@nylorun/runtime 0.24.0-beta → 0.26.0-beta

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 (171) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/README.md +18 -4
  3. package/dist/api/a2a/card.d.ts +11 -1
  4. package/dist/api/a2a/card.js +26 -2
  5. package/dist/api/a2a/endpoint.js +4 -2
  6. package/dist/api/a2a/protocol.d.ts +25 -2
  7. package/dist/api/a2a/protocol.js +20 -3
  8. package/dist/api/a2a/routes.d.ts +4 -1
  9. package/dist/api/a2a/routes.js +65 -7
  10. package/dist/api/ag-ui/endpoint.js +5 -2
  11. package/dist/api/ag-ui/history.d.ts +6 -1
  12. package/dist/api/ag-ui/history.js +35 -2
  13. package/dist/api/ag-ui/routes.js +53 -11
  14. package/dist/api/components.d.ts +1165 -678
  15. package/dist/api/components.js +16 -1
  16. package/dist/api/gate/keys.d.ts +2 -1
  17. package/dist/api/gate/keys.js +7 -0
  18. package/dist/api/gate/routes.js +13 -0
  19. package/dist/api/http/app.d.ts +2 -2
  20. package/dist/api/http/app.js +15 -4
  21. package/dist/api/http/body.d.ts +3 -3
  22. package/dist/api/http/body.js +7 -7
  23. package/dist/api/http/define.d.ts +1 -1
  24. package/dist/api/http/respond.js +1 -1
  25. package/dist/api/http/routes/environment-manifests.d.ts +9 -0
  26. package/dist/api/http/routes/environment-manifests.js +118 -0
  27. package/dist/api/http/routes/environments.js +61 -12
  28. package/dist/api/http/routes/reads.d.ts +52 -3
  29. package/dist/api/http/routes/sessions.js +14 -4
  30. package/dist/api/http/routes/tenant.js +35 -7
  31. package/dist/api/inbound-files.d.ts +65 -0
  32. package/dist/api/inbound-files.js +115 -0
  33. package/dist/api/openapi.js +18 -3
  34. package/dist/artifacts/disk.js +20 -14
  35. package/dist/artifacts/media-types.d.ts +15 -0
  36. package/dist/artifacts/media-types.js +56 -4
  37. package/dist/artifacts/parts.d.ts +12 -3
  38. package/dist/artifacts/parts.js +15 -4
  39. package/dist/artifacts/workspace.d.ts +4 -4
  40. package/dist/artifacts/workspace.js +6 -18
  41. package/dist/core/flow-host.d.ts +1 -1
  42. package/dist/core/flow-host.js +2 -2
  43. package/dist/core/sandbox-routes.js +2 -2
  44. package/dist/core/turn-manifest.d.ts +3 -2
  45. package/dist/core/turn-manifest.js +29 -5
  46. package/dist/gates/egress-credentials.js +1 -1
  47. package/dist/gates/egress.d.ts +13 -19
  48. package/dist/gates/egress.js +32 -29
  49. package/dist/gates/http-tool.d.ts +3 -4
  50. package/dist/gates/http-tool.js +23 -19
  51. package/dist/gates/journal.js +0 -1
  52. package/dist/gates/mcp-handler.js +2 -3
  53. package/dist/gates/policy.js +1 -3
  54. package/dist/gates/tool-contract.d.ts +1 -1
  55. package/dist/harness/calls.d.ts +2 -2
  56. package/dist/harness/calls.js +9 -12
  57. package/dist/harness/main.js +7 -1
  58. package/dist/harness/pod.d.ts +6 -1
  59. package/dist/harness/pod.js +5 -0
  60. package/dist/harness/service.js +5 -5
  61. package/dist/harness/setup.d.ts +2 -0
  62. package/dist/harness/setup.js +25 -1
  63. package/dist/harness-api/record.d.ts +1 -1
  64. package/dist/harness-api/record.js +13 -13
  65. package/dist/harness-api/server.d.ts +27 -4
  66. package/dist/harness-api/server.js +41 -8
  67. package/dist/harness-api/tool-journal.d.ts +17 -8
  68. package/dist/harness-api/tool-journal.js +41 -11
  69. package/dist/harness-api/workspace.d.ts +7 -5
  70. package/dist/harness-api/workspace.js +25 -19
  71. package/dist/host/gates.js +2 -2
  72. package/dist/host/stack-config.js +1 -1
  73. package/dist/keys/contract.d.ts +1 -1
  74. package/dist/keys/contract.js +1 -1
  75. package/dist/keys/keys.d.ts +9 -2
  76. package/dist/keys/keys.js +4 -1
  77. package/dist/management-openapi.json +366 -61
  78. package/dist/mcp/connect.d.ts +1 -2
  79. package/dist/mcp/connect.js +1 -4
  80. package/dist/mcp/pool.d.ts +1 -4
  81. package/dist/mcp/pool.js +13 -27
  82. package/dist/mcp/preview.d.ts +1 -1
  83. package/dist/mcp/preview.js +1 -2
  84. package/dist/mcp/snapshot.d.ts +11 -13
  85. package/dist/mcp/snapshot.js +27 -38
  86. package/dist/model/capabilities.d.ts +26 -0
  87. package/dist/model/capabilities.js +44 -0
  88. package/dist/model/catalog.d.ts +34 -3
  89. package/dist/model/catalog.js +38 -2
  90. package/dist/model/models.d.ts +2 -0
  91. package/dist/model/models.js +1 -1
  92. package/dist/model/native-blocks.d.ts +35 -0
  93. package/dist/model/native-blocks.js +170 -0
  94. package/dist/model/pi-model.js +106 -94
  95. package/dist/openapi.json +9554 -5076
  96. package/dist/record/environment.js +1 -1
  97. package/dist/sandbox/join.js +4 -0
  98. package/dist/sandbox/manager.d.ts +32 -14
  99. package/dist/sandbox/manager.js +132 -93
  100. package/dist/sandbox/placement.d.ts +1 -1
  101. package/dist/sandbox/placement.js +2 -2
  102. package/dist/sandbox/pods/client.d.ts +3 -1
  103. package/dist/sandbox/pods/lifecycle.d.ts +8 -0
  104. package/dist/sandbox/pods/lifecycle.js +15 -0
  105. package/dist/sandbox/pods/spec.js +2 -1
  106. package/dist/sandbox/resolve.d.ts +5 -3
  107. package/dist/sandbox/resolve.js +9 -2
  108. package/dist/sandbox/runtime-tools.d.ts +9 -0
  109. package/dist/sandbox/runtime-tools.js +16 -0
  110. package/dist/sandbox/session-sandbox.d.ts +4 -6
  111. package/dist/sandbox/session-sandbox.js +47 -94
  112. package/dist/sandbox/setup.d.ts +4 -1
  113. package/dist/sandbox/setup.js +46 -9
  114. package/dist/sandbox/share.d.ts +12 -7
  115. package/dist/sandbox/share.js +27 -25
  116. package/dist/sandbox/skills.d.ts +8 -6
  117. package/dist/sandbox/skills.js +24 -23
  118. package/dist/store/postgres/drizzle/0024_flat_manifest.sql +7 -0
  119. package/dist/store/postgres/drizzle/0025_environment_manifests.sql +14 -0
  120. package/dist/store/postgres/drizzle/0026_environment_forks.sql +1 -0
  121. package/dist/store/postgres/drizzle/0027_environment_image_digest.sql +1 -0
  122. package/dist/store/postgres/drizzle/meta/_journal.json +28 -0
  123. package/dist/store/postgres/migrate.js +1 -1
  124. package/dist/store/postgres/reads.js +8 -2
  125. package/dist/store/postgres/schema.d.ts +217 -0
  126. package/dist/store/postgres/schema.js +36 -2
  127. package/dist/store/postgres/store.js +79 -4
  128. package/dist/store/types.d.ts +68 -14
  129. package/dist/tenant/advance.js +3 -0
  130. package/dist/tenant/artifact-tool.d.ts +1 -1
  131. package/dist/tenant/artifact-tool.js +43 -22
  132. package/dist/tenant/commands.js +24 -4
  133. package/dist/tenant/context.d.ts +10 -4
  134. package/dist/tenant/effects.js +7 -9
  135. package/dist/tenant/environment-manifests.d.ts +57 -0
  136. package/dist/tenant/environment-manifests.js +200 -0
  137. package/dist/tenant/environments.d.ts +54 -47
  138. package/dist/tenant/environments.js +309 -85
  139. package/dist/tenant/ephemeral.d.ts +1 -1
  140. package/dist/tenant/host-token.js +1 -1
  141. package/dist/tenant/identity-file.d.ts +1 -1
  142. package/dist/tenant/identity-file.js +1 -1
  143. package/dist/tenant/model-setting.d.ts +14 -0
  144. package/dist/tenant/model-setting.js +51 -0
  145. package/dist/tenant/outbound.d.ts +6 -5
  146. package/dist/tenant/outbound.js +8 -6
  147. package/dist/tenant/sessions.d.ts +5 -1
  148. package/dist/tenant/sessions.js +45 -12
  149. package/dist/tenant/skill-tool.d.ts +3 -3
  150. package/dist/tenant/skill-tool.js +6 -11
  151. package/dist/tenant/sweep.js +1 -1
  152. package/dist/tenant/tool-results.js +1 -1
  153. package/dist/tenant/tool-search.d.ts +7 -11
  154. package/dist/tenant/tool-search.js +8 -5
  155. package/dist/tenant/transcript.d.ts +51 -32
  156. package/dist/tenant/transcript.js +2 -1
  157. package/dist/tenant/types.d.ts +2 -2
  158. package/dist/traces/ids.d.ts +0 -1
  159. package/dist/traces/ids.js +0 -4
  160. package/dist/traces/map.d.ts +2 -2
  161. package/dist/traces/map.js +1 -29
  162. package/dist/vault/coverage.js +11 -13
  163. package/dist/vault/host-model.d.ts +4 -1
  164. package/dist/vault/host-model.js +10 -2
  165. package/dist/vault/service.d.ts +49 -4
  166. package/dist/vault/service.js +153 -6
  167. package/dist/version.d.ts +1 -1
  168. package/dist/version.js +1 -1
  169. package/package.json +3 -3
  170. package/dist/sandbox/capability.d.ts +0 -3
  171. package/dist/sandbox/capability.js +0 -10
