@kynver-app/runtime 0.1.39 → 0.1.47

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.
Files changed (117) hide show
  1. package/README.md +15 -0
  2. package/dist/auto-complete.d.ts +60 -0
  3. package/dist/bounded-build/admission.d.ts +30 -0
  4. package/dist/bounded-build/constants.d.ts +10 -0
  5. package/dist/bounded-build/exec.d.ts +26 -0
  6. package/dist/bounded-build/index.d.ts +6 -0
  7. package/dist/bounded-build/meminfo.d.ts +5 -0
  8. package/dist/bounded-build/node-options.d.ts +9 -0
  9. package/dist/bounded-build/systemd-wrap.d.ts +17 -0
  10. package/dist/callback-headers.d.ts +2 -0
  11. package/dist/callbacks.d.ts +38 -0
  12. package/dist/cleanup-cli.d.ts +1 -0
  13. package/dist/cleanup-dir-size.d.ts +4 -0
  14. package/dist/cleanup-execute.d.ts +4 -0
  15. package/dist/cleanup-guards.d.ts +18 -0
  16. package/dist/cleanup-scan.d.ts +14 -0
  17. package/dist/cleanup-types.d.ts +56 -0
  18. package/dist/cleanup-worktree-index.d.ts +13 -0
  19. package/dist/cleanup.d.ts +5 -0
  20. package/dist/cli.d.ts +3 -0
  21. package/dist/cli.js +1398 -199
  22. package/dist/cli.js.map +4 -4
  23. package/dist/command-center-contract-cli.d.ts +1 -0
  24. package/dist/completion-ack.d.ts +10 -0
  25. package/dist/completion-response.d.ts +15 -0
  26. package/dist/config.d.ts +61 -0
  27. package/dist/daemon.d.ts +5 -0
  28. package/dist/disk-gate.d.ts +9 -0
  29. package/dist/dispatch.d.ts +16 -0
  30. package/dist/doctor/doctor.types.d.ts +25 -0
  31. package/dist/doctor/index.d.ts +4 -0
  32. package/dist/doctor/runtime-takeover-cli.d.ts +1 -0
  33. package/dist/doctor/runtime-takeover.d.ts +3 -0
  34. package/dist/doctor/runtime-takeover.probes.d.ts +37 -0
  35. package/dist/exit-classify.d.ts +12 -0
  36. package/dist/exited-salvage.d.ts +22 -0
  37. package/dist/finalize.d.ts +16 -0
  38. package/dist/fortress-engagement-gate.d.ts +5 -0
  39. package/dist/git.d.ts +37 -0
  40. package/dist/github-repo.d.ts +5 -0
  41. package/dist/harness-verify-cli.d.ts +1 -0
  42. package/dist/harness-verify.d.ts +19 -0
  43. package/dist/heartbeat.d.ts +22 -0
  44. package/dist/index.d.ts +33 -0
  45. package/dist/index.js +1733 -202
  46. package/dist/index.js.map +4 -4
  47. package/dist/installed-package-versions.d.ts +6 -0
  48. package/dist/landing-contract-gate.d.ts +24 -0
  49. package/dist/landing-gate.d.ts +24 -0
  50. package/dist/lease-renewal.d.ts +15 -0
  51. package/dist/model-routing-task-enrich.d.ts +8 -0
  52. package/dist/model-routing.d.ts +29 -0
  53. package/dist/monitor/index.d.ts +7 -0
  54. package/dist/monitor/monitor-cli.d.ts +9 -0
  55. package/dist/monitor/monitor-loop.d.ts +1 -0
  56. package/dist/monitor/monitor-spawn.d.ts +18 -0
  57. package/dist/monitor/monitor.classify.d.ts +15 -0
  58. package/dist/monitor/monitor.service.d.ts +17 -0
  59. package/dist/monitor/monitor.store.d.ts +6 -0
  60. package/dist/monitor/monitor.task-lease.d.ts +11 -0
  61. package/dist/monitor/monitor.terminal.d.ts +11 -0
  62. package/dist/monitor/monitor.types.d.ts +74 -0
  63. package/dist/package-version.d.ts +5 -0
  64. package/dist/path-values.d.ts +5 -0
  65. package/dist/paths.d.ts +7 -0
  66. package/dist/pipeline-dispatch.d.ts +7 -0
  67. package/dist/pipeline-tick.d.ts +45 -0
  68. package/dist/plan-persist/agentos-api.d.ts +28 -0
  69. package/dist/plan-persist/body-hash.d.ts +3 -0
  70. package/dist/plan-persist/drain.d.ts +7 -0
  71. package/dist/plan-persist/errors.d.ts +9 -0
  72. package/dist/plan-persist/handoff.d.ts +7 -0
  73. package/dist/plan-persist/idempotency.d.ts +2 -0
  74. package/dist/plan-persist/index.d.ts +8 -0
  75. package/dist/plan-persist/outbox-store.d.ts +18 -0
  76. package/dist/plan-persist/paths.d.ts +8 -0
  77. package/dist/plan-persist/persist.d.ts +10 -0
  78. package/dist/plan-persist/readback.d.ts +17 -0
  79. package/dist/plan-persist/types.d.ts +91 -0
  80. package/dist/plan-persist-cli.d.ts +3 -0
  81. package/dist/plan-progress-daemon-sync.d.ts +7 -0
  82. package/dist/plan-progress-sync.d.ts +21 -0
  83. package/dist/plan-progress.d.ts +10 -0
  84. package/dist/pr-handoff/index.d.ts +4 -0
  85. package/dist/pr-handoff/pr-handoff-assess.d.ts +26 -0
  86. package/dist/pr-handoff/pr-handoff-gh.d.ts +44 -0
  87. package/dist/pr-handoff/pr-handoff.d.ts +8 -0
  88. package/dist/pr-handoff/pr-handoff.types.d.ts +45 -0
  89. package/dist/prompt.d.ts +14 -0
  90. package/dist/providers/claude.d.ts +4 -0
  91. package/dist/providers/cursor-windows.d.ts +7 -0
  92. package/dist/providers/cursor.d.ts +11 -0
  93. package/dist/providers/model-preflight.d.ts +31 -0
  94. package/dist/providers/registry.d.ts +4 -0
  95. package/dist/providers/types.d.ts +32 -0
  96. package/dist/redact.d.ts +1 -0
  97. package/dist/resource-gate.d.ts +53 -0
  98. package/dist/retry-limits.d.ts +8 -0
  99. package/dist/run-store.d.ts +30 -0
  100. package/dist/shell-command-outcome.d.ts +32 -0
  101. package/dist/stale-reconcile.d.ts +25 -0
  102. package/dist/status.d.ts +161 -0
  103. package/dist/stream.d.ts +20 -0
  104. package/dist/supervisor.d.ts +25 -0
  105. package/dist/sweep.d.ts +1 -0
  106. package/dist/util.d.ts +22 -0
  107. package/dist/validate.d.ts +5 -0
  108. package/dist/vercel/index.d.ts +3 -0
  109. package/dist/vercel/vercel-evidence.d.ts +48 -0
  110. package/dist/vercel/vercel-github-status.d.ts +19 -0
  111. package/dist/vercel/vercel-url.d.ts +16 -0
  112. package/dist/worker-env.d.ts +15 -0
  113. package/dist/worker-lifecycle.d.ts +28 -0
  114. package/dist/worker-ops.d.ts +20 -0
  115. package/dist/workspace-runtime-config.d.ts +8 -0
  116. package/dist/worktree.d.ts +4 -0
  117. package/package.json +8 -4
