grok-bot-cli 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/gbot.mjs CHANGED
@@ -11126,9 +11126,9 @@ const config = {
11126
11126
  };
11127
11127
  async function route({ input }) {
11128
11128
  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 */.g.Result, {
11129
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Result */.g6.Result, {
11130
11130
  value: out,
11131
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.g.Text, {
11131
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.g6.Text, {
11132
11132
  children: JSON.stringify(out)
11133
11133
  })
11134
11134
  });
@@ -11186,9 +11186,9 @@ const config = {
11186
11186
  };
11187
11187
  async function route({ input }) {
11188
11188
  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 */.g.Result, {
11189
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Result */.g6.Result, {
11190
11190
  value: out,
11191
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.g.Text, {
11191
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.g6.Text, {
11192
11192
  children: JSON.stringify(out)
11193
11193
  })
11194
11194
  });
@@ -11260,9 +11260,9 @@ async function botsCreate({ input }) {
11260
11260
  const { dir: _d, files: _f, gateway: _g, ...fields } = input;
11261
11261
  const rec = await backend.createAgent((0,_shared_js__rspack_import_1/* .toCreateInput */.cp)(fields));
11262
11262
  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 */.g.Result, {
11263
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Result */.g6.Result, {
11264
11264
  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 */.g.Text, {
11265
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_2/* .Agent.Text */.g6.Text, {
11266
11266
  children: `Created bot ${rec.name} (${rec.id})`
11267
11267
  })
11268
11268
  });
@@ -11328,9 +11328,9 @@ const resultSchema = _shared_js__rspack_import_1/* .agentSummarySchema */.t_;
11328
11328
  async function botsDelete({ input }) {
11329
11329
  const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
11330
11330
  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 */.g.Result, {
11331
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
11332
11332
  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 */.g.Text, {
11333
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
11334
11334
  children: `Deleted ${rec.isGroup ? 'group' : 'bot'} ${rec.name} (${rec.id})`
11335
11335
  })
11336
11336
  });
@@ -11397,9 +11397,9 @@ async function botsGet({ input }) {
11397
11397
  const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
11398
11398
  const rec = await backend.resolve(input.ref);
11399
11399
  const all = await backend.list();
11400
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g.Result, {
11400
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
11401
11401
  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 */.g.Text, {
11402
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
11403
11403
  children: (0,_core_format_js__rspack_import_4/* .formatRecord */.bM)(rec, all)
11404
11404
  })
11405
11405
  });
@@ -11456,9 +11456,9 @@ async function botsList({ input }) {
11456
11456
  const rows = all.filter((r)=>!r.isGroup);
11457
11457
  const bots = rows.map(_core_format_js__rspack_import_3/* .summarize */.eh);
11458
11458
  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 */.g.Result, {
11459
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
11460
11460
  value: bots,
11461
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
11461
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
11462
11462
  children: text
11463
11463
  })
11464
11464
  });
@@ -11546,9 +11546,9 @@ async function botsUpdate({ input }) {
11546
11546
  const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
11547
11547
  const { dir: _d, files: _f, gateway: _g, ref, ...fields } = input;
11548
11548
  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 */.g.Result, {
11549
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
11550
11550
  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 */.g.Text, {
11551
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
11552
11552
  children: `Updated ${rec.isGroup ? 'group' : 'bot'} ${rec.name} (${rec.id})`
11553
11553
  })
11554
11554
  });
@@ -11632,9 +11632,9 @@ async function route({ input }) {
11632
11632
  } catch (error) {
11633
11633
  out = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
11634
11634
  }
11635
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
11635
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
11636
11636
  value: out,
11637
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
11637
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
11638
11638
  children: JSON.stringify(out)
11639
11639
  })
11640
11640
  });
@@ -11723,12 +11723,12 @@ async function route({ signal, input }) {
11723
11723
  } finally{
11724
11724
  signal.removeEventListener('abort', stop);
11725
11725
  }
11726
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g.Result, {
11726
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
11727
11727
  value: {
11728
11728
  state: 'stopped',
11729
11729
  exitCode
11730
11730
  },
11731
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g.Text, {
11731
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
11732
11732
  children: "Relay worker stopped."
11733
11733
  })
11734
11734
  });
@@ -11801,9 +11801,9 @@ async function route({ input }) {
11801
11801
  } catch (error) {
11802
11802
  out = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
11803
11803
  }
11804
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
11804
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
11805
11805
  value: out,
11806
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
11806
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
11807
11807
  children: JSON.stringify(out)
11808
11808
  })
11809
11809
  });
@@ -11857,9 +11857,9 @@ async function route({ input }) {
11857
11857
  } catch (error) {
11858
11858
  out = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
11859
11859
  }
11860
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
11860
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
11861
11861
  value: out,
11862
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
11862
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
11863
11863
  children: JSON.stringify(out)
11864
11864
  })
11865
11865
  });
@@ -11916,9 +11916,9 @@ async function route({ input }) {
11916
11916
  } catch (error) {
11917
11917
  out = (0,_core_codex_contract_js__rspack_import_2/* .outcomeFromError */.DG)(error);
11918
11918
  }
11919
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
11919
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
11920
11920
  value: out,
11921
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
11921
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
11922
11922
  children: JSON.stringify(out)
11923
11923
  })
11924
11924
  });
@@ -11994,21 +11994,21 @@ async function codexDesktopShim({ input }) {
11994
11994
  out = (0,_core_desktop_shim_js__rspack_import_1/* .installDesktopShim */.B0)();
11995
11995
  } catch (error) {
11996
11996
  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 */.g.Result, {
11997
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
11998
11998
  value: {
11999
11999
  action: 'install',
12000
12000
  error: message,
12001
12001
  exitCode: 1
12002
12002
  },
12003
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
12003
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12004
12004
  children: `Desktop shim install failed: ${message}`
12005
12005
  })
12006
12006
  });
12007
12007
  }
12008
12008
  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 */.g.Result, {
12009
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12010
12010
  value: out,
12011
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
12011
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12012
12012
  children: text
12013
12013
  })
12014
12014
  });
@@ -12020,22 +12020,22 @@ async function codexDesktopShim({ input }) {
12020
12020
  out = (0,_core_desktop_shim_js__rspack_import_1/* .uninstallDesktopShim */.gM)();
12021
12021
  } catch (error) {
12022
12022
  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 */.g.Result, {
12023
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12024
12024
  value: {
12025
12025
  action: 'uninstall',
12026
12026
  error: message,
12027
12027
  exitCode: 1
12028
12028
  },
12029
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
12029
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12030
12030
  children: `Desktop shim uninstall failed: ${message}`
12031
12031
  })
12032
12032
  });
12033
12033
  }
12034
12034
  const removed = out.removed.length === 0 ? '(nothing installed)' : out.removed.join(', ');
12035
12035
  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 */.g.Result, {
12036
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12037
12037
  value: out,
12038
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
12038
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12039
12039
  children: text
12040
12040
  })
12041
12041
  });
@@ -12043,9 +12043,9 @@ async function codexDesktopShim({ input }) {
12043
12043
  case 'status':
12044
12044
  {
12045
12045
  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 */.g.Result, {
12046
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12047
12047
  value: out,
12048
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
12048
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12049
12049
  children: (0,_core_format_js__rspack_import_4/* .formatDesktopShimStatus */.fX)(out)
12050
12050
  })
12051
12051
  });
@@ -12125,21 +12125,21 @@ async function codexListThreads({ input }) {
12125
12125
  });
12126
12126
  } catch (error) {
12127
12127
  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 */.g.Result, {
12128
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
12129
12129
  value: failure,
12130
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g.Text, {
12130
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
12131
12131
  children: failure.error
12132
12132
  })
12133
12133
  });
12134
12134
  }
12135
12135
  const more = out.nextCursor ? `\n\nmore: --cursor ${JSON.stringify((0,_core_codex_bridge_js__rspack_import_1/* .singleLine */.pF)(out.nextCursor))}` : '';
12136
12136
  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 */.g.Result, {
12137
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
12138
12138
  value: {
12139
12139
  ...out,
12140
12140
  exitCode: 0
12141
12141
  },
12142
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g.Text, {
12142
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
12143
12143
  children: text
12144
12144
  })
12145
12145
  });
@@ -12212,19 +12212,19 @@ async function codexQueue({ input }) {
12212
12212
  out = await (0,_core_codex_bridge_js__rspack_import_1/* .listCodexQueue */.Bt)(input.threadId);
12213
12213
  } catch (error) {
12214
12214
  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 */.g.Result, {
12215
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
12216
12216
  value: failure,
12217
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g.Text, {
12217
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
12218
12218
  children: failure.error
12219
12219
  })
12220
12220
  });
12221
12221
  }
12222
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g.Result, {
12222
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
12223
12223
  value: {
12224
12224
  ...out,
12225
12225
  exitCode: 0
12226
12226
  },
12227
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g.Text, {
12227
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
12228
12228
  children: (0,_core_format_js__rspack_import_6/* .formatCodexQueue */.e_)(out)
12229
12229
  })
12230
12230
  });
@@ -12355,12 +12355,12 @@ async function route({ input, signal }) {
12355
12355
  ...input,
12356
12356
  message: input.message.join(' ').trim()
12357
12357
  }, context);
12358
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g.Result, {
12358
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
12359
12359
  value: {
12360
12360
  ...out,
12361
12361
  exitCode: out.delivery === 'rejected' ? 1 : 0
12362
12362
  },
12363
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g.Text, {
12363
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
12364
12364
  children: `Delivery ${out.delivery}; terminal answer returns to Grok automatically.`
12365
12365
  })
12366
12366
  });
@@ -12372,9 +12372,9 @@ async function route({ input, signal }) {
12372
12372
  }, signal, (message)=>context.progress.report({
12373
12373
  message
12374
12374
  }), true);