@@ -4,6 +4,7 @@
4
4
  * Payload schemas: `@nylorun/core/contracts` (`parseTranscriptEvent`).
5
5
  */
6
6
  import type { HostEffect } from "@nylorun/harness/run";
7
+ import type { PluginLabel } from "@nylorun/core/define";
7
8
  import type { TOOL_CALL_KINDS, TOOL_CALL_STATUSES } from "@nylorun/core/contracts";
8
9
  export type ToolCallStatus = (typeof TOOL_CALL_STATUSES)[number];
9
10
  export type ToolCallKind = (typeof TOOL_CALL_KINDS)[number];
@@ -136,6 +137,8 @@ export interface ToolCallFacts {
136
137
  readonly status: ToolCallStatus;
137
138
  readonly kind?: ToolCallKind;
138
139
  readonly server?: string;
140
+ readonly skill?: string;
141
+ readonly plugin?: PluginLabel;
139
142
  readonly attempts?: number;
140
143
  readonly durationMs?: number;
141
144
  readonly effectId?: string;
@@ -156,11 +159,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
156
159
  };
157
160
  output?: undefined;
158
161
  redacted: number;
159
- capabilityId: string;
160
162
  toolName: string;
161
163
  status?: "cancelled" | "completed" | "failed" | undefined;
