grok-bot-cli 0.6.0 → 0.8.0

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.
@@ -13650,6 +13650,37 @@ __webpack_require__.d(__webpack_exports__, {
13650
13650
  });
13651
13651
 
13652
13652
 
13653
+ },
13654
+ "./src/core/grok-approval-routes.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
13655
+ /* import */ var zod__rspack_import_3 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
13656
+ /* import */ var _gateway_js__rspack_import_0 = __webpack_require__("./src/core/gateway.js");
13657
+ /* import */ var _grok_approvals_js__rspack_import_1 = __webpack_require__("./src/core/grok-approvals.js");
13658
+ /* import */ var _gbot_js__rspack_import_2 = __webpack_require__("./src/gbot.ts");
13659
+
13660
+
13661
+
13662
+
13663
+ const listSchema = zod__rspack_import_3/* .strictObject */.rej({
13664
+ target: zod__rspack_import_3/* .string */.YjP().min(1).max(1024)
13665
+ });
13666
+ const respondSchema = _grok_approvals_js__rspack_import_1/* .grokApprovalResponseSchema */.T5;
13667
+ const resultSchema = zod__rspack_import_3/* .record */.g1P(zod__rspack_import_3/* .string */.YjP(), zod__rspack_import_3/* .json */.Pq9());
13668
+ const listOperation = (input)=>(0,_gbot_js__rspack_import_2/* .withRedactedErrors */.yF)(async ()=>(0,_gateway_js__rspack_import_0/* .listGrokApprovals */.MI)(await (0,_gateway_js__rspack_import_0/* .connectGateway */.Vq)(), listSchema.parse(input).target));
13669
+ const respondOperation = (input)=>(0,_gbot_js__rspack_import_2/* .withRedactedErrors */.yF)(async ()=>{
13670
+ const { target, ...response } = respondSchema.parse(input);
13671
+ return (0,_gateway_js__rspack_import_0/* .respondGrokApproval */.OR)(await (0,_gateway_js__rspack_import_0/* .connectGateway */.Vq)(), target, response);
13672
+ });
13673
+
13674
+ __webpack_require__.d(__webpack_exports__, {
13675
+ }, {
13676
+ FD: resultSchema,
13677
+ cE: listSchema,
13678
+ gi: listOperation,
13679
+ lr: respondOperation,
13680
+ v1: respondSchema
13681
+ });
13682
+
13683
+
13653
13684
  },
13654
13685
  "./src/core/relay/routes.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
13655
13686
  /* import */ var _agent_bundle_runtime__rspack_import_4 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/40.js");
@@ -13968,6 +13999,9 @@ const resultSchema = zod__rspack_import_4/* .union */.KCZ([
13968
13999
  _core_relay_routes_js__rspack_import_3/* .relayResultSchema */.Ax
13969
14000
  ]);
13970
14001
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
14002
+ excludeClients: [
14003
+ 'codex'
14004
+ ],
13971
14005
  description: 'Send to Codex. With replyToGrok or bindingId, managed delivery returns the terminal answer to Grok automatically. Otherwise optional wait observes completion and explicit steer requires expectedTurnId. Acceptance is not completion.',
13972
14006
  title: 'Codex send',
