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.
@@ -11221,6 +11221,37 @@ __webpack_require__.d(__webpack_exports__, {
11221
11221
  });
11222
11222
 
11223
11223
 
11224
+ },
11225
+ "./src/core/grok-approval-routes.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
11226
+ /* import */ var zod__rspack_import_3 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
11227
+ /* import */ var _gateway_js__rspack_import_0 = __webpack_require__("./src/core/gateway.js");
11228
+ /* import */ var _grok_approvals_js__rspack_import_1 = __webpack_require__("./src/core/grok-approvals.js");
11229
+ /* import */ var _gbot_js__rspack_import_2 = __webpack_require__("./src/gbot.ts");
11230
+
11231
+
11232
+
11233
+
11234
+ const listSchema = zod__rspack_import_3/* .strictObject */.rej({
11235
+ target: zod__rspack_import_3/* .string */.YjP().min(1).max(1024)
11236
+ });
11237
+ const respondSchema = _grok_approvals_js__rspack_import_1/* .grokApprovalResponseSchema */.T5;
11238
+ const resultSchema = zod__rspack_import_3/* .record */.g1P(zod__rspack_import_3/* .string */.YjP(), zod__rspack_import_3/* .json */.Pq9());
11239
+ 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));
11240
+ const respondOperation = (input)=>(0,_gbot_js__rspack_import_2/* .withRedactedErrors */.yF)(async ()=>{
11241
+ const { target, ...response } = respondSchema.parse(input);
11242
+ return (0,_gateway_js__rspack_import_0/* .respondGrokApproval */.OR)(await (0,_gateway_js__rspack_import_0/* .connectGateway */.Vq)(), target, response);
11243
+ });
11244
+
11245
+ __webpack_require__.d(__webpack_exports__, {
11246
+ }, {
11247
+ FD: resultSchema,
11248
+ cE: listSchema,
11249
+ gi: listOperation,
11250
+ lr: respondOperation,
11251
+ v1: respondSchema
11252
+ });
11253
+
11254
+
11224
11255
  },
11225
11256
  "./src/core/relay/routes.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
11226
11257
  /* import */ var _agent_bundle_runtime__rspack_import_4 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/40.js");
@@ -11539,6 +11570,9 @@ const resultSchema = zod__rspack_import_4/* .union */.KCZ([
11539
11570
  _core_relay_routes_js__rspack_import_3/* .relayResultSchema */.Ax
11540
11571
  ]);
11541
11572
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
11573
+ excludeClients: [
11574
+ 'codex'
11575
+ ],
11542
11576
  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.',
11543
11577
  title: 'Codex send',
