@wrongstack/webui-server 0.313.0 → 0.316.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/index.js +4739 -1302
  2. package/dist/server/agent-roster-handlers.d.ts +3 -2
  3. package/dist/server/backend-services.d.ts +33 -1
  4. package/dist/server/boot.d.ts +2 -1
  5. package/dist/server/brain-handlers.d.ts +21 -4
  6. package/dist/server/chimera-routes.d.ts +88 -0
  7. package/dist/server/codebase-index-server-control.d.ts +2 -1
  8. package/dist/server/codebase-indexing.d.ts +3 -2
  9. package/dist/server/codemap-cache.d.ts +0 -5
  10. package/dist/server/codemap-handlers.d.ts +2 -1
  11. package/dist/server/collab/controller.d.ts +0 -2
  12. package/dist/server/collab/session-registry.d.ts +2 -1
  13. package/dist/server/connection-handler.d.ts +2 -1
  14. package/dist/server/connections/auto-healer.d.ts +5 -6
  15. package/dist/server/connections/collector.d.ts +0 -3
  16. package/dist/server/connections/helpers.d.ts +0 -2
  17. package/dist/server/connections/service-actions.d.ts +0 -4
  18. package/dist/server/content-routes.d.ts +6 -1
  19. package/dist/server/conversation-operations.d.ts +18 -2
  20. package/dist/server/deadcode-handlers.d.ts +2 -1
  21. package/dist/server/design-handlers.d.ts +6 -0
  22. package/dist/server/discover-mailbox-bridge.d.ts +2 -1
  23. package/dist/server/embedded-host-adapters.d.ts +120 -2
  24. package/dist/server/embedded-message-router.d.ts +15 -1
  25. package/dist/server/entry.js +4323 -1086
  26. package/dist/server/file-handlers.d.ts +5 -2
  27. package/dist/server/git-handlers.d.ts +19 -0
  28. package/dist/server/governance-runtime.d.ts +1 -1
  29. package/dist/server/handlers.js +6 -9
  30. package/dist/server/http-server/analytics-handler.d.ts +0 -2
  31. package/dist/server/http-server/security-helpers.d.ts +0 -6
  32. package/dist/server/http-server/vector-memory-handlers.d.ts +2 -56
  33. package/dist/server/index.d.ts +12 -5
  34. package/dist/server/introspection-routes.d.ts +16 -0
  35. package/dist/server/kanban-contract-routes.d.ts +19 -1
  36. package/dist/server/kanban-decomposition-routes.d.ts +4 -1
  37. package/dist/server/kanban-dispatch.d.ts +2 -0
  38. package/dist/server/kanban-route-helpers.d.ts +21 -0
  39. package/dist/server/kanban-routes.d.ts +13 -1
  40. package/dist/server/kanban-supervisor.d.ts +2 -0
  41. package/dist/server/kanban-task-routes.d.ts +4 -1
  42. package/dist/server/lifecycle.d.ts +2 -1
  43. package/dist/server/mcp-handlers.d.ts +2 -1
  44. package/dist/server/message-dispatcher.d.ts +19 -5
  45. package/dist/server/mode-handlers.d.ts +6 -4
  46. package/dist/server/mode-operations.d.ts +15 -4
  47. package/dist/server/model-catalog-search.d.ts +2 -1
  48. package/dist/server/model-operations.d.ts +6 -2
  49. package/dist/server/pending-confirms.d.ts +27 -1
  50. package/dist/server/port-utils.d.ts +16 -2
  51. package/dist/server/pref-helpers.d.ts +1 -1
  52. package/dist/server/prefs-handlers.d.ts +43 -6
  53. package/dist/server/prefs-routes.d.ts +11 -2
  54. package/dist/server/process-handlers.d.ts +12 -5
  55. package/dist/server/project-handlers.d.ts +12 -0
  56. package/dist/server/project-watcher.d.ts +19 -10
  57. package/dist/server/provider/mutations.d.ts +0 -1
  58. package/dist/server/provider-fanout.d.ts +46 -0
  59. package/dist/server/provider-handlers.d.ts +6 -2
  60. package/dist/server/provider-routes.d.ts +3 -0
  61. package/dist/server/provider-store.d.ts +2 -1
  62. package/dist/server/requirement-intake-handlers.d.ts +0 -2
  63. package/dist/server/route-family-dispatcher.d.ts +2 -0
  64. package/dist/server/routes.d.ts +41 -5
  65. package/dist/server/sdd-board-ws-handler.d.ts +2 -2
  66. package/dist/server/server-runtime.d.ts +23 -6
  67. package/dist/server/session-agent-registry.d.ts +145 -0
  68. package/dist/server/session-agent-sessions.d.ts +49 -0
  69. package/dist/server/session-cleanup-scheduler.d.ts +3 -2
  70. package/dist/server/session-deletion.d.ts +1 -0
  71. package/dist/server/session-handlers.d.ts +82 -1
  72. package/dist/server/session-history.d.ts +4 -3
  73. package/dist/server/session-routes.d.ts +2 -0
  74. package/dist/server/session-scoped-prefs.d.ts +28 -0
  75. package/dist/server/setup-events-core-watchers.d.ts +7 -2
  76. package/dist/server/setup-events-fleet-broadcaster.d.ts +7 -2
  77. package/dist/server/setup-events-pattern-handlers.d.ts +5 -1
  78. package/dist/server/setup-events-provider-handlers.d.ts +1 -1
  79. package/dist/server/setup-events-session-helpers.d.ts +14 -1
  80. package/dist/server/setup-events-status-watcher.d.ts +7 -2
  81. package/dist/server/setup-events-subagent-handlers.d.ts +5 -1
  82. package/dist/server/setup-events-tool-handlers.d.ts +14 -1
  83. package/dist/server/setup-events.d.ts +21 -1
  84. package/dist/server/setup-screen.d.ts +3 -2
  85. package/dist/server/shell-git-routes.d.ts +4 -0
  86. package/dist/server/standalone-session-identity.d.ts +3 -3
  87. package/dist/server/start-webui-proxy-apply.d.ts +2 -1
  88. package/dist/server/start-webui-shutdown.d.ts +15 -0
  89. package/dist/server/system-prompt-handlers.d.ts +67 -0
  90. package/dist/server/system-prompt-rebuild.d.ts +45 -0
  91. package/dist/server/terminal-dashboard.d.ts +145 -0
  92. package/dist/server/types.d.ts +33 -4
  93. package/dist/server/webui-status-logger.d.ts +61 -0
  94. package/dist/server/worklist-routes.d.ts +8 -2
  95. package/dist/server/worklist-session-context.d.ts +44 -0
  96. package/dist/server/worktree-ws-handler.d.ts +2 -1
  97. package/dist/server/ws-payload-validation.d.ts +27 -2
  98. package/dist/server/ws-utils.d.ts +29 -4
  99. package/package.json +15 -14
