@wrongstack/webui-server 0.301.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.
- package/dist/index.js +436 -187
- package/dist/server/connections-health-route.d.ts +2 -2
- package/dist/server/conversation-operations.d.ts +9 -4
- package/dist/server/embedded-host-adapters.d.ts +7 -5
- package/dist/server/embedded-lifecycle.d.ts +17 -2
- package/dist/server/entry.js +615 -143
- package/dist/server/index.d.ts +1 -1
- package/dist/server/instance-registry.d.ts +51 -2
- package/dist/server/kanban-routes.d.ts +8 -0
- package/dist/server/kanban-supervisor.d.ts +1 -1
- package/dist/server/lifecycle.d.ts +7 -0
- package/dist/server/message-dispatcher.d.ts +10 -0
- package/dist/server/server-runtime.d.ts +8 -1
- package/dist/server/session-handlers.d.ts +3 -2
- package/dist/server/standalone-session-identity.d.ts +10 -2
- package/package.json +11 -11
|
@@ -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
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
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
|
-
|
|
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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type WebUIInstanceRecord } from './instance-registry.js';
|
|
1
|
+
import { type WebUIInstanceRecord, type WebUIInstanceRole } from './instance-registry.js';
|
|
2
2
|
import type { SurfaceKind } from './port-utils.js';
|
|
3
3
|
/**
|
|
4
4
|
* PR 7 of Issue #30 (webui-server 8-PR refactor): process lifecycle.
|
|
@@ -38,6 +38,21 @@ export interface RegisterWebuiInstanceParams {
|
|
|
38
38
|
* authenticate `POST /api/fleet/ping` (H3). See `WebUIInstanceRecord`.
|
|
39
39
|
*/
|
|
40
40
|
authToken?: string | undefined;
|
|
41
|
+
/** Runtime role. Missing means the legacy standalone WebUI/SimpleUI role. */
|
|
42
|
+
role?: WebUIInstanceRole | undefined;
|
|
43
|
+
/** Live session owned by this endpoint when `role === 'session-child'`. */
|
|
44
|
+
sessionId?: string | undefined;
|
|
45
|
+
/** Parent shell process identity, when this endpoint was spawned by a parent. */
|
|
46
|
+
parentPid?: number | undefined;
|
|
47
|
+
parentShellId?: string | undefined;
|
|
48
|
+
/** Stable child runtime id, distinct from the session id. */
|
|
49
|
+
runtimeId?: string | undefined;
|
|
50
|
+
/** Whether a parent shell should treat this endpoint as attachable. */
|
|
51
|
+
attachable?: boolean | undefined;
|
|
52
|
+
/** Health/protocol hints for future parent shells. */
|
|
53
|
+
lastReadyAt?: string | undefined;
|
|
54
|
+
protocolVersion?: number | undefined;
|
|
55
|
+
capabilities?: string[] | undefined;
|
|
41
56
|
}
|
|
42
57
|
export interface RegisterWebuiInstanceDeps {
|
|
43
58
|
registerFn?: (record: WebUIInstanceRecord, baseDir?: string) => Promise<void>;
|
|
@@ -48,7 +63,7 @@ export interface RegisterWebuiInstanceDeps {
|
|
|
48
63
|
* is swallowed (the registry is a convenience index, not a source of
|
|
49
64
|
* truth). Caller guards on `projectRoot` being known.
|
|
50
65
|
*/
|
|
51
|
-
export declare function registerWebuiInstance(p: RegisterWebuiInstanceParams, deps?: RegisterWebuiInstanceDeps):
|
|
66
|
+
export declare function registerWebuiInstance(p: RegisterWebuiInstanceParams, deps?: RegisterWebuiInstanceDeps): Promise<boolean>;
|
|
52
67
|
export interface AnnounceWebuiReadyParams {
|
|
53
68
|
/** Surface kind — 'webui' or 'simpleui'. */
|
|
54
69
|
surface: SurfaceKind;
|