@wrongstack/cli 1.0.32 → 1.0.35

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 (126) hide show
  1. package/data/providers.json +322 -2
  2. package/dist/{acp-EDGUWU7N.js → acp-T77EAEDB.js} +469 -465
  3. package/dist/{auth-SUHKFFO4.js → auth-M6LXZTDA.js} +4 -4
  4. package/dist/auth-menu/openai-codex-oauth.d.ts +1 -1
  5. package/dist/auth-menu/panel-provider-edits.d.ts +15 -0
  6. package/dist/auth-menu/panel-service.d.ts +1 -1
  7. package/dist/auto-discover-providers-JX346GOM.js +7 -0
  8. package/dist/boot/governance-evidence-candidate.d.ts +1 -2
  9. package/dist/boot/system-prompt-builder.d.ts +1 -1
  10. package/dist/boot/tui-project-spawn.d.ts +0 -1
  11. package/dist/boot/tui-session-resume-contracts.d.ts +95 -0
  12. package/dist/boot/tui-session-resume.d.ts +2 -88
  13. package/dist/boot/tui-settings-read.d.ts +3 -0
  14. package/dist/{boot-auto-thin-K2DHHYIW.js → boot-auto-thin-YMAZI3QL.js} +2 -2
  15. package/dist/boot-launch-choices.d.ts +22 -0
  16. package/dist/boot-provider-gate.d.ts +28 -0
  17. package/dist/boot-subcommand-dispatch.d.ts +24 -0
  18. package/dist/boot.d.ts +1 -1
  19. package/dist/chimera-cascade-evidence.d.ts +1 -1
  20. package/dist/{chunk-TI7KLHYX.js → chunk-2CMMWRQH.js} +81 -80
  21. package/dist/{chunk-3LEFXLAW.js → chunk-6SIUTX75.js} +36 -36
  22. package/dist/{chunk-RQ4UBKYH.js → chunk-6Z6C6ZHH.js} +3 -3
  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-U3SS4NRH.js → chunk-BHXAKTBE.js} +1 -1
  27. package/dist/{chunk-MPQCHBDJ.js → chunk-CJSHS2K7.js} +5 -1
  28. package/dist/{chunk-P3GRLV47.js → chunk-GZSKLXYG.js} +208 -141
  29. package/dist/{chunk-4MDRHMX4.js → chunk-KMU7GF7X.js} +3 -26
  30. package/dist/{chunk-WXJH4F6K.js → chunk-LDV4ERNV.js} +4 -4
  31. package/dist/{chunk-LIZXJHZQ.js → chunk-LDXXMPMS.js} +13 -13
  32. package/dist/{chunk-UQUYBDMG.js → chunk-M4G5FO7F.js} +1 -1
  33. package/dist/{chunk-CFHWIFXL.js → chunk-PA4VBCXS.js} +25 -33
  34. package/dist/{chunk-5UZBUV2H.js → chunk-RKU66D2O.js} +6 -4
  35. package/dist/{chunk-PGNERAZL.js → chunk-RWNI5OWT.js} +2 -2
  36. package/dist/chunk-TGSPCFBT.js +1 -0
  37. package/dist/{cli-context-ITHGP2CE.js → cli-context-II57EHD2.js} +1555 -1451
  38. package/dist/cli-initial-tools.d.ts +54 -0
  39. package/dist/{cli-main-TQGLKB6D.js → cli-main-YR2WJCPL.js} +38062 -37035
  40. package/dist/cli-main-boot.d.ts +133 -0
  41. package/dist/cli-main-orchestration.d.ts +170 -0
  42. package/dist/cli-main-state.d.ts +19 -0
  43. package/dist/config-doctor.d.ts +1 -1
  44. package/dist/{config-transfer-UE37X4B5.js → config-transfer-VOIFY7U4.js} +2 -2
  45. package/dist/{execution-C2IECWF7.js → execution-IBAZ2EIU.js} +138 -124
  46. package/dist/fleet/host-director-setup.d.ts +41 -0
  47. package/dist/fleet/host-spawn-types.d.ts +17 -0
  48. package/dist/fleet/host.d.ts +2 -1
  49. package/dist/goal-host-prompts.d.ts +5 -0
  50. package/dist/goal-host-types.d.ts +94 -0
  51. package/dist/goal-host.d.ts +2 -91
  52. package/dist/{hq-KBFDKTDD.js → hq-5OIEKB4V.js} +5 -6
  53. package/dist/hq-server/handle-types.d.ts +1 -1
  54. package/dist/hq-server/routes/auth-handlers.d.ts +1 -1
  55. package/dist/hq-server/routes.d.ts +1 -13
  56. package/dist/hq-server/utils.d.ts +1 -1
  57. package/dist/{hq-server-AVNKZ2PV.js → hq-server-DU3ZH3X7.js} +3 -3
  58. package/dist/{hq-service-FGB7BY2D.js → hq-service-LYZV7EK7.js} +3 -3
  59. package/dist/index.js +4 -4
  60. package/dist/live-settings-input.d.ts +2 -0
  61. package/dist/mailbox-bridge-bootstrap.d.ts +1 -4
  62. package/dist/{modeldiag-PQILD7TN.js → modeldiag-NEPTLFZW.js} +2 -2
  63. package/dist/picker-effort.d.ts +32 -0
  64. package/dist/picker-model-picker.d.ts +13 -2
  65. package/dist/picker-provider-list.d.ts +66 -0
  66. package/dist/picker.d.ts +12 -12
  67. package/dist/{providers-models-W57I3QOA.js → providers-models-37DUV2GW.js} +297 -253
  68. package/dist/repl-suggestions.d.ts +0 -5
  69. package/dist/{sdd-runtime-PTOSPYI4.js → sdd-runtime-PF72WHLO.js} +3 -20
  70. package/dist/services/sdd/task-manager.d.ts +1 -12
  71. package/dist/services/sdd-runtime.d.ts +3 -4
  72. package/dist/services/statusline-config.d.ts +0 -2
  73. package/dist/settings-behavior-sections.d.ts +0 -1
  74. package/dist/short-circuit-flags-EXJBJ5GT.js +10 -0
  75. package/dist/{skill-suggest-L2EVWB6R.js → skill-suggest-THANK3LV.js} +1 -1
  76. package/dist/slash-commands/command-context.d.ts +2 -0
  77. package/dist/slash-commands/fallback-chain-view.d.ts +3 -0
  78. package/dist/slash-commands/fallback-ref-validation.d.ts +34 -0
  79. package/dist/slash-commands/goal-refiner.d.ts +10 -2
  80. package/dist/slash-commands/goals.d.ts +6 -0
  81. package/dist/slash-commands/kanban-task-completion.d.ts +17 -0
  82. package/dist/slash-commands/mcp.d.ts +0 -1
  83. package/dist/slash-commands/memory-purge-domain-terms.d.ts +5 -0
  84. package/dist/slash-commands/nextsteps-mode.d.ts +13 -0
  85. package/dist/slash-commands/session-live-status.d.ts +21 -0
  86. package/dist/slash-commands/session.d.ts +1 -1
  87. package/dist/slash-commands/settings-feature-ui-mutations.d.ts +8 -0
  88. package/dist/slash-commands/settings-hq-autonomy-mutations.d.ts +8 -0
  89. package/dist/slash-commands/settings-persist-deps.d.ts +10 -0
  90. package/dist/slash-commands/settings-runtime-mutations.d.ts +12 -0
  91. package/dist/slash-commands/shadow.d.ts +0 -1
  92. package/dist/slash-commands/tool-auto-thin-commands.d.ts +15 -0
  93. package/dist/subcommands/handlers/acp-agents.d.ts +9 -0
  94. package/dist/subcommands/handlers/acp-server.d.ts +7 -0
  95. package/dist/subcommands/handlers/hq.d.ts +0 -1
  96. package/dist/subcommands/handlers/providers-models-custom.d.ts +33 -0
  97. package/dist/subcommands/handlers/providers-models-visibility.d.ts +29 -0
  98. package/dist/subcommands/handlers/skill-suggest.d.ts +0 -2
  99. package/dist/{subcommands-QO7VYTSS.js → subcommands-DTKBXLPU.js} +2 -2
  100. package/dist/{update-J5WHAFPE.js → update-6OEPAEUV.js} +3 -3
  101. package/dist/utils/win32-cmd.d.ts +1 -1
  102. package/dist/{version-help-ATOKGMTK.js → version-help-JQGRPDJW.js} +2 -2
  103. package/dist/webui-server/host-settings.d.ts +17 -0
  104. package/dist/webui-server/http-bridge.d.ts +32 -0
  105. package/dist/webui-server/instance-registration.d.ts +19 -0
  106. package/dist/webui-server/kanban-services.d.ts +9 -0
  107. package/dist/webui-server/message-router.d.ts +14 -0
  108. package/dist/webui-server/prefs-seeding.d.ts +1 -2
  109. package/dist/webui-server/provider-config.d.ts +0 -1
  110. package/dist/webui-server/provider-plane.d.ts +14 -0
  111. package/dist/webui-server/session-agents.d.ts +18 -0
  112. package/dist/webui-server/session-start-live.d.ts +11 -0
  113. package/dist/webui-server/stream-coalescer.d.ts +1 -1
  114. package/dist/webui-server/transport.d.ts +12 -0
  115. package/dist/{webui-server-GQOVLQS3.js → webui-server-6IC3SLZG.js} +1600 -1435
  116. package/dist/webui-session-maintenance.d.ts +16 -0
  117. package/dist/wiring/brain-and-orchestration.d.ts +1 -1
  118. package/dist/wiring/cli-slash-commands-setup.d.ts +1 -0
  119. package/dist/wiring/command-host-state.d.ts +11 -2
  120. package/dist/wiring/dep-watcher-bridge.d.ts +8 -1
  121. package/dist/wiring/session-command-handlers.d.ts +2 -1
  122. package/dist/worktree-command-host.d.ts +31 -0
  123. package/package.json +30 -30
  124. package/dist/auto-discover-providers-QIL34K3U.js +0 -7
  125. package/dist/chunk-WHOIR577.js +0 -1
  126. package/dist/short-circuit-flags-6LB3EGF7.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-6SIUTX75.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,7 +36,14 @@ 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-KMU7GF7X.js";
