@kynver-app/runtime 0.1.49 → 0.1.51
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 +2 -2
- package/dist/cleanup-guards.d.ts +3 -0
- package/dist/cleanup-retention-config.d.ts +14 -0
- package/dist/cleanup-run-liveness.d.ts +13 -0
- package/dist/cleanup-types.d.ts +12 -0
- package/dist/cleanup.d.ts +1 -1
- package/dist/cli.js +795 -546
- package/dist/cli.js.map +4 -4
- package/dist/default-repo-discovery.d.ts +15 -0
- package/dist/default-repo.d.ts +30 -0
- package/dist/finalize.d.ts +9 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +827 -541
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@ Standalone Kynver AgentOS execution runtime and CLI (`kynver`).
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm run kynver:build
|
|
9
|
-
npm run kynver -- setup --api-base-url http://localhost:3000 --agent-os-id <id> --repo /path/to/repo --max-workers 13
|
|
9
|
+
npm run kynver -- setup --api-base-url http://localhost:3000 --agent-os-id <id> [--repo /path/to/repo] --max-workers 13
|
|
10
10
|
npm run kynver -- login --api-key "$KYNVER_API_KEY"
|
|
11
11
|
npm run kynver -- runner credential --agent-os-id <id>
|
|
12
|
-
npm run kynver -- run create --repo /path/to/repo --name my-run
|
|
12
|
+
npm run kynver -- run create [--repo /path/to/repo] --name my-run
|
|
13
13
|
npm run kynver -- daemon --run <runId> --agent-os-id <id> --execute
|
|
14
14
|
```
|
|
15
15
|
|
package/dist/cleanup-guards.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { CleanupSkipReason } from "./cleanup-types.js";
|
|
2
2
|
import type { IndexedWorktree } from "./cleanup-worktree-index.js";
|
|
3
3
|
import type { RawHarnessWorkerStatus } from "./status.js";
|
|
4
|
+
/** Blocks whole-worktree removal when commits are not landed or tree is dirty. */
|
|
4
5
|
export declare function isPrOrUnmergedWork(status: RawHarnessWorkerStatus): boolean;
|
|
6
|
+
/** Strip generated install trees from porcelain — they are what cleanup removes. */
|
|
7
|
+
export declare function materialWorktreeChanges(changedFiles: string[]): string[];
|
|
5
8
|
export interface WorktreeGuardInput {
|
|
6
9
|
indexed: IndexedWorktree | null;
|
|
7
10
|
includeOrphans: boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type HarnessCleanupOptions } from "./cleanup-types.js";
|
|
2
|
+
export interface ResolvedHarnessRetention {
|
|
3
|
+
execute: boolean;
|
|
4
|
+
finalizeStaleRuns: boolean;
|
|
5
|
+
nodeModulesAgeMs: number;
|
|
6
|
+
worktreesAgeMs: number;
|
|
7
|
+
includeOrphans: boolean;
|
|
8
|
+
runIdFilter?: string;
|
|
9
|
+
accountBytes: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Merge CLI options with operator env defaults (pipeline + `kynver cleanup`). */
|
|
12
|
+
export declare function resolveHarnessRetention(options?: HarnessCleanupOptions): ResolvedHarnessRetention;
|
|
13
|
+
/** Pipeline tick: dry-run by default; global scope when `KYNVER_CLEANUP_SCOPE=all`. */
|
|
14
|
+
export declare function resolvePipelineHarnessRetention(runId?: string): ResolvedHarnessRetention;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IndexedWorktree } from "./cleanup-worktree-index.js";
|
|
2
|
+
/** True when the worker process is still live or marked running in worker.json. */
|
|
3
|
+
export declare function isWorkerProcessLive(indexed: IndexedWorktree): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Run record still marked active but every worker is finished — safe to treat as
|
|
6
|
+
* terminal for GC after `finalizeStaleRuns()` (or when deriveTerminalRunStatus is set).
|
|
7
|
+
*/
|
|
8
|
+
export declare function isRunStaleActive(indexed: IndexedWorktree): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the harness run still has unfinished work that should block whole-worktree removal.
|
|
11
|
+
* Does not block per-worker `node_modules` when only this worker is finished.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runBlocksWorktreeRemoval(indexed: IndexedWorktree): boolean;
|
package/dist/cleanup-types.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ export interface CleanupAction extends CleanupCandidate {
|
|
|
15
15
|
skipReason?: CleanupSkipReason;
|
|
16
16
|
error?: string;
|
|
17
17
|
}
|
|
18
|
+
export interface RunFinalizeSummary {
|
|
19
|
+
runId: string;
|
|
20
|
+
from: string;
|
|
21
|
+
to: string;
|
|
22
|
+
}
|
|
18
23
|
export interface HarnessCleanupSummary {
|
|
19
24
|
harnessRoot: string;
|
|
20
25
|
dryRun: boolean;
|
|
@@ -23,6 +28,7 @@ export interface HarnessCleanupSummary {
|
|
|
23
28
|
worktreesAgeMs: number;
|
|
24
29
|
includeOrphans: boolean;
|
|
25
30
|
scannedAt: string;
|
|
31
|
+
finalizedRuns: RunFinalizeSummary[];
|
|
26
32
|
actions: CleanupAction[];
|
|
27
33
|
skips: Array<{
|
|
28
34
|
path: string;
|
|
@@ -31,15 +37,21 @@ export interface HarnessCleanupSummary {
|
|
|
31
37
|
}>;
|
|
32
38
|
totals: {
|
|
33
39
|
candidateBytes: number;
|
|
40
|
+
reclaimableBytes: number;
|
|
34
41
|
removedBytes: number;
|
|
35
42
|
removedPaths: number;
|
|
36
43
|
skippedPaths: number;
|
|
44
|
+
skipReasons: Partial<Record<CleanupSkipReason, number>>;
|
|
37
45
|
};
|
|
38
46
|
}
|
|
39
47
|
export interface HarnessCleanupOptions {
|
|
40
48
|
harnessRoot?: string;
|
|
41
49
|
/** When false (default), only report candidates. */
|
|
42
50
|
execute?: boolean;
|
|
51
|
+
/** When true (default), call `finalizeStaleRuns()` before scanning. */
|
|
52
|
+
finalizeStaleRuns?: boolean;
|
|
53
|
+
/** When true (default), estimate candidate bytes in dry-run summaries. */
|
|
54
|
+
accountBytes?: boolean;
|
|
43
55
|
/** Minimum age before removing generated `node_modules` (default 6h). */
|
|
44
56
|
nodeModulesAgeMs?: number;
|
|
45
57
|
/** When 0 or unset, worktree removal is disabled. */
|
package/dist/cleanup.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HarnessCleanupOptions, type HarnessCleanupSummary } from "./cleanup-types.js";
|
|
2
2
|
export declare function runHarnessCleanup(options?: HarnessCleanupOptions): HarnessCleanupSummary;
|
|
3
|
-
/** Pipeline-safe defaults:
|
|
3
|
+
/** Pipeline-safe defaults: finalize stale runs, dry-run unless execute env is set. */
|
|
4
4
|
export declare function runPipelineHarnessCleanup(runId?: string): HarnessCleanupSummary;
|
|
5
5
|
export declare function isPipelineCleanupEnabled(): boolean;
|