@wrongstack/webui-server 0.302.0 → 0.302.2

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.
@@ -1,10 +1,10 @@
1
1
  import type { TrustBoundary } from '@wrongstack/core/security';
2
- import { authorizeWebUIAction } from './privileged-actions.js';
3
2
  import type { WebSocket } from 'ws';
3
+ import { authorizeWebUIAction } from './privileged-actions.js';
4
4
  import type { WSClientMessage, WSServerMessage } from './types.js';
5
5
  export type ConnectionHealthStatus = 'healthy' | 'degraded' | 'offline' | 'unavailable' | 'error';
6
6
  export interface ConnectionHealthService {
7
- id: 'webui' | 'chronicle' | 'codebase-index' | 'sage' | 'kanban' | 'mailbox' | 'governance';
7
+ id: 'webui' | 'session-catalog' | 'chronicle' | 'codebase-index' | 'sage' | 'kanban' | 'mailbox' | 'governance';
8
8
  label: string;
9
9
  status: ConnectionHealthStatus;
10
10
  required: boolean;
@@ -7,10 +7,15 @@ type OutboundMessage = {
7
7
  payload: unknown;
8
8
  };
9
9
  export interface ConversationRunControl {
10
- /** Return a controller when acquired, or undefined when this host is busy. */
11
- begin(ws: WebSocket): AbortController | undefined;
12
- end(ws: WebSocket, controller: AbortController): void;
13
- abort(ws: WebSocket): void;
10
+ /**
11
+ * Acquire a run controller for the given session.
12
+ * Return a controller when acquired, or undefined when this host is busy.
13
+ */
14
+ begin(ws: WebSocket, sessionId: string): AbortController | undefined;
15
+ /** Release the controller for the given session after the run completes. */
16
+ end(ws: WebSocket, sessionId: string, controller: AbortController): void;
17
+ /** Abort only the run belonging to `sessionId`, leaving other sessions intact. */
18
+ abort(ws: WebSocket, sessionId: string): void;
14
19
  }
15
20
  export interface ConversationOperationsContext {
16
21
  getAgent: () => Agent;
@@ -73,7 +73,8 @@ export declare function createEmbeddedProviderOperations(ctx: EmbeddedProviderCo
73
73
  };
74
74
  export interface EmbeddedConversationContext extends EmbeddedHostTransport {
75
75
  agent: Agent;
76
- abortControllers: Map<WebSocket, AbortController>;
76
+ /** Session-keyed abort controllers — one active run per session. */
77
+ abortControllers: Map<string, AbortController>;
77
78
  pendingConfirms: Map<string, PendingConfirm>;
78
79
  }
79
80
  export declare function createEmbeddedConversationRoutes(ctx: EmbeddedConversationContext): ConversationRouteHandlers;
@@ -92,10 +93,10 @@ export interface EmbeddedSessionContext extends EmbeddedHostTransport {
92
93
  opts: EmbeddedSessionOptions;
93
94
  buildSessionStart: (overrides?: Record<string, unknown>) => Promise<unknown>;
94
95
  getCustomModeStore: () => Promise<CustomModeStore>;
95
- /** Abort the in-flight agent run before session.new/resume swaps the session. */
96
- abortActiveRun?: (() => void) | undefined;
96
+ /** When sessionId is provided, abort only that session's run; otherwise abort all. */
97
+ abortActiveRun?: ((sessionId?: string) => void) | undefined;
97
98
  /** True while an embedded agent run is active. */
98
- isRunActive?: (() => boolean) | undefined;
99
+ isRunActive?: ((sessionId?: string) => boolean) | undefined;
99
100
  }
100
101
  export declare function createEmbeddedSessionRoutes(ctx: EmbeddedSessionContext): SessionRouteHandlers;
101
102
  export declare function broadcastEmbeddedGoalSnapshot(ctx: EmbeddedSessionContext): Promise<void>;
@@ -103,7 +104,8 @@ export interface EmbeddedProjectContext extends EmbeddedHostTransport {
103
104
  opts: EmbeddedSessionOptions & {
104
105
  globalConfigPath?: string | undefined;
105
106
  };
106
- abortControllers: Map<WebSocket, AbortController>;
107
+ /** Session-keyed — same instance as EmbeddedConversationContext. */
108
+ abortControllers: Map<string, AbortController>;
107
109
  abortLegacyRun: () => void;
108
110
  buildSessionStart: (overrides?: Record<string, unknown>) => Promise<unknown>;
109
111
  }