47
47
  import {
48
48
  terminalLink,
49
49
  terminalText
@@ -724,16 +724,12 @@ async function restoreDebugStreamCallback() {
724
724
 
725
725
  // src/boot/tui-goal-wiring.ts
726
726
  import { PHASE_EVENT_NAMES } from "@wrongstack/core/goal";
727
+ import { WORKTREE_EVENT_NAMES } from "@wrongstack/core/types/worktree-timeline";
727
728
  var GOAL_EVENTS = [
728
729
  ...PHASE_EVENT_NAMES,
729
730
  // Extra events not in PhaseEventMap (sourced from other subsystems)
730
731
  "sdd.board.snapshot",
731
- "worktree.allocated",
732
- "worktree.committed",
733
- "worktree.merged",
734
- "worktree.conflict",
735
- "worktree.released",
736
- "worktree.failed",
732
+ ...WORKTREE_EVENT_NAMES,
737
733
  "countdown.tick"
738
734
  ];
739
735
  function wireGoal(events) {
@@ -1139,7 +1135,7 @@ async function switchProjectInPlace(ctx, targetRoot, displayName) {
1139
1135
 
1140
1136
  // src/boot/tui-sdd-callback.ts
1141
1137
  async function getSDDContext() {
1142
- const { getActiveSDDContext: getActiveSDDContext2 } = await import("./sdd-runtime-PTOSPYI4.js");
1138
+ const { getActiveSDDContext: getActiveSDDContext2 } = await import("./sdd-runtime-PF72WHLO.js");
1143
1139
  return getActiveSDDContext2();
1144
1140
  }
1145
1141
  async function onSDDOutput(output) {
@@ -1150,7 +1146,7 @@ async function onSDDOutput(output) {
1150
1146
  autoDetectTaskCompletion: autoDetectTaskCompletion2,
1151
1147
  getTaskProgress: getTaskProgress2,
1152
1148
  getActiveSDDPhase: getActiveSDDPhase2
1153
- } = await import("./sdd-runtime-PTOSPYI4.js");
1149
+ } = await import("./sdd-runtime-PF72WHLO.js");
1154
1150
  const messages = [];
1155
1151
  const specSaved = await trySaveSpecFromAIOutput2(output);
1156
1152
  if (specSaved) messages.push("\u2713 Spec detected and saved! Use /sdd approve to continue.");
@@ -1178,8 +1174,14 @@ async function onSDDOutput(output) {
1178
1174
  }
1179
1175
 
1180
1176
  // src/boot/tui-settings-adapter.ts
1181
- import { normalizeTokenSavingTier, resolveFleetChatVerbosity } from "@wrongstack/core/types";
1182
1177
  import { getProcessRegistry } from "@wrongstack/tools";
1178
+
1179
+ // src/boot/tui-settings-read.ts
1180
+ import {
1181
+ normalizeTokenSavingTier,
1182
+ resolveFleetChatVerbosity,
1183
+ resolveNextStepsMode
1184
+ } from "@wrongstack/core/types";
1183
1185
  var PANEL_IDS_CLI = [
1184
1186
  "projectPicker",
1185
1187
  "fleet",
@@ -1221,109 +1223,113 @@ var ANIMATION_STYLES = [
1221
1223
  function normalizeAnimationStyle(raw) {
1222
1224
  return typeof raw === "string" && ANIMATION_STYLES.includes(raw) ? raw : "rainbow";
1223
1225
  }
1226
+ function readTuiSettings(configStore) {
1227
+ const cfg = configStore.get();
1228
+ const autonomy = cfg.autonomy;
1229
+ const rawMode = autonomy?.defaultMode;
1230
+ const mode = rawMode === "suggest" || rawMode === "auto" ? rawMode : "off";
1231
+ const modelRuntime = cfg.modelRuntime;
1232
+ const contextModeRaw = cfg.context?.mode;
1233
+ const contextMode = contextModeRaw === "frugal" || contextModeRaw === "deep" ? contextModeRaw : "balanced";
1234
+ const reasoningEffortRaw = modelRuntime?.reasoning?.effort;
1235
+ const reasoningEffort = reasoningEffortRaw === "none" || reasoningEffortRaw === "minimal" || reasoningEffortRaw === "low" || reasoningEffortRaw === "medium" || reasoningEffortRaw === "high" || reasoningEffortRaw === "xhigh" || reasoningEffortRaw === "max" ? reasoningEffortRaw : "medium";
1236
+ const featuresAllow = cfg.features?.allowOutsideProjectRoot;
1237
+ const toolsRestrict = cfg.tools?.restrictToProjectRoot;
1238
+ const resolvedAllow = featuresAllow !== void 0 ? featuresAllow : toolsRestrict !== void 0 ? !toolsRestrict : true;
1239
+ const resolvedRestrict = !resolvedAllow;
1240
+ return {
1241
+ mode,
1242
+ delayMs: autonomy?.autoProceedDelayMs ?? 15e3,
1243
+ titleAnimation: autonomy?.terminalTitleAnimation !== false,
1244
+ yolo: cfg.yolo ?? autonomy?.yolo ?? true,
1245
+ fleetChatVerbosity: resolveFleetChatVerbosity(cfg.autonomy),
1246
+ chime: autonomy?.chime ?? true,
1247
+ confirmExit: autonomy?.confirmExit !== false,
1248
+ nextPrediction: cfg.nextPrediction ?? true,
1249
+ featureMcp: cfg.features?.mcp !== false,
1250
+ featurePlugins: cfg.features?.plugins !== false,
1251
+ featureMemory: cfg.features?.memory !== false,
1252
+ featureSkills: cfg.features?.skills !== false,
1253
+ featureModelsRegistry: cfg.features?.modelsRegistry !== false,
1254
+ featureToolCoach: cfg.features?.toolCoach !== false,
1255
+ // Preserve the 'auto' sentinel for the picker DISPLAY (normalize would
1256
+ // collapse it to 'off', which would then overwrite 'auto' on save);
1257
+ // everything else normalizes to a concrete tier.
1258
+ featureTokenSaving: cfg.features?.tokenSavingMode === "auto" ? "auto" : normalizeTokenSavingTier(cfg.features?.tokenSavingMode),
1259
+ allowOutsideProjectRoot: resolvedAllow,
1260
+ contextAutoCompact: cfg.context?.autoCompact !== false,
1261
+ contextStrategy: cfg.context?.strategy ?? "hybrid",
1262
+ contextMode,
1263
+ maxConcurrent: cfg.maxConcurrent ?? 10,
1264
+ logLevel: cfg.log?.level ?? "warn",
1265
+ auditLevel: cfg.session?.auditLevel ?? "full",
1266
+ indexOnStart: cfg.indexing?.onSessionStart !== false,
1267
+ maxIterations: cfg.tools?.maxIterations ?? 0,
1268
+ // Multi-diff summary threshold — mirrors the WebUI parity path
1269
+ // (pref-helpers.ts reads/writes `decrypted.autonomy.multiDiffSummaryThreshold`;
1270
+ // here we read from `decrypted.tools.multiDiffSummaryThreshold` to
1271
+ // match the Tools-section write gate added in saveSettings).
1272
+ multiDiffSummaryThreshold: cfg.tools?.multiDiffSummaryThreshold ?? 5,
1273
+ nextStepsTool: cfg.tools?.nextsteps?.enabled === true,
1274
+ nextStepsRequired: resolveNextStepsMode(autonomy?.nextSteps) === "required",
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
+ enhanceRetryTimeoutMs: cfg.autonomy?.enhanceRetryTimeoutMs,
1289
+ midRunSendPicker: cfg.autonomy?.midRunSendPicker ?? true,
1290
+ mouseMode: autonomy?.mouseMode ?? false,
1291
+ autonomyNextPrompt: cfg.autonomy?.autonomyNextPrompt ?? "auto {{suggestion}}",
1292
+ reasoningMode: modelRuntime?.reasoning?.mode === "on" || modelRuntime?.reasoning?.mode === "off" ? modelRuntime.reasoning.mode : "auto",
1293
+ reasoningEffort,
1294
+ reasoningPreserve: modelRuntime?.reasoning?.preserve === true,
1295
+ cacheTtl: modelRuntime?.cache?.ttl === "5m" || modelRuntime?.cache?.ttl === "1h" ? modelRuntime.cache.ttl : "default",
1296
+ breakerEnabled: cfg.circuitBreaker?.enabled === true,
1297
+ breakerAutoKillResetMs: cfg.circuitBreaker?.autoKillResetMs ?? 6e4,
1298
+ showModelReasoning: autonomy?.showModelReasoning ?? false,
1299
+ toolResultViewMode: autonomy?.toolResultViewMode === "minimal" || autonomy?.toolResultViewMode === "full" ? autonomy.toolResultViewMode : "normal",
1300
+ showAgentSwarmPanel: coerceAgentSwarmMode(autonomy?.showAgentSwarmPanel),
1301
+ showSidebar: autonomy?.showSidebar ?? true,
1302
+ lastSettingsField: autonomy?.lastSettingsField ?? 0,
1303
+ // Migrate the legacy `autonomy.showAgentSwarmPanel: 'sidebar'` into
1304
+ // the new per-panel `panelPositions.fleet` map at the read boundary
1305
+ // so users with old configs (no `panelPositions` key on disk) get
1306
+ // their sidebar routing. Only migrate when the per-panel key is
1307
+ // UNDEFINED — an explicit `panelPositions.fleet: 'bottom'` must
1308
+ // NOT be reverted to `'sidebar'`.
1309
+ panelPositions: coercePanelPositionMap({
1310
+ ...autonomy?.panelPositions,
1311
+ ...coerceAgentSwarmMode(autonomy?.showAgentSwarmPanel) === "sidebar" && autonomy?.panelPositions?.fleet === void 0 ? { fleet: "sidebar" } : {}
1312
+ }),
1313
+ showSageMemoryInject: autonomy?.showSageMemoryInject ?? false,
1314
+ readSymbols: autonomy?.readAdvancedMode ?? false,
1315
+ sageMemoryInjectThreshold: cfg.Sage?.inject ? cfg.Sage.inject?.relationFloor : void 0,
1316
+ // WrongProxy / WrongTrace: read from `tools.wrongProxy.{enabled,url}`
1317
+ // so the persistence shape mirrors the WebUI `LocalPrefs` shape
1318
+ // (single object with two fields, not two top-level keys). The
1319
+ // canonical type is `ToolsConfig.wrongProxy?: WrongProxyToolConfig`
1320
+ // — no index-signature widening cast needed.
1321
+ wrongProxyEnabled: cfg.tools?.wrongProxy?.enabled === true,
1322
+ wrongProxyUrl: cfg.tools?.wrongProxy?.url
1323
+ };
1324
+ }
1325
+
1326
+ // src/boot/tui-settings-adapter.ts
1224
1327
  function createSettingsAdapter(ctx) {
1225
1328
  const { configStore, wpaths, vault, fleetStreamController, applyLiveSettings } = ctx;
1226
1329
  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
1330
  async function saveSettings(s) {
1325
1331
  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
1332
+ 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
1333
  // either key being present in the live patch. Without this, a
1328
1334
  // picker toggle round-trip would silently no-op the persistence
1329
1335
  // layer (the runtime probe would never read the change).
@@ -1382,6 +1388,8 @@ function createSettingsAdapter(ctx) {
1382
1388
  autonomy.autonomyNextPrompt = s.autonomyNextPrompt;
1383
1389
  if (s.autoProceedMaxIterations !== void 0)
1384
1390
  autonomy.autoProceedMaxIterations = s.autoProceedMaxIterations;
1391
+ if (s.nextStepsRequired !== void 0)
1392
+ autonomy.nextSteps = s.nextStepsRequired ? "required" : "optional";
1385
1393
  decrypted.autonomy = autonomy;
1386
1394
  if (s.nextPrediction !== void 0) decrypted.nextPrediction = s.nextPrediction;
1387
1395
  if (s.yolo !== void 0) decrypted.yolo = s.yolo;
@@ -1485,15 +1493,17 @@ function createSettingsAdapter(ctx) {
1485
1493
  }
1486
1494
  });
1487
1495
  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;
1496
+ 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
1497
  if (effectiveScope === "project" && hasProfileOnlySettings) {
1490
1498
  await persistConfigSetting(
1491
1499
  { ...persistDeps, forceGlobal: true, updateStore: false },
1492
1500
  (profileConfig) => {
1493
- if (s.mode !== void 0 || s.yolo !== void 0) {
1501
+ if (s.mode !== void 0 || s.yolo !== void 0 || s.nextStepsRequired !== void 0) {
1494
1502
  const autonomy = profileConfig.autonomy ?? {};
1495
1503
  if (s.mode !== void 0) autonomy.defaultMode = s.mode;
1496
1504
  if (s.yolo !== void 0) autonomy.yolo = s.yolo;
1505
+ if (s.nextStepsRequired !== void 0)
1506
+ autonomy.nextSteps = s.nextStepsRequired ? "required" : "optional";
1497
1507
  profileConfig.autonomy = autonomy;
1498
1508
  }
1499
1509
  if (s.yolo !== void 0) profileConfig.yolo = s.yolo;
@@ -1626,7 +1636,7 @@ function createSettingsAdapter(ctx) {
1626
1636
  return message;
1627
1637
  }
1628
1638
  }
1629
- return { getSettings, saveSettings };
1639
+ return { getSettings: () => readTuiSettings(configStore), saveSettings };
1630
1640
  }
1631
1641
 
1632
1642
  // src/boot/tui-theme-adapter.ts
@@ -5197,7 +5207,7 @@ async function runWebUIDispatch(ctx) {
5197
5207
  const isSimpleUi = !isSessionChild && flags["simpleui"] === true;
5198
5208
  agent.disableInteractiveConfirmation();
5199
5209
  renderer.setSilent(true);
5200
- const { runWebUI } = await import("./webui-server-GQOVLQS3.js");
5210
+ const { runWebUI } = await import("./webui-server-6IC3SLZG.js");
5201
5211
  const flagValue = (names) => {
5202
5212
  for (const name of names) {
5203
5213
  if (!Object.hasOwn(flags, name)) continue;
@@ -6424,8 +6434,8 @@ import { restoreRequiredSkillsFromEvents as restoreRequiredSkillsFromEvents2 } f
6424
6434
  import { attachTodosCheckpoint, loadTodosCheckpoint } from "@wrongstack/core/storage";
6425
6435
  import { projectLastRequestTokens } from "@wrongstack/core/types/session-timeline";
6426
6436
  import { sessionScopedPath as sessionScopedPath2, toErrorMessage as toErrorMessage4 } from "@wrongstack/core/utils";
6427
- var RESERVATION_WINDOW_MS = 6e4;
6428
- var RESERVATION_RENEW_MS = 2e4;
6437
+
6438
+ // src/boot/tui-session-resume-contracts.ts
6429
6439
  function messageText(content) {
6430
6440
  if (typeof content === "string") return content;
6431
6441
  if (!Array.isArray(content)) return "";
@@ -6442,6 +6452,10 @@ function lastAssistantTextOf(messages) {
6442
6452
  }
6443
6453
  return void 0;
6444
6454
  }
6455
+
6456
+ // src/boot/tui-session-resume.ts
6457
+ var RESERVATION_WINDOW_MS = 6e4;
6458
+ var RESERVATION_RENEW_MS = 2e4;
6445
6459
  async function resumeSession(ctx, sessionId) {
6446
6460
  const { state, agent, tokenCounter, switchProviderAndModel, events, onLoadProgress } = ctx;
6447
6461
  const fail = (stage2, message) => {
@@ -7495,4 +7509,4 @@ export {
7495
7509
  execute,
7496
7510
  resolveReviewerFallbackModels
7497
7511
  };
7498
- //# sourceMappingURL=execution-C2IECWF7.js.map
7512
+ //# sourceMappingURL=execution-IBAZ2EIU.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
@@ -0,0 +1,94 @@
1
+ import type { BrainArbiter } from '@wrongstack/core/coordination';
2
+ import type { PhaseGraph, PhaseOrchestrator, PhaseProgress } from '@wrongstack/core/goal';
3
+ import type { EventBus } from '@wrongstack/core/kernel';
4
+ import type { Config, TaskNode } from '@wrongstack/core/types';
5
+ import type { MultiAgentHost } from './multi-agent.js';
6
+ export interface GoalHostDeps {
7
+ multiAgentHost: MultiAgentHost;
8
+ /** Read the *current* Config lazily (it may be patched, e.g. YOLO toggles). */
9
+ getConfig: () => Config;
10
+ /** Shared app EventBus — orchestrator events feed the TUI PhaseMonitor. */
11
+ events: EventBus;
12
+ /** Current parent session id for worktree lifecycle events. */
13
+ getSessionId?: (() => string | undefined) | undefined;
14
+ /** Directory for per-project phase-graph engine checkpoints. */
15
+ storeDir: string;
16
+ /** Project root — base for git-worktree isolation. */
17
+ projectRoot: string;
18
+ /** SDD board snapshot dir — `/worktree clean` skips while an SDD run is live. */
19
+ sddBoardsDir?: string | undefined;
20
+ /**
21
+ * Enable per-phase git-worktree isolation (default true). When on and the
22
+ * project is a git repo, parallelizable phases run in isolated worktrees and
23
+ * merge back sequentially. Disable with WRONGSTACK_GOAL_WORKTREES=0.
24
+ */
25
+ worktrees?: boolean | undefined;
26
+ /** Max parallel phases when worktrees are active (default 4). */
27
+ maxConcurrentPhases?: number | undefined;
28
+ /** Optional global Brain arbiter for Goal policy decisions. */
29
+ brain?: BrainArbiter | undefined;
30
+ /** Optional progress logger (rendered to the user during start). */
31
+ log?: ((line: string) => void) | undefined;
32
+ }
33
+ /** A live, read-only view of the running Goal, exposed to slash commands. */
34
+ interface GoalRunnerView {
35
+ graph: PhaseGraph;
36
+ getProgress: () => PhaseProgress | null;
37
+ isRunning: () => boolean;
38
+ }
39
+ export type GoalStartResult = {
40
+ ok: true;
41
+ graph: PhaseGraph;
42
+ } | {
43
+ ok: false;
44
+ error: string;
45
+ };
46
+ export interface GoalHostHooks {
47
+ onGoalStart: (opts: {
48
+ goal: string;
49
+ projectContext?: string | undefined;
50
+ }) => Promise<GoalStartResult>;
51
+ onGoalPause: () => void;
52
+ onGoalResume: () => void;
53
+ /**
54
+ * Resume a persisted PhaseGraph. The graph must already have been loaded
55
+ * from the PhaseStore. Creates a fresh orchestrator and starts executing
56
+ * pending tasks.
57
+ */
58
+ onGoalResumeFromGraph: (graph: PhaseGraph) => Promise<GoalStartResult>;
59
+ onGoalStop: () => void;
60
+ getGoalRunner: () => GoalRunnerView | null;
61
+ /** Interactive board: move a task to another phase. */
62
+ onGoalMoveTask: (taskId: string, toPhaseId: string) => boolean;
63
+ /** Interactive board: (re)assign a task to a specific agent (clear with both omitted). */
64
+ onGoalAssignTask: (taskId: string, agentId?: string, agentName?: string) => boolean;
65
+ /** Interactive board: add a new task to a phase. Returns the new task id. */
66
+ onGoalAddTask: (phaseId: string, spec: {
67
+ title: string;
68
+ description?: string;
69
+ type?: TaskNode['type'];
70
+ priority?: TaskNode['priority'];
71
+ }) => string | null;
72
+ /** Interactive board: requeue a task to pending so it (re)runs. */
73
+ onGoalRetryTask: (taskId: string) => boolean;
74
+ /** Backs the /worktree slash command (list / merge / prune / clean). */
75
+ onWorktree: (action: 'list' | 'merge' | 'prune' | 'clean', target?: string) => Promise<string>;
76
+ }
77
+ export interface ActiveRun {
78
+ graph: PhaseGraph;
79
+ orchestrator: PhaseOrchestrator;
80
+ abort: AbortController;
81
+ unsubscribe: () => void;
82
+ releaseRunLease: () => Promise<void>;
83
+ runPromise?: Promise<void> | undefined;
84
+ }
85
+ /** Minimal shape of an agent.run result we depend on. */
86
+ export interface RunResult {
87
+ status: string;
88
+ finalText?: string | undefined;
89
+ error?: {
90
+ message?: string | undefined;
91
+ };
92
+ }
93
+ export {};
94
+ //# sourceMappingURL=goal-host-types.d.ts.map
@@ -1,94 +1,5 @@
1
1
  export { configureGoalPolicy, isGoalCommandAllowed, resetGoalPolicy } from './goal-commands.js';
2
- /**
3
- * Goal host wiring for the CLI.
4
- *
5
- * Turns a free-text goal into a real, LLM-driven phase run:
6
- * 1. PLAN — a one-shot subagent generates a phase-by-phase plan where each
7
- * phase carries many concrete todos (GoalPlanner).
8
- * 2. BUILD — PhaseGraphBuilder materializes the plan into a PhaseGraph with a
9
- * populated TaskGraph per phase, persisted as per-project JSON.
10
- * 3. RUN — PhaseOrchestrator drives the graph in the background; every task
11
- * is executed by a fresh subagent (full tool access). Phase/task
12
- * events flow on the shared EventBus so the TUI PhaseMonitor stays
13
- * live, and the graph is re-persisted as phases complete.
14
- *
15
- * This is "SDD logic but different": phased, persisted task-lists like SDD, but
16
- * driven by the autonomous orchestrator + concurrent subagents rather than
17
- * single-thread turn injection.
18
- */
19
- import { type BrainArbiter } from '@wrongstack/core/coordination';
20
- import { type PhaseGraph, type PhaseProgress } from '@wrongstack/core/goal';
21
- import type { EventBus } from '@wrongstack/core/kernel';
22
- import type { Config, TaskNode } from '@wrongstack/core/types';
23
- import type { MultiAgentHost } from './multi-agent.js';
24
- export interface GoalHostDeps {
25
- multiAgentHost: MultiAgentHost;
26
- /** Read the *current* Config lazily (it may be patched, e.g. YOLO toggles). */
27
- getConfig: () => Config;
28
- /** Shared app EventBus — orchestrator events feed the TUI PhaseMonitor. */
29
- events: EventBus;
30
- /** Current parent session id for worktree lifecycle events. */
31
- getSessionId?: (() => string | undefined) | undefined;
32
- /** Directory for per-project phase-graph engine checkpoints. */
33
- storeDir: string;
34
- /** Project root — base for git-worktree isolation. */
35
- projectRoot: string;
36
- /**
37
- * Enable per-phase git-worktree isolation (default true). When on and the
38
- * project is a git repo, parallelizable phases run in isolated worktrees and
39
- * merge back sequentially. Disable with WRONGSTACK_GOAL_WORKTREES=0.
40
- */
41
- worktrees?: boolean | undefined;
42
- /** Max parallel phases when worktrees are active (default 4). */
43
- maxConcurrentPhases?: number | undefined;
44
- /** Optional global Brain arbiter for Goal policy decisions. */
45
- brain?: BrainArbiter | undefined;
46
- /** Optional progress logger (rendered to the user during start). */
47
- log?: ((line: string) => void) | undefined;
48
- }
49
- /** A live, read-only view of the running Goal, exposed to slash commands. */
50
- interface GoalRunnerView {
51
- graph: PhaseGraph;
52
- getProgress: () => PhaseProgress | null;
53
- isRunning: () => boolean;
54
- }
55
- type GoalStartResult = {
56
- ok: true;
57
- graph: PhaseGraph;
58
- } | {
59
- ok: false;
60
- error: string;
61
- };
62
- export interface GoalHostHooks {
63
- onGoalStart: (opts: {
64
- goal: string;
65
- projectContext?: string | undefined;
66
- }) => Promise<GoalStartResult>;
67
- onGoalPause: () => void;
68
- onGoalResume: () => void;
69
- /**
70
- * Resume a persisted PhaseGraph. The graph must already have been loaded
71
- * from the PhaseStore. Creates a fresh orchestrator and starts executing
72
- * pending tasks.
73
- */
74
- onGoalResumeFromGraph: (graph: PhaseGraph) => Promise<GoalStartResult>;
75
- onGoalStop: () => void;
76
- getGoalRunner: () => GoalRunnerView | null;
77
- /** Interactive board: move a task to another phase. */
78
- onGoalMoveTask: (taskId: string, toPhaseId: string) => boolean;
79
- /** Interactive board: (re)assign a task to a specific agent (clear with both omitted). */
80
- onGoalAssignTask: (taskId: string, agentId?: string, agentName?: string) => boolean;
81
- /** Interactive board: add a new task to a phase. Returns the new task id. */
82
- onGoalAddTask: (phaseId: string, spec: {
83
- title: string;
84
- description?: string;
85
- type?: TaskNode['type'];
86
- priority?: TaskNode['priority'];
87
- }) => string | null;
88
- /** Interactive board: requeue a task to pending so it (re)runs. */
89
- onGoalRetryTask: (taskId: string) => boolean;
90
- /** Backs the /worktree slash command (list / merge / prune / clean). */
91
- onWorktree: (action: 'list' | 'merge' | 'prune' | 'clean', target?: string) => Promise<string>;
92
- }
2
+ import type { GoalHostDeps, GoalHostHooks } from './goal-host-types.js';
3
+ export type { GoalHostDeps, GoalHostHooks } from './goal-host-types.js';
93
4
  export declare function createGoalHost(deps: GoalHostDeps): GoalHostHooks;
94
5
  //# sourceMappingURL=goal-host.d.ts.map