11544
11578
  annotations: {
@@ -11656,6 +11690,9 @@ __webpack_require__.r(__webpack_exports__);
11656
11690
 
11657
11691
 
11658
11692
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
11693
+ excludeClients: [
11694
+ 'codex'
11695
+ ],
11659
11696
  description: 'Discover a bounded page of Codex daemon threads.',
11660
11697
  title: 'Codex threads',
11661
11698
  annotations: {
@@ -11712,6 +11749,9 @@ __webpack_require__.r(__webpack_exports__);
11712
11749
 
11713
11750
 
11714
11751
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
11752
+ excludeClients: [
11753
+ 'codex'
11754
+ ],
11715
11755
  description: 'Explicit diagnostic observation of one Codex turn; returns execution and final reply without interrupting it.',
11716
11756
  title: 'Codex wait',
11717
11757
  annotations: {
@@ -11786,6 +11826,9 @@ __webpack_require__.r(__webpack_exports__);
11786
11826
 
11787
11827
 
11788
11828
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
11829
+ excludeClients: [
11830
+ 'codex'
11831
+ ],
11789
11832
  description: 'Watch bounded Codex thread events for diagnostics without answering approvals.',
11790
11833
  title: 'Codex watch',
11791
11834
  annotations: {
@@ -12022,6 +12065,9 @@ __webpack_require__.r(__webpack_exports__);
12022
12065
 
12023
12066
 
12024
12067
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
12068
+ excludeClients: [
12069
+ 'codex'
12070
+ ],
12025
12071
  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.',
12026
12072
  title: 'gbot_codex_respond',
12027
12073
  annotations: {
@@ -12088,6 +12134,130 @@ __webpack_require__.d(__webpack_exports__, {
12088
12134
  });
12089
12135
 
12090
12136
 
12137
+ },
12138
+ "./src/mcp/grok-bot/tools/gbot_grok_approvals.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
12139
+ __webpack_require__.r(__webpack_exports__);
12140
+ /* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
12141
+ /* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
12142
+ /* import */ var agent_bundle_routes__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/routes.js");
12143
+ /* import */ var _core_grok_approval_routes_js__rspack_import_2 = __webpack_require__("./src/core/grok-approval-routes.ts");
12144
+
12145
+
12146
+
12147
+
12148
+
12149
+ /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
12150
+ excludeClients: [
12151
+ 'grok bot',
12152
+ 'grokbot',
12153
+ 'grok-bot'
12154
+ ],
12155
+ title: 'Pending Grok approvals',
12156
+ 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.',
12157
+ annotations: {
12158
+ readOnlyHint: true
12159
+ },
12160
+ inputSchema: _core_grok_approval_routes_js__rspack_import_2/* .listSchema */.cE,
12161
+ resultSchema: _core_grok_approval_routes_js__rspack_import_2/* .resultSchema */.FD,
12162
+ inputJsonSchema: {
12163
+ type: 'object',
12164
+ properties: {
12165
+ target: {
12166
+ type: 'string'
12167
+ }
12168
+ },
12169
+ required: [
12170
+ 'target'
12171
+ ],
12172
+ additionalProperties: false
12173
+ }
12174
+ }, async (input)=>{
12175
+ const out = await (0,_core_grok_approval_routes_js__rspack_import_2/* .listOperation */.gi)(input);
12176
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12177
+ value: out,
12178
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12179
+ children: JSON.stringify(out)
12180
+ })
12181
+ });
12182
+ }));
12183
+
12184
+ __webpack_require__.d(__webpack_exports__, {
12185
+ inputSchema: () => (/* reexport safe */ _core_grok_approval_routes_js__rspack_import_2.cE)
12186
+ }, {
12187
+ "default": __rspack_default_export
12188
+ });
12189
+
12190
+
12191
+ },
12192
+ "./src/mcp/grok-bot/tools/gbot_grok_respond.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
12193
+ __webpack_require__.r(__webpack_exports__);
12194
+ /* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
12195
+ /* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
12196
+ /* import */ var agent_bundle_routes__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/routes.js");
12197
+ /* import */ var _core_grok_approval_routes_js__rspack_import_2 = __webpack_require__("./src/core/grok-approval-routes.ts");
12198
+
12199
+
12200
+
12201
+
12202
+
12203
+ /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
12204
+ excludeClients: [
12205
+ 'grok bot',
12206
+ 'grokbot',
12207
+ 'grok-bot'
12208
+ ],
12209
+ title: 'Respond to Grok approval',
12210
+ 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.',
12211
+ annotations: {
12212
+ readOnlyHint: false
12213
+ },
12214
+ inputSchema: _core_grok_approval_routes_js__rspack_import_2/* .respondSchema */.v1,
12215
+ resultSchema: _core_grok_approval_routes_js__rspack_import_2/* .resultSchema */.FD,
12216
+ inputJsonSchema: {
12217
+ type: 'object',
12218
+ properties: {
12219
+ target: {
12220
+ type: 'string'
12221
+ },
12222
+ entryId: {
12223
+ type: 'string'
12224
+ },
12225
+ requestId: {
12226
+ type: 'string'
12227
+ },
12228
+ decision: {
12229
+ type: 'string',
12230
+ enum: [
12231
+ 'accept',
12232
+ 'decline'
12233
+ ]
12234
+ }
12235
+ },
12236
+ required: [
12237
+ 'target',
12238
+ 'entryId',
12239
+ 'requestId',
12240
+ 'decision'
12241
+ ],
12242
+ additionalProperties: false
12243
+ }
12244
+ }, async (input)=>{
12245
+ const out = await (0,_core_grok_approval_routes_js__rspack_import_2/* .respondOperation */.lr)(input);
12246
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12247
+ value: out,
12248
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12249
+ children: JSON.stringify(out)
12250
+ })
12251
+ });
12252
+ }));
12253
+
12254
+ __webpack_require__.d(__webpack_exports__, {
12255
+ inputSchema: () => (/* reexport safe */ _core_grok_approval_routes_js__rspack_import_2.v1)
12256
+ }, {
12257
+ "default": __rspack_default_export
12258
+ });
12259
+
12260
+
12091
12261
  },
