@wrongstack/cli 1.0.33 → 1.0.36

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 (145) hide show
  1. package/dist/{acp-EDGUWU7N.js → acp-QLU7T5WX.js} +470 -466
  2. package/dist/{auth-SUHKFFO4.js → auth-AED7RW7D.js} +7 -7
  3. package/dist/auth-menu/openai-codex-oauth.d.ts +1 -1
  4. package/dist/auth-menu/panel-provider-edits.d.ts +15 -0
  5. package/dist/auth-menu/panel-service.d.ts +1 -1
  6. package/dist/{automation-MCDFCIMV.js → automation-3E3AUPBF.js} +19 -4
  7. package/dist/boot/governance-evidence-candidate.d.ts +1 -2
  8. package/dist/boot/system-prompt-builder.d.ts +1 -1
  9. package/dist/boot/tui-project-spawn.d.ts +0 -1
  10. package/dist/boot/tui-session-resume-contracts.d.ts +95 -0
  11. package/dist/boot/tui-session-resume.d.ts +2 -88
  12. package/dist/boot/tui-settings-read.d.ts +3 -0
  13. package/dist/{boot-auto-thin-K2DHHYIW.js → boot-auto-thin-AGJ6TAWY.js} +3 -3
  14. package/dist/boot-launch-choices.d.ts +22 -0
  15. package/dist/boot-provider-gate.d.ts +28 -0
  16. package/dist/boot-subcommand-dispatch.d.ts +24 -0
  17. package/dist/boot.d.ts +1 -1
  18. package/dist/chimera-cascade-evidence.d.ts +1 -1
  19. package/dist/{chunk-TI7KLHYX.js → chunk-2CMMWRQH.js} +81 -80
  20. package/dist/{chunk-4BX2YDTQ.js → chunk-4JMAWKLA.js} +45 -4
  21. package/dist/{chunk-TWSQTQKR.js → chunk-4R6TVMYA.js} +2 -2
  22. package/dist/{chunk-HHRYIDOW.js → chunk-ACW64W4M.js} +34 -7
  23. package/dist/{chunk-5EA6OTLJ.js → chunk-AFOH6CHO.js} +2 -2
  24. package/dist/{chunk-WHEYHDIE.js → chunk-AKESWZH5.js} +2 -1
  25. package/dist/{chunk-JHUJUIOH.js → chunk-AT2A7RJZ.js} +4 -16
  26. package/dist/{chunk-LKFKO4JW.js → chunk-B6EHK772.js} +2 -2
  27. package/dist/{chunk-U3SS4NRH.js → chunk-BHXAKTBE.js} +1 -1
  28. package/dist/{chunk-4UWCMBPG.js → chunk-BJH44J7G.js} +3 -3
  29. package/dist/{chunk-MPQCHBDJ.js → chunk-CJSHS2K7.js} +5 -1
  30. package/dist/{chunk-RQ4UBKYH.js → chunk-GF7LUWQS.js} +5 -11
  31. package/dist/{chunk-TXAFIERF.js → chunk-L5NWFP5R.js} +2 -2
  32. package/dist/{chunk-24C6VVLM.js → chunk-LPGZ3NUF.js} +23 -23
  33. package/dist/{chunk-UQUYBDMG.js → chunk-M4G5FO7F.js} +1 -1
  34. package/dist/{chunk-P3GRLV47.js → chunk-NEWXDNF2.js} +212 -145
  35. package/dist/{chunk-3LEFXLAW.js → chunk-NOZJIN46.js} +36 -37
  36. package/dist/{chunk-4MDRHMX4.js → chunk-RE73FP2X.js} +4 -27
  37. package/dist/{chunk-5UZBUV2H.js → chunk-RKU66D2O.js} +6 -4
  38. package/dist/{chunk-SWOPJHXI.js → chunk-RYTSPBNM.js} +4 -4
  39. package/dist/{chunk-WTJDSTYD.js → chunk-T5KR6SNO.js} +2 -2
  40. package/dist/chunk-TGSPCFBT.js +1 -0
  41. package/dist/{chunk-ZYACRPLN.js → chunk-ULYAI7CP.js} +6 -3
  42. package/dist/{chunk-HLSHFXTO.js → chunk-WY74MMDB.js} +2 -2
  43. package/dist/{chunk-PGNERAZL.js → chunk-ZWBI7ORM.js} +3 -3
  44. package/dist/{cli-context-7HK67B2Z.js → cli-context-I6HJCVCV.js} +1607 -1495
  45. package/dist/cli-initial-tools.d.ts +54 -0
  46. package/dist/{cli-main-TQGLKB6D.js → cli-main-X7KD7IOC.js} +38223 -37136
  47. package/dist/cli-main-boot.d.ts +133 -0
  48. package/dist/cli-main-orchestration.d.ts +170 -0
  49. package/dist/cli-main-state.d.ts +19 -0
  50. package/dist/config-doctor.d.ts +1 -1
  51. package/dist/{config-transfer-UE37X4B5.js → config-transfer-YPD7HYXH.js} +7 -5
  52. package/dist/{execution-C2IECWF7.js → execution-M7D4KNBB.js} +171 -132
  53. package/dist/fleet/host-director-setup.d.ts +41 -0
  54. package/dist/fleet/host-spawn-types.d.ts +17 -0
  55. package/dist/fleet/host.d.ts +2 -1
  56. package/dist/goal-host-prompts.d.ts +5 -0
  57. package/dist/goal-host-types.d.ts +94 -0
  58. package/dist/goal-host.d.ts +2 -91
  59. package/dist/{hq-KBFDKTDD.js → hq-BBLGEEUH.js} +5 -6
  60. package/dist/hq-server/handle-types.d.ts +1 -1
  61. package/dist/hq-server/routes/auth-handlers.d.ts +1 -1
  62. package/dist/hq-server/routes.d.ts +1 -13
  63. package/dist/hq-server/utils.d.ts +1 -1
  64. package/dist/{hq-server-AVNKZ2PV.js → hq-server-5TR6NBGS.js} +3 -3
  65. package/dist/{hq-service-FGB7BY2D.js → hq-service-4Q64WFNT.js} +3 -3
  66. package/dist/{import-claude-code-AYG24RG2.js → import-claude-code-GHIS2F7Y.js} +3 -3
  67. package/dist/index.js +5 -5
  68. package/dist/live-settings-input.d.ts +2 -0
  69. package/dist/mailbox-bridge-bootstrap.d.ts +1 -4
  70. package/dist/{mailbox-serve-S536N66F.js → mailbox-serve-DRWJVMYU.js} +2 -2
  71. package/dist/{modeldiag-NEPTLFZW.js → modeldiag-F3LUF4VJ.js} +3 -3
  72. package/dist/picker-effort.d.ts +32 -0
  73. package/dist/picker-model-picker.d.ts +13 -2
  74. package/dist/picker-provider-list.d.ts +66 -0
  75. package/dist/picker.d.ts +12 -12
  76. package/dist/plugin-config.d.ts +6 -0
  77. package/dist/{plugin-usage-3TZGROK7.js → plugin-usage-EM752WHG.js} +3 -3
  78. package/dist/{plugins-ITH4SLO6.js → plugins-U6HQFJ7N.js} +4 -4
  79. package/dist/{providers-models-O75MKLN2.js → providers-models-S3S6VXME.js} +249 -239
  80. package/dist/repl-suggestions.d.ts +0 -5
  81. package/dist/{sage-FFKUOCQL.js → sage-BMRDJCDI.js} +9 -5
  82. package/dist/{sage-sync-ZMTHB477.js → sage-sync-PCWCNEUK.js} +2 -2
  83. package/dist/{sdd-runtime-PTOSPYI4.js → sdd-runtime-PF72WHLO.js} +3 -20
  84. package/dist/services/sdd/task-manager.d.ts +1 -12
  85. package/dist/services/sdd-runtime.d.ts +3 -4
  86. package/dist/services/statusline-config.d.ts +0 -2
  87. package/dist/{sessions-config-VE26SB56.js → sessions-config-RQRQDW5Q.js} +2 -2
  88. package/dist/settings-behavior-sections.d.ts +0 -1
  89. package/dist/short-circuit-flags-IEV3FEOT.js +10 -0
  90. package/dist/{skill-suggest-L2EVWB6R.js → skill-suggest-THANK3LV.js} +1 -1
  91. package/dist/slash-commands/command-context.d.ts +2 -0
  92. package/dist/slash-commands/doctor.d.ts +0 -9
  93. package/dist/slash-commands/fallback-chain-view.d.ts +3 -0
  94. package/dist/slash-commands/fallback-ref-validation.d.ts +34 -0
  95. package/dist/slash-commands/goal-refiner.d.ts +10 -2
  96. package/dist/slash-commands/goals.d.ts +6 -0
  97. package/dist/slash-commands/kanban-task-completion.d.ts +17 -0
  98. package/dist/slash-commands/mcp.d.ts +0 -1
  99. package/dist/slash-commands/memory-purge-domain-terms.d.ts +5 -0
  100. package/dist/slash-commands/nextsteps-mode.d.ts +13 -0
  101. package/dist/slash-commands/session-live-status.d.ts +21 -0
  102. package/dist/slash-commands/session.d.ts +1 -1
  103. package/dist/slash-commands/settings-feature-ui-mutations.d.ts +8 -0
  104. package/dist/slash-commands/settings-hq-autonomy-mutations.d.ts +8 -0
  105. package/dist/slash-commands/settings-persist-deps.d.ts +10 -0
  106. package/dist/slash-commands/settings-runtime-mutations.d.ts +12 -0
  107. package/dist/slash-commands/shadow.d.ts +0 -1
  108. package/dist/slash-commands/tool-auto-thin-commands.d.ts +15 -0
  109. package/dist/{standalone-auto-update-VQC4GYCM.js → standalone-auto-update-QUXOZ4B5.js} +13 -2
  110. package/dist/subcommands/handlers/acp-agents.d.ts +9 -0
  111. package/dist/subcommands/handlers/acp-server.d.ts +7 -0
  112. package/dist/subcommands/handlers/hq.d.ts +0 -1
  113. package/dist/subcommands/handlers/providers-models-custom.d.ts +33 -0
  114. package/dist/subcommands/handlers/providers-models-visibility.d.ts +29 -0
  115. package/dist/subcommands/handlers/skill-suggest.d.ts +0 -2
  116. package/dist/{subcommands-CLI6QTLU.js → subcommands-75IB23LS.js} +2 -2
  117. package/dist/{typesafe-NHC322W5.js → typesafe-KW2XHOG3.js} +2 -2
  118. package/dist/{update-J5WHAFPE.js → update-LHCWAWEZ.js} +3 -3
  119. package/dist/utils/win32-cmd.d.ts +1 -1
  120. package/dist/{version-help-ATOKGMTK.js → version-help-JQGRPDJW.js} +2 -2
  121. package/dist/webui-server/credential-watcher.d.ts +3 -1
  122. package/dist/webui-server/host-settings.d.ts +17 -0
  123. package/dist/webui-server/http-bridge.d.ts +32 -0
  124. package/dist/webui-server/instance-registration.d.ts +19 -0
  125. package/dist/webui-server/kanban-services.d.ts +9 -0
  126. package/dist/webui-server/message-router.d.ts +14 -0
  127. package/dist/webui-server/prefs-seeding.d.ts +1 -2
  128. package/dist/webui-server/provider-config.d.ts +0 -1
  129. package/dist/webui-server/provider-plane.d.ts +14 -0
  130. package/dist/webui-server/session-agents.d.ts +18 -0
  131. package/dist/webui-server/session-start-live.d.ts +11 -0
  132. package/dist/webui-server/stream-coalescer.d.ts +1 -1
  133. package/dist/webui-server/transport.d.ts +12 -0
  134. package/dist/{webui-server-GQOVLQS3.js → webui-server-CUIFA25W.js} +1472 -1335
  135. package/dist/webui-session-maintenance.d.ts +16 -0
  136. package/dist/wiring/brain-and-orchestration.d.ts +1 -1
  137. package/dist/wiring/cli-slash-commands-setup.d.ts +1 -0
  138. package/dist/wiring/command-host-state.d.ts +11 -2
  139. package/dist/wiring/dep-watcher-bridge.d.ts +8 -1
  140. package/dist/wiring/management-tools.d.ts +9 -1
  141. package/dist/wiring/session-command-handlers.d.ts +2 -1
  142. package/dist/worktree-command-host.d.ts +31 -0
  143. package/package.json +31 -31
  144. package/dist/chunk-WHOIR577.js +0 -1
  145. package/dist/short-circuit-flags-D6VAG47Y.js +0 -10
