odai-dsh-agent 0.2.57 → 0.3.2

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.
Files changed (36) hide show
  1. package/README.md +4 -4
  2. package/client/client.js +135 -9
  3. package/package.json +1 -1
  4. package/preset/odai/runtime/control-center-runtime.d.mts +7 -0
  5. package/preset/odai/runtime/control-center-runtime.d.mts.map +1 -1
  6. package/preset/odai/runtime/control-center-runtime.mjs +34 -3
  7. package/preset/odai/runtime/control-center-runtime.mjs.map +1 -1
  8. package/preset/odai/runtime/governance.d.mts.map +1 -1
  9. package/preset/odai/runtime/governance.mjs +2 -3
  10. package/preset/odai/runtime/governance.mjs.map +1 -1
  11. package/preset/odai/runtime/index.d.mts.map +1 -1
  12. package/preset/odai/runtime/index.mjs +11 -0
  13. package/preset/odai/runtime/index.mjs.map +1 -1
  14. package/preset/odai/runtime/lead-mode.d.mts +6 -1
  15. package/preset/odai/runtime/lead-mode.d.mts.map +1 -1
  16. package/preset/odai/runtime/lead-mode.mjs +7 -1
  17. package/preset/odai/runtime/lead-mode.mjs.map +1 -1
  18. package/preset/odai/runtime/lifecycle-runtime.d.mts.map +1 -1
  19. package/preset/odai/runtime/lifecycle-runtime.mjs +5 -2
  20. package/preset/odai/runtime/lifecycle-runtime.mjs.map +1 -1
  21. package/preset/odai/runtime/local-cli-catalog.d.mts +7 -0
  22. package/preset/odai/runtime/local-cli-catalog.d.mts.map +1 -0
  23. package/preset/odai/runtime/local-cli-catalog.mjs +101 -0
  24. package/preset/odai/runtime/local-cli-catalog.mjs.map +1 -0
  25. package/preset/odai/runtime/runtime-support.d.mts.map +1 -1
  26. package/preset/odai/runtime/runtime-support.mjs +4 -2
  27. package/preset/odai/runtime/runtime-support.mjs.map +1 -1
  28. package/preset/odai/runtime/session-controls.d.mts +33 -0
  29. package/preset/odai/runtime/session-controls.d.mts.map +1 -0
  30. package/preset/odai/runtime/session-controls.mjs +64 -0
  31. package/preset/odai/runtime/session-controls.mjs.map +1 -0
  32. package/preset/odai/runtime/session-evidence.d.mts.map +1 -1
  33. package/preset/odai/runtime/session-evidence.mjs +5 -4
  34. package/preset/odai/runtime/session-evidence.mjs.map +1 -1
  35. package/preset/odai/runtime/tool-runtime.mjs +2 -2
  36. package/preset/odai/runtime/tool-runtime.mjs.map +1 -1
package/README.md CHANGED
@@ -17,7 +17,7 @@ odai-dsh-agent/
17
17
 
18
18
  The preset id stays `odai`, so sessions saved with it keep resolving after an upgrade. In DSH's Plugins page the whole bundle and its Control Center row can be switched on and off; the preset declaration and the rows inside the preset are read-only there, because DSH does not let its plugin manager edit a preset's composition.
19
19
 
20
- Odai owns its composition and capability set, with a scoped runtime in default `auto` mode. The `0.2.57` candidate uses DSH `0.2.1-rc.2` as its minimum supported baseline and admits later versions, including prereleases. Its npm peer stays `*` to avoid a package-manager prerelease allow-list. The release matrix targets `0.2.1-rc.2`; later versions still need compatible bundle and runtime services and are not automatically certified. Working-directory context comes from the host service rather than the retired `{{cwd}}` prompt variable. Standard is an upstream reference, not a required composition; release checks load Odai against the real host and verify scoped tool and prompt behavior.
20
+ Odai owns its composition and capability set, with a scoped runtime in default `auto` mode. The `0.3.2` candidate uses DSH `0.2.1-rc.2` as its minimum supported baseline and admits later versions, including prereleases. Its npm peer stays `*` to avoid a package-manager prerelease allow-list. The release matrix targets `0.2.1-rc.2`; later versions still need compatible bundle and runtime services and are not automatically certified. Working-directory context comes from the host service rather than the retired `{{cwd}}` prompt variable. Standard is an upstream reference, not a required composition; release checks load Odai against the real host and verify scoped tool and prompt behavior.
21
21
 
22
22
  Host-owned persistence, sandbox, approval, registries, and base controller selection remain in the selected DSH profile. Ordinary requests stay on that controller. Responsibility words are optional signals rather than commands: evidence-grounded task-state gaps route at any step, the gap tool records rather than claims a route start, terminal decisions consume the proposal, an incomplete reviewer proposal waits for changed native evidence, and an identical planner/controller model remains inline without another model call. After planner handback, the controller resumes implementation only when the current user task authorizes it; plan-only, new-task, expanded-scope, and unknown authorization remain non-implementing. Reviewer children require a current hash-addressed schema 3 evidence packet whose diff is newer than the last write and whose latest successful test or read-only check follows the last write; viewing a diff does not itself invalidate an earlier successful check. The packet binds to the authenticated direct-user task when available, excludes all prior-task session events, records its boundary in route evidence, and fails closed if an explicit task binding cannot be resolved uniquely. An incomplete packet keeps the current controller route, reports why native evidence was excluded, suppresses unchanged repeat notices, and reassesses the pending proposal after decisive evidence changes without claiming independent acceptance or terminating the authorized task. Every API route is resolved before provider I/O; deterministic invalid persisted mappings are backed up and exact-match removed, while recoverable provider failures preserve them. Frontend route failure becomes an explicit local controller fallback without a routed receipt. `execute` remains an explicit comparison mode and `observe` changes no model or child while retaining fail-closed high-impact protection. Configured compaction streams are buffered so partial failed output cannot contaminate the inherited-route retry or replace original history.
23
23
 
@@ -39,7 +39,7 @@ With DSH `0.2.1-rc.2` or a compatible later version installed, run:
39
39
  npx odai-dsh-agent install [--profile web] [--dsh-home /path/to/dsh-home]
