@kynver-app/runtime 0.1.134 → 0.1.139

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.
@@ -13,3 +13,13 @@ export declare function discoverDefaultRepo(opts?: {
13
13
  cwd?: string;
14
14
  runtimeModuleUrl?: string;
15
15
  }): DiscoveredDefaultRepo | null;
16
+ /** Harness worker worktrees are valid for ephemeral resolution but poor durable defaultRepo targets. */
17
+ export declare function isHarnessWorktreeRepo(repo: string): boolean;
18
+ /**
19
+ * Prefer stable monorepo checkouts when persisting defaultRepo (setup, doctor remediation).
20
+ * Falls back to cwd when no durable candidate exists.
21
+ */
22
+ export declare function discoverDefaultRepoForPersistence(opts?: {
23
+ cwd?: string;
24
+ runtimeModuleUrl?: string;
25
+ }): DiscoveredDefaultRepo | null;
@@ -13,6 +13,8 @@ export interface ResolveDefaultRepoOptions {
13
13
  runtimeModuleUrl?: string;
14
14
  }
15
15
  export declare function resolveDefaultRepo(opts?: ResolveDefaultRepoOptions): ResolvedDefaultRepo | null;
16
+ /** Discovery for setup/doctor persistence — skips harness worktrees when a stable checkout exists. */
17
+ export declare function resolveDefaultRepoForPersistence(opts?: ResolveDefaultRepoOptions): ResolvedDefaultRepo | null;
16
18
  export declare function persistDefaultRepo(repo: string, existing?: KynverUserConfig): KynverUserConfig;
