@kici-dev/engine 0.1.24 → 0.1.26

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 (136) 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.js +3 -2
  4. package/dist/audit/activity.d.ts +2 -0
  5. package/dist/audit/activity.js +15 -1
  6. package/dist/audit/retention-policy.js +3 -3
  7. package/dist/bundler/index.js +1 -1
  8. package/dist/bundler/rolldown-config.js +1 -1
  9. package/dist/check-mode.js +1 -1
  10. package/dist/dev-ops/operations.d.ts +56 -0
  11. package/dist/dev-ops/operations.js +135 -0
  12. package/dist/env/environment-allowlist.js +1 -1
  13. package/dist/environment/host-match.js +1 -1
  14. package/dist/environment/index.js +1 -1
  15. package/dist/environment/multi-env.js +1 -1
  16. package/dist/environment/scope-resolver.js +1 -1
  17. package/dist/environment/scope-template.js +1 -1
  18. package/dist/environment/types.js +1 -1
  19. package/dist/fanout/materialize.js +3 -3
  20. package/dist/index.d.ts +7 -1
  21. package/dist/index.js +16 -10
  22. package/dist/inputs/build.js +1 -1
  23. package/dist/inputs/coerce.js +1 -1
  24. package/dist/inputs/descriptor.js +1 -1
  25. package/dist/inputs/extract.js +1 -1
  26. package/dist/inputs/index.js +1 -1
  27. package/dist/inputs/schedule.js +1 -1
  28. package/dist/inventory.js +1 -1
  29. package/dist/labels/compile.js +1 -1
  30. package/dist/labels-match.js +1 -1
  31. package/dist/labels.js +2 -2
  32. package/dist/matrix/expand.js +1 -1
  33. package/dist/matrix/format.js +1 -1
  34. package/dist/mcp/fence.d.ts +22 -0
  35. package/dist/mcp/fence.js +65 -0
  36. package/dist/mcp/held-run-resolve.d.ts +52 -0
  37. package/dist/mcp/held-run-resolve.js +53 -0
  38. package/dist/mcp/tool-schemas.d.ts +38 -5
  39. package/dist/mcp/tool-schemas.js +38 -9
  40. package/dist/metrics/catalog-policy.js +1 -1
  41. package/dist/metrics/metric-catalog.generated.d.ts +85 -0
  42. package/dist/metrics/metric-catalog.generated.js +103 -1
  43. package/dist/protocol/analytics-events.js +1 -1
  44. package/dist/protocol/cluster-name.js +1 -1
  45. package/dist/protocol/dashboard-global-workflows.js +1 -1
  46. package/dist/protocol/dashboard-write-operations.d.ts +5 -1
  47. package/dist/protocol/dashboard-write-operations.js +13 -2
  48. package/dist/protocol/event-log-payload.js +1 -1
  49. package/dist/protocol/messages/access-log.d.ts +14 -5
  50. package/dist/protocol/messages/access-log.js +13 -1
  51. package/dist/protocol/messages/actor.d.ts +13 -0
  52. package/dist/protocol/messages/actor.js +25 -5
  53. package/dist/protocol/messages/agent-dev-ops.d.ts +118 -0
  54. package/dist/protocol/messages/agent-dev-ops.js +89 -0
  55. package/dist/protocol/messages/agent-run-result.d.ts +77 -2
  56. package/dist/protocol/messages/agent-run-result.js +44 -2
  57. package/dist/protocol/messages/auth.d.ts +1 -0
  58. package/dist/protocol/messages/auth.js +1 -1
  59. package/dist/protocol/messages/browser.js +1 -1
  60. package/dist/protocol/messages/capabilities.d.ts +1 -0
  61. package/dist/protocol/messages/capabilities.js +1 -1
  62. package/dist/protocol/messages/common.js +1 -1
  63. package/dist/protocol/messages/dashboard-global-workflows.d.ts +6 -0
  64. package/dist/protocol/messages/dashboard-global-workflows.js +1 -1
  65. package/dist/protocol/messages/dashboard.d.ts +634 -18
  66. package/dist/protocol/messages/dashboard.js +111 -12
  67. package/dist/protocol/messages/deployment-identity.js +1 -1
  68. package/dist/protocol/messages/event-log.js +1 -1
  69. package/dist/protocol/messages/execution-status.d.ts +15 -3
  70. package/dist/protocol/messages/execution-status.js +19 -4
  71. package/dist/protocol/messages/join.js +1 -1
  72. package/dist/protocol/messages/log-pull.js +1 -1
  73. package/dist/protocol/messages/oidc-mint.d.ts +51 -0
  74. package/dist/protocol/messages/oidc-mint.js +55 -0
  75. package/dist/protocol/messages/oidc-token-relay.d.ts +31 -4
  76. package/dist/protocol/messages/oidc-token-relay.js +22 -7
  77. package/dist/protocol/messages/orchestrator-agent.d.ts +45 -0
  78. package/dist/protocol/messages/orchestrator-agent.js +30 -2
  79. package/dist/protocol/messages/pat-kind.js +1 -1
  80. package/dist/protocol/messages/peer.js +1 -1
  81. package/dist/protocol/messages/platform-orchestrator.d.ts +292 -10
  82. package/dist/protocol/messages/platform-orchestrator.js +5 -2
  83. package/dist/protocol/messages/run-events.d.ts +3 -0
  84. package/dist/protocol/messages/run-events.js +1 -1
  85. package/dist/protocol/messages/scaler-event.js +1 -1
  86. package/dist/protocol/messages/source-registration.js +1 -1
  87. package/dist/protocol/source-origin.d.ts +20 -0
  88. package/dist/protocol/source-origin.js +21 -0
  89. package/dist/protocol/version.js +1 -1
  90. package/dist/provenance/attestation-origin.d.ts +18 -0
  91. package/dist/provenance/attestation-origin.js +22 -0
  92. package/dist/provenance/bundle.js +1 -1
  93. package/dist/provenance/dsse.js +1 -1
  94. package/dist/provenance/schema.d.ts +48 -0
  95. package/dist/provenance/schema.js +21 -7
  96. package/dist/provenance/statement-hash.d.ts +9 -0
  97. package/dist/provenance/statement-hash.js +17 -0
  98. package/dist/provenance/verify.d.ts +7 -0
  99. package/dist/provenance/verify.js +49 -10
  100. package/dist/provider/changed-files-fetcher.js +1 -1
  101. package/dist/provider/check-run-conclusion.js +1 -1
  102. package/dist/provider/check-status-poster.js +1 -1
  103. package/dist/provider/clone-token-provider.js +1 -1
  104. package/dist/provider/contributor-resolver.js +1 -1
  105. package/dist/provider/index.js +1 -1
  106. package/dist/provider/lock-file-fetcher.js +1 -1
  107. package/dist/provider/lock-file-parse-error.js +1 -1
  108. package/dist/provider/repo-url-builder.js +1 -1
  109. package/dist/provider/types.js +1 -1
  110. package/dist/provider/webhook-normalizer.js +1 -1
  111. package/dist/registration/registerable-trigger-type.d.ts +1 -1
  112. package/dist/registration/registerable-trigger-type.js +1 -1
  113. package/dist/{chunk-BTugEXQM.js → rolldown-runtime-ClRpJifh.js} +0 -1
  114. package/dist/scaler/resource-types.js +1 -1
  115. package/dist/scaler/scaler-backend-type.js +1 -1
  116. package/dist/secrets/index.d.ts +1 -1
  117. package/dist/secrets/index.js +1 -1
  118. package/dist/secrets/types.d.ts +0 -24
  119. package/dist/secrets/types.js +1 -1
  120. package/dist/state-machine/index.js +1 -1
  121. package/dist/state-machine/machine.js +1 -1
  122. package/dist/state-machine/types.js +1 -1
  123. package/dist/trigger/decision-trace.js +1 -1
  124. package/dist/trigger/jsonpath-matcher.js +1 -1
  125. package/dist/trigger/matcher.js +1 -1
  126. package/dist/trigger/trigger-event-type.js +1 -1
  127. package/dist/trigger/types.js +1 -1
  128. package/dist/webhook/signature.js +1 -1
  129. package/dist/webhook/webhook-url-format.d.ts +7 -0
  130. package/dist/webhook/webhook-url-format.js +11 -2
  131. package/dist/ws/close-codes.d.ts +8 -2
  132. package/dist/ws/close-codes.js +10 -4
  133. package/dist/ws/rate-limiter.js +1 -1
  134. package/dist/ws/ws-like.js +1 -1
  135. package/package.json +9 -1
  136. package/sbom.spdx.json +5 -5
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/state-machine/types.ts
3
3
  /**
4
4
  * States from which no further transitions are possible.
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/trigger/decision-trace.ts
3
3
  /**
4
4
  * Create a new trace entry.
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { JSONPath } from "jsonpath-plus";
3
3
  //#region src/trigger/jsonpath-matcher.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { createTraceEntry, createWorkflowDecision } from "./decision-trace.js";
3
3
  import { matchJsonPath, matchJsonPathNot } from "./jsonpath-matcher.js";
4
4
  import picomatch from "picomatch";
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/trigger/trigger-event-type.ts
3
3
  /**
4
4
  * Canonical trigger event types with human-readable metadata.
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { ExecutionJobStatus, TERMINAL_JOB_STATES } from "../protocol/messages/execution-status.js";
3
3
  import { z } from "zod";
4
4
  //#region src/trigger/types.ts
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  //#region src/webhook/signature.ts
4
4
  /**
@@ -6,4 +6,11 @@
6
6
  * pre-flight so the two never drift.
7
7
  */
