@parcha/agentrun-serve 0.1.0-beta.45 → 0.1.0-beta.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 (256) hide show
  1. package/CHANGELOG.md +180 -0
  2. package/NOTICE +4 -0
  3. package/README.md +283 -47
  4. package/dist/acp-package.d.ts +35 -6
  5. package/dist/acp-package.js +3 -3
  6. package/dist/adapter-facts.d.ts +5 -2
  7. package/dist/adapter-facts.js +6 -3
  8. package/dist/adapters.d.ts +7 -0
  9. package/dist/adapters.js +39 -0
  10. package/dist/agents-store.d.ts +5 -3
  11. package/dist/agents-store.js +13 -8
  12. package/dist/api-only.d.ts +7 -10
  13. package/dist/api-only.js +7 -10
  14. package/dist/archil-routes.js +2 -1
  15. package/dist/cap.js +12 -2
  16. package/dist/chatgpt-plan.js +2 -1
  17. package/dist/cli.js +119 -44
  18. package/dist/composio-made.d.ts +19 -2
  19. package/dist/composio-made.js +17 -5
  20. package/dist/composio-preset.d.ts +42 -7
  21. package/dist/composio-preset.js +106 -70
  22. package/dist/composio-triggers.d.ts +9 -4
  23. package/dist/composio-triggers.js +20 -13
  24. package/dist/computer-attach.d.ts +11 -10
  25. package/dist/computer-attach.js +13 -14
  26. package/dist/computer-commands.d.ts +3 -0
  27. package/dist/computer-commands.js +3 -2
  28. package/dist/computer-lost.d.ts +4 -0
  29. package/dist/computer-lost.js +8 -3
  30. package/dist/computer-setting.d.ts +2 -0
  31. package/dist/computer-setting.js +2 -0
  32. package/dist/computers.d.ts +9 -75
  33. package/dist/computers.js +20 -66
  34. package/dist/console/assets/index-BBFzAxLB.js +715 -0
  35. package/dist/console/assets/index-BRi-Rgq6.css +1 -0
  36. package/dist/console/index.html +2 -2
  37. package/dist/cost-heal.d.ts +13 -0
  38. package/dist/cost-heal.js +27 -0
  39. package/dist/dial-relay.d.ts +6 -2
  40. package/dist/dial-relay.js +9 -12
  41. package/dist/email/routes.js +2 -1
  42. package/dist/errors.d.ts +2 -0
  43. package/dist/errors.js +5 -0
  44. package/dist/exa-keyless.d.ts +1 -1
  45. package/dist/exa-keyless.js +1 -1
  46. package/dist/faux-computers.d.ts +2 -3
  47. package/dist/faux-computers.js +9 -31
  48. package/dist/github-connection.js +2 -1
  49. package/dist/harness-archive.d.ts +19 -2
  50. package/dist/harness-archive.js +49 -15
  51. package/dist/harness-check.d.ts +73 -0
  52. package/dist/harness-check.js +489 -0
  53. package/dist/harness-cursor.d.ts +45 -0
  54. package/dist/harness-cursor.js +121 -0
  55. package/dist/harness-recipe.d.ts +127 -0
  56. package/dist/harness-recipe.js +357 -0
  57. package/dist/harness-table.d.ts +12 -0
  58. package/dist/harness-table.js +62 -2
  59. package/dist/harness.d.ts +2 -0
  60. package/dist/harness.js +3 -2
  61. package/dist/host-check.d.ts +6 -0
  62. package/dist/host-check.js +14 -0
  63. package/dist/host.d.ts +10 -3
  64. package/dist/host.js +17 -3
  65. package/dist/import-sources.d.ts +2 -0
  66. package/dist/import-sources.js +2 -0
  67. package/dist/import-summary.d.ts +15 -5
  68. package/dist/import-summary.js +24 -8
  69. package/dist/import.d.ts +34 -4
  70. package/dist/import.js +134 -32
  71. package/dist/key-refusal.d.ts +1 -0
  72. package/dist/key-refusal.js +8 -3
  73. package/dist/key-words.d.ts +1 -1
  74. package/dist/key-words.js +4 -4
  75. package/dist/learn/check.d.ts +3 -0
  76. package/dist/learn/check.js +31 -20
  77. package/dist/learn/compile.js +11 -4
  78. package/dist/learn/promote.d.ts +77 -4
  79. package/dist/learn/promote.js +123 -2
  80. package/dist/learned-nodes.d.ts +4 -3
  81. package/dist/learned-workflow.js +4 -1
  82. package/dist/learning-cost.d.ts +6 -16
  83. package/dist/learning-cost.js +6 -12
  84. package/dist/learning-setting.d.ts +17 -6
  85. package/dist/learning-setting.js +41 -5
  86. package/dist/learning-words.d.ts +2 -0
  87. package/dist/learning-words.js +1 -1
  88. package/dist/listen-first.d.ts +10 -0
  89. package/dist/listen-first.js +25 -1
  90. package/dist/llms.txt +1 -1
  91. package/dist/mcp-gateway.d.ts +2 -1
  92. package/dist/mcp-gateway.js +31 -15
  93. package/dist/mcp-probe.d.ts +18 -6
  94. package/dist/mcp-probe.js +41 -8
  95. package/dist/mcp-secret-writes.d.ts +8 -0
  96. package/dist/mcp-secret-writes.js +104 -4
  97. package/dist/mcp-servers-store.d.ts +11 -5
  98. package/dist/mcp-servers-store.js +46 -20
  99. package/dist/model-form.d.ts +2 -1
  100. package/dist/model-form.js +22 -8
  101. package/dist/model-gateway.d.ts +113 -0
  102. package/dist/model-gateway.js +433 -0
  103. package/dist/model.d.ts +2 -1
  104. package/dist/model.js +9 -7
  105. package/dist/monid.js +1 -1
  106. package/dist/native/binding.d.ts +4 -0
  107. package/dist/native/binding.js +9 -0
  108. package/dist/native/cli.d.ts +3 -2
  109. package/dist/native/cli.js +6 -5
  110. package/dist/openapi.d.ts +2 -0
  111. package/dist/openapi.js +326 -41
  112. package/dist/owner.d.ts +4 -2
  113. package/dist/owner.js +10 -4
  114. package/dist/page.d.ts +8 -0
  115. package/dist/page.js +9 -1
  116. package/dist/port-models.js +17 -10
  117. package/dist/provider.d.ts +3 -3
  118. package/dist/provider.js +12 -3
  119. package/dist/public-address.d.ts +28 -0
  120. package/dist/public-address.js +62 -0
  121. package/dist/run-launch.d.ts +1 -1
  122. package/dist/run-launch.js +1 -1
  123. package/dist/run-secrets.d.ts +3 -2
  124. package/dist/run-secrets.js +6 -4
  125. package/dist/runner/adapter-loop.d.ts +10 -7
  126. package/dist/runner/adapter-loop.js +57 -22
  127. package/dist/runner/adapter-run-spec.d.ts +12 -0
  128. package/dist/runner/adapter-run-spec.js +40 -6
  129. package/dist/runner/adapters/index.js +16 -0
  130. package/dist/runner/adapters/pi.d.ts +5 -2
  131. package/dist/runner/adapters/pi.js +7 -4
  132. package/dist/runner/audit.d.ts +7 -0
  133. package/dist/runner/audit.js +24 -6
  134. package/dist/runner/claim-secrets.js +5 -1
  135. package/dist/runner/cli-run-spec.js +15 -7
  136. package/dist/runner/compare-end.d.ts +43 -0
  137. package/dist/runner/compare-end.js +95 -0
  138. package/dist/runner/computer-journal.d.ts +3 -0
  139. package/dist/runner/computer-journal.js +22 -2
  140. package/dist/runner/conformance/harness.js +19 -8
  141. package/dist/runner/conformance/subject.d.ts +6 -0
  142. package/dist/runner/harness-loops.d.ts +6 -1
  143. package/dist/runner/harness-loops.js +94 -54
  144. package/dist/runner/held.d.ts +5 -4
  145. package/dist/runner/journal-kinds.d.ts +4 -1
  146. package/dist/runner/journal-kinds.js +3 -0
  147. package/dist/runner/loop-contract.d.ts +10 -0
  148. package/dist/runner/main.d.ts +5 -5
  149. package/dist/runner/main.js +81 -11
  150. package/dist/runner/mcp-claim.js +40 -12
  151. package/dist/runner/metrics.d.ts +26 -0
  152. package/dist/runner/metrics.js +44 -1
  153. package/dist/runner/presence.d.ts +41 -0
  154. package/dist/runner/presence.js +89 -0
  155. package/dist/runner/promotion.d.ts +10 -3
  156. package/dist/runner/promotion.js +42 -21
  157. package/dist/runner/run-child-host.js +52 -14
  158. package/dist/runner/runner.d.ts +5 -0
  159. package/dist/runner/runner.js +8 -0
  160. package/dist/runner/store-port.d.ts +3 -0
  161. package/dist/runner/store-secrets.js +19 -7
  162. package/dist/runner/workflow-first.d.ts +5 -2
  163. package/dist/runner/workflow-first.js +6 -3
  164. package/dist/runs-over-store.d.ts +6 -2
  165. package/dist/runs-over-store.js +14 -4
  166. package/dist/sdk/runs.d.ts +1 -1
  167. package/dist/sdk/runs.js +6 -1
  168. package/dist/sdk/schema.js +1 -1
  169. package/dist/secret-writes.d.ts +16 -3
  170. package/dist/secret-writes.js +28 -3
  171. package/dist/server-secrets-store.js +5 -0
  172. package/dist/server.d.ts +31 -2
  173. package/dist/server.js +326 -53
  174. package/dist/sign-ins-secrets.js +4 -1
  175. package/dist/skills/agentrun-serve/SKILL.md +11 -0
  176. package/dist/slack-url.d.ts +5 -0
  177. package/dist/slack-url.js +11 -0
  178. package/dist/slack.d.ts +107 -0
  179. package/dist/slack.js +292 -0
  180. package/dist/start-switches.d.ts +28 -0
  181. package/dist/start-switches.js +37 -0
  182. package/dist/stats.d.ts +1 -1
  183. package/dist/stats.js +2 -1
  184. package/dist/stop-signals.d.ts +11 -0
  185. package/dist/stop-signals.js +22 -0
  186. package/dist/store/agent-body.d.ts +1 -1
  187. package/dist/store/agent-body.js +2 -2
  188. package/dist/store/index.d.ts +3 -3
  189. package/dist/store/index.js +1 -1
  190. package/dist/store/postgres/migrations/0020_runners.sql +18 -0
  191. package/dist/store/postgres/store.d.ts +1 -1
  192. package/dist/store/postgres/store.js +4 -2
  193. package/dist/store/schema.d.ts +13 -5
  194. package/dist/store/schema.js +20 -11
  195. package/dist/store/seal.d.ts +16 -4
  196. package/dist/store/sqlite/store.d.ts +1 -1
  197. package/dist/store/sqlite/store.js +106 -27
  198. package/dist/store/store.d.ts +75 -23
  199. package/dist/store/store.js +11 -0
  200. package/dist/store-reads/analytics.js +3 -2
  201. package/dist/store-reads/cap.d.ts +7 -0
  202. package/dist/store-reads/cap.js +11 -1
  203. package/dist/store-reads/journal.js +27 -1
  204. package/dist/store-reads/learning.d.ts +23 -2
  205. package/dist/store-reads/learning.js +29 -8
  206. package/dist/store-reads/runs.d.ts +9 -0
  207. package/dist/store-reads/runs.js +19 -6
  208. package/dist/store-reads/stats.d.ts +4 -1
  209. package/dist/store-reads/stats.js +15 -6
  210. package/dist/store-view.d.ts +123 -14
  211. package/dist/store-view.js +154 -21
  212. package/dist/telemetry.d.ts +7 -7
  213. package/dist/telemetry.js +38 -15
  214. package/dist/templates.d.ts +6 -3
  215. package/dist/templates.js +38 -3
  216. package/dist/timeline/timeline.js +18 -0
  217. package/dist/tool-keys-store.js +2 -2
  218. package/dist/tool-keys.js +2 -1
  219. package/dist/tool-plane.js +2 -2
  220. package/dist/trigger-adapter.d.ts +3 -4
  221. package/dist/trigger-adapter.js +2 -2
  222. package/dist/trigger-composio.js +3 -3
  223. package/dist/trigger-email.js +0 -2
  224. package/dist/trigger-feed.js +0 -2
  225. package/dist/trigger-schedule.js +3 -0
  226. package/dist/trigger-secrets-shown.d.ts +6 -3
  227. package/dist/trigger-secrets-shown.js +22 -13
  228. package/dist/trigger-targets.d.ts +1 -1
  229. package/dist/trigger-targets.js +19 -8
  230. package/dist/triggers.d.ts +7 -3
  231. package/dist/triggers.js +2 -1
  232. package/dist/webhooks.d.ts +85 -9
  233. package/dist/webhooks.js +129 -46
  234. package/dist/wires.d.ts +6 -1
  235. package/dist/wires.js +5 -0
  236. package/dist/workspace/attach.d.ts +3 -2
  237. package/dist/workspace/attach.js +2 -1
  238. package/dist/workspace/attached-computers.d.ts +6 -8
  239. package/dist/workspace/attached-computers.js +27 -24
  240. package/dist/workspace/computer-deps.d.ts +2 -3
  241. package/dist/workspace/computer-deps.js +3 -6
  242. package/dist/workspace/computer-for-claim.js +72 -96
  243. package/dist/workspace/computer-kept.d.ts +0 -7
  244. package/dist/workspace/computer-kept.js +0 -17
  245. package/dist/workspace/resolve-computer.d.ts +18 -14
  246. package/dist/workspace/resolve-computer.js +47 -60
  247. package/dist/workspace/synced-folder.d.ts +20 -15
  248. package/dist/workspace/synced-folder.js +33 -43
  249. package/launcher/agentrun-serve +4 -1
  250. package/package.json +10 -10
  251. package/skills/agentrun-serve/SKILL.md +11 -0
  252. package/templates/README.md +1 -1
  253. package/templates/inbound-lead/agent.md +2 -1
  254. package/templates/kyb/agent.md +2 -1
  255. package/dist/console/assets/index-3O2Yl6hZ.js +0 -701
  256. package/dist/console/assets/index-DaFsZuzQ.css +0 -1
