@halonicjs/testing 0.0.0 → 0.1.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 (384) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +1 -0
  3. package/README.md +41 -1
  4. package/dist/adapters/http-kit/src/address-class.d.ts +34 -0
  5. package/dist/adapters/http-kit/src/address-class.js +109 -0
  6. package/dist/adapters/http-kit/src/index.d.ts +2 -0
  7. package/dist/adapters/http-kit/src/index.js +2 -0
  8. package/dist/adapters/http-kit/src/ip-address.d.ts +23 -0
  9. package/dist/adapters/http-kit/src/ip-address.js +89 -0
  10. package/dist/adapters/integration-kit/src/declaration.d.ts +14 -0
  11. package/dist/adapters/integration-kit/src/declaration.js +77 -0
  12. package/dist/adapters/integration-kit/src/host.d.ts +28 -0
  13. package/dist/adapters/integration-kit/src/host.js +30 -0
  14. package/dist/adapters/integration-kit/src/index.d.ts +14 -0
  15. package/dist/adapters/integration-kit/src/index.js +21 -0
  16. package/dist/adapters/integration-kit/src/leak-attempt.d.ts +14 -0
  17. package/dist/adapters/integration-kit/src/leak-attempt.js +16 -0
  18. package/dist/adapters/integration-kit/src/limited-http.d.ts +49 -0
  19. package/dist/adapters/integration-kit/src/limited-http.js +182 -0
  20. package/dist/adapters/integration-kit/src/load-problem.d.ts +20 -0
  21. package/dist/adapters/integration-kit/src/load-problem.js +1 -0
  22. package/dist/adapters/integration-kit/src/loader.d.ts +104 -0
  23. package/dist/adapters/integration-kit/src/loader.js +219 -0
  24. package/dist/adapters/integration-kit/src/local-address.d.ts +15 -0
  25. package/dist/adapters/integration-kit/src/local-address.js +25 -0
  26. package/dist/adapters/integration-kit/src/own-request.d.ts +33 -0
  27. package/dist/adapters/integration-kit/src/own-request.js +36 -0
  28. package/dist/adapters/integration-kit/src/plugin-load.d.ts +14 -0
  29. package/dist/adapters/integration-kit/src/plugin-load.js +58 -0
  30. package/dist/adapters/integration-kit/src/policy.d.ts +55 -0
  31. package/dist/adapters/integration-kit/src/policy.js +37 -0
  32. package/dist/adapters/integration-kit/src/request-body.d.ts +38 -0
  33. package/dist/adapters/integration-kit/src/request-body.js +68 -0
  34. package/dist/adapters/integration-kit/src/request-log.d.ts +25 -0
  35. package/dist/adapters/integration-kit/src/request-log.js +17 -0
  36. package/dist/adapters/integration-kit/src/response-body.d.ts +23 -0
  37. package/dist/adapters/integration-kit/src/response-body.js +117 -0
  38. package/dist/adapters/integration-kit/src/scoped-tokens.d.ts +14 -0
  39. package/dist/adapters/integration-kit/src/scoped-tokens.js +27 -0
  40. package/dist/adapters/integration-kit/src/secret-filter.d.ts +84 -0
  41. package/dist/adapters/integration-kit/src/secret-filter.js +205 -0
  42. package/dist/adapters/integration-kit/src/secret-in-request.d.ts +59 -0
  43. package/dist/adapters/integration-kit/src/secret-in-request.js +133 -0
  44. package/dist/adapters/integration-kit/src/secret-placement.d.ts +36 -0
  45. package/dist/adapters/integration-kit/src/secret-placement.js +190 -0
  46. package/dist/adapters/integration-kit/src/wait.d.ts +16 -0
  47. package/dist/adapters/integration-kit/src/wait.js +35 -0
  48. package/dist/core/events/src/add-usage.d.ts +10 -0
  49. package/dist/core/events/src/add-usage.js +27 -0
  50. package/dist/core/events/src/agent-resume.d.ts +24 -0
  51. package/dist/core/events/src/agent-resume.js +1 -0
  52. package/dist/core/events/src/home-path.d.ts +13 -0
  53. package/dist/core/events/src/home-path.js +26 -0
  54. package/dist/core/events/src/index.d.ts +13 -0
  55. package/dist/core/events/src/index.js +7 -0
  56. package/dist/core/events/src/run-basics.d.ts +205 -0
  57. package/dist/core/events/src/run-basics.js +1 -0
  58. package/dist/core/events/src/run-event.d.ts +434 -0
  59. package/dist/core/events/src/run-event.js +1 -0
  60. package/dist/core/events/src/run-summary.d.ts +108 -0
  61. package/dist/core/events/src/run-summary.js +1 -0
  62. package/dist/core/events/src/sandbox-blocked.d.ts +42 -0
  63. package/dist/core/events/src/sandbox-blocked.js +26 -0
  64. package/dist/core/events/src/sandbox-opened-read.d.ts +17 -0
  65. package/dist/core/events/src/sandbox-opened-read.js +63 -0
  66. package/dist/core/events/src/sandbox-opened.d.ts +94 -0
  67. package/dist/core/events/src/sandbox-opened.js +52 -0
  68. package/dist/core/events/src/summarize.d.ts +14 -0
  69. package/dist/core/events/src/summarize.js +188 -0
  70. package/dist/core/events/src/timeline-entry.d.ts +21 -0
  71. package/dist/core/events/src/timeline-entry.js +105 -0
  72. package/dist/core/events/src/upgrade.d.ts +23 -0
  73. package/dist/core/events/src/upgrade.js +49 -0
  74. package/dist/core/format/src/compact.d.ts +30 -0
  75. package/dist/core/format/src/compact.js +72 -0
  76. package/dist/core/format/src/index.d.ts +37 -0
  77. package/dist/core/format/src/index.js +23 -0
  78. package/dist/core/format/src/integration/index.d.ts +6 -0
  79. package/dist/core/format/src/integration/index.js +9 -0
  80. package/dist/core/format/src/json-schema.d.ts +26 -0
  81. package/dist/core/format/src/json-schema.js +48 -0
  82. package/dist/core/format/src/kind.d.ts +65 -0
  83. package/dist/core/format/src/kind.js +1 -0
  84. package/dist/core/format/src/kinds/agent/kind.d.ts +4 -0
  85. package/dist/core/format/src/kinds/agent/kind.js +10 -0
  86. package/dist/core/format/src/kinds/agent/sandbox-fields.d.ts +89 -0
  87. package/dist/core/format/src/kinds/agent/sandbox-fields.js +197 -0
  88. package/dist/core/format/src/kinds/agent/schema.d.ts +147 -0
  89. package/dist/core/format/src/kinds/agent/schema.js +107 -0
  90. package/dist/core/format/src/kinds/agent/working-folder-start.d.ts +74 -0
  91. package/dist/core/format/src/kinds/agent/working-folder-start.js +312 -0
  92. package/dist/core/format/src/kinds/collection/kind.d.ts +8 -0
  93. package/dist/core/format/src/kinds/collection/kind.js +14 -0
  94. package/dist/core/format/src/kinds/collection/schema.d.ts +89 -0
  95. package/dist/core/format/src/kinds/collection/schema.js +90 -0
  96. package/dist/core/format/src/kinds/connector/is-local.d.ts +10 -0
  97. package/dist/core/format/src/kinds/connector/is-local.js +43 -0
  98. package/dist/core/format/src/kinds/connector/kind.d.ts +4 -0
  99. package/dist/core/format/src/kinds/connector/kind.js +119 -0
  100. package/dist/core/format/src/kinds/connector/schema.d.ts +50 -0
  101. package/dist/core/format/src/kinds/connector/schema.js +92 -0
  102. package/dist/core/format/src/kinds/deployments/kind.d.ts +4 -0
  103. package/dist/core/format/src/kinds/deployments/kind.js +25 -0
  104. package/dist/core/format/src/kinds/deployments/schema.d.ts +37 -0
  105. package/dist/core/format/src/kinds/deployments/schema.js +42 -0
  106. package/dist/core/format/src/kinds/hub/kind.d.ts +4 -0
  107. package/dist/core/format/src/kinds/hub/kind.js +10 -0
  108. package/dist/core/format/src/kinds/hub/schema.d.ts +54 -0
  109. package/dist/core/format/src/kinds/hub/schema.js +34 -0
  110. package/dist/core/format/src/kinds/integration/kind.d.ts +16 -0
  111. package/dist/core/format/src/kinds/integration/kind.js +138 -0
  112. package/dist/core/format/src/kinds/integration/parse-sheet.d.ts +19 -0
  113. package/dist/core/format/src/kinds/integration/parse-sheet.js +24 -0
  114. package/dist/core/format/src/kinds/integration/policy.d.ts +67 -0
  115. package/dist/core/format/src/kinds/integration/policy.js +268 -0
  116. package/dist/core/format/src/kinds/integration/schema.d.ts +233 -0
  117. package/dist/core/format/src/kinds/integration/schema.js +233 -0
  118. package/dist/core/format/src/kinds/knowledge/kind.d.ts +4 -0
  119. package/dist/core/format/src/kinds/knowledge/kind.js +13 -0
  120. package/dist/core/format/src/kinds/knowledge/schema.d.ts +18 -0
  121. package/dist/core/format/src/kinds/knowledge/schema.js +25 -0
  122. package/dist/core/format/src/kinds/models/kind.d.ts +4 -0
  123. package/dist/core/format/src/kinds/models/kind.js +10 -0
  124. package/dist/core/format/src/kinds/models/schema.d.ts +92 -0
  125. package/dist/core/format/src/kinds/models/schema.js +38 -0
  126. package/dist/core/format/src/kinds/plugin/backend.d.ts +22 -0
  127. package/dist/core/format/src/kinds/plugin/backend.js +31 -0
  128. package/dist/core/format/src/kinds/plugin/checks.d.ts +13 -0
  129. package/dist/core/format/src/kinds/plugin/checks.js +131 -0
  130. package/dist/core/format/src/kinds/plugin/kind.d.ts +8 -0
  131. package/dist/core/format/src/kinds/plugin/kind.js +16 -0
  132. package/dist/core/format/src/kinds/plugin/problems.d.ts +24 -0
  133. package/dist/core/format/src/kinds/plugin/problems.js +65 -0
  134. package/dist/core/format/src/kinds/plugin/schema.d.ts +542 -0
  135. package/dist/core/format/src/kinds/plugin/schema.js +261 -0
  136. package/dist/core/format/src/kinds/plugin/setting-values.d.ts +17 -0
  137. package/dist/core/format/src/kinds/plugin/setting-values.js +38 -0
  138. package/dist/core/format/src/kinds/plugin/ui-checks.d.ts +8 -0
  139. package/dist/core/format/src/kinds/plugin/ui-checks.js +94 -0
  140. package/dist/core/format/src/kinds/provider/kind.d.ts +4 -0
  141. package/dist/core/format/src/kinds/provider/kind.js +24 -0
  142. package/dist/core/format/src/kinds/provider/schema.d.ts +17 -0
  143. package/dist/core/format/src/kinds/provider/schema.js +22 -0
  144. package/dist/core/format/src/kinds/routine/kind.d.ts +8 -0
  145. package/dist/core/format/src/kinds/routine/kind.js +25 -0
  146. package/dist/core/format/src/kinds/routine/schema.d.ts +84 -0
  147. package/dist/core/format/src/kinds/routine/schema.js +93 -0
  148. package/dist/core/format/src/kinds/runtime/kind.d.ts +4 -0
  149. package/dist/core/format/src/kinds/runtime/kind.js +13 -0
  150. package/dist/core/format/src/kinds/runtime/schema.d.ts +10 -0
  151. package/dist/core/format/src/kinds/runtime/schema.js +12 -0
  152. package/dist/core/format/src/kinds/skill/kind.d.ts +4 -0
  153. package/dist/core/format/src/kinds/skill/kind.js +10 -0
  154. package/dist/core/format/src/kinds/skill/schema.d.ts +17 -0
  155. package/dist/core/format/src/kinds/skill/schema.js +17 -0
  156. package/dist/core/format/src/kinds/skill/scripts-folder.d.ts +27 -0
  157. package/dist/core/format/src/kinds/skill/scripts-folder.js +37 -0
  158. package/dist/core/format/src/kinds/workflow/kind.d.ts +8 -0
  159. package/dist/core/format/src/kinds/workflow/kind.js +14 -0
  160. package/dist/core/format/src/kinds/workflow/schema.d.ts +162 -0
  161. package/dist/core/format/src/kinds/workflow/schema.js +106 -0
  162. package/dist/core/format/src/kinds/workflow-test/kind.d.ts +4 -0
  163. package/dist/core/format/src/kinds/workflow-test/kind.js +14 -0
  164. package/dist/core/format/src/kinds/workflow-test/schema.d.ts +67 -0
  165. package/dist/core/format/src/kinds/workflow-test/schema.js +59 -0
  166. package/dist/core/format/src/kinds/workspace/kind.d.ts +4 -0
  167. package/dist/core/format/src/kinds/workspace/kind.js +10 -0
  168. package/dist/core/format/src/kinds/workspace/schema.d.ts +72 -0
  169. package/dist/core/format/src/kinds/workspace/schema.js +66 -0
  170. package/dist/core/format/src/parse-file.d.ts +69 -0
  171. package/dist/core/format/src/parse-file.js +105 -0
  172. package/dist/core/format/src/recording/format.d.ts +81 -0
  173. package/dist/core/format/src/recording/format.js +102 -0
  174. package/dist/core/format/src/recording/index.d.ts +1 -0
  175. package/dist/core/format/src/recording/index.js +3 -0
  176. package/dist/core/format/src/registry.d.ts +64 -0
  177. package/dist/core/format/src/registry.js +61 -0
  178. package/dist/core/format/src/reserved.d.ts +20 -0
  179. package/dist/core/format/src/reserved.js +30 -0
  180. package/dist/core/format/src/shared/fields.d.ts +37 -0
  181. package/dist/core/format/src/shared/fields.js +54 -0
  182. package/dist/core/format/src/shared/guard.d.ts +32 -0
  183. package/dist/core/format/src/shared/guard.js +16 -0
  184. package/dist/core/format/src/shared/key-in-value.d.ts +28 -0
  185. package/dist/core/format/src/shared/key-in-value.js +82 -0
  186. package/dist/core/format/src/shared/legacy-keys.d.ts +8 -0
  187. package/dist/core/format/src/shared/legacy-keys.js +17 -0
  188. package/dist/core/format/src/shared/program-start.d.ts +60 -0
  189. package/dist/core/format/src/shared/program-start.js +99 -0
  190. package/dist/core/format/src/shared/relative-path.d.ts +29 -0
  191. package/dist/core/format/src/shared/relative-path.js +50 -0
  192. package/dist/core/format/src/shared/secret-name.d.ts +24 -0
  193. package/dist/core/format/src/shared/secret-name.js +107 -0
  194. package/dist/core/format/src/source.d.ts +16 -0
  195. package/dist/core/format/src/source.js +73 -0
  196. package/dist/core/ports/src/agent-placement-store.d.ts +74 -0
  197. package/dist/core/ports/src/agent-placement-store.js +27 -0
  198. package/dist/core/ports/src/blob-store.d.ts +33 -0
  199. package/dist/core/ports/src/blob-store.js +2 -0
  200. package/dist/core/ports/src/cant-try-error.d.ts +35 -0
  201. package/dist/core/ports/src/cant-try-error.js +44 -0
  202. package/dist/core/ports/src/chat.d.ts +127 -0
  203. package/dist/core/ports/src/chat.js +1 -0
  204. package/dist/core/ports/src/clock.d.ts +7 -0
  205. package/dist/core/ports/src/clock.js +2 -0
  206. package/dist/core/ports/src/connection-settings-store.d.ts +57 -0
  207. package/dist/core/ports/src/connection-settings-store.js +2 -0
  208. package/dist/core/ports/src/connector-client.d.ts +259 -0
  209. package/dist/core/ports/src/connector-client.js +2 -0
  210. package/dist/core/ports/src/coordination.d.ts +84 -0
  211. package/dist/core/ports/src/coordination.js +2 -0
  212. package/dist/core/ports/src/definition-store.d.ts +208 -0
  213. package/dist/core/ports/src/definition-store.js +122 -0
  214. package/dist/core/ports/src/digest.d.ts +14 -0
  215. package/dist/core/ports/src/digest.js +2 -0
  216. package/dist/core/ports/src/folder-reader.d.ts +89 -0
  217. package/dist/core/ports/src/folder-reader.js +2 -0
  218. package/dist/core/ports/src/harness-bridge-server.d.ts +189 -0
  219. package/dist/core/ports/src/harness-bridge-server.js +37 -0
  220. package/dist/core/ports/src/harness.d.ts +250 -0
  221. package/dist/core/ports/src/harness.js +45 -0
  222. package/dist/core/ports/src/http-client.d.ts +27 -0
  223. package/dist/core/ports/src/http-client.js +2 -0
  224. package/dist/core/ports/src/id-generator.d.ts +14 -0
  225. package/dist/core/ports/src/id-generator.js +2 -0
  226. package/dist/core/ports/src/index.d.ts +37 -0
  227. package/dist/core/ports/src/index.js +36 -0
  228. package/dist/core/ports/src/integration.d.ts +178 -0
  229. package/dist/core/ports/src/integration.js +13 -0
  230. package/dist/core/ports/src/knowledge-provider.d.ts +65 -0
  231. package/dist/core/ports/src/knowledge-provider.js +2 -0
  232. package/dist/core/ports/src/llm-cache.d.ts +13 -0
  233. package/dist/core/ports/src/llm-cache.js +2 -0
  234. package/dist/core/ports/src/llm-provider.d.ts +184 -0
  235. package/dist/core/ports/src/llm-provider.js +136 -0
  236. package/dist/core/ports/src/model-price.d.ts +34 -0
  237. package/dist/core/ports/src/model-price.js +25 -0
  238. package/dist/core/ports/src/password-hasher.d.ts +47 -0
  239. package/dist/core/ports/src/password-hasher.js +2 -0
  240. package/dist/core/ports/src/plugin-folder-writer.d.ts +104 -0
  241. package/dist/core/ports/src/plugin-folder-writer.js +95 -0
  242. package/dist/core/ports/src/port-versions.d.ts +44 -0
  243. package/dist/core/ports/src/port-versions.js +74 -0
  244. package/dist/core/ports/src/program-probe.d.ts +46 -0
  245. package/dist/core/ports/src/program-probe.js +2 -0
  246. package/dist/core/ports/src/record-store.d.ts +62 -0
  247. package/dist/core/ports/src/record-store.js +38 -0
  248. package/dist/core/ports/src/resource-probe.d.ts +59 -0
  249. package/dist/core/ports/src/resource-probe.js +2 -0
  250. package/dist/core/ports/src/run-executor.d.ts +302 -0
  251. package/dist/core/ports/src/run-executor.js +2 -0
  252. package/dist/core/ports/src/run-failure-error.d.ts +49 -0
  253. package/dist/core/ports/src/run-failure-error.js +47 -0
  254. package/dist/core/ports/src/run-store.d.ts +194 -0
  255. package/dist/core/ports/src/run-store.js +131 -0
  256. package/dist/core/ports/src/sandbox.d.ts +247 -0
  257. package/dist/core/ports/src/sandbox.js +34 -0
  258. package/dist/core/ports/src/scheduler.d.ts +85 -0
  259. package/dist/core/ports/src/scheduler.js +2 -0
  260. package/dist/core/ports/src/secrets.d.ts +128 -0
  261. package/dist/core/ports/src/secrets.js +144 -0
  262. package/dist/core/ports/src/token-store.d.ts +19 -0
  263. package/dist/core/ports/src/token-store.js +2 -0
  264. package/dist/core/ports/src/tool-approval-store.d.ts +211 -0
  265. package/dist/core/ports/src/tool-approval-store.js +57 -0
  266. package/dist/core/ports/src/trust-store.d.ts +72 -0
  267. package/dist/core/ports/src/trust-store.js +2 -0
  268. package/dist/core/ports/src/unfenced-run-consent-store.d.ts +43 -0
  269. package/dist/core/ports/src/unfenced-run-consent-store.js +2 -0
  270. package/dist/core/ports/src/vcs.d.ts +394 -0
  271. package/dist/core/ports/src/vcs.js +48 -0
  272. package/dist/core/schema-kit/src/builders.d.ts +50 -0
  273. package/dist/core/schema-kit/src/builders.js +72 -0
  274. package/dist/core/schema-kit/src/depth.d.ts +15 -0
  275. package/dist/core/schema-kit/src/depth.js +37 -0
  276. package/dist/core/schema-kit/src/index.d.ts +6 -0
  277. package/dist/core/schema-kit/src/index.js +6 -0
  278. package/dist/core/schema-kit/src/issue.d.ts +22 -0
  279. package/dist/core/schema-kit/src/issue.js +23 -0
  280. package/dist/core/schema-kit/src/json-schema.d.ts +23 -0
  281. package/dist/core/schema-kit/src/json-schema.js +22 -0
  282. package/dist/core/schema-kit/src/parse.d.ts +17 -0
  283. package/dist/core/schema-kit/src/parse.js +25 -0
  284. package/dist/core/schema-kit/src/schema.d.ts +12 -0
  285. package/dist/core/schema-kit/src/schema.js +1 -0
  286. package/dist/core/std/src/ascii-host.d.ts +18 -0
  287. package/dist/core/std/src/ascii-host.js +110 -0
  288. package/dist/core/std/src/assert.d.ts +39 -0
  289. package/dist/core/std/src/assert.js +59 -0
  290. package/dist/core/std/src/base64url.d.ts +23 -0
  291. package/dist/core/std/src/base64url.js +65 -0
  292. package/dist/core/std/src/canonical-json.d.ts +18 -0
  293. package/dist/core/std/src/canonical-json.js +56 -0
  294. package/dist/core/std/src/clock.d.ts +27 -0
  295. package/dist/core/std/src/clock.js +33 -0
  296. package/dist/core/std/src/constant-time.d.ts +16 -0
  297. package/dist/core/std/src/constant-time.js +26 -0
  298. package/dist/core/std/src/content-digest.d.ts +24 -0
  299. package/dist/core/std/src/content-digest.js +28 -0
  300. package/dist/core/std/src/deep-clone.d.ts +15 -0
  301. package/dist/core/std/src/deep-clone.js +59 -0
  302. package/dist/core/std/src/deep-equal.d.ts +23 -0
  303. package/dist/core/std/src/deep-equal.js +64 -0
  304. package/dist/core/std/src/emitter.d.ts +42 -0
  305. package/dist/core/std/src/emitter.js +74 -0
  306. package/dist/core/std/src/error-kind.d.ts +88 -0
  307. package/dist/core/std/src/error-kind.js +98 -0
  308. package/dist/core/std/src/hex.d.ts +10 -0
  309. package/dist/core/std/src/hex.js +16 -0
  310. package/dist/core/std/src/ids.d.ts +45 -0
  311. package/dist/core/std/src/ids.js +49 -0
  312. package/dist/core/std/src/index.d.ts +25 -0
  313. package/dist/core/std/src/index.js +26 -0
  314. package/dist/core/std/src/keyed-queue.d.ts +18 -0
  315. package/dist/core/std/src/keyed-queue.js +32 -0
  316. package/dist/core/std/src/line-diff.d.ts +83 -0
  317. package/dist/core/std/src/line-diff.js +179 -0
  318. package/dist/core/std/src/line-merge.d.ts +63 -0
  319. package/dist/core/std/src/line-merge.js +138 -0
  320. package/dist/core/std/src/plain-data.d.ts +32 -0
  321. package/dist/core/std/src/plain-data.js +57 -0
  322. package/dist/core/std/src/posix-path.d.ts +61 -0
  323. package/dist/core/std/src/posix-path.js +121 -0
  324. package/dist/core/std/src/result.d.ts +55 -0
  325. package/dist/core/std/src/result.js +52 -0
  326. package/dist/core/std/src/secret-scrubber.d.ts +54 -0
  327. package/dist/core/std/src/secret-scrubber.js +124 -0
  328. package/dist/core/std/src/secret-shape.d.ts +20 -0
  329. package/dist/core/std/src/secret-shape.js +53 -0
  330. package/dist/core/std/src/stop-signal.d.ts +44 -0
  331. package/dist/core/std/src/stop-signal.js +77 -0
  332. package/dist/core/std/src/text.d.ts +28 -0
  333. package/dist/core/std/src/text.js +54 -0
  334. package/dist/core/std/src/utf8.d.ts +23 -0
  335. package/dist/core/std/src/utf8.js +110 -0
  336. package/dist/core/std/src/version.d.ts +48 -0
  337. package/dist/core/std/src/version.js +103 -0
  338. package/dist/core/yaml/src/depth.d.ts +14 -0
  339. package/dist/core/yaml/src/depth.js +140 -0
  340. package/dist/core/yaml/src/edit-data.d.ts +47 -0
  341. package/dist/core/yaml/src/edit-data.js +286 -0
  342. package/dist/core/yaml/src/edit-text.d.ts +92 -0
  343. package/dist/core/yaml/src/edit-text.js +267 -0
  344. package/dist/core/yaml/src/edit.d.ts +47 -0
  345. package/dist/core/yaml/src/edit.js +198 -0
  346. package/dist/core/yaml/src/index.d.ts +5 -0
  347. package/dist/core/yaml/src/index.js +4 -0
  348. package/dist/core/yaml/src/problem.d.ts +20 -0
  349. package/dist/core/yaml/src/problem.js +1 -0
  350. package/dist/core/yaml/src/read.d.ts +47 -0
  351. package/dist/core/yaml/src/read.js +130 -0
  352. package/dist/core/yaml/src/splice-node.d.ts +47 -0
  353. package/dist/core/yaml/src/splice-node.js +333 -0
  354. package/dist/core/yaml/src/splice.d.ts +13 -0
  355. package/dist/core/yaml/src/splice.js +174 -0
  356. package/dist/core/yaml/src/unsupported.d.ts +26 -0
  357. package/dist/core/yaml/src/unsupported.js +70 -0
  358. package/dist/core/yaml/src/write.d.ts +35 -0
  359. package/dist/core/yaml/src/write.js +44 -0
  360. package/dist/testing/integration/src/canaries.d.ts +14 -0
  361. package/dist/testing/integration/src/canaries.js +17 -0
  362. package/dist/testing/integration/src/checks.d.ts +37 -0
  363. package/dist/testing/integration/src/checks.js +195 -0
  364. package/dist/testing/integration/src/describe.d.ts +35 -0
  365. package/dist/testing/integration/src/describe.js +74 -0
  366. package/dist/testing/integration/src/failure.d.ts +6 -0
  367. package/dist/testing/integration/src/failure.js +8 -0
  368. package/dist/testing/integration/src/fake-wait.d.ts +18 -0
  369. package/dist/testing/integration/src/fake-wait.js +21 -0
  370. package/dist/testing/integration/src/index.d.ts +10 -0
  371. package/dist/testing/integration/src/index.js +11 -0
  372. package/dist/testing/integration/src/load.d.ts +14 -0
  373. package/dist/testing/integration/src/load.js +45 -0
  374. package/dist/testing/integration/src/plugin-folder.d.ts +23 -0
  375. package/dist/testing/integration/src/plugin-folder.js +59 -0
  376. package/dist/testing/integration/src/plugin.d.ts +32 -0
  377. package/dist/testing/integration/src/plugin.js +57 -0
  378. package/dist/testing/integration/src/recording.d.ts +84 -0
  379. package/dist/testing/integration/src/recording.js +164 -0
  380. package/dist/testing/integration/src/run.d.ts +60 -0
  381. package/dist/testing/integration/src/run.js +81 -0
  382. package/dist/testing/integration/src/source-scan.d.ts +16 -0
  383. package/dist/testing/integration/src/source-scan.js +40 -0
  384. package/package.json +34 -3
