@wrongstack/cli 0.300.0 → 0.302.0

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 (62) hide show
  1. package/dist/{acp-IDNS2YVE.js → acp-DATHHPNT.js} +34 -15
  2. package/dist/acp-server-agent.d.ts +1 -1
  3. package/dist/{audit-2ZSFGNIF.js → audit-QRCLEHHW.js} +5 -1
  4. package/dist/{auth-6T6ZOT2R.js → auth-PJD3JRH2.js} +150 -37
  5. package/dist/boot/dispatch-webui.d.ts +3 -16
  6. package/dist/boot/launch-menu.d.ts +2 -4
  7. package/dist/boot/tool-registry.d.ts +3 -0
  8. package/dist/boot/webui-session-child.d.ts +91 -0
  9. package/dist/chimera-reviewer-policy.d.ts +10 -3
  10. package/dist/chimera-work-registry.d.ts +19 -0
  11. package/dist/{chronicle-QQEQFSSE.js → chronicle-63MFCZN6.js} +26 -5
  12. package/dist/{chunk-YWUPHRGB.js → chunk-263G3FMB.js} +33 -10
  13. package/dist/{chunk-GYDQABMA.js → chunk-2KDOFTTM.js} +44 -32
  14. package/dist/{chunk-V76R7DC5.js → chunk-3MOUBRKZ.js} +311 -309
  15. package/dist/chunk-CSAPOCBP.js +24 -0
  16. package/dist/{chunk-N7ULWBO5.js → chunk-ETOEGL3V.js} +3 -7
  17. package/dist/{chunk-3MWUZMOL.js → chunk-GUHQQG63.js} +14 -3
  18. package/dist/chunk-KE7E7DPX.js +38 -0
  19. package/dist/{chunk-PEMN4T5O.js → chunk-MT6FGXO3.js} +23 -4
  20. package/dist/chunk-PFVVUH5B.js +127 -0
  21. package/dist/{chunk-DPJZQCVP.js → chunk-YMXXOOFN.js} +1 -1
  22. package/dist/{chunk-4WJKVQJY.js → chunk-ZECLGUTF.js} +15 -3
  23. package/dist/cli-context.d.ts +2 -0
  24. package/dist/{cli-main-7B3G2YSG.js → cli-main-EOJ74CI4.js} +336 -99
  25. package/dist/execute-deps.d.ts +3 -0
  26. package/dist/{execution-SHGM7BVC.js → execution-CQ772VPS.js} +246 -97
  27. package/dist/execution-chimera-cascade.d.ts +3 -4
  28. package/dist/execution-chimera-review.d.ts +2 -3
  29. package/dist/execution-cleanup.d.ts +3 -2
  30. package/dist/execution.d.ts +1 -1
  31. package/dist/{export-TPORYVRZ.js → export-DOBGPY23.js} +12 -1
  32. package/dist/fleet/host-context.d.ts +1 -1
  33. package/dist/fleet/host-helpers.d.ts +14 -0
  34. package/dist/fleet/status-broadcast.d.ts +1 -1
  35. package/dist/{hq-DVDD4XPV.js → hq-LN5CJHCM.js} +2 -2
  36. package/dist/hq-server/routes.d.ts +10 -1
  37. package/dist/hq-server/ws.d.ts +17 -6
  38. package/dist/{hq-server-DQHLNHDL.js → hq-server-S7HZG3PA.js} +3 -2
  39. package/dist/index.js +142 -100
  40. package/dist/live-settings-input.d.ts +5 -0
  41. package/dist/{mcp-CYLPUEHC.js → mcp-OHPJH73U.js} +6 -2
  42. package/dist/{modeldiag-YOQZHBQV.js → modeldiag-3DOK4BWW.js} +2 -2
  43. package/dist/{plugin-usage-EOG4ET4S.js → plugin-usage-YEVLOR33.js} +7 -3
  44. package/dist/{plugins-56CMWMPR.js → plugins-K3BAUP4D.js} +3 -3
  45. package/dist/profile-config-path.d.ts +0 -2
  46. package/dist/provider-helpers.d.ts +0 -5
  47. package/dist/{providers-models-K6RT7ABI.js → providers-models-WEZ4EGLL.js} +6 -5
  48. package/dist/{replay-KCTXNMZQ.js → replay-FCBNHW3K.js} +5 -1
  49. package/dist/{rewind-EJMVFVLS.js → rewind-AOD3JIYX.js} +5 -1
  50. package/dist/{sessions-config-NLCMK3BY.js → sessions-config-XXN7267N.js} +8 -3
  51. package/dist/subcommands/flags.d.ts +23 -0
  52. package/dist/terminal-format.d.ts +15 -0
  53. package/dist/{webui-server-G3EKFXLL.js → webui-server-NFNRGNNT.js} +54 -29
  54. package/dist/webui-server-options.d.ts +7 -0
  55. package/dist/wiring/brain-and-orchestration.d.ts +1 -1
  56. package/dist/wiring/mailbox-bridge-bootstrap.d.ts +3 -1
  57. package/dist/wiring/management-tools.d.ts +9 -1
  58. package/dist/wiring/pipeline.d.ts +5 -5
  59. package/dist/wiring/plugins.d.ts +2 -3
  60. package/dist/wiring/provider-utility-tools.d.ts +1 -0
  61. package/dist/wiring/tools.d.ts +4 -5
  62. package/package.json +23 -23
