@kici-dev/engine 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/approval/types.d.ts +1 -1
- package/dist/approval/types.js +1 -1
- package/dist/audit/access-log-policy.js +9 -0
- package/dist/audit/activity.d.ts +3 -1
- package/dist/audit/activity.js +8 -16
- package/dist/audit/retention-policy.js +12 -0
- package/dist/environment/host-match.d.ts +25 -0
- package/dist/environment/host-match.js +67 -0
- package/dist/environment/index.d.ts +1 -0
- package/dist/environment/scope-resolver.d.ts +15 -4
- package/dist/environment/scope-resolver.js +55 -15
- package/dist/environment/scope-template.d.ts +18 -0
- package/dist/environment/scope-template.js +43 -0
- package/dist/environment/types.d.ts +7 -0
- package/dist/fanout/materialize.d.ts +55 -4
- package/dist/fanout/materialize.js +95 -49
- package/dist/index.d.ts +4 -2
- package/dist/index.js +14 -8
- package/dist/inputs/build.d.ts +9 -0
- package/dist/inputs/build.js +44 -0
- package/dist/inputs/coerce.d.ts +25 -0
- package/dist/inputs/coerce.js +51 -0
- package/dist/inputs/descriptor.d.ts +53 -0
- package/dist/inputs/descriptor.js +42 -0
- package/dist/inputs/extract.d.ts +15 -0
- package/dist/inputs/extract.js +117 -0
- package/dist/inputs/index.d.ts +5 -0
- package/dist/inputs/index.js +6 -0
- package/dist/inventory.d.ts +2 -2
- package/dist/labels/compile.d.ts +9 -0
- package/dist/labels/compile.js +10 -1
- package/dist/labels-match.d.ts +52 -0
- package/dist/labels-match.js +22 -1
- package/dist/labels.d.ts +29 -0
- package/dist/labels.js +32 -1
- package/dist/metrics/catalog-policy.d.ts +7 -0
- package/dist/metrics/catalog-policy.js +11 -12
- package/dist/metrics/metric-catalog.generated.d.ts +2 -2
- package/dist/metrics/metric-catalog.generated.js +10 -2
- package/dist/protocol/dashboard-write-operations.d.ts +8 -1
- package/dist/protocol/dashboard-write-operations.js +25 -4
- package/dist/protocol/messages/access-log.d.ts +40 -0
- package/dist/protocol/messages/access-log.js +9 -1
- package/dist/protocol/messages/auth.d.ts +2 -0
- package/dist/protocol/messages/capabilities.d.ts +2 -0
- package/dist/protocol/messages/dashboard.d.ts +766 -25
- package/dist/protocol/messages/dashboard.js +173 -9
- package/dist/protocol/messages/deployment-identity.d.ts +38 -0
- package/dist/protocol/messages/deployment-identity.js +28 -0
- package/dist/protocol/messages/orchestrator-agent.d.ts +64 -2
- package/dist/protocol/messages/orchestrator-agent.js +26 -7
- package/dist/protocol/messages/peer.js +1 -1
- package/dist/protocol/messages/platform-orchestrator.d.ts +197 -2
- package/dist/protocol/messages/run-events.d.ts +1 -1
- package/dist/protocol/messages/source-registration.d.ts +15 -0
- package/dist/protocol/messages/source-registration.js +17 -1
- package/dist/trigger/types.d.ts +114 -22
- package/dist/trigger/types.js +53 -12
- package/package.json +9 -1
- package/sbom.spdx.json +5 -5
|
@@ -15,20 +15,63 @@ let VariantKind = /* @__PURE__ */ function(VariantKind) {
|
|
|
15
15
|
return VariantKind;
|
|
16
16
|
}({});
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Why a fan-out produced no dispatchable children. Drives whether the zeroed
|
|
19
|
+
* job's synthetic terminal row is recorded as a failure or a skip:
|
|
20
|
+
*
|
|
21
|
+
* - `error` — a genuine failure: invalid matrix (zero combinations / over the
|
|
22
|
+
* cap), an unavailable roster, or `onUnreachable: 'fail'` with an absent host.
|
|
23
|
+
* The synthetic job is `failed`.
|
|
24
|
+
* - `narrowed-empty` — the fan-out intentionally resolved to zero usable hosts
|
|
25
|
+
* (e.g. `onUnreachable: 'skip'` skipped every unreachable host). The synthetic
|
|
26
|
+
* job is `skipped`.
|
|
27
|
+
*/
|
|
28
|
+
let FanoutCause = /* @__PURE__ */ function(FanoutCause) {
|
|
29
|
+
FanoutCause["error"] = "error";
|
|
30
|
+
FanoutCause["narrowedEmpty"] = "narrowed-empty";
|
|
31
|
+
return FanoutCause;
|
|
32
|
+
}({});
|
|
33
|
+
/**
|
|
34
|
+
* Thrown when a job's fan-out cannot be materialized into dispatchable children:
|
|
35
|
+
* an invalid matrix, an unavailable / zeroed host roster. The `cause` discriminates
|
|
36
|
+
* a genuine failure from an intentional narrow-to-empty so the caller can record
|
|
37
|
+
* the zeroed job's synthetic row as `failed` or `skipped` accordingly.
|
|
21
38
|
*/
|
|
22
39
|
var FanoutError = class FanoutError extends Error {
|
|
23
40
|
jobName;
|
|
41
|
+
cause;
|
|
24
42
|
name = "FanoutError";
|
|
25
|
-
constructor(jobName, message) {
|
|
43
|
+
constructor(jobName, message, cause = "error") {
|
|
26
44
|
super(message);
|
|
27
45
|
this.jobName = jobName;
|
|
46
|
+
this.cause = cause;
|
|
28
47
|
Object.setPrototypeOf(this, FanoutError.prototype);
|
|
29
48
|
}
|
|
30
49
|
};
|
|
31
50
|
/**
|
|
51
|
+
* Stamp a deterministic `fanoutIndex`/`fanoutTotal` onto each child of a
|
|
52
|
+
* multi-child fan-out. `fanoutIndex` is the child's rank in the order defined by
|
|
53
|
+
* `keyOf` (host: `agentId`; matrix: variant label), independent of emission
|
|
54
|
+
* order — the orchestrator's wave dispatch keys on `fanoutIndex`, so emission
|
|
55
|
+
* order need not be touched (this preserves the local-executor matrix naming
|
|
56
|
+
* order). A single child gets no position (non-fan-out job; `ctx.fanout` stays
|
|
57
|
+
* undefined). Mutates and returns the same array.
|
|
58
|
+
*/
|
|
59
|
+
function assignFanoutPositions(children, keyOf) {
|
|
60
|
+
if (children.length <= 1) return children;
|
|
61
|
+
const total = children.length;
|
|
62
|
+
const rank = /* @__PURE__ */ new Map();
|
|
63
|
+
[...children].sort((a, b) => keyOf(a).localeCompare(keyOf(b))).forEach((child, index) => rank.set(child, index));
|
|
64
|
+
for (const child of children) {
|
|
65
|
+
child.fanoutIndex = rank.get(child);
|
|
66
|
+
child.fanoutTotal = total;
|
|
67
|
+
}
|
|
68
|
+
return children;
|
|
69
|
+
}
|
|
70
|
+
/** Variant label of a child = the text inside the trailing `(...)` of its expanded name. */
|
|
71
|
+
function variantLabelOf(child) {
|
|
72
|
+
return child.expandedName.slice(child.baseName.length + 2, -1);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
32
75
|
* The job-config envelope fields that identify a materialized child: the
|
|
33
76
|
* expanded `name`, the `baseJobName` (what the agent exposes as `ctx.job.name`),
|
|
34
77
|
* and `matrixValues` (exposed as `ctx.matrix`). Every dispatch site spreads
|
|
@@ -40,10 +83,22 @@ function matrixEnvelopeFields(mat) {
|
|
|
40
83
|
return {
|
|
41
84
|
name: mat.expandedName,
|
|
42
85
|
baseJobName: mat.baseName,
|
|
43
|
-
...mat.variantValues && { matrixValues: mat.variantValues }
|
|
86
|
+
...mat.variantValues && { matrixValues: mat.variantValues },
|
|
87
|
+
...fanoutEnvelopeFields(mat)
|
|
44
88
|
};
|
|
45
89
|
}
|
|
46
90
|
/**
|
|
91
|
+
* The fan-out position envelope fields (`fanoutIndex`/`fanoutTotal`) of a
|
|
92
|
+
* materialized child, shared by the matrix + host envelope builders. Both are
|
|
93
|
+
* present together or absent together (a non-fan-out child has neither).
|
|
94
|
+
*/
|
|
95
|
+
function fanoutEnvelopeFields(mat) {
|
|
96
|
+
return mat.fanoutTotal !== void 0 ? {
|
|
97
|
+
fanoutIndex: mat.fanoutIndex,
|
|
98
|
+
fanoutTotal: mat.fanoutTotal
|
|
99
|
+
} : {};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
47
102
|
* Build materialized children from a resolved dynamic-matrix combination list
|
|
48
103
|
* (produced by the agent eval flow). Mirrors the static-matrix branch of
|
|
49
104
|
* {@link materializeFanout} but takes the already-resolved combinations and
|
|
@@ -53,21 +108,17 @@ function materializeResolvedMatrix(lockJob, combos) {
|
|
|
53
108
|
if (combos.length === 0) throw new FanoutError(lockJob.name, `dynamic matrix for job '${lockJob.name}' resolved to zero combinations`);
|
|
54
109
|
if (combos.length > 256) throw new FanoutError(lockJob.name, `dynamic matrix for job '${lockJob.name}' resolved to ${combos.length} combinations (max 256)`);
|
|
55
110
|
const jobs = [];
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
variantKind: "matrix",
|
|
65
|
-
variantValues
|
|
66
|
-
});
|
|
67
|
-
}
|
|
111
|
+
for (const variantValues of combos) jobs.push({
|
|
112
|
+
lockJob,
|
|
113
|
+
baseName: lockJob.name,
|
|
114
|
+
expandedName: formatExpandedJobName(lockJob.name, variantValues),
|
|
115
|
+
variantKind: "matrix",
|
|
116
|
+
variantValues
|
|
117
|
+
});
|
|
118
|
+
assignFanoutPositions(jobs, variantLabelOf);
|
|
68
119
|
return {
|
|
69
120
|
jobs,
|
|
70
|
-
expansionMap: new Map([[lockJob.name,
|
|
121
|
+
expansionMap: new Map([[lockJob.name, jobs.map((j) => j.expandedName)]])
|
|
71
122
|
};
|
|
72
123
|
}
|
|
73
124
|
/**
|
|
@@ -83,7 +134,8 @@ function hostEnvelopeFields(mat) {
|
|
|
83
134
|
...mat.pinnedAgentId && { pinnedAgentId: mat.pinnedAgentId },
|
|
84
135
|
...mat.host && { host: mat.host },
|
|
85
136
|
...mat.agent && { agent: mat.agent },
|
|
86
|
-
...mat.connectedInstanceId !== void 0 && { connectedInstanceId: mat.connectedInstanceId }
|
|
137
|
+
...mat.connectedInstanceId !== void 0 && { connectedInstanceId: mat.connectedInstanceId },
|
|
138
|
+
...fanoutEnvelopeFields(mat)
|
|
87
139
|
};
|
|
88
140
|
}
|
|
89
141
|
/**
|
|
@@ -97,24 +149,21 @@ function materializeResolvedHosts(lockJob, agents, maxHosts) {
|
|
|
97
149
|
if (agents.length === 0) throw new FanoutError(lockJob.name, `runsOnAll for job '${lockJob.name}' matched zero matching hosts`);
|
|
98
150
|
if (agents.length > maxHosts) throw new FanoutError(lockJob.name, `runsOnAll for job '${lockJob.name}' matched ${agents.length} hosts (max ${maxHosts})`);
|
|
99
151
|
const jobs = [];
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
connectedInstanceId: agent.connectedInstanceId ?? null
|
|
113
|
-
});
|
|
114
|
-
}
|
|
152
|
+
for (const agent of agents) jobs.push({
|
|
153
|
+
lockJob,
|
|
154
|
+
baseName: lockJob.name,
|
|
155
|
+
expandedName: `${lockJob.name} (${agent.host})`,
|
|
156
|
+
variantKind: "host",
|
|
157
|
+
pinnedAgentId: agent.agentId,
|
|
158
|
+
host: agent.host,
|
|
159
|
+
agent,
|
|
160
|
+
connectedInstanceId: agent.connectedInstanceId ?? null,
|
|
161
|
+
...agent.needsBringup && { needsBringup: true }
|
|
162
|
+
});
|
|
163
|
+
assignFanoutPositions(jobs, (child) => child.pinnedAgentId ?? "");
|
|
115
164
|
return {
|
|
116
165
|
jobs,
|
|
117
|
-
expansionMap: new Map([[lockJob.name,
|
|
166
|
+
expansionMap: new Map([[lockJob.name, jobs.map((j) => j.expandedName)]])
|
|
118
167
|
};
|
|
119
168
|
}
|
|
120
169
|
/**
|
|
@@ -151,19 +200,16 @@ function materializeFanout(staticJobs) {
|
|
|
151
200
|
const combos = applyIncludeExclude(expandMatrix(values), lockJob.include, lockJob.exclude);
|
|
152
201
|
if (combos.length === 0) throw new FanoutError(lockJob.name, `matrix for job '${lockJob.name}' expands to zero combinations`);
|
|
153
202
|
if (combos.length > 256) throw new FanoutError(lockJob.name, `matrix for job '${lockJob.name}' expands to ${combos.length} combinations (max 256)`);
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
expansionMap.set(lockJob.name, names);
|
|
203
|
+
const children = combos.map((variantValues) => ({
|
|
204
|
+
lockJob,
|
|
205
|
+
baseName: lockJob.name,
|
|
206
|
+
expandedName: formatExpandedJobName(lockJob.name, variantValues),
|
|
207
|
+
variantKind: "matrix",
|
|
208
|
+
variantValues
|
|
209
|
+
}));
|
|
210
|
+
assignFanoutPositions(children, variantLabelOf);
|
|
211
|
+
jobs.push(...children);
|
|
212
|
+
expansionMap.set(lockJob.name, children.map((j) => j.expandedName));
|
|
167
213
|
}
|
|
168
214
|
return {
|
|
169
215
|
jobs,
|
|
@@ -171,6 +217,6 @@ function materializeFanout(staticJobs) {
|
|
|
171
217
|
};
|
|
172
218
|
}
|
|
173
219
|
//#endregion
|
|
174
|
-
export { FanoutError, MAX_FANOUT_JOBS, VariantKind, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields };
|
|
220
|
+
export { FanoutCause, FanoutError, MAX_FANOUT_JOBS, VariantKind, fanoutEnvelopeFields, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields };
|
|
175
221
|
|
|
176
222
|
//# sourceMappingURL=materialize.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './protocol/messages/auth.js';
|
|
|
15
15
|
export * from './protocol/messages/capabilities.js';
|
|
16
16
|
export { webhookRelaySchema, webhookRelayStartSchema, webhookRelayChunkSchema, webhookAckSchema, WebhookRelayResult, WEBHOOK_RELAY_MAX_BODY_BYTES, WEBHOOK_RELAY_CHUNK_SIZE, executionEventSchema, logChunkSchema, peerDiscoverSchema, peerUpdateSchema, cacheStatsSchema, orchMetricsSchema, platformToOrchestratorMessageSchema, orchestratorToPlatformMessageSchema, type WebhookRelay, type WebhookRelayStart, type WebhookRelayChunk, type WebhookAck, type LogChunk, type PeerDiscover, type PeerUpdate, type CacheStats, type OrchMetrics, trustPolicyUpdateSchema, type TrustPolicyUpdate, staleCheckrunCleanupSchema, type StaleCheckrunCleanup, type PlatformToOrchestratorMessage, type OrchestratorToPlatformMessage, } from './protocol/messages/platform-orchestrator.js';
|
|
17
17
|
export * from './protocol/messages/execution-status.js';
|
|
18
|
+
export * from './protocol/messages/deployment-identity.js';
|
|
18
19
|
export * from './protocol/messages/scaler-event.js';
|
|
19
20
|
export * from './protocol/messages/event-log.js';
|
|
20
21
|
export * from './protocol/messages/access-log.js';
|
|
@@ -35,6 +36,7 @@ export * from './trigger/types.js';
|
|
|
35
36
|
export * from './trigger/trigger-event-type.js';
|
|
36
37
|
export * from './trigger/decision-trace.js';
|
|
37
38
|
export * from './trigger/matcher.js';
|
|
39
|
+
export * from './inputs/index.js';
|
|
38
40
|
export * from './state-machine/index.js';
|
|
39
41
|
export * from './provider/index.js';
|
|
40
42
|
export { githubWebhookPath } from './webhook/webhook-url-format.js';
|
|
@@ -45,10 +47,10 @@ export type { RateLimiterConfig, RateLimitResult } from './ws/rate-limiter.js';
|
|
|
45
47
|
export * from './env/environment-allowlist.js';
|
|
46
48
|
export * from './secrets/index.js';
|
|
47
49
|
export * from './environment/index.js';
|
|
48
|
-
export { deriveOsArchLabels, hostLabel, parseHostLabel, HOST_LABEL_PREFIX, agentTypeLabel, scalerLabel, mergeAutoLabels, normalizeRunsOn, KNOWN_ROLES, resolveRoleLabels, validateNoReservedLabels, scalerAgentLabels, isSelfReportedLabel, SELF_REPORTED_LABEL_PREFIXES, } from './labels.js';
|
|
50
|
+
export { deriveOsArchLabels, hostLabel, parseHostLabel, HOST_LABEL_PREFIX, agentTypeLabel, scalerLabel, mergeAutoLabels, normalizeRunsOn, KNOWN_ROLES, resolveRoleLabels, validateNoReservedLabels, scalerAgentLabels, isSelfReportedLabel, SELF_REPORTED_LABEL_PREFIXES, CAPABILITY_LABEL_PREFIX, capabilityLabel, SSH_TRANSPORT_CAPABILITY, INIT_LABEL, PRIVILEGED_ROOT_LABEL, } from './labels.js';
|
|
49
51
|
export type { NormalizedRunsOn } from './labels.js';
|
|
50
52
|
export type { AgentRole } from './labels.js';
|
|
51
|
-
export { LabelMatcher, matcherMatches, matcherSatisfiedBy, partitionMatchers, compileRegexMatcher, } from './labels-match.js';
|
|
53
|
+
export { LabelMatcher, matcherMatches, matcherSatisfiedBy, partitionMatchers, compileRegexMatcher, HostTargetValue, HostTargetSelector, hostSatisfiesTarget, } from './labels-match.js';
|
|
52
54
|
export * from './inventory.js';
|
|
53
55
|
export * from './scaler/scaler-backend-type.js';
|
|
54
56
|
export * from './scaler/resource-types.js';
|
package/dist/index.js
CHANGED
|
@@ -6,14 +6,17 @@ import { ActorType, actorPrincipalSchema, apiKeyActorSchema, flattenActor, parse
|
|
|
6
6
|
import { ORCH_CAPABILITIES, OrchRole, hasOrchCapability, orchCapabilitiesSchema } from "./protocol/messages/capabilities.js";
|
|
7
7
|
import { authFailureSchema, authRequestSchema, authSuccessSchema } from "./protocol/messages/auth.js";
|
|
8
8
|
import { CacheOutcome, CacheRunEventType, CacheStepType, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, InitFailureCategory, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TimeoutReason, executionStatusSchema, initFailureSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema } from "./protocol/messages/execution-status.js";
|
|
9
|
+
import { DeploymentContainerRuntimeSchema, DeploymentIdentitySchema, DeploymentModeSchema } from "./protocol/messages/deployment-identity.js";
|
|
9
10
|
import { SourceProvider, SourceSubtype, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema } from "./protocol/messages/source-registration.js";
|
|
10
11
|
import { AccessLogAction, AccessLogOutcome, AccessLogSource, AccessLogTargetType, accessLogFilterSchema, accessLogItemSchema, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema } from "./protocol/messages/access-log.js";
|
|
11
12
|
import { browserJobContextSchema, browserRunEventSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, jobContextMessageSchema, runEventMessageSchema } from "./protocol/messages/run-events.js";
|
|
12
13
|
import { EventLogSource, EventLogStatus, PayloadOmittedReason } from "./protocol/messages/event-log.js";
|
|
13
14
|
import { ScalerBackendType } from "./scaler/scaler-backend-type.js";
|
|
14
15
|
import { ApprovalDecision, HoldScope, TriggerSource, approvalRequirementSchema, approverClauseSchema } from "./approval/types.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
16
|
+
import { NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, RunsOnPick, SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, resolveWhenToRunOn } from "./trigger/types.js";
|
|
17
|
+
import { HostTargetSelector, HostTargetValue, LabelMatcher, compileRegexMatcher, hostSatisfiesTarget, matcherMatches, matcherSatisfiedBy, partitionMatchers } from "./labels-match.js";
|
|
18
|
+
import { HostInventoryEntry, HostPropertyValue, InventoryHostStatus, InventoryLifecycleClass, InventorySelectorSchema, coerceHostPropertyValue, parseHostPropertyAssignments } from "./inventory.js";
|
|
19
|
+
import { EnvDeleteErrorCode, EventLogPayloadStreamError, FleetHostDisposition, HeldRunQueueType, HeldRunStatus, TestRelayType, attestationListItemSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardFleetHostRequestSchema, dashboardFleetHostResponseSchema, dashboardFleetHostsRequestSchema, dashboardFleetHostsResponseSchema, dashboardFleetPreviewRequestSchema, dashboardFleetPreviewResponseSchema, dashboardFleetWorkflowsForHostRequestSchema, dashboardFleetWorkflowsForHostResponseSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, envBindingEntrySchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, fleetHostDeclareRequestSchema, fleetHostDeclareResponseSchema, fleetHostRemoveRequestSchema, fleetHostRemoveResponseSchema, fleetHostWorkflowSchema, fleetPinnedRunSchema, fleetPreviewHostSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, identityLinkItemSchema, identityLinkListResponseSchema, manualScheduleRequestSchema, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, orgMemberSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, runCancelRequestSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, trustPolicyResponseSchema } from "./protocol/messages/dashboard.js";
|
|
17
20
|
import { WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WebhookRelayResult, cacheStatsSchema, executionEventSchema, logChunkSchema, orchMetricsSchema, orchestratorToPlatformMessageSchema, peerDiscoverSchema, peerUpdateSchema, platformToOrchestratorMessageSchema, staleCheckrunCleanupSchema, trustPolicyUpdateSchema, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema } from "./protocol/messages/platform-orchestrator.js";
|
|
18
21
|
import { ScalerEventType } from "./protocol/messages/scaler-event.js";
|
|
19
22
|
import { AccessLogPolicyKind, POLICY_BY_ACTION, fnv1a32, shouldRecordAccess, shouldRecordSecretResolve } from "./audit/access-log-policy.js";
|
|
@@ -23,12 +26,16 @@ import { logPullOrchToPlatformSchema, logPullPlatformToOrchSchema } from "./prot
|
|
|
23
26
|
import { EVENT_LOG_PAYLOAD_CHUNK_BYTES } from "./protocol/event-log-payload.js";
|
|
24
27
|
import { browserAuthFailureSchema, browserAuthRefreshSchema, browserAuthRequestSchema, browserAuthSuccessSchema, browserErrorSchema, browserEventLogPayloadFetchSchema, browserGapSchema, browserJobNewSchema, browserJobStatusSchema, browserLogLinesSchema, browserLogStreamTerminatedReason, browserLogStreamTerminatedSchema, browserLogSubscribeSchema, browserLogUnsubscribeSchema, browserPingSchema, browserPongSchema, browserRunNewSchema, browserRunStatusSchema, browserStatusSubscribeSchema, browserStatusUnsubscribeSchema, browserStepStatusSchema, browserToPlatformMessageSchema, platformToBrowserMessageSchema } from "./protocol/messages/browser.js";
|
|
25
28
|
import { joinRequestSchema, joinResponseSchema } from "./protocol/messages/join.js";
|
|
26
|
-
import { LabelMatcher, compileRegexMatcher, matcherMatches, matcherSatisfiedBy, partitionMatchers } from "./labels-match.js";
|
|
27
29
|
import { fleetSelectionSchema, jobProgressAckSchema, jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema } from "./protocol/messages/peer.js";
|
|
28
|
-
import { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, registerAckSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, upstreamSnapshotSchema } from "./protocol/messages/orchestrator-agent.js";
|
|
30
|
+
import { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, registerAckSchema, stepApprovalPayloadSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, upstreamSnapshotSchema } from "./protocol/messages/orchestrator-agent.js";
|
|
29
31
|
import { TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES } from "./trigger/trigger-event-type.js";
|
|
30
32
|
import { createTraceEntry, createWorkflowDecision } from "./trigger/decision-trace.js";
|
|
31
33
|
import { matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchWorkflowTriggers } from "./trigger/matcher.js";
|
|
34
|
+
import { DispatchInputType, InputDescriptor, InputsDescriptorMapSchema } from "./inputs/descriptor.js";
|
|
35
|
+
import { UnsupportedDispatchInputError, extractInputDescriptor, extractInputsDescriptorMap } from "./inputs/extract.js";
|
|
36
|
+
import { buildZodFromDescriptor, buildZodObjectFromMap } from "./inputs/build.js";
|
|
37
|
+
import { DispatchInputError, coerceDispatchInputs, parseInputPairs } from "./inputs/coerce.js";
|
|
38
|
+
import "./inputs/index.js";
|
|
32
39
|
import { isTerminal, transition } from "./state-machine/machine.js";
|
|
33
40
|
import "./state-machine/index.js";
|
|
34
41
|
import { LockFileParseError } from "./provider/lock-file-parse-error.js";
|
|
@@ -41,13 +48,12 @@ import { AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, KICI_AGENT_ENV_PREFIX, S
|
|
|
41
48
|
import "./secrets/index.js";
|
|
42
49
|
import { matchScopePattern, resolveSecretsForEnvironment, stripScopePrefix } from "./environment/scope-resolver.js";
|
|
43
50
|
import "./environment/index.js";
|
|
44
|
-
import { HOST_LABEL_PREFIX, KNOWN_ROLES, SELF_REPORTED_LABEL_PREFIXES, agentTypeLabel, deriveOsArchLabels, hostLabel, isSelfReportedLabel, mergeAutoLabels, normalizeRunsOn, parseHostLabel, resolveRoleLabels, scalerAgentLabels, scalerLabel, validateNoReservedLabels } from "./labels.js";
|
|
45
|
-
import { HostInventoryEntry, HostPropertyValue, InventoryHostStatus, InventoryLifecycleClass, InventorySelectorSchema, coerceHostPropertyValue, parseHostPropertyAssignments } from "./inventory.js";
|
|
51
|
+
import { CAPABILITY_LABEL_PREFIX, HOST_LABEL_PREFIX, INIT_LABEL, KNOWN_ROLES, PRIVILEGED_ROOT_LABEL, SELF_REPORTED_LABEL_PREFIXES, SSH_TRANSPORT_CAPABILITY, agentTypeLabel, capabilityLabel, deriveOsArchLabels, hostLabel, isSelfReportedLabel, mergeAutoLabels, normalizeRunsOn, parseHostLabel, resolveRoleLabels, scalerAgentLabels, scalerLabel, validateNoReservedLabels } from "./labels.js";
|
|
46
52
|
import { parseMemoryString, resourceRequestNestedSchema, resourceSpecSchema, validateResourceRequest } from "./scaler/resource-types.js";
|
|
47
53
|
import { RegisterableTriggerType } from "./registration/registerable-trigger-type.js";
|
|
48
54
|
import { createWorkflowBundleConfig } from "./bundler/rolldown-config.js";
|
|
49
55
|
import "./bundler/index.js";
|
|
50
56
|
import { applyIncludeExclude, expandMatrix, expandMultiDimension, expandSingleDimension } from "./matrix/expand.js";
|
|
51
57
|
import { formatExpandedJobName, formatMatrixSuffix } from "./matrix/format.js";
|
|
52
|
-
import { FanoutError, MAX_FANOUT_JOBS, VariantKind, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields } from "./fanout/materialize.js";
|
|
53
|
-
export { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, AccessLogAction, AccessLogOutcome, AccessLogPolicyKind, AccessLogSource, AccessLogTargetType, ActivityFilterSource, ActivityRowSource, ActorType, ApprovalDecision, CacheOutcome, CacheRefScope, CacheRunEventType, CacheStepType, CheckMode, CheckRunConclusion, CheckStepOutcome, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EnvDeleteErrorCode, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, FanoutError, HOST_LABEL_PREFIX, HeldRunQueueType, HeldRunStatus, HoldScope, HostInventoryEntry, HostPropertyValue, IfFailedPolicy, InitFailureCategory, InventoryHostStatus, InventoryLifecycleClass, InventorySelectorSchema, JobRejectReason, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, LabelMatcher, LockFileParseError, MAX_FANOUT_JOBS, MIN_PROTOCOL_VERSION, NeedsEntrySchema, NeedsGroupEntrySchema, ORCH_CAPABILITIES, OnUnreachableMode, OrchRole, POLICY_BY_ACTION, PROTOCOL_VERSION, PayloadOmittedReason, RegisterableTriggerType, SANDBOX_DEFAULT_VARS, SCHEMA_VERSION, SELF_REPORTED_LABEL_PREFIXES, ScalerBackendType, ScalerEventType, SourceProvider, SourceSubtype, StepApprovalOutcome, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES, TestRelayType, TimeoutReason, TriggerSource, VariantKind, WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, WS_CLOSE_DISPATCH_ACK_TIMEOUT, WS_CLOSE_GOING_AWAY, WS_CLOSE_HEARTBEAT_TIMEOUT, WS_CLOSE_INTERNAL_ERROR, WS_CLOSE_INVALID_MESSAGE, WS_CLOSE_PLAN_LIMIT, WS_CLOSE_PROTOCOL_ERROR, WS_CLOSE_RUN_NOT_FOUND, WS_CLOSE_UNAUTHORIZED, WS_MAX_PAYLOAD_BYTES, WebhookRelayResult, WsRateLimiter, accessLogFilterSchema, accessLogItemSchema, accessLogWarmSqlCase, ackSchema, activityCursorSchema, activityFilterSchema, activityRowSchema, actorPrincipalSchema, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, agentTypeLabel, apiKeyActorSchema, applyIncludeExclude, approvalRequirementSchema, approverClauseSchema, attestationListItemSchema, auditLogColdDays, auditLogWarmDays, auditLogWarmSqlCase, authFailureSchema, authRequestSchema, authSuccessSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserAuthFailureSchema, browserAuthRefreshSchema, browserAuthRequestSchema, browserAuthSuccessSchema, browserErrorSchema, browserEventLogPayloadChunkSchema, browserEventLogPayloadFetchSchema, browserGapSchema, browserJobContextSchema, browserJobNewSchema, browserJobStatusSchema, browserLogLinesSchema, browserLogStreamTerminatedReason, browserLogStreamTerminatedSchema, browserLogSubscribeSchema, browserLogUnsubscribeSchema, browserPingSchema, browserPongSchema, browserRunEventSchema, browserRunNewSchema, browserRunStatusSchema, browserStatusSubscribeSchema, browserStatusUnsubscribeSchema, browserStepStatusSchema, browserToPlatformMessageSchema, cacheStatsSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, coerceHostPropertyValue, compileRegexMatcher, configAckSchema, createTraceEntry, createWorkflowBundleConfig, createWorkflowDecision, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, decodeActivityCursor, deriveOsArchLabels, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, encodeActivityCursor, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, errorSchema, eventEmitResponseSchema, eventEmitSchema, eventLogListItemSchema, executionEventSchema, executionStatusSchema, expandMatrix, expandMultiDimension, expandSingleDimension, flattenActor, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, fleetSelectionSchema, fnv1a32, formatExpandedJobName, formatMatrixSuffix, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, gitAuthSchema, githubWebhookPath, hasOrchCapability, heartbeatSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, hostEnvelopeFields, hostLabel, identityLinkItemSchema, identityLinkListResponseSchema, initFailureSchema, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, isSelfReportedLabel, isTerminal, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobContextMessageSchema, jobDispatchSchema, jobProgressAckSchema, jobProgressSchema, jobRejectSchema, jobRerouteAckSchema, jobRerouteSchema, jobStatusForwardSchema, jobStatusSchema, joinRequestSchema, joinResponseSchema, logChunkSchema, logPullOrchToPlatformSchema, logPullPlatformToOrchSchema, manualScheduleRequestSchema, matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchScopePattern, matchWorkflowTriggers, matcherMatches, matcherSatisfiedBy, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, mergeAutoLabels, minAccessLogWarmDays, minAuditLogWarmDays, minSecretAuditLogWarmDays, nackSchema, normalizeRunsOn, orchCapabilitiesSchema, orchMetricsSchema, orchestratorToAgentMessageSchema, orchestratorToPlatformMessageSchema, orgMemberSchema, parseActor, parseHostLabel, parseHostPropertyAssignments, parseMemoryString, partitionMatchers, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerDiscoverSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, peerUpdateSchema, platformOperatorActorSchema, platformToBrowserMessageSchema, platformToOrchestratorMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, registerAckSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, resolveRoleLabels, resolveRunIdSugar, resolveSecretsForEnvironment, resourceRequestNestedSchema, resourceSpecSchema, runCancelRequestSchema, runEventMessageSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, scalerAgentLabels, scalerLabel, secretAuditLogColdDays, secretAuditLogWarmDays, secretAuditLogWarmSqlCase, serviceAccountActorSchema, shouldRecordAccess, shouldRecordSecretResolve, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema, staleCheckrunCleanupSchema, stateReplaySchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, stepStatusForwardSchema, stringifyActor, stripScopePrefix, systemActorSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, transition, trustPolicyResponseSchema, trustPolicyUpdateSchema, upstreamSnapshotSchema, userActorSchema, validateNoReservedLabels, validateResourceRequest, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
|
|
58
|
+
import { FanoutCause, FanoutError, MAX_FANOUT_JOBS, VariantKind, fanoutEnvelopeFields, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields } from "./fanout/materialize.js";
|
|
59
|
+
export { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, AccessLogAction, AccessLogOutcome, AccessLogPolicyKind, AccessLogSource, AccessLogTargetType, ActivityFilterSource, ActivityRowSource, ActorType, ApprovalDecision, CAPABILITY_LABEL_PREFIX, CacheOutcome, CacheRefScope, CacheRunEventType, CacheStepType, CheckMode, CheckRunConclusion, CheckStepOutcome, DeploymentContainerRuntimeSchema, DeploymentIdentitySchema, DeploymentModeSchema, DispatchInputError, DispatchInputType, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EnvDeleteErrorCode, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, FanoutCause, FanoutError, FleetHostDisposition, HOST_LABEL_PREFIX, HeldRunQueueType, HeldRunStatus, HoldScope, HostInventoryEntry, HostPropertyValue, HostTargetSelector, HostTargetValue, INIT_LABEL, InitFailureCategory, InputDescriptor, InputsDescriptorMapSchema, InventoryHostStatus, InventoryLifecycleClass, InventorySelectorSchema, JobRejectReason, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, LabelMatcher, LockFileParseError, MAX_FANOUT_JOBS, MIN_PROTOCOL_VERSION, NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, ORCH_CAPABILITIES, OnUnreachableMode, OrchRole, POLICY_BY_ACTION, PRIVILEGED_ROOT_LABEL, PROTOCOL_VERSION, PayloadOmittedReason, RegisterableTriggerType, RunsOnPick, SANDBOX_DEFAULT_VARS, SCHEMA_VERSION, SELF_REPORTED_LABEL_PREFIXES, SSH_TRANSPORT_CAPABILITY, ScalerBackendType, ScalerEventType, SourceProvider, SourceSubtype, StepApprovalOutcome, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES, TestRelayType, TimeoutReason, TriggerSource, UnsupportedDispatchInputError, VariantKind, WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, WS_CLOSE_DISPATCH_ACK_TIMEOUT, WS_CLOSE_GOING_AWAY, WS_CLOSE_HEARTBEAT_TIMEOUT, WS_CLOSE_INTERNAL_ERROR, WS_CLOSE_INVALID_MESSAGE, WS_CLOSE_PLAN_LIMIT, WS_CLOSE_PROTOCOL_ERROR, WS_CLOSE_RUN_NOT_FOUND, WS_CLOSE_UNAUTHORIZED, WS_MAX_PAYLOAD_BYTES, WebhookRelayResult, WsRateLimiter, accessLogFilterSchema, accessLogItemSchema, accessLogWarmSqlCase, ackSchema, activityCursorSchema, activityFilterSchema, activityRowSchema, actorPrincipalSchema, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, agentTypeLabel, apiKeyActorSchema, applyIncludeExclude, approvalRequirementSchema, approverClauseSchema, attestationListItemSchema, auditLogColdDays, auditLogWarmDays, auditLogWarmSqlCase, authFailureSchema, authRequestSchema, authSuccessSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserAuthFailureSchema, browserAuthRefreshSchema, browserAuthRequestSchema, browserAuthSuccessSchema, browserErrorSchema, browserEventLogPayloadChunkSchema, browserEventLogPayloadFetchSchema, browserGapSchema, browserJobContextSchema, browserJobNewSchema, browserJobStatusSchema, browserLogLinesSchema, browserLogStreamTerminatedReason, browserLogStreamTerminatedSchema, browserLogSubscribeSchema, browserLogUnsubscribeSchema, browserPingSchema, browserPongSchema, browserRunEventSchema, browserRunNewSchema, browserRunStatusSchema, browserStatusSubscribeSchema, browserStatusUnsubscribeSchema, browserStepStatusSchema, browserToPlatformMessageSchema, buildZodFromDescriptor, buildZodObjectFromMap, cacheStatsSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, capabilityLabel, coerceDispatchInputs, coerceHostPropertyValue, compileRegexMatcher, configAckSchema, createTraceEntry, createWorkflowBundleConfig, createWorkflowDecision, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardFleetHostRequestSchema, dashboardFleetHostResponseSchema, dashboardFleetHostsRequestSchema, dashboardFleetHostsResponseSchema, dashboardFleetPreviewRequestSchema, dashboardFleetPreviewResponseSchema, dashboardFleetWorkflowsForHostRequestSchema, dashboardFleetWorkflowsForHostResponseSchema, dashboardJobDetailSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, decodeActivityCursor, deriveOsArchLabels, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, encodeActivityCursor, envBindingEntrySchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, errorSchema, eventEmitResponseSchema, eventEmitSchema, eventLogListItemSchema, executionEventSchema, executionStatusSchema, expandMatrix, expandMultiDimension, expandSingleDimension, extractInputDescriptor, extractInputsDescriptorMap, fanoutEnvelopeFields, flattenActor, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetHostDeclareRequestSchema, fleetHostDeclareResponseSchema, fleetHostRemoveRequestSchema, fleetHostRemoveResponseSchema, fleetHostWorkflowSchema, fleetLogsRequestSchema, fleetPinnedRunSchema, fleetPreviewHostSchema, fleetSelectionSchema, fnv1a32, formatExpandedJobName, formatMatrixSuffix, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, gitAuthSchema, githubWebhookPath, hasOrchCapability, heartbeatSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, hostEnvelopeFields, hostLabel, hostSatisfiesTarget, identityLinkItemSchema, identityLinkListResponseSchema, initFailureSchema, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, isSelfReportedLabel, isTerminal, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobContextMessageSchema, jobDispatchSchema, jobProgressAckSchema, jobProgressSchema, jobRejectSchema, jobRerouteAckSchema, jobRerouteSchema, jobStatusForwardSchema, jobStatusSchema, joinRequestSchema, joinResponseSchema, logChunkSchema, logPullOrchToPlatformSchema, logPullPlatformToOrchSchema, manualScheduleRequestSchema, matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchScopePattern, matchWorkflowTriggers, matcherMatches, matcherSatisfiedBy, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, mergeAutoLabels, minAccessLogWarmDays, minAuditLogWarmDays, minSecretAuditLogWarmDays, nackSchema, normalizeRunsOn, orchCapabilitiesSchema, orchMetricsSchema, orchestratorToAgentMessageSchema, orchestratorToPlatformMessageSchema, orgMemberSchema, parseActor, parseHostLabel, parseHostPropertyAssignments, parseInputPairs, parseMemoryString, partitionMatchers, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerDiscoverSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, peerUpdateSchema, platformOperatorActorSchema, platformToBrowserMessageSchema, platformToOrchestratorMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, registerAckSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, resolveRoleLabels, resolveRunIdSugar, resolveSecretsForEnvironment, resolveWhenToRunOn, resourceRequestNestedSchema, resourceSpecSchema, runCancelRequestSchema, runEventMessageSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, scalerAgentLabels, scalerLabel, secretAuditLogColdDays, secretAuditLogWarmDays, secretAuditLogWarmSqlCase, serviceAccountActorSchema, shouldRecordAccess, shouldRecordSecretResolve, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema, staleCheckrunCleanupSchema, stateReplaySchema, stepApprovalPayloadSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, stepStatusForwardSchema, stringifyActor, stripScopePrefix, systemActorSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, transition, trustPolicyResponseSchema, trustPolicyUpdateSchema, upstreamSnapshotSchema, userActorSchema, validateNoReservedLabels, validateResourceRequest, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { InputDescriptorT, InputsDescriptorMap } from './descriptor.js';
|
|
3
|
+
/** Rebuild a real coercing Zod schema from a descriptor. */
|
|
4
|
+
export declare function buildZodFromDescriptor(d: InputDescriptorT): z.ZodType;
|
|
5
|
+
/** Rebuild a strict (unknown-key-rejecting) `z.object` from a descriptor map. */
|
|
6
|
+
export declare function buildZodObjectFromMap(map: InputsDescriptorMap): z.ZodObject<{
|
|
7
|
+
[x: string]: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import "../chunk-BTugEXQM.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/inputs/build.ts
|
|
4
|
+
/** Build the base (unwrapped) coercing schema for a descriptor. */
|
|
5
|
+
function base(d) {
|
|
6
|
+
switch (d.type) {
|
|
7
|
+
case "string": {
|
|
8
|
+
let s = z.string();
|
|
9
|
+
if (d.min !== void 0) s = s.min(d.min);
|
|
10
|
+
if (d.max !== void 0) s = s.max(d.max);
|
|
11
|
+
if (d.pattern !== void 0) s = s.regex(new RegExp(d.pattern));
|
|
12
|
+
return s;
|
|
13
|
+
}
|
|
14
|
+
case "number":
|
|
15
|
+
case "integer": {
|
|
16
|
+
let n = z.coerce.number();
|
|
17
|
+
if (d.type === "integer") n = n.int();
|
|
18
|
+
if (d.min !== void 0) n = n.min(d.min);
|
|
19
|
+
if (d.max !== void 0) n = n.max(d.max);
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
case "boolean": return z.stringbool();
|
|
23
|
+
case "enum": return z.enum(d.values ?? []);
|
|
24
|
+
case "literal": return z.literal(d.literal);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** Rebuild a real coercing Zod schema from a descriptor. */
|
|
28
|
+
function buildZodFromDescriptor(d) {
|
|
29
|
+
let schema = base(d);
|
|
30
|
+
if (d.nullable) schema = schema.nullable();
|
|
31
|
+
if (d.default !== void 0) schema = schema.default(d.default);
|
|
32
|
+
else if (d.optional) schema = schema.optional();
|
|
33
|
+
return schema;
|
|
34
|
+
}
|
|
35
|
+
/** Rebuild a strict (unknown-key-rejecting) `z.object` from a descriptor map. */
|
|
36
|
+
function buildZodObjectFromMap(map) {
|
|
37
|
+
const shape = {};
|
|
38
|
+
for (const [k, d] of Object.entries(map)) shape[k] = buildZodFromDescriptor(d);
|
|
39
|
+
return z.object(shape).strict();
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { buildZodFromDescriptor, buildZodObjectFromMap };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { InputsDescriptorMap } from './descriptor.js';
|
|
2
|
+
/** A single normalized validation issue for one dispatch input key. */
|
|
3
|
+
export interface DispatchInputIssue {
|
|
4
|
+
key: string;
|
|
5
|
+
code: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
/** Structured rejection for invalid dispatch inputs (CLI + dashboard rendering). */
|
|
9
|
+
export declare class DispatchInputError extends Error {
|
|
10
|
+
readonly issues: DispatchInputIssue[];
|
|
11
|
+
constructor(issues: DispatchInputIssue[]);
|
|
12
|
+
}
|
|
13
|
+
/** Split `key=value` pairs; throws `DispatchInputError` on a missing `=`. */
|
|
14
|
+
export declare function parseInputPairs(pairs: string[]): Record<string, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Coerce + validate raw operator pairs against the descriptor map, applying
|
|
17
|
+
* defaults. Strict: unknown keys are errors. Returns typed values or a
|
|
18
|
+
* structured `DispatchInputError`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function coerceDispatchInputs(raw: Record<string, string>, map: InputsDescriptorMap): {
|
|
21
|
+
values: Record<string, unknown>;
|
|
22
|
+
} | {
|
|
23
|
+
error: DispatchInputError;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=coerce.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import "../chunk-BTugEXQM.js";
|
|
2
|
+
import { buildZodObjectFromMap } from "./build.js";
|
|
3
|
+
//#region src/inputs/coerce.ts
|
|
4
|
+
/** Structured rejection for invalid dispatch inputs (CLI + dashboard rendering). */
|
|
5
|
+
var DispatchInputError = class extends Error {
|
|
6
|
+
issues;
|
|
7
|
+
constructor(issues) {
|
|
8
|
+
super(`Invalid dispatch inputs: ${issues.map((i) => `${i.key}: ${i.message}`).join("; ")}`);
|
|
9
|
+
this.issues = issues;
|
|
10
|
+
this.name = "DispatchInputError";
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
/** Split `key=value` pairs; throws `DispatchInputError` on a missing `=`. */
|
|
14
|
+
function parseInputPairs(pairs) {
|
|
15
|
+
const out = {};
|
|
16
|
+
for (const p of pairs) {
|
|
17
|
+
const eq = p.indexOf("=");
|
|
18
|
+
if (eq <= 0) throw new DispatchInputError([{
|
|
19
|
+
key: p,
|
|
20
|
+
code: "malformed",
|
|
21
|
+
message: `expected key=value, got "${p}"`
|
|
22
|
+
}]);
|
|
23
|
+
out[p.slice(0, eq)] = p.slice(eq + 1);
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Coerce + validate raw operator pairs against the descriptor map, applying
|
|
29
|
+
* defaults. Strict: unknown keys are errors. Returns typed values or a
|
|
30
|
+
* structured `DispatchInputError`.
|
|
31
|
+
*/
|
|
32
|
+
function coerceDispatchInputs(raw, map) {
|
|
33
|
+
const parsed = buildZodObjectFromMap(map).safeParse(raw);
|
|
34
|
+
if (parsed.success) return { values: parsed.data };
|
|
35
|
+
return { error: new DispatchInputError(parsed.error.issues.flatMap((i) => {
|
|
36
|
+
if (i.code === "unrecognized_keys" && Array.isArray(i.keys)) return i.keys.map((k) => ({
|
|
37
|
+
key: k,
|
|
38
|
+
code: i.code,
|
|
39
|
+
message: `unknown input "${k}"`
|
|
40
|
+
}));
|
|
41
|
+
return [{
|
|
42
|
+
key: String(i.path[0] ?? "(root)"),
|
|
43
|
+
code: i.code,
|
|
44
|
+
message: i.message
|
|
45
|
+
}];
|
|
46
|
+
})) };
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { DispatchInputError, coerceDispatchInputs, parseInputPairs };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=coerce.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The closed set of input value types persisted in the lockfile. */
|
|
3
|
+
export declare const DispatchInputType: z.ZodEnum<{
|
|
4
|
+
string: "string";
|
|
5
|
+
number: "number";
|
|
6
|
+
boolean: "boolean";
|
|
7
|
+
enum: "enum";
|
|
8
|
+
literal: "literal";
|
|
9
|
+
integer: "integer";
|
|
10
|
+
}>;
|
|
11
|
+
export type DispatchInputTypeT = z.infer<typeof DispatchInputType>;
|
|
12
|
+
/** JSON-safe, lossless descriptor of one declared dispatch input. */
|
|
13
|
+
export declare const InputDescriptor: z.ZodObject<{
|
|
14
|
+
type: z.ZodEnum<{
|
|
15
|
+
string: "string";
|
|
16
|
+
number: "number";
|
|
17
|
+
boolean: "boolean";
|
|
18
|
+
enum: "enum";
|
|
19
|
+
literal: "literal";
|
|
20
|
+
integer: "integer";
|
|
21
|
+
}>;
|
|
22
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
nullable: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
25
|
+
values: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
26
|
+
literal: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
27
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
30
|
+
description: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type InputDescriptorT = z.infer<typeof InputDescriptor>;
|
|
33
|
+
export declare const InputsDescriptorMapSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
34
|
+
type: z.ZodEnum<{
|
|
35
|
+
string: "string";
|
|
36
|
+
number: "number";
|
|
37
|
+
boolean: "boolean";
|
|
38
|
+
enum: "enum";
|
|
39
|
+
literal: "literal";
|
|
40
|
+
integer: "integer";
|
|
41
|
+
}>;
|
|
42
|
+
optional: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
nullable: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
+
default: z.ZodOptional<z.ZodUnknown>;
|
|
45
|
+
values: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
46
|
+
literal: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
47
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
50
|
+
description: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
export type InputsDescriptorMap = z.infer<typeof InputsDescriptorMapSchema>;
|
|
53
|
+
//# sourceMappingURL=descriptor.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import "../chunk-BTugEXQM.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/inputs/descriptor.ts
|
|
4
|
+
/** The closed set of input value types persisted in the lockfile. */
|
|
5
|
+
const DispatchInputType = z.enum([
|
|
6
|
+
"string",
|
|
7
|
+
"number",
|
|
8
|
+
"integer",
|
|
9
|
+
"boolean",
|
|
10
|
+
"enum",
|
|
11
|
+
"literal"
|
|
12
|
+
]);
|
|
13
|
+
/** JSON-safe, lossless descriptor of one declared dispatch input. */
|
|
14
|
+
const InputDescriptor = z.object({
|
|
15
|
+
type: DispatchInputType,
|
|
16
|
+
optional: z.boolean().default(false),
|
|
17
|
+
nullable: z.boolean().default(false),
|
|
18
|
+
/** Present iff the author set `.default()`. */
|
|
19
|
+
default: z.unknown().optional(),
|
|
20
|
+
/** Enum members (type === 'enum'). */
|
|
21
|
+
values: z.array(z.union([
|
|
22
|
+
z.string(),
|
|
23
|
+
z.number(),
|
|
24
|
+
z.boolean()
|
|
25
|
+
])).optional(),
|
|
26
|
+
/** Literal value (type === 'literal'). */
|
|
27
|
+
literal: z.union([
|
|
28
|
+
z.string(),
|
|
29
|
+
z.number(),
|
|
30
|
+
z.boolean()
|
|
31
|
+
]).optional(),
|
|
32
|
+
min: z.number().optional(),
|
|
33
|
+
max: z.number().optional(),
|
|
34
|
+
/** Regex source (type === 'string'). */
|
|
35
|
+
pattern: z.string().optional(),
|
|
36
|
+
description: z.string().optional()
|
|
37
|
+
});
|
|
38
|
+
const InputsDescriptorMapSchema = z.record(z.string(), InputDescriptor);
|
|
39
|
+
//#endregion
|
|
40
|
+
export { DispatchInputType, InputDescriptor, InputsDescriptorMapSchema };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=descriptor.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InputDescriptorT, InputsDescriptorMap } from './descriptor.js';
|
|
2
|
+
/** Thrown when a declared dispatch input falls outside the closed Zod subset. */
|
|
3
|
+
export declare class UnsupportedDispatchInputError extends Error {
|
|
4
|
+
readonly construct: string;
|
|
5
|
+
readonly key?: string | undefined;
|
|
6
|
+
constructor(construct: string, key?: string | undefined);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Walk a Zod schema's `_zod.def`, reject any construct outside the closed
|
|
10
|
+
* subset, and extract a JSON-safe `InputDescriptor`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractInputDescriptor(schema: unknown, key?: string): InputDescriptorT;
|
|
13
|
+
/** Extract a descriptor for every key in a `{ name: ZodSchema }` map. */
|
|
14
|
+
export declare function extractInputsDescriptorMap(map: Record<string, unknown>): InputsDescriptorMap;
|
|
15
|
+
//# sourceMappingURL=extract.d.ts.map
|