@kici-dev/engine 0.1.3 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit/access-log-policy.js +4 -1
- package/dist/audit/retention-policy.js +9 -2
- package/dist/index.js +3 -3
- package/dist/metrics/catalog-policy.d.ts +67 -0
- package/dist/metrics/catalog-policy.js +246 -0
- package/dist/metrics/metric-catalog.generated.d.ts +219 -2
- package/dist/metrics/metric-catalog.generated.js +246 -8
- package/dist/protocol/cluster-name.d.ts +35 -0
- package/dist/protocol/cluster-name.js +43 -0
- package/dist/protocol/dashboard-write-operations.d.ts +170 -0
- package/dist/protocol/dashboard-write-operations.js +324 -0
- package/dist/protocol/messages/access-log.d.ts +51 -26
- package/dist/protocol/messages/access-log.js +8 -3
- package/dist/protocol/messages/actor.js +3 -3
- package/dist/protocol/messages/auth.d.ts +25 -0
- package/dist/protocol/messages/capabilities.d.ts +25 -0
- package/dist/protocol/messages/capabilities.js +14 -3
- package/dist/protocol/messages/dashboard.d.ts +311 -10
- package/dist/protocol/messages/dashboard.js +85 -1
- package/dist/protocol/messages/platform-orchestrator.d.ts +225 -7
- package/dist/protocol/messages/platform-orchestrator.js +41 -8
- package/dist/protocol/messages/source-registration.d.ts +19 -1
- package/dist/protocol/messages/source-registration.js +35 -2
- package/dist/registration/registerable-trigger-type.d.ts +1 -1
- package/dist/ws/close-codes.d.ts +6 -0
- package/dist/ws/close-codes.js +7 -1
- package/package.json +13 -2
- package/sbom.spdx.json +5 -5
|
@@ -16,6 +16,7 @@ const MetricNames = {
|
|
|
16
16
|
KICI_CACHE_MISSES_TOTAL: "kici_cache_misses_total",
|
|
17
17
|
KICI_CROSS_SOURCE_ERRORS_TOTAL: "kici_cross_source_errors_total",
|
|
18
18
|
KICI_CROSS_SOURCE_FANOUT_SIZE: "kici_cross_source_fanout_size",
|
|
19
|
+
KICI_DASHBOARD_RELAY_LATENCY_SECONDS: "kici_dashboard_relay_latency_seconds",
|
|
19
20
|
KICI_ORCH_AGENTS_ACTIVE: "kici_orch_agents_active",
|
|
20
21
|
KICI_ORCH_BUILD_DURATION_SECONDS: "kici_orch_build_duration_seconds",
|
|
21
22
|
KICI_ORCH_CONFIG_RELOAD_TOTAL: "kici_orch_config_reload_total",
|
|
@@ -38,6 +39,11 @@ const MetricNames = {
|
|
|
38
39
|
KICI_ORCH_INSTALL_SECRETS_DECISIONS_TOTAL: "kici_orch_install_secrets_decisions_total",
|
|
39
40
|
KICI_ORCH_INSTALL_SECRETS_NPM_REGISTRY_USED_TOTAL: "kici_orch_install_secrets_npm_registry_used_total",
|
|
40
41
|
KICI_ORCH_INSTALL_SECRETS_TOKEN_RESOLUTION_DURATION_SECONDS: "kici_orch_install_secrets_token_resolution_duration_seconds",
|
|
42
|
+
KICI_ORCH_JOB_CONSECUTIVE_FAILURES: "kici_orch_job_consecutive_failures",
|
|
43
|
+
KICI_ORCH_JOB_DURATION_SECONDS: "kici_orch_job_duration_seconds",
|
|
44
|
+
KICI_ORCH_JOB_LAST_FAILURE_TIMESTAMP_SECONDS: "kici_orch_job_last_failure_timestamp_seconds",
|
|
45
|
+
KICI_ORCH_JOB_LAST_SUCCESS_TIMESTAMP_SECONDS: "kici_orch_job_last_success_timestamp_seconds",
|
|
46
|
+
KICI_ORCH_JOB_RUNS_TOTAL: "kici_orch_job_runs_total",
|
|
41
47
|
KICI_ORCH_LOG_BYTES_STORED_TOTAL: "kici_orch_log_bytes_stored_total",
|
|
42
48
|
KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "kici_orch_log_chunks_received_total",
|
|
43
49
|
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "kici_orch_scaler_config_reloads_total",
|
|
@@ -79,8 +85,10 @@ const MetricNames = {
|
|
|
79
85
|
KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "kici_platform_log_lines_forwarded_total",
|
|
80
86
|
KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "kici_platform_metrics_query_rate_limited_total",
|
|
81
87
|
KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "kici_platform_mimir_relay_errors_total",
|
|
88
|
+
KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "kici_platform_orch_metrics_filtered_total",
|
|
82
89
|
KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "kici_platform_orphan_connections_swept_total",
|
|
83
90
|
KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "kici_platform_stale_orchestrators_total",
|
|
91
|
+
KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "kici_platform_stale_platform_connections_evicted_total",
|
|
84
92
|
KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "kici_platform_stale_runs_failed_total",
|
|
85
93
|
KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "kici_platform_step_status_forwards_total",
|
|
86
94
|
KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "kici_universal_git_registration_errors_total",
|
|
@@ -97,7 +105,21 @@ const MetricNames = {
|
|
|
97
105
|
KICI_WS_MESSAGES_RECEIVED_TOTAL: "kici_ws_messages_received_total",
|
|
98
106
|
KICI_WS_MESSAGES_SENT_TOTAL: "kici_ws_messages_sent_total",
|
|
99
107
|
KICI_WS_RELAY_ATTEMPTS_TOTAL: "kici_ws_relay_attempts_total",
|
|
100
|
-
KICI_WS_RELAY_DURATION_SECONDS: "kici_ws_relay_duration_seconds"
|
|
108
|
+
KICI_WS_RELAY_DURATION_SECONDS: "kici_ws_relay_duration_seconds",
|
|
109
|
+
NODEJS_EVENTLOOP_DELAY_MAX: "nodejs.eventloop.delay.max",
|
|
110
|
+
NODEJS_EVENTLOOP_DELAY_MEAN: "nodejs.eventloop.delay.mean",
|
|
111
|
+
NODEJS_EVENTLOOP_DELAY_MIN: "nodejs.eventloop.delay.min",
|
|
112
|
+
NODEJS_EVENTLOOP_DELAY_P50: "nodejs.eventloop.delay.p50",
|
|
113
|
+
NODEJS_EVENTLOOP_DELAY_P90: "nodejs.eventloop.delay.p90",
|
|
114
|
+
NODEJS_EVENTLOOP_DELAY_P99: "nodejs.eventloop.delay.p99",
|
|
115
|
+
NODEJS_EVENTLOOP_DELAY_STDDEV: "nodejs.eventloop.delay.stddev",
|
|
116
|
+
NODEJS_EVENTLOOP_TIME: "nodejs.eventloop.time",
|
|
117
|
+
NODEJS_EVENTLOOP_UTILIZATION: "nodejs.eventloop.utilization",
|
|
118
|
+
V8JS_GC_DURATION: "v8js.gc.duration",
|
|
119
|
+
V8JS_MEMORY_HEAP_LIMIT: "v8js.memory.heap.limit",
|
|
120
|
+
V8JS_MEMORY_HEAP_SPACE_AVAILABLE_SIZE: "v8js.memory.heap.space.available_size",
|
|
121
|
+
V8JS_MEMORY_HEAP_SPACE_PHYSICAL_SIZE: "v8js.memory.heap.space.physical_size",
|
|
122
|
+
V8JS_MEMORY_HEAP_USED: "v8js.memory.heap.used"
|
|
101
123
|
};
|
|
102
124
|
const MetricLabels = {
|
|
103
125
|
KICI_AGENT_CLONE_DURATION_SECONDS: ["scaler"],
|
|
@@ -115,6 +137,7 @@ const MetricLabels = {
|
|
|
115
137
|
KICI_CACHE_MISSES_TOTAL: ["cache_type"],
|
|
116
138
|
KICI_CROSS_SOURCE_ERRORS_TOTAL: ["reason"],
|
|
117
139
|
KICI_CROSS_SOURCE_FANOUT_SIZE: [],
|
|
140
|
+
KICI_DASHBOARD_RELAY_LATENCY_SECONDS: ["outcome"],
|
|
118
141
|
KICI_ORCH_AGENTS_ACTIVE: [],
|
|
119
142
|
KICI_ORCH_BUILD_DURATION_SECONDS: [],
|
|
120
143
|
KICI_ORCH_CONFIG_RELOAD_TOTAL: ["result", "source"],
|
|
@@ -141,11 +164,16 @@ const MetricLabels = {
|
|
|
141
164
|
"scope"
|
|
142
165
|
],
|
|
143
166
|
KICI_ORCH_INSTALL_SECRETS_TOKEN_RESOLUTION_DURATION_SECONDS: ["environment"],
|
|
167
|
+
KICI_ORCH_JOB_CONSECUTIVE_FAILURES: ["job"],
|
|
168
|
+
KICI_ORCH_JOB_DURATION_SECONDS: ["job"],
|
|
169
|
+
KICI_ORCH_JOB_LAST_FAILURE_TIMESTAMP_SECONDS: ["job"],
|
|
170
|
+
KICI_ORCH_JOB_LAST_SUCCESS_TIMESTAMP_SECONDS: ["job"],
|
|
171
|
+
KICI_ORCH_JOB_RUNS_TOTAL: ["job", "result"],
|
|
144
172
|
KICI_ORCH_LOG_BYTES_STORED_TOTAL: [],
|
|
145
173
|
KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: [],
|
|
146
174
|
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: ["result"],
|
|
147
|
-
KICI_ORCH_SCALER_CPUS_USED: [],
|
|
148
|
-
KICI_ORCH_SCALER_MEMORY_BYTES_USED: [],
|
|
175
|
+
KICI_ORCH_SCALER_CPUS_USED: ["scaler", "machinePool"],
|
|
176
|
+
KICI_ORCH_SCALER_MEMORY_BYTES_USED: ["scaler", "machinePool"],
|
|
149
177
|
KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: [],
|
|
150
178
|
KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: [],
|
|
151
179
|
KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: [],
|
|
@@ -182,8 +210,10 @@ const MetricLabels = {
|
|
|
182
210
|
KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: [],
|
|
183
211
|
KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: [],
|
|
184
212
|
KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: ["reason"],
|
|
213
|
+
KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: [],
|
|
185
214
|
KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: [],
|
|
186
215
|
KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: [],
|
|
216
|
+
KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: ["org_id"],
|
|
187
217
|
KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: [],
|
|
188
218
|
KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: ["state"],
|
|
189
219
|
KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: ["reason"],
|
|
@@ -204,7 +234,21 @@ const MetricLabels = {
|
|
|
204
234
|
KICI_WS_MESSAGES_RECEIVED_TOTAL: ["type"],
|
|
205
235
|
KICI_WS_MESSAGES_SENT_TOTAL: ["type"],
|
|
206
236
|
KICI_WS_RELAY_ATTEMPTS_TOTAL: ["status"],
|
|
207
|
-
KICI_WS_RELAY_DURATION_SECONDS: ["status"]
|
|
237
|
+
KICI_WS_RELAY_DURATION_SECONDS: ["status"],
|
|
238
|
+
NODEJS_EVENTLOOP_DELAY_MAX: ["scaler"],
|
|
239
|
+
NODEJS_EVENTLOOP_DELAY_MEAN: ["scaler"],
|
|
240
|
+
NODEJS_EVENTLOOP_DELAY_MIN: ["scaler"],
|
|
241
|
+
NODEJS_EVENTLOOP_DELAY_P50: ["scaler"],
|
|
242
|
+
NODEJS_EVENTLOOP_DELAY_P90: ["scaler"],
|
|
243
|
+
NODEJS_EVENTLOOP_DELAY_P99: ["scaler"],
|
|
244
|
+
NODEJS_EVENTLOOP_DELAY_STDDEV: ["scaler"],
|
|
245
|
+
NODEJS_EVENTLOOP_TIME: ["nodejs.eventloop.state", "scaler"],
|
|
246
|
+
NODEJS_EVENTLOOP_UTILIZATION: ["scaler"],
|
|
247
|
+
V8JS_GC_DURATION: ["v8js.gc.type", "scaler"],
|
|
248
|
+
V8JS_MEMORY_HEAP_LIMIT: ["v8js.heap.space.name", "scaler"],
|
|
249
|
+
V8JS_MEMORY_HEAP_SPACE_AVAILABLE_SIZE: ["v8js.heap.space.name", "scaler"],
|
|
250
|
+
V8JS_MEMORY_HEAP_SPACE_PHYSICAL_SIZE: ["v8js.heap.space.name", "scaler"],
|
|
251
|
+
V8JS_MEMORY_HEAP_USED: ["v8js.heap.space.name", "scaler"]
|
|
208
252
|
};
|
|
209
253
|
const MetricKind = {
|
|
210
254
|
KICI_AGENT_CLONE_DURATION_SECONDS: "histogram",
|
|
@@ -222,6 +266,7 @@ const MetricKind = {
|
|
|
222
266
|
KICI_CACHE_MISSES_TOTAL: "counter",
|
|
223
267
|
KICI_CROSS_SOURCE_ERRORS_TOTAL: "counter",
|
|
224
268
|
KICI_CROSS_SOURCE_FANOUT_SIZE: "histogram",
|
|
269
|
+
KICI_DASHBOARD_RELAY_LATENCY_SECONDS: "histogram",
|
|
225
270
|
KICI_ORCH_AGENTS_ACTIVE: "observableGauge",
|
|
226
271
|
KICI_ORCH_BUILD_DURATION_SECONDS: "histogram",
|
|
227
272
|
KICI_ORCH_CONFIG_RELOAD_TOTAL: "counter",
|
|
@@ -244,6 +289,11 @@ const MetricKind = {
|
|
|
244
289
|
KICI_ORCH_INSTALL_SECRETS_DECISIONS_TOTAL: "counter",
|
|
245
290
|
KICI_ORCH_INSTALL_SECRETS_NPM_REGISTRY_USED_TOTAL: "counter",
|
|
246
291
|
KICI_ORCH_INSTALL_SECRETS_TOKEN_RESOLUTION_DURATION_SECONDS: "histogram",
|
|
292
|
+
KICI_ORCH_JOB_CONSECUTIVE_FAILURES: "observableGauge",
|
|
293
|
+
KICI_ORCH_JOB_DURATION_SECONDS: "histogram",
|
|
294
|
+
KICI_ORCH_JOB_LAST_FAILURE_TIMESTAMP_SECONDS: "observableGauge",
|
|
295
|
+
KICI_ORCH_JOB_LAST_SUCCESS_TIMESTAMP_SECONDS: "observableGauge",
|
|
296
|
+
KICI_ORCH_JOB_RUNS_TOTAL: "counter",
|
|
247
297
|
KICI_ORCH_LOG_BYTES_STORED_TOTAL: "counter",
|
|
248
298
|
KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "counter",
|
|
249
299
|
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "counter",
|
|
@@ -285,8 +335,10 @@ const MetricKind = {
|
|
|
285
335
|
KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "counter",
|
|
286
336
|
KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "counter",
|
|
287
337
|
KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "counter",
|
|
338
|
+
KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "counter",
|
|
288
339
|
KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "counter",
|
|
289
340
|
KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "counter",
|
|
341
|
+
KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "counter",
|
|
290
342
|
KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "counter",
|
|
291
343
|
KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "counter",
|
|
292
344
|
KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "counter",
|
|
@@ -303,7 +355,21 @@ const MetricKind = {
|
|
|
303
355
|
KICI_WS_MESSAGES_RECEIVED_TOTAL: "counter",
|
|
304
356
|
KICI_WS_MESSAGES_SENT_TOTAL: "counter",
|
|
305
357
|
KICI_WS_RELAY_ATTEMPTS_TOTAL: "counter",
|
|
306
|
-
KICI_WS_RELAY_DURATION_SECONDS: "histogram"
|
|
358
|
+
KICI_WS_RELAY_DURATION_SECONDS: "histogram",
|
|
359
|
+
NODEJS_EVENTLOOP_DELAY_MAX: "gauge",
|
|
360
|
+
NODEJS_EVENTLOOP_DELAY_MEAN: "gauge",
|
|
361
|
+
NODEJS_EVENTLOOP_DELAY_MIN: "gauge",
|
|
362
|
+
NODEJS_EVENTLOOP_DELAY_P50: "gauge",
|
|
363
|
+
NODEJS_EVENTLOOP_DELAY_P90: "gauge",
|
|
364
|
+
NODEJS_EVENTLOOP_DELAY_P99: "gauge",
|
|
365
|
+
NODEJS_EVENTLOOP_DELAY_STDDEV: "gauge",
|
|
366
|
+
NODEJS_EVENTLOOP_TIME: "counter",
|
|
367
|
+
NODEJS_EVENTLOOP_UTILIZATION: "gauge",
|
|
368
|
+
V8JS_GC_DURATION: "histogram",
|
|
369
|
+
V8JS_MEMORY_HEAP_LIMIT: "gauge",
|
|
370
|
+
V8JS_MEMORY_HEAP_SPACE_AVAILABLE_SIZE: "gauge",
|
|
371
|
+
V8JS_MEMORY_HEAP_SPACE_PHYSICAL_SIZE: "gauge",
|
|
372
|
+
V8JS_MEMORY_HEAP_USED: "gauge"
|
|
307
373
|
};
|
|
308
374
|
const MetricDescription = {
|
|
309
375
|
KICI_AGENT_CLONE_DURATION_SECONDS: "Git clone duration in seconds",
|
|
@@ -321,6 +387,7 @@ const MetricDescription = {
|
|
|
321
387
|
KICI_CACHE_MISSES_TOTAL: "Total cache misses by type",
|
|
322
388
|
KICI_CROSS_SOURCE_ERRORS_TOTAL: "Errors encountered during cross-source webhook dispatch",
|
|
323
389
|
KICI_CROSS_SOURCE_FANOUT_SIZE: "Number of webhook-trigger registrations matched when an inbound generic webhook fans out across sources in the same org",
|
|
390
|
+
KICI_DASHBOARD_RELAY_LATENCY_SECONDS: "Round-trip latency of a cross-instance dashboard relay request",
|
|
324
391
|
KICI_ORCH_AGENTS_ACTIVE: "Current number of active agents connected",
|
|
325
392
|
KICI_ORCH_BUILD_DURATION_SECONDS: "Duration of build agent operations in seconds",
|
|
326
393
|
KICI_ORCH_CONFIG_RELOAD_TOTAL: "Total number of config reload operations",
|
|
@@ -343,6 +410,11 @@ const MetricDescription = {
|
|
|
343
410
|
KICI_ORCH_INSTALL_SECRETS_DECISIONS_TOTAL: "Total install-secrets resolution decisions (pass / reject + reason)",
|
|
344
411
|
KICI_ORCH_INSTALL_SECRETS_NPM_REGISTRY_USED_TOTAL: "Total registry / installEnv entries successfully resolved per channel / provider / scope",
|
|
345
412
|
KICI_ORCH_INSTALL_SECRETS_TOKEN_RESOLUTION_DURATION_SECONDS: "Duration of per-environment secret resolution during install-secrets evaluation",
|
|
413
|
+
KICI_ORCH_JOB_CONSECUTIVE_FAILURES: "Consecutive failures for each scheduled job since its last success",
|
|
414
|
+
KICI_ORCH_JOB_DURATION_SECONDS: "Scheduled job tick duration in seconds",
|
|
415
|
+
KICI_ORCH_JOB_LAST_FAILURE_TIMESTAMP_SECONDS: "Unix timestamp of the most recent failed scheduled job tick",
|
|
416
|
+
KICI_ORCH_JOB_LAST_SUCCESS_TIMESTAMP_SECONDS: "Unix timestamp of the most recent successful scheduled job tick",
|
|
417
|
+
KICI_ORCH_JOB_RUNS_TOTAL: "Scheduled job run outcomes, by job and result (success/failure)",
|
|
346
418
|
KICI_ORCH_LOG_BYTES_STORED_TOTAL: "Total bytes of log data written to storage",
|
|
347
419
|
KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "Total number of log chunks received from agents",
|
|
348
420
|
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "Total number of scaler config reload operations",
|
|
@@ -384,8 +456,10 @@ const MetricDescription = {
|
|
|
384
456
|
KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "Total log lines forwarded from orchestrators",
|
|
385
457
|
KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "Total dashboard metric-query requests rate-limited (429).",
|
|
386
458
|
KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "Total Mimir push-relay errors (Platform-embedded metrics). Labels: reason.",
|
|
459
|
+
KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "Orchestrator-pushed metric data points dropped or rewritten by the catalog allow-list. Labels: reason.",
|
|
387
460
|
KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "Total orphan connections swept from platform_connections",
|
|
388
461
|
KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "Total orchestrators detected as permanently disconnected",
|
|
462
|
+
KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform_connections rows evicted by source.register DB dedup (same-instance reconnect path)",
|
|
389
463
|
KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "Total execution runs failed due to orchestrator staleness",
|
|
390
464
|
KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "Total step status forwards received",
|
|
391
465
|
KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "Errors encountered while registering universal-git provider bundles",
|
|
@@ -402,7 +476,149 @@ const MetricDescription = {
|
|
|
402
476
|
KICI_WS_MESSAGES_RECEIVED_TOTAL: "Total messages received from orchestrators",
|
|
403
477
|
KICI_WS_MESSAGES_SENT_TOTAL: "Total messages sent to orchestrators",
|
|
404
478
|
KICI_WS_RELAY_ATTEMPTS_TOTAL: "Total number of webhook relay attempts",
|
|
405
|
-
KICI_WS_RELAY_DURATION_SECONDS: "Duration of webhook relay operations in seconds"
|
|
479
|
+
KICI_WS_RELAY_DURATION_SECONDS: "Duration of webhook relay operations in seconds",
|
|
480
|
+
NODEJS_EVENTLOOP_DELAY_MAX: "Event loop maximum delay",
|
|
481
|
+
NODEJS_EVENTLOOP_DELAY_MEAN: "Event loop mean delay",
|
|
482
|
+
NODEJS_EVENTLOOP_DELAY_MIN: "Event loop minimum delay",
|
|
483
|
+
NODEJS_EVENTLOOP_DELAY_P50: "Event loop 50th-percentile delay",
|
|
484
|
+
NODEJS_EVENTLOOP_DELAY_P90: "Event loop 90th-percentile delay",
|
|
485
|
+
NODEJS_EVENTLOOP_DELAY_P99: "Event loop 99th-percentile delay",
|
|
486
|
+
NODEJS_EVENTLOOP_DELAY_STDDEV: "Event loop delay standard deviation",
|
|
487
|
+
NODEJS_EVENTLOOP_TIME: "Cumulative event loop time by state",
|
|
488
|
+
NODEJS_EVENTLOOP_UTILIZATION: "Event loop utilization ratio",
|
|
489
|
+
V8JS_GC_DURATION: "Garbage-collection pause duration by GC type",
|
|
490
|
+
V8JS_MEMORY_HEAP_LIMIT: "V8 heap size limit by heap space",
|
|
491
|
+
V8JS_MEMORY_HEAP_SPACE_AVAILABLE_SIZE: "V8 available heap size by heap space",
|
|
492
|
+
V8JS_MEMORY_HEAP_SPACE_PHYSICAL_SIZE: "V8 physical heap size by heap space",
|
|
493
|
+
V8JS_MEMORY_HEAP_USED: "V8 used heap size by heap space"
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* Service that owns each metric (the package whose meter created it).
|
|
497
|
+
* Consumed by the Platform's orchestrator-metrics filter to drop
|
|
498
|
+
* `kici_platform_*` (and other Platform-only) series that should never
|
|
499
|
+
* appear on the wire — the orchestrator and forwarded-agent metrics are
|
|
500
|
+
* the only valid push payloads.
|
|
501
|
+
*/
|
|
502
|
+
const MetricService = {
|
|
503
|
+
KICI_AGENT_CLONE_DURATION_SECONDS: "agent",
|
|
504
|
+
KICI_AGENT_CONNECTION_STATUS: "agent",
|
|
505
|
+
KICI_AGENT_JOBS_ACTIVE: "agent",
|
|
506
|
+
KICI_AGENT_JOBS_TOTAL: "agent",
|
|
507
|
+
KICI_AGENT_LOG_BACKPRESSURE_ACTIVE: "agent",
|
|
508
|
+
KICI_AGENT_LOG_BACKPRESSURE_EVENTS_TOTAL: "agent",
|
|
509
|
+
KICI_AGENT_LOG_BYTES_TOTAL: "agent",
|
|
510
|
+
KICI_AGENT_LOG_LINES_DROPPED_TOTAL: "agent",
|
|
511
|
+
KICI_AGENT_STEP_DURATION_SECONDS: "agent",
|
|
512
|
+
KICI_AGENT_STEPS_TOTAL: "agent",
|
|
513
|
+
KICI_BUILD_JOBS_TOTAL: "platform",
|
|
514
|
+
KICI_CACHE_HITS_TOTAL: "platform",
|
|
515
|
+
KICI_CACHE_MISSES_TOTAL: "platform",
|
|
516
|
+
KICI_CROSS_SOURCE_ERRORS_TOTAL: "orchestrator",
|
|
517
|
+
KICI_CROSS_SOURCE_FANOUT_SIZE: "orchestrator",
|
|
518
|
+
KICI_DASHBOARD_RELAY_LATENCY_SECONDS: "platform",
|
|
519
|
+
KICI_ORCH_AGENTS_ACTIVE: "orchestrator",
|
|
520
|
+
KICI_ORCH_BUILD_DURATION_SECONDS: "orchestrator",
|
|
521
|
+
KICI_ORCH_CONFIG_RELOAD_TOTAL: "orchestrator",
|
|
522
|
+
KICI_ORCH_CONFIG_VERSION: "orchestrator",
|
|
523
|
+
KICI_ORCH_DEDUP_HITS_TOTAL: "orchestrator",
|
|
524
|
+
KICI_ORCH_DEP_CACHE_HITS_TOTAL: "orchestrator",
|
|
525
|
+
KICI_ORCH_DEP_CACHE_MISSES_TOTAL: "orchestrator",
|
|
526
|
+
KICI_ORCH_DISPATCH_QUEUE_DEPTH: "orchestrator",
|
|
527
|
+
KICI_ORCH_DISPATCH_QUEUE_DEPTH_BY_LABEL: "orchestrator",
|
|
528
|
+
KICI_ORCH_EVENT_ATTEMPTS: "orchestrator",
|
|
529
|
+
KICI_ORCH_EVENT_DISPATCH_SUCCESS_TOTAL: "orchestrator",
|
|
530
|
+
KICI_ORCH_EVENT_DLQ_DEPTH: "orchestrator",
|
|
531
|
+
KICI_ORCH_EVENT_DLQ_TOTAL: "orchestrator",
|
|
532
|
+
KICI_ORCH_EVENT_LEASE_EXPIRATIONS_TOTAL: "orchestrator",
|
|
533
|
+
KICI_ORCH_EVENT_RETRY_TOTAL: "orchestrator",
|
|
534
|
+
KICI_ORCH_EXECUTION_DURATION_SECONDS: "orchestrator",
|
|
535
|
+
KICI_ORCH_EXECUTIONS_TOTAL: "orchestrator",
|
|
536
|
+
KICI_ORCH_GITHUB_CHECK_RUN_TOTAL: "orchestrator",
|
|
537
|
+
KICI_ORCH_INSTALL_SECRETS_CONTRIBUTOR_STRIPPED_TOTAL: "orchestrator",
|
|
538
|
+
KICI_ORCH_INSTALL_SECRETS_DECISIONS_TOTAL: "orchestrator",
|
|
539
|
+
KICI_ORCH_INSTALL_SECRETS_NPM_REGISTRY_USED_TOTAL: "orchestrator",
|
|
540
|
+
KICI_ORCH_INSTALL_SECRETS_TOKEN_RESOLUTION_DURATION_SECONDS: "orchestrator",
|
|
541
|
+
KICI_ORCH_JOB_CONSECUTIVE_FAILURES: "orchestrator",
|
|
542
|
+
KICI_ORCH_JOB_DURATION_SECONDS: "orchestrator",
|
|
543
|
+
KICI_ORCH_JOB_LAST_FAILURE_TIMESTAMP_SECONDS: "orchestrator",
|
|
544
|
+
KICI_ORCH_JOB_LAST_SUCCESS_TIMESTAMP_SECONDS: "orchestrator",
|
|
545
|
+
KICI_ORCH_JOB_RUNS_TOTAL: "orchestrator",
|
|
546
|
+
KICI_ORCH_LOG_BYTES_STORED_TOTAL: "orchestrator",
|
|
547
|
+
KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: "orchestrator",
|
|
548
|
+
KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: "orchestrator",
|
|
549
|
+
KICI_ORCH_SCALER_CPUS_USED: "orchestrator",
|
|
550
|
+
KICI_ORCH_SCALER_MEMORY_BYTES_USED: "orchestrator",
|
|
551
|
+
KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: "orchestrator",
|
|
552
|
+
KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: "orchestrator",
|
|
553
|
+
KICI_ORCH_SOURCE_CACHE_MISSES_TOTAL: "orchestrator",
|
|
554
|
+
KICI_ORCH_STALE_DETECTION_DURATION_SECONDS: "orchestrator",
|
|
555
|
+
KICI_ORCH_STALE_RUNS_CURRENT: "orchestrator",
|
|
556
|
+
KICI_ORCH_STALE_RUNS_DETECTED_TOTAL: "orchestrator",
|
|
557
|
+
KICI_ORCH_STEPS_TOTAL: "orchestrator",
|
|
558
|
+
KICI_ORCH_TRIGGER_MATCH_DURATION_SECONDS: "orchestrator",
|
|
559
|
+
KICI_ORCH_TRUST_MATCH_REFUSED_NO_ID_TOTAL: "orchestrator",
|
|
560
|
+
KICI_ORCH_WEBHOOKS_PROCESSED_TOTAL: "orchestrator",
|
|
561
|
+
KICI_ORCH_WEBHOOKS_RECEIVED_TOTAL: "orchestrator",
|
|
562
|
+
KICI_ORG_AGENT_MINUTES: "platform",
|
|
563
|
+
KICI_ORG_CONNECTIONS: "platform",
|
|
564
|
+
KICI_ORG_EXECUTIONS_COUNT: "platform",
|
|
565
|
+
KICI_ORG_LOG_BYTES: "platform",
|
|
566
|
+
KICI_ORG_STATUS_EVENTS_TOTAL: "platform",
|
|
567
|
+
KICI_ORGS_TOTAL: "platform",
|
|
568
|
+
KICI_PLAN_CAP_EXCEEDED_TOTAL: "platform",
|
|
569
|
+
KICI_PLAN_USAGE_RATIO: "platform",
|
|
570
|
+
KICI_PLATFORM_CROSS_TENANT_REJECTIONS_TOTAL: "platform",
|
|
571
|
+
KICI_PLATFORM_DASHBOARD_PROXY_DURATION_SECONDS: "platform",
|
|
572
|
+
KICI_PLATFORM_DASHBOARD_PROXY_PENDING: "platform",
|
|
573
|
+
KICI_PLATFORM_DASHBOARD_PROXY_REQUESTS_TOTAL: "platform",
|
|
574
|
+
KICI_PLATFORM_EXECUTION_EVENTS_TOTAL: "platform",
|
|
575
|
+
KICI_PLATFORM_EXECUTION_STATUS_UPDATES_TOTAL: "platform",
|
|
576
|
+
KICI_PLATFORM_IDENTITY_LINKS_MISSING_PROVIDER_USER_ID: "platform",
|
|
577
|
+
KICI_PLATFORM_JOB_CONSECUTIVE_FAILURES: "platform",
|
|
578
|
+
KICI_PLATFORM_JOB_DURATION_SECONDS: "platform",
|
|
579
|
+
KICI_PLATFORM_JOB_LAST_FAILURE_TIMESTAMP_SECONDS: "platform",
|
|
580
|
+
KICI_PLATFORM_JOB_LAST_SUCCESS_TIMESTAMP_SECONDS: "platform",
|
|
581
|
+
KICI_PLATFORM_JOB_RUNS_TOTAL: "platform",
|
|
582
|
+
KICI_PLATFORM_JOB_STATUS_FORWARDS_TOTAL: "platform",
|
|
583
|
+
KICI_PLATFORM_LOG_CHUNKS_FORWARDED_TOTAL: "platform",
|
|
584
|
+
KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "platform",
|
|
585
|
+
KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "platform",
|
|
586
|
+
KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "platform",
|
|
587
|
+
KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "platform",
|
|
588
|
+
KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "platform",
|
|
589
|
+
KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "platform",
|
|
590
|
+
KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform",
|
|
591
|
+
KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "platform",
|
|
592
|
+
KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "platform",
|
|
593
|
+
KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "orchestrator",
|
|
594
|
+
KICI_VALKEY_CONNECTION_STATUS: "platform",
|
|
595
|
+
KICI_VALKEY_PUBLISH_TOTAL: "platform",
|
|
596
|
+
KICI_VALKEY_RELAY_LATENCY_SECONDS: "platform",
|
|
597
|
+
KICI_VALKEY_SUBSCRIBE_RECEIVE_TOTAL: "platform",
|
|
598
|
+
KICI_WEBHOOK_PROCESSING_SECONDS: "platform",
|
|
599
|
+
KICI_WEBHOOK_SIGNATURE_FAILURES_TOTAL: "platform",
|
|
600
|
+
KICI_WEBHOOKS_RECEIVED_TOTAL: "platform",
|
|
601
|
+
KICI_WS_CONNECTIONS_ACTIVE: "platform",
|
|
602
|
+
KICI_WS_CONNECTIONS_TOTAL: "platform",
|
|
603
|
+
KICI_WS_HEARTBEAT_AGE_SECONDS: "platform",
|
|
604
|
+
KICI_WS_MESSAGES_RECEIVED_TOTAL: "platform",
|
|
605
|
+
KICI_WS_MESSAGES_SENT_TOTAL: "platform",
|
|
606
|
+
KICI_WS_RELAY_ATTEMPTS_TOTAL: "platform",
|
|
607
|
+
KICI_WS_RELAY_DURATION_SECONDS: "platform",
|
|
608
|
+
NODEJS_EVENTLOOP_DELAY_MAX: "runtime",
|
|
609
|
+
NODEJS_EVENTLOOP_DELAY_MEAN: "runtime",
|
|
610
|
+
NODEJS_EVENTLOOP_DELAY_MIN: "runtime",
|
|
611
|
+
NODEJS_EVENTLOOP_DELAY_P50: "runtime",
|
|
612
|
+
NODEJS_EVENTLOOP_DELAY_P90: "runtime",
|
|
613
|
+
NODEJS_EVENTLOOP_DELAY_P99: "runtime",
|
|
614
|
+
NODEJS_EVENTLOOP_DELAY_STDDEV: "runtime",
|
|
615
|
+
NODEJS_EVENTLOOP_TIME: "runtime",
|
|
616
|
+
NODEJS_EVENTLOOP_UTILIZATION: "runtime",
|
|
617
|
+
V8JS_GC_DURATION: "runtime",
|
|
618
|
+
V8JS_MEMORY_HEAP_LIMIT: "runtime",
|
|
619
|
+
V8JS_MEMORY_HEAP_SPACE_AVAILABLE_SIZE: "runtime",
|
|
620
|
+
V8JS_MEMORY_HEAP_SPACE_PHYSICAL_SIZE: "runtime",
|
|
621
|
+
V8JS_MEMORY_HEAP_USED: "runtime"
|
|
406
622
|
};
|
|
407
623
|
/** Set of every catalog metric name — O(1) membership for lint / filter UI. */
|
|
408
624
|
const ALL_METRIC_NAMES = [
|
|
@@ -421,6 +637,7 @@ const ALL_METRIC_NAMES = [
|
|
|
421
637
|
"kici_cache_misses_total",
|
|
422
638
|
"kici_cross_source_errors_total",
|
|
423
639
|
"kici_cross_source_fanout_size",
|
|
640
|
+
"kici_dashboard_relay_latency_seconds",
|
|
424
641
|
"kici_orch_agents_active",
|
|
425
642
|
"kici_orch_build_duration_seconds",
|
|
426
643
|
"kici_orch_config_reload_total",
|
|
@@ -443,6 +660,11 @@ const ALL_METRIC_NAMES = [
|
|
|
443
660
|
"kici_orch_install_secrets_decisions_total",
|
|
444
661
|
"kici_orch_install_secrets_npm_registry_used_total",
|
|
445
662
|
"kici_orch_install_secrets_token_resolution_duration_seconds",
|
|
663
|
+
"kici_orch_job_consecutive_failures",
|
|
664
|
+
"kici_orch_job_duration_seconds",
|
|
665
|
+
"kici_orch_job_last_failure_timestamp_seconds",
|
|
666
|
+
"kici_orch_job_last_success_timestamp_seconds",
|
|
667
|
+
"kici_orch_job_runs_total",
|
|
446
668
|
"kici_orch_log_bytes_stored_total",
|
|
447
669
|
"kici_orch_log_chunks_received_total",
|
|
448
670
|
"kici_orch_scaler_config_reloads_total",
|
|
@@ -484,8 +706,10 @@ const ALL_METRIC_NAMES = [
|
|
|
484
706
|
"kici_platform_log_lines_forwarded_total",
|
|
485
707
|
"kici_platform_metrics_query_rate_limited_total",
|
|
486
708
|
"kici_platform_mimir_relay_errors_total",
|
|
709
|
+
"kici_platform_orch_metrics_filtered_total",
|
|
487
710
|
"kici_platform_orphan_connections_swept_total",
|
|
488
711
|
"kici_platform_stale_orchestrators_total",
|
|
712
|
+
"kici_platform_stale_platform_connections_evicted_total",
|
|
489
713
|
"kici_platform_stale_runs_failed_total",
|
|
490
714
|
"kici_platform_step_status_forwards_total",
|
|
491
715
|
"kici_universal_git_registration_errors_total",
|
|
@@ -502,9 +726,23 @@ const ALL_METRIC_NAMES = [
|
|
|
502
726
|
"kici_ws_messages_received_total",
|
|
503
727
|
"kici_ws_messages_sent_total",
|
|
504
728
|
"kici_ws_relay_attempts_total",
|
|
505
|
-
"kici_ws_relay_duration_seconds"
|
|
729
|
+
"kici_ws_relay_duration_seconds",
|
|
730
|
+
"nodejs.eventloop.delay.max",
|
|
731
|
+
"nodejs.eventloop.delay.mean",
|
|
732
|
+
"nodejs.eventloop.delay.min",
|
|
733
|
+
"nodejs.eventloop.delay.p50",
|
|
734
|
+
"nodejs.eventloop.delay.p90",
|
|
735
|
+
"nodejs.eventloop.delay.p99",
|
|
736
|
+
"nodejs.eventloop.delay.stddev",
|
|
737
|
+
"nodejs.eventloop.time",
|
|
738
|
+
"nodejs.eventloop.utilization",
|
|
739
|
+
"v8js.gc.duration",
|
|
740
|
+
"v8js.memory.heap.limit",
|
|
741
|
+
"v8js.memory.heap.space.available_size",
|
|
742
|
+
"v8js.memory.heap.space.physical_size",
|
|
743
|
+
"v8js.memory.heap.used"
|
|
506
744
|
];
|
|
507
745
|
//#endregion
|
|
508
|
-
export { ALL_METRIC_NAMES, MetricDescription, MetricKind, MetricLabels, MetricNames };
|
|
746
|
+
export { ALL_METRIC_NAMES, MetricDescription, MetricKind, MetricLabels, MetricNames, MetricService };
|
|
509
747
|
|
|
510
748
|
//# sourceMappingURL=metric-catalog.generated.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cluster name format for orchestrator identity.
|
|
3
|
+
*
|
|
4
|
+
* Subpath export: consumers import from
|
|
5
|
+
* `@kici-dev/engine/protocol/cluster-name`. Pure Zod + plain TypeScript
|
|
6
|
+
* with no node built-ins; browser-safe.
|
|
7
|
+
*
|
|
8
|
+
* Three audiences validate against the same regex:
|
|
9
|
+
* - Orchestrator: boot resolver + `kici-admin cluster-name set`.
|
|
10
|
+
* - Platform: `source.register` defense-in-depth on wire payload.
|
|
11
|
+
* - Dashboard: client-side input validation on future rename UI.
|
|
12
|
+
*
|
|
13
|
+
* DNS-label-ish: lowercase letters, digits, hyphens; starts with a
|
|
14
|
+
* letter; max 63 chars. Matches RFC 1035 label rules narrowed to
|
|
15
|
+
* lowercase, which keeps cluster names safe for URLs without encoding
|
|
16
|
+
* and for filesystem / log identifiers.
|
|
17
|
+
*/
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
export declare const CLUSTER_NAME_REGEX: RegExp;
|
|
20
|
+
export declare const CLUSTER_NAME_MAX_LENGTH = 63;
|
|
21
|
+
export declare const CLUSTER_NAME_FORMAT_MESSAGE: string;
|
|
22
|
+
export declare const clusterNameSchema: z.ZodString;
|
|
23
|
+
export type ClusterName = z.infer<typeof clusterNameSchema>;
|
|
24
|
+
/**
|
|
25
|
+
* Generate a random auto-name in the `cluster-<6hex>` form used when an
|
|
26
|
+
* operator has not supplied a name. The 6-hex suffix gives ~16M values
|
|
27
|
+
* per org; same-org collisions are caught by the Platform's UNIQUE
|
|
28
|
+
* constraint and the orch retries with a fresh suffix.
|
|
29
|
+
*
|
|
30
|
+
* Accepts an injected `randomBytes` to keep the function testable and
|
|
31
|
+
* to allow the orchestrator caller to use `node:crypto.randomBytes`
|
|
32
|
+
* without pulling a node built-in into this browser-safe module.
|
|
33
|
+
*/
|
|
34
|
+
export declare function generateClusterName(randomBytes: (size: number) => Uint8Array): ClusterName;
|
|
35
|
+
//# sourceMappingURL=cluster-name.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "../chunk-gOLHoazu.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/protocol/cluster-name.ts
|
|
4
|
+
/**
|
|
5
|
+
* Cluster name format for orchestrator identity.
|
|
6
|
+
*
|
|
7
|
+
* Subpath export: consumers import from
|
|
8
|
+
* `@kici-dev/engine/protocol/cluster-name`. Pure Zod + plain TypeScript
|
|
9
|
+
* with no node built-ins; browser-safe.
|
|
10
|
+
*
|
|
11
|
+
* Three audiences validate against the same regex:
|
|
12
|
+
* - Orchestrator: boot resolver + `kici-admin cluster-name set`.
|
|
13
|
+
* - Platform: `source.register` defense-in-depth on wire payload.
|
|
14
|
+
* - Dashboard: client-side input validation on future rename UI.
|
|
15
|
+
*
|
|
16
|
+
* DNS-label-ish: lowercase letters, digits, hyphens; starts with a
|
|
17
|
+
* letter; max 63 chars. Matches RFC 1035 label rules narrowed to
|
|
18
|
+
* lowercase, which keeps cluster names safe for URLs without encoding
|
|
19
|
+
* and for filesystem / log identifiers.
|
|
20
|
+
*/
|
|
21
|
+
const CLUSTER_NAME_REGEX = /^[a-z][a-z0-9-]{0,62}$/;
|
|
22
|
+
const CLUSTER_NAME_MAX_LENGTH = 63;
|
|
23
|
+
const CLUSTER_NAME_FORMAT_MESSAGE = "Cluster name must match ^[a-z][a-z0-9-]{0,62}$ (lowercase letters, digits, hyphens; start with a letter; ≤63 chars)";
|
|
24
|
+
const clusterNameSchema = z.string().min(1, CLUSTER_NAME_FORMAT_MESSAGE).max(63, CLUSTER_NAME_FORMAT_MESSAGE).regex(CLUSTER_NAME_REGEX, CLUSTER_NAME_FORMAT_MESSAGE);
|
|
25
|
+
/**
|
|
26
|
+
* Generate a random auto-name in the `cluster-<6hex>` form used when an
|
|
27
|
+
* operator has not supplied a name. The 6-hex suffix gives ~16M values
|
|
28
|
+
* per org; same-org collisions are caught by the Platform's UNIQUE
|
|
29
|
+
* constraint and the orch retries with a fresh suffix.
|
|
30
|
+
*
|
|
31
|
+
* Accepts an injected `randomBytes` to keep the function testable and
|
|
32
|
+
* to allow the orchestrator caller to use `node:crypto.randomBytes`
|
|
33
|
+
* without pulling a node built-in into this browser-safe module.
|
|
34
|
+
*/
|
|
35
|
+
function generateClusterName(randomBytes) {
|
|
36
|
+
const bytes = randomBytes(3);
|
|
37
|
+
const candidate = `cluster-${Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("")}`;
|
|
38
|
+
return clusterNameSchema.parse(candidate);
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { CLUSTER_NAME_FORMAT_MESSAGE, CLUSTER_NAME_MAX_LENGTH, CLUSTER_NAME_REGEX, clusterNameSchema, generateClusterName };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=cluster-name.js.map
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry of dashboard write operations governed by the per-orch
|
|
3
|
+
* dashboard-write policy.
|
|
4
|
+
*
|
|
5
|
+
* Subpath export: consumers import from
|
|
6
|
+
* `@kici-dev/engine/protocol/dashboard-write-operations`. The file is pure
|
|
7
|
+
* Zod + plain TypeScript with no node built-ins, so it remains
|
|
8
|
+
* browser-safe and is also imported directly by the dashboard SPA for
|
|
9
|
+
* capability rendering.
|
|
10
|
+
*
|
|
11
|
+
* Three audiences read this registry:
|
|
12
|
+
* - Orchestrator: enforces the policy per operation in dashboard.* handlers.
|
|
13
|
+
* - Platform: gates HTTP routes that proxy to the orch.
|
|
14
|
+
* - Dashboard: renders per-control state (enabled / disabled / loading).
|
|
15
|
+
*
|
|
16
|
+
* Adding a new operation: append an entry to `DashboardWriteOperation`
|
|
17
|
+
* (the Zod enum) and `DASHBOARD_WRITE_OPERATIONS` (the descriptor array).
|
|
18
|
+
* The runtime build-time tests on the orchestrator and Platform sides
|
|
19
|
+
* fail until at least one gate handler references the new operation.
|
|
20
|
+
*/
|
|
21
|
+
import { z } from 'zod';
|
|
22
|
+
export declare const DashboardWriteOperation: z.ZodEnum<{
|
|
23
|
+
"secrets.set": "secrets.set";
|
|
24
|
+
"secrets.delete": "secrets.delete";
|
|
25
|
+
"secrets.scope.create": "secrets.scope.create";
|
|
26
|
+
"secrets.scope.rename": "secrets.scope.rename";
|
|
27
|
+
"secrets.scope.delete": "secrets.scope.delete";
|
|
28
|
+
"variables.set": "variables.set";
|
|
29
|
+
"variables.delete": "variables.delete";
|
|
30
|
+
"environments.create": "environments.create";
|
|
31
|
+
"environments.update": "environments.update";
|
|
32
|
+
"environments.delete": "environments.delete";
|
|
33
|
+
"environments.bindings.set": "environments.bindings.set";
|
|
34
|
+
"environments.source_overrides.set": "environments.source_overrides.set";
|
|
35
|
+
"environments.source_overrides.delete": "environments.source_overrides.delete";
|
|
36
|
+
"held_runs.approve": "held_runs.approve";
|
|
37
|
+
"held_runs.reject": "held_runs.reject";
|
|
38
|
+
"event_dlq.retry": "event_dlq.retry";
|
|
39
|
+
"event_dlq.discard": "event_dlq.discard";
|
|
40
|
+
"registration.disable": "registration.disable";
|
|
41
|
+
"registration.delete": "registration.delete";
|
|
42
|
+
"global_workflows.update": "global_workflows.update";
|
|
43
|
+
"backends.sync": "backends.sync";
|
|
44
|
+
"backends.sync_one": "backends.sync_one";
|
|
45
|
+
"backends.test": "backends.test";
|
|
46
|
+
}>;
|
|
47
|
+
export type DashboardWriteOperation = z.infer<typeof DashboardWriteOperation>;
|
|
48
|
+
/** Stable list of every operation in enum-declaration order. */
|
|
49
|
+
export declare const DASHBOARD_WRITE_OPERATION_VALUES: readonly DashboardWriteOperation[];
|
|
50
|
+
export declare const DashboardWriteCategory: z.ZodEnum<{
|
|
51
|
+
Secrets: "Secrets";
|
|
52
|
+
Variables: "Variables";
|
|
53
|
+
Environments: "Environments";
|
|
54
|
+
Bindings: "Bindings";
|
|
55
|
+
"Held runs": "Held runs";
|
|
56
|
+
DLQ: "DLQ";
|
|
57
|
+
Registrations: "Registrations";
|
|
58
|
+
Topology: "Topology";
|
|
59
|
+
}>;
|
|
60
|
+
export type DashboardWriteCategory = z.infer<typeof DashboardWriteCategory>;
|
|
61
|
+
export declare const DashboardWriteSensitivity: z.ZodEnum<{
|
|
62
|
+
plaintext: "plaintext";
|
|
63
|
+
authority: "authority";
|
|
64
|
+
dispatch: "dispatch";
|
|
65
|
+
}>;
|
|
66
|
+
export type DashboardWriteSensitivity = z.infer<typeof DashboardWriteSensitivity>;
|
|
67
|
+
/**
|
|
68
|
+
* Descriptor for one dashboard write operation. The fields that don't
|
|
69
|
+
* affect enforcement (label, cliEquivalent) are read by the dashboard
|
|
70
|
+
* SPA to render policy-aware UI and by the docs generator.
|
|
71
|
+
*/
|
|
72
|
+
export interface DashboardWriteOperationDescriptor {
|
|
73
|
+
/** The operation enum value used by enforcement helpers. */
|
|
74
|
+
readonly name: DashboardWriteOperation;
|
|
75
|
+
/** The wire message type the operation maps to (dashboard.* on Platform→Orch). */
|
|
76
|
+
readonly wireMessageType: string;
|
|
77
|
+
/** Grouping for UI rendering. */
|
|
78
|
+
readonly category: DashboardWriteCategory;
|
|
79
|
+
/** Human-facing label for tooltips and the Security policy page. */
|
|
80
|
+
readonly label: string;
|
|
81
|
+
/** Threat-model bucket — used by docs + the --sensitivity CLI sugar. */
|
|
82
|
+
readonly sensitivity: DashboardWriteSensitivity;
|
|
83
|
+
/** kici-admin invocation hint shown in the CLI snippet copied from the UI. */
|
|
84
|
+
readonly cliEquivalent: string;
|
|
85
|
+
}
|
|
86
|
+
export declare const DASHBOARD_WRITE_OPERATIONS: readonly DashboardWriteOperationDescriptor[];
|
|
87
|
+
/** O(1) lookup of a descriptor by operation name. */
|
|
88
|
+
export declare const DASHBOARD_WRITE_OPERATIONS_BY_NAME: ReadonlyMap<DashboardWriteOperation, DashboardWriteOperationDescriptor>;
|
|
89
|
+
/** O(1) lookup of a descriptor by wire-message type. */
|
|
90
|
+
export declare const DASHBOARD_WRITE_OPERATIONS_BY_WIRE_TYPE: ReadonlyMap<string, DashboardWriteOperationDescriptor>;
|
|
91
|
+
export declare function getDashboardWriteOperationDescriptor(op: DashboardWriteOperation): DashboardWriteOperationDescriptor;
|
|
92
|
+
export declare function getDashboardWriteOperationsByCategory(category: DashboardWriteCategory): readonly DashboardWriteOperationDescriptor[];
|
|
93
|
+
export declare function getDashboardWriteOperationsBySensitivity(sensitivity: DashboardWriteSensitivity): readonly DashboardWriteOperationDescriptor[];
|
|
94
|
+
/**
|
|
95
|
+
* Map of operation → enabled flag. Omitted operations default to true
|
|
96
|
+
* (permissive). The orch persists this shape verbatim as JSONB; the
|
|
97
|
+
* Platform mirrors it in its per-org cache.
|
|
98
|
+
*/
|
|
99
|
+
export type DashboardWritePolicyMap = Partial<Record<DashboardWriteOperation, boolean>>;
|
|
100
|
+
/**
|
|
101
|
+
* Validates a sparse policy map. Use this where the value is required
|
|
102
|
+
* but may be empty (e.g. the JSONB column on the orch). For optional
|
|
103
|
+
* fields on outer schemas, embed `dashboardWritePolicyMap` directly
|
|
104
|
+
* with `.optional()` so omission stays as `undefined` rather than being
|
|
105
|
+
* coerced to `{}`.
|
|
106
|
+
*/
|
|
107
|
+
export declare const dashboardWritePolicyMap: z.ZodRecord<z.ZodEnum<{
|
|
108
|
+
"secrets.set": "secrets.set";
|
|
109
|
+
"secrets.delete": "secrets.delete";
|
|
110
|
+
"secrets.scope.create": "secrets.scope.create";
|
|
111
|
+
"secrets.scope.rename": "secrets.scope.rename";
|
|
112
|
+
"secrets.scope.delete": "secrets.scope.delete";
|
|
113
|
+
"variables.set": "variables.set";
|
|
114
|
+
"variables.delete": "variables.delete";
|
|
115
|
+
"environments.create": "environments.create";
|
|
116
|
+
"environments.update": "environments.update";
|
|
117
|
+
"environments.delete": "environments.delete";
|
|
118
|
+
"environments.bindings.set": "environments.bindings.set";
|
|
119
|
+
"environments.source_overrides.set": "environments.source_overrides.set";
|
|
120
|
+
"environments.source_overrides.delete": "environments.source_overrides.delete";
|
|
121
|
+
"held_runs.approve": "held_runs.approve";
|
|
122
|
+
"held_runs.reject": "held_runs.reject";
|
|
123
|
+
"event_dlq.retry": "event_dlq.retry";
|
|
124
|
+
"event_dlq.discard": "event_dlq.discard";
|
|
125
|
+
"registration.disable": "registration.disable";
|
|
126
|
+
"registration.delete": "registration.delete";
|
|
127
|
+
"global_workflows.update": "global_workflows.update";
|
|
128
|
+
"backends.sync": "backends.sync";
|
|
129
|
+
"backends.sync_one": "backends.sync_one";
|
|
130
|
+
"backends.test": "backends.test";
|
|
131
|
+
}> & z.core.$partial, z.ZodBoolean>;
|
|
132
|
+
export declare const dashboardWritePolicyMapSchema: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
133
|
+
"secrets.set": "secrets.set";
|
|
134
|
+
"secrets.delete": "secrets.delete";
|
|
135
|
+
"secrets.scope.create": "secrets.scope.create";
|
|
136
|
+
"secrets.scope.rename": "secrets.scope.rename";
|
|
137
|
+
"secrets.scope.delete": "secrets.scope.delete";
|
|
138
|
+
"variables.set": "variables.set";
|
|
139
|
+
"variables.delete": "variables.delete";
|
|
140
|
+
"environments.create": "environments.create";
|
|
141
|
+
"environments.update": "environments.update";
|
|
142
|
+
"environments.delete": "environments.delete";
|
|
143
|
+
"environments.bindings.set": "environments.bindings.set";
|
|
144
|
+
"environments.source_overrides.set": "environments.source_overrides.set";
|
|
145
|
+
"environments.source_overrides.delete": "environments.source_overrides.delete";
|
|
146
|
+
"held_runs.approve": "held_runs.approve";
|
|
147
|
+
"held_runs.reject": "held_runs.reject";
|
|
148
|
+
"event_dlq.retry": "event_dlq.retry";
|
|
149
|
+
"event_dlq.discard": "event_dlq.discard";
|
|
150
|
+
"registration.disable": "registration.disable";
|
|
151
|
+
"registration.delete": "registration.delete";
|
|
152
|
+
"global_workflows.update": "global_workflows.update";
|
|
153
|
+
"backends.sync": "backends.sync";
|
|
154
|
+
"backends.sync_one": "backends.sync_one";
|
|
155
|
+
"backends.test": "backends.test";
|
|
156
|
+
}> & z.core.$partial, z.ZodBoolean>>;
|
|
157
|
+
/**
|
|
158
|
+
* Resolve the effective state of an operation given a (possibly sparse)
|
|
159
|
+
* policy map. Treats `undefined` as enabled by the permissive default.
|
|
160
|
+
*/
|
|
161
|
+
export declare function isDashboardWriteOperationEnabled(policy: DashboardWritePolicyMap | null | undefined, op: DashboardWriteOperation): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Expand a (possibly sparse) policy map into the full effective state
|
|
164
|
+
* for all 23 operations. Operations the policy doesn't mention come
|
|
165
|
+
* back as `true` (permissive). Used by the orch HTTP admin response,
|
|
166
|
+
* the WS `orch.capabilities` broadcast, and the dashboard's policy
|
|
167
|
+
* page so consumers see the full picture, not the sparse storage shape.
|
|
168
|
+
*/
|
|
169
|
+
export declare function resolveFullPolicyView(policy: DashboardWritePolicyMap | null | undefined): Record<DashboardWriteOperation, boolean>;
|
|
170
|
+
//# sourceMappingURL=dashboard-write-operations.d.ts.map
|