@kici-dev/engine 0.1.15 → 0.1.17
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/types.d.ts +56 -0
- package/dist/approval/types.js +42 -0
- package/dist/audit/access-log-policy.js +5 -1
- package/dist/audit/activity.js +1 -1
- package/dist/audit/retention-policy.js +9 -1
- package/dist/bundler/index.js +1 -1
- package/dist/bundler/rolldown-config.js +1 -1
- package/dist/env/environment-allowlist.js +1 -1
- package/dist/environment/index.js +1 -1
- package/dist/environment/scope-resolver.js +1 -1
- package/dist/environment/types.d.ts +8 -0
- package/dist/environment/types.js +1 -1
- package/dist/fanout/materialize.d.ts +67 -0
- package/dist/fanout/materialize.js +119 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +10 -8
- package/dist/labels.js +1 -1
- package/dist/matrix/expand.d.ts +43 -0
- package/dist/matrix/expand.js +66 -0
- package/dist/matrix/format.d.ts +10 -0
- package/dist/matrix/format.js +19 -0
- package/dist/metrics/catalog-policy.js +8 -3
- package/dist/metrics/metric-catalog.generated.d.ts +1 -1
- package/dist/metrics/metric-catalog.generated.js +2 -2
- package/dist/protocol/analytics-events.js +1 -1
- package/dist/protocol/cluster-name.js +1 -1
- package/dist/protocol/dashboard-global-workflows.js +1 -1
- package/dist/protocol/dashboard-write-operations.js +1 -1
- package/dist/protocol/event-log-payload.js +1 -1
- package/dist/protocol/messages/access-log.d.ts +25 -5
- package/dist/protocol/messages/access-log.js +5 -1
- package/dist/protocol/messages/actor.js +1 -1
- package/dist/protocol/messages/auth.d.ts +1 -0
- package/dist/protocol/messages/auth.js +11 -2
- package/dist/protocol/messages/browser.js +1 -1
- package/dist/protocol/messages/capabilities.js +1 -1
- package/dist/protocol/messages/common.js +1 -1
- package/dist/protocol/messages/dashboard-global-workflows.js +1 -1
- package/dist/protocol/messages/dashboard.d.ts +1030 -50
- package/dist/protocol/messages/dashboard.js +377 -7
- package/dist/protocol/messages/event-log.js +1 -1
- package/dist/protocol/messages/execution-status.d.ts +13 -1
- package/dist/protocol/messages/execution-status.js +13 -3
- package/dist/protocol/messages/join.js +1 -1
- package/dist/protocol/messages/log-pull.js +1 -1
- package/dist/protocol/messages/observe.d.ts +1 -0
- package/dist/protocol/messages/oidc-token-relay.d.ts +31 -0
- package/dist/protocol/messages/oidc-token-relay.js +34 -0
- package/dist/protocol/messages/orchestrator-agent.d.ts +161 -0
- package/dist/protocol/messages/orchestrator-agent.js +117 -4
- package/dist/protocol/messages/peer.d.ts +76 -0
- package/dist/protocol/messages/peer.js +37 -2
- package/dist/protocol/messages/platform-orchestrator.d.ts +187 -10
- package/dist/protocol/messages/platform-orchestrator.js +13 -2
- package/dist/protocol/messages/run-events.js +1 -1
- package/dist/protocol/messages/scaler-event.js +1 -1
- package/dist/protocol/messages/source-registration.d.ts +7 -6
- package/dist/protocol/messages/source-registration.js +7 -6
- package/dist/protocol/version.js +1 -1
- package/dist/provenance/bundle.d.ts +54 -0
- package/dist/provenance/bundle.js +53 -0
- package/dist/provenance/dsse.d.ts +39 -0
- package/dist/provenance/dsse.js +53 -0
- package/dist/provenance/schema.d.ts +407 -0
- package/dist/provenance/schema.js +143 -0
- package/dist/provenance/verify.d.ts +71 -0
- package/dist/provenance/verify.js +135 -0
- package/dist/provider/changed-files-fetcher.js +1 -1
- package/dist/provider/check-run-conclusion.js +1 -1
- package/dist/provider/check-status-poster.js +1 -1
- package/dist/provider/clone-token-provider.js +1 -1
- package/dist/provider/contributor-resolver.js +1 -1
- package/dist/provider/index.js +1 -1
- package/dist/provider/lock-file-fetcher.js +1 -1
- package/dist/provider/lock-file-parse-error.js +3 -1
- package/dist/provider/repo-url-builder.js +1 -1
- package/dist/provider/types.d.ts +2 -2
- package/dist/provider/types.js +1 -1
- package/dist/provider/webhook-normalizer.js +1 -1
- package/dist/registration/registerable-trigger-type.js +1 -1
- package/dist/scaler/resource-types.js +1 -1
- package/dist/scaler/scaler-backend-type.js +1 -1
- package/dist/secrets/index.js +1 -1
- package/dist/secrets/types.js +1 -1
- package/dist/state-machine/index.js +1 -1
- package/dist/state-machine/machine.js +1 -1
- package/dist/state-machine/types.js +1 -1
- package/dist/trigger/decision-trace.js +1 -1
- package/dist/trigger/jsonpath-matcher.js +1 -1
- package/dist/trigger/matcher.js +1 -1
- package/dist/trigger/trigger-event-type.js +1 -1
- package/dist/trigger/types.d.ts +34 -1
- package/dist/trigger/types.js +14 -5
- package/dist/webhook/signature.js +1 -1
- package/dist/ws/close-codes.js +1 -1
- package/dist/ws/rate-limiter.js +3 -1
- package/dist/ws/ws-like.js +1 -1
- package/package.json +23 -1
- package/sbom.spdx.json +55 -5
- package/dist/protocol/messages/observe.js +0 -70
- package/dist/protocol/messages/test-run.js +0 -52
- /package/dist/{chunk-gOLHoazu.js → chunk-BTugEXQM.js} +0 -0
|
@@ -352,6 +352,28 @@ export declare const cacheUserSaveCompleteSchema: z.ZodObject<{
|
|
|
352
352
|
tarHash: z.ZodString;
|
|
353
353
|
sizeBytes: z.ZodNumber;
|
|
354
354
|
}, z.core.$strip>;
|
|
355
|
+
/** Agent -> Orchestrator: request a presigned PUT URL for a provenance bundle. */
|
|
356
|
+
export declare const provenanceUploadRequestSchema: z.ZodObject<{
|
|
357
|
+
type: z.ZodLiteral<"provenance.upload.request">;
|
|
358
|
+
messageId: z.ZodString;
|
|
359
|
+
jobId: z.ZodString;
|
|
360
|
+
subjectDigest: z.ZodString;
|
|
361
|
+
}, z.core.$strip>;
|
|
362
|
+
/** Orchestrator -> Agent: presigned PUT URL for the provenance bundle. */
|
|
363
|
+
export declare const provenanceUploadResponseSchema: z.ZodObject<{
|
|
364
|
+
type: z.ZodLiteral<"provenance.upload.response">;
|
|
365
|
+
requestId: z.ZodString;
|
|
366
|
+
uploadUrl: z.ZodString;
|
|
367
|
+
}, z.core.$strip>;
|
|
368
|
+
/** Agent -> Orchestrator: confirm a provenance bundle upload (records an attestations row). */
|
|
369
|
+
export declare const provenanceUploadCompleteSchema: z.ZodObject<{
|
|
370
|
+
type: z.ZodLiteral<"provenance.upload.complete">;
|
|
371
|
+
messageId: z.ZodString;
|
|
372
|
+
jobId: z.ZodString;
|
|
373
|
+
subjectName: z.ZodString;
|
|
374
|
+
subjectDigest: z.ZodString;
|
|
375
|
+
mediaType: z.ZodString;
|
|
376
|
+
}, z.core.$strip>;
|
|
355
377
|
/** Agent -> Orchestrator: emit a custom event from a running workflow step. */
|
|
356
378
|
export declare const eventEmitSchema: z.ZodObject<{
|
|
357
379
|
type: z.ZodLiteral<"event.emit">;
|
|
@@ -424,6 +446,81 @@ export declare const agentApiResponseSchema: z.ZodObject<{
|
|
|
424
446
|
result: z.ZodOptional<z.ZodUnknown>;
|
|
425
447
|
error: z.ZodOptional<z.ZodString>;
|
|
426
448
|
}, z.core.$strip>;
|
|
449
|
+
/** Orchestrator asks an agent for its log/diagnostic mini-bundle. */
|
|
450
|
+
export declare const fleetLogsRequestSchema: z.ZodObject<{
|
|
451
|
+
type: z.ZodLiteral<"fleet.logs.request">;
|
|
452
|
+
requestId: z.ZodString;
|
|
453
|
+
logWindowHours: z.ZodNumber;
|
|
454
|
+
maxBytes: z.ZodNumber;
|
|
455
|
+
}, z.core.$strip>;
|
|
456
|
+
/** One base64 frame of an agent's mini-bundle ZIP. */
|
|
457
|
+
export declare const fleetBundleChunkSchema: z.ZodObject<{
|
|
458
|
+
type: z.ZodLiteral<"fleet.bundle.chunk">;
|
|
459
|
+
requestId: z.ZodString;
|
|
460
|
+
seq: z.ZodNumber;
|
|
461
|
+
isLast: z.ZodBoolean;
|
|
462
|
+
dataB64: z.ZodString;
|
|
463
|
+
}, z.core.$strip>;
|
|
464
|
+
/** Agent failed to build/stream its mini-bundle. */
|
|
465
|
+
export declare const fleetBundleErrorSchema: z.ZodObject<{
|
|
466
|
+
type: z.ZodLiteral<"fleet.bundle.error">;
|
|
467
|
+
requestId: z.ZodString;
|
|
468
|
+
message: z.ZodString;
|
|
469
|
+
}, z.core.$strip>;
|
|
470
|
+
/** Outcome of a step-level approval hold, sent back to the waiting agent. */
|
|
471
|
+
export declare const StepApprovalOutcome: z.ZodEnum<{
|
|
472
|
+
rejected: "rejected";
|
|
473
|
+
approved: "approved";
|
|
474
|
+
expired: "expired";
|
|
475
|
+
}>;
|
|
476
|
+
export type StepApprovalOutcome = z.infer<typeof StepApprovalOutcome>;
|
|
477
|
+
/**
|
|
478
|
+
* Agent -> Orchestrator: a step carrying `requireApproval` is about to run and
|
|
479
|
+
* the agent is blocking its step loop until the orchestrator resolves the
|
|
480
|
+
* approval. The orchestrator creates a step-scoped `held_runs` row from the
|
|
481
|
+
* normalized requirement and replies with `step.approval-resolved` once the
|
|
482
|
+
* hold is approved, rejected, or expired. The agent keeps heartbeats flowing
|
|
483
|
+
* during the wait so it is not reaped as stale.
|
|
484
|
+
*
|
|
485
|
+
* NOT fast-pathed — the `log.chunk` / `heartbeat` manual-validator invariant is
|
|
486
|
+
* untouched by this message.
|
|
487
|
+
*/
|
|
488
|
+
export declare const stepApprovalRequestSchema: z.ZodObject<{
|
|
489
|
+
type: z.ZodLiteral<"step.approval-request">;
|
|
490
|
+
messageId: z.ZodString;
|
|
491
|
+
runId: z.ZodString;
|
|
492
|
+
jobId: z.ZodString;
|
|
493
|
+
stepIndex: z.ZodNumber;
|
|
494
|
+
stepName: z.ZodString;
|
|
495
|
+
clauses: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
496
|
+
team: z.ZodString;
|
|
497
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
498
|
+
user: z.ZodString;
|
|
499
|
+
}, z.core.$strict>]>>;
|
|
500
|
+
reason: z.ZodString;
|
|
501
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
502
|
+
}, z.core.$strip>;
|
|
503
|
+
export type StepApprovalRequest = z.infer<typeof stepApprovalRequestSchema>;
|
|
504
|
+
/**
|
|
505
|
+
* Orchestrator -> Agent: resolution of a step-level approval hold. `requestId`
|
|
506
|
+
* correlates to the originating `step.approval-request.messageId`. On
|
|
507
|
+
* `approved` the agent runs the step with its live workspace intact; on
|
|
508
|
+
* `rejected`/`expired` it fails the job with a clear reason.
|
|
509
|
+
*/
|
|
510
|
+
export declare const stepApprovalResolvedSchema: z.ZodObject<{
|
|
511
|
+
type: z.ZodLiteral<"step.approval-resolved">;
|
|
512
|
+
requestId: z.ZodString;
|
|
513
|
+
runId: z.ZodString;
|
|
514
|
+
jobId: z.ZodString;
|
|
515
|
+
stepIndex: z.ZodNumber;
|
|
516
|
+
outcome: z.ZodEnum<{
|
|
517
|
+
rejected: "rejected";
|
|
518
|
+
approved: "approved";
|
|
519
|
+
expired: "expired";
|
|
520
|
+
}>;
|
|
521
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
522
|
+
}, z.core.$strip>;
|
|
523
|
+
export type StepApprovalResolved = z.infer<typeof stepApprovalResolvedSchema>;
|
|
427
524
|
/** All messages that flow from Orchestrator to Agent. */
|
|
428
525
|
export declare const orchestratorToAgentMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
429
526
|
type: z.ZodLiteral<"job.dispatch">;
|
|
@@ -526,6 +623,10 @@ export declare const orchestratorToAgentMessageSchema: z.ZodDiscriminatedUnion<[
|
|
|
526
623
|
requestId: z.ZodString;
|
|
527
624
|
uploadUrl: z.ZodOptional<z.ZodString>;
|
|
528
625
|
skip: z.ZodBoolean;
|
|
626
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
627
|
+
type: z.ZodLiteral<"provenance.upload.response">;
|
|
628
|
+
requestId: z.ZodString;
|
|
629
|
+
uploadUrl: z.ZodString;
|
|
529
630
|
}, z.core.$strip>, z.ZodObject<{
|
|
530
631
|
type: z.ZodLiteral<"event.emit.response">;
|
|
531
632
|
requestId: z.ZodString;
|
|
@@ -542,6 +643,23 @@ export declare const orchestratorToAgentMessageSchema: z.ZodDiscriminatedUnion<[
|
|
|
542
643
|
}, z.core.$strip>, z.ZodObject<{
|
|
543
644
|
type: z.ZodLiteral<"auth.failure">;
|
|
544
645
|
reason: z.ZodString;
|
|
646
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
647
|
+
type: z.ZodLiteral<"fleet.logs.request">;
|
|
648
|
+
requestId: z.ZodString;
|
|
649
|
+
logWindowHours: z.ZodNumber;
|
|
650
|
+
maxBytes: z.ZodNumber;
|
|
651
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
652
|
+
type: z.ZodLiteral<"step.approval-resolved">;
|
|
653
|
+
requestId: z.ZodString;
|
|
654
|
+
runId: z.ZodString;
|
|
655
|
+
jobId: z.ZodString;
|
|
656
|
+
stepIndex: z.ZodNumber;
|
|
657
|
+
outcome: z.ZodEnum<{
|
|
658
|
+
rejected: "rejected";
|
|
659
|
+
approved: "approved";
|
|
660
|
+
expired: "expired";
|
|
661
|
+
}>;
|
|
662
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
545
663
|
}, z.core.$strip>], "type">;
|
|
546
664
|
/** All messages that flow from Agent to Orchestrator. */
|
|
547
665
|
export declare const agentToOrchestratorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -712,6 +830,18 @@ export declare const agentToOrchestratorMessageSchema: z.ZodDiscriminatedUnion<[
|
|
|
712
830
|
key: z.ZodString;
|
|
713
831
|
tarHash: z.ZodString;
|
|
714
832
|
sizeBytes: z.ZodNumber;
|
|
833
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
834
|
+
type: z.ZodLiteral<"provenance.upload.request">;
|
|
835
|
+
messageId: z.ZodString;
|
|
836
|
+
jobId: z.ZodString;
|
|
837
|
+
subjectDigest: z.ZodString;
|
|
838
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
839
|
+
type: z.ZodLiteral<"provenance.upload.complete">;
|
|
840
|
+
messageId: z.ZodString;
|
|
841
|
+
jobId: z.ZodString;
|
|
842
|
+
subjectName: z.ZodString;
|
|
843
|
+
subjectDigest: z.ZodString;
|
|
844
|
+
mediaType: z.ZodString;
|
|
715
845
|
}, z.core.$strip>, z.ZodObject<{
|
|
716
846
|
type: z.ZodLiteral<"event.emit">;
|
|
717
847
|
jobId: z.ZodString;
|
|
@@ -752,6 +882,30 @@ export declare const agentToOrchestratorMessageSchema: z.ZodDiscriminatedUnion<[
|
|
|
752
882
|
type: z.ZodLiteral<"auth.request">;
|
|
753
883
|
token: z.ZodString;
|
|
754
884
|
protocolVersion: z.ZodNumber;
|
|
885
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
886
|
+
type: z.ZodLiteral<"fleet.bundle.chunk">;
|
|
887
|
+
requestId: z.ZodString;
|
|
888
|
+
seq: z.ZodNumber;
|
|
889
|
+
isLast: z.ZodBoolean;
|
|
890
|
+
dataB64: z.ZodString;
|
|
891
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
892
|
+
type: z.ZodLiteral<"fleet.bundle.error">;
|
|
893
|
+
requestId: z.ZodString;
|
|
894
|
+
message: z.ZodString;
|
|
895
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
896
|
+
type: z.ZodLiteral<"step.approval-request">;
|
|
897
|
+
messageId: z.ZodString;
|
|
898
|
+
runId: z.ZodString;
|
|
899
|
+
jobId: z.ZodString;
|
|
900
|
+
stepIndex: z.ZodNumber;
|
|
901
|
+
stepName: z.ZodString;
|
|
902
|
+
clauses: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
903
|
+
team: z.ZodString;
|
|
904
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
905
|
+
user: z.ZodString;
|
|
906
|
+
}, z.core.$strict>]>>;
|
|
907
|
+
reason: z.ZodString;
|
|
908
|
+
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
755
909
|
}, z.core.$strip>], "type">;
|
|
756
910
|
export type JobDispatch = z.infer<typeof jobDispatchSchema>;
|
|
757
911
|
export type JobCancel = z.infer<typeof jobCancelSchema>;
|
|
@@ -766,5 +920,12 @@ export type CacheUserRestoreResponse = z.infer<typeof cacheUserRestoreResponseSc
|
|
|
766
920
|
export type CacheUserSaveRequest = z.infer<typeof cacheUserSaveRequestSchema>;
|
|
767
921
|
export type CacheUserSaveResponse = z.infer<typeof cacheUserSaveResponseSchema>;
|
|
768
922
|
export type CacheUserSaveComplete = z.infer<typeof cacheUserSaveCompleteSchema>;
|
|
923
|
+
export type ProvenanceUploadRequest = z.infer<typeof provenanceUploadRequestSchema>;
|
|
924
|
+
export type ProvenanceUploadResponse = z.infer<typeof provenanceUploadResponseSchema>;
|
|
925
|
+
export type ProvenanceUploadComplete = z.infer<typeof provenanceUploadCompleteSchema>;
|
|
926
|
+
export type FleetLogsRequest = z.infer<typeof fleetLogsRequestSchema>;
|
|
927
|
+
export type FleetBundleChunk = z.infer<typeof fleetBundleChunkSchema>;
|
|
928
|
+
export type FleetBundleError = z.infer<typeof fleetBundleErrorSchema>;
|
|
929
|
+
export type OrchestratorToAgentMessage = z.infer<typeof orchestratorToAgentMessageSchema>;
|
|
769
930
|
export type AgentToOrchestratorMessage = z.infer<typeof agentToOrchestratorMessageSchema>;
|
|
770
931
|
//# sourceMappingURL=orchestrator-agent.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "../../chunk-
|
|
1
|
+
import "../../chunk-BTugEXQM.js";
|
|
2
2
|
import { ExecutionJobStatus, ExecutionStepStatus } from "./execution-status.js";
|
|
3
|
+
import { approverClauseSchema } from "../../approval/types.js";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
//#region src/protocol/messages/orchestrator-agent.ts
|
|
5
6
|
/**
|
|
@@ -470,6 +471,34 @@ const cacheUserSaveCompleteSchema = z.object({
|
|
|
470
471
|
/** Tarball size in bytes (drives quota accounting). */
|
|
471
472
|
sizeBytes: z.number().int().nonnegative()
|
|
472
473
|
});
|
|
474
|
+
/** Agent -> Orchestrator: request a presigned PUT URL for a provenance bundle. */
|
|
475
|
+
const provenanceUploadRequestSchema = z.object({
|
|
476
|
+
type: z.literal("provenance.upload.request"),
|
|
477
|
+
messageId: z.string(),
|
|
478
|
+
/** Job producing the attestation (ownership-checked; runId resolved server-side). */
|
|
479
|
+
jobId: z.string(),
|
|
480
|
+
/** Primary subject digest (lowercase hex) — the storage-key discriminator. */
|
|
481
|
+
subjectDigest: z.string()
|
|
482
|
+
});
|
|
483
|
+
/** Orchestrator -> Agent: presigned PUT URL for the provenance bundle. */
|
|
484
|
+
const provenanceUploadResponseSchema = z.object({
|
|
485
|
+
type: z.literal("provenance.upload.response"),
|
|
486
|
+
requestId: z.string(),
|
|
487
|
+
/** Presigned PUT URL, or '' when storage is unavailable. */
|
|
488
|
+
uploadUrl: z.string()
|
|
489
|
+
});
|
|
490
|
+
/** Agent -> Orchestrator: confirm a provenance bundle upload (records an attestations row). */
|
|
491
|
+
const provenanceUploadCompleteSchema = z.object({
|
|
492
|
+
type: z.literal("provenance.upload.complete"),
|
|
493
|
+
messageId: z.string(),
|
|
494
|
+
jobId: z.string(),
|
|
495
|
+
/** Caller-supplied artifact name. */
|
|
496
|
+
subjectName: z.string(),
|
|
497
|
+
/** Primary subject digest (lowercase hex). */
|
|
498
|
+
subjectDigest: z.string(),
|
|
499
|
+
/** Bundle media type. */
|
|
500
|
+
mediaType: z.string()
|
|
501
|
+
});
|
|
473
502
|
/** Agent -> Orchestrator: emit a custom event from a running workflow step. */
|
|
474
503
|
const eventEmitSchema = z.object({
|
|
475
504
|
type: z.literal("event.emit"),
|
|
@@ -554,6 +583,82 @@ const agentApiResponseSchema = z.object({
|
|
|
554
583
|
/** Error description (present on failure). */
|
|
555
584
|
error: z.string().optional()
|
|
556
585
|
});
|
|
586
|
+
/** Orchestrator asks an agent for its log/diagnostic mini-bundle. */
|
|
587
|
+
const fleetLogsRequestSchema = z.object({
|
|
588
|
+
type: z.literal("fleet.logs.request"),
|
|
589
|
+
/** UUID correlating the chunked response. */
|
|
590
|
+
requestId: z.string(),
|
|
591
|
+
/** Hours of log history to include. */
|
|
592
|
+
logWindowHours: z.number(),
|
|
593
|
+
/** Per-node cap on raw log bytes. */
|
|
594
|
+
maxBytes: z.number()
|
|
595
|
+
});
|
|
596
|
+
/** One base64 frame of an agent's mini-bundle ZIP. */
|
|
597
|
+
const fleetBundleChunkSchema = z.object({
|
|
598
|
+
type: z.literal("fleet.bundle.chunk"),
|
|
599
|
+
requestId: z.string(),
|
|
600
|
+
seq: z.number().int().nonnegative(),
|
|
601
|
+
isLast: z.boolean(),
|
|
602
|
+
dataB64: z.string()
|
|
603
|
+
});
|
|
604
|
+
/** Agent failed to build/stream its mini-bundle. */
|
|
605
|
+
const fleetBundleErrorSchema = z.object({
|
|
606
|
+
type: z.literal("fleet.bundle.error"),
|
|
607
|
+
requestId: z.string(),
|
|
608
|
+
message: z.string()
|
|
609
|
+
});
|
|
610
|
+
/** Outcome of a step-level approval hold, sent back to the waiting agent. */
|
|
611
|
+
const StepApprovalOutcome = z.enum([
|
|
612
|
+
"approved",
|
|
613
|
+
"rejected",
|
|
614
|
+
"expired"
|
|
615
|
+
]);
|
|
616
|
+
/**
|
|
617
|
+
* Agent -> Orchestrator: a step carrying `requireApproval` is about to run and
|
|
618
|
+
* the agent is blocking its step loop until the orchestrator resolves the
|
|
619
|
+
* approval. The orchestrator creates a step-scoped `held_runs` row from the
|
|
620
|
+
* normalized requirement and replies with `step.approval-resolved` once the
|
|
621
|
+
* hold is approved, rejected, or expired. The agent keeps heartbeats flowing
|
|
622
|
+
* during the wait so it is not reaped as stale.
|
|
623
|
+
*
|
|
624
|
+
* NOT fast-pathed — the `log.chunk` / `heartbeat` manual-validator invariant is
|
|
625
|
+
* untouched by this message.
|
|
626
|
+
*/
|
|
627
|
+
const stepApprovalRequestSchema = z.object({
|
|
628
|
+
type: z.literal("step.approval-request"),
|
|
629
|
+
messageId: z.string(),
|
|
630
|
+
runId: z.string(),
|
|
631
|
+
jobId: z.string(),
|
|
632
|
+
stepIndex: z.number().int().nonnegative(),
|
|
633
|
+
stepName: z.string(),
|
|
634
|
+
/** AND-list of approver clauses (empty = any approval-capable member). */
|
|
635
|
+
clauses: z.array(approverClauseSchema),
|
|
636
|
+
/** Human label for the gate (from the SDK `requireApproval` reason). */
|
|
637
|
+
reason: z.string(),
|
|
638
|
+
/**
|
|
639
|
+
* Per-gate timeout override (seconds) from the SDK `requireApproval.timeout`.
|
|
640
|
+
* Absent ⇒ the orchestrator uses the org-default `approval_expiry_seconds`.
|
|
641
|
+
* The orchestrator owns the authoritative `expiresAt` computation.
|
|
642
|
+
*/
|
|
643
|
+
timeoutSeconds: z.number().int().positive().optional()
|
|
644
|
+
});
|
|
645
|
+
/**
|
|
646
|
+
* Orchestrator -> Agent: resolution of a step-level approval hold. `requestId`
|
|
647
|
+
* correlates to the originating `step.approval-request.messageId`. On
|
|
648
|
+
* `approved` the agent runs the step with its live workspace intact; on
|
|
649
|
+
* `rejected`/`expired` it fails the job with a clear reason.
|
|
650
|
+
*/
|
|
651
|
+
const stepApprovalResolvedSchema = z.object({
|
|
652
|
+
type: z.literal("step.approval-resolved"),
|
|
653
|
+
/** Correlates to the originating step.approval-request messageId. */
|
|
654
|
+
requestId: z.string(),
|
|
655
|
+
runId: z.string(),
|
|
656
|
+
jobId: z.string(),
|
|
657
|
+
stepIndex: z.number().int().nonnegative(),
|
|
658
|
+
outcome: StepApprovalOutcome,
|
|
659
|
+
/** Optional human reason (e.g. the reject reason). */
|
|
660
|
+
reason: z.string().optional()
|
|
661
|
+
});
|
|
557
662
|
/** All messages that flow from Orchestrator to Agent. */
|
|
558
663
|
const orchestratorToAgentMessageSchema = z.discriminatedUnion("type", [
|
|
559
664
|
jobDispatchSchema,
|
|
@@ -563,10 +668,13 @@ const orchestratorToAgentMessageSchema = z.discriminatedUnion("type", [
|
|
|
563
668
|
cacheUploadResponseSchema,
|
|
564
669
|
cacheUserRestoreResponseSchema,
|
|
565
670
|
cacheUserSaveResponseSchema,
|
|
671
|
+
provenanceUploadResponseSchema,
|
|
566
672
|
eventEmitResponseSchema,
|
|
567
673
|
agentApiResponseSchema,
|
|
568
674
|
agentAuthSuccessSchema,
|
|
569
|
-
agentAuthFailureSchema
|
|
675
|
+
agentAuthFailureSchema,
|
|
676
|
+
fleetLogsRequestSchema,
|
|
677
|
+
stepApprovalResolvedSchema
|
|
570
678
|
]);
|
|
571
679
|
/** All messages that flow from Agent to Orchestrator. */
|
|
572
680
|
const agentToOrchestratorMessageSchema = z.discriminatedUnion("type", [
|
|
@@ -586,12 +694,17 @@ const agentToOrchestratorMessageSchema = z.discriminatedUnion("type", [
|
|
|
586
694
|
cacheUserRestoreRequestSchema,
|
|
587
695
|
cacheUserSaveRequestSchema,
|
|
588
696
|
cacheUserSaveCompleteSchema,
|
|
697
|
+
provenanceUploadRequestSchema,
|
|
698
|
+
provenanceUploadCompleteSchema,
|
|
589
699
|
eventEmitSchema,
|
|
590
700
|
agentApiRequestSchema,
|
|
591
701
|
agentMetricsSchema,
|
|
592
|
-
agentAuthRequestSchema
|
|
702
|
+
agentAuthRequestSchema,
|
|
703
|
+
fleetBundleChunkSchema,
|
|
704
|
+
fleetBundleErrorSchema,
|
|
705
|
+
stepApprovalRequestSchema
|
|
593
706
|
]);
|
|
594
707
|
//#endregion
|
|
595
|
-
export { CacheRefScope, JobRejectReason, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, registerAckSchema };
|
|
708
|
+
export { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, registerAckSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema };
|
|
596
709
|
|
|
597
710
|
//# sourceMappingURL=orchestrator-agent.js.map
|
|
@@ -302,6 +302,38 @@ export declare const peerConfigReloadResponseSchema: z.ZodObject<{
|
|
|
302
302
|
restartRequired: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
303
303
|
fieldsChanged: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
304
304
|
}, z.core.$strip>;
|
|
305
|
+
/** Which of THIS peer's downstream nodes to gather. all=true ignores the id lists. */
|
|
306
|
+
export declare const fleetSelectionSchema: z.ZodObject<{
|
|
307
|
+
all: z.ZodBoolean;
|
|
308
|
+
agentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
309
|
+
workerInstanceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
310
|
+
}, z.core.$strip>;
|
|
311
|
+
/** Ask a peer to assemble and stream back its subtree bundle. */
|
|
312
|
+
export declare const peerLogsCollectRequestSchema: z.ZodObject<{
|
|
313
|
+
type: z.ZodLiteral<"peer.logs.collect.request">;
|
|
314
|
+
messageId: z.ZodString;
|
|
315
|
+
logWindowHours: z.ZodNumber;
|
|
316
|
+
includeCoordinatorMesh: z.ZodBoolean;
|
|
317
|
+
selection: z.ZodObject<{
|
|
318
|
+
all: z.ZodBoolean;
|
|
319
|
+
agentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
320
|
+
workerInstanceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
321
|
+
}, z.core.$strip>;
|
|
322
|
+
}, z.core.$strip>;
|
|
323
|
+
/** One base64 frame of a peer's subtree ZIP. */
|
|
324
|
+
export declare const peerLogsCollectChunkSchema: z.ZodObject<{
|
|
325
|
+
type: z.ZodLiteral<"peer.logs.collect.chunk">;
|
|
326
|
+
messageId: z.ZodString;
|
|
327
|
+
seq: z.ZodNumber;
|
|
328
|
+
isLast: z.ZodBoolean;
|
|
329
|
+
dataB64: z.ZodString;
|
|
330
|
+
}, z.core.$strip>;
|
|
331
|
+
/** Peer failed to assemble/stream its subtree. */
|
|
332
|
+
export declare const peerLogsCollectErrorSchema: z.ZodObject<{
|
|
333
|
+
type: z.ZodLiteral<"peer.logs.collect.error">;
|
|
334
|
+
messageId: z.ZodString;
|
|
335
|
+
message: z.ZodString;
|
|
336
|
+
}, z.core.$strip>;
|
|
305
337
|
/** Graceful shutdown announcement. Peers remove sender from registry immediately. */
|
|
306
338
|
export declare const peerLeavingSchema: z.ZodObject<{
|
|
307
339
|
type: z.ZodLiteral<"peer.leaving">;
|
|
@@ -568,6 +600,26 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
568
600
|
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
569
601
|
restartRequired: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
570
602
|
fieldsChanged: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
603
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
604
|
+
type: z.ZodLiteral<"peer.logs.collect.request">;
|
|
605
|
+
messageId: z.ZodString;
|
|
606
|
+
logWindowHours: z.ZodNumber;
|
|
607
|
+
includeCoordinatorMesh: z.ZodBoolean;
|
|
608
|
+
selection: z.ZodObject<{
|
|
609
|
+
all: z.ZodBoolean;
|
|
610
|
+
agentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
611
|
+
workerInstanceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
612
|
+
}, z.core.$strip>;
|
|
613
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
614
|
+
type: z.ZodLiteral<"peer.logs.collect.chunk">;
|
|
615
|
+
messageId: z.ZodString;
|
|
616
|
+
seq: z.ZodNumber;
|
|
617
|
+
isLast: z.ZodBoolean;
|
|
618
|
+
dataB64: z.ZodString;
|
|
619
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
620
|
+
type: z.ZodLiteral<"peer.logs.collect.error">;
|
|
621
|
+
messageId: z.ZodString;
|
|
622
|
+
message: z.ZodString;
|
|
571
623
|
}, z.core.$strip>, z.ZodObject<{
|
|
572
624
|
type: z.ZodLiteral<"peer.leaving">;
|
|
573
625
|
instanceId: z.ZodString;
|
|
@@ -816,6 +868,26 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
816
868
|
errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
817
869
|
restartRequired: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
818
870
|
fieldsChanged: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
871
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
872
|
+
type: z.ZodLiteral<"peer.logs.collect.request">;
|
|
873
|
+
messageId: z.ZodString;
|
|
874
|
+
logWindowHours: z.ZodNumber;
|
|
875
|
+
includeCoordinatorMesh: z.ZodBoolean;
|
|
876
|
+
selection: z.ZodObject<{
|
|
877
|
+
all: z.ZodBoolean;
|
|
878
|
+
agentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
879
|
+
workerInstanceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
880
|
+
}, z.core.$strip>;
|
|
881
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
882
|
+
type: z.ZodLiteral<"peer.logs.collect.chunk">;
|
|
883
|
+
messageId: z.ZodString;
|
|
884
|
+
seq: z.ZodNumber;
|
|
885
|
+
isLast: z.ZodBoolean;
|
|
886
|
+
dataB64: z.ZodString;
|
|
887
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
888
|
+
type: z.ZodLiteral<"peer.logs.collect.error">;
|
|
889
|
+
messageId: z.ZodString;
|
|
890
|
+
message: z.ZodString;
|
|
819
891
|
}, z.core.$strip>, z.ZodObject<{
|
|
820
892
|
type: z.ZodLiteral<"peer.leaving">;
|
|
821
893
|
instanceId: z.ZodString;
|
|
@@ -856,6 +928,10 @@ export type PeerConfigReload = z.infer<typeof peerConfigReloadSchema>;
|
|
|
856
928
|
export type PeerConfigReloadResponse = z.infer<typeof peerConfigReloadResponseSchema>;
|
|
857
929
|
export type PeerLeaving = z.infer<typeof peerLeavingSchema>;
|
|
858
930
|
export type PeerAgentTokenRevoke = z.infer<typeof peerAgentTokenRevokeSchema>;
|
|
931
|
+
export type FleetSelection = z.infer<typeof fleetSelectionSchema>;
|
|
932
|
+
export type PeerLogsCollectRequest = z.infer<typeof peerLogsCollectRequestSchema>;
|
|
933
|
+
export type PeerLogsCollectChunk = z.infer<typeof peerLogsCollectChunkSchema>;
|
|
934
|
+
export type PeerLogsCollectError = z.infer<typeof peerLogsCollectErrorSchema>;
|
|
859
935
|
export type PeerToPeerMessage = z.infer<typeof peerToPeerMessageSchema>;
|
|
860
936
|
export {};
|
|
861
937
|
//# sourceMappingURL=peer.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../chunk-
|
|
1
|
+
import "../../chunk-BTugEXQM.js";
|
|
2
2
|
import { ExecutionJobStatus } from "./execution-status.js";
|
|
3
3
|
import { ScalerEventType } from "./scaler-event.js";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -316,6 +316,35 @@ const peerConfigReloadResponseSchema = z.object({
|
|
|
316
316
|
restartRequired: z.array(z.string()).optional(),
|
|
317
317
|
fieldsChanged: z.array(z.string()).optional()
|
|
318
318
|
});
|
|
319
|
+
/** Which of THIS peer's downstream nodes to gather. all=true ignores the id lists. */
|
|
320
|
+
const fleetSelectionSchema = z.object({
|
|
321
|
+
all: z.boolean(),
|
|
322
|
+
agentIds: z.array(z.string()).default([]),
|
|
323
|
+
workerInstanceIds: z.array(z.string()).default([])
|
|
324
|
+
});
|
|
325
|
+
/** Ask a peer to assemble and stream back its subtree bundle. */
|
|
326
|
+
const peerLogsCollectRequestSchema = z.object({
|
|
327
|
+
type: z.literal("peer.logs.collect.request"),
|
|
328
|
+
messageId: z.string(),
|
|
329
|
+
logWindowHours: z.number(),
|
|
330
|
+
/** Loop guard: false on every downstream request so the coordinator mesh never echoes. */
|
|
331
|
+
includeCoordinatorMesh: z.boolean(),
|
|
332
|
+
selection: fleetSelectionSchema
|
|
333
|
+
});
|
|
334
|
+
/** One base64 frame of a peer's subtree ZIP. */
|
|
335
|
+
const peerLogsCollectChunkSchema = z.object({
|
|
336
|
+
type: z.literal("peer.logs.collect.chunk"),
|
|
337
|
+
messageId: z.string(),
|
|
338
|
+
seq: z.number().int().nonnegative(),
|
|
339
|
+
isLast: z.boolean(),
|
|
340
|
+
dataB64: z.string()
|
|
341
|
+
});
|
|
342
|
+
/** Peer failed to assemble/stream its subtree. */
|
|
343
|
+
const peerLogsCollectErrorSchema = z.object({
|
|
344
|
+
type: z.literal("peer.logs.collect.error"),
|
|
345
|
+
messageId: z.string(),
|
|
346
|
+
message: z.string()
|
|
347
|
+
});
|
|
319
348
|
/** Graceful shutdown announcement. Peers remove sender from registry immediately. */
|
|
320
349
|
const peerLeavingSchema = z.object({
|
|
321
350
|
type: z.literal("peer.leaving"),
|
|
@@ -377,6 +406,9 @@ const peerToPeerMessageSchema = z.discriminatedUnion("type", [
|
|
|
377
406
|
peerCacheUploadResponseSchema,
|
|
378
407
|
peerConfigReloadSchema,
|
|
379
408
|
peerConfigReloadResponseSchema,
|
|
409
|
+
peerLogsCollectRequestSchema,
|
|
410
|
+
peerLogsCollectChunkSchema,
|
|
411
|
+
peerLogsCollectErrorSchema,
|
|
380
412
|
peerLeavingSchema,
|
|
381
413
|
peerAgentTokenRevokeSchema,
|
|
382
414
|
peerScalerEventSchema
|
|
@@ -400,11 +432,14 @@ const peerFromPeerMessageSchema = z.discriminatedUnion("type", [
|
|
|
400
432
|
peerCacheUploadResponseSchema,
|
|
401
433
|
peerConfigReloadSchema,
|
|
402
434
|
peerConfigReloadResponseSchema,
|
|
435
|
+
peerLogsCollectRequestSchema,
|
|
436
|
+
peerLogsCollectChunkSchema,
|
|
437
|
+
peerLogsCollectErrorSchema,
|
|
403
438
|
peerLeavingSchema,
|
|
404
439
|
peerAgentTokenRevokeSchema,
|
|
405
440
|
peerScalerEventSchema
|
|
406
441
|
]);
|
|
407
442
|
//#endregion
|
|
408
|
-
export { jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerScalerEventSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema };
|
|
443
|
+
export { fleetSelectionSchema, jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema };
|
|
409
444
|
|
|
410
445
|
//# sourceMappingURL=peer.js.map
|