13973
14007
  annotations: {
@@ -14085,6 +14119,9 @@ __webpack_require__.r(__webpack_exports__);
14085
14119
 
14086
14120
 
14087
14121
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
14122
+ excludeClients: [
14123
+ 'codex'
14124
+ ],
14088
14125
  description: 'Discover a bounded page of Codex daemon threads.',
14089
14126
  title: 'Codex threads',
14090
14127
  annotations: {
@@ -14141,6 +14178,9 @@ __webpack_require__.r(__webpack_exports__);
14141
14178
 
14142
14179
 
14143
14180
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
14181
+ excludeClients: [
14182
+ 'codex'
14183
+ ],
14144
14184
  description: 'Explicit diagnostic observation of one Codex turn; returns execution and final reply without interrupting it.',
14145
14185
  title: 'Codex wait',
14146
14186
  annotations: {
@@ -14215,6 +14255,9 @@ __webpack_require__.r(__webpack_exports__);
14215
14255
 
14216
14256
 
14217
14257
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
14258
+ excludeClients: [
14259
+ 'codex'
14260
+ ],
14218
14261
  description: 'Watch bounded Codex thread events for diagnostics without answering approvals.',
14219
14262
  title: 'Codex watch',
14220
14263
  annotations: {
@@ -14451,6 +14494,9 @@ __webpack_require__.r(__webpack_exports__);
14451
14494
 
14452
14495
 
14453
14496
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
14497
+ excludeClients: [
14498
+ 'codex'
14499
+ ],
14454
14500
  description: 'Explicit operator response to a current scoped Codex interaction. Supports only one-time accept/decline/cancel or exact question-ID answers. Never auto-approve.',
14455
14501
  title: 'gbot_codex_respond',
14456
14502
  annotations: {
@@ -14517,6 +14563,130 @@ __webpack_require__.d(__webpack_exports__, {
14517
14563
  });
14518
14564
 
14519
14565
 
14566
+ },
14567
+ "./src/mcp/grok-bot/tools/gbot_grok_approvals.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
14568
+ __webpack_require__.r(__webpack_exports__);
14569
+ /* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.react-server.js");
14570
+ /* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
14571
+ /* import */ var agent_bundle_routes__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/routes.js");
14572
+ /* import */ var _core_grok_approval_routes_js__rspack_import_2 = __webpack_require__("./src/core/grok-approval-routes.ts");
14573
+
14574
+
14575
+
14576
+
14577
+
14578
+ /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
14579
+ excludeClients: [
14580
+ 'grok bot',
14581
+ 'grokbot',
14582
+ 'grok-bot'
14583
+ ],
14584
+ title: 'Pending Grok approvals',
14585
+ description: 'List pending auto-review and local-tool approval cards in the latest 200 entries for a Grok bot. Older or unsupported requests require the owning Grok UI.',
14586
+ annotations: {
14587
+ readOnlyHint: true
14588
+ },
14589
+ inputSchema: _core_grok_approval_routes_js__rspack_import_2/* .listSchema */.cE,
14590
+ resultSchema: _core_grok_approval_routes_js__rspack_import_2/* .resultSchema */.FD,
14591
+ inputJsonSchema: {
14592
+ type: 'object',
14593
+ properties: {
14594
+ target: {
14595
+ type: 'string'
14596
+ }
14597
+ },
14598
+ required: [
14599
+ 'target'
14600
+ ],
14601
+ additionalProperties: false
14602
+ }
14603
+ }, async (input)=>{
14604
+ const out = await (0,_core_grok_approval_routes_js__rspack_import_2/* .listOperation */.gi)(input);
14605
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
14606
+ value: out,
14607
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
14608
+ children: JSON.stringify(out)
14609
+ })
14610
+ });
14611
+ }));
14612
+
14613
+ __webpack_require__.d(__webpack_exports__, {
14614
+ inputSchema: () => (/* reexport safe */ _core_grok_approval_routes_js__rspack_import_2.cE)
14615
+ }, {
14616
+ "default": __rspack_default_export
14617
+ });
14618
+
14619
+
14620
+ },
14621
+ "./src/mcp/grok-bot/tools/gbot_grok_respond.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
14622
+ __webpack_require__.r(__webpack_exports__);
14623
+ /* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.react-server.js");
14624
+ /* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
14625
+ /* import */ var agent_bundle_routes__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/routes.js");
14626
+ /* import */ var _core_grok_approval_routes_js__rspack_import_2 = __webpack_require__("./src/core/grok-approval-routes.ts");
14627
+
14628
+
14629
+
14630
+
14631
+
14632
+ /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
14633
+ excludeClients: [
14634
+ 'grok bot',
14635
+ 'grokbot',
14636
+ 'grok-bot'
14637
+ ],
14638
+ title: 'Respond to Grok approval',
14639
+ description: 'Only after an explicit user decision: accept one current Grok approval once or decline it. Exact target, entryId and approval requestId required. Never auto-approve or grant persistent permissions. Success acknowledges response delivery, not execution.',
14640
+ annotations: {
14641
+ readOnlyHint: false
14642
+ },
14643
+ inputSchema: _core_grok_approval_routes_js__rspack_import_2/* .respondSchema */.v1,
14644
+ resultSchema: _core_grok_approval_routes_js__rspack_import_2/* .resultSchema */.FD,
14645
+ inputJsonSchema: {
14646
+ type: 'object',
14647
+ properties: {
14648
+ target: {
14649
+ type: 'string'
14650
+ },
14651
+ entryId: {
14652
+ type: 'string'
14653
+ },
14654
+ requestId: {
14655
+ type: 'string'
14656
+ },
14657
+ decision: {
14658
+ type: 'string',
14659
+ enum: [
14660
+ 'accept',
14661
+ 'decline'
14662
+ ]
14663
+ }
14664
+ },
14665
+ required: [
14666
+ 'target',
14667
+ 'entryId',
14668
+ 'requestId',
14669
+ 'decision'
14670
+ ],
14671
+ additionalProperties: false
14672
+ }
14673
+ }, async (input)=>{
14674
+ const out = await (0,_core_grok_approval_routes_js__rspack_import_2/* .respondOperation */.lr)(input);
14675
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
14676
+ value: out,
14677
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
14678
+ children: JSON.stringify(out)
14679
+ })
14680
+ });
14681
+ }));
14682
+
14683
+ __webpack_require__.d(__webpack_exports__, {
14684
+ inputSchema: () => (/* reexport safe */ _core_grok_approval_routes_js__rspack_import_2.v1)
14685
+ }, {
14686
+ "default": __rspack_default_export
14687
+ });
14688
+
14689
+
14520
14690
  },
14521
14691
  "./src/mcp/grok-bot/tools/gbot_send.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
14522
14692
  __webpack_require__.r(__webpack_exports__);
@@ -14531,6 +14701,11 @@ __webpack_require__.r(__webpack_exports__);
14531
14701
 
14532
14702
 
