@sentropic/h2a-runtime 0.81.0

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 (253) hide show
  1. package/dist/account-pool.d.ts +168 -0
  2. package/dist/account-pool.d.ts.map +1 -0
  3. package/dist/account-pool.js +385 -0
  4. package/dist/account-pool.js.map +1 -0
  5. package/dist/agents-projection.d.ts +56 -0
  6. package/dist/agents-projection.d.ts.map +1 -0
  7. package/dist/agents-projection.js +82 -0
  8. package/dist/agents-projection.js.map +1 -0
  9. package/dist/attach.d.ts +75 -0
  10. package/dist/attach.d.ts.map +1 -0
  11. package/dist/attach.js +432 -0
  12. package/dist/attach.js.map +1 -0
  13. package/dist/auth-bundle.d.ts +21 -0
  14. package/dist/auth-bundle.d.ts.map +1 -0
  15. package/dist/auth-bundle.js +112 -0
  16. package/dist/auth-bundle.js.map +1 -0
  17. package/dist/auth-diagnostics.d.ts +18 -0
  18. package/dist/auth-diagnostics.d.ts.map +1 -0
  19. package/dist/auth-diagnostics.js +23 -0
  20. package/dist/auth-diagnostics.js.map +1 -0
  21. package/dist/auth-login.d.ts +9 -0
  22. package/dist/auth-login.d.ts.map +1 -0
  23. package/dist/auth-login.js +21 -0
  24. package/dist/auth-login.js.map +1 -0
  25. package/dist/auth-refresh.d.ts +32 -0
  26. package/dist/auth-refresh.d.ts.map +1 -0
  27. package/dist/auth-refresh.js +83 -0
  28. package/dist/auth-refresh.js.map +1 -0
  29. package/dist/auth-tools.d.ts +55 -0
  30. package/dist/auth-tools.d.ts.map +1 -0
  31. package/dist/auth-tools.js +163 -0
  32. package/dist/auth-tools.js.map +1 -0
  33. package/dist/browser-bridge-local.d.ts +27 -0
  34. package/dist/browser-bridge-local.d.ts.map +1 -0
  35. package/dist/browser-bridge-local.js +51 -0
  36. package/dist/browser-bridge-local.js.map +1 -0
  37. package/dist/browser.d.ts +53 -0
  38. package/dist/browser.d.ts.map +1 -0
  39. package/dist/browser.js +61 -0
  40. package/dist/browser.js.map +1 -0
  41. package/dist/conductor-launch.d.ts +179 -0
  42. package/dist/conductor-launch.d.ts.map +1 -0
  43. package/dist/conductor-launch.js +414 -0
  44. package/dist/conductor-launch.js.map +1 -0
  45. package/dist/config.d.ts +182 -0
  46. package/dist/config.d.ts.map +1 -0
  47. package/dist/config.js +334 -0
  48. package/dist/config.js.map +1 -0
  49. package/dist/conv-guard.d.ts +76 -0
  50. package/dist/conv-guard.d.ts.map +1 -0
  51. package/dist/conv-guard.js +131 -0
  52. package/dist/conv-guard.js.map +1 -0
  53. package/dist/convsync.d.ts +24 -0
  54. package/dist/convsync.d.ts.map +1 -0
  55. package/dist/convsync.js +108 -0
  56. package/dist/convsync.js.map +1 -0
  57. package/dist/cred-health.d.ts +96 -0
  58. package/dist/cred-health.d.ts.map +1 -0
  59. package/dist/cred-health.js +170 -0
  60. package/dist/cred-health.js.map +1 -0
  61. package/dist/delegate.d.ts +406 -0
  62. package/dist/delegate.d.ts.map +1 -0
  63. package/dist/delegate.js +739 -0
  64. package/dist/delegate.js.map +1 -0
  65. package/dist/enroll.d.ts +91 -0
  66. package/dist/enroll.d.ts.map +1 -0
  67. package/dist/enroll.js +248 -0
  68. package/dist/enroll.js.map +1 -0
  69. package/dist/fanout.d.ts +63 -0
  70. package/dist/fanout.d.ts.map +1 -0
  71. package/dist/fanout.js +115 -0
  72. package/dist/fanout.js.map +1 -0
  73. package/dist/forward.d.ts +66 -0
  74. package/dist/forward.d.ts.map +1 -0
  75. package/dist/forward.js +141 -0
  76. package/dist/forward.js.map +1 -0
  77. package/dist/gitdiff.d.ts +31 -0
  78. package/dist/gitdiff.d.ts.map +1 -0
  79. package/dist/gitdiff.js +133 -0
  80. package/dist/gitdiff.js.map +1 -0
  81. package/dist/h2a-bridge.d.ts +102 -0
  82. package/dist/h2a-bridge.d.ts.map +1 -0
  83. package/dist/h2a-bridge.js +333 -0
  84. package/dist/h2a-bridge.js.map +1 -0
  85. package/dist/h2a-jobs.d.ts +235 -0
  86. package/dist/h2a-jobs.d.ts.map +1 -0
  87. package/dist/h2a-jobs.js +388 -0
  88. package/dist/h2a-jobs.js.map +1 -0
  89. package/dist/h2a-ping.d.ts +38 -0
  90. package/dist/h2a-ping.d.ts.map +1 -0
  91. package/dist/h2a-ping.js +58 -0
  92. package/dist/h2a-ping.js.map +1 -0
  93. package/dist/index.d.ts +98 -0
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/index.js +5887 -0
  96. package/dist/index.js.map +1 -0
  97. package/dist/interactive-throttle.d.ts +164 -0
  98. package/dist/interactive-throttle.d.ts.map +1 -0
  99. package/dist/interactive-throttle.js +194 -0
  100. package/dist/interactive-throttle.js.map +1 -0
  101. package/dist/lineage-client.d.ts +77 -0
  102. package/dist/lineage-client.d.ts.map +1 -0
  103. package/dist/lineage-client.js +117 -0
  104. package/dist/lineage-client.js.map +1 -0
  105. package/dist/lineage-lease.d.ts +152 -0
  106. package/dist/lineage-lease.d.ts.map +1 -0
  107. package/dist/lineage-lease.js +303 -0
  108. package/dist/lineage-lease.js.map +1 -0
  109. package/dist/llm-gateway-runtime/accounts.d.ts +48 -0
  110. package/dist/llm-gateway-runtime/accounts.d.ts.map +1 -0
  111. package/dist/llm-gateway-runtime/accounts.js +226 -0
  112. package/dist/llm-gateway-runtime/accounts.js.map +1 -0
  113. package/dist/llm-gateway-runtime/index.d.ts +4 -0
  114. package/dist/llm-gateway-runtime/index.d.ts.map +1 -0
  115. package/dist/llm-gateway-runtime/index.js +58 -0
  116. package/dist/llm-gateway-runtime/index.js.map +1 -0
  117. package/dist/llm-gateway-runtime/model-catalog.d.ts +36 -0
  118. package/dist/llm-gateway-runtime/model-catalog.d.ts.map +1 -0
  119. package/dist/llm-gateway-runtime/model-catalog.js +146 -0
  120. package/dist/llm-gateway-runtime/model-catalog.js.map +1 -0
  121. package/dist/llm-gateway-runtime/proxy-anthropic.d.ts +3 -0
  122. package/dist/llm-gateway-runtime/proxy-anthropic.d.ts.map +1 -0
  123. package/dist/llm-gateway-runtime/proxy-anthropic.js +139 -0
  124. package/dist/llm-gateway-runtime/proxy-anthropic.js.map +1 -0
  125. package/dist/llm-gateway-runtime/proxy-openai.d.ts +117 -0
  126. package/dist/llm-gateway-runtime/proxy-openai.d.ts.map +1 -0
  127. package/dist/llm-gateway-runtime/proxy-openai.js +1132 -0
  128. package/dist/llm-gateway-runtime/proxy-openai.js.map +1 -0
  129. package/dist/llm-gateway-runtime/session-ledger.d.ts +32 -0
  130. package/dist/llm-gateway-runtime/session-ledger.d.ts.map +1 -0
  131. package/dist/llm-gateway-runtime/session-ledger.js +62 -0
  132. package/dist/llm-gateway-runtime/session-ledger.js.map +1 -0
  133. package/dist/llm-gateway-runtime/sticky.d.ts +40 -0
  134. package/dist/llm-gateway-runtime/sticky.d.ts.map +1 -0
  135. package/dist/llm-gateway-runtime/sticky.js +254 -0
  136. package/dist/llm-gateway-runtime/sticky.js.map +1 -0
  137. package/dist/llm-mesh.d.ts +102 -0
  138. package/dist/llm-mesh.d.ts.map +1 -0
  139. package/dist/llm-mesh.js +433 -0
  140. package/dist/llm-mesh.js.map +1 -0
  141. package/dist/migrate-candidates.d.ts +35 -0
  142. package/dist/migrate-candidates.d.ts.map +1 -0
  143. package/dist/migrate-candidates.js +128 -0
  144. package/dist/migrate-candidates.js.map +1 -0
  145. package/dist/migrate.d.ts +125 -0
  146. package/dist/migrate.d.ts.map +1 -0
  147. package/dist/migrate.js +561 -0
  148. package/dist/migrate.js.map +1 -0
  149. package/dist/plugin-manifest.d.ts +143 -0
  150. package/dist/plugin-manifest.d.ts.map +1 -0
  151. package/dist/plugin-manifest.js +233 -0
  152. package/dist/plugin-manifest.js.map +1 -0
  153. package/dist/plugin.d.ts +274 -0
  154. package/dist/plugin.d.ts.map +1 -0
  155. package/dist/plugin.js +919 -0
  156. package/dist/plugin.js.map +1 -0
  157. package/dist/pod-liveness.d.ts +51 -0
  158. package/dist/pod-liveness.d.ts.map +1 -0
  159. package/dist/pod-liveness.js +80 -0
  160. package/dist/pod-liveness.js.map +1 -0
  161. package/dist/profile-menu.d.ts +7 -0
  162. package/dist/profile-menu.d.ts.map +1 -0
  163. package/dist/profile-menu.js +52 -0
  164. package/dist/profile-menu.js.map +1 -0
  165. package/dist/profiles.d.ts +23 -0
  166. package/dist/profiles.d.ts.map +1 -0
  167. package/dist/profiles.js +66 -0
  168. package/dist/profiles.js.map +1 -0
  169. package/dist/protocol-local.d.ts +27 -0
  170. package/dist/protocol-local.d.ts.map +1 -0
  171. package/dist/protocol-local.js +12 -0
  172. package/dist/protocol-local.js.map +1 -0
  173. package/dist/pty.d.ts +26 -0
  174. package/dist/pty.d.ts.map +1 -0
  175. package/dist/pty.js +45 -0
  176. package/dist/pty.js.map +1 -0
  177. package/dist/readiness.d.ts +38 -0
  178. package/dist/readiness.d.ts.map +1 -0
  179. package/dist/readiness.js +169 -0
  180. package/dist/readiness.js.map +1 -0
  181. package/dist/registry.d.ts +258 -0
  182. package/dist/registry.d.ts.map +1 -0
  183. package/dist/registry.js +570 -0
  184. package/dist/registry.js.map +1 -0
  185. package/dist/relaunch.d.ts +52 -0
  186. package/dist/relaunch.d.ts.map +1 -0
  187. package/dist/relaunch.js +76 -0
  188. package/dist/relaunch.js.map +1 -0
  189. package/dist/restore.d.ts +165 -0
  190. package/dist/restore.d.ts.map +1 -0
  191. package/dist/restore.js +530 -0
  192. package/dist/restore.js.map +1 -0
  193. package/dist/run.d.ts +29 -0
  194. package/dist/run.d.ts.map +1 -0
  195. package/dist/run.js +206 -0
  196. package/dist/run.js.map +1 -0
  197. package/dist/secrets.d.ts +25 -0
  198. package/dist/secrets.d.ts.map +1 -0
  199. package/dist/secrets.js +98 -0
  200. package/dist/secrets.js.map +1 -0
  201. package/dist/session-restore.d.ts +26 -0
  202. package/dist/session-restore.d.ts.map +1 -0
  203. package/dist/session-restore.js +122 -0
  204. package/dist/session-restore.js.map +1 -0
  205. package/dist/skills-sync.d.ts +126 -0
  206. package/dist/skills-sync.d.ts.map +1 -0
  207. package/dist/skills-sync.js +255 -0
  208. package/dist/skills-sync.js.map +1 -0
  209. package/dist/smoke.d.ts +23 -0
  210. package/dist/smoke.d.ts.map +1 -0
  211. package/dist/smoke.js +138 -0
  212. package/dist/smoke.js.map +1 -0
  213. package/dist/soft-refresh.d.ts +107 -0
  214. package/dist/soft-refresh.d.ts.map +1 -0
  215. package/dist/soft-refresh.js +426 -0
  216. package/dist/soft-refresh.js.map +1 -0
  217. package/dist/sync-status.d.ts +22 -0
  218. package/dist/sync-status.d.ts.map +1 -0
  219. package/dist/sync-status.js +41 -0
  220. package/dist/sync-status.js.map +1 -0
  221. package/dist/sync.d.ts +77 -0
  222. package/dist/sync.d.ts.map +1 -0
  223. package/dist/sync.js +302 -0
  224. package/dist/sync.js.map +1 -0
  225. package/dist/throttle-signatures.d.ts +43 -0
  226. package/dist/throttle-signatures.d.ts.map +1 -0
  227. package/dist/throttle-signatures.js +116 -0
  228. package/dist/throttle-signatures.js.map +1 -0
  229. package/dist/tmux.d.ts +286 -0
  230. package/dist/tmux.d.ts.map +1 -0
  231. package/dist/tmux.js +970 -0
  232. package/dist/tmux.js.map +1 -0
  233. package/dist/tunnel.d.ts +25 -0
  234. package/dist/tunnel.d.ts.map +1 -0
  235. package/dist/tunnel.js +127 -0
  236. package/dist/tunnel.js.map +1 -0
  237. package/dist/workspace-merge.d.ts +17 -0
  238. package/dist/workspace-merge.d.ts.map +1 -0
  239. package/dist/workspace-merge.js +153 -0
  240. package/dist/workspace-merge.js.map +1 -0
  241. package/dist/workspace-sync-incremental.d.ts +64 -0
  242. package/dist/workspace-sync-incremental.d.ts.map +1 -0
  243. package/dist/workspace-sync-incremental.js +199 -0
  244. package/dist/workspace-sync-incremental.js.map +1 -0
  245. package/dist/workspace-sync.d.ts +3 -0
  246. package/dist/workspace-sync.d.ts.map +1 -0
  247. package/dist/workspace-sync.js +187 -0
  248. package/dist/workspace-sync.js.map +1 -0
  249. package/dist/workspace.d.ts +70 -0
  250. package/dist/workspace.d.ts.map +1 -0
  251. package/dist/workspace.js +173 -0
  252. package/dist/workspace.js.map +1 -0
  253. package/package.json +44 -0
