@kici-dev/engine 0.1.15 → 0.1.17

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 (102) hide show
  1. package/dist/approval/types.d.ts +56 -0
  2. package/dist/approval/types.js +42 -0
  3. package/dist/audit/access-log-policy.js +5 -1
  4. package/dist/audit/activity.js +1 -1
  5. package/dist/audit/retention-policy.js +9 -1
  6. package/dist/bundler/index.js +1 -1
  7. package/dist/bundler/rolldown-config.js +1 -1
  8. package/dist/env/environment-allowlist.js +1 -1
  9. package/dist/environment/index.js +1 -1
  10. package/dist/environment/scope-resolver.js +1 -1
  11. package/dist/environment/types.d.ts +8 -0
  12. package/dist/environment/types.js +1 -1
  13. package/dist/fanout/materialize.d.ts +67 -0
  14. package/dist/fanout/materialize.js +119 -0
  15. package/dist/index.d.ts +4 -2
  16. package/dist/index.js +10 -8
  17. package/dist/labels.js +1 -1
  18. package/dist/matrix/expand.d.ts +43 -0
  19. package/dist/matrix/expand.js +66 -0
  20. package/dist/matrix/format.d.ts +10 -0
  21. package/dist/matrix/format.js +19 -0
  22. package/dist/metrics/catalog-policy.js +8 -3
  23. package/dist/metrics/metric-catalog.generated.d.ts +1 -1
  24. package/dist/metrics/metric-catalog.generated.js +2 -2
  25. package/dist/protocol/analytics-events.js +1 -1
  26. package/dist/protocol/cluster-name.js +1 -1
  27. package/dist/protocol/dashboard-global-workflows.js +1 -1
  28. package/dist/protocol/dashboard-write-operations.js +1 -1
  29. package/dist/protocol/event-log-payload.js +1 -1
  30. package/dist/protocol/messages/access-log.d.ts +25 -5
  31. package/dist/protocol/messages/access-log.js +5 -1
  32. package/dist/protocol/messages/actor.js +1 -1
  33. package/dist/protocol/messages/auth.d.ts +1 -0
  34. package/dist/protocol/messages/auth.js +11 -2
  35. package/dist/protocol/messages/browser.js +1 -1
  36. package/dist/protocol/messages/capabilities.js +1 -1
  37. package/dist/protocol/messages/common.js +1 -1
  38. package/dist/protocol/messages/dashboard-global-workflows.js +1 -1
  39. package/dist/protocol/messages/dashboard.d.ts +1030 -50
  40. package/dist/protocol/messages/dashboard.js +377 -7
  41. package/dist/protocol/messages/event-log.js +1 -1
  42. package/dist/protocol/messages/execution-status.d.ts +13 -1
  43. package/dist/protocol/messages/execution-status.js +13 -3
  44. package/dist/protocol/messages/join.js +1 -1
  45. package/dist/protocol/messages/log-pull.js +1 -1
  46. package/dist/protocol/messages/observe.d.ts +1 -0
  47. package/dist/protocol/messages/oidc-token-relay.d.ts +31 -0
  48. package/dist/protocol/messages/oidc-token-relay.js +34 -0
  49. package/dist/protocol/messages/orchestrator-agent.d.ts +161 -0
  50. package/dist/protocol/messages/orchestrator-agent.js +117 -4
  51. package/dist/protocol/messages/peer.d.ts +76 -0
  52. package/dist/protocol/messages/peer.js +37 -2
  53. package/dist/protocol/messages/platform-orchestrator.d.ts +187 -10
  54. package/dist/protocol/messages/platform-orchestrator.js +13 -2
  55. package/dist/protocol/messages/run-events.js +1 -1
  56. package/dist/protocol/messages/scaler-event.js +1 -1
  57. package/dist/protocol/messages/source-registration.d.ts +7 -6
  58. package/dist/protocol/messages/source-registration.js +7 -6
  59. package/dist/protocol/version.js +1 -1
  60. package/dist/provenance/bundle.d.ts +54 -0
  61. package/dist/provenance/bundle.js +53 -0
  62. package/dist/provenance/dsse.d.ts +39 -0
  63. package/dist/provenance/dsse.js +53 -0
  64. package/dist/provenance/schema.d.ts +407 -0
  65. package/dist/provenance/schema.js +143 -0
  66. package/dist/provenance/verify.d.ts +71 -0
  67. package/dist/provenance/verify.js +135 -0
  68. package/dist/provider/changed-files-fetcher.js +1 -1
  69. package/dist/provider/check-run-conclusion.js +1 -1
  70. package/dist/provider/check-status-poster.js +1 -1
  71. package/dist/provider/clone-token-provider.js +1 -1
  72. package/dist/provider/contributor-resolver.js +1 -1
  73. package/dist/provider/index.js +1 -1
  74. package/dist/provider/lock-file-fetcher.js +1 -1
  75. package/dist/provider/lock-file-parse-error.js +3 -1
  76. package/dist/provider/repo-url-builder.js +1 -1
  77. package/dist/provider/types.d.ts +2 -2
  78. package/dist/provider/types.js +1 -1
  79. package/dist/provider/webhook-normalizer.js +1 -1
  80. package/dist/registration/registerable-trigger-type.js +1 -1
  81. package/dist/scaler/resource-types.js +1 -1
  82. package/dist/scaler/scaler-backend-type.js +1 -1
  83. package/dist/secrets/index.js +1 -1
  84. package/dist/secrets/types.js +1 -1
  85. package/dist/state-machine/index.js +1 -1
  86. package/dist/state-machine/machine.js +1 -1
  87. package/dist/state-machine/types.js +1 -1
  88. package/dist/trigger/decision-trace.js +1 -1
  89. package/dist/trigger/jsonpath-matcher.js +1 -1
  90. package/dist/trigger/matcher.js +1 -1
  91. package/dist/trigger/trigger-event-type.js +1 -1
  92. package/dist/trigger/types.d.ts +34 -1
  93. package/dist/trigger/types.js +14 -5
  94. package/dist/webhook/signature.js +1 -1
  95. package/dist/ws/close-codes.js +1 -1
  96. package/dist/ws/rate-limiter.js +3 -1
  97. package/dist/ws/ws-like.js +1 -1
  98. package/package.json +23 -1
  99. package/sbom.spdx.json +55 -5
  100. package/dist/protocol/messages/observe.js +0 -70
  101. package/dist/protocol/messages/test-run.js +0 -52
  102. /package/dist/{chunk-gOLHoazu.js → chunk-BTugEXQM.js} +0 -0
