@kici-dev/engine 0.1.27 → 0.3.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/approval/types.d.ts +8 -1
- package/dist/approval/types.js +8 -1
- package/dist/artifacts/name.d.ts +60 -0
- package/dist/artifacts/name.js +71 -0
- package/dist/audit/access-log-policy.d.ts +1 -1
- package/dist/audit/access-log-policy.js +8 -0
- package/dist/audit/activity.d.ts +12 -12
- package/dist/audit/retention-policy.js +16 -0
- package/dist/billing/plan-type.d.ts +53 -0
- package/dist/billing/plan-type.js +70 -0
- package/dist/bundler/rolldown-config.d.ts +3 -3
- package/dist/check-mode.d.ts +1 -1
- package/dist/context/concurrency-strategy.d.ts +34 -0
- package/dist/context/concurrency-strategy.js +35 -0
- package/dist/context/held-run-job-id.d.ts +45 -0
- package/dist/context/held-run-job-id.js +56 -0
- package/dist/context/held-run-status.d.ts +33 -0
- package/dist/context/held-run-status.js +37 -0
- package/dist/context/hold-expiry.d.ts +20 -0
- package/dist/context/hold-expiry.js +25 -0
- package/dist/context/hold-reason.d.ts +33 -0
- package/dist/context/hold-reason.js +23 -0
- package/dist/context/hold-type.d.ts +40 -0
- package/dist/context/hold-type.js +61 -0
- package/dist/context/index.d.ts +9 -1
- package/dist/context/index.js +9 -2
- package/dist/context/multi-context.d.ts +3 -3
- package/dist/context/scope-name.d.ts +29 -0
- package/dist/context/scope-name.js +49 -0
- package/dist/context/scope-resolver.d.ts +33 -0
- package/dist/context/scope-resolver.js +45 -15
- package/dist/context/types.d.ts +8 -5
- package/dist/dev-ops/operations.d.ts +8 -0
- package/dist/dev-ops/operations.js +36 -19
- package/dist/diagnostics/infra-alert.d.ts +71 -0
- package/dist/diagnostics/infra-alert.js +60 -0
- package/dist/env/environment-allowlist.d.ts +4 -4
- package/dist/fanout/materialize.d.ts +16 -0
- package/dist/fanout/materialize.js +32 -3
- package/dist/index.d.ts +15 -6
- package/dist/index.js +34 -19
- package/dist/inputs/descriptor.d.ts +9 -9
- package/dist/inventory.d.ts +4 -4
- package/dist/labels.d.ts +82 -2
- package/dist/labels.js +119 -1
- package/dist/matrix/expand.d.ts +49 -2
- package/dist/matrix/expand.js +102 -13
- package/dist/matrix/format.d.ts +6 -1
- package/dist/matrix/format.js +6 -1
- package/dist/mcp/held-run-resolve.d.ts +7 -10
- package/dist/mcp/held-run-resolve.js +33 -7
- package/dist/metrics/catalog-policy.js +4 -4
- package/dist/metrics/metric-catalog.generated.d.ts +959 -739
- package/dist/metrics/metric-catalog.generated.js +284 -20
- package/dist/metrics/metric-kind-compat.d.ts +26 -0
- package/dist/metrics/metric-kind-compat.js +33 -0
- package/dist/protocol/analytics-events.d.ts +6 -6
- package/dist/protocol/dashboard-api-errors.d.ts +1 -0
- package/dist/protocol/dashboard-api-errors.js +5 -1
- package/dist/protocol/dashboard-write-operations.d.ts +143 -86
- package/dist/protocol/dashboard-write-operations.js +91 -17
- package/dist/protocol/messages/access-log.d.ts +437 -392
- package/dist/protocol/messages/access-log.js +11 -2
- package/dist/protocol/messages/actor.d.ts +2 -2
- package/dist/protocol/messages/agent-dev-ops.d.ts +4 -2
- package/dist/protocol/messages/agent-dev-ops.js +2 -5
- package/dist/protocol/messages/agent-run-result.d.ts +72 -62
- package/dist/protocol/messages/auth.d.ts +35 -23
- package/dist/protocol/messages/browser.d.ts +81 -5
- package/dist/protocol/messages/browser.js +53 -2
- package/dist/protocol/messages/capabilities.d.ts +106 -31
- package/dist/protocol/messages/capabilities.js +94 -10
- package/dist/protocol/messages/common.d.ts +45 -2
- package/dist/protocol/messages/common.js +64 -3
- package/dist/protocol/messages/dashboard-sealed-write.d.ts +52 -0
- package/dist/protocol/messages/dashboard-sealed-write.js +57 -0
- package/dist/protocol/messages/dashboard.d.ts +1026 -498
- package/dist/protocol/messages/dashboard.js +208 -31
- package/dist/protocol/messages/deployment-identity.d.ts +37 -10
- package/dist/protocol/messages/deployment-identity.js +30 -3
- package/dist/protocol/messages/event-log.d.ts +5 -5
- package/dist/protocol/messages/execution-status.d.ts +189 -53
- package/dist/protocol/messages/execution-status.js +108 -40
- package/dist/protocol/messages/heartbeat-health.d.ts +83 -0
- package/dist/protocol/messages/heartbeat-health.js +87 -0
- package/dist/protocol/messages/log-stream.d.ts +18 -0
- package/dist/protocol/messages/log-stream.js +19 -0
- package/dist/protocol/messages/oidc-mint.d.ts +7 -0
- package/dist/protocol/messages/oidc-mint.js +7 -0
- package/dist/protocol/messages/orchestrator-agent.d.ts +264 -67
- package/dist/protocol/messages/orchestrator-agent.js +170 -5
- package/dist/protocol/messages/pat-kind.d.ts +1 -1
- package/dist/protocol/messages/peer.d.ts +122 -58
- package/dist/protocol/messages/peer.js +37 -2
- package/dist/protocol/messages/platform-orchestrator.d.ts +561 -217
- package/dist/protocol/messages/platform-orchestrator.js +131 -21
- package/dist/protocol/messages/run-events.d.ts +5 -5
- package/dist/protocol/messages/scaler-event.d.ts +3 -3
- package/dist/protocol/messages/source-registration.d.ts +56 -13
- package/dist/protocol/messages/source-registration.js +49 -6
- package/dist/protocol/source-origin.d.ts +1 -1
- package/dist/provenance/attestation-origin.d.ts +1 -1
- package/dist/provenance/schema.d.ts +11 -11
- package/dist/provenance/verify.js +2 -1
- package/dist/provider/changed-files-fetcher.d.ts +21 -2
- package/dist/provider/check-run-conclusion.d.ts +2 -2
- package/dist/provider/check-status-poster.d.ts +23 -0
- package/dist/provider/index.d.ts +2 -2
- package/dist/registration/registerable-trigger-type.d.ts +14 -13
- package/dist/registration/registerable-trigger-type.js +1 -0
- package/dist/sandbox/capabilities.d.ts +6 -0
- package/dist/sandbox/capabilities.js +57 -0
- package/dist/scaler/scaler-backend-type.d.ts +1 -1
- package/dist/status/presentation.d.ts +89 -0
- package/dist/status/presentation.js +163 -0
- package/dist/trigger/compiled-matchers.d.ts +13 -0
- package/dist/trigger/compiled-matchers.js +44 -0
- package/dist/trigger/event-buckets.d.ts +44 -0
- package/dist/trigger/event-buckets.js +93 -0
- package/dist/trigger/matcher.d.ts +7 -3
- package/dist/trigger/matcher.js +53 -15
- package/dist/trigger/schedule-key.d.ts +14 -0
- package/dist/trigger/schedule-key.js +21 -0
- package/dist/trigger/trigger-event-type.d.ts +1 -1
- package/dist/trigger/trigger-event-type.js +2 -0
- package/dist/trigger/types.d.ts +173 -43
- package/dist/trigger/types.js +82 -25
- package/dist/webhook/event-types.d.ts +56 -0
- package/dist/webhook/event-types.js +59 -0
- package/dist/ws/ws-like.d.ts +13 -0
- package/package.json +12 -4
- package/sbom.spdx.json +10 -10
- package/dist/environment/host-match.d.ts +0 -25
- package/dist/environment/index.d.ts +0 -6
- package/dist/environment/multi-env.d.ts +0 -30
- package/dist/environment/scope-resolver.d.ts +0 -46
- package/dist/environment/scope-template.d.ts +0 -18
- package/dist/environment/types.d.ts +0 -119
- package/dist/package-manager.d.ts +0 -20
- package/dist/protocol/messages/observe.d.ts +0 -76
- package/dist/protocol/messages/saas-orchestrator.d.ts +0 -2179
- package/dist/protocol/messages/test-run.d.ts +0 -59
- package/dist/state-machine/index.d.ts +0 -2
- package/dist/state-machine/index.js +0 -3
- package/dist/state-machine/machine.d.ts +0 -34
- package/dist/state-machine/machine.js +0 -103
- package/dist/state-machine/types.d.ts +0 -34
- package/dist/state-machine/types.js +0 -15
package/dist/trigger/types.js
CHANGED
|
@@ -1,33 +1,62 @@
|
|
|
1
1
|
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { ExecutionJobStatus, TERMINAL_JOB_STATES } from "../protocol/messages/execution-status.js";
|
|
3
|
+
import { isFailureStatus } from "../status/presentation.js";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
//#region src/trigger/types.ts
|
|
5
6
|
/**
|
|
6
7
|
* Lock file types for the trigger matching engine.
|
|
7
8
|
* Single source of truth -- replaces local copies in @kici-dev/compiler and @kici-dev/orchestrator.
|
|
8
|
-
*
|
|
9
|
+
*
|
|
10
|
+
* Bump-history convention: every entry is annotated `additive` (older readers
|
|
11
|
+
* tolerate the new lock because unknown fields are ignored) or `BREAKING` (an
|
|
12
|
+
* older reader would mis-parse the lock). Every `BREAKING` bump moves
|
|
13
|
+
* `BREAKING_FLOOR` (below) to that version in the SAME commit.
|
|
14
|
+
*
|
|
15
|
+
* Schema version 4 (additive): adds 4 internal event routing trigger types (kici_event, workflow_complete,
|
|
9
16
|
* job_complete, generic_webhook).
|
|
10
|
-
* Schema version 6: replaces job-level contexts with environment/env/concurrencyGroup.
|
|
11
|
-
* Schema version 8: adds runsOn polymorphic type (string | string[] | selector) and excludeLabels.
|
|
12
|
-
* Schema version 9: adds repos/notRepos repo pattern fields to git-event triggers for global workflow matching.
|
|
13
|
-
* Schema version 10: removes notRepos/notPaths fields, negative patterns use ! prefix in repos/paths arrays.
|
|
14
|
-
* Schema version 11: adds LockInlineValue type for pure function inline evaluation.
|
|
15
|
-
* Schema version 14: adds declarative cache specs to LockJob and LockStep.
|
|
16
|
-
* Schema version 15: adds per-job init config(s) to LockJob.
|
|
17
|
-
* Schema version 16: adds normalized approval config to LockWorkflow/LockJob/LockStep.
|
|
18
|
-
* Schema version 17: widens LockJob.init to typed presets ('mise' / { mise }) and 'auto' detection.
|
|
19
|
-
* Schema version 18: adds LockJob.runsOnAll host fan-out predicate + onUnreachable policy.
|
|
20
|
-
* Schema version 19: adds LockJob.maxParallel/failFast fan-out concurrency (rolling waves).
|
|
21
|
-
* Schema version 20: runsOn/runsOnAll/excludeLabels carry LabelMatcher (exact|regex) for glob+regex selectors.
|
|
22
|
-
* Schema version 23: adds LockDispatchTrigger.inputs (typed dispatch inputs descriptors).
|
|
23
|
-
* Schema version 24: adds LockJob.runsOnPick (deterministic single-host selection).
|
|
24
|
-
* Schema version 25: adds LockStep.retry (step retry policy data subset; retryIf is execution-only).
|
|
25
|
-
* Schema version 26: adds LockJob.includeUninitialized (runsOnAll fans out to declared-but-un-agented hosts, bringing up a temporary init-runner per fresh box).
|
|
26
|
-
* Schema version 27: adds LockScheduleTrigger.inputs (defaults-only schedule dispatch inputs).
|
|
27
|
-
* Schema version 30: renames job-level `environments` to `contexts`.
|
|
17
|
+
* Schema version 6 (BREAKING): replaces job-level contexts with environment/env/concurrencyGroup.
|
|
18
|
+
* Schema version 8 (additive): adds runsOn polymorphic type (string | string[] | selector) and excludeLabels.
|
|
19
|
+
* Schema version 9 (additive): adds repos/notRepos repo pattern fields to git-event triggers for global workflow matching.
|
|
20
|
+
* Schema version 10 (BREAKING): removes notRepos/notPaths fields, negative patterns use ! prefix in repos/paths arrays.
|
|
21
|
+
* Schema version 11 (additive): adds LockInlineValue type for pure function inline evaluation.
|
|
22
|
+
* Schema version 14 (additive): adds declarative cache specs to LockJob and LockStep.
|
|
23
|
+
* Schema version 15 (additive): adds per-job init config(s) to LockJob.
|
|
24
|
+
* Schema version 16 (additive): adds normalized approval config to LockWorkflow/LockJob/LockStep.
|
|
25
|
+
* Schema version 17 (additive): widens LockJob.init to typed presets ('mise' / { mise }) and 'auto' detection.
|
|
26
|
+
* Schema version 18 (additive): adds LockJob.runsOnAll host fan-out predicate + onUnreachable policy.
|
|
27
|
+
* Schema version 19 (additive): adds LockJob.maxParallel/failFast fan-out concurrency (rolling waves).
|
|
28
|
+
* Schema version 20 (BREAKING): runsOn/runsOnAll/excludeLabels carry LabelMatcher (exact|regex) for glob+regex selectors.
|
|
29
|
+
* Schema version 23 (additive): adds LockDispatchTrigger.inputs (typed dispatch inputs descriptors).
|
|
30
|
+
* Schema version 24 (additive): adds LockJob.runsOnPick (deterministic single-host selection).
|
|
31
|
+
* Schema version 25 (additive): adds LockStep.retry (step retry policy data subset; retryIf is execution-only).
|
|
32
|
+
* Schema version 26 (additive): adds LockJob.includeUninitialized (runsOnAll fans out to declared-but-un-agented hosts, bringing up a temporary init-runner per fresh box).
|
|
33
|
+
* Schema version 27 (additive): adds LockScheduleTrigger.inputs (defaults-only schedule dispatch inputs).
|
|
34
|
+
* Schema version 30 (BREAKING): renames job-level `environments` to `contexts`.
|
|
35
|
+
* Schema version 31 (additive): adds the workflows_failed_batch lock trigger.
|
|
36
|
+
* Schema version 32 (additive): adds LockJob.sandbox (per-job escape-hatch request).
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Schema version the compiler emits into every lock file. Incremented on ANY
|
|
40
|
+
* schema change (additive or breaking); the bump-history comment above records
|
|
41
|
+
* which. See `BREAKING_FLOOR` for the compatibility-window semantics.
|
|
28
42
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
const SCHEMA_VERSION = 32;
|
|
44
|
+
/**
|
|
45
|
+
* Oldest lock schema version this codebase can still read correctly — the lower
|
|
46
|
+
* bound of the acceptance window.
|
|
47
|
+
*
|
|
48
|
+
* A lock at `schemaVersion >= BREAKING_FLOOR` parses correctly here even if it
|
|
49
|
+
* is newer than `SCHEMA_VERSION` (additive bumps add fields this reader ignores).
|
|
50
|
+
* A lock below the floor was produced by an SDK whose breaking change this
|
|
51
|
+
* reader predates and must be rejected (it would mis-parse silently otherwise).
|
|
52
|
+
*
|
|
53
|
+
* Bump rule: move this to the current `SCHEMA_VERSION` ONLY in the commit that
|
|
54
|
+
* lands a `BREAKING` schema change (see the bump-history convention above). It
|
|
55
|
+
* currently sits at 30 because v30 (`environments`→`contexts`) was the most
|
|
56
|
+
* recent breaking bump; v31 and v32 were additive, so a v30 lock still reads
|
|
57
|
+
* correctly.
|
|
58
|
+
*/
|
|
59
|
+
const BREAKING_FLOOR = 30;
|
|
31
60
|
/** Type guard distinguishing a parallel group from an ordinary lock step. */
|
|
32
61
|
function isLockParallelStep(entry) {
|
|
33
62
|
return entry.kind === "parallel";
|
|
@@ -59,17 +88,22 @@ const WHEN_TO_RUN_ON = {
|
|
|
59
88
|
"on-success": [ExecutionJobStatus.enum.success],
|
|
60
89
|
always: [...TERMINAL_JOB_STATES],
|
|
61
90
|
"on-skip": [ExecutionJobStatus.enum.success, ExecutionJobStatus.enum.skipped],
|
|
62
|
-
"on-failure": [
|
|
91
|
+
"on-failure": [...TERMINAL_JOB_STATES].filter(isFailureStatus)
|
|
63
92
|
};
|
|
64
93
|
/**
|
|
65
94
|
* Resolve the author-facing `when` (keyword sugar | raw status-set | unset) to
|
|
66
95
|
* the normalized status-set. An unset `when` defaults to success-only — the
|
|
67
96
|
* downstream runs only when the upstream succeeded.
|
|
97
|
+
*
|
|
98
|
+
* Always a fresh array. The keyword arm used to hand back the shared
|
|
99
|
+
* `WHEN_TO_RUN_ON` entry itself, so every lock-file edge compiled from the same
|
|
100
|
+
* keyword aliased one array and any caller that sorted or mutated its result
|
|
101
|
+
* silently reordered the keyword's expansion for every other edge.
|
|
68
102
|
*/
|
|
69
103
|
function resolveWhenToRunOn(when) {
|
|
70
104
|
if (when === void 0) return [ExecutionJobStatus.enum.success];
|
|
71
|
-
if (Array.isArray(when)) return when;
|
|
72
|
-
return WHEN_TO_RUN_ON[when];
|
|
105
|
+
if (Array.isArray(when)) return [...when];
|
|
106
|
+
return [...WHEN_TO_RUN_ON[when]];
|
|
73
107
|
}
|
|
74
108
|
/**
|
|
75
109
|
* Needs entry carrying the normalized run-on status-set.
|
|
@@ -112,6 +146,12 @@ const OnUnreachableMode = z.enum([
|
|
|
112
146
|
* - `any`: pick any available agent (load spread).
|
|
113
147
|
*/
|
|
114
148
|
const RunsOnPick = z.enum(["deterministic", "any"]);
|
|
149
|
+
/** Container network posture: 'default' (bridge), 'none' (loopback-only), 'host' (host netns; gated). */
|
|
150
|
+
const SANDBOX_NETWORK_MODES = [
|
|
151
|
+
"default",
|
|
152
|
+
"none",
|
|
153
|
+
"host"
|
|
154
|
+
];
|
|
115
155
|
/** Type guard for static jobs */
|
|
116
156
|
function isLockStaticJob(job) {
|
|
117
157
|
return job._type === "static";
|
|
@@ -120,7 +160,24 @@ function isLockStaticJob(job) {
|
|
|
120
160
|
function isLockDynamicJobFn(job) {
|
|
121
161
|
return job._type === "dynamic";
|
|
122
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Availability of the changed-files list for path-filter evaluation.
|
|
165
|
+
*
|
|
166
|
+
* Distinguishes three states that a bare `string[]` collapses into one:
|
|
167
|
+
* - `skipped` — no trigger has path patterns, so the fetch never ran. Path
|
|
168
|
+
* filters are not evaluated (today's no-fetch fast path).
|
|
169
|
+
* - `fetched` — the fetch succeeded and the list is authoritative; an empty
|
|
170
|
+
* list genuinely means "no files changed" and does NOT match a path filter.
|
|
171
|
+
* - `unavailable` — the diff could not be determined (a provider capability
|
|
172
|
+
* gap such as universal-git PR events, or upstream degradation). Path
|
|
173
|
+
* filters match conservatively so a real change is never silently dropped.
|
|
174
|
+
*/
|
|
175
|
+
const changedFilesStatusSchema = z.enum([
|
|
176
|
+
"fetched",
|
|
177
|
+
"unavailable",
|
|
178
|
+
"skipped"
|
|
179
|
+
]);
|
|
123
180
|
//#endregion
|
|
124
|
-
export { NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, RunsOnPick, SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockParallelStep, isLockStaticJob, resolveWhenToRunOn };
|
|
181
|
+
export { BREAKING_FLOOR, NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, RunsOnPick, SANDBOX_NETWORK_MODES, SCHEMA_VERSION, changedFilesStatusSchema, isLockDynamicJobFn, isLockInlineValue, isLockParallelStep, isLockStaticJob, resolveWhenToRunOn };
|
|
125
182
|
|
|
126
183
|
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared outbound-webhook event-type vocabulary — the single source of truth for
|
|
3
|
+
* the event types a customer can subscribe an endpoint to, consumed by the
|
|
4
|
+
* Platform route validator and the dashboard endpoint-create checkbox list.
|
|
5
|
+
*
|
|
6
|
+
* Pure Zod (browser-safe): the engine barrel re-exports this module and the
|
|
7
|
+
* dashboard imports the barrel, so no Node built-in may appear here.
|
|
8
|
+
*
|
|
9
|
+
* `docs/user/dashboard/settings.md` § Webhooks lists the subscribable types in
|
|
10
|
+
* prose — adding a type here means updating that list in the same change.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
/**
|
|
14
|
+
* The connectivity-check event the test-endpoint button sends. It is not
|
|
15
|
+
* subscribable, and a failed ping never counts toward an endpoint's
|
|
16
|
+
* consecutive-failure budget — a customer probing a not-yet-live receiver must
|
|
17
|
+
* not be able to auto-disable their own endpoint.
|
|
18
|
+
*/
|
|
19
|
+
export declare const PING_EVENT_TYPE = "ping";
|
|
20
|
+
/** Zod enum for the subscribable set — usable directly as a route schema. */
|
|
21
|
+
export declare const SubscribableWebhookEventType: z.ZodEnum<{
|
|
22
|
+
"job.completed": "job.completed";
|
|
23
|
+
"job.failed": "job.failed";
|
|
24
|
+
"job.started": "job.started";
|
|
25
|
+
"run.completed": "run.completed";
|
|
26
|
+
"run.failed": "run.failed";
|
|
27
|
+
"run.started": "run.started";
|
|
28
|
+
}>;
|
|
29
|
+
export type SubscribableWebhookEventType = z.infer<typeof SubscribableWebhookEventType>;
|
|
30
|
+
/**
|
|
31
|
+
* All outbound webhook event types (the Stripe-style envelope `type`, also sent
|
|
32
|
+
* as the X-KiCI-Event header): the subscribable set plus the ping, which is
|
|
33
|
+
* emitted only by the test-endpoint button and is never subscribable.
|
|
34
|
+
*/
|
|
35
|
+
export declare const WebhookEventType: z.ZodEnum<{
|
|
36
|
+
"job.completed": "job.completed";
|
|
37
|
+
"job.failed": "job.failed";
|
|
38
|
+
"job.started": "job.started";
|
|
39
|
+
ping: "ping";
|
|
40
|
+
"run.completed": "run.completed";
|
|
41
|
+
"run.failed": "run.failed";
|
|
42
|
+
"run.started": "run.started";
|
|
43
|
+
}>;
|
|
44
|
+
export type WebhookEventType = z.infer<typeof WebhookEventType>;
|
|
45
|
+
/**
|
|
46
|
+
* Readonly value tuple for iteration (UI checkbox list, tests) — the accepted
|
|
47
|
+
* set of `SubscribableWebhookEventType`, in declaration order.
|
|
48
|
+
*
|
|
49
|
+
* A frozen copy, not `SubscribableWebhookEventType.options`: Zod hands back the
|
|
50
|
+
* validator's own internal array from that getter, so re-exporting it would let
|
|
51
|
+
* any consumer `push` / `sort` the shared vocabulary out from under every other
|
|
52
|
+
* module in the process. `event-types.test.ts` asserts the copy still matches
|
|
53
|
+
* the validator's options.
|
|
54
|
+
*/
|
|
55
|
+
export declare const SUBSCRIBABLE_WEBHOOK_EVENT_TYPES: readonly ("job.completed" | "job.failed" | "job.started" | "run.completed" | "run.failed" | "run.started")[];
|
|
56
|
+
//# sourceMappingURL=event-types.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/webhook/event-types.ts
|
|
4
|
+
/**
|
|
5
|
+
* Shared outbound-webhook event-type vocabulary — the single source of truth for
|
|
6
|
+
* the event types a customer can subscribe an endpoint to, consumed by the
|
|
7
|
+
* Platform route validator and the dashboard endpoint-create checkbox list.
|
|
8
|
+
*
|
|
9
|
+
* Pure Zod (browser-safe): the engine barrel re-exports this module and the
|
|
10
|
+
* dashboard imports the barrel, so no Node built-in may appear here.
|
|
11
|
+
*
|
|
12
|
+
* `docs/user/dashboard/settings.md` § Webhooks lists the subscribable types in
|
|
13
|
+
* prose — adding a type here means updating that list in the same change.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Subscribable webhook event types — the run/job lifecycle events a customer can
|
|
17
|
+
* wire an endpoint to. Written once here; the full `WebhookEventType` enum
|
|
18
|
+
* derives from these plus the non-subscribable ping. Module-private on purpose:
|
|
19
|
+
* `SUBSCRIBABLE_WEBHOOK_EVENT_TYPES` is the one public name for this list, so
|
|
20
|
+
* consumers cannot pick between two spellings of the same vocabulary.
|
|
21
|
+
*/
|
|
22
|
+
const SUBSCRIBABLE_EVENT_VALUES = [
|
|
23
|
+
"run.started",
|
|
24
|
+
"run.completed",
|
|
25
|
+
"run.failed",
|
|
26
|
+
"job.started",
|
|
27
|
+
"job.completed",
|
|
28
|
+
"job.failed"
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* The connectivity-check event the test-endpoint button sends. It is not
|
|
32
|
+
* subscribable, and a failed ping never counts toward an endpoint's
|
|
33
|
+
* consecutive-failure budget — a customer probing a not-yet-live receiver must
|
|
34
|
+
* not be able to auto-disable their own endpoint.
|
|
35
|
+
*/
|
|
36
|
+
const PING_EVENT_TYPE = "ping";
|
|
37
|
+
/** Zod enum for the subscribable set — usable directly as a route schema. */
|
|
38
|
+
const SubscribableWebhookEventType = z.enum(SUBSCRIBABLE_EVENT_VALUES);
|
|
39
|
+
/**
|
|
40
|
+
* All outbound webhook event types (the Stripe-style envelope `type`, also sent
|
|
41
|
+
* as the X-KiCI-Event header): the subscribable set plus the ping, which is
|
|
42
|
+
* emitted only by the test-endpoint button and is never subscribable.
|
|
43
|
+
*/
|
|
44
|
+
const WebhookEventType = z.enum([...SUBSCRIBABLE_EVENT_VALUES, PING_EVENT_TYPE]);
|
|
45
|
+
/**
|
|
46
|
+
* Readonly value tuple for iteration (UI checkbox list, tests) — the accepted
|
|
47
|
+
* set of `SubscribableWebhookEventType`, in declaration order.
|
|
48
|
+
*
|
|
49
|
+
* A frozen copy, not `SubscribableWebhookEventType.options`: Zod hands back the
|
|
50
|
+
* validator's own internal array from that getter, so re-exporting it would let
|
|
51
|
+
* any consumer `push` / `sort` the shared vocabulary out from under every other
|
|
52
|
+
* module in the process. `event-types.test.ts` asserts the copy still matches
|
|
53
|
+
* the validator's options.
|
|
54
|
+
*/
|
|
55
|
+
const SUBSCRIBABLE_WEBHOOK_EVENT_TYPES = Object.freeze([...SUBSCRIBABLE_EVENT_VALUES]);
|
|
56
|
+
//#endregion
|
|
57
|
+
export { PING_EVENT_TYPE, SUBSCRIBABLE_WEBHOOK_EVENT_TYPES, SubscribableWebhookEventType, WebhookEventType };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=event-types.js.map
|
package/dist/ws/ws-like.d.ts
CHANGED
|
@@ -8,5 +8,18 @@ export interface WsLike {
|
|
|
8
8
|
send(data: string | ArrayBuffer): void;
|
|
9
9
|
close(code?: number, reason?: string): void;
|
|
10
10
|
readyState: number;
|
|
11
|
+
/**
|
|
12
|
+
* Bytes queued in the socket's send buffer, when the transport exposes it.
|
|
13
|
+
* The `ws` library socket does; used by the browser fan-out to terminate a
|
|
14
|
+
* slow consumer past a watermark instead of buffering unboundedly in heap.
|
|
15
|
+
* Optional so mock sockets and non-`ws` transports need not provide it.
|
|
16
|
+
*/
|
|
17
|
+
bufferedAmount?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Force-close the underlying socket immediately, when the transport exposes
|
|
20
|
+
* it (the `ws` library socket does). Optional for the same reason as
|
|
21
|
+
* `bufferedAmount`.
|
|
22
|
+
*/
|
|
23
|
+
terminate?(): void;
|
|
11
24
|
}
|
|
12
25
|
//# sourceMappingURL=ws-like.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Shared business logic for the KiCI CI/CD stack: protocol, triggers, state machine, and provider interfaces used by the Platform relay, orchestrator, and compiler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -89,6 +89,10 @@
|
|
|
89
89
|
"import": "./dist/protocol/messages/oidc-token-relay.js",
|
|
90
90
|
"types": "./dist/protocol/messages/oidc-token-relay.d.ts"
|
|
91
91
|
},
|
|
92
|
+
"./protocol/messages/dashboard-sealed-write": {
|
|
93
|
+
"import": "./dist/protocol/messages/dashboard-sealed-write.js",
|
|
94
|
+
"types": "./dist/protocol/messages/dashboard-sealed-write.d.ts"
|
|
95
|
+
},
|
|
92
96
|
"./protocol/messages/oidc-mint": {
|
|
93
97
|
"import": "./dist/protocol/messages/oidc-mint.js",
|
|
94
98
|
"types": "./dist/protocol/messages/oidc-mint.d.ts"
|
|
@@ -120,12 +124,16 @@
|
|
|
120
124
|
"./metrics/catalog-policy": {
|
|
121
125
|
"import": "./dist/metrics/catalog-policy.js",
|
|
122
126
|
"types": "./dist/metrics/catalog-policy.d.ts"
|
|
127
|
+
},
|
|
128
|
+
"./metrics/metric-kind-compat": {
|
|
129
|
+
"import": "./dist/metrics/metric-kind-compat.js",
|
|
130
|
+
"types": "./dist/metrics/metric-kind-compat.d.ts"
|
|
123
131
|
}
|
|
124
132
|
},
|
|
125
133
|
"dependencies": {
|
|
126
134
|
"jose": "^6.1.0",
|
|
127
135
|
"jsonpath-plus": "^10.4.0",
|
|
128
|
-
"picomatch": "^4.0.
|
|
136
|
+
"picomatch": "^4.0.5",
|
|
129
137
|
"safe-regex": "^2.1.1",
|
|
130
138
|
"zod": "^4.4.3"
|
|
131
139
|
},
|
|
@@ -134,8 +142,8 @@
|
|
|
134
142
|
"@types/safe-regex": "^1.1.6"
|
|
135
143
|
},
|
|
136
144
|
"scripts": {
|
|
137
|
-
"build": "node ../../scripts/build-ts.mjs &&
|
|
138
|
-
"typecheck": "
|
|
145
|
+
"build": "node ../../scripts/build-ts.mjs && tsgo --emitDeclarationOnly",
|
|
146
|
+
"typecheck": "tsgo --noEmit",
|
|
139
147
|
"test": "vitest run"
|
|
140
148
|
}
|
|
141
149
|
}
|
package/sbom.spdx.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"spdxVersion": "SPDX-2.3",
|
|
3
3
|
"dataLicense": "CC0-1.0",
|
|
4
4
|
"SPDXID": "SPDXRef-DOCUMENT",
|
|
5
|
-
"name": "@kici-dev/engine@0.
|
|
6
|
-
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.
|
|
5
|
+
"name": "@kici-dev/engine@0.3.0",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.3.0/efa4dc6e-9041-4801-bb71-cb5f0e5d0cc2",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-
|
|
8
|
+
"created": "2026-08-09T01:30:10Z",
|
|
9
9
|
"creators": [
|
|
10
10
|
"Tool: kici-sbom-generator"
|
|
11
11
|
]
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
{
|
|
55
55
|
"SPDXID": "SPDXRef-RootPackage",
|
|
56
56
|
"name": "@kici-dev/engine",
|
|
57
|
-
"versionInfo": "0.
|
|
57
|
+
"versionInfo": "0.3.0",
|
|
58
58
|
"downloadLocation": "NOASSERTION",
|
|
59
59
|
"filesAnalyzed": false,
|
|
60
60
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
{
|
|
66
66
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
67
67
|
"referenceType": "purl",
|
|
68
|
-
"referenceLocator": "pkg:npm/%40kici-dev/engine@0.
|
|
68
|
+
"referenceLocator": "pkg:npm/%40kici-dev/engine@0.3.0"
|
|
69
69
|
}
|
|
70
70
|
],
|
|
71
71
|
"description": "Shared business logic for the KiCI CI/CD stack: protocol, triggers, state machine, and provider interfaces used by the Platform relay, orchestrator, and compiler.",
|
|
@@ -132,10 +132,10 @@
|
|
|
132
132
|
"homepage": "https://github.com/s3u/JSONPath"
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
|
-
"SPDXID": "SPDXRef-Package-picomatch-4.0.
|
|
135
|
+
"SPDXID": "SPDXRef-Package-picomatch-4.0.5",
|
|
136
136
|
"name": "picomatch",
|
|
137
|
-
"versionInfo": "4.0.
|
|
138
|
-
"downloadLocation": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.
|
|
137
|
+
"versionInfo": "4.0.5",
|
|
138
|
+
"downloadLocation": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz",
|
|
139
139
|
"filesAnalyzed": false,
|
|
140
140
|
"licenseConcluded": "NOASSERTION",
|
|
141
141
|
"licenseDeclared": "MIT",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
{
|
|
146
146
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
147
147
|
"referenceType": "purl",
|
|
148
|
-
"referenceLocator": "pkg:npm/picomatch@4.0.
|
|
148
|
+
"referenceLocator": "pkg:npm/picomatch@4.0.5"
|
|
149
149
|
}
|
|
150
150
|
],
|
|
151
151
|
"description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
242
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
243
|
-
"relatedSpdxElement": "SPDXRef-Package-picomatch-4.0.
|
|
243
|
+
"relatedSpdxElement": "SPDXRef-Package-picomatch-4.0.5",
|
|
244
244
|
"relationshipType": "DEPENDS_ON"
|
|
245
245
|
},
|
|
246
246
|
{
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Identity facts of a single fan-out child, matched against a binding's
|
|
3
|
-
* `host_pattern`. `agentId` / `host` are the stable dispatch identity; `labels`
|
|
4
|
-
* is the host's label set. The union of all three is the match target.
|
|
5
|
-
*/
|
|
6
|
-
export interface HostFacts {
|
|
7
|
-
agentId: string;
|
|
8
|
-
host: string;
|
|
9
|
-
labels: readonly string[];
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Whether a fan-out child's identity facts satisfy a binding's `host_pattern`.
|
|
13
|
-
*
|
|
14
|
-
* `'**'` / empty matches every host. Otherwise the pattern is compiled once
|
|
15
|
-
* (exact / glob / regex, same selector grammar as `runsOnAll`) and tested
|
|
16
|
-
* against the union `[agentId, host, ...labels]` — true if any element matches.
|
|
17
|
-
*/
|
|
18
|
-
export declare function matchHostPattern(facts: HostFacts, pattern: string): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Rank a `host_pattern` by specificity for precedence: an exact literal (2)
|
|
21
|
-
* beats a glob/regex (1), which beats `'**'`/empty (0). Used to let a per-host
|
|
22
|
-
* binding override a fleet-wide one on a key collision.
|
|
23
|
-
*/
|
|
24
|
-
export declare function hostSpecificity(pattern: string): number;
|
|
25
|
-
//# sourceMappingURL=host-match.d.ts.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type { Environment, EnvironmentBinding, EnvironmentVariable, EnvironmentSourceOverride, ScopedSecret, HeldRun, ProtectionGateResult, TrustTier, } from './types.js';
|
|
2
|
-
export { TrustTierSchema } from './types.js';
|
|
3
|
-
export { resolveSecretsForEnvironment, matchScopePattern, stripScopePrefix, } from './scope-resolver.js';
|
|
4
|
-
export type { HostFacts } from './host-match.js';
|
|
5
|
-
export { mergeOrderedMaps, EnvGateRejectReason } from './multi-env.js';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-environment merge helpers shared across the orchestrator dispatch path.
|
|
3
|
-
*
|
|
4
|
-
* A job may bind several deployment environments in order; their resolved
|
|
5
|
-
* secrets/variables are folded last-wins (a later environment's key overrides an
|
|
6
|
-
* earlier one) and their protection gates combine all-must-pass. This module is
|
|
7
|
-
* browser-safe (pure functions + a Zod enum, no Node built-ins) so it can be
|
|
8
|
-
* exported from the engine environment barrel.
|
|
9
|
-
*/
|
|
10
|
-
import { z } from 'zod';
|
|
11
|
-
/**
|
|
12
|
-
* Reason a single bound environment rejects a run under all-must-pass
|
|
13
|
-
* aggregation. Used to name which environment and which rule blocked dispatch.
|
|
14
|
-
*/
|
|
15
|
-
export declare const EnvGateRejectReason: z.ZodEnum<{
|
|
16
|
-
branch_restricted: "branch_restricted";
|
|
17
|
-
trigger_filtered: "trigger_filtered";
|
|
18
|
-
repo_unmatched: "repo_unmatched";
|
|
19
|
-
trust_too_low: "trust_too_low";
|
|
20
|
-
env_disabled: "env_disabled";
|
|
21
|
-
env_not_found: "env_not_found";
|
|
22
|
-
}>;
|
|
23
|
-
export type EnvGateRejectReason = z.infer<typeof EnvGateRejectReason>;
|
|
24
|
-
/**
|
|
25
|
-
* Fold an ordered list of per-environment resolved maps into one. Later entries
|
|
26
|
-
* override earlier keys (last-wins), matching the documented merge order for
|
|
27
|
-
* `environments: [...]`.
|
|
28
|
-
*/
|
|
29
|
-
export declare function mergeOrderedMaps(maps: ReadonlyArray<Record<string, string>>): Record<string, string>;
|
|
30
|
-
//# sourceMappingURL=multi-env.d.ts.map
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { EnvironmentBinding, ScopedSecret } from './types.js';
|
|
2
|
-
import { type HostFacts } from './host-match.js';
|
|
3
|
-
export type { HostFacts } from './host-match.js';
|
|
4
|
-
/**
|
|
5
|
-
* Check whether a scope string matches a pattern.
|
|
6
|
-
*
|
|
7
|
-
* Supports exact match and glob patterns (via picomatch).
|
|
8
|
-
* Scope paths use '/' as separator (e.g., 'aws/prod/db').
|
|
9
|
-
*
|
|
10
|
-
* For prefixed scopes (e.g., 'pg:aws/prod'), the pattern may be prefixed too
|
|
11
|
-
* (e.g., 'pg:**'). In this case, the backend prefix must match exactly and
|
|
12
|
-
* the path portion is matched separately against the glob. This is needed
|
|
13
|
-
* because picomatch's '**' requires '/' separators — 'pg:**' wouldn't match
|
|
14
|
-
* 'pg:aws/prod' without splitting on the colon.
|
|
15
|
-
*/
|
|
16
|
-
export declare function matchScopePattern(scope: string, pattern: string): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Strip the backend prefix from a scope string.
|
|
19
|
-
* Prefixed scopes have the form "backendName:path" (e.g., "pg:aws/prod").
|
|
20
|
-
* Returns the path after the first colon, or the full scope if no prefix.
|
|
21
|
-
*/
|
|
22
|
-
export declare function stripScopePrefix(scope: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* Resolve secrets for an environment by matching bindings against scoped secrets.
|
|
25
|
-
*
|
|
26
|
-
* Takes already-filtered bindings (for the target environment). For each binding,
|
|
27
|
-
* finds secrets whose (substituted) scope matches the binding's scopePattern via
|
|
28
|
-
* picomatch. When multiple scopes provide the same key, precedence is the tuple
|
|
29
|
-
* `(host specificity, scope depth)` — a per-host binding (exact host) overrides a
|
|
30
|
-
* fleet-wide one, then longest scope path wins. Scope depth is computed AFTER
|
|
31
|
-
* stripping the backend prefix.
|
|
32
|
-
*
|
|
33
|
-
* When `hostFacts` is supplied (a fan-out child's identity), each binding is
|
|
34
|
-
* gated by its `host_pattern` and its `scope_pattern` is templated per-child
|
|
35
|
-
* (`${agentId}`/`${host}`/`${label:NAME}`). When omitted, only fleet-wide
|
|
36
|
-
* (`'**'`/NULL) non-templated bindings contribute — preserving the workflow-level
|
|
37
|
-
* (no-host) behaviour.
|
|
38
|
-
*
|
|
39
|
-
* @param bindings - Bindings already filtered for the target environment
|
|
40
|
-
* @param allSecrets - All scoped secrets in the org
|
|
41
|
-
* @param decryptFn - Pure decryption function (keeps this module crypto-free)
|
|
42
|
-
* @param hostFacts - Optional fan-out child identity for per-host resolution
|
|
43
|
-
* @returns Flat record of decrypted secret key-value pairs
|
|
44
|
-
*/
|
|
45
|
-
export declare function resolveSecretsForEnvironment(bindings: EnvironmentBinding[], allSecrets: ScopedSecret[], decryptFn: (s: ScopedSecret) => string, hostFacts?: HostFacts): Record<string, string>;
|
|
46
|
-
//# sourceMappingURL=scope-resolver.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { HostFacts } from './host-match.js';
|
|
2
|
-
/**
|
|
3
|
-
* Substitute `${agentId}` / `${host}` / `${label:NAME}` placeholders in a
|
|
4
|
-
* binding's `scope_pattern` with a fan-out child's identity, so one templated
|
|
5
|
-
* binding selects each host's own subtree (`prod/hosts/${agentId}/**`).
|
|
6
|
-
*
|
|
7
|
-
* Returns the substituted pattern, or `null` when the binding must be **skipped
|
|
8
|
-
* for this host** because either:
|
|
9
|
-
* - a referenced variable is unresolved (a missing `${label:NAME}`), or
|
|
10
|
-
* - a substituted value is unsafe — it contains anything outside
|
|
11
|
-
* `[A-Za-z0-9._-]` (a `/` path separator or a glob metacharacter), which
|
|
12
|
-
* could let a hostname/label value escape its segment or inject a pattern.
|
|
13
|
-
*
|
|
14
|
-
* A multi-valued label resolves to its lexicographic-first value
|
|
15
|
-
* (deterministic). A pattern with no placeholders is returned unchanged.
|
|
16
|
-
*/
|
|
17
|
-
export declare function substituteScopePattern(pattern: string, facts: HostFacts): string | null;
|
|
18
|
-
//# sourceMappingURL=scope-template.d.ts.map
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Environment types for KiCI's deployment environment model.
|
|
3
|
-
*
|
|
4
|
-
* Environments are org-level entities that group secrets, variables,
|
|
5
|
-
* and protection rules for deployment targets (dev, staging, production).
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
import type { ApproverClause } from '../approval/types.js';
|
|
9
|
-
/** Environment entity — org-level deployment target with protection rules. */
|
|
10
|
-
export interface Environment {
|
|
11
|
-
id: string;
|
|
12
|
-
orgId: string;
|
|
13
|
-
name: string;
|
|
14
|
-
type: 'fixed' | 'glob';
|
|
15
|
-
globPattern: string | null;
|
|
16
|
-
branchRestrictions: string[];
|
|
17
|
-
triggerTypeFilters: string[];
|
|
18
|
-
repoPatterns: string[];
|
|
19
|
-
concurrencyLimit: number | null;
|
|
20
|
-
concurrencyStrategy: 'queue' | 'cancel-pending';
|
|
21
|
-
concurrencyTimeoutMs: number;
|
|
22
|
-
requiredReviewers: string[] | null;
|
|
23
|
-
waitTimerSeconds: number | null;
|
|
24
|
-
holdExpirySeconds: number;
|
|
25
|
-
/** Minimum trust tier required for CI execution in this environment. */
|
|
26
|
-
minimumTrust?: 'known' | 'trusted';
|
|
27
|
-
/** Whether this environment allows local (no-remote) executions. Default false. */
|
|
28
|
-
allowLocalExecution?: boolean;
|
|
29
|
-
enabled: boolean;
|
|
30
|
-
createdAt: string;
|
|
31
|
-
updatedAt: string;
|
|
32
|
-
createdBy: string;
|
|
33
|
-
}
|
|
34
|
-
/** Scoped secret — individual secret with a scope path for precedence resolution. */
|
|
35
|
-
export interface ScopedSecret {
|
|
36
|
-
id: string;
|
|
37
|
-
orgId: string;
|
|
38
|
-
scope: string;
|
|
39
|
-
key: string;
|
|
40
|
-
encryptedValue: string;
|
|
41
|
-
backendType: 'pg' | 'vault';
|
|
42
|
-
keyVersion: number;
|
|
43
|
-
createdAt: string;
|
|
44
|
-
updatedAt: string;
|
|
45
|
-
}
|
|
46
|
-
/** Binding that maps a scope pattern to an environment. */
|
|
47
|
-
export interface EnvironmentBinding {
|
|
48
|
-
id: string;
|
|
49
|
-
orgId: string;
|
|
50
|
-
environmentId: string;
|
|
51
|
-
scopePattern: string;
|
|
52
|
-
/**
|
|
53
|
-
* Host selector this binding applies to (exact / glob / regex, matched
|
|
54
|
-
* against a fan-out child's agentId / hostname / labels). `'**'` matches
|
|
55
|
-
* every host, preserving fleet-wide behaviour for bindings with no host
|
|
56
|
-
* scope.
|
|
57
|
-
*/
|
|
58
|
-
hostPattern: string;
|
|
59
|
-
createdAt: string;
|
|
60
|
-
}
|
|
61
|
-
/** Non-secret key-value config per environment, with optional lock. */
|
|
62
|
-
export interface EnvironmentVariable {
|
|
63
|
-
id: string;
|
|
64
|
-
orgId: string;
|
|
65
|
-
environmentId: string;
|
|
66
|
-
key: string;
|
|
67
|
-
value: string;
|
|
68
|
-
locked: boolean;
|
|
69
|
-
createdAt: string;
|
|
70
|
-
updatedAt: string;
|
|
71
|
-
}
|
|
72
|
-
/** Per-source override for an environment variable. */
|
|
73
|
-
export interface EnvironmentSourceOverride {
|
|
74
|
-
id: string;
|
|
75
|
-
orgId: string;
|
|
76
|
-
environmentId: string;
|
|
77
|
-
routingKey: string;
|
|
78
|
-
key: string;
|
|
79
|
-
value: string;
|
|
80
|
-
createdAt: string;
|
|
81
|
-
updatedAt: string;
|
|
82
|
-
}
|
|
83
|
-
/** Trust tier for contributor-based CI execution gating (single source of truth). */
|
|
84
|
-
export declare const TrustTierSchema: z.ZodEnum<{
|
|
85
|
-
unknown: "unknown";
|
|
86
|
-
known: "known";
|
|
87
|
-
trusted: "trusted";
|
|
88
|
-
}>;
|
|
89
|
-
export type TrustTier = z.infer<typeof TrustTierSchema>;
|
|
90
|
-
/** Held run record for protection gate enforcement. */
|
|
91
|
-
export interface HeldRun {
|
|
92
|
-
id: string;
|
|
93
|
-
orgId: string;
|
|
94
|
-
runId: string;
|
|
95
|
-
jobId: string;
|
|
96
|
-
environmentId: string;
|
|
97
|
-
holdType: 'reviewer' | 'timer' | 'concurrency' | 'security';
|
|
98
|
-
status: 'pending' | 'approved' | 'rejected' | 'expired';
|
|
99
|
-
reason: string | null;
|
|
100
|
-
approvedBy: string | null;
|
|
101
|
-
createdAt: string;
|
|
102
|
-
expiresAt: string | null;
|
|
103
|
-
resolvedAt: string | null;
|
|
104
|
-
}
|
|
105
|
-
/** Result from the protection gate pipeline evaluation. */
|
|
106
|
-
export interface ProtectionGateResult {
|
|
107
|
-
action: 'pass' | 'reject' | 'hold' | 'queue' | 'wait';
|
|
108
|
-
reason?: string;
|
|
109
|
-
holdUntil?: string;
|
|
110
|
-
holdType?: 'reviewer' | 'timer' | 'concurrency' | 'security';
|
|
111
|
-
/**
|
|
112
|
-
* Approver clauses for a reviewer hold, mapped from the environment's
|
|
113
|
-
* `requiredReviewers`. Each reviewer string maps to a `{ user }` clause
|
|
114
|
-
* (team-named reviewers are a documented follow-up). Empty/undefined means
|
|
115
|
-
* "any approval-capable member".
|
|
116
|
-
*/
|
|
117
|
-
clauses?: ApproverClause[];
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=types.d.ts.map
|