firedrill-run 2.2.5 → 3.0.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 (392) hide show
  1. package/README.md +178 -22
  2. package/bin/firedrill.mjs +29 -5
  3. package/dist/assembly.json +13 -0
  4. package/dist/cli/runtime/candidate_copy.py +395 -0
  5. package/dist/cli/runtime/source_snapshot.py +391 -0
  6. package/dist/cli/src/administration.js +295 -0
  7. package/dist/cli/src/agent-changes.js +496 -0
  8. package/dist/cli/src/assessment-requests.js +67 -0
  9. package/dist/cli/src/auth.js +465 -0
  10. package/dist/cli/src/billing-commerce-contracts.js +1 -0
  11. package/dist/cli/src/billing-usage.js +227 -0
  12. package/dist/cli/src/billing-wallet-contracts.js +1 -0
  13. package/dist/cli/src/billing.js +170 -0
  14. package/dist/cli/src/bootstrap-process-lock.js +136 -0
  15. package/dist/cli/src/browser-links.js +14 -0
  16. package/dist/cli/src/campaign-controls.js +122 -0
  17. package/dist/cli/src/campaign-diagnoses.js +118 -0
  18. package/dist/cli/src/campaign-reports.js +1215 -0
  19. package/dist/cli/src/campaign-world.js +156 -0
  20. package/dist/cli/src/candidate-copy.js +376 -0
  21. package/dist/cli/src/catalog-contracts.js +1 -0
  22. package/dist/cli/src/ci-access-contracts.js +1 -0
  23. package/dist/cli/src/ci-configuration-contracts.js +1 -0
  24. package/dist/cli/src/ci-coverage.js +64 -0
  25. package/dist/cli/src/ci-delivery-contracts.js +1 -0
  26. package/dist/cli/src/ci-result-contracts.js +1 -0
  27. package/dist/cli/src/ci-run-contracts.js +1 -0
  28. package/dist/cli/src/ci-setup-proposals.js +52 -0
  29. package/dist/cli/src/company-policies.js +229 -0
  30. package/dist/cli/src/completion.js +79 -0
  31. package/dist/cli/src/configuration-intents.js +277 -0
  32. package/dist/cli/src/configuration.js +369 -0
  33. package/dist/cli/src/continuous-simulation.js +277 -0
  34. package/dist/cli/src/coordinated-checkpoints.js +133 -0
  35. package/dist/cli/src/credential-mode.js +139 -0
  36. package/dist/cli/src/credentials.js +331 -0
  37. package/dist/cli/src/credit-format.js +8 -0
  38. package/dist/cli/src/dataset-contracts.js +1 -0
  39. package/dist/cli/src/dataset-export.js +154 -0
  40. package/dist/cli/src/dataset-reads.js +37 -0
  41. package/dist/cli/src/dependency-preparation.js +239 -0
  42. package/dist/cli/src/director-tool-setup.js +104 -0
  43. package/dist/cli/src/driver-review.js +225 -0
  44. package/dist/cli/src/evaluation-authoring.js +315 -0
  45. package/dist/cli/src/evidence-bundles.js +367 -0
  46. package/dist/cli/src/execution-proposals.js +36 -0
  47. package/dist/cli/src/http.js +302 -0
  48. package/dist/cli/src/local-container-boundary.js +38 -0
  49. package/dist/cli/src/local-container-policy.js +201 -0
  50. package/dist/cli/src/local-execution-setup.js +81 -0
  51. package/dist/cli/src/local-source-basis.js +73 -0
  52. package/dist/cli/src/local-source.js +66 -0
  53. package/dist/cli/src/local-value-store.js +91 -0
  54. package/dist/cli/src/local-values.js +163 -0
  55. package/dist/cli/src/login-organizations.js +70 -0
  56. package/dist/cli/src/main.js +1622 -0
  57. package/dist/cli/src/mcp-connection.js +109 -0
  58. package/dist/cli/src/native/bindings.js +137 -0
  59. package/dist/cli/src/native/canonical.js +370 -0
  60. package/dist/cli/src/native/cloud-resources.js +942 -0
  61. package/dist/cli/src/native/companion-channel.js +421 -0
  62. package/dist/cli/src/native/companion-ipc.js +473 -0
  63. package/dist/cli/src/native/contracts.js +218 -0
  64. package/dist/cli/src/native/control-plane.js +1354 -0
  65. package/dist/cli/src/native/credit-approval.js +15 -0
  66. package/dist/cli/src/native/dependency-proxy.js +1006 -0
  67. package/dist/cli/src/native/drill-cleanup.js +115 -0
  68. package/dist/cli/src/native/drill-runner.js +1562 -0
  69. package/dist/cli/src/native/drivers/action-trace.js +210 -0
  70. package/dist/cli/src/native/drivers/function-wrapper.js +152 -0
  71. package/dist/cli/src/native/drivers/http.js +442 -0
  72. package/dist/cli/src/native/drivers/index.js +47 -0
  73. package/dist/cli/src/native/drivers/jsonl-process.js +538 -0
  74. package/dist/cli/src/native/drivers/playwright.js +600 -0
  75. package/dist/cli/src/native/drivers/signed-event.js +244 -0
  76. package/dist/cli/src/native/drivers/types.js +578 -0
  77. package/dist/cli/src/native/evidence-filter.js +255 -0
  78. package/dist/cli/src/native/isolated-access.js +241 -0
  79. package/dist/cli/src/native/library-sharing.js +220 -0
  80. package/dist/cli/src/native/local-run.js +667 -0
  81. package/dist/cli/src/native/local-secrets.js +19 -0
  82. package/dist/cli/src/native/mcp-config.js +123 -0
  83. package/dist/cli/src/native/metadata-requests.js +120 -0
  84. package/dist/cli/src/native/observations.js +1159 -0
  85. package/dist/cli/src/native/owned-groups.js +46 -0
  86. package/dist/cli/src/native/plan.js +594 -0
  87. package/dist/cli/src/native/png.js +159 -0
  88. package/dist/cli/src/native/ports.js +43 -0
  89. package/dist/cli/src/native/readiness.js +139 -0
  90. package/dist/cli/src/native/reassessments.js +206 -0
  91. package/dist/cli/src/native/redaction.js +235 -0
  92. package/dist/cli/src/native/registration.js +155 -0
  93. package/dist/cli/src/native/roots.js +110 -0
  94. package/dist/cli/src/native/run-cleanup.js +199 -0
  95. package/dist/cli/src/native/scratch.js +117 -0
  96. package/dist/cli/src/native/screenshots.js +60 -0
  97. package/dist/cli/src/native/session.js +556 -0
  98. package/dist/cli/src/native/standalone-proxy.js +580 -0
  99. package/dist/cli/src/native/standalone-renewals.js +183 -0
  100. package/dist/cli/src/native/standalone-state.js +193 -0
  101. package/dist/cli/src/native/standalone-tools.js +187 -0
  102. package/dist/cli/src/native/supervisor.js +831 -0
  103. package/dist/cli/src/native/target-auth.js +161 -0
  104. package/dist/cli/src/native/target-state.js +330 -0
  105. package/dist/cli/src/native/tool-reuse.js +364 -0
  106. package/dist/cli/src/native/tool-setups.js +336 -0
  107. package/dist/cli/src/native/world-reuse.js +288 -0
  108. package/dist/cli/src/onboarding.js +23 -0
  109. package/dist/cli/src/priority-requests.js +70 -0
  110. package/dist/cli/src/priority.js +223 -0
  111. package/dist/cli/src/prompts.js +184 -0
  112. package/dist/cli/src/real-operations.js +221 -0
  113. package/dist/cli/src/recipe-intents.js +58 -0
  114. package/dist/cli/src/recorded-context-intents.js +59 -0
  115. package/dist/cli/src/recorded-context.js +248 -0
  116. package/dist/cli/src/recordings.js +69 -0
  117. package/dist/cli/src/registration-guide.js +39 -0
  118. package/dist/cli/src/report-exports.js +213 -0
  119. package/dist/cli/src/request-input.js +47 -0
  120. package/dist/cli/src/resource-lifecycle.js +141 -0
  121. package/dist/cli/src/revision-requests.js +55 -0
  122. package/dist/cli/src/runner-abandon.js +53 -0
  123. package/dist/cli/src/runner-campaign-controls.js +262 -0
  124. package/dist/cli/src/runner-claim-reads.js +36 -0
  125. package/dist/cli/src/runner-completion.js +65 -0
  126. package/dist/cli/src/runner-configuration.js +546 -0
  127. package/dist/cli/src/runner-container.js +794 -0
  128. package/dist/cli/src/runner-evidence-erasure.js +351 -0
  129. package/dist/cli/src/runner-evidence-privacy.js +37 -0
  130. package/dist/cli/src/runner-evidence-retention.js +161 -0
  131. package/dist/cli/src/runner-evidence.js +326 -0
  132. package/dist/cli/src/runner-execute.js +92 -0
  133. package/dist/cli/src/runner-execution-deadline.js +25 -0
  134. package/dist/cli/src/runner-grants.js +307 -0
  135. package/dist/cli/src/runner-identity.js +615 -0
  136. package/dist/cli/src/runner-inputs.js +308 -0
  137. package/dist/cli/src/runner-jobs.js +49 -0
  138. package/dist/cli/src/runner-model-transport.js +392 -0
  139. package/dist/cli/src/runner-ownership.js +332 -0
  140. package/dist/cli/src/runner-process-lock.js +175 -0
  141. package/dist/cli/src/runner-runtime.js +396 -0
  142. package/dist/cli/src/runner-session-channel.js +377 -0
  143. package/dist/cli/src/runner-trial-completion.js +34 -0
  144. package/dist/cli/src/runner-trial-journal.js +358 -0
  145. package/dist/cli/src/runner-trial-live.js +393 -0
  146. package/dist/cli/src/runner-trial-protocol.js +289 -0
  147. package/dist/cli/src/runner-trial-sync.js +110 -0
  148. package/dist/cli/src/runner-trial-transfer.js +107 -0
  149. package/dist/cli/src/runner-voice.js +40 -0
  150. package/dist/cli/src/runner-world-claim.js +21 -0
  151. package/dist/cli/src/runner-world-collector.js +159 -0
  152. package/dist/cli/src/runner-world-command-evidence.js +487 -0
  153. package/dist/cli/src/runner-world-commands.js +268 -0
  154. package/dist/cli/src/runner-world-completion.js +76 -0
  155. package/dist/cli/src/runner-world-erasure.js +95 -0
  156. package/dist/cli/src/runner-world-evidence-sync.js +91 -0
  157. package/dist/cli/src/runner-world-journal.js +510 -0
  158. package/dist/cli/src/runner-world-native-filters.js +134 -0
  159. package/dist/cli/src/runner-world-observations.js +50 -0
  160. package/dist/cli/src/runner-world-session-protocol.js +134 -0
  161. package/dist/cli/src/saved-records.js +40 -0
  162. package/dist/cli/src/scenario-authoring.js +212 -0
  163. package/dist/cli/src/scenario-discovery.js +216 -0
  164. package/dist/cli/src/scenario-paths.js +68 -0
  165. package/dist/cli/src/scenario-requests.js +4 -0
  166. package/dist/cli/src/service-receipts.js +105 -0
  167. package/dist/cli/src/simple/authoring.js +270 -0
  168. package/dist/cli/src/simple/credit-approval.js +16 -0
  169. package/dist/cli/src/simple/help.js +98 -0
  170. package/dist/cli/src/simple/init.js +61 -0
  171. package/dist/cli/src/simple/library-sharing.js +414 -0
  172. package/dist/cli/src/simple/metadata-requests.js +46 -0
  173. package/dist/cli/src/simple/native-report.js +841 -0
  174. package/dist/cli/src/simple/native-tools.js +780 -0
  175. package/dist/cli/src/simple/plan-apply.js +506 -0
  176. package/dist/cli/src/simple/reassessment.js +323 -0
  177. package/dist/cli/src/simple/register.js +123 -0
  178. package/dist/cli/src/simple/run.js +122 -0
  179. package/dist/cli/src/simple/status.js +49 -0
  180. package/dist/cli/src/simple/tool-renewal.js +308 -0
  181. package/dist/cli/src/simple/tool-reuse.js +526 -0
  182. package/dist/cli/src/simple/tool-start-catalog.js +100 -0
  183. package/dist/cli/src/simple/tool-state.js +426 -0
  184. package/dist/cli/src/simple/tools-author.js +222 -0
  185. package/dist/cli/src/simple/watch.js +28 -0
  186. package/dist/cli/src/simple/world-reuse.js +586 -0
  187. package/dist/cli/src/simulation-intents.js +406 -0
  188. package/dist/cli/src/simulation-run.js +1058 -0
  189. package/dist/cli/src/source-batch.js +322 -0
  190. package/dist/cli/src/source-connection.js +451 -0
  191. package/dist/cli/src/source-runtime.js +346 -0
  192. package/dist/cli/src/source-selection-intents.js +75 -0
  193. package/dist/cli/src/source-sets.js +214 -0
  194. package/dist/cli/src/target-models.js +109 -0
  195. package/dist/cli/src/tool-catalog.js +224 -0
  196. package/dist/cli/src/tool-command-contracts.js +1 -0
  197. package/dist/cli/src/tool-command-export.js +245 -0
  198. package/dist/cli/src/tool-connection-contracts.js +1 -0
  199. package/dist/cli/src/tool-connection-reads.js +23 -0
  200. package/dist/cli/src/tool-contributions.js +58 -0
  201. package/dist/cli/src/tool-data.js +116 -0
  202. package/dist/cli/src/tool-datasets.js +176 -0
  203. package/dist/cli/src/tool-group-contracts.js +1 -0
  204. package/dist/cli/src/tool-group-reads.js +26 -0
  205. package/dist/cli/src/tool-group-state.js +147 -0
  206. package/dist/cli/src/tool-groups.js +311 -0
  207. package/dist/cli/src/tool-instances.js +186 -0
  208. package/dist/cli/src/tool-lifecycle-contracts.js +1 -0
  209. package/dist/cli/src/tool-lifecycle-reads.js +30 -0
  210. package/dist/cli/src/tool-lifecycle.js +323 -0
  211. package/dist/cli/src/tool-package-contracts.js +1 -0
  212. package/dist/cli/src/tool-package-reads.js +41 -0
  213. package/dist/cli/src/tool-records.js +53 -0
  214. package/dist/cli/src/tool-runtime.js +96 -0
  215. package/dist/cli/src/tool-state-contracts.js +1 -0
  216. package/dist/cli/src/tool-state-reads.js +31 -0
  217. package/dist/cli/src/tools.js +306 -0
  218. package/dist/cli/src/trial-actions.js +93 -0
  219. package/dist/cli/src/trial-checkpoints.js +133 -0
  220. package/dist/cli/src/trial-checks.js +70 -0
  221. package/dist/cli/src/trial-state.js +197 -0
  222. package/dist/cli/src/vault.js +266 -0
  223. package/dist/cli/src/workspace-registration.js +383 -0
  224. package/dist/cli/src/workspace-team-contracts.js +1 -0
  225. package/dist/cli/src/world-access.js +231 -0
  226. package/dist/cli/src/world-agent.js +4 -0
  227. package/dist/cli/src/world-checkpoint-scopes.js +15 -0
  228. package/dist/cli/src/world-contracts.js +6 -0
  229. package/dist/cli/src/world-creation.js +201 -0
  230. package/dist/cli/src/world-datasets.js +207 -0
  231. package/dist/cli/src/world-inspection.js +257 -0
  232. package/dist/cli/src/world-recipes.js +103 -0
  233. package/dist/cli/src/world-requests.js +241 -0
  234. package/dist/cli/src/world-session-checkpoints.js +196 -0
  235. package/dist/cli/src/world-session-lifecycle.js +207 -0
  236. package/dist/cli/src/world-session-requests.js +215 -0
  237. package/dist/cli/src/world-session-state.js +145 -0
  238. package/dist/cli/src/world-session-voice.js +66 -0
  239. package/dist/cli/src/world-sessions.js +288 -0
  240. package/dist/cli/src/world-stream.js +99 -0
  241. package/dist/cli/src/world-time-report.js +58 -0
  242. package/dist/contracts/agent-change-contracts.js +75 -0
  243. package/dist/contracts/agent-execution-contracts.js +38 -0
  244. package/dist/contracts/application-state-contracts.js +26 -0
  245. package/dist/contracts/assessment-aggregate-contracts.js +15 -0
  246. package/dist/contracts/assessment-contracts.js +74 -0
  247. package/dist/contracts/billing-commerce-contracts.js +107 -0
  248. package/dist/contracts/billing-wallet-contracts.js +43 -0
  249. package/dist/contracts/campaign-lifecycle.js +1 -0
  250. package/dist/contracts/campaign-world-contracts.js +80 -0
  251. package/dist/contracts/catalog-contracts.js +73 -0
  252. package/dist/contracts/ci-access-contracts.js +68 -0
  253. package/dist/contracts/ci-configuration-contracts.js +88 -0
  254. package/dist/contracts/ci-coverage-contracts.js +65 -0
  255. package/dist/contracts/ci-coverage-labels.js +25 -0
  256. package/dist/contracts/ci-delivery-contracts.js +61 -0
  257. package/dist/contracts/ci-result-contracts.js +103 -0
  258. package/dist/contracts/ci-run-contracts.js +51 -0
  259. package/dist/contracts/ci-setup-contracts.js +88 -0
  260. package/dist/contracts/clip-contracts.js +32 -0
  261. package/dist/contracts/comparison-contracts.js +53 -0
  262. package/dist/contracts/composite-contracts.js +34 -0
  263. package/dist/contracts/context-contracts.js +76 -0
  264. package/dist/contracts/continuation-report-contracts.js +1 -0
  265. package/dist/contracts/continuity-requirements.js +8 -0
  266. package/dist/contracts/coordinated-checkpoint-contracts.js +34 -0
  267. package/dist/contracts/dataset-contracts.js +88 -0
  268. package/dist/contracts/dependency-decision-contracts.js +36 -0
  269. package/dist/contracts/dependency-protocol-contracts.js +43 -0
  270. package/dist/contracts/director-execution.js +51 -0
  271. package/dist/contracts/driver-review-contracts.js +99 -0
  272. package/dist/contracts/evidence-contracts.js +65 -0
  273. package/dist/contracts/evidence-coverage-contracts.js +10 -0
  274. package/dist/contracts/export-contracts.js +44 -0
  275. package/dist/contracts/github-directory-contracts.js +96 -0
  276. package/dist/contracts/insight-contracts.js +11 -0
  277. package/dist/contracts/inspection-contracts.js +1 -0
  278. package/dist/contracts/local-claim-contracts.js +39 -0
  279. package/dist/contracts/local-configuration-contracts.js +7 -0
  280. package/dist/contracts/local-evidence-contracts.js +32 -0
  281. package/dist/contracts/local-grant-contracts.js +83 -0
  282. package/dist/contracts/local-input-contracts.js +19 -0
  283. package/dist/contracts/local-runner-contracts.js +42 -0
  284. package/dist/contracts/local-trial-live-contracts.js +16 -0
  285. package/dist/contracts/local-value-source-contracts.js +92 -0
  286. package/dist/contracts/local-world-native-contracts.js +8 -0
  287. package/dist/contracts/mcp-contracts.js +42 -0
  288. package/dist/contracts/media-contracts.js +28 -0
  289. package/dist/contracts/native-check-contracts.js +31 -0
  290. package/dist/contracts/native-identity-contracts.js +52 -0
  291. package/dist/contracts/onboarding-contracts.js +32 -0
  292. package/dist/contracts/performance-contracts.js +85 -0
  293. package/dist/contracts/planning-contracts.js +81 -0
  294. package/dist/contracts/real-operation-contracts.js +30 -0
  295. package/dist/contracts/recommendation-contracts.js +54 -0
  296. package/dist/contracts/report-contracts.js +1 -0
  297. package/dist/contracts/resource-lifecycle-contracts.js +57 -0
  298. package/dist/contracts/revision-contracts.js +12 -0
  299. package/dist/contracts/revision-request-contracts.js +39 -0
  300. package/dist/contracts/saved-record-contracts.js +76 -0
  301. package/dist/contracts/scenario-draft-comparison.js +91 -0
  302. package/dist/contracts/scenario-world-contracts.js +14 -0
  303. package/dist/contracts/service-contracts.js +1 -0
  304. package/dist/contracts/session-command-contracts.js +56 -0
  305. package/dist/contracts/session-contracts.js +65 -0
  306. package/dist/contracts/session-state-contracts.js +67 -0
  307. package/dist/contracts/session-voice-contracts.js +45 -0
  308. package/dist/contracts/source-set-contracts.js +26 -0
  309. package/dist/contracts/source-upload-contracts.js +22 -0
  310. package/dist/contracts/tool-command-contracts.js +57 -0
  311. package/dist/contracts/tool-connection-contracts.js +87 -0
  312. package/dist/contracts/tool-contribution-contracts.js +35 -0
  313. package/dist/contracts/tool-group-contracts.js +53 -0
  314. package/dist/contracts/tool-group-state-contracts.js +63 -0
  315. package/dist/contracts/tool-lifecycle-contracts.js +94 -0
  316. package/dist/contracts/tool-package-contracts.js +91 -0
  317. package/dist/contracts/tool-protocol-contracts.js +71 -0
  318. package/dist/contracts/tool-runtime-billing-contracts.js +28 -0
  319. package/dist/contracts/tool-setup-proposal.js +59 -0
  320. package/dist/contracts/tool-state-contracts.js +79 -0
  321. package/dist/contracts/trial-state-contracts.js +30 -0
  322. package/dist/contracts/typescript/agent-change.js +1 -0
  323. package/dist/contracts/typescript/assessment-aggregate.js +1 -0
  324. package/dist/contracts/typescript/assessment.js +1 -0
  325. package/dist/contracts/typescript/billing-commerce.js +1 -0
  326. package/dist/contracts/typescript/campaigns.js +1 -0
  327. package/dist/contracts/typescript/catalog.js +1 -0
  328. package/dist/contracts/typescript/ci-access.js +1 -0
  329. package/dist/contracts/typescript/ci-configuration.js +1 -0
  330. package/dist/contracts/typescript/ci-delivery.js +1 -0
  331. package/dist/contracts/typescript/ci-result.js +1 -0
  332. package/dist/contracts/typescript/ci-runs.js +1 -0
  333. package/dist/contracts/typescript/clips.js +1 -0
  334. package/dist/contracts/typescript/comparison.js +1 -0
  335. package/dist/contracts/typescript/composite.js +1 -0
  336. package/dist/contracts/typescript/connections.js +1 -0
  337. package/dist/contracts/typescript/context.js +1 -0
  338. package/dist/contracts/typescript/datasets.js +1 -0
  339. package/dist/contracts/typescript/evidence-coverage.js +1 -0
  340. package/dist/contracts/typescript/export.js +1 -0
  341. package/dist/contracts/typescript/github-directory.js +1 -0
  342. package/dist/contracts/typescript/insight.js +1 -0
  343. package/dist/contracts/typescript/inspection.js +1 -0
  344. package/dist/contracts/typescript/intake.js +1 -0
  345. package/dist/contracts/typescript/local-claim.js +1 -0
  346. package/dist/contracts/typescript/local-configuration.js +1 -0
  347. package/dist/contracts/typescript/local-evidence.js +1 -0
  348. package/dist/contracts/typescript/local-grant.js +1 -0
  349. package/dist/contracts/typescript/local-input.js +1 -0
  350. package/dist/contracts/typescript/local-runner.js +1 -0
  351. package/dist/contracts/typescript/local-trial-live.js +1 -0
  352. package/dist/contracts/typescript/local-value-source.js +1 -0
  353. package/dist/contracts/typescript/local-world-native.js +1 -0
  354. package/dist/contracts/typescript/mcp.js +1 -0
  355. package/dist/contracts/typescript/media.js +1 -0
  356. package/dist/contracts/typescript/native-check.js +1 -0
  357. package/dist/contracts/typescript/native-identity.js +1 -0
  358. package/dist/contracts/typescript/onboarding.js +1 -0
  359. package/dist/contracts/typescript/performance.js +1 -0
  360. package/dist/contracts/typescript/planning.js +1 -0
  361. package/dist/contracts/typescript/preparation.js +1 -0
  362. package/dist/contracts/typescript/real-operation.js +1 -0
  363. package/dist/contracts/typescript/recommendation.js +1 -0
  364. package/dist/contracts/typescript/reports.js +1 -0
  365. package/dist/contracts/typescript/resource-lifecycle.js +1 -0
  366. package/dist/contracts/typescript/saved-record.js +1 -0
  367. package/dist/contracts/typescript/scenarios.js +1 -0
  368. package/dist/contracts/typescript/services.js +1 -0
  369. package/dist/contracts/typescript/session-command.js +1 -0
  370. package/dist/contracts/typescript/session-state.js +1 -0
  371. package/dist/contracts/typescript/session-voice.js +1 -0
  372. package/dist/contracts/typescript/session.js +1 -0
  373. package/dist/contracts/typescript/tool-command.js +1 -0
  374. package/dist/contracts/typescript/tool-connection.js +1 -0
  375. package/dist/contracts/typescript/tool-contribution.js +1 -0
  376. package/dist/contracts/typescript/tool-groups.js +1 -0
  377. package/dist/contracts/typescript/tool-lifecycle.js +1 -0
  378. package/dist/contracts/typescript/tool-package.js +1 -0
  379. package/dist/contracts/typescript/tool-state.js +1 -0
  380. package/dist/contracts/typescript/trial-state.js +1 -0
  381. package/dist/contracts/typescript/vault.js +1 -0
  382. package/dist/contracts/typescript/workspace-team.js +1 -0
  383. package/dist/contracts/typescript/world-stream.js +1 -0
  384. package/dist/contracts/workspace-team-contracts.js +55 -0
  385. package/dist/contracts/world-command.js +65 -0
  386. package/dist/contracts/world-lifetime-contracts.js +74 -0
  387. package/dist/contracts/world-recipe-contracts.js +27 -0
  388. package/dist/contracts/world-stream-contracts.js +27 -0
  389. package/dist/package.json +1 -0
  390. package/package.json +16 -16
  391. package/LICENSE.md +0 -23
  392. package/PACKAGING.json +0 -50
