@pellux/goodvibes-daemon-sdk 0.30.2 → 0.33.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/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
package/dist/knowledge-routes.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { buildMissingScopeBody, resolvePrivateHostFetchOptions, } from './http-policy.js';
|
|
2
2
|
import { GoodVibesSdkError, DaemonErrorCategory } from '@pellux/goodvibes-errors';
|
|
3
|
-
import { jsonErrorResponse
|
|
3
|
+
import { jsonErrorResponse } from './error-response.js';
|
|
4
4
|
import { createArtifactFromUploadRequest, isArtifactUploadRequest } from './artifact-upload.js';
|
|
5
|
-
import { readBoundedPositiveInteger, readOptionalBoundedInteger } from './route-helpers.js';
|
|
5
|
+
import { createRouteBodySchema, createRouteBodySchemaRegistry, readBoundedBodyInteger, readBoundedPositiveInteger, readOptionalBoundedInteger, readOptionalStringField, readStringArrayField, } from './route-helpers.js';
|
|
6
6
|
import { createDaemonKnowledgeRefinementRouteHandlers } from './knowledge-refinement-routes.js';
|
|
7
|
+
const MAX_KNOWLEDGE_INGEST_TAGS = 64;
|
|
7
8
|
export function createDaemonKnowledgeRouteHandlers(context) {
|
|
8
9
|
return {
|
|
9
10
|
getKnowledgeStatus: async () => Response.json(await context.knowledgeService.getStatus()),
|
|
@@ -14,20 +15,20 @@ export function createDaemonKnowledgeRouteHandlers(context) {
|
|
|
14
15
|
const item = context.knowledgeService.getItem(id);
|
|
15
16
|
return item
|
|
16
17
|
? Response.json(item)
|
|
17
|
-
:
|
|
18
|
+
: jsonErrorResponse({ error: 'Unknown knowledge item' }, { status: 404 });
|
|
18
19
|
},
|
|
19
20
|
getKnowledgeConnectors: () => Response.json({ connectors: context.knowledgeService.listConnectors() }),
|
|
20
21
|
getKnowledgeConnector: (id) => {
|
|
21
22
|
const connector = context.knowledgeService.getConnector(id);
|
|
22
23
|
return connector
|
|
23
24
|
? Response.json({ connector })
|
|
24
|
-
:
|
|
25
|
+
: jsonErrorResponse({ error: 'Unknown knowledge connector' }, { status: 404 });
|
|
25
26
|
},
|
|
26
27
|
getKnowledgeConnectorDoctor: async (id) => {
|
|
27
28
|
const report = await context.knowledgeService.doctorConnector(id);
|
|
28
29
|
return report
|
|
29
30
|
? Response.json({ report })
|
|
30
|
-
:
|
|
31
|
+
: jsonErrorResponse({ error: 'Unknown knowledge connector' }, { status: 404 });
|
|
31
32
|
},
|
|
32
33
|
getKnowledgeProjectionTargets: async (url) => Response.json({ targets: await context.knowledgeService.listProjectionTargets(readLimit(url, 25)) }),
|
|
33
34
|
getKnowledgeMap: async (url) => Response.json(await context.knowledgeService.map({
|
|
@@ -74,33 +75,33 @@ export function createDaemonKnowledgeRouteHandlers(context) {
|
|
|
74
75
|
const candidate = context.knowledgeService.getConsolidationCandidate(id);
|
|
75
76
|
return candidate
|
|
76
77
|
? Response.json({ candidate })
|
|
77
|
-
:
|
|
78
|
+
: jsonErrorResponse({ error: 'Unknown knowledge consolidation candidate' }, { status: 404 });
|
|
78
79
|
},
|
|
79
80
|
getKnowledgeReports: async (url) => Response.json({ reports: context.knowledgeService.listConsolidationReports(readLimit(url, 100)) }),
|
|
80
81
|
getKnowledgeReport: (id) => {
|
|
81
82
|
const report = context.knowledgeService.getConsolidationReport(id);
|
|
82
83
|
return report
|
|
83
84
|
? Response.json({ report })
|
|
84
|
-
:
|
|
85
|
+
: jsonErrorResponse({ error: 'Unknown knowledge consolidation report' }, { status: 404 });
|
|
85
86
|
},
|
|
86
87
|
getKnowledgeExtraction: (id) => {
|
|
87
88
|
const extraction = context.knowledgeService.getExtraction(id);
|
|
88
89
|
return extraction
|
|
89
90
|
? Response.json({ extraction })
|
|
90
|
-
:
|
|
91
|
+
: jsonErrorResponse({ error: 'Unknown knowledge extraction' }, { status: 404 });
|
|
91
92
|
},
|
|
92
93
|
getKnowledgeSourceExtraction: (id) => {
|
|
93
94
|
const extraction = context.knowledgeService.getSourceExtraction(id);
|
|
94
95
|
return extraction
|
|
95
96
|
? Response.json({ extraction })
|
|
96
|
-
:
|
|
97
|
+
: jsonErrorResponse({ error: 'Unknown source extraction' }, { status: 404 });
|
|
97
98
|
},
|
|
98
99
|
getKnowledgeJobs: () => Response.json({ jobs: context.knowledgeService.listJobs() }),
|
|
99
100
|
getKnowledgeJob: (jobId) => {
|
|
100
101
|
const job = context.knowledgeService.getJob(jobId);
|
|
101
102
|
return job
|
|
102
103
|
? Response.json({ job })
|
|
103
|
-
:
|
|
104
|
+
: jsonErrorResponse({ error: 'Unknown knowledge job' }, { status: 404 });
|
|
104
105
|
},
|
|
105
106
|
getKnowledgeJobRuns: (url) => {
|
|
106
107
|
const jobId = url.searchParams.get('jobId') ?? undefined;
|
|
@@ -112,7 +113,7 @@ export function createDaemonKnowledgeRouteHandlers(context) {
|
|
|
112
113
|
const schedule = context.knowledgeService.getSchedule(id);
|
|
113
114
|
return schedule
|
|
114
115
|
? Response.json({ schedule })
|
|
115
|
-
:
|
|
116
|
+
: jsonErrorResponse({ error: 'Unknown knowledge schedule' }, { status: 404 });
|
|
116
117
|
},
|
|
117
118
|
postKnowledgeIngestUrl: async (request) => handleKnowledgeIngestUrl(context, request),
|
|
118
119
|
postKnowledgeIngestArtifact: async (request) => handleKnowledgeIngestArtifact(context, request),
|
|
@@ -146,7 +147,7 @@ export function createDaemonKnowledgeRouteHandlers(context) {
|
|
|
146
147
|
const deleted = await context.knowledgeService.deleteSchedule(id);
|
|
147
148
|
return deleted
|
|
148
149
|
? Response.json({ deleted: true })
|
|
149
|
-
:
|
|
150
|
+
: jsonErrorResponse({ error: 'Unknown knowledge schedule' }, { status: 404 });
|
|
150
151
|
},
|
|
151
152
|
postKnowledgeSetScheduleEnabled: async (id, request) => handleKnowledgeSetScheduleEnabled(context, id, request),
|
|
152
153
|
postKnowledgeRenderProjection: async (request) => handleKnowledgeRenderProjection(context, request),
|
|
@@ -189,6 +190,72 @@ function readStringList(url, ...names) {
|
|
|
189
190
|
.map((value) => value.trim())
|
|
190
191
|
.filter(Boolean);
|
|
191
192
|
}
|
|
193
|
+
const knowledgeBodySchemas = createRouteBodySchemaRegistry({
|
|
194
|
+
search: createRouteBodySchema('POST /api/knowledge/search', (body) => {
|
|
195
|
+
const query = readOptionalStringField(body, 'query');
|
|
196
|
+
if (!query)
|
|
197
|
+
return jsonErrorResponse({ error: 'Missing query' }, { status: 400 });
|
|
198
|
+
return {
|
|
199
|
+
query,
|
|
200
|
+
limit: readBoundedBodyInteger(body.limit, 10, 100),
|
|
201
|
+
};
|
|
202
|
+
}),
|
|
203
|
+
ask: createRouteBodySchema('POST /api/knowledge/ask', (body) => {
|
|
204
|
+
const query = readOptionalStringField(body, 'query');
|
|
205
|
+
if (!query)
|
|
206
|
+
return jsonErrorResponse({ error: 'Missing query' }, { status: 400 });
|
|
207
|
+
const mode = readKnowledgeAnswerMode(body.mode);
|
|
208
|
+
const knowledgeSpaceId = readOptionalStringField(body, 'knowledgeSpaceId');
|
|
209
|
+
const candidateSourceIds = readStringArrayField(body, 'candidateSourceIds');
|
|
210
|
+
const candidateNodeIds = readStringArrayField(body, 'candidateNodeIds');
|
|
211
|
+
return {
|
|
212
|
+
query,
|
|
213
|
+
...(knowledgeSpaceId ? { knowledgeSpaceId } : {}),
|
|
214
|
+
...(Object.hasOwn(body, 'limit') ? { limit: readBoundedBodyInteger(body.limit, 8, 50) } : {}),
|
|
215
|
+
...(mode ? { mode } : {}),
|
|
216
|
+
...(typeof body.includeSources === 'boolean' ? { includeSources: body.includeSources } : {}),
|
|
217
|
+
...(typeof body.includeConfidence === 'boolean' ? { includeConfidence: body.includeConfidence } : {}),
|
|
218
|
+
...(typeof body.includeLinkedObjects === 'boolean' ? { includeLinkedObjects: body.includeLinkedObjects } : {}),
|
|
219
|
+
...(candidateSourceIds ? { candidateSourceIds } : {}),
|
|
220
|
+
...(candidateNodeIds ? { candidateNodeIds } : {}),
|
|
221
|
+
...(typeof body.strictCandidates === 'boolean' ? { strictCandidates: body.strictCandidates } : {}),
|
|
222
|
+
};
|
|
223
|
+
}),
|
|
224
|
+
packet: createRouteBodySchema('POST /api/knowledge/packet', (body) => {
|
|
225
|
+
const task = readOptionalStringField(body, 'task');
|
|
226
|
+
if (!task)
|
|
227
|
+
return jsonErrorResponse({ error: 'Missing task' }, { status: 400 });
|
|
228
|
+
const detail = readKnowledgePacketDetail(body.detail);
|
|
229
|
+
const budgetLimit = Object.hasOwn(body, 'budgetLimit')
|
|
230
|
+
? readBoundedBodyInteger(body.budgetLimit, 6, 100)
|
|
231
|
+
: undefined;
|
|
232
|
+
return {
|
|
233
|
+
task,
|
|
234
|
+
writeScope: readStringArrayField(body, 'writeScope') ?? [],
|
|
235
|
+
limit: readBoundedBodyInteger(body.limit, 6, 50),
|
|
236
|
+
...(detail ? { detail } : {}),
|
|
237
|
+
...(typeof budgetLimit === 'number' ? { budgetLimit } : {}),
|
|
238
|
+
};
|
|
239
|
+
}),
|
|
240
|
+
runJob: createRouteBodySchema('POST /api/knowledge/jobs/:jobId/run', (body) => {
|
|
241
|
+
const mode = readKnowledgeJobRunMode(body.mode);
|
|
242
|
+
const sourceIds = readStringArrayField(body, 'sourceIds');
|
|
243
|
+
return {
|
|
244
|
+
...(mode ? { mode } : {}),
|
|
245
|
+
...(sourceIds ? { sourceIds } : {}),
|
|
246
|
+
...(Object.hasOwn(body, 'limit') ? { limit: readBoundedBodyInteger(body.limit, 50, 500) } : {}),
|
|
247
|
+
};
|
|
248
|
+
}),
|
|
249
|
+
});
|
|
250
|
+
function readKnowledgeAnswerMode(value) {
|
|
251
|
+
return value === 'concise' || value === 'standard' || value === 'detailed' ? value : undefined;
|
|
252
|
+
}
|
|
253
|
+
function readKnowledgePacketDetail(value) {
|
|
254
|
+
return typeof value === 'string' ? value.toLowerCase() : undefined;
|
|
255
|
+
}
|
|
256
|
+
function readKnowledgeJobRunMode(value) {
|
|
257
|
+
return value === 'inline' || value === 'background' ? value : undefined;
|
|
258
|
+
}
|
|
192
259
|
function readKnowledgeProjectionRequest(body) {
|
|
193
260
|
const rawKind = typeof body.kind === 'string' ? body.kind.trim().toLowerCase() : '';
|
|
194
261
|
if (rawKind !== 'overview'
|
|
@@ -198,23 +265,24 @@ function readKnowledgeProjectionRequest(body) {
|
|
|
198
265
|
&& rawKind !== 'issue'
|
|
199
266
|
&& rawKind !== 'dashboard'
|
|
200
267
|
&& rawKind !== 'rollup') {
|
|
201
|
-
return
|
|
268
|
+
return jsonErrorResponse({
|
|
202
269
|
error: 'Projection kind must be one of overview, bundle, source, node, issue, dashboard, or rollup.',
|
|
270
|
+
code: 'INVALID_PROJECTION_KIND',
|
|
203
271
|
}, { status: 400 });
|
|
204
272
|
}
|
|
205
273
|
const id = typeof body.id === 'string' ? body.id.trim() : '';
|
|
206
274
|
if ((rawKind === 'source' || rawKind === 'node' || rawKind === 'issue' || rawKind === 'rollup') && !id) {
|
|
207
|
-
return
|
|
275
|
+
return jsonErrorResponse({ error: `Projection kind ${rawKind} requires id.` }, { status: 400 });
|
|
208
276
|
}
|
|
209
277
|
return {
|
|
210
278
|
kind: rawKind,
|
|
211
279
|
...(id ? { id } : {}),
|
|
212
|
-
...(
|
|
280
|
+
...(Object.hasOwn(body, 'limit') ? { limit: readBoundedBodyInteger(body.limit, 20, 500) } : {}),
|
|
213
281
|
};
|
|
214
282
|
}
|
|
215
283
|
function readKnowledgeSchedule(context, value) {
|
|
216
284
|
if (typeof value !== 'object' || value === null) {
|
|
217
|
-
return
|
|
285
|
+
return jsonErrorResponse({ error: 'Missing schedule object' }, { status: 400 });
|
|
218
286
|
}
|
|
219
287
|
const schedule = value;
|
|
220
288
|
const kind = typeof schedule.kind === 'string' ? schedule.kind.trim().toLowerCase() : '';
|
|
@@ -257,14 +325,14 @@ function readGraphqlVariables(value, parseJsonText) {
|
|
|
257
325
|
if (typeof value === 'object') {
|
|
258
326
|
return value;
|
|
259
327
|
}
|
|
260
|
-
return
|
|
328
|
+
return jsonErrorResponse({ error: 'GraphQL variables must be an object or JSON string.' }, { status: 400 });
|
|
261
329
|
}
|
|
262
330
|
async function parseKnowledgeGraphqlRequest(context, req) {
|
|
263
331
|
if (req.method === 'GET') {
|
|
264
332
|
const url = new URL(req.url);
|
|
265
333
|
const query = url.searchParams.get('query')?.trim() ?? '';
|
|
266
334
|
if (!query)
|
|
267
|
-
return
|
|
335
|
+
return jsonErrorResponse({ error: 'Missing query' }, { status: 400 });
|
|
268
336
|
const variables = readGraphqlVariables(url.searchParams.get('variables'), context.parseJsonText);
|
|
269
337
|
if (variables instanceof Response)
|
|
270
338
|
return variables;
|
|
@@ -280,16 +348,16 @@ async function parseKnowledgeGraphqlRequest(context, req) {
|
|
|
280
348
|
const query = (await req.text()).trim();
|
|
281
349
|
return query
|
|
282
350
|
? { query }
|
|
283
|
-
:
|
|
351
|
+
: jsonErrorResponse({ error: 'Missing query' }, { status: 400 });
|
|
284
352
|
}
|
|
285
353
|
const body = await context.parseOptionalJsonBody(req);
|
|
286
354
|
if (body instanceof Response)
|
|
287
355
|
return body;
|
|
288
356
|
if (!body)
|
|
289
|
-
return
|
|
357
|
+
return jsonErrorResponse({ error: 'Missing query' }, { status: 400 });
|
|
290
358
|
const query = typeof body.query === 'string' ? body.query.trim() : '';
|
|
291
359
|
if (!query)
|
|
292
|
-
return
|
|
360
|
+
return jsonErrorResponse({ error: 'Missing query' }, { status: 400 });
|
|
293
361
|
const variables = readGraphqlVariables(body.variables, context.parseJsonText);
|
|
294
362
|
if (variables instanceof Response)
|
|
295
363
|
return variables;
|
|
@@ -304,12 +372,12 @@ async function handleKnowledgeGraphql(context, req) {
|
|
|
304
372
|
const parsed = await parseKnowledgeGraphqlRequest(context, req);
|
|
305
373
|
if (parsed instanceof Response)
|
|
306
374
|
return parsed;
|
|
307
|
-
if (req.method === 'GET' &&
|
|
308
|
-
return
|
|
375
|
+
if (req.method === 'GET' && graphqlOperationLooksLikeMutation(parsed.query)) {
|
|
376
|
+
return jsonErrorResponse({ error: 'GraphQL mutations must use POST.' }, { status: 405 });
|
|
309
377
|
}
|
|
310
378
|
const principal = context.resolveAuthenticatedPrincipal(req);
|
|
311
379
|
if (!principal) {
|
|
312
|
-
return
|
|
380
|
+
return jsonErrorResponse({ error: 'Unauthorized' }, { status: 401 });
|
|
313
381
|
}
|
|
314
382
|
let access;
|
|
315
383
|
try {
|
|
@@ -323,7 +391,7 @@ async function handleKnowledgeGraphql(context, req) {
|
|
|
323
391
|
return Response.json(scopeDenied, { status: 403 });
|
|
324
392
|
}
|
|
325
393
|
if (access.adminRequired && !principal.admin) {
|
|
326
|
-
return
|
|
394
|
+
return jsonErrorResponse({ error: 'Knowledge GraphQL mutation requires admin access.' }, { status: 403 });
|
|
327
395
|
}
|
|
328
396
|
const result = await context.knowledgeGraphqlService.execute({
|
|
329
397
|
query: parsed.query,
|
|
@@ -335,6 +403,13 @@ async function handleKnowledgeGraphql(context, req) {
|
|
|
335
403
|
const status = result.errors?.length && !result.data ? 400 : 200;
|
|
336
404
|
return Response.json(result, { status });
|
|
337
405
|
}
|
|
406
|
+
function graphqlOperationLooksLikeMutation(query) {
|
|
407
|
+
const withoutComments = query.replace(/#[^\n\r]*/g, '');
|
|
408
|
+
const withoutStrings = withoutComments
|
|
409
|
+
.replace(/"""[\s\S]*?"""/g, ' ')
|
|
410
|
+
.replace(/"(?:\\.|[^"\\])*"/g, ' ');
|
|
411
|
+
return /^\s*mutation\b/.test(withoutStrings);
|
|
412
|
+
}
|
|
338
413
|
function buildKnowledgePrivateHostFetchOptions(context, requested) {
|
|
339
414
|
return resolvePrivateHostFetchOptions(requested, {
|
|
340
415
|
configManager: context.configManager,
|
|
@@ -349,16 +424,17 @@ async function handleKnowledgeIngestUrl(context, request) {
|
|
|
349
424
|
return body;
|
|
350
425
|
const url = typeof body.url === 'string' ? body.url.trim() : '';
|
|
351
426
|
if (!url)
|
|
352
|
-
return
|
|
427
|
+
return jsonErrorResponse({ error: 'Missing url' }, { status: 400 });
|
|
353
428
|
const privateHostFetchOptions = buildKnowledgePrivateHostFetchOptions(context, body.allowPrivateHosts);
|
|
354
429
|
if (privateHostFetchOptions instanceof Response)
|
|
355
430
|
return privateHostFetchOptions;
|
|
431
|
+
const tags = readStringArrayField(body, 'tags', MAX_KNOWLEDGE_INGEST_TAGS);
|
|
356
432
|
try {
|
|
357
433
|
return Response.json(await context.knowledgeService.ingestUrl({
|
|
358
434
|
url,
|
|
359
435
|
...(typeof body.title === 'string' ? { title: body.title } : {}),
|
|
360
436
|
...(typeof body.folderPath === 'string' ? { folderPath: body.folderPath } : {}),
|
|
361
|
-
...(
|
|
437
|
+
...(tags ? { tags } : {}),
|
|
362
438
|
...(typeof body.sessionId === 'string' ? { sessionId: body.sessionId } : {}),
|
|
363
439
|
...(typeof body.sourceType === 'string' ? { sourceType: body.sourceType } : {}),
|
|
364
440
|
...(typeof body.connectorId === 'string' ? { connectorId: body.connectorId } : {}),
|
|
@@ -394,6 +470,7 @@ async function handleKnowledgeIngestArtifact(context, request) {
|
|
|
394
470
|
const privateHostFetchOptions = buildKnowledgePrivateHostFetchOptions(context, body.allowPrivateHosts);
|
|
395
471
|
if (privateHostFetchOptions instanceof Response)
|
|
396
472
|
return privateHostFetchOptions;
|
|
473
|
+
const tags = readStringArrayField(body, 'tags', MAX_KNOWLEDGE_INGEST_TAGS);
|
|
397
474
|
try {
|
|
398
475
|
return Response.json(await context.knowledgeService.ingestArtifact({
|
|
399
476
|
...(typeof body.artifactId === 'string' ? { artifactId: body.artifactId } : {}),
|
|
@@ -401,7 +478,7 @@ async function handleKnowledgeIngestArtifact(context, request) {
|
|
|
401
478
|
...(typeof body.uri === 'string' ? { uri: body.uri } : {}),
|
|
402
479
|
...(typeof body.title === 'string' ? { title: body.title } : {}),
|
|
403
480
|
...(typeof body.folderPath === 'string' ? { folderPath: body.folderPath } : {}),
|
|
404
|
-
...(
|
|
481
|
+
...(tags ? { tags } : {}),
|
|
405
482
|
...(typeof body.sessionId === 'string' ? { sessionId: body.sessionId } : {}),
|
|
406
483
|
...(typeof body.sourceType === 'string' ? { sourceType: body.sourceType } : {}),
|
|
407
484
|
...(typeof body.connectorId === 'string' ? { connectorId: body.connectorId } : {}),
|
|
@@ -429,7 +506,7 @@ async function handleKnowledgeSyncBrowserHistory(context, request) {
|
|
|
429
506
|
: undefined;
|
|
430
507
|
try {
|
|
431
508
|
return Response.json(await context.knowledgeService.syncBrowserHistory({
|
|
432
|
-
...(
|
|
509
|
+
...(Object.hasOwn(input, 'limit') ? { limit: readBoundedBodyInteger(input.limit, 50, 500) } : {}),
|
|
433
510
|
...(typeof input.sinceMs === 'number' ? { sinceMs: input.sinceMs } : {}),
|
|
434
511
|
...(typeof input.homeOverride === 'string' ? { homeOverride: input.homeOverride } : {}),
|
|
435
512
|
...(typeof input.sessionId === 'string' ? { sessionId: input.sessionId } : {}),
|
|
@@ -451,7 +528,7 @@ async function handleKnowledgeImportBookmarks(context, request) {
|
|
|
451
528
|
return body;
|
|
452
529
|
const path = typeof body.path === 'string' ? body.path.trim() : '';
|
|
453
530
|
if (!path)
|
|
454
|
-
return
|
|
531
|
+
return jsonErrorResponse({ error: 'Missing path' }, { status: 400 });
|
|
455
532
|
const privateHostFetchOptions = buildKnowledgePrivateHostFetchOptions(context, body.allowPrivateHosts);
|
|
456
533
|
if (privateHostFetchOptions instanceof Response)
|
|
457
534
|
return privateHostFetchOptions;
|
|
@@ -475,7 +552,7 @@ async function handleKnowledgeImportUrls(context, request) {
|
|
|
475
552
|
return body;
|
|
476
553
|
const path = typeof body.path === 'string' ? body.path.trim() : '';
|
|
477
554
|
if (!path)
|
|
478
|
-
return
|
|
555
|
+
return jsonErrorResponse({ error: 'Missing path' }, { status: 400 });
|
|
479
556
|
const privateHostFetchOptions = buildKnowledgePrivateHostFetchOptions(context, body.allowPrivateHosts);
|
|
480
557
|
if (privateHostFetchOptions instanceof Response)
|
|
481
558
|
return privateHostFetchOptions;
|
|
@@ -499,7 +576,7 @@ async function handleKnowledgeIngestConnector(context, request) {
|
|
|
499
576
|
return body;
|
|
500
577
|
const connectorId = typeof body.connectorId === 'string' ? body.connectorId.trim() : '';
|
|
501
578
|
if (!connectorId)
|
|
502
|
-
return
|
|
579
|
+
return jsonErrorResponse({ error: 'Missing connectorId' }, { status: 400 });
|
|
503
580
|
const privateHostFetchOptions = buildKnowledgePrivateHostFetchOptions(context, body.allowPrivateHosts);
|
|
504
581
|
if (privateHostFetchOptions instanceof Response)
|
|
505
582
|
return privateHostFetchOptions;
|
|
@@ -521,48 +598,30 @@ async function handleKnowledgeSearch(context, request) {
|
|
|
521
598
|
const body = await context.parseJsonBody(request);
|
|
522
599
|
if (body instanceof Response)
|
|
523
600
|
return body;
|
|
524
|
-
const
|
|
525
|
-
if (
|
|
526
|
-
return
|
|
527
|
-
|
|
528
|
-
return Response.json({ results: context.knowledgeService.search(query, limit) });
|
|
601
|
+
const input = knowledgeBodySchemas.search.parse(body);
|
|
602
|
+
if (input instanceof Response)
|
|
603
|
+
return input;
|
|
604
|
+
return Response.json({ results: context.knowledgeService.search(input.query, input.limit) });
|
|
529
605
|
}
|
|
530
606
|
async function handleKnowledgeAsk(context, request) {
|
|
531
607
|
const body = await context.parseJsonBody(request);
|
|
532
608
|
if (body instanceof Response)
|
|
533
609
|
return body;
|
|
534
|
-
const
|
|
535
|
-
if (
|
|
536
|
-
return
|
|
537
|
-
return Response.json(await context.knowledgeService.ask(
|
|
538
|
-
query,
|
|
539
|
-
...(typeof body.knowledgeSpaceId === 'string' ? { knowledgeSpaceId: body.knowledgeSpaceId } : {}),
|
|
540
|
-
...(typeof body.limit === 'number' ? { limit: Math.max(1, body.limit) } : {}),
|
|
541
|
-
...(typeof body.mode === 'string' && ['concise', 'standard', 'detailed'].includes(body.mode) ? { mode: body.mode } : {}),
|
|
542
|
-
...(typeof body.includeSources === 'boolean' ? { includeSources: body.includeSources } : {}),
|
|
543
|
-
...(typeof body.includeConfidence === 'boolean' ? { includeConfidence: body.includeConfidence } : {}),
|
|
544
|
-
...(typeof body.includeLinkedObjects === 'boolean' ? { includeLinkedObjects: body.includeLinkedObjects } : {}),
|
|
545
|
-
...(Array.isArray(body.candidateSourceIds) ? { candidateSourceIds: body.candidateSourceIds.filter(isString) } : {}),
|
|
546
|
-
...(Array.isArray(body.candidateNodeIds) ? { candidateNodeIds: body.candidateNodeIds.filter(isString) } : {}),
|
|
547
|
-
...(typeof body.strictCandidates === 'boolean' ? { strictCandidates: body.strictCandidates } : {}),
|
|
548
|
-
}));
|
|
610
|
+
const input = knowledgeBodySchemas.ask.parse(body);
|
|
611
|
+
if (input instanceof Response)
|
|
612
|
+
return input;
|
|
613
|
+
return Response.json(await context.knowledgeService.ask(input));
|
|
549
614
|
}
|
|
550
615
|
async function handleKnowledgePacket(context, request) {
|
|
551
616
|
const body = await context.parseJsonBody(request);
|
|
552
617
|
if (body instanceof Response)
|
|
553
618
|
return body;
|
|
554
|
-
const
|
|
555
|
-
if (
|
|
556
|
-
return
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
? body.detail.toLowerCase()
|
|
561
|
-
: undefined;
|
|
562
|
-
const budgetLimit = typeof body.budgetLimit === 'number' ? body.budgetLimit : undefined;
|
|
563
|
-
return Response.json(await context.knowledgeService.buildPacket(task, writeScope, limit, {
|
|
564
|
-
...(detail ? { detail } : {}),
|
|
565
|
-
...(typeof budgetLimit === 'number' ? { budgetLimit } : {}),
|
|
619
|
+
const input = knowledgeBodySchemas.packet.parse(body);
|
|
620
|
+
if (input instanceof Response)
|
|
621
|
+
return input;
|
|
622
|
+
return Response.json(await context.knowledgeService.buildPacket(input.task, input.writeScope, input.limit, {
|
|
623
|
+
...(input.detail ? { detail: input.detail } : {}),
|
|
624
|
+
...(typeof input.budgetLimit === 'number' ? { budgetLimit: input.budgetLimit } : {}),
|
|
566
625
|
}));
|
|
567
626
|
}
|
|
568
627
|
async function handleKnowledgeReviewIssue(context, id, request) {
|
|
@@ -574,7 +633,7 @@ async function handleKnowledgeReviewIssue(context, id, request) {
|
|
|
574
633
|
return body;
|
|
575
634
|
const action = typeof body?.action === 'string' ? body.action.trim().toLowerCase() : '';
|
|
576
635
|
if (!['accept', 'reject', 'resolve', 'reopen', 'edit', 'forget'].includes(action)) {
|
|
577
|
-
return
|
|
636
|
+
return jsonErrorResponse({ error: 'Action must be accept, reject, resolve, reopen, edit, or forget.' }, { status: 400 });
|
|
578
637
|
}
|
|
579
638
|
try {
|
|
580
639
|
return Response.json(await context.knowledgeService.reviewIssue({
|
|
@@ -585,10 +644,10 @@ async function handleKnowledgeReviewIssue(context, id, request) {
|
|
|
585
644
|
}));
|
|
586
645
|
}
|
|
587
646
|
catch (error) {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
});
|
|
647
|
+
// map status from error code, not English-prefix match.
|
|
648
|
+
const isNotFound = error instanceof Error && (error.code === 'NOT_FOUND'
|
|
649
|
+
|| error.code === 'KNOWLEDGE_ISSUE_NOT_FOUND');
|
|
650
|
+
return jsonErrorResponse(error, { status: isNotFound ? 404 : 400 });
|
|
592
651
|
}
|
|
593
652
|
}
|
|
594
653
|
async function handleKnowledgeDecideCandidate(context, id, request) {
|
|
@@ -600,7 +659,7 @@ async function handleKnowledgeDecideCandidate(context, id, request) {
|
|
|
600
659
|
return body;
|
|
601
660
|
const decision = typeof body.decision === 'string' ? body.decision.trim().toLowerCase() : '';
|
|
602
661
|
if (decision !== 'accept' && decision !== 'reject' && decision !== 'supersede') {
|
|
603
|
-
return
|
|
662
|
+
return jsonErrorResponse({ error: 'Decision must be accept, reject, or supersede.' }, { status: 400 });
|
|
604
663
|
}
|
|
605
664
|
try {
|
|
606
665
|
return Response.json({
|
|
@@ -613,10 +672,10 @@ async function handleKnowledgeDecideCandidate(context, id, request) {
|
|
|
613
672
|
});
|
|
614
673
|
}
|
|
615
674
|
catch (error) {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
});
|
|
675
|
+
// map status from error code, not English-prefix match.
|
|
676
|
+
const isNotFound = error instanceof Error && (error.code === 'NOT_FOUND'
|
|
677
|
+
|| error.code === 'KNOWLEDGE_CANDIDATE_NOT_FOUND');
|
|
678
|
+
return jsonErrorResponse(error, { status: isNotFound ? 404 : 400 });
|
|
620
679
|
}
|
|
621
680
|
}
|
|
622
681
|
async function handleKnowledgeRunJob(context, jobId, request) {
|
|
@@ -626,20 +685,19 @@ async function handleKnowledgeRunJob(context, jobId, request) {
|
|
|
626
685
|
const body = await context.parseJsonBody(request);
|
|
627
686
|
if (body instanceof Response)
|
|
628
687
|
return body;
|
|
688
|
+
const input = knowledgeBodySchemas.runJob.parse(body);
|
|
689
|
+
if (input instanceof Response)
|
|
690
|
+
return input;
|
|
629
691
|
try {
|
|
630
692
|
return Response.json({
|
|
631
|
-
run: await context.knowledgeService.runJob(jobId,
|
|
632
|
-
...(typeof body.mode === 'string' ? { mode: body.mode.toLowerCase() } : {}),
|
|
633
|
-
...(Array.isArray(body.sourceIds) ? { sourceIds: body.sourceIds.filter((entry) => typeof entry === 'string') } : {}),
|
|
634
|
-
...(typeof body.limit === 'number' ? { limit: body.limit } : {}),
|
|
635
|
-
}),
|
|
693
|
+
run: await context.knowledgeService.runJob(jobId, input),
|
|
636
694
|
});
|
|
637
695
|
}
|
|
638
696
|
catch (error) {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
});
|
|
697
|
+
// map status from error code, not English-prefix match.
|
|
698
|
+
const isNotFound = error instanceof Error && (error.code === 'NOT_FOUND'
|
|
699
|
+
|| error.code === 'KNOWLEDGE_JOB_NOT_FOUND');
|
|
700
|
+
return jsonErrorResponse(error, { status: isNotFound ? 404 : 400 });
|
|
643
701
|
}
|
|
644
702
|
}
|
|
645
703
|
async function handleKnowledgeSaveSchedule(context, request) {
|
|
@@ -651,7 +709,7 @@ async function handleKnowledgeSaveSchedule(context, request) {
|
|
|
651
709
|
return body;
|
|
652
710
|
const jobId = typeof body.jobId === 'string' ? body.jobId.trim() : '';
|
|
653
711
|
if (!jobId)
|
|
654
|
-
return
|
|
712
|
+
return jsonErrorResponse({ error: 'Missing jobId' }, { status: 400 });
|
|
655
713
|
const schedule = readKnowledgeSchedule(context, body.schedule);
|
|
656
714
|
if (schedule instanceof Response)
|
|
657
715
|
return schedule;
|
|
@@ -679,12 +737,12 @@ async function handleKnowledgeSetScheduleEnabled(context, id, request) {
|
|
|
679
737
|
if (body instanceof Response)
|
|
680
738
|
return body;
|
|
681
739
|
if (typeof body.enabled !== 'boolean') {
|
|
682
|
-
return
|
|
740
|
+
return jsonErrorResponse({ error: 'Missing enabled boolean' }, { status: 400 });
|
|
683
741
|
}
|
|
684
742
|
const schedule = await context.knowledgeService.setScheduleEnabled(id, body.enabled);
|
|
685
743
|
return schedule
|
|
686
744
|
? Response.json({ schedule })
|
|
687
|
-
:
|
|
745
|
+
: jsonErrorResponse({ error: 'Unknown knowledge schedule' }, { status: 404 });
|
|
688
746
|
}
|
|
689
747
|
async function handleKnowledgeRenderProjection(context, request) {
|
|
690
748
|
const body = await context.parseJsonBody(request);
|
|
@@ -720,6 +778,3 @@ async function handleKnowledgeMaterializeProjection(context, request) {
|
|
|
720
778
|
return jsonErrorResponse(error, { status: 400 });
|
|
721
779
|
}
|
|
722
780
|
}
|
|
723
|
-
function isString(value) {
|
|
724
|
-
return typeof value === 'string' && value.trim().length > 0;
|
|
725
|
-
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JsonRecord } from './route-helpers.js';
|
|
1
2
|
export type ArtifactKind = string;
|
|
2
3
|
export type FetchExtractMode = string;
|
|
3
4
|
export type MediaArtifact = Record<string, unknown>;
|
|
@@ -68,7 +69,7 @@ export interface DaemonMediaRouteContext {
|
|
|
68
69
|
readonly configManager: ConfigManagerLike;
|
|
69
70
|
readonly mediaProviders: MediaProviderRegistryLike;
|
|
70
71
|
readonly multimodalService: MultimodalServiceLike;
|
|
71
|
-
readonly parseJsonBody: (req: Request) => Promise<
|
|
72
|
+
readonly parseJsonBody: (req: Request) => Promise<JsonRecord | Response>;
|
|
72
73
|
readonly requireAdmin: (req: Request) => Response | null;
|
|
73
74
|
readonly voiceService: VoiceServiceLike;
|
|
74
75
|
readonly webSearchService: WebSearchServiceLike;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-route-types.d.ts","sourceRoot":"","sources":["../src/media-route-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAC/C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACzD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC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D,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAC;IACxC,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;CACjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-routes.d.ts","sourceRoot":"","sources":["../src/media-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"media-routes.d.ts","sourceRoot":"","sources":["../src/media-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAY7D,OAAO,KAAK,EAEV,uBAAuB,EAUxB,MAAM,wBAAwB,CAAC;AAehC,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,uBAAuB,GAC/B,wBAAwB,CAkC1B"}
|