@@ -3,19 +3,18 @@ import type { ExecuteDeps } from './execute-deps.js';
3
3
  type Director = NonNullable<ExecuteDeps['fleet']['director']>;
4
4
  type Events = ExecuteDeps['core']['events'];
5
5
  type Session = ExecuteDeps['session']['session'];
6
- type PendingChimeraWork = Promise<void> | undefined;
7
6
  export type InstallChimeraCascadeHandlerOptions = {
8
7
  events: Events;
9
8
  director: Director | null | undefined;
10
9
  session: Session;
11
- getPendingWork: () => PendingChimeraWork;
12
- setPendingWork: (work: PendingChimeraWork) => void;
10
+ getPendingWork: () => Promise<void> | undefined;
11
+ trackWork: (work: Promise<void>) => void;
13
12
  /**
14
13
  * Model ladder for cascade spawns. Supplied by the caller because only it
15
14
  * holds the live config. Omit to keep the single unpinned spawn.
16
15
  */
17
16
  buildLadder?: (() => ReviewerAttempt[]) | undefined;
18
17
  };
19
- export declare function installChimeraCascadeHandler({ events, director, session, getPendingWork, setPendingWork, buildLadder, }: InstallChimeraCascadeHandlerOptions): void;
18
+ export declare function installChimeraCascadeHandler({ events, director, session, getPendingWork, trackWork, buildLadder, }: InstallChimeraCascadeHandlerOptions): void;
20
19
  export {};
21
20
  //# sourceMappingURL=execution-chimera-cascade.d.ts.map
@@ -7,7 +7,6 @@ type Session = ExecuteDeps['session']['session'];
7
7
  type Mailbox = ExecuteDeps['session']['mailbox'];
8
8
  type Agent = ExecuteDeps['core']['agent'];
9
9
  type Config = ExecuteDeps['core']['config'];
10
- type PendingChimeraWork = Promise<void> | undefined;
11
10
  /**
12
11
  * Canonicalize a file path for citation gating. The reviewer can cite
13
12
  * absolute Windows paths (`D:\Codebox\...`) or mix casing on a
@@ -38,8 +37,8 @@ export type InstallChimeraReviewHandlerOptions = {
38
37
  */
39
38
  statusTracker?: ProviderModelStatusTracker | undefined;
40
39
  persistReview?: ((payload: ChimeraReviewCompletePayload, projectDir: string) => Promise<void>) | undefined;
41
- setPendingWork: (work: PendingChimeraWork) => void;
40
+ trackWork: (work: Promise<void>) => void;
42
41
  };