@@ -0,0 +1,262 @@
1
+ import { createHash, randomUUID } from 'node:crypto';
2
+ import { constants } from 'node:fs';
3
+ import { lstat, mkdir, open, rename } from 'node:fs/promises';
4
+ import { join } from 'node:path';
5
+ import { setTimeout as sleep } from 'node:timers/promises';
6
+ import { api } from './auth.js';
7
+ import { privateDirectory } from './credentials.js';
8
+ import { CliError } from './http.js';
9
+ import { signRunnerRequest } from './runner-identity.js';
10
+ import { readLocalClaim } from './runner-claim-reads.js';
11
+ import { identifier } from './world-contracts.js';
12
+ const CAPACITY = { schema: 'firedrill.campaign-world-control-error.v1', code: 'campaign_world_control_capacity' };
13
+ const HASH = /^[a-f0-9]{64}$/, MAX_PACKET = 600 * 1024;
14
+ const record = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
15
+ const sameKeys = (value, fields) => Object.keys(value).sort().join(',') === [...fields].sort().join(',');
16
+ const sha = (value) => createHash('sha256').update(value).digest('hex');
17
+ const date = (value) => typeof value === 'string' && Number.isFinite(Date.parse(value));
18
+ const invalid = () => new CliError('local_campaign_control_unconfirmed', 'World control delivery paused. The original drill was not restarted and no command was repeated.');
19
+ function control(value, owner, execution) {
20
+ if (value === null)
21
+ return;
22
+ if (!record(value) || !sameKeys(value, ['id', 'command_sha256', 'request_key', 'action', 'sequence', 'expected_sequence', 'previous_revision',
23
+ 'expected_watermark', 'next_scenario_id', 'not_after', 'state', 'publication_started_at', 'result', 'workspace_id',
24
+ 'campaign_id', 'execution_id', 'actor_id', 'created_at', 'finished_at', 'provenance', 'problem'])
25
+ || ['id', 'request_key', 'workspace_id', 'campaign_id', 'execution_id', 'actor_id'].some(key => typeof value[key] !== 'string'
26
+ || identifier(value[key]) !== value[key])
27
+ || value.workspace_id !== owner.workspace || value.execution_id !== execution
28
+ || value.provenance !== 'customer_device'
29
+ || typeof value.command_sha256 !== 'string' || !HASH.test(value.command_sha256)
30
+ || typeof value.previous_revision !== 'string' || !HASH.test(value.previous_revision)
31
+ || typeof value.expected_watermark !== 'string' || !/^(0|[1-9][0-9]{0,5})$/.test(value.expected_watermark)
32
+ || !Number.isSafeInteger(value.sequence) || Number(value.sequence) < 1 || Number(value.sequence) > 100000
33
+ || value.expected_sequence !== Number(value.sequence) - 1
34
+ || typeof value.action !== 'string' || !['pause', 'resume', 'cancel_future', 'revise_future'].includes(value.action)
35
+ || typeof value.state !== 'string' || !['queued', 'publishing', 'observed', 'rejected', 'unknown', 'ended'].includes(value.state)
36
+ || !date(value.not_after) || !date(value.created_at)
37
+ || value.publication_started_at !== null && !date(value.publication_started_at)
38
+ || value.finished_at !== null && !date(value.finished_at)
39
+ || value.next_scenario_id !== null && (typeof value.next_scenario_id !== 'string' || identifier(value.next_scenario_id) !== value.next_scenario_id)
40
+ || value.result !== null && !record(value.result))
41
+ throw invalid();
42
+ if (value.problem !== null && (typeof value.problem !== 'string' || value.problem.length > 1000))
43
+ throw invalid();
44
+ }
45
+ export function campaignControlReadback(value, expected) {
46
+ if (!record(value) || !sameKeys(value, ['schema', 'command_sha256', 'publication', 'receipt'])
47
+ || value.schema !== 'firedrill.campaign-world-control-readback.v1' || value.command_sha256 !== expected
48
+ || typeof value.publication !== 'string' || !['absent', 'queued', 'accepted', 'finished'].includes(value.publication)
49
+ || (value.receipt !== null) !== (value.publication === 'finished') || value.receipt !== null && !record(value.receipt))
50
+ throw invalid();
51
+ return value;
52
+ }
53
+ async function privateFolder(owner) {
54
+ const path = join(await privateDirectory(), `campaign-controls-${identifier(owner.owner)}-${identifier(owner.workspace)}-${identifier(owner.lease)}`);
55
+ await mkdir(path, { mode: 0o700 }).catch(error => { if (error.code !== 'EEXIST')
56
+ throw error; });
57
+ const row = await lstat(path);
58
+ if (!row.isDirectory() || row.isSymbolicLink() || row.mode & 0o077 || process.getuid && row.uid !== process.getuid())
59
+ throw invalid();
60
+ return path;
61
+ }
62
+ async function saved(directory, expected) {
63
+ const path = join(directory, identifier(expected.command_id) + '.json');
64
+ const before = await lstat(path).catch(error => { if (error.code === 'ENOENT')
65
+ return null; throw error; });
66
+ if (!before)
67
+ return expected;
68
+ if (!before.isFile() || before.isSymbolicLink() || before.nlink !== 1 || before.mode & 0o077 || before.size > 8192
69
+ || process.getuid && before.uid !== process.getuid())
70
+ throw invalid();
71
+ const file = await open(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));
72
+ try {
73
+ const actual = await file.stat();
74
+ if (actual.ino !== before.ino || actual.dev !== before.dev || actual.size !== before.size)
75
+ throw invalid();
76
+ const raw = await file.readFile(), after = await file.stat();
77
+ if (after.mtimeMs !== actual.mtimeMs || after.ctimeMs !== actual.ctimeMs || after.size !== actual.size)
78
+ throw invalid();
79
+ const value = JSON.parse(raw.toString('utf8'));
80
+ if (!record(value) || !sameKeys(value, Object.keys(expected))
81
+ || Object.entries(expected).some(([key, child]) => key !== 'stage' && value[key] !== child)
82
+ || typeof value.stage !== 'string' || !['planned', 'cloud_requested', 'cloud_authorized', 'native_requested', 'readback_only', 'finished'].includes(value.stage))
83
+ throw invalid();
84
+ return value;
85
+ }
86
+ finally {
87
+ await file.close();
88
+ }
89
+ }
90
+ async function persist(directory, journal) {
91
+ const path = join(directory, identifier(journal.command_id) + '.json'), temporary = path + '.' + randomUUID() + '.tmp';
92
+ const file = await open(temporary, 'wx', 0o600);
93
+ try {
94
+ await file.writeFile(JSON.stringify(journal));
95
+ await file.sync();
96
+ }
97
+ finally {
98
+ await file.close();
99
+ }
100
+ await rename(temporary, path);
101
+ const folder = await open(directory, constants.O_RDONLY | (constants.O_DIRECTORY ?? 0));
102
+ try {
103
+ await folder.sync();
104
+ }
105
+ finally {
106
+ await folder.close();
107
+ }
108
+ }
109
+ /** One bounded pump on the original container and claim. It never starts a
110
+ * target, installs a runner, extends consent or repeats an uncertain write. */
111
+ export function startCampaignWorldControls(owner, configuration, native, signal, output) {
112
+ const stopping = new AbortController(), active = AbortSignal.any([signal, stopping.signal]);
113
+ const input = configuration.control;
114
+ if (owner.purpose !== 'trial' || input.schema !== 'firedrill.trial.v1' || !owner.evidenceUpload
115
+ || input.world_continuity !== 'continuous'
116
+ || input.operation_id !== owner.lease || input.job_id !== owner.job || !HASH.test(configuration.manifest_sha256)
117
+ || typeof input.execution_id !== 'string' || typeof input.execution_inputs_sha256 !== 'string' || !HASH.test(input.execution_inputs_sha256))
118
+ throw invalid();
119
+ const execution = identifier(input.execution_id), inputsSha256 = input.execution_inputs_sha256;
120
+ const prefix = `/api/workspaces/${identifier(owner.workspace)}/local-runners/${identifier(owner.device)}/jobs/${identifier(owner.job)}/claims/${identifier(owner.request)}/campaign-world-controls`;
121
+ const request = async (action, selected, readback) => {
122
+ const bounded = AbortSignal.any([active, AbortSignal.timeout(15000)]);
123
+ const claim = await readLocalClaim(owner, owner.device, owner.job, owner.request, bounded);
124
+ if (claim.claim?.id !== owner.lease || claim.claim.attempt_id !== owner.attempt || claim.claim.state !== 'claimed'
125
+ || claim.native_session_id !== owner.nativeSession || claim.payload_digest !== owner.payloadDigest || !date(claim.server_time))
126
+ throw invalid();
127
+ const payload = { schema: 'firedrill.local-campaign-control-read.v1', job_id: owner.job, attempt_id: owner.attempt,
128
+ lease_id: owner.lease, request_key: owner.request, device_key: owner.device, native_session_id: owner.nativeSession,
129
+ manifest_sha256: configuration.manifest_sha256, execution_id: execution, execution_inputs_sha256: inputsSha256,
130
+ action, read_key: randomUUID(), sent_at_ms: Date.parse(claim.server_time),
131
+ ...(selected ? { command_id: selected.id, command_sha256: selected.command_sha256 } : {}),
132
+ ...(action === 'publish' ? { publication_key: selected.id } : {}), ...(action === 'readback' ? { readback } : {}) };
133
+ const proof = await signRunnerRequest(owner, owner.device, payload, bounded);
134
+ const value = await api(prefix, { actor: owner.owner, workspace: owner.workspace, signal: bounded, method: 'POST', body: proof });
135
+ const extra = action === 'packet' ? ['packet_base64'] : action === 'publish' ? ['should_publish'] : [];
136
+ if (!record(value) || !sameKeys(value, ['actor_id', 'workspace_id', 'device_key', 'request_key', 'job_id', 'attempt_id', 'lease_id',
137
+ 'manifest_sha256', 'schema', 'execution_id', 'execution_inputs_sha256', 'action', 'command', 'server_time', 'provenance', ...extra])
138
+ || value.schema !== 'firedrill.local-campaign-control-delivery.v1' || value.action !== action || value.actor_id !== owner.owner
139
+ || value.workspace_id !== owner.workspace || value.device_key !== owner.device || value.request_key !== owner.request
140
+ || value.job_id !== owner.job || value.attempt_id !== owner.attempt || value.lease_id !== owner.lease
141
+ || value.manifest_sha256 !== configuration.manifest_sha256 || value.execution_id !== execution
142
+ || value.execution_inputs_sha256 !== inputsSha256 || value.provenance !== 'customer_device' || !date(value.server_time))
143
+ throw invalid();
144
+ control(value.command, owner, execution);
145
+ if (selected && (!value.command || ['id', 'command_sha256', 'sequence', 'action', 'not_after'].some(key => value.command[key] !== selected[key])))
146
+ throw invalid();
147
+ if (action === 'publish' && typeof value.should_publish !== 'boolean')
148
+ throw invalid();
149
+ return value;
150
+ };
151
+ const work = (async () => {
152
+ const directory = await privateFolder(owner);
153
+ while (!active.aborted) {
154
+ const next = await request('next'), selected = next.command;
155
+ if (selected) {
156
+ const intent = await saved(directory, { schema: 'firedrill.local-campaign-control-journal.v1', job_id: owner.job,
157
+ attempt_id: owner.attempt, lease_id: owner.lease, manifest_sha256: configuration.manifest_sha256,
158
+ execution_id: execution, execution_inputs_sha256: inputsSha256, command_id: selected.id,
159
+ command_sha256: selected.command_sha256, sequence: selected.sequence, stage: 'planned' });
160
+ if (intent.stage === 'finished')
161
+ throw invalid();
162
+ if (intent.stage === 'planned' && selected.publication_started_at === null && selected.state === 'queued') {
163
+ await persist(directory, intent);
164
+ const delivered = await request('packet', selected);
165
+ if (typeof delivered.packet_base64 !== 'string' || delivered.packet_base64.length > 4 * Math.ceil(MAX_PACKET / 3))
166
+ throw invalid();
167
+ const packet = Buffer.from(delivered.packet_base64, 'base64');
168
+ try {
169
+ if (!packet.length || packet.length > MAX_PACKET || packet.toString('base64') !== delivered.packet_base64 || sha(packet) !== selected.command_sha256)
170
+ throw invalid();
171
+ const value = JSON.parse(packet.toString('utf8'));
172
+ if (!record(value) || value.schema !== 'firedrill.campaign-world-control.v1' || value.operation_id !== owner.lease
173
+ || value.job_id !== owner.job || value.execution_id !== execution || value.command_id !== selected.id
174
+ || value.execution_inputs_sha256 !== inputsSha256 || value.sequence !== selected.sequence
175
+ || value.action !== selected.action || value.previous_revision !== selected.previous_revision
176
+ || value.expected_watermark !== Number(selected.expected_watermark) || !date(value.not_after)
177
+ || Date.parse(value.not_after) !== Date.parse(selected.not_after)
178
+ || value.scenario_revision_id !== selected.next_scenario_id || !date(input.job_deadline_at)
179
+ || Date.parse(selected.not_after) > Date.parse(input.job_deadline_at))
180
+ throw invalid();
181
+ try {
182
+ await native.stage(selected.id, packet, selected.command_sha256, active);
183
+ const check = campaignControlReadback(await native.read(selected.id, 'check', active), selected.command_sha256);
184
+ if (check.publication !== 'absent')
185
+ throw invalid();
186
+ }
187
+ catch (error) {
188
+ if (!(error instanceof CliError) || error.code !== 'campaign_world_control_capacity')
189
+ throw error;
190
+ const refused = await request('readback', selected, CAPACITY);
191
+ if (refused.command?.state !== 'ended' || !refused.command.problem)
192
+ throw invalid();
193
+ intent.stage = 'finished';
194
+ await persist(directory, intent);
195
+ output?.('local_world_control_capacity', { command_id: selected.id, execution_id: execution,
196
+ state: 'ended', provenance: 'customer_device', native_publication_observed: false }, refused.command.problem);
197
+ await sleep(5000, undefined, { signal: active });
198
+ continue;
199
+ }
200
+ intent.stage = 'cloud_requested';
201
+ await persist(directory, intent);
202
+ let admitted = null;
203
+ try {
204
+ admitted = await request('publish', selected);
205
+ }
206
+ catch (error) {
207
+ intent.stage = 'readback_only';
208
+ await persist(directory, intent);
209
+ if (!(error instanceof CliError) || !['connection_uncertain', 'response_unavailable'].includes(error.code))
210
+ throw error;
211
+ }
212
+ if (admitted?.should_publish === true) {
213
+ intent.stage = 'cloud_authorized';
214
+ await persist(directory, intent);
215
+ // Persist the irreversible send boundary BEFORE the only native
216
+ // publication. A lost result can only use mode=result thereafter.
217
+ intent.stage = 'native_requested';
218
+ await persist(directory, intent);
219
+ try {
220
+ await native.read(selected.id, 'publish', active);
221
+ }
222
+ catch { /* Result-only readback below; never republish. */ }
223
+ }
224
+ else {
225
+ intent.stage = 'readback_only';
226
+ await persist(directory, intent);
227
+ }
228
+ }
229
+ finally {
230
+ packet.fill(0);
231
+ }
232
+ }
233
+ const observed = campaignControlReadback(await native.read(selected.id, 'result', active), selected.command_sha256);
234
+ let retained;
235
+ try {
236
+ retained = await request('readback', selected, observed);
237
+ }
238
+ catch (error) {
239
+ if (!(error instanceof CliError) || error.code !== 'campaign_world_control_pending')
240
+ throw error;
241
+ // Ordered live evidence can arrive after the native result. Keep the
242
+ // original command in readback-only state; this never sends it again.
243
+ intent.stage = 'readback_only';
244
+ await persist(directory, intent);
245
+ await sleep(2000, undefined, { signal: active });
246
+ continue;
247
+ }
248
+ intent.stage = retained.command && ['observed', 'rejected', 'ended'].includes(retained.command.state) ? 'finished' : 'readback_only';
249
+ await persist(directory, intent);
250
+ if (intent.stage === 'finished')
251
+ output?.('local_world_control', { command_id: selected.id, execution_id: execution,
252
+ state: retained.command.state, action: selected.action, provenance: 'customer_device' }, `World control ${retained.command.state}: ${selected.action.replaceAll('_', ' ')}.`);
253
+ }
254
+ await sleep(selected ? 2000 : 5000, undefined, { signal: active });
255
+ }
256
+ })().catch(() => {
257
+ if (!active.aborted)
258
+ output?.('local_world_controls_paused', { job_id: owner.job, execution_id: execution,
259
+ provenance: 'customer_device', commands_replayed: false }, 'Live world controls paused. Inspect the original command in the portal; the drill was not restarted.');
260
+ });
261
+ return { stop: async () => { stopping.abort(); await work; } };
262
+ }
@@ -0,0 +1,36 @@
1
+ import { api } from './auth.js';
2
+ import { CliError } from './http.js';
3
+ import { identifier } from './world-contracts.js';
4
+ import { localAssignmentMatches, localClaimLookupMatches, localAssignmentsMatch } from '../../contracts/local-claim-contracts.js';
5
+ const prefix = (scope, device) => `/api/workspaces/${identifier(scope.workspace)}/local-runners/${identifier(device)}/jobs`;
6
+ const original = (scope, device, job, request) => `${prefix(scope, device)}/${identifier(job)}/claims/${identifier(request)}`;
7
+ const selected = (scope, device, job, request) => ({ actor: scope.owner, workspace: scope.workspace, world: scope.world, device, job, request });
8
+ const auth = (scope, signal) => ({ actor: scope.owner, workspace: scope.workspace, signal });
9
+ const invalid = () => new CliError('local_claim_response_invalid', 'The saved local assignment did not match this account, device, job or original claim. No replacement was sent.');
10
+ export async function localAssignmentsPage(scope, device, filters, signal) {
11
+ const query = new URLSearchParams({ page: String(filters.page ?? 1) });
12
+ if (filters.world)
13
+ query.set('world_id', identifier(filters.world));
14
+ if (filters.campaign)
15
+ query.set('campaign_id', identifier(filters.campaign));
16
+ if (filters.query)
17
+ query.set('q', filters.query);
18
+ if (filters.available)
19
+ query.set('available', 'true');
20
+ const value = await api(`${prefix(scope, device)}?${query}`, auth(scope, signal));
21
+ if (!localAssignmentsMatch(value, selected(scope, device), filters))
22
+ throw invalid();
23
+ return value;
24
+ }
25
+ export async function readLocalClaim(scope, device, job, request, signal) {
26
+ const value = await api(original(scope, device, job, request), auth(scope, signal));
27
+ if (!localClaimLookupMatches(value, { ...selected(scope, device, job, request), request }))
28
+ throw invalid();
29
+ return value;
30
+ }
31
+ export async function changeLocalClaim(scope, device, job, request, action, body, signal) {
32
+ const value = await api(original(scope, device, job, request) + (action === 'presence' ? '/presence' : ''), { ...auth(scope, signal), method: action === 'claim' ? 'PUT' : action === 'withdraw' ? 'DELETE' : 'POST', body });
33
+ if (!localAssignmentMatches(value, selected(scope, device, job, request)) || !value.claim)
34
+ throw invalid();
35
+ return value;
36
+ }
@@ -0,0 +1,65 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { setTimeout as sleep } from 'node:timers/promises';
3
+ import { api } from './auth.js';
4
+ import { CliError } from './http.js';
5
+ import { historicalRunnerSigner } from './runner-identity.js';
6
+ import { localContainerCompletion } from './runner-container.js';
7
+ import { identifier } from './world-contracts.js';
8
+ import { localClosingReceiptMatches } from '../../contracts/local-evidence-contracts.js';
9
+ const fail = () => new CliError('local_completion_unconfirmed', 'The closing receipt is not confirmed. The saved operation was not restarted.');
10
+ const canonical = (value) => {
11
+ if (Array.isArray(value))
12
+ return '[' + value.map(canonical).join(',') + ']';
13
+ if (value && typeof value === 'object')
14
+ return '{' + Object.keys(value).sort().map(key => JSON.stringify(key) + ':' + canonical(value[key])).join(',') + '}';
15
+ const body = JSON.stringify(value);
16
+ if (body === undefined)
17
+ throw fail();
18
+ return body;
19
+ };
20
+ /** Historical receipt only. Never claims, renews, executes or reruns a target. */
21
+ export async function syncLocalCompletion(scope, operation, signal, options = {}) {
22
+ return syncClosingReceipt(scope, await localContainerCompletion(scope, operation), signal, options);
23
+ }
24
+ /** Shared fixed closing proof. Each purpose constructs its own exact document. */
25
+ export async function syncClosingReceipt(scope, saved, signal, options = {}) {
26
+ const document = canonical(saved.document);
27
+ const digest = createHash('sha256').update(document).digest('hex');
28
+ const path = `/api/workspaces/${identifier(scope.workspace)}/local-runners/${identifier(saved.device)}/jobs/${identifier(saved.job)}/claims/${identifier(saved.request)}/completion`;
29
+ const auth = { actor: scope.owner, workspace: scope.workspace, signal };
30
+ const matching = (receipt) => {
31
+ if (!localClosingReceiptMatches(receipt, { ...scope, ...saved })
32
+ || receipt.schema !== 'firedrill.local-completion-receipt.v1' || receipt.job_id !== saved.job || receipt.attempt_id !== saved.attempt
33
+ || receipt.lease_id !== saved.lease || receipt.request_key !== saved.request || receipt.manifest_sha256 !== saved.manifestSha256
34
+ || receipt.provenance !== 'customer_device' || receipt.independently_attested !== false || typeof receipt.received !== 'boolean'
35
+ || typeof receipt.settled !== 'boolean' || !Number.isSafeInteger(Date.parse(receipt.server_time))
36
+ || receipt.received && (receipt.digest !== digest || canonical(receipt.document) !== document || receipt.cleanup_recorded !== true)
37
+ || !receipt.received && (receipt.digest !== null || receipt.document !== null || receipt.cleanup_recorded || receipt.settled)
38
+ || receipt.settled && !['completed', 'failed', 'canceled'].includes(receipt.job_state))
39
+ throw fail();
40
+ };
41
+ let receipt = await api(path, auth);
42
+ matching(receipt);
43
+ if (!receipt.received) {
44
+ const signer = await historicalRunnerSigner(scope, saved.device, signal);
45
+ const proof = await signer.sign({ schema: 'firedrill.local-completion.v1', job_id: saved.job, attempt_id: saved.attempt,
46
+ lease_id: saved.lease, request_key: saved.request, device_key: saved.device, native_session_id: signer.nativeSession,
47
+ manifest_sha256: saved.manifestSha256, sent_at_ms: Date.parse(receipt.server_time), document: saved.document });
48
+ try {
49
+ receipt = await api(path, { ...auth, method: 'POST', body: proof });
50
+ }
51
+ catch {
52
+ receipt = await api(path, auth);
53
+ } // Reconcile the exact intent, never an automatic write replay.
54
+ matching(receipt);
55
+ if (!receipt.received)
56
+ throw fail();
57
+ }
58
+ const until = performance.now() + 180000;
59
+ while (options.wait && !receipt.settled && performance.now() < until) {
60
+ await sleep(1000, undefined, { signal });
61
+ receipt = await api(path, auth);
62
+ matching(receipt);
63
+ }
64
+ return receipt;
65
+ }