@kici-dev/engine 0.1.23 → 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 (49) 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 +9 -1
  4. package/dist/audit/activity.d.ts +2 -2
  5. package/dist/audit/retention-policy.js +2 -0
  6. package/dist/environment/index.d.ts +2 -0
  7. package/dist/environment/index.js +3 -1
  8. package/dist/environment/multi-env.d.ts +30 -0
  9. package/dist/environment/multi-env.js +38 -0
  10. package/dist/environment/types.d.ts +8 -2
  11. package/dist/environment/types.js +18 -1
  12. package/dist/index.d.ts +3 -0
  13. package/dist/index.js +14 -8
  14. package/dist/inputs/index.d.ts +1 -0
  15. package/dist/inputs/index.js +2 -1
  16. package/dist/inputs/schedule.d.ts +19 -0
  17. package/dist/inputs/schedule.js +33 -0
  18. package/dist/mcp/tool-schemas.d.ts +41 -0
  19. package/dist/mcp/tool-schemas.js +49 -0
  20. package/dist/metrics/metric-catalog.generated.d.ts +20 -0
  21. package/dist/metrics/metric-catalog.generated.js +24 -0
  22. package/dist/protocol/messages/access-log.d.ts +29 -15
  23. package/dist/protocol/messages/access-log.js +3 -1
  24. package/dist/protocol/messages/actor.d.ts +8 -0
  25. package/dist/protocol/messages/actor.js +17 -3
  26. package/dist/protocol/messages/agent-run-result.d.ts +350 -0
  27. package/dist/protocol/messages/agent-run-result.js +123 -0
  28. package/dist/protocol/messages/auth.d.ts +2 -0
  29. package/dist/protocol/messages/auth.js +10 -1
  30. package/dist/protocol/messages/capabilities.d.ts +2 -0
  31. package/dist/protocol/messages/capabilities.js +15 -2
  32. package/dist/protocol/messages/dashboard-global-workflows.d.ts +8 -0
  33. package/dist/protocol/messages/dashboard.d.ts +1376 -42
  34. package/dist/protocol/messages/dashboard.js +161 -6
  35. package/dist/protocol/messages/execution-status.d.ts +52 -1
  36. package/dist/protocol/messages/execution-status.js +115 -54
  37. package/dist/protocol/messages/orchestrator-agent.d.ts +21 -5
  38. package/dist/protocol/messages/orchestrator-agent.js +5 -1
  39. package/dist/protocol/messages/pat-kind.d.ts +16 -0
  40. package/dist/protocol/messages/pat-kind.js +17 -0
  41. package/dist/protocol/messages/peer.d.ts +7 -7
  42. package/dist/protocol/messages/platform-orchestrator.d.ts +393 -7
  43. package/dist/protocol/messages/platform-orchestrator.js +3 -3
  44. package/dist/protocol/messages/run-events.d.ts +5 -1
  45. package/dist/provider/check-run-conclusion.d.ts +1 -1
  46. package/dist/trigger/types.d.ts +35 -7
  47. package/dist/trigger/types.js +7 -2
  48. package/package.json +1 -1
  49. 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",