8
8
  export declare function githubWebhookPath(orgId: string): string;
9
+ /**
10
+ * Route shape for a direct GitHub-App webhook delivered straight to the
11
+ * orchestrator (bypassing the Platform relay). Per-source: the `:sourceId`
12
+ * segment identifies the local GitHub source. Shared by the orchestrator's
13
+ * ingress route handler and its local URL resolver so the two never drift.
14
+ */
15
+ export declare function githubIngressPath(orgId: string, sourceId: string): string;
9
16
  //# sourceMappingURL=webhook-url-format.d.ts.map
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/webhook/webhook-url-format.ts
3
3
  /**
4
4
  * Route shape for a GitHub App webhook. Org-scoped, NOT app-scoped — the app
@@ -10,7 +10,16 @@ import "../chunk-BTugEXQM.js";
10
10
  function githubWebhookPath(orgId) {
11
11
  return `/webhook/${orgId}/github`;
12
12
  }
13
+ /**
14
+ * Route shape for a direct GitHub-App webhook delivered straight to the
15
+ * orchestrator (bypassing the Platform relay). Per-source: the `:sourceId`
16
+ * segment identifies the local GitHub source. Shared by the orchestrator's
17
+ * ingress route handler and its local URL resolver so the two never drift.
18
+ */
19
+ function githubIngressPath(orgId, sourceId) {
20
+ return `/webhook/${orgId}/github/${sourceId}`;
21
+ }
13
22
  //#endregion