14533
14703
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
14704
+ excludeClients: [
14705
+ 'grok bot',
14706
+ 'grokbot',
14707
+ 'grok-bot'
14708
+ ],
14534
14709
  description: 'Send to Grok Bot. Native Codex calls automatically receive replies in their originating thread; send once and continue work. Without a native source, supply codexThreadId or use manual gbot_thread reading.',
14535
14710
  title: 'Send a message to Grok Bot',
14536
14711
  annotations: {
@@ -14619,6 +14794,11 @@ const inputSchema = zod__rspack_import_3/* .object */.Ikc({
14619
14794
  target: zod__rspack_import_3/* .string */.YjP().min(1)
14620
14795
  });
14621
14796
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
14797
+ excludeClients: [
14798
+ 'grok bot',
14799
+ 'grokbot',
14800
+ 'grok-bot'
14801
+ ],
14622
14802
  annotations: {
14623
14803
  readOnlyHint: true
14624
14804
  },
@@ -17164,7 +17344,7 @@ function strictObject(shape, params) {
17164
17344
  type: "object",
17165
17345
  shape,
17166
17346
  catchall: never(),
17167
- ...util.normalizeParams(params),
17347
+ ..._core_index_js__rspack_import_4/* .normalizeParams */.A2(params),
17168
17348
  });
17169
17349
  }
17170
17350
  // looseObject
@@ -17798,6 +17978,7 @@ __webpack_require__.d(__webpack_exports__, {
17798
17978
  euz: () => (literal),
17799
17979
  g1P: () => (record),
17800
17980
  k5n: () => (_enum),
17981
+ rej: () => (strictObject),
17801
17982
  zMY: () => (boolean)
17802
17983
  });
17803
17984
 
@@ -27079,10 +27260,10 @@ function listDesktopProcesses(timeoutMs = DESKTOP_PROCESS_LIST_TIMEOUT_MS) {
27079
27260
  const lines = Array.isArray(listProcesses) ? listProcesses : String(listProcesses ?? "").split(/\r?\n/);
27080
27261
  for (const line of lines){
27081
27262
  if (!/app-server/.test(line)) continue;
27082
- // Desktop's bundled binary, Mac or Windows-style separators with optional .exe.
27263
+ // Desktop's bundled binary only (Mac/Windows separators, optional .exe).
27264
+ // Do NOT match probe shells whose cmdline merely mentions ChatGPT.app +
27265
+ // app-server + codex-app-tools — that false-positives MATCH2 / Scout noise.
27083
27266
  if (/ChatGPT\.app[\\/].*Resources[\\/]codex(\.exe)?(["'\s]|$)/.test(line)) return "private-stdio";
27084
- // Same app-server line owned by ChatGPT.app carrying the app-tools override.
27085
- if (/ChatGPT\.app/.test(line) && /(codex_app|mcp_servers\.codex_app|codex-app-tools)/.test(line)) return "private-stdio";
27086
27267
  }
27087
27268
  return "unknown";
27088
27269
  }
@@ -28769,10 +28950,12 @@ function socketStateOf(path) {
28769
28950
  },
28770
28951
  "./src/core/gateway.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
28771
28952
  /* import */ var node_crypto__rspack_import_0 = __webpack_require__("node:crypto");
28772
- /* import */ var _headers_js__rspack_import_4 = __webpack_require__("./src/core/headers.js");
28953
+ /* import */ var _headers_js__rspack_import_5 = __webpack_require__("./src/core/headers.js");
28773
28954
  /* import */ var _app_session_js__rspack_import_1 = __webpack_require__("./src/core/app-session.js");
28774
28955
  /* import */ var _store_js__rspack_import_2 = __webpack_require__("./src/core/store.js");
28775
28956
  /* import */ var _url_policy_js__rspack_import_3 = __webpack_require__("./src/core/url-policy.js");
28957
+ /* import */ var _grok_approvals_js__rspack_import_4 = __webpack_require__("./src/core/grok-approvals.js");
28958
+
28776
28959
 
28777
28960
 
28778
28961
 
@@ -28822,7 +29005,7 @@ function gatewayOverride() {
28822
29005
  kind: "gateway"
28823
29006
  }),
28824
29007
  gatewayToken: token,
28825
- gatewayHeaders: (0,_headers_js__rspack_import_4/* .headersFromEnv */.gx)()
29008
+ gatewayHeaders: (0,_headers_js__rspack_import_5/* .headersFromEnv */.gx)()
28826
29009
  };
28827
29010
  }
28828
29011
  return null;
@@ -28843,7 +29026,7 @@ function sessionFromApp() {
28843
29026
  kind: "gateway"
28844
29027
  }),
28845
29028
  gatewayToken: loaded.gatewayToken,
28846
- gatewayHeaders: (0,_headers_js__rspack_import_4/* .mergeGatewayHeaders */.bQ)((0,_headers_js__rspack_import_4/* .normalizeHeaderMap */.dk)(loaded.headers), (0,_headers_js__rspack_import_4/* .headersFromEnv */.gx)())
29029
+ gatewayHeaders: (0,_headers_js__rspack_import_5/* .mergeGatewayHeaders */.bQ)((0,_headers_js__rspack_import_5/* .normalizeHeaderMap */.dk)(loaded.headers), (0,_headers_js__rspack_import_5/* .headersFromEnv */.gx)())
28847
29030
  };