40
40
  ```
41
41
 
42
- The installer checks `dsh -V` (the `0.2.57` candidate accepts `>=0.2.1-rc.2`, including later prereleases, without an upper version cap; published `0.2.37` targets `0.1.5-rc.2` and keeps its copied-preset installer), then runs `dsh plugin --profile <profile> add odai-dsh-agent@<version> --save-exact`. DSH's plugin manager checks the package's DSH peer before downloading anything. The package already contains the canonical skills and runtime; it does not require the Plugin. Restart the DSH Web process after a profile change, open a new session, and select `odai 治理模式` in the preset picker. Existing sessions keep the composition they started with.
42
+ The installer checks `dsh -V` (the `0.3.2` candidate accepts `>=0.2.1-rc.2`, including later prereleases, without an upper version cap; published `0.2.37` targets `0.1.5-rc.2` and keeps its copied-preset installer), then runs `dsh plugin --profile <profile> add odai-dsh-agent@<version> --save-exact`. DSH's plugin manager checks the package's DSH peer before downloading anything. The package already contains the canonical skills and runtime; it does not require the Plugin. Restart the DSH Web process after a profile change, open a new session, and select `odai 治理模式` in the preset picker. Existing sessions keep the composition they started with.
43
43
 
44
44
  DSH `0.1.7` does not carry the earlier `agent-presets.default` setting forward. To make odai the default preset again, choose it as the default in DSH; the choice is saved in the profile's own `cordis.patch.yml`.
45
45
 
@@ -110,11 +110,11 @@ The Agent keeps the bundle's complete skill copy as its `bundled` default, so ex
110
110
 
111
111
  An independent install must be a complete directory bundle containing `SKILL.md`, `manifest.json`, and every manifest-declared file. The runtime checks SemVer 2.0.0 `skillVersion`, an exact supported `runtimeContract`, complete-file SHA-256 integrity, and same-version content conflicts. Prompt governance and routing role contracts are selected atomically for one agent turn; project sources are scoped by that session's cwd, and changes are reconsidered on the next user turn. Explicit deployment `skillPath` or `ODAI_SKILL_PATH` remains highest priority and requires a DSH restart.
112
112
 
113
- The `0.2.57` source candidate bundles governance `0.7.1` (schema `5`, runtime contract `9`) and `odai-orchestration` `0.2.3` (schema `1`). The latest published pair is `0.2.56`, with governance `0.7.1`, runtime contract `9`, and orchestration `0.2.2`. Published `0.2.38` bundles orchestration `0.2.0`. Published `0.2.37` bundles governance `0.7.0` with the same schemas and runtime contract, and orchestration `0.2.0`. Governance has no role or orchestration dependency. The bundle carries both skills and its own trusted compiler, combining separate source digests into one immutable turn snapshot; it never executes external scripts or discovers neighboring orchestration. Incompatible older sources fall back visibly without rewriting their files; an incompatible explicit `skillPath` fails fast.
113
+ The `0.3.2` source candidate bundles governance `0.7.1` (schema `5`, runtime contract `9`) and `odai-orchestration` `0.2.3` (schema `1`). The latest published pair is `0.3.1`. Published `0.2.56` bundles governance `0.7.1`, runtime contract `9`, and orchestration `0.2.2`. Published `0.2.38` bundles orchestration `0.2.0`. Published `0.2.37` bundles governance `0.7.0` with the same schemas and runtime contract, and orchestration `0.2.0`. Governance has no role or orchestration dependency. The bundle carries both skills and its own trusted compiler, combining separate source digests into one immutable turn snapshot; it never executes external scripts or discovers neighboring orchestration. Incompatible older sources fall back visibly without rewriting their files; an incompatible explicit `skillPath` fails fast.
114
114
 
115
115
  ## Retired skill evolution
116
116
 
117
- Releases before `0.2.37` could refine both governance and orchestration Markdown in `$DSH_HOME/odai/skill-evolution`. Published `0.2.37` retired that overlay together with `odai_skill_evolution`, `ODAI_DISABLE_EVOLUTION`, and `governance.evolutionRoot`; later releases, including the `0.2.57` candidate, preserve that retirement. Previously active refinements stop taking effect after upgrading and restarting DSH. The runtime no longer reads the store, no package install, update, repair, or removal deletes it, and a leftover `evolutionRoot` is ignored.
117
+ Releases before `0.2.37` could refine both governance and orchestration Markdown in `$DSH_HOME/odai/skill-evolution`. Published `0.2.37` retired that overlay together with `odai_skill_evolution`, `ODAI_DISABLE_EVOLUTION`, and `governance.evolutionRoot`; later releases, including the `0.3.2` candidate, preserve that retirement. Previously active refinements stop taking effect after upgrading and restarting DSH. The runtime no longer reads the store, no package install, update, repair, or removal deletes it, and a leftover `evolutionRoot` is ignored.
118
118
 
119
119
  To retain governance customizations, start with a complete schema `5` / contract `9` user-level bundle, review and apply the desired rules, assign a distinct valid SemVer `skillVersion`, then ask Odai to set the source to `user`. Modified content retaining this candidate's bundled version `0.7.1` falls back with `same-version-content-conflict`; changing only build metadata is insufficient. On the next turn verify the actual canonical source, version and governance digest, not just the saved setting. Explicit deployment paths take precedence.
120
120
 
package/client/client.js CHANGED
@@ -423,7 +423,36 @@ window.__ModuleLoader__.load({
423
423
  const selected = trace.items.find((item) => item.key === selectedKey) ?? defaultTraceItem(trace);
424
424
  return h("div", { className: "odaiCC__live" }, evidenceError ? h("div", { className: "odaiCC__alert is-error", role: "alert" }, evidenceError) : null, h(FlowBoard, { trace, onSelect: setSelectedKey }), h("div", { className: "odaiCC__evidenceGrid" }, h(Timeline, { trace, selectedKey: selected?.key, onSelect: setSelectedKey }), h(Inspector, { item: selected })));
425
425
  }
426
- function RouteEditor({ role, config, busy, onApply }) {
426
+ function RouteChoice({ connection, value, onChange, provider, model, disabled, placeholder, localChoices, cli }) {
427
+ const [choices, setChoices] = useState([]);
428
+ const [custom, setCustom] = useState(false);
429
+ const [error, setError] = useState("");
430
+ useEffect(() => {
431
+ const controller = new AbortController();
432
+ setChoices(localChoices ?? []);
433
+ setError("");
434
+ if (localChoices || (!cli && (provider === "" || model === "")))
435
+ return () => controller.abort();
436
+ const timer = setTimeout(async () => {
437
+ try {
438
+ const response = await connection.rpc.call("/api", "odai-control-center/routing", { action: "choices", ...(cli ? { cli } : {}), ...(provider !== undefined ? { provider } : {}), ...(model !== undefined ? { model } : {}) }, controller.signal);
439
+ if (!response?.ok || !response.value?.ok)
440
+ throw new Error(response?.value?.error?.message || "目录不可用");
441
+ if (!controller.signal.aborted)
442
+ setChoices(response.value.choices ?? []);
443
+ }
444
+ catch (cause) {
445
+ if (!controller.signal.aborted)
446
+ setError(String(cause));
447
+ }
448
+ }, 200);
449
+ return () => { clearTimeout(timer); controller.abort(); };
450
+ }, [connection, provider, model, localChoices, cli]);
451
+ return h("span", { className: "odaiCC__routeChoice", title: error || undefined }, h("select", { disabled, "aria-label": placeholder, value: custom ? "__custom__" : value,
452
+ onChange: (event) => { const next = event.target.value; setCustom(next === "__custom__"); if (next !== "__custom__")
453
+ onChange(next); } }, h("option", { value: "" }, model !== undefined || localChoices ? "默认" : "请选择"), value && !choices.some((choice) => choice.id === value) ? h("option", { value }, value) : null, choices.map((choice) => h("option", { key: choice.id, value: choice.id }, choice.name === choice.id ? choice.id : `${choice.name} (${choice.id})`)), h("option", { value: "__custom__" }, "手动输入…")), error ? h("small", { role: "status" }, error) : null, custom ? h("input", { value, placeholder, disabled, "aria-label": `${placeholder}自定义值`, onChange: (event) => onChange(event.target.value) }) : null);
454
+ }
455
+ function RouteEditor({ role, config, busy, onApply, connection }) {
427
456
  const route = config?.roles?.[role];
428
457
  const source = config?.sources?.[role];
429
458
  const localCli = route?.backend === "local-cli";
@@ -454,6 +483,7 @@ window.__ModuleLoader__.load({
454
483
  }, [route, editing]);
455
484
  const formCli = backend === "local-cli";
456
485
  const efforts = LOCAL_CLI_OPTIONS.find((option) => option.id === cli)?.efforts;
486
+ const localEfforts = useMemo(() => (cli === "codex" ? [] : (efforts ?? "").split(" / ").filter(Boolean)).map(id => ({ id, name: id })), [efforts, cli]);
457
487
  const payload = routeEditorPayload(role, { backend, cli, provider, model, effort, maxTokens, timeoutSeconds, session });
458
488
  const save = () => payload ? onApply(payload).then(() => setEditing(false)) : undefined;
459
489
  const remove = () => {
@@ -480,8 +510,8 @@ window.__ModuleLoader__.load({
480
510
  onClick: () => setBackend(value),
481
511
  disabled: busy,
482
512
  }, label))), formCli ? h("small", null, "本机 CLI 只读运行,固定子代理调度,需已安装并登录对应 CLI") : null) : null, formCli
483
- ? h("label", null, h("span", null, "本机 CLI"), h("select", { value: cli, onChange: (event) => setCli(event.target.value), disabled: busy }, LOCAL_CLI_OPTIONS.map((option) => h("option", { key: option.id, value: option.id }, option.label))))
484
- : h("label", null, h("span", null, "Provider"), h("input", { value: provider, onChange: (event) => setProvider(event.target.value), placeholder: "Provider ID", disabled: busy })), h("label", null, h("span", null, "模型"), h("input", { value: model, onChange: (event) => setModel(event.target.value), placeholder: formCli ? "模型 ID 或别名" : "模型 ID", disabled: busy })), h("label", null, h("span", null, "推理档位"), h("input", { value: effort, onChange: (event) => setEffort(event.target.value), placeholder: formCli && efforts ? `可选:${efforts}` : "可选", disabled: busy })), formCli
513
+ ? h("label", null, h("span", null, "本机 CLI"), h("select", { value: cli, onChange: (event) => { setCli(event.target.value); setModel(""); setEffort(""); }, disabled: busy }, LOCAL_CLI_OPTIONS.map((option) => h("option", { key: option.id, value: option.id }, option.label))))
514
+ : h("label", null, h("span", null, "Provider"), h(RouteChoice, { connection, value: provider, onChange: (next) => { setProvider(next); setModel(""); setEffort(""); }, placeholder: "渠道", disabled: busy })), h("label", null, h("span", null, "模型"), h(RouteChoice, { connection, provider: formCli ? undefined : provider, cli: formCli ? cli : undefined, value: model, onChange: (next) => { setModel(next); setEffort(""); }, placeholder: "模型", disabled: busy })), h("label", null, h("span", null, "推理档位"), h(RouteChoice, { connection, provider, model, localChoices: formCli ? localEfforts : undefined, value: effort, onChange: setEffort, placeholder: "推理档位", disabled: busy })), formCli
485
515
  ? h("label", null, h("span", null, "超时(秒)"), h("input", { value: timeoutSeconds, onChange: (event) => setTimeoutSeconds(event.target.value), inputMode: "numeric", placeholder: "可选,默认 1200", disabled: busy }))
486
516
  : h("label", null, h("span", null, "最大 tokens"), h("input", { value: maxTokens, onChange: (event) => setMaxTokens(event.target.value), inputMode: "numeric", placeholder: "可选", disabled: busy })), h("label", null, h("span", null, "会话续接"), h("select", { value: session, onChange: (event) => setSession(event.target.value), disabled: busy }, h("option", { value: "fresh" }, "每次新开(默认)"), h("option", { value: "continue" }, "续接(不支持的后端会明确报错)"))), h("div", { className: "odaiCC__formActions" }, route ? h("button", { type: "button", className: "odaiCC__dangerButton", onClick: remove, disabled: busy }, "移除映射") : null, h("button", { type: "button", className: "odaiCC__primaryButton", onClick: save, disabled: busy || !payload }, busy ? "正在验证…" : (formCli ? "保存" : "验证并保存")))) : null);
487
517
  }
@@ -511,6 +541,7 @@ window.__ModuleLoader__.load({
511
541
  config,
512
542
  busy: busyRole === role,
513
543
  onApply: apply,
544
+ connection,
514
545
  }))) : loading ? h("div", { className: "odaiCC__empty" }, "正在加载路由配置…") : null);
515
546
  }
516
547
  function conversationTraceSource(conversation, sessionId) {
@@ -551,9 +582,12 @@ window.__ModuleLoader__.load({
551
582
  onClose();
552
583
  };
553
584
  document.addEventListener("keydown", onKey);
554
- closeRef.current?.focus();
555
585
  return () => document.removeEventListener("keydown", onKey);
556
586
  }, [onClose]);
587
+ // Focus only when the drawer opens; host updates may replace onClose.
588
+ useEffect(() => {
589
+ closeRef.current?.focus();
590
+ }, []);
557
591
  useEffect(() => {
558
592
  setStoredEvidence([]);
559
593
  evidenceFingerprintRef.current = traceFingerprint(traceView.events ?? []);
@@ -608,9 +642,79 @@ window.__ModuleLoader__.load({
608
642
  ? h(LiveView, { trace, evidenceError })
609
643
  : h(RoutingView, { connection, config, setConfig, loading, error, reload })))), document.body);
610
644
  }
645
+ function SessionControls({ sessionId, connection }) {
646
+ const [state, setState] = useState(null);
647
+ const [error, setError] = useState("");
648
+ const [busy, setBusy] = useState(false);
649
+ const lifetime = useRef(null);
650
+ const sequence = useRef(0);
651
+ const mutating = useRef(false);
652
+ const request = async (payload, signal) => {
653
+ const current = ++sequence.current;
654
+ const response = await connection.rpc.call("/api", "odai-control-center/session", { sessionId, ...payload }, signal);
655
+ if (!response?.ok || !response.value?.ok)
656
+ throw new Error(response?.value?.error?.message || response?.error?.message || "会话控制不可用");
657
+ if (!signal.aborted && current === sequence.current) {
658
+ setState(response.value.session);
659
+ setError("");
660
+ }
661
+ };
662
+ useEffect(() => {
663
+ const controller = new AbortController();
664
+ lifetime.current = controller;
665
+ setState(null);
666
+ setError("");
667
+ setBusy(false);
668
+ let pending = false;
669
+ const refresh = async () => {
670
+ if (!sessionId || pending || mutating.current)
671
+ return;
672
+ pending = true;
673
+ try {
674
+ await request({ action: "show" }, controller.signal);
675
+ }
676
+ catch (e) {
677
+ if (!controller.signal.aborted)
678
+ setError(String(e));
679
+ }
680
+ finally {
681
+ pending = false;
682
+ }
683
+ };
684
+ void refresh();
685
+ const timer = setInterval(refresh, 2500);
686
+ return () => { controller.abort(); clearInterval(timer); };
687
+ }, [sessionId, connection]);
688
+ const change = async (payload) => {
689
+ const controller = lifetime.current;
690
+ if (!controller || busy)
691
+ return;
692
+ mutating.current = true;
693
+ setBusy(true);
694
+ try {
695
+ await request(payload, controller.signal);
696
+ }
697
+ catch (e) {
698
+ if (!controller.signal.aborted)
699
+ setError(String(e));
700
+ }
701
+ finally {
702
+ mutating.current = false;
703
+ if (!controller.signal.aborted)
704
+ setBusy(false);
705
+ }
706
+ };
707
+ const details = state?.continuation.roles.map((r) => `${r.responsibility}:${r.reason || (r.effective === "continue" ? "续接" : "新开")}`).join(";");
708
+ return h("span", { className: "odaiCC__sessionControls", "aria-label": "本会话控制" }, h("button", { type: "button", className: "odaiCC__leadSwitch", role: "switch", "aria-label": "本会话主导模式", "aria-checked": !!state?.lead.enabled,
709
+ disabled: busy || !state || (!state.lead.enabled && !state.lead.available), title: state?.lead.reason || "本会话:首次写入前规划,写入后审查;未配置的规划、审查使用当前会话模型;关闭不取消正在运行的调用",
710
+ onClick: () => change({ action: "set-lead", enabled: !state.lead.enabled }) }, h("span", null, "主导"), h("span", { className: "odaiCC__switchTrack", "aria-hidden": true })), h("label", { className: "odaiCC__continuation", title: state?.continuation.reason || details }, h("span", null, "续接"), h("select", {
711
+ "aria-label": "本会话职责续接", disabled: busy || !state, value: state?.continuation.override ?? "inherit",
712
+ onChange: (event) => change({ action: "set-continuation", value: event.target.value })
713
+ }, h("option", { value: "inherit" }, "按映射"), h("option", { value: "fresh" }, "关闭"), h("option", { value: "continue", disabled: !state?.continuation.available }, "开启")), h("span", { className: "odaiCC__selectChevron", "aria-hidden": true })), error ? h("span", { className: "odaiCC__sessionNotice", role: "alert", title: error }, error) : state?.lead.reason || state?.continuation.reason ? h("small", { className: "odaiCC__sessionNotice", title: state.lead.reason || state.continuation.reason }, state.lead.reason || state.continuation.reason) : null);
714
+ }
611
715
  function Launcher(props) {
612
716
  const [open, setOpen] = useState(false);
613
- return h(React.Fragment, null, h("button", {
717
+ return h(React.Fragment, null, h(SessionControls, { key: props.sessionId, sessionId: props.sessionId, connection: props.connection }), h("button", {
614
718
  type: "button",
615
719
  className: "odaiCC__launcher",
616
720
  onClick: () => setOpen(true),
@@ -627,8 +731,26 @@ window.__ModuleLoader__.load({
627
731
  tag.dataset.plugin = PACKAGE_ID;
628
732
  tag.dataset.pluginCss = styleId;
629
733
  tag.textContent = `
