@kynver-app/runtime 0.1.119 → 0.1.122
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/chat/anthropic-credentials.d.ts +3 -1
- package/dist/chat/chat-claim-loop.d.ts +3 -1
- package/dist/cleanup-duplicate-worktrees.d.ts +3 -2
- package/dist/cleanup-git-probe.d.ts +5 -0
- package/dist/cleanup-guards.d.ts +4 -0
- package/dist/cleanup-retention-config.d.ts +2 -0
- package/dist/cleanup-run-liveness.d.ts +3 -6
- package/dist/cleanup-salvage-evidence.d.ts +33 -0
- package/dist/cleanup-types.d.ts +2 -0
- package/dist/cleanup-worker-harness-live.d.ts +9 -0
- package/dist/cleanup-worktree-index.d.ts +2 -0
- package/dist/cli.js +881 -520
- package/dist/cli.js.map +4 -4
- package/dist/config.d.ts +22 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +826 -463
- package/dist/index.js.map +4 -4
- package/dist/run-metadata-retention.d.ts +15 -0
- package/dist/server/cleanup.js +452 -308
- package/dist/server/cleanup.js.map +4 -4
- package/dist/server/default-repo.js.map +2 -2
- package/dist/server/monitor.js.map +2 -2
- package/dist/server/worker-policy.js.map +2 -2
- package/dist/stale-reconcile.d.ts +2 -0
- package/dist/start.d.ts +6 -0
- package/package.json +2 -2
|
@@ -6,4 +6,6 @@ export type LocalAnthropicCredentials = {
|
|
|
6
6
|
token: string;
|
|
7
7
|
};
|
|
8
8
|
export declare function parseClaudeCredentials(raw: string, now?: number): string | null;
|
|
9
|
-
export declare function resolveLocalAnthropicCredentials(env?: Record<string, string | undefined
|
|
9
|
+
export declare function resolveLocalAnthropicCredentials(env?: Record<string, string | undefined>, opts?: {
|
|
10
|
+
oauthOptIn?: boolean;
|
|
11
|
+
}): LocalAnthropicCredentials | null;
|
|
@@ -5,9 +5,11 @@ export interface ChatBridgeTarget {
|
|
|
5
5
|
apiKey: string;
|
|
6
6
|
boxId: string;
|
|
7
7
|
model: string;
|
|
8
|
+
/** Claude Code OAuth opt-in (config `chatUseClaudeOauth` or env). */
|
|
9
|
+
useClaudeOauth: boolean;
|
|
8
10
|
}
|
|
9
11
|
/** Resolve the chat-bridge target; null when the feature is off/unconfigured. */
|
|
10
|
-
export declare function resolveChatBridgeTarget(env?: Record<string, string | undefined>): ChatBridgeTarget | null
|
|
12
|
+
export declare function resolveChatBridgeTarget(env?: Record<string, string | undefined>): Promise<ChatBridgeTarget | null>;
|
|
11
13
|
interface ClaimedTurn {
|
|
12
14
|
turnId: string;
|
|
13
15
|
agentOsId: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { CleanupCandidate } from "./cleanup-types.js";
|
|
2
2
|
import type { ScanHarnessOptions } from "./cleanup-scan.js";
|
|
3
3
|
/**
|
|
4
|
-
* Secondary git worktrees under the harness layout that are
|
|
5
|
-
* (aborted duplicate attempts).
|
|
4
|
+
* Secondary git worktrees under the harness layout that are not indexed
|
|
5
|
+
* (aborted duplicate attempts). Salvage guards (orphan safety) run at evaluation
|
|
6
|
+
* time — do not run per-worktree `git status` during the scan pass.
|
|
6
7
|
*/
|
|
7
8
|
export declare function scanDuplicateWorktreeCandidates(opts: ScanHarnessOptions): CleanupCandidate[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { GitCaptureResult } from "./git.js";
|
|
2
|
+
/** Bounded git work during broad cleanup scans — hung repos must not stall the sweep. */
|
|
3
|
+
export declare const CLEANUP_GIT_PROBE_TIMEOUT_MS = 5000;
|
|
4
|
+
export declare function cleanupGitCapture(cwd: string, args: string[]): GitCaptureResult;
|
|
5
|
+
export declare function gitStatusShortForCleanup(worktreePath: string): string[] | null;
|
package/dist/cleanup-guards.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ export interface WorktreeGuardInput {
|
|
|
20
20
|
orphanSafety?: CleanupSkipReason | null;
|
|
21
21
|
worktreeRemovalGuard?: WorktreeRemovalGuardHook;
|
|
22
22
|
liveness?: CleanupRunLivenessContext;
|
|
23
|
+
now?: number;
|
|
24
|
+
harnessRoot?: string;
|
|
25
|
+
/** When true (execute mode), persist salvage evidence before allowing removal. */
|
|
26
|
+
writeSalvageEvidence?: boolean;
|
|
23
27
|
}
|
|
24
28
|
export type WorktreeGuardSkip = CleanupSkipReason | {
|
|
25
29
|
reason: CleanupSkipReason;
|
|
@@ -3,6 +3,8 @@ import { type HarnessCleanupOptions } from "./cleanup-types.js";
|
|
|
3
3
|
export interface ResolvedHarnessRetention {
|
|
4
4
|
execute: boolean;
|
|
5
5
|
finalizeStaleRuns: boolean;
|
|
6
|
+
/** When false, skip node_modules/.next/build-cache scans (worktree-only operator sweeps). */
|
|
7
|
+
scanDependencyCaches: boolean;
|
|
6
8
|
nodeModulesAgeMs: number;
|
|
7
9
|
worktreesAgeMs: number;
|
|
8
10
|
terminalWorktreesAgeMs: number;
|
|
@@ -7,11 +7,8 @@ export interface CleanupRunLivenessContext {
|
|
|
7
7
|
gitStatusCache: CleanupGitStatusCache;
|
|
8
8
|
gitRevCache: CleanupGitRevCache;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
* terminal hints before falling back to full `computeWorkerStatus` (expensive).
|
|
13
|
-
*/
|
|
14
|
-
export declare function isWorkerProcessLive(indexed: IndexedWorktree): boolean;
|
|
10
|
+
/** True when the worker process or heartbeat still shows live harness activity. */
|
|
11
|
+
export declare function isWorkerProcessLive(indexed: IndexedWorktree, now?: number): boolean;
|
|
15
12
|
/**
|
|
16
13
|
* Run record still marked active but every worker is finished — safe to treat as
|
|
17
14
|
* terminal for GC after `finalizeStaleRuns()` (or when deriveTerminalRunStatus is set).
|
|
@@ -21,4 +18,4 @@ export declare function isRunStaleActive(indexed: IndexedWorktree, ctx?: Cleanup
|
|
|
21
18
|
* Whether the harness run still has unfinished work that should block whole-worktree removal.
|
|
22
19
|
* Does not block per-worker `node_modules` when only this worker is finished.
|
|
23
20
|
*/
|
|
24
|
-
export declare function runBlocksWorktreeRemoval(indexed: IndexedWorktree, ctx?: CleanupRunLivenessContext): boolean;
|
|
21
|
+
export declare function runBlocksWorktreeRemoval(indexed: IndexedWorktree, ctx?: CleanupRunLivenessContext, now?: number): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CleanupSkipReason } from "./cleanup-types.js";
|
|
2
|
+
import type { IndexedWorktree } from "./cleanup-worktree-index.js";
|
|
3
|
+
import type { RawHarnessWorkerStatus } from "./status.js";
|
|
4
|
+
export interface WorktreeSalvageEvidenceRecord {
|
|
5
|
+
capturedAt: string;
|
|
6
|
+
skipReason: CleanupSkipReason;
|
|
7
|
+
runId: string;
|
|
8
|
+
workerName: string;
|
|
9
|
+
worktreePath: string;
|
|
10
|
+
taskId?: string;
|
|
11
|
+
agentOsId?: string;
|
|
12
|
+
branch?: string;
|
|
13
|
+
completionBlocker?: string;
|
|
14
|
+
finalResult?: unknown;
|
|
15
|
+
changedFiles: string[];
|
|
16
|
+
gitAncestry: RawHarnessWorkerStatus["gitAncestry"];
|
|
17
|
+
prUrl?: string | null;
|
|
18
|
+
patchPath?: string | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function salvageEvidenceDir(harnessRoot: string, runId: string, workerName: string): string;
|
|
21
|
+
export declare function hasSalvageEvidence(input: {
|
|
22
|
+
harnessRoot: string;
|
|
23
|
+
runId: string;
|
|
24
|
+
workerName: string;
|
|
25
|
+
}): boolean;
|
|
26
|
+
/** Persist worktree/git evidence before whole-worktree removal for operator salvage review. */
|
|
27
|
+
export declare function writeWorktreeSalvageEvidence(input: {
|
|
28
|
+
harnessRoot: string;
|
|
29
|
+
indexed: IndexedWorktree;
|
|
30
|
+
skipReason: CleanupSkipReason;
|
|
31
|
+
status: RawHarnessWorkerStatus;
|
|
32
|
+
now?: number;
|
|
33
|
+
}): WorktreeSalvageEvidenceRecord;
|
package/dist/cleanup-types.d.ts
CHANGED
|
@@ -106,6 +106,8 @@ export interface HarnessCleanupOptions {
|
|
|
106
106
|
storagePerRunEntryCap?: number | null;
|
|
107
107
|
/** Per-candidate filesystem walk cap when `du` is unavailable. */
|
|
108
108
|
byteAccountingEntryCap?: number;
|
|
109
|
+
/** When false, skip node_modules/.next/build-cache scans (worktree-only operator sweeps). */
|
|
110
|
+
scanDependencyCaches?: boolean;
|
|
109
111
|
/** Minimum age before removing generated `node_modules` (default 6h). */
|
|
110
112
|
nodeModulesAgeMs?: number;
|
|
111
113
|
/** When 0 or unset, worktree removal is disabled. */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HarnessWorkerRecord } from "./status.js";
|
|
2
|
+
/** True when parsed heartbeat JSON has a recent `ts` (not file mtime alone). */
|
|
3
|
+
export declare function heartbeatContentIsFresh(worker: HarnessWorkerRecord, now?: number, windowMs?: number): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Whether a harness worker still has live execution signals: OS process and/or
|
|
6
|
+
* fresh heartbeat content. Ignores stale `worker.json` status and file mtimes
|
|
7
|
+
* that daemons or scanners may touch without a running worker.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isHarnessWorkerHarnessLive(worker: HarnessWorkerRecord, now?: number, windowMs?: number): boolean;
|
|
@@ -11,6 +11,8 @@ export interface IndexedWorktree {
|
|
|
11
11
|
status?: RawHarnessWorkerStatus;
|
|
12
12
|
}
|
|
13
13
|
export declare function buildWorktreeIndex(): Map<string, IndexedWorktree>;
|
|
14
|
+
/** Scope a merged multi-root index to one harness tree (avoids triple-scanning every worker). */
|
|
15
|
+
export declare function filterWorktreeIndexForRoot(index: Map<string, IndexedWorktree>, harnessRoot: string): Map<string, IndexedWorktree>;
|
|
14
16
|
export declare function buildWorktreeIndexAt(harnessRoot: string): Map<string, IndexedWorktree>;
|
|
15
17
|
/** Load worker when index miss but path is known from disk layout. */
|
|
16
18
|
export declare function loadIndexedWorker(runId: string, workerName: string): HarnessWorkerRecord | null;
|