@wrongstack/webui-server 0.302.0 → 0.303.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/index.js +630 -308
- package/dist/server/agent-roster-handlers.d.ts +7 -6
- package/dist/server/codemap-cache.d.ts +13 -1
- 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/entry.js +901 -289
- package/dist/server/handlers/worklist-handlers.d.ts +23 -4
- package/dist/server/handlers.js +126 -23
- package/dist/server/kanban-route-protocol.d.ts +1 -1
- package/dist/server/kanban-routes.d.ts +10 -2
- 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 +22 -3
- package/dist/server/session-handlers.d.ts +3 -2
- package/dist/server/standalone-session-identity.d.ts +10 -2
- package/package.json +11 -11
|
@@ -44,18 +44,19 @@ export interface AgentRosterHandlerOptions {
|
|
|
44
44
|
* clients refresh the affected roster card without a manual reload.
|
|
45
45
|
*/
|
|
46
46
|
broadcast?: (msg: WSServerMessage) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Live read of `fleet.learning.autoOptimize`. Optional: without it the
|
|
49
|
+
* status endpoint reports the built-in defaults, which is still the right
|
|
50
|
+
* answer for a host that never overrode them.
|
|
51
|
+
*/
|
|
52
|
+
getAutoOptimizeSettings?: (() => Record<string, unknown> | undefined) | undefined;
|
|
47
53
|
}
|
|
48
54
|
export declare class AgentRosterWSHandler {
|
|
49
55
|
private readonly getProjectRoot;
|
|
50
56
|
private readonly getLlm;
|
|
51
57
|
private readonly broadcast;
|
|
58
|
+
private readonly getAutoOptimizeSettings;
|
|
52
59
|
constructor(opts: AgentRosterHandlerOptions);
|
|
53
|
-
/**
|
|
54
|
-
* Run the consolidation LLM synthesis headlessly and return the cleaned
|
|
55
|
-
* document text. Returns undefined when no LLM is available so the caller
|
|
56
|
-
* can fall back to the instruction-only path.
|
|
57
|
-
*/
|
|
58
|
-
private synthesizeConsolidation;
|
|
59
60
|
/** Handle an incoming client message. Returns a response payload. */
|
|
60
61
|
handleMessage(_ws: WebSocket, type: string, payload: unknown): Promise<WSServerMessage>;
|
|
61
62
|
}
|
|
@@ -3,7 +3,19 @@ export interface CodemapCacheEntry {
|
|
|
3
3
|
/** Pre-serialized JSON body — avoids re-stringify on cache hits. */
|
|
4
4
|
body: string;
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Filesystem fingerprint of the index DB used as the cache generation key.
|
|
8
|
+
*
|
|
9
|
+
* The index uses WAL mode (`PRAGMA journal_mode = WAL`), so indexer writes land
|
|
10
|
+
* in `index.db-wal` and only move into `index.db` on a checkpoint. Fingerprinting
|
|
11
|
+
* `index.db` alone returns the same mtime/size across an entire indexing run,
|
|
12
|
+
* which makes a stale empty-graph response cached before the first successful
|
|
13
|
+
* index look like a permanent cache hit — the CodeMap canvas shows
|
|
14
|
+
* "No indexed nodes at this level" indefinitely.
|
|
15
|
+
*
|
|
16
|
+
* Including the WAL file's mtime/size (and falling back gracefully when no WAL
|
|
17
|
+
* exists yet) ensures the fingerprint changes as soon as the indexer writes.
|
|
18
|
+
*/
|
|
7
19
|
export declare function indexDbVersion(projectRoot: string, indexDir?: string): string;
|
|
8
20
|
export declare function codemapCacheKey(projectRoot: string, indexDir: string | undefined, scope: string): string;
|
|
9
21
|
export declare function getCachedCodemapBody(key: string, version: string): string | undefined;
|
|
@@ -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
|
}
|