@nylorun/core 0.13.0-beta → 0.15.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 +114 -0
  2. package/dist/compatibility.d.ts +49 -25
  3. package/dist/compatibility.js +48 -27
  4. package/dist/contracts.d.ts +318 -956
  5. package/dist/contracts.js +280 -515
  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;
@@ -899,11 +900,13 @@ export declare const RejectedResponseSchema: z.ZodObject<{
899
900
  status: z.ZodLiteral<"rejected">;
900
901
  code: z.ZodEnum<{
901
902
  connection_missing: "connection_missing";
903
+ definition_files_missing: "definition_files_missing";
902
904
  host_rejected: "host_rejected";
903
905
  incompatible_host: "incompatible_host";
904
906
  internal_error: "internal_error";
905
907
  invalid_request: "invalid_request";
906
908
  issuer_unavailable: "issuer_unavailable";
909
+ key_role_mismatch: "key_role_mismatch";
907
910
  limit_exceeded: "limit_exceeded";
908
911
  not_found: "not_found";
909
912
  oauth_client_required: "oauth_client_required";
@@ -936,164 +939,6 @@ export declare const AgentRefSchema: z.ZodObject<{
936
939
  path: z.ZodString;
937
940
  delegationId: z.ZodOptional<z.ZodString>;
938
941
  }, 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
942
  /**
1098
943
  * `message.assistant`: one completed model step. `invocationId` is the model call's.
1099
944
  * `model`, `finishReason` and `usage` are present when the provider reported them.
@@ -1151,7 +996,7 @@ export declare const ContextCompactedPayloadSchema: z.ZodObject<{
1151
996
  tokensBefore: z.ZodNumber;
1152
997
  tokensAfter: z.ZodNumber;
1153
998
  }, z.core.$loose>;
1154
- /** `tool.completed`: an MCP or sandbox tool the Runtime ran. `error` for a tool error. */
999
+ /** `tool.completed`: a tool the Runtime ran (HTTP, MCP, sandbox, built-in). `error` for a tool error. */
1155
1000
  export declare const ToolCompletedPayloadSchema: z.ZodObject<{
1156
1001
  agent: z.ZodOptional<z.ZodObject<{
1157
1002
  id: z.ZodString;
@@ -1168,44 +1013,6 @@ export declare const ToolCompletedPayloadSchema: z.ZodObject<{
1168
1013
  message: z.ZodString;
1169
1014
  }, z.core.$loose>>;
1170
1015
  }, 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
1016
  export declare const EffectUncertainPayloadSchema: z.ZodObject<{
1210
1017
  effectId: z.ZodString;
1211
1018
  message: z.ZodOptional<z.ZodString>;
@@ -1216,6 +1023,7 @@ export declare const TurnCompletedPayloadSchema: z.ZodObject<{
1216
1023
  export declare const TurnPausedPayloadSchema: z.ZodObject<{
1217
1024
  interactions: z.ZodArray<z.ZodObject<{
1218
1025
  invocationId: z.ZodString;
1026
+ callId: z.ZodOptional<z.ZodString>;
1219
1027
  interaction: z.ZodObject<{
1220
1028
  id: z.ZodString;
1221
1029
  kind: z.ZodString;
@@ -1305,44 +1113,6 @@ declare const TRANSCRIPT_PAYLOADS: {
1305
1113
  message: z.ZodString;
1306
1114
  }, z.core.$loose>>;
1307
1115
  }, 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
1116
  readonly "effect.uncertain": z.ZodObject<{
1347
1117
  effectId: z.ZodString;
1348
1118
  message: z.ZodOptional<z.ZodString>;
@@ -1353,6 +1123,7 @@ declare const TRANSCRIPT_PAYLOADS: {
1353
1123
  readonly "turn.paused": z.ZodObject<{
1354
1124
  interactions: z.ZodArray<z.ZodObject<{
1355
1125
  invocationId: z.ZodString;
1126
+ callId: z.ZodOptional<z.ZodString>;
1356
1127
  interaction: z.ZodObject<{
1357
1128
  id: z.ZodString;
1358
1129
  kind: z.ZodString;
@@ -1422,24 +1193,6 @@ export declare const CommandRespondPayloadSchema: z.ZodObject<{
1422
1193
  interactionId: z.ZodString;
1423
1194
  value: z.ZodUnknown;
1424
1195
  }, 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
1196
  /** `sandbox.state`: the session's sandbox changed state. */
1444
1197
  export declare const SandboxStatePayloadSchema: z.ZodObject<{
1445
1198
  state: z.ZodEnum<{
@@ -1471,7 +1224,7 @@ export declare const SandboxExecPayloadSchema: z.ZodObject<{
1471
1224
  code: z.ZodOptional<z.ZodString>;
1472
1225
  durationMs: z.ZodNumber;
1473
1226
  }, z.core.$loose>;
1474
- /** `node.started`: a workflow node that runs an Action started. */
1227
+ /** `node.started`: a workflow tool node started. */
1475
1228
  export declare const NodeStartedPayloadSchema: z.ZodObject<{
1476
1229
  path: z.ZodString;
1477
1230
  kind: z.ZodString;
@@ -1501,16 +1254,6 @@ export declare const LoopVerifiedPayloadSchema: z.ZodObject<{
1501
1254
  feedback: z.ZodOptional<z.ZodString>;
1502
1255
  data: z.ZodOptional<z.ZodUnknown>;
1503
1256
  }, 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
1257
  /**
1515
1258
  * `transcript.updated` (internal; blueprint P0.3): the own loop's model-facing transcript after a
1516
1259
  * settled segment, as an edit of the previous one: keep its first `keep` entries, then append
@@ -1606,6 +1349,41 @@ export declare const ArtifactExportFailedPayloadSchema: z.ZodObject<{
1606
1349
  name: z.ZodString;
1607
1350
  message: z.ZodString;
1608
1351
  }, z.core.$loose>;
1352
+ /** What readying one declared MCP server found (`mcp.discovered`). */
1353
+ export declare const McpServerOutcomeSchema: z.ZodObject<{
1354
+ agentId: z.ZodOptional<z.ZodString>;
1355
+ capabilityId: z.ZodString;
1356
+ serverName: z.ZodString;
1357
+ outcome: z.ZodEnum<{
1358
+ connected: "connected";
1359
+ failed: "failed";
1360
+ refused: "refused";
1361
+ }>;
1362
+ message: z.ZodString;
1363
+ tools: z.ZodNumber;
1364
+ credentialIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1365
+ }, z.core.$loose>;
1366
+ export type McpServerOutcome = z.infer<typeof McpServerOutcomeSchema>;
1367
+ /**
1368
+ * `mcp.discovered`: the session's first turn readied its MCP servers and pinned the tools they
1369
+ * offer, one outcome per declared server. A server that did not connect adds no tools for the
1370
+ * session's life, so this is where the model's missing tools show (also `mcpDiagnostics`).
1371
+ */
1372
+ export declare const McpDiscoveredPayloadSchema: z.ZodObject<{
1373
+ servers: z.ZodArray<z.ZodObject<{
1374
+ agentId: z.ZodOptional<z.ZodString>;
1375
+ capabilityId: z.ZodString;
1376
+ serverName: z.ZodString;
1377
+ outcome: z.ZodEnum<{
1378
+ connected: "connected";
1379
+ failed: "failed";
1380
+ refused: "refused";
1381
+ }>;
1382
+ message: z.ZodString;
1383
+ tools: z.ZodNumber;
1384
+ credentialIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1385
+ }, z.core.$loose>>;
1386
+ }, z.core.$loose>;
1609
1387
  /**
1610
1388
  * The event catalog (Durable Streams §9.5): every session event type, its payload schema, its
1611
1389
  * payload schema version and who writes it. A type not listed here cannot be written. A type
@@ -1670,6 +1448,7 @@ export declare const EVENT_CATALOG: {
1670
1448
  readonly payload: z.ZodObject<{
1671
1449
  interactions: z.ZodArray<z.ZodObject<{
1672
1450
  invocationId: z.ZodString;
1451
+ callId: z.ZodOptional<z.ZodString>;
1673
1452
  interaction: z.ZodObject<{
1674
1453
  id: z.ZodString;
1675
1454
  kind: z.ZodString;
@@ -1775,80 +1554,6 @@ export declare const EVENT_CATALOG: {
1775
1554
  readonly source: "loop";
1776
1555
  readonly version: 1;
1777
1556
  };
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
1557
  readonly "effect.uncertain": {
1853
1558
  readonly payload: z.ZodObject<{
1854
1559
  effectId: z.ZodString;
@@ -1881,6 +1586,25 @@ export declare const EVENT_CATALOG: {
1881
1586
  readonly source: "loop";
1882
1587
  readonly version: 1;
1883
1588
  };
1589
+ readonly "mcp.discovered": {
1590
+ readonly payload: z.ZodObject<{
1591
+ servers: z.ZodArray<z.ZodObject<{
1592
+ agentId: z.ZodOptional<z.ZodString>;
1593
+ capabilityId: z.ZodString;
1594
+ serverName: z.ZodString;
1595
+ outcome: z.ZodEnum<{
1596
+ connected: "connected";
1597
+ failed: "failed";
1598
+ refused: "refused";
1599
+ }>;
1600
+ message: z.ZodString;
1601
+ tools: z.ZodNumber;
1602
+ credentialIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1603
+ }, z.core.$loose>>;
1604
+ }, z.core.$loose>;
1605
+ readonly source: "loop";
1606
+ readonly version: 1;
1607
+ };
1884
1608
  readonly "sandbox.state": {
1885
1609
  readonly payload: z.ZodObject<{
1886
1610
  state: z.ZodEnum<{
@@ -1960,19 +1684,6 @@ export declare const EVENT_CATALOG: {
1960
1684
  readonly source: "api";
1961
1685
  readonly version: 1;
1962
1686
  };
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
1687
  readonly "artifact.created": {
1977
1688
  readonly payload: z.ZodObject<{
1978
1689
  artifactId: z.ZodString;
@@ -2083,7 +1794,7 @@ type EventSchemaOf<T extends EventType> = z.ZodObject<typeof eventEnvelope & {
2083
1794
  /** One schema per event type, keyed by type (the OpenAPI components). */
2084
1795
  export declare const EVENT_SCHEMAS: { [T in EventType]: EventSchemaOf<T>; };
2085
1796
  /** 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">;
1797
+ 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
1798
  export type SessionEvent = {
2088
1799
  [T in EventType]: z.infer<EventSchemaOf<T>>;
2089
1800
  }[EventType];
@@ -2098,7 +1809,7 @@ export type SessionEventOf<T extends EventType> = Extract<SessionEvent, {
2098
1809
  */
2099
1810
  export declare function parseSessionEvent(value: unknown): SessionEvent | LiveEvent;
2100
1811
  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">>;
1812
+ 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
1813
  cursor: z.ZodNullable<z.ZodString>;
2103
1814
  }, z.core.$strip>;
2104
1815
  export type SessionItemsResponse = {
@@ -2133,6 +1844,13 @@ export declare const ReadyResponseSchema: z.ZodObject<{
2133
1844
  }>;
2134
1845
  service: z.ZodString;
2135
1846
  checks: z.ZodRecord<z.ZodString, z.ZodBoolean>;
1847
+ harness: z.ZodOptional<z.ZodObject<{
1848
+ mode: z.ZodEnum<{
1849
+ "in-process": "in-process";
1850
+ remote: "remote";
1851
+ }>;
1852
+ connected: z.ZodNumber;
1853
+ }, z.core.$strip>>;
2136
1854
  }, z.core.$strip>;
2137
1855
  export type HealthResponse = z.infer<typeof HealthResponseSchema>;
2138
1856
  export type ReadyResponse = z.infer<typeof ReadyResponseSchema>;
@@ -2176,8 +1894,8 @@ export declare const TenantCauseSchema: z.ZodObject<{
2176
1894
  }, z.core.$strict>;
2177
1895
  export type TenantCause = z.infer<typeof TenantCauseSchema>;
2178
1896
  /**
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.
1897
+ * The Host's one Tenant. `unavailable` while it opens, when opening it failed (`cause`), or
1898
+ * when it is closing.
2181
1899
  */
2182
1900
  export declare const HostTenantSchema: z.ZodObject<{
2183
1901
  id: z.ZodNullable<z.ZodString>;
@@ -2234,165 +1952,9 @@ export declare const HarnessStatusSchema: z.ZodObject<{
2234
1952
  workspace: z.ZodBoolean;
2235
1953
  }, z.core.$strict>;
2236
1954
  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
1955
  /**
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.
1956
+ * A key of the Tenant (`/v1/tenant/keys`, `nylorun-operate keys`), named by its id
1957
+ * (`APPLICATION_KEY_ID_PATTERN`), with its role. The Runtime keeps only its hash.
2396
1958
  */
2397
1959
  export declare const OperatorKeySchema: z.ZodObject<{
2398
1960
  id: z.ZodString;
@@ -2400,7 +1962,7 @@ export declare const OperatorKeySchema: z.ZodObject<{
2400
1962
  createdAt: z.ZodString;
2401
1963
  }, z.core.$strict>;
2402
1964
  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. */
1965
+ /** `GET /v1/tenant/keys`: the Tenant's keys, by id. */
2404
1966
  export declare const ListOperatorKeysResponseSchema: z.ZodObject<{
2405
1967
  keys: z.ZodArray<z.ZodObject<{
2406
1968
  id: z.ZodString;
@@ -2409,7 +1971,7 @@ export declare const ListOperatorKeysResponseSchema: z.ZodObject<{
2409
1971
  }, z.core.$strict>>;
2410
1972
  }, z.core.$strict>;
2411
1973
  export type ListOperatorKeysResponse = z.infer<typeof ListOperatorKeysResponseSchema>;
2412
- /** `PUT /v1/admin/keys/{id}`: the new key, shown this once; `rotated` when it replaced one. */
1974
+ /** `PUT /v1/tenant/keys/{keyId}`: the new key, shown this once; `rotated` when it replaced one. */
2413
1975
  export declare const PutOperatorKeyResponseSchema: z.ZodObject<{
2414
1976
  id: z.ZodString;
2415
1977
  role: z.ZodString;
@@ -2418,7 +1980,7 @@ export declare const PutOperatorKeyResponseSchema: z.ZodObject<{
2418
1980
  rotated: z.ZodBoolean;
2419
1981
  }, z.core.$strict>;
2420
1982
  export type PutOperatorKeyResponse = z.infer<typeof PutOperatorKeyResponseSchema>;
2421
- /** `DELETE /v1/admin/keys/{id}`: the key no longer authenticates. */
1983
+ /** `DELETE /v1/tenant/keys/{keyId}`: the key no longer authenticates. */
2422
1984
  export declare const DeleteOperatorKeyResponseSchema: z.ZodObject<{
2423
1985
  id: z.ZodString;
2424
1986
  deleted: z.ZodLiteral<true>;
@@ -2438,10 +2000,16 @@ export declare const ProjectLinkFileSchema: z.ZodObject<{
2438
2000
  tenantId: z.ZodOptional<z.ZodString>;
2439
2001
  }, z.core.$loose>;
2440
2002
  export type ProjectLinkFile = z.infer<typeof ProjectLinkFileSchema>;
2003
+ /**
2004
+ * `.nylorun/credentials.json`: the Project's application key and, from protocol 8, its
2005
+ * management key. Still format 1: readers that predate the management key ignore it.
2006
+ */
2441
2007
  export declare const ProjectCredentialsFileSchema: z.ZodObject<{
2442
2008
  format: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
2443
2009
  applicationKey: z.ZodString;
2444
2010
  principalId: z.ZodString;
2011
+ managementKey: z.ZodOptional<z.ZodString>;
2012
+ managementPrincipalId: z.ZodOptional<z.ZodString>;
2445
2013
  }, z.core.$loose>;
2446
2014
  export type ProjectCredentialsFile = z.infer<typeof ProjectCredentialsFileSchema>;
2447
2015
  export declare const HostModelViewSchema: z.ZodUnion<readonly [z.ZodObject<{
@@ -2475,7 +2043,6 @@ export declare const TenantStatusSchema: z.ZodObject<{
2475
2043
  store: z.ZodBoolean;
2476
2044
  scheduler: z.ZodBoolean;
2477
2045
  model: z.ZodBoolean;
2478
- endpoints: z.ZodBoolean;
2479
2046
  schema: z.ZodBoolean;
2480
2047
  }, z.core.$strict>;
2481
2048
  model: z.ZodUnion<readonly [z.ZodObject<{
@@ -2498,13 +2065,10 @@ export declare const TenantStatusSchema: z.ZodObject<{
2498
2065
  }, z.core.$strict>]>;
2499
2066
  agents: z.ZodArray<z.ZodObject<{
2500
2067
  agentId: z.ZodString;
2501
- registered: z.ZodBoolean;
2502
- endpoint: z.ZodBoolean;
2503
2068
  }, z.core.$strict>>;
2504
2069
  counts: z.ZodObject<{
2505
2070
  sessions: z.ZodNumber;
2506
2071
  runningSessions: z.ZodNumber;
2507
- pendingActions: z.ZodNumber;
2508
2072
  uncertainEffects: z.ZodNumber;
2509
2073
  }, z.core.$strict>;
2510
2074
  sandbox: z.ZodObject<{
@@ -2646,9 +2210,9 @@ export type ResetTenantRequest = z.infer<typeof ResetTenantRequestSchema>;
2646
2210
  * narrow a request to. `sessions:own` reaches only the subject's own sessions; the others reach
2647
2211
  * Tenant-wide resources. `sandboxes:write` creates and deletes sandboxes (Host feature
2648
2212
  * `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).
2213
+ * installation's, managed with management keys on the Management API (protocol 8).
2650
2214
  */
2651
- export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "tenant:settings", "sandboxes:write"];
2215
+ export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "sandboxes:write"];
2652
2216
  export type SubjectScope = (typeof SUBJECT_SCOPES)[number];
2653
2217
  /** A valid subject: 1–200 visible ASCII characters, not reserved by the Runtime. */
2654
2218
  export declare function isSubject(value: unknown): value is string;
@@ -2665,22 +2229,20 @@ export declare function parseSubjectHeaders(subject: string, scopes: string | un
2665
2229
  message: string;
2666
2230
  };
2667
2231
  /**
2668
- * Scopes a token caller (a trusted issuer's token) may carry: never `agents:write` or
2669
- * `tenant:settings`.
2232
+ * Scopes a token caller (a trusted issuer's token) may carry: never `agents:write`.
2670
2233
  */
2671
2234
  export declare const TOKEN_SCOPES: readonly ["agents:read", "sessions:own", "sandboxes:write"];
2672
2235
  /** The most sandbox grants one token caller carries. */
2673
2236
  export declare const TOKEN_SANDBOX_GRANTS_MAX = 16;
2674
2237
  export type TokenScope = (typeof TOKEN_SCOPES)[number];
2675
2238
  /**
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.
2239
+ * The longest a token the Runtime signs itself lives, in seconds (capability links): rotating
2240
+ * signing keys revokes the previous key once the longest token it may have signed has expired.
2679
2241
  */
2680
2242
  export declare const TOKEN_TTL_MAX_SECONDS = 900;
2681
2243
  /**
2682
- * The `iss` of every token a Tenant's Runtime signs itself: delivery tokens, capability links,
2683
- * run, host and egress tokens.
2244
+ * The `iss` of every token a Tenant's Runtime signs itself: capability links, run, host and
2245
+ * egress tokens.
2684
2246
  */
2685
2247
  export declare function tenantTokenIssuer(tenantId: string): string;
2686
2248
  export declare const SIGNING_KEY_STATES: readonly ["standby", "current", "previous", "revoked"];
@@ -2772,7 +2334,7 @@ export declare const RevokeSigningKeyRequestSchema: z.ZodObject<{
2772
2334
  export declare const ISSUER_SCOPES: readonly ["agents:read", "sessions:own", "sandboxes:write", "studio"];
2773
2335
  export type IssuerScope = (typeof ISSUER_SCOPES)[number];
2774
2336
  /** 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"];
2337
+ export declare const CALLER_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "sandboxes:write", "studio"];
2776
2338
  export type CallerScope = (typeof CALLER_SCOPES)[number];
2777
2339
  /**
2778
2340
  * `GET /v1/me`: who the Runtime takes the caller to be, for any credential.
@@ -2794,7 +2356,6 @@ export declare const MeResponseSchema: z.ZodObject<{
2794
2356
  "sandboxes:write": "sandboxes:write";
2795
2357
  "sessions:own": "sessions:own";
2796
2358
  studio: "studio";
2797
- "tenant:settings": "tenant:settings";
2798
2359
  }>>;
2799
2360
  agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2800
2361
  sandboxes: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -2917,150 +2478,6 @@ export declare const SessionViewSchema: z.ZodObject<{
2917
2478
  mcpDiagnostics: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2918
2479
  waits: z.ZodOptional<z.ZodUnknown>;
2919
2480
  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
2481
  uncertainEffects: z.ZodArray<z.ZodObject<{
3065
2482
  effectId: z.ZodString;
3066
2483
  turnId: z.ZodString;
@@ -3403,9 +2820,6 @@ export declare const DeletedResponseSchema: z.ZodObject<{
3403
2820
  id: z.ZodString;
3404
2821
  }, z.core.$strict>;
3405
2822
  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
2823
  /**
3410
2824
  * The last frame of a session stream the Runtime ends: `event: nylorun.closed`, when the
3411
2825
  * token caller's token expires.
@@ -3422,11 +2836,13 @@ export type StreamClosedFrame = z.infer<typeof StreamClosedFrameSchema>;
3422
2836
  */
3423
2837
  export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
3424
2838
  connection_missing: "connection_missing";
2839
+ definition_files_missing: "definition_files_missing";
3425
2840
  host_rejected: "host_rejected";
3426
2841
  incompatible_host: "incompatible_host";
3427
2842
  internal_error: "internal_error";
3428
2843
  invalid_request: "invalid_request";
3429
2844
  issuer_unavailable: "issuer_unavailable";
2845
+ key_role_mismatch: "key_role_mismatch";
3430
2846
  limit_exceeded: "limit_exceeded";
3431
2847
  not_found: "not_found";
3432
2848
  oauth_client_required: "oauth_client_required";
@@ -3450,281 +2866,6 @@ export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
3450
2866
  unsupported_media_type: "unsupported_media_type";
3451
2867
  }>;
3452
2868
  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
2869
  /** `POST /_studio/login-tokens` body. No `tenant` mints a Host-wide token (the CLI's `{}`). */
3729
2870
  export declare const StudioLoginTokenRequestSchema: z.ZodObject<{
3730
2871
  tenant: z.ZodOptional<z.ZodString>;
@@ -3986,6 +3127,15 @@ export declare const UploadArtifactResponseSchema: z.ZodObject<{
3986
3127
  }, z.core.$strict>;
3987
3128
  }, z.core.$strict>;
3988
3129
  export type UploadArtifactResponse = z.infer<typeof UploadArtifactResponseSchema>;
3130
+ /**
3131
+ * `PUT /v1/files/sha256:{hex}`: a definition file the Runtime holds (track R2 M4), named by the
3132
+ * SHA-256 of its bytes. `201` stored it, `200` already had it.
3133
+ */
3134
+ export declare const DefinitionFileViewSchema: z.ZodObject<{
3135
+ sha256: z.ZodString;
3136
+ size: z.ZodNumber;
3137
+ }, z.core.$strict>;
3138
+ export type DefinitionFileView = z.infer<typeof DefinitionFileViewSchema>;
3989
3139
  export declare const DeleteArtifactResponseSchema: z.ZodObject<{
3990
3140
  artifactId: z.ZodString;
3991
3141
  deleted: z.ZodBoolean;
@@ -4111,3 +3261,215 @@ export declare const TenantArtifactsViewSchema: z.ZodObject<{
4111
3261
  usedBytes: z.ZodNumber;
4112
3262
  }, z.core.$strict>;
4113
3263
  export type TenantArtifactsView = z.infer<typeof TenantArtifactsViewSchema>;
3264
+ /** Opt-in session reads (Host feature `session-reads`). */
3265
+ export declare const SessionListItemSchema: z.ZodObject<{
3266
+ id: z.ZodString;
3267
+ agentId: z.ZodString;
3268
+ ownerUserId: z.ZodString;
3269
+ status: z.ZodEnum<{
3270
+ cancelled: "cancelled";
3271
+ completed: "completed";
3272
+ failed: "failed";
3273
+ idle: "idle";
3274
+ paused: "paused";
3275
+ runnable: "runnable";
3276
+ running: "running";
3277
+ uncertain: "uncertain";
3278
+ waiting: "waiting";
3279
+ }>;
3280
+ activeTurnId: z.ZodNullable<z.ZodString>;
3281
+ lastTurnId: z.ZodNullable<z.ZodString>;
3282
+ sandboxId: z.ZodNullable<z.ZodString>;
3283
+ createdAt: z.ZodNullable<z.ZodString>;
3284
+ lastEventAt: z.ZodNullable<z.ZodString>;
3285
+ }, z.core.$strict>;
3286
+ export type SessionListItem = z.infer<typeof SessionListItemSchema>;
3287
+ export declare const SessionPageSchema: z.ZodObject<{
3288
+ sessions: z.ZodArray<z.ZodObject<{
3289
+ id: z.ZodString;
3290
+ agentId: z.ZodString;
3291
+ ownerUserId: z.ZodString;
3292
+ status: z.ZodEnum<{
3293
+ cancelled: "cancelled";
3294
+ completed: "completed";
3295
+ failed: "failed";
3296
+ idle: "idle";
3297
+ paused: "paused";
3298
+ runnable: "runnable";
3299
+ running: "running";
3300
+ uncertain: "uncertain";
3301
+ waiting: "waiting";
3302
+ }>;
3303
+ activeTurnId: z.ZodNullable<z.ZodString>;
3304
+ lastTurnId: z.ZodNullable<z.ZodString>;
3305
+ sandboxId: z.ZodNullable<z.ZodString>;
3306
+ createdAt: z.ZodNullable<z.ZodString>;
3307
+ lastEventAt: z.ZodNullable<z.ZodString>;
3308
+ }, z.core.$strict>>;
3309
+ nextCursor: z.ZodNullable<z.ZodString>;
3310
+ }, z.core.$strict>;
3311
+ export type SessionPage = z.infer<typeof SessionPageSchema>;
3312
+ export declare const SessionManifestViewSchema: z.ZodObject<{
3313
+ sessionId: z.ZodString;
3314
+ agentId: z.ZodString;
3315
+ manifestHash: z.ZodString;
3316
+ implementationVersion: z.ZodString;
3317
+ manifest: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3318
+ }, z.core.$strict>;
3319
+ export type SessionManifestView = z.infer<typeof SessionManifestViewSchema>;
3320
+ export declare const HistoryPageSchema: z.ZodObject<{
3321
+ 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">>;
3322
+ cursor: z.ZodNullable<z.ZodString>;
3323
+ tail: z.ZodBoolean;
3324
+ }, z.core.$strip>;
3325
+ export type HistoryPage = z.infer<typeof HistoryPageSchema>;
3326
+ export declare const SessionUsageTotalsSchema: z.ZodObject<{
3327
+ inputTokens: z.ZodNumber;
3328
+ outputTokens: z.ZodNumber;
3329
+ totalTokens: z.ZodNumber;
3330
+ cachedTokens: z.ZodNumber;
3331
+ cacheWriteTokens: z.ZodNumber;
3332
+ reasoningTokens: z.ZodNumber;
3333
+ costUsd: z.ZodNumber;
3334
+ sessionId: z.ZodString;
3335
+ turnId: z.ZodNullable<z.ZodString>;
3336
+ asOf: z.ZodString;
3337
+ calls: z.ZodNumber;
3338
+ duplicates: z.ZodNumber;
3339
+ unpricedCalls: z.ZodNumber;
3340
+ unreportedCalls: z.ZodNumber;
3341
+ unknownQualityCalls: z.ZodNumber;
3342
+ }, z.core.$strict>;
3343
+ export type SessionUsageTotals = z.infer<typeof SessionUsageTotalsSchema>;
3344
+ export declare const ModelCallSchema: z.ZodObject<{
3345
+ id: z.ZodString;
3346
+ sessionId: z.ZodString;
3347
+ turnId: z.ZodString;
3348
+ agentId: z.ZodString;
3349
+ provider: z.ZodNullable<z.ZodString>;
3350
+ model: z.ZodNullable<z.ZodString>;
3351
+ at: z.ZodString;
3352
+ outcome: z.ZodEnum<{
3353
+ completed: "completed";
3354
+ failed: "failed";
3355
+ }>;
3356
+ usage: z.ZodNullable<z.ZodObject<{
3357
+ inputTokens: z.ZodNumber;
3358
+ outputTokens: z.ZodNumber;
3359
+ totalTokens: z.ZodNumber;
3360
+ cachedTokens: z.ZodNumber;
3361
+ cacheWriteTokens: z.ZodNumber;
3362
+ reasoningTokens: z.ZodNumber;
3363
+ costUsd: z.ZodNumber;
3364
+ duplicate: z.ZodBoolean;
3365
+ tokensReported: z.ZodNullable<z.ZodBoolean>;
3366
+ costKnown: z.ZodNullable<z.ZodBoolean>;
3367
+ }, z.core.$strict>>;
3368
+ }, z.core.$strict>;
3369
+ export type ModelCall = z.infer<typeof ModelCallSchema>;
3370
+ export declare const ModelCallsPageSchema: z.ZodObject<{
3371
+ calls: z.ZodArray<z.ZodObject<{
3372
+ id: z.ZodString;
3373
+ sessionId: z.ZodString;
3374
+ turnId: z.ZodString;
3375
+ agentId: z.ZodString;
3376
+ provider: z.ZodNullable<z.ZodString>;
3377
+ model: z.ZodNullable<z.ZodString>;
3378
+ at: z.ZodString;
3379
+ outcome: z.ZodEnum<{
3380
+ completed: "completed";
3381
+ failed: "failed";
3382
+ }>;
3383
+ usage: z.ZodNullable<z.ZodObject<{
3384
+ inputTokens: z.ZodNumber;
3385
+ outputTokens: z.ZodNumber;
3386
+ totalTokens: z.ZodNumber;
3387
+ cachedTokens: z.ZodNumber;
3388
+ cacheWriteTokens: z.ZodNumber;
3389
+ reasoningTokens: z.ZodNumber;
3390
+ costUsd: z.ZodNumber;
3391
+ duplicate: z.ZodBoolean;
3392
+ tokensReported: z.ZodNullable<z.ZodBoolean>;
3393
+ costKnown: z.ZodNullable<z.ZodBoolean>;
3394
+ }, z.core.$strict>>;
3395
+ }, z.core.$strict>>;
3396
+ nextCursor: z.ZodNullable<z.ZodString>;
3397
+ asOf: z.ZodString;
3398
+ }, z.core.$strict>;
3399
+ export type ModelCallsPage = z.infer<typeof ModelCallsPageSchema>;
3400
+ export declare const ModelCallExportPageSchema: z.ZodObject<{
3401
+ calls: z.ZodArray<z.ZodObject<{
3402
+ id: z.ZodString;
3403
+ sessionId: z.ZodString;
3404
+ turnId: z.ZodString;
3405
+ agentId: z.ZodString;
3406
+ provider: z.ZodNullable<z.ZodString>;
3407
+ model: z.ZodNullable<z.ZodString>;
3408
+ at: z.ZodString;
3409
+ outcome: z.ZodEnum<{
3410
+ completed: "completed";
3411
+ failed: "failed";
3412
+ }>;
3413
+ usage: z.ZodNullable<z.ZodObject<{
3414
+ inputTokens: z.ZodNumber;
3415
+ outputTokens: z.ZodNumber;
3416
+ totalTokens: z.ZodNumber;
3417
+ cachedTokens: z.ZodNumber;
3418
+ cacheWriteTokens: z.ZodNumber;
3419
+ reasoningTokens: z.ZodNumber;
3420
+ costUsd: z.ZodNumber;
3421
+ duplicate: z.ZodBoolean;
3422
+ tokensReported: z.ZodNullable<z.ZodBoolean>;
3423
+ costKnown: z.ZodNullable<z.ZodBoolean>;
3424
+ }, z.core.$strict>>;
3425
+ }, z.core.$strict>>;
3426
+ next: z.ZodNullable<z.ZodString>;
3427
+ caughtUp: z.ZodBoolean;
3428
+ asOf: z.ZodString;
3429
+ }, z.core.$strict>;
3430
+ export type ModelCallExportPage = z.infer<typeof ModelCallExportPageSchema>;
3431
+ export declare const SandboxPageSchema: z.ZodObject<{
3432
+ sandboxes: z.ZodArray<z.ZodObject<{
3433
+ id: z.ZodString;
3434
+ kind: z.ZodEnum<{
3435
+ pod: "pod";
3436
+ virtual: "virtual";
3437
+ }>;
3438
+ labels: z.ZodRecord<z.ZodString, z.ZodString>;
3439
+ spec: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3440
+ state: z.ZodEnum<{
3441
+ creating: "creating";
3442
+ ready: "ready";
3443
+ running: "running";
3444
+ stopped: "stopped";
3445
+ }>;
3446
+ pod: z.ZodOptional<z.ZodObject<{
3447
+ desired: z.ZodEnum<{
3448
+ deleted: "deleted";
3449
+ running: "running";
3450
+ suspended: "suspended";
3451
+ }>;
3452
+ observed: z.ZodEnum<{
3453
+ creating: "creating";
3454
+ deleting: "deleting";
3455
+ expired: "expired";
3456
+ failed: "failed";
3457
+ lost: "lost";
3458
+ running: "running";
3459
+ suspended: "suspended";
3460
+ }>;
3461
+ volumeGeneration: z.ZodNumber;
3462
+ hostEpoch: z.ZodNumber;
3463
+ expiresAt: z.ZodOptional<z.ZodString>;
3464
+ reason: z.ZodOptional<z.ZodString>;
3465
+ }, z.core.$strict>>;
3466
+ sessions: z.ZodArray<z.ZodObject<{
3467
+ id: z.ZodString;
3468
+ activeTurnId: z.ZodNullable<z.ZodString>;
3469
+ }, z.core.$strict>>;
3470
+ createdAt: z.ZodString;
3471
+ updatedAt: z.ZodString;
3472
+ }, z.core.$strict>>;
3473
+ nextCursor: z.ZodNullable<z.ZodString>;
3474
+ }, z.core.$strict>;
3475
+ export type SandboxPage = z.infer<typeof SandboxPageSchema>;