@@ -5,17 +5,17 @@ export declare const trustPolicyUpdateSchema: z.ZodObject<{
5
5
  orgId: z.ZodString;
6
6
  policy: z.ZodObject<{
7
7
  forkPolicy: z.ZodEnum<{
8
- hold: "hold";
9
8
  reject: "reject";
9
+ hold: "hold";
10
10
  allow: "allow";
11
11
  }>;
12
12
  unknownContributorPolicy: z.ZodEnum<{
13
- hold: "hold";
14
13
  reject: "reject";
14
+ hold: "hold";
15
15
  }>;
16
16
  workflowChangePolicy: z.ZodEnum<{
17
- hold: "hold";
18
17
  reject: "reject";
18
+ hold: "hold";
19
19
  allow: "allow";
20
20
  }>;
21
21
  approvalExpiryHours: z.ZodNumber;
@@ -32,6 +32,10 @@ export declare const trustPolicyUpdateSchema: z.ZodObject<{
32
32
  write: "write";
33
33
  admin: "admin";
34
34
  }>>;
35
+ teamMemberships: z.ZodDefault<z.ZodArray<z.ZodObject<{
36
+ teamName: z.ZodString;
37
+ memberUserIds: z.ZodArray<z.ZodString>;
38
+ }, z.core.$strip>>>;
35
39
  }, z.core.$strip>;
36
40
  export type TrustPolicyUpdate = z.infer<typeof trustPolicyUpdateSchema>;
37
41
  /**
@@ -350,17 +354,17 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
350
354
  orgId: z.ZodString;
351
355
  policy: z.ZodObject<{
352
356
  forkPolicy: z.ZodEnum<{
353
- hold: "hold";
354
357
  reject: "reject";
358
+ hold: "hold";
355
359
  allow: "allow";
356
360
  }>;
357
361
  unknownContributorPolicy: z.ZodEnum<{
358
- hold: "hold";
359
362
  reject: "reject";
363
+ hold: "hold";
360
364
  }>;
361
365
  workflowChangePolicy: z.ZodEnum<{
362
- hold: "hold";
363
366
  reject: "reject";
367
+ hold: "hold";
364
368
  allow: "allow";
365
369
  }>;
366
370
  approvalExpiryHours: z.ZodNumber;
@@ -377,6 +381,10 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
377
381
  write: "write";
378
382
  admin: "admin";
379
383
  }>>;
384
+ teamMemberships: z.ZodDefault<z.ZodArray<z.ZodObject<{
385
+ teamName: z.ZodString;
386
+ memberUserIds: z.ZodArray<z.ZodString>;
387
+ }, z.core.$strip>>>;
380
388
  }, z.core.$strip>, z.ZodObject<{
381
389
  type: z.ZodLiteral<"source.register.ack">;
382
390
  messageId: z.ZodString;
@@ -402,6 +410,7 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
402
410
  type: z.ZodLiteral<"auth.success">;
403
411
  connectionId: z.ZodString;
404
412
  orgPublicAlias: z.ZodOptional<z.ZodString>;
413
+ orgId: z.ZodOptional<z.ZodString>;
405
414
  }, z.core.$strip>, z.ZodObject<{
406
415
  type: z.ZodLiteral<"auth.failure">;
407
416
  reason: z.ZodString;
@@ -484,6 +493,29 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
484
493
  runId: z.ZodString;
485
494
  jobId: z.ZodString;
486
495
  stepIndex: z.ZodNumber;
496
+ }, z.core.$strip>, z.ZodObject<{
497
+ type: z.ZodLiteral<"dashboard.attestations.list">;
498
+ requestId: z.ZodString;
499
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
500
+ type: z.ZodLiteral<"user">;
501
+ sub: z.ZodString;
502
+ }, z.core.$strip>, z.ZodObject<{
503
+ type: z.ZodLiteral<"api_key">;
504
+ keyId: z.ZodString;
505
+ ownerSub: z.ZodString;
506
+ }, z.core.$strip>, z.ZodObject<{
507
+ type: z.ZodLiteral<"service_account">;
508
+ id: z.ZodString;
509
+ }, z.core.$strip>, z.ZodObject<{
510
+ type: z.ZodLiteral<"platform_operator">;
511
+ sub: z.ZodString;
512
+ reason: z.ZodString;
513
+ sessionId: z.ZodOptional<z.ZodString>;
514
+ }, z.core.$strip>, z.ZodObject<{
515
+ type: z.ZodLiteral<"system">;
516
+ component: z.ZodString;
517
+ }, z.core.$strip>], "type">;
518
+ runId: z.ZodString;
487
519
  }, z.core.$strip>, z.ZodObject<{
488
520
  type: z.ZodLiteral<"dashboard.runs.list">;
489
521
  requestId: z.ZodString;
@@ -694,6 +726,8 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
694
726
  type: z.ZodLiteral<"system">;
695
727
  component: z.ZodString;
696
728
  }, z.core.$strip>], "type">;
729
+ includeSecrets: z.ZodOptional<z.ZodBoolean>;
730
+ orgId: z.ZodOptional<z.ZodString>;
697
731
  }, z.core.$strip>, z.ZodObject<{
698
732
  type: z.ZodLiteral<"dashboard.environments.get">;
699
733
  requestId: z.ZodString;
@@ -741,8 +775,8 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
741
775
  }, z.core.$strip>], "type">;
742
776
  name: z.ZodString;
743
777
  envType: z.ZodEnum<{
744
- fixed: "fixed";
745
778
  glob: "glob";
779
+ fixed: "fixed";
746
780
  }>;
747
781
  globPattern: z.ZodOptional<z.ZodString>;
748
782
  branchRestrictions: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -781,8 +815,8 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
781
815
  updates: z.ZodObject<{
782
816
  name: z.ZodOptional<z.ZodString>;
783
817
  envType: z.ZodOptional<z.ZodEnum<{
784
- fixed: "fixed";
785
818
  glob: "glob";
819
+ fixed: "fixed";
786
820
  }>>;
787
821
  globPattern: z.ZodOptional<z.ZodNullable<z.ZodString>>;
788
822
  branchRestrictions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
@@ -1822,9 +1856,11 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
1822
1856
  "run.payload.read": "run.payload.read";
1823
1857
  "run.orch_logs.read": "run.orch_logs.read";
1824
1858
  "step.logs.read": "step.logs.read";
1859
+ "attestations.read": "attestations.read";
1825
1860
  "run.cancel": "run.cancel";
1826
1861
  "run.rerun": "run.rerun";
1827
1862
  "run.manual_schedule": "run.manual_schedule";
1863
+ "run.trigger": "run.trigger";
1828
1864
  "job.cancel": "job.cancel";
1829
1865
  "event_log.list.read": "event_log.list.read";
1830
1866
  "event_log.detail.read": "event_log.detail.read";
@@ -1853,6 +1889,8 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
1853
1889
  "held_run.list.read": "held_run.list.read";
1854
1890
  "held_run.approve": "held_run.approve";
1855
1891
  "held_run.reject": "held_run.reject";
1892
+ "held_run.request": "held_run.request";
1893
+ "held_run.expire": "held_run.expire";
1856
1894
  "registration.list.read": "registration.list.read";
1857
1895
  "diagnostics.read": "diagnostics.read";
1858
1896
  "scaler.capacity.read": "scaler.capacity.read";
@@ -1883,8 +1921,8 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
1883
1921
  targetType: z.ZodOptional<z.ZodEnum<{
1884
1922
  run: "run";
1885
1923
  job: "job";
1886
- step: "step";
1887
1924
  payload: "payload";
1925
+ step: "step";
1888
1926
  event_log: "event_log";
1889
1927
  event_log_payload: "event_log_payload";
1890
1928
  secret_scope: "secret_scope";
@@ -1905,6 +1943,143 @@ export declare const platformToOrchestratorMessageSchema: z.ZodDiscriminatedUnio
1905
1943
  q: z.ZodOptional<z.ZodString>;
1906
1944
  limit: z.ZodOptional<z.ZodNumber>;
1907
1945
  cursor: z.ZodOptional<z.ZodString>;
1946
+ }, z.core.$strip>, z.ZodObject<{
1947
+ type: z.ZodLiteral<"test.relay.uploads.init">;
1948
+ requestId: z.ZodString;
1949
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
1950
+ type: z.ZodLiteral<"user">;
1951
+ sub: z.ZodString;
1952
+ }, z.core.$strip>, z.ZodObject<{
1953
+ type: z.ZodLiteral<"api_key">;
1954
+ keyId: z.ZodString;
1955
+ ownerSub: z.ZodString;
1956
+ }, z.core.$strip>, z.ZodObject<{
1957
+ type: z.ZodLiteral<"service_account">;
1958
+ id: z.ZodString;
1959
+ }, z.core.$strip>, z.ZodObject<{
1960
+ type: z.ZodLiteral<"platform_operator">;
1961
+ sub: z.ZodString;
1962
+ reason: z.ZodString;
1963
+ sessionId: z.ZodOptional<z.ZodString>;
1964
+ }, z.core.$strip>, z.ZodObject<{
1965
+ type: z.ZodLiteral<"system">;
1966
+ component: z.ZodString;
1967
+ }, z.core.$strip>], "type">;
1968
+ routingKey: z.ZodString;
1969
+ sha: z.ZodOptional<z.ZodString>;
1970
+ fileCount: z.ZodOptional<z.ZodNumber>;
1971
+ compressedSize: z.ZodOptional<z.ZodNumber>;
1972
+ }, z.core.$strip>, z.ZodObject<{
1973
+ type: z.ZodLiteral<"test.relay.trigger">;
1974
+ requestId: z.ZodString;
1975
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
1976
+ type: z.ZodLiteral<"user">;
1977
+ sub: z.ZodString;
1978
+ }, z.core.$strip>, z.ZodObject<{
1979
+ type: z.ZodLiteral<"api_key">;
1980
+ keyId: z.ZodString;
1981
+ ownerSub: z.ZodString;
1982
+ }, z.core.$strip>, z.ZodObject<{
1983
+ type: z.ZodLiteral<"service_account">;
1984
+ id: z.ZodString;
1985
+ }, z.core.$strip>, z.ZodObject<{
1986
+ type: z.ZodLiteral<"platform_operator">;
1987
+ sub: z.ZodString;
1988
+ reason: z.ZodString;
1989
+ sessionId: z.ZodOptional<z.ZodString>;
1990
+ }, z.core.$strip>, z.ZodObject<{
1991
+ type: z.ZodLiteral<"system">;
1992
+ component: z.ZodString;
1993
+ }, z.core.$strip>], "type">;
1994
+ routingKey: z.ZodString;
1995
+ fixtureId: z.ZodString;
1996
+ event: z.ZodObject<{
1997
+ type: z.ZodString;
1998
+ action: z.ZodOptional<z.ZodString>;
1999
+ targetBranch: z.ZodString;
2000
+ sourceBranch: z.ZodOptional<z.ZodString>;
2001
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2002
+ changedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
2003
+ }, z.core.$strip>;
2004
+ workflowName: z.ZodOptional<z.ZodString>;
2005
+ uploadId: z.ZodOptional<z.ZodString>;
2006
+ cliPublicKey: z.ZodOptional<z.ZodString>;
2007
+ inlineLockFile: z.ZodOptional<z.ZodString>;
2008
+ fullRepo: z.ZodOptional<z.ZodBoolean>;
2009
+ secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2010
+ encryptedSecrets: z.ZodOptional<z.ZodString>;
2011
+ encryptedSecretsKey: z.ZodOptional<z.ZodString>;
2012
+ }, z.core.$strip>, z.ZodObject<{
2013
+ type: z.ZodLiteral<"test.relay.run.status">;
2014
+ requestId: z.ZodString;
2015
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
2016
+ type: z.ZodLiteral<"user">;
2017
+ sub: z.ZodString;
2018
+ }, z.core.$strip>, z.ZodObject<{
2019
+ type: z.ZodLiteral<"api_key">;
2020
+ keyId: z.ZodString;
2021
+ ownerSub: z.ZodString;
2022
+ }, z.core.$strip>, z.ZodObject<{
2023
+ type: z.ZodLiteral<"service_account">;
2024
+ id: z.ZodString;
2025
+ }, z.core.$strip>, z.ZodObject<{
2026
+ type: z.ZodLiteral<"platform_operator">;
2027
+ sub: z.ZodString;
2028
+ reason: z.ZodString;
2029
+ sessionId: z.ZodOptional<z.ZodString>;
2030
+ }, z.core.$strip>, z.ZodObject<{
2031
+ type: z.ZodLiteral<"system">;
2032
+ component: z.ZodString;
2033
+ }, z.core.$strip>], "type">;
2034
+ runId: z.ZodString;
2035
+ }, z.core.$strip>, z.ZodObject<{
2036
+ type: z.ZodLiteral<"test.relay.run.logs">;
2037
+ requestId: z.ZodString;
2038
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
2039
+ type: z.ZodLiteral<"user">;
2040
+ sub: z.ZodString;
2041
+ }, z.core.$strip>, z.ZodObject<{
2042
+ type: z.ZodLiteral<"api_key">;
2043
+ keyId: z.ZodString;
2044
+ ownerSub: z.ZodString;
2045
+ }, z.core.$strip>, z.ZodObject<{
2046
+ type: z.ZodLiteral<"service_account">;
2047
+ id: z.ZodString;
2048
+ }, z.core.$strip>, z.ZodObject<{
2049
+ type: z.ZodLiteral<"platform_operator">;
2050
+ sub: z.ZodString;
2051
+ reason: z.ZodString;
2052
+ sessionId: z.ZodOptional<z.ZodString>;
2053
+ }, z.core.$strip>, z.ZodObject<{
2054
+ type: z.ZodLiteral<"system">;
2055
+ component: z.ZodString;
2056
+ }, z.core.$strip>], "type">;
2057
+ runId: z.ZodString;
2058
+ cursor: z.ZodNumber;
2059
+ }, z.core.$strip>, z.ZodObject<{
2060
+ type: z.ZodLiteral<"test.relay.cancel">;
2061
+ requestId: z.ZodString;
2062
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
2063
+ type: z.ZodLiteral<"user">;
2064
+ sub: z.ZodString;
2065
+ }, z.core.$strip>, z.ZodObject<{
2066
+ type: z.ZodLiteral<"api_key">;
2067
+ keyId: z.ZodString;
2068
+ ownerSub: z.ZodString;
2069
+ }, z.core.$strip>, z.ZodObject<{
2070
+ type: z.ZodLiteral<"service_account">;
2071
+ id: z.ZodString;
2072
+ }, z.core.$strip>, z.ZodObject<{
2073
+ type: z.ZodLiteral<"platform_operator">;
2074
+ sub: z.ZodString;
2075
+ reason: z.ZodString;
2076
+ sessionId: z.ZodOptional<z.ZodString>;
2077
+ }, z.core.$strip>, z.ZodObject<{
2078
+ type: z.ZodLiteral<"system">;
2079
+ component: z.ZodString;
2080
+ }, z.core.$strip>], "type">;
2081
+ runId: z.ZodOptional<z.ZodString>;
2082
+ branch: z.ZodOptional<z.ZodString>;
1908
2083
  }, z.core.$strip>], "type">;
1909
2084
  /** All messages that flow from Orchestrator to Platform.
1910
2085
  *
@@ -1956,6 +2131,7 @@ export declare const orchestratorToPlatformMessageSchema: z.ZodDiscriminatedUnio
1956
2131
  failed: "failed";
1957
2132
  cancelled: "cancelled";
1958
2133
  cancelling: "cancelling";
2134
+ held: "held";
1959
2135
  }>;
1960
2136
  repoIdentifier: z.ZodOptional<z.ZodString>;
1961
2137
  sha: z.ZodOptional<z.ZodString>;
@@ -2067,6 +2243,7 @@ export declare const orchestratorToPlatformMessageSchema: z.ZodDiscriminatedUnio
2067
2243
  failed: "failed";
2068
2244
  cancelled: "cancelled";
2069
2245
  cancelling: "cancelling";
2246
+ held: "held";
2070
2247
  }>;
2071
2248
  routingKey: z.ZodOptional<z.ZodString>;
2072
2249
  repoIdentifier: z.ZodOptional<z.ZodString>;
@@ -2145,7 +2322,7 @@ export declare const orchestratorToPlatformMessageSchema: z.ZodDiscriminatedUnio
2145
2322
  github_app: "github_app";
2146
2323
  generic_webhook: "generic_webhook";
2147
2324
  universal_git: "universal_git";
2148
- internal: "internal";
2325
+ local: "local";
2149
2326
  }>;
2150
2327
  }, z.core.$strip>>;
2151
2328
  instanceId: z.ZodOptional<z.ZodString>;
@@ -1,4 +1,4 @@
1
- import "../../chunk-gOLHoazu.js";
1
+ import "../../chunk-BTugEXQM.js";
2
2
  import { heartbeatSchema } from "./common.js";
3
3
  import { orchCapabilitiesSchema } from "./capabilities.js";
4
4
  import { authFailureSchema, authRequestSchema, authSuccessSchema } from "./auth.js";
@@ -44,7 +44,18 @@ const trustPolicyUpdateSchema = z.object({
44
44
  "read",
45
45
  "write",
46
46
  "admin"
47
- ]))
47
+ ])),
48
+ /**
49
+ * Operator-defined teams and their member user ids. The orchestrator has no
50
+ * identity store, so team membership is delivered here (next to
51
+ * `identityLinks`) and cached in-memory. The approval resolver matches a
52
+ * `{team}` clause by looking up the team's members in this list.
53
+ * `.default([])` keeps an older Platform that doesn't send it valid.
54
+ */
55
+ teamMemberships: z.array(z.object({
56
+ teamName: z.string(),
57
+ memberUserIds: z.array(z.string())
58
+ })).default([])
48
59
  });
