@kontextmind/kxm 0.7.40 → 0.7.44

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 (178) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +45 -7
  3. package/docs/README.md +5 -3
  4. package/docs/agent-skills.md +1 -1
  5. package/docs/architecture.md +1 -1
  6. package/docs/configuration.md +28 -5
  7. package/docs/{vnext → contracts}/README.md +7 -7
  8. package/docs/{vnext → contracts}/architecture.md +2 -2
  9. package/docs/{vnext → contracts}/migration.md +25 -25
  10. package/docs/{vnext → contracts}/routing.md +2 -2
  11. package/docs/{vnext → contracts}/synchronization.md +1 -1
  12. package/docs/{vnext → contracts}/validation.md +7 -7
  13. package/docs/getting-started.md +1 -1
  14. package/docs/kb/qa-authentik-authentication.md +47 -0
  15. package/docs/kb/qa-extension-install-and-hub-bootstrap.md +68 -0
  16. package/docs/kb/qa-hub-on-a-public-host.md +31 -0
  17. package/docs/kb/qa-sqlite-vs-duckdb.md +18 -0
  18. package/docs/kb/qa-what-the-hub-stores.md +47 -0
  19. package/docs/packages.md +91 -0
  20. package/docs/templates/architecture.md +1 -1
  21. package/docs/test-matrix.md +6 -6
  22. package/docs/tui-components.md +131 -0
  23. package/examples/README.md +2 -2
  24. package/examples/{vnext → project}/.kxm/agents/critic-3.yaml +1 -1
  25. package/examples/{vnext → project}/README.md +4 -4
  26. package/package.json +18 -8
  27. package/packages/core/tui/CHANGELOG.md +19 -0
  28. package/packages/core/tui/LICENSE +21 -0
  29. package/packages/core/tui/README.md +45 -0
  30. package/packages/core/tui/dist/index.js +1439 -0
  31. package/packages/core/tui/src/adapters/pi.ts +73 -0
  32. package/packages/core/tui/src/adapters/terminal.ts +106 -0
  33. package/packages/core/tui/src/exports/index.ts +30 -0
  34. package/packages/core/tui/src/services/registry.ts +274 -0
  35. package/packages/core/tui/src/tui/keys.ts +130 -0
  36. package/packages/core/tui/src/tui/layout.ts +117 -0
  37. package/packages/core/tui/src/tui/panel.ts +435 -0
  38. package/packages/core/tui/src/tui/panelComponent.ts +208 -0
  39. package/packages/core/tui/src/tui/render.ts +309 -0
  40. package/packages/core/tui/src/tui/theme.ts +145 -0
  41. package/packages/core/tui/src/types/surface.ts +407 -0
  42. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  43. package/plugins/kxm/dist/cli.js +681 -553
  44. package/plugins/kxm/dist/extension.js +18 -18
  45. package/plugins/kxm/dist/mcp-server.js +1 -1
  46. package/plugins/kxm/dist/{vnext-runtime-supervisor.js → runtime-supervisor.js} +553 -553
  47. package/plugins/kxm/dist/runtime.js +608 -608
  48. package/plugins/kxm/dist/server.js +13 -13
  49. package/plugins/kxm/package.json +2 -2
  50. package/plugins/kxm/skills/kxm-project-setup/SKILL.md +2 -2
  51. package/plugins/kxm/skills/kxm-runs/SKILL.md +3 -3
  52. package/plugins/kxm/skills/kxm-session/SKILL.md +1 -1
  53. package/plugins/kxm/skills/kxm-workflow/SKILL.md +1 -1
  54. package/plugins/kxm/src/autocomplete.ts +4 -4
  55. package/plugins/kxm/src/{vnext-bindings.ts → bindings.ts} +48 -48
  56. package/plugins/kxm/src/cli/hub.ts +3 -3
  57. package/plugins/kxm/src/cli/{vnext.ts → project.ts} +106 -106
  58. package/plugins/kxm/src/cli/roles.ts +9 -9
  59. package/plugins/kxm/src/cli/system.ts +2 -2
  60. package/plugins/kxm/src/cli/tasks.ts +8 -8
  61. package/plugins/kxm/src/cli/workflows.ts +8 -8
  62. package/plugins/kxm/src/cli.ts +47 -47
  63. package/plugins/kxm/src/config.ts +69 -14
  64. package/plugins/kxm/src/database.ts +4 -4
  65. package/plugins/kxm/src/{vnext-engine-artifacts.ts → engine-artifacts.ts} +7 -7
  66. package/plugins/kxm/src/{vnext-engine-command.ts → engine-command.ts} +40 -40
  67. package/plugins/kxm/src/{vnext-engine-compile.ts → engine-compile.ts} +64 -64
  68. package/plugins/kxm/src/{vnext-engine-evidence.ts → engine-evidence.ts} +26 -26
  69. package/plugins/kxm/src/{vnext-engine-fold.ts → engine-fold.ts} +99 -99
  70. package/plugins/kxm/src/{vnext-engine-gate-records.ts → engine-gate-records.ts} +105 -105
  71. package/plugins/kxm/src/{vnext-engine-plan.ts → engine-plan.ts} +69 -69
  72. package/plugins/kxm/src/{vnext-engine.ts → engine.ts} +502 -502
  73. package/plugins/kxm/src/gate-hash.ts +10 -0
  74. package/plugins/kxm/src/{vnext-harness.ts → harness.ts} +1 -1
  75. package/plugins/kxm/src/hub.ts +1 -1
  76. package/plugins/kxm/src/init-guide-setup.ts +3 -3
  77. package/plugins/kxm/src/{vnext-init.ts → init.ts} +93 -93
  78. package/plugins/kxm/src/kxm-install-kind.ts +1 -1
  79. package/plugins/kxm/src/kxm-update-config.ts +2 -2
  80. package/plugins/kxm/src/local-snapshot.ts +23 -23
  81. package/plugins/kxm/src/mcp-server.ts +1 -1
  82. package/plugins/kxm/src/{vnext-migrate.ts → migrate.ts} +123 -123
  83. package/plugins/kxm/src/model-inventory.ts +1 -1
  84. package/plugins/kxm/src/{vnext-oneshot-evidence.ts → oneshot-evidence.ts} +2 -2
  85. package/plugins/kxm/src/{vnext-oneshot-process.ts → oneshot-process.ts} +4 -4
  86. package/plugins/kxm/src/{vnext-oneshot-producer.ts → oneshot-producer.ts} +24 -24
  87. package/plugins/kxm/src/{vnext-permission.ts → permission.ts} +86 -86
  88. package/plugins/kxm/src/{vnext-pi-producer.ts → pi-producer.ts} +13 -13
  89. package/plugins/kxm/src/{vnext-config.ts → project-config.ts} +177 -177
  90. package/plugins/kxm/src/{vnext-repair.ts → repair.ts} +159 -159
  91. package/plugins/kxm/src/restricted-yaml.d.mts +3 -3
  92. package/plugins/kxm/src/restricted-yaml.mjs +4 -4
  93. package/plugins/kxm/src/{vnext-runtime-owner.ts → runtime-owner.ts} +35 -35
  94. package/plugins/kxm/src/{vnext-runtime.ts → runtime-service.ts} +136 -136
  95. package/plugins/kxm/src/{vnext-runtime-store.ts → runtime-store.ts} +145 -145
  96. package/plugins/kxm/src/{vnext-runtime-supervisor.ts → runtime-supervisor.ts} +80 -80
  97. package/plugins/kxm/src/runtime.ts +6 -6
  98. package/plugins/kxm/src/session-work.ts +3 -3
  99. package/plugins/kxm/src/studio-layout.ts +6 -6
  100. package/plugins/kxm/src/{vnext-template.ts → template.ts} +33 -33
  101. package/plugins/kxm/src/tui.ts +10 -24
  102. package/schemas/{vnext/README.md → README.md} +3 -3
  103. package/schemas/{vnext/agent.schema.json → agent.schema.json} +1 -1
  104. package/schemas/{vnext/assignment-result.schema.json → assignment-result.schema.json} +1 -1
  105. package/schemas/{vnext/backup-manifest.schema.json → backup-manifest.schema.json} +1 -1
  106. package/schemas/{vnext/candidate.schema.json → candidate.schema.json} +1 -1
  107. package/schemas/{vnext/common.schema.json → common.schema.json} +2 -2
  108. package/schemas/{vnext/context-candidate.schema.json → context-candidate.schema.json} +1 -1
  109. package/schemas/{vnext/context-packet.schema.json → context-packet.schema.json} +1 -1
  110. package/schemas/{vnext/delivery-manifest.schema.json → delivery-manifest.schema.json} +1 -1
  111. package/schemas/{vnext/drive-receipt.schema.json → drive-receipt.schema.json} +2 -2
  112. package/schemas/{vnext/environment.schema.json → environment.schema.json} +1 -1
  113. package/schemas/{vnext/gate-registry.schema.json → gate-registry.schema.json} +1 -1
  114. package/schemas/{vnext/handoff-manifest.schema.json → handoff-manifest.schema.json} +1 -1
  115. package/schemas/{vnext/init-operation.schema.json → init-operation.schema.json} +1 -1
  116. package/schemas/{vnext/local-repository-bindings.schema.json → local-repository-bindings.schema.json} +1 -1
  117. package/schemas/{vnext/memory-record.schema.json → memory-record.schema.json} +1 -1
  118. package/schemas/{vnext/migration-decision.schema.json → migration-decision.schema.json} +1 -1
  119. package/schemas/{vnext/migration-plan.schema.json → migration-plan.schema.json} +1 -1
  120. package/schemas/{vnext/migration-receipt.schema.json → migration-receipt.schema.json} +1 -1
  121. package/schemas/{vnext/model.schema.json → model.schema.json} +1 -1
  122. package/schemas/{vnext/modes.schema.json → modes.schema.json} +1 -1
  123. package/schemas/{vnext/permission-diff.schema.json → permission-diff.schema.json} +1 -1
  124. package/schemas/policy-draft/README.md +2 -2
  125. package/schemas/{vnext/prices.schema.json → prices.schema.json} +1 -1
  126. package/schemas/{vnext/project.schema.json → project.schema.json} +1 -1
  127. package/schemas/{vnext/repository.schema.json → repository.schema.json} +1 -1
  128. package/schemas/{vnext/role.schema.json → role.schema.json} +1 -1
  129. package/schemas/{vnext/run-event.schema.json → run-event.schema.json} +1 -1
  130. package/schemas/{vnext/session-brief.schema.json → session-brief.schema.json} +2 -2
  131. package/schemas/{vnext/sync-event.schema.json → sync-event.schema.json} +1 -1
  132. package/schemas/{vnext/template-provenance.schema.json → template-provenance.schema.json} +1 -1
  133. package/schemas/{vnext/workflow.schema.json → workflow.schema.json} +1 -1
  134. package/scripts/build-package.mjs +59 -0
  135. package/scripts/build-runtime.mjs +3 -2
  136. package/scripts/check-generated.mjs +2 -1
  137. package/scripts/check-versions.mjs +12 -1
  138. package/scripts/docker-install-smoke.mjs +268 -0
  139. package/scripts/emit-codex-artifacts.mjs +1 -1
  140. package/scripts/kxm-bump-version.mjs +53 -3
  141. package/scripts/kxm-hub.mjs +36 -0
  142. package/scripts/kxm-runtime-supervisor.mjs +3 -3
  143. package/scripts/package-surfaces.mjs +39 -0
  144. package/plugins/kxm/src/vnext-gate-hash.ts +0 -10
  145. /package/docs/{vnext → contracts}/effects-and-recovery.md +0 -0
  146. /package/docs/{vnext → contracts}/lifecycles.md +0 -0
  147. /package/docs/{vnext → contracts}/terminology.md +0 -0
  148. /package/examples/{vnext → project}/.kxm/agents/coordinator.yaml +0 -0
  149. /package/examples/{vnext → project}/.kxm/agents/critic-1.yaml +0 -0
  150. /package/examples/{vnext → project}/.kxm/agents/critic-2.yaml +0 -0
  151. /package/examples/{vnext → project}/.kxm/agents/implementer.yaml +0 -0
  152. /package/examples/{vnext → project}/.kxm/agents/planner.yaml +0 -0
  153. /package/examples/{vnext → project}/.kxm/agents/reproducer.yaml +0 -0
  154. /package/examples/{vnext → project}/.kxm/agents/reviewer.yaml +0 -0
  155. /package/examples/{vnext → project}/.kxm/gates.yaml +0 -0
  156. /package/examples/{vnext → project}/.kxm/models/critic-claude.yaml +0 -0
  157. /package/examples/{vnext → project}/.kxm/models/critic-gemini.yaml +0 -0
  158. /package/examples/{vnext → project}/.kxm/models/critic-grok.yaml +0 -0
  159. /package/examples/{vnext → project}/.kxm/models/implementation.yaml +0 -0
  160. /package/examples/{vnext → project}/.kxm/models/primary.yaml +0 -0
  161. /package/examples/{vnext → project}/.kxm/prices.yaml +0 -0
  162. /package/examples/{vnext → project}/.kxm/project/env.yaml +0 -0
  163. /package/examples/{vnext → project}/.kxm/project.yaml +0 -0
  164. /package/examples/{vnext → project}/.kxm/repo/repo.yaml +0 -0
  165. /package/examples/{vnext → project}/.kxm/workflows/default.yaml +0 -0
  166. /package/examples/{vnext → project}/.kxm/workflows/fix.yaml +0 -0
  167. /package/examples/{vnext → project}/.kxm/workflows/improve.yaml +0 -0
  168. /package/examples/{vnext → project}/records/assignment-result-recorded.json +0 -0
  169. /package/examples/{vnext → project}/records/assignment-result.json +0 -0
  170. /package/examples/{vnext → project}/records/context-candidate.json +0 -0
  171. /package/examples/{vnext → project}/records/delivery-manifest.json +0 -0
  172. /package/examples/{vnext → project}/records/effect-uncertainty-resolved-sync.json +0 -0
  173. /package/examples/{vnext → project}/records/effect-uncertainty-resolved.json +0 -0
  174. /package/examples/{vnext → project}/records/run-created.json +0 -0
  175. /package/examples/{vnext → project}/records/sync-event.json +0 -0
  176. /package/examples/{vnext → project}/repositories/api/.kxm/repo/env.yaml +0 -0
  177. /package/examples/{vnext → project}/repositories/api/.kxm/repo/repo.yaml +0 -0
  178. /package/examples/{vnext → project}/repositories/web/.kxm/repo/repo.yaml +0 -0