630
- .odaiCC__launcher,.odaiCC{--odai-cc-bg:#f5f7fa;--odai-cc-panel:#fff;--odai-cc-surface:#f8fafc;--odai-cc-surface-2:#edf1f5;--odai-cc-text:#151922;--odai-cc-text-2:#4c5665;--odai-cc-text-3:#778190;--odai-cc-border:#d8dee7;--odai-cc-border-strong:#bdc6d2;--odai-cc-hover:#edf3ff;--odai-cc-accent:#2f6feb}
631
- .odaiCC__launcher{box-sizing:border-box;height:28px;border:1px solid var(--odai-cc-border);border-radius:6px;background:transparent;color:var(--odai-cc-text-2);display:inline-flex;align-items:center;gap:6px;padding:0 8px;cursor:pointer;font:600 11px/1 inherit;letter-spacing:0}.odaiCC__launcher:hover{background:var(--odai-cc-hover);color:var(--odai-cc-text)}
734
+ .odaiCC__sessionControls{display:inline-flex;align-items:center;gap:0;box-sizing:border-box;min-height:28px;border:1px solid var(--odai-cc-border);border-radius:8px;background:var(--odai-cc-surface);color:var(--odai-cc-text-2);font-family:inherit;font-size:11px;line-height:1;white-space:nowrap}
735
+ .odaiCC__leadSwitch{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:26px;padding:0 9px;border:0;border-radius:7px 0 0 7px;background:transparent;color:inherit;font-family:inherit;font-size:11px;font-weight:500;cursor:pointer}
736
+ .odaiCC__leadSwitch:hover:not(:disabled){background:var(--odai-cc-hover)}
737
+ .odaiCC__leadSwitch[aria-checked="true"]{color:var(--odai-cc-accent)}
738
+ .odaiCC__switchTrack{position:relative;display:inline-block;width:23px;height:13px;border-radius:8px;background:var(--odai-cc-border-strong);transition:background .15s;flex:none}
739
+ .odaiCC__switchTrack:after{content:"";position:absolute;top:2px;left:2px;width:9px;height:9px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0002;transition:transform .15s}
740
+ .odaiCC__leadSwitch[aria-checked="true"] .odaiCC__switchTrack{background:var(--odai-cc-accent)}
741
+ .odaiCC__leadSwitch[aria-checked="true"] .odaiCC__switchTrack:after{transform:translateX(10px)}
742
+ .odaiCC__continuation{position:relative;display:inline-flex;align-items:center;gap:5px;min-height:26px;padding-left:9px;border-left:1px solid var(--odai-cc-border);font-size:11px;color:var(--odai-cc-text-3)}
743
+ .odaiCC__continuation select{appearance:none;-webkit-appearance:none;box-sizing:border-box;width:65px;min-height:26px;margin:0;padding:0 19px 0 3px;border:0;border-radius:0 7px 7px 0;background:transparent;color:var(--odai-cc-text-2);font-family:inherit;font-size:11px;font-weight:500;line-height:normal;cursor:pointer}
744
+ .odaiCC__continuation select:hover:not(:disabled){background:var(--odai-cc-hover)}
745
+ .odaiCC__continuation option{color:var(--odai-cc-text);background:var(--odai-cc-panel)}
746
+ .odaiCC__selectChevron{position:absolute;right:9px;top:9px;width:5px;height:5px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);pointer-events:none}
747
+ .odaiCC__leadSwitch:focus-visible,.odaiCC__continuation select:focus-visible{outline:2px solid var(--odai-cc-accent);outline-offset:2px}
748
+ .odaiCC__leadSwitch:disabled,.odaiCC__continuation select:disabled{opacity:.5;cursor:not-allowed}
749
+ .odaiCC__sessionNotice{max-width:160px;overflow:hidden;text-overflow:ellipsis;padding:0 8px;font-size:11px;color:var(--odai-cc-text-3)}
750
+ @media(prefers-reduced-motion:reduce){.odaiCC__switchTrack,.odaiCC__switchTrack:after{transition:none}}
751
+
752
+ .odaiCC__sessionControls,.odaiCC__launcher,.odaiCC{--odai-cc-bg:#f5f7fa;--odai-cc-panel:#fff;--odai-cc-surface:#f8fafc;--odai-cc-surface-2:#edf1f5;--odai-cc-text:#151922;--odai-cc-text-2:#4c5665;--odai-cc-text-3:#778190;--odai-cc-border:#d8dee7;--odai-cc-border-strong:#bdc6d2;--odai-cc-hover:#edf3ff;--odai-cc-accent:#2f6feb}
753
+ .odaiCC__launcher{box-sizing:border-box;height:28px;border:1px solid var(--odai-cc-border);border-radius:6px;background:transparent;color:var(--odai-cc-text-2);display:inline-flex;align-items:center;gap:6px;padding:0 8px;cursor:pointer;font-family:inherit;font-size:11px;font-weight:600;line-height:1;letter-spacing:0}.odaiCC__launcher:hover{background:var(--odai-cc-hover);color:var(--odai-cc-text)}
632
754
  .odaiCC__graphIcon{position:relative;width:17px;height:15px;display:inline-block;flex:none}.odaiCC__graphNode{position:absolute;width:5px;height:5px;border:1.5px solid currentColor;border-radius:50%;box-sizing:border-box}.odaiCC__graphNode--a{left:0;top:5px}.odaiCC__graphNode--b{right:0;top:0}.odaiCC__graphNode--c{right:0;bottom:0}.odaiCC__graphLine{position:absolute;left:5px;top:7px;width:7px;height:1px;background:currentColor}.odaiCC__graphLine:before,.odaiCC__graphLine:after{content:"";position:absolute;right:0;width:5px;height:1px;background:currentColor;transform-origin:right center}.odaiCC__graphLine:before{transform:rotate(-38deg)}.odaiCC__graphLine:after{transform:rotate(38deg)}
633
755
  .odaiCC{position:fixed;inset:0;z-index:120;color:var(--odai-cc-text);font-family:inherit;letter-spacing:0}.odaiCC *{box-sizing:border-box}.odaiCC__backdrop{position:absolute;inset:0;border:0;background:rgba(0,0,0,.28)}.odaiCC__drawer{position:absolute;inset:14px;max-width:1180px;margin-left:auto;border:1px solid var(--odai-cc-border-strong);border-radius:8px;background:var(--odai-cc-panel);box-shadow:0 24px 80px rgba(0,0,0,.42);display:flex;flex-direction:column;overflow:hidden}.odaiCC__header{min-height:62px;border-bottom:1px solid var(--odai-cc-border);display:grid;grid-template-columns:minmax(230px,1fr) auto minmax(44px,1fr);align-items:center;gap:16px;padding:10px 14px}.odaiCC__brand{display:flex;align-items:center;gap:10px;min-width:0}.odaiCC__brand>.odaiCC__graphIcon{width:22px;height:19px;color:var(--odai-cc-accent)}.odaiCC__brand h2{font-size:16px;line-height:22px;margin:0}.odaiCC__brand span{display:block;color:var(--odai-cc-text-3);font-size:11px;line-height:16px}.odaiCC__tabs{display:flex;border:1px solid var(--odai-cc-border);border-radius:6px;padding:2px;background:var(--odai-cc-surface)}.odaiCC__tabs button{height:30px;min-width:72px;border:0;border-radius:4px;background:transparent;color:var(--odai-cc-text-3);cursor:pointer;font:600 12px/1 inherit}.odaiCC__tabs button.is-active{background:var(--odai-cc-panel);color:var(--odai-cc-text);box-shadow:0 1px 4px rgba(0,0,0,.2)}.odaiCC__close{justify-self:end;width:32px;height:32px;border:0;border-radius:6px;background:transparent;color:var(--odai-cc-text-2);font-size:22px;line-height:1;cursor:pointer}.odaiCC__close:hover{background:var(--odai-cc-hover)}.odaiCC__body{min-height:0;flex:1;overflow:auto}.odaiCC__live{padding:14px}.odaiCC__kicker{display:block;color:var(--odai-cc-text-3);font:700 9px/14px inherit;letter-spacing:.08em}.odaiCC__sectionHead{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}.odaiCC__sectionHead h3{font-size:12px;line-height:18px;margin:0}.odaiCC__eventCount{color:var(--odai-cc-text-3);font-size:10px}.odaiCC__flow{border:1px solid var(--odai-cc-border);border-radius:8px;background:var(--odai-cc-surface);padding:12px}.odaiCC__flowGrid{display:grid;grid-template-columns:minmax(160px,220px) minmax(360px,1fr);gap:22px;align-items:center;min-height:265px}.odaiCC__controllerNode{border:1px solid rgba(119,167,255,.45);border-radius:8px;background:rgba(119,167,255,.08);padding:18px}.odaiCC__controllerNode strong,.odaiCC__roleNode strong{display:block;font-size:12px;line-height:18px}.odaiCC__controllerNode small,.odaiCC__roleNode small{display:block;color:var(--odai-cc-text-3);font-size:10px;line-height:15px;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.odaiCC__nodeEyebrow{color:#2f6feb;font-size:9px;font-weight:700}.odaiCC__roleStack{display:flex;flex-direction:column;gap:8px}.odaiCC__flowRole{display:grid;grid-template-columns:92px minmax(0,1fr);align-items:center;border:0;background:transparent;color:inherit;padding:0;text-align:left}.odaiCC__flowRole:not(:disabled){cursor:pointer}.odaiCC__flowRole:disabled{opacity:1}.odaiCC__edge{position:relative;height:1px;background:var(--odai-cc-border-strong);margin-right:12px}.odaiCC__edge i{position:absolute;right:-1px;top:-3px;width:7px;height:7px;border-top:1px solid currentColor;border-right:1px solid currentColor;transform:rotate(45deg)}.odaiCC__edge em{position:absolute;left:5px;top:-17px;color:var(--odai-cc-text-3);font:500 9px/12px inherit;font-style:normal}.odaiCC__edge[data-state=proposal],.odaiCC__edge[data-state=decision]{background:repeating-linear-gradient(90deg,#65c6b8 0 5px,transparent 5px 9px);color:#65c6b8}.odaiCC__edge[data-state=same-turn]{background:#b99cff;color:#b99cff}.odaiCC__edge[data-state=child]{background:var(--odai-cc-accent);color:var(--odai-cc-accent)}.odaiCC__edge[data-state=handback]{background:#f1bb61;color:#f1bb61}.odaiCC__edge[data-state=blocked],.odaiCC__edge[data-state=interrupted]{background:#ef7e78;color:#ef7e78}.odaiCC__roleNode{border:1px solid var(--odai-cc-border);border-radius:7px;background:var(--odai-cc-panel);padding:8px 10px;min-width:0}.odaiCC__flowRole:not(:disabled):hover .odaiCC__roleNode{border-color:var(--odai-cc-accent)}.odaiCC__role{display:inline-flex;align-items:center;gap:5px;color:var(--odai-cc-text-2);font-size:9px;line-height:14px}.odaiCC__role i{width:6px;height:6px;border-radius:50%;background:#8f969e}.odaiCC__role--controller i{background:var(--odai-cc-accent)}.odaiCC__role--researcher i{background:#65c6b8}.odaiCC__role--planner i{background:#b99cff}.odaiCC__role--reviewer i{background:#f1bb61}.odaiCC__role--frontend i{background:#ef8fbd}.odaiCC__evidenceGrid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr);gap:12px;margin-top:12px}.odaiCC__timeline,.odaiCC__inspector{min-width:0;border:1px solid var(--odai-cc-border);border-radius:8px;background:var(--odai-cc-surface);padding:10px}.odaiCC__turn{border-top:1px solid var(--odai-cc-border);padding:8px 0}.odaiCC__turn:first-child{border-top:0;padding-top:0}.odaiCC__turn summary{display:flex;justify-content:space-between;gap:10px;cursor:pointer;list-style:none;font-size:10px}.odaiCC__turn summary::-webkit-details-marker{display:none}.odaiCC__turn summary span{color:var(--odai-cc-text-3)}.odaiCC__events{display:flex;flex-direction:column;gap:6px;margin-top:8px}.odaiCC__event{width:100%;border:1px solid var(--odai-cc-border);border-radius:7px;background:var(--odai-cc-panel);color:inherit;padding:8px;text-align:left;cursor:pointer}.odaiCC__event:hover,.odaiCC__event.is-selected{border-color:var(--odai-cc-accent);background:var(--odai-cc-hover)}.odaiCC__eventTop{display:flex;align-items:center;gap:6px;color:var(--odai-cc-text-3);font-size:9px}.odaiCC__eventTop time{margin-left:auto}.odaiCC__eventTop code{font-size:9px}.odaiCC__event>strong{display:block;margin-top:5px;font-size:11px;line-height:16px}.odaiCC__eventDetail{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--odai-cc-text-2);font-size:10px;line-height:15px;margin-top:2px}.odaiCC__eventBottom{display:flex;gap:8px;align-items:center;color:var(--odai-cc-text-3);font-size:9px;margin-top:6px}.odaiCC__state{display:inline-flex;border-radius:999px;background:var(--odai-cc-surface-2);color:var(--odai-cc-text-2);padding:1px 6px;font-size:9px;line-height:13px}.odaiCC__state--proposal{background:rgba(101,198,184,.15);color:#18756b}.odaiCC__state--same-turn{background:rgba(185,156,255,.15);color:#6f42c1}.odaiCC__state--child{background:rgba(119,167,255,.15);color:#245ec7}.odaiCC__state--handback{background:rgba(241,187,97,.15);color:#946000}.odaiCC__state--blocked,.odaiCC__state--interrupted{background:rgba(239,126,120,.15);color:#b42318}.odaiCC__facts{margin:0;display:flex;flex-direction:column;gap:7px}.odaiCC__facts>div{display:grid;grid-template-columns:56px minmax(0,1fr);gap:8px;font-size:10px}.odaiCC__facts dt{color:var(--odai-cc-text-3)}.odaiCC__facts dd{margin:0;overflow-wrap:anywhere}.odaiCC__facts code{font-size:9px}.odaiCC__raw{max-height:360px;overflow:auto;border:1px solid var(--odai-cc-border);border-radius:7px;background:var(--odai-cc-panel);color:var(--odai-cc-text-2);font:9px/14px ui-monospace,SFMono-Regular,Menlo,monospace;padding:8px;margin:10px 0 0}.odaiCC__empty{border:1px dashed var(--odai-cc-border-strong);border-radius:7px;color:var(--odai-cc-text-3);font-size:10px;line-height:16px;padding:18px;text-align:center}
634
756
  .odaiCC__nativeCalls{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:8px;min-width:0}.odaiCC__flowRole.odaiCC__nativeCall{grid-template-columns:minmax(0,1fr);width:100%;min-width:0}.odaiCC__nativeCall .odaiCC__roleNode{min-width:0;height:100%}.odaiCC__nativeNote{margin:6px 0 0;color:var(--odai-cc-text-3);font-size:12px;line-height:1.5}
@@ -637,7 +759,11 @@ window.__ModuleLoader__.load({
637
759
  @media(max-width:900px){.odaiCC__routeRow{display:block}.odaiCC__dispatch{margin-top:7px}}
638
760
  @media(max-width:760px){.odaiCC__launcher span:last-child{display:none}.odaiCC__drawer{inset:6px}.odaiCC__header{grid-template-columns:minmax(0,1fr) auto auto;gap:7px;padding:8px}.odaiCC__brand span{display:none}.odaiCC__tabs button{min-width:56px}.odaiCC__live{padding:8px}.odaiCC__flowGrid{grid-template-columns:1fr;gap:10px;min-height:0}.odaiCC__controllerNode{padding:10px}.odaiCC__flowRole{grid-template-columns:65px minmax(0,1fr)}.odaiCC__evidenceGrid{grid-template-columns:1fr}.odaiCC__inspector{max-height:none}.odaiCC__routing{padding:10px}.odaiCC__controllerLock,.odaiCC__routeSummary{grid-template-columns:92px minmax(0,1fr) auto}.odaiCC__dispatch{grid-template-columns:92px 1fr}.odaiCC__dispatch small{grid-column:2}.odaiCC__routeForm{grid-template-columns:1fr 1fr;margin-left:0}.odaiCC__raw{max-height:240px}}
639
761
  @media(max-width:760px){.odaiCC__body{overflow:hidden}.odaiCC__live{gap:8px}.odaiCC__flow{max-height:30vh}.odaiCC__evidenceGrid{grid-template-rows:minmax(180px,1fr) minmax(120px,35vh);overflow:hidden}.odaiCC__timeline,.odaiCC__inspector{min-height:0;max-height:none}}
640
- @media(prefers-color-scheme:dark){.odaiCC__launcher,.odaiCC{--odai-cc-bg:#14171b;--odai-cc-panel:#191d22;--odai-cc-surface:#1f242a;--odai-cc-surface-2:#282e35;--odai-cc-text:#f2f4f7;--odai-cc-text-2:#c5cbd3;--odai-cc-text-3:#929ba7;--odai-cc-border:#333a43;--odai-cc-border-strong:#46505c;--odai-cc-hover:#26354b;--odai-cc-accent:#77a7ff}.odaiCC__nodeEyebrow{color:#91b7ff}.odaiCC__state--proposal,.odaiCC__alert.is-success{color:#90d9cf}.odaiCC__state--same-turn{color:#cbb8ff}.odaiCC__state--child{color:#a6c3ff}.odaiCC__state--handback{color:#f4ca84}.odaiCC__state--blocked,.odaiCC__state--interrupted,.odaiCC__dangerButton,.odaiCC__alert.is-error{color:#f3a39e}}
762
+ @media(min-width:761px){.odaiCC__routing .odaiCC__routeForm{grid-template-columns:repeat(5,minmax(0,1fr))}}
763
+ .odaiCC__routeForm>label{min-width:0}
764
+ .odaiCC__routeChoice{display:flex;flex-direction:column;gap:4px;min-width:0}
765
+ .odaiCC__routeForm input,.odaiCC__routeForm select{min-width:0;width:100%}
766
+ @media(prefers-color-scheme:dark){.odaiCC__sessionControls,.odaiCC__launcher,.odaiCC{--odai-cc-bg:#14171b;--odai-cc-panel:#191d22;--odai-cc-surface:#1f242a;--odai-cc-surface-2:#282e35;--odai-cc-text:#f2f4f7;--odai-cc-text-2:#c5cbd3;--odai-cc-text-3:#929ba7;--odai-cc-border:#333a43;--odai-cc-border-strong:#46505c;--odai-cc-hover:#26354b;--odai-cc-accent:#77a7ff}.odaiCC__nodeEyebrow{color:#91b7ff}.odaiCC__state--proposal,.odaiCC__alert.is-success{color:#90d9cf}.odaiCC__state--same-turn{color:#cbb8ff}.odaiCC__state--child{color:#a6c3ff}.odaiCC__state--handback{color:#f4ca84}.odaiCC__state--blocked,.odaiCC__state--interrupted,.odaiCC__dangerButton,.odaiCC__alert.is-error{color:#f3a39e}}
641
767
  @media(prefers-reduced-motion:no-preference){.odaiCC__drawer{animation:odaiCCIn .15s ease-out}}@keyframes odaiCCIn{from{opacity:.72;transform:translateX(8px)}to{opacity:1;transform:none}}
642
768
  `;
643
769
  document.head.appendChild(tag);
@@ -771,7 +897,7 @@ window.__ModuleLoader__.load({
771
897
  }
772
898
  exports.apply = apply;
773
899
  exports.inject = ["slots", "sessions", "connection"];
774
- exports.__testing = { controlCenterError, conversationTraceSource, defaultTraceItem, localCliAllowed, projectTrace, routeEditorPayload, stateOf, roleOf, shouldOwnSurface, traceFingerprint, windowTurnItems };
900
+ exports.__testing = { ControlCenter, controlCenterError, conversationTraceSource, defaultTraceItem, localCliAllowed, projectTrace, routeEditorPayload, stateOf, roleOf, shouldOwnSurface, traceFingerprint, windowTurnItems };
775
901
  return module.exports;
776
902
  },
777
903
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "odai-dsh-agent",
3
- "version": "0.2.57",
3
+ "version": "0.3.2",
4
4
  "description": "独立维护的 odai 治理模式预设(DSH bundle),按任务需要提供治理与协作。",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,3 +1,4 @@
1
+ import { type SessionControlsSnapshot } from "./session-controls.mjs";
1
2
  import { type RoleDispatches, type RoleRoutes, type RoutingConfigResult } from "./routing-config.mjs";
2
3
  import type { SessionEvidenceEvent } from "./session-evidence.mjs";
3
4
  import type { DshRuntimeContext, RuntimeLogger } from "./runtime-types.mjs";
@@ -10,6 +11,11 @@ interface RpcFailure {
10
11
  }
11
12
  export interface ControlCenterResponse {
12
13
  ok: boolean;
14
+ session?: SessionControlsSnapshot;
15
+ choices?: Array<{
16
+ id: string;
17
+ name: string;
18
+ }>;
13
19
  config?: Omit<RoutingConfigResult, "configPath" | "latestRoute">;
14
20
  events?: readonly SessionEvidenceEvent[];
15
21
  revision?: string;
@@ -18,6 +24,7 @@ export interface ControlCenterResponse {
18
24
  }
19
25
  export interface ControlCenterRuntimeOptions {
20
26
  configPath: string;
27
+ routingMode?: string;
21
28
  evidenceRoot?: string;
22
29
  configuredRoles?: Readonly<RoleRoutes>;
23
30
  configuredDispatch?: Readonly<RoleDispatches>;
@@ -1 +1 @@
1
- {"version":3,"file":"control-center-runtime.d.mts","sourceRoot":"","sources":["../src/control-center-runtime.mts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAiB,MAAM,qBAAqB,CAAC;AAG3F,QAAA,MAAM,sBAAsB,y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BAAgB,wCAAwC,CACtD,GAAG,EAAE,iBAAiB,EACtB,OAAO,EAAE,2BAA2B,GACnC,MAAM,OAAO,CAAC,IAAI,CAAC,CAmCrB;AAED,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,iBAAiB,EACtB,OAAO,EAAE,2BAA2B,GACnC,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CA2FnC;AAED,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,CAAC"}
@@ -1,14 +1,17 @@
1
+ import { discoverCliModels } from "./local-cli-catalog.mjs";
2
+ import { applySessionControl } from "./session-controls.mjs";
1
3
  import { applyRoutingConfigAction, } from "./routing-config.mjs";
2
4
  import { readStoredSessionEvidence, resolveSessionEvidenceRoot, storedSessionEvidenceRevision, } from "./session-evidence.mjs";
3
5
  import { isUnknownRecord } from "./runtime-types.mjs";
4
6
  const CONTROL_CENTER_CHANNEL = "/odai-control-center";
5
7
  const CONTROL_CENTER_ENDPOINT = "routing";
6
8
  const CONTROL_CENTER_EVIDENCE_ENDPOINT = "evidence";
9
+ const CONTROL_CENTER_SESSION_ENDPOINT = "session";
7
10
  const MAX_EVIDENCE_EVENTS = 2_000;
8
11
  function registerControlCenter(connection, handler) {
9
12
  if (!connection.fetch)
10
13
  return connection.rpc.handle(CONTROL_CENTER_CHANNEL, handler, { authority: "loopback" });
11
- const disposers = [CONTROL_CENTER_ENDPOINT, CONTROL_CENTER_EVIDENCE_ENDPOINT].map((endpoint) => {
14
+ const disposers = [CONTROL_CENTER_ENDPOINT, CONTROL_CENTER_EVIDENCE_ENDPOINT, CONTROL_CENTER_SESSION_ENDPOINT].map((endpoint) => {
12
15
  const method = `${CONTROL_CENTER_CHANNEL.slice(1)}/${endpoint}`;
13
16
  return connection.fetch.register({
14
17
  path: `/api/${method}`, methods: ["POST"], requestBody: "buffered",
@@ -37,7 +40,8 @@ function effectiveOptions(owners) {
37
40
  for (const options of owners.values()) {
38
41
  const weight = Object.keys(options.configuredRoles ?? {}).length
39
42
  + Object.keys(options.configuredDispatch ?? {}).length;
40
- if (selected === undefined || weight > selectedWeight) {
43
+ if (selected === undefined || weight > selectedWeight
44
+ || (weight === selectedWeight && selected.routingMode === undefined && options.routingMode !== undefined)) {
41
45
  selected = options;
42
46
  selectedWeight = weight;
43
47
  }
@@ -154,11 +158,38 @@ export function installControlCenterRuntime(ctx, options) {
154
158
  }
155
159
  const owners = new Map([[owner, options]]);
156
160
  const dispose = registerControlCenter(connection, async (endpoint, payload, signal) => {
157
- if (endpoint !== CONTROL_CENTER_ENDPOINT && endpoint !== CONTROL_CENTER_EVIDENCE_ENDPOINT) {
161
+ if (endpoint !== CONTROL_CENTER_ENDPOINT && endpoint !== CONTROL_CENTER_EVIDENCE_ENDPOINT && endpoint !== CONTROL_CENTER_SESSION_ENDPOINT) {
158
162
  return { ok: true, value: { ok: false, error: { code: "unavailable", message: "unknown Odai Control Center endpoint" } } };
159
163
  }
160
164
  const active = effectiveOptions(owners);
161
165
  try {
166
+ if (endpoint === CONTROL_CENTER_ENDPOINT && isUnknownRecord(payload) && payload.action === "choices") {
167
+ if (typeof payload.cli === "string")
168
+ return { ok: true, value: { ok: true, choices: await discoverCliModels(payload.cli, signal) } };
169
+ const llm = ctx.llm;
170
+ if (!llm?.listProviders)
171
+ throw new TypeError("宿主未提供模型目录,请手动输入");
172
+ if (payload.provider !== undefined && typeof payload.provider !== "string")
173
+ throw new TypeError("invalid provider");
174
+ if (payload.model !== undefined && typeof payload.model !== "string")
175
+ throw new TypeError("invalid model");
176
+ let choices;
177
+ if (typeof payload.provider !== "string" || !payload.provider)
178
+ choices = llm.listProviders();
179
+ else if (typeof payload.model !== "string" || !payload.model) {
180
+ if (!llm.listModels)
181
+ throw new TypeError("宿主未提供模型列表,请手动输入");
182
+ choices = await llm.listModels(payload.provider);
183
+ }
184
+ else {
185
+ if (!llm.resolveModelInfo)
186
+ throw new TypeError("宿主未提供推理档位,请手动输入");
187
+ choices = (await llm.resolveModelInfo(payload.provider, payload.model, signal)).reasoning?.efforts ?? [];
188
+ }
189
+ return { ok: true, value: { ok: true, choices: choices.map(({ id, name }) => ({ id, name })) } };
190
+ }
191
+ if (endpoint === CONTROL_CENTER_SESSION_ENDPOINT)
192
+ return { ok: true, value: { ok: true, session: applySessionControl(payload, { ...active, evidenceRoot: active.evidenceRoot ?? resolveSessionEvidenceRoot(active.configPath) }) } };
162
193
  if (endpoint === CONTROL_CENTER_EVIDENCE_ENDPOINT) {
163
194
  const request = evidenceRequest(payload);
164
195
  const evidenceRoot = active.evidenceRoot ?? resolveSessionEvidenceRoot(active.configPath);
@@ -1 +1 @@
1
- {"version":3,"file":"control-center-runtime.mjs","sourceRoot":"","sources":["../src/control-center-runtime.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAIzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AACtD,MAAM,uBAAuB,GAAG,SAAS,CAAC;AAC1C,MAAM,gCAAgC,GAAG,UAAU,CAAC;AACpD,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAoClC,SAAS,qBAAqB,CAAC,UAA0B,EACvD,OAAkG;IAElG,IAAI,CAAC,UAAU,CAAC,KAAK;QAAE,OAAO,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,sBAAsB,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;IAChH,MAAM,SAAS,GAAG,CAAC,uBAAuB,EAAE,gCAAgC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7F,MAAM,MAAM,GAAG,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,C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AAO,CAAC;CACjE;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAItE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,gBAAqB,GAAG,CAAC,SAAS,EAAE,aAAa,KAAK,MAAM,GAAG,SAAS,CAgBrH;AAgBD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,EAClC,cAAc,GAAE,SAAS,QAAQ,EAAE,GAAG,SAAyC,GAC9E,eAAe,GAAG,SAAS,CA6B7B;AAED,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,2BAAgC,GACxC,CAAC,SAAS,EAAE,aAAa,KAAK,MAAM,GAAG,SAAS,CA2BlD;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,GAAG,iBAAiB,CAcnG"}
@@ -113,9 +113,8 @@ export function createRouteProtectionGuard(options = {}) {
113
113
  if (allowed.has(execution?.name))
114
114
  return undefined;
115
115
  if (options.isReadOnlyResponsibility?.(execution?.agent)) {
116
- // Preserve the public denial code while enforcing responsibility permissions
117
- // independently of risk classification, routing mode, or risk-release state.
118
- const reason = `ODAI_HIGH_IMPACT_ROUTE_BLOCKED: active read-only responsibility may not execute ${execution.name}; return evidence to the controller instead.`;
116
+ // Responsibility permissions are independent of high-impact route protection.
117
+ const reason = `ODAI_RESPONSIBILITY_READ_ONLY: active read-only responsibility may not execute ${execution.name}. Use read, glob, or grep to inspect source; shell commands are unavailable even for queries. Return findings through odai_responsibility_return so the controller can continue.`;
119
118
  onDenied(execution, reason);
120
119
  return reason;
121
120
  }
@@ -1 +1 @@
1
- {"version":3,"file":"governance.mjs","sourceRoot":"","sources":["../src/governance.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,CAAC,MAAM,0CAA0C,GAAG,MAAM,CAAC,MAAM,CAAC;IACtE,MAAM;IACN,YAAY;IACZ,MAAM;IACN,MAAM;IACN,YAAY;IACZ,WAAW;IACX,mBAAmB;IACnB,UAAU;IACV,aAAa;IACb,YAAY;IACZ,UAAU;IACV,OAAO;IACP,4BAA4B;CACpB,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC;IACvD,sBAAsB;IACtB,MAAM;IACN,YAAY;IACZ,MAAM;IACN,MAAM;IACN,YAAY;IACZ,WAAW;IACX,4BAA4B;CACpB,CAAC,CAAC;AA6BZ,MAAM,UAAU,UAAU,CAAC,KAAkC;IAC3D,MAAM,MAAM,GAAG,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC;IACtC,OAAO,MAAM,EAAE,MAAM,KAAK,UAAU;WAC/B,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,OAAO,GAAqB,EAAE;IACjE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS;QAC9B,GAAG,2BAA2B;QAC9B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAC;KACzF,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAS,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAA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MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAeA,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAEV,iBAAiB,EAKlB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,IAAI,qBAAe,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC;AAEtF,eAAO,MAAM,MAAM,UAA4D,CAAC;AA0BhF,wBAAgB,KAAK,CAAC,GAAG,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CA4QtE"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAiBA,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAEV,iBAAiB,EAKlB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,IAAI,qBAAe,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC;AAEtF,eAAO,MAAM,MAAM,UAA4D,CAAC;AA0BhF,wBAAgB,KAAK,CAAC,GAAG,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CAoRtE"}
@@ -1,3 +1,5 @@
1
+ import { leadState } from "./lead-mode.mjs";
2
+ import { latestRequestRoute } from "./runtime-support.mjs";
1
3
  import { applyCompactionStateProtocol, applyCompactionTarget, effectiveCompactionTarget, invalidatePersistedCompactionTarget, } from "./compaction-config.mjs";
2
4
  import { installCompactionRuntime } from "./compaction-runtime.mjs";
3
5
  import { installControlCenterRuntimeWhenAvailable } from "./control-center-runtime.mjs";
@@ -33,6 +35,7 @@ export function apply(ctx, rawConfig) {
33
35
  const logger = loggerFor(ctx);
34
36
  const disposeControlCenter = installControlCenterRuntimeWhenAvailable(ctx, {
35
37
  configPath: config.routing.configPath,
38
+ routingMode: config.routing.mode,
36
39
  configuredRoles: config.routing.roles,
37
40
  configuredDispatch: config.routing.dispatch,
38
41
  logger,
@@ -125,6 +128,14 @@ export function apply(ctx, rawConfig) {
125
128
  const state = routingSnapshotFor(agent, turn);
126
129
  if (state.error || !state.snapshot)
127
130
  return state;
131
+ const lead = leadState(evidence.events(agent));
132
+ if (!state.snapshot.roles[role] && config.routing.mode !== "off" && !agent.session.header?.parentSession && agent.session.header?.origin !== "subagent"
133
+ && (role === "planner" || role === "reviewer") && lead?.enabled === true && Array.isArray(lead.roles) && lead.roles.includes(role)) {
134
+ const route = routeFromConfig(agent.options) ?? latestRequestRoute(agent);
135
+ if (route)
136
+ return { route, dispatch: state.snapshot.dispatch[role] ?? "child",
137
+ dispatchSource: state.snapshot.dispatchSources[role] };
138
+ }
128
139
  return {
129
140
  route: state.snapshot.roles[role],
130
141
  source: state.snapshot.sources[role],