@nylorun/runtime 0.36.1-beta → 0.38.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 (71) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +10 -0
  3. package/dist/api/a2a/card.d.ts +10 -4
  4. package/dist/api/a2a/card.js +18 -6
  5. package/dist/api/a2a/endpoint.d.ts +5 -2
  6. package/dist/api/a2a/endpoint.js +31 -9
  7. package/dist/api/a2a/extensions.d.ts +41 -0
  8. package/dist/api/a2a/extensions.js +92 -0
  9. package/dist/api/a2a/list.d.ts +60 -0
  10. package/dist/api/a2a/list.js +169 -0
  11. package/dist/api/a2a/protocol.d.ts +105 -9
  12. package/dist/api/a2a/protocol.js +169 -18
  13. package/dist/api/a2a/push.d.ts +76 -0
  14. package/dist/api/a2a/push.js +305 -0
  15. package/dist/api/a2a/routes.d.ts +12 -6
  16. package/dist/api/a2a/routes.js +409 -112
  17. package/dist/api/a2a/tasks.d.ts +72 -4
  18. package/dist/api/a2a/tasks.js +305 -27
  19. package/dist/api/components.d.ts +538 -0
  20. package/dist/api/components.js +3 -1
  21. package/dist/api/http/app.js +2 -0
  22. package/dist/api/http/routes/artifacts.js +19 -0
  23. package/dist/api/http/routes/turns.d.ts +18 -0
  24. package/dist/api/http/routes/turns.js +67 -0
  25. package/dist/api/inbound-files.d.ts +12 -1
  26. package/dist/api/inbound-files.js +44 -0
  27. package/dist/api/openapi.js +7 -2
  28. package/dist/harness/image-engine.d.ts +14 -0
  29. package/dist/harness/image-engine.js +16 -0
  30. package/dist/harness/pod.d.ts +2 -0
  31. package/dist/harness/pod.js +5 -0
  32. package/dist/harness-api/ws-server.js +7 -1
  33. package/dist/host/config-for.d.ts +2 -0
  34. package/dist/host/config-for.js +1 -0
  35. package/dist/host/main.js +1 -0
  36. package/dist/host/stack-config.d.ts +16 -0
  37. package/dist/host/stack-config.js +30 -0
  38. package/dist/management-openapi.json +37 -2
  39. package/dist/openapi.json +1485 -738
  40. package/dist/reads/types.d.ts +19 -0
  41. package/dist/sandbox/join.d.ts +7 -1
  42. package/dist/sandbox/join.js +5 -1
  43. package/dist/sandbox/pods/builtin.d.ts +18 -0
  44. package/dist/sandbox/pods/builtin.js +33 -0
  45. package/dist/sandbox/pods/client.d.ts +5 -4
  46. package/dist/sandbox/pods/spec.js +14 -1
  47. package/dist/store/postgres/drizzle/0039_a2a_push.sql +32 -0
  48. package/dist/store/postgres/drizzle/0040_turn_index.sql +23 -0
  49. package/dist/store/postgres/drizzle/0041_turn_index_backfill.sql +88 -0
  50. package/dist/store/postgres/drizzle/0042_worker_engine_image.sql +1 -0
  51. package/dist/store/postgres/drizzle/meta/_journal.json +28 -0
  52. package/dist/store/postgres/reads.js +41 -1
  53. package/dist/store/postgres/schema.d.ts +1314 -533
  54. package/dist/store/postgres/schema.js +94 -0
  55. package/dist/store/postgres/store.js +135 -3
  56. package/dist/store/postgres/turns.d.ts +62 -0
  57. package/dist/store/postgres/turns.js +153 -0
  58. package/dist/store/types.d.ts +82 -3
  59. package/dist/tenant/runtime.js +7 -5
  60. package/dist/tenant/session-model.d.ts +11 -1
  61. package/dist/tenant/session-model.js +34 -5
  62. package/dist/tenant/sessions.d.ts +2 -1
  63. package/dist/tenant/sessions.js +8 -2
  64. package/dist/tenant/sweep.d.ts +3 -0
  65. package/dist/tenant/sweep.js +39 -11
  66. package/dist/tenant/types.d.ts +23 -0
  67. package/dist/tuning.d.ts +9 -0
  68. package/dist/tuning.js +11 -0
  69. package/dist/version.d.ts +1 -1
  70. package/dist/version.js +1 -1
  71. package/package.json +3 -3
@@ -4580,6 +4580,86 @@ export declare const SessionEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
4580
4580
  full: "full";
4581
4581
  metadata: "metadata";
4582
4582
  }>;