@@ -1,7 +1,7 @@
1
1
  export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
2
2
  export type JsonObject = { [key: string]: JsonValue };
3
3
 
4
- export interface VnextYamlLimits {
4
+ export interface KxmYamlLimits {
5
5
  maxDocumentBytes: number;
6
6
  maxDepth: number;
7
7
  maxScalarBytes: number;
@@ -10,7 +10,7 @@ export interface VnextYamlLimits {
10
10
  maxKeys: number;
11
11
  }
12
12
 
13
- export const VNEXT_YAML_LIMITS: Readonly<VnextYamlLimits>;
13
+ export const KXM_YAML_LIMITS: Readonly<KxmYamlLimits>;
14
14
 
15
15
  export interface RestrictedYamlIssue {
16
16
  phase: "parse";
@@ -27,5 +27,5 @@ export class RestrictedYamlError extends Error {
27
27
  export function parseRestrictedYaml(
28
28
  input: string | Uint8Array,
29
29
  label?: string,
30
- limits?: Readonly<VnextYamlLimits>,
30
+ limits?: Readonly<KxmYamlLimits>,
31
31
  ): JsonObject;
@@ -1,7 +1,7 @@
1
1
  import { isAlias, isCollection, isMap, isScalar, parseDocument, visit } from "yaml";
2
2
 
3
- /** Restricted JSON-compatible YAML limits used by vNext configuration. */
4
- export const VNEXT_YAML_LIMITS = Object.freeze({
3
+ /** Restricted JSON-compatible YAML limits used by KXM configuration. */
4
+ export const KXM_YAML_LIMITS = Object.freeze({
5
5
  maxDocumentBytes: 256 * 1024,
6
6
  maxDepth: 32,
7
7
  maxScalarBytes: 64 * 1024,
@@ -85,11 +85,11 @@ function assertJsonValue(value, label, path = "$", seen = new Set()) {
85
85
  seen.delete(value);
86
86
  }
87
87
 
88
- /** Parse the restricted, JSON-compatible YAML profile used by all vNext configuration. */
88
+ /** Parse the restricted, JSON-compatible YAML profile used by all KXM configuration. */
89
89
  export function parseRestrictedYaml(
90
90
  input,
91
91
  label = "<yaml>",
92
- limits = VNEXT_YAML_LIMITS,
92
+ limits = KXM_YAML_LIMITS,
93
93
  ) {
94
94
  const byteLength = typeof input === "string" ? Buffer.byteLength(input, "utf8") : input.byteLength;
95
95
  if (byteLength > limits.maxDocumentBytes) {
@@ -1,12 +1,12 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { runtimeError } from "./vnext-runtime-store.ts";
2
+ import { runtimeError } from "./runtime-store.ts";
3
3
 
4
- export interface VnextOwnedAttempt {
4
+ export interface KxmOwnedAttempt {
5
5
  attemptId: string;
6
6
  controller: AbortController;
7
7
  }
8
8
 
9
- export interface VnextGateHoldView {
9
+ export interface KxmGateHoldView {
10
10
  attemptId: string;
11
11
  token: string;
12
12
  state: "active" | "unsettled";
@@ -19,7 +19,7 @@ interface GateHold {
19
19
  stop?: () => void;
20
20
  }
21
21
 
22
- export interface VnextDriveSession {
22
+ export interface KxmDriveSession {
23
23
  driveId: string;
24
24
  runId: string;
25
25
  token: string;
@@ -36,7 +36,7 @@ interface AdmissionRecord {
36
36
  token: string;
37
37
  configRevision: string;
38
38
  gateHold?: GateHold;
39
- driveSession?: VnextDriveSession;
39
+ driveSession?: KxmDriveSession;
40
40
  }
41
41
 
42
42
  interface QueueItem {
@@ -58,7 +58,7 @@ interface OwnerRecord {
58
58
  implicit?: OwnerPolicy;
59
59
  admitted: Map<string, AdmissionRecord>;
60
60
  queue: QueueItem[];
61
- attempts: Map<string, Map<string, VnextOwnedAttempt>>;
61
+ attempts: Map<string, Map<string, KxmOwnedAttempt>>;
62
62
  }
63
63
 
64
64
  const owners = new Map<string, OwnerRecord>();
@@ -92,22 +92,22 @@ function clearImplicitIfIdle(owner: OwnerRecord): void {
92
92
  }
93
93
  }
94
94
 
95
- export function registerVnextRuntimeHandle(storePath: string): void {
95
+ export function registerKxmRuntimeHandle(storePath: string): void {
96
96
  record(storePath).handles += 1;
97
97
  }
98
98
 
99
- export function unregisterVnextRuntimeHandle(storePath: string): void {
99
+ export function unregisterKxmRuntimeHandle(storePath: string): void {
100
100
  const owner = owners.get(storePath);
101
101
  if (!owner) return;
102
102
  owner.handles = Math.max(0, owner.handles - 1);
103
103
  maybeDelete(storePath, owner);
104
104
  }
105
105
 
106
- export function vnextRuntimeHandleCount(storePath: string): number {
106
+ export function kxmRuntimeHandleCount(storePath: string): number {
107
107
  return owners.get(storePath)?.handles ?? 0;
108
108
  }
109
109
 
110
- export function registerVnextAttemptController(storePath: string, runId: string, attempt: VnextOwnedAttempt): void {
110
+ export function registerKxmAttemptController(storePath: string, runId: string, attempt: KxmOwnedAttempt): void {
111
111
  const owner = record(storePath);
112
112
  let runAttempts = owner.attempts.get(runId);
113
113
  if (!runAttempts) {
@@ -120,17 +120,17 @@ export function registerVnextAttemptController(storePath: string, runId: string,
120
120
  runAttempts.set(attempt.attemptId, attempt);
121
121
  }
122
122
 
123
- export function vnextAttemptController(storePath: string, runId: string, attemptId: string): VnextOwnedAttempt | undefined {
123
+ export function kxmAttemptController(storePath: string, runId: string, attemptId: string): KxmOwnedAttempt | undefined {
124
124
  return owners.get(storePath)?.attempts.get(runId)?.get(attemptId);
125
125
  }
126
126
 
127
- export function vnextAttemptControllers(storePath: string, runId: string): VnextOwnedAttempt[] {
127
+ export function kxmAttemptControllers(storePath: string, runId: string): KxmOwnedAttempt[] {
128
128
  const runAttempts = owners.get(storePath)?.attempts.get(runId);
129
129
  if (!runAttempts) return [];
130
130
  return [...runAttempts.values()];
131
131
  }
132
132
 
133
- export function unregisterVnextAttemptController(storePath: string, runId: string, attemptId: string): void {
133
+ export function unregisterKxmAttemptController(storePath: string, runId: string, attemptId: string): void {
134
134
  const owner = owners.get(storePath);
135
135
  if (!owner) return;
136
136
  const runAttempts = owner.attempts.get(runId);
@@ -141,7 +141,7 @@ export function unregisterVnextAttemptController(storePath: string, runId: strin
141
141
  maybeDelete(storePath, owner);
142
142
  }
143
143
 
144
- export function bindVnextSchedulerPolicy(storePath: string, bound: number, configRevision: string): void {
144
+ export function bindKxmSchedulerPolicy(storePath: string, bound: number, configRevision: string): void {
145
145
  const owner = record(storePath);
146
146
  const current = activePolicy(owner);
147
147
  if (current && (current.configRevision !== configRevision || current.bound !== bound)) {
@@ -153,11 +153,11 @@ export function bindVnextSchedulerPolicy(storePath: string, bound: number, confi
153
153
  delete owner.implicit;
154
154
  }
155
155
 
156
- export function vnextSchedulerPolicy(storePath: string): OwnerPolicy | undefined {
156
+ export function kxmSchedulerPolicy(storePath: string): OwnerPolicy | undefined {
157
157
  return owners.get(storePath)?.scheduler;
158
158
  }
159
159
 
160
- export function admitVnextRun(
160
+ export function admitKxmRun(
161
161
  storePath: string,
162
162
  runId: string,
163
163
  envelopeRevision: string,
@@ -190,7 +190,7 @@ export function admitVnextRun(
190
190
  return token;
191
191
  }
192
192
 
193
- export function releaseVnextRun(storePath: string, runId: string, token: string): void {
193
+ export function releaseKxmRun(storePath: string, runId: string, token: string): void {
194
194
  const owner = owners.get(storePath);
195
195
  if (!owner) return;
196
196
  const current = owner.admitted.get(runId);
@@ -202,7 +202,7 @@ export function releaseVnextRun(storePath: string, runId: string, token: string)
202
202
  maybeDelete(storePath, owner);
203
203
  }
204
204
 
205
- export function armVnextGateHold(
205
+ export function armKxmGateHold(
206
206
  storePath: string,
207
207
  runId: string,
208
208
  token: string,
@@ -220,7 +220,7 @@ export function armVnextGateHold(
220
220
  current.gateHold = { attemptId, token, state: "active", stop };
221
221
  }
222
222
 
223
- export function markVnextGateHoldUnsettled(storePath: string, runId: string, token: string, attemptId: string): void {
223
+ export function markKxmGateHoldUnsettled(storePath: string, runId: string, token: string, attemptId: string): void {
224
224
  const owner = owners.get(storePath);
225
225
  const current = owner?.admitted.get(runId);
226
226
  if (!current || current.token !== token) {
@@ -233,7 +233,7 @@ export function markVnextGateHoldUnsettled(storePath: string, runId: string, tok
233
233
  hold.state = "unsettled";
234
234
  }
235
235
 
236
- export function finishVnextOwnedGate(storePath: string, runId: string, token: string, attemptId: string): void {
236
+ export function finishKxmOwnedGate(storePath: string, runId: string, token: string, attemptId: string): void {
237
237
  const owner = owners.get(storePath);
238
238
  const current = owner?.admitted.get(runId);
239
239
  if (!current || current.token !== token) {
@@ -249,13 +249,13 @@ export function finishVnextOwnedGate(storePath: string, runId: string, token: st
249
249
  delete current.gateHold;
250
250
  }
251
251
 
252
- export function dropVnextGateStopHook(storePath: string, runId: string, attemptId: string): void {
252
+ export function dropKxmGateStopHook(storePath: string, runId: string, attemptId: string): void {
253
253
  const hold = owners.get(storePath)?.admitted.get(runId)?.gateHold;
254
254
  if (!hold || hold.attemptId !== attemptId) return;
255
255
  delete hold.stop;
256
256
  }
257
257
 
258
- export function resolveVnextGateHold(storePath: string, runId: string, attemptId: string): void {
258
+ export function resolveKxmGateHold(storePath: string, runId: string, attemptId: string): void {
259
259
  const owner = owners.get(storePath);
260
260
  if (!owner) return;
261
261
  const current = owner.admitted.get(runId);
@@ -274,21 +274,21 @@ export function resolveVnextGateHold(storePath: string, runId: string, attemptId
274
274
  maybeDelete(storePath, owner);
275
275
  }
276
276
 
277
- export function vnextGateHold(storePath: string, runId: string): VnextGateHoldView | undefined {
277
+ export function kxmGateHold(storePath: string, runId: string): KxmGateHoldView | undefined {
278
278
  const hold = owners.get(storePath)?.admitted.get(runId)?.gateHold;
279
279
  if (!hold) return undefined;
280
280
  return { attemptId: hold.attemptId, token: hold.token, state: hold.state };
281
281
  }
282
282
 
283
- export function vnextAdmittedToken(storePath: string, runId: string): string | undefined {
283
+ export function kxmAdmittedToken(storePath: string, runId: string): string | undefined {
284
284
  return owners.get(storePath)?.admitted.get(runId)?.token;
285
285
  }
286
286
 
287
- export function attachVnextDriveSession(
287
+ export function attachKxmDriveSession(
288
288
  storePath: string,
289
289
  runId: string,
290
290
  token: string,
291
- session: VnextDriveSession,
291
+ session: KxmDriveSession,
292
292
  ): void {
293
293
  const owner = record(storePath);
294
294
  const current = owner.admitted.get(runId);
@@ -301,28 +301,28 @@ export function attachVnextDriveSession(
301
301
  current.driveSession = session;
302
302
  }
303
303
 
304
- export function clearVnextDriveSession(storePath: string, runId: string, token: string): void {
304
+ export function clearKxmDriveSession(storePath: string, runId: string, token: string): void {
305
305
  const owner = owners.get(storePath);
306
306
  const current = owner?.admitted.get(runId);
307
307
  if (!current || current.token !== token) return;
308
308
  delete current.driveSession;
309
309
  }
310
310
 
311
- export function vnextDriveSession(storePath: string, runId: string): VnextDriveSession | undefined {
311
+ export function kxmDriveSession(storePath: string, runId: string): KxmDriveSession | undefined {
312
312
  return owners.get(storePath)?.admitted.get(runId)?.driveSession;
313
313
  }
314
314
 
315
- export function vnextOpenDriveSessions(storePath: string): VnextDriveSession[] {
315
+ export function kxmOpenDriveSessions(storePath: string): KxmDriveSession[] {
316
316
  const owner = owners.get(storePath);
317
317
  if (!owner) return [];
318
- const sessions: VnextDriveSession[] = [];
318
+ const sessions: KxmDriveSession[] = [];
319
319
  for (const current of owner.admitted.values()) {
320
320
  if (current.driveSession) sessions.push(current.driveSession);
321
321
  }
322
322
  return sessions;
323
323
  }
324
324
 
325
- export function enqueueVnextScheduledRun(
325
+ export function enqueueKxmScheduledRun(
326
326
  storePath: string,
327
327
  runId: string,
328
328
  configRevision: string,
@@ -345,11 +345,11 @@ export function enqueueVnextScheduledRun(
345
345
  });
346
346
  }
347
347
 
348
- export function vnextActiveScheduledRuns(storePath: string): number {
348
+ export function kxmActiveScheduledRuns(storePath: string): number {
349
349
  return owners.get(storePath)?.admitted.size ?? 0;
350
350
  }
351
351
 
352
- export function vnextQueuedScheduledRuns(storePath: string): number {
352
+ export function kxmQueuedScheduledRuns(storePath: string): number {
353
353
  return owners.get(storePath)?.queue.length ?? 0;
354
354
  }
355
355
 
@@ -360,13 +360,13 @@ function pump(storePath: string, owner: OwnerRecord): void {
360
360
  if (!next) break;
361
361
  let token: string;
362
362
  try {
363
- token = admitVnextRun(storePath, next.runId, next.configRevision, next.bound);
363
+ token = admitKxmRun(storePath, next.runId, next.configRevision, next.bound);
364
364
  } catch (error) {
365
365
  next.fail(error);
366
366
  continue;
367
367
  }
368
368
  void next.start(token).finally(() => {
369
- releaseVnextRun(storePath, next.runId, token);
369
+ releaseKxmRun(storePath, next.runId, token);
370
370
  });
371
371
  }
372
372
  }