@wrongstack/cli 0.287.0 → 0.289.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.
- package/README.md +93 -1
- package/dist/arg-parser.d.ts.map +1 -1
- package/dist/auth-menu/anthropic-oauth.d.ts.map +1 -1
- package/dist/auth-menu/index.d.ts +1 -0
- package/dist/auth-menu/index.d.ts.map +1 -1
- package/dist/auth-menu/oauth-menu.d.ts +11 -0
- package/dist/auth-menu/oauth-menu.d.ts.map +1 -1
- package/dist/auth-menu/openai-codex-oauth.d.ts.map +1 -1
- package/dist/boot/dispatch-webui.d.ts +5 -0
- package/dist/boot/dispatch-webui.d.ts.map +1 -1
- package/dist/boot/launch-menu.d.ts +129 -0
- package/dist/boot/launch-menu.d.ts.map +1 -0
- package/dist/boot/short-circuit-hq.d.ts.map +1 -1
- package/dist/boot/{tui-autophase-wiring.d.ts → tui-goal-wiring.d.ts} +6 -6
- package/dist/boot/tui-goal-wiring.d.ts.map +1 -0
- package/dist/boot/tui-session-resume.d.ts +3 -1
- package/dist/boot/tui-session-resume.d.ts.map +1 -1
- package/dist/boot/tui-settings-adapter.d.ts.map +1 -1
- package/dist/boot.d.ts.map +1 -1
- package/dist/cli-context.d.ts +1 -0
- package/dist/cli-context.d.ts.map +1 -1
- package/dist/cli-entry-point.d.ts +19 -0
- package/dist/cli-entry-point.d.ts.map +1 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/execute-deps.d.ts +11 -1
- package/dist/execute-deps.d.ts.map +1 -1
- package/dist/execution.d.ts +3 -1
- package/dist/execution.d.ts.map +1 -1
- package/dist/fleet/host.d.ts +17 -1
- package/dist/fleet/host.d.ts.map +1 -1
- package/dist/fleet/status-broadcast.d.ts +4 -4
- package/dist/fleet/status-broadcast.d.ts.map +1 -1
- package/dist/{autophase-host.d.ts → goal-host.d.ts} +30 -30
- package/dist/goal-host.d.ts.map +1 -0
- package/dist/hq-server/auth.d.ts +10 -2
- package/dist/hq-server/auth.d.ts.map +1 -1
- package/dist/hq-server/snapshot.d.ts +4 -2
- package/dist/hq-server/snapshot.d.ts.map +1 -1
- package/dist/hq-server/ws.d.ts.map +1 -1
- package/dist/hq-server.d.ts +26 -0
- package/dist/hq-server.d.ts.map +1 -1
- package/dist/index.js +6831 -4591
- package/dist/index.js.map +4 -4
- package/dist/input-reader.d.ts +2 -0
- package/dist/input-reader.d.ts.map +1 -1
- package/dist/launch-hints.d.ts +5 -3
- package/dist/launch-hints.d.ts.map +1 -1
- package/dist/session-event-wiring.d.ts +8 -1
- package/dist/session-event-wiring.d.ts.map +1 -1
- package/dist/slash-commands/clear.d.ts +1 -1
- package/dist/slash-commands/clear.d.ts.map +1 -1
- package/dist/slash-commands/goal.d.ts +9 -0
- package/dist/slash-commands/goal.d.ts.map +1 -1
- package/dist/slash-commands/index.d.ts +33 -14
- package/dist/slash-commands/index.d.ts.map +1 -1
- package/dist/slash-commands/interrupt.d.ts +10 -0
- package/dist/slash-commands/interrupt.d.ts.map +1 -1
- package/dist/slash-commands/memory.d.ts.map +1 -1
- package/dist/slash-commands/mode.d.ts.map +1 -1
- package/dist/slash-commands/provider-status.d.ts +21 -0
- package/dist/slash-commands/provider-status.d.ts.map +1 -0
- package/dist/slash-commands/techstack.d.ts.map +1 -1
- package/dist/slash-commands/telegram-pairing.d.ts +41 -0
- package/dist/slash-commands/telegram-pairing.d.ts.map +1 -0
- package/dist/slash-commands/telegram-settings.d.ts.map +1 -1
- package/dist/slash-commands/telegram-setup.d.ts +13 -5
- package/dist/slash-commands/telegram-setup.d.ts.map +1 -1
- package/dist/slash-commands/worktree.d.ts +1 -1
- package/dist/subcommands/handlers/auth.d.ts.map +1 -1
- package/dist/subcommands/handlers/chronicle.d.ts +4 -0
- package/dist/subcommands/handlers/chronicle.d.ts.map +1 -0
- package/dist/subcommands/handlers/hq.d.ts.map +1 -1
- package/dist/subcommands/handlers/mailbox-serve.d.ts.map +1 -1
- package/dist/subcommands/handlers/rewind.d.ts.map +1 -1
- package/dist/subcommands/handlers/update.d.ts +12 -1
- package/dist/subcommands/handlers/update.d.ts.map +1 -1
- package/dist/subcommands/index.d.ts.map +1 -1
- package/dist/update-check.d.ts +13 -2
- package/dist/update-check.d.ts.map +1 -1
- package/dist/webui-server/connection-handler.d.ts +8 -2
- package/dist/webui-server/connection-handler.d.ts.map +1 -1
- package/dist/webui-server/kanban-run-mirror.d.ts +13 -13
- package/dist/webui-server/kanban-run-mirror.d.ts.map +1 -1
- package/dist/webui-server/kanban-supervisor.d.ts.map +1 -1
- package/dist/webui-server/lifecycle.d.ts +1 -1
- package/dist/webui-server/message-router.d.ts +2 -2
- package/dist/webui-server/message-router.d.ts.map +1 -1
- package/dist/webui-server/prefs-seeding.d.ts +1 -1
- package/dist/webui-server/prefs-seeding.d.ts.map +1 -1
- package/dist/webui-server/session-start-payload.d.ts.map +1 -1
- package/dist/webui-server/session-status-poll.d.ts +2 -0
- package/dist/webui-server/session-status-poll.d.ts.map +1 -1
- package/dist/webui-server/setup-events.d.ts.map +1 -1
- package/dist/webui-server/static-serve.d.ts +14 -0
- package/dist/webui-server/static-serve.d.ts.map +1 -1
- package/dist/webui-server/stream-coalescer.d.ts +8 -0
- package/dist/webui-server/stream-coalescer.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/agent-config.d.ts +7 -1
- package/dist/webui-server/ws-handlers/agent-config.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/kanban.d.ts +7 -0
- package/dist/webui-server/ws-handlers/kanban.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/prefs.d.ts +2 -0
- package/dist/webui-server/ws-handlers/prefs.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/providers.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/sessions.d.ts.map +1 -1
- package/dist/webui-server.d.ts +6 -0
- package/dist/webui-server.d.ts.map +1 -1
- package/dist/wiring/brain-and-orchestration.d.ts +4 -0
- package/dist/wiring/brain-and-orchestration.d.ts.map +1 -1
- package/dist/wiring/codebase-index.d.ts.map +1 -1
- package/dist/wiring/controllers.d.ts +4 -0
- package/dist/wiring/controllers.d.ts.map +1 -1
- package/dist/wiring/provider-runtime-setup.d.ts +5 -1
- package/dist/wiring/provider-runtime-setup.d.ts.map +1 -1
- package/dist/wiring/sdd-handlers.d.ts +2 -0
- package/dist/wiring/sdd-handlers.d.ts.map +1 -0
- package/dist/wiring/session.d.ts +17 -0
- package/dist/wiring/session.d.ts.map +1 -1
- package/dist/wiring/slash-commands.d.ts +3 -1
- package/dist/wiring/slash-commands.d.ts.map +1 -1
- package/dist/wiring/super-memory.d.ts.map +1 -1
- package/package.json +21 -20
- package/dist/autophase-host.d.ts.map +0 -1
- package/dist/boot/tui-autophase-wiring.d.ts.map +0 -1
- package/dist/slash-commands/autophase.d.ts +0 -13
- package/dist/slash-commands/autophase.d.ts.map +0 -1
package/dist/fleet/host.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BrainArbiter, SubagentRunner } from '@wrongstack/core';
|
|
2
|
-
import { type AgentFactory, type Config, type ConfigStore, type Container, Director, EventBus, type ModelsRegistry, type ProviderRegistry, type SessionWriter, type SystemPromptBuilder, type TaskResult, type TokenCounter, ToolRegistry } from '@wrongstack/core';
|
|
2
|
+
import { type AgentFactory, type Config, type ConfigStore, type Container, Director, EventBus, type FallbackProfileManager, type ModelsRegistry, type ProviderRegistry, type SessionWriter, type SystemPromptBuilder, type TaskResult, type TokenCounter, ToolRegistry } from '@wrongstack/core';
|
|
3
|
+
import type { ProviderModelStatusTracker } from '@wrongstack/core/coordination';
|
|
3
4
|
export interface MultiAgentDeps {
|
|
4
5
|
container: Container;
|
|
5
6
|
toolRegistry: ToolRegistry;
|
|
@@ -21,6 +22,8 @@ export interface MultiAgentDeps {
|
|
|
21
22
|
cwd: string;
|
|
22
23
|
secretScrubber: import('@wrongstack/core').SecretScrubber;
|
|
23
24
|
renderer?: import('@wrongstack/core').Renderer | undefined;
|
|
25
|
+
/** Shared live fallback profile manager from the runtime container. */
|
|
26
|
+
fallbackProfileManager: FallbackProfileManager;
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
26
29
|
* Per-session options for the multi-agent host. Director Mode is always
|
|
@@ -163,6 +166,18 @@ export interface MultiAgentHostOptions {
|
|
|
163
166
|
* Override for embedders whose leader uses a custom base id.
|
|
164
167
|
*/
|
|
165
168
|
getLeaderMailboxId?: (() => string | undefined) | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* Live getter for the leader's current mode id (e.g. 'teach', 'brief').
|
|
171
|
+
* When set, spawned subagents inherit it as `memoryContext.mode` so
|
|
172
|
+
* audience-scoped memories targeting that mode are injected.
|
|
173
|
+
*/
|
|
174
|
+
getLeaderMode?: (() => string | undefined) | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Shared provider/model status tracker. When set, the Director checks
|
|
177
|
+
* whether the resolved provider/model is blocked before spawning a new
|
|
178
|
+
* subagent.
|
|
179
|
+
*/
|
|
180
|
+
statusTracker?: ProviderModelStatusTracker | undefined;
|
|
166
181
|
}
|
|
167
182
|
/**
|
|
168
183
|
* Lazy holder — created on first /spawn call, reused across the session
|
|
@@ -277,6 +292,7 @@ export declare class MultiAgentHost {
|
|
|
277
292
|
* specialized, concurrency-safe agent instead of sharing the leader's Context.
|
|
278
293
|
*/
|
|
279
294
|
makeSubagentFactory(config: Config): AgentFactory;
|
|
295
|
+
private retrieveSubagentMemory;
|
|
280
296
|
/**
|
|
281
297
|
* Build the per-subagent runner.
|
|
282
298
|
*
|
package/dist/fleet/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/fleet/host.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAIL,KAAK,YAAY,EAGjB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,SAAS,EAOd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MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;KACtF,CAiDA;IAED;;;;;;;;;OASG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAOvC;IAED;;;;;OAKG;IACG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAiBlD;IAED;;OAEG;IACH,cAAc,IAAI,OAAO,CAExB;IAED;;;;;OAKG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAK/C;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAgB7B;IAED;;;;;OAKG;IACH,gBAAgB,IAAI,MAAM,CAKzB;IAED;;;;;;;;OAQG;IACH,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAahC;IAED;;;;;;OAMG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAwC7B;CACF"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* status-broadcast — mailbox broadcasts on meaningful subagent transitions.
|
|
3
3
|
*
|
|
4
4
|
* The third leg of peer awareness (with the fleet-pulse digest and the
|
|
5
|
-
* fleet_status tool): when a fleet subagent joins,
|
|
6
|
-
* hits budget pressure, a low-priority `type:'status'`
|
|
7
|
-
* the project mailbox so every OTHER agent — including
|
|
8
|
-
* processes on the same project — sees it on its next iteration.
|
|
5
|
+
* fleet_status tool): when a fleet subagent joins, finishes a task, or (when
|
|
6
|
+
* explicitly enabled) hits budget pressure, a low-priority `type:'status'`
|
|
7
|
+
* broadcast lands in the project mailbox so every OTHER agent — including
|
|
8
|
+
* agents in other processes on the same project — sees it on its next iteration.
|
|
9
9
|
*
|
|
10
10
|
* It also keeps the mailbox registry heartbeat rich: task start/stop
|
|
11
11
|
* transitions push `currentTask`/`status` into the registry, which is what
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-broadcast.d.ts","sourceRoot":"","sources":["../../src/fleet/status-broadcast.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,6BAA6B;IAC5C,2EAA2E;IAC3E,MAAM,EAAE,QAAQ,CAAC;IACjB,yEAAyE;IACzE,cAAc,EAAE,MAAM,OAAO,CAAC;IAC9B,kEAAkE;IAClE,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,oEAAoE;IACpE,YAAY,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACxE,MAAM,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC;CACtD;AAYD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,6BAA6B,GAAG;IACjF,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;CACd,
|
|
1
|
+
{"version":3,"file":"status-broadcast.d.ts","sourceRoot":"","sources":["../../src/fleet/status-broadcast.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,6BAA6B;IAC5C,2EAA2E;IAC3E,MAAM,EAAE,QAAQ,CAAC;IACjB,yEAAyE;IACzE,cAAc,EAAE,MAAM,OAAO,CAAC;IAC9B,kEAAkE;IAClE,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,oEAAoE;IACpE,YAAY,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACxE,MAAM,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC;CACtD;AAYD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,6BAA6B,GAAG;IACjF,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;CACd,CA+JA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Goal host wiring for the CLI.
|
|
3
3
|
*
|
|
4
4
|
* Turns a free-text goal into a real, LLM-driven phase run:
|
|
5
5
|
* 1. PLAN — a one-shot subagent generates a phase-by-phase plan where each
|
|
6
|
-
* phase carries many concrete todos (
|
|
6
|
+
* phase carries many concrete todos (GoalPlanner).
|
|
7
7
|
* 2. BUILD — PhaseGraphBuilder materializes the plan into a PhaseGraph with a
|
|
8
8
|
* populated TaskGraph per phase, persisted as per-project JSON.
|
|
9
9
|
* 3. RUN — PhaseOrchestrator drives the graph in the background; every task
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
import { type BrainArbiter, type Config, type EventBus, type PhaseGraph, type PhaseProgress, type TaskNode } from '@wrongstack/core';
|
|
19
19
|
import type { MultiAgentHost } from './multi-agent.js';
|
|
20
20
|
/**
|
|
21
|
-
* Extend/trim the autonomous
|
|
22
|
-
* policy. Mirrors `configureExecPolicy` but keeps
|
|
21
|
+
* Extend/trim the autonomous goal command allowlist from the user's exec
|
|
22
|
+
* policy. Mirrors `configureExecPolicy` but keeps goal's narrower base.
|
|
23
23
|
* Idempotent (always rebuilt from the base).
|
|
24
24
|
*/
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function configureGoalPolicy(opts?: {
|
|
26
26
|
allow?: readonly string[] | undefined;
|
|
27
27
|
deny?: readonly string[] | undefined;
|
|
28
28
|
}): void;
|
|
29
|
-
/** Reset the
|
|
30
|
-
export declare function
|
|
31
|
-
/** Whether `cmd` may run in autonomous
|
|
32
|
-
export declare function
|
|
33
|
-
export interface
|
|
29
|
+
/** Reset the goal allowlist to its built-in base (tests / re-init). */
|
|
30
|
+
export declare function resetGoalPolicy(): void;
|
|
31
|
+
/** Whether `cmd` may run in autonomous goal verification. */
|
|
32
|
+
export declare function isGoalCommandAllowed(cmd: string): boolean;
|
|
33
|
+
export interface GoalHostDeps {
|
|
34
34
|
multiAgentHost: MultiAgentHost;
|
|
35
35
|
/** Read the *current* Config lazily (it may be patched, e.g. YOLO toggles). */
|
|
36
36
|
getConfig: () => Config;
|
|
@@ -38,66 +38,66 @@ export interface AutoPhaseHostDeps {
|
|
|
38
38
|
events: EventBus;
|
|
39
39
|
/** Current parent session id for worktree lifecycle events. */
|
|
40
40
|
getSessionId?: (() => string | undefined) | undefined;
|
|
41
|
-
/** Directory for per-project phase-graph JSON (wpaths.
|
|
41
|
+
/** Directory for per-project phase-graph JSON (wpaths.projectGoal). */
|
|
42
42
|
storeDir: string;
|
|
43
43
|
/** Project root — base for git-worktree isolation. */
|
|
44
44
|
projectRoot: string;
|
|
45
45
|
/**
|
|
46
46
|
* Enable per-phase git-worktree isolation (default true). When on and the
|
|
47
47
|
* project is a git repo, parallelizable phases run in isolated worktrees and
|
|
48
|
-
* merge back sequentially. Disable with
|
|
48
|
+
* merge back sequentially. Disable with WRONGSTACK_GOAL_WORKTREES=0.
|
|
49
49
|
*/
|
|
50
50
|
worktrees?: boolean | undefined;
|
|
51
51
|
/** Max parallel phases when worktrees are active (default 4). */
|
|
52
52
|
maxConcurrentPhases?: number | undefined;
|
|
53
|
-
/** Optional global Brain arbiter for
|
|
53
|
+
/** Optional global Brain arbiter for Goal policy decisions. */
|
|
54
54
|
brain?: BrainArbiter | undefined;
|
|
55
55
|
/** Optional progress logger (rendered to the user during start). */
|
|
56
56
|
log?: ((line: string) => void) | undefined;
|
|
57
57
|
}
|
|
58
|
-
/** A live, read-only view of the running
|
|
59
|
-
export interface
|
|
58
|
+
/** A live, read-only view of the running Goal, exposed to slash commands. */
|
|
59
|
+
export interface GoalRunnerView {
|
|
60
60
|
graph: PhaseGraph;
|
|
61
61
|
getProgress: () => PhaseProgress | null;
|
|
62
62
|
isRunning: () => boolean;
|
|
63
63
|
}
|
|
64
|
-
export type
|
|
64
|
+
export type GoalStartResult = {
|
|
65
65
|
ok: true;
|
|
66
66
|
graph: PhaseGraph;
|
|
67
67
|
} | {
|
|
68
68
|
ok: false;
|
|
69
69
|
error: string;
|
|
70
70
|
};
|
|
71
|
-
export interface
|
|
72
|
-
|
|
71
|
+
export interface GoalHostHooks {
|
|
72
|
+
onGoalStart: (opts: {
|
|
73
73
|
goal: string;
|
|
74
74
|
projectContext?: string | undefined;
|
|
75
|
-
}) => Promise<
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
}) => Promise<GoalStartResult>;
|
|
76
|
+
onGoalPause: () => void;
|
|
77
|
+
onGoalResume: () => void;
|
|
78
78
|
/**
|
|
79
79
|
* Resume a persisted PhaseGraph. The graph must already have been loaded
|
|
80
80
|
* from the PhaseStore. Creates a fresh orchestrator and starts executing
|
|
81
81
|
* pending tasks.
|
|
82
82
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
onGoalResumeFromGraph: (graph: PhaseGraph) => Promise<GoalStartResult>;
|
|
84
|
+
onGoalStop: () => void;
|
|
85
|
+
getGoalRunner: () => GoalRunnerView | null;
|
|
86
86
|
/** Interactive board: move a task to another phase. */
|
|
87
|
-
|
|
87
|
+
onGoalMoveTask: (taskId: string, toPhaseId: string) => boolean;
|
|
88
88
|
/** Interactive board: (re)assign a task to a specific agent (clear with both omitted). */
|
|
89
|
-
|
|
89
|
+
onGoalAssignTask: (taskId: string, agentId?: string, agentName?: string) => boolean;
|
|
90
90
|
/** Interactive board: add a new task to a phase. Returns the new task id. */
|
|
91
|
-
|
|
91
|
+
onGoalAddTask: (phaseId: string, spec: {
|
|
92
92
|
title: string;
|
|
93
93
|
description?: string;
|
|
94
94
|
type?: TaskNode['type'];
|
|
95
95
|
priority?: TaskNode['priority'];
|
|
96
96
|
}) => string | null;
|
|
97
97
|
/** Interactive board: requeue a task to pending so it (re)runs. */
|
|
98
|
-
|
|
98
|
+
onGoalRetryTask: (taskId: string) => boolean;
|
|
99
99
|
/** Backs the /worktree slash command (list / merge / prune / clean). */
|
|
100
100
|
onWorktree: (action: 'list' | 'merge' | 'prune' | 'clean', target?: string) => Promise<string>;
|
|
101
101
|
}
|
|
102
|
-
export declare function
|
|
103
|
-
//# sourceMappingURL=
|
|
102
|
+
export declare function createGoalHost(deps: GoalHostDeps): GoalHostHooks;
|
|
103
|
+
//# sourceMappingURL=goal-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-host.d.ts","sourceRoot":"","sources":["../src/goal-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgBH,OAAO,EAGL,KAAK,YAAY,EAEjB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,UAAU,EAGf,KAAK,aAAa,EAElB,KAAK,QAAQ,EAEd,MAAM,kBAAkB,CAAC;AAY1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAmEvD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;CAAO,GACzF,IAAI,CAQN;AAED,uEAAuE;AACvE,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzD;AA+GD,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,cAAc,CAAC;IAC/B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,MAAM,CAAC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EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,cAAc,GAAG,IAAI,CAAC;IAC3C,uDAAuD;IACvD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/D,0FAA0F;IAC1F,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IACpF,6EAA6E;IAC7E,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;KACjC,KACE,MAAM,GAAG,IAAI,CAAC;IACnB,mEAAmE;IACnE,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,wEAAwE;IACxE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAChG;AAgBD,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,aAAa,CAmkBhE"}
|
package/dist/hq-server/auth.d.ts
CHANGED
|
@@ -35,10 +35,18 @@ export declare function signHqSession(sessionId: string, secret: string): string
|
|
|
35
35
|
export declare function serializeHqSessionCookie(sessionId: string, secret: string): string;
|
|
36
36
|
export declare function parseHqSessionCookie(value: string, secret: string): string | undefined;
|
|
37
37
|
export declare function parseCookieHeader(cookieHeader: string | undefined): Record<string, string>;
|
|
38
|
-
export declare function setHqSessionCookie(res: http.ServerResponse, value: string): void;
|
|
39
|
-
export declare function clearHqSessionCookie(res: http.ServerResponse): void;
|
|
38
|
+
export declare function setHqSessionCookie(res: http.ServerResponse, value: string, secure?: boolean): void;
|
|
39
|
+
export declare function clearHqSessionCookie(res: http.ServerResponse, secure?: boolean): void;
|
|
40
40
|
export declare function isTokenAuth(auth: HqBrowserAuthResult): auth is HqBrowserAuthContext;
|
|
41
41
|
export declare function extractBrowserToken(req: http.IncomingMessage, url: URL): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Constant-time membership test for a token set. Returns the matching stored
|
|
44
|
+
* token (so callers can look up its metadata) or undefined. Iterates and
|
|
45
|
+
* compares each candidate with `timingSafeEqual` instead of `Set.has()`, whose
|
|
46
|
+
* hash lookup can leak token length/prefix via timing. Use this everywhere an
|
|
47
|
+
* HQ token is checked — the HTTP path and the WS-upgrade path alike.
|
|
48
|
+
*/
|
|
49
|
+
export declare function timingSafeTokenMatch(tokens: Set<string>, supplied: string): string | undefined;
|
|
42
50
|
export declare function authenticateBrowserRequest(req: http.IncomingMessage, url: URL, mutableAuth: {
|
|
43
51
|
browserTokens: Set<string>;
|
|
44
52
|
browserTokenObjs: Map<string, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/hq-server/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAIvC,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C,eAAO,MAAM,qBAAqB,QAA0B,CAAC;AAI7D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAI9E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAA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B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACvE,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,EACD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GAC3C,mBAAmB,CA6BrB"}
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module hq-server/snapshot
|
|
5
5
|
*/
|
|
6
|
-
import type { HqEventEnvelope, HqPersistence, HqSnapshot } from '@wrongstack/core';
|
|
6
|
+
import type { HqCommandAuditEntry, HqEventEnvelope, HqPersistence, HqSnapshot } from '@wrongstack/core';
|
|
7
7
|
import { WebSocket } from 'ws';
|
|
8
8
|
import type { ConnectedClient, HqSnapshotBroadcaster, ProjectDetail } from './types.js';
|
|
9
|
-
export declare const HQ_SNAPSHOT_BROADCAST_DEBOUNCE_MS =
|
|
9
|
+
export declare const HQ_SNAPSHOT_BROADCAST_DEBOUNCE_MS = 100;
|
|
10
10
|
export declare function buildSnapshot(clients: Map<WebSocket, ConnectedClient>): HqSnapshot;
|
|
11
11
|
export declare function createSnapshotBroadcaster(clients: Map<WebSocket, ConnectedClient>, browsers: Set<WebSocket>, persistence?: HqPersistence): HqSnapshotBroadcaster;
|
|
12
12
|
export declare function buildProjectDetail(clients: Map<WebSocket, ConnectedClient>, projectId: string): ProjectDetail | null;
|
|
13
13
|
export declare function broadcastEvent(event: HqEventEnvelope, browsers: Set<WebSocket>): void;
|
|
14
|
+
/** Push one control command's lifecycle to every authenticated HQ browser. */
|
|
15
|
+
export declare function broadcastCommandStatus(command: HqCommandAuditEntry, browsers: Set<WebSocket>): void;
|
|
14
16
|
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/hq-server/snapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAIV,eAAe,EAOf,aAAa,EAIb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKxF,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAIrD,wBAAgB,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/hq-server/snapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAIV,mBAAmB,EACnB,eAAe,EAOf,aAAa,EAIb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKxF,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAIrD,wBAAgB,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,GAAG,UAAU,CAwSlF;AAID,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,EACxC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,EACxB,WAAW,CAAC,EAAE,aAAa,GAC1B,qBAAqB,CAgDvB;AAID,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,EACxC,SAAS,EAAE,MAAM,GAChB,aAAa,GAAG,IAAI,CAqDtB;AAID,w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|
|
27
27
|
sessionSnapshotTtlMs?: number;
|
|
28
28
|
/** Optional browser password login. When provided on first-run, the auth file stores a scrypt hash. */
|
|
29
29
|
password?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Allow a non-loopback bind while HQ is in open mode (no tokens, no
|
|
32
|
+
* password). Off by default: that pairing serves POST /api/command
|
|
33
|
+
* unauthenticated to the whole network. See assessHqExposure.
|
|
34
|
+
*/
|
|
35
|
+
allowInsecureOpen?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Set `Secure` flag on session cookies. Enable this when HQ is behind a
|
|
38
|
+
* TLS-terminating reverse proxy. Defaults to `false` because HQ speaks
|
|
39
|
+
* plain HTTP; setting `Secure` on an HTTP cookie makes it invisible to
|
|
40
|
+
* the browser.
|
|
41
|
+
*/
|
|
42
|
+
secureCookies?: boolean;
|
|
30
43
|
}
|
|
44
|
+
export { HqInsecureExposureError } from '@wrongstack/core';
|
|
31
45
|
export interface HqStartupConnectionInfo {
|
|
32
46
|
dataDir: string;
|
|
33
47
|
browserUrl: string;
|
|
@@ -54,6 +68,18 @@ export interface HqServerHandle {
|
|
|
54
68
|
* or the file is absent (caller falls back to the ring).
|
|
55
69
|
*/
|
|
56
70
|
export declare function readLocalSubagentTranscript(sessionId: string, subagentId: string): Promise<HqTranscriptEntry[] | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Library default: loopback. `startHqServer` is called programmatically
|
|
73
|
+
* (tests, embedders) as well as from the CLI, and a caller that never
|
|
74
|
+
* mentions a host has not asked to be reachable from the network.
|
|
75
|
+
*
|
|
76
|
+
* HQ is still the deliberate cross-machine surface — the CLI entry points
|
|
77
|
+
* (`wstack hq`, the launch menu) pass HQ_CLI_DEFAULT_HOST explicitly, so
|
|
78
|
+
* `wstack hq` binds every interface with no extra flag. Keeping the wide
|
|
79
|
+
* bind at the CLI edge rather than in this default is what stops an
|
|
80
|
+
* unrelated embedder from silently publishing HQ to its whole network.
|
|
81
|
+
*/
|
|
82
|
+
export declare const DEFAULT_HOST = "127.0.0.1";
|
|
57
83
|
export declare const DEFAULT_PORT = 3499;
|
|
58
84
|
export { HQ_HTML };
|
|
59
85
|
export declare function startHqServer(options?: HqServerOptions): Promise<HqServerHandle>;
|
package/dist/hq-server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hq-server.d.ts","sourceRoot":"","sources":["../src/hq-server.ts"],"names":[],"mappings":"AAsBA,OAAO,EAYL,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"hq-server.d.ts","sourceRoot":"","sources":["../src/hq-server.ts"],"names":[],"mappings":"AAsBA,OAAO,EAYL,KAAK,iBAAiB,EAyBvB,MAAM,kBAAkB,CAAC;AAY1B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,kGAAkG;IAClG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,iGAAiG;IACjG,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uGAAuG;IACvG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE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