@@ -6,11 +6,7 @@ import {
6
6
  runGit,
7
7
  setAutoSuggestions,
8
8
  setSuggestions
9
- } from "./chunk-3LEFXLAW.js";
10
- import {
11
- deriveFsAccessPair,
12
- persistConfigSetting
13
- } from "./chunk-4MDRHMX4.js";
9
+ } from "./chunk-NOZJIN46.js";
14
10
  import {
15
11
  checkStructuredAnswer,
16
12
  parseOutputFormat,
@@ -27,10 +23,7 @@ import {
27
23
  import {
28
24
  theme
29
25
  } from "./chunk-QD544J2B.js";
30
- import {
31
- fmtTok
32
- } from "./chunk-EWKESL4L.js";
33
- import "./chunk-WHOIR577.js";
26
+ import "./chunk-TGSPCFBT.js";
34
27
  import {
35
28
  advanceToNextTask,
36
29
  autoDetectTaskCompletion,
@@ -43,23 +36,30 @@ import {
43
36
  trySaveImplementationPlan,
44
37
  trySaveSpecFromAIOutput,
45
38
  trySaveTasksFromAIOutput
46
- } from "./chunk-JHUJUIOH.js";
39
+ } from "./chunk-AT2A7RJZ.js";
40
+ import {
41
+ fmtTok
42
+ } from "./chunk-EWKESL4L.js";
43
+ import {
44
+ deriveFsAccessPair,
45
+ persistConfigSetting
46
+ } from "./chunk-RE73FP2X.js";
47
47
  import {
48
48
  terminalLink,
49
49
  terminalText
50
50
  } from "./chunk-HXJYHAR4.js";
51
51
  import {
52
52
  resolveActiveApiKey
53
- } from "./chunk-ZYACRPLN.js";
53
+ } from "./chunk-ULYAI7CP.js";
54
54
  import {
55
55
  activeProfileConfigPath
56
56
  } from "./chunk-YMXXOOFN.js";
57
57
  import {
58
58
  backupCurrent
59
- } from "./chunk-4BX2YDTQ.js";
59
+ } from "./chunk-4JMAWKLA.js";
60
60
  import {
61
61
  startCliHqConnection
62
- } from "./chunk-4UWCMBPG.js";
62
+ } from "./chunk-BJH44J7G.js";
63
63
  import {
64
64
  CLI_VERSION
65
65
  } from "./chunk-F5DCFAKI.js";
