@kici-dev/engine 0.1.16 → 0.1.18

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 (104) hide show
  1. package/dist/approval/types.js +1 -1
  2. package/dist/audit/access-log-policy.js +3 -1
  3. package/dist/audit/activity.js +1 -1
  4. package/dist/audit/retention-policy.js +5 -1
  5. package/dist/bundler/index.js +1 -1
  6. package/dist/bundler/rolldown-config.js +1 -1
  7. package/dist/env/environment-allowlist.d.ts +1 -1
  8. package/dist/env/environment-allowlist.js +13 -2
  9. package/dist/environment/index.js +1 -1
  10. package/dist/environment/scope-resolver.js +1 -1
  11. package/dist/environment/types.js +1 -1
  12. package/dist/fanout/materialize.d.ts +123 -0
  13. package/dist/fanout/materialize.js +176 -0
  14. package/dist/index.d.ts +4 -2
  15. package/dist/index.js +9 -7
  16. package/dist/labels/compile.d.ts +40 -0
  17. package/dist/labels/compile.js +91 -0
  18. package/dist/labels-match.d.ts +32 -0
  19. package/dist/labels-match.js +55 -0
  20. package/dist/labels.js +1 -1
  21. package/dist/matrix/expand.d.ts +48 -0
  22. package/dist/matrix/expand.js +72 -0
  23. package/dist/matrix/format.d.ts +10 -0
  24. package/dist/matrix/format.js +20 -0
  25. package/dist/metrics/catalog-policy.js +8 -3
  26. package/dist/metrics/metric-catalog.generated.d.ts +11 -1
  27. package/dist/metrics/metric-catalog.generated.js +14 -2
  28. package/dist/protocol/analytics-events.js +1 -1
  29. package/dist/protocol/cluster-name.js +1 -1
  30. package/dist/protocol/dashboard-global-workflows.js +1 -1
  31. package/dist/protocol/dashboard-write-operations.js +1 -1
  32. package/dist/protocol/event-log-payload.js +1 -1
  33. package/dist/protocol/messages/access-log.d.ts +15 -5
  34. package/dist/protocol/messages/access-log.js +3 -1
  35. package/dist/protocol/messages/actor.js +1 -1
  36. package/dist/protocol/messages/auth.d.ts +1 -0
  37. package/dist/protocol/messages/auth.js +11 -2
  38. package/dist/protocol/messages/browser.js +1 -1
  39. package/dist/protocol/messages/capabilities.js +1 -1
  40. package/dist/protocol/messages/common.js +1 -1
  41. package/dist/protocol/messages/dashboard-global-workflows.js +1 -1
  42. package/dist/protocol/messages/dashboard.d.ts +985 -57
  43. package/dist/protocol/messages/dashboard.js +368 -13
  44. package/dist/protocol/messages/event-log.js +1 -1
  45. package/dist/protocol/messages/execution-status.d.ts +13 -1
  46. package/dist/protocol/messages/execution-status.js +13 -3
  47. package/dist/protocol/messages/join.js +1 -1
  48. package/dist/protocol/messages/log-pull.js +1 -1
  49. package/dist/protocol/messages/observe.d.ts +1 -0
  50. package/dist/protocol/messages/oidc-token-relay.d.ts +31 -0
  51. package/dist/protocol/messages/oidc-token-relay.js +34 -0
  52. package/dist/protocol/messages/orchestrator-agent.d.ts +56 -0
  53. package/dist/protocol/messages/orchestrator-agent.js +47 -2
  54. package/dist/protocol/messages/peer.d.ts +48 -0
  55. package/dist/protocol/messages/peer.js +12 -1
  56. package/dist/protocol/messages/platform-orchestrator.d.ts +171 -4
  57. package/dist/protocol/messages/platform-orchestrator.js +1 -1
  58. package/dist/protocol/messages/run-events.js +1 -1
  59. package/dist/protocol/messages/scaler-event.js +1 -1
  60. package/dist/protocol/messages/source-registration.d.ts +7 -6
  61. package/dist/protocol/messages/source-registration.js +7 -6
  62. package/dist/protocol/version.js +1 -1
  63. package/dist/provenance/bundle.d.ts +54 -0
  64. package/dist/provenance/bundle.js +53 -0
  65. package/dist/provenance/dsse.d.ts +39 -0
  66. package/dist/provenance/dsse.js +53 -0
  67. package/dist/provenance/schema.js +1 -1
  68. package/dist/provenance/verify.d.ts +71 -0
  69. package/dist/provenance/verify.js +135 -0
  70. package/dist/provider/changed-files-fetcher.js +1 -1
  71. package/dist/provider/check-run-conclusion.js +1 -1
  72. package/dist/provider/check-status-poster.js +1 -1
  73. package/dist/provider/clone-token-provider.js +1 -1
  74. package/dist/provider/contributor-resolver.js +1 -1
  75. package/dist/provider/index.js +1 -1
  76. package/dist/provider/lock-file-fetcher.js +1 -1
  77. package/dist/provider/lock-file-parse-error.js +3 -1
  78. package/dist/provider/repo-url-builder.js +1 -1
  79. package/dist/provider/types.d.ts +2 -2
  80. package/dist/provider/types.js +1 -1
  81. package/dist/provider/webhook-normalizer.js +1 -1
  82. package/dist/registration/registerable-trigger-type.js +1 -1
  83. package/dist/scaler/resource-types.js +1 -1
  84. package/dist/scaler/scaler-backend-type.js +1 -1
  85. package/dist/secrets/index.js +1 -1
  86. package/dist/secrets/types.js +1 -1
  87. package/dist/state-machine/index.js +1 -1
  88. package/dist/state-machine/machine.js +1 -1
  89. package/dist/state-machine/types.js +1 -1
  90. package/dist/trigger/decision-trace.js +1 -1
  91. package/dist/trigger/jsonpath-matcher.js +1 -1
  92. package/dist/trigger/matcher.js +1 -1
  93. package/dist/trigger/trigger-event-type.js +1 -1
  94. package/dist/trigger/types.d.ts +76 -3
  95. package/dist/trigger/types.js +33 -5
  96. package/dist/webhook/signature.js +1 -1
  97. package/dist/ws/close-codes.js +1 -1
  98. package/dist/ws/rate-limiter.js +3 -1
  99. package/dist/ws/ws-like.js +1 -1
  100. package/package.json +26 -3
  101. package/sbom.spdx.json +85 -10
  102. package/dist/protocol/messages/observe.js +0 -70
  103. package/dist/protocol/messages/test-run.js +0 -52
  104. /package/dist/{chunk-gOLHoazu.js → chunk-BTugEXQM.js} +0 -0
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { z } from "zod";
3
3
  //#region src/approval/types.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { z } from "zod";
