@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.
Files changed (72) hide show
  1. package/README.md +2 -2
  2. package/dist/api-router.d.ts +4 -2
  3. package/dist/api-router.d.ts.map +1 -1
  4. package/dist/api-router.js +18 -10
  5. package/dist/artifact-upload.d.ts +9 -9
  6. package/dist/artifact-upload.d.ts.map +1 -1
  7. package/dist/artifact-upload.js +27 -19
  8. package/dist/auth-helpers.d.ts +9 -0
  9. package/dist/auth-helpers.d.ts.map +1 -0
  10. package/dist/auth-helpers.js +10 -0
  11. package/dist/automation.js +10 -10
  12. package/dist/channel-route-types.d.ts +22 -23
  13. package/dist/channel-route-types.d.ts.map +1 -1
  14. package/dist/channel-routes.d.ts.map +1 -1
  15. package/dist/channel-routes.js +37 -42
  16. package/dist/context.d.ts +27 -27
  17. package/dist/context.d.ts.map +1 -1
  18. package/dist/control-routes.d.ts +12 -13
  19. package/dist/control-routes.d.ts.map +1 -1
  20. package/dist/control-routes.js +55 -26
  21. package/dist/error-response.d.ts +10 -3
  22. package/dist/error-response.d.ts.map +1 -1
  23. package/dist/error-response.js +102 -11
  24. package/dist/http-policy.d.ts +3 -4
  25. package/dist/http-policy.d.ts.map +1 -1
  26. package/dist/http-policy.js +2 -1
  27. package/dist/index.d.ts +11 -8
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +2 -1
  30. package/dist/integration-routes.d.ts +1 -1
  31. package/dist/integration-routes.d.ts.map +1 -1
  32. package/dist/integration-routes.js +72 -33
  33. package/dist/knowledge-refinement-routes.d.ts.map +1 -1
  34. package/dist/knowledge-refinement-routes.js +22 -15
  35. package/dist/knowledge-route-types.d.ts +16 -15
  36. package/dist/knowledge-route-types.d.ts.map +1 -1
  37. package/dist/knowledge-routes.d.ts.map +1 -1
  38. package/dist/knowledge-routes.js +144 -89
  39. package/dist/media-route-types.d.ts +2 -1
  40. package/dist/media-route-types.d.ts.map +1 -1
  41. package/dist/media-routes.d.ts.map +1 -1
  42. package/dist/media-routes.js +119 -55
  43. package/dist/operator.d.ts +16 -0
  44. package/dist/operator.d.ts.map +1 -1
  45. package/dist/operator.js +105 -61
  46. package/dist/otlp-protobuf.d.ts.map +1 -1
  47. package/dist/otlp-protobuf.js +28 -10
  48. package/dist/remote-routes.d.ts +9 -3
  49. package/dist/remote-routes.d.ts.map +1 -1
  50. package/dist/remote-routes.js +259 -163
  51. package/dist/route-helpers.d.ts +13 -2
  52. package/dist/route-helpers.d.ts.map +1 -1
  53. package/dist/route-helpers.js +38 -1
  54. package/dist/runtime-automation-routes.d.ts.map +1 -1
  55. package/dist/runtime-automation-routes.js +88 -54
  56. package/dist/runtime-route-types.d.ts +87 -93
  57. package/dist/runtime-route-types.d.ts.map +1 -1
  58. package/dist/runtime-session-routes.d.ts +6 -4
  59. package/dist/runtime-session-routes.d.ts.map +1 -1
  60. package/dist/runtime-session-routes.js +132 -88
  61. package/dist/sessions.js +3 -3
  62. package/dist/system-route-types.d.ts +25 -24
  63. package/dist/system-route-types.d.ts.map +1 -1
  64. package/dist/system-routes.d.ts +1 -1
  65. package/dist/system-routes.d.ts.map +1 -1
  66. package/dist/system-routes.js +126 -92
  67. package/dist/tasks.d.ts.map +1 -1
  68. package/dist/tasks.js +2 -0
  69. package/dist/telemetry-routes.d.ts +14 -14
  70. package/dist/telemetry-routes.d.ts.map +1 -1
  71. package/dist/telemetry-routes.js +54 -29
  72. package/package.json +5 -4
package/dist/operator.js CHANGED
@@ -1,10 +1,58 @@
1
1
  import { readBoundedPositiveInteger } from './route-helpers.js';
