@kici-dev/engine 0.1.22 → 0.1.24

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 (72) hide show
  1. package/dist/approval/types.d.ts +1 -1
  2. package/dist/audit/access-log-policy.d.ts +4 -1
  3. package/dist/audit/access-log-policy.js +11 -1
  4. package/dist/audit/activity.d.ts +3 -1
  5. package/dist/audit/activity.js +8 -16
  6. package/dist/audit/retention-policy.js +6 -0
  7. package/dist/environment/host-match.d.ts +25 -0
  8. package/dist/environment/host-match.js +67 -0
  9. package/dist/environment/index.d.ts +3 -0
  10. package/dist/environment/index.js +3 -1
  11. package/dist/environment/multi-env.d.ts +30 -0
  12. package/dist/environment/multi-env.js +38 -0
  13. package/dist/environment/scope-resolver.d.ts +15 -4
  14. package/dist/environment/scope-resolver.js +55 -15
  15. package/dist/environment/scope-template.d.ts +18 -0
  16. package/dist/environment/scope-template.js +43 -0
  17. package/dist/environment/types.d.ts +15 -2
  18. package/dist/environment/types.js +18 -1
  19. package/dist/fanout/materialize.d.ts +34 -0
  20. package/dist/fanout/materialize.js +72 -45
  21. package/dist/index.d.ts +5 -1
  22. package/dist/index.js +21 -10
  23. package/dist/inputs/build.d.ts +9 -0
  24. package/dist/inputs/build.js +44 -0
  25. package/dist/inputs/coerce.d.ts +25 -0
  26. package/dist/inputs/coerce.js +51 -0
  27. package/dist/inputs/descriptor.d.ts +53 -0
  28. package/dist/inputs/descriptor.js +42 -0
  29. package/dist/inputs/extract.d.ts +15 -0
  30. package/dist/inputs/extract.js +117 -0
  31. package/dist/inputs/index.d.ts +6 -0
  32. package/dist/inputs/index.js +7 -0
  33. package/dist/inputs/schedule.d.ts +19 -0
  34. package/dist/inputs/schedule.js +33 -0
  35. package/dist/labels/compile.d.ts +9 -0
  36. package/dist/labels/compile.js +10 -1
  37. package/dist/labels.d.ts +29 -0
  38. package/dist/labels.js +32 -1
  39. package/dist/mcp/tool-schemas.d.ts +41 -0
  40. package/dist/mcp/tool-schemas.js +49 -0
  41. package/dist/metrics/catalog-policy.d.ts +7 -0
  42. package/dist/metrics/catalog-policy.js +11 -12
  43. package/dist/metrics/metric-catalog.generated.d.ts +22 -2
  44. package/dist/metrics/metric-catalog.generated.js +34 -2
  45. package/dist/protocol/messages/access-log.d.ts +39 -10
  46. package/dist/protocol/messages/access-log.js +7 -2
  47. package/dist/protocol/messages/actor.d.ts +8 -0
  48. package/dist/protocol/messages/actor.js +17 -3
  49. package/dist/protocol/messages/agent-run-result.d.ts +350 -0
  50. package/dist/protocol/messages/agent-run-result.js +123 -0
  51. package/dist/protocol/messages/auth.d.ts +2 -0
  52. package/dist/protocol/messages/auth.js +10 -1
  53. package/dist/protocol/messages/capabilities.d.ts +2 -0
  54. package/dist/protocol/messages/capabilities.js +15 -2
  55. package/dist/protocol/messages/dashboard-global-workflows.d.ts +8 -0
  56. package/dist/protocol/messages/dashboard.d.ts +1513 -39
  57. package/dist/protocol/messages/dashboard.js +210 -15
  58. package/dist/protocol/messages/execution-status.d.ts +52 -1
  59. package/dist/protocol/messages/execution-status.js +115 -54
  60. package/dist/protocol/messages/orchestrator-agent.d.ts +21 -5
  61. package/dist/protocol/messages/orchestrator-agent.js +5 -1
  62. package/dist/protocol/messages/pat-kind.d.ts +16 -0
  63. package/dist/protocol/messages/pat-kind.js +17 -0
  64. package/dist/protocol/messages/peer.d.ts +7 -7
  65. package/dist/protocol/messages/platform-orchestrator.d.ts +424 -8
  66. package/dist/protocol/messages/platform-orchestrator.js +3 -3
  67. package/dist/protocol/messages/run-events.d.ts +5 -1
  68. package/dist/provider/check-run-conclusion.d.ts +1 -1
  69. package/dist/trigger/types.d.ts +75 -7
  70. package/dist/trigger/types.js +19 -2
  71. package/package.json +9 -1
  72. package/sbom.spdx.json +5 -5