@@ -0,0 +1 @@
1
+ export declare function runCommandCenterContractCli(args: Record<string, string | boolean>): Promise<void>;
@@ -0,0 +1,10 @@
1
+ import type { HarnessWorkerRecord } from "./status.js";
2
+ export type CompletionOutcome = "acknowledged" | "skipped_already_acked" | "structural_blocker";
3
+ export interface CompletionAckFields {
4
+ completionReportedAt: string;
5
+ completionOutcome: "acknowledged" | "rejected";
6
+ completionResponse?: unknown;
7
+ }
8
+ export declare function hasCompletionAck(worker: HarnessWorkerRecord): boolean;
9
+ export declare function persistCompletionAck(worker: HarnessWorkerRecord, runId: string, fields: CompletionAckFields): void;
10
+ export declare function clearCompletionAck(worker: HarnessWorkerRecord, runId: string): void;
@@ -0,0 +1,15 @@
1
+ /** Parsed outcome from POST /harness/completion (AgentOS handleHarnessWorkerCompletion). */
2
+ export type HarnessCompletionRouteOutcome = "review_scheduled" | "review_already_scheduled" | "needs_attention" | "mirror_only" | "task_not_found" | "task_not_harness" | "skipped_terminal_task";
3
+ export interface HarnessCompletionResponseSummary {
4
+ routeOutcome: HarnessCompletionRouteOutcome | null;
5
+ /** True when the board task should have moved into review (or already was). */
6
+ taskAdvanced: boolean;
7
+ detail: string | null;
8
+ }
9
+ /**
10
+ * Classify a 2xx harness completion response. HTTP success alone is not enough:
11
+ * `needs_attention` (policy gate, dirty tree, missing artifact) still leaves the
12
+ * linked AgentTask blocked while the worker sidecar would otherwise report done.
13
+ */
14
+ export declare function summarizeHarnessCompletionResponse(parsed: unknown): HarnessCompletionResponseSummary;
15
+ export declare function completionPostSucceeded(summary: HarnessCompletionResponseSummary): boolean;
@@ -0,0 +1,61 @@
1
+ export interface KynverUserConfig {
2
+ apiBaseUrl?: string;
3
+ agentOsSlug?: string;
4
+ agentOsId?: string;
5
+ defaultRepo?: string;
6
+ workerProvider?: string;
7
+ /** Default Claude model when dispatch does not infer or pass `--model`. */
8
+ defaultModel?: string;
9
+ harnessRoot?: string;
10
+ /** Max concurrent workers on this machine. Omit to auto-size from RAM. */
11
+ maxConcurrentWorkers?: number;
12
+ /** @internal Advanced tuning — not required for setup. */
13
+ perWorkerMemBytes?: number;
14
+ /** @internal Advanced tuning — not required for setup. */
15
+ memReserveBytes?: number;
16
+ /** @internal Advanced tuning — not required for setup. */
17
+ memUtilization?: number;
18
+ }
19
+ export declare function loadUserConfig(): KynverUserConfig;
20
+ export declare function saveUserConfig(config: KynverUserConfig): void;
21
+ /** Persist path fields with `~` instead of absolute home directories. */
22
+ export declare function normalizeConfigPaths(config: KynverUserConfig): KynverUserConfig;
23
+ /** Values for setup output (never emit `/home/<user>/…`). */
24
+ export declare function presentUserConfig(config: KynverUserConfig): KynverUserConfig;
25
+ export declare function loadApiKey(): string | undefined;
26
+ export declare function saveApiKey(apiKey: string): void;
27
+ export declare function loadRunnerToken(agentOsId?: string): string | undefined;
28
+ export declare function saveRunnerToken(agentOsId: string, token: string): void;
29
+ export declare function resolveBaseUrl(argsBaseUrl?: string): string;
30
+ export declare function resolveCallbackSecret(argsSecret?: string, agentOsId?: string): string;
31
+ export declare function resolveCallbackSecretWithMint(argsSecret?: string, agentOsId?: string, opts?: {
32
+ baseUrl?: string;
33
+ }): Promise<string>;
34
+ /**
35
+ * Force-mint a fresh scoped runner token for `agentOsId`, bypassing any cached
36
+ * or env token. Recovery path for a callback that 401s because the configured
37
+ * token is revoked, expired, or scoped to a *different* workspace (the
38
+ * self-linked repair case). Requires an API key + base URL to mint; returns
39
+ * `null` when a fresh token cannot be obtained, so the caller degrades to a
40
+ * structural blocker instead of papering the worker over as done.
41
+ */
42
+ export declare function refreshRunnerToken(agentOsId: string, opts?: {
43
+ baseUrl?: string;
44
+ }): Promise<string | null>;
45
+ export declare function refreshRunnerTokenForAuthFailure(rejectedSecret: string, agentOsId: string, opts?: {
46
+ baseUrl?: string;
47
+ }): Promise<{
48
+ ok: true;
49
+ token: string;
50
+ } | {
51
+ ok: false;
52
+ reason: string;
53
+ }>;
54
+ export declare function fetchRunnerCredential(agentOsId: string, opts?: {
55
+ baseUrl?: string;
56
+ apiKey?: string;
57
+ }): Promise<string>;
58
+ export declare function mintRunnerCredential(args: Record<string, string | boolean>): Promise<void>;
59
+ export declare function parseArgs(argv: string[]): Record<string, string | boolean>;
60
+ export declare function runSetup(args: Record<string, string | boolean>): Promise<void>;
61
+ export declare function runLogin(args: Record<string, string | boolean>): Promise<void>;
@@ -0,0 +1,5 @@
1
+ export declare function runDaemon(args: Record<string, string | boolean>): Promise<void>;
2
+ export { runPipelineTick } from "./pipeline-tick.js";
3
+ export { dispatchRun } from "./dispatch.js";
4
+ export { sweepRun } from "./sweep.js";
5
+ export { completeWorker } from "./worker-ops.js";
@@ -0,0 +1,9 @@
1
+ import type { DispatchNextDiskGateShape } from "./callbacks.js";
2
+ export interface ObserveDiskGateInput {
3
+ diskPath?: string;
4
+ diskFreeWarnBytes?: number;
5
+ diskFreeCriticalBytes?: number;
6
+ diskMaxUsedPercent?: number;
7
+ diskHardMaxUsedPercent?: number;
8
+ }
9
+ export declare function observeRunnerDiskGate(input?: ObserveDiskGateInput): DispatchNextDiskGateShape;
@@ -0,0 +1,16 @@
1
+ import { runDirectory } from "./run-store.js";
2
+ import type { InstructionPolicyEvidenceSnapshot, PersonaContextEvidenceSnapshot } from "./status.js";
3
+ export declare const DEFAULT_DISPATCH_LEASE_MS: number;
4
+ export interface HarnessWorkerDispatchContext {
5
+ instructionPolicyMarkdown: string | null;
6
+ instructionPolicyFingerprint: string | null;
7
+ instructionPolicyEvidence: InstructionPolicyEvidenceSnapshot | null;
8
+ personaMarkdown: string | null;
9
+ personaSlug: string | null;
10
+ personaEvidence: PersonaContextEvidenceSnapshot | null;
11
+ personaInjectionReady: boolean;
12
+ }
13
+ export declare function readHarnessWorkerContext(decision: Record<string, unknown>): HarnessWorkerDispatchContext | null;
14
+ export declare function buildDispatchTaskText(task: Record<string, unknown>, agentOsId: string): string;
15
+ export declare function dispatchRun(args: Record<string, string | boolean>): Promise<Record<string, unknown> | void>;
16
+ export { runDirectory };
@@ -0,0 +1,25 @@
1
+ export type DoctorCheckStatus = "pass" | "warn" | "fail";
2
+ export interface DoctorCheck {
3
+ id: string;
4
+ label: string;
5
+ status: DoctorCheckStatus;
6
+ summary: string;
7
+ remediation?: string;
8
+ details?: Record<string, unknown>;
9
+ }
10
+ export interface DoctorSection {
11
+ id: string;
12
+ label: string;
13
+ checks: DoctorCheck[];
14
+ }
15
+ export interface RuntimeTakeoverDoctorReport {
16
+ command: "doctor runtime-takeover";
17
+ ready: boolean;
18
+ summary: string;
19
+ counts: {
20
+ pass: number;
21
+ warn: number;
22
+ fail: number;
23
+ };
24
+ sections: DoctorSection[];
25
+ }
@@ -0,0 +1,4 @@
1
+ export type { DoctorCheck, DoctorCheckStatus, DoctorSection, RuntimeTakeoverDoctorReport, } from "./doctor.types.js";
2
+ export { assessRuntimeTakeoverReadiness, } from "./runtime-takeover.js";
3
+ export { defaultRuntimeTakeoverProbes, type CommandProbeResult, type RuntimeTakeoverProbes, } from "./runtime-takeover.probes.js";
4
+ export { runRuntimeTakeoverDoctorCli } from "./runtime-takeover-cli.js";
@@ -0,0 +1 @@
1
+ export declare function runRuntimeTakeoverDoctorCli(): void;
@@ -0,0 +1,3 @@
1
+ import type { RuntimeTakeoverDoctorReport } from "./doctor.types.js";
2
+ import { type RuntimeTakeoverProbes } from "./runtime-takeover.probes.js";
3
+ export declare function assessRuntimeTakeoverReadiness(probes?: RuntimeTakeoverProbes): RuntimeTakeoverDoctorReport;
@@ -0,0 +1,37 @@
1
+ import { type KynverUserConfig } from "../config.js";
2
+ export interface CommandProbeResult {
3
+ ok: boolean;
4
+ stdout: string;
5
+ stderr: string;
6
+ error?: string;
7
+ }
8
+ export interface RuntimeTakeoverProbes {
9
+ packageVersion(): string;
10
+ commandOnPath(bin: string): CommandProbeResult;
11
+ kynverVersion(bin: string): CommandProbeResult;
12
+ loadConfig(): KynverUserConfig;
13
+ configFilePath(): string;
14
+ credentialsFilePath(): string;
15
+ readCredentials(): {
16
+ hasApiKey: boolean;
17
+ runnerTokenPrefix?: string;
18
+ runnerTokenAgentOsId?: string;
19
+ };
20
+ envSnapshot(): {
21
+ kynverApiUrl?: string;
22
+ openclawCronFireBaseUrl?: string;
23
+ kynverRunnerTokenPrefix?: string;
24
+ kynverRuntimeSecret: boolean;
25
+ openclawCronSecret: boolean;
26
+ kynverHarnessRoot?: string;
27
+ opusHarnessRoot?: string;
28
+ kynverSchedulerProvider?: string;
29
+ };
30
+ harnessRoot(): string;
31
+ legacyOpenclawHarnessRoot(): string;
32
+ pathExists(target: string): boolean;
33
+ pathWritable(target: string): boolean;
34
+ vercelVersion(): CommandProbeResult;
35
+ vercelWhoami(): CommandProbeResult;
36
+ }
37
+ export declare const defaultRuntimeTakeoverProbes: RuntimeTakeoverProbes;
@@ -0,0 +1,12 @@
1
+ export interface ExitClassification {
2
+ /** True when the failure is a structural blocker an operator must fix. */
3
+ blocked: boolean;
4
+ /** Precise, human-readable reason for the blocker. */
5
+ reason: string;
6
+ }
7
+ /**
8
+ * Classify a dead worker's error/stderr output. Returns a structured blocker when
9
+ * the text matches a known startup/config failure, or null when it does not (the
10
+ * caller should fall back to the generic needs_attention path).
11
+ */
12
+ export declare function classifyExitFailure(errorText: string | null | undefined): ExitClassification | null;
@@ -0,0 +1,22 @@
1
+ import type { GitAncestry } from "./git.js";
2
+ export type ExitedSalvageKind = "none" | "uncommitted" | "committed_ahead" | "both";
3
+ export interface ExitedSalvageAssessment {
4
+ kind: ExitedSalvageKind;
5
+ /** True when the worktree has reviewable uncommitted and/or committed-ahead work. */
6
+ salvageable: boolean;
7
+ uncommittedCount: number;
8
+ headCommit: string | null;
9
+ /** Board / attention reason — stable prefix for downstream parsers. */
10
+ attentionReason: string;
11
+ }
12
+ /**
13
+ * Classify a dead worker with no `finalResult`. Returns null when the worker is
14
+ * still alive or already recorded a final result.
15
+ */
16
+ export declare function assessExitedWorkerSalvage(input: {
17
+ alive: boolean;
18
+ finalResult: unknown;
19
+ changedFiles?: string[];
20
+ gitAncestry?: GitAncestry | null;
21
+ headCommit?: string | null;
22
+ }): ExitedSalvageAssessment | null;
@@ -0,0 +1,16 @@
1
+ export interface RunFinalizeResult {
2
+ runId: string;
3
+ from: string;
4
+ to: string;
5
+ }
6
+ /**
7
+ * Finalize runs that are still marked active but have no live workers.
8
+ *
9
+ * The harness creates one run per task and never closed them out, leaving dozens
10
+ * of "running" runs that bloated disk and broke operator views (and made cleanup
11
+ * unsafe to reason about). Active-worker accounting already excludes dead workers,
12
+ * so this is about run-status hygiene + enabling safe pruning of finished runs.
13
+ *
14
+ * Returns the runs whose status changed.
15
+ */
16
+ export declare function finalizeStaleRuns(): RunFinalizeResult[];
@@ -0,0 +1,5 @@
1
+ /** Parse dispatch-next skip decisions for Security Fortress engagement gates. */
2
+ export declare function isEngagementRequiredSkip(skip: {
3
+ skipReason?: string;
4
+ reason?: string;
5
+ }): boolean;
package/dist/git.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ export interface GitOptions {
2
+ allowFailure?: boolean;
3
+ throwError?: boolean;
4
+ }
5
+ export declare function git(cwd: string, args: string[], options?: GitOptions): string;
6
+ export declare function ensureGitRepo(repo: string): void;
7
+ export declare function gitStatusShort(worktreePath: string): string[];
8
+ export interface GitCaptureResult {
9
+ status: number | null;
10
+ stdout: string;
11
+ stderr: string;
12
+ error: string | null;
13
+ }
14
+ export declare function gitCapture(cwd: string, args: string[]): GitCaptureResult;
15
+ export declare function gitIsAncestor(cwd: string, ancestor: string, descendant: string): {
16
+ isAncestor: boolean | null;
17
+ error: string | null;
18
+ };
19
+ export type GitAncestryRelation = "synced" | "merged" | "ahead" | "diverged" | "unknown";
20
+ export interface GitAncestry {
21
+ checked: boolean;
22
+ base: string;
23
+ head: string | null;
24
+ baseHead: string | null;
25
+ baseIsAncestorOfHead: boolean | null;
26
+ headIsAncestorOfBase: boolean | null;
27
+ relation: GitAncestryRelation;
28
+ error?: string;
29
+ }
30
+ export interface GitAncestryOptions {
31
+ /** Branch or ref name (e.g. origin/main). Used when baseCommit is unset. */
32
+ base?: string;
33
+ /** Pinned SHA the worktree was created from — preferred over a moving branch ref. */
34
+ baseCommit?: string;
35
+ }
36
+ export declare function computeGitAncestry(worktreePath: string, baseOrOptions?: string | GitAncestryOptions): GitAncestry;
37
+ export { scrubClaudeEnv, scrubWorkerEnv } from "./worker-env.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Parse `owner/repo` from a git remote URL (HTTPS or git@github.com:…).
3
+ * Uses URL pathname parsing so repo names are not truncated at dots (e.g. Kynver).
4
+ */
5
+ export declare function parseGithubOwnerRepo(remoteUrl: string): string | null;
@@ -0,0 +1 @@
1
+ export declare function runHarnessVerifyCli(args: Record<string, string | boolean>): void;
@@ -0,0 +1,19 @@
1
+ import { type BoundedBuildExecResult } from "./bounded-build/index.js";
2
+ /** Default expensive checks for harness / plan runtime verification. */
3
+ export declare const DEFAULT_HARNESS_VERIFY_COMMANDS: readonly ["npm run typecheck", "npm run test"];
4
+ export interface HarnessVerifyStep {
5
+ command: string;
6
+ result: BoundedBuildExecResult;
7
+ }
8
+ export interface HarnessVerifySummary {
9
+ passed: boolean;
10
+ steps: HarnessVerifyStep[];
11
+ }
12
+ /**
13
+ * Run plan/harness verification commands with memory-bounded subprocess execution.
14
+ * Parallel worktrees remain allowed — each call admits by MemAvailable at start.
15
+ */
16
+ export declare function runHarnessVerifyCommands(cwd: string, commands?: readonly string[], opts?: {
17
+ waitForAdmissionMs?: number;
18
+ timeoutMs?: number;
19
+ }): HarnessVerifySummary;
@@ -0,0 +1,22 @@
1
+ export interface ParsedHeartbeat {
2
+ heartbeatCount: number;
3
+ lastHeartbeatAt: string | null;
4
+ lastHeartbeatPhase: string | null;
5
+ lastHeartbeatSummary: string | null;
6
+ heartbeatBlocker: string | null;
7
+ timestampAnomalies: ParsedHeartbeatTimestampAnomaly[];
8
+ }
9
+ export interface ParsedHeartbeatTimestampAnomaly {
10
+ kind: "future_heartbeat_timestamp";
11
+ observedAt: string;
12
+ clampedTo: string;
13
+ }
14
+ /** Worker contract: append `phase: "complete"` when productively finished. */
15
+ export declare function isTerminalHeartbeatPhase(phase: string | null | undefined): boolean;
16
+ /**
17
+ * When stdout has no stream-json `result` yet (common for Cursor workers mid-exit),
18
+ * treat the worker's completion heartbeat as a synthetic final result so lifecycle
19
+ * sync, completion replay, and resource gates advance.
20
+ */
21
+ export declare function terminalFinalResultFromHeartbeat(heartbeat: ParsedHeartbeat): string | null;
22
+ export declare function parseHeartbeat(file: string): ParsedHeartbeat;
@@ -0,0 +1,33 @@
1
+ export { PACKAGE_VERSION } from "./package-version.js";
2
+ export { buildDispatchTaskText, dispatchRun, DEFAULT_DISPATCH_LEASE_MS } from "./dispatch.js";
3
+ export { observeRunnerDiskGate } from "./disk-gate.js";
4
+ export { postJson, type DispatchNextDiskGateShape } from "./callbacks.js";
5
+ export { parseClaudeStream, parseHarnessStream, summarizeEvent, summarizeShellToolCallEvent, } from "./stream.js";
6
+ export { classifyNpmAuditOutcome, classifyShellCommandOutcome, summarizeNpmAuditReport, type NpmAuditSummary, type ShellCommandOutcome, type ShellCommandOutcomeKind, } from "./shell-command-outcome.js";
7
+ export { parseHeartbeat, isTerminalHeartbeatPhase, terminalFinalResultFromHeartbeat, } from "./heartbeat.js";
8
+ export { computeWorkerStatus, computeAttention, isFinishedWorkerStatus, isLandingBlockedWorkerStatus, deriveRunStatus, type RawHarnessWorkerStatus, type HarnessWorkerRecord, type WorkerAttention, } from "./status.js";
9
+ export { assessWorkerLanding, type WorkerLandingVerdict } from "./landing-gate.js";
10
+ export { isEngagementRequiredSkip } from "./fortress-engagement-gate.js";
11
+ export { assessWorkerLandingContract, landingContractAttentionReason, type WorkerLandingContract, type WorkerLandingContractVerdict, type TargetPrReconciliation, } from "./landing-contract-gate.js";
12
+ export { assessExitedWorkerSalvage, type ExitedSalvageAssessment, type ExitedSalvageKind, } from "./exited-salvage.js";
13
+ export { buildPrompt } from "./prompt.js";
14
+ export { assessPrHandoffRequirement, ensurePrReadyHandoff, extractPrUrlFromText, } from "./pr-handoff/index.js";
15
+ export { normalizeCursorModelAlias, preflightCursorModel } from "./providers/model-preflight.js";
16
+ export { redactHarness } from "./redact.js";
17
+ export { scrubWorkerEnv, scrubClaudeEnv, auditWorkerEnv, listForbiddenWorkerEnvKeys, isForbiddenWorkerEnvKey, FORBIDDEN_WORKER_ENV_KEYS, type WorkerEnvAudit, } from "./worker-env.js";
18
+ export { validateRunId, validateWorkerName, validateRepo, validateOwnedPaths, validateTailLines, } from "./validate.js";
19
+ export { spawnWorkerProcess, startWorker } from "./supervisor.js";
20
+ export { createRun, listRuns } from "./worktree.js";
21
+ export { sweepRun } from "./sweep.js";
22
+ export { completeWorker, runStatus, workerStatus, tailWorker, stopWorker } from "./worker-ops.js";
23
+ export { autoCompleteWorker, autoCompleteWorkerCli, spawnCompletionSidecar, type AutoCompleteArgs, type AutoCompleteOutcome, type SpawnSidecarOptions, type SpawnedSidecar, } from "./auto-complete.js";
24
+ export { loadUserConfig, saveUserConfig, resolveBaseUrl, resolveCallbackSecret, resolveCallbackSecretWithMint, parseArgs, } from "./config.js";
25
+ export { getHarnessPaths, resolveHarnessRoot } from "./paths.js";
26
+ export { usage, main } from "./cli.js";
27
+ export { reconcileRunsCli, reconcileStaleWorkers, type ReconcileStaleWorkersResult, type StaleWorkerReconcileOutcome } from "./stale-reconcile.js";
28
+ export { runDaemon } from "./daemon.js";
29
+ export { runHarnessVerifyCommands, DEFAULT_HARNESS_VERIFY_COMMANDS, type HarnessVerifySummary, type HarnessVerifyStep, } from "./harness-verify.js";
30
+ export { runBoundedBuildCheck, assessBuildAdmission, mergeNodeOptionsForBuildCheck, buildSystemdRunArgv, isSystemdRunAvailable, readMemAvailableBytes, type BoundedBuildExecResult, type BuildAdmissionVerdict, } from "./bounded-build/index.js";
31
+ export { assessAutoCompleteEligibility, classifyWorkerHealth, getMonitorStatus, listMonitors, runMonitorTick, spawnMonitorSidecar, type AutoCompleteAssessment, type MonitorTickResult, type TaskLeaseSnapshot, type WorkerHealthClass, type WorkerMonitorView, } from "./monitor/index.js";
32
+ export { persistPlan, drainPlanOutbox, listOutboxItems, formatPlanOutboxHandoffBlock, extractPlanOutboxFromTask, hashPlanBody, type PersistPlanInput, type PersistPlanResult, type PlanPersistUserStatus, } from "./plan-persist/index.js";
33
+ export { classifyVercelUrl, collectVercelEvidence, evidenceFromGitHubVercelStatus, isDashboardVercelUrl, isVercelStatusContext, pickVercelStatusContext, resolveVercelInspectTarget, type CollectVercelEvidenceInput, type GitHubCommitStatusRow, type VercelEvidenceResult, type VercelEvidenceStatus, } from "./vercel/index.js";