@wrongstack/cli 0.310.1 → 0.313.1

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 (32) hide show
  1. package/dist/{acp-GZIASCLH.js → acp-LQMSMV32.js} +2 -2
  2. package/dist/chunk-4JRIWVJ4.js +13 -0
  3. package/dist/chunk-7CECQDNH.js +24 -0
  4. package/dist/{chunk-3FHFGIIN.js → chunk-AOAIPYFB.js} +2 -2
  5. package/dist/{chunk-J4QSP6T2.js → chunk-CNQZ4HG4.js} +1 -1
  6. package/dist/{chunk-J3XBHGEO.js → chunk-E3X4KM7T.js} +5 -2
  7. package/dist/{chunk-3MAUU765.js → chunk-GWVLRUVH.js} +1 -1
  8. package/dist/{cli-main-UDWMWX55.js → cli-main-UOQ2ICUO.js} +493 -212
  9. package/dist/{diag-doctor-Z6JDXBVX.js → diag-doctor-OPTB2NWY.js} +15 -3
  10. package/dist/{execution-ZEHK4II6.js → execution-L4CXQEND.js} +76 -14
  11. package/dist/execution-chimera-cascade.d.ts +4 -1
  12. package/dist/execution-chimera-review.d.ts +4 -1
  13. package/dist/fleet/host-types.d.ts +9 -0
  14. package/dist/fleet/subagent-hook-runner.d.ts +22 -0
  15. package/dist/{hq-3BEUEXJQ.js → hq-2XIXGAER.js} +2 -2
  16. package/dist/{hq-server-4MIW3S4J.js → hq-server-DBT3OOYD.js} +2 -2
  17. package/dist/index.js +12 -12
  18. package/dist/live-settings-input.d.ts +7 -2
  19. package/dist/{proxy-wiring-7RPGBHZP.js → proxy-wiring-G26YGP7S.js} +3 -3
  20. package/dist/slash-commands/sidebar.d.ts +4 -0
  21. package/dist/subcommands/contracts.d.ts +7 -0
  22. package/dist/webui-server/prefs-seeding.d.ts +1 -1
  23. package/dist/{webui-server-UB75UHWX.js → webui-server-I53IYBW4.js} +1 -1
  24. package/dist/wiring/proxy-probe.d.ts +1 -1
  25. package/dist/wiring/wrongtrace-gate-counters.d.ts +18 -0
  26. package/dist/wiring/wrongtrace-gate.d.ts +13 -0
  27. package/dist/wiring/wrongtrace-hooks.d.ts +8 -0
  28. package/dist/wiring/wrongtrace-prompt-contributor.d.ts +23 -0
  29. package/dist/wiring/wrongtrace-telemetry.d.ts +53 -0
  30. package/dist/wrongtrace-gate-counters-P5BCBXQN.js +22 -0
  31. package/dist/wrongtrace-telemetry-6M2CCBX5.js +34 -0
  32. package/package.json +28 -27
@@ -1,6 +1,10 @@
1
1
  import {
2
2
  startProxyProbe
3
- } from "./chunk-3MAUU765.js";
3
+ } from "./chunk-GWVLRUVH.js";
4
+ import {
5
+ formatGateCounterReport,
6
+ loadWrongTraceGateCounters
7
+ } from "./chunk-7CECQDNH.js";
4
8
  import {
5
9
  API_VERSION
6
10
  } from "./chunk-XJXDOF63.js";
@@ -141,7 +145,10 @@ var diagCmd = async (_args, deps) => {
141
145
  ` model: ${cfg.model ?? "<unset>"}`,
142
146
  ` tools: ${deps.toolRegistry?.list().length ?? 0}`,
143
147
  ` plugins: ${cfg.plugins?.length ?? 0}`,
144
- ` mcpServers: ${Object.keys(cfg.mcpServers ?? {}).length}`
148
+ ` mcpServers: ${Object.keys(cfg.mcpServers ?? {}).length}`,
149
+ ...deps.events ? [
150
+ ` eventBus: listeners=${deps.events.listenerCount()} wildcards=${deps.events.wildcardCount()}`
151
+ ] : []
145
152
  ];
146
153
  deps.renderer.write(lines.join("\n") + "\n");
147
154
  return 0;
@@ -180,6 +187,11 @@ var proxyCmd = async (_args, deps) => {
180
187
  ` active: ${active} ${s.color(`(${s.label})`)}`,
181
188
  ` shouldRewrite:${gate} ${rewriteGateLabel(gate)}`
182
189
  ];
190
+ const counters = await loadWrongTraceGateCounters(deps.projectRoot);
191
+ if (counters) {
192
+ lines.push(color.bold("WrongTrace gate decisions (last session)"));
193
+ lines.push(` ${formatGateCounterReport(counters)}`);
194
+ }
183
195
  deps.renderer.write(lines.join("\n") + "\n");
184
196
  return 0;
185
197
  };
@@ -372,4 +384,4 @@ export {
372
384
  doctorCmd,
373
385
  proxyCmd
374
386
  };
