@kici-dev/engine 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +13 -1
  2. package/dist/approval/types.d.ts +56 -0
  3. package/dist/approval/types.js +42 -0
  4. package/dist/audit/access-log-policy.js +14 -0
  5. package/dist/audit/retention-policy.js +10 -0
  6. package/dist/environment/types.d.ts +8 -0
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.js +10 -8
  9. package/dist/labels.d.ts +7 -0
  10. package/dist/labels.js +11 -2
  11. package/dist/metrics/metric-catalog.generated.d.ts +50 -0
  12. package/dist/metrics/metric-catalog.generated.js +60 -0
  13. package/dist/protocol/analytics-events.d.ts +16 -0
  14. package/dist/protocol/analytics-events.js +20 -0
  15. package/dist/protocol/dashboard-write-operations.d.ts +4 -1
  16. package/dist/protocol/dashboard-write-operations.js +11 -1
  17. package/dist/protocol/messages/access-log.d.ts +26 -0
  18. package/dist/protocol/messages/access-log.js +5 -0
  19. package/dist/protocol/messages/actor.d.ts +2 -0
  20. package/dist/protocol/messages/actor.js +12 -2
  21. package/dist/protocol/messages/auth.d.ts +1 -0
  22. package/dist/protocol/messages/capabilities.d.ts +1 -0
  23. package/dist/protocol/messages/dashboard-global-workflows.d.ts +2 -0
  24. package/dist/protocol/messages/dashboard.d.ts +619 -6
  25. package/dist/protocol/messages/dashboard.js +179 -10
  26. package/dist/protocol/messages/event-log.d.ts +4 -0
  27. package/dist/protocol/messages/event-log.js +4 -0
  28. package/dist/protocol/messages/execution-status.d.ts +56 -3
  29. package/dist/protocol/messages/execution-status.js +44 -4
  30. package/dist/protocol/messages/orchestrator-agent.d.ts +284 -0
  31. package/dist/protocol/messages/orchestrator-agent.js +202 -4
  32. package/dist/protocol/messages/peer.d.ts +89 -0
  33. package/dist/protocol/messages/peer.js +50 -2
  34. package/dist/protocol/messages/platform-orchestrator.d.ts +168 -6
  35. package/dist/protocol/messages/platform-orchestrator.js +15 -56
  36. package/dist/protocol/messages/run-events.d.ts +1 -0
  37. package/dist/provenance/schema.d.ts +407 -0
  38. package/dist/provenance/schema.js +143 -0
  39. package/dist/provider/index.d.ts +1 -0
  40. package/dist/provider/index.js +2 -1
  41. package/dist/provider/lock-file-parse-error.d.ts +14 -0
  42. package/dist/provider/lock-file-parse-error.js +22 -0
  43. package/dist/trigger/types.d.ts +29 -1
  44. package/dist/trigger/types.js +4 -1
  45. package/dist/ws/close-codes.d.ts +7 -0
  46. package/dist/ws/close-codes.js +8 -1
  47. package/package.json +19 -8
  48. package/sbom.spdx.json +5 -5
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Thrown by a LockFileFetcher when a lock file is present at the repo ref but
3
+ * cannot be parsed or validated (empty content, invalid JSON, missing/invalid
4
+ * schemaVersion). Distinct from "not found" (the fetcher returns null) and from
5
+ * transient fetch errors (plain Error). The orchestrator routes this to a
6
+ * `lock_resolution` init-failure run.
7
+ */
8
+ export declare class LockFileParseError extends Error {
9
+ readonly repoIdentifier: string;
10
+ readonly ref: string;
11
+ readonly name = "LockFileParseError";
12
+ constructor(repoIdentifier: string, ref: string, message: string);
13
+ }
14
+ //# sourceMappingURL=lock-file-parse-error.d.ts.map
@@ -0,0 +1,22 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ //#region src/provider/lock-file-parse-error.ts
3
+ /**
4
+ * Thrown by a LockFileFetcher when a lock file is present at the repo ref but
5
+ * cannot be parsed or validated (empty content, invalid JSON, missing/invalid
6
+ * schemaVersion). Distinct from "not found" (the fetcher returns null) and from
7
+ * transient fetch errors (plain Error). The orchestrator routes this to a
8
+ * `lock_resolution` init-failure run.
9
+ */
10
+ var LockFileParseError = class LockFileParseError extends Error {
11
+ name = "LockFileParseError";
12
+ constructor(repoIdentifier, ref, message) {
13
+ super(message);
14
+ this.repoIdentifier = repoIdentifier;
15
+ this.ref = ref;
16
+ Object.setPrototypeOf(this, LockFileParseError.prototype);
17
+ }
18
+ };
19
+ //#endregion
20
+ export { LockFileParseError };
21
+
22
+ //# sourceMappingURL=lock-file-parse-error.js.map
@@ -8,11 +8,28 @@
8
8
  * Schema version 9: adds repos/notRepos repo pattern fields to git-event triggers for global workflow matching.