14
- export { githubWebhookPath };
23
+ export { githubIngressPath, githubWebhookPath };
15
24
 
16
25
  //# sourceMappingURL=webhook-url-format.js.map
@@ -29,8 +29,14 @@ export declare const WS_CLOSE_PLAN_LIMIT = 4020;
29
29
  * via `kici-admin cluster-name set <name>` before reconnecting.
30
30
  */
31
31
  export declare const WS_CLOSE_CLUSTER_NAME_CONFLICT = 4011;
32
- /** The connection was closed because the requested run was not found. */
33
- export declare const WS_CLOSE_RUN_NOT_FOUND = 4030;
32
+ /**
33
+ * The connection was closed to rebalance load across Platform instances. A
34
+ * newly-joined Platform instance asks peers holding excess connections to shed
35
+ * some; the affected orchestrators reconnect immediately and redistribute
36
+ * evenly. Not an error — the orchestrator treats it as a transient close and
37
+ * reconnects.
38
+ */
39
+ export declare const WS_CLOSE_REBALANCE = 4030;
34
40
  /**
35
41
  * The connection was closed because a job dispatch went unacknowledged past
36
42
  * its deadline. The orchestrator treats the dispatch as lost, requeues the
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/ws/close-codes.ts
3
3
  /**
4
4
  * Unified WebSocket close codes for KiCI connections.
@@ -31,8 +31,14 @@ const WS_CLOSE_PLAN_LIMIT = 4020;
31
31
  * via `kici-admin cluster-name set <name>` before reconnecting.
32
32
  */
33
33
  const WS_CLOSE_CLUSTER_NAME_CONFLICT = 4011;
34
- /** The connection was closed because the requested run was not found. */
35
- const WS_CLOSE_RUN_NOT_FOUND = 4030;
34
+ /**
35
+ * The connection was closed to rebalance load across Platform instances. A
36
+ * newly-joined Platform instance asks peers holding excess connections to shed
37
+ * some; the affected orchestrators reconnect immediately and redistribute
38
+ * evenly. Not an error — the orchestrator treats it as a transient close and
39
+ * reconnects.
40
+ */
41
+ const WS_CLOSE_REBALANCE = 4030;
36
42
  /**
37
43
  * The connection was closed because a job dispatch went unacknowledged past
38
44
  * its deadline. The orchestrator treats the dispatch as lost, requeues the
@@ -41,6 +47,6 @@ const WS_CLOSE_RUN_NOT_FOUND = 4030;
41
47
  */