3
3
  //#region src/audit/access-log-policy.ts
4
4
  /**
@@ -58,6 +58,7 @@ const POLICY_BY_ACTION = {
58
58
  kind: "sample",
59
59
  allowedRate: .1
60
60
  },
61
+ "attestations.read": { kind: "always" },
61
62
  "event_log.list.read": {
62
63
  kind: "sample",
63
64
  allowedRate: .05
@@ -114,6 +115,7 @@ const POLICY_BY_ACTION = {
114
115
  "run.cancel": { kind: "always" },
115
116
  "run.rerun": { kind: "always" },
116
117
  "run.manual_schedule": { kind: "always" },
118
+ "run.trigger": { kind: "always" },
117
119
  "job.cancel": { kind: "always" },
118
120
  "event_log.detail.read": { kind: "always" },
119
121
  "event_log.payload.read": { kind: "always" },
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { ActorType } from "../protocol/messages/actor.js";
3
3
  import { AccessLogOutcome } from "../protocol/messages/access-log.js";
4
4
  import { z } from "zod";
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/audit/retention-policy.ts
3
3
  /**
4
4
  * Warm-retention days per `AccessLogAction`. Exhaustive over the enum so a
@@ -18,6 +18,7 @@ const ACCESS_LOG_WARM_DAYS = {
18
18
  "sources.list.read": 30,
19
19
  "run.orch_logs.read": 30,
20
20
  "step.logs.read": 30,
21
+ "attestations.read": 30,
21
22
  "event_log.list.read": 30,
22
23
  "environment.list.read": 30,
23
24
  "environment.get.read": 30,
@@ -41,6 +42,7 @@ const ACCESS_LOG_WARM_DAYS = {
41
42
  "run.cancel": 180,
42
43
  "run.rerun": 180,
43
44
  "run.manual_schedule": 180,
45
+ "run.trigger": 180,
44
46
  "job.cancel": 180,
45
47
  "environment.create": 180,
46
48
  "environment.update": 180,
@@ -254,6 +256,7 @@ const ACCESS_LOG_COLD_DAYS = {
254
256
  "sources.list.read": 180,
255
257
  "run.orch_logs.read": 180,
256
258
  "step.logs.read": 180,
259
+ "attestations.read": 180,
257
260
  "event_log.list.read": 180,
258
261
  "environment.list.read": 180,
259
262
  "environment.get.read": 180,
@@ -277,6 +280,7 @@ const ACCESS_LOG_COLD_DAYS = {
277
280
  "run.cancel": 730,
278
281
  "run.rerun": 730,
279
282
  "run.manual_schedule": 730,
283
+ "run.trigger": 730,
280
284
  "job.cancel": 730,
281
285
  "environment.create": 730,
282
286
  "environment.update": 730,
@@ -1,3 +1,3 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { createWorkflowBundleConfig } from "./rolldown-config.js";
3
3
  export { createWorkflowBundleConfig };
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/bundler/rolldown-config.ts
3
3
  /**
4
4
  * Create a rolldown configuration for workflow bundling.
@@ -15,7 +15,7 @@
15
15
  * This is an explicit allowlist -- anything NOT listed here is stripped.
16
16
  * Adding new variables to the host process will NOT leak them downstream.
17
17
  */
