@kontextmind/kxm 0.7.39 → 0.7.43
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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +41 -7
- package/docs/README.md +5 -3
- package/docs/agent-skills.md +1 -1
- package/docs/architecture.md +1 -1
- package/docs/configuration.md +28 -5
- package/docs/{vnext → contracts}/README.md +7 -7
- package/docs/{vnext → contracts}/architecture.md +2 -2
- package/docs/{vnext → contracts}/migration.md +25 -25
- package/docs/{vnext → contracts}/routing.md +2 -2
- package/docs/{vnext → contracts}/synchronization.md +1 -1
- package/docs/{vnext → contracts}/validation.md +7 -7
- package/docs/getting-started.md +1 -1
- package/docs/kb/qa-authentik-authentication.md +47 -0
- package/docs/kb/qa-extension-install-and-hub-bootstrap.md +68 -0
- package/docs/kb/qa-hub-on-a-public-host.md +31 -0
- package/docs/kb/qa-sqlite-vs-duckdb.md +18 -0
- package/docs/kb/qa-what-the-hub-stores.md +47 -0
- package/docs/packages.md +91 -0
- package/docs/templates/architecture.md +1 -1
- package/docs/test-matrix.md +6 -6
- package/docs/tui-components.md +131 -0
- package/examples/README.md +2 -2
- package/examples/{vnext → project}/.kxm/agents/critic-3.yaml +1 -1
- package/examples/{vnext → project}/README.md +4 -4
- package/package.json +18 -8
- package/packages/core/tui/CHANGELOG.md +19 -0
- package/packages/core/tui/LICENSE +21 -0
- package/packages/core/tui/README.md +45 -0
- package/packages/core/tui/dist/index.js +1439 -0
- package/packages/core/tui/src/adapters/pi.ts +73 -0
- package/packages/core/tui/src/adapters/terminal.ts +106 -0
- package/packages/core/tui/src/exports/index.ts +30 -0
- package/packages/core/tui/src/services/registry.ts +274 -0
- package/packages/core/tui/src/tui/keys.ts +130 -0
- package/packages/core/tui/src/tui/layout.ts +117 -0
- package/packages/core/tui/src/tui/panel.ts +435 -0
- package/packages/core/tui/src/tui/panelComponent.ts +208 -0
- package/packages/core/tui/src/tui/render.ts +309 -0
- package/packages/core/tui/src/tui/theme.ts +145 -0
- package/packages/core/tui/src/types/surface.ts +407 -0
- package/plugins/kxm/.claude-plugin/plugin.json +1 -1
- package/plugins/kxm/dist/cli.js +681 -553
- package/plugins/kxm/dist/extension.js +18 -18
- package/plugins/kxm/dist/mcp-server.js +1 -1
- package/plugins/kxm/dist/{vnext-runtime-supervisor.js → runtime-supervisor.js} +553 -553
- package/plugins/kxm/dist/runtime.js +608 -608
- package/plugins/kxm/dist/server.js +13 -13
- package/plugins/kxm/package.json +2 -2
- package/plugins/kxm/skills/kxm-project-setup/SKILL.md +2 -2
- package/plugins/kxm/skills/kxm-runs/SKILL.md +3 -3
- package/plugins/kxm/skills/kxm-session/SKILL.md +1 -1
- package/plugins/kxm/skills/kxm-workflow/SKILL.md +1 -1
- package/plugins/kxm/src/autocomplete.ts +4 -4
- package/plugins/kxm/src/{vnext-bindings.ts → bindings.ts} +48 -48
- package/plugins/kxm/src/cli/hub.ts +3 -3
- package/plugins/kxm/src/cli/{vnext.ts → project.ts} +106 -106
- package/plugins/kxm/src/cli/roles.ts +9 -9
- package/plugins/kxm/src/cli/system.ts +2 -2
- package/plugins/kxm/src/cli/tasks.ts +8 -8
- package/plugins/kxm/src/cli/workflows.ts +8 -8
- package/plugins/kxm/src/cli.ts +47 -47
- package/plugins/kxm/src/config.ts +69 -14
- package/plugins/kxm/src/database.ts +4 -4
- package/plugins/kxm/src/{vnext-engine-artifacts.ts → engine-artifacts.ts} +7 -7
- package/plugins/kxm/src/{vnext-engine-command.ts → engine-command.ts} +40 -40
- package/plugins/kxm/src/{vnext-engine-compile.ts → engine-compile.ts} +64 -64
- package/plugins/kxm/src/{vnext-engine-evidence.ts → engine-evidence.ts} +26 -26
- package/plugins/kxm/src/{vnext-engine-fold.ts → engine-fold.ts} +99 -99
- package/plugins/kxm/src/{vnext-engine-gate-records.ts → engine-gate-records.ts} +105 -105
- package/plugins/kxm/src/{vnext-engine-plan.ts → engine-plan.ts} +69 -69
- package/plugins/kxm/src/{vnext-engine.ts → engine.ts} +502 -502
- package/plugins/kxm/src/gate-hash.ts +10 -0
- package/plugins/kxm/src/{vnext-harness.ts → harness.ts} +1 -1
- package/plugins/kxm/src/hub.ts +1 -1
- package/plugins/kxm/src/init-guide-setup.ts +3 -3
- package/plugins/kxm/src/{vnext-init.ts → init.ts} +93 -93
- package/plugins/kxm/src/kxm-install-kind.ts +1 -1
- package/plugins/kxm/src/kxm-update-config.ts +2 -2
- package/plugins/kxm/src/local-snapshot.ts +23 -23
- package/plugins/kxm/src/mcp-server.ts +1 -1
- package/plugins/kxm/src/{vnext-migrate.ts → migrate.ts} +123 -123
- package/plugins/kxm/src/model-inventory.ts +1 -1
- package/plugins/kxm/src/{vnext-oneshot-evidence.ts → oneshot-evidence.ts} +2 -2
- package/plugins/kxm/src/{vnext-oneshot-process.ts → oneshot-process.ts} +4 -4
- package/plugins/kxm/src/{vnext-oneshot-producer.ts → oneshot-producer.ts} +24 -24
- package/plugins/kxm/src/{vnext-permission.ts → permission.ts} +86 -86
- package/plugins/kxm/src/{vnext-pi-producer.ts → pi-producer.ts} +13 -13
- package/plugins/kxm/src/{vnext-config.ts → project-config.ts} +177 -177
- package/plugins/kxm/src/{vnext-repair.ts → repair.ts} +159 -159
- package/plugins/kxm/src/restricted-yaml.d.mts +3 -3
- package/plugins/kxm/src/restricted-yaml.mjs +4 -4
- package/plugins/kxm/src/{vnext-runtime-owner.ts → runtime-owner.ts} +35 -35
- package/plugins/kxm/src/{vnext-runtime.ts → runtime-service.ts} +136 -136
- package/plugins/kxm/src/{vnext-runtime-store.ts → runtime-store.ts} +145 -145
- package/plugins/kxm/src/{vnext-runtime-supervisor.ts → runtime-supervisor.ts} +80 -80
- package/plugins/kxm/src/runtime.ts +6 -6
- package/plugins/kxm/src/session-work.ts +3 -3
- package/plugins/kxm/src/studio-layout.ts +6 -6
- package/plugins/kxm/src/{vnext-template.ts → template.ts} +33 -33
- package/plugins/kxm/src/tui.ts +10 -24
- package/schemas/{vnext/README.md → README.md} +3 -3
- package/schemas/{vnext/agent.schema.json → agent.schema.json} +1 -1
- package/schemas/{vnext/assignment-result.schema.json → assignment-result.schema.json} +1 -1
- package/schemas/{vnext/backup-manifest.schema.json → backup-manifest.schema.json} +1 -1
- package/schemas/{vnext/candidate.schema.json → candidate.schema.json} +1 -1
- package/schemas/{vnext/common.schema.json → common.schema.json} +2 -2
- package/schemas/{vnext/context-candidate.schema.json → context-candidate.schema.json} +1 -1
- package/schemas/{vnext/context-packet.schema.json → context-packet.schema.json} +1 -1
- package/schemas/{vnext/delivery-manifest.schema.json → delivery-manifest.schema.json} +1 -1
- package/schemas/{vnext/drive-receipt.schema.json → drive-receipt.schema.json} +2 -2
- package/schemas/{vnext/environment.schema.json → environment.schema.json} +1 -1
- package/schemas/{vnext/gate-registry.schema.json → gate-registry.schema.json} +1 -1
- package/schemas/{vnext/handoff-manifest.schema.json → handoff-manifest.schema.json} +1 -1
- package/schemas/{vnext/init-operation.schema.json → init-operation.schema.json} +1 -1
- package/schemas/{vnext/local-repository-bindings.schema.json → local-repository-bindings.schema.json} +1 -1
- package/schemas/{vnext/memory-record.schema.json → memory-record.schema.json} +1 -1
- package/schemas/{vnext/migration-decision.schema.json → migration-decision.schema.json} +1 -1
- package/schemas/{vnext/migration-plan.schema.json → migration-plan.schema.json} +1 -1
- package/schemas/{vnext/migration-receipt.schema.json → migration-receipt.schema.json} +1 -1
- package/schemas/{vnext/model.schema.json → model.schema.json} +1 -1
- package/schemas/{vnext/modes.schema.json → modes.schema.json} +1 -1
- package/schemas/{vnext/permission-diff.schema.json → permission-diff.schema.json} +1 -1
- package/schemas/policy-draft/README.md +2 -2
- package/schemas/{vnext/prices.schema.json → prices.schema.json} +1 -1
- package/schemas/{vnext/project.schema.json → project.schema.json} +1 -1
- package/schemas/{vnext/repository.schema.json → repository.schema.json} +1 -1
- package/schemas/{vnext/role.schema.json → role.schema.json} +1 -1
- package/schemas/{vnext/run-event.schema.json → run-event.schema.json} +1 -1
- package/schemas/{vnext/session-brief.schema.json → session-brief.schema.json} +2 -2
- package/schemas/{vnext/sync-event.schema.json → sync-event.schema.json} +1 -1
- package/schemas/{vnext/template-provenance.schema.json → template-provenance.schema.json} +1 -1
- package/schemas/{vnext/workflow.schema.json → workflow.schema.json} +1 -1
- package/scripts/build-package.mjs +59 -0
- package/scripts/build-runtime.mjs +3 -2
- package/scripts/check-generated.mjs +2 -1
- package/scripts/check-versions.mjs +12 -1
- package/scripts/docker-install-smoke.mjs +268 -0
- package/scripts/emit-codex-artifacts.mjs +1 -1
- package/scripts/kxm-bump-version.mjs +53 -3
- package/scripts/kxm-runtime-supervisor.mjs +3 -3
- package/scripts/package-surfaces.mjs +39 -0
- package/scripts/roster-policy.mjs +1 -1
- package/plugins/kxm/src/vnext-gate-hash.ts +0 -10
- /package/docs/{vnext → contracts}/effects-and-recovery.md +0 -0
- /package/docs/{vnext → contracts}/lifecycles.md +0 -0
- /package/docs/{vnext → contracts}/terminology.md +0 -0
- /package/examples/{vnext → project}/.kxm/agents/coordinator.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/critic-1.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/critic-2.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/implementer.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/planner.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/reproducer.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/agents/reviewer.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/gates.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/critic-claude.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/critic-gemini.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/critic-grok.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/implementation.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/models/primary.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/prices.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/project/env.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/project.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/repo/repo.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/workflows/default.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/workflows/fix.yaml +0 -0
- /package/examples/{vnext → project}/.kxm/workflows/improve.yaml +0 -0
- /package/examples/{vnext → project}/records/assignment-result-recorded.json +0 -0
- /package/examples/{vnext → project}/records/assignment-result.json +0 -0
- /package/examples/{vnext → project}/records/context-candidate.json +0 -0
- /package/examples/{vnext → project}/records/delivery-manifest.json +0 -0
- /package/examples/{vnext → project}/records/effect-uncertainty-resolved-sync.json +0 -0
- /package/examples/{vnext → project}/records/effect-uncertainty-resolved.json +0 -0
- /package/examples/{vnext → project}/records/run-created.json +0 -0
- /package/examples/{vnext → project}/records/sync-event.json +0 -0
- /package/examples/{vnext → project}/repositories/api/.kxm/repo/env.yaml +0 -0
- /package/examples/{vnext → project}/repositories/api/.kxm/repo/repo.yaml +0 -0
- /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
|
|
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
|
|
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<
|
|
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
|
|
4
|
-
export const
|
|
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
|
|
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 =
|
|
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 "./
|
|
2
|
+
import { runtimeError } from "./runtime-store.ts";
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface KxmOwnedAttempt {
|
|
5
5
|
attemptId: string;
|
|
6
6
|
controller: AbortController;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export interface
|
|
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
|
|
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?:
|
|
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,
|
|
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
|
|
95
|
+
export function registerKxmRuntimeHandle(storePath: string): void {
|
|
96
96
|
record(storePath).handles += 1;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export function
|
|
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
|
|
106
|
+
export function kxmRuntimeHandleCount(storePath: string): number {
|
|
107
107
|
return owners.get(storePath)?.handles ?? 0;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
export function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
156
|
+
export function kxmSchedulerPolicy(storePath: string): OwnerPolicy | undefined {
|
|
157
157
|
return owners.get(storePath)?.scheduler;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
export function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
287
|
+
export function attachKxmDriveSession(
|
|
288
288
|
storePath: string,
|
|
289
289
|
runId: string,
|
|
290
290
|
token: string,
|
|
291
|
-
session:
|
|
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
|
|
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
|
|
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
|
|
315
|
+
export function kxmOpenDriveSessions(storePath: string): KxmDriveSession[] {
|
|
316
316
|
const owner = owners.get(storePath);
|
|
317
317
|
if (!owner) return [];
|
|
318
|
-
const sessions:
|
|
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
|
|
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
|
|
348
|
+
export function kxmActiveScheduledRuns(storePath: string): number {
|
|
349
349
|
return owners.get(storePath)?.admitted.size ?? 0;
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
export function
|
|
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 =
|
|
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
|
-
|
|
369
|
+
releaseKxmRun(storePath, next.runId, token);
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
372
|
}
|