@@ -25,11 +25,11 @@ import type { WSServerMessage } from './types.js';
25
25
  * embedded and standalone routers can supply this from the active agent
26
26
  * context (`agent.ctx.provider` / `agent.ctx.model`).
27
27
  */
28
- export interface AgentRosterLlm {
28
+ interface AgentRosterLlm {
29
29
  provider: Provider;
30
30
  model: string;
31
31
  }
32
- export interface AgentRosterHandlerOptions {
32
+ interface AgentRosterHandlerOptions {
33
33
  projectRoot: string | (() => string);
34
34
  /**
35
35
  * Resolves the LLM used to synthesize consolidations directly on the server,
@@ -60,4 +60,5 @@ export declare class AgentRosterWSHandler {
60
60
  /** Handle an incoming client message. Returns a response payload. */
61
61
  handleMessage(_ws: WebSocket, type: string, payload: unknown): Promise<WSServerMessage>;
62
62
  }
63
+ export {};
63
64
  //# sourceMappingURL=agent-roster-handlers.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { AgentPipelines, Context } from '@wrongstack/core/agent';
1
+ import { type AgentPipelines, Context } from '@wrongstack/core/agent';
2
2
  import type { CollaborationBus, ObservableBrainArbiter } from '@wrongstack/core/coordination';
3
3
  import type { AutoCompactionMiddleware, BrainAutoRisk, BrainRuntime } from '@wrongstack/core/execution';
4
4
  import type { DefaultTokenCounter } from '@wrongstack/core/infrastructure';
@@ -58,6 +58,21 @@ interface AgentServicesInput {
58
58
  sessionGetter: () => Session;
59
59
  /** Read-only session reader (collab replay-on-join). */
60
60
  sessionReader: SessionReader;
61
+ /**
62
+ * True while `sessionId` has an in-flight run. Consulted before evicting a
63
+ * session agent: the registry is capped at the tab limit, so without this a
64
+ * fifth lookup would drop a tab that is mid-turn and strand its transcript.
65
+ */
66
+ isRunActive?: ((sessionId: string) => boolean) | undefined;
67
+ /**
68
+ * Is any connected surface still showing `sessionId`?
69
+ *
70
+ * Also consulted before eviction, and it decides WHICH agent goes. Insertion
71
+ * order alone picks the oldest, which is routinely a tab the user still has
72
+ * open, while the agent of a tab they closed minutes ago survives because it
73
+ * was created later.
74
+ */
75
+ isDisplayed?: ((sessionId: string) => boolean) | undefined;
61
76
  /** Annotations store (collab notes). */
62
77
  annotationsStore: AnnotationsStore;
63
78
  /**
@@ -73,6 +88,22 @@ interface AgentServices {
73
88
  autoCompactor: AutoCompactionMiddleware | undefined;
74
89
  toolExecutor: ToolExecutor;
75
90
  agent: Agent;
91
+ getAgent?: (sessionId?: string) => Agent;
92
+ /**
93
+ * The Agent for a session WITHOUT creating one. Read-only callers (status
94
+ * logging, introspection, "can this host serve that id") must use this:
95
+ * `getAgent` creates, so asking about a stale id materialised an agent and
96
+ * could evict a live tab's.
97
+ */
98
+ peekAgent?: (sessionId?: string) => Agent | undefined;
99
+ /** Conversations holding a live agent — see `WebuiDeps.sessionAgentIds`. */
100
+ sessionAgentIds?: () => string[];
101
+ /** Does this host already hold an open journal writer for that session? */
102
+ isSessionLive?: (sessionId: string) => boolean;
103
+ /** Drain every open tab's journal synchronously — fatal-exit salvage. */
104
+ flushSessionJournalsSync?: () => void;
105
+ /** End + close the journals of every tab that is not the leader's. */
106
+ closeSessionJournals?: () => Promise<void>;
76
107
  permissionPolicy: PermissionPolicy;
77
108
  pipelines: AgentPipelines;
78
109
  brain: ObservableBrainArbiter;
@@ -86,6 +117,7 @@ interface AgentServices {
86
117
  kind: string;
87
118
  question: string;
88
119
  outcome: string;
120
+ sessionId?: string | undefined;
89
121
  }>;
90
122
  brainMonitor: BrainMonitor;
91
123
  /** LIVE persistent decision ledger (undefined when disabled). Read via the
@@ -2,7 +2,7 @@ import { type DefaultLogger } from '@wrongstack/core/infrastructure';
2
2
  import type { DefaultSecretVault } from '@wrongstack/core/security';
3
3
  import type { Config } from '@wrongstack/core/types';
4
4
  import type { WstackPaths } from '@wrongstack/core/utils';
5
- export interface BootResult {
5
+ interface BootResult {
6
6
  config: Config;
7
7
  vault: DefaultSecretVault;
8
8
  globalConfigPath: string;
@@ -19,4 +19,5 @@ export interface BootResult {
19
19
  */
20
20
  export declare function bootConfig(): Promise<BootResult>;
21
21
  export declare function patchConfig(config: Config, updates: Partial<Config>): Config;
22
+ export {};
22
23
  //# sourceMappingURL=boot.d.ts.map
@@ -18,6 +18,13 @@ export interface BrainLogEntry {
18
18
  kind: string;
19
19
  question: string;
20
20
  outcome: string;
21
+ /**
22
+ * The session the decision was about. The Brain is project-wide, but each
23
+ * decision concerns one session's tool call — a tab asking `/brain` wants
24
+ * ITS decisions, not an unlabelled mixture of every open tab's.
25
+ * Undefined for decisions that named no session.
26
+ */
27
+ sessionId?: string | undefined;
21
28
  }
22
29
  export interface BrainTransportContext {
23
30
  send: (ws: WebSocket, message: WSServerMessage) => void;
@@ -39,9 +46,19 @@ export interface BrainHandlerContext extends BrainTransportContext {
39
46
  /** Read the active session id for brain.ask requests. */
40
47
  getSessionId?: (() => string | undefined) | undefined;
41
48
  }
42
- export declare function handleBrainStatus(ctx: BrainHandlerContext, ws: WebSocket): void;
49
+ export declare function handleBrainStatus(ctx: BrainHandlerContext, ws: WebSocket, sessionId?: string | undefined): void;
43
50
  export declare function handleBrainConfigGet(ctx: BrainHandlerContext, ws: WebSocket): void;
44
- export declare function handleBrainConfigSet(ctx: BrainHandlerContext, ws: WebSocket, payload: unknown): Promise<void>;
45
- export declare function handleBrainRisk(ctx: BrainHandlerContext, ws: WebSocket, level: string): void;
46
- export declare function handleBrainAsk(ctx: BrainHandlerContext, ws: WebSocket, question: string | undefined): Promise<void>;
51
+ export declare function handleBrainConfigSet(ctx: BrainHandlerContext, ws: WebSocket, payload: unknown,
52
+ /** The tab that changed the setting the follow-up status is stamped for it. */
53
+ sessionId?: string | undefined): Promise<void>;
54
+ export declare function handleBrainRisk(ctx: BrainHandlerContext, ws: WebSocket, level: string, sessionId?: string | undefined): void;
55
+ export declare function handleBrainAsk(ctx: BrainHandlerContext, ws: WebSocket, question: string | undefined,
56
+ /**
57
+ * The tab that asked. `ctx.getSessionId()` is the runtime's session — with
58
+ * four tabs open that is the one the runtime last switched to, so a
59
+ * background tab's `/brain ask` was attributed to another session, filed
60
+ * under its decisions, and answered with a stamp the asking tab's own
61
+ * session gate then dropped.
62
+ */
63
+ sessionId?: string | undefined): Promise<void>;
47
64
  //# sourceMappingURL=brain-handlers.d.ts.map
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Chimera review-report routes — the session-scoped and project-wide view
3
+ * of persisted Chimera review reports, findings, and event journals.
4
+ *
5
+ * Wire shape:
6
+ * client → `chimera.reports.list` { sessionId?: string, all?: boolean, lifecycle?: string, limit?: number }
7
+ * server → `chimera.reports` { sessionId, reports: [...] }
8
+ * client → `chimera.report.get` { reportId }
9
+ * server → `chimera.report.detail` { report, findings, events, error?: string }
10
+ * client → `chimera.report.transition` { reportId, to, reason?: string }
11
+ * server → `chimera.report.updated` { reportId, lifecycle, success: boolean, error?: string }
12
+ * client → `chimera.report.add_note` { reportId, note: string }
13
+ * server → `chimera.report.note_added` { reportId, success: boolean, error?: string }
14
+ * client → `chimera.finding.transition` { findingId, to, outcome?: string, reason?: string }
15
+ * server → `chimera.finding.updated` { findingId, status, success: boolean, error?: string }
16
+ */
17
+ import { type ChimeraFinding, type FindingLifecycleEvent, type ReviewReport, type ReviewReportCounts, type ReviewReportEvent } from '@wrongstack/core/plugin';
18
+ import type { WebSocket } from 'ws';
19
+ import type { WSClientMessage } from './types.js';
20
+ export interface ChimeraRouteHandlers {
21
+ listReports: (ws: WebSocket, msg: WSClientMessage) => Promise<void>;
22
+ getReport?: ((ws: WebSocket, msg: WSClientMessage) => Promise<void>) | undefined;
23
+ transitionReport?: ((ws: WebSocket, msg: WSClientMessage) => Promise<void>) | undefined;
24
+ addReportNote?: ((ws: WebSocket, msg: WSClientMessage) => Promise<void>) | undefined;
25
+ transitionFinding?: ((ws: WebSocket, msg: WSClientMessage) => Promise<void>) | undefined;
26
+ }
27
+ export declare function handleChimeraRoute(ws: WebSocket, msg: WSClientMessage, handlers: ChimeraRouteHandlers): Promise<boolean>;
28
+ /** One report row on the wire. */
29
+ export interface ChimeraReportSummary {
30
+ reportId: string;
31
+ sessionId: string;
32
+ agentId?: string | undefined;
33
+ reviewedAt: string;
34
+ reviewerModel?: string | undefined;
35
+ source?: string | undefined;
36
+ reviewStatus?: 'success' | 'failed' | undefined;
37
+ lifecycleStatus: string;
38
+ counts?: ReviewReportCounts | undefined;
39
+ totalFindings: number;
40
+ fileCount?: number | undefined;
41
+ durationSeconds?: number | undefined;
42
+ cascadeDepth?: number | undefined;
43
+ evidenceStatus?: string | undefined;
44
+ /** Mirrors `pending`: the client backfills cards for actionable rows. */
45
+ hasActionableFindings: boolean;
46
+ }
47
+ /**
48
+ * A report still asks for attention until its findings are closed out.
49
+ * `completed`/`skipped` are terminal: nobody needs to be nudged about them.
50
+ */
51
+ export declare function isPendingChimeraReport(report: {
52
+ lifecycle: string;
53
+ totalFindings: number;
54
+ }): boolean;
55
+ /**
56
+ * List one session's pending persisted review reports, newest first.
57
+ * Pure over the store — unit-testable without a WebSocket.
58
+ */
59
+ export declare function listChimeraReportsForSession(projectDir: string, sessionId: string, limit?: number): Promise<ChimeraReportSummary[]>;
60
+ /**
61
+ * Query all reports across sessions with optional filters.
62
+ */
63
+ export declare function queryAllChimeraReports(projectDir: string, opts?: {
64
+ sessionId?: string | undefined;
65
+ lifecycle?: string | undefined;
66
+ limit?: number | undefined;
67
+ }): Promise<ChimeraReportSummary[]>;
68
+ /** Finding with its lifecycle events attached for detail view. */
69
+ export interface FindingWithEvents {
70
+ finding: ChimeraFinding;
71
+ events: FindingLifecycleEvent[];
72
+ }
73
+ /** Full report detail payload. */
74
+ export interface ChimeraReportDetail {
75
+ report: ReviewReport | null;
76
+ findings: FindingWithEvents[];
77
+ events: ReviewReportEvent[];
78
+ }
79
+ /** Build the route handlers. `projectDir` is read lazily: project switches re-root it. */
80
+ export declare function createChimeraRouteHandlers(deps: {
81
+ projectDir: () => string;
82
+ send: (ws: WebSocket, msg: {
83
+ type: string;
84
+ payload: unknown;
85
+ }) => void;
86
+ log?: ((message: string) => void) | undefined;
87
+ }): ChimeraRouteHandlers;
88
+ //# sourceMappingURL=chimera-routes.d.ts.map
@@ -2,7 +2,7 @@ import type { TrustBoundary } from '@wrongstack/core/security';
2
2
  import type { Logger } from '@wrongstack/core/types';
3
3
  import type { WebSocket } from 'ws';
4
4
  import type { WSClientMessage, WSServerMessage } from './types.js';
5
- export interface CodebaseIndexServerControlDeps {
5
+ interface CodebaseIndexServerControlDeps {
6
6
  trustBoundary: TrustBoundary;
7
7
  logger?: Logger | undefined;
8
8
  getProjectRoot(): string;
@@ -12,4 +12,5 @@ export interface CodebaseIndexServerControlDeps {
12
12
  }
13
13
  /** Handle the WebSocket control message that stops this project's index server. */
14
14
  export declare function handleCodebaseIndexServerControl(ws: WebSocket, message: WSClientMessage, deps: CodebaseIndexServerControlDeps): Promise<boolean>;
15
+ export {};
15
16
  //# sourceMappingURL=codebase-index-server-control.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type { Context } from '@wrongstack/core/agent';
2
2
  import type { EventBus } from '@wrongstack/core/kernel';
3
3
  import type { IndexingConfig, Logger } from '@wrongstack/core/types';
4
- export interface WebUICodebaseIndexingDeps {
4
+ interface WebUICodebaseIndexingDeps {
5
5
  config: {
6
6
  indexing?: IndexingConfig | undefined;
7
7
  };
@@ -10,9 +10,10 @@ export interface WebUICodebaseIndexingDeps {
10
10
  logger: Logger;
11
11
  events?: EventBus | undefined;
12
12
  }
13
- export interface WebUICodebaseIndexing {
13
+ interface WebUICodebaseIndexing {
14
14
  onFileWritten(filePath: string): void;
15
15
  dispose(): void;
16
16
  }
17
17
  export declare function setupWebUICodebaseIndexing(deps: WebUICodebaseIndexingDeps): WebUICodebaseIndexing;
18
+ export {};
18
19
  //# sourceMappingURL=codebase-indexing.d.ts.map
@@ -1,8 +1,3 @@
1
- export interface CodemapCacheEntry {
2
- version: string;
3
- /** Pre-serialized JSON body — avoids re-stringify on cache hits. */
4
- body: string;
5
- }
6
1
  /**
7
2
  * Filesystem fingerprint of the index DB used as the cache generation key.
8
3
  *
@@ -11,7 +11,7 @@
11
11
  * GET /api/codemap/symbols?file=<path> — symbol-level graph for one file
12
12
  */
13
13
  import type * as http from 'node:http';
14
- export interface CodemapHandlerDeps {
14
+ interface CodemapHandlerDeps {
15
15
  projectRoot: string;
16
16
  /** Optional index directory override (tests, custom wiring). */
17
17
  indexDir?: string | undefined;
@@ -22,4 +22,5 @@ export declare function handleCodemapPackages(res: http.ServerResponse, deps: Co
22
22
  export declare function handleCodemapFiles(res: http.ServerResponse, deps: CodemapHandlerDeps, pkg: string): Promise<void>;
23
23
  /** GET /api/codemap/symbols?file=<path> — symbol-level graph within a file. */
24
24
  export declare function handleCodemapSymbols(res: http.ServerResponse, deps: CodemapHandlerDeps, file: string): Promise<void>;
25
+ export {};
25
26
  //# sourceMappingURL=codemap-handlers.d.ts.map
@@ -2,8 +2,6 @@ import type { WebSocket } from 'ws';
2
2
  import type { WSServerMessage } from '../types.js';
3
3
  import type { CollabContext } from './collab-context.js';
4
4
  import type { CollabFeature } from './dispatcher.js';
5
- /** How long the middleware waits before auto-resuming (mirrors the middleware default). */
6
- export declare const PAUSE_TIMEOUT_MS = 60000;
7
5
  /**
8
6
  * Controller flow, Phase 3 (6A-2). Moved verbatim from
9
7
  * CollaborationWebSocketHandler: pause/resume/grant_control guards and
@@ -13,7 +13,7 @@ export interface Participant {
13
13
  joinedAt: string;
14
14
  }
15
15
  /** One removal produced by `removeBySocket`, with leave-choreography facts. */
16
- export interface SocketRemoval {
16
+ interface SocketRemoval {
17
17
  sessionId: string;
18
18
  participant: Participant;
19
19
  /** True when this removal emptied the session bucket (no broadcast due). */
@@ -71,4 +71,5 @@ export declare class CollabSessionRegistry {
71
71
  sessionIdOfParticipant(participantId: string): string | null;
72
72
  clear(): void;
73
73
  }
74
+ export {};
74
75
  //# sourceMappingURL=session-registry.d.ts.map
@@ -10,7 +10,7 @@ import type { SpecsWebSocketHandler } from './specs-ws-handler.js';
10
10
  import type { TerminalWebSocketHandler } from './terminal-ws-handler.js';
11
11
  import type { ConnectedClient, WSClientMessage } from './types.js';
12
12
  import type { WorktreeWebSocketHandler } from './worktree-ws-handler.js';
13
- export interface ConnectionHandlerOptions {
13
+ interface ConnectionHandlerOptions {
14
14
  getSessionId(): string;
15
15
  sessionStartPayload(): Promise<Record<string, unknown>>;
16
16
  tokenCounter: TokenCounter;
@@ -39,4 +39,5 @@ export interface ConnectionHandlerOptions {
39
39
  onSecurityRejection?: (event: import('./connection-lifecycle.js').SecurityRejectionEvent) => void;
40
40
  }
41
41
  export declare function createConnectionHandler(options: ConnectionHandlerOptions): (ws: WebSocket) => void;
42
+ export {};
42
43
  //# sourceMappingURL=connection-handler.d.ts.map
@@ -18,10 +18,8 @@ import type { ConnectionHealthService, ConnectionsHealthReport, ServiceActionRes
18
18
  * damaged rows) and should also never trigger a restart.
19
19
  */
20
20
  export declare const AUTO_HEAL_ENV_FLAG = "WRONGSTACK_AUTO_HEAL_SERVICES";
21
- export declare const AUTO_HEAL_DEFAULT_INTERVAL_MS = 30000;
22
21
  export declare const AUTO_HEAL_DEFAULT_COOLDOWN_MS: number;
23
- export declare const AUTO_HEAL_DEFAULT_MAX_ATTEMPTS = 3;
24
- export interface AutoHealServiceState {
22
+ interface AutoHealServiceState {
25
23
  lastAttemptAt: number | null;
26
24
  consecutiveFailures: number;
27
25
  lastSuccess: boolean | null;
@@ -39,13 +37,13 @@ export interface AutoHealStatusEvent {
39
37
  /** 1-based attempt number within the current failure streak. */
40
38
  attempt: number;
41
39
  }
42
- export interface AutoHealSnapshot {
40
+ interface AutoHealSnapshot {
43
41
  enabled: boolean;
44
42
  running: boolean;
45
43
  lastTickAt: number | null;
46
44
  services: Record<string, AutoHealServiceState>;
47
45
  }
48
- export interface AutoHealerOptions {
46
+ interface AutoHealerOptions {
49
47
  projectRoot: () => string;
50
48
  indexDir: () => string | undefined;
51
49
  /** Policy boundary. When absent, auto-heal refuses to act (same rule as the manual WS path). */
@@ -67,7 +65,7 @@ export interface AutoHealerOptions {
67
65
  cooldownMs?: number;
68
66
  maxAttempts?: number;
69
67
  }
70
- export interface AutoHealer {
68
+ interface AutoHealer {
71
69
  start(): void;
72
70
  stop(): void;
73
71
  /**
@@ -82,4 +80,5 @@ export interface AutoHealer {
82
80
  }
83
81
  export declare function isAutoHealEnabled(): boolean;
84
82
  export declare function createAutoHealer(options: AutoHealerOptions): AutoHealer;
83
+ export {};
85
84
  //# sourceMappingURL=auto-healer.d.ts.map
@@ -4,12 +4,9 @@ export declare function collectConnectionsHealth(options: {
4
4
  indexDir?: string | undefined;
5
5
  backend: ConnectionsHealthReport['backend'];
6
6
  }): Promise<ConnectionsHealthReport>;
7
- export declare function webuiHealth(backend: ConnectionsHealthReport['backend']): ConnectionHealthService;
8
- export declare function sessionCatalogHealth(projectRoot: string): Promise<ConnectionHealthService>;
9
7
  export declare function chronicleHealth(projectRoot: string): Promise<ConnectionHealthService>;
10
8
  export declare function codebaseIndexHealth(projectRoot: string, indexDir?: string): Promise<ConnectionHealthService>;
11
9
  export declare function sageHealth(projectRoot: string): Promise<ConnectionHealthService>;
12
10
  export declare function kanbanHealth(projectRoot: string): Promise<ConnectionHealthService>;
13
11
  export declare function mailboxHealth(projectRoot: string): Promise<ConnectionHealthService>;
14
- export declare function governanceHealth(projectRoot: string): Promise<ConnectionHealthService>;
15
12
  //# sourceMappingURL=collector.d.ts.map
@@ -1,6 +1,4 @@
1
1
  import type { ConnectionHealthService } from './types.js';
2
- export declare const RESTART_POLL_INTERVAL_MS = 250;
3
- export declare const RESTART_DEADLINE_MS = 3000;
4
2
  /**
5
3
  * Raw socket probe — checks if anything is listening on an IPC endpoint
6
4
  * (Unix domain socket or Windows named pipe) without sending protocol frames.
@@ -6,11 +6,7 @@ export declare function executeServiceAction(serviceId: ConnectionHealthService[
6
6
  export declare function killKanbanServer(projectRoot: string, action: 'shutdown' | 'restart'): Promise<ServiceActionResult>;
7
7
  export declare function restartKanbanServer(projectRoot: string): Promise<ServiceActionResult>;
8
8
  export declare function killSageServer(projectRoot: string, action: 'shutdown' | 'restart'): Promise<ServiceActionResult>;
9
- export declare function restartSageServer(projectRoot: string): Promise<ServiceActionResult>;
10
9
  export declare function killChronicleServer(projectRoot: string, action: 'shutdown' | 'restart'): Promise<ServiceActionResult>;
11
- export declare function restartChronicleServer(projectRoot: string): Promise<ServiceActionResult>;
12
10
  export declare function killCodebaseIndexServer(projectRoot: string, indexDir: string | undefined, action: 'shutdown' | 'restart'): Promise<ServiceActionResult>;
13
- export declare function restartCodebaseIndexServer(projectRoot: string, indexDir: string | undefined): Promise<ServiceActionResult>;
14
11
  export declare function killMailboxServer(projectRoot: string, action: 'shutdown' | 'restart'): Promise<ServiceActionResult>;
15
- export declare function restartMailboxServer(projectRoot: string): Promise<ServiceActionResult>;
16
12
  //# sourceMappingURL=service-actions.d.ts.map
@@ -7,7 +7,12 @@ export interface ContentRouteContext {
7
7
  getProjectRoot: () => string;
8
8
  getSkillsContext: () => SkillsContext;
9
9
  getPromptsContext: () => PromptsContext;
10
- getDesignContext: () => DesignContext;
10
+ /**
11
+ * The design kit is pinned on a conversation's own meta, so the tab that
12
+ * picked it is the one whose prompts carry it. Without the id every pick
13
+ * landed on the leader — tab 3 choosing a kit re-styled tab 1's next turn.
14
+ */
15
+ getDesignContext: (sessionId?: string | undefined) => DesignContext;
11
16
  onFileWritten?: ((filePath: string) => void) | undefined;
12
17
  }
13
18
  /** Canonical file/skill/prompt/design routing shared by every WebUI host. */
@@ -18,13 +18,29 @@ export interface ConversationRunControl {
18
18
  abort(ws: WebSocket, sessionId: string): void;
19
19
  }
20
20
  export interface ConversationOperationsContext {
21
- getAgent: () => Agent;
21
+ getAgent: (sessionId?: string) => Agent;
22
22
  getSessionId: () => string;
23
+ hasSession?: ((id: string) => boolean) | undefined;
23
24
  runControl: ConversationRunControl;
24
25
  pendingConfirms: Map<string, PendingConfirm>;
25
26
  send: (ws: WebSocket, message: OutboundMessage) => void;
26
27
  notifyAbort: (ws: WebSocket, message: OutboundMessage) => void;
27
- getMaxIterations?: () => number | undefined;
28
+ /**
29
+ * The iteration ceiling for ONE session.
30
+ *
31
+ * `maxIterations` is a per-tab preference (it sits on the session's own
32
+ * context meta, like autonomy and yolo), so reading it off the shared root
33
+ * context handed every tab whichever value the runtime's current session
34
+ * happened to hold — a run in tab 3 capped by a number the user set in tab 1.
35
+ */
36
+ getMaxIterations?: (sessionId?: string) => number | undefined;
37
+ /**
38
+ * Serialiser shared with the session handlers. Run setup is wrapped in it so
39
+ * a turn can never start on a context that a concurrent session.new /
40
+ * session.resume is halfway through re-pointing. Defaults to running the
41
+ * callback directly when the host does not wire one.
42
+ */
43
+ withSessionTransition?: (<T>(operation: () => Promise<T>) => Promise<T>) | undefined;
28
44
  busyPhase?: string;
29
45
  busyMessage?: string;
30
46
  }
@@ -1,8 +1,9 @@
1
1
  import type * as http from 'node:http';
2
- export interface DeadCodeHandlerDeps {
2
+ interface DeadCodeHandlerDeps {
3
3
  projectRoot: string;
4
4
  indexDir?: string | undefined;
5
5
  }
6
6
  export declare function handleDeadCodeScan(res: http.ServerResponse, deps: DeadCodeHandlerDeps, req: http.IncomingMessage): Promise<void>;
7
7
  export declare function handleDeadCodeActionPlan(res: http.ServerResponse, _deps: DeadCodeHandlerDeps, req: http.IncomingMessage): Promise<void>;
8
+ export {};
8
9
  //# sourceMappingURL=deadcode-handlers.d.ts.map
@@ -21,6 +21,12 @@ export interface DesignContext {
21
21
  agentMeta?: {
22
22
  meta: Record<string, unknown>;
23
23
  } | undefined;
24
+ /**
25
+ * The session that sent the request, when it stamped one. Echoed on every
26
+ * response so the gallery can drop a late reply that belongs to another
27
+ * tab — without it, tab A's slow `design.list` overwrote tab B's kit view.
28
+ */
29
+ sessionId?: string | undefined;
24
30
  }
25
31
  export declare function handleDesignList(ws: WebSocket, ctx: DesignContext): Promise<void>;
26
32
  export declare function handleDesignState(ws: WebSocket, ctx: DesignContext): Promise<void>;
@@ -1,4 +1,4 @@
1
- export interface MailboxBridgeParams {
1
+ interface MailboxBridgeParams {
2
2
  projectRoot: string;
3
3
  config: {
4
4
  features?: {
@@ -28,4 +28,5 @@ export interface MailboxBridgeParams {
28
28
  * project was overhead nobody collected on. Opt in with 'auto'.
29
29
  */
30
30
  export declare function discoverMailboxBridgeForWebui(params: MailboxBridgeParams): Promise<void>;
31
+ export {};
31
32
  //# sourceMappingURL=discover-mailbox-bridge.d.ts.map