@nylorun/runtime 0.36.1-beta → 0.37.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 (59) hide show
  1. package/CHANGELOG.md +49 -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 +532 -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/host/config-for.d.ts +2 -0
  29. package/dist/host/config-for.js +1 -0
  30. package/dist/host/main.js +1 -0
  31. package/dist/host/stack-config.d.ts +16 -0
  32. package/dist/host/stack-config.js +30 -0
  33. package/dist/management-openapi.json +5 -2
  34. package/dist/openapi.json +1485 -738
  35. package/dist/reads/types.d.ts +19 -0
  36. package/dist/store/postgres/drizzle/0039_a2a_push.sql +32 -0
  37. package/dist/store/postgres/drizzle/0040_turn_index.sql +23 -0
  38. package/dist/store/postgres/drizzle/0041_turn_index_backfill.sql +88 -0
  39. package/dist/store/postgres/drizzle/meta/_journal.json +21 -0
  40. package/dist/store/postgres/reads.js +41 -1
  41. package/dist/store/postgres/schema.d.ts +1296 -534
  42. package/dist/store/postgres/schema.js +92 -0
  43. package/dist/store/postgres/store.js +133 -3
  44. package/dist/store/postgres/turns.d.ts +62 -0
  45. package/dist/store/postgres/turns.js +153 -0
  46. package/dist/store/types.d.ts +73 -3
  47. package/dist/tenant/runtime.js +7 -5
  48. package/dist/tenant/session-model.d.ts +11 -1
  49. package/dist/tenant/session-model.js +34 -5
  50. package/dist/tenant/sessions.d.ts +2 -1
  51. package/dist/tenant/sessions.js +8 -2
  52. package/dist/tenant/sweep.d.ts +3 -0
  53. package/dist/tenant/sweep.js +39 -11
  54. package/dist/tenant/types.d.ts +23 -0
  55. package/dist/tuning.d.ts +9 -0
  56. package/dist/tuning.js +11 -0
  57. package/dist/version.d.ts +1 -1
  58. package/dist/version.js +1 -1
  59. 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<{
@@ -16425,6 +16745,86 @@ export declare const HistoryPage: z.ZodObject<{
16425
16745
  full: "full";
16426
16746
  metadata: "metadata";
16427
16747
  }>;
16748
+ } & {
16749
+ type: z.ZodLiteral<"plan.updated">;
16750
+ payload: z.ZodObject<{
16751
+ steps: z.ZodArray<z.ZodObject<{
16752
+ label: z.ZodString;
16753
+ state: z.ZodEnum<{
16754
+ active: "active";
16755
+ blocked: "blocked";
16756
+ done: "done";
16757
+ pending: "pending";
16758
+ skipped: "skipped";
16759
+ }>;
16760
+ note: z.ZodOptional<z.ZodString>;
16761
+ }, z.core.$loose>>;
16762
+ }, z.core.$loose>;
16763
+ }, z.core.$strip> | z.ZodObject<{
16764
+ schema: z.ZodLiteral<"nylorun.event/2">;
16765
+ eventId: z.ZodString;
16766
+ tenantId: z.ZodString;
16767
+ sessionId: z.ZodString;
16768
+ runId: z.ZodNullable<z.ZodString>;
16769
+ turnId: z.ZodNullable<z.ZodString>;
16770
+ incarnation: z.ZodNumber;
16771
+ epoch: z.ZodNumber;
16772
+ seq: z.ZodNumber;
16773
+ cursor: z.ZodString;
16774
+ time: z.ZodString;
16775
+ schemaVersion: z.ZodNumber;
16776
+ source: z.ZodObject<{
16777
+ kind: z.ZodEnum<{
16778
+ api: "api";
16779
+ client: "client";
16780
+ controller: "controller";
16781
+ core: "core";
16782
+ edge: "edge";
16783
+ "egress-gate": "egress-gate";
16784
+ evidence: "evidence";
16785
+ harness: "harness";
16786
+ human: "human";
16787
+ init: "init";
16788
+ loop: "loop";
16789
+ "model-gate": "model-gate";
16790
+ operator: "operator";
16791
+ sandboxes: "sandboxes";
16792
+ supervisor: "supervisor";
16793
+ "tool-gate": "tool-gate";
16794
+ }>;
16795
+ id: z.ZodString;
16796
+ }, z.core.$strip>;
16797
+ evidence: z.ZodEnum<{
16798
+ asserted: "asserted";
16799
+ attested: "attested";
16800
+ claimed: "claimed";
16801
+ measured: "measured";
16802
+ observed: "observed";
16803
+ }>;
16804
+ principal: z.ZodOptional<z.ZodObject<{
16805
+ kind: z.ZodEnum<{
16806
+ application: "application";
16807
+ core: "core";
16808
+ "flow-host": "flow-host";
16809
+ subject: "subject";
16810
+ trigger: "trigger";
16811
+ }>;
16812
+ id: z.ZodString;
16813
+ }, z.core.$strict>>;
16814
+ trace: z.ZodOptional<z.ZodObject<{
16815
+ traceId: z.ZodString;
16816
+ spanId: z.ZodString;
16817
+ parentSpanId: z.ZodOptional<z.ZodString>;
16818
+ }, z.core.$strip>>;
16819
+ visibility: z.ZodEnum<{
16820
+ internal: "internal";
16821
+ public: "public";
16822
+ restricted: "restricted";
16823
+ }>;
16824
+ retention: z.ZodEnum<{
16825
+ full: "full";
16826
+ metadata: "metadata";
16827
+ }>;
16428
16828
  } & {
16429
16829
  type: z.ZodLiteral<"queue.taken">;
16430
16830
  payload: z.ZodObject<{
@@ -19158,6 +19558,86 @@ export declare const HistoryPage: z.ZodObject<{
19158
19558
  full: "full";
19159
19559
  metadata: "metadata";
19160
19560
  }>;
19561
+ } & {
19562
+ type: z.ZodLiteral<"plan.updated">;
19563
+ payload: z.ZodObject<{
19564
+ steps: z.ZodArray<z.ZodObject<{
19565
+ label: z.ZodString;
19566
+ state: z.ZodEnum<{
19567
+ active: "active";
19568
+ blocked: "blocked";
19569
+ done: "done";
19570
+ pending: "pending";
19571
+ skipped: "skipped";
19572
+ }>;
19573
+ note: z.ZodOptional<z.ZodString>;
19574
+ }, z.core.$loose>>;
19575
+ }, z.core.$loose>;
19576
+ }, z.core.$strip> | z.ZodObject<{
19577
+ schema: z.ZodLiteral<"nylorun.event/2">;
19578
+ eventId: z.ZodString;
19579
+ tenantId: z.ZodString;
19580
+ sessionId: z.ZodString;
19581
+ runId: z.ZodNullable<z.ZodString>;
19582
+ turnId: z.ZodNullable<z.ZodString>;
19583
+ incarnation: z.ZodNumber;
19584
+ epoch: z.ZodNumber;
19585
+ seq: z.ZodNumber;
19586
+ cursor: z.ZodString;
19587
+ time: z.ZodString;
19588
+ schemaVersion: z.ZodNumber;
19589
+ source: z.ZodObject<{
19590
+ kind: z.ZodEnum<{
19591
+ api: "api";
19592
+ client: "client";
19593
+ controller: "controller";
19594
+ core: "core";
19595
+ edge: "edge";
19596
+ "egress-gate": "egress-gate";
19597
+ evidence: "evidence";
19598
+ harness: "harness";
19599
+ human: "human";
19600
+ init: "init";
19601
+ loop: "loop";
19602
+ "model-gate": "model-gate";
19603
+ operator: "operator";
19604
+ sandboxes: "sandboxes";
19605
+ supervisor: "supervisor";
19606
+ "tool-gate": "tool-gate";
19607
+ }>;
19608
+ id: z.ZodString;
19609
+ }, z.core.$strip>;
19610
+ evidence: z.ZodEnum<{
19611
+ asserted: "asserted";
19612
+ attested: "attested";
19613
+ claimed: "claimed";
19614
+ measured: "measured";
19615
+ observed: "observed";
19616
+ }>;
19617
+ principal: z.ZodOptional<z.ZodObject<{
19618
+ kind: z.ZodEnum<{
19619
+ application: "application";
19620
+ core: "core";
19621
+ "flow-host": "flow-host";
19622
+ subject: "subject";
19623
+ trigger: "trigger";
19624
+ }>;
19625
+ id: z.ZodString;
19626
+ }, z.core.$strict>>;
19627
+ trace: z.ZodOptional<z.ZodObject<{
19628
+ traceId: z.ZodString;
19629
+ spanId: z.ZodString;
19630
+ parentSpanId: z.ZodOptional<z.ZodString>;
19631
+ }, z.core.$strip>>;
19632
+ visibility: z.ZodEnum<{
19633
+ internal: "internal";
19634
+ public: "public";
19635
+ restricted: "restricted";
19636
+ }>;
19637
+ retention: z.ZodEnum<{
19638
+ full: "full";
19639
+ metadata: "metadata";
19640
+ }>;
19161
19641
  } & {
19162
19642
  type: z.ZodLiteral<"queue.taken">;
19163
19643
  payload: z.ZodObject<{
@@ -20416,6 +20896,58 @@ export declare const TurnTrace: z.ZodObject<{
20416
20896
  }, z.core.$loose>>;
20417
20897
  }, z.core.$loose>>;
20418
20898
  }, z.core.$loose>;
20899
+ export declare const TurnSummary: z.ZodObject<{
20900
+ turnId: z.ZodString;
20901
+ sessionId: z.ZodString;
20902
+ agentId: z.ZodString;
20903
+ status: z.ZodEnum<{
20904
+ cancelled: "cancelled";
20905
+ completed: "completed";
20906
+ failed: "failed";
20907
+ paused: "paused";
20908
+ running: "running";
20909
+ }>;
20910
+ startedAt: z.ZodString;
20911
+ endedAt: z.ZodNullable<z.ZodString>;
20912
+ changedAt: z.ZodString;
20913
+ totals: z.ZodNullable<z.ZodObject<{
20914
+ steps: z.ZodNumber;
20915
+ tokens: z.ZodNumber;
20916
+ costUsd: z.ZodNumber;
20917
+ }, z.core.$strict>>;
20918
+ a2a: z.ZodNullable<z.ZodObject<{
20919
+ contextId: z.ZodString;
20920
+ taskId: z.ZodString;
20921
+ }, z.core.$strict>>;
20922
+ }, z.core.$strict>;
20923
+ export declare const TurnChangesPage: z.ZodObject<{
20924
+ cursor: z.ZodString;
20925
+ hasMore: z.ZodBoolean;
20926
+ turns: z.ZodArray<z.ZodObject<{
20927
+ turnId: z.ZodString;
20928
+ sessionId: z.ZodString;
20929
+ agentId: z.ZodString;
20930
+ status: z.ZodEnum<{
20931
+ cancelled: "cancelled";
20932
+ completed: "completed";
20933
+ failed: "failed";
20934
+ paused: "paused";
20935
+ running: "running";
20936
+ }>;
20937
+ startedAt: z.ZodString;
20938
+ endedAt: z.ZodNullable<z.ZodString>;
20939
+ changedAt: z.ZodString;
20940
+ totals: z.ZodNullable<z.ZodObject<{
20941
+ steps: z.ZodNumber;
20942
+ tokens: z.ZodNumber;
20943
+ costUsd: z.ZodNumber;
20944
+ }, z.core.$strict>>;
20945
+ a2a: z.ZodNullable<z.ZodObject<{
20946
+ contextId: z.ZodString;
20947
+ taskId: z.ZodString;
20948
+ }, z.core.$strict>>;
20949
+ }, z.core.$strict>>;
20950
+ }, z.core.$strict>;
20419
20951
  export declare const MeResponse: z.ZodObject<{
20420
20952
  subject: z.ZodOptional<z.ZodString>;
20421
20953
  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;