@wrongstack/cli 1.1.5 → 1.1.7

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/dist/{acp-NKUEYJDZ.js → acp-DJWUTU5J.js} +6 -6
  2. package/dist/acp-leader/acp-leader-host.d.ts +7 -0
  3. package/dist/acp-leader/acp-leader-provider.d.ts +10 -0
  4. package/dist/acp-leader/acp-leader-skills.d.ts +5 -0
  5. package/dist/acp-leader/acp-leader-stream.d.ts +8 -0
  6. package/dist/{auth-2ZG5DBHS.js → auth-XOJIPFFX.js} +2 -2
  7. package/dist/{chunk-UROB7MK5.js → chunk-BQ5OMSZG.js} +3 -2
  8. package/dist/{chunk-M7PSENGF.js → chunk-CL3BU45P.js} +5 -4
  9. package/dist/{chunk-M7FNHCE3.js → chunk-EAATL6FL.js} +110 -30
  10. package/dist/{chunk-JFYQGMMM.js → chunk-FWUIKCCO.js} +54 -49
  11. package/dist/{chunk-MEBXWI7U.js → chunk-OCB4I4GQ.js} +4 -4
  12. package/dist/{chunk-VEESMPTX.js → chunk-PGC44T7N.js} +2 -1
  13. package/dist/{chunk-5SGMUDP5.js → chunk-QRWXHGLB.js} +2 -2
  14. package/dist/{chunk-7BM4LGKQ.js → chunk-V3AKAH25.js} +6 -6
  15. package/dist/{chunk-LUEO5HLZ.js → chunk-X4DEQLAZ.js} +1 -1
  16. package/dist/{cli-context-CQYGIWOU.js → cli-context-F3B5TRZX.js} +40 -15
  17. package/dist/{cli-main-VRUJNUBX.js → cli-main-BPYX7AC6.js} +45 -12
  18. package/dist/{execution-IV72RUSM.js → execution-W3OWWXY7.js} +23 -9
  19. package/dist/{hq-54PQYR5O.js → hq-V2M4IYCI.js} +13 -3
  20. package/dist/hq-server/login-attempt-store.d.ts +2 -0
  21. package/dist/{hq-server-YK7FBLL6.js → hq-server-QM7EIVGJ.js} +2 -2
  22. package/dist/index.js +6 -6
  23. package/dist/live-settings-input.d.ts +1 -0
  24. package/dist/short-circuit-flags-6LWKP4KP.js +11 -0
  25. package/dist/{subcommands-OCJNO57E.js → subcommands-SR4K73WA.js} +2 -2
  26. package/dist/{version-help-X6CC4CFY.js → version-help-MITOB3YK.js} +2 -2
  27. package/dist/vibeui-dist-OEPU6BOM.js +27 -0
  28. package/dist/vibeui-dist.d.ts +6 -0
  29. package/dist/webui-server/host-settings.d.ts +1 -1
  30. package/dist/webui-server/http-bridge.d.ts +1 -1
  31. package/dist/webui-server/instance-registration.d.ts +1 -1
  32. package/dist/{webui-server-V2R5WQUK.js → webui-server-KREX7GYA.js} +11 -9
  33. package/dist/webui-server-options.d.ts +1 -1
  34. package/dist/wrongforge-leader/wrongforge-leader-provider.d.ts +8 -1
  35. package/package.json +35 -34
  36. package/dist/short-circuit-flags-AGHURHMQ.js +0 -11
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  parseArgs
3
- } from "./chunk-M7PSENGF.js";
3
+ } from "./chunk-CL3BU45P.js";
4
4
  import {
5
5
  helpCmd,
6
6
  versionCmd
7
- } from "./chunk-UROB7MK5.js";
7
+ } from "./chunk-BQ5OMSZG.js";
8
8
 
9
9
  // src/boot/short-circuit-flags.ts