12092
12262
  "./src/mcp/grok-bot/tools/gbot_send.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
12093
12263
  __webpack_require__.r(__webpack_exports__);
@@ -12102,6 +12272,11 @@ __webpack_require__.r(__webpack_exports__);
12102
12272
 
12103
12273
 
12104
12274
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
12275
+ excludeClients: [
12276
+ 'grok bot',
12277
+ 'grokbot',
12278
+ 'grok-bot'
12279
+ ],
12105
12280
  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.',
12106
12281
  title: 'Send a message to Grok Bot',
12107
12282
  annotations: {
@@ -12190,6 +12365,11 @@ const inputSchema = zod__rspack_import_3/* .object */.Ikc({
12190
12365
  target: zod__rspack_import_3/* .string */.YjP().min(1)
12191
12366
  });
12192
12367
  /* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
12368
+ excludeClients: [
12369
+ 'grok bot',
12370
+ 'grokbot',
12371
+ 'grok-bot'
12372
+ ],
12193
12373
  annotations: {
12194
12374
  readOnlyHint: true
12195
12375
  },
@@ -39766,9 +39946,12 @@ const mcp_server_runtime_settled = async (operation, afterRender)=>{
39766
39946
  }
39767
39947
  };
39768
39948
  const registerGeneratedRoutes = (server, routes, dispatcher, artifactEpoch, options = {})=>{
39949
+ const clientTools = [];
39769
39950
  for (const route of Object.values(routes))switch(route.kind){
39770
39951
  case 'tool':
39771
39952
  {
39953
+ const excluded = route.config['excludeClients'];
39954
+ if (void 0 !== excluded && (!Array.isArray(excluded) || excluded.some((prefix)=>'string' != typeof prefix || '' === prefix.trim() || prefix.length > 128))) throw new TypeError(`Tool ${JSON.stringify(route.name)} excludeClients must contain non-empty client-name prefixes up to 128 characters.`);
39772
39955
  const outputSchema = advertisedOutputSchema(route.module.resultSchema);
39773
39956
  const registered = server.registerTool(route.name, {
39774
39957
  ...selectedConfig(route.config, [
@@ -39795,6 +39978,10 @@ const registerGeneratedRoutes = (server, routes, dispatcher, artifactEpoch, opti
39795
39978
  return (0,_agent_bundle_runtime__rspack_import_11/* .attachMcpStructuredContent */.IB)(rendered.toolResult, rendered.result);
39796
39979
  }, options.afterRender));
39797
39980
  options.tasks?.declareTool(registered, route.name, routeTaskSupport(route.config));
39981
+ if (Array.isArray(excluded) && excluded.length > 0) clientTools.push({
39982
+ prefixes: excluded.map((prefix)=>String(prefix).toLowerCase()),
39983
+ disable: ()=>registered.disable()
39984
+ });
39798
39985
  break;
39799
39986
  }
39800
39987
  case 'resource':
@@ -39845,6 +40032,16 @@ const registerGeneratedRoutes = (server, routes, dispatcher, artifactEpoch, opti
39845
40032
  throw new TypeError(`Unsupported generated MCP route kind ${String(unreachable)}.`);
39846
40033
  }
39847
40034
  }
40035
+ if (clientTools.length > 0) {
40036
+ const initialized = server.server.oninitialized;
40037
+ server.server.oninitialized = ()=>{
40038
+ const name = server.server.getClientVersion()?.name.toLowerCase();
40039
+ if (void 0 !== name) {
40040
+ for (const tool of clientTools)if (tool.prefixes.some((prefix)=>name.startsWith(prefix))) tool.disable();
40041
+ }
40042
+ initialized?.();
40043
+ };
40044
+ }
39848
40045
  };