162
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
164
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
163
165
  server?: string | undefined;
166
+ skill?: string | undefined;
167
+ plugin?: PluginLabel | undefined;
164
168
  attempts?: number | undefined;
165
169
  durationMs?: number | undefined;
166
170
  effectId?: string | undefined;
@@ -176,11 +180,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
176
180
  };
177
181
  output?: undefined;
178
182
  redacted: number;
179
- capabilityId: string;
180
183
  toolName: string;
181
184
  status?: "cancelled" | "completed" | "failed" | undefined;
182
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
185
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
183
186
  server?: string | undefined;
187
+ skill?: string | undefined;
188
+ plugin?: PluginLabel | undefined;
184
189
  attempts?: number | undefined;
185
190
  durationMs?: number | undefined;
186
191
  effectId?: string | undefined;
@@ -196,11 +201,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
196
201
  };
197
202
  output?: undefined;
198
203
  redacted?: undefined;
199
- capabilityId: string;
200
204
  toolName: string;
201
205
  status?: "cancelled" | "completed" | "failed" | undefined;
202
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
206
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
203
207
  server?: string | undefined;
208
+ skill?: string | undefined;
209
+ plugin?: PluginLabel | undefined;
204
210
  attempts?: number | undefined;
205
211
  durationMs?: number | undefined;
206
212
  effectId?: string | undefined;
@@ -216,11 +222,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
216
222
  };
217
223
  output?: undefined;
218
224
  redacted?: undefined;
219
- capabilityId: string;
220
225
  toolName: string;
221
226
  status?: "cancelled" | "completed" | "failed" | undefined;
222
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
227
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
223
228
  server?: string | undefined;
229
+ skill?: string | undefined;
230
+ plugin?: PluginLabel | undefined;
224
231
  attempts?: number | undefined;
225
232
  durationMs?: number | undefined;
226
233
  effectId?: string | undefined;
@@ -231,11 +238,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
231
238
  error?: undefined;
232
239
  output: unknown;
233
240
  redacted: number;
234
- capabilityId: string;
235
241
  toolName: string;
236
242
  status?: "cancelled" | "completed" | "failed" | undefined;
237
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
243
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
238
244
  server?: string | undefined;