28848
29031
  }
28849
29032
  function hasGatewayAuth() {
@@ -28903,7 +29086,7 @@ async function ensureSandbox(accessToken, { signal } = {}) {
28903
29086
  method: "POST",
28904
29087
  redirect: "error",
28905
29088
  signal: gatewayDeadline(signal),
28906
- headers: (0,_headers_js__rspack_import_4/* .ensureSandboxHeaders */._6)(accessToken),
29089
+ headers: (0,_headers_js__rspack_import_5/* .ensureSandboxHeaders */._6)(accessToken),
28907
29090
  body: "{}"
28908
29091
  });
28909
29092
  body = await readJson(res);
@@ -28929,7 +29112,7 @@ async function ensureSandbox(accessToken, { signal } = {}) {
28929
29112
  kind: "gateway"
28930
29113
  }),
28931
29114
  gatewayToken: String(gatewayToken),
28932
- gatewayHeaders: (0,_headers_js__rspack_import_4/* .mergeGatewayHeaders */.bQ)((0,_headers_js__rspack_import_4/* .headersFromEnsureSandbox */.Ew)(body), (0,_headers_js__rspack_import_4/* .headersFromEnv */.gx)())
29115
+ gatewayHeaders: (0,_headers_js__rspack_import_5/* .mergeGatewayHeaders */.bQ)((0,_headers_js__rspack_import_5/* .headersFromEnsureSandbox */.Ew)(body), (0,_headers_js__rspack_import_5/* .headersFromEnv */.gx)())
28933
29116
  };
28934
29117
  }
28935
29118
  async function connectGateway({ signal } = {}) {
@@ -28959,7 +29142,7 @@ async function gatewayCall(session, method, body = {}, { signal } = {}) {
28959
29142
  method: "POST",
28960
29143
  redirect: "error",
28961
29144
  signal: gatewayDeadline(prompt ? undefined : signal),
28962
- headers: (0,_headers_js__rspack_import_4/* .requestHeaders */.A1)(session),
29145
+ headers: (0,_headers_js__rspack_import_5/* .requestHeaders */.A1)(session),
28963
29146
  body: JSON.stringify(body)
28964
29147
  };
28965
29148
  assertGatewayActive(signal); // Final synchronous boundary before transmission.
@@ -29226,14 +29409,115 @@ async function getThread(session, ref, rootId) {
29226
29409
  thread: data
29227
29410
  };
29228
29411
  }
29412
+ async function listGrokApprovals(session, ref) {
29413
+ const { target, transcript } = await getTranscriptTail(session, ref, 200);
29414
+ if (!Array.isArray(transcript?.entries) || transcript.entries.length > 200) throw new GatewayError("Invalid approval transcript coverage");
29415
+ return {
29416
+ target: {
29417
+ id: target.id,
29418
+ name: target.name
29419
+ },
29420
+ approvals: transcript.entries.map(_grok_approvals_js__rspack_import_4/* .grokApproval */.Ny).filter(Boolean),
29421
+ coverage: "Latest 200 transcript entries only; older requests require the owning Grok UI."
29422
+ };
29423
+ }
29424
+ async function respondGrokApproval(session, ref, input) {
29425
+ const { entryId, requestId, decision } = _grok_approvals_js__rspack_import_4/* .grokApprovalResponseSchema.parse */.T5.parse({
29426
+ ...input,
29427
+ target: ref
29428
+ });
29429
+ const { target, approvals } = await listGrokApprovals(session, ref);
29430
+ const matches = approvals.filter((card)=>card.entryId === entryId && card.requestId === requestId);
29431
+ if (matches.length !== 1) throw new GatewayError("Stale, foreign or unsupported Grok approval; refresh pending requests or use the owning Grok UI");
29432
+ const approval = matches[0];
29433
+ if (decision === "accept" && approval.truncated) throw new GatewayError("Approval details are truncated; acceptance requires the owning Grok UI");
29434
+ const local = approval.type === "local-tool-permission";
29435
+ await gatewayCall(session, local ? "resolveLocalToolPermission" : "resolveAutoReviewApproval", {
29436
+ agentId: target.id,
29437
+ entryId,
29438
+ requestId,
29439
+ resolution: local ? decision === "accept" ? "allow-once" : "deny" : decision === "accept" ? "approved" : "denied"
29440
+ });
29441
+ return {
29442
+ target,
29443
+ entryId,
29444
+ requestId,
29445
+ decision,
29446
+ delivery: "accepted"
29447
+ };
29448
+ }
29229
29449
 
29230
29450
  __webpack_require__.d(__webpack_exports__, {
29231
29451
  LV: () => (sendPrompt),
29452
+ MI: () => (listGrokApprovals),
29453
+ OR: () => (respondGrokApproval),
29232
29454
  Vq: () => (connectGateway),
29233
29455
  bA: () => (getTranscriptTail)
29234
29456
  });