@@ -68,6 +68,7 @@ import {
68
68
  import * as path14 from "node:path";
69
69
  import { setQueuedMessagesSnapshot as setQueuedMessagesSnapshot2 } from "@wrongstack/core/agent";
70
70
  import { LeaderAutoWakeController as LeaderAutoWakeController2 } from "@wrongstack/core/coordination";
71
+ import { activeLeaderEffort } from "@wrongstack/core/execution";
71
72
  import { noOpVault } from "@wrongstack/core/security";
72
73
  import { attachTodosCheckpoint as attachTodosCheckpoint2, QueueStore } from "@wrongstack/core/storage";
73
74
  import { normalizeTokenSavingTier as normalizeTokenSavingTier2 } from "@wrongstack/core/types";
@@ -724,16 +725,12 @@ async function restoreDebugStreamCallback() {
724
725
 
725
726
  // src/boot/tui-goal-wiring.ts
726
727
  import { PHASE_EVENT_NAMES } from "@wrongstack/core/goal";
728
+ import { WORKTREE_EVENT_NAMES } from "@wrongstack/core/types/worktree-timeline";
727
729
  var GOAL_EVENTS = [
728
730
  ...PHASE_EVENT_NAMES,
729
731
  // Extra events not in PhaseEventMap (sourced from other subsystems)
730
732
  "sdd.board.snapshot",
731
- "worktree.allocated",
732
- "worktree.committed",
733
- "worktree.merged",
734
- "worktree.conflict",
735
- "worktree.released",
736
- "worktree.failed",
733
+ ...WORKTREE_EVENT_NAMES,
737
734
  "countdown.tick"
738
735
  ];
739
736
  function wireGoal(events) {
@@ -932,6 +929,7 @@ import { restoreRequiredSkillsFromEvents } from "@wrongstack/core/skills";
932
929
  import { DefaultSessionStore } from "@wrongstack/core/storage";
933
930
  import {
934
931
  activateProjectStateGuard,
932
+ clearLeaderEffortOverride,
935
933
  resolveWstackPaths,
936
934
  sessionScopedPath
937
935
  } from "@wrongstack/core/utils";
@@ -1042,6 +1040,7 @@ async function switchProjectInPlace(ctx, targetRoot, displayName) {
1042
1040
  context.state.replaceMessages([]);
1043
1041
  resetSessionSubagentPolicy(context);
1044
1042
  restoreSessionPermissionOverrides(context.meta, {});
1043
+ clearLeaderEffortOverride(context.meta);
1045
1044
  restoreRequiredSkillsFromEvents(context, []);
1046
1045
  context.state.replaceTodos([]);
1047
1046
  context.clearFileTracking();
@@ -1139,7 +1138,7 @@ async function switchProjectInPlace(ctx, targetRoot, displayName) {
1139
1138
 
1140
1139
  // src/boot/tui-sdd-callback.ts
1141
1140
  async function getSDDContext() {
1142
- const { getActiveSDDContext: getActiveSDDContext2 } = await import("./sdd-runtime-PTOSPYI4.js");
1141
+ const { getActiveSDDContext: getActiveSDDContext2 } = await import("./sdd-runtime-PF72WHLO.js");
1143
1142
  return getActiveSDDContext2();
1144
1143
  }
1145
1144
  async function onSDDOutput(output) {
@@ -1150,7 +1149,7 @@ async function onSDDOutput(output) {
1150
1149
  autoDetectTaskCompletion: autoDetectTaskCompletion2,
1151
1150
  getTaskProgress: getTaskProgress2,
1152
1151
  getActiveSDDPhase: getActiveSDDPhase2
1153
- } = await import("./sdd-runtime-PTOSPYI4.js");
1152
+ } = await import("./sdd-runtime-PF72WHLO.js");
1154
1153
  const messages = [];
1155
1154
  const specSaved = await trySaveSpecFromAIOutput2(output);
1156
1155
  if (specSaved) messages.push("\u2713 Spec detected and saved! Use /sdd approve to continue.");
@@ -1178,8 +1177,14 @@ async function onSDDOutput(output) {
1178
1177
  }
1179
1178
 
1180
1179
  // src/boot/tui-settings-adapter.ts
1181
- import { normalizeTokenSavingTier, resolveFleetChatVerbosity } from "@wrongstack/core/types";
1182
1180
  import { getProcessRegistry } from "@wrongstack/tools";
1181
+
1182
+ // src/boot/tui-settings-read.ts
1183
+ import {
1184
+ normalizeTokenSavingTier,
1185
+ resolveFleetChatVerbosity,
1186
+ resolveNextStepsMode
1187
+ } from "@wrongstack/core/types";
1183
1188
  var PANEL_IDS_CLI = [
1184
1189
  "projectPicker",
1185
1190
  "fleet",
@@ -1221,109 +1226,113 @@ var ANIMATION_STYLES = [
1221
1226
  function normalizeAnimationStyle(raw) {
1222
1227
  return typeof raw === "string" && ANIMATION_STYLES.includes(raw) ? raw : "rainbow";
1223
1228
  }
1229
+ function readTuiSettings(configStore) {
1230
+ const cfg = configStore.get();
1231
+ const autonomy = cfg.autonomy;
1232
+ const rawMode = autonomy?.defaultMode;
1233
+ const mode = rawMode === "suggest" || rawMode === "auto" ? rawMode : "off";
1234
+ const modelRuntime = cfg.modelRuntime;
1235
+ const contextModeRaw = cfg.context?.mode;
1236
+ const contextMode = contextModeRaw === "frugal" || contextModeRaw === "deep" ? contextModeRaw : "balanced";
1237
+ const reasoningEffortRaw = modelRuntime?.reasoning?.effort;
1238
+ const reasoningEffort = reasoningEffortRaw === "none" || reasoningEffortRaw === "minimal" || reasoningEffortRaw === "low" || reasoningEffortRaw === "medium" || reasoningEffortRaw === "high" || reasoningEffortRaw === "xhigh" || reasoningEffortRaw === "max" ? reasoningEffortRaw : "medium";
1239
+ const featuresAllow = cfg.features?.allowOutsideProjectRoot;
1240
+ const toolsRestrict = cfg.tools?.restrictToProjectRoot;
1241
+ const resolvedAllow = featuresAllow !== void 0 ? featuresAllow : toolsRestrict !== void 0 ? !toolsRestrict : true;
1242
+ const resolvedRestrict = !resolvedAllow;
1243
+ return {
1244
+ mode,
1245
+ delayMs: autonomy?.autoProceedDelayMs ?? 15e3,
1246
+ titleAnimation: autonomy?.terminalTitleAnimation !== false,
1247
+ yolo: cfg.yolo ?? autonomy?.yolo ?? true,
1248
+ fleetChatVerbosity: resolveFleetChatVerbosity(cfg.autonomy),
1249
+ chime: autonomy?.chime ?? true,
1250
+ confirmExit: autonomy?.confirmExit !== false,
1251
+ nextPrediction: cfg.nextPrediction ?? true,
1252
+ featureMcp: cfg.features?.mcp !== false,
1253
+ featurePlugins: cfg.features?.plugins !== false,
1254
+ featureMemory: cfg.features?.memory !== false,
1255
+ featureSkills: cfg.features?.skills !== false,
1256
+ featureModelsRegistry: cfg.features?.modelsRegistry !== false,
1257
+ featureToolCoach: cfg.features?.toolCoach !== false,
1258
+ // Preserve the 'auto' sentinel for the picker DISPLAY (normalize would
1259
+ // collapse it to 'off', which would then overwrite 'auto' on save);
1260
+ // everything else normalizes to a concrete tier.
1261
+ featureTokenSaving: cfg.features?.tokenSavingMode === "auto" ? "auto" : normalizeTokenSavingTier(cfg.features?.tokenSavingMode),
1262
+ allowOutsideProjectRoot: resolvedAllow,
1263
+ contextAutoCompact: cfg.context?.autoCompact !== false,
1264
+ contextStrategy: cfg.context?.strategy ?? "hybrid",
1265
+ contextMode,
1266
+ maxConcurrent: cfg.maxConcurrent ?? 10,
1267
+ logLevel: cfg.log?.level ?? "warn",
1268
+ auditLevel: cfg.session?.auditLevel ?? "full",
1269
+ indexOnStart: cfg.indexing?.onSessionStart !== false,
1270
+ maxIterations: cfg.tools?.maxIterations ?? 0,
1271
+ // Multi-diff summary threshold — mirrors the WebUI parity path
1272
+ // (pref-helpers.ts reads/writes `decrypted.autonomy.multiDiffSummaryThreshold`;
1273
+ // here we read from `decrypted.tools.multiDiffSummaryThreshold` to
1274
+ // match the Tools-section write gate added in saveSettings).
1275
+ multiDiffSummaryThreshold: cfg.tools?.multiDiffSummaryThreshold ?? 5,
1276
+ nextStepsTool: cfg.tools?.nextsteps?.enabled === true,
1277
+ nextStepsRequired: resolveNextStepsMode(autonomy?.nextSteps) === "required",
1278
+ restrictFsToRoot: resolvedRestrict,
1279
+ autoProceedMaxIterations: cfg.autonomy?.autoProceedMaxIterations ?? 0,
1280
+ debugStream: cfg.debugStream ?? false,
1281
+ shellBangWarningDontShowAgain: autonomy?.shellBangWarningDontShowAgain === true,
1282
+ statuslineMode: autonomy?.statuslineMode === "no-color" ? "no-color" : autonomy?.statuslineMode === "detailed" ? "detailed" : "minimum",
1283
+ thinkingWord: normalizeTuiThinkingWord(autonomy?.thinkingWord),
1284
+ animationStyle: normalizeAnimationStyle(autonomy?.animationStyle),
1285
+ configScope: cfg.configScope ?? "global",
1286
+ systemPromptVariant: cfg.systemPrompt?.variant === "lite" || cfg.systemPrompt?.variant === "pro" || cfg.systemPrompt?.variant === "scout" ? cfg.systemPrompt.variant : cfg.systemPrompt?.variant === "default" ? "default" : "pro",
1287
+ enhanceDelayMs: cfg.autonomy?.enhanceDelayMs ?? 15e3,
1288
+ enhanceEnabled: cfg.autonomy?.enhance ?? true,
1289
+ preRefineSeconds: cfg.autonomy?.preRefineSeconds ?? 3,
1290
+ enhanceLanguage: cfg.autonomy?.enhanceLanguage === "english" ? "english" : cfg.autonomy?.enhanceLanguage === "original" ? "original" : "english",
1291
+ enhanceRetryTimeoutMs: cfg.autonomy?.enhanceRetryTimeoutMs,
1292
+ midRunSendPicker: cfg.autonomy?.midRunSendPicker ?? true,
1293
+ mouseMode: autonomy?.mouseMode ?? false,
1294
+ autonomyNextPrompt: cfg.autonomy?.autonomyNextPrompt ?? "auto {{suggestion}}",
1295
+ reasoningMode: modelRuntime?.reasoning?.mode === "on" || modelRuntime?.reasoning?.mode === "off" ? modelRuntime.reasoning.mode : "auto",
1296
+ reasoningEffort,
1297
+ reasoningPreserve: modelRuntime?.reasoning?.preserve === true,
1298
+ cacheTtl: modelRuntime?.cache?.ttl === "5m" || modelRuntime?.cache?.ttl === "1h" ? modelRuntime.cache.ttl : "default",
1299
+ breakerEnabled: cfg.circuitBreaker?.enabled === true,
1300
+ breakerAutoKillResetMs: cfg.circuitBreaker?.autoKillResetMs ?? 6e4,
1301
+ showModelReasoning: autonomy?.showModelReasoning ?? false,
1302
+ toolResultViewMode: autonomy?.toolResultViewMode === "minimal" || autonomy?.toolResultViewMode === "full" ? autonomy.toolResultViewMode : "normal",
1303
+ showAgentSwarmPanel: coerceAgentSwarmMode(autonomy?.showAgentSwarmPanel),
1304
+ showSidebar: autonomy?.showSidebar ?? true,
1305
+ lastSettingsField: autonomy?.lastSettingsField ?? 0,
1306
+ // Migrate the legacy `autonomy.showAgentSwarmPanel: 'sidebar'` into
1307
+ // the new per-panel `panelPositions.fleet` map at the read boundary
1308
+ // so users with old configs (no `panelPositions` key on disk) get
1309
+ // their sidebar routing. Only migrate when the per-panel key is
1310
+ // UNDEFINED — an explicit `panelPositions.fleet: 'bottom'` must
1311
+ // NOT be reverted to `'sidebar'`.
1312
+ panelPositions: coercePanelPositionMap({
1313
+ ...autonomy?.panelPositions,
1314
+ ...coerceAgentSwarmMode(autonomy?.showAgentSwarmPanel) === "sidebar" && autonomy?.panelPositions?.fleet === void 0 ? { fleet: "sidebar" } : {}
1315
+ }),
1316
+ showSageMemoryInject: autonomy?.showSageMemoryInject ?? false,
1317
+ readSymbols: autonomy?.readAdvancedMode ?? false,
1318
+ sageMemoryInjectThreshold: cfg.Sage?.inject ? cfg.Sage.inject?.relationFloor : void 0,
1319
+ // WrongProxy / WrongTrace: read from `tools.wrongProxy.{enabled,url}`
1320
+ // so the persistence shape mirrors the WebUI `LocalPrefs` shape
1321
+ // (single object with two fields, not two top-level keys). The
1322
+ // canonical type is `ToolsConfig.wrongProxy?: WrongProxyToolConfig`
1323
+ // — no index-signature widening cast needed.
1324
+ wrongProxyEnabled: cfg.tools?.wrongProxy?.enabled === true,
1325
+ wrongProxyUrl: cfg.tools?.wrongProxy?.url
1326
+ };
1327
+ }
1328
+
1329
+ // src/boot/tui-settings-adapter.ts
1224
1330
  function createSettingsAdapter(ctx) {
1225
1331
  const { configStore, wpaths, vault, fleetStreamController, applyLiveSettings } = ctx;
1226
1332
  const deriveFsAccess = deriveFsAccessPair;
1227
- function getSettings() {
1228
- const cfg = configStore.get();
1229
- const autonomy = cfg.autonomy;
1230
- const rawMode = autonomy?.defaultMode;
1231
- const mode = rawMode === "suggest" || rawMode === "auto" ? rawMode : "off";
1232
- const modelRuntime = cfg.modelRuntime;
1233
- const contextModeRaw = cfg.context?.mode;
1234
- const contextMode = contextModeRaw === "frugal" || contextModeRaw === "deep" ? contextModeRaw : "balanced";
1235
- const reasoningEffortRaw = modelRuntime?.reasoning?.effort;
1236
- const reasoningEffort = reasoningEffortRaw === "none" || reasoningEffortRaw === "minimal" || reasoningEffortRaw === "low" || reasoningEffortRaw === "medium" || reasoningEffortRaw === "high" || reasoningEffortRaw === "xhigh" || reasoningEffortRaw === "max" ? reasoningEffortRaw : "medium";
1237
- const featuresAllow = cfg.features?.allowOutsideProjectRoot;
1238
- const toolsRestrict = cfg.tools?.restrictToProjectRoot;
1239
- const resolvedAllow = featuresAllow !== void 0 ? featuresAllow : toolsRestrict !== void 0 ? !toolsRestrict : true;
1240
- const resolvedRestrict = !resolvedAllow;
1241
- return {
1242
- mode,
1243
- delayMs: autonomy?.autoProceedDelayMs ?? 15e3,
1244
- titleAnimation: autonomy?.terminalTitleAnimation !== false,
1245
- yolo: cfg.yolo ?? autonomy?.yolo ?? true,
1246
- fleetChatVerbosity: resolveFleetChatVerbosity(cfg.autonomy),
1247
- chime: autonomy?.chime ?? true,
1248
- confirmExit: autonomy?.confirmExit !== false,
1249
- nextPrediction: cfg.nextPrediction ?? true,
1250
- featureMcp: cfg.features?.mcp !== false,
1251
- featurePlugins: cfg.features?.plugins !== false,
1252
- featureMemory: cfg.features?.memory !== false,
1253
- featureSkills: cfg.features?.skills !== false,
1254
- featureModelsRegistry: cfg.features?.modelsRegistry !== false,
1255
- featureToolCoach: cfg.features?.toolCoach !== false,
1256
- // Preserve the 'auto' sentinel for the picker DISPLAY (normalize would
1257
- // collapse it to 'off', which would then overwrite 'auto' on save);
1258
- // everything else normalizes to a concrete tier.
1259
- featureTokenSaving: cfg.features?.tokenSavingMode === "auto" ? "auto" : normalizeTokenSavingTier(cfg.features?.tokenSavingMode),
1260
- allowOutsideProjectRoot: resolvedAllow,
1261
- contextAutoCompact: cfg.context?.autoCompact !== false,
1262
- contextStrategy: cfg.context?.strategy ?? "hybrid",
1263
- contextMode,
1264
- maxConcurrent: cfg.maxConcurrent ?? 10,
1265
- logLevel: cfg.log?.level ?? "warn",
1266
- auditLevel: cfg.session?.auditLevel ?? "full",
1267
- indexOnStart: cfg.indexing?.onSessionStart !== false,
1268
- maxIterations: cfg.tools?.maxIterations ?? 0,
1269
- // Multi-diff summary threshold — mirrors the WebUI parity path
1270
- // (pref-helpers.ts reads/writes `decrypted.autonomy.multiDiffSummaryThreshold`;
1271
- // here we read from `decrypted.tools.multiDiffSummaryThreshold` to
1272
- // match the Tools-section write gate added in saveSettings).
1273
- multiDiffSummaryThreshold: cfg.tools?.multiDiffSummaryThreshold ?? 5,
1274
- nextStepsTool: cfg.tools?.nextsteps?.enabled === true,
1275
- restrictFsToRoot: resolvedRestrict,
1276
- autoProceedMaxIterations: cfg.autonomy?.autoProceedMaxIterations ?? 0,
1277
- debugStream: cfg.debugStream ?? false,
1278
- shellBangWarningDontShowAgain: autonomy?.shellBangWarningDontShowAgain === true,
1279
- statuslineMode: autonomy?.statuslineMode === "no-color" ? "no-color" : autonomy?.statuslineMode === "detailed" ? "detailed" : "minimum",
1280
- thinkingWord: normalizeTuiThinkingWord(autonomy?.thinkingWord),
1281
- animationStyle: normalizeAnimationStyle(autonomy?.animationStyle),
1282
- configScope: cfg.configScope ?? "global",
1283
- systemPromptVariant: cfg.systemPrompt?.variant === "lite" || cfg.systemPrompt?.variant === "pro" || cfg.systemPrompt?.variant === "scout" ? cfg.systemPrompt.variant : cfg.systemPrompt?.variant === "default" ? "default" : "pro",
1284
- enhanceDelayMs: cfg.autonomy?.enhanceDelayMs ?? 15e3,
1285
- enhanceEnabled: cfg.autonomy?.enhance ?? true,
1286
- preRefineSeconds: cfg.autonomy?.preRefineSeconds ?? 3,
1287
- enhanceLanguage: cfg.autonomy?.enhanceLanguage === "english" ? "english" : cfg.autonomy?.enhanceLanguage === "original" ? "original" : "english",
1288
- midRunSendPicker: cfg.autonomy?.midRunSendPicker ?? true,
1289
- mouseMode: autonomy?.mouseMode ?? false,
1290
- autonomyNextPrompt: cfg.autonomy?.autonomyNextPrompt ?? "auto {{suggestion}}",
1291
- reasoningMode: modelRuntime?.reasoning?.mode === "on" || modelRuntime?.reasoning?.mode === "off" ? modelRuntime.reasoning.mode : "auto",
1292
- reasoningEffort,
1293
- reasoningPreserve: modelRuntime?.reasoning?.preserve === true,
1294
- cacheTtl: modelRuntime?.cache?.ttl === "5m" || modelRuntime?.cache?.ttl === "1h" ? modelRuntime.cache.ttl : "default",
1295
- breakerEnabled: cfg.circuitBreaker?.enabled === true,
1296
- breakerAutoKillResetMs: cfg.circuitBreaker?.autoKillResetMs ?? 6e4,
1297
- showModelReasoning: autonomy?.showModelReasoning ?? false,
1298
- toolResultViewMode: autonomy?.toolResultViewMode === "minimal" || autonomy?.toolResultViewMode === "full" ? autonomy.toolResultViewMode : "normal",
1299
- showAgentSwarmPanel: coerceAgentSwarmMode(autonomy?.showAgentSwarmPanel),
1300
- showSidebar: autonomy?.showSidebar ?? true,
1301
- lastSettingsField: autonomy?.lastSettingsField ?? 0,
1302
- // Migrate the legacy `autonomy.showAgentSwarmPanel: 'sidebar'` into
1303
- // the new per-panel `panelPositions.fleet` map at the read boundary
1304
- // so users with old configs (no `panelPositions` key on disk) get
1305
- // their sidebar routing. Only migrate when the per-panel key is
1306
- // UNDEFINED — an explicit `panelPositions.fleet: 'bottom'` must
1307
- // NOT be reverted to `'sidebar'`.
1308
- panelPositions: coercePanelPositionMap({
1309
- ...autonomy?.panelPositions,
1310
- ...coerceAgentSwarmMode(autonomy?.showAgentSwarmPanel) === "sidebar" && autonomy?.panelPositions?.fleet === void 0 ? { fleet: "sidebar" } : {}
1311
- }),
1312
- showSageMemoryInject: autonomy?.showSageMemoryInject ?? false,
1313
- readSymbols: autonomy?.readAdvancedMode ?? false,
1314
- sageMemoryInjectThreshold: cfg.Sage?.inject ? cfg.Sage.inject?.relationFloor : void 0,
1315
- // WrongProxy / WrongTrace: read from `tools.wrongProxy.{enabled,url}`
1316
- // so the persistence shape mirrors the WebUI `LocalPrefs` shape
1317
- // (single object with two fields, not two top-level keys). The
1318
- // canonical type is `ToolsConfig.wrongProxy?: WrongProxyToolConfig`
1319
- // — no index-signature widening cast needed.
1320
- wrongProxyEnabled: cfg.tools?.wrongProxy?.enabled === true,
1321
- wrongProxyUrl: cfg.tools?.wrongProxy?.url
1322
- };
1323
- }
1324
1333
  async function saveSettings(s) {
1325
1334
  try {
1326
- if (s.mode !== void 0 || s.delayMs !== void 0 || s.titleAnimation !== void 0 || s.yolo !== void 0 || s.fleetChatVerbosity !== void 0 || s.chime !== void 0 || s.confirmExit !== void 0 || s.mouseMode !== void 0 || s.featureMcp !== void 0 || s.featurePlugins !== void 0 || s.featureMemory !== void 0 || s.featureSkills !== void 0 || s.featureModelsRegistry !== void 0 || s.featureToolCoach !== void 0 || s.featureTokenSaving !== void 0 || s.allowOutsideProjectRoot !== void 0 || s.contextAutoCompact !== void 0 || s.contextStrategy !== void 0 || s.contextMode !== void 0 || s.maxConcurrent !== void 0 || s.logLevel !== void 0 || s.auditLevel !== void 0 || s.indexOnStart !== void 0 || s.maxIterations !== void 0 || s.multiDiffSummaryThreshold !== void 0 || s.nextStepsTool !== void 0 || s.restrictFsToRoot !== void 0 || s.nextPrediction !== void 0 || s.debugStream !== void 0 || s.shellBangWarningDontShowAgain !== void 0 || s.configScope !== void 0 || s.enhanceDelayMs !== void 0 || s.enhanceEnabled !== void 0 || s.preRefineSeconds !== void 0 || s.enhanceLanguage !== void 0 || s.midRunSendPicker !== void 0 || s.statuslineMode !== void 0 || s.thinkingWord !== void 0 || s.animationStyle !== void 0 || s.autonomyNextPrompt !== void 0 || s.autoProceedMaxIterations !== void 0 || s.reasoningMode !== void 0 || s.reasoningEffort !== void 0 || s.reasoningPreserve !== void 0 || s.cacheTtl !== void 0 || s.breakerEnabled !== void 0 || s.breakerAutoKillResetMs !== void 0 || s.showModelReasoning !== void 0 || s.toolResultViewMode !== void 0 || s.showAgentSwarmPanel !== void 0 || s.showSidebar !== void 0 || s.panelPositions !== void 0 || s.lastSettingsField !== void 0 || s.showSageMemoryInject !== void 0 || s.sageMemoryInjectThreshold !== void 0 || s.readSymbols !== void 0 || // WrongProxy / WrongTrace: gate the persisted-section write on
1335
+ if (s.mode !== void 0 || s.delayMs !== void 0 || s.titleAnimation !== void 0 || s.yolo !== void 0 || s.fleetChatVerbosity !== void 0 || s.chime !== void 0 || s.confirmExit !== void 0 || s.mouseMode !== void 0 || s.featureMcp !== void 0 || s.featurePlugins !== void 0 || s.featureMemory !== void 0 || s.featureSkills !== void 0 || s.featureModelsRegistry !== void 0 || s.featureToolCoach !== void 0 || s.featureTokenSaving !== void 0 || s.allowOutsideProjectRoot !== void 0 || s.contextAutoCompact !== void 0 || s.contextStrategy !== void 0 || s.contextMode !== void 0 || s.maxConcurrent !== void 0 || s.logLevel !== void 0 || s.auditLevel !== void 0 || s.indexOnStart !== void 0 || s.maxIterations !== void 0 || s.multiDiffSummaryThreshold !== void 0 || s.nextStepsTool !== void 0 || s.nextStepsRequired !== void 0 || s.restrictFsToRoot !== void 0 || s.nextPrediction !== void 0 || s.debugStream !== void 0 || s.shellBangWarningDontShowAgain !== void 0 || s.configScope !== void 0 || s.enhanceDelayMs !== void 0 || s.enhanceEnabled !== void 0 || s.preRefineSeconds !== void 0 || s.enhanceLanguage !== void 0 || s.midRunSendPicker !== void 0 || s.statuslineMode !== void 0 || s.thinkingWord !== void 0 || s.animationStyle !== void 0 || s.autonomyNextPrompt !== void 0 || s.autoProceedMaxIterations !== void 0 || s.reasoningMode !== void 0 || s.reasoningEffort !== void 0 || s.reasoningPreserve !== void 0 || s.cacheTtl !== void 0 || s.breakerEnabled !== void 0 || s.breakerAutoKillResetMs !== void 0 || s.showModelReasoning !== void 0 || s.toolResultViewMode !== void 0 || s.showAgentSwarmPanel !== void 0 || s.showSidebar !== void 0 || s.panelPositions !== void 0 || s.lastSettingsField !== void 0 || s.showSageMemoryInject !== void 0 || s.sageMemoryInjectThreshold !== void 0 || s.readSymbols !== void 0 || // WrongProxy / WrongTrace: gate the persisted-section write on
1327
1336
  // either key being present in the live patch. Without this, a
1328
1337
  // picker toggle round-trip would silently no-op the persistence
1329
1338
  // layer (the runtime probe would never read the change).
@@ -1382,6 +1391,8 @@ function createSettingsAdapter(ctx) {
1382
1391
  autonomy.autonomyNextPrompt = s.autonomyNextPrompt;
1383
1392
  if (s.autoProceedMaxIterations !== void 0)
1384
1393
  autonomy.autoProceedMaxIterations = s.autoProceedMaxIterations;
1394
+ if (s.nextStepsRequired !== void 0)
1395
+ autonomy.nextSteps = s.nextStepsRequired ? "required" : "optional";
1385
1396
  decrypted.autonomy = autonomy;
1386
1397
  if (s.nextPrediction !== void 0) decrypted.nextPrediction = s.nextPrediction;
1387
1398
  if (s.yolo !== void 0) decrypted.yolo = s.yolo;
@@ -1485,15 +1496,17 @@ function createSettingsAdapter(ctx) {
1485
1496
  }
1486
1497
  });
1487
1498
  const effectiveScope = s.configScope ?? cfg.configScope;
1488
- const hasProfileOnlySettings = s.mode !== void 0 || s.yolo !== void 0 || fsAccess !== void 0 || s.maxIterations !== void 0 || s.wrongProxyEnabled !== void 0 || s.wrongProxyUrl !== void 0;
1499
+ const hasProfileOnlySettings = s.mode !== void 0 || s.yolo !== void 0 || s.nextStepsRequired !== void 0 || fsAccess !== void 0 || s.maxIterations !== void 0 || s.wrongProxyEnabled !== void 0 || s.wrongProxyUrl !== void 0;
1489
1500
  if (effectiveScope === "project" && hasProfileOnlySettings) {
1490
1501
  await persistConfigSetting(
1491
1502
  { ...persistDeps, forceGlobal: true, updateStore: false },
1492
1503
  (profileConfig) => {
1493
- if (s.mode !== void 0 || s.yolo !== void 0) {
1504
+ if (s.mode !== void 0 || s.yolo !== void 0 || s.nextStepsRequired !== void 0) {
1494
1505
  const autonomy = profileConfig.autonomy ?? {};
1495
1506
  if (s.mode !== void 0) autonomy.defaultMode = s.mode;
1496
1507
  if (s.yolo !== void 0) autonomy.yolo = s.yolo;
1508
+ if (s.nextStepsRequired !== void 0)
1509
+ autonomy.nextSteps = s.nextStepsRequired ? "required" : "optional";
1497
1510
  profileConfig.autonomy = autonomy;
1498
1511
  }
1499
1512
  if (s.yolo !== void 0) profileConfig.yolo = s.yolo;
@@ -1626,7 +1639,7 @@ function createSettingsAdapter(ctx) {
1626
1639
  return message;
1627
1640
  }
1628
1641
  }
1629
- return { getSettings, saveSettings };
1642
+ return { getSettings: () => readTuiSettings(configStore), saveSettings };
1630
1643
  }
1631
1644
 
1632
1645
  // src/boot/tui-theme-adapter.ts
@@ -2039,6 +2052,7 @@ import { emitReviewIfChanged } from "@wrongstack/core/plugin";
2039
2052
 
2040
2053
  // src/chimera-cascade-evidence.ts
2041
2054
  import { spawn as spawn2 } from "node:child_process";
2055
+ import { treeKill } from "@wrongstack/core/utils/tree-kill";
2042
2056
  import {
2043
2057
  buildWin32CmdShimInvocation,
2044
2058
  isWinCmdShim,
@@ -2150,15 +2164,28 @@ var runCascadeVerificationCommand = (command, cwd, timeoutMs) => {
2150
2164
  cwd,
2151
2165
  stdio: "ignore",
2152
2166
  windowsHide: true,
2153
- signal: AbortSignal.timeout(timeoutMs),
2154
2167
  ...windowsVerbatimArguments ? { windowsVerbatimArguments } : {}
2155
2168
  });
2156
2169
  } catch {
2157
2170
  resolve5({ exitCode: CASCADE_EVIDENCE_RUN_ERROR_EXIT });
2158
2171
  return;
2159
2172
  }
2160
- child.on("error", () => resolve5({ exitCode: CASCADE_EVIDENCE_RUN_ERROR_EXIT }));
2161
- child.on("close", (code) => resolve5({ exitCode: code ?? CASCADE_EVIDENCE_RUN_ERROR_EXIT }));
2173
+ const spawned = child;
2174
+ let timedOut = false;
2175
+ const timer = setTimeout(() => {
2176
+ timedOut = true;
2177
+ treeKill(spawned);
2178
+ }, timeoutMs);
2179
+ child.on("error", () => {
2180
+ clearTimeout(timer);
2181
+ resolve5({ exitCode: CASCADE_EVIDENCE_RUN_ERROR_EXIT });
2182
+ });
2183
+ child.on("close", (code) => {
2184
+ clearTimeout(timer);
2185
+ resolve5({
2186
+ exitCode: timedOut ? CASCADE_EVIDENCE_RUN_ERROR_EXIT : code ?? CASCADE_EVIDENCE_RUN_ERROR_EXIT
2187
+ });
2188
+ });
2162
2189
  });
2163
2190
  };
2164
2191
  async function verifyCascadeEvidence(evidence, cwd, runCommand = runCascadeVerificationCommand, timeoutMs = CASCADE_EVIDENCE_COMMAND_TIMEOUT_MS) {
@@ -5197,7 +5224,7 @@ async function runWebUIDispatch(ctx) {
5197
5224
  const isSimpleUi = !isSessionChild && flags["simpleui"] === true;
5198
5225
  agent.disableInteractiveConfirmation();
5199
5226
  renderer.setSilent(true);
5200
- const { runWebUI } = await import("./webui-server-GQOVLQS3.js");
5227
+ const { runWebUI } = await import("./webui-server-CUIFA25W.js");
5201
5228
  const flagValue = (names) => {
5202
5229
  for (const name of names) {
5203
5230
  if (!Object.hasOwn(flags, name)) continue;
@@ -6423,9 +6450,14 @@ import { restoreSessionPermissionOverrides as restoreSessionPermissionOverrides2
6423
6450
  import { restoreRequiredSkillsFromEvents as restoreRequiredSkillsFromEvents2 } from "@wrongstack/core/skills";
6424
6451
  import { attachTodosCheckpoint, loadTodosCheckpoint } from "@wrongstack/core/storage";
6425
6452
  import { projectLastRequestTokens } from "@wrongstack/core/types/session-timeline";
6426
- import { sessionScopedPath as sessionScopedPath2, toErrorMessage as toErrorMessage4 } from "@wrongstack/core/utils";
6427
- var RESERVATION_WINDOW_MS = 6e4;
6428
- var RESERVATION_RENEW_MS = 2e4;
6453
+ import {
6454
+ clearLeaderEffortOverride as clearLeaderEffortOverride2,
6455
+ restoreLeaderEffortOverride,
6456
+ sessionScopedPath as sessionScopedPath2,
6457
+ toErrorMessage as toErrorMessage4
6458
+ } from "@wrongstack/core/utils";
6459
+
6460
+ // src/boot/tui-session-resume-contracts.ts
6429
6461
  function messageText(content) {
6430
6462
  if (typeof content === "string") return content;
6431
6463
  if (!Array.isArray(content)) return "";
@@ -6442,6 +6474,10 @@ function lastAssistantTextOf(messages) {
6442
6474
  }
6443
6475
  return void 0;
6444
6476
  }
6477
+
6478
+ // src/boot/tui-session-resume.ts
6479
+ var RESERVATION_WINDOW_MS = 6e4;
6480
+ var RESERVATION_RENEW_MS = 2e4;
6445
6481
  async function resumeSession(ctx, sessionId) {
6446
6482
  const { state, agent, tokenCounter, switchProviderAndModel, events, onLoadProgress } = ctx;
6447
6483
  const fail = (stage2, message) => {
@@ -6603,6 +6639,8 @@ async function resumeSession(ctx, sessionId) {
6603
6639
  restoreSessionSubagentModelPlan(agent.ctx, resumed.data.events);
6604
6640
  restoreSessionPermissionOverrides2(agent.ctx.meta, resumed.data);
6605
6641
  restoreRequiredSkillsFromEvents2(agent.ctx, resumed.data.events);
6642
+ clearLeaderEffortOverride2(agent.ctx.meta);
6643
+ restoreLeaderEffortOverride(agent.ctx.meta, resumed.data.events);
6606
6644
  } catch (err) {
6607
6645
  agent.ctx.session = oldWriter;
6608
6646
  agent.ctx.state.replaceMessages(oldMessages);
@@ -7079,7 +7117,7 @@ async function execute(deps) {
7079
7117
  });
7080
7118
  }
7081
7119
  if (executionMode !== "single-shot" && !webuiSessionChild) {
7082
- autoUpdate = (await import("./standalone-auto-update-VQC4GYCM.js")).startStandaloneAutoUpdate({
7120
+ autoUpdate = (await import("./standalone-auto-update-QUXOZ4B5.js")).startStandaloneAutoUpdate({
7083
7121
  getConfig: () => configStore.get(),
7084
7122
  updateInfo: bootUpdateInfo
7085
7123
  });
@@ -7275,6 +7313,7 @@ async function execute(deps) {
7275
7313
  applyLiveSettings
7276
7314
  }),
7277
7315
  ...createThemeAdapter({ configStore, wpaths }),
7316
+ getLeaderEffort: () => activeLeaderEffort(context.meta, configStore.get().modelRuntime?.reasoning?.effort),
7278
7317
  configStore,
7279
7318
  effectiveMaxContext,
7280
7319
  titleAnimation: config.autonomy?.["terminalTitleAnimation"] ?? true,
@@ -7495,4 +7534,4 @@ export {
7495
7534
  execute,
7496
7535
  resolveReviewerFallbackModels
7497
7536
  };
7498
- //# sourceMappingURL=execution-C2IECWF7.js.map
7537
+ //# sourceMappingURL=execution-M7D4KNBB.js.map
@@ -0,0 +1,41 @@
1
+ import { AdaptiveConcurrencyController, type DefaultMultiAgentCoordinator, Director, type DirectorSessionFactory, type TaskResultNotification } from '@wrongstack/core/coordination';
2
+ import type { Config, SubagentConfig, SubagentRunner, TaskResult, Tool } from '@wrongstack/core/types';
3
+ import { type ExploreCompanionRegistry } from './host-explore-companion-registry.js';
4
+ import type { HostLearningScheduler } from './host-learning-scheduler.js';
5
+ import { HostMemoryCompanion } from './host-memory-companion.js';
6
+ import type { HostShadowManager } from './host-shadow-manager.js';
7
+ import type { MultiAgentDeps, MultiAgentHostOptions } from './host-types.js';
8
+ export interface HostDirectorSetupHost {
9
+ director: Director | undefined;
10
+ deps: MultiAgentDeps;
11
+ learningScheduler: HostLearningScheduler;
12
+ opts: MultiAgentHostOptions;
13
+ fleetManager: import('@wrongstack/core/coordination').FleetManager | undefined;
14
+ sessionFactory: DirectorSessionFactory | undefined;
15
+ roster: Record<string, SubagentConfig>;
16
+ reportTaskResultToLeader(n: TaskResultNotification): Promise<void>;
17
+ captureCompletedTaskLearning(result: TaskResult): void;
18
+ shadowManager: HostShadowManager;
19
+ emitLifecycleCompleted(taskId: string, result: TaskResult): void;
20
+ statusBroadcaster: {
21
+ start(): void;
22
+ stop(): void;
23
+ } | null;
24
+ mailboxProjectDir(): string;
25
+ buildFleetSupervisor(config: Config): void;
26
+ exploreCompanions: ExploreCompanionRegistry | null;
27
+ memoryCompanion: HostMemoryCompanion | null;
28
+ exploreCompanionOff: (() => void) | null;
29
+ directorOffHandles: Array<() => void>;
30
+ sessionForSubagent(subagentId: string): string;
31
+ getCoordinator(): DefaultMultiAgentCoordinator;
32
+ coordinatorOffHandle: (() => void) | null;
33
+ fleetEmitTool: import('@wrongstack/core/types').Tool | undefined;
34
+ directorToolsByName: Map<string, Tool<unknown, unknown>>;
35
+ adaptiveConcurrencyController: AdaptiveConcurrencyController | undefined;
36
+ getMaxConcurrent(): number;
37
+ buildSubagentRunner(config: Config): Promise<SubagentRunner>;
38
+ directorRunnerSet: boolean;
39
+ }
40
+ export declare function buildDirector(host: HostDirectorSetupHost): Promise<void>;
41
+ //# sourceMappingURL=host-director-setup.d.ts.map
@@ -6,6 +6,23 @@ export interface HostSpawnOptions {
6
6
  name?: string | undefined;
7
7
  allowedCapabilities?: readonly string[] | undefined;
8
8
  shadowIntervalMs?: number | undefined;
9
+ /**
10
+ * Opt into model-driven completion (mirrors the Chimera reviewer policy).
11
+ *
12
+ * At the leader's session end, `finalizeExecutionCleanup` calls
13
+ * `director.requestFinish()`, which notifies ONLY the subagents that set
14
+ * this. An opted-in worker receives an in-band `subagent.finish_requested`
15
+ * between tool batches and is granted a grace window to finish and deliver
16
+ * its result during the drain that precedes `director.terminateAll()`.
17
+ *
18
+ * Without it the subagent is skipped by that notification and then hard-
19
+ * aborted by the terminal sweep — its work is lost mid-flight. Required for
20
+ * background auditors whose deliverable is a mailbox report rather than a
21
+ * value the leader is still awaiting.
22
+ */
23
+ gracefulFinish?: boolean | {
24
+ graceMs?: number | undefined;
25
+ } | undefined;
9
26
  /**
10
27
  * Conversation on whose behalf this spawn happens.
11
28
  *
@@ -1,4 +1,4 @@
1
- import { type AgentFactory, Director } from '@wrongstack/core/coordination';
1
+ import { type AgentFactory, type Director } from '@wrongstack/core/coordination';
2
2
  import type { SubagentRunner } from '@wrongstack/core/types';
3
3
  import { type Config, type SubagentConfig, type TaskResult } from '@wrongstack/core/types';
4
4
  import type { HostSpawnAndWaitOptions, HostSpawnOptions } from './host-spawn-types.js';
@@ -162,5 +162,6 @@ export declare class MultiAgentHost {
162
162
  dispose(): Promise<void>;
163
163
  private hostAcpRunnerHost;
164
164
  private hostBudgetHost;
165
+ private hostDirectorSetupHost;
165
166
  }
166
167
  //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { TaskNode } from '@wrongstack/core/types';
2
+ export declare function buildTaskPrompt(task: TaskNode, phaseName: string, goal: string): string;
3
+ export declare function buildRepairPrompt(phaseName: string, failure: string, goal: string): string;
4
+ export declare function buildConflictPrompt(files: string[], goal: string): string;
5
+ //# sourceMappingURL=goal-host-prompts.d.ts.map