245
+ skill?: string | undefined;
246
+ plugin?: PluginLabel | undefined;
239
247
  attempts?: number | undefined;
240
248
  durationMs?: number | undefined;
241
249
  effectId?: string | undefined;
@@ -246,11 +254,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
246
254
  error?: undefined;
247
255
  output: unknown;
248
256
  redacted: number;
249
- capabilityId: string;
250
257
  toolName: string;
251
258
  status?: "cancelled" | "completed" | "failed" | undefined;
252
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
259
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
253
260
  server?: string | undefined;
261
+ skill?: string | undefined;
262
+ plugin?: PluginLabel | undefined;
254
263
  attempts?: number | undefined;
255
264
  durationMs?: number | undefined;
256
265
  effectId?: string | undefined;
@@ -261,11 +270,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
261
270
  error?: undefined;
262
271
  output: unknown;
263
272
  redacted?: undefined;
264
- capabilityId: string;
265
273
  toolName: string;
266
274
  status?: "cancelled" | "completed" | "failed" | undefined;
267
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
275
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
268
276
  server?: string | undefined;
277
+ skill?: string | undefined;
278
+ plugin?: PluginLabel | undefined;
269
279
  attempts?: number | undefined;
270
280
  durationMs?: number | undefined;
271
281
  effectId?: string | undefined;
@@ -276,11 +286,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
276
286
  error?: undefined;
277
287
  output: unknown;
278
288
  redacted?: undefined;
279
- capabilityId: string;
280
289
  toolName: string;
281
290
  status?: "cancelled" | "completed" | "failed" | undefined;
282
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
291
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
283
292
  server?: string | undefined;
293
+ skill?: string | undefined;
294
+ plugin?: PluginLabel | undefined;
284
295
  attempts?: number | undefined;
285
296
  durationMs?: number | undefined;
286
297
  effectId?: string | undefined;
@@ -298,11 +309,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
298
309
  };
299
310
  output?: undefined;
300
311
  redacted: number;
301
- capabilityId: string;
302
312
  toolName: string;
303
313
  status?: "cancelled" | "completed" | "failed" | undefined;
304
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
314
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
305
315
  server?: string | undefined;
316
+ skill?: string | undefined;
317
+ plugin?: PluginLabel | undefined;
306
318
  attempts?: number | undefined;
307
319
  durationMs?: number | undefined;
308
320
  effectId?: string | undefined;
@@ -320,11 +332,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
320
332
  };
321
333
  output?: undefined;
322
334
  redacted: number;
323
- capabilityId: string;
324
335
  toolName: string;
325
336
  status?: "cancelled" | "completed" | "failed" | undefined;
326
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
337
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
327
338
  server?: string | undefined;
339
+ skill?: string | undefined;
340
+ plugin?: PluginLabel | undefined;
328
341
  attempts?: number | undefined;
329
342
  durationMs?: number | undefined;
330
343
  effectId?: string | undefined;
@@ -342,11 +355,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
342
355
  };
343
356
  output?: undefined;
344
357
  redacted?: undefined;
345
- capabilityId: string;
346
358
  toolName: string;
347
359
  status?: "cancelled" | "completed" | "failed" | undefined;
348
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
360
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
349
361
  server?: string | undefined;
362
+ skill?: string | undefined;
363
+ plugin?: PluginLabel | undefined;
350
364
  attempts?: number | undefined;
351
365
  durationMs?: number | undefined;
352
366
  effectId?: string | undefined;
@@ -364,11 +378,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
364
378
  };
365
379
  output?: undefined;
366
380
  redacted?: undefined;
367
- capabilityId: string;
368
381
  toolName: string;
369
382
  status?: "cancelled" | "completed" | "failed" | undefined;
370
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
383
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
371
384
  server?: string | undefined;
385
+ skill?: string | undefined;
386
+ plugin?: PluginLabel | undefined;
372
387
  attempts?: number | undefined;
373
388
  durationMs?: number | undefined;
374
389
  effectId?: string | undefined;
@@ -381,11 +396,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
381
396
  error?: undefined;
382
397
  output: unknown;
383
398
  redacted: number;
384
- capabilityId: string;
385
399
  toolName: string;
386
400
  status?: "cancelled" | "completed" | "failed" | undefined;
387
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
401
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
388
402
  server?: string | undefined;
403
+ skill?: string | undefined;
404
+ plugin?: PluginLabel | undefined;
389
405
  attempts?: number | undefined;
390
406
  durationMs?: number | undefined;
391
407
  effectId?: string | undefined;
@@ -398,11 +414,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
398
414
  error?: undefined;
399
415
  output: unknown;
400
416
  redacted: number;