29235
29457
 
29236
29458
 
29459
+ },
29460
+ "./src/core/grok-approvals.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
29461
+ /* import */ var zod__rspack_import_1 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
29462
+ /* import */ var _url_policy_js__rspack_import_0 = __webpack_require__("./src/core/url-policy.js");
29463
+
29464
+
29465
+ const id = zod__rspack_import_1/* .string */.YjP().min(1).max(1024);
29466
+ const grokApprovalResponseSchema = zod__rspack_import_1/* .strictObject */.rej({
29467
+ target: id,
29468
+ entryId: id,
29469
+ requestId: id,
29470
+ decision: zod__rspack_import_1/* ["enum"] */.k5n([
29471
+ "accept",
29472
+ "decline"
29473
+ ])
29474
+ });
29475
+ function grokApproval(entry) {
29476
+ if (entry?.kind !== "send-message") return null;
29477
+ const type = entry.message?.type;
29478
+ const card = type === "auto-review-approval" ? entry.message.approval : type === "local-tool-permission" ? entry.message.ask : null;
29479
+ if (card?.status !== "pending" || !id.safeParse(card.requestId).success || !id.safeParse(entry.id).success) return null;
29480
+ const details = {};
29481
+ let truncated = false;
29482
+ for (const key of [
29483
+ "reason",
29484
+ "command",
29485
+ "summary",
29486
+ "action",
29487
+ "description",
29488
+ "target",
29489
+ "machineId",
29490
+ "surface",
29491
+ "workingDirectory"
29492
+ ]){
29493
+ if (typeof card[key] !== "string") continue;
29494
+ const text = (0,_url_policy_js__rspack_import_0/* .redactSecrets */.fp)(card[key]);
29495
+ truncated ||= text.length > 2048;
29496
+ details[key] = text.slice(0, 2048);
29497
+ }
29498
+ return {
29499
+ entryId: entry.id,
29500
+ requestId: card.requestId,
29501
+ type,
29502
+ ...details,
29503
+ truncated
29504
+ };
29505
+ }
29506
+ function grokApprovalNotice(entry, target) {
29507
+ const approval = grokApproval(entry);
29508
+ return approval ? `Grok approval pending. Requires an explicit user decision; never approve automatically.\n${JSON.stringify({
29509
+ botTarget: target,
29510
+ ...approval
29511
+ })}\nUse gbot_grok_respond with target=${JSON.stringify(target)}, entryId, requestId and decision accept (once) or decline.${approval.truncated ? " Details are truncated; acceptance requires the owning Grok UI." : ""} A chat reply is not authorization.` : null;
29512
+ }
29513
+
29514
+ __webpack_require__.d(__webpack_exports__, {
29515
+ Ny: () => (grokApproval)
29516
+ }, {
29517
+ T5: grokApprovalResponseSchema
29518
+ });
29519
+
29520
+
29237
29521
  },
29238
29522
  "./src/core/headers.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