@@ -0,0 +1,406 @@
1
+ /**
2
+ * `remote delegate <type> "<task>"` — P1 of cross-type agent delegation.
3
+ *
4
+ * Spawns a LIVE, INTERACTIVE agent (claude / codex / agy) in a DETACHED tmux
5
+ * session, PRIMED with the task, with the h2a MCP server in a side window (the
6
+ * existing `remote run --h2a` path) so the parent/master feedback loop works.
7
+ * Returns a job id (slug). The job is enrolled in the SAME registry as sessions
8
+ * with `role: "job"` (no second jobs.json), so `listLive` + the liveness guards
9
+ * + the atomic write are reused as-is.
10
+ *
11
+ * Isolation: by default, if the cwd is a git repo, each job runs in its OWN git
12
+ * worktree under `<cwd>/.remote/jobs/<jobId>/wt` — the single-writer guard only
13
+ * protects the conversation `.jsonl`, not the file tree, so concurrent jobs in
14
+ * the shared cwd would clobber each other. `--cwd` overrides; a non-repo cwd is
15
+ * used as-is.
16
+ *
17
+ * `--headless` is the run-once-exit variant (NOT drop-to-shell): it runs
18
+ * `claude -p` / `codex exec`, redirects stdout+stderr to `<dir>/output.log`,
19
+ * writes `<dir>/result.json {state,exitCode}`, then ENDS the tmux session.
20
+ *
21
+ * SECURITY: the task is passed as a SINGLE argv token — never concatenated into
22
+ * a shell string. The jobId / `--name` pass `assertSafeName` before becoming a
23
+ * tmux slug, a directory, or a filename.
24
+ */
25
+ import type { JobState, RegistryEntry, RegistryTool } from "./registry.js";
26
+ export type DelegateType = RegistryTool;
27
+ export declare function assertSafeName(name: string): void;
28
+ export declare function isDelegateType(value: string): value is DelegateType;
29
+ /**
30
+ * The EXACT argv for the agent binary, by type and mode. Pure, exported for
31
+ * tests. The task is ALWAYS a single trailing token (no shell concat):
32
+ * - interactive: the agent starts live, primed with the task as a positional
33
+ * initial prompt (claude/codex/agy all accept a bare positional prompt);
34
+ * - headless: a run-once-exit print mode — claude `-p`, codex `exec`. agy has
35
+ * no confirmed headless mode (design R3), so headless agy throws.
36
+ *
37
+ * Returns `{ command, args }` where args ends with the task token.
38
+ */
39
+ export declare function buildDelegateArgs(type: DelegateType, task: string, headless: boolean, model?: string, effort?: string): {
40
+ command: string;
41
+ args: string[];
42
+ };
43
+ /** Hard cap on auto-resume attempts before a throttled job is failed `rate-limited`. */
44
+ export declare const THROTTLE_MAX_ATTEMPTS = 6;
45
+ /** Backoff base (ms) for the resume schedule. */
46
+ export declare const THROTTLE_BACKOFF_BASE_MS = 60000;
47
+ /** Backoff cap (ms) for the resume schedule. */
48
+ export declare const THROTTLE_BACKOFF_CAP_MS: number;
49
+ /**
50
+ * The EXACT argv to RESUME a throttled HEADLESS job, by type. The job continues
51
+ * its prior conversation (rather than re-running from scratch) and re-prints to
52
+ * the same log, so a fresh success settles it `done`:
53
+ * - claude: `-p --continue <task>` (print mode, continue the last conversation).
54
+ * - codex: `exec resume --last <task>` (resume the most recent rollout).
55
+ * - agy: no confirmed headless mode → throws (same as buildDelegateArgs).
56
+ *
57
+ * The task stays a single trailing token (no shell concat). Pure, exported for
58
+ * tests.
59
+ *
60
+ * TODO(phase-2, interactive): an INTERACTIVE throttled tmux job would instead be
61
+ * nudged via `send-keys` (guarded by an attached-pane check so we never type
62
+ * into a pane the user is driving). Not in this slice.
63
+ */
64
+ export declare function buildThrottleResumeArgs(type: DelegateType, task: string): {
65
+ command: string;
66
+ args: string[];
67
+ };
68
+ /**
69
+ * Full-jitter exponential backoff delay for the throttle RESUME schedule —
70
+ * copied from the session-agent's `websocket-transport.ts` `jitteredDelay`
71
+ * (same formula, kept local so this module stays pure/dependency-free).
72
+ * Returns a random value in [0, min(cap, base * 2^attempt)]. `attempt` is
73
+ * 0-based (the FIRST throttle passes attempt 0). `rand` is injectable so tests
74
+ * pin the jitter. Pure, exported for tests.
75
+ */
76
+ export declare function jitteredBackoffMs(attempt: number, baseMs?: number, capMs?: number, rand?: () => number): number;
77
+ /**
78
+ * The CEILING of the full-jitter window for a given attempt: `min(cap, base *
79
+ * 2^attempt)`. Monotonic non-decreasing in `attempt`, capped at `capMs`. The
80
+ * jittered delay is always in `[0, ceiling]`. Pure, exported so tests can assert
81
+ * the schedule is monotonic + bounded without depending on the random draw.
82
+ */
83
+ export declare function backoffCeilingMs(attempt: number, baseMs?: number, capMs?: number): number;
84
+ /** Window over which throttle events are counted for the breaker (10 min). */
85
+ export declare const AIMD_WINDOW_MS: number;
86
+ /** ≥ this many throttles in the window trips the multiplicative decrease. */
87
+ export declare const AIMD_TRIP_THRESHOLD = 2;
88
+ /**
89
+ * The effective admission cap under AIMD. Pure.
90
+ *
91
+ * - Count throttle events with `firstAt`/`at` within `[now - AIMD_WINDOW_MS, now]`.
92
+ * - If that count ≥ AIMD_TRIP_THRESHOLD → HALVE the previous effective cap
93
+ * (`Math.floor`), floored at 1 (never admit zero — a single slot keeps the
94
+ * queue making progress so the breaker can observe recovery).
95
+ * - Else (a clean pass) → ADDITIVELY restore +1, capped at `configuredCap`.
96
+ * - Always clamped to `[1, configuredCap]` (never below 1, never above the
97
+ * configured cap). A `configuredCap <= 0` returns 0 (a degenerate config
98
+ * admits nothing — mirrors planNextStarts).
99
+ *
100
+ * `lastCap` is the effective cap from the PREVIOUS pass (defaults to
101
+ * `configuredCap` on the first pass — we start fully open). `recentThrottles` is
102
+ * the list of throttle-event timestamps (ISO or ms) the conductor tracks.
103
+ */
104
+ export declare function aimdEffectiveCap(configuredCap: number, recentThrottles: ReadonlyArray<string | number>, now?: number, lastCap?: number): number;
105
+ /** The next throttle bookkeeping for a job that just (re-)threw a rate-limit. */
106
+ export type ThrottleStep = {
107
+ /** Mark/keep the job `throttled`; the conductor resumes it on `nextRetryAt`. */
108
+ action: "throttle";
109
+ attempts: number;
110
+ firstAt: string;
111
+ nextRetryAt: string;
112
+ signature?: string;
113
+ } | {
114
+ /** The attempt cap is spent → fail the job with the rate-limited reason. */
115
+ action: "fail";
116
+ reason: "rate-limited";
117
+ };
118
+ /**
119
+ * Decide what to do with a HEADLESS LOCAL job whose latest finished run was
120
+ * classified as a transient rate-limit. PURE — no clock/registry/IO; the caller
121
+ * passes `now`, the prior `throttle` bookkeeping (undefined on the first hit),
122
+ * the matched `signature`, and a `delay` (a jittered backoff in ms, computed via
123
+ * `jitteredBackoffMs`).
124
+ *
125
+ * - First/next throttle while `attempts < maxAttempts`: bump `attempts`,
126
+ * preserve `firstAt`, schedule `nextRetryAt = now + delay`.
127
+ * - When the NEXT attempt would exceed `maxAttempts` (i.e. prior attempts already
128
+ * == maxAttempts): give up → `{action:"fail", reason:"rate-limited"}`.
129
+ *
130
+ * Exported for tests.
131
+ */
132
+ export declare function planThrottleStep(opts: {
133
+ prior: {
134
+ attempts: number;
135
+ firstAt: string;
136
+ } | undefined;
137
+ nowMs: number;
138
+ delayMs: number;
139
+ signature?: string;
140
+ maxAttempts?: number;
141
+ }): ThrottleStep;
142
+ /**
143
+ * Is a `throttled` job DUE for resume right now (now >= nextRetryAt)? Pure,
144
+ * tolerant of a missing/unparseable `nextRetryAt` (treated as due — better to
145
+ * retry than to strand a job forever). Exported for tests.
146
+ */
147
+ export declare function isThrottleResumeDue(throttle: {
148
+ nextRetryAt?: string;
149
+ } | undefined, nowMs: number): boolean;
150
+ /**
151
+ * Minutes-until-retry label for a `throttled` row (`jobs ls`), e.g. "retry in
152
+ * 3m" / "retry now". Pure, exported for tests. Rounds UP so "<1 min away" still
153
+ * reads as 1m rather than 0.
154
+ */
155
+ export declare function throttleRetryLabel(throttle: {
156
+ nextRetryAt?: string;
157
+ } | undefined, nowMs?: number): string;
158
+ /**
159
+ * P2 — REMOTE delegation. Map a (type, task) to the control-plane session body
160
+ * for a delegated agent running in a Pod. The agent CLI is the session PROFILE
161
+ * (profiles claude/codex/agy launch the matching binary on the Pod), and the
162
+ * task rides the ALREADY-SAFE argv channel `startupArgs` — exactly the args that
163
+ * follow the binary, which the session-agent reads from `SESSION_STARTUP_ARGS`
164
+ * (a JSON array, never a `bash -lc` string). We reuse `buildDelegateArgs` and
165
+ * DROP its `command` (the profile already provides the binary): `args` is what
166
+ * trails it (the bare task token interactive, `-p <task>` / `exec <task>`
167
+ * headless). Pure, exported for tests.
168
+ *
169
+ * SECURITY: the task stays a single argv element through `startupArgs` → JSON →
170
+ * the agent's argv; it is NEVER concatenated into a shell string.
171
+ */
172
+ export declare function buildRemoteDelegate(type: DelegateType, task: string, headless: boolean, model?: string, effort?: string): {
173
+ profile: DelegateType;
174
+ startupArgs: string[];
175
+ };
176
+ /**
177
+ * Default concurrency cap (Hermes `max_concurrent_children`), applied to BOTH
178
+ * local AND remote jobs: the shared RWX volume is mounted RW across all nodes
179
+ * (subPath per job — no CSI packing limit, design F3 correction), so remote is
180
+ * not sequential. A new `delegate` beyond `running` jobs is enrolled `pending`.
181
+ */
182
+ export declare const DEFAULT_MAX_CONCURRENT = 16;
183
+ /** Default / min / max spawn depth (Hermes `max_spawn_depth`, clamp 1–3). */
184
+ export declare const DEFAULT_MAX_DEPTH = 1;
185
+ export declare const MIN_MAX_DEPTH = 1;
186
+ export declare const MAX_MAX_DEPTH = 3;
187
+ /** The env channel carrying the REMAINING delegation depth into a job's agent. */
188
+ export declare const DEPTH_ENV = "REMOTE_DELEGATE_DEPTH";
189
+ /**
190
+ * Env channel carrying a delegated job's id INTO its agent process (H1). The
191
+ * local-tmux spawn stamps `REMOTE_JOB_ID=<jobId>` so the claude SessionStart/End
192
+ * hooks — which only receive claude's conversation uuid (`session_id`), never the
193
+ * job slug — can resolve the job and complete it. Without this, an interactive
194
+ * tmux job never advances past `running`.
195
+ */
196
+ export declare const JOB_ID_ENV = "REMOTE_JOB_ID";
197
+ /**
198
+ * Clamp a requested `--max-depth` into [1, 3] (à la Hermes). A missing /
199
+ * non-finite value falls back to the default (1). Pure, exported for tests.
200
+ */
201
+ export declare function clampDepth(requested: number | undefined): number;
202
+ /**
203
+ * The depth a job INHERITS from its parent, read off `REMOTE_DELEGATE_DEPTH`
204
+ * (decremented at each launch). When a `delegate` runs OUTSIDE a job (no env),
205
+ * the requested `--max-depth` is the budget. When it runs INSIDE a job, the
206
+ * inherited budget wins (a job cannot grant itself more than it was given).
207
+ * Pure, exported for tests; `env` is injectable.
208
+ *
209
+ * Returns the budget the CURRENT `delegate` may spend:
210
+ * - no env (top-level): clamp(requestedMaxDepth).
211
+ * - env present: the inherited value (already a remaining budget), clamped
212
+ * to [0, 3] — 0 means "this job may not delegate further".
213
+ */
214
+ export declare function inheritedDepthBudget(requestedMaxDepth: number | undefined, env?: Record<string, string | undefined>): number;
215
+ /**
216
+ * May a `delegate` proceed given its current depth budget? A budget of 0 means
217
+ * the calling job has exhausted its delegation depth and must REFUSE. Pure.
218
+ */
219
+ export declare function canDelegateAtDepth(budget: number): boolean;
220
+ /**
221
+ * REMOTE depth clamp (YAGNI/safety): there is NO env channel carrying
222
+ * `REMOTE_DELEGATE_DEPTH` into a Pod (`createRemoteSession` only passes
223
+ * `startupArgs`, and the session-agent doesn't forward a depth budget), so a
224
+ * remote job could NOT enforce a budget even if we recorded one > 1. Until that
225
+ * channel exists we clamp a REMOTE job's recorded budget to AT MOST 1 — i.e. a
226
+ * job-in-a-Pod does not re-delegate. (Local jobs DO inherit the budget via the
227
+ * env, so they keep the full 1–3 range.) Pure, exported for tests.
228
+ */
229
+ export declare function clampRemoteDepthBudget(budget: number): number;
230
+ /**
231
+ * The depth value to PROPAGATE to a freshly launched job: the parent's budget
232
+ * minus one (never below 0), so the child knows how much further it may go.
233
+ * Returned as the string the env channel carries. Pure, exported for tests.
234
+ */
235
+ export declare function childDepthEnvValue(parentBudget: number): string;
236
+ /**
237
+ * Decide which `pending` jobs to START this pass, given the cap. Pure, the heart
238
+ * of the queue: count jobs currently occupying a slot (`running`), and admit
239
+ * `pending` jobs (oldest first — FIFO by `enrolledAt`) until `running` reaches
240
+ * the cap. Terminal jobs (done/failed) free their slot. Returns the ids to
241
+ * start, in admission order. Exported for tests.
242
+ *
243
+ * `cap <= 0` admits nothing (a degenerate config never starts work).
244
+ */
245
+ export declare function planNextStarts(jobs: ReadonlyArray<Pick<RegistryEntry, "id" | "role" | "jobState" | "enrolledAt">>, cap: number): string[];
246
+ /**
247
+ * Is there room to start a job RIGHT NOW (used by `delegate` to decide launch vs
248
+ * enqueue)? True when `running < cap`. Pure, exported for tests.
249
+ */
250
+ export declare function hasFreeSlot(jobs: ReadonlyArray<Pick<RegistryEntry, "role" | "jobState">>, cap: number): boolean;
251
+ /**
252
+ * The `track item new` argv that mirrors a delegated job as a child item under
253
+ * the workpackage `wpId`. PURE (no spawn): the caller resolves the track binary
254
+ * (realpath) and runs it best-effort. `--role item`, parented under the WP, with
255
+ * a stable title derived from the job. Exported for tests.
256
+ *
257
+ * SECURITY: jobId is assertSafeName-checked at delegate time; wpId/task ride
258
+ * structured argv (never a shell string).
259
+ */
260
+ export declare function trackItemNewArgs(wpId: string, job: {
261
+ id: string;
262
+ task?: string;
263
+ }): string[];
264
+ /**
265
+ * The `track item realize` argv to close the mirror item when a job reaches a
266
+ * terminal state. We address the item by the same `job:<id>` ref we created it
267
+ * with. PURE; the caller runs it best-effort. Exported for tests.
268
+ */
269
+ export declare function trackItemRealizeArgs(job: {
270
+ id: string;
271
+ }): string[];
272
+ export type TrackRunner = (args: ReadonlyArray<string>) => {
273
+ status: number | null;
274
+ };
275
+ /**
276
+ * Resolve the `track` binary to its REALPATH (some track versions have an
277
+ * entrypoint guard that breaks through the npm-global bin symlink — same note as
278
+ * config.ts PluginMcp). Returns `node <realpath>` argv, or undefined when track
279
+ * is not installed. Best-effort, exported for tests (the `which`+realpath are
280
+ * injectable).
281
+ */
282
+ export declare function resolveTrackBin(which?: (bin: string) => string | undefined, realpath?: (p: string) => string): {
283
+ command: string;
284
+ prefix: string[];
285
+ } | undefined;
286
+ /**
287
+ * Best-effort track-mirror call: resolve `track`, run `track <args>` in `cwd`,
288
+ * swallow ANY failure (track absent/erroring must NEVER couple delivery to
289
+ * track). Returns whether it ran. The runner is injectable for tests.
290
+ */
291
+ export declare function runTrackMirror(args: ReadonlyArray<string>, cwd: string, run?: TrackRunner): boolean;
292
+ /** Per-job directory under the ORIGIN cwd (where worktree + logs live). */
293
+ export declare function jobDir(originCwd: string, jobId: string): string;
294
+ export type JobResult = {
295
+ state: "done" | "failed";
296
+ exitCode: number;
297
+ };
298
+ /**
299
+ * The terminal result a HEADLESS job wrote to `result.json` (run-once-exit), or
300
+ * undefined when absent / unreadable. Lets supervision reconcile a finished
301
+ * headless job (whose tmux session has ended) to its REAL state instead of the
302
+ * default "session-gone → failed". Pure-ish (reads one file), injectable read.
303
+ */
304
+ export declare function readJobResult(originCwd: string, jobId: string, read?: (p: string) => string): JobResult | undefined;
305
+ export type GitProbe = (cwd: string) => boolean;
306
+ export type Runner = (cmd: string, args: ReadonlyArray<string>, cwd: string) => {
307
+ status: number | null;
308
+ };
309
+ export type ResolveCwdOpts = {
310
+ /** Explicit cwd override (`--cwd`): used as-is, no worktree. */
311
+ explicitCwd?: string;
312
+ isGitRepo?: GitProbe;
313
+ runGit?: Runner;
314
+ mkdir?: (p: string) => void;
315
+ };
316
+ export type ResolvedCwd = {
317
+ /** The directory the agent actually runs in. */
318
+ runCwd: string;
319
+ /** True when a dedicated git worktree was created for file-tree isolation. */
320
+ isolated: boolean;
321
+ };
322
+ /**
323
+ * Decide WHERE the job runs and create isolation if warranted:
324
+ * - `--cwd <path>` → that path, as-is (caller owns isolation).
325
+ * - else if the origin cwd is a git repo → a dedicated worktree at
326
+ * `<originCwd>/.remote/jobs/<jobId>/wt` (so concurrent jobs never clobber the
327
+ * working tree; the single-writer guard only protects the `.jsonl`).
328
+ * - else → the origin cwd, as-is (non-repo: nothing to isolate cheaply).
329
+ *
330
+ * Throws if the worktree creation fails (we must NOT silently run in the shared
331
+ * cwd, which would defeat isolation).
332
+ */
333
+ export declare function resolveJobCwd(originCwd: string, jobId: string, opts?: ResolveCwdOpts): ResolvedCwd;
334
+ export type JobRow = {
335
+ id: string;
336
+ type: DelegateType;
337
+ state: JobState;
338
+ age: string;
339
+ cwd: string;
340
+ /**
341
+ * Extra per-state detail shown in the NOTE column — currently the throttle
342
+ * "retry in Xm" hint for `throttled` rows (empty otherwise). Reliability
343
+ * slice 1.
344
+ */
345
+ note: string;
346
+ /** Account label bound to this job via the pool (omitted when no pool binding). */
347
+ account?: string;
348
+ /** Remote session UUID (kind "remote" only) — use with `remote attach <session>`. */
349
+ session?: string;
350
+ };
351
+ /**
352
+ * The DISPLAY state of a job, reconciling its persisted `jobState` with live
353
+ * liveness: a job still marked `running`/`pending` whose tmux session is gone
354
+ * has crashed/finished → show `failed` (P1 has no headless-success poll in the
355
+ * pure layer; the headless result.json is surfaced by `jobs status`). A job
356
+ * already in a terminal state keeps it. Pure, exported for tests.
357
+ */
358
+ export declare function reconcileJobState(entry: Pick<RegistryEntry, "jobState" | "endedAt">, live: boolean): JobState;
359
+ /**
360
+ * P2 — CLUSTER reconciliation for REMOTE jobs (`kind:"remote"`). The registry
361
+ * reports a remote entry as `isLive` ALWAYS (it can't probe the cluster —
362
+ * registry.ts), so a delegated Pod that died/finished would stay "running"
363
+ * forever. Given the set of session ids the control-plane still lists
364
+ * (`listRemoteSessions`), this decides the transitions to apply: a remote job
365
+ * still in a non-terminal state whose `remoteId` is NOT in the live set has
366
+ * ended → `done` when it left a `result.json` (success/known exit), else
367
+ * `failed`. Jobs whose Pod is still listed, or already terminal, are untouched.
368
+ * Pure (the result read is injected), exported for tests.
369
+ */
370
+ export declare function reconcileRemoteJobs(jobs: ReadonlyArray<RegistryEntry>, liveRemoteIds: ReadonlySet<string>, readResult: (job: RegistryEntry) => JobResult | undefined): Array<{
371
+ id: string;
372
+ to: JobState;
373
+ }>;
374
+ /**
375
+ * M2 — SWEEP stale jobs. A job stuck in a non-terminal `running` /
376
+ * `awaiting-decision`-ish state (we only persist `running`; awaiting-decision is
377
+ * a DISPLAY overlay, so a job awaiting a decision is `running` on disk) whose
378
+ * runtime signal was lost — NOT live AND no `result.json` AND older than
379
+ * `maxAgeMs` — would otherwise occupy a concurrency slot forever. This returns
380
+ * the ids to transition to `failed`. Bounds BOTH plain running jobs and ones
381
+ * showing awaiting-decision (same persisted `running`). `pending` jobs are NOT
382
+ * swept here (they were never launched — the conductor owns them). Terminal jobs
383
+ * are skipped. Pure (liveness + result presence injected), exported for tests.
384
+ */
385
+ export declare function sweepStaleJobs(jobs: ReadonlyArray<RegistryEntry>, opts: {
386
+ isJobLive: (e: RegistryEntry) => boolean;
387
+ hasResult: (e: RegistryEntry) => boolean;
388
+ maxAgeMs: number;
389
+ nowMs?: number;
390
+ }): string[];
391
+ /**
392
+ * Build `jobs ls` rows from job entries + an injectable liveness probe. Pure,
393
+ * exported for tests. `nowMs` makes the age deterministic.
394
+ */
395
+ export declare function buildJobRows(jobs: ReadonlyArray<RegistryEntry>, isJobLive: (e: RegistryEntry) => boolean, nowMs?: number, resolveAccountLabel?: (jobId: string) => string | undefined): JobRow[];
396
+ /**
397
+ * M3 — advisory line for `jobs ls`: when there are QUEUED (`pending`) jobs but
398
+ * NO conductor running to drain them, warn the user (we do NOT self-heal — a
399
+ * one-shot `jobs ls` can't start the queue; only `jobs conduct` does). Returns
400
+ * undefined when there's nothing to warn about. Pure (the conductor-liveness
401
+ * probe is passed in), exported for tests.
402
+ */
403
+ export declare function conductorAdvisory(jobs: ReadonlyArray<Pick<RegistryEntry, "role" | "jobState">>, conductorRunning: boolean): string | undefined;
404
+ /** Render `jobs ls` rows as an aligned plain-text table. Pure. */
405
+ export declare function renderJobsTable(rows: ReadonlyArray<JobRow>): string;
406
+ //# sourceMappingURL=delegate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../src/delegate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAI3E,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AAWxC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,C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