4583
+ } & {
4584
+ type: z.ZodLiteral<"plan.updated">;
4585
+ payload: z.ZodObject<{
4586
+ steps: z.ZodArray<z.ZodObject<{
4587
+ label: z.ZodString;
4588
+ state: z.ZodEnum<{
4589
+ active: "active";
4590
+ blocked: "blocked";
4591
+ done: "done";
4592
+ pending: "pending";
4593
+ skipped: "skipped";
4594
+ }>;
4595
+ note: z.ZodOptional<z.ZodString>;
4596
+ }, z.core.$loose>>;
4597
+ }, z.core.$loose>;
4598
+ }, z.core.$strip> | z.ZodObject<{
4599
+ schema: z.ZodLiteral<"nylorun.event/2">;
4600
+ eventId: z.ZodString;
4601
+ tenantId: z.ZodString;
4602
+ sessionId: z.ZodString;
4603
+ runId: z.ZodNullable<z.ZodString>;
4604
+ turnId: z.ZodNullable<z.ZodString>;
4605
+ incarnation: z.ZodNumber;
4606
+ epoch: z.ZodNumber;
4607
+ seq: z.ZodNumber;
4608
+ cursor: z.ZodString;
4609
+ time: z.ZodString;
4610
+ schemaVersion: z.ZodNumber;
4611
+ source: z.ZodObject<{
4612
+ kind: z.ZodEnum<{
4613
+ api: "api";
4614
+ client: "client";
4615
+ controller: "controller";
4616
+ core: "core";
4617
+ edge: "edge";
4618
+ "egress-gate": "egress-gate";
4619
+ evidence: "evidence";
4620
+ harness: "harness";
4621
+ human: "human";
4622
+ init: "init";
4623
+ loop: "loop";
4624
+ "model-gate": "model-gate";
4625
+ operator: "operator";
4626
+ sandboxes: "sandboxes";
4627
+ supervisor: "supervisor";
4628
+ "tool-gate": "tool-gate";
4629
+ }>;
4630
+ id: z.ZodString;
4631
+ }, z.core.$strip>;
4632
+ evidence: z.ZodEnum<{
4633
+ asserted: "asserted";
4634
+ attested: "attested";
4635
+ claimed: "claimed";
4636
+ measured: "measured";
4637
+ observed: "observed";
4638
+ }>;
4639
+ principal: z.ZodOptional<z.ZodObject<{
4640
+ kind: z.ZodEnum<{
4641
+ application: "application";
4642
+ core: "core";
4643
+ "flow-host": "flow-host";
4644
+ subject: "subject";
4645
+ trigger: "trigger";
4646
+ }>;
4647
+ id: z.ZodString;
4648
+ }, z.core.$strict>>;
4649
+ trace: z.ZodOptional<z.ZodObject<{
4650
+ traceId: z.ZodString;
4651
+ spanId: z.ZodString;
4652
+ parentSpanId: z.ZodOptional<z.ZodString>;
4653
+ }, z.core.$strip>>;
4654
+ visibility: z.ZodEnum<{
4655
+ internal: "internal";
4656
+ public: "public";
4657
+ restricted: "restricted";
4658
+ }>;
4659
+ retention: z.ZodEnum<{
4660
+ full: "full";
4661
+ metadata: "metadata";
4662
+ }>;
4583
4663
  } & {
4584
4664
  type: z.ZodLiteral<"queue.taken">;
4585
4665
  payload: z.ZodObject<{
@@ -7313,6 +7393,86 @@ export declare const SessionEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
7313
7393
  full: "full";
7314
7394
  metadata: "metadata";
7315
7395
  }>;
7396
+ } & {
7397
+ type: z.ZodLiteral<"plan.updated">;
7398
+ payload: z.ZodObject<{
7399
+ steps: z.ZodArray<z.ZodObject<{
7400
+ label: z.ZodString;
7401
+ state: z.ZodEnum<{
7402
+ active: "active";
7403
+ blocked: "blocked";
7404
+ done: "done";
7405
+ pending: "pending";
7406
+ skipped: "skipped";
7407
+ }>;
7408
+ note: z.ZodOptional<z.ZodString>;
7409
+ }, z.core.$loose>>;
7410
+ }, z.core.$loose>;
7411
+ }, z.core.$strip> | z.ZodObject<{
7412
+ schema: z.ZodLiteral<"nylorun.event/2">;
7413
+ eventId: z.ZodString;
7414
+ tenantId: z.ZodString;
7415
+ sessionId: z.ZodString;
7416
+ runId: z.ZodNullable<z.ZodString>;
7417
+ turnId: z.ZodNullable<z.ZodString>;
7418
+ incarnation: z.ZodNumber;
7419
+ epoch: z.ZodNumber;
7420
+ seq: z.ZodNumber;
7421
+ cursor: z.ZodString;
7422
+ time: z.ZodString;
7423
+ schemaVersion: z.ZodNumber;
7424
+ source: z.ZodObject<{
7425
+ kind: z.ZodEnum<{
7426
+ api: "api";
7427
+ client: "client";
7428
+ controller: "controller";
7429
+ core: "core";
7430
+ edge: "edge";
7431
+ "egress-gate": "egress-gate";
7432
+ evidence: "evidence";
7433
+ harness: "harness";
7434
+ human: "human";
7435
+ init: "init";
7436
+ loop: "loop";
7437
+ "model-gate": "model-gate";
7438
+ operator: "operator";
7439
+ sandboxes: "sandboxes";
7440
+ supervisor: "supervisor";
7441
+ "tool-gate": "tool-gate";
7442
+ }>;
7443
+ id: z.ZodString;
7444
+ }, z.core.$strip>;
7445
+ evidence: z.ZodEnum<{
7446
+ asserted: "asserted";
7447
+ attested: "attested";
7448
+ claimed: "claimed";
7449
+ measured: "measured";
7450
+ observed: "observed";
7451
+ }>;
7452
+ principal: z.ZodOptional<z.ZodObject<{
7453
+ kind: z.ZodEnum<{
7454
+ application: "application";
7455
+ core: "core";
7456
+ "flow-host": "flow-host";
7457
+ subject: "subject";
7458
+ trigger: "trigger";
7459
+ }>;
7460
+ id: z.ZodString;
7461
+ }, z.core.$strict>>;
7462
+ trace: z.ZodOptional<z.ZodObject<{
7463
+ traceId: z.ZodString;
7464
+ spanId: z.ZodString;
7465
+ parentSpanId: z.ZodOptional<z.ZodString>;
7466
+ }, z.core.$strip>>;
7467
+ visibility: z.ZodEnum<{
7468
+ internal: "internal";
7469
+ public: "public";
7470
+ restricted: "restricted";
7471
+ }>;
7472
+ retention: z.ZodEnum<{
7473
+ full: "full";
7474
+ metadata: "metadata";
7475
+ }>;
7316
7476
  } & {
7317
7477
  type: z.ZodLiteral<"queue.taken">;
7318
7478
  payload: z.ZodObject<{
@@ -10049,6 +10209,86 @@ export declare const SessionItemsResponse: z.ZodObject<{
10049
10209
  full: "full";
10050
10210
  metadata: "metadata";
10051
10211
  }>;
10212
+ } & {
10213
+ type: z.ZodLiteral<"plan.updated">;
10214
+ payload: z.ZodObject<{
10215
+ steps: z.ZodArray<z.ZodObject<{
10216
+ label: z.ZodString;
10217
+ state: z.ZodEnum<{
10218
+ active: "active";
10219
+ blocked: "blocked";
10220
+ done: "done";
10221
+ pending: "pending";
10222
+ skipped: "skipped";
10223
+ }>;
10224
+ note: z.ZodOptional<z.ZodString>;
10225
+ }, z.core.$loose>>;
10226
+ }, z.core.$loose>;
10227
+ }, z.core.$strip> | z.ZodObject<{
10228
+ schema: z.ZodLiteral<"nylorun.event/2">;
10229
+ eventId: z.ZodString;
10230
+ tenantId: z.ZodString;
10231
+ sessionId: z.ZodString;
10232
+ runId: z.ZodNullable<z.ZodString>;
10233
+ turnId: z.ZodNullable<z.ZodString>;
10234
+ incarnation: z.ZodNumber;
10235
+ epoch: z.ZodNumber;
10236
+ seq: z.ZodNumber;
10237
+ cursor: z.ZodString;
10238
+ time: z.ZodString;
10239
+ schemaVersion: z.ZodNumber;
10240
+ source: z.ZodObject<{
10241
+ kind: z.ZodEnum<{
10242
+ api: "api";
10243
+ client: "client";
10244
+ controller: "controller";
10245
+ core: "core";
10246
+ edge: "edge";
10247
+ "egress-gate": "egress-gate";
10248
+ evidence: "evidence";
10249
+ harness: "harness";
10250
+ human: "human";
10251
+ init: "init";
10252
+ loop: "loop";
10253
+ "model-gate": "model-gate";
10254
+ operator: "operator";
10255
+ sandboxes: "sandboxes";
10256
+ supervisor: "supervisor";
10257
+ "tool-gate": "tool-gate";
10258
+ }>;
10259
+ id: z.ZodString;
10260
+ }, z.core.$strip>;
10261
+ evidence: z.ZodEnum<{
10262
+ asserted: "asserted";
10263
+ attested: "attested";
10264
+ claimed: "claimed";
10265
+ measured: "measured";
10266
+ observed: "observed";
10267
+ }>;
10268
+ principal: z.ZodOptional<z.ZodObject<{
10269
+ kind: z.ZodEnum<{
10270
+ application: "application";
10271
+ core: "core";
10272
+ "flow-host": "flow-host";
10273
+ subject: "subject";
10274
+ trigger: "trigger";
10275
+ }>;
10276
+ id: z.ZodString;
10277
+ }, z.core.$strict>>;
10278
+ trace: z.ZodOptional<z.ZodObject<{
10279
+ traceId: z.ZodString;
10280
+ spanId: z.ZodString;
10281
+ parentSpanId: z.ZodOptional<z.ZodString>;
10282
+ }, z.core.$strip>>;
10283
+ visibility: z.ZodEnum<{
10284
+ internal: "internal";
10285
+ public: "public";
10286
+ restricted: "restricted";
10287
+ }>;
10288
+ retention: z.ZodEnum<{
10289
+ full: "full";
10290
+ metadata: "metadata";
10291
+ }>;
10052
10292
  } & {
10053
10293
  type: z.ZodLiteral<"queue.taken">;
10054
10294
  payload: z.ZodObject<{
@@ -12782,6 +13022,86 @@ export declare const SessionItemsResponse: z.ZodObject<{
12782
13022
  full: "full";
12783
13023
  metadata: "metadata";
12784
13024
  }>;
13025
+ } & {
13026
+ type: z.ZodLiteral<"plan.updated">;
13027
+ payload: z.ZodObject<{
13028
+ steps: z.ZodArray<z.ZodObject<{
13029
+ label: z.ZodString;
13030
+ state: z.ZodEnum<{
13031
+ active: "active";
13032
+ blocked: "blocked";
13033
+ done: "done";
13034
+ pending: "pending";
13035
+ skipped: "skipped";
13036
+ }>;
13037
+ note: z.ZodOptional<z.ZodString>;
13038
+ }, z.core.$loose>>;
13039
+ }, z.core.$loose>;
13040
+ }, z.core.$strip> | z.ZodObject<{
13041
+ schema: z.ZodLiteral<"nylorun.event/2">;
13042
+ eventId: z.ZodString;
13043
+ tenantId: z.ZodString;
13044
+ sessionId: z.ZodString;
13045
+ runId: z.ZodNullable<z.ZodString>;
13046
+ turnId: z.ZodNullable<z.ZodString>;
13047
+ incarnation: z.ZodNumber;
13048
+ epoch: z.ZodNumber;
13049
+ seq: z.ZodNumber;
13050
+ cursor: z.ZodString;
13051
+ time: z.ZodString;
13052
+ schemaVersion: z.ZodNumber;
13053
+ source: z.ZodObject<{
13054
+ kind: z.ZodEnum<{
13055
+ api: "api";
13056
+ client: "client";
13057
+ controller: "controller";
13058
+ core: "core";
13059
+ edge: "edge";
13060
+ "egress-gate": "egress-gate";
13061
+ evidence: "evidence";
13062
+ harness: "harness";
13063
+ human: "human";
13064
+ init: "init";
13065
+ loop: "loop";
13066
+ "model-gate": "model-gate";
13067
+ operator: "operator";
13068
+ sandboxes: "sandboxes";
13069
+ supervisor: "supervisor";
13070
+ "tool-gate": "tool-gate";
13071
+ }>;
13072
+ id: z.ZodString;
13073
+ }, z.core.$strip>;
13074
+ evidence: z.ZodEnum<{
13075
+ asserted: "asserted";
13076
+ attested: "attested";
13077
+ claimed: "claimed";
13078
+ measured: "measured";
13079
+ observed: "observed";
13080
+ }>;
13081
+ principal: z.ZodOptional<z.ZodObject<{
13082
+ kind: z.ZodEnum<{
13083
+ application: "application";
13084
+ core: "core";
13085
+ "flow-host": "flow-host";
13086
+ subject: "subject";
13087
+ trigger: "trigger";
13088
+ }>;
13089
+ id: z.ZodString;
13090
+ }, z.core.$strict>>;
13091
+ trace: z.ZodOptional<z.ZodObject<{
13092
+ traceId: z.ZodString;
13093
+ spanId: z.ZodString;
13094
+ parentSpanId: z.ZodOptional<z.ZodString>;
13095
+ }, z.core.$strip>>;
13096
+ visibility: z.ZodEnum<{
13097
+ internal: "internal";
13098
+ public: "public";
13099
+ restricted: "restricted";
13100
+ }>;
13101
+ retention: z.ZodEnum<{
13102
+ full: "full";
13103
+ metadata: "metadata";
13104
+ }>;
12785
13105
  } & {
12786
13106
  type: z.ZodLiteral<"queue.taken">;
12787
13107
  payload: z.ZodObject<{
@@ -13601,6 +13921,9 @@ export declare const SeedTenantConfigRequest: z.ZodObject<{
13601
13921
  lifecycle: z.ZodOptional<z.ZodObject<{
13602
13922
  stopGrace: z.ZodOptional<z.ZodString>;
13603
13923
  }, z.core.$strict>>;
13924
+ engine: z.ZodOptional<z.ZodObject<{
13925
+ images: z.ZodOptional<z.ZodArray<z.ZodString>>;
13926
+ }, z.core.$strict>>;
13604
13927
  placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
13605
13928
  hosts: z.ZodArray<z.ZodEnum<{
13606
13929
  "harness-container": "harness-container";
@@ -13894,6 +14217,9 @@ export declare const PutTenantEnvironmentsRequest: z.ZodObject<{
13894
14217
  lifecycle: z.ZodOptional<z.ZodObject<{
13895
14218
  stopGrace: z.ZodOptional<z.ZodString>;
13896
14219
  }, z.core.$strict>>;
14220
+ engine: z.ZodOptional<z.ZodObject<{
14221
+ images: z.ZodOptional<z.ZodArray<z.ZodString>>;
14222
+ }, z.core.$strict>>;
13897
14223
  placement: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
13898
14224
  hosts: z.ZodArray<z.ZodEnum<{
13899
14225
  "harness-container": "harness-container";
@@ -16425,6 +16751,86 @@ export declare const HistoryPage: z.ZodObject<{
16425
16751
  full: "full";
16426
16752
  metadata: "metadata";
16427
16753
  }>;
16754
+ } & {
16755
+ type: z.ZodLiteral<"plan.updated">;
16756
+ payload: z.ZodObject<{
16757
+ steps: z.ZodArray<z.ZodObject<{
16758
+ label: z.ZodString;
16759
+ state: z.ZodEnum<{
16760
+ active: "active";
16761
+ blocked: "blocked";
16762
+ done: "done";
16763
+ pending: "pending";
16764
+ skipped: "skipped";
16765
+ }>;
16766
+ note: z.ZodOptional<z.ZodString>;
16767
+ }, z.core.$loose>>;
16768
+ }, z.core.$loose>;
16769
+ }, z.core.$strip> | z.ZodObject<{
16770
+ schema: z.ZodLiteral<"nylorun.event/2">;
16771
+ eventId: z.ZodString;
16772
+ tenantId: z.ZodString;
16773
+ sessionId: z.ZodString;
16774
+ runId: z.ZodNullable<z.ZodString>;
16775
+ turnId: z.ZodNullable<z.ZodString>;
16776
+ incarnation: z.ZodNumber;
16777
+ epoch: z.ZodNumber;
16778
+ seq: z.ZodNumber;
16779
+ cursor: z.ZodString;
16780
+ time: z.ZodString;
16781
+ schemaVersion: z.ZodNumber;
16782
+ source: z.ZodObject<{
16783
+ kind: z.ZodEnum<{
16784
+ api: "api";
16785
+ client: "client";
16786
+ controller: "controller";
16787
+ core: "core";
16788
+ edge: "edge";
16789
+ "egress-gate": "egress-gate";
16790
+ evidence: "evidence";
16791
+ harness: "harness";
16792
+ human: "human";
16793
+ init: "init";
16794
+ loop: "loop";
16795
+ "model-gate": "model-gate";
16796
+ operator: "operator";
16797
+ sandboxes: "sandboxes";
16798
+ supervisor: "supervisor";
16799
+ "tool-gate": "tool-gate";
16800
+ }>;
16801
+ id: z.ZodString;
16802
+ }, z.core.$strip>;
16803
+ evidence: z.ZodEnum<{
16804
+ asserted: "asserted";
16805
+ attested: "attested";
16806
+ claimed: "claimed";
16807
+ measured: "measured";
16808
+ observed: "observed";
16809
+ }>;
16810
+ principal: z.ZodOptional<z.ZodObject<{
16811
+ kind: z.ZodEnum<{
16812
+ application: "application";
16813
+ core: "core";
16814
+ "flow-host": "flow-host";
16815
+ subject: "subject";
16816
+ trigger: "trigger";
16817
+ }>;
16818
+ id: z.ZodString;
16819
+ }, z.core.$strict>>;
16820
+ trace: z.ZodOptional<z.ZodObject<{
16821
+ traceId: z.ZodString;
16822
+ spanId: z.ZodString;
16823
+ parentSpanId: z.ZodOptional<z.ZodString>;
16824
+ }, z.core.$strip>>;
16825
+ visibility: z.ZodEnum<{
16826
+ internal: "internal";
16827
+ public: "public";
16828
+ restricted: "restricted";
16829
+ }>;
16830
+ retention: z.ZodEnum<{
16831
+ full: "full";
16832
+ metadata: "metadata";
16833
+ }>;
16428
16834
  } & {
16429
16835
  type: z.ZodLiteral<"queue.taken">;
16430
16836
  payload: z.ZodObject<{
@@ -19158,6 +19564,86 @@ export declare const HistoryPage: z.ZodObject<{
19158
19564
  full: "full";
19159
19565
  metadata: "metadata";
19160
19566
  }>;
19567
+ } & {
19568
+ type: z.ZodLiteral<"plan.updated">;
19569
+ payload: z.ZodObject<{
19570
+ steps: z.ZodArray<z.ZodObject<{
19571
+ label: z.ZodString;
19572
+ state: z.ZodEnum<{
19573
+ active: "active";
19574
+ blocked: "blocked";
19575
+ done: "done";
19576
+ pending: "pending";
19577
+ skipped: "skipped";
19578
+ }>;
19579
+ note: z.ZodOptional<z.ZodString>;
19580
+ }, z.core.$loose>>;
19581
+ }, z.core.$loose>;
19582
+ }, z.core.$strip> | z.ZodObject<{
19583
+ schema: z.ZodLiteral<"nylorun.event/2">;
19584
+ eventId: z.ZodString;
19585
+ tenantId: z.ZodString;
19586
+ sessionId: z.ZodString;
19587
+ runId: z.ZodNullable<z.ZodString>;
19588
+ turnId: z.ZodNullable<z.ZodString>;
19589
+ incarnation: z.ZodNumber;
19590
+ epoch: z.ZodNumber;
19591
+ seq: z.ZodNumber;
19592
+ cursor: z.ZodString;
19593
+ time: z.ZodString;
19594
+ schemaVersion: z.ZodNumber;
19595
+ source: z.ZodObject<{
19596
+ kind: z.ZodEnum<{
19597
+ api: "api";
19598
+ client: "client";
19599
+ controller: "controller";
19600
+ core: "core";
19601
+ edge: "edge";
19602
+ "egress-gate": "egress-gate";
19603
+ evidence: "evidence";
19604
+ harness: "harness";
19605
+ human: "human";
19606
+ init: "init";
19607
+ loop: "loop";
19608
+ "model-gate": "model-gate";
19609
+ operator: "operator";
19610
+ sandboxes: "sandboxes";
19611
+ supervisor: "supervisor";
19612
+ "tool-gate": "tool-gate";
19613
+ }>;
19614
+ id: z.ZodString;
19615
+ }, z.core.$strip>;
19616
+ evidence: z.ZodEnum<{
19617
+ asserted: "asserted";
19618
+ attested: "attested";
19619
+ claimed: "claimed";
19620
+ measured: "measured";
19621
+ observed: "observed";
19622
+ }>;
19623
+ principal: z.ZodOptional<z.ZodObject<{
19624
+ kind: z.ZodEnum<{
19625
+ application: "application";
19626
+ core: "core";
19627
+ "flow-host": "flow-host";
19628
+ subject: "subject";
19629
+ trigger: "trigger";
19630
+ }>;
19631
+ id: z.ZodString;
19632
+ }, z.core.$strict>>;
19633
+ trace: z.ZodOptional<z.ZodObject<{
19634
+ traceId: z.ZodString;
19635
+ spanId: z.ZodString;
19636
+ parentSpanId: z.ZodOptional<z.ZodString>;
19637
+ }, z.core.$strip>>;
19638
+ visibility: z.ZodEnum<{
19639
+ internal: "internal";
19640
+ public: "public";
19641
+ restricted: "restricted";
19642
+ }>;
19643
+ retention: z.ZodEnum<{
19644
+ full: "full";
19645
+ metadata: "metadata";
19646
+ }>;
19161
19647
  } & {
19162
19648
  type: z.ZodLiteral<"queue.taken">;
19163
19649
  payload: z.ZodObject<{
@@ -20416,6 +20902,58 @@ export declare const TurnTrace: z.ZodObject<{
20416
20902
  }, z.core.$loose>>;
20417
20903
  }, z.core.$loose>>;
20418
20904
  }, z.core.$loose>;
20905
+ export declare const TurnSummary: z.ZodObject<{
20906
+ turnId: z.ZodString;
20907
+ sessionId: z.ZodString;
20908
+ agentId: z.ZodString;
20909
+ status: z.ZodEnum<{
20910
+ cancelled: "cancelled";
20911
+ completed: "completed";
20912
+ failed: "failed";
20913
+ paused: "paused";
20914
+ running: "running";
20915
+ }>;
20916
+ startedAt: z.ZodString;
20917
+ endedAt: z.ZodNullable<z.ZodString>;
20918
+ changedAt: z.ZodString;
20919
+ totals: z.ZodNullable<z.ZodObject<{
20920
+ steps: z.ZodNumber;
20921
+ tokens: z.ZodNumber;
20922
+ costUsd: z.ZodNumber;
20923
+ }, z.core.$strict>>;
20924
+ a2a: z.ZodNullable<z.ZodObject<{
20925
+ contextId: z.ZodString;
20926
+ taskId: z.ZodString;
20927
+ }, z.core.$strict>>;
20928
+ }, z.core.$strict>;
20929
+ export declare const TurnChangesPage: z.ZodObject<{
20930
+ cursor: z.ZodString;
20931
+ hasMore: z.ZodBoolean;
20932
+ turns: z.ZodArray<z.ZodObject<{
20933
+ turnId: z.ZodString;
20934
+ sessionId: z.ZodString;
20935
+ agentId: z.ZodString;
20936
+ status: z.ZodEnum<{
20937
+ cancelled: "cancelled";
20938
+ completed: "completed";
20939
+ failed: "failed";
20940
+ paused: "paused";
20941
+ running: "running";
20942
+ }>;
20943
+ startedAt: z.ZodString;
20944
+ endedAt: z.ZodNullable<z.ZodString>;
20945
+ changedAt: z.ZodString;
20946
+ totals: z.ZodNullable<z.ZodObject<{
20947
+ steps: z.ZodNumber;
20948
+ tokens: z.ZodNumber;
20949
+ costUsd: z.ZodNumber;
20950
+ }, z.core.$strict>>;
20951
+ a2a: z.ZodNullable<z.ZodObject<{
20952
+ contextId: z.ZodString;
20953
+ taskId: z.ZodString;
20954
+ }, z.core.$strict>>;
20955
+ }, z.core.$strict>>;
20956
+ }, z.core.$strict>;
20419
20957
  export declare const MeResponse: z.ZodObject<{
20420
20958
  subject: z.ZodOptional<z.ZodString>;
20421
20959
  scopes: z.ZodArray<z.ZodEnum<{
@@ -5,7 +5,7 @@
5
5
  * global registry.
6
6
  */
7
7
  import { z } from "zod";
8
- import { PutSessionModelRequestSchema, SessionModelViewSchema, QueuedResponseSchema, TriggerListSchema, MemoryListSchema, MemorySchema, PutMemoryRequestSchema, MemoryVersionPageSchema, MemoryVersionDetailSchema, TriggerRunPageSchema, RunTriggerResponseSchema, WebhookSecretResponseSchema, WebhookAcceptedResponseSchema, AgentManifestV8Schema, EnvironmentSecretSlotsSchema, DeleteAgentManifestResponseSchema, AgentManifestPlanSchema, AgentManifestVersionsSchema, AgentManifestViewSchema, ListAgentManifestsResponseSchema, PutAgentManifestRequestSchema, PutAgentFolderRequestSchema, AgentManifestSourceSchema, AgentManifestSourceDiffSchema, PutAgentSecretValueRequestSchema, SaveAgentManifestResponseSchema, SessionListItemSchema, ModelCallSchema, SessionPageSchema, SessionManifestViewSchema, HistoryPageSchema, SessionUsageTotalsSchema, ModelCallsPageSchema, ModelCallExportPageSchema, AgentPageSchema, ToolCallSchema, ToolCallsPageSchema, TurnTraceSchema, JwksSchema, SigningKeyListSchema, SigningKeyViewSchema, RotateSigningKeysRequestSchema, RevokeSigningKeyRequestSchema, MeResponseSchema, TenantStatusSchema, ResetTenantRequestSchema, ResetTenantResponseSchema, SeedTenantConfigRequestSchema, SeedTenantConfigResponseSchema, HostModelCatalogSchema, TenantSandboxViewSchema, ModelUsageTotalsSchema, ModelBudgetsSchema, PutModelBudgetsRequestSchema, ToolPolicySchema, PutToolPolicyRequestSchema, PutModelInputsRequestSchema, ModelInputsViewSchema, PutTenantEnvironmentsRequestSchema, ListProvidersResponseSchema, HostModelViewSchema, PutHostModelRequestSchema, SelectHostModelRequestSchema, PutAgentSecretRequestSchema, AgentSecretViewSchema, ListAgentSecretsResponseSchema, McpPreviewRequestSchema, McpPreviewSchema, CredentialCoverageRequestSchema, CredentialCoverageSchema, DeletedResponseSchema, ListSessionsResponseSchema, LiveEventSchema, PutAgentRequestSchema, PutSessionRequestSchema, SessionItemsResponseSchema, SessionViewSchema, StreamClosedFrameSchema, AcceptedResponseSchema, SandboxToolOutcomeSchema, AgentViewSchema, AgentSnapshotSchema, RestoreAgentRequestSchema, ForkAgentRequestSchema, AgentForkPlanSchema, ForkAgentResponseSchema, PutAgentDryRunResponseSchema, RestartAgentRequestSchema, AgentRestoreSchema, AgentDiskVersionsSchema, ListAgentsResponseSchema, DeleteAgentResponseSchema, ListAgentEventsResponseSchema, ArtifactViewSchema, ArtifactListItemSchema, ArtifactPageSchema, ArtifactVersionViewSchema, ListArtifactsResponseSchema, UploadArtifactResponseSchema, DefinitionFileViewSchema, DeleteArtifactResponseSchema, CreateArtifactLinkRequestSchema, ArtifactLinkSchema, PutTenantArtifactsRequestSchema, PutTenantSkillsRequestSchema, PutTenantLimitsRequestSchema, TenantLimitsViewSchema, TenantArtifactsViewSchema, TenantSkillsViewSchema, ArtifactTreeSchema, ArtifactDiffSchema, SessionCommandSchema, ListOperatorKeysResponseSchema, PutOperatorKeyResponseSchema, DeleteOperatorKeyResponseSchema, OperatorKeySchema, ProtocolRejectedResponseSchema, RejectedResponseSchema, EVENT_SCHEMAS, EVENT_TYPES, } from "@nylorun/core/contracts";
8
+ import { PutSessionModelRequestSchema, SessionModelViewSchema, QueuedResponseSchema, TriggerListSchema, MemoryListSchema, MemorySchema, PutMemoryRequestSchema, MemoryVersionPageSchema, MemoryVersionDetailSchema, TriggerRunPageSchema, RunTriggerResponseSchema, WebhookSecretResponseSchema, WebhookAcceptedResponseSchema, AgentManifestV8Schema, EnvironmentSecretSlotsSchema, DeleteAgentManifestResponseSchema, AgentManifestPlanSchema, AgentManifestVersionsSchema, AgentManifestViewSchema, ListAgentManifestsResponseSchema, PutAgentManifestRequestSchema, PutAgentFolderRequestSchema, AgentManifestSourceSchema, AgentManifestSourceDiffSchema, PutAgentSecretValueRequestSchema, SaveAgentManifestResponseSchema, SessionListItemSchema, ModelCallSchema, SessionPageSchema, SessionManifestViewSchema, HistoryPageSchema, SessionUsageTotalsSchema, ModelCallsPageSchema, ModelCallExportPageSchema, AgentPageSchema, ToolCallSchema, ToolCallsPageSchema, TurnTraceSchema, TurnChangesPageSchema, TurnSummarySchema, JwksSchema, SigningKeyListSchema, SigningKeyViewSchema, RotateSigningKeysRequestSchema, RevokeSigningKeyRequestSchema, MeResponseSchema, TenantStatusSchema, ResetTenantRequestSchema, ResetTenantResponseSchema, SeedTenantConfigRequestSchema, SeedTenantConfigResponseSchema, HostModelCatalogSchema, TenantSandboxViewSchema, ModelUsageTotalsSchema, ModelBudgetsSchema, PutModelBudgetsRequestSchema, ToolPolicySchema, PutToolPolicyRequestSchema, PutModelInputsRequestSchema, ModelInputsViewSchema, PutTenantEnvironmentsRequestSchema, ListProvidersResponseSchema, HostModelViewSchema, PutHostModelRequestSchema, SelectHostModelRequestSchema, PutAgentSecretRequestSchema, AgentSecretViewSchema, ListAgentSecretsResponseSchema, McpPreviewRequestSchema, McpPreviewSchema, CredentialCoverageRequestSchema, CredentialCoverageSchema, DeletedResponseSchema, ListSessionsResponseSchema, LiveEventSchema, PutAgentRequestSchema, PutSessionRequestSchema, SessionItemsResponseSchema, SessionViewSchema, StreamClosedFrameSchema, AcceptedResponseSchema, SandboxToolOutcomeSchema, AgentViewSchema, AgentSnapshotSchema, RestoreAgentRequestSchema, ForkAgentRequestSchema, AgentForkPlanSchema, ForkAgentResponseSchema, PutAgentDryRunResponseSchema, RestartAgentRequestSchema, AgentRestoreSchema, AgentDiskVersionsSchema, ListAgentsResponseSchema, DeleteAgentResponseSchema, ListAgentEventsResponseSchema, ArtifactViewSchema, ArtifactListItemSchema, ArtifactPageSchema, ArtifactVersionViewSchema, ListArtifactsResponseSchema, UploadArtifactResponseSchema, DefinitionFileViewSchema, DeleteArtifactResponseSchema, CreateArtifactLinkRequestSchema, ArtifactLinkSchema, PutTenantArtifactsRequestSchema, PutTenantSkillsRequestSchema, PutTenantLimitsRequestSchema, TenantLimitsViewSchema, TenantArtifactsViewSchema, TenantSkillsViewSchema, ArtifactTreeSchema, ArtifactDiffSchema, SessionCommandSchema, ListOperatorKeysResponseSchema, PutOperatorKeyResponseSchema, DeleteOperatorKeyResponseSchema, OperatorKeySchema, ProtocolRejectedResponseSchema, RejectedResponseSchema, EVENT_SCHEMAS, EVENT_TYPES, } from "@nylorun/core/contracts";
9
9
  function named(id, schema) {
10
10
  return schema.meta({ id });
11
11
  }
@@ -135,4 +135,6 @@ export const AgentPage = named("AgentPage", AgentPageSchema.extend({ environment
135
135
  export const ToolCall = named("ToolCall", ToolCallSchema);
136
136
  export const ToolCallsPage = named("ToolCallsPage", ToolCallsPageSchema.extend({ calls: z.array(ToolCall) }));
137
137
  export const TurnTrace = named("TurnTrace", TurnTraceSchema);
138
+ export const TurnSummary = named("TurnSummary", TurnSummarySchema);
139
+ export const TurnChangesPage = named("TurnChangesPage", TurnChangesPageSchema.extend({ turns: z.array(TurnSummary) }));
138
140
  export const MeResponse = named("MeResponse", MeResponseSchema);
@@ -18,6 +18,7 @@ import { memoryRoutes } from "./routes/memories.js";
18
18
  import { agentManifestRoutes } from "./routes/agent-manifests.js";
19
19
  import { artifactRoutes } from "./routes/artifacts.js";
20
20
  import { readRoutes } from "./routes/reads.js";
21
+ import { turnRoutes } from "./routes/turns.js";
21
22
  import { sessionRoutes } from "./routes/sessions.js";
22
23
  import { fileRoutes } from "./routes/files.js";
23
24
  import { keyRoutes } from "./routes/keys.js";
@@ -82,5 +83,6 @@ function build() {
82
83
  return jsonResponse(rejection.status, rejection.body, rejection.headers);
83
84
  });
84
85
  readRoutes(api);
86
+ turnRoutes(api);
85
87
  return api;
86
88
  }
@@ -456,6 +456,25 @@ export function artifactRoutes(api) {
456
456
  const { artifact, version, manifest } = await folderContent(ctx, c.req.param("artifactId"), versionNumber(c.req.param("version")), accessOf(c.get("scope")));
457
457
  return zipResponse(ctx, artifact, version, manifest, c.req.raw);
458
458
  });
459
+ tenantRoute(api, { credentials: ["subject", "token"], scopes: ["sessions:own"] }, {
460
+ method: "get",
461
+ path: "/v1/a2a/files/{artifactId}/versions/{version}",
462
+ tags: ["A2A"],
463
+ summary: "Download a file an A2A task wrote",
464
+ description: "Where the `url` parts of an A2A task's file artifacts point (Host feature `a2a-profile-v2`, `files/v1`): a file version's bytes, with Range, or a folder version as a zip. Served only to the subject whose session wrote it, as the A2A endpoint is: send the same credential, `Nylorun-Subject` and `Nylorun-Scopes`. Another subject's artifact is a `404`.",
465
+ request: { params: versionParam },
466
+ responses: { 200: fileContent("The file, or the folder's zip"), ...ranged },
467
+ }, async (c) => {
468
+ const ctx = c.env.tenant;
469
+ const access = accessOf(c.get("scope")) ??
470
+ fail(400, "Acting for a subject is required: send Nylorun-Subject and Nylorun-Scopes", {
471
+ code: "subject_required",
472
+ });
473
+ const { artifact, version } = await artifactContent(ctx, c.req.param("artifactId"), versionNumber(c.req.param("version")), access);
474
+ if (artifact.kind === "file")
475
+ return contentResponse(ctx, fileOf(artifact, version), c.req.raw);
476
+ return zipResponse(ctx, artifact, version, await readManifest(ctx.blobs, version), c.req.raw);
477
+ });
459
478
  tenantRoute(api, OWN, {
460
479
  method: "post",
461
480
  path: "/v1/artifacts/{artifactId}/links",
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `GET /v1/turns` (Host feature `turns`): the turn index's change feed. Turns in the order their
3
+ * transactions changed them, a turn again each time it changes, after `changedAfter` (the
4
+ * `cursor` a page returned); with `sessionId`, one session's, which come in the order they
5
+ * started, since a session runs one turn at a time. An application key reads the whole Tenant,
6
+ * a subject or a token only its own sessions' turns (and a token only its Agents'). A client
7
+ * that missed pushes, or follows many sessions, catches up with one call per interval.
8
+ */
9
+ import type { OpenAPIHono } from "@hono/zod-openapi";
10
+ import type { TurnSummary as TurnBody } from "@nylorun/core/contracts";
11
+ import type { TurnRow } from "../../../store/types.js";
12
+ import type { TenantEnv } from "../app.js";
13
+ /** A page's size when the query names none, and the most one holds. */
14
+ export declare const TURNS_PAGE_DEFAULT = 100;
15
+ export declare const TURNS_PAGE_MAX = 500;
16
+ /** A turn index row as the API shows it. */
17
+ export declare function turnSummary(row: TurnRow): TurnBody;
18
+ export declare function turnRoutes(api: OpenAPIHono<TenantEnv>): void;