9
9
  * Schema version 10: removes notRepos/notPaths fields, negative patterns use ! prefix in repos/paths arrays.
10
10
  * Schema version 11: adds LockInlineValue type for pure function inline evaluation.
11
+ * Schema version 14: adds declarative cache specs to LockJob and LockStep.
12
+ * Schema version 15: adds per-job init config(s) to LockJob.
13
+ * Schema version 16: adds normalized approval config to LockWorkflow/LockJob/LockStep.
11
14
  */
12
15
  import { z } from 'zod';
13
16
  import type { ProviderType } from '../provider/types.js';
17
+ import type { ApproverClause } from '../approval/types.js';
14
18
  /** Schema version - increment on breaking changes */
15
- export declare const SCHEMA_VERSION: 12;
19
+ export declare const SCHEMA_VERSION: 16;
20
+ /**
21
+ * Normalized approval config carried in the lock file. Produced by the compiler
22
+ * from an SDK `requireApproval` at any of the three levels; consumed by the
23
+ * orchestrator dispatch gate (and the agent step round-trip for step scope).
24
+ */
25
+ export interface LockApproval {
26
+ /** AND list of approver clauses; empty means "any approval-capable member". */
27
+ readonly clauses: ApproverClause[];
28
+ /** Human label for the gate. */
29
+ readonly reason?: string;
30
+ /** Per-gate expiry override (seconds); falls back to the org default. */
31
+ readonly timeoutSeconds?: number;
32
+ }
16
33
  /**
17
34
  * Source file reference with meaningful path.
18
35
  * Format: file is relative path from git root, export uses hash syntax.
@@ -313,6 +330,8 @@ export interface LockStep {
313
330
  readonly line: number;
314
331
  readonly column: number;
315
332
  };
333
+ /** Normalized approval gate; when set the step pauses for a human approval. */
334
+ readonly approval?: LockApproval;
316
335
  }
317
336
  /**
318
337
  * Inline expression value for pure dynamic functions.
@@ -381,12 +400,16 @@ export interface LockJob {
381
400
  readonly concurrencyGroup?: string | LockInlineValue;
382
401
  /** When true, concurrencyGroup is dynamic (function) -- resolved at orchestrator two-phase eval or inline. */
383
402
  readonly dynamicConcurrencyGroup?: boolean;
403
+ /** Total job wall-clock timeout in milliseconds (init + all steps + hooks). Threaded to the agent via jobConfig. */
404
+ readonly timeout?: number;
384
405
  /**
385
406
  * Resource request and limit for this job.
386
407
  * Threaded from SDK `Job.resources` to the orchestrator scaler for cap accounting
387
408
  * (`requests`) and kernel-side enforcement (`limits`) on the spawned agent.
388
409
  */
389
410
  readonly resources?: import('../scaler/resource-types.js').ResourceRequest;
411
+ /** Normalized approval gate; when set the job is held before dispatch. */
412
+ readonly approval?: LockApproval;
390
413
  }
391
414
  /**
392
415
  * Dynamic job generator reference.
@@ -454,6 +477,10 @@ export interface LockWorkflow {
454
477
  readonly cancelInProgress?: boolean;
455
478
  readonly max?: number;
456
479
  };
480
+ /** Whole-run wall-clock timeout in milliseconds. Read by the orchestrator at run creation to set the run deadline. */
481
+ readonly timeout?: number;
482
+ /** Normalized approval gate; when set the whole run is held before any job dispatches. */
483
+ readonly approval?: LockApproval;
457
484
  }
458
485
  /**
459
486
  * Complete lock file structure.
@@ -470,6 +497,7 @@ export interface LockWorkflow {
470
497
  * v10 removes notRepos/notPaths fields; negative patterns use ! prefix in repos/paths arrays.
471
498
  * v11 adds LockInlineValue type for pure function inline evaluation.
472
499
  * v12 adds workflow-level registries and installEnv for private npm registry auth.
500
+ * v13 adds job-level and workflow-level timeout.
473
501
  */
