@kici-dev/engine 0.15.0 → 0.16.0
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.
- package/dist/approval/expiry-duration.d.ts +11 -0
- package/dist/approval/expiry-duration.js +29 -0
- package/dist/audit/access-log-policy.js +2 -0
- package/dist/audit/retention-policy.d.ts +1 -1
- package/dist/audit/retention-policy.js +5 -1
- package/dist/auth/permissions.d.ts +69 -0
- package/dist/auth/permissions.js +51 -0
- package/dist/context/hold-type.d.ts +0 -19
- package/dist/context/hold-type.js +1 -37
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +2 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +18 -13
- package/dist/labels.d.ts +2 -17
- package/dist/labels.js +3 -33
- package/dist/mcp/held-run-resolve.d.ts +2 -5
- package/dist/mcp/held-run-resolve.js +3 -4
- package/dist/metrics/metric-catalog.generated.d.ts +0 -5
- package/dist/metrics/metric-catalog.generated.js +0 -6
- package/dist/protocol/messages/access-log.d.ts +10 -0
- package/dist/protocol/messages/access-log.js +2 -0
- package/dist/protocol/messages/auth.d.ts +7 -10
- package/dist/protocol/messages/auth.js +8 -22
- package/dist/protocol/messages/browser.js +1 -1
- package/dist/protocol/messages/capabilities.d.ts +21 -106
- package/dist/protocol/messages/capabilities.js +23 -133
- package/dist/protocol/messages/dashboard.d.ts +24 -28
- package/dist/protocol/messages/dashboard.js +19 -38
- package/dist/protocol/messages/execution-status.d.ts +3 -3
- package/dist/protocol/messages/execution-status.js +7 -12
- package/dist/protocol/messages/orchestrator-agent.d.ts +35 -40
- package/dist/protocol/messages/orchestrator-agent.js +63 -96
- package/dist/protocol/messages/peer.d.ts +223 -18
- package/dist/protocol/messages/peer.js +90 -55
- package/dist/protocol/messages/platform-orchestrator.d.ts +36 -145
- package/dist/protocol/messages/platform-orchestrator.js +24 -86
- package/dist/protocol/messages/source-registration.d.ts +0 -13
- package/dist/protocol/messages/source-registration.js +9 -10
- package/dist/protocol/version.d.ts +9 -15
- package/dist/protocol/version.js +9 -15
- package/dist/provenance/id-token-claim-names.d.ts +3 -5
- package/dist/provenance/id-token-claim-names.js +3 -5
- package/dist/status/presentation.d.ts +2 -14
- package/dist/status/presentation.js +3 -23
- package/dist/trigger/types.d.ts +125 -34
- package/dist/trigger/types.js +9 -24
- package/dist/util/date.d.ts +7 -0
- package/dist/util/date.js +14 -0
- package/dist/util/parse-duration.d.ts +6 -0
- package/dist/util/parse-duration.js +21 -0
- package/dist/util/sleep.d.ts +3 -0
- package/dist/util/sleep.js +10 -0
- package/package.json +1 -1
- package/sbom.spdx.json +5 -5
|
@@ -199,10 +199,10 @@ export declare const jobRerouteSchema: z.ZodObject<{
|
|
|
199
199
|
}, z.core.$strip>], "kind">>>;
|
|
200
200
|
triedConnections: z.ZodArray<z.ZodString>;
|
|
201
201
|
maxHops: z.ZodNumber;
|
|
202
|
-
spawnRetry: z.
|
|
202
|
+
spawnRetry: z.ZodObject<{
|
|
203
203
|
maxAttempts: z.ZodNumber;
|
|
204
204
|
backoffMs: z.ZodNumber;
|
|
205
|
-
}, z.core.$strip
|
|
205
|
+
}, z.core.$strip>;
|
|
206
206
|
coordinatorId: z.ZodString;
|
|
207
207
|
requestId: z.ZodOptional<z.ZodString>;
|
|
208
208
|
traceId: z.ZodOptional<z.ZodString>;
|
|
@@ -339,10 +339,10 @@ declare const peerLogChunkSchema: z.ZodObject<{
|
|
|
339
339
|
lines: z.ZodArray<z.ZodObject<{
|
|
340
340
|
text: z.ZodString;
|
|
341
341
|
timestamp: z.ZodNumber;
|
|
342
|
-
stream: z.
|
|
342
|
+
stream: z.ZodEnum<{
|
|
343
343
|
stderr: "stderr";
|
|
344
344
|
stdout: "stdout";
|
|
345
|
-
}
|
|
345
|
+
}>;
|
|
346
346
|
}, z.core.$strip>>;
|
|
347
347
|
}, z.core.$strip>;
|
|
348
348
|
/** Cache upload request: worker -> coordinator. Worker agent needs upload URL. */
|
|
@@ -366,6 +366,110 @@ declare const peerCacheUploadResponseSchema: z.ZodObject<{
|
|
|
366
366
|
jobId: z.ZodString;
|
|
367
367
|
uploadUrl: z.ZodString;
|
|
368
368
|
}, z.core.$strip>;
|
|
369
|
+
/**
|
|
370
|
+
* What a scaler config reload did on one orchestrator. `rejected`: the file did
|
|
371
|
+
* not load or validate, or an added scaler did not build, and nothing applied.
|
|
372
|
+
* `not-configured`: the orchestrator runs without a scaler config, so there is
|
|
373
|
+
* nothing to reload. `unreachable`: the request did not reach the orchestrator,
|
|
374
|
+
* or it did not answer in time.
|
|
375
|
+
*/
|
|
376
|
+
export declare const ScalerReloadOutcome: z.ZodEnum<{
|
|
377
|
+
applied: "applied";
|
|
378
|
+
"not-configured": "not-configured";
|
|
379
|
+
rejected: "rejected";
|
|
380
|
+
unreachable: "unreachable";
|
|
381
|
+
}>;
|
|
382
|
+
export type ScalerReloadOutcome = z.infer<typeof ScalerReloadOutcome>;
|
|
383
|
+
/**
|
|
384
|
+
* What an applied scaler reload changed, as scaler names per bucket. `updated`
|
|
385
|
+
* holds the kept scalers whose entry changed and `unchanged` the rest of them;
|
|
386
|
+
* `global` names the changed top-level limits (`globalMaxAgents`,
|
|
387
|
+
* `globalResourceCap`).
|
|
388
|
+
*/
|
|
389
|
+
export declare const scalerReloadPlanSchema: z.ZodObject<{
|
|
390
|
+
added: z.ZodArray<z.ZodString>;
|
|
391
|
+
updated: z.ZodArray<z.ZodString>;
|
|
392
|
+
unchanged: z.ZodArray<z.ZodString>;
|
|
393
|
+
retired: z.ZodArray<z.ZodString>;
|
|
394
|
+
resurrected: z.ZodArray<z.ZodString>;
|
|
395
|
+
global: z.ZodArray<z.ZodString>;
|
|
396
|
+
}, z.core.$strip>;
|
|
397
|
+
export type ScalerReloadPlan = z.infer<typeof scalerReloadPlanSchema>;
|
|
398
|
+
/** One orchestrator's scaler reload outcome, its plan when applied, its errors when refused. */
|
|
399
|
+
export declare const scalerReloadAnswerSchema: z.ZodObject<{
|
|
400
|
+
outcome: z.ZodEnum<{
|
|
401
|
+
applied: "applied";
|
|
402
|
+
"not-configured": "not-configured";
|
|
403
|
+
rejected: "rejected";
|
|
404
|
+
unreachable: "unreachable";
|
|
405
|
+
}>;
|
|
406
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
407
|
+
added: z.ZodArray<z.ZodString>;
|
|
408
|
+
updated: z.ZodArray<z.ZodString>;
|
|
409
|
+
unchanged: z.ZodArray<z.ZodString>;
|
|
410
|
+
retired: z.ZodArray<z.ZodString>;
|
|
411
|
+
resurrected: z.ZodArray<z.ZodString>;
|
|
412
|
+
global: z.ZodArray<z.ZodString>;
|
|
413
|
+
}, z.core.$strip>>;
|
|
414
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
export type ScalerReloadAnswer = z.infer<typeof scalerReloadAnswerSchema>;
|
|
417
|
+
/** One orchestrator's answer to a scaler reload, as `kici-admin scaler reload` reports it. */
|
|
418
|
+
export declare const scalerReloadInstanceResultSchema: z.ZodObject<{
|
|
419
|
+
outcome: z.ZodEnum<{
|
|
420
|
+
applied: "applied";
|
|
421
|
+
"not-configured": "not-configured";
|
|
422
|
+
rejected: "rejected";
|
|
423
|
+
unreachable: "unreachable";
|
|
424
|
+
}>;
|
|
425
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
426
|
+
added: z.ZodArray<z.ZodString>;
|
|
427
|
+
updated: z.ZodArray<z.ZodString>;
|
|
428
|
+
unchanged: z.ZodArray<z.ZodString>;
|
|
429
|
+
retired: z.ZodArray<z.ZodString>;
|
|
430
|
+
resurrected: z.ZodArray<z.ZodString>;
|
|
431
|
+
global: z.ZodArray<z.ZodString>;
|
|
432
|
+
}, z.core.$strip>>;
|
|
433
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
434
|
+
instanceId: z.ZodString;
|
|
435
|
+
role: z.ZodEnum<{
|
|
436
|
+
coordinator: "coordinator";
|
|
437
|
+
unknown: "unknown";
|
|
438
|
+
worker: "worker";
|
|
439
|
+
}>;
|
|
440
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
441
|
+
}, z.core.$strip>;
|
|
442
|
+
export type ScalerReloadInstanceResult = z.infer<typeof scalerReloadInstanceResultSchema>;
|
|
443
|
+
/**
|
|
444
|
+
* Scaler reload request: the orchestrator that received `kici-admin scaler
|
|
445
|
+
* reload` asks each connected peer to re-read its own scaler config. The peer
|
|
446
|
+
* answers with peer.scaler.reload.response.
|
|
447
|
+
*/
|
|
448
|
+
export declare const peerScalerReloadRequestSchema: z.ZodObject<{
|
|
449
|
+
type: z.ZodLiteral<"peer.scaler.reload.request">;
|
|
450
|
+
messageId: z.ZodString;
|
|
451
|
+
}, z.core.$strip>;
|
|
452
|
+
/** Scaler reload response: the peer's outcome, its plan when applied, its errors when rejected. */
|
|
453
|
+
export declare const peerScalerReloadResponseSchema: z.ZodObject<{
|
|
454
|
+
outcome: z.ZodEnum<{
|
|
455
|
+
applied: "applied";
|
|
456
|
+
"not-configured": "not-configured";
|
|
457
|
+
rejected: "rejected";
|
|
458
|
+
unreachable: "unreachable";
|
|
459
|
+
}>;
|
|
460
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
461
|
+
added: z.ZodArray<z.ZodString>;
|
|
462
|
+
updated: z.ZodArray<z.ZodString>;
|
|
463
|
+
unchanged: z.ZodArray<z.ZodString>;
|
|
464
|
+
retired: z.ZodArray<z.ZodString>;
|
|
465
|
+
resurrected: z.ZodArray<z.ZodString>;
|
|
466
|
+
global: z.ZodArray<z.ZodString>;
|
|
467
|
+
}, z.core.$strip>>;
|
|
468
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
469
|
+
type: z.ZodLiteral<"peer.scaler.reload.response">;
|
|
470
|
+
messageId: z.ZodString;
|
|
471
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
472
|
+
}, z.core.$strip>;
|
|
369
473
|
/**
|
|
370
474
|
* Config reload request: forwarded from one orchestrator to a specific peer
|
|
371
475
|
* when an operator calls POST /admin/config/reload with a `target` parameter.
|
|
@@ -389,6 +493,23 @@ export declare const peerConfigReloadResponseSchema: z.ZodObject<{
|
|
|
389
493
|
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
390
494
|
restartRequired: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
391
495
|
fieldsChanged: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
496
|
+
scaler: z.ZodOptional<z.ZodObject<{
|
|
497
|
+
outcome: z.ZodEnum<{
|
|
498
|
+
applied: "applied";
|
|
499
|
+
"not-configured": "not-configured";
|
|
500
|
+
rejected: "rejected";
|
|
501
|
+
unreachable: "unreachable";
|
|
502
|
+
}>;
|
|
503
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
504
|
+
added: z.ZodArray<z.ZodString>;
|
|
505
|
+
updated: z.ZodArray<z.ZodString>;
|
|
506
|
+
unchanged: z.ZodArray<z.ZodString>;
|
|
507
|
+
retired: z.ZodArray<z.ZodString>;
|
|
508
|
+
resurrected: z.ZodArray<z.ZodString>;
|
|
509
|
+
global: z.ZodArray<z.ZodString>;
|
|
510
|
+
}, z.core.$strip>>;
|
|
511
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
512
|
+
}, z.core.$strip>>;
|
|
392
513
|
}, z.core.$strip>;
|
|
393
514
|
/** How a live Firecracker VM relates to the orchestrator on its host. */
|
|
394
515
|
export declare const ScalerVmStatus: z.ZodEnum<{
|
|
@@ -568,7 +689,8 @@ export declare const peerForgetResponseSchema: z.ZodObject<{
|
|
|
568
689
|
*/
|
|
569
690
|
export declare const workerClusterSettingsSchema: z.ZodObject<{
|
|
570
691
|
agentTokenTtlMs: z.ZodNumber;
|
|
571
|
-
firecrackerApiSocketWaitMs: z.
|
|
692
|
+
firecrackerApiSocketWaitMs: z.ZodNumber;
|
|
693
|
+
concurrencyWaitTimeoutMs: z.ZodNumber;
|
|
572
694
|
}, z.core.$strip>;
|
|
573
695
|
/**
|
|
574
696
|
* Cluster-settings pull request: a DB-less worker asks a connected coordinator
|
|
@@ -590,7 +712,8 @@ export declare const peerClusterSettingsResponseSchema: z.ZodObject<{
|
|
|
590
712
|
version: z.ZodNumber;
|
|
591
713
|
settings: z.ZodObject<{
|
|
592
714
|
agentTokenTtlMs: z.ZodNumber;
|
|
593
|
-
firecrackerApiSocketWaitMs: z.
|
|
715
|
+
firecrackerApiSocketWaitMs: z.ZodNumber;
|
|
716
|
+
concurrencyWaitTimeoutMs: z.ZodNumber;
|
|
594
717
|
}, z.core.$strip>;
|
|
595
718
|
}, z.core.$strip>;
|
|
596
719
|
/** Which of THIS peer's downstream nodes to gather. all=true ignores the id lists. */
|
|
@@ -668,7 +791,7 @@ export declare const peerScalerEventSchema: z.ZodObject<{
|
|
|
668
791
|
final: z.ZodOptional<z.ZodBoolean>;
|
|
669
792
|
}, z.core.$strip>;
|
|
670
793
|
/** All peer-to-peer messages (outbound from this node). */
|
|
671
|
-
export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
794
|
+
export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
672
795
|
type: z.ZodLiteral<"peer.hello">;
|
|
673
796
|
ephemeralPublicKey: z.ZodString;
|
|
674
797
|
nonce: z.ZodString;
|
|
@@ -808,10 +931,10 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
808
931
|
}, z.core.$strip>], "kind">>>;
|
|
809
932
|
triedConnections: z.ZodArray<z.ZodString>;
|
|
810
933
|
maxHops: z.ZodNumber;
|
|
811
|
-
spawnRetry: z.
|
|
934
|
+
spawnRetry: z.ZodObject<{
|
|
812
935
|
maxAttempts: z.ZodNumber;
|
|
813
936
|
backoffMs: z.ZodNumber;
|
|
814
|
-
}, z.core.$strip
|
|
937
|
+
}, z.core.$strip>;
|
|
815
938
|
coordinatorId: z.ZodString;
|
|
816
939
|
requestId: z.ZodOptional<z.ZodString>;
|
|
817
940
|
traceId: z.ZodOptional<z.ZodString>;
|
|
@@ -908,10 +1031,10 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
908
1031
|
lines: z.ZodArray<z.ZodObject<{
|
|
909
1032
|
text: z.ZodString;
|
|
910
1033
|
timestamp: z.ZodNumber;
|
|
911
|
-
stream: z.
|
|
1034
|
+
stream: z.ZodEnum<{
|
|
912
1035
|
stderr: "stderr";
|
|
913
1036
|
stdout: "stdout";
|
|
914
|
-
}
|
|
1037
|
+
}>;
|
|
915
1038
|
}, z.core.$strip>>;
|
|
916
1039
|
}, z.core.$strip>, z.ZodObject<{
|
|
917
1040
|
type: z.ZodLiteral<"peer.cache.upload.request">;
|
|
@@ -942,6 +1065,23 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
942
1065
|
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
943
1066
|
restartRequired: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
944
1067
|
fieldsChanged: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1068
|
+
scaler: z.ZodOptional<z.ZodObject<{
|
|
1069
|
+
outcome: z.ZodEnum<{
|
|
1070
|
+
applied: "applied";
|
|
1071
|
+
"not-configured": "not-configured";
|
|
1072
|
+
rejected: "rejected";
|
|
1073
|
+
unreachable: "unreachable";
|
|
1074
|
+
}>;
|
|
1075
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
1076
|
+
added: z.ZodArray<z.ZodString>;
|
|
1077
|
+
updated: z.ZodArray<z.ZodString>;
|
|
1078
|
+
unchanged: z.ZodArray<z.ZodString>;
|
|
1079
|
+
retired: z.ZodArray<z.ZodString>;
|
|
1080
|
+
resurrected: z.ZodArray<z.ZodString>;
|
|
1081
|
+
global: z.ZodArray<z.ZodString>;
|
|
1082
|
+
}, z.core.$strip>>;
|
|
1083
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1084
|
+
}, z.core.$strip>>;
|
|
945
1085
|
}, z.core.$strip>, z.ZodObject<{
|
|
946
1086
|
type: z.ZodLiteral<"peer.scaler.orphans.request">;
|
|
947
1087
|
messageId: z.ZodString;
|
|
@@ -989,6 +1129,28 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
989
1129
|
pid: z.ZodOptional<z.ZodNumber>;
|
|
990
1130
|
detail: z.ZodString;
|
|
991
1131
|
}, z.core.$strip>>>;
|
|
1132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1133
|
+
type: z.ZodLiteral<"peer.scaler.reload.request">;
|
|
1134
|
+
messageId: z.ZodString;
|
|
1135
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1136
|
+
outcome: z.ZodEnum<{
|
|
1137
|
+
applied: "applied";
|
|
1138
|
+
"not-configured": "not-configured";
|
|
1139
|
+
rejected: "rejected";
|
|
1140
|
+
unreachable: "unreachable";
|
|
1141
|
+
}>;
|
|
1142
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
1143
|
+
added: z.ZodArray<z.ZodString>;
|
|
1144
|
+
updated: z.ZodArray<z.ZodString>;
|
|
1145
|
+
unchanged: z.ZodArray<z.ZodString>;
|
|
1146
|
+
retired: z.ZodArray<z.ZodString>;
|
|
1147
|
+
resurrected: z.ZodArray<z.ZodString>;
|
|
1148
|
+
global: z.ZodArray<z.ZodString>;
|
|
1149
|
+
}, z.core.$strip>>;
|
|
1150
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1151
|
+
type: z.ZodLiteral<"peer.scaler.reload.response">;
|
|
1152
|
+
messageId: z.ZodString;
|
|
1153
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
992
1154
|
}, z.core.$strip>, z.ZodObject<{
|
|
993
1155
|
type: z.ZodLiteral<"peer.forget.request">;
|
|
994
1156
|
messageId: z.ZodString;
|
|
@@ -1015,7 +1177,8 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1015
1177
|
version: z.ZodNumber;
|
|
1016
1178
|
settings: z.ZodObject<{
|
|
1017
1179
|
agentTokenTtlMs: z.ZodNumber;
|
|
1018
|
-
firecrackerApiSocketWaitMs: z.
|
|
1180
|
+
firecrackerApiSocketWaitMs: z.ZodNumber;
|
|
1181
|
+
concurrencyWaitTimeoutMs: z.ZodNumber;
|
|
1019
1182
|
}, z.core.$strip>;
|
|
1020
1183
|
}, z.core.$strip>, z.ZodObject<{
|
|
1021
1184
|
type: z.ZodLiteral<"peer.logs.collect.request">;
|
|
@@ -1062,7 +1225,7 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1062
1225
|
final: z.ZodOptional<z.ZodBoolean>;
|
|
1063
1226
|
}, z.core.$strip>], "type">;
|
|
1064
1227
|
/** All peer-to-peer messages (inbound to this node). */
|
|
1065
|
-
export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1228
|
+
export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
1066
1229
|
type: z.ZodLiteral<"peer.hello">;
|
|
1067
1230
|
ephemeralPublicKey: z.ZodString;
|
|
1068
1231
|
nonce: z.ZodString;
|
|
@@ -1202,10 +1365,10 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
1202
1365
|
}, z.core.$strip>], "kind">>>;
|
|
1203
1366
|
triedConnections: z.ZodArray<z.ZodString>;
|
|
1204
1367
|
maxHops: z.ZodNumber;
|
|
1205
|
-
spawnRetry: z.
|
|
1368
|
+
spawnRetry: z.ZodObject<{
|
|
1206
1369
|
maxAttempts: z.ZodNumber;
|
|
1207
1370
|
backoffMs: z.ZodNumber;
|
|
1208
|
-
}, z.core.$strip
|
|
1371
|
+
}, z.core.$strip>;
|
|
1209
1372
|
coordinatorId: z.ZodString;
|
|
1210
1373
|
requestId: z.ZodOptional<z.ZodString>;
|
|
1211
1374
|
traceId: z.ZodOptional<z.ZodString>;
|
|
@@ -1302,10 +1465,10 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
1302
1465
|
lines: z.ZodArray<z.ZodObject<{
|
|
1303
1466
|
text: z.ZodString;
|
|
1304
1467
|
timestamp: z.ZodNumber;
|
|
1305
|
-
stream: z.
|
|
1468
|
+
stream: z.ZodEnum<{
|
|
1306
1469
|
stderr: "stderr";
|
|
1307
1470
|
stdout: "stdout";
|
|
1308
|
-
}
|
|
1471
|
+
}>;
|
|
1309
1472
|
}, z.core.$strip>>;
|
|
1310
1473
|
}, z.core.$strip>, z.ZodObject<{
|
|
1311
1474
|
type: z.ZodLiteral<"peer.cache.upload.request">;
|
|
@@ -1336,6 +1499,23 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
1336
1499
|
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1337
1500
|
restartRequired: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1338
1501
|
fieldsChanged: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1502
|
+
scaler: z.ZodOptional<z.ZodObject<{
|
|
1503
|
+
outcome: z.ZodEnum<{
|
|
1504
|
+
applied: "applied";
|
|
1505
|
+
"not-configured": "not-configured";
|
|
1506
|
+
rejected: "rejected";
|
|
1507
|
+
unreachable: "unreachable";
|
|
1508
|
+
}>;
|
|
1509
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
1510
|
+
added: z.ZodArray<z.ZodString>;
|
|
1511
|
+
updated: z.ZodArray<z.ZodString>;
|
|
1512
|
+
unchanged: z.ZodArray<z.ZodString>;
|
|
1513
|
+
retired: z.ZodArray<z.ZodString>;
|
|
1514
|
+
resurrected: z.ZodArray<z.ZodString>;
|
|
1515
|
+
global: z.ZodArray<z.ZodString>;
|
|
1516
|
+
}, z.core.$strip>>;
|
|
1517
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1518
|
+
}, z.core.$strip>>;
|
|
1339
1519
|
}, z.core.$strip>, z.ZodObject<{
|
|
1340
1520
|
type: z.ZodLiteral<"peer.scaler.orphans.request">;
|
|
1341
1521
|
messageId: z.ZodString;
|
|
@@ -1383,6 +1563,28 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
1383
1563
|
pid: z.ZodOptional<z.ZodNumber>;
|
|
1384
1564
|
detail: z.ZodString;
|
|
1385
1565
|
}, z.core.$strip>>>;
|
|
1566
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1567
|
+
type: z.ZodLiteral<"peer.scaler.reload.request">;
|
|
1568
|
+
messageId: z.ZodString;
|
|
1569
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1570
|
+
outcome: z.ZodEnum<{
|
|
1571
|
+
applied: "applied";
|
|
1572
|
+
"not-configured": "not-configured";
|
|
1573
|
+
rejected: "rejected";
|
|
1574
|
+
unreachable: "unreachable";
|
|
1575
|
+
}>;
|
|
1576
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
1577
|
+
added: z.ZodArray<z.ZodString>;
|
|
1578
|
+
updated: z.ZodArray<z.ZodString>;
|
|
1579
|
+
unchanged: z.ZodArray<z.ZodString>;
|
|
1580
|
+
retired: z.ZodArray<z.ZodString>;
|
|
1581
|
+
resurrected: z.ZodArray<z.ZodString>;
|
|
1582
|
+
global: z.ZodArray<z.ZodString>;
|
|
1583
|
+
}, z.core.$strip>>;
|
|
1584
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1585
|
+
type: z.ZodLiteral<"peer.scaler.reload.response">;
|
|
1586
|
+
messageId: z.ZodString;
|
|
1587
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
1386
1588
|
}, z.core.$strip>, z.ZodObject<{
|
|
1387
1589
|
type: z.ZodLiteral<"peer.forget.request">;
|
|
1388
1590
|
messageId: z.ZodString;
|
|
@@ -1409,7 +1611,8 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
1409
1611
|
version: z.ZodNumber;
|
|
1410
1612
|
settings: z.ZodObject<{
|
|
1411
1613
|
agentTokenTtlMs: z.ZodNumber;
|
|
1412
|
-
firecrackerApiSocketWaitMs: z.
|
|
1614
|
+
firecrackerApiSocketWaitMs: z.ZodNumber;
|
|
1615
|
+
concurrencyWaitTimeoutMs: z.ZodNumber;
|
|
1413
1616
|
}, z.core.$strip>;
|
|
1414
1617
|
}, z.core.$strip>, z.ZodObject<{
|
|
1415
1618
|
type: z.ZodLiteral<"peer.logs.collect.request">;
|
|
@@ -1477,6 +1680,8 @@ export type PeerConfigReload = z.infer<typeof peerConfigReloadSchema>;
|
|
|
1477
1680
|
export type PeerConfigReloadResponse = z.infer<typeof peerConfigReloadResponseSchema>;
|
|
1478
1681
|
export type PeerScalerOrphansRequest = z.infer<typeof peerScalerOrphansRequestSchema>;
|
|
1479
1682
|
export type PeerScalerOrphansResponse = z.infer<typeof peerScalerOrphansResponseSchema>;
|
|
1683
|
+
export type PeerScalerReloadRequest = z.infer<typeof peerScalerReloadRequestSchema>;
|
|
1684
|
+
export type PeerScalerReloadResponse = z.infer<typeof peerScalerReloadResponseSchema>;
|
|
1480
1685
|
export type PeerForgetRequest = z.infer<typeof peerForgetRequestSchema>;
|
|
1481
1686
|
export type PeerForgetResponse = z.infer<typeof peerForgetResponseSchema>;
|
|
1482
1687
|
export type WorkerClusterSettings = z.infer<typeof workerClusterSettingsSchema>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { LogStream } from "./log-stream.js";
|
|
2
3
|
import { ExecutionJobStatus } from "./execution-status.js";
|
|
3
4
|
import { LabelMatcher } from "../../labels-match.js";
|
|
4
|
-
import { LogStream } from "./log-stream.js";
|
|
5
5
|
import { ScalerEventType } from "./scaler-event.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/protocol/messages/peer.ts
|
|
@@ -140,13 +140,13 @@ const peerHeartbeatSchema = z.object({
|
|
|
140
140
|
draining: z.boolean(),
|
|
141
141
|
agents: z.array(peerAgentSummarySchema),
|
|
142
142
|
capabilities: peerCapabilitiesSchema,
|
|
143
|
-
/**
|
|
143
|
+
/** Scaler capacity data for on-demand backends. */
|
|
144
144
|
scalerCapacity: z.array(scalerCapacitySummarySchema).optional(),
|
|
145
|
-
/** Shared config version for cross-orchestrator config sync
|
|
145
|
+
/** Shared config version for cross-orchestrator config sync. */
|
|
146
146
|
configVersion: z.number().optional(),
|
|
147
|
-
/** Registry version for cross-orchestrator registration sync
|
|
147
|
+
/** Registry version for cross-orchestrator registration sync. */
|
|
148
148
|
registryVersion: z.number().optional(),
|
|
149
|
-
/** Cluster-settings version for the coordinator→worker settings pull
|
|
149
|
+
/** Cluster-settings version for the coordinator→worker settings pull. */
|
|
150
150
|
clusterSettingsVersion: z.number().optional(),
|
|
151
151
|
timestamp: z.number(),
|
|
152
152
|
hostname: z.string().optional(),
|
|
@@ -193,7 +193,7 @@ const jobRerouteSchema = z.object({
|
|
|
193
193
|
jobName: z.string(),
|
|
194
194
|
workflowName: z.string(),
|
|
195
195
|
runsOnLabels: z.array(z.array(z.string())),
|
|
196
|
-
/** Labels that the dispatched agent must NOT have
|
|
196
|
+
/** Labels that the dispatched agent must NOT have. Absent is `[]`. */
|
|
197
197
|
excludeLabels: z.array(z.string()).optional(),
|
|
198
198
|
/**
|
|
199
199
|
* Glob/regex include matchers the receiving peer's agent labels must
|
|
@@ -207,11 +207,8 @@ const jobRerouteSchema = z.object({
|
|
|
207
207
|
excludePatterns: z.array(LabelMatcher).optional(),
|
|
208
208
|
triedConnections: z.array(z.string()),
|
|
209
209
|
maxHops: z.number(),
|
|
210
|
-
/**
|
|
211
|
-
|
|
212
|
-
* the worker applies its own configured default.
|
|
213
|
-
*/
|
|
214
|
-
spawnRetry: rerouteSpawnRetrySchema.optional(),
|
|
210
|
+
/** The worker's spawn-retry budget for this job. */
|
|
211
|
+
spawnRetry: rerouteSpawnRetrySchema,
|
|
215
212
|
coordinatorId: z.string(),
|
|
216
213
|
requestId: z.string().optional(),
|
|
217
214
|
traceId: z.string().optional(),
|
|
@@ -334,7 +331,7 @@ const peerLogChunkSchema = z.object({
|
|
|
334
331
|
lines: z.array(z.object({
|
|
335
332
|
text: z.string(),
|
|
336
333
|
timestamp: z.number(),
|
|
337
|
-
stream: LogStream
|
|
334
|
+
stream: LogStream
|
|
338
335
|
}))
|
|
339
336
|
});
|
|
340
337
|
/** Cache upload request: worker -> coordinator. Worker agent needs upload URL. */
|
|
@@ -356,6 +353,65 @@ const peerCacheUploadResponseSchema = z.object({
|
|
|
356
353
|
uploadUrl: z.string()
|
|
357
354
|
});
|
|
358
355
|
/**
|
|
356
|
+
* What a scaler config reload did on one orchestrator. `rejected`: the file did
|
|
357
|
+
* not load or validate, or an added scaler did not build, and nothing applied.
|
|
358
|
+
* `not-configured`: the orchestrator runs without a scaler config, so there is
|
|
359
|
+
* nothing to reload. `unreachable`: the request did not reach the orchestrator,
|
|
360
|
+
* or it did not answer in time.
|
|
361
|
+
*/
|
|
362
|
+
const ScalerReloadOutcome = z.enum([
|
|
363
|
+
"applied",
|
|
364
|
+
"rejected",
|
|
365
|
+
"not-configured",
|
|
366
|
+
"unreachable"
|
|
367
|
+
]);
|
|
368
|
+
/**
|
|
369
|
+
* What an applied scaler reload changed, as scaler names per bucket. `updated`
|
|
370
|
+
* holds the kept scalers whose entry changed and `unchanged` the rest of them;
|
|
371
|
+
* `global` names the changed top-level limits (`globalMaxAgents`,
|
|
372
|
+
* `globalResourceCap`).
|
|
373
|
+
*/
|
|
374
|
+
const scalerReloadPlanSchema = z.object({
|
|
375
|
+
added: z.array(z.string()),
|
|
376
|
+
updated: z.array(z.string()),
|
|
377
|
+
unchanged: z.array(z.string()),
|
|
378
|
+
retired: z.array(z.string()),
|
|
379
|
+
resurrected: z.array(z.string()),
|
|
380
|
+
global: z.array(z.string())
|
|
381
|
+
});
|
|
382
|
+
/** One orchestrator's scaler reload outcome, its plan when applied, its errors when refused. */
|
|
383
|
+
const scalerReloadAnswerSchema = z.object({
|
|
384
|
+
outcome: ScalerReloadOutcome,
|
|
385
|
+
plan: scalerReloadPlanSchema.optional(),
|
|
386
|
+
errors: z.array(z.string()).optional()
|
|
387
|
+
});
|
|
388
|
+
/** One orchestrator's answer to a scaler reload, as `kici-admin scaler reload` reports it. */
|
|
389
|
+
const scalerReloadInstanceResultSchema = scalerReloadAnswerSchema.extend({
|
|
390
|
+
instanceId: z.string(),
|
|
391
|
+
role: z.enum([
|
|
392
|
+
"coordinator",
|
|
393
|
+
"worker",
|
|
394
|
+
"unknown"
|
|
395
|
+
]),
|
|
396
|
+
/** Why the outcome is what it is, for an instance that was not reached or did not answer. */
|
|
397
|
+
detail: z.string().optional()
|
|
398
|
+
});
|
|
399
|
+
/**
|
|
400
|
+
* Scaler reload request: the orchestrator that received `kici-admin scaler
|
|
401
|
+
* reload` asks each connected peer to re-read its own scaler config. The peer
|
|
402
|
+
* answers with peer.scaler.reload.response.
|
|
403
|
+
*/
|
|
404
|
+
const peerScalerReloadRequestSchema = z.object({
|
|
405
|
+
type: z.literal("peer.scaler.reload.request"),
|
|
406
|
+
messageId: z.string()
|
|
407
|
+
});
|
|
408
|
+
/** Scaler reload response: the peer's outcome, its plan when applied, its errors when rejected. */
|
|
409
|
+
const peerScalerReloadResponseSchema = scalerReloadAnswerSchema.extend({
|
|
410
|
+
type: z.literal("peer.scaler.reload.response"),
|
|
411
|
+
messageId: z.string(),
|
|
412
|
+
detail: z.string().optional()
|
|
413
|
+
});
|
|
414
|
+
/**
|
|
359
415
|
* Config reload request: forwarded from one orchestrator to a specific peer
|
|
360
416
|
* when an operator calls POST /admin/config/reload with a `target` parameter.
|
|
361
417
|
* The receiving peer executes a local reload and replies with
|
|
@@ -378,7 +434,9 @@ const peerConfigReloadResponseSchema = z.object({
|
|
|
378
434
|
version: z.number().optional(),
|
|
379
435
|
errors: z.array(z.string()).optional(),
|
|
380
436
|
restartRequired: z.array(z.string()).optional(),
|
|
381
|
-
fieldsChanged: z.array(z.string()).optional()
|
|
437
|
+
fieldsChanged: z.array(z.string()).optional(),
|
|
438
|
+
/** The target peer's scaler config reload outcome, when it runs a scaler config. */
|
|
439
|
+
scaler: scalerReloadAnswerSchema.optional()
|
|
382
440
|
});
|
|
383
441
|
/** How a live Firecracker VM relates to the orchestrator on its host. */
|
|
384
442
|
const ScalerVmStatus = z.enum([
|
|
@@ -498,12 +556,13 @@ const peerForgetResponseSchema = z.object({
|
|
|
498
556
|
*/
|
|
499
557
|
const workerClusterSettingsSchema = z.object({
|
|
500
558
|
agentTokenTtlMs: z.number(),
|
|
559
|
+
/** How long a Firecracker spawn waits for the VM's API socket. */
|
|
560
|
+
firecrackerApiSocketWaitMs: z.number(),
|
|
501
561
|
/**
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
* configured default.
|
|
562
|
+
* The concurrency-slot wait timeout a worker sends on each `job.dispatch`,
|
|
563
|
+
* from `cluster_settings.concurrency_wait_timeout_ms`.
|
|
505
564
|
*/
|
|
506
|
-
|
|
565
|
+
concurrencyWaitTimeoutMs: z.number()
|
|
507
566
|
});
|
|
508
567
|
/**
|
|
509
568
|
* Cluster-settings pull request: a DB-less worker asks a connected coordinator
|
|
@@ -598,13 +657,16 @@ const peerScalerEventSchema = z.object({
|
|
|
598
657
|
/**
|
|
599
658
|
* The worker's retry verdict on a `scaler.failed` for a job under its spawn-retry
|
|
600
659
|
* budget: false while attempts remain, true on the last one. Absent on a repeated
|
|
601
|
-
* report of one failed spawn
|
|
602
|
-
*
|
|
660
|
+
* report of one failed spawn and on every other relay; the coordinator then keeps
|
|
661
|
+
* its spawn window running unchanged.
|
|
603
662
|
*/
|
|
604
663
|
final: z.boolean().optional()
|
|
605
664
|
});
|
|
606
|
-
/**
|
|
607
|
-
|
|
665
|
+
/**
|
|
666
|
+
* Every peer message type. Both directions carry the same set: each node sends
|
|
667
|
+
* and receives every type, so one list backs both unions.
|
|
668
|
+
*/
|
|
669
|
+
const peerMessageSchemas = [
|
|
608
670
|
peerHelloSchema,
|
|
609
671
|
peerHelloResponseSchema,
|
|
610
672
|
peerAuthRequestSchema,
|
|
@@ -625,6 +687,8 @@ const peerToPeerMessageSchema = z.discriminatedUnion("type", [
|
|
|
625
687
|
peerConfigReloadResponseSchema,
|
|
626
688
|
peerScalerOrphansRequestSchema,
|
|
627
689
|
peerScalerOrphansResponseSchema,
|
|
690
|
+
peerScalerReloadRequestSchema,
|
|
691
|
+
peerScalerReloadResponseSchema,
|
|
628
692
|
peerForgetRequestSchema,
|
|
629
693
|
peerForgetResponseSchema,
|
|
630
694
|
peerClusterSettingsRequestSchema,
|
|
@@ -635,41 +699,12 @@ const peerToPeerMessageSchema = z.discriminatedUnion("type", [
|
|
|
635
699
|
peerLeavingSchema,
|
|
636
700
|
peerAgentTokenRevokeSchema,
|
|
637
701
|
peerScalerEventSchema
|
|
638
|
-
]
|
|
702
|
+
];
|
|
703
|
+
/** All peer-to-peer messages (outbound from this node). */
|
|
704
|
+
const peerToPeerMessageSchema = z.discriminatedUnion("type", peerMessageSchemas);
|
|
639
705
|
/** All peer-to-peer messages (inbound to this node). */
|
|
640
|
-
const peerFromPeerMessageSchema = z.discriminatedUnion("type",
|
|
641
|
-
peerHelloSchema,
|
|
642
|
-
peerHelloResponseSchema,
|
|
643
|
-
peerAuthRequestSchema,
|
|
644
|
-
peerAuthResponseSchema,
|
|
645
|
-
peerHeartbeatSchema,
|
|
646
|
-
jobRerouteSchema,
|
|
647
|
-
jobRerouteAckSchema,
|
|
648
|
-
jobProgressSchema,
|
|
649
|
-
jobProgressAckSchema,
|
|
650
|
-
peerJobCancelSchema,
|
|
651
|
-
raftVoteRequestSchema,
|
|
652
|
-
raftVoteResponseSchema,
|
|
653
|
-
raftAppendEntriesSchema,
|
|
654
|
-
peerLogChunkSchema,
|
|
655
|
-
peerCacheUploadRequestSchema,
|
|
656
|
-
peerCacheUploadResponseSchema,
|
|
657
|
-
peerConfigReloadSchema,
|
|
658
|
-
peerConfigReloadResponseSchema,
|
|
659
|
-
peerScalerOrphansRequestSchema,
|
|
660
|
-
peerScalerOrphansResponseSchema,
|
|
661
|
-
peerForgetRequestSchema,
|
|
662
|
-
peerForgetResponseSchema,
|
|
663
|
-
peerClusterSettingsRequestSchema,
|
|
664
|
-
peerClusterSettingsResponseSchema,
|
|
665
|
-
peerLogsCollectRequestSchema,
|
|
666
|
-
peerLogsCollectChunkSchema,
|
|
667
|
-
peerLogsCollectErrorSchema,
|
|
668
|
-
peerLeavingSchema,
|
|
669
|
-
peerAgentTokenRevokeSchema,
|
|
670
|
-
peerScalerEventSchema
|
|
671
|
-
]);
|
|
706
|
+
const peerFromPeerMessageSchema = z.discriminatedUnion("type", peerMessageSchemas);
|
|
672
707
|
//#endregion
|
|
673
|
-
export { PEER_MUTUAL_AUTH_REQUIRED_REASON, PeerAuthMode, PeerAuthScheme, PeerForgetOutcome, ScalerOrphansAction, ScalerVmStatus, ScalerVmStopOutcome, ScalerVmTracker, fleetSelectionSchema, jobProgressAckSchema, jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerClusterSettingsRequestSchema, peerClusterSettingsResponseSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerForgetRequestSchema, peerForgetResponseSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerScalerOrphansRequestSchema, peerScalerOrphansResponseSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, rerouteSpawnRetrySchema, scalerLiveVmSchema, scalerVmStopResultSchema, workerClusterSettingsSchema };
|
|
708
|
+
export { PEER_MUTUAL_AUTH_REQUIRED_REASON, PeerAuthMode, PeerAuthScheme, PeerForgetOutcome, ScalerOrphansAction, ScalerReloadOutcome, ScalerVmStatus, ScalerVmStopOutcome, ScalerVmTracker, fleetSelectionSchema, jobProgressAckSchema, jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerClusterSettingsRequestSchema, peerClusterSettingsResponseSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerForgetRequestSchema, peerForgetResponseSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerScalerOrphansRequestSchema, peerScalerOrphansResponseSchema, peerScalerReloadRequestSchema, peerScalerReloadResponseSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, rerouteSpawnRetrySchema, scalerLiveVmSchema, scalerReloadAnswerSchema, scalerReloadInstanceResultSchema, scalerReloadPlanSchema, scalerVmStopResultSchema, workerClusterSettingsSchema };
|
|
674
709
|
|
|
675
710
|
//# sourceMappingURL=peer.js.map
|