@@ -0,0 +1,434 @@
1
+ import type { AgentResume } from "./agent-resume.js";
2
+ import type { ApprovalResolver, CantTryStep, ModelSkipReason, ProviderText, RunFailureReason, RunKind, RunParent, RunTrigger, RunVersion, StoredBlob, ToolNoun, ToolOutcome, ToolRefusalReason, ToolRisk, Usage } from "./run-basics.js";
3
+ import type { LoggedSandboxBlock } from "./sandbox-blocked.js";
4
+ import type { SandboxOpenedView } from "./sandbox-opened.js";
5
+ /** The fields every event in a run log has, whatever its type. */
6
+ export interface RunEventBase {
7
+ runId: string;
8
+ /** Position in the stream, starting at 1. */
9
+ seq: number;
10
+ /** ISO timestamp. */
11
+ at: string;
12
+ /** Set on events of one branch of a parallel state. */
13
+ branch?: string;
14
+ /** Set on events of one item of a for-each state (0-based). */
15
+ item?: number;
16
+ /**
17
+ * The timeline entry this event belongs to: the `seq` of the event that
18
+ * opened the entry. On an opening event it equals `seq`. Logs written
19
+ * before this field existed don't have it; read them with `entryOf`.
20
+ */
21
+ entry?: number;
22
+ }
23
+ /** What one event says, by its `type`. A run log is a list of these, each with a {@link RunEventBase}. */
24
+ export type RunEventBody = {
25
+ type: "run.started";
26
+ hubId: string;
27
+ /** Workflow id, or "agent:<agentId>" for a run of a single agent. */
28
+ workflowId: string;
29
+ input: Record<string, unknown>;
30
+ kind: RunKind;
31
+ definitionsVersion: string;
32
+ trigger?: RunTrigger;
33
+ /** Set when a workflow state of another run started this one (a subflow). */
34
+ parent?: RunParent;
35
+ /**
36
+ * The harness every task agent of the run runs in, whatever its file
37
+ * names, such as `codex`; `halonic` runs them all in Halonic's own loop
38
+ * (requirement `events.run-started-harness`). Absent when the run keeps
39
+ * each agent's own harness, and in older logs.
40
+ */
41
+ harness?: string;
42
+ /**
43
+ * The steps of a Try it or Test run that can't be tried, as found when
44
+ * the run's item was loaded, so a timeline can mark them straight away
45
+ * (requirement `events.run-cant-try`). Absent when there are none, and
46
+ * in older logs.
47
+ */
48
+ cantTry?: CantTryStep[];
49
+ /**
50
+ * Which version of the workspace the run read: the live version, with
51
+ * its commit and date, or the saved files (requirement
52
+ * `events.run-started-version`). A child run has its parent's. Absent
53
+ * in logs written before it was recorded: read that as "not
54
+ * recorded", never as the saved files.
55
+ */
56
+ version?: RunVersion;
57
+ } | {
58
+ type: "state.entered";
59
+ state: string;
60
+ }
61
+ /** `parent`: the agent that delegated this one (subagents); absent for the state's own agent. */
62
+ | {
63
+ type: "agent.started";
64
+ state: string;
65
+ agent: string;
66
+ prompt: string;
67
+ parent?: string;
68
+ } | {
69
+ type: "llm.request";
70
+ agent: string;
71
+ provider: string;
72
+ model: string;
73
+ messages: number;
74
+ } | {
75
+ type: "llm.response";
76
+ agent: string;
77
+ provider: string;
78
+ model: string;
79
+ usage: Usage;
80
+ /**
81
+ * From the request to the answer, including the time spent on any model
82
+ * that failed before the call fell back to the one that answered.
83
+ */
84
+ latencyMs: number;
85
+ text: string;
86
+ /** The model's summary of its reasoning, when it gives one. */
87
+ thoughts?: string;
88
+ /**
89
+ * In the budget currency, when the model has a price. On a call marked
90
+ * with `paidBy`, `0` means Halonic paid nothing for it, not that the
91
+ * model is free.
92
+ */
93
+ cost?: number;
94
+ /**
95
+ * Who paid for the call when it wasn't Halonic: `"subscription"` when
96
+ * the person's own subscription did, through the harness bridge's
97
+ * sign-in. Such a call has its tokens but no price, counts in the run's
98
+ * `subscriptionCalls` and never towards `cost` or a budget (requirement
99
+ * `events.summary-cost`). Absent otherwise.
100
+ */
101
+ paidBy?: "subscription";
102
+ /** Answered from the cache (a simulation re-run), not by the model. */
103
+ cached?: boolean;
104
+ /**
105
+ * The answer made no tool call, but its text is a call to a tool the
106
+ * step offered, written out as JSON (requirement
107
+ * `events.tool-call-as-text`). That call never runs. Absent otherwise.
108
+ */
109
+ toolCallAsText?: true;
110
+ }
111
+ /**
112
+ * The call moved on to the next model. `providerText`: the provider's own
113
+ * error text, for `--debug` and Copy details only (requirement
114
+ * `events.provider-text`); absent in older logs and when it gave none.
115
+ */
116
+ | {
117
+ type: "llm.fallback";
118
+ agent: string;
119
+ from: string;
120
+ to: string;
121
+ error: string;
122
+ providerText?: ProviderText;
123
+ }
124
+ /**
125
+ * A model alias was skipped before any call (requirement
126
+ * `events.llm-skipped`), such as "smart: no key, using default". `next` is
127
+ * the alias tried instead; absent when none is left.
128
+ */
129
+ | {
130
+ type: "llm.skipped";
131
+ agent: string;
132
+ alias: string;
133
+ provider: string;
134
+ model: string;
135
+ reason: ModelSkipReason;
136
+ next?: string;
137
+ } | {
138
+ type: "tool.called";
139
+ agent: string;
140
+ tool: string;
141
+ args: unknown;
142
+ }
143
+ /**
144
+ * A model's tool call was refused before it ran, so it reached nothing
145
+ * (requirement `events.tool-refused`). `tool`: the name exactly as the
146
+ * model wrote it, which may hold look-alike or control characters.
147
+ * `toolCallId`: the model's id for the call. A refused call has no
148
+ * `tool.called` or `tool.result`.
149
+ */
150
+ | {
151
+ type: "tool.refused";
152
+ agent: string;
153
+ tool: string;
154
+ toolCallId: string;
155
+ reason: ToolRefusalReason;
156
+ }
157
+ /**
158
+ * A step's sandbox is being opened (requirement `events.started-events`).
159
+ * Written before the call, so a screen can say what the step waits for;
160
+ * `timeoutMs` is how long the engine waits before the step fails.
161
+ */
162
+ | {
163
+ type: "sandbox.started";
164
+ state: string;
165
+ agent: string;
166
+ timeoutMs: number;
167
+ }
168
+ /**
169
+ * A step's harness program is being started (requirement
170
+ * `events.started-events`). `harness` is the agent's harness id, such as
171
+ * `"claude-code"`; `timeoutMs` is how long the engine waits for its first event.
172
+ */
173
+ | {
174
+ type: "harness.started";
175
+ state: string;
176
+ agent: string;
177
+ harness: string;
178
+ timeoutMs: number;
179
+ }
180
+ /**
181
+ * A step's sandbox opened (requirement `events.sandbox-opened`). `sandbox`
182
+ * is a display copy of its profile, never its environment variables.
183
+ */
184
+ | {
185
+ type: "sandbox.opened";
186
+ state: string;
187
+ agent: string;
188
+ sandbox: SandboxOpenedView;
189
+ }
190
+ /**
191
+ * A step ran without the sandbox because a person chose to run the agent
192
+ * on this computer (requirement `events.sandbox-off`). `chosenAt` is when
193
+ * they made that choice, as an ISO 8601 date and time. Logs written before
194
+ * this event have neither it nor `sandbox.opened`.
195
+ */
196
+ | {
197
+ type: "sandbox.off";
198
+ state: string;
199
+ agent: string;
200
+ chosenAt: string;
201
+ }
202
+ /**
203
+ * A step's sandbox refused an access (requirement `events.sandbox-blocked`).
204
+ * `count` is the running total of refused accesses to this target (or to
205
+ * `others`) in the step so far: the engine logs a target's first block at
206
+ * once and the total at the end of the step. A later event replaces an
207
+ * earlier count, it doesn't add to it: events with 1 and then 7 for one
208
+ * target mean 7 refused accesses.
209
+ */
210
+ | {
211
+ type: "sandbox.blocked";
212
+ state: string;
213
+ agent: string;
214
+ block: LoggedSandboxBlock;
215
+ count: number;
216
+ }
217
+ /**
218
+ * A step is about to call a connector's program (requirement `events.connector-started`).
219
+ * `connector`: its id in the workspace. `timeoutMs`: how long the engine waits for it; every
220
+ * wait has a limit. Logged before the call, so a screen can say what the step is waiting for.
221
+ */
222
+ | {
223
+ type: "connector.started";
224
+ state: string;
225
+ agent: string;
226
+ connector: string;
227
+ timeoutMs: number;
228
+ }
229
+ /**
230
+ * A step is about to make a connector call that can change things
231
+ * (requirement `events.effect-requested`). Written before the call, so a
232
+ * call with this record and no `tool.result` may or may not have done its
233
+ * work. `callId`: the engine's id for the call, `call-<n>`, unique in the
234
+ * run. `idempotencyKey`: `<runId>:<callId>`, the same when a person has
235
+ * the call tried again. `resume`: where the agent goes on once the call
236
+ * has a result.
237
+ */
238
+ | {
239
+ type: "effect.requested";
240
+ state: string;
241
+ agent: string;
242
+ connector: string;
243
+ tool: string;
244
+ args: unknown;
245
+ callId: string;
246
+ idempotencyKey: string;
247
+ resume: AgentResume;
248
+ /** The subagent whose call it is (requirement `events.agent-resume-inner`); absent for the state's own agent. */
249
+ subagent?: string;
250
+ }
251
+ /** A knowledge source in "auto" mode was searched with the task before the first model call. */
252
+ | {
253
+ type: "knowledge.searched";
254
+ agent: string;
255
+ source: string;
256
+ query: string;
257
+ refs: string[];
258
+ }
259
+ /**
260
+ * `outcome`: how the call ended (requirement `events.tool-result-outcome`).
261
+ * `risk` and `noun`: what the tool can do and what one call sends, copied
262
+ * from its integration's sheet when the call ends (requirement
263
+ * `events.tool-result-risk`). Each is absent in older logs, and `risk` and
264
+ * `noun` for a tool without a sheet.
265
+ * `resultBlob`: set when the result was too large for the log; `result`
266
+ * then holds only its start, and the whole result is in the blob store
267
+ * (requirement `events.tool-result-blob`).
268
+ */
269
+ | {
270
+ type: "tool.result";
271
+ agent: string;
272
+ tool: string;
273
+ result: string;
274
+ outcome?: ToolOutcome;
275
+ risk?: ToolRisk;
276
+ noun?: ToolNoun;
277
+ resultBlob?: StoredBlob;
278
+ }
279
+ /** A connector tool call that needs a person's OK; the run waits for "approve" or "reject". */
280
+ | {
281
+ type: "approval.requested";
282
+ state: string;
283
+ agent: string;
284
+ tool: string;
285
+ args: unknown;
286
+ callId: string;
287
+ resume: AgentResume;
288
+ /** The subagent whose call it is (requirement `events.agent-resume-inner`); absent for the state's own agent. */
289
+ subagent?: string;
290
+ } | {
291
+ type: "approval.resolved";
292
+ state: string;
293
+ agent: string;
294
+ tool: string;
295
+ callId: string;
296
+ approved: boolean;
297
+ comment?: string;
298
+ /** Who resolved it (requirement `events.approval-resolved-by`); absent in older logs. */
299
+ by?: ApprovalResolver;
300
+ }
301
+ /**
302
+ * `error` and `reason`: set when the agent failed without failing the run,
303
+ * as a parallel branch does; `output` is then `null` (requirement
304
+ * `events.agent-finished-error`). Absent in older logs and for an agent
305
+ * that answered.
306
+ * `cantTry`: set instead of `reason` when the agent's step couldn't be
307
+ * tried (requirement `events.run-cant-try`), as a parallel branch reports it.
308
+ */
309
+ | {
310
+ type: "agent.finished";
311
+ state: string;
312
+ agent: string;
313
+ output: unknown;
314
+ parent?: string;
315
+ error?: string;
316
+ reason?: RunFailureReason;
317
+ cantTry?: CantTryStep;
318
+ } | {
319
+ type: "artifact.created";
320
+ state: string;
321
+ name: string;
322
+ hash: string;
323
+ mediaType: string;
324
+ size: number;
325
+ } | {
326
+ type: "context.updated";
327
+ key: string;
328
+ value: unknown;
329
+ }
330
+ /** A step sent a signal; routines with a signal trigger start on it. */
331
+ | {
332
+ type: "signal.sent";
333
+ state: string;
334
+ name: string;
335
+ data: Record<string, unknown>;
336
+ } | {
337
+ type: "transition";
338
+ from: string;
339
+ to: string;
340
+ event: string;
341
+ }
342
+ /** A workflow state started a child run; it finishes with workflow.finished. */
343
+ | {
344
+ type: "workflow.started";
345
+ state: string;
346
+ workflow: string;
347
+ childRunId: string;
348
+ } | {
349
+ type: "workflow.finished";
350
+ state: string;
351
+ workflow: string;
352
+ childRunId: string;
353
+ /** `cant-try` when the child ended with `run.cant-try` (requirement `events.run-cant-try`). */
354
+ status: "completed" | "failed" | "cant-try";
355
+ error?: string;
356
+ /**
357
+ * The child's final context, set when it completed as one item of a
358
+ * for-each state (requirement `events.workflow-finished-context`);
359
+ * absent otherwise and in older logs.
360
+ */
361
+ context?: Record<string, unknown>;
362
+ }
363
+ /**
364
+ * `child`: the run is waiting because this child run waits; events go to it.
365
+ * `title` and `body`: the wait step's description, filled in against the
366
+ * run when it started waiting (requirement `events.waiting-description`).
367
+ * The filled-in values can be model output: show them as plain text.
368
+ * `labels`: event → the label the step's author gave that answer, for the
369
+ * events that have one (requirement `events.answer-labels`).
370
+ */
371
+ | {
372
+ type: "run.waiting";
373
+ state: string;
374
+ events: string[];
375
+ child?: string;
376
+ timers?: {
377
+ after: string;
378
+ at: string;
379
+ }[];
380
+ title?: string;
381
+ body?: string;
382
+ labels?: Record<string, string>;
383
+ }
384
+ /** A timer transition (`after`) of a wait state fired. */
385
+ | {
386
+ type: "timer.fired";
387
+ state: string;
388
+ after: string;
389
+ } | {
390
+ type: "event.received";
391
+ event: string;
392
+ payload?: unknown;
393
+ } | {
394
+ type: "run.completed";
395
+ state: string;
396
+ context: Record<string, unknown>;
397
+ }
398
+ /**
399
+ * `reason`: why the run failed (requirement `events.run-failed-reason`); absent in older logs.
400
+ * `host`: with `model-unreachable` only, the host and port that didn't answer, such as
401
+ * `localhost:11434` (requirement `events.run-failed-model-unreachable`).
402
+ * `sandboxReason`: with `sandbox-not-ready` only, why the sandbox can't start, as the `Sandbox`
403
+ * port's reason code, such as `bubblewrap-missing` (requirement `events.run-failed-sandbox-not-ready`).
404
+ * A reader that doesn't know the code reads it as `other`.
405
+ * `providerText`: the model provider's own error text, for `--debug` and Copy details only
406
+ * (requirement `events.provider-text`); absent in older logs and when it gave none.
407
+ */
408
+ | {
409
+ type: "run.failed";
410
+ state: string | null;
411
+ error: string;
412
+ reason?: RunFailureReason;
413
+ host?: string;
414
+ sandboxReason?: string;
415
+ providerText?: ProviderText;
416
+ }
417
+ /**
418
+ * A Try it or Test run ended at a step it couldn't try, and nothing in it
419
+ * really failed (requirement `events.run-cant-try`). `cantTry` lists every
420
+ * such step: the ones found when the item was loaded and the ones found
421
+ * while running. A run with a real failure ends with `run.failed` instead.
422
+ */
423
+ | {
424
+ type: "run.cant-try";
425
+ state: string | null;
426
+ cantTry: CantTryStep[];
427
+ };
428
+ /**
429
+ * One entry of a run log. Every run is an append-only stream of these; the
430
+ * timeline, cost reports, test assertions and replays all read that one stream.
431
+ */
432
+ export type RunEvent = RunEventBase & RunEventBody;
433
+ /** The name of an event, such as `"run.started"`. */
434
+ export type RunEventType = RunEvent["type"];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,108 @@
1
+ import type { CantTryStep, RunFailureReason, RunKind, RunStatus, RunTrigger, Usage } from "./run-basics.js";
2
+ /** A tool call a run is waiting on a person's OK for, from its `approval.requested` event. */
3
+ export interface PendingApproval {
4
+ /** The state's agent: the one that asked, or the one whose subagent asked. */
5
+ agent: string;
6
+ /**
7
+ * The subagent that asked, when it was one (requirement
8
+ * `events.agent-resume-inner`); absent when `agent` asked itself.
9
+ */
10
+ subagent?: string;
11
+ tool: string;
12
+ args: unknown;
13
+ callId: string;
14
+ /** ISO time the approval was asked for. */
15
+ at: string;
16
+ /** The state whose agent asked. */
17
+ state: string;
18
+ /** The parallel branch that asked, or `null` outside a parallel state. */
19
+ branch: string | null;
20
+ /** The for-each item that asked (0-based), or `null` outside a for-each state. */
21
+ item: number | null;
22
+ }
23
+ /** A signal a run sent. `id` is "<runId>:<seq>" of its `signal.sent` event. */
24
+ export interface SentSignal {
25
+ id: string;
26
+ name: string;
27
+ data: Record<string, unknown>;
28
+ at: string;
29
+ }
30
+ /** Summary of a run, derived from its events by {@link summarize}. */
31
+ export interface RunSummary {
32
+ id: string;
33
+ hubId: string;
34
+ workflowId: string;
35
+ kind: RunKind;
36
+ status: RunStatus;
37
+ state: string | null;
38
+ startedAt: string;
39
+ endedAt: string | null;
40
+ usage: Usage;
41
+ /** Sum of the priced model calls, in the budget currency. Subscription calls aren't in it. */
42
+ cost: number;
43
+ /** Model calls without a price (their cost is unknown). Subscription calls aren't counted here. */
44
+ unpricedCalls: number;
45
+ /**
46
+ * Model calls the person's own subscription paid for (`paidBy:
47
+ * "subscription"`). Their tokens are in `usage`; they have no price and
48
+ * are in neither `cost` nor `unpricedCalls`.
49
+ */
50
+ subscriptionCalls: number;
51
+ statesVisited: string[];
52
+ context: Record<string, unknown>;
53
+ error: string | null;
54
+ /**
55
+ * Why the run failed, from its `run.failed` event. `null` while it hasn't
56
+ * failed, and for older logs whose `run.failed` gives no reason.
57
+ */
58
+ reason: RunFailureReason | null;
59
+ definitionsVersion: string;
60
+ trigger: RunTrigger | null;
61
+ /** The run that started this one (subflows). */
62
+ parentRunId: string | null;
63
+ /** While waiting: the child run that waits (send events there, or here; they are passed on). */
64
+ waitingOn: string | null;
65
+ /** Events the run accepts while waiting. */
66
+ accepts: string[];
67
+ /**
68
+ * While waiting: event → the label the wait step's author gave that answer,
69
+ * for the events in `accepts` that have one. Show a label in place of its
70
+ * event name; `{}` when none has one, and in older logs.
71
+ */
72
+ answerLabels: Record<string, string>;
73
+ /** While waiting: when the next timer is due (ISO), if the state has timers. */
74
+ nextTimer: string | null;
75
+ /**
76
+ * While waiting: the wait step's description, filled in, as its first line
77
+ * (`title`) and the rest (`body`); `null` when the step has none. The
78
+ * filled-in values can be model output: show them as plain text.
79
+ */
80
+ waitingFor: {
81
+ title: string;
82
+ body: string;
83
+ } | null;
84
+ /** ISO time of the last `run.waiting`, kept after the run goes on; `null` if it never waited. */
85
+ lastWaitingAt: string | null;
86
+ /**
87
+ * The tool calls waiting for approval, oldest first. Parallel branches can
88
+ * each wait for one, so there can be more than one.
89
+ */
90
+ approvals: PendingApproval[];
91
+ /** Signals the run sent, in order (for signal triggers). */
92
+ signals: SentSignal[];
93
+ /**
94
+ * The steps of a Try it or Test run that couldn't be tried, from
95
+ * `run.started`, a parallel branch's `agent.finished` and `run.cant-try`.
96
+ * Kept when a real failure ends the run as `failed`. `[]` for any other
97
+ * run, and in older logs.
98
+ */
99
+ cantTry: CantTryStep[];
100
+ /**
101
+ * Sequence number of the run's last event. A writer appends after it, and a
102
+ * client subscribes from it. Not in the old summary; derived, so the run
103
+ * log doesn't change.
104
+ */
105
+ lastSeq: number;
106
+ /** ISO time of the run's last event, so a watchdog can find runs that stopped moving. */
107
+ updatedAt: string;
108
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,42 @@
1
+ /**
2
+ * An access a step's sandbox refused, as the `Sandbox` port reports it: a
3
+ * file read or write, or a connection to a site. A copy of the port's
4
+ * `SandboxBlock`, so this package doesn't depend on the ports.
5
+ */
6
+ export type SandboxBlock = {
7
+ kind: "file";
8
+ path: string;
9
+ access: "read" | "write";
10
+ } | {
11
+ kind: "network";
12
+ host: string;
13
+ port: number | null;
14
+ };
15
+ /**
16
+ * What a `sandbox.blocked` event names: one blocked target, or `others`, the
17
+ * blocked accesses to the targets past the ones a step's log names.
18
+ */
19
+ export type LoggedSandboxBlock = SandboxBlock | {
20
+ kind: "others";
21
+ };
22
+ /**
23
+ * The most distinct targets one step's run log names in `sandbox.blocked`
24
+ * events. Blocks of further targets are counted in one `others` event, so a
25
+ * program that tries many files can't flood the log.
26
+ */
27
+ export declare const maxBlockedTargetsPerStep = 100;
28
+ /**
29
+ * Makes the copy of a blocked access that a `sandbox.blocked` event carries
30
+ * (requirement `events.sandbox-blocked`): a file path in the person's home
31
+ * folder starts with `~`, the way `sandbox.opened` writes paths. A site is
32
+ * copied as it is.
33
+ *
34
+ * @param block - the access the sandbox refused
35
+ * @param home - the person's home folder, or `null` when it is unknown
36
+ * @returns the block for the event
37
+ *
38
+ * @example
39
+ * sandboxBlockedView({ kind: "file", path: "<home>/.ssh/id_ed25519", access: "read" }, "<home>");
40
+ * // => { kind: "file", path: "~/.ssh/id_ed25519", access: "read" }
41
+ */
42
+ export declare function sandboxBlockedView(block: SandboxBlock, home: string | null): SandboxBlock;
@@ -0,0 +1,26 @@
1
+ import { shortenHome } from "./home-path.js";
2
+ /**
3
+ * The most distinct targets one step's run log names in `sandbox.blocked`
4
+ * events. Blocks of further targets are counted in one `others` event, so a
5
+ * program that tries many files can't flood the log.
6
+ */
7
+ export const maxBlockedTargetsPerStep = 100;
8
+ /**
9
+ * Makes the copy of a blocked access that a `sandbox.blocked` event carries
10
+ * (requirement `events.sandbox-blocked`): a file path in the person's home
11
+ * folder starts with `~`, the way `sandbox.opened` writes paths. A site is
12
+ * copied as it is.
13
+ *
14
+ * @param block - the access the sandbox refused
15
+ * @param home - the person's home folder, or `null` when it is unknown
16
+ * @returns the block for the event
17
+ *
18
+ * @example
19
+ * sandboxBlockedView({ kind: "file", path: "<home>/.ssh/id_ed25519", access: "read" }, "<home>");
20
+ * // => { kind: "file", path: "~/.ssh/id_ed25519", access: "read" }
21
+ */
22
+ export function sandboxBlockedView(block, home) {
23
+ if (block.kind === "network")
24
+ return { kind: "network", host: block.host, port: block.port };
25
+ return { kind: "file", path: shortenHome(block.path, home), access: block.access };
26
+ }
@@ -0,0 +1,17 @@
1
+ import { type SandboxOpenedView } from "./sandbox-opened.js";
2
+ /**
3
+ * Reads the `sandbox` of a stored `sandbox.opened` event (requirement
4
+ * `events.sandbox-opened`). It never throws: a value that is damaged, from
5
+ * another version or missing a field gives `null`, so a screen says it
6
+ * couldn't read what the step could do instead of showing part of it. It
7
+ * copies only the view's fields, so an extra field in a damaged log never
8
+ * reaches a screen either.
9
+ *
10
+ * @param value - the event's `sandbox`, as parsed from the log
11
+ * @returns the view, or `null` when it can't be read
12
+ *
13
+ * @example
14
+ * readSandboxOpened({ strength: "os", workingFolder: "~/work", ... }); // => { strength: "os", ... }
15
+ * readSandboxOpened("damaged"); // => null
16
+ */
17
+ export declare function readSandboxOpened(value: unknown): SandboxOpenedView | null;