49
60
  /**
50
61
  * Internal shape of a fully-reassembled, HMAC-verified webhook relay handed
@@ -1,4 +1,4 @@
1
- import "../../chunk-gOLHoazu.js";
1
+ import "../../chunk-BTugEXQM.js";
2
2
  import { actorPrincipalSchema } from "./actor.js";
3
3
  import { z } from "zod";
4
4
  //#region src/protocol/messages/run-events.ts
@@ -1,4 +1,4 @@
1
- import "../../chunk-gOLHoazu.js";
1
+ import "../../chunk-BTugEXQM.js";
2
2
  import { z } from "zod";
3
3
  //#region src/protocol/messages/scaler-event.ts
4
4
  /**
@@ -4,7 +4,7 @@ import { z } from 'zod';
4
4
  * grouping logic) to render an icon and friendly label for each source.
5
5
  *
6
6
  * Distinct from `provider` (which collapses universal-git, generic_webhook, and
7
- * internal into the single value `'generic'`): subtype keeps the "what kind of
7
+ * local into the single value `'generic'`): subtype keeps the "what kind of
8
8
  * orchestrator-side wiring is this?" distinction visible all the way through
9
9
  * the API and UI.
10
10
  *
@@ -13,19 +13,20 @@ import { z } from 'zod';
13
13
  * - `generic_webhook` — `generic_webhook_sources` row with `provider_type='generic'`.
14
14
  * - `universal_git` — `generic_webhook_sources` row with a non-null `git_config`
15
15
  * (universal-git provider — gitea, gitlab, forgejo, etc.).
16
- * - `internal` — `generic_webhook_sources` row with `provider_type='internal'`
17
- * (E2E / staging stg-ha smoke-test plumbing).
16
+ * - `local` — `generic_webhook_sources` row with `provider_type='local'`
17
+ * (a git repository present on the agent's filesystem,
18
+ * cloned via `file://`).
18
19
  */
