@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
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { stringify } from "yaml";
|
|
4
|
-
import { defaultSpawn } from "./
|
|
4
|
+
import { defaultSpawn } from "./oneshot-process.ts";
|
|
5
5
|
|
|
6
6
|
export interface InventoryPrice {
|
|
7
7
|
inputPerMillion: number | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
2
|
import { lstat, mkdir, open, rename } from "node:fs/promises";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import type {
|
|
4
|
+
import type { KxmOneShotProcessResult } from "./oneshot-process.ts";
|
|
5
5
|
|
|
6
6
|
export const ONESHOT_EVIDENCE_SCHEMA = "kxm.oneshot-evidence.v2" as const;
|
|
7
7
|
const RETIRED_ONESHOT_EVIDENCE_SCHEMAS = new Set(["kxm.oneshot-evidence.v1"]);
|
|
@@ -44,7 +44,7 @@ export async function beginOneShotEvidence(root: string, intent: {
|
|
|
44
44
|
command: string; args: readonly string[]; input?: string | undefined;
|
|
45
45
|
}, sensitive: readonly string[]): Promise<{
|
|
46
46
|
id: string;
|
|
47
|
-
finish(result:
|
|
47
|
+
finish(result: KxmOneShotProcessResult, observation: unknown): Promise<string>;
|
|
48
48
|
}> {
|
|
49
49
|
await mkdir(root, { recursive: true, mode: 0o700 });
|
|
50
50
|
const stat = await lstat(root);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface KxmOneShotProcessResult {
|
|
4
4
|
stdout: string;
|
|
5
5
|
stderr: string;
|
|
6
6
|
code: number | null;
|
|
@@ -17,7 +17,7 @@ export interface VnextOneShotProcessResult {
|
|
|
17
17
|
error?: Error | undefined;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export interface
|
|
20
|
+
export interface KxmOneShotSpawnOptions {
|
|
21
21
|
cwd?: string | undefined;
|
|
22
22
|
env?: NodeJS.ProcessEnv | undefined;
|
|
23
23
|
input?: string | undefined;
|
|
@@ -26,7 +26,7 @@ export interface VnextOneShotSpawnOptions {
|
|
|
26
26
|
/** Only allowlisted Windows `.cmd` probes may set this; never a user string. */
|
|
27
27
|
shell?: boolean | undefined;
|
|
28
28
|
}
|
|
29
|
-
export type
|
|
29
|
+
export type KxmOneShotSpawn = (command: string, args: readonly string[], options: KxmOneShotSpawnOptions) => Promise<KxmOneShotProcessResult>;
|
|
30
30
|
|
|
31
31
|
const OUTPUT_LIMIT = 8 * 1024 * 1024;
|
|
32
32
|
const KILL_GRACE_MS = 250;
|
|
@@ -54,7 +54,7 @@ export function killProcessTree(child: ReturnType<typeof spawn>, signal: NodeJS.
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/** Bound both execution and pipe drain. Observing exit is not proof of descendant death. */
|
|
57
|
-
export function defaultSpawn(command: string, args: readonly string[], options:
|
|
57
|
+
export function defaultSpawn(command: string, args: readonly string[], options: KxmOneShotSpawnOptions): Promise<KxmOneShotProcessResult> {
|
|
58
58
|
if (options.signal?.aborted) {
|
|
59
59
|
return Promise.resolve({ stdout: "", stderr: "", code: null, started: false, observedChildExit: false, error: new Error("process_aborted") });
|
|
60
60
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { beginOneShotEvidence } from "./
|
|
3
|
-
import {
|
|
4
|
-
import { defaultSpawn, type
|
|
5
|
-
export { defaultSpawn, type
|
|
2
|
+
import { beginOneShotEvidence } from "./oneshot-evidence.ts";
|
|
3
|
+
import { kxmUserStateRoot } from "./bindings.ts";
|
|
4
|
+
import { defaultSpawn, type KxmOneShotProcessResult, type KxmOneShotSpawn } from "./oneshot-process.ts";
|
|
5
|
+
export { defaultSpawn, type KxmOneShotProcessResult, type KxmOneShotSpawn } from "./oneshot-process.ts";
|
|
6
6
|
import {
|
|
7
7
|
BUILTIN_HARNESSES,
|
|
8
8
|
NATIVE_HARNESS_PROVIDERS,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type HarnessCatalogEntry,
|
|
14
14
|
type HarnessInventory,
|
|
15
15
|
type OneShotParsedOutput,
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./harness.ts";
|
|
17
17
|
import {
|
|
18
18
|
calculateModelCost,
|
|
19
19
|
findModelPrice,
|
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
} from "./prices.ts";
|
|
24
24
|
import {
|
|
25
25
|
registerTrustedProducer,
|
|
26
|
-
type
|
|
27
|
-
type
|
|
28
|
-
type
|
|
29
|
-
} from "./
|
|
26
|
+
type KxmProducer,
|
|
27
|
+
type KxmProducerRequest,
|
|
28
|
+
type KxmProducerResult,
|
|
29
|
+
} from "./engine.ts";
|
|
30
30
|
|
|
31
|
-
export interface
|
|
31
|
+
export interface KxmOneShotProducerOptions {
|
|
32
32
|
projectRoot?: string | undefined;
|
|
33
33
|
evidenceRoot?: string | undefined;
|
|
34
34
|
defaultHarness?: string | undefined;
|
|
@@ -39,7 +39,7 @@ export interface VnextOneShotProducerOptions {
|
|
|
39
39
|
priceCatalog?: PriceCatalog | undefined;
|
|
40
40
|
env?: NodeJS.ProcessEnv | undefined;
|
|
41
41
|
timeoutMs?: number | undefined;
|
|
42
|
-
spawnProcess?:
|
|
42
|
+
spawnProcess?: KxmOneShotSpawn | undefined;
|
|
43
43
|
probeHarness?: ((options: Omit<HarnessAssignmentProbeOptions, "runCommand"> & { signal?: AbortSignal | undefined }) => HarnessStatus | Promise<HarnessStatus>) | undefined;
|
|
44
44
|
resolveHarness?: ((agentId: string, runId: string) => string | undefined) | undefined;
|
|
45
45
|
resolveModel?: ((agentId: string, runId: string) => {
|
|
@@ -50,9 +50,9 @@ export interface VnextOneShotProducerOptions {
|
|
|
50
50
|
} | undefined) | undefined;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
export interface
|
|
53
|
+
export interface KxmOneShotProducer extends KxmProducer {
|
|
54
54
|
readonly id: "oneshot";
|
|
55
|
-
produce(request:
|
|
55
|
+
produce(request: KxmProducerRequest): Promise<KxmProducerResult>;
|
|
56
56
|
close(): Promise<void>;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -67,12 +67,12 @@ function determineOutcome(text: string, allowedOutcomes: readonly string[]): str
|
|
|
67
67
|
return "failed";
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
export function
|
|
70
|
+
export function createKxmOneShotProducer(options: KxmOneShotProducerOptions = {}): KxmOneShotProducer {
|
|
71
71
|
const defaultHarness = options.defaultHarness ?? "claude";
|
|
72
|
-
const running = new Map<AbortController, Promise<
|
|
72
|
+
const running = new Map<AbortController, Promise<KxmProducerResult>>();
|
|
73
73
|
let closed = false;
|
|
74
74
|
|
|
75
|
-
function resolveHarnessForRequest(request:
|
|
75
|
+
function resolveHarnessForRequest(request: KxmProducerRequest): string {
|
|
76
76
|
if (request.harness) return request.harness;
|
|
77
77
|
if (options.resolveHarness) {
|
|
78
78
|
const resolved = options.resolveHarness(request.agentId, request.runId);
|
|
@@ -96,7 +96,7 @@ export function createVnextOneShotProducer(options: VnextOneShotProducerOptions
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
function resolveModelForRequest(
|
|
99
|
-
request:
|
|
99
|
+
request: KxmProducerRequest,
|
|
100
100
|
harness: string,
|
|
101
101
|
): { provider: string; model: string; thinking?: string | undefined } {
|
|
102
102
|
if (request.model) {
|
|
@@ -145,13 +145,13 @@ export function createVnextOneShotProducer(options: VnextOneShotProducerOptions
|
|
|
145
145
|
return probe;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
async function executeRequest(request:
|
|
148
|
+
async function executeRequest(request: KxmProducerRequest): Promise<KxmProducerResult> {
|
|
149
149
|
const startTime = Date.now();
|
|
150
150
|
const harness = resolveHarnessForRequest(request);
|
|
151
151
|
const resolved = resolveModelForRequest(request, harness);
|
|
152
152
|
|
|
153
153
|
if (closed) throw new Error("oneshot_producer_closed");
|
|
154
|
-
const cancelled = ():
|
|
154
|
+
const cancelled = (): KxmProducerResult => ({ outcome: "cancelled", costBasis: "unknown", costUsd: null,
|
|
155
155
|
latencyMs: Math.max(0, Date.now() - startTime), harness, provider: resolved.provider,
|
|
156
156
|
requestedModel: resolved.model, effectiveModel: "unknown", agentRole: request.agentRole ?? request.agentId });
|
|
157
157
|
if (request.signal.aborted) return cancelled();
|
|
@@ -231,11 +231,11 @@ export function createVnextOneShotProducer(options: VnextOneShotProducerOptions
|
|
|
231
231
|
|
|
232
232
|
const spawnFn = options.spawnProcess ?? defaultSpawn;
|
|
233
233
|
const cwd = options.projectRoot ?? process.cwd();
|
|
234
|
-
const evidence = await beginOneShotEvidence(options.evidenceRoot ?? join(
|
|
234
|
+
const evidence = await beginOneShotEvidence(options.evidenceRoot ?? join(kxmUserStateRoot(), "runtime", "oneshot-evidence"), {
|
|
235
235
|
runId: request.runId, stepId: request.stepId, attemptId: request.attemptId, assignmentId: request.assignmentId,
|
|
236
236
|
harness, provider: resolved.provider, model: resolved.model, cwd, command, args, input,
|
|
237
237
|
}, [request.capability, ...Object.entries(env).filter(([key]) => /TOKEN|KEY|SECRET|PASSWORD|COOKIE|AUTH/i.test(key)).map(([, value]) => value ?? "")]);
|
|
238
|
-
let procResult:
|
|
238
|
+
let procResult: KxmOneShotProcessResult;
|
|
239
239
|
try {
|
|
240
240
|
procResult = request.signal.aborted
|
|
241
241
|
? { stdout: "", stderr: "", code: null, started: false, observedChildExit: false, error: new Error("process_aborted") }
|
|
@@ -330,7 +330,7 @@ export function createVnextOneShotProducer(options: VnextOneShotProducerOptions
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
const result:
|
|
333
|
+
const result: KxmProducerResult = {
|
|
334
334
|
outcome,
|
|
335
335
|
costBasis,
|
|
336
336
|
costUsd,
|
|
@@ -358,9 +358,9 @@ export function createVnextOneShotProducer(options: VnextOneShotProducerOptions
|
|
|
358
358
|
return result;
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
-
const producer:
|
|
361
|
+
const producer: KxmOneShotProducer = {
|
|
362
362
|
id: "oneshot",
|
|
363
|
-
produce(request): Promise<
|
|
363
|
+
produce(request): Promise<KxmProducerResult> {
|
|
364
364
|
const controller = new AbortController();
|
|
365
365
|
const signal = AbortSignal.any([request.signal, controller.signal]);
|
|
366
366
|
const pending = Promise.resolve().then(() => executeRequest({ ...request, signal }))
|