@@ -4,10 +4,12 @@
4
4
  // first-use install does (harness-install.ts):
5
5
  // - the archive is downloaded with node's fetch into a fresh folder beside `<data>/harnesses/<harness>`, its sha256
6
6
  // taken as it arrives, and refused unless it is the pin's before anything reads it;
7
- // - the verified archive is unpacked there by the system's tar (`tar -xjf`, a fixed argument list, no shell, an
8
- // environment of PATH alone): node has no bzip2 of its own, and the repository carries none;
9
- // - the binary's sha256 is checked there against the pin, and only then is the folder renamed into place and made
10
- // read-only. What was there before goes aside first, then away;
7
+ // - the verified archive is unpacked there by the system's tar (`tar -xjf` for Goose's tar.bz2, `-xzf` for Cursor's
8
+ // tar.gz; a fixed argument list, no shell, an environment of PATH alone): node has no bzip2 of its own, and the
9
+ // repository carries none;
10
+ // - the binary's sha256 is checked there against the pin, and where the pin holds one the digest of every file beside
11
+ // it (Cursor's launcher runs its own node on a hundred files of code), and only then is the folder renamed into place
12
+ // and made read-only. What was there before goes aside first, then away;
11
13
  // - a crash part way leaves that fresh folder (its name the sweep's) and never a half install: the next install removes it.
