@nylorun/core 0.12.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 +159 -0
  2. package/dist/compatibility.d.ts +84 -50
  3. package/dist/compatibility.js +84 -67
  4. package/dist/contracts.d.ts +462 -1196
  5. package/dist/contracts.js +403 -681
  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<{
@@ -44,10 +44,10 @@ export declare const SandboxInlineRequestSchema: z.ZodObject<{
44
44
  export type SandboxInlineRequest = z.infer<typeof SandboxInlineRequestSchema>;
45
45
  export declare const SANDBOX_ID_MAX_LENGTH = 200;
46
46
  export declare function isSandboxId(value: unknown): value is string;
47
- /** An `sbx` entry: an exact sandbox id, or a prefix ending in `/*` (`team-a/*`). */
47
+ /** A sandbox grant: an exact sandbox id, or a prefix ending in `/*` (`team-a/*`). */
48
48
  export declare function isSandboxGrant(value: unknown): value is string;
49
49
  /**
50
- * Whether `grants` (a subject token's `sbx`) reach sandbox `id`: an exact entry, or a prefix
50
+ * Whether `grants` (a token caller's sandbox grants) reach sandbox `id`: an exact entry, or a prefix
51
51
  * entry `p/*` for any id below `p/`. No grants reach no sandbox.
52
52
  */
53
53
  export declare function sandboxGranted(grants: readonly string[] | undefined, id: string): boolean;
@@ -456,11 +456,17 @@ export declare const PutTenantSandboxRequestSchema: z.ZodObject<{
456
456
  }, z.core.$strict>;
457
457
  export type PutTenantSandboxRequest = z.infer<typeof PutTenantSandboxRequestSchema>;
458
458
  export type PutSessionRequest = z.infer<typeof PutSessionRequestSchema>;
459
+ /** The owner of every installation vault (`scope: "installation"`); a reserved subject. */
460
+ export declare const INSTALLATION_OWNER = "installation";
459
461
  export declare const CreateVaultRequestSchema: z.ZodObject<{
460
462
  requestId: z.ZodString;
461
463
  idempotencyKey: z.ZodString;
462
464
  name: z.ZodString;
463
- ownerUserId: z.ZodString;
465
+ scope: z.ZodOptional<z.ZodEnum<{
466
+ installation: "installation";
467
+ user: "user";
468
+ }>>;
469
+ ownerUserId: z.ZodOptional<z.ZodString>;
464
470
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
465
471
  }, z.core.$strict>;
466
472
  export type CreateVaultRequest = z.infer<typeof CreateVaultRequestSchema>;
@@ -632,11 +638,12 @@ export declare const MessageEventBodySchema: z.ZodUnion<readonly [z.ZodObject<{
632
638
  version: z.ZodOptional<z.ZodNumber>;
633
639
  }, z.core.$strict>], "type">>;
634
640
  }, z.core.$strict>]>;
635
- 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<{
636
643
  value: z.ZodUnknown;
637
644
  statePatch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
638
645
  }, z.core.$strict>;
639
- export type ActionOutcome = z.infer<typeof ActionOutcomeSchema>;
646
+ export type EffectOutcome = z.infer<typeof EffectOutcomeSchema>;
640
647
  export declare const SessionCommandSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
641
648
  requestId: z.ZodString;
642
649
  idempotencyKey: z.ZodString;