474
502
  export interface LockFile {
475
503
  readonly schemaVersion: typeof SCHEMA_VERSION;
@@ -11,9 +11,12 @@ import { z } from "zod";
11
11
  * Schema version 9: adds repos/notRepos repo pattern fields to git-event triggers for global workflow matching.
12
12
  * Schema version 10: removes notRepos/notPaths fields, negative patterns use ! prefix in repos/paths arrays.
13
13
  * Schema version 11: adds LockInlineValue type for pure function inline evaluation.
14
+ * Schema version 14: adds declarative cache specs to LockJob and LockStep.
15
+ * Schema version 15: adds per-job init config(s) to LockJob.
16
+ * Schema version 16: adds normalized approval config to LockWorkflow/LockJob/LockStep.
14
17
  */
15
18
  /** Schema version - increment on breaking changes */
16
- const SCHEMA_VERSION = 12;
19
+ const SCHEMA_VERSION = 16;
17
20
  /** Type guard for inline expression values */
18
21
  function isLockInlineValue(value) {
19
22
  return typeof value === "object" && value !== null && value._type === "inline";
@@ -31,4 +31,11 @@ export declare const WS_CLOSE_PLAN_LIMIT = 4020;
31
31
  export declare const WS_CLOSE_CLUSTER_NAME_CONFLICT = 4011;
32
32
  /** The connection was closed because the requested run was not found. */
33
33
  export declare const WS_CLOSE_RUN_NOT_FOUND = 4030;
34
+ /**
35
+ * The connection was closed because a job dispatch went unacknowledged past
36
+ * its deadline. The orchestrator treats the dispatch as lost, requeues the
37
+ * job, and disconnects the unresponsive agent (scaler-managed agents are then
38
+ * destroyed by their normal lifecycle; static agents reconnect and re-sync).
39
+ */
40
+ export declare const WS_CLOSE_DISPATCH_ACK_TIMEOUT = 4031;
34
41
  //# sourceMappingURL=close-codes.d.ts.map
@@ -33,7 +33,14 @@ const WS_CLOSE_PLAN_LIMIT = 4020;
33
33
  const WS_CLOSE_CLUSTER_NAME_CONFLICT = 4011;
34
34
  /** The connection was closed because the requested run was not found. */
35
35
  const WS_CLOSE_RUN_NOT_FOUND = 4030;
36
+ /**
37
+ * The connection was closed because a job dispatch went unacknowledged past
38
+ * its deadline. The orchestrator treats the dispatch as lost, requeues the
39
+ * job, and disconnects the unresponsive agent (scaler-managed agents are then
40
+ * destroyed by their normal lifecycle; static agents reconnect and re-sync).
41
+ */
42
+ const WS_CLOSE_DISPATCH_ACK_TIMEOUT = 4031;
36
43
  //#endregion
37
- export { WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, 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 };
44
+ export { 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 };
38
45
 
39
46
  //# sourceMappingURL=close-codes.js.map
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@kici-dev/engine",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
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
- "kici",
7
6
  "ci",
8
- "cd",
9
- "ci-cd",
7
+ "cicd",
8
+ "continuous-integration",
10
9
  "typescript",
11
- "workflows",
12
- "devops",
13
- "engine",
14
- "protocol"
10
+ "workflow",
11
+ "engine"
15
12
  ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/kici-dev/kici-public.git",
16
+ "directory": "packages/engine"
17
+ },
18
+ "bugs": "https://github.com/kici-dev/kici-public/issues",
16
19
  "homepage": "https://kici.dev",
17
20
  "author": {
18
21
  "name": "KiCI",
@@ -54,10 +57,18 @@
54
57
  "import": "./dist/protocol/dashboard-write-operations.js",
55
58
  "types": "./dist/protocol/dashboard-write-operations.d.ts"
56
59
  },
60
+ "./protocol/analytics-events": {
61
+ "import": "./dist/protocol/analytics-events.js",
62
+ "types": "./dist/protocol/analytics-events.d.ts"
63
+ },
57
64
  "./protocol/cluster-name": {
58
65
  "import": "./dist/protocol/cluster-name.js",
59
66
  "types": "./dist/protocol/cluster-name.d.ts"
60
67
  },
68
+ "./provenance/schema": {
69
+ "import": "./dist/provenance/schema.js",
70
+ "types": "./dist/provenance/schema.d.ts"
71
+ },
61
72
  "./metrics/catalog": {
62
73
  "import": "./dist/metrics/metric-catalog.generated.js",
63
74
  "types": "./dist/metrics/metric-catalog.generated.d.ts"
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.1.14",
6
- "documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.1.14/e0f9b814-d366-4ae4-8be4-0663a2fdb6d7",
5
+ "name": "@kici-dev/engine@0.1.16",
6
+ "documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.1.16/33d50570-d86e-4a27-b1c9-26cef35a15c7",
7
7
  "creationInfo": {
8
- "created": "2026-05-30T03:05:55Z",
8
+ "created": "2026-06-12T09:41:34Z",
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.1.14",
57
+ "versionInfo": "0.1.16",
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.1.14"
68
+ "referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.16"
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.",