@nylorun/core 0.13.0-beta → 0.16.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 (90) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/dist/compatibility.d.ts +68 -25
  3. package/dist/compatibility.js +67 -27
  4. package/dist/contracts.d.ts +325 -959
  5. package/dist/contracts.js +281 -516
  6. package/dist/define.d.ts +13 -10
  7. package/dist/define.js +7 -4
  8. package/dist/definition/assemble.d.ts +0 -3
  9. package/dist/definition/assemble.js +13 -19
  10. package/dist/definition/bind-agent.js +0 -2
  11. package/dist/definition/bind-tool.js +0 -1
  12. package/dist/definition/bound.d.ts +3 -10
  13. package/dist/definition/builder.d.ts +19 -55
  14. package/dist/definition/builder.js +19 -130
  15. package/dist/definition/capability.d.ts +3 -15
  16. package/dist/definition/capability.js +3 -25
  17. package/dist/definition/code-tools.d.ts +22 -0
  18. package/dist/definition/code-tools.js +46 -0
  19. package/dist/definition/declaration.d.ts +0 -3
  20. package/dist/definition/declaration.js +8 -11
  21. package/dist/definition/delegate.d.ts +7 -7
  22. package/dist/definition/flow/compile.d.ts +4 -5
  23. package/dist/definition/flow/compile.js +120 -72
  24. package/dist/definition/flow/from.d.ts +2 -2
  25. package/dist/definition/flow/from.js +14 -33
  26. package/dist/definition/flow/index.d.ts +2 -2
  27. package/dist/definition/flow/index.js +2 -2
  28. package/dist/definition/flow/paths.d.ts +32 -17
  29. package/dist/definition/flow/paths.js +35 -14
  30. package/dist/definition/flow/spec.d.ts +6 -9
  31. package/dist/definition/flow/spec.js +49 -31
  32. package/dist/definition/flow/types.d.ts +40 -116
  33. package/dist/definition/from.js +36 -41
  34. package/dist/definition/helpers.d.ts +1 -1
  35. package/dist/definition/helpers.js +1 -1
  36. package/dist/definition/http-tool.d.ts +66 -0
  37. package/dist/definition/http-tool.js +131 -0
  38. package/dist/definition/implementations.d.ts +0 -3
  39. package/dist/definition/manifest.js +5 -4
  40. package/dist/definition/mcp.d.ts +4 -2
  41. package/dist/definition/mcp.js +14 -18
  42. package/dist/definition/removed.d.ts +10 -0
  43. package/dist/definition/removed.js +26 -0
  44. package/dist/definition/sandbox-capability.d.ts +2 -0
  45. package/dist/definition/sandbox-capability.js +11 -1
  46. package/dist/definition/schema.js +0 -3
  47. package/dist/definition/skill-tools.d.ts +16 -2
  48. package/dist/definition/skill-tools.js +38 -31
  49. package/dist/definition/variant.d.ts +1 -1
  50. package/dist/definition/variant.js +3 -14
  51. package/dist/definition/workflow/diagnostics.d.ts +1 -7
  52. package/dist/definition/workflow/diagnostics.js +1 -24
  53. package/dist/definition/workflow/index.d.ts +3 -17
  54. package/dist/definition/workflow/index.js +2 -9
  55. package/dist/definition/workflow/runnable.d.ts +2 -34
  56. package/dist/definition/workflow/runnable.js +8 -142
  57. package/dist/definition/workflow/types.d.ts +1 -10
  58. package/dist/harness-api/messages.d.ts +24 -27
  59. package/dist/harness-api/messages.js +1 -1
  60. package/dist/harness-api/schema.d.ts +0 -16
  61. package/dist/harness-api/schema.js +5 -12
  62. package/dist/index.d.ts +1 -1
  63. package/dist/types/manifest.d.ts +41 -14
  64. package/dist/types/middleware.d.ts +11 -16
  65. package/dist/types/observe.d.ts +0 -6
  66. package/dist/types/tool.d.ts +0 -6
  67. package/dist/types/workflow.d.ts +54 -110
  68. package/dist/utils/definition-files.d.ts +31 -0
  69. package/dist/utils/definition-files.js +84 -0
  70. package/package.json +1 -1
  71. package/dist/definition/hooks.d.ts +0 -19
  72. package/dist/definition/hooks.js +0 -67
  73. package/dist/definition/workflow/build.d.ts +0 -28
  74. package/dist/definition/workflow/build.js +0 -40
  75. package/dist/definition/workflow/chain.d.ts +0 -49
  76. package/dist/definition/workflow/chain.js +0 -40
  77. package/dist/definition/workflow/loop.d.ts +0 -54
  78. package/dist/definition/workflow/loop.js +0 -100
  79. package/dist/definition/workflow/map.d.ts +0 -17
  80. package/dist/definition/workflow/map.js +0 -45
  81. package/dist/definition/workflow/parallel.d.ts +0 -19
  82. package/dist/definition/workflow/parallel.js +0 -36
  83. package/dist/definition/workflow/patch.d.ts +0 -11
  84. package/dist/definition/workflow/patch.js +0 -45
  85. package/dist/definition/workflow/slot.d.ts +0 -23
  86. package/dist/definition/workflow/slot.js +0 -16
  87. package/dist/definition/workflow/switch.d.ts +0 -26
  88. package/dist/definition/workflow/switch.js +0 -64
  89. package/dist/types/dynamics.d.ts +0 -101
  90. package/dist/types/dynamics.js +0 -1
@@ -6,6 +6,7 @@ import type { WorkflowManifest } from "./types/workflow.js";
6
6
  export type { AgentManifest } from "./types/manifest.js";
7
7
  export type { WorkflowManifest } from "./types/workflow.js";
8
8
  export { PROTOCOL_VERSION, ERROR_CODES } from "./compatibility.js";
9
+ export { DEFINITION_FILE_MAX_BYTES, SKILL_FILES_MAX, definitionFilesOf, isDefinitionFileHash, } from "./utils/definition-files.js";
9
10
  export type { ErrorCode } from "./compatibility.js";
10
11
  export declare const RequestIdSchema: z.ZodString;
11
12
  export declare const IdempotencyKeySchema: z.ZodString;
@@ -19,7 +20,6 @@ export declare const PutAgentRequestSchema: z.ZodObject<{
19
20
  requestId: z.ZodString;
20
21
  manifest: z.ZodUnion<readonly [z.ZodType<AgentManifest, unknown, z.core.$ZodTypeInternals<AgentManifest, unknown>>, z.ZodType<WorkflowManifest, unknown, z.core.$ZodTypeInternals<WorkflowManifest, unknown>>]>;
21
22
  implementationVersion: z.ZodString;
22
- pluginRoots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
23
23
  }, z.core.$strict>;
24
24
  export type PutAgentRequest = z.infer<typeof PutAgentRequestSchema>;
25
25
  export declare const CredentialSelectionSchema: z.ZodObject<{
@@ -638,11 +638,12 @@ export declare const MessageEventBodySchema: z.ZodUnion<readonly [z.ZodObject<{
638
638
  version: z.ZodOptional<z.ZodNumber>;
639
639
  }, z.core.$strict>], "type">>;
640
640
  }, z.core.$strict>]>;