@@ -88,13 +88,17 @@ const MetricNames = {
88
88
  KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "kici_platform_log_lines_forwarded_total",
89
89
  KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "kici_platform_metrics_query_rate_limited_total",
90
90
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "kici_platform_mimir_relay_errors_total",
91
+ KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: "kici_platform_notifications_delivered_total",
92
+ KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: "kici_platform_notifications_suppressed_total",
91
93
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "kici_platform_orch_metrics_filtered_total",
92
94
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "kici_platform_orphan_connections_swept_total",
93
95
  KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "kici_platform_pg_pool_client_errors_total",
96
+ KICI_PLATFORM_PLAN_CAP_CHECK_ERRORS_TOTAL: "kici_platform_plan_cap_check_errors_total",
94
97
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "kici_platform_stale_orchestrators_total",
95
98
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "kici_platform_stale_platform_connections_evicted_total",
96
99
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "kici_platform_stale_runs_failed_total",
97
100
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "kici_platform_step_status_forwards_total",
101
+ KICI_PLATFORM_WS_ORG_RATE_LIMITED_TOTAL: "kici_platform_ws_org_rate_limited_total",
98
102
  KICI_REGISTRATIONS_TOTAL: "kici_registrations_total",
99
103
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "kici_universal_git_registration_errors_total",
100
104
  KICI_USER_REGISTRATION_NOTIFY_TOTAL: "kici_user_registration_notify_total",
@@ -188,8 +192,16 @@ const MetricLabels = {
188
192
  KICI_ORCH_LOG_CHUNKS_RECEIVED_TOTAL: [],
189
193
  KICI_ORCH_PG_POOL_CLIENT_ERRORS_TOTAL: ["source"],
190
194
  KICI_ORCH_SCALER_CONFIG_RELOADS_TOTAL: ["result"],
191
- KICI_ORCH_SCALER_CPUS_USED: ["scaler", "machinePool"],
192
- KICI_ORCH_SCALER_MEMORY_BYTES_USED: ["scaler", "machinePool"],
195
+ KICI_ORCH_SCALER_CPUS_USED: [
196
+ "scaler",
197
+ "scalerType",
198
+ "machinePool"
199
+ ],
200
+ KICI_ORCH_SCALER_MEMORY_BYTES_USED: [
201
+ "scaler",
202
+ "scalerType",
203
+ "machinePool"
204
+ ],
193
205
  KICI_ORCH_SCALER_SPAWN_FAILURES_TOTAL: ["backend", "bound"],
194
206
  KICI_ORCH_SCALER_SPAWN_REFUSALS_TOTAL: [],
195
207
  KICI_ORCH_SOURCE_CACHE_HITS_TOTAL: [],
@@ -227,13 +239,17 @@ const MetricLabels = {
227
239
  KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: [],
228
240
  KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: ["org_id"],
229
241
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: ["reason"],
242
+ KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: ["channel_type", "result"],
243
+ KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: ["org_id"],
230
244
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: ["reason", "metric"],
231
245
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: [],
232
246
  KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: ["source"],
247
+ KICI_PLATFORM_PLAN_CAP_CHECK_ERRORS_TOTAL: ["org_id"],
233
248
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: [],
234
249
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: ["org_id"],
235
250
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: [],
236
251
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: ["state"],
252
+ KICI_PLATFORM_WS_ORG_RATE_LIMITED_TOTAL: ["org_id"],
237
253
  KICI_REGISTRATIONS_TOTAL: [],
238
254
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: ["reason"],
239
255
  KICI_USER_REGISTRATION_NOTIFY_TOTAL: ["result"],
@@ -366,13 +382,17 @@ const MetricKind = {
366
382
  KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "counter",
367
383
  KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "counter",
368
384
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "counter",
385
+ KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: "counter",
386
+ KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: "counter",
369
387
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "counter",
370
388
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "counter",
371
389
  KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "counter",
390
+ KICI_PLATFORM_PLAN_CAP_CHECK_ERRORS_TOTAL: "counter",
372
391
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "counter",
373
392
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "counter",
374
393
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "counter",
375
394
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "counter",
395
+ KICI_PLATFORM_WS_ORG_RATE_LIMITED_TOTAL: "counter",
376
396
  KICI_REGISTRATIONS_TOTAL: "counter",
377
397
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "counter",
378
398
  KICI_USER_REGISTRATION_NOTIFY_TOTAL: "counter",
@@ -501,13 +521,17 @@ const MetricDescription = {
501
521
  KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "Total log lines forwarded from orchestrators",
502
522
  KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "Total dashboard metric-query requests rate-limited (429).",
503
523
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "Total Mimir push-relay errors (Platform-embedded metrics). Labels: reason.",
524
+ KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: "Notification delivery attempts that reached a terminal outcome",
525
+ KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: "Run-terminal notifications suppressed by the per-org notification quota",
504
526
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "Orchestrator-pushed metric data points dropped or rewritten by the catalog allow-list. Labels: reason, metric.",
505
527
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "Total orphan connections swept from platform_connections",
506
528
  KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "Total pg connection errors absorbed without a process restart",
529
+ KICI_PLATFORM_PLAN_CAP_CHECK_ERRORS_TOTAL: "WS connection rejected because the plan-limit check errored (fail-closed)",
507
530
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "Total orchestrators detected as permanently disconnected",
508
531
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform_connections rows evicted by source.register DB dedup (same-instance reconnect path)",
509
532
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "Total execution runs failed due to orchestrator staleness",
510
533
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "Total step status forwards received",
534
+ KICI_PLATFORM_WS_ORG_RATE_LIMITED_TOTAL: "Inbound orchestrator messages dropped by the per-org aggregate WS rate limit",
511
535
  KICI_REGISTRATIONS_TOTAL: "Total user registrations (new personal orgs created on first login)",
512
536
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "Errors encountered while registering universal-git provider bundles",
513
537
  KICI_USER_REGISTRATION_NOTIFY_TOTAL: "New-user Telegram notifications by result (sent|failed)",
@@ -643,13 +667,17 @@ const MetricService = {
643
667
  KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "platform",
644
668
  KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "platform",
645
669
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "platform",
670
+ KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: "platform",
671
+ KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: "platform",
646
672
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "platform",
647
673
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "platform",
648
674
  KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "platform",
675
+ KICI_PLATFORM_PLAN_CAP_CHECK_ERRORS_TOTAL: "platform",
649
676
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "platform",
650
677
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform",
651
678
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "platform",
652
679
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "platform",
680
+ KICI_PLATFORM_WS_ORG_RATE_LIMITED_TOTAL: "platform",
653
681
  KICI_REGISTRATIONS_TOTAL: "platform",
654
682
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "orchestrator",
655
683
  KICI_USER_REGISTRATION_NOTIFY_TOTAL: "platform",
@@ -779,13 +807,17 @@ const ALL_METRIC_NAMES = [
779
807
  "kici_platform_log_lines_forwarded_total",
780
808
  "kici_platform_metrics_query_rate_limited_total",
781
809
  "kici_platform_mimir_relay_errors_total",
810
+ "kici_platform_notifications_delivered_total",
811
+ "kici_platform_notifications_suppressed_total",
782
812
  "kici_platform_orch_metrics_filtered_total",
783
813
  "kici_platform_orphan_connections_swept_total",
784
814
  "kici_platform_pg_pool_client_errors_total",
815
+ "kici_platform_plan_cap_check_errors_total",
785
816
  "kici_platform_stale_orchestrators_total",
786
817
  "kici_platform_stale_platform_connections_evicted_total",
787
818
  "kici_platform_stale_runs_failed_total",
788
819
  "kici_platform_step_status_forwards_total",
820
+ "kici_platform_ws_org_rate_limited_total",
789
821
  "kici_registrations_total",
790
822
  "kici_universal_git_registration_errors_total",
791
823
  "kici_user_registration_notify_total",
@@ -13,6 +13,7 @@ import { z } from 'zod';
13
13
  */
14
14
  /** Where the access-log entry was originated from. */
15
15
  export declare const AccessLogSource: z.ZodEnum<{
16
+ agent: "agent";
16
17
  platform_proxy: "platform_proxy";
17
18
  admin_http: "admin_http";
18
19
  admin_cli: "admin_cli";
@@ -29,12 +30,12 @@ export type AccessLogOutcome = z.infer<typeof AccessLogOutcome>;
29
30
  export declare const AccessLogTargetType: z.ZodEnum<{
30
31
  run: "run";
31
32
  job: "job";
32
- payload: "payload";
33
33
  step: "step";
34
+ environment: "environment";
35
+ payload: "payload";
34
36
  event_log: "event_log";
35
37
  event_log_payload: "event_log_payload";
36
38
  secret_scope: "secret_scope";
37
- environment: "environment";
38
39
  registration: "registration";
39
40
  backend: "backend";
40
41
  diagnostics: "diagnostics";
@@ -45,6 +46,7 @@ export declare const AccessLogTargetType: z.ZodEnum<{
45
46
  event_dlq: "event_dlq";
46
47
  org_settings: "org_settings";
47
48
  cluster_meta: "cluster_meta";
49
+ attestation: "attestation";
48
50
  }>;
49
51
  export type AccessLogTargetType = z.infer<typeof AccessLogTargetType>;
50
52
  /**
@@ -60,6 +62,7 @@ export declare const AccessLogAction: z.ZodEnum<{
60
62
  "fleet.host.declare": "fleet.host.declare";
61
63
  "fleet.host.remove": "fleet.host.remove";
62
64
  "run.detail.read": "run.detail.read";
65
+ "run.structured.read": "run.structured.read";
63
66
  "runs.list.read": "runs.list.read";
64
67
  "runs.filters.read": "runs.filters.read";
65
68
  "sources.list.read": "sources.list.read";
@@ -107,6 +110,8 @@ export declare const AccessLogAction: z.ZodEnum<{
107
110
  "scaler.capacity.read": "scaler.capacity.read";
108
111
  "scaler.agents.read": "scaler.agents.read";
109
112
  "fleet.read": "fleet.read";
113
+ "fleet.init_runner.bringup": "fleet.init_runner.bringup";
114
+ "fleet.pre_boot.send": "fleet.pre_boot.send";
110
115
  "backend.list.read": "backend.list.read";
111
116
  "backend.get.read": "backend.get.read";
112
117
  "backend.sync": "backend.sync";
@@ -152,6 +157,7 @@ export declare const accessLogItemSchema: z.ZodObject<{
152
157
  "fleet.host.declare": "fleet.host.declare";
153
158
  "fleet.host.remove": "fleet.host.remove";
154
159
  "run.detail.read": "run.detail.read";
160
+ "run.structured.read": "run.structured.read";
155
161
  "runs.list.read": "runs.list.read";
156
162
  "runs.filters.read": "runs.filters.read";
157
163
  "sources.list.read": "sources.list.read";
@@ -199,6 +205,8 @@ export declare const accessLogItemSchema: z.ZodObject<{
199
205
  "scaler.capacity.read": "scaler.capacity.read";
200
206
  "scaler.agents.read": "scaler.agents.read";
201
207
  "fleet.read": "fleet.read";
208
+ "fleet.init_runner.bringup": "fleet.init_runner.bringup";
209
+ "fleet.pre_boot.send": "fleet.pre_boot.send";
202
210
  "backend.list.read": "backend.list.read";
203
211
  "backend.get.read": "backend.get.read";
204
212
  "backend.sync": "backend.sync";
@@ -215,12 +223,12 @@ export declare const accessLogItemSchema: z.ZodObject<{
215
223
  targetType: z.ZodNullable<z.ZodEnum<{
216
224
  run: "run";
217
225
  job: "job";
218
- payload: "payload";
219
226
  step: "step";
227
+ environment: "environment";
228
+ payload: "payload";
220
229
  event_log: "event_log";
221
230
  event_log_payload: "event_log_payload";
222
231
  secret_scope: "secret_scope";
223
- environment: "environment";
224
232
  registration: "registration";
225
233
  backend: "backend";
226
234
  diagnostics: "diagnostics";
@@ -231,10 +239,12 @@ export declare const accessLogItemSchema: z.ZodObject<{
231
239
  event_dlq: "event_dlq";
232
240
  org_settings: "org_settings";
233
241
  cluster_meta: "cluster_meta";
242
+ attestation: "attestation";
234
243
  }>>;
235
244
  targetId: z.ZodNullable<z.ZodString>;
236
245
  requestId: z.ZodNullable<z.ZodString>;
237
246
  source: z.ZodEnum<{
247
+ agent: "agent";
238
248
  platform_proxy: "platform_proxy";
239
249
  admin_http: "admin_http";
240
250
  admin_cli: "admin_cli";
@@ -267,6 +277,7 @@ export declare const accessLogFilterSchema: z.ZodObject<{
267
277
  "fleet.host.declare": "fleet.host.declare";
268
278
  "fleet.host.remove": "fleet.host.remove";
269
279
  "run.detail.read": "run.detail.read";
280
+ "run.structured.read": "run.structured.read";
270
281
  "runs.list.read": "runs.list.read";
271
282
  "runs.filters.read": "runs.filters.read";
272
283
  "sources.list.read": "sources.list.read";
@@ -314,6 +325,8 @@ export declare const accessLogFilterSchema: z.ZodObject<{
314
325
  "scaler.capacity.read": "scaler.capacity.read";
315
326
  "scaler.agents.read": "scaler.agents.read";
316
327
  "fleet.read": "fleet.read";
328
+ "fleet.init_runner.bringup": "fleet.init_runner.bringup";
329
+ "fleet.pre_boot.send": "fleet.pre_boot.send";
317
330
  "backend.list.read": "backend.list.read";
318
331
  "backend.get.read": "backend.get.read";
319
332
  "backend.sync": "backend.sync";
@@ -328,6 +341,7 @@ export declare const accessLogFilterSchema: z.ZodObject<{
328
341
  purge_chunk: "purge_chunk";
329
342
  }>>;
330
343
  source: z.ZodOptional<z.ZodEnum<{
344
+ agent: "agent";
331
345
  platform_proxy: "platform_proxy";
332
346
  admin_http: "admin_http";
333
347
  admin_cli: "admin_cli";
@@ -340,12 +354,12 @@ export declare const accessLogFilterSchema: z.ZodObject<{
340
354
  targetType: z.ZodOptional<z.ZodEnum<{
341
355
  run: "run";
342
356
  job: "job";
343
- payload: "payload";
344
357
  step: "step";
358
+ environment: "environment";
359
+ payload: "payload";
345
360
  event_log: "event_log";
346
361
  event_log_payload: "event_log_payload";
347
362
  secret_scope: "secret_scope";
348
- environment: "environment";
349
363
  registration: "registration";
350
364
  backend: "backend";
351
365
  diagnostics: "diagnostics";
@@ -356,6 +370,7 @@ export declare const accessLogFilterSchema: z.ZodObject<{
356
370
  event_dlq: "event_dlq";
357
371
  org_settings: "org_settings";
358
372
  cluster_meta: "cluster_meta";
373
+ attestation: "attestation";
359
374
  }>>;
360
375
  targetId: z.ZodOptional<z.ZodString>;
361
376
  fromTimestamp: z.ZodOptional<z.ZodString>;
@@ -370,6 +385,10 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
370
385
  actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
371
386
  type: z.ZodLiteral<"user">;
372
387
  sub: z.ZodString;
388
+ agent: z.ZodOptional<z.ZodObject<{
389
+ patId: z.ZodString;
390
+ label: z.ZodString;
391
+ }, z.core.$strip>>;
373
392
  }, z.core.$strip>, z.ZodObject<{
374
393
  type: z.ZodLiteral<"api_key">;
375
394
  keyId: z.ZodString;
@@ -404,6 +423,7 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
404
423
  "fleet.host.declare": "fleet.host.declare";
405
424
  "fleet.host.remove": "fleet.host.remove";
406
425
  "run.detail.read": "run.detail.read";
426
+ "run.structured.read": "run.structured.read";
407
427
  "runs.list.read": "runs.list.read";
408
428
  "runs.filters.read": "runs.filters.read";
409
429
  "sources.list.read": "sources.list.read";
@@ -451,6 +471,8 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
451
471
  "scaler.capacity.read": "scaler.capacity.read";
452
472
  "scaler.agents.read": "scaler.agents.read";
453
473
  "fleet.read": "fleet.read";
474
+ "fleet.init_runner.bringup": "fleet.init_runner.bringup";
475
+ "fleet.pre_boot.send": "fleet.pre_boot.send";
454
476
  "backend.list.read": "backend.list.read";
455
477
  "backend.get.read": "backend.get.read";
456
478
  "backend.sync": "backend.sync";
@@ -465,6 +487,7 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
465
487
  purge_chunk: "purge_chunk";
466
488
  }>>;
467
489
  source: z.ZodOptional<z.ZodEnum<{
490
+ agent: "agent";
468
491
  platform_proxy: "platform_proxy";
469
492
  admin_http: "admin_http";
470
493
  admin_cli: "admin_cli";
@@ -477,12 +500,12 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
477
500
  targetType: z.ZodOptional<z.ZodEnum<{
478
501
  run: "run";
479
502
  job: "job";
480
- payload: "payload";
481
503
  step: "step";
504
+ environment: "environment";
505
+ payload: "payload";
482
506
  event_log: "event_log";
483
507
  event_log_payload: "event_log_payload";
484
508
  secret_scope: "secret_scope";
485
- environment: "environment";
486
509
  registration: "registration";
487
510
  backend: "backend";
488
511
  diagnostics: "diagnostics";
@@ -493,6 +516,7 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
493
516
  event_dlq: "event_dlq";
494
517
  org_settings: "org_settings";
495
518
  cluster_meta: "cluster_meta";
519
+ attestation: "attestation";
496
520
  }>>;
497
521
  targetId: z.ZodOptional<z.ZodString>;
498
522
  fromTimestamp: z.ZodOptional<z.ZodString>;
@@ -529,6 +553,7 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
529
553
  "fleet.host.declare": "fleet.host.declare";
530
554
  "fleet.host.remove": "fleet.host.remove";
531
555
  "run.detail.read": "run.detail.read";
556
+ "run.structured.read": "run.structured.read";
532
557
  "runs.list.read": "runs.list.read";
533
558
  "runs.filters.read": "runs.filters.read";
534
559
  "sources.list.read": "sources.list.read";
@@ -576,6 +601,8 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
576
601
  "scaler.capacity.read": "scaler.capacity.read";
577
602
  "scaler.agents.read": "scaler.agents.read";
578
603
  "fleet.read": "fleet.read";
604
+ "fleet.init_runner.bringup": "fleet.init_runner.bringup";
605
+ "fleet.pre_boot.send": "fleet.pre_boot.send";
579
606
  "backend.list.read": "backend.list.read";
580
607
  "backend.get.read": "backend.get.read";
581
608
  "backend.sync": "backend.sync";
@@ -592,12 +619,12 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
592
619
  targetType: z.ZodNullable<z.ZodEnum<{
593
620
  run: "run";
594
621
  job: "job";
595
- payload: "payload";
596
622
  step: "step";
623
+ environment: "environment";
624
+ payload: "payload";
597
625
  event_log: "event_log";
598
626
  event_log_payload: "event_log_payload";
599
627
  secret_scope: "secret_scope";
600
- environment: "environment";
601
628
  registration: "registration";
602
629
  backend: "backend";
603
630
  diagnostics: "diagnostics";
@@ -608,10 +635,12 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
608
635
  event_dlq: "event_dlq";
609
636
  org_settings: "org_settings";
610
637
  cluster_meta: "cluster_meta";
638
+ attestation: "attestation";
611
639
  }>>;
612
640
  targetId: z.ZodNullable<z.ZodString>;
613
641
  requestId: z.ZodNullable<z.ZodString>;
614
642
  source: z.ZodEnum<{
643
+ agent: "agent";
615
644
  platform_proxy: "platform_proxy";
616
645
  admin_http: "admin_http";
617
646
  admin_cli: "admin_cli";
@@ -18,7 +18,8 @@ import { z } from "zod";
18
18
  const AccessLogSource = z.enum([
19
19
  "platform_proxy",
20
20
  "admin_http",
21
- "admin_cli"
21
+ "admin_cli",
22
+ "agent"
22
23
  ]);
23
24
  /** Outcome of the attempted action. */
24
25
  const AccessLogOutcome = z.enum([
@@ -45,7 +46,8 @@ const AccessLogTargetType = z.enum([
45
46
  "access_log",
46
47
  "event_dlq",
47
48
  "org_settings",
48
- "cluster_meta"
49
+ "cluster_meta",
50
+ "attestation"
49
51
  ]);
50
52
  /**
51
53
  * Dotted-namespace action names. Every handler that writes an access_log
@@ -53,6 +55,7 @@ const AccessLogTargetType = z.enum([
53
55
  */
54
56
  const AccessLogAction = z.enum([
55
57
  "run.detail.read",
58
+ "run.structured.read",
56
59
  "runs.list.read",
57
60
  "runs.filters.read",
58
61
  "sources.list.read",
@@ -104,6 +107,8 @@ const AccessLogAction = z.enum([
104
107
  "fleet.read",
105
108
  "fleet.host.declare",
106
109
  "fleet.host.remove",
110
+ "fleet.init_runner.bringup",
111
+ "fleet.pre_boot.send",
107
112
  "backend.list.read",
108
113
  "backend.get.read",
109
114
  "backend.sync",
@@ -20,6 +20,10 @@ export type ActorType = z.infer<typeof ActorType>;
20
20
  export declare const userActorSchema: z.ZodObject<{
21
21
  type: z.ZodLiteral<"user">;
22
22
  sub: z.ZodString;
23
+ agent: z.ZodOptional<z.ZodObject<{
24
+ patId: z.ZodString;
25
+ label: z.ZodString;
26
+ }, z.core.$strip>>;
23
27
  }, z.core.$strip>;
24
28
  export type UserActor = z.infer<typeof userActorSchema>;
25
29
  export declare const apiKeyActorSchema: z.ZodObject<{
@@ -48,6 +52,10 @@ export type SystemActor = z.infer<typeof systemActorSchema>;
48
52
  export declare const actorPrincipalSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
49
53
  type: z.ZodLiteral<"user">;
50
54
  sub: z.ZodString;
55
+ agent: z.ZodOptional<z.ZodObject<{
56
+ patId: z.ZodString;
57
+ label: z.ZodString;
58
+ }, z.core.$strip>>;
51
59
  }, z.core.$strip>, z.ZodObject<{
52
60
  type: z.ZodLiteral<"api_key">;
53
61
  keyId: z.ZodString;
@@ -21,7 +21,18 @@ const ActorType = z.enum([
21
21
  const userActorSchema = z.object({
22
22
  type: z.literal(ActorType.enum.user),
23
23
  /** Keycloak subject (idp_sub). */
24
- sub: z.string().min(1)
24
+ sub: z.string().min(1),
25
+ /**
26
+ * Present when the user is acting through an agent-kind PAT (e.g. a coding
27
+ * agent driving KiCI via the developer MCP server). The PAT still inherits
28
+ * the user's permissions — this is provenance only, not an authority change.
29
+ * `patId` is the opaque PAT identifier; `label` is the human-set agent name
30
+ * recorded on every audit / access-log row.
31
+ */
32
+ agent: z.object({
33
+ patId: z.string().min(1),
34
+ label: z.string().min(1)
35
+ }).optional()
25
36
  });
26
37
  const apiKeyActorSchema = z.object({
27
38
  type: z.literal(ActorType.enum.api_key),
@@ -77,7 +88,7 @@ const actorPrincipalSchema = z.discriminatedUnion("type", [
77
88
  */
78
89
  function stringifyActor(actor) {
79
90
  switch (actor.type) {
80
- case "user": return `user:${actor.sub}`;
91
+ case "user": return actor.agent ? `user:${actor.sub} via agent:${actor.agent.label}` : `user:${actor.sub}`;
81
92
  case "api_key": return `api_key:${actor.keyId}`;
82
93
  case "service_account": return `service_account:${actor.id}`;
83
94
  case "platform_operator": return `platform_operator:${actor.sub}`;
@@ -116,7 +127,10 @@ function flattenActor(actor) {
116
127
  case "user": return {
117
128
  actorType: "user",
118
129
  actorId: actor.sub,
119
- actorMeta: null
130
+ actorMeta: actor.agent ? {
131
+ agentPatId: actor.agent.patId,
132
+ agentLabel: actor.agent.label
133
+ } : null
120
134
  };
121
135
  case "api_key": return {
122
136
  actorType: "api_key",