@wrongstack/cli 0.285.0 → 0.287.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/dist/arg-parser.d.ts.map +1 -1
- package/dist/auth-menu/add-provider.d.ts.map +1 -1
- package/dist/boot/dispatch-webui.d.ts +7 -0
- package/dist/boot/dispatch-webui.d.ts.map +1 -1
- package/dist/boot/short-circuit-hq.d.ts.map +1 -1
- package/dist/boot/simpleui-full-auto.d.ts +21 -0
- package/dist/boot/simpleui-full-auto.d.ts.map +1 -0
- package/dist/boot/system-prompt-builder.d.ts.map +1 -1
- package/dist/boot/tool-registry.d.ts.map +1 -1
- package/dist/boot/tui-settings-adapter.d.ts +2 -1
- package/dist/boot/tui-settings-adapter.d.ts.map +1 -1
- package/dist/boot.d.ts +14 -0
- package/dist/boot.d.ts.map +1 -1
- package/dist/brain-menu/panel-service.d.ts +15 -0
- package/dist/brain-menu/panel-service.d.ts.map +1 -0
- package/dist/cli-eternal-flag.d.ts +3 -1
- package/dist/cli-eternal-flag.d.ts.map +1 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/config-doctor.d.ts.map +1 -1
- package/dist/execute-deps.d.ts +19 -0
- package/dist/execute-deps.d.ts.map +1 -1
- package/dist/execution.d.ts +4 -1
- package/dist/execution.d.ts.map +1 -1
- package/dist/fleet/host.d.ts +15 -45
- package/dist/fleet/host.d.ts.map +1 -1
- package/dist/hq-dashboard-html.d.ts.map +1 -1
- package/dist/hq-server/auth.d.ts +53 -0
- package/dist/hq-server/auth.d.ts.map +1 -0
- package/dist/hq-server/snapshot.d.ts +14 -0
- package/dist/hq-server/snapshot.d.ts.map +1 -0
- package/dist/hq-server/types.d.ts +67 -0
- package/dist/hq-server/types.d.ts.map +1 -0
- package/dist/hq-server/utils.d.ts +70 -0
- package/dist/hq-server/utils.d.ts.map +1 -0
- package/dist/hq-server/ws.d.ts +14 -0
- package/dist/hq-server/ws.d.ts.map +1 -0
- package/dist/hq-server.d.ts +4 -0
- package/dist/hq-server.d.ts.map +1 -1
- package/dist/index.js +8865 -3967
- package/dist/index.js.map +4 -4
- package/dist/launch-hints.d.ts.map +1 -1
- package/dist/mcp-serve.d.ts +7 -9
- package/dist/mcp-serve.d.ts.map +1 -1
- package/dist/next-task-predictor.d.ts.map +1 -1
- package/dist/pre-launch/launch-prompts.d.ts +1 -4
- package/dist/pre-launch/launch-prompts.d.ts.map +1 -1
- package/dist/provider-id.d.ts +13 -0
- package/dist/provider-id.d.ts.map +1 -0
- package/dist/repl.d.ts +2 -0
- package/dist/repl.d.ts.map +1 -1
- package/dist/services/project-facts.d.ts.map +1 -1
- package/dist/simpleui-dist.d.ts +7 -0
- package/dist/simpleui-dist.d.ts.map +1 -0
- package/dist/slash-commands/agents.d.ts +2 -0
- package/dist/slash-commands/agents.d.ts.map +1 -1
- package/dist/slash-commands/brain.d.ts.map +1 -1
- package/dist/slash-commands/delegate.d.ts +1 -1
- package/dist/slash-commands/fallback.d.ts.map +1 -1
- package/dist/slash-commands/git.d.ts +16 -0
- package/dist/slash-commands/git.d.ts.map +1 -0
- package/dist/slash-commands/goal-refiner.d.ts +72 -2
- package/dist/slash-commands/goal-refiner.d.ts.map +1 -1
- package/dist/slash-commands/goal.d.ts.map +1 -1
- package/dist/slash-commands/health.d.ts +4 -0
- package/dist/slash-commands/health.d.ts.map +1 -0
- package/dist/slash-commands/index.d.ts +21 -2
- package/dist/slash-commands/index.d.ts.map +1 -1
- package/dist/slash-commands/mcp.d.ts +8 -0
- package/dist/slash-commands/mcp.d.ts.map +1 -1
- package/dist/slash-commands/memory.d.ts.map +1 -1
- package/dist/slash-commands/metrics.d.ts +4 -0
- package/dist/slash-commands/metrics.d.ts.map +1 -0
- package/dist/slash-commands/plan.d.ts +4 -0
- package/dist/slash-commands/plan.d.ts.map +1 -0
- package/dist/slash-commands/refiner.d.ts +15 -0
- package/dist/slash-commands/refiner.d.ts.map +1 -0
- package/dist/slash-commands/security.d.ts.map +1 -1
- package/dist/slash-commands/settings.d.ts.map +1 -1
- package/dist/slash-commands/spawn-agents.d.ts.map +1 -1
- package/dist/slash-commands/suggest.d.ts.map +1 -1
- package/dist/slash-commands/tuneup.d.ts +1 -1
- package/dist/subcommands/handlers/mailbox-serve.d.ts.map +1 -1
- package/dist/subcommands/handlers/per-subcommand-help.d.ts.map +1 -1
- package/dist/subcommands/handlers/version-help.d.ts.map +1 -1
- package/dist/tuneup.d.ts.map +1 -1
- package/dist/webui-server/client-registration.d.ts.map +1 -1
- package/dist/webui-server/connection-handler.d.ts +1 -1
- package/dist/webui-server/kanban-run-mirror.d.ts +77 -0
- package/dist/webui-server/kanban-run-mirror.d.ts.map +1 -0
- package/dist/webui-server/kanban-supervisor.d.ts +36 -0
- package/dist/webui-server/kanban-supervisor.d.ts.map +1 -0
- package/dist/webui-server/lifecycle.d.ts +5 -1
- package/dist/webui-server/lifecycle.d.ts.map +1 -1
- package/dist/webui-server/message-router.d.ts +7 -1
- 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/provider-config.d.ts +1 -1
- package/dist/webui-server/setup-events.d.ts +1 -1
- package/dist/webui-server/static-serve.d.ts +5 -3
- package/dist/webui-server/static-serve.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/agent-config.d.ts +25 -2
- package/dist/webui-server/ws-handlers/agent-config.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/brain.d.ts +8 -1
- package/dist/webui-server/ws-handlers/brain.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/connection.d.ts +8 -1
- package/dist/webui-server/ws-handlers/connection.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/context.d.ts +1 -1
- package/dist/webui-server/ws-handlers/index.d.ts +3 -3
- package/dist/webui-server/ws-handlers/index.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/kanban.d.ts +5 -0
- package/dist/webui-server/ws-handlers/kanban.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/mailbox.d.ts +9 -0
- package/dist/webui-server/ws-handlers/mailbox.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/prefs.d.ts.map +1 -1
- package/dist/webui-server/ws-handlers/providers.d.ts +10 -0
- 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/ws-handlers/worklist.d.ts +1 -1
- package/dist/webui-server.d.ts +15 -4
- package/dist/webui-server.d.ts.map +1 -1
- package/dist/wiring/brain-and-orchestration.d.ts +22 -5
- package/dist/wiring/brain-and-orchestration.d.ts.map +1 -1
- package/dist/wiring/controllers.d.ts +7 -2
- package/dist/wiring/controllers.d.ts.map +1 -1
- package/dist/wiring/hq-telemetry.d.ts +4 -2
- package/dist/wiring/hq-telemetry.d.ts.map +1 -1
- package/dist/wiring/lifecycle-plugins.d.ts +10 -7
- package/dist/wiring/lifecycle-plugins.d.ts.map +1 -1
- package/dist/wiring/metrics.d.ts +20 -1
- package/dist/wiring/metrics.d.ts.map +1 -1
- package/dist/wiring/plugins.d.ts +2 -1
- package/dist/wiring/plugins.d.ts.map +1 -1
- package/dist/wiring/session.d.ts +2 -0
- package/dist/wiring/session.d.ts.map +1 -1
- package/dist/wiring/slash-commands.d.ts +2 -0
- package/dist/wiring/slash-commands.d.ts.map +1 -1
- package/dist/wiring/tools.d.ts.map +1 -1
- package/package.json +20 -18
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { IncomingMessage } from 'node:http';
|
|
14
14
|
import type { Message, Usage } from '@wrongstack/core';
|
|
15
|
-
import type { AutoPhaseWebSocketHandler, SddBoardWebSocketHandler, SddWizardWebSocketHandler, SpecsWebSocketHandler, TerminalWebSocketHandler, WorktreeWebSocketHandler } from '@wrongstack/webui
|
|
15
|
+
import type { AutoPhaseWebSocketHandler, SddBoardWebSocketHandler, SddWizardWebSocketHandler, SpecsWebSocketHandler, TerminalWebSocketHandler, WorktreeWebSocketHandler } from '@wrongstack/webui-server';
|
|
16
16
|
import type { WebSocket } from 'ws';
|
|
17
17
|
import { type PendingConfirm } from './ws-handlers/index.js';
|
|
18
18
|
import type { WSClientMessage, WSServerMessage } from '../webui-server.js';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KanbanRunMirror — projects live AutoPhase / SDD runs into `@wrongstack/kanban`
|
|
3
|
+
* boards so the kanban view becomes the unified LIVE surface for both engines.
|
|
4
|
+
*
|
|
5
|
+
* It is fed two ways (both in the CLI-hosted webui-server process, the only
|
|
6
|
+
* place with the shared EventBus + both live handlers):
|
|
7
|
+
* - SDD: subscribe to `sdd.board.snapshot` on the shared bus.
|
|
8
|
+
* - AutoPhase: a callback tap on `AutoPhaseWebSocketHandler` (that orchestrator
|
|
9
|
+
* does NOT emit PhaseEventMap on the bus), delivering its `buildState()`.
|
|
10
|
+
*
|
|
11
|
+
* Each run maps to ONE kanban board. Linkage lives in board TAGS (not
|
|
12
|
+
* generatedBy, which `syncBoardFromTaskGraph` overwrites):
|
|
13
|
+
* ['sdd', 'run:<runId>', 'graph:<graphId>'] or ['autophase', 'graph:<graphId>']
|
|
14
|
+
*
|
|
15
|
+
* Reconcile per tick is a two-pass, both idempotent:
|
|
16
|
+
* 1. `syncBoardFromTaskGraph` — structure + status→column + deps + origin-keyed
|
|
17
|
+
* create/update/archive.
|
|
18
|
+
* 2. targeted, diff-guarded `updateTaskAssignment` overlay for the LIVE subset
|
|
19
|
+
* only (running/completed/failed/cancelled/assigned tasks) so the inspector's
|
|
20
|
+
* AgentRunPanel lights up with the real worker + model — without fabricating
|
|
21
|
+
* phantom assignments or a per-tick event storm.
|
|
22
|
+
*/
|
|
23
|
+
import type { EventBus } from '@wrongstack/core';
|
|
24
|
+
import { type SerializedTaskGraph, type TaskNode } from '@wrongstack/core';
|
|
25
|
+
import type { SddBoardSnapshot } from '@wrongstack/sdd';
|
|
26
|
+
type Engine = 'sdd' | 'autophase';
|
|
27
|
+
interface WSServerMessage {
|
|
28
|
+
type: string;
|
|
29
|
+
payload: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface KanbanRunMirrorDeps {
|
|
32
|
+
projectRoot: string;
|
|
33
|
+
events?: EventBus | undefined;
|
|
34
|
+
broadcast: (msg: WSServerMessage) => void;
|
|
35
|
+
log?: ((msg: string) => void) | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** Loose shape of the AutoPhase `buildState()` projection we consume. */
|
|
38
|
+
interface AutophaseState {
|
|
39
|
+
title?: string;
|
|
40
|
+
goal?: string;
|
|
41
|
+
phases?: Array<{
|
|
42
|
+
id: string;
|
|
43
|
+
name?: string;
|
|
44
|
+
tasks?: Array<{
|
|
45
|
+
id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
status: TaskNode['status'];
|
|
49
|
+
priority: TaskNode['priority'];
|
|
50
|
+
type: TaskNode['type'];
|
|
51
|
+
assignee?: string;
|
|
52
|
+
startedAt?: number;
|
|
53
|
+
completedAt?: number;
|
|
54
|
+
}>;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
57
|
+
export interface KanbanRunMirror {
|
|
58
|
+
/** AutoPhase tap — the handler's `onBoardState(graphId, state)` callback. */
|
|
59
|
+
onAutophaseState(graphId: string, state: Record<string, unknown>): void;
|
|
60
|
+
/** Bind a runId to a specific board (used by launch-from-board, phase 4). */
|
|
61
|
+
bind(engine: Engine, key: string, boardId: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* One-shot: the NEXT AutoPhase run whose graphId we haven't seen binds to this
|
|
64
|
+
* board instead of creating a new one. Used by launch-from-board — the graphId
|
|
65
|
+
* is only known after the async build, so we can't `bind()` up front.
|
|
66
|
+
*/
|
|
67
|
+
bindAutophaseNext(boardId: string): void;
|
|
68
|
+
dispose(): void;
|
|
69
|
+
}
|
|
70
|
+
export declare function createKanbanRunMirror(deps: KanbanRunMirrorDeps): KanbanRunMirror;
|
|
71
|
+
/** Build a serialized TaskGraph from an SDD board snapshot (faithful; runtime in metadata). */
|
|
72
|
+
export declare function buildTaskGraphFromSddSnapshot(snapshot: SddBoardSnapshot): SerializedTaskGraph;
|
|
73
|
+
type AutophasePhase = NonNullable<AutophaseState['phases']>[number];
|
|
74
|
+
/** Build a serialized TaskGraph for one AutoPhase phase (graph.id = RUN graphId; phase scoped via sync phaseId). */
|
|
75
|
+
export declare function buildTaskGraphFromAutophasePhase(graphId: string, title: string, phase: AutophasePhase): SerializedTaskGraph;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=kanban-run-mirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kanban-run-mirror.d.ts","sourceRoot":"","sources":["../../src/webui-server/kanban-run-mirror.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAEL,KAAK,mBAAmB,EAExB,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAW1B,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,iBAAiB,CAAC;AAEtE,KAAK,MAAM,GAAG,KAAK,GAAG,WAAW,CAAC;AAElC,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC9B,SAAS,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC3C;AAED,yEAAyE;AACzE,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM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C,CAC9C,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,cAAc,GACpB,mBAAmB,CAiBrB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type KanbanSupervisorSnapshot } from '@wrongstack/kanban';
|
|
2
|
+
interface DispatchOptions {
|
|
3
|
+
provider?: string | undefined;
|
|
4
|
+
model?: string | undefined;
|
|
5
|
+
fallbackProfile?: string | undefined;
|
|
6
|
+
fallbackModels?: string[] | undefined;
|
|
7
|
+
skills?: string[] | undefined;
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
onDone?: ((result: {
|
|
10
|
+
status: 'completed' | 'failed';
|
|
11
|
+
result?: string | undefined;
|
|
12
|
+
error?: string | undefined;
|
|
13
|
+
}) => void | Promise<void>) | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface KanbanSupervisorDeps {
|
|
16
|
+
projectRoot: string;
|
|
17
|
+
broadcast: (message: {
|
|
18
|
+
type: string;
|
|
19
|
+
payload: unknown;
|
|
20
|
+
}) => void;
|
|
21
|
+
dispatchTask?: ((description: string, opts?: DispatchOptions) => Promise<string>) | undefined;
|
|
22
|
+
log?: ((message: string) => void) | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface KanbanSupervisor {
|
|
25
|
+
getSnapshot(boardId: string): KanbanSupervisorSnapshot | undefined;
|
|
26
|
+
auditNow(boardId?: string): Promise<KanbanSupervisorSnapshot[]>;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Quiet, project-local board custodian. The frequent pass is deterministic and
|
|
31
|
+
* free; an LLM is spawned only when the board explicitly opts into agentic mode
|
|
32
|
+
* and the health snapshot contains an anomaly.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createKanbanSupervisor(deps: KanbanSupervisorDeps): KanbanSupervisor;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=kanban-supervisor.d.ts.map
|
|
@@ -0,0 +1 @@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G,wBAAwB,GAAG,SAAS,CAAC;IACnE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IAChE,OAAO,IAAI,IAAI,CAAC;CACjB;AAaD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB,GAAG,gBAAgB,CA+KnF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type WebUIInstanceRecord } from '@wrongstack/webui
|
|
1
|
+
import { type SurfaceKind, type WebUIInstanceRecord } from '@wrongstack/webui-server';
|
|
2
2
|
/**
|
|
3
3
|
* PR 7 of Issue #30 (webui-server 8-PR refactor): process lifecycle.
|
|
4
4
|
*
|
|
@@ -20,6 +20,8 @@ import { type WebUIInstanceRecord } from '@wrongstack/webui/server';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface RegisterWebuiInstanceParams {
|
|
22
22
|
pid: number;
|
|
23
|
+
/** Surface kind — 'webui' or 'simpleui'. */
|
|
24
|
+
surface: SurfaceKind;
|
|
23
25
|
host: string;
|
|
24
26
|
httpPort: number;
|
|
25
27
|
wsPort: number;
|
|
@@ -42,6 +44,8 @@ export interface RegisterWebuiInstanceDeps {
|
|
|
42
44
|
*/
|
|
43
45
|
export declare function registerWebuiInstance(p: RegisterWebuiInstanceParams, deps?: RegisterWebuiInstanceDeps): void;
|
|
44
46
|
export interface AnnounceWebuiReadyParams {
|
|
47
|
+
/** Surface kind — 'webui' or 'simpleui'. */
|
|
48
|
+
surface: SurfaceKind;
|
|
45
49
|
/** The HTTP server (StaticServeHandle.server). */
|
|
46
50
|
server: {
|
|
47
51
|
on: (event: 'listening', cb: () => void) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/webui-server/lifecycle.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAElC;;;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AAK,IAAI,CAAA;KAAE,CAAC;IAC1C,sDAAsD;IACtD,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,2EAA2E;IAC3E,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,sEAAsE;IACtE,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,sBAAsB,GAAG,MAAM,IAAI,CA2B3E;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAY5E"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { KanbanRunMirror } from './kanban-run-mirror.js';
|
|
2
|
+
import type { KanbanSupervisor } from './kanban-supervisor.js';
|
|
3
|
+
import type { AutoPhaseWebSocketHandler, DesignContext, PromptsContext, SddBoardWebSocketHandler, SddWizardWebSocketHandler, SkillsContext, SpecsWebSocketHandler, TerminalWebSocketHandler, WorktreeWebSocketHandler } from '@wrongstack/webui-server';
|
|
2
4
|
import type { WebSocket } from 'ws';
|
|
3
5
|
import type { CliWebUIOptions, WSClientMessage, WSServerMessage } from '../webui-server.js';
|
|
4
6
|
import type { ConnectedClient } from './connection-handler.js';
|
|
@@ -33,6 +35,10 @@ export interface MessageRouterDeps {
|
|
|
33
35
|
sddWizardHandler: SddWizardWebSocketHandler | null;
|
|
34
36
|
worktreeHandler: WorktreeWebSocketHandler;
|
|
35
37
|
terminalHandler: TerminalWebSocketHandler;
|
|
38
|
+
/** Live run↔kanban mirror; used by kanban.run.start to bind a launched run's board. */
|
|
39
|
+
kanbanRunMirror?: KanbanRunMirror | undefined;
|
|
40
|
+
/** Quiet deterministic/agentic Kanban health custodian. */
|
|
41
|
+
kanbanSupervisor?: KanbanSupervisor | undefined;
|
|
36
42
|
}
|
|
37
43
|
export type MessageRouter = (ws: WebSocket, client: ConnectedClient, msg: WSClientMessage) => Promise<void>;
|
|
38
44
|
export declare function createMessageRouter(deps: MessageRouterDeps): MessageRouter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-router.d.ts","sourceRoot":"","sources":["../../src/webui-server/message-router.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-router.d.ts","sourceRoot":"","sources":["../../src/webui-server/message-router.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EACV,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,yBAAyB,EACzB,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AAqDlC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,EACf,QAAQ,EACR,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAmFhC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,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B,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACjD;AAED,MAAM,MAAM,aAAa,GAAG,CAC1B,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,eAAe,KACjB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CA0zB1E"}
|
|
@@ -34,7 +34,7 @@ interface CliWebUIOptions {
|
|
|
34
34
|
} | undefined;
|
|
35
35
|
}
|
|
36
36
|
/** Keys synced between `agent.ctx.meta` and `config.json`. */
|
|
37
|
-
export declare const PREF_KEYS: readonly ['autonomy', 'autonomyDelayMs', 'autoProceedMaxIterations', 'yolo', 'maxIterations', 'chime', 'confirmExit', 'streamFleet', 'nextPrediction', 'fallbackModels', 'fallbackProfiles', 'favoriteModels', 'favoriteModelsOnly', 'modelMatrix', 'fallbackAuto', 'uiLocale', 'enhanceEnabled', 'enhanceDelayMs', 'enhanceLanguage', 'featureMcp', 'featurePlugins', 'featureMemory', 'featureSkills', 'featureModelsRegistry', 'indexOnStart', 'contextAutoCompact', 'contextStrategy', 'contextMode', 'tokenSavingTier', 'maxConcurrent', 'titleAnimation', 'reasoningMode', 'reasoningEffort', 'reasoningPreserve', 'cacheTtl', 'logLevel', 'auditLevel', 'hqEnabled', 'hqUrl', 'hqToken', 'hqRawContent', 'tgConfigured', 'tgSessionEnd', 'tgDelegate', 'tgLongToolMs'];
|
|
37
|
+
export declare const PREF_KEYS: readonly ['autonomy', 'autonomyDelayMs', 'autoProceedMaxIterations', 'yolo', 'maxIterations', 'chime', 'confirmExit', 'streamFleet', 'nextPrediction', 'fallbackModels', 'fallbackProfiles', 'favoriteModels', 'favoriteModelsOnly', 'modelMatrix', 'fallbackAuto', 'uiLocale', 'enhanceEnabled', 'enhanceDelayMs', 'enhanceLanguage', 'featureMcp', 'featurePlugins', 'featureMemory', 'featureSkills', 'featureModelsRegistry', 'indexOnStart', 'contextAutoCompact', 'contextStrategy', 'contextMode', 'tokenSavingTier', 'maxConcurrent', 'titleAnimation', 'reasoningMode', 'reasoningEffort', 'reasoningPreserve', 'cacheTtl', 'logLevel', 'auditLevel', 'hqEnabled', 'hqUrl', 'hqToken', 'hqRawContent', 'refinerProvider', 'refinerModel', 'refinerFallbackProfile', 'thinkingWord', 'statuslineMode', 'animationStyle', 'tgConfigured', 'tgSessionEnd', 'tgDelegate', 'tgLongToolMs', 'breakerEnabled', 'breakerAutoKillResetMs', 'fsAccess', 'debugStream', 'chimeraAutoFix', 'pluginsEnabled'];
|
|
38
38
|
type PrefSnapshot = Record<string, unknown>;
|
|
39
39
|
/**
|
|
40
40
|
* One-time startup seed: reads `globalConfigPath` and copies recognised fields
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefs-seeding.d.ts","sourceRoot":"","sources":["../../src/webui-server/prefs-seeding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK/C,UAAU,eAAe;IACvB,KAAK,EAAE;QAAE,GAAG,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAA;KAAE,CAAC;IAClD,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE;QACV,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC;QACxD,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACtC,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACzC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QACnC,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;QAChD,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAC/B,GAAG,SAAS,CAAC;CACf;AAWD,8DAA8D;AAC9D,eAAO,MAAM,SAAS,YACpB,UAAU,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,MAAM,EACN,eAAe,EACf,OAAO,EACP,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAIhB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,OAAO,EACP,SAAS,EACT,cAAc,
|
|
1
|
+
{"version":3,"file":"prefs-seeding.d.ts","sourceRoot":"","sources":["../../src/webui-server/prefs-seeding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK/C,UAAU,eAAe;IACvB,KAAK,EAAE;QAAE,GAAG,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAA;KAAE,CAAC;IAClD,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE;QACV,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC;QACxD,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAA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,CAAC;IACjC,YAAY,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,YAAY,CA+StE"}
|
|
@@ -22,7 +22,7 @@ export { expectDefined, maskedKey, normalizeKeys, nowIso, writeKeysBack, } from
|
|
|
22
22
|
*
|
|
23
23
|
* Note: `writeKeysBack` and `normalizeKeys` (used by
|
|
24
24
|
* the per-handler key ops) are *already* imported from
|
|
25
|
-
* `@wrongstack/webui
|
|
25
|
+
* `@wrongstack/webui-server`. This PR does not move
|
|
26
26
|
* them — they were never inlined in `webui-server.ts`.
|
|
27
27
|
* Per the plan body's update after PR #51, they are
|
|
28
28
|
* not part of this extraction.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* PR 12 of Issue #30: extracted from `webui-server.ts`.
|
|
13
13
|
*/
|
|
14
14
|
import type { Context, EventBus, JournalEntry, SecretScrubber } from '@wrongstack/core';
|
|
15
|
-
import { createEternalSubscription } from '@wrongstack/webui
|
|
15
|
+
import { createEternalSubscription } from '@wrongstack/webui-server';
|
|
16
16
|
import type { StreamCoalescer } from './stream-coalescer.js';
|
|
17
17
|
import type { PendingConfirm } from './ws-handlers/index.js';
|
|
18
18
|
export interface SetupEventsDeps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
|
-
import { type CreateHttpServerOptions } from '@wrongstack/webui
|
|
2
|
+
import { type CreateHttpServerOptions } from '@wrongstack/webui-server';
|
|
3
3
|
/**
|
|
4
4
|
* PR 6 of Issue #30 (webui-server 8-PR refactor):
|
|
5
5
|
* dist discovery + HTTP server bring-up.
|
|
@@ -31,6 +31,8 @@ export interface StaticServeOptions {
|
|
|
31
31
|
httpPort: number;
|
|
32
32
|
wsPort: number;
|
|
33
33
|
globalRoot: string;
|
|
34
|
+
/** Explicit frontend build. Omitted for the regular @wrongstack/webui app. */
|
|
35
|
+
distDir?: string | undefined;
|
|
34
36
|
/** Push-on-write hook for `POST /api/fleet/ping` (immediate fleet re-broadcast). */
|
|
35
37
|
onFleetPing?: (() => void) | undefined;
|
|
36
38
|
/** Public browser-facing WS URL injected into the React app. */
|
|
@@ -55,7 +57,7 @@ export interface StaticServeOptions {
|
|
|
55
57
|
* can exercise the resolution (and stub it) without
|
|
56
58
|
* binding a socket.
|
|
57
59
|
*/
|
|
58
|
-
export declare function resolveDistDir(): string | null;
|
|
60
|
+
export declare function resolveDistDir(explicitDistDir?: string): string | null;
|
|
59
61
|
/**
|
|
60
62
|
* Injectable seams for `startStaticServe`. Both default to
|
|
61
63
|
* the real implementations; tests override them to assert
|
|
@@ -63,7 +65,7 @@ export declare function resolveDistDir(): string | null;
|
|
|
63
65
|
* a real port.
|
|
64
66
|
*/
|
|
65
67
|
export interface StaticServeDeps {
|
|
66
|
-
resolveDist?: () => string | null;
|
|
68
|
+
resolveDist?: (explicitDistDir?: string) => string | null;
|
|
67
69
|
createServer?: (opts: CreateHttpServerOptions) => Server;
|
|
68
70
|
}
|
|
69
71
|
export declare function startStaticServe(opts: StaticServeOptions, deps?: StaticServeDeps): StaticServeHandle | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-serve.d.ts","sourceRoot":"","sources":["../../src/webui-server/static-serve.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,0BAA0B,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,E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M,GAAG,IAAI,CAStE;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,CAAC,eAAe,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,MAAM,CAAC;CAC1D;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,kBAAkB,EACxB,IAAI,GAAE,eAAoB,GACzB,iBAAiB,GAAG,IAAI,CA6B1B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Agent, type ModelsRegistry, type ModeStore } from '@wrongstack/core';
|
|
1
|
+
import { type Agent, type Config, type ModelsRegistry, type ModeStore } from '@wrongstack/core';
|
|
2
2
|
import type { WebSocket } from 'ws';
|
|
3
3
|
import type { WsCommon } from './index.js';
|
|
4
4
|
/**
|
|
@@ -28,6 +28,13 @@ export interface AgentConfigContext extends WsCommon {
|
|
|
28
28
|
* absent the refiner sends no reasoning field (unchanged behavior).
|
|
29
29
|
*/
|
|
30
30
|
modelsRegistry?: ModelsRegistry | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Live app config accessor — used by the refine handler to resolve the
|
|
33
|
+
* one-key "retry with another model" fallback ref (see
|
|
34
|
+
* `resolveEnhanceFallbackRef`). Optional: when absent no fallback ref is
|
|
35
|
+
* offered (the user can still pick a model explicitly).
|
|
36
|
+
*/
|
|
37
|
+
getConfig?: (() => Config | undefined) | undefined;
|
|
31
38
|
onMaxContextResolved?: ((providerId: string, modelId: string, maxContext: number) => void) | undefined;
|
|
32
39
|
/**
|
|
33
40
|
* Persist durable keys to config.json (runWebUI's createPrefsSeeding closure).
|
|
@@ -39,9 +46,25 @@ export interface AgentConfigContext extends WsCommon {
|
|
|
39
46
|
}
|
|
40
47
|
export declare function handleModesList(ctx: AgentConfigContext, ws: WebSocket): Promise<void>;
|
|
41
48
|
export declare function handleModeSwitch(ctx: AgentConfigContext, ws: WebSocket, id: string): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Apply a provider+model switch to the live agent: rebuild the provider from
|
|
51
|
+
* saved config, resolve the model's maxContext, persist the choice, and
|
|
52
|
+
* broadcast a fresh `session.start`. Shared by the `model.switch` handler and
|
|
53
|
+
* the "adopt on first provider add" path so both mutate the agent identically.
|
|
54
|
+
* Throws on provider-construction failure (the caller decides how to report).
|
|
55
|
+
*/
|
|
56
|
+
export declare function applyModelSwitch(ctx: AgentConfigContext, newProvider: string, newModel: string): Promise<void>;
|
|
42
57
|
export declare function handleModelSwitch(ctx: AgentConfigContext, ws: WebSocket, payload: {
|
|
43
58
|
provider: string;
|
|
44
59
|
model: string;
|
|
45
60
|
}): Promise<void>;
|
|
46
|
-
export
|
|
61
|
+
export interface ModelRefinePayload {
|
|
62
|
+
text: string;
|
|
63
|
+
/** Retry window override (ms) — set on the auto-retry after a timeout. */
|
|
64
|
+
timeoutMs?: number | undefined;
|
|
65
|
+
/** Refine on this provider/model instead of the session's (ephemeral). */
|
|
66
|
+
provider?: string | undefined;
|
|
67
|
+
model?: string | undefined;
|
|
68
|
+
}
|
|
69
|
+
export declare function handleModelRefine(ctx: AgentConfigContext, ws: WebSocket, payload: ModelRefinePayload): Promise<void>;
|
|
47
70
|
//# sourceMappingURL=agent-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-config.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/agent-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"agent-config.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/agent-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,MAAM,EAIX,KAAK,cAAc,EACnB,KAAK,SAAS,EAMf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,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AO,CAAC,IAAI,CAAC,CA+Cf;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,kBAAkB,EACvB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC3C,OAAO,CAAC,IAAI,CAAC,CAQf;AAgBD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,kBAAkB,EACvB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAoHf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BrainArbiter, BrainAutoRisk } from '@wrongstack/core';
|
|
1
|
+
import type { BrainArbiter, BrainAutoRisk, BrainRuntime } from '@wrongstack/core';
|
|
2
2
|
import type { WebSocket } from 'ws';
|
|
3
3
|
import type { WsCommon } from './index.js';
|
|
4
4
|
/**
|
|
@@ -23,6 +23,11 @@ export interface BrainHandlerContext extends WsCommon {
|
|
|
23
23
|
brainSettings: {
|
|
24
24
|
maxAutoRisk: BrainAutoRisk;
|
|
25
25
|
} | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Live-editable Brain config owner. Powers `brain.config.get/set` and
|
|
28
|
+
* enriches `brain.status`; risk-only hosts may leave it undefined.
|
|
29
|
+
*/
|
|
30
|
+
brainRuntime?: BrainRuntime | undefined;
|
|
26
31
|
/** Read the host's rolling Brain decision log, or undefined when not wired. */
|
|
27
32
|
getBrainLog: (() => BrainLogEntry[]) | undefined;
|
|
28
33
|
/** Resolve the active Brain arbiter (host instance, else container-bound), or undefined. */
|
|
@@ -31,6 +36,8 @@ export interface BrainHandlerContext extends WsCommon {
|
|
|
31
36
|
getSessionId?: (() => string | undefined) | undefined;
|
|
32
37
|
}
|
|
33
38
|
export declare function handleBrainStatus(ctx: BrainHandlerContext, ws: WebSocket): void;
|
|
39
|
+
export declare function handleBrainConfigGet(ctx: BrainHandlerContext, ws: WebSocket): void;
|
|
40
|
+
export declare function handleBrainConfigSet(ctx: BrainHandlerContext, ws: WebSocket, payload: unknown): Promise<void>;
|
|
34
41
|
export declare function handleBrainRisk(ctx: BrainHandlerContext, ws: WebSocket, level: string): void;
|
|
35
42
|
export declare function handleBrainAsk(ctx: BrainHandlerContext, ws: WebSocket, question: string | undefined): Promise<void>;
|
|
36
43
|
//# sourceMappingURL=brain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/brain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/brain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAoB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;;;;;GASG;AAEH,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAoB,SAAQ,QAAQ;IACnD,kEAAkE;IAClE,aAAa,EAAE;QAAE,WAAW,EAAE,aAAa,CAAA;KAAE,GAAG,SAAS,CAAC;IAC1D;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,+EAA+E;IAC/E,WAAW,EAAE,CAAC,MAAM,aAAa,EAAE,CAAC,GAAG,SAAS,CAAC;IACjD,4FAA4F;IAC5F,cAAc,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC;IAC/C,yDAAyD;IACzD,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACvD;AAMD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAkB/E;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CASlF;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,mBAAmB,EACxB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAe5F;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,mBAAmB,EACxB,EAAE,EAAE,SAAS,EACb,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAAC,IAAI,CAAC,CA6Bf"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Agent } from '@wrongstack/core';
|
|
2
|
+
import { type IncomingImagePayload } from '@wrongstack/core/utils';
|
|
2
3
|
import type { WebSocket } from 'ws';
|
|
3
4
|
import type { WsCommon } from './index.js';
|
|
4
5
|
/**
|
|
@@ -43,7 +44,13 @@ export interface ConnectionContext extends WsCommon {
|
|
|
43
44
|
/** Pending tool-permission resolvers keyed by confirm id; owned by runWebUI. */
|
|
44
45
|
pendingConfirms: Map<string, PendingConfirm>;
|
|
45
46
|
}
|
|
46
|
-
export
|
|
47
|
+
export interface UserMessageAttachments {
|
|
48
|
+
/** Images attached in the WebUI composer (paste / drop / file picker). */
|
|
49
|
+
images?: IncomingImagePayload[] | undefined;
|
|
50
|
+
/** Legacy single-image field older clients sent as a data-URL. */
|
|
51
|
+
imageBase64?: string | undefined;
|
|
52
|
+
}
|
|
53
|
+
export declare function handleUserMessage(ctx: ConnectionContext, ws: WebSocket, content: string, requestedSessionId?: string | undefined, attachments?: UserMessageAttachments | undefined): Promise<void>;
|
|
47
54
|
export declare function handleAbort(ctx: ConnectionContext, ws: WebSocket, requestedSessionId?: string | undefined): void;
|
|
48
55
|
export declare function handlePing(ctx: ConnectionContext, ws: WebSocket): void;
|
|
49
56
|
export declare function handleToolConfirmResult(ctx: ConnectionContext, id: string, decision: ConfirmDecision, requestedSessionId?: string | undefined): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAgB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAGL,KAAK,oBAAoB,EAG1B,MAAM,wBAAwB,CAAC;AAOhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;;;;;;;GAiBG;AAEH,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,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EAAE,iBAAiB,EACtB,EAAE,EAAE,SAAS,EACb,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,GACtC,IAAI,CA0BN;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,iBAAiB,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAEtE;AAED,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,iBAAiB,EACtB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,eAAe,EACzB,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,GACtC,IAAI,CAQN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Agent } from '@wrongstack/core';
|
|
2
|
-
import type { CustomModeStore } from '@wrongstack/webui
|
|
2
|
+
import type { CustomModeStore } from '@wrongstack/webui-server';
|
|
3
3
|
import type { WebSocket } from 'ws';
|
|
4
4
|
import type { WsCommon } from './index.js';
|
|
5
5
|
/**
|
|
@@ -45,16 +45,16 @@ export interface WsHandlerContext extends WsCommon {
|
|
|
45
45
|
modelsRegistry: ModelsRegistry | undefined;
|
|
46
46
|
}
|
|
47
47
|
export { type AgentConfigContext, handleModelRefine, handleModelSwitch, handleModeSwitch, handleModesList, } from './agent-config.js';
|
|
48
|
-
export { type BrainHandlerContext, handleBrainAsk, handleBrainRisk, handleBrainStatus, } from './brain.js';
|
|
48
|
+
export { type BrainHandlerContext, handleBrainAsk, handleBrainConfigGet, handleBrainConfigSet, handleBrainRisk, handleBrainStatus, } from './brain.js';
|
|
49
49
|
export { type ConfirmDecision, type ConnectionContext, type ConnectionOptions, type PendingConfirm, handleAbort, handlePing, handleToolConfirmResult, handleUserMessage, resolveAllPendingConfirms, resolveYoloEligiblePendingConfirms, } from './connection.js';
|
|
50
50
|
export { type ContextHandlerContext, handleContextClear, handleContextCompact, handleContextDebug, handleContextModeCreate, handleContextModeDelete, handleContextModeSwitch, handleContextModesList, handleContextModeUpdate, handleContextRepair, } from './context.js';
|
|
51
51
|
export { handleDiagGet, handleToolDisable, handleToolEnable, handleSkillsList, handleStatsGet, handleToolsList, type IntrospectionContext, } from './introspection.js';
|
|
52
52
|
export { handleAutonomySwitch, handlePrefsGet, handlePrefsUpdate, type PrefsContext, } from './prefs.js';
|
|
53
53
|
export { handleProcessKill, handleProcessKillAll, handleProcessList } from './process.js';
|
|
54
54
|
export { handleProjectsAdd, handleProjectsList, handleProjectsSelect, handleWorkingDirSet, type ProjectsContext, type ProjectsOptions, } from './projects.js';
|
|
55
|
-
export { handleKeyDelete, handleKeySetActive, handleKeyUpsert, handleProviderAdd, handleProviderModels, handleProviderRemove, handleProviderClearModels, handleProviderUndoClear, handleProviderUpdate, handleProviderProbe, handleProvidersList, handleProvidersSaved, broadcastSaved, } from './providers.js';
|
|
55
|
+
export { adoptDefaultProviderIfUnset, handleKeyDelete, handleKeySetActive, handleKeyUpsert, handleProviderAdd, handleProviderModels, handleProviderRemove, handleProviderClearModels, handleProviderUndoClear, handleProviderUpdate, handleProviderProbe, handleProvidersList, handleProvidersSaved, broadcastSaved, } from './providers.js';
|
|
56
56
|
export { handleOAuthStart, handleOAuthCode, handleOAuthCancel } from './oauth.js';
|
|
57
57
|
export { handleGoalGet, handleSessionCheckpoints, handleSessionDelete, handleSessionNew, handleSessionRename, handleSessionResume, handleSessionRewind, handleSessionSave, handleSessionsList, type SessionsContext, type SessionsOptions, } from './sessions.js';
|
|
58
58
|
export { handlePlanGet, handlePlanItemUpdate, handlePlanTemplateUse, handleTasksGet, handleTaskUpdate, handleTodosClear, handleTodosGet, handleTodosRemove, handleTodoUpdate, type WorklistContext, } from './worklist.js';
|
|
59
|
-
export { type MailboxContext, getMailbox, handleMailboxMessages, handleMailboxAgents, handleMailboxClear, handleMailboxPurge, } from './mailbox.js';
|
|
59
|
+
export { type MailboxContext, getMailbox, handleMailboxMessages, handleMailboxAgents, handleMailboxClear, handleMailboxCompact, handleMailboxPurge, } from './mailbox.js';
|
|
60
60
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;;;;;;;GASG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,4EAA4E;IAC5E,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,qDAAqD;IACrD,SAAS,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,4EAA4E;IAC5E,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,kGAAkG;IAClG,aAAa,EAAE,mBAAmB,CAAC;IACnC,qEAAqE;IACrE,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;CAC5C;AAED,OAAO,EACL,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,mBAAmB,EACxB,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,WAAW,EACX,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,kCAAkC,GACnC,MA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,EACd,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,cAAc,EACnB,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;;;;;;;GASG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,4EAA4E;IAC5E,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,qDAAqD;IACrD,SAAS,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,4EAA4E;IAC5E,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,kGAAkG;IAClG,aAAa,EAAE,mBAAmB,CAAC;IACnC,qEAAqE;IACrE,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;CAC5C;AAED,OAAO,EACL,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,mBAAmB,EACxB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,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,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,cAAc,EACnB,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,cAAc,CAAC"}
|
|
@@ -16,14 +16,19 @@
|
|
|
16
16
|
* kanban.column.remove→ remove a column
|
|
17
17
|
* kanban.generate → auto-generate a board
|
|
18
18
|
*/
|
|
19
|
+
import { type Context } from '@wrongstack/core';
|
|
19
20
|
import type { WebSocket } from 'ws';
|
|
20
21
|
import type { WsCommon } from './index.js';
|
|
21
22
|
export interface KanbanContext extends WsCommon {
|
|
22
23
|
projectRoot: string;
|
|
24
|
+
/** Live session state used for Kanban -> todo/task/plan write-back. */
|
|
25
|
+
sessionContext?: Context | undefined;
|
|
23
26
|
dispatchTask?: (description: string, opts?: {
|
|
24
27
|
provider?: string | undefined;
|
|
25
28
|
model?: string | undefined;
|
|
26
29
|
fallbackModels?: string[] | undefined;
|
|
30
|
+
fallbackProfile?: string | undefined;
|
|
31
|
+
skills?: string[] | undefined;
|
|
27
32
|
tools?: string[] | undefined;
|
|
28
33
|
name?: string | undefined;
|
|
29
34
|
allowedCapabilities?: readonly string[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kanban.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/kanban.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"kanban.d.ts","sourceRo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AAa,EAClB,EAAE,EAAE,SAAS,EACb,GAAG,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACvC,OAAO,CAAC,IAAI,CAAC,CAg/Bf"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* - mailbox.agents — query online/stored agent statuses
|
|
7
7
|
* - mailbox.clear — clear all mailbox messages
|
|
8
8
|
* - mailbox.purge — purge stale messages by age
|
|
9
|
+
* - mailbox.compact — remove expired, read-by-all, and stale messages
|
|
9
10
|
*/
|
|
10
11
|
import type { WebSocket } from 'ws';
|
|
11
12
|
import { GlobalMailbox, type EventBus } from '@wrongstack/core';
|
|
@@ -48,4 +49,12 @@ export declare function handleMailboxPurge(ctx: MailboxContext, msg: {
|
|
|
48
49
|
incompleteMaxAgeMs?: number;
|
|
49
50
|
};
|
|
50
51
|
}, ws: WebSocket): Promise<void>;
|
|
52
|
+
export declare function handleMailboxCompact(ctx: MailboxContext, msg: {
|
|
53
|
+
payload?: {
|
|
54
|
+
readMaxAgeMs?: number;
|
|
55
|
+
defaultTtlMs?: number;
|
|
56
|
+
completedMaxAgeMs?: number;
|
|
57
|
+
incompleteMaxAgeMs?: number;
|
|
58
|
+
};
|
|
59
|
+
}, ws: WebSocket): Promise<void>;
|
|
51
60
|
//# sourceMappingURL=mailbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/mailbox.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/mailbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAqB,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEnF,MAAM,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Ae1F;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE;IAAE,OAAO,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAC9E,EAAE,EAAE,SAAS,GACZ,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE;IACH,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH,EACD,EAAE,EAAE,SAAS,GACZ,OAAO,CAAC,IAAI,CAAC,CAef"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefs.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/prefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"prefs.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/prefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAsC,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE1F;;;;;;;;;GASG;AAEH,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,gEAAgE;IAChE,KAAK,EAAE,KAAK,CAAC;IACb,kEAAkE;IAClE,YAAY,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,mFAAmF;IACnF,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,6DAA6D;IAC7D,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACvD,+EAA+E;IAC/E,gBAAgB,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACvD,wEAAwE;IACxE,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC9C;AAMD,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAIrE;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,YAAY,EACjB,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,IAAI,CAiCN;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQzF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ProviderConfig } from '@wrongstack/core';
|
|
2
2
|
import type { WebSocket } from 'ws';
|
|
3
|
+
import { type AgentConfigContext } from './agent-config.js';
|
|
3
4
|
import type { WsHandlerContext } from './index.js';
|
|
4
5
|
export declare function broadcastSaved(ctx: WsHandlerContext, providers: Record<string, ProviderConfig>): void;
|
|
5
6
|
export declare function handleProvidersList(ctx: WsHandlerContext, ws: WebSocket): Promise<void>;
|
|
@@ -14,6 +15,15 @@ export declare function handleProviderAdd(ctx: WsHandlerContext, ws: WebSocket,
|
|
|
14
15
|
baseUrl?: string | undefined;
|
|
15
16
|
apiKey?: string | undefined;
|
|
16
17
|
}): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Adopt `providerId` as the live agent's active provider/model when the agent
|
|
20
|
+
* has no usable model yet — the in-session counterpart to the boot auto-select,
|
|
21
|
+
* so the first provider a user adds in the WebUI is immediately usable instead
|
|
22
|
+
* of leaving a blank model. No-op (never hijacks) once any model is active.
|
|
23
|
+
* Resolves the model from the saved allowlist, then the catalog, then a live
|
|
24
|
+
* `/v1/models` probe. Best-effort: a failure just leaves the state unchanged.
|
|
25
|
+
*/
|
|
26
|
+
export declare function adoptDefaultProviderIfUnset(agentCtx: AgentConfigContext, wsCtx: WsHandlerContext, providerId: string): Promise<void>;
|
|
17
27
|
export declare function handleProviderRemove(ctx: WsHandlerContext, ws: WebSocket, providerId: string): Promise<void>;
|
|
18
28
|
/** Drop a provider's model allowlist (so the full catalog is offered again). */
|
|
19
29
|
export declare function handleProviderClearModels(ctx: WsHandlerContext, ws: WebSocket, providerId: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AASpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AASpC,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AA4EnD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE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CAAC,GAAG,EAAE,eAAe,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAcjG;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,SAAS,EACb,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,SAAS,EACb,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,SAAS,EACb,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAG3E;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,SAAS,EACb,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAuDf"}
|
|
@@ -15,7 +15,7 @@ import type { WsCommon } from './index.js';
|
|
|
15
15
|
* module uses `ok`/`error` — structural unification awaits a decision on
|
|
16
16
|
* which format is canonical.
|
|
17
17
|
*
|
|
18
|
-
* The shared handlers live at `@wrongstack/webui
|
|
18
|
+
* The shared handlers live at `@wrongstack/webui-server/handlers` and are
|
|
19
19
|
* used by the standalone WebUI server (`startWebUI`).
|
|
20
20
|
*/
|
|
21
21
|
export interface WorklistContext extends WsCommon {
|