@@ -235,13 +239,17 @@ const MetricLabels = {
235
239
  KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: [],
236
240
  KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: ["org_id"],
237
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"],
238
244
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: ["reason", "metric"],
239
245
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: [],
240
246
  KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: ["source"],
247
+ KICI_PLATFORM_PLAN_CAP_CHECK_ERRORS_TOTAL: ["org_id"],
241
248
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: [],
242
249
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: ["org_id"],
243
250
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: [],
244
251
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: ["state"],
252
+ KICI_PLATFORM_WS_ORG_RATE_LIMITED_TOTAL: ["org_id"],
245
253
  KICI_REGISTRATIONS_TOTAL: [],
246
254
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: ["reason"],
247
255
  KICI_USER_REGISTRATION_NOTIFY_TOTAL: ["result"],
@@ -374,13 +382,17 @@ const MetricKind = {
374
382
  KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "counter",
375
383
  KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "counter",
376
384
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "counter",
385
+ KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: "counter",
386
+ KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: "counter",
377
387
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "counter",
378
388
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "counter",
379
389
  KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "counter",
390
+ KICI_PLATFORM_PLAN_CAP_CHECK_ERRORS_TOTAL: "counter",
380
391
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "counter",
381
392
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "counter",
382
393
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "counter",
383
394
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "counter",
395
+ KICI_PLATFORM_WS_ORG_RATE_LIMITED_TOTAL: "counter",
384
396
  KICI_REGISTRATIONS_TOTAL: "counter",
385
397
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "counter",
386
398
  KICI_USER_REGISTRATION_NOTIFY_TOTAL: "counter",
@@ -509,13 +521,17 @@ const MetricDescription = {
509
521
  KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "Total log lines forwarded from orchestrators",
510
522
  KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "Total dashboard metric-query requests rate-limited (429).",
511
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",
512
526
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "Orchestrator-pushed metric data points dropped or rewritten by the catalog allow-list. Labels: reason, metric.",
513
527
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "Total orphan connections swept from platform_connections",
514
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)",
515
530
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "Total orchestrators detected as permanently disconnected",
516
531
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform_connections rows evicted by source.register DB dedup (same-instance reconnect path)",
517
532
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "Total execution runs failed due to orchestrator staleness",
518
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",
519
535
  KICI_REGISTRATIONS_TOTAL: "Total user registrations (new personal orgs created on first login)",
520
536
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "Errors encountered while registering universal-git provider bundles",
521
537
  KICI_USER_REGISTRATION_NOTIFY_TOTAL: "New-user Telegram notifications by result (sent|failed)",
@@ -651,13 +667,17 @@ const MetricService = {
651
667
  KICI_PLATFORM_LOG_LINES_FORWARDED_TOTAL: "platform",
652
668
  KICI_PLATFORM_METRICS_QUERY_RATE_LIMITED_TOTAL: "platform",
653
669
  KICI_PLATFORM_MIMIR_RELAY_ERRORS_TOTAL: "platform",
670
+ KICI_PLATFORM_NOTIFICATIONS_DELIVERED_TOTAL: "platform",
671
+ KICI_PLATFORM_NOTIFICATIONS_SUPPRESSED_TOTAL: "platform",
654
672
  KICI_PLATFORM_ORCH_METRICS_FILTERED_TOTAL: "platform",
655
673
  KICI_PLATFORM_ORPHAN_CONNECTIONS_SWEPT_TOTAL: "platform",
656
674
  KICI_PLATFORM_PG_POOL_CLIENT_ERRORS_TOTAL: "platform",
675
+ KICI_PLATFORM_PLAN_CAP_CHECK_ERRORS_TOTAL: "platform",
657
676
  KICI_PLATFORM_STALE_ORCHESTRATORS_TOTAL: "platform",
658
677
  KICI_PLATFORM_STALE_PLATFORM_CONNECTIONS_EVICTED_TOTAL: "platform",
659
678
  KICI_PLATFORM_STALE_RUNS_FAILED_TOTAL: "platform",
660
679
  KICI_PLATFORM_STEP_STATUS_FORWARDS_TOTAL: "platform",
680
+ KICI_PLATFORM_WS_ORG_RATE_LIMITED_TOTAL: "platform",
661
681
  KICI_REGISTRATIONS_TOTAL: "platform",
662
682
  KICI_UNIVERSAL_GIT_REGISTRATION_ERRORS_TOTAL: "orchestrator",
663
683
  KICI_USER_REGISTRATION_NOTIFY_TOTAL: "platform",
@@ -787,13 +807,17 @@ const ALL_METRIC_NAMES = [
787
807
  "kici_platform_log_lines_forwarded_total",
788
808
  "kici_platform_metrics_query_rate_limited_total",
789
809
  "kici_platform_mimir_relay_errors_total",
810
+ "kici_platform_notifications_delivered_total",
811
+ "kici_platform_notifications_suppressed_total",
790
812
  "kici_platform_orch_metrics_filtered_total",
791
813
  "kici_platform_orphan_connections_swept_total",
792
814
  "kici_platform_pg_pool_client_errors_total",
815
+ "kici_platform_plan_cap_check_errors_total",
793
816
  "kici_platform_stale_orchestrators_total",
794
817
  "kici_platform_stale_platform_connections_evicted_total",
795
818
  "kici_platform_stale_runs_failed_total",
796
819
  "kici_platform_step_status_forwards_total",
820
+ "kici_platform_ws_org_rate_limited_total",
797
821
  "kici_registrations_total",
798
822
  "kici_universal_git_registration_errors_total",
799
823
  "kici_user_registration_notify_total",
@@ -13,10 +13,10 @@ 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";
19
- agent: "agent";
20
20
  }>;
21
21
  export type AccessLogSource = z.infer<typeof AccessLogSource>;
22
22
  /** Outcome of the attempted action. */
@@ -30,12 +30,12 @@ export type AccessLogOutcome = z.infer<typeof AccessLogOutcome>;
30
30
  export declare const AccessLogTargetType: z.ZodEnum<{
31
31
  run: "run";
32
32
  job: "job";
33
- payload: "payload";
34
33
  step: "step";
34
+ environment: "environment";
35
+ payload: "payload";
35
36
  event_log: "event_log";
36
37
  event_log_payload: "event_log_payload";
37
38
  secret_scope: "secret_scope";
38
- environment: "environment";
39
39
  registration: "registration";
40
40
  backend: "backend";
41
41
  diagnostics: "diagnostics";
@@ -46,6 +46,7 @@ export declare const AccessLogTargetType: z.ZodEnum<{
46
46
  event_dlq: "event_dlq";
47
47
  org_settings: "org_settings";
48
48
  cluster_meta: "cluster_meta";
49
+ attestation: "attestation";
49
50
  }>;
50
51
  export type AccessLogTargetType = z.infer<typeof AccessLogTargetType>;
51
52
  /**
@@ -61,6 +62,7 @@ export declare const AccessLogAction: z.ZodEnum<{
61
62
  "fleet.host.declare": "fleet.host.declare";
62
63
  "fleet.host.remove": "fleet.host.remove";
63
64
  "run.detail.read": "run.detail.read";
65
+ "run.structured.read": "run.structured.read";
64
66
  "runs.list.read": "runs.list.read";
65
67
  "runs.filters.read": "runs.filters.read";
66
68
  "sources.list.read": "sources.list.read";
@@ -155,6 +157,7 @@ export declare const accessLogItemSchema: z.ZodObject<{
155
157
  "fleet.host.declare": "fleet.host.declare";
156
158
  "fleet.host.remove": "fleet.host.remove";
157
159
  "run.detail.read": "run.detail.read";
160
+ "run.structured.read": "run.structured.read";
158
161
  "runs.list.read": "runs.list.read";
159
162
  "runs.filters.read": "runs.filters.read";
160
163
  "sources.list.read": "sources.list.read";
@@ -220,12 +223,12 @@ export declare const accessLogItemSchema: z.ZodObject<{
220
223
  targetType: z.ZodNullable<z.ZodEnum<{
221
224
  run: "run";
222
225
  job: "job";
223
- payload: "payload";
224
226
  step: "step";
227
+ environment: "environment";
228
+ payload: "payload";
225
229
  event_log: "event_log";
226
230
  event_log_payload: "event_log_payload";
227
231
  secret_scope: "secret_scope";
228
- environment: "environment";
229
232
  registration: "registration";
230
233
  backend: "backend";
231
234
  diagnostics: "diagnostics";
@@ -236,14 +239,15 @@ export declare const accessLogItemSchema: z.ZodObject<{
236
239
  event_dlq: "event_dlq";
237
240
  org_settings: "org_settings";
238
241
  cluster_meta: "cluster_meta";
242
+ attestation: "attestation";
239
243
  }>>;
240
244
  targetId: z.ZodNullable<z.ZodString>;
241
245
  requestId: z.ZodNullable<z.ZodString>;
242
246
  source: z.ZodEnum<{
247
+ agent: "agent";
243
248
  platform_proxy: "platform_proxy";
244
249
  admin_http: "admin_http";
245
250
  admin_cli: "admin_cli";
246
- agent: "agent";
247
251
  }>;
248
252
  outcome: z.ZodEnum<{
249
253
  error: "error";
@@ -273,6 +277,7 @@ export declare const accessLogFilterSchema: z.ZodObject<{
273
277
  "fleet.host.declare": "fleet.host.declare";
274
278
  "fleet.host.remove": "fleet.host.remove";
275
279
  "run.detail.read": "run.detail.read";
280
+ "run.structured.read": "run.structured.read";
276
281
  "runs.list.read": "runs.list.read";
277
282
  "runs.filters.read": "runs.filters.read";
278
283
  "sources.list.read": "sources.list.read";
@@ -336,10 +341,10 @@ export declare const accessLogFilterSchema: z.ZodObject<{
336
341
  purge_chunk: "purge_chunk";
337
342
  }>>;
338
343
  source: z.ZodOptional<z.ZodEnum<{
344
+ agent: "agent";
339
345
  platform_proxy: "platform_proxy";
340
346
  admin_http: "admin_http";
341
347
  admin_cli: "admin_cli";
342
- agent: "agent";
343
348
  }>>;
344
349
  outcome: z.ZodOptional<z.ZodEnum<{
345
350
  error: "error";
@@ -349,12 +354,12 @@ export declare const accessLogFilterSchema: z.ZodObject<{
349
354
  targetType: z.ZodOptional<z.ZodEnum<{
350
355
  run: "run";
351
356
  job: "job";
352
- payload: "payload";
353
357
  step: "step";
358
+ environment: "environment";
359
+ payload: "payload";
354
360
  event_log: "event_log";
355
361
  event_log_payload: "event_log_payload";
356
362
  secret_scope: "secret_scope";
357
- environment: "environment";
358
363
  registration: "registration";
359
364
  backend: "backend";
360
365
  diagnostics: "diagnostics";
@@ -365,6 +370,7 @@ export declare const accessLogFilterSchema: z.ZodObject<{
365
370
  event_dlq: "event_dlq";
366
371
  org_settings: "org_settings";
367
372
  cluster_meta: "cluster_meta";
373
+ attestation: "attestation";
368
374
  }>>;
369
375
  targetId: z.ZodOptional<z.ZodString>;
370
376
  fromTimestamp: z.ZodOptional<z.ZodString>;
@@ -379,6 +385,10 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
379
385
  actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
380
386
  type: z.ZodLiteral<"user">;
381
387
  sub: z.ZodString;
388
+ agent: z.ZodOptional<z.ZodObject<{
389
+ patId: z.ZodString;
390
+ label: z.ZodString;
391
+ }, z.core.$strip>>;
382
392
  }, z.core.$strip>, z.ZodObject<{
383
393
  type: z.ZodLiteral<"api_key">;
384
394
  keyId: z.ZodString;
@@ -413,6 +423,7 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
413
423
  "fleet.host.declare": "fleet.host.declare";
414
424
  "fleet.host.remove": "fleet.host.remove";
415
425
  "run.detail.read": "run.detail.read";
426
+ "run.structured.read": "run.structured.read";
416
427
  "runs.list.read": "runs.list.read";
417
428
  "runs.filters.read": "runs.filters.read";
418
429
  "sources.list.read": "sources.list.read";
@@ -476,10 +487,10 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
476
487
  purge_chunk: "purge_chunk";
477
488
  }>>;
478
489
  source: z.ZodOptional<z.ZodEnum<{
490
+ agent: "agent";
479
491
  platform_proxy: "platform_proxy";
480
492
  admin_http: "admin_http";
481
493
  admin_cli: "admin_cli";
482
- agent: "agent";
483
494
  }>>;
484
495
  outcome: z.ZodOptional<z.ZodEnum<{
485
496
  error: "error";
@@ -489,12 +500,12 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
489
500
  targetType: z.ZodOptional<z.ZodEnum<{
490
501
  run: "run";
491
502
  job: "job";
492
- payload: "payload";
493
503
  step: "step";
504
+ environment: "environment";
505
+ payload: "payload";
494
506
  event_log: "event_log";
495
507
  event_log_payload: "event_log_payload";
496
508
  secret_scope: "secret_scope";
497
- environment: "environment";
498
509
  registration: "registration";
499
510
  backend: "backend";
500
511
  diagnostics: "diagnostics";
@@ -505,6 +516,7 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
505
516
  event_dlq: "event_dlq";
506
517
  org_settings: "org_settings";
507
518
  cluster_meta: "cluster_meta";
519
+ attestation: "attestation";
508
520
  }>>;
509
521
  targetId: z.ZodOptional<z.ZodString>;
510
522
  fromTimestamp: z.ZodOptional<z.ZodString>;
@@ -541,6 +553,7 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
541
553
  "fleet.host.declare": "fleet.host.declare";
542
554
  "fleet.host.remove": "fleet.host.remove";
543
555
  "run.detail.read": "run.detail.read";
556
+ "run.structured.read": "run.structured.read";
544
557
  "runs.list.read": "runs.list.read";
545
558
  "runs.filters.read": "runs.filters.read";
546
559
  "sources.list.read": "sources.list.read";
@@ -606,12 +619,12 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
606
619
  targetType: z.ZodNullable<z.ZodEnum<{
607
620
  run: "run";
608
621
  job: "job";
609
- payload: "payload";
610
622
  step: "step";
623
+ environment: "environment";
624
+ payload: "payload";
611
625
  event_log: "event_log";
612
626
  event_log_payload: "event_log_payload";
613
627
  secret_scope: "secret_scope";
614
- environment: "environment";
615
628
  registration: "registration";
616
629
  backend: "backend";
617
630
  diagnostics: "diagnostics";
@@ -622,14 +635,15 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
622
635
  event_dlq: "event_dlq";
623
636
  org_settings: "org_settings";
624
637
  cluster_meta: "cluster_meta";
638
+ attestation: "attestation";
625
639
  }>>;
626
640
  targetId: z.ZodNullable<z.ZodString>;
627
641
  requestId: z.ZodNullable<z.ZodString>;
628
642
  source: z.ZodEnum<{
643
+ agent: "agent";
629
644
  platform_proxy: "platform_proxy";
630
645
  admin_http: "admin_http";
631
646
  admin_cli: "admin_cli";
632
- agent: "agent";
633
647
  }>;
634
648
  outcome: z.ZodEnum<{
635
649
  error: "error";
@@ -46,7 +46,8 @@ const AccessLogTargetType = z.enum([
46
46
  "access_log",
47
47
  "event_dlq",
48
48
  "org_settings",
49
- "cluster_meta"
49
+ "cluster_meta",
50
+ "attestation"
50
51
  ]);
51
52
  /**
52
53
  * Dotted-namespace action names. Every handler that writes an access_log
@@ -54,6 +55,7 @@ const AccessLogTargetType = z.enum([
54
55
  */
55
56
  const AccessLogAction = z.enum([
56
57
  "run.detail.read",
58
+ "run.structured.read",
57
59
  "runs.list.read",
58
60
  "runs.filters.read",
59
61
  "sources.list.read",
@@ -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",