@kici-dev/engine 0.1.23 → 0.1.25

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 (146) hide show
  1. package/dist/approval/types.d.ts +1 -1
  2. package/dist/approval/types.js +1 -1
  3. package/dist/audit/access-log-policy.d.ts +4 -1
  4. package/dist/audit/access-log-policy.js +11 -2
  5. package/dist/audit/activity.d.ts +4 -2
  6. package/dist/audit/activity.js +15 -1
  7. package/dist/audit/retention-policy.js +5 -3
  8. package/dist/bundler/index.js +1 -1
  9. package/dist/bundler/rolldown-config.js +1 -1
  10. package/dist/check-mode.js +1 -1
  11. package/dist/dev-ops/operations.d.ts +56 -0
  12. package/dist/dev-ops/operations.js +135 -0
  13. package/dist/env/environment-allowlist.js +1 -1
  14. package/dist/environment/host-match.js +1 -1
  15. package/dist/environment/index.d.ts +2 -0
  16. package/dist/environment/index.js +4 -2
  17. package/dist/environment/multi-env.d.ts +30 -0
  18. package/dist/environment/multi-env.js +38 -0
  19. package/dist/environment/scope-resolver.js +1 -1
  20. package/dist/environment/scope-template.js +1 -1
  21. package/dist/environment/types.d.ts +8 -2
  22. package/dist/environment/types.js +19 -2
  23. package/dist/fanout/materialize.js +3 -3
  24. package/dist/index.d.ts +10 -1
  25. package/dist/index.js +25 -13
  26. package/dist/inputs/build.js +1 -1
  27. package/dist/inputs/coerce.js +1 -1
  28. package/dist/inputs/descriptor.js +1 -1
  29. package/dist/inputs/extract.js +1 -1
  30. package/dist/inputs/index.d.ts +1 -0
  31. package/dist/inputs/index.js +3 -2
  32. package/dist/inputs/schedule.d.ts +19 -0
  33. package/dist/inputs/schedule.js +33 -0
  34. package/dist/inventory.js +1 -1
  35. package/dist/labels/compile.js +1 -1
  36. package/dist/labels-match.js +1 -1
  37. package/dist/labels.js +2 -2
  38. package/dist/matrix/expand.js +1 -1
  39. package/dist/matrix/format.js +1 -1
  40. package/dist/mcp/fence.d.ts +22 -0
  41. package/dist/mcp/fence.js +65 -0
  42. package/dist/mcp/held-run-resolve.d.ts +52 -0
  43. package/dist/mcp/held-run-resolve.js +53 -0
  44. package/dist/mcp/tool-schemas.d.ts +74 -0
  45. package/dist/mcp/tool-schemas.js +78 -0
  46. package/dist/metrics/catalog-policy.js +1 -1
  47. package/dist/metrics/metric-catalog.generated.d.ts +105 -0
  48. package/dist/metrics/metric-catalog.generated.js +127 -1
  49. package/dist/protocol/analytics-events.js +1 -1
  50. package/dist/protocol/cluster-name.js +1 -1
  51. package/dist/protocol/dashboard-global-workflows.js +1 -1
  52. package/dist/protocol/dashboard-write-operations.d.ts +5 -1
  53. package/dist/protocol/dashboard-write-operations.js +13 -2
  54. package/dist/protocol/event-log-payload.js +1 -1
  55. package/dist/protocol/messages/access-log.d.ts +43 -20
  56. package/dist/protocol/messages/access-log.js +16 -2
  57. package/dist/protocol/messages/actor.d.ts +21 -0
  58. package/dist/protocol/messages/actor.js +42 -8
  59. package/dist/protocol/messages/agent-dev-ops.d.ts +118 -0
  60. package/dist/protocol/messages/agent-dev-ops.js +89 -0
  61. package/dist/protocol/messages/agent-run-result.d.ts +425 -0
  62. package/dist/protocol/messages/agent-run-result.js +165 -0
  63. package/dist/protocol/messages/auth.d.ts +3 -0
  64. package/dist/protocol/messages/auth.js +11 -2
  65. package/dist/protocol/messages/browser.js +1 -1
  66. package/dist/protocol/messages/capabilities.d.ts +3 -0
  67. package/dist/protocol/messages/capabilities.js +16 -3
  68. package/dist/protocol/messages/common.js +1 -1
  69. package/dist/protocol/messages/dashboard-global-workflows.d.ts +14 -0
  70. package/dist/protocol/messages/dashboard-global-workflows.js +1 -1
  71. package/dist/protocol/messages/dashboard.d.ts +1998 -48
  72. package/dist/protocol/messages/dashboard.js +269 -15
  73. package/dist/protocol/messages/deployment-identity.js +1 -1
  74. package/dist/protocol/messages/event-log.js +1 -1
  75. package/dist/protocol/messages/execution-status.d.ts +67 -4
  76. package/dist/protocol/messages/execution-status.js +133 -57
  77. package/dist/protocol/messages/join.js +1 -1
  78. package/dist/protocol/messages/log-pull.js +1 -1
  79. package/dist/protocol/messages/oidc-mint.d.ts +51 -0
  80. package/dist/protocol/messages/oidc-mint.js +55 -0
  81. package/dist/protocol/messages/oidc-token-relay.d.ts +31 -4
  82. package/dist/protocol/messages/oidc-token-relay.js +22 -7
  83. package/dist/protocol/messages/orchestrator-agent.d.ts +66 -5
  84. package/dist/protocol/messages/orchestrator-agent.js +35 -3
  85. package/dist/protocol/messages/pat-kind.d.ts +16 -0
  86. package/dist/protocol/messages/pat-kind.js +17 -0
  87. package/dist/protocol/messages/peer.d.ts +7 -7
  88. package/dist/protocol/messages/peer.js +1 -1
  89. package/dist/protocol/messages/platform-orchestrator.d.ts +685 -17
  90. package/dist/protocol/messages/platform-orchestrator.js +8 -5
  91. package/dist/protocol/messages/run-events.d.ts +8 -1
  92. package/dist/protocol/messages/run-events.js +1 -1
  93. package/dist/protocol/messages/scaler-event.js +1 -1
  94. package/dist/protocol/messages/source-registration.js +1 -1
  95. package/dist/protocol/source-origin.d.ts +20 -0
  96. package/dist/protocol/source-origin.js +21 -0
  97. package/dist/protocol/version.js +1 -1
  98. package/dist/provenance/attestation-origin.d.ts +18 -0
  99. package/dist/provenance/attestation-origin.js +22 -0
  100. package/dist/provenance/bundle.js +1 -1
  101. package/dist/provenance/dsse.js +1 -1
  102. package/dist/provenance/schema.d.ts +48 -0
  103. package/dist/provenance/schema.js +21 -7
  104. package/dist/provenance/statement-hash.d.ts +9 -0
  105. package/dist/provenance/statement-hash.js +17 -0
  106. package/dist/provenance/verify.d.ts +7 -0
  107. package/dist/provenance/verify.js +49 -10
  108. package/dist/provider/changed-files-fetcher.js +1 -1
  109. package/dist/provider/check-run-conclusion.d.ts +1 -1
  110. package/dist/provider/check-run-conclusion.js +1 -1
  111. package/dist/provider/check-status-poster.js +1 -1
  112. package/dist/provider/clone-token-provider.js +1 -1
  113. package/dist/provider/contributor-resolver.js +1 -1
  114. package/dist/provider/index.js +1 -1
  115. package/dist/provider/lock-file-fetcher.js +1 -1
  116. package/dist/provider/lock-file-parse-error.js +1 -1
  117. package/dist/provider/repo-url-builder.js +1 -1
  118. package/dist/provider/types.js +1 -1
  119. package/dist/provider/webhook-normalizer.js +1 -1
  120. package/dist/registration/registerable-trigger-type.d.ts +1 -1
  121. package/dist/registration/registerable-trigger-type.js +1 -1
  122. package/dist/{chunk-BTugEXQM.js → rolldown-runtime-ClRpJifh.js} +0 -1
  123. package/dist/scaler/resource-types.js +1 -1
  124. package/dist/scaler/scaler-backend-type.js +1 -1
  125. package/dist/secrets/index.d.ts +1 -1
  126. package/dist/secrets/index.js +1 -1
  127. package/dist/secrets/types.d.ts +0 -24
  128. package/dist/secrets/types.js +1 -1
  129. package/dist/state-machine/index.js +1 -1
  130. package/dist/state-machine/machine.js +1 -1
  131. package/dist/state-machine/types.js +1 -1
  132. package/dist/trigger/decision-trace.js +1 -1
  133. package/dist/trigger/jsonpath-matcher.js +1 -1
  134. package/dist/trigger/matcher.js +1 -1
  135. package/dist/trigger/trigger-event-type.js +1 -1
  136. package/dist/trigger/types.d.ts +35 -7
  137. package/dist/trigger/types.js +8 -3
  138. package/dist/webhook/signature.js +1 -1
  139. package/dist/webhook/webhook-url-format.d.ts +7 -0
  140. package/dist/webhook/webhook-url-format.js +11 -2
  141. package/dist/ws/close-codes.d.ts +8 -2
  142. package/dist/ws/close-codes.js +10 -4
  143. package/dist/ws/rate-limiter.js +1 -1
  144. package/dist/ws/ws-like.js +1 -1
  145. package/package.json +9 -1
  146. package/sbom.spdx.json +5 -5