10
10
  async function handleHelpVersionShortCircuit(argv) {
@@ -22,7 +22,7 @@ async function handleHelpVersionShortCircuit(argv) {
22
22
  }
23
23
  if (earlyFlags["help"] === true) {
24
24
  if (positional.length > 0) {
25
- const { subcommandNames } = await import("./subcommands-OCJNO57E.js");
25
+ const { subcommandNames } = await import("./subcommands-SR4K73WA.js");
26
26
  if (subcommandNames.includes(positional[0])) {
27
27
  const first = positional[0];
28
28
  const deep = positional[1];
@@ -43,4 +43,4 @@ async function handleHelpVersionShortCircuit(argv) {
43
43
  export {
44
44
  handleHelpVersionShortCircuit
45
45
  };
46
- //# sourceMappingURL=chunk-MEBXWI7U.js.map
46
+ //# sourceMappingURL=chunk-OCB4I4GQ.js.map
@@ -225,6 +225,7 @@ function wfTokens(usage) {
225
225
  };
226
226
  }
227
227
  function sleep(ms, signal) {
228
+ if (signal.aborted) return Promise.resolve();
228
229
  return new Promise((resolve) => {
229
230
  const t = setTimeout(done, ms);
230
231
  function done() {
@@ -251,4 +252,4 @@ export {
251
252
  toProgress,
252
253
  wfTokens
253
254
  };
254
- //# sourceMappingURL=chunk-VEESMPTX.js.map
255
+ //# sourceMappingURL=chunk-PGC44T7N.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolveWrongForgeEndpoint,
3
3
  wrongForgeCall
4
- } from "./chunk-VEESMPTX.js";
4
+ } from "./chunk-PGC44T7N.js";
5
5
 
6
6
  // src/fleet/acp-wrongstack-bridge.ts
7
7
  import { statSync } from "node:fs";
@@ -749,4 +749,4 @@ export {
749
749
  refreshWrongForgeInfoCache,
750
750
  reportWrongForgeQuota
751
751
  };
752
- //# sourceMappingURL=chunk-5SGMUDP5.js.map
752
+ //# sourceMappingURL=chunk-QRWXHGLB.js.map
@@ -3,9 +3,9 @@
3
3
  var loaders = {
4
4
  automation: async () => (await import("./automation-O7ZRZSFS.js")).automationCmd,
5
5
  sandbox: async () => (await import("./sandbox-EZQ76MNY.js")).sandboxCmd,
6
- acp: async () => (await import("./acp-NKUEYJDZ.js")).acpCmd,
6
+ acp: async () => (await import("./acp-DJWUTU5J.js")).acpCmd,
7
7
  init: async () => (await import("./init-5PLABNLR.js")).initCmd,
8
- auth: async () => (await import("./auth-2ZG5DBHS.js")).authCmd,
8
+ auth: async () => (await import("./auth-XOJIPFFX.js")).authCmd,
9
9
  update: async () => (await import("./update-54W7GUS5.js")).updateCmd,
10
10
  remote: async () => (await import("./remote-AKKRJEHK.js")).remoteCmd,
11
11
  sessions: async () => (await import("./sessions-config-7MK742OW.js")).sessionsCmd,
@@ -29,14 +29,14 @@ var loaders = {
29
29
  "proxy-status": async () => (await import("./diag-doctor-5SVYK2DR.js")).proxyCmd,
30
30
  export: async () => (await import("./export-W27PTU6Y.js")).exportCmd,
31
31
  usage: async () => (await import("./plugin-usage-UWKYMNQU.js")).usageCmd,
32
- version: async () => (await import("./version-help-X6CC4CFY.js")).versionCmd,
33
- help: async () => (await import("./version-help-X6CC4CFY.js")).helpCmd,
32
+ version: async () => (await import("./version-help-MITOB3YK.js")).versionCmd,
33
+ help: async () => (await import("./version-help-MITOB3YK.js")).helpCmd,
34
34
  projects: async () => (await import("./projects-FWRJHW3S.js")).projectsCmd,
35
35
  modeldiag: async () => (await import("./modeldiag-5PBB777J.js")).modeldiagCmd,
36
36
  quick: async () => (await import("./quick-NPC3N3ZX.js")).quickCmd,
37
37
  bench: async () => (await import("./bench-NDYES33Y.js")).benchCmd,
38
38
  chronicle: async () => (await import("./chronicle-WBK3TJRB.js")).chronicleCmd,
39
- hq: async () => (await import("./hq-54PQYR5O.js")).hqCmd,
39
+ hq: async () => (await import("./hq-V2M4IYCI.js")).hqCmd,
40
40
  mailbox: async () => (await import("./mailbox-serve-MMQCHOHI.js")).mailboxServeCmd,
41
41
  permissions: async () => (await import("./permissions-6YJ64W65.js")).permissionsCmd,
42
42
  project: async () => (await import("./project-V5KNTLV4.js")).projectCmd,
@@ -58,4 +58,4 @@ export {
58
58
  subcommands,
59
59
  subcommandNames
60
60
  };
61
- //# sourceMappingURL=chunk-7BM4LGKQ.js.map
61
+ //# sourceMappingURL=chunk-V3AKAH25.js.map
@@ -47,4 +47,4 @@ export {
47
47
  trackAcpLeader,
48
48
  closeAcpLeaderSessions
49
49
  };
50
- //# sourceMappingURL=chunk-LUEO5HLZ.js.map
50
+ //# sourceMappingURL=chunk-X4DEQLAZ.js.map
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-FUJHWQV4.js";
23
23
  import {
24
24
  handleHelpVersionShortCircuit
25
- } from "./chunk-MEBXWI7U.js";
25
+ } from "./chunk-OCB4I4GQ.js";
26
26
  import {
27
27
  fmtTok,
28
28
  patchConfig
@@ -32,14 +32,14 @@ import {
32
32
  } from "./chunk-NL2ABOAS.js";
33
33
  import {
34
34
  subcommands
35
- } from "./chunk-7BM4LGKQ.js";
35
+ } from "./chunk-V3AKAH25.js";
36
36
  import {
37
37
  renderDeepHelp,
38
38
  renderFocusedHelp
39
39
  } from "./chunk-P7MEEUGT.js";
40
40
  import {
41
41
  DEFAULT_PORT
42
- } from "./chunk-JFYQGMMM.js";
42
+ } from "./chunk-FWUIKCCO.js";
43
43
  import "./chunk-QVITQ425.js";
44
44
  import {
45
45
  resolveHqPasswordInput
@@ -86,7 +86,7 @@ import {
86
86
  } from "./chunk-3LEIFO5D.js";
87
87
  import {
88
88
  WRONGFORGE_AGENT_ID
89
- } from "./chunk-VEESMPTX.js";
89
+ } from "./chunk-PGC44T7N.js";
90
90
  import "./chunk-OZCYZYN2.js";
91
91
  import {
92
92
  runUpdateCommand
@@ -100,15 +100,15 @@ import {
100
100
  } from "./chunk-CVVQ5NCN.js";
101
101
  import {
102
102
  parseArgs
103
- } from "./chunk-M7PSENGF.js";
103
+ } from "./chunk-CL3BU45P.js";
104
104
  import {
105
105
  ACP_LEADER_PROVIDER_ID
106
- } from "./chunk-LUEO5HLZ.js";
106
+ } from "./chunk-X4DEQLAZ.js";
107
107
  import "./chunk-H53EXXAU.js";
108
108
  import {
109
109
  applyAsciiMode
110
110
  } from "./chunk-UVF3BGET.js";
111
- import "./chunk-UROB7MK5.js";
111
+ import "./chunk-BQ5OMSZG.js";
112
112
  import {
113
113
  CLI_VERSION
114
114
  } from "./chunk-HKMOIIPQ.js";
@@ -364,6 +364,7 @@ import { color, isStdinTTY, setRawMode } from "@wrongstack/core/utils";
364
364
  var DEFAULT_PORTS = {
365
365
  webui: 3456,
366
366
  simpleui: 3466,
367
+ vibeui: 3476,
367
368
  hq: DEFAULT_PORT
368
369
  };
369
370
  var MODE_OPTIONS = [
@@ -401,6 +402,13 @@ var MODE_OPTIONS = [
401
402
  label: "Desktop",
402
403
  hint: "Electron app (alias: --desktop)",
403
404
  icon: "\u{1F5A5}"
405
+ },
406
+ {
407
+ key: 6,
408
+ mode: "vibeui",
409
+ label: "VibeUI",
410
+ hint: `focused coding workspace (port ${DEFAULT_PORTS.vibeui})`,
411
+ icon: "\u2726"
404
412
  }
405
413
  ];
406
414
  var MENU_TIMEOUT_MS = 8e3;
@@ -564,6 +572,7 @@ function shouldSkipMenu(argv, flags, positional) {
564
572
  if (flags["webui"] === true) return true;
565
573
  if (flags["webui-session-child"] === true) return true;
566
574
  if (flags["simpleui"] === true) return true;
575
+ if (flags["vibeui"] === true) return true;
567
576
  if (flags["hq"] === true) return true;
568
577
  if (flags["desktop"] === true) return true;
569
578
  if (flags["no-interactive"] === true) return true;
@@ -715,6 +724,8 @@ function describeMode(mode) {
715
724
  return "WebUI";
716
725
  case "simpleui":
717
726
  return "SimpleUI";
727
+ case "vibeui":
728
+ return "VibeUI";
718
729
  case "hq":
719
730
  return "HQ";
720
731
  case "desktop":
@@ -741,6 +752,11 @@ function applyLaunchMenuToArgv(argv, result) {
741
752
  if (typeof result.host === "string") out.push(`--host=${result.host}`);
742
753
  out.push("--simpleui");
743
754
  return out;
755
+ case "vibeui":
756
+ if (typeof result.port === "number") out.push(`--port=${result.port}`);
757
+ if (typeof result.host === "string") out.push(`--host=${result.host}`);
758
+ out.push("--vibeui");
759
+ return out;
744
760
  case "hq":
745
761
  if (typeof result.port === "number") out.push(`--port=${result.port}`);
746
762
  if (typeof result.host === "string") out.push(`--host=${result.host}`);
@@ -948,7 +964,7 @@ async function isPortInUse(host, port) {
948
964
  }
949
965
  async function handleHqShortCircuit(flags) {
950
966
  if (flags["hq"] !== true) return null;
951
- const { startHqServer } = await import("./hq-server-YK7FBLL6.js");
967
+ const { startHqServer } = await import("./hq-server-QM7EIVGJ.js");
952
968
  const tunnelRequested = flags["tunnel"] === true;
953
969
  const rawPublicUrl = typeof flags["hq-public-url"] === "string" ? flags["hq-public-url"] : process.env.WRONGSTACK_HQ_PUBLIC_URL;
954
970
  let publicOrigin;
@@ -1230,7 +1246,14 @@ async function resolveAppendedSystemPrompt(flags, cwd) {
1230
1246
  // src/boot/config-backup-recovery.ts
1231
1247
  import * as fs3 from "node:fs/promises";
1232
1248
  import * as path5 from "node:path";
1233
- import { atomicWrite as atomicWrite2, backupConfigFile, color as color5, toErrorMessage } from "@wrongstack/core/utils";
1249
+ import {
1250
+ atomicWrite as atomicWrite2,
1251
+ backupConfigFile,
1252
+ color as color5,
1253
+ configSlug,
1254
+ safeProfileName,
1255
+ toErrorMessage
1256
+ } from "@wrongstack/core/utils";
1234
1257
  function isRecord(value) {
1235
1258
  return value !== null && typeof value === "object" && !Array.isArray(value);
1236
1259
  }
@@ -1248,9 +1271,7 @@ async function defaultProfileProvidersAreEmpty(profilePath) {
1248
1271
  }
1249
1272
  }
1250
1273
  function profileSnapshotTimestamp(fileName, fallback) {
1251
- const match = /^profiles-default-config-(\d{4})-(\d{2})-(\d{2})T(\d{2})-(\d{2})-(\d{2})-(\d{3})\.json$/i.exec(
1252
- fileName
1253
- );
1274
+ const match = /-(\d{4})-(\d{2})-(\d{2})T(\d{2})-(\d{2})-(\d{2})-(\d{3})\.json$/i.exec(fileName);
1254
1275
  if (!match) return fallback;
1255
1276
  const [, year, month, day, hour, minute, second, millisecond] = match;
1256
1277
  return Date.UTC(
@@ -1265,9 +1286,13 @@ function profileSnapshotTimestamp(fileName, fallback) {
1265
1286
  }
1266
1287
  async function findLatestProviderBackup(globalRoot, profileName = "default") {
1267
1288
  const directory = path5.join(globalRoot, "config-history");
1268
- const escapedProfile = profileName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1289
+ const prefix = configSlug(
1290
+ path5.join(globalRoot, "profiles", safeProfileName(profileName), "config.json"),
1291
+ globalRoot
1292
+ );
1293
+ const escapedPrefix = prefix.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1269
1294
  const filePattern = new RegExp(
1270
- `^profiles-${escapedProfile}-config-\\d{4}-\\d{2}-\\d{2}T\\d{2}-\\d{2}-\\d{2}-\\d{3}\\.json$`,
1295
+ `^${escapedPrefix}-\\d{4}-\\d{2}-\\d{2}T\\d{2}-\\d{2}-\\d{2}-\\d{3}\\.json$`,
1271
1296
  "i"
1272
1297
  );
1273
1298
  const candidates = [];
@@ -3639,4 +3664,4 @@ async function initializeCli(argv, options = {}) {
3639
3664
  export {
3640
3665
  initializeCli
3641
3666
  };
3642
- //# sourceMappingURL=cli-context-CQYGIWOU.js.map
3667
+ //# sourceMappingURL=cli-context-F3B5TRZX.js.map
@@ -132,6 +132,7 @@ import {
132
132
  } from "./chunk-KNYIEQAY.js";
133
133
  import {
134
134
  WRONGFORGE_REASONING,
135
+ cardOutputForText,
135
136
  createGracefulShutdown,
136
137
  formatAcpAgentList,
137
138
  loadCachedAcpRegistry,
@@ -141,7 +142,7 @@ import {
141
142
  startAcpTurnReminders,
142
143
  wrongForgeRuntime,
143
144
  wrongstackAcpPermissionPolicy
144
- } from "./chunk-M7FNHCE3.js";
145
+ } from "./chunk-EAATL6FL.js";
145
146
  import {
146
147
  DEFAULT_BRIDGE_SERVERS,
147
148
  createHqCommandDispatcher,
@@ -154,7 +155,7 @@ import {
154
155
  reportWrongForgeQuota,
155
156
  writeWrongForgeInfoCache,
156
157
  wrongstackBridgeSetup
157
- } from "./chunk-5SGMUDP5.js";
158
+ } from "./chunk-QRWXHGLB.js";
158
159
  import {
159
160
  isRestrictedMode,
160
161
  withRestrictedTools
@@ -173,7 +174,7 @@ import {
173
174
  toProgress,
174
175
  wfTokens,
175
176
  wrongForgeCall
176
- } from "./chunk-VEESMPTX.js";
177
+ } from "./chunk-PGC44T7N.js";
177
178
  import {
178
179
  startCliHqConnection
179
180
  } from "./chunk-76JE54WD.js";
@@ -191,12 +192,12 @@ import {
191
192
  } from "./chunk-BCKVNORU.js";
192
193
  import {
193
194
  parseSpawnFlags
194
- } from "./chunk-M7PSENGF.js";
195
+ } from "./chunk-CL3BU45P.js";
195
196
  import {
196
197
  ACP_LEADER_PROVIDER_ID,
197
198
  acpLeaderSessionAgent,
198
199
  bindAcpLeaderHost
199
- } from "./chunk-LUEO5HLZ.js";
200
+ } from "./chunk-X4DEQLAZ.js";
200
201
  import {
201
202
  checkForUpdate
202
203
  } from "./chunk-H53EXXAU.js";
@@ -1028,6 +1029,7 @@ function makeWrongForgeRunner(options) {
1028
1029
  }
1029
1030
  const cancel = () => cancelTask(call, record.id, "cancelled by WrongStack");
1030
1031
  ctx.signal.addEventListener("abort", cancel, { once: true });
1032
+ if (ctx.signal.aborted) cancel();
1031
1033
  const publish = (event) => {
1032
1034
  try {
1033
1035
  options.publishLive?.(ctx, task, event);
@@ -1040,6 +1042,7 @@ function makeWrongForgeRunner(options) {
1040
1042
  } catch {
1041
1043
  }
1042
1044
  };
1045
+ const stepTexts = [""];
1043
1046
  try {
1044
1047
  for await (const ev of followTask(call, record.id, ctx.signal, {
1045
1048
  retryDelayMs: options.retryDelayMs,
@@ -1055,6 +1058,11 @@ function makeWrongForgeRunner(options) {
1055
1058
  void reportWrongForgeQuota({ endpoint: ep, fetchImpl: options.fetchImpl });
1056
1059
  }
1057
1060
  for (const progress of toProgress(ev)) publish(progress);
1061
+ if (ev.type === "agent.text" && typeof ev.data["text"] === "string") {
1062
+ stepTexts[stepTexts.length - 1] += ev.data["text"];
1063
+ } else if (ev.type === "tool.started" && stepTexts[stepTexts.length - 1]?.trim()) {
1064
+ stepTexts.push("");
1065
+ }
1058
1066
  }
1059
1067
  record = await terminalTaskRecord(call, record.id, ctx.signal, {
1060
1068
  retryDelayMs: options.retryDelayMs
@@ -1080,7 +1088,8 @@ function makeWrongForgeRunner(options) {
1080
1088
  if (!result || !result.text.trim() && result.tool_calls === 0) {
1081
1089
  throw subagentError("empty_response", "WrongForge finished with no text and no tool calls");
1082
1090
  }
1083
- return { result: result.text, iterations: result.steps, toolCalls: result.tool_calls };
1091
+ const text = stepTexts.map((t) => t.trim()).filter(Boolean).join("\n\n") || result.text;
1092
+ return { result: text, iterations: result.steps, toolCalls: result.tool_calls };
1084
1093
  };
1085
1094
  }
1086
1095
  function taskFailure(record, signal) {
@@ -3243,13 +3252,31 @@ function createAcpLeaderHost(opts) {
3243
3252
  runTool: async (name, input, run = {}) => {
3244
3253
  const agent = agentFor(run.sessionId);
3245
3254
  const use = { type: "tool_use", id: `acp_fleet_${randomUUID()}`, name, input };
3255
+ const startedAt = Date.now();
3256
+ const settle = (content2, ok, settlement) => {
3257
+ if (!run.announce) return;
3258
+ opts.events.emit("tool.executed", {
3259
+ sessionId: agent.ctx.activeRunSessionId ?? agent.ctx.session?.id,
3260
+ agentId: "leader",
3261
+ id: use.id,
3262
+ name,
3263
+ durationMs: Date.now() - startedAt,
3264
+ ok,
3265
+ settlement,
3266
+ input: use.input,
3267
+ outsideConversation: true,
3268
+ ...cardOutputForText(content2)
3269
+ });
3270
+ };
3246
3271
  const batch = await agent.toolExecutor.executeBatch([use], agent.ctx, "sequential");
3247
3272
  let result = batch.outputs[0]?.result;
3248
3273
  if (result?.type === "tool_confirm_pending") {
3249
3274
  const tool = opts.getTool(name);
3250
3275
  const approved = { ...use, input: result.input };
3251
3276
  if (!tool || !await run.approve?.(tool, approved.input)) {
3252
- return { content: `${name} was not approved by the user.`, isError: true };
3277
+ const content2 = `${name} was not approved by the user.`;
3278
+ settle(content2, false, "declined");
3279
+ return { content: content2, isError: true };
3253
3280
  }
3254
3281
  result = (await agent.toolExecutor.executeTool(
3255
3282
  tool,
@@ -3258,8 +3285,13 @@ function createAcpLeaderHost(opts) {
3258
3285
  agent.perIterationOutputCapBytes
3259
3286
  )).block;
3260
3287
  }
3261
- if (!result) return { content: `${name} returned no result.`, isError: true };
3288
+ if (!result) {
3289
+ const content2 = `${name} returned no result.`;
3290
+ settle(content2, false, "failed");
3291
+ return { content: content2, isError: true };
3292
+ }
3262
3293
  const content = typeof result.content === "string" ? result.content : JSON.stringify(result.content);
3294
+ settle(content, !result.is_error, result.is_error ? "failed" : "completed");
3263
3295
  return { content, isError: Boolean(result.is_error) };
3264
3296
  },
3265
3297
  confirmAwaiter: opts.confirmAwaiter
@@ -8977,6 +9009,7 @@ ${JSON.stringify({
8977
9009
 
8978
9010
  // src/fleet/host-skill-companion.ts
8979
9011
  import { createHash as createHash2, randomUUID as randomUUID6 } from "node:crypto";
9012
+ import { keepsOwnContext } from "@wrongstack/core/agent";
8980
9013
  import {
8981
9014
  extractSkillMentions,
8982
9015
  isSkillRecommendable,
@@ -9127,7 +9160,7 @@ var HostSkillCompanion = class {
9127
9160
  input.events.on("agent.run.started", (event) => {
9128
9161
  const sessionId = event.sessionId;
9129
9162
  if (!sessionId || event.ctx.meta?.["agentRole"]) return;
9130
- if (isProofDrivenBugHuntRequest(event.inputText ?? "")) {
9163
+ if (keepsOwnContext(event.ctx.provider) || isProofDrivenBugHuntRequest(event.inputText ?? "")) {
9131
9164
  this.release(sessionId);
9132
9165
  if (event.ctx.meta) delete event.ctx.meta[SKILL_COMPANION_META_KEY];
9133
9166
  return;
@@ -41166,7 +41199,7 @@ function setupCliHeapWatchdog({
41166
41199
  const hqSnapshot = brainMailbox.getHqSnapshotStats();
41167
41200
  const kanbanSync = hqPublisherRef.getKanbanSyncStats?.();
41168
41201
  return {
41169
- surface: flags["simpleui"] ? "simpleui" : flags["webui"] ? "webui" : tuiOwnsScreen ? "tui" : "cli",
41202
+ surface: flags["vibeui"] ? "vibeui" : flags["simpleui"] ? "simpleui" : flags["webui"] ? "webui" : tuiOwnsScreen ? "tui" : "cli",
41170
41203
  sessionId: context.session.id,
41171
41204
  messages: context.state.messages.length,
41172
41205
  messageEstimatedTokens: context.state.messages.reduce(
@@ -43411,7 +43444,7 @@ async function runCliExecution(params) {
43411
43444
  governanceHandle,
43412
43445
  setConfig
43413
43446
  } = params;
43414
- const { execute } = await import("./execution-IV72RUSM.js");
43447
+ const { execute } = await import("./execution-W3OWWXY7.js");
43415
43448
  return execute(
43416
43449
  toExecuteDeps({
43417
43450
  core: {
@@ -43832,4 +43865,4 @@ export {
43832
43865
  CLI_VERSION,
43833
43866
  runInteractive
43834
43867
  };
43835
- //# sourceMappingURL=cli-main-VRUJNUBX.js.map
43868
+ //# sourceMappingURL=cli-main-BPYX7AC6.js.map
@@ -63,7 +63,7 @@ import {
63
63
  import "./chunk-OZCYZYN2.js";
64
64
  import {
65
65
  confirmAcpLeaderThroughEvents
66
- } from "./chunk-LUEO5HLZ.js";
66
+ } from "./chunk-X4DEQLAZ.js";
67
67
  import {
68
68
  CLI_VERSION
69
69
  } from "./chunk-HKMOIIPQ.js";
@@ -3247,6 +3247,7 @@ function readTuiSettings(configStore) {
3247
3247
  breakerEnabled: cfg.circuitBreaker?.enabled === true,
3248
3248
  breakerAutoKillResetMs: cfg.circuitBreaker?.autoKillResetMs ?? 6e4,
3249
3249
  showModelReasoning: autonomy?.showModelReasoning ?? false,
3250
+ selectionMode: autonomy?.selectionMode === "text" ? "text" : "block",
3250
3251
  toolResultViewMode: autonomy?.toolResultViewMode === "minimal" || autonomy?.toolResultViewMode === "full" ? autonomy.toolResultViewMode : "normal",
3251
3252
  showAgentSwarmPanel: coerceAgentSwarmMode(autonomy?.showAgentSwarmPanel),
3252
3253
  showSidebar: autonomy?.showSidebar ?? true,
@@ -3304,7 +3305,7 @@ function createSettingsAdapter(ctx) {
3304
3305
  nextSystemPromptVariant = s.nextSystemPromptVariant;
3305
3306
  }
3306
3307
  }
3307
- 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.rememberStartupChoices !== 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
3308
+ 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.rememberStartupChoices !== 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.selectionMode !== 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
3308
3309
  // either key being present in the live patch. Without this, a
3309
3310
  // picker toggle round-trip would silently no-op the persistence
3310
3311
  // layer (the runtime probe would never read the change).
@@ -3351,6 +3352,7 @@ function createSettingsAdapter(ctx) {
3351
3352
  autonomy.showModelReasoning = s.showModelReasoning;
3352
3353
  if (s.toolResultViewMode !== void 0)
3353
3354
  autonomy.toolResultViewMode = s.toolResultViewMode;
3355
+ if (s.selectionMode !== void 0) autonomy.selectionMode = s.selectionMode;
3354
3356
  if (s.showAgentSwarmPanel !== void 0)
3355
3357
  autonomy.showAgentSwarmPanel = s.showAgentSwarmPanel;
3356
3358
  if (s.showSidebar !== void 0) autonomy.showSidebar = s.showSidebar;
@@ -6181,6 +6183,11 @@ async function resumeSession(ctx, sessionId) {
6181
6183
  );
6182
6184
  warn(`could not restore ${targetProviderId}/${targetModel}`, err);
6183
6185
  }
6186
+ } else if (targetProviderId && targetProviderId !== currentProviderId) {
6187
+ warn(
6188
+ "could not restore saved route without a provider switch",
6189
+ `${targetProviderId}/${targetModel}`
6190
+ );
6184
6191
  } else if (targetModel !== agent.ctx.model) {
6185
6192
  agent.ctx.model = targetModel;
6186
6193
  }
@@ -6831,10 +6838,11 @@ async function runWebUIDispatch(ctx) {
6831
6838
  } = ctx;
6832
6839
  const isSessionChild = Boolean(webuiSessionChild);
6833
6840
  const isSimpleUi = !isSessionChild && flags["simpleui"] === true;
6841
+ const isVibeUi = !isSessionChild && flags["vibeui"] === true;
6834
6842
  agent.disableInteractiveConfirmation();
6835
6843
  confirmAcpLeaderThroughEvents();
6836
6844
  renderer.setSilent(true);
6837
- const { runWebUI } = await import("./webui-server-V2R5WQUK.js");
6845
+ const { runWebUI } = await import("./webui-server-KREX7GYA.js");
6838
6846
  const flagValue = (names) => {
6839
6847
  for (const name of names) {
6840
6848
  if (!Object.hasOwn(flags, name)) continue;
@@ -6879,7 +6887,7 @@ async function runWebUIDispatch(ctx) {
6879
6887
  let frontendDistDir;
6880
6888
  try {
6881
6889
  webuiHost = webuiSessionChild?.host ?? flagValue(["webui-host", "host"]) ?? process.env["WEBUI_HOST"] ?? process.env["WS_HOST"] ?? "127.0.0.1";
6882
- const defaultPort = isSimpleUi ? 3466 : 3456;
6890
+ const defaultPort = isVibeUi ? 3476 : isSimpleUi ? 3466 : 3456;
6883
6891
  webuiPort = webuiSessionChild?.port ?? parsePort(
6884
6892
  flagValue(["webui-port", "http-port", "port", "ws-port"]) ?? process.env["WEBUI_PORT"] ?? process.env["PORT"] ?? process.env["WS_PORT"],
6885
6893
  defaultPort,
@@ -6893,6 +6901,10 @@ async function runWebUIDispatch(ctx) {
6893
6901
  const { ensureSimpleUiDistDir } = await import("./simpleui-dist-EE3TJRBG.js");
6894
6902
  frontendDistDir = await ensureSimpleUiDistDir();
6895
6903
  }
6904
+ if (isVibeUi) {
6905
+ const { resolveVibeUiDistDir } = await import("./vibeui-dist-OEPU6BOM.js");
6906
+ frontendDistDir = resolveVibeUiDistDir();
6907
+ }
6896
6908
  } catch (err) {
6897
6909
  if (webuiSessionChild) {
6898
6910
  await writeWebuiSessionChildError(webuiSessionChild.readyFile, {
@@ -6913,7 +6925,7 @@ async function runWebUIDispatch(ctx) {
6913
6925
  events,
6914
6926
  statusTracker,
6915
6927
  session,
6916
- surface: isSimpleUi ? "simpleui" : "webui",
6928
+ surface: isVibeUi ? "vibeui" : isSimpleUi ? "simpleui" : "webui",
6917
6929
  host: webuiHost,
6918
6930
  port: webuiPort,
6919
6931
  frontendDistDir,
@@ -7020,7 +7032,7 @@ async function runWebUIDispatch(ctx) {
7020
7032
  }).catch(() => void 0);
7021
7033
  return;
7022
7034
  }
7023
- const surface = isSimpleUi ? "SimpleUI" : "WebUI";
7035
+ const surface = isVibeUi ? "VibeUI" : isSimpleUi ? "SimpleUI" : "WebUI";
7024
7036
  renderer.writeInfo(
7025
7037
  ` \u2726 ${terminalText(surface, "success", { bold: true })} ${terminalText("running \u2192", "muted")} ${terminalLink(url)}`
7026
7038
  );
@@ -7052,7 +7064,9 @@ async function runWebUIDispatch(ctx) {
7052
7064
  renderer.setSilent(false);
7053
7065
  renderer.write("\n");
7054
7066
  renderer.writeInfo(
7055
- color10.yellow(` Shutting down ${isSimpleUi ? "SimpleUI" : "WebUI"} server\u2026`)
7067
+ color10.yellow(
7068
+ ` Shutting down ${isVibeUi ? "VibeUI" : isSimpleUi ? "SimpleUI" : "WebUI"} server\u2026`
7069
+ )
7056
7070
  );
7057
7071
  resolve5(0);
7058
7072
  }).catch((err) => {
@@ -7069,7 +7083,7 @@ async function runWebUIDispatch(ctx) {
7069
7083
  renderer.setSilent(false);
7070
7084
  renderer.writeInfo(
7071
7085
  color10.red(
7072
- ` \u2717 ${isSimpleUi ? "SimpleUI" : "WebUI"} failed to start: ${err instanceof Error ? err.message : String(err)}`
7086
+ ` \u2717 ${isVibeUi ? "VibeUI" : isSimpleUi ? "SimpleUI" : "WebUI"} failed to start: ${err instanceof Error ? err.message : String(err)}`
7073
7087
  )
7074
7088
  );
7075
7089
  resolve5(1);
@@ -7675,4 +7689,4 @@ export {
7675
7689
  execute,
7676
7690
  resolveReviewerFallbackModels
7677
7691
  };
7678
- //# sourceMappingURL=execution-IV72RUSM.js.map
7692
+ //# sourceMappingURL=execution-W3OWWXY7.js.map
@@ -552,18 +552,21 @@ async function tokenRevoke(args, deps) {
552
552
  const dataDir = resolveDataDir(deps);
553
553
  const tokenField = scope === "client" ? "clientTokens" : "browserTokens";
554
554
  let revoked;
555
+ let ambiguous = [];
555
556
  try {
556
557
  await mutateHqAuthFile(
557
558
  dataDir,
558
559
  (current) => {
559
560
  const tokens = current[tokenField] ?? [];
560
561
  const matches = tokens.filter((t) => t.id.startsWith(idPrefix));
562
+ ambiguous = [];
561
563
  if (matches.length === 0) {
562
564
  revoked = void 0;
563
565
  return current;
564
566
  }
565
567
  if (matches.length > 1) {
566
- revoked = matches[0];
568
+ revoked = void 0;
569
+ ambiguous = matches;
567
570
  return current;
568
571
  }
569
572
  revoked = matches[0];
@@ -580,6 +583,13 @@ async function tokenRevoke(args, deps) {
580
583
  `);
581
584
  return 1;
582
585
  }
586
+ if (ambiguous.length > 0) {
587
+ deps.renderer.writeError(
588
+ `Id-prefix "${idPrefix}" matches ${ambiguous.length} ${scope} tokens (${ambiguous.map((t) => t.id).join(", ")}); nothing revoked. Use a longer prefix.
589
+ `
590
+ );
591
+ return 1;
592
+ }
583
593
  if (!revoked) {
584
594
  deps.renderer.writeError(`No ${scope} token found matching id-prefix "${idPrefix}".
585
595
  `);
@@ -704,7 +714,7 @@ var hqCmd = async (args, deps) => {
704
714
  return 1;
705
715
  };
706
716
  async function startServer(deps) {
707
- const { startHqServer } = await import("./hq-server-YK7FBLL6.js");
717
+ const { startHqServer } = await import("./hq-server-QM7EIVGJ.js");
708
718
  const dataDir = resolveDataDir(deps);
709
719
  const flags = deps.flags ?? {};
710
720
  const rawPublicUrl = typeof flags["hq-public-url"] === "string" ? flags["hq-public-url"] : process.env.WRONGSTACK_HQ_PUBLIC_URL;
@@ -1014,4 +1024,4 @@ function printHelp(deps) {
1014
1024
  export {
1015
1025
  hqCmd
1016
1026
  };
1017
- //# sourceMappingURL=hq-54PQYR5O.js.map
1027
+ //# sourceMappingURL=hq-V2M4IYCI.js.map
@@ -22,6 +22,7 @@ export declare class LoginAttemptStore {
22
22
  private store;
23
23
  private writeTimer;
24
24
  private dirty;
25
+ private writeTail;
25
26
  private readonly filePath;
26
27
  private readonly debounceMs;
27
28
  private readonly retentionMs;
@@ -92,6 +93,7 @@ export declare class LoginAttemptStore {
92
93
  flush(): Promise<void>;
93
94
  private scheduleWrite;
94
95
  private writeToDisk;
96
+ private writeSnapshotToDisk;
95
97
  /** Iterate entries (for cleanup timers). */
96
98
  entries(): IterableIterator<[string, LoginAttemptEntry]>;
97
99
  }
@@ -10,7 +10,7 @@ import {
10
10
  readLocalSubagentTranscript,
11
11
  sanitizeApiError,
12
12
  startHqServer
13
- } from "./chunk-JFYQGMMM.js";
13
+ } from "./chunk-FWUIKCCO.js";
14
14
  import "./chunk-QVITQ425.js";
15
15
  import "./chunk-5TQ65PXQ.js";
16
16
  import "./chunk-OGVSKS4Q.js";
@@ -29,4 +29,4 @@ export {
29
29
  sanitizeApiError,
30
30
  startHqServer
31
31
  };
32
- //# sourceMappingURL=hq-server-YK7FBLL6.js.map
32
+ //# sourceMappingURL=hq-server-QM7EIVGJ.js.map