@kici-dev/engine 0.1.9 → 0.1.11
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/retention-policy.js +1 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -3
- package/dist/labels.d.ts +24 -0
- package/dist/labels.js +38 -1
- package/dist/metrics/metric-catalog.generated.d.ts +5 -0
- package/dist/metrics/metric-catalog.generated.js +6 -0
- package/dist/package-manager.d.ts +20 -0
- package/dist/protocol/messages/peer.d.ts +53 -0
- package/dist/protocol/messages/peer.js +28 -3
- package/dist/protocol/messages/scaler-event.d.ts +19 -0
- package/dist/protocol/messages/scaler-event.js +23 -0
- package/package.json +1 -1
- package/sbom.spdx.json +5 -5
|
@@ -176,12 +176,11 @@ function groupByDays(map) {
|
|
|
176
176
|
function accessLogWarmSqlCase() {
|
|
177
177
|
const groups = groupByDays(ACCESS_LOG_WARM_DAYS);
|
|
178
178
|
const sortedDays = [...groups.keys()].sort((a, b) => b - a);
|
|
179
|
-
const defaultDays =
|
|
179
|
+
const defaultDays = UNKNOWN_ACTION_WARM_DAYS;
|
|
180
180
|
const whenClauses = [];
|
|
181
181
|
whenClauses.push(`WHEN outcome IN ('denied','error') THEN INTERVAL '${FORENSIC_OUTCOME_DAYS} days'`);
|
|
182
182
|
whenClauses.push(`WHEN actor_type = 'platform_operator' THEN INTERVAL '${PLATFORM_OPERATOR_DAYS} days'`);
|
|
183
183
|
for (const days of sortedDays) {
|
|
184
|
-
if (days === defaultDays) continue;
|
|
185
184
|
const actions = groups.get(days);
|
|
186
185
|
whenClauses.push(`WHEN action IN (${quoteList(actions)}) THEN INTERVAL '${days} days'`);
|
|
187
186
|
}
|
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/scaler-event.js';
|
|
18
19
|
export * from './protocol/messages/event-log.js';
|
|
19
20
|
export * from './protocol/messages/access-log.js';
|
|
20
21
|
export * from './audit/access-log-policy.js';
|
|
@@ -44,7 +45,7 @@ export type { RateLimiterConfig, RateLimitResult } from './ws/rate-limiter.js';
|
|
|
44
45
|
export * from './env/environment-allowlist.js';
|
|
45
46
|
export * from './secrets/index.js';
|
|
46
47
|
export * from './environment/index.js';
|
|
47
|
-
export { deriveOsArchLabels, hostLabel, agentTypeLabel, scalerLabel, mergeAutoLabels, normalizeRunsOn, KNOWN_ROLES, resolveRoleLabels, validateNoReservedLabels, } from './labels.js';
|
|
48
|
+
export { deriveOsArchLabels, hostLabel, agentTypeLabel, scalerLabel, mergeAutoLabels, normalizeRunsOn, KNOWN_ROLES, resolveRoleLabels, validateNoReservedLabels, scalerAgentLabels, isSelfReportedLabel, SELF_REPORTED_LABEL_PREFIXES, } from './labels.js';
|
|
48
49
|
export type { NormalizedRunsOn } from './labels.js';
|
|
49
50
|
export type { AgentRole } from './labels.js';
|
|
50
51
|
export * from './scaler/scaler-backend-type.js';
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { browserJobContextSchema, browserRunEventSchema, dashboardOrchLogsReques
|
|
|
11
11
|
import { EventLogSource, EventLogStatus, PayloadOmittedReason } from "./protocol/messages/event-log.js";
|
|
12
12
|
import { EventLogPayloadStreamError, HeldRunQueueType, HeldRunStatus, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, identityLinkItemSchema, identityLinkListResponseSchema, manualScheduleRequestSchema, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, orgMemberSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, runCancelRequestSchema, runEventSchema, runLineageResponseSchema, runRerunRequestSchema, trustPolicyResponseSchema } from "./protocol/messages/dashboard.js";
|
|
13
13
|
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";
|
|
14
|
+
import { ScalerEventType } from "./protocol/messages/scaler-event.js";
|
|
14
15
|
import { AccessLogPolicyKind, POLICY_BY_ACTION, fnv1a32, shouldRecordAccess, shouldRecordSecretResolve } from "./audit/access-log-policy.js";
|
|
15
16
|
import { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, accessLogWarmSqlCase, auditLogColdDays, auditLogWarmDays, auditLogWarmSqlCase, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, minAccessLogWarmDays, minAuditLogWarmDays, minSecretAuditLogWarmDays, secretAuditLogColdDays, secretAuditLogWarmDays, secretAuditLogWarmSqlCase } from "./audit/retention-policy.js";
|
|
16
17
|
import { ActivityFilterSource, ActivityRowSource, activityCursorSchema, activityFilterSchema, activityRowSchema, decodeActivityCursor, encodeActivityCursor, resolveRunIdSugar } from "./audit/activity.js";
|
|
@@ -18,7 +19,7 @@ import { logPullOrchToPlatformSchema, logPullPlatformToOrchSchema } from "./prot
|
|
|
18
19
|
import { EVENT_LOG_PAYLOAD_CHUNK_BYTES } from "./protocol/event-log-payload.js";
|
|
19
20
|
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";
|
|
20
21
|
import { joinRequestSchema, joinResponseSchema } from "./protocol/messages/join.js";
|
|
21
|
-
import { jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema } from "./protocol/messages/peer.js";
|
|
22
|
+
import { jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerScalerEventSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema } from "./protocol/messages/peer.js";
|
|
22
23
|
import { agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, gitAuthSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobStatusSchema, orchestratorToAgentMessageSchema, registerAckSchema } from "./protocol/messages/orchestrator-agent.js";
|
|
23
24
|
import { testCancelResponseSchema, testCancelSchema, testEventSchema, testTriggerResponseSchema, testTriggerSchema } from "./protocol/messages/test-run.js";
|
|
24
25
|
import { observeCompleteSchema, observeLogSchema, observeStatusSchema, observeStepSchema, observeSubscribeSchema } from "./protocol/messages/observe.js";
|
|
@@ -36,10 +37,10 @@ import { AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, KICI_AGENT_ENV_PREFIX, S
|
|
|
36
37
|
import "./secrets/index.js";
|
|
37
38
|
import { matchScopePattern, resolveSecretsForEnvironment, stripScopePrefix } from "./environment/scope-resolver.js";
|
|
38
39
|
import "./environment/index.js";
|
|
39
|
-
import { KNOWN_ROLES, agentTypeLabel, deriveOsArchLabels, hostLabel, mergeAutoLabels, normalizeRunsOn, resolveRoleLabels, scalerLabel, validateNoReservedLabels } from "./labels.js";
|
|
40
|
+
import { KNOWN_ROLES, SELF_REPORTED_LABEL_PREFIXES, agentTypeLabel, deriveOsArchLabels, hostLabel, isSelfReportedLabel, mergeAutoLabels, normalizeRunsOn, resolveRoleLabels, scalerAgentLabels, scalerLabel, validateNoReservedLabels } from "./labels.js";
|
|
40
41
|
import { ScalerBackendType } from "./scaler/scaler-backend-type.js";
|
|
41
42
|
import { parseMemoryString, resourceRequestNestedSchema, resourceSpecSchema, validateResourceRequest } from "./scaler/resource-types.js";
|
|
42
43
|
import { RegisterableTriggerType } from "./registration/registerable-trigger-type.js";
|
|
43
44
|
import { createWorkflowBundleConfig } from "./bundler/rolldown-config.js";
|
|
44
45
|
import "./bundler/index.js";
|
|
45
|
-
export { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, AccessLogAction, AccessLogOutcome, AccessLogPolicyKind, AccessLogSource, AccessLogTargetType, ActivityFilterSource, ActivityRowSource, ActorType, CheckRunConclusion, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, HeldRunQueueType, HeldRunStatus, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, MIN_PROTOCOL_VERSION, NeedsEntrySchema, NeedsGroupEntrySchema, ORCH_CAPABILITIES, OrchRole, POLICY_BY_ACTION, PROTOCOL_VERSION, PayloadOmittedReason, RegisterableTriggerType, SANDBOX_DEFAULT_VARS, SCHEMA_VERSION, ScalerBackendType, SourceProvider, SourceSubtype, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES, 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_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, 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, configAckSchema, createTraceEntry, createWorkflowBundleConfig, createWorkflowDecision, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, decodeActivityCursor, deriveOsArchLabels, encodeActivityCursor, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, errorSchema, eventEmitResponseSchema, eventEmitSchema, eventLogListItemSchema, executionEventSchema, executionStatusSchema, flattenActor, fnv1a32, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, gitAuthSchema, hasOrchCapability, heartbeatSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, hostLabel, identityLinkItemSchema, identityLinkListResponseSchema, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, isTerminal, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobContextMessageSchema, jobDispatchSchema, jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, jobStatusForwardSchema, jobStatusSchema, joinRequestSchema, joinResponseSchema, logChunkSchema, logPullOrchToPlatformSchema, logPullPlatformToOrchSchema, manualScheduleRequestSchema, matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchScopePattern, matchWorkflowTriggers, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, mergeAutoLabels, minAccessLogWarmDays, minAuditLogWarmDays, minSecretAuditLogWarmDays, nackSchema, normalizeRunsOn, observeCompleteSchema, observeLogSchema, observeStatusSchema, observeStepSchema, observeSubscribeSchema, orchCapabilitiesSchema, orchMetricsSchema, orchestratorToAgentMessageSchema, orchestratorToPlatformMessageSchema, orgMemberSchema, parseActor, parseMemoryString, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerDiscoverSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerToPeerMessageSchema, peerUpdateSchema, platformOperatorActorSchema, platformToBrowserMessageSchema, platformToOrchestratorMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, registerAckSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, resolveRoleLabels, resolveRunIdSugar, resolveSecretsForEnvironment, resourceRequestNestedSchema, resourceSpecSchema, runCancelRequestSchema, runEventMessageSchema, runEventSchema, runLineageResponseSchema, runRerunRequestSchema, scalerLabel, secretAuditLogColdDays, secretAuditLogWarmDays, secretAuditLogWarmSqlCase, serviceAccountActorSchema, shouldRecordAccess, shouldRecordSecretResolve, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema, staleCheckrunCleanupSchema, stateReplaySchema, stepStatusForwardSchema, stringifyActor, stripScopePrefix, systemActorSchema, testCancelResponseSchema, testCancelSchema, testEventSchema, testTriggerResponseSchema, testTriggerSchema, transition, trustPolicyResponseSchema, trustPolicyUpdateSchema, userActorSchema, validateNoReservedLabels, validateResourceRequest, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
|
|
46
|
+
export { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, AccessLogAction, AccessLogOutcome, AccessLogPolicyKind, AccessLogSource, AccessLogTargetType, ActivityFilterSource, ActivityRowSource, ActorType, CheckRunConclusion, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, HeldRunQueueType, HeldRunStatus, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, MIN_PROTOCOL_VERSION, NeedsEntrySchema, NeedsGroupEntrySchema, ORCH_CAPABILITIES, OrchRole, POLICY_BY_ACTION, PROTOCOL_VERSION, PayloadOmittedReason, RegisterableTriggerType, SANDBOX_DEFAULT_VARS, SCHEMA_VERSION, SELF_REPORTED_LABEL_PREFIXES, ScalerBackendType, ScalerEventType, SourceProvider, SourceSubtype, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES, 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_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, 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, configAckSchema, createTraceEntry, createWorkflowBundleConfig, createWorkflowDecision, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, decodeActivityCursor, deriveOsArchLabels, encodeActivityCursor, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, errorSchema, eventEmitResponseSchema, eventEmitSchema, eventLogListItemSchema, executionEventSchema, executionStatusSchema, flattenActor, fnv1a32, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, gitAuthSchema, hasOrchCapability, heartbeatSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, hostLabel, identityLinkItemSchema, identityLinkListResponseSchema, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, isSelfReportedLabel, isTerminal, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobContextMessageSchema, jobDispatchSchema, jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, jobStatusForwardSchema, jobStatusSchema, joinRequestSchema, joinResponseSchema, logChunkSchema, logPullOrchToPlatformSchema, logPullPlatformToOrchSchema, manualScheduleRequestSchema, matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchScopePattern, matchWorkflowTriggers, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, mergeAutoLabels, minAccessLogWarmDays, minAuditLogWarmDays, minSecretAuditLogWarmDays, nackSchema, normalizeRunsOn, observeCompleteSchema, observeLogSchema, observeStatusSchema, observeStepSchema, observeSubscribeSchema, orchCapabilitiesSchema, orchMetricsSchema, orchestratorToAgentMessageSchema, orchestratorToPlatformMessageSchema, orgMemberSchema, parseActor, parseMemoryString, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerDiscoverSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerScalerEventSchema, peerToPeerMessageSchema, peerUpdateSchema, platformOperatorActorSchema, platformToBrowserMessageSchema, platformToOrchestratorMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, registerAckSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, resolveRoleLabels, resolveRunIdSugar, resolveSecretsForEnvironment, resourceRequestNestedSchema, resourceSpecSchema, runCancelRequestSchema, runEventMessageSchema, runEventSchema, runLineageResponseSchema, runRerunRequestSchema, scalerAgentLabels, scalerLabel, secretAuditLogColdDays, secretAuditLogWarmDays, secretAuditLogWarmSqlCase, serviceAccountActorSchema, shouldRecordAccess, shouldRecordSecretResolve, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema, staleCheckrunCleanupSchema, stateReplaySchema, stepStatusForwardSchema, stringifyActor, stripScopePrefix, systemActorSchema, testCancelResponseSchema, testCancelSchema, testEventSchema, testTriggerResponseSchema, testTriggerSchema, transition, trustPolicyResponseSchema, trustPolicyUpdateSchema, userActorSchema, validateNoReservedLabels, validateResourceRequest, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
|
package/dist/labels.d.ts
CHANGED
|
@@ -87,6 +87,30 @@ export declare function roleToLabel(role: AgentRole): string;
|
|
|
87
87
|
* - ['builder'] → specific role labels only
|
|
88
88
|
*/
|
|
89
89
|
export declare function resolveRoleLabels(roles: readonly string[] | undefined): string[];
|
|
90
|
+
/**
|
|
91
|
+
* The full label set a scaler injects into an agent it spawns: the base label
|
|
92
|
+
* set plus the scaler-assigned `kici:agent:`, `kici:scaler:`, and `kici:role:`
|
|
93
|
+
* labels. This is exactly what the scaler writes into `KICI_LABELS`, and it is
|
|
94
|
+
* the set an ephemeral agent token must be bound to — the agent then adds only
|
|
95
|
+
* the self-reported platform facts (`kici:os:`, `kici:arch:`, `kici:host:`) at
|
|
96
|
+
* registration, which the orchestrator's register-time scope gate exempts (see
|
|
97
|
+
* `isSelfReportedLabel`). Keep this aligned with the agent's wire-label
|
|
98
|
+
* construction in `orchestrator-client.ts#sendAgentRegister`.
|
|
99
|
+
*/
|
|
100
|
+
export declare function scalerAgentLabels(labelSet: string[], backendType: string, backendName: string, roles: readonly string[] | undefined): string[];
|
|
101
|
+
/**
|
|
102
|
+
* Label-category prefixes the agent self-reports at registration from its own
|
|
103
|
+
* host (operating system, CPU architecture, hostname). They are immutable
|
|
104
|
+
* platform facts, not authorization grants, so the orchestrator's register-time
|
|
105
|
+
* label-scope gate does not require an ephemeral token to be bound to them.
|
|
106
|
+
*/
|
|
107
|
+
export declare const SELF_REPORTED_LABEL_PREFIXES: readonly ["kici:os:", "kici:arch:", "kici:host:"];
|
|
108
|
+
/**
|
|
109
|
+
* True if a label is a self-reported platform fact (os/arch/host) rather than a
|
|
110
|
+
* scaler-assigned, authorization-bearing label. Used by the agent register-time
|
|
111
|
+
* scope gate to avoid flagging the agent's own platform labels as "elevated".
|
|
112
|
+
*/
|
|
113
|
+
export declare function isSelfReportedLabel(label: string): boolean;
|
|
90
114
|
/**
|
|
91
115
|
* Validate that no labels use the reserved kici: prefix.
|
|
92
116
|
* Throws if any reserved labels are found (case-insensitive check).
|
package/dist/labels.js
CHANGED
|
@@ -130,6 +130,43 @@ function resolveRoleLabels(roles) {
|
|
|
130
130
|
return roles.map(roleToLabel);
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
|
+
* The full label set a scaler injects into an agent it spawns: the base label
|
|
134
|
+
* set plus the scaler-assigned `kici:agent:`, `kici:scaler:`, and `kici:role:`
|
|
135
|
+
* labels. This is exactly what the scaler writes into `KICI_LABELS`, and it is
|
|
136
|
+
* the set an ephemeral agent token must be bound to — the agent then adds only
|
|
137
|
+
* the self-reported platform facts (`kici:os:`, `kici:arch:`, `kici:host:`) at
|
|
138
|
+
* registration, which the orchestrator's register-time scope gate exempts (see
|
|
139
|
+
* `isSelfReportedLabel`). Keep this aligned with the agent's wire-label
|
|
140
|
+
* construction in `orchestrator-client.ts#sendAgentRegister`.
|
|
141
|
+
*/
|
|
142
|
+
function scalerAgentLabels(labelSet, backendType, backendName, roles) {
|
|
143
|
+
return [
|
|
144
|
+
...labelSet,
|
|
145
|
+
agentTypeLabel(backendType),
|
|
146
|
+
scalerLabel(backendName),
|
|
147
|
+
...resolveRoleLabels(roles)
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Label-category prefixes the agent self-reports at registration from its own
|
|
152
|
+
* host (operating system, CPU architecture, hostname). They are immutable
|
|
153
|
+
* platform facts, not authorization grants, so the orchestrator's register-time
|
|
154
|
+
* label-scope gate does not require an ephemeral token to be bound to them.
|
|
155
|
+
*/
|
|
156
|
+
const SELF_REPORTED_LABEL_PREFIXES = [
|
|
157
|
+
"kici:os:",
|
|
158
|
+
"kici:arch:",
|
|
159
|
+
"kici:host:"
|
|
160
|
+
];
|
|
161
|
+
/**
|
|
162
|
+
* True if a label is a self-reported platform fact (os/arch/host) rather than a
|
|
163
|
+
* scaler-assigned, authorization-bearing label. Used by the agent register-time
|
|
164
|
+
* scope gate to avoid flagging the agent's own platform labels as "elevated".
|
|
165
|
+
*/
|
|
166
|
+
function isSelfReportedLabel(label) {
|
|
167
|
+
return SELF_REPORTED_LABEL_PREFIXES.some((p) => label.startsWith(p));
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
133
170
|
* Validate that no labels use the reserved kici: prefix.
|
|
134
171
|
* Throws if any reserved labels are found (case-insensitive check).
|
|
135
172
|
*/
|
|
@@ -157,6 +194,6 @@ function separateLabels(labels) {
|
|
|
157
194
|
};
|
|
158
195
|
}
|
|
159
196
|
//#endregion
|
|
160
|
-
export { KNOWN_ROLES, RESERVED_LABEL_PREFIX, ROLE_LABEL_PREFIX, agentTypeLabel, deriveOsArchLabels, hostLabel, isAutoLabel, mergeAutoLabels, normalizeRunsOn, resolveRoleLabels, roleToLabel, scalerLabel, separateLabels, validateNoReservedLabels };
|
|
197
|
+
export { KNOWN_ROLES, RESERVED_LABEL_PREFIX, ROLE_LABEL_PREFIX, SELF_REPORTED_LABEL_PREFIXES, agentTypeLabel, deriveOsArchLabels, hostLabel, isAutoLabel, isSelfReportedLabel, mergeAutoLabels, normalizeRunsOn, resolveRoleLabels, roleToLabel, scalerAgentLabels, scalerLabel, separateLabels, validateNoReservedLabels };
|
|
161
198
|
|
|
162
199
|
//# sourceMappingURL=labels.js.map
|
|
@@ -47,6 +47,7 @@ export declare const MetricNames: {
|
|
|
47
47
|
readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "kici_orch_scaler_config_reloads_total";
|
|
48
48
|
readonly KICI_ORCH_SCALER_CPUS_USED: "kici_orch_scaler_cpus_used";
|
|
49
49
|
readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: "kici_orch_scaler_memory_bytes_used";
|
|
50
|
+
readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: "kici_orch_scaler_spawn_failures_total";
|
|
50
51
|
readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: "kici_orch_scaler_spawn_refusals_total";
|
|
51
52
|
readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: "kici_orch_source_cache_hits_total";
|
|
52
53
|
readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: "kici_orch_source_cache_misses_total";
|
|
@@ -169,6 +170,7 @@ export declare const MetricLabels: {
|
|
|
169
170
|
readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: readonly ["result"];
|
|
170
171
|
readonly KICI_ORCH_SCALER_CPUS_USED: readonly ["scaler", "machinePool"];
|
|
171
172
|
readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: readonly ["scaler", "machinePool"];
|
|
173
|
+
readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: readonly ["backend", "bound"];
|
|
172
174
|
readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: readonly [];
|
|
173
175
|
readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: readonly [];
|
|
174
176
|
readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: readonly [];
|
|
@@ -290,6 +292,7 @@ export declare const MetricKind: {
|
|
|
290
292
|
readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "counter";
|
|
291
293
|
readonly KICI_ORCH_SCALER_CPUS_USED: "observableGauge";
|
|
292
294
|
readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: "observableGauge";
|
|
295
|
+
readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: "counter";
|
|
293
296
|
readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: "observableGauge";
|
|
294
297
|
readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: "counter";
|
|
295
298
|
readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: "counter";
|
|
@@ -411,6 +414,7 @@ export declare const MetricDescription: {
|
|
|
411
414
|
readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "Total number of scaler config reload operations";
|
|
412
415
|
readonly KICI_ORCH_SCALER_CPUS_USED: "Current CPU reservations summed by scaler / pool. scaler=\"__global__\" is the orchestrator-wide total; machinePool=\"<name>\" rows reflect the on-disk ledger.";
|
|
413
416
|
readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: "Current memory reservations (bytes) summed by scaler / pool. scaler=\"__global__\" is the orchestrator-wide total; machinePool=\"<name>\" rows reflect the on-disk ledger.";
|
|
417
|
+
readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: "Total scaler agent spawn failures (job-bound and warm-pool)";
|
|
414
418
|
readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: "Cumulative count of scaler spawn requests refused due to resource caps (maxAgents, resourceCap, globalResourceCap, machinePool).";
|
|
415
419
|
readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: "Total number of source tarball cache hits";
|
|
416
420
|
readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: "Total number of source tarball cache misses";
|
|
@@ -539,6 +543,7 @@ export declare const MetricService: {
|
|
|
539
543
|
readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "orchestrator";
|
|
540
544
|
readonly KICI_ORCH_SCALER_CPUS_USED: "orchestrator";
|
|
541
545
|
readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: "orchestrator";
|
|
546
|
+
readonly KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: "orchestrator";
|
|
542
547
|
readonly KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: "orchestrator";
|
|
543
548
|
readonly KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: "orchestrator";
|
|
544
549
|
readonly KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: "orchestrator";
|
|
@@ -49,6 +49,7 @@ const MetricNames = {
|
|
|
49
49
|
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "kici_orch_scaler_config_reloads_total",
|
|
50
50
|
KICI_ORCH_SCALER_CPUS_USED: "kici_orch_scaler_cpus_used",
|
|
51
51
|
KICI_ORCH_SCALER_MEMORY_BYTES_USED: "kici_orch_scaler_memory_bytes_used",
|
|
52
|
+
KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: "kici_orch_scaler_spawn_failures_total",
|
|
52
53
|
KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: "kici_orch_scaler_spawn_refusals_total",
|
|
53
54
|
KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: "kici_orch_source_cache_hits_total",
|
|
54
55
|
KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: "kici_orch_source_cache_misses_total",
|
|
@@ -174,6 +175,7 @@ const MetricLabels = {
|
|
|
174
175
|
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: ["result"],
|
|
175
176
|
KICI_ORCH_SCALER_CPUS_USED: ["scaler", "machinePool"],
|
|
176
177
|
KICI_ORCH_SCALER_MEMORY_BYTES_USED: ["scaler", "machinePool"],
|
|
178
|
+
KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: ["backend", "bound"],
|
|
177
179
|
KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: [],
|
|
178
180
|
KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: [],
|
|
179
181
|
KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: [],
|
|
@@ -299,6 +301,7 @@ const MetricKind = {
|
|
|
299
301
|
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "counter",
|
|
300
302
|
KICI_ORCH_SCALER_CPUS_USED: "observableGauge",
|
|
301
303
|
KICI_ORCH_SCALER_MEMORY_BYTES_USED: "observableGauge",
|
|
304
|
+
KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: "counter",
|
|
302
305
|
KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: "observableGauge",
|
|
303
306
|
KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: "counter",
|
|
304
307
|
KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: "counter",
|
|
@@ -420,6 +423,7 @@ const MetricDescription = {
|
|
|
420
423
|
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "Total number of scaler config reload operations",
|
|
421
424
|
KICI_ORCH_SCALER_CPUS_USED: "Current CPU reservations summed by scaler / pool. scaler=\"__global__\" is the orchestrator-wide total; machinePool=\"<name>\" rows reflect the on-disk ledger.",
|
|
422
425
|
KICI_ORCH_SCALER_MEMORY_BYTES_USED: "Current memory reservations (bytes) summed by scaler / pool. scaler=\"__global__\" is the orchestrator-wide total; machinePool=\"<name>\" rows reflect the on-disk ledger.",
|
|
426
|
+
KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: "Total scaler agent spawn failures (job-bound and warm-pool)",
|
|
423
427
|
KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: "Cumulative count of scaler spawn requests refused due to resource caps (maxAgents, resourceCap, globalResourceCap, machinePool).",
|
|
424
428
|
KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: "Total number of source tarball cache hits",
|
|
425
429
|
KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: "Total number of source tarball cache misses",
|
|
@@ -548,6 +552,7 @@ const MetricService = {
|
|
|
548
552
|
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "orchestrator",
|
|
549
553
|
KICI_ORCH_SCALER_CPUS_USED: "orchestrator",
|
|
550
554
|
KICI_ORCH_SCALER_MEMORY_BYTES_USED: "orchestrator",
|
|
555
|
+
KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: "orchestrator",
|
|
551
556
|
KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: "orchestrator",
|
|
552
557
|
KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: "orchestrator",
|
|
553
558
|
KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: "orchestrator",
|
|
@@ -670,6 +675,7 @@ const ALL_METRIC_NAMES = [
|
|
|
670
675
|
"kici_orch_scaler_config_reloads_total",
|
|
671
676
|
"kici_orch_scaler_cpus_used",
|
|
672
677
|
"kici_orch_scaler_memory_bytes_used",
|
|
678
|
+
"kici_orch_scaler_spawn_failures_total",
|
|
673
679
|
"kici_orch_scaler_spawn_refusals_total",
|
|
674
680
|
"kici_orch_source_cache_hits_total",
|
|
675
681
|
"kici_orch_source_cache_misses_total",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-manager wire identity for protocol schemas and the lock-file type.
|
|
3
|
+
*
|
|
4
|
+
* Engine has no internal `@kici-dev/*` dependencies (it is a leaf imported by
|
|
5
|
+
* the browser dashboard), so it owns the wire enum for the package manager
|
|
6
|
+
* rather than importing the detection enum from `@kici-dev/shared`. The three
|
|
7
|
+
* values are identical to `@kici-dev/shared`'s `PackageManager` enum; a
|
|
8
|
+
* compile-time assignability test in a package that imports both guards
|
|
9
|
+
* against drift.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
/** Wire schema for the package manager that resolves `.kici/` dependencies. */
|
|
13
|
+
export declare const packageManagerSchema: z.ZodEnum<{
|
|
14
|
+
npm: "npm";
|
|
15
|
+
pnpm: "pnpm";
|
|
16
|
+
yarn: "yarn";
|
|
17
|
+
}>;
|
|
18
|
+
/** `'npm' | 'pnpm' | 'yarn'` — the package-manager identity on the wire. */
|
|
19
|
+
export type PackageManagerId = z.infer<typeof packageManagerSchema>;
|
|
20
|
+
//# sourceMappingURL=package-manager.d.ts.map
|
|
@@ -314,6 +314,30 @@ export declare const peerAgentTokenRevokeSchema: z.ZodObject<{
|
|
|
314
314
|
tokenId: z.ZodString;
|
|
315
315
|
senderInstanceId: z.ZodString;
|
|
316
316
|
}, z.core.$strip>;
|
|
317
|
+
/**
|
|
318
|
+
* A scaler provisioning event a worker forwards to the owning coordinator.
|
|
319
|
+
*
|
|
320
|
+
* Workers have no database, so they cannot persist a provisioning failure
|
|
321
|
+
* themselves. When a worker's scaler emits an event correlated to a queued
|
|
322
|
+
* job (e.g. a failed agent spawn), the worker relays it to the coordinator
|
|
323
|
+
* that owns the run; the coordinator's ExecutionTracker writes it to the
|
|
324
|
+
* provisioning log and the dispatch queue's last-error column.
|
|
325
|
+
*/
|
|
326
|
+
export declare const peerScalerEventSchema: z.ZodObject<{
|
|
327
|
+
type: z.ZodLiteral<"scaler.event">;
|
|
328
|
+
runId: z.ZodString;
|
|
329
|
+
jobId: z.ZodString;
|
|
330
|
+
agentId: z.ZodString;
|
|
331
|
+
eventType: z.ZodEnum<{
|
|
332
|
+
"scaler.provisioning": "scaler.provisioning";
|
|
333
|
+
"scaler.network": "scaler.network";
|
|
334
|
+
"scaler.ready": "scaler.ready";
|
|
335
|
+
"scaler.failed": "scaler.failed";
|
|
336
|
+
"agent.connecting": "agent.connecting";
|
|
337
|
+
}>;
|
|
338
|
+
detail: z.ZodString;
|
|
339
|
+
timestampMs: z.ZodNumber;
|
|
340
|
+
}, z.core.$strip>;
|
|
317
341
|
/** All peer-to-peer messages (outbound from this node). */
|
|
318
342
|
export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
319
343
|
type: z.ZodLiteral<"peer.hello">;
|
|
@@ -543,6 +567,20 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
543
567
|
type: z.ZodLiteral<"peer.agent-token.revoke">;
|
|
544
568
|
tokenId: z.ZodString;
|
|
545
569
|
senderInstanceId: z.ZodString;
|
|
570
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
571
|
+
type: z.ZodLiteral<"scaler.event">;
|
|
572
|
+
runId: z.ZodString;
|
|
573
|
+
jobId: z.ZodString;
|
|
574
|
+
agentId: z.ZodString;
|
|
575
|
+
eventType: z.ZodEnum<{
|
|
576
|
+
"scaler.provisioning": "scaler.provisioning";
|
|
577
|
+
"scaler.network": "scaler.network";
|
|
578
|
+
"scaler.ready": "scaler.ready";
|
|
579
|
+
"scaler.failed": "scaler.failed";
|
|
580
|
+
"agent.connecting": "agent.connecting";
|
|
581
|
+
}>;
|
|
582
|
+
detail: z.ZodString;
|
|
583
|
+
timestampMs: z.ZodNumber;
|
|
546
584
|
}, z.core.$strip>], "type">;
|
|
547
585
|
/** All peer-to-peer messages (inbound to this node). */
|
|
548
586
|
export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -773,12 +811,27 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
773
811
|
type: z.ZodLiteral<"peer.agent-token.revoke">;
|
|
774
812
|
tokenId: z.ZodString;
|
|
775
813
|
senderInstanceId: z.ZodString;
|
|
814
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
815
|
+
type: z.ZodLiteral<"scaler.event">;
|
|
816
|
+
runId: z.ZodString;
|
|
817
|
+
jobId: z.ZodString;
|
|
818
|
+
agentId: z.ZodString;
|
|
819
|
+
eventType: z.ZodEnum<{
|
|
820
|
+
"scaler.provisioning": "scaler.provisioning";
|
|
821
|
+
"scaler.network": "scaler.network";
|
|
822
|
+
"scaler.ready": "scaler.ready";
|
|
823
|
+
"scaler.failed": "scaler.failed";
|
|
824
|
+
"agent.connecting": "agent.connecting";
|
|
825
|
+
}>;
|
|
826
|
+
detail: z.ZodString;
|
|
827
|
+
timestampMs: z.ZodNumber;
|
|
776
828
|
}, z.core.$strip>], "type">;
|
|
777
829
|
export type PeerCapabilities = z.infer<typeof peerCapabilitiesSchema>;
|
|
778
830
|
export type ScalerCapacitySummary = z.infer<typeof scalerCapacitySummarySchema>;
|
|
779
831
|
export type PeerHeartbeat = z.infer<typeof peerHeartbeatSchema>;
|
|
780
832
|
export type JobReroute = z.infer<typeof jobRerouteSchema>;
|
|
781
833
|
export type JobProgress = z.infer<typeof jobProgressSchema>;
|
|
834
|
+
export type PeerScalerEvent = z.infer<typeof peerScalerEventSchema>;
|
|
782
835
|
export type PeerJobCancel = z.infer<typeof peerJobCancelSchema>;
|
|
783
836
|
export type RaftVoteRequest = z.infer<typeof raftVoteRequestSchema>;
|
|
784
837
|
export type RaftVoteResponse = z.infer<typeof raftVoteResponseSchema>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../../chunk-gOLHoazu.js";
|
|
2
2
|
import { ExecutionJobStatus } from "./execution-status.js";
|
|
3
|
+
import { ScalerEventType } from "./scaler-event.js";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
//#region src/protocol/messages/peer.ts
|
|
5
6
|
/** Agent summary included in peer heartbeat and auth response messages. */
|
|
@@ -322,6 +323,28 @@ const peerAgentTokenRevokeSchema = z.object({
|
|
|
322
323
|
/** Originating peer's instanceId — for log correlation across the cluster. */
|
|
323
324
|
senderInstanceId: z.string().min(1)
|
|
324
325
|
});
|
|
326
|
+
/**
|
|
327
|
+
* A scaler provisioning event a worker forwards to the owning coordinator.
|
|
328
|
+
*
|
|
329
|
+
* Workers have no database, so they cannot persist a provisioning failure
|
|
330
|
+
* themselves. When a worker's scaler emits an event correlated to a queued
|
|
331
|
+
* job (e.g. a failed agent spawn), the worker relays it to the coordinator
|
|
332
|
+
* that owns the run; the coordinator's ExecutionTracker writes it to the
|
|
333
|
+
* provisioning log and the dispatch queue's last-error column.
|
|
334
|
+
*/
|
|
335
|
+
const peerScalerEventSchema = z.object({
|
|
336
|
+
type: z.literal("scaler.event"),
|
|
337
|
+
runId: z.string(),
|
|
338
|
+
jobId: z.string(),
|
|
339
|
+
/** The scaler-managed agent id the event is about. */
|
|
340
|
+
agentId: z.string(),
|
|
341
|
+
/** Scaler event type (one of the ScalerEventType enum members). */
|
|
342
|
+
eventType: ScalerEventType,
|
|
343
|
+
/** Human-readable detail, including any captured spawn stderr tail. */
|
|
344
|
+
detail: z.string(),
|
|
345
|
+
/** Event timestamp in epoch milliseconds. */
|
|
346
|
+
timestampMs: z.number()
|
|
347
|
+
});
|
|
325
348
|
/** All peer-to-peer messages (outbound from this node). */
|
|
326
349
|
const peerToPeerMessageSchema = z.discriminatedUnion("type", [
|
|
327
350
|
peerHelloSchema,
|
|
@@ -342,7 +365,8 @@ const peerToPeerMessageSchema = z.discriminatedUnion("type", [
|
|
|
342
365
|
peerConfigReloadSchema,
|
|
343
366
|
peerConfigReloadResponseSchema,
|
|
344
367
|
peerLeavingSchema,
|
|
345
|
-
peerAgentTokenRevokeSchema
|
|
368
|
+
peerAgentTokenRevokeSchema,
|
|
369
|
+
peerScalerEventSchema
|
|
346
370
|
]);
|
|
347
371
|
/** All peer-to-peer messages (inbound to this node). */
|
|
348
372
|
const peerFromPeerMessageSchema = z.discriminatedUnion("type", [
|
|
@@ -364,9 +388,10 @@ const peerFromPeerMessageSchema = z.discriminatedUnion("type", [
|
|
|
364
388
|
peerConfigReloadSchema,
|
|
365
389
|
peerConfigReloadResponseSchema,
|
|
366
390
|
peerLeavingSchema,
|
|
367
|
-
peerAgentTokenRevokeSchema
|
|
391
|
+
peerAgentTokenRevokeSchema,
|
|
392
|
+
peerScalerEventSchema
|
|
368
393
|
]);
|
|
369
394
|
//#endregion
|
|
370
|
-
export { jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema };
|
|
395
|
+
export { jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerScalerEventSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema };
|
|
371
396
|
|
|
372
397
|
//# sourceMappingURL=peer.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Standardized scaler lifecycle event types emitted by all backends.
|
|
4
|
+
*
|
|
5
|
+
* Stored in the event_log table for timeline rendering and relayed
|
|
6
|
+
* worker→coordinator via the scaler.event peer message. The values are dotted
|
|
7
|
+
* (e.g. "scaler.failed") because that is the on-wire form the event_log row
|
|
8
|
+
* name and the dashboard timeline depend on — access members with bracket
|
|
9
|
+
* notation: `ScalerEventType.enum['scaler.failed']`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ScalerEventType: z.ZodEnum<{
|
|
12
|
+
"scaler.provisioning": "scaler.provisioning";
|
|
13
|
+
"scaler.network": "scaler.network";
|
|
14
|
+
"scaler.ready": "scaler.ready";
|
|
15
|
+
"scaler.failed": "scaler.failed";
|
|
16
|
+
"agent.connecting": "agent.connecting";
|
|
17
|
+
}>;
|
|
18
|
+
export type ScalerEventType = z.infer<typeof ScalerEventType>;
|
|
19
|
+
//# sourceMappingURL=scaler-event.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "../../chunk-gOLHoazu.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/protocol/messages/scaler-event.ts
|
|
4
|
+
/**
|
|
5
|
+
* Standardized scaler lifecycle event types emitted by all backends.
|
|
6
|
+
*
|
|
7
|
+
* Stored in the event_log table for timeline rendering and relayed
|
|
8
|
+
* worker→coordinator via the scaler.event peer message. The values are dotted
|
|
9
|
+
* (e.g. "scaler.failed") because that is the on-wire form the event_log row
|
|
10
|
+
* name and the dashboard timeline depend on — access members with bracket
|
|
11
|
+
* notation: `ScalerEventType.enum['scaler.failed']`.
|
|
12
|
+
*/
|
|
13
|
+
const ScalerEventType = z.enum([
|
|
14
|
+
"scaler.provisioning",
|
|
15
|
+
"scaler.network",
|
|
16
|
+
"scaler.ready",
|
|
17
|
+
"scaler.failed",
|
|
18
|
+
"agent.connecting"
|
|
19
|
+
]);
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ScalerEventType };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=scaler-event.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Shared business logic for the KiCI CI/CD stack: protocol, triggers, state machine, and provider interfaces used by the Platform relay, orchestrator, and compiler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kici",
|
package/sbom.spdx.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"spdxVersion": "SPDX-2.3",
|
|
3
3
|
"dataLicense": "CC0-1.0",
|
|
4
4
|
"SPDXID": "SPDXRef-DOCUMENT",
|
|
5
|
-
"name": "@kici-dev/engine@0.1.
|
|
6
|
-
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.1.
|
|
5
|
+
"name": "@kici-dev/engine@0.1.11",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.1.11/2b46d5de-8b1f-4f79-b887-3b373c19012e",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-05-
|
|
8
|
+
"created": "2026-05-27T16:18:17Z",
|
|
9
9
|
"creators": [
|
|
10
10
|
"Tool: kici-sbom-generator"
|
|
11
11
|
]
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
{
|
|
55
55
|
"SPDXID": "SPDXRef-RootPackage",
|
|
56
56
|
"name": "@kici-dev/engine",
|
|
57
|
-
"versionInfo": "0.1.
|
|
57
|
+
"versionInfo": "0.1.11",
|
|
58
58
|
"downloadLocation": "NOASSERTION",
|
|
59
59
|
"filesAnalyzed": false,
|
|
60
60
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
{
|
|
66
66
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
67
67
|
"referenceType": "purl",
|
|
68
|
-
"referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.
|
|
68
|
+
"referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.11"
|
|
69
69
|
}
|
|
70
70
|
],
|
|
71
71
|
"description": "Shared business logic for the KiCI CI/CD stack: protocol, triggers, state machine, and provider interfaces used by the Platform relay, orchestrator, and compiler.",
|