sync: auto-sync from GURU-5070 at 2026-06-04 07:59:53
Author: Mike Swanson Machine: GURU-5070 Timestamp: 2026-06-04 07:59:53
This commit is contained in:
@@ -65,3 +65,46 @@ None discovered or created this session. (Prior-day note still stands: the MSP36
|
||||
- Commits: gururmm `9671c4b` (top-5), `d2d10e3` (size sweep); ClaudeTools `8fb45e4`, `13f992c`; build SHAs `fa901e28` (v0.2.37), `fc76b7fb` (v0.2.38).
|
||||
- Human-flow skill: `.claude/skills/human-flow/` (scanner `scripts/scan.mjs`, heuristics `references/mouse-keyboard-heuristics.md`).
|
||||
- Prior-day session log: `session-logs/2026-06-03-session.md` (beta channel + Grok post-mortem + MSP360/B2 cleanup).
|
||||
|
||||
## Update: 07:59 PDT — Grok CLI integration (capability router + per-machine flag)
|
||||
|
||||
### Summary
|
||||
Explored and built Claude->Grok delegation using the locally-installed Grok CLI (`grok.exe`, xAI, "Grok Build TUI" 0.2.20). Discovered the binary at `C:\Users\guru\.grok\bin\grok.exe` (not on PATH; OIDC/grok.com login at `~/.grok/auth.json`, ~6h refresh, team account mike@azcomputerguru.com — NO developer API key). Learned the CLI surface (`--prompt-file`, `--output-format json`, `-p/--single`, `agent` subcommand, scoping flags). `grok inspect` showed Grok natively reads the Claude harness here (CLAUDE.md, settings.local.json 69 perms, all 52 skills).
|
||||
|
||||
Per Mike's suggestion, interviewed the Grok agent itself (headless) — its leaked system-prompt tool list overturned an earlier wrong conclusion (I'd said the CLI was text-only and needed an API key). It has native media tools. VERIFIED live, no API key: `image_gen` produced a correct 1024x1024 red-circle JPG; `image_to_video` produced a 6.04s 544x544 H.264+AAC MP4 from it. Also has `web_search`/`web_fetch` + X/Twitter tools (xsearch returned the current Rust version 1.96.0 with x.com citations). Artifacts land in `~/.grok/sessions/<url-encoded-cwd>/<sessionId>/{images,videos}/`.
|
||||
|
||||
Built the `/grok` capability-router skill: `.claude/skills/grok/SKILL.md` + `scripts/ask-grok.sh` (modes: text, verify, image, video, xsearch, raw). All five modes tested working end-to-end. Then added a per-machine availability flag: `identity.json` `grok` block, with `migrate-identity.sh` auto-detecting Grok so every fleet machine self-populates `grok.installed` (false where absent); the wrapper is identity-aware (exits 3 with routing guidance on non-Grok machines). Remote routing (so other fleet machines could use this host's Grok) was DEFERRED.
|
||||
|
||||
### Key Decisions
|
||||
- Grok = capability EXTENSION (image/video, live web+X data, independent second model), not a replacement for Claude's coding/editing. Pure classify/extract stays on Tier-0 Ollama; repo code stays with Claude's agents.
|
||||
- Prompts to grok ALWAYS via `--prompt-file` (inline args break on shell quoting). Parse grok JSON via stdin (Windows `py` can't open git-bash `/c/...` paths). Retrieve media artifacts by sessionId glob (robust against the headless `stopReason: Cancelled` finalization quirk). Override the config's `permission_mode = "always-approve"` with `--permission-mode dontAsk --no-subagents`.
|
||||
- Per-machine flag lives in `identity.json` (gitignored, local); auto-detected by `migrate-identity.sh` (preserves manual `is_fleet_host`). Fleet host advertised in SKILL.md (currently GURU-5070, the only install).
|
||||
- Deferred remote routing: only this workstation drives Claude+Grok now; the relay (esp. image/video artifact transport back to a requesting machine) isn't worth building yet. Per the SBS post-mortem, never delegate unsupervised destructive work to Grok; always review its output.
|
||||
|
||||
### Problems Encountered
|
||||
- `grok` / `agent` not on PATH -> located the binary by filesystem search.
|
||||
- `--effort high` -> 400 "grok-build does not support reasoningEffort"; dropped it.
|
||||
- Headless `-p` reported `Cancelled` after generating media but before echoing the path -> solved by retrieving artifacts via sessionId glob of the session dir.
|
||||
- ask-grok.sh bugs found via testing: `set -u` tripped on unbound `$USER` (guarded); Windows `py` couldn't open the `/c/...` json path (switched to stdin); `--disallowed-tools`/`--rules`/`--check` tripped/slowed the CLI (replaced with prompt-level steering). All fixed; modes re-verified.
|
||||
|
||||
### Configuration Changes
|
||||
- NEW `.claude/skills/grok/SKILL.md`, `.claude/skills/grok/scripts/ask-grok.sh`
|
||||
- EDIT `.claude/scripts/migrate-identity.sh` (Grok auto-detect -> identity.json `grok` block)
|
||||
- EDIT `.claude/identity.json` (added `grok` block; gitignored/local — does NOT sync)
|
||||
|
||||
### Commands & Outputs
|
||||
- Headless text: `grok --prompt-file <f> --output-format json` -> `{"text":"...","sessionId":"..."}`.
|
||||
- Router: `bash .claude/skills/grok/scripts/ask-grok.sh {text|verify|image|video|xsearch} ...`.
|
||||
- Verified: image -> 1024x1024 JPEG; video -> 6.04s 544x544 H.264 MP4 (ffprobe); xsearch -> live Rust 1.96.0 + citations.
|
||||
- `migrate-identity.sh` -> "Grok: installed (C:/Users/guru/.grok/bin/grok.exe)", grok.installed: true, is_fleet_host preserved.
|
||||
|
||||
### Pending / Incomplete Tasks
|
||||
- Remote routing DEFERRED (candidates: GuruRMM agent command / `grok agent serve` / coord job queue; artifact transport is the hard part).
|
||||
- Existing fleet machines should re-run `migrate-identity.sh` to populate `grok.installed` (else they hit a generic "grok not found" instead of the exit-3 routing message). Optional: have `/self-check` flag a missing `grok` block.
|
||||
- Untested Grok tools: `image_edit`, `reference_to_video`. Optional `/grok` slash-command alias.
|
||||
- Carried over: human-flow promote beta->prod when ready; MSP360/B2 follow-ups (coord todos 2e50f388 / dc3a6233 / 0fed5eb2); SBS portal removal (db03f8fe); rotate leaked MSP360 API key.
|
||||
|
||||
### Reference Information
|
||||
- Grok binary `~/.grok/bin/grok.exe` (0.2.20); auth `~/.grok/auth.json` (OIDC); config `~/.grok/config.toml` (`permission_mode=always-approve`, model grok-build). Models: grok-build (default), grok-composer-2.5-fast; agent self-reports Grok 4.3.
|
||||
- Native tools: image_gen, image_edit, image_to_video, reference_to_video, web_search, web_fetch, x_keyword_search, x_semantic_search, x_user_search, x_thread_fetch, run_terminal_command, file ops, scheduler_*, monitor, memory.
|
||||
- Skill: `.claude/skills/grok/`. Fleet Grok host: GURU-5070 (only install).
|
||||
|
||||
Reference in New Issue
Block a user