2
+ /**
3
+ * Thrown when a URL path segment contains malformed percent-encoded sequences.
4
+ * Caught at the dispatch boundary to return a 400 INVALID_PATH_ENCODING response.
5
+ */
6
+ class InvalidPathEncodingError extends Error {
7
+ constructor() { super('INVALID_PATH_ENCODING'); }
8
+ }
9
+ /**
10
+ * Decode a URL path segment. Throws InvalidPathEncodingError on malformed
11
+ * percent-encoded sequences (e.g. `%E0%A4`) instead of passing null downstream.
12
+ */
13
+ function safeDecodeURIComponent(segment) {
14
+ try {
15
+ return decodeURIComponent(segment);
16
+ }
17
+ catch {
18
+ throw new InvalidPathEncodingError();
19
+ }
20
+ }
21
+ const INVALID_ENCODING_RESPONSE = Response.json({ error: 'INVALID_PATH_ENCODING', code: 'INVALID_PATH_ENCODING' }, { status: 400 });
22
+ /**
23
+ * Route-level authentication is enforced inside each handler, not at the
24
+ * dispatcher level. Handler auth requirements by category:
25
+ *
26
+ * - READ-ONLY routes (status, providers, settings, continuity, intelligence,
27
+ * worktrees, watchers, approvals, telemetry snapshot) — require admin or
28
+ * authenticated session per handler implementation.
29
+ * - STATE-CHANGING routes (service install/start/stop, route bindings,
30
+ * automation jobs, knowledge ingest) — always `withAdmin(context, req, ...)`.
31
+ * - SCHEDULER/RUNTIME routes (getSchedulerCapacity, getRuntimeMetrics) —
32
+ * require admin per handler implementation.
33
+ *
34
+ * Dispatcher does not short-circuit unauthenticated requests; all auth
35
+ * enforcement lives in the handler factories (system-routes.ts,
36
+ * integration-routes.ts, runtime-automation-routes.ts, etc.).
37
+ */
2
38
  export async function dispatchOperatorRoutes(req, handlers) {
39
+ try {
40
+ return await dispatchOperatorRoutesInner(req, handlers);
41
+ }
42
+ catch (e) {
43
+ if (e instanceof InvalidPathEncodingError)
44
+ return INVALID_ENCODING_RESPONSE;
45
+ throw e;
46
+ }
47
+ }
48
+ async function dispatchOperatorRoutesInner(req, handlers) {
3
49
  const url = new URL(req.url);
4
50
  const { pathname } = url;
5
51
  const method = req.method;
52
+ if (pathname === '/login' && method === 'POST')
53
+ return handlers.postLogin(req);
6
54
  if (pathname === '/status' && method === 'GET')
7
- return handlers.getStatus();
55
+ return handlers.getStatus(req);
8
56
  if (pathname === '/api/control-plane/auth' && method === 'GET')
9
57
  return handlers.getCurrentAuth(req);
10
58
  if (pathname === '/api/control-plane' && method === 'GET')
@@ -49,10 +97,10 @@ export async function dispatchOperatorRoutes(req, handlers) {
49
97
  return handlers.getGatewayMethods(url);
50
98
  const gatewayMethodInvokeMatch = pathname.match(/^\/api\/control-plane\/methods\/([^/]+)\/invoke$/);
51
99
  if (gatewayMethodInvokeMatch && method === 'POST')
52
- return handlers.invokeGatewayMethod(decodeURIComponent(gatewayMethodInvokeMatch[1]), req);
100
+ return handlers.invokeGatewayMethod(safeDecodeURIComponent(gatewayMethodInvokeMatch[1]), req);
53
101
  const gatewayMethodMatch = pathname.match(/^\/api\/control-plane\/methods\/([^/]+)$/);
54
102
  if (gatewayMethodMatch && method === 'GET')
55
- return handlers.getGatewayMethod(decodeURIComponent(gatewayMethodMatch[1]));
103
+ return handlers.getGatewayMethod(safeDecodeURIComponent(gatewayMethodMatch[1]));
56
104
  if (pathname === '/api/control-plane/events/catalog' && method === 'GET')
57
105
  return handlers.getGatewayEvents(url);
58
106
  if (pathname === '/api/control-plane/events' && method === 'GET')
@@ -73,79 +121,75 @@ export async function dispatchOperatorRoutes(req, handlers) {
73
121
  return handlers.getChannelActions();
74
122
  const channelAccountDefaultActionMatch = pathname.match(/^\/api\/channels\/accounts\/([^/]+)\/actions\/([^/]+)$/);
75
123
  if (channelAccountDefaultActionMatch && method === 'POST') {
76
- return handlers.postChannelAccountAction(decodeURIComponent(channelAccountDefaultActionMatch[1]), null, decodeURIComponent(channelAccountDefaultActionMatch[2]), req);
124
+ return handlers.postChannelAccountAction(safeDecodeURIComponent(channelAccountDefaultActionMatch[1]), null, safeDecodeURIComponent(channelAccountDefaultActionMatch[2]), req);
77
125
  }
78
126
  const channelAccountActionMatch = pathname.match(/^\/api\/channels\/accounts\/([^/]+)\/([^/]+)\/actions\/([^/]+)$/);
79
127
  if (channelAccountActionMatch && method === 'POST') {
80
- return handlers.postChannelAccountAction(decodeURIComponent(channelAccountActionMatch[1]), decodeURIComponent(channelAccountActionMatch[2]), decodeURIComponent(channelAccountActionMatch[3]), req);
128
+ return handlers.postChannelAccountAction(safeDecodeURIComponent(channelAccountActionMatch[1]), safeDecodeURIComponent(channelAccountActionMatch[2]), safeDecodeURIComponent(channelAccountActionMatch[3]), req);
81
129
  }
82
130
  const channelSetupMatch = pathname.match(/^\/api\/channels\/setup\/([^/]+)$/);
83
131
  if (channelSetupMatch && method === 'GET') {
84
- return handlers.getChannelSetupSchema(decodeURIComponent(channelSetupMatch[1]), url);
132
+ return handlers.getChannelSetupSchema(safeDecodeURIComponent(channelSetupMatch[1]), url);
85
133
  }
86
134
  const channelDoctorMatch = pathname.match(/^\/api\/channels\/doctor\/([^/]+)$/);
87
135
  if (channelDoctorMatch && method === 'GET') {
88
- return handlers.getChannelDoctor(decodeURIComponent(channelDoctorMatch[1]), url);
136
+ return handlers.getChannelDoctor(safeDecodeURIComponent(channelDoctorMatch[1]), url);
89
137
  }
90
138
  const channelRepairActionsMatch = pathname.match(/^\/api\/channels\/repair-actions\/([^/]+)$/);
91
139
  if (channelRepairActionsMatch && method === 'GET') {
92
- return handlers.getChannelRepairActions(decodeURIComponent(channelRepairActionsMatch[1]), url);
93
- }
94
- const channelLifecycleMigrateMatch = pathname.match(/^\/api\/channels\/lifecycle\/([^/]+)\/migrate$/);
95
- if (channelLifecycleMigrateMatch && method === 'POST') {
96
- return handlers.postChannelLifecycleMigrate(decodeURIComponent(channelLifecycleMigrateMatch[1]), req);
140
+ return handlers.getChannelRepairActions(safeDecodeURIComponent(channelRepairActionsMatch[1]), url);
97
141
  }
98
142
  const channelLifecycleMatch = pathname.match(/^\/api\/channels\/lifecycle\/([^/]+)$/);
99
143
  if (channelLifecycleMatch && method === 'GET') {
100
- return handlers.getChannelLifecycle(decodeURIComponent(channelLifecycleMatch[1]), url);
144
+ return handlers.getChannelLifecycle(safeDecodeURIComponent(channelLifecycleMatch[1]), url);
101
145
  }
102
146
  const channelResolveTargetMatch = pathname.match(/^\/api\/channels\/targets\/([^/]+)\/resolve$/);
103
147
  if (channelResolveTargetMatch && method === 'POST') {
104
- return handlers.postChannelResolveTarget(decodeURIComponent(channelResolveTargetMatch[1]), req);
148
+ return handlers.postChannelResolveTarget(safeDecodeURIComponent(channelResolveTargetMatch[1]), req);
105
149
  }
106
150
  const channelAuthorizeMatch = pathname.match(/^\/api\/channels\/authorize\/([^/]+)$/);
107
151
  if (channelAuthorizeMatch && method === 'POST') {
108
- return handlers.postChannelAuthorize(decodeURIComponent(channelAuthorizeMatch[1]), req);
152
+ return handlers.postChannelAuthorize(safeDecodeURIComponent(channelAuthorizeMatch[1]), req);
109
153
  }
110
154
  const channelAllowlistResolveMatch = pathname.match(/^\/api\/channels\/allowlist\/([^/]+)\/resolve$/);
111
155
  if (channelAllowlistResolveMatch && method === 'POST') {
112
- return handlers.postChannelAllowlistResolve(decodeURIComponent(channelAllowlistResolveMatch[1]), req);
156
+ return handlers.postChannelAllowlistResolve(safeDecodeURIComponent(channelAllowlistResolveMatch[1]), req);
113
157
  }
114
158
  const channelAllowlistEditMatch = pathname.match(/^\/api\/channels\/allowlist\/([^/]+)\/edit$/);
115
159
  if (channelAllowlistEditMatch && method === 'POST') {
116
- return handlers.postChannelAllowlistEdit(decodeURIComponent(channelAllowlistEditMatch[1]), req);
160
+ return handlers.postChannelAllowlistEdit(safeDecodeURIComponent(channelAllowlistEditMatch[1]), req);
117
161
  }
118
162
  const channelAccountMatch = pathname.match(/^\/api\/channels\/accounts\/([^/]+)\/([^/]+)$/);
119
163
  if (channelAccountMatch && method === 'GET') {
120
- return handlers.getChannelAccount(decodeURIComponent(channelAccountMatch[1]), decodeURIComponent(channelAccountMatch[2]));
164
+ return handlers.getChannelAccount(safeDecodeURIComponent(channelAccountMatch[1]), safeDecodeURIComponent(channelAccountMatch[2]));
121
165
  }
122
166
  const channelActionPostMatch = pathname.match(/^\/api\/channels\/actions\/([^/]+)\/([^/]+)$/);
123
167
  if (channelActionPostMatch && method === 'POST') {
124
- return handlers.postChannelAction(decodeURIComponent(channelActionPostMatch[1]), decodeURIComponent(channelActionPostMatch[2]), req);
168
+ return handlers.postChannelAction(safeDecodeURIComponent(channelActionPostMatch[1]), safeDecodeURIComponent(channelActionPostMatch[2]), req);
125
169
  }
126
170
  const channelSurfaceAccountsMatch = pathname.match(/^\/api\/channels\/accounts\/([^/]+)$/);
127
171
  if (channelSurfaceAccountsMatch && method === 'GET') {
128
- return handlers.getChannelSurfaceAccounts(decodeURIComponent(channelSurfaceAccountsMatch[1]));
172
+ return handlers.getChannelSurfaceAccounts(safeDecodeURIComponent(channelSurfaceAccountsMatch[1]));
129
173
  }
130
174
  const channelSurfaceCapabilitiesMatch = pathname.match(/^\/api\/channels\/capabilities\/([^/]+)$/);
131
175
  if (channelSurfaceCapabilitiesMatch && method === 'GET') {
132
- return handlers.getChannelSurfaceCapabilities(decodeURIComponent(channelSurfaceCapabilitiesMatch[1]));
176
+ return handlers.getChannelSurfaceCapabilities(safeDecodeURIComponent(channelSurfaceCapabilitiesMatch[1]));
133
177
  }
134
178
  const channelSurfaceToolsMatch = pathname.match(/^\/api\/channels\/tools\/([^/]+)$/);
135
179
  if (channelSurfaceToolsMatch && method === 'GET') {
136
- return handlers.getChannelSurfaceTools(decodeURIComponent(channelSurfaceToolsMatch[1]));
180
+ return handlers.getChannelSurfaceTools(safeDecodeURIComponent(channelSurfaceToolsMatch[1]));
137
181
  }
138
182
  const channelSurfaceAgentToolsMatch = pathname.match(/^\/api\/channels\/agent-tools\/([^/]+)$/);
139
183
  if (channelSurfaceAgentToolsMatch && method === 'GET') {
140
- return handlers.getChannelSurfaceAgentTools(decodeURIComponent(channelSurfaceAgentToolsMatch[1]));
184
+ return handlers.getChannelSurfaceAgentTools(safeDecodeURIComponent(channelSurfaceAgentToolsMatch[1]));
141
185
  }
142
186
  const channelToolPostMatch = pathname.match(/^\/api\/channels\/tools\/([^/]+)\/([^/]+)$/);
143
187
  if (channelToolPostMatch && method === 'POST') {
144
- return handlers.postChannelTool(decodeURIComponent(channelToolPostMatch[1]), decodeURIComponent(channelToolPostMatch[2]), req);
188
+ return handlers.postChannelTool(safeDecodeURIComponent(channelToolPostMatch[1]), safeDecodeURIComponent(channelToolPostMatch[2]), req);
145
189
  }
146
190
  const channelSurfaceActionsMatch = pathname.match(/^\/api\/channels\/actions\/([^/]+)$/);
147
191
  if (channelSurfaceActionsMatch && method === 'GET') {
148
- return handlers.getChannelSurfaceActions(decodeURIComponent(channelSurfaceActionsMatch[1]));
192
+ return handlers.getChannelSurfaceActions(safeDecodeURIComponent(channelSurfaceActionsMatch[1]));
149
193
  }
150
194
  if (pathname === '/api/channels/policies' && method === 'GET')
151
195
  return handlers.getChannelPolicies();
@@ -171,31 +215,31 @@ export async function dispatchOperatorRoutes(req, handlers) {
171
215
  if (watcherUpdateMatch && method === 'PATCH')
172
216
  return handlers.patchWatcher(watcherUpdateMatch[1], req);
173
217
  if (watcherUpdateMatch && method === 'DELETE')
174
- return handlers.deleteWatcher(watcherUpdateMatch[1]);
218
+ return handlers.deleteWatcher(watcherUpdateMatch[1], req);
175
219
  const watcherActionMatch = pathname.match(/^\/api\/watchers\/([^/]+)\/(start|stop|run)$/);
176
220
  if (watcherActionMatch && method === 'POST')
177
- return handlers.watcherAction(watcherActionMatch[1], watcherActionMatch[2]);
221
+ return handlers.watcherAction(watcherActionMatch[1], watcherActionMatch[2], req);
178
222
  if (pathname === '/api/service/status' && method === 'GET')
179
223
  return handlers.getServiceStatus();
180
224
  if (pathname === '/api/service/install' && method === 'POST')
181
- return handlers.installService();
225
+ return handlers.installService(req);
182
226
  if (pathname === '/api/service/start' && method === 'POST')
183
- return handlers.startService();
227
+ return handlers.startService(req);
184
228
  if (pathname === '/api/service/stop' && method === 'POST')
185
- return handlers.stopService();
229
+ return handlers.stopService(req);
186
230
  if (pathname === '/api/service/restart' && method === 'POST')
187
- return handlers.restartService();
231
+ return handlers.restartService(req);
188
232
  if (pathname === '/api/service/uninstall' && method === 'POST')
189
- return handlers.uninstallService();
233
+ return handlers.uninstallService(req);
190
234
  if (pathname === '/api/routes/bindings' && method === 'GET')
191
- return handlers.getRouteBindings();
235
+ return handlers.getRouteBindings(req);
192
236
  if (pathname === '/api/routes/bindings' && method === 'POST')
193
237
  return handlers.postRouteBinding(req);
194
238
  const routeBindingMatch = pathname.match(/^\/api\/routes\/bindings\/([^/]+)$/);
195
239
  if (routeBindingMatch && method === 'PATCH')
196
240
  return handlers.patchRouteBinding(routeBindingMatch[1], req);
197
241
  if (routeBindingMatch && method === 'DELETE')
198
- return handlers.deleteRouteBinding(routeBindingMatch[1]);
242
+ return handlers.deleteRouteBinding(routeBindingMatch[1], req);
199
243
  if (pathname === '/api/approvals' && method === 'GET')
200
244
  return handlers.getApprovals();
201
245
  const approvalActionMatch = pathname.match(/^\/api\/approvals\/([^/]+)\/(claim|approve|deny|cancel)$/);
@@ -213,10 +257,10 @@ export async function dispatchOperatorRoutes(req, handlers) {
213
257
  return handlers.getProviders();
214
258
  const providerUsageMatch = pathname.match(/^\/api\/providers\/([^/]+)\/usage$/);
215
259
  if (providerUsageMatch && method === 'GET')
216
- return handlers.getProviderUsage(decodeURIComponent(providerUsageMatch[1]));
260
+ return handlers.getProviderUsage(safeDecodeURIComponent(providerUsageMatch[1]));
217
261
  const providerMatch = pathname.match(/^\/api\/providers\/([^/]+)$/);
218
262
  if (providerMatch && method === 'GET')
219
- return handlers.getProvider(decodeURIComponent(providerMatch[1]));
263
+ return handlers.getProvider(safeDecodeURIComponent(providerMatch[1]));
220
264
  if (pathname === '/api/settings' && method === 'GET')
221
265
  return handlers.getSettings();
222
266
  if (pathname === '/api/security-settings' && method === 'GET')
@@ -305,51 +349,51 @@ export async function dispatchOperatorRoutes(req, handlers) {
305
349
  return handlers.postKnowledgeMaterializeProjection(req);
306
350
  const knowledgeConnectorDoctorMatch = pathname.match(/^\/api\/knowledge\/connectors\/([^/]+)\/doctor$/);
307
351
  if (knowledgeConnectorDoctorMatch && method === 'GET')
308
- return handlers.getKnowledgeConnectorDoctor(decodeURIComponent(knowledgeConnectorDoctorMatch[1]));
352
+ return handlers.getKnowledgeConnectorDoctor(safeDecodeURIComponent(knowledgeConnectorDoctorMatch[1]));
309
353
  const knowledgeConnectorMatch = pathname.match(/^\/api\/knowledge\/connectors\/([^/]+)$/);
310
354
  if (knowledgeConnectorMatch && method === 'GET')
311
- return handlers.getKnowledgeConnector(decodeURIComponent(knowledgeConnectorMatch[1]));
355
+ return handlers.getKnowledgeConnector(safeDecodeURIComponent(knowledgeConnectorMatch[1]));
312
356
  const knowledgeExtractionMatch = pathname.match(/^\/api\/knowledge\/extractions\/([^/]+)$/);
313
357
  if (knowledgeExtractionMatch && method === 'GET')
314
- return handlers.getKnowledgeExtraction(decodeURIComponent(knowledgeExtractionMatch[1]));
358
+ return handlers.getKnowledgeExtraction(safeDecodeURIComponent(knowledgeExtractionMatch[1]));
315
359
  const knowledgeIssueReviewMatch = pathname.match(/^\/api\/knowledge\/issues\/([^/]+)\/review$/);
316
360
  if (knowledgeIssueReviewMatch && method === 'POST')
317
- return handlers.postKnowledgeReviewIssue(decodeURIComponent(knowledgeIssueReviewMatch[1]), req);
361
+ return handlers.postKnowledgeReviewIssue(safeDecodeURIComponent(knowledgeIssueReviewMatch[1]), req);
318
362
  const knowledgeCandidateDecideMatch = pathname.match(/^\/api\/knowledge\/candidates\/([^/]+)\/decide$/);
319
363
  if (knowledgeCandidateDecideMatch && method === 'POST')
320
- return handlers.postKnowledgeDecideCandidate(decodeURIComponent(knowledgeCandidateDecideMatch[1]), req);
364
+ return handlers.postKnowledgeDecideCandidate(safeDecodeURIComponent(knowledgeCandidateDecideMatch[1]), req);
321
365
  const knowledgeCandidateMatch = pathname.match(/^\/api\/knowledge\/candidates\/([^/]+)$/);
322
366
  if (knowledgeCandidateMatch && method === 'GET')
323
- return handlers.getKnowledgeCandidate(decodeURIComponent(knowledgeCandidateMatch[1]));
367
+ return handlers.getKnowledgeCandidate(safeDecodeURIComponent(knowledgeCandidateMatch[1]));
324
368
  const knowledgeReportMatch = pathname.match(/^\/api\/knowledge\/reports\/([^/]+)$/);
325
369
  if (knowledgeReportMatch && method === 'GET')
326
- return handlers.getKnowledgeReport(decodeURIComponent(knowledgeReportMatch[1]));
370
+ return handlers.getKnowledgeReport(safeDecodeURIComponent(knowledgeReportMatch[1]));
327
371
  const knowledgeSourceExtractionMatch = pathname.match(/^\/api\/knowledge\/sources\/([^/]+)\/extraction$/);
328
372
  if (knowledgeSourceExtractionMatch && method === 'GET')
329
- return handlers.getKnowledgeSourceExtraction(decodeURIComponent(knowledgeSourceExtractionMatch[1]));
373
+ return handlers.getKnowledgeSourceExtraction(safeDecodeURIComponent(knowledgeSourceExtractionMatch[1]));
330
374
  const knowledgeJobRunMatch = pathname.match(/^\/api\/knowledge\/jobs\/([^/]+)\/run$/);
331
375
  if (knowledgeJobRunMatch && method === 'POST')
332
- return handlers.postKnowledgeRunJob(decodeURIComponent(knowledgeJobRunMatch[1]), req);
376
+ return handlers.postKnowledgeRunJob(safeDecodeURIComponent(knowledgeJobRunMatch[1]), req);
333
377
  const knowledgeJobMatch = pathname.match(/^\/api\/knowledge\/jobs\/([^/]+)$/);
334
378
  if (knowledgeJobMatch && method === 'GET')
335
- return handlers.getKnowledgeJob(decodeURIComponent(knowledgeJobMatch[1]));
379
+ return handlers.getKnowledgeJob(safeDecodeURIComponent(knowledgeJobMatch[1]));
336
380
  const knowledgeRefinementTaskCancelMatch = pathname.match(/^\/api\/knowledge\/refinement\/tasks\/([^/]+)\/cancel$/);
337
381
  if (knowledgeRefinementTaskCancelMatch && method === 'POST')
338
- return handlers.postKnowledgeCancelRefinementTask(decodeURIComponent(knowledgeRefinementTaskCancelMatch[1]), req);
382
+ return handlers.postKnowledgeCancelRefinementTask(safeDecodeURIComponent(knowledgeRefinementTaskCancelMatch[1]), req);
339
383
  const knowledgeRefinementTaskMatch = pathname.match(/^\/api\/knowledge\/refinement\/tasks\/([^/]+)$/);
340
384
  if (knowledgeRefinementTaskMatch && method === 'GET')
341
- return handlers.getKnowledgeRefinementTask(decodeURIComponent(knowledgeRefinementTaskMatch[1]));
385
+ return handlers.getKnowledgeRefinementTask(safeDecodeURIComponent(knowledgeRefinementTaskMatch[1]));
342
386
  const knowledgeScheduleEnabledMatch = pathname.match(/^\/api\/knowledge\/schedules\/([^/]+)\/enabled$/);
343
387
  if (knowledgeScheduleEnabledMatch && method === 'POST')
344
- return handlers.postKnowledgeSetScheduleEnabled(decodeURIComponent(knowledgeScheduleEnabledMatch[1]), req);
388
+ return handlers.postKnowledgeSetScheduleEnabled(safeDecodeURIComponent(knowledgeScheduleEnabledMatch[1]), req);
345
389
  const knowledgeScheduleMatch = pathname.match(/^\/api\/knowledge\/schedules\/([^/]+)$/);
346
390
  if (knowledgeScheduleMatch && method === 'GET')
347
- return handlers.getKnowledgeSchedule(decodeURIComponent(knowledgeScheduleMatch[1]));
391
+ return handlers.getKnowledgeSchedule(safeDecodeURIComponent(knowledgeScheduleMatch[1]));
348
392
  if (knowledgeScheduleMatch && method === 'DELETE')
349
- return handlers.deleteKnowledgeSchedule(decodeURIComponent(knowledgeScheduleMatch[1]), req);
393
+ return handlers.deleteKnowledgeSchedule(safeDecodeURIComponent(knowledgeScheduleMatch[1]), req);
350
394
  const knowledgeItemMatch = pathname.match(/^\/api\/knowledge\/items\/([^/]+)$/);
351
395
  if (knowledgeItemMatch && method === 'GET')
352
- return handlers.getKnowledgeItem(decodeURIComponent(knowledgeItemMatch[1]));
396
+ return handlers.getKnowledgeItem(safeDecodeURIComponent(knowledgeItemMatch[1]));
353
397
  if (pathname === '/api/voice' && method === 'GET')
354
398
  return handlers.getVoiceStatus();
355
399
  if (pathname === '/api/voice/providers' && method === 'GET')
@@ -374,10 +418,10 @@ export async function dispatchOperatorRoutes(req, handlers) {
374
418
  return handlers.postArtifact(req);
375
419
  const artifactContentMatch = pathname.match(/^\/api\/artifacts\/([^/]+)\/content$/);
376
420
  if (artifactContentMatch && method === 'GET')
377
- return handlers.getArtifactContent(decodeURIComponent(artifactContentMatch[1]), req);
421
+ return handlers.getArtifactContent(safeDecodeURIComponent(artifactContentMatch[1]), req);
378
422
  const artifactMatch = pathname.match(/^\/api\/artifacts\/([^/]+)$/);
379
423
  if (artifactMatch && method === 'GET')
380
- return handlers.getArtifact(decodeURIComponent(artifactMatch[1]));
424
+ return handlers.getArtifact(safeDecodeURIComponent(artifactMatch[1]));
381
425
  if (pathname === '/api/media/providers' && method === 'GET')
382
426
  return handlers.getMediaProviders();
383
427
  if (pathname === '/api/media/analyze' && method === 'POST')
@@ -397,22 +441,22 @@ export async function dispatchOperatorRoutes(req, handlers) {
397
441
  if (pathname === '/api/multimodal/writeback' && method === 'POST')
398
442
  return handlers.postMultimodalWriteback(req);
399
443
  if (pathname === '/api/local-auth' && method === 'GET')
400
- return handlers.getLocalAuth();
444
+ return handlers.getLocalAuth(req);
401
445
  if (pathname === '/api/local-auth/users' && method === 'POST')
402
446
  return handlers.postLocalAuthUser(req);
403
447
  const userMatch = pathname.match(/^\/api\/local-auth\/users\/([^/]+)$/);
404
448
  if (userMatch && method === 'DELETE')
405
- return handlers.deleteLocalAuthUser(decodeURIComponent(userMatch[1]));
449
+ return handlers.deleteLocalAuthUser(safeDecodeURIComponent(userMatch[1]), req);
406
450
  const passwordMatch = pathname.match(/^\/api\/local-auth\/users\/([^/]+)\/password$/);
407
451
  if (passwordMatch && method === 'POST')
408
- return handlers.postLocalAuthPassword(decodeURIComponent(passwordMatch[1]), req);
452
+ return handlers.postLocalAuthPassword(safeDecodeURIComponent(passwordMatch[1]), req);
409
453
  const sessionMatch = pathname.match(/^\/api\/local-auth\/sessions\/([^/]+)$/);
410
454
  if (sessionMatch && method === 'DELETE')
411
- return handlers.deleteLocalAuthSession(decodeURIComponent(sessionMatch[1]));
455
+ return handlers.deleteLocalAuthSession(safeDecodeURIComponent(sessionMatch[1]), req);
412
456
  if (pathname === '/api/local-auth/bootstrap-file' && method === 'DELETE')
413
- return handlers.deleteBootstrapFile();
457
+ return handlers.deleteBootstrapFile(req);
414
458
  if (pathname === '/api/runtime/scheduler' && method === 'GET')
415
- return handlers.getSchedulerCapacity();
459
+ return handlers.getSchedulerCapacity(req);
416
460
  if (pathname === '/api/runtime/metrics' && method === 'GET')
417
461
  return handlers.getRuntimeMetrics();
418
462
  if (pathname === '/api/panels' && method === 'GET')
@@ -422,7 +466,7 @@ export async function dispatchOperatorRoutes(req, handlers) {
422
466
  if (pathname === '/api/events' && method === 'GET')
423
467
  return handlers.getEvents(req);
424
468
  if (pathname === '/config' && method === 'GET')
425
- return handlers.getConfig();
469
+ return handlers.getConfig(req);
426
470
  if (pathname === '/config' && method === 'POST')
427
471
  return handlers.postConfig(req);
428
472
  return null;
@@ -1 +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"}
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;AAk7B7D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASrG"}
@@ -147,6 +147,20 @@ function readNumeric(reader, wireType) {
147
147
  reader.skip(wireType);
148
148
  return undefined;
149
149
  }
150
+ /**
151
+ * Return uint64 fields as string (via BigInt) to preserve nanosecond
152
+ * precision. Year-2026 timestamps (~1.78e18 ns) exceed Number.MAX_SAFE_INTEGER
153
+ * (~9e15), so Number conversion loses the low ~7 digits.
154
+ * OTLP JSON spec §3.4 encodes int64 fields as strings — this matches the spec.
155
+ */
156
+ function readNumericBigIntAsString(reader, wireType) {
157
+ if (wireType === 0)
158
+ return String(reader.readVarint());
159
+ if (wireType === 1)
160
+ return String(reader.readFixed64());
161
+ reader.skip(wireType);
162
+ return undefined;
163
+ }
150
164
  function readFloating(reader, wireType) {
151
165
  if (wireType === 1)
152
166
  return reader.readDouble();
@@ -212,9 +226,9 @@ function decodeAnyValue(bytes) {
212
226
  break;
213
227
  }
214
228
  case 3: {
215
- const value = readNumeric(reader, wireType);
229
+ const value = readNumericBigIntAsString(reader, wireType);
216
230
  if (value !== undefined)
217
- out['intValue'] = String(Math.trunc(value));
231
+ out['intValue'] = value;
218
232
  break;
219
233
  }
220
234
  case 4: {
@@ -452,13 +466,13 @@ function decodeSpan(bytes) {
452
466
  break;
453
467
  }
454
468
  case 7: {
455
- const value = readNumeric(reader, wireType);
469
+ const value = readNumericBigIntAsString(reader, wireType);
456
470
  if (value !== undefined)
457
471
  out['startTimeUnixNano'] = value;
458
472
  break;
459
473
  }
460
474
  case 8: {
461
- const value = readNumeric(reader, wireType);
475
+ const value = readNumericBigIntAsString(reader, wireType);
462
476
  if (value !== undefined)
463
477
  out['endTimeUnixNano'] = value;
464
478
  break;
@@ -513,7 +527,7 @@ function decodeSpanEvent(bytes) {
513
527
  const { fieldNumber, wireType } = reader.readField();
514
528
  switch (fieldNumber) {
515
529
  case 1: {
516
- const value = readNumeric(reader, wireType);
530
+ const value = readNumericBigIntAsString(reader, wireType);
517
531
  if (value !== undefined)
518
532
  out['timeUnixNano'] = value;
519
533
  break;
@@ -686,7 +700,7 @@ function decodeLogRecord(bytes) {
686
700
  switch (fieldNumber) {
687
701
  case 1:
688
702
  case 11: {
689
- const value = readNumeric(reader, wireType);
703
+ const value = readNumericBigIntAsString(reader, wireType);
690
704
  if (value !== undefined)
691
705
  out[fieldNumber === 1 ? 'timeUnixNano' : 'observedTimeUnixNano'] = value;
692
706
  break;
@@ -905,7 +919,7 @@ function decodeNumberDataPoint(bytes) {
905
919
  switch (fieldNumber) {
906
920
  case 2:
907
921
  case 3: {
908
- const value = readNumeric(reader, wireType);
922
+ const value = readNumericBigIntAsString(reader, wireType);
909
923
  if (value !== undefined)
910
924
  out[fieldNumber === 2 ? 'startTimeUnixNano' : 'timeUnixNano'] = value;
911
925
  break;
@@ -917,9 +931,9 @@ function decodeNumberDataPoint(bytes) {
917
931
  break;
918
932
  }
919
933
  case 6: {
920
- const value = readNumeric(reader, wireType);
934
+ const value = readNumericBigIntAsString(reader, wireType);
921
935
  if (value !== undefined)
922
- out['asInt'] = String(Math.trunc(value));
936
+ out['asInt'] = value;
923
937
  break;
924
938
  }
925
939
  case 7:
@@ -943,9 +957,13 @@ function decodeGenericDataPoint(bytes) {
943
957
  while (!reader.eof()) {
944
958
  const { fieldNumber, wireType } = reader.readField();
945
959
  if (fieldNumber === 2 || fieldNumber === 3 || fieldNumber === 4 || fieldNumber === 5 || fieldNumber === 10 || fieldNumber === 11 || fieldNumber === 12) {
960
+ // fields 2/3 are *UnixNano (uint64), use string form to preserve precision.
961
+ const isNano = fieldNumber === 2 || fieldNumber === 3;
946
962
  const value = fieldNumber === 5 || fieldNumber === 11 || fieldNumber === 12
947
963
  ? readFloating(reader, wireType)
948
- : readNumeric(reader, wireType);
964
+ : isNano
965
+ ? readNumericBigIntAsString(reader, wireType)
966
+ : readNumeric(reader, wireType);
949
967
  if (value !== undefined) {
950
968
  out[fieldNumber === 2 ? 'startTimeUnixNano'
951
969
  : fieldNumber === 3 ? 'timeUnixNano'
@@ -1,5 +1,5 @@
1
1
  import type { DaemonRemoteManagementRouteHandlers } from './context.js';
2
- type JsonBody = Record<string, unknown>;
2
+ import { type JsonRecord } from './route-helpers.js';
3
3
  type RemotePeerAuth = unknown;
4
4
  interface DistributedRuntimeRouteService {
5
5
  listPairRequests(): unknown;
@@ -23,8 +23,8 @@ interface SessionUserLike {
23
23
  readonly username: string;
24
24
  }
25
25
  interface DaemonRemoteRouteContext {
26
- readonly authToken?: string | null;
27
- readonly parseJsonBody: (req: Request) => Promise<JsonBody | Response>;
26
+ readonly authToken?: string | null | undefined;
27
+ readonly parseJsonBody: (req: Request) => Promise<JsonRecord | Response>;
28
28
  readonly requireAdmin: (req: Request) => Response | null;
29
29
  readonly requireRemotePeer: (req: Request, scope?: string) => Promise<RemotePeerAuth | Response>;
30
30
  readonly requireAuthenticatedSession: (req: Request) => SessionUserLike | null;
@@ -36,5 +36,11 @@ export declare function handleRemotePairVerify(context: Pick<DaemonRemoteRouteCo
36
36
  export declare function handleRemotePeerHeartbeat(context: Pick<DaemonRemoteRouteContext, 'parseJsonBody' | 'requireRemotePeer' | 'distributedRuntime'>, req: Request): Promise<Response>;
37
37
  export declare function handleRemotePeerWorkPull(context: Pick<DaemonRemoteRouteContext, 'parseJsonBody' | 'requireRemotePeer' | 'distributedRuntime'>, req: Request): Promise<Response>;
38
38
  export declare function handleRemotePeerWorkComplete(context: Pick<DaemonRemoteRouteContext, 'parseJsonBody' | 'requireRemotePeer' | 'distributedRuntime'>, workId: string, req: Request): Promise<Response>;
39
+ export declare function estimateJsonByteLengthWithinLimit(value: unknown, maxBytes: number): {
40
+ readonly kind: 'ok';
41
+ readonly byteLength: number;
42
+ } | {
43
+ readonly kind: 'invalid';
44
+ };
39
45
  export {};
40
46
  //# sourceMappingURL=remote-routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remote-routes.d.ts","sourceRoot":"","sources":["../src/remote-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,cAAc,CAAC;AAIxE,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACxC,KAAK,cAAc,GAAG,OAAO,CAAC;AAI9B,UAAU,8BAA8B;IACtC,gBAAgB,IAAI,OAAO,CAAC;IAC5B,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAC/F,iBAAiB,CAAC,S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