@@ -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. */
@@ -28,14 +28,14 @@ export declare const AccessLogOutcome: z.ZodEnum<{
28
28
  export type AccessLogOutcome = z.infer<typeof AccessLogOutcome>;
29
29
  /** Target object category. */
30
30
  export declare const AccessLogTargetType: z.ZodEnum<{
31
- run: "run";
32
31
  job: "job";
33
- payload: "payload";
34
32
  step: "step";
33
+ run: "run";
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";
@@ -218,14 +221,14 @@ export declare const accessLogItemSchema: z.ZodObject<{
218
221
  purge_chunk: "purge_chunk";
219
222
  }>;
220
223
  targetType: z.ZodNullable<z.ZodEnum<{
221
- run: "run";
222
224
  job: "job";
223
- payload: "payload";
224
225
  step: "step";
226
+ run: "run";
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";
@@ -251,6 +255,7 @@ export declare const accessLogItemSchema: z.ZodObject<{
251
255
  denied: "denied";
252
256
  }>;
253
257
  errorMessage: z.ZodNullable<z.ZodString>;
258
+ agentLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
254
259
  createdAt: z.ZodString;
255
260
  }, z.core.$strip>;
256
261
  export type AccessLogItem = z.infer<typeof accessLogItemSchema>;
@@ -273,6 +278,7 @@ export declare const accessLogFilterSchema: z.ZodObject<{
273
278
  "fleet.host.declare": "fleet.host.declare";
274
279
  "fleet.host.remove": "fleet.host.remove";
275
280
  "run.detail.read": "run.detail.read";
281
+ "run.structured.read": "run.structured.read";
276
282
  "runs.list.read": "runs.list.read";
277
283
  "runs.filters.read": "runs.filters.read";
278
284
  "sources.list.read": "sources.list.read";
@@ -336,10 +342,10 @@ export declare const accessLogFilterSchema: z.ZodObject<{
336
342
  purge_chunk: "purge_chunk";
337
343
  }>>;
338
344
  source: z.ZodOptional<z.ZodEnum<{
345
+ agent: "agent";
339
346
  platform_proxy: "platform_proxy";
340
347
  admin_http: "admin_http";
341
348
  admin_cli: "admin_cli";
342
- agent: "agent";
343
349
  }>>;
344
350
  outcome: z.ZodOptional<z.ZodEnum<{
345
351
  error: "error";
@@ -347,14 +353,14 @@ export declare const accessLogFilterSchema: z.ZodObject<{
347
353
  denied: "denied";
348
354
  }>>;
349
355
  targetType: z.ZodOptional<z.ZodEnum<{
350
- run: "run";
351
356
  job: "job";
352
- payload: "payload";
353
357
  step: "step";
358
+ run: "run";
359
+ environment: "environment";
360
+ payload: "payload";
354
361
  event_log: "event_log";
355
362
  event_log_payload: "event_log_payload";
356
363
  secret_scope: "secret_scope";
357
- environment: "environment";
358
364
  registration: "registration";
359
365
  backend: "backend";
360
366
  diagnostics: "diagnostics";
@@ -365,10 +371,13 @@ export declare const accessLogFilterSchema: z.ZodObject<{
365
371
  event_dlq: "event_dlq";
366
372
  org_settings: "org_settings";
367
373
  cluster_meta: "cluster_meta";
374
+ attestation: "attestation";
368
375
  }>>;
369
376
  targetId: z.ZodOptional<z.ZodString>;
370
377
  fromTimestamp: z.ZodOptional<z.ZodString>;
371
378
  toTimestamp: z.ZodOptional<z.ZodString>;
379
+ agentLabel: z.ZodOptional<z.ZodString>;
380
+ agentOnly: z.ZodOptional<z.ZodBoolean>;
372
381
  limit: z.ZodOptional<z.ZodNumber>;
373
382
  cursor: z.ZodOptional<z.ZodString>;
374
383
  }, z.core.$strip>;
@@ -379,10 +388,17 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
379
388
  actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
380
389
  type: z.ZodLiteral<"user">;
381
390
  sub: z.ZodString;
391
+ agent: z.ZodOptional<z.ZodObject<{
392
+ patId: z.ZodString;
393
+ label: z.ZodString;
394
+ }, z.core.$strip>>;
382
395
  }, z.core.$strip>, z.ZodObject<{
383
396
  type: z.ZodLiteral<"api_key">;
384
397
  keyId: z.ZodString;
385
398
  ownerSub: z.ZodString;
399
+ agent: z.ZodOptional<z.ZodObject<{
400
+ label: z.ZodString;
401
+ }, z.core.$strip>>;
386
402
  }, z.core.$strip>, z.ZodObject<{
387
403
  type: z.ZodLiteral<"service_account">;
388
404
  id: z.ZodString;
@@ -413,6 +429,7 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
413
429
  "fleet.host.declare": "fleet.host.declare";
414
430
  "fleet.host.remove": "fleet.host.remove";
415
431
  "run.detail.read": "run.detail.read";
432
+ "run.structured.read": "run.structured.read";
416
433
  "runs.list.read": "runs.list.read";
417
434
  "runs.filters.read": "runs.filters.read";
418
435
  "sources.list.read": "sources.list.read";
@@ -476,10 +493,10 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
476
493
  purge_chunk: "purge_chunk";
477
494
  }>>;
478
495
  source: z.ZodOptional<z.ZodEnum<{
496
+ agent: "agent";
479
497
  platform_proxy: "platform_proxy";
480
498
  admin_http: "admin_http";
481
499
  admin_cli: "admin_cli";
482
- agent: "agent";
483
500
  }>>;
484
501
  outcome: z.ZodOptional<z.ZodEnum<{
485
502
  error: "error";
@@ -487,14 +504,14 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
487
504
  denied: "denied";
488
505
  }>>;
489
506
  targetType: z.ZodOptional<z.ZodEnum<{
490
- run: "run";
491
507
  job: "job";
492
- payload: "payload";
493
508
  step: "step";
509
+ run: "run";
510
+ environment: "environment";
511
+ payload: "payload";
494
512
  event_log: "event_log";
495
513
  event_log_payload: "event_log_payload";
496
514
  secret_scope: "secret_scope";
497
- environment: "environment";
498
515
  registration: "registration";
499
516
  backend: "backend";
500
517
  diagnostics: "diagnostics";
@@ -505,11 +522,14 @@ export declare const dashboardAccessLogListRequestSchema: z.ZodObject<{
505
522
  event_dlq: "event_dlq";
506
523
  org_settings: "org_settings";
507
524
  cluster_meta: "cluster_meta";
525
+ attestation: "attestation";
508
526
  }>>;
509
527
  targetId: z.ZodOptional<z.ZodString>;
510
528
  fromTimestamp: z.ZodOptional<z.ZodString>;
511
529
  toTimestamp: z.ZodOptional<z.ZodString>;
512
530
  q: z.ZodOptional<z.ZodString>;
531
+ agentLabel: z.ZodOptional<z.ZodString>;
532
+ agentOnly: z.ZodOptional<z.ZodBoolean>;
513
533
  limit: z.ZodOptional<z.ZodNumber>;
514
534
  cursor: z.ZodOptional<z.ZodString>;
515
535
  }, z.core.$strip>;
@@ -541,6 +561,7 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
541
561
  "fleet.host.declare": "fleet.host.declare";
542
562
  "fleet.host.remove": "fleet.host.remove";
543
563
  "run.detail.read": "run.detail.read";
564
+ "run.structured.read": "run.structured.read";
544
565
  "runs.list.read": "runs.list.read";
545
566
  "runs.filters.read": "runs.filters.read";
546
567
  "sources.list.read": "sources.list.read";
@@ -604,14 +625,14 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
604
625
  purge_chunk: "purge_chunk";
605
626
  }>;
606
627
  targetType: z.ZodNullable<z.ZodEnum<{
607
- run: "run";
608
628
  job: "job";
609
- payload: "payload";
610
629
  step: "step";
630
+ run: "run";
631
+ environment: "environment";
632
+ payload: "payload";
611
633
  event_log: "event_log";
612
634
  event_log_payload: "event_log_payload";
613
635
  secret_scope: "secret_scope";
614
- environment: "environment";
615
636
  registration: "registration";
616
637
  backend: "backend";
617
638
  diagnostics: "diagnostics";
@@ -622,14 +643,15 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
622
643
  event_dlq: "event_dlq";
623
644
  org_settings: "org_settings";
624
645
  cluster_meta: "cluster_meta";
646
+ attestation: "attestation";
625
647
  }>>;
626
648
  targetId: z.ZodNullable<z.ZodString>;
627
649
  requestId: z.ZodNullable<z.ZodString>;
628
650
  source: z.ZodEnum<{
651
+ agent: "agent";
629
652
  platform_proxy: "platform_proxy";
630
653
  admin_http: "admin_http";
631
654
  admin_cli: "admin_cli";
632
- agent: "agent";
633
655
  }>;
634
656
  outcome: z.ZodEnum<{
635
657
  error: "error";
@@ -637,6 +659,7 @@ export declare const dashboardAccessLogListResponseSchema: z.ZodObject<{
637
659
  denied: "denied";
638
660
  }>;
639
661
  errorMessage: z.ZodNullable<z.ZodString>;
662
+ agentLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
640
663
  createdAt: z.ZodString;
641
664
  }, z.core.$strip>>>;
642
665
  nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import { ActorType, actorPrincipalSchema } from "./actor.js";
3
3
  import { z } from "zod";
4
4
  //#region src/protocol/messages/access-log.ts
@@ -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",
@@ -147,6 +149,12 @@ const accessLogItemSchema = z.object({
147
149
  source: AccessLogSource,
148
150
  outcome: AccessLogOutcome,
149
151
  errorMessage: z.string().nullable(),
152
+ /**
153
+ * Agent provenance label promoted from the dedicated `agent_label` column
154
+ * (not parsed out of `actor_meta`) so consumers can filter/display it
155
+ * directly. Null for ordinary human / API-key / system actors.
156
+ */
157
+ agentLabel: z.string().nullable().optional(),
150
158
  createdAt: z.string()
151
159
  });
152
160
  /** Shared filter shape reused by Platform proxy + orchestrator HTTP + CLI. */
@@ -160,6 +168,8 @@ const accessLogFilterSchema = z.object({
160
168
  targetId: z.string().optional(),
161
169
  fromTimestamp: z.string().optional(),
162
170
  toTimestamp: z.string().optional(),
171
+ agentLabel: z.string().optional(),
172
+ agentOnly: z.boolean().optional(),
163
173
  limit: z.number().int().positive().max(200).optional(),
164
174
  cursor: z.string().optional()
165
175
  });
@@ -179,6 +189,10 @@ const dashboardAccessLogListRequestSchema = z.object({
179
189
  toTimestamp: z.string().optional(),
180
190
  /** Full-text search over `error_message` (trigram-indexed via migration 009). */
181
191
  q: z.string().optional(),
192
+ /** Exact-match filter on the agent provenance label (`agent_label` column). */
193
+ agentLabel: z.string().max(255).optional(),
194
+ /** When true, return only agent-attributed rows (`agent_label IS NOT NULL`). */
195
+ agentOnly: z.boolean().optional(),
182
196
  limit: z.number().int().positive().max(200).optional(),
183
197
  cursor: z.string().optional()
184
198
  });
@@ -20,12 +20,19 @@ 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<{
26
30
  type: z.ZodLiteral<"api_key">;
27
31
  keyId: z.ZodString;
28
32
  ownerSub: z.ZodString;
33
+ agent: z.ZodOptional<z.ZodObject<{
34
+ label: z.ZodString;
35
+ }, z.core.$strip>>;
29
36
  }, z.core.$strip>;
30
37
  export type ApiKeyActor = z.infer<typeof apiKeyActorSchema>;
31
38
  export declare const serviceAccountActorSchema: z.ZodObject<{
@@ -48,10 +55,17 @@ export type SystemActor = z.infer<typeof systemActorSchema>;
48
55
  export declare const actorPrincipalSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
49
56
  type: z.ZodLiteral<"user">;
50
57
  sub: z.ZodString;
58
+ agent: z.ZodOptional<z.ZodObject<{
59
+ patId: z.ZodString;
60
+ label: z.ZodString;
61
+ }, z.core.$strip>>;
51
62
  }, z.core.$strip>, z.ZodObject<{
52
63
  type: z.ZodLiteral<"api_key">;
53
64
  keyId: z.ZodString;
54
65
  ownerSub: z.ZodString;
66
+ agent: z.ZodOptional<z.ZodObject<{
67
+ label: z.ZodString;
68
+ }, z.core.$strip>>;
55
69
  }, z.core.$strip>, z.ZodObject<{
56
70
  type: z.ZodLiteral<"service_account">;
57
71
  id: z.ZodString;
@@ -99,4 +113,11 @@ export declare function flattenActor(actor: ActorPrincipal): {
99
113
  actorId: string;
100
114
  actorMeta: Record<string, unknown> | null;
101
115
  };
116
+ /**
117
+ * Extract the agent provenance label from an actor, when present. Returns the
118
+ * label for agent-kind `user` (PAT) and `api_key` (org key) actors, else null.
119
+ * The single label extractor reused by run capture and the access-log writer so
120
+ * both credential families surface agent provenance identically.
121
+ */
122
+ export declare function agentLabelOf(actor: ActorPrincipal): string | null;
102
123
  //# sourceMappingURL=actor.d.ts.map
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import { z } from "zod";
3
3
  //#region src/protocol/messages/actor.ts
4
4
  /**
@@ -21,14 +21,32 @@ 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),
28
39
  /** Opaque key identifier (not the secret). */
29
40
  keyId: z.string().min(1),
30
41
  /** Keycloak sub of the human who owns this key. */
31
- ownerSub: z.string().min(1)
42
+ ownerSub: z.string().min(1),
43
+ /**
44
+ * Present when the org API key is agent-kind (e.g. a service account driving
45
+ * KiCI via the developer MCP server). Unlike the user actor's agent, no
46
+ * separate id is needed — `keyId` already identifies the credential. The key
47
+ * still inherits the org's permissions; the label is provenance only.
48
+ */
49
+ agent: z.object({ label: z.string().min(1) }).optional()
32
50
  });
33
51
  const serviceAccountActorSchema = z.object({
34
52
  type: z.literal(ActorType.enum.service_account),
@@ -77,8 +95,8 @@ const actorPrincipalSchema = z.discriminatedUnion("type", [
77
95
  */
78
96
  function stringifyActor(actor) {
79
97
  switch (actor.type) {
80
- case "user": return `user:${actor.sub}`;
81
- case "api_key": return `api_key:${actor.keyId}`;
98
+ case "user": return actor.agent ? `user:${actor.sub} via agent:${actor.agent.label}` : `user:${actor.sub}`;
99
+ case "api_key": return actor.agent ? `api_key:${actor.keyId} via agent:${actor.agent.label}` : `api_key:${actor.keyId}`;
82
100
  case "service_account": return `service_account:${actor.id}`;
83
101
  case "platform_operator": return `platform_operator:${actor.sub}`;
84
102
  case "system": return `system:${actor.component}`;
@@ -116,12 +134,18 @@ function flattenActor(actor) {
116
134
  case "user": return {
117
135
  actorType: "user",
118
136
  actorId: actor.sub,
119
- actorMeta: null
137
+ actorMeta: actor.agent ? {
138
+ agentPatId: actor.agent.patId,
139
+ agentLabel: actor.agent.label
140
+ } : null
120
141
  };
121
142
  case "api_key": return {
122
143
  actorType: "api_key",
123
144
  actorId: actor.keyId,
124
- actorMeta: { ownerSub: actor.ownerSub }
145
+ actorMeta: actor.agent ? {
146
+ ownerSub: actor.ownerSub,
147
+ agentLabel: actor.agent.label
148
+ } : { ownerSub: actor.ownerSub }
125
149
  };
126
150
  case "service_account": return {
127
151
  actorType: "service_account",
@@ -143,7 +167,17 @@ function flattenActor(actor) {
143
167
  };
144
168
  }
145
169
  }
170
+ /**
171
+ * Extract the agent provenance label from an actor, when present. Returns the
172
+ * label for agent-kind `user` (PAT) and `api_key` (org key) actors, else null.
173
+ * The single label extractor reused by run capture and the access-log writer so
174
+ * both credential families surface agent provenance identically.
175
+ */
176
+ function agentLabelOf(actor) {
177
+ if (actor.type === "user" || actor.type === "api_key") return actor.agent?.label ?? null;
178
+ return null;
179
+ }
146
180
  //#endregion
147
- export { ActorType, actorPrincipalSchema, apiKeyActorSchema, flattenActor, parseActor, platformOperatorActorSchema, serviceAccountActorSchema, stringifyActor, systemActorSchema, userActorSchema };
181
+ export { ActorType, actorPrincipalSchema, agentLabelOf, apiKeyActorSchema, flattenActor, parseActor, platformOperatorActorSchema, serviceAccountActorSchema, stringifyActor, systemActorSchema, userActorSchema };
148
182
 
149
183
  //# sourceMappingURL=actor.js.map
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Agent-facing, provenance-tagged shapes for the developer MCP's read tools
3
+ * beyond runs: organizations, connected orchestrators, diagnostics, and secret
4
+ * scope key names. Same discipline as {@link ./agent-run-result.js}: every
5
+ * user/process-controlled value (org and cluster names, routing keys, scope and
6
+ * secret key names) is wrapped in an {@link untrusted} envelope so the fencing
7
+ * renderer keeps it out of an agent's instruction channel; KiCI-generated ids,
8
+ * enum statuses, counts, and timestamps stay plain (trusted).
9
+ *
10
+ * Browser-safe (zod only) so it can ride the engine barrel alongside the rest
11
+ * of the agent-facing read contract.
12
+ */
13
+ import { z } from 'zod';
14
+ /**
15
+ * Organization the calling user belongs to. `displayName` / `publicAlias` are
16
+ * user-chosen → untrusted; the id, the owner flag, and the creation timestamp
17
+ * are trusted.
18
+ */
19
+ export declare const agentOrgSummarySchema: z.ZodObject<{
20
+ id: z.ZodString;
21
+ publicAlias: z.ZodNullable<z.ZodObject<{
22
+ untrusted: z.ZodLiteral<true>;
23
+ value: z.ZodString;
24
+ }, z.core.$strip>>;
25
+ displayName: z.ZodObject<{
26
+ untrusted: z.ZodLiteral<true>;
27
+ value: z.ZodString;
28
+ }, z.core.$strip>;
29
+ isOwner: z.ZodBoolean;
30
+ createdAt: z.ZodNullable<z.ZodString>;
31
+ }, z.core.$strip>;
32
+ export type AgentOrgSummary = z.infer<typeof agentOrgSummarySchema>;
33
+ /**
34
+ * Connected orchestrator cluster (the customer-deployed data plane the org's
35
+ * runs execute on). The cluster name and routing keys carry user/source-derived
36
+ * content → untrusted; versions, modes, roles, scaler-backend enum tags, the S3
37
+ * flag, ids, and timestamps are trusted.
38
+ */
39
+ export declare const agentOrchestratorSummarySchema: z.ZodObject<{
40
+ connectionId: z.ZodString;
41
+ clusterName: z.ZodNullable<z.ZodObject<{
42
+ untrusted: z.ZodLiteral<true>;
43
+ value: z.ZodString;
44
+ }, z.core.$strip>>;
45
+ routingKeys: z.ZodArray<z.ZodObject<{
46
+ untrusted: z.ZodLiteral<true>;
47
+ value: z.ZodString;
48
+ }, z.core.$strip>>;
49
+ orchVersion: z.ZodNullable<z.ZodString>;
50
+ orchMode: z.ZodNullable<z.ZodString>;
51
+ orchRole: z.ZodNullable<z.ZodString>;
52
+ scalerBackends: z.ZodArray<z.ZodString>;
53
+ s3LogAccess: z.ZodBoolean;
54
+ connectedAt: z.ZodString;
55
+ lastHeartbeatAt: z.ZodString;
56
+ }, z.core.$strip>;
57
+ export type AgentOrchestratorSummary = z.infer<typeof agentOrchestratorSummarySchema>;
58
+ /** One orchestrator connection row inside the diagnostics summary. */
59
+ export declare const agentDiagnosticsConnectionSchema: z.ZodObject<{
60
+ connectionId: z.ZodString;
61
+ healthBadge: z.ZodEnum<{
62
+ stale: "stale";
63
+ connected: "connected";
64
+ unhealthy: "unhealthy";
65
+ }>;
66
+ routingKeys: z.ZodArray<z.ZodObject<{
67
+ untrusted: z.ZodLiteral<true>;
68
+ value: z.ZodString;
69
+ }, z.core.$strip>>;
70
+ lastHeartbeatAt: z.ZodNullable<z.ZodString>;
71
+ }, z.core.$strip>;
72
+ /**
73
+ * Org diagnostics summary: execution metrics over the last 24h plus per-orch
74
+ * connection health. All metrics/counts/badges are KiCI-computed (trusted); only
75
+ * the routing keys carry user content.
76
+ */
77
+ export declare const agentDiagnosticsSchema: z.ZodObject<{
78
+ executionMetrics: z.ZodObject<{
79
+ totalRuns: z.ZodNumber;
80
+ successRate: z.ZodNumber;
81
+ avgDurationSeconds: z.ZodNumber;
82
+ queuedJobs: z.ZodNumber;
83
+ runningJobs: z.ZodNumber;
84
+ }, z.core.$strip>;
85
+ orchestrators: z.ZodArray<z.ZodObject<{
86
+ connectionId: z.ZodString;
87
+ healthBadge: z.ZodEnum<{
88
+ stale: "stale";
89
+ connected: "connected";
90
+ unhealthy: "unhealthy";
91
+ }>;
92
+ routingKeys: z.ZodArray<z.ZodObject<{
93
+ untrusted: z.ZodLiteral<true>;
94
+ value: z.ZodString;
95
+ }, z.core.$strip>>;
96
+ lastHeartbeatAt: z.ZodNullable<z.ZodString>;
97
+ }, z.core.$strip>>;
98
+ orphanedConnections: z.ZodNumber;
99
+ }, z.core.$strip>;
100
+ export type AgentDiagnostics = z.infer<typeof agentDiagnosticsSchema>;
101
+ /**
102
+ * A secret scope and the key NAMES it holds — never values. Both the scope name
103
+ * and each key name are user-chosen → untrusted. This is the read contract for
104
+ * `list_secrets`: an agent can discover which secret keys exist without ever
105
+ * being handed a secret value.
106
+ */
107
+ export declare const agentSecretScopeSchema: z.ZodObject<{
108
+ scope: z.ZodObject<{
109
+ untrusted: z.ZodLiteral<true>;
110
+ value: z.ZodString;
111
+ }, z.core.$strip>;
112
+ keys: z.ZodArray<z.ZodObject<{
113
+ untrusted: z.ZodLiteral<true>;
114
+ value: z.ZodString;
115
+ }, z.core.$strip>>;
116
+ }, z.core.$strip>;
117
+ export type AgentSecretScope = z.infer<typeof agentSecretScopeSchema>;
118
+ //# sourceMappingURL=agent-dev-ops.d.ts.map
@@ -0,0 +1,89 @@
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
+ import { untrusted } from "./agent-run-result.js";
3
+ import { z } from "zod";
4
+ //#region src/protocol/messages/agent-dev-ops.ts
5
+ /**
6
+ * Agent-facing, provenance-tagged shapes for the developer MCP's read tools
7
+ * beyond runs: organizations, connected orchestrators, diagnostics, and secret
8
+ * scope key names. Same discipline as {@link ./agent-run-result.js}: every
9
+ * user/process-controlled value (org and cluster names, routing keys, scope and
10
+ * secret key names) is wrapped in an {@link untrusted} envelope so the fencing
11
+ * renderer keeps it out of an agent's instruction channel; KiCI-generated ids,
12
+ * enum statuses, counts, and timestamps stay plain (trusted).
13
+ *
14
+ * Browser-safe (zod only) so it can ride the engine barrel alongside the rest
15
+ * of the agent-facing read contract.
16
+ */
17
+ const untrustedString = untrusted(z.string());
18
+ const untrustedStringNullable = untrusted(z.string()).nullable();
19
+ /**
20
+ * Organization the calling user belongs to. `displayName` / `publicAlias` are
21
+ * user-chosen → untrusted; the id, the owner flag, and the creation timestamp
22
+ * are trusted.
23
+ */
24
+ const agentOrgSummarySchema = z.object({
25
+ id: z.string(),
26
+ publicAlias: untrustedStringNullable,
27
+ displayName: untrustedString,
28
+ isOwner: z.boolean(),
29
+ createdAt: z.string().nullable()
30
+ });
31
+ /**
32
+ * Connected orchestrator cluster (the customer-deployed data plane the org's
33
+ * runs execute on). The cluster name and routing keys carry user/source-derived
34
+ * content → untrusted; versions, modes, roles, scaler-backend enum tags, the S3
35
+ * flag, ids, and timestamps are trusted.
36
+ */
37
+ const agentOrchestratorSummarySchema = z.object({
38
+ connectionId: z.string(),
39
+ clusterName: untrustedStringNullable,
40
+ routingKeys: z.array(untrustedString),
41
+ orchVersion: z.string().nullable(),
42
+ orchMode: z.string().nullable(),
43
+ orchRole: z.string().nullable(),
44
+ scalerBackends: z.array(z.string()),
45
+ s3LogAccess: z.boolean(),
46
+ connectedAt: z.string(),
47
+ lastHeartbeatAt: z.string()
48
+ });
49
+ /** One orchestrator connection row inside the diagnostics summary. */
50
+ const agentDiagnosticsConnectionSchema = z.object({
51
+ connectionId: z.string(),
52
+ healthBadge: z.enum([
53
+ "connected",
54
+ "unhealthy",
55
+ "stale"
56
+ ]),
57
+ routingKeys: z.array(untrustedString),
58
+ lastHeartbeatAt: z.string().nullable()
59
+ });
60
+ /**
61
+ * Org diagnostics summary: execution metrics over the last 24h plus per-orch
62
+ * connection health. All metrics/counts/badges are KiCI-computed (trusted); only
63
+ * the routing keys carry user content.
64
+ */
65
+ const agentDiagnosticsSchema = z.object({
66
+ executionMetrics: z.object({
67
+ totalRuns: z.number().int(),
68
+ successRate: z.number(),
69
+ avgDurationSeconds: z.number(),
70
+ queuedJobs: z.number().int(),
71
+ runningJobs: z.number().int()
72
+ }),
73
+ orchestrators: z.array(agentDiagnosticsConnectionSchema),
74
+ orphanedConnections: z.number().int()
75
+ });
76
+ /**
77
+ * A secret scope and the key NAMES it holds — never values. Both the scope name
78
+ * and each key name are user-chosen → untrusted. This is the read contract for
79
+ * `list_secrets`: an agent can discover which secret keys exist without ever
80
+ * being handed a secret value.
81
+ */
82
+ const agentSecretScopeSchema = z.object({
83
+ scope: untrustedString,
84
+ keys: z.array(untrustedString)
85
+ });
86
+ //#endregion
87
+ export { agentDiagnosticsConnectionSchema, agentDiagnosticsSchema, agentOrchestratorSummarySchema, agentOrgSummarySchema, agentSecretScopeSchema };
88
+
89
+ //# sourceMappingURL=agent-dev-ops.js.map