43
- export declare function installChimeraReviewHandler({ events, director, session, mailbox, agent, config, projectDir, statusTracker, persistReview, setPendingWork, }: InstallChimeraReviewHandlerOptions): void;
42
+ export declare function installChimeraReviewHandler({ events, director, session, mailbox, agent, config, projectDir, statusTracker, persistReview, trackWork, }: InstallChimeraReviewHandlerOptions): void;
44
43
  export {};
45
44
  //# sourceMappingURL=execution-chimera-review.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import type { Director } from '@wrongstack/core/coordination';
2
+ import type { ChimeraWorkRegistry } from './chimera-work-registry.js';
2
3
  import type { ExecuteDeps } from './execute-deps.js';
3
4
  import type { FleetStatusLine } from './fleet-statusline.js';
4
5
  export interface ExecutionCleanupInput {
@@ -13,8 +14,8 @@ export interface ExecutionCleanupInput {
13
14
  session: ExecuteDeps['session']['session'];
14
15
  tokenCounter: ExecuteDeps['core']['tokenCounter'];
15
16
  events: ExecuteDeps['core']['events'];
16
- /** Getter for chimera's in-flight work promise avoids stale captures. */
17
- getPendingChimeraWork?: () => Promise<void> | undefined;
17
+ /** Session-scoped Chimera work tracker; drained before agent/session teardown. */
18
+ chimeraWork?: ChimeraWorkRegistry | undefined;
18
19
  /** Optional director reference for fleet cleanup at session end. */
19
20
  director?: Director | null | undefined;
20
21
  reader: ExecuteDeps['ui']['reader'];
@@ -1,6 +1,6 @@
1
1
  import type { ExecuteDeps } from './execute-deps.js';
2
2
  export type { LiveSettingsInput } from './live-settings-input.js';
3
- export { __resetReviewerRoundRobinCursor, applyChimeraReviewerReadOnlyPolicy, assignReviewerModelsRoundRobin, CHIMERA_REVIEW_READ_ONLY_TOOLS, resolveReviewerFallbackModels, } from './chimera-reviewer-policy.js';
3
+ export { __resetReviewerRoundRobinCursor, applyChimeraReviewerReadOnlyPolicy, assignReviewerModels, assignReviewerModelsRoundRobin, CHIMERA_REVIEW_READ_ONLY_TOOLS, resolveReviewerFallbackModels, } from './chimera-reviewer-policy.js';
4
4
  export type { BrainData, BrainLogEntry, ExecuteDeps, McpPickerItem, PluginPickerItem, RestoredToolCall, ToolPickerItem, } from './execute-deps.js';
5
5
  export declare function execute(deps: ExecuteDeps): Promise<number>;
6
6
  //# sourceMappingURL=execution.d.ts.map
@@ -1,3 +1,6 @@
1
+ import {
2
+ restoreFlags
3
+ } from "./chunk-CSAPOCBP.js";
1
4
  import "./chunk-7OCVIDC7.js";
2
5
 
3
6
  // src/subcommands/handlers/export.ts
@@ -7,6 +10,14 @@ import { DefaultSessionReader } from "@wrongstack/core/storage";
7
10
  import { expectDefined } from "@wrongstack/core/utils";
8
11
  import { toErrorMessage } from "@wrongstack/core/utils";
9
12
  var exportCmd = async (args, deps) => {
13
+ args = restoreFlags(args, deps, [
14
+ "format",
15
+ "f",
16
+ "out",
17
+ "o",
18
+ "no-tools",
19
+ "no-diagnostics"
20
+ ]);
10
21
  if (!deps.sessionStore) {
11
22
  deps.renderer.writeError("No session store configured.");
12
23
  return 1;
@@ -61,4 +72,4 @@ var exportCmd = async (args, deps) => {
61
72
  export {
62
73
  exportCmd
63
74
  };
64
- //# sourceMappingURL=export-TPORYVRZ.js.map
75
+ //# sourceMappingURL=export-DOBGPY23.js.map
@@ -1,5 +1,5 @@
1
1
  import type { SubagentConfig } from '@wrongstack/core/types';
2
2
  import type { MultiAgentDeps } from './host-types.js';
3
- export declare function resolveHostSubagentSkillContent(deps: MultiAgentDeps, roster: Record<string, SubagentConfig>, subCfg: SubagentConfig): Promise<string>;
3
+ export declare function resolveHostSubagentSkillContent(deps: MultiAgentDeps, roster: Record<string, SubagentConfig>, subCfg: SubagentConfig, availableToolNames?: readonly string[]): Promise<string>;
4
4
  export declare function retrieveHostSubagentMemory(deps: MultiAgentDeps, getLeaderMode: (() => string | undefined) | undefined, subCfg: SubagentConfig, taskContext?: Record<string, unknown>): Promise<string[]>;
5
5
  //# sourceMappingURL=host-context.d.ts.map
@@ -10,6 +10,20 @@ export declare function buildShadowAgentTaskDescription(reason: string): string;
10
10
  export declare function touchLruKey(order: string[], key: string): void;
11
11
  export declare function setBoundedLruEntry<T>(map: Map<string, T>, order: string[], key: string, value: T, maxEntries: number): void;
12
12
  export declare const DEFAULT_SUBAGENT_HIDDEN_TOOLS: Set<string>;
13
+ /**
14
+ * Tools a subagent can never receive — not even through an explicit
15
+ * `tools: [...]` allowlist.
16
+ *
17
+ * This is stricter than {@link DEFAULT_SUBAGENT_HIDDEN_TOOLS}, which only hides
18
+ * orchestration controls from the unrestricted default slice and still hands
19
+ * them over when a spawn asks for them by name. `nextsteps` records the
20
+ * leader's after-task suggestions: the runtime folds a recorded block into a
21
+ * LEADER turn only (`next-steps-slot.ts`), and `WIDE_SUBAGENT_CAPABILITIES`
22
+ * does not carry `session.nextsteps`. Granting it would produce either a
23
+ * permission rejection or a silent no-op, so asking for it by name is a
24
+ * mistake to correct rather than an intent to honor.
25
+ */
26
+ export declare const NEVER_SUBAGENT_TOOLS: Set<string>;
13
27
  export declare function selectSubagentTools(allTools: readonly Tool[], directorToolsByName: ReadonlyMap<string, Tool>, allow?: readonly string[] | undefined): Tool[];
14
28
  export declare function resolveSubagentCapabilities(subCfg: SubagentConfig, toolsForAllow: (allow: readonly string[]) => readonly Tool[]): readonly string[] | undefined;
15
29
  export declare function resolveFleetWorktreePolicy(config: Config): FleetWorktreePolicy;
@@ -22,8 +22,8 @@
22
22
  *
23
23
  * @module fleet/status-broadcast
24
24
  */
25
- import type { EventBus } from '@wrongstack/core/kernel';
26
25
  import type { Mailbox } from '@wrongstack/core/coordination';
26
+ import type { EventBus } from '@wrongstack/core/kernel';
27
27
  import type { FleetConfig } from '@wrongstack/core/types';
28
28
  export interface FleetStatusBroadcasterOptions {
29
29
  /** Host EventBus carrying the re-emitted `subagent.*` lifecycle events. */
@@ -36,7 +36,7 @@ var hqCmd = async (args, deps) => {
36
36
  return 1;
37
37
  };
38
38
  async function startServer(deps) {
39
- const { startHqServer } = await import("./hq-server-DQHLNHDL.js");
39
+ const { startHqServer } = await import("./hq-server-S7HZG3PA.js");
40
40
  const dataDir = resolveDataDir(deps);
41
41
  const flags = deps.flags ?? {};
42
42
  const host = typeof flags["host"] === "string" ? flags["host"] : HQ_CLI_DEFAULT_HOST;
@@ -563,4 +563,4 @@ export {
563
563
  hqCmd,
564
564
  resolveAuditActor
565
565
  };
566
- //# sourceMappingURL=hq-DVDD4XPV.js.map
566
+ //# sourceMappingURL=hq-LN5CJHCM.js.map
@@ -51,7 +51,16 @@ export interface HqRouterMailboxGateway {
51
51
  export interface HqRouterDeps {
52
52
  trustBoundary: TrustBoundary;
53
53
  host: string;
54
- listeningPort: number;
54
+ /**
55
+ * Getter, not a value. The router is constructed BEFORE `listen()`
56
+ * resolves, so a copied number froze the REQUESTED port. When the default
57
+ * is busy and `strictPort` is off, the scan binds `port+1` and the banner
58
+ * prints it — but the origin guard kept comparing against the old number and
59
+ * answered `403 forbidden: untrusted request origin` to the dashboard and
60
+ * every `/api/*` call. (The WS upgrade handler read the live local, so the
61
+ * failure looked like "the socket connects but the page won't load".)
62
+ */
63
+ listeningPort: () => number;
55
64
  trustedPublicOrigins: Set<string>;
56
65
  /** Trust `Origin: file://`. Off by default — see StartHqServerOptions (WS-081). */
57
66
  allowFileOrigin?: boolean | undefined;
@@ -32,11 +32,22 @@ export declare function detectLeaderLoss(lostClient: ConnectedClient, clients: M
32
32
  /**
33
33
  * Server-side fanout of a `hq.kanban_snapshot` envelope after a merge.
34
34
  *
35
- * C2 — broadcasts the post-merge `delta` payload to:
36
- * - every client whose `projectId` matches `projectId`, and
37
- * - every browser in `browsers` (browsers are not project-scoped at the
38
- * WS level; the browser-side projection filters by project when it
39
- * applies the snapshot).
35
+ * C2 — broadcasts the post-merge `delta` payload to every client whose
36
+ * `projectId` matches `projectId`.
37
+ *
38
+ * BROWSERS ARE DELIBERATELY NOT NOTIFIED. They used to be — unscoped, so
39
+ * every browser received every project's deltas — on the strength of a
40
+ * comment claiming "the browser-side projection filters by project when it
41
+ * applies the snapshot". No such projection exists: `hq.kanban_snapshot` is
42
+ * absent from `HqBrowserMessage` and from the SPA's dispatch chain, so
43
+ * `HqWsClient` parsed each frame and dropped it. The board view learns about
44
+ * changes from the `kanban.snapshot` HQ *event* and refetches over HTTP
45
+ * (`views/kanban.tsx`), which is why the drift was invisible.
46
+ *
47
+ * `browsers` stays in the signature: the fan-out is the natural place to wire
48
+ * a real browser consumer, and the parity test in
49
+ * `tests/hq-browser-protocol-parity.test.ts` now fails the moment a
50
+ * browser-bound frame has no handler.
40
51
  *
41
52
  * The `delta` payload is the same touched-only payload the merge handler
42
53
  * builds (full-set broadcasts drive V8 heap exhaustion on long-lived
@@ -44,7 +55,7 @@ export declare function detectLeaderLoss(lostClient: ConnectedClient, clients: M
44
55
  *
45
56
  * Exported for direct unit testing in `tests/hq-kanban-fanout.test.ts`.
46
57
  */
47
- export declare function fanoutKanbanDelta(message: string, clients: Map<WebSocket, ConnectedClient>, browsers: Set<WebSocket>, projectId: string): {
58
+ export declare function fanoutKanbanDelta(message: string, clients: Map<WebSocket, ConnectedClient>, _browsers: Set<WebSocket>, projectId: string): {
48
59
  clientsNotified: number;
49
60
  browsersNotified: number;
50
61
  };
@@ -15,7 +15,8 @@ import {
15
15
  readLocalSubagentTranscript,
16
16
  sanitizeApiError,
17
17
  startHqServer
18
- } from "./chunk-GYDQABMA.js";
18
+ } from "./chunk-2KDOFTTM.js";
19
+ import "./chunk-KE7E7DPX.js";
19
20
  import "./chunk-Q5GTM25S.js";
20
21
  import "./chunk-7OCVIDC7.js";
21
22
  export {
@@ -36,4 +37,4 @@ export {
36
37
  sanitizeApiError,
37
38
  startHqServer
38
39
  };
39
- //# sourceMappingURL=hq-server-DQHLNHDL.js.map
40
+ //# sourceMappingURL=hq-server-S7HZG3PA.js.map