@kynver-app/runtime 0.1.73 → 0.1.76
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/active-harness-workers.d.ts +11 -0
- package/dist/cleanup-evidence.d.ts +10 -0
- package/dist/cleanup-execute.d.ts +1 -0
- package/dist/cleanup-guards.d.ts +2 -0
- package/dist/cleanup-retention-config.d.ts +3 -0
- package/dist/cleanup-run-directory.d.ts +20 -0
- package/dist/cleanup-types.d.ts +25 -1
- package/dist/cli.js +2439 -751
- package/dist/cli.js.map +4 -4
- package/dist/cron/hermes-provider-notice.d.ts +1 -0
- package/dist/harness-lease-owner.d.ts +13 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.js +2715 -760
- package/dist/index.js.map +4 -4
- package/dist/landing-contract-gate.d.ts +1 -0
- package/dist/model-routing.d.ts +4 -1
- package/dist/orchestration-providers/audit.d.ts +3 -0
- package/dist/orchestration-providers/capabilities.d.ts +3 -0
- package/dist/orchestration-providers/claude-oauth-binding.d.ts +6 -0
- package/dist/orchestration-providers/codex-oauth-binding.d.ts +5 -0
- package/dist/orchestration-providers/codex-orchestration-adapter.d.ts +13 -0
- package/dist/orchestration-providers/cost-router.d.ts +24 -0
- package/dist/orchestration-providers/cursor-oauth-binding.d.ts +5 -0
- package/dist/orchestration-providers/hermes-cli-adapter.d.ts +15 -0
- package/dist/orchestration-providers/hermes-openai-codex-binding.d.ts +15 -0
- package/dist/orchestration-providers/index.d.ts +13 -0
- package/dist/orchestration-providers/inventory.d.ts +31 -0
- package/dist/orchestration-providers/oauth-binding-utils.d.ts +21 -0
- package/dist/orchestration-providers/routing.d.ts +16 -0
- package/dist/orchestration-providers/types.d.ts +45 -0
- package/dist/paths.d.ts +9 -1
- package/dist/pipeline-tick.d.ts +3 -0
- package/dist/post-restart-unblock.d.ts +24 -0
- package/dist/providers/codex.d.ts +9 -0
- package/dist/providers/hermes-codex.d.ts +9 -0
- package/dist/providers/model-preflight.d.ts +2 -0
- package/dist/providers/openai-codex-resilience.d.ts +33 -0
- package/dist/retry-limits.d.ts +1 -1
- package/dist/stale-reconcile.d.ts +2 -0
- package/dist/status.d.ts +6 -0
- package/dist/supervisor.d.ts +1 -0
- package/dist/worker-metadata-paths.d.ts +26 -0
- package/dist/worker-metadata-reconcile.d.ts +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ActiveHarnessWorkerRef {
|
|
2
|
+
runId: string;
|
|
3
|
+
workerName: string;
|
|
4
|
+
taskId: string;
|
|
5
|
+
pid?: number;
|
|
6
|
+
writeSetPrefixes?: string[];
|
|
7
|
+
ownedPaths?: string[];
|
|
8
|
+
allowConcurrentHotspot?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Live harness workers in one run — matches dispatch-next occupancy reporting. */
|
|
11
|
+
export declare function collectRunActiveHarnessWorkers(runId: string): ActiveHarnessWorkerRef[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CleanupAction, CleanupSkipReason } from "./cleanup-types.js";
|
|
2
|
+
export declare function collectPreservedLivePaths(actions: CleanupAction[], skips: Array<{
|
|
3
|
+
path: string;
|
|
4
|
+
reason: CleanupSkipReason;
|
|
5
|
+
detail?: string;
|
|
6
|
+
}>): Array<{
|
|
7
|
+
path: string;
|
|
8
|
+
reason: CleanupSkipReason;
|
|
9
|
+
detail?: string;
|
|
10
|
+
}>;
|
|
@@ -2,6 +2,7 @@ import type { CleanupAction, CleanupCandidate, CleanupSkipReason } from "./clean
|
|
|
2
2
|
export declare function removeNodeModules(candidate: CleanupCandidate, execute: boolean): CleanupAction;
|
|
3
3
|
export declare function removeNextCache(candidate: CleanupCandidate, execute: boolean): CleanupAction;
|
|
4
4
|
export declare function removeBuildCache(candidate: CleanupCandidate, execute: boolean): CleanupAction;
|
|
5
|
+
export declare function removeRunDirectory(candidate: CleanupCandidate, execute: boolean): CleanupAction;
|
|
5
6
|
export declare function removeWorktree(candidate: CleanupCandidate, execute: boolean): CleanupAction;
|
|
6
7
|
export declare function isHarnessNodeModulesPath(targetPath: string, harnessRoot: string, worktreesDir: string): CleanupSkipReason | null;
|
|
7
8
|
export declare function isHarnessNextCachePath(targetPath: string, harnessRoot: string, worktreesDir: string): CleanupSkipReason | null;
|
package/dist/cleanup-guards.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface WorktreeGuardInput {
|
|
|
10
10
|
worktreePath: string;
|
|
11
11
|
includeOrphans: boolean;
|
|
12
12
|
worktreesAgeMs: number;
|
|
13
|
+
/** Shorter age gate for harness runs already marked terminal. */
|
|
14
|
+
terminalWorktreesAgeMs: number;
|
|
13
15
|
ageMs: number;
|
|
14
16
|
/**
|
|
15
17
|
* Filesystem-derived skip reason for orphan candidates (computed by
|
|
@@ -5,6 +5,9 @@ export interface ResolvedHarnessRetention {
|
|
|
5
5
|
finalizeStaleRuns: boolean;
|
|
6
6
|
nodeModulesAgeMs: number;
|
|
7
7
|
worktreesAgeMs: number;
|
|
8
|
+
terminalWorktreesAgeMs: number;
|
|
9
|
+
runDirectoriesAgeMs: number;
|
|
10
|
+
maxActionsPerSweep: number;
|
|
8
11
|
includeOrphans: boolean;
|
|
9
12
|
runIdFilter?: string;
|
|
10
13
|
accountBytes: boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CleanupCandidate, CleanupSkipReason } from "./cleanup-types.js";
|
|
2
|
+
import type { ActiveWorktreeGuardSnapshot } from "./cleanup-active-worktrees.js";
|
|
3
|
+
export interface ScanRunDirectoryOptions {
|
|
4
|
+
harnessRoot: string;
|
|
5
|
+
worktreesDir: string;
|
|
6
|
+
runDirectoriesAgeMs: number;
|
|
7
|
+
runIdFilter?: string;
|
|
8
|
+
activeGuards: ActiveWorktreeGuardSnapshot;
|
|
9
|
+
now: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function skipRunDirectoryRemoval(input: {
|
|
12
|
+
harnessRoot: string;
|
|
13
|
+
runId: string;
|
|
14
|
+
runPath: string;
|
|
15
|
+
ageMs: number;
|
|
16
|
+
runDirectoriesAgeMs: number;
|
|
17
|
+
activeGuards: ActiveWorktreeGuardSnapshot;
|
|
18
|
+
}): CleanupSkipReason | null;
|
|
19
|
+
/** Empty per-run folders under `worktrees/<runId>/` after worker worktrees are gone. */
|
|
20
|
+
export declare function scanStaleRunDirectoryCandidates(opts: ScanRunDirectoryOptions): CleanupCandidate[];
|
package/dist/cleanup-types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type CleanupActionKind = "remove_node_modules" | "remove_next_cache" | "remove_build_cache" | "remove_worktree";
|
|
1
|
+
export type CleanupActionKind = "remove_node_modules" | "remove_next_cache" | "remove_build_cache" | "remove_worktree" | "remove_run_directory";
|
|
2
2
|
export type CleanupSkipReason = "dry_run" | "below_age_threshold" | "active_worker" | "dirty_worktree" | "landing_blocked" | "pr_or_unmerged_commits" | "completion_blocked" | "run_still_active" | "path_outside_harness" | "worktrees_disabled" | "orphan_without_flag" | "missing_worktree" | "remove_failed"
|
|
3
3
|
/** AgentOS / operator lifecycle overlay blocked removal (see `detail`). */
|
|
4
4
|
| "board_lifecycle_blocked";
|
|
@@ -67,6 +67,14 @@ export interface HarnessCleanupSummary {
|
|
|
67
67
|
};
|
|
68
68
|
/** Disk-pressure evidence — present when bytes accounting is enabled. */
|
|
69
69
|
storage?: HarnessStorageSnapshotShape;
|
|
70
|
+
/** Sample of paths kept because workers/runs are still live (for operator summaries). */
|
|
71
|
+
preservedLivePaths?: Array<{
|
|
72
|
+
path: string;
|
|
73
|
+
reason: CleanupSkipReason;
|
|
74
|
+
detail?: string;
|
|
75
|
+
}>;
|
|
76
|
+
/** Empty harness worktree run directories removed after worker worktrees were reclaimed. */
|
|
77
|
+
removedRunDirectories?: number;
|
|
70
78
|
}
|
|
71
79
|
export interface WorktreeRemovalGuardInput {
|
|
72
80
|
worktreePath: string;
|
|
@@ -92,6 +100,15 @@ export interface HarnessCleanupOptions {
|
|
|
92
100
|
nodeModulesAgeMs?: number;
|
|
93
101
|
/** When 0 or unset, worktree removal is disabled. */
|
|
94
102
|
worktreesAgeMs?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Age threshold for worktrees whose harness run is already terminal
|
|
105
|
+
* (`completed` / `failed` / `cancelled` / `done`). Salvage gates still apply.
|
|
106
|
+
*/
|
|
107
|
+
terminalWorktreesAgeMs?: number;
|
|
108
|
+
/** Minimum age before removing an empty `worktrees/<runId>/` directory. */
|
|
109
|
+
runDirectoriesAgeMs?: number;
|
|
110
|
+
/** Cap actions evaluated per sweep (cron/watchdog boundedness). */
|
|
111
|
+
maxActionsPerSweep?: number;
|
|
95
112
|
/** Allow cleaning `node_modules` under worktrees with no worker index entry. */
|
|
96
113
|
includeOrphans?: boolean;
|
|
97
114
|
/** When set, only consider workers for this harness run (pipeline tick scope). */
|
|
@@ -104,3 +121,10 @@ export interface HarnessCleanupOptions {
|
|
|
104
121
|
export declare const DEFAULT_NODE_MODULES_AGE_MS: number;
|
|
105
122
|
/** Seven days — only used when worktree cleanup is explicitly enabled. */
|
|
106
123
|
export declare const DEFAULT_WORKTREES_AGE_MS: number;
|
|
124
|
+
/** Terminal runs: salvage-first worktree removal after workers finish (6h default). */
|
|
125
|
+
export declare const DEFAULT_TERMINAL_WORKTREES_AGE_MS: number;
|
|
126
|
+
/** Empty per-run worktree folders under `worktrees/<runId>/`. */
|
|
127
|
+
export declare const DEFAULT_RUN_DIRECTORIES_AGE_MS: number;
|
|
128
|
+
/** Bounded cron/watchdog scan — skip remaining candidates when exceeded. */
|
|
129
|
+
export declare const DEFAULT_MAX_ACTIONS_PER_SWEEP = 120;
|
|
130
|
+
export declare const MAX_PRESERVED_LIVE_PATH_SAMPLES = 24;
|