@kici-dev/engine 0.1.22 → 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/audit/access-log-policy.js +2 -0
- package/dist/audit/activity.d.ts +3 -1
- package/dist/audit/activity.js +8 -16
- package/dist/audit/retention-policy.js +4 -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 +34 -0
- package/dist/fanout/materialize.js +72 -45
- package/dist/index.d.ts +2 -1
- package/dist/index.js +10 -5
- 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/labels/compile.d.ts +9 -0
- package/dist/labels/compile.js +10 -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/messages/access-log.d.ts +15 -0
- package/dist/protocol/messages/access-log.js +4 -1
- package/dist/protocol/messages/dashboard.d.ts +146 -6
- package/dist/protocol/messages/dashboard.js +50 -10
- package/dist/protocol/messages/platform-orchestrator.d.ts +33 -3
- package/dist/protocol/messages/run-events.d.ts +1 -1
- package/dist/trigger/types.d.ts +41 -1
- package/dist/trigger/types.js +14 -2
- package/package.json +9 -1
- package/sbom.spdx.json +5 -5
package/dist/index.js
CHANGED
|
@@ -13,10 +13,10 @@ import { browserJobContextSchema, browserRunEventSchema, dashboardOrchLogsReques
|
|
|
13
13
|
import { EventLogSource, EventLogStatus, PayloadOmittedReason } from "./protocol/messages/event-log.js";
|
|
14
14
|
import { ScalerBackendType } from "./scaler/scaler-backend-type.js";
|
|
15
15
|
import { ApprovalDecision, HoldScope, TriggerSource, approvalRequirementSchema, approverClauseSchema } from "./approval/types.js";
|
|
16
|
-
import { NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, resolveWhenToRunOn } from "./trigger/types.js";
|
|
16
|
+
import { NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, RunsOnPick, SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, resolveWhenToRunOn } from "./trigger/types.js";
|
|
17
17
|
import { HostTargetSelector, HostTargetValue, LabelMatcher, compileRegexMatcher, hostSatisfiesTarget, matcherMatches, matcherSatisfiedBy, partitionMatchers } from "./labels-match.js";
|
|
18
18
|
import { HostInventoryEntry, HostPropertyValue, InventoryHostStatus, InventoryLifecycleClass, InventorySelectorSchema, coerceHostPropertyValue, parseHostPropertyAssignments } from "./inventory.js";
|
|
19
|
-
import { EnvDeleteErrorCode, EventLogPayloadStreamError, 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, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, 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, 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";
|
|
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";
|
|
20
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";
|
|
21
21
|
import { ScalerEventType } from "./protocol/messages/scaler-event.js";
|
|
22
22
|
import { AccessLogPolicyKind, POLICY_BY_ACTION, fnv1a32, shouldRecordAccess, shouldRecordSecretResolve } from "./audit/access-log-policy.js";
|
|
@@ -31,6 +31,11 @@ import { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSch
|
|
|
31
31
|
import { TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES } from "./trigger/trigger-event-type.js";
|
|
32
32
|
import { createTraceEntry, createWorkflowDecision } from "./trigger/decision-trace.js";
|
|
33
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";
|
|
34
39
|
import { isTerminal, transition } from "./state-machine/machine.js";
|
|
35
40
|
import "./state-machine/index.js";
|
|
36
41
|
import { LockFileParseError } from "./provider/lock-file-parse-error.js";
|
|
@@ -43,12 +48,12 @@ import { AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, KICI_AGENT_ENV_PREFIX, S
|
|
|
43
48
|
import "./secrets/index.js";
|
|
44
49
|
import { matchScopePattern, resolveSecretsForEnvironment, stripScopePrefix } from "./environment/scope-resolver.js";
|
|
45
50
|
import "./environment/index.js";
|
|
46
|
-
import { HOST_LABEL_PREFIX, KNOWN_ROLES, SELF_REPORTED_LABEL_PREFIXES, agentTypeLabel, deriveOsArchLabels, hostLabel, isSelfReportedLabel, mergeAutoLabels, normalizeRunsOn, parseHostLabel, resolveRoleLabels, scalerAgentLabels, scalerLabel, validateNoReservedLabels } from "./labels.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";
|
|
47
52
|
import { parseMemoryString, resourceRequestNestedSchema, resourceSpecSchema, validateResourceRequest } from "./scaler/resource-types.js";
|
|
48
53
|
import { RegisterableTriggerType } from "./registration/registerable-trigger-type.js";
|
|
49
54
|
import { createWorkflowBundleConfig } from "./bundler/rolldown-config.js";
|
|
50
55
|
import "./bundler/index.js";
|
|
51
56
|
import { applyIncludeExclude, expandMatrix, expandMultiDimension, expandSingleDimension } from "./matrix/expand.js";
|
|
52
57
|
import { formatExpandedJobName, formatMatrixSuffix } from "./matrix/format.js";
|
|
53
|
-
import { FanoutCause, FanoutError, MAX_FANOUT_JOBS, VariantKind, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields } from "./fanout/materialize.js";
|
|
54
|
-
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, DeploymentContainerRuntimeSchema, DeploymentIdentitySchema, DeploymentModeSchema, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EnvDeleteErrorCode, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, FanoutCause, FanoutError, HOST_LABEL_PREFIX, HeldRunQueueType, HeldRunStatus, HoldScope, HostInventoryEntry, HostPropertyValue, HostTargetSelector, HostTargetValue, InitFailureCategory, 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, 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, dashboardFleetHostRequestSchema, dashboardFleetHostResponseSchema, dashboardFleetHostsRequestSchema, dashboardFleetHostsResponseSchema, dashboardFleetPreviewRequestSchema, dashboardFleetPreviewResponseSchema, 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, fleetHostDeclareRequestSchema, fleetHostDeclareResponseSchema, fleetHostRemoveRequestSchema, fleetHostRemoveResponseSchema, 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, 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 };
|
|
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
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import "../chunk-BTugEXQM.js";
|
|
2
|
+
//#region src/inputs/extract.ts
|
|
3
|
+
/** Thrown when a declared dispatch input falls outside the closed Zod subset. */
|
|
4
|
+
var UnsupportedDispatchInputError = class extends Error {
|
|
5
|
+
construct;
|
|
6
|
+
key;
|
|
7
|
+
constructor(construct, key) {
|
|
8
|
+
super(`Unsupported dispatch input${key ? ` "${key}"` : ""}: ${construct}. Allowed: z.string/number/boolean/enum/literal with .optional/.nullable/.default/.min/.max/.regex/.int.`);
|
|
9
|
+
this.construct = construct;
|
|
10
|
+
this.key = key;
|
|
11
|
+
this.name = "UnsupportedDispatchInputError";
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const defOf = (s) => s?._zod?.def;
|
|
15
|
+
const checkDefOf = (c) => c?._zod?.def;
|
|
16
|
+
/** Pull string/number checks (min/max/int/regex) into descriptor fields. */
|
|
17
|
+
function applyChecks(d, checks, key) {
|
|
18
|
+
for (const c of checks ?? []) {
|
|
19
|
+
const cd = checkDefOf(c);
|
|
20
|
+
switch (cd?.check) {
|
|
21
|
+
case "greater_than":
|
|
22
|
+
d.min = Number(cd.value);
|
|
23
|
+
break;
|
|
24
|
+
case "less_than":
|
|
25
|
+
d.max = Number(cd.value);
|
|
26
|
+
break;
|
|
27
|
+
case "min_length":
|
|
28
|
+
d.min = Number(cd.minimum);
|
|
29
|
+
break;
|
|
30
|
+
case "max_length":
|
|
31
|
+
d.max = Number(cd.maximum);
|
|
32
|
+
break;
|
|
33
|
+
case "string_format":
|
|
34
|
+
if (cd.format === "regex" && cd.pattern) d.pattern = String(typeof cd.pattern === "object" ? cd.pattern.source ?? cd.pattern : cd.pattern);
|
|
35
|
+
else throw new UnsupportedDispatchInputError(`string format:${cd.format ?? "unknown"}`, key);
|
|
36
|
+
break;
|
|
37
|
+
case "number_format":
|
|
38
|
+
if (cd.format === "safeint" || cd.format === "int") d.type = "integer";
|
|
39
|
+
else throw new UnsupportedDispatchInputError(`number format:${cd.format ?? "unknown"}`, key);
|
|
40
|
+
break;
|
|
41
|
+
default: throw new UnsupportedDispatchInputError(`check:${cd?.check ?? "unknown"}`, key);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Walk a Zod schema's `_zod.def`, reject any construct outside the closed
|
|
47
|
+
* subset, and extract a JSON-safe `InputDescriptor`.
|
|
48
|
+
*/
|
|
49
|
+
function extractInputDescriptor(schema, key) {
|
|
50
|
+
let cur = schema;
|
|
51
|
+
let optional = false;
|
|
52
|
+
let nullable = false;
|
|
53
|
+
let hasDefault = false;
|
|
54
|
+
let defaultValue;
|
|
55
|
+
for (;;) {
|
|
56
|
+
const d = defOf(cur);
|
|
57
|
+
if (!d) throw new UnsupportedDispatchInputError("non-zod value", key);
|
|
58
|
+
if (d.type === "optional") {
|
|
59
|
+
optional = true;
|
|
60
|
+
cur = d.innerType;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (d.type === "nullable") {
|
|
64
|
+
nullable = true;
|
|
65
|
+
cur = d.innerType;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (d.type === "default") {
|
|
69
|
+
hasDefault = true;
|
|
70
|
+
defaultValue = typeof d.defaultValue === "function" ? d.defaultValue() : d.defaultValue;
|
|
71
|
+
cur = d.innerType;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
const d = defOf(cur);
|
|
77
|
+
if (!d) throw new UnsupportedDispatchInputError("non-zod value", key);
|
|
78
|
+
const out = {
|
|
79
|
+
type: "string",
|
|
80
|
+
optional,
|
|
81
|
+
nullable
|
|
82
|
+
};
|
|
83
|
+
if (hasDefault) out.default = defaultValue;
|
|
84
|
+
switch (d.type) {
|
|
85
|
+
case "string":
|
|
86
|
+
out.type = "string";
|
|
87
|
+
applyChecks(out, d.checks, key);
|
|
88
|
+
break;
|
|
89
|
+
case "number":
|
|
90
|
+
out.type = "number";
|
|
91
|
+
applyChecks(out, d.checks, key);
|
|
92
|
+
break;
|
|
93
|
+
case "boolean":
|
|
94
|
+
out.type = "boolean";
|
|
95
|
+
break;
|
|
96
|
+
case "enum":
|
|
97
|
+
out.type = "enum";
|
|
98
|
+
out.values = Object.values(d.entries ?? {});
|
|
99
|
+
break;
|
|
100
|
+
case "literal":
|
|
101
|
+
out.type = "literal";
|
|
102
|
+
out.literal = d.values?.[0] ?? d.value;
|
|
103
|
+
break;
|
|
104
|
+
default: throw new UnsupportedDispatchInputError(`z.${d.type}`, key);
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
/** Extract a descriptor for every key in a `{ name: ZodSchema }` map. */
|
|
109
|
+
function extractInputsDescriptorMap(map) {
|
|
110
|
+
const out = {};
|
|
111
|
+
for (const [k, v] of Object.entries(map)) out[k] = extractInputDescriptor(v, k);
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { UnsupportedDispatchInputError, extractInputDescriptor, extractInputsDescriptorMap };
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=extract.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "../chunk-BTugEXQM.js";
|
|
2
|
+
import { DispatchInputType, InputDescriptor, InputsDescriptorMapSchema } from "./descriptor.js";
|
|
3
|
+
import { UnsupportedDispatchInputError, extractInputDescriptor, extractInputsDescriptorMap } from "./extract.js";
|
|
4
|
+
import { buildZodFromDescriptor, buildZodObjectFromMap } from "./build.js";
|
|
5
|
+
import { DispatchInputError, coerceDispatchInputs, parseInputPairs } from "./coerce.js";
|
|
6
|
+
export { DispatchInputError, DispatchInputType, InputDescriptor, InputsDescriptorMapSchema, UnsupportedDispatchInputError, buildZodFromDescriptor, buildZodObjectFromMap, coerceDispatchInputs, extractInputDescriptor, extractInputsDescriptorMap, parseInputPairs };
|
package/dist/labels/compile.d.ts
CHANGED
|
@@ -15,9 +15,12 @@ export declare function assertSafeRegex(source: string, flags: string, ctx: stri
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function toLabelMatcher(el: string | RegExp, ctx: string): LabelMatcher;
|
|
17
17
|
export type SelectorEl = string | RegExp;
|
|
18
|
+
/** Single-agent selection policy when multiple agents match a `runsOn` selector. */
|
|
19
|
+
export type RunsOnPickInput = 'deterministic' | 'any';
|
|
18
20
|
export type RunsOnAuthorInput = SelectorEl | readonly SelectorEl[] | {
|
|
19
21
|
labels: SelectorEl | readonly SelectorEl[];
|
|
20
22
|
exclude?: SelectorEl | readonly SelectorEl[];
|
|
23
|
+
pick?: RunsOnPickInput;
|
|
21
24
|
};
|
|
22
25
|
export type RunsOnAllAuthorInput = string | RegExp | readonly SelectorEl[] | {
|
|
23
26
|
include: readonly {
|
|
@@ -30,6 +33,12 @@ export declare function normalizeRunsOnToMatchers(runsOn: RunsOnAuthorInput, ctx
|
|
|
30
33
|
include: LabelMatcher[];
|
|
31
34
|
exclude: LabelMatcher[];
|
|
32
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Resolve a `runsOn` author value's single-agent selection policy, defaulting to
|
|
38
|
+
* `'deterministic'` for every form (string / array shorthand inherit the default
|
|
39
|
+
* after normalization; the selector object's explicit `pick` wins).
|
|
40
|
+
*/
|
|
41
|
+
export declare function runsOnPickFromInput(runsOn: RunsOnAuthorInput): RunsOnPickInput;
|
|
33
42
|
/** Normalize a `runsOnAll` author value into include groups + exclude matchers. */
|
|
34
43
|
export declare function normalizeRunsOnAllToMatchers(input: RunsOnAllAuthorInput, ctx: string): {
|
|
35
44
|
include: LabelMatcher[][];
|
package/dist/labels/compile.js
CHANGED
|
@@ -59,6 +59,15 @@ function normalizeRunsOnToMatchers(runsOn, ctx) {
|
|
|
59
59
|
exclude: sel.exclude ? asArray(sel.exclude).map((e) => toLabelMatcher(e, ctx)) : []
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Resolve a `runsOn` author value's single-agent selection policy, defaulting to
|
|
64
|
+
* `'deterministic'` for every form (string / array shorthand inherit the default
|
|
65
|
+
* after normalization; the selector object's explicit `pick` wins).
|
|
66
|
+
*/
|
|
67
|
+
function runsOnPickFromInput(runsOn) {
|
|
68
|
+
if (typeof runsOn === "string" || runsOn instanceof RegExp || Array.isArray(runsOn)) return "deterministic";
|
|
69
|
+
return runsOn.pick ?? "deterministic";
|
|
70
|
+
}
|
|
62
71
|
/** Normalize a `runsOnAll` author value into include groups + exclude matchers. */
|
|
63
72
|
function normalizeRunsOnAllToMatchers(input, ctx) {
|
|
64
73
|
if (typeof input === "string" || input instanceof RegExp) return {
|
|
@@ -86,6 +95,6 @@ function assertMatchersSafe(matchers, ctx) {
|
|
|
86
95
|
for (const m of matchers) if (m.kind === "regex") assertSafeRegex(m.source, m.flags, ctx);
|
|
87
96
|
}
|
|
88
97
|
//#endregion
|
|
89
|
-
export { assertMatchersSafe, assertSafeRegex, normalizeRunsOnAllToMatchers, normalizeRunsOnToMatchers, toLabelMatcher };
|
|
98
|
+
export { assertMatchersSafe, assertSafeRegex, normalizeRunsOnAllToMatchers, normalizeRunsOnToMatchers, runsOnPickFromInput, toLabelMatcher };
|
|
90
99
|
|
|
91
100
|
//# sourceMappingURL=compile.js.map
|
package/dist/labels.d.ts
CHANGED
|
@@ -79,6 +79,35 @@ export declare const KNOWN_ROLES: readonly ["builder", "init-runner"];
|
|
|
79
79
|
export type AgentRole = (typeof KNOWN_ROLES)[number];
|
|
80
80
|
/** Reserved label prefix — labels starting with this are system-managed. */
|
|
81
81
|
export declare const RESERVED_LABEL_PREFIX = "kici:";
|
|
82
|
+
/**
|
|
83
|
+
* Capability label prefix — `kici:capability:<name>` grants an agent a
|
|
84
|
+
* privileged capability beyond plain execution. Distinct from `kici:role:`
|
|
85
|
+
* (which gates which internal job kinds an agent runs).
|
|
86
|
+
*/
|
|
87
|
+
export declare const CAPABILITY_LABEL_PREFIX = "kici:capability:";
|
|
88
|
+
/** Build a `kici:capability:<name>` label. */
|
|
89
|
+
export declare function capabilityLabel(name: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* The `ssh-transport` capability: an agent holding this may run the bootstrap
|
|
92
|
+
* bring-up (`ctx.kici.bootstrap.ensureInitRunner` / `preBootSend`) — i.e. SSH
|
|
93
|
+
* to a declared-but-un-agented host. The orchestrator refuses to run a
|
|
94
|
+
* bring-up on an agent that lacks it. Prod-critical: such an agent custodies
|
|
95
|
+
* the bootstrap SSH key.
|
|
96
|
+
*/
|
|
97
|
+
export declare const SSH_TRANSPORT_CAPABILITY = "kici:capability:ssh-transport";
|
|
98
|
+
/**
|
|
99
|
+
* The `kici:init` lifecycle label carried by a temporary init-runner agent
|
|
100
|
+
* brought up on a fresh box for bootstrap. Marks it as ephemeral + privileged;
|
|
101
|
+
* it dies on reboot and is reaped. Distinct from `kici:role:init-runner`
|
|
102
|
+
* (which is the per-job `__init__` workspace-init capability — a different
|
|
103
|
+
* concept entirely).
|
|
104
|
+
*/
|
|
105
|
+
export declare const INIT_LABEL = "kici:init";
|
|
106
|
+
/**
|
|
107
|
+
* The `kici:privileged:root` label a bootstrap init-runner carries — it runs
|
|
108
|
+
* as root in the target's rescue env to partition / format / install.
|
|
109
|
+
*/
|
|
110
|
+
export declare const PRIVILEGED_ROOT_LABEL = "kici:privileged:root";
|
|
82
111
|
/** Role label prefix — used to generate role-specific labels. */
|
|
83
112
|
export declare const ROLE_LABEL_PREFIX = "kici:role:";
|
|
84
113
|
/**
|
package/dist/labels.js
CHANGED
|
@@ -116,6 +116,37 @@ function normalizeRunsOn(runsOn) {
|
|
|
116
116
|
const KNOWN_ROLES = ["builder", "init-runner"];
|
|
117
117
|
/** Reserved label prefix — labels starting with this are system-managed. */
|
|
118
118
|
const RESERVED_LABEL_PREFIX = "kici:";
|
|
119
|
+
/**
|
|
120
|
+
* Capability label prefix — `kici:capability:<name>` grants an agent a
|
|
121
|
+
* privileged capability beyond plain execution. Distinct from `kici:role:`
|
|
122
|
+
* (which gates which internal job kinds an agent runs).
|
|
123
|
+
*/
|
|
124
|
+
const CAPABILITY_LABEL_PREFIX = "kici:capability:";
|
|
125
|
+
/** Build a `kici:capability:<name>` label. */
|
|
126
|
+
function capabilityLabel(name) {
|
|
127
|
+
return `${CAPABILITY_LABEL_PREFIX}${name}`;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The `ssh-transport` capability: an agent holding this may run the bootstrap
|
|
131
|
+
* bring-up (`ctx.kici.bootstrap.ensureInitRunner` / `preBootSend`) — i.e. SSH
|
|
132
|
+
* to a declared-but-un-agented host. The orchestrator refuses to run a
|
|
133
|
+
* bring-up on an agent that lacks it. Prod-critical: such an agent custodies
|
|
134
|
+
* the bootstrap SSH key.
|
|
135
|
+
*/
|
|
136
|
+
const SSH_TRANSPORT_CAPABILITY = "kici:capability:ssh-transport";
|
|
137
|
+
/**
|
|
138
|
+
* The `kici:init` lifecycle label carried by a temporary init-runner agent
|
|
139
|
+
* brought up on a fresh box for bootstrap. Marks it as ephemeral + privileged;
|
|
140
|
+
* it dies on reboot and is reaped. Distinct from `kici:role:init-runner`
|
|
141
|
+
* (which is the per-job `__init__` workspace-init capability — a different
|
|
142
|
+
* concept entirely).
|
|
143
|
+
*/
|
|
144
|
+
const INIT_LABEL = "kici:init";
|
|
145
|
+
/**
|
|
146
|
+
* The `kici:privileged:root` label a bootstrap init-runner carries — it runs
|
|
147
|
+
* as root in the target's rescue env to partition / format / install.
|
|
148
|
+
*/
|
|
149
|
+
const PRIVILEGED_ROOT_LABEL = "kici:privileged:root";
|
|
119
150
|
/** Role label prefix — used to generate role-specific labels. */
|
|
120
151
|
const ROLE_LABEL_PREFIX = "kici:role:";
|
|
121
152
|
/**
|
|
@@ -203,6 +234,6 @@ function separateLabels(labels) {
|
|
|
203
234
|
};
|
|
204
235
|
}
|
|
205
236
|
//#endregion
|
|
206
|
-
export { HOST_LABEL_PREFIX, KNOWN_ROLES, RESERVED_LABEL_PREFIX, ROLE_LABEL_PREFIX, SELF_REPORTED_LABEL_PREFIXES, agentTypeLabel, deriveOsArchLabels, hostLabel, isAutoLabel, isSelfReportedLabel, mergeAutoLabels, normalizeRunsOn, parseHostLabel, resolveRoleLabels, roleToLabel, scalerAgentLabels, scalerLabel, separateLabels, validateNoReservedLabels };
|
|
237
|
+
export { CAPABILITY_LABEL_PREFIX, HOST_LABEL_PREFIX, INIT_LABEL, KNOWN_ROLES, PRIVILEGED_ROOT_LABEL, RESERVED_LABEL_PREFIX, ROLE_LABEL_PREFIX, SELF_REPORTED_LABEL_PREFIXES, SSH_TRANSPORT_CAPABILITY, agentTypeLabel, capabilityLabel, deriveOsArchLabels, hostLabel, isAutoLabel, isSelfReportedLabel, mergeAutoLabels, normalizeRunsOn, parseHostLabel, resolveRoleLabels, roleToLabel, scalerAgentLabels, scalerLabel, separateLabels, validateNoReservedLabels };
|
|
207
238
|
|
|
208
239
|
//# sourceMappingURL=labels.js.map
|
|
@@ -52,6 +52,13 @@ export declare const OVERFLOW_LABEL_VALUE = "__overflow__";
|
|
|
52
52
|
* so they are valid push payloads alongside `kici_orch_*`.
|
|
53
53
|
*/
|
|
54
54
|
export declare const ORCH_PUSHED_METRIC_NAMES: ReadonlySet<MetricName>;
|
|
55
|
+
/**
|
|
56
|
+
* Closed enum of scaler-backend TYPE values the orchestrator's own
|
|
57
|
+
* resource-usage gauges carry on their `scalerType` rollup label.
|
|
58
|
+
* `__global__` is the orchestrator-wide rollup row; the other four match
|
|
59
|
+
* `AGENT_SCALER_VALUES`. Exported so the policy tests can assert against it.
|
|
60
|
+
*/
|
|
61
|
+
export declare const ORCH_SCALER_VALUES: readonly ["__global__", "stateful", "container", "firecracker", "bare-metal"];
|
|
55
62
|
/**
|
|
56
63
|
* Per-metric, per-label value policy. Missing entries (or missing label
|
|
57
64
|
* keys within an entry) mean "no value-level constraint" — the label key
|