grok-bot-cli 0.6.0 → 0.7.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.
- package/CHANGELOG.md +13 -0
- package/dist/.claude-plugin/marketplace.json +1 -1
- package/dist/.claude-plugin/plugin.json +1 -1
- package/dist/.codex-plugin/plugin.json +1 -1
- package/dist/.cursor-plugin/plugin.json +1 -1
- package/dist/INSTALL.md +6 -6
- package/dist/agent-bundle.compile-evidence.json +1 -1
- package/dist/agent-bundle.manifest.json +1 -1
- package/dist/agent-bundle.package-compile-evidence.json +1 -1
- package/dist/bin/gbot-flight.mjs +463 -238
- package/dist/bin/gbot-install.js +9087 -9084
- package/dist/bin/gbot.mjs +679 -540
- package/dist/install.mjs +6 -3
- package/dist/mcp/mcp-grok-bot-b8c2461e-flight.mjs +380 -93
- package/dist/mcp/mcp-grok-bot-b8c2461e.mjs +497 -377
- package/dist/package.json +3 -3
- package/dist/plugin.json +1 -1
- package/dist/scripts/gbot-relay.mjs +149 -2071
- package/dist/skills/talk-to-grok-bot/SKILL.md +10 -0
- package/package.json +3 -3
|
@@ -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");
|
|
@@ -11614,9 +11645,9 @@ const resultSchema = zod__rspack_import_4/* .union */.KCZ([
|
|
|
11614
11645
|
const context = await (0,_agent_bundle_runtime__rspack_import_5/* .agent */.MA)();
|
|
11615
11646
|
if (input.replyToGrok || input.bindingId) {
|
|
11616
11647
|
const out = await (0,_core_relay_routes_js__rspack_import_3/* .codexReturnOperation */.lt)(input, context);
|
|
11617
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Result */.
|
|
11648
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Result */.g.Result, {
|
|
11618
11649
|
value: out,
|
|
11619
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Text */.
|
|
11650
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Text */.g.Text, {
|
|
11620
11651
|
children: `Delivery ${out.delivery}; terminal answer returns to Grok automatically.`
|
|
11621
11652
|
})
|
|
11622
11653
|
});
|
|
@@ -11627,9 +11658,9 @@ const resultSchema = zod__rspack_import_4/* .union */.KCZ([
|
|
|
11627
11658
|
}, context.signal, (message)=>context.progress.report({
|
|
11628
11659
|
message
|
|
11629
11660
|
}));
|
|
11630
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Result */.
|
|
11661
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Result */.g.Result, {
|
|
11631
11662
|
value: out,
|
|
11632
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Text */.
|
|
11663
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Text */.g.Text, {
|
|
11633
11664
|
children: (0,_core_codex_routes_js__rspack_import_2/* .resultText */.D6)(out)
|
|
11634
11665
|
})
|
|
11635
11666
|
});
|
|
@@ -11683,9 +11714,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11683
11714
|
}, async (input)=>{
|
|
11684
11715
|
const context = await (0,_agent_bundle_runtime__rspack_import_3/* .agent */.MA)();
|
|
11685
11716
|
const out = await (0,_core_codex_routes_js__rspack_import_2/* .threadsOperation */.$c)(input);
|
|
11686
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11717
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
11687
11718
|
value: out,
|
|
11688
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11719
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
11689
11720
|
children: (0,_core_codex_routes_js__rspack_import_2/* .resultText */.D6)(out)
|
|
11690
11721
|
})
|
|
11691
11722
|
});
|
|
@@ -11757,9 +11788,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11757
11788
|
const out = await (0,_core_codex_routes_js__rspack_import_2/* .observeOperation */.gT)('wait', input, context.signal, (message)=>context.progress.report({
|
|
11758
11789
|
message
|
|
11759
11790
|
}));
|
|
11760
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11791
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
11761
11792
|
value: out,
|
|
11762
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11793
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
11763
11794
|
children: (0,_core_codex_routes_js__rspack_import_2/* .resultText */.D6)(out)
|
|
11764
11795
|
})
|
|
11765
11796
|
});
|
|
@@ -11824,9 +11855,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11824
11855
|
const out = await (0,_core_codex_routes_js__rspack_import_2/* .observeOperation */.gT)('watch', input, context.signal, (message)=>context.progress.report({
|
|
11825
11856
|
message
|
|
11826
11857
|
}));
|
|
11827
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11858
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
11828
11859
|
value: out,
|
|
11829
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11860
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
11830
11861
|
children: (0,_core_codex_routes_js__rspack_import_2/* .resultText */.D6)(out)
|
|
11831
11862
|
})
|
|
11832
11863
|
});
|
|
@@ -11890,9 +11921,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11890
11921
|
}
|
|
11891
11922
|
}, async (input)=>{
|
|
11892
11923
|
const out = await (0,_core_relay_routes_js__rspack_import_2/* .bridgeOperation */.n1)('startBinding', input, await (0,_agent_bundle_runtime__rspack_import_3/* .agent */.MA)());
|
|
11893
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11924
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
11894
11925
|
value: out,
|
|
11895
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11926
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
11896
11927
|
children: JSON.stringify(out)
|
|
11897
11928
|
})
|
|
11898
11929
|
});
|
|
@@ -11940,9 +11971,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11940
11971
|
}
|
|
11941
11972
|
}, async (input)=>{
|
|
11942
11973
|
const out = await (0,_core_relay_routes_js__rspack_import_2/* .bridgeOperation */.n1)('status', input, await (0,_agent_bundle_runtime__rspack_import_3/* .agent */.MA)());
|
|
11943
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11974
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
11944
11975
|
value: out,
|
|
11945
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11976
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
11946
11977
|
children: JSON.stringify(out)
|
|
11947
11978
|
})
|
|
11948
11979
|
});
|
|
@@ -11993,9 +12024,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11993
12024
|
}
|
|
11994
12025
|
}, async (input)=>{
|
|
11995
12026
|
const out = await (0,_core_relay_routes_js__rspack_import_2/* .bridgeOperation */.n1)('stop', input, await (0,_agent_bundle_runtime__rspack_import_3/* .agent */.MA)());
|
|
11996
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
12027
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
11997
12028
|
value: out,
|
|
11998
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
12029
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
11999
12030
|
children: JSON.stringify(out)
|
|
12000
12031
|
})
|
|
12001
12032
|
});
|
|
@@ -12073,9 +12104,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12073
12104
|
}
|
|
12074
12105
|
}, async (input)=>{
|
|
12075
12106
|
const out = await (0,_core_relay_routes_js__rspack_import_2/* .bridgeOperation */.n1)('respond', input, await (0,_agent_bundle_runtime__rspack_import_3/* .agent */.MA)());
|
|
12076
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
12107
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
12077
12108
|
value: out,
|
|
12078
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
12109
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
12079
12110
|
children: JSON.stringify(out)
|
|
12080
12111
|
})
|
|
12081
12112
|
});
|
|
@@ -12088,6 +12119,120 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
12088
12119
|
});
|
|
12089
12120
|
|
|
12090
12121
|
|
|
12122
|
+
},
|
|
12123
|
+
"./src/mcp/grok-bot/tools/gbot_grok_approvals.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
12124
|
+
__webpack_require__.r(__webpack_exports__);
|
|
12125
|
+
/* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
|
|
12126
|
+
/* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
|
|
12127
|
+
/* import */ var agent_bundle_routes__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/routes.js");
|
|
12128
|
+
/* import */ var _core_grok_approval_routes_js__rspack_import_2 = __webpack_require__("./src/core/grok-approval-routes.ts");
|
|
12129
|
+
|
|
12130
|
+
|
|
12131
|
+
|
|
12132
|
+
|
|
12133
|
+
|
|
12134
|
+
/* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
|
|
12135
|
+
title: 'Pending Grok approvals',
|
|
12136
|
+
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.',
|
|
12137
|
+
annotations: {
|
|
12138
|
+
readOnlyHint: true
|
|
12139
|
+
},
|
|
12140
|
+
inputSchema: _core_grok_approval_routes_js__rspack_import_2/* .listSchema */.cE,
|
|
12141
|
+
resultSchema: _core_grok_approval_routes_js__rspack_import_2/* .resultSchema */.FD,
|
|
12142
|
+
inputJsonSchema: {
|
|
12143
|
+
type: 'object',
|
|
12144
|
+
properties: {
|
|
12145
|
+
target: {
|
|
12146
|
+
type: 'string'
|
|
12147
|
+
}
|
|
12148
|
+
},
|
|
12149
|
+
required: [
|
|
12150
|
+
'target'
|
|
12151
|
+
],
|
|
12152
|
+
additionalProperties: false
|
|
12153
|
+
}
|
|
12154
|
+
}, async (input)=>{
|
|
12155
|
+
const out = await (0,_core_grok_approval_routes_js__rspack_import_2/* .listOperation */.gi)(input);
|
|
12156
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g.Result, {
|
|
12157
|
+
value: out,
|
|
12158
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
|
|
12159
|
+
children: JSON.stringify(out)
|
|
12160
|
+
})
|
|
12161
|
+
});
|
|
12162
|
+
}));
|
|
12163
|
+
|
|
12164
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
12165
|
+
inputSchema: () => (/* reexport safe */ _core_grok_approval_routes_js__rspack_import_2.cE)
|
|
12166
|
+
}, {
|
|
12167
|
+
"default": __rspack_default_export
|
|
12168
|
+
});
|
|
12169
|
+
|
|
12170
|
+
|
|
12171
|
+
},
|
|
12172
|
+
"./src/mcp/grok-bot/tools/gbot_grok_respond.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
12173
|
+
__webpack_require__.r(__webpack_exports__);
|
|
12174
|
+
/* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
|
|
12175
|
+
/* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
|
|
12176
|
+
/* import */ var agent_bundle_routes__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/routes.js");
|
|
12177
|
+
/* import */ var _core_grok_approval_routes_js__rspack_import_2 = __webpack_require__("./src/core/grok-approval-routes.ts");
|
|
12178
|
+
|
|
12179
|
+
|
|
12180
|
+
|
|
12181
|
+
|
|
12182
|
+
|
|
12183
|
+
/* export default */ const __rspack_default_export = ((0,agent_bundle_routes__rspack_import_1/* .defineTool */.uO)({
|
|
12184
|
+
title: 'Respond to Grok approval',
|
|
12185
|
+
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.',
|
|
12186
|
+
annotations: {
|
|
12187
|
+
readOnlyHint: false
|
|
12188
|
+
},
|
|
12189
|
+
inputSchema: _core_grok_approval_routes_js__rspack_import_2/* .respondSchema */.v1,
|
|
12190
|
+
resultSchema: _core_grok_approval_routes_js__rspack_import_2/* .resultSchema */.FD,
|
|
12191
|
+
inputJsonSchema: {
|
|
12192
|
+
type: 'object',
|
|
12193
|
+
properties: {
|
|
12194
|
+
target: {
|
|
12195
|
+
type: 'string'
|
|
12196
|
+
},
|
|
12197
|
+
entryId: {
|
|
12198
|
+
type: 'string'
|
|
12199
|
+
},
|
|
12200
|
+
requestId: {
|
|
12201
|
+
type: 'string'
|
|
12202
|
+
},
|
|
12203
|
+
decision: {
|
|
12204
|
+
type: 'string',
|
|
12205
|
+
enum: [
|
|
12206
|
+
'accept',
|
|
12207
|
+
'decline'
|
|
12208
|
+
]
|
|
12209
|
+
}
|
|
12210
|
+
},
|
|
12211
|
+
required: [
|
|
12212
|
+
'target',
|
|
12213
|
+
'entryId',
|
|
12214
|
+
'requestId',
|
|
12215
|
+
'decision'
|
|
12216
|
+
],
|
|
12217
|
+
additionalProperties: false
|
|
12218
|
+
}
|
|
12219
|
+
}, async (input)=>{
|
|
12220
|
+
const out = await (0,_core_grok_approval_routes_js__rspack_import_2/* .respondOperation */.lr)(input);
|
|
12221
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g.Result, {
|
|
12222
|
+
value: out,
|
|
12223
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
|
|
12224
|
+
children: JSON.stringify(out)
|
|
12225
|
+
})
|
|
12226
|
+
});
|
|
12227
|
+
}));
|
|
12228
|
+
|
|
12229
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
12230
|
+
inputSchema: () => (/* reexport safe */ _core_grok_approval_routes_js__rspack_import_2.v1)
|
|
12231
|
+
}, {
|
|
12232
|
+
"default": __rspack_default_export
|
|
12233
|
+
});
|
|
12234
|
+
|
|
12235
|
+
|
|
12091
12236
|
},
|
|
12092
12237
|
"./src/mcp/grok-bot/tools/gbot_send.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
12093
12238
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -12153,9 +12298,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12153
12298
|
}
|
|
12154
12299
|
}, async (input)=>{
|
|
12155
12300
|
const out = await (0,_core_relay_routes_js__rspack_import_2/* .grokSendOperation */.bv)(input, await (0,_agent_bundle_runtime__rspack_import_3/* .agent */.MA)());
|
|
12156
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
12301
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
12157
12302
|
value: out,
|
|
12158
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
12303
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
12159
12304
|
children: out.replyRoute.mode === 'auto' ? `Delivery ${out.delivery}; replies will arrive in Codex thread ${out.replyRoute.threadId}. Continue work; no polling needed.` : `Delivery ${out.delivery}${out.delivery === 'unknown' ? ' (no receipt; check the thread before resending)' : ''}; read the reply with gbot_thread.`
|
|
12160
12305
|
})
|
|
12161
12306
|
});
|
|
@@ -12247,9 +12392,9 @@ const inputSchema = zod__rspack_import_3/* .object */.Ikc({
|
|
|
12247
12392
|
summary
|
|
12248
12393
|
};
|
|
12249
12394
|
if (!full) {
|
|
12250
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
12395
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
12251
12396
|
value: receipt,
|
|
12252
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
12397
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
12253
12398
|
children: summary
|
|
12254
12399
|
})
|
|
12255
12400
|
});
|
|
@@ -12258,9 +12403,9 @@ const inputSchema = zod__rspack_import_3/* .object */.Ikc({
|
|
|
12258
12403
|
...receipt,
|
|
12259
12404
|
entries
|
|
12260
12405
|
};
|
|
12261
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
12406
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
|
|
12262
12407
|
value: value,
|
|
12263
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
12408
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
|
|
12264
12409
|
children: summary
|
|
12265
12410
|
})
|
|
12266
12411
|
});
|
|
@@ -12358,28 +12503,7 @@ module.exports = __rspack_createRequire_require("util");
|
|
|
12358
12503
|
},
|
|
12359
12504
|
"./node_modules/@agent-bundle/runtime/dist/302.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
12360
12505
|
/* import */ var node_buffer__rspack_import_0 = __webpack_require__("node:buffer");
|
|
12361
|
-
/* import */ var react__rspack_import_1 = __webpack_require__("./node_modules/react/index.js");
|
|
12362
|
-
|
|
12363
12506
|
|
|
12364
|
-
const isServerComponent = (value)=>'function' == typeof value;
|
|
12365
|
-
const asMcpElement = (node)=>{
|
|
12366
|
-
let element = node;
|
|
12367
|
-
while(isValidElement(element) && isServerComponent(element.type))element = element.type(element.props);
|
|
12368
|
-
if (!isValidElement(element) || 'string' != typeof element.type || !element.type.startsWith('mcp-')) throw new Error('Expected an MCP result element');
|
|
12369
|
-
return {
|
|
12370
|
-
props: element.props,
|
|
12371
|
-
type: element.type
|
|
12372
|
-
};
|
|
12373
|
-
};
|
|
12374
|
-
const requiredString = (value, message)=>{
|
|
12375
|
-
if ('string' != typeof value || '' === value.trim()) throw new Error(message);
|
|
12376
|
-
return value;
|
|
12377
|
-
};
|
|
12378
|
-
const textChild = (children, message)=>{
|
|
12379
|
-
const values = Children.toArray(children);
|
|
12380
|
-
if (1 !== values.length || 'string' != typeof values[0]) throw new Error(message);
|
|
12381
|
-
return values[0];
|
|
12382
|
-
};
|
|
12383
12507
|
const jsonLeafBytes = (value)=>node_buffer__rspack_import_0.Buffer.byteLength(JSON.stringify(value), 'utf8');
|
|
12384
12508
|
const isArrayIndex = (key, length)=>{
|
|
12385
12509
|
if ('0' === key) return length > 0;
|
|
@@ -12441,16 +12565,6 @@ const cloneJsonValue = (value, ancestors, path, depth = 0, budget)=>{
|
|
|
12441
12565
|
ancestors.delete(value);
|
|
12442
12566
|
}
|
|
12443
12567
|
};
|
|
12444
|
-
const jsonRecord = (value, message)=>{
|
|
12445
|
-
try {
|
|
12446
|
-
if (null === value || 'object' != typeof value || Array.isArray(value)) throw new Error('not a plain object');
|
|
12447
|
-
return cloneJsonValue(value, new Set(), '');
|
|
12448
|
-
} catch (error) {
|
|
12449
|
-
throw new Error(`${message} (${error instanceof Error ? error.message : String(error)})`, {
|
|
12450
|
-
cause: error
|
|
12451
|
-
});
|
|
12452
|
-
}
|
|
12453
|
-
};
|
|
12454
12568
|
const deepFreezeJson = (value)=>{
|
|
12455
12569
|
if ('object' == typeof value && null !== value) {
|
|
12456
12570
|
for (const child of Object.values(value))deepFreezeJson(child);
|
|
@@ -12468,89 +12582,6 @@ const snapshotJsonValue = (value, message, budget)=>{
|
|
|
12468
12582
|
});
|
|
12469
12583
|
}
|
|
12470
12584
|
};
|
|
12471
|
-
const lowerContent = (node)=>{
|
|
12472
|
-
const element = asMcpElement(node);
|
|
12473
|
-
const { props } = element;
|
|
12474
|
-
switch(element.type){
|
|
12475
|
-
case 'mcp-text':
|
|
12476
|
-
return {
|
|
12477
|
-
text: textChild(props.children, 'mcp-text requires one text child'),
|
|
12478
|
-
type: 'text'
|
|
12479
|
-
};
|
|
12480
|
-
case 'mcp-image':
|
|
12481
|
-
return {
|
|
12482
|
-
data: requiredString(props.data, 'mcp-image requires non-empty data and mimeType'),
|
|
12483
|
-
mimeType: requiredString(props.mimeType, 'mcp-image requires non-empty data and mimeType'),
|
|
12484
|
-
type: 'image'
|
|
12485
|
-
};
|
|
12486
|
-
case 'mcp-audio':
|
|
12487
|
-
return {
|
|
12488
|
-
data: requiredString(props.data, 'mcp-audio requires non-empty data and mimeType'),
|
|
12489
|
-
mimeType: requiredString(props.mimeType, 'mcp-audio requires non-empty data and mimeType'),
|
|
12490
|
-
type: 'audio'
|
|
12491
|
-
};
|
|
12492
|
-
case 'mcp-resource-link':
|
|
12493
|
-
{
|
|
12494
|
-
const mimeType = props.mimeType;
|
|
12495
|
-
if (void 0 !== mimeType && 'string' != typeof mimeType) throw new Error('mcp-resource-link mimeType must be a string');
|
|
12496
|
-
return {
|
|
12497
|
-
...void 0 === mimeType ? {} : {
|
|
12498
|
-
mimeType
|
|
12499
|
-
},
|
|
12500
|
-
name: requiredString(props.name, 'mcp-resource-link requires non-empty uri and name'),
|
|
12501
|
-
type: 'resource_link',
|
|
12502
|
-
uri: requiredString(props.uri, 'mcp-resource-link requires non-empty uri and name')
|
|
12503
|
-
};
|
|
12504
|
-
}
|
|
12505
|
-
case 'mcp-embedded-resource':
|
|
12506
|
-
{
|
|
12507
|
-
const hasText = void 0 !== props.text;
|
|
12508
|
-
const hasTextChild = void 0 !== props.children;
|
|
12509
|
-
const hasBlob = void 0 !== props.blob;
|
|
12510
|
-
if (Number(hasText) + Number(hasTextChild) + Number(hasBlob) !== 1) throw new Error('mcp-embedded-resource accepts exactly one text or blob value');
|
|
12511
|
-
const mimeType = props.mimeType;
|
|
12512
|
-
if (void 0 !== mimeType && 'string' != typeof mimeType) throw new Error('mcp-embedded-resource mimeType must be a string');
|
|
12513
|
-
const resource = {
|
|
12514
|
-
...void 0 === mimeType ? {} : {
|
|
12515
|
-
mimeType
|
|
12516
|
-
},
|
|
12517
|
-
uri: requiredString(props.uri, 'mcp-embedded-resource requires a non-empty uri'),
|
|
12518
|
-
...hasBlob ? {
|
|
12519
|
-
blob: requiredString(props.blob, 'mcp-embedded-resource blob must be non-empty')
|
|
12520
|
-
} : {
|
|
12521
|
-
text: hasTextChild ? textChild(props.children, 'mcp-embedded-resource requires one text child') : requiredString(props.text, 'mcp-embedded-resource text must be non-empty')
|
|
12522
|
-
}
|
|
12523
|
-
};
|
|
12524
|
-
return {
|
|
12525
|
-
resource,
|
|
12526
|
-
type: 'resource'
|
|
12527
|
-
};
|
|
12528
|
-
}
|
|
12529
|
-
case 'mcp-result':
|
|
12530
|
-
throw new Error('mcp-result may not be nested');
|
|
12531
|
-
default:
|
|
12532
|
-
throw new Error(`Unsupported MCP result element: ${element.type}`);
|
|
12533
|
-
}
|
|
12534
|
-
};
|
|
12535
|
-
const lowerMcpResult = (node)=>{
|
|
12536
|
-
const root = asMcpElement(node);
|
|
12537
|
-
if ('mcp-result' !== root.type) throw new Error('Expected mcp-result as the root element');
|
|
12538
|
-
if (void 0 !== root.props.isError && 'boolean' != typeof root.props.isError) throw new Error('mcp-result isError must be a boolean');
|
|
12539
|
-
const structuredContent = root.props.structuredContent;
|
|
12540
|
-
const metadata = root.props._meta;
|
|
12541
|
-
return {
|
|
12542
|
-
content: Children.toArray(root.props.children).map(lowerContent),
|
|
12543
|
-
...void 0 === metadata ? {} : {
|
|
12544
|
-
_meta: jsonRecord(metadata, 'mcp-result _meta must be JSON-serializable')
|
|
12545
|
-
},
|
|
12546
|
-
...void 0 === structuredContent ? {} : {
|
|
12547
|
-
structuredContent: jsonRecord(structuredContent, 'mcp-result structuredContent must be JSON-serializable')
|
|
12548
|
-
},
|
|
12549
|
-
...void 0 === root.props.isError ? {} : {
|
|
12550
|
-
isError: root.props.isError
|
|
12551
|
-
}
|
|
12552
|
-
};
|
|
12553
|
-
};
|
|
12554
12585
|
const AGENT_DOCUMENT_VERSION = 1;
|
|
12555
12586
|
const agentRenderAbortError = ()=>new DOMException('Agent render was aborted', 'AbortError');
|
|
12556
12587
|
const DEFAULT_AGENT_RENDER_LIMITS = Object.freeze({
|
|
@@ -12578,7 +12609,7 @@ const resolveAgentRenderLimits = (overrides = {})=>{
|
|
|
12578
12609
|
for (const [name, value] of Object.entries(limits))if (!Number.isSafeInteger(value) || value <= 0) throw new AgentContractError('invalid-document', `${name} must be a positive safe integer`);
|
|
12579
12610
|
return Object.freeze(limits);
|
|
12580
12611
|
};
|
|
12581
|
-
const
|
|
12612
|
+
const requiredString = (value, field)=>{
|
|
12582
12613
|
if ('string' != typeof value || '' === value.trim()) throw new AgentContractError('invalid-document', `${field} must be a non-empty string`);
|
|
12583
12614
|
return value;
|
|
12584
12615
|
};
|
|
@@ -12586,7 +12617,7 @@ const agent_document_text = (value, field)=>{
|
|
|
12586
12617
|
if ('string' != typeof value) throw new AgentContractError('invalid-document', `${field} must be a string`);
|
|
12587
12618
|
return value;
|
|
12588
12619
|
};
|
|
12589
|
-
const optionalString = (value, field)=>void 0 === value ? void 0 :
|
|
12620
|
+
const optionalString = (value, field)=>void 0 === value ? void 0 : requiredString(value, field);
|
|
12590
12621
|
const elapsedTimeExceeded = (maxElapsedMs)=>new AgentContractError('elapsed-time-exceeded', `Agent render elapsed time exceeds ${String(maxElapsedMs)}ms`);
|
|
12591
12622
|
const expectDocumentDepth = (depth, limits)=>{
|
|
12592
12623
|
if (depth > limits.maxDocumentDepth) throw new AgentContractError('document-depth-exceeded', `Agent Document depth exceeds ${String(limits.maxDocumentDepth)}`);
|
|
@@ -12684,15 +12715,15 @@ const snapshotNode = (node, depth, state)=>{
|
|
|
12684
12715
|
}
|
|
12685
12716
|
case 'image':
|
|
12686
12717
|
return Object.freeze({
|
|
12687
|
-
data:
|
|
12718
|
+
data: requiredString(node.data, 'Agent image data'),
|
|
12688
12719
|
kind: 'image',
|
|
12689
|
-
mimeType:
|
|
12720
|
+
mimeType: requiredString(node.mimeType, 'Agent image mimeType')
|
|
12690
12721
|
});
|
|
12691
12722
|
case 'audio':
|
|
12692
12723
|
return Object.freeze({
|
|
12693
|
-
data:
|
|
12724
|
+
data: requiredString(node.data, 'Agent audio data'),
|
|
12694
12725
|
kind: 'audio',
|
|
12695
|
-
mimeType:
|
|
12726
|
+
mimeType: requiredString(node.mimeType, 'Agent audio mimeType')
|
|
12696
12727
|
});
|
|
12697
12728
|
case 'resource':
|
|
12698
12729
|
{
|
|
@@ -12702,13 +12733,13 @@ const snapshotNode = (node, depth, state)=>{
|
|
|
12702
12733
|
...void 0 === mimeType ? {} : {
|
|
12703
12734
|
mimeType
|
|
12704
12735
|
},
|
|
12705
|
-
name:
|
|
12706
|
-
uri:
|
|
12736
|
+
name: requiredString(node.name, 'Agent resource name'),
|
|
12737
|
+
uri: requiredString(node.uri, 'Agent resource uri')
|
|
12707
12738
|
});
|
|
12708
12739
|
}
|
|
12709
12740
|
case 'error':
|
|
12710
12741
|
return Object.freeze({
|
|
12711
|
-
code:
|
|
12742
|
+
code: requiredString(node.code, 'Agent error code'),
|
|
12712
12743
|
kind: 'error',
|
|
12713
12744
|
message: agent_document_text(node.message, 'Agent error message')
|
|
12714
12745
|
});
|
|
@@ -12766,7 +12797,7 @@ const snapshotRenderError = (error, limits)=>{
|
|
|
12766
12797
|
nodes: 0
|
|
12767
12798
|
});
|
|
12768
12799
|
return Object.freeze({
|
|
12769
|
-
code:
|
|
12800
|
+
code: requiredString(error.code, 'Agent render error code'),
|
|
12770
12801
|
...void 0 === data ? {} : {
|
|
12771
12802
|
data
|
|
12772
12803
|
},
|
|
@@ -12801,7 +12832,7 @@ const snapshotEvent = (input, sequence, limits)=>{
|
|
|
12801
12832
|
}
|
|
12802
12833
|
case 'replace':
|
|
12803
12834
|
return Object.freeze({
|
|
12804
|
-
boundaryId:
|
|
12835
|
+
boundaryId: requiredString(input.boundaryId, 'Agent render boundaryId'),
|
|
12805
12836
|
document: createAgentDocument(input.document, limits),
|
|
12806
12837
|
sequence,
|
|
12807
12838
|
type: 'replace'
|
|
@@ -13374,51 +13405,11 @@ const Agent = Object.freeze({
|
|
|
13374
13405
|
Result: AgentResult,
|
|
13375
13406
|
Text: AgentText
|
|
13376
13407
|
});
|
|
13377
|
-
const Result = ({ children })=>(0,react__rspack_import_0.createElement)('agent-hook-result', null, children);
|
|
13378
|
-
const AdditionalContext = ({ children })=>(0,react__rspack_import_0.createElement)('agent-hook-additional-context', null, children);
|
|
13379
|
-
const Hook = {
|
|
13380
|
-
AdditionalContext: AdditionalContext,
|
|
13381
|
-
Result: Result
|
|
13382
|
-
};
|
|
13383
|
-
const McpResult = ({ _meta, children, isError, structuredContent })=>createElement('mcp-result', {
|
|
13384
|
-
_meta,
|
|
13385
|
-
isError,
|
|
13386
|
-
structuredContent
|
|
13387
|
-
}, children);
|
|
13388
|
-
const McpText = ({ children })=>createElement('mcp-text', null, children);
|
|
13389
|
-
const McpImage = ({ data, mimeType })=>createElement('mcp-image', {
|
|
13390
|
-
data,
|
|
13391
|
-
mimeType
|
|
13392
|
-
});
|
|
13393
|
-
const McpAudio = ({ data, mimeType })=>createElement('mcp-audio', {
|
|
13394
|
-
data,
|
|
13395
|
-
mimeType
|
|
13396
|
-
});
|
|
13397
|
-
const McpResourceLink = ({ mimeType, name, uri })=>createElement('mcp-resource-link', {
|
|
13398
|
-
mimeType,
|
|
13399
|
-
name,
|
|
13400
|
-
uri
|
|
13401
|
-
});
|
|
13402
|
-
const McpEmbeddedResource = ({ blob, children, mimeType, text, uri })=>createElement('mcp-embedded-resource', {
|
|
13403
|
-
blob,
|
|
13404
|
-
mimeType,
|
|
13405
|
-
text,
|
|
13406
|
-
uri
|
|
13407
|
-
}, children);
|
|
13408
|
-
const Mcp = (/* unused pure expression or super */ null && ({
|
|
13409
|
-
Audio: McpAudio,
|
|
13410
|
-
EmbeddedResource: McpEmbeddedResource,
|
|
13411
|
-
Image: McpImage,
|
|
13412
|
-
ResourceLink: McpResourceLink,
|
|
13413
|
-
Result: McpResult,
|
|
13414
|
-
Text: McpText
|
|
13415
|
-
}));
|
|
13416
13408
|
|
|
13417
13409
|
|
|
13418
13410
|
__webpack_require__.d(__webpack_exports__, {
|
|
13419
13411
|
}, {
|
|
13420
|
-
|
|
13421
|
-
qn: Hook
|
|
13412
|
+
g: Agent
|
|
13422
13413
|
});
|
|
13423
13414
|
|
|
13424
13415
|
|
|
@@ -13885,23 +13876,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
13885
13876
|
|
|
13886
13877
|
},
|
|
13887
13878
|
"./node_modules/@agent-bundle/runtime/dist/index.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
13888
|
-
/* import */ var
|
|
13889
|
-
/* import */ var
|
|
13890
|
-
/* import */ var
|
|
13891
|
-
/* import */ var
|
|
13892
|
-
/* import */ var
|
|
13893
|
-
/* import */ var
|
|
13894
|
-
/* import */ var
|
|
13895
|
-
/* import */ var
|
|
13896
|
-
/* import */ var
|
|
13879
|
+
/* import */ var effect__rspack_import_2 = __webpack_require__("./node_modules/effect/dist/Latch.js");
|
|
13880
|
+
/* import */ var effect__rspack_import_3 = __webpack_require__("./node_modules/effect/dist/Effect.js");
|
|
13881
|
+
/* import */ var effect__rspack_import_6 = __webpack_require__("./node_modules/effect/dist/Duration.js");
|
|
13882
|
+
/* import */ var effect__rspack_import_7 = __webpack_require__("./node_modules/effect/dist/Stream.js");
|
|
13883
|
+
/* import */ var effect__rspack_import_8 = __webpack_require__("./node_modules/effect/dist/Deferred.js");
|
|
13884
|
+
/* import */ var effect__rspack_import_9 = __webpack_require__("./node_modules/effect/dist/Queue.js");
|
|
13885
|
+
/* import */ var effect__rspack_import_10 = __webpack_require__("./node_modules/effect/dist/Option.js");
|
|
13886
|
+
/* import */ var effect__rspack_import_11 = __webpack_require__("./node_modules/effect/dist/Exit.js");
|
|
13887
|
+
/* import */ var effect__rspack_import_13 = __webpack_require__("./node_modules/effect/dist/Clock.js");
|
|
13897
13888
|
/* import */ var react__rspack_import_0 = __webpack_require__("./node_modules/react/index.js");
|
|
13898
13889
|
/* import */ var react_server_dom_rspack_client_node__rspack_import_1 = __webpack_require__("./node_modules/react-server-dom-rspack/client.node.js");
|
|
13899
|
-
/* import */ var
|
|
13900
|
-
/* import */ var
|
|
13901
|
-
/* import */ var
|
|
13902
|
-
/* import */ var _707_js__rspack_import_13 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/707.js");
|
|
13903
|
-
/* import */ var _506_js__rspack_import_15 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
|
|
13904
|
-
|
|
13890
|
+
/* import */ var _315_js__rspack_import_4 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/315.js");
|
|
13891
|
+
/* import */ var _302_js__rspack_import_5 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/302.js");
|
|
13892
|
+
/* import */ var _707_js__rspack_import_12 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/707.js");
|
|
13905
13893
|
|
|
13906
13894
|
|
|
13907
13895
|
|
|
@@ -13912,10 +13900,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
13912
13900
|
|
|
13913
13901
|
|
|
13914
13902
|
const createFlightDemand = ()=>{
|
|
13915
|
-
const pulling =
|
|
13903
|
+
const pulling = effect__rspack_import_2/* .makeUnsafe */.LZ(false);
|
|
13916
13904
|
let shellEmitted = false;
|
|
13917
13905
|
return {
|
|
13918
|
-
markShell:
|
|
13906
|
+
markShell: effect__rspack_import_3/* .sync */.OH5(()=>{
|
|
13919
13907
|
shellEmitted = true;
|
|
13920
13908
|
}),
|
|
13921
13909
|
notePull () {
|
|
@@ -13924,11 +13912,11 @@ const createFlightDemand = ()=>{
|
|
|
13924
13912
|
notePullEnd () {
|
|
13925
13913
|
pulling.closeUnsafe();
|
|
13926
13914
|
},
|
|
13927
|
-
wait:
|
|
13915
|
+
wait: effect__rspack_import_3/* .suspend */.DYE(()=>shellEmitted ? pulling.await : effect__rspack_import_3/* ["void"] */.rIH)
|
|
13928
13916
|
};
|
|
13929
13917
|
};
|
|
13930
|
-
const emitBoundRenderEvent = (sequence, input)=>
|
|
13931
|
-
catch: (error)=>(0,
|
|
13918
|
+
const emitBoundRenderEvent = (sequence, input)=>effect__rspack_import_3/* ["try"] */.SvU({
|
|
13919
|
+
catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
|
|
13932
13920
|
try: ()=>sequence.emit(input)
|
|
13933
13921
|
});
|
|
13934
13922
|
const agentElementTypes = Object.freeze([
|
|
@@ -13945,7 +13933,7 @@ const agentElementTypes = Object.freeze([
|
|
|
13945
13933
|
]);
|
|
13946
13934
|
const isAgentElementType = (value)=>agentElementTypes.includes(value);
|
|
13947
13935
|
const protocolElement = (node)=>{
|
|
13948
|
-
if (!(0,react__rspack_import_0.isValidElement)(node) || 'string' != typeof node.type || !isAgentElementType(node.type)) throw new
|
|
13936
|
+
if (!(0,react__rspack_import_0.isValidElement)(node) || 'string' != typeof node.type || !isAgentElementType(node.type)) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight output must contain only Agent protocol elements; function components and HTML are unsupported');
|
|
13949
13937
|
return {
|
|
13950
13938
|
props: node.props,
|
|
13951
13939
|
type: node.type
|
|
@@ -13953,31 +13941,31 @@ const protocolElement = (node)=>{
|
|
|
13953
13941
|
};
|
|
13954
13942
|
const textChild = (children, type)=>{
|
|
13955
13943
|
const values = react__rspack_import_0.Children.toArray(children);
|
|
13956
|
-
if (1 !== values.length || 'string' != typeof values[0]) throw new
|
|
13944
|
+
if (1 !== values.length || 'string' != typeof values[0]) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', `${type} requires exactly one string child`);
|
|
13957
13945
|
return values[0];
|
|
13958
13946
|
};
|
|
13959
13947
|
const decodeBudget = (state)=>({
|
|
13960
13948
|
addBytes (n) {
|
|
13961
13949
|
state.bytes += n;
|
|
13962
|
-
if (state.bytes > state.limits.maxDocumentBytes) throw new
|
|
13950
|
+
if (state.bytes > state.limits.maxDocumentBytes) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('document-bytes-exceeded', `Agent Document bytes exceed ${String(state.limits.maxDocumentBytes)}`);
|
|
13963
13951
|
},
|
|
13964
13952
|
addNode () {
|
|
13965
|
-
(0,
|
|
13953
|
+
(0,_302_js__rspack_import_5/* .admitDocumentNode */.Dy)(state);
|
|
13966
13954
|
},
|
|
13967
13955
|
checkDepth (depth) {
|
|
13968
|
-
(0,
|
|
13956
|
+
(0,_302_js__rspack_import_5/* .expectDocumentDepth */.MI)(depth, state.limits);
|
|
13969
13957
|
}
|
|
13970
13958
|
});
|
|
13971
13959
|
const isJsonObject = (value)=>null != value && 'object' == typeof value && !Array.isArray(value);
|
|
13972
13960
|
const budgetedJson = (value, message, depth, state)=>{
|
|
13973
13961
|
try {
|
|
13974
|
-
return (0,
|
|
13962
|
+
return (0,_302_js__rspack_import_5/* .snapshotJsonValue */.mY)(value, message, {
|
|
13975
13963
|
depth,
|
|
13976
13964
|
limits: decodeBudget(state)
|
|
13977
13965
|
});
|
|
13978
13966
|
} catch (error) {
|
|
13979
|
-
if (error instanceof
|
|
13980
|
-
throw new
|
|
13967
|
+
if (error instanceof _302_js__rspack_import_5/* .AgentContractError */.I2) throw error;
|
|
13968
|
+
throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', error instanceof Error ? error.message : message, {
|
|
13981
13969
|
cause: error
|
|
13982
13970
|
});
|
|
13983
13971
|
}
|
|
@@ -14036,8 +14024,8 @@ const decodeResult = (props, depth, state)=>{
|
|
|
14036
14024
|
return node;
|
|
14037
14025
|
};
|
|
14038
14026
|
const decodeNode = (node, depth, state)=>{
|
|
14039
|
-
(0,
|
|
14040
|
-
(0,
|
|
14027
|
+
(0,_302_js__rspack_import_5/* .expectDocumentDepth */.MI)(depth, state.limits);
|
|
14028
|
+
(0,_302_js__rspack_import_5/* .admitDocumentNode */.Dy)(state);
|
|
14041
14029
|
const element = protocolElement(node);
|
|
14042
14030
|
const { props } = element;
|
|
14043
14031
|
switch(element.type){
|
|
@@ -14105,14 +14093,14 @@ const decodeNode = (node, depth, state)=>{
|
|
|
14105
14093
|
default:
|
|
14106
14094
|
{
|
|
14107
14095
|
const exhaustive = element.type;
|
|
14108
|
-
throw new
|
|
14096
|
+
throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', `Unsupported Agent protocol element: ${String(exhaustive)}`);
|
|
14109
14097
|
}
|
|
14110
14098
|
}
|
|
14111
14099
|
};
|
|
14112
14100
|
const decodeAgentDocument = (node, limits = {})=>{
|
|
14113
|
-
const resolved = (0,
|
|
14101
|
+
const resolved = (0,_302_js__rspack_import_5/* .resolveAgentRenderLimits */.i0)(limits);
|
|
14114
14102
|
const root = protocolElement(node);
|
|
14115
|
-
if ('agent-result' !== root.type) throw new
|
|
14103
|
+
if ('agent-result' !== root.type) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight output must have Agent.Result as its root');
|
|
14116
14104
|
const state = {
|
|
14117
14105
|
bytes: 0,
|
|
14118
14106
|
discardedBytes: 0,
|
|
@@ -14123,7 +14111,7 @@ const decodeAgentDocument = (node, limits = {})=>{
|
|
|
14123
14111
|
};
|
|
14124
14112
|
const documentRoot = decodeNode(node, 1, state);
|
|
14125
14113
|
const value = state.resultValues.get(documentRoot)?.value;
|
|
14126
|
-
const document = (0,
|
|
14114
|
+
const document = (0,_302_js__rspack_import_5/* .createAgentDocument */.ZX)({
|
|
14127
14115
|
root: documentRoot,
|
|
14128
14116
|
status: state.representedError ? 'represented-error' : 'success',
|
|
14129
14117
|
...void 0 === value ? {} : {
|
|
@@ -14131,13 +14119,13 @@ const decodeAgentDocument = (node, limits = {})=>{
|
|
|
14131
14119
|
},
|
|
14132
14120
|
version: 1
|
|
14133
14121
|
}, resolved);
|
|
14134
|
-
if (state.discardedBytes > 0 && state.discardedBytes + jsonBytes(document) > resolved.maxDocumentBytes) throw new
|
|
14122
|
+
if (state.discardedBytes > 0 && state.discardedBytes + jsonBytes(document) > resolved.maxDocumentBytes) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('document-bytes-exceeded', `Agent Document bytes exceed ${String(resolved.maxDocumentBytes)}`);
|
|
14135
14123
|
return document;
|
|
14136
14124
|
};
|
|
14137
14125
|
const REACT_FRAGMENT = Symbol.for('react.fragment');
|
|
14138
14126
|
const REACT_LAZY = Symbol.for('react.lazy');
|
|
14139
14127
|
const REACT_SUSPENSE = Symbol.for('react.suspense');
|
|
14140
|
-
const abortError =
|
|
14128
|
+
const abortError = _302_js__rspack_import_5/* .agentRenderAbortError */.k2;
|
|
14141
14129
|
const isObject = (value)=>'object' == typeof value && null !== value;
|
|
14142
14130
|
const isThenable = (value)=>isObject(value) && 'function' == typeof value.then;
|
|
14143
14131
|
const isLazyElement = (value)=>isObject(value) && value.$$typeof === REACT_LAZY && isThenable(value._payload);
|
|
@@ -14168,7 +14156,7 @@ const classifyNode = (node)=>{
|
|
|
14168
14156
|
kind: 'thenable',
|
|
14169
14157
|
value: node
|
|
14170
14158
|
};
|
|
14171
|
-
if (!(0,react__rspack_import_0.isValidElement)(node)) throw new
|
|
14159
|
+
if (!(0,react__rspack_import_0.isValidElement)(node)) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight output contained an unsupported node');
|
|
14172
14160
|
const type = node.type;
|
|
14173
14161
|
if (type === REACT_SUSPENSE) return {
|
|
14174
14162
|
kind: 'suspense',
|
|
@@ -14182,7 +14170,7 @@ const classifyNode = (node)=>{
|
|
|
14182
14170
|
kind: 'protocol',
|
|
14183
14171
|
value: node
|
|
14184
14172
|
};
|
|
14185
|
-
throw new
|
|
14173
|
+
throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', "Flight output must contain only Agent protocol elements; function components and HTML are unsupported");
|
|
14186
14174
|
};
|
|
14187
14175
|
const thenableStatus = (thenable)=>{
|
|
14188
14176
|
switch(thenable.status){
|
|
@@ -14357,8 +14345,8 @@ const snapshotTree = (root, ids)=>{
|
|
|
14357
14345
|
tree: materializeNode(root, '', ctx)
|
|
14358
14346
|
};
|
|
14359
14347
|
};
|
|
14360
|
-
const hostError = (signal, error)=>signal.aborted || (0,
|
|
14361
|
-
const waitSettledBoundary = (pending)=>
|
|
14348
|
+
const hostError = (signal, error)=>signal.aborted || (0,_315_js__rspack_import_4/* .isAbortError */.zf)(error) ? abortError() : (0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error);
|
|
14349
|
+
const waitSettledBoundary = (pending)=>effect__rspack_import_3/* .raceAll */.Vdx(pending.map((boundary)=>effect__rspack_import_3/* .promise */.ivC(()=>Promise.resolve(boundary.thenable).then(()=>({
|
|
14362
14350
|
boundary,
|
|
14363
14351
|
ok: true
|
|
14364
14352
|
}), (error)=>({
|
|
@@ -14368,8 +14356,8 @@ const waitSettledBoundary = (pending)=>effect__rspack_import_4/* .raceAll */.Vdx
|
|
|
14368
14356
|
})))));
|
|
14369
14357
|
const waitOrDeadline = (wait, sequence)=>{
|
|
14370
14358
|
const remaining = sequence.remainingMs;
|
|
14371
|
-
if (remaining <= 0) return
|
|
14372
|
-
return
|
|
14359
|
+
if (remaining <= 0) return effect__rspack_import_3/* .fail */.fJG((0,_302_js__rspack_import_5/* .elapsedTimeExceeded */.zm)(sequence.maxElapsedMs));
|
|
14360
|
+
return effect__rspack_import_3/* .raceFirst */.KT6(wait, effect__rspack_import_3/* .sleep */.yy4(effect__rspack_import_6/* .millis */.ne(remaining)).pipe(effect__rspack_import_3/* .flatMap */.qIB(()=>effect__rspack_import_3/* .fail */.fJG((0,_302_js__rspack_import_5/* .elapsedTimeExceeded */.zm)(sequence.maxElapsedMs)))));
|
|
14373
14361
|
};
|
|
14374
14362
|
const settledBoundaryInputs = (previous, next, winner, limits)=>{
|
|
14375
14363
|
const stillPending = new Set(next.pending.map((boundary)=>boundary.id));
|
|
@@ -14402,9 +14390,9 @@ const settledBoundaryInputs = (previous, next, winner, limits)=>{
|
|
|
14402
14390
|
for (const boundary of previous.pending)if (boundary.id !== winner.boundary.id) emitFor(boundary.id);
|
|
14403
14391
|
return inputs;
|
|
14404
14392
|
};
|
|
14405
|
-
const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInputs, sequence)=>
|
|
14406
|
-
if (0 === snapshot.pending.length) return waitOrDeadline(
|
|
14407
|
-
catch: (error)=>(0,
|
|
14393
|
+
const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInputs, sequence)=>effect__rspack_import_7/* .paginate */.EnV(initial, (snapshot)=>{
|
|
14394
|
+
if (0 === snapshot.pending.length) return waitOrDeadline(effect__rspack_import_8/* ["await"] */.Tx(flightDone), sequence).pipe(effect__rspack_import_3/* .andThen */.hgn(effect__rspack_import_9/* .clear */.IU(progressInputs)), effect__rspack_import_3/* .flatMap */.qIB((queued)=>effect__rspack_import_3/* ["try"] */.SvU({
|
|
14395
|
+
catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
|
|
14408
14396
|
try: ()=>[
|
|
14409
14397
|
[
|
|
14410
14398
|
...queued,
|
|
@@ -14413,32 +14401,32 @@ const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInp
|
|
|
14413
14401
|
type: 'complete'
|
|
14414
14402
|
}
|
|
14415
14403
|
],
|
|
14416
|
-
|
|
14404
|
+
effect__rspack_import_10.none()
|
|
14417
14405
|
]
|
|
14418
14406
|
})));
|
|
14419
|
-
return
|
|
14407
|
+
return effect__rspack_import_3/* .raceFirst */.KT6(waitOrDeadline(waitSettledBoundary(snapshot.pending), sequence).pipe(effect__rspack_import_3/* .map */.TjK((winner)=>({
|
|
14420
14408
|
kind: 'boundary',
|
|
14421
14409
|
winner
|
|
14422
|
-
}))),
|
|
14410
|
+
}))), effect__rspack_import_9/* .take */.s(progressInputs).pipe(effect__rspack_import_3/* .map */.TjK((input)=>({
|
|
14423
14411
|
kind: 'progress',
|
|
14424
14412
|
input
|
|
14425
|
-
})))).pipe(
|
|
14413
|
+
})))).pipe(effect__rspack_import_3/* .flatMap */.qIB((event)=>{
|
|
14426
14414
|
switch(event.kind){
|
|
14427
14415
|
case 'progress':
|
|
14428
|
-
return
|
|
14416
|
+
return effect__rspack_import_3/* .succeed */.PyW([
|
|
14429
14417
|
[
|
|
14430
14418
|
event.input
|
|
14431
14419
|
],
|
|
14432
|
-
|
|
14420
|
+
effect__rspack_import_10.some(snapshot)
|
|
14433
14421
|
]);
|
|
14434
14422
|
case 'boundary':
|
|
14435
|
-
return
|
|
14436
|
-
catch: (error)=>(0,
|
|
14423
|
+
return effect__rspack_import_3/* ["try"] */.SvU({
|
|
14424
|
+
catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
|
|
14437
14425
|
try: ()=>{
|
|
14438
14426
|
const next = snapshotTree(root, ids);
|
|
14439
14427
|
return [
|
|
14440
14428
|
settledBoundaryInputs(snapshot, next, event.winner, limits),
|
|
14441
|
-
|
|
14429
|
+
effect__rspack_import_10.some(next)
|
|
14442
14430
|
];
|
|
14443
14431
|
}
|
|
14444
14432
|
});
|
|
@@ -14450,38 +14438,38 @@ const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInp
|
|
|
14450
14438
|
}
|
|
14451
14439
|
}));
|
|
14452
14440
|
});
|
|
14453
|
-
const gatedFlightStream = (flight, demand, flightDone)=>
|
|
14454
|
-
const reader = yield*
|
|
14455
|
-
const cancelExit = yield*
|
|
14456
|
-
catch: (error)=>(0,
|
|
14441
|
+
const gatedFlightStream = (flight, demand, flightDone)=>effect__rspack_import_7/* .unwrap */.oAg(effect__rspack_import_3/* .gen */.JkU(function*() {
|
|
14442
|
+
const reader = yield* effect__rspack_import_3/* .acquireRelease */.Q56(effect__rspack_import_3/* .sync */.OH5(()=>flight.getReader()), (handle, exit)=>effect__rspack_import_3/* .gen */.JkU(function*() {
|
|
14443
|
+
const cancelExit = yield* effect__rspack_import_3/* .exit */.NS5(effect__rspack_import_3/* .tryPromise */.$mh({
|
|
14444
|
+
catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
|
|
14457
14445
|
try: ()=>handle.cancel()
|
|
14458
14446
|
}));
|
|
14459
|
-
if (
|
|
14460
|
-
if (
|
|
14461
|
-
const error = (0,
|
|
14462
|
-
yield*
|
|
14463
|
-
return yield*
|
|
14447
|
+
if (effect__rspack_import_11/* .isFailure */.N6(exit)) return void (yield* effect__rspack_import_8/* .fail */.fJ(flightDone, (0,_315_js__rspack_import_4/* .mapCause */.K0)(exit.cause)));
|
|
14448
|
+
if (effect__rspack_import_11/* .isFailure */.N6(cancelExit)) {
|
|
14449
|
+
const error = (0,_315_js__rspack_import_4/* .mapCause */.K0)(cancelExit.cause);
|
|
14450
|
+
yield* effect__rspack_import_8/* .fail */.fJ(flightDone, error);
|
|
14451
|
+
return yield* effect__rspack_import_3/* .die */.F_Q(error);
|
|
14464
14452
|
}
|
|
14465
|
-
yield*
|
|
14453
|
+
yield* effect__rspack_import_8/* .succeed */.Py(flightDone, void 0);
|
|
14466
14454
|
}));
|
|
14467
|
-
return
|
|
14468
|
-
catch: (error)=>(0,
|
|
14455
|
+
return effect__rspack_import_7/* .unfold */.t8s(void 0, ()=>demand.wait.pipe(effect__rspack_import_3/* .flatMap */.qIB(()=>effect__rspack_import_3/* .tryPromise */.$mh({
|
|
14456
|
+
catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
|
|
14469
14457
|
try: ()=>reader.read()
|
|
14470
|
-
})),
|
|
14458
|
+
})), effect__rspack_import_3/* .map */.TjK((next)=>next.done ? void 0 : [
|
|
14471
14459
|
next.value,
|
|
14472
14460
|
void 0
|
|
14473
14461
|
])));
|
|
14474
14462
|
}));
|
|
14475
|
-
const decodeFlightRoot = (flight, demand, signal, flightDone)=>
|
|
14476
|
-
(0,
|
|
14477
|
-
const flightAbort = yield*
|
|
14478
|
-
const readable = (0,
|
|
14463
|
+
const decodeFlightRoot = (flight, demand, signal, flightDone)=>effect__rspack_import_3/* .gen */.JkU(function*() {
|
|
14464
|
+
(0,_707_js__rspack_import_12/* .ensureAgentFlightManifest */.n)();
|
|
14465
|
+
const flightAbort = yield* _315_js__rspack_import_4/* .scopedAbortSignal */.lQ;
|
|
14466
|
+
const readable = (0,_315_js__rspack_import_4/* .streamToReadableStream */._I)(gatedFlightStream(flight, demand, flightDone), {
|
|
14479
14467
|
signal: flightAbort,
|
|
14480
14468
|
strategy: {
|
|
14481
14469
|
highWaterMark: 1
|
|
14482
14470
|
}
|
|
14483
14471
|
});
|
|
14484
|
-
return yield*
|
|
14472
|
+
return yield* effect__rspack_import_3/* .tryPromise */.$mh({
|
|
14485
14473
|
catch: (error)=>hostError(signal, error),
|
|
14486
14474
|
try: ()=>(0,react_server_dom_rspack_client_node__rspack_import_1.createFromReadableStream)(readable, {
|
|
14487
14475
|
unstable_allowPartialStream: true
|
|
@@ -14498,11 +14486,11 @@ const progressInput = (update)=>({
|
|
|
14498
14486
|
},
|
|
14499
14487
|
type: 'progress'
|
|
14500
14488
|
});
|
|
14501
|
-
const handoffRequired = ()=>new
|
|
14489
|
+
const handoffRequired = ()=>new _302_js__rspack_import_5/* .AgentContractError */.I2('handoff-required', 'The render is complete; later work requires a new invocation handoff');
|
|
14502
14490
|
const createAgentRenderEventSession = (options)=>{
|
|
14503
14491
|
const clock = options.clock;
|
|
14504
|
-
const sequence = (0,
|
|
14505
|
-
const maxBufferedProgress = (0,
|
|
14492
|
+
const sequence = (0,_302_js__rspack_import_5/* .createAgentRenderEventSequence */.n4)(options.limits, void 0 === clock ? void 0 : ()=>clock.currentTimeMillisUnsafe());
|
|
14493
|
+
const maxBufferedProgress = (0,_302_js__rspack_import_5/* .resolveAgentRenderLimits */.i0)(options.limits).maxEvents;
|
|
14506
14494
|
let offerProgress;
|
|
14507
14495
|
let progressFailure;
|
|
14508
14496
|
const bufferedProgress = [];
|
|
@@ -14512,36 +14500,36 @@ const createAgentRenderEventSession = (options)=>{
|
|
|
14512
14500
|
if (sequence.completed) throw handoffRequired();
|
|
14513
14501
|
const input = progressInput(update);
|
|
14514
14502
|
if (void 0 === offerProgress) {
|
|
14515
|
-
if (bufferedProgress.length >= maxBufferedProgress) throw new
|
|
14503
|
+
if (bufferedProgress.length >= maxBufferedProgress) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('event-count-exceeded', `Agent render event count exceeds ${String(maxBufferedProgress)}`);
|
|
14516
14504
|
bufferedProgress.push(input);
|
|
14517
14505
|
return;
|
|
14518
14506
|
}
|
|
14519
|
-
await (0,
|
|
14507
|
+
await (0,_315_js__rspack_import_4/* .runPromise */.pR)(offerProgress(input));
|
|
14520
14508
|
}
|
|
14521
14509
|
});
|
|
14522
|
-
const events =
|
|
14523
|
-
const progressInputs = yield*
|
|
14524
|
-
const flightDone = yield*
|
|
14510
|
+
const events = effect__rspack_import_7/* .unwrap */.oAg(effect__rspack_import_3/* .gen */.JkU(function*() {
|
|
14511
|
+
const progressInputs = yield* effect__rspack_import_9/* .bounded */.Mm(0);
|
|
14512
|
+
const flightDone = yield* effect__rspack_import_8/* .make */.L8();
|
|
14525
14513
|
const bindProgress = ()=>{
|
|
14526
|
-
offerProgress = (input)=>
|
|
14527
|
-
if (void 0 !== progressFailure) return
|
|
14528
|
-
if (!accepted) return
|
|
14529
|
-
return
|
|
14514
|
+
offerProgress = (input)=>effect__rspack_import_9/* .offer */.x(progressInputs, input).pipe(effect__rspack_import_3/* .flatMap */.qIB((accepted)=>{
|
|
14515
|
+
if (void 0 !== progressFailure) return effect__rspack_import_3/* .fail */.fJG(progressFailure);
|
|
14516
|
+
if (!accepted) return effect__rspack_import_3/* .fail */.fJG(handoffRequired());
|
|
14517
|
+
return effect__rspack_import_3/* ["void"] */.rIH;
|
|
14530
14518
|
}));
|
|
14531
14519
|
};
|
|
14532
|
-
const finalizeProgress = (error)=>
|
|
14520
|
+
const finalizeProgress = (error)=>effect__rspack_import_3/* .sync */.OH5(()=>{
|
|
14533
14521
|
progressFailure = error;
|
|
14534
|
-
}).pipe(
|
|
14535
|
-
const setup =
|
|
14536
|
-
const flight = yield*
|
|
14522
|
+
}).pipe(effect__rspack_import_3/* .andThen */.hgn(effect__rspack_import_9/* .shutdown */.n_(progressInputs)));
|
|
14523
|
+
const setup = effect__rspack_import_3/* .gen */.JkU(function*() {
|
|
14524
|
+
const flight = yield* effect__rspack_import_3/* .tryPromise */.$mh({
|
|
14537
14525
|
catch: (error)=>hostError(options.signal, error),
|
|
14538
14526
|
try: ()=>options.flight
|
|
14539
14527
|
});
|
|
14540
|
-
if (options.signal.aborted) return yield*
|
|
14528
|
+
if (options.signal.aborted) return yield* effect__rspack_import_3/* .fail */.fJG(abortError());
|
|
14541
14529
|
const root = yield* decodeFlightRoot(flight, options.demand, options.signal, flightDone);
|
|
14542
|
-
if (options.signal.aborted) return yield*
|
|
14543
|
-
const prepared = yield*
|
|
14544
|
-
catch: (error)=>(0,
|
|
14530
|
+
if (options.signal.aborted) return yield* effect__rspack_import_3/* .fail */.fJG(abortError());
|
|
14531
|
+
const prepared = yield* effect__rspack_import_3/* ["try"] */.SvU({
|
|
14532
|
+
catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
|
|
14545
14533
|
try: ()=>{
|
|
14546
14534
|
const ids = new Map();
|
|
14547
14535
|
const initial = snapshotTree(root, ids);
|
|
@@ -14556,23 +14544,23 @@ const createAgentRenderEventSession = (options)=>{
|
|
|
14556
14544
|
}
|
|
14557
14545
|
});
|
|
14558
14546
|
bindProgress();
|
|
14559
|
-
return
|
|
14547
|
+
return effect__rspack_import_7/* .concat */.xWs(effect__rspack_import_7/* .fromArray */.ciY([
|
|
14560
14548
|
prepared.shellInput,
|
|
14561
14549
|
...bufferedProgress
|
|
14562
|
-
]), reconcileLoopStream(root, prepared.ids, prepared.initial, options.limits, flightDone, progressInputs, sequence)).pipe(
|
|
14563
|
-
if (
|
|
14564
|
-
const error = (0,
|
|
14565
|
-
return finalizeProgress(sequence.completed && (0,
|
|
14550
|
+
]), reconcileLoopStream(root, prepared.ids, prepared.initial, options.limits, flightDone, progressInputs, sequence)).pipe(effect__rspack_import_7/* .mapEffect */.WK$((input)=>emitBoundRenderEvent(sequence, input)), effect__rspack_import_7/* .tap */.Mim((event)=>'shell' === event.type ? options.demand.markShell : effect__rspack_import_3/* ["void"] */.rIH), effect__rspack_import_7/* .takeUntil */.QKh((event)=>'complete' === event.type), effect__rspack_import_7/* .onExit */.cfM((exit)=>{
|
|
14551
|
+
if (effect__rspack_import_11/* .isSuccess */.oJ(exit)) return finalizeProgress(handoffRequired());
|
|
14552
|
+
const error = (0,_315_js__rspack_import_4/* .mapCause */.K0)(exit.cause);
|
|
14553
|
+
return finalizeProgress(sequence.completed && (0,_315_js__rspack_import_4/* .isAbortError */.zf)(error) ? handoffRequired() : error);
|
|
14566
14554
|
}));
|
|
14567
14555
|
});
|
|
14568
|
-
return yield* setup.pipe(
|
|
14556
|
+
return yield* setup.pipe(effect__rspack_import_3/* .onExit */.cfM((exit)=>effect__rspack_import_11/* .isFailure */.N6(exit) ? finalizeProgress((0,_315_js__rspack_import_4/* .mapCause */.K0)(exit.cause)) : effect__rspack_import_3/* ["void"] */.rIH));
|
|
14569
14557
|
}));
|
|
14570
14558
|
return {
|
|
14571
|
-
events: void 0 === clock ? events :
|
|
14559
|
+
events: void 0 === clock ? events : effect__rspack_import_7/* .provideService */.PfK(events, effect__rspack_import_13/* .Clock */.zD, clock),
|
|
14572
14560
|
progress
|
|
14573
14561
|
};
|
|
14574
14562
|
};
|
|
14575
|
-
const toPublicEventStream = (events, demand, signal)=>(0,
|
|
14563
|
+
const toPublicEventStream = (events, demand, signal)=>(0,_315_js__rspack_import_4/* .streamToReadableStream */._I)(effect__rspack_import_7/* .interruptWhen */.S67(events, (0,_315_js__rspack_import_4/* .abortToInterrupt */.p7)(signal)), {
|
|
14576
14564
|
closeOn: (event)=>'complete' === event.type,
|
|
14577
14565
|
onPull: demand.notePull,
|
|
14578
14566
|
onPullDelivered: demand.notePullEnd,
|
|
@@ -14590,7 +14578,7 @@ const decodeAgentFlightStream = (flight, options = {})=>{
|
|
|
14590
14578
|
signal
|
|
14591
14579
|
}).events, demand, signal);
|
|
14592
14580
|
};
|
|
14593
|
-
const dispatcher_abortError =
|
|
14581
|
+
const dispatcher_abortError = _302_js__rspack_import_5/* .agentRenderAbortError */.k2;
|
|
14594
14582
|
const abortedStream = ()=>new ReadableStream({
|
|
14595
14583
|
start (controller) {
|
|
14596
14584
|
controller.error(dispatcher_abortError());
|
|
@@ -14625,7 +14613,7 @@ const drainCompleteDocument = async (events, signal)=>{
|
|
|
14625
14613
|
}
|
|
14626
14614
|
if (void 0 !== complete) return complete;
|
|
14627
14615
|
if (signal.aborted) throw dispatcher_abortError();
|
|
14628
|
-
throw new
|
|
14616
|
+
throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight stream ended without a complete document');
|
|
14629
14617
|
};
|
|
14630
14618
|
const createAgentRenderDispatcher = (host, options = {})=>{
|
|
14631
14619
|
const stream = (request)=>{
|
|
@@ -14636,7 +14624,7 @@ const createAgentRenderDispatcher = (host, options = {})=>{
|
|
|
14636
14624
|
demand,
|
|
14637
14625
|
get flight () {
|
|
14638
14626
|
const current = pendingFlight.current;
|
|
14639
|
-
if (void 0 === current) return Promise.reject(new
|
|
14627
|
+
if (void 0 === current) return Promise.reject(new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight worker is not running'));
|
|
14640
14628
|
return current;
|
|
14641
14629
|
},
|
|
14642
14630
|
limits: {
|
|
@@ -14767,21 +14755,21 @@ const appendNode = (node, content, capabilities, fallback)=>{
|
|
|
14767
14755
|
default:
|
|
14768
14756
|
{
|
|
14769
14757
|
const exhaustive = node;
|
|
14770
|
-
throw new
|
|
14758
|
+
throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', `Unsupported Agent Document node: ${String(exhaustive.kind)}`);
|
|
14771
14759
|
}
|
|
14772
14760
|
}
|
|
14773
14761
|
};
|
|
14774
14762
|
const project_mcp_isJsonObject = (value)=>null !== value && 'object' == typeof value && !Array.isArray(value);
|
|
14775
14763
|
const objectStructuredContent = (value)=>{
|
|
14776
14764
|
if (void 0 === value) return;
|
|
14777
|
-
const snapshot = (0,
|
|
14765
|
+
const snapshot = (0,_302_js__rspack_import_5/* .snapshotJsonValue */.mY)(value, 'MCP structured content must be JSON-serializable');
|
|
14778
14766
|
return project_mcp_isJsonObject(snapshot) ? snapshot : void 0;
|
|
14779
14767
|
};
|
|
14780
14768
|
const resultMetadata = (document)=>{
|
|
14781
14769
|
if ('result' !== document.root.kind) return;
|
|
14782
14770
|
const metadata = document.root.metadata;
|
|
14783
14771
|
if (void 0 === metadata) return;
|
|
14784
|
-
const snapshot = (0,
|
|
14772
|
+
const snapshot = (0,_302_js__rspack_import_5/* .snapshotJsonValue */.mY)(metadata, 'MCP result _meta must be JSON-serializable');
|
|
14785
14773
|
if (!project_mcp_isJsonObject(snapshot)) throw new McpProjectionError('invalid-result-metadata', 'MCP result _meta must be a JSON object; Agent.Result metadata projects to CallToolResult._meta');
|
|
14786
14774
|
return snapshot;
|
|
14787
14775
|
};
|
|
@@ -14811,8 +14799,8 @@ const attachMcpStructuredContent = (result, value)=>{
|
|
|
14811
14799
|
structuredContent: structured
|
|
14812
14800
|
};
|
|
14813
14801
|
};
|
|
14814
|
-
const notifyProgress = (source, token, sendProgress)=>
|
|
14815
|
-
catch: (error)=>(0,
|
|
14802
|
+
const notifyProgress = (source, token, sendProgress)=>effect__rspack_import_3/* .tryPromise */.$mh({
|
|
14803
|
+
catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
|
|
14816
14804
|
try: ()=>sendProgress({
|
|
14817
14805
|
progress: source.completed,
|
|
14818
14806
|
progressToken: token,
|
|
@@ -14853,18 +14841,18 @@ const documentProgressNodes = (document)=>{
|
|
|
14853
14841
|
appendProgressNodes(document.root, nodes);
|
|
14854
14842
|
return nodes;
|
|
14855
14843
|
};
|
|
14856
|
-
const projectMcpEventStream =
|
|
14844
|
+
const projectMcpEventStream = effect__rspack_import_3/* .fnUntraced */.D9k(function*(events, options = {}) {
|
|
14857
14845
|
let lastProgress = -1 / 0;
|
|
14858
14846
|
let complete;
|
|
14859
14847
|
const token = options.progressToken;
|
|
14860
14848
|
const sendProgress = options.sendProgress;
|
|
14861
14849
|
const notify = (source)=>{
|
|
14862
|
-
if (void 0 === token || void 0 === sendProgress) return
|
|
14863
|
-
if (!(source.completed > lastProgress)) return
|
|
14850
|
+
if (void 0 === token || void 0 === sendProgress) return effect__rspack_import_3/* ["void"] */.rIH;
|
|
14851
|
+
if (!(source.completed > lastProgress)) return effect__rspack_import_3/* ["void"] */.rIH;
|
|
14864
14852
|
lastProgress = source.completed;
|
|
14865
14853
|
return notifyProgress(source, token, sendProgress);
|
|
14866
14854
|
};
|
|
14867
|
-
yield*
|
|
14855
|
+
yield* effect__rspack_import_7/* .runForEach */.o1d(events, (event)=>effect__rspack_import_3/* .gen */.JkU(function*() {
|
|
14868
14856
|
switch(event.type){
|
|
14869
14857
|
case 'progress':
|
|
14870
14858
|
yield* notify(event);
|
|
@@ -14885,18 +14873,18 @@ const projectMcpEventStream = effect__rspack_import_4/* .fnUntraced */.D9k(funct
|
|
|
14885
14873
|
}
|
|
14886
14874
|
}
|
|
14887
14875
|
}));
|
|
14888
|
-
if (void 0 === complete) return yield*
|
|
14876
|
+
if (void 0 === complete) return yield* effect__rspack_import_3/* .fail */.fJG(new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'MCP projector requires a complete document; the stream ended without one'));
|
|
14889
14877
|
return Object.freeze({
|
|
14890
14878
|
document: complete,
|
|
14891
14879
|
result: documentToCallToolResult(complete, options)
|
|
14892
14880
|
});
|
|
14893
14881
|
});
|
|
14894
14882
|
const projectMcpRenderStream = async (events, options = {})=>{
|
|
14895
|
-
const program = projectMcpEventStream(
|
|
14883
|
+
const program = projectMcpEventStream(effect__rspack_import_7/* .fromReadableStream */.fph({
|
|
14896
14884
|
evaluate: ()=>events,
|
|
14897
|
-
onError: (error)=>(0,
|
|
14885
|
+
onError: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error)
|
|
14898
14886
|
}), options);
|
|
14899
|
-
return (0,
|
|
14887
|
+
return (0,_315_js__rspack_import_4/* .runPromise */.pR)(void 0 === options.signal ? program : (0,_315_js__rspack_import_4/* .interruptWhenAborted */.Vd)(program, options.signal), void 0 === options.signal ? void 0 : {
|
|
14900
14888
|
signal: options.signal
|
|
14901
14889
|
});
|
|
14902
14890
|
};
|
|
@@ -14968,53 +14956,6 @@ const MarkdownContent = async ({ children, components })=>{
|
|
|
14968
14956
|
});
|
|
14969
14957
|
return createElement(Agent.Markdown, null, markdown.replace(/\n+$/u, ''));
|
|
14970
14958
|
};
|
|
14971
|
-
const hookComponents = new Set(Object.values(_506_js__rspack_import_15/* .Hook */.qn));
|
|
14972
|
-
const isHookComponent = (value)=>hookComponents.has(value);
|
|
14973
|
-
const resolveHookElement = (node)=>{
|
|
14974
|
-
let element = node;
|
|
14975
|
-
while(isValidElement(element) && isHookComponent(element.type))element = element.type(element.props);
|
|
14976
|
-
return element;
|
|
14977
|
-
};
|
|
14978
|
-
const isAgentElement = (node, name)=>{
|
|
14979
|
-
const resolved = resolveHookElement(node);
|
|
14980
|
-
return isValidElement(resolved) && resolved.type === name;
|
|
14981
|
-
};
|
|
14982
|
-
const flattenText = (node)=>{
|
|
14983
|
-
if ('string' == typeof node || 'number' == typeof node) return String(node);
|
|
14984
|
-
if (Array.isArray(node)) return node.map(flattenText).join('');
|
|
14985
|
-
if (isAgentElement(node, 'agent-hook-result')) throw new Error('Hook result contains duplicate roots');
|
|
14986
|
-
throw new Error('Hook additional context may contain only string or number children');
|
|
14987
|
-
};
|
|
14988
|
-
const lowerHookResult = (node)=>{
|
|
14989
|
-
const roots = Children.toArray(node).map(resolveHookElement);
|
|
14990
|
-
if (1 !== roots.length || !isAgentElement(roots[0], 'agent-hook-result')) throw new Error('Expected exactly one agent-hook-result root');
|
|
14991
|
-
const result = roots[0];
|
|
14992
|
-
const contexts = Children.toArray(result.props.children).map(resolveHookElement).map((child)=>{
|
|
14993
|
-
if (isAgentElement(child, 'agent-hook-result')) throw new Error('Hook result contains duplicate roots');
|
|
14994
|
-
if (!isAgentElement(child, 'agent-hook-additional-context')) throw new Error('Hook result may contain only agent-hook-additional-context elements');
|
|
14995
|
-
return flattenText(child.props.children);
|
|
14996
|
-
});
|
|
14997
|
-
if (0 === contexts.length) throw new Error('Hook result requires additional context');
|
|
14998
|
-
return {
|
|
14999
|
-
hookSpecificOutput: {
|
|
15000
|
-
additionalContext: contexts.join(''),
|
|
15001
|
-
hookEventName: 'PostToolUse'
|
|
15002
|
-
}
|
|
15003
|
-
};
|
|
15004
|
-
};
|
|
15005
|
-
const createRscRequestContext = (label)=>{
|
|
15006
|
-
const storage = new AsyncLocalStorage();
|
|
15007
|
-
return Object.freeze({
|
|
15008
|
-
run (value, operation) {
|
|
15009
|
-
return storage.run(value, operation);
|
|
15010
|
-
},
|
|
15011
|
-
use () {
|
|
15012
|
-
const value = storage.getStore();
|
|
15013
|
-
if (void 0 === value) throw new Error(`${label} used outside a render request`);
|
|
15014
|
-
return value;
|
|
15015
|
-
}
|
|
15016
|
-
});
|
|
15017
|
-
};
|
|
15018
14959
|
var src_AGENT_DOCUMENT_VERSION = 1;
|
|
15019
14960
|
var src_AGENT_REQUEST_STORE_VERSION = 6;
|
|
15020
14961
|
var src_PLUGIN_STATE_DIRECTORY = "state";
|
|
@@ -98263,7 +98204,7 @@ function strictObject(shape, params) {
|
|
|
98263
98204
|
type: "object",
|
|
98264
98205
|
shape,
|
|
98265
98206
|
catchall: never(),
|
|
98266
|
-
...
|
|
98207
|
+
..._core_index_js__rspack_import_4/* .normalizeParams */.A2(params),
|
|
98267
98208
|
});
|
|
98268
98209
|
}
|
|
98269
98210
|
// looseObject
|
|
@@ -98906,6 +98847,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
98906
98847
|
gMt: () => (discriminatedUnion),
|
|
98907
98848
|
k5n: () => (_enum),
|
|
98908
98849
|
lqM: () => (optional),
|
|
98850
|
+
rej: () => (strictObject),
|
|
98909
98851
|
vkY: () => (preprocess),
|
|
98910
98852
|
zMY: () => (boolean)
|
|
98911
98853
|
}, {
|
|
@@ -107192,9 +107134,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
107192
107134
|
"./.agent-bundle-virtual/mcp-grok-bot-b8c2461e-1.mjs"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
107193
107135
|
__webpack_require__.r(__webpack_exports__);
|
|
107194
107136
|
/* import */ var node_url__rspack_import_0 = __webpack_require__("node:url");
|
|
107195
|
-
/* import */ var
|
|
107137
|
+
/* import */ var _agent_bundle_runtime__rspack_import_15 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/49.js");
|
|
107196
107138
|
/* import */ var agent_bundle_mcp_server_runtime__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/mcp-server-runtime.js");
|
|
107197
|
-
/* import */ var
|
|
107139
|
+
/* import */ var _agent_bundle_runtime_lineage__rspack_import_16 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/lineage.js");
|
|
107198
107140
|
/* import */ var agent_bundle_mcp_apps__rspack_import_2 = __webpack_require__("./.agent-bundle-virtual/mcp-grok-bot-b8c2461e-0.mjs");
|
|
107199
107141
|
/* 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
107142
|
/* 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 +107146,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107204
107146
|
/* 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
107147
|
/* 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
107148
|
/* 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
|
|
107208
|
-
/* import */ var
|
|
107149
|
+
/* 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");
|
|
107150
|
+
/* 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");
|
|
107151
|
+
/* 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");
|
|
107152
|
+
/* 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
107153
|
|
|
107210
107154
|
|
|
107211
107155
|
|
|
@@ -107228,17 +107172,21 @@ const route6 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok
|
|
|
107228
107172
|
|
|
107229
107173
|
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
107174
|
|
|
107231
|
-
const route8 = Object.assign({}, Reflect.get(
|
|
107175
|
+
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
107176
|
|
|
107233
|
-
const route9 = Object.assign({}, Reflect.get(
|
|
107234
|
-
|
|
107235
|
-
const
|
|
107177
|
+
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);
|
|
107178
|
+
|
|
107179
|
+
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);
|
|
107180
|
+
|
|
107181
|
+
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);
|
|
107182
|
+
const ARTIFACT_EPOCH = "gbot@0.7.0";
|
|
107183
|
+
const pluginRoot = (0,_agent_bundle_runtime__rspack_import_15/* .resolvePluginRoot */.E7)({
|
|
107236
107184
|
fallback: (0,node_url__rspack_import_0.fileURLToPath)(new URL('..', import.meta.url)),
|
|
107237
107185
|
stateAnchor: 'user-data'
|
|
107238
107186
|
});
|
|
107239
107187
|
const openLineage = async ()=>({
|
|
107240
107188
|
dispose: async ()=>undefined,
|
|
107241
|
-
registry: (0,
|
|
107189
|
+
registry: (0,_agent_bundle_runtime_lineage__rspack_import_16/* .createAgentLineageRegistry */.Q5)()
|
|
107242
107190
|
});
|
|
107243
107191
|
const routes = Object.freeze({
|
|
107244
107192
|
"tool:grok-bot/codex_send": Object.freeze({
|
|
@@ -107582,6 +107530,72 @@ const routes = Object.freeze({
|
|
|
107582
107530
|
module: route7,
|
|
107583
107531
|
name: "gbot_codex_respond"
|
|
107584
107532
|
}),
|
|
107533
|
+
"tool:grok-bot/gbot_grok_approvals": Object.freeze({
|
|
107534
|
+
config: {
|
|
107535
|
+
"annotations": {
|
|
107536
|
+
"readOnlyHint": true
|
|
107537
|
+
},
|
|
107538
|
+
"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.",
|
|
107539
|
+
"inputJsonSchema": {
|
|
107540
|
+
"additionalProperties": false,
|
|
107541
|
+
"properties": {
|
|
107542
|
+
"target": {
|
|
107543
|
+
"type": "string"
|
|
107544
|
+
}
|
|
107545
|
+
},
|
|
107546
|
+
"required": [
|
|
107547
|
+
"target"
|
|
107548
|
+
],
|
|
107549
|
+
"type": "object"
|
|
107550
|
+
},
|
|
107551
|
+
"title": "Pending Grok approvals"
|
|
107552
|
+
},
|
|
107553
|
+
id: "tool:grok-bot/gbot_grok_approvals",
|
|
107554
|
+
kind: "tool",
|
|
107555
|
+
module: route8,
|
|
107556
|
+
name: "gbot_grok_approvals"
|
|
107557
|
+
}),
|
|
107558
|
+
"tool:grok-bot/gbot_grok_respond": Object.freeze({
|
|
107559
|
+
config: {
|
|
107560
|
+
"annotations": {
|
|
107561
|
+
"readOnlyHint": false
|
|
107562
|
+
},
|
|
107563
|
+
"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.",
|
|
107564
|
+
"inputJsonSchema": {
|
|
107565
|
+
"additionalProperties": false,
|
|
107566
|
+
"properties": {
|
|
107567
|
+
"decision": {
|
|
107568
|
+
"enum": [
|
|
107569
|
+
"accept",
|
|
107570
|
+
"decline"
|
|
107571
|
+
],
|
|
107572
|
+
"type": "string"
|
|
107573
|
+
},
|
|
107574
|
+
"entryId": {
|
|
107575
|
+
"type": "string"
|
|
107576
|
+
},
|
|
107577
|
+
"requestId": {
|
|
107578
|
+
"type": "string"
|
|
107579
|
+
},
|
|
107580
|
+
"target": {
|
|
107581
|
+
"type": "string"
|
|
107582
|
+
}
|
|
107583
|
+
},
|
|
107584
|
+
"required": [
|
|
107585
|
+
"target",
|
|
107586
|
+
"entryId",
|
|
107587
|
+
"requestId",
|
|
107588
|
+
"decision"
|
|
107589
|
+
],
|
|
107590
|
+
"type": "object"
|
|
107591
|
+
},
|
|
107592
|
+
"title": "Respond to Grok approval"
|
|
107593
|
+
},
|
|
107594
|
+
id: "tool:grok-bot/gbot_grok_respond",
|
|
107595
|
+
kind: "tool",
|
|
107596
|
+
module: route9,
|
|
107597
|
+
name: "gbot_grok_respond"
|
|
107598
|
+
}),
|
|
107585
107599
|
"tool:grok-bot/gbot_send": Object.freeze({
|
|
107586
107600
|
config: {
|
|
107587
107601
|
"annotations": {
|
|
@@ -107634,7 +107648,7 @@ const routes = Object.freeze({
|
|
|
107634
107648
|
},
|
|
107635
107649
|
id: "tool:grok-bot/gbot_send",
|
|
107636
107650
|
kind: "tool",
|
|
107637
|
-
module:
|
|
107651
|
+
module: route10,
|
|
107638
107652
|
name: "gbot_send"
|
|
107639
107653
|
}),
|
|
107640
107654
|
"tool:grok-bot/gbot_thread": Object.freeze({
|
|
@@ -107674,7 +107688,7 @@ const routes = Object.freeze({
|
|
|
107674
107688
|
},
|
|
107675
107689
|
id: "tool:grok-bot/gbot_thread",
|
|
107676
107690
|
kind: "tool",
|
|
107677
|
-
module:
|
|
107691
|
+
module: route11,
|
|
107678
107692
|
name: "gbot_thread"
|
|
107679
107693
|
})
|
|
107680
107694
|
});
|
|
@@ -107688,7 +107702,7 @@ const routes = Object.freeze({
|
|
|
107688
107702
|
lineage: lineage.registry,
|
|
107689
107703
|
plugin: {
|
|
107690
107704
|
"name": "gbot",
|
|
107691
|
-
"version": "0.
|
|
107705
|
+
"version": "0.7.0"
|
|
107692
107706
|
},
|
|
107693
107707
|
pluginRoot: pluginRoot.identity,
|
|
107694
107708
|
routes
|
|
@@ -108759,10 +108773,10 @@ function listDesktopProcesses(timeoutMs = DESKTOP_PROCESS_LIST_TIMEOUT_MS) {
|
|
|
108759
108773
|
const lines = Array.isArray(listProcesses) ? listProcesses : String(listProcesses ?? "").split(/\r?\n/);
|
|
108760
108774
|
for (const line of lines){
|
|
108761
108775
|
if (!/app-server/.test(line)) continue;
|
|
108762
|
-
// Desktop's bundled binary
|
|
108776
|
+
// Desktop's bundled binary only (Mac/Windows separators, optional .exe).
|
|
108777
|
+
// Do NOT match probe shells whose cmdline merely mentions ChatGPT.app +
|
|
108778
|
+
// app-server + codex-app-tools — that false-positives MATCH2 / Scout noise.
|
|
108763
108779
|
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
108780
|
}
|
|
108767
108781
|
return "unknown";
|
|
108768
108782
|
}
|
|
@@ -110449,10 +110463,12 @@ function socketStateOf(path) {
|
|
|
110449
110463
|
},
|
|
110450
110464
|
"./src/core/gateway.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
110451
110465
|
/* import */ var node_crypto__rspack_import_0 = __webpack_require__("node:crypto");
|
|
110452
|
-
/* import */ var
|
|
110466
|
+
/* import */ var _headers_js__rspack_import_5 = __webpack_require__("./src/core/headers.js");
|
|
110453
110467
|
/* import */ var _app_session_js__rspack_import_1 = __webpack_require__("./src/core/app-session.js");
|
|
110454
110468
|
/* import */ var _store_js__rspack_import_2 = __webpack_require__("./src/core/store.js");
|
|
110455
110469
|
/* import */ var _url_policy_js__rspack_import_3 = __webpack_require__("./src/core/url-policy.js");
|
|
110470
|
+
/* import */ var _grok_approvals_js__rspack_import_4 = __webpack_require__("./src/core/grok-approvals.js");
|
|
110471
|
+
|
|
110456
110472
|
|
|
110457
110473
|
|
|
110458
110474
|
|
|
@@ -110502,7 +110518,7 @@ function gatewayOverride() {
|
|
|
110502
110518
|
kind: "gateway"
|
|
110503
110519
|
}),
|
|
110504
110520
|
gatewayToken: token,
|
|
110505
|
-
gatewayHeaders: (0,
|
|
110521
|
+
gatewayHeaders: (0,_headers_js__rspack_import_5/* .headersFromEnv */.gx)()
|
|
110506
110522
|
};
|
|
110507
110523
|
}
|
|
110508
110524
|
return null;
|
|
@@ -110523,7 +110539,7 @@ function sessionFromApp() {
|
|
|
110523
110539
|
kind: "gateway"
|
|
110524
110540
|
}),
|
|
110525
110541
|
gatewayToken: loaded.gatewayToken,
|
|
110526
|
-
gatewayHeaders: (0,
|
|
110542
|
+
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
110543
|
};
|
|
110528
110544
|
}
|
|
110529
110545
|
function hasGatewayAuth() {
|
|
@@ -110583,7 +110599,7 @@ async function ensureSandbox(accessToken, { signal } = {}) {
|
|
|
110583
110599
|
method: "POST",
|
|
110584
110600
|
redirect: "error",
|
|
110585
110601
|
signal: gatewayDeadline(signal),
|
|
110586
|
-
headers: (0,
|
|
110602
|
+
headers: (0,_headers_js__rspack_import_5/* .ensureSandboxHeaders */._6)(accessToken),
|
|
110587
110603
|
body: "{}"
|
|
110588
110604
|
});
|
|
110589
110605
|
body = await readJson(res);
|
|
@@ -110609,7 +110625,7 @@ async function ensureSandbox(accessToken, { signal } = {}) {
|
|
|
110609
110625
|
kind: "gateway"
|
|
110610
110626
|
}),
|
|
110611
110627
|
gatewayToken: String(gatewayToken),
|
|
110612
|
-
gatewayHeaders: (0,
|
|
110628
|
+
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
110629
|
};
|
|
110614
110630
|
}
|
|
110615
110631
|
async function connectGateway({ signal } = {}) {
|
|
@@ -110639,7 +110655,7 @@ async function gatewayCall(session, method, body = {}, { signal } = {}) {
|
|
|
110639
110655
|
method: "POST",
|
|
110640
110656
|
redirect: "error",
|
|
110641
110657
|
signal: gatewayDeadline(prompt ? undefined : signal),
|
|
110642
|
-
headers: (0,
|
|
110658
|
+
headers: (0,_headers_js__rspack_import_5/* .requestHeaders */.A1)(session),
|
|
110643
110659
|
body: JSON.stringify(body)
|
|
110644
110660
|
};
|
|
110645
110661
|
assertGatewayActive(signal); // Final synchronous boundary before transmission.
|
|
@@ -110906,14 +110922,115 @@ async function getThread(session, ref, rootId) {
|
|
|
110906
110922
|
thread: data
|
|
110907
110923
|
};
|
|
110908
110924
|
}
|
|
110925
|
+
async function listGrokApprovals(session, ref) {
|
|
110926
|
+
const { target, transcript } = await getTranscriptTail(session, ref, 200);
|
|
110927
|
+
if (!Array.isArray(transcript?.entries) || transcript.entries.length > 200) throw new GatewayError("Invalid approval transcript coverage");
|
|
110928
|
+
return {
|
|
110929
|
+
target: {
|
|
110930
|
+
id: target.id,
|
|
110931
|
+
name: target.name
|
|
110932
|
+
},
|
|
110933
|
+
approvals: transcript.entries.map(_grok_approvals_js__rspack_import_4/* .grokApproval */.Ny).filter(Boolean),
|
|
110934
|
+
coverage: "Latest 200 transcript entries only; older requests require the owning Grok UI."
|
|
110935
|
+
};
|
|
110936
|
+
}
|
|
110937
|
+
async function respondGrokApproval(session, ref, input) {
|
|
110938
|
+
const { entryId, requestId, decision } = _grok_approvals_js__rspack_import_4/* .grokApprovalResponseSchema.parse */.T5.parse({
|
|
110939
|
+
...input,
|
|
110940
|
+
target: ref
|
|
110941
|
+
});
|
|
110942
|
+
const { target, approvals } = await listGrokApprovals(session, ref);
|
|
110943
|
+
const matches = approvals.filter((card)=>card.entryId === entryId && card.requestId === requestId);
|
|
110944
|
+
if (matches.length !== 1) throw new GatewayError("Stale, foreign or unsupported Grok approval; refresh pending requests or use the owning Grok UI");
|
|
110945
|
+
const approval = matches[0];
|
|
110946
|
+
if (decision === "accept" && approval.truncated) throw new GatewayError("Approval details are truncated; acceptance requires the owning Grok UI");
|
|
110947
|
+
const local = approval.type === "local-tool-permission";
|
|
110948
|
+
await gatewayCall(session, local ? "resolveLocalToolPermission" : "resolveAutoReviewApproval", {
|
|
110949
|
+
agentId: target.id,
|
|
110950
|
+
entryId,
|
|
110951
|
+
requestId,
|
|
110952
|
+
resolution: local ? decision === "accept" ? "allow-once" : "deny" : decision === "accept" ? "approved" : "denied"
|
|
110953
|
+
});
|
|
110954
|
+
return {
|
|
110955
|
+
target,
|
|
110956
|
+
entryId,
|
|
110957
|
+
requestId,
|
|
110958
|
+
decision,
|
|
110959
|
+
delivery: "accepted"
|
|
110960
|
+
};
|
|
110961
|
+
}
|
|
110909
110962
|
|
|
110910
110963
|
__webpack_require__.d(__webpack_exports__, {
|
|
110911
110964
|
LV: () => (sendPrompt),
|
|
110965
|
+
MI: () => (listGrokApprovals),
|
|
110966
|
+
OR: () => (respondGrokApproval),
|
|
110912
110967
|
Vq: () => (connectGateway),
|
|
110913
110968
|
bA: () => (getTranscriptTail)
|
|
110914
110969
|
});
|
|
110915
110970
|
|
|
110916
110971
|
|
|
110972
|
+
},
|
|
110973
|
+
"./src/core/grok-approvals.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
110974
|
+
/* import */ var zod__rspack_import_1 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
|
|
110975
|
+
/* import */ var _url_policy_js__rspack_import_0 = __webpack_require__("./src/core/url-policy.js");
|
|
110976
|
+
|
|
110977
|
+
|
|
110978
|
+
const id = zod__rspack_import_1/* .string */.YjP().min(1).max(1024);
|
|
110979
|
+
const grokApprovalResponseSchema = zod__rspack_import_1/* .strictObject */.rej({
|
|
110980
|
+
target: id,
|
|
110981
|
+
entryId: id,
|
|
110982
|
+
requestId: id,
|
|
110983
|
+
decision: zod__rspack_import_1/* ["enum"] */.k5n([
|
|
110984
|
+
"accept",
|
|
110985
|
+
"decline"
|
|
110986
|
+
])
|
|
110987
|
+
});
|
|
110988
|
+
function grokApproval(entry) {
|
|
110989
|
+
if (entry?.kind !== "send-message") return null;
|
|
110990
|
+
const type = entry.message?.type;
|
|
110991
|
+
const card = type === "auto-review-approval" ? entry.message.approval : type === "local-tool-permission" ? entry.message.ask : null;
|
|
110992
|
+
if (card?.status !== "pending" || !id.safeParse(card.requestId).success || !id.safeParse(entry.id).success) return null;
|
|
110993
|
+
const details = {};
|
|
110994
|
+
let truncated = false;
|
|
110995
|
+
for (const key of [
|
|
110996
|
+
"reason",
|
|
110997
|
+
"command",
|
|
110998
|
+
"summary",
|
|
110999
|
+
"action",
|
|
111000
|
+
"description",
|
|
111001
|
+
"target",
|
|
111002
|
+
"machineId",
|
|
111003
|
+
"surface",
|
|
111004
|
+
"workingDirectory"
|
|
111005
|
+
]){
|
|
111006
|
+
if (typeof card[key] !== "string") continue;
|
|
111007
|
+
const text = (0,_url_policy_js__rspack_import_0/* .redactSecrets */.fp)(card[key]);
|
|
111008
|
+
truncated ||= text.length > 2048;
|
|
111009
|
+
details[key] = text.slice(0, 2048);
|
|
111010
|
+
}
|
|
111011
|
+
return {
|
|
111012
|
+
entryId: entry.id,
|
|
111013
|
+
requestId: card.requestId,
|
|
111014
|
+
type,
|
|
111015
|
+
...details,
|
|
111016
|
+
truncated
|
|
111017
|
+
};
|
|
111018
|
+
}
|
|
111019
|
+
function grokApprovalNotice(entry, target) {
|
|
111020
|
+
const approval = grokApproval(entry);
|
|
111021
|
+
return approval ? `Grok approval pending. Requires an explicit user decision; never approve automatically.\n${JSON.stringify({
|
|
111022
|
+
botTarget: target,
|
|
111023
|
+
...approval
|
|
111024
|
+
})}\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;
|
|
111025
|
+
}
|
|
111026
|
+
|
|
111027
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
111028
|
+
Ny: () => (grokApproval)
|
|
111029
|
+
}, {
|
|
111030
|
+
T5: grokApprovalResponseSchema
|
|
111031
|
+
});
|
|
111032
|
+
|
|
111033
|
+
|
|
110917
111034
|
},
|
|
110918
111035
|
"./src/core/headers.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
110919
111036
|
function normalizeHeaderMap(obj) {
|
|
@@ -111209,7 +111326,10 @@ function relayProfile(env = process.env) {
|
|
|
111209
111326
|
"GROK_BOT_ALLOW_LOCAL_GATEWAY",
|
|
111210
111327
|
"GROK_BOT_ALLOW_ANY_GATEWAY",
|
|
111211
111328
|
"GROK_BOT_TEST",
|
|
111212
|
-
"NODE_ENV"
|
|
111329
|
+
"NODE_ENV",
|
|
111330
|
+
// Secret Service credentials depend on the caller's desktop session.
|
|
111331
|
+
"DBUS_SESSION_BUS_ADDRESS",
|
|
111332
|
+
"DISPLAY"
|
|
111213
111333
|
];
|
|
111214
111334
|
return digest(JSON.stringify([
|
|
111215
111335
|
(0,node_path__rspack_import_2.resolve)((0,_codex_bridge_js__rspack_import_3/* .codexSocketPath */.ql)(env)),
|
|
@@ -111788,7 +111908,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
111788
111908
|
|
|
111789
111909
|
},
|
|
111790
111910
|
"./package.json"(module) {
|
|
111791
|
-
module.exports = {"rE":"0.
|
|
111911
|
+
module.exports = {"rE":"0.7.0"}
|
|
111792
111912
|
|
|
111793
111913
|
},
|
|
111794
111914
|
|