12
14
  // One install at a time on a data directory, under the hold first-use installs take (takeHold). The installer is handed no
13
15
  // key of the server's: fetch carries no header of ours, and tar's environment is PATH alone.
@@ -34,6 +36,10 @@ export const ARCHIVE_CODES = Object.freeze({
34
36
  /** Another install into the same data directory is running. */
35
37
  busy: "HARNESS_INSTALL_BUSY",
36
38
  });
39
+ /** How tar unpacks each format this installer takes: node has neither bzip2 nor a tar of its own. */
40
+ const TAR_FLAG = Object.freeze({ "tar.bz2": "-xjf", "tar.gz": "-xzf" });
41
+ /** The formats this installer unpacks, the one list a recipe's loader checks a release against (harness-recipe.ts). */
42
+ export const ARCHIVE_FORMATS = Object.freeze(Object.keys(TAR_FLAG));
37
43
  /** A failed install, by its code (ARCHIVE_CODES): its message says why, and the command that tries again. */
38
44
  export class ArchiveInstallFailed extends Error {
39
45
  code;
@@ -54,7 +60,7 @@ export function archivePlatform(platform = process.platform, arch = process.arch
54
60
  return os && cpu ? `${os}-${cpu}` : undefined;
55
61
  }
56
62
  /** The sha256 of the file at `path`, read a chunk at a time. */
57
- async function digestOf(path) {
63
+ export async function digestOf(path) {
58
64
  const hash = createHash("sha256");
59
65
  await pipeline(createReadStream(path), hash);
60
66
  return hash.digest("hex");
@@ -76,16 +82,24 @@ export async function installArchive(harness, dir, options = {}) {
76
82
  const release = platform ? harness.pin.archives[platform] : undefined;
77
83
  if (!platform || !release)
78
84
  throw fail(ARCHIVE_CODES.platform, `${named} has no release pinned for ${platform ?? `${process.platform}-${process.arch}`}`);
79
- if (!release.binarySha256)
85
+ if (!release.binarySha256 && !options.binaryRecord)
80
86
  throw fail(ARCHIVE_CODES.platform, `${named}'s binary on ${platform} has no sha256 pinned, so what its archive unpacks to cannot be checked`);
81
- if (release.format !== "tar.bz2")
82
- throw fail(ARCHIVE_CODES.platform, `${named}'s archive on ${platform} is ${release.format}, and this installer unpacks tar.bz2 alone`);
87
+ const flag = TAR_FLAG[release.format];
88
+ if (!flag || !Object.hasOwn(TAR_FLAG, release.format))
89
+ throw fail(ARCHIVE_CODES.platform, `${named}'s archive on ${platform} is ${release.format}, and this installer unpacks ${ARCHIVE_FORMATS.join(" and ")} alone`);
90
+ if (release.treeSha256 && !harness.tree)
91
+ throw fail(ARCHIVE_CODES.platform, `${named}'s files on ${platform} are pinned by a tree digest, and this install was given no way to take one`);
83
92
  const binary = binaryUnder(dir, release.cmd);
84
93
  if (!binary)
85
94
  throw fail(ARCHIVE_CODES.platform, `${named}'s pinned path ${release.cmd} is not inside its folder`);
86
- const pinned = release.binarySha256;
87
- /** Whether the pinned binary is in place: a file whose sha256 is the pin's. */
88
- const inPlace = async () => (await lstat(binary).catch(() => undefined)) !== undefined && (await digestOf(binary).catch(() => undefined)) === pinned;
95
+ // The pin's digest, else the first one recorded (none before the first install).
96
+ const pinned = release.binarySha256 ?? options.binaryRecord?.read();
97
+ /** Whether the pinned binary is in place: a file whose sha256 is the pin's, in a folder whose tree is the pin's where
98
+ * it pins one. */
99
+ const inPlace = async () => pinned !== undefined &&
100
+ (await lstat(binary).catch(() => undefined)) !== undefined &&
101
+ (await digestOf(binary).catch(() => undefined)) === pinned &&
102
+ (!release.treeSha256 || (await harness.tree(dir).catch(() => undefined)) === release.treeSha256);
89
103
  if (await inPlace())
90
104
  return { installed: "already", binary };
91
105
  const parent = dirname(dir);
@@ -101,7 +115,7 @@ export async function installArchive(harness, dir, options = {}) {
101
115
  // What an earlier install left part way (a crash between the unpack and the rename): never read, removed now.
102
116
  await sweepLeftovers(dir);
103
117
  work = await mkdtemp(join(parent, leftoverPrefix(dir)));
104
- const archive = join(work, "archive.tar.bz2");
118
+ const archive = join(work, `archive.${release.format}`);
105
119
  const timeoutMs = options.timeoutMs ?? ARCHIVE_TIMEOUT_MS;
106
120
  const maxBytes = options.maxBytes ?? ARCHIVE_MAX_BYTES;
107
121
  // The download, hashed as it is written; refused past its limit.
@@ -140,7 +154,7 @@ export async function installArchive(harness, dir, options = {}) {
140
154
  await mkdir(tree);
141
155
  const PATH = (options.env ?? process.env).PATH ?? "/usr/bin:/bin";
142
156
  await new Promise((done, reject) => {
143
- execFile(options.tar ?? "tar", ["-xjf", archive, "-C", tree, "--no-same-owner", "--no-same-permissions"], { env: { PATH, LC_ALL: "C" }, timeout: timeoutMs, maxBuffer: 1024 * 1024 }, (error, _stdout, stderr) => {
157
+ execFile(options.tar ?? "tar", [flag, archive, "-C", tree, "--no-same-owner", "--no-same-permissions"], { env: { PATH, LC_ALL: "C" }, timeout: timeoutMs, maxBuffer: 1024 * 1024 }, (error, _stdout, stderr) => {
144
158
  if (error)
145
159
  reject(fail(ARCHIVE_CODES.unpack, `tar could not unpack ${named}'s archive: ${String(stderr).trim() || error.message}`));
146
160
  else
@@ -154,8 +168,28 @@ export async function installArchive(harness, dir, options = {}) {
154
168
  if (!found?.isFile())
155
169
  throw fail(ARCHIVE_CODES.unpack, `${named}'s archive holds no file at ${release.cmd}`);
156
170
  const binarySha = await digestOf(unpacked);
157
- if (binarySha !== pinned)
158
- throw fail(ARCHIVE_CODES.binary, `${named}'s binary from its archive has sha256 ${binarySha}, and the pin is ${pinned}; it was not put in place`);
171
+ if (pinned === undefined) {
172
+ // The first binary unpacked from the verified archive: recorded, so a later one that differs is refused. A record
173
+ // another install wrote first holds.
174
+ try {
175
+ options.binaryRecord.write(binarySha);
176
+ }
177
+ catch (error) {
178
+ if (error?.code !== "EEXIST")
179
+ throw error;
180
+ const first = options.binaryRecord.read();
181
+ if (first !== binarySha)
182
+ throw fail(ARCHIVE_CODES.binary, `${named}'s binary from its archive has sha256 ${binarySha}, and the first one recorded is ${first}; it was not put in place`);
183
+ }
184
+ }
185
+ else if (binarySha !== pinned)
186
+ throw fail(ARCHIVE_CODES.binary, `${named}'s binary from its archive has sha256 ${binarySha}, and the ${release.binarySha256 ? "pin" : "first one recorded"} is ${pinned}; it was not put in place`);
187
+ // Every file beside it, where the pin holds their digest: a launcher's code is as much the harness as the launcher.
188
+ if (release.treeSha256) {
189
+ const treeSha = await harness.tree(tree);
190
+ if (treeSha !== release.treeSha256)
191
+ throw fail(ARCHIVE_CODES.binary, `${named}'s files from its archive have the tree sha256 ${treeSha}, and the pin is ${release.treeSha256}; they were not put in place`);
192
+ }
159
193
  await options.onStep?.("verified");
160
194
  // Into place whole: what was there (a binary that is not the pin's, a folder by hand) goes aside first, then away.
161
195
  const old = existsSync(dir) ? `${work}-old` : undefined;
@@ -0,0 +1,73 @@
1
+ export declare const CHECK_DEFAULT_CAP_USD = 0.25;
2
+ export interface HarnessCheckOptions {
3
+ /** The recipe file. */
4
+ recipe: string;
5
+ /** The data directory its owner installed it into. */
6
+ data: string;
7
+ /** The run's model, `provider/model-id` (a proxy-billed recipe needs one). */
8
+ model?: string;
9
+ /** The process's environment with its secrets (withSecrets): the provider's key, the recipe's own keys. */
10
+ env: NodeJS.ProcessEnv;
11
+ /** The most the check may spend, USD. */
12
+ capUsd?: number;
13
+ platform?: string;
14
+ /** For tests: the fetch the model proxy forwards with. */
15
+ fetch?: typeof fetch;
16
+ /** Each step as it happens, a line of words. */
17
+ say?: (line: string) => void;
18
+ turnMs?: number;
19
+ }
20
+ type Check = {
21
+ ok: boolean | null;
22
+ [field: string]: unknown;
23
+ };
24
+ export interface HarnessCheckReport {
25
+ ok: boolean;
26
+ recipe: {
27
+ id: string;
28
+ label: string;
29
+ file: string;
30
+ sha256: string;
31
+ } | {
32
+ file: string;
33
+ };
34
+ refused?: {
35
+ code: string;
36
+ message: string;
37
+ };
38
+ platform?: string;
39
+ model?: string;
40
+ binary?: {
41
+ path: string;
42
+ sha256: string;
43
+ pinnedBy: "recipe" | "first-seen";
44
+ };
45
+ stage2?: Record<string, Check>;
46
+ stage3?: Record<string, Check>;
47
+ facts?: {
48
+ resume: "load" | "restart" | "unknown";
49
+ tool_gate: "permission" | "config";
50
+ billing: "proxy" | "plan";
51
+ };
52
+ gate?: {
53
+ permissionsAsked: {
54
+ toolCallId: unknown;
55
+ kind: unknown;
56
+ }[];
57
+ asked: {
58
+ tool: string;
59
+ answer: string;
60
+ }[];
61
+ };
62
+ spendUsd?: number | null;
63
+ checkedAt: string;
64
+ failures: string[];
65
+ }
66
+ /** Runs the check. Never throws for what it judges: a refused recipe, a missing install or a failed stage is in the
67
+ * report (`ok: false`, `failures`). */
68
+ export declare function harnessCheck(options: HarnessCheckOptions): Promise<HarnessCheckReport>;
69
+ /** The three facts and the verdict, as the command prints them. */
70
+ export declare function printedFacts(report: HarnessCheckReport): string[];
71
+ /** Writes the report to `file`. */
72
+ export declare const writeReport: (file: string, report: HarnessCheckReport) => Promise<void>;
73
+ export {};