17
19
  export declare function remediateDefaultRepo(opts?: ResolveDefaultRepoOptions): {
18
20
  ok: true;
@@ -1,4 +1,5 @@
1
1
  import type { DispatchNextDiskGateShape } from "./callbacks.js";
2
+ import { type ObserveWslCrashDumpsOptions } from "./wsl-crash-dumps.js";
2
3
  import { type ObserveWslHostDiskOptions } from "./wsl-host.js";
3
4
  export interface ObserveDiskGateInput {
4
5
  diskPath?: string;
@@ -10,6 +11,9 @@ export interface ObserveDiskGateInput {
10
11
  * default so we always check `/mnt/c` under WSL. */
11
12
  skipWslHostCheck?: boolean;
12
13
  wslHost?: ObserveWslHostDiskOptions;
14
+ /** Opt-out for the Windows-side wsl-crashes probe. */
15
+ skipWslCrashDumpCheck?: boolean;
16
+ wslCrashDumps?: ObserveWslCrashDumpsOptions;
13
17
  }
14
18
  export declare function observeRunnerDiskGate(input?: ObserveDiskGateInput): DispatchNextDiskGateShape;
15
19
  /**
@@ -0,0 +1 @@
1
+ export declare function resolveDispatchCallbackTimeoutMs(): number;
@@ -0,0 +1,3 @@
1
+ /** Structured stderr progress for long multi-worker dispatch fanout (orchestrator-visible). */
2
+ export declare function emitDispatchProgress(payload: Record<string, unknown>): void;
3
+ export declare function isDispatchCallbackTransportFailure(response: unknown): boolean;
@@ -0,0 +1,10 @@
1
+ import { buildRunListRows } from "../run-list.js";
2
+ import type { FactoryStatusSnapshot } from "./types.js";
3
+ export interface CollectFactoryStatusInput {
4
+ mode: FactoryStatusSnapshot["mode"];
5
+ taskId?: string;
6
+ }
7
+ export declare function collectFactoryStatus(input: CollectFactoryStatusInput): FactoryStatusSnapshot | {
8
+ mode: "full";
9
+ runs: ReturnType<typeof buildRunListRows>;
10
+ };
@@ -0,0 +1,5 @@
1
+ import type { HarnessRunRecord } from "../run-store.js";
2
+ import type { HarnessWorkerRecord } from "../status.js";
3
+ import type { FactoryWorkerRow } from "./types.js";
4
+ export declare function isLightweightActiveHarnessWorker(worker: HarnessWorkerRecord): boolean;
5
+ export declare function collectLightweightWorkerRow(run: HarnessRunRecord, workerName: string): FactoryWorkerRow | null;
@@ -0,0 +1,5 @@
1
+ import type { FactoryStatusSnapshot } from "./types.js";
2
+ export declare function renderFactoryStatusCompact(snapshot: FactoryStatusSnapshot): string;
3
+ export declare function renderFactoryStatusWorkers(snapshot: FactoryStatusSnapshot): string;
4
+ export declare function renderFactoryStatusTask(snapshot: FactoryStatusSnapshot): string;
5
+ export declare function renderFactoryStatus(snapshot: FactoryStatusSnapshot): string;
@@ -0,0 +1,46 @@
1
+ import type { RunnerResourceGateShape } from "../resource-gate.js";
2
+ export interface FactoryWorkerRow {
3
+ runId: string;
4
+ runName: string;
5
+ worker: string;
6
+ status: string;
7
+ attention: string;
8
+ attentionReason?: string;
9
+ alive: boolean;
10
+ /** Occupies a machine-wide harness slot (matches dispatch isActiveHarnessWorker semantics). */
11
+ isActive: boolean;
12
+ taskId: string | null;
13
+ planId: string | null;
14
+ leaseOwner: string | null;
15
+ pid?: number;
16
+ model?: string;
17
+ currentTask?: string | null;
18
+ lastHeartbeatPhase?: string | null;
19
+ lastHeartbeatSummary?: string | null;
20
+ heartbeatBlocker?: string | null;
21
+ completionBlocker?: string | null;
22
+ }
23
+ export interface FactoryBlockedItem {
24
+ runId: string;
25
+ worker: string;
26
+ taskId: string | null;
27
+ reason: string;
28
+ }
29
+ export interface FactoryStatusSnapshot {
30
+ generatedAt: string;
31
+ mode: "compact" | "workers" | "task" | "json" | "full";
32
+ harnessRoot: string;
33
+ agentOsId: string | null;
34
+ resourceGate: RunnerResourceGateShape;
35
+ runCount: number;
36
+ runStatusCounts: Record<string, number>;
37
+ workerCount: number;
38
+ workerStatusCounts: Record<string, number>;
39
+ workerAttentionCounts: Record<string, number>;
40
+ activeTaskIds: string[];
41
+ blocked: FactoryBlockedItem[];
42
+ workers: FactoryWorkerRow[];
43
+ /** Present when mode is task drilldown. */
44
+ taskId?: string;
45
+ taskFound?: boolean;
46
+ }
@@ -0,0 +1 @@
1
+ export declare function runFactoryStatusCli(args: Record<string, string | boolean>): void;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,8 @@ export { buildMemoryCostPackageGuardInput, enforceMemoryCostPackageGuardAtStartu
4
4
  export { buildDispatchTaskText, dispatchRun, DEFAULT_DISPATCH_LEASE_MS } from "./dispatch.js";
5
5
  export { observeRunnerDiskGate } from "./disk-gate.js";
6
6
  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";
7
+ export { observeWslCrashDumps, parseWslCrashDumpFilename, readKernelCorePattern, readWslConfigCrashDumpSettings, resolveWslCrashDumpDir, resolveWslWindowsUsername, summarizeWslCrashDumpRecoverySteps, DEFAULT_WSL_CRASH_DUMP_WARN_BYTES, DEFAULT_WSL_CRASH_DUMP_CRITICAL_BYTES, type WslCrashDumpFile, type WslCrashDumpObservation, } from "./wsl-crash-dumps.js";
8
+ export { cleanupWslCrashDumps, shouldAutoCleanupWslCrashDumps, type WslCrashDumpCleanupResult, } from "./wsl-crash-dumps-cleanup.js";
7
9
  export { postJson, type DispatchNextDiskGateShape, type DispatchNextWslHostShape, } from "./callbacks.js";
8
10
  export { parseClaudeStream, parseHarnessStream, summarizeEvent, summarizeShellToolCallEvent, } from "./stream.js";
9
11
  export { classifyNpmAuditOutcome, classifyShellCommandOutcome, summarizeNpmAuditReport, type NpmAuditSummary, type ShellCommandOutcome, type ShellCommandOutcomeKind, } from "./shell-command-outcome.js";
@@ -43,8 +45,8 @@ export { sweepRun } from "./sweep.js";
43
45
  export { completeWorker, runStatus, workerStatus, tailWorker, stopWorker } from "./worker-ops.js";
44
46
  export { autoCompleteWorker, autoCompleteWorkerCli, spawnCompletionSidecar, type AutoCompleteArgs, type AutoCompleteOutcome, type SpawnSidecarOptions, type SpawnedSidecar, } from "./auto-complete.js";
45
47
  export { loadUserConfig, saveUserConfig, resolveBaseUrl, tryResolveBaseUrl, resolveCallbackSecret, resolveCallbackSecretWithMint, tryResolveCallbackSecretWithMint, parseArgs, } from "./config.js";
46
- export { discoverDefaultRepo, discoverDefaultRepoCandidates, isKynverMonorepoRoot, gitRepoRoot, type DiscoveredDefaultRepo, type DefaultRepoDiscoverySource, } from "./default-repo-discovery.js";
47
- export { resolveDefaultRepo, persistDefaultRepo, remediateDefaultRepo, formatResolvedDefaultRepo, type ResolvedDefaultRepo, type DefaultRepoSource, } from "./default-repo.js";
48
+ export { discoverDefaultRepo, discoverDefaultRepoCandidates, discoverDefaultRepoForPersistence, isHarnessWorktreeRepo, isKynverMonorepoRoot, gitRepoRoot, type DiscoveredDefaultRepo, type DefaultRepoDiscoverySource, } from "./default-repo-discovery.js";
49
+ export { resolveDefaultRepo, resolveDefaultRepoForPersistence, persistDefaultRepo, remediateDefaultRepo, formatResolvedDefaultRepo, type ResolvedDefaultRepo, type DefaultRepoSource, } from "./default-repo.js";
48
50
  export { getHarnessPaths, harnessRunsDir, harnessWorktreesDir, normalizeHarnessRoot, resolveHarnessRoot, } from "./paths.js";
49
51
  export { harnessStorageSnapshot, type HarnessStorageSnapshot, } from "./harness-storage-snapshot.js";
50
52
  export { runHarnessCleanup, runPipelineHarnessCleanup, isPipelineCleanupEnabled, } from "./cleanup.js";