641
- export declare const ActionOutcomeSchema: z.ZodObject<{
641
+ /** What one effect came to: its value, and the agent state it changes. */
642
+ export declare const EffectOutcomeSchema: z.ZodObject<{
642
643
  value: z.ZodUnknown;
643
644
  statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
644
645
  }, z.core.$strict>;
645
- export type ActionOutcome = z.infer<typeof ActionOutcomeSchema>;
646
+ export type EffectOutcome = z.infer<typeof EffectOutcomeSchema>;
646
647
  export declare const SessionCommandSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
647
648
  requestId: z.ZodString;
648
649
  idempotencyKey: z.ZodString;
@@ -747,7 +748,7 @@ export declare const EventSourceKindSchema: z.ZodEnum<{
747
748
  loop: "loop";
748
749
  "model-gate": "model-gate";
749
750
  operator: "operator";
750
- sandboxd: "sandboxd";
751
+ sandboxes: "sandboxes";
751
752
  supervisor: "supervisor";
752
753
  "tool-gate": "tool-gate";
753
754
  }>;
@@ -798,7 +799,7 @@ declare const eventEnvelope: {
798
799
  loop: "loop";
799
800
  "model-gate": "model-gate";
800
801
  operator: "operator";
801
- sandboxd: "sandboxd";
802
+ sandboxes: "sandboxes";
802
803
  supervisor: "supervisor";
803
804
  "tool-gate": "tool-gate";
804
805
  }>;
@@ -856,7 +857,7 @@ export declare const LiveEventSchema: z.ZodObject<{
856
857
  loop: "loop";
857
858
  "model-gate": "model-gate";
858
859
  operator: "operator";
859
- sandboxd: "sandboxd";
860
+ sandboxes: "sandboxes";
860
861
  supervisor: "supervisor";
861
862
  "tool-gate": "tool-gate";
862
863
  }>;
@@ -899,11 +900,15 @@ export declare const RejectedResponseSchema: z.ZodObject<{
899
900
  status: z.ZodLiteral<"rejected">;
900
901
  code: z.ZodEnum<{
901
902
  connection_missing: "connection_missing";
903
+ credential_invalid: "credential_invalid";
904
+ credential_required: "credential_required";
905
+ definition_files_missing: "definition_files_missing";
902
906
  host_rejected: "host_rejected";
903
907
  incompatible_host: "incompatible_host";
904
908
  internal_error: "internal_error";
905
909
  invalid_request: "invalid_request";
906
910
  issuer_unavailable: "issuer_unavailable";
911
+ key_role_mismatch: "key_role_mismatch";
907
912
  limit_exceeded: "limit_exceeded";
908
913
  not_found: "not_found";
909
914
  oauth_client_required: "oauth_client_required";
@@ -936,164 +941,6 @@ export declare const AgentRefSchema: z.ZodObject<{
936
941
  path: z.ZodString;
937
942
  delegationId: z.ZodOptional<z.ZodString>;
938
943
  }, z.core.$strict>;
939
- /** The hook point an action runs, and the capabilities that registered it (manifest order). */
940
- export declare const ActionHookSchema: z.ZodObject<{
941
- at: z.ZodEnum<{
942
- after: "after";
943
- before: "before";
944
- }>;
945
- scope: z.ZodEnum<{
946
- step: "step";
947
- turn: "turn";
948
- }>;
949
- capabilityIds: z.ZodArray<z.ZodString>;
950
- }, z.core.$strict>;
951
- export type ActionHook = z.infer<typeof ActionHookSchema>;
952
- export declare const ActionSchema: z.ZodUnion<readonly [z.ZodObject<{
953
- actionId: z.ZodString;
954
- sessionId: z.ZodString;
955
- turnId: z.ZodString;
956
- agentId: z.ZodString;
957
- manifestHash: z.ZodString;
958
- implementationVersion: z.ZodString;
959
- input: z.ZodUnknown;
960
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
961
- status: z.ZodEnum<{
962
- cancelled: "cancelled";
963
- completed: "completed";
964
- delivering: "delivering";
965
- pending: "pending";
966
- uncertain: "uncertain";
967
- }>;
968
- generation: z.ZodNumber;
969
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
970
- agent: z.ZodOptional<z.ZodObject<{
971
- id: z.ZodString;
972
- path: z.ZodString;
973
- delegationId: z.ZodOptional<z.ZodString>;
974
- }, z.core.$strict>>;
975
- kind: z.ZodLiteral<"tool">;
976
- capabilityId: z.ZodString;
977
- toolName: z.ZodString;
978
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
979
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
980
- }, z.core.$strict>, z.ZodObject<{
981
- actionId: z.ZodString;
982
- sessionId: z.ZodString;
983
- turnId: z.ZodString;
984
- agentId: z.ZodString;
985
- manifestHash: z.ZodString;
986
- implementationVersion: z.ZodString;
987
- input: z.ZodUnknown;
988
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
989
- status: z.ZodEnum<{
990
- cancelled: "cancelled";
991
- completed: "completed";
992
- delivering: "delivering";
993
- pending: "pending";
994
- uncertain: "uncertain";
995
- }>;
996
- generation: z.ZodNumber;
997
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
998
- agent: z.ZodOptional<z.ZodObject<{
999
- id: z.ZodString;
1000
- path: z.ZodString;
1001
- delegationId: z.ZodOptional<z.ZodString>;
1002
- }, z.core.$strict>>;
1003
- kind: z.ZodLiteral<"tool">;
1004
- path: z.ZodString;
1005
- key: z.ZodString;
1006
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1007
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1008
- }, z.core.$strict>, z.ZodObject<{
1009
- actionId: z.ZodString;
1010
- sessionId: z.ZodString;
1011
- turnId: z.ZodString;
1012
- agentId: z.ZodString;
1013
- manifestHash: z.ZodString;
1014
- implementationVersion: z.ZodString;
1015
- input: z.ZodUnknown;
1016
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1017
- status: z.ZodEnum<{
1018
- cancelled: "cancelled";
1019
- completed: "completed";
1020
- delivering: "delivering";
1021
- pending: "pending";
1022
- uncertain: "uncertain";
1023
- }>;
1024
- generation: z.ZodNumber;
1025
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1026
- agent: z.ZodOptional<z.ZodObject<{
1027
- id: z.ZodString;
1028
- path: z.ZodString;
1029
- delegationId: z.ZodOptional<z.ZodString>;
1030
- }, z.core.$strict>>;
1031
- kind: z.ZodLiteral<"hook">;
1032
- hook: z.ZodObject<{
1033
- at: z.ZodEnum<{
1034
- after: "after";
1035
- before: "before";
1036
- }>;
1037
- scope: z.ZodEnum<{
1038
- step: "step";
1039
- turn: "turn";
1040
- }>;
1041
- capabilityIds: z.ZodArray<z.ZodString>;
1042
- }, z.core.$strict>;
1043
- }, z.core.$strict>, z.ZodObject<{
1044
- actionId: z.ZodString;
1045
- sessionId: z.ZodString;
1046
- turnId: z.ZodString;
1047
- agentId: z.ZodString;
1048
- manifestHash: z.ZodString;
1049
- implementationVersion: z.ZodString;
1050
- input: z.ZodUnknown;
1051
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1052
- status: z.ZodEnum<{
1053
- cancelled: "cancelled";
1054
- completed: "completed";
1055
- delivering: "delivering";
1056
- pending: "pending";
1057
- uncertain: "uncertain";
1058
- }>;
1059
- generation: z.ZodNumber;
1060
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1061
- agent: z.ZodOptional<z.ZodObject<{
1062
- id: z.ZodString;
1063
- path: z.ZodString;
1064
- delegationId: z.ZodOptional<z.ZodString>;
1065
- }, z.core.$strict>>;
1066
- kind: z.ZodLiteral<"fn">;
1067
- path: z.ZodString;
1068
- key: z.ZodString;
1069
- }, z.core.$strict>, z.ZodObject<{
1070
- actionId: z.ZodString;
1071
- sessionId: z.ZodString;
1072
- turnId: z.ZodString;
1073
- agentId: z.ZodString;
1074
- manifestHash: z.ZodString;
1075
- implementationVersion: z.ZodString;
1076
- input: z.ZodUnknown;
1077
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1078
- status: z.ZodEnum<{
1079
- cancelled: "cancelled";
1080
- completed: "completed";
1081
- delivering: "delivering";
1082
- pending: "pending";
1083
- uncertain: "uncertain";
1084
- }>;
1085
- generation: z.ZodNumber;
1086
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1087
- agent: z.ZodOptional<z.ZodObject<{
1088
- id: z.ZodString;
1089
- path: z.ZodString;
1090
- delegationId: z.ZodOptional<z.ZodString>;
1091
- }, z.core.$strict>>;
1092
- kind: z.ZodLiteral<"verify">;
1093
- path: z.ZodString;
1094
- key: z.ZodString;
1095
- }, z.core.$strict>]>;
1096
- export type Action = z.infer<typeof ActionSchema>;
1097
944
  /**
1098
945
  * `message.assistant`: one completed model step. `invocationId` is the model call's.
1099
946
  * `model`, `finishReason` and `usage` are present when the provider reported them.
@@ -1151,7 +998,7 @@ export declare const ContextCompactedPayloadSchema: z.ZodObject<{
1151
998
  tokensBefore: z.ZodNumber;
1152
999
  tokensAfter: z.ZodNumber;
1153
1000
  }, z.core.$loose>;
1154
- /** `tool.completed`: an MCP or sandbox tool the Runtime ran. `error` for a tool error. */
1001
+ /** `tool.completed`: a tool the Runtime ran (HTTP, MCP, sandbox, built-in). `error` for a tool error. */
1155
1002
  export declare const ToolCompletedPayloadSchema: z.ZodObject<{
1156
1003
  agent: z.ZodOptional<z.ZodObject<{
1157
1004
  id: z.ZodString;
@@ -1168,44 +1015,6 @@ export declare const ToolCompletedPayloadSchema: z.ZodObject<{
1168
1015
  message: z.ZodString;
1169
1016
  }, z.core.$loose>>;
1170
1017
  }, z.core.$loose>;
1171
- export declare const ActionPendingPayloadSchema: z.ZodObject<{
1172
- agent: z.ZodOptional<z.ZodObject<{
1173
- id: z.ZodString;
1174
- path: z.ZodString;
1175
- delegationId: z.ZodOptional<z.ZodString>;
1176
- }, z.core.$loose>>;
1177
- actionId: z.ZodString;
1178
- kind: z.ZodString;
1179
- toolName: z.ZodOptional<z.ZodString>;
1180
- path: z.ZodOptional<z.ZodString>;
1181
- key: z.ZodOptional<z.ZodString>;
1182
- callId: z.ZodOptional<z.ZodString>;
1183
- invocationId: z.ZodOptional<z.ZodString>;
1184
- input: z.ZodUnknown;
1185
- }, z.core.$loose>;
1186
- export declare const ActionCompletedPayloadSchema: z.ZodObject<{
1187
- agent: z.ZodOptional<z.ZodObject<{
1188
- id: z.ZodString;
1189
- path: z.ZodString;
1190
- delegationId: z.ZodOptional<z.ZodString>;
1191
- }, z.core.$loose>>;
1192
- actionId: z.ZodString;
1193
- kind: z.ZodString;
1194
- toolName: z.ZodOptional<z.ZodString>;
1195
- path: z.ZodOptional<z.ZodString>;
1196
- key: z.ZodOptional<z.ZodString>;
1197
- callId: z.ZodOptional<z.ZodString>;
1198
- invocationId: z.ZodOptional<z.ZodString>;
1199
- result: z.ZodUnknown;
1200
- }, z.core.$loose>;
1201
- export declare const ActionUncertainPayloadSchema: z.ZodObject<{
1202
- agent: z.ZodOptional<z.ZodObject<{
1203
- id: z.ZodString;
1204
- path: z.ZodString;
1205
- delegationId: z.ZodOptional<z.ZodString>;
1206
- }, z.core.$loose>>;
1207
- actionId: z.ZodString;
1208
- }, z.core.$loose>;
1209
1018
  export declare const EffectUncertainPayloadSchema: z.ZodObject<{
1210
1019
  effectId: z.ZodString;
1211
1020
  message: z.ZodOptional<z.ZodString>;
@@ -1216,6 +1025,7 @@ export declare const TurnCompletedPayloadSchema: z.ZodObject<{
1216
1025
  export declare const TurnPausedPayloadSchema: z.ZodObject<{
1217
1026
  interactions: z.ZodArray<z.ZodObject<{
1218
1027
  invocationId: z.ZodString;
1028
+ callId: z.ZodOptional<z.ZodString>;
1219
1029
  interaction: z.ZodObject<{
1220
1030
  id: z.ZodString;
1221
1031
  kind: z.ZodString;
@@ -1305,44 +1115,6 @@ declare const TRANSCRIPT_PAYLOADS: {
1305
1115
  message: z.ZodString;
1306
1116
  }, z.core.$loose>>;
1307
1117
  }, z.core.$loose>;
1308
- readonly "action.pending": z.ZodObject<{
1309
- agent: z.ZodOptional<z.ZodObject<{
1310
- id: z.ZodString;
1311
- path: z.ZodString;
1312
- delegationId: z.ZodOptional<z.ZodString>;
1313
- }, z.core.$loose>>;
1314
- actionId: z.ZodString;
1315
- kind: z.ZodString;
1316
- toolName: z.ZodOptional<z.ZodString>;
1317
- path: z.ZodOptional<z.ZodString>;
1318
- key: z.ZodOptional<z.ZodString>;
1319
- callId: z.ZodOptional<z.ZodString>;
1320
- invocationId: z.ZodOptional<z.ZodString>;
1321
- input: z.ZodUnknown;
1322
- }, z.core.$loose>;
1323
- readonly "action.completed": z.ZodObject<{
1324
- agent: z.ZodOptional<z.ZodObject<{
1325
- id: z.ZodString;
1326
- path: z.ZodString;
1327
- delegationId: z.ZodOptional<z.ZodString>;
1328
- }, z.core.$loose>>;
1329
- actionId: z.ZodString;
1330
- kind: z.ZodString;
1331
- toolName: z.ZodOptional<z.ZodString>;
1332
- path: z.ZodOptional<z.ZodString>;
1333
- key: z.ZodOptional<z.ZodString>;
1334
- callId: z.ZodOptional<z.ZodString>;
1335
- invocationId: z.ZodOptional<z.ZodString>;
1336
- result: z.ZodUnknown;
1337
- }, z.core.$loose>;
1338
- readonly "action.uncertain": z.ZodObject<{
1339
- agent: z.ZodOptional<z.ZodObject<{
1340
- id: z.ZodString;
1341
- path: z.ZodString;
1342
- delegationId: z.ZodOptional<z.ZodString>;
1343
- }, z.core.$loose>>;
1344
- actionId: z.ZodString;
1345
- }, z.core.$loose>;
1346
1118
  readonly "effect.uncertain": z.ZodObject<{
1347
1119
  effectId: z.ZodString;
1348
1120
  message: z.ZodOptional<z.ZodString>;
@@ -1353,6 +1125,7 @@ declare const TRANSCRIPT_PAYLOADS: {
1353
1125
  readonly "turn.paused": z.ZodObject<{
1354
1126
  interactions: z.ZodArray<z.ZodObject<{
1355
1127
  invocationId: z.ZodString;
1128
+ callId: z.ZodOptional<z.ZodString>;
1356
1129
  interaction: z.ZodObject<{
1357
1130
  id: z.ZodString;
1358
1131
  kind: z.ZodString;
@@ -1422,24 +1195,6 @@ export declare const CommandRespondPayloadSchema: z.ZodObject<{
1422
1195
  interactionId: z.ZodString;
1423
1196
  value: z.ZodUnknown;
1424
1197
  }, z.core.$loose>;
1425
- /** `action.delivered`: the Runtime sent an Action to its endpoint. */
1426
- export declare const ActionDeliveredPayloadSchema: z.ZodObject<{
1427
- agent: z.ZodOptional<z.ZodObject<{
1428
- id: z.ZodString;
1429
- path: z.ZodString;
1430
- delegationId: z.ZodOptional<z.ZodString>;
1431
- }, z.core.$loose>>;
1432
- actionId: z.ZodString;
1433
- generation: z.ZodNumber;
1434
- }, z.core.$loose>;
1435
- /** `action.delivery_failed`: a delivery did not reach its endpoint, or was refused; it is retried. */
1436
- export declare const ActionDeliveryFailedPayloadSchema: z.ZodObject<{
1437
- actionId: z.ZodString;
1438
- generation: z.ZodNumber;
1439
- reason: z.ZodString;
1440
- message: z.ZodOptional<z.ZodString>;
1441
- retryInMs: z.ZodNumber;
1442
- }, z.core.$loose>;
1443
1198
  /** `sandbox.state`: the session's sandbox changed state. */
1444
1199
  export declare const SandboxStatePayloadSchema: z.ZodObject<{
1445
1200
  state: z.ZodEnum<{
@@ -1471,7 +1226,7 @@ export declare const SandboxExecPayloadSchema: z.ZodObject<{
1471
1226
  code: z.ZodOptional<z.ZodString>;
1472
1227
  durationMs: z.ZodNumber;
1473
1228
  }, z.core.$loose>;
1474
- /** `node.started`: a workflow node that runs an Action started. */
1229
+ /** `node.started`: a workflow tool node started. */
1475
1230
  export declare const NodeStartedPayloadSchema: z.ZodObject<{
1476
1231
  path: z.ZodString;
1477
1232
  kind: z.ZodString;
@@ -1501,16 +1256,6 @@ export declare const LoopVerifiedPayloadSchema: z.ZodObject<{
1501
1256
  feedback: z.ZodOptional<z.ZodString>;
1502
1257
  data: z.ZodOptional<z.ZodUnknown>;
1503
1258
  }, z.core.$loose>;
1504
- /** `loop.decided`: a Loop's decide step chose to iterate again (`input`) or finish (`output`). */
1505
- export declare const LoopDecidedPayloadSchema: z.ZodObject<{
1506
- path: z.ZodString;
1507
- n: z.ZodNumber;
1508
- next: z.ZodEnum<{
1509
- input: "input";
1510
- output: "output";
1511
- }>;
1512
- patched: z.ZodBoolean;
1513
- }, z.core.$loose>;
1514
1259
  /**
1515
1260
  * `transcript.updated` (internal; blueprint P0.3): the own loop's model-facing transcript after a
1516
1261
  * settled segment, as an edit of the previous one: keep its first `keep` entries, then append
@@ -1606,6 +1351,41 @@ export declare const ArtifactExportFailedPayloadSchema: z.ZodObject<{
1606
1351
  name: z.ZodString;
1607
1352
  message: z.ZodString;
1608
1353
  }, z.core.$loose>;
1354
+ /** What readying one declared MCP server found (`mcp.discovered`). */
1355
+ export declare const McpServerOutcomeSchema: z.ZodObject<{
1356
+ agentId: z.ZodOptional<z.ZodString>;
1357
+ capabilityId: z.ZodString;
1358
+ serverName: z.ZodString;
1359
+ outcome: z.ZodEnum<{
1360
+ connected: "connected";
1361
+ failed: "failed";
1362
+ refused: "refused";
1363
+ }>;
1364
+ message: z.ZodString;
1365
+ tools: z.ZodNumber;
1366
+ credentialIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1367
+ }, z.core.$loose>;
1368
+ export type McpServerOutcome = z.infer<typeof McpServerOutcomeSchema>;
1369
+ /**
1370
+ * `mcp.discovered`: the session's first turn readied its MCP servers and pinned the tools they
1371
+ * offer, one outcome per declared server. A server that did not connect adds no tools for the
1372
+ * session's life, so this is where the model's missing tools show (also `mcpDiagnostics`).
1373
+ */
1374
+ export declare const McpDiscoveredPayloadSchema: z.ZodObject<{
1375
+ servers: z.ZodArray<z.ZodObject<{
1376
+ agentId: z.ZodOptional<z.ZodString>;
1377
+ capabilityId: z.ZodString;
1378
+ serverName: z.ZodString;
1379
+ outcome: z.ZodEnum<{
1380
+ connected: "connected";
1381
+ failed: "failed";
1382
+ refused: "refused";
1383
+ }>;
1384
+ message: z.ZodString;
1385
+ tools: z.ZodNumber;
1386
+ credentialIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1387
+ }, z.core.$loose>>;
1388
+ }, z.core.$loose>;
1609
1389
  /**
1610
1390
  * The event catalog (Durable Streams §9.5): every session event type, its payload schema, its
1611
1391
  * payload schema version and who writes it. A type not listed here cannot be written. A type
@@ -1670,6 +1450,7 @@ export declare const EVENT_CATALOG: {
1670
1450
  readonly payload: z.ZodObject<{
1671
1451
  interactions: z.ZodArray<z.ZodObject<{
1672
1452
  invocationId: z.ZodString;
1453
+ callId: z.ZodOptional<z.ZodString>;
1673
1454
  interaction: z.ZodObject<{
1674
1455
  id: z.ZodString;
1675
1456
  kind: z.ZodString;
@@ -1775,80 +1556,6 @@ export declare const EVENT_CATALOG: {
1775
1556
  readonly source: "loop";
1776
1557
  readonly version: 1;
1777
1558
  };
1778
- readonly "action.pending": {
1779
- readonly payload: z.ZodObject<{
1780
- agent: z.ZodOptional<z.ZodObject<{
1781
- id: z.ZodString;
1782
- path: z.ZodString;
1783
- delegationId: z.ZodOptional<z.ZodString>;
1784
- }, z.core.$loose>>;
1785
- actionId: z.ZodString;
1786
- kind: z.ZodString;
1787
- toolName: z.ZodOptional<z.ZodString>;
1788
- path: z.ZodOptional<z.ZodString>;
1789
- key: z.ZodOptional<z.ZodString>;
1790
- callId: z.ZodOptional<z.ZodString>;
1791
- invocationId: z.ZodOptional<z.ZodString>;
1792
- input: z.ZodUnknown;
1793
- }, z.core.$loose>;
1794
- readonly source: "loop";
1795
- readonly version: 1;
1796
- };
1797
- readonly "action.delivered": {
1798
- readonly payload: z.ZodObject<{
1799
- agent: z.ZodOptional<z.ZodObject<{
1800
- id: z.ZodString;
1801
- path: z.ZodString;
1802
- delegationId: z.ZodOptional<z.ZodString>;
1803
- }, z.core.$loose>>;
1804
- actionId: z.ZodString;
1805
- generation: z.ZodNumber;
1806
- }, z.core.$loose>;
1807
- readonly source: "loop";
1808
- readonly version: 1;
1809
- };
1810
- readonly "action.delivery_failed": {
1811
- readonly payload: z.ZodObject<{
1812
- actionId: z.ZodString;
1813
- generation: z.ZodNumber;
1814
- reason: z.ZodString;
1815
- message: z.ZodOptional<z.ZodString>;
1816
- retryInMs: z.ZodNumber;
1817
- }, z.core.$loose>;
1818
- readonly source: "loop";
1819
- readonly version: 1;
1820
- };
1821
- readonly "action.completed": {
1822
- readonly payload: z.ZodObject<{
1823
- agent: z.ZodOptional<z.ZodObject<{
1824
- id: z.ZodString;
1825
- path: z.ZodString;
1826
- delegationId: z.ZodOptional<z.ZodString>;
1827
- }, z.core.$loose>>;
1828
- actionId: z.ZodString;
1829
- kind: z.ZodString;
1830
- toolName: z.ZodOptional<z.ZodString>;
1831
- path: z.ZodOptional<z.ZodString>;
1832
- key: z.ZodOptional<z.ZodString>;
1833
- callId: z.ZodOptional<z.ZodString>;
1834
- invocationId: z.ZodOptional<z.ZodString>;
1835
- result: z.ZodUnknown;
1836
- }, z.core.$loose>;
1837
- readonly source: "api";
1838
- readonly version: 1;
1839
- };
1840
- readonly "action.uncertain": {
1841
- readonly payload: z.ZodObject<{
1842
- agent: z.ZodOptional<z.ZodObject<{
1843
- id: z.ZodString;
1844
- path: z.ZodString;
1845
- delegationId: z.ZodOptional<z.ZodString>;
1846
- }, z.core.$loose>>;
1847
- actionId: z.ZodString;
1848
- }, z.core.$loose>;
1849
- readonly source: "loop";
1850
- readonly version: 1;
1851
- };
1852
1559
  readonly "effect.uncertain": {
1853
1560
  readonly payload: z.ZodObject<{
1854
1561
  effectId: z.ZodString;
@@ -1881,6 +1588,25 @@ export declare const EVENT_CATALOG: {
1881
1588
  readonly source: "loop";
1882
1589
  readonly version: 1;
1883
1590
  };
1591
+ readonly "mcp.discovered": {
1592
+ readonly payload: z.ZodObject<{
1593
+ servers: z.ZodArray<z.ZodObject<{
1594
+ agentId: z.ZodOptional<z.ZodString>;
1595
+ capabilityId: z.ZodString;
1596
+ serverName: z.ZodString;
1597
+ outcome: z.ZodEnum<{
1598
+ connected: "connected";
1599
+ failed: "failed";
1600
+ refused: "refused";
1601
+ }>;
1602
+ message: z.ZodString;
1603
+ tools: z.ZodNumber;
1604
+ credentialIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1605
+ }, z.core.$loose>>;
1606
+ }, z.core.$loose>;
1607
+ readonly source: "loop";
1608
+ readonly version: 1;
1609
+ };
1884
1610
  readonly "sandbox.state": {
1885
1611
  readonly payload: z.ZodObject<{
1886
1612
  state: z.ZodEnum<{
@@ -1960,19 +1686,6 @@ export declare const EVENT_CATALOG: {
1960
1686
  readonly source: "api";
1961
1687
  readonly version: 1;
1962
1688
  };
1963
- readonly "loop.decided": {
1964
- readonly payload: z.ZodObject<{
1965
- path: z.ZodString;
1966
- n: z.ZodNumber;
1967
- next: z.ZodEnum<{
1968
- input: "input";
1969
- output: "output";
1970
- }>;
1971
- patched: z.ZodBoolean;
1972
- }, z.core.$loose>;
1973
- readonly source: "api";
1974
- readonly version: 1;
1975
- };
1976
1689
  readonly "artifact.created": {
1977
1690
  readonly payload: z.ZodObject<{
1978
1691
  artifactId: z.ZodString;
@@ -2083,7 +1796,7 @@ type EventSchemaOf<T extends EventType> = z.ZodObject<typeof eventEnvelope & {
2083
1796
  /** One schema per event type, keyed by type (the OpenAPI components). */
2084
1797
  export declare const EVENT_SCHEMAS: { [T in EventType]: EventSchemaOf<T>; };
2085
1798
  /** A session event of a known type, discriminated on `type`. */
2086
- export declare const SessionEventSchema: z.ZodDiscriminatedUnion<[EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.decided" | "loop.iteration" | "loop.verified" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">, ...EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.decided" | "loop.iteration" | "loop.verified" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">;
1799
+ export declare const SessionEventSchema: z.ZodDiscriminatedUnion<[EventSchemaOf<"artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.iteration" | "loop.verified" | "mcp.discovered" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">, ...EventSchemaOf<"artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.iteration" | "loop.verified" | "mcp.discovered" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">;
2087
1800
  export type SessionEvent = {
2088
1801
  [T in EventType]: z.infer<EventSchemaOf<T>>;
2089
1802
  }[EventType];
@@ -2098,7 +1811,7 @@ export type SessionEventOf<T extends EventType> = Extract<SessionEvent, {
2098
1811
  */
2099
1812
  export declare function parseSessionEvent(value: unknown): SessionEvent | LiveEvent;
2100
1813
  export declare const SessionItemsResponseSchema: z.ZodObject<{
2101
- items: z.ZodArray<z.ZodDiscriminatedUnion<[EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.decided" | "loop.iteration" | "loop.verified" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">, ...EventSchemaOf<"action.completed" | "action.delivered" | "action.delivery_failed" | "action.pending" | "action.uncertain" | "artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.decided" | "loop.iteration" | "loop.verified" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">>;
1814
+ items: z.ZodArray<z.ZodDiscriminatedUnion<[EventSchemaOf<"artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.iteration" | "loop.verified" | "mcp.discovered" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">, ...EventSchemaOf<"artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.iteration" | "loop.verified" | "mcp.discovered" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">>;
2102
1815
  cursor: z.ZodNullable<z.ZodString>;
2103
1816
  }, z.core.$strip>;
2104
1817
  export type SessionItemsResponse = {
@@ -2133,6 +1846,13 @@ export declare const ReadyResponseSchema: z.ZodObject<{
2133
1846
  }>;
2134
1847
  service: z.ZodString;
2135
1848
  checks: z.ZodRecord<z.ZodString, z.ZodBoolean>;
1849
+ harness: z.ZodOptional<z.ZodObject<{
1850
+ mode: z.ZodEnum<{
1851
+ "in-process": "in-process";
1852
+ remote: "remote";
1853
+ }>;
1854
+ connected: z.ZodNumber;
1855
+ }, z.core.$strip>>;
2136
1856
  }, z.core.$strip>;
2137
1857
  export type HealthResponse = z.infer<typeof HealthResponseSchema>;
2138
1858
  export type ReadyResponse = z.infer<typeof ReadyResponseSchema>;
@@ -2176,8 +1896,8 @@ export declare const TenantCauseSchema: z.ZodObject<{
2176
1896
  }, z.core.$strict>;
2177
1897
  export type TenantCause = z.infer<typeof TenantCauseSchema>;
2178
1898
  /**
2179
- * The Host's one Tenant, as `/v1/admin/status` reports it. `unavailable` while it opens, when
2180
- * opening it failed (`cause`), or when it is closing.
1899
+ * The Host's one Tenant. `unavailable` while it opens, when opening it failed (`cause`), or
1900
+ * when it is closing.
2181
1901
  */
2182
1902
  export declare const HostTenantSchema: z.ZodObject<{
2183
1903
  id: z.ZodNullable<z.ZodString>;
@@ -2234,165 +1954,9 @@ export declare const HarnessStatusSchema: z.ZodObject<{
2234
1954
  workspace: z.ZodBoolean;
2235
1955
  }, z.core.$strict>;
2236
1956
  export type HarnessStatus = z.infer<typeof HarnessStatusSchema>;
2237
- export declare const HostAggregateSchema: z.ZodObject<{
2238
- runningSessions: z.ZodNumber;
2239
- inFlightDeliveries: z.ZodNumber;
2240
- pendingActions: z.ZodNumber;
2241
- uncertainEffects: z.ZodNumber;
2242
- relay: z.ZodOptional<z.ZodObject<{
2243
- active: z.ZodBoolean;
2244
- pendingTxs: z.ZodNumber;
2245
- pendingRows: z.ZodNumber;
2246
- confirmed: z.ZodNullable<z.ZodString>;
2247
- reconciliations: z.ZodNumber;
2248
- lastError: z.ZodNullable<z.ZodString>;
2249
- lagBytes: z.ZodOptional<z.ZodNumber>;
2250
- }, z.core.$strict>>;
2251
- harness: z.ZodOptional<z.ZodObject<{
2252
- mode: z.ZodEnum<{
2253
- "in-process": "in-process";
2254
- remote: "remote";
2255
- }>;
2256
- connected: z.ZodNumber;
2257
- workspace: z.ZodBoolean;
2258
- }, z.core.$strict>>;
2259
- }, z.core.$strict>;
2260
- export type HostAggregate = z.infer<typeof HostAggregateSchema>;
2261
- export declare const AdminHostStatusSchema: z.ZodObject<{
2262
- hostId: z.ZodString;
2263
- url: z.ZodString;
2264
- pid: z.ZodNumber;
2265
- version: z.ZodString;
2266
- protocol: z.ZodObject<{
2267
- min: z.ZodNumber;
2268
- max: z.ZodNumber;
2269
- features: z.ZodArray<z.ZodString>;
2270
- }, z.core.$strict>;
2271
- tenant: z.ZodObject<{
2272
- id: z.ZodNullable<z.ZodString>;
2273
- name: z.ZodNullable<z.ZodString>;
2274
- state: z.ZodEnum<{
2275
- open: "open";
2276
- unavailable: "unavailable";
2277
- }>;
2278
- envelope: z.ZodNullable<z.ZodObject<{
2279
- id: z.ZodString;
2280
- name: z.ZodString;
2281
- createdAt: z.ZodString;
2282
- updatedAt: z.ZodString;
2283
- schemaVersion: z.ZodNumber;
2284
- }, z.core.$strict>>;
2285
- cause: z.ZodOptional<z.ZodObject<{
2286
- code: z.ZodEnum<{
2287
- corrupt: "corrupt";
2288
- "database-layout-old": "database-layout-old";
2289
- "envelope-invalid": "envelope-invalid";
2290
- "kek-missing": "kek-missing";
2291
- "migration-failed": "migration-failed";
2292
- "open-failed": "open-failed";
2293
- "open-timeout": "open-timeout";
2294
- "schema-too-new": "schema-too-new";
2295
- }>;
2296
- message: z.ZodString;
2297
- repair: z.ZodString;
2298
- }, z.core.$strict>>;
2299
- }, z.core.$strict>;
2300
- aggregate: z.ZodObject<{
2301
- runningSessions: z.ZodNumber;
2302
- inFlightDeliveries: z.ZodNumber;
2303
- pendingActions: z.ZodNumber;
2304
- uncertainEffects: z.ZodNumber;
2305
- relay: z.ZodOptional<z.ZodObject<{
2306
- active: z.ZodBoolean;
2307
- pendingTxs: z.ZodNumber;
2308
- pendingRows: z.ZodNumber;
2309
- confirmed: z.ZodNullable<z.ZodString>;
2310
- reconciliations: z.ZodNumber;
2311
- lastError: z.ZodNullable<z.ZodString>;
2312
- lagBytes: z.ZodOptional<z.ZodNumber>;
2313
- }, z.core.$strict>>;
2314
- harness: z.ZodOptional<z.ZodObject<{
2315
- mode: z.ZodEnum<{
2316
- "in-process": "in-process";
2317
- remote: "remote";
2318
- }>;
2319
- connected: z.ZodNumber;
2320
- workspace: z.ZodBoolean;
2321
- }, z.core.$strict>>;
2322
- }, z.core.$strict>;
2323
- }, z.core.$strict>;
2324
- export type AdminHostStatus = z.infer<typeof AdminHostStatusSchema>;
2325
- /** Shared Admin API status (D§4.1). OSS fills `host`; Cloud omits it. */
2326
- export declare const AdminStatusSchema: z.ZodObject<{
2327
- service: z.ZodString;
2328
- version: z.ZodString;
2329
- protocol: z.ZodObject<{
2330
- min: z.ZodNumber;
2331
- max: z.ZodNumber;
2332
- features: z.ZodArray<z.ZodString>;
2333
- }, z.core.$strict>;
2334
- tenant: z.ZodObject<{
2335
- id: z.ZodNullable<z.ZodString>;
2336
- name: z.ZodNullable<z.ZodString>;
2337
- state: z.ZodEnum<{
2338
- open: "open";
2339
- unavailable: "unavailable";
2340
- }>;
2341
- envelope: z.ZodNullable<z.ZodObject<{
2342
- id: z.ZodString;
2343
- name: z.ZodString;
2344
- createdAt: z.ZodString;
2345
- updatedAt: z.ZodString;
2346
- schemaVersion: z.ZodNumber;
2347
- }, z.core.$strict>>;
2348
- cause: z.ZodOptional<z.ZodObject<{
2349
- code: z.ZodEnum<{
2350
- corrupt: "corrupt";
2351
- "database-layout-old": "database-layout-old";
2352
- "envelope-invalid": "envelope-invalid";
2353
- "kek-missing": "kek-missing";
2354
- "migration-failed": "migration-failed";
2355
- "open-failed": "open-failed";
2356
- "open-timeout": "open-timeout";
2357
- "schema-too-new": "schema-too-new";
2358
- }>;
2359
- message: z.ZodString;
2360
- repair: z.ZodString;
2361
- }, z.core.$strict>>;
2362
- }, z.core.$strict>;
2363
- aggregate: z.ZodObject<{
2364
- runningSessions: z.ZodNumber;
2365
- inFlightDeliveries: z.ZodNumber;
2366
- pendingActions: z.ZodNumber;
2367
- uncertainEffects: z.ZodNumber;
2368
- relay: z.ZodOptional<z.ZodObject<{
2369
- active: z.ZodBoolean;
2370
- pendingTxs: z.ZodNumber;
2371
- pendingRows: z.ZodNumber;
2372
- confirmed: z.ZodNullable<z.ZodString>;
2373
- reconciliations: z.ZodNumber;
2374
- lastError: z.ZodNullable<z.ZodString>;
2375
- lagBytes: z.ZodOptional<z.ZodNumber>;
2376
- }, z.core.$strict>>;
2377
- harness: z.ZodOptional<z.ZodObject<{
2378
- mode: z.ZodEnum<{
2379
- "in-process": "in-process";
2380
- remote: "remote";
2381
- }>;
2382
- connected: z.ZodNumber;
2383
- workspace: z.ZodBoolean;
2384
- }, z.core.$strict>>;
2385
- }, z.core.$strict>;
2386
- host: z.ZodOptional<z.ZodObject<{
2387
- hostId: z.ZodString;
2388
- url: z.ZodString;
2389
- pid: z.ZodNumber;
2390
- }, z.core.$strict>>;
2391
- }, z.core.$strict>;
2392
- export type AdminStatus = z.infer<typeof AdminStatusSchema>;
2393
1957
  /**
2394
- * An operator key (Host feature `operator-keys`): a revocable application key of the Tenant,
2395
- * named by its id (`APPLICATION_KEY_ID_PATTERN`). The Runtime keeps only its hash.
1958
+ * A key of the Tenant (`/v1/tenant/keys`, `nylorun-operate keys`), named by its id
1959
+ * (`APPLICATION_KEY_ID_PATTERN`), with its role. The Runtime keeps only its hash.
2396
1960
  */
2397
1961
  export declare const OperatorKeySchema: z.ZodObject<{
2398
1962
  id: z.ZodString;
@@ -2400,7 +1964,7 @@ export declare const OperatorKeySchema: z.ZodObject<{
2400
1964
  createdAt: z.ZodString;
2401
1965
  }, z.core.$strict>;
2402
1966
  export type OperatorKey = z.infer<typeof OperatorKeySchema>;
2403
- /** `GET /v1/admin/keys`: every key of the Tenant (Studio's and derived ones too), by id. */
1967
+ /** `GET /v1/tenant/keys`: the Tenant's keys, by id. */
2404
1968
  export declare const ListOperatorKeysResponseSchema: z.ZodObject<{
2405
1969
  keys: z.ZodArray<z.ZodObject<{
2406
1970
  id: z.ZodString;
@@ -2409,7 +1973,7 @@ export declare const ListOperatorKeysResponseSchema: z.ZodObject<{
2409
1973
  }, z.core.$strict>>;
2410
1974
  }, z.core.$strict>;
2411
1975
  export type ListOperatorKeysResponse = z.infer<typeof ListOperatorKeysResponseSchema>;
2412
- /** `PUT /v1/admin/keys/{id}`: the new key, shown this once; `rotated` when it replaced one. */
1976
+ /** `PUT /v1/tenant/keys/{keyId}`: the new key, shown this once; `rotated` when it replaced one. */
2413
1977
  export declare const PutOperatorKeyResponseSchema: z.ZodObject<{
2414
1978
  id: z.ZodString;
2415
1979
  role: z.ZodString;
@@ -2418,7 +1982,7 @@ export declare const PutOperatorKeyResponseSchema: z.ZodObject<{
2418
1982
  rotated: z.ZodBoolean;
2419
1983
  }, z.core.$strict>;
2420
1984
  export type PutOperatorKeyResponse = z.infer<typeof PutOperatorKeyResponseSchema>;
2421
- /** `DELETE /v1/admin/keys/{id}`: the key no longer authenticates. */
1985
+ /** `DELETE /v1/tenant/keys/{keyId}`: the key no longer authenticates. */
2422
1986
  export declare const DeleteOperatorKeyResponseSchema: z.ZodObject<{
2423
1987
  id: z.ZodString;
2424
1988
  deleted: z.ZodLiteral<true>;
@@ -2438,10 +2002,16 @@ export declare const ProjectLinkFileSchema: z.ZodObject<{
2438
2002
  tenantId: z.ZodOptional<z.ZodString>;
2439
2003
  }, z.core.$loose>;
2440
2004
  export type ProjectLinkFile = z.infer<typeof ProjectLinkFileSchema>;
2005
+ /**
2006
+ * `.nylorun/credentials.json`: the Project's application key and, from protocol 8, its
2007
+ * management key. Still format 1: readers that predate the management key ignore it.
2008
+ */
2441
2009
  export declare const ProjectCredentialsFileSchema: z.ZodObject<{
2442
2010
  format: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
2443
2011
  applicationKey: z.ZodString;
2444
2012
  principalId: z.ZodString;
2013
+ managementKey: z.ZodOptional<z.ZodString>;
2014
+ managementPrincipalId: z.ZodOptional<z.ZodString>;
2445
2015
  }, z.core.$loose>;
2446
2016
  export type ProjectCredentialsFile = z.infer<typeof ProjectCredentialsFileSchema>;
2447
2017
  export declare const HostModelViewSchema: z.ZodUnion<readonly [z.ZodObject<{
@@ -2475,7 +2045,6 @@ export declare const TenantStatusSchema: z.ZodObject<{
2475
2045
  store: z.ZodBoolean;
2476
2046
  scheduler: z.ZodBoolean;
2477
2047
  model: z.ZodBoolean;
2478
- endpoints: z.ZodBoolean;
2479
2048
  schema: z.ZodBoolean;
2480
2049
  }, z.core.$strict>;
2481
2050
  model: z.ZodUnion<readonly [z.ZodObject<{
@@ -2498,13 +2067,10 @@ export declare const TenantStatusSchema: z.ZodObject<{
2498
2067
  }, z.core.$strict>]>;
2499
2068
  agents: z.ZodArray<z.ZodObject<{
2500
2069
  agentId: z.ZodString;
2501
- registered: z.ZodBoolean;
2502
- endpoint: z.ZodBoolean;
2503
2070
  }, z.core.$strict>>;
2504
2071
  counts: z.ZodObject<{
2505
2072
  sessions: z.ZodNumber;
2506
2073
  runningSessions: z.ZodNumber;
2507
- pendingActions: z.ZodNumber;
2508
2074
  uncertainEffects: z.ZodNumber;
2509
2075
  }, z.core.$strict>;
2510
2076
  sandbox: z.ZodObject<{
@@ -2646,9 +2212,9 @@ export type ResetTenantRequest = z.infer<typeof ResetTenantRequestSchema>;
2646
2212
  * narrow a request to. `sessions:own` reaches only the subject's own sessions; the others reach
2647
2213
  * Tenant-wide resources. `sandboxes:write` creates and deletes sandboxes (Host feature
2648
2214
  * `sandboxes`); a token caller's reach only the ids its sandbox grants name. Vaults are the
2649
- * installation's, managed by application keys acting for no one (protocol 7).
2215
+ * installation's, managed with management keys on the Management API (protocol 8).
2650
2216
  */
2651
- export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "tenant:settings", "sandboxes:write"];
2217
+ export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "sandboxes:write"];
2652
2218
  export type SubjectScope = (typeof SUBJECT_SCOPES)[number];
2653
2219
  /** A valid subject: 1–200 visible ASCII characters, not reserved by the Runtime. */
2654
2220
  export declare function isSubject(value: unknown): value is string;
@@ -2665,22 +2231,20 @@ export declare function parseSubjectHeaders(subject: string, scopes: string | un
2665
2231
  message: string;
2666
2232
  };
2667
2233
  /**
2668
- * Scopes a token caller (a trusted issuer's token) may carry: never `agents:write` or
2669
- * `tenant:settings`.
2234
+ * Scopes a token caller (a trusted issuer's token) may carry: never `agents:write`.
2670
2235
  */
2671
2236
  export declare const TOKEN_SCOPES: readonly ["agents:read", "sessions:own", "sandboxes:write"];
2672
2237
  /** The most sandbox grants one token caller carries. */
2673
2238
  export declare const TOKEN_SANDBOX_GRANTS_MAX = 16;
2674
2239
  export type TokenScope = (typeof TOKEN_SCOPES)[number];
2675
2240
  /**
2676
- * The longest a token the Runtime signs itself lives, in seconds (delivery tokens, capability
2677
- * links): rotating signing keys revokes the previous key once the longest token it may have
2678
- * signed has expired.
2241
+ * The longest a token the Runtime signs itself lives, in seconds (capability links): rotating
2242
+ * signing keys revokes the previous key once the longest token it may have signed has expired.
2679
2243
  */
2680
2244
  export declare const TOKEN_TTL_MAX_SECONDS = 900;
2681
2245
  /**
2682
- * The `iss` of every token a Tenant's Runtime signs itself: delivery tokens, capability links,
2683
- * run, host and egress tokens.
2246
+ * The `iss` of every token a Tenant's Runtime signs itself: capability links, run, host and
2247
+ * egress tokens.
2684
2248
  */
2685
2249
  export declare function tenantTokenIssuer(tenantId: string): string;
2686
2250
  export declare const SIGNING_KEY_STATES: readonly ["standby", "current", "previous", "revoked"];
@@ -2772,7 +2336,7 @@ export declare const RevokeSigningKeyRequestSchema: z.ZodObject<{
2772
2336
  export declare const ISSUER_SCOPES: readonly ["agents:read", "sessions:own", "sandboxes:write", "studio"];
2773
2337
  export type IssuerScope = (typeof ISSUER_SCOPES)[number];
2774
2338
  /** Every scope a caller can hold: the subject scopes, and an issuer token's `studio`. */
2775
- export declare const CALLER_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "tenant:settings", "sandboxes:write", "studio"];
2339
+ export declare const CALLER_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "sandboxes:write", "studio"];
2776
2340
  export type CallerScope = (typeof CALLER_SCOPES)[number];
2777
2341
  /**
2778
2342
  * `GET /v1/me`: who the Runtime takes the caller to be, for any credential.
@@ -2794,7 +2358,6 @@ export declare const MeResponseSchema: z.ZodObject<{
2794
2358
  "sandboxes:write": "sandboxes:write";
2795
2359
  "sessions:own": "sessions:own";
2796
2360
  studio: "studio";
2797
- "tenant:settings": "tenant:settings";
2798
2361
  }>>;
2799
2362
  agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2800
2363
  sandboxes: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -2917,150 +2480,6 @@ export declare const SessionViewSchema: z.ZodObject<{
2917
2480
  mcpDiagnostics: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2918
2481
  waits: z.ZodOptional<z.ZodUnknown>;
2919
2482
  error: z.ZodOptional<z.ZodString>;
2920
- actions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2921
- actionId: z.ZodString;
2922
- sessionId: z.ZodString;
2923
- turnId: z.ZodString;
2924
- agentId: z.ZodString;
2925
- manifestHash: z.ZodString;
2926
- implementationVersion: z.ZodString;
2927
- input: z.ZodUnknown;
2928
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2929
- status: z.ZodEnum<{
2930
- cancelled: "cancelled";
2931
- completed: "completed";
2932
- delivering: "delivering";
2933
- pending: "pending";
2934
- uncertain: "uncertain";
2935
- }>;
2936
- generation: z.ZodNumber;
2937
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2938
- agent: z.ZodOptional<z.ZodObject<{
2939
- id: z.ZodString;
2940
- path: z.ZodString;
2941
- delegationId: z.ZodOptional<z.ZodString>;
2942
- }, z.core.$strict>>;
2943
- kind: z.ZodLiteral<"tool">;
2944
- capabilityId: z.ZodString;
2945
- toolName: z.ZodString;
2946
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2947
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2948
- }, z.core.$strict>, z.ZodObject<{
2949
- actionId: z.ZodString;
2950
- sessionId: z.ZodString;
2951
- turnId: z.ZodString;
2952
- agentId: z.ZodString;
2953
- manifestHash: z.ZodString;
2954
- implementationVersion: z.ZodString;
2955
- input: z.ZodUnknown;
2956
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2957
- status: z.ZodEnum<{
2958
- cancelled: "cancelled";
2959
- completed: "completed";
2960
- delivering: "delivering";
2961
- pending: "pending";
2962
- uncertain: "uncertain";
2963
- }>;
2964
- generation: z.ZodNumber;
2965
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2966
- agent: z.ZodOptional<z.ZodObject<{
2967
- id: z.ZodString;
2968
- path: z.ZodString;
2969
- delegationId: z.ZodOptional<z.ZodString>;
2970
- }, z.core.$strict>>;
2971
- kind: z.ZodLiteral<"tool">;
2972
- path: z.ZodString;
2973
- key: z.ZodString;
2974
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2975
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2976
- }, z.core.$strict>, z.ZodObject<{
2977
- actionId: z.ZodString;
2978
- sessionId: z.ZodString;
2979
- turnId: z.ZodString;
2980
- agentId: z.ZodString;
2981
- manifestHash: z.ZodString;
2982
- implementationVersion: z.ZodString;
2983
- input: z.ZodUnknown;
2984
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2985
- status: z.ZodEnum<{
2986
- cancelled: "cancelled";
2987
- completed: "completed";
2988
- delivering: "delivering";
2989
- pending: "pending";
2990
- uncertain: "uncertain";
2991
- }>;
2992
- generation: z.ZodNumber;
2993
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2994
- agent: z.ZodOptional<z.ZodObject<{
2995
- id: z.ZodString;
2996
- path: z.ZodString;
2997
- delegationId: z.ZodOptional<z.ZodString>;
2998
- }, z.core.$strict>>;
2999
- kind: z.ZodLiteral<"hook">;
3000
- hook: z.ZodObject<{
3001
- at: z.ZodEnum<{
3002
- after: "after";
3003
- before: "before";
3004
- }>;
3005
- scope: z.ZodEnum<{
3006
- step: "step";
3007
- turn: "turn";
3008
- }>;
3009
- capabilityIds: z.ZodArray<z.ZodString>;
3010
- }, z.core.$strict>;
3011
- }, z.core.$strict>, z.ZodObject<{
3012
- actionId: z.ZodString;
3013
- sessionId: z.ZodString;
3014
- turnId: z.ZodString;
3015
- agentId: z.ZodString;
3016
- manifestHash: z.ZodString;
3017
- implementationVersion: z.ZodString;
3018
- input: z.ZodUnknown;
3019
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3020
- status: z.ZodEnum<{
3021
- cancelled: "cancelled";
3022
- completed: "completed";
3023
- delivering: "delivering";
3024
- pending: "pending";
3025
- uncertain: "uncertain";
3026
- }>;
3027
- generation: z.ZodNumber;
3028
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3029
- agent: z.ZodOptional<z.ZodObject<{
3030
- id: z.ZodString;
3031
- path: z.ZodString;
3032
- delegationId: z.ZodOptional<z.ZodString>;
3033
- }, z.core.$strict>>;
3034
- kind: z.ZodLiteral<"fn">;
3035
- path: z.ZodString;
3036
- key: z.ZodString;
3037
- }, z.core.$strict>, z.ZodObject<{
3038
- actionId: z.ZodString;
3039
- sessionId: z.ZodString;
3040
- turnId: z.ZodString;
3041
- agentId: z.ZodString;
3042
- manifestHash: z.ZodString;
3043
- implementationVersion: z.ZodString;
3044
- input: z.ZodUnknown;
3045
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3046
- status: z.ZodEnum<{
3047
- cancelled: "cancelled";
3048
- completed: "completed";
3049
- delivering: "delivering";
3050
- pending: "pending";
3051
- uncertain: "uncertain";
3052
- }>;
3053
- generation: z.ZodNumber;
3054
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3055
- agent: z.ZodOptional<z.ZodObject<{
3056
- id: z.ZodString;
3057
- path: z.ZodString;
3058
- delegationId: z.ZodOptional<z.ZodString>;
3059
- }, z.core.$strict>>;
3060
- kind: z.ZodLiteral<"verify">;
3061
- path: z.ZodString;
3062
- key: z.ZodString;
3063
- }, z.core.$strict>]>>;
3064
2483
  uncertainEffects: z.ZodArray<z.ZodObject<{
3065
2484
  effectId: z.ZodString;
3066
2485
  turnId: z.ZodString;
@@ -3403,9 +2822,6 @@ export declare const DeletedResponseSchema: z.ZodObject<{
3403
2822
  id: z.ZodString;
3404
2823
  }, z.core.$strict>;
3405
2824
  export type DeletedResponse = z.infer<typeof DeletedResponseSchema>;
3406
- export declare const HostShutdownResponseSchema: z.ZodObject<{
3407
- status: z.ZodLiteral<"shutting_down">;
3408
- }, z.core.$strict>;
3409
2825
  /**
3410
2826
  * The last frame of a session stream the Runtime ends: `event: nylorun.closed`, when the
3411
2827
  * token caller's token expires.
@@ -3422,11 +2838,15 @@ export type StreamClosedFrame = z.infer<typeof StreamClosedFrameSchema>;
3422
2838
  */
3423
2839
  export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
3424
2840
  connection_missing: "connection_missing";
2841
+ credential_invalid: "credential_invalid";
2842
+ credential_required: "credential_required";
2843
+ definition_files_missing: "definition_files_missing";
3425
2844
  host_rejected: "host_rejected";
3426
2845
  incompatible_host: "incompatible_host";
3427
2846
  internal_error: "internal_error";
3428
2847
  invalid_request: "invalid_request";
3429
2848
  issuer_unavailable: "issuer_unavailable";
2849
+ key_role_mismatch: "key_role_mismatch";
3430
2850
  limit_exceeded: "limit_exceeded";
3431
2851
  not_found: "not_found";
3432
2852
  oauth_client_required: "oauth_client_required";
@@ -3450,281 +2870,6 @@ export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
3450
2870
  unsupported_media_type: "unsupported_media_type";
3451
2871
  }>;
3452
2872
  export type AgUiRunErrorCode = z.infer<typeof AgUiRunErrorCodeSchema>;
3453
- /** The JWT `typ` of a delivery token (RFC 8725 explicit typing). */
3454
- export declare const DELIVERY_TOKEN_TYPE = "nylorun-delivery+jwt";
3455
- /** A delivery token lives no longer than any token the Runtime signs (`TOKEN_TTL_MAX_SECONDS`). */
3456
- export declare const DELIVERY_TOKEN_MAX_TTL_SECONDS = 900;
3457
- /** Inline delivery timeouts, in milliseconds. The maximum keeps a token within its lifetime. */
3458
- export declare const ENDPOINT_TIMEOUT_DEFAULT_MS = 60000;
3459
- export declare const ENDPOINT_TIMEOUT_MAX_MS: number;
3460
- /** In-flight deliveries per endpoint when the registration does not say. */
3461
- export declare const ENDPOINT_MAX_CONCURRENT_DEFAULT = 16;
3462
- /** One agent's or workflow's Action endpoint, as the application registers it. */
3463
- export declare const EndpointRegistrationSchema: z.ZodObject<{
3464
- agentId: z.ZodString;
3465
- url: z.ZodString;
3466
- implementationVersion: z.ZodString;
3467
- manifestHash: z.ZodOptional<z.ZodString>;
3468
- timeoutMs: z.ZodOptional<z.ZodNumber>;
3469
- maxConcurrent: z.ZodOptional<z.ZodNumber>;
3470
- }, z.core.$strict>;
3471
- export type EndpointRegistration = z.infer<typeof EndpointRegistrationSchema>;
3472
- export declare const PutEndpointsRequestSchema: z.ZodObject<{
3473
- endpoints: z.ZodArray<z.ZodObject<{
3474
- agentId: z.ZodString;
3475
- url: z.ZodString;
3476
- implementationVersion: z.ZodString;
3477
- manifestHash: z.ZodOptional<z.ZodString>;
3478
- timeoutMs: z.ZodOptional<z.ZodNumber>;
3479
- maxConcurrent: z.ZodOptional<z.ZodNumber>;
3480
- }, z.core.$strict>>;
3481
- }, z.core.$strict>;
3482
- export type PutEndpointsRequest = z.infer<typeof PutEndpointsRequestSchema>;
3483
- /** What recent deliveries and the last ping say about an endpoint. */
3484
- export declare const EndpointHealthSchema: z.ZodObject<{
3485
- lastDeliveryAt: z.ZodOptional<z.ZodString>;
3486
- lastSuccessAt: z.ZodOptional<z.ZodString>;
3487
- lastError: z.ZodOptional<z.ZodObject<{
3488
- code: z.ZodString;
3489
- message: z.ZodString;
3490
- }, z.core.$strip>>;
3491
- consecutiveFailures: z.ZodNumber;
3492
- served: z.ZodOptional<z.ZodObject<{
3493
- implementationVersion: z.ZodString;
3494
- manifestHash: z.ZodOptional<z.ZodString>;
3495
- }, z.core.$strict>>;
3496
- }, z.core.$strict>;
3497
- export type EndpointHealth = z.infer<typeof EndpointHealthSchema>;
3498
- export declare const EndpointSchema: z.ZodObject<{
3499
- agentId: z.ZodString;
3500
- url: z.ZodString;
3501
- implementationVersion: z.ZodString;
3502
- manifestHash: z.ZodOptional<z.ZodString>;
3503
- timeoutMs: z.ZodNumber;
3504
- maxConcurrent: z.ZodNumber;
3505
- health: z.ZodObject<{
3506
- lastDeliveryAt: z.ZodOptional<z.ZodString>;
3507
- lastSuccessAt: z.ZodOptional<z.ZodString>;
3508
- lastError: z.ZodOptional<z.ZodObject<{
3509
- code: z.ZodString;
3510
- message: z.ZodString;
3511
- }, z.core.$strip>>;
3512
- consecutiveFailures: z.ZodNumber;
3513
- served: z.ZodOptional<z.ZodObject<{
3514
- implementationVersion: z.ZodString;
3515
- manifestHash: z.ZodOptional<z.ZodString>;
3516
- }, z.core.$strict>>;
3517
- }, z.core.$strict>;
3518
- updatedAt: z.ZodString;
3519
- }, z.core.$strict>;
3520
- export type Endpoint = z.infer<typeof EndpointSchema>;
3521
- export declare const ListEndpointsResponseSchema: z.ZodObject<{
3522
- endpoints: z.ZodArray<z.ZodObject<{
3523
- agentId: z.ZodString;
3524
- url: z.ZodString;
3525
- implementationVersion: z.ZodString;
3526
- manifestHash: z.ZodOptional<z.ZodString>;
3527
- timeoutMs: z.ZodNumber;
3528
- maxConcurrent: z.ZodNumber;
3529
- health: z.ZodObject<{
3530
- lastDeliveryAt: z.ZodOptional<z.ZodString>;
3531
- lastSuccessAt: z.ZodOptional<z.ZodString>;
3532
- lastError: z.ZodOptional<z.ZodObject<{
3533
- code: z.ZodString;
3534
- message: z.ZodString;
3535
- }, z.core.$strip>>;
3536
- consecutiveFailures: z.ZodNumber;
3537
- served: z.ZodOptional<z.ZodObject<{
3538
- implementationVersion: z.ZodString;
3539
- manifestHash: z.ZodOptional<z.ZodString>;
3540
- }, z.core.$strict>>;
3541
- }, z.core.$strict>;
3542
- updatedAt: z.ZodString;
3543
- }, z.core.$strict>>;
3544
- }, z.core.$strict>;
3545
- export type ListEndpointsResponse = z.infer<typeof ListEndpointsResponseSchema>;
3546
- export declare const DeleteEndpointResponseSchema: z.ZodObject<{
3547
- agentId: z.ZodString;
3548
- deleted: z.ZodLiteral<true>;
3549
- }, z.core.$strict>;
3550
- export type DeleteEndpointResponse = z.infer<typeof DeleteEndpointResponseSchema>;
3551
- /** The body the Runtime POSTs to an Action endpoint. */
3552
- export declare const ActionDeliverySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3553
- type: z.ZodLiteral<"action">;
3554
- action: z.ZodUnion<readonly [z.ZodObject<{
3555
- actionId: z.ZodString;
3556
- sessionId: z.ZodString;
3557
- turnId: z.ZodString;
3558
- agentId: z.ZodString;
3559
- manifestHash: z.ZodString;
3560
- implementationVersion: z.ZodString;
3561
- input: z.ZodUnknown;
3562
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3563
- status: z.ZodEnum<{
3564
- cancelled: "cancelled";
3565
- completed: "completed";
3566
- delivering: "delivering";
3567
- pending: "pending";
3568
- uncertain: "uncertain";
3569
- }>;
3570
- generation: z.ZodNumber;
3571
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3572
- agent: z.ZodOptional<z.ZodObject<{
3573
- id: z.ZodString;
3574
- path: z.ZodString;
3575
- delegationId: z.ZodOptional<z.ZodString>;
3576
- }, z.core.$strict>>;
3577
- kind: z.ZodLiteral<"tool">;
3578
- capabilityId: z.ZodString;
3579
- toolName: z.ZodString;
3580
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3581
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3582
- }, z.core.$strict>, z.ZodObject<{
3583
- actionId: z.ZodString;
3584
- sessionId: z.ZodString;
3585
- turnId: z.ZodString;
3586
- agentId: z.ZodString;
3587
- manifestHash: z.ZodString;
3588
- implementationVersion: z.ZodString;
3589
- input: z.ZodUnknown;
3590
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3591
- status: z.ZodEnum<{
3592
- cancelled: "cancelled";
3593
- completed: "completed";
3594
- delivering: "delivering";
3595
- pending: "pending";
3596
- uncertain: "uncertain";
3597
- }>;
3598
- generation: z.ZodNumber;
3599
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3600
- agent: z.ZodOptional<z.ZodObject<{
3601
- id: z.ZodString;
3602
- path: z.ZodString;
3603
- delegationId: z.ZodOptional<z.ZodString>;
3604
- }, z.core.$strict>>;
3605
- kind: z.ZodLiteral<"tool">;
3606
- path: z.ZodString;
3607
- key: z.ZodString;
3608
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3609
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3610
- }, z.core.$strict>, z.ZodObject<{
3611
- actionId: z.ZodString;
3612
- sessionId: z.ZodString;
3613
- turnId: z.ZodString;
3614
- agentId: z.ZodString;
3615
- manifestHash: z.ZodString;
3616
- implementationVersion: z.ZodString;
3617
- input: z.ZodUnknown;
3618
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3619
- status: z.ZodEnum<{
3620
- cancelled: "cancelled";
3621
- completed: "completed";
3622
- delivering: "delivering";
3623
- pending: "pending";
3624
- uncertain: "uncertain";
3625
- }>;
3626
- generation: z.ZodNumber;
3627
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3628
- agent: z.ZodOptional<z.ZodObject<{
3629
- id: z.ZodString;
3630
- path: z.ZodString;
3631
- delegationId: z.ZodOptional<z.ZodString>;
3632
- }, z.core.$strict>>;
3633
- kind: z.ZodLiteral<"hook">;
3634
- hook: z.ZodObject<{
3635
- at: z.ZodEnum<{
3636
- after: "after";
3637
- before: "before";
3638
- }>;
3639
- scope: z.ZodEnum<{
3640
- step: "step";
3641
- turn: "turn";
3642
- }>;
3643
- capabilityIds: z.ZodArray<z.ZodString>;
3644
- }, z.core.$strict>;
3645
- }, z.core.$strict>, z.ZodObject<{
3646
- actionId: z.ZodString;
3647
- sessionId: z.ZodString;
3648
- turnId: z.ZodString;
3649
- agentId: z.ZodString;
3650
- manifestHash: z.ZodString;
3651
- implementationVersion: z.ZodString;
3652
- input: z.ZodUnknown;
3653
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3654
- status: z.ZodEnum<{
3655
- cancelled: "cancelled";
3656
- completed: "completed";
3657
- delivering: "delivering";
3658
- pending: "pending";
3659
- uncertain: "uncertain";
3660
- }>;
3661
- generation: z.ZodNumber;
3662
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3663
- agent: z.ZodOptional<z.ZodObject<{
3664
- id: z.ZodString;
3665
- path: z.ZodString;
3666
- delegationId: z.ZodOptional<z.ZodString>;
3667
- }, z.core.$strict>>;
3668
- kind: z.ZodLiteral<"fn">;
3669
- path: z.ZodString;
3670
- key: z.ZodString;
3671
- }, z.core.$strict>, z.ZodObject<{
3672
- actionId: z.ZodString;
3673
- sessionId: z.ZodString;
3674
- turnId: z.ZodString;
3675
- agentId: z.ZodString;
3676
- manifestHash: z.ZodString;
3677
- implementationVersion: z.ZodString;
3678
- input: z.ZodUnknown;
3679
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3680
- status: z.ZodEnum<{
3681
- cancelled: "cancelled";
3682
- completed: "completed";
3683
- delivering: "delivering";
3684
- pending: "pending";
3685
- uncertain: "uncertain";
3686
- }>;
3687
- generation: z.ZodNumber;
3688
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3689
- agent: z.ZodOptional<z.ZodObject<{
3690
- id: z.ZodString;
3691
- path: z.ZodString;
3692
- delegationId: z.ZodOptional<z.ZodString>;
3693
- }, z.core.$strict>>;
3694
- kind: z.ZodLiteral<"verify">;
3695
- path: z.ZodString;
3696
- key: z.ZodString;
3697
- }, z.core.$strict>]>;
3698
- sandbox: z.ZodBoolean;
3699
- }, z.core.$strict>, z.ZodObject<{
3700
- type: z.ZodLiteral<"ping">;
3701
- agentId: z.ZodString;
3702
- manifestHash: z.ZodOptional<z.ZodString>;
3703
- }, z.core.$strict>], "type">;
3704
- export type ActionDelivery = z.infer<typeof ActionDeliverySchema>;
3705
- /** An Action endpoint's answer to a ping. */
3706
- export declare const EndpointPingResponseSchema: z.ZodObject<{
3707
- agentId: z.ZodString;
3708
- implementationVersion: z.ZodString;
3709
- manifestHash: z.ZodOptional<z.ZodString>;
3710
- }, z.core.$strip>;
3711
- export type EndpointPingResponse = z.infer<typeof EndpointPingResponseSchema>;
3712
- /** The answer to a background delivery's heartbeat: a fresh token and the new deadline. */
3713
- export declare const DeliveryHeartbeatResponseSchema: z.ZodObject<{
3714
- token: z.ZodString;
3715
- deadlineAt: z.ZodString;
3716
- }, z.core.$strip>;
3717
- export type DeliveryHeartbeatResponse = z.infer<typeof DeliveryHeartbeatResponseSchema>;
3718
- /**
3719
- * The receipt of a background result (`POST /v1/actions/:id/result`): a session command's
3720
- * receipt without `requestId`, since the result carries none. The same result again returns it.
3721
- */
3722
- export declare const ActionResultReceiptSchema: z.ZodObject<{
3723
- status: z.ZodLiteral<"accepted">;
3724
- turnId: z.ZodNullable<z.ZodString>;
3725
- cursor: z.ZodNullable<z.ZodString>;
3726
- }, z.core.$strip>;
3727
- export type ActionResultReceipt = z.infer<typeof ActionResultReceiptSchema>;
3728
2873
  /** `POST /_studio/login-tokens` body. No `tenant` mints a Host-wide token (the CLI's `{}`). */
3729
2874
  export declare const StudioLoginTokenRequestSchema: z.ZodObject<{
3730
2875
  tenant: z.ZodOptional<z.ZodString>;
@@ -3986,6 +3131,15 @@ export declare const UploadArtifactResponseSchema: z.ZodObject<{
3986
3131
  }, z.core.$strict>;
3987
3132
  }, z.core.$strict>;
3988
3133
  export type UploadArtifactResponse = z.infer<typeof UploadArtifactResponseSchema>;
3134
+ /**
3135
+ * `PUT /v1/files/sha256:{hex}`: a definition file the Runtime holds (track R2 M4), named by the
3136
+ * SHA-256 of its bytes. `201` stored it, `200` already had it.
3137
+ */
3138
+ export declare const DefinitionFileViewSchema: z.ZodObject<{
3139
+ sha256: z.ZodString;
3140
+ size: z.ZodNumber;
3141
+ }, z.core.$strict>;
3142
+ export type DefinitionFileView = z.infer<typeof DefinitionFileViewSchema>;
3989
3143
  export declare const DeleteArtifactResponseSchema: z.ZodObject<{
3990
3144
  artifactId: z.ZodString;
3991
3145
  deleted: z.ZodBoolean;
@@ -4111,3 +3265,215 @@ export declare const TenantArtifactsViewSchema: z.ZodObject<{
4111
3265
  usedBytes: z.ZodNumber;
4112
3266
  }, z.core.$strict>;
4113
3267
  export type TenantArtifactsView = z.infer<typeof TenantArtifactsViewSchema>;
3268
+ /** Opt-in session reads (Host feature `session-reads`). */
3269
+ export declare const SessionListItemSchema: z.ZodObject<{
3270
+ id: z.ZodString;
3271
+ agentId: z.ZodString;
3272
+ ownerUserId: z.ZodString;
3273
+ status: z.ZodEnum<{
3274
+ cancelled: "cancelled";
3275
+ completed: "completed";
3276
+ failed: "failed";
3277
+ idle: "idle";
3278
+ paused: "paused";
3279
+ runnable: "runnable";
3280
+ running: "running";
3281
+ uncertain: "uncertain";
3282
+ waiting: "waiting";
3283
+ }>;
3284
+ activeTurnId: z.ZodNullable<z.ZodString>;
3285
+ lastTurnId: z.ZodNullable<z.ZodString>;
3286
+ sandboxId: z.ZodNullable<z.ZodString>;
3287
+ createdAt: z.ZodNullable<z.ZodString>;
3288
+ lastEventAt: z.ZodNullable<z.ZodString>;
3289
+ }, z.core.$strict>;
3290
+ export type SessionListItem = z.infer<typeof SessionListItemSchema>;
3291
+ export declare const SessionPageSchema: z.ZodObject<{
3292
+ sessions: z.ZodArray<z.ZodObject<{
3293
+ id: z.ZodString;
3294
+ agentId: z.ZodString;
3295
+ ownerUserId: z.ZodString;
3296
+ status: z.ZodEnum<{
3297
+ cancelled: "cancelled";
3298
+ completed: "completed";
3299
+ failed: "failed";
3300
+ idle: "idle";
3301
+ paused: "paused";
3302
+ runnable: "runnable";
3303
+ running: "running";
3304
+ uncertain: "uncertain";
3305
+ waiting: "waiting";
3306
+ }>;
3307
+ activeTurnId: z.ZodNullable<z.ZodString>;
3308
+ lastTurnId: z.ZodNullable<z.ZodString>;
3309
+ sandboxId: z.ZodNullable<z.ZodString>;
3310
+ createdAt: z.ZodNullable<z.ZodString>;
3311
+ lastEventAt: z.ZodNullable<z.ZodString>;
3312
+ }, z.core.$strict>>;
3313
+ nextCursor: z.ZodNullable<z.ZodString>;
3314
+ }, z.core.$strict>;
3315
+ export type SessionPage = z.infer<typeof SessionPageSchema>;
3316
+ export declare const SessionManifestViewSchema: z.ZodObject<{
3317
+ sessionId: z.ZodString;
3318
+ agentId: z.ZodString;
3319
+ manifestHash: z.ZodString;
3320
+ implementationVersion: z.ZodString;
3321
+ manifest: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3322
+ }, z.core.$strict>;
3323
+ export type SessionManifestView = z.infer<typeof SessionManifestViewSchema>;
3324
+ export declare const HistoryPageSchema: z.ZodObject<{
3325
+ items: z.ZodArray<z.ZodDiscriminatedUnion<[EventSchemaOf<"artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.iteration" | "loop.verified" | "mcp.discovered" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">, ...EventSchemaOf<"artifact.created" | "artifact.deleted" | "artifact.export.failed" | "artifact.export.skipped" | "artifact.version.created" | "command.approve" | "command.message" | "command.respond" | "context.compacted" | "delegation.completed" | "delegation.started" | "effect.uncertain" | "loop.iteration" | "loop.verified" | "mcp.discovered" | "message.assistant" | "model.failed" | "node.agent" | "node.started" | "sandbox.attached" | "sandbox.exec" | "sandbox.state" | "tool.completed" | "transcript.updated" | "turn.cancelled" | "turn.completed" | "turn.failed" | "turn.paused">[]], "type">>;
3326
+ cursor: z.ZodNullable<z.ZodString>;
3327
+ tail: z.ZodBoolean;
3328
+ }, z.core.$strip>;
3329
+ export type HistoryPage = z.infer<typeof HistoryPageSchema>;
3330
+ export declare const SessionUsageTotalsSchema: z.ZodObject<{
3331
+ inputTokens: z.ZodNumber;
3332
+ outputTokens: z.ZodNumber;
3333
+ totalTokens: z.ZodNumber;
3334
+ cachedTokens: z.ZodNumber;
3335
+ cacheWriteTokens: z.ZodNumber;
3336
+ reasoningTokens: z.ZodNumber;
3337
+ costUsd: z.ZodNumber;
3338
+ sessionId: z.ZodString;
3339
+ turnId: z.ZodNullable<z.ZodString>;
3340
+ asOf: z.ZodString;
3341
+ calls: z.ZodNumber;
3342
+ duplicates: z.ZodNumber;
3343
+ unpricedCalls: z.ZodNumber;
3344
+ unreportedCalls: z.ZodNumber;
3345
+ unknownQualityCalls: z.ZodNumber;
3346
+ }, z.core.$strict>;
3347
+ export type SessionUsageTotals = z.infer<typeof SessionUsageTotalsSchema>;
3348
+ export declare const ModelCallSchema: z.ZodObject<{
3349
+ id: z.ZodString;
3350
+ sessionId: z.ZodString;
3351
+ turnId: z.ZodString;
3352
+ agentId: z.ZodString;
3353
+ provider: z.ZodNullable<z.ZodString>;
3354
+ model: z.ZodNullable<z.ZodString>;
3355
+ at: z.ZodString;
3356
+ outcome: z.ZodEnum<{
3357
+ completed: "completed";
3358
+ failed: "failed";
3359
+ }>;
3360
+ usage: z.ZodNullable<z.ZodObject<{
3361
+ inputTokens: z.ZodNumber;
3362
+ outputTokens: z.ZodNumber;
3363
+ totalTokens: z.ZodNumber;
3364
+ cachedTokens: z.ZodNumber;
3365
+ cacheWriteTokens: z.ZodNumber;
3366
+ reasoningTokens: z.ZodNumber;
3367
+ costUsd: z.ZodNumber;
3368
+ duplicate: z.ZodBoolean;
3369
+ tokensReported: z.ZodNullable<z.ZodBoolean>;
3370
+ costKnown: z.ZodNullable<z.ZodBoolean>;
3371
+ }, z.core.$strict>>;
3372
+ }, z.core.$strict>;
3373
+ export type ModelCall = z.infer<typeof ModelCallSchema>;
3374
+ export declare const ModelCallsPageSchema: z.ZodObject<{
3375
+ calls: z.ZodArray<z.ZodObject<{
3376
+ id: z.ZodString;
3377
+ sessionId: z.ZodString;
3378
+ turnId: z.ZodString;
3379
+ agentId: z.ZodString;
3380
+ provider: z.ZodNullable<z.ZodString>;
3381
+ model: z.ZodNullable<z.ZodString>;
3382
+ at: z.ZodString;
3383
+ outcome: z.ZodEnum<{
3384
+ completed: "completed";
3385
+ failed: "failed";
3386
+ }>;
3387
+ usage: z.ZodNullable<z.ZodObject<{
3388
+ inputTokens: z.ZodNumber;
3389
+ outputTokens: z.ZodNumber;
3390
+ totalTokens: z.ZodNumber;
3391
+ cachedTokens: z.ZodNumber;
3392
+ cacheWriteTokens: z.ZodNumber;
3393
+ reasoningTokens: z.ZodNumber;
3394
+ costUsd: z.ZodNumber;
3395
+ duplicate: z.ZodBoolean;
3396
+ tokensReported: z.ZodNullable<z.ZodBoolean>;
3397
+ costKnown: z.ZodNullable<z.ZodBoolean>;
3398
+ }, z.core.$strict>>;
3399
+ }, z.core.$strict>>;
3400
+ nextCursor: z.ZodNullable<z.ZodString>;
3401
+ asOf: z.ZodString;
3402
+ }, z.core.$strict>;
3403
+ export type ModelCallsPage = z.infer<typeof ModelCallsPageSchema>;
3404
+ export declare const ModelCallExportPageSchema: z.ZodObject<{
3405
+ calls: z.ZodArray<z.ZodObject<{
3406
+ id: z.ZodString;
3407
+ sessionId: z.ZodString;
3408
+ turnId: z.ZodString;
3409
+ agentId: z.ZodString;
3410
+ provider: z.ZodNullable<z.ZodString>;
3411
+ model: z.ZodNullable<z.ZodString>;
3412
+ at: z.ZodString;
3413
+ outcome: z.ZodEnum<{
3414
+ completed: "completed";
3415
+ failed: "failed";
3416
+ }>;
3417
+ usage: z.ZodNullable<z.ZodObject<{
3418
+ inputTokens: z.ZodNumber;
3419
+ outputTokens: z.ZodNumber;
3420
+ totalTokens: z.ZodNumber;
3421
+ cachedTokens: z.ZodNumber;
3422
+ cacheWriteTokens: z.ZodNumber;
3423
+ reasoningTokens: z.ZodNumber;
3424
+ costUsd: z.ZodNumber;
3425
+ duplicate: z.ZodBoolean;
3426
+ tokensReported: z.ZodNullable<z.ZodBoolean>;
3427
+ costKnown: z.ZodNullable<z.ZodBoolean>;
3428
+ }, z.core.$strict>>;
3429
+ }, z.core.$strict>>;
3430
+ next: z.ZodNullable<z.ZodString>;
3431
+ caughtUp: z.ZodBoolean;
3432
+ asOf: z.ZodString;
3433
+ }, z.core.$strict>;
3434
+ export type ModelCallExportPage = z.infer<typeof ModelCallExportPageSchema>;
3435
+ export declare const SandboxPageSchema: z.ZodObject<{
3436
+ sandboxes: z.ZodArray<z.ZodObject<{
3437
+ id: z.ZodString;
3438
+ kind: z.ZodEnum<{
3439
+ pod: "pod";
3440
+ virtual: "virtual";
3441
+ }>;
3442
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
3443
+ spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3444
+ state: z.ZodEnum<{
3445
+ creating: "creating";
3446
+ ready: "ready";
3447
+ running: "running";
3448
+ stopped: "stopped";
3449
+ }>;
3450
+ pod: z.ZodOptional<z.ZodObject<{
3451
+ desired: z.ZodEnum<{
3452
+ deleted: "deleted";
3453
+ running: "running";
3454
+ suspended: "suspended";
3455
+ }>;
3456
+ observed: z.ZodEnum<{
3457
+ creating: "creating";
3458
+ deleting: "deleting";
3459
+ expired: "expired";
3460
+ failed: "failed";
3461
+ lost: "lost";
3462
+ running: "running";
3463
+ suspended: "suspended";
3464
+ }>;
3465
+ volumeGeneration: z.ZodNumber;
3466
+ hostEpoch: z.ZodNumber;
3467
+ expiresAt: z.ZodOptional<z.ZodString>;
3468
+ reason: z.ZodOptional<z.ZodString>;
3469
+ }, z.core.$strict>>;
3470
+ sessions: z.ZodArray<z.ZodObject<{
3471
+ id: z.ZodString;
3472
+ activeTurnId: z.ZodNullable<z.ZodString>;
3473
+ }, z.core.$strict>>;
3474
+ createdAt: z.ZodString;
3475
+ updatedAt: z.ZodString;
3476
+ }, z.core.$strict>>;
3477
+ nextCursor: z.ZodNullable<z.ZodString>;
3478
+ }, z.core.$strict>;
3479
+ export type SandboxPage = z.infer<typeof SandboxPageSchema>;