19
20
  export declare const SourceSubtype: z.ZodEnum<{
20
21
  github_app: "github_app";
21
22
  generic_webhook: "generic_webhook";
22
23
  universal_git: "universal_git";
23
- internal: "internal";
24
+ local: "local";
24
25
  }>;
25
26
  export type SourceSubtype = z.infer<typeof SourceSubtype>;
26
27
  /**
27
28
  * Source provider family used by Platform's webhook router. Coarser-grained
28
- * than `SourceSubtype` — every universal-git / generic_webhook / internal row
29
+ * than `SourceSubtype` — every universal-git / generic_webhook / local row
29
30
  * collapses to `'generic'` here because Platform routes them through the same
30
31
  * generic webhook ingress.
31
32
  */
@@ -53,7 +54,7 @@ export declare const sourceRegistrationSchema: z.ZodObject<{
53
54
  github_app: "github_app";
54
55
  generic_webhook: "generic_webhook";
55
56
  universal_git: "universal_git";
56
- internal: "internal";
57
+ local: "local";
57
58
  }>;
58
59
  }, z.core.$strip>>;
59
60
  instanceId: z.ZodOptional<z.ZodString>;
@@ -1,4 +1,4 @@
1
- import "../../chunk-gOLHoazu.js";
1
+ import "../../chunk-BTugEXQM.js";
2
2
  import { z } from "zod";
