@kici-dev/sdk 0.1.16 → 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 (67) hide show
  1. package/dist/api-types.d.ts +25 -1
  2. package/dist/api-types.js +29 -3
  3. package/dist/approval.js +1 -1
  4. package/dist/cache-types.js +1 -1
  5. package/dist/context.d.ts +31 -2
  6. package/dist/context.js +10 -2
  7. package/dist/dynamic-group.js +1 -1
  8. package/dist/errors.js +3 -1
  9. package/dist/events/define-event.js +1 -1
  10. package/dist/events/event-payloads.js +1 -1
  11. package/dist/events/event-payloads.test-d.js +1 -1
  12. package/dist/events/index.js +1 -1
  13. package/dist/events/types.js +1 -1
  14. package/dist/fixture.js +1 -1
  15. package/dist/hooks/index.js +1 -1
  16. package/dist/hooks/types.js +1 -1
  17. package/dist/idempotent.js +1 -1
  18. package/dist/index.d.ts +5 -2
  19. package/dist/index.js +4 -2
  20. package/dist/job.js +13 -6
  21. package/dist/matrix/expand.d.ts +1 -24
  22. package/dist/matrix/expand.js +2 -65
  23. package/dist/matrix/index.js +1 -1
  24. package/dist/matrix/types.d.ts +2 -19
  25. package/dist/matrix/types.js +1 -1
  26. package/dist/outputs.js +1 -1
  27. package/dist/provenance-types.d.ts +38 -0
  28. package/dist/provenance-types.js +10 -0
  29. package/dist/rules/evaluator.js +1 -1
  30. package/dist/rules/index.js +1 -1
  31. package/dist/rules/rule.js +1 -1
  32. package/dist/rules/types.js +1 -1
  33. package/dist/secrets.js +1 -1
  34. package/dist/step.js +1 -1
  35. package/dist/triggers/comment.js +1 -1
  36. package/dist/triggers/create.js +1 -1
  37. package/dist/triggers/delete.js +1 -1
  38. package/dist/triggers/dispatch.js +1 -1
  39. package/dist/triggers/fork.js +1 -1
  40. package/dist/triggers/generic-webhook.js +1 -1
  41. package/dist/triggers/index.js +1 -1
  42. package/dist/triggers/job-complete.js +1 -1
  43. package/dist/triggers/kici-event.js +1 -1
  44. package/dist/triggers/lifecycle.js +1 -1
  45. package/dist/triggers/pr.js +1 -1
  46. package/dist/triggers/push.js +1 -1
  47. package/dist/triggers/release.js +1 -1
  48. package/dist/triggers/review-comment.js +1 -1
  49. package/dist/triggers/review.js +1 -1
  50. package/dist/triggers/schedule.js +1 -1
  51. package/dist/triggers/star.js +1 -1
  52. package/dist/triggers/status.js +1 -1
  53. package/dist/triggers/tag.js +1 -1
  54. package/dist/triggers/types.js +1 -1
  55. package/dist/triggers/watch.js +1 -1
  56. package/dist/triggers/webhook.js +1 -1
  57. package/dist/triggers/workflow-complete.js +1 -1
  58. package/dist/triggers/workflow-run.js +1 -1
  59. package/dist/types.d.ts +56 -15
  60. package/dist/types.js +1 -1
  61. package/dist/validation/dag.js +1 -1
  62. package/dist/validation/index.js +1 -1
  63. package/dist/wait-for.js +1 -1
  64. package/dist/workflow.js +1 -1
  65. package/package.json +3 -4
  66. package/sbom.spdx.json +52 -27
  67. /package/dist/{chunk-gOLHoazu.js → chunk-BTugEXQM.js} +0 -0
@@ -8,6 +8,8 @@
8
8
  * 1. Add the typed method here (with param + return types)
9
9
  * 2. Register the handler in the orchestrator's AgentApiRegistry
10
10
  */
