@kici-dev/sdk 0.8.0 → 0.9.0
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/agent-cloud-init.d.ts +6 -16
- package/dist/agent-cloud-init.js +12 -18
- package/dist/agent-cloud-init.test-d.d.ts +2 -0
- package/dist/agent-cloud-init.test-d.js +20 -0
- package/dist/events/emit-typing.test-d.js +1 -1
- package/dist/index.d.ts +1 -23
- package/dist/index.js +4 -12
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +2 -2
- package/dist/testing/step-context.js +1 -1
- package/package.json +7 -7
- package/sbom.spdx.json +162 -350
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Pass a claim code (ClaimCodeCredentials) so the token never
|
|
3
|
-
* transits cloud-init. Removed at v1.0.0.
|
|
4
|
-
*/
|
|
5
|
-
export interface CloudInitCredentials {
|
|
6
|
-
agentToken: string;
|
|
7
|
-
agentId: string;
|
|
8
|
-
orchestratorUrl: string;
|
|
9
|
-
labels: string[];
|
|
10
|
-
}
|
|
11
|
-
/** Preferred: the agent self-claims from a single-use code; the token is minted in-instance. */
|
|
1
|
+
/** The agent self-claims from a single-use code; the token is minted in-instance. */
|
|
12
2
|
export interface ClaimCodeCredentials {
|
|
13
3
|
claimCode: string;
|
|
14
4
|
agentId: string;
|
|
15
5
|
orchestratorUrl: string;
|
|
16
6
|
labels: string[];
|
|
17
7
|
}
|
|
18
|
-
/**
|
|
19
|
-
export type AgentCloudInitCredentials =
|
|
8
|
+
/** The credential shape accepted by `buildAgentCloudInit`. */
|
|
9
|
+
export type AgentCloudInitCredentials = ClaimCodeCredentials;
|
|
20
10
|
/** How the agent binary is delivered onto the instance. */
|
|
21
11
|
export type AgentDeliveryMode = 'container' | 'payload';
|
|
22
12
|
/** How the rendered `user_data` string is encoded before it is returned. */
|
|
@@ -58,9 +48,9 @@ export interface AgentCloudInitOptions {
|
|
|
58
48
|
userDataEncoding?: UserDataEncoding;
|
|
59
49
|
}
|
|
60
50
|
/**
|
|
61
|
-
* Build the cloud-config `user_data` string.
|
|
62
|
-
*
|
|
63
|
-
*
|
|
51
|
+
* Build the cloud-config `user_data` string. The claim code appears only in the
|
|
52
|
+
* reserved env-file write entry (`0600`, root-only), and the agent token the
|
|
53
|
+
* instance exchanges it for stays off the provisioning channel entirely.
|
|
64
54
|
*/
|
|
65
55
|
export declare function buildAgentCloudInit(creds: AgentCloudInitCredentials, options: AgentCloudInitOptions): string;
|
|
66
56
|
//# sourceMappingURL=agent-cloud-init.d.ts.map
|
package/dist/agent-cloud-init.js
CHANGED
|
@@ -4,33 +4,27 @@ import { parse, stringify } from "yaml";
|
|
|
4
4
|
/**
|
|
5
5
|
* Cloud-init `user_data` builder for a scaler-provisioned KiCI agent.
|
|
6
6
|
*
|
|
7
|
-
* Renders a `#cloud-config` that installs + starts the agent
|
|
8
|
-
*
|
|
9
|
-
* self-poweroff. The
|
|
10
|
-
* file; it never appears in a comment, a process argument, or any other file
|
|
7
|
+
* Renders a `#cloud-config` that installs + starts the agent from a single-use
|
|
8
|
+
* claim code, plus teardown layer L2 — an in-instance max-lifetime
|
|
9
|
+
* self-poweroff. The claim code is written ONLY into a root-only `0600` env
|
|
10
|
+
* file; it never appears in a comment, a process argument, or any other file,
|
|
11
|
+
* and the agent token it is exchanged for never transits cloud-init at all.
|
|
11
12
|
*/
|
|
12
13
|
const AGENT_ENV_FILE = "/etc/kici-agent.env";
|
|
13
14
|
const DEFAULT_AGENT_IMAGE = "quay.io/kici-dev/kici-agent:latest";
|
|
14
15
|
/**
|
|
15
|
-
* The credential
|
|
16
|
-
*
|
|
17
|
-
* the token directly (the ONLY place the token appears).
|
|
16
|
+
* The credential env lines: the single-use claim code the agent exchanges for
|
|
17
|
+
* its own token in-instance, plus the identity the exchange is made under.
|
|
18
18
|
*/
|
|
19
19
|
function credentialEnvLines(creds) {
|
|
20
|
-
if ("claimCode" in creds) return [
|
|
21
|
-
`KICI_ORCHESTRATOR_URL=${creds.orchestratorUrl}`,
|
|
22
|
-
`KICI_SCALER_CLAIM_CODE=${creds.claimCode}`,
|
|
23
|
-
`KICI_AGENT_ID=${creds.agentId}`,
|
|
24
|
-
`KICI_LABELS=${creds.labels.join(",")}`
|
|
25
|
-
];
|
|
26
20
|
return [
|
|
27
21
|
`KICI_ORCHESTRATOR_URL=${creds.orchestratorUrl}`,
|
|
28
|
-
`
|
|
22
|
+
`KICI_SCALER_CLAIM_CODE=${creds.claimCode}`,
|
|
29
23
|
`KICI_AGENT_ID=${creds.agentId}`,
|
|
30
24
|
`KICI_LABELS=${creds.labels.join(",")}`
|
|
31
25
|
];
|
|
32
26
|
}
|
|
33
|
-
/** Render the agent env-file content (the ONLY place the
|
|
27
|
+
/** Render the agent env-file content (the ONLY place the claim code appears). */
|
|
34
28
|
function renderEnvFileContent(creds, agentEnv) {
|
|
35
29
|
return `${[
|
|
36
30
|
...credentialEnvLines(creds),
|
|
@@ -81,9 +75,9 @@ function renderStartCommand(opts) {
|
|
|
81
75
|
return `docker run -d --restart=no --name kici-agent --network host --env-file ${AGENT_ENV_FILE} ${image}`;
|
|
82
76
|
}
|
|
83
77
|
/**
|
|
84
|
-
* Build the cloud-config `user_data` string.
|
|
85
|
-
*
|
|
86
|
-
*
|
|
78
|
+
* Build the cloud-config `user_data` string. The claim code appears only in the
|
|
79
|
+
* reserved env-file write entry (`0600`, root-only), and the agent token the
|
|
80
|
+
* instance exchanges it for stays off the provisioning channel entirely.
|
|
87
81
|
*/
|
|
88
82
|
function buildAgentCloudInit(creds, options) {
|
|
89
83
|
validateAgentEnv(options.agentEnv);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { describe, expectTypeOf, it } from "vitest";
|
|
3
|
+
//#region src/agent-cloud-init.test-d.ts
|
|
4
|
+
describe("AgentCloudInitCredentials", () => {
|
|
5
|
+
it("rejects the removed agent-token credentials form", () => {
|
|
6
|
+
expectTypeOf({
|
|
7
|
+
agentToken: "t",
|
|
8
|
+
agentId: "a",
|
|
9
|
+
orchestratorUrl: "u",
|
|
10
|
+
labels: []
|
|
11
|
+
}).toBeObject();
|
|
12
|
+
});
|
|
13
|
+
it("is exactly the claim-code form", () => {
|
|
14
|
+
expectTypeOf().toEqualTypeOf();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export {};
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=agent-cloud-init.test-d.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { defineEvent } from "./define-event.js";
|
|
3
|
-
import { z } from "zod";
|
|
4
3
|
import { describe, expectTypeOf, it } from "vitest";
|
|
4
|
+
import { z } from "zod";
|
|
5
5
|
//#region src/events/emit-typing.test-d.ts
|
|
6
6
|
const deployComplete = defineEvent("deploy-complete", z.object({
|
|
7
7
|
env: z.string(),
|
package/dist/index.d.ts
CHANGED
|
@@ -2,23 +2,15 @@ export { step } from './step.js';
|
|
|
2
2
|
export { job } from './job.js';
|
|
3
3
|
export { workflow } from './workflow.js';
|
|
4
4
|
export { parallel, isParallelGroup } from './parallel.js';
|
|
5
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
6
|
-
export { flattenStepInputs } from './parallel.js';
|
|
7
5
|
export type { ParallelGroup, ParallelOptions } from './parallel.js';
|
|
8
6
|
export { invokeSource } from './invoke.js';
|
|
9
7
|
export type { InvokeConfig } from './invoke.js';
|
|
10
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
11
|
-
export { normalizeApproval } from './approval.js';
|
|
12
8
|
export type { ApprovalConfig, ApprovalWhen, ApproverClause, NormalizedApproval, } from './approval.js';
|
|
13
9
|
export { pr, push, tag, comment, review, reviewComment, release, dispatch, create, delete as delete, status, workflowRun, fork, star, watch, webhook, kiciEvent, workflowComplete, workflowsFailedBatch, jobComplete, genericWebhook, schedule, lifecycle, defineDispatchInputs, } from './triggers/index.js';
|
|
14
10
|
export type { DefinedDispatchInputs, InferDispatchInputs, DispatchInputsMap, TriggerConfig, PrTriggerConfig, PushTriggerConfig, TagTriggerConfig, CommentTriggerConfig, ReviewTriggerConfig, ReviewCommentTriggerConfig, ReleaseTriggerConfig, DispatchTriggerConfig, CreateTriggerConfig, DeleteTriggerConfig, StatusTriggerConfig, WorkflowRunTriggerConfig, ForkTriggerConfig, StarTriggerConfig, WatchTriggerConfig, WebhookTriggerConfig, BranchPattern, BodyMatchPattern, PrEvent, PushEvent, PrConfigInput, PushConfigInput, TagConfigInput, CommentConfigInput, CommentAction, CommentSource, ReviewConfigInput, ReviewAction, ReviewState, ReviewCommentConfigInput, ReviewCommentAction, ReleaseConfigInput, ReleaseAction, DispatchConfigInput, CreateConfigInput, DeleteConfigInput, RefType, StatusConfigInput, StatusState, WorkflowRunConfigInput, WorkflowRunAction, ForkConfigInput, StarConfigInput, StarAction, WatchConfigInput, WatchAction, WebhookConfigInput, KiciEventConfigInput, KiciEventTriggerConfig, WorkflowCompleteConfigInput, WorkflowCompleteTriggerConfig, WorkflowCompleteStatus, WorkflowsFailedBatchConfigInput, WorkflowsFailedBatchTriggerConfig, JobCompleteConfigInput, JobCompleteTriggerConfig, JobCompleteStatus, GenericWebhookConfigInput, GenericWebhookTriggerConfig, GenericWebhookAuthMethod, GenericWebhookHmacAuth, GenericWebhookApiKeyAuth, GenericWebhookAuth, ScheduleConfigInput, ScheduleTriggerConfig, LifecycleEvent, LifecycleConfigInput, LifecycleTriggerConfig, } from './triggers/index.js';
|
|
15
11
|
export { onCancel, cleanup, onSuccess, onFailure, beforeStep, afterStep } from './hooks/index.js';
|
|
16
12
|
export type { HookConfig, HookFn, HookInput, HookContext, OutcomeMetadata } from './hooks/index.js';
|
|
17
13
|
export { rule, skip, onlyOnFirstHost, onlyOnLastHost, onlyOnFanoutIndex } from './rules/index.js';
|
|
18
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
19
|
-
export { evaluateRules } from './rules/index.js';
|
|
20
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
21
|
-
export { createRuleContext } from './rules/index.js';
|
|
22
14
|
export { ChangedFilesUnavailableError } from './rules/index.js';
|
|
23
15
|
export type { CreateRuleContextInput } from './rules/index.js';
|
|
24
16
|
export { isEventType } from './rules/index.js';
|
|
@@ -28,12 +20,8 @@ export type { DagNode, DagValidationResult } from './validation/index.js';
|
|
|
28
20
|
export type { SourceLocation, OutputProxy, Step, StepOptions, StepOptionsBase, StepOptionsPlain, StepOptionsWithCheck, StepRunFn, RetryConfig, NormalizedRetry, BareStepFn, StepInput, OutputSchema, InferOutputs, Job, JobOptions, GenericInitConfig, MiseInitConfig, InitPreset, InitItem, InitConfig, ContainerConfig, RunsOnSelector, RunsOn, RunsOnPick, Workflow, WorkflowOptions, Registry, Trigger, DynamicJobFn, DynamicJobContext, JobOrFactory, } from './types.js';
|
|
29
21
|
export { isDynamicJobFn, dynamicJob, getDynamicJobGroup, getDynamicJobNeeds, getDynamicJobGitCredentials, DYNAMIC_JOB_GROUP_TAG, DYNAMIC_JOB_NEEDS_TAG, DYNAMIC_JOB_GIT_CREDENTIALS_TAG, } from './types.js';
|
|
30
22
|
export type { TaggedDynamicJobFn, ResultAwareDynamicJobConfig, ResultAwareDynamicJobFn, DynamicJobNeed, NeedsWhen, NeedsWhenInput, } from './types.js';
|
|
31
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
32
|
-
export { buildNeedsContext } from './needs-context.js';
|
|
33
23
|
export type { UpstreamSnapshot, NeedsContext, NeedEntry, GroupNeedEntry, InvokeNeedEntry, InvokeResult, } from './needs-context.js';
|
|
34
24
|
export { CacheSpecSchema } from './cache-types.js';
|
|
35
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
36
|
-
export { normalizeCacheSpecs } from './cache-types.js';
|
|
37
25
|
export type { CacheSpec, CacheInput } from './cache-types.js';
|
|
38
26
|
export type { CacheRestoreResult, CacheApi } from './cache-types.js';
|
|
39
27
|
export { ArtifactNameSchema, ARTIFACT_NAME_MAX_LENGTH } from './artifacts-types.js';
|
|
@@ -45,25 +33,15 @@ export type { DynamicGroupRef } from './dynamic-group.js';
|
|
|
45
33
|
export type { StepContext, Logger, WorkflowInfo, JobInfo, AgentInfo, MatrixJobOutputs, HostJobOutputs, RepoInfo, StepSecretsTyped, KnownSecretKeys, } from './context.js';
|
|
46
34
|
export { isMatrixJobOutputs, isHostJobOutputs } from './context.js';
|
|
47
35
|
export type { FilterContext, FilterFn } from './filter.js';
|
|
48
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
49
|
-
export { createFilterContext } from './filter-context.js';
|
|
50
36
|
export type { CreateFilterContextInput } from './filter-context.js';
|
|
51
37
|
export type { FanoutPosition } from './fanout-context.js';
|
|
52
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
53
|
-
export { buildKiciApi } from './api-types.js';
|
|
54
38
|
export type { KiciApi, KiciApiTransport, InfrastructureApi, InfrastructureListResult, InventoryApi, HostApi, HostInventoryEntry, InventorySelector, } from './api-types.js';
|
|
55
39
|
export { SecretNotFoundError } from './errors.js';
|
|
56
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
57
|
-
export { createStepSecrets } from './secrets.js';
|
|
58
40
|
export type { StepSecrets, TrackedStepSecrets, SecretMeta, SecretFileOptions, MountedFile, StepSecretsFileHost, StepSecretsFileWiring, StepSecretsHandle, StepSecretMountKind, StepSecretMountRecord, } from './secrets.js';
|
|
59
41
|
export { createStepOutputProxy, createJobOutputProxy, createSnapshotOutputProxy, resolveStepOutputs, resolveJobOutputs, getStepOutputsMap, getJobOutputsMap, getStepRefMap, } from './outputs.js';
|
|
60
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
61
|
-
export { setStepOutputsMap, setJobOutputsMap, setStepRefMap } from './outputs.js';
|
|
62
42
|
export type { OutputsMap, StepRefMap } from './outputs.js';
|
|
63
43
|
export type { StaticMatrixArray, StaticMatrixObject, DynamicMatrixFn, DynamicMatrixContext, Matrix, MatrixInclude, MatrixExclude, MatrixValues, } from './matrix/index.js';
|
|
64
44
|
export { isStaticArray, isStaticObject, isDynamicFunction } from './matrix/index.js';
|
|
65
|
-
/** @deprecated Moved to `@kici-dev/sdk/internal` — internal runtime API, not covered by semver. */
|
|
66
|
-
export { expandMatrix, applyIncludeExclude } from './matrix/index.js';
|
|
67
45
|
export { defineEvent, isEventDefinition } from './events/index.js';
|
|
68
46
|
export type { EventDefinition } from './events/index.js';
|
|
69
47
|
export type { EventEmitOptions } from './events/index.js';
|
|
@@ -80,7 +58,7 @@ export type { AgentVersionConvergeOptions, AgentVersionDrift, } from './fleet/ag
|
|
|
80
58
|
export { z } from 'zod';
|
|
81
59
|
export { SCALER_EVENT_NAMES, ScaleDownReason, ScalerScaleUpPayload, ScalerScaleDownPayload, } from '@kici-dev/engine';
|
|
82
60
|
export { buildAgentCloudInit } from './agent-cloud-init.js';
|
|
83
|
-
export type {
|
|
61
|
+
export type { ClaimCodeCredentials, AgentCloudInitCredentials, AgentDeliveryMode, UserDataEncoding, CloudInitWriteFile, AgentCloudInitOptions, } from './agent-cloud-init.js';
|
|
84
62
|
export { assertSecretName } from './git-types.js';
|
|
85
63
|
export type { ForgeName, GitHubPermissions, WriteOptions, GitGrant, Sourced, ContainerRegistryAuth, GitCredentialRef, GitCredentialMap, RepoHandle, GitTokenResult, GitHubApi, GitApi, } from './git-types.js';
|
|
86
64
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { buildAgentCloudInit } from "./agent-cloud-init.js";
|
|
3
|
-
import { buildKiciApi } from "./api-types.js";
|
|
4
|
-
import { normalizeApproval } from "./approval.js";
|
|
5
3
|
import { ARTIFACT_NAME_MAX_LENGTH, ArtifactNameSchema } from "./artifacts-types.js";
|
|
6
|
-
import { CacheSpecSchema
|
|
4
|
+
import { CacheSpecSchema } from "./cache-types.js";
|
|
7
5
|
import { isHostJobOutputs, isMatrixJobOutputs } from "./context.js";
|
|
8
6
|
import { DYNAMIC_GROUP_TAG, dynamicGroup, isDynamicGroupRef } from "./dynamic-group.js";
|
|
9
7
|
import { SecretNotFoundError } from "./errors.js";
|
|
10
8
|
import { ChangedFilesUnavailableError } from "./rules/changed-files.js";
|
|
11
|
-
import { createFilterContext } from "./filter-context.js";
|
|
12
9
|
import { workflow } from "./workflow.js";
|
|
13
|
-
import { createJobOutputProxy, createSnapshotOutputProxy, createStepOutputProxy, getJobOutputsMap, getStepOutputsMap, getStepRefMap, resolveJobOutputs, resolveStepOutputs
|
|
10
|
+
import { createJobOutputProxy, createSnapshotOutputProxy, createStepOutputProxy, getJobOutputsMap, getStepOutputsMap, getStepRefMap, resolveJobOutputs, resolveStepOutputs } from "./outputs.js";
|
|
14
11
|
import { assertSecretName } from "./git-types.js";
|
|
15
12
|
import { job } from "./job.js";
|
|
16
13
|
import { step } from "./step.js";
|
|
@@ -18,7 +15,7 @@ import { fixture } from "./fixture.js";
|
|
|
18
15
|
import { WaitForTimeoutError, waitFor, waitForStep } from "./wait-for.js";
|
|
19
16
|
import { restartHost, waitForHostAlive } from "./host-restart.js";
|
|
20
17
|
import { checkStep, idempotent, idempotentStep } from "./idempotent.js";
|
|
21
|
-
import {
|
|
18
|
+
import { isParallelGroup, parallel } from "./parallel.js";
|
|
22
19
|
import { invokeSource } from "./invoke.js";
|
|
23
20
|
import { pr } from "./triggers/pr.js";
|
|
24
21
|
import { push } from "./triggers/push.js";
|
|
@@ -47,22 +44,17 @@ import { defineDispatchInputs } from "./triggers/dispatch-inputs.js";
|
|
|
47
44
|
import "./triggers/index.js";
|
|
48
45
|
import { afterStep, beforeStep, cleanup, onCancel, onFailure, onSuccess } from "./hooks/index.js";
|
|
49
46
|
import { onlyOnFanoutIndex, onlyOnFirstHost, onlyOnLastHost, rule, skip } from "./rules/rule.js";
|
|
50
|
-
import { createRuleContext } from "./rules/context.js";
|
|
51
|
-
import { evaluateRules } from "./rules/evaluator.js";
|
|
52
47
|
import { isEventType } from "./events/event-payloads.js";
|
|
53
48
|
import "./rules/index.js";
|
|
54
49
|
import { validateDag } from "./validation/dag.js";
|
|
55
50
|
import "./validation/index.js";
|
|
56
51
|
import { DYNAMIC_JOB_GIT_CREDENTIALS_TAG, DYNAMIC_JOB_GROUP_TAG, DYNAMIC_JOB_NEEDS_TAG, dynamicJob, getDynamicJobGitCredentials, getDynamicJobGroup, getDynamicJobNeeds, isDynamicJobFn } from "./types.js";
|
|
57
|
-
import { buildNeedsContext } from "./needs-context.js";
|
|
58
52
|
import { provenanceSubjectIsPath } from "./provenance-types.js";
|
|
59
|
-
import { createStepSecrets } from "./secrets.js";
|
|
60
53
|
import { isDynamicFunction, isStaticArray, isStaticObject } from "./matrix/types.js";
|
|
61
|
-
import { applyIncludeExclude, expandMatrix } from "./matrix/expand.js";
|
|
62
54
|
import "./matrix/index.js";
|
|
63
55
|
import { defineEvent, isEventDefinition } from "./events/define-event.js";
|
|
64
56
|
import "./events/index.js";
|
|
65
57
|
import { agentVersionConverge } from "./fleet/agent-version-converge.js";
|
|
66
58
|
import { SCALER_EVENT_NAMES, ScaleDownReason, ScalerScaleDownPayload, ScalerScaleUpPayload } from "@kici-dev/engine";
|
|
67
59
|
import { z } from "zod";
|
|
68
|
-
export { ARTIFACT_NAME_MAX_LENGTH, ArtifactNameSchema, CacheSpecSchema, ChangedFilesUnavailableError, DYNAMIC_GROUP_TAG, DYNAMIC_JOB_GIT_CREDENTIALS_TAG, DYNAMIC_JOB_GROUP_TAG, DYNAMIC_JOB_NEEDS_TAG, SCALER_EVENT_NAMES, ScaleDownReason, ScalerScaleDownPayload, ScalerScaleUpPayload, SecretNotFoundError, WaitForTimeoutError, afterStep, agentVersionConverge,
|
|
60
|
+
export { ARTIFACT_NAME_MAX_LENGTH, ArtifactNameSchema, CacheSpecSchema, ChangedFilesUnavailableError, DYNAMIC_GROUP_TAG, DYNAMIC_JOB_GIT_CREDENTIALS_TAG, DYNAMIC_JOB_GROUP_TAG, DYNAMIC_JOB_NEEDS_TAG, SCALER_EVENT_NAMES, ScaleDownReason, ScalerScaleDownPayload, ScalerScaleUpPayload, SecretNotFoundError, WaitForTimeoutError, afterStep, agentVersionConverge, assertSecretName, beforeStep, buildAgentCloudInit, checkStep, cleanup, comment, create, createJobOutputProxy, createSnapshotOutputProxy, createStepOutputProxy, defineDispatchInputs, defineEvent, del as delete, dispatch, dynamicGroup, dynamicJob, fixture, fork, genericWebhook, getDynamicJobGitCredentials, getDynamicJobGroup, getDynamicJobNeeds, getJobOutputsMap, getStepOutputsMap, getStepRefMap, idempotent, idempotentStep, invokeSource, isDynamicFunction, isDynamicGroupRef, isDynamicJobFn, isEventDefinition, isEventType, isHostJobOutputs, isMatrixJobOutputs, isParallelGroup, isStaticArray, isStaticObject, job, jobComplete, kiciEvent, lifecycle, onCancel, onFailure, onSuccess, onlyOnFanoutIndex, onlyOnFirstHost, onlyOnLastHost, parallel, pr, provenanceSubjectIsPath, push, release, resolveJobOutputs, resolveStepOutputs, restartHost, review, reviewComment, rule, schedule, skip, star, status, step, tag, validateDag, waitFor, waitForHostAlive, waitForStep, watch, webhook, workflow, workflowComplete, workflowRun, workflowsFailedBatch, z };
|
package/dist/internal.d.ts
CHANGED
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
* dual-shape window — for a function no customer ever called. Every internal
|
|
16
16
|
* refactor of the runtime would pay the public-API tax forever.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* These symbols live only here. The agent and the compiler test runner resolve
|
|
19
|
+
* the customer's own SDK copy at run time (`workflow-loader.ts`,
|
|
20
|
+
* `job-executor.ts`) through this subpath, so an SDK that predates it cannot
|
|
21
|
+
* drive a workflow on a current agent.
|
|
22
22
|
*
|
|
23
23
|
* Do not import this from a workflow. It carries no compatibility promise and
|
|
24
24
|
* may change shape in any release.
|
package/dist/internal.js
CHANGED
|
@@ -8,8 +8,8 @@ import { flattenStepInputs } from "./parallel.js";
|
|
|
8
8
|
import { createRuleContext } from "./rules/context.js";
|
|
9
9
|
import { evaluateRules } from "./rules/evaluator.js";
|
|
10
10
|
import "./rules/index.js";
|
|
11
|
-
import { buildNeedsContext } from "./needs-context.js";
|
|
12
|
-
import { createStepSecrets } from "./secrets.js";
|
|
13
11
|
import { applyIncludeExclude, expandMatrix } from "./matrix/expand.js";
|
|
14
12
|
import "./matrix/index.js";
|
|
13
|
+
import { buildNeedsContext } from "./needs-context.js";
|
|
14
|
+
import { createStepSecrets } from "./secrets.js";
|
|
15
15
|
export { applyIncludeExclude, buildKiciApi, buildNeedsContext, createFilterContext, createRuleContext, createStepSecrets, evaluateRules, expandMatrix, flattenStepInputs, normalizeApproval, normalizeCacheSpecs, setJobOutputsMap, setStepOutputsMap, setStepRefMap };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { resolveJobOutputs, resolveStepOutputs } from "../outputs.js";
|
|
3
|
-
import { createStepSecrets } from "../secrets.js";
|
|
4
3
|
import { isEventDefinition } from "../events/define-event.js";
|
|
4
|
+
import { createStepSecrets } from "../secrets.js";
|
|
5
5
|
import { $ } from "zx";
|
|
6
6
|
import { initZx } from "@kici-dev/core";
|
|
7
7
|
import { chmodSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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",
|
|
@@ -57,18 +57,18 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"micromatch": "^4.0.8",
|
|
60
|
-
"yaml": "^2.9.
|
|
61
|
-
"zod": "^4.
|
|
60
|
+
"yaml": "^2.9.1",
|
|
61
|
+
"zod": "^4.6.5",
|
|
62
62
|
"zx": "^8.8.5",
|
|
63
|
-
"@kici-dev/core": "0.
|
|
64
|
-
"@kici-dev/engine": "0.
|
|
63
|
+
"@kici-dev/core": "0.9.0",
|
|
64
|
+
"@kici-dev/engine": "0.9.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/micromatch": "^4.0.10"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
|
-
"build": "node ../../scripts/build-ts.mjs &&
|
|
71
|
-
"typecheck": "
|
|
70
|
+
"build": "node ../../scripts/build-ts.mjs && tsc --emitDeclarationOnly",
|
|
71
|
+
"typecheck": "tsc --noEmit",
|
|
72
72
|
"test": "vitest run",
|
|
73
73
|
"test:watch": "vitest"
|
|
74
74
|
}
|