12375
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g.Result, {
12375
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Result */.g6.Result, {
12376
12376
  value: out,
12377
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g.Text, {
12377
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_5/* .Agent.Text */.g6.Text, {
12378
12378
  children: (0,_core_codex_routes_js__rspack_import_1/* .resultText */.D6)(out)
12379
12379
  })
12380
12380
  });
@@ -12420,9 +12420,9 @@ const resultSchema = zod__rspack_import_2/* .object */.Ikc({
12420
12420
  }).passthrough();
12421
12421
  async function codexStatusCmd(_props) {
12422
12422
  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 */.g.Result, {
12423
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12424
12424
  value: status,
12425
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
12425
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12426
12426
  children: (0,_core_format_js__rspack_import_4/* .formatCodexStatus */.P2)(status)
12427
12427
  })
12428
12428
  });
@@ -12494,9 +12494,9 @@ async function route({ input, signal }) {
12494
12494
  const out = await (0,_core_codex_routes_js__rspack_import_1/* .observeOperation */.gT)('wait', input, signal, (message)=>context.progress.report({
12495
12495
  message
12496
12496
  }));
12497
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g.Result, {
12497
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12498
12498
  value: out,
12499
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
12499
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12500
12500
  children: (0,_core_codex_routes_js__rspack_import_1/* .resultText */.D6)(out)
12501
12501
  })
12502
12502
  });
@@ -12560,9 +12560,9 @@ async function route({ input, signal }) {
12560
12560
  const out = await (0,_core_codex_routes_js__rspack_import_1/* .observeOperation */.gT)('watch', input, signal, (message)=>context.progress.report({
12561
12561
  message
12562
12562
  }));
12563
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g.Result, {
12563
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12564
12564
  value: out,
12565
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
12565
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12566
12566
  children: (0,_core_codex_routes_js__rspack_import_1/* .resultText */.D6)(out)
12567
12567
  })
12568
12568
  });
@@ -12665,9 +12665,9 @@ async function doctor({ input }) {
12665
12665
  ...candidates.map((c)=>` ${c}`),
12666
12666
  note
12667
12667
  ].join('\n');
12668
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Result */.g.Result, {
12668
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Result */.g6.Result, {
12669
12669
  value: value,
12670
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Text */.g.Text, {
12670
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_6/* .Agent.Text */.g6.Text, {
12671
12671
  children: text
12672
12672
  })
12673
12673
  });
@@ -12738,9 +12738,9 @@ const resultSchema = _shared_js__rspack_import_1/* .agentSummarySchema */.t_;
12738
12738
  async function groupsAdd({ input }) {
12739
12739
  const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
12740
12740
  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 */.g.Result, {
12741
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12742
12742
  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 */.g.Text, {
12743
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12744
12744
  children: `Added to ${rec.name}. Members: ${rec.memberIds.length}`
12745
12745
  })
12746
12746
  });
@@ -12826,9 +12826,9 @@ async function groupsCreate({ input }) {
12826
12826
  ...(0,_shared_js__rspack_import_1/* .toCreateInput */.cp)(fields),
12827
12827
  memberIds: member
12828
12828
  });
12829
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g.Result, {
12829
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12830
12830
  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 */.g.Text, {
12831
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12832
12832
  children: `Created group ${rec.name} (${rec.id}) with ${rec.memberIds.length} members`
12833
12833
  })
12834
12834
  });
@@ -12896,9 +12896,9 @@ async function groupsDelete({ input }) {
12896
12896
  const rec = await backend.resolve(input.ref);
12897
12897
  if (!rec.isGroup) throw new Error(`"${rec.name}" is a bot, not a group. Use bots delete.`);
12898
12898
  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 */.g.Result, {
12899
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12900
12900
  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 */.g.Text, {
12901
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12902
12902
  children: `Deleted group ${deleted.name} (${deleted.id})`
12903
12903
  })
12904
12904
  });
@@ -12966,9 +12966,9 @@ async function groupsGet({ input }) {
12966
12966
  const rec = await backend.resolve(input.ref);
12967
12967
  if (!rec.isGroup) throw new Error(`"${rec.name}" is a bot, not a group.`);
12968
12968
  const all = await backend.list();
12969
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g.Result, {
12969
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
12970
12970
  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 */.g.Text, {
12971
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
12972
12972
  children: (0,_core_format_js__rspack_import_4/* .formatRecord */.bM)(rec, all)
12973
12973
  })
12974
12974
  });
@@ -13025,9 +13025,9 @@ async function groupsList({ input }) {
13025
13025
  const rows = all.filter((r)=>r.isGroup);
13026
13026
  const groups = rows.map(_core_format_js__rspack_import_3/* .summarize */.eh);
13027
13027
  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 */.g.Result, {
13028
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
13029
13029
  value: groups,
13030
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
13030
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
13031
13031
  children: text
13032
13032
  })
13033
13033
  });
@@ -13095,9 +13095,9 @@ async function groupsMembers({ input }) {
13095
13095
  const rec = await backend.resolve(input.ref);
13096
13096
  if (!rec.isGroup) throw new Error(`"${rec.name}" is a bot, not a group.`);
13097
13097
  const all = await backend.list();
13098
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g.Result, {
13098
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
13099
13099
  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 */.g.Text, {
13100
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
13101
13101
  children: (0,_core_format_js__rspack_import_4/* .formatRecord */.bM)(rec, all)
13102
13102
  })
13103
13103
  });
@@ -13168,9 +13168,9 @@ const resultSchema = _shared_js__rspack_import_1/* .agentSummarySchema */.t_;
13168
13168
  async function groupsRemove({ input }) {
13169
13169
  const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
13170
13170
  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 */.g.Result, {
13171
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
13172
13172
  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 */.g.Text, {
13173
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
13174
13174
  children: `Removed from ${rec.name}. Members: ${rec.memberIds.length}`
13175
13175
  })
13176
13176
  });
@@ -13244,9 +13244,9 @@ const resultSchema = _shared_js__rspack_import_1/* .agentSummarySchema */.t_;
13244
13244
  async function groupsSet({ input }) {
13245
13245
  const backend = await (0,_shared_js__rspack_import_1/* .openBackendFromInput */.FS)(input);
13246
13246
  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 */.g.Result, {
13247
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
13248
13248
  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 */.g.Text, {
13249
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
13250
13250
  children: `Updated ${rec.name}. Members: ${rec.memberIds.length}`
13251
13251
  })
13252
13252
  });
@@ -13336,9 +13336,9 @@ async function groupsUpdate({ input }) {
13336
13336
  if (!current.isGroup) throw new Error(`"${current.name}" is a bot, not a group. Use bots update.`);
13337
13337
  const { dir: _d, files: _f, gateway: _g, ref, ...fields } = input;
13338
13338
  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 */.g.Result, {
13339
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
13340
13340
  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 */.g.Text, {
13341
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
13342
13342
  children: `Updated group ${rec.name} (${rec.id})`
13343
13343
  })
13344
13344
  });
@@ -13414,11 +13414,11 @@ const resultSchema = zod__rspack_import_2/* .union */.KCZ([
13414
13414
  async function history({ input }) {
13415
13415
  const file = (0,_core_history_js__rspack_import_1/* .historyPath */.ae)(input.historyDir);
13416
13416
  if (input.path) {
13417
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g.Result, {
13417
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
13418
13418
  value: {
13419
13419
  path: file
13420
13420
  },
13421
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
13421
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
13422
13422
  children: file
13423
13423
  })
13424
13424
  });
@@ -13429,9 +13429,9 @@ async function history({ input }) {
13429
13429
  search: input.search
13430
13430
  });
13431
13431
  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 */.g.Result, {
13432
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Result */.g6.Result, {
13433
13433
  value: rows,
13434
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g.Text, {
13434
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_3/* .Agent.Text */.g6.Text, {
13435
13435
  children: text
13436
13436
  })
13437
13437
  });
@@ -13641,12 +13641,12 @@ async function send({ input }) {
13641
13641
  hop: input.hop,
13642
13642
  correlationId: input.correlationId
13643
13643
  }, 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 */.g.Result, {
13644
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Result */.g6.Result, {
13645
13645
  value: {
13646
13646
  ...out,
13647
13647
  exitCode: out.delivery === 'rejected' ? 1 : 0
13648
13648
  },
13649
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Text */.g.Text, {
13649
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Text */.g6.Text, {
13650
13650
  children: `Delivery ${out.delivery}; inspect codex bridge status for automatic reply delivery.`
13651
13651
  })
13652
13652
  });
@@ -13656,9 +13656,9 @@ async function send({ input }) {
13656
13656
  value = (0,_core_codex_contract_js__rspack_import_3/* .outcomeFromError */.DG)(error);
13657
13657
  }
13658
13658
  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 */.g.Result, {
13659
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Result */.g6.Result, {
13660
13660
  value: value,
13661
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Text */.g.Text, {
13661
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_8/* .Agent.Text */.g6.Text, {
13662
13662
  children: text
13663
13663
  })
13664
13664
  });
@@ -13765,9 +13765,9 @@ async function thread({ input }) {
13765
13765
  event: 'thread',
13766
13766
  rootId: input.root
13767
13767
  });
13768
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
13768
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
13769
13769
  value: rooted,
13770
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
13770
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
13771
13771
  children: (0,_core_format_js__rspack_import_5/* .formatTranscript */.oZ)(rooted, {
13772
13772
  full: input.full
13773
13773
  })
@@ -13797,9 +13797,9 @@ async function thread({ input }) {
13797
13797
  const text = (0,_core_format_js__rspack_import_5/* .formatTranscript */.oZ)(selected, {
13798
13798
  full: input.full
13799
13799
  });
13800
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
13800
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
13801
13801
  value: selected,
13802
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
13802
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
13803
13803
  children: `${text}\n\ncursor: ${delta.cursor}${delta.gapReset ? ' (gap reset)' : ''}`
13804
13804
  })
