@kanyun-ai-infra/agenthub 1.5.0 → 1.5.2
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/index.cjs +1110 -1022
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -7
- package/dist/index.d.ts +59 -7
- package/dist/index.js +1110 -1022
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -218,6 +218,7 @@ var import_zod67 = require("zod");
|
|
|
218
218
|
var import_zod68 = require("zod");
|
|
219
219
|
var import_zod69 = require("zod");
|
|
220
220
|
var import_zod70 = require("zod");
|
|
221
|
+
var import_zod71 = require("zod");
|
|
221
222
|
var MODELGATE_VENDOR_TYPES = [
|
|
222
223
|
"anthropic",
|
|
223
224
|
"openai",
|
|
@@ -5558,35 +5559,41 @@ var SessionDeliveryEnvelopeSchema = import_zod47.z.object({
|
|
|
5558
5559
|
/** ISO-8601 last-write time; the latest-wins ordering key. */
|
|
5559
5560
|
updatedAt: import_zod47.z.string().min(1)
|
|
5560
5561
|
}).strict();
|
|
5562
|
+
var SESSION_INCLUDE_FIELDS = ["streamCursor"];
|
|
5563
|
+
var SessionIncludeQuerySchema = import_zod48.z.object({
|
|
5564
|
+
include: import_zod48.z.string().optional().transform(
|
|
5565
|
+
(raw) => raw ? raw.split(",").map((value) => value.trim()).filter(Boolean) : []
|
|
5566
|
+
).pipe(import_zod48.z.array(import_zod48.z.enum(SESSION_INCLUDE_FIELDS)))
|
|
5567
|
+
});
|
|
5561
5568
|
var SECRET_VALUE_MAX_LENGTH = 65536;
|
|
5562
5569
|
var SECRET_DISPLAY_NAME_MAX_LENGTH = 200;
|
|
5563
|
-
var SecretEnvKeySchema =
|
|
5564
|
-
var CreateSecretRequestSchema =
|
|
5565
|
-
delivery:
|
|
5566
|
-
displayName:
|
|
5570
|
+
var SecretEnvKeySchema = import_zod49.z.string().min(1).max(SECRET_ENV_KEY_MAX_LENGTH).regex(SECRET_ENV_KEY_REGEX, "envKey must look like an environment variable name").refine((key) => !isDisallowedWorkerConfigEnvKey(key), { message: "ENV_KEY_FORBIDDEN" });
|
|
5571
|
+
var CreateSecretRequestSchema = import_zod49.z.object({
|
|
5572
|
+
delivery: import_zod49.z.literal("env_jit"),
|
|
5573
|
+
displayName: import_zod49.z.string().min(1).max(SECRET_DISPLAY_NAME_MAX_LENGTH),
|
|
5567
5574
|
envKey: SecretEnvKeySchema,
|
|
5568
5575
|
/** Plaintext, write-only; bounded so a blob cannot bloat the envelope. */
|
|
5569
|
-
value:
|
|
5576
|
+
value: import_zod49.z.string().min(1).max(SECRET_VALUE_MAX_LENGTH)
|
|
5570
5577
|
}).strict();
|
|
5571
|
-
var RotateSecretRequestSchema =
|
|
5572
|
-
value:
|
|
5578
|
+
var RotateSecretRequestSchema = import_zod49.z.object({
|
|
5579
|
+
value: import_zod49.z.string().min(1).max(SECRET_VALUE_MAX_LENGTH)
|
|
5573
5580
|
}).strict();
|
|
5574
|
-
var SecretRecordSchema =
|
|
5581
|
+
var SecretRecordSchema = import_zod49.z.object({
|
|
5575
5582
|
publicId: SecretPublicIdSchema,
|
|
5576
|
-
displayName:
|
|
5583
|
+
displayName: import_zod49.z.string(),
|
|
5577
5584
|
delivery: SecretDeliverySchema,
|
|
5578
5585
|
/** env_jit: target env var name; proxy_inject (P2): null. */
|
|
5579
|
-
envKey:
|
|
5580
|
-
createdAt:
|
|
5581
|
-
updatedAt:
|
|
5582
|
-
archivedAt:
|
|
5586
|
+
envKey: import_zod49.z.string().nullable(),
|
|
5587
|
+
createdAt: import_zod49.z.string(),
|
|
5588
|
+
updatedAt: import_zod49.z.string(),
|
|
5589
|
+
archivedAt: import_zod49.z.string().nullable()
|
|
5583
5590
|
}).strict();
|
|
5584
|
-
var SecretPickItemSchema =
|
|
5591
|
+
var SecretPickItemSchema = import_zod49.z.object({
|
|
5585
5592
|
publicId: SecretPublicIdSchema,
|
|
5586
|
-
displayName:
|
|
5587
|
-
envKey:
|
|
5593
|
+
displayName: import_zod49.z.string(),
|
|
5594
|
+
envKey: import_zod49.z.string().nullable()
|
|
5588
5595
|
}).strict();
|
|
5589
|
-
var RecordWorkspaceSnapshotRequestSchema =
|
|
5596
|
+
var RecordWorkspaceSnapshotRequestSchema = import_zod50.z.object({
|
|
5590
5597
|
/**
|
|
5591
5598
|
* The split workspace snapshot produced at the prior turn's end. Both
|
|
5592
5599
|
* parts may be null ("nothing to restore" — a valid no-op snapshot, NOT
|
|
@@ -5594,14 +5601,14 @@ var RecordWorkspaceSnapshotRequestSchema = import_zod49.z.object({
|
|
|
5594
5601
|
*/
|
|
5595
5602
|
snapshot: WorkspaceSnapshotSchema
|
|
5596
5603
|
}).strict();
|
|
5597
|
-
var RecordWorkspaceSnapshotResponseSchema =
|
|
5598
|
-
success:
|
|
5599
|
-
data:
|
|
5600
|
-
applied:
|
|
5601
|
-
gateInjected:
|
|
5604
|
+
var RecordWorkspaceSnapshotResponseSchema = import_zod50.z.object({
|
|
5605
|
+
success: import_zod50.z.literal(true),
|
|
5606
|
+
data: import_zod50.z.object({
|
|
5607
|
+
applied: import_zod50.z.boolean(),
|
|
5608
|
+
gateInjected: import_zod50.z.boolean()
|
|
5602
5609
|
})
|
|
5603
5610
|
});
|
|
5604
|
-
var RecordWorkspaceSnapshotErrorCodeSchema =
|
|
5611
|
+
var RecordWorkspaceSnapshotErrorCodeSchema = import_zod50.z.enum([
|
|
5605
5612
|
// 400 — request was malformed or schema-invalid
|
|
5606
5613
|
"VALIDATION_ERROR",
|
|
5607
5614
|
// 401 — Authorization header missing or session token invalid/expired
|
|
@@ -5618,12 +5625,12 @@ var RecordWorkspaceSnapshotErrorCodeSchema = import_zod49.z.enum([
|
|
|
5618
5625
|
]);
|
|
5619
5626
|
var WorkspaceExportPartSchema = WorkspaceSnapshotPartSchema.extend({
|
|
5620
5627
|
/** Presigned OSS download URL, valid for `WORKSPACE_EXPORT_URL_TTL_SECONDS`. */
|
|
5621
|
-
downloadUrl:
|
|
5628
|
+
downloadUrl: import_zod50.z.string().min(1),
|
|
5622
5629
|
/** ISO-8601 instant at which `downloadUrl` stops working. */
|
|
5623
|
-
expiresAt:
|
|
5630
|
+
expiresAt: import_zod50.z.string().min(1)
|
|
5624
5631
|
}).strip();
|
|
5625
|
-
var WorkspaceExportDataSchema =
|
|
5626
|
-
version:
|
|
5632
|
+
var WorkspaceExportDataSchema = import_zod50.z.object({
|
|
5633
|
+
version: import_zod50.z.literal("v1"),
|
|
5627
5634
|
/**
|
|
5628
5635
|
* Opaque monotonic cursor identifying this capture. **Not a turn ordinal**
|
|
5629
5636
|
* despite the name: the capture side sets it to `capturedAt.getTime()`
|
|
@@ -5660,19 +5667,19 @@ var WorkspaceExportDataSchema = import_zod49.z.object({
|
|
|
5660
5667
|
* from "nothing was produced". Anchoring the snapshot to a turn identity
|
|
5661
5668
|
* rather than a timestamp is the real fix — see the spec's follow-ups.
|
|
5662
5669
|
*/
|
|
5663
|
-
capturedAtTurn:
|
|
5670
|
+
capturedAtTurn: import_zod50.z.number().int().nonnegative(),
|
|
5664
5671
|
/** ISO-8601 capture time — the field to show a human. */
|
|
5665
|
-
capturedAt:
|
|
5666
|
-
parts:
|
|
5672
|
+
capturedAt: import_zod50.z.string().min(1),
|
|
5673
|
+
parts: import_zod50.z.object({
|
|
5667
5674
|
repoBundle: WorkspaceExportPartSchema.nullable(),
|
|
5668
5675
|
externalArchive: WorkspaceExportPartSchema.nullable()
|
|
5669
5676
|
})
|
|
5670
5677
|
});
|
|
5671
|
-
var WorkspaceExportResponseSchema =
|
|
5672
|
-
success:
|
|
5678
|
+
var WorkspaceExportResponseSchema = import_zod50.z.object({
|
|
5679
|
+
success: import_zod50.z.literal(true),
|
|
5673
5680
|
data: WorkspaceExportDataSchema
|
|
5674
5681
|
});
|
|
5675
|
-
var WorkspaceExportErrorCodeSchema =
|
|
5682
|
+
var WorkspaceExportErrorCodeSchema = import_zod50.z.enum([
|
|
5676
5683
|
// 400 — the URL session id is not a well-formed uuid
|
|
5677
5684
|
"VALIDATION_ERROR",
|
|
5678
5685
|
// 404 — no such session, or it is not visible to this caller
|
|
@@ -5702,25 +5709,25 @@ var WorkspaceExportErrorCodeSchema = import_zod49.z.enum([
|
|
|
5702
5709
|
var SESSION_ARTIFACT_MAX_BUNDLE_COMPRESSED_BYTES = 8 * 1024 * 1024;
|
|
5703
5710
|
var SESSION_ARTIFACT_MAX_ENTRY_BYTES = 8 * 1024 * 1024;
|
|
5704
5711
|
var SESSION_ARTIFACT_MAX_TOTAL_UNCOMPRESSED_BYTES = 16 * 1024 * 1024;
|
|
5705
|
-
var ScheduleTargetKindSchema =
|
|
5706
|
-
var ScheduleApiVersionPreferenceSchema =
|
|
5707
|
-
var ScheduleLifecycleStatusSchema =
|
|
5708
|
-
var ScheduleConcurrencyPolicySchema =
|
|
5709
|
-
var ScheduleMisfirePolicySchema =
|
|
5710
|
-
var ScheduleTriggerSourceSchema =
|
|
5711
|
-
var ScheduleTriggerStatusSchema =
|
|
5712
|
+
var ScheduleTargetKindSchema = import_zod51.z.enum(["workload", "agent", "inline_v1", "inline_v2"]);
|
|
5713
|
+
var ScheduleApiVersionPreferenceSchema = import_zod51.z.enum(["v1", "v2"]);
|
|
5714
|
+
var ScheduleLifecycleStatusSchema = import_zod51.z.enum(["active", "disabled", "deleted"]);
|
|
5715
|
+
var ScheduleConcurrencyPolicySchema = import_zod51.z.enum(["allow", "forbid"]);
|
|
5716
|
+
var ScheduleMisfirePolicySchema = import_zod51.z.enum(["skip", "fire_once_immediately"]);
|
|
5717
|
+
var ScheduleTriggerSourceSchema = import_zod51.z.enum(["cron", "manual"]);
|
|
5718
|
+
var ScheduleTriggerStatusSchema = import_zod51.z.enum([
|
|
5712
5719
|
"pending",
|
|
5713
5720
|
"dispatched",
|
|
5714
5721
|
"skipped",
|
|
5715
5722
|
"failed_to_dispatch"
|
|
5716
5723
|
]);
|
|
5717
|
-
var ScheduleSkippedReasonSchema =
|
|
5724
|
+
var ScheduleSkippedReasonSchema = import_zod51.z.enum([
|
|
5718
5725
|
"misfire",
|
|
5719
5726
|
"concurrency_forbidden",
|
|
5720
5727
|
"schedule_disabled",
|
|
5721
5728
|
"out_of_window"
|
|
5722
5729
|
]);
|
|
5723
|
-
var ScheduleFailureReasonCodeSchema =
|
|
5730
|
+
var ScheduleFailureReasonCodeSchema = import_zod51.z.enum([
|
|
5724
5731
|
"TARGET_NOT_FOUND",
|
|
5725
5732
|
"TARGET_DISABLED",
|
|
5726
5733
|
"REVISION_NOT_FOUND",
|
|
@@ -5731,7 +5738,7 @@ var ScheduleFailureReasonCodeSchema = import_zod50.z.enum([
|
|
|
5731
5738
|
"STAGE_NOT_DEPLOYED",
|
|
5732
5739
|
"UNKNOWN_DISPATCH_FAILURE"
|
|
5733
5740
|
]);
|
|
5734
|
-
var ScheduleApiErrorCodeSchema =
|
|
5741
|
+
var ScheduleApiErrorCodeSchema = import_zod51.z.enum([
|
|
5735
5742
|
"INVALID_CRON",
|
|
5736
5743
|
"INVALID_TIMEZONE",
|
|
5737
5744
|
"INVALID_TARGET",
|
|
@@ -5788,16 +5795,16 @@ function isCronStructurallyValid(value) {
|
|
|
5788
5795
|
const segments = trimmed.split(/\s+/);
|
|
5789
5796
|
return segments.length === 5 || segments.length === 6;
|
|
5790
5797
|
}
|
|
5791
|
-
var TimezoneStringSchema =
|
|
5792
|
-
var CronExpressionSchema =
|
|
5793
|
-
var IsoDatetimeSchema =
|
|
5798
|
+
var TimezoneStringSchema = import_zod51.z.string().min(1, "timezone must be a non-empty IANA identifier").refine(isValidIanaTimezone, "timezone must be a valid IANA identifier");
|
|
5799
|
+
var CronExpressionSchema = import_zod51.z.string().min(1, "cronExpression must be non-empty").max(200, "cronExpression must be at most 200 characters").refine(isCronStructurallyValid, "cronExpression must have 5 or 6 whitespace-separated segments");
|
|
5800
|
+
var IsoDatetimeSchema = import_zod51.z.string().datetime({ offset: true });
|
|
5794
5801
|
var SCHEDULE_PAYLOAD_PROMPT_MAX_LENGTH = 5e4;
|
|
5795
|
-
var SchedulePayloadV1Schema =
|
|
5802
|
+
var SchedulePayloadV1Schema = import_zod51.z.object({
|
|
5796
5803
|
/** Required for v1 — `RunService.createRun` rejects empty prompts. */
|
|
5797
|
-
prompt:
|
|
5798
|
-
repo:
|
|
5799
|
-
ref:
|
|
5800
|
-
model:
|
|
5804
|
+
prompt: import_zod51.z.string().min(1).max(SCHEDULE_PAYLOAD_PROMPT_MAX_LENGTH),
|
|
5805
|
+
repo: import_zod51.z.string().max(2048).optional(),
|
|
5806
|
+
ref: import_zod51.z.string().max(255).optional(),
|
|
5807
|
+
model: import_zod51.z.string().max(255).optional(),
|
|
5801
5808
|
/**
|
|
5802
5809
|
* P1.6: tightened from `z.string().max(64).optional()` to
|
|
5803
5810
|
* `ProviderTypeSchema.optional()`. Catches invalid provider strings
|
|
@@ -5813,31 +5820,31 @@ var SchedulePayloadV1Schema = import_zod50.z.object({
|
|
|
5813
5820
|
* cron-triggered runs. Null / undefined falls back to the
|
|
5814
5821
|
* service-level Bedrock key.
|
|
5815
5822
|
*/
|
|
5816
|
-
triggerUserLdap:
|
|
5823
|
+
triggerUserLdap: import_zod51.z.string().min(1).max(255).optional()
|
|
5817
5824
|
}).strict();
|
|
5818
|
-
var SchedulePayloadV2Schema =
|
|
5825
|
+
var SchedulePayloadV2Schema = import_zod51.z.object({
|
|
5819
5826
|
/**
|
|
5820
5827
|
* Sandbox-environment overrides forwarded to
|
|
5821
5828
|
* `CreateSessionRequest.configValues`. Reserved-env-key sanitization
|
|
5822
5829
|
* is enforced at the SessionStartupService boundary; the schema
|
|
5823
5830
|
* here keeps the shape opaque to avoid duplicating that policy.
|
|
5824
5831
|
*/
|
|
5825
|
-
configValues:
|
|
5832
|
+
configValues: import_zod51.z.record(import_zod51.z.string(), import_zod51.z.string()).optional(),
|
|
5826
5833
|
/** Free-form audit metadata; non-functional. */
|
|
5827
|
-
metadata:
|
|
5834
|
+
metadata: import_zod51.z.record(import_zod51.z.string(), import_zod51.z.unknown()).optional()
|
|
5828
5835
|
}).strict();
|
|
5829
|
-
var ScheduleInlineV1PayloadSchema =
|
|
5830
|
-
prompt:
|
|
5831
|
-
repo:
|
|
5832
|
-
ref:
|
|
5833
|
-
model:
|
|
5836
|
+
var ScheduleInlineV1PayloadSchema = import_zod51.z.object({
|
|
5837
|
+
prompt: import_zod51.z.string().min(1).max(SCHEDULE_PAYLOAD_PROMPT_MAX_LENGTH),
|
|
5838
|
+
repo: import_zod51.z.string().min(1).max(2048).optional(),
|
|
5839
|
+
ref: import_zod51.z.string().min(1).max(255).optional(),
|
|
5840
|
+
model: import_zod51.z.string().max(255).optional(),
|
|
5834
5841
|
/**
|
|
5835
5842
|
* P1.6: see `SchedulePayloadV1Schema.provider` — same rationale.
|
|
5836
5843
|
* Closes the unsafe `as RunSpec["provider"]` cast in
|
|
5837
5844
|
* `schedule-dispatcher.ts dispatchInlineV1` (P1.3 review [CONSIDER]).
|
|
5838
5845
|
*/
|
|
5839
5846
|
provider: ProviderTypeSchema.optional(),
|
|
5840
|
-
triggerUserLdap:
|
|
5847
|
+
triggerUserLdap: import_zod51.z.string().min(1).max(255).optional(),
|
|
5841
5848
|
/**
|
|
5842
5849
|
* Per-fire MCP / Skills enable lists — same wire shape the home
|
|
5843
5850
|
* composer sends to `POST /api/agents` (run-level override, spec
|
|
@@ -5861,20 +5868,20 @@ var ScheduleInlineV1PayloadSchema = import_zod50.z.object({
|
|
|
5861
5868
|
* onto every synthesised `RunSpec`, so each cron-created Run sees
|
|
5862
5869
|
* the same attachments. Capped at 5 to match `RunSpec.attachments`.
|
|
5863
5870
|
*/
|
|
5864
|
-
attachments:
|
|
5871
|
+
attachments: import_zod51.z.array(AttachmentMetaSchema).max(5).optional()
|
|
5865
5872
|
}).strict();
|
|
5866
5873
|
var SCHEDULE_INLINE_V2_WORKLOAD_SLUG_REGEX = /^[a-z0-9][a-z0-9-]{0,127}$/;
|
|
5867
|
-
var ScheduleInlineV2PayloadSchema =
|
|
5868
|
-
workloadSlug:
|
|
5874
|
+
var ScheduleInlineV2PayloadSchema = import_zod51.z.object({
|
|
5875
|
+
workloadSlug: import_zod51.z.string().min(1).max(128).refine(
|
|
5869
5876
|
(s) => SCHEDULE_INLINE_V2_WORKLOAD_SLUG_REGEX.test(s),
|
|
5870
5877
|
"workloadSlug must be lowercase alphanumeric / dashes (1..128 chars)"
|
|
5871
5878
|
),
|
|
5872
5879
|
/** Default `"latest"`; UUID strings are treated as revision pin. */
|
|
5873
|
-
revisionSelector:
|
|
5874
|
-
configValues:
|
|
5875
|
-
metadata:
|
|
5880
|
+
revisionSelector: import_zod51.z.union([import_zod51.z.literal("latest"), import_zod51.z.string().uuid()]).default("latest"),
|
|
5881
|
+
configValues: import_zod51.z.record(import_zod51.z.string(), import_zod51.z.string()).optional(),
|
|
5882
|
+
metadata: import_zod51.z.record(import_zod51.z.string(), import_zod51.z.unknown()).optional()
|
|
5876
5883
|
}).strict();
|
|
5877
|
-
var RawPayloadSchema =
|
|
5884
|
+
var RawPayloadSchema = import_zod51.z.record(import_zod51.z.string(), import_zod51.z.unknown());
|
|
5878
5885
|
var ADMISSIBLE_TARGET_VERSION_COMBOS = ["workload:v2", "agent:v1", "inline_v1:v1", "inline_v1:v2", "inline_v2:v2"];
|
|
5879
5886
|
function refineTargetFields(schema) {
|
|
5880
5887
|
return schema.superRefine((value, ctx) => {
|
|
@@ -5882,14 +5889,14 @@ function refineTargetFields(schema) {
|
|
|
5882
5889
|
case "workload": {
|
|
5883
5890
|
if (!value.targetWorkloadId) {
|
|
5884
5891
|
ctx.addIssue({
|
|
5885
|
-
code:
|
|
5892
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5886
5893
|
message: "targetWorkloadId is required when targetKind is 'workload'",
|
|
5887
5894
|
path: ["targetWorkloadId"]
|
|
5888
5895
|
});
|
|
5889
5896
|
}
|
|
5890
5897
|
if (value.targetAgentId) {
|
|
5891
5898
|
ctx.addIssue({
|
|
5892
|
-
code:
|
|
5899
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5893
5900
|
message: "targetAgentId must be omitted when targetKind is 'workload'",
|
|
5894
5901
|
path: ["targetAgentId"]
|
|
5895
5902
|
});
|
|
@@ -5899,21 +5906,21 @@ function refineTargetFields(schema) {
|
|
|
5899
5906
|
case "agent": {
|
|
5900
5907
|
if (!value.targetAgentId) {
|
|
5901
5908
|
ctx.addIssue({
|
|
5902
|
-
code:
|
|
5909
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5903
5910
|
message: "targetAgentId is required when targetKind is 'agent'",
|
|
5904
5911
|
path: ["targetAgentId"]
|
|
5905
5912
|
});
|
|
5906
5913
|
}
|
|
5907
5914
|
if (value.targetWorkloadId) {
|
|
5908
5915
|
ctx.addIssue({
|
|
5909
|
-
code:
|
|
5916
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5910
5917
|
message: "targetWorkloadId must be omitted when targetKind is 'agent'",
|
|
5911
5918
|
path: ["targetWorkloadId"]
|
|
5912
5919
|
});
|
|
5913
5920
|
}
|
|
5914
5921
|
if (value.targetRevisionId) {
|
|
5915
5922
|
ctx.addIssue({
|
|
5916
|
-
code:
|
|
5923
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5917
5924
|
message: "targetRevisionId is only allowed when targetKind is 'workload'",
|
|
5918
5925
|
path: ["targetRevisionId"]
|
|
5919
5926
|
});
|
|
@@ -5924,21 +5931,21 @@ function refineTargetFields(schema) {
|
|
|
5924
5931
|
case "inline_v2": {
|
|
5925
5932
|
if (value.targetWorkloadId) {
|
|
5926
5933
|
ctx.addIssue({
|
|
5927
|
-
code:
|
|
5934
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5928
5935
|
message: `targetWorkloadId must be omitted when targetKind is '${value.targetKind}'`,
|
|
5929
5936
|
path: ["targetWorkloadId"]
|
|
5930
5937
|
});
|
|
5931
5938
|
}
|
|
5932
5939
|
if (value.targetAgentId) {
|
|
5933
5940
|
ctx.addIssue({
|
|
5934
|
-
code:
|
|
5941
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5935
5942
|
message: `targetAgentId must be omitted when targetKind is '${value.targetKind}'`,
|
|
5936
5943
|
path: ["targetAgentId"]
|
|
5937
5944
|
});
|
|
5938
5945
|
}
|
|
5939
5946
|
if (value.targetRevisionId) {
|
|
5940
5947
|
ctx.addIssue({
|
|
5941
|
-
code:
|
|
5948
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5942
5949
|
message: `targetRevisionId must be omitted when targetKind is '${value.targetKind}' (use payload.revisionSelector for inline_v2)`,
|
|
5943
5950
|
path: ["targetRevisionId"]
|
|
5944
5951
|
});
|
|
@@ -5949,7 +5956,7 @@ function refineTargetFields(schema) {
|
|
|
5949
5956
|
const combo = `${value.targetKind}:${value.pilotApiVersionPreference}`;
|
|
5950
5957
|
if (!ADMISSIBLE_TARGET_VERSION_COMBOS.includes(combo)) {
|
|
5951
5958
|
ctx.addIssue({
|
|
5952
|
-
code:
|
|
5959
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5953
5960
|
message: `Unsupported (targetKind, pilotApiVersionPreference) combination. Admissible: ${ADMISSIBLE_TARGET_VERSION_COMBOS.join(
|
|
5954
5961
|
", "
|
|
5955
5962
|
)}`,
|
|
@@ -5959,7 +5966,7 @@ function refineTargetFields(schema) {
|
|
|
5959
5966
|
const isInline = value.targetKind === "inline_v1" || value.targetKind === "inline_v2";
|
|
5960
5967
|
if (!isInline && !value.projectId) {
|
|
5961
5968
|
ctx.addIssue({
|
|
5962
|
-
code:
|
|
5969
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5963
5970
|
message: `projectId is required when targetKind is '${value.targetKind}'`,
|
|
5964
5971
|
path: ["projectId"]
|
|
5965
5972
|
});
|
|
@@ -5968,7 +5975,7 @@ function refineTargetFields(schema) {
|
|
|
5968
5975
|
const hasOwner = Boolean(value.ownerLdap && value.ownerLdap.length > 0);
|
|
5969
5976
|
if (!hasProject && !hasOwner) {
|
|
5970
5977
|
ctx.addIssue({
|
|
5971
|
-
code:
|
|
5978
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5972
5979
|
message: "At least one of projectId / ownerLdap must be present (project-or-owner anchor)",
|
|
5973
5980
|
path: ["ownerLdap"]
|
|
5974
5981
|
});
|
|
@@ -5982,7 +5989,7 @@ function refineLifecycleWindow(schema) {
|
|
|
5982
5989
|
const end = Date.parse(value.endAt);
|
|
5983
5990
|
if (Number.isFinite(start) && Number.isFinite(end) && end <= start) {
|
|
5984
5991
|
ctx.addIssue({
|
|
5985
|
-
code:
|
|
5992
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
5986
5993
|
message: "endAt must be strictly later than startAt",
|
|
5987
5994
|
path: ["endAt"]
|
|
5988
5995
|
});
|
|
@@ -5990,13 +5997,13 @@ function refineLifecycleWindow(schema) {
|
|
|
5990
5997
|
}
|
|
5991
5998
|
});
|
|
5992
5999
|
}
|
|
5993
|
-
var CreateScheduleRequestBaseSchema =
|
|
6000
|
+
var CreateScheduleRequestBaseSchema = import_zod51.z.object({
|
|
5994
6001
|
/**
|
|
5995
6002
|
* Host project. Required for `targetKind ∈ {workload, agent}` (P0
|
|
5996
6003
|
* shape); MAY be null for `inline_v1` / `inline_v2`. When null, the
|
|
5997
6004
|
* `ownerLdap` field becomes the sole authorization anchor.
|
|
5998
6005
|
*/
|
|
5999
|
-
projectId:
|
|
6006
|
+
projectId: import_zod51.z.string().uuid().nullable().optional(),
|
|
6000
6007
|
/**
|
|
6001
6008
|
* LDAP of the schedule owner (P1.2). Distinct from the implicit
|
|
6002
6009
|
* `createdBy` which is captured server-side from the auth context.
|
|
@@ -6004,20 +6011,20 @@ var CreateScheduleRequestBaseSchema = import_zod50.z.object({
|
|
|
6004
6011
|
* authoritative for enforcing "createdBy === ownerLdap" on create
|
|
6005
6012
|
* (delegation / ownership transfer is an explicit follow-up).
|
|
6006
6013
|
*/
|
|
6007
|
-
ownerLdap:
|
|
6008
|
-
displayName:
|
|
6009
|
-
description:
|
|
6014
|
+
ownerLdap: import_zod51.z.string().min(1).max(255).optional(),
|
|
6015
|
+
displayName: import_zod51.z.string().min(1, "displayName must be non-empty").max(SCHEDULE_DISPLAY_NAME_MAX_LENGTH),
|
|
6016
|
+
description: import_zod51.z.string().max(SCHEDULE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
6010
6017
|
cronExpression: CronExpressionSchema,
|
|
6011
6018
|
timezone: TimezoneStringSchema,
|
|
6012
6019
|
targetKind: ScheduleTargetKindSchema,
|
|
6013
|
-
targetWorkloadId:
|
|
6014
|
-
targetRevisionId:
|
|
6015
|
-
targetAgentId:
|
|
6020
|
+
targetWorkloadId: import_zod51.z.string().uuid().optional(),
|
|
6021
|
+
targetRevisionId: import_zod51.z.string().uuid().optional(),
|
|
6022
|
+
targetAgentId: import_zod51.z.string().uuid().optional(),
|
|
6016
6023
|
pilotApiVersionPreference: ScheduleApiVersionPreferenceSchema,
|
|
6017
6024
|
concurrencyPolicy: ScheduleConcurrencyPolicySchema.default("allow"),
|
|
6018
6025
|
misfirePolicy: ScheduleMisfirePolicySchema.default("skip"),
|
|
6019
|
-
misfireGraceSeconds:
|
|
6020
|
-
consecutiveFailureThreshold:
|
|
6026
|
+
misfireGraceSeconds: import_zod51.z.number().int().min(SCHEDULE_MISFIRE_GRACE_SECONDS_MIN).max(SCHEDULE_MISFIRE_GRACE_SECONDS_MAX).default(SCHEDULE_MISFIRE_GRACE_SECONDS_DEFAULT),
|
|
6027
|
+
consecutiveFailureThreshold: import_zod51.z.number().int().min(SCHEDULE_FAILURE_THRESHOLD_MIN).max(SCHEDULE_FAILURE_THRESHOLD_MAX).default(SCHEDULE_FAILURE_THRESHOLD_DEFAULT),
|
|
6021
6028
|
startAt: IsoDatetimeSchema.optional(),
|
|
6022
6029
|
endAt: IsoDatetimeSchema.optional(),
|
|
6023
6030
|
/**
|
|
@@ -6048,7 +6055,7 @@ function refinePayload(schema) {
|
|
|
6048
6055
|
if (!result.success) {
|
|
6049
6056
|
for (const issue of result.error.issues) {
|
|
6050
6057
|
ctx.addIssue({
|
|
6051
|
-
code:
|
|
6058
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6052
6059
|
message: issue.message,
|
|
6053
6060
|
path: ["payload", ...issue.path]
|
|
6054
6061
|
});
|
|
@@ -6059,21 +6066,21 @@ function refinePayload(schema) {
|
|
|
6059
6066
|
var CreateScheduleRequestSchema = refinePayload(
|
|
6060
6067
|
refineLifecycleWindow(refineTargetFields(CreateScheduleRequestBaseSchema))
|
|
6061
6068
|
);
|
|
6062
|
-
var UpdateScheduleRequestBaseSchema =
|
|
6063
|
-
displayName:
|
|
6064
|
-
description:
|
|
6069
|
+
var UpdateScheduleRequestBaseSchema = import_zod51.z.object({
|
|
6070
|
+
displayName: import_zod51.z.string().min(1).max(SCHEDULE_DISPLAY_NAME_MAX_LENGTH).optional(),
|
|
6071
|
+
description: import_zod51.z.string().max(SCHEDULE_DESCRIPTION_MAX_LENGTH).nullable().optional(),
|
|
6065
6072
|
/**
|
|
6066
6073
|
* Convenience field — `true` ⇒ lifecycle_status='active',
|
|
6067
6074
|
* `false` ⇒ lifecycle_status='disabled'. Cannot reach `deleted`
|
|
6068
6075
|
* via PATCH (use DELETE).
|
|
6069
6076
|
*/
|
|
6070
|
-
enabled:
|
|
6077
|
+
enabled: import_zod51.z.boolean().optional(),
|
|
6071
6078
|
cronExpression: CronExpressionSchema.optional(),
|
|
6072
6079
|
timezone: TimezoneStringSchema.optional(),
|
|
6073
6080
|
concurrencyPolicy: ScheduleConcurrencyPolicySchema.optional(),
|
|
6074
6081
|
misfirePolicy: ScheduleMisfirePolicySchema.optional(),
|
|
6075
|
-
misfireGraceSeconds:
|
|
6076
|
-
consecutiveFailureThreshold:
|
|
6082
|
+
misfireGraceSeconds: import_zod51.z.number().int().min(SCHEDULE_MISFIRE_GRACE_SECONDS_MIN).max(SCHEDULE_MISFIRE_GRACE_SECONDS_MAX).optional(),
|
|
6083
|
+
consecutiveFailureThreshold: import_zod51.z.number().int().min(SCHEDULE_FAILURE_THRESHOLD_MIN).max(SCHEDULE_FAILURE_THRESHOLD_MAX).optional(),
|
|
6077
6084
|
endAt: IsoDatetimeSchema.nullable().optional(),
|
|
6078
6085
|
/**
|
|
6079
6086
|
* Replaces the entire dispatch payload. Null is forbidden — to
|
|
@@ -6088,41 +6095,41 @@ var UpdateScheduleRequestSchema = UpdateScheduleRequestBaseSchema.refine(
|
|
|
6088
6095
|
(data) => Object.keys(data).length > 0,
|
|
6089
6096
|
{ message: "PATCH body must contain at least one field" }
|
|
6090
6097
|
);
|
|
6091
|
-
var ScheduleViewBaseSchema =
|
|
6092
|
-
id:
|
|
6098
|
+
var ScheduleViewBaseSchema = import_zod51.z.object({
|
|
6099
|
+
id: import_zod51.z.string().uuid(),
|
|
6093
6100
|
/**
|
|
6094
6101
|
* Nullable since P1.2 — only inline kinds may have null projectId in
|
|
6095
6102
|
* persisted form; workload / agent kinds keep it set (enforced at
|
|
6096
6103
|
* create time and by DB shape CHECK).
|
|
6097
6104
|
*/
|
|
6098
|
-
projectId:
|
|
6105
|
+
projectId: import_zod51.z.string().uuid().nullable(),
|
|
6099
6106
|
/**
|
|
6100
6107
|
* Owner LDAP (P1.2). NOT NULL in DB; the read shape exposes it for
|
|
6101
6108
|
* UI to render "owned by" labels and for permission checks on
|
|
6102
6109
|
* project-less schedules.
|
|
6103
6110
|
*/
|
|
6104
|
-
ownerLdap:
|
|
6105
|
-
displayName:
|
|
6106
|
-
description:
|
|
6107
|
-
cronExpression:
|
|
6108
|
-
timezone:
|
|
6111
|
+
ownerLdap: import_zod51.z.string(),
|
|
6112
|
+
displayName: import_zod51.z.string(),
|
|
6113
|
+
description: import_zod51.z.string().nullable(),
|
|
6114
|
+
cronExpression: import_zod51.z.string(),
|
|
6115
|
+
timezone: import_zod51.z.string(),
|
|
6109
6116
|
targetKind: ScheduleTargetKindSchema,
|
|
6110
|
-
targetWorkloadId:
|
|
6111
|
-
targetRevisionId:
|
|
6112
|
-
targetAgentId:
|
|
6117
|
+
targetWorkloadId: import_zod51.z.string().uuid().nullable(),
|
|
6118
|
+
targetRevisionId: import_zod51.z.string().uuid().nullable(),
|
|
6119
|
+
targetAgentId: import_zod51.z.string().uuid().nullable(),
|
|
6113
6120
|
pilotApiVersionPreference: ScheduleApiVersionPreferenceSchema,
|
|
6114
6121
|
lifecycleStatus: ScheduleLifecycleStatusSchema,
|
|
6115
6122
|
concurrencyPolicy: ScheduleConcurrencyPolicySchema,
|
|
6116
6123
|
misfirePolicy: ScheduleMisfirePolicySchema,
|
|
6117
|
-
misfireGraceSeconds:
|
|
6124
|
+
misfireGraceSeconds: import_zod51.z.number().int().nonnegative(),
|
|
6118
6125
|
startAt: IsoDatetimeSchema.nullable(),
|
|
6119
6126
|
endAt: IsoDatetimeSchema.nullable(),
|
|
6120
6127
|
payload: RawPayloadSchema,
|
|
6121
|
-
consecutiveFailureCount:
|
|
6122
|
-
consecutiveFailureThreshold:
|
|
6128
|
+
consecutiveFailureCount: import_zod51.z.number().int().nonnegative(),
|
|
6129
|
+
consecutiveFailureThreshold: import_zod51.z.number().int().positive(),
|
|
6123
6130
|
lastTriggerAt: IsoDatetimeSchema.nullable(),
|
|
6124
6131
|
nextFireAt: IsoDatetimeSchema.nullable(),
|
|
6125
|
-
createdBy:
|
|
6132
|
+
createdBy: import_zod51.z.string(),
|
|
6126
6133
|
createdAt: IsoDatetimeSchema,
|
|
6127
6134
|
updatedAt: IsoDatetimeSchema,
|
|
6128
6135
|
deletedAt: IsoDatetimeSchema.nullable()
|
|
@@ -6147,37 +6154,37 @@ var ScheduleListItemSchema = ScheduleViewBaseSchema.pick({
|
|
|
6147
6154
|
createdAt: true,
|
|
6148
6155
|
updatedAt: true
|
|
6149
6156
|
});
|
|
6150
|
-
var ScheduleListResponseSchema =
|
|
6151
|
-
items:
|
|
6152
|
-
nextCursor:
|
|
6157
|
+
var ScheduleListResponseSchema = import_zod51.z.object({
|
|
6158
|
+
items: import_zod51.z.array(ScheduleListItemSchema),
|
|
6159
|
+
nextCursor: import_zod51.z.string().optional()
|
|
6153
6160
|
});
|
|
6154
|
-
var ScheduleTriggerViewSchema =
|
|
6155
|
-
id:
|
|
6156
|
-
scheduleId:
|
|
6161
|
+
var ScheduleTriggerViewSchema = import_zod51.z.object({
|
|
6162
|
+
id: import_zod51.z.string().uuid(),
|
|
6163
|
+
scheduleId: import_zod51.z.string().uuid(),
|
|
6157
6164
|
firedAt: IsoDatetimeSchema,
|
|
6158
6165
|
triggerSource: ScheduleTriggerSourceSchema,
|
|
6159
6166
|
status: ScheduleTriggerStatusSchema,
|
|
6160
6167
|
dispatchedAt: IsoDatetimeSchema.nullable(),
|
|
6161
|
-
dispatchedRunId:
|
|
6162
|
-
dispatchedSessionId:
|
|
6168
|
+
dispatchedRunId: import_zod51.z.string().uuid().nullable(),
|
|
6169
|
+
dispatchedSessionId: import_zod51.z.string().uuid().nullable(),
|
|
6163
6170
|
/**
|
|
6164
6171
|
* Owning agent of the dispatched Run / Session, when one exists.
|
|
6165
6172
|
* Run IDs join `runs.id`; Session IDs join `runs.session_id` with a
|
|
6166
6173
|
* cold-start legacy fallback to the matching run ID.
|
|
6167
6174
|
*/
|
|
6168
|
-
dispatchedAgentId:
|
|
6175
|
+
dispatchedAgentId: import_zod51.z.string().uuid().nullable(),
|
|
6169
6176
|
skippedReason: ScheduleSkippedReasonSchema.nullable(),
|
|
6170
6177
|
failureReasonCode: ScheduleFailureReasonCodeSchema.nullable(),
|
|
6171
|
-
failureReasonMessage:
|
|
6172
|
-
idempotencyKey:
|
|
6173
|
-
attemptCount:
|
|
6174
|
-
blockingTriggerId:
|
|
6178
|
+
failureReasonMessage: import_zod51.z.string().max(SCHEDULE_FAILURE_REASON_MESSAGE_MAX_LENGTH).nullable(),
|
|
6179
|
+
idempotencyKey: import_zod51.z.string(),
|
|
6180
|
+
attemptCount: import_zod51.z.number().int().nonnegative(),
|
|
6181
|
+
blockingTriggerId: import_zod51.z.string().uuid().nullable(),
|
|
6175
6182
|
createdAt: IsoDatetimeSchema
|
|
6176
6183
|
}).superRefine((trigger, ctx) => {
|
|
6177
6184
|
if (trigger.status === "dispatched") {
|
|
6178
6185
|
if (!trigger.dispatchedAt) {
|
|
6179
6186
|
ctx.addIssue({
|
|
6180
|
-
code:
|
|
6187
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6181
6188
|
message: "dispatchedAt is required when status is 'dispatched'",
|
|
6182
6189
|
path: ["dispatchedAt"]
|
|
6183
6190
|
});
|
|
@@ -6186,7 +6193,7 @@ var ScheduleTriggerViewSchema = import_zod50.z.object({
|
|
|
6186
6193
|
const hasSession = trigger.dispatchedSessionId !== null;
|
|
6187
6194
|
if (hasRun === hasSession) {
|
|
6188
6195
|
ctx.addIssue({
|
|
6189
|
-
code:
|
|
6196
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6190
6197
|
message: "Exactly one of dispatchedRunId / dispatchedSessionId must be set when status is 'dispatched'",
|
|
6191
6198
|
path: ["dispatchedRunId"]
|
|
6192
6199
|
});
|
|
@@ -6194,7 +6201,7 @@ var ScheduleTriggerViewSchema = import_zod50.z.object({
|
|
|
6194
6201
|
} else {
|
|
6195
6202
|
if (trigger.dispatchedAt !== null) {
|
|
6196
6203
|
ctx.addIssue({
|
|
6197
|
-
code:
|
|
6204
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6198
6205
|
message: "dispatchedAt must be null when status is not 'dispatched'",
|
|
6199
6206
|
path: ["dispatchedAt"]
|
|
6200
6207
|
});
|
|
@@ -6202,74 +6209,74 @@ var ScheduleTriggerViewSchema = import_zod50.z.object({
|
|
|
6202
6209
|
}
|
|
6203
6210
|
if (trigger.status === "skipped" && trigger.skippedReason === null) {
|
|
6204
6211
|
ctx.addIssue({
|
|
6205
|
-
code:
|
|
6212
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6206
6213
|
message: "skippedReason is required when status is 'skipped'",
|
|
6207
6214
|
path: ["skippedReason"]
|
|
6208
6215
|
});
|
|
6209
6216
|
}
|
|
6210
6217
|
if (trigger.status !== "skipped" && trigger.skippedReason !== null) {
|
|
6211
6218
|
ctx.addIssue({
|
|
6212
|
-
code:
|
|
6219
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6213
6220
|
message: "skippedReason must be null when status is not 'skipped'",
|
|
6214
6221
|
path: ["skippedReason"]
|
|
6215
6222
|
});
|
|
6216
6223
|
}
|
|
6217
6224
|
if (trigger.status === "failed_to_dispatch" && trigger.failureReasonCode === null) {
|
|
6218
6225
|
ctx.addIssue({
|
|
6219
|
-
code:
|
|
6226
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6220
6227
|
message: "failureReasonCode is required when status is 'failed_to_dispatch'",
|
|
6221
6228
|
path: ["failureReasonCode"]
|
|
6222
6229
|
});
|
|
6223
6230
|
}
|
|
6224
6231
|
if (trigger.status !== "failed_to_dispatch" && trigger.failureReasonCode !== null) {
|
|
6225
6232
|
ctx.addIssue({
|
|
6226
|
-
code:
|
|
6233
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6227
6234
|
message: "failureReasonCode must be null when status is not 'failed_to_dispatch'",
|
|
6228
6235
|
path: ["failureReasonCode"]
|
|
6229
6236
|
});
|
|
6230
6237
|
}
|
|
6231
6238
|
if (trigger.blockingTriggerId !== null && !(trigger.status === "skipped" && trigger.skippedReason === "concurrency_forbidden")) {
|
|
6232
6239
|
ctx.addIssue({
|
|
6233
|
-
code:
|
|
6240
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6234
6241
|
message: "blockingTriggerId is only meaningful for skipped+concurrency_forbidden rows",
|
|
6235
6242
|
path: ["blockingTriggerId"]
|
|
6236
6243
|
});
|
|
6237
6244
|
}
|
|
6238
6245
|
});
|
|
6239
|
-
var ScheduleTriggerListResponseSchema =
|
|
6240
|
-
items:
|
|
6241
|
-
nextCursor:
|
|
6246
|
+
var ScheduleTriggerListResponseSchema = import_zod51.z.object({
|
|
6247
|
+
items: import_zod51.z.array(ScheduleTriggerViewSchema),
|
|
6248
|
+
nextCursor: import_zod51.z.string().optional()
|
|
6242
6249
|
});
|
|
6243
|
-
var RunScheduleResponseSchema =
|
|
6244
|
-
triggerId:
|
|
6245
|
-
dispatchedRunId:
|
|
6246
|
-
dispatchedSessionId:
|
|
6250
|
+
var RunScheduleResponseSchema = import_zod51.z.object({
|
|
6251
|
+
triggerId: import_zod51.z.string().uuid(),
|
|
6252
|
+
dispatchedRunId: import_zod51.z.string().uuid().optional(),
|
|
6253
|
+
dispatchedSessionId: import_zod51.z.string().uuid().optional()
|
|
6247
6254
|
}).superRefine((value, ctx) => {
|
|
6248
6255
|
const hasRun = value.dispatchedRunId !== void 0;
|
|
6249
6256
|
const hasSession = value.dispatchedSessionId !== void 0;
|
|
6250
6257
|
if (hasRun === hasSession) {
|
|
6251
6258
|
ctx.addIssue({
|
|
6252
|
-
code:
|
|
6259
|
+
code: import_zod51.z.ZodIssueCode.custom,
|
|
6253
6260
|
message: "Exactly one of dispatchedRunId / dispatchedSessionId must be present in run-now response"
|
|
6254
6261
|
});
|
|
6255
6262
|
}
|
|
6256
6263
|
});
|
|
6257
|
-
var ScheduleApiErrorBodySchema =
|
|
6258
|
-
error:
|
|
6264
|
+
var ScheduleApiErrorBodySchema = import_zod51.z.object({
|
|
6265
|
+
error: import_zod51.z.object({
|
|
6259
6266
|
code: ScheduleApiErrorCodeSchema,
|
|
6260
|
-
message:
|
|
6261
|
-
details:
|
|
6267
|
+
message: import_zod51.z.string(),
|
|
6268
|
+
details: import_zod51.z.record(import_zod51.z.string(), import_zod51.z.unknown()).optional()
|
|
6262
6269
|
})
|
|
6263
6270
|
});
|
|
6264
|
-
var EnvChangeFanoutJobSchema =
|
|
6265
|
-
environmentId:
|
|
6266
|
-
projectId:
|
|
6267
|
-
trigger:
|
|
6271
|
+
var EnvChangeFanoutJobSchema = import_zod52.z.object({
|
|
6272
|
+
environmentId: import_zod52.z.string().uuid(),
|
|
6273
|
+
projectId: import_zod52.z.string().uuid(),
|
|
6274
|
+
trigger: import_zod52.z.enum(["env_change", "rebake"]).default("env_change")
|
|
6268
6275
|
}).strict();
|
|
6269
|
-
var EnvironmentReleasePropagationJobSchema =
|
|
6270
|
-
environmentId:
|
|
6276
|
+
var EnvironmentReleasePropagationJobSchema = import_zod52.z.object({
|
|
6277
|
+
environmentId: import_zod52.z.string().uuid(),
|
|
6271
6278
|
/** Released base template name (patch source + mirror-refresh pairing key). */
|
|
6272
|
-
baseTemplateName:
|
|
6279
|
+
baseTemplateName: import_zod52.z.string().min(1),
|
|
6273
6280
|
/**
|
|
6274
6281
|
* Release identity (E-DEC6): the `platform_release` version's idempotency
|
|
6275
6282
|
* key — a redelivered job never creates a duplicate version (template
|
|
@@ -6277,46 +6284,46 @@ var EnvironmentReleasePropagationJobSchema = import_zod51.z.object({
|
|
|
6277
6284
|
* deploy-window compatibility with in-flight pre-E-DEC6 jobs; the worker
|
|
6278
6285
|
* falls back to `legacy:<baseTemplateName>`.
|
|
6279
6286
|
*/
|
|
6280
|
-
releaseRef:
|
|
6287
|
+
releaseRef: import_zod52.z.string().min(1).optional()
|
|
6281
6288
|
}).strict();
|
|
6282
|
-
var EnvironmentPackagesBuildJobSchema =
|
|
6283
|
-
environmentId:
|
|
6289
|
+
var EnvironmentPackagesBuildJobSchema = import_zod52.z.object({
|
|
6290
|
+
environmentId: import_zod52.z.string().uuid(),
|
|
6284
6291
|
/**
|
|
6285
6292
|
* The building version. Its predecessor (version - 1, or none when this
|
|
6286
6293
|
* is v1) is the CAS `fromVersion` of the deferred second-phase repoint
|
|
6287
6294
|
* (PKG-D3) — versions are strictly monotonic (+1 under the env row
|
|
6288
6295
|
* lock), so it is derived, not carried.
|
|
6289
6296
|
*/
|
|
6290
|
-
version:
|
|
6297
|
+
version: import_zod52.z.number().int().positive(),
|
|
6291
6298
|
/** Who initiated the edit (repoint ledger actor on the second phase). */
|
|
6292
|
-
actor:
|
|
6299
|
+
actor: import_zod52.z.string().nullable(),
|
|
6293
6300
|
/**
|
|
6294
6301
|
* ENV-V5 flag captured at the edit: false = advanced create-only path —
|
|
6295
6302
|
* the second phase skips the repoint even after a successful build.
|
|
6296
6303
|
*/
|
|
6297
|
-
repointReferences:
|
|
6304
|
+
repointReferences: import_zod52.z.boolean().default(true),
|
|
6298
6305
|
/**
|
|
6299
6306
|
* Ledger source of the second-phase repoint: user_edit for interactive
|
|
6300
6307
|
* edits, platform_release for the PKG-D7 rebake pipeline.
|
|
6301
6308
|
*/
|
|
6302
|
-
repointSource:
|
|
6309
|
+
repointSource: import_zod52.z.enum(["user_edit", "platform_release"]).default("user_edit"),
|
|
6303
6310
|
/** trigger = generate+start the build; poll = check build status. */
|
|
6304
|
-
phase:
|
|
6311
|
+
phase: import_zod52.z.enum(["trigger", "poll"]).default("trigger")
|
|
6305
6312
|
}).strict();
|
|
6306
|
-
var EnvironmentDeleteCleanupJobSchema =
|
|
6307
|
-
projectId:
|
|
6308
|
-
environmentId:
|
|
6313
|
+
var EnvironmentDeleteCleanupJobSchema = import_zod52.z.object({
|
|
6314
|
+
projectId: import_zod52.z.string().uuid(),
|
|
6315
|
+
environmentId: import_zod52.z.string().uuid(),
|
|
6309
6316
|
/** Archived Dockerfile paths captured from `environment_versions` right before the delete. */
|
|
6310
|
-
dockerfilePaths:
|
|
6317
|
+
dockerfilePaths: import_zod52.z.array(import_zod52.z.string().min(1)).min(1)
|
|
6311
6318
|
}).strict();
|
|
6312
|
-
var EnvironmentStatusSchema =
|
|
6313
|
-
var EnvironmentVersionSourceSchema =
|
|
6319
|
+
var EnvironmentStatusSchema = import_zod52.z.enum(["active", "archived"]);
|
|
6320
|
+
var EnvironmentVersionSourceSchema = import_zod52.z.enum([
|
|
6314
6321
|
"user_edit",
|
|
6315
6322
|
"platform_release",
|
|
6316
6323
|
"seed",
|
|
6317
6324
|
"backfill"
|
|
6318
6325
|
]);
|
|
6319
|
-
var EnvironmentRepointSourceSchema =
|
|
6326
|
+
var EnvironmentRepointSourceSchema = import_zod52.z.enum([
|
|
6320
6327
|
"user_edit",
|
|
6321
6328
|
"platform_release",
|
|
6322
6329
|
"stage_binding",
|
|
@@ -6325,9 +6332,9 @@ var EnvironmentRepointSourceSchema = import_zod51.z.enum([
|
|
|
6325
6332
|
]);
|
|
6326
6333
|
var ENVIRONMENT_CPU_QUANTITY_RE = /^\d+(\.\d+)?m?$/;
|
|
6327
6334
|
var ENVIRONMENT_MEMORY_QUANTITY_RE = /^\d+(\.\d+)?(Ki|Mi|Gi|Ti|K|M|G|T)$/;
|
|
6328
|
-
var EnvironmentResourcesSchema =
|
|
6329
|
-
cpu:
|
|
6330
|
-
memory:
|
|
6335
|
+
var EnvironmentResourcesSchema = import_zod52.z.object({
|
|
6336
|
+
cpu: import_zod52.z.string().regex(ENVIRONMENT_CPU_QUANTITY_RE, 'cpu must be a K8s quantity like "2", "0.5" or "500m"'),
|
|
6337
|
+
memory: import_zod52.z.string().regex(ENVIRONMENT_MEMORY_QUANTITY_RE, 'memory must be a K8s quantity like "4Gi" or "512Mi"')
|
|
6331
6338
|
}).strict();
|
|
6332
6339
|
var RESERVED_ENVIRONMENT_ENV_PREFIXES = [
|
|
6333
6340
|
"POD_AGENT_",
|
|
@@ -6363,14 +6370,14 @@ function findReservedEnvironmentEnvKey(envVars) {
|
|
|
6363
6370
|
return null;
|
|
6364
6371
|
}
|
|
6365
6372
|
var ENVIRONMENT_ENV_VAR_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
6366
|
-
var EnvironmentEnvVarsSchema =
|
|
6367
|
-
|
|
6368
|
-
|
|
6373
|
+
var EnvironmentEnvVarsSchema = import_zod52.z.record(
|
|
6374
|
+
import_zod52.z.string().regex(ENVIRONMENT_ENV_VAR_KEY_RE, "env var keys must match [A-Za-z_][A-Za-z0-9_]*"),
|
|
6375
|
+
import_zod52.z.string().max(4e3)
|
|
6369
6376
|
).superRefine((envVars, ctx) => {
|
|
6370
6377
|
const reserved = findReservedEnvironmentEnvKey(envVars);
|
|
6371
6378
|
if (reserved) {
|
|
6372
6379
|
ctx.addIssue({
|
|
6373
|
-
code:
|
|
6380
|
+
code: import_zod52.z.ZodIssueCode.custom,
|
|
6374
6381
|
path: [reserved],
|
|
6375
6382
|
// `params.pilotPolicyCode` is LOAD-BEARING: `classifyEnvironmentInputIssues`
|
|
6376
6383
|
// (below) reads it so the four environment routes (agent-hub +
|
|
@@ -6387,14 +6394,14 @@ var EnvironmentEnvVarsSchema = import_zod51.z.record(
|
|
|
6387
6394
|
});
|
|
6388
6395
|
}
|
|
6389
6396
|
});
|
|
6390
|
-
var EnvironmentDefaultTtlSecondsSchema =
|
|
6397
|
+
var EnvironmentDefaultTtlSecondsSchema = import_zod52.z.number().int().positive().max(30 * 24 * 60 * 60);
|
|
6391
6398
|
var ENVIRONMENT_PACKAGE_ENTRY_PATTERN = /^[A-Za-z0-9@_][A-Za-z0-9@._/:+,[\]<>=!~^*-]*$/;
|
|
6392
|
-
var EnvironmentPackageEntrySchema =
|
|
6399
|
+
var EnvironmentPackageEntrySchema = import_zod52.z.string().min(1).max(128).regex(
|
|
6393
6400
|
ENVIRONMENT_PACKAGE_ENTRY_PATTERN,
|
|
6394
6401
|
"package entries must not contain whitespace or shell metacharacters (PKG-D1)"
|
|
6395
6402
|
);
|
|
6396
|
-
var environmentPackageListSchema =
|
|
6397
|
-
var EnvironmentPackagesSchema =
|
|
6403
|
+
var environmentPackageListSchema = import_zod52.z.array(EnvironmentPackageEntrySchema).max(64);
|
|
6404
|
+
var EnvironmentPackagesSchema = import_zod52.z.object({
|
|
6398
6405
|
pip: environmentPackageListSchema.optional(),
|
|
6399
6406
|
npm: environmentPackageListSchema.optional(),
|
|
6400
6407
|
apt: environmentPackageListSchema.optional(),
|
|
@@ -6407,7 +6414,7 @@ function normalizeEnvironmentPackages(value) {
|
|
|
6407
6414
|
const entries = Object.entries(value).filter(([, list]) => list !== void 0 && list.length > 0);
|
|
6408
6415
|
return entries.length > 0 ? Object.fromEntries(entries) : null;
|
|
6409
6416
|
}
|
|
6410
|
-
var EnvironmentConfigSchema =
|
|
6417
|
+
var EnvironmentConfigSchema = import_zod52.z.object({
|
|
6411
6418
|
// PKG-D1 shape + PKG-D2 gate: malformed packages → 400 here; a VALID
|
|
6412
6419
|
// non-null value still 422s via findUnsupportedEnvironmentConfigField
|
|
6413
6420
|
// until the P2.1-A2 pipeline PR flips the gate. Tightening from
|
|
@@ -6417,7 +6424,7 @@ var EnvironmentConfigSchema = import_zod51.z.object({
|
|
|
6417
6424
|
// drops the optional mark) — `.optional()` restores the v3 inference so
|
|
6418
6425
|
// callers can construct partial configs; runtime behavior is unchanged.
|
|
6419
6426
|
packages: EnvironmentPackagesSchema.nullish().transform(normalizeEnvironmentPackages).optional(),
|
|
6420
|
-
networking:
|
|
6427
|
+
networking: import_zod52.z.unknown().nullish(),
|
|
6421
6428
|
resources: EnvironmentResourcesSchema.nullish(),
|
|
6422
6429
|
// Normalize an empty `{}` to `null` (E-DEC4 null-representation LOCK — the
|
|
6423
6430
|
// pool-fingerprint hash must not see `{}` vs `null` as different). Preserve
|
|
@@ -6428,72 +6435,72 @@ var EnvironmentConfigSchema = import_zod51.z.object({
|
|
|
6428
6435
|
).optional(),
|
|
6429
6436
|
defaultTtlSeconds: EnvironmentDefaultTtlSecondsSchema.nullish()
|
|
6430
6437
|
}).strict();
|
|
6431
|
-
var EnvironmentVersionConfigSchema =
|
|
6432
|
-
provider:
|
|
6433
|
-
providerPoolName:
|
|
6438
|
+
var EnvironmentVersionConfigSchema = import_zod52.z.object({
|
|
6439
|
+
provider: import_zod52.z.string(),
|
|
6440
|
+
providerPoolName: import_zod52.z.string().nullish(),
|
|
6434
6441
|
/** Base identity at version creation (null = the row itself is a base). */
|
|
6435
|
-
baseProviderTemplateName:
|
|
6436
|
-
resources:
|
|
6442
|
+
baseProviderTemplateName: import_zod52.z.string().nullish(),
|
|
6443
|
+
resources: import_zod52.z.object({ cpu: import_zod52.z.string(), memory: import_zod52.z.string() }).nullish(),
|
|
6437
6444
|
/** RAW record — no reserved-key refinement on the frozen read path. */
|
|
6438
|
-
envVars:
|
|
6439
|
-
defaultTtlSeconds:
|
|
6440
|
-
packages:
|
|
6441
|
-
networking:
|
|
6445
|
+
envVars: import_zod52.z.record(import_zod52.z.string(), import_zod52.z.string()).nullish(),
|
|
6446
|
+
defaultTtlSeconds: import_zod52.z.number().int().nullish(),
|
|
6447
|
+
packages: import_zod52.z.unknown().nullish(),
|
|
6448
|
+
networking: import_zod52.z.unknown().nullish()
|
|
6442
6449
|
}).passthrough();
|
|
6443
|
-
var EnvironmentVersionMaterializationStatusSchema =
|
|
6450
|
+
var EnvironmentVersionMaterializationStatusSchema = import_zod52.z.enum([
|
|
6444
6451
|
"building",
|
|
6445
6452
|
"ready",
|
|
6446
6453
|
"failed",
|
|
6447
6454
|
"superseded"
|
|
6448
6455
|
]);
|
|
6449
|
-
var EnvironmentVersionSchema =
|
|
6450
|
-
environmentId:
|
|
6451
|
-
version:
|
|
6456
|
+
var EnvironmentVersionSchema = import_zod52.z.object({
|
|
6457
|
+
environmentId: import_zod52.z.string().uuid(),
|
|
6458
|
+
version: import_zod52.z.number().int().positive(),
|
|
6452
6459
|
config: EnvironmentVersionConfigSchema,
|
|
6453
6460
|
source: EnvironmentVersionSourceSchema,
|
|
6454
6461
|
/** Idempotency ref for machine producers (platform_release); null otherwise. */
|
|
6455
|
-
sourceRef:
|
|
6456
|
-
createdBy:
|
|
6457
|
-
createdAt:
|
|
6458
|
-
providerTemplateName:
|
|
6462
|
+
sourceRef: import_zod52.z.string().nullable(),
|
|
6463
|
+
createdBy: import_zod52.z.string().nullable(),
|
|
6464
|
+
createdAt: import_zod52.z.coerce.date(),
|
|
6465
|
+
providerTemplateName: import_zod52.z.string().nullable(),
|
|
6459
6466
|
/** null = pre-E-DEC7 version (ready semantics). */
|
|
6460
6467
|
materializationStatus: EnvironmentVersionMaterializationStatusSchema.nullable(),
|
|
6461
6468
|
/** Failure reason for the UI (PKG-D4); null unless failed. */
|
|
6462
|
-
materializationDetail:
|
|
6469
|
+
materializationDetail: import_zod52.z.string().nullable(),
|
|
6463
6470
|
/** Baked image ref (repository:tag@digest) once built (PKG-D6/D9). */
|
|
6464
|
-
imageRef:
|
|
6471
|
+
imageRef: import_zod52.z.string().nullable(),
|
|
6465
6472
|
/** Generated Dockerfile archived verbatim (PKG-D9, audit-only). */
|
|
6466
|
-
dockerfile:
|
|
6473
|
+
dockerfile: import_zod52.z.string().nullable()
|
|
6467
6474
|
}).strict();
|
|
6468
|
-
var EnvironmentRepointRecordSchema =
|
|
6469
|
-
id:
|
|
6470
|
-
environmentId:
|
|
6471
|
-
workloadId:
|
|
6472
|
-
workloadStageId:
|
|
6475
|
+
var EnvironmentRepointRecordSchema = import_zod52.z.object({
|
|
6476
|
+
id: import_zod52.z.string().uuid(),
|
|
6477
|
+
environmentId: import_zod52.z.string().uuid(),
|
|
6478
|
+
workloadId: import_zod52.z.string().uuid(),
|
|
6479
|
+
workloadStageId: import_zod52.z.string().uuid(),
|
|
6473
6480
|
stage: StageSchema,
|
|
6474
6481
|
/** null = first pin (the slot had no pinned version yet). */
|
|
6475
|
-
fromVersion:
|
|
6476
|
-
toVersion:
|
|
6482
|
+
fromVersion: import_zod52.z.number().int().positive().nullable(),
|
|
6483
|
+
toVersion: import_zod52.z.number().int().positive(),
|
|
6477
6484
|
source: EnvironmentRepointSourceSchema,
|
|
6478
|
-
actor:
|
|
6479
|
-
createdAt:
|
|
6485
|
+
actor: import_zod52.z.string().nullable(),
|
|
6486
|
+
createdAt: import_zod52.z.coerce.date()
|
|
6480
6487
|
}).strict();
|
|
6481
|
-
var EnvironmentReferenceSchema =
|
|
6482
|
-
workloadId:
|
|
6483
|
-
workloadSlug:
|
|
6488
|
+
var EnvironmentReferenceSchema = import_zod52.z.object({
|
|
6489
|
+
workloadId: import_zod52.z.string().uuid(),
|
|
6490
|
+
workloadSlug: import_zod52.z.string(),
|
|
6484
6491
|
stage: StageSchema,
|
|
6485
6492
|
/**
|
|
6486
6493
|
* Pinned environment version of this slot (ENV-V2). null = legacy pin
|
|
6487
6494
|
* written before the version line landed (deploy window) — resolution
|
|
6488
6495
|
* falls back to the tip version for those.
|
|
6489
6496
|
*/
|
|
6490
|
-
environmentVersion:
|
|
6497
|
+
environmentVersion: import_zod52.z.number().int().positive().nullable()
|
|
6491
6498
|
}).strict();
|
|
6492
|
-
var EnvironmentSchema =
|
|
6493
|
-
id:
|
|
6494
|
-
projectId:
|
|
6495
|
-
name:
|
|
6496
|
-
description:
|
|
6499
|
+
var EnvironmentSchema = import_zod52.z.object({
|
|
6500
|
+
id: import_zod52.z.string().uuid(),
|
|
6501
|
+
projectId: import_zod52.z.string().uuid(),
|
|
6502
|
+
name: import_zod52.z.string().min(1).max(255),
|
|
6503
|
+
description: import_zod52.z.string().nullish(),
|
|
6497
6504
|
status: EnvironmentStatusSchema,
|
|
6498
6505
|
config: EnvironmentConfigSchema,
|
|
6499
6506
|
/**
|
|
@@ -6502,19 +6509,19 @@ var EnvironmentSchema = import_zod51.z.object({
|
|
|
6502
6509
|
* `providerTemplateName` verbatim (no dedicated Kanyun template until the
|
|
6503
6510
|
* config first diverges, E5/P2.1).
|
|
6504
6511
|
*/
|
|
6505
|
-
base:
|
|
6506
|
-
referencedBy:
|
|
6512
|
+
base: import_zod52.z.object({ platformTemplateName: import_zod52.z.string() }).strict(),
|
|
6513
|
+
referencedBy: import_zod52.z.array(EnvironmentReferenceSchema),
|
|
6507
6514
|
/** Platform-shared environments are project-agnostic and admin-managed. */
|
|
6508
|
-
isPlatformShared:
|
|
6515
|
+
isPlatformShared: import_zod52.z.boolean(),
|
|
6509
6516
|
/**
|
|
6510
6517
|
* Tip of the version line (E-DEC6): the latest immutable version number.
|
|
6511
6518
|
* The row's config columns always mirror this version. null only for
|
|
6512
6519
|
* legacy rows created by pre-E-DEC6 writers during the deploy window
|
|
6513
6520
|
* (their first config write creates v1).
|
|
6514
6521
|
*/
|
|
6515
|
-
currentVersion:
|
|
6516
|
-
createdAt:
|
|
6517
|
-
updatedAt:
|
|
6522
|
+
currentVersion: import_zod52.z.number().int().positive().nullable(),
|
|
6523
|
+
createdAt: import_zod52.z.coerce.date(),
|
|
6524
|
+
updatedAt: import_zod52.z.coerce.date()
|
|
6518
6525
|
}).strict();
|
|
6519
6526
|
function findUnsupportedEnvironmentConfigField(config) {
|
|
6520
6527
|
if (!config) return null;
|
|
@@ -6525,7 +6532,7 @@ function rejectReservedConfigFields(config, ctx) {
|
|
|
6525
6532
|
const field = findUnsupportedEnvironmentConfigField(config);
|
|
6526
6533
|
if (field) {
|
|
6527
6534
|
ctx.addIssue({
|
|
6528
|
-
code:
|
|
6535
|
+
code: import_zod52.z.ZodIssueCode.custom,
|
|
6529
6536
|
path: ["config", field],
|
|
6530
6537
|
// `params.pilotPolicyCode` is what `classifyEnvironmentInputIssues` keys
|
|
6531
6538
|
// on (structural, spoof-proof) — see the env-var superRefine above.
|
|
@@ -6534,16 +6541,16 @@ function rejectReservedConfigFields(config, ctx) {
|
|
|
6534
6541
|
});
|
|
6535
6542
|
}
|
|
6536
6543
|
}
|
|
6537
|
-
var CreateEnvironmentInputSchema =
|
|
6538
|
-
name:
|
|
6539
|
-
description:
|
|
6540
|
-
base:
|
|
6544
|
+
var CreateEnvironmentInputSchema = import_zod52.z.object({
|
|
6545
|
+
name: import_zod52.z.string().min(1).max(255),
|
|
6546
|
+
description: import_zod52.z.string().max(4e3).optional(),
|
|
6547
|
+
base: import_zod52.z.object({ platformTemplateName: import_zod52.z.string().min(1) }).strict(),
|
|
6541
6548
|
config: EnvironmentConfigSchema.optional()
|
|
6542
6549
|
}).strict().superRefine((input, ctx) => rejectReservedConfigFields(input.config, ctx));
|
|
6543
|
-
var UpdateEnvironmentInputSchema =
|
|
6544
|
-
name:
|
|
6550
|
+
var UpdateEnvironmentInputSchema = import_zod52.z.object({
|
|
6551
|
+
name: import_zod52.z.string().min(1).max(255).optional(),
|
|
6545
6552
|
/** `null` clears the description; omitted keeps the stored value. */
|
|
6546
|
-
description:
|
|
6553
|
+
description: import_zod52.z.string().max(4e3).nullish(),
|
|
6547
6554
|
config: EnvironmentConfigSchema.optional(),
|
|
6548
6555
|
/**
|
|
6549
6556
|
* ENV-V5: a config-face change creates a new immutable version. Default
|
|
@@ -6553,11 +6560,11 @@ var UpdateEnvironmentInputSchema = import_zod51.z.object({
|
|
|
6553
6560
|
* dial slots individually via the repoint endpoint (canary/rollback).
|
|
6554
6561
|
* Ignored for metadata-only writes (name/description never version).
|
|
6555
6562
|
*/
|
|
6556
|
-
repointReferences:
|
|
6563
|
+
repointReferences: import_zod52.z.boolean().optional()
|
|
6557
6564
|
}).strict().superRefine((input, ctx) => rejectReservedConfigFields(input.config, ctx));
|
|
6558
|
-
var RepointEnvironmentInputSchema =
|
|
6559
|
-
toVersion:
|
|
6560
|
-
slots:
|
|
6565
|
+
var RepointEnvironmentInputSchema = import_zod52.z.object({
|
|
6566
|
+
toVersion: import_zod52.z.number().int().positive(),
|
|
6567
|
+
slots: import_zod52.z.array(import_zod52.z.object({ workloadId: import_zod52.z.string().uuid(), stage: StageSchema }).strict()).min(1).optional(),
|
|
6561
6568
|
/**
|
|
6562
6569
|
* TOCTOU guard (codex #7 residual, §4 impact-confirmation dialog): the
|
|
6563
6570
|
* FULL `(workloadId, stage)` set the caller observed as "affected" when
|
|
@@ -6574,7 +6581,7 @@ var RepointEnvironmentInputSchema = import_zod51.z.object({
|
|
|
6574
6581
|
* (backward compatible: platform/manifest callers that don't render a
|
|
6575
6582
|
* confirmation dialog are unaffected).
|
|
6576
6583
|
*/
|
|
6577
|
-
expectedSlots:
|
|
6584
|
+
expectedSlots: import_zod52.z.array(import_zod52.z.object({ workloadId: import_zod52.z.string().uuid(), stage: StageSchema }).strict()).optional()
|
|
6578
6585
|
}).strict();
|
|
6579
6586
|
var WORKER_PROTOCOL_TERMINAL_EVENT_TYPES = [
|
|
6580
6587
|
"worker_protocol.prompt.completed",
|
|
@@ -6589,13 +6596,13 @@ var LEAK_RECONCILER_INTERVAL_MS = 30 * 60 * 1e3;
|
|
|
6589
6596
|
var SESSION_STARTUP_LEASE_MS = 10 * 6e4;
|
|
6590
6597
|
var INSTRUCTIONS_JOIN_SEPARATOR = "\n\n";
|
|
6591
6598
|
var MANAGED_AGENT_PROFILE_KIND = "ManagedAgentProfile";
|
|
6592
|
-
var ManagedAgentProfileMetadataSchema =
|
|
6599
|
+
var ManagedAgentProfileMetadataSchema = import_zod53.z.object({
|
|
6593
6600
|
name: WorkloadManifestNameSchema,
|
|
6594
6601
|
displayName: WorkloadManifestDisplayNameSchema,
|
|
6595
|
-
labels:
|
|
6596
|
-
annotations:
|
|
6602
|
+
labels: import_zod53.z.record(import_zod53.z.string(), import_zod53.z.string()).optional(),
|
|
6603
|
+
annotations: import_zod53.z.record(import_zod53.z.string(), import_zod53.z.string()).optional()
|
|
6597
6604
|
}).strict();
|
|
6598
|
-
var ManagedAgentProfileSpecSchema =
|
|
6605
|
+
var ManagedAgentProfileSpecSchema = import_zod53.z.object({
|
|
6599
6606
|
runtimeTemplateRef: WorkloadManifestObjectRefSchema,
|
|
6600
6607
|
env: SessionConfigValuesSchema.optional(),
|
|
6601
6608
|
ui: WorkloadManifestUiHintSchema.optional(),
|
|
@@ -6617,7 +6624,7 @@ var ManagedAgentProfileSpecSchema = import_zod52.z.object({
|
|
|
6617
6624
|
// `agents.enabled_skills` at agent creation when the caller omits
|
|
6618
6625
|
// skills. See `specs/features/pilot-v2-managed-agent-profile.md`
|
|
6619
6626
|
// §"Phase C".
|
|
6620
|
-
skills:
|
|
6627
|
+
skills: import_zod53.z.array(import_zod53.z.string().min(1)).optional(),
|
|
6621
6628
|
// Phase C2/C3 (🟡): workload-level default MCP servers as friendly rush
|
|
6622
6629
|
// MCP ids (e.g. `github`). Projected to
|
|
6623
6630
|
// `manifest.spec.defaults.enabledMcpServers` as `EnabledMcpRef[]`. At
|
|
@@ -6627,7 +6634,7 @@ var ManagedAgentProfileSpecSchema = import_zod52.z.object({
|
|
|
6627
6634
|
// user at bootstrap (C3). Seeded into `agents.enabled_mcp_servers` at
|
|
6628
6635
|
// agent creation when the caller omits MCP servers. See
|
|
6629
6636
|
// `specs/features/pilot-v2-managed-agent-profile.md` §"Phase C".
|
|
6630
|
-
mcpServers:
|
|
6637
|
+
mcpServers: import_zod53.z.array(import_zod53.z.string().min(1)).optional(),
|
|
6631
6638
|
// Phase D: workload-level default system prompt. Projected to
|
|
6632
6639
|
// `manifest.spec.defaults.systemPrompt`, seeded onto
|
|
6633
6640
|
// `agents.system_prompt` at agent creation, and forwarded per-run as
|
|
@@ -6641,14 +6648,14 @@ var ManagedAgentProfileSpecSchema = import_zod52.z.object({
|
|
|
6641
6648
|
resources: SessionResourcesSchema.optional(),
|
|
6642
6649
|
agentPackage: AgentPackageSchema.optional()
|
|
6643
6650
|
}).strict();
|
|
6644
|
-
var ManagedAgentProfileSchema =
|
|
6651
|
+
var ManagedAgentProfileSchema = import_zod53.z.object({
|
|
6645
6652
|
apiVersion: PilotWorkloadManifestApiVersionSchema,
|
|
6646
|
-
kind:
|
|
6653
|
+
kind: import_zod53.z.literal(MANAGED_AGENT_PROFILE_KIND),
|
|
6647
6654
|
metadata: ManagedAgentProfileMetadataSchema,
|
|
6648
6655
|
spec: ManagedAgentProfileSpecSchema
|
|
6649
6656
|
}).strict();
|
|
6650
6657
|
var MANAGED_AGENT_PROFILE_V1_API_VERSION = "pilot.zhenguanyu.com/v1alpha1";
|
|
6651
|
-
var ManagedAgentProfileV1RuntimeSchema =
|
|
6658
|
+
var ManagedAgentProfileV1RuntimeSchema = import_zod53.z.object({
|
|
6652
6659
|
templateRef: WorkloadManifestObjectRefSchema.optional(),
|
|
6653
6660
|
environmentRef: WorkloadManifestObjectRefSchema.optional(),
|
|
6654
6661
|
env: SessionConfigValuesSchema.optional(),
|
|
@@ -6662,65 +6669,65 @@ var ManagedAgentProfileV1RuntimeSchema = import_zod52.z.object({
|
|
|
6662
6669
|
}).strict().superRefine((runtime, ctx) => {
|
|
6663
6670
|
if (!runtime.templateRef && !runtime.environmentRef) {
|
|
6664
6671
|
ctx.addIssue({
|
|
6665
|
-
code:
|
|
6672
|
+
code: import_zod53.z.ZodIssueCode.custom,
|
|
6666
6673
|
path: ["templateRef"],
|
|
6667
6674
|
message: "runtime group requires exactly one of `templateRef` / `environmentRef`"
|
|
6668
6675
|
});
|
|
6669
6676
|
}
|
|
6670
6677
|
if (runtime.templateRef && runtime.environmentRef) {
|
|
6671
6678
|
ctx.addIssue({
|
|
6672
|
-
code:
|
|
6679
|
+
code: import_zod53.z.ZodIssueCode.custom,
|
|
6673
6680
|
path: ["environmentRef"],
|
|
6674
6681
|
message: "runtime.environmentRef is mutually exclusive with runtime.templateRef"
|
|
6675
6682
|
});
|
|
6676
6683
|
}
|
|
6677
6684
|
});
|
|
6678
|
-
var ManagedAgentProfileV1ModelSchema =
|
|
6685
|
+
var ManagedAgentProfileV1ModelSchema = import_zod53.z.object({
|
|
6679
6686
|
primary: WorkloadManifestModelSchema.optional(),
|
|
6680
6687
|
providerRef: LlmProviderConfigPublicIdSchema.optional()
|
|
6681
6688
|
}).strict().refine((model) => model.primary !== void 0 || model.providerRef !== void 0, {
|
|
6682
6689
|
message: "model group requires at least one of `primary` / `providerRef`"
|
|
6683
6690
|
});
|
|
6684
|
-
var ManagedAgentProfileV1InstructionItemSchema =
|
|
6691
|
+
var ManagedAgentProfileV1InstructionItemSchema = import_zod53.z.object({
|
|
6685
6692
|
inline: WorkloadManifestSystemPromptSchema
|
|
6686
6693
|
}).strict();
|
|
6687
|
-
var ManagedAgentProfileV1InstructionsSchema =
|
|
6694
|
+
var ManagedAgentProfileV1InstructionsSchema = import_zod53.z.union([
|
|
6688
6695
|
WorkloadManifestSystemPromptSchema,
|
|
6689
|
-
|
|
6696
|
+
import_zod53.z.array(ManagedAgentProfileV1InstructionItemSchema).min(1).superRefine((blocks, ctx) => {
|
|
6690
6697
|
const joinedLength = blocks.reduce((sum, b) => sum + b.inline.length, 0) + INSTRUCTIONS_JOIN_SEPARATOR.length * Math.max(0, blocks.length - 1);
|
|
6691
6698
|
if (joinedLength > WORKLOAD_MANIFEST_SYSTEM_PROMPT_MAX_LENGTH) {
|
|
6692
6699
|
ctx.addIssue({
|
|
6693
|
-
code:
|
|
6700
|
+
code: import_zod53.z.ZodIssueCode.custom,
|
|
6694
6701
|
message: `joined instructions length ${joinedLength} exceeds the ${WORKLOAD_MANIFEST_SYSTEM_PROMPT_MAX_LENGTH} system-prompt limit`
|
|
6695
6702
|
});
|
|
6696
6703
|
}
|
|
6697
6704
|
})
|
|
6698
6705
|
]);
|
|
6699
|
-
var ManagedAgentProfileV1SkillRefSchema =
|
|
6700
|
-
source:
|
|
6701
|
-
name:
|
|
6706
|
+
var ManagedAgentProfileV1SkillRefSchema = import_zod53.z.object({
|
|
6707
|
+
source: import_zod53.z.literal("ref"),
|
|
6708
|
+
name: import_zod53.z.string().min(1)
|
|
6702
6709
|
}).strict();
|
|
6703
|
-
var ManagedAgentProfileV1SkillInlineSchema =
|
|
6704
|
-
source:
|
|
6710
|
+
var ManagedAgentProfileV1SkillInlineSchema = import_zod53.z.object({
|
|
6711
|
+
source: import_zod53.z.literal("inline"),
|
|
6705
6712
|
/** Skill file path inside the package, e.g. `SKILL.md`. */
|
|
6706
|
-
path:
|
|
6707
|
-
content:
|
|
6713
|
+
path: import_zod53.z.string().min(1),
|
|
6714
|
+
content: import_zod53.z.string().min(1)
|
|
6708
6715
|
}).strict();
|
|
6709
|
-
var ManagedAgentProfileV1SkillSchema =
|
|
6716
|
+
var ManagedAgentProfileV1SkillSchema = import_zod53.z.discriminatedUnion("source", [
|
|
6710
6717
|
ManagedAgentProfileV1SkillRefSchema,
|
|
6711
6718
|
ManagedAgentProfileV1SkillInlineSchema
|
|
6712
6719
|
]);
|
|
6713
|
-
var ManagedAgentProfileV1McpRefSchema =
|
|
6714
|
-
source:
|
|
6715
|
-
rushMcpId:
|
|
6720
|
+
var ManagedAgentProfileV1McpRefSchema = import_zod53.z.object({
|
|
6721
|
+
source: import_zod53.z.literal("ref"),
|
|
6722
|
+
rushMcpId: import_zod53.z.string().min(1)
|
|
6716
6723
|
}).strict();
|
|
6717
|
-
var ManagedAgentProfileV1CapabilitiesSchema =
|
|
6718
|
-
skills:
|
|
6719
|
-
mcpServers:
|
|
6724
|
+
var ManagedAgentProfileV1CapabilitiesSchema = import_zod53.z.object({
|
|
6725
|
+
skills: import_zod53.z.array(ManagedAgentProfileV1SkillSchema).optional(),
|
|
6726
|
+
mcpServers: import_zod53.z.array(ManagedAgentProfileV1McpRefSchema).optional()
|
|
6720
6727
|
}).strict();
|
|
6721
|
-
var ManagedAgentProfileV1EvalsSchema =
|
|
6722
|
-
suiteRef:
|
|
6723
|
-
name:
|
|
6728
|
+
var ManagedAgentProfileV1EvalsSchema = import_zod53.z.object({
|
|
6729
|
+
suiteRef: import_zod53.z.object({
|
|
6730
|
+
name: import_zod53.z.string().min(1)
|
|
6724
6731
|
}).strict()
|
|
6725
6732
|
}).strict();
|
|
6726
6733
|
var MANAGED_AGENT_PROFILE_V1_KNOWN_SPEC_KEYS = [
|
|
@@ -6771,7 +6778,7 @@ function validateXExtensionValueShape(value) {
|
|
|
6771
6778
|
return "x-* value must be a scalar or a one-level object of scalars";
|
|
6772
6779
|
}
|
|
6773
6780
|
var ManagedAgentProfileV1MemorySchema = WorkloadManifestMemorySchema;
|
|
6774
|
-
var ManagedAgentProfileV1SpecSchema =
|
|
6781
|
+
var ManagedAgentProfileV1SpecSchema = import_zod53.z.object({
|
|
6775
6782
|
runtime: ManagedAgentProfileV1RuntimeSchema,
|
|
6776
6783
|
model: ManagedAgentProfileV1ModelSchema.optional(),
|
|
6777
6784
|
instructions: ManagedAgentProfileV1InstructionsSchema.optional(),
|
|
@@ -6795,7 +6802,7 @@ var ManagedAgentProfileV1SpecSchema = import_zod52.z.object({
|
|
|
6795
6802
|
var _a, _b, _c, _d;
|
|
6796
6803
|
if (((_b = (_a = spec.vaultMcpBindings) == null ? void 0 : _a.length) != null ? _b : 0) > 0 && ((_d = (_c = spec.managedMcpBindings) == null ? void 0 : _c.length) != null ? _d : 0) > 0) {
|
|
6797
6804
|
ctx.addIssue({
|
|
6798
|
-
code:
|
|
6805
|
+
code: import_zod53.z.ZodIssueCode.custom,
|
|
6799
6806
|
path: ["managedMcpBindings"],
|
|
6800
6807
|
message: "managedMcpBindings and vaultMcpBindings are mutually exclusive (#1469 D2) \u2014 declare only one binding granularity"
|
|
6801
6808
|
});
|
|
@@ -6807,7 +6814,7 @@ var ManagedAgentProfileV1SpecSchema = import_zod52.z.object({
|
|
|
6807
6814
|
if (known.has(key)) continue;
|
|
6808
6815
|
if (!X_EXTENSION_KEY_PATTERN.test(key)) {
|
|
6809
6816
|
ctx.addIssue({
|
|
6810
|
-
code:
|
|
6817
|
+
code: import_zod53.z.ZodIssueCode.custom,
|
|
6811
6818
|
path: [key],
|
|
6812
6819
|
message: `unknown key "${key}" \u2014 spec only allows known capability groups or x-* extension keys`
|
|
6813
6820
|
});
|
|
@@ -6817,34 +6824,34 @@ var ManagedAgentProfileV1SpecSchema = import_zod52.z.object({
|
|
|
6817
6824
|
const value = spec[key];
|
|
6818
6825
|
const shapeError = validateXExtensionValueShape(value);
|
|
6819
6826
|
if (shapeError) {
|
|
6820
|
-
ctx.addIssue({ code:
|
|
6827
|
+
ctx.addIssue({ code: import_zod53.z.ZodIssueCode.custom, path: [key], message: shapeError });
|
|
6821
6828
|
continue;
|
|
6822
6829
|
}
|
|
6823
6830
|
xTotalBytes += utf8ByteLength(JSON.stringify(value));
|
|
6824
6831
|
}
|
|
6825
6832
|
if (xKeyCount > X_EXTENSION_MAX_KEYS) {
|
|
6826
6833
|
ctx.addIssue({
|
|
6827
|
-
code:
|
|
6834
|
+
code: import_zod53.z.ZodIssueCode.custom,
|
|
6828
6835
|
path: [],
|
|
6829
6836
|
message: `too many x-* extension keys (${xKeyCount} > ${X_EXTENSION_MAX_KEYS})`
|
|
6830
6837
|
});
|
|
6831
6838
|
}
|
|
6832
6839
|
if (xTotalBytes > X_EXTENSION_MAX_TOTAL_BYTES) {
|
|
6833
6840
|
ctx.addIssue({
|
|
6834
|
-
code:
|
|
6841
|
+
code: import_zod53.z.ZodIssueCode.custom,
|
|
6835
6842
|
path: [],
|
|
6836
6843
|
message: `x-* extension total size ${xTotalBytes} bytes exceeds ${X_EXTENSION_MAX_TOTAL_BYTES}`
|
|
6837
6844
|
});
|
|
6838
6845
|
}
|
|
6839
6846
|
});
|
|
6840
|
-
var ManagedAgentProfileV1Schema =
|
|
6841
|
-
apiVersion:
|
|
6842
|
-
kind:
|
|
6847
|
+
var ManagedAgentProfileV1Schema = import_zod53.z.object({
|
|
6848
|
+
apiVersion: import_zod53.z.literal(MANAGED_AGENT_PROFILE_V1_API_VERSION),
|
|
6849
|
+
kind: import_zod53.z.literal(MANAGED_AGENT_PROFILE_KIND),
|
|
6843
6850
|
metadata: ManagedAgentProfileMetadataSchema,
|
|
6844
6851
|
spec: ManagedAgentProfileV1SpecSchema
|
|
6845
6852
|
}).strict();
|
|
6846
|
-
var CanaryArmSchema =
|
|
6847
|
-
var CanaryDecisionReasonSchema =
|
|
6853
|
+
var CanaryArmSchema = import_zod54.z.enum(["stable", "canary"]);
|
|
6854
|
+
var CanaryDecisionReasonSchema = import_zod54.z.enum([
|
|
6848
6855
|
"kill_switch",
|
|
6849
6856
|
"fail_safe",
|
|
6850
6857
|
"pool_exempt",
|
|
@@ -6855,25 +6862,25 @@ var CanaryDecisionReasonSchema = import_zod53.z.enum([
|
|
|
6855
6862
|
"percentage_miss",
|
|
6856
6863
|
"pool_canary"
|
|
6857
6864
|
]);
|
|
6858
|
-
var StageCanaryStateSchema =
|
|
6865
|
+
var StageCanaryStateSchema = import_zod54.z.object({
|
|
6859
6866
|
/** 灰度 revision。与主指针同 workload(跨 workload 引用在写路径被拒)。 */
|
|
6860
|
-
revisionId:
|
|
6867
|
+
revisionId: import_zod54.z.string().uuid(),
|
|
6861
6868
|
/**
|
|
6862
6869
|
* 灰度百分比 0..99。100 不是灰度态(那是 promote);0 = 冻结观察态:
|
|
6863
6870
|
* hash 全 miss,仅名单命中仍走 canary 臂。
|
|
6864
6871
|
*/
|
|
6865
|
-
percentage:
|
|
6872
|
+
percentage: import_zod54.z.number().int().min(0).max(99),
|
|
6866
6873
|
/** ldap 精确匹配名单(命中优先于百分比)。缺省解析为 `[]`。 */
|
|
6867
|
-
userAllowlist:
|
|
6874
|
+
userAllowlist: import_zod54.z.array(import_zod54.z.string()).default([]),
|
|
6868
6875
|
/** 灰度开始时间(ISO)。`null` = 存量行无记录。 */
|
|
6869
|
-
startedAt:
|
|
6876
|
+
startedAt: import_zod54.z.string().nullable(),
|
|
6870
6877
|
/** 灰度发起人。`null` = 非请求上下文写入。 */
|
|
6871
|
-
startedBy:
|
|
6878
|
+
startedBy: import_zod54.z.string().nullable()
|
|
6872
6879
|
}).strict();
|
|
6873
|
-
var StageSlotViewSchema =
|
|
6880
|
+
var StageSlotViewSchema = import_zod54.z.object({
|
|
6874
6881
|
stage: StageSchema,
|
|
6875
6882
|
/** 槽位当前指针;同 workload 的 revision(跨 workload 引用在写路径被拒)。 */
|
|
6876
|
-
revisionId:
|
|
6883
|
+
revisionId: import_zod54.z.string().uuid(),
|
|
6877
6884
|
/**
|
|
6878
6885
|
* Stage-level runtime overrides layered on top of the revision snapshot
|
|
6879
6886
|
* (top-level key replace, no deep merge — STG-R3). `null` → none stored.
|
|
@@ -6886,20 +6893,20 @@ var StageSlotViewSchema = import_zod53.z.object({
|
|
|
6886
6893
|
* and re-running them on read could brick `GET /stages` for rows written
|
|
6887
6894
|
* before a rule tightened.
|
|
6888
6895
|
*/
|
|
6889
|
-
configValues:
|
|
6896
|
+
configValues: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.string()).nullable(),
|
|
6890
6897
|
/**
|
|
6891
6898
|
* Environment binding(P2, spec §6.3)。`null` = 槽位以 revision 快照为
|
|
6892
6899
|
* 基底(P1 行为);非空 = 会话创建按 E-DEC2 字段组组合解析(PR-E3)。
|
|
6893
6900
|
* P1 的 `z.null()` 锁死已按计划放开。
|
|
6894
6901
|
*/
|
|
6895
|
-
environmentId:
|
|
6902
|
+
environmentId: import_zod54.z.string().uuid().nullable(),
|
|
6896
6903
|
/**
|
|
6897
6904
|
* Pinned environment version(E-DEC6 ENV-V2):引用是 (environmentId,
|
|
6898
6905
|
* environmentVersion) 对。`null` 且 environmentId 非空 = legacy 钉
|
|
6899
6906
|
* (部署窗口写入,解析回退 tip)。Optional so existing fixtures that
|
|
6900
6907
|
* predate this field keep parsing.
|
|
6901
6908
|
*/
|
|
6902
|
-
environmentVersion:
|
|
6909
|
+
environmentVersion: import_zod54.z.number().int().positive().nullable().optional(),
|
|
6903
6910
|
/**
|
|
6904
6911
|
* Display name hydrated for an EXISTING `environmentId` reference
|
|
6905
6912
|
* (UI-11). Deliberately independent of the environment-picker's active
|
|
@@ -6911,19 +6918,19 @@ var StageSlotViewSchema = import_zod53.z.object({
|
|
|
6911
6918
|
* no longer exists (e.g. hard-deleted). Optional so existing fixtures
|
|
6912
6919
|
* that predate this field keep parsing.
|
|
6913
6920
|
*/
|
|
6914
|
-
environmentName:
|
|
6921
|
+
environmentName: import_zod54.z.string().nullable().optional(),
|
|
6915
6922
|
/**
|
|
6916
6923
|
* 活跃灰度状态(#1214 canary rollout)。`null` = 无灰度(绝大多数槽位)。
|
|
6917
6924
|
* 必填字段:read 端总是显式报告 null,而非靠省略表达「无灰度」。
|
|
6918
6925
|
*/
|
|
6919
6926
|
canary: StageCanaryStateSchema.nullable(),
|
|
6920
6927
|
/** ISO timestamp of the last pointer/overrides/config change (STG-D2 audit baseline). */
|
|
6921
|
-
deployedAt:
|
|
6928
|
+
deployedAt: import_zod54.z.string(),
|
|
6922
6929
|
/**
|
|
6923
6930
|
* Actor of the last change. `null` only for rows created outside a
|
|
6924
6931
|
* request context (e.g. the STG-M1 backfill migration).
|
|
6925
6932
|
*/
|
|
6926
|
-
deployedBy:
|
|
6933
|
+
deployedBy: import_zod54.z.string().nullable(),
|
|
6927
6934
|
/**
|
|
6928
6935
|
* ISO timestamp of the slot row's last write — the UI-5 optimistic
|
|
6929
6936
|
* concurrency token. Confirm dialogs MUST echo this back as
|
|
@@ -6931,10 +6938,10 @@ var StageSlotViewSchema = import_zod53.z.object({
|
|
|
6931
6938
|
* (someone else wrote the slot in between) is a 409 `STAGE_CONFLICT` that
|
|
6932
6939
|
* requires re-fetching the preview. Never null — the row always has one.
|
|
6933
6940
|
*/
|
|
6934
|
-
updatedAt:
|
|
6941
|
+
updatedAt: import_zod54.z.string()
|
|
6935
6942
|
}).strict();
|
|
6936
|
-
var ListStagesResponseSchema =
|
|
6937
|
-
stages:
|
|
6943
|
+
var ListStagesResponseSchema = import_zod54.z.object({
|
|
6944
|
+
stages: import_zod54.z.array(StageSlotViewSchema)
|
|
6938
6945
|
}).strict();
|
|
6939
6946
|
function findFrozenStagePutField(rawBody) {
|
|
6940
6947
|
if (typeof rawBody !== "object" || rawBody === null) return null;
|
|
@@ -6959,9 +6966,9 @@ function parsePutStageRequest(rawBody) {
|
|
|
6959
6966
|
}
|
|
6960
6967
|
return { ok: true, data: parsed.data };
|
|
6961
6968
|
}
|
|
6962
|
-
var PutStageRequestSchema =
|
|
6969
|
+
var PutStageRequestSchema = import_zod54.z.object({
|
|
6963
6970
|
/** 必填:槽位指针。MUST 属于路径上的 workload(服务层校验跨 workload 引用)。 */
|
|
6964
|
-
revisionId:
|
|
6971
|
+
revisionId: import_zod54.z.string().uuid(),
|
|
6965
6972
|
/**
|
|
6966
6973
|
* Stage-level runtime overrides. Reuses the shipped revision overrides
|
|
6967
6974
|
* contract (`pilot-v2-workload-manifest.ts`) — same shape, same
|
|
@@ -6985,7 +6992,7 @@ var PutStageRequestSchema = import_zod53.z.object({
|
|
|
6985
6992
|
* 回退 revision 快照基底;UUID = 绑定该 environment(服务层校验存在 /
|
|
6986
6993
|
* 同 project 或平台共享 / 未 archived)。
|
|
6987
6994
|
*/
|
|
6988
|
-
environmentId:
|
|
6995
|
+
environmentId: import_zod54.z.string().uuid().nullable().optional(),
|
|
6989
6996
|
/**
|
|
6990
6997
|
* UI-5 乐观并发 token(可选)。语义:
|
|
6991
6998
|
*
|
|
@@ -6996,12 +7003,12 @@ var PutStageRequestSchema = import_zod53.z.object({
|
|
|
6996
7003
|
*
|
|
6997
7004
|
* 任一期望落空 → 409 `STAGE_CONFLICT`,须重新拉取预览。
|
|
6998
7005
|
*/
|
|
6999
|
-
expectedUpdatedAt:
|
|
7006
|
+
expectedUpdatedAt: import_zod54.z.string().datetime().nullable().optional()
|
|
7000
7007
|
}).strict().superRefine((input, ctx) => {
|
|
7001
7008
|
for (const field of ["runtimeOverrides", "configValues"]) {
|
|
7002
7009
|
if (input[field] != null) {
|
|
7003
7010
|
ctx.addIssue({
|
|
7004
|
-
code:
|
|
7011
|
+
code: import_zod54.z.ZodIssueCode.custom,
|
|
7005
7012
|
path: [field],
|
|
7006
7013
|
// `params.pilotPolicyCode` is LOAD-BEARING: `classifyStageInputIssues`
|
|
7007
7014
|
// (above) keys on it so the stage PUT routes map this rejection to
|
|
@@ -7014,17 +7021,17 @@ var PutStageRequestSchema = import_zod53.z.object({
|
|
|
7014
7021
|
}
|
|
7015
7022
|
});
|
|
7016
7023
|
var PutStageResponseSchema = StageSlotViewSchema;
|
|
7017
|
-
var PromoteRequestSchema =
|
|
7018
|
-
expectedUpdatedAt:
|
|
7024
|
+
var PromoteRequestSchema = import_zod54.z.object({
|
|
7025
|
+
expectedUpdatedAt: import_zod54.z.string().datetime().nullable().optional(),
|
|
7019
7026
|
/**
|
|
7020
7027
|
* Environment binding for the production slot(P2 §6.3):omitted = 保留
|
|
7021
7028
|
* production 槽位现值;`null` = 清引用;UUID = 绑定(同 PUT 语义)。
|
|
7022
7029
|
*/
|
|
7023
|
-
environmentId:
|
|
7030
|
+
environmentId: import_zod54.z.string().uuid().nullable().optional(),
|
|
7024
7031
|
/** 弹窗快照的 test 槽位 revision(预览与确认针对的对象)。 */
|
|
7025
|
-
sourceRevisionId:
|
|
7032
|
+
sourceRevisionId: import_zod54.z.string().uuid().optional(),
|
|
7026
7033
|
/** 弹窗快照的 test 槽位 `updatedAt`(`StageSlotView.updatedAt` 原样回传)。 */
|
|
7027
|
-
expectedTestUpdatedAt:
|
|
7034
|
+
expectedTestUpdatedAt: import_zod54.z.string().datetime().optional(),
|
|
7028
7035
|
/**
|
|
7029
7036
|
* 人工 override pipeline 门禁(§5.6 / §5.1 per-agent 判据):门禁开启
|
|
7030
7037
|
* (`promote_gate_enabled`)时,被晋级的 revision 所属 agent 在其挂过的
|
|
@@ -7033,120 +7040,120 @@ var PromoteRequestSchema = import_zod53.z.object({
|
|
|
7033
7040
|
* `PIPELINE_GATE_NOT_PASSED` 拒;带 override(必须给出 `reason`)可显式
|
|
7034
7041
|
* 放行并落审计。门禁关闭时忽略。
|
|
7035
7042
|
*/
|
|
7036
|
-
override:
|
|
7043
|
+
override: import_zod54.z.object({ reason: import_zod54.z.string().min(1) }).strict().optional()
|
|
7037
7044
|
}).strict();
|
|
7038
|
-
var PromoteResponseSchema =
|
|
7045
|
+
var PromoteResponseSchema = import_zod54.z.object({
|
|
7039
7046
|
/** production 槽位晋级后的视图。 */
|
|
7040
7047
|
production: StageSlotViewSchema,
|
|
7041
7048
|
/** 晋级前 production 指针;production 槽位此前不存在时为 `null`。 */
|
|
7042
|
-
fromRevisionId:
|
|
7049
|
+
fromRevisionId: import_zod54.z.string().uuid().nullable(),
|
|
7043
7050
|
/** = 事务读取时 test 槽位所指 revision。 */
|
|
7044
|
-
toRevisionId:
|
|
7051
|
+
toRevisionId: import_zod54.z.string().uuid()
|
|
7045
7052
|
}).strict();
|
|
7046
|
-
var PreviewStageResolutionRequestSchema =
|
|
7053
|
+
var PreviewStageResolutionRequestSchema = import_zod54.z.object({
|
|
7047
7054
|
/** 预览基底 revision。MUST 属于路径上的 workload(跨 workload 拒绝)。 */
|
|
7048
|
-
revisionId:
|
|
7055
|
+
revisionId: import_zod54.z.string().uuid(),
|
|
7049
7056
|
/** 槽位 runtime overrides(顶层键整体替换,STG-R3)。`null`/omitted = 无叠加。 */
|
|
7050
7057
|
runtimeOverrides: RevisionRuntimeEnvironmentOverridesSchema.nullable().optional(),
|
|
7051
7058
|
/** 槽位 config values(key 级整体替换,叠加到 revision 级之上)。 */
|
|
7052
|
-
configValues:
|
|
7059
|
+
configValues: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.string()).nullable().optional(),
|
|
7053
7060
|
/**
|
|
7054
7061
|
* Environment binding to preview(P2 §6.3 / E-DEC2)。`null`/omitted =
|
|
7055
7062
|
* revision 快照基底;UUID = 按字段组组合预览(可引用性同写路径校验)。
|
|
7056
7063
|
*/
|
|
7057
|
-
environmentId:
|
|
7064
|
+
environmentId: import_zod54.z.string().uuid().nullable().optional()
|
|
7058
7065
|
}).strict();
|
|
7059
|
-
var PreviewStageResolutionResponseSchema =
|
|
7066
|
+
var PreviewStageResolutionResponseSchema = import_zod54.z.object({
|
|
7060
7067
|
/** revision 快照 ⊕ environment 字段组 ⊕ overrides(E-DEC2)后的最终 runtime 配置。 */
|
|
7061
7068
|
runtimeSnapshot: RuntimeTemplateSnapshotSchema,
|
|
7062
7069
|
/** revision 级 configValues + 槽位 configValues 合并结果(revision < slot)。 */
|
|
7063
|
-
configValues:
|
|
7070
|
+
configValues: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.string()),
|
|
7064
7071
|
/** 解析基底来源(§6.3):绑定 environment 时 = "environment"。 */
|
|
7065
|
-
base:
|
|
7072
|
+
base: import_zod54.z.enum(["revision_snapshot", "environment"]),
|
|
7066
7073
|
/** 基底环境摘要(UI-5 展示;base = "environment" 时非 null)。 */
|
|
7067
|
-
environment:
|
|
7074
|
+
environment: import_zod54.z.object({ id: import_zod54.z.string().uuid(), name: import_zod54.z.string(), updatedAt: import_zod54.z.string() }).strict().nullable()
|
|
7068
7075
|
}).strict();
|
|
7069
|
-
var StartCanaryRequestSchema =
|
|
7076
|
+
var StartCanaryRequestSchema = import_zod54.z.object({
|
|
7070
7077
|
/** 灰度 revision。MUST 属于路径上的 workload;= 主指针时 422 `CANARY_SAME_REVISION`。 */
|
|
7071
|
-
revisionId:
|
|
7078
|
+
revisionId: import_zod54.z.string().uuid(),
|
|
7072
7079
|
/** 0..99(100 = promote,走 promote 端点;0 = 冻结观察,仅名单命中)。 */
|
|
7073
|
-
percentage:
|
|
7080
|
+
percentage: import_zod54.z.number().int().min(0).max(99),
|
|
7074
7081
|
/** ldap 精确匹配名单(≤200 条,条目非空)。 */
|
|
7075
|
-
userAllowlist:
|
|
7076
|
-
expectedUpdatedAt:
|
|
7082
|
+
userAllowlist: import_zod54.z.array(import_zod54.z.string().min(1)).max(200).optional(),
|
|
7083
|
+
expectedUpdatedAt: import_zod54.z.string().nullable().optional()
|
|
7077
7084
|
}).strict();
|
|
7078
|
-
var CanaryPromoteRequestSchema =
|
|
7079
|
-
expectedUpdatedAt:
|
|
7085
|
+
var CanaryPromoteRequestSchema = import_zod54.z.object({
|
|
7086
|
+
expectedUpdatedAt: import_zod54.z.string().nullable().optional()
|
|
7080
7087
|
}).strict();
|
|
7081
7088
|
var CanaryAbortRequestSchema = CanaryPromoteRequestSchema;
|
|
7082
|
-
var RolloutEventActionSchema =
|
|
7089
|
+
var RolloutEventActionSchema = import_zod54.z.enum([
|
|
7083
7090
|
"start",
|
|
7084
7091
|
"adjust",
|
|
7085
7092
|
"promote",
|
|
7086
7093
|
"abort",
|
|
7087
7094
|
"cascade_abort"
|
|
7088
7095
|
]);
|
|
7089
|
-
var CanaryArmSessionMetricsSchema =
|
|
7090
|
-
total:
|
|
7091
|
-
ready:
|
|
7092
|
-
failed:
|
|
7093
|
-
terminated:
|
|
7094
|
-
}).strict();
|
|
7095
|
-
var CanaryRolloutTimelineEntrySchema =
|
|
7096
|
-
id:
|
|
7096
|
+
var CanaryArmSessionMetricsSchema = import_zod54.z.object({
|
|
7097
|
+
total: import_zod54.z.number().int().min(0),
|
|
7098
|
+
ready: import_zod54.z.number().int().min(0),
|
|
7099
|
+
failed: import_zod54.z.number().int().min(0),
|
|
7100
|
+
terminated: import_zod54.z.number().int().min(0)
|
|
7101
|
+
}).strict();
|
|
7102
|
+
var CanaryRolloutTimelineEntrySchema = import_zod54.z.object({
|
|
7103
|
+
id: import_zod54.z.string().uuid(),
|
|
7097
7104
|
action: RolloutEventActionSchema,
|
|
7098
|
-
fromPercentage:
|
|
7099
|
-
toPercentage:
|
|
7105
|
+
fromPercentage: import_zod54.z.number().int().nullable(),
|
|
7106
|
+
toPercentage: import_zod54.z.number().int().nullable(),
|
|
7100
7107
|
/** to 侧 canary revision 短名(join revisions 解析);无 to 臂 / 解析不到为 null。 */
|
|
7101
|
-
toRevisionLabel:
|
|
7102
|
-
actor:
|
|
7103
|
-
createdAt:
|
|
7108
|
+
toRevisionLabel: import_zod54.z.string().nullable(),
|
|
7109
|
+
actor: import_zod54.z.string().nullable(),
|
|
7110
|
+
createdAt: import_zod54.z.string()
|
|
7104
7111
|
}).strict();
|
|
7105
|
-
var CanaryObservationSchema =
|
|
7112
|
+
var CanaryObservationSchema = import_zod54.z.object({
|
|
7106
7113
|
/** 活跃灰度状态快照(与 `StageSlotView.canary` 同 shape)。 */
|
|
7107
7114
|
canary: StageCanaryStateSchema,
|
|
7108
7115
|
/**
|
|
7109
7116
|
* 会话聚合窗口起点 = 本轮灰度 `startedAt`(CNR-D3 生命周期基线,adjust
|
|
7110
7117
|
* 不重置);存量行无记录时为 null(退化为全量打标行聚合)。
|
|
7111
7118
|
*/
|
|
7112
|
-
observedSince:
|
|
7119
|
+
observedSince: import_zod54.z.string().nullable(),
|
|
7113
7120
|
/**
|
|
7114
7121
|
* 两臂对比。聚合口径:`canary_arm` 非 NULL 的会话(含池补给
|
|
7115
7122
|
* pool_exempt / pool_canary 打标行——池行 provisioning 失败同样是臂
|
|
7116
7123
|
* 健康信号;决策 reason 明细在会话 `metadata.canaryDecision`,不进聚合)。
|
|
7117
7124
|
*/
|
|
7118
|
-
arms:
|
|
7125
|
+
arms: import_zod54.z.object({
|
|
7119
7126
|
stable: CanaryArmSessionMetricsSchema,
|
|
7120
7127
|
canary: CanaryArmSessionMetricsSchema
|
|
7121
7128
|
}).strict(),
|
|
7122
7129
|
/** rollout 账表时间线,`createdAt` 降序,最多 `CANARY_OBSERVATION_TIMELINE_LIMIT` 条。 */
|
|
7123
|
-
timeline:
|
|
7130
|
+
timeline: import_zod54.z.array(CanaryRolloutTimelineEntrySchema)
|
|
7124
7131
|
}).strict();
|
|
7125
|
-
var ProfileNameSchema =
|
|
7132
|
+
var ProfileNameSchema = import_zod55.z.string().regex(
|
|
7126
7133
|
/^@[a-z0-9-]{1,40}\/[a-z0-9-]{1,60}$/,
|
|
7127
7134
|
"Profile name must be a scoped lowercase slug like @scope/name"
|
|
7128
7135
|
);
|
|
7129
|
-
var SemverSchema =
|
|
7136
|
+
var SemverSchema = import_zod55.z.string().regex(
|
|
7130
7137
|
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,
|
|
7131
7138
|
"Version must be semver major.minor.patch (no leading zeros; pre-release segments non-empty)"
|
|
7132
7139
|
);
|
|
7133
|
-
var ProfileSchemaVersionSchema =
|
|
7140
|
+
var ProfileSchemaVersionSchema = import_zod55.z.string().regex(
|
|
7134
7141
|
/^[a-z0-9]([a-z0-9.-]*[a-z0-9])?\/v\d+[a-z0-9]*$/,
|
|
7135
7142
|
"schemaVersion must be a k8s-style apiVersion like pilot.zhenguanyu.com/v0alpha1"
|
|
7136
7143
|
);
|
|
7137
|
-
var ProfileIntegritySchema =
|
|
7144
|
+
var ProfileIntegritySchema = import_zod55.z.string().regex(
|
|
7138
7145
|
/^sha256-[A-Za-z0-9+/]{43}=$/,
|
|
7139
7146
|
"Integrity must be an SRI sha256-<base64> of a 32-byte digest"
|
|
7140
7147
|
);
|
|
7141
|
-
var ProfileVersionStatusSchema =
|
|
7142
|
-
var ProfileVisibilitySchema =
|
|
7143
|
-
var ProfileLdapSchema =
|
|
7144
|
-
var WorkloadBindKindSchema =
|
|
7145
|
-
var WorkloadProfileRefSchema =
|
|
7148
|
+
var ProfileVersionStatusSchema = import_zod55.z.enum(["published", "yanked"]);
|
|
7149
|
+
var ProfileVisibilitySchema = import_zod55.z.enum(["public", "private"]);
|
|
7150
|
+
var ProfileLdapSchema = import_zod55.z.string().min(1).max(64);
|
|
7151
|
+
var WorkloadBindKindSchema = import_zod55.z.enum(["profile", "legacy_direct_bind"]);
|
|
7152
|
+
var WorkloadProfileRefSchema = import_zod55.z.object({
|
|
7146
7153
|
bindKind: WorkloadBindKindSchema.default("profile"),
|
|
7147
7154
|
profileName: ProfileNameSchema.optional(),
|
|
7148
7155
|
resolvedVersion: SemverSchema.optional(),
|
|
7149
|
-
resolvedAt:
|
|
7156
|
+
resolvedAt: import_zod55.z.string().datetime().optional(),
|
|
7150
7157
|
integrity: ProfileIntegritySchema.optional()
|
|
7151
7158
|
}).strict().superRefine((ref, ctx) => {
|
|
7152
7159
|
if (ref.bindKind === "profile") {
|
|
@@ -7154,7 +7161,7 @@ var WorkloadProfileRefSchema = import_zod54.z.object({
|
|
|
7154
7161
|
for (const field of required) {
|
|
7155
7162
|
if (ref[field] === void 0) {
|
|
7156
7163
|
ctx.addIssue({
|
|
7157
|
-
code:
|
|
7164
|
+
code: import_zod55.z.ZodIssueCode.custom,
|
|
7158
7165
|
path: [field],
|
|
7159
7166
|
message: `profile bind requires ${field} for audit`
|
|
7160
7167
|
});
|
|
@@ -7164,7 +7171,7 @@ var WorkloadProfileRefSchema = import_zod54.z.object({
|
|
|
7164
7171
|
for (const field of ["profileName", "resolvedVersion", "resolvedAt", "integrity"]) {
|
|
7165
7172
|
if (ref[field] !== void 0) {
|
|
7166
7173
|
ctx.addIssue({
|
|
7167
|
-
code:
|
|
7174
|
+
code: import_zod55.z.ZodIssueCode.custom,
|
|
7168
7175
|
path: [field],
|
|
7169
7176
|
message: `legacy_direct_bind must not carry ${field}`
|
|
7170
7177
|
});
|
|
@@ -7172,139 +7179,139 @@ var WorkloadProfileRefSchema = import_zod54.z.object({
|
|
|
7172
7179
|
}
|
|
7173
7180
|
}
|
|
7174
7181
|
});
|
|
7175
|
-
var CreateProfileRequestSchema =
|
|
7182
|
+
var CreateProfileRequestSchema = import_zod55.z.object({
|
|
7176
7183
|
name: ProfileNameSchema,
|
|
7177
|
-
displayName:
|
|
7178
|
-
description:
|
|
7184
|
+
displayName: import_zod55.z.string().min(1).max(255),
|
|
7185
|
+
description: import_zod55.z.string().max(4096).optional(),
|
|
7179
7186
|
visibility: ProfileVisibilitySchema.default("private"),
|
|
7180
|
-
whitelistLdaps:
|
|
7187
|
+
whitelistLdaps: import_zod55.z.array(ProfileLdapSchema).max(256).optional()
|
|
7181
7188
|
}).strict();
|
|
7182
|
-
var SetVisibilityRequestSchema =
|
|
7189
|
+
var SetVisibilityRequestSchema = import_zod55.z.object({
|
|
7183
7190
|
visibility: ProfileVisibilitySchema,
|
|
7184
|
-
whitelistLdaps:
|
|
7191
|
+
whitelistLdaps: import_zod55.z.array(ProfileLdapSchema).max(256).optional()
|
|
7185
7192
|
}).strict();
|
|
7186
|
-
var PublishProfileVersionRequestSchema =
|
|
7193
|
+
var PublishProfileVersionRequestSchema = import_zod55.z.object({
|
|
7187
7194
|
version: SemverSchema,
|
|
7188
7195
|
schemaVersion: ProfileSchemaVersionSchema,
|
|
7189
|
-
content:
|
|
7196
|
+
content: import_zod55.z.record(import_zod55.z.string(), import_zod55.z.unknown()),
|
|
7190
7197
|
integrity: ProfileIntegritySchema.optional()
|
|
7191
7198
|
}).strict();
|
|
7192
|
-
var SetStableRequestSchema =
|
|
7199
|
+
var SetStableRequestSchema = import_zod55.z.object({
|
|
7193
7200
|
version: SemverSchema
|
|
7194
7201
|
}).strict();
|
|
7195
|
-
var YankVersionRequestSchema =
|
|
7196
|
-
reason:
|
|
7202
|
+
var YankVersionRequestSchema = import_zod55.z.object({
|
|
7203
|
+
reason: import_zod55.z.string().max(1024).optional()
|
|
7197
7204
|
}).strict();
|
|
7198
|
-
var ResolveReasonSchema =
|
|
7199
|
-
var ResolveResultSchema =
|
|
7205
|
+
var ResolveReasonSchema = import_zod55.z.enum(["stable", "pinned", "no_stable", "yanked", "not_found"]);
|
|
7206
|
+
var ResolveResultSchema = import_zod55.z.object({
|
|
7200
7207
|
profileName: ProfileNameSchema,
|
|
7201
7208
|
requestedVersion: SemverSchema.nullable(),
|
|
7202
7209
|
resolvedVersion: SemverSchema.nullable(),
|
|
7203
7210
|
integrity: ProfileIntegritySchema.nullable(),
|
|
7204
7211
|
reason: ResolveReasonSchema
|
|
7205
7212
|
});
|
|
7206
|
-
var PlatformProjectSchema =
|
|
7207
|
-
id:
|
|
7213
|
+
var PlatformProjectSchema = import_zod56.z.object({
|
|
7214
|
+
id: import_zod56.z.string().uuid(),
|
|
7208
7215
|
slug: WorkloadManifestNameSchema,
|
|
7209
7216
|
displayName: WorkloadManifestDisplayNameSchema,
|
|
7210
|
-
description:
|
|
7217
|
+
description: import_zod56.z.string().nullable().optional(),
|
|
7211
7218
|
defaultRuntimeTemplateRefName: WorkloadManifestRefNameSchema.nullable().optional(),
|
|
7212
|
-
createdAt:
|
|
7213
|
-
updatedAt:
|
|
7219
|
+
createdAt: import_zod56.z.string().optional(),
|
|
7220
|
+
updatedAt: import_zod56.z.string().optional()
|
|
7214
7221
|
}).strict();
|
|
7215
|
-
var CreatePlatformProjectRequestSchema =
|
|
7222
|
+
var CreatePlatformProjectRequestSchema = import_zod56.z.object({
|
|
7216
7223
|
slug: WorkloadManifestNameSchema,
|
|
7217
7224
|
displayName: WorkloadManifestDisplayNameSchema,
|
|
7218
|
-
description:
|
|
7225
|
+
description: import_zod56.z.string().max(2e3).optional(),
|
|
7219
7226
|
defaultRuntimeTemplateRefName: WorkloadManifestRefNameSchema.optional()
|
|
7220
7227
|
}).strict();
|
|
7221
|
-
var ListPlatformProjectsResponseSchema =
|
|
7222
|
-
projects:
|
|
7228
|
+
var ListPlatformProjectsResponseSchema = import_zod56.z.object({
|
|
7229
|
+
projects: import_zod56.z.array(PlatformProjectSchema)
|
|
7223
7230
|
}).strict();
|
|
7224
|
-
var DeletePlatformProjectResponseSchema =
|
|
7225
|
-
action:
|
|
7226
|
-
projectId:
|
|
7231
|
+
var DeletePlatformProjectResponseSchema = import_zod56.z.object({
|
|
7232
|
+
action: import_zod56.z.literal("deactivated"),
|
|
7233
|
+
projectId: import_zod56.z.string().uuid()
|
|
7227
7234
|
}).strict();
|
|
7228
|
-
var PlatformWorkloadDefaultsSchema =
|
|
7235
|
+
var PlatformWorkloadDefaultsSchema = import_zod56.z.object({
|
|
7229
7236
|
workerContract: WorkloadManifestWorkerContractDefaultsSchema.optional(),
|
|
7230
7237
|
configValues: SessionConfigValuesSchema.optional(),
|
|
7231
|
-
model:
|
|
7232
|
-
systemPrompt:
|
|
7238
|
+
model: import_zod56.z.string().min(1).max(255).optional(),
|
|
7239
|
+
systemPrompt: import_zod56.z.string().min(1).max(32768).optional(),
|
|
7233
7240
|
enabledSkills: EnabledSkillEntryListSchema.optional(),
|
|
7234
7241
|
enabledMcpServers: EnabledMcpEntryListSchema.optional(),
|
|
7235
7242
|
agentOptions: AgentOptionsSchema.optional(),
|
|
7236
7243
|
agentPackage: AgentPackageSchema.optional()
|
|
7237
7244
|
}).strict();
|
|
7238
|
-
var CreatePlatformWorkloadRequestSchema =
|
|
7239
|
-
projectId:
|
|
7245
|
+
var CreatePlatformWorkloadRequestSchema = import_zod56.z.object({
|
|
7246
|
+
projectId: import_zod56.z.string().uuid(),
|
|
7240
7247
|
slug: WorkloadManifestNameSchema,
|
|
7241
7248
|
displayName: WorkloadManifestDisplayNameSchema,
|
|
7242
7249
|
kind: ActiveWorkloadKindSchema,
|
|
7243
7250
|
defaults: PlatformWorkloadDefaultsSchema.optional(),
|
|
7244
7251
|
ui: WorkloadManifestUiHintSchema.optional()
|
|
7245
7252
|
}).strict();
|
|
7246
|
-
var PlatformWorkloadSchema =
|
|
7247
|
-
id:
|
|
7248
|
-
projectId:
|
|
7253
|
+
var PlatformWorkloadSchema = import_zod56.z.object({
|
|
7254
|
+
id: import_zod56.z.string().uuid(),
|
|
7255
|
+
projectId: import_zod56.z.string().uuid(),
|
|
7249
7256
|
slug: WorkloadManifestNameSchema,
|
|
7250
7257
|
displayName: WorkloadManifestDisplayNameSchema,
|
|
7251
7258
|
kind: ActiveWorkloadKindSchema,
|
|
7252
|
-
defaultRevisionId:
|
|
7253
|
-
createdAt:
|
|
7254
|
-
updatedAt:
|
|
7259
|
+
defaultRevisionId: import_zod56.z.string().uuid().nullable().optional(),
|
|
7260
|
+
createdAt: import_zod56.z.string().optional(),
|
|
7261
|
+
updatedAt: import_zod56.z.string().optional()
|
|
7255
7262
|
}).strict();
|
|
7256
|
-
var PublishPlatformRevisionWorkerContractSchema =
|
|
7263
|
+
var PublishPlatformRevisionWorkerContractSchema = import_zod56.z.object({
|
|
7257
7264
|
kind: ActiveWorkloadKindSchema,
|
|
7258
7265
|
name: WorkloadManifestRefNameSchema.optional(),
|
|
7259
|
-
version:
|
|
7266
|
+
version: import_zod56.z.string().min(1).max(100).optional()
|
|
7260
7267
|
}).strict();
|
|
7261
|
-
var PublishPlatformRevisionRequestSchema =
|
|
7262
|
-
projectId:
|
|
7268
|
+
var PublishPlatformRevisionRequestSchema = import_zod56.z.object({
|
|
7269
|
+
projectId: import_zod56.z.string().uuid(),
|
|
7263
7270
|
workloadSlug: WorkloadManifestNameSchema,
|
|
7264
7271
|
version: WorkloadManifestNameSchema,
|
|
7265
7272
|
workerContract: PublishPlatformRevisionWorkerContractSchema,
|
|
7266
|
-
setDefault:
|
|
7267
|
-
startup:
|
|
7268
|
-
requiredGates:
|
|
7269
|
-
optionalGates:
|
|
7273
|
+
setDefault: import_zod56.z.boolean().default(true),
|
|
7274
|
+
startup: import_zod56.z.object({
|
|
7275
|
+
requiredGates: import_zod56.z.array(import_zod56.z.string().min(1)).optional(),
|
|
7276
|
+
optionalGates: import_zod56.z.array(import_zod56.z.string().min(1)).optional()
|
|
7270
7277
|
}).strict().optional(),
|
|
7271
7278
|
configValues: SessionConfigValuesSchema.optional(),
|
|
7272
7279
|
managedAgentProfileSnapshot: ManagedAgentProfileSnapshotSchema.optional(),
|
|
7273
7280
|
runtime: RevisionRuntimeSchema.optional()
|
|
7274
7281
|
}).strict();
|
|
7275
|
-
var PlatformRevisionSchema =
|
|
7276
|
-
id:
|
|
7277
|
-
projectId:
|
|
7278
|
-
workloadId:
|
|
7282
|
+
var PlatformRevisionSchema = import_zod56.z.object({
|
|
7283
|
+
id: import_zod56.z.string().uuid(),
|
|
7284
|
+
projectId: import_zod56.z.string().uuid(),
|
|
7285
|
+
workloadId: import_zod56.z.string().uuid(),
|
|
7279
7286
|
workloadSlug: WorkloadManifestNameSchema.optional(),
|
|
7280
7287
|
version: WorkloadManifestNameSchema,
|
|
7281
|
-
runtimeSnapshotHash:
|
|
7282
|
-
createdAt:
|
|
7288
|
+
runtimeSnapshotHash: import_zod56.z.string().nullable().optional(),
|
|
7289
|
+
createdAt: import_zod56.z.string().optional()
|
|
7283
7290
|
}).strict();
|
|
7284
7291
|
var GetPlatformWorkloadResponseSchema = PlatformWorkloadSchema.extend({
|
|
7285
7292
|
kind: WorkloadKindSchema,
|
|
7286
7293
|
defaultRevision: PlatformRevisionSchema.nullable()
|
|
7287
7294
|
});
|
|
7288
7295
|
var GetPlatformRevisionResponseSchema = PlatformRevisionSchema;
|
|
7289
|
-
var GetPlatformSessionResponseSchema =
|
|
7290
|
-
id:
|
|
7291
|
-
projectId:
|
|
7292
|
-
workloadId:
|
|
7293
|
-
revisionId:
|
|
7296
|
+
var GetPlatformSessionResponseSchema = import_zod56.z.object({
|
|
7297
|
+
id: import_zod56.z.string().uuid(),
|
|
7298
|
+
projectId: import_zod56.z.string().uuid(),
|
|
7299
|
+
workloadId: import_zod56.z.string().uuid(),
|
|
7300
|
+
revisionId: import_zod56.z.string().uuid(),
|
|
7294
7301
|
status: SessionStatusSchema,
|
|
7295
|
-
createdAt:
|
|
7296
|
-
updatedAt:
|
|
7302
|
+
createdAt: import_zod56.z.string().optional(),
|
|
7303
|
+
updatedAt: import_zod56.z.string().optional()
|
|
7297
7304
|
}).strict();
|
|
7298
7305
|
var CreatePlatformSessionRequestSchema = CreateSessionRequestSchema;
|
|
7299
7306
|
var CreatePlatformSessionResponseSchema = CreateSessionResponseSchema;
|
|
7300
|
-
var ReleaseSandboxResponseSchema =
|
|
7301
|
-
released:
|
|
7302
|
-
sandboxId:
|
|
7303
|
-
sandboxDestroyed:
|
|
7304
|
-
destroyError:
|
|
7307
|
+
var ReleaseSandboxResponseSchema = import_zod56.z.object({
|
|
7308
|
+
released: import_zod56.z.literal(true),
|
|
7309
|
+
sandboxId: import_zod56.z.string().nullable(),
|
|
7310
|
+
sandboxDestroyed: import_zod56.z.boolean(),
|
|
7311
|
+
destroyError: import_zod56.z.string().optional()
|
|
7305
7312
|
}).strict();
|
|
7306
7313
|
var PlatformFileUploadResponseSchema = AttachmentMetaSchema.extend({
|
|
7307
|
-
url:
|
|
7314
|
+
url: import_zod56.z.string()
|
|
7308
7315
|
});
|
|
7309
7316
|
function platformWorkloadCreateToManifest(input) {
|
|
7310
7317
|
const defaults = input.defaults ? omitUndefined(input.defaults) : void 0;
|
|
@@ -7339,29 +7346,29 @@ function platformRevisionPublishToManifest(input) {
|
|
|
7339
7346
|
}), input.startup ? { startup: input.startup } : {}), input.configValues ? { configValues: input.configValues } : {}), input.managedAgentProfileSnapshot ? { managedAgentProfileSnapshot: input.managedAgentProfileSnapshot } : {})
|
|
7340
7347
|
});
|
|
7341
7348
|
}
|
|
7342
|
-
var SessionTurnRequestSchema =
|
|
7343
|
-
text:
|
|
7349
|
+
var SessionTurnRequestSchema = import_zod57.z.object({
|
|
7350
|
+
text: import_zod57.z.string().min(1).max(5e4),
|
|
7344
7351
|
/**
|
|
7345
7352
|
* Optional attachments uploaded via `POST /api/files/upload`. The Worker
|
|
7346
7353
|
* Protocol envelope itself does not carry attachments, so the handler
|
|
7347
7354
|
* splices the URLs into `promptText` as a trailing context block; the
|
|
7348
7355
|
* worker (LLM) treats them as references it can fetch.
|
|
7349
7356
|
*/
|
|
7350
|
-
attachments:
|
|
7357
|
+
attachments: import_zod57.z.array(AttachmentMetaSchema).max(20).optional()
|
|
7351
7358
|
}).strict();
|
|
7352
|
-
var SessionTurnDispatchedResponseSchema =
|
|
7353
|
-
success:
|
|
7354
|
-
data:
|
|
7359
|
+
var SessionTurnDispatchedResponseSchema = import_zod57.z.object({
|
|
7360
|
+
success: import_zod57.z.literal(true),
|
|
7361
|
+
data: import_zod57.z.object({ outcome: DispatchOutcomeSchema })
|
|
7355
7362
|
});
|
|
7356
|
-
var SessionTurnRevivalResponseSchema =
|
|
7357
|
-
success:
|
|
7358
|
-
revivalInProgress:
|
|
7359
|
-
sessionId:
|
|
7360
|
-
attemptId:
|
|
7361
|
-
alreadyReviving:
|
|
7362
|
-
turnId:
|
|
7363
|
+
var SessionTurnRevivalResponseSchema = import_zod57.z.object({
|
|
7364
|
+
success: import_zod57.z.literal(false),
|
|
7365
|
+
revivalInProgress: import_zod57.z.literal(true),
|
|
7366
|
+
sessionId: import_zod57.z.string(),
|
|
7367
|
+
attemptId: import_zod57.z.string(),
|
|
7368
|
+
alreadyReviving: import_zod57.z.boolean().optional(),
|
|
7369
|
+
turnId: import_zod57.z.string().optional()
|
|
7363
7370
|
});
|
|
7364
|
-
var GatewayErrorCodeSchema =
|
|
7371
|
+
var GatewayErrorCodeSchema = import_zod58.z.enum([
|
|
7365
7372
|
"gateway_invalid_session_token",
|
|
7366
7373
|
"gateway_session_not_found",
|
|
7367
7374
|
"gateway_missing_mcp_target",
|
|
@@ -7404,7 +7411,7 @@ var GatewayErrorCodeSchema = import_zod57.z.enum([
|
|
|
7404
7411
|
"gateway_request_too_large",
|
|
7405
7412
|
"gateway_response_too_large"
|
|
7406
7413
|
]);
|
|
7407
|
-
var WebhookEventTypeSchema =
|
|
7414
|
+
var WebhookEventTypeSchema = import_zod59.z.enum([
|
|
7408
7415
|
/** v1/v2 Run reached terminal `completed`. */
|
|
7409
7416
|
"run.completed",
|
|
7410
7417
|
/** v1/v2 Run reached terminal `failed`. */
|
|
@@ -7437,43 +7444,43 @@ var WebhookEventTypeSchema = import_zod58.z.enum([
|
|
|
7437
7444
|
]);
|
|
7438
7445
|
var WEBHOOK_EVENT_TYPES = WebhookEventTypeSchema.options;
|
|
7439
7446
|
var MAX_WEBHOOK_EVENT_ID_LENGTH = 255;
|
|
7440
|
-
var WebhookEventPayloadSchema =
|
|
7441
|
-
event_id:
|
|
7447
|
+
var WebhookEventPayloadSchema = import_zod59.z.object({
|
|
7448
|
+
event_id: import_zod59.z.string().min(1).max(MAX_WEBHOOK_EVENT_ID_LENGTH),
|
|
7442
7449
|
event_type: WebhookEventTypeSchema,
|
|
7443
7450
|
/** ISO-8601 instant at which the transition was recorded. */
|
|
7444
|
-
occurred_at:
|
|
7445
|
-
project_id:
|
|
7446
|
-
run_id:
|
|
7447
|
-
agent_id:
|
|
7448
|
-
session_id:
|
|
7451
|
+
occurred_at: import_zod59.z.string(),
|
|
7452
|
+
project_id: import_zod59.z.string().uuid(),
|
|
7453
|
+
run_id: import_zod59.z.string().uuid().optional(),
|
|
7454
|
+
agent_id: import_zod59.z.string().uuid().optional(),
|
|
7455
|
+
session_id: import_zod59.z.string().uuid().optional(),
|
|
7449
7456
|
/**
|
|
7450
7457
|
* Worker turn id of a `turn.*` event, paired with `session_id`.
|
|
7451
7458
|
* NOT a uuid: `deriveWorkerTurnId` yields a uuid-v5, but other
|
|
7452
7459
|
* emitters use composite forms (`${kind}:${idempotencyKey}`), so the
|
|
7453
7460
|
* wire type stays an opaque string.
|
|
7454
7461
|
*/
|
|
7455
|
-
turn_id:
|
|
7456
|
-
lifecycle_phase:
|
|
7457
|
-
lifecycle_transition_id:
|
|
7458
|
-
idle_since:
|
|
7459
|
-
grace_deadline:
|
|
7460
|
-
reason:
|
|
7461
|
-
terminate_deadline:
|
|
7462
|
-
}).strict();
|
|
7463
|
-
var WebhookSubscriptionStatusSchema =
|
|
7464
|
-
var CreateWebhookSubscriptionRequestSchema =
|
|
7465
|
-
projectId:
|
|
7462
|
+
turn_id: import_zod59.z.string().min(1).optional(),
|
|
7463
|
+
lifecycle_phase: import_zod59.z.enum(["idle", "terminating", "terminated"]).optional(),
|
|
7464
|
+
lifecycle_transition_id: import_zod59.z.string().uuid().optional(),
|
|
7465
|
+
idle_since: import_zod59.z.string().optional(),
|
|
7466
|
+
grace_deadline: import_zod59.z.string().optional(),
|
|
7467
|
+
reason: import_zod59.z.string().optional(),
|
|
7468
|
+
terminate_deadline: import_zod59.z.string().optional()
|
|
7469
|
+
}).strict();
|
|
7470
|
+
var WebhookSubscriptionStatusSchema = import_zod59.z.enum(["active", "disabled"]);
|
|
7471
|
+
var CreateWebhookSubscriptionRequestSchema = import_zod59.z.object({
|
|
7472
|
+
projectId: import_zod59.z.string().uuid(),
|
|
7466
7473
|
/** Subscriber endpoint. https required outside dev; SSRF-validated. */
|
|
7467
|
-
url:
|
|
7474
|
+
url: import_zod59.z.string().url().max(1024),
|
|
7468
7475
|
/** Event types to deliver. At least one. */
|
|
7469
|
-
events:
|
|
7476
|
+
events: import_zod59.z.array(WebhookEventTypeSchema).min(1).max(WEBHOOK_EVENT_TYPES.length),
|
|
7470
7477
|
/** Optional operator note shown in list responses. */
|
|
7471
|
-
description:
|
|
7478
|
+
description: import_zod59.z.string().max(512).optional()
|
|
7472
7479
|
}).strict();
|
|
7473
|
-
var UpdateWebhookSubscriptionRequestSchema =
|
|
7474
|
-
url:
|
|
7475
|
-
events:
|
|
7476
|
-
description:
|
|
7480
|
+
var UpdateWebhookSubscriptionRequestSchema = import_zod59.z.object({
|
|
7481
|
+
url: import_zod59.z.string().url().max(1024).optional(),
|
|
7482
|
+
events: import_zod59.z.array(WebhookEventTypeSchema).min(1).max(WEBHOOK_EVENT_TYPES.length).optional(),
|
|
7483
|
+
description: import_zod59.z.string().max(512).nullable().optional(),
|
|
7477
7484
|
/**
|
|
7478
7485
|
* `active` re-enables a subscription that was auto-disabled after
|
|
7479
7486
|
* consecutive failures (resets the failure counter); `disabled`
|
|
@@ -7484,23 +7491,23 @@ var UpdateWebhookSubscriptionRequestSchema = import_zod58.z.object({
|
|
|
7484
7491
|
(data) => data.url !== void 0 || data.events !== void 0 || data.description !== void 0 || data.status !== void 0,
|
|
7485
7492
|
{ message: "At least one of url / events / description / status MUST be provided" }
|
|
7486
7493
|
);
|
|
7487
|
-
var WebhookSubscriptionSchema =
|
|
7488
|
-
id:
|
|
7489
|
-
projectId:
|
|
7490
|
-
url:
|
|
7491
|
-
events:
|
|
7492
|
-
description:
|
|
7494
|
+
var WebhookSubscriptionSchema = import_zod59.z.object({
|
|
7495
|
+
id: import_zod59.z.string().uuid(),
|
|
7496
|
+
projectId: import_zod59.z.string().uuid(),
|
|
7497
|
+
url: import_zod59.z.string(),
|
|
7498
|
+
events: import_zod59.z.array(WebhookEventTypeSchema),
|
|
7499
|
+
description: import_zod59.z.string().nullable(),
|
|
7493
7500
|
status: WebhookSubscriptionStatusSchema,
|
|
7494
|
-
consecutiveFailures:
|
|
7495
|
-
createdBy:
|
|
7496
|
-
createdAt:
|
|
7497
|
-
updatedAt:
|
|
7501
|
+
consecutiveFailures: import_zod59.z.number().int().nonnegative(),
|
|
7502
|
+
createdBy: import_zod59.z.string(),
|
|
7503
|
+
createdAt: import_zod59.z.string(),
|
|
7504
|
+
updatedAt: import_zod59.z.string()
|
|
7498
7505
|
});
|
|
7499
|
-
var WebhookSubscriptionWithSecretSchema =
|
|
7506
|
+
var WebhookSubscriptionWithSecretSchema = import_zod59.z.object({
|
|
7500
7507
|
subscription: WebhookSubscriptionSchema,
|
|
7501
|
-
secret:
|
|
7508
|
+
secret: import_zod59.z.string()
|
|
7502
7509
|
});
|
|
7503
|
-
var WebhookSubscriptionErrorCodeSchema =
|
|
7510
|
+
var WebhookSubscriptionErrorCodeSchema = import_zod59.z.enum([
|
|
7504
7511
|
// 400
|
|
7505
7512
|
"VALIDATION_ERROR",
|
|
7506
7513
|
/** URL failed SSRF policy (non-https, private/loopback/link-local IP…). */
|
|
@@ -7513,117 +7520,125 @@ var WebhookSubscriptionErrorCodeSchema = import_zod58.z.enum([
|
|
|
7513
7520
|
// 500
|
|
7514
7521
|
"INTERNAL_ERROR"
|
|
7515
7522
|
]);
|
|
7516
|
-
var SessionPrewarmingIdentitySchema =
|
|
7517
|
-
projectIdGenerator:
|
|
7518
|
-
claimNameTemplate:
|
|
7519
|
-
idempotencyScopePrefix:
|
|
7520
|
-
}).strict();
|
|
7521
|
-
var SessionPrewarmingSessionTemplateSchema =
|
|
7522
|
-
configValues:
|
|
7523
|
-
metadata:
|
|
7524
|
-
}).strict();
|
|
7525
|
-
var BusinessReadyProbeSchema =
|
|
7526
|
-
endpointName:
|
|
7527
|
-
path:
|
|
7528
|
-
successCodes:
|
|
7529
|
-
timeoutMs:
|
|
7530
|
-
}).strict();
|
|
7531
|
-
var SessionPrewarmingSpecSchema =
|
|
7532
|
-
targetReadyCount:
|
|
7533
|
-
reVerifyIntervalSeconds:
|
|
7534
|
-
warmingTimeoutSeconds:
|
|
7535
|
-
claimingLeaseTtlSeconds:
|
|
7536
|
-
replenishIntervalSeconds:
|
|
7537
|
-
maxConcurrentWarming:
|
|
7523
|
+
var SessionPrewarmingIdentitySchema = import_zod60.z.object({
|
|
7524
|
+
projectIdGenerator: import_zod60.z.literal("nanoid"),
|
|
7525
|
+
claimNameTemplate: import_zod60.z.string().min(1),
|
|
7526
|
+
idempotencyScopePrefix: import_zod60.z.string().min(1)
|
|
7527
|
+
}).strict();
|
|
7528
|
+
var SessionPrewarmingSessionTemplateSchema = import_zod60.z.object({
|
|
7529
|
+
configValues: import_zod60.z.record(import_zod60.z.string(), import_zod60.z.string()),
|
|
7530
|
+
metadata: import_zod60.z.record(import_zod60.z.string(), import_zod60.z.unknown()).optional()
|
|
7531
|
+
}).strict();
|
|
7532
|
+
var BusinessReadyProbeSchema = import_zod60.z.object({
|
|
7533
|
+
endpointName: import_zod60.z.enum(["api", "preview"]),
|
|
7534
|
+
path: import_zod60.z.string().min(1),
|
|
7535
|
+
successCodes: import_zod60.z.array(import_zod60.z.number().int().min(100).max(599)).min(1),
|
|
7536
|
+
timeoutMs: import_zod60.z.number().int().min(500).max(3e4)
|
|
7537
|
+
}).strict();
|
|
7538
|
+
var SessionPrewarmingSpecSchema = import_zod60.z.object({
|
|
7539
|
+
targetReadyCount: import_zod60.z.number().int().min(1).max(50),
|
|
7540
|
+
reVerifyIntervalSeconds: import_zod60.z.number().int().min(60).max(3600),
|
|
7541
|
+
warmingTimeoutSeconds: import_zod60.z.number().int().min(60).max(600),
|
|
7542
|
+
claimingLeaseTtlSeconds: import_zod60.z.number().int().min(10).max(120),
|
|
7543
|
+
replenishIntervalSeconds: import_zod60.z.number().int().min(5).max(300),
|
|
7544
|
+
maxConcurrentWarming: import_zod60.z.number().int().min(1).max(10),
|
|
7538
7545
|
identity: SessionPrewarmingIdentitySchema,
|
|
7539
7546
|
sessionTemplate: SessionPrewarmingSessionTemplateSchema,
|
|
7540
7547
|
businessReadyProbe: BusinessReadyProbeSchema.optional()
|
|
7541
7548
|
}).strict();
|
|
7542
|
-
var AcquireSessionRequestSchema =
|
|
7543
|
-
workloadId:
|
|
7544
|
-
clientMutationId:
|
|
7545
|
-
}).strict();
|
|
7546
|
-
var AcquireSessionResponseSchema =
|
|
7547
|
-
leaseToken:
|
|
7548
|
-
leaseExpiresAt:
|
|
7549
|
-
sessionId:
|
|
7550
|
-
projectId:
|
|
7551
|
-
runtimeClaimName:
|
|
7552
|
-
configValues:
|
|
7549
|
+
var AcquireSessionRequestSchema = import_zod60.z.object({
|
|
7550
|
+
workloadId: import_zod60.z.string().uuid(),
|
|
7551
|
+
clientMutationId: import_zod60.z.string().min(1).max(255)
|
|
7552
|
+
}).strict();
|
|
7553
|
+
var AcquireSessionResponseSchema = import_zod60.z.object({
|
|
7554
|
+
leaseToken: import_zod60.z.string().min(1),
|
|
7555
|
+
leaseExpiresAt: import_zod60.z.string().datetime(),
|
|
7556
|
+
sessionId: import_zod60.z.string().uuid(),
|
|
7557
|
+
projectId: import_zod60.z.string().min(1),
|
|
7558
|
+
runtimeClaimName: import_zod60.z.string().min(1),
|
|
7559
|
+
configValues: import_zod60.z.record(import_zod60.z.string(), import_zod60.z.string()),
|
|
7553
7560
|
// Optional: outbox-protocol workloads (`managed_agent`) expose no public HTTP
|
|
7554
7561
|
// endpoint, so a ready slot is claimable with no `apiUrl`. self_managed
|
|
7555
7562
|
// (rush-app) slots always carry it. Omitted (not null) when absent — mirrors
|
|
7556
7563
|
// `previewUrl`. See `pilot-v2-managed-agent-prewarming.md` § Readiness and
|
|
7557
7564
|
// `SessionPoolService.buildAcquireResponse`.
|
|
7558
|
-
apiUrl:
|
|
7559
|
-
previewUrl:
|
|
7565
|
+
apiUrl: import_zod60.z.string().url().optional(),
|
|
7566
|
+
previewUrl: import_zod60.z.string().url().optional()
|
|
7560
7567
|
}).strict();
|
|
7561
|
-
var FinalizeAcquireRequestSchema =
|
|
7562
|
-
leaseToken:
|
|
7563
|
-
sessionId:
|
|
7564
|
-
clientMutationId:
|
|
7568
|
+
var FinalizeAcquireRequestSchema = import_zod60.z.object({
|
|
7569
|
+
leaseToken: import_zod60.z.string().min(1),
|
|
7570
|
+
sessionId: import_zod60.z.string().uuid(),
|
|
7571
|
+
clientMutationId: import_zod60.z.string().min(1).max(255).optional()
|
|
7565
7572
|
}).strict();
|
|
7566
|
-
var AbortAcquireRequestSchema =
|
|
7567
|
-
leaseToken:
|
|
7568
|
-
sessionId:
|
|
7573
|
+
var AbortAcquireRequestSchema = import_zod60.z.object({
|
|
7574
|
+
leaseToken: import_zod60.z.string().min(1),
|
|
7575
|
+
sessionId: import_zod60.z.string().uuid()
|
|
7569
7576
|
}).strict();
|
|
7570
|
-
var WorkloadLifecycleKindSchema =
|
|
7571
|
-
var WorkloadLifecycleConfigSchema =
|
|
7572
|
-
idleEnabled:
|
|
7573
|
-
idleAfterSeconds:
|
|
7574
|
-
idleGraceSeconds:
|
|
7575
|
-
maxSessionLifetimeMs:
|
|
7577
|
+
var WorkloadLifecycleKindSchema = import_zod61.z.enum(["managed_agent", "self_managed"]);
|
|
7578
|
+
var WorkloadLifecycleConfigSchema = import_zod61.z.object({
|
|
7579
|
+
idleEnabled: import_zod61.z.boolean().nullable(),
|
|
7580
|
+
idleAfterSeconds: import_zod61.z.number().int().min(300).max(86400).nullable(),
|
|
7581
|
+
idleGraceSeconds: import_zod61.z.number().int().min(60).max(3600).nullable(),
|
|
7582
|
+
maxSessionLifetimeMs: import_zod61.z.number().int().min(36e5).max(6048e5).nullable()
|
|
7576
7583
|
}).strict();
|
|
7577
7584
|
var WorkloadLifecycleConfigUpdateSchema = WorkloadLifecycleConfigSchema.partial().strict();
|
|
7578
|
-
var EffectiveWorkloadLifecycleConfigSchema =
|
|
7579
|
-
idleEnabled:
|
|
7580
|
-
idleAfterSeconds:
|
|
7581
|
-
idleGraceSeconds:
|
|
7582
|
-
maxSessionLifetimeMs:
|
|
7583
|
-
}).strict();
|
|
7584
|
-
var WorkloadLifecycleConfigResponseSchema =
|
|
7585
|
-
workloadId:
|
|
7585
|
+
var EffectiveWorkloadLifecycleConfigSchema = import_zod61.z.object({
|
|
7586
|
+
idleEnabled: import_zod61.z.boolean(),
|
|
7587
|
+
idleAfterSeconds: import_zod61.z.number().int().min(300).max(86400),
|
|
7588
|
+
idleGraceSeconds: import_zod61.z.number().int().min(60).max(3600),
|
|
7589
|
+
maxSessionLifetimeMs: import_zod61.z.number().int().min(36e5).max(6048e5)
|
|
7590
|
+
}).strict();
|
|
7591
|
+
var WorkloadLifecycleConfigResponseSchema = import_zod61.z.object({
|
|
7592
|
+
workloadId: import_zod61.z.string().uuid(),
|
|
7586
7593
|
kind: WorkloadLifecycleKindSchema,
|
|
7587
7594
|
config: WorkloadLifecycleConfigSchema,
|
|
7588
7595
|
effective: EffectiveWorkloadLifecycleConfigSchema
|
|
7589
7596
|
}).strict();
|
|
7590
|
-
var OtelJobContextSchema =
|
|
7597
|
+
var OtelJobContextSchema = import_zod62.z.object({
|
|
7591
7598
|
/** W3C Trace Context `traceparent` header value. */
|
|
7592
|
-
traceparent:
|
|
7599
|
+
traceparent: import_zod62.z.string().optional(),
|
|
7593
7600
|
/** W3C Trace Context `tracestate` header value. */
|
|
7594
|
-
tracestate:
|
|
7601
|
+
tracestate: import_zod62.z.string().optional(),
|
|
7595
7602
|
/** W3C Baggage header value. */
|
|
7596
|
-
baggage:
|
|
7603
|
+
baggage: import_zod62.z.string().optional()
|
|
7597
7604
|
}).passthrough();
|
|
7598
|
-
var LifecycleStageNameSchema =
|
|
7599
|
-
var SlotCanarySummarySchema =
|
|
7605
|
+
var LifecycleStageNameSchema = import_zod63.z.enum(["test", "production"]);
|
|
7606
|
+
var SlotCanarySummarySchema = import_zod63.z.object({
|
|
7600
7607
|
/** canary 臂 revision id。 */
|
|
7601
|
-
revisionId:
|
|
7608
|
+
revisionId: import_zod63.z.string(),
|
|
7602
7609
|
/** canary revision 的人可读版本短名;revision 行缺失时 null(降级显示 id 前缀)。 */
|
|
7603
|
-
revisionLabel:
|
|
7610
|
+
revisionLabel: import_zod63.z.string().nullable(),
|
|
7604
7611
|
/** 0..99;0 = 冻结观察态(仅名单命中仍入 canary)。 */
|
|
7605
|
-
percentage:
|
|
7612
|
+
percentage: import_zod63.z.number().int(),
|
|
7606
7613
|
/** ldap 名单人数(徽章"名单 N 人";0 = 无名单)。 */
|
|
7607
|
-
userAllowlistCount:
|
|
7614
|
+
userAllowlistCount: import_zod63.z.number().int(),
|
|
7608
7615
|
/** 本轮灰度开始时间(ISO);存量行无记录时 null。 */
|
|
7609
|
-
startedAt:
|
|
7616
|
+
startedAt: import_zod63.z.string().nullable()
|
|
7610
7617
|
});
|
|
7611
|
-
var SlotSummarySchema =
|
|
7612
|
-
revisionId:
|
|
7618
|
+
var SlotSummarySchema = import_zod63.z.object({
|
|
7619
|
+
revisionId: import_zod63.z.string().nullable(),
|
|
7613
7620
|
/** 人可读的版本标识(revision name/number);无部署时 null。 */
|
|
7614
|
-
revisionLabel:
|
|
7615
|
-
environmentId:
|
|
7616
|
-
environmentName:
|
|
7617
|
-
environmentVersion:
|
|
7621
|
+
revisionLabel: import_zod63.z.string().nullable(),
|
|
7622
|
+
environmentId: import_zod63.z.string().nullable(),
|
|
7623
|
+
environmentName: import_zod63.z.string().nullable(),
|
|
7624
|
+
environmentVersion: import_zod63.z.number().int().nullable(),
|
|
7625
|
+
/**
|
|
7626
|
+
* 槽位所指 revision 自带的运行环境(`revisions.runtime_template_id` 及其名字)。
|
|
7627
|
+
* 槽位 `environmentId` 为 NULL(存量未绑定行)时会话实际跑的就是它——读侧用
|
|
7628
|
+
* 它兜底显示,不再渲染「内置于版本」伪状态(ENV-R1a)。发布板读模型必带;
|
|
7629
|
+
* 工作台等其它 SlotSummary 生产方可省略(省略 = 未报告)。
|
|
7630
|
+
*/
|
|
7631
|
+
revisionEnvironmentId: import_zod63.z.string().nullable().optional(),
|
|
7632
|
+
revisionEnvironmentName: import_zod63.z.string().nullable().optional(),
|
|
7618
7633
|
/** 槽位最近一次变更时间(ISO);数据缺口约定:仅当前指针,无历史流水。 */
|
|
7619
|
-
updatedAt:
|
|
7634
|
+
updatedAt: import_zod63.z.string().nullable(),
|
|
7620
7635
|
/**
|
|
7621
7636
|
* 活跃灰度摘要(#1214)。目前仅发布板读模型的槽位显式带出(null = 无灰度);
|
|
7622
7637
|
* 工作台等其它 SlotSummary 生产方不带(optional,省略 = 未报告)。
|
|
7623
7638
|
*/
|
|
7624
7639
|
canary: SlotCanarySummarySchema.nullable().optional()
|
|
7625
7640
|
});
|
|
7626
|
-
var WorkbenchStageDriftKindSchema =
|
|
7641
|
+
var WorkbenchStageDriftKindSchema = import_zod63.z.enum([
|
|
7627
7642
|
/** test 指向新于 production(待晋级)。 */
|
|
7628
7643
|
"test_ahead",
|
|
7629
7644
|
/** 只有 test 有部署(从未上过 production)。 */
|
|
@@ -7646,27 +7661,27 @@ var WorkbenchStageDriftKindSchema = import_zod62.z.enum([
|
|
|
7646
7661
|
*/
|
|
7647
7662
|
"diverged"
|
|
7648
7663
|
]);
|
|
7649
|
-
var WorkbenchStageDriftItemSchema =
|
|
7650
|
-
workloadId:
|
|
7651
|
-
workloadName:
|
|
7652
|
-
workloadSlug:
|
|
7664
|
+
var WorkbenchStageDriftItemSchema = import_zod63.z.object({
|
|
7665
|
+
workloadId: import_zod63.z.string(),
|
|
7666
|
+
workloadName: import_zod63.z.string(),
|
|
7667
|
+
workloadSlug: import_zod63.z.string().nullable(),
|
|
7653
7668
|
kind: WorkbenchStageDriftKindSchema,
|
|
7654
7669
|
test: SlotSummarySchema.nullable(),
|
|
7655
7670
|
production: SlotSummarySchema.nullable(),
|
|
7656
7671
|
/** 差异开始的近似时间 = 领先侧槽位的 updatedAt(ISO)。 */
|
|
7657
|
-
since:
|
|
7672
|
+
since: import_zod63.z.string().nullable()
|
|
7658
7673
|
});
|
|
7659
|
-
var WorkbenchRecentChangeKindSchema =
|
|
7674
|
+
var WorkbenchRecentChangeKindSchema = import_zod63.z.enum([
|
|
7660
7675
|
"stage_updated",
|
|
7661
7676
|
"revision_published",
|
|
7662
7677
|
"environment_version_created"
|
|
7663
7678
|
]);
|
|
7664
|
-
var WorkbenchRecentChangeSchema =
|
|
7679
|
+
var WorkbenchRecentChangeSchema = import_zod63.z.object({
|
|
7665
7680
|
kind: WorkbenchRecentChangeKindSchema,
|
|
7666
7681
|
/** 变更主体的可读标题(如 workload 名 / 环境名)。 */
|
|
7667
|
-
subject:
|
|
7682
|
+
subject: import_zod63.z.string(),
|
|
7668
7683
|
/** 主体 id(workloadId / environmentId),用于前端拼详情链接。 */
|
|
7669
|
-
subjectId:
|
|
7684
|
+
subjectId: import_zod63.z.string(),
|
|
7670
7685
|
/**
|
|
7671
7686
|
* workload 类变更(stage_updated / revision_published)的 slug——详情路由
|
|
7672
7687
|
* UUID / slug 双形态均可达,前端优先用可读的 slug 拼链接,缺失时回退
|
|
@@ -7677,26 +7692,26 @@ var WorkbenchRecentChangeSchema = import_zod62.z.object({
|
|
|
7677
7692
|
* agenthub-sdk 对 WorkbenchDTO 的硬 parse)在滚动发版遇到旧产出时
|
|
7678
7693
|
* 降级为无 slug,而不是整个 DTO 校验失败。
|
|
7679
7694
|
*/
|
|
7680
|
-
subjectSlug:
|
|
7695
|
+
subjectSlug: import_zod63.z.string().nullable().optional(),
|
|
7681
7696
|
/** 一句话变更描述(如 "production → rev-12" / "环境 v3 创建")。 */
|
|
7682
|
-
detail:
|
|
7683
|
-
occurredAt:
|
|
7697
|
+
detail: import_zod63.z.string(),
|
|
7698
|
+
occurredAt: import_zod63.z.string()
|
|
7684
7699
|
});
|
|
7685
|
-
var WorkbenchSessionStatsSchema =
|
|
7686
|
-
running:
|
|
7687
|
-
failed24h:
|
|
7688
|
-
total24h:
|
|
7700
|
+
var WorkbenchSessionStatsSchema = import_zod63.z.object({
|
|
7701
|
+
running: import_zod63.z.number().int(),
|
|
7702
|
+
failed24h: import_zod63.z.number().int(),
|
|
7703
|
+
total24h: import_zod63.z.number().int()
|
|
7689
7704
|
});
|
|
7690
|
-
var WorkbenchDTOSchema =
|
|
7691
|
-
workloadCount:
|
|
7705
|
+
var WorkbenchDTOSchema = import_zod63.z.object({
|
|
7706
|
+
workloadCount: import_zod63.z.number().int(),
|
|
7692
7707
|
sessionStats: WorkbenchSessionStatsSchema,
|
|
7693
|
-
stageDrift:
|
|
7694
|
-
recentChanges:
|
|
7708
|
+
stageDrift: import_zod63.z.array(WorkbenchStageDriftItemSchema),
|
|
7709
|
+
recentChanges: import_zod63.z.array(WorkbenchRecentChangeSchema)
|
|
7695
7710
|
});
|
|
7696
|
-
var ReleaseBoardRowSchema =
|
|
7697
|
-
workloadId:
|
|
7698
|
-
workloadName:
|
|
7699
|
-
workloadSlug:
|
|
7711
|
+
var ReleaseBoardRowSchema = import_zod63.z.object({
|
|
7712
|
+
workloadId: import_zod63.z.string(),
|
|
7713
|
+
workloadName: import_zod63.z.string(),
|
|
7714
|
+
workloadSlug: import_zod63.z.string().nullable(),
|
|
7700
7715
|
/**
|
|
7701
7716
|
* @deprecated Workload 当前默认指针(`default_revision_id`,production 部署
|
|
7702
7717
|
* 从写)。指针收敛(2026-08-02)后发布 UI 不再移动它,本字段随删列窗口结束
|
|
@@ -7705,7 +7720,7 @@ var ReleaseBoardRowSchema = import_zod62.z.object({
|
|
|
7705
7720
|
* 新消费方一律读 `latestRevision`(前端回退链 latestRevision ?? defaultRevision
|
|
7706
7721
|
* 只为兼容旧服务端缺字段,不表示两者同义)。
|
|
7707
7722
|
*/
|
|
7708
|
-
defaultRevision:
|
|
7723
|
+
defaultRevision: import_zod63.z.object({ id: import_zod63.z.string(), version: import_zod63.z.string(), createdAt: import_zod63.z.string() }).nullable(),
|
|
7709
7724
|
/**
|
|
7710
7725
|
* Workload 最近发布的 Revision(createdAt 最新;并列时 id 大者,保证确定性)。
|
|
7711
7726
|
* 发布板用它判断"有新版本尚未部署到 test"(latestRevision.id ≠
|
|
@@ -7718,12 +7733,12 @@ var ReleaseBoardRowSchema = import_zod62.z.object({
|
|
|
7718
7733
|
* pendingRevision)一直想要的一致。**optional**:旧服务端的响应没有此字段,
|
|
7719
7734
|
* 新 client 解析须容忍(双向滚动窗口兼容),缺席时回退读 defaultRevision。
|
|
7720
7735
|
*/
|
|
7721
|
-
latestRevision:
|
|
7722
|
-
id:
|
|
7723
|
-
version:
|
|
7724
|
-
createdAt:
|
|
7736
|
+
latestRevision: import_zod63.z.object({
|
|
7737
|
+
id: import_zod63.z.string(),
|
|
7738
|
+
version: import_zod63.z.string(),
|
|
7739
|
+
createdAt: import_zod63.z.string(),
|
|
7725
7740
|
/** 真实发布时间;optional 仅用于新旧服务端滚动窗口兼容。 */
|
|
7726
|
-
publishedAt:
|
|
7741
|
+
publishedAt: import_zod63.z.string().optional()
|
|
7727
7742
|
}).nullable().optional(),
|
|
7728
7743
|
/**
|
|
7729
7744
|
* 用户当前有理由继续使用的 Revision(latestRevision、test、production)中,
|
|
@@ -7731,30 +7746,35 @@ var ReleaseBoardRowSchema = import_zod62.z.object({
|
|
|
7731
7746
|
* latestRevision;具体复制哪份配置由升级弹窗显式选择。optional 仅用于
|
|
7732
7747
|
* 新旧服务端滚动窗口兼容。
|
|
7733
7748
|
*/
|
|
7734
|
-
runtimeUpgradeAvailable:
|
|
7749
|
+
runtimeUpgradeAvailable: import_zod63.z.boolean().optional(),
|
|
7735
7750
|
test: SlotSummarySchema.nullable(),
|
|
7736
7751
|
production: SlotSummarySchema.nullable(),
|
|
7737
|
-
/**
|
|
7738
|
-
|
|
7752
|
+
/**
|
|
7753
|
+
* test 与 production 指向不同 revision,或**有效环境**不同
|
|
7754
|
+
* (`environmentId ?? revisionEnvironmentId`,ENV-R1a);环境版本号只在两侧
|
|
7755
|
+
* 都显式绑定时参与比较——任一侧是兜底态(槽位未绑、跑版本自带环境)时
|
|
7756
|
+
* 没有可比的版本钉。发布板展开面板的环境行高亮与本字段同口径。
|
|
7757
|
+
*/
|
|
7758
|
+
drift: import_zod63.z.boolean(),
|
|
7739
7759
|
/** 两槽位 updatedAt 的较新者(ISO);均空则 null。 */
|
|
7740
|
-
lastChangedAt:
|
|
7741
|
-
});
|
|
7742
|
-
var ReleaseBoardDTOSchema =
|
|
7743
|
-
rows:
|
|
7744
|
-
});
|
|
7745
|
-
var SessionDiagnosisSessionSchema =
|
|
7746
|
-
id:
|
|
7747
|
-
workloadId:
|
|
7748
|
-
workloadName:
|
|
7749
|
-
workloadSlug:
|
|
7750
|
-
status:
|
|
7751
|
-
lifecyclePhase:
|
|
7752
|
-
model:
|
|
7753
|
-
createdAt:
|
|
7754
|
-
readyAt:
|
|
7755
|
-
endedAt:
|
|
7760
|
+
lastChangedAt: import_zod63.z.string().nullable()
|
|
7761
|
+
});
|
|
7762
|
+
var ReleaseBoardDTOSchema = import_zod63.z.object({
|
|
7763
|
+
rows: import_zod63.z.array(ReleaseBoardRowSchema)
|
|
7764
|
+
});
|
|
7765
|
+
var SessionDiagnosisSessionSchema = import_zod63.z.object({
|
|
7766
|
+
id: import_zod63.z.string(),
|
|
7767
|
+
workloadId: import_zod63.z.string().nullable(),
|
|
7768
|
+
workloadName: import_zod63.z.string().nullable(),
|
|
7769
|
+
workloadSlug: import_zod63.z.string().nullable(),
|
|
7770
|
+
status: import_zod63.z.string(),
|
|
7771
|
+
lifecyclePhase: import_zod63.z.string().nullable(),
|
|
7772
|
+
model: import_zod63.z.string().nullable(),
|
|
7773
|
+
createdAt: import_zod63.z.string(),
|
|
7774
|
+
readyAt: import_zod63.z.string().nullable(),
|
|
7775
|
+
endedAt: import_zod63.z.string().nullable(),
|
|
7756
7776
|
/** 会话创建链路 trace(Octopus 深链"启动 Trace"数据源)。 */
|
|
7757
|
-
rootTraceId:
|
|
7777
|
+
rootTraceId: import_zod63.z.string().nullable(),
|
|
7758
7778
|
/**
|
|
7759
7779
|
* 该会话能不能点进对话面(`/p/<pid>/s/<sid>`)。**由服务端算好下发,前端不要
|
|
7760
7780
|
* 自己按 `usageKind` 重推** —— `usage_kind` 是会话创建时写死的名字、认领后
|
|
@@ -7762,37 +7782,37 @@ var SessionDiagnosisSessionSchema = import_zod62.z.object({
|
|
|
7762
7782
|
* `packages/control-plane/src/session-lifecycle/session-chat-entry.ts`,
|
|
7763
7783
|
* 排障列表的 `chatHref` 走的是同一个函数。
|
|
7764
7784
|
*/
|
|
7765
|
-
canOpenChat:
|
|
7785
|
+
canOpenChat: import_zod63.z.boolean()
|
|
7766
7786
|
});
|
|
7767
|
-
var SessionDiagnosisFailureSchema =
|
|
7768
|
-
kind:
|
|
7769
|
-
message:
|
|
7770
|
-
occurredAt:
|
|
7787
|
+
var SessionDiagnosisFailureSchema = import_zod63.z.object({
|
|
7788
|
+
kind: import_zod63.z.string().nullable(),
|
|
7789
|
+
message: import_zod63.z.string().nullable(),
|
|
7790
|
+
occurredAt: import_zod63.z.string().nullable()
|
|
7771
7791
|
});
|
|
7772
|
-
var SessionDiagnosisEventSchema =
|
|
7773
|
-
id:
|
|
7774
|
-
type:
|
|
7792
|
+
var SessionDiagnosisEventSchema = import_zod63.z.object({
|
|
7793
|
+
id: import_zod63.z.string(),
|
|
7794
|
+
type: import_zod63.z.string(),
|
|
7775
7795
|
/** 该轮 dispatch trace(每条用户消息的 Octopus 深链数据源);非 dispatch 事件为 null。 */
|
|
7776
|
-
traceId:
|
|
7777
|
-
summary:
|
|
7778
|
-
occurredAt:
|
|
7796
|
+
traceId: import_zod63.z.string().nullable(),
|
|
7797
|
+
summary: import_zod63.z.string().nullable(),
|
|
7798
|
+
occurredAt: import_zod63.z.string()
|
|
7779
7799
|
});
|
|
7780
|
-
var SessionDiagnosisSandboxSchema =
|
|
7781
|
-
id:
|
|
7782
|
-
status:
|
|
7783
|
-
expiresAt:
|
|
7784
|
-
createdAt:
|
|
7800
|
+
var SessionDiagnosisSandboxSchema = import_zod63.z.object({
|
|
7801
|
+
id: import_zod63.z.string(),
|
|
7802
|
+
status: import_zod63.z.string(),
|
|
7803
|
+
expiresAt: import_zod63.z.string().nullable(),
|
|
7804
|
+
createdAt: import_zod63.z.string().nullable()
|
|
7785
7805
|
});
|
|
7786
|
-
var SessionDiagnosisDTOSchema =
|
|
7806
|
+
var SessionDiagnosisDTOSchema = import_zod63.z.object({
|
|
7787
7807
|
session: SessionDiagnosisSessionSchema,
|
|
7788
7808
|
failure: SessionDiagnosisFailureSchema.nullable(),
|
|
7789
|
-
events:
|
|
7809
|
+
events: import_zod63.z.array(SessionDiagnosisEventSchema).nullable(),
|
|
7790
7810
|
sandbox: SessionDiagnosisSandboxSchema.nullable(),
|
|
7791
7811
|
// zod v4 infers `z.record(enum, string)` as a FULL `Record` (all keys
|
|
7792
7812
|
// present) instead of v3's `Partial` — but only failing blocks appear here.
|
|
7793
7813
|
// Explicit partial object keeps the v3 inference; runtime behavior matches
|
|
7794
7814
|
// the record form (any key subset accepted, extras rejected).
|
|
7795
|
-
blockErrors:
|
|
7815
|
+
blockErrors: import_zod63.z.object({ failure: import_zod63.z.string(), events: import_zod63.z.string(), sandbox: import_zod63.z.string() }).partial().optional()
|
|
7796
7816
|
});
|
|
7797
7817
|
var PIPELINE_TRIGGERS = ["push", "merge", "manual", "env_change", "rebake"];
|
|
7798
7818
|
var PIPELINE_RUN_STATUSES = [
|
|
@@ -7834,12 +7854,12 @@ var PIPELINE_FULL_FACE_TRIGGERS = Object.keys(PIPELINE_TRIGGER_STAGES).filter((t
|
|
|
7834
7854
|
return set.length === PIPELINE_STEPS.length && PIPELINE_STEPS.every((s) => set.includes(s));
|
|
7835
7855
|
});
|
|
7836
7856
|
var IMAGE_FINGERPRINT_RE = /^fp_[0-9a-f]{64}$/;
|
|
7837
|
-
var BakeInputsSchema =
|
|
7838
|
-
v:
|
|
7839
|
-
fingerprint:
|
|
7840
|
-
baseImage:
|
|
7857
|
+
var BakeInputsSchema = import_zod64.z.object({
|
|
7858
|
+
v: import_zod64.z.literal(1),
|
|
7859
|
+
fingerprint: import_zod64.z.string().regex(IMAGE_FINGERPRINT_RE),
|
|
7860
|
+
baseImage: import_zod64.z.string().min(1),
|
|
7841
7861
|
packages: EnvironmentPackagesSchema.nullable(),
|
|
7842
|
-
generatorVersion:
|
|
7862
|
+
generatorVersion: import_zod64.z.number().int().positive()
|
|
7843
7863
|
}).strict();
|
|
7844
7864
|
var BAKE_IMAGE_BUILD_TIMEOUT_MS = 45 * 60 * 1e3;
|
|
7845
7865
|
var BAKE_MATERIALIZE_WAIT_MS = 30 * 60 * 1e3;
|
|
@@ -7857,7 +7877,7 @@ var FILE_AGENT_REFERENCE_NAME_MAX_LENGTH = 200;
|
|
|
7857
7877
|
var FILE_AGENT_REFERENCE_LIST_MAX_LENGTH = 100;
|
|
7858
7878
|
var FILE_AGENT_PACKAGE_FILE_CHAR_WHITELIST = /^[A-Za-z0-9._/-]+$/;
|
|
7859
7879
|
function packageFilePathSchema(fieldName) {
|
|
7860
|
-
return
|
|
7880
|
+
return import_zod65.z.string().min(1).max(FILE_AGENT_PACKAGE_FILE_PATH_MAX_LENGTH).refine((value) => FILE_AGENT_PACKAGE_FILE_CHAR_WHITELIST.test(value), {
|
|
7861
7881
|
message: `${fieldName} may only contain [A-Za-z0-9._/-]`
|
|
7862
7882
|
}).refine((value) => !value.startsWith("/"), {
|
|
7863
7883
|
message: `${fieldName} must be a relative path`
|
|
@@ -7873,11 +7893,11 @@ function packageFilePathSchema(fieldName) {
|
|
|
7873
7893
|
var FileAgentSystemPromptFileSchema = packageFilePathSchema("systemPromptFile");
|
|
7874
7894
|
var FileAgentSetupScriptFileSchema = packageFilePathSchema("setupScriptFile");
|
|
7875
7895
|
var FILE_AGENT_RUSH_NAME_WHITELIST = /^(@[A-Za-z0-9][A-Za-z0-9._-]*\/)?[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
7876
|
-
var FileAgentReferenceNameSchema =
|
|
7896
|
+
var FileAgentReferenceNameSchema = import_zod65.z.string().min(1).max(FILE_AGENT_REFERENCE_NAME_MAX_LENGTH).refine((value) => FILE_AGENT_RUSH_NAME_WHITELIST.test(value), {
|
|
7877
7897
|
message: "rush registry name must match (@scope/)?name using only [A-Za-z0-9._-] (no spaces or invisible characters)"
|
|
7878
7898
|
});
|
|
7879
7899
|
function platformEntityNameSchema(fieldName) {
|
|
7880
|
-
return
|
|
7900
|
+
return import_zod65.z.string().min(1).max(FILE_AGENT_REFERENCE_NAME_MAX_LENGTH).refine((value) => value.trim() === value, {
|
|
7881
7901
|
message: `${fieldName} name must not have leading or trailing whitespace`
|
|
7882
7902
|
}).refine((value) => !/[\p{Cc}\p{Cf}]/u.test(value), {
|
|
7883
7903
|
message: `${fieldName} name must not contain control or invisible format characters`
|
|
@@ -7885,29 +7905,30 @@ function platformEntityNameSchema(fieldName) {
|
|
|
7885
7905
|
}
|
|
7886
7906
|
var FileAgentEnvironmentNameSchema = platformEntityNameSchema("environment");
|
|
7887
7907
|
var FileAgentModelServiceNameSchema = platformEntityNameSchema("modelService");
|
|
7888
|
-
var FileAgentMcpServerEntrySchema =
|
|
7908
|
+
var FileAgentMcpServerEntrySchema = import_zod65.z.union([
|
|
7889
7909
|
ManagedMcpIdSchema,
|
|
7890
|
-
|
|
7910
|
+
import_zod65.z.object({
|
|
7891
7911
|
id: ManagedMcpIdSchema,
|
|
7892
|
-
disabled:
|
|
7912
|
+
disabled: import_zod65.z.boolean().optional()
|
|
7893
7913
|
}).strict()
|
|
7894
7914
|
]);
|
|
7895
7915
|
function mcpEntryId(entry) {
|
|
7896
7916
|
return typeof entry === "string" ? entry : entry.id;
|
|
7897
7917
|
}
|
|
7898
|
-
var FileAgentMcpServerListSchema =
|
|
7918
|
+
var FileAgentMcpServerListSchema = import_zod65.z.array(FileAgentMcpServerEntrySchema).max(FILE_AGENT_REFERENCE_LIST_MAX_LENGTH).refine(
|
|
7899
7919
|
(list) => {
|
|
7900
7920
|
const ids = list.map(mcpEntryId);
|
|
7901
7921
|
return new Set(ids).size === ids.length;
|
|
7902
7922
|
},
|
|
7903
7923
|
{ message: "must not contain duplicate mcpServers entries (compared by id)" }
|
|
7904
7924
|
);
|
|
7905
|
-
var FileAgentClaudeCodeSectionSchema =
|
|
7925
|
+
var FileAgentClaudeCodeSectionSchema = import_zod65.z.object({
|
|
7906
7926
|
entryCommand: ClaudeCodeAgentPackageEntryCommandSchema.optional()
|
|
7907
7927
|
}).strict();
|
|
7908
|
-
var
|
|
7909
|
-
|
|
7910
|
-
|
|
7928
|
+
var FileAgentMemorySchema = WorkloadManifestMemorySchema.pick({ enabled: true }).strict();
|
|
7929
|
+
var FileAgentClaudeCodeDefinitionSchema = import_zod65.z.object({
|
|
7930
|
+
apiVersion: import_zod65.z.literal(FILE_AGENT_API_VERSION),
|
|
7931
|
+
format: import_zod65.z.literal("claude_code"),
|
|
7911
7932
|
model: WorkloadManifestModelSchema.optional(),
|
|
7912
7933
|
/**
|
|
7913
7934
|
* **待退场旧入口**(owner 2026-08-11 拍板,见
|
|
@@ -7971,25 +7992,40 @@ var FileAgentClaudeCodeDefinitionSchema = import_zod64.z.object({
|
|
|
7971
7992
|
* 沿用既有 `assertLlmProviderModelExclusive` 在解析层触发。
|
|
7972
7993
|
*/
|
|
7973
7994
|
modelService: FileAgentModelServiceNameSchema.optional(),
|
|
7995
|
+
/**
|
|
7996
|
+
* per-agent 记忆闸(#1873)。**缺省 = 开**:不写这一段与写 `enabled: true`
|
|
7997
|
+
* 在运行时等价,区别只在快照里有没有这个键(缺省不投影,见转换器)。
|
|
7998
|
+
*
|
|
7999
|
+
* `enabled: false` 关掉的是这个 Agent 的**全部**记忆面(spec §10 第三层与门):
|
|
8000
|
+
* 召回不带入任何记忆——`memory/` 里的记忆文档与运行时条目**一起**不进 prompt;
|
|
8001
|
+
* `memory_search` 工具查到空;写入面(抽取 / 直写 / 转达晋升)一律回
|
|
8002
|
+
* `agent_disabled`;对话内容不被记录,声明的业务主体也不写。
|
|
8003
|
+
*
|
|
8004
|
+
* 记忆文档的**物化**不受此声明 gating(它是构建产物,照常打进包里),关的是
|
|
8005
|
+
* "带不带进上下文"。
|
|
8006
|
+
*
|
|
8007
|
+
* 与总闸 `v2_managed_memory_enabled` 是 AND 关系:这里写 `true` 打不开总闸。
|
|
8008
|
+
*/
|
|
8009
|
+
memory: FileAgentMemorySchema.optional(),
|
|
7974
8010
|
claudeCode: FileAgentClaudeCodeSectionSchema.optional()
|
|
7975
8011
|
}).strict();
|
|
7976
|
-
var FileAgentDefinitionSchema =
|
|
8012
|
+
var FileAgentDefinitionSchema = import_zod65.z.discriminatedUnion("format", [FileAgentClaudeCodeDefinitionSchema]).superRefine((definition, ctx) => {
|
|
7977
8013
|
if (definition.systemPrompt !== void 0 && definition.systemPromptFile !== void 0) {
|
|
7978
8014
|
ctx.addIssue({
|
|
7979
|
-
code:
|
|
8015
|
+
code: import_zod65.z.ZodIssueCode.custom,
|
|
7980
8016
|
path: ["systemPromptFile"],
|
|
7981
8017
|
message: "systemPrompt and systemPromptFile are mutually exclusive (D18)"
|
|
7982
8018
|
});
|
|
7983
8019
|
}
|
|
7984
8020
|
if (definition.setupScript !== void 0 && definition.setupScriptFile !== void 0) {
|
|
7985
8021
|
ctx.addIssue({
|
|
7986
|
-
code:
|
|
8022
|
+
code: import_zod65.z.ZodIssueCode.custom,
|
|
7987
8023
|
path: ["setupScriptFile"],
|
|
7988
8024
|
message: "setupScript and setupScriptFile are mutually exclusive (D21)"
|
|
7989
8025
|
});
|
|
7990
8026
|
}
|
|
7991
8027
|
});
|
|
7992
|
-
var FileAgentErrorCodeSchema =
|
|
8028
|
+
var FileAgentErrorCodeSchema = import_zod65.z.enum([
|
|
7993
8029
|
/** agent.yaml failed schema validation (unknown/reserved key, apiVersion boundary, field shape). */
|
|
7994
8030
|
"FILE_AGENT_INVALID",
|
|
7995
8031
|
/**
|
|
@@ -8007,6 +8043,16 @@ var FileAgentErrorCodeSchema = import_zod64.z.enum([
|
|
|
8007
8043
|
* operator sees WHICH declaration is broken without parsing the message.
|
|
8008
8044
|
*/
|
|
8009
8045
|
"FILE_AGENT_SETUP_SCRIPT_FILE_UNRESOLVED",
|
|
8046
|
+
/**
|
|
8047
|
+
* A definition doc (`CLAUDE.md`/`AGENTS.md`, see
|
|
8048
|
+
* {@link verdictForFileAgentDefinitionDocCandidate}) resolved to content
|
|
8049
|
+
* over {@link WORKLOAD_MANIFEST_SYSTEM_PROMPT_MAX_LENGTH} characters — but
|
|
8050
|
+
* ONLY for the FIRST doc in `FILE_AGENT_DEFINITION_DOCS` order (the
|
|
8051
|
+
* author's primary declared prompt). An oversize FALLBACK doc is treated
|
|
8052
|
+
* as absent instead (see that function's jsdoc), so this code is never
|
|
8053
|
+
* raised for `AGENTS.md` while `CLAUDE.md` is present.
|
|
8054
|
+
*/
|
|
8055
|
+
"FILE_AGENT_DEFINITION_DOC_OVERSIZE",
|
|
8010
8056
|
/**
|
|
8011
8057
|
* `modelService` is declared but the caller supplied no resolved
|
|
8012
8058
|
* `llmProviderRef` id (or supplied one without a declaration). The converter
|
|
@@ -8025,7 +8071,7 @@ var FileAgentErrorCodeSchema = import_zod64.z.enum([
|
|
|
8025
8071
|
/** Converted output failed `RevisionManifestSchema` — a pipeline-context input is invalid (e.g. a non-endorsed package URL). */
|
|
8026
8072
|
"FILE_AGENT_REVISION_INVALID"
|
|
8027
8073
|
]);
|
|
8028
|
-
var BindProjectRepoRequestSchema =
|
|
8074
|
+
var BindProjectRepoRequestSchema = import_zod66.z.object({
|
|
8029
8075
|
/**
|
|
8030
8076
|
* Project uuid — the ONLY form accepted (#1635). Slugs used to be
|
|
8031
8077
|
* resolved here (exact `slug` column, then derived-from-`name` fallback
|
|
@@ -8034,8 +8080,8 @@ var BindProjectRepoRequestSchema = import_zod65.z.object({
|
|
|
8034
8080
|
* scan was a full-table fallback with no ordering. Identity is uuid-only;
|
|
8035
8081
|
* slugs are display-only and never resolve.
|
|
8036
8082
|
*/
|
|
8037
|
-
project:
|
|
8038
|
-
repoUrl:
|
|
8083
|
+
project: import_zod66.z.string().uuid(),
|
|
8084
|
+
repoUrl: import_zod66.z.string().min(1).max(1024),
|
|
8039
8085
|
/**
|
|
8040
8086
|
* Repoint a project that already names a DIFFERENT repo.
|
|
8041
8087
|
*
|
|
@@ -8044,53 +8090,53 @@ var BindProjectRepoRequestSchema = import_zod65.z.object({
|
|
|
8044
8090
|
* next release publish agent definitions from another repository, under
|
|
8045
8091
|
* the same project, with no visible signal.
|
|
8046
8092
|
*/
|
|
8047
|
-
allowRebind:
|
|
8093
|
+
allowRebind: import_zod66.z.boolean().optional()
|
|
8048
8094
|
}).strict();
|
|
8049
|
-
var BindProjectRepoResponseSchema =
|
|
8050
|
-
|
|
8095
|
+
var BindProjectRepoResponseSchema = import_zod66.z.discriminatedUnion("outcome", [
|
|
8096
|
+
import_zod66.z.object({ outcome: import_zod66.z.literal("bound"), projectId: import_zod66.z.string().uuid(), repoUrl: import_zod66.z.string() }).strict(),
|
|
8051
8097
|
/** Idempotent re-run: already bound to this repo, nothing written. */
|
|
8052
|
-
|
|
8098
|
+
import_zod66.z.object({ outcome: import_zod66.z.literal("unchanged"), projectId: import_zod66.z.string().uuid(), repoUrl: import_zod66.z.string() }).strict()
|
|
8053
8099
|
]);
|
|
8054
|
-
var FileAgentRefKindSchema =
|
|
8055
|
-
var CheckFileAgentRefsQuerySchema =
|
|
8056
|
-
projectId:
|
|
8057
|
-
environment:
|
|
8058
|
-
modelService:
|
|
8100
|
+
var FileAgentRefKindSchema = import_zod66.z.enum(["environment", "modelService", "managedMcp"]);
|
|
8101
|
+
var CheckFileAgentRefsQuerySchema = import_zod66.z.object({
|
|
8102
|
+
projectId: import_zod66.z.string().uuid(),
|
|
8103
|
+
environment: import_zod66.z.string().min(1).max(200).optional(),
|
|
8104
|
+
modelService: import_zod66.z.string().min(1).max(200).optional(),
|
|
8059
8105
|
/**
|
|
8060
8106
|
* `agent.yaml` `mcpServers:` —— 托管 MCP id(`vcrd_*`),已经是 id 而不是名字,
|
|
8061
8107
|
* 所以这里问的是「它在这个项目里存在吗」。上限对齐 `mcpServers` 的列表上限。
|
|
8062
8108
|
*/
|
|
8063
|
-
managedMcpIds:
|
|
8109
|
+
managedMcpIds: import_zod66.z.array(ManagedMcpIdSchema).max(64).optional()
|
|
8064
8110
|
}).strict();
|
|
8065
|
-
var FileAgentRefProblemSchema =
|
|
8111
|
+
var FileAgentRefProblemSchema = import_zod66.z.object({
|
|
8066
8112
|
kind: FileAgentRefKindSchema,
|
|
8067
|
-
name:
|
|
8113
|
+
name: import_zod66.z.string(),
|
|
8068
8114
|
/** Existing names in the project, for a "did you mean" hint (server-capped). */
|
|
8069
|
-
available:
|
|
8115
|
+
available: import_zod66.z.array(import_zod66.z.string())
|
|
8070
8116
|
}).strict();
|
|
8071
|
-
var CheckFileAgentRefsResponseSchema =
|
|
8072
|
-
environmentId:
|
|
8073
|
-
llmProviderRef:
|
|
8117
|
+
var CheckFileAgentRefsResponseSchema = import_zod66.z.object({
|
|
8118
|
+
environmentId: import_zod66.z.string().optional(),
|
|
8119
|
+
llmProviderRef: import_zod66.z.string().optional(),
|
|
8074
8120
|
/** 解析到的 `managedMcpId → 展示名`(发布侧要把名字冻进快照;check 只看 problems)。 */
|
|
8075
|
-
managedMcpDisplayNames:
|
|
8076
|
-
problems:
|
|
8121
|
+
managedMcpDisplayNames: import_zod66.z.record(import_zod66.z.string(), import_zod66.z.string()).optional(),
|
|
8122
|
+
problems: import_zod66.z.array(FileAgentRefProblemSchema)
|
|
8077
8123
|
}).strict();
|
|
8078
|
-
var IssueMcpDevTicketRequestSchema =
|
|
8079
|
-
projectId:
|
|
8124
|
+
var IssueMcpDevTicketRequestSchema = import_zod67.z.object({
|
|
8125
|
+
projectId: import_zod67.z.string().uuid(),
|
|
8080
8126
|
/**
|
|
8081
8127
|
* 人可读的用途标记(典型值:`<agent slug>@<主机名>`)。只为审计与自助排查
|
|
8082
8128
|
* ("我还有几张票在外面"),不参与鉴权。
|
|
8083
8129
|
*/
|
|
8084
|
-
label:
|
|
8130
|
+
label: import_zod67.z.string().min(1).max(200).optional(),
|
|
8085
8131
|
/** 省略 = 服务端默认(一个开发日)。服务端另有 24h 上限。 */
|
|
8086
|
-
ttlSeconds:
|
|
8132
|
+
ttlSeconds: import_zod67.z.number().int().positive().max(24 * 60 * 60).optional()
|
|
8087
8133
|
}).strict();
|
|
8088
|
-
var McpDevTicketTargetSchema =
|
|
8134
|
+
var McpDevTicketTargetSchema = import_zod67.z.object({
|
|
8089
8135
|
managedMcpId: ManagedMcpIdSchema,
|
|
8090
8136
|
/** 展示名 —— 给人看的(提示、报错)。**不是** `.mcp.json` 的键。 */
|
|
8091
|
-
displayName:
|
|
8137
|
+
displayName: import_zod67.z.string(),
|
|
8092
8138
|
/** 真实上游 URL。作为 `X-Pilot-MCP-Target` 头传给 gateway(**不是**凭据)。 */
|
|
8093
|
-
mcpServerUrl:
|
|
8139
|
+
mcpServerUrl: import_zod67.z.string(),
|
|
8094
8140
|
/**
|
|
8095
8141
|
* `.mcp.json` 的**键名**,平台侧创建期定死(`pilot_v2_vault_credentials.
|
|
8096
8142
|
* server_key`)。CLI 必须用它,不许从 `displayName` 现造:LLM 看到的工具名是
|
|
@@ -8105,37 +8151,37 @@ var McpDevTicketTargetSchema = import_zod66.z.object({
|
|
|
8105
8151
|
* 版本 skew 面(老服务端可能回 null → 新 SDK parse 抛错),而收益只是类型更
|
|
8106
8152
|
* 诚实。CLI 侧不该再有 null 分支——那个分支正是这条修复要消灭的东西。
|
|
8107
8153
|
*/
|
|
8108
|
-
serverKey:
|
|
8154
|
+
serverKey: import_zod67.z.string().nullable()
|
|
8109
8155
|
}).strict();
|
|
8110
|
-
var McpDevTicketStdioTargetSchema =
|
|
8156
|
+
var McpDevTicketStdioTargetSchema = import_zod67.z.object({
|
|
8111
8157
|
managedMcpId: ManagedMcpIdSchema,
|
|
8112
8158
|
/**
|
|
8113
8159
|
* `.mcp.json` 的键名。与 remote 的 `serverKey` 在**同一个命名空间**里分配:
|
|
8114
8160
|
* `.mcp.json` 是一张表,stdio 与 remote 的键撞了就是互相覆盖(沙箱冻结侧同
|
|
8115
8161
|
* 此约束,见 `vault-snapshot-freezer`)。
|
|
8116
8162
|
*/
|
|
8117
|
-
serverKey:
|
|
8163
|
+
serverKey: import_zod67.z.string().min(1).max(200),
|
|
8118
8164
|
/** 展示名 —— 给人看的。**不是**键。 */
|
|
8119
|
-
displayName:
|
|
8120
|
-
command:
|
|
8121
|
-
args:
|
|
8165
|
+
displayName: import_zod67.z.string(),
|
|
8166
|
+
command: import_zod67.z.string().min(1).max(500),
|
|
8167
|
+
args: import_zod67.z.array(import_zod67.z.string().max(500)).max(64).optional(),
|
|
8122
8168
|
/** 变量名 → 已渲染的值(`${MCP_...}` 占位符或字面量)。**绝不含明文凭据。** */
|
|
8123
|
-
env:
|
|
8169
|
+
env: import_zod67.z.record(import_zod67.z.string(), import_zod67.z.string()).optional()
|
|
8124
8170
|
}).strict();
|
|
8125
|
-
var IssueMcpDevTicketResponseSchema =
|
|
8171
|
+
var IssueMcpDevTicketResponseSchema = import_zod67.z.object({
|
|
8126
8172
|
/**
|
|
8127
8173
|
* 写进 `.mcp.json` 的 `Authorization: Bearer <token>`。
|
|
8128
8174
|
* **只在这一次响应里出现**,服务端不留明文。
|
|
8129
8175
|
*/
|
|
8130
|
-
token:
|
|
8176
|
+
token: import_zod67.z.string(),
|
|
8131
8177
|
/** 票据的 public id —— 撤销时用它。 */
|
|
8132
|
-
ticketId:
|
|
8178
|
+
ticketId: import_zod67.z.string(),
|
|
8133
8179
|
/** ISO 时间串。 */
|
|
8134
|
-
expiresAt:
|
|
8180
|
+
expiresAt: import_zod67.z.string(),
|
|
8135
8181
|
/** gateway URL(CLI 不该自己猜环境)。 */
|
|
8136
|
-
gatewayUrl:
|
|
8182
|
+
gatewayUrl: import_zod67.z.string(),
|
|
8137
8183
|
/** `remote` 形态 —— 经 gateway 代理,白名单即 `allowedMcpTargets`。 */
|
|
8138
|
-
targets:
|
|
8184
|
+
targets: import_zod67.z.array(McpDevTicketTargetSchema),
|
|
8139
8185
|
/**
|
|
8140
8186
|
* `stdio` 形态 —— 本机子进程,不经 gateway、不进白名单。上限与
|
|
8141
8187
|
* `FrozenStdioMcpListSchema` 对齐(64),两侧同一个上限才不会出现
|
|
@@ -8150,20 +8196,20 @@ var IssueMcpDevTicketResponseSchema = import_zod66.z.object({
|
|
|
8150
8196
|
* 注意输出类型仍是**非可选数组**(`z.infer` 取的是 default 之后的形态),所以
|
|
8151
8197
|
* 消费方不需要写 `?? []` 分支。
|
|
8152
8198
|
*/
|
|
8153
|
-
stdioTargets:
|
|
8199
|
+
stdioTargets: import_zod67.z.array(McpDevTicketStdioTargetSchema).max(64).default([])
|
|
8154
8200
|
}).strict();
|
|
8155
|
-
var RevokeMcpDevTicketResponseSchema =
|
|
8201
|
+
var RevokeMcpDevTicketResponseSchema = import_zod67.z.object({
|
|
8156
8202
|
/** `false` = 本来就不活跃(已撤销/不存在)。撤销是幂等的,两种都算成功。 */
|
|
8157
|
-
revoked:
|
|
8203
|
+
revoked: import_zod67.z.boolean()
|
|
8158
8204
|
}).strict();
|
|
8159
|
-
var DevSecretEnvKeySchema =
|
|
8160
|
-
var ResolveMcpDevSecretsRequestSchema =
|
|
8161
|
-
projectId:
|
|
8205
|
+
var DevSecretEnvKeySchema = import_zod68.z.string().min(1).max(100).regex(/^[A-Z_][A-Z0-9_]*$/, "env key must match ^[A-Z_][A-Z0-9_]*$");
|
|
8206
|
+
var ResolveMcpDevSecretsRequestSchema = import_zod68.z.object({
|
|
8207
|
+
projectId: import_zod68.z.string().uuid(),
|
|
8162
8208
|
/**
|
|
8163
8209
|
* 这个 agent 声明的托管 MCP id。服务端据此推导要解哪些 `sec_*` ——
|
|
8164
8210
|
* 只有 `stdio` 形态有凭据要下发(`remote` 走 gateway,明文不出平台)。
|
|
8165
8211
|
*/
|
|
8166
|
-
managedMcpIds:
|
|
8212
|
+
managedMcpIds: import_zod68.z.array(ManagedMcpIdSchema).max(64).optional(),
|
|
8167
8213
|
/**
|
|
8168
8214
|
* `agent.yaml` 的 `env:` 里指向 secret 的条目:`envKey → sec_*`。
|
|
8169
8215
|
*
|
|
@@ -8172,16 +8218,16 @@ var ResolveMcpDevSecretsRequestSchema = import_zod67.z.object({
|
|
|
8172
8218
|
* `secrets:resolve` 的调用方本来就被授权读本项目任意 secret,所以这不扩大权限;
|
|
8173
8219
|
* 上限在这里是为了让一次请求不能变成"把整个项目扫一遍"的批量导出工具。
|
|
8174
8220
|
*/
|
|
8175
|
-
envSecretRefs:
|
|
8221
|
+
envSecretRefs: import_zod68.z.record(DevSecretEnvKeySchema, SecretPublicIdSchema).refine((refs) => Object.keys(refs).length <= 64, {
|
|
8176
8222
|
message: "envSecretRefs must have at most 64 entries"
|
|
8177
8223
|
}).optional()
|
|
8178
8224
|
}).strict();
|
|
8179
|
-
var ResolveMcpDevSecretsResponseSchema =
|
|
8225
|
+
var ResolveMcpDevSecretsResponseSchema = import_zod68.z.object({
|
|
8180
8226
|
/**
|
|
8181
8227
|
* env 变量名 → **明文**。CLI 只把它放进子进程 env(`.mcp.json` 与 env 文件里
|
|
8182
8228
|
* 都只写 `${VAR}` 占位符),不落盘。
|
|
8183
8229
|
*/
|
|
8184
|
-
values:
|
|
8230
|
+
values: import_zod68.z.record(DevSecretEnvKeySchema, import_zod68.z.string()),
|
|
8185
8231
|
/**
|
|
8186
8232
|
* 声明了但解不出来的 env key(不存在 / 已归档 / 不属于本项目)。
|
|
8187
8233
|
*
|
|
@@ -8189,7 +8235,7 @@ var ResolveMcpDevSecretsResponseSchema = import_zod67.z.object({
|
|
|
8189
8235
|
* `${VAR}` 字面量原样传给 MCP server,于是上游报"token 无效",排查方向被带到
|
|
8190
8236
|
* 上游去,而真实原因是这里少了一个值。
|
|
8191
8237
|
*/
|
|
8192
|
-
missing:
|
|
8238
|
+
missing: import_zod68.z.array(import_zod68.z.string())
|
|
8193
8239
|
}).strict();
|
|
8194
8240
|
var EVAL_SUITE_API_VERSION = "agenthub/v1alpha1";
|
|
8195
8241
|
var EVAL_SUITE_KIND = "EvalSuite";
|
|
@@ -8199,7 +8245,7 @@ var EVAL_MAX_RETRIES = 2;
|
|
|
8199
8245
|
var EVAL_MAX_TURN_BYTES = 32 * 1024;
|
|
8200
8246
|
var EVAL_MAX_FIXTURE_FILE_BYTES = 64 * 1024;
|
|
8201
8247
|
var EVAL_MAX_FIXTURE_TOTAL_BYTES = 512 * 1024;
|
|
8202
|
-
var EvalRunStatusSchema =
|
|
8248
|
+
var EvalRunStatusSchema = import_zod69.z.enum([
|
|
8203
8249
|
"pending",
|
|
8204
8250
|
"running",
|
|
8205
8251
|
"passed",
|
|
@@ -8207,20 +8253,20 @@ var EvalRunStatusSchema = import_zod68.z.enum([
|
|
|
8207
8253
|
"errored",
|
|
8208
8254
|
"cancelled"
|
|
8209
8255
|
]);
|
|
8210
|
-
var EvalCaseVerdictSchema =
|
|
8211
|
-
var EvalGraderStatusSchema =
|
|
8212
|
-
var EvalErrorClassSchema =
|
|
8256
|
+
var EvalCaseVerdictSchema = import_zod69.z.enum(["passed", "failed", "errored"]);
|
|
8257
|
+
var EvalGraderStatusSchema = import_zod69.z.enum(["passed", "failed", "errored", "skipped"]);
|
|
8258
|
+
var EvalErrorClassSchema = import_zod69.z.enum([
|
|
8213
8259
|
"capability_unavailable",
|
|
8214
8260
|
"infrastructure_error",
|
|
8215
8261
|
"indeterminate",
|
|
8216
8262
|
"invalid_definition"
|
|
8217
8263
|
]);
|
|
8218
|
-
var EvalErrorCodeSchema =
|
|
8264
|
+
var EvalErrorCodeSchema = import_zod69.z.enum([
|
|
8219
8265
|
"EVAL_GRADER_CAPABILITY_UNAVAILABLE",
|
|
8220
8266
|
"EVAL_SELF_EVAL_FORBIDDEN"
|
|
8221
8267
|
]);
|
|
8222
8268
|
var EVAL_SCRIPT_STDOUT_TAIL_MAX_BYTES = 64 * 1024;
|
|
8223
|
-
var EvalTriggerSchema =
|
|
8269
|
+
var EvalTriggerSchema = import_zod69.z.enum([
|
|
8224
8270
|
"manual",
|
|
8225
8271
|
"promote_gate",
|
|
8226
8272
|
"cli",
|
|
@@ -8230,123 +8276,135 @@ var EvalTriggerSchema = import_zod68.z.enum([
|
|
|
8230
8276
|
"replay",
|
|
8231
8277
|
"pipeline"
|
|
8232
8278
|
]);
|
|
8233
|
-
var EvalSeveritySchema =
|
|
8234
|
-
var EvalGraderTypeSchema =
|
|
8235
|
-
var EvalPassPolicySchema =
|
|
8236
|
-
var EvalSuitePurposeSchema =
|
|
8279
|
+
var EvalSeveritySchema = import_zod69.z.enum(["gate", "soft"]);
|
|
8280
|
+
var EvalGraderTypeSchema = import_zod69.z.enum(["transcript", "file", "llm", "script"]);
|
|
8281
|
+
var EvalPassPolicySchema = import_zod69.z.enum(["all", "any"]);
|
|
8282
|
+
var EvalSuitePurposeSchema = import_zod69.z.enum(["regression", "capability"]);
|
|
8237
8283
|
var EVAL_SKIP_REASON_MAX = 2048;
|
|
8238
|
-
var EvalSuiteSkipSchema =
|
|
8239
|
-
var EvalSkippedSuiteSchema =
|
|
8240
|
-
var EvalConclusionStatusSchema =
|
|
8284
|
+
var EvalSuiteSkipSchema = import_zod69.z.object({ reason: import_zod69.z.string().min(1).max(EVAL_SKIP_REASON_MAX) }).strict();
|
|
8285
|
+
var EvalSkippedSuiteSchema = import_zod69.z.object({ path: import_zod69.z.string().min(1), reason: import_zod69.z.string().min(1) }).strict();
|
|
8286
|
+
var EvalConclusionStatusSchema = import_zod69.z.enum(["passed", "failed", "errored", "unassessed"]);
|
|
8241
8287
|
var isSafeRelativePath = (p) => !p.startsWith("/") && !p.split("/").includes("..") && !p.split("/").includes(".");
|
|
8242
|
-
var EvalRelativePathSchema =
|
|
8288
|
+
var EvalRelativePathSchema = import_zod69.z.string().min(1).max(255).refine(isSafeRelativePath, {
|
|
8243
8289
|
message: "path must be a relative path without '.' or '..' segments"
|
|
8244
8290
|
});
|
|
8245
|
-
var EvalSlugSchema =
|
|
8291
|
+
var EvalSlugSchema = import_zod69.z.string().regex(/^[a-z0-9-]{1,64}$/, {
|
|
8246
8292
|
message: "must be a slug matching [a-z0-9-]{1,64}"
|
|
8247
8293
|
});
|
|
8248
|
-
var EvalTimesExprSchema =
|
|
8294
|
+
var EvalTimesExprSchema = import_zod69.z.string().regex(/^(>=|<=|=|>|<)?\d+$/, {
|
|
8249
8295
|
message: 'times must match an operator + integer, e.g. ">=1", "=3", "2"'
|
|
8250
8296
|
});
|
|
8251
|
-
var EvalMarkerSchema =
|
|
8252
|
-
evalRunId:
|
|
8297
|
+
var EvalMarkerSchema = import_zod69.z.object({
|
|
8298
|
+
evalRunId: import_zod69.z.string().min(1),
|
|
8253
8299
|
caseId: EvalSlugSchema,
|
|
8254
|
-
trial:
|
|
8255
|
-
}).strict();
|
|
8256
|
-
var EvalPatternRulesSchema =
|
|
8257
|
-
required:
|
|
8258
|
-
forbidden:
|
|
8259
|
-
}).strict();
|
|
8260
|
-
var EvalTranscriptExpectSchema =
|
|
8261
|
-
completed:
|
|
8262
|
-
calledTool:
|
|
8263
|
-
toolOrder:
|
|
8264
|
-
forbiddenTools:
|
|
8265
|
-
calledSubagent:
|
|
8266
|
-
usedNoTools:
|
|
8267
|
-
loadedSkill:
|
|
8268
|
-
maxToolCalls:
|
|
8300
|
+
trial: import_zod69.z.number().int().nonnegative()
|
|
8301
|
+
}).strict();
|
|
8302
|
+
var EvalPatternRulesSchema = import_zod69.z.object({
|
|
8303
|
+
required: import_zod69.z.array(import_zod69.z.string()).optional(),
|
|
8304
|
+
forbidden: import_zod69.z.array(import_zod69.z.string()).optional()
|
|
8305
|
+
}).strict();
|
|
8306
|
+
var EvalTranscriptExpectSchema = import_zod69.z.object({
|
|
8307
|
+
completed: import_zod69.z.boolean().optional(),
|
|
8308
|
+
calledTool: import_zod69.z.object({ name: import_zod69.z.string().min(1), times: EvalTimesExprSchema.optional() }).strict().optional(),
|
|
8309
|
+
toolOrder: import_zod69.z.array(import_zod69.z.string().min(1)).optional(),
|
|
8310
|
+
forbiddenTools: import_zod69.z.array(import_zod69.z.string().min(1)).optional(),
|
|
8311
|
+
calledSubagent: import_zod69.z.object({ name: import_zod69.z.string().min(1).optional(), times: EvalTimesExprSchema.optional() }).strict().optional(),
|
|
8312
|
+
usedNoTools: import_zod69.z.boolean().optional(),
|
|
8313
|
+
loadedSkill: import_zod69.z.string().min(1).optional(),
|
|
8314
|
+
maxToolCalls: import_zod69.z.number().int().positive().optional(),
|
|
8269
8315
|
commandPatterns: EvalPatternRulesSchema.optional(),
|
|
8270
8316
|
toolInputPatterns: EvalPatternRulesSchema.optional()
|
|
8271
8317
|
}).strict();
|
|
8272
|
-
var EvalTranscriptGraderSchema =
|
|
8273
|
-
type:
|
|
8318
|
+
var EvalTranscriptGraderSchema = import_zod69.z.object({
|
|
8319
|
+
type: import_zod69.z.literal("transcript"),
|
|
8274
8320
|
label: EvalSlugSchema.optional(),
|
|
8275
8321
|
severity: EvalSeveritySchema.optional(),
|
|
8276
8322
|
// 缺省 gate
|
|
8277
|
-
online:
|
|
8323
|
+
online: import_zod69.z.boolean().optional(),
|
|
8324
|
+
/**
|
|
8325
|
+
* T2 真·多轮:只对第 `turn` 轮(0-based,指向 `case.turns` 的下标)的轨迹
|
|
8326
|
+
* 断言——可以表达"第二轮才调用 run_sql"。缺省 = 整个 trial 的合并轨迹
|
|
8327
|
+
* (全部轮的工具按序拼接,终态取最后一轮)。executor 保证走到 grader 的
|
|
8328
|
+
* trial 中间轮恒为 completed(非末轮非 completed 直接整 trial 报 infra
|
|
8329
|
+
* 错,不会被末轮掩盖),所以缺省 grader 看到的末轮终态就是真实终态;
|
|
8330
|
+
* `turn` 的价值在**按轮收窄工具断言**,不再承担防掩盖职责。上界
|
|
8331
|
+
* (< turns.length)在 EvalSuiteSchema 的 superRefine 校验(需要 case 的
|
|
8332
|
+
* turns 上下文;单 parse 一个 grader 不带上界,越界到 gradeTranscript
|
|
8333
|
+
* 才 errored——已知取舍)。
|
|
8334
|
+
*/
|
|
8335
|
+
turn: import_zod69.z.number().int().min(0).optional(),
|
|
8278
8336
|
expect: EvalTranscriptExpectSchema
|
|
8279
8337
|
}).strict();
|
|
8280
|
-
var EvalFileEntrySchema =
|
|
8338
|
+
var EvalFileEntrySchema = import_zod69.z.object({
|
|
8281
8339
|
path: EvalRelativePathSchema,
|
|
8282
|
-
mustMatch:
|
|
8283
|
-
mustNotMatch:
|
|
8340
|
+
mustMatch: import_zod69.z.array(import_zod69.z.string()).optional(),
|
|
8341
|
+
mustNotMatch: import_zod69.z.array(import_zod69.z.string()).optional()
|
|
8284
8342
|
}).strict();
|
|
8285
|
-
var EvalFileShorthandExpectSchema =
|
|
8286
|
-
includes:
|
|
8287
|
-
equals:
|
|
8288
|
-
matches:
|
|
8343
|
+
var EvalFileShorthandExpectSchema = import_zod69.z.object({
|
|
8344
|
+
includes: import_zod69.z.string().optional(),
|
|
8345
|
+
equals: import_zod69.z.string().optional(),
|
|
8346
|
+
matches: import_zod69.z.string().optional()
|
|
8289
8347
|
// 正则字符串
|
|
8290
8348
|
}).strict();
|
|
8291
|
-
var EvalFileGraderSchema =
|
|
8292
|
-
type:
|
|
8349
|
+
var EvalFileGraderSchema = import_zod69.z.object({
|
|
8350
|
+
type: import_zod69.z.literal("file"),
|
|
8293
8351
|
label: EvalSlugSchema.optional(),
|
|
8294
8352
|
severity: EvalSeveritySchema.optional(),
|
|
8295
8353
|
// 缺省 gate
|
|
8296
|
-
online:
|
|
8354
|
+
online: import_zod69.z.boolean().optional(),
|
|
8297
8355
|
// 多文件形式
|
|
8298
|
-
files:
|
|
8356
|
+
files: import_zod69.z.array(EvalFileEntrySchema).min(1).optional(),
|
|
8299
8357
|
// 简写形式
|
|
8300
8358
|
path: EvalRelativePathSchema.optional(),
|
|
8301
8359
|
expect: EvalFileShorthandExpectSchema.optional()
|
|
8302
8360
|
}).strict();
|
|
8303
|
-
var EvalLlmGraderSchema =
|
|
8304
|
-
type:
|
|
8361
|
+
var EvalLlmGraderSchema = import_zod69.z.object({
|
|
8362
|
+
type: import_zod69.z.literal("llm"),
|
|
8305
8363
|
label: EvalSlugSchema.optional(),
|
|
8306
8364
|
severity: EvalSeveritySchema.optional(),
|
|
8307
8365
|
// 缺省 soft
|
|
8308
|
-
online:
|
|
8366
|
+
online: import_zod69.z.boolean().optional(),
|
|
8309
8367
|
rubric: EvalRelativePathSchema.refine((p) => p.endsWith(".md"), {
|
|
8310
8368
|
message: "rubric must be a relative .md path within the suite"
|
|
8311
8369
|
}),
|
|
8312
|
-
dimensions:
|
|
8313
|
-
threshold:
|
|
8314
|
-
graderVersion:
|
|
8370
|
+
dimensions: import_zod69.z.array(import_zod69.z.string().min(1)).optional(),
|
|
8371
|
+
threshold: import_zod69.z.number().min(0).max(1),
|
|
8372
|
+
graderVersion: import_zod69.z.number().int().positive()
|
|
8315
8373
|
}).strict();
|
|
8316
|
-
var EvalScriptExpectSchema =
|
|
8317
|
-
exitCode:
|
|
8374
|
+
var EvalScriptExpectSchema = import_zod69.z.object({
|
|
8375
|
+
exitCode: import_zod69.z.number().int().optional(),
|
|
8318
8376
|
// 缺省 0
|
|
8319
|
-
stdoutIncludes:
|
|
8377
|
+
stdoutIncludes: import_zod69.z.array(import_zod69.z.string()).optional()
|
|
8320
8378
|
}).strict();
|
|
8321
|
-
var EvalScriptGraderSchema =
|
|
8322
|
-
type:
|
|
8379
|
+
var EvalScriptGraderSchema = import_zod69.z.object({
|
|
8380
|
+
type: import_zod69.z.literal("script"),
|
|
8323
8381
|
label: EvalSlugSchema.optional(),
|
|
8324
8382
|
severity: EvalSeveritySchema.optional(),
|
|
8325
8383
|
// 缺省 gate
|
|
8326
|
-
online:
|
|
8327
|
-
run:
|
|
8328
|
-
timeout:
|
|
8384
|
+
online: import_zod69.z.boolean().optional(),
|
|
8385
|
+
run: import_zod69.z.string().min(1),
|
|
8386
|
+
timeout: import_zod69.z.number().int().positive().max(EVAL_MAX_TIMEOUT_SECONDS).optional(),
|
|
8329
8387
|
expect: EvalScriptExpectSchema.optional()
|
|
8330
8388
|
}).strict();
|
|
8331
|
-
var EvalGraderSpecSchema =
|
|
8389
|
+
var EvalGraderSpecSchema = import_zod69.z.discriminatedUnion("type", [
|
|
8332
8390
|
EvalTranscriptGraderSchema,
|
|
8333
8391
|
EvalFileGraderSchema,
|
|
8334
8392
|
EvalLlmGraderSchema,
|
|
8335
8393
|
EvalScriptGraderSchema
|
|
8336
8394
|
]);
|
|
8337
|
-
var EvalFixtureWorkspaceSchema =
|
|
8338
|
-
repo:
|
|
8339
|
-
ref:
|
|
8395
|
+
var EvalFixtureWorkspaceSchema = import_zod69.z.object({
|
|
8396
|
+
repo: import_zod69.z.string().url(),
|
|
8397
|
+
ref: import_zod69.z.string().min(1)
|
|
8340
8398
|
}).strict();
|
|
8341
|
-
var EvalFixtureFileSchema =
|
|
8399
|
+
var EvalFixtureFileSchema = import_zod69.z.object({
|
|
8342
8400
|
path: EvalRelativePathSchema,
|
|
8343
|
-
content:
|
|
8401
|
+
content: import_zod69.z.string()
|
|
8344
8402
|
}).strict();
|
|
8345
|
-
var EvalFixturesSchema =
|
|
8403
|
+
var EvalFixturesSchema = import_zod69.z.object({
|
|
8346
8404
|
workspace: EvalFixtureWorkspaceSchema.optional(),
|
|
8347
|
-
files:
|
|
8405
|
+
files: import_zod69.z.array(EvalFixtureFileSchema).optional()
|
|
8348
8406
|
}).strict();
|
|
8349
|
-
var EvalAgentOverridesSchema =
|
|
8407
|
+
var EvalAgentOverridesSchema = import_zod69.z.object({
|
|
8350
8408
|
/**
|
|
8351
8409
|
* 覆盖被测 agent 的模型。**被测 model 是 case 级可变的**:最终生效值 =
|
|
8352
8410
|
* `agentOverrides.model ?? agent 默认 model`,故同一份卷不同 case 的被测
|
|
@@ -8359,33 +8417,51 @@ var EvalAgentOverridesSchema = import_zod68.z.object({
|
|
|
8359
8417
|
* 先经 ModelGate 归一为 canonical id 再比较——**需运行时上下文,故不在本零依赖
|
|
8360
8418
|
* 契约层做,留给 T3/T4 resolve 层的 400**。
|
|
8361
8419
|
*/
|
|
8362
|
-
model:
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8420
|
+
model: import_zod69.z.string().min(1).optional(),
|
|
8421
|
+
/**
|
|
8422
|
+
* T1 语义(减法白名单):把 revision 解析出的 skills **收窄**为名单内的
|
|
8423
|
+
* 子集(按 `EnabledSkill.rushSkillName` 匹配——即 agent skills.json 里写的
|
|
8424
|
+
* 名字)。`[]` = 全部禁用(合法的消融测试)。名单里的名字一个都匹配不上 →
|
|
8425
|
+
* 执行层 infrastructure error(fail-loud:拼错名字静默测了个没装 skill 的
|
|
8426
|
+
* agent,是假红灯)。**不能加塞** revision 未声明的 skill——eval 测的是
|
|
8427
|
+
* 「已发布的 agent」,不是「一个不存在的配置」。
|
|
8428
|
+
*/
|
|
8429
|
+
skills: import_zod69.z.array(import_zod69.z.string().min(1)).optional(),
|
|
8430
|
+
/**
|
|
8431
|
+
* T1 语义(减法白名单):把 revision 解析出的 mcpServers **收窄**为名单内
|
|
8432
|
+
* 的子集(按 runtime `.mcp.json` 的 server 键名匹配,即 agent 实际运行的
|
|
8433
|
+
* server 名)。匹配规则与 fail-loud 姿态同 `skills`。stdio transport 的
|
|
8434
|
+
* server 仍受 `allowStdioMcp` 总闸约束(默认不注入)。
|
|
8435
|
+
*/
|
|
8436
|
+
mcpServers: import_zod69.z.array(import_zod69.z.string().min(1)).optional(),
|
|
8437
|
+
/**
|
|
8438
|
+
* T1 语义:追加在被测 agent 冻结 systemPrompt 之后的指令块(`\n\n` 拼接),
|
|
8439
|
+
* 例如注入 case 特有的输出格式要求。不能替换(替换 = 测别的 agent)。
|
|
8440
|
+
*/
|
|
8441
|
+
systemPromptAppend: import_zod69.z.string().optional()
|
|
8366
8442
|
}).strict();
|
|
8367
|
-
var EvalCaseOriginSchema =
|
|
8368
|
-
sessionId:
|
|
8369
|
-
capturedAt:
|
|
8443
|
+
var EvalCaseOriginSchema = import_zod69.z.object({
|
|
8444
|
+
sessionId: import_zod69.z.string().min(1),
|
|
8445
|
+
capturedAt: import_zod69.z.string().min(1)
|
|
8370
8446
|
}).strict();
|
|
8371
|
-
var EvalCaseSchema =
|
|
8447
|
+
var EvalCaseSchema = import_zod69.z.object({
|
|
8372
8448
|
id: EvalSlugSchema,
|
|
8373
|
-
description:
|
|
8374
|
-
turns:
|
|
8449
|
+
description: import_zod69.z.string().optional(),
|
|
8450
|
+
turns: import_zod69.z.array(import_zod69.z.object({ user: import_zod69.z.string().min(1) }).strict()).min(1),
|
|
8375
8451
|
fixtures: EvalFixturesSchema.optional(),
|
|
8376
8452
|
agentOverrides: EvalAgentOverridesSchema.optional(),
|
|
8377
|
-
timeout:
|
|
8378
|
-
maxRetries:
|
|
8379
|
-
trials:
|
|
8453
|
+
timeout: import_zod69.z.number().int().positive().max(EVAL_MAX_TIMEOUT_SECONDS).optional(),
|
|
8454
|
+
maxRetries: import_zod69.z.number().int().min(0).max(EVAL_MAX_RETRIES).optional(),
|
|
8455
|
+
trials: import_zod69.z.number().int().min(1).max(EVAL_MAX_TRIALS).optional(),
|
|
8380
8456
|
// U1,默认 1
|
|
8381
8457
|
passPolicy: EvalPassPolicySchema.optional(),
|
|
8382
8458
|
// U1,缺省按 purpose
|
|
8383
8459
|
origin: EvalCaseOriginSchema.optional(),
|
|
8384
|
-
allowStdioMcp:
|
|
8460
|
+
allowStdioMcp: import_zod69.z.boolean().optional(),
|
|
8385
8461
|
// 默认 false(§2.1.1 副作用面)
|
|
8386
|
-
graders:
|
|
8462
|
+
graders: import_zod69.z.array(EvalGraderSpecSchema).min(1)
|
|
8387
8463
|
}).strict();
|
|
8388
|
-
var EvalSuiteDefaultsSchema =
|
|
8464
|
+
var EvalSuiteDefaultsSchema = import_zod69.z.object({
|
|
8389
8465
|
/**
|
|
8390
8466
|
* llm grader 的裁判模型。**仅 suite 级、不可 case/grader 级覆盖**(也不在
|
|
8391
8467
|
* `EvalAgentOverridesSchema` 白名单里)。
|
|
@@ -8407,27 +8483,27 @@ var EvalSuiteDefaultsSchema = import_zod68.z.object({
|
|
|
8407
8483
|
* 兑现留给 T7(llm grader 实现),届时大概率取当时最合适的 judge 且做成运行面
|
|
8408
8484
|
* 可配置,而非硬编码进契约。
|
|
8409
8485
|
*/
|
|
8410
|
-
judgeModel:
|
|
8411
|
-
timeout:
|
|
8412
|
-
maxConcurrency:
|
|
8486
|
+
judgeModel: import_zod69.z.string().min(1).optional(),
|
|
8487
|
+
timeout: import_zod69.z.number().int().positive().max(EVAL_MAX_TIMEOUT_SECONDS).optional(),
|
|
8488
|
+
maxConcurrency: import_zod69.z.number().int().positive().optional()
|
|
8413
8489
|
}).strict();
|
|
8414
8490
|
var byteLen = (s) => new TextEncoder().encode(s).length;
|
|
8415
|
-
var EvalSuiteSchema =
|
|
8416
|
-
apiVersion:
|
|
8417
|
-
kind:
|
|
8491
|
+
var EvalSuiteSchema = import_zod69.z.object({
|
|
8492
|
+
apiVersion: import_zod69.z.literal(EVAL_SUITE_API_VERSION),
|
|
8493
|
+
kind: import_zod69.z.literal(EVAL_SUITE_KIND),
|
|
8418
8494
|
purpose: EvalSuitePurposeSchema.optional(),
|
|
8419
8495
|
// U2,默认 regression
|
|
8420
8496
|
skip: EvalSuiteSkipSchema.optional(),
|
|
8421
8497
|
// §4 声明跳过(带必填理由)
|
|
8422
8498
|
defaults: EvalSuiteDefaultsSchema.optional(),
|
|
8423
|
-
cases:
|
|
8499
|
+
cases: import_zod69.z.array(EvalCaseSchema).min(1)
|
|
8424
8500
|
}).strict().superRefine((suite, ctx) => {
|
|
8425
8501
|
const seen = /* @__PURE__ */ new Set();
|
|
8426
8502
|
suite.cases.forEach((c, ci) => {
|
|
8427
8503
|
var _a, _b;
|
|
8428
8504
|
if (seen.has(c.id)) {
|
|
8429
8505
|
ctx.addIssue({
|
|
8430
|
-
code:
|
|
8506
|
+
code: import_zod69.z.ZodIssueCode.custom,
|
|
8431
8507
|
path: ["cases", ci, "id"],
|
|
8432
8508
|
message: `duplicate case id "${c.id}" (must be unique within suite)`
|
|
8433
8509
|
});
|
|
@@ -8436,7 +8512,7 @@ var EvalSuiteSchema = import_zod68.z.object({
|
|
|
8436
8512
|
c.turns.forEach((t, ti) => {
|
|
8437
8513
|
if (byteLen(t.user) > EVAL_MAX_TURN_BYTES) {
|
|
8438
8514
|
ctx.addIssue({
|
|
8439
|
-
code:
|
|
8515
|
+
code: import_zod69.z.ZodIssueCode.custom,
|
|
8440
8516
|
path: ["cases", ci, "turns", ti, "user"],
|
|
8441
8517
|
message: `turn exceeds ${EVAL_MAX_TURN_BYTES} bytes`
|
|
8442
8518
|
});
|
|
@@ -8448,7 +8524,7 @@ var EvalSuiteSchema = import_zod68.z.object({
|
|
|
8448
8524
|
fixtureTotal += size;
|
|
8449
8525
|
if (size > EVAL_MAX_FIXTURE_FILE_BYTES) {
|
|
8450
8526
|
ctx.addIssue({
|
|
8451
|
-
code:
|
|
8527
|
+
code: import_zod69.z.ZodIssueCode.custom,
|
|
8452
8528
|
path: ["cases", ci, "fixtures", "files", fi, "content"],
|
|
8453
8529
|
message: `fixture file exceeds ${EVAL_MAX_FIXTURE_FILE_BYTES} bytes`
|
|
8454
8530
|
});
|
|
@@ -8456,7 +8532,7 @@ var EvalSuiteSchema = import_zod68.z.object({
|
|
|
8456
8532
|
});
|
|
8457
8533
|
if (fixtureTotal > EVAL_MAX_FIXTURE_TOTAL_BYTES) {
|
|
8458
8534
|
ctx.addIssue({
|
|
8459
|
-
code:
|
|
8535
|
+
code: import_zod69.z.ZodIssueCode.custom,
|
|
8460
8536
|
path: ["cases", ci, "fixtures", "files"],
|
|
8461
8537
|
message: `fixture files total exceeds ${EVAL_MAX_FIXTURE_TOTAL_BYTES} bytes`
|
|
8462
8538
|
});
|
|
@@ -8467,99 +8543,106 @@ var EvalSuiteSchema = import_zod68.z.object({
|
|
|
8467
8543
|
const hasShorthand = g.path != null && g.expect != null;
|
|
8468
8544
|
if (hasFiles === hasShorthand) {
|
|
8469
8545
|
ctx.addIssue({
|
|
8470
|
-
code:
|
|
8546
|
+
code: import_zod69.z.ZodIssueCode.custom,
|
|
8471
8547
|
path: ["cases", ci, "graders", gi],
|
|
8472
8548
|
message: "file grader must use either `files[]` or `{path, expect}`, not both/neither"
|
|
8473
8549
|
});
|
|
8474
8550
|
}
|
|
8475
8551
|
}
|
|
8552
|
+
if (g.type === "transcript" && g.turn != null && g.turn >= c.turns.length) {
|
|
8553
|
+
ctx.addIssue({
|
|
8554
|
+
code: import_zod69.z.ZodIssueCode.custom,
|
|
8555
|
+
path: ["cases", ci, "graders", gi, "turn"],
|
|
8556
|
+
message: `transcript grader turn=${g.turn} is out of range (case has ${c.turns.length} turn(s); 0-based)`
|
|
8557
|
+
});
|
|
8558
|
+
}
|
|
8476
8559
|
});
|
|
8477
8560
|
});
|
|
8478
8561
|
});
|
|
8479
|
-
var ScriptEvidenceSchema =
|
|
8480
|
-
|
|
8481
|
-
kind:
|
|
8562
|
+
var ScriptEvidenceSchema = import_zod69.z.discriminatedUnion("kind", [
|
|
8563
|
+
import_zod69.z.object({
|
|
8564
|
+
kind: import_zod69.z.literal("executed"),
|
|
8482
8565
|
// A1
|
|
8483
|
-
exitCode:
|
|
8484
|
-
stdoutTailRef:
|
|
8566
|
+
exitCode: import_zod69.z.number().int(),
|
|
8567
|
+
stdoutTailRef: import_zod69.z.string().optional(),
|
|
8485
8568
|
// 超限内容走 OSS ref
|
|
8486
|
-
durationMs:
|
|
8569
|
+
durationMs: import_zod69.z.number().int().nonnegative()
|
|
8487
8570
|
}).strict(),
|
|
8488
|
-
|
|
8489
|
-
kind:
|
|
8571
|
+
import_zod69.z.object({
|
|
8572
|
+
kind: import_zod69.z.literal("capability_unavailable"),
|
|
8490
8573
|
// A0
|
|
8491
|
-
capability:
|
|
8492
|
-
phase:
|
|
8574
|
+
capability: import_zod69.z.literal("script_grader"),
|
|
8575
|
+
phase: import_zod69.z.literal("A0")
|
|
8493
8576
|
}).strict()
|
|
8494
8577
|
]);
|
|
8495
|
-
var EvalGraderEvidenceSchema =
|
|
8496
|
-
|
|
8497
|
-
type:
|
|
8498
|
-
matchedEventIds:
|
|
8499
|
-
violatedCheck:
|
|
8578
|
+
var EvalGraderEvidenceSchema = import_zod69.z.discriminatedUnion("type", [
|
|
8579
|
+
import_zod69.z.object({
|
|
8580
|
+
type: import_zod69.z.literal("transcript"),
|
|
8581
|
+
matchedEventIds: import_zod69.z.array(import_zod69.z.string()).optional(),
|
|
8582
|
+
violatedCheck: import_zod69.z.string().optional()
|
|
8500
8583
|
}).strict(),
|
|
8501
|
-
|
|
8502
|
-
type:
|
|
8503
|
-
path:
|
|
8504
|
-
excerpt:
|
|
8584
|
+
import_zod69.z.object({
|
|
8585
|
+
type: import_zod69.z.literal("file"),
|
|
8586
|
+
path: import_zod69.z.string(),
|
|
8587
|
+
excerpt: import_zod69.z.string().max(2048).optional()
|
|
8505
8588
|
// ≤2KB
|
|
8506
8589
|
}).strict(),
|
|
8507
|
-
|
|
8508
|
-
type:
|
|
8509
|
-
judgeModel:
|
|
8510
|
-
rubricSha:
|
|
8590
|
+
import_zod69.z.object({
|
|
8591
|
+
type: import_zod69.z.literal("llm"),
|
|
8592
|
+
judgeModel: import_zod69.z.string(),
|
|
8593
|
+
rubricSha: import_zod69.z.string(),
|
|
8511
8594
|
// U5:离散档位 + 锚点文本(不是换算后小数)
|
|
8512
|
-
dimensionScores:
|
|
8513
|
-
judgeOutputRef:
|
|
8595
|
+
dimensionScores: import_zod69.z.record(import_zod69.z.string(), import_zod69.z.unknown()).optional(),
|
|
8596
|
+
judgeOutputRef: import_zod69.z.string().optional()
|
|
8514
8597
|
// judge 原始输出 OSS ref
|
|
8515
8598
|
}).strict(),
|
|
8516
|
-
|
|
8599
|
+
import_zod69.z.object({ type: import_zod69.z.literal("script"), evidence: ScriptEvidenceSchema }).strict()
|
|
8517
8600
|
]);
|
|
8518
|
-
var GraderVerdictSchema =
|
|
8519
|
-
graderIndex:
|
|
8520
|
-
graderKey:
|
|
8601
|
+
var GraderVerdictSchema = import_zod69.z.object({
|
|
8602
|
+
graderIndex: import_zod69.z.number().int().nonnegative(),
|
|
8603
|
+
graderKey: import_zod69.z.string(),
|
|
8521
8604
|
type: EvalGraderTypeSchema,
|
|
8522
8605
|
severity: EvalSeveritySchema,
|
|
8523
8606
|
// resolve 后终值
|
|
8524
|
-
label:
|
|
8607
|
+
label: import_zod69.z.string().optional(),
|
|
8525
8608
|
status: EvalGraderStatusSchema,
|
|
8526
8609
|
errorClass: EvalErrorClassSchema.optional(),
|
|
8527
8610
|
// status=errored 时
|
|
8528
8611
|
errorCode: EvalErrorCodeSchema.optional(),
|
|
8529
8612
|
// status=errored 时
|
|
8530
|
-
score:
|
|
8613
|
+
score: import_zod69.z.number().nullable(),
|
|
8531
8614
|
// llm=0~1;二值 grader=null
|
|
8532
|
-
threshold:
|
|
8533
|
-
reason:
|
|
8615
|
+
threshold: import_zod69.z.number().optional(),
|
|
8616
|
+
reason: import_zod69.z.string(),
|
|
8534
8617
|
evidence: EvalGraderEvidenceSchema.optional(),
|
|
8535
|
-
graderVersion:
|
|
8536
|
-
engineVersion:
|
|
8618
|
+
graderVersion: import_zod69.z.number().int().optional(),
|
|
8619
|
+
engineVersion: import_zod69.z.string(),
|
|
8537
8620
|
// 平台 grader 实现版本,基线口径用
|
|
8538
|
-
durationMs:
|
|
8621
|
+
durationMs: import_zod69.z.number().int().nonnegative().optional()
|
|
8539
8622
|
}).strict();
|
|
8540
|
-
var EvalCaseResultSchema =
|
|
8541
|
-
caseId:
|
|
8542
|
-
trial:
|
|
8623
|
+
var EvalCaseResultSchema = import_zod69.z.object({
|
|
8624
|
+
caseId: import_zod69.z.string(),
|
|
8625
|
+
trial: import_zod69.z.number().int().nonnegative(),
|
|
8543
8626
|
// U1,online_sample 恒 0
|
|
8544
|
-
attempt:
|
|
8627
|
+
attempt: import_zod69.z.number().int().nonnegative(),
|
|
8545
8628
|
// 基础设施重试序
|
|
8546
|
-
sessionId:
|
|
8629
|
+
sessionId: import_zod69.z.string().optional(),
|
|
8547
8630
|
verdict: EvalCaseVerdictSchema,
|
|
8548
|
-
caseDefinitionDigest:
|
|
8631
|
+
caseDefinitionDigest: import_zod69.z.string(),
|
|
8549
8632
|
errorClass: EvalErrorClassSchema.optional(),
|
|
8550
8633
|
errorCode: EvalErrorCodeSchema.optional(),
|
|
8551
|
-
softMisses:
|
|
8552
|
-
softIncomplete:
|
|
8553
|
-
graders:
|
|
8554
|
-
resolvedRef:
|
|
8634
|
+
softMisses: import_zod69.z.array(import_zod69.z.string()),
|
|
8635
|
+
softIncomplete: import_zod69.z.array(import_zod69.z.string()),
|
|
8636
|
+
graders: import_zod69.z.array(GraderVerdictSchema),
|
|
8637
|
+
resolvedRef: import_zod69.z.string().optional()
|
|
8555
8638
|
// fixtures.workspace.ref → commit SHA
|
|
8556
8639
|
}).strict();
|
|
8557
|
-
var EvalRunSummarySchema =
|
|
8558
|
-
total:
|
|
8559
|
-
passed:
|
|
8560
|
-
failed:
|
|
8561
|
-
errored:
|
|
8562
|
-
gatePass:
|
|
8640
|
+
var EvalRunSummarySchema = import_zod69.z.object({
|
|
8641
|
+
total: import_zod69.z.number().int().nonnegative(),
|
|
8642
|
+
passed: import_zod69.z.number().int().nonnegative(),
|
|
8643
|
+
failed: import_zod69.z.number().int().nonnegative(),
|
|
8644
|
+
errored: import_zod69.z.number().int().nonnegative(),
|
|
8645
|
+
gatePass: import_zod69.z.boolean(),
|
|
8563
8646
|
// 正向断言:全部 case 的全部 gate grader 显式 passed
|
|
8564
8647
|
/**
|
|
8565
8648
|
* v1.2:本 run 参与门禁的 grader 总数。零 gate grader 时 `gatePass` 按「真空为真」
|
|
@@ -8567,116 +8650,116 @@ var EvalRunSummarySchema = import_zod68.z.object({
|
|
|
8567
8650
|
* 本字段让使用者一眼分辨「真的全部通过」与「压根没有门禁断言」。
|
|
8568
8651
|
* optional:老数据无此字段。
|
|
8569
8652
|
*/
|
|
8570
|
-
gateGraderCount:
|
|
8653
|
+
gateGraderCount: import_zod69.z.number().int().nonnegative().optional(),
|
|
8571
8654
|
/**
|
|
8572
8655
|
* v1.2:有多少 case 一个 gate grader 都没有(各自「真空为真」)。`gateGraderCount`
|
|
8573
8656
|
* 是 sum,只能答「全 run 有没有任何门禁断言」;本字段答「是否每个 case 都有」——
|
|
8574
8657
|
* `gatePass=true` 但本值 > 0 = 有 case 无门禁却被算作通过(case 级假绿)。optional:老数据无。
|
|
8575
8658
|
*/
|
|
8576
|
-
casesWithoutGateGrader:
|
|
8577
|
-
errorSummary:
|
|
8578
|
-
capabilityUnavailable:
|
|
8579
|
-
infrastructureError:
|
|
8659
|
+
casesWithoutGateGrader: import_zod69.z.number().int().nonnegative().optional(),
|
|
8660
|
+
errorSummary: import_zod69.z.object({
|
|
8661
|
+
capabilityUnavailable: import_zod69.z.number().int().nonnegative(),
|
|
8662
|
+
infrastructureError: import_zod69.z.number().int().nonnegative(),
|
|
8580
8663
|
/** v1.2:judge 未能给出结论(gate llm UNKNOWN)。optional:老数据无此字段。 */
|
|
8581
|
-
indeterminate:
|
|
8664
|
+
indeterminate: import_zod69.z.number().int().nonnegative().optional(),
|
|
8582
8665
|
/** v1.2:定义写错(自评防护 EVAL_SELF_EVAL_FORBIDDEN)。optional:老数据无此字段。 */
|
|
8583
|
-
invalidDefinition:
|
|
8666
|
+
invalidDefinition: import_zod69.z.number().int().nonnegative().optional()
|
|
8584
8667
|
}).loose().optional()
|
|
8585
8668
|
}).loose();
|
|
8586
8669
|
var EvalRunSummaryWriteSchema = EvalRunSummarySchema.extend({
|
|
8587
8670
|
errorSummary: EvalRunSummarySchema.shape.errorSummary.unwrap().strict().optional()
|
|
8588
8671
|
}).strict();
|
|
8589
|
-
var EvalSuiteRefSchema =
|
|
8590
|
-
source:
|
|
8591
|
-
digest:
|
|
8592
|
-
path:
|
|
8672
|
+
var EvalSuiteRefSchema = import_zod69.z.object({
|
|
8673
|
+
source: import_zod69.z.enum(["package", "repo"]),
|
|
8674
|
+
digest: import_zod69.z.string().min(1),
|
|
8675
|
+
path: import_zod69.z.string().min(1)
|
|
8593
8676
|
}).strict();
|
|
8594
|
-
var CreateEvalRunRequestSchema =
|
|
8595
|
-
agent:
|
|
8677
|
+
var CreateEvalRunRequestSchema = import_zod69.z.object({
|
|
8678
|
+
agent: import_zod69.z.string().min(1),
|
|
8596
8679
|
// A0 只打 test stage(§9 非目标:不做 prod 直评)。用 enum 而非 literal——
|
|
8597
8680
|
// 将来放开 staging/prod 时「enum 加值」是非破坏性变更,literal 变 enum 才是
|
|
8598
8681
|
// 破坏性变更(T1 评审建议,见设计文档 §2.1.6)。
|
|
8599
|
-
stage:
|
|
8682
|
+
stage: import_zod69.z.enum(["test"]),
|
|
8600
8683
|
suiteRef: EvalSuiteRefSchema.optional(),
|
|
8601
8684
|
// 缺省=目标 Revision 绑定的 suite
|
|
8602
|
-
caseIds:
|
|
8603
|
-
strict:
|
|
8685
|
+
caseIds: import_zod69.z.array(EvalSlugSchema).optional(),
|
|
8686
|
+
strict: import_zod69.z.boolean().optional()
|
|
8604
8687
|
}).strict();
|
|
8605
|
-
var CreateEvalRunResponseSchema =
|
|
8606
|
-
var CancelEvalRunResponseSchema =
|
|
8607
|
-
var EvalRunViewSchema =
|
|
8608
|
-
runId:
|
|
8688
|
+
var CreateEvalRunResponseSchema = import_zod69.z.object({ runId: import_zod69.z.string().min(1) }).strict();
|
|
8689
|
+
var CancelEvalRunResponseSchema = import_zod69.z.object({ runId: import_zod69.z.string().min(1), cancelled: import_zod69.z.boolean() }).strict();
|
|
8690
|
+
var EvalRunViewSchema = import_zod69.z.object({
|
|
8691
|
+
runId: import_zod69.z.string(),
|
|
8609
8692
|
status: EvalRunStatusSchema,
|
|
8610
|
-
agent:
|
|
8611
|
-
revisionId:
|
|
8612
|
-
stage:
|
|
8693
|
+
agent: import_zod69.z.string(),
|
|
8694
|
+
revisionId: import_zod69.z.string(),
|
|
8695
|
+
stage: import_zod69.z.string(),
|
|
8613
8696
|
suiteRef: EvalSuiteRefSchema,
|
|
8614
|
-
strict:
|
|
8697
|
+
strict: import_zod69.z.boolean(),
|
|
8615
8698
|
trigger: EvalTriggerSchema,
|
|
8616
|
-
startedAt:
|
|
8617
|
-
completedAt:
|
|
8618
|
-
cases:
|
|
8699
|
+
startedAt: import_zod69.z.string().optional(),
|
|
8700
|
+
completedAt: import_zod69.z.string().optional(),
|
|
8701
|
+
cases: import_zod69.z.array(EvalCaseResultSchema),
|
|
8619
8702
|
summary: EvalRunSummarySchema
|
|
8620
8703
|
}).strict();
|
|
8621
|
-
var EvalRunListItemSchema =
|
|
8622
|
-
runId:
|
|
8704
|
+
var EvalRunListItemSchema = import_zod69.z.object({
|
|
8705
|
+
runId: import_zod69.z.string(),
|
|
8623
8706
|
status: EvalRunStatusSchema,
|
|
8624
|
-
agent:
|
|
8625
|
-
revisionId:
|
|
8626
|
-
stage:
|
|
8707
|
+
agent: import_zod69.z.string(),
|
|
8708
|
+
revisionId: import_zod69.z.string(),
|
|
8709
|
+
stage: import_zod69.z.string(),
|
|
8627
8710
|
trigger: EvalTriggerSchema,
|
|
8628
|
-
startedAt:
|
|
8629
|
-
completedAt:
|
|
8711
|
+
startedAt: import_zod69.z.string().optional(),
|
|
8712
|
+
completedAt: import_zod69.z.string().optional(),
|
|
8630
8713
|
summary: EvalRunSummarySchema
|
|
8631
8714
|
}).strict();
|
|
8632
|
-
var EvalRunListResponseSchema =
|
|
8633
|
-
items:
|
|
8634
|
-
nextCursor:
|
|
8715
|
+
var EvalRunListResponseSchema = import_zod69.z.object({
|
|
8716
|
+
items: import_zod69.z.array(EvalRunListItemSchema),
|
|
8717
|
+
nextCursor: import_zod69.z.string().optional()
|
|
8635
8718
|
}).strict();
|
|
8636
8719
|
var PIPELINE_COMMIT_SHA_RE = /^[0-9a-f]{7,64}$/i;
|
|
8637
|
-
var CommitShaSchema =
|
|
8720
|
+
var CommitShaSchema = import_zod70.z.string().regex(PIPELINE_COMMIT_SHA_RE, {
|
|
8638
8721
|
message: "commitSha must be 7-64 hexadecimal characters"
|
|
8639
8722
|
});
|
|
8640
8723
|
var PIPELINE_FULL_COMMIT_SHA_RE = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i;
|
|
8641
|
-
var FullCommitShaSchema =
|
|
8724
|
+
var FullCommitShaSchema = import_zod70.z.string().regex(PIPELINE_FULL_COMMIT_SHA_RE, {
|
|
8642
8725
|
message: "commitSha must be a full 40- or 64-character hexadecimal SHA (short prefixes cannot anchor a release)"
|
|
8643
8726
|
});
|
|
8644
8727
|
var PIPELINE_TRIGGERED_REF_MAX_LENGTH = 512;
|
|
8645
|
-
var TriggeredRefSchema =
|
|
8646
|
-
var IsoTimestampSchema =
|
|
8728
|
+
var TriggeredRefSchema = import_zod70.z.string().min(1).max(PIPELINE_TRIGGERED_REF_MAX_LENGTH);
|
|
8729
|
+
var IsoTimestampSchema = import_zod70.z.string().datetime({ offset: true });
|
|
8647
8730
|
var NullableIsoTimestampSchema = IsoTimestampSchema.nullable();
|
|
8648
|
-
var PipelineTriggerSchema =
|
|
8649
|
-
var PipelineRunStatusSchema =
|
|
8650
|
-
var PipelineStepSchema =
|
|
8651
|
-
var PipelineStepStatusSchema =
|
|
8652
|
-
var PipelineErrorCodeSchema =
|
|
8653
|
-
var ListPipelineRunsQuerySchema =
|
|
8654
|
-
projectId:
|
|
8655
|
-
limit:
|
|
8656
|
-
}).strict();
|
|
8657
|
-
var NullableTriggeredRefSchema =
|
|
8658
|
-
var PipelineRunListItemSchema =
|
|
8659
|
-
id:
|
|
8660
|
-
commitSha:
|
|
8661
|
-
commitMessage:
|
|
8731
|
+
var PipelineTriggerSchema = import_zod70.z.enum(PIPELINE_TRIGGERS);
|
|
8732
|
+
var PipelineRunStatusSchema = import_zod70.z.enum(PIPELINE_RUN_STATUSES);
|
|
8733
|
+
var PipelineStepSchema = import_zod70.z.enum(PIPELINE_STEPS);
|
|
8734
|
+
var PipelineStepStatusSchema = import_zod70.z.enum(PIPELINE_STEP_STATUSES);
|
|
8735
|
+
var PipelineErrorCodeSchema = import_zod70.z.string().min(1).nullable();
|
|
8736
|
+
var ListPipelineRunsQuerySchema = import_zod70.z.object({
|
|
8737
|
+
projectId: import_zod70.z.string().uuid(),
|
|
8738
|
+
limit: import_zod70.z.coerce.number().int().min(1).max(200).default(50)
|
|
8739
|
+
}).strict();
|
|
8740
|
+
var NullableTriggeredRefSchema = import_zod70.z.string().nullable().optional();
|
|
8741
|
+
var PipelineRunListItemSchema = import_zod70.z.object({
|
|
8742
|
+
id: import_zod70.z.string().uuid(),
|
|
8743
|
+
commitSha: import_zod70.z.string(),
|
|
8744
|
+
commitMessage: import_zod70.z.string().nullable(),
|
|
8662
8745
|
trigger: PipelineTriggerSchema,
|
|
8663
8746
|
status: PipelineRunStatusSchema,
|
|
8664
|
-
stagesKey:
|
|
8665
|
-
attempt:
|
|
8666
|
-
agentSlugs:
|
|
8667
|
-
createdBy:
|
|
8747
|
+
stagesKey: import_zod70.z.string(),
|
|
8748
|
+
attempt: import_zod70.z.number().int().nonnegative(),
|
|
8749
|
+
agentSlugs: import_zod70.z.array(import_zod70.z.string()),
|
|
8750
|
+
createdBy: import_zod70.z.string().nullable(),
|
|
8668
8751
|
createdAt: IsoTimestampSchema,
|
|
8669
8752
|
startedAt: NullableIsoTimestampSchema,
|
|
8670
8753
|
completedAt: NullableIsoTimestampSchema,
|
|
8671
8754
|
errorCode: PipelineErrorCodeSchema,
|
|
8672
8755
|
triggeredRef: NullableTriggeredRefSchema
|
|
8673
8756
|
}).strict();
|
|
8674
|
-
var ListPipelineRunsResponseSchema =
|
|
8675
|
-
enabled:
|
|
8676
|
-
items:
|
|
8757
|
+
var ListPipelineRunsResponseSchema = import_zod70.z.object({
|
|
8758
|
+
enabled: import_zod70.z.boolean(),
|
|
8759
|
+
items: import_zod70.z.array(PipelineRunListItemSchema)
|
|
8677
8760
|
}).strict();
|
|
8678
|
-
var CreatePipelineRunRequestSchema =
|
|
8679
|
-
projectId:
|
|
8761
|
+
var CreatePipelineRunRequestSchema = import_zod70.z.object({
|
|
8762
|
+
projectId: import_zod70.z.string().uuid(),
|
|
8680
8763
|
commitSha: FullCommitShaSchema,
|
|
8681
8764
|
/**
|
|
8682
8765
|
* Explicit re-run: mint `attempt+1` even when the latest run for this
|
|
@@ -8685,7 +8768,7 @@ var CreatePipelineRunRequestSchema = import_zod69.z.object({
|
|
|
8685
8768
|
* against servers that predate it (`.strict()` on their side). Non-passed
|
|
8686
8769
|
* terminal runs re-run automatically without this flag (§4).
|
|
8687
8770
|
*/
|
|
8688
|
-
rerun:
|
|
8771
|
+
rerun: import_zod70.z.boolean().optional(),
|
|
8689
8772
|
/**
|
|
8690
8773
|
* The ref the caller resolved `commitSha` from, recorded for display only
|
|
8691
8774
|
* (see `TriggeredRefSchema`). Optional: a caller that has just a SHA and no
|
|
@@ -8698,54 +8781,54 @@ var CreatePipelineRunRequestSchema = import_zod69.z.object({
|
|
|
8698
8781
|
*/
|
|
8699
8782
|
triggeredRef: TriggeredRefSchema.optional()
|
|
8700
8783
|
}).strict();
|
|
8701
|
-
var CreatePipelineRunResponseSchema =
|
|
8702
|
-
runId:
|
|
8703
|
-
deduplicated:
|
|
8704
|
-
attempt:
|
|
8784
|
+
var CreatePipelineRunResponseSchema = import_zod70.z.object({
|
|
8785
|
+
runId: import_zod70.z.string().uuid(),
|
|
8786
|
+
deduplicated: import_zod70.z.boolean(),
|
|
8787
|
+
attempt: import_zod70.z.number().int().nonnegative().optional(),
|
|
8705
8788
|
status: PipelineRunStatusSchema.optional()
|
|
8706
8789
|
});
|
|
8707
|
-
var PipelineRunDetailRunSchema =
|
|
8708
|
-
id:
|
|
8709
|
-
projectId:
|
|
8710
|
-
repoUrl:
|
|
8711
|
-
commitSha:
|
|
8712
|
-
commitMessage:
|
|
8790
|
+
var PipelineRunDetailRunSchema = import_zod70.z.object({
|
|
8791
|
+
id: import_zod70.z.string().uuid(),
|
|
8792
|
+
projectId: import_zod70.z.string().uuid(),
|
|
8793
|
+
repoUrl: import_zod70.z.string(),
|
|
8794
|
+
commitSha: import_zod70.z.string(),
|
|
8795
|
+
commitMessage: import_zod70.z.string().nullable(),
|
|
8713
8796
|
trigger: PipelineTriggerSchema,
|
|
8714
8797
|
status: PipelineRunStatusSchema,
|
|
8715
|
-
stagesRequested:
|
|
8716
|
-
stagesKey:
|
|
8717
|
-
attempt:
|
|
8718
|
-
planJson:
|
|
8798
|
+
stagesRequested: import_zod70.z.array(PipelineStepSchema).nullable(),
|
|
8799
|
+
stagesKey: import_zod70.z.string(),
|
|
8800
|
+
attempt: import_zod70.z.number().int().nonnegative(),
|
|
8801
|
+
planJson: import_zod70.z.unknown().nullable(),
|
|
8719
8802
|
errorCode: PipelineErrorCodeSchema,
|
|
8720
|
-
errorMessage:
|
|
8721
|
-
createdBy:
|
|
8803
|
+
errorMessage: import_zod70.z.string().nullable(),
|
|
8804
|
+
createdBy: import_zod70.z.string().nullable(),
|
|
8722
8805
|
createdAt: IsoTimestampSchema,
|
|
8723
8806
|
startedAt: NullableIsoTimestampSchema,
|
|
8724
8807
|
completedAt: NullableIsoTimestampSchema,
|
|
8725
8808
|
triggeredRef: NullableTriggeredRefSchema
|
|
8726
8809
|
}).strict();
|
|
8727
|
-
var PipelineRunStepSchema =
|
|
8810
|
+
var PipelineRunStepSchema = import_zod70.z.object({
|
|
8728
8811
|
step: PipelineStepSchema,
|
|
8729
8812
|
status: PipelineStepStatusSchema,
|
|
8730
|
-
attempt:
|
|
8731
|
-
resultJson:
|
|
8813
|
+
attempt: import_zod70.z.number().int().nonnegative(),
|
|
8814
|
+
resultJson: import_zod70.z.unknown().nullable(),
|
|
8732
8815
|
errorCode: PipelineErrorCodeSchema,
|
|
8733
|
-
errorMessage:
|
|
8816
|
+
errorMessage: import_zod70.z.string().nullable(),
|
|
8734
8817
|
startedAt: NullableIsoTimestampSchema,
|
|
8735
8818
|
completedAt: NullableIsoTimestampSchema
|
|
8736
8819
|
}).strict();
|
|
8737
|
-
var PipelineRunWorkloadSchema =
|
|
8738
|
-
agentSlug:
|
|
8739
|
-
affectedReason:
|
|
8740
|
-
workloadId:
|
|
8741
|
-
revisionId:
|
|
8742
|
-
repointStatus:
|
|
8743
|
-
freezeStatus:
|
|
8744
|
-
frozenPackageOssUrl:
|
|
8745
|
-
frozenPackageSha256:
|
|
8746
|
-
frozenPackageWarnings:
|
|
8747
|
-
evalRunId:
|
|
8748
|
-
evalVerdict:
|
|
8820
|
+
var PipelineRunWorkloadSchema = import_zod70.z.object({
|
|
8821
|
+
agentSlug: import_zod70.z.string(),
|
|
8822
|
+
affectedReason: import_zod70.z.string().nullable(),
|
|
8823
|
+
workloadId: import_zod70.z.string().nullable(),
|
|
8824
|
+
revisionId: import_zod70.z.string().nullable(),
|
|
8825
|
+
repointStatus: import_zod70.z.string().nullable(),
|
|
8826
|
+
freezeStatus: import_zod70.z.string().nullable(),
|
|
8827
|
+
frozenPackageOssUrl: import_zod70.z.string().nullable(),
|
|
8828
|
+
frozenPackageSha256: import_zod70.z.string().nullable(),
|
|
8829
|
+
frozenPackageWarnings: import_zod70.z.array(import_zod70.z.string()).nullable(),
|
|
8830
|
+
evalRunId: import_zod70.z.string().nullable(),
|
|
8831
|
+
evalVerdict: import_zod70.z.string().nullable(),
|
|
8749
8832
|
/**
|
|
8750
8833
|
* joined | skipped_no_base_revision | skipped_no_image_change | failed.
|
|
8751
8834
|
*
|
|
@@ -8754,7 +8837,7 @@ var PipelineRunWorkloadSchema = import_zod69.z.object({
|
|
|
8754
8837
|
* so a client parsing a response from a control-plane that predates these
|
|
8755
8838
|
* fields must not throw. Absent and null both read as "not reported".
|
|
8756
8839
|
*/
|
|
8757
|
-
joinStatus:
|
|
8840
|
+
joinStatus: import_zod70.z.string().nullable().optional(),
|
|
8758
8841
|
/**
|
|
8759
8842
|
* Per-workload failure, so a client can say WHICH agent failed and why —
|
|
8760
8843
|
* the run/step level only ever counts failures. Deliberately NOT
|
|
@@ -8766,16 +8849,16 @@ var PipelineRunWorkloadSchema = import_zod69.z.object({
|
|
|
8766
8849
|
* `.max()`-ed here — a schema cap would upgrade "the error text is long"
|
|
8767
8850
|
* into "the whole response fails to parse".
|
|
8768
8851
|
*/
|
|
8769
|
-
errorCode:
|
|
8770
|
-
errorMessage:
|
|
8852
|
+
errorCode: import_zod70.z.string().nullable().optional(),
|
|
8853
|
+
errorMessage: import_zod70.z.string().nullable().optional()
|
|
8771
8854
|
}).strict();
|
|
8772
|
-
var PipelineRunDetailResponseSchema =
|
|
8855
|
+
var PipelineRunDetailResponseSchema = import_zod70.z.object({
|
|
8773
8856
|
run: PipelineRunDetailRunSchema,
|
|
8774
|
-
steps:
|
|
8775
|
-
workloads:
|
|
8857
|
+
steps: import_zod70.z.array(PipelineRunStepSchema),
|
|
8858
|
+
workloads: import_zod70.z.array(PipelineRunWorkloadSchema)
|
|
8776
8859
|
}).strict();
|
|
8777
|
-
var GetPipelinePlanQuerySchema =
|
|
8778
|
-
projectId:
|
|
8860
|
+
var GetPipelinePlanQuerySchema = import_zod70.z.object({
|
|
8861
|
+
projectId: import_zod70.z.string().uuid(),
|
|
8779
8862
|
commitSha: CommitShaSchema,
|
|
8780
8863
|
fromSha: CommitShaSchema.optional(),
|
|
8781
8864
|
/**
|
|
@@ -8783,20 +8866,20 @@ var GetPipelinePlanQuerySchema = import_zod69.z.object({
|
|
|
8783
8866
|
* Accepted as the STRING "false" because it arrives as a query param; any
|
|
8784
8867
|
* other value (including absent) means "compute if missing".
|
|
8785
8868
|
*/
|
|
8786
|
-
enqueue:
|
|
8869
|
+
enqueue: import_zod70.z.enum(["true", "false"]).optional().transform((value) => value !== "false")
|
|
8787
8870
|
}).strict();
|
|
8788
|
-
var PipelinePlanResponseSchema =
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
source:
|
|
8792
|
-
enqueued:
|
|
8871
|
+
var PipelinePlanResponseSchema = import_zod70.z.discriminatedUnion("source", [
|
|
8872
|
+
import_zod70.z.object({ source: import_zod70.z.literal("cache"), plan: import_zod70.z.unknown() }).strict(),
|
|
8873
|
+
import_zod70.z.object({
|
|
8874
|
+
source: import_zod70.z.literal("computing"),
|
|
8875
|
+
enqueued: import_zod70.z.boolean(),
|
|
8793
8876
|
// 上一次计算的失败摘要(若有)。默认 enqueue=true 会不断重算,plan 一直
|
|
8794
8877
|
// "computing" 时失败原本被吞——带上它让轮询者看到「在重试,但上次失败:…」
|
|
8795
8878
|
// 而不是无限"计算中"(#1346 D4)。
|
|
8796
8879
|
// 长度上游已有界(plan-cache fail() 落库前截断 2000),这里刻意不设
|
|
8797
8880
|
// .max():schema 硬上限会把"错误信息超长"升级成"整个响应 parse 失败",
|
|
8798
8881
|
// 让错误路径反过来炸掉主功能。
|
|
8799
|
-
lastError:
|
|
8882
|
+
lastError: import_zod70.z.string().nullable().optional()
|
|
8800
8883
|
}).strict()
|
|
8801
8884
|
]);
|
|
8802
8885
|
var PIPELINE_API_ERROR_CODES = [
|
|
@@ -8807,23 +8890,23 @@ var PIPELINE_API_ERROR_CODES = [
|
|
|
8807
8890
|
"PIPELINE_RUN_NOT_FOUND",
|
|
8808
8891
|
"PLAN_NOT_CACHED"
|
|
8809
8892
|
];
|
|
8810
|
-
var PipelineApiErrorCodeSchema =
|
|
8893
|
+
var PipelineApiErrorCodeSchema = import_zod70.z.enum(PIPELINE_API_ERROR_CODES);
|
|
8811
8894
|
var SKILL_NAME_MAX_LENGTH = 200;
|
|
8812
8895
|
var SKILL_SOURCE_REF_MAX_LENGTH = 512;
|
|
8813
8896
|
var SKILL_NAME_WHITELIST = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
8814
|
-
var SkillNameSchema =
|
|
8897
|
+
var SkillNameSchema = import_zod71.z.string().min(1).max(SKILL_NAME_MAX_LENGTH).refine((value) => SKILL_NAME_WHITELIST.test(value), {
|
|
8815
8898
|
message: "skill name must start with [A-Za-z0-9] and contain only [A-Za-z0-9._-] (no path separators, spaces or invisible characters)"
|
|
8816
8899
|
}).refine((value) => value !== "." && value !== "..", {
|
|
8817
8900
|
message: "skill name must not be '.' or '..'"
|
|
8818
8901
|
});
|
|
8819
|
-
var SkillSourceRefSchema =
|
|
8820
|
-
var SkillManifestSourceTypeSchema =
|
|
8821
|
-
var SkillsManifestDefaultsSchema =
|
|
8822
|
-
installDir:
|
|
8823
|
-
targetAgents:
|
|
8824
|
-
installMode:
|
|
8902
|
+
var SkillSourceRefSchema = import_zod71.z.string().min(1).max(SKILL_SOURCE_REF_MAX_LENGTH);
|
|
8903
|
+
var SkillManifestSourceTypeSchema = import_zod71.z.enum(["rush", "github", "gitlab"]);
|
|
8904
|
+
var SkillsManifestDefaultsSchema = import_zod71.z.object({
|
|
8905
|
+
installDir: import_zod71.z.string().min(1).max(SKILL_SOURCE_REF_MAX_LENGTH).optional(),
|
|
8906
|
+
targetAgents: import_zod71.z.array(import_zod71.z.string().min(1)).optional(),
|
|
8907
|
+
installMode: import_zod71.z.string().min(1).optional()
|
|
8825
8908
|
}).passthrough();
|
|
8826
|
-
var SkillsManifestSchema =
|
|
8909
|
+
var SkillsManifestSchema = import_zod71.z.object({
|
|
8827
8910
|
/**
|
|
8828
8911
|
* **必填,刻意不做 `.optional().default({})`**(评审提过,权衡后维持):
|
|
8829
8912
|
* 本 schema 是 passthrough 的,若 `skills` 可省略,一个拼错的顶层 key
|
|
@@ -8832,27 +8915,27 @@ var SkillsManifestSchema = import_zod70.z.object({
|
|
|
8832
8915
|
* 看到一条报错、补上 `"skills": {}`:响的、可恢复的。空清单请显式写
|
|
8833
8916
|
* `{"skills": {}}`(脚手架生成的就是这个形态)。
|
|
8834
8917
|
*/
|
|
8835
|
-
skills:
|
|
8836
|
-
registries:
|
|
8918
|
+
skills: import_zod71.z.record(SkillNameSchema, SkillSourceRefSchema),
|
|
8919
|
+
registries: import_zod71.z.record(import_zod71.z.string().min(1), import_zod71.z.string().min(1)).optional(),
|
|
8837
8920
|
defaults: SkillsManifestDefaultsSchema.optional()
|
|
8838
8921
|
}).passthrough();
|
|
8839
|
-
var SkillsLockEntrySchema =
|
|
8840
|
-
source:
|
|
8922
|
+
var SkillsLockEntrySchema = import_zod71.z.object({
|
|
8923
|
+
source: import_zod71.z.string().min(1).max(SKILL_SOURCE_REF_MAX_LENGTH),
|
|
8841
8924
|
/** 注册表源的精确版本;git 源这里是可读注记(实测常为 `main`)。 */
|
|
8842
|
-
version:
|
|
8925
|
+
version: import_zod71.z.string().optional(),
|
|
8843
8926
|
/** 浮动 ref 的人类可读注记——**绝不参与安装**(D23)。 */
|
|
8844
|
-
ref:
|
|
8845
|
-
resolved:
|
|
8927
|
+
ref: import_zod71.z.string().optional(),
|
|
8928
|
+
resolved: import_zod71.z.string().optional(),
|
|
8846
8929
|
/** git 源的钉死点。实测可能为 `""`(缺 commit),由校验层硬拒。 */
|
|
8847
|
-
commit:
|
|
8848
|
-
integrity:
|
|
8849
|
-
installedAt:
|
|
8930
|
+
commit: import_zod71.z.string().optional(),
|
|
8931
|
+
integrity: import_zod71.z.string().optional(),
|
|
8932
|
+
installedAt: import_zod71.z.string().optional()
|
|
8850
8933
|
}).passthrough();
|
|
8851
|
-
var SkillsLockSchema =
|
|
8852
|
-
lockfileVersion:
|
|
8853
|
-
skills:
|
|
8934
|
+
var SkillsLockSchema = import_zod71.z.object({
|
|
8935
|
+
lockfileVersion: import_zod71.z.number().int().nonnegative().optional(),
|
|
8936
|
+
skills: import_zod71.z.record(SkillNameSchema, SkillsLockEntrySchema)
|
|
8854
8937
|
}).passthrough();
|
|
8855
|
-
var SkillsManifestErrorCodeSchema =
|
|
8938
|
+
var SkillsManifestErrorCodeSchema = import_zod71.z.enum([
|
|
8856
8939
|
/** `skills.json` 语法/结构非法。 */
|
|
8857
8940
|
"SKILLS_MANIFEST_INVALID",
|
|
8858
8941
|
/** `skills.lock` 语法/结构非法。 */
|
|
@@ -8988,7 +9071,7 @@ var BindingsResource = class {
|
|
|
8988
9071
|
};
|
|
8989
9072
|
|
|
8990
9073
|
// src/resources/environments.ts
|
|
8991
|
-
var
|
|
9074
|
+
var import_zod72 = require("zod");
|
|
8992
9075
|
|
|
8993
9076
|
// src/agent-vocab.ts
|
|
8994
9077
|
function resolveExclusiveAlias(canonicalKey, canonicalValue, aliasKey, aliasValue) {
|
|
@@ -9012,24 +9095,24 @@ function attachAgentAliases(data) {
|
|
|
9012
9095
|
}
|
|
9013
9096
|
|
|
9014
9097
|
// src/resources/environments.ts
|
|
9015
|
-
var EnvironmentVersionHistorySchema =
|
|
9016
|
-
versions:
|
|
9017
|
-
repoints:
|
|
9098
|
+
var EnvironmentVersionHistorySchema = import_zod72.z.object({
|
|
9099
|
+
versions: import_zod72.z.array(EnvironmentVersionSchema),
|
|
9100
|
+
repoints: import_zod72.z.array(EnvironmentRepointRecordSchema)
|
|
9018
9101
|
}).strict();
|
|
9019
|
-
var RepointedSlotResultSchema =
|
|
9020
|
-
workloadId:
|
|
9102
|
+
var RepointedSlotResultSchema = import_zod72.z.object({
|
|
9103
|
+
workloadId: import_zod72.z.string().uuid(),
|
|
9021
9104
|
stage: StageSchema,
|
|
9022
|
-
fromVersion:
|
|
9105
|
+
fromVersion: import_zod72.z.number().int().positive().nullable()
|
|
9023
9106
|
}).strict();
|
|
9024
|
-
var RepointEnvironmentResultSchema =
|
|
9025
|
-
toVersion:
|
|
9026
|
-
repointedSlotCount:
|
|
9027
|
-
repointedSlots:
|
|
9107
|
+
var RepointEnvironmentResultSchema = import_zod72.z.object({
|
|
9108
|
+
toVersion: import_zod72.z.number().int().positive(),
|
|
9109
|
+
repointedSlotCount: import_zod72.z.number().int().nonnegative(),
|
|
9110
|
+
repointedSlots: import_zod72.z.array(RepointedSlotResultSchema)
|
|
9028
9111
|
}).strict();
|
|
9029
|
-
var UpdateEnvironmentResultSchema =
|
|
9112
|
+
var UpdateEnvironmentResultSchema = import_zod72.z.object({
|
|
9030
9113
|
environment: EnvironmentSchema,
|
|
9031
|
-
createdVersion:
|
|
9032
|
-
repointedSlotCount:
|
|
9114
|
+
createdVersion: import_zod72.z.number().int().positive().nullable(),
|
|
9115
|
+
repointedSlotCount: import_zod72.z.number().int().nonnegative()
|
|
9033
9116
|
}).strict();
|
|
9034
9117
|
function attachAgentAliasesToEach(items) {
|
|
9035
9118
|
return items.map((item) => attachAgentAliases(item));
|
|
@@ -9350,14 +9433,14 @@ var McpDevTicketsResource = class {
|
|
|
9350
9433
|
};
|
|
9351
9434
|
|
|
9352
9435
|
// src/resources/memories.ts
|
|
9353
|
-
var
|
|
9436
|
+
var import_zod73 = require("zod");
|
|
9354
9437
|
var ListedMemorySchema = AgentMemorySchema.extend({
|
|
9355
|
-
createdAt:
|
|
9356
|
-
updatedAt:
|
|
9438
|
+
createdAt: import_zod73.z.string(),
|
|
9439
|
+
updatedAt: import_zod73.z.string()
|
|
9357
9440
|
});
|
|
9358
|
-
var ListMemoriesResponseSchema =
|
|
9359
|
-
items:
|
|
9360
|
-
nextCursor:
|
|
9441
|
+
var ListMemoriesResponseSchema = import_zod73.z.object({
|
|
9442
|
+
items: import_zod73.z.array(ListedMemorySchema),
|
|
9443
|
+
nextCursor: import_zod73.z.string().nullish()
|
|
9361
9444
|
});
|
|
9362
9445
|
function parseEnvelopeData2(envelope, routeLabel, schema) {
|
|
9363
9446
|
if (envelope?.data === void 0) {
|
|
@@ -9828,7 +9911,7 @@ var ProjectsResource = class {
|
|
|
9828
9911
|
};
|
|
9829
9912
|
|
|
9830
9913
|
// src/resources/sessions.ts
|
|
9831
|
-
var
|
|
9914
|
+
var import_zod74 = require("zod");
|
|
9832
9915
|
function normalizeSessionRequest(request) {
|
|
9833
9916
|
const { agentId, versionId, ...rest } = request;
|
|
9834
9917
|
const workloadId = resolveExclusiveAlias("workloadId", rest.workloadId, "agentId", agentId);
|
|
@@ -9853,28 +9936,28 @@ function normalizeSessionRequest(request) {
|
|
|
9853
9936
|
...revisionId !== void 0 ? { revisionId } : {}
|
|
9854
9937
|
};
|
|
9855
9938
|
}
|
|
9856
|
-
var ListSessionEventsEnvelopeSchema =
|
|
9857
|
-
data:
|
|
9858
|
-
});
|
|
9859
|
-
var DeliveryResultEnvelopeSchema =
|
|
9860
|
-
data:
|
|
9861
|
-
});
|
|
9862
|
-
var SessionArtifactsListEnvelopeSchema =
|
|
9863
|
-
data:
|
|
9864
|
-
items:
|
|
9865
|
-
|
|
9866
|
-
id:
|
|
9867
|
-
artifactId:
|
|
9868
|
-
filename:
|
|
9869
|
-
path:
|
|
9870
|
-
contentType:
|
|
9871
|
-
size:
|
|
9872
|
-
turnId:
|
|
9873
|
-
messageId:
|
|
9939
|
+
var ListSessionEventsEnvelopeSchema = import_zod74.z.object({
|
|
9940
|
+
data: import_zod74.z.object({ events: import_zod74.z.array(SessionEventSchema) })
|
|
9941
|
+
});
|
|
9942
|
+
var DeliveryResultEnvelopeSchema = import_zod74.z.object({
|
|
9943
|
+
data: import_zod74.z.object({ delivery: SessionDeliveryEnvelopeSchema.nullable() })
|
|
9944
|
+
});
|
|
9945
|
+
var SessionArtifactsListEnvelopeSchema = import_zod74.z.object({
|
|
9946
|
+
data: import_zod74.z.object({
|
|
9947
|
+
items: import_zod74.z.array(
|
|
9948
|
+
import_zod74.z.object({
|
|
9949
|
+
id: import_zod74.z.string(),
|
|
9950
|
+
artifactId: import_zod74.z.string().optional(),
|
|
9951
|
+
filename: import_zod74.z.string(),
|
|
9952
|
+
path: import_zod74.z.string(),
|
|
9953
|
+
contentType: import_zod74.z.string(),
|
|
9954
|
+
size: import_zod74.z.number(),
|
|
9955
|
+
turnId: import_zod74.z.string().optional(),
|
|
9956
|
+
messageId: import_zod74.z.string().optional()
|
|
9874
9957
|
})
|
|
9875
9958
|
),
|
|
9876
|
-
partial:
|
|
9877
|
-
skippedBundles:
|
|
9959
|
+
partial: import_zod74.z.boolean().optional(),
|
|
9960
|
+
skippedBundles: import_zod74.z.array(import_zod74.z.object({ artifactId: import_zod74.z.string(), reason: import_zod74.z.string() })).optional()
|
|
9878
9961
|
})
|
|
9879
9962
|
});
|
|
9880
9963
|
var SessionsResource = class {
|
|
@@ -9897,6 +9980,11 @@ var SessionsResource = class {
|
|
|
9897
9980
|
method: "GET",
|
|
9898
9981
|
signal: options.signal,
|
|
9899
9982
|
cache: "no-store",
|
|
9983
|
+
// Omitted entirely (not sent as `include=`) unless explicitly
|
|
9984
|
+
// requested — see `GetSessionOptions.include`'s docstring.
|
|
9985
|
+
query: {
|
|
9986
|
+
include: options.include?.length ? options.include.join(",") : void 0
|
|
9987
|
+
},
|
|
9900
9988
|
headers: {
|
|
9901
9989
|
"Cache-Control": "no-cache",
|
|
9902
9990
|
Pragma: "no-cache"
|
|
@@ -10039,8 +10127,8 @@ var SessionsResource = class {
|
|
|
10039
10127
|
* `GET /api/sessions/:id/events` — cursor-paged read of the session event
|
|
10040
10128
|
* log (`worker_protocol.*` dispatch markers, `pilot_coder.chunk` streaming
|
|
10041
10129
|
* chunks, `agent.*` lifecycle events...). Requires scope `runs:stream`.
|
|
10042
|
-
* Poll with `afterEventId` = the last
|
|
10043
|
-
* oldest-first.
|
|
10130
|
+
* Poll with `afterEventId` = the `eventId` of the last event you have
|
|
10131
|
+
* (not its `id`); rows are returned oldest-first.
|
|
10044
10132
|
*/
|
|
10045
10133
|
async listEvents(sessionId, options = {}) {
|
|
10046
10134
|
const path = `/api/sessions/${encodeURIComponent(sessionId)}/events`;
|
|
@@ -10414,7 +10502,7 @@ var SessionsResource = class {
|
|
|
10414
10502
|
}
|
|
10415
10503
|
}
|
|
10416
10504
|
const last = events[events.length - 1];
|
|
10417
|
-
if (last) cursor = last.
|
|
10505
|
+
if (last) cursor = last.eventId;
|
|
10418
10506
|
if (Date.now() - startedAt >= timeoutMs) {
|
|
10419
10507
|
throw new PilotPlatformApiError({
|
|
10420
10508
|
status: 0,
|
|
@@ -10480,11 +10568,11 @@ function sleep(ms, signal) {
|
|
|
10480
10568
|
}
|
|
10481
10569
|
|
|
10482
10570
|
// src/resources/workloads.ts
|
|
10483
|
-
var
|
|
10484
|
-
var CanaryPromoteResponseSchema =
|
|
10571
|
+
var import_zod75 = require("zod");
|
|
10572
|
+
var CanaryPromoteResponseSchema = import_zod75.z.object({
|
|
10485
10573
|
slot: StageSlotViewSchema,
|
|
10486
|
-
fromRevisionId:
|
|
10487
|
-
toRevisionId:
|
|
10574
|
+
fromRevisionId: import_zod75.z.string().uuid(),
|
|
10575
|
+
toRevisionId: import_zod75.z.string().uuid()
|
|
10488
10576
|
}).strict();
|
|
10489
10577
|
var WorkloadStageCanaryResource = class {
|
|
10490
10578
|
constructor(client) {
|