39849
40046
  const registerGeneratedMcpApps = (server, apps)=>{
39850
40047
  for (const app of apps)server.registerResource(app.name, app.resourceUri, {
@@ -98263,7 +98460,7 @@ function strictObject(shape, params) {
98263
98460
  type: "object",
98264
98461
  shape,
98265
98462
  catchall: never(),
98266
- ...util.normalizeParams(params),
98463
+ ..._core_index_js__rspack_import_4/* .normalizeParams */.A2(params),
98267
98464
  });
98268
98465
  }
98269
98466
  // looseObject
@@ -98906,6 +99103,7 @@ __webpack_require__.d(__webpack_exports__, {
98906
99103
  gMt: () => (discriminatedUnion),
98907
99104
  k5n: () => (_enum),
98908
99105
  lqM: () => (optional),
99106
+ rej: () => (strictObject),
98909
99107
  vkY: () => (preprocess),
98910
99108
  zMY: () => (boolean)
98911
99109
  }, {
@@ -107192,9 +107390,9 @@ __webpack_require__.d(__webpack_exports__, {
107192
107390
  "./.agent-bundle-virtual/mcp-grok-bot-b8c2461e-1.mjs"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
107193
107391
  __webpack_require__.r(__webpack_exports__);
107194
107392
  /* import */ var node_url__rspack_import_0 = __webpack_require__("node:url");
107195
- /* import */ var _agent_bundle_runtime__rspack_import_13 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/49.js");
107393
+ /* import */ var _agent_bundle_runtime__rspack_import_15 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/49.js");
107196
107394
  /* import */ var agent_bundle_mcp_server_runtime__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/mcp-server-runtime.js");
107197
- /* import */ var _agent_bundle_runtime_lineage__rspack_import_14 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/lineage.js");
107395
+ /* import */ var _agent_bundle_runtime_lineage__rspack_import_16 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/lineage.js");
107198
107396
  /* import */ var agent_bundle_mcp_apps__rspack_import_2 = __webpack_require__("./.agent-bundle-virtual/mcp-grok-bot-b8c2461e-0.mjs");
107199
107397
  /* 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");
107200
107398
  /* 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");
@@ -107204,8 +107402,10 @@ __webpack_require__.r(__webpack_exports__);
107204
107402
  /* 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");
107205
107403
  /* 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");
107206
107404
  /* 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");
107207
- /* 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");
107208
- /* 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");
107405
+ /* 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");
107406
+ /* 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");
107407
+ /* 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");
107408
+ /* 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");
107209
107409
 
107210
107410
 
107211
107411
 
@@ -107228,17 +107428,21 @@ const route6 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok
107228
107428
 
107229
107429
  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);
107230
107430
 
107231
- 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);
107431
+ 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);
107232
107432
 
107233
- 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);
107234
- const ARTIFACT_EPOCH = "gbot@0.6.0";
107235
- const pluginRoot = (0,_agent_bundle_runtime__rspack_import_13/* .resolvePluginRoot */.E7)({
107433
+ 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);
107434
+
107435
+ 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);
107436
+
107437
+ 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);
107438
+ const ARTIFACT_EPOCH = "gbot@0.8.0";
107439
+ const pluginRoot = (0,_agent_bundle_runtime__rspack_import_15/* .resolvePluginRoot */.E7)({
107236
107440
  fallback: (0,node_url__rspack_import_0.fileURLToPath)(new URL('..', import.meta.url)),
107237
107441
  stateAnchor: 'user-data'
107238
107442
  });
107239
107443
  const openLineage = async ()=>({
107240
107444
  dispose: async ()=>undefined,
107241
- registry: (0,_agent_bundle_runtime_lineage__rspack_import_14/* .createAgentLineageRegistry */.Q5)()
107445
+ registry: (0,_agent_bundle_runtime_lineage__rspack_import_16/* .createAgentLineageRegistry */.Q5)()
107242
107446
  });
107243
107447
  const routes = Object.freeze({
107244
107448
  "tool:grok-bot/codex_send": Object.freeze({
@@ -107247,6 +107451,9 @@ const routes = Object.freeze({
107247
107451
  "readOnlyHint": false
107248
107452
  },
107249
107453
  "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.",
107454
+ "excludeClients": [
107455
+ "codex"
107456
+ ],
107250
107457
  "inputJsonSchema": {
107251
107458
  "additionalProperties": false,
107252
107459
  "properties": {
@@ -107324,6 +107531,9 @@ const routes = Object.freeze({
107324
107531
  "readOnlyHint": true
107325
107532
  },
107326
107533
  "description": "Discover a bounded page of Codex daemon threads.",
107534
+ "excludeClients": [
107535
+ "codex"
107536
+ ],
107327
107537
  "inputJsonSchema": {
107328
107538
  "additionalProperties": false,
107329
107539
  "properties": {
@@ -107354,6 +107564,9 @@ const routes = Object.freeze({
107354
107564
  "readOnlyHint": true
107355
107565
  },
107356
107566
  "description": "Explicit diagnostic observation of one Codex turn; returns execution and final reply without interrupting it.",
107567
+ "excludeClients": [
107568
+ "codex"
107569
+ ],
107357
107570
  "inputJsonSchema": {
107358
107571
  "additionalProperties": false,
107359
107572
  "properties": {
@@ -107400,6 +107613,9 @@ const routes = Object.freeze({
107400
107613
  "readOnlyHint": true
107401
107614
  },
107402
107615
  "description": "Watch bounded Codex thread events for diagnostics without answering approvals.",
107616
+ "excludeClients": [
107617
+ "codex"
107618
+ ],
107403
107619
  "inputJsonSchema": {
107404
107620
  "additionalProperties": false,
107405
107621
  "properties": {
@@ -107533,6 +107749,9 @@ const routes = Object.freeze({
107533
107749
  "readOnlyHint": false
107534
107750
  },
107535
107751
  "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.",
107752
+ "excludeClients": [
107753
+ "codex"
107754
+ ],
107536
107755
  "inputJsonSchema": {
107537
107756
  "additionalProperties": false,
107538
107757
  "properties": {
@@ -107582,12 +107801,93 @@ const routes = Object.freeze({
107582
107801
  module: route7,
107583
107802
  name: "gbot_codex_respond"
107584
107803
  }),
107804
+ "tool:grok-bot/gbot_grok_approvals": Object.freeze({
107805
+ config: {
107806
+ "annotations": {
107807
+ "readOnlyHint": true
107808
+ },
107809
+ "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.",
107810
+ "excludeClients": [
107811
+ "grok bot",
107812
+ "grokbot",
107813
+ "grok-bot"
107814
+ ],
107815
+ "inputJsonSchema": {
107816
+ "additionalProperties": false,
107817
+ "properties": {
107818
+ "target": {
107819
+ "type": "string"
107820
+ }
107821
+ },
107822
+ "required": [
107823
+ "target"
107824
+ ],
107825
+ "type": "object"
107826
+ },
107827
+ "title": "Pending Grok approvals"
107828
+ },
107829
+ id: "tool:grok-bot/gbot_grok_approvals",
107830
+ kind: "tool",
107831
+ module: route8,
107832
+ name: "gbot_grok_approvals"
107833
+ }),
107834
+ "tool:grok-bot/gbot_grok_respond": Object.freeze({
107835
+ config: {
107836
+ "annotations": {
107837
+ "readOnlyHint": false
107838
+ },
107839
+ "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.",
107840
+ "excludeClients": [
107841
+ "grok bot",
107842
+ "grokbot",
107843
+ "grok-bot"
107844
+ ],
107845
+ "inputJsonSchema": {
107846
+ "additionalProperties": false,
107847
+ "properties": {
107848
+ "decision": {
107849
+ "enum": [
107850
+ "accept",
107851
+ "decline"
107852
+ ],
107853
+ "type": "string"
107854
+ },
107855
+ "entryId": {
107856
+ "type": "string"
107857
+ },
107858
+ "requestId": {
107859
+ "type": "string"
107860
+ },
107861
+ "target": {
107862
+ "type": "string"
107863
+ }
107864
+ },
107865
+ "required": [
107866
+ "target",
107867
+ "entryId",
107868
+ "requestId",
107869
+ "decision"
107870
+ ],
107871
+ "type": "object"
107872
+ },
107873
+ "title": "Respond to Grok approval"
107874
+ },
107875
+ id: "tool:grok-bot/gbot_grok_respond",
107876
+ kind: "tool",
107877
+ module: route9,
107878
+ name: "gbot_grok_respond"
107879
+ }),
107585
107880
  "tool:grok-bot/gbot_send": Object.freeze({
107586
107881
  config: {
107587
107882
  "annotations": {
107588
107883
  "readOnlyHint": false
107589
107884
  },
107590
107885
  "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.",
107886
+ "excludeClients": [
107887
+ "grok bot",
107888
+ "grokbot",
107889
+ "grok-bot"
107890
+ ],
107591
107891
  "inputJsonSchema": {
107592
107892
  "additionalProperties": false,
107593
107893
  "properties": {
@@ -107634,7 +107934,7 @@ const routes = Object.freeze({
107634
107934
  },
107635
107935
  id: "tool:grok-bot/gbot_send",
107636
107936
  kind: "tool",
107637
- module: route8,
107937
+ module: route10,
107638
107938
  name: "gbot_send"
107639
107939
  }),
107640
107940
  "tool:grok-bot/gbot_thread": Object.freeze({
@@ -107643,6 +107943,11 @@ const routes = Object.freeze({
107643
107943
  "readOnlyHint": true
107644
107944
  },
107645
107945
  "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.",
107946
+ "excludeClients": [
107947
+ "grok bot",
107948
+ "grokbot",
107949
+ "grok-bot"
107950
+ ],
107646
107951
  "inputJsonSchema": {
107647
107952
  "additionalProperties": false,
107648
107953
  "properties": {
@@ -107674,7 +107979,7 @@ const routes = Object.freeze({
107674
107979
  },
107675
107980
  id: "tool:grok-bot/gbot_thread",
107676
107981
  kind: "tool",
107677
- module: route9,
107982
+ module: route11,
107678
107983
  name: "gbot_thread"
107679
107984
  })
107680
107985
  });
@@ -107688,7 +107993,7 @@ const routes = Object.freeze({
107688
107993
  lineage: lineage.registry,
107689
107994
  plugin: {
107690
107995
  "name": "gbot",
107691
- "version": "0.6.0"
107996
+ "version": "0.8.0"
107692
107997
  },
107693
107998
  pluginRoot: pluginRoot.identity,
107694
107999
  routes
@@ -108759,10 +109064,10 @@ function listDesktopProcesses(timeoutMs = DESKTOP_PROCESS_LIST_TIMEOUT_MS) {
108759
109064
  const lines = Array.isArray(listProcesses) ? listProcesses : String(listProcesses ?? "").split(/\r?\n/);
108760
109065
  for (const line of lines){
108761
109066
  if (!/app-server/.test(line)) continue;
108762
- // Desktop's bundled binary, Mac or Windows-style separators with optional .exe.
109067
+ // Desktop's bundled binary only (Mac/Windows separators, optional .exe).
109068
+ // Do NOT match probe shells whose cmdline merely mentions ChatGPT.app +
109069
+ // app-server + codex-app-tools — that false-positives MATCH2 / Scout noise.
108763
109070
  if (/ChatGPT\.app[\\/].*Resources[\\/]codex(\.exe)?(["'\s]|$)/.test(line)) return "private-stdio";
108764
- // Same app-server line owned by ChatGPT.app carrying the app-tools override.
108765
- if (/ChatGPT\.app/.test(line) && /(codex_app|mcp_servers\.codex_app|codex-app-tools)/.test(line)) return "private-stdio";
108766
109071
  }
108767
109072
  return "unknown";
108768
109073
  }
@@ -110449,10 +110754,12 @@ function socketStateOf(path) {
110449
110754
  },
110450
110755
  "./src/core/gateway.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
110451
110756
  /* import */ var node_crypto__rspack_import_0 = __webpack_require__("node:crypto");
110452
- /* import */ var _headers_js__rspack_import_4 = __webpack_require__("./src/core/headers.js");
110757
+ /* import */ var _headers_js__rspack_import_5 = __webpack_require__("./src/core/headers.js");
110453
110758
  /* import */ var _app_session_js__rspack_import_1 = __webpack_require__("./src/core/app-session.js");
110454
110759
  /* import */ var _store_js__rspack_import_2 = __webpack_require__("./src/core/store.js");
110455
110760
  /* import */ var _url_policy_js__rspack_import_3 = __webpack_require__("./src/core/url-policy.js");
110761
+ /* import */ var _grok_approvals_js__rspack_import_4 = __webpack_require__("./src/core/grok-approvals.js");
110762
+
110456
110763
 
110457
110764
 
110458
110765
 
@@ -110502,7 +110809,7 @@ function gatewayOverride() {
110502
110809
  kind: "gateway"
110503
110810
  }),
110504
110811
  gatewayToken: token,
110505
- gatewayHeaders: (0,_headers_js__rspack_import_4/* .headersFromEnv */.gx)()
110812
+ gatewayHeaders: (0,_headers_js__rspack_import_5/* .headersFromEnv */.gx)()
110506
110813
  };
110507
110814
  }
110508
110815
  return null;
@@ -110523,7 +110830,7 @@ function sessionFromApp() {
110523
110830
  kind: "gateway"
110524
110831
  }),
110525
110832
  gatewayToken: loaded.gatewayToken,
110526
- 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)())
110833
+ 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)())
110527
110834
  };
110528
110835
  }
110529
110836
  function hasGatewayAuth() {
@@ -110583,7 +110890,7 @@ async function ensureSandbox(accessToken, { signal } = {}) {
110583
110890
  method: "POST",
110584
110891
  redirect: "error",
110585
110892
  signal: gatewayDeadline(signal),
110586
- headers: (0,_headers_js__rspack_import_4/* .ensureSandboxHeaders */._6)(accessToken),
110893
+ headers: (0,_headers_js__rspack_import_5/* .ensureSandboxHeaders */._6)(accessToken),
110587
110894
  body: "{}"
110588
110895
  });
110589
110896
  body = await readJson(res);
@@ -110609,7 +110916,7 @@ async function ensureSandbox(accessToken, { signal } = {}) {
110609
110916
  kind: "gateway"
110610
110917
  }),
110611
110918
  gatewayToken: String(gatewayToken),
110612
- 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)())
110919
+ 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)())
110613
110920
  };
110614
110921
  }
110615
110922
  async function connectGateway({ signal } = {}) {
@@ -110639,7 +110946,7 @@ async function gatewayCall(session, method, body = {}, { signal } = {}) {
110639
110946
  method: "POST",
110640
110947
  redirect: "error",
110641
110948
  signal: gatewayDeadline(prompt ? undefined : signal),
110642
- headers: (0,_headers_js__rspack_import_4/* .requestHeaders */.A1)(session),
110949
+ headers: (0,_headers_js__rspack_import_5/* .requestHeaders */.A1)(session),
110643
110950
  body: JSON.stringify(body)
110644
110951
  };
110645
110952
  assertGatewayActive(signal); // Final synchronous boundary before transmission.
@@ -110906,14 +111213,115 @@ async function getThread(session, ref, rootId) {
110906
111213
  thread: data
110907
111214
  };
110908
111215
  }
111216
+ async function listGrokApprovals(session, ref) {
111217
+ const { target, transcript } = await getTranscriptTail(session, ref, 200);
111218
+ if (!Array.isArray(transcript?.entries) || transcript.entries.length > 200) throw new GatewayError("Invalid approval transcript coverage");
111219
+ return {
111220
+ target: {
111221
+ id: target.id,
111222
+ name: target.name
111223
+ },
111224
+ approvals: transcript.entries.map(_grok_approvals_js__rspack_import_4/* .grokApproval */.Ny).filter(Boolean),
111225
+ coverage: "Latest 200 transcript entries only; older requests require the owning Grok UI."
111226
+ };
111227
+ }
111228
+ async function respondGrokApproval(session, ref, input) {
111229
+ const { entryId, requestId, decision } = _grok_approvals_js__rspack_import_4/* .grokApprovalResponseSchema.parse */.T5.parse({
111230
+ ...input,
111231
+ target: ref
111232
+ });
111233
+ const { target, approvals } = await listGrokApprovals(session, ref);
111234
+ const matches = approvals.filter((card)=>card.entryId === entryId && card.requestId === requestId);
111235
+ if (matches.length !== 1) throw new GatewayError("Stale, foreign or unsupported Grok approval; refresh pending requests or use the owning Grok UI");
111236
+ const approval = matches[0];
111237
+ if (decision === "accept" && approval.truncated) throw new GatewayError("Approval details are truncated; acceptance requires the owning Grok UI");
111238
+ const local = approval.type === "local-tool-permission";
111239
+ await gatewayCall(session, local ? "resolveLocalToolPermission" : "resolveAutoReviewApproval", {
111240
+ agentId: target.id,
111241
+ entryId,
111242
+ requestId,
111243
+ resolution: local ? decision === "accept" ? "allow-once" : "deny" : decision === "accept" ? "approved" : "denied"
111244
+ });
111245
+ return {
111246
+ target,
111247
+ entryId,
111248
+ requestId,
111249
+ decision,
111250
+ delivery: "accepted"
111251
+ };
111252
+ }
110909
111253
 
110910
111254
  __webpack_require__.d(__webpack_exports__, {
110911
111255
  LV: () => (sendPrompt),
111256
+ MI: () => (listGrokApprovals),
111257
+ OR: () => (respondGrokApproval),
110912
111258
  Vq: () => (connectGateway),
110913
111259
  bA: () => (getTranscriptTail)
110914
111260
  });
110915
111261
 
110916
111262
 
111263
+ },
111264
+ "./src/core/grok-approvals.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
111265
+ /* import */ var zod__rspack_import_1 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
111266
+ /* import */ var _url_policy_js__rspack_import_0 = __webpack_require__("./src/core/url-policy.js");
111267
+
111268
+
111269
+ const id = zod__rspack_import_1/* .string */.YjP().min(1).max(1024);
111270
+ const grokApprovalResponseSchema = zod__rspack_import_1/* .strictObject */.rej({
111271
+ target: id,
111272
+ entryId: id,
111273
+ requestId: id,
111274
+ decision: zod__rspack_import_1/* ["enum"] */.k5n([
111275
+ "accept",
111276
+ "decline"
111277
+ ])
111278
+ });
111279
+ function grokApproval(entry) {
111280
+ if (entry?.kind !== "send-message") return null;
111281
+ const type = entry.message?.type;
111282
+ const card = type === "auto-review-approval" ? entry.message.approval : type === "local-tool-permission" ? entry.message.ask : null;
111283
+ if (card?.status !== "pending" || !id.safeParse(card.requestId).success || !id.safeParse(entry.id).success) return null;
111284
+ const details = {};
111285
+ let truncated = false;
111286
+ for (const key of [
111287
+ "reason",
111288
+ "command",
111289
+ "summary",
111290
+ "action",
111291
+ "description",
111292
+ "target",
111293
+ "machineId",
111294
+ "surface",
111295
+ "workingDirectory"
111296
+ ]){
111297
+ if (typeof card[key] !== "string") continue;
111298
+ const text = (0,_url_policy_js__rspack_import_0/* .redactSecrets */.fp)(card[key]);
111299
+ truncated ||= text.length > 2048;
111300
+ details[key] = text.slice(0, 2048);
111301
+ }
111302
+ return {
111303
+ entryId: entry.id,
111304
+ requestId: card.requestId,
111305
+ type,
111306
+ ...details,
111307
+ truncated
111308
+ };
111309
+ }
111310
+ function grokApprovalNotice(entry, target) {
111311
+ const approval = grokApproval(entry);
111312
+ return approval ? `Grok approval pending. Requires an explicit user decision; never approve automatically.\n${JSON.stringify({
111313
+ botTarget: target,
111314
+ ...approval
111315
+ })}\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;
111316
+ }
111317
+
111318
+ __webpack_require__.d(__webpack_exports__, {
111319
+ Ny: () => (grokApproval)
111320
+ }, {
111321
+ T5: grokApprovalResponseSchema
111322
+ });
111323
+
111324
+
110917
111325
  },
110918
111326
  "./src/core/headers.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
110919
111327
  function normalizeHeaderMap(obj) {
@@ -111209,7 +111617,10 @@ function relayProfile(env = process.env) {
111209
111617
  "GROK_BOT_ALLOW_LOCAL_GATEWAY",
111210
111618
  "GROK_BOT_ALLOW_ANY_GATEWAY",
111211
111619
  "GROK_BOT_TEST",
111212
- "NODE_ENV"
111620
+ "NODE_ENV",
111621
+ // Secret Service credentials depend on the caller's desktop session.
111622
+ "DBUS_SESSION_BUS_ADDRESS",
111623
+ "DISPLAY"
111213
111624
  ];
111214
111625
  return digest(JSON.stringify([
111215
111626
  (0,node_path__rspack_import_2.resolve)((0,_codex_bridge_js__rspack_import_3/* .codexSocketPath */.ql)(env)),
@@ -111788,7 +112199,7 @@ __webpack_require__.d(__webpack_exports__, {
111788
112199
 
111789
112200
  },
111790
112201
  "./package.json"(module) {
111791
- module.exports = {"rE":"0.6.0"}
112202
+ module.exports = {"rE":"0.8.0"}
111792
112203
 
111793
112204
  },
111794
112205