grok-bot-cli 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,34 @@
1
1
  ---
2
2
  name: talk-to-grok-bot
3
- description: Send or read Grok Bot threads via gbot_send/gbot_thread and Codex daemon threads via codex_send/codex_threads. Use when handing off to a named bot/group or posting a status note agents watch — not for work you can finish yourself.
3
+ description: Message Grok Bot, Codex threads, or opted-in local Claude Code channels. Use when handing off to a named bot/group or posting a status note agents watch — not for work you can finish yourself.
4
4
  ---
5
5
  # Talk to Grok Bot
6
6
 
7
- MCP tools on the `grok-bot` server use the same gateway as the `gbot` CLI.
7
+ The `grok-bot` MCP server and `gbot` CLI share Grok gateway access. Codex and
8
+ Claude tools use **local sockets only** on the user's registered machines.
9
+
10
+ ## MCP instructions (Codex / Claude)
11
+
12
+ gbot connects only to a local Unix socket
13
+ (`$CODEX_HOME/app-server-control/app-server-control.sock`, or
14
+ `CODEX_APP_SERVER_SOCK`). There is **no remote transport**.
15
+
16
+ - Codex app-server threads and opted-in Claude Code channels live on the user's
17
+ registered computers (Linux desktop, Mac, …) — **never** on the Grok Bot agent
18
+ box (`HOME=/home/box`, no Codex install).
19
+ - When this MCP server is running on the box, **do not** call `codex_*` or
20
+ `claude_send`. Run the `gbot` CLI on the user's machine through **Grok Bot Shell
21
+ with a machineId** (the host's machine-targeted shell).
22
+ - On that machine, provide the socket with `codex app-server daemon start` (or
23
+ bootstrap). Auth stays with each machine's native Codex or Claude login.
8
24
 
9
25
  ## When to load this
10
26
 
11
27
  - The repo or task names a bot as owner, or you need a decision only that thread holds.
12
28
  - You want a short status note in a shared group other agents watch.
13
29
 
14
- Do not ping a bot for work you can finish yourself. Replies are asynchronous — never block a turn waiting.
30
+ Do not ping a bot for work you can finish yourself. Grok replies are asynchronous;
31
+ continue useful work instead of waiting or polling.
15
32
 
16
33
  ## How
17
34
 
@@ -27,42 +44,17 @@ Do not ping a bot for work you can finish yourself. Replies are asynchronous —
27
44
  Read `gbot_thread` later, using `after` for a known cursor and `full: true` only
28
45
  when entry bodies are needed. `replyMode: manual` explicitly requests this flow.
29
46
 
30
- Automatic routes start a durable background worker that survives the calling tool.
31
- Use `gbot_bridge_status` to distinguish delivery from execution and return delivery,
32
- and to inspect gaps, paused routes and pending interactions. Do not resend unknown
33
- submissions under a new identity. A provided `requestId` safely replays identical
34
- tracked input; `controlRequestId` is returned independently of the gateway request ID.
35
- `gbot_bridge_stop` stops a `bindingId`; `worker: true` explicitly stops the process.
36
- Neither deletes receipts nor interrupts a Codex turn. No login service is installed;
37
- if the process dies, the next tracked send/start resumes saved routes.
38
-
39
- `gbot_codex_respond` is only for an explicit operator response to a current scoped
40
- interaction. Copy the advertised interactionId, generation, threadId, turnId and
41
- bindingId/exchangeId. Use one-time `decision: accept|decline|cancel`, or `answersJson`
42
- with exact question IDs mapped to `{"answers":["answer"]}`. Never auto-approve,
43
- change session permissions, or respond to an unsupported interaction; use its owning UI.
44
-
45
- Bot replies are `send-message` entries; yours are `message` with `role: user`.
46
-
47
- Grok-origin approvals are separate from Codex interactions. `gbot_grok_approvals`
48
- (CLI: `gbot approvals list TARGET`) lists pending auto-review and local-tool cards in
49
- the latest 200 entries. Linked/tracked routes forward new pending cards as notices;
50
- their chat answers never authorize an action. After an explicit user decision, use
51
- `gbot_grok_respond` (CLI: `gbot approvals respond --target TARGET --entry-id ID
52
- --request-id ID --decision accept|decline`). Copy the exact IDs from the current
53
- card. Accept grants once; persistent grants are unavailable. Responses recheck the
54
- card before sending; delivery success does not prove execution. Older cards,
55
- cookie/payment approvals and other unsupported requests require the owning Grok UI.
47
+ Never resend an unknown submission under a new identity. Inspect delivery with
48
+ `gbot_bridge_status`. Never infer permission from chat replies or auto-approve a
49
+ Codex/Grok interaction; keep approvals in the owning UI unless the user explicitly
50
+ authorizes a scoped response.
56
51
 
57
- List targets with `gbot bots list` / `gbot groups list` when the name is ambiguous.
58
-
59
- ## CLI automation
52
+ Read [bridge administration](references/bridge-administration.md) before starting,
53
+ stopping, diagnosing or answering approvals on a managed bridge, or using direct
54
+ Codex conversation tools. It covers exact approval IDs, idempotent requests, guarded
55
+ steering, CLI output, and host limitations. Ordinary Grok sends need no reference.
60
56
 
61
- The bundled `gbot` and `gbot-install` executables require Node.js 22.19.0 or newer.
62
- For `gbot send`, `gbot codex status`, and `gbot codex send` with `--json`, read the result
63
- document from stdout and branch on its `exitCode`, `mode`, `reason`, and `delivery`.
64
- Framework argument/schema errors use stderr and exit 2. `--json` is reserved before
65
- `--`; put `--` before flag-like message text.
57
+ List targets with `gbot bots list` / `gbot groups list` when the name is ambiguous.
66
58
 
67
59
  ## Auth
68
60
 
@@ -70,50 +62,14 @@ Same order as `gbot`: `GROK_BOT_GATEWAY_URL` plus `GROK_BOT_GATEWAY_TOKEN`,
70
62
  else the Grok Bot app session, else `CURSOR_ACCESS_TOKEN`. `gbot doctor` shows
71
63
  which source is present.
72
64
 
73
- ## Codex conversation tools
74
-
75
- The generated Codex, Cursor, and Claude plugins and portable MCP artifact expose these
76
- additional tools on the same `grok-bot` MCP server. Codex tools use the local Codex
77
- app-server control socket; Grok tools use the Grok gateway. Portable MCP artifacts
78
- must be configured in an MCP-capable host; they are not automatically loaded by the Grok app.
79
-
80
- - `codex_threads`: bounded discovery of daemon-managed Codex threads.
81
- - `codex_send`: submit a message with a correlation envelope. Default delivery is
82
- immediate acceptance, which does not mean execution finished. `wait: true` adds
83
- bounded execution and final reply fields. An accepted message remains accepted
84
- when observation times out or execution fails.
85
- - `codex_wait`: explicitly observe a known thread/turn and recover its final output.
86
- - `codex_watch`: diagnostic observation of bounded thread events. It never answers approvals.
87
-
88
- Use `expectedCwd` to verify the destination workspace. Busy sends reject by default;
89
- `whenBusy: queue` needs `GROK_BOT_CODEX_EXPERIMENTAL=1`. Explicit `whenBusy: steer`
90
- requires `expectedTurnId` and visibly rejects a stale guard without retrying another turn.
91
- Final replies omit commentary/reasoning; older phase-null agent messages are a fallback
92
- only after terminal execution. Inspect `reply.truncated` and execution errors for coverage limits.
93
-
94
- CLI equivalents are `gbot codex send --wait --timeout-ms 1000 THREAD_ID hello --json`,
95
- `gbot codex wait --timeout-ms 1000 THREAD_ID TURN_ID --json`, and
96
- `gbot codex watch --timeout-ms 1000 --max-events 20 THREAD_ID --json`.
97
- Use framework `--ndjson` for progress. Wait/watch are explicit diagnostics; automatic
98
- background reply routing uses the managed tools above. `codex_send` with `replyToGrok` or `bindingId` returns its terminal answer automatically; without either it retains the explicit observation flow. Managed routes default to guarded steering; ordinary sends still reject busy work by default.
99
-
100
- `gbot codex bridge start/status/stop/respond` provide the same administration controls.
101
- CLI auto-routing requires explicit `gbot send --reply-mode auto --codex-thread-id ID`.
102
- `bridge run` is foreground and bounded (`--lifetime-ms`, default/maximum 23 hours).
103
- The packaged `scripts/gbot-relay.mjs` is the unlimited foreground service entry.
104
- Grok participation is through its gateway conversation, not an assumed native Grok
105
- plugin loader or remote MCP tunnel. Never claim a host loaded a plugin from generated
106
- configuration alone.
107
-
108
- Managed Codex return routes reject `expectedTurnId` and legacy `replyTo`/`envelope`
109
- options before submission; use plain `codex_send` for a caller-selected turn guard.
110
- An explicit Grok target supplied with `bindingId` must resolve to the binding's
111
- recipient. A mismatch fails instead of selecting one destination silently.
112
-
113
- ## Host tool inventory
114
-
115
- Codex MCP clients receive Grok messaging and approval tools; truthfully identified
116
- Grok Bot clients receive Codex messaging and approval tools. Bridge start/status/stop
117
- remain shared. Cursor and unknown clients retain both sets. Filtering uses negotiated
118
- client-name prefixes and does not provide authorization. A Grok runtime identifying
119
- itself as Cursor needs its native MCP identity corrected before this filter applies.
65
+ ## Claude Code channel
66
+
67
+ `claude_send` sends to a named live Claude Code session on the user's registered
68
+ machine (local socket under `~/.grok-bot-cli/claude/`) and waits for its explicit
69
+ `claude_reply`. From the Grok Bot box, do not call this tool — use Grok Bot Shell
70
+ with a machineId to run `gbot claude send` on that machine instead. The destination
71
+ must enable the native `claude-channel` with `GROK_BOT_CLAUDE_CHANNEL=NAME` and
72
+ Claude's development-channel opt-in. Supply `name`, `message`, and optional
73
+ `timeoutMs` (1..120000). `replied` means the reply tool ran; `unknown` is not
74
+ rejection and must not be automatically retried. Normal Claude tool approvals remain
75
+ in its session. CLI: `gbot claude send NAME "message" --json`.
@@ -0,0 +1,89 @@
1
+ # Bridge administration and diagnostics
2
+
3
+ Automatic routes start a durable background worker that survives the calling tool.
4
+ Use `gbot_bridge_status` to distinguish delivery from execution and return delivery,
5
+ and to inspect gaps, paused routes and pending interactions. Do not resend unknown
6
+ submissions under a new identity. A provided `requestId` safely replays identical
7
+ tracked input; `controlRequestId` is returned independently of the gateway request ID.
8
+ `gbot_bridge_stop` stops a `bindingId`; `worker: true` explicitly stops the process.
9
+ Neither deletes receipts nor interrupts a Codex turn. No login service is installed;
10
+ if the process dies, the next tracked send/start resumes saved routes.
11
+
12
+ `gbot_codex_respond` is only for an explicit operator response to a current scoped
13
+ interaction. Copy the advertised interactionId, generation, threadId, turnId and
14
+ bindingId/exchangeId. Use one-time `decision: accept|decline|cancel`, or `answersJson`
15
+ with exact question IDs mapped to `{"answers":["answer"]}`. Never auto-approve,
16
+ change session permissions, or respond to an unsupported interaction; use its owning UI.
17
+
18
+ Bot replies are `send-message` entries; yours are `message` with `role: user`.
19
+
20
+ Grok-origin approvals are separate from Codex interactions. `gbot_grok_approvals`
21
+ (CLI: `gbot approvals list TARGET`) lists pending auto-review and local-tool cards in
22
+ the latest 200 entries. Linked/tracked routes forward new pending cards as notices;
23
+ their chat answers never authorize an action. After an explicit user decision, use
24
+ `gbot_grok_respond` (CLI: `gbot approvals respond --target TARGET --entry-id ID
25
+ --request-id ID --decision accept|decline`). Copy the exact IDs from the current
26
+ card. Accept grants once; persistent grants are unavailable. Responses recheck the
27
+ card before sending; delivery success does not prove execution. Older cards,
28
+ cookie/payment approvals and other unsupported requests require the owning Grok UI.
29
+
30
+ ## Codex conversation tools
31
+
32
+ The generated Codex, Cursor, and Claude plugins and portable MCP artifact expose these
33
+ additional tools on the same `grok-bot` MCP server. Codex tools connect only to a
34
+ **local** Codex app-server control socket on the process's machine
35
+ (`$CODEX_HOME/...` or `CODEX_APP_SERVER_SOCK`). gbot has **no remote transport**.
36
+ When the MCP server runs on the Grok Bot agent box (`HOME=/home/box`), do not call
37
+ these tools — run the `gbot` CLI on the user's registered machine through Grok Bot
38
+ Shell with a machineId, after `codex app-server daemon start` (or bootstrap) there.
39
+ Grok tools use the Grok gateway. Portable MCP artifacts must be configured in an
40
+ MCP-capable host; they are not automatically loaded by the Grok app.
41
+
42
+ - `codex_threads`: bounded discovery of daemon-managed Codex threads.
43
+ - `codex_send`: submit a message with a correlation envelope. Default delivery is
44
+ immediate acceptance, which does not mean execution finished. `wait: true` adds
45
+ bounded execution and final reply fields. An accepted message remains accepted
46
+ when observation times out or execution fails.
47
+ - `codex_wait`: explicitly observe a known thread/turn and recover its final output.
48
+ - `codex_watch`: diagnostic observation of bounded thread events. It never answers approvals.
49
+
50
+ Use `expectedCwd` to verify the destination workspace. Busy sends reject by default;
51
+ `whenBusy: queue` needs `GROK_BOT_CODEX_EXPERIMENTAL=1`. Explicit `whenBusy: steer`
52
+ requires `expectedTurnId` and visibly rejects a stale guard without retrying another turn.
53
+ Final replies omit commentary/reasoning; older phase-null agent messages are a fallback
54
+ only after terminal execution. Inspect `reply.truncated` and execution errors for coverage limits.
55
+
56
+ CLI equivalents are `gbot codex send --wait --timeout-ms 1000 THREAD_ID hello --json`,
57
+ `gbot codex wait --timeout-ms 1000 THREAD_ID TURN_ID --json`, and
58
+ `gbot codex watch --timeout-ms 1000 --max-events 20 THREAD_ID --json`.
59
+ Use framework `--ndjson` for progress. Wait/watch are explicit diagnostics; automatic
60
+ background reply routing uses the managed tools above. `codex_send` with `replyToGrok` or `bindingId` returns its terminal answer automatically; without either it retains the explicit observation flow. Managed routes default to guarded steering; ordinary sends still reject busy work by default.
61
+
62
+ `gbot codex bridge start/status/stop/respond` provide the same administration controls.
63
+ CLI auto-routing requires explicit `gbot send --reply-mode auto --codex-thread-id ID`.
64
+ `bridge run` is foreground and bounded (`--lifetime-ms`, default/maximum 23 hours).
65
+ The packaged `scripts/gbot-relay.mjs` is the unlimited foreground service entry.
66
+ Grok participation is through its gateway conversation, not an assumed native Grok
67
+ plugin loader or remote MCP tunnel. Never claim a host loaded a plugin from generated
68
+ configuration alone.
69
+
70
+ Managed Codex return routes reject `expectedTurnId` and legacy `replyTo`/`envelope`
71
+ options before submission; use plain `codex_send` for a caller-selected turn guard.
72
+ An explicit Grok target supplied with `bindingId` must resolve to the binding's
73
+ recipient. A mismatch fails instead of selecting one destination silently.
74
+
75
+ ## CLI automation
76
+
77
+ The bundled `gbot` and `gbot-install` executables require Node.js 22.19.0 or newer.
78
+ For `gbot send`, `gbot codex status`, and `gbot codex send` with `--json`, read the result
79
+ document from stdout and branch on its `exitCode`, `mode`, `reason`, and `delivery`.
80
+ Framework argument/schema errors use stderr and exit 2. `--json` is reserved before
81
+ `--`; put `--` before flag-like message text.
82
+
83
+ ## Host tool inventory
84
+
85
+ Codex MCP clients receive Grok messaging and approval tools; truthfully identified
86
+ Grok Bot clients receive Codex messaging and approval tools. Bridge start/status/stop
87
+ remain shared. Cursor and unknown clients retain both sets. Filtering uses negotiated
88
+ client-name prefixes and does not provide authorization. A Grok runtime identifying
89
+ itself as Cursor needs its native MCP identity corrected before this filter applies.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grok-bot-cli",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "CLI and Agent Bundle plugin for Grok Bot agents and groups: create, update, message, inspect threads, and automate cleanup",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,6 +18,7 @@
18
18
  "gbot": "node dist/bin/gbot.mjs",
19
19
  "prepack": "agent-bundle prepack",
20
20
  "release": "changeset publish",
21
+ "release:version": "changeset version && npm run build && npm run validate:artifact",
21
22
  "test": "npm run test:unit && npm run test:routes",
22
23
  "test:routes": "rstest --config rstest.route-unit.config.ts",
23
24
  "test:unit": "node scripts/run-unit-tests.mjs",
@@ -54,12 +55,13 @@
54
55
  "LICENSE"
55
56
  ],
56
57
  "devDependencies": {
57
- "@agent-bundle/runtime": "https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@ab5ae66e1d9c2829a092640c586e2b3eacc4be88",
58
+ "@agent-bundle/runtime": "https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@899755dc6d",
58
59
  "@changesets/cli": "3.0.3",
60
+ "@modelcontextprotocol/server": "2.1.0",
59
61
  "@rstest/core": "0.11.12",
60
62
  "@types/node": "^24.0.0",
61
63
  "@types/react": "^19.2.18",
62
- "agent-bundle": "https://pkg.pr.new/ScriptedAlchemy/agent-bundle/agent-bundle@ab5ae66e1d9c2829a092640c586e2b3eacc4be88",
64
+ "agent-bundle": "https://pkg.pr.new/ScriptedAlchemy/agent-bundle/agent-bundle@899755dc6d",
63
65
  "react": "19.3.0",
64
66
  "react-dom": "19.3.0",
65
67
  "typescript": "7.0.2",