@pellux/goodvibes-daemon-sdk 0.30.3 → 0.33.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.
- package/README.md +2 -2
- package/dist/api-router.d.ts +4 -2
- package/dist/api-router.d.ts.map +1 -1
- package/dist/api-router.js +18 -10
- package/dist/artifact-upload.d.ts +9 -9
- package/dist/artifact-upload.d.ts.map +1 -1
- package/dist/artifact-upload.js +27 -19
- package/dist/auth-helpers.d.ts +9 -0
- package/dist/auth-helpers.d.ts.map +1 -0
- package/dist/auth-helpers.js +10 -0
- package/dist/automation.js +10 -10
- package/dist/channel-route-types.d.ts +22 -23
- package/dist/channel-route-types.d.ts.map +1 -1
- package/dist/channel-routes.d.ts.map +1 -1
- package/dist/channel-routes.js +37 -42
- package/dist/context.d.ts +27 -27
- package/dist/context.d.ts.map +1 -1
- package/dist/control-routes.d.ts +12 -13
- package/dist/control-routes.d.ts.map +1 -1
- package/dist/control-routes.js +55 -26
- package/dist/error-response.d.ts +10 -3
- package/dist/error-response.d.ts.map +1 -1
- package/dist/error-response.js +102 -11
- package/dist/http-policy.d.ts +3 -4
- package/dist/http-policy.d.ts.map +1 -1
- package/dist/http-policy.js +2 -1
- package/dist/index.d.ts +11 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/integration-routes.d.ts +1 -1
- package/dist/integration-routes.d.ts.map +1 -1
- package/dist/integration-routes.js +72 -33
- package/dist/knowledge-refinement-routes.d.ts.map +1 -1
- package/dist/knowledge-refinement-routes.js +22 -15
- package/dist/knowledge-route-types.d.ts +16 -15
- package/dist/knowledge-route-types.d.ts.map +1 -1
- package/dist/knowledge-routes.d.ts.map +1 -1
- package/dist/knowledge-routes.js +144 -89
- package/dist/media-route-types.d.ts +2 -1
- package/dist/media-route-types.d.ts.map +1 -1
- package/dist/media-routes.d.ts.map +1 -1
- package/dist/media-routes.js +119 -55
- package/dist/operator.d.ts +16 -0
- package/dist/operator.d.ts.map +1 -1
- package/dist/operator.js +105 -61
- package/dist/otlp-protobuf.d.ts.map +1 -1
- package/dist/otlp-protobuf.js +28 -10
- package/dist/remote-routes.d.ts +9 -3
- package/dist/remote-routes.d.ts.map +1 -1
- package/dist/remote-routes.js +259 -163
- package/dist/route-helpers.d.ts +13 -2
- package/dist/route-helpers.d.ts.map +1 -1
- package/dist/route-helpers.js +38 -1
- package/dist/runtime-automation-routes.d.ts.map +1 -1
- package/dist/runtime-automation-routes.js +88 -54
- package/dist/runtime-route-types.d.ts +87 -93
- package/dist/runtime-route-types.d.ts.map +1 -1
- package/dist/runtime-session-routes.d.ts +6 -4
- package/dist/runtime-session-routes.d.ts.map +1 -1
- package/dist/runtime-session-routes.js +132 -88
- package/dist/sessions.js +3 -3
- package/dist/system-route-types.d.ts +25 -24
- package/dist/system-route-types.d.ts.map +1 -1
- package/dist/system-routes.d.ts +1 -1
- package/dist/system-routes.d.ts.map +1 -1
- package/dist/system-routes.js +126 -92
- package/dist/tasks.d.ts.map +1 -1
- package/dist/tasks.js +2 -0
- package/dist/telemetry-routes.d.ts +14 -14
- package/dist/telemetry-routes.d.ts.map +1 -1
- package/dist/telemetry-routes.js +54 -29
- package/package.json +5 -4
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { DaemonRuntimeSessionRouteHandlers, DaemonRuntimeTaskRouteHandlers } from './context.js';
|
|
2
|
-
import type { DaemonRuntimeRouteContext
|
|
2
|
+
import type { DaemonRuntimeRouteContext } from './runtime-route-types.js';
|
|
3
|
+
import { type JsonRecord } from './route-helpers.js';
|
|
3
4
|
export declare function createDaemonRuntimeSessionRouteHandlers(context: DaemonRuntimeRouteContext): DaemonRuntimeSessionRouteHandlers & DaemonRuntimeTaskRouteHandlers;
|
|
4
5
|
/**
|
|
5
6
|
* Extract the message body from an incoming POST body.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* Accepts the canonical `body` field from the request envelope.
|
|
9
|
+
* Returns an empty string when the field is absent or not a string; the
|
|
10
|
+
* caller must check for an empty result and return 400.
|
|
9
11
|
*
|
|
10
12
|
* @param body - Parsed JSON body from the request.
|
|
11
13
|
* @returns Trimmed message string, or '' if none of the accepted fields are present.
|
|
12
14
|
*/
|
|
13
|
-
export declare function readSharedSessionMessageBody(body:
|
|
15
|
+
export declare function readSharedSessionMessageBody(body: JsonRecord): string;
|
|
14
16
|
//# sourceMappingURL=runtime-session-routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-session-routes.d.ts","sourceRoot":"","sources":["../src/runtime-session-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime-session-routes.d.ts","sourceRoot":"","sources":["../src/runtime-session-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAItG,OAAO,KAAK,EAEV,yBAAyB,EAG1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAqB5B,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,yBAAyB,GACjC,iCAAiC,GAAG,8BAA8B,CAkBpE;AA2XD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAErE"}
|
|
@@ -1,29 +1,49 @@
|
|
|
1
|
+
import { withAdmin } from './auth-helpers.js';
|
|
1
2
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import {
|
|
3
|
+
import { jsonErrorResponse } from './error-response.js';
|
|
4
|
+
import { createRouteBodySchema, createRouteBodySchemaRegistry, readBoundedPositiveInteger, readOptionalStringField, readStringArrayField, } from './route-helpers.js';
|
|
3
5
|
const DEFAULT_LIST_LIMIT = 100;
|
|
4
6
|
const MAX_LIST_LIMIT = 500;
|
|
7
|
+
const MAX_SESSION_TOOL_NAMES = 64;
|
|
5
8
|
function readBoundedLimit(url, key = 'limit') {
|
|
6
9
|
return readBoundedPositiveInteger(url.searchParams.get(key), DEFAULT_LIST_LIMIT, MAX_LIST_LIMIT);
|
|
7
10
|
}
|
|
8
11
|
export function createDaemonRuntimeSessionRouteHandlers(context) {
|
|
9
12
|
return {
|
|
10
|
-
createSharedSession: async (request) => handleCreateSharedSession(context, request),
|
|
11
|
-
postTask: async (request) => handlePostTask(context, request),
|
|
13
|
+
createSharedSession: async (request) => withAdmin(context, request, () => handleCreateSharedSession(context, request)),
|
|
14
|
+
postTask: async (request) => withAdmin(context, request, () => handlePostTask(context, request)),
|
|
12
15
|
getSharedSession: async (sessionId) => handleGetSharedSession(context, sessionId),
|
|
13
|
-
closeSharedSession: (sessionId) => handleSharedSessionLifecycle(context, sessionId, 'close'),
|
|
14
|
-
reopenSharedSession: (sessionId) => handleSharedSessionLifecycle(context, sessionId, 'reopen'),
|
|
16
|
+
closeSharedSession: (sessionId, request) => withAdmin(context, request, () => handleSharedSessionLifecycle(context, sessionId, 'close')),
|
|
17
|
+
reopenSharedSession: (sessionId, request) => withAdmin(context, request, () => handleSharedSessionLifecycle(context, sessionId, 'reopen')),
|
|
15
18
|
getSharedSessionMessages: async (sessionId, url) => handleGetSharedSessionMessages(context, sessionId, url),
|
|
16
19
|
getSharedSessionInputs: async (sessionId, url) => handleGetSharedSessionInputs(context, sessionId, url),
|
|
17
|
-
postSharedSessionMessage: (sessionId, request) => handlePostSharedSessionMessage(context, sessionId, request),
|
|
18
|
-
postSharedSessionSteer: (sessionId, request) => handlePostSharedSessionSteer(context, sessionId, request),
|
|
19
|
-
postSharedSessionFollowUp: (sessionId, request) => handlePostSharedSessionFollowUp(context, sessionId, request),
|
|
20
|
-
cancelSharedSessionInput: (sessionId, inputId) => handleCancelSharedSessionInput(context, sessionId, inputId),
|
|
20
|
+
postSharedSessionMessage: (sessionId, request) => withAdmin(context, request, () => handlePostSharedSessionMessage(context, sessionId, request)),
|
|
21
|
+
postSharedSessionSteer: (sessionId, request) => withAdmin(context, request, () => handlePostSharedSessionSteer(context, sessionId, request)),
|
|
22
|
+
postSharedSessionFollowUp: (sessionId, request) => withAdmin(context, request, () => handlePostSharedSessionFollowUp(context, sessionId, request)),
|
|
23
|
+
cancelSharedSessionInput: (sessionId, inputId, request) => withAdmin(context, request, () => handleCancelSharedSessionInput(context, sessionId, inputId)),
|
|
21
24
|
getRuntimeTask: (taskId) => handleGetRuntimeTask(context, taskId),
|
|
22
|
-
runtimeTaskAction: (taskId, action, request) => handleRuntimeTaskAction(context, taskId, action, request),
|
|
25
|
+
runtimeTaskAction: (taskId, action, request) => withAdmin(context, request, () => handleRuntimeTaskAction(context, taskId, action, request)),
|
|
23
26
|
getTaskStatus: (agentId) => handleGetTaskStatus(context, agentId),
|
|
24
|
-
getSharedSessionEvents: (sessionId, request) => handleGetSharedSessionEvents(context, sessionId, request),
|
|
27
|
+
getSharedSessionEvents: (sessionId, request) => withAdmin(context, request, () => handleGetSharedSessionEvents(context, sessionId, request)),
|
|
25
28
|
};
|
|
26
29
|
}
|
|
30
|
+
const runtimeSessionBodySchemas = createRouteBodySchemaRegistry({
|
|
31
|
+
task: createRouteBodySchema('POST /task', (body) => {
|
|
32
|
+
const task = readOptionalStringField(body, 'task');
|
|
33
|
+
if (!task) {
|
|
34
|
+
return jsonErrorResponse({ error: 'Missing required field: task (non-empty string)' }, { status: 400 });
|
|
35
|
+
}
|
|
36
|
+
const routing = readSharedSessionRoutingIntent(body.routing);
|
|
37
|
+
const model = readOptionalStringField(body, 'model');
|
|
38
|
+
const tools = readStringArrayField(body, 'tools', MAX_SESSION_TOOL_NAMES);
|
|
39
|
+
return {
|
|
40
|
+
task,
|
|
41
|
+
...(model ? { model } : {}),
|
|
42
|
+
...(tools ? { tools } : {}),
|
|
43
|
+
...(routing ? { routing } : {}),
|
|
44
|
+
};
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
27
47
|
async function handleCreateSharedSession(context, req) {
|
|
28
48
|
const body = await context.parseJsonBody(req);
|
|
29
49
|
if (body instanceof Response)
|
|
@@ -56,12 +76,9 @@ async function handlePostTask(context, req) {
|
|
|
56
76
|
const body = await context.parseJsonBody(req);
|
|
57
77
|
if (body instanceof Response)
|
|
58
78
|
return body;
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
const model = typeof body.model === 'string' ? body.model : undefined;
|
|
64
|
-
const tools = Array.isArray(body.tools) ? body.tools.filter((t) => typeof t === 'string') : undefined;
|
|
79
|
+
const input = runtimeSessionBodySchemas.task.parse(body);
|
|
80
|
+
if (input instanceof Response)
|
|
81
|
+
return input;
|
|
65
82
|
const wantsSharedSession = typeof body.sessionId === 'string' || typeof body.routeId === 'string' || typeof body.surfaceKind === 'string';
|
|
66
83
|
if (wantsSharedSession) {
|
|
67
84
|
const submission = await context.sessionBroker.submitMessage({
|
|
@@ -74,9 +91,9 @@ async function handlePostTask(context, req) {
|
|
|
74
91
|
userId: typeof body.userId === 'string' ? body.userId : undefined,
|
|
75
92
|
displayName: typeof body.displayName === 'string' ? body.displayName : undefined,
|
|
76
93
|
title: typeof body.title === 'string' ? body.title : undefined,
|
|
77
|
-
body: task
|
|
94
|
+
body: input.task,
|
|
78
95
|
metadata: typeof body.metadata === 'object' && body.metadata !== null ? body.metadata : {},
|
|
79
|
-
...(
|
|
96
|
+
...(input.routing ? { routing: input.routing } : {}),
|
|
80
97
|
});
|
|
81
98
|
if (submission.mode === 'continued-live') {
|
|
82
99
|
return context.recordApiResponse(req, '/task', Response.json({
|
|
@@ -107,8 +124,8 @@ async function handlePostTask(context, req) {
|
|
|
107
124
|
const sessionSpawn = context.trySpawnAgent({
|
|
108
125
|
mode: 'spawn',
|
|
109
126
|
task: submission.task,
|
|
110
|
-
...(model !== undefined || submission.input.routing?.modelId ? { model: model ?? submission.input.routing?.modelId } : {}),
|
|
111
|
-
...(tools !== undefined || submission.input.routing?.tools ? { tools: tools ?? [...(submission.input.routing?.tools ?? [])] } : {}),
|
|
127
|
+
...(input.model !== undefined || submission.input.routing?.modelId ? { model: input.model ?? submission.input.routing?.modelId } : {}),
|
|
128
|
+
...(input.tools !== undefined || submission.input.routing?.tools ? { tools: input.tools ?? [...(submission.input.routing?.tools ?? []).slice(0, MAX_SESSION_TOOL_NAMES)] } : {}),
|
|
112
129
|
...(submission.input.routing?.providerId ? { provider: submission.input.routing.providerId } : {}),
|
|
113
130
|
...(submission.input.routing?.executionIntent ? { executionIntent: submission.input.routing.executionIntent } : {}),
|
|
114
131
|
}, 'DaemonServer.handlePostTask.sharedSession', submission.session.id);
|
|
@@ -117,7 +134,7 @@ async function handlePostTask(context, req) {
|
|
|
117
134
|
await context.sessionBroker.bindAgent(submission.session.id, sessionSpawn.id);
|
|
118
135
|
context.queueSurfaceReplyFromBinding(submission.routeBinding, {
|
|
119
136
|
agentId: sessionSpawn.id,
|
|
120
|
-
task,
|
|
137
|
+
task: input.task,
|
|
121
138
|
sessionId: submission.session.id,
|
|
122
139
|
});
|
|
123
140
|
return context.recordApiResponse(req, '/task', Response.json({
|
|
@@ -130,9 +147,9 @@ async function handlePostTask(context, req) {
|
|
|
130
147
|
}
|
|
131
148
|
const spawnResult = context.trySpawnAgent({
|
|
132
149
|
mode: 'spawn',
|
|
133
|
-
task,
|
|
134
|
-
...(model !== undefined && { model }),
|
|
135
|
-
...(tools !== undefined && { tools }),
|
|
150
|
+
task: input.task,
|
|
151
|
+
...(input.model !== undefined && { model: input.model }),
|
|
152
|
+
...(input.tools !== undefined && { tools: input.tools }),
|
|
136
153
|
...(typeof body.routing === 'object'
|
|
137
154
|
&& body.routing !== null
|
|
138
155
|
&& typeof body.routing.executionIntent === 'object'
|
|
@@ -157,7 +174,7 @@ async function handleGetSharedSession(context, sessionId) {
|
|
|
157
174
|
await context.sessionBroker.start();
|
|
158
175
|
const session = context.sessionBroker.getSession(sessionId);
|
|
159
176
|
if (!session) {
|
|
160
|
-
return
|
|
177
|
+
return jsonErrorResponse({ error: 'Unknown shared session' }, { status: 404 });
|
|
161
178
|
}
|
|
162
179
|
return Response.json({
|
|
163
180
|
session,
|
|
@@ -171,13 +188,13 @@ async function handleSharedSessionLifecycle(context, sessionId, action) {
|
|
|
171
188
|
: await context.sessionBroker.reopenSession(sessionId);
|
|
172
189
|
return session
|
|
173
190
|
? Response.json({ session })
|
|
174
|
-
:
|
|
191
|
+
: jsonErrorResponse({ error: 'Unknown shared session' }, { status: 404 });
|
|
175
192
|
}
|
|
176
193
|
async function handleGetSharedSessionMessages(context, sessionId, url) {
|
|
177
194
|
await context.sessionBroker.start();
|
|
178
195
|
const session = context.sessionBroker.getSession(sessionId);
|
|
179
196
|
if (!session) {
|
|
180
|
-
return
|
|
197
|
+
return jsonErrorResponse({ error: 'Unknown shared session' }, { status: 404 });
|
|
181
198
|
}
|
|
182
199
|
const limit = readBoundedLimit(url);
|
|
183
200
|
return Response.json({
|
|
@@ -189,7 +206,7 @@ async function handleGetSharedSessionInputs(context, sessionId, url) {
|
|
|
189
206
|
await context.sessionBroker.start();
|
|
190
207
|
const session = context.sessionBroker.getSession(sessionId);
|
|
191
208
|
if (!session) {
|
|
192
|
-
return
|
|
209
|
+
return jsonErrorResponse({ error: 'Unknown shared session' }, { status: 404 });
|
|
193
210
|
}
|
|
194
211
|
const limit = readBoundedLimit(url);
|
|
195
212
|
return Response.json({
|
|
@@ -210,11 +227,11 @@ async function handlePostSharedSessionMessage(context, sessionId, req) {
|
|
|
210
227
|
// routing; callers must explicitly opt into kind='task' for agent/WRFC work.
|
|
211
228
|
const kind = body.kind === undefined ? 'message' : body.kind;
|
|
212
229
|
if (kind !== 'task' && kind !== 'message' && kind !== 'followup') {
|
|
213
|
-
return
|
|
230
|
+
return jsonErrorResponse({ error: `Invalid kind '${String(kind)}'. Accepted values: 'task' | 'message' | 'followup'`, code: 'INVALID_KIND' }, { status: 400 });
|
|
214
231
|
}
|
|
215
232
|
const message = readSharedSessionMessageBody(body);
|
|
216
233
|
if (!message) {
|
|
217
|
-
return
|
|
234
|
+
return jsonErrorResponse({ error: 'Missing shared session message body' }, { status: 400 });
|
|
218
235
|
}
|
|
219
236
|
// kind='followup' — always queues/spawns a follow-up turn via followUpMessage()
|
|
220
237
|
if (kind === 'followup') {
|
|
@@ -223,55 +240,57 @@ async function handlePostSharedSessionMessage(context, sessionId, req) {
|
|
|
223
240
|
context: `shared-session:${followUpSubmission.session.id}`,
|
|
224
241
|
});
|
|
225
242
|
}
|
|
226
|
-
// kind='message' — companion main-chat send.
|
|
227
|
-
//
|
|
228
|
-
// orchestrator.handleUserInput() which fires a real LLM turn (same entry as TUI input
|
|
229
|
-
// box). Turn events stream to both TUI and companion over SSE automatically.
|
|
230
|
-
// Deliberately short-circuits BEFORE sessionBroker.submitMessage() to avoid the
|
|
231
|
-
// buildContinuationTask WRFC engineer-chain spawn path.
|
|
243
|
+
// kind='message' — companion main-chat send. Delegates to dedicated handler to avoid
|
|
244
|
+
// inline duplication of session-resolution with submitMessage().
|
|
232
245
|
if (kind === 'message') {
|
|
233
|
-
|
|
234
|
-
if (!session) {
|
|
235
|
-
return Response.json({ error: 'Unknown shared session', code: 'SESSION_NOT_FOUND' }, { status: 404 });
|
|
236
|
-
}
|
|
237
|
-
if (session.status === 'closed') {
|
|
238
|
-
return Response.json({ error: 'Session is closed', code: 'SESSION_CLOSED' }, { status: 409 });
|
|
239
|
-
}
|
|
240
|
-
const messageId = randomUUID();
|
|
241
|
-
const timestamp = Date.now();
|
|
242
|
-
// Persist the companion message to the session log so GET /api/sessions/:id/messages
|
|
243
|
-
// returns it and the TUI can render it.
|
|
244
|
-
await context.sessionBroker.appendCompanionMessage(sessionId, {
|
|
245
|
-
messageId,
|
|
246
|
-
body: message,
|
|
247
|
-
source: 'companion-followup',
|
|
248
|
-
timestamp,
|
|
249
|
-
});
|
|
250
|
-
// Also notify the TUI's in-process subscriber via the conversation follow-up event.
|
|
251
|
-
context.publishConversationFollowup(sessionId, {
|
|
252
|
-
messageId,
|
|
253
|
-
body: message,
|
|
254
|
-
source: 'companion-followup',
|
|
255
|
-
timestamp,
|
|
256
|
-
});
|
|
257
|
-
// Return immediately. appendCompanionMessage persists the message and
|
|
258
|
-
// publishConversationFollowup emits COMPANION_MESSAGE_RECEIVED on the runtime bus.
|
|
259
|
-
// The TUI's bootstrap-core.ts COMPANION_MESSAGE_RECEIVED subscriber delegates to
|
|
260
|
-
// orchestrator.handleUserInput(), which adds the user message to the conversation
|
|
261
|
-
// view and fires a real LLM turn whose events stream to both TUI and companion SSE.
|
|
262
|
-
// The { routedTo: 'conversation' } shape signals the companion app that the message
|
|
263
|
-
// was received and persisted (isConversationRouteResult check).
|
|
264
|
-
return context.recordApiResponse(req, `/api/sessions/${sessionId}/messages`, Response.json({
|
|
265
|
-
messageId,
|
|
266
|
-
routedTo: 'conversation',
|
|
267
|
-
sessionId,
|
|
268
|
-
}, { status: 202 }));
|
|
246
|
+
return handleCompanionMessageKind(context, sessionId, req, message);
|
|
269
247
|
}
|
|
270
248
|
const submission = await context.sessionBroker.submitMessage(buildSharedSessionMessageInput(sessionId, body, message));
|
|
271
249
|
return await respondToSessionSubmission(context, req, submission, message, `/api/sessions/${sessionId}/messages`, 'DaemonServer.handlePostSharedSessionMessage', {
|
|
272
250
|
context: `shared-session:${submission.session.id}`,
|
|
273
251
|
});
|
|
274
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* Handles kind='message' companion main-chat messages.
|
|
255
|
+
*
|
|
256
|
+
* Short-circuits before sessionBroker.submitMessage() so conversation messages
|
|
257
|
+
* are routed to the existing session instead of spawning continuation work.
|
|
258
|
+
*/
|
|
259
|
+
async function handleCompanionMessageKind(context, sessionId, req, message) {
|
|
260
|
+
const session = context.sessionBroker.getSession(sessionId);
|
|
261
|
+
if (!session) {
|
|
262
|
+
return jsonErrorResponse({ error: 'Unknown shared session', code: 'SESSION_NOT_FOUND' }, { status: 404 });
|
|
263
|
+
}
|
|
264
|
+
if (session.status === 'closed') {
|
|
265
|
+
return jsonErrorResponse({ error: 'Session is closed', code: 'SESSION_CLOSED' }, { status: 409 });
|
|
266
|
+
}
|
|
267
|
+
const messageId = `companion-${randomUUID()}`;
|
|
268
|
+
const timestamp = Date.now();
|
|
269
|
+
// Persist the companion message to the session log so GET /api/sessions/:id/messages
|
|
270
|
+
// returns it and the TUI can render it.
|
|
271
|
+
await context.sessionBroker.appendCompanionMessage(sessionId, {
|
|
272
|
+
messageId,
|
|
273
|
+
body: message,
|
|
274
|
+
source: 'companion-followup',
|
|
275
|
+
timestamp,
|
|
276
|
+
});
|
|
277
|
+
// Notify in-process subscribers via the conversation follow-up event. The
|
|
278
|
+
// runtime subscriber turns this persisted message into a normal conversation
|
|
279
|
+
// turn whose events stream to both local and remote clients.
|
|
280
|
+
context.publishConversationFollowup(sessionId, {
|
|
281
|
+
messageId,
|
|
282
|
+
body: message,
|
|
283
|
+
source: 'companion-followup',
|
|
284
|
+
timestamp,
|
|
285
|
+
});
|
|
286
|
+
// The { routedTo: 'conversation' } shape signals the companion app that the message
|
|
287
|
+
// was received and persisted (isConversationRouteResult check).
|
|
288
|
+
return context.recordApiResponse(req, `/api/sessions/${sessionId}/messages`, Response.json({
|
|
289
|
+
messageId,
|
|
290
|
+
routedTo: 'conversation',
|
|
291
|
+
sessionId,
|
|
292
|
+
}, { status: 202 }));
|
|
293
|
+
}
|
|
275
294
|
/**
|
|
276
295
|
* Handle GET /api/sessions/:id/events — creates a session-scoped SSE stream
|
|
277
296
|
* for the companion app to receive turn events (STREAM_DELTA, TURN_COMPLETED,
|
|
@@ -281,8 +300,10 @@ async function handleGetSharedSessionEvents(context, sessionId, req) {
|
|
|
281
300
|
await context.sessionBroker.start();
|
|
282
301
|
const session = context.sessionBroker.getSession(sessionId);
|
|
283
302
|
if (!session) {
|
|
284
|
-
return
|
|
303
|
+
return jsonErrorResponse({ error: 'Unknown shared session', code: 'SESSION_NOT_FOUND' }, { status: 404 });
|
|
285
304
|
}
|
|
305
|
+
// Stream lifetime is tied to the request connection; cleanup happens when
|
|
306
|
+
// the response body closes.
|
|
286
307
|
return context.openSessionEventStream(req, sessionId);
|
|
287
308
|
}
|
|
288
309
|
async function handlePostSharedSessionSteer(context, sessionId, req) {
|
|
@@ -291,7 +312,7 @@ async function handlePostSharedSessionSteer(context, sessionId, req) {
|
|
|
291
312
|
return body;
|
|
292
313
|
const message = readSharedSessionMessageBody(body);
|
|
293
314
|
if (!message) {
|
|
294
|
-
return
|
|
315
|
+
return jsonErrorResponse({ error: 'Missing shared session steer body' }, { status: 400 });
|
|
295
316
|
}
|
|
296
317
|
const submission = await context.sessionBroker.steerMessage({
|
|
297
318
|
...buildSharedSessionMessageInput(sessionId, body, message),
|
|
@@ -307,7 +328,7 @@ async function handlePostSharedSessionFollowUp(context, sessionId, req) {
|
|
|
307
328
|
return body;
|
|
308
329
|
const message = readSharedSessionMessageBody(body);
|
|
309
330
|
if (!message) {
|
|
310
|
-
return
|
|
331
|
+
return jsonErrorResponse({ error: 'Missing shared session follow-up body' }, { status: 400 });
|
|
311
332
|
}
|
|
312
333
|
const submission = await context.sessionBroker.followUpMessage(buildSharedSessionMessageInput(sessionId, body, message));
|
|
313
334
|
return await respondToSessionSubmission(context, req, submission, message, `/api/sessions/${sessionId}/follow-up`, 'DaemonServer.handlePostSharedSessionFollowUp', {
|
|
@@ -318,12 +339,15 @@ async function handleCancelSharedSessionInput(context, sessionId, inputId) {
|
|
|
318
339
|
await context.sessionBroker.start();
|
|
319
340
|
const input = await context.sessionBroker.cancelInput(sessionId, inputId);
|
|
320
341
|
if (!input) {
|
|
321
|
-
return
|
|
342
|
+
return jsonErrorResponse({ error: 'Unknown shared session input' }, { status: 404 });
|
|
322
343
|
}
|
|
323
|
-
//
|
|
324
|
-
//
|
|
344
|
+
// cancelInput returns the entry unchanged when state is not 'queued'. Return
|
|
345
|
+
// 409 so callers know the cancel was a no-op, e.g. already spawned.
|
|
325
346
|
const inputRecord = input;
|
|
326
347
|
if (inputRecord.state !== 'queued' && inputRecord.state !== 'cancelled') {
|
|
348
|
+
// Use Response.json directly so the `input` field is preserved in the
|
|
349
|
+
// response body. jsonErrorResponse strips unknown fields via its structured
|
|
350
|
+
// error serializer, which would remove `input`.
|
|
327
351
|
return Response.json({ error: `Cannot cancel input in state '${inputRecord.state}'`, code: 'CANCEL_NOT_ALLOWED', input }, { status: 409 });
|
|
328
352
|
}
|
|
329
353
|
return Response.json({ input });
|
|
@@ -331,15 +355,16 @@ async function handleCancelSharedSessionInput(context, sessionId, inputId) {
|
|
|
331
355
|
function handleGetRuntimeTask(context, taskId) {
|
|
332
356
|
const task = context.runtimeStore?.getState().tasks.tasks.get(taskId);
|
|
333
357
|
if (!task) {
|
|
334
|
-
return
|
|
358
|
+
return jsonErrorResponse({ error: 'Unknown runtime task' }, { status: 404 });
|
|
335
359
|
}
|
|
336
360
|
return Response.json({ task });
|
|
337
361
|
}
|
|
338
362
|
/**
|
|
339
363
|
* Extract the message body from an incoming POST body.
|
|
340
364
|
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
365
|
+
* Accepts the canonical `body` field from the request envelope.
|
|
366
|
+
* Returns an empty string when the field is absent or not a string; the
|
|
367
|
+
* caller must check for an empty result and return 400.
|
|
343
368
|
*
|
|
344
369
|
* @param body - Parsed JSON body from the request.
|
|
345
370
|
* @returns Trimmed message string, or '' if none of the accepted fields are present.
|
|
@@ -348,6 +373,7 @@ export function readSharedSessionMessageBody(body) {
|
|
|
348
373
|
return typeof body.body === 'string' ? body.body.trim() : '';
|
|
349
374
|
}
|
|
350
375
|
function buildSharedSessionMessageInput(sessionId, body, message) {
|
|
376
|
+
const routing = readSharedSessionRoutingIntent(body.routing);
|
|
351
377
|
return {
|
|
352
378
|
sessionId,
|
|
353
379
|
surfaceKind: typeof body.surfaceKind === 'string' ? body.surfaceKind : 'web',
|
|
@@ -360,7 +386,25 @@ function buildSharedSessionMessageInput(sessionId, body, message) {
|
|
|
360
386
|
...(typeof body.routeId === 'string' ? { routeId: body.routeId } : {}),
|
|
361
387
|
body: message,
|
|
362
388
|
...(typeof body.metadata === 'object' && body.metadata !== null ? { metadata: body.metadata } : {}),
|
|
363
|
-
...(
|
|
389
|
+
...(routing ? { routing } : {}),
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function readToolNames(value) {
|
|
393
|
+
if (!Array.isArray(value))
|
|
394
|
+
return undefined;
|
|
395
|
+
const tools = value.filter((entry) => typeof entry === 'string' && entry.trim() !== '').slice(0, MAX_SESSION_TOOL_NAMES);
|
|
396
|
+
return tools.length > 0 ? tools : undefined;
|
|
397
|
+
}
|
|
398
|
+
function readSharedSessionRoutingIntent(value) {
|
|
399
|
+
if (typeof value !== 'object' || value === null)
|
|
400
|
+
return undefined;
|
|
401
|
+
const input = value;
|
|
402
|
+
const tools = readToolNames(input.tools);
|
|
403
|
+
return {
|
|
404
|
+
...(typeof input.modelId === 'string' ? { modelId: input.modelId } : {}),
|
|
405
|
+
...(typeof input.providerId === 'string' ? { providerId: input.providerId } : {}),
|
|
406
|
+
...(tools ? { tools } : {}),
|
|
407
|
+
...(input.executionIntent !== undefined ? { executionIntent: input.executionIntent } : {}),
|
|
364
408
|
};
|
|
365
409
|
}
|
|
366
410
|
async function respondToSessionSubmission(context, req, submission, taskText, path, logLabel, spawnOptions = {}) {
|
|
@@ -414,11 +458,11 @@ async function respondToSessionSubmission(context, req, submission, taskText, pa
|
|
|
414
458
|
}
|
|
415
459
|
function handleRuntimeTaskAction(context, taskId, action, _req) {
|
|
416
460
|
if (!context.runtimeStore || !context.runtimeDispatch) {
|
|
417
|
-
return
|
|
461
|
+
return jsonErrorResponse({ error: 'Runtime store unavailable' }, { status: 503 });
|
|
418
462
|
}
|
|
419
463
|
const task = context.runtimeStore.getState().tasks.tasks.get(taskId);
|
|
420
464
|
if (!task) {
|
|
421
|
-
return
|
|
465
|
+
return jsonErrorResponse({ error: 'Unknown runtime task' }, { status: 404 });
|
|
422
466
|
}
|
|
423
467
|
if (action === 'cancel') {
|
|
424
468
|
if (task.kind === 'agent' && task.owner) {
|
|
@@ -432,7 +476,7 @@ function handleRuntimeTaskAction(context, taskId, action, _req) {
|
|
|
432
476
|
}
|
|
433
477
|
if (action === 'retry') {
|
|
434
478
|
if (task.kind !== 'agent') {
|
|
435
|
-
return
|
|
479
|
+
return jsonErrorResponse({ error: 'Retry is only implemented for agent tasks' }, { status: 400 });
|
|
436
480
|
}
|
|
437
481
|
const spawnResult = context.trySpawnAgent({
|
|
438
482
|
mode: 'spawn',
|
|
@@ -452,12 +496,12 @@ function handleRuntimeTaskAction(context, taskId, action, _req) {
|
|
|
452
496
|
agentId: spawnResult.id,
|
|
453
497
|
});
|
|
454
498
|
}
|
|
455
|
-
return
|
|
499
|
+
return jsonErrorResponse({ error: 'Unsupported task action' }, { status: 400 });
|
|
456
500
|
}
|
|
457
501
|
function handleGetTaskStatus(context, agentId) {
|
|
458
502
|
const record = context.agentManager.getStatus(agentId);
|
|
459
503
|
if (!record) {
|
|
460
|
-
return
|
|
504
|
+
return jsonErrorResponse({ error: `Agent not found: ${agentId}` }, { status: 404 });
|
|
461
505
|
}
|
|
462
506
|
if (record.status === 'completed' || record.status === 'failed' || record.status === 'cancelled') {
|
|
463
507
|
context.syncFinishedAgentTask(record);
|
package/dist/sessions.js
CHANGED
|
@@ -12,8 +12,8 @@ export async function dispatchSessionRoutes(req, handlers) {
|
|
|
12
12
|
const sharedSessionCloseMatch = pathname.match(/^\/api\/sessions\/([^/]+)\/(close|reopen)$/);
|
|
13
13
|
if (sharedSessionCloseMatch && method === 'POST') {
|
|
14
14
|
return sharedSessionCloseMatch[2] === 'close'
|
|
15
|
-
? handlers.closeSharedSession(sharedSessionCloseMatch[1])
|
|
16
|
-
: handlers.reopenSharedSession(sharedSessionCloseMatch[1]);
|
|
15
|
+
? handlers.closeSharedSession(sharedSessionCloseMatch[1], req)
|
|
16
|
+
: handlers.reopenSharedSession(sharedSessionCloseMatch[1], req);
|
|
17
17
|
}
|
|
18
18
|
const sharedSessionMessagesMatch = pathname.match(/^\/api\/sessions\/([^/]+)\/messages$/);
|
|
19
19
|
if (sharedSessionMessagesMatch && method === 'GET')
|
|
@@ -31,7 +31,7 @@ export async function dispatchSessionRoutes(req, handlers) {
|
|
|
31
31
|
return handlers.postSharedSessionFollowUp(sharedSessionFollowUpMatch[1], req);
|
|
32
32
|
const sharedSessionCancelInputMatch = pathname.match(/^\/api\/sessions\/([^/]+)\/inputs\/([^/]+)\/cancel$/);
|
|
33
33
|
if (sharedSessionCancelInputMatch && method === 'POST') {
|
|
34
|
-
return handlers.cancelSharedSessionInput(sharedSessionCancelInputMatch[1], sharedSessionCancelInputMatch[2]);
|
|
34
|
+
return handlers.cancelSharedSessionInput(sharedSessionCancelInputMatch[1], sharedSessionCancelInputMatch[2], req);
|
|
35
35
|
}
|
|
36
36
|
const sharedSessionEventsMatch = pathname.match(/^\/api\/sessions\/([^/]+)\/events$/);
|
|
37
37
|
if (sharedSessionEventsMatch && method === 'GET')
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { JsonRecord } from './route-helpers.js';
|
|
2
|
+
import type { AutomationSurfaceKind } from './runtime-route-types.js';
|
|
3
|
+
export type { AutomationSurfaceKind };
|
|
2
4
|
export type DaemonApiClientKind = 'web' | 'slack' | 'discord' | 'ntfy' | 'webhook' | 'telegram' | 'google-chat' | 'signal' | 'whatsapp' | 'imessage' | 'msteams' | 'bluebubbles' | 'mattermost' | 'matrix' | 'daemon';
|
|
3
5
|
export type AutomationRouteBindingKind = string;
|
|
4
|
-
export type AutomationSurfaceKind = string;
|
|
5
6
|
export type AutomationSessionPolicy = string;
|
|
6
7
|
export type AutomationThreadPolicy = string;
|
|
7
8
|
export type AutomationDeliveryGuarantee = string;
|
|
@@ -23,33 +24,33 @@ export interface PlatformServiceManagerLike {
|
|
|
23
24
|
uninstall(): unknown;
|
|
24
25
|
}
|
|
25
26
|
export interface RouteBindingRecordInput {
|
|
26
|
-
readonly id?: string;
|
|
27
|
+
readonly id?: string | undefined;
|
|
27
28
|
readonly kind: AutomationRouteBindingKind;
|
|
28
29
|
readonly surfaceKind: AutomationSurfaceKind;
|
|
29
30
|
readonly surfaceId: string;
|
|
30
31
|
readonly externalId: string;
|
|
31
|
-
readonly sessionPolicy?: AutomationSessionPolicy;
|
|
32
|
-
readonly threadPolicy?: AutomationThreadPolicy;
|
|
33
|
-
readonly deliveryGuarantee?: AutomationDeliveryGuarantee;
|
|
34
|
-
readonly threadId?: string;
|
|
35
|
-
readonly channelId?: string;
|
|
36
|
-
readonly sessionId?: string | null;
|
|
37
|
-
readonly jobId?: string | null;
|
|
38
|
-
readonly runId?: string | null;
|
|
39
|
-
readonly title?: string;
|
|
32
|
+
readonly sessionPolicy?: AutomationSessionPolicy | undefined;
|
|
33
|
+
readonly threadPolicy?: AutomationThreadPolicy | undefined;
|
|
34
|
+
readonly deliveryGuarantee?: AutomationDeliveryGuarantee | undefined;
|
|
35
|
+
readonly threadId?: string | undefined;
|
|
36
|
+
readonly channelId?: string | undefined;
|
|
37
|
+
readonly sessionId?: string | null | undefined;
|
|
38
|
+
readonly jobId?: string | null | undefined;
|
|
39
|
+
readonly runId?: string | null | undefined;
|
|
40
|
+
readonly title?: string | undefined;
|
|
40
41
|
readonly metadata: Record<string, unknown>;
|
|
41
42
|
}
|
|
42
43
|
export interface RouteBindingPatchInput {
|
|
43
|
-
readonly sessionPolicy?: AutomationSessionPolicy;
|
|
44
|
-
readonly threadPolicy?: AutomationThreadPolicy;
|
|
45
|
-
readonly deliveryGuarantee?: AutomationDeliveryGuarantee;
|
|
46
|
-
readonly threadId?: string;
|
|
47
|
-
readonly channelId?: string;
|
|
48
|
-
readonly sessionId?: string | null;
|
|
49
|
-
readonly jobId?: string | null;
|
|
50
|
-
readonly runId?: string | null;
|
|
51
|
-
readonly title?: string;
|
|
52
|
-
readonly metadata?: Record<string, unknown
|
|
44
|
+
readonly sessionPolicy?: AutomationSessionPolicy | undefined;
|
|
45
|
+
readonly threadPolicy?: AutomationThreadPolicy | undefined;
|
|
46
|
+
readonly deliveryGuarantee?: AutomationDeliveryGuarantee | undefined;
|
|
47
|
+
readonly threadId?: string | undefined;
|
|
48
|
+
readonly channelId?: string | undefined;
|
|
49
|
+
readonly sessionId?: string | null | undefined;
|
|
50
|
+
readonly jobId?: string | null | undefined;
|
|
51
|
+
readonly runId?: string | null | undefined;
|
|
52
|
+
readonly title?: string | undefined;
|
|
53
|
+
readonly metadata?: Record<string, unknown> | undefined;
|
|
53
54
|
}
|
|
54
55
|
export interface RouteBindingManagerLike {
|
|
55
56
|
listBindings(): readonly unknown[];
|
|
@@ -71,7 +72,7 @@ export interface WatcherRecord {
|
|
|
71
72
|
readonly label: string;
|
|
72
73
|
readonly kind: WatcherKind;
|
|
73
74
|
readonly source: WatcherSourceRecord;
|
|
74
|
-
readonly intervalMs?: number;
|
|
75
|
+
readonly intervalMs?: number | undefined;
|
|
75
76
|
readonly metadata: Record<string, unknown>;
|
|
76
77
|
}
|
|
77
78
|
export interface WatcherRegistryLike {
|
|
@@ -84,7 +85,7 @@ export interface WatcherRegistryLike {
|
|
|
84
85
|
readonly source: WatcherSourceRecord;
|
|
85
86
|
readonly intervalMs: number;
|
|
86
87
|
readonly metadata: Record<string, unknown>;
|
|
87
|
-
readonly run?: () => string;
|
|
88
|
+
readonly run?: (() => string) | undefined;
|
|
88
89
|
}): WatcherRecord;
|
|
89
90
|
getWatcher(watcherId: string): WatcherRecord | null;
|
|
90
91
|
startWatcher(watcherId: string): WatcherRecord | null;
|
|
@@ -99,7 +100,7 @@ export interface ApprovalBrokerLike {
|
|
|
99
100
|
readonly remember: boolean;
|
|
100
101
|
readonly actor: string;
|
|
101
102
|
readonly actorSurface: string;
|
|
102
|
-
readonly note?: string;
|
|
103
|
+
readonly note?: string | undefined;
|
|
103
104
|
}): Promise<unknown | null>;
|
|
104
105
|
}
|
|
105
106
|
export interface WorkspaceSwapManagerLike {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-route-types.d.ts","sourceRoot":"","sources":["../src/system-route-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"system-route-types.d.ts","sourceRoot":"","sources":["../src/system-route-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,OAAO,GACP,SAAS,GACT,MAAM,GACN,SAAS,GACT,UAAU,GACV,aAAa,GACb,QAAQ,GACR,UAAU,GACV,UAAU,GACV,SAAS,GACT,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,QAAQ,CAAC;AAEb,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAChD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAC7C,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAC5C,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC;AACjD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,qCAAqC;IACpD,mBAAmB,IAAI,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,IAAI,OAAO,CAAC;IACnB,KAAK,IAAI,OAAO,CAAC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+1,4 @@
|
|
|
1
1
|
import type { DaemonSystemRouteHandlers } from './context.js';
|
|
2
2
|
import type { DaemonSystemRouteContext } from './system-route-types.js';
|
|
3
|
-
export declare function createDaemonSystemRouteHandlers(context: DaemonSystemRouteContext
|
|
3
|
+
export declare function createDaemonSystemRouteHandlers(context: DaemonSystemRouteContext): DaemonSystemRouteHandlers;
|
|
4
4
|
//# sourceMappingURL=system-routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-routes.d.ts","sourceRoot":"","sources":["../src/system-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"system-routes.d.ts","sourceRoot":"","sources":["../src/system-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAU9D,OAAO,KAAK,EAMV,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AA4CjC,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,wBAAwB,GAChC,yBAAyB,CA0J3B"}
|