@kynver-app/runtime 0.2.19 → 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 -66
- package/dist/config.d.ts +1 -1
- package/dist/cron/cron-install-plan.d.ts +3 -1
- package/dist/daemon-keeper.d.ts +32 -0
- package/dist/doctor/runner-install.d.ts +86 -2
- package/dist/doctor/runtime-takeover-deploy-evidence.d.ts +7 -3
- package/dist/doctor/runtime-takeover.probes.d.ts +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +95 -88
- package/dist/landing/land-pr-check-classify.d.ts +6 -0
- package/dist/orchestration-providers/inventory.d.ts +27 -4
- package/dist/provider-evidence/index.d.ts +0 -1
- 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/scheduler-cutover.d.ts +1 -1
- package/dist/server/adapter-contract.d.ts +1 -0
- package/dist/server/adapter-contract.js +1 -0
- package/dist/server/cleanup.js +14 -14
- package/dist/server/context-budget-receipt.d.ts +2 -0
- package/dist/server/context-budget-receipt.js +6 -0
- package/dist/server/db-credentials.d.ts +1 -0
- package/dist/server/db-credentials.js +2 -0
- package/dist/server/default-repo.js +1 -1
- package/dist/server/heavy-verification.js +1 -1
- package/dist/server/memory-cost-enforce.js +2 -2
- package/dist/server/memory-cost.js +2 -2
- package/dist/server/model-routing.d.ts +3 -0
- package/dist/server/model-routing.js +5 -0
- package/dist/server/monitor.js +7 -7
- package/dist/server/node-runtime-policy.d.ts +1 -0
- package/dist/server/node-runtime-policy.js +1 -0
- package/dist/server/orchestration.d.ts +1 -1
- package/dist/server/orchestration.js +1 -1
- package/dist/server/prompt.d.ts +1 -0
- package/dist/server/prompt.js +19 -0
- 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 +34 -3
|
@@ -7,5 +7,11 @@ export declare function classifyChecks(statusCheckRollup: unknown[] | undefined)
|
|
|
7
7
|
failed: string[];
|
|
8
8
|
ignoredActions: string[];
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* LEGACY (Vercel decommissioned 2026-08): no check named `vercel*` appears on
|
|
12
|
+
* current PRs, so this always returns false post-cutover. Retained so landing
|
|
13
|
+
* evidence for pre-cutover PRs still classifies; callers treat it as one
|
|
14
|
+
* optional evidence source among several.
|
|
15
|
+
*/
|
|
10
16
|
export declare function vercelCheckSuccess(statusCheckRollup: unknown[] | undefined): boolean;
|
|
11
17
|
export declare function mergeStateReadinessError(mergeStateStatus: string, checks: ReturnType<typeof classifyChecks>): string | null;
|
|
@@ -2,19 +2,42 @@ import { type CodexOrchestrationPath } from "./codex-orchestration-adapter.js";
|
|
|
2
2
|
import { type HermesCliAdapterStatus } from "./hermes-cli-adapter.js";
|
|
3
3
|
import { type HermesOpenAiCodexBindingStatus } from "./hermes-openai-codex-binding.js";
|
|
4
4
|
import type { OrchestrationProviderBindingStatus, OrchestrationProviderId } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* PRESENCE-ONLY report of cloud API keys on the daemon host env.
|
|
7
|
+
*
|
|
8
|
+
* Honesty note (model-freedom audit gap 8): these keys are NOT usable by
|
|
9
|
+
* harness CLI workers — the worker-env scrub (`worker-env.ts`) strips every
|
|
10
|
+
* `*_API_KEY` from worker child environments by design. Presence here means
|
|
11
|
+
* only "the key exists on the daemon host" (e.g. for daemon-side HTTP paths);
|
|
12
|
+
* it must never be advertised as spendable worker credit.
|
|
13
|
+
*/
|
|
5
14
|
export interface OrchestrationCloudApiCredits {
|
|
6
|
-
/** ANTHROPIC_API_KEY
|
|
15
|
+
/** ANTHROPIC_API_KEY present on the daemon host env (scrubbed from worker children). */
|
|
7
16
|
anthropicApiKey: boolean;
|
|
8
|
-
/** OPENAI_API_KEY
|
|
17
|
+
/** OPENAI_API_KEY present on the daemon host env (scrubbed from worker children). */
|
|
9
18
|
openaiApiKey: boolean;
|
|
10
|
-
/** CODEX_API_KEY
|
|
19
|
+
/** CODEX_API_KEY present on the daemon host env (scrubbed from worker children). */
|
|
11
20
|
codexApiKey: boolean;
|
|
12
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* W2a — generic `openai-compatible` worker provider endpoint presence.
|
|
24
|
+
* Unlike the cloud API keys above, this path IS worker-usable: the daemon
|
|
25
|
+
* builds the request (headers include the key) and hands it to its own runner
|
|
26
|
+
* child over stdin, so the scrub never blocks it.
|
|
27
|
+
*/
|
|
28
|
+
export interface OrchestrationWorkerEndpoint {
|
|
29
|
+
/** KYNVER_WORKER_BASE_URL present — the generic provider is endpoint-configured. */
|
|
30
|
+
baseUrlConfigured: boolean;
|
|
31
|
+
/** KYNVER_WORKER_API_KEY present (optional — many local servers need none). */
|
|
32
|
+
apiKeyConfigured: boolean;
|
|
33
|
+
}
|
|
13
34
|
export interface OrchestrationProviderInventory {
|
|
14
35
|
generatedAt: string;
|
|
15
36
|
bindings: Record<OrchestrationProviderId, OrchestrationProviderBindingStatus>;
|
|
16
|
-
/** API-key
|
|
37
|
+
/** API-key PRESENCE on the daemon host — not worker-usable credit (see type doc). */
|
|
17
38
|
cloudApiCredits: OrchestrationCloudApiCredits;
|
|
39
|
+
/** Generic openai-compatible worker endpoint presence (optional for snapshots from older runtimes). */
|
|
40
|
+
workerEndpoint?: OrchestrationWorkerEndpoint;
|
|
18
41
|
hermes: HermesCliAdapterStatus;
|
|
19
42
|
hermesOpenAiCodex: HermesOpenAiCodexBindingStatus;
|
|
20
43
|
codexAdapterPath: CodexOrchestrationPath;
|
|
@@ -30,4 +30,12 @@ export declare function preflightClaudeModel(model: string | undefined, defaultM
|
|
|
30
30
|
*/
|
|
31
31
|
/** Preflight for `codex` provider — accepts OpenAI/Codex model ids; rejects Claude-family ids. */
|
|
32
32
|
export declare function preflightCodexModel(model: string | undefined, defaultModel: string): ModelPreflightResult;
|
|
33
|
+
/**
|
|
34
|
+
* Preflight for the generic `openai-compatible` provider. The endpoint behind
|
|
35
|
+
* `KYNVER_WORKER_BASE_URL` is the only judge of model validity — llama, qwen,
|
|
36
|
+
* mistral, deepseek, gpt-* and anything else all pass. The ONLY structural
|
|
37
|
+
* failure is having no model at all (no request and no provider default): a
|
|
38
|
+
* chat-completions call cannot be issued without one.
|
|
39
|
+
*/
|
|
40
|
+
export declare function preflightOpenAiCompatibleModel(model: string | undefined, defaultModel: string | undefined): ModelPreflightResult;
|
|
33
41
|
export declare function preflightCursorModel(model: string | undefined, defaultModel: string): ModelPreflightResult;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface OpenAiCompatibleUsage {
|
|
2
|
+
inputTokens?: number;
|
|
3
|
+
outputTokens?: number;
|
|
4
|
+
}
|
|
5
|
+
export interface OpenAiCompatibleCompletion {
|
|
6
|
+
ok: true;
|
|
7
|
+
/** Assistant message text (choices[0].message.content, string-joined). */
|
|
8
|
+
content: string;
|
|
9
|
+
/** Model id the endpoint reports serving (may differ from the requested id). */
|
|
10
|
+
model?: string;
|
|
11
|
+
/** usage.prompt_tokens / usage.completion_tokens when the endpoint reports them. */
|
|
12
|
+
usage?: OpenAiCompatibleUsage;
|
|
13
|
+
}
|
|
14
|
+
export interface OpenAiCompatibleCompletionError {
|
|
15
|
+
ok: false;
|
|
16
|
+
error: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Extract the assistant output + usage from a chat-completions response body.
|
|
20
|
+
* Tolerant of the shape variance across Ollama/vLLM/OpenRouter/Together/OpenAI —
|
|
21
|
+
* the caller only needs `content` (the work product) and optional usage/model.
|
|
22
|
+
*/
|
|
23
|
+
export declare function extractOpenAiCompatibleCompletion(body: unknown): OpenAiCompatibleCompletion | OpenAiCompatibleCompletionError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runOpenAiCompatibleWorkUnit(): Promise<void>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { WorkerProvider, WorkerProviderStartOptions } from "./types.js";
|
|
2
|
+
export declare const OPENAI_COMPATIBLE_PROVIDER = "openai-compatible";
|
|
3
|
+
export declare function resolveOpenAiCompatibleDefaultModel(env?: NodeJS.ProcessEnv): string | undefined;
|
|
4
|
+
export interface OpenAiCompatibleEndpoint {
|
|
5
|
+
/** Normalized base URL without a trailing slash, e.g. http://localhost:11434/v1 */
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
/** Raw API key when configured; never placed in a child env. */
|
|
8
|
+
apiKey?: string;
|
|
9
|
+
timeoutMs: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class OpenAiCompatibleConfigError extends Error {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolve the endpoint from the DAEMON host env. Throws a remediation-quality
|
|
15
|
+
* error when `KYNVER_WORKER_BASE_URL` is unset or not an http(s) URL.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveOpenAiCompatibleEndpoint(env?: NodeJS.ProcessEnv): OpenAiCompatibleEndpoint;
|
|
18
|
+
export declare const OPENAI_COMPATIBLE_SYSTEM_PROMPT: string;
|
|
19
|
+
export interface OpenAiCompatibleChatRequest {
|
|
20
|
+
url: string;
|
|
21
|
+
/** Fully constructed headers — the Authorization bearer is baked in here. */
|
|
22
|
+
headers: Record<string, string>;
|
|
23
|
+
body: {
|
|
24
|
+
model: string;
|
|
25
|
+
temperature: number;
|
|
26
|
+
stream: false;
|
|
27
|
+
messages: Array<{
|
|
28
|
+
role: "system" | "user";
|
|
29
|
+
content: string;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Build the single chat-completions request for a work unit. Pure — testable. */
|
|
34
|
+
export declare function buildOpenAiCompatibleChatRequest(endpoint: Pick<OpenAiCompatibleEndpoint, "baseUrl" | "apiKey">, model: string, prompt: string): OpenAiCompatibleChatRequest;
|
|
35
|
+
/** Config the runner child receives over STDIN (never argv/env/disk — carries the key). */
|
|
36
|
+
export interface OpenAiCompatibleRunnerConfig {
|
|
37
|
+
provider: typeof OPENAI_COMPATIBLE_PROVIDER;
|
|
38
|
+
model: string;
|
|
39
|
+
request: OpenAiCompatibleChatRequest;
|
|
40
|
+
timeoutMs: number;
|
|
41
|
+
heartbeatPath: string;
|
|
42
|
+
/** Redacted origin for log/error messages (no path, no credentials). */
|
|
43
|
+
endpointOrigin: string;
|
|
44
|
+
}
|
|
45
|
+
export declare function buildOpenAiCompatibleRunnerConfig(opts: Pick<WorkerProviderStartOptions, "prompt" | "heartbeatPath">, endpoint: OpenAiCompatibleEndpoint, model: string): OpenAiCompatibleRunnerConfig;
|
|
46
|
+
export declare const openAiCompatibleProvider: WorkerProvider;
|
|
@@ -18,7 +18,7 @@ export interface SchedulerCutoverReport {
|
|
|
18
18
|
deploymentSteps: string[];
|
|
19
19
|
runnerSteps: string[];
|
|
20
20
|
}
|
|
21
|
-
export declare const DEPLOYMENT_SCHEDULER_CUTOVER_STEPS: readonly ["
|
|
21
|
+
export declare const DEPLOYMENT_SCHEDULER_CUTOVER_STEPS: readonly ["Railway/hosted: set KYNVER_SCHEDULER_PROVIDER=qstash", "Railway/hosted: ensure QSTASH_TOKEN (and QStash signing keys) are configured", "Railway/hosted: unset OPENCLAW_CRON_STORE_PATH if present"];
|
|
22
22
|
export declare const RUNNER_SCHEDULER_CUTOVER_STEPS: readonly ["User runner: unset KYNVER_SCHEDULER_PROVIDER (scheduling is deployment-owned)", "User runner: unset OPENCLAW_CRON_STORE_PATH, OPENCLAW_CRON_SECRET, OPENCLAW_CRON_FIRE_BASE_URL", "User runner: after deployment cutover, run `kynver scheduler attest-cutover` (or set deploymentSchedulerProvider to \"qstash\" in ~/.kynver/config.json)", "Verify: kynver doctor runtime-takeover — hotspot_openclaw_scheduler should pass"];
|
|
23
23
|
export declare function readSchedulerCutoverEnv(env?: NodeJS.ProcessEnv): SchedulerCutoverEnvSnapshot;
|
|
24
24
|
export declare function assessSchedulerCutover(config: Pick<KynverUserConfig, "deploymentSchedulerProvider">, env?: SchedulerCutoverEnvSnapshot): SchedulerCutoverReport;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getAdapterContextContract, listAdapterContextContracts, type AdapterContextCapability, type AdapterContextContract, type AdapterContextContractId, } from "../orchestration-providers/adapter-contract.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o={"kynver-harness":{adapterId:"kynver-harness",displayName:"Kynver Harness (native)",capabilities:["instruction_policy","persona_context","memory_quality_capture","context_envelope_goal","context_envelope_plan","context_envelope_task","context_envelope_memories","context_envelope_persona"],requiredCapabilities:[],compatibilityNotes:"Context injected via SYSTEM prompt block (buildPrompt). instruction_policy and persona_context are rendered as markdown sections before the task block. context_envelope_* fields (goal/plan/task/memories/persona) are available for dispatch-time injection into the task description \u2014 parity with hermes for shared envelope fields. memory_quality_capture feeds the MARM P7 runtime prompt block."},hermes:{adapterId:"hermes",displayName:"Hermes Forge CLI",capabilities:["context_envelope_goal","context_envelope_plan","context_envelope_task","context_envelope_memories","context_envelope_persona"],requiredCapabilities:[],compatibilityNotes:"External CLI adapter. Context delivered via --context flag or stdin JSON envelope. Does not receive instruction_policy or persona_context / memory_quality_capture (MARM-internal). kynver-harness is the Kynver-native equivalent and covers all hermes capabilities plus richer local context."},cursor:{adapterId:"cursor",displayName:"Cursor / Composer",capabilities:["instruction_policy","persona_context","context_envelope_goal","context_envelope_plan","context_envelope_task","context_envelope_memories"],requiredCapabilities:[],compatibilityNotes:"Context injected via SYSTEM prompt block. Cursor does not receive context_envelope_sessions (no standard block for session history). context_envelope_persona is not forwarded (persona block is absorbed into persona_context markdown)."},codex:{adapterId:"codex",displayName:"Codex (BYO OAuth / Hermes openai-codex)",capabilities:["instruction_policy","context_envelope_goal","context_envelope_plan","context_envelope_task","context_envelope_memories"],requiredCapabilities:[],compatibilityNotes:"Context injected via --instructions flag or system prompt. persona_context not forwarded (Codex has no persona-aware memory lane). memory_quality_capture not surfaced (no MARM completion verification hook on Codex path). context_envelope_sessions and context_envelope_persona omitted."},claude:{adapterId:"claude",displayName:"Claude Code CLI",capabilities:["instruction_policy","persona_context","memory_quality_capture","context_envelope_goal","context_envelope_plan","context_envelope_task","context_envelope_memories","context_envelope_sessions","context_envelope_persona"],requiredCapabilities:[],compatibilityNotes:"Full context injection via SYSTEM prompt block. Supports all capabilities including session summaries and the full persona block. Equivalent to kynver-harness in capability coverage."}};function n(e){let t=o[e];return t||{adapterId:e,displayName:`Unknown adapter (${e})`,capabilities:[],requiredCapabilities:[],compatibilityNotes:"Unknown adapter \u2014 no context-envelope routing performed."}}function a(){return Object.values(o)}export{n as getAdapterContextContract,a as listAdapterContextContracts};
|