13805
13805
  });
@@ -13809,9 +13809,9 @@ async function thread({ input }) {
13809
13809
  disabled: input.noHistory,
13810
13810
  event: 'thread'
13811
13811
  });
13812
- return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g.Result, {
13812
+ return /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Result */.g6.Result, {
13813
13813
  value: out,
13814
- children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g.Text, {
13814
+ children: /*#__PURE__*/ (0,react_jsx_runtime__rspack_import_0.jsx)(_agent_bundle_runtime__rspack_import_4/* .Agent.Text */.g6.Text, {
13815
13815
  children: (0,_core_format_js__rspack_import_5/* .formatTranscript */.oZ)(out, {
13816
13816
  full: input.full
13817
13817
  })
@@ -14461,7 +14461,28 @@ module.exports = __rspack_createRequire_require("util");
14461
14461
  },
14462
14462
  "./node_modules/@agent-bundle/runtime/dist/302.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
14463
14463
  /* import */ var node_buffer__rspack_import_0 = __webpack_require__("node:buffer");
14464
+ /* import */ var react__rspack_import_1 = __webpack_require__("./node_modules/react/index.js");
14464
14465
 
14466
+
14467
+ const isServerComponent = (value)=>'function' == typeof value;
14468
+ const asMcpElement = (node)=>{
14469
+ let element = node;
14470
+ while(isValidElement(element) && isServerComponent(element.type))element = element.type(element.props);
14471
+ if (!isValidElement(element) || 'string' != typeof element.type || !element.type.startsWith('mcp-')) throw new Error('Expected an MCP result element');
14472
+ return {
14473
+ props: element.props,
14474
+ type: element.type
14475
+ };
14476
+ };
14477
+ const requiredString = (value, message)=>{
14478
+ if ('string' != typeof value || '' === value.trim()) throw new Error(message);
14479
+ return value;
14480
+ };
14481
+ const textChild = (children, message)=>{
14482
+ const values = Children.toArray(children);
14483
+ if (1 !== values.length || 'string' != typeof values[0]) throw new Error(message);
14484
+ return values[0];
14485
+ };
14465
14486
  const jsonLeafBytes = (value)=>node_buffer__rspack_import_0.Buffer.byteLength(JSON.stringify(value), 'utf8');
14466
14487
  const isArrayIndex = (key, length)=>{
14467
14488
  if ('0' === key) return length > 0;
@@ -14523,6 +14544,16 @@ const cloneJsonValue = (value, ancestors, path, depth = 0, budget)=>{
14523
14544
  ancestors.delete(value);
14524
14545
  }
14525
14546
  };
14547
+ const jsonRecord = (value, message)=>{
14548
+ try {
14549
+ if (null === value || 'object' != typeof value || Array.isArray(value)) throw new Error('not a plain object');
14550
+ return cloneJsonValue(value, new Set(), '');
14551
+ } catch (error) {
14552
+ throw new Error(`${message} (${error instanceof Error ? error.message : String(error)})`, {
14553
+ cause: error
14554
+ });
14555
+ }
14556
+ };
14526
14557
  const deepFreezeJson = (value)=>{
14527
14558
  if ('object' == typeof value && null !== value) {
14528
14559
  for (const child of Object.values(value))deepFreezeJson(child);
@@ -14540,6 +14571,89 @@ const snapshotJsonValue = (value, message, budget)=>{
14540
14571
  });
14541
14572
  }
14542
14573
  };
14574
+ const lowerContent = (node)=>{
14575
+ const element = asMcpElement(node);
14576
+ const { props } = element;
14577
+ switch(element.type){
14578
+ case 'mcp-text':
14579
+ return {
14580
+ text: textChild(props.children, 'mcp-text requires one text child'),
14581
+ type: 'text'
14582
+ };
14583
+ case 'mcp-image':
14584
+ return {
14585
+ data: requiredString(props.data, 'mcp-image requires non-empty data and mimeType'),
14586
+ mimeType: requiredString(props.mimeType, 'mcp-image requires non-empty data and mimeType'),
14587
+ type: 'image'
14588
+ };
14589
+ case 'mcp-audio':
14590
+ return {
14591
+ data: requiredString(props.data, 'mcp-audio requires non-empty data and mimeType'),
14592
+ mimeType: requiredString(props.mimeType, 'mcp-audio requires non-empty data and mimeType'),
14593
+ type: 'audio'
14594
+ };
14595
+ case 'mcp-resource-link':
14596
+ {
14597
+ const mimeType = props.mimeType;
14598
+ if (void 0 !== mimeType && 'string' != typeof mimeType) throw new Error('mcp-resource-link mimeType must be a string');
14599
+ return {
14600
+ ...void 0 === mimeType ? {} : {
14601
+ mimeType
14602
+ },
14603
+ name: requiredString(props.name, 'mcp-resource-link requires non-empty uri and name'),
14604
+ type: 'resource_link',
14605
+ uri: requiredString(props.uri, 'mcp-resource-link requires non-empty uri and name')
14606
+ };
14607
+ }
14608
+ case 'mcp-embedded-resource':
14609
+ {
14610
+ const hasText = void 0 !== props.text;
14611
+ const hasTextChild = void 0 !== props.children;
14612
+ const hasBlob = void 0 !== props.blob;
14613
+ if (Number(hasText) + Number(hasTextChild) + Number(hasBlob) !== 1) throw new Error('mcp-embedded-resource accepts exactly one text or blob value');
14614
+ const mimeType = props.mimeType;
14615
+ if (void 0 !== mimeType && 'string' != typeof mimeType) throw new Error('mcp-embedded-resource mimeType must be a string');
14616
+ const resource = {
14617
+ ...void 0 === mimeType ? {} : {
14618
+ mimeType
14619
+ },
14620
+ uri: requiredString(props.uri, 'mcp-embedded-resource requires a non-empty uri'),
14621
+ ...hasBlob ? {
14622
+ blob: requiredString(props.blob, 'mcp-embedded-resource blob must be non-empty')
14623
+ } : {
14624
+ text: hasTextChild ? textChild(props.children, 'mcp-embedded-resource requires one text child') : requiredString(props.text, 'mcp-embedded-resource text must be non-empty')
14625
+ }
14626
+ };
14627
+ return {
14628
+ resource,
14629
+ type: 'resource'
14630
+ };
14631
+ }
14632
+ case 'mcp-result':
14633
+ throw new Error('mcp-result may not be nested');
14634
+ default:
14635
+ throw new Error(`Unsupported MCP result element: ${element.type}`);
14636
+ }
14637
+ };
14638
+ const lowerMcpResult = (node)=>{
14639
+ const root = asMcpElement(node);
14640
+ if ('mcp-result' !== root.type) throw new Error('Expected mcp-result as the root element');
14641
+ if (void 0 !== root.props.isError && 'boolean' != typeof root.props.isError) throw new Error('mcp-result isError must be a boolean');
14642
+ const structuredContent = root.props.structuredContent;
14643
+ const metadata = root.props._meta;
14644
+ return {
14645
+ content: Children.toArray(root.props.children).map(lowerContent),
14646
+ ...void 0 === metadata ? {} : {
14647
+ _meta: jsonRecord(metadata, 'mcp-result _meta must be JSON-serializable')
14648
+ },
14649
+ ...void 0 === structuredContent ? {} : {
14650
+ structuredContent: jsonRecord(structuredContent, 'mcp-result structuredContent must be JSON-serializable')
14651
+ },
14652
+ ...void 0 === root.props.isError ? {} : {
14653
+ isError: root.props.isError
14654
+ }
14655
+ };
14656
+ };
14543
14657
  const AGENT_DOCUMENT_VERSION = 1;
14544
14658
  const agentRenderAbortError = ()=>new DOMException('Agent render was aborted', 'AbortError');
14545
14659
  const DEFAULT_AGENT_RENDER_LIMITS = Object.freeze({
@@ -14567,7 +14681,7 @@ const resolveAgentRenderLimits = (overrides = {})=>{
14567
14681
  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
14682
  return Object.freeze(limits);
14569
14683
  };
14570
- const requiredString = (value, field)=>{
14684
+ const agent_document_requiredString = (value, field)=>{
14571
14685
  if ('string' != typeof value || '' === value.trim()) throw new AgentContractError('invalid-document', `${field} must be a non-empty string`);
14572
14686
  return value;
14573
14687
  };
@@ -14575,7 +14689,7 @@ const agent_document_text = (value, field)=>{
14575
14689
  if ('string' != typeof value) throw new AgentContractError('invalid-document', `${field} must be a string`);
14576
14690
  return value;
14577
14691
  };
14578
- const optionalString = (value, field)=>void 0 === value ? void 0 : requiredString(value, field);
14692
+ const optionalString = (value, field)=>void 0 === value ? void 0 : agent_document_requiredString(value, field);
14579
14693
  const elapsedTimeExceeded = (maxElapsedMs)=>new AgentContractError('elapsed-time-exceeded', `Agent render elapsed time exceeds ${String(maxElapsedMs)}ms`);
14580
14694
  const expectDocumentDepth = (depth, limits)=>{
14581
14695
  if (depth > limits.maxDocumentDepth) throw new AgentContractError('document-depth-exceeded', `Agent Document depth exceeds ${String(limits.maxDocumentDepth)}`);
@@ -14673,15 +14787,15 @@ const snapshotNode = (node, depth, state)=>{
14673
14787
  }
14674
14788
  case 'image':
14675
14789
  return Object.freeze({
14676
- data: requiredString(node.data, 'Agent image data'),
14790
+ data: agent_document_requiredString(node.data, 'Agent image data'),
14677
14791
  kind: 'image',
14678
- mimeType: requiredString(node.mimeType, 'Agent image mimeType')
14792
+ mimeType: agent_document_requiredString(node.mimeType, 'Agent image mimeType')
14679
14793
  });
14680
14794
  case 'audio':
14681
14795
  return Object.freeze({
14682
- data: requiredString(node.data, 'Agent audio data'),
14796
+ data: agent_document_requiredString(node.data, 'Agent audio data'),
14683
14797
  kind: 'audio',
14684
- mimeType: requiredString(node.mimeType, 'Agent audio mimeType')
14798
+ mimeType: agent_document_requiredString(node.mimeType, 'Agent audio mimeType')
14685
14799
  });
14686
14800
  case 'resource':
14687
14801
  {
@@ -14691,13 +14805,13 @@ const snapshotNode = (node, depth, state)=>{
14691
14805
  ...void 0 === mimeType ? {} : {
14692
14806
  mimeType
14693
14807
  },
14694
- name: requiredString(node.name, 'Agent resource name'),
14695
- uri: requiredString(node.uri, 'Agent resource uri')
14808
+ name: agent_document_requiredString(node.name, 'Agent resource name'),
14809
+ uri: agent_document_requiredString(node.uri, 'Agent resource uri')
14696
14810
  });
14697
14811
  }
14698
14812
  case 'error':
14699
14813
  return Object.freeze({
14700
- code: requiredString(node.code, 'Agent error code'),
14814
+ code: agent_document_requiredString(node.code, 'Agent error code'),
14701
14815
  kind: 'error',
14702
14816
  message: agent_document_text(node.message, 'Agent error message')
14703
14817
  });
@@ -14755,7 +14869,7 @@ const snapshotRenderError = (error, limits)=>{
14755
14869
  nodes: 0
14756
14870
  });
14757
14871
  return Object.freeze({
14758
- code: requiredString(error.code, 'Agent render error code'),
14872
+ code: agent_document_requiredString(error.code, 'Agent render error code'),
14759
14873
  ...void 0 === data ? {} : {
14760
14874
  data
14761
14875
  },
@@ -14790,7 +14904,7 @@ const snapshotEvent = (input, sequence, limits)=>{
14790
14904
  }
14791
14905
  case 'replace':
14792
14906
  return Object.freeze({
14793
- boundaryId: requiredString(input.boundaryId, 'Agent render boundaryId'),
14907
+ boundaryId: agent_document_requiredString(input.boundaryId, 'Agent render boundaryId'),
14794
14908
  document: createAgentDocument(input.document, limits),
14795
14909
  sequence,
14796
14910
  type: 'replace'
@@ -15358,11 +15472,51 @@ const Agent = Object.freeze({
15358
15472
  Result: AgentResult,
15359
15473
  Text: AgentText
15360
15474
  });
15475
+ const Result = ({ children })=>(0,react__rspack_import_0.createElement)('agent-hook-result', null, children);
15476
+ const AdditionalContext = ({ children })=>(0,react__rspack_import_0.createElement)('agent-hook-additional-context', null, children);
15477
+ const Hook = {
15478
+ AdditionalContext: AdditionalContext,
15479
+ Result: Result
15480
+ };
15481
+ const McpResult = ({ _meta, children, isError, structuredContent })=>createElement('mcp-result', {
15482
+ _meta,
15483
+ isError,
15484
+ structuredContent
15485
+ }, children);
15486
+ const McpText = ({ children })=>createElement('mcp-text', null, children);
15487
+ const McpImage = ({ data, mimeType })=>createElement('mcp-image', {
15488
+ data,
15489
+ mimeType
15490
+ });
15491
+ const McpAudio = ({ data, mimeType })=>createElement('mcp-audio', {
15492
+ data,
15493
+ mimeType
15494
+ });
15495
+ const McpResourceLink = ({ mimeType, name, uri })=>createElement('mcp-resource-link', {
15496
+ mimeType,
15497
+ name,
15498
+ uri
15499
+ });
15500
+ const McpEmbeddedResource = ({ blob, children, mimeType, text, uri })=>createElement('mcp-embedded-resource', {
15501
+ blob,
15502
+ mimeType,
15503
+ text,
15504
+ uri
15505
+ }, children);
15506
+ const Mcp = (/* unused pure expression or super */ null && ({
15507
+ Audio: McpAudio,
15508
+ EmbeddedResource: McpEmbeddedResource,
15509
+ Image: McpImage,
15510
+ ResourceLink: McpResourceLink,
15511
+ Result: McpResult,
15512
+ Text: McpText
15513
+ }));
15361
15514
 
15362
15515
 
15363
15516
  __webpack_require__.d(__webpack_exports__, {
15364
15517
  }, {
15365
- g: Agent
15518
+ g6: Agent,
15519
+ qn: Hook
15366
15520
  });
15367
15521
 
15368
15522
 
@@ -15679,20 +15833,23 @@ __webpack_require__.d(__webpack_exports__, {
15679
15833
 
15680
15834
  },
15681
15835
  "./node_modules/@agent-bundle/runtime/dist/index.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
15682
- /* import */ var effect__rspack_import_2 = __webpack_require__("./node_modules/effect/dist/Latch.js");
15683
- /* import */ var effect__rspack_import_3 = __webpack_require__("./node_modules/effect/dist/Effect.js");
15684
- /* import */ var effect__rspack_import_6 = __webpack_require__("./node_modules/effect/dist/Duration.js");
15685
- /* import */ var effect__rspack_import_7 = __webpack_require__("./node_modules/effect/dist/Stream.js");
15686
- /* import */ var effect__rspack_import_8 = __webpack_require__("./node_modules/effect/dist/Deferred.js");
15687
- /* import */ var effect__rspack_import_9 = __webpack_require__("./node_modules/effect/dist/Queue.js");
15688
- /* import */ var effect__rspack_import_10 = __webpack_require__("./node_modules/effect/dist/Option.js");
15689
- /* import */ var effect__rspack_import_11 = __webpack_require__("./node_modules/effect/dist/Exit.js");
15690
- /* import */ var effect__rspack_import_13 = __webpack_require__("./node_modules/effect/dist/Clock.js");
15836
+ /* import */ var effect__rspack_import_3 = __webpack_require__("./node_modules/effect/dist/Latch.js");
15837
+ /* import */ var effect__rspack_import_4 = __webpack_require__("./node_modules/effect/dist/Effect.js");
15838
+ /* import */ var effect__rspack_import_7 = __webpack_require__("./node_modules/effect/dist/Duration.js");
15839
+ /* import */ var effect__rspack_import_8 = __webpack_require__("./node_modules/effect/dist/Stream.js");
15840
+ /* import */ var effect__rspack_import_9 = __webpack_require__("./node_modules/effect/dist/Deferred.js");
15841
+ /* import */ var effect__rspack_import_10 = __webpack_require__("./node_modules/effect/dist/Queue.js");
15842
+ /* import */ var effect__rspack_import_11 = __webpack_require__("./node_modules/effect/dist/Option.js");
15843
+ /* import */ var effect__rspack_import_12 = __webpack_require__("./node_modules/effect/dist/Exit.js");
15844
+ /* import */ var effect__rspack_import_14 = __webpack_require__("./node_modules/effect/dist/Clock.js");
15691
15845
  /* import */ var react__rspack_import_0 = __webpack_require__("./node_modules/react/index.js");
15692
15846
  /* 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 _315_js__rspack_import_4 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/315.js");
15694
- /* import */ var _302_js__rspack_import_5 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/302.js");
15695
- /* import */ var _707_js__rspack_import_12 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/707.js");
15847
+ /* import */ var node_async_hooks__rspack_import_2 = __webpack_require__("node:async_hooks");
15848
+ /* import */ var _315_js__rspack_import_5 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/315.js");
15849
+ /* import */ var _302_js__rspack_import_6 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/302.js");
15850
+ /* import */ var _707_js__rspack_import_13 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/707.js");
15851
+ /* import */ var _506_js__rspack_import_15 = __webpack_require__("./node_modules/@agent-bundle/runtime/dist/506.js");
15852
+
15696
15853
 
15697
15854
 
15698
15855
 
@@ -15703,10 +15860,10 @@ __webpack_require__.d(__webpack_exports__, {
15703
15860
 
15704
15861
 
15705
15862
  const createFlightDemand = ()=>{
15706
- const pulling = effect__rspack_import_2/* .makeUnsafe */.LZ(false);
15863
+ const pulling = effect__rspack_import_3/* .makeUnsafe */.LZ(false);
15707
15864
  let shellEmitted = false;
15708
15865
  return {
15709
- markShell: effect__rspack_import_3/* .sync */.OH5(()=>{
15866
+ markShell: effect__rspack_import_4/* .sync */.OH5(()=>{
15710
15867
  shellEmitted = true;
15711
15868
  }),
15712
15869
  notePull () {
@@ -15715,11 +15872,11 @@ const createFlightDemand = ()=>{
15715
15872
  notePullEnd () {
15716
15873
  pulling.closeUnsafe();
15717
15874
  },
15718
- wait: effect__rspack_import_3/* .suspend */.DYE(()=>shellEmitted ? pulling.await : effect__rspack_import_3/* ["void"] */.rIH)
15875
+ wait: effect__rspack_import_4/* .suspend */.DYE(()=>shellEmitted ? pulling.await : effect__rspack_import_4/* ["void"] */.rIH)
15719
15876
  };
15720
15877
  };
15721
- const emitBoundRenderEvent = (sequence, input)=>effect__rspack_import_3/* ["try"] */.SvU({
15722
- catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
15878
+ const emitBoundRenderEvent = (sequence, input)=>effect__rspack_import_4/* ["try"] */.SvU({
15879
+ catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
15723
15880
  try: ()=>sequence.emit(input)
15724
15881
  });
15725
15882
  const agentElementTypes = Object.freeze([
@@ -15736,7 +15893,7 @@ const agentElementTypes = Object.freeze([
15736
15893
  ]);
15737
15894
  const isAgentElementType = (value)=>agentElementTypes.includes(value);
15738
15895
  const protocolElement = (node)=>{
15739
- if (!(0,react__rspack_import_0.isValidElement)(node) || 'string' != typeof node.type || !isAgentElementType(node.type)) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight output must contain only Agent protocol elements; function components and HTML are unsupported');
15896
+ 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
15897
  return {
15741
15898
  props: node.props,
15742
15899
  type: node.type
@@ -15744,31 +15901,31 @@ const protocolElement = (node)=>{
15744
15901
  };
15745
15902
  const textChild = (children, type)=>{
15746
15903
  const values = react__rspack_import_0.Children.toArray(children);
15747
- if (1 !== values.length || 'string' != typeof values[0]) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', `${type} requires exactly one string child`);
15904
+ 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
15905
  return values[0];
15749
15906
  };
15750
15907
  const decodeBudget = (state)=>({
15751
15908
  addBytes (n) {
15752
15909
  state.bytes += n;
15753
- if (state.bytes > state.limits.maxDocumentBytes) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('document-bytes-exceeded', `Agent Document bytes exceed ${String(state.limits.maxDocumentBytes)}`);
15910
+ 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
15911
  },
15755
15912
  addNode () {
15756
- (0,_302_js__rspack_import_5/* .admitDocumentNode */.Dy)(state);
15913
+ (0,_302_js__rspack_import_6/* .admitDocumentNode */.Dy)(state);
15757
15914
  },
15758
15915
  checkDepth (depth) {
15759
- (0,_302_js__rspack_import_5/* .expectDocumentDepth */.MI)(depth, state.limits);
15916
+ (0,_302_js__rspack_import_6/* .expectDocumentDepth */.MI)(depth, state.limits);
15760
15917
  }
15761
15918
  });
15762
15919
  const isJsonObject = (value)=>null != value && 'object' == typeof value && !Array.isArray(value);
15763
15920
  const budgetedJson = (value, message, depth, state)=>{
15764
15921
  try {
15765
- return (0,_302_js__rspack_import_5/* .snapshotJsonValue */.mY)(value, message, {
15922
+ return (0,_302_js__rspack_import_6/* .snapshotJsonValue */.mY)(value, message, {
15766
15923
  depth,
15767
15924
  limits: decodeBudget(state)
15768
15925
  });
15769
15926
  } catch (error) {
15770
- if (error instanceof _302_js__rspack_import_5/* .AgentContractError */.I2) throw error;
15771
- throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', error instanceof Error ? error.message : message, {
15927
+ if (error instanceof _302_js__rspack_import_6/* .AgentContractError */.I2) throw error;
15928
+ throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', error instanceof Error ? error.message : message, {
15772
15929
  cause: error
15773
15930
  });
15774
15931
  }
@@ -15827,8 +15984,8 @@ const decodeResult = (props, depth, state)=>{
15827
15984
  return node;
15828
15985
  };
15829
15986
  const decodeNode = (node, depth, state)=>{
15830
- (0,_302_js__rspack_import_5/* .expectDocumentDepth */.MI)(depth, state.limits);
15831
- (0,_302_js__rspack_import_5/* .admitDocumentNode */.Dy)(state);
15987
+ (0,_302_js__rspack_import_6/* .expectDocumentDepth */.MI)(depth, state.limits);
15988
+ (0,_302_js__rspack_import_6/* .admitDocumentNode */.Dy)(state);
15832
15989
  const element = protocolElement(node);
15833
15990
  const { props } = element;
15834
15991
  switch(element.type){
@@ -15896,14 +16053,14 @@ const decodeNode = (node, depth, state)=>{
15896
16053
  default:
15897
16054
  {
15898
16055
  const exhaustive = element.type;
15899
- throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', `Unsupported Agent protocol element: ${String(exhaustive)}`);
16056
+ throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', `Unsupported Agent protocol element: ${String(exhaustive)}`);
15900
16057
  }
15901
16058
  }
15902
16059
  };
15903
16060
  const decodeAgentDocument = (node, limits = {})=>{
15904
- const resolved = (0,_302_js__rspack_import_5/* .resolveAgentRenderLimits */.i0)(limits);
16061
+ const resolved = (0,_302_js__rspack_import_6/* .resolveAgentRenderLimits */.i0)(limits);
15905
16062
  const root = protocolElement(node);
15906
- if ('agent-result' !== root.type) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight output must have Agent.Result as its root');
16063
+ 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
16064
  const state = {
15908
16065
  bytes: 0,
15909
16066
  discardedBytes: 0,
@@ -15914,7 +16071,7 @@ const decodeAgentDocument = (node, limits = {})=>{
15914
16071
  };
15915
16072
  const documentRoot = decodeNode(node, 1, state);
15916
16073
  const value = state.resultValues.get(documentRoot)?.value;
15917
- const document = (0,_302_js__rspack_import_5/* .createAgentDocument */.ZX)({
16074
+ const document = (0,_302_js__rspack_import_6/* .createAgentDocument */.ZX)({
15918
16075
  root: documentRoot,
15919
16076
  status: state.representedError ? 'represented-error' : 'success',
15920
16077
  ...void 0 === value ? {} : {
@@ -15922,13 +16079,13 @@ const decodeAgentDocument = (node, limits = {})=>{
15922
16079
  },
15923
16080
  version: 1
15924
16081
  }, resolved);
15925
- if (state.discardedBytes > 0 && state.discardedBytes + jsonBytes(document) > resolved.maxDocumentBytes) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('document-bytes-exceeded', `Agent Document bytes exceed ${String(resolved.maxDocumentBytes)}`);
16082
+ 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
16083
  return document;
15927
16084
  };
15928
16085
  const REACT_FRAGMENT = Symbol.for('react.fragment');
15929
16086
  const REACT_LAZY = Symbol.for('react.lazy');
15930
16087
  const REACT_SUSPENSE = Symbol.for('react.suspense');
15931
- const abortError = _302_js__rspack_import_5/* .agentRenderAbortError */.k2;
16088
+ const abortError = _302_js__rspack_import_6/* .agentRenderAbortError */.k2;
15932
16089
  const isObject = (value)=>'object' == typeof value && null !== value;
15933
16090
  const isThenable = (value)=>isObject(value) && 'function' == typeof value.then;
15934
16091
  const isLazyElement = (value)=>isObject(value) && value.$$typeof === REACT_LAZY && isThenable(value._payload);
@@ -15959,7 +16116,7 @@ const classifyNode = (node)=>{
15959
16116
  kind: 'thenable',
15960
16117
  value: node
15961
16118
  };
15962
- if (!(0,react__rspack_import_0.isValidElement)(node)) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight output contained an unsupported node');
16119
+ 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
16120
  const type = node.type;
15964
16121
  if (type === REACT_SUSPENSE) return {
15965
16122
  kind: 'suspense',
@@ -15973,7 +16130,7 @@ const classifyNode = (node)=>{
15973
16130
  kind: 'protocol',
15974
16131
  value: node
15975
16132
  };
15976
- throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', "Flight output must contain only Agent protocol elements; function components and HTML are unsupported");
16133
+ 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
16134
  };
15978
16135
  const thenableStatus = (thenable)=>{
15979
16136
  switch(thenable.status){
@@ -16148,8 +16305,8 @@ const snapshotTree = (root, ids)=>{
16148
16305
  tree: materializeNode(root, '', ctx)
16149
16306
  };
16150
16307
  };
16151
- const hostError = (signal, error)=>signal.aborted || (0,_315_js__rspack_import_4/* .isAbortError */.zf)(error) ? abortError() : (0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error);
16152
- const waitSettledBoundary = (pending)=>effect__rspack_import_3/* .raceAll */.Vdx(pending.map((boundary)=>effect__rspack_import_3/* .promise */.ivC(()=>Promise.resolve(boundary.thenable).then(()=>({
16308
+ 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);
16309
+ const waitSettledBoundary = (pending)=>effect__rspack_import_4/* .raceAll */.Vdx(pending.map((boundary)=>effect__rspack_import_4/* .promise */.ivC(()=>Promise.resolve(boundary.thenable).then(()=>({
16153
16310
  boundary,
16154
16311
  ok: true
16155
16312
  }), (error)=>({
@@ -16159,8 +16316,8 @@ const waitSettledBoundary = (pending)=>effect__rspack_import_3/* .raceAll */.Vdx
16159
16316
  })))));
16160
16317
  const waitOrDeadline = (wait, sequence)=>{
16161
16318
  const remaining = sequence.remainingMs;
16162
- if (remaining <= 0) return effect__rspack_import_3/* .fail */.fJG((0,_302_js__rspack_import_5/* .elapsedTimeExceeded */.zm)(sequence.maxElapsedMs));
16163
- return effect__rspack_import_3/* .raceFirst */.KT6(wait, effect__rspack_import_3/* .sleep */.yy4(effect__rspack_import_6/* .millis */.ne(remaining)).pipe(effect__rspack_import_3/* .flatMap */.qIB(()=>effect__rspack_import_3/* .fail */.fJG((0,_302_js__rspack_import_5/* .elapsedTimeExceeded */.zm)(sequence.maxElapsedMs)))));
16319
+ if (remaining <= 0) return effect__rspack_import_4/* .fail */.fJG((0,_302_js__rspack_import_6/* .elapsedTimeExceeded */.zm)(sequence.maxElapsedMs));
16320
+ 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
16321
  };
16165
16322
  const settledBoundaryInputs = (previous, next, winner, limits)=>{
16166
16323
  const stillPending = new Set(next.pending.map((boundary)=>boundary.id));
@@ -16193,9 +16350,9 @@ const settledBoundaryInputs = (previous, next, winner, limits)=>{
16193
16350
  for (const boundary of previous.pending)if (boundary.id !== winner.boundary.id) emitFor(boundary.id);
16194
16351
  return inputs;
16195
16352
  };
16196
- const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInputs, sequence)=>effect__rspack_import_7/* .paginate */.EnV(initial, (snapshot)=>{
16197
- if (0 === snapshot.pending.length) return waitOrDeadline(effect__rspack_import_8/* ["await"] */.Tx(flightDone), sequence).pipe(effect__rspack_import_3/* .andThen */.hgn(effect__rspack_import_9/* .clear */.IU(progressInputs)), effect__rspack_import_3/* .flatMap */.qIB((queued)=>effect__rspack_import_3/* ["try"] */.SvU({
16198
- catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
16353
+ const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInputs, sequence)=>effect__rspack_import_8/* .paginate */.EnV(initial, (snapshot)=>{
16354
+ 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({
16355
+ catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
16199
16356
  try: ()=>[
16200
16357
  [
16201
16358
  ...queued,
@@ -16204,32 +16361,32 @@ const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInp
16204
16361
  type: 'complete'
16205
16362
  }
16206
16363
  ],
16207
- effect__rspack_import_10.none()
16364
+ effect__rspack_import_11.none()
16208
16365
  ]
16209
16366
  })));
16210
- return effect__rspack_import_3/* .raceFirst */.KT6(waitOrDeadline(waitSettledBoundary(snapshot.pending), sequence).pipe(effect__rspack_import_3/* .map */.TjK((winner)=>({
16367
+ return effect__rspack_import_4/* .raceFirst */.KT6(waitOrDeadline(waitSettledBoundary(snapshot.pending), sequence).pipe(effect__rspack_import_4/* .map */.TjK((winner)=>({
16211
16368
  kind: 'boundary',
16212
16369
  winner
16213
- }))), effect__rspack_import_9/* .take */.s(progressInputs).pipe(effect__rspack_import_3/* .map */.TjK((input)=>({
16370
+ }))), effect__rspack_import_10/* .take */.s(progressInputs).pipe(effect__rspack_import_4/* .map */.TjK((input)=>({
16214
16371
  kind: 'progress',
16215
16372
  input
16216
- })))).pipe(effect__rspack_import_3/* .flatMap */.qIB((event)=>{
16373
+ })))).pipe(effect__rspack_import_4/* .flatMap */.qIB((event)=>{
16217
16374
  switch(event.kind){
16218
16375
  case 'progress':
16219
- return effect__rspack_import_3/* .succeed */.PyW([
16376
+ return effect__rspack_import_4/* .succeed */.PyW([
16220
16377
  [
16221
16378
  event.input
16222
16379
  ],
16223
- effect__rspack_import_10.some(snapshot)
16380
+ effect__rspack_import_11.some(snapshot)
16224
16381
  ]);
16225
16382
  case 'boundary':
16226
- return effect__rspack_import_3/* ["try"] */.SvU({
16227
- catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
16383
+ return effect__rspack_import_4/* ["try"] */.SvU({
16384
+ catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
16228
16385
  try: ()=>{
16229
16386
  const next = snapshotTree(root, ids);
16230
16387
  return [
16231
16388
  settledBoundaryInputs(snapshot, next, event.winner, limits),
16232
- effect__rspack_import_10.some(next)
16389
+ effect__rspack_import_11.some(next)
16233
16390
  ];
16234
16391
  }
16235
16392
  });
@@ -16241,38 +16398,38 @@ const reconcileLoopStream = (root, ids, initial, limits, flightDone, progressInp
16241
16398
  }
16242
16399
  }));
16243
16400
  });
16244
- const gatedFlightStream = (flight, demand, flightDone)=>effect__rspack_import_7/* .unwrap */.oAg(effect__rspack_import_3/* .gen */.JkU(function*() {
16245
- const reader = yield* effect__rspack_import_3/* .acquireRelease */.Q56(effect__rspack_import_3/* .sync */.OH5(()=>flight.getReader()), (handle, exit)=>effect__rspack_import_3/* .gen */.JkU(function*() {
16246
- const cancelExit = yield* effect__rspack_import_3/* .exit */.NS5(effect__rspack_import_3/* .tryPromise */.$mh({
16247
- catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
16401
+ const gatedFlightStream = (flight, demand, flightDone)=>effect__rspack_import_8/* .unwrap */.oAg(effect__rspack_import_4/* .gen */.JkU(function*() {
16402
+ 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*() {
16403
+ const cancelExit = yield* effect__rspack_import_4/* .exit */.NS5(effect__rspack_import_4/* .tryPromise */.$mh({
16404
+ catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
16248
16405
  try: ()=>handle.cancel()
16249
16406
  }));
16250
- if (effect__rspack_import_11/* .isFailure */.N6(exit)) return void (yield* effect__rspack_import_8/* .fail */.fJ(flightDone, (0,_315_js__rspack_import_4/* .mapCause */.K0)(exit.cause)));
16251
- if (effect__rspack_import_11/* .isFailure */.N6(cancelExit)) {
16252
- const error = (0,_315_js__rspack_import_4/* .mapCause */.K0)(cancelExit.cause);
16253
- yield* effect__rspack_import_8/* .fail */.fJ(flightDone, error);
16254
- return yield* effect__rspack_import_3/* .die */.F_Q(error);
16407
+ 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)));
16408
+ if (effect__rspack_import_12/* .isFailure */.N6(cancelExit)) {
16409
+ const error = (0,_315_js__rspack_import_5/* .mapCause */.K0)(cancelExit.cause);
16410
+ yield* effect__rspack_import_9/* .fail */.fJ(flightDone, error);
16411
+ return yield* effect__rspack_import_4/* .die */.F_Q(error);
16255
16412
  }
16256
- yield* effect__rspack_import_8/* .succeed */.Py(flightDone, void 0);
16413
+ yield* effect__rspack_import_9/* .succeed */.Py(flightDone, void 0);
16257
16414
  }));
16258
- return effect__rspack_import_7/* .unfold */.t8s(void 0, ()=>demand.wait.pipe(effect__rspack_import_3/* .flatMap */.qIB(()=>effect__rspack_import_3/* .tryPromise */.$mh({
16259
- catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
16415
+ return effect__rspack_import_8/* .unfold */.t8s(void 0, ()=>demand.wait.pipe(effect__rspack_import_4/* .flatMap */.qIB(()=>effect__rspack_import_4/* .tryPromise */.$mh({
16416
+ catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
16260
16417
  try: ()=>reader.read()
16261
- })), effect__rspack_import_3/* .map */.TjK((next)=>next.done ? void 0 : [
16418
+ })), effect__rspack_import_4/* .map */.TjK((next)=>next.done ? void 0 : [
16262
16419
  next.value,
16263
16420
  void 0
16264
16421
  ])));
16265
16422
  }));
16266
- const decodeFlightRoot = (flight, demand, signal, flightDone)=>effect__rspack_import_3/* .gen */.JkU(function*() {
16267
- (0,_707_js__rspack_import_12/* .ensureAgentFlightManifest */.n)();
16268
- const flightAbort = yield* _315_js__rspack_import_4/* .scopedAbortSignal */.lQ;
16269
- const readable = (0,_315_js__rspack_import_4/* .streamToReadableStream */._I)(gatedFlightStream(flight, demand, flightDone), {
16423
+ const decodeFlightRoot = (flight, demand, signal, flightDone)=>effect__rspack_import_4/* .gen */.JkU(function*() {
16424
+ (0,_707_js__rspack_import_13/* .ensureAgentFlightManifest */.n)();
16425
+ const flightAbort = yield* _315_js__rspack_import_5/* .scopedAbortSignal */.lQ;
16426
+ const readable = (0,_315_js__rspack_import_5/* .streamToReadableStream */._I)(gatedFlightStream(flight, demand, flightDone), {
16270
16427
  signal: flightAbort,
16271
16428
  strategy: {
16272
16429
  highWaterMark: 1
16273
16430
  }
16274
16431
  });
16275
- return yield* effect__rspack_import_3/* .tryPromise */.$mh({
16432
+ return yield* effect__rspack_import_4/* .tryPromise */.$mh({
16276
16433
  catch: (error)=>hostError(signal, error),
16277
16434
  try: ()=>(0,react_server_dom_rspack_client_node__rspack_import_1.createFromReadableStream)(readable, {
16278
16435
  unstable_allowPartialStream: true
@@ -16289,11 +16446,11 @@ const progressInput = (update)=>({
16289
16446
  },
16290
16447
  type: 'progress'
16291
16448
  });
16292
- const handoffRequired = ()=>new _302_js__rspack_import_5/* .AgentContractError */.I2('handoff-required', 'The render is complete; later work requires a new invocation handoff');
16449
+ const handoffRequired = ()=>new _302_js__rspack_import_6/* .AgentContractError */.I2('handoff-required', 'The render is complete; later work requires a new invocation handoff');
16293
16450
  const createAgentRenderEventSession = (options)=>{
16294
16451
  const clock = options.clock;
16295
- const sequence = (0,_302_js__rspack_import_5/* .createAgentRenderEventSequence */.n4)(options.limits, void 0 === clock ? void 0 : ()=>clock.currentTimeMillisUnsafe());
16296
- const maxBufferedProgress = (0,_302_js__rspack_import_5/* .resolveAgentRenderLimits */.i0)(options.limits).maxEvents;
16452
+ const sequence = (0,_302_js__rspack_import_6/* .createAgentRenderEventSequence */.n4)(options.limits, void 0 === clock ? void 0 : ()=>clock.currentTimeMillisUnsafe());
16453
+ const maxBufferedProgress = (0,_302_js__rspack_import_6/* .resolveAgentRenderLimits */.i0)(options.limits).maxEvents;
16297
16454
  let offerProgress;
16298
16455
  let progressFailure;
16299
16456
  const bufferedProgress = [];
@@ -16303,36 +16460,36 @@ const createAgentRenderEventSession = (options)=>{
16303
16460
  if (sequence.completed) throw handoffRequired();
16304
16461
  const input = progressInput(update);
16305
16462
  if (void 0 === offerProgress) {
16306
- if (bufferedProgress.length >= maxBufferedProgress) throw new _302_js__rspack_import_5/* .AgentContractError */.I2('event-count-exceeded', `Agent render event count exceeds ${String(maxBufferedProgress)}`);
16463
+ if (bufferedProgress.length >= maxBufferedProgress) throw new _302_js__rspack_import_6/* .AgentContractError */.I2('event-count-exceeded', `Agent render event count exceeds ${String(maxBufferedProgress)}`);
16307
16464
  bufferedProgress.push(input);
16308
16465
  return;
16309
16466
  }
16310
- await (0,_315_js__rspack_import_4/* .runPromise */.pR)(offerProgress(input));
16467
+ await (0,_315_js__rspack_import_5/* .runPromise */.pR)(offerProgress(input));
16311
16468
  }
16312
16469
  });
16313
- const events = effect__rspack_import_7/* .unwrap */.oAg(effect__rspack_import_3/* .gen */.JkU(function*() {
16314
- const progressInputs = yield* effect__rspack_import_9/* .bounded */.Mm(0);
16315
- const flightDone = yield* effect__rspack_import_8/* .make */.L8();
16470
+ const events = effect__rspack_import_8/* .unwrap */.oAg(effect__rspack_import_4/* .gen */.JkU(function*() {
16471
+ const progressInputs = yield* effect__rspack_import_10/* .bounded */.Mm(0);
16472
+ const flightDone = yield* effect__rspack_import_9/* .make */.L8();
16316
16473
  const bindProgress = ()=>{
16317
- offerProgress = (input)=>effect__rspack_import_9/* .offer */.x(progressInputs, input).pipe(effect__rspack_import_3/* .flatMap */.qIB((accepted)=>{
16318
- if (void 0 !== progressFailure) return effect__rspack_import_3/* .fail */.fJG(progressFailure);
16319
- if (!accepted) return effect__rspack_import_3/* .fail */.fJG(handoffRequired());
16320
- return effect__rspack_import_3/* ["void"] */.rIH;
16474
+ offerProgress = (input)=>effect__rspack_import_10/* .offer */.x(progressInputs, input).pipe(effect__rspack_import_4/* .flatMap */.qIB((accepted)=>{
16475
+ if (void 0 !== progressFailure) return effect__rspack_import_4/* .fail */.fJG(progressFailure);
16476
+ if (!accepted) return effect__rspack_import_4/* .fail */.fJG(handoffRequired());
16477
+ return effect__rspack_import_4/* ["void"] */.rIH;
16321
16478
  }));
16322
16479
  };
16323
- const finalizeProgress = (error)=>effect__rspack_import_3/* .sync */.OH5(()=>{
16480
+ const finalizeProgress = (error)=>effect__rspack_import_4/* .sync */.OH5(()=>{
16324
16481
  progressFailure = error;
16325
- }).pipe(effect__rspack_import_3/* .andThen */.hgn(effect__rspack_import_9/* .shutdown */.n_(progressInputs)));
16326
- const setup = effect__rspack_import_3/* .gen */.JkU(function*() {
16327
- const flight = yield* effect__rspack_import_3/* .tryPromise */.$mh({
16482
+ }).pipe(effect__rspack_import_4/* .andThen */.hgn(effect__rspack_import_10/* .shutdown */.n_(progressInputs)));
16483
+ const setup = effect__rspack_import_4/* .gen */.JkU(function*() {
16484
+ const flight = yield* effect__rspack_import_4/* .tryPromise */.$mh({
16328
16485
  catch: (error)=>hostError(options.signal, error),
16329
16486
  try: ()=>options.flight
16330
16487
  });
16331
- if (options.signal.aborted) return yield* effect__rspack_import_3/* .fail */.fJG(abortError());
16488
+ if (options.signal.aborted) return yield* effect__rspack_import_4/* .fail */.fJG(abortError());
16332
16489
  const root = yield* decodeFlightRoot(flight, options.demand, options.signal, flightDone);
16333
- if (options.signal.aborted) return yield* effect__rspack_import_3/* .fail */.fJG(abortError());
16334
- const prepared = yield* effect__rspack_import_3/* ["try"] */.SvU({
16335
- catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
16490
+ if (options.signal.aborted) return yield* effect__rspack_import_4/* .fail */.fJG(abortError());
16491
+ const prepared = yield* effect__rspack_import_4/* ["try"] */.SvU({
16492
+ catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
16336
16493
  try: ()=>{
16337
16494
  const ids = new Map();
16338
16495
  const initial = snapshotTree(root, ids);
@@ -16347,23 +16504,23 @@ const createAgentRenderEventSession = (options)=>{
16347
16504
  }
16348
16505
  });
16349
16506
  bindProgress();
16350
- return effect__rspack_import_7/* .concat */.xWs(effect__rspack_import_7/* .fromArray */.ciY([
16507
+ return effect__rspack_import_8/* .concat */.xWs(effect__rspack_import_8/* .fromArray */.ciY([
16351
16508
  prepared.shellInput,
16352
16509
  ...bufferedProgress
16353
- ]), reconcileLoopStream(root, prepared.ids, prepared.initial, options.limits, flightDone, progressInputs, sequence)).pipe(effect__rspack_import_7/* .mapEffect */.WK$((input)=>emitBoundRenderEvent(sequence, input)), effect__rspack_import_7/* .tap */.Mim((event)=>'shell' === event.type ? options.demand.markShell : effect__rspack_import_3/* ["void"] */.rIH), effect__rspack_import_7/* .takeUntil */.QKh((event)=>'complete' === event.type), effect__rspack_import_7/* .onExit */.cfM((exit)=>{
16354
- if (effect__rspack_import_11/* .isSuccess */.oJ(exit)) return finalizeProgress(handoffRequired());
16355
- const error = (0,_315_js__rspack_import_4/* .mapCause */.K0)(exit.cause);
16356
- return finalizeProgress(sequence.completed && (0,_315_js__rspack_import_4/* .isAbortError */.zf)(error) ? handoffRequired() : error);
16510
+ ]), 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)=>{
16511
+ if (effect__rspack_import_12/* .isSuccess */.oJ(exit)) return finalizeProgress(handoffRequired());
16512
+ const error = (0,_315_js__rspack_import_5/* .mapCause */.K0)(exit.cause);
16513
+ return finalizeProgress(sequence.completed && (0,_315_js__rspack_import_5/* .isAbortError */.zf)(error) ? handoffRequired() : error);
16357
16514
  }));
16358
16515
  });
16359
- return yield* setup.pipe(effect__rspack_import_3/* .onExit */.cfM((exit)=>effect__rspack_import_11/* .isFailure */.N6(exit) ? finalizeProgress((0,_315_js__rspack_import_4/* .mapCause */.K0)(exit.cause)) : effect__rspack_import_3/* ["void"] */.rIH));
16516
+ 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
16517
  }));
16361
16518
  return {
16362
- events: void 0 === clock ? events : effect__rspack_import_7/* .provideService */.PfK(events, effect__rspack_import_13/* .Clock */.zD, clock),
16519
+ events: void 0 === clock ? events : effect__rspack_import_8/* .provideService */.PfK(events, effect__rspack_import_14/* .Clock */.zD, clock),
16363
16520
  progress
16364
16521
  };
16365
16522
  };
16366
- const toPublicEventStream = (events, demand, signal)=>(0,_315_js__rspack_import_4/* .streamToReadableStream */._I)(effect__rspack_import_7/* .interruptWhen */.S67(events, (0,_315_js__rspack_import_4/* .abortToInterrupt */.p7)(signal)), {
16523
+ 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
16524
  closeOn: (event)=>'complete' === event.type,
16368
16525
  onPull: demand.notePull,
16369
16526
  onPullDelivered: demand.notePullEnd,
@@ -16381,7 +16538,7 @@ const decodeAgentFlightStream = (flight, options = {})=>{
16381
16538
  signal
16382
16539
  }).events, demand, signal);
16383
16540
  };
16384
- const dispatcher_abortError = _302_js__rspack_import_5/* .agentRenderAbortError */.k2;
16541
+ const dispatcher_abortError = _302_js__rspack_import_6/* .agentRenderAbortError */.k2;
16385
16542
  const abortedStream = ()=>new ReadableStream({
16386
16543
  start (controller) {
16387
16544
  controller.error(dispatcher_abortError());
@@ -16416,7 +16573,7 @@ const drainCompleteDocument = async (events, signal)=>{
16416
16573
  }
16417
16574
  if (void 0 !== complete) return complete;
16418
16575
  if (signal.aborted) throw dispatcher_abortError();
16419
- throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight stream ended without a complete document');
16576
+ throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', 'Flight stream ended without a complete document');
16420
16577
  };
16421
16578
  const createAgentRenderDispatcher = (host, options = {})=>{
16422
16579
  const stream = (request)=>{
@@ -16427,7 +16584,7 @@ const createAgentRenderDispatcher = (host, options = {})=>{
16427
16584
  demand,
16428
16585
  get flight () {
16429
16586
  const current = pendingFlight.current;
16430
- if (void 0 === current) return Promise.reject(new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'Flight worker is not running'));
16587
+ if (void 0 === current) return Promise.reject(new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', 'Flight worker is not running'));
16431
16588
  return current;
16432
16589
  },
16433
16590
  limits: {
@@ -16558,21 +16715,21 @@ const appendNode = (node, content, capabilities, fallback)=>{
16558
16715
  default:
16559
16716
  {
16560
16717
  const exhaustive = node;
16561
- throw new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', `Unsupported Agent Document node: ${String(exhaustive.kind)}`);
16718
+ throw new _302_js__rspack_import_6/* .AgentContractError */.I2('invalid-document', `Unsupported Agent Document node: ${String(exhaustive.kind)}`);
16562
16719
  }
16563
16720
  }
16564
16721
  };
16565
16722
  const project_mcp_isJsonObject = (value)=>null !== value && 'object' == typeof value && !Array.isArray(value);
16566
16723
  const objectStructuredContent = (value)=>{
16567
16724
  if (void 0 === value) return;
16568
- const snapshot = (0,_302_js__rspack_import_5/* .snapshotJsonValue */.mY)(value, 'MCP structured content must be JSON-serializable');
16725
+ const snapshot = (0,_302_js__rspack_import_6/* .snapshotJsonValue */.mY)(value, 'MCP structured content must be JSON-serializable');
16569
16726
  return project_mcp_isJsonObject(snapshot) ? snapshot : void 0;
16570
16727
  };
16571
16728
  const resultMetadata = (document)=>{
16572
16729
  if ('result' !== document.root.kind) return;
16573
16730
  const metadata = document.root.metadata;
16574
16731
  if (void 0 === metadata) return;
16575
- const snapshot = (0,_302_js__rspack_import_5/* .snapshotJsonValue */.mY)(metadata, 'MCP result _meta must be JSON-serializable');
16732
+ const snapshot = (0,_302_js__rspack_import_6/* .snapshotJsonValue */.mY)(metadata, 'MCP result _meta must be JSON-serializable');
16576
16733
  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
16734
  return snapshot;
16578
16735
  };
@@ -16602,8 +16759,8 @@ const attachMcpStructuredContent = (result, value)=>{
16602
16759
  structuredContent: structured
16603
16760
  };
16604
16761
  };
16605
- const notifyProgress = (source, token, sendProgress)=>effect__rspack_import_3/* .tryPromise */.$mh({
16606
- catch: (error)=>(0,_315_js__rspack_import_4/* .toRuntimeError */.qN)(error),
16762
+ const notifyProgress = (source, token, sendProgress)=>effect__rspack_import_4/* .tryPromise */.$mh({
16763
+ catch: (error)=>(0,_315_js__rspack_import_5/* .toRuntimeError */.qN)(error),
16607
16764
  try: ()=>sendProgress({
16608
16765
  progress: source.completed,
16609
16766
  progressToken: token,
@@ -16644,18 +16801,18 @@ const documentProgressNodes = (document)=>{
16644
16801
  appendProgressNodes(document.root, nodes);
16645
16802
  return nodes;
16646
16803
  };
16647
- const projectMcpEventStream = effect__rspack_import_3/* .fnUntraced */.D9k(function*(events, options = {}) {
16804
+ const projectMcpEventStream = effect__rspack_import_4/* .fnUntraced */.D9k(function*(events, options = {}) {
16648
16805
  let lastProgress = -1 / 0;
16649
16806
  let complete;
16650
16807
  const token = options.progressToken;
16651
16808
  const sendProgress = options.sendProgress;
16652
16809
  const notify = (source)=>{
16653
- if (void 0 === token || void 0 === sendProgress) return effect__rspack_import_3/* ["void"] */.rIH;
16654
- if (!(source.completed > lastProgress)) return effect__rspack_import_3/* ["void"] */.rIH;
16810
+ if (void 0 === token || void 0 === sendProgress) return effect__rspack_import_4/* ["void"] */.rIH;
16811
+ if (!(source.completed > lastProgress)) return effect__rspack_import_4/* ["void"] */.rIH;
16655
16812
  lastProgress = source.completed;
16656
16813
  return notifyProgress(source, token, sendProgress);
16657
16814
  };
16658
- yield* effect__rspack_import_7/* .runForEach */.o1d(events, (event)=>effect__rspack_import_3/* .gen */.JkU(function*() {
16815
+ yield* effect__rspack_import_8/* .runForEach */.o1d(events, (event)=>effect__rspack_import_4/* .gen */.JkU(function*() {
16659
16816
  switch(event.type){
16660
16817
  case 'progress':
16661
16818
  yield* notify(event);
@@ -16676,7 +16833,7 @@ const projectMcpEventStream = effect__rspack_import_3/* .fnUntraced */.D9k(funct
16676
16833
  }
16677
16834
  }
16678
16835
  }));
16679
- if (void 0 === complete) return yield* effect__rspack_import_3/* .fail */.fJG(new _302_js__rspack_import_5/* .AgentContractError */.I2('invalid-document', 'MCP projector requires a complete document; the stream ended without one'));
16836
+ 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
16837
  return Object.freeze({
16681
16838
  document: complete,
16682
16839
  result: documentToCallToolResult(complete, options)
@@ -16759,6 +16916,53 @@ const MarkdownContent = async ({ children, components })=>{
16759
16916
  });
16760
16917
  return createElement(Agent.Markdown, null, markdown.replace(/\n+$/u, ''));
16761
16918
  };
16919
+ const hookComponents = new Set(Object.values(_506_js__rspack_import_15/* .Hook */.qn));
16920
+ const isHookComponent = (value)=>hookComponents.has(value);
16921
+ const resolveHookElement = (node)=>{
16922
+ let element = node;
16923
+ while(isValidElement(element) && isHookComponent(element.type))element = element.type(element.props);
16924
+ return element;
16925
+ };
16926
+ const isAgentElement = (node, name)=>{
16927
+ const resolved = resolveHookElement(node);
16928
+ return isValidElement(resolved) && resolved.type === name;
16929
+ };
16930
+ const flattenText = (node)=>{
16931
+ if ('string' == typeof node || 'number' == typeof node) return String(node);
16932
+ if (Array.isArray(node)) return node.map(flattenText).join('');
16933
+ if (isAgentElement(node, 'agent-hook-result')) throw new Error('Hook result contains duplicate roots');
16934
+ throw new Error('Hook additional context may contain only string or number children');
16935
+ };
16936
+ const lowerHookResult = (node)=>{
16937
+ const roots = Children.toArray(node).map(resolveHookElement);
16938
+ if (1 !== roots.length || !isAgentElement(roots[0], 'agent-hook-result')) throw new Error('Expected exactly one agent-hook-result root');
16939
+ const result = roots[0];
16940
+ const contexts = Children.toArray(result.props.children).map(resolveHookElement).map((child)=>{
16941
+ if (isAgentElement(child, 'agent-hook-result')) throw new Error('Hook result contains duplicate roots');
16942
+ if (!isAgentElement(child, 'agent-hook-additional-context')) throw new Error('Hook result may contain only agent-hook-additional-context elements');
16943
+ return flattenText(child.props.children);
16944
+ });
16945
+ if (0 === contexts.length) throw new Error('Hook result requires additional context');
16946
+ return {
16947
+ hookSpecificOutput: {
16948
+ additionalContext: contexts.join(''),
16949
+ hookEventName: 'PostToolUse'
16950
+ }
16951
+ };
16952
+ };
16953
+ const createRscRequestContext = (label)=>{
16954
+ const storage = new AsyncLocalStorage();
16955
+ return Object.freeze({
16956
+ run (value, operation) {
16957
+ return storage.run(value, operation);
16958
+ },
16959
+ use () {
16960
+ const value = storage.getStore();
16961
+ if (void 0 === value) throw new Error(`${label} used outside a render request`);
16962
+ return value;
16963
+ }
16964
+ });
16965
+ };
16762
16966
  var src_AGENT_DOCUMENT_VERSION = 1;
16763
16967
  var src_AGENT_REQUEST_STORE_VERSION = 6;
16764
16968
  var src_PLUGIN_STATE_DIRECTORY = "state";
@@ -17148,7 +17352,19 @@ const cliInputError = (command, input, error)=>{
17148
17352
  });
17149
17353
  return new CliInputError(issues.map(cliInputIssueLine).join('\n'), issues);
17150
17354
  };
17151
- const resolveTerminal = (hostSurface, options)=>options.terminal ?? (0,_terminal_capability_js__rspack_import_2/* .detectProcessTerminal */.JH)(hostSurface);
17355
+ const resolveTerminal = (hostSurface, options)=>{
17356
+ if (void 0 !== options.terminal) return options.terminal;
17357
+ if (void 0 === options.isTty) return (0,_terminal_capability_js__rspack_import_2/* .detectProcessTerminal */.JH)(hostSurface);
17358
+ const stdout = {
17359
+ columns: process.stdout.columns,
17360
+ fd: 1,
17361
+ isTTY: options.isTty(),
17362
+ rows: process.stdout.rows
17363
+ };
17364
+ return (0,_terminal_capability_js__rspack_import_2/* .detectProcessTerminal */.JH)(hostSurface, {
17365
+ stdout
17366
+ });
17367
+ };
17152
17368
  const webCommandRow = [
17153
17369
  'web',
17154
17370
  "Open one of the plugin's MCP Apps in a browser."
@@ -86186,7 +86402,7 @@ if (import.meta.main) {
86186
86402
  execute,
86187
86403
  name: "gbot",
86188
86404
  render,
86189
- version: "0.7.0"
86405
+ version: "0.8.0"
86190
86406
  });
86191
86407
  }
86192
86408
 
@@ -90765,7 +90981,7 @@ __webpack_require__.d(__webpack_exports__, {
90765
90981
 
90766
90982
  },
90767
90983
  "./package.json"(module) {
90768
- module.exports = {"rE":"0.7.0"}
90984
+ module.exports = {"rE":"0.8.0"}
90769
90985
 
90770
90986
  },
90771
90987