@kynver-app/runtime 0.1.56 → 0.1.59
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/dist/callbacks.d.ts +17 -0
- package/dist/cleanup-guards-helpers.d.ts +2 -0
- package/dist/cleanup-guards.d.ts +15 -4
- package/dist/cleanup-orphan-safety.d.ts +17 -0
- package/dist/cleanup-types.d.ts +28 -1
- package/dist/cli.js +712 -183
- package/dist/cli.js.map +4 -4
- package/dist/config.d.ts +5 -0
- package/dist/db-credential-resolver.d.ts +37 -0
- package/dist/db-url-hint.d.ts +4 -0
- package/dist/discard-disposable.d.ts +6 -0
- package/dist/disk-gate.d.ts +5 -0
- package/dist/dispatch.d.ts +2 -1
- package/dist/disposable-artifacts.d.ts +2 -0
- package/dist/doctor/runtime-takeover-scheduler.d.ts +5 -0
- package/dist/doctor/runtime-takeover.probes.d.ts +2 -0
- package/dist/harness-storage-snapshot.d.ts +26 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +1299 -588
- package/dist/index.js.map +4 -4
- package/dist/material-worktree-changes.d.ts +2 -0
- package/dist/paths.d.ts +1 -0
- package/dist/status.d.ts +13 -0
- package/dist/supervisor.d.ts +2 -1
- package/dist/worker-env.d.ts +1 -1
- package/dist/worktree-completion-handoff.d.ts +17 -0
- package/dist/wsl-host.d.ts +71 -0
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -7,6 +7,11 @@ export interface KynverUserConfig {
|
|
|
7
7
|
/** Default Claude model when dispatch does not infer or pass `--model`. */
|
|
8
8
|
defaultModel?: string;
|
|
9
9
|
harnessRoot?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Operator attestation that the hosted Kynver deployment uses this scheduler provider
|
|
12
|
+
* (set on user runners after Vercel env cutover — scheduling is deployment-owned).
|
|
13
|
+
*/
|
|
14
|
+
deploymentSchedulerProvider?: "qstash" | "kynver-cron" | "openclaw-cron";
|
|
10
15
|
/** Max concurrent workers on this machine. Omit to auto-size from RAM. */
|
|
11
16
|
maxConcurrentWorkers?: number;
|
|
12
17
|
/** @internal Advanced tuning — not required for setup. */
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** How production DATABASE_URL was obtained (no secrets in this enum). */
|
|
2
|
+
export type DbCredentialSource = "neon-cli" | "env:KYNVER_PRODUCTION_DATABASE_URL" | "env:PRODUCTION_DATABASE_URL" | "env-file:PRODUCTION_DATABASE_URL" | "env-file:KYNVER_PRODUCTION_DATABASE_URL";
|
|
3
|
+
export interface DbCredentialResolution {
|
|
4
|
+
ok: true;
|
|
5
|
+
databaseUrl: string;
|
|
6
|
+
source: DbCredentialSource;
|
|
7
|
+
hint: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DbCredentialFailure {
|
|
10
|
+
ok: false;
|
|
11
|
+
reason: string;
|
|
12
|
+
attempted: DbCredentialSource[];
|
|
13
|
+
}
|
|
14
|
+
export type ResolveProductionDatabaseResult = DbCredentialResolution | DbCredentialFailure;
|
|
15
|
+
declare const ENV_FILE_KEYS: readonly ["KYNVER_PRODUCTION_DATABASE_URL", "PRODUCTION_DATABASE_URL"];
|
|
16
|
+
export interface ResolveProductionDatabaseOptions {
|
|
17
|
+
cwd?: string;
|
|
18
|
+
env?: NodeJS.ProcessEnv;
|
|
19
|
+
/** Injectable for tests — runs `neon connection-string`. */
|
|
20
|
+
neonConnectionString?: (args: {
|
|
21
|
+
branch: string;
|
|
22
|
+
projectId?: string;
|
|
23
|
+
databaseName?: string;
|
|
24
|
+
roleName?: string;
|
|
25
|
+
pooled?: boolean;
|
|
26
|
+
}) => string | null;
|
|
27
|
+
}
|
|
28
|
+
/** Parse only production DB keys from a dotenv file — never loads unrelated secrets. */
|
|
29
|
+
export declare function readProductionDbKeysFromEnvFile(envPath: string): Partial<Record<(typeof ENV_FILE_KEYS)[number], string>>;
|
|
30
|
+
/**
|
|
31
|
+
* Resolve a production Prisma `DATABASE_URL` at CLI execution time.
|
|
32
|
+
* Precedence: Neon CLI → explicit process env → selective `.env` keys only.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveProductionDatabaseUrl(options?: ResolveProductionDatabaseOptions): ResolveProductionDatabaseResult;
|
|
35
|
+
/** Set `process.env.DATABASE_URL` from resolver; logs source + host hint to stderr (no secrets). */
|
|
36
|
+
export declare function applyProductionDatabaseToProcess(options?: ResolveProductionDatabaseOptions): DbCredentialResolution;
|
|
37
|
+
export {};
|
package/dist/disk-gate.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { DispatchNextDiskGateShape } from "./callbacks.js";
|
|
2
|
+
import { type ObserveWslHostDiskOptions } from "./wsl-host.js";
|
|
2
3
|
export interface ObserveDiskGateInput {
|
|
3
4
|
diskPath?: string;
|
|
4
5
|
diskFreeWarnBytes?: number;
|
|
5
6
|
diskFreeCriticalBytes?: number;
|
|
6
7
|
diskMaxUsedPercent?: number;
|
|
7
8
|
diskHardMaxUsedPercent?: number;
|
|
9
|
+
/** Opt-out for the WSL host disk probe — leave `false`/undefined by
|
|
10
|
+
* default so we always check `/mnt/c` under WSL. */
|
|
11
|
+
skipWslHostCheck?: boolean;
|
|
12
|
+
wslHost?: ObserveWslHostDiskOptions;
|
|
8
13
|
}
|
|
9
14
|
export declare function observeRunnerDiskGate(input?: ObserveDiskGateInput): DispatchNextDiskGateShape;
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { runDirectory } from "./run-store.js";
|
|
2
|
-
import type { InstructionPolicyEvidenceSnapshot, PersonaContextEvidenceSnapshot } from "./status.js";
|
|
2
|
+
import type { HarnessMemoryQualityCaptureSnapshot, InstructionPolicyEvidenceSnapshot, PersonaContextEvidenceSnapshot } from "./status.js";
|
|
3
3
|
export declare const DEFAULT_DISPATCH_LEASE_MS: number;
|
|
4
4
|
export interface HarnessWorkerDispatchContext {
|
|
5
5
|
instructionPolicyMarkdown: string | null;
|
|
6
6
|
instructionPolicyFingerprint: string | null;
|
|
7
7
|
instructionPolicyEvidence: InstructionPolicyEvidenceSnapshot | null;
|
|
8
|
+
memoryQualityCapture: HarnessMemoryQualityCaptureSnapshot | null;
|
|
8
9
|
personaMarkdown: string | null;
|
|
9
10
|
personaSlug: string | null;
|
|
10
11
|
personaEvidence: PersonaContextEvidenceSnapshot | null;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { DoctorCheck } from "./doctor.types.js";
|
|
2
|
+
export type DeploymentSchedulerProvider = "qstash" | "kynver-cron" | "openclaw-cron";
|
|
2
3
|
export interface RuntimeTakeoverSchedulerEnv {
|
|
3
4
|
kynverSchedulerProvider?: string;
|
|
5
|
+
/** Local durable openclaw-cron bridge (`OPENCLAW_CRON_STORE_PATH`). */
|
|
6
|
+
openclawCronStorePath?: boolean;
|
|
4
7
|
/** True when this process has QStash credentials (typical Kynver server deploy). */
|
|
5
8
|
qstashTokenPresent?: boolean;
|
|
6
9
|
/** Explicit hosted-deploy marker (`KYNVER_HOSTED_DEPLOYMENT=1|true|yes`). */
|
|
@@ -10,6 +13,8 @@ export interface RuntimeTakeoverSchedulerContext {
|
|
|
10
13
|
agentOsId?: string | null;
|
|
11
14
|
apiBaseUrl?: string | null;
|
|
12
15
|
hasScopedRunnerToken: boolean;
|
|
16
|
+
/** Operator attestation in ~/.kynver/config.json for the hosted deployment. */
|
|
17
|
+
deploymentSchedulerProvider?: DeploymentSchedulerProvider;
|
|
13
18
|
}
|
|
14
19
|
/**
|
|
15
20
|
* Scheduler readiness for runtime takeover.
|
|
@@ -26,6 +26,8 @@ export interface RuntimeTakeoverProbes {
|
|
|
26
26
|
kynverHarnessRoot?: string;
|
|
27
27
|
opusHarnessRoot?: string;
|
|
28
28
|
kynverSchedulerProvider?: string;
|
|
29
|
+
/** Local durable openclaw-cron bridge (`OPENCLAW_CRON_STORE_PATH`). */
|
|
30
|
+
openclawCronStorePath?: boolean;
|
|
29
31
|
qstashTokenPresent?: boolean;
|
|
30
32
|
kynverHostedDeployment?: boolean;
|
|
31
33
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface HarnessStorageSnapshot {
|
|
2
|
+
harnessRoot: string;
|
|
3
|
+
worktreesDir: string;
|
|
4
|
+
/** Sum of per-run directory sizes. `null` when scan exceeded entry cap. */
|
|
5
|
+
worktreesBytes: number | null;
|
|
6
|
+
/** Top-level run directory count under `worktreesDir`. */
|
|
7
|
+
runCount: number;
|
|
8
|
+
/** Total worktree (worker) directories across all runs. */
|
|
9
|
+
workerCount: number;
|
|
10
|
+
/** Earliest run-directory mtime, ISO string. `null` when no runs present. */
|
|
11
|
+
oldestRunAt: string | null;
|
|
12
|
+
scannedAt: string;
|
|
13
|
+
}
|
|
14
|
+
interface ScanOptions {
|
|
15
|
+
harnessRoot?: string;
|
|
16
|
+
/** Cap per directorySizeBytes call. Default 50k entries — keeps the snapshot fast for monitor ticks. Set null/0 to return bytes=null without scanning. */
|
|
17
|
+
perRunEntryCap?: number | null;
|
|
18
|
+
now?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Read-only summary of harness worktree storage usage. Surfaced in cleanup
|
|
22
|
+
* summaries and consumable by monitor/Command Center to flag disk pressure
|
|
23
|
+
* before WSL runs out of space again.
|
|
24
|
+
*/
|
|
25
|
+
export declare function harnessStorageSnapshot(opts?: ScanOptions): HarnessStorageSnapshot;
|
|
26
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { PACKAGE_VERSION } from "./package-version.js";
|
|
2
2
|
export { buildDispatchTaskText, dispatchRun, DEFAULT_DISPATCH_LEASE_MS } from "./dispatch.js";
|
|
3
3
|
export { observeRunnerDiskGate } from "./disk-gate.js";
|
|
4
|
-
export {
|
|
4
|
+
export { isWslHost, observeWslHostDisk, summarizeWslRecoverySteps, DEFAULT_WSL_HOST_MOUNT, DEFAULT_WSL_HOST_WARN_FREE_BYTES, DEFAULT_WSL_HOST_CRITICAL_FREE_BYTES, type WslHostDiskShape, } from "./wsl-host.js";
|
|
5
|
+
export { postJson, type DispatchNextDiskGateShape, type DispatchNextWslHostShape, } from "./callbacks.js";
|
|
5
6
|
export { parseClaudeStream, parseHarnessStream, summarizeEvent, summarizeShellToolCallEvent, } from "./stream.js";
|
|
6
7
|
export { classifyNpmAuditOutcome, classifyShellCommandOutcome, summarizeNpmAuditReport, type NpmAuditSummary, type ShellCommandOutcome, type ShellCommandOutcomeKind, } from "./shell-command-outcome.js";
|
|
7
8
|
export { parseHeartbeat, isTerminalHeartbeatPhase, terminalFinalResultFromHeartbeat, } from "./heartbeat.js";
|
|
@@ -15,6 +16,8 @@ export { assessPrHandoffRequirement, ensurePrReadyHandoff, extractPrUrlFromText,
|
|
|
15
16
|
export { normalizeCursorModelAlias, preflightCursorModel } from "./providers/model-preflight.js";
|
|
16
17
|
export { redactHarness } from "./redact.js";
|
|
17
18
|
export { scrubWorkerEnv, scrubClaudeEnv, auditWorkerEnv, listForbiddenWorkerEnvKeys, isForbiddenWorkerEnvKey, FORBIDDEN_WORKER_ENV_KEYS, type WorkerEnvAudit, } from "./worker-env.js";
|
|
19
|
+
export { applyProductionDatabaseToProcess, readProductionDbKeysFromEnvFile, resolveProductionDatabaseUrl, type DbCredentialResolution, type DbCredentialFailure, type DbCredentialSource, type ResolveProductionDatabaseResult, type ResolveProductionDatabaseOptions, } from "./db-credential-resolver.js";
|
|
20
|
+
export { safeDatabaseUrlHint } from "./db-url-hint.js";
|
|
18
21
|
export { validateRunId, validateWorkerName, validateRepo, validateOwnedPaths, validateTailLines, } from "./validate.js";
|
|
19
22
|
export { spawnWorkerProcess, startWorker } from "./supervisor.js";
|
|
20
23
|
export { createRun, listRuns } from "./worktree.js";
|
|
@@ -25,6 +28,10 @@ export { loadUserConfig, saveUserConfig, resolveBaseUrl, resolveCallbackSecret,
|
|
|
25
28
|
export { discoverDefaultRepo, discoverDefaultRepoCandidates, isKynverMonorepoRoot, gitRepoRoot, type DiscoveredDefaultRepo, type DefaultRepoDiscoverySource, } from "./default-repo-discovery.js";
|
|
26
29
|
export { resolveDefaultRepo, persistDefaultRepo, remediateDefaultRepo, formatResolvedDefaultRepo, type ResolvedDefaultRepo, type DefaultRepoSource, } from "./default-repo.js";
|
|
27
30
|
export { getHarnessPaths, resolveHarnessRoot } from "./paths.js";
|
|
31
|
+
export { harnessStorageSnapshot, type HarnessStorageSnapshot, } from "./harness-storage-snapshot.js";
|
|
32
|
+
export { assessOrphanWorktreeSafety } from "./cleanup-orphan-safety.js";
|
|
33
|
+
export { runHarnessCleanup, runPipelineHarnessCleanup, isPipelineCleanupEnabled, } from "./cleanup.js";
|
|
34
|
+
export type { HarnessCleanupSummary, HarnessCleanupOptions, HarnessStorageSnapshotShape, WorktreeRemovalGuardHook, WorktreeRemovalGuardInput, CleanupSkipReason, } from "./cleanup-types.js";
|
|
28
35
|
export { usage, main } from "./cli.js";
|
|
29
36
|
export { reconcileRunsCli, reconcileStaleWorkers, type ReconcileStaleWorkersResult, type StaleWorkerReconcileOutcome } from "./stale-reconcile.js";
|
|
30
37
|
export { runDaemon } from "./daemon.js";
|