@kynver-app/runtime 0.1.93 → 0.1.99

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.
@@ -36,7 +36,5 @@ export interface RuntimeTakeoverProbes {
36
36
  legacyOpenclawHarnessRoot(): string;
37
37
  pathExists(target: string): boolean;
38
38
  pathWritable(target: string): boolean;
39
- vercelVersion(): CommandProbeResult;
40
- vercelWhoami(): CommandProbeResult;
41
39
  }
42
40
  export declare const defaultRuntimeTakeoverProbes: RuntimeTakeoverProbes;
@@ -10,8 +10,9 @@ export interface HarnessVerifySummary {
10
10
  steps: HarnessVerifyStep[];
11
11
  }
12
12
  /**
13
- * Run plan/harness verification commands with memory-bounded subprocess execution.
14
- * Parallel worktrees remain allowed each call admits by MemAvailable at start.
13
+ * Run plan/harness verification commands through the cross-process heavy-verification
14
+ * gate and memory-bounded subprocess execution. Parallel workers queue here instead
15
+ * of launching simultaneous typecheck/build commands.
15
16
  */
16
17
  export declare function runHarnessVerifyCommands(cwd: string, commands?: readonly string[], opts?: {
17
18
  waitForAdmissionMs?: number;
@@ -0,0 +1,10 @@
1
+ import { assessHeavyVerificationGate, tryAcquireHeavyVerificationSlot, type HeavyVerificationGateVerdict } from "./slot.js";
2
+ export declare function sleepMs(ms: number): void;
3
+ /**
4
+ * Poll until a heavy-verification slot is acquired or timeout elapses.
5
+ * Serializes expensive typecheck/build across harness worker processes.
6
+ */
7
+ export declare function waitForHeavyVerificationSlot(command: string, timeoutMs: number, pollMs?: number, opts?: Parameters<typeof tryAcquireHeavyVerificationSlot>[1]): HeavyVerificationGateVerdict & {
8
+ slotId: string | null;
9
+ };
10
+ export { assessHeavyVerificationGate, type HeavyVerificationGateVerdict };
@@ -0,0 +1,3 @@
1
+ export { DEFAULT_HEAVY_VERIFICATION_MAX_CONCURRENT, DEFAULT_HEAVY_VERIFICATION_STALE_MS, assessHeavyVerificationGate, countActiveHeavyVerificationSlots, isHeavyVerificationGateSkipped, listActiveHeavyVerificationSlots, reclaimStaleHeavyVerificationSlots, releaseHeavyVerificationSlot, resolveHeavyVerificationMaxConcurrent, tryAcquireHeavyVerificationSlot, type HeavyVerificationGateVerdict, type HeavyVerificationSlotRecord, } from "./slot.js";
2
+ export { waitForHeavyVerificationSlot } from "./gate.js";
3
+ export { ensureHeavyVerificationDirs, heavyVerificationSlotsDir, resolveHeavyVerificationRoot, } from "./paths.js";
@@ -0,0 +1,3 @@
1
+ export declare function resolveHeavyVerificationRoot(): string;
2
+ export declare function heavyVerificationSlotsDir(): string;
3
+ export declare function ensureHeavyVerificationDirs(): string;
@@ -0,0 +1,49 @@
1
+ /** Reclaim slots held by dead PIDs or long-running orphans. */
2
+ export declare const DEFAULT_HEAVY_VERIFICATION_STALE_MS: number;
3
+ /** Default global cap — serialize typecheck/build across harness workers. */
4
+ export declare const DEFAULT_HEAVY_VERIFICATION_MAX_CONCURRENT = 1;
5
+ export interface HeavyVerificationSlotRecord {
6
+ slotId: string;
7
+ pid: number;
8
+ acquiredAt: string;
9
+ command: string;
10
+ }
11
+ export interface HeavyVerificationGateVerdict {
12
+ admitted: boolean;
13
+ slotId: string | null;
14
+ activeSlots: number;
15
+ maxSlots: number;
16
+ reason: string | null;
17
+ }
18
+ export declare function isHeavyVerificationGateSkipped(): boolean;
19
+ export declare function resolveHeavyVerificationMaxConcurrent(): number;
20
+ /** Remove dead/orphan slot files before admission attempts. */
21
+ export declare function reclaimStaleHeavyVerificationSlots(opts?: {
22
+ slotsDir?: string;
23
+ staleMs?: number;
24
+ }): number;
25
+ export declare function listActiveHeavyVerificationSlots(opts?: {
26
+ slotsDir?: string;
27
+ staleMs?: number;
28
+ }): HeavyVerificationSlotRecord[];
29
+ export declare function countActiveHeavyVerificationSlots(opts?: {
30
+ slotsDir?: string;
31
+ staleMs?: number;
32
+ }): number;
33
+ /**
34
+ * Try to acquire one heavy-verification slot using fixed index files (`slot-0.json`, …)
35
+ * and exclusive `wx` create. Avoids count-then-UUID TOCTOU races under burst dispatch.
36
+ */
37
+ export declare function tryAcquireHeavyVerificationSlot(command: string, opts?: {
38
+ slotsDir?: string;
39
+ staleMs?: number;
40
+ maxSlots?: number;
41
+ }): HeavyVerificationGateVerdict;
42
+ export declare function releaseHeavyVerificationSlot(slotId: string | null | undefined, opts?: {
43
+ slotsDir?: string;
44
+ }): void;
45
+ export declare function assessHeavyVerificationGate(command: string, opts?: {
46
+ slotsDir?: string;
47
+ staleMs?: number;
48
+ maxSlots?: number;
49
+ }): HeavyVerificationGateVerdict;
package/dist/index.d.ts CHANGED
@@ -57,6 +57,7 @@ export { canonicalWorkerDir, hasNestedRunsSegment, repairNestedRunsPath, resolve
57
57
  export { runDaemon } from "./daemon.js";
58
58
  export { runHarnessVerifyCommands, DEFAULT_HARNESS_VERIFY_COMMANDS, type HarnessVerifySummary, type HarnessVerifyStep, } from "./harness-verify.js";
59
59
  export { runBoundedBuildCheck, assessBuildAdmission, mergeNodeOptionsForBuildCheck, buildSystemdRunArgv, isSystemdRunAvailable, readMemAvailableBytes, type BoundedBuildExecResult, type BuildAdmissionVerdict, } from "./bounded-build/index.js";
60
+ export { assessHeavyVerificationGate, countActiveHeavyVerificationSlots, isHeavyVerificationGateSkipped, listActiveHeavyVerificationSlots, reclaimStaleHeavyVerificationSlots, releaseHeavyVerificationSlot, resolveHeavyVerificationMaxConcurrent, tryAcquireHeavyVerificationSlot, waitForHeavyVerificationSlot, DEFAULT_HEAVY_VERIFICATION_MAX_CONCURRENT, type HeavyVerificationGateVerdict, type HeavyVerificationSlotRecord, } from "./heavy-verification/index.js";
60
61
  export { assessAutoCompleteEligibility, classifyWorkerHealth, getMonitorStatus, listMonitors, runMonitorTick, spawnMonitorSidecar, type AutoCompleteAssessment, type MonitorTickResult, type TaskLeaseSnapshot, type WorkerHealthClass, type WorkerMonitorView, } from "./monitor/index.js";
61
62
  export { formatHarnessToolReadable, formatMonitorTickNotice, formatAutoCompleteOutcomeNotice, formatWorkerStatusNotice, formatWorkerCompleteNotice, joinHarnessNotice, type HarnessReadableNotice, type HarnessToolFormatContext, } from "./harness-notice/index.js";
62
63
  export { persistPlan, drainPlanOutbox, listOutboxItems, formatPlanOutboxHandoffBlock, extractPlanOutboxFromTask, hashPlanBody, type PersistPlanInput, type PersistPlanResult, type PlanPersistUserStatus, } from "./plan-persist/index.js";