11
+ import { type OidcTokenResult } from '@kici-dev/engine/protocol/messages/oidc-token-relay';
12
+ export type { OidcTokenResult };
11
13
  export interface InfrastructureListResult {
12
14
  scalers: Array<{
13
15
  name: string;
@@ -28,9 +30,23 @@ export interface InfrastructureApi {
28
30
  /** List available scalers and connected agents. */
29
31
  list(): Promise<InfrastructureListResult>;
30
32
  }
33
+ export interface OidcApi {
34
+ /**
35
+ * Request a short-lived OIDC ID token for the current job, bound to
36
+ * `audience`. The token's identity claims (repository, ref, sha, run/job id)
37
+ * are derived server-side from the build context and cannot be spoofed by the
38
+ * workflow. The token is automatically masked in step logs. Only available
39
+ * inside a running job step (throws otherwise).
40
+ */
41
+ token(opts: {
42
+ audience: string;
43
+ }): Promise<OidcTokenResult>;
44
+ }
31
45
  export interface KiciApi {
32
46
  /** Query orchestrator infrastructure (scalers, agents). */
33
47
  infrastructure: InfrastructureApi;
48
+ /** Request short-lived OIDC ID tokens for the current job (build provenance). */
49
+ oidc: OidcApi;
34
50
  }
35
51
  /**
36
52
  * Low-level transport function used to implement KiciApi.
@@ -42,6 +58,14 @@ export type KiciApiTransport = (method: string, params?: Record<string, unknown>
42
58
  *
43
59
  * This is the bridge between the typed SDK interface and the untyped WS/IPC
44
60
  * transport. Each method call is mapped to { method: 'namespace.method', params }.
61
+ *
62
+ * `jobCtx` carries the per-job execution context (the job the step is running
63
+ * in). It is supplied by the agent's sandbox step context so `oidc.token()` can
64
+ * bind its request to that job; the workflow author never supplies it. It is
65
+ * omitted for contexts with no running job (e.g. DynamicJobFn re-evaluation),
66
+ * where `oidc.token()` throws rather than silently misattributing a token.
45
67
  */
46
- export declare function buildKiciApi(transport: KiciApiTransport): KiciApi;
68
+ export declare function buildKiciApi(transport: KiciApiTransport, jobCtx?: {
69
+ jobId: string;
70
+ }): KiciApi;
47
71
  //# sourceMappingURL=api-types.d.ts.map
package/dist/api-types.js CHANGED
@@ -1,13 +1,39 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
+ import { OIDC_TOKEN_REQUEST_METHOD } from "@kici-dev/engine/protocol/messages/oidc-token-relay";
2
3
  //#region src/api-types.ts
3
4
  /**
5
+ * Typed KiCI API available to workflows via ctx.kici.
6
+ *
7
+ * Each namespace groups related methods. Under the hood, calls are serialized
8
+ * to { method: 'namespace.method', params } and sent over the agent's WS
9
+ * connection to the orchestrator. Adding a new API method:
10
+ *
11
+ * 1. Add the typed method here (with param + return types)
12
+ * 2. Register the handler in the orchestrator's AgentApiRegistry
13
+ */
14
+ /**
4
15
  * Build a typed KiciApi proxy from a raw transport function.
5
16
  *
6
17
  * This is the bridge between the typed SDK interface and the untyped WS/IPC
7
18
  * transport. Each method call is mapped to { method: 'namespace.method', params }.
19
+ *
20
+ * `jobCtx` carries the per-job execution context (the job the step is running
21
+ * in). It is supplied by the agent's sandbox step context so `oidc.token()` can
22
+ * bind its request to that job; the workflow author never supplies it. It is
23
+ * omitted for contexts with no running job (e.g. DynamicJobFn re-evaluation),
24
+ * where `oidc.token()` throws rather than silently misattributing a token.
8
25
  */
9
- function buildKiciApi(transport) {
10
- return { infrastructure: { list: () => transport("infrastructure.list", {}) } };
26
+ function buildKiciApi(transport, jobCtx) {
27
+ return {
28
+ infrastructure: { list: () => transport("infrastructure.list", {}) },
29
+ oidc: { token: (opts) => {
30
+ if (!jobCtx) return Promise.reject(/* @__PURE__ */ new Error("ctx.kici.oidc.token() is only available inside a running job step"));
31
+ return transport(OIDC_TOKEN_REQUEST_METHOD, {
32
+ jobId: jobCtx.jobId,
33
+ audience: opts.audience
34
+ });
35
+ } }
36
+ };
11
37
  }
12
38
  //#endregion
13
39
  export { buildKiciApi };
package/dist/approval.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  //#region src/approval.ts
3
3
  /** Normalize any `RequireApproval` form into `{ clauses, reason?, timeoutSeconds? }`. */
4
4
  function normalizeRequireApproval(r) {
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  import { z } from "zod";
3
3
  //#region src/cache-types.ts
4
4
  /** Zod schema validating a CacheSpec at compile/serialize time. */
package/dist/context.d.ts CHANGED
@@ -19,6 +19,19 @@ export interface JobInfo {
19
19
  name: string;
20
20
  runsOn: string;
21
21
  }
22
+ /**
23
+ * Outputs of a matrix job as seen by a downstream `needs:` consumer.
24
+ * A downstream that consumes a matrix upstream receives this envelope instead of
25
+ * a flat outputs object, identically under `kici run local` and the remote path.
26
+ */
27
+ export interface MatrixJobOutputs<T = Record<string, unknown>> {
28
+ /** Keyed by the combination suffix (the text inside `(...)` of the child name). */
29
+ byMatrix: Record<string, T>;
30
+ /** Last-write-wins flat merge across children, in child (name) order. */
31
+ merged: T;
32
+ }
33
+ /** Runtime discriminator: true when `ctx.jobOutputs(ref)` returned a matrix envelope. */
34
+ export declare function isMatrixJobOutputs(value: Record<string, unknown> | MatrixJobOutputs): value is MatrixJobOutputs;
22
35
  /**
23
36
  * Augmentable interface for known secret keys.
24
37
  * When augmented via `kici types` (.d.ts generation), narrows get/expose key parameter.
@@ -158,14 +171,22 @@ export interface StepContext<TInputs = Record<string, unknown>> {
158
171
  } | ((...args: any[]) => any)): T;
159
172
  /**
160
173
  * Resolve outputs from a preceding job by reference.
161
- * Returns the job's collected outputs (step-keyed for multi-step, flat for run shorthand).
174
+ *
175
+ * For a plain upstream this returns the job's collected outputs (step-keyed
176
+ * for multi-step, flat for run shorthand). For a **matrix** upstream it returns
177
+ * a {@link MatrixJobOutputs} envelope `{ byMatrix, merged }` keyed by the
178
+ * combination suffix — identical under `kici run local` and the remote path.
179
+ * Use {@link isMatrixJobOutputs} (or `'byMatrix' in result`) to discriminate.
162
180
  *
163
181
  * @example
164
182
  * const setupOutputs = ctx.jobOutputs(setupJob);
183
+ * @example
184
+ * const m = ctx.jobOutputs(buildMatrixJob);
185
+ * if (isMatrixJobOutputs(m)) console.log(m.byMatrix['linux, arm64']);
165
186
  */
166
187
  jobOutputs(ref: {
167
188
  name: string;
168
- }): Record<string, unknown>;
189
+ }): Record<string, unknown> | MatrixJobOutputs;
169
190
  /**
170
191
  * Publish a secret output value from this job.
171
192
  * Secret outputs are encrypted before leaving the agent and can be consumed
@@ -188,6 +209,14 @@ export interface StepContext<TInputs = Record<string, unknown>> {
188
209
  * under `spec.key` (immutable — first save wins). Scoped per org + ref.
189
210
  */
190
211
  cache: import('./cache-types.js').CacheApi;
212
+ /**
213
+ * Build, sign, and persist a KiCI build-provenance attestation for a produced
214
+ * artifact. The in-toto statement's identity is derived from a Platform-minted
215
+ * identity token (unforgeable); the bundle is signed with an ephemeral key and
216
+ * is offline-verifiable. Pass the artifact via a precomputed digest or a path
217
+ * the agent digests with SHA-256.
218
+ */
219
+ attestProvenance(opts: import('./provenance-types.js').AttestProvenanceOptions): Promise<import('./provenance-types.js').AttestProvenanceResult>;
191
220
  }
192
221
  export {};
193
222
  //# sourceMappingURL=context.d.ts.map
package/dist/context.js CHANGED
@@ -1,2 +1,10 @@
1
- import "./chunk-gOLHoazu.js";
2
- export {};
1
+ import "./chunk-BTugEXQM.js";
2
+ //#region src/context.ts
3
+ /** Runtime discriminator: true when `ctx.jobOutputs(ref)` returned a matrix envelope. */
4
+ function isMatrixJobOutputs(value) {
5
+ return typeof value === "object" && value !== null && "byMatrix" in value && "merged" in value && typeof value.byMatrix === "object";
6
+ }
7
+ //#endregion
8
+ export { isMatrixJobOutputs };
9
+
10
+ //# sourceMappingURL=context.js.map
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  //#region src/dynamic-group.ts
3
3
  /**
4
4
  * Dynamic group helpers for cross-domain needs.
package/dist/errors.js CHANGED
@@ -1,9 +1,11 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  //#region src/errors.ts
3
3
  /**
4
4
  * Thrown when accessing a secret key that does not exist in the flat secrets proxy.
5
5
  */
6
6
  var SecretNotFoundError = class extends Error {
7
+ key;
8
+ availableKeys;
7
9
  constructor(key, availableKeys) {
8
10
  super(`Secret "${key}" not found. Available keys: ${availableKeys.join(", ") || "(none)"}. Use ctx.secrets.has('${key}') to check existence, or await ctx.secrets.get('${key}') in a try/catch.`);
9
11
  this.key = key;
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/events/define-event.ts
3
3
  /**
4
4
  * Create a typed event definition with a Zod schema.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/events/event-payloads.ts
3
3
  /**
4
4
  * Narrow an EventPayload to a specific event type.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { describe, expectTypeOf, it } from "vitest";
3
3
  //#region src/events/event-payloads.test-d.ts
4
4
  describe("EventPayload narrowing", () => {
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { isEventType } from "./event-payloads.js";
3
3
  import { defineEvent } from "./define-event.js";
4
4
  export { defineEvent, isEventType };
@@ -1,2 +1,2 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  export {};
package/dist/fixture.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  //#region src/fixture.ts
3
3
  /**
4
4
  * Create a test fixture definition.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/hooks/index.ts
3
3
  /**
4
4
  * Normalize HookInput to extract run function and optional timeout.
@@ -1,2 +1,2 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  export {};
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  import { step } from "./step.js";
3
3
  import { runIdempotentStep } from "@kici-dev/core/idempotency";
4
4
  //#region src/idempotent.ts
package/dist/index.d.ts CHANGED
@@ -13,15 +13,18 @@ export { isEventType } from './rules/index.js';
13
13
  export type { Rule, RuleContext, RuleCheckFn, RuleResult, EventPayload, RuleEvaluationResult, EventBase, PullRequestEventPayload, PushEventPayload, TagEventPayload, CommentEventPayload, ReviewEventPayload, ReviewCommentEventPayload, ReleaseEventPayload, DispatchEventPayload, CreateEventPayload, DeleteEventPayload, StatusEventPayload, WorkflowRunEventPayload, ForkEventPayload, StarEventPayload, WatchEventPayload, WebhookEventPayload, KiciEventPayload, WorkflowCompleteEventPayload, JobCompleteEventPayload, GenericWebhookEventPayload, ScheduleEventPayload, LifecycleEventPayload, GitHubRepository, GitHubUser, GitHubPullRequest, GitHubCommit, GitHubComment, GitHubReview, GitHubRelease, } from './rules/index.js';
14
14
  export { validateDag } from './validation/index.js';
15
15
  export type { DagNode, DagValidationResult } from './validation/index.js';
16
- export type { SourceLocation, OutputProxy, Step, StepOptions, StepRunFn, BareStepFn, StepInput, OutputSchema, InferOutputs, Job, JobOptions, GenericInitConfig, ContainerConfig, RunsOnSelector, RunsOn, Workflow, WorkflowOptions, Registry, Trigger, DynamicJobFn, DynamicJobContext, JobOrFactory, } from './types.js';
16
+ export type { SourceLocation, OutputProxy, Step, StepOptions, StepRunFn, BareStepFn, StepInput, OutputSchema, InferOutputs, Job, JobOptions, GenericInitConfig, MiseInitConfig, InitPreset, InitItem, InitConfig, ContainerConfig, RunsOnSelector, RunsOn, Workflow, WorkflowOptions, Registry, Trigger, DynamicJobFn, DynamicJobContext, JobOrFactory, } from './types.js';
17
17
  export { isDynamicJobFn, dynamicJob, getDynamicJobGroup, DYNAMIC_JOB_GROUP_TAG } from './types.js';
18
18
  export type { TaggedDynamicJobFn } from './types.js';
19
19
  export { CacheSpecSchema, normalizeCacheSpecs } from './cache-types.js';
20
20
  export type { CacheSpec, CacheInput } from './cache-types.js';
21
21
  export type { CacheRestoreResult, CacheApi } from './cache-types.js';
22
+ export { provenanceSubjectIsPath } from './provenance-types.js';
23
+ export type { AttestProvenanceOptions, AttestProvenanceResult, ProvenanceSubjectInput, } from './provenance-types.js';
22
24
  export { dynamicGroup, isDynamicGroupRef, DYNAMIC_GROUP_TAG } from './dynamic-group.js';
23
25
  export type { DynamicGroupRef } from './dynamic-group.js';
24
- export type { StepContext, Logger, WorkflowInfo, JobInfo, RepoInfo, StepSecretsTyped, KnownSecretKeys, } from './context.js';
26
+ export type { StepContext, Logger, WorkflowInfo, JobInfo, MatrixJobOutputs, RepoInfo, StepSecretsTyped, KnownSecretKeys, } from './context.js';
27
+ export { isMatrixJobOutputs } from './context.js';
25
28
  export { buildKiciApi } from './api-types.js';
26
29
  export type { KiciApi, KiciApiTransport, InfrastructureApi, InfrastructureListResult, } from './api-types.js';
27
30
  export { SecretNotFoundError } from './errors.js';
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  import { buildKiciApi } from "./api-types.js";
3
3
  import { normalizeRequireApproval } from "./approval.js";
4
4
  import { CacheSpecSchema, normalizeCacheSpecs } from "./cache-types.js";
5
+ import { isMatrixJobOutputs } from "./context.js";
5
6
  import { DYNAMIC_GROUP_TAG, dynamicGroup, isDynamicGroupRef } from "./dynamic-group.js";
6
7
  import { SecretNotFoundError } from "./errors.js";
7
8
  import { fixture } from "./fixture.js";
@@ -41,6 +42,7 @@ import "./rules/index.js";
41
42
  import { validateDag } from "./validation/dag.js";
42
43
  import "./validation/index.js";
43
44
  import { DYNAMIC_JOB_GROUP_TAG, dynamicJob, getDynamicJobGroup, isDynamicJobFn } from "./types.js";
45
+ import { provenanceSubjectIsPath } from "./provenance-types.js";
44
46
  import { createStepSecrets } from "./secrets.js";
45
47
  import { isDynamicFunction, isStaticArray, isStaticObject } from "./matrix/types.js";
46
48
  import { applyIncludeExclude, expandMatrix } from "./matrix/expand.js";
@@ -49,4 +51,4 @@ import { defineEvent } from "./events/define-event.js";
49
51
  import "./events/index.js";
50
52
  import { WaitForTimeoutError, waitFor, waitForStep } from "./wait-for.js";
51
53
  import { z } from "zod";
52
- export { CacheSpecSchema, DYNAMIC_GROUP_TAG, DYNAMIC_JOB_GROUP_TAG, SecretNotFoundError, WaitForTimeoutError, afterStep, applyIncludeExclude, beforeStep, buildKiciApi, cleanup, comment, create, createJobOutputProxy, createStepOutputProxy, createStepSecrets, defineEvent, del as delete, dispatch, dynamicGroup, dynamicJob, evaluateRules, expandMatrix, fixture, fork, genericWebhook, getDynamicJobGroup, getJobOutputsMap, getStepOutputsMap, getStepRefMap, idempotent, idempotentStep, isDynamicFunction, isDynamicGroupRef, isDynamicJobFn, isEventType, isStaticArray, isStaticObject, job, jobComplete, kiciEvent, lifecycle, normalizeCacheSpecs, normalizeRequireApproval, onCancel, onFailure, onSuccess, pr, push, release, resolveJobOutputs, resolveStepOutputs, review, reviewComment, rule, schedule, setJobOutputsMap, setStepOutputsMap, setStepRefMap, skip, star, status, step, tag, validateDag, waitFor, waitForStep, watch, webhook, workflow, workflowComplete, workflowRun, z };
54
+ export { CacheSpecSchema, DYNAMIC_GROUP_TAG, DYNAMIC_JOB_GROUP_TAG, SecretNotFoundError, WaitForTimeoutError, afterStep, applyIncludeExclude, beforeStep, buildKiciApi, cleanup, comment, create, createJobOutputProxy, createStepOutputProxy, createStepSecrets, defineEvent, del as delete, dispatch, dynamicGroup, dynamicJob, evaluateRules, expandMatrix, fixture, fork, genericWebhook, getDynamicJobGroup, getJobOutputsMap, getStepOutputsMap, getStepRefMap, idempotent, idempotentStep, isDynamicFunction, isDynamicGroupRef, isDynamicJobFn, isEventType, isMatrixJobOutputs, isStaticArray, isStaticObject, job, jobComplete, kiciEvent, lifecycle, normalizeCacheSpecs, normalizeRequireApproval, onCancel, onFailure, onSuccess, pr, provenanceSubjectIsPath, push, release, resolveJobOutputs, resolveStepOutputs, review, reviewComment, rule, schedule, setJobOutputsMap, setStepOutputsMap, setStepRefMap, skip, star, status, step, tag, validateDag, waitFor, waitForStep, watch, webhook, workflow, workflowComplete, workflowRun, z };
package/dist/job.js CHANGED
@@ -1,15 +1,22 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  import { createJobOutputProxy } from "./outputs.js";
3
3
  import { randomUUID } from "node:crypto";
4
4
  //#region src/job.ts
5
+ /** A typed preset is a `'mise'` string or a `{ mise }` object — neither carries `run`. */
6
+ function isPreset(item) {
7
+ return item === "mise" || typeof item === "object" && item !== null && "mise" in item;
8
+ }
5
9
  /**
6
- * Validate a job's `init` config. `undefined` / `false` are no-ops; every
7
- * remaining spec (one, or each element of an array) must carry a non-empty
8
- * `run` command. Throws with the offending index when validation fails.
10
+ * Validate a job's `init` config. `undefined` / `false` / `'auto'` are no-ops;
11
+ * typed presets (`'mise'` / `{ mise }`) carry no `run`, so they need no check.
12
+ * Every remaining generic spec (one, or each element of an array) must carry a
13
+ * non-empty `run` command. Throws with the offending index when validation fails.
9
14
  */
10
15
  function validateInit(init, jobName) {
11
- if (init === void 0 || init === false) return;
12
- (Array.isArray(init) ? init : [init]).forEach((spec, i) => {
16
+ if (init === void 0 || init === false || init === "auto") return;
17
+ (Array.isArray(init) ? init : [init]).forEach((item, i) => {
18
+ if (isPreset(item)) return;
19
+ const spec = item;
13
20
  if (typeof spec.run !== "string" || spec.run.trim().length === 0) throw new Error(`job('${jobName}'): init[${i}].run must be a non-empty command`);
14
21
  });
15
22
  }
@@ -1,25 +1,2 @@
1
- import type { StaticMatrixArray, StaticMatrixObject, MatrixInclude, MatrixExclude, MatrixValues } from './types.js';
2
- /**
3
- * Expand single-dimension matrix (array form) to MatrixValues array.
4
- * Each value becomes {value: string}.
5
- */
6
- export declare function expandSingleDimension(matrix: StaticMatrixArray): MatrixValues[];
7
- /**
8
- * Expand multi-dimensional matrix (object form) to MatrixValues array.
9
- * Uses fast-cartesian to compute cartesian product of all dimensions.
10
- * Dimension names are sorted for deterministic output.
11
- */
12
- export declare function expandMultiDimension(matrix: StaticMatrixObject): MatrixValues[];
13
- /**
14
- * Unified expand function that dispatches to single or multi-dimensional expansion.
15
- */
16
- export declare function expandMatrix(matrix: StaticMatrixArray | StaticMatrixObject): MatrixValues[];
17
- /**
18
- * Apply include/exclude modifications to expanded matrix combinations.
19
- * Per CONTEXT.md: exclude first (remove matching), then include (add new).
20
- *
21
- * Exclude matches if ALL specified dimensions match.
22
- * Include adds new combinations if they don't already exist.
23
- */
24
- export declare function applyIncludeExclude(expanded: MatrixValues[], include?: MatrixInclude[], exclude?: MatrixExclude[]): MatrixValues[];
1
+ export { expandSingleDimension, expandMultiDimension, expandMatrix, applyIncludeExclude, } from '@kici-dev/engine';
25
2
  //# sourceMappingURL=expand.d.ts.map
@@ -1,66 +1,3 @@
1
- import "../chunk-gOLHoazu.js";
2
- import fastCartesian from "fast-cartesian";
3
- //#region src/matrix/expand.ts
4
- /**
5
- * Expand single-dimension matrix (array form) to MatrixValues array.
6
- * Each value becomes {value: string}.
7
- */
8
- function expandSingleDimension(matrix) {
9
- return matrix.map((value) => ({ value }));
10
- }
11
- /**
12
- * Expand multi-dimensional matrix (object form) to MatrixValues array.
13
- * Uses fast-cartesian to compute cartesian product of all dimensions.
14
- * Dimension names are sorted for deterministic output.
15
- */
16
- function expandMultiDimension(matrix) {
17
- const dimensions = Object.entries(matrix);
18
- if (dimensions.length === 0) return [];
19
- dimensions.sort((a, b) => a[0].localeCompare(b[0]));
20
- const names = dimensions.map(([name]) => name);
21
- return fastCartesian(dimensions.map(([, values]) => values)).map((combo) => {
22
- const result = {};
23
- names.forEach((name, idx) => {
24
- result[name] = combo[idx];
25
- });
26
- return result;
27
- });
28
- }
29
- /**
30
- * Unified expand function that dispatches to single or multi-dimensional expansion.
31
- */
32
- function expandMatrix(matrix) {
33
- if (Array.isArray(matrix)) return expandSingleDimension(matrix);
34
- return expandMultiDimension(matrix);
35
- }
36
- /**
37
- * Apply include/exclude modifications to expanded matrix combinations.
38
- * Per CONTEXT.md: exclude first (remove matching), then include (add new).
39
- *
40
- * Exclude matches if ALL specified dimensions match.
41
- * Include adds new combinations if they don't already exist.
42
- */
43
- function applyIncludeExclude(expanded, include, exclude) {
44
- let result = [...expanded];
45
- if (exclude && exclude.length > 0) result = result.filter((combo) => {
46
- return !exclude.some((excl) => {
47
- const exclEntries = Object.entries(excl);
48
- if (exclEntries.length === 0) return false;
49
- return exclEntries.every(([key, value]) => combo[key] === value);
50
- });
51
- });
52
- if (include && include.length > 0) for (const incl of include) {
53
- const inclKeys = Object.keys(incl);
54
- if (inclKeys.length === 0) continue;
55
- if (!result.some((combo) => {
56
- const comboKeys = Object.keys(combo);
57
- if (inclKeys.length !== comboKeys.length) return false;
58
- return inclKeys.every((key) => combo[key] === incl[key]);
59
- })) result.push(incl);
60
- }
61
- return result;
62
- }
63
- //#endregion
1
+ import "../chunk-BTugEXQM.js";
2
+ import { applyIncludeExclude, expandMatrix, expandMultiDimension, expandSingleDimension } from "@kici-dev/engine";
64
3
  export { applyIncludeExclude, expandMatrix, expandMultiDimension, expandSingleDimension };
65
-
66
- //# sourceMappingURL=expand.js.map
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { isDynamicFunction, isStaticArray, isStaticObject } from "./types.js";
3
3
  import { applyIncludeExclude, expandMatrix } from "./expand.js";
4
4
  export { applyIncludeExclude, expandMatrix, isDynamicFunction, isStaticArray, isStaticObject };
@@ -1,9 +1,7 @@
1
1
  import type { $ as Shell } from 'zx';
2
2
  import type { Logger } from '../context.js';
3
- /** Single-dimension static matrix: array of values */
4
- export type StaticMatrixArray = string[];
5
- /** Multi-dimensional static matrix: named dimensions with values */
6
- export type StaticMatrixObject = Record<string, string[]>;
3
+ export type { StaticMatrixArray, StaticMatrixObject, MatrixInclude, MatrixExclude, MatrixValues, } from '@kici-dev/engine';
4
+ import type { StaticMatrixArray, StaticMatrixObject } from '@kici-dev/engine';
7
5
  /**
8
6
  * Context passed to dynamic matrix functions.
9
7
  * Uses destructured form: async ({$, ctx, log, env}) => values
@@ -36,21 +34,6 @@ export interface DynamicMatrixContext {
36
34
  export type DynamicMatrixFn = (context: DynamicMatrixContext) => Promise<StaticMatrixArray | StaticMatrixObject>;
37
35
  /** Union type for all matrix forms */
38
36
  export type Matrix = StaticMatrixArray | StaticMatrixObject | DynamicMatrixFn;
39
- /** Include entries for adding specific matrix combinations */
40
- export type MatrixInclude = Record<string, string>;
41
- /** Exclude entries for removing specific matrix combinations */
42
- export type MatrixExclude = Record<string, string>;
43
- /**
44
- * Matrix values as exposed to steps.
45
- * Single-dimension: {value: 'linux'}
46
- * Multi-dimensional: {os: 'linux', node: '18'}
47
- */
48
- export interface MatrixValues {
49
- /** Single-dimension: the value */
50
- value?: string;
51
- /** Multi-dimensional: named properties */
52
- [dimension: string]: string | undefined;
53
- }
54
37
  /** Type guard for static array matrices */
55
38
  export declare function isStaticArray(m: Matrix): m is StaticMatrixArray;
56
39
  /** Type guard for static object matrices */
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/matrix/types.ts
3
3
  /** Type guard for static array matrices */
4
4
  function isStaticArray(m) {
package/dist/outputs.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  //#region src/outputs.ts
3
3
  /**
4
4
  * Well-known string property names that should delegate to Reflect rather than throwing.
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Types for `ctx.attestProvenance()` — the imperative step helper that builds,
3
+ * signs, and persists a KiCI build-provenance attestation for a produced
4
+ * artifact.
5
+ */
6
+ /**
7
+ * The artifact being attested. Either supply a precomputed digest, or a path
8
+ * (relative to the step working directory) the agent will digest with SHA-256.
9
+ */
10
+ export type ProvenanceSubjectInput = {
11
+ name: string;
12
+ digest: {
13
+ sha256?: string;
14
+ sha512?: string;
15
+ };
16
+ } | {
17
+ name: string;
18
+ path: string;
19
+ };
20
+ export interface AttestProvenanceOptions {
21
+ subject: ProvenanceSubjectInput;
22
+ /** OIDC audience for the identity token (defaults to 'kici-provenance'). */
23
+ audience?: string;
24
+ }
25
+ export interface AttestProvenanceResult {
26
+ /** Object-storage key the signed bundle was written to. */
27
+ storageKey: string;
28
+ /** Primary subject digest (lowercase hex). */
29
+ subjectDigest: string;
30
+ /** Media type of the persisted bundle. */
31
+ bundleMediaType: string;
32
+ }
33
+ /** Discriminate a path subject from a precomputed-digest subject. */
34
+ export declare function provenanceSubjectIsPath(s: ProvenanceSubjectInput): s is {
35
+ name: string;
36
+ path: string;
37
+ };
38
+ //# sourceMappingURL=provenance-types.d.ts.map
@@ -0,0 +1,10 @@
1
+ import "./chunk-BTugEXQM.js";
2
+ //#region src/provenance-types.ts
3
+ /** Discriminate a path subject from a precomputed-digest subject. */
4
+ function provenanceSubjectIsPath(s) {
5
+ return "path" in s;
6
+ }
7
+ //#endregion
8
+ export { provenanceSubjectIsPath };
9
+
10
+ //# sourceMappingURL=provenance-types.js.map
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { toErrorMessage } from "@kici-dev/core";
3
3
  //#region src/rules/evaluator.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { rule, skip } from "./rule.js";
3
3
  import { evaluateRules } from "./evaluator.js";
4
4
  import { isEventType } from "../events/event-payloads.js";
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/rules/rule.ts
3
3
  /**
4
4
  * Implementation of rule() factory.
@@ -1,2 +1,2 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  export {};
package/dist/secrets.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  import { SecretNotFoundError } from "./errors.js";
3
3
  //#region src/secrets.ts
4
4
  /**
package/dist/step.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  import { createStepOutputProxy } from "./outputs.js";
3
3
  //#region src/step.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/comment.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/create.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/delete.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/dispatch.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/fork.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/triggers/generic-webhook.ts
3
3
  /**
4
4
  * Create a generic webhook trigger configuration.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { DEFAULT_PR_EVENTS, toBranchPattern } from "./types.js";
3
3
  import { pr } from "./pr.js";
4
4
  import { push } from "./push.js";
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/triggers/job-complete.ts
3
3
  /**
4
4
  * Create a job completion trigger configuration.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/triggers/kici-event.ts
3
3
  /**
4
4
  * Create a KiCI custom event trigger configuration.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/triggers/lifecycle.ts
3
3
  /**
4
4
  * Create a lifecycle trigger configuration.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { DEFAULT_PR_EVENTS, asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/pr.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/push.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/release.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/review-comment.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/review.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/triggers/schedule.ts
3
3
  /**
4
4
  * Create a schedule trigger configuration.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/star.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/status.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/tag.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/triggers/types.ts
3
3
  /**
4
4
  * Default PR events when pr() is called without explicit events.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/watch.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/webhook.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/triggers/workflow-complete.ts
3
3
  /**
4
4
  * Create a workflow completion trigger configuration.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { asArray, toBranchPattern } from "./types.js";
3
3
  //#region src/triggers/workflow-run.ts
4
4
  /**
package/dist/types.d.ts CHANGED
@@ -210,13 +210,48 @@ export interface GenericInitConfig {
210
210
  /** Static environment variables available to the command. */
211
211
  env?: Record<string, string>;
212
212
  }
213
+ /**
214
+ * Overrides for the `mise` init preset. The preset supplies the `run` command;
215
+ * these tune the same fields a hand-written {@link GenericInitConfig} exposes,
216
+ * minus `run`.
217
+ */
218
+ export interface MiseInitConfig {
219
+ /** Cache spec for mise's data dir. Omit -> content-derived default; `false` -> no cache. */
220
+ cache?: import('./cache-types.js').CacheSpec | false;
221
+ /** Max wall-clock for the mise init command in ms. Defaults to 600000. */
222
+ timeout?: number;
223
+ /** Static environment variables available to the mise command. */
224
+ env?: Record<string, string>;
225
+ /** Shell used to run the mise command. Defaults to the OS template's shell. */
226
+ shell?: string;
227
+ }
228
+ /** A typed toolchain preset: zero-config string or an object with overrides. */
229
+ export type InitPreset = 'mise' | {
230
+ mise: MiseInitConfig;
231
+ };
232
+ /** One init directive: a hand-written generic config or a typed preset. */
233
+ export type InitItem = GenericInitConfig | InitPreset;
234
+ /**
235
+ * Per-job init configuration:
236
+ * - a single {@link InitItem} (generic config or preset),
237
+ * - an ordered array of items (run in order),
238
+ * - `'auto'` — detect the toolchain from committed files (mise.toml / .tool-versions),
239
+ * - `false` — explicit opt-out.
240
+ *
241
+ * An unset `init` is also "no init". `'auto'` is a scalar only — never an array element.
242
+ */
243
+ export type InitConfig = InitItem | InitItem[] | 'auto' | false;
213
244
  /**
214
245
  * Structured runsOn selector with required and excluded labels.
215
246
  * Used when jobs need to target specific agents while excluding others.
216
247
  *
217
- * **Reserved namespace:** Labels with the `kici:` prefix are reserved for internal use
218
- * (e.g., `kici:role:builder`, `kici:role:init-runner`). User-supplied labels starting with
219
- * `kici:` will be rejected at compile time and agent startup.
248
+ * **Targeting `kici:` labels:** `runsOn` may target any agent label, including the
249
+ * `kici:`-namespaced auto-labels (e.g. `kici:os:linux`, `kici:arch:arm64`,
250
+ * `kici:host:<name>`). Targeting is a requirement on candidate agents, never a grant.
251
+ * Note that `kici:scaler:<name>` / `kici:agent:<backend>` are deployment-specific names,
252
+ * so targeting them couples a workflow to one orchestrator's configuration. Users still
253
+ * cannot *set* `kici:` labels on agents — that namespace is reserved for the scaler and
254
+ * the agent's self-reported platform facts.
220
255
  */
221
256
  export interface RunsOnSelector {
222
257
  labels: string | string[];
@@ -224,13 +259,15 @@ export interface RunsOnSelector {
224
259
  }
225
260
  /**
226
261
  * Polymorphic runsOn type: string shorthand, array shorthand, or full selector object.
227
- * - `'linux'` — single label shorthand
228
- * - `['linux', 'docker']` — multi-label shorthand
229
- * - `{ labels: ['linux', 'docker'], exclude: ['gpu'] }` — full selector with exclusions
262
+ * - `'kici:os:linux'` — single label shorthand (targets any linux agent)
263
+ * - `['kici:os:linux', 'gpu']` — multi-label shorthand (all must match)
264
+ * - `{ labels: ['kici:os:linux'], exclude: ['kici:host:box-01'] }` — full selector
230
265
  *
231
- * **Reserved namespace:** Labels with the `kici:` prefix are reserved for internal use
232
- * (e.g., `kici:role:builder`, `kici:role:init-runner`). User-supplied labels starting with
233
- * `kici:` will be rejected at compile time and agent startup.
266
+ * **Targeting `kici:` labels:** `runsOn` may target any agent label, including the
267
+ * `kici:`-namespaced auto-labels (`kici:os:`, `kici:arch:`, `kici:host:`, `kici:agent:`,
268
+ * `kici:scaler:`, `kici:role:`). Targeting is a requirement on candidate agents, never a
269
+ * grant. `kici:scaler:` / `kici:agent:` are deployment-specific, so prefer custom labels
270
+ * for portable pool targeting. Users still cannot *set* `kici:` labels on agents.
234
271
  */
235
272
  export type RunsOn = string | string[] | RunsOnSelector;
236
273
  /** Job definition returned by job() factory */
@@ -298,10 +335,12 @@ export interface Job {
298
335
  readonly resources?: ResourceRequest;
299
336
  /**
300
337
  * Per-job initialization. Runs after clone, before steps.
301
- * - A `GenericInitConfig` (or array, run in order) provisions a toolchain.
302
- * - `false` is an explicit opt-out (reserved for the future auto-detect layer).
338
+ * - A `GenericInitConfig` or typed preset (`'mise'` / `{ mise }`), single or
339
+ * in an ordered array, provisions a toolchain.
340
+ * - `'auto'` detects the toolchain from committed files (mise.toml / .tool-versions).
341
+ * - `false` is an explicit opt-out (an unset `init` is also "no init").
303
342
  */
304
- readonly init?: GenericInitConfig | GenericInitConfig[] | false;
343
+ readonly init?: InitConfig;
305
344
  /** Declarative cache: restored before steps, saved after the job on key miss. */
306
345
  readonly cache?: import('./cache-types.js').CacheInput;
307
346
  /** Pause for a manual human approval before this job dispatches. */
@@ -401,10 +440,12 @@ export interface JobOptions {
401
440
  resources?: ResourceRequest;
402
441
  /**
403
442
  * Per-job initialization. Runs after clone, before steps.
404
- * - A `GenericInitConfig` (or array, run in order) provisions a toolchain.
405
- * - `false` is an explicit opt-out (reserved for the future auto-detect layer).
443
+ * - A `GenericInitConfig` or typed preset (`'mise'` / `{ mise }`), single or
444
+ * in an ordered array, provisions a toolchain.
445
+ * - `'auto'` detects the toolchain from committed files (mise.toml / .tool-versions).
446
+ * - `false` is an explicit opt-out (an unset `init` is also "no init").
406
447
  */
407
- init?: GenericInitConfig | GenericInitConfig[] | false;
448
+ init?: InitConfig;
408
449
  /** Declarative cache: restored before steps, saved after the job on key miss. */
409
450
  cache?: import('./cache-types.js').CacheInput;
410
451
  /** Pause for a manual human approval before this job dispatches. */
package/dist/types.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  //#region src/types.ts
3
3
  /**
4
4
  * Type guard to check if a JobOrFactory is a dynamic job generator.
@@ -1,4 +1,4 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  //#region src/validation/dag.ts
3
3
  /**
4
4
  * Validate a DAG for common issues: self-references, missing dependencies, and cycles.
@@ -1,3 +1,3 @@
1
- import "../chunk-gOLHoazu.js";
1
+ import "../chunk-BTugEXQM.js";
2
2
  import { validateDag } from "./dag.js";
3
3
  export { validateDag };
package/dist/wait-for.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  import { step } from "./step.js";
3
3
  //#region src/wait-for.ts
4
4
  /**
package/dist/workflow.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-gOLHoazu.js";
1
+ import "./chunk-BTugEXQM.js";
2
2
  //#region src/workflow.ts
3
3
  /**
4
4
  * Normalize triggers to array.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kici-dev/sdk",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "TypeScript SDK for defining KiCI workflows. Import into `.kici/workflows/*.ts` to declare workflows, jobs, steps, triggers, rules, and matrix configurations.",
5
5
  "keywords": [
6
6
  "ci",
@@ -46,12 +46,11 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "fast-cartesian": "^9.0.1",
50
49
  "micromatch": "^4.0.8",
51
50
  "zod": "^4.3.6",
52
51
  "zx": "^8.8.5",
53
- "@kici-dev/core": "0.1.16",
54
- "@kici-dev/engine": "0.1.16"
52
+ "@kici-dev/core": "0.1.17",
53
+ "@kici-dev/engine": "0.1.17"
55
54
  },
56
55
  "devDependencies": {
57
56
  "@types/micromatch": "^4.0.10"
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/sdk@0.1.16",
6
- "documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fsdk/0.1.16/49f54029-d7dc-48b9-ad51-af6b845b321f",
5
+ "name": "@kici-dev/sdk@0.1.17",
6
+ "documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fsdk/0.1.17/3fe04364-30c3-435e-8804-37ebcd2fee4b",
7
7
  "creationInfo": {
8
- "created": "2026-06-12T09:41:41Z",
8
+ "created": "2026-06-14T12:30:22Z",
9
9
  "creators": [
10
10
  "Tool: kici-sbom-generator"
11
11
  ]
@@ -146,9 +146,9 @@
146
146
  "homepage": "https://ericsmekens.github.io/jsep/tree/master/packages/regex#readme"
147
147
  },
148
148
  {
149
- "SPDXID": "SPDXRef-Package--kici-dev-core-0.1.16",
149
+ "SPDXID": "SPDXRef-Package--kici-dev-core-0.1.17",
150
150
  "name": "@kici-dev/core",
151
- "versionInfo": "0.1.16",
151
+ "versionInfo": "0.1.17",
152
152
  "downloadLocation": "NOASSERTION",
153
153
  "filesAnalyzed": false,
154
154
  "licenseConcluded": "NOASSERTION",
@@ -159,16 +159,16 @@
159
159
  {
160
160
  "referenceCategory": "PACKAGE-MANAGER",
161
161
  "referenceType": "purl",
162
- "referenceLocator": "pkg:npm/%40kici-dev/core@0.1.16"
162
+ "referenceLocator": "pkg:npm/%40kici-dev/core@0.1.17"
163
163
  }
164
164
  ],
165
165
  "description": "Light shared utilities for the KiCI stack (logging, errors, formatting, crypto, zx init, the TypeScript ESM loader hook). No server-side dependencies.",
166
166
  "homepage": "https://kici.dev"
167
167
  },
168
168
  {
169
- "SPDXID": "SPDXRef-Package--kici-dev-engine-0.1.16",
169
+ "SPDXID": "SPDXRef-Package--kici-dev-engine-0.1.17",
170
170
  "name": "@kici-dev/engine",
171
- "versionInfo": "0.1.16",
171
+ "versionInfo": "0.1.17",
172
172
  "downloadLocation": "NOASSERTION",
173
173
  "filesAnalyzed": false,
174
174
  "licenseConcluded": "NOASSERTION",
@@ -179,7 +179,7 @@
179
179
  {
180
180
  "referenceCategory": "PACKAGE-MANAGER",
181
181
  "referenceType": "purl",
182
- "referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.16"
182
+ "referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.17"
183
183
  }
184
184
  ],
185
185
  "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.",
@@ -188,7 +188,7 @@
188
188
  {
189
189
  "SPDXID": "SPDXRef-RootPackage",
190
190
  "name": "@kici-dev/sdk",
191
- "versionInfo": "0.1.16",
191
+ "versionInfo": "0.1.17",
192
192
  "downloadLocation": "NOASSERTION",
193
193
  "filesAnalyzed": false,
194
194
  "licenseConcluded": "NOASSERTION",
@@ -199,7 +199,7 @@
199
199
  {
200
200
  "referenceCategory": "PACKAGE-MANAGER",
201
201
  "referenceType": "purl",
202
- "referenceLocator": "pkg:npm/%40kici-dev/sdk@0.1.16"
202
+ "referenceLocator": "pkg:npm/%40kici-dev/sdk@0.1.17"
203
203
  }
204
204
  ],
205
205
  "description": "TypeScript SDK for defining KiCI workflows. Import into `.kici/workflows/*.ts` to declare workflows, jobs, steps, triggers, rules, and matrix configurations.",
@@ -936,6 +936,26 @@
936
936
  ],
937
937
  "description": "Check if something is a Node.js stream"
938
938
  },
939
+ {
940
+ "SPDXID": "SPDXRef-Package-jose-6.2.3",
941
+ "name": "jose",
942
+ "versionInfo": "6.2.3",
943
+ "downloadLocation": "https://registry.npmjs.org/jose/-/jose-6.2.3.tgz",
944
+ "filesAnalyzed": false,
945
+ "licenseConcluded": "NOASSERTION",
946
+ "licenseDeclared": "MIT",
947
+ "copyrightText": "NOASSERTION",
948
+ "supplier": "NOASSERTION",
949
+ "externalRefs": [
950
+ {
951
+ "referenceCategory": "PACKAGE-MANAGER",
952
+ "referenceType": "purl",
953
+ "referenceLocator": "pkg:npm/jose@6.2.3"
954
+ }
955
+ ],
956
+ "description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
957
+ "homepage": "https://github.com/panva/jose"
958
+ },
939
959
  {
940
960
  "SPDXID": "SPDXRef-Package-jsep-1.4.0",
941
961
  "name": "jsep",
@@ -1544,63 +1564,68 @@
1544
1564
  "relationshipType": "DEPENDS_ON"
1545
1565
  },
1546
1566
  {
1547
- "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.16",
1567
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.17",
1548
1568
  "relatedSpdxElement": "SPDXRef-Package-oxc-transform-0.128.0",
1549
1569
  "relationshipType": "DEPENDS_ON"
1550
1570
  },
1551
1571
  {
1552
- "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.16",
1572
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.17",
1553
1573
  "relatedSpdxElement": "SPDXRef-Package-picocolors-1.1.1",
1554
1574
  "relationshipType": "DEPENDS_ON"
1555
1575
  },
1556
1576
  {
1557
- "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.16",
1577
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.17",
1558
1578
  "relatedSpdxElement": "SPDXRef-Package-winston-daily-rotate-file-5.0.0",
1559
1579
  "relationshipType": "DEPENDS_ON"
1560
1580
  },
1561
1581
  {
1562
- "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.16",
1582
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.17",
1563
1583
  "relatedSpdxElement": "SPDXRef-Package-winston-3.19.0",
1564
1584
  "relationshipType": "DEPENDS_ON"
1565
1585
  },
1566
1586
  {
1567
- "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.16",
1587
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.17",
1568
1588
  "relatedSpdxElement": "SPDXRef-Package-zod-4.3.6",
1569
1589
  "relationshipType": "DEPENDS_ON"
1570
1590
  },
1571
1591
  {
1572
- "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.16",
1592
+ "spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.17",
1573
1593
  "relatedSpdxElement": "SPDXRef-Package-zx-8.8.5",
1574
1594
  "relationshipType": "DEPENDS_ON"
1575
1595
  },
1576
1596
  {
1577
- "spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.16",
1578
- "relatedSpdxElement": "SPDXRef-Package-jsonpath-plus-10.4.0",
1597
+ "spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.17",
1598
+ "relatedSpdxElement": "SPDXRef-Package-fast-cartesian-9.0.1",
1579
1599
  "relationshipType": "DEPENDS_ON"
1580
1600
  },
1581
1601
  {
1582
- "spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.16",
1583
- "relatedSpdxElement": "SPDXRef-Package-picomatch-4.0.4",
1602
+ "spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.17",
1603
+ "relatedSpdxElement": "SPDXRef-Package-jose-6.2.3",
1584
1604
  "relationshipType": "DEPENDS_ON"
1585
1605
  },
1586
1606
  {
1587
- "spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.16",
1588
- "relatedSpdxElement": "SPDXRef-Package-zod-4.3.6",
1607
+ "spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.17",
1608
+ "relatedSpdxElement": "SPDXRef-Package-jsonpath-plus-10.4.0",
1589
1609
  "relationshipType": "DEPENDS_ON"
1590
1610
  },
1591
1611
  {
1592
- "spdxElementId": "SPDXRef-RootPackage",
1593
- "relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.16",
1612
+ "spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.17",
1613
+ "relatedSpdxElement": "SPDXRef-Package-picomatch-4.0.4",
1614
+ "relationshipType": "DEPENDS_ON"
1615
+ },
1616
+ {
1617
+ "spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.17",
1618
+ "relatedSpdxElement": "SPDXRef-Package-zod-4.3.6",
1594
1619
  "relationshipType": "DEPENDS_ON"
1595
1620
  },
1596
1621
  {
1597
1622
  "spdxElementId": "SPDXRef-RootPackage",
1598
- "relatedSpdxElement": "SPDXRef-Package--kici-dev-engine-0.1.16",
1623
+ "relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.17",
1599
1624
  "relationshipType": "DEPENDS_ON"
1600
1625
  },
1601
1626
  {
1602
1627
  "spdxElementId": "SPDXRef-RootPackage",
1603
- "relatedSpdxElement": "SPDXRef-Package-fast-cartesian-9.0.1",
1628
+ "relatedSpdxElement": "SPDXRef-Package--kici-dev-engine-0.1.17",
1604
1629
  "relationshipType": "DEPENDS_ON"
1605
1630
  },
1606
1631
  {
File without changes