@kici-dev/engine 0.1.14 → 0.1.15

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.
Files changed (43) hide show
  1. package/README.md +13 -1
  2. package/dist/audit/access-log-policy.js +12 -0
  3. package/dist/audit/retention-policy.js +6 -0
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +8 -7
  6. package/dist/labels.d.ts +7 -0
  7. package/dist/labels.js +11 -2
  8. package/dist/metrics/metric-catalog.generated.d.ts +50 -0
  9. package/dist/metrics/metric-catalog.generated.js +60 -0
  10. package/dist/protocol/analytics-events.d.ts +16 -0
  11. package/dist/protocol/analytics-events.js +20 -0
  12. package/dist/protocol/dashboard-write-operations.d.ts +4 -1
  13. package/dist/protocol/dashboard-write-operations.js +11 -1
  14. package/dist/protocol/messages/access-log.d.ts +16 -0
  15. package/dist/protocol/messages/access-log.js +3 -0
  16. package/dist/protocol/messages/actor.d.ts +2 -0
  17. package/dist/protocol/messages/actor.js +12 -2
  18. package/dist/protocol/messages/auth.d.ts +1 -0
  19. package/dist/protocol/messages/capabilities.d.ts +1 -0
  20. package/dist/protocol/messages/dashboard-global-workflows.d.ts +2 -0
  21. package/dist/protocol/messages/dashboard.d.ts +559 -6
  22. package/dist/protocol/messages/dashboard.js +164 -9
  23. package/dist/protocol/messages/event-log.d.ts +4 -0
  24. package/dist/protocol/messages/event-log.js +4 -0
  25. package/dist/protocol/messages/execution-status.d.ts +56 -3
  26. package/dist/protocol/messages/execution-status.js +44 -4
  27. package/dist/protocol/messages/orchestrator-agent.d.ts +164 -0
  28. package/dist/protocol/messages/orchestrator-agent.js +118 -2
  29. package/dist/protocol/messages/peer.d.ts +13 -0
  30. package/dist/protocol/messages/peer.js +14 -1
  31. package/dist/protocol/messages/platform-orchestrator.d.ts +152 -0
  32. package/dist/protocol/messages/platform-orchestrator.js +3 -55
  33. package/dist/protocol/messages/run-events.d.ts +1 -0
  34. package/dist/provider/index.d.ts +1 -0
  35. package/dist/provider/index.js +2 -1
  36. package/dist/provider/lock-file-parse-error.d.ts +14 -0
  37. package/dist/provider/lock-file-parse-error.js +22 -0
  38. package/dist/trigger/types.d.ts +8 -1
  39. package/dist/trigger/types.js +3 -1
  40. package/dist/ws/close-codes.d.ts +7 -0
  41. package/dist/ws/close-codes.js +8 -1
  42. package/package.json +15 -8
  43. package/sbom.spdx.json +5 -5