29239
29523
  function normalizeHeaderMap(obj) {
@@ -29529,7 +29813,10 @@ function relayProfile(env = process.env) {
29529
29813
  "GROK_BOT_ALLOW_LOCAL_GATEWAY",
29530
29814
  "GROK_BOT_ALLOW_ANY_GATEWAY",
29531
29815
  "GROK_BOT_TEST",
29532
- "NODE_ENV"
29816
+ "NODE_ENV",
29817
+ // Secret Service credentials depend on the caller's desktop session.
29818
+ "DBUS_SESSION_BUS_ADDRESS",
29819
+ "DISPLAY"
29533
29820
  ];
29534
29821
  return digest(JSON.stringify([
29535
29822
  (0,node_path__rspack_import_2.resolve)((0,_codex_bridge_js__rspack_import_3/* .codexSocketPath */.ql)(env)),
@@ -30108,7 +30395,7 @@ __webpack_require__.d(__webpack_exports__, {
30108
30395
 
30109
30396
  },
30110
30397
  "./package.json"(module) {
30111
- module.exports = {"rE":"0.6.0"}
30398
+ module.exports = {"rE":"0.8.0"}
30112
30399
 
30113
30400
  },
30114
30401
 
@@ -30174,10 +30461,10 @@ __webpack_require__.r = (exports) => {
30174
30461
  var __webpack_exports__ = {};
30175
30462
  /* import */ var node_worker_threads__rspack_import_0 = __webpack_require__("node:worker_threads");
30176
30463
  /* import */ var react__rspack_import_1 = __webpack_require__("./node_modules/react/react.react-server.js");
30177
- /* import */ var _agent_bundle_runtime_flight_server__rspack_import_16 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/flight/server.js");
30178
- /* import */ var _agent_bundle_runtime__rspack_import_13 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/49.js");
30179
- /* import */ var _agent_bundle_runtime__rspack_import_14 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/736.js");
30180
- /* import */ var _agent_bundle_runtime__rspack_import_15 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
30464
+ /* import */ var _agent_bundle_runtime_flight_server__rspack_import_18 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/flight/server.js");
30465
+ /* import */ var _agent_bundle_runtime__rspack_import_15 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/49.js");
30466
+ /* import */ var _agent_bundle_runtime__rspack_import_16 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/736.js");
30467
+ /* import */ var _agent_bundle_runtime__rspack_import_17 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
30181
30468
  /* import */ var node_url__rspack_import_2 = __webpack_require__("node:url");
30182
30469
  /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_codex_send_tsx__rspack_import_3 = __webpack_require__("./src/mcp/grok-bot/tools/codex_send.tsx");
30183
30470
  /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_codex_threads_tsx__rspack_import_4 = __webpack_require__("./src/mcp/grok-bot/tools/codex_threads.tsx");
@@ -30187,8 +30474,10 @@ var __webpack_exports__ = {};
30187
30474
  /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_bridge_status_tsx__rspack_import_8 = __webpack_require__("./src/mcp/grok-bot/tools/gbot_bridge_status.tsx");
30188
30475
  /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_bridge_stop_tsx__rspack_import_9 = __webpack_require__("./src/mcp/grok-bot/tools/gbot_bridge_stop.tsx");
30189
30476
  /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_codex_respond_tsx__rspack_import_10 = __webpack_require__("./src/mcp/grok-bot/tools/gbot_codex_respond.tsx");
30190
- /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_send_tsx__rspack_import_11 = __webpack_require__("./src/mcp/grok-bot/tools/gbot_send.tsx");
30191
- /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_thread_tsx__rspack_import_12 = __webpack_require__("./src/mcp/grok-bot/tools/gbot_thread.tsx");
30477
+ /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_grok_approvals_tsx__rspack_import_11 = __webpack_require__("./src/mcp/grok-bot/tools/gbot_grok_approvals.tsx");
30478
+ /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_grok_respond_tsx__rspack_import_12 = __webpack_require__("./src/mcp/grok-bot/tools/gbot_grok_respond.tsx");
30479
+ /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_send_tsx__rspack_import_13 = __webpack_require__("./src/mcp/grok-bot/tools/gbot_send.tsx");
30480
+ /* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_thread_tsx__rspack_import_14 = __webpack_require__("./src/mcp/grok-bot/tools/gbot_thread.tsx");
30192
30481
 
30193
30482
 
30194
30483
 
@@ -30211,22 +30500,26 @@ const route6 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok
30211
30500
 
30212
30501
  const route7 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_codex_respond_tsx__rspack_import_10, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_codex_respond_tsx__rspack_import_10);
30213
30502
 
30214
- const route8 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_send_tsx__rspack_import_11, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_send_tsx__rspack_import_11);
30503
+ const route8 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_grok_approvals_tsx__rspack_import_11, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_grok_approvals_tsx__rspack_import_11);
30504
+
30505
+ const route9 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_grok_respond_tsx__rspack_import_12, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_grok_respond_tsx__rspack_import_12);
30215
30506
 
30216
- const route9 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_thread_tsx__rspack_import_12, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_thread_tsx__rspack_import_12);
30507
+ const route10 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_send_tsx__rspack_import_13, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_send_tsx__rspack_import_13);
30508
+
30509
+ const route11 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_thread_tsx__rspack_import_14, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_mcp_grok_bot_tools_gbot_thread_tsx__rspack_import_14);
30217
30510
  // Generated routes contain only intrinsic Agent protocol elements, so no client references exist.
30218
30511
  globalThis.__rspack_rsc_manifest__ ??= Object.freeze({
30219
30512
  clientManifest: Object.freeze({})
30220
30513
  });
30221
30514
  if (node_worker_threads__rspack_import_0.parentPort === null) throw new Error('Generated Flight worker requires a parent port.');
30222
30515
  process.stdout.write = process.stderr.write.bind(process.stderr);
30223
- const ARTIFACT_EPOCH = "gbot@0.6.0";
30516
+ const ARTIFACT_EPOCH = "gbot@0.8.0";
30224
30517
  const processLifetime = {
30225
30518
  hits: 0,
30226
30519
  instanceId: crypto.randomUUID(),
30227
30520
  pid: process.pid
30228
30521
  };
30229
- const pluginRoot = (0,_agent_bundle_runtime__rspack_import_13/* .resolvePluginRoot */.E7)({
30522
+ const pluginRoot = (0,_agent_bundle_runtime__rspack_import_15/* .resolvePluginRoot */.E7)({
30230
30523
  fallback: (0,node_url__rspack_import_2.fileURLToPath)(new URL('..', import.meta.url)),
30231
30524
  stateAnchor: 'user-data'
30232
30525
  });
@@ -30238,6 +30531,9 @@ const routes = Object.freeze({
30238
30531
  "readOnlyHint": false
30239
30532
  },
30240
30533
  "description": "Send to Codex. With replyToGrok or bindingId, managed delivery returns the terminal answer to Grok automatically. Otherwise optional wait observes completion and explicit steer requires expectedTurnId. Acceptance is not completion.",
30534
+ "excludeClients": [
30535
+ "codex"
30536
+ ],
30241
30537
  "inputJsonSchema": {
30242
30538
  "additionalProperties": false,
30243
30539
  "properties": {
@@ -30316,6 +30612,9 @@ const routes = Object.freeze({
30316
30612
  "readOnlyHint": true
30317
30613
  },
30318
30614
  "description": "Discover a bounded page of Codex daemon threads.",
30615
+ "excludeClients": [
30616
+ "codex"
30617
+ ],
30319
30618
  "inputJsonSchema": {
30320
30619
  "additionalProperties": false,
30321
30620
  "properties": {
@@ -30347,6 +30646,9 @@ const routes = Object.freeze({
30347
30646
  "readOnlyHint": true
30348
30647
  },
30349
30648
  "description": "Explicit diagnostic observation of one Codex turn; returns execution and final reply without interrupting it.",
30649
+ "excludeClients": [
30650
+ "codex"
30651
+ ],
30350
30652
  "inputJsonSchema": {
30351
30653
  "additionalProperties": false,
30352
30654
  "properties": {
@@ -30394,6 +30696,9 @@ const routes = Object.freeze({
30394
30696
  "readOnlyHint": true
30395
30697
  },
30396
30698
  "description": "Watch bounded Codex thread events for diagnostics without answering approvals.",
30699
+ "excludeClients": [
30700
+ "codex"
30701
+ ],
30397
30702
  "inputJsonSchema": {
30398
30703
  "additionalProperties": false,
30399
30704
  "properties": {
@@ -30531,6 +30836,9 @@ const routes = Object.freeze({
30531
30836
  "readOnlyHint": false
30532
30837
  },
30533
30838
  "description": "Explicit operator response to a current scoped Codex interaction. Supports only one-time accept/decline/cancel or exact question-ID answers. Never auto-approve.",
30839
+ "excludeClients": [
30840
+ "codex"
30841
+ ],
30534
30842
  "inputJsonSchema": {
30535
30843
  "additionalProperties": false,
30536
30844
  "properties": {
@@ -30581,12 +30889,95 @@ const routes = Object.freeze({
30581
30889
  name: "gbot_codex_respond",
30582
30890
  serverId: "mcp:grok-bot"
30583
30891
  }),
30892
+ "tool:grok-bot/gbot_grok_approvals": Object.freeze({
30893
+ config: {
30894
+ "annotations": {
30895
+ "readOnlyHint": true
30896
+ },
30897
+ "description": "List pending auto-review and local-tool approval cards in the latest 200 entries for a Grok bot. Older or unsupported requests require the owning Grok UI.",
30898
+ "excludeClients": [
30899
+ "grok bot",
30900
+ "grokbot",
30901
+ "grok-bot"
30902
+ ],
30903
+ "inputJsonSchema": {
30904
+ "additionalProperties": false,
30905
+ "properties": {
30906
+ "target": {
30907
+ "type": "string"
30908
+ }
30909
+ },
30910
+ "required": [
30911
+ "target"
30912
+ ],
30913
+ "type": "object"
30914
+ },
30915
+ "title": "Pending Grok approvals"
30916
+ },
30917
+ id: "tool:grok-bot/gbot_grok_approvals",
30918
+ kind: "tool",
30919
+ module: route8,
30920
+ name: "gbot_grok_approvals",
30921
+ serverId: "mcp:grok-bot"
30922
+ }),
30923
+ "tool:grok-bot/gbot_grok_respond": Object.freeze({
30924
+ config: {
30925
+ "annotations": {
30926
+ "readOnlyHint": false
30927
+ },
30928
+ "description": "Only after an explicit user decision: accept one current Grok approval once or decline it. Exact target, entryId and approval requestId required. Never auto-approve or grant persistent permissions. Success acknowledges response delivery, not execution.",
30929
+ "excludeClients": [
30930
+ "grok bot",
30931
+ "grokbot",
30932
+ "grok-bot"
30933
+ ],
30934
+ "inputJsonSchema": {
30935
+ "additionalProperties": false,
30936
+ "properties": {
30937
+ "decision": {
30938
+ "enum": [
30939
+ "accept",
30940
+ "decline"
30941
+ ],
30942
+ "type": "string"
30943
+ },
30944
+ "entryId": {
30945
+ "type": "string"
30946
+ },
30947
+ "requestId": {
30948
+ "type": "string"
30949
+ },
30950
+ "target": {
30951
+ "type": "string"
30952
+ }
30953
+ },
30954
+ "required": [
30955
+ "target",
30956
+ "entryId",
30957
+ "requestId",
30958
+ "decision"
30959
+ ],
30960
+ "type": "object"
30961
+ },
30962
+ "title": "Respond to Grok approval"
30963
+ },
30964
+ id: "tool:grok-bot/gbot_grok_respond",
30965
+ kind: "tool",
30966
+ module: route9,
30967
+ name: "gbot_grok_respond",
30968
+ serverId: "mcp:grok-bot"
30969
+ }),
30584
30970
  "tool:grok-bot/gbot_send": Object.freeze({
30585
30971
  config: {
30586
30972
  "annotations": {
30587
30973
  "readOnlyHint": false
30588
30974
  },
30589
30975
  "description": "Send to Grok Bot. Native Codex calls automatically receive replies in their originating thread; send once and continue work. Without a native source, supply codexThreadId or use manual gbot_thread reading.",
30976
+ "excludeClients": [
30977
+ "grok bot",
30978
+ "grokbot",
30979
+ "grok-bot"
30980
+ ],
30590
30981
  "inputJsonSchema": {
30591
30982
  "additionalProperties": false,
30592
30983
  "properties": {
@@ -30633,7 +31024,7 @@ const routes = Object.freeze({
30633
31024
  },
30634
31025
  id: "tool:grok-bot/gbot_send",
30635
31026
  kind: "tool",
30636
- module: route8,
31027
+ module: route10,
30637
31028
  name: "gbot_send",
30638
31029
  serverId: "mcp:grok-bot"
30639
31030
  }),
@@ -30643,6 +31034,11 @@ const routes = Object.freeze({
30643
31034
  "readOnlyHint": true
30644
31035
  },
30645
31036
  "description": "Read a bounded Grok Bot thread tail. Returns a small receipt by default; pass the last cursor as after for an exclusive client-side delta, or full:true to include bounded entry text.",
31037
+ "excludeClients": [
31038
+ "grok bot",
31039
+ "grokbot",
31040
+ "grok-bot"
31041
+ ],
30646
31042
  "inputJsonSchema": {
30647
31043
  "additionalProperties": false,
30648
31044
  "properties": {
@@ -30674,7 +31070,7 @@ const routes = Object.freeze({
30674
31070
  },
30675
31071
  id: "tool:grok-bot/gbot_thread",
30676
31072
  kind: "tool",
30677
- module: route9,
31073
+ module: route11,
30678
31074
  name: "gbot_thread",
30679
31075
  serverId: "mcp:grok-bot"
30680
31076
  })
@@ -30722,7 +31118,7 @@ const render = async (message)=>{
30722
31118
  };
30723
31119
  try {
30724
31120
  const plugin = message.plugin ?? pluginRoot.identity;
30725
- await (0,_agent_bundle_runtime__rspack_import_14/* .runAgentRequest */.iC)({
31121
+ await (0,_agent_bundle_runtime__rspack_import_16/* .runAgentRequest */.iC)({
30726
31122
  ...message.actor === undefined ? {} : {
30727
31123
  actor: message.actor
30728
31124
  },
@@ -30736,7 +31132,7 @@ const render = async (message)=>{
30736
31132
  operationId: route.id,
30737
31133
  surface: route.name
30738
31134
  },
30739
- lineage: message.lineage ?? (0,_agent_bundle_runtime__rspack_import_14/* .unavailable */.hU)('not-provided'),
31135
+ lineage: message.lineage ?? (0,_agent_bundle_runtime__rspack_import_16/* .unavailable */.hU)('not-provided'),
30740
31136
  plugin,
30741
31137
  progress: {
30742
31138
  report: async (update)=>{
@@ -30752,7 +31148,7 @@ const render = async (message)=>{
30752
31148
  session: message.session
30753
31149
  },
30754
31150
  signal: controller.signal,
30755
- terminal: message.terminal ?? (0,_agent_bundle_runtime__rspack_import_14/* .unavailable */.hU)('not-provided'),
31151
+ terminal: message.terminal ?? (0,_agent_bundle_runtime__rspack_import_16/* .unavailable */.hU)('not-provided'),
30756
31152
  ...message.workspace === undefined ? {} : {
30757
31153
  workspace: message.workspace
30758
31154
  }
@@ -30787,10 +31183,10 @@ const render = async (message)=>{
30787
31183
  type: 'observed-render-start'
30788
31184
  });
30789
31185
  const renderStartedAt = performance.now();
30790
- const element = validationError === undefined ? composeLayouts(observedRoute, props, controller.signal) : /*#__PURE__*/ (0,react__rspack_import_1.createElement)(_agent_bundle_runtime__rspack_import_15/* .Agent.Result */.g6.Result, null, /*#__PURE__*/ (0,react__rspack_import_1.createElement)(_agent_bundle_runtime__rspack_import_15/* .Agent.Error */.g6.Error, {
31186
+ const element = validationError === undefined ? composeLayouts(observedRoute, props, controller.signal) : /*#__PURE__*/ (0,react__rspack_import_1.createElement)(_agent_bundle_runtime__rspack_import_17/* .Agent.Result */.g6.Result, null, /*#__PURE__*/ (0,react__rspack_import_1.createElement)(_agent_bundle_runtime__rspack_import_17/* .Agent.Error */.g6.Error, {
30791
31187
  code: 'invalid-input'
30792
31188
  }, `Input validation error: ${validationError instanceof Error ? validationError.message : String(validationError)}`));
30793
- const flight = (0,_agent_bundle_runtime_flight_server__rspack_import_16/* .renderAgentFlight */.y)(element, {
31189
+ const flight = (0,_agent_bundle_runtime_flight_server__rspack_import_18/* .renderAgentFlight */.y)(element, {
30794
31190
  signal: controller.signal
30795
31191
  });
30796
31192
  const reader = flight.getReader();