@kynver-app/runtime 0.2.23 → 0.2.24
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/README.md +52 -18
- package/dist/bootstrap.d.ts +48 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.js +73 -65
- package/dist/daemon-keeper.d.ts +32 -0
- package/dist/doctor/runner-install.d.ts +86 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +95 -87
- package/dist/orchestration-providers/inventory.d.ts +27 -4
- package/dist/providers/model-preflight.d.ts +8 -0
- package/dist/providers/openai-compatible-response.d.ts +23 -0
- package/dist/providers/openai-compatible-runner.d.ts +1 -0
- package/dist/providers/openai-compatible.d.ts +46 -0
- package/dist/server/cleanup.js +14 -14
- package/dist/server/default-repo.js +1 -1
- package/dist/server/model-routing.js +4 -4
- package/dist/server/monitor.js +7 -7
- package/dist/server/orchestration.d.ts +1 -1
- package/dist/server/orchestration.js +1 -1
- package/dist/server/worker-policy.d.ts +1 -1
- package/dist/server/worker-policy.js +2 -2
- package/dist/status.d.ts +3 -1
- package/dist/stream.d.ts +13 -0
- package/dist/worker-provider-policy.d.ts +21 -4
- package/dist/worker-usage.d.ts +20 -0
- package/dist/worktree.d.ts +33 -0
- package/package.json +3 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ModelRoutingDecision } from "./model-routing.js";
|
|
2
|
-
/** Default harness worker CLI provider
|
|
2
|
+
/** Default harness worker CLI provider when the operator expressed no preference anywhere. */
|
|
3
3
|
export declare const DEFAULT_WORKER_PROVIDER = "cursor";
|
|
4
|
+
/** Normalize an operator-supplied worker provider name to its canonical key. */
|
|
5
|
+
export declare function normalizeWorkerProviderName(name: string): string;
|
|
4
6
|
export declare function isClaudeFamilyProvider(provider: string | null | undefined): boolean;
|
|
5
7
|
/**
|
|
6
8
|
* True when the board row explicitly opts into a Claude/Opus worker
|
|
@@ -16,11 +18,26 @@ export interface EnforceCursorWorkerProviderInput {
|
|
|
16
18
|
explicitProviderIsOperatorOverride?: boolean;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
* True when the board row expresses ANY worker-provider preference (not just
|
|
22
|
+
* Claude): `workerProviderOverride`, an executorRef `provider:*` intent, or the
|
|
23
|
+
* Claude override markers handled by {@link taskAllowsClaudeWorker}.
|
|
24
|
+
*/
|
|
25
|
+
export declare function taskExpressesWorkerProviderPreference(task: Record<string, unknown> | null | undefined): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* W2b routing authority: the Cursor coercion is a *default-only* fallback.
|
|
28
|
+
* An operator preference expressed anywhere — explicit CLI `--provider`,
|
|
29
|
+
* explicit CLI model (incl. provider aliases), executorRef provider intent,
|
|
30
|
+
* factory `provider:*` routing, or task override markers — is authoritative
|
|
31
|
+
* and never rewritten. Only preference-free Claude-family routing (e.g. the
|
|
32
|
+
* global default model inferring Claude) is coerced to the Cursor default.
|
|
21
33
|
*/
|
|
22
34
|
export declare function enforceCursorWorkerProvider(input: EnforceCursorWorkerProviderInput): ModelRoutingDecision;
|
|
23
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the configured worker provider. W2b: `config.workerProvider` is the
|
|
37
|
+
* operator's explicit choice and is honored verbatim (after alias
|
|
38
|
+
* normalization) — the legacy behavior of downgrading Claude-family configs to
|
|
39
|
+
* Cursor is removed. Only an EMPTY config falls back to the Cursor default.
|
|
40
|
+
*/
|
|
24
41
|
export declare function resolveConfiguredWorkerProvider(configured: string | null | undefined, fallback?: string): string;
|
|
25
42
|
/** Plan / Command Center executor lists — Cursor wins when both families appear. */
|
|
26
43
|
export declare function preferCursorExecutor(executors: string[]): string[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ParsedStreamUsage } from "./stream.js";
|
|
2
|
+
export interface WorkerUsagePayload {
|
|
3
|
+
provider: string;
|
|
4
|
+
model: string | null;
|
|
5
|
+
inputTokens: number | null;
|
|
6
|
+
outputTokens: number | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ResolveWorkerUsageInput {
|
|
9
|
+
/** Usage parsed from the worker's stream output (null/undefined → no payload). */
|
|
10
|
+
usage?: ParsedStreamUsage | null;
|
|
11
|
+
/** Provider key frozen at spawn (worker.json), falling back to status readback. */
|
|
12
|
+
provider?: string | null;
|
|
13
|
+
/** Launch model from worker.json — used when the stream did not name a model. */
|
|
14
|
+
model?: string | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build the completion `workerUsage` payload, or null when the provider
|
|
18
|
+
* reported no token usage (the field is then omitted from the POST entirely).
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveWorkerUsagePayload(input: ResolveWorkerUsageInput): WorkerUsagePayload | null;
|
package/dist/worktree.d.ts
CHANGED
|
@@ -6,6 +6,39 @@ export interface CreatedRunInfo {
|
|
|
6
6
|
base: string;
|
|
7
7
|
baseCommit: string;
|
|
8
8
|
}
|
|
9
|
+
export type RunBaseRefSource = "flag" | "env" | "config" | "origin/main" | "remote-head";
|
|
10
|
+
export interface ResolveRunBaseRefInput {
|
|
11
|
+
/** `--base` on the command line. */
|
|
12
|
+
explicitBase?: string;
|
|
13
|
+
/** `KYNVER_RUN_BASE_REF` env override. */
|
|
14
|
+
envBaseRef?: string;
|
|
15
|
+
/** `defaultBase` from `~/.kynver/config.json`. */
|
|
16
|
+
configDefaultBase?: string;
|
|
17
|
+
/** Verify a ref resolves to a commit in the repo; injectable for tests. */
|
|
18
|
+
verifyRef: (ref: string) => boolean;
|
|
19
|
+
/** Resolve the remote default branch (e.g. `origin/master`); injectable for tests. */
|
|
20
|
+
resolveRemoteHeadRef: () => string | null;
|
|
21
|
+
/** Repo path for error messages. */
|
|
22
|
+
repoLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ResolvedRunBaseRef {
|
|
25
|
+
base: string;
|
|
26
|
+
source: RunBaseRefSource;
|
|
27
|
+
/** Human note when the pick was a fallback (never fall back silently). */
|
|
28
|
+
note?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolve the base ref a new run is cut from. Precedence: `--base` flag >
|
|
32
|
+
* `KYNVER_RUN_BASE_REF` env > config `defaultBase` > `origin/main` > the
|
|
33
|
+
* remote HEAD default branch. An EXPLICIT override (flag/env/config) that
|
|
34
|
+
* does not verify is an error — never silently substituted with another ref.
|
|
35
|
+
* When `origin/main` is absent (repos whose default branch is `master`,
|
|
36
|
+
* `develop`, …) the remote HEAD fallback is used with a visible note; when
|
|
37
|
+
* nothing resolves the error names everything tried plus the fix.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveRunBaseRef(input: ResolveRunBaseRefInput): ResolvedRunBaseRef;
|
|
40
|
+
/** Resolve the remote default branch without hitting `git remote show` (porcelain-free). */
|
|
41
|
+
export declare function resolveRemoteHeadRefForRepo(repo: string): string | null;
|
|
9
42
|
export declare function createRun(args: Record<string, string | boolean>): CreatedRunInfo;
|
|
10
43
|
export declare function listRuns(): void;
|
|
11
44
|
export { loadRun, saveRun, runDirectory };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kynver-app/runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"description": "Kynver AgentOS local execution runtime and CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -141,7 +141,8 @@
|
|
|
141
141
|
"build": "esbuild src/cli.ts src/index.ts src/node-runtime-policy.ts src/local-run-store/index.ts src/worker-persona-catalog.ts src/instruction-bundle/contract.ts src/chat/command-auth-proof.ts src/server/monitor.ts src/server/landing.ts src/server/worker-policy.ts src/server/orchestration.ts src/server/adapter-contract.ts src/server/context-budget-receipt.ts src/server/prompt.ts src/server/node-runtime-policy.ts src/server/model-routing.ts src/server/db-credentials.ts src/server/heavy-verification.ts src/server/memory-cost.ts src/server/pr-evidence.ts src/server/default-repo.ts src/server/cleanup.ts src/server/repo-search.ts src/server/harness-notice.ts src/server/memory-cost-enforce.ts src/server/wsl-crash-dumps.ts --bundle --platform=node --format=esm --packages=external --outbase=src --outdir=dist --minify && tsc -p tsconfig.json --emitDeclarationOnly && node scripts/chmod-cli-bin.mjs",
|
|
142
142
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
143
143
|
"test": "vitest run --config vitest.config.ts",
|
|
144
|
-
"prepublishOnly": "node ../../scripts/npm-publish-guard.mjs && npm run build"
|
|
144
|
+
"prepublishOnly": "node ../../scripts/npm-publish-guard.mjs && npm run build",
|
|
145
|
+
"postinstall": "node scripts/postinstall-banner.mjs || true"
|
|
145
146
|
},
|
|
146
147
|
"engines": {
|
|
147
148
|
"node": ">=24.11.0"
|