@@ -893,12 +900,18 @@ export declare const RejectedResponseSchema: z.ZodObject<{
893
900
  status: z.ZodLiteral<"rejected">;
894
901
  code: z.ZodEnum<{
895
902
  connection_missing: "connection_missing";
903
+ definition_files_missing: "definition_files_missing";
896
904
  host_rejected: "host_rejected";
897
905
  incompatible_host: "incompatible_host";
898
906
  internal_error: "internal_error";
899
907
  invalid_request: "invalid_request";
908
+ issuer_unavailable: "issuer_unavailable";
909
+ key_role_mismatch: "key_role_mismatch";
900
910
  limit_exceeded: "limit_exceeded";
901
911
  not_found: "not_found";
912
+ oauth_client_required: "oauth_client_required";
913
+ oauth_failed: "oauth_failed";
914
+ oauth_state_invalid: "oauth_state_invalid";
902
915
  origin_rejected: "origin_rejected";
903
916
  placement_refused: "placement_refused";
904
917
  protocol_unsupported: "protocol_unsupported";
@@ -926,164 +939,6 @@ export declare const AgentRefSchema: z.ZodObject<{
926
939
  path: z.ZodString;
927
940
  delegationId: z.ZodOptional<z.ZodString>;
928
941
  }, z.core.$strict>;
929
- /** The hook point an action runs, and the capabilities that registered it (manifest order). */
930
- export declare const ActionHookSchema: z.ZodObject<{
931
- at: z.ZodEnum<{
932
- after: "after";
933
- before: "before";
934
- }>;
935
- scope: z.ZodEnum<{
936
- step: "step";
937
- turn: "turn";
938
- }>;
939
- capabilityIds: z.ZodArray<z.ZodString>;
940
- }, z.core.$strict>;
941
- export type ActionHook = z.infer<typeof ActionHookSchema>;
942
- export declare const ActionSchema: z.ZodUnion<readonly [z.ZodObject<{
943
- actionId: z.ZodString;
944
- sessionId: z.ZodString;
945
- turnId: z.ZodString;
946
- agentId: z.ZodString;
947
- manifestHash: z.ZodString;
948
- implementationVersion: z.ZodString;
949
- input: z.ZodUnknown;
950
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
951
- status: z.ZodEnum<{
952
- cancelled: "cancelled";
953
- completed: "completed";
954
- delivering: "delivering";
955
- pending: "pending";
956
- uncertain: "uncertain";
957
- }>;
958
- generation: z.ZodNumber;
959
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
960
- agent: z.ZodOptional<z.ZodObject<{
961
- id: z.ZodString;
962
- path: z.ZodString;
963
- delegationId: z.ZodOptional<z.ZodString>;
964
- }, z.core.$strict>>;
965
- kind: z.ZodLiteral<"tool">;
966
- capabilityId: z.ZodString;
967
- toolName: z.ZodString;
968
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
969
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
970
- }, z.core.$strict>, z.ZodObject<{
971
- actionId: z.ZodString;
972
- sessionId: z.ZodString;
973
- turnId: z.ZodString;
974
- agentId: z.ZodString;
975
- manifestHash: z.ZodString;
976
- implementationVersion: z.ZodString;
977
- input: z.ZodUnknown;
978
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
979
- status: z.ZodEnum<{
980
- cancelled: "cancelled";
981
- completed: "completed";
982
- delivering: "delivering";
983
- pending: "pending";
984
- uncertain: "uncertain";
985
- }>;
986
- generation: z.ZodNumber;
987
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
988
- agent: z.ZodOptional<z.ZodObject<{
989
- id: z.ZodString;
990
- path: z.ZodString;
991
- delegationId: z.ZodOptional<z.ZodString>;
992
- }, z.core.$strict>>;
993
- kind: z.ZodLiteral<"tool">;
994
- path: z.ZodString;
995
- key: z.ZodString;
996
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
997
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
998
- }, z.core.$strict>, z.ZodObject<{
999
- actionId: z.ZodString;
1000
- sessionId: z.ZodString;
1001
- turnId: z.ZodString;
1002
- agentId: z.ZodString;
1003
- manifestHash: z.ZodString;
1004
- implementationVersion: z.ZodString;
1005
- input: z.ZodUnknown;
1006
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1007
- status: z.ZodEnum<{
1008
- cancelled: "cancelled";
1009
- completed: "completed";
1010
- delivering: "delivering";
1011
- pending: "pending";
1012
- uncertain: "uncertain";
1013
- }>;
1014
- generation: z.ZodNumber;
1015
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1016
- agent: z.ZodOptional<z.ZodObject<{
1017
- id: z.ZodString;
1018
- path: z.ZodString;
1019
- delegationId: z.ZodOptional<z.ZodString>;
1020
- }, z.core.$strict>>;
1021
- kind: z.ZodLiteral<"hook">;
1022
- hook: z.ZodObject<{
1023
- at: z.ZodEnum<{
1024
- after: "after";
1025
- before: "before";
1026
- }>;
1027
- scope: z.ZodEnum<{
1028
- step: "step";
1029
- turn: "turn";
1030
- }>;
1031
- capabilityIds: z.ZodArray<z.ZodString>;
1032
- }, z.core.$strict>;
1033
- }, z.core.$strict>, z.ZodObject<{
1034
- actionId: z.ZodString;
1035
- sessionId: z.ZodString;
1036
- turnId: z.ZodString;
1037
- agentId: z.ZodString;
1038
- manifestHash: z.ZodString;
1039
- implementationVersion: z.ZodString;
1040
- input: z.ZodUnknown;
1041
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1042
- status: z.ZodEnum<{
1043
- cancelled: "cancelled";
1044
- completed: "completed";
1045
- delivering: "delivering";
1046
- pending: "pending";
1047
- uncertain: "uncertain";
1048
- }>;
1049
- generation: z.ZodNumber;
1050
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1051
- agent: z.ZodOptional<z.ZodObject<{
1052
- id: z.ZodString;
1053
- path: z.ZodString;
1054
- delegationId: z.ZodOptional<z.ZodString>;
1055
- }, z.core.$strict>>;
1056
- kind: z.ZodLiteral<"fn">;
1057
- path: z.ZodString;
1058
- key: z.ZodString;
1059
- }, z.core.$strict>, z.ZodObject<{
1060
- actionId: z.ZodString;
1061
- sessionId: z.ZodString;
1062
- turnId: z.ZodString;
1063
- agentId: z.ZodString;
1064
- manifestHash: z.ZodString;
1065
- implementationVersion: z.ZodString;
1066
- input: z.ZodUnknown;
1067
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1068
- status: z.ZodEnum<{
1069
- cancelled: "cancelled";
1070
- completed: "completed";
1071
- delivering: "delivering";
1072
- pending: "pending";
1073
- uncertain: "uncertain";
1074
- }>;
1075
- generation: z.ZodNumber;
1076
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1077
- agent: z.ZodOptional<z.ZodObject<{
1078
- id: z.ZodString;
1079
- path: z.ZodString;
1080
- delegationId: z.ZodOptional<z.ZodString>;
1081
- }, z.core.$strict>>;
1082
- kind: z.ZodLiteral<"verify">;
1083
- path: z.ZodString;
1084
- key: z.ZodString;
1085
- }, z.core.$strict>]>;
1086
- export type Action = z.infer<typeof ActionSchema>;
1087
942
  /**
1088
943
  * `message.assistant`: one completed model step. `invocationId` is the model call's.
1089
944
  * `model`, `finishReason` and `usage` are present when the provider reported them.
@@ -1141,7 +996,7 @@ export declare const ContextCompactedPayloadSchema: z.ZodObject<{
1141
996
  tokensBefore: z.ZodNumber;
1142
997
  tokensAfter: z.ZodNumber;
1143
998
  }, z.core.$loose>;
1144
- /** `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. */
1145
1000
  export declare const ToolCompletedPayloadSchema: z.ZodObject<{
1146
1001
  agent: z.ZodOptional<z.ZodObject<{
1147
1002
  id: z.ZodString;
@@ -1158,44 +1013,6 @@ export declare const ToolCompletedPayloadSchema: z.ZodObject<{
1158
1013
  message: z.ZodString;
1159
1014
  }, z.core.$loose>>;
1160
1015
  }, z.core.$loose>;
1161
- export declare const ActionPendingPayloadSchema: z.ZodObject<{
1162
- agent: z.ZodOptional<z.ZodObject<{
1163
- id: z.ZodString;
1164
- path: z.ZodString;
1165
- delegationId: z.ZodOptional<z.ZodString>;
1166
- }, z.core.$loose>>;
1167
- actionId: z.ZodString;
1168
- kind: z.ZodString;
1169
- toolName: z.ZodOptional<z.ZodString>;
1170
- path: z.ZodOptional<z.ZodString>;
1171
- key: z.ZodOptional<z.ZodString>;
1172
- callId: z.ZodOptional<z.ZodString>;
1173
- invocationId: z.ZodOptional<z.ZodString>;
1174
- input: z.ZodUnknown;
1175
- }, z.core.$loose>;
1176
- export declare const ActionCompletedPayloadSchema: z.ZodObject<{
1177
- agent: z.ZodOptional<z.ZodObject<{
1178
- id: z.ZodString;
1179
- path: z.ZodString;
1180
- delegationId: z.ZodOptional<z.ZodString>;
1181
- }, z.core.$loose>>;
1182
- actionId: z.ZodString;
1183
- kind: z.ZodString;
1184
- toolName: z.ZodOptional<z.ZodString>;
1185
- path: z.ZodOptional<z.ZodString>;
1186
- key: z.ZodOptional<z.ZodString>;
1187
- callId: z.ZodOptional<z.ZodString>;
1188
- invocationId: z.ZodOptional<z.ZodString>;
1189
- result: z.ZodUnknown;
1190
- }, z.core.$loose>;
1191
- export declare const ActionUncertainPayloadSchema: z.ZodObject<{
1192
- agent: z.ZodOptional<z.ZodObject<{
1193
- id: z.ZodString;
1194
- path: z.ZodString;
1195
- delegationId: z.ZodOptional<z.ZodString>;
1196
- }, z.core.$loose>>;
1197
- actionId: z.ZodString;
1198
- }, z.core.$loose>;
1199
1016
  export declare const EffectUncertainPayloadSchema: z.ZodObject<{
1200
1017
  effectId: z.ZodString;
1201
1018
  message: z.ZodOptional<z.ZodString>;
@@ -1206,6 +1023,7 @@ export declare const TurnCompletedPayloadSchema: z.ZodObject<{
1206
1023
  export declare const TurnPausedPayloadSchema: z.ZodObject<{
1207
1024
  interactions: z.ZodArray<z.ZodObject<{
1208
1025
  invocationId: z.ZodString;
1026
+ callId: z.ZodOptional<z.ZodString>;
1209
1027
  interaction: z.ZodObject<{
1210
1028
  id: z.ZodString;
1211
1029
  kind: z.ZodString;
@@ -1295,44 +1113,6 @@ declare const TRANSCRIPT_PAYLOADS: {
1295
1113
  message: z.ZodString;
1296
1114
  }, z.core.$loose>>;
1297
1115
  }, z.core.$loose>;
1298
- readonly "action.pending": z.ZodObject<{
1299
- agent: z.ZodOptional<z.ZodObject<{
1300
- id: z.ZodString;
1301
- path: z.ZodString;
1302
- delegationId: z.ZodOptional<z.ZodString>;
1303
- }, z.core.$loose>>;
1304
- actionId: z.ZodString;
1305
- kind: z.ZodString;
1306
- toolName: z.ZodOptional<z.ZodString>;
1307
- path: z.ZodOptional<z.ZodString>;
1308
- key: z.ZodOptional<z.ZodString>;
1309
- callId: z.ZodOptional<z.ZodString>;
1310
- invocationId: z.ZodOptional<z.ZodString>;
1311
- input: z.ZodUnknown;
1312
- }, z.core.$loose>;
1313
- readonly "action.completed": z.ZodObject<{
1314
- agent: z.ZodOptional<z.ZodObject<{
1315
- id: z.ZodString;
1316
- path: z.ZodString;
1317
- delegationId: z.ZodOptional<z.ZodString>;
1318
- }, z.core.$loose>>;
1319
- actionId: z.ZodString;
1320
- kind: z.ZodString;
1321
- toolName: z.ZodOptional<z.ZodString>;
1322
- path: z.ZodOptional<z.ZodString>;
1323
- key: z.ZodOptional<z.ZodString>;
1324
- callId: z.ZodOptional<z.ZodString>;
1325
- invocationId: z.ZodOptional<z.ZodString>;
1326
- result: z.ZodUnknown;
1327
- }, z.core.$loose>;
1328
- readonly "action.uncertain": z.ZodObject<{
1329
- agent: z.ZodOptional<z.ZodObject<{
1330
- id: z.ZodString;
1331
- path: z.ZodString;
1332
- delegationId: z.ZodOptional<z.ZodString>;
1333
- }, z.core.$loose>>;
1334
- actionId: z.ZodString;
1335
- }, z.core.$loose>;
1336
1116
  readonly "effect.uncertain": z.ZodObject<{
1337
1117
  effectId: z.ZodString;
1338
1118
  message: z.ZodOptional<z.ZodString>;
@@ -1343,6 +1123,7 @@ declare const TRANSCRIPT_PAYLOADS: {
1343
1123
  readonly "turn.paused": z.ZodObject<{
1344
1124
  interactions: z.ZodArray<z.ZodObject<{
1345
1125
  invocationId: z.ZodString;
1126
+ callId: z.ZodOptional<z.ZodString>;
1346
1127
  interaction: z.ZodObject<{
1347
1128
  id: z.ZodString;
1348
1129
  kind: z.ZodString;
@@ -1412,24 +1193,6 @@ export declare const CommandRespondPayloadSchema: z.ZodObject<{
1412
1193
  interactionId: z.ZodString;
1413
1194
  value: z.ZodUnknown;
1414
1195
  }, z.core.$loose>;
1415
- /** `action.delivered`: the Runtime sent an Action to its endpoint. */
1416
- export declare const ActionDeliveredPayloadSchema: z.ZodObject<{
1417
- agent: z.ZodOptional<z.ZodObject<{
1418
- id: z.ZodString;
1419
- path: z.ZodString;
1420
- delegationId: z.ZodOptional<z.ZodString>;
1421
- }, z.core.$loose>>;
1422
- actionId: z.ZodString;
1423
- generation: z.ZodNumber;
1424
- }, z.core.$loose>;
1425
- /** `action.delivery_failed`: a delivery did not reach its endpoint, or was refused; it is retried. */
1426
- export declare const ActionDeliveryFailedPayloadSchema: z.ZodObject<{
1427
- actionId: z.ZodString;
1428
- generation: z.ZodNumber;
1429
- reason: z.ZodString;
1430
- message: z.ZodOptional<z.ZodString>;
1431
- retryInMs: z.ZodNumber;
1432
- }, z.core.$loose>;
1433
1196
  /** `sandbox.state`: the session's sandbox changed state. */
1434
1197
  export declare const SandboxStatePayloadSchema: z.ZodObject<{
1435
1198
  state: z.ZodEnum<{
@@ -1461,7 +1224,7 @@ export declare const SandboxExecPayloadSchema: z.ZodObject<{
1461
1224
  code: z.ZodOptional<z.ZodString>;
1462
1225
  durationMs: z.ZodNumber;
1463
1226
  }, z.core.$loose>;
1464
- /** `node.started`: a workflow node that runs an Action started. */
1227
+ /** `node.started`: a workflow tool node started. */
1465
1228
  export declare const NodeStartedPayloadSchema: z.ZodObject<{
1466
1229
  path: z.ZodString;
1467
1230
  kind: z.ZodString;
@@ -1491,16 +1254,6 @@ export declare const LoopVerifiedPayloadSchema: z.ZodObject<{
1491
1254
  feedback: z.ZodOptional<z.ZodString>;
1492
1255
  data: z.ZodOptional<z.ZodUnknown>;
1493
1256
  }, z.core.$loose>;
1494
- /** `loop.decided`: a Loop's decide step chose to iterate again (`input`) or finish (`output`). */
1495
- export declare const LoopDecidedPayloadSchema: z.ZodObject<{
1496
- path: z.ZodString;
1497
- n: z.ZodNumber;
1498
- next: z.ZodEnum<{
1499
- input: "input";
1500
- output: "output";
1501
- }>;
1502
- patched: z.ZodBoolean;
1503
- }, z.core.$loose>;
1504
1257
  /**
1505
1258
  * `transcript.updated` (internal; blueprint P0.3): the own loop's model-facing transcript after a
1506
1259
  * settled segment, as an edit of the previous one: keep its first `keep` entries, then append
@@ -1596,6 +1349,41 @@ export declare const ArtifactExportFailedPayloadSchema: z.ZodObject<{
1596
1349
  name: z.ZodString;
1597
1350
  message: z.ZodString;
1598
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>;
1599
1387
  /**
1600
1388
  * The event catalog (Durable Streams §9.5): every session event type, its payload schema, its
1601
1389
  * payload schema version and who writes it. A type not listed here cannot be written. A type
@@ -1660,6 +1448,7 @@ export declare const EVENT_CATALOG: {
1660
1448
  readonly payload: z.ZodObject<{
1661
1449
  interactions: z.ZodArray<z.ZodObject<{
1662
1450
  invocationId: z.ZodString;
1451
+ callId: z.ZodOptional<z.ZodString>;
1663
1452
  interaction: z.ZodObject<{
1664
1453
  id: z.ZodString;
1665
1454
  kind: z.ZodString;
@@ -1765,80 +1554,6 @@ export declare const EVENT_CATALOG: {
1765
1554
  readonly source: "loop";
1766
1555
  readonly version: 1;
1767
1556
  };
1768
- readonly "action.pending": {
1769
- readonly payload: z.ZodObject<{
1770
- agent: z.ZodOptional<z.ZodObject<{
1771
- id: z.ZodString;
1772
- path: z.ZodString;
1773
- delegationId: z.ZodOptional<z.ZodString>;
1774
- }, z.core.$loose>>;
1775
- actionId: z.ZodString;
1776
- kind: z.ZodString;
1777
- toolName: z.ZodOptional<z.ZodString>;
1778
- path: z.ZodOptional<z.ZodString>;
1779
- key: z.ZodOptional<z.ZodString>;
1780
- callId: z.ZodOptional<z.ZodString>;
1781
- invocationId: z.ZodOptional<z.ZodString>;
1782
- input: z.ZodUnknown;
1783
- }, z.core.$loose>;
1784
- readonly source: "loop";
1785
- readonly version: 1;
1786
- };
1787
- readonly "action.delivered": {
1788
- readonly payload: z.ZodObject<{
1789
- agent: z.ZodOptional<z.ZodObject<{
1790
- id: z.ZodString;
1791
- path: z.ZodString;
1792
- delegationId: z.ZodOptional<z.ZodString>;
1793
- }, z.core.$loose>>;
1794
- actionId: z.ZodString;
1795
- generation: z.ZodNumber;
1796
- }, z.core.$loose>;
1797
- readonly source: "loop";
1798
- readonly version: 1;
1799
- };
1800
- readonly "action.delivery_failed": {
1801
- readonly payload: z.ZodObject<{
1802
- actionId: z.ZodString;
1803
- generation: z.ZodNumber;
1804
- reason: z.ZodString;
1805
- message: z.ZodOptional<z.ZodString>;
1806
- retryInMs: z.ZodNumber;
1807
- }, z.core.$loose>;
1808
- readonly source: "loop";
1809
- readonly version: 1;
1810
- };
1811
- readonly "action.completed": {
1812
- readonly payload: z.ZodObject<{
1813
- agent: z.ZodOptional<z.ZodObject<{
1814
- id: z.ZodString;
1815
- path: z.ZodString;
1816
- delegationId: z.ZodOptional<z.ZodString>;
1817
- }, z.core.$loose>>;
1818
- actionId: z.ZodString;
1819
- kind: z.ZodString;
1820
- toolName: z.ZodOptional<z.ZodString>;
1821
- path: z.ZodOptional<z.ZodString>;
1822
- key: z.ZodOptional<z.ZodString>;
1823
- callId: z.ZodOptional<z.ZodString>;
1824
- invocationId: z.ZodOptional<z.ZodString>;
1825
- result: z.ZodUnknown;
1826
- }, z.core.$loose>;
1827
- readonly source: "api";
1828
- readonly version: 1;
1829
- };
1830
- readonly "action.uncertain": {
1831
- readonly payload: z.ZodObject<{
1832
- agent: z.ZodOptional<z.ZodObject<{
1833
- id: z.ZodString;
1834
- path: z.ZodString;
1835
- delegationId: z.ZodOptional<z.ZodString>;
1836
- }, z.core.$loose>>;
1837
- actionId: z.ZodString;
1838
- }, z.core.$loose>;
1839
- readonly source: "loop";
1840
- readonly version: 1;
1841
- };
1842
1557
  readonly "effect.uncertain": {
1843
1558
  readonly payload: z.ZodObject<{
1844
1559
  effectId: z.ZodString;
@@ -1871,6 +1586,25 @@ export declare const EVENT_CATALOG: {
1871
1586
  readonly source: "loop";
1872
1587
  readonly version: 1;
1873
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
+ };
1874
1608
  readonly "sandbox.state": {
1875
1609
  readonly payload: z.ZodObject<{
1876
1610
  state: z.ZodEnum<{
@@ -1950,19 +1684,6 @@ export declare const EVENT_CATALOG: {
1950
1684
  readonly source: "api";
1951
1685
  readonly version: 1;
1952
1686
  };
1953
- readonly "loop.decided": {
1954
- readonly payload: z.ZodObject<{
1955
- path: z.ZodString;
1956
- n: z.ZodNumber;
1957
- next: z.ZodEnum<{
1958
- input: "input";
1959
- output: "output";
1960
- }>;
1961
- patched: z.ZodBoolean;
1962
- }, z.core.$loose>;
1963
- readonly source: "api";
1964
- readonly version: 1;
1965
- };
1966
1687
  readonly "artifact.created": {
1967
1688
  readonly payload: z.ZodObject<{
1968
1689
  artifactId: z.ZodString;
@@ -2073,7 +1794,7 @@ type EventSchemaOf<T extends EventType> = z.ZodObject<typeof eventEnvelope & {
2073
1794
  /** One schema per event type, keyed by type (the OpenAPI components). */
2074
1795
  export declare const EVENT_SCHEMAS: { [T in EventType]: EventSchemaOf<T>; };
2075
1796
  /** A session event of a known type, discriminated on `type`. */
2076
- 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">;
2077
1798
  export type SessionEvent = {
2078
1799
  [T in EventType]: z.infer<EventSchemaOf<T>>;
2079
1800
  }[EventType];
@@ -2088,7 +1809,7 @@ export type SessionEventOf<T extends EventType> = Extract<SessionEvent, {
2088
1809
  */
2089
1810
  export declare function parseSessionEvent(value: unknown): SessionEvent | LiveEvent;
2090
1811
  export declare const SessionItemsResponseSchema: z.ZodObject<{
2091
- 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">>;
2092
1813
  cursor: z.ZodNullable<z.ZodString>;
2093
1814
  }, z.core.$strip>;
2094
1815
  export type SessionItemsResponse = {
@@ -2123,11 +1844,18 @@ export declare const ReadyResponseSchema: z.ZodObject<{
2123
1844
  }>;
2124
1845
  service: z.ZodString;
2125
1846
  checks: z.ZodRecord<z.ZodString, z.ZodBoolean>;
2126
- }, z.core.$strip>;
2127
- export type HealthResponse = z.infer<typeof HealthResponseSchema>;
2128
- export type ReadyResponse = z.infer<typeof ReadyResponseSchema>;
2129
- export declare const ProtocolRejectedResponseSchema: z.ZodObject<{
2130
- status: z.ZodLiteral<"rejected">;
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>>;
1854
+ }, z.core.$strip>;
1855
+ export type HealthResponse = z.infer<typeof HealthResponseSchema>;
1856
+ export type ReadyResponse = z.infer<typeof ReadyResponseSchema>;
1857
+ export declare const ProtocolRejectedResponseSchema: z.ZodObject<{
1858
+ status: z.ZodLiteral<"rejected">;
2131
1859
  code: z.ZodLiteral<"protocol_unsupported">;
2132
1860
  protocol: z.ZodObject<{
2133
1861
  min: z.ZodNumber;
@@ -2166,8 +1894,8 @@ export declare const TenantCauseSchema: z.ZodObject<{
2166
1894
  }, z.core.$strict>;
2167
1895
  export type TenantCause = z.infer<typeof TenantCauseSchema>;
2168
1896
  /**
2169
- * The Host's one Tenant, as `/v1/admin/status` reports it. `unavailable` while it opens, when
2170
- * 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.
2171
1899
  */
2172
1900
  export declare const HostTenantSchema: z.ZodObject<{
2173
1901
  id: z.ZodNullable<z.ZodString>;
@@ -2224,162 +1952,40 @@ export declare const HarnessStatusSchema: z.ZodObject<{
2224
1952
  workspace: z.ZodBoolean;
2225
1953
  }, z.core.$strict>;
2226
1954
  export type HarnessStatus = z.infer<typeof HarnessStatusSchema>;
2227
- export declare const HostAggregateSchema: z.ZodObject<{
2228
- runningSessions: z.ZodNumber;
2229
- inFlightDeliveries: z.ZodNumber;
2230
- pendingActions: z.ZodNumber;
2231
- uncertainEffects: z.ZodNumber;
2232
- relay: z.ZodOptional<z.ZodObject<{
2233
- active: z.ZodBoolean;
2234
- pendingTxs: z.ZodNumber;
2235
- pendingRows: z.ZodNumber;
2236
- confirmed: z.ZodNullable<z.ZodString>;
2237
- reconciliations: z.ZodNumber;
2238
- lastError: z.ZodNullable<z.ZodString>;
2239
- lagBytes: z.ZodOptional<z.ZodNumber>;
2240
- }, z.core.$strict>>;
2241
- harness: z.ZodOptional<z.ZodObject<{
2242
- mode: z.ZodEnum<{
2243
- "in-process": "in-process";
2244
- remote: "remote";
2245
- }>;
2246
- connected: z.ZodNumber;
2247
- workspace: z.ZodBoolean;
1955
+ /**
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.
1958
+ */
1959
+ export declare const OperatorKeySchema: z.ZodObject<{
1960
+ id: z.ZodString;
1961
+ role: z.ZodString;
1962
+ createdAt: z.ZodString;
1963
+ }, z.core.$strict>;
1964
+ export type OperatorKey = z.infer<typeof OperatorKeySchema>;
1965
+ /** `GET /v1/tenant/keys`: the Tenant's keys, by id. */
1966
+ export declare const ListOperatorKeysResponseSchema: z.ZodObject<{
1967
+ keys: z.ZodArray<z.ZodObject<{
1968
+ id: z.ZodString;
1969
+ role: z.ZodString;
1970
+ createdAt: z.ZodString;
2248
1971
  }, z.core.$strict>>;
2249
1972
  }, z.core.$strict>;
2250
- export type HostAggregate = z.infer<typeof HostAggregateSchema>;
2251
- export declare const AdminHostStatusSchema: z.ZodObject<{
2252
- hostId: z.ZodString;
2253
- url: z.ZodString;
2254
- pid: z.ZodNumber;
2255
- version: z.ZodString;
2256
- protocol: z.ZodObject<{
2257
- min: z.ZodNumber;
2258
- max: z.ZodNumber;
2259
- features: z.ZodArray<z.ZodString>;
2260
- }, z.core.$strict>;
2261
- tenant: z.ZodObject<{
2262
- id: z.ZodNullable<z.ZodString>;
2263
- name: z.ZodNullable<z.ZodString>;
2264
- state: z.ZodEnum<{
2265
- open: "open";
2266
- unavailable: "unavailable";
2267
- }>;
2268
- envelope: z.ZodNullable<z.ZodObject<{
2269
- id: z.ZodString;
2270
- name: z.ZodString;
2271
- createdAt: z.ZodString;
2272
- updatedAt: z.ZodString;
2273
- schemaVersion: z.ZodNumber;
2274
- }, z.core.$strict>>;
2275
- cause: z.ZodOptional<z.ZodObject<{
2276
- code: z.ZodEnum<{
2277
- corrupt: "corrupt";
2278
- "database-layout-old": "database-layout-old";
2279
- "envelope-invalid": "envelope-invalid";
2280
- "kek-missing": "kek-missing";
2281
- "migration-failed": "migration-failed";
2282
- "open-failed": "open-failed";
2283
- "open-timeout": "open-timeout";
2284
- "schema-too-new": "schema-too-new";
2285
- }>;
2286
- message: z.ZodString;
2287
- repair: z.ZodString;
2288
- }, z.core.$strict>>;
2289
- }, z.core.$strict>;
2290
- aggregate: z.ZodObject<{
2291
- runningSessions: z.ZodNumber;
2292
- inFlightDeliveries: z.ZodNumber;
2293
- pendingActions: z.ZodNumber;
2294
- uncertainEffects: z.ZodNumber;
2295
- relay: z.ZodOptional<z.ZodObject<{
2296
- active: z.ZodBoolean;
2297
- pendingTxs: z.ZodNumber;
2298
- pendingRows: z.ZodNumber;
2299
- confirmed: z.ZodNullable<z.ZodString>;
2300
- reconciliations: z.ZodNumber;
2301
- lastError: z.ZodNullable<z.ZodString>;
2302
- lagBytes: z.ZodOptional<z.ZodNumber>;
2303
- }, z.core.$strict>>;
2304
- harness: z.ZodOptional<z.ZodObject<{
2305
- mode: z.ZodEnum<{
2306
- "in-process": "in-process";
2307
- remote: "remote";
2308
- }>;
2309
- connected: z.ZodNumber;
2310
- workspace: z.ZodBoolean;
2311
- }, z.core.$strict>>;
2312
- }, z.core.$strict>;
1973
+ export type ListOperatorKeysResponse = z.infer<typeof ListOperatorKeysResponseSchema>;
1974
+ /** `PUT /v1/tenant/keys/{keyId}`: the new key, shown this once; `rotated` when it replaced one. */
1975
+ export declare const PutOperatorKeyResponseSchema: z.ZodObject<{
1976
+ id: z.ZodString;
1977
+ role: z.ZodString;
1978
+ createdAt: z.ZodString;
1979
+ key: z.ZodString;
1980
+ rotated: z.ZodBoolean;
2313
1981
  }, z.core.$strict>;
2314
- export type AdminHostStatus = z.infer<typeof AdminHostStatusSchema>;
2315
- /** Shared Admin API status (D§4.1). OSS fills `host`; Cloud omits it. */
2316
- export declare const AdminStatusSchema: z.ZodObject<{
2317
- service: z.ZodString;
2318
- version: z.ZodString;
2319
- protocol: z.ZodObject<{
2320
- min: z.ZodNumber;
2321
- max: z.ZodNumber;
2322
- features: z.ZodArray<z.ZodString>;
2323
- }, z.core.$strict>;
2324
- tenant: z.ZodObject<{
2325
- id: z.ZodNullable<z.ZodString>;
2326
- name: z.ZodNullable<z.ZodString>;
2327
- state: z.ZodEnum<{
2328
- open: "open";
2329
- unavailable: "unavailable";
2330
- }>;
2331
- envelope: z.ZodNullable<z.ZodObject<{
2332
- id: z.ZodString;
2333
- name: z.ZodString;
2334
- createdAt: z.ZodString;
2335
- updatedAt: z.ZodString;
2336
- schemaVersion: z.ZodNumber;
2337
- }, z.core.$strict>>;
2338
- cause: z.ZodOptional<z.ZodObject<{
2339
- code: z.ZodEnum<{
2340
- corrupt: "corrupt";
2341
- "database-layout-old": "database-layout-old";
2342
- "envelope-invalid": "envelope-invalid";
2343
- "kek-missing": "kek-missing";
2344
- "migration-failed": "migration-failed";
2345
- "open-failed": "open-failed";
2346
- "open-timeout": "open-timeout";
2347
- "schema-too-new": "schema-too-new";
2348
- }>;
2349
- message: z.ZodString;
2350
- repair: z.ZodString;
2351
- }, z.core.$strict>>;
2352
- }, z.core.$strict>;
2353
- aggregate: z.ZodObject<{
2354
- runningSessions: z.ZodNumber;
2355
- inFlightDeliveries: z.ZodNumber;
2356
- pendingActions: z.ZodNumber;
2357
- uncertainEffects: z.ZodNumber;
2358
- relay: z.ZodOptional<z.ZodObject<{
2359
- active: z.ZodBoolean;
2360
- pendingTxs: z.ZodNumber;
2361
- pendingRows: z.ZodNumber;
2362
- confirmed: z.ZodNullable<z.ZodString>;
2363
- reconciliations: z.ZodNumber;
2364
- lastError: z.ZodNullable<z.ZodString>;
2365
- lagBytes: z.ZodOptional<z.ZodNumber>;
2366
- }, z.core.$strict>>;
2367
- harness: z.ZodOptional<z.ZodObject<{
2368
- mode: z.ZodEnum<{
2369
- "in-process": "in-process";
2370
- remote: "remote";
2371
- }>;
2372
- connected: z.ZodNumber;
2373
- workspace: z.ZodBoolean;
2374
- }, z.core.$strict>>;
2375
- }, z.core.$strict>;
2376
- host: z.ZodOptional<z.ZodObject<{
2377
- hostId: z.ZodString;
2378
- url: z.ZodString;
2379
- pid: z.ZodNumber;
2380
- }, z.core.$strict>>;
1982
+ export type PutOperatorKeyResponse = z.infer<typeof PutOperatorKeyResponseSchema>;
1983
+ /** `DELETE /v1/tenant/keys/{keyId}`: the key no longer authenticates. */
1984
+ export declare const DeleteOperatorKeyResponseSchema: z.ZodObject<{
1985
+ id: z.ZodString;
1986
+ deleted: z.ZodLiteral<true>;
2381
1987
  }, z.core.$strict>;
2382
- export type AdminStatus = z.infer<typeof AdminStatusSchema>;
1988
+ export type DeleteOperatorKeyResponse = z.infer<typeof DeleteOperatorKeyResponseSchema>;
2383
1989
  /**
2384
1990
  * `.nylorun/link.json`: the installation a Project uses. Format 3 names the local `tenant`
2385
1991
  * that `nylorun start` created or attached; `tenantId` is information only, since nothing in a
@@ -2394,10 +2000,16 @@ export declare const ProjectLinkFileSchema: z.ZodObject<{
2394
2000
  tenantId: z.ZodOptional<z.ZodString>;
2395
2001
  }, z.core.$loose>;
2396
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
+ */
2397
2007
  export declare const ProjectCredentialsFileSchema: z.ZodObject<{
2398
2008
  format: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>>;
2399
2009
  applicationKey: z.ZodString;
2400
2010
  principalId: z.ZodString;
2011
+ managementKey: z.ZodOptional<z.ZodString>;
2012
+ managementPrincipalId: z.ZodOptional<z.ZodString>;
2401
2013
  }, z.core.$loose>;
2402
2014
  export type ProjectCredentialsFile = z.infer<typeof ProjectCredentialsFileSchema>;
2403
2015
  export declare const HostModelViewSchema: z.ZodUnion<readonly [z.ZodObject<{
@@ -2431,7 +2043,6 @@ export declare const TenantStatusSchema: z.ZodObject<{
2431
2043
  store: z.ZodBoolean;
2432
2044
  scheduler: z.ZodBoolean;
2433
2045
  model: z.ZodBoolean;
2434
- endpoints: z.ZodBoolean;
2435
2046
  schema: z.ZodBoolean;
2436
2047
  }, z.core.$strict>;
2437
2048
  model: z.ZodUnion<readonly [z.ZodObject<{
@@ -2454,13 +2065,10 @@ export declare const TenantStatusSchema: z.ZodObject<{
2454
2065
  }, z.core.$strict>]>;
2455
2066
  agents: z.ZodArray<z.ZodObject<{
2456
2067
  agentId: z.ZodString;
2457
- registered: z.ZodBoolean;
2458
- endpoint: z.ZodBoolean;
2459
2068
  }, z.core.$strict>>;
2460
2069
  counts: z.ZodObject<{
2461
2070
  sessions: z.ZodNumber;
2462
2071
  runningSessions: z.ZodNumber;
2463
- pendingActions: z.ZodNumber;
2464
2072
  uncertainEffects: z.ZodNumber;
2465
2073
  }, z.core.$strict>;
2466
2074
  sandbox: z.ZodObject<{
@@ -2599,11 +2207,12 @@ export declare const ResetTenantRequestSchema: z.ZodObject<{
2599
2207
  export type ResetTenantRequest = z.infer<typeof ResetTenantRequestSchema>;
2600
2208
  /**
2601
2209
  * Acting for a subject (Host feature `subject-headers`): what an application principal may
2602
- * narrow a request to. `sessions:own` and `vaults:own` reach only the subject's own sessions
2603
- * and vaults; the others reach Tenant-wide resources. `sandboxes:write` creates and deletes
2604
- * sandboxes (Host feature `sandboxes`); a subject token's reach only the ids its `sbx` grants.
2210
+ * narrow a request to. `sessions:own` reaches only the subject's own sessions; the others reach
2211
+ * Tenant-wide resources. `sandboxes:write` creates and deletes sandboxes (Host feature
2212
+ * `sandboxes`); a token caller's reach only the ids its sandbox grants name. Vaults are the
2213
+ * installation's, managed with management keys on the Management API (protocol 8).
2605
2214
  */
2606
- export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "vaults:own", "tenant:settings", "sandboxes:write"];
2215
+ export declare const SUBJECT_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "sandboxes:write"];
2607
2216
  export type SubjectScope = (typeof SUBJECT_SCOPES)[number];
2608
2217
  /** A valid subject: 1–200 visible ASCII characters, not reserved by the Runtime. */
2609
2218
  export declare function isSubject(value: unknown): value is string;
@@ -2619,130 +2228,23 @@ export declare function parseSubjectHeaders(subject: string, scopes: string | un
2619
2228
  ok: false;
2620
2229
  message: string;
2621
2230
  };
2622
- /** Scopes a subject token may carry: never `agents:write` or `tenant:settings`. */
2623
- export declare const TOKEN_SCOPES: readonly ["agents:read", "sessions:own", "vaults:own", "sandboxes:write"];
2624
- /** The most `sandboxes` grants one subject token carries (it is capped at 4 KiB). */
2231
+ /**
2232
+ * Scopes a token caller (a trusted issuer's token) may carry: never `agents:write`.
2233
+ */
2234
+ export declare const TOKEN_SCOPES: readonly ["agents:read", "sessions:own", "sandboxes:write"];
2235
+ /** The most sandbox grants one token caller carries. */
2625
2236
  export declare const TOKEN_SANDBOX_GRANTS_MAX = 16;
2626
2237
  export type TokenScope = (typeof TOKEN_SCOPES)[number];
2627
- /** The JWT `typ` of a subject token (RFC 8725 explicit typing). */
2628
- export declare const SUBJECT_TOKEN_TYPE = "nylorun-subject+jwt";
2629
- /** The `aud` of every subject token. */
2630
- export declare const SUBJECT_TOKEN_AUDIENCE = "nylorun";
2631
- /** The `iss` of a Tenant's subject tokens. */
2632
- export declare function subjectTokenIssuer(tenantId: string): string;
2633
- /** Token lifetimes, in seconds. */
2634
- export declare const TOKEN_TTL_MIN_SECONDS = 60;
2238
+ /**
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.
2241
+ */
2635
2242
  export declare const TOKEN_TTL_MAX_SECONDS = 900;
2636
- export declare const TOKEN_TTL_DEFAULT_SECONDS = 600;
2637
- /** A role's name in the access policy; `anon` is reserved for publishable keys. */
2638
- export declare const ROLE_NAME_PATTERN: RegExp;
2639
- export declare const RoleLimitsSchema: z.ZodObject<{
2640
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
2641
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
2642
- }, z.core.$strict>;
2643
- export type RoleLimits = z.infer<typeof RoleLimitsSchema>;
2644
- export declare const AccessRoleSchema: z.ZodObject<{
2645
- scopes: z.ZodArray<z.ZodEnum<{
2646
- "agents:read": "agents:read";
2647
- "sandboxes:write": "sandboxes:write";
2648
- "sessions:own": "sessions:own";
2649
- "vaults:own": "vaults:own";
2650
- }>>;
2651
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2652
- limits: z.ZodOptional<z.ZodObject<{
2653
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
2654
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
2655
- }, z.core.$strict>>;
2656
- }, z.core.$strict>;
2657
- export type AccessRole = z.infer<typeof AccessRoleSchema>;
2658
2243
  /**
2659
- * The Tenant's access policy: what each role may do with a subject token, what a publishable
2660
- * key grants alone (`anon`), and how long tokens live. Without roles nothing can be minted.
2244
+ * The `iss` of every token a Tenant's Runtime signs itself: capability links, run, host and
2245
+ * egress tokens.
2661
2246
  */
2662
- export declare const AccessPolicySchema: z.ZodObject<{
2663
- version: z.ZodLiteral<1>;
2664
- roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2665
- scopes: z.ZodArray<z.ZodEnum<{
2666
- "agents:read": "agents:read";
2667
- "sandboxes:write": "sandboxes:write";
2668
- "sessions:own": "sessions:own";
2669
- "vaults:own": "vaults:own";
2670
- }>>;
2671
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2672
- limits: z.ZodOptional<z.ZodObject<{
2673
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
2674
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
2675
- }, z.core.$strict>>;
2676
- }, z.core.$strict>>;
2677
- anon: z.ZodObject<{
2678
- scopes: z.ZodArray<z.ZodLiteral<"agents:read">>;
2679
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2680
- }, z.core.$strict>;
2681
- tokens: z.ZodObject<{
2682
- maxTtlSeconds: z.ZodNumber;
2683
- }, z.core.$strict>;
2684
- }, z.core.$strict>;
2685
- export type AccessPolicy = z.infer<typeof AccessPolicySchema>;
2686
- /** The policy of a Tenant that never set one: no roles, nothing for `anon`. */
2687
- export declare const DEFAULT_ACCESS_POLICY: AccessPolicy;
2688
- export declare const PutAccessPolicyRequestSchema: z.ZodObject<{
2689
- requestId: z.ZodString;
2690
- policy: z.ZodObject<{
2691
- version: z.ZodLiteral<1>;
2692
- roles: z.ZodRecord<z.ZodString, z.ZodObject<{
2693
- scopes: z.ZodArray<z.ZodEnum<{
2694
- "agents:read": "agents:read";
2695
- "sandboxes:write": "sandboxes:write";
2696
- "sessions:own": "sessions:own";
2697
- "vaults:own": "vaults:own";
2698
- }>>;
2699
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2700
- limits: z.ZodOptional<z.ZodObject<{
2701
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
2702
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
2703
- }, z.core.$strict>>;
2704
- }, z.core.$strict>>;
2705
- anon: z.ZodObject<{
2706
- scopes: z.ZodArray<z.ZodLiteral<"agents:read">>;
2707
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2708
- }, z.core.$strict>;
2709
- tokens: z.ZodObject<{
2710
- maxTtlSeconds: z.ZodNumber;
2711
- }, z.core.$strict>;
2712
- }, z.core.$strict>;
2713
- }, z.core.$strict>;
2714
- export type PutAccessPolicyRequest = z.infer<typeof PutAccessPolicyRequestSchema>;
2715
- export declare const CreateTokenRequestSchema: z.ZodObject<{
2716
- requestId: z.ZodString;
2717
- subject: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
2718
- role: z.ZodString;
2719
- scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2720
- "agents:read": "agents:read";
2721
- "sandboxes:write": "sandboxes:write";
2722
- "sessions:own": "sessions:own";
2723
- "vaults:own": "vaults:own";
2724
- }>>>;
2725
- agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
2726
- sandboxes: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>>;
2727
- ttlSeconds: z.ZodOptional<z.ZodNumber>;
2728
- }, z.core.$strict>;
2729
- export type CreateTokenRequest = z.infer<typeof CreateTokenRequestSchema>;
2730
- export declare const CreateTokenResponseSchema: z.ZodObject<{
2731
- token: z.ZodString;
2732
- expiresAt: z.ZodString;
2733
- subject: z.ZodString;
2734
- role: z.ZodString;
2735
- scopes: z.ZodArray<z.ZodEnum<{
2736
- "agents:read": "agents:read";
2737
- "sandboxes:write": "sandboxes:write";
2738
- "sessions:own": "sessions:own";
2739
- "vaults:own": "vaults:own";
2740
- }>>;
2741
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2742
- sandboxes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2743
- keyId: z.ZodString;
2744
- }, z.core.$strict>;
2745
- export type CreateTokenResponse = z.infer<typeof CreateTokenResponseSchema>;
2247
+ export declare function tenantTokenIssuer(tenantId: string): string;
2746
2248
  export declare const SIGNING_KEY_STATES: readonly ["standby", "current", "previous", "revoked"];
2747
2249
  export type SigningKeyState = (typeof SIGNING_KEY_STATES)[number];
2748
2250
  /** A public JSON Web Key as the JWKS publishes it. */
@@ -2824,62 +2326,44 @@ export declare const RotateSigningKeysRequestSchema: z.ZodObject<{
2824
2326
  export declare const RevokeSigningKeyRequestSchema: z.ZodObject<{
2825
2327
  requestId: z.ZodString;
2826
2328
  }, z.core.$strict>;
2827
- export declare const RevokeSubjectRequestSchema: z.ZodObject<{
2828
- requestId: z.ZodString;
2829
- subject: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
2830
- }, z.core.$strict>;
2831
- export type RevokeSubjectRequest = z.infer<typeof RevokeSubjectRequestSchema>;
2832
- export declare const RevokeSubjectResponseSchema: z.ZodObject<{
2833
- subject: z.ZodString;
2834
- epoch: z.ZodNumber;
2329
+ /**
2330
+ * Scopes a trusted issuer's tokens may carry (`allowedScopes` in the identity file): the
2331
+ * token scopes, and `studio`, an operator scope no Runtime route requires (Studio
2332
+ * admits a person who holds it, Tenant-wide).
2333
+ */
2334
+ export declare const ISSUER_SCOPES: readonly ["agents:read", "sessions:own", "sandboxes:write", "studio"];
2335
+ export type IssuerScope = (typeof ISSUER_SCOPES)[number];
2336
+ /** Every scope a caller can hold: the subject scopes, and an issuer token's `studio`. */
2337
+ export declare const CALLER_SCOPES: readonly ["agents:read", "agents:write", "sessions:own", "sandboxes:write", "studio"];
2338
+ export type CallerScope = (typeof CALLER_SCOPES)[number];
2339
+ /**
2340
+ * `GET /v1/me`: who the Runtime takes the caller to be, for any credential.
2341
+ *
2342
+ * - `via` is how the caller authenticated: `application:<principalId>` (an application key,
2343
+ * acting as itself), `subject` (an application key acting for `Nylorun-Subject`) or
2344
+ * `issuer:<name>` (a token from the identity file's issuer `name`).
2345
+ * - `subject` is the person the request acts for; absent for an application key alone.
2346
+ * - `scopes`: what the caller holds. An application key alone holds every subject scope.
2347
+ * - `agents`: the agents it may reach, `*` for all.
2348
+ * - `sandboxes`: the sandbox grants of a token caller (empty reaches none); absent for an
2349
+ * application key, alone or acting for a subject, which no grant limits.
2350
+ */
2351
+ export declare const MeResponseSchema: z.ZodObject<{
2352
+ subject: z.ZodOptional<z.ZodString>;
2353
+ scopes: z.ZodArray<z.ZodEnum<{
2354
+ "agents:read": "agents:read";
2355
+ "agents:write": "agents:write";
2356
+ "sandboxes:write": "sandboxes:write";
2357
+ "sessions:own": "sessions:own";
2358
+ studio: "studio";
2359
+ }>>;
2360
+ agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
2361
+ sandboxes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2362
+ via: z.ZodString;
2835
2363
  }, z.core.$strict>;
2836
- /** The claims of a subject token, as the Runtime writes them. */
2837
- export interface SubjectTokenClaims {
2838
- iss: string;
2839
- aud: string;
2840
- /** Tenant id. */
2841
- tnt: string;
2842
- sub: string;
2843
- role: string;
2844
- /** Space-separated token scopes. */
2845
- scp: string;
2846
- /** The agents the mint narrowed the role to; absent when not narrowed. */
2847
- agt?: string[];
2848
- /** The sandboxes the token reaches: exact ids, or prefixes ending in `/*`. */
2849
- sbx?: string[];
2850
- /** The subject's revocation epoch when minted. */
2851
- epc: number;
2852
- iat: number;
2853
- exp: number;
2854
- jti: string;
2855
- }
2856
- /** Loopback origins with any port, for development: `http://localhost:*`, `http://127.0.0.1:*`. */
2857
- export declare const LOOPBACK_ORIGIN_WILDCARDS: readonly ["http://localhost:*", "http://127.0.0.1:*"];
2364
+ export type MeResponse = z.infer<typeof MeResponseSchema>;
2858
2365
  /** True for a serialized web origin: `scheme://host[:port]`, lowercase, no path. */
2859
2366
  export declare function isSerializedOrigin(value: string): boolean;
2860
- /** An origin allowlist entry: an exact origin or a loopback wildcard. */
2861
- export declare const OriginEntrySchema: z.ZodString;
2862
- /** True when `origin` (a request's `Origin`) is allowed by `origins`. */
2863
- export declare function originAllowed(origins: readonly string[], origin: string): boolean;
2864
- export declare const PublishableKeySchema: z.ZodObject<{
2865
- id: z.ZodString;
2866
- name: z.ZodString;
2867
- key: z.ZodString;
2868
- origins: z.ZodArray<z.ZodString>;
2869
- createdAt: z.ZodString;
2870
- revokedAt: z.ZodNullable<z.ZodString>;
2871
- }, z.core.$strict>;
2872
- export type PublishableKey = z.infer<typeof PublishableKeySchema>;
2873
- export declare const CreatePublishableKeyRequestSchema: z.ZodObject<{
2874
- requestId: z.ZodString;
2875
- name: z.ZodString;
2876
- origins: z.ZodArray<z.ZodString>;
2877
- }, z.core.$strict>;
2878
- export type CreatePublishableKeyRequest = z.infer<typeof CreatePublishableKeyRequestSchema>;
2879
- export declare const UpdatePublishableKeyRequestSchema: z.ZodObject<{
2880
- requestId: z.ZodString;
2881
- origins: z.ZodArray<z.ZodString>;
2882
- }, z.core.$strict>;
2883
2367
  /** `GET /v1/agents` with an application key: every definition, manifest included. */
2884
2368
  export declare const AgentDefinitionViewSchema: z.ZodObject<{
2885
2369
  agentId: z.ZodString;
@@ -2897,7 +2381,7 @@ export declare const ListAgentsResponseSchema: z.ZodObject<{
2897
2381
  }, z.core.$strict>>;
2898
2382
  }, z.core.$strict>;
2899
2383
  export type ListAgentsResponse = z.infer<typeof ListAgentsResponseSchema>;
2900
- /** `GET /v1/agents` with a subject token or publishable key: the allowed agents' names only. */
2384
+ /** `GET /v1/agents` with a token caller's credential: the allowed agents' names only. */
2901
2385
  export declare const PublicAgentSchema: z.ZodObject<{
2902
2386
  agentId: z.ZodString;
2903
2387
  name: z.ZodOptional<z.ZodString>;
@@ -2994,180 +2478,36 @@ export declare const SessionViewSchema: z.ZodObject<{
2994
2478
  mcpDiagnostics: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2995
2479
  waits: z.ZodOptional<z.ZodUnknown>;
2996
2480
  error: z.ZodOptional<z.ZodString>;
2997
- actions: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2998
- actionId: z.ZodString;
2999
- sessionId: z.ZodString;
3000
- turnId: z.ZodString;
3001
- agentId: z.ZodString;
3002
- manifestHash: z.ZodString;
3003
- implementationVersion: z.ZodString;
3004
- input: z.ZodUnknown;
3005
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3006
- status: z.ZodEnum<{
3007
- cancelled: "cancelled";
3008
- completed: "completed";
3009
- delivering: "delivering";
3010
- pending: "pending";
3011
- uncertain: "uncertain";
3012
- }>;
3013
- generation: z.ZodNumber;
3014
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3015
- agent: z.ZodOptional<z.ZodObject<{
3016
- id: z.ZodString;
3017
- path: z.ZodString;
3018
- delegationId: z.ZodOptional<z.ZodString>;
3019
- }, z.core.$strict>>;
3020
- kind: z.ZodLiteral<"tool">;
3021
- capabilityId: z.ZodString;
3022
- toolName: z.ZodString;
3023
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3024
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3025
- }, z.core.$strict>, z.ZodObject<{
3026
- actionId: z.ZodString;
3027
- sessionId: z.ZodString;
2481
+ uncertainEffects: z.ZodArray<z.ZodObject<{
2482
+ effectId: z.ZodString;
3028
2483
  turnId: z.ZodString;
3029
- agentId: z.ZodString;
3030
- manifestHash: z.ZodString;
3031
- implementationVersion: z.ZodString;
3032
- input: z.ZodUnknown;
3033
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3034
- status: z.ZodEnum<{
3035
- cancelled: "cancelled";
3036
- completed: "completed";
3037
- delivering: "delivering";
3038
- pending: "pending";
3039
- uncertain: "uncertain";
3040
- }>;
3041
- generation: z.ZodNumber;
3042
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3043
- agent: z.ZodOptional<z.ZodObject<{
2484
+ kind: z.ZodString;
2485
+ error: z.ZodUnknown;
2486
+ }, z.core.$strict>>;
2487
+ }, z.core.$strict>;
2488
+ export type SessionView = z.infer<typeof SessionViewSchema>;
2489
+ /** A sandbox tool call's answer (`POST …/sandbox/:tool`): its output, or why it failed. */
2490
+ export declare const SandboxToolOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2491
+ kind: z.ZodLiteral<"completed">;
2492
+ output: z.ZodUnknown;
2493
+ }, z.core.$strict>, z.ZodObject<{
2494
+ kind: z.ZodLiteral<"failed">;
2495
+ code: z.ZodString;
2496
+ message: z.ZodString;
2497
+ }, z.core.$strict>], "kind">;
2498
+ export type SandboxToolOutcome = z.infer<typeof SandboxToolOutcomeSchema>;
2499
+ export declare const ResetTenantResponseSchema: z.ZodObject<{
2500
+ ok: z.ZodLiteral<true>;
2501
+ }, z.core.$strict>;
2502
+ export type ResetTenantResponse = z.infer<typeof ResetTenantResponseSchema>;
2503
+ /** `GET /v1/tenant/models`: public provider and model names, no credentials. */
2504
+ export declare const HostModelCatalogSchema: z.ZodObject<{
2505
+ providers: z.ZodArray<z.ZodObject<{
2506
+ id: z.ZodString;
2507
+ name: z.ZodString;
2508
+ models: z.ZodArray<z.ZodObject<{
3044
2509
  id: z.ZodString;
3045
- path: z.ZodString;
3046
- delegationId: z.ZodOptional<z.ZodString>;
3047
- }, z.core.$strict>>;
3048
- kind: z.ZodLiteral<"tool">;
3049
- path: z.ZodString;
3050
- key: z.ZodString;
3051
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3052
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3053
- }, z.core.$strict>, z.ZodObject<{
3054
- actionId: z.ZodString;
3055
- sessionId: z.ZodString;
3056
- turnId: z.ZodString;
3057
- agentId: z.ZodString;
3058
- manifestHash: z.ZodString;
3059
- implementationVersion: z.ZodString;
3060
- input: z.ZodUnknown;
3061
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3062
- status: z.ZodEnum<{
3063
- cancelled: "cancelled";
3064
- completed: "completed";
3065
- delivering: "delivering";
3066
- pending: "pending";
3067
- uncertain: "uncertain";
3068
- }>;
3069
- generation: z.ZodNumber;
3070
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3071
- agent: z.ZodOptional<z.ZodObject<{
3072
- id: z.ZodString;
3073
- path: z.ZodString;
3074
- delegationId: z.ZodOptional<z.ZodString>;
3075
- }, z.core.$strict>>;
3076
- kind: z.ZodLiteral<"hook">;
3077
- hook: z.ZodObject<{
3078
- at: z.ZodEnum<{
3079
- after: "after";
3080
- before: "before";
3081
- }>;
3082
- scope: z.ZodEnum<{
3083
- step: "step";
3084
- turn: "turn";
3085
- }>;
3086
- capabilityIds: z.ZodArray<z.ZodString>;
3087
- }, z.core.$strict>;
3088
- }, z.core.$strict>, z.ZodObject<{
3089
- actionId: z.ZodString;
3090
- sessionId: z.ZodString;
3091
- turnId: z.ZodString;
3092
- agentId: z.ZodString;
3093
- manifestHash: z.ZodString;
3094
- implementationVersion: z.ZodString;
3095
- input: z.ZodUnknown;
3096
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3097
- status: z.ZodEnum<{
3098
- cancelled: "cancelled";
3099
- completed: "completed";
3100
- delivering: "delivering";
3101
- pending: "pending";
3102
- uncertain: "uncertain";
3103
- }>;
3104
- generation: z.ZodNumber;
3105
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3106
- agent: z.ZodOptional<z.ZodObject<{
3107
- id: z.ZodString;
3108
- path: z.ZodString;
3109
- delegationId: z.ZodOptional<z.ZodString>;
3110
- }, z.core.$strict>>;
3111
- kind: z.ZodLiteral<"fn">;
3112
- path: z.ZodString;
3113
- key: z.ZodString;
3114
- }, z.core.$strict>, z.ZodObject<{
3115
- actionId: z.ZodString;
3116
- sessionId: z.ZodString;
3117
- turnId: z.ZodString;
3118
- agentId: z.ZodString;
3119
- manifestHash: z.ZodString;
3120
- implementationVersion: z.ZodString;
3121
- input: z.ZodUnknown;
3122
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3123
- status: z.ZodEnum<{
3124
- cancelled: "cancelled";
3125
- completed: "completed";
3126
- delivering: "delivering";
3127
- pending: "pending";
3128
- uncertain: "uncertain";
3129
- }>;
3130
- generation: z.ZodNumber;
3131
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3132
- agent: z.ZodOptional<z.ZodObject<{
3133
- id: z.ZodString;
3134
- path: z.ZodString;
3135
- delegationId: z.ZodOptional<z.ZodString>;
3136
- }, z.core.$strict>>;
3137
- kind: z.ZodLiteral<"verify">;
3138
- path: z.ZodString;
3139
- key: z.ZodString;
3140
- }, z.core.$strict>]>>;
3141
- uncertainEffects: z.ZodArray<z.ZodObject<{
3142
- effectId: z.ZodString;
3143
- turnId: z.ZodString;
3144
- kind: z.ZodString;
3145
- error: z.ZodUnknown;
3146
- }, z.core.$strict>>;
3147
- }, z.core.$strict>;
3148
- export type SessionView = z.infer<typeof SessionViewSchema>;
3149
- /** A sandbox tool call's answer (`POST …/sandbox/:tool`): its output, or why it failed. */
3150
- export declare const SandboxToolOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3151
- kind: z.ZodLiteral<"completed">;
3152
- output: z.ZodUnknown;
3153
- }, z.core.$strict>, z.ZodObject<{
3154
- kind: z.ZodLiteral<"failed">;
3155
- code: z.ZodString;
3156
- message: z.ZodString;
3157
- }, z.core.$strict>], "kind">;
3158
- export type SandboxToolOutcome = z.infer<typeof SandboxToolOutcomeSchema>;
3159
- export declare const ResetTenantResponseSchema: z.ZodObject<{
3160
- ok: z.ZodLiteral<true>;
3161
- }, z.core.$strict>;
3162
- export type ResetTenantResponse = z.infer<typeof ResetTenantResponseSchema>;
3163
- /** `GET /v1/tenant/models`: public provider and model names, no credentials. */
3164
- export declare const HostModelCatalogSchema: z.ZodObject<{
3165
- providers: z.ZodArray<z.ZodObject<{
3166
- id: z.ZodString;
3167
- name: z.ZodString;
3168
- models: z.ZodArray<z.ZodObject<{
3169
- id: z.ZodString;
3170
- name: z.ZodString;
2510
+ name: z.ZodString;
3171
2511
  }, z.core.$strict>>;
3172
2512
  }, z.core.$strict>>;
3173
2513
  }, z.core.$strict>;
@@ -3457,55 +2797,35 @@ export declare const ListCredentialsResponseSchema: z.ZodObject<{
3457
2797
  }, z.core.$strict>>;
3458
2798
  }, z.core.$strict>;
3459
2799
  export type ListCredentialsResponse = z.infer<typeof ListCredentialsResponseSchema>;
2800
+ /**
2801
+ * `POST /v1/vaults/{vaultId}/oauth/start` (F9 C2): sign the installation in to the remote MCP
2802
+ * server at `url`, declared as `server`, and store its OAuth credential in the installation vault.
2803
+ * `clientId` names a client registered with the authorization server; without one the Runtime
2804
+ * registers itself (RFC 7591) when the server allows it.
2805
+ */
2806
+ export declare const StartOAuthRequestSchema: z.ZodObject<{
2807
+ url: z.ZodString;
2808
+ server: z.ZodString;
2809
+ clientId: z.ZodOptional<z.ZodString>;
2810
+ }, z.core.$strict>;
2811
+ export type StartOAuthRequest = z.infer<typeof StartOAuthRequestSchema>;
2812
+ /** Where to send the browser, and until when the sign-in can finish. */
2813
+ export declare const StartOAuthResponseSchema: z.ZodObject<{
2814
+ authorizeUrl: z.ZodString;
2815
+ expiresAt: z.ZodString;
2816
+ }, z.core.$strict>;
2817
+ export type StartOAuthResponse = z.infer<typeof StartOAuthResponseSchema>;
3460
2818
  /** A deleted vault or credential. */
3461
2819
  export declare const DeletedResponseSchema: z.ZodObject<{
3462
2820
  id: z.ZodString;
3463
2821
  }, z.core.$strict>;
3464
2822
  export type DeletedResponse = z.infer<typeof DeletedResponseSchema>;
3465
- export declare const AccessPolicyResponseSchema: z.ZodObject<{
3466
- policy: z.ZodObject<{
3467
- version: z.ZodLiteral<1>;
3468
- roles: z.ZodRecord<z.ZodString, z.ZodObject<{
3469
- scopes: z.ZodArray<z.ZodEnum<{
3470
- "agents:read": "agents:read";
3471
- "sandboxes:write": "sandboxes:write";
3472
- "sessions:own": "sessions:own";
3473
- "vaults:own": "vaults:own";
3474
- }>>;
3475
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
3476
- limits: z.ZodOptional<z.ZodObject<{
3477
- turnsPerHour: z.ZodOptional<z.ZodNumber>;
3478
- concurrentTurns: z.ZodOptional<z.ZodNumber>;
3479
- }, z.core.$strict>>;
3480
- }, z.core.$strict>>;
3481
- anon: z.ZodObject<{
3482
- scopes: z.ZodArray<z.ZodLiteral<"agents:read">>;
3483
- agents: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>;
3484
- }, z.core.$strict>;
3485
- tokens: z.ZodObject<{
3486
- maxTtlSeconds: z.ZodNumber;
3487
- }, z.core.$strict>;
3488
- }, z.core.$strict>;
3489
- }, z.core.$strict>;
3490
- export type AccessPolicyResponse = z.infer<typeof AccessPolicyResponseSchema>;
3491
- export declare const ListPublishableKeysResponseSchema: z.ZodObject<{
3492
- keys: z.ZodArray<z.ZodObject<{
3493
- id: z.ZodString;
3494
- name: z.ZodString;
3495
- key: z.ZodString;
3496
- origins: z.ZodArray<z.ZodString>;
3497
- createdAt: z.ZodString;
3498
- revokedAt: z.ZodNullable<z.ZodString>;
3499
- }, z.core.$strict>>;
3500
- }, z.core.$strict>;
3501
- export type ListPublishableKeysResponse = z.infer<typeof ListPublishableKeysResponseSchema>;
3502
- export declare const HostShutdownResponseSchema: z.ZodObject<{
3503
- status: z.ZodLiteral<"shutting_down">;
3504
- }, z.core.$strict>;
3505
- /** The last frame of a session stream the Runtime ends: `event: nylorun.closed`. */
2823
+ /**
2824
+ * The last frame of a session stream the Runtime ends: `event: nylorun.closed`, when the
2825
+ * token caller's token expires.
2826
+ */
3506
2827
  export declare const StreamClosedFrameSchema: z.ZodObject<{
3507
2828
  reason: z.ZodEnum<{
3508
- revoked: "revoked";
3509
2829
  token_expired: "token_expired";
3510
2830
  }>;
3511
2831
  }, z.core.$strict>;
@@ -3516,12 +2836,18 @@ export type StreamClosedFrame = z.infer<typeof StreamClosedFrameSchema>;
3516
2836
  */
3517
2837
  export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
3518
2838
  connection_missing: "connection_missing";
2839
+ definition_files_missing: "definition_files_missing";
3519
2840
  host_rejected: "host_rejected";
3520
2841
  incompatible_host: "incompatible_host";
3521
2842
  internal_error: "internal_error";
3522
2843
  invalid_request: "invalid_request";
2844
+ issuer_unavailable: "issuer_unavailable";
2845
+ key_role_mismatch: "key_role_mismatch";
3523
2846
  limit_exceeded: "limit_exceeded";
3524
2847
  not_found: "not_found";
2848
+ oauth_client_required: "oauth_client_required";
2849
+ oauth_failed: "oauth_failed";
2850
+ oauth_state_invalid: "oauth_state_invalid";
3525
2851
  origin_rejected: "origin_rejected";
3526
2852
  placement_refused: "placement_refused";
3527
2853
  protocol_unsupported: "protocol_unsupported";
@@ -3540,284 +2866,6 @@ export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
3540
2866
  unsupported_media_type: "unsupported_media_type";
3541
2867
  }>;
3542
2868
  export type AgUiRunErrorCode = z.infer<typeof AgUiRunErrorCodeSchema>;
3543
- /** The JWT `typ` of a delivery token (RFC 8725 explicit typing). */
3544
- export declare const DELIVERY_TOKEN_TYPE = "nylorun-delivery+jwt";
3545
- /**
3546
- * A delivery token lives no longer than a subject token: rotating signing keys revokes the
3547
- * previous key once the longest token it may have signed has expired.
3548
- */
3549
- export declare const DELIVERY_TOKEN_MAX_TTL_SECONDS = 900;
3550
- /** Inline delivery timeouts, in milliseconds. The maximum keeps a token within its lifetime. */
3551
- export declare const ENDPOINT_TIMEOUT_DEFAULT_MS = 60000;
3552
- export declare const ENDPOINT_TIMEOUT_MAX_MS: number;
3553
- /** In-flight deliveries per endpoint when the registration does not say. */
3554
- export declare const ENDPOINT_MAX_CONCURRENT_DEFAULT = 16;
3555
- /** One agent's or workflow's Action endpoint, as the application registers it. */
3556
- export declare const EndpointRegistrationSchema: z.ZodObject<{
3557
- agentId: z.ZodString;
3558
- url: z.ZodString;
3559
- implementationVersion: z.ZodString;
3560
- manifestHash: z.ZodOptional<z.ZodString>;
3561
- timeoutMs: z.ZodOptional<z.ZodNumber>;
3562
- maxConcurrent: z.ZodOptional<z.ZodNumber>;
3563
- }, z.core.$strict>;
3564
- export type EndpointRegistration = z.infer<typeof EndpointRegistrationSchema>;
3565
- export declare const PutEndpointsRequestSchema: z.ZodObject<{
3566
- endpoints: z.ZodArray<z.ZodObject<{
3567
- agentId: z.ZodString;
3568
- url: z.ZodString;
3569
- implementationVersion: z.ZodString;
3570
- manifestHash: z.ZodOptional<z.ZodString>;
3571
- timeoutMs: z.ZodOptional<z.ZodNumber>;
3572
- maxConcurrent: z.ZodOptional<z.ZodNumber>;
3573
- }, z.core.$strict>>;
3574
- }, z.core.$strict>;
3575
- export type PutEndpointsRequest = z.infer<typeof PutEndpointsRequestSchema>;
3576
- /** What recent deliveries and the last ping say about an endpoint. */
3577
- export declare const EndpointHealthSchema: z.ZodObject<{
3578
- lastDeliveryAt: z.ZodOptional<z.ZodString>;
3579
- lastSuccessAt: z.ZodOptional<z.ZodString>;
3580
- lastError: z.ZodOptional<z.ZodObject<{
3581
- code: z.ZodString;
3582
- message: z.ZodString;
3583
- }, z.core.$strip>>;
3584
- consecutiveFailures: z.ZodNumber;
3585
- served: z.ZodOptional<z.ZodObject<{
3586
- implementationVersion: z.ZodString;
3587
- manifestHash: z.ZodOptional<z.ZodString>;
3588
- }, z.core.$strict>>;
3589
- }, z.core.$strict>;
3590
- export type EndpointHealth = z.infer<typeof EndpointHealthSchema>;
3591
- export declare const EndpointSchema: z.ZodObject<{
3592
- agentId: z.ZodString;
3593
- url: z.ZodString;
3594
- implementationVersion: z.ZodString;
3595
- manifestHash: z.ZodOptional<z.ZodString>;
3596
- timeoutMs: z.ZodNumber;
3597
- maxConcurrent: z.ZodNumber;
3598
- health: z.ZodObject<{
3599
- lastDeliveryAt: z.ZodOptional<z.ZodString>;
3600
- lastSuccessAt: z.ZodOptional<z.ZodString>;
3601
- lastError: z.ZodOptional<z.ZodObject<{
3602
- code: z.ZodString;
3603
- message: z.ZodString;
3604
- }, z.core.$strip>>;
3605
- consecutiveFailures: z.ZodNumber;
3606
- served: z.ZodOptional<z.ZodObject<{
3607
- implementationVersion: z.ZodString;
3608
- manifestHash: z.ZodOptional<z.ZodString>;
3609
- }, z.core.$strict>>;
3610
- }, z.core.$strict>;
3611
- updatedAt: z.ZodString;
3612
- }, z.core.$strict>;
3613
- export type Endpoint = z.infer<typeof EndpointSchema>;
3614
- export declare const ListEndpointsResponseSchema: z.ZodObject<{
3615
- endpoints: z.ZodArray<z.ZodObject<{
3616
- agentId: z.ZodString;
3617
- url: z.ZodString;
3618
- implementationVersion: z.ZodString;
3619
- manifestHash: z.ZodOptional<z.ZodString>;
3620
- timeoutMs: z.ZodNumber;
3621
- maxConcurrent: z.ZodNumber;
3622
- health: z.ZodObject<{
3623
- lastDeliveryAt: z.ZodOptional<z.ZodString>;
3624
- lastSuccessAt: z.ZodOptional<z.ZodString>;
3625
- lastError: z.ZodOptional<z.ZodObject<{
3626
- code: z.ZodString;
3627
- message: z.ZodString;
3628
- }, z.core.$strip>>;
3629
- consecutiveFailures: z.ZodNumber;
3630
- served: z.ZodOptional<z.ZodObject<{
3631
- implementationVersion: z.ZodString;
3632
- manifestHash: z.ZodOptional<z.ZodString>;
3633
- }, z.core.$strict>>;
3634
- }, z.core.$strict>;
3635
- updatedAt: z.ZodString;
3636
- }, z.core.$strict>>;
3637
- }, z.core.$strict>;
3638
- export type ListEndpointsResponse = z.infer<typeof ListEndpointsResponseSchema>;
3639
- export declare const DeleteEndpointResponseSchema: z.ZodObject<{
3640
- agentId: z.ZodString;
3641
- deleted: z.ZodLiteral<true>;
3642
- }, z.core.$strict>;
3643
- export type DeleteEndpointResponse = z.infer<typeof DeleteEndpointResponseSchema>;
3644
- /** The body the Runtime POSTs to an Action endpoint. */
3645
- export declare const ActionDeliverySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3646
- type: z.ZodLiteral<"action">;
3647
- action: z.ZodUnion<readonly [z.ZodObject<{
3648
- actionId: z.ZodString;
3649
- sessionId: z.ZodString;
3650
- turnId: z.ZodString;
3651
- agentId: z.ZodString;
3652
- manifestHash: z.ZodString;
3653
- implementationVersion: z.ZodString;
3654
- input: z.ZodUnknown;
3655
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3656
- status: z.ZodEnum<{
3657
- cancelled: "cancelled";
3658
- completed: "completed";
3659
- delivering: "delivering";
3660
- pending: "pending";
3661
- uncertain: "uncertain";
3662
- }>;
3663
- generation: z.ZodNumber;
3664
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3665
- agent: z.ZodOptional<z.ZodObject<{
3666
- id: z.ZodString;
3667
- path: z.ZodString;
3668
- delegationId: z.ZodOptional<z.ZodString>;
3669
- }, z.core.$strict>>;
3670
- kind: z.ZodLiteral<"tool">;
3671
- capabilityId: z.ZodString;
3672
- toolName: z.ZodString;
3673
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3674
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3675
- }, z.core.$strict>, z.ZodObject<{
3676
- actionId: z.ZodString;
3677
- sessionId: z.ZodString;
3678
- turnId: z.ZodString;
3679
- agentId: z.ZodString;
3680
- manifestHash: z.ZodString;
3681
- implementationVersion: z.ZodString;
3682
- input: z.ZodUnknown;
3683
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3684
- status: z.ZodEnum<{
3685
- cancelled: "cancelled";
3686
- completed: "completed";
3687
- delivering: "delivering";
3688
- pending: "pending";
3689
- uncertain: "uncertain";
3690
- }>;
3691
- generation: z.ZodNumber;
3692
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3693
- agent: z.ZodOptional<z.ZodObject<{
3694
- id: z.ZodString;
3695
- path: z.ZodString;
3696
- delegationId: z.ZodOptional<z.ZodString>;
3697
- }, z.core.$strict>>;
3698
- kind: z.ZodLiteral<"tool">;
3699
- path: z.ZodString;
3700
- key: z.ZodString;
3701
- inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3702
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3703
- }, z.core.$strict>, z.ZodObject<{
3704
- actionId: z.ZodString;
3705
- sessionId: z.ZodString;
3706
- turnId: z.ZodString;
3707
- agentId: z.ZodString;
3708
- manifestHash: z.ZodString;
3709
- implementationVersion: z.ZodString;
3710
- input: z.ZodUnknown;
3711
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3712
- status: z.ZodEnum<{
3713
- cancelled: "cancelled";
3714
- completed: "completed";
3715
- delivering: "delivering";
3716
- pending: "pending";
3717
- uncertain: "uncertain";
3718
- }>;
3719
- generation: z.ZodNumber;
3720
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3721
- agent: z.ZodOptional<z.ZodObject<{
3722
- id: z.ZodString;
3723
- path: z.ZodString;
3724
- delegationId: z.ZodOptional<z.ZodString>;
3725
- }, z.core.$strict>>;
3726
- kind: z.ZodLiteral<"hook">;
3727
- hook: z.ZodObject<{
3728
- at: z.ZodEnum<{
3729
- after: "after";
3730
- before: "before";
3731
- }>;
3732
- scope: z.ZodEnum<{
3733
- step: "step";
3734
- turn: "turn";
3735
- }>;
3736
- capabilityIds: z.ZodArray<z.ZodString>;
3737
- }, z.core.$strict>;
3738
- }, z.core.$strict>, z.ZodObject<{
3739
- actionId: z.ZodString;
3740
- sessionId: z.ZodString;
3741
- turnId: z.ZodString;
3742
- agentId: z.ZodString;
3743
- manifestHash: z.ZodString;
3744
- implementationVersion: z.ZodString;
3745
- input: z.ZodUnknown;
3746
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3747
- status: z.ZodEnum<{
3748
- cancelled: "cancelled";
3749
- completed: "completed";
3750
- delivering: "delivering";
3751
- pending: "pending";
3752
- uncertain: "uncertain";
3753
- }>;
3754
- generation: z.ZodNumber;
3755
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3756
- agent: z.ZodOptional<z.ZodObject<{
3757
- id: z.ZodString;
3758
- path: z.ZodString;
3759
- delegationId: z.ZodOptional<z.ZodString>;
3760
- }, z.core.$strict>>;
3761
- kind: z.ZodLiteral<"fn">;
3762
- path: z.ZodString;
3763
- key: z.ZodString;
3764
- }, z.core.$strict>, z.ZodObject<{
3765
- actionId: z.ZodString;
3766
- sessionId: z.ZodString;
3767
- turnId: z.ZodString;
3768
- agentId: z.ZodString;
3769
- manifestHash: z.ZodString;
3770
- implementationVersion: z.ZodString;
3771
- input: z.ZodUnknown;
3772
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3773
- status: z.ZodEnum<{
3774
- cancelled: "cancelled";
3775
- completed: "completed";
3776
- delivering: "delivering";
3777
- pending: "pending";
3778
- uncertain: "uncertain";
3779
- }>;
3780
- generation: z.ZodNumber;
3781
- deadlineAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3782
- agent: z.ZodOptional<z.ZodObject<{
3783
- id: z.ZodString;
3784
- path: z.ZodString;
3785
- delegationId: z.ZodOptional<z.ZodString>;
3786
- }, z.core.$strict>>;
3787
- kind: z.ZodLiteral<"verify">;
3788
- path: z.ZodString;
3789
- key: z.ZodString;
3790
- }, z.core.$strict>]>;
3791
- sandbox: z.ZodBoolean;
3792
- }, z.core.$strict>, z.ZodObject<{
3793
- type: z.ZodLiteral<"ping">;
3794
- agentId: z.ZodString;
3795
- manifestHash: z.ZodOptional<z.ZodString>;
3796
- }, z.core.$strict>], "type">;
3797
- export type ActionDelivery = z.infer<typeof ActionDeliverySchema>;
3798
- /** An Action endpoint's answer to a ping. */
3799
- export declare const EndpointPingResponseSchema: z.ZodObject<{
3800
- agentId: z.ZodString;
3801
- implementationVersion: z.ZodString;
3802
- manifestHash: z.ZodOptional<z.ZodString>;
3803
- }, z.core.$strip>;
3804
- export type EndpointPingResponse = z.infer<typeof EndpointPingResponseSchema>;
3805
- /** The answer to a background delivery's heartbeat: a fresh token and the new deadline. */
3806
- export declare const DeliveryHeartbeatResponseSchema: z.ZodObject<{
3807
- token: z.ZodString;
3808
- deadlineAt: z.ZodString;
3809
- }, z.core.$strip>;
3810
- export type DeliveryHeartbeatResponse = z.infer<typeof DeliveryHeartbeatResponseSchema>;
3811
- /**
3812
- * The receipt of a background result (`POST /v1/actions/:id/result`): a session command's
3813
- * receipt without `requestId`, since the result carries none. The same result again returns it.
3814
- */
3815
- export declare const ActionResultReceiptSchema: z.ZodObject<{
3816
- status: z.ZodLiteral<"accepted">;
3817
- turnId: z.ZodNullable<z.ZodString>;
3818
- cursor: z.ZodNullable<z.ZodString>;
3819
- }, z.core.$strip>;
3820
- export type ActionResultReceipt = z.infer<typeof ActionResultReceiptSchema>;
3821
2869
  /** `POST /_studio/login-tokens` body. No `tenant` mints a Host-wide token (the CLI's `{}`). */
3822
2870
  export declare const StudioLoginTokenRequestSchema: z.ZodObject<{
3823
2871
  tenant: z.ZodOptional<z.ZodString>;
@@ -3928,7 +2976,7 @@ export declare const StudioEmbedMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObj
3928
2976
  }, z.core.$strip>, z.ZodObject<{
3929
2977
  type: z.ZodLiteral<"nylorun.studio">;
3930
2978
  protocol: z.ZodNumber;
3931
- kind: z.ZodLiteral<"open.babai">;
2979
+ kind: z.ZodLiteral<"open.session">;
3932
2980
  sessionId: z.ZodString;
3933
2981
  }, z.core.$strip>, z.ZodObject<{
3934
2982
  type: z.ZodLiteral<"nylorun.studio">;
@@ -3948,10 +2996,7 @@ export declare function isFrameAncestor(value: string): boolean;
3948
2996
  export declare function parseFrameAncestors(value: string): string[];
3949
2997
  /** The JWT `typ` of a capability link's token (RFC 8725 explicit typing). */
3950
2998
  export declare const ARTIFACT_LINK_TOKEN_TYPE = "nylorun-artifact+jwt";
3951
- /**
3952
- * A capability link lives no longer than a subject token: rotating signing keys revokes the
3953
- * previous key once the longest token it may have signed has expired.
3954
- */
2999
+ /** A capability link lives no longer than any token the Runtime signs (`TOKEN_TTL_MAX_SECONDS`). */
3955
3000
  export declare const ARTIFACT_LINK_MAX_TTL_SECONDS = 900;
3956
3001
  export declare const ARTIFACT_LINK_DEFAULT_TTL_SECONDS = 300;
3957
3002
  /** A Tenant's limits when it sets none: 100 MiB per file, 10 GiB in all. */
@@ -4082,6 +3127,15 @@ export declare const UploadArtifactResponseSchema: z.ZodObject<{
4082
3127
  }, z.core.$strict>;
4083
3128
  }, z.core.$strict>;
4084
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>;
4085
3139
  export declare const DeleteArtifactResponseSchema: z.ZodObject<{
4086
3140
  artifactId: z.ZodString;
4087
3141
  deleted: z.ZodBoolean;
@@ -4207,3 +3261,215 @@ export declare const TenantArtifactsViewSchema: z.ZodObject<{
4207
3261
  usedBytes: z.ZodNumber;
4208
3262
  }, z.core.$strict>;
4209
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>;