3
3
  //#region src/protocol/messages/source-registration.ts
4
4
  /**
@@ -6,7 +6,7 @@ import { z } from "zod";
6
6
  * grouping logic) to render an icon and friendly label for each source.
7
7
  *
8
8
  * Distinct from `provider` (which collapses universal-git, generic_webhook, and
9
- * internal into the single value `'generic'`): subtype keeps the "what kind of
9
+ * local into the single value `'generic'`): subtype keeps the "what kind of
10
10
  * orchestrator-side wiring is this?" distinction visible all the way through
11
11
  * the API and UI.
12
12
  *
@@ -15,18 +15,19 @@ import { z } from "zod";
15
15
  * - `generic_webhook` — `generic_webhook_sources` row with `provider_type='generic'`.
16
16
  * - `universal_git` — `generic_webhook_sources` row with a non-null `git_config`
17
17
  * (universal-git provider — gitea, gitlab, forgejo, etc.).
18
- * - `internal` — `generic_webhook_sources` row with `provider_type='internal'`
19
- * (E2E / staging stg-ha smoke-test plumbing).
18
+ * - `local` — `generic_webhook_sources` row with `provider_type='local'`
19
+ * (a git repository present on the agent's filesystem,
20
+ * cloned via `file://`).
20
21
  */