401
- capabilityId: string;
402
417
  toolName: string;
403
418
  status?: "cancelled" | "completed" | "failed" | undefined;
404
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
419
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
405
420
  server?: string | undefined;
421
+ skill?: string | undefined;
422
+ plugin?: PluginLabel | undefined;
406
423
  attempts?: number | undefined;
407
424
  durationMs?: number | undefined;
408
425
  effectId?: string | undefined;
@@ -415,11 +432,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
415
432
  error?: undefined;
416
433
  output: unknown;
417
434
  redacted?: undefined;
418
- capabilityId: string;
419
435
  toolName: string;
420
436
  status?: "cancelled" | "completed" | "failed" | undefined;
421
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
437
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
422
438
  server?: string | undefined;
439
+ skill?: string | undefined;
440
+ plugin?: PluginLabel | undefined;
423
441
  attempts?: number | undefined;
424
442
  durationMs?: number | undefined;
425
443
  effectId?: string | undefined;
@@ -432,11 +450,12 @@ export declare function toolCompleted(request: HostEffect, value: unknown, facts
432
450
  error?: undefined;
433
451
  output: unknown;
434
452
  redacted?: undefined;
435
- capabilityId: string;
436
453
  toolName: string;
437
454
  status?: "cancelled" | "completed" | "failed" | undefined;
438
- kind?: "http" | "mcp" | "platform" | "sandbox" | undefined;
455
+ kind?: "harness" | "http" | "mcp" | "platform" | "sandbox" | undefined;
439
456
  server?: string | undefined;
457
+ skill?: string | undefined;
458
+ plugin?: PluginLabel | undefined;
440
459
  attempts?: number | undefined;
441
460
  durationMs?: number | undefined;
442
461
  effectId?: string | undefined;
@@ -158,13 +158,14 @@ export function toolCompleted(request, value, facts) {
158
158
  : {};
159
159
  return {
160
160
  ...ids,
161
- capabilityId: request.capabilityId,
162
161
  toolName: request.toolName,
163
162
  ...(facts
164
163
  ? {
165
164
  status: facts.status,
166
165
  ...(facts.kind === undefined ? {} : { kind: facts.kind }),
167
166
  ...(facts.server === undefined ? {} : { server: facts.server }),
167
+ ...(facts.skill === undefined ? {} : { skill: facts.skill }),
168
+ ...(facts.plugin === undefined ? {} : { plugin: facts.plugin }),
168
169
  ...(facts.attempts === undefined ? {} : { attempts: facts.attempts }),
169
170
  ...(facts.durationMs === undefined ? {} : { durationMs: facts.durationMs }),
170
171
  ...(facts.effectId === undefined ? {} : { effectId: facts.effectId }),
@@ -75,7 +75,7 @@ export interface TenantConfig {
75
75
  */
76
76
  flowEnv?: Readonly<Record<string, string | undefined>>;
77
77
  /**
78
- * The trusted issuers whose JWTs the Tenant API accepts (Host feature `trusted-issuers`), from
78
+ * The trusted issuers whose JWTs the Runtime API accepts (Host feature `trusted-issuers`), from
79
79
  * the identity file (`NYLORUN_IDENTITY_FILE`). Absent: none.
80
80
  */
81
81
  issuers?: import("./issuers.js").TrustedIssuers;
@@ -107,7 +107,7 @@ export interface TenantHandle {
107
107
  /** The handlers Durable Session Execution calls for this Tenant (`worker.ts`). */
108
108
  readonly worker?: TenantWorker;
109
109
  /**
110
- * A Tenant API request whose headers the Host has validated: authenticates, authorizes,
110
+ * A Runtime or Management API request whose headers the Host has validated: authenticates, authorizes,
111
111
  * dispatches. A response already written to `node.outgoing` is `RESPONSE_ALREADY_SENT`.
112
112
  */
113
113
  fetch(request: Request, node: NodeBindings): Promise<Response>;
@@ -3,7 +3,6 @@ export type TraceKey = Buffer;
3
3
  export declare function traceIdOf(key: TraceKey, tenantId: string, sessionId: string, turnId: string): string;
4
4
  export declare function turnSpanOf(key: TraceKey, turnId: string): string;
5
5
  export declare function effectSpanOf(key: TraceKey, effectId: string): string;
6
- export declare function egressSpanOf(key: TraceKey, sessionId: string, seq: number): string;
7
6
  export declare function eventSpanOf(key: TraceKey, sessionId: string, seq: number): string;
8
7
  /** W3C trace context (R7.4): `traceparent`, and `tracestate` when the caller sent one. */
9
8
  export interface TraceContext {
@@ -8,7 +8,6 @@
8
8
  * (R7.4): then that trace id.
9
9
  * - **turn span**: `span|turn|<turn>`; every crossing's span is its child.
10
10
  * - **effect span**: `span|effect|<effect id>`, for a model or tool call or a flow stage.
11
- * - **egress span**: `span|egress|<session>|<seq>`, for one `egress.connection` row.
12
11
  * - **event span**: `span|event|<session>|<seq>`, for a marker or a row without an effect id.
13
12
  */
14
13
  import { createHmac } from "node:crypto";
@@ -26,9 +25,6 @@ export function turnSpanOf(key, turnId) {
26
25
  export function effectSpanOf(key, effectId) {
27
26
  return hmacHex(key, `span|effect|${effectId}`, 8);
28
27
  }
29
- export function egressSpanOf(key, sessionId, seq) {
30
- return hmacHex(key, `span|egress|${sessionId}|${seq}`, 8);
31
- }
32
28
  export function eventSpanOf(key, sessionId, seq) {
33
29
  return hmacHex(key, `span|event|${sessionId}|${seq}`, 8);
34
30
  }
@@ -10,7 +10,6 @@
10
10
  * | `tool.completed` | `execute_tool {toolName}` (INTERNAL) |
11
11
  * | `node.completed` | `execute_tool {key}`, a flow's HTTP stage (INTERNAL) |
12
12
  * | `effect.uncertain` | the call's span, with an error status |
13
- * | `egress.connection` | `CONNECT {host}` (CLIENT) |
14
13
  * | `turn.paused`, `command.approve`, `command.respond` | a marker with no length |
15
14
  *
16
15
  * Every other row, and every row without a turn, makes none. Every child's parent is the turn's
@@ -18,7 +17,8 @@
18
17
  *
19
18
  * Timing: a span with a gate's own measurement (`gate`, R7.1) is that measurement; any other ends
20
19
  * at the row's time and starts `durationMs` before it (the journal's window, exported as
21
- * `nylorun.effect.window_ms`). An egress span is the gate's: `startedAt` plus `durationMs`.
20
+ * `nylorun.effect.window_ms`). Egress has no span: a connection is the Environment's, not a
21
+ * turn's (D67), and is read from the Environment's events.
22
22
  *
23
23
  * Attribute names follow the OTel GenAI conventions at `GENAI_SEMCONV` (still in Development
24
24
  * status), recorded on the resource as `nylorun.semconv.genai`; the rest are `nylorun.*`. A span
@@ -1,4 +1,4 @@
1
- import { effectSpanOf, egressSpanOf, eventSpanOf, parseTraceparent, traceIdOf, turnSpanOf } from "./ids.js";
1
+ import { effectSpanOf, eventSpanOf, parseTraceparent, traceIdOf, turnSpanOf } from "./ids.js";
2
2
  /** The commit of open-telemetry/semantic-conventions-genai whose attribute names spans use. */
3
3
  export const GENAI_SEMCONV = "open-telemetry/semantic-conventions-genai@6fd0d763a092db245a54104fc1124031eb3c51d2";
4
4
  /**
@@ -188,34 +188,6 @@ export function spanOf(row, turn, settings) {
188
188
  status: errorStatus(content("errors", p.message)),
189
189
  };
190
190
  }
191
- case "egress.connection": {
192
- const refused = p.outcome === "refused";
193
- const started = Date.parse(String(p.startedAt));
194
- const attributes = base
195
- .str("server.address", p.host)
196
- .int("server.port", p.port)
197
- .str("nylorun.environment.id", p.environmentId)
198
- .str("nylorun.egress.outcome", p.outcome)
199
- .str("nylorun.egress.mode", p.mode)
200
- .bool("nylorun.egress.credential_bound", p.credentialBound)
201
- .strings("nylorun.egress.credential_ids", p.credentialIds)
202
- .int("nylorun.egress.requests", p.requests)
203
- .int("nylorun.egress.bytes_up", p.bytesUp)
204
- .int("nylorun.egress.bytes_down", p.bytesDown)
205
- .int("nylorun.egress.status", p.status)
206
- .str("error.type", refused ? (p.reason ?? "refused") : undefined);
207
- const times = Number.isFinite(started)
208
- ? { start: started, end: started + Math.max(0, Math.round(Number(p.durationMs) || 0)) }
209
- : undefined;
210
- return {
211
- ...child(egressSpanOf(settings.key, row.sessionId, row.seq), `CONNECT ${String(p.host)}`, SPAN_KIND.client),
212
- ...(times
213
- ? { startTimeUnixNano: nanos(times.start), endTimeUnixNano: nanos(times.end) }
214
- : window(row.time, undefined)),
215
- attributes: attributes.list,
216
- status: refused ? errorStatus(undefined) : { code: STATUS.unset },
217
- };
218
- }
219
191
  case "turn.paused":
220
192
  case "command.approve":
221
193
  case "command.respond": {
@@ -18,19 +18,17 @@ export function credentialNeeds(manifest) {
18
18
  };
19
19
  const owner = (agentId) => (agentId === undefined ? {} : { agentId });
20
20
  const agent = (manifest, agentId) => {
21
- for (const capability of manifest.capabilities) {
22
- for (const server of Object.values(capability.mcpServers ?? {}))
23
- add({ kind: "mcp", ...owner(agentId), name: server.name, serverName: server.name, url: server.url });
24
- for (const tool of capability.tools ?? [])
25
- if (tool.http?.credential !== undefined)
26
- add({
27
- kind: "http",
28
- ...owner(agentId),
29
- name: tool.name,
30
- serverName: tool.http.credential,
31
- url: tool.http.url,
32
- });
33
- }
21
+ for (const tool of manifest.tools ?? [])
22
+ if (tool.http?.credential !== undefined)
23
+ add({
24
+ kind: "http",
25
+ ...owner(agentId),
26
+ name: tool.name,
27
+ serverName: tool.http.credential,
28
+ url: tool.http.url,
29
+ });
30
+ for (const server of Object.values(manifest.mcpServers ?? {}))
31
+ add({ kind: "mcp", ...owner(agentId), name: server.name, serverName: server.name, url: server.url });
34
32
  for (const child of delegatesOf(manifest))
35
33
  agent(child.manifest, child.manifest.id);
36
34
  for (const child of flowDelegatesOf(manifest))
@@ -17,7 +17,10 @@ export declare class HostModelVault {
17
17
  private readonly store;
18
18
  private readonly kek;
19
19
  constructor(options: HostModelVaultOptions);
20
- /** Reads the active host model secret. Decrypts after the read commits. */
20
+ /**
21
+ * Reads the active host model secret, with the inputs the operator added to catalog models
22
+ * (protocol 12). Decrypts after the read commits.
23
+ */
21
24
  readHostModel(): Promise<HostModelSecret | undefined>;
22
25
  /** Replaces the active host model's secret, keeping its binding. */
23
26
  updateHostCredential(credential: {
@@ -1,3 +1,4 @@
1
+ import { readAddedInputs } from "../tenant/model-setting.js";
1
2
  import { encryptSecret } from "./crypto.js";
2
3
  import { VaultError } from "./error.js";
3
4
  import { activeHostCredentialRow, HOST_VAULT_ID, hostModelAad, modelBinding, readHostPayload, } from "./service.js";
@@ -8,9 +9,15 @@ export class HostModelVault {
8
9
  this.store = options.store;
9
10
  this.kek = options.kek;
10
11
  }
11
- /** Reads the active host model secret. Decrypts after the read commits. */
12
+ /**
13
+ * Reads the active host model secret, with the inputs the operator added to catalog models
14
+ * (protocol 12). Decrypts after the read commits.
15
+ */
12
16
  async readHostModel() {
13
- const row = await this.store.tx((t) => activeHostCredentialRow(t));
17
+ const { row, addedInputs } = await this.store.tx(async (t) => ({
18
+ row: await activeHostCredentialRow(t),
19
+ addedInputs: await readAddedInputs(t),
20
+ }));
14
21
  if (!row)
15
22
  return undefined;
16
23
  const binding = modelBinding(row);
@@ -27,6 +34,7 @@ export class HostModelVault {
27
34
  model: binding.model,
28
35
  ...(binding.baseUrl ? { baseUrl: binding.baseUrl } : {}),
29
36
  ...(binding.settings ? { settings: binding.settings } : {}),
37
+ addedInputs,
30
38
  authType: binding.authType,
31
39
  credential,
32
40
  };
@@ -1,4 +1,4 @@
1
- import type { CredentialCoverage, CredentialCoverageRequest, CredentialIdentity, EnvironmentSecretView, HostModelProviderInfo, HostModelView, PutEnvironmentSecretRequest, PutHostModelRequest, CustomModelSettings, SelectHostModelRequest } from "@nylorun/core/contracts";
1
+ import type { CredentialCoverage, CredentialCoverageRequest, CredentialIdentity, EnvironmentSecretView, HostModelProviderInfo, HostModelView, PutEnvironmentSecretRequest, PutHostModelRequest, CustomModelSettings, ModelInput, SelectHostModelRequest } from "@nylorun/core/contracts";
2
2
  import type { AgentManifest, WorkflowManifest } from "@nylorun/core/define";
3
3
  import type { SessionStore, Tx, VaultCredentialRow } from "../store/types.js";
4
4
  export declare const HOST_VAULT_ID = "host";
@@ -6,8 +6,10 @@ export type HostModelSecret = {
6
6
  provider: string;
7
7
  model: string;
8
8
  baseUrl?: string;
9
- /** A custom endpoint's window, output limit, reasoning and pi-ai compat (Model Calls §7). */
9
+ /** A custom endpoint's window, output limit, reasoning, inputs and pi-ai compat (Model Calls §7). */
10
10
  settings?: CustomModelSettings;
11
+ /** The inputs the operator added to catalog models, by `<provider>/<model>` (protocol 12). */
12
+ addedInputs?: Readonly<Record<string, readonly ModelInput[]>>;
11
13
  authType: "api_key" | "oauth";
12
14
  credential: {
13
15
  type: "api_key" | "oauth";
@@ -19,6 +21,28 @@ export type HostModelSecret = {
19
21
  [key: string]: unknown;
20
22
  };
21
23
  };
24
+ type UserCredentialRow = VaultCredentialRow & {
25
+ type: "bearer" | "headers" | "environment_secret" | "environment_variable";
26
+ };
27
+ /**
28
+ * A fork's secrets sealed for its new vault (`sealEnvironmentSecretCopies`): each copy's
29
+ * ciphertext, base64 so it crosses the keys service's JSON, and what about it is not secret.
30
+ */
31
+ export interface SealedSecretCopies {
32
+ readonly copies: readonly {
33
+ readonly id: string;
34
+ readonly name: string;
35
+ readonly type: UserCredentialRow["type"];
36
+ readonly bindingJson: string;
37
+ readonly expiresAt: string | null;
38
+ readonly kekId: string;
39
+ readonly nonce: string;
40
+ readonly ciphertext: string;
41
+ readonly wrappedDek: string;
42
+ }[];
43
+ /** Names left behind: no slot of the fork declares them, or their slot cannot take the value. */
44
+ readonly dropped: readonly string[];
45
+ }
22
46
  export type AuthorizeResult = {
23
47
  status: "unauthenticated";
24
48
  url: string;
@@ -47,14 +71,35 @@ export declare class VaultService {
47
71
  private readonly store;
48
72
  private readonly kek;
49
73
  constructor(options: VaultServiceOptions);
50
- /** Creates Environment `environmentId`'s vault (D56), in the transaction that creates it. */
51
- createEnvironmentVault(t: Tx, environmentId: string, actor: string): Promise<void>;
74
+ /**
75
+ * Creates Environment `environmentId`'s vault (D56), in the transaction that creates it; answers
76
+ * its id, `id` when given (a fork's, whose secrets were sealed for it first).
77
+ */
78
+ createEnvironmentVault(t: Tx, environmentId: string, actor: string, id?: string): Promise<string>;
52
79
  /**
53
80
  * Deletes Environment `environmentId`'s vault and its credentials, with their audit rows, in
54
81
  * the transaction that deletes the Environment: no release or tool call finds them after it
55
82
  * commits.
56
83
  */
57
84
  deleteEnvironmentVault(t: Tx, environmentId: string, actor: string): Promise<void>;
85
+ /**
86
+ * Seals Environment `from`'s secrets again for vault `vaultId`, a fork's new vault (Q15): each
87
+ * value is unsealed and sealed under the new vault's and credential's ids, which its AAD binds.
88
+ * Needs the vault key, so callers reach it through `Keys`; it reads `from` in its own
89
+ * transaction and writes nothing. With `slots` (what the fork runs declares secret slots, D64),
90
+ * only the names it declares are sealed, each with its slot's binding; a value the slot's type
91
+ * cannot take is left behind. The fork's transaction inserts the copies
92
+ * (`insertEnvironmentSecretCopies`).
93
+ */
94
+ sealEnvironmentSecretCopies(from: string, vaultId: string, slots?: Readonly<Record<string, Record<string, unknown>>> | null): Promise<SealedSecretCopies>;
95
+ /**
96
+ * Inserts a fork's sealed copies (`sealEnvironmentSecretCopies`) into vault `vaultId`, in the
97
+ * transaction that creates the fork, with an audit row each naming `from`. Reads no secret.
98
+ */
99
+ insertEnvironmentSecretCopies(t: Tx, vaultId: string, from: string, actor: string, sealed: SealedSecretCopies): Promise<{
100
+ copied: string[];
101
+ dropped: string[];
102
+ }>;
58
103
  /**
59
104
  * `PUT /v1/environments/{id}/secrets/{name}`: creates or replaces one credential. The same
60
105
  * name and type keeps the credential's id and re-seals its value and binding; another type