18
- export declare const ALLOWED_SYSTEM_VARS: readonly ["PATH", "HOME", "USER", "SHELL", "LANG", "LC_ALL", "TERM", "TMPDIR", "NODE_PATH", "TZ"];
18
+ export declare const ALLOWED_SYSTEM_VARS: readonly ["PATH", "HOME", "USER", "SHELL", "LANG", "LC_ALL", "TERM", "TMPDIR", "NODE_PATH", "TZ", "PATHEXT", "SystemRoot", "windir", "COMSPEC", "TEMP", "TMP", "USERPROFILE", "LOCALAPPDATA", "APPDATA", "PROCESSOR_ARCHITECTURE", "NUMBER_OF_PROCESSORS"];
19
19
  /**
20
20
  * Default environment variables injected into every sandbox execution.
21
21
  *
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/env/environment-allowlist.ts
3
3
  /**
4
4
  * Shared environment allowlist constants for KiCI.
@@ -27,7 +27,18 @@ const ALLOWED_SYSTEM_VARS = [
27
27
  "TERM",
28
28
  "TMPDIR",
29
29
  "NODE_PATH",
30
- "TZ"
30
+ "TZ",
31
+ "PATHEXT",
32
+ "SystemRoot",
33
+ "windir",
34
+ "COMSPEC",
35
+ "TEMP",
36
+ "TMP",
37
+ "USERPROFILE",
38
+ "LOCALAPPDATA",
39
+ "APPDATA",
40
+ "PROCESSOR_ARCHITECTURE",
41
+ "NUMBER_OF_PROCESSORS"
31
42
  ];
32
43
  /**
33
44
  * Default environment variables injected into every sandbox execution.
@@ -1,3 +1,3 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { matchScopePattern, resolveSecretsForEnvironment, stripScopePrefix } from "./scope-resolver.js";
3
3
  export { matchScopePattern, resolveSecretsForEnvironment, stripScopePrefix };
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import picomatch from "picomatch";
3
3
  //#region src/environment/scope-resolver.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  export {};
@@ -0,0 +1,123 @@
1
+ import { type MatrixValues } from '../matrix/expand.js';
2
+ import type { LockJob } from '../trigger/types.js';
3
+ /** Hard cap on children per fanned job — mirrors the compiler's MAX_STATIC_MATRIX_JOBS. */
4
+ export declare const MAX_FANOUT_JOBS = 256;
5
+ /**
6
+ * The kind of fan-out a materialized child belongs to. `matrix` children come
7
+ * from a matrix expansion (one per combination); `host` children come from a
8
+ * `runsOnAll` fan-out (one pinned execution per roster host).
9
+ */
10
+ export declare enum VariantKind {
11
+ matrix = "matrix",
12
+ host = "host"
13
+ }
14
+ /**
15
+ * Thrown when a job's matrix cannot be materialized into dispatchable children:
16
+ * zero combinations after exclude, or more combinations than {@link MAX_FANOUT_JOBS}.
17
+ * Callers map this onto the `matrix_expansion` init-failure category.
18
+ */
19
+ export declare class FanoutError extends Error {
20
+ readonly jobName: string;
21
+ readonly name = "FanoutError";
22
+ constructor(jobName: string, message: string);
23
+ }
24
+ /**
25
+ * A roster host resolved as a target of a `runsOnAll` fan-out. Carries the
26
+ * identity the dispatcher pins to and the agent facts exposed as `ctx.agent`.
27
+ */
28
+ export interface ResolvedHostAgent {
29
+ /** Agent id the child pins to. */
30
+ agentId: string;
31
+ /** Hostname (falls back to agentId). */
32
+ host: string;
33
+ /** The host's label set. */
34
+ labels: readonly string[];
35
+ platform?: string;
36
+ arch?: string;
37
+ /** Which orchestrator owns the live WS (null = not currently connected). */
38
+ connectedInstanceId?: string | null;
39
+ }
40
+ /**
41
+ * One dispatchable unit produced from a lock job. `variantKind` is `matrix` for
42
+ * a matrix combination child and `host` for a `runsOnAll` per-host child; absent
43
+ * for a non-fanned job.
44
+ */
45
+ export interface MaterializedJob {
46
+ /** The originating lock job. Its matrix/include/exclude are NOT dispatched as-is. */
47
+ lockJob: LockJob;
48
+ /** The lock job's name (the consumer-facing job identity). */
49
+ baseName: string;
50
+ /** `${baseName} (${suffix})` for fanned children, else `baseName`. */
51
+ expandedName: string;
52
+ /** Present only for fanned children. */
53
+ variantKind?: VariantKind;
54
+ /** The combination values for a matrix child; absent for non-matrix jobs. */
55
+ variantValues?: MatrixValues;
56
+ /**
57
+ * True when the job carries a dynamic matrix the orchestrator cannot expand —
58
+ * it must route through the agent-eval flow and be re-materialized from the result.
59
+ */
60
+ pendingDynamicMatrix?: boolean;
61
+ /** The agent this child is pinned to. */
62
+ pinnedAgentId?: string;
63
+ /** The host this child runs on (also the variant label / name suffix). */
64
+ host?: string;
65
+ /** The resolved host agent facts, exposed to the step as `ctx.agent`. */
66
+ agent?: ResolvedHostAgent;
67
+ /** Which orchestrator owns the pinned agent's live WS (null = not connected). */
68
+ connectedInstanceId?: string | null;
69
+ }
70
+ export interface FanoutResult {
71
+ jobs: MaterializedJob[];
72
+ /** baseName → expandedNames (length 1 for non-fanned jobs). Drives needs-edge expansion. */
73
+ expansionMap: Map<string, string[]>;
74
+ }
75
+ /**
76
+ * The job-config envelope fields that identify a materialized child: the
77
+ * expanded `name`, the `baseJobName` (what the agent exposes as `ctx.job.name`),
78
+ * and `matrixValues` (exposed as `ctx.matrix`). Every dispatch site spreads
79
+ * these into its job config so the envelopes stay identical. The raw
80
+ * matrix/include/exclude are intentionally NOT included — they are consumed at
81
+ * dispatch time, not shipped to the agent.
82
+ */
83
+ export declare function matrixEnvelopeFields(mat: MaterializedJob): {
84
+ name: string;
85
+ baseJobName: string;
86
+ matrixValues?: MatrixValues;
87
+ };
88
+ /**
89
+ * Build materialized children from a resolved dynamic-matrix combination list
90
+ * (produced by the agent eval flow). Mirrors the static-matrix branch of
91
+ * {@link materializeFanout} but takes the already-resolved combinations and
92
+ * enforces the same cap / zero-combination guards.
93
+ */
94
+ export declare function materializeResolvedMatrix(lockJob: LockJob, combos: readonly MatrixValues[]): FanoutResult;
95
+ /**
96
+ * The job-config envelope fields that identify a materialized host child: the
97
+ * expanded `name`, the `baseJobName`, the `pinnedAgentId`, the `host` (exposed as
98
+ * `ctx.host` and persisted as `variant_label`), and the resolved `agent` facts
99
+ * (exposed as `ctx.agent`). The matrix sibling is {@link matrixEnvelopeFields}.
100
+ */
101
+ export declare function hostEnvelopeFields(mat: MaterializedJob): {
102
+ name: string;
103
+ baseJobName: string;
104
+ pinnedAgentId?: string;
105
+ host?: string;
106
+ agent?: ResolvedHostAgent;
107
+ connectedInstanceId?: string | null;
108
+ };
109
+ /**
110
+ * Build materialized host children from a resolved target-host list (produced by
111
+ * the roster-backed resolution branch at dispatch time). Emits one pinned child
112
+ * per host, sibling to {@link materializeResolvedMatrix}. `maxHosts` is the
113
+ * orchestrator `maxFanoutHosts` config (default 1024) — NOT {@link MAX_FANOUT_JOBS}
114
+ * (the 256 matrix cap is GitHub-Actions author-error parity, irrelevant to fleet size).
115
+ */
116
+ export declare function materializeResolvedHosts(lockJob: LockJob, agents: readonly ResolvedHostAgent[], maxHosts: number): FanoutResult;
117
+ /**
118
+ * Expand each lock job's static matrix into N dispatchable children (one per
119
+ * combination), passing non-matrix and dynamic-matrix jobs through 1:1.
120
+ * Dynamic-matrix jobs are flagged `pendingDynamicMatrix` for the eval flow.
121
+ */
122
+ export declare function materializeFanout(staticJobs: readonly LockJob[]): FanoutResult;
123
+ //# sourceMappingURL=materialize.d.ts.map
@@ -0,0 +1,176 @@
1
+ import "../chunk-BTugEXQM.js";
2
+ import { applyIncludeExclude, expandMatrix } from "../matrix/expand.js";
3
+ import { formatExpandedJobName } from "../matrix/format.js";
4
+ //#region src/fanout/materialize.ts
5
+ /** Hard cap on children per fanned job — mirrors the compiler's MAX_STATIC_MATRIX_JOBS. */
6
+ const MAX_FANOUT_JOBS = 256;
7
+ /**
8
+ * The kind of fan-out a materialized child belongs to. `matrix` children come
9
+ * from a matrix expansion (one per combination); `host` children come from a
10
+ * `runsOnAll` fan-out (one pinned execution per roster host).
11
+ */
12
+ let VariantKind = /* @__PURE__ */ function(VariantKind) {
13
+ VariantKind["matrix"] = "matrix";
14
+ VariantKind["host"] = "host";
15
+ return VariantKind;
16
+ }({});
17
+ /**
18
+ * Thrown when a job's matrix cannot be materialized into dispatchable children:
19
+ * zero combinations after exclude, or more combinations than {@link MAX_FANOUT_JOBS}.
20
+ * Callers map this onto the `matrix_expansion` init-failure category.
21
+ */
22
+ var FanoutError = class FanoutError extends Error {
23
+ jobName;
24
+ name = "FanoutError";
25
+ constructor(jobName, message) {
26
+ super(message);
27
+ this.jobName = jobName;
28
+ Object.setPrototypeOf(this, FanoutError.prototype);
29
+ }
30
+ };
31
+ /**
32
+ * The job-config envelope fields that identify a materialized child: the
33
+ * expanded `name`, the `baseJobName` (what the agent exposes as `ctx.job.name`),
34
+ * and `matrixValues` (exposed as `ctx.matrix`). Every dispatch site spreads
35
+ * these into its job config so the envelopes stay identical. The raw
36
+ * matrix/include/exclude are intentionally NOT included — they are consumed at
37
+ * dispatch time, not shipped to the agent.
38
+ */
39
+ function matrixEnvelopeFields(mat) {
40
+ return {
41
+ name: mat.expandedName,
42
+ baseJobName: mat.baseName,
43
+ ...mat.variantValues && { matrixValues: mat.variantValues }
44
+ };
45
+ }
46
+ /**
47
+ * Build materialized children from a resolved dynamic-matrix combination list
48
+ * (produced by the agent eval flow). Mirrors the static-matrix branch of
49
+ * {@link materializeFanout} but takes the already-resolved combinations and
50
+ * enforces the same cap / zero-combination guards.
51
+ */
52
+ function materializeResolvedMatrix(lockJob, combos) {
53
+ if (combos.length === 0) throw new FanoutError(lockJob.name, `dynamic matrix for job '${lockJob.name}' resolved to zero combinations`);
54
+ if (combos.length > 256) throw new FanoutError(lockJob.name, `dynamic matrix for job '${lockJob.name}' resolved to ${combos.length} combinations (max 256)`);
55
+ const jobs = [];
56
+ const names = [];
57
+ for (const variantValues of combos) {
58
+ const expandedName = formatExpandedJobName(lockJob.name, variantValues);
59
+ names.push(expandedName);
60
+ jobs.push({
61
+ lockJob,
62
+ baseName: lockJob.name,
63
+ expandedName,
64
+ variantKind: "matrix",
65
+ variantValues
66
+ });
67
+ }
68
+ return {
69
+ jobs,
70
+ expansionMap: new Map([[lockJob.name, names]])
71
+ };
72
+ }
73
+ /**
74
+ * The job-config envelope fields that identify a materialized host child: the
75
+ * expanded `name`, the `baseJobName`, the `pinnedAgentId`, the `host` (exposed as
76
+ * `ctx.host` and persisted as `variant_label`), and the resolved `agent` facts
77
+ * (exposed as `ctx.agent`). The matrix sibling is {@link matrixEnvelopeFields}.
78
+ */
79
+ function hostEnvelopeFields(mat) {
80
+ return {
81
+ name: mat.expandedName,
82
+ baseJobName: mat.baseName,
83
+ ...mat.pinnedAgentId && { pinnedAgentId: mat.pinnedAgentId },
84
+ ...mat.host && { host: mat.host },
85
+ ...mat.agent && { agent: mat.agent },
86
+ ...mat.connectedInstanceId !== void 0 && { connectedInstanceId: mat.connectedInstanceId }
87
+ };
88
+ }
89
+ /**
90
+ * Build materialized host children from a resolved target-host list (produced by
91
+ * the roster-backed resolution branch at dispatch time). Emits one pinned child
92
+ * per host, sibling to {@link materializeResolvedMatrix}. `maxHosts` is the
93
+ * orchestrator `maxFanoutHosts` config (default 1024) — NOT {@link MAX_FANOUT_JOBS}
94
+ * (the 256 matrix cap is GitHub-Actions author-error parity, irrelevant to fleet size).
95
+ */
96
+ function materializeResolvedHosts(lockJob, agents, maxHosts) {
97
+ if (agents.length === 0) throw new FanoutError(lockJob.name, `runsOnAll for job '${lockJob.name}' matched zero matching hosts`);
98
+ if (agents.length > maxHosts) throw new FanoutError(lockJob.name, `runsOnAll for job '${lockJob.name}' matched ${agents.length} hosts (max ${maxHosts})`);
99
+ const jobs = [];
100
+ const names = [];
101
+ for (const agent of agents) {
102
+ const expandedName = `${lockJob.name} (${agent.host})`;
103
+ names.push(expandedName);
104
+ jobs.push({
105
+ lockJob,
106
+ baseName: lockJob.name,
107
+ expandedName,
108
+ variantKind: "host",
109
+ pinnedAgentId: agent.agentId,
110
+ host: agent.host,
111
+ agent,
112
+ connectedInstanceId: agent.connectedInstanceId ?? null
113
+ });
114
+ }
115
+ return {
116
+ jobs,
117
+ expansionMap: new Map([[lockJob.name, names]])
118
+ };
119
+ }
120
+ /**
121
+ * Expand each lock job's static matrix into N dispatchable children (one per
122
+ * combination), passing non-matrix and dynamic-matrix jobs through 1:1.
123
+ * Dynamic-matrix jobs are flagged `pendingDynamicMatrix` for the eval flow.
124
+ */
125
+ function materializeFanout(staticJobs) {
126
+ const jobs = [];
127
+ const expansionMap = /* @__PURE__ */ new Map();
128
+ for (const lockJob of staticJobs) {
129
+ const matrix = lockJob.matrix;
130
+ if (!matrix) {
131
+ jobs.push({
132
+ lockJob,
133
+ baseName: lockJob.name,
134
+ expandedName: lockJob.name
135
+ });
136
+ expansionMap.set(lockJob.name, [lockJob.name]);
137
+ continue;
138
+ }
139
+ if (matrix._type === "dynamic") {
140
+ jobs.push({
141
+ lockJob,
142
+ baseName: lockJob.name,
143
+ expandedName: lockJob.name,
144
+ pendingDynamicMatrix: true
145
+ });
146
+ expansionMap.set(lockJob.name, [lockJob.name]);
147
+ continue;
148
+ }
149
+ const values = matrix.values;
150
+ if (!values) throw new FanoutError(lockJob.name, `static matrix for job '${lockJob.name}' has no values`);
151
+ const combos = applyIncludeExclude(expandMatrix(values), lockJob.include, lockJob.exclude);
152
+ if (combos.length === 0) throw new FanoutError(lockJob.name, `matrix for job '${lockJob.name}' expands to zero combinations`);
153
+ if (combos.length > 256) throw new FanoutError(lockJob.name, `matrix for job '${lockJob.name}' expands to ${combos.length} combinations (max 256)`);
154
+ const names = [];
155
+ for (const variantValues of combos) {
156
+ const expandedName = formatExpandedJobName(lockJob.name, variantValues);
157
+ names.push(expandedName);
158
+ jobs.push({
159
+ lockJob,
160
+ baseName: lockJob.name,
161
+ expandedName,
162
+ variantKind: "matrix",
163
+ variantValues
164
+ });
165
+ }
166
+ expansionMap.set(lockJob.name, names);
167
+ }
168
+ return {
169
+ jobs,
170
+ expansionMap
171
+ };
172
+ }
173
+ //#endregion
174
+ export { FanoutError, MAX_FANOUT_JOBS, VariantKind, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields };
175
+
176
+ //# sourceMappingURL=materialize.js.map
package/dist/index.d.ts CHANGED
@@ -31,8 +31,6 @@ export { sourceRegistrationSchema, sourceRegistrationAckSchema, sourceDeregister
31
31
  export * from './protocol/messages/join.js';
32
32
  export * from './protocol/messages/peer.js';
33
33
  export * from './protocol/messages/orchestrator-agent.js';
34
- export * from './protocol/messages/test-run.js';
35
- export * from './protocol/messages/observe.js';
36
34
  export * from './trigger/types.js';
37
35
  export * from './trigger/trigger-event-type.js';
38
36
  export * from './trigger/decision-trace.js';
@@ -49,8 +47,12 @@ export * from './environment/index.js';
49
47
  export { deriveOsArchLabels, hostLabel, parseHostLabel, HOST_LABEL_PREFIX, agentTypeLabel, scalerLabel, mergeAutoLabels, normalizeRunsOn, KNOWN_ROLES, resolveRoleLabels, validateNoReservedLabels, scalerAgentLabels, isSelfReportedLabel, SELF_REPORTED_LABEL_PREFIXES, } from './labels.js';
50
48
  export type { NormalizedRunsOn } from './labels.js';
51
49
  export type { AgentRole } from './labels.js';
50
+ export { LabelMatcher, matcherMatches, matcherSatisfiedBy, partitionMatchers, compileRegexMatcher, } from './labels-match.js';
52
51
  export * from './scaler/scaler-backend-type.js';
53
52
  export * from './scaler/resource-types.js';
54
53
  export * from './registration/registerable-trigger-type.js';
55
54
  export * from './bundler/index.js';
55
+ export { expandSingleDimension, expandMultiDimension, expandMatrix, applyIncludeExclude, type StaticMatrixArray, type StaticMatrixObject, type MatrixInclude, type MatrixExclude, type MatrixValues, } from './matrix/expand.js';
56
+ export { formatMatrixSuffix, formatExpandedJobName } from './matrix/format.js';
57
+ export * from './fanout/materialize.js';
56
58
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  import { MIN_PROTOCOL_VERSION, PROTOCOL_VERSION } from "./protocol/version.js";
3
3
  import { WS_MAX_PAYLOAD_BYTES, ackSchema, errorSchema, heartbeatSchema, nackSchema } from "./protocol/messages/common.js";
4
4
  import { ActorType, actorPrincipalSchema, apiKeyActorSchema, flattenActor, parseActor, platformOperatorActorSchema, serviceAccountActorSchema, stringifyActor, systemActorSchema, userActorSchema } from "./protocol/messages/actor.js";
@@ -11,7 +11,8 @@ import { browserJobContextSchema, browserRunEventSchema, dashboardOrchLogsReques
11
11
  import { EventLogSource, EventLogStatus, PayloadOmittedReason } from "./protocol/messages/event-log.js";
12
12
  import { ScalerBackendType } from "./scaler/scaler-backend-type.js";
13
13
  import { ApprovalDecision, HoldScope, TriggerSource, approvalRequirementSchema, approverClauseSchema } from "./approval/types.js";
14
- import { EnvDeleteErrorCode, EventLogPayloadStreamError, HeldRunQueueType, HeldRunStatus, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, identityLinkItemSchema, identityLinkListResponseSchema, manualScheduleRequestSchema, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, orgMemberSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, runCancelRequestSchema, runEventSchema, runLineageResponseSchema, runRerunRequestSchema, trustPolicyResponseSchema } from "./protocol/messages/dashboard.js";
14
+ import { IfFailedPolicy, NeedsEntrySchema, NeedsGroupEntrySchema, OnUnreachableMode, SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob } from "./trigger/types.js";
15
+ import { EnvDeleteErrorCode, EventLogPayloadStreamError, HeldRunQueueType, HeldRunStatus, TestRelayType, attestationListItemSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, identityLinkItemSchema, identityLinkListResponseSchema, manualScheduleRequestSchema, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, orgMemberSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, runCancelRequestSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, trustPolicyResponseSchema } from "./protocol/messages/dashboard.js";
15
16
  import { WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WebhookRelayResult, cacheStatsSchema, executionEventSchema, logChunkSchema, orchMetricsSchema, orchestratorToPlatformMessageSchema, peerDiscoverSchema, peerUpdateSchema, platformToOrchestratorMessageSchema, staleCheckrunCleanupSchema, trustPolicyUpdateSchema, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema } from "./protocol/messages/platform-orchestrator.js";
16
17
  import { ScalerEventType } from "./protocol/messages/scaler-event.js";
17
18
  import { AccessLogPolicyKind, POLICY_BY_ACTION, fnv1a32, shouldRecordAccess, shouldRecordSecretResolve } from "./audit/access-log-policy.js";
@@ -21,11 +22,9 @@ import { logPullOrchToPlatformSchema, logPullPlatformToOrchSchema } from "./prot
21
22
  import { EVENT_LOG_PAYLOAD_CHUNK_BYTES } from "./protocol/event-log-payload.js";
22
23
  import { browserAuthFailureSchema, browserAuthRefreshSchema, browserAuthRequestSchema, browserAuthSuccessSchema, browserErrorSchema, browserEventLogPayloadFetchSchema, browserGapSchema, browserJobNewSchema, browserJobStatusSchema, browserLogLinesSchema, browserLogStreamTerminatedReason, browserLogStreamTerminatedSchema, browserLogSubscribeSchema, browserLogUnsubscribeSchema, browserPingSchema, browserPongSchema, browserRunNewSchema, browserRunStatusSchema, browserStatusSubscribeSchema, browserStatusUnsubscribeSchema, browserStepStatusSchema, browserToPlatformMessageSchema, platformToBrowserMessageSchema } from "./protocol/messages/browser.js";
23
24
  import { joinRequestSchema, joinResponseSchema } from "./protocol/messages/join.js";
25
+ import { LabelMatcher, compileRegexMatcher, matcherMatches, matcherSatisfiedBy, partitionMatchers } from "./labels-match.js";
24
26
  import { fleetSelectionSchema, jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema } from "./protocol/messages/peer.js";
25
- import { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, registerAckSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema } from "./protocol/messages/orchestrator-agent.js";
26
- import { testCancelResponseSchema, testCancelSchema, testEventSchema, testTriggerResponseSchema, testTriggerSchema } from "./protocol/messages/test-run.js";
27
- import { observeCompleteSchema, observeLogSchema, observeStatusSchema, observeStepSchema, observeSubscribeSchema } from "./protocol/messages/observe.js";
28
- import { NeedsEntrySchema, NeedsGroupEntrySchema, SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob } from "./trigger/types.js";
27
+ import { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, registerAckSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, upstreamSnapshotSchema } from "./protocol/messages/orchestrator-agent.js";
29
28
  import { TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES } from "./trigger/trigger-event-type.js";
30
29
  import { createTraceEntry, createWorkflowDecision } from "./trigger/decision-trace.js";
31
30
  import { matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchWorkflowTriggers } from "./trigger/matcher.js";
@@ -45,4 +44,7 @@ import { parseMemoryString, resourceRequestNestedSchema, resourceSpecSchema, val
45
44
  import { RegisterableTriggerType } from "./registration/registerable-trigger-type.js";
46
45
  import { createWorkflowBundleConfig } from "./bundler/rolldown-config.js";
47
46
  import "./bundler/index.js";
48
- export { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, AccessLogAction, AccessLogOutcome, AccessLogPolicyKind, AccessLogSource, AccessLogTargetType, ActivityFilterSource, ActivityRowSource, ActorType, ApprovalDecision, CacheOutcome, CacheRefScope, CacheRunEventType, CacheStepType, CheckRunConclusion, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EnvDeleteErrorCode, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, HOST_LABEL_PREFIX, HeldRunQueueType, HeldRunStatus, HoldScope, InitFailureCategory, JobRejectReason, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, LockFileParseError, MIN_PROTOCOL_VERSION, NeedsEntrySchema, NeedsGroupEntrySchema, ORCH_CAPABILITIES, OrchRole, POLICY_BY_ACTION, PROTOCOL_VERSION, PayloadOmittedReason, RegisterableTriggerType, SANDBOX_DEFAULT_VARS, SCHEMA_VERSION, SELF_REPORTED_LABEL_PREFIXES, ScalerBackendType, ScalerEventType, SourceProvider, SourceSubtype, StepApprovalOutcome, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES, TimeoutReason, TriggerSource, WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, 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, WS_MAX_PAYLOAD_BYTES, WebhookRelayResult, WsRateLimiter, accessLogFilterSchema, accessLogItemSchema, accessLogWarmSqlCase, ackSchema, activityCursorSchema, activityFilterSchema, activityRowSchema, actorPrincipalSchema, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, agentTypeLabel, apiKeyActorSchema, approvalRequirementSchema, approverClauseSchema, auditLogColdDays, auditLogWarmDays, auditLogWarmSqlCase, authFailureSchema, authRequestSchema, authSuccessSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserAuthFailureSchema, browserAuthRefreshSchema, browserAuthRequestSchema, browserAuthSuccessSchema, browserErrorSchema, browserEventLogPayloadChunkSchema, browserEventLogPayloadFetchSchema, browserGapSchema, browserJobContextSchema, browserJobNewSchema, browserJobStatusSchema, browserLogLinesSchema, browserLogStreamTerminatedReason, browserLogStreamTerminatedSchema, browserLogSubscribeSchema, browserLogUnsubscribeSchema, browserPingSchema, browserPongSchema, browserRunEventSchema, browserRunNewSchema, browserRunStatusSchema, browserStatusSubscribeSchema, browserStatusUnsubscribeSchema, browserStepStatusSchema, browserToPlatformMessageSchema, cacheStatsSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, createTraceEntry, createWorkflowBundleConfig, createWorkflowDecision, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, decodeActivityCursor, deriveOsArchLabels, encodeActivityCursor, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, errorSchema, eventEmitResponseSchema, eventEmitSchema, eventLogListItemSchema, executionEventSchema, executionStatusSchema, flattenActor, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, fleetSelectionSchema, fnv1a32, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, gitAuthSchema, hasOrchCapability, heartbeatSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, hostLabel, identityLinkItemSchema, identityLinkListResponseSchema, initFailureSchema, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, isSelfReportedLabel, isTerminal, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobContextMessageSchema, jobDispatchSchema, jobProgressSchema, jobRejectSchema, jobRerouteAckSchema, jobRerouteSchema, jobStatusForwardSchema, jobStatusSchema, joinRequestSchema, joinResponseSchema, logChunkSchema, logPullOrchToPlatformSchema, logPullPlatformToOrchSchema, manualScheduleRequestSchema, matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchScopePattern, matchWorkflowTriggers, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, mergeAutoLabels, minAccessLogWarmDays, minAuditLogWarmDays, minSecretAuditLogWarmDays, nackSchema, normalizeRunsOn, observeCompleteSchema, observeLogSchema, observeStatusSchema, observeStepSchema, observeSubscribeSchema, orchCapabilitiesSchema, orchMetricsSchema, orchestratorToAgentMessageSchema, orchestratorToPlatformMessageSchema, orgMemberSchema, parseActor, parseHostLabel, parseMemoryString, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerDiscoverSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, peerUpdateSchema, platformOperatorActorSchema, platformToBrowserMessageSchema, platformToOrchestratorMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, registerAckSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, resolveRoleLabels, resolveRunIdSugar, resolveSecretsForEnvironment, resourceRequestNestedSchema, resourceSpecSchema, runCancelRequestSchema, runEventMessageSchema, runEventSchema, runLineageResponseSchema, runRerunRequestSchema, scalerAgentLabels, scalerLabel, secretAuditLogColdDays, secretAuditLogWarmDays, secretAuditLogWarmSqlCase, serviceAccountActorSchema, shouldRecordAccess, shouldRecordSecretResolve, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema, staleCheckrunCleanupSchema, stateReplaySchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, stepStatusForwardSchema, stringifyActor, stripScopePrefix, systemActorSchema, testCancelResponseSchema, testCancelSchema, testEventSchema, testTriggerResponseSchema, testTriggerSchema, transition, trustPolicyResponseSchema, trustPolicyUpdateSchema, userActorSchema, validateNoReservedLabels, validateResourceRequest, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
47
+ import { applyIncludeExclude, expandMatrix, expandMultiDimension, expandSingleDimension } from "./matrix/expand.js";
48
+ import { formatExpandedJobName, formatMatrixSuffix } from "./matrix/format.js";
49
+ import { FanoutError, MAX_FANOUT_JOBS, VariantKind, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields } from "./fanout/materialize.js";
50
+ export { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, AccessLogAction, AccessLogOutcome, AccessLogPolicyKind, AccessLogSource, AccessLogTargetType, ActivityFilterSource, ActivityRowSource, ActorType, ApprovalDecision, CacheOutcome, CacheRefScope, CacheRunEventType, CacheStepType, CheckRunConclusion, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EnvDeleteErrorCode, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, FanoutError, HOST_LABEL_PREFIX, HeldRunQueueType, HeldRunStatus, HoldScope, IfFailedPolicy, InitFailureCategory, JobRejectReason, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, LabelMatcher, LockFileParseError, MAX_FANOUT_JOBS, MIN_PROTOCOL_VERSION, NeedsEntrySchema, NeedsGroupEntrySchema, ORCH_CAPABILITIES, OnUnreachableMode, OrchRole, POLICY_BY_ACTION, PROTOCOL_VERSION, PayloadOmittedReason, RegisterableTriggerType, SANDBOX_DEFAULT_VARS, SCHEMA_VERSION, SELF_REPORTED_LABEL_PREFIXES, ScalerBackendType, ScalerEventType, SourceProvider, SourceSubtype, StepApprovalOutcome, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES, TestRelayType, TimeoutReason, TriggerSource, VariantKind, WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, 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, WS_MAX_PAYLOAD_BYTES, WebhookRelayResult, WsRateLimiter, accessLogFilterSchema, accessLogItemSchema, accessLogWarmSqlCase, ackSchema, activityCursorSchema, activityFilterSchema, activityRowSchema, actorPrincipalSchema, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, agentTypeLabel, apiKeyActorSchema, applyIncludeExclude, approvalRequirementSchema, approverClauseSchema, attestationListItemSchema, auditLogColdDays, auditLogWarmDays, auditLogWarmSqlCase, authFailureSchema, authRequestSchema, authSuccessSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserAuthFailureSchema, browserAuthRefreshSchema, browserAuthRequestSchema, browserAuthSuccessSchema, browserErrorSchema, browserEventLogPayloadChunkSchema, browserEventLogPayloadFetchSchema, browserGapSchema, browserJobContextSchema, browserJobNewSchema, browserJobStatusSchema, browserLogLinesSchema, browserLogStreamTerminatedReason, browserLogStreamTerminatedSchema, browserLogSubscribeSchema, browserLogUnsubscribeSchema, browserPingSchema, browserPongSchema, browserRunEventSchema, browserRunNewSchema, browserRunStatusSchema, browserStatusSubscribeSchema, browserStatusUnsubscribeSchema, browserStepStatusSchema, browserToPlatformMessageSchema, cacheStatsSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, compileRegexMatcher, configAckSchema, createTraceEntry, createWorkflowBundleConfig, createWorkflowDecision, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, decodeActivityCursor, deriveOsArchLabels, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, encodeActivityCursor, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, errorSchema, eventEmitResponseSchema, eventEmitSchema, eventLogListItemSchema, executionEventSchema, executionStatusSchema, expandMatrix, expandMultiDimension, expandSingleDimension, flattenActor, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, fleetSelectionSchema, fnv1a32, formatExpandedJobName, formatMatrixSuffix, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, gitAuthSchema, hasOrchCapability, heartbeatSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, hostEnvelopeFields, hostLabel, identityLinkItemSchema, identityLinkListResponseSchema, initFailureSchema, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, isSelfReportedLabel, isTerminal, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobContextMessageSchema, jobDispatchSchema, jobProgressSchema, jobRejectSchema, jobRerouteAckSchema, jobRerouteSchema, jobStatusForwardSchema, jobStatusSchema, joinRequestSchema, joinResponseSchema, logChunkSchema, logPullOrchToPlatformSchema, logPullPlatformToOrchSchema, manualScheduleRequestSchema, matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchScopePattern, matchWorkflowTriggers, matcherMatches, matcherSatisfiedBy, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, mergeAutoLabels, minAccessLogWarmDays, minAuditLogWarmDays, minSecretAuditLogWarmDays, nackSchema, normalizeRunsOn, orchCapabilitiesSchema, orchMetricsSchema, orchestratorToAgentMessageSchema, orchestratorToPlatformMessageSchema, orgMemberSchema, parseActor, parseHostLabel, parseMemoryString, partitionMatchers, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerDiscoverSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, peerUpdateSchema, platformOperatorActorSchema, platformToBrowserMessageSchema, platformToOrchestratorMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, registerAckSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, resolveRoleLabels, resolveRunIdSugar, resolveSecretsForEnvironment, resourceRequestNestedSchema, resourceSpecSchema, runCancelRequestSchema, runEventMessageSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, scalerAgentLabels, scalerLabel, secretAuditLogColdDays, secretAuditLogWarmDays, secretAuditLogWarmSqlCase, serviceAccountActorSchema, shouldRecordAccess, shouldRecordSecretResolve, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema, staleCheckrunCleanupSchema, stateReplaySchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, stepStatusForwardSchema, stringifyActor, stripScopePrefix, systemActorSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, transition, trustPolicyResponseSchema, trustPolicyUpdateSchema, upstreamSnapshotSchema, userActorSchema, validateNoReservedLabels, validateResourceRequest, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
@@ -0,0 +1,40 @@
1
+ import type { LabelMatcher } from '../labels-match.js';
2
+ /**
3
+ * Reject a ReDoS-prone regex. `safe-regex` is a star-height heuristic — the
4
+ * orchestrator is single-tenant, so a slipped-through pattern only stalls the
5
+ * author's own orchestrator. Globs are linear by construction but pass through
6
+ * here for uniformity.
7
+ */
8
+ export declare function assertSafeRegex(source: string, flags: string, ctx: string): void;
9
+ /**
10
+ * Convert one author selector element into a `LabelMatcher`.
11
+ * - `RegExp` → regex matcher (source + flags captured verbatim).
12
+ * - string that picomatch detects as a glob → regex via `picomatch.makeRe`.
13
+ * - any other string → exact.
14
+ * `ctx` is a human label (e.g. "job 'web' runsOn") used in ReDoS errors.
15
+ */
16
+ export declare function toLabelMatcher(el: string | RegExp, ctx: string): LabelMatcher;
17
+ export type SelectorEl = string | RegExp;
18
+ export type RunsOnAuthorInput = SelectorEl | readonly SelectorEl[] | {
19
+ labels: SelectorEl | readonly SelectorEl[];
20
+ exclude?: SelectorEl | readonly SelectorEl[];
21
+ };
22
+ export type RunsOnAllAuthorInput = string | RegExp | readonly SelectorEl[] | {
23
+ include: readonly {
24
+ all: readonly SelectorEl[];
25
+ }[];
26
+ exclude?: readonly SelectorEl[];
27
+ };
28
+ /** Normalize a `runsOn` author value into include + exclude matchers. */
29
+ export declare function normalizeRunsOnToMatchers(runsOn: RunsOnAuthorInput, ctx: string): {
30
+ include: LabelMatcher[];
31
+ exclude: LabelMatcher[];
32
+ };
33
+ /** Normalize a `runsOnAll` author value into include groups + exclude matchers. */
34
+ export declare function normalizeRunsOnAllToMatchers(input: RunsOnAllAuthorInput, ctx: string): {
35
+ include: LabelMatcher[][];
36
+ exclude: LabelMatcher[];
37
+ };
38
+ /** Re-validate every regex matcher in a parsed lock selector (orchestrator lock-load). */
39
+ export declare function assertMatchersSafe(matchers: readonly LabelMatcher[], ctx: string): void;
40
+ //# sourceMappingURL=compile.d.ts.map