21
22
  const SourceSubtype = z.enum([
22
23
  "github_app",
23
24
  "generic_webhook",
24
25
  "universal_git",
25
- "internal"
26
+ "local"
26
27
  ]);
27
28
  /**
28
29
  * Source provider family used by Platform's webhook router. Coarser-grained
29
- * than `SourceSubtype` — every universal-git / generic_webhook / internal row
30
+ * than `SourceSubtype` — every universal-git / generic_webhook / local row
30
31
  * collapses to `'generic'` here because Platform routes them through the same
31
32
  * generic webhook ingress.
32
33
  */
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/protocol/version.ts
3
3
  /**
4
4
  * Protocol version. Sent during WebSocket handshake.
@@ -0,0 +1,54 @@
1
+ /**
2
+ * KiCI provenance bundle: the Mode-A (KiCI-signed) attestation package.
3
+ *
4
+ * A KiCI bundle is the Sigstore model with the KiCI identity JWT standing in
5
+ * for the Fulcio certificate and no transparency log: it carries the DSSE
6
+ * envelope over the in-toto statement, the ephemeral public key that signed it,
7
+ * and the identity JWT that anchors the statement's build context to a
8
+ * KiCI-minted identity (verified offline against the Platform JWKS).
9
+ *
10
+ * Pure schema + constants, browser-safe — the agent producer and the verifier
11
+ * both import it. Exported at `@kici-dev/engine/provenance/bundle`.
12
+ */
13
+ import { z } from 'zod';
14
+ /** Versioned media type for the KiCI-custom Mode-A bundle (verifier dispatches on it). */
15
+ export declare const KICI_PROVENANCE_BUNDLE_MEDIA_TYPE = "application/vnd.kici.provenance.bundle+json;version=0.1";
16
+ /** OIDC audience the agent requests for the identity token bound into a bundle. */
17
+ export declare const KICI_PROVENANCE_AUDIENCE = "kici-provenance";
18
+ /** in-toto DSSE payload type for the signed statement. */
19
+ export declare const IN_TOTO_PAYLOAD_TYPE = "application/vnd.in-toto+json";
20
+ /** Signing mode of a stored attestation. Mode A = KiCI-signed (the only mode today). */
21
+ export declare const AttestationMode: z.ZodEnum<{
22
+ kici: "kici";
23
+ }>;
24
+ export type AttestationMode = z.infer<typeof AttestationMode>;
25
+ /** Object-storage prefix for provenance bundles. */
26
+ export declare const PROVENANCE_STORAGE_PREFIX = "provenance";
27
+ /**
28
+ * Storage key for a provenance bundle:
29
+ * `provenance/{runId}/{jobId}/{subjectDigest}.kici.json`. Shared by the agent
30
+ * producer and the orchestrator persistence path so the two never drift.
31
+ */
32
+ export declare function provenanceStorageKey(runId: string, jobId: string, subjectDigest: string): string;
33
+ /**
34
+ * Mode-A (KiCI-signed) bundle: the DSSE envelope over the statement plus the
35
+ * verification material (the ephemeral signing public key as a JWK + the
36
+ * identity JWT).
37
+ */
38
+ export declare const kiciBundleSchema: z.ZodObject<{
39
+ mediaType: z.ZodLiteral<"application/vnd.kici.provenance.bundle+json;version=0.1">;
40
+ dsseEnvelope: z.ZodObject<{
41
+ payloadType: z.ZodString;
42
+ payload: z.ZodString;
43
+ signatures: z.ZodArray<z.ZodObject<{
44
+ keyid: z.ZodString;
45
+ sig: z.ZodString;
46
+ }, z.core.$strip>>;
47
+ }, z.core.$strip>;
48
+ verificationMaterial: z.ZodObject<{
49
+ publicKey: z.ZodRecord<z.ZodString, z.ZodUnknown>;
50
+ identityToken: z.ZodString;
51
+ }, z.core.$strip>;
52
+ }, z.core.$strip>;
53
+ export type KiciBundle = z.infer<typeof kiciBundleSchema>;
54
+ //# sourceMappingURL=bundle.d.ts.map
@@ -0,0 +1,53 @@
1
+ import "../chunk-BTugEXQM.js";
2
+ import { dsseEnvelopeSchema } from "./dsse.js";
3
+ import { z } from "zod";
4
+ //#region src/provenance/bundle.ts
5
+ /**
6
+ * KiCI provenance bundle: the Mode-A (KiCI-signed) attestation package.
7
+ *
8
+ * A KiCI bundle is the Sigstore model with the KiCI identity JWT standing in
9
+ * for the Fulcio certificate and no transparency log: it carries the DSSE
10
+ * envelope over the in-toto statement, the ephemeral public key that signed it,
11
+ * and the identity JWT that anchors the statement's build context to a
12
+ * KiCI-minted identity (verified offline against the Platform JWKS).
13
+ *
14
+ * Pure schema + constants, browser-safe — the agent producer and the verifier
15
+ * both import it. Exported at `@kici-dev/engine/provenance/bundle`.
16
+ */
17
+ /** Versioned media type for the KiCI-custom Mode-A bundle (verifier dispatches on it). */
18
+ const KICI_PROVENANCE_BUNDLE_MEDIA_TYPE = "application/vnd.kici.provenance.bundle+json;version=0.1";
19
+ /** OIDC audience the agent requests for the identity token bound into a bundle. */
20
+ const KICI_PROVENANCE_AUDIENCE = "kici-provenance";
21
+ /** in-toto DSSE payload type for the signed statement. */
22
+ const IN_TOTO_PAYLOAD_TYPE = "application/vnd.in-toto+json";
23
+ /** Signing mode of a stored attestation. Mode A = KiCI-signed (the only mode today). */
24
+ const AttestationMode = z.enum(["kici"]);
25
+ /** Object-storage prefix for provenance bundles. */
26
+ const PROVENANCE_STORAGE_PREFIX = "provenance";
27
+ /**
28
+ * Storage key for a provenance bundle:
29
+ * `provenance/{runId}/{jobId}/{subjectDigest}.kici.json`. Shared by the agent
30
+ * producer and the orchestrator persistence path so the two never drift.
31
+ */
32
+ function provenanceStorageKey(runId, jobId, subjectDigest) {
33
+ return `${PROVENANCE_STORAGE_PREFIX}/${runId}/${jobId}/${subjectDigest}.kici.json`;
34
+ }
35
+ /**
36
+ * Mode-A (KiCI-signed) bundle: the DSSE envelope over the statement plus the
37
+ * verification material (the ephemeral signing public key as a JWK + the
38
+ * identity JWT).
39
+ */
40
+ const kiciBundleSchema = z.object({
41
+ mediaType: z.literal(KICI_PROVENANCE_BUNDLE_MEDIA_TYPE),
42
+ dsseEnvelope: dsseEnvelopeSchema,
43
+ verificationMaterial: z.object({
44
+ /** JWK of the ephemeral ES256 key that signed the DSSE envelope. */
45
+ publicKey: z.record(z.string(), z.unknown()),
46
+ /** The KiCI ID token (verified against the Platform JWKS). */
47
+ identityToken: z.string()
48
+ })
49
+ });
50
+ //#endregion
51
+ export { AttestationMode, IN_TOTO_PAYLOAD_TYPE, KICI_PROVENANCE_AUDIENCE, KICI_PROVENANCE_BUNDLE_MEDIA_TYPE, PROVENANCE_STORAGE_PREFIX, kiciBundleSchema, provenanceStorageKey };
52
+
53
+ //# sourceMappingURL=bundle.js.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * DSSE (Dead Simple Signing Envelope) helpers for KiCI provenance.
3
+ *
4
+ * Provides the in-toto pre-authentication encoding (PAE) and the envelope
5
+ * assembly used by the agent producer and the verifier. Pure byte / base64
6
+ * assembly with no Node-only crypto, so this module stays browser-safe and is
7
+ * exported at the subpath `@kici-dev/engine/provenance/dsse`.
8
+ *
9
+ * Spec reference: https://github.com/secure-systems-lab/dsse/blob/master/protocol.md
10
+ */
11
+ import { z } from 'zod';
12
+ /** A single DSSE signature: a key id plus the base64 signature bytes. */
13
+ export declare const dsseSignatureSchema: z.ZodObject<{
14
+ keyid: z.ZodString;
15
+ sig: z.ZodString;
16
+ }, z.core.$strip>;
17
+ export type DsseSignature = z.infer<typeof dsseSignatureSchema>;
18
+ /** A DSSE envelope: the payload type, the base64 payload, and ≥1 signature. */
19
+ export declare const dsseEnvelopeSchema: z.ZodObject<{
20
+ payloadType: z.ZodString;
21
+ payload: z.ZodString;
22
+ signatures: z.ZodArray<z.ZodObject<{
23
+ keyid: z.ZodString;
24
+ sig: z.ZodString;
25
+ }, z.core.$strip>>;
26
+ }, z.core.$strip>;
27
+ export type DsseEnvelope = z.infer<typeof dsseEnvelopeSchema>;
28
+ /**
29
+ * DSSE pre-authentication encoding: `"DSSEv1 <lenType> <type> <lenBody> <body>"`.
30
+ * The length fields count bytes (UTF-8 for the type, raw bytes for the payload).
31
+ * This is the exact byte sequence that gets signed and verified.
32
+ */
33
+ export declare function dssePae(payloadType: string, payload: Uint8Array): Uint8Array;
34
+ /** Assemble a {@link DsseEnvelope} from the payload bytes + raw signature bytes. */
35
+ export declare function buildDsseEnvelope(payloadType: string, payloadBytes: Uint8Array, signatures: {
36
+ keyid: string;
37
+ sig: Uint8Array;
38
+ }[]): DsseEnvelope;
39
+ //# sourceMappingURL=dsse.d.ts.map
@@ -0,0 +1,53 @@
1
+ import "../chunk-BTugEXQM.js";
2
+ import { z } from "zod";
3
+ //#region src/provenance/dsse.ts
4
+ /**
5
+ * DSSE (Dead Simple Signing Envelope) helpers for KiCI provenance.
6
+ *
7
+ * Provides the in-toto pre-authentication encoding (PAE) and the envelope
8
+ * assembly used by the agent producer and the verifier. Pure byte / base64
9
+ * assembly with no Node-only crypto, so this module stays browser-safe and is
10
+ * exported at the subpath `@kici-dev/engine/provenance/dsse`.
11
+ *
12
+ * Spec reference: https://github.com/secure-systems-lab/dsse/blob/master/protocol.md
13
+ */
14
+ /** A single DSSE signature: a key id plus the base64 signature bytes. */
15
+ const dsseSignatureSchema = z.object({
16
+ keyid: z.string(),
17
+ sig: z.string()
18
+ });
19
+ /** A DSSE envelope: the payload type, the base64 payload, and ≥1 signature. */
20
+ const dsseEnvelopeSchema = z.object({
21
+ payloadType: z.string(),
22
+ payload: z.string(),
23
+ signatures: z.array(dsseSignatureSchema).min(1)
24
+ });
25
+ /**
26
+ * DSSE pre-authentication encoding: `"DSSEv1 <lenType> <type> <lenBody> <body>"`.
27
+ * The length fields count bytes (UTF-8 for the type, raw bytes for the payload).
28
+ * This is the exact byte sequence that gets signed and verified.
29
+ */
30
+ function dssePae(payloadType, payload) {
31
+ const enc = new TextEncoder();
32
+ const typeBytes = enc.encode(payloadType);
33
+ const prefix = enc.encode(`DSSEv1 ${typeBytes.length} ${payloadType} ${payload.length} `);
34
+ const out = new Uint8Array(prefix.length + payload.length);
35
+ out.set(prefix, 0);
36
+ out.set(payload, prefix.length);
37
+ return out;
38
+ }
39
+ /** Assemble a {@link DsseEnvelope} from the payload bytes + raw signature bytes. */
40
+ function buildDsseEnvelope(payloadType, payloadBytes, signatures) {
41
+ return {
42
+ payloadType,
43
+ payload: Buffer.from(payloadBytes).toString("base64"),
44
+ signatures: signatures.map((s) => ({
45
+ keyid: s.keyid,
46
+ sig: Buffer.from(s.sig).toString("base64")
47
+ }))
48
+ };
49
+ }
50
+ //#endregion
51
+ export { buildDsseEnvelope, dsseEnvelopeSchema, dssePae, dsseSignatureSchema };
52
+
53
+ //# sourceMappingURL=dsse.js.map