grok-bot-cli 0.7.0 → 0.9.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 +16 -0
- package/README.md +12 -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 +14 -9
- package/dist/README.md +12 -0
- 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 +474 -106
- package/dist/bin/gbot-install.js +10 -5
- package/dist/bin/gbot.mjs +894 -229
- package/dist/install.mjs +21 -14
- package/dist/mcp/mcp-grok-bot-b8c2461e-flight.mjs +223 -32
- package/dist/mcp/mcp-grok-bot-b8c2461e.mjs +529 -156
- package/dist/package.json +3 -3
- package/dist/plugin.json +1 -1
- package/dist/scripts/gbot-relay.mjs +2132 -12
- package/dist/skills/talk-to-grok-bot/SKILL.md +8 -0
- package/package.json +3 -3
package/dist/bin/gbot.mjs
CHANGED
|
@@ -11045,6 +11045,14 @@ const agentSummarySchema = zod__rspack_import_3/* .object */.Ikc({
|
|
|
11045
11045
|
notifyOnAgentUpdates: zod__rspack_import_3/* .boolean */.zMY().optional(),
|
|
11046
11046
|
title: zod__rspack_import_3/* .string */.YjP().optional()
|
|
11047
11047
|
}).strict();
|
|
11048
|
+
const skillSchema = zod__rspack_import_3/* .object */.Ikc({
|
|
11049
|
+
description: zod__rspack_import_3/* .string */.YjP(),
|
|
11050
|
+
id: zod__rspack_import_3/* .string */.YjP(),
|
|
11051
|
+
name: zod__rspack_import_3/* .string */.YjP(),
|
|
11052
|
+
pluginId: zod__rspack_import_3/* .string */.YjP().optional(),
|
|
11053
|
+
source: zod__rspack_import_3/* .string */.YjP(),
|
|
11054
|
+
sourceRef: zod__rspack_import_3/* .string */.YjP().optional()
|
|
11055
|
+
}).strict();
|
|
11048
11056
|
const createFieldsSchema = zod__rspack_import_3/* .object */.Ikc({
|
|
11049
11057
|
avatarColor: avatarColorSchema.optional(),
|
|
11050
11058
|
avatarShape: avatarShapeSchema.optional(),
|
|
@@ -11087,6 +11095,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
11087
11095
|
}, {
|
|
11088
11096
|
FS: openBackendFromInput,
|
|
11089
11097
|
R9: failureDocumentSchema,
|
|
11098
|
+
b7: skillSchema,
|
|
11090
11099
|
bY: createFieldsSchema,
|
|
11091
11100
|
cp: toCreateInput,
|
|
11092
11101
|
lK: backendFlagsSchema,
|
|
@@ -11126,9 +11135,9 @@ const config = {
|
|
|
11126
11135
|
};
|
|
11127
11136
|
async function route({ input }) {
|
|
11128
11137
|
const out = await (0,_core_grok_approval_routes_js__rspack_import_1/* .listOperation */.gi)(input);
|
|
11129
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Result */.
|
|
11138
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Result */.g6.Result, {
|
|
11130
11139
|
value: out,
|
|
11131
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.
|
|
11140
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.g6.Text, {
|
|
11132
11141
|
children: JSON.stringify(out)
|
|
11133
11142
|
})
|
|
11134
11143
|
});
|
|
@@ -11186,9 +11195,9 @@ const config = {
|
|
|
11186
11195
|
};
|
|
11187
11196
|
async function route({ input }) {
|
|
11188
11197
|
const out = await (0,_core_grok_approval_routes_js__rspack_import_1/* .respondOperation */.lr)(input);
|
|
11189
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Result */.
|
|
11198
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Result */.g6.Result, {
|
|
11190
11199
|
value: out,
|
|
11191
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.
|
|
11200
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.g6.Text, {
|
|
11192
11201
|
children: JSON.stringify(out)
|
|
11193
11202
|
})
|
|
11194
11203
|
});
|
|
@@ -11260,9 +11269,9 @@ async function botsCreate({ input }) {
|
|
|
11260
11269
|
const { dir: _d, files: _f, gateway: _g, ...fields } = input;
|
|
11261
11270
|
const rec = await backend.createAgent((0,_shared_js__rspack_import_1/* .toCreateInput */.cp)(fields));
|
|
11262
11271
|
if (rec == null) throw new Error('createAgent returned no record');
|
|
11263
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Result */.
|
|
11272
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Result */.g6.Result, {
|
|
11264
11273
|
value: (0,_core_format_js__rspack_import_3/* .summarize */.eh)(rec),
|
|
11265
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.
|
|
11274
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.g6.Text, {
|
|
11266
11275
|
children: `Created bot ${rec.name} (${rec.id})`
|
|
11267
11276
|
})
|
|
11268
11277
|
});
|
|
@@ -11328,9 +11337,9 @@ const resultSchema = _shared_js__rspack_import_1/* .agentSummarySchema */.t_;
|
|
|
11328
11337
|
async function botsDelete({ input }) {
|
|
11329
11338
|
const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
|
|
11330
11339
|
const rec = await backend.deleteAgent(input.ref);
|
|
11331
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
11340
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
11332
11341
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
11333
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
11342
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
11334
11343
|
children: `Deleted ${rec.isGroup ? 'group' : 'bot'} ${rec.name} (${rec.id})`
|
|
11335
11344
|
})
|
|
11336
11345
|
});
|
|
@@ -11397,9 +11406,9 @@ async function botsGet({ input }) {
|
|
|
11397
11406
|
const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
|
|
11398
11407
|
const rec = await backend.resolve(input.ref);
|
|
11399
11408
|
const all = await backend.list();
|
|
11400
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
11409
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
11401
11410
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
11402
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
11411
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
11403
11412
|
children: (0,_core_format_js__rspack_import_4/* .formatRecord */.bM)(rec, all)
|
|
11404
11413
|
})
|
|
11405
11414
|
});
|
|
@@ -11456,9 +11465,9 @@ async function botsList({ input }) {
|
|
|
11456
11465
|
const rows = all.filter((r)=>!r.isGroup);
|
|
11457
11466
|
const bots = rows.map(_core_format_js__rspack_import_3/* .summarize */.eh);
|
|
11458
11467
|
const text = rows.length === 0 ? 'No bots.' : rows.map((r)=>(0,_core_format_js__rspack_import_3/* .formatRecord */.bM)(r, all)).join('\n\n');
|
|
11459
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11468
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
|
|
11460
11469
|
value: bots,
|
|
11461
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11470
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
|
|
11462
11471
|
children: text
|
|
11463
11472
|
})
|
|
11464
11473
|
});
|
|
@@ -11546,9 +11555,9 @@ async function botsUpdate({ input }) {
|
|
|
11546
11555
|
const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
|
|
11547
11556
|
const { dir: _d, files: _f, gateway: _g, ref, ...fields } = input;
|
|
11548
11557
|
const rec = await backend.updateAgent(ref, (0,_shared_js__rspack_import_1/* .toUpdatePatch */.li)(fields));
|
|
11549
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
11558
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
11550
11559
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
11551
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
11560
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
11552
11561
|
children: `Updated ${rec.isGroup ? 'group' : 'bot'} ${rec.name} (${rec.id})`
|
|
11553
11562
|
})
|
|
11554
11563
|
});
|
|
@@ -11632,9 +11641,9 @@ async function route({ input }) {
|
|
|
11632
11641
|
} catch (error) {
|
|
11633
11642
|
out = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
|
|
11634
11643
|
}
|
|
11635
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11644
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
|
|
11636
11645
|
value: out,
|
|
11637
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11646
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
|
|
11638
11647
|
children: JSON.stringify(out)
|
|
11639
11648
|
})
|
|
11640
11649
|
});
|
|
@@ -11723,12 +11732,12 @@ async function route({ signal, input }) {
|
|
|
11723
11732
|
} finally{
|
|
11724
11733
|
signal.removeEventListener('abort', stop);
|
|
11725
11734
|
}
|
|
11726
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.
|
|
11735
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
|
|
11727
11736
|
value: {
|
|
11728
11737
|
state: 'stopped',
|
|
11729
11738
|
exitCode
|
|
11730
11739
|
},
|
|
11731
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.
|
|
11740
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
|
|
11732
11741
|
children: "Relay worker stopped."
|
|
11733
11742
|
})
|
|
11734
11743
|
});
|
|
@@ -11801,9 +11810,9 @@ async function route({ input }) {
|
|
|
11801
11810
|
} catch (error) {
|
|
11802
11811
|
out = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
|
|
11803
11812
|
}
|
|
11804
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11813
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
|
|
11805
11814
|
value: out,
|
|
11806
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11815
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
|
|
11807
11816
|
children: JSON.stringify(out)
|
|
11808
11817
|
})
|
|
11809
11818
|
});
|
|
@@ -11857,9 +11866,9 @@ async function route({ input }) {
|
|
|
11857
11866
|
} catch (error) {
|
|
11858
11867
|
out = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
|
|
11859
11868
|
}
|
|
11860
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11869
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
|
|
11861
11870
|
value: out,
|
|
11862
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11871
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
|
|
11863
11872
|
children: JSON.stringify(out)
|
|
11864
11873
|
})
|
|
11865
11874
|
});
|
|
@@ -11916,9 +11925,9 @@ async function route({ input }) {
|
|
|
11916
11925
|
} catch (error) {
|
|
11917
11926
|
out = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
|
|
11918
11927
|
}
|
|
11919
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
11928
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
|
|
11920
11929
|
value: out,
|
|
11921
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
11930
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
|
|
11922
11931
|
children: JSON.stringify(out)
|
|
11923
11932
|
})
|
|
11924
11933
|
});
|
|
@@ -11994,21 +12003,21 @@ async function codexDesktopShim({ input }) {
|
|
|
11994
12003
|
out = (0,_core_desktop_shim_js__rspack_import_1/* .installDesktopShim */.B0)();
|
|
11995
12004
|
} catch (error) {
|
|
11996
12005
|
const message = error instanceof Error ? error.message : String(error);
|
|
11997
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12006
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
11998
12007
|
value: {
|
|
11999
12008
|
action: 'install',
|
|
12000
12009
|
error: message,
|
|
12001
12010
|
exitCode: 1
|
|
12002
12011
|
},
|
|
12003
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12012
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12004
12013
|
children: `Desktop shim install failed: ${message}`
|
|
12005
12014
|
})
|
|
12006
12015
|
});
|
|
12007
12016
|
}
|
|
12008
12017
|
const text = `Installed ChatGPT Desktop shim:\n` + ` wrapper: ${out.wrapperPath}\n` + ` bridge: ${out.bridgePath}\n` + ` login env: ${out.envScriptPath}` + (out.plistPath ? `\n LaunchAgent: ${out.plistPath}` : '\n LaunchAgent: n/a (macOS-only)') + `\nFully quit and relaunch ChatGPT.app so it inherits CODEX_CLI_PATH; ` + `Desktop falls back to stock Codex if the shim is ever removed.` + formatWarnings(out.warnings);
|
|
12009
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12018
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12010
12019
|
value: out,
|
|
12011
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12020
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12012
12021
|
children: text
|
|
12013
12022
|
})
|
|
12014
12023
|
});
|
|
@@ -12020,22 +12029,22 @@ async function codexDesktopShim({ input }) {
|
|
|
12020
12029
|
out = (0,_core_desktop_shim_js__rspack_import_1/* .uninstallDesktopShim */.gM)();
|
|
12021
12030
|
} catch (error) {
|
|
12022
12031
|
const message = error instanceof Error ? error.message : String(error);
|
|
12023
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12032
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12024
12033
|
value: {
|
|
12025
12034
|
action: 'uninstall',
|
|
12026
12035
|
error: message,
|
|
12027
12036
|
exitCode: 1
|
|
12028
12037
|
},
|
|
12029
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12038
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12030
12039
|
children: `Desktop shim uninstall failed: ${message}`
|
|
12031
12040
|
})
|
|
12032
12041
|
});
|
|
12033
12042
|
}
|
|
12034
12043
|
const removed = out.removed.length === 0 ? '(nothing installed)' : out.removed.join(', ');
|
|
12035
12044
|
const text = `Removed ChatGPT Desktop shim: ${removed}. ` + `Desktop and Codex fall back to stock behavior; relaunch ChatGPT.app to pick it up.` + formatWarnings(out.warnings);
|
|
12036
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12045
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12037
12046
|
value: out,
|
|
12038
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12047
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12039
12048
|
children: text
|
|
12040
12049
|
})
|
|
12041
12050
|
});
|
|
@@ -12043,9 +12052,9 @@ async function codexDesktopShim({ input }) {
|
|
|
12043
12052
|
case 'status':
|
|
12044
12053
|
{
|
|
12045
12054
|
const out = (0,_core_desktop_shim_js__rspack_import_1/* .desktopShimStatus */.em)();
|
|
12046
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12055
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12047
12056
|
value: out,
|
|
12048
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12057
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12049
12058
|
children: (0,_core_format_js__rspack_import_4/* .formatDesktopShimStatus */.fX)(out)
|
|
12050
12059
|
})
|
|
12051
12060
|
});
|
|
@@ -12125,21 +12134,21 @@ async function codexListThreads({ input }) {
|
|
|
12125
12134
|
});
|
|
12126
12135
|
} catch (error) {
|
|
12127
12136
|
const failure = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
|
|
12128
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.
|
|
12137
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
|
|
12129
12138
|
value: failure,
|
|
12130
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.
|
|
12139
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
|
|
12131
12140
|
children: failure.error
|
|
12132
12141
|
})
|
|
12133
12142
|
});
|
|
12134
12143
|
}
|
|
12135
12144
|
const more = out.nextCursor ? `\n\nmore: --cursor ${JSON.stringify((0,_core_codex_bridge_js__rspack_import_1/* .singleLine */.pF)(out.nextCursor))}` : '';
|
|
12136
12145
|
const text = out.threads.length === 0 ? 'No Codex threads.' : out.threads.map(_core_format_js__rspack_import_6/* .formatCodexThread */.nz).join('\n\n') + more;
|
|
12137
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.
|
|
12146
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
|
|
12138
12147
|
value: {
|
|
12139
12148
|
...out,
|
|
12140
12149
|
exitCode: 0
|
|
12141
12150
|
},
|
|
12142
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.
|
|
12151
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
|
|
12143
12152
|
children: text
|
|
12144
12153
|
})
|
|
12145
12154
|
});
|
|
@@ -12212,19 +12221,19 @@ async function codexQueue({ input }) {
|
|
|
12212
12221
|
out = await (0,_core_codex_bridge_js__rspack_import_1/* .listCodexQueue */.Bt)(input.threadId);
|
|
12213
12222
|
} catch (error) {
|
|
12214
12223
|
const failure = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
|
|
12215
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.
|
|
12224
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
|
|
12216
12225
|
value: failure,
|
|
12217
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.
|
|
12226
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
|
|
12218
12227
|
children: failure.error
|
|
12219
12228
|
})
|
|
12220
12229
|
});
|
|
12221
12230
|
}
|
|
12222
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.
|
|
12231
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
|
|
12223
12232
|
value: {
|
|
12224
12233
|
...out,
|
|
12225
12234
|
exitCode: 0
|
|
12226
12235
|
},
|
|
12227
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.
|
|
12236
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
|
|
12228
12237
|
children: (0,_core_format_js__rspack_import_6/* .formatCodexQueue */.e_)(out)
|
|
12229
12238
|
})
|
|
12230
12239
|
});
|
|
@@ -12355,12 +12364,12 @@ async function route({ input, signal }) {
|
|
|
12355
12364
|
...input,
|
|
12356
12365
|
message: input.message.join(' ').trim()
|
|
12357
12366
|
}, context);
|
|
12358
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.
|
|
12367
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
|
|
12359
12368
|
value: {
|
|
12360
12369
|
...out,
|
|
12361
12370
|
exitCode: out.delivery === 'rejected' ? 1 : 0
|
|
12362
12371
|
},
|
|
12363
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.
|
|
12372
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
|
|
12364
12373
|
children: `Delivery ${out.delivery}; terminal answer returns to Grok automatically.`
|
|
12365
12374
|
})
|
|
12366
12375
|
});
|
|
@@ -12372,9 +12381,9 @@ async function route({ input, signal }) {
|
|
|
12372
12381
|
}, signal, (message)=>context.progress.report({
|
|
12373
12382
|
message
|
|
12374
12383
|
}), true);
|
|
12375
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.
|
|
12384
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
|
|
12376
12385
|
value: out,
|
|
12377
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.
|
|
12386
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
|
|
12378
12387
|
children: (0,_core_codex_routes_js__rspack_import_1/* .resultText */.D6)(out)
|
|
12379
12388
|
})
|
|
12380
12389
|
});
|
|
@@ -12420,9 +12429,9 @@ const resultSchema = zod__rspack_import_2/* .object */.Ikc({
|
|
|
12420
12429
|
}).passthrough();
|
|
12421
12430
|
async function codexStatusCmd(_props) {
|
|
12422
12431
|
const status = await (0,_core_codex_bridge_js__rspack_import_1/* .codexStatus */.MU)();
|
|
12423
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12432
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12424
12433
|
value: status,
|
|
12425
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12434
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12426
12435
|
children: (0,_core_format_js__rspack_import_4/* .formatCodexStatus */.P2)(status)
|
|
12427
12436
|
})
|
|
12428
12437
|
});
|
|
@@ -12494,9 +12503,9 @@ async function route({ input, signal }) {
|
|
|
12494
12503
|
const out = await (0,_core_codex_routes_js__rspack_import_1/* .observeOperation */.gT)('wait', input, signal, (message)=>context.progress.report({
|
|
12495
12504
|
message
|
|
12496
12505
|
}));
|
|
12497
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12506
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12498
12507
|
value: out,
|
|
12499
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12508
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12500
12509
|
children: (0,_core_codex_routes_js__rspack_import_1/* .resultText */.D6)(out)
|
|
12501
12510
|
})
|
|
12502
12511
|
});
|
|
@@ -12560,9 +12569,9 @@ async function route({ input, signal }) {
|
|
|
12560
12569
|
const out = await (0,_core_codex_routes_js__rspack_import_1/* .observeOperation */.gT)('watch', input, signal, (message)=>context.progress.report({
|
|
12561
12570
|
message
|
|
12562
12571
|
}));
|
|
12563
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12572
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12564
12573
|
value: out,
|
|
12565
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12574
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12566
12575
|
children: (0,_core_codex_routes_js__rspack_import_1/* .resultText */.D6)(out)
|
|
12567
12576
|
})
|
|
12568
12577
|
});
|
|
@@ -12665,9 +12674,9 @@ async function doctor({ input }) {
|
|
|
12665
12674
|
...candidates.map((c)=>` ${c}`),
|
|
12666
12675
|
note
|
|
12667
12676
|
].join('\n');
|
|
12668
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Result */.
|
|
12677
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Result */.g6.Result, {
|
|
12669
12678
|
value: value,
|
|
12670
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Text */.
|
|
12679
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Text */.g6.Text, {
|
|
12671
12680
|
children: text
|
|
12672
12681
|
})
|
|
12673
12682
|
});
|
|
@@ -12738,9 +12747,9 @@ const resultSchema = _shared_js__rspack_import_1/* .agentSummarySchema */.t_;
|
|
|
12738
12747
|
async function groupsAdd({ input }) {
|
|
12739
12748
|
const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
|
|
12740
12749
|
const rec = await backend.addGroupMember(input.group, input.bot);
|
|
12741
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12750
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12742
12751
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
12743
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12752
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12744
12753
|
children: `Added to ${rec.name}. Members: ${rec.memberIds.length}`
|
|
12745
12754
|
})
|
|
12746
12755
|
});
|
|
@@ -12826,9 +12835,9 @@ async function groupsCreate({ input }) {
|
|
|
12826
12835
|
...(0,_shared_js__rspack_import_1/* .toCreateInput */.cp)(fields),
|
|
12827
12836
|
memberIds: member
|
|
12828
12837
|
});
|
|
12829
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12838
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12830
12839
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
12831
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12840
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12832
12841
|
children: `Created group ${rec.name} (${rec.id}) with ${rec.memberIds.length} members`
|
|
12833
12842
|
})
|
|
12834
12843
|
});
|
|
@@ -12896,9 +12905,9 @@ async function groupsDelete({ input }) {
|
|
|
12896
12905
|
const rec = await backend.resolve(input.ref);
|
|
12897
12906
|
if (!rec.isGroup) throw new Error(`"${rec.name}" is a bot, not a group. Use bots delete.`);
|
|
12898
12907
|
const deleted = await backend.deleteAgent(input.ref);
|
|
12899
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12908
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12900
12909
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(deleted),
|
|
12901
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12910
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12902
12911
|
children: `Deleted group ${deleted.name} (${deleted.id})`
|
|
12903
12912
|
})
|
|
12904
12913
|
});
|
|
@@ -12966,9 +12975,9 @@ async function groupsGet({ input }) {
|
|
|
12966
12975
|
const rec = await backend.resolve(input.ref);
|
|
12967
12976
|
if (!rec.isGroup) throw new Error(`"${rec.name}" is a bot, not a group.`);
|
|
12968
12977
|
const all = await backend.list();
|
|
12969
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
12978
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
12970
12979
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
12971
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
12980
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
12972
12981
|
children: (0,_core_format_js__rspack_import_4/* .formatRecord */.bM)(rec, all)
|
|
12973
12982
|
})
|
|
12974
12983
|
});
|
|
@@ -13025,9 +13034,9 @@ async function groupsList({ input }) {
|
|
|
13025
13034
|
const rows = all.filter((r)=>r.isGroup);
|
|
13026
13035
|
const groups = rows.map(_core_format_js__rspack_import_3/* .summarize */.eh);
|
|
13027
13036
|
const text = rows.length === 0 ? 'No groups.' : rows.map((r)=>(0,_core_format_js__rspack_import_3/* .formatRecord */.bM)(r, all)).join('\n\n');
|
|
13028
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
13037
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
|
|
13029
13038
|
value: groups,
|
|
13030
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
13039
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
|
|
13031
13040
|
children: text
|
|
13032
13041
|
})
|
|
13033
13042
|
});
|
|
@@ -13095,9 +13104,9 @@ async function groupsMembers({ input }) {
|
|
|
13095
13104
|
const rec = await backend.resolve(input.ref);
|
|
13096
13105
|
if (!rec.isGroup) throw new Error(`"${rec.name}" is a bot, not a group.`);
|
|
13097
13106
|
const all = await backend.list();
|
|
13098
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
13107
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
13099
13108
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
13100
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
13109
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
13101
13110
|
children: (0,_core_format_js__rspack_import_4/* .formatRecord */.bM)(rec, all)
|
|
13102
13111
|
})
|
|
13103
13112
|
});
|
|
@@ -13168,9 +13177,9 @@ const resultSchema = _shared_js__rspack_import_1/* .agentSummarySchema */.t_;
|
|
|
13168
13177
|
async function groupsRemove({ input }) {
|
|
13169
13178
|
const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
|
|
13170
13179
|
const rec = await backend.removeGroupMember(input.group, input.bot);
|
|
13171
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
13180
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
13172
13181
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
13173
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
13182
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
13174
13183
|
children: `Removed from ${rec.name}. Members: ${rec.memberIds.length}`
|
|
13175
13184
|
})
|
|
13176
13185
|
});
|
|
@@ -13244,9 +13253,9 @@ const resultSchema = _shared_js__rspack_import_1/* .agentSummarySchema */.t_;
|
|
|
13244
13253
|
async function groupsSet({ input }) {
|
|
13245
13254
|
const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
|
|
13246
13255
|
const rec = await backend.setGroupMembers(input.group, input.member);
|
|
13247
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
13256
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
13248
13257
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
13249
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
13258
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
13250
13259
|
children: `Updated ${rec.name}. Members: ${rec.memberIds.length}`
|
|
13251
13260
|
})
|
|
13252
13261
|
});
|
|
@@ -13336,9 +13345,9 @@ async function groupsUpdate({ input }) {
|
|
|
13336
13345
|
if (!current.isGroup) throw new Error(`"${current.name}" is a bot, not a group. Use bots update.`);
|
|
13337
13346
|
const { dir: _d, files: _f, gateway: _g, ref, ...fields } = input;
|
|
13338
13347
|
const rec = await backend.updateAgent(ref, (0,_shared_js__rspack_import_1/* .toUpdatePatch */.li)(fields));
|
|
13339
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
13348
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
13340
13349
|
value: (0,_core_format_js__rspack_import_4/* .summarize */.eh)(rec),
|
|
13341
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
13350
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
13342
13351
|
children: `Updated group ${rec.name} (${rec.id})`
|
|
13343
13352
|
})
|
|
13344
13353
|
});
|
|
@@ -13414,11 +13423,11 @@ const resultSchema = zod__rspack_import_2/* .union */.KCZ([
|
|
|
13414
13423
|
async function history({ input }) {
|
|
13415
13424
|
const file = (0,_core_history_js__rspack_import_1/* .historyPath */.ae)(input.historyDir);
|
|
13416
13425
|
if (input.path) {
|
|
13417
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
13426
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
13418
13427
|
value: {
|
|
13419
13428
|
path: file
|
|
13420
13429
|
},
|
|
13421
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
13430
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
13422
13431
|
children: file
|
|
13423
13432
|
})
|
|
13424
13433
|
});
|
|
@@ -13429,9 +13438,9 @@ async function history({ input }) {
|
|
|
13429
13438
|
search: input.search
|
|
13430
13439
|
});
|
|
13431
13440
|
const text = rows.length ? rows.map((row)=>`[${row.recordedAt}] ${row.target.name} (${row.target.id}) [${row.role}] ${row.text}`).join('\n') : 'No local history.';
|
|
13432
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.
|
|
13441
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
13433
13442
|
value: rows,
|
|
13434
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.
|
|
13443
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
13435
13444
|
children: text
|
|
13436
13445
|
})
|
|
13437
13446
|
});
|
|
@@ -13641,12 +13650,12 @@ async function send({ input }) {
|
|
|
13641
13650
|
hop: input.hop,
|
|
13642
13651
|
correlationId: input.correlationId
|
|
13643
13652
|
}, await (0,_agent_bundle_runtime__rspack_import_7/* .agent */.MA)());
|
|
13644
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Result */.
|
|
13653
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Result */.g6.Result, {
|
|
13645
13654
|
value: {
|
|
13646
13655
|
...out,
|
|
13647
13656
|
exitCode: out.delivery === 'rejected' ? 1 : 0
|
|
13648
13657
|
},
|
|
13649
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Text */.
|
|
13658
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Text */.g6.Text, {
|
|
13650
13659
|
children: `Delivery ${out.delivery}; inspect codex bridge status for automatic reply delivery.`
|
|
13651
13660
|
})
|
|
13652
13661
|
});
|
|
@@ -13656,9 +13665,9 @@ async function send({ input }) {
|
|
|
13656
13665
|
value = (0,_core_codex_contract_js__rspack_import_3/* .outcomeFromError */.DG)(error);
|
|
13657
13666
|
}
|
|
13658
13667
|
const text = value.exitCode === 0 ? `Sent to ${value.kind} ${value.name} (${value.id})${value.messageId ? ` message ${value.messageId}` : ''}; envelope ${value.envelopeId}` : value.error;
|
|
13659
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Result */.
|
|
13668
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Result */.g6.Result, {
|
|
13660
13669
|
value: value,
|
|
13661
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Text */.
|
|
13670
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Text */.g6.Text, {
|
|
13662
13671
|
children: text
|
|
13663
13672
|
})
|
|
13664
13673
|
});
|
|
@@ -13673,6 +13682,202 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
13673
13682
|
});
|
|
13674
13683
|
|
|
13675
13684
|
|
|
13685
|
+
},
|
|
13686
|
+
"./src/cli/skills/add.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
13687
|
+
__webpack_require__.r(__webpack_exports__);
|
|
13688
|
+
/* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
|
|
13689
|
+
/* import */ var node_fs_promises__rspack_import_1 = __webpack_require__("node:fs/promises");
|
|
13690
|
+
/* import */ var node_path__rspack_import_2 = __webpack_require__("node:path");
|
|
13691
|
+
/* import */ var _agent_bundle_runtime__rspack_import_5 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
|
|
13692
|
+
/* import */ var zod__rspack_import_4 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
|
|
13693
|
+
/* import */ var _shared_js__rspack_import_3 = __webpack_require__("./src/cli/_shared.ts");
|
|
13694
|
+
|
|
13695
|
+
|
|
13696
|
+
|
|
13697
|
+
|
|
13698
|
+
|
|
13699
|
+
|
|
13700
|
+
const config = {
|
|
13701
|
+
description: 'Add a SKILL.md to the shared skill library. Every bot sees it.',
|
|
13702
|
+
inputJsonSchema: {
|
|
13703
|
+
additionalProperties: false,
|
|
13704
|
+
properties: {
|
|
13705
|
+
dir: {
|
|
13706
|
+
description: 'Agents directory for --files mode',
|
|
13707
|
+
type: 'string'
|
|
13708
|
+
},
|
|
13709
|
+
files: {
|
|
13710
|
+
description: 'Force the on-disk agents store',
|
|
13711
|
+
type: 'boolean'
|
|
13712
|
+
},
|
|
13713
|
+
gateway: {
|
|
13714
|
+
description: 'Force the live gateway',
|
|
13715
|
+
type: 'boolean'
|
|
13716
|
+
},
|
|
13717
|
+
path: {
|
|
13718
|
+
description: 'SKILL.md file, or a directory holding one',
|
|
13719
|
+
type: 'string'
|
|
13720
|
+
}
|
|
13721
|
+
},
|
|
13722
|
+
required: [
|
|
13723
|
+
'path'
|
|
13724
|
+
],
|
|
13725
|
+
type: 'object'
|
|
13726
|
+
},
|
|
13727
|
+
positionals: [
|
|
13728
|
+
'path'
|
|
13729
|
+
]
|
|
13730
|
+
};
|
|
13731
|
+
const inputSchema = _shared_js__rspack_import_3/* .backendFlagsSchema.extend */.lK.extend({
|
|
13732
|
+
path: zod__rspack_import_4/* .string */.YjP().min(1)
|
|
13733
|
+
}).strict();
|
|
13734
|
+
const resultSchema = _shared_js__rspack_import_3/* .skillSchema */.b7;
|
|
13735
|
+
const skillFile = async (path)=>{
|
|
13736
|
+
const target = (0,node_path__rspack_import_2.resolve)(path);
|
|
13737
|
+
return (await (0,node_fs_promises__rspack_import_1.stat)(target)).isDirectory() ? (0,node_path__rspack_import_2.join)(target, 'SKILL.md') : target;
|
|
13738
|
+
};
|
|
13739
|
+
async function skillsAdd({ input }) {
|
|
13740
|
+
const markdown = await (0,node_fs_promises__rspack_import_1.readFile)(await skillFile(input.path), 'utf8');
|
|
13741
|
+
const backend = await (0,_shared_js__rspack_import_3/* .openBackendFromInput */.FS)(input);
|
|
13742
|
+
const skill = resultSchema.parse(await backend.addSkill(markdown));
|
|
13743
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
|
|
13744
|
+
value: skill,
|
|
13745
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
|
|
13746
|
+
children: `Added skill ${skill.name} (${skill.id}) to the shared library`
|
|
13747
|
+
})
|
|
13748
|
+
});
|
|
13749
|
+
}
|
|
13750
|
+
|
|
13751
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
13752
|
+
"default": () => (skillsAdd)
|
|
13753
|
+
}, {
|
|
13754
|
+
config: config,
|
|
13755
|
+
inputSchema: inputSchema,
|
|
13756
|
+
resultSchema: resultSchema
|
|
13757
|
+
});
|
|
13758
|
+
|
|
13759
|
+
|
|
13760
|
+
},
|
|
13761
|
+
"./src/cli/skills/list.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
13762
|
+
__webpack_require__.r(__webpack_exports__);
|
|
13763
|
+
/* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
|
|
13764
|
+
/* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
|
|
13765
|
+
/* import */ var zod__rspack_import_2 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
|
|
13766
|
+
/* import */ var _shared_js__rspack_import_1 = __webpack_require__("./src/cli/_shared.ts");
|
|
13767
|
+
|
|
13768
|
+
|
|
13769
|
+
|
|
13770
|
+
|
|
13771
|
+
const config = {
|
|
13772
|
+
description: 'List the skill library every bot in this Grok Bot shares.',
|
|
13773
|
+
inputJsonSchema: {
|
|
13774
|
+
additionalProperties: false,
|
|
13775
|
+
properties: {
|
|
13776
|
+
dir: {
|
|
13777
|
+
description: 'Agents directory for --files mode',
|
|
13778
|
+
type: 'string'
|
|
13779
|
+
},
|
|
13780
|
+
files: {
|
|
13781
|
+
description: 'Force the on-disk agents store',
|
|
13782
|
+
type: 'boolean'
|
|
13783
|
+
},
|
|
13784
|
+
gateway: {
|
|
13785
|
+
description: 'Force the live gateway',
|
|
13786
|
+
type: 'boolean'
|
|
13787
|
+
}
|
|
13788
|
+
},
|
|
13789
|
+
type: 'object'
|
|
13790
|
+
}
|
|
13791
|
+
};
|
|
13792
|
+
const inputSchema = _shared_js__rspack_import_1/* .backendFlagsSchema */.lK;
|
|
13793
|
+
const resultSchema = zod__rspack_import_2/* .array */.YOg(_shared_js__rspack_import_1/* .skillSchema */.b7);
|
|
13794
|
+
async function skillsList({ input }) {
|
|
13795
|
+
const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
|
|
13796
|
+
const skills = resultSchema.parse(await backend.skills());
|
|
13797
|
+
const lines = skills.map((s)=>`${s.id} ${s.name} [${s.source}]${s.description ? ` ${s.description}` : ''}`);
|
|
13798
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
13799
|
+
value: skills,
|
|
13800
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
13801
|
+
children: lines.length > 0 ? lines.join('\n') : 'No skills.'
|
|
13802
|
+
})
|
|
13803
|
+
});
|
|
13804
|
+
}
|
|
13805
|
+
|
|
13806
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
13807
|
+
"default": () => (skillsList)
|
|
13808
|
+
}, {
|
|
13809
|
+
config: config,
|
|
13810
|
+
inputSchema: inputSchema,
|
|
13811
|
+
resultSchema: resultSchema
|
|
13812
|
+
});
|
|
13813
|
+
|
|
13814
|
+
|
|
13815
|
+
},
|
|
13816
|
+
"./src/cli/skills/remove.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
13817
|
+
__webpack_require__.r(__webpack_exports__);
|
|
13818
|
+
/* import */ var react_jsx_runtime__rspack_import_0 = __webpack_require__("./node_modules/react/jsx-runtime.js");
|
|
13819
|
+
/* import */ var _agent_bundle_runtime__rspack_import_3 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
|
|
13820
|
+
/* import */ var zod__rspack_import_2 = __webpack_require__("./node_modules/zod/v4/classic/schemas.js");
|
|
13821
|
+
/* import */ var _shared_js__rspack_import_1 = __webpack_require__("./src/cli/_shared.ts");
|
|
13822
|
+
|
|
13823
|
+
|
|
13824
|
+
|
|
13825
|
+
|
|
13826
|
+
const config = {
|
|
13827
|
+
description: 'Remove a library skill by id or name. Every bot loses it.',
|
|
13828
|
+
inputJsonSchema: {
|
|
13829
|
+
additionalProperties: false,
|
|
13830
|
+
properties: {
|
|
13831
|
+
dir: {
|
|
13832
|
+
description: 'Agents directory for --files mode',
|
|
13833
|
+
type: 'string'
|
|
13834
|
+
},
|
|
13835
|
+
files: {
|
|
13836
|
+
description: 'Force the on-disk agents store',
|
|
13837
|
+
type: 'boolean'
|
|
13838
|
+
},
|
|
13839
|
+
gateway: {
|
|
13840
|
+
description: 'Force the live gateway',
|
|
13841
|
+
type: 'boolean'
|
|
13842
|
+
},
|
|
13843
|
+
skill: {
|
|
13844
|
+
description: 'Skill id or name',
|
|
13845
|
+
type: 'string'
|
|
13846
|
+
}
|
|
13847
|
+
},
|
|
13848
|
+
required: [
|
|
13849
|
+
'skill'
|
|
13850
|
+
],
|
|
13851
|
+
type: 'object'
|
|
13852
|
+
},
|
|
13853
|
+
positionals: [
|
|
13854
|
+
'skill'
|
|
13855
|
+
]
|
|
13856
|
+
};
|
|
13857
|
+
const inputSchema = _shared_js__rspack_import_1/* .backendFlagsSchema.extend */.lK.extend({
|
|
13858
|
+
skill: zod__rspack_import_2/* .string */.YjP().min(1)
|
|
13859
|
+
}).strict();
|
|
13860
|
+
const resultSchema = _shared_js__rspack_import_1/* .skillSchema */.b7;
|
|
13861
|
+
async function skillsRemove({ input }) {
|
|
13862
|
+
const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
|
|
13863
|
+
const skill = resultSchema.parse(await backend.removeSkill(input.skill));
|
|
13864
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
|
|
13865
|
+
value: skill,
|
|
13866
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
|
|
13867
|
+
children: `Removed skill ${skill.name} (${skill.id}) from the shared library`
|
|
13868
|
+
})
|
|
13869
|
+
});
|
|
13870
|
+
}
|
|
13871
|
+
|
|
13872
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
13873
|
+
"default": () => (skillsRemove)
|
|
13874
|
+
}, {
|
|
13875
|
+
config: config,
|
|
13876
|
+
inputSchema: inputSchema,
|
|
13877
|
+
resultSchema: resultSchema
|
|
13878
|
+
});
|
|
13879
|
+
|
|
13880
|
+
|
|
13676
13881
|
},
|
|
13677
13882
|
"./src/cli/thread.tsx"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
13678
13883
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -13765,9 +13970,9 @@ async function thread({ input }) {
|
|
|
13765
13970
|
event: 'thread',
|
|
13766
13971
|
rootId: input.root
|
|
13767
13972
|
});
|
|
13768
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
13973
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
|
|
13769
13974
|
value: rooted,
|
|
13770
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
13975
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
|
|
13771
13976
|
children: (0,_core_format_js__rspack_import_5/* .formatTranscript */.oZ)(rooted, {
|
|
13772
13977
|
full: input.full
|
|
13773
13978
|
})
|
|
@@ -13797,9 +14002,9 @@ async function thread({ input }) {
|
|
|
13797
14002
|
const text = (0,_core_format_js__rspack_import_5/* .formatTranscript */.oZ)(selected, {
|
|
13798
14003
|
full: input.full
|
|
13799
14004
|
});
|
|
13800
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
14005
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
|
|
13801
14006
|
value: selected,
|
|
13802
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
14007
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
|
|
13803
14008
|
children: `${text}\n\ncursor: ${delta.cursor}${delta.gapReset ? ' (gap reset)' : ''}`
|
|
13804
14009
|
})
|
|
13805
14010
|
});
|
|
@@ -13809,9 +14014,9 @@ async function thread({ input }) {
|
|
|
13809
14014
|
disabled: input.noHistory,
|
|
13810
14015
|
event: 'thread'
|
|
13811
14016
|
});
|
|
13812
|
-
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.
|
|
14017
|
+
return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
|
|
13813
14018
|
value: out,
|
|
13814
|
-
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.
|
|
14019
|
+
children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
|
|
13815
14020
|
children: (0,_core_format_js__rspack_import_5/* .formatTranscript */.oZ)(out, {
|
|
13816
14021
|
full: input.full
|
|
13817
14022
|
})
|
|
@@ -14461,7 +14666,28 @@ module.exports = __rspack_createRequire_require("util");
|
|
|
14461
14666
|
},
|
|
14462
14667
|
"./node_modules/@agent-bundle/runtime/dist/302.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
14463
14668
|
/* import */ var node_buffer__rspack_import_0 = __webpack_require__("node:buffer");
|
|
14669
|
+
/* import */ var react__rspack_import_1 = __webpack_require__("./node_modules/react/index.js");
|
|
14670
|
+
|
|
14464
14671
|
|
|
14672
|
+
const isServerComponent = (value)=>'function' == typeof value;
|
|
14673
|
+
const asMcpElement = (node)=>{
|
|
14674
|
+
let element = node;
|
|
14675
|
+
while(isValidElement(element) && isServerComponent(element.type))element = element.type(element.props);
|
|
14676
|
+
if (!isValidElement(element) || 'string' != typeof element.type || !element.type.startsWith('mcp-')) throw new Error('Expected an MCP result element');
|
|
14677
|
+
return {
|
|
14678
|
+
props: element.props,
|
|
14679
|
+
type: element.type
|
|
14680
|
+
};
|
|
14681
|
+
};
|
|
14682
|
+
const requiredString = (value, message)=>{
|
|
14683
|
+
if ('string' != typeof value || '' === value.trim()) throw new Error(message);
|
|
14684
|
+
return value;
|
|
14685
|
+
};
|
|
14686
|
+
const textChild = (children, message)=>{
|
|
14687
|
+
const values = Children.toArray(children);
|
|
14688
|
+
if (1 !== values.length || 'string' != typeof values[0]) throw new Error(message);
|
|
14689
|
+
return values[0];
|
|
14690
|
+
};
|
|
14465
14691
|
const jsonLeafBytes = (value)=>node_buffer__rspack_import_0.Buffer.byteLength(JSON.stringify(value), 'utf8');
|
|
14466
14692
|
const isArrayIndex = (key, length)=>{
|
|
14467
14693
|
if ('0' === key) return length > 0;
|
|
@@ -14523,6 +14749,16 @@ const cloneJsonValue = (value, ancestors, path, depth = 0, budget)=>{
|
|
|
14523
14749
|
ancestors.delete(value);
|
|
14524
14750
|
}
|
|
14525
14751
|
};
|
|
14752
|
+
const jsonRecord = (value, message)=>{
|
|
14753
|
+
try {
|
|
14754
|
+
if (null === value || 'object' != typeof value || Array.isArray(value)) throw new Error('not a plain object');
|
|
14755
|
+
return cloneJsonValue(value, new Set(), '');
|
|
14756
|
+
} catch (error) {
|
|
14757
|
+
throw new Error(`${message} (${error instanceof Error ? error.message : String(error)})`, {
|
|
14758
|
+
cause: error
|
|
14759
|
+
});
|
|
14760
|
+
}
|
|
14761
|
+
};
|
|
14526
14762
|
const deepFreezeJson = (value)=>{
|
|
14527
14763
|
if ('object' == typeof value && null !== value) {
|
|
14528
14764
|
for (const child of Object.values(value))deepFreezeJson(child);
|
|
@@ -14540,6 +14776,89 @@ const snapshotJsonValue = (value, message, budget)=>{
|
|
|
14540
14776
|
});
|
|
14541
14777
|
}
|
|
14542
14778
|
};
|
|
14779
|
+
const lowerContent = (node)=>{
|
|
14780
|
+
const element = asMcpElement(node);
|
|
14781
|
+
const { props } = element;
|
|
14782
|
+
switch(element.type){
|
|
14783
|
+
case 'mcp-text':
|
|
14784
|
+
return {
|
|
14785
|
+
text: textChild(props.children, 'mcp-text requires one text child'),
|
|
14786
|
+
type: 'text'
|
|
14787
|
+
};
|
|
14788
|
+
case 'mcp-image':
|
|
14789
|
+
return {
|
|
14790
|
+
data: requiredString(props.data, 'mcp-image requires non-empty data and mimeType'),
|
|
14791
|
+
mimeType: requiredString(props.mimeType, 'mcp-image requires non-empty data and mimeType'),
|
|
14792
|
+
type: 'image'
|
|
14793
|
+
};
|
|
14794
|
+
case 'mcp-audio':
|
|
14795
|
+
return {
|
|
14796
|
+
data: requiredString(props.data, 'mcp-audio requires non-empty data and mimeType'),
|
|
14797
|
+
mimeType: requiredString(props.mimeType, 'mcp-audio requires non-empty data and mimeType'),
|
|
14798
|
+
type: 'audio'
|
|
14799
|
+
};
|
|
14800
|
+
case 'mcp-resource-link':
|
|
14801
|
+
{
|
|
14802
|
+
const mimeType = props.mimeType;
|
|
14803
|
+
if (void 0 !== mimeType && 'string' != typeof mimeType) throw new Error('mcp-resource-link mimeType must be a string');
|
|
14804
|
+
return {
|
|
14805
|
+
...void 0 === mimeType ? {} : {
|
|
14806
|
+
mimeType
|
|
14807
|
+
},
|
|
14808
|
+
name: requiredString(props.name, 'mcp-resource-link requires non-empty uri and name'),
|
|
14809
|
+
type: 'resource_link',
|
|
14810
|
+
uri: requiredString(props.uri, 'mcp-resource-link requires non-empty uri and name')
|
|
14811
|
+
};
|
|
14812
|
+
}
|
|
14813
|
+
case 'mcp-embedded-resource':
|
|
14814
|
+
{
|
|
14815
|
+
const hasText = void 0 !== props.text;
|
|
14816
|
+
const hasTextChild = void 0 !== props.children;
|
|
14817
|
+
const hasBlob = void 0 !== props.blob;
|
|
14818
|
+
if (Number(hasText) + Number(hasTextChild) + Number(hasBlob) !== 1) throw new Error('mcp-embedded-resource accepts exactly one text or blob value');
|
|
14819
|
+
const mimeType = props.mimeType;
|
|
14820
|
+
if (void 0 !== mimeType && 'string' != typeof mimeType) throw new Error('mcp-embedded-resource mimeType must be a string');
|
|
14821
|
+
const resource = {
|
|
14822
|
+
...void 0 === mimeType ? {} : {
|
|
14823
|
+
mimeType
|
|
14824
|
+
},
|
|
14825
|
+
uri: requiredString(props.uri, 'mcp-embedded-resource requires a non-empty uri'),
|
|
14826
|
+
...hasBlob ? {
|
|
14827
|
+
blob: requiredString(props.blob, 'mcp-embedded-resource blob must be non-empty')
|
|
14828
|
+
} : {
|
|
14829
|
+
text: hasTextChild ? textChild(props.children, 'mcp-embedded-resource requires one text child') : requiredString(props.text, 'mcp-embedded-resource text must be non-empty')
|
|
14830
|
+
}
|
|
14831
|
+
};
|
|
14832
|
+
return {
|
|
14833
|
+
resource,
|
|
14834
|
+
type: 'resource'
|
|
14835
|
+
};
|
|
14836
|
+
}
|
|
14837
|
+
case 'mcp-result':
|
|
14838
|
+
throw new Error('mcp-result may not be nested');
|
|
14839
|
+
default:
|
|
14840
|
+
throw new Error(`Unsupported MCP result element: ${element.type}`);
|
|
14841
|
+
}
|
|
14842
|
+
};
|
|
14843
|
+
const lowerMcpResult = (node)=>{
|
|
14844
|
+
const root = asMcpElement(node);
|
|
14845
|
+
if ('mcp-result' !== root.type) throw new Error('Expected mcp-result as the root element');
|
|
14846
|
+
if (void 0 !== root.props.isError && 'boolean' != typeof root.props.isError) throw new Error('mcp-result isError must be a boolean');
|
|
14847
|
+
const structuredContent = root.props.structuredContent;
|
|
14848
|
+
const metadata = root.props._meta;
|
|
14849
|
+
return {
|
|
14850
|
+
content: Children.toArray(root.props.children).map(lowerContent),
|
|
14851
|
+
...void 0 === metadata ? {} : {
|
|
14852
|
+
_meta: jsonRecord(metadata, 'mcp-result _meta must be JSON-serializable')
|
|
14853
|
+
},
|
|
14854
|
+
...void 0 === structuredContent ? {} : {
|
|
14855
|
+
structuredContent: jsonRecord(structuredContent, 'mcp-result structuredContent must be JSON-serializable')
|
|
14856
|
+
},
|
|
14857
|
+
...void 0 === root.props.isError ? {} : {
|
|
14858
|
+
isError: root.props.isError
|
|
14859
|
+
}
|
|
14860
|
+
};
|
|
14861
|
+
};
|
|
14543
14862
|
const AGENT_DOCUMENT_VERSION = 1;
|
|
14544
14863
|
const agentRenderAbortError = ()=>new DOMException('Agent render was aborted', 'AbortError');
|
|
14545
14864
|
const DEFAULT_AGENT_RENDER_LIMITS = Object.freeze({
|
|
@@ -14567,7 +14886,7 @@ const resolveAgentRenderLimits = (overrides = {})=>{
|
|
|
14567
14886
|
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`);
|
|
14568
14887
|
return Object.freeze(limits);
|
|
14569
14888
|
};
|
|
14570
|
-
const
|
|
14889
|
+
const agent_document_requiredString = (value, field)=>{
|
|
14571
14890
|
if ('string' != typeof value || '' === value.trim()) throw new AgentContractError('invalid-document', `${field} must be a non-empty string`);
|
|
14572
14891
|
return value;
|
|
14573
14892
|
};
|
|
@@ -14575,7 +14894,7 @@ const agent_document_text = (value, field)=>{
|
|
|
14575
14894
|
if ('string' != typeof value) throw new AgentContractError('invalid-document', `${field} must be a string`);
|
|
14576
14895
|
return value;
|
|
14577
14896
|
};
|
|
14578
|
-
const optionalString = (value, field)=>void 0 === value ? void 0 :
|
|
14897
|
+
const optionalString = (value, field)=>void 0 === value ? void 0 : agent_document_requiredString(value, field);
|
|
14579
14898
|
const elapsedTimeExceeded = (maxElapsedMs)=>new AgentContractError('elapsed-time-exceeded', `Agent render elapsed time exceeds ${String(maxElapsedMs)}ms`);
|
|
14580
14899
|
const expectDocumentDepth = (depth, limits)=>{
|
|
14581
14900
|
if (depth > limits.maxDocumentDepth) throw new AgentContractError('document-depth-exceeded', `Agent Document depth exceeds ${String(limits.maxDocumentDepth)}`);
|
|
@@ -14673,15 +14992,15 @@ const snapshotNode = (node, depth, state)=>{
|
|
|
14673
14992
|
}
|
|
14674
14993
|
case 'image':
|
|
14675
14994
|
return Object.freeze({
|
|
14676
|
-
data:
|
|
14995
|
+
data: agent_document_requiredString(node.data, 'Agent image data'),
|
|
14677
14996
|
kind: 'image',
|
|
14678
|
-
mimeType:
|
|
14997
|
+
mimeType: agent_document_requiredString(node.mimeType, 'Agent image mimeType')
|
|
14679
14998
|
});
|
|
14680
14999
|
case 'audio':
|
|
14681
15000
|
return Object.freeze({
|
|
14682
|
-
data:
|
|
15001
|
+
data: agent_document_requiredString(node.data, 'Agent audio data'),
|
|
14683
15002
|
kind: 'audio',
|
|
14684
|
-
mimeType:
|
|
15003
|
+
mimeType: agent_document_requiredString(node.mimeType, 'Agent audio mimeType')
|
|
14685
15004
|
});
|
|
14686
15005
|
case 'resource':
|
|
14687
15006
|
{
|
|
@@ -14691,13 +15010,13 @@ const snapshotNode = (node, depth, state)=>{
|
|
|
14691
15010
|
...void 0 === mimeType ? {} : {
|
|
14692
15011
|
mimeType
|
|
14693
15012
|
},
|
|
14694
|
-
name:
|
|
14695
|
-
uri:
|
|
15013
|
+
name: agent_document_requiredString(node.name, 'Agent resource name'),
|
|
15014
|
+
uri: agent_document_requiredString(node.uri, 'Agent resource uri')
|
|
14696
15015
|
});
|
|
14697
15016
|
}
|
|
14698
15017
|
case 'error':
|
|
14699
15018
|
return Object.freeze({
|
|
14700
|
-
code:
|
|
15019
|
+
code: agent_document_requiredString(node.code, 'Agent error code'),
|
|
14701
15020
|
kind: 'error',
|
|
14702
15021
|
message: agent_document_text(node.message, 'Agent error message')
|
|
14703
15022
|
});
|
|
@@ -14755,7 +15074,7 @@ const snapshotRenderError = (error, limits)=>{
|
|
|
14755
15074
|
nodes: 0
|
|
14756
15075
|
});
|
|
14757
15076
|
return Object.freeze({
|
|
14758
|
-
code:
|
|
15077
|
+
code: agent_document_requiredString(error.code, 'Agent render error code'),
|
|
14759
15078
|
...void 0 === data ? {} : {
|
|
14760
15079
|
data
|
|
14761
15080
|
},
|
|
@@ -14790,7 +15109,7 @@ const snapshotEvent = (input, sequence, limits)=>{
|
|
|
14790
15109
|
}
|
|
14791
15110
|
case 'replace':
|
|
14792
15111
|
return Object.freeze({
|
|
14793
|
-
boundaryId:
|
|
15112
|
+
boundaryId: agent_document_requiredString(input.boundaryId, 'Agent render boundaryId'),
|
|
14794
15113
|
document: createAgentDocument(input.document, limits),
|
|
14795
15114
|
sequence,
|
|
14796
15115
|
type: 'replace'
|
|
@@ -15358,11 +15677,51 @@ const Agent = Object.freeze({
|
|
|
15358
15677
|
Result: AgentResult,
|
|
15359
15678
|
Text: AgentText
|
|
15360
15679
|
});
|
|
15680
|
+
const Result = ({ children })=>(0,react__rspack_import_0.createElement)('agent-hook-result', null, children);
|
|
15681
|
+
const AdditionalContext = ({ children })=>(0,react__rspack_import_0.createElement)('agent-hook-additional-context', null, children);
|
|
15682
|
+
const Hook = {
|
|
15683
|
+
AdditionalContext: AdditionalContext,
|
|
15684
|
+
Result: Result
|
|
15685
|
+
};
|
|
15686
|
+
const McpResult = ({ _meta, children, isError, structuredContent })=>createElement('mcp-result', {
|
|
15687
|
+
_meta,
|
|
15688
|
+
isError,
|
|
15689
|
+
structuredContent
|
|
15690
|
+
}, children);
|
|
15691
|
+
const McpText = ({ children })=>createElement('mcp-text', null, children);
|
|
15692
|
+
const McpImage = ({ data, mimeType })=>createElement('mcp-image', {
|
|
15693
|
+
data,
|
|
15694
|
+
mimeType
|
|
15695
|
+
});
|
|
15696
|
+
const McpAudio = ({ data, mimeType })=>createElement('mcp-audio', {
|
|
15697
|
+
data,
|
|
15698
|
+
mimeType
|
|
15699
|
+
});
|
|
15700
|
+
const McpResourceLink = ({ mimeType, name, uri })=>createElement('mcp-resource-link', {
|
|
15701
|
+
mimeType,
|
|
15702
|
+
name,
|
|
15703
|
+
uri
|
|
15704
|
+
});
|
|
15705
|
+
const McpEmbeddedResource = ({ blob, children, mimeType, text, uri })=>createElement('mcp-embedded-resource', {
|
|
15706
|
+
blob,
|
|
15707
|
+
mimeType,
|
|
15708
|
+
text,
|
|
15709
|
+
uri
|
|
15710
|
+
}, children);
|
|
15711
|
+
const Mcp = (/* unused pure expression or super */ null && ({
|
|
15712
|
+
Audio: McpAudio,
|
|
15713
|
+
EmbeddedResource: McpEmbeddedResource,
|
|
15714
|
+
Image: McpImage,
|
|
15715
|
+
ResourceLink: McpResourceLink,
|
|
15716
|
+
Result: McpResult,
|
|
15717
|
+
Text: McpText
|
|
15718
|
+
}));
|
|
15361
15719
|
|
|
15362
15720
|
|
|
15363
15721
|
__webpack_require__.d(__webpack_exports__, {
|
|
15364
15722
|
}, {
|
|
15365
|
-
|
|
15723
|
+
g6: Agent,
|
|
15724
|
+
qn: Hook
|
|
15366
15725
|
});
|
|
15367
15726
|
|
|
15368
15727
|
|
|
@@ -15679,20 +16038,23 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15679
16038
|
|
|
15680
16039
|
},
|
|
15681
16040
|
"./node_modules/@agent-bundle/runtime/dist/index.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
15682
|
-
/* import */ var
|
|
15683
|
-
/* import */ var
|
|
15684
|
-
/* import */ var
|
|
15685
|
-
/* import */ var
|
|
15686
|
-
/* import */ var
|
|
15687
|
-
/* import */ var
|
|
15688
|
-
/* import */ var
|
|
15689
|
-
/* import */ var
|
|
15690
|
-
/* import */ var
|
|
16041
|
+
/* import */ var effect__rspack_import_3 = __webpack_require__("./node_modules/effect/dist/Latch.js");
|
|
16042
|
+
/* import */ var effect__rspack_import_4 = __webpack_require__("./node_modules/effect/dist/Effect.js");
|
|
16043
|
+
/* import */ var effect__rspack_import_7 = __webpack_require__("./node_modules/effect/dist/Duration.js");
|
|
16044
|
+
/* import */ var effect__rspack_import_8 = __webpack_require__("./node_modules/effect/dist/Stream.js");
|
|
16045
|
+
/* import */ var effect__rspack_import_9 = __webpack_require__("./node_modules/effect/dist/Deferred.js");
|
|
16046
|
+
/* import */ var effect__rspack_import_10 = __webpack_require__("./node_modules/effect/dist/Queue.js");
|
|
16047
|
+
/* import */ var effect__rspack_import_11 = __webpack_require__("./node_modules/effect/dist/Option.js");
|
|
16048
|
+
/* import */ var effect__rspack_import_12 = __webpack_require__("./node_modules/effect/dist/Exit.js");
|
|
16049
|
+
/* import */ var effect__rspack_import_14 = __webpack_require__("./node_modules/effect/dist/Clock.js");
|
|
15691
16050
|
/* import */ var react__rspack_import_0 = __webpack_require__("./node_modules/react/index.js");
|
|
15692
16051
|
/* import */ var react_server_dom_rspack_client_node__rspack_import_1 = __webpack_require__("./node_modules/react-server-dom-rspack/client.node.js");
|
|
15693
|
-
/* import */ var
|
|
15694
|
-
/* import */ var
|
|
15695
|
-
/* import */ var
|
|
16052
|
+
/* import */ var node_async_hooks__rspack_import_2 = __webpack_require__("node:async_hooks");
|
|
16053
|
+
/* import */ var _315_js__rspack_import_5 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/315.js");
|
|
16054
|
+
/* import */ var _302_js__rspack_import_6 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/302.js");
|
|
16055
|
+
/* import */ var _707_js__rspack_import_13 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/707.js");
|
|
16056
|
+
/* import */ var _506_js__rspack_import_15 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
|
|
16057
|
+
|
|
15696
16058
|
|
|
15697
16059
|
|
|
15698
16060
|
|
|
@@ -15703,10 +16065,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
15703
16065
|
|
|
15704
16066
|
|
|
15705
16067
|
const createFlightDemand = ()=>{
|
|
15706
|
-
const pulling =
|
|
16068
|
+
const pulling = effect__rspack_import_3/* .makeUnsafe */.LZ(false);
|
|
15707
16069
|
let shellEmitted = false;
|
|
15708
16070
|
return {
|
|
15709
|
-
markShell:
|
|
16071
|
+
markShell: effect__rspack_import_4/* .sync */.OH5(()=>{
|
|
15710
16072
|
shellEmitted = true;
|
|
15711
16073
|
}),
|
|
15712
16074
|
notePull () {
|
|
@@ -15715,11 +16077,11 @@ const createFlightDemand = ()=>{
|
|
|
15715
16077
|
notePullEnd () {
|
|
15716
16078
|
pulling.closeUnsafe();
|
|
15717
16079
|
},
|
|
15718
|
-
wait:
|
|
16080
|
+
wait: effect__rspack_import_4/* .suspend */.DYE(()=>shellEmitted ? pulling.await : effect__rspack_import_4/* ["void"] */.rIH)
|
|
15719
16081
|
};
|
|
15720
16082
|
};
|
|
15721
|
-
const emitBoundRenderEvent = (sequence, input)=>
|
|
15722
|
-
catch: (error)=>(0,
|
|
16083
|
+
const emitBoundRenderEvent = (sequence, input)=>effect__rspack_import_4/* ["try"] */.SvU({
|
|
16084
|
+
catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
|
|
15723
16085
|
try: ()=>sequence.emit(input)
|
|
15724
16086
|
});
|
|
15725
16087
|
const agentElementTypes = Object.freeze([
|
|
@@ -15736,7 +16098,7 @@ const agentElementTypes = Object.freeze([
|
|
|
15736
16098
|
]);
|
|
15737
16099
|
const isAgentElementType = (value)=>agentElementTypes.includes(value);
|
|
15738
16100
|
const protocolElement = (node)=>{
|
|
15739
|
-
if (!(0,react__rspack_import_0.isValidElement)(node) || 'string' != typeof node.type || !isAgentElementType(node.type)) throw new
|
|
16101
|
+
if (!(0,react__rspack_import_0.isValidElement)(node) || 'string' != typeof node.type || !isAgentElementType(node.type)) throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', 'Flight output must contain only Agent protocol elements; function components and HTML are unsupported');
|
|
15740
16102
|
return {
|
|
15741
16103
|
props: node.props,
|
|
15742
16104
|
type: node.type
|
|
@@ -15744,31 +16106,31 @@ const protocolElement = (node)=>{
|
|
|
15744
16106
|
};
|
|
15745
16107
|
const textChild = (children, type)=>{
|
|
15746
16108
|
const values = react__rspack_import_0.Children.toArray(children);
|
|
15747
|
-
if (1 !== values.length || 'string' != typeof values[0]) throw new
|
|
16109
|
+
if (1 !== values.length || 'string' != typeof values[0]) throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', `${type} requires exactly one string child`);
|
|
15748
16110
|
return values[0];
|
|
15749
16111
|
};
|
|
15750
16112
|
const decodeBudget = (state)=>({
|
|
15751
16113
|
addBytes (n) {
|
|
15752
16114
|
state.bytes += n;
|
|
15753
|
-
if (state.bytes > state.limits.maxDocumentBytes) throw new
|
|
16115
|
+
if (state.bytes > state.limits.maxDocumentBytes) throw new _302_js__rspack_import_6/* .AgentContractError */.I2('document-bytes-exceeded', `Agent Document bytes exceed ${String(state.limits.maxDocumentBytes)}`);
|
|
15754
16116
|
},
|
|
15755
16117
|
addNode () {
|
|
15756
|
-
(0,
|
|
16118
|
+
(0,_302_js__rspack_import_6/* .admitDocumentNode */.Dy)(state);
|
|
15757
16119
|
},
|
|
15758
16120
|
checkDepth (depth) {
|
|
15759
|
-
(0,
|
|
16121
|
+
(0,_302_js__rspack_import_6/* .expectDocumentDepth */.MI)(depth, state.limits);
|
|
15760
16122
|
}
|
|
15761
16123
|
});
|
|
15762
16124
|
const isJsonObject = (value)=>null != value && 'object' == typeof value && !Array.isArray(value);
|
|
15763
16125
|
const budgetedJson = (value, message, depth, state)=>{
|
|
15764
16126
|
try {
|
|
15765
|
-
return (0,
|
|
16127
|
+
return (0,_302_js__rspack_import_6/* .snapshotJsonValue */.mY)(value, message, {
|
|
15766
16128
|
depth,
|
|
15767
16129
|
limits: decodeBudget(state)
|
|
15768
16130
|
});
|
|
15769
16131
|
} catch (error) {
|
|
15770
|
-
if (error instanceof
|
|
15771
|
-
throw new
|
|
16132
|
+
if (error instanceof _302_js__rspack_import_6/* .AgentContractError */.I2) throw error;
|
|
16133
|
+
throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', error instanceof Error ? error.message : message, {
|
|
15772
16134
|
cause: error
|
|
15773
16135
|
});
|
|
15774
16136
|
}
|
|
@@ -15827,8 +16189,8 @@ const decodeResult = (props, depth, state)=>{
|
|
|
15827
16189
|
return node;
|
|
15828
16190
|
};
|
|
15829
16191
|
const decodeNode = (node, depth, state)=>{
|
|
15830
|
-
(0,
|
|
15831
|
-
(0,
|
|
16192
|
+
(0,_302_js__rspack_import_6/* .expectDocumentDepth */.MI)(depth, state.limits);
|
|
16193
|
+
(0,_302_js__rspack_import_6/* .admitDocumentNode */.Dy)(state);
|
|
15832
16194
|
const element = protocolElement(node);
|
|
15833
16195
|
const { props } = element;
|
|
15834
16196
|
switch(element.type){
|
|
@@ -15896,14 +16258,14 @@ const decodeNode = (node, depth, state)=>{
|
|
|
15896
16258
|
default:
|
|
15897
16259
|
{
|
|
15898
16260
|
const exhaustive = element.type;
|
|
15899
|
-
throw new
|
|
16261
|
+
throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', `Unsupported Agent protocol element: ${String(exhaustive)}`);
|
|
15900
16262
|
}
|
|
15901
16263
|
}
|
|
15902
16264
|
};
|
|
15903
16265
|
const decodeAgentDocument = (node, limits = {})=>{
|
|
15904
|
-
const resolved = (0,
|
|
16266
|
+
const resolved = (0,_302_js__rspack_import_6/* .resolveAgentRenderLimits */.i0)(limits);
|
|
15905
16267
|
const root = protocolElement(node);
|
|
15906
|
-
if ('agent-result' !== root.type) throw new
|
|
16268
|
+
if ('agent-result' !== root.type) throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', 'Flight output must have Agent.Result as its root');
|
|
15907
16269
|
const state = {
|
|
15908
16270
|
bytes: 0,
|
|
15909
16271
|
discardedBytes: 0,
|
|
@@ -15914,7 +16276,7 @@ const decodeAgentDocument = (node, limits = {})=>{
|
|
|
15914
16276
|
};
|
|
15915
16277
|
const documentRoot = decodeNode(node, 1, state);
|
|
15916
16278
|
const value = state.resultValues.get(documentRoot)?.value;
|
|
15917
|
-
const document = (0,
|
|
16279
|
+
const document = (0,_302_js__rspack_import_6/* .createAgentDocument */.ZX)({
|
|
15918
16280
|
root: documentRoot,
|
|
15919
16281
|
status: state.representedError ? 'represented-error' : 'success',
|
|
15920
16282
|
...void 0 === value ? {} : {
|
|
@@ -15922,13 +16284,13 @@ const decodeAgentDocument = (node, limits = {})=>{
|
|
|
15922
16284
|
},
|
|
15923
16285
|
version: 1
|
|
15924
16286
|
}, resolved);
|
|
15925
|
-
if (state.discardedBytes > 0 && state.discardedBytes + jsonBytes(document) > resolved.maxDocumentBytes) throw new
|
|
16287
|
+
if (state.discardedBytes > 0 && state.discardedBytes + jsonBytes(document) > resolved.maxDocumentBytes) throw new _302_js__rspack_import_6/* .AgentContractError */.I2('document-bytes-exceeded', `Agent Document bytes exceed ${String(resolved.maxDocumentBytes)}`);
|
|
15926
16288
|
return document;
|
|
15927
16289
|
};
|
|
15928
16290
|
const REACT_FRAGMENT = Symbol.for('react.fragment');
|
|
15929
16291
|
const REACT_LAZY = Symbol.for('react.lazy');
|
|
15930
16292
|
const REACT_SUSPENSE = Symbol.for('react.suspense');
|
|
15931
|
-
const abortError =
|
|
16293
|
+
const abortError = _302_js__rspack_import_6/* .agentRenderAbortError */.k2;
|
|
15932
16294
|
const isObject = (value)=>'object' == typeof value && null !== value;
|
|
15933
16295
|
const isThenable = (value)=>isObject(value) && 'function' == typeof value.then;
|
|
15934
16296
|
const isLazyElement = (value)=>isObject(value) && value.$$typeof === REACT_LAZY && isThenable(value._payload);
|
|
@@ -15959,7 +16321,7 @@ const classifyNode = (node)=>{
|
|
|
15959
16321
|
kind: 'thenable',
|
|
15960
16322
|
value: node
|
|
15961
16323
|
};
|
|
15962
|
-
if (!(0,react__rspack_import_0.isValidElement)(node)) throw new
|
|
16324
|
+
if (!(0,react__rspack_import_0.isValidElement)(node)) throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', 'Flight output contained an unsupported node');
|
|
15963
16325
|
const type = node.type;
|
|
15964
16326
|
if (type === REACT_SUSPENSE) return {
|
|
15965
16327
|
kind: 'suspense',
|
|
@@ -15973,7 +16335,7 @@ const classifyNode = (node)=>{
|
|
|
15973
16335
|
kind: 'protocol',
|
|
15974
16336
|
value: node
|
|
15975
16337
|
};
|
|
15976
|
-
throw new
|
|
16338
|
+
throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', "Flight output must contain only Agent protocol elements; function components and HTML are unsupported");
|
|
15977
16339
|
};
|
|
15978
16340
|
const thenableStatus = (thenable)=>{
|
|
15979
16341
|
switch(thenable.status){
|
|
@@ -16148,8 +16510,8 @@ const snapshotTree = (root, ids)=>{
|
|
|
16148
16510
|
tree: materializeNode(root, '', ctx)
|
|
16149
16511
|
};
|
|
16150
16512
|
};
|
|
16151
|
-
const hostError = (signal, error)=>signal.aborted || (0,
|
|
16152
|
-
const waitSettledBoundary = (pending)=>
|
|
16513
|
+
const hostError = (signal, error)=>signal.aborted || (0,_315_js__rspack_import_5/* .isAbortError */.zf)(error) ? abortError() : (0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error);
|
|
16514
|
+
const waitSettledBoundary = (pending)=>effect__rspack_import_4/* .raceAll */.Vdx(pending.map((boundary)=>effect__rspack_import_4/* .promise */.ivC(()=>Promise.resolve(boundary.thenable).then(()=>({
|
|
16153
16515
|
boundary,
|
|
16154
16516
|
ok: true
|
|
16155
16517
|
}), (error)=>({
|
|
@@ -16159,8 +16521,8 @@ const waitSettledBoundary = (pending)=>effect__rspack_import_3/* .raceAll */.Vdx
|
|
|
16159
16521
|
})))));
|
|
16160
16522
|
const waitOrDeadline = (wait, sequence)=>{
|
|
16161
16523
|
const remaining = sequence.remainingMs;
|
|
16162
|
-
if (remaining <= 0) return
|
|
16163
|
-
return
|
|
16524
|
+
if (remaining <= 0) return effect__rspack_import_4/* .fail */.fJG((0,_302_js__rspack_import_6/* .elapsedTimeExceeded */.zm)(sequence.maxElapsedMs));
|
|
16525
|
+
return effect__rspack_import_4/* .raceFirst */.KT6(wait, effect__rspack_import_4/* .sleep */.yy4(effect__rspack_import_7/* .millis */.ne(remaining)).pipe(effect__rspack_import_4/* .flatMap */.qIB(()=>effect__rspack_import_4/* .fail */.fJG((0,_302_js__rspack_import_6/* .elapsedTimeExceeded */.zm)(sequence.maxElapsedMs)))));
|
|
16164
16526
|
};
|
|
16165
16527
|
const settledBoundaryInputs = (previous, next, winner, limits)=>{
|
|
16166
16528
|
const stillPending = new Set(next.pending.map((boundary)=>boundary.id));
|
|
@@ -16193,9 +16555,9 @@ const settledBoundaryInputs = (previous, next, winner, limits)=>{
|
|
|
16193
16555
|
for (const boundary of previous.pending)if (boundary.id !== winner.boundary.id) emitFor(boundary.id);
|
|
16194
16556
|
return inputs;
|
|
16195
16557
|
};
|
|
16196
|
-
const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInputs, sequence)=>
|
|
16197
|
-
if (0 === snapshot.pending.length) return waitOrDeadline(
|
|
16198
|
-
catch: (error)=>(0,
|
|
16558
|
+
const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInputs, sequence)=>effect__rspack_import_8/* .paginate */.EnV(initial, (snapshot)=>{
|
|
16559
|
+
if (0 === snapshot.pending.length) return waitOrDeadline(effect__rspack_import_9/* ["await"] */.Tx(flightDone), sequence).pipe(effect__rspack_import_4/* .andThen */.hgn(effect__rspack_import_10/* .clear */.IU(progressInputs)), effect__rspack_import_4/* .flatMap */.qIB((queued)=>effect__rspack_import_4/* ["try"] */.SvU({
|
|
16560
|
+
catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
|
|
16199
16561
|
try: ()=>[
|
|
16200
16562
|
[
|
|
16201
16563
|
...queued,
|
|
@@ -16204,32 +16566,32 @@ const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInp
|
|
|
16204
16566
|
type: 'complete'
|
|
16205
16567
|
}
|
|
16206
16568
|
],
|
|
16207
|
-
|
|
16569
|
+
effect__rspack_import_11.none()
|
|
16208
16570
|
]
|
|
16209
16571
|
})));
|
|
16210
|
-
return
|
|
16572
|
+
return effect__rspack_import_4/* .raceFirst */.KT6(waitOrDeadline(waitSettledBoundary(snapshot.pending), sequence).pipe(effect__rspack_import_4/* .map */.TjK((winner)=>({
|
|
16211
16573
|
kind: 'boundary',
|
|
16212
16574
|
winner
|
|
16213
|
-
}))),
|
|
16575
|
+
}))), effect__rspack_import_10/* .take */.s(progressInputs).pipe(effect__rspack_import_4/* .map */.TjK((input)=>({
|
|
16214
16576
|
kind: 'progress',
|
|
16215
16577
|
input
|
|
16216
|
-
})))).pipe(
|
|
16578
|
+
})))).pipe(effect__rspack_import_4/* .flatMap */.qIB((event)=>{
|
|
16217
16579
|
switch(event.kind){
|
|
16218
16580
|
case 'progress':
|
|
16219
|
-
return
|
|
16581
|
+
return effect__rspack_import_4/* .succeed */.PyW([
|
|
16220
16582
|
[
|
|
16221
16583
|
event.input
|
|
16222
16584
|
],
|
|
16223
|
-
|
|
16585
|
+
effect__rspack_import_11.some(snapshot)
|
|
16224
16586
|
]);
|
|
16225
16587
|
case 'boundary':
|
|
16226
|
-
return
|
|
16227
|
-
catch: (error)=>(0,
|
|
16588
|
+
return effect__rspack_import_4/* ["try"] */.SvU({
|
|
16589
|
+
catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
|
|
16228
16590
|
try: ()=>{
|
|
16229
16591
|
const next = snapshotTree(root, ids);
|
|
16230
16592
|
return [
|
|
16231
16593
|
settledBoundaryInputs(snapshot, next, event.winner, limits),
|
|
16232
|
-
|
|
16594
|
+
effect__rspack_import_11.some(next)
|
|
16233
16595
|
];
|
|
16234
16596
|
}
|
|
16235
16597
|
});
|
|
@@ -16241,38 +16603,38 @@ const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInp
|
|
|
16241
16603
|
}
|
|
16242
16604
|
}));
|
|
16243
16605
|
});
|
|
16244
|
-
const gatedFlightStream = (flight, demand, flightDone)=>
|
|
16245
|
-
const reader = yield*
|
|
16246
|
-
const cancelExit = yield*
|
|
16247
|
-
catch: (error)=>(0,
|
|
16606
|
+
const gatedFlightStream = (flight, demand, flightDone)=>effect__rspack_import_8/* .unwrap */.oAg(effect__rspack_import_4/* .gen */.JkU(function*() {
|
|
16607
|
+
const reader = yield* effect__rspack_import_4/* .acquireRelease */.Q56(effect__rspack_import_4/* .sync */.OH5(()=>flight.getReader()), (handle, exit)=>effect__rspack_import_4/* .gen */.JkU(function*() {
|
|
16608
|
+
const cancelExit = yield* effect__rspack_import_4/* .exit */.NS5(effect__rspack_import_4/* .tryPromise */.$mh({
|
|
16609
|
+
catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
|
|
16248
16610
|
try: ()=>handle.cancel()
|
|
16249
16611
|
}));
|
|
16250
|
-
if (
|
|
16251
|
-
if (
|
|
16252
|
-
const error = (0,
|
|
16253
|
-
yield*
|
|
16254
|
-
return yield*
|
|
16612
|
+
if (effect__rspack_import_12/* .isFailure */.N6(exit)) return void (yield* effect__rspack_import_9/* .fail */.fJ(flightDone, (0,_315_js__rspack_import_5/* .mapCause */.K0)(exit.cause)));
|
|
16613
|
+
if (effect__rspack_import_12/* .isFailure */.N6(cancelExit)) {
|
|
16614
|
+
const error = (0,_315_js__rspack_import_5/* .mapCause */.K0)(cancelExit.cause);
|
|
16615
|
+
yield* effect__rspack_import_9/* .fail */.fJ(flightDone, error);
|
|
16616
|
+
return yield* effect__rspack_import_4/* .die */.F_Q(error);
|
|
16255
16617
|
}
|
|
16256
|
-
yield*
|
|
16618
|
+
yield* effect__rspack_import_9/* .succeed */.Py(flightDone, void 0);
|
|
16257
16619
|
}));
|
|
16258
|
-
return
|
|
16259
|
-
catch: (error)=>(0,
|
|
16620
|
+
return effect__rspack_import_8/* .unfold */.t8s(void 0, ()=>demand.wait.pipe(effect__rspack_import_4/* .flatMap */.qIB(()=>effect__rspack_import_4/* .tryPromise */.$mh({
|
|
16621
|
+
catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
|
|
16260
16622
|
try: ()=>reader.read()
|
|
16261
|
-
})),
|
|
16623
|
+
})), effect__rspack_import_4/* .map */.TjK((next)=>next.done ? void 0 : [
|
|
16262
16624
|
next.value,
|
|
16263
16625
|
void 0
|
|
16264
16626
|
])));
|
|
16265
16627
|
}));
|
|
16266
|
-
const decodeFlightRoot = (flight, demand, signal, flightDone)=>
|
|
16267
|
-
(0,
|
|
16268
|
-
const flightAbort = yield*
|
|
16269
|
-
const readable = (0,
|
|
16628
|
+
const decodeFlightRoot = (flight, demand, signal, flightDone)=>effect__rspack_import_4/* .gen */.JkU(function*() {
|
|
16629
|
+
(0,_707_js__rspack_import_13/* .ensureAgentFlightManifest */.n)();
|
|
16630
|
+
const flightAbort = yield* _315_js__rspack_import_5/* .scopedAbortSignal */.lQ;
|
|
16631
|
+
const readable = (0,_315_js__rspack_import_5/* .streamToReadableStream */._I)(gatedFlightStream(flight, demand, flightDone), {
|
|
16270
16632
|
signal: flightAbort,
|
|
16271
16633
|
strategy: {
|
|
16272
16634
|
highWaterMark: 1
|
|
16273
16635
|
}
|
|
16274
16636
|
});
|
|
16275
|
-
return yield*
|
|
16637
|
+
return yield* effect__rspack_import_4/* .tryPromise */.$mh({
|
|
16276
16638
|
catch: (error)=>hostError(signal, error),
|
|
16277
16639
|
try: ()=>(0,react_server_dom_rspack_client_node__rspack_import_1.createFromReadableStream)(readable, {
|
|
16278
16640
|
unstable_allowPartialStream: true
|
|
@@ -16289,11 +16651,11 @@ const progressInput = (update)=>({
|
|
|
16289
16651
|
},
|
|
16290
16652
|
type: 'progress'
|
|
16291
16653
|
});
|
|
16292
|
-
const handoffRequired = ()=>new
|
|
16654
|
+
const handoffRequired = ()=>new _302_js__rspack_import_6/* .AgentContractError */.I2('handoff-required', 'The render is complete; later work requires a new invocation handoff');
|
|
16293
16655
|
const createAgentRenderEventSession = (options)=>{
|
|
16294
16656
|
const clock = options.clock;
|
|
16295
|
-
const sequence = (0,
|
|
16296
|
-
const maxBufferedProgress = (0,
|
|
16657
|
+
const sequence = (0,_302_js__rspack_import_6/* .createAgentRenderEventSequence */.n4)(options.limits, void 0 === clock ? void 0 : ()=>clock.currentTimeMillisUnsafe());
|
|
16658
|
+
const maxBufferedProgress = (0,_302_js__rspack_import_6/* .resolveAgentRenderLimits */.i0)(options.limits).maxEvents;
|
|
16297
16659
|
let offerProgress;
|
|
16298
16660
|
let progressFailure;
|
|
16299
16661
|
const bufferedProgress = [];
|
|
@@ -16303,36 +16665,36 @@ const createAgentRenderEventSession = (options)=>{
|
|
|
16303
16665
|
if (sequence.completed) throw handoffRequired();
|
|
16304
16666
|
const input = progressInput(update);
|
|
16305
16667
|
if (void 0 === offerProgress) {
|
|
16306
|
-
if (bufferedProgress.length >= maxBufferedProgress) throw new
|
|
16668
|
+
if (bufferedProgress.length >= maxBufferedProgress) throw new _302_js__rspack_import_6/* .AgentContractError */.I2('event-count-exceeded', `Agent render event count exceeds ${String(maxBufferedProgress)}`);
|
|
16307
16669
|
bufferedProgress.push(input);
|
|
16308
16670
|
return;
|
|
16309
16671
|
}
|
|
16310
|
-
await (0,
|
|
16672
|
+
await (0,_315_js__rspack_import_5/* .runPromise */.pR)(offerProgress(input));
|
|
16311
16673
|
}
|
|
16312
16674
|
});
|
|
16313
|
-
const events =
|
|
16314
|
-
const progressInputs = yield*
|
|
16315
|
-
const flightDone = yield*
|
|
16675
|
+
const events = effect__rspack_import_8/* .unwrap */.oAg(effect__rspack_import_4/* .gen */.JkU(function*() {
|
|
16676
|
+
const progressInputs = yield* effect__rspack_import_10/* .bounded */.Mm(0);
|
|
16677
|
+
const flightDone = yield* effect__rspack_import_9/* .make */.L8();
|
|
16316
16678
|
const bindProgress = ()=>{
|
|
16317
|
-
offerProgress = (input)=>
|
|
16318
|
-
if (void 0 !== progressFailure) return
|
|
16319
|
-
if (!accepted) return
|
|
16320
|
-
return
|
|
16679
|
+
offerProgress = (input)=>effect__rspack_import_10/* .offer */.x(progressInputs, input).pipe(effect__rspack_import_4/* .flatMap */.qIB((accepted)=>{
|
|
16680
|
+
if (void 0 !== progressFailure) return effect__rspack_import_4/* .fail */.fJG(progressFailure);
|
|
16681
|
+
if (!accepted) return effect__rspack_import_4/* .fail */.fJG(handoffRequired());
|
|
16682
|
+
return effect__rspack_import_4/* ["void"] */.rIH;
|
|
16321
16683
|
}));
|
|
16322
16684
|
};
|
|
16323
|
-
const finalizeProgress = (error)=>
|
|
16685
|
+
const finalizeProgress = (error)=>effect__rspack_import_4/* .sync */.OH5(()=>{
|
|
16324
16686
|
progressFailure = error;
|
|
16325
|
-
}).pipe(
|
|
16326
|
-
const setup =
|
|
16327
|
-
const flight = yield*
|
|
16687
|
+
}).pipe(effect__rspack_import_4/* .andThen */.hgn(effect__rspack_import_10/* .shutdown */.n_(progressInputs)));
|
|
16688
|
+
const setup = effect__rspack_import_4/* .gen */.JkU(function*() {
|
|
16689
|
+
const flight = yield* effect__rspack_import_4/* .tryPromise */.$mh({
|
|
16328
16690
|
catch: (error)=>hostError(options.signal, error),
|
|
16329
16691
|
try: ()=>options.flight
|
|
16330
16692
|
});
|
|
16331
|
-
if (options.signal.aborted) return yield*
|
|
16693
|
+
if (options.signal.aborted) return yield* effect__rspack_import_4/* .fail */.fJG(abortError());
|
|
16332
16694
|
const root = yield* decodeFlightRoot(flight, options.demand, options.signal, flightDone);
|
|
16333
|
-
if (options.signal.aborted) return yield*
|
|
16334
|
-
const prepared = yield*
|
|
16335
|
-
catch: (error)=>(0,
|
|
16695
|
+
if (options.signal.aborted) return yield* effect__rspack_import_4/* .fail */.fJG(abortError());
|
|
16696
|
+
const prepared = yield* effect__rspack_import_4/* ["try"] */.SvU({
|
|
16697
|
+
catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
|
|
16336
16698
|
try: ()=>{
|
|
16337
16699
|
const ids = new Map();
|
|
16338
16700
|
const initial = snapshotTree(root, ids);
|
|
@@ -16347,23 +16709,23 @@ const createAgentRenderEventSession = (options)=>{
|
|
|
16347
16709
|
}
|
|
16348
16710
|
});
|
|
16349
16711
|
bindProgress();
|
|
16350
|
-
return
|
|
16712
|
+
return effect__rspack_import_8/* .concat */.xWs(effect__rspack_import_8/* .fromArray */.ciY([
|
|
16351
16713
|
prepared.shellInput,
|
|
16352
16714
|
...bufferedProgress
|
|
16353
|
-
]), reconcileLoopStream(root, prepared.ids, prepared.initial, options.limits, flightDone, progressInputs, sequence)).pipe(
|
|
16354
|
-
if (
|
|
16355
|
-
const error = (0,
|
|
16356
|
-
return finalizeProgress(sequence.completed && (0,
|
|
16715
|
+
]), reconcileLoopStream(root, prepared.ids, prepared.initial, options.limits, flightDone, progressInputs, sequence)).pipe(effect__rspack_import_8/* .mapEffect */.WK$((input)=>emitBoundRenderEvent(sequence, input)), effect__rspack_import_8/* .tap */.Mim((event)=>'shell' === event.type ? options.demand.markShell : effect__rspack_import_4/* ["void"] */.rIH), effect__rspack_import_8/* .takeUntil */.QKh((event)=>'complete' === event.type), effect__rspack_import_8/* .onExit */.cfM((exit)=>{
|
|
16716
|
+
if (effect__rspack_import_12/* .isSuccess */.oJ(exit)) return finalizeProgress(handoffRequired());
|
|
16717
|
+
const error = (0,_315_js__rspack_import_5/* .mapCause */.K0)(exit.cause);
|
|
16718
|
+
return finalizeProgress(sequence.completed && (0,_315_js__rspack_import_5/* .isAbortError */.zf)(error) ? handoffRequired() : error);
|
|
16357
16719
|
}));
|
|
16358
16720
|
});
|
|
16359
|
-
return yield* setup.pipe(
|
|
16721
|
+
return yield* setup.pipe(effect__rspack_import_4/* .onExit */.cfM((exit)=>effect__rspack_import_12/* .isFailure */.N6(exit) ? finalizeProgress((0,_315_js__rspack_import_5/* .mapCause */.K0)(exit.cause)) : effect__rspack_import_4/* ["void"] */.rIH));
|
|
16360
16722
|
}));
|
|
16361
16723
|
return {
|
|
16362
|
-
events: void 0 === clock ? events :
|
|
16724
|
+
events: void 0 === clock ? events : effect__rspack_import_8/* .provideService */.PfK(events, effect__rspack_import_14/* .Clock */.zD, clock),
|
|
16363
16725
|
progress
|
|
16364
16726
|
};
|
|
16365
16727
|
};
|
|
16366
|
-
const toPublicEventStream = (events, demand, signal)=>(0,
|
|
16728
|
+
const toPublicEventStream = (events, demand, signal)=>(0,_315_js__rspack_import_5/* .streamToReadableStream */._I)(effect__rspack_import_8/* .interruptWhen */.S67(events, (0,_315_js__rspack_import_5/* .abortToInterrupt */.p7)(signal)), {
|
|
16367
16729
|
closeOn: (event)=>'complete' === event.type,
|
|
16368
16730
|
onPull: demand.notePull,
|
|
16369
16731
|
onPullDelivered: demand.notePullEnd,
|
|
@@ -16381,7 +16743,7 @@ const decodeAgentFlightStream = (flight, options = {})=>{
|
|
|
16381
16743
|
signal
|
|
16382
16744
|
}).events, demand, signal);
|
|
16383
16745
|
};
|
|
16384
|
-
const dispatcher_abortError =
|
|
16746
|
+
const dispatcher_abortError = _302_js__rspack_import_6/* .agentRenderAbortError */.k2;
|
|
16385
16747
|
const abortedStream = ()=>new ReadableStream({
|
|
16386
16748
|
start (controller) {
|
|
16387
16749
|
controller.error(dispatcher_abortError());
|
|
@@ -16416,7 +16778,7 @@ const drainCompleteDocument = async (events, signal)=>{
|
|
|
16416
16778
|
}
|
|
16417
16779
|
if (void 0 !== complete) return complete;
|
|
16418
16780
|
if (signal.aborted) throw dispatcher_abortError();
|
|
16419
|
-
throw new
|
|
16781
|
+
throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', 'Flight stream ended without a complete document');
|
|
16420
16782
|
};
|
|
16421
16783
|
const createAgentRenderDispatcher = (host, options = {})=>{
|
|
16422
16784
|
const stream = (request)=>{
|
|
@@ -16427,7 +16789,7 @@ const createAgentRenderDispatcher = (host, options = {})=>{
|
|
|
16427
16789
|
demand,
|
|
16428
16790
|
get flight () {
|
|
16429
16791
|
const current = pendingFlight.current;
|
|
16430
|
-
if (void 0 === current) return Promise.reject(new
|
|
16792
|
+
if (void 0 === current) return Promise.reject(new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', 'Flight worker is not running'));
|
|
16431
16793
|
return current;
|
|
16432
16794
|
},
|
|
16433
16795
|
limits: {
|
|
@@ -16558,21 +16920,21 @@ const appendNode = (node, content, capabilities, fallback)=>{
|
|
|
16558
16920
|
default:
|
|
16559
16921
|
{
|
|
16560
16922
|
const exhaustive = node;
|
|
16561
|
-
throw new
|
|
16923
|
+
throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', `Unsupported Agent Document node: ${String(exhaustive.kind)}`);
|
|
16562
16924
|
}
|
|
16563
16925
|
}
|
|
16564
16926
|
};
|
|
16565
16927
|
const project_mcp_isJsonObject = (value)=>null !== value && 'object' == typeof value && !Array.isArray(value);
|
|
16566
16928
|
const objectStructuredContent = (value)=>{
|
|
16567
16929
|
if (void 0 === value) return;
|
|
16568
|
-
const snapshot = (0,
|
|
16930
|
+
const snapshot = (0,_302_js__rspack_import_6/* .snapshotJsonValue */.mY)(value, 'MCP structured content must be JSON-serializable');
|
|
16569
16931
|
return project_mcp_isJsonObject(snapshot) ? snapshot : void 0;
|
|
16570
16932
|
};
|
|
16571
16933
|
const resultMetadata = (document)=>{
|
|
16572
16934
|
if ('result' !== document.root.kind) return;
|
|
16573
16935
|
const metadata = document.root.metadata;
|
|
16574
16936
|
if (void 0 === metadata) return;
|
|
16575
|
-
const snapshot = (0,
|
|
16937
|
+
const snapshot = (0,_302_js__rspack_import_6/* .snapshotJsonValue */.mY)(metadata, 'MCP result _meta must be JSON-serializable');
|
|
16576
16938
|
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');
|
|
16577
16939
|
return snapshot;
|
|
16578
16940
|
};
|
|
@@ -16602,8 +16964,8 @@ const attachMcpStructuredContent = (result, value)=>{
|
|
|
16602
16964
|
structuredContent: structured
|
|
16603
16965
|
};
|
|
16604
16966
|
};
|
|
16605
|
-
const notifyProgress = (source, token, sendProgress)=>
|
|
16606
|
-
catch: (error)=>(0,
|
|
16967
|
+
const notifyProgress = (source, token, sendProgress)=>effect__rspack_import_4/* .tryPromise */.$mh({
|
|
16968
|
+
catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
|
|
16607
16969
|
try: ()=>sendProgress({
|
|
16608
16970
|
progress: source.completed,
|
|
16609
16971
|
progressToken: token,
|
|
@@ -16644,18 +17006,18 @@ const documentProgressNodes = (document)=>{
|
|
|
16644
17006
|
appendProgressNodes(document.root, nodes);
|
|
16645
17007
|
return nodes;
|
|
16646
17008
|
};
|
|
16647
|
-
const projectMcpEventStream =
|
|
17009
|
+
const projectMcpEventStream = effect__rspack_import_4/* .fnUntraced */.D9k(function*(events, options = {}) {
|
|
16648
17010
|
let lastProgress = -1 / 0;
|
|
16649
17011
|
let complete;
|
|
16650
17012
|
const token = options.progressToken;
|
|
16651
17013
|
const sendProgress = options.sendProgress;
|
|
16652
17014
|
const notify = (source)=>{
|
|
16653
|
-
if (void 0 === token || void 0 === sendProgress) return
|
|
16654
|
-
if (!(source.completed > lastProgress)) return
|
|
17015
|
+
if (void 0 === token || void 0 === sendProgress) return effect__rspack_import_4/* ["void"] */.rIH;
|
|
17016
|
+
if (!(source.completed > lastProgress)) return effect__rspack_import_4/* ["void"] */.rIH;
|
|
16655
17017
|
lastProgress = source.completed;
|
|
16656
17018
|
return notifyProgress(source, token, sendProgress);
|
|
16657
17019
|
};
|
|
16658
|
-
yield*
|
|
17020
|
+
yield* effect__rspack_import_8/* .runForEach */.o1d(events, (event)=>effect__rspack_import_4/* .gen */.JkU(function*() {
|
|
16659
17021
|
switch(event.type){
|
|
16660
17022
|
case 'progress':
|
|
16661
17023
|
yield* notify(event);
|
|
@@ -16676,7 +17038,7 @@ const projectMcpEventStream = effect__rspack_import_3/* .fnUntraced */.D9k(funct
|
|
|
16676
17038
|
}
|
|
16677
17039
|
}
|
|
16678
17040
|
}));
|
|
16679
|
-
if (void 0 === complete) return yield*
|
|
17041
|
+
if (void 0 === complete) return yield* effect__rspack_import_4/* .fail */.fJG(new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', 'MCP projector requires a complete document; the stream ended without one'));
|
|
16680
17042
|
return Object.freeze({
|
|
16681
17043
|
document: complete,
|
|
16682
17044
|
result: documentToCallToolResult(complete, options)
|
|
@@ -16759,6 +17121,53 @@ const MarkdownContent = async ({ children, components })=>{
|
|
|
16759
17121
|
});
|
|
16760
17122
|
return createElement(Agent.Markdown, null, markdown.replace(/\n+$/u, ''));
|
|
16761
17123
|
};
|
|
17124
|
+
const hookComponents = new Set(Object.values(_506_js__rspack_import_15/* .Hook */.qn));
|
|
17125
|
+
const isHookComponent = (value)=>hookComponents.has(value);
|
|
17126
|
+
const resolveHookElement = (node)=>{
|
|
17127
|
+
let element = node;
|
|
17128
|
+
while(isValidElement(element) && isHookComponent(element.type))element = element.type(element.props);
|
|
17129
|
+
return element;
|
|
17130
|
+
};
|
|
17131
|
+
const isAgentElement = (node, name)=>{
|
|
17132
|
+
const resolved = resolveHookElement(node);
|
|
17133
|
+
return isValidElement(resolved) && resolved.type === name;
|
|
17134
|
+
};
|
|
17135
|
+
const flattenText = (node)=>{
|
|
17136
|
+
if ('string' == typeof node || 'number' == typeof node) return String(node);
|
|
17137
|
+
if (Array.isArray(node)) return node.map(flattenText).join('');
|
|
17138
|
+
if (isAgentElement(node, 'agent-hook-result')) throw new Error('Hook result contains duplicate roots');
|
|
17139
|
+
throw new Error('Hook additional context may contain only string or number children');
|
|
17140
|
+
};
|
|
17141
|
+
const lowerHookResult = (node)=>{
|
|
17142
|
+
const roots = Children.toArray(node).map(resolveHookElement);
|
|
17143
|
+
if (1 !== roots.length || !isAgentElement(roots[0], 'agent-hook-result')) throw new Error('Expected exactly one agent-hook-result root');
|
|
17144
|
+
const result = roots[0];
|
|
17145
|
+
const contexts = Children.toArray(result.props.children).map(resolveHookElement).map((child)=>{
|
|
17146
|
+
if (isAgentElement(child, 'agent-hook-result')) throw new Error('Hook result contains duplicate roots');
|
|
17147
|
+
if (!isAgentElement(child, 'agent-hook-additional-context')) throw new Error('Hook result may contain only agent-hook-additional-context elements');
|
|
17148
|
+
return flattenText(child.props.children);
|
|
17149
|
+
});
|
|
17150
|
+
if (0 === contexts.length) throw new Error('Hook result requires additional context');
|
|
17151
|
+
return {
|
|
17152
|
+
hookSpecificOutput: {
|
|
17153
|
+
additionalContext: contexts.join(''),
|
|
17154
|
+
hookEventName: 'PostToolUse'
|
|
17155
|
+
}
|
|
17156
|
+
};
|
|
17157
|
+
};
|
|
17158
|
+
const createRscRequestContext = (label)=>{
|
|
17159
|
+
const storage = new AsyncLocalStorage();
|
|
17160
|
+
return Object.freeze({
|
|
17161
|
+
run (value, operation) {
|
|
17162
|
+
return storage.run(value, operation);
|
|
17163
|
+
},
|
|
17164
|
+
use () {
|
|
17165
|
+
const value = storage.getStore();
|
|
17166
|
+
if (void 0 === value) throw new Error(`${label} used outside a render request`);
|
|
17167
|
+
return value;
|
|
17168
|
+
}
|
|
17169
|
+
});
|
|
17170
|
+
};
|
|
16762
17171
|
var src_AGENT_DOCUMENT_VERSION = 1;
|
|
16763
17172
|
var src_AGENT_REQUEST_STORE_VERSION = 6;
|
|
16764
17173
|
var src_PLUGIN_STATE_DIRECTORY = "state";
|
|
@@ -17148,7 +17557,19 @@ const cliInputError = (command, input, error)=>{
|
|
|
17148
17557
|
});
|
|
17149
17558
|
return new CliInputError(issues.map(cliInputIssueLine).join('\n'), issues);
|
|
17150
17559
|
};
|
|
17151
|
-
const resolveTerminal = (hostSurface, options)=>
|
|
17560
|
+
const resolveTerminal = (hostSurface, options)=>{
|
|
17561
|
+
if (void 0 !== options.terminal) return options.terminal;
|
|
17562
|
+
if (void 0 === options.isTty) return (0,_terminal_capability_js__rspack_import_2/* .detectProcessTerminal */.JH)(hostSurface);
|
|
17563
|
+
const stdout = {
|
|
17564
|
+
columns: process.stdout.columns,
|
|
17565
|
+
fd: 1,
|
|
17566
|
+
isTTY: options.isTty(),
|
|
17567
|
+
rows: process.stdout.rows
|
|
17568
|
+
};
|
|
17569
|
+
return (0,_terminal_capability_js__rspack_import_2/* .detectProcessTerminal */.JH)(hostSurface, {
|
|
17570
|
+
stdout
|
|
17571
|
+
});
|
|
17572
|
+
};
|
|
17152
17573
|
const webCommandRow = [
|
|
17153
17574
|
'web',
|
|
17154
17575
|
"Open one of the plugin's MCP Apps in a browser."
|
|
@@ -84021,9 +84442,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
84021
84442
|
__webpack_require__.a(__webpack_module__, async function (__rspack_load_async_deps, __rspack_async_done) { try {
|
|
84022
84443
|
/* import */ var agent_bundle_launch_env_layer__rspack_import_0 = __webpack_require__("./.agent-bundle-virtual/bin-gbot-0.mjs");
|
|
84023
84444
|
/* import */ var agent_bundle_cli_entry__rspack_import_1 = __webpack_require__("./node_modules/agent-bundle/dist/cli-entry.js");
|
|
84024
|
-
/* import */ var
|
|
84025
|
-
/* import */ var
|
|
84026
|
-
/* import */ var
|
|
84445
|
+
/* import */ var _agent_bundle_runtime__rspack_import_39 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/49.js");
|
|
84446
|
+
/* import */ var _agent_bundle_runtime__rspack_import_40 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/736.js");
|
|
84447
|
+
/* import */ var _agent_bundle_runtime__rspack_import_41 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/index.js");
|
|
84027
84448
|
/* import */ var node_url__rspack_import_2 = __webpack_require__("node:url");
|
|
84028
84449
|
/* import */ var node_worker_threads__rspack_import_3 = __webpack_require__("node:worker_threads");
|
|
84029
84450
|
/* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_approvals_list_tsx__rspack_import_4 = __webpack_require__("./src/cli/approvals/list.tsx");
|
|
@@ -84057,7 +84478,10 @@ __webpack_require__.a(__webpack_module__, async function (__rspack_load_async_de
|
|
|
84057
84478
|
/* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_groups_update_tsx__rspack_import_32 = __webpack_require__("./src/cli/groups/update.tsx");
|
|
84058
84479
|
/* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_history_tsx__rspack_import_33 = __webpack_require__("./src/cli/history.tsx");
|
|
84059
84480
|
/* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_send_tsx__rspack_import_34 = __webpack_require__("./src/cli/send.tsx");
|
|
84060
|
-
/* import */ var
|
|
84481
|
+
/* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_add_tsx__rspack_import_35 = __webpack_require__("./src/cli/skills/add.tsx");
|
|
84482
|
+
/* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_list_tsx__rspack_import_36 = __webpack_require__("./src/cli/skills/list.tsx");
|
|
84483
|
+
/* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_remove_tsx__rspack_import_37 = __webpack_require__("./src/cli/skills/remove.tsx");
|
|
84484
|
+
/* import */ var _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_thread_tsx__rspack_import_38 = __webpack_require__("./src/cli/thread.tsx");
|
|
84061
84485
|
|
|
84062
84486
|
|
|
84063
84487
|
|
|
@@ -84126,8 +84550,14 @@ const route29 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_gro
|
|
|
84126
84550
|
|
|
84127
84551
|
const route30 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_send_tsx__rspack_import_34, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_send_tsx__rspack_import_34);
|
|
84128
84552
|
|
|
84129
|
-
const route31 = Object.assign({}, Reflect.get(
|
|
84130
|
-
|
|
84553
|
+
const route31 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_add_tsx__rspack_import_35, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_add_tsx__rspack_import_35);
|
|
84554
|
+
|
|
84555
|
+
const route32 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_list_tsx__rspack_import_36, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_list_tsx__rspack_import_36);
|
|
84556
|
+
|
|
84557
|
+
const route33 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_remove_tsx__rspack_import_37, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_skills_remove_tsx__rspack_import_37);
|
|
84558
|
+
|
|
84559
|
+
const route34 = Object.assign({}, Reflect.get(_home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_thread_tsx__rspack_import_38, 'default'), _home_runner_work_grok_bot_cli_grok_bot_cli_src_cli_thread_tsx__rspack_import_38);
|
|
84560
|
+
const pluginRoot = (0,_agent_bundle_runtime__rspack_import_39/* .resolvePluginRoot */.E7)({
|
|
84131
84561
|
fallback: (0,node_url__rspack_import_2.fileURLToPath)(new URL('..', import.meta.url)),
|
|
84132
84562
|
stateAnchor: 'user-data'
|
|
84133
84563
|
});
|
|
@@ -84230,8 +84660,17 @@ const routes = Object.freeze({
|
|
|
84230
84660
|
"cli:send": Object.freeze({
|
|
84231
84661
|
module: route30
|
|
84232
84662
|
}),
|
|
84233
|
-
"cli:
|
|
84663
|
+
"cli:skills/add": Object.freeze({
|
|
84234
84664
|
module: route31
|
|
84665
|
+
}),
|
|
84666
|
+
"cli:skills/list": Object.freeze({
|
|
84667
|
+
module: route32
|
|
84668
|
+
}),
|
|
84669
|
+
"cli:skills/remove": Object.freeze({
|
|
84670
|
+
module: route33
|
|
84671
|
+
}),
|
|
84672
|
+
"cli:thread": Object.freeze({
|
|
84673
|
+
module: route34
|
|
84235
84674
|
})
|
|
84236
84675
|
});
|
|
84237
84676
|
const commands = Object.freeze([
|
|
@@ -85883,6 +86322,135 @@ const commands = Object.freeze([
|
|
|
85883
86322
|
"rendered": true,
|
|
85884
86323
|
"routeId": "cli:send"
|
|
85885
86324
|
},
|
|
86325
|
+
{
|
|
86326
|
+
"aliases": [],
|
|
86327
|
+
"description": "Add a SKILL.md to the shared skill library. Every bot sees it.",
|
|
86328
|
+
"exitCode": "zero",
|
|
86329
|
+
"options": [
|
|
86330
|
+
{
|
|
86331
|
+
"description": "Agents directory for --files mode",
|
|
86332
|
+
"key": "dir",
|
|
86333
|
+
"kind": "string",
|
|
86334
|
+
"option": "dir",
|
|
86335
|
+
"repeated": false,
|
|
86336
|
+
"required": false
|
|
86337
|
+
},
|
|
86338
|
+
{
|
|
86339
|
+
"description": "Force the on-disk agents store",
|
|
86340
|
+
"key": "files",
|
|
86341
|
+
"kind": "boolean",
|
|
86342
|
+
"option": "files",
|
|
86343
|
+
"repeated": false,
|
|
86344
|
+
"required": false
|
|
86345
|
+
},
|
|
86346
|
+
{
|
|
86347
|
+
"description": "Force the live gateway",
|
|
86348
|
+
"key": "gateway",
|
|
86349
|
+
"kind": "boolean",
|
|
86350
|
+
"option": "gateway",
|
|
86351
|
+
"repeated": false,
|
|
86352
|
+
"required": false
|
|
86353
|
+
},
|
|
86354
|
+
{
|
|
86355
|
+
"description": "SKILL.md file, or a directory holding one",
|
|
86356
|
+
"key": "path",
|
|
86357
|
+
"kind": "string",
|
|
86358
|
+
"option": "path",
|
|
86359
|
+
"positional": 0,
|
|
86360
|
+
"repeated": false,
|
|
86361
|
+
"required": true
|
|
86362
|
+
}
|
|
86363
|
+
],
|
|
86364
|
+
"path": [
|
|
86365
|
+
"skills",
|
|
86366
|
+
"add"
|
|
86367
|
+
],
|
|
86368
|
+
"rendered": true,
|
|
86369
|
+
"routeId": "cli:skills/add"
|
|
86370
|
+
},
|
|
86371
|
+
{
|
|
86372
|
+
"aliases": [],
|
|
86373
|
+
"description": "List the skill library every bot in this Grok Bot shares.",
|
|
86374
|
+
"exitCode": "zero",
|
|
86375
|
+
"options": [
|
|
86376
|
+
{
|
|
86377
|
+
"description": "Agents directory for --files mode",
|
|
86378
|
+
"key": "dir",
|
|
86379
|
+
"kind": "string",
|
|
86380
|
+
"option": "dir",
|
|
86381
|
+
"repeated": false,
|
|
86382
|
+
"required": false
|
|
86383
|
+
},
|
|
86384
|
+
{
|
|
86385
|
+
"description": "Force the on-disk agents store",
|
|
86386
|
+
"key": "files",
|
|
86387
|
+
"kind": "boolean",
|
|
86388
|
+
"option": "files",
|
|
86389
|
+
"repeated": false,
|
|
86390
|
+
"required": false
|
|
86391
|
+
},
|
|
86392
|
+
{
|
|
86393
|
+
"description": "Force the live gateway",
|
|
86394
|
+
"key": "gateway",
|
|
86395
|
+
"kind": "boolean",
|
|
86396
|
+
"option": "gateway",
|
|
86397
|
+
"repeated": false,
|
|
86398
|
+
"required": false
|
|
86399
|
+
}
|
|
86400
|
+
],
|
|
86401
|
+
"path": [
|
|
86402
|
+
"skills",
|
|
86403
|
+
"list"
|
|
86404
|
+
],
|
|
86405
|
+
"rendered": true,
|
|
86406
|
+
"routeId": "cli:skills/list"
|
|
86407
|
+
},
|
|
86408
|
+
{
|
|
86409
|
+
"aliases": [],
|
|
86410
|
+
"description": "Remove a library skill by id or name. Every bot loses it.",
|
|
86411
|
+
"exitCode": "zero",
|
|
86412
|
+
"options": [
|
|
86413
|
+
{
|
|
86414
|
+
"description": "Agents directory for --files mode",
|
|
86415
|
+
"key": "dir",
|
|
86416
|
+
"kind": "string",
|
|
86417
|
+
"option": "dir",
|
|
86418
|
+
"repeated": false,
|
|
86419
|
+
"required": false
|
|
86420
|
+
},
|
|
86421
|
+
{
|
|
86422
|
+
"description": "Force the on-disk agents store",
|
|
86423
|
+
"key": "files",
|
|
86424
|
+
"kind": "boolean",
|
|
86425
|
+
"option": "files",
|
|
86426
|
+
"repeated": false,
|
|
86427
|
+
"required": false
|
|
86428
|
+
},
|
|
86429
|
+
{
|
|
86430
|
+
"description": "Force the live gateway",
|
|
86431
|
+
"key": "gateway",
|
|
86432
|
+
"kind": "boolean",
|
|
86433
|
+
"option": "gateway",
|
|
86434
|
+
"repeated": false,
|
|
86435
|
+
"required": false
|
|
86436
|
+
},
|
|
86437
|
+
{
|
|
86438
|
+
"description": "Skill id or name",
|
|
86439
|
+
"key": "skill",
|
|
86440
|
+
"kind": "string",
|
|
86441
|
+
"option": "skill",
|
|
86442
|
+
"positional": 0,
|
|
86443
|
+
"repeated": false,
|
|
86444
|
+
"required": true
|
|
86445
|
+
}
|
|
86446
|
+
],
|
|
86447
|
+
"path": [
|
|
86448
|
+
"skills",
|
|
86449
|
+
"remove"
|
|
86450
|
+
],
|
|
86451
|
+
"rendered": true,
|
|
86452
|
+
"routeId": "cli:skills/remove"
|
|
86453
|
+
},
|
|
85886
86454
|
{
|
|
85887
86455
|
"aliases": [],
|
|
85888
86456
|
"description": "Read the most recent messages in a Grok Bot bot or group thread.",
|
|
@@ -86011,27 +86579,27 @@ const execute = async (command, input, context)=>{
|
|
|
86011
86579
|
instanceId: processLifetime.instanceId,
|
|
86012
86580
|
pid: processLifetime.pid
|
|
86013
86581
|
};
|
|
86014
|
-
const result = await (0,
|
|
86582
|
+
const result = await (0,_agent_bundle_runtime__rspack_import_40/* .runAgentRequest */.iC)({
|
|
86015
86583
|
capabilities: {
|
|
86016
|
-
command: (0,
|
|
86017
|
-
filesystem: (0,
|
|
86018
|
-
network: (0,
|
|
86019
|
-
projectRoot: (0,
|
|
86584
|
+
command: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)(),
|
|
86585
|
+
filesystem: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)(),
|
|
86586
|
+
network: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)(),
|
|
86587
|
+
projectRoot: (0,_agent_bundle_runtime__rspack_import_40/* .available */.qC)({
|
|
86020
86588
|
root: cwd
|
|
86021
86589
|
}, 'derived')
|
|
86022
86590
|
},
|
|
86023
|
-
host: (0,
|
|
86591
|
+
host: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)('unsupported-surface'),
|
|
86024
86592
|
invocation: {
|
|
86025
86593
|
kind: 'cli',
|
|
86026
86594
|
operationId: command.routeId,
|
|
86027
86595
|
surface: command.path.join(' ')
|
|
86028
86596
|
},
|
|
86029
|
-
lineage: (0,
|
|
86597
|
+
lineage: (0,_agent_bundle_runtime__rspack_import_40/* .unavailable */.hU)('unsupported-surface'),
|
|
86030
86598
|
plugin: pluginRoot.identity,
|
|
86031
86599
|
process: processHit,
|
|
86032
86600
|
signal: context.signal,
|
|
86033
|
-
terminal: (0,
|
|
86034
|
-
workspace: (0,
|
|
86601
|
+
terminal: (0,_agent_bundle_runtime__rspack_import_40/* .available */.qC)(context.terminal, 'native'),
|
|
86602
|
+
workspace: (0,_agent_bundle_runtime__rspack_import_40/* .available */.qC)({
|
|
86035
86603
|
root: cwd
|
|
86036
86604
|
}, 'derived')
|
|
86037
86605
|
}, async ()=>route.module.default({
|
|
@@ -86138,7 +86706,7 @@ const openRenderedSession = ({ invocation, limits, props, request, routeId, sign
|
|
|
86138
86706
|
return stream;
|
|
86139
86707
|
}
|
|
86140
86708
|
});
|
|
86141
|
-
const dispatcher = (0,
|
|
86709
|
+
const dispatcher = (0,_agent_bundle_runtime__rspack_import_41/* .createAgentRenderDispatcher */.jK)(host);
|
|
86142
86710
|
return Object.freeze({
|
|
86143
86711
|
close: async ()=>{
|
|
86144
86712
|
await worker.terminate();
|
|
@@ -86186,7 +86754,7 @@ if (import.meta.main) {
|
|
|
86186
86754
|
execute,
|
|
86187
86755
|
name: "gbot",
|
|
86188
86756
|
render,
|
|
86189
|
-
version: "0.
|
|
86757
|
+
version: "0.9.0"
|
|
86190
86758
|
});
|
|
86191
86759
|
}
|
|
86192
86760
|
|
|
@@ -88460,7 +89028,10 @@ async function openBackend(opts) {
|
|
|
88460
89028
|
removeGroupMember: (group, bot)=>_gateway_js__rspack_import_1/* .removeGroupMember */.A0(session, group, bot),
|
|
88461
89029
|
send: (ref, prompt, extra)=>_gateway_js__rspack_import_1/* .sendPrompt */.LV(session, ref, prompt, extra),
|
|
88462
89030
|
transcript: (ref, limit)=>_gateway_js__rspack_import_1/* .getTranscriptTail */.bA(session, ref, limit),
|
|
88463
|
-
thread: (ref, rootId)=>_gateway_js__rspack_import_1/* .getThread */.fG(session, ref, rootId)
|
|
89031
|
+
thread: (ref, rootId)=>_gateway_js__rspack_import_1/* .getThread */.fG(session, ref, rootId),
|
|
89032
|
+
skills: ()=>_gateway_js__rspack_import_1/* .listSkills */.bG(session),
|
|
89033
|
+
addSkill: (markdown)=>_gateway_js__rspack_import_1/* .addSkill */.L5(session, markdown),
|
|
89034
|
+
removeSkill: (skillRef)=>_gateway_js__rspack_import_1/* .removeSkill */.uX(session, skillRef)
|
|
88464
89035
|
};
|
|
88465
89036
|
}
|
|
88466
89037
|
const root = _store_js__rspack_import_0/* .resolveAgentsRoot */.v1(opts.root);
|
|
@@ -88484,6 +89055,15 @@ async function openBackend(opts) {
|
|
|
88484
89055
|
},
|
|
88485
89056
|
thread: async ()=>{
|
|
88486
89057
|
throw new _store_js__rspack_import_0/* .StoreError */.AD("thread requires the live gateway");
|
|
89058
|
+
},
|
|
89059
|
+
skills: async ()=>{
|
|
89060
|
+
throw new _store_js__rspack_import_0/* .StoreError */.AD("skills requires the live gateway");
|
|
89061
|
+
},
|
|
89062
|
+
addSkill: async ()=>{
|
|
89063
|
+
throw new _store_js__rspack_import_0/* .StoreError */.AD("skills requires the live gateway");
|
|
89064
|
+
},
|
|
89065
|
+
removeSkill: async ()=>{
|
|
89066
|
+
throw new _store_js__rspack_import_0/* .StoreError */.AD("skills requires the live gateway");
|
|
88487
89067
|
}
|
|
88488
89068
|
};
|
|
88489
89069
|
}
|
|
@@ -89494,6 +90074,88 @@ async function deleteAgent(session, ref) {
|
|
|
89494
90074
|
});
|
|
89495
90075
|
return rec;
|
|
89496
90076
|
}
|
|
90077
|
+
// Grok Bot keeps one skill library per box. Every bot reads the same list, and the
|
|
90078
|
+
// workflow RPCs take any bot id only to say whose automations ride along.
|
|
90079
|
+
const SKILL_MAX_BODY_LENGTH = 100000;
|
|
90080
|
+
const SKILL_SOURCES = {
|
|
90081
|
+
workflow: "your library",
|
|
90082
|
+
managed: "team-managed",
|
|
90083
|
+
plugin: "a plugin",
|
|
90084
|
+
automation: "a scheduled automation"
|
|
90085
|
+
};
|
|
90086
|
+
function asSkill(skill) {
|
|
90087
|
+
return {
|
|
90088
|
+
id: String(skill.id),
|
|
90089
|
+
name: skill.name || "",
|
|
90090
|
+
description: skill.description || "",
|
|
90091
|
+
source: String(skill.source || "workflow"),
|
|
90092
|
+
...skill.sourceRef ? {
|
|
90093
|
+
sourceRef: String(skill.sourceRef)
|
|
90094
|
+
} : {},
|
|
90095
|
+
...skill.pluginId ? {
|
|
90096
|
+
pluginId: String(skill.pluginId)
|
|
90097
|
+
} : {}
|
|
90098
|
+
};
|
|
90099
|
+
}
|
|
90100
|
+
function asSkills(data) {
|
|
90101
|
+
const list = Array.isArray(data) ? data : Array.isArray(data?.workflows) ? data.workflows : [];
|
|
90102
|
+
return list.filter((s)=>s && s.id).map(asSkill);
|
|
90103
|
+
}
|
|
90104
|
+
async function anyBotId(session) {
|
|
90105
|
+
const bot = (await listAgents(session)).find((r)=>!r.isGroup);
|
|
90106
|
+
if (!bot) throw new GatewayError("Skills need at least one bot. Run gbot bots create first.");
|
|
90107
|
+
return bot.id;
|
|
90108
|
+
}
|
|
90109
|
+
async function listSkills(session) {
|
|
90110
|
+
return asSkills(await gatewayCall(session, "getAgentWorkflows", {
|
|
90111
|
+
id: await anyBotId(session)
|
|
90112
|
+
}));
|
|
90113
|
+
}
|
|
90114
|
+
async function addSkill(session, markdown) {
|
|
90115
|
+
const text = String(markdown);
|
|
90116
|
+
if (!text.trim()) throw new GatewayError("Skill markdown is empty.");
|
|
90117
|
+
if (text.length > SKILL_MAX_BODY_LENGTH) {
|
|
90118
|
+
throw new GatewayError(`Skill markdown is ${text.length} characters. Grok Bot truncates bodies over ${SKILL_MAX_BODY_LENGTH}; shorten it.`);
|
|
90119
|
+
}
|
|
90120
|
+
const id = await anyBotId(session);
|
|
90121
|
+
let data;
|
|
90122
|
+
try {
|
|
90123
|
+
data = await gatewayCall(session, "importAgentWorkflowText", {
|
|
90124
|
+
id,
|
|
90125
|
+
markdown: text
|
|
90126
|
+
});
|
|
90127
|
+
} catch (error) {
|
|
90128
|
+
if (error instanceof GatewayError && /response too large/.test(error.message)) {
|
|
90129
|
+
throw new GatewayError("Grok Bot echoed a skill list too large to read; the import may still have landed. Run gbot skills list.");
|
|
90130
|
+
}
|
|
90131
|
+
throw error;
|
|
90132
|
+
}
|
|
90133
|
+
const imported = data.result?.imported?.[0];
|
|
90134
|
+
if (!imported) {
|
|
90135
|
+
const reason = data.result?.skipped?.[0]?.reason || "rejected";
|
|
90136
|
+
throw new GatewayError(`Grok Bot did not import the skill (${reason}). It needs a name, a non-empty body, and library room.`);
|
|
90137
|
+
}
|
|
90138
|
+
return asSkills(data).find((s)=>s.id === String(imported.id)) ?? asSkill(imported);
|
|
90139
|
+
}
|
|
90140
|
+
async function removeSkill(session, skillRef) {
|
|
90141
|
+
const id = await anyBotId(session);
|
|
90142
|
+
const skills = asSkills(await gatewayCall(session, "getAgentWorkflows", {
|
|
90143
|
+
id
|
|
90144
|
+
}));
|
|
90145
|
+
const needle = String(skillRef).trim().toLowerCase();
|
|
90146
|
+
const matches = skills.filter((s)=>s.id.toLowerCase() === needle || s.name.toLowerCase() === needle);
|
|
90147
|
+
if (matches.length === 0) throw new GatewayError(`No skill "${skillRef}".`);
|
|
90148
|
+
if (matches.length > 1) throw new GatewayError(`Ambiguous skill name "${skillRef}". Use the id.`);
|
|
90149
|
+
if (matches[0].source !== "workflow") {
|
|
90150
|
+
const kind = SKILL_SOURCES[matches[0].source] || matches[0].source;
|
|
90151
|
+
throw new GatewayError(`"${matches[0].name}" is ${kind}, not a library skill. Manage it where it came from.`);
|
|
90152
|
+
}
|
|
90153
|
+
await gatewayCall(session, "deleteAgentWorkflow", {
|
|
90154
|
+
id,
|
|
90155
|
+
workflowId: matches[0].id
|
|
90156
|
+
});
|
|
90157
|
+
return matches[0];
|
|
90158
|
+
}
|
|
89497
90159
|
function normalizeMemberIds(records, memberRefs) {
|
|
89498
90160
|
const memberIds = new Set();
|
|
89499
90161
|
for (const ref of memberRefs){
|
|
@@ -89668,6 +90330,7 @@ async function respondGrokApproval(session, ref, input) {
|
|
|
89668
90330
|
|
|
89669
90331
|
__webpack_require__.d(__webpack_exports__, {
|
|
89670
90332
|
A0: () => (removeGroupMember),
|
|
90333
|
+
L5: () => (addSkill),
|
|
89671
90334
|
LV: () => (sendPrompt),
|
|
89672
90335
|
MI: () => (listGrokApprovals),
|
|
89673
90336
|
OR: () => (respondGrokApproval),
|
|
@@ -89676,9 +90339,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
89676
90339
|
Td: () => (setGroupMembers),
|
|
89677
90340
|
Vq: () => (connectGateway),
|
|
89678
90341
|
bA: () => (getTranscriptTail),
|
|
90342
|
+
bG: () => (listSkills),
|
|
89679
90343
|
fG: () => (getThread),
|
|
89680
90344
|
nF: () => (hasGatewayAuth),
|
|
89681
90345
|
qE: () => (resolveRef),
|
|
90346
|
+
uX: () => (removeSkill),
|
|
89682
90347
|
vc: () => (listAgents),
|
|
89683
90348
|
wj: () => (createGroup),
|
|
89684
90349
|
x4: () => (updateAgent),
|
|
@@ -90765,7 +91430,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
90765
91430
|
|
|
90766
91431
|
},
|
|
90767
91432
|
"./package.json"(module) {
|
|
90768
|
-
module.exports = {"rE":"0.
|
|
91433
|
+
module.exports = {"rE":"0.9.0"}
|
|
90769
91434
|
|
|
90770
91435
|
},
|
|
90771
91436
|
|