@kici-dev/sdk 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-types.js +1 -1
- package/dist/approval.js +1 -1
- package/dist/cache-types.js +1 -1
- package/dist/context.d.ts +9 -2
- package/dist/context.js +1 -1
- package/dist/dynamic-group.js +1 -1
- package/dist/errors.js +1 -1
- package/dist/events/define-event.js +1 -1
- package/dist/events/event-payloads.js +1 -1
- package/dist/events/event-payloads.test-d.js +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/types.js +1 -1
- package/dist/fanout-context.js +1 -1
- package/dist/fixture.d.ts +3 -3
- package/dist/fixture.js +2 -2
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/types.js +1 -1
- package/dist/host-restart.js +1 -1
- package/dist/idempotent.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -2
- package/dist/job.js +6 -2
- package/dist/matrix/expand.js +1 -1
- package/dist/matrix/index.js +1 -1
- package/dist/matrix/types.js +1 -1
- package/dist/needs-context.js +1 -1
- package/dist/outputs.js +2 -2
- package/dist/parallel.d.ts +40 -0
- package/dist/parallel.js +37 -0
- package/dist/provenance-types.d.ts +16 -2
- package/dist/provenance-types.js +1 -1
- package/dist/{chunk-BTugEXQM.js → rolldown-runtime-ClRpJifh.js} +0 -1
- package/dist/rules/evaluator.js +1 -1
- package/dist/rules/index.js +1 -1
- package/dist/rules/rule.js +1 -1
- package/dist/rules/types.js +1 -1
- package/dist/secrets.d.ts +1 -1
- package/dist/secrets.js +1 -1
- package/dist/step.js +1 -1
- package/dist/triggers/comment.js +1 -1
- package/dist/triggers/create.js +1 -1
- package/dist/triggers/delete.js +1 -1
- package/dist/triggers/dispatch-inputs.js +1 -1
- package/dist/triggers/dispatch.js +1 -1
- package/dist/triggers/fork.js +1 -1
- package/dist/triggers/generic-webhook.js +1 -1
- package/dist/triggers/index.js +1 -1
- package/dist/triggers/job-complete.js +1 -1
- package/dist/triggers/kici-event.js +1 -1
- package/dist/triggers/lifecycle.js +1 -1
- package/dist/triggers/pr.js +1 -1
- package/dist/triggers/push.js +1 -1
- package/dist/triggers/release.js +1 -1
- package/dist/triggers/review-comment.js +1 -1
- package/dist/triggers/review.js +1 -1
- package/dist/triggers/schedule.d.ts +3 -0
- package/dist/triggers/schedule.js +9 -2
- package/dist/triggers/star.js +1 -1
- package/dist/triggers/status.js +1 -1
- package/dist/triggers/tag.js +1 -1
- package/dist/triggers/types.d.ts +12 -0
- package/dist/triggers/types.js +1 -1
- package/dist/triggers/watch.js +1 -1
- package/dist/triggers/webhook.js +1 -1
- package/dist/triggers/workflow-complete.js +1 -1
- package/dist/triggers/workflow-run.js +1 -1
- package/dist/types.d.ts +18 -4
- package/dist/types.js +1 -1
- package/dist/validation/dag.js +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/wait-for.js +1 -1
- package/dist/workflow.js +1 -1
- package/package.json +3 -3
- package/sbom.spdx.json +24 -24
package/dist/api-types.js
CHANGED
package/dist/approval.js
CHANGED
package/dist/cache-types.js
CHANGED
package/dist/context.d.ts
CHANGED
|
@@ -114,6 +114,13 @@ export interface StepContext<TInputs = Record<string, unknown>> {
|
|
|
114
114
|
setEnv(key: string, value: string): void;
|
|
115
115
|
/** Prepend a directory to PATH, visible to this step and all subsequent steps. */
|
|
116
116
|
addPath(dir: string): void;
|
|
117
|
+
/**
|
|
118
|
+
* Aborted when this step should stop early — the job is being cancelled, the
|
|
119
|
+
* job-level timeout fired, or (in a `parallel()` group) a sibling failed under
|
|
120
|
+
* fail-fast. Pass it to `fetch`, `ctx.$`, timers, or any cancellable async work
|
|
121
|
+
* to cooperatively unwind. Unaborted for a normally-running step.
|
|
122
|
+
*/
|
|
123
|
+
signal: AbortSignal;
|
|
117
124
|
/** Typed inputs from dependencies */
|
|
118
125
|
inputs: TInputs;
|
|
119
126
|
/**
|
|
@@ -153,7 +160,7 @@ export interface StepContext<TInputs = Record<string, unknown>> {
|
|
|
153
160
|
/**
|
|
154
161
|
* Raw webhook payload from the git provider.
|
|
155
162
|
* Contains the full, unmodified payload as received from the webhook.
|
|
156
|
-
* In local
|
|
163
|
+
* In local preview/run mode (`kici preview` / `kici run local`), contains the simulated payload.
|
|
157
164
|
* Use this for provider-specific data not covered by normalized fields.
|
|
158
165
|
*/
|
|
159
166
|
rawPayload?: Record<string, unknown>;
|
|
@@ -164,7 +171,7 @@ export interface StepContext<TInputs = Record<string, unknown>> {
|
|
|
164
171
|
*/
|
|
165
172
|
provider?: string;
|
|
166
173
|
/**
|
|
167
|
-
* Whether this execution was triggered by `kici
|
|
174
|
+
* Whether this execution was triggered by `kici run remote` (developer-initiated remote run).
|
|
168
175
|
* Use to conditionally skip destructive operations in test mode.
|
|
169
176
|
* Defaults to false for backward compatibility.
|
|
170
177
|
*/
|
package/dist/context.js
CHANGED
package/dist/dynamic-group.js
CHANGED
package/dist/errors.js
CHANGED
package/dist/events/index.js
CHANGED
package/dist/events/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
package/dist/fanout-context.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
package/dist/fixture.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Fixture factory for defining test event replicas.
|
|
3
3
|
*
|
|
4
4
|
* Fixtures declare which trigger event to simulate when running
|
|
5
|
-
* `kici
|
|
5
|
+
* `kici run remote <name>`. They are event replicas (not assertions) --
|
|
6
6
|
* pass/fail is determined by the pipeline execution.
|
|
7
7
|
*/
|
|
8
8
|
import type { TriggerConfig } from './triggers/types.js';
|
|
@@ -25,7 +25,7 @@ export interface FixtureOptions {
|
|
|
25
25
|
}
|
|
26
26
|
/** Resolved fixture definition */
|
|
27
27
|
export interface Fixture {
|
|
28
|
-
/** Unique fixture ID used in `kici
|
|
28
|
+
/** Unique fixture ID used in `kici run remote <name>` */
|
|
29
29
|
readonly id: string;
|
|
30
30
|
/** Fixture options (plain object or async factory function) */
|
|
31
31
|
readonly options: FixtureOptions | (() => FixtureOptions | Promise<FixtureOptions>);
|
|
@@ -33,7 +33,7 @@ export interface Fixture {
|
|
|
33
33
|
/**
|
|
34
34
|
* Create a test fixture definition.
|
|
35
35
|
*
|
|
36
|
-
* @param id - Unique fixture ID (no whitespace allowed, used in `kici
|
|
36
|
+
* @param id - Unique fixture ID (no whitespace allowed, used in `kici run remote <name>`)
|
|
37
37
|
* @param options - Fixture configuration or async factory function
|
|
38
38
|
* @returns Frozen fixture definition
|
|
39
39
|
*
|
package/dist/fixture.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
//#region src/fixture.ts
|
|
3
3
|
/**
|
|
4
4
|
* Create a test fixture definition.
|
|
5
5
|
*
|
|
6
|
-
* @param id - Unique fixture ID (no whitespace allowed, used in `kici
|
|
6
|
+
* @param id - Unique fixture ID (no whitespace allowed, used in `kici run remote <name>`)
|
|
7
7
|
* @param options - Fixture configuration or async factory function
|
|
8
8
|
* @returns Frozen fixture definition
|
|
9
9
|
*
|
package/dist/hooks/index.js
CHANGED
package/dist/hooks/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
package/dist/host-restart.js
CHANGED
package/dist/idempotent.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { step } from './step.js';
|
|
2
2
|
export { job } from './job.js';
|
|
3
3
|
export { workflow } from './workflow.js';
|
|
4
|
+
export { parallel, isParallelGroup, flattenStepInputs } from './parallel.js';
|
|
5
|
+
export type { ParallelGroup, ParallelOptions } from './parallel.js';
|
|
4
6
|
export { normalizeApproval } from './approval.js';
|
|
5
7
|
export type { ApprovalConfig, ApprovalWhen, ApproverClause, NormalizedApproval, } from './approval.js';
|
|
6
8
|
export { pr, push, tag, comment, review, reviewComment, release, dispatch, create, delete as delete, status, workflowRun, fork, star, watch, webhook, kiciEvent, workflowComplete, jobComplete, genericWebhook, schedule, lifecycle, defineDispatchInputs, } from './triggers/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { buildKiciApi } from "./api-types.js";
|
|
3
3
|
import { normalizeApproval } from "./approval.js";
|
|
4
4
|
import { CacheSpecSchema, normalizeCacheSpecs } from "./cache-types.js";
|
|
@@ -13,6 +13,7 @@ import { restartHost, waitForHostAlive } from "./host-restart.js";
|
|
|
13
13
|
import { checkStep, idempotent, idempotentStep } from "./idempotent.js";
|
|
14
14
|
import { job } from "./job.js";
|
|
15
15
|
import { workflow } from "./workflow.js";
|
|
16
|
+
import { flattenStepInputs, isParallelGroup, parallel } from "./parallel.js";
|
|
16
17
|
import { pr } from "./triggers/pr.js";
|
|
17
18
|
import { push } from "./triggers/push.js";
|
|
18
19
|
import { tag } from "./triggers/tag.js";
|
|
@@ -54,4 +55,4 @@ import "./matrix/index.js";
|
|
|
54
55
|
import { defineEvent } from "./events/define-event.js";
|
|
55
56
|
import "./events/index.js";
|
|
56
57
|
import { z } from "zod";
|
|
57
|
-
export { CacheSpecSchema, DYNAMIC_GROUP_TAG, DYNAMIC_JOB_GROUP_TAG, DYNAMIC_JOB_NEEDS_TAG, SecretNotFoundError, WaitForTimeoutError, afterStep, applyIncludeExclude, beforeStep, buildKiciApi, buildNeedsContext, checkStep, cleanup, comment, create, createJobOutputProxy, createSnapshotOutputProxy, createStepOutputProxy, createStepSecrets, defineDispatchInputs, defineEvent, del as delete, dispatch, dynamicGroup, dynamicJob, evaluateRules, expandMatrix, fixture, fork, genericWebhook, getDynamicJobGroup, getDynamicJobNeeds, getJobOutputsMap, getStepOutputsMap, getStepRefMap, idempotent, idempotentStep, isDynamicFunction, isDynamicGroupRef, isDynamicJobFn, isEventType, isHostJobOutputs, isMatrixJobOutputs, isStaticArray, isStaticObject, job, jobComplete, kiciEvent, lifecycle, normalizeApproval, normalizeCacheSpecs, onCancel, onFailure, onSuccess, onlyOnFanoutIndex, onlyOnFirstHost, onlyOnLastHost, pr, provenanceSubjectIsPath, push, release, resolveJobOutputs, resolveStepOutputs, restartHost, review, reviewComment, rule, schedule, setJobOutputsMap, setStepOutputsMap, setStepRefMap, skip, star, status, step, tag, validateDag, waitFor, waitForHostAlive, waitForStep, watch, webhook, workflow, workflowComplete, workflowRun, z };
|
|
58
|
+
export { CacheSpecSchema, DYNAMIC_GROUP_TAG, DYNAMIC_JOB_GROUP_TAG, DYNAMIC_JOB_NEEDS_TAG, SecretNotFoundError, WaitForTimeoutError, afterStep, applyIncludeExclude, beforeStep, buildKiciApi, buildNeedsContext, checkStep, cleanup, comment, create, createJobOutputProxy, createSnapshotOutputProxy, createStepOutputProxy, createStepSecrets, defineDispatchInputs, defineEvent, del as delete, dispatch, dynamicGroup, dynamicJob, evaluateRules, expandMatrix, fixture, flattenStepInputs, fork, genericWebhook, getDynamicJobGroup, getDynamicJobNeeds, getJobOutputsMap, getStepOutputsMap, getStepRefMap, idempotent, idempotentStep, isDynamicFunction, isDynamicGroupRef, isDynamicJobFn, isEventType, isHostJobOutputs, isMatrixJobOutputs, isParallelGroup, isStaticArray, isStaticObject, job, jobComplete, kiciEvent, lifecycle, normalizeApproval, normalizeCacheSpecs, onCancel, onFailure, onSuccess, onlyOnFanoutIndex, onlyOnFirstHost, onlyOnLastHost, parallel, pr, provenanceSubjectIsPath, push, release, resolveJobOutputs, resolveStepOutputs, restartHost, review, reviewComment, rule, schedule, setJobOutputsMap, setStepOutputsMap, setStepRefMap, skip, star, status, step, tag, validateDag, waitFor, waitForHostAlive, waitForStep, watch, webhook, workflow, workflowComplete, workflowRun, z };
|
package/dist/job.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { createJobOutputProxy } from "./outputs.js";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
//#region src/job.ts
|
|
@@ -32,6 +32,9 @@ function job(nameOrOptions, maybeOptions) {
|
|
|
32
32
|
steps = [options.run];
|
|
33
33
|
}
|
|
34
34
|
validateInit(options.init, name);
|
|
35
|
+
const firstEnv = options.environments?.[0];
|
|
36
|
+
const concurrencyGroup = options.concurrencyGroup ?? (typeof firstEnv === "string" ? firstEnv : void 0);
|
|
37
|
+
if (options.environment !== void 0 && options.environments !== void 0) throw new Error(`job('${name}'): environment and environments are mutually exclusive — use one`);
|
|
35
38
|
if (options.runsOn !== void 0 && options.runsOnAll !== void 0) throw new Error(`job('${name}'): runsOn and runsOnAll are mutually exclusive`);
|
|
36
39
|
if (options.runsOn === void 0 && options.runsOnAll === void 0) throw new Error(`job('${name}'): one of runsOn or runsOnAll is required`);
|
|
37
40
|
if (options.onUnreachable !== void 0 && options.runsOnAll === void 0) console.warn(`[kici] job('${name}'): onUnreachable is ignored without runsOnAll`);
|
|
@@ -55,8 +58,9 @@ function job(nameOrOptions, maybeOptions) {
|
|
|
55
58
|
checkout: options.checkout,
|
|
56
59
|
container: options.container,
|
|
57
60
|
environment: options.environment,
|
|
61
|
+
environments: options.environments,
|
|
58
62
|
env: options.env,
|
|
59
|
-
concurrencyGroup
|
|
63
|
+
concurrencyGroup,
|
|
60
64
|
onCancel: options.onCancel,
|
|
61
65
|
cleanup: options.cleanup,
|
|
62
66
|
onSuccess: options.onSuccess,
|
package/dist/matrix/expand.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { applyIncludeExclude, expandMatrix, expandMultiDimension, expandSingleDimension } from "@kici-dev/engine";
|
|
3
3
|
export { applyIncludeExclude, expandMatrix, expandMultiDimension, expandSingleDimension };
|
package/dist/matrix/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.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 };
|
package/dist/matrix/types.js
CHANGED
package/dist/needs-context.js
CHANGED
package/dist/outputs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
//#region src/outputs.ts
|
|
3
3
|
/**
|
|
4
4
|
* Well-known string property names that should delegate to Reflect rather than throwing.
|
|
5
5
|
* These are accessed by built-in operations like JSON.stringify, console.log, iteration, etc.
|
|
6
6
|
*/
|
|
7
|
-
const WELL_KNOWN_STRING_PROPS = new Set([
|
|
7
|
+
const WELL_KNOWN_STRING_PROPS = /* @__PURE__ */ new Set([
|
|
8
8
|
"constructor",
|
|
9
9
|
"toString",
|
|
10
10
|
"valueOf",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Step, BareStepFn, StepInput } from './types.js';
|
|
2
|
+
/** A flat step entry: a step or bare function, never a parallel group. */
|
|
3
|
+
export type FlatStepInput = Step<any> | BareStepFn<any>;
|
|
4
|
+
/**
|
|
5
|
+
* A concurrent group of steps with a join barrier. Each child runs concurrently
|
|
6
|
+
* and surfaces as its own observable dashboard step (own logs, status, timing).
|
|
7
|
+
* Execution continues past the group only once every child has settled.
|
|
8
|
+
*/
|
|
9
|
+
export interface ParallelGroup {
|
|
10
|
+
readonly _tag: 'ParallelGroup';
|
|
11
|
+
/** Optional group label shown on the dashboard band. */
|
|
12
|
+
readonly name?: string;
|
|
13
|
+
/** When the first child fails, cancel in-flight siblings (default `true`). */
|
|
14
|
+
readonly failFast: boolean;
|
|
15
|
+
/** Maximum children running at once; queued children show `pending`. */
|
|
16
|
+
readonly maxParallel?: number;
|
|
17
|
+
readonly steps: readonly StepInput[];
|
|
18
|
+
}
|
|
19
|
+
export interface ParallelOptions {
|
|
20
|
+
readonly failFast?: boolean;
|
|
21
|
+
readonly maxParallel?: number;
|
|
22
|
+
readonly name?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Run `steps` concurrently with a join barrier; each child is its own
|
|
26
|
+
* observable step. A `parallel()` group's `failFast`/`maxParallel` nest inside
|
|
27
|
+
* the job-level fan-out scopes — they govern only this step group.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parallel(steps: StepInput[], opts?: ParallelOptions): ParallelGroup;
|
|
30
|
+
/** Type guard distinguishing a `ParallelGroup` from a step or bare function. */
|
|
31
|
+
export declare function isParallelGroup(x: unknown): x is ParallelGroup;
|
|
32
|
+
/**
|
|
33
|
+
* Flatten a job's `steps` into a flat list where each parallel group's children
|
|
34
|
+
* are inlined in array order (the group wrapper is dropped). Used by single-
|
|
35
|
+
* process consumers (the local executor and dry-run preview) that surface each
|
|
36
|
+
* child as its own step but do not run a concurrent scheduler; the concurrent
|
|
37
|
+
* agent path expands groups into observable concurrent tasks instead.
|
|
38
|
+
*/
|
|
39
|
+
export declare function flattenStepInputs(steps: readonly StepInput[]): FlatStepInput[];
|
|
40
|
+
//# sourceMappingURL=parallel.d.ts.map
|
package/dist/parallel.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
//#region src/parallel.ts
|
|
3
|
+
/**
|
|
4
|
+
* Run `steps` concurrently with a join barrier; each child is its own
|
|
5
|
+
* observable step. A `parallel()` group's `failFast`/`maxParallel` nest inside
|
|
6
|
+
* the job-level fan-out scopes — they govern only this step group.
|
|
7
|
+
*/
|
|
8
|
+
function parallel(steps, opts = {}) {
|
|
9
|
+
return {
|
|
10
|
+
_tag: "ParallelGroup",
|
|
11
|
+
name: opts.name,
|
|
12
|
+
failFast: opts.failFast ?? true,
|
|
13
|
+
maxParallel: opts.maxParallel,
|
|
14
|
+
steps
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Type guard distinguishing a `ParallelGroup` from a step or bare function. */
|
|
18
|
+
function isParallelGroup(x) {
|
|
19
|
+
return typeof x === "object" && x !== null && x._tag === "ParallelGroup";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Flatten a job's `steps` into a flat list where each parallel group's children
|
|
23
|
+
* are inlined in array order (the group wrapper is dropped). Used by single-
|
|
24
|
+
* process consumers (the local executor and dry-run preview) that surface each
|
|
25
|
+
* child as its own step but do not run a concurrent scheduler; the concurrent
|
|
26
|
+
* agent path expands groups into observable concurrent tasks instead.
|
|
27
|
+
*/
|
|
28
|
+
function flattenStepInputs(steps) {
|
|
29
|
+
const flat = [];
|
|
30
|
+
for (const entry of steps) if (isParallelGroup(entry)) flat.push(...entry.steps);
|
|
31
|
+
else flat.push(entry);
|
|
32
|
+
return flat;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { flattenStepInputs, isParallelGroup, parallel };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=parallel.js.map
|
|
@@ -22,14 +22,28 @@ export interface AttestProvenanceOptions {
|
|
|
22
22
|
/** OIDC audience for the identity token (defaults to 'kici-provenance'). */
|
|
23
23
|
audience?: string;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type AttestProvenanceResult = {
|
|
26
|
+
/** Absent/false: the identity token was minted live and the bundle uploaded. */
|
|
27
|
+
deferred?: false;
|
|
26
28
|
/** Object-storage key the signed bundle was written to. */
|
|
27
29
|
storageKey: string;
|
|
28
30
|
/** Primary subject digest (lowercase hex). */
|
|
29
31
|
subjectDigest: string;
|
|
30
32
|
/** Media type of the persisted bundle. */
|
|
31
33
|
bundleMediaType: string;
|
|
32
|
-
}
|
|
34
|
+
} | {
|
|
35
|
+
/**
|
|
36
|
+
* The Platform mint failed transiently, so only the identity token is
|
|
37
|
+
* deferred: the statement was frozen + signed at build time and is minted
|
|
38
|
+
* later (automatically on Platform recovery, or via
|
|
39
|
+
* `kici-admin attestations retry`). The job still completes successfully.
|
|
40
|
+
*/
|
|
41
|
+
deferred: true;
|
|
42
|
+
/** Primary subject digest (lowercase hex). */
|
|
43
|
+
subjectDigest: string;
|
|
44
|
+
/** SHA-256 of the frozen statement the later token will bind to. */
|
|
45
|
+
statementHash: string;
|
|
46
|
+
};
|
|
33
47
|
/** Discriminate a path subject from a precomputed-digest subject. */
|
|
34
48
|
export declare function provenanceSubjectIsPath(s: ProvenanceSubjectInput): s is {
|
|
35
49
|
name: string;
|
package/dist/provenance-types.js
CHANGED
package/dist/rules/evaluator.js
CHANGED
package/dist/rules/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { onlyOnFanoutIndex, onlyOnFirstHost, onlyOnLastHost, rule, skip } from "./rule.js";
|
|
3
3
|
import { evaluateRules } from "./evaluator.js";
|
|
4
4
|
import { isEventType } from "../events/event-payloads.js";
|
package/dist/rules/rule.js
CHANGED
package/dist/rules/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
package/dist/secrets.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface MountedFile {
|
|
|
48
48
|
*
|
|
49
49
|
* The SDK owns the public surface (`mountFile` / `exposeFile`) but defers
|
|
50
50
|
* disk and `process.env` operations to the agent so the SDK stays free of
|
|
51
|
-
* any `node:fs` / `node:os` imports. Local
|
|
51
|
+
* any `node:fs` / `node:os` imports. Local preview/run mode (`kici preview` / `kici run local`) plugs
|
|
52
52
|
* in the same adapter shape against `os.tmpdir()`.
|
|
53
53
|
*/
|
|
54
54
|
export interface StepSecretsFileHost {
|
package/dist/secrets.js
CHANGED
package/dist/step.js
CHANGED
package/dist/triggers/comment.js
CHANGED
package/dist/triggers/create.js
CHANGED
package/dist/triggers/delete.js
CHANGED
package/dist/triggers/fork.js
CHANGED
package/dist/triggers/index.js
CHANGED
package/dist/triggers/pr.js
CHANGED
package/dist/triggers/push.js
CHANGED
package/dist/triggers/release.js
CHANGED
package/dist/triggers/review.js
CHANGED
|
@@ -15,6 +15,9 @@ import type { ScheduleConfigInput, ScheduleTriggerConfig } from './types.js';
|
|
|
15
15
|
*
|
|
16
16
|
* // Run weekly on Monday at 9am in a specific timezone
|
|
17
17
|
* schedule({ cron: '0 9 * * 1', timezone: 'America/New_York' })
|
|
18
|
+
*
|
|
19
|
+
* // Daily at midnight UTC, with a defaults-only input
|
|
20
|
+
* schedule({ cron: '0 0 * * *', inputs: { mode: z.enum(['full', 'quick']).default('full') } })
|
|
18
21
|
*/
|
|
19
22
|
export declare function schedule(config: ScheduleConfigInput): ScheduleTriggerConfig;
|
|
20
23
|
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
//#region src/triggers/schedule.ts
|
|
3
3
|
/**
|
|
4
4
|
* Create a schedule trigger configuration.
|
|
@@ -12,14 +12,21 @@ import "../chunk-BTugEXQM.js";
|
|
|
12
12
|
*
|
|
13
13
|
* // Run weekly on Monday at 9am in a specific timezone
|
|
14
14
|
* schedule({ cron: '0 9 * * 1', timezone: 'America/New_York' })
|
|
15
|
+
*
|
|
16
|
+
* // Daily at midnight UTC, with a defaults-only input
|
|
17
|
+
* schedule({ cron: '0 0 * * *', inputs: { mode: z.enum(['full', 'quick']).default('full') } })
|
|
15
18
|
*/
|
|
16
19
|
function schedule(config) {
|
|
17
20
|
if (!config.cron || config.cron.trim() === "") throw new Error("schedule() requires a non-empty cron expression");
|
|
21
|
+
const rawInputs = config.inputs;
|
|
22
|
+
let inputsMap;
|
|
23
|
+
if (rawInputs) inputsMap = "__kiciDispatchInputs" in rawInputs ? rawInputs.map : rawInputs;
|
|
18
24
|
const result = {
|
|
19
25
|
_tag: "ScheduleTrigger",
|
|
20
26
|
cron: config.cron,
|
|
21
27
|
timezone: config.timezone ?? "UTC",
|
|
22
|
-
...config.description !== void 0 && { description: config.description }
|
|
28
|
+
...config.description !== void 0 && { description: config.description },
|
|
29
|
+
...inputsMap && { inputs: Object.freeze({ ...inputsMap }) }
|
|
23
30
|
};
|
|
24
31
|
return Object.freeze(result);
|
|
25
32
|
}
|
package/dist/triggers/star.js
CHANGED
package/dist/triggers/status.js
CHANGED
package/dist/triggers/tag.js
CHANGED
package/dist/triggers/types.d.ts
CHANGED
|
@@ -459,6 +459,16 @@ export interface ScheduleConfigInput {
|
|
|
459
459
|
readonly cron: string;
|
|
460
460
|
readonly timezone?: string;
|
|
461
461
|
readonly description?: string;
|
|
462
|
+
/**
|
|
463
|
+
* Typed schedule inputs (defaults-only — no operator overrides on a fire).
|
|
464
|
+
* Accepts a bare `{ name: ZodSchema }` map or a `defineDispatchInputs(...)`
|
|
465
|
+
* branded handle. Each input must declare a `.default()` or be `.optional()`
|
|
466
|
+
* (enforced at compile time).
|
|
467
|
+
*/
|
|
468
|
+
readonly inputs?: DispatchInputsMap | {
|
|
469
|
+
readonly __kiciDispatchInputs: true;
|
|
470
|
+
readonly map: DispatchInputsMap;
|
|
471
|
+
};
|
|
462
472
|
}
|
|
463
473
|
/**
|
|
464
474
|
* Configuration for a schedule trigger.
|
|
@@ -468,6 +478,8 @@ export interface ScheduleTriggerConfig {
|
|
|
468
478
|
readonly cron: string;
|
|
469
479
|
readonly timezone: string;
|
|
470
480
|
readonly description?: string;
|
|
481
|
+
/** Declared, typed schedule inputs (frozen `{ name: ZodSchema }`). */
|
|
482
|
+
readonly inputs?: DispatchInputsMap;
|
|
471
483
|
}
|
|
472
484
|
/**
|
|
473
485
|
* Lifecycle event types for cross-workflow orchestration.
|
package/dist/triggers/types.js
CHANGED
package/dist/triggers/watch.js
CHANGED
package/dist/triggers/webhook.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -93,9 +93,9 @@ export interface Step<TResult = void> {
|
|
|
93
93
|
export type BareStepFn<TResult = void> = (ctx: StepContext) => Promise<TResult>;
|
|
94
94
|
/**
|
|
95
95
|
* Union type for items accepted in a job's steps array.
|
|
96
|
-
* Accepts
|
|
96
|
+
* Accepts Step objects, bare async functions, and concurrent parallel groups.
|
|
97
97
|
*/
|
|
98
|
-
export type StepInput = Step<any> | BareStepFn<any
|
|
98
|
+
export type StepInput = Step<any> | BareStepFn<any> | import('./parallel.js').ParallelGroup;
|
|
99
99
|
/** Options for step() factory - simple form (just async function) */
|
|
100
100
|
export type StepRunFn = (ctx: StepContext) => Promise<void>;
|
|
101
101
|
/**
|
|
@@ -473,9 +473,16 @@ export interface Job {
|
|
|
473
473
|
readonly container?: string | ContainerConfig;
|
|
474
474
|
/** Deployment environment for this job. String for static, or a function of the normalized event envelope for dynamic (resolved at orchestrator two-phase eval). */
|
|
475
475
|
readonly environment?: string | ((event: EventPayload) => string | Promise<string>);
|
|
476
|
+
/**
|
|
477
|
+
* Deployment environments for this job, in merge order (later entries override
|
|
478
|
+
* earlier on name collisions). Mutually exclusive with `environment`. Each entry
|
|
479
|
+
* is a static name or a function of the event (dynamic, resolved per element at
|
|
480
|
+
* two-phase eval).
|
|
481
|
+
*/
|
|
482
|
+
readonly environments?: readonly (string | ((event: EventPayload) => string | Promise<string>))[];
|
|
476
483
|
/** Environment variables. Static object or a function of the normalized event envelope (resolved at orchestrator two-phase eval). */
|
|
477
484
|
readonly env?: Record<string, string> | ((event: EventPayload) => Record<string, string> | Promise<Record<string, string>>);
|
|
478
|
-
/** Concurrency group name. Defaults to environment name if not set. String or a function of the normalized event envelope. */
|
|
485
|
+
/** Concurrency group name. Defaults to the first bound environment's name if not set. String or a function of the normalized event envelope. */
|
|
479
486
|
readonly concurrencyGroup?: string | ((event: EventPayload) => string | Promise<string>);
|
|
480
487
|
/** Runs on cancellation. */
|
|
481
488
|
readonly onCancel?: HookInput;
|
|
@@ -614,9 +621,16 @@ export interface JobOptions {
|
|
|
614
621
|
container?: string | ContainerConfig;
|
|
615
622
|
/** Deployment environment for this job. String for static, or a function of the normalized event envelope for dynamic (resolved at orchestrator two-phase eval). */
|
|
616
623
|
environment?: string | ((event: EventPayload) => string | Promise<string>);
|
|
624
|
+
/**
|
|
625
|
+
* Deployment environments for this job, in merge order (later entries override
|
|
626
|
+
* earlier on name collisions). Mutually exclusive with `environment`. Each entry
|
|
627
|
+
* is a static name or a function of the event (dynamic, resolved per element at
|
|
628
|
+
* two-phase eval).
|
|
629
|
+
*/
|
|
630
|
+
environments?: (string | ((event: EventPayload) => string | Promise<string>))[];
|
|
617
631
|
/** Environment variables. Static object or a function of the normalized event envelope (resolved at orchestrator two-phase eval). */
|
|
618
632
|
env?: Record<string, string> | ((event: EventPayload) => Record<string, string> | Promise<Record<string, string>>);
|
|
619
|
-
/** Concurrency group name. Defaults to environment name if not set. String or a function of the normalized event envelope. */
|
|
633
|
+
/** Concurrency group name. Defaults to the first bound environment's name if not set. String or a function of the normalized event envelope. */
|
|
620
634
|
concurrencyGroup?: string | ((event: EventPayload) => string | Promise<string>);
|
|
621
635
|
/** Runs on cancellation. */
|
|
622
636
|
onCancel?: HookInput;
|
package/dist/types.js
CHANGED
package/dist/validation/dag.js
CHANGED
package/dist/validation/index.js
CHANGED
package/dist/wait-for.js
CHANGED
package/dist/workflow.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
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",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"micromatch": "^4.0.8",
|
|
50
50
|
"zod": "^4.4.3",
|
|
51
51
|
"zx": "^8.8.5",
|
|
52
|
-
"@kici-dev/core": "0.1.
|
|
53
|
-
"@kici-dev/engine": "0.1.
|
|
52
|
+
"@kici-dev/core": "0.1.25",
|
|
53
|
+
"@kici-dev/engine": "0.1.25"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
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.
|
|
6
|
-
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fsdk/0.1.
|
|
5
|
+
"name": "@kici-dev/sdk@0.1.25",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fsdk/0.1.25/28cc15a9-6a0e-47f1-956b-685f5211df15",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-
|
|
8
|
+
"created": "2026-07-05T08:32:31Z",
|
|
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.
|
|
149
|
+
"SPDXID": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
150
150
|
"name": "@kici-dev/core",
|
|
151
|
-
"versionInfo": "0.1.
|
|
151
|
+
"versionInfo": "0.1.25",
|
|
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.
|
|
162
|
+
"referenceLocator": "pkg:npm/%40kici-dev/core@0.1.25"
|
|
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.
|
|
169
|
+
"SPDXID": "SPDXRef-Package--kici-dev-engine-0.1.25",
|
|
170
170
|
"name": "@kici-dev/engine",
|
|
171
|
-
"versionInfo": "0.1.
|
|
171
|
+
"versionInfo": "0.1.25",
|
|
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.
|
|
182
|
+
"referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.25"
|
|
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.
|
|
191
|
+
"versionInfo": "0.1.25",
|
|
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.
|
|
202
|
+
"referenceLocator": "pkg:npm/%40kici-dev/sdk@0.1.25"
|
|
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.",
|
|
@@ -1584,68 +1584,68 @@
|
|
|
1584
1584
|
"relationshipType": "DEPENDS_ON"
|
|
1585
1585
|
},
|
|
1586
1586
|
{
|
|
1587
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
1587
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
1588
1588
|
"relatedSpdxElement": "SPDXRef-Package-oxc-transform-0.135.0",
|
|
1589
1589
|
"relationshipType": "DEPENDS_ON"
|
|
1590
1590
|
},
|
|
1591
1591
|
{
|
|
1592
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
1592
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
1593
1593
|
"relatedSpdxElement": "SPDXRef-Package-picocolors-1.1.1",
|
|
1594
1594
|
"relationshipType": "DEPENDS_ON"
|
|
1595
1595
|
},
|
|
1596
1596
|
{
|
|
1597
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
1597
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
1598
1598
|
"relatedSpdxElement": "SPDXRef-Package-winston-daily-rotate-file-5.0.0",
|
|
1599
1599
|
"relationshipType": "DEPENDS_ON"
|
|
1600
1600
|
},
|
|
1601
1601
|
{
|
|
1602
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
1602
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
1603
1603
|
"relatedSpdxElement": "SPDXRef-Package-winston-3.19.0",
|
|
1604
1604
|
"relationshipType": "DEPENDS_ON"
|
|
1605
1605
|
},
|
|
1606
1606
|
{
|
|
1607
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
1607
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
1608
1608
|
"relatedSpdxElement": "SPDXRef-Package-zod-4.4.3",
|
|
1609
1609
|
"relationshipType": "DEPENDS_ON"
|
|
1610
1610
|
},
|
|
1611
1611
|
{
|
|
1612
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
1612
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
1613
1613
|
"relatedSpdxElement": "SPDXRef-Package-zx-8.8.5",
|
|
1614
1614
|
"relationshipType": "DEPENDS_ON"
|
|
1615
1615
|
},
|
|
1616
1616
|
{
|
|
1617
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
1617
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.25",
|
|
1618
1618
|
"relatedSpdxElement": "SPDXRef-Package-jose-6.2.3",
|
|
1619
1619
|
"relationshipType": "DEPENDS_ON"
|
|
1620
1620
|
},
|
|
1621
1621
|
{
|
|
1622
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
1622
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.25",
|
|
1623
1623
|
"relatedSpdxElement": "SPDXRef-Package-jsonpath-plus-10.4.0",
|
|
1624
1624
|
"relationshipType": "DEPENDS_ON"
|
|
1625
1625
|
},
|
|
1626
1626
|
{
|
|
1627
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
1627
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.25",
|
|
1628
1628
|
"relatedSpdxElement": "SPDXRef-Package-picomatch-4.0.4",
|
|
1629
1629
|
"relationshipType": "DEPENDS_ON"
|
|
1630
1630
|
},
|
|
1631
1631
|
{
|
|
1632
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
1632
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.25",
|
|
1633
1633
|
"relatedSpdxElement": "SPDXRef-Package-safe-regex-2.1.1",
|
|
1634
1634
|
"relationshipType": "DEPENDS_ON"
|
|
1635
1635
|
},
|
|
1636
1636
|
{
|
|
1637
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
1637
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.25",
|
|
1638
1638
|
"relatedSpdxElement": "SPDXRef-Package-zod-4.4.3",
|
|
1639
1639
|
"relationshipType": "DEPENDS_ON"
|
|
1640
1640
|
},
|
|
1641
1641
|
{
|
|
1642
1642
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
1643
|
-
"relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.
|
|
1643
|
+
"relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
1644
1644
|
"relationshipType": "DEPENDS_ON"
|
|
1645
1645
|
},
|
|
1646
1646
|
{
|
|
1647
1647
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
1648
|
-
"relatedSpdxElement": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
1648
|
+
"relatedSpdxElement": "SPDXRef-Package--kici-dev-engine-0.1.25",
|
|
1649
1649
|
"relationshipType": "DEPENDS_ON"
|
|
1650
1650
|
},
|
|
1651
1651
|
{
|