package/README.md CHANGED
@@ -1 +1,13 @@
1
- TBD
1
+ # @kici-dev/engine
2
+
3
+ Shared business logic for the KiCI CI/CD stack: protocol message schemas, trigger matching, the execution state machine, and provider interfaces used across the KiCI tiers.
4
+
5
+ This is an internal support library — other `@kici-dev` packages depend on it; it is not meant to be installed directly.
6
+
7
+ Part of [KiCI](https://kici.dev) — CI/CD workflows as TypeScript code: author them with full language power, dry-run them locally, and run them on your own infrastructure.
8
+
9
+ ## Links
10
+
11
+ - Documentation: <https://docs.kici.dev/architecture/overview/>
12
+ - Source: <https://github.com/kici-dev/kici-public/tree/main/packages/engine>
13
+ - License: AGPL-3.0-only
@@ -38,6 +38,18 @@ const POLICY_BY_ACTION = {
38
38
  kind: "sample",
39
39
  allowedRate: .05
40
40
  },
41
+ "runs.list.read": {
42
+ kind: "sample",
43
+ allowedRate: .05
44
+ },
45
+ "runs.filters.read": {
46
+ kind: "sample",
47
+ allowedRate: .05
48
+ },
49
+ "sources.list.read": {
50
+ kind: "sample",
51
+ allowedRate: .1
52
+ },
41
53
  "run.orch_logs.read": {
42
54
  kind: "sample",
43
55
  allowedRate: .1
@@ -13,6 +13,9 @@ import "../chunk-gOLHoazu.js";
13
13
  */
14
14
  const ACCESS_LOG_WARM_DAYS = {
15
15
  "run.detail.read": 30,
16
+ "runs.list.read": 30,
17
+ "runs.filters.read": 30,
18
+ "sources.list.read": 30,
16
19
  "run.orch_logs.read": 30,
17
20
  "step.logs.read": 30,
18
21
  "event_log.list.read": 30,
@@ -244,6 +247,9 @@ function secretAuditLogWarmSqlCase() {
244
247
  */
245
248
  const ACCESS_LOG_COLD_DAYS = {
246
249
  "run.detail.read": 180,
250
+ "runs.list.read": 180,
251
+ "runs.filters.read": 180,
252
+ "sources.list.read": 180,
247
253
  "run.orch_logs.read": 180,
248
254
  "step.logs.read": 180,
249
255
  "event_log.list.read": 180,
package/dist/index.d.ts CHANGED
@@ -45,7 +45,7 @@ export type { RateLimiterConfig, RateLimitResult } from './ws/rate-limiter.js';
45
45
  export * from './env/environment-allowlist.js';
46
46
  export * from './secrets/index.js';
47
47
  export * from './environment/index.js';
48
- export { deriveOsArchLabels, hostLabel, agentTypeLabel, scalerLabel, mergeAutoLabels, normalizeRunsOn, KNOWN_ROLES, resolveRoleLabels, validateNoReservedLabels, scalerAgentLabels, isSelfReportedLabel, SELF_REPORTED_LABEL_PREFIXES, } from './labels.js';
48
+ export { deriveOsArchLabels, hostLabel, parseHostLabel, HOST_LABEL_PREFIX, agentTypeLabel, scalerLabel, mergeAutoLabels, normalizeRunsOn, KNOWN_ROLES, resolveRoleLabels, validateNoReservedLabels, scalerAgentLabels, isSelfReportedLabel, SELF_REPORTED_LABEL_PREFIXES, } from './labels.js';
49
49
  export type { NormalizedRunsOn } from './labels.js';
50
50
  export type { AgentRole } from './labels.js';
51
51
  export * from './scaler/scaler-backend-type.js';
package/dist/index.js CHANGED
@@ -4,12 +4,13 @@ import { WS_MAX_PAYLOAD_BYTES, ackSchema, errorSchema, heartbeatSchema, nackSche
4
4
  import { ActorType, actorPrincipalSchema, apiKeyActorSchema, flattenActor, parseActor, platformOperatorActorSchema, serviceAccountActorSchema, stringifyActor, systemActorSchema, userActorSchema } from "./protocol/messages/actor.js";
5
5
  import { ORCH_CAPABILITIES, OrchRole, hasOrchCapability, orchCapabilitiesSchema } from "./protocol/messages/capabilities.js";
6
6
  import { authFailureSchema, authRequestSchema, authSuccessSchema } from "./protocol/messages/auth.js";
7
- import { ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, InitFailureCategory, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, executionStatusSchema, initFailureSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema } from "./protocol/messages/execution-status.js";
7
+ import { CacheOutcome, CacheRunEventType, CacheStepType, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, InitFailureCategory, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TimeoutReason, executionStatusSchema, initFailureSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema } from "./protocol/messages/execution-status.js";
8
8
  import { SourceProvider, SourceSubtype, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema } from "./protocol/messages/source-registration.js";
9
9
  import { AccessLogAction, AccessLogOutcome, AccessLogSource, AccessLogTargetType, accessLogFilterSchema, accessLogItemSchema, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema } from "./protocol/messages/access-log.js";
10
10
  import { browserJobContextSchema, browserRunEventSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, jobContextMessageSchema, runEventMessageSchema } from "./protocol/messages/run-events.js";
11
11
  import { EventLogSource, EventLogStatus, PayloadOmittedReason } from "./protocol/messages/event-log.js";
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";
12
+ import { ScalerBackendType } from "./scaler/scaler-backend-type.js";
13
+ import { EnvDeleteErrorCode, 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, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, 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
14
  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
15
  import { ScalerEventType } from "./protocol/messages/scaler-event.js";
15
16
  import { AccessLogPolicyKind, POLICY_BY_ACTION, fnv1a32, shouldRecordAccess, shouldRecordSecretResolve } from "./audit/access-log-policy.js";
@@ -20,7 +21,7 @@ import { EVENT_LOG_PAYLOAD_CHUNK_BYTES } from "./protocol/event-log-payload.js";
20
21
  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";
21
22
  import { joinRequestSchema, joinResponseSchema } from "./protocol/messages/join.js";
22
23
  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";
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";
24
+ import { CacheRefScope, JobRejectReason, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, registerAckSchema } from "./protocol/messages/orchestrator-agent.js";
24
25
  import { testCancelResponseSchema, testCancelSchema, testEventSchema, testTriggerResponseSchema, testTriggerSchema } from "./protocol/messages/test-run.js";
25
26
  import { observeCompleteSchema, observeLogSchema, observeStatusSchema, observeStepSchema, observeSubscribeSchema } from "./protocol/messages/observe.js";
26
27
  import { NeedsEntrySchema, NeedsGroupEntrySchema, SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob } from "./trigger/types.js";
@@ -29,18 +30,18 @@ import { createTraceEntry, createWorkflowDecision } from "./trigger/decision-tra
29
30
  import { matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchWorkflowTriggers } from "./trigger/matcher.js";
30
31
  import { isTerminal, transition } from "./state-machine/machine.js";
31
32
  import "./state-machine/index.js";
33
+ import { LockFileParseError } from "./provider/lock-file-parse-error.js";
32
34
  import { CheckRunConclusion } from "./provider/check-run-conclusion.js";
33
35
  import "./provider/index.js";
34
- import { 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 } from "./ws/close-codes.js";
36
+ import { 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 } from "./ws/close-codes.js";
35
37
  import { WsRateLimiter } from "./ws/rate-limiter.js";
36
38
  import { AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, KICI_AGENT_ENV_PREFIX, SANDBOX_DEFAULT_VARS } from "./env/environment-allowlist.js";
37
39
  import "./secrets/index.js";
38
40
  import { matchScopePattern, resolveSecretsForEnvironment, stripScopePrefix } from "./environment/scope-resolver.js";
39
41
  import "./environment/index.js";
40
- import { KNOWN_ROLES, SELF_REPORTED_LABEL_PREFIXES, agentTypeLabel, deriveOsArchLabels, hostLabel, isSelfReportedLabel, mergeAutoLabels, normalizeRunsOn, resolveRoleLabels, scalerAgentLabels, scalerLabel, validateNoReservedLabels } from "./labels.js";
41
- import { ScalerBackendType } from "./scaler/scaler-backend-type.js";
42
+ import { HOST_LABEL_PREFIX, KNOWN_ROLES, SELF_REPORTED_LABEL_PREFIXES, agentTypeLabel, deriveOsArchLabels, hostLabel, isSelfReportedLabel, mergeAutoLabels, normalizeRunsOn, parseHostLabel, resolveRoleLabels, scalerAgentLabels, scalerLabel, validateNoReservedLabels } from "./labels.js";
42
43
  import { parseMemoryString, resourceRequestNestedSchema, resourceSpecSchema, validateResourceRequest } from "./scaler/resource-types.js";
43
44
  import { RegisterableTriggerType } from "./registration/registerable-trigger-type.js";
44
45
  import { createWorkflowBundleConfig } from "./bundler/rolldown-config.js";
45
46
  import "./bundler/index.js";
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, InitFailureCategory, 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, initFailureSchema, 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 };
47
+ export { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, AccessLogAction, AccessLogOutcome, AccessLogPolicyKind, AccessLogSource, AccessLogTargetType, ActivityFilterSource, ActivityRowSource, ActorType, CacheOutcome, CacheRefScope, CacheRunEventType, CacheStepType, CheckRunConclusion, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EnvDeleteErrorCode, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, HOST_LABEL_PREFIX, HeldRunQueueType, HeldRunStatus, InitFailureCategory, JobRejectReason, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, LockFileParseError, 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, TimeoutReason, 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, 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, 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, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, decodeActivityCursor, deriveOsArchLabels, 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, flattenActor, fnv1a32, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, gitAuthSchema, hasOrchCapability, heartbeatSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, hostLabel, identityLinkItemSchema, identityLinkListResponseSchema, initFailureSchema, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, isSelfReportedLabel, isTerminal, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobContextMessageSchema, jobDispatchSchema, jobProgressSchema, jobRejectSchema, 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, parseHostLabel, 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
@@ -30,10 +30,17 @@
30
30
  * Derive kici:os: and kici:arch: labels from platform and architecture strings.
31
31
  */
32
32
  export declare function deriveOsArchLabels(platform: string, arch: string): string[];
33
+ /** Prefix for the agent self-reported hostname label. */
34
+ export declare const HOST_LABEL_PREFIX = "kici:host:";
33
35
  /**
34
36
  * Build a kici:host: label from a hostname.
35
37
  */
36
38
  export declare function hostLabel(hostname: string): string;
39
+ /**
40
+ * Extract the hostname from a kici:host: label, or null if the label is not a
41
+ * host label. Inverse of {@link hostLabel}.
42
+ */
43
+ export declare function parseHostLabel(label: string): string | null;
37
44
  /**
38
45
  * Build a kici:agent: label from the scaler backend type.
39
46
  */
package/dist/labels.js CHANGED
@@ -56,11 +56,20 @@ function deriveOsArchLabels(platform, arch) {
56
56
  }
57
57
  return labels;
58
58
  }
59
+ /** Prefix for the agent self-reported hostname label. */
60
+ const HOST_LABEL_PREFIX = "kici:host:";
59
61
  /**
60
62
  * Build a kici:host: label from a hostname.
61
63
  */
62
64
  function hostLabel(hostname) {
63
- return `kici:host:${hostname}`;
65
+ return `${HOST_LABEL_PREFIX}${hostname}`;
66
+ }
67
+ /**
68
+ * Extract the hostname from a kici:host: label, or null if the label is not a
69
+ * host label. Inverse of {@link hostLabel}.
70
+ */
71
+ function parseHostLabel(label) {
72
+ return label.startsWith("kici:host:") ? label.slice(10) : null;
64
73
  }
65
74
  /**
66
75
  * Build a kici:agent: label from the scaler backend type.
@@ -194,6 +203,6 @@ function separateLabels(labels) {
194
203
  };
195
204
  }
196
205
  //#endregion
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 };
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 };
198
207
 
199
208
  //# sourceMappingURL=labels.js.map
@@ -44,6 +44,7 @@ export declare const MetricNames: {
44
44
  readonly KICI_ORCH_JOB_RUNS_TOTAL: "kici_orch_job_runs_total";
45
45
  readonly KICI_ORCH_LOG_BYTES_STORED_TOTAL: "kici_orch_log_bytes_stored_total";
46
46
  readonly KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "kici_orch_log_chunks_received_total";
47
+ readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: "kici_orch_pg_pool_client_errors_total";
47
48
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "kici_orch_scaler_config_reloads_total";
48
49
  readonly KICI_ORCH_SCALER_CPUS_USED: "kici_orch_scaler_cpus_used";
49
50
  readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: "kici_orch_scaler_memory_bytes_used";
@@ -86,16 +87,25 @@ export declare const MetricNames: {
86
87
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "kici_platform_mimir_relay_errors_total";
87
88
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "kici_platform_orch_metrics_filtered_total";
88
89
  readonly KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "kici_platform_orphan_connections_swept_total";
90
+ readonly KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "kici_platform_pg_pool_client_errors_total";
89
91
  readonly KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "kici_platform_stale_orchestrators_total";
90
92
  readonly KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "kici_platform_stale_platform_connections_evicted_total";
91
93
  readonly KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "kici_platform_stale_runs_failed_total";
92
94
  readonly KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "kici_platform_step_status_forwards_total";
95
+ readonly KICI_REGISTRATIONS_TOTAL: "kici_registrations_total";
93
96
  readonly KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "kici_universal_git_registration_errors_total";
94
97
  readonly KICI_VALKEY_CONNECTION_STATUS: "kici_valkey_connection_status";
95
98
  readonly KICI_VALKEY_PUBLISH_TOTAL: "kici_valkey_publish_total";
96
99
  readonly KICI_VALKEY_RELAY_LATENCY_SECONDS: "kici_valkey_relay_latency_seconds";
97
100
  readonly KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: "kici_valkey_subscribe_receive_total";
101
+ readonly KICI_WEBHOOK_BUFFER_BYTES: "kici_webhook_buffer_bytes";
102
+ readonly KICI_WEBHOOK_BUFFER_DEPTH: "kici_webhook_buffer_depth";
103
+ readonly KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: "kici_webhook_buffer_oldest_age_seconds";
104
+ readonly KICI_WEBHOOK_PG_BREAKER_STATE: "kici_webhook_pg_breaker_state";
105
+ readonly KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: "kici_webhook_pg_breaker_transitions_total";
106
+ readonly KICI_WEBHOOK_PG_DEGRADED_TOTAL: "kici_webhook_pg_degraded_total";
98
107
  readonly KICI_WEBHOOK_PROCESSING_SECONDS: "kici_webhook_processing_seconds";
108
+ readonly KICI_WEBHOOK_REPLAY_DURATION_SECONDS: "kici_webhook_replay_duration_seconds";
99
109
  readonly KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: "kici_webhook_signature_failures_total";
100
110
  readonly KICI_WEBHOOKS_RECEIVED_TOTAL: "kici_webhooks_received_total";
101
111
  readonly KICI_WS_CONNECTIONS_ACTIVE: "kici_ws_connections_active";
@@ -167,6 +177,7 @@ export declare const MetricLabels: {
167
177
  readonly KICI_ORCH_JOB_RUNS_TOTAL: readonly ["job", "result"];
168
178
  readonly KICI_ORCH_LOG_BYTES_STORED_TOTAL: readonly [];
169
179
  readonly KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: readonly [];
180
+ readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: readonly ["source"];
170
181
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: readonly ["result"];
171
182
  readonly KICI_ORCH_SCALER_CPUS_USED: readonly ["scaler", "machinePool"];
172
183
  readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: readonly ["scaler", "machinePool"];
@@ -209,16 +220,25 @@ export declare const MetricLabels: {
209
220
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: readonly ["reason"];
210
221
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: readonly ["reason", "metric"];
211
222
  readonly KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: readonly [];
223
+ readonly KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: readonly ["source"];
212
224
  readonly KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: readonly [];
213
225
  readonly KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: readonly ["org_id"];
214
226
  readonly KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: readonly [];
215
227
  readonly KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: readonly ["state"];
228
+ readonly KICI_REGISTRATIONS_TOTAL: readonly [];
216
229
  readonly KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: readonly ["reason"];
217
230
  readonly KICI_VALKEY_CONNECTION_STATUS: readonly ["role"];
218
231
  readonly KICI_VALKEY_PUBLISH_TOTAL: readonly ["channel"];
219
232
  readonly KICI_VALKEY_RELAY_LATENCY_SECONDS: readonly ["status"];
220
233
  readonly KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: readonly ["channel"];
234
+ readonly KICI_WEBHOOK_BUFFER_BYTES: readonly [];
235
+ readonly KICI_WEBHOOK_BUFFER_DEPTH: readonly [];
236
+ readonly KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: readonly [];
237
+ readonly KICI_WEBHOOK_PG_BREAKER_STATE: readonly [];
238
+ readonly KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: readonly [];
239
+ readonly KICI_WEBHOOK_PG_DEGRADED_TOTAL: readonly ["outcome", "org_id"];
221
240
  readonly KICI_WEBHOOK_PROCESSING_SECONDS: readonly ["event"];
241
+ readonly KICI_WEBHOOK_REPLAY_DURATION_SECONDS: readonly [];
222
242
  readonly KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: readonly ["source", "org_id"];
223
243
  readonly KICI_WEBHOOKS_RECEIVED_TOTAL: readonly ["event", "status", "org_id"];
224
244
  readonly KICI_WS_CONNECTIONS_ACTIVE: readonly ["routing_key"];
@@ -289,6 +309,7 @@ export declare const MetricKind: {
289
309
  readonly KICI_ORCH_JOB_RUNS_TOTAL: "counter";
290
310
  readonly KICI_ORCH_LOG_BYTES_STORED_TOTAL: "counter";
291
311
  readonly KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "counter";
312
+ readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: "counter";
292
313
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "counter";
293
314
  readonly KICI_ORCH_SCALER_CPUS_USED: "observableGauge";
294
315
  readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: "observableGauge";
@@ -331,16 +352,25 @@ export declare const MetricKind: {
331
352
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "counter";
332
353
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "counter";
333
354
  readonly KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "counter";
355
+ readonly KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "counter";
334
356
  readonly KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "counter";
335
357
  readonly KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "counter";
336
358
  readonly KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "counter";
337
359
  readonly KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "counter";
360
+ readonly KICI_REGISTRATIONS_TOTAL: "counter";
338
361
  readonly KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "counter";
339
362
  readonly KICI_VALKEY_CONNECTION_STATUS: "observableGauge";
340
363
  readonly KICI_VALKEY_PUBLISH_TOTAL: "counter";
341
364
  readonly KICI_VALKEY_RELAY_LATENCY_SECONDS: "histogram";
342
365
  readonly KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: "counter";
366
+ readonly KICI_WEBHOOK_BUFFER_BYTES: "observableGauge";
367
+ readonly KICI_WEBHOOK_BUFFER_DEPTH: "observableGauge";
368
+ readonly KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: "observableGauge";
369
+ readonly KICI_WEBHOOK_PG_BREAKER_STATE: "observableGauge";
370
+ readonly KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: "counter";
371
+ readonly KICI_WEBHOOK_PG_DEGRADED_TOTAL: "counter";
343
372
  readonly KICI_WEBHOOK_PROCESSING_SECONDS: "histogram";
373
+ readonly KICI_WEBHOOK_REPLAY_DURATION_SECONDS: "histogram";
344
374
  readonly KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: "counter";
345
375
  readonly KICI_WEBHOOKS_RECEIVED_TOTAL: "counter";
346
376
  readonly KICI_WS_CONNECTIONS_ACTIVE: "upDownCounter";
@@ -411,6 +441,7 @@ export declare const MetricDescription: {
411
441
  readonly KICI_ORCH_JOB_RUNS_TOTAL: "Scheduled job run outcomes, by job and result (success/failure)";
412
442
  readonly KICI_ORCH_LOG_BYTES_STORED_TOTAL: "Total bytes of log data written to storage";
413
443
  readonly KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "Total number of log chunks received from agents";
444
+ readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: "Total pg connection errors absorbed without a process restart";
414
445
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "Total number of scaler config reload operations";
415
446
  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.";
416
447
  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.";
@@ -453,16 +484,25 @@ export declare const MetricDescription: {
453
484
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "Total Mimir push-relay errors (Platform-embedded metrics). Labels: reason.";
454
485
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "Orchestrator-pushed metric data points dropped or rewritten by the catalog allow-list. Labels: reason, metric.";
455
486
  readonly KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "Total orphan connections swept from platform_connections";
487
+ readonly KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "Total pg connection errors absorbed without a process restart";
456
488
  readonly KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "Total orchestrators detected as permanently disconnected";
457
489
  readonly KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform_connections rows evicted by source.register DB dedup (same-instance reconnect path)";
458
490
  readonly KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "Total execution runs failed due to orchestrator staleness";
459
491
  readonly KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "Total step status forwards received";
492
+ readonly KICI_REGISTRATIONS_TOTAL: "Total user registrations (new personal orgs created on first login)";
460
493
  readonly KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "Errors encountered while registering universal-git provider bundles";
461
494
  readonly KICI_VALKEY_CONNECTION_STATUS: "Valkey connection status per role (1=connected, 0=disconnected)";
462
495
  readonly KICI_VALKEY_PUBLISH_TOTAL: "Total messages published to Valkey channels";
463
496
  readonly KICI_VALKEY_RELAY_LATENCY_SECONDS: "Latency of cross-instance Valkey relay operations in seconds";
464
497
  readonly KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: "Total messages received from Valkey subscriptions";
498
+ readonly KICI_WEBHOOK_BUFFER_BYTES: "Total buffered webhook bytes (global Valkey counter)";
499
+ readonly KICI_WEBHOOK_BUFFER_DEPTH: "Buffered webhook count per org";
500
+ readonly KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: "Age of the oldest buffered webhook per org, in seconds";
501
+ readonly KICI_WEBHOOK_PG_BREAKER_STATE: "PG circuit-breaker state on this instance (0=closed,1=degraded,2=open)";
502
+ readonly KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: "PG circuit-breaker state transitions";
503
+ readonly KICI_WEBHOOK_PG_DEGRADED_TOTAL: "Webhooks handled in PG-degraded mode, by outcome";
465
504
  readonly KICI_WEBHOOK_PROCESSING_SECONDS: "Webhook processing duration in seconds";
505
+ readonly KICI_WEBHOOK_REPLAY_DURATION_SECONDS: "Buffered-webhook replay latency (enqueue → delivered) in seconds";
466
506
  readonly KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: "Total number of webhooks rejected at orchestrator signature verification";
467
507
  readonly KICI_WEBHOOKS_RECEIVED_TOTAL: "Total number of webhooks received";
468
508
  readonly KICI_WS_CONNECTIONS_ACTIVE: "Current number of active WebSocket connections";
@@ -540,6 +580,7 @@ export declare const MetricService: {
540
580
  readonly KICI_ORCH_JOB_RUNS_TOTAL: "orchestrator";
541
581
  readonly KICI_ORCH_LOG_BYTES_STORED_TOTAL: "orchestrator";
542
582
  readonly KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "orchestrator";
583
+ readonly KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: "orchestrator";
543
584
  readonly KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "orchestrator";
544
585
  readonly KICI_ORCH_SCALER_CPUS_USED: "orchestrator";
545
586
  readonly KICI_ORCH_SCALER_MEMORY_BYTES_USED: "orchestrator";
@@ -582,16 +623,25 @@ export declare const MetricService: {
582
623
  readonly KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "platform";
583
624
  readonly KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "platform";
584
625
  readonly KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "platform";
626
+ readonly KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "platform";
585
627
  readonly KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "platform";
586
628
  readonly KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform";
587
629
  readonly KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "platform";
588
630
  readonly KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "platform";
631
+ readonly KICI_REGISTRATIONS_TOTAL: "platform";
589
632
  readonly KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "orchestrator";
590
633
  readonly KICI_VALKEY_CONNECTION_STATUS: "platform";
591
634
  readonly KICI_VALKEY_PUBLISH_TOTAL: "platform";
592
635
  readonly KICI_VALKEY_RELAY_LATENCY_SECONDS: "platform";
593
636
  readonly KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: "platform";
637
+ readonly KICI_WEBHOOK_BUFFER_BYTES: "platform";
638
+ readonly KICI_WEBHOOK_BUFFER_DEPTH: "platform";
639
+ readonly KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: "platform";
640
+ readonly KICI_WEBHOOK_PG_BREAKER_STATE: "platform";
641
+ readonly KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: "platform";
642
+ readonly KICI_WEBHOOK_PG_DEGRADED_TOTAL: "platform";
594
643
  readonly KICI_WEBHOOK_PROCESSING_SECONDS: "platform";
644
+ readonly KICI_WEBHOOK_REPLAY_DURATION_SECONDS: "platform";
595
645
  readonly KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: "platform";
596
646
  readonly KICI_WEBHOOKS_RECEIVED_TOTAL: "platform";
597
647
  readonly KICI_WS_CONNECTIONS_ACTIVE: "platform";
@@ -46,6 +46,7 @@ const MetricNames = {
46
46
  KICI_ORCH_JOB_RUNS_TOTAL: "kici_orch_job_runs_total",
47
47
  KICI_ORCH_LOG_BYTES_STORED_TOTAL: "kici_orch_log_bytes_stored_total",
48
48
  KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "kici_orch_log_chunks_received_total",
49
+ KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: "kici_orch_pg_pool_client_errors_total",
49
50
  KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "kici_orch_scaler_config_reloads_total",
50
51
  KICI_ORCH_SCALER_CPUS_USED: "kici_orch_scaler_cpus_used",
51
52
  KICI_ORCH_SCALER_MEMORY_BYTES_USED: "kici_orch_scaler_memory_bytes_used",
@@ -88,16 +89,25 @@ const MetricNames = {
88
89
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "kici_platform_mimir_relay_errors_total",
89
90
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "kici_platform_orch_metrics_filtered_total",
90
91
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "kici_platform_orphan_connections_swept_total",
92
+ KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "kici_platform_pg_pool_client_errors_total",
91
93
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "kici_platform_stale_orchestrators_total",
92
94
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "kici_platform_stale_platform_connections_evicted_total",
93
95
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "kici_platform_stale_runs_failed_total",
94
96
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "kici_platform_step_status_forwards_total",
97
+ KICI_REGISTRATIONS_TOTAL: "kici_registrations_total",
95
98
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "kici_universal_git_registration_errors_total",
96
99
  KICI_VALKEY_CONNECTION_STATUS: "kici_valkey_connection_status",
97
100
  KICI_VALKEY_PUBLISH_TOTAL: "kici_valkey_publish_total",
98
101
  KICI_VALKEY_RELAY_LATENCY_SECONDS: "kici_valkey_relay_latency_seconds",
99
102
  KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: "kici_valkey_subscribe_receive_total",
103
+ KICI_WEBHOOK_BUFFER_BYTES: "kici_webhook_buffer_bytes",
104
+ KICI_WEBHOOK_BUFFER_DEPTH: "kici_webhook_buffer_depth",
105
+ KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: "kici_webhook_buffer_oldest_age_seconds",
106
+ KICI_WEBHOOK_PG_BREAKER_STATE: "kici_webhook_pg_breaker_state",
107
+ KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: "kici_webhook_pg_breaker_transitions_total",
108
+ KICI_WEBHOOK_PG_DEGRADED_TOTAL: "kici_webhook_pg_degraded_total",
100
109
  KICI_WEBHOOK_PROCESSING_SECONDS: "kici_webhook_processing_seconds",
110
+ KICI_WEBHOOK_REPLAY_DURATION_SECONDS: "kici_webhook_replay_duration_seconds",
101
111
  KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: "kici_webhook_signature_failures_total",
102
112
  KICI_WEBHOOKS_RECEIVED_TOTAL: "kici_webhooks_received_total",
103
113
  KICI_WS_CONNECTIONS_ACTIVE: "kici_ws_connections_active",
@@ -172,6 +182,7 @@ const MetricLabels = {
172
182
  KICI_ORCH_JOB_RUNS_TOTAL: ["job", "result"],
173
183
  KICI_ORCH_LOG_BYTES_STORED_TOTAL: [],
174
184
  KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: [],
185
+ KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: ["source"],
175
186
  KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: ["result"],
176
187
  KICI_ORCH_SCALER_CPUS_USED: ["scaler", "machinePool"],
177
188
  KICI_ORCH_SCALER_MEMORY_BYTES_USED: ["scaler", "machinePool"],
@@ -214,16 +225,25 @@ const MetricLabels = {
214
225
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: ["reason"],
215
226
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: ["reason", "metric"],
216
227
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: [],
228
+ KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: ["source"],
217
229
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: [],
218
230
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: ["org_id"],
219
231
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: [],
220
232
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: ["state"],
233
+ KICI_REGISTRATIONS_TOTAL: [],
221
234
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: ["reason"],
222
235
  KICI_VALKEY_CONNECTION_STATUS: ["role"],
223
236
  KICI_VALKEY_PUBLISH_TOTAL: ["channel"],
224
237
  KICI_VALKEY_RELAY_LATENCY_SECONDS: ["status"],
225
238
  KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: ["channel"],
239
+ KICI_WEBHOOK_BUFFER_BYTES: [],
240
+ KICI_WEBHOOK_BUFFER_DEPTH: [],
241
+ KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: [],
242
+ KICI_WEBHOOK_PG_BREAKER_STATE: [],
243
+ KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: [],
244
+ KICI_WEBHOOK_PG_DEGRADED_TOTAL: ["outcome", "org_id"],
226
245
  KICI_WEBHOOK_PROCESSING_SECONDS: ["event"],
246
+ KICI_WEBHOOK_REPLAY_DURATION_SECONDS: [],
227
247
  KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: ["source", "org_id"],
228
248
  KICI_WEBHOOKS_RECEIVED_TOTAL: [
229
249
  "event",
@@ -298,6 +318,7 @@ const MetricKind = {
298
318
  KICI_ORCH_JOB_RUNS_TOTAL: "counter",
299
319
  KICI_ORCH_LOG_BYTES_STORED_TOTAL: "counter",
300
320
  KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "counter",
321
+ KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: "counter",
301
322
  KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "counter",
302
323
  KICI_ORCH_SCALER_CPUS_USED: "observableGauge",
303
324
  KICI_ORCH_SCALER_MEMORY_BYTES_USED: "observableGauge",
@@ -340,16 +361,25 @@ const MetricKind = {
340
361
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "counter",
341
362
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "counter",
342
363
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "counter",
364
+ KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "counter",
343
365
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "counter",
344
366
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "counter",
345
367
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "counter",
346
368
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "counter",
369
+ KICI_REGISTRATIONS_TOTAL: "counter",
347
370
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "counter",
348
371
  KICI_VALKEY_CONNECTION_STATUS: "observableGauge",
349
372
  KICI_VALKEY_PUBLISH_TOTAL: "counter",
350
373
  KICI_VALKEY_RELAY_LATENCY_SECONDS: "histogram",
351
374
  KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: "counter",
375
+ KICI_WEBHOOK_BUFFER_BYTES: "observableGauge",
376
+ KICI_WEBHOOK_BUFFER_DEPTH: "observableGauge",
377
+ KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: "observableGauge",
378
+ KICI_WEBHOOK_PG_BREAKER_STATE: "observableGauge",
379
+ KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: "counter",
380
+ KICI_WEBHOOK_PG_DEGRADED_TOTAL: "counter",
352
381
  KICI_WEBHOOK_PROCESSING_SECONDS: "histogram",
382
+ KICI_WEBHOOK_REPLAY_DURATION_SECONDS: "histogram",
353
383
  KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: "counter",
354
384
  KICI_WEBHOOKS_RECEIVED_TOTAL: "counter",
355
385
  KICI_WS_CONNECTIONS_ACTIVE: "upDownCounter",
@@ -420,6 +450,7 @@ const MetricDescription = {
420
450
  KICI_ORCH_JOB_RUNS_TOTAL: "Scheduled job run outcomes, by job and result (success/failure)",
421
451
  KICI_ORCH_LOG_BYTES_STORED_TOTAL: "Total bytes of log data written to storage",
422
452
  KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "Total number of log chunks received from agents",
453
+ KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: "Total pg connection errors absorbed without a process restart",
423
454
  KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "Total number of scaler config reload operations",
424
455
  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.",
425
456
  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.",
@@ -462,16 +493,25 @@ const MetricDescription = {
462
493
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "Total Mimir push-relay errors (Platform-embedded metrics). Labels: reason.",
463
494
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "Orchestrator-pushed metric data points dropped or rewritten by the catalog allow-list. Labels: reason, metric.",
464
495
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "Total orphan connections swept from platform_connections",
496
+ KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "Total pg connection errors absorbed without a process restart",
465
497
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "Total orchestrators detected as permanently disconnected",
466
498
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform_connections rows evicted by source.register DB dedup (same-instance reconnect path)",
467
499
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "Total execution runs failed due to orchestrator staleness",
468
500
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "Total step status forwards received",
501
+ KICI_REGISTRATIONS_TOTAL: "Total user registrations (new personal orgs created on first login)",
469
502
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "Errors encountered while registering universal-git provider bundles",
470
503
  KICI_VALKEY_CONNECTION_STATUS: "Valkey connection status per role (1=connected, 0=disconnected)",
471
504
  KICI_VALKEY_PUBLISH_TOTAL: "Total messages published to Valkey channels",
472
505
  KICI_VALKEY_RELAY_LATENCY_SECONDS: "Latency of cross-instance Valkey relay operations in seconds",
473
506
  KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: "Total messages received from Valkey subscriptions",
507
+ KICI_WEBHOOK_BUFFER_BYTES: "Total buffered webhook bytes (global Valkey counter)",
508
+ KICI_WEBHOOK_BUFFER_DEPTH: "Buffered webhook count per org",
509
+ KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: "Age of the oldest buffered webhook per org, in seconds",
510
+ KICI_WEBHOOK_PG_BREAKER_STATE: "PG circuit-breaker state on this instance (0=closed,1=degraded,2=open)",
511
+ KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: "PG circuit-breaker state transitions",
512
+ KICI_WEBHOOK_PG_DEGRADED_TOTAL: "Webhooks handled in PG-degraded mode, by outcome",
474
513
  KICI_WEBHOOK_PROCESSING_SECONDS: "Webhook processing duration in seconds",
514
+ KICI_WEBHOOK_REPLAY_DURATION_SECONDS: "Buffered-webhook replay latency (enqueue → delivered) in seconds",
475
515
  KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: "Total number of webhooks rejected at orchestrator signature verification",
476
516
  KICI_WEBHOOKS_RECEIVED_TOTAL: "Total number of webhooks received",
477
517
  KICI_WS_CONNECTIONS_ACTIVE: "Current number of active WebSocket connections",
@@ -549,6 +589,7 @@ const MetricService = {
549
589
  KICI_ORCH_JOB_RUNS_TOTAL: "orchestrator",
550
590
  KICI_ORCH_LOG_BYTES_STORED_TOTAL: "orchestrator",
551
591
  KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "orchestrator",
592
+ KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: "orchestrator",
552
593
  KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "orchestrator",
553
594
  KICI_ORCH_SCALER_CPUS_USED: "orchestrator",
554
595
  KICI_ORCH_SCALER_MEMORY_BYTES_USED: "orchestrator",
@@ -591,16 +632,25 @@ const MetricService = {
591
632
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "platform",
592
633
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "platform",
593
634
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "platform",
635
+ KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "platform",
594
636
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "platform",
595
637
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform",
596
638
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "platform",
597
639
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "platform",
640
+ KICI_REGISTRATIONS_TOTAL: "platform",
598
641
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "orchestrator",
599
642
  KICI_VALKEY_CONNECTION_STATUS: "platform",
600
643
  KICI_VALKEY_PUBLISH_TOTAL: "platform",
601
644
  KICI_VALKEY_RELAY_LATENCY_SECONDS: "platform",
602
645
  KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: "platform",
646
+ KICI_WEBHOOK_BUFFER_BYTES: "platform",
647
+ KICI_WEBHOOK_BUFFER_DEPTH: "platform",
648
+ KICI_WEBHOOK_BUFFER_OLDEST_AGE_SECONDS: "platform",
649
+ KICI_WEBHOOK_PG_BREAKER_STATE: "platform",
650
+ KICI_WEBHOOK_PG_BREAKER_TRANSITIONS_TOTAL: "platform",
651
+ KICI_WEBHOOK_PG_DEGRADED_TOTAL: "platform",
603
652
  KICI_WEBHOOK_PROCESSING_SECONDS: "platform",
653
+ KICI_WEBHOOK_REPLAY_DURATION_SECONDS: "platform",
604
654
  KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: "platform",
605
655
  KICI_WEBHOOKS_RECEIVED_TOTAL: "platform",
606
656
  KICI_WS_CONNECTIONS_ACTIVE: "platform",
@@ -672,6 +722,7 @@ const ALL_METRIC_NAMES = [
672
722
  "kici_orch_job_runs_total",
673
723
  "kici_orch_log_bytes_stored_total",
674
724
  "kici_orch_log_chunks_received_total",
725
+ "kici_orch_pg_pool_client_errors_total",
675
726
  "kici_orch_scaler_config_reloads_total",
676
727
  "kici_orch_scaler_cpus_used",
677
728
  "kici_orch_scaler_memory_bytes_used",
@@ -714,16 +765,25 @@ const ALL_METRIC_NAMES = [
714
765
  "kici_platform_mimir_relay_errors_total",
715
766
  "kici_platform_orch_metrics_filtered_total",
716
767
  "kici_platform_orphan_connections_swept_total",
768
+ "kici_platform_pg_pool_client_errors_total",
717
769
  "kici_platform_stale_orchestrators_total",
718
770
  "kici_platform_stale_platform_connections_evicted_total",
719
771
  "kici_platform_stale_runs_failed_total",
720
772
  "kici_platform_step_status_forwards_total",
773
+ "kici_registrations_total",
721
774
  "kici_universal_git_registration_errors_total",
722
775
  "kici_valkey_connection_status",
723
776
  "kici_valkey_publish_total",
724
777
  "kici_valkey_relay_latency_seconds",
725
778
  "kici_valkey_subscribe_receive_total",
779
+ "kici_webhook_buffer_bytes",
780
+ "kici_webhook_buffer_depth",
781
+ "kici_webhook_buffer_oldest_age_seconds",
782
+ "kici_webhook_pg_breaker_state",
783
+ "kici_webhook_pg_breaker_transitions_total",
784
+ "kici_webhook_pg_degraded_total",
726
785
  "kici_webhook_processing_seconds",
786
+ "kici_webhook_replay_duration_seconds",
727
787
  "kici_webhook_signature_failures_total",
728
788
  "kici_webhooks_received_total",
729
789
  "kici_ws_connections_active",
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ export declare const AnalyticsEvent: z.ZodEnum<{
3
+ login: "login";
4
+ org_created: "org_created";
5
+ secret_created: "secret_created";
6
+ workflow_run_triggered: "workflow_run_triggered";
7
+ run_viewed: "run_viewed";
8
+ billing_plan_selected: "billing_plan_selected";
9
+ code_copy: "code_copy";
10
+ docs_search: "docs_search";
11
+ cta_dashboard: "cta_dashboard";
12
+ }>;
13
+ export type AnalyticsEvent = z.infer<typeof AnalyticsEvent>;
14
+ /** The catalogue as a plain array (for build-time mirroring + tests). */
15
+ export declare const ANALYTICS_EVENTS: ("login" | "org_created" | "secret_created" | "workflow_run_triggered" | "run_viewed" | "billing_plan_selected" | "code_copy" | "docs_search" | "cta_dashboard")[];
16
+ //# sourceMappingURL=analytics-events.d.ts.map
@@ -0,0 +1,20 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import { z } from "zod";
3
+ //#region src/protocol/analytics-events.ts
4
+ const AnalyticsEvent = z.enum([
5
+ "login",
6
+ "org_created",
7
+ "secret_created",
8
+ "workflow_run_triggered",
9
+ "run_viewed",
10
+ "billing_plan_selected",
11
+ "code_copy",
12
+ "docs_search",
13
+ "cta_dashboard"
14
+ ]);
15
+ /** The catalogue as a plain array (for build-time mirroring + tests). */
16
+ const ANALYTICS_EVENTS = AnalyticsEvent.options;
17
+ //#endregion
18
+ export { ANALYTICS_EVENTS, AnalyticsEvent };
19
+
20
+ //# sourceMappingURL=analytics-events.js.map