42
48
  const WS_CLOSE_DISPATCH_ACK_TIMEOUT = 4031;
43
49
  //#endregion
44
- export { WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, WS_CLOSE_DISPATCH_ACK_TIMEOUT, WS_CLOSE_GOING_AWAY, WS_CLOSE_HEARTBEAT_TIMEOUT, WS_CLOSE_INTERNAL_ERROR, WS_CLOSE_INVALID_MESSAGE, WS_CLOSE_PLAN_LIMIT, WS_CLOSE_PROTOCOL_ERROR, WS_CLOSE_RUN_NOT_FOUND, WS_CLOSE_UNAUTHORIZED };
50
+ export { WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, WS_CLOSE_DISPATCH_ACK_TIMEOUT, WS_CLOSE_GOING_AWAY, WS_CLOSE_HEARTBEAT_TIMEOUT, WS_CLOSE_INTERNAL_ERROR, WS_CLOSE_INVALID_MESSAGE, WS_CLOSE_PLAN_LIMIT, WS_CLOSE_PROTOCOL_ERROR, WS_CLOSE_REBALANCE, WS_CLOSE_UNAUTHORIZED };
45
51
 
46
52
  //# sourceMappingURL=close-codes.js.map
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/ws/rate-limiter.ts
3
3
  /**
4
4
  * WebSocket rate limiter with two-tier token bucket (messages + bytes).
@@ -1,2 +1,2 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kici-dev/engine",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Shared business logic for the KiCI CI/CD stack: protocol, triggers, state machine, and provider interfaces used by the Platform relay, orchestrator, and compiler.",
5
5
  "keywords": [
6
6
  "ci",
@@ -81,6 +81,10 @@
81
81
  "import": "./dist/protocol/messages/oidc-token-relay.js",
82
82
  "types": "./dist/protocol/messages/oidc-token-relay.d.ts"
83
83
  },
84
+ "./protocol/messages/oidc-mint": {
85
+ "import": "./dist/protocol/messages/oidc-mint.js",
86
+ "types": "./dist/protocol/messages/oidc-mint.d.ts"
87
+ },
84
88
  "./provenance/schema": {
85
89
  "import": "./dist/provenance/schema.js",
86
90
  "types": "./dist/provenance/schema.d.ts"
@@ -97,6 +101,10 @@
97
101
  "import": "./dist/provenance/verify.js",
98
102
  "types": "./dist/provenance/verify.d.ts"
99
103
  },
104
+ "./provenance/statement-hash": {
105
+ "import": "./dist/provenance/statement-hash.js",
106
+ "types": "./dist/provenance/statement-hash.d.ts"
107
+ },
100
108
  "./metrics/catalog": {
101
109
  "import": "./dist/metrics/metric-catalog.generated.js",
102
110
  "types": "./dist/metrics/metric-catalog.generated.d.ts"
package/sbom.spdx.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "spdxVersion": "SPDX-2.3",
3
3
  "dataLicense": "CC0-1.0",
4
4
  "SPDXID": "SPDXRef-DOCUMENT",
5
- "name": "@kici-dev/engine@0.1.24",
6
- "documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.1.24/915641e1-bf02-4cc8-a165-ac232d710e4f",
5
+ "name": "@kici-dev/engine@0.1.26",
6
+ "documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.1.26/aac1dbb3-c6f9-48b3-8675-85b4ba20c113",
7
7
  "creationInfo": {
8
- "created": "2026-06-28T16:24:19Z",
8
+ "created": "2026-07-06T04:29:39Z",
9
9
  "creators": [
10
10
  "Tool: kici-sbom-generator"
11
11
  ]
@@ -54,7 +54,7 @@
54
54
  {
55
55
  "SPDXID": "SPDXRef-RootPackage",
56
56
  "name": "@kici-dev/engine",
57
- "versionInfo": "0.1.24",
57
+ "versionInfo": "0.1.26",
58
58
  "downloadLocation": "NOASSERTION",
59
59
  "filesAnalyzed": false,
60
60
  "licenseConcluded": "NOASSERTION",
@@ -65,7 +65,7 @@
65
65
  {
66
66
  "referenceCategory": "PACKAGE-MANAGER",
67
67
  "referenceType": "purl",
68
- "referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.24"
68
+ "referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.26"
69
69
  }
70
70
  ],
71
71
  "description": "Shared business logic for the KiCI CI/CD stack: protocol, triggers, state machine, and provider interfaces used by the Platform relay, orchestrator, and compiler.",