375
- //# sourceMappingURL=diag-doctor-Z6JDXBVX.js.map
387
+ //# sourceMappingURL=diag-doctor-OPTB2NWY.js.map
@@ -29,14 +29,14 @@ import {
29
29
  import {
30
30
  theme
31
31
  } from "./chunk-QD544J2B.js";
32
+ import {
33
+ fmtTok
34
+ } from "./chunk-TYO2OVAD.js";
32
35
  import {
33
36
  WEBUI_SESSION_CHILD_CAPABILITIES,
34
37
  writeWebuiSessionChildError,
35
38
  writeWebuiSessionChildReady
36
39
  } from "./chunk-3JPTNADJ.js";
37
- import {
38
- fmtTok
39
- } from "./chunk-TYO2OVAD.js";
40
40
  import {
41
41
  terminalLink,
42
42
  terminalText
@@ -207,7 +207,7 @@ async function runWebUIDispatch(ctx) {
207
207
  const isSimpleUi = !isSessionChild && flags["simpleui"] === true;
208
208
  agent.disableInteractiveConfirmation();
209
209
  renderer.setSilent(true);
210
- const { runWebUI } = await import("./webui-server-UB75UHWX.js");
210
+ const { runWebUI } = await import("./webui-server-I53IYBW4.js");
211
211
  const flagValue = (names) => {
212
212
  for (const name of names) {
213
213
  if (!Object.hasOwn(flags, name)) continue;
@@ -406,7 +406,7 @@ async function runWebUIDispatch(ctx) {
406
406
  applyLiveSettings?.({ yolo: enabled });
407
407
  },
408
408
  onWrongProxyPrefsChange: (payload) => {
409
- void import("./proxy-wiring-7RPGBHZP.js").then(
409
+ void import("./proxy-wiring-G26YGP7S.js").then(
410
410
  ({ applyWrongProxyPrefs }) => applyWrongProxyPrefs(payload)
411
411
  );
412
412
  }
@@ -1638,7 +1638,7 @@ function coerceAgentSwarmMode(v) {
1638
1638
  if (typeof v === "string" && (v === "bottom" || v === "sidebar" || v === "off")) return v;
1639
1639
  return "bottom";
1640
1640
  }
1641
- var ANIMATION_STYLES = ["rainbow", "wave", "pulse", "dots", "breathe", "cycle"];
1641
+ var ANIMATION_STYLES = ["rainbow", "wave", "pulse", "dots", "breathe", "static", "cycle"];
1642
1642
  function normalizeAnimationStyle(raw) {
1643
1643
  return typeof raw === "string" && ANIMATION_STYLES.includes(raw) ? raw : "rainbow";
1644
1644
  }
@@ -1709,6 +1709,7 @@ function createSettingsAdapter(ctx) {
1709
1709
  breakerAutoKillResetMs: cfg.circuitBreaker?.autoKillResetMs ?? 6e4,
1710
1710
  showModelReasoning: autonomy?.showModelReasoning ?? true,
1711
1711
  showAgentSwarmPanel: coerceAgentSwarmMode(autonomy?.showAgentSwarmPanel),
1712
+ showSidebar: autonomy?.showSidebar ?? true,
1712
1713
  // Migrate the legacy `autonomy.showAgentSwarmPanel: 'sidebar'` into
1713
1714
  // the new per-panel `panelPositions.fleet` map at the read boundary
1714
1715
  // so users with old configs (no `panelPositions` key on disk) get
@@ -1733,7 +1734,7 @@ function createSettingsAdapter(ctx) {
1733
1734
  }
1734
1735
  async function saveSettings(s) {
1735
1736
  try {
1736
- 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.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.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.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.showAgentSwarmPanel !== void 0 || s.panelPositions !== void 0 || s.showSageMemoryInject !== void 0 || s.sageMemoryInjectThreshold !== void 0 || s.readSymbols !== void 0 || // WrongProxy / WrongTrace: gate the persisted-section write on
1737
+ 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.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.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.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.showAgentSwarmPanel !== void 0 || s.showSidebar !== void 0 || s.panelPositions !== void 0 || s.showSageMemoryInject !== void 0 || s.sageMemoryInjectThreshold !== void 0 || s.readSymbols !== void 0 || // WrongProxy / WrongTrace: gate the persisted-section write on
1737
1738
  // either key being present in the live patch. Without this, a
1738
1739
  // picker toggle round-trip would silently no-op the persistence
1739
1740
  // layer (the runtime probe would never read the change).
@@ -1789,6 +1790,7 @@ function createSettingsAdapter(ctx) {
1789
1790
  if (s.showModelReasoning !== void 0) autonomy.showModelReasoning = s.showModelReasoning;
1790
1791
  if (s.showAgentSwarmPanel !== void 0)
1791
1792
  autonomy.showAgentSwarmPanel = s.showAgentSwarmPanel;
1793
+ if (s.showSidebar !== void 0) autonomy.showSidebar = s.showSidebar;
1792
1794
  if (s.panelPositions !== void 0) autonomy.panelPositions = s.panelPositions;
1793
1795
  if (s.showSageMemoryInject !== void 0)
1794
1796
  autonomy.showSageMemoryInject = s.showSageMemoryInject;
@@ -2437,6 +2439,53 @@ async function finalizeExecutionCleanup(input) {
2437
2439
  sessionEndProducers.add(tracked);
2438
2440
  }
2439
2441
  });
2442
+ try {
2443
+ const model = agent.ctx.model;
2444
+ if (!model) {
2445
+ console.warn(
2446
+ JSON.stringify({
2447
+ level: "warn",
2448
+ event: "shutdown.wrongtrace_telemetry_skipped",
2449
+ message: "Skipping WrongTrace telemetry: agent model unknown at session end",
2450
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
2451
+ })
2452
+ );
2453
+ } else {
2454
+ const { reportWrongTraceSessionTelemetry } = await import("./wrongtrace-telemetry-6M2CCBX5.js");
2455
+ const usage = tokenCounter.total();
2456
+ const report = reportWrongTraceSessionTelemetry({
2457
+ sessionId: activeSession.id,
2458
+ agentName: "wrongstack-cli",
2459
+ model,
2460
+ provider: agent.ctx.provider?.id ?? "",
2461
+ usage: {
2462
+ input: usage.input,
2463
+ output: usage.output,
2464
+ cacheRead: usage.cacheRead,
2465
+ cacheWrite: usage.cacheWrite
2466
+ },
2467
+ costUsd: tokenCounter.estimateCost().total
2468
+ });
2469
+ const deadline = new Promise((resolve4) => {
2470
+ const t = setTimeout(resolve4, 5e3);
2471
+ t.unref?.();
2472
+ });
2473
+ const tracked = Promise.race([report, deadline]).finally(
2474
+ () => sessionEndProducers.delete(tracked)
2475
+ );
2476
+ void tracked.catch(() => void 0);
2477
+ sessionEndProducers.add(tracked);
2478
+ }
2479
+ } catch {
2480
+ }
2481
+ try {
2482
+ const { snapshotGateDecisions, persistWrongTraceGateCounters } = await import("./wrongtrace-gate-counters-P5BCBXQN.js");
2483
+ const projectRoot = agent.ctx.projectRoot;
2484
+ if (projectRoot) {
2485
+ await persistWrongTraceGateCounters(projectRoot, snapshotGateDecisions());
2486
+ }
2487
+ } catch {
2488
+ }
2440
2489
  if (director) {
2441
2490
  try {
2442
2491
  director.requestFinish("leader session ended \u2014 finish your review now");
@@ -3364,9 +3413,10 @@ function installChimeraCascadeHandler({
3364
3413
  trackWork,
3365
3414
  buildLadder,
3366
3415
  verifyEvidence = verifyCascadeEvidence,
3367
- persistEvidence
3416
+ persistEvidence,
3417
+ teardownHandlers
3368
3418
  }) {
3369
- events.onPattern("chimera.cascade_needed", (_event, payload) => {
3419
+ const off = events.onPattern("chimera.cascade_needed", (_event, payload) => {
3370
3420
  const p = payload;
3371
3421
  const dir = director;
3372
3422
  if (!dir) return;
@@ -3481,7 +3531,8 @@ function installChimeraCascadeHandler({
3481
3531
  });
3482
3532
  })();
3483
3533
  trackWork(pendingWork);
3484
- });
3534
+ }, "chimera-cascade");
3535
+ if (off) teardownHandlers?.push(off);
3485
3536
  }
3486
3537
  async function maybeReReviewCascade({
3487
3538
  events,
@@ -3656,9 +3707,10 @@ function installChimeraReviewHandler({
3656
3707
  projectDir,
3657
3708
  statusTracker,
3658
3709
  persistReview = persistChimeraReview,
3659
- trackWork
3710
+ trackWork,
3711
+ teardownHandlers
3660
3712
  }) {
3661
- events.onPattern("chimera.review_needed", (_event, payload) => {
3713
+ const off = events.onPattern("chimera.review_needed", (_event, payload) => {
3662
3714
  const p = payload;
3663
3715
  const reviewSessionId = agent.ctx.activeRunSessionId ?? agent.ctx.session?.id ?? session.id;
3664
3716
  const dir = director;
@@ -4019,7 +4071,8 @@ ${reviewBody}`;
4019
4071
  }
4020
4072
  })()
4021
4073
  );
4022
- });
4074
+ }, "chimera-review");
4075
+ if (off) teardownHandlers?.push(off);
4023
4076
  }
4024
4077
  async function persistChimeraReview(payload, projectDir) {
4025
4078
  const reportId = payload.reportId;
@@ -5762,6 +5815,7 @@ async function execute(deps) {
5762
5815
  const bootUpdateInfo = initialUpdateInfo;
5763
5816
  const offStorageObservability = installStorageObservability(events, context.traceId);
5764
5817
  const chimeraWork = createChimeraWorkRegistry();
5818
+ const chimeraTeardowns = [];
5765
5819
  installChimeraReviewHandler({
5766
5820
  events,
5767
5821
  director,
@@ -5770,6 +5824,7 @@ async function execute(deps) {
5770
5824
  agent,
5771
5825
  config,
5772
5826
  projectDir: wpaths.projectDir,
5827
+ teardownHandlers: chimeraTeardowns,
5773
5828
  // Thread the shared tracker so the round-robin Chimera reviewer picks
5774
5829
  // skip (provider, model) pairs currently in the waiting room. Without
5775
5830
  // this, a 429-stricken model is re-spawned on every concurrent reviewer
@@ -5783,6 +5838,7 @@ async function execute(deps) {
5783
5838
  events,
5784
5839
  director,
5785
5840
  session,
5841
+ teardownHandlers: chimeraTeardowns,
5786
5842
  buildLadder: () => buildMutatingAgentLadder({
5787
5843
  profileChain: effectiveFallbackChain2(config),
5788
5844
  session: { provider: config.provider, model: config.model }
@@ -6215,6 +6271,12 @@ async function execute(deps) {
6215
6271
  }
6216
6272
  }
6217
6273
  } finally {
6274
+ for (const off of chimeraTeardowns.splice(0)) {
6275
+ try {
6276
+ off();
6277
+ } catch {
6278
+ }
6279
+ }
6218
6280
  await finalizeExecutionCleanup({
6219
6281
  offStorageObservability,
6220
6282
  fleetStatusLine,
@@ -6243,4 +6305,4 @@ export {
6243
6305
  execute,
6244
6306
  resolveReviewerFallbackModels
6245
6307
  };
6246
- //# sourceMappingURL=execution-ZEHK4II6.js.map
6308
+ //# sourceMappingURL=execution-L4CXQEND.js.map
@@ -18,9 +18,12 @@ export type InstallChimeraCascadeHandlerOptions = {
18
18
  buildLadder?: (() => ReviewerAttempt[]) | undefined;
19
19
  /** Test seam; production defaults to the real safe command verifier. */
20
20
  verifyEvidence?: typeof verifyCascadeEvidence | undefined;
21
+ /** Optional session-teardown chain — the wildcard listener disposer is
22
+ * pushed here so the registration is released when the session ends. */
23
+ teardownHandlers?: Array<() => void> | undefined;
21
24
  /** Persist every evidence verdict on the source report, even when re-review stops. */
22
25
  persistEvidence?: ((reportId: string, status: CascadeEvidenceStatus, checks: CascadeEvidenceCheckResult[]) => Promise<void>) | undefined;
23
26
  };
24
- export declare function installChimeraCascadeHandler({ events, director, session, getPendingWork, trackWork, buildLadder, verifyEvidence, persistEvidence, }: InstallChimeraCascadeHandlerOptions): void;
27
+ export declare function installChimeraCascadeHandler({ events, director, session, getPendingWork, trackWork, buildLadder, verifyEvidence, persistEvidence, teardownHandlers, }: InstallChimeraCascadeHandlerOptions): void;
25
28
  export {};
26
29
  //# sourceMappingURL=execution-chimera-cascade.d.ts.map
@@ -38,7 +38,10 @@ export type InstallChimeraReviewHandlerOptions = {
38
38
  statusTracker?: ProviderModelStatusTracker | undefined;
39
39
  persistReview?: ((payload: ChimeraReviewCompletePayload, projectDir: string) => Promise<void>) | undefined;
40
40
  trackWork: (work: Promise<void>) => void;
41
+ /** Optional session-teardown chain — the wildcard listener disposer is
42
+ * pushed here so the registration is released when the session ends. */
43
+ teardownHandlers?: Array<() => void> | undefined;
41
44
  };
42
- export declare function installChimeraReviewHandler({ events, director, session, mailbox, agent, config, projectDir, statusTracker, persistReview, trackWork, }: InstallChimeraReviewHandlerOptions): void;
45
+ export declare function installChimeraReviewHandler({ events, director, session, mailbox, agent, config, projectDir, statusTracker, persistReview, trackWork, teardownHandlers, }: InstallChimeraReviewHandlerOptions): void;
43
46
  export {};
44
47
  //# sourceMappingURL=execution-chimera-review.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import type { AgentPipelines, FallbackProfileManager } from '@wrongstack/core/agent';
2
2
  import type { BrainArbiter, ProviderModelStatusTracker } from '@wrongstack/core/coordination';
3
+ import type { HookRunner } from '@wrongstack/core/hooks';
3
4
  import type { Container, EventBus } from '@wrongstack/core/kernel';
4
5
  import type { ProviderRegistry, ToolRegistry } from '@wrongstack/core/registry';
5
6
  import type { ConfigStore, ModelsRegistry, Renderer, SecretScrubber, SessionWriter, SkillLoader, SystemPromptBuilder, TokenCounter } from '@wrongstack/core/types';
@@ -32,6 +33,14 @@ export interface MultiAgentDeps {
32
33
  * subagent pipeline. This is host wiring, never a model-visible capability.
33
34
  */
34
35
  installToolBoundary?: ((pipelines: AgentPipelines) => void) | undefined;
36
+ /**
37
+ * Optional hook runner applied to every spawned subagent's ToolExecutor.
38
+ * The CLI wires a dedicated WrongTrace-only runner here so worker edits
39
+ * pass the same lock gate as the leader. Deliberately NOT the leader's
40
+ * own HookRegistry: shell hooks from `config.hooks` are a leader-session
41
+ * automation surface and must not silently replay on workers.
42
+ */
43
+ hookRunner?: HookRunner | undefined;
35
44
  }
36
45
  /**
37
46
  * Per-session options for the multi-agent host. Director Mode is always
@@ -0,0 +1,22 @@
1
+ import { HookRunner } from '@wrongstack/core/hooks';
2
+ /**
3
+ * Dedicated WrongTrace-only HookRunner for fleet subagents.
4
+ *
5
+ * Why not hand subagents the leader's own HookRunner: the leader's
6
+ * HookRegistry also carries shell hooks loaded from `config.hooks`, and
7
+ * those are a leader-session automation surface — replaying them on every
8
+ * worker tool call would be a silent behavior change beyond WrongTrace.
9
+ * This runner registers ONLY the fail-open lock-gate hooks, so a worker's
10
+ * `edit`/`write`/`replace`/`patch`/`codebase-ast-replace` call honors
11
+ * peer locks exactly like the leader does while nothing else changes.
12
+ *
13
+ * Lock claims are stamped `wrongstack:<leaderSessionId>` — one process,
14
+ * one lock-owner identity; per-worker ids would fragment the TTL picture
15
+ * without adding safety (the daemon lock is advisory coordination).
16
+ *
17
+ * Mirrors the registration contract in lifecycle-plugins.ts (same events,
18
+ * same matcher, same owner id). If production drifts, update both.
19
+ * `emit` (optional) forwards typed gate-decision events to the host bus.
20
+ */
21
+ export declare function createSubagentWrongTraceHookRunner(sessionId: () => string, emit?: (event: import('@wrongstack/wrongtrace').WrongTraceGateDecisionEvent) => void): HookRunner;
22
+ //# sourceMappingURL=subagent-hook-runner.d.ts.map
@@ -51,7 +51,7 @@ var hqCmd = async (args, deps) => {
51
51
  return 1;
52
52
  };
53
53
  async function startServer(deps) {
54
- const { startHqServer } = await import("./hq-server-4MIW3S4J.js");
54
+ const { startHqServer } = await import("./hq-server-DBT3OOYD.js");
55
55
  const dataDir = resolveDataDir(deps);
56
56
  const flags = deps.flags ?? {};
57
57
  const host = typeof flags["host"] === "string" ? flags["host"] : HQ_CLI_DEFAULT_HOST;
@@ -709,4 +709,4 @@ export {
709
709
  hqCmd,
710
710
  resolveAuditActor
711
711
  };
712
- //# sourceMappingURL=hq-3BEUEXJQ.js.map
712
+ //# sourceMappingURL=hq-2XIXGAER.js.map
@@ -15,7 +15,7 @@ import {
15
15
  readLocalSubagentTranscript,
16
16
  sanitizeApiError,
17
17
  startHqServer
18
- } from "./chunk-J3XBHGEO.js";
18
+ } from "./chunk-E3X4KM7T.js";
19
19
  import "./chunk-KE7E7DPX.js";
20
20
  import "./chunk-Q5GTM25S.js";
21
21
  import "./chunk-7OCVIDC7.js";
@@ -37,4 +37,4 @@ export {
37
37
  sanitizeApiError,
38
38
  startHqServer
39
39
  };
40
- //# sourceMappingURL=hq-server-4MIW3S4J.js.map
40
+ //# sourceMappingURL=hq-server-DBT3OOYD.js.map
package/dist/index.js CHANGED
@@ -10,14 +10,14 @@ import {
10
10
  import {
11
11
  theme
12
12
  } from "./chunk-QD544J2B.js";
13
- import {
14
- parseWebuiSessionChildOptions,
15
- writeWebuiSessionChildError
16
- } from "./chunk-3JPTNADJ.js";
17
13
  import {
18
14
  fmtTok,
19
15
  patchConfig
20
16
  } from "./chunk-TYO2OVAD.js";
17
+ import {
18
+ parseWebuiSessionChildOptions,
19
+ writeWebuiSessionChildError
20
+ } from "./chunk-3JPTNADJ.js";
21
21
  import {
22
22
  discoverAndMergeProviders
23
23
  } from "./chunk-52C7PD2H.js";
@@ -28,7 +28,7 @@ import "./chunk-U3SS4NRH.js";
28
28
  import "./chunk-NUIHRGPY.js";
29
29
  import {
30
30
  DEFAULT_PORT
31
- } from "./chunk-J3XBHGEO.js";
31
+ } from "./chunk-E3X4KM7T.js";
32
32
  import "./chunk-KE7E7DPX.js";
33
33
  import "./chunk-Q5GTM25S.js";
34
34
  import {
@@ -1861,7 +1861,7 @@ var subcommandsWithFocusedHelp = Object.keys(helpTable);
1861
1861
 
1862
1862
  // src/subcommands/index.ts
1863
1863
  var loaders = {
1864
- acp: async () => (await import("./acp-GZIASCLH.js")).acpCmd,
1864
+ acp: async () => (await import("./acp-LQMSMV32.js")).acpCmd,
1865
1865
  init: async () => (await import("./init-4JQSG66Q.js")).initCmd,
1866
1866
  auth: async () => (await import("./auth-VQMSZGKE.js")).authCmd,
1867
1867
  update: async () => (await import("./update-ZXNC6I6G.js")).updateCmd,
@@ -1877,9 +1877,9 @@ var loaders = {
1877
1877
  mcp: async () => (await import("./mcp-RRPKNRSN.js")).mcpCmd,
1878
1878
  plugin: async () => (await import("./plugin-usage-GCTYOZPH.js")).pluginCmd,
1879
1879
  plugins: async () => (await import("./plugin-usage-GCTYOZPH.js")).pluginCmd,
1880
- diag: async () => (await import("./diag-doctor-Z6JDXBVX.js")).diagCmd,
1881
- doctor: async () => (await import("./diag-doctor-Z6JDXBVX.js")).doctorCmd,
1882
- "proxy-status": async () => (await import("./diag-doctor-Z6JDXBVX.js")).proxyCmd,
1880
+ diag: async () => (await import("./diag-doctor-OPTB2NWY.js")).diagCmd,
1881
+ doctor: async () => (await import("./diag-doctor-OPTB2NWY.js")).doctorCmd,
1882
+ "proxy-status": async () => (await import("./diag-doctor-OPTB2NWY.js")).proxyCmd,
1883
1883
  export: async () => (await import("./export-ROG3DKTZ.js")).exportCmd,
1884
1884
  usage: async () => (await import("./plugin-usage-GCTYOZPH.js")).usageCmd,
1885
1885
  version: async () => (await import("./version-help-WMPSEL4U.js")).versionCmd,
@@ -1889,7 +1889,7 @@ var loaders = {
1889
1889
  quick: async () => (await import("./quick-XLYLZX4B.js")).quickCmd,
1890
1890
  bench: async () => (await import("./bench-XYG56AMO.js")).benchCmd,
1891
1891
  chronicle: async () => (await import("./chronicle-6EPPMUC5.js")).chronicleCmd,
1892
- hq: async () => (await import("./hq-3BEUEXJQ.js")).hqCmd,
1892
+ hq: async () => (await import("./hq-2XIXGAER.js")).hqCmd,
1893
1893
  mailbox: async () => (await import("./mailbox-serve-5S3PHG5D.js")).mailboxServeCmd,
1894
1894
  permissions: async () => (await import("./permissions-2PWBL4YU.js")).permissionsCmd,
1895
1895
  project: async () => (await import("./project-BLQ3ALVL.js")).projectCmd,
@@ -1968,7 +1968,7 @@ async function isPortInUse(host, port) {
1968
1968
  }
1969
1969
  async function handleHqShortCircuit(flags) {
1970
1970
  if (flags["hq"] !== true) return null;
1971
- const { startHqServer } = await import("./hq-server-4MIW3S4J.js");
1971
+ const { startHqServer } = await import("./hq-server-DBT3OOYD.js");
1972
1972
  const tunnelRequested = flags["tunnel"] === true;
1973
1973
  const host = typeof flags["host"] === "string" ? flags["host"] : tunnelRequested ? "127.0.0.1" : HQ_CLI_DEFAULT_HOST2;
1974
1974
  if (tunnelRequested && !isLoopbackHost(host)) {
@@ -4481,7 +4481,7 @@ async function initializeCli(argv) {
4481
4481
  async function main(argv) {
4482
4482
  const cliCtx = await initializeCli(argv);
4483
4483
  if (typeof cliCtx === "number") return cliCtx;
4484
- const { runInteractive } = await import("./cli-main-UDWMWX55.js");
4484
+ const { runInteractive } = await import("./cli-main-UOQ2ICUO.js");
4485
4485
  return runInteractive(cliCtx);
4486
4486
  }
4487
4487
 
@@ -52,7 +52,7 @@ export interface LiveSettingsInput {
52
52
  /** Single word shown in the TUI rainbow working-state chip. */
53
53
  thinkingWord?: string | undefined;
54
54
  /** Animation style for the TUI working-state chip. */
55
- animationStyle?: 'rainbow' | 'wave' | 'pulse' | 'dots' | 'breathe' | 'cycle' | undefined;
55
+ animationStyle?: 'rainbow' | 'wave' | 'pulse' | 'dots' | 'breathe' | 'static' | 'cycle' | undefined;
56
56
  /** Provider-runtime reasoning mode. */
57
57
  reasoningMode?: 'auto' | 'on' | 'off' | undefined;
58
58
  /** Provider-runtime reasoning effort. */
@@ -66,6 +66,11 @@ export interface LiveSettingsInput {
66
66
  /** Agent swarm panel placement: 'bottom' (lower region), 'sidebar' (right sidebar), or 'off' (hidden).
67
67
  * Backward-compat: legacy boolean values are coerced by the TUI settings adapter. Default: 'bottom'. */
68
68
  showAgentSwarmPanel?: 'bottom' | 'sidebar' | 'off' | boolean | undefined;
69
+ /**
70
+ * Right sidebar visibility: when false, the right sidebar is completely
71
+ * hidden and chat history takes the full terminal width. Default: true.
72
+ */
73
+ showSidebar?: boolean | undefined;
69
74
  /**
70
75
  * Per-panel position map (one entry per F-key panel id). Each value is
71
76
  * 'bottom' (F-key behavior) or 'sidebar' (right-sidebar twin). Persisted
@@ -97,7 +102,7 @@ export interface LiveSettingsInput {
97
102
  */
98
103
  wrongProxyEnabled?: boolean | undefined;
99
104
  /**
100
- * WrongProxy / WrongTrace URL. Default `http://localhost:8000`. The
105
+ * WrongProxy / WrongTrace URL. Default `http://localhost:3444`. The
101
106
  * CLI's periodic probe targets `<wrongProxyUrl>/api/health`; a 2xx
102
107
  * response flips the runtime's `active` flag.
103
108
  */
@@ -3,8 +3,8 @@ import {
3
3
  awaitFirstWrongProxyProbe,
4
4
  bootstrapWrongProxy,
5
5
  shutdownWrongProxy
6
- } from "./chunk-3FHFGIIN.js";
7
- import "./chunk-3MAUU765.js";
6
+ } from "./chunk-AOAIPYFB.js";
7
+ import "./chunk-GWVLRUVH.js";
8
8
  import "./chunk-7OCVIDC7.js";
9
9
  export {
10
10
  applyWrongProxyPrefs,
@@ -12,4 +12,4 @@ export {
12
12
  bootstrapWrongProxy,
13
13
  shutdownWrongProxy
14
14
  };
15
- //# sourceMappingURL=proxy-wiring-7RPGBHZP.js.map
15
+ //# sourceMappingURL=proxy-wiring-G26YGP7S.js.map
@@ -0,0 +1,4 @@
1
+ import type { SlashCommand } from '@wrongstack/core/types';
2
+ import type { SlashCommandContext } from './command-context.js';
3
+ export declare function buildSidebarCommand(opts: SlashCommandContext): SlashCommand;
4
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -19,5 +19,12 @@ export interface SubcommandDeps {
19
19
  userHome: string;
20
20
  /** Parsed top-level flags after they have been removed from positional args. */
21
21
  flags?: Record<string, string | boolean>;
22
+ /**
23
+ * Live EventBus when a subcommand is invoked from a host that holds one
24
+ * (e.g. an in-process diagnostics surface). Standalone `wstack doctor`
25
+ * runs in a fresh process and has none — the handler then omits the
26
+ * listener-pressure line instead of fabricating counts.
27
+ */
28
+ events?: import('@wrongstack/core/kernel').EventBus | undefined;
22
29
  }
23
30
  //# sourceMappingURL=contracts.d.ts.map
@@ -20,7 +20,7 @@ interface CliWebUIOptions {
20
20
  uiLocale?: string | undefined;
21
21
  /** WrongProxy / WrongTrace toggle. */
22
22
  wrongProxyEnabled?: boolean | undefined;
23
- /** WrongProxy / WrongTrace URL. Default: 'http://localhost:8000'. */
23
+ /** WrongProxy / WrongTrace URL. Default: 'http://localhost:3444'. */
24
24
  wrongProxyUrl?: string | undefined;
25
25
  } | undefined;
26
26
  }
@@ -1693,4 +1693,4 @@ async function runWebUI(opts) {
1693
1693
  export {
1694
1694
  runWebUI
1695
1695
  };
1696
- //# sourceMappingURL=webui-server-UB75UHWX.js.map
1696
+ //# sourceMappingURL=webui-server-I53IYBW4.js.map
@@ -10,7 +10,7 @@
10
10
  * 3. Aborts in-flight probes on every state change so we never accumulate
11
11
  * a backlog when the user toggles the proxy on/off rapidly.
12
12
  * 4. Uses a small per-call AbortController + timeout (2s) so a hung
13
- * `localhost:8000` cannot stall the loop.
13
+ * `localhost:3444` cannot stall the loop.
14
14
  *
15
15
  * The probe is intentionally minimal: the daemon's `/api/health` response
16
16
  * shape is small and stable, so we don't try to parse it — a 2xx is
@@ -0,0 +1,18 @@
1
+ /**
2
+ * WrongTrace gate-decision counter — CLI re-export shim.
3
+ *
4
+ * The implementation lives in `@wrongstack/wrongtrace/src/gate-counters.ts`
5
+ * so EVERY process that runs the gate (CLI leader + fleet, standalone WebUI
6
+ * server) tallies against the same contract and the same counters file.
7
+ * This file exists only to keep the historical import path alive:
8
+ * - `execution-cleanup.ts` (dynamic import for session-end persist)
9
+ * - `brain-and-orchestration.ts` (fleet-runner emit-site recording)
10
+ * - `subcommands/handlers/diag-doctor.ts` (proxy-status readout)
11
+ * - `lifecycle-plugins.ts` (leader emit-site recording)
12
+ * - `tests/wrongtrace-gate-counters.test.ts`
13
+ * All five resolve through this shim; nothing imports the adapter
14
+ * implementation directly from CLI source.
15
+ */
16
+ export { createWrongTraceGateCounter, countersFilePath, formatGateCounterReport, loadWrongTraceGateCounters, persistWrongTraceGateCounters, recordGateDecision, resetGateDecisions, snapshotGateDecisions, } from '@wrongstack/wrongtrace';
17
+ export type { WrongTraceGateCounter, WrongTraceGateCounterSnapshot, } from '@wrongstack/wrongtrace';
18
+ //# sourceMappingURL=wrongtrace-gate-counters.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Re-export shim — the implementation moved into `@wrongstack/wrongtrace`
3
+ * so the CLI leader, fleet subagents, and the standalone WebUI server all
4
+ * share one gate without any of them importing `@wrongstack/cli` (the
5
+ * dependency direction cli → webui-server forbids the reverse edge).
6
+ *
7
+ * Every historical import path (`../wiring/wrongtrace-gate.js`) keeps
8
+ * working unchanged through this shim. NOTE: this is NOT core/utils'
9
+ * `withFileLock` (a local file lock) — same name, different mechanism.
10
+ */
11
+ export { getWrongTrace, preflightFileEdit, resetWrongTraceGate, withFileLock, } from "@wrongstack/wrongtrace";
12
+ export type { PreflightOptions, PreflightVerdict } from "@wrongstack/wrongtrace";
13
+ //# sourceMappingURL=wrongtrace-gate.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Re-export shim — the implementation moved into `@wrongstack/wrongtrace`
3
+ * (see wrongtrace-gate.ts for why). Same factories, same behaviour, now
4
+ * shared by every host process that executes tools.
5
+ */
6
+ export { createWrongTraceHookPair, createWrongTracePostToolUseHook, createWrongTracePreToolUseHook, } from "@wrongstack/wrongtrace";
7
+ export type { WrongTraceGateDecisionEvent, WrongTraceHookInput, WrongTraceHookOptions, WrongTraceHookPair, WrongTracePreToolUseOutcome, } from "@wrongstack/wrongtrace";
8
+ //# sourceMappingURL=wrongtrace-hooks.d.ts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * WrongTrace boot-prompt contributor — consumes the previously-unused
3
+ * `digestAtlas` and `summarizeFriction` helpers so the leader's system
4
+ * prompt, not just the executor gate, sees the daemon's observability.
5
+ *
6
+ * Contract:
7
+ * - Fail-open: daemon offline / any throw → `[]` (no prompt block).
8
+ * - Bounded: the gate singleton is warmed fire-and-forget at boot; this
9
+ * contributor races discovery + atlas/friction fetches against short
10
+ * deadlines so a cold/absent daemon can never stall the first build.
11
+ * Each race is capped at CONTRIBUTOR_DEADLINE_MS; discovery + fetch is
12
+ * at most ~2 × the deadline cold, far less once the singleton resolves
13
+ * (a live local daemon answers in single-digit ms).
14
+ * - Registered in `bindSystemPromptBuilder`'s contributors array, after
15
+ * the ETERNAL AUTONOMY contributor (registration order is preserved).
16
+ */
17
+ import type { SystemPromptContributor } from '@wrongstack/core/types';
18
+ /**
19
+ * Build the contributor. Fresh instance per `bindSystemPromptBuilder` call
20
+ * (i.e. per process); cheap since the gate singleton is process-shared.
21
+ */
22
+ export declare function createWrongTracePromptContributor(): SystemPromptContributor;
23
+ //# sourceMappingURL=wrongtrace-prompt-contributor.d.ts.map
@@ -0,0 +1,53 @@
1
+ /**
2
+ * WrongTrace session telemetry — the session-completion reporting hook.
3
+ *
4
+ * The daemon's /api/telemetry endpoint exists and answers 200 {ok:true}
5
+ * (verified live 2026-08-24), so WrongStack reports one summary per
6
+ * finished session: run id, agent/model/provider identity, token usage,
7
+ * and cost. This is what lets the daemon attribute activity (friction
8
+ * matrices, file lineage) to WrongStack sessions.
9
+ *
10
+ * Fail-open by construction: daemon offline → reportTelemetry returns
11
+ * null and this helper resolves without side effects; any throw is
12
+ * swallowed so session cleanup is never delayed or blocked by it.
13
+ */
14
+ import type { WrongTraceTelemetryReport } from '@wrongstack/wrongtrace';
15
+ /** Inputs the session-completion path already has in hand. */
16
+ export interface WrongTraceTelemetryInput {
17
+ sessionId: string;
18
+ /** Stable agent identity, e.g. 'wrongstack-cli'. */
19
+ agentName: string;
20
+ model: string;
21
+ provider: string;
22
+ /** Cumulative session usage from tokenCounter.total(). */
23
+ usage: {
24
+ input: number;
25
+ output: number;
26
+ cacheRead?: number | undefined;
27
+ cacheWrite?: number | undefined;
28
+ };
29
+ /** Session cost in USD from tokenCounter.estimateCost().total. */
30
+ costUsd: number;
31
+ }
32
+ /**
33
+ * Pure mapping to the daemon's POST /api/telemetry contract. Cache fields
34
+ * ride along as extras (the payload allows free-form pass-through), so
35
+ * downstream attribution keeps the full token picture.
36
+ */
37
+ export declare function buildWrongTraceTelemetryReport(input: WrongTraceTelemetryInput): WrongTraceTelemetryReport;
38
+ /**
39
+ * Report session telemetry, best-effort. Never throws: an offline daemon,
40
+ * transport failure, or malformed response resolves silently — telemetry
41
+ * must never delay or fail session cleanup.
42
+ *
43
+ * Optional client injection is a test seam; production uses the singleton.
44
+ */
45
+ export declare function reportWrongTraceSessionTelemetry(input: WrongTraceTelemetryInput, opts?: {
46
+ client?: {
47
+ isAvailable: boolean;
48
+ reportTelemetry: (r: WrongTraceTelemetryReport) => Promise<{
49
+ ok: boolean;
50
+ } | null>;
51
+ };
52
+ }): Promise<void>;
53
+ //# sourceMappingURL=wrongtrace-telemetry.d.ts.map