@kici-dev/engine 0.1.20 → 0.1.22
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 +1 -1
- package/dist/approval/types.js +1 -1
- package/dist/audit/access-log-policy.js +7 -0
- package/dist/audit/retention-policy.js +8 -0
- package/dist/check-mode.d.ts +33 -0
- package/dist/check-mode.js +36 -0
- package/dist/fanout/materialize.d.ts +21 -4
- package/dist/fanout/materialize.js +24 -5
- package/dist/index.d.ts +5 -1
- package/dist/index.js +11 -7
- package/dist/inventory.d.ts +101 -0
- package/dist/inventory.js +89 -0
- package/dist/labels-match.d.ts +52 -0
- package/dist/labels-match.js +24 -2
- package/dist/protocol/dashboard-write-operations.d.ts +8 -1
- package/dist/protocol/dashboard-write-operations.js +25 -4
- package/dist/protocol/messages/access-log.d.ts +25 -0
- package/dist/protocol/messages/access-log.js +5 -0
- package/dist/protocol/messages/auth.d.ts +2 -0
- package/dist/protocol/messages/capabilities.d.ts +2 -0
- package/dist/protocol/messages/dashboard.d.ts +669 -21
- package/dist/protocol/messages/dashboard.js +140 -7
- package/dist/protocol/messages/deployment-identity.d.ts +38 -0
- package/dist/protocol/messages/deployment-identity.js +28 -0
- package/dist/protocol/messages/execution-status.d.ts +5 -5
- package/dist/protocol/messages/orchestrator-agent.d.ts +70 -6
- package/dist/protocol/messages/orchestrator-agent.js +37 -8
- package/dist/protocol/messages/peer.d.ts +62 -3
- package/dist/protocol/messages/peer.js +16 -2
- package/dist/protocol/messages/platform-orchestrator.d.ts +172 -2
- package/dist/protocol/messages/source-registration.d.ts +15 -0
- package/dist/protocol/messages/source-registration.js +17 -1
- package/dist/trigger/types.d.ts +74 -22
- package/dist/trigger/types.js +41 -12
- package/dist/webhook/webhook-url-format.d.ts +9 -0
- package/dist/webhook/webhook-url-format.js +16 -0
- package/package.json +1 -1
- package/sbom.spdx.json +5 -5
package/dist/approval/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Shared approval requirement + clause types.
|
|
3
3
|
*
|
|
4
4
|
* One normalized `ApprovalRequirement` is produced by both approval triggers —
|
|
5
|
-
* a mandatory environment policy and an explicit SDK `
|
|
5
|
+
* a mandatory environment policy and an explicit SDK `approval` config — and is
|
|
6
6
|
* consumed identically by the orchestrator gate, the resolver, the held-run
|
|
7
7
|
* store, and the agent step round-trip. Pure Zod (no node built-ins), so this
|
|
8
8
|
* module is safe in the browser-facing engine barrel.
|
package/dist/approval/types.js
CHANGED
|
@@ -5,7 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
* Shared approval requirement + clause types.
|
|
6
6
|
*
|
|
7
7
|
* One normalized `ApprovalRequirement` is produced by both approval triggers —
|
|
8
|
-
* a mandatory environment policy and an explicit SDK `
|
|
8
|
+
* a mandatory environment policy and an explicit SDK `approval` config — and is
|
|
9
9
|
* consumed identically by the orchestrator gate, the resolver, the held-run
|
|
10
10
|
* store, and the agent step round-trip. Pure Zod (no node built-ins), so this
|
|
11
11
|
* module is safe in the browser-facing engine barrel.
|
|
@@ -111,6 +111,10 @@ const POLICY_BY_ACTION = {
|
|
|
111
111
|
kind: "rate_limit",
|
|
112
112
|
perMinutePerActor: 1
|
|
113
113
|
},
|
|
114
|
+
"fleet.read": {
|
|
115
|
+
kind: "rate_limit",
|
|
116
|
+
perMinutePerActor: 1
|
|
117
|
+
},
|
|
114
118
|
"run.payload.read": { kind: "always" },
|
|
115
119
|
"run.cancel": { kind: "always" },
|
|
116
120
|
"run.rerun": { kind: "always" },
|
|
@@ -137,6 +141,7 @@ const POLICY_BY_ACTION = {
|
|
|
137
141
|
"secret_scope.rename": { kind: "always" },
|
|
138
142
|
"secret_scope.delete": { kind: "always" },
|
|
139
143
|
"held_run.approve": { kind: "always" },
|
|
144
|
+
"held_run.auto_approve": { kind: "always" },
|
|
140
145
|
"held_run.reject": { kind: "always" },
|
|
141
146
|
"held_run.request": { kind: "always" },
|
|
142
147
|
"held_run.expire": { kind: "always" },
|
|
@@ -145,6 +150,8 @@ const POLICY_BY_ACTION = {
|
|
|
145
150
|
"backend.sync": { kind: "always" },
|
|
146
151
|
"backend.sync.one": { kind: "always" },
|
|
147
152
|
"backend.test": { kind: "always" },
|
|
153
|
+
"fleet.host.declare": { kind: "always" },
|
|
154
|
+
"fleet.host.remove": { kind: "always" },
|
|
148
155
|
"global_workflows.update": { kind: "always" },
|
|
149
156
|
"org_settings.dashboard_write_policy.update": { kind: "always" },
|
|
150
157
|
"cluster_name.update": { kind: "always" },
|
|
@@ -32,6 +32,7 @@ const ACCESS_LOG_WARM_DAYS = {
|
|
|
32
32
|
"diagnostics.read": 30,
|
|
33
33
|
"scaler.capacity.read": 30,
|
|
34
34
|
"scaler.agents.read": 30,
|
|
35
|
+
"fleet.read": 30,
|
|
35
36
|
"event_log.detail.read": 180,
|
|
36
37
|
"event_log.payload.read": 180,
|
|
37
38
|
"run.payload.read": 180,
|
|
@@ -53,6 +54,7 @@ const ACCESS_LOG_WARM_DAYS = {
|
|
|
53
54
|
"source_override.delete": 180,
|
|
54
55
|
"env_binding.set": 180,
|
|
55
56
|
"held_run.approve": 180,
|
|
57
|
+
"held_run.auto_approve": 180,
|
|
56
58
|
"held_run.reject": 180,
|
|
57
59
|
"held_run.request": 180,
|
|
58
60
|
"held_run.expire": 180,
|
|
@@ -61,6 +63,8 @@ const ACCESS_LOG_WARM_DAYS = {
|
|
|
61
63
|
"backend.sync": 180,
|
|
62
64
|
"backend.sync.one": 180,
|
|
63
65
|
"backend.test": 180,
|
|
66
|
+
"fleet.host.declare": 180,
|
|
67
|
+
"fleet.host.remove": 180,
|
|
64
68
|
"global_workflows.update": 180,
|
|
65
69
|
"org_settings.dashboard_write_policy.update": 180,
|
|
66
70
|
"cluster_name.update": 180,
|
|
@@ -270,6 +274,7 @@ const ACCESS_LOG_COLD_DAYS = {
|
|
|
270
274
|
"diagnostics.read": 30,
|
|
271
275
|
"scaler.capacity.read": 30,
|
|
272
276
|
"scaler.agents.read": 30,
|
|
277
|
+
"fleet.read": 30,
|
|
273
278
|
"event_log.detail.read": 730,
|
|
274
279
|
"event_log.payload.read": 730,
|
|
275
280
|
"run.payload.read": 730,
|
|
@@ -291,6 +296,7 @@ const ACCESS_LOG_COLD_DAYS = {
|
|
|
291
296
|
"source_override.delete": 730,
|
|
292
297
|
"env_binding.set": 730,
|
|
293
298
|
"held_run.approve": 730,
|
|
299
|
+
"held_run.auto_approve": 730,
|
|
294
300
|
"held_run.reject": 730,
|
|
295
301
|
"held_run.request": 730,
|
|
296
302
|
"held_run.expire": 730,
|
|
@@ -299,6 +305,8 @@ const ACCESS_LOG_COLD_DAYS = {
|
|
|
299
305
|
"backend.sync": 730,
|
|
300
306
|
"backend.sync.one": 730,
|
|
301
307
|
"backend.test": 730,
|
|
308
|
+
"fleet.host.declare": 730,
|
|
309
|
+
"fleet.host.remove": 730,
|
|
302
310
|
"global_workflows.update": 730,
|
|
303
311
|
"org_settings.dashboard_write_policy.update": 730,
|
|
304
312
|
"cluster_name.update": 730,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* How a run executes idempotent steps.
|
|
4
|
+
*
|
|
5
|
+
* - `apply` (default): converge — per step, check(); on drift apply(); else in sync.
|
|
6
|
+
* - `check`: report what would change, changing nothing (always succeeds; report-only).
|
|
7
|
+
* - `check-fail-on-drift`: like check, but the run fails if any step reports drift.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CheckMode: z.ZodEnum<{
|
|
10
|
+
apply: "apply";
|
|
11
|
+
check: "check";
|
|
12
|
+
"check-fail-on-drift": "check-fail-on-drift";
|
|
13
|
+
}>;
|
|
14
|
+
export type CheckMode = z.infer<typeof CheckMode>;
|
|
15
|
+
/**
|
|
16
|
+
* Per-step idempotent outcome. The first four mirror the StepOutcome union in
|
|
17
|
+
* @kici-dev/core/idempotency verbatim (skipped | applied | declined | dry-run);
|
|
18
|
+
* `no_check` covers a plain step (no check facet) skipped under check mode
|
|
19
|
+
* because it cannot be safely previewed.
|
|
20
|
+
*
|
|
21
|
+
* Orthogonal to ExecutionStepStatus (success | failed | skipped), which stays the
|
|
22
|
+
* top-level status. Dashboard chips map: applied -> "applied", skipped -> "in sync",
|
|
23
|
+
* dry-run -> "would change", no_check -> "no check".
|
|
24
|
+
*/
|
|
25
|
+
export declare const CheckStepOutcome: z.ZodEnum<{
|
|
26
|
+
skipped: "skipped";
|
|
27
|
+
applied: "applied";
|
|
28
|
+
declined: "declined";
|
|
29
|
+
"dry-run": "dry-run";
|
|
30
|
+
no_check: "no_check";
|
|
31
|
+
}>;
|
|
32
|
+
export type CheckStepOutcome = z.infer<typeof CheckStepOutcome>;
|
|
33
|
+
//# sourceMappingURL=check-mode.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "./chunk-BTugEXQM.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/check-mode.ts
|
|
4
|
+
/**
|
|
5
|
+
* How a run executes idempotent steps.
|
|
6
|
+
*
|
|
7
|
+
* - `apply` (default): converge — per step, check(); on drift apply(); else in sync.
|
|
8
|
+
* - `check`: report what would change, changing nothing (always succeeds; report-only).
|
|
9
|
+
* - `check-fail-on-drift`: like check, but the run fails if any step reports drift.
|
|
10
|
+
*/
|
|
11
|
+
const CheckMode = z.enum([
|
|
12
|
+
"apply",
|
|
13
|
+
"check",
|
|
14
|
+
"check-fail-on-drift"
|
|
15
|
+
]);
|
|
16
|
+
/**
|
|
17
|
+
* Per-step idempotent outcome. The first four mirror the StepOutcome union in
|
|
18
|
+
* @kici-dev/core/idempotency verbatim (skipped | applied | declined | dry-run);
|
|
19
|
+
* `no_check` covers a plain step (no check facet) skipped under check mode
|
|
20
|
+
* because it cannot be safely previewed.
|
|
21
|
+
*
|
|
22
|
+
* Orthogonal to ExecutionStepStatus (success | failed | skipped), which stays the
|
|
23
|
+
* top-level status. Dashboard chips map: applied -> "applied", skipped -> "in sync",
|
|
24
|
+
* dry-run -> "would change", no_check -> "no check".
|
|
25
|
+
*/
|
|
26
|
+
const CheckStepOutcome = z.enum([
|
|
27
|
+
"skipped",
|
|
28
|
+
"applied",
|
|
29
|
+
"declined",
|
|
30
|
+
"dry-run",
|
|
31
|
+
"no_check"
|
|
32
|
+
]);
|
|
33
|
+
//#endregion
|
|
34
|
+
export { CheckMode, CheckStepOutcome };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=check-mode.js.map
|
|
@@ -12,14 +12,31 @@ export declare enum VariantKind {
|
|
|
12
12
|
host = "host"
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Why a fan-out produced no dispatchable children. Drives whether the zeroed
|
|
16
|
+
* job's synthetic terminal row is recorded as a failure or a skip:
|
|
17
|
+
*
|
|
18
|
+
* - `error` — a genuine failure: invalid matrix (zero combinations / over the
|
|
19
|
+
* cap), an unavailable roster, or `onUnreachable: 'fail'` with an absent host.
|
|
20
|
+
* The synthetic job is `failed`.
|
|
21
|
+
* - `narrowed-empty` — the fan-out intentionally resolved to zero usable hosts
|
|
22
|
+
* (e.g. `onUnreachable: 'skip'` skipped every unreachable host). The synthetic
|
|
23
|
+
* job is `skipped`.
|
|
24
|
+
*/
|
|
25
|
+
export declare enum FanoutCause {
|
|
26
|
+
error = "error",
|
|
27
|
+
narrowedEmpty = "narrowed-empty"
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Thrown when a job's fan-out cannot be materialized into dispatchable children:
|
|
31
|
+
* an invalid matrix, an unavailable / zeroed host roster. The `cause` discriminates
|
|
32
|
+
* a genuine failure from an intentional narrow-to-empty so the caller can record
|
|
33
|
+
* the zeroed job's synthetic row as `failed` or `skipped` accordingly.
|
|
18
34
|
*/
|
|
19
35
|
export declare class FanoutError extends Error {
|
|
20
36
|
readonly jobName: string;
|
|
37
|
+
readonly cause: FanoutCause;
|
|
21
38
|
readonly name = "FanoutError";
|
|
22
|
-
constructor(jobName: string, message: string);
|
|
39
|
+
constructor(jobName: string, message: string, cause?: FanoutCause);
|
|
23
40
|
}
|
|
24
41
|
/**
|
|
25
42
|
* A roster host resolved as a target of a `runsOnAll` fan-out. Carries the
|
|
@@ -15,16 +15,35 @@ let VariantKind = /* @__PURE__ */ function(VariantKind) {
|
|
|
15
15
|
return VariantKind;
|
|
16
16
|
}({});
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Why a fan-out produced no dispatchable children. Drives whether the zeroed
|
|
19
|
+
* job's synthetic terminal row is recorded as a failure or a skip:
|
|
20
|
+
*
|
|
21
|
+
* - `error` — a genuine failure: invalid matrix (zero combinations / over the
|
|
22
|
+
* cap), an unavailable roster, or `onUnreachable: 'fail'` with an absent host.
|
|
23
|
+
* The synthetic job is `failed`.
|
|
24
|
+
* - `narrowed-empty` — the fan-out intentionally resolved to zero usable hosts
|
|
25
|
+
* (e.g. `onUnreachable: 'skip'` skipped every unreachable host). The synthetic
|
|
26
|
+
* job is `skipped`.
|
|
27
|
+
*/
|
|
28
|
+
let FanoutCause = /* @__PURE__ */ function(FanoutCause) {
|
|
29
|
+
FanoutCause["error"] = "error";
|
|
30
|
+
FanoutCause["narrowedEmpty"] = "narrowed-empty";
|
|
31
|
+
return FanoutCause;
|
|
32
|
+
}({});
|
|
33
|
+
/**
|
|
34
|
+
* Thrown when a job's fan-out cannot be materialized into dispatchable children:
|
|
35
|
+
* an invalid matrix, an unavailable / zeroed host roster. The `cause` discriminates
|
|
36
|
+
* a genuine failure from an intentional narrow-to-empty so the caller can record
|
|
37
|
+
* the zeroed job's synthetic row as `failed` or `skipped` accordingly.
|
|
21
38
|
*/
|
|
22
39
|
var FanoutError = class FanoutError extends Error {
|
|
23
40
|
jobName;
|
|
41
|
+
cause;
|
|
24
42
|
name = "FanoutError";
|
|
25
|
-
constructor(jobName, message) {
|
|
43
|
+
constructor(jobName, message, cause = "error") {
|
|
26
44
|
super(message);
|
|
27
45
|
this.jobName = jobName;
|
|
46
|
+
this.cause = cause;
|
|
28
47
|
Object.setPrototypeOf(this, FanoutError.prototype);
|
|
29
48
|
}
|
|
30
49
|
};
|
|
@@ -171,6 +190,6 @@ function materializeFanout(staticJobs) {
|
|
|
171
190
|
};
|
|
172
191
|
}
|
|
173
192
|
//#endregion
|
|
174
|
-
export { FanoutError, MAX_FANOUT_JOBS, VariantKind, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields };
|
|
193
|
+
export { FanoutCause, FanoutError, MAX_FANOUT_JOBS, VariantKind, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields };
|
|
175
194
|
|
|
176
195
|
//# sourceMappingURL=materialize.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './protocol/messages/auth.js';
|
|
|
15
15
|
export * from './protocol/messages/capabilities.js';
|
|
16
16
|
export { webhookRelaySchema, webhookRelayStartSchema, webhookRelayChunkSchema, webhookAckSchema, WebhookRelayResult, WEBHOOK_RELAY_MAX_BODY_BYTES, WEBHOOK_RELAY_CHUNK_SIZE, executionEventSchema, logChunkSchema, peerDiscoverSchema, peerUpdateSchema, cacheStatsSchema, orchMetricsSchema, platformToOrchestratorMessageSchema, orchestratorToPlatformMessageSchema, type WebhookRelay, type WebhookRelayStart, type WebhookRelayChunk, type WebhookAck, type LogChunk, type PeerDiscover, type PeerUpdate, type CacheStats, type OrchMetrics, trustPolicyUpdateSchema, type TrustPolicyUpdate, staleCheckrunCleanupSchema, type StaleCheckrunCleanup, type PlatformToOrchestratorMessage, type OrchestratorToPlatformMessage, } from './protocol/messages/platform-orchestrator.js';
|
|
17
17
|
export * from './protocol/messages/execution-status.js';
|
|
18
|
+
export * from './protocol/messages/deployment-identity.js';
|
|
18
19
|
export * from './protocol/messages/scaler-event.js';
|
|
19
20
|
export * from './protocol/messages/event-log.js';
|
|
20
21
|
export * from './protocol/messages/access-log.js';
|
|
@@ -37,6 +38,7 @@ export * from './trigger/decision-trace.js';
|
|
|
37
38
|
export * from './trigger/matcher.js';
|
|
38
39
|
export * from './state-machine/index.js';
|
|
39
40
|
export * from './provider/index.js';
|
|
41
|
+
export { githubWebhookPath } from './webhook/webhook-url-format.js';
|
|
40
42
|
export type { WsLike } from './ws/ws-like.js';
|
|
41
43
|
export * from './ws/close-codes.js';
|
|
42
44
|
export { WsRateLimiter } from './ws/rate-limiter.js';
|
|
@@ -47,7 +49,8 @@ export * from './environment/index.js';
|
|
|
47
49
|
export { deriveOsArchLabels, hostLabel, parseHostLabel, HOST_LABEL_PREFIX, agentTypeLabel, scalerLabel, mergeAutoLabels, normalizeRunsOn, KNOWN_ROLES, resolveRoleLabels, validateNoReservedLabels, scalerAgentLabels, isSelfReportedLabel, SELF_REPORTED_LABEL_PREFIXES, } from './labels.js';
|
|
48
50
|
export type { NormalizedRunsOn } from './labels.js';
|
|
49
51
|
export type { AgentRole } from './labels.js';
|
|
50
|
-
export { LabelMatcher, matcherMatches, matcherSatisfiedBy, partitionMatchers, compileRegexMatcher, } from './labels-match.js';
|
|
52
|
+
export { LabelMatcher, matcherMatches, matcherSatisfiedBy, partitionMatchers, compileRegexMatcher, HostTargetValue, HostTargetSelector, hostSatisfiesTarget, } from './labels-match.js';
|
|
53
|
+
export * from './inventory.js';
|
|
51
54
|
export * from './scaler/scaler-backend-type.js';
|
|
52
55
|
export * from './scaler/resource-types.js';
|
|
53
56
|
export * from './registration/registerable-trigger-type.js';
|
|
@@ -55,4 +58,5 @@ export * from './bundler/index.js';
|
|
|
55
58
|
export { expandSingleDimension, expandMultiDimension, expandMatrix, applyIncludeExclude, type StaticMatrixArray, type StaticMatrixObject, type MatrixInclude, type MatrixExclude, type MatrixValues, } from './matrix/expand.js';
|
|
56
59
|
export { formatMatrixSuffix, formatExpandedJobName } from './matrix/format.js';
|
|
57
60
|
export * from './fanout/materialize.js';
|
|
61
|
+
export * from './check-mode.js';
|
|
58
62
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import "./chunk-BTugEXQM.js";
|
|
2
|
+
import { CheckMode, CheckStepOutcome } from "./check-mode.js";
|
|
2
3
|
import { MIN_PROTOCOL_VERSION, PROTOCOL_VERSION } from "./protocol/version.js";
|
|
3
4
|
import { WS_MAX_PAYLOAD_BYTES, ackSchema, errorSchema, heartbeatSchema, nackSchema } from "./protocol/messages/common.js";
|
|
4
5
|
import { ActorType, actorPrincipalSchema, apiKeyActorSchema, flattenActor, parseActor, platformOperatorActorSchema, serviceAccountActorSchema, stringifyActor, systemActorSchema, userActorSchema } from "./protocol/messages/actor.js";
|
|
5
6
|
import { ORCH_CAPABILITIES, OrchRole, hasOrchCapability, orchCapabilitiesSchema } from "./protocol/messages/capabilities.js";
|
|
6
7
|
import { authFailureSchema, authRequestSchema, authSuccessSchema } from "./protocol/messages/auth.js";
|
|
7
8
|
import { CacheOutcome, CacheRunEventType, CacheStepType, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, InitFailureCategory, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TimeoutReason, executionStatusSchema, initFailureSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema } from "./protocol/messages/execution-status.js";
|
|
9
|
+
import { DeploymentContainerRuntimeSchema, DeploymentIdentitySchema, DeploymentModeSchema } from "./protocol/messages/deployment-identity.js";
|
|
8
10
|
import { SourceProvider, SourceSubtype, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema } from "./protocol/messages/source-registration.js";
|
|
9
11
|
import { AccessLogAction, AccessLogOutcome, AccessLogSource, AccessLogTargetType, accessLogFilterSchema, accessLogItemSchema, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema } from "./protocol/messages/access-log.js";
|
|
10
12
|
import { browserJobContextSchema, browserRunEventSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, jobContextMessageSchema, runEventMessageSchema } from "./protocol/messages/run-events.js";
|
|
11
13
|
import { EventLogSource, EventLogStatus, PayloadOmittedReason } from "./protocol/messages/event-log.js";
|
|
12
14
|
import { ScalerBackendType } from "./scaler/scaler-backend-type.js";
|
|
13
15
|
import { ApprovalDecision, HoldScope, TriggerSource, approvalRequirementSchema, approverClauseSchema } from "./approval/types.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
+
import { NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, resolveWhenToRunOn } from "./trigger/types.js";
|
|
17
|
+
import { HostTargetSelector, HostTargetValue, LabelMatcher, compileRegexMatcher, hostSatisfiesTarget, matcherMatches, matcherSatisfiedBy, partitionMatchers } from "./labels-match.js";
|
|
18
|
+
import { HostInventoryEntry, HostPropertyValue, InventoryHostStatus, InventoryLifecycleClass, InventorySelectorSchema, coerceHostPropertyValue, parseHostPropertyAssignments } from "./inventory.js";
|
|
19
|
+
import { EnvDeleteErrorCode, EventLogPayloadStreamError, HeldRunQueueType, HeldRunStatus, TestRelayType, attestationListItemSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardFleetHostRequestSchema, dashboardFleetHostResponseSchema, dashboardFleetHostsRequestSchema, dashboardFleetHostsResponseSchema, dashboardFleetPreviewRequestSchema, dashboardFleetPreviewResponseSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, fleetHostDeclareRequestSchema, fleetHostDeclareResponseSchema, fleetHostRemoveRequestSchema, fleetHostRemoveResponseSchema, fleetPinnedRunSchema, fleetPreviewHostSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, identityLinkItemSchema, identityLinkListResponseSchema, manualScheduleRequestSchema, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, orgMemberSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, runCancelRequestSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, trustPolicyResponseSchema } from "./protocol/messages/dashboard.js";
|
|
16
20
|
import { WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WebhookRelayResult, cacheStatsSchema, executionEventSchema, logChunkSchema, orchMetricsSchema, orchestratorToPlatformMessageSchema, peerDiscoverSchema, peerUpdateSchema, platformToOrchestratorMessageSchema, staleCheckrunCleanupSchema, trustPolicyUpdateSchema, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema } from "./protocol/messages/platform-orchestrator.js";
|
|
17
21
|
import { ScalerEventType } from "./protocol/messages/scaler-event.js";
|
|
18
22
|
import { AccessLogPolicyKind, POLICY_BY_ACTION, fnv1a32, shouldRecordAccess, shouldRecordSecretResolve } from "./audit/access-log-policy.js";
|
|
@@ -22,9 +26,8 @@ import { logPullOrchToPlatformSchema, logPullPlatformToOrchSchema } from "./prot
|
|
|
22
26
|
import { EVENT_LOG_PAYLOAD_CHUNK_BYTES } from "./protocol/event-log-payload.js";
|
|
23
27
|
import { browserAuthFailureSchema, browserAuthRefreshSchema, browserAuthRequestSchema, browserAuthSuccessSchema, browserErrorSchema, browserEventLogPayloadFetchSchema, browserGapSchema, browserJobNewSchema, browserJobStatusSchema, browserLogLinesSchema, browserLogStreamTerminatedReason, browserLogStreamTerminatedSchema, browserLogSubscribeSchema, browserLogUnsubscribeSchema, browserPingSchema, browserPongSchema, browserRunNewSchema, browserRunStatusSchema, browserStatusSubscribeSchema, browserStatusUnsubscribeSchema, browserStepStatusSchema, browserToPlatformMessageSchema, platformToBrowserMessageSchema } from "./protocol/messages/browser.js";
|
|
24
28
|
import { joinRequestSchema, joinResponseSchema } from "./protocol/messages/join.js";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, registerAckSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, upstreamSnapshotSchema } from "./protocol/messages/orchestrator-agent.js";
|
|
29
|
+
import { fleetSelectionSchema, jobProgressAckSchema, jobProgressSchema, jobRerouteAckSchema, jobRerouteSchema, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema } from "./protocol/messages/peer.js";
|
|
30
|
+
import { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, registerAckSchema, stepApprovalPayloadSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, upstreamSnapshotSchema } from "./protocol/messages/orchestrator-agent.js";
|
|
28
31
|
import { TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES } from "./trigger/trigger-event-type.js";
|
|
29
32
|
import { createTraceEntry, createWorkflowDecision } from "./trigger/decision-trace.js";
|
|
30
33
|
import { matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchWorkflowTriggers } from "./trigger/matcher.js";
|
|
@@ -33,6 +36,7 @@ import "./state-machine/index.js";
|
|
|
33
36
|
import { LockFileParseError } from "./provider/lock-file-parse-error.js";
|
|
34
37
|
import { CheckRunConclusion } from "./provider/check-run-conclusion.js";
|
|
35
38
|
import "./provider/index.js";
|
|
39
|
+
import { githubWebhookPath } from "./webhook/webhook-url-format.js";
|
|
36
40
|
import { WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, WS_CLOSE_DISPATCH_ACK_TIMEOUT, WS_CLOSE_GOING_AWAY, WS_CLOSE_HEARTBEAT_TIMEOUT, WS_CLOSE_INTERNAL_ERROR, WS_CLOSE_INVALID_MESSAGE, WS_CLOSE_PLAN_LIMIT, WS_CLOSE_PROTOCOL_ERROR, WS_CLOSE_RUN_NOT_FOUND, WS_CLOSE_UNAUTHORIZED } from "./ws/close-codes.js";
|
|
37
41
|
import { WsRateLimiter } from "./ws/rate-limiter.js";
|
|
38
42
|
import { AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, KICI_AGENT_ENV_PREFIX, SANDBOX_DEFAULT_VARS } from "./env/environment-allowlist.js";
|
|
@@ -46,5 +50,5 @@ import { createWorkflowBundleConfig } from "./bundler/rolldown-config.js";
|
|
|
46
50
|
import "./bundler/index.js";
|
|
47
51
|
import { applyIncludeExclude, expandMatrix, expandMultiDimension, expandSingleDimension } from "./matrix/expand.js";
|
|
48
52
|
import { formatExpandedJobName, formatMatrixSuffix } from "./matrix/format.js";
|
|
49
|
-
import { FanoutError, MAX_FANOUT_JOBS, VariantKind, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields } from "./fanout/materialize.js";
|
|
50
|
-
export { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, AccessLogAction, AccessLogOutcome, AccessLogPolicyKind, AccessLogSource, AccessLogTargetType, ActivityFilterSource, ActivityRowSource, ActorType, ApprovalDecision, CacheOutcome, CacheRefScope, CacheRunEventType, CacheStepType, CheckRunConclusion, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EnvDeleteErrorCode, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, FanoutError, HOST_LABEL_PREFIX, HeldRunQueueType, HeldRunStatus, HoldScope, IfFailedPolicy, InitFailureCategory, JobRejectReason, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, LabelMatcher, LockFileParseError, MAX_FANOUT_JOBS, MIN_PROTOCOL_VERSION, NeedsEntrySchema, NeedsGroupEntrySchema, ORCH_CAPABILITIES, OnUnreachableMode, OrchRole, POLICY_BY_ACTION, PROTOCOL_VERSION, PayloadOmittedReason, RegisterableTriggerType, SANDBOX_DEFAULT_VARS, SCHEMA_VERSION, SELF_REPORTED_LABEL_PREFIXES, ScalerBackendType, ScalerEventType, SourceProvider, SourceSubtype, StepApprovalOutcome, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES, TestRelayType, TimeoutReason, TriggerSource, VariantKind, WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, WS_CLOSE_DISPATCH_ACK_TIMEOUT, WS_CLOSE_GOING_AWAY, WS_CLOSE_HEARTBEAT_TIMEOUT, WS_CLOSE_INTERNAL_ERROR, WS_CLOSE_INVALID_MESSAGE, WS_CLOSE_PLAN_LIMIT, WS_CLOSE_PROTOCOL_ERROR, WS_CLOSE_RUN_NOT_FOUND, WS_CLOSE_UNAUTHORIZED, WS_MAX_PAYLOAD_BYTES, WebhookRelayResult, WsRateLimiter, accessLogFilterSchema, accessLogItemSchema, accessLogWarmSqlCase, ackSchema, activityCursorSchema, activityFilterSchema, activityRowSchema, actorPrincipalSchema, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, agentTypeLabel, apiKeyActorSchema, applyIncludeExclude, approvalRequirementSchema, approverClauseSchema, attestationListItemSchema, auditLogColdDays, auditLogWarmDays, auditLogWarmSqlCase, authFailureSchema, authRequestSchema, authSuccessSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserAuthFailureSchema, browserAuthRefreshSchema, browserAuthRequestSchema, browserAuthSuccessSchema, browserErrorSchema, browserEventLogPayloadChunkSchema, browserEventLogPayloadFetchSchema, browserGapSchema, browserJobContextSchema, browserJobNewSchema, browserJobStatusSchema, browserLogLinesSchema, browserLogStreamTerminatedReason, browserLogStreamTerminatedSchema, browserLogSubscribeSchema, browserLogUnsubscribeSchema, browserPingSchema, browserPongSchema, browserRunEventSchema, browserRunNewSchema, browserRunStatusSchema, browserStatusSubscribeSchema, browserStatusUnsubscribeSchema, browserStepStatusSchema, browserToPlatformMessageSchema, cacheStatsSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, compileRegexMatcher, configAckSchema, createTraceEntry, createWorkflowBundleConfig, createWorkflowDecision, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, decodeActivityCursor, deriveOsArchLabels, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, encodeActivityCursor, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, errorSchema, eventEmitResponseSchema, eventEmitSchema, eventLogListItemSchema, executionEventSchema, executionStatusSchema, expandMatrix, expandMultiDimension, expandSingleDimension, flattenActor, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, fleetSelectionSchema, fnv1a32, formatExpandedJobName, formatMatrixSuffix, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, gitAuthSchema, hasOrchCapability, heartbeatSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, hostEnvelopeFields, hostLabel, identityLinkItemSchema, identityLinkListResponseSchema, initFailureSchema, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, isSelfReportedLabel, isTerminal, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobContextMessageSchema, jobDispatchSchema, jobProgressSchema, jobRejectSchema, jobRerouteAckSchema, jobRerouteSchema, jobStatusForwardSchema, jobStatusSchema, joinRequestSchema, joinResponseSchema, logChunkSchema, logPullOrchToPlatformSchema, logPullPlatformToOrchSchema, manualScheduleRequestSchema, matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchScopePattern, matchWorkflowTriggers, matcherMatches, matcherSatisfiedBy, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, mergeAutoLabels, minAccessLogWarmDays, minAuditLogWarmDays, minSecretAuditLogWarmDays, nackSchema, normalizeRunsOn, orchCapabilitiesSchema, orchMetricsSchema, orchestratorToAgentMessageSchema, orchestratorToPlatformMessageSchema, orgMemberSchema, parseActor, parseHostLabel, parseMemoryString, partitionMatchers, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerDiscoverSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, peerUpdateSchema, platformOperatorActorSchema, platformToBrowserMessageSchema, platformToOrchestratorMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, registerAckSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, resolveRoleLabels, resolveRunIdSugar, resolveSecretsForEnvironment, resourceRequestNestedSchema, resourceSpecSchema, runCancelRequestSchema, runEventMessageSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, scalerAgentLabels, scalerLabel, secretAuditLogColdDays, secretAuditLogWarmDays, secretAuditLogWarmSqlCase, serviceAccountActorSchema, shouldRecordAccess, shouldRecordSecretResolve, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema, staleCheckrunCleanupSchema, stateReplaySchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, stepStatusForwardSchema, stringifyActor, stripScopePrefix, systemActorSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, transition, trustPolicyResponseSchema, trustPolicyUpdateSchema, upstreamSnapshotSchema, userActorSchema, validateNoReservedLabels, validateResourceRequest, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
|
|
53
|
+
import { FanoutCause, FanoutError, MAX_FANOUT_JOBS, VariantKind, hostEnvelopeFields, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields } from "./fanout/materialize.js";
|
|
54
|
+
export { ACCESS_LOG_COLD_DAYS, ACCESS_LOG_WARM_DAYS, AGENT_REQUIRED_KICI_VARS, ALLOWED_SYSTEM_VARS, AccessLogAction, AccessLogOutcome, AccessLogPolicyKind, AccessLogSource, AccessLogTargetType, ActivityFilterSource, ActivityRowSource, ActorType, ApprovalDecision, CacheOutcome, CacheRefScope, CacheRunEventType, CacheStepType, CheckMode, CheckRunConclusion, CheckStepOutcome, DeploymentContainerRuntimeSchema, DeploymentIdentitySchema, DeploymentModeSchema, EVENT_LOG_PAYLOAD_CHUNK_BYTES, EnvDeleteErrorCode, EventLogPayloadStreamError, EventLogSource, EventLogStatus, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, FanoutCause, FanoutError, HOST_LABEL_PREFIX, HeldRunQueueType, HeldRunStatus, HoldScope, HostInventoryEntry, HostPropertyValue, HostTargetSelector, HostTargetValue, InitFailureCategory, InventoryHostStatus, InventoryLifecycleClass, InventorySelectorSchema, JobRejectReason, KICI_AGENT_ENV_PREFIX, KNOWN_ROLES, LabelMatcher, LockFileParseError, MAX_FANOUT_JOBS, MIN_PROTOCOL_VERSION, NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, ORCH_CAPABILITIES, OnUnreachableMode, OrchRole, POLICY_BY_ACTION, PROTOCOL_VERSION, PayloadOmittedReason, RegisterableTriggerType, SANDBOX_DEFAULT_VARS, SCHEMA_VERSION, SELF_REPORTED_LABEL_PREFIXES, ScalerBackendType, ScalerEventType, SourceProvider, SourceSubtype, StepApprovalOutcome, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES, TestRelayType, TimeoutReason, TriggerSource, VariantKind, WEBHOOK_RELAY_CHUNK_SIZE, WEBHOOK_RELAY_MAX_BODY_BYTES, WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, WS_CLOSE_DISPATCH_ACK_TIMEOUT, WS_CLOSE_GOING_AWAY, WS_CLOSE_HEARTBEAT_TIMEOUT, WS_CLOSE_INTERNAL_ERROR, WS_CLOSE_INVALID_MESSAGE, WS_CLOSE_PLAN_LIMIT, WS_CLOSE_PROTOCOL_ERROR, WS_CLOSE_RUN_NOT_FOUND, WS_CLOSE_UNAUTHORIZED, WS_MAX_PAYLOAD_BYTES, WebhookRelayResult, WsRateLimiter, accessLogFilterSchema, accessLogItemSchema, accessLogWarmSqlCase, ackSchema, activityCursorSchema, activityFilterSchema, activityRowSchema, actorPrincipalSchema, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, agentTypeLabel, apiKeyActorSchema, applyIncludeExclude, approvalRequirementSchema, approverClauseSchema, attestationListItemSchema, auditLogColdDays, auditLogWarmDays, auditLogWarmSqlCase, authFailureSchema, authRequestSchema, authSuccessSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserAuthFailureSchema, browserAuthRefreshSchema, browserAuthRequestSchema, browserAuthSuccessSchema, browserErrorSchema, browserEventLogPayloadChunkSchema, browserEventLogPayloadFetchSchema, browserGapSchema, browserJobContextSchema, browserJobNewSchema, browserJobStatusSchema, browserLogLinesSchema, browserLogStreamTerminatedReason, browserLogStreamTerminatedSchema, browserLogSubscribeSchema, browserLogUnsubscribeSchema, browserPingSchema, browserPongSchema, browserRunEventSchema, browserRunNewSchema, browserRunStatusSchema, browserStatusSubscribeSchema, browserStatusUnsubscribeSchema, browserStepStatusSchema, browserToPlatformMessageSchema, cacheStatsSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, coerceHostPropertyValue, compileRegexMatcher, configAckSchema, createTraceEntry, createWorkflowBundleConfig, createWorkflowDecision, dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardFleetHostRequestSchema, dashboardFleetHostResponseSchema, dashboardFleetHostsRequestSchema, dashboardFleetHostsResponseSchema, dashboardFleetPreviewRequestSchema, dashboardFleetPreviewResponseSchema, dashboardJobDetailSchema, dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, decodeActivityCursor, deriveOsArchLabels, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, encodeActivityCursor, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, errorSchema, eventEmitResponseSchema, eventEmitSchema, eventLogListItemSchema, executionEventSchema, executionStatusSchema, expandMatrix, expandMultiDimension, expandSingleDimension, flattenActor, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetHostDeclareRequestSchema, fleetHostDeclareResponseSchema, fleetHostRemoveRequestSchema, fleetHostRemoveResponseSchema, fleetLogsRequestSchema, fleetPinnedRunSchema, fleetPreviewHostSchema, fleetSelectionSchema, fnv1a32, formatExpandedJobName, formatMatrixSuffix, getAccessLogColdDays, getAccessLogWarmDays, getAuditLogColdDays, getAuditLogWarmDays, getSecretAuditLogColdDays, getSecretAuditLogWarmDays, gitAuthSchema, githubWebhookPath, hasOrchCapability, heartbeatSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, hostEnvelopeFields, hostLabel, hostSatisfiesTarget, identityLinkItemSchema, identityLinkListResponseSchema, initFailureSchema, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob, isSelfReportedLabel, isTerminal, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobContextMessageSchema, jobDispatchSchema, jobProgressAckSchema, jobProgressSchema, jobRejectSchema, jobRerouteAckSchema, jobRerouteSchema, jobStatusForwardSchema, jobStatusSchema, joinRequestSchema, joinResponseSchema, logChunkSchema, logPullOrchToPlatformSchema, logPullPlatformToOrchSchema, manualScheduleRequestSchema, matchAllWorkflows, matchBranchPattern, matchPathPatterns, matchRepoPatterns, matchScopePattern, matchWorkflowTriggers, matcherMatches, matcherSatisfiedBy, materializeFanout, materializeResolvedHosts, materializeResolvedMatrix, matrixEnvelopeFields, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, mergeAutoLabels, minAccessLogWarmDays, minAuditLogWarmDays, minSecretAuditLogWarmDays, nackSchema, normalizeRunsOn, orchCapabilitiesSchema, orchMetricsSchema, orchestratorToAgentMessageSchema, orchestratorToPlatformMessageSchema, orgMemberSchema, parseActor, parseHostLabel, parseHostPropertyAssignments, parseMemoryString, partitionMatchers, peerAgentTokenRevokeSchema, peerAuthRequestSchema, peerAuthResponseSchema, peerCapabilitiesSchema, peerConfigReloadResponseSchema, peerConfigReloadSchema, peerDiscoverSchema, peerFromPeerMessageSchema, peerHeartbeatSchema, peerHelloResponseSchema, peerHelloSchema, peerJobCancelSchema, peerLeavingSchema, peerLogsCollectChunkSchema, peerLogsCollectErrorSchema, peerLogsCollectRequestSchema, peerScalerEventSchema, peerToPeerMessageSchema, peerUpdateSchema, platformOperatorActorSchema, platformToBrowserMessageSchema, platformToOrchestratorMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, raftAppendEntriesSchema, raftVoteRequestSchema, raftVoteResponseSchema, registerAckSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, resolveRoleLabels, resolveRunIdSugar, resolveSecretsForEnvironment, resolveWhenToRunOn, resourceRequestNestedSchema, resourceSpecSchema, runCancelRequestSchema, runEventMessageSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, scalerAgentLabels, scalerLabel, secretAuditLogColdDays, secretAuditLogWarmDays, secretAuditLogWarmSqlCase, serviceAccountActorSchema, shouldRecordAccess, shouldRecordSecretResolve, sourceDeregisterAckSchema, sourceDeregisterSchema, sourceRegistrationAckSchema, sourceRegistrationSchema, staleCheckrunCleanupSchema, stateReplaySchema, stepApprovalPayloadSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, stepStatusForwardSchema, stringifyActor, stripScopePrefix, systemActorSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, transition, trustPolicyResponseSchema, trustPolicyUpdateSchema, upstreamSnapshotSchema, userActorSchema, validateNoReservedLabels, validateResourceRequest, webhookAckSchema, webhookRelayChunkSchema, webhookRelaySchema, webhookRelayStartSchema };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical, workflow-queryable host inventory schema.
|
|
3
|
+
*
|
|
4
|
+
* One `HostInventoryEntry` is the single shape every inventory consumer reads:
|
|
5
|
+
* the orchestrator's roster store maps each `host_roster` row to it, the
|
|
6
|
+
* `inventory.query`/`inventory.get` agent-API RPC returns it, and the SDK's
|
|
7
|
+
* `ctx.kici.inventory` types it. Labels stay the flat-string grouping
|
|
8
|
+
* dimension (the shipped runsOnAll glob/regex matchers operate on flat
|
|
9
|
+
* strings); `properties` is the separate typed host-vars dimension.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import { LabelMatcher } from './labels-match.js';
|
|
13
|
+
/** A single host-property value — the typed host-vars dimension. */
|
|
14
|
+
export declare const HostPropertyValue: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
15
|
+
export type HostPropertyValue = z.infer<typeof HostPropertyValue>;
|
|
16
|
+
/**
|
|
17
|
+
* Lifecycle class of a roster host. Mirrors the orchestrator's `LifecycleClass`
|
|
18
|
+
* (the auth token's `agent_type` snapshot): `static` hosts persist and alarm on
|
|
19
|
+
* absence; `ephemeral` hosts are GC'd past their ttl.
|
|
20
|
+
*/
|
|
21
|
+
export declare const InventoryLifecycleClass: z.ZodEnum<{
|
|
22
|
+
static: "static";
|
|
23
|
+
ephemeral: "ephemeral";
|
|
24
|
+
}>;
|
|
25
|
+
export type InventoryLifecycleClass = z.infer<typeof InventoryLifecycleClass>;
|
|
26
|
+
/**
|
|
27
|
+
* Read-time derived status of a roster host. Mirrors the orchestrator's
|
|
28
|
+
* `HostStatus` values: `ready` (live + fresh heartbeat), `unreachable`
|
|
29
|
+
* (declared static host not currently live), `stale` (ephemeral past ttl,
|
|
30
|
+
* awaiting reap).
|
|
31
|
+
*/
|
|
32
|
+
export declare const InventoryHostStatus: z.ZodEnum<{
|
|
33
|
+
ready: "ready";
|
|
34
|
+
unreachable: "unreachable";
|
|
35
|
+
stale: "stale";
|
|
36
|
+
}>;
|
|
37
|
+
export type InventoryHostStatus = z.infer<typeof InventoryHostStatus>;
|
|
38
|
+
/** Canonical queryable inventory record for one roster host. */
|
|
39
|
+
export declare const HostInventoryEntry: z.ZodObject<{
|
|
40
|
+
agentId: z.ZodString;
|
|
41
|
+
labels: z.ZodArray<z.ZodString>;
|
|
42
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
43
|
+
hostname: z.ZodNullable<z.ZodString>;
|
|
44
|
+
platform: z.ZodNullable<z.ZodString>;
|
|
45
|
+
arch: z.ZodNullable<z.ZodString>;
|
|
46
|
+
lifecycleClass: z.ZodEnum<{
|
|
47
|
+
static: "static";
|
|
48
|
+
ephemeral: "ephemeral";
|
|
49
|
+
}>;
|
|
50
|
+
status: z.ZodEnum<{
|
|
51
|
+
ready: "ready";
|
|
52
|
+
unreachable: "unreachable";
|
|
53
|
+
stale: "stale";
|
|
54
|
+
}>;
|
|
55
|
+
lastSeen: z.ZodString;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type HostInventoryEntry = z.infer<typeof HostInventoryEntry>;
|
|
58
|
+
/**
|
|
59
|
+
* Label selector for `inventory.query`. Reuses the shipped `LabelMatcher`
|
|
60
|
+
* (glob/regex) semantics: `include` is an OR-of-AND group list, `exclude`
|
|
61
|
+
* removes any host whose labels satisfy a matcher. Omit ⇒ all hosts.
|
|
62
|
+
* Property filtering is done client-side in the workflow (full JS).
|
|
63
|
+
*/
|
|
64
|
+
export interface InventorySelector {
|
|
65
|
+
include?: (readonly LabelMatcher[])[];
|
|
66
|
+
exclude?: LabelMatcher[];
|
|
67
|
+
}
|
|
68
|
+
/** Zod validator for the `inventory.query` selector params on the wire. */
|
|
69
|
+
export declare const InventorySelectorSchema: z.ZodObject<{
|
|
70
|
+
include: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
71
|
+
kind: z.ZodLiteral<"exact">;
|
|
72
|
+
value: z.ZodString;
|
|
73
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
74
|
+
kind: z.ZodLiteral<"regex">;
|
|
75
|
+
source: z.ZodString;
|
|
76
|
+
flags: z.ZodString;
|
|
77
|
+
}, z.core.$strip>], "kind">>>>;
|
|
78
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
79
|
+
kind: z.ZodLiteral<"exact">;
|
|
80
|
+
value: z.ZodString;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
kind: z.ZodLiteral<"regex">;
|
|
83
|
+
source: z.ZodString;
|
|
84
|
+
flags: z.ZodString;
|
|
85
|
+
}, z.core.$strip>], "kind">>>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
/**
|
|
88
|
+
* Coerce a raw string into a typed {@link HostPropertyValue}: `true`/`false` ⇒
|
|
89
|
+
* boolean, a finite integer/decimal literal ⇒ number, everything else ⇒ the
|
|
90
|
+
* verbatim string. The single source of truth for the `key=value` typing used
|
|
91
|
+
* by both `kici-admin host declare --prop` and the agent's `KICI_PROPERTIES`.
|
|
92
|
+
*/
|
|
93
|
+
export declare function coerceHostPropertyValue(raw: string): HostPropertyValue;
|
|
94
|
+
/**
|
|
95
|
+
* Parse a list of `key=value` property assignments into a typed property bag.
|
|
96
|
+
* Values are typed via {@link coerceHostPropertyValue}. Throws on a malformed
|
|
97
|
+
* entry (missing `=`) or an empty key. Used by the host-declare CLI `--prop`
|
|
98
|
+
* option and the agent's `KICI_PROPERTIES` config parse.
|
|
99
|
+
*/
|
|
100
|
+
export declare function parseHostPropertyAssignments(values: string[]): Record<string, HostPropertyValue>;
|
|
101
|
+
//# sourceMappingURL=inventory.d.ts.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import "./chunk-BTugEXQM.js";
|
|
2
|
+
import { LabelMatcher } from "./labels-match.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/inventory.ts
|
|
5
|
+
/**
|
|
6
|
+
* Canonical, workflow-queryable host inventory schema.
|
|
7
|
+
*
|
|
8
|
+
* One `HostInventoryEntry` is the single shape every inventory consumer reads:
|
|
9
|
+
* the orchestrator's roster store maps each `host_roster` row to it, the
|
|
10
|
+
* `inventory.query`/`inventory.get` agent-API RPC returns it, and the SDK's
|
|
11
|
+
* `ctx.kici.inventory` types it. Labels stay the flat-string grouping
|
|
12
|
+
* dimension (the shipped runsOnAll glob/regex matchers operate on flat
|
|
13
|
+
* strings); `properties` is the separate typed host-vars dimension.
|
|
14
|
+
*/
|
|
15
|
+
/** A single host-property value — the typed host-vars dimension. */
|
|
16
|
+
const HostPropertyValue = z.union([
|
|
17
|
+
z.string(),
|
|
18
|
+
z.number(),
|
|
19
|
+
z.boolean()
|
|
20
|
+
]);
|
|
21
|
+
/**
|
|
22
|
+
* Lifecycle class of a roster host. Mirrors the orchestrator's `LifecycleClass`
|
|
23
|
+
* (the auth token's `agent_type` snapshot): `static` hosts persist and alarm on
|
|
24
|
+
* absence; `ephemeral` hosts are GC'd past their ttl.
|
|
25
|
+
*/
|
|
26
|
+
const InventoryLifecycleClass = z.enum(["static", "ephemeral"]);
|
|
27
|
+
/**
|
|
28
|
+
* Read-time derived status of a roster host. Mirrors the orchestrator's
|
|
29
|
+
* `HostStatus` values: `ready` (live + fresh heartbeat), `unreachable`
|
|
30
|
+
* (declared static host not currently live), `stale` (ephemeral past ttl,
|
|
31
|
+
* awaiting reap).
|
|
32
|
+
*/
|
|
33
|
+
const InventoryHostStatus = z.enum([
|
|
34
|
+
"ready",
|
|
35
|
+
"unreachable",
|
|
36
|
+
"stale"
|
|
37
|
+
]);
|
|
38
|
+
/** Canonical queryable inventory record for one roster host. */
|
|
39
|
+
const HostInventoryEntry = z.object({
|
|
40
|
+
agentId: z.string(),
|
|
41
|
+
/** Flat-string grouping/tags dimension (runsOnAll selectors operate on these). */
|
|
42
|
+
labels: z.array(z.string()),
|
|
43
|
+
/** Typed host-vars dimension (the ansible host-vars analogue). */
|
|
44
|
+
properties: z.record(z.string(), HostPropertyValue),
|
|
45
|
+
hostname: z.string().nullable(),
|
|
46
|
+
platform: z.string().nullable(),
|
|
47
|
+
arch: z.string().nullable(),
|
|
48
|
+
lifecycleClass: InventoryLifecycleClass,
|
|
49
|
+
status: InventoryHostStatus,
|
|
50
|
+
/** ISO 8601 timestamp of the last heartbeat. */
|
|
51
|
+
lastSeen: z.string()
|
|
52
|
+
});
|
|
53
|
+
/** Zod validator for the `inventory.query` selector params on the wire. */
|
|
54
|
+
const InventorySelectorSchema = z.object({
|
|
55
|
+
include: z.array(z.array(LabelMatcher)).optional(),
|
|
56
|
+
exclude: z.array(LabelMatcher).optional()
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Coerce a raw string into a typed {@link HostPropertyValue}: `true`/`false` ⇒
|
|
60
|
+
* boolean, a finite integer/decimal literal ⇒ number, everything else ⇒ the
|
|
61
|
+
* verbatim string. The single source of truth for the `key=value` typing used
|
|
62
|
+
* by both `kici-admin host declare --prop` and the agent's `KICI_PROPERTIES`.
|
|
63
|
+
*/
|
|
64
|
+
function coerceHostPropertyValue(raw) {
|
|
65
|
+
if (raw === "true") return true;
|
|
66
|
+
if (raw === "false") return false;
|
|
67
|
+
if (raw !== "" && /^-?\d+(\.\d+)?$/.test(raw) && Number.isFinite(Number(raw))) return Number(raw);
|
|
68
|
+
return raw;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Parse a list of `key=value` property assignments into a typed property bag.
|
|
72
|
+
* Values are typed via {@link coerceHostPropertyValue}. Throws on a malformed
|
|
73
|
+
* entry (missing `=`) or an empty key. Used by the host-declare CLI `--prop`
|
|
74
|
+
* option and the agent's `KICI_PROPERTIES` config parse.
|
|
75
|
+
*/
|
|
76
|
+
function parseHostPropertyAssignments(values) {
|
|
77
|
+
const out = {};
|
|
78
|
+
for (const entry of values) {
|
|
79
|
+
const eq = entry.indexOf("=");
|
|
80
|
+
if (eq <= 0) throw new Error(`Invalid property '${entry}': expected key=value`);
|
|
81
|
+
const key = entry.slice(0, eq);
|
|
82
|
+
out[key] = coerceHostPropertyValue(entry.slice(eq + 1));
|
|
83
|
+
}
|
|
84
|
+
return out;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { HostInventoryEntry, HostPropertyValue, InventoryHostStatus, InventoryLifecycleClass, InventorySelectorSchema, coerceHostPropertyValue, parseHostPropertyAssignments };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=inventory.js.map
|