@pellux/goodvibes-daemon-sdk 0.18.3 → 0.30.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.
Files changed (82) hide show
  1. package/README.md +13 -7
  2. package/dist/api-router.d.ts +8 -1
  3. package/dist/api-router.d.ts.map +1 -1
  4. package/dist/api-router.js +12 -3
  5. package/dist/artifact-upload.d.ts +26 -0
  6. package/dist/artifact-upload.d.ts.map +1 -0
  7. package/dist/artifact-upload.js +535 -0
  8. package/dist/automation.d.ts +2 -2
  9. package/dist/automation.d.ts.map +1 -1
  10. package/dist/channel-route-types.d.ts.map +1 -1
  11. package/dist/channel-routes.d.ts +2 -2
  12. package/dist/channel-routes.d.ts.map +1 -1
  13. package/dist/channel-routes.js +28 -3
  14. package/dist/context.d.ts +151 -51
  15. package/dist/context.d.ts.map +1 -1
  16. package/dist/control-routes.d.ts +2 -2
  17. package/dist/control-routes.d.ts.map +1 -1
  18. package/dist/error-response.d.ts.map +1 -1
  19. package/dist/error-response.js +172 -12
  20. package/dist/http-policy.d.ts +1 -1
  21. package/dist/http-policy.d.ts.map +1 -1
  22. package/dist/http-policy.js +0 -1
  23. package/dist/index.d.ts +8 -4
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +3 -1
  26. package/dist/integration-route-types.d.ts +3 -1
  27. package/dist/integration-route-types.d.ts.map +1 -1
  28. package/dist/integration-routes.d.ts +2 -2
  29. package/dist/integration-routes.d.ts.map +1 -1
  30. package/dist/integration-routes.js +3 -0
  31. package/dist/knowledge-refinement-routes.d.ts +4 -0
  32. package/dist/knowledge-refinement-routes.d.ts.map +1 -0
  33. package/dist/knowledge-refinement-routes.js +58 -0
  34. package/dist/knowledge-route-types.d.ts +11 -1
  35. package/dist/knowledge-route-types.d.ts.map +1 -1
  36. package/dist/knowledge-routes.d.ts +2 -2
  37. package/dist/knowledge-routes.d.ts.map +1 -1
  38. package/dist/knowledge-routes.js +156 -13
  39. package/dist/media-route-types.d.ts +10 -0
  40. package/dist/media-route-types.d.ts.map +1 -1
  41. package/dist/media-routes.d.ts +2 -2
  42. package/dist/media-routes.d.ts.map +1 -1
  43. package/dist/media-routes.js +134 -15
  44. package/dist/operator.d.ts +2 -2
  45. package/dist/operator.d.ts.map +1 -1
  46. package/dist/operator.js +49 -15
  47. package/dist/otlp-protobuf.d.ts +3 -0
  48. package/dist/otlp-protobuf.d.ts.map +1 -0
  49. package/dist/otlp-protobuf.js +977 -0
  50. package/dist/remote-routes.d.ts +2 -2
  51. package/dist/remote-routes.d.ts.map +1 -1
  52. package/dist/remote-routes.js +146 -13
  53. package/dist/remote.d.ts +2 -2
  54. package/dist/remote.d.ts.map +1 -1
  55. package/dist/route-helpers.d.ts +8 -0
  56. package/dist/route-helpers.d.ts.map +1 -1
  57. package/dist/route-helpers.js +24 -0
  58. package/dist/runtime-automation-routes.d.ts +2 -2
  59. package/dist/runtime-automation-routes.d.ts.map +1 -1
  60. package/dist/runtime-automation-routes.js +4 -1
  61. package/dist/runtime-route-types.d.ts +46 -3
  62. package/dist/runtime-route-types.d.ts.map +1 -1
  63. package/dist/runtime-routes.d.ts +2 -2
  64. package/dist/runtime-routes.d.ts.map +1 -1
  65. package/dist/runtime-routes.js +1 -0
  66. package/dist/runtime-session-routes.d.ts +13 -3
  67. package/dist/runtime-session-routes.d.ts.map +1 -1
  68. package/dist/runtime-session-routes.js +102 -10
  69. package/dist/sessions.d.ts +2 -2
  70. package/dist/sessions.d.ts.map +1 -1
  71. package/dist/sessions.js +3 -0
  72. package/dist/system-route-types.d.ts +19 -0
  73. package/dist/system-route-types.d.ts.map +1 -1
  74. package/dist/system-routes.d.ts +2 -2
  75. package/dist/system-routes.d.ts.map +1 -1
  76. package/dist/system-routes.js +18 -0
  77. package/dist/tasks.d.ts +2 -2
  78. package/dist/tasks.d.ts.map +1 -1
  79. package/dist/telemetry-routes.d.ts +25 -2
  80. package/dist/telemetry-routes.d.ts.map +1 -1
  81. package/dist/telemetry-routes.js +131 -15
  82. package/package.json +128 -5
package/dist/operator.js CHANGED
@@ -1,10 +1,11 @@
1
+ import { readBoundedPositiveInteger } from './route-helpers.js';
1
2
  export async function dispatchOperatorRoutes(req, handlers) {
2
3
  const url = new URL(req.url);
3
4
  const { pathname } = url;
4
5
  const method = req.method;
5
6
  if (pathname === '/status' && method === 'GET')
6
7
  return handlers.getStatus();
7
- if ((pathname === '/api/control-plane/auth' || pathname === '/api/control-plane/whoami') && method === 'GET')
8
+ if (pathname === '/api/control-plane/auth' && method === 'GET')
8
9
  return handlers.getCurrentAuth(req);
9
10
  if (pathname === '/api/control-plane' && method === 'GET')
10
11
  return handlers.getControlPlaneSnapshot();
@@ -13,31 +14,37 @@ export async function dispatchOperatorRoutes(req, handlers) {
13
14
  if (pathname === '/api/control-plane/web' && method === 'GET')
14
15
  return handlers.getControlPlaneWeb();
15
16
  if (pathname === '/api/control-plane/recent-events' && method === 'GET') {
16
- const limit = Number(url.searchParams.get('limit') ?? 100);
17
+ const limit = readBoundedPositiveInteger(url.searchParams.get('limit'), 100);
17
18
  return handlers.getControlPlaneRecentEvents(limit);
18
19
  }
19
20
  if (pathname === '/api/control-plane/messages' && method === 'GET')
20
21
  return handlers.getControlPlaneMessages();
21
22
  if (pathname === '/api/control-plane/clients' && method === 'GET')
22
23
  return handlers.getControlPlaneClients();
23
- if ((pathname === '/api/telemetry' || pathname === '/api/v1/telemetry') && method === 'GET')
24
+ if (pathname === '/api/v1/telemetry' && method === 'GET')
24
25
  return handlers.getTelemetrySnapshot(req);
25
- if ((pathname === '/api/telemetry/events' || pathname === '/api/v1/telemetry/events') && method === 'GET')
26
+ if (pathname === '/api/v1/telemetry/events' && method === 'GET')
26
27
  return handlers.getTelemetryEvents(req);
27
- if ((pathname === '/api/telemetry/errors' || pathname === '/api/v1/telemetry/errors') && method === 'GET')
28
+ if (pathname === '/api/v1/telemetry/errors' && method === 'GET')
28
29
  return handlers.getTelemetryErrors(req);
29
- if ((pathname === '/api/telemetry/traces' || pathname === '/api/v1/telemetry/traces') && method === 'GET')
30
+ if (pathname === '/api/v1/telemetry/traces' && method === 'GET')
30
31
  return handlers.getTelemetryTraces(req);
31
- if ((pathname === '/api/telemetry/metrics' || pathname === '/api/v1/telemetry/metrics') && method === 'GET')
32
+ if (pathname === '/api/v1/telemetry/metrics' && method === 'GET')
32
33
  return handlers.getTelemetryMetrics(req);
33
- if ((pathname === '/api/telemetry/stream' || pathname === '/api/v1/telemetry/stream') && method === 'GET')
34
+ if (pathname === '/api/v1/telemetry/stream' && method === 'GET')
34
35
  return handlers.createTelemetryEventStream(req);
35
- if ((pathname === '/api/telemetry/otlp/v1/traces' || pathname === '/api/v1/telemetry/otlp/v1/traces') && method === 'GET')
36
+ if (pathname === '/api/v1/telemetry/otlp/v1/traces' && method === 'GET')
36
37
  return handlers.getTelemetryOtlpTraces(req);
37
- if ((pathname === '/api/telemetry/otlp/v1/logs' || pathname === '/api/v1/telemetry/otlp/v1/logs') && method === 'GET')
38
+ if (pathname === '/api/v1/telemetry/otlp/v1/logs' && method === 'GET')
38
39
  return handlers.getTelemetryOtlpLogs(req);
39
- if ((pathname === '/api/telemetry/otlp/v1/metrics' || pathname === '/api/v1/telemetry/otlp/v1/metrics') && method === 'GET')
40
+ if (pathname === '/api/v1/telemetry/otlp/v1/metrics' && method === 'GET')
40
41
  return handlers.getTelemetryOtlpMetrics(req);
42
+ if (pathname === '/api/v1/telemetry/otlp/v1/logs' && method === 'POST')
43
+ return handlers.postTelemetryOtlpLogs(req);
44
+ if (pathname === '/api/v1/telemetry/otlp/v1/traces' && method === 'POST')
45
+ return handlers.postTelemetryOtlpTraces(req);
46
+ if (pathname === '/api/v1/telemetry/otlp/v1/metrics' && method === 'POST')
47
+ return handlers.postTelemetryOtlpMetrics(req);
41
48
  if (pathname === '/api/control-plane/methods' && method === 'GET')
42
49
  return handlers.getGatewayMethods(url);
43
50
  const gatewayMethodInvokeMatch = pathname.match(/^\/api\/control-plane\/methods\/([^/]+)\/invoke$/);
@@ -145,8 +152,10 @@ export async function dispatchOperatorRoutes(req, handlers) {
145
152
  const channelPolicyMatch = pathname.match(/^\/api\/channels\/policies\/([^/]+)$/);
146
153
  if (channelPolicyMatch && method === 'POST')
147
154
  return handlers.postChannelPolicy(channelPolicyMatch[1], req);
155
+ if (channelPolicyMatch && method === 'PATCH')
156
+ return handlers.patchChannelPolicy(channelPolicyMatch[1], req);
148
157
  if (pathname === '/api/channels/policies/audit' && method === 'GET') {
149
- const limit = Number(url.searchParams.get('limit') ?? 100);
158
+ const limit = readBoundedPositiveInteger(url.searchParams.get('limit'), 100);
150
159
  return handlers.getChannelPolicyAudit(limit);
151
160
  }
152
161
  if (pathname === '/api/channels/status' && method === 'GET')
@@ -193,9 +202,7 @@ export async function dispatchOperatorRoutes(req, handlers) {
193
202
  if (approvalActionMatch && method === 'POST') {
194
203
  return handlers.approvalAction(approvalActionMatch[1], approvalActionMatch[2], req);
195
204
  }
196
- if (pathname === '/api/remote' && method === 'GET')
197
- return handlers.getRemote();
198
- if ((pathname === '/api/remote/node-host/contract' || pathname === '/api/remote/device/contract') && method === 'GET') {
205
+ if (pathname === '/api/remote/node-host/contract' && method === 'GET') {
199
206
  return handlers.getRemoteNodeHostContract();
200
207
  }
201
208
  if (pathname === '/api/health' && method === 'GET')
@@ -212,6 +219,8 @@ export async function dispatchOperatorRoutes(req, handlers) {
212
219
  return handlers.getProvider(decodeURIComponent(providerMatch[1]));
213
220
  if (pathname === '/api/settings' && method === 'GET')
214
221
  return handlers.getSettings();
222
+ if (pathname === '/api/security-settings' && method === 'GET')
223
+ return handlers.getSecuritySettings();
215
224
  if (pathname === '/api/continuity' && method === 'GET')
216
225
  return handlers.getContinuity();
217
226
  if (pathname === '/api/worktrees' && method === 'GET')
@@ -252,10 +261,16 @@ export async function dispatchOperatorRoutes(req, handlers) {
252
261
  return handlers.getKnowledgeJobs();
253
262
  if (pathname === '/api/knowledge/job-runs' && method === 'GET')
254
263
  return handlers.getKnowledgeJobRuns(url);
264
+ if (pathname === '/api/knowledge/refinement/tasks' && method === 'GET')
265
+ return handlers.getKnowledgeRefinementTasks(url);
266
+ if (pathname === '/api/knowledge/refinement/run' && method === 'POST')
267
+ return handlers.postKnowledgeRunRefinement(req);
255
268
  if (pathname === '/api/knowledge/schedules' && method === 'GET')
256
269
  return handlers.getKnowledgeSchedules(url);
257
270
  if (pathname === '/api/knowledge/projections' && method === 'GET')
258
271
  return handlers.getKnowledgeProjectionTargets(url);
272
+ if (pathname === '/api/knowledge/map' && method === 'GET')
273
+ return handlers.getKnowledgeMap(url);
259
274
  if (pathname === '/api/knowledge/graphql/schema' && method === 'GET')
260
275
  return handlers.getKnowledgeGraphqlSchema();
261
276
  if (pathname === '/api/knowledge/graphql' && (method === 'GET' || method === 'POST'))
@@ -264,6 +279,8 @@ export async function dispatchOperatorRoutes(req, handlers) {
264
279
  return handlers.postKnowledgeIngestUrl(req);
265
280
  if (pathname === '/api/knowledge/ingest/artifact' && method === 'POST')
266
281
  return handlers.postKnowledgeIngestArtifact(req);
282
+ if (pathname === '/api/knowledge/ingest/browser-history' && method === 'POST')
283
+ return handlers.postKnowledgeSyncBrowserHistory(req);
267
284
  if (pathname === '/api/knowledge/ingest/bookmarks' && method === 'POST')
268
285
  return handlers.postKnowledgeImportBookmarks(req);
269
286
  if (pathname === '/api/knowledge/ingest/urls' && method === 'POST')
@@ -272,6 +289,8 @@ export async function dispatchOperatorRoutes(req, handlers) {
272
289
  return handlers.postKnowledgeIngestConnector(req);
273
290
  if (pathname === '/api/knowledge/search' && method === 'POST')
274
291
  return handlers.postKnowledgeSearch(req);
292
+ if (pathname === '/api/knowledge/ask' && method === 'POST')
293
+ return handlers.postKnowledgeAsk(req);
275
294
  if (pathname === '/api/knowledge/packet' && method === 'POST')
276
295
  return handlers.postKnowledgePacket(req);
277
296
  if (pathname === '/api/knowledge/lint' && method === 'POST')
@@ -293,6 +312,9 @@ export async function dispatchOperatorRoutes(req, handlers) {
293
312
  const knowledgeExtractionMatch = pathname.match(/^\/api\/knowledge\/extractions\/([^/]+)$/);
294
313
  if (knowledgeExtractionMatch && method === 'GET')
295
314
  return handlers.getKnowledgeExtraction(decodeURIComponent(knowledgeExtractionMatch[1]));
315
+ const knowledgeIssueReviewMatch = pathname.match(/^\/api\/knowledge\/issues\/([^/]+)\/review$/);
316
+ if (knowledgeIssueReviewMatch && method === 'POST')
317
+ return handlers.postKnowledgeReviewIssue(decodeURIComponent(knowledgeIssueReviewMatch[1]), req);
296
318
  const knowledgeCandidateDecideMatch = pathname.match(/^\/api\/knowledge\/candidates\/([^/]+)\/decide$/);
297
319
  if (knowledgeCandidateDecideMatch && method === 'POST')
298
320
  return handlers.postKnowledgeDecideCandidate(decodeURIComponent(knowledgeCandidateDecideMatch[1]), req);
@@ -311,6 +333,12 @@ export async function dispatchOperatorRoutes(req, handlers) {
311
333
  const knowledgeJobMatch = pathname.match(/^\/api\/knowledge\/jobs\/([^/]+)$/);
312
334
  if (knowledgeJobMatch && method === 'GET')
313
335
  return handlers.getKnowledgeJob(decodeURIComponent(knowledgeJobMatch[1]));
336
+ const knowledgeRefinementTaskCancelMatch = pathname.match(/^\/api\/knowledge\/refinement\/tasks\/([^/]+)\/cancel$/);
337
+ if (knowledgeRefinementTaskCancelMatch && method === 'POST')
338
+ return handlers.postKnowledgeCancelRefinementTask(decodeURIComponent(knowledgeRefinementTaskCancelMatch[1]), req);
339
+ const knowledgeRefinementTaskMatch = pathname.match(/^\/api\/knowledge\/refinement\/tasks\/([^/]+)$/);
340
+ if (knowledgeRefinementTaskMatch && method === 'GET')
341
+ return handlers.getKnowledgeRefinementTask(decodeURIComponent(knowledgeRefinementTaskMatch[1]));
314
342
  const knowledgeScheduleEnabledMatch = pathname.match(/^\/api\/knowledge\/schedules\/([^/]+)\/enabled$/);
315
343
  if (knowledgeScheduleEnabledMatch && method === 'POST')
316
344
  return handlers.postKnowledgeSetScheduleEnabled(decodeURIComponent(knowledgeScheduleEnabledMatch[1]), req);
@@ -328,6 +356,8 @@ export async function dispatchOperatorRoutes(req, handlers) {
328
356
  return handlers.getVoiceProviders();
329
357
  if (pathname === '/api/voice/voices' && method === 'GET')
330
358
  return handlers.getVoiceVoices(url);
359
+ if (pathname === '/api/voice/tts/stream' && method === 'POST')
360
+ return handlers.postVoiceTtsStream(req);
331
361
  if (pathname === '/api/voice/tts' && method === 'POST')
332
362
  return handlers.postVoiceTts(req);
333
363
  if (pathname === '/api/voice/stt' && method === 'POST')
@@ -381,6 +411,10 @@ export async function dispatchOperatorRoutes(req, handlers) {
381
411
  return handlers.deleteLocalAuthSession(decodeURIComponent(sessionMatch[1]));
382
412
  if (pathname === '/api/local-auth/bootstrap-file' && method === 'DELETE')
383
413
  return handlers.deleteBootstrapFile();
414
+ if (pathname === '/api/runtime/scheduler' && method === 'GET')
415
+ return handlers.getSchedulerCapacity();
416
+ if (pathname === '/api/runtime/metrics' && method === 'GET')
417
+ return handlers.getRuntimeMetrics();
384
418
  if (pathname === '/api/panels' && method === 'GET')
385
419
  return handlers.getPanels();
386
420
  if (pathname === '/api/panels/open' && method === 'POST')
@@ -0,0 +1,3 @@
1
+ export type OtlpProtobufKind = 'logs' | 'traces' | 'metrics';
2
+ export declare function decodeOtlpProtobuf(kind: OtlpProtobufKind, bytes: Uint8Array): Record<string, unknown>;
3
+ //# sourceMappingURL=otlp-protobuf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otlp-protobuf.d.ts","sourceRoot":"","sources":["../src/otlp-protobuf.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAi6B7D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASrG"}