@halonicjs/testing 0.0.0 → 0.1.1

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 (438) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/README.md +41 -1
  4. package/dist/adapters/http-kit/src/address-checking.d.ts +19 -0
  5. package/dist/adapters/http-kit/src/address-checking.js +1 -0
  6. package/dist/adapters/http-kit/src/address-class.d.ts +34 -0
  7. package/dist/adapters/http-kit/src/address-class.js +109 -0
  8. package/dist/adapters/http-kit/src/index.d.ts +3 -0
  9. package/dist/adapters/http-kit/src/index.js +2 -0
  10. package/dist/adapters/http-kit/src/ip-address.d.ts +23 -0
  11. package/dist/adapters/http-kit/src/ip-address.js +89 -0
  12. package/dist/adapters/integration-kit/src/auth-placement.d.ts +40 -0
  13. package/dist/adapters/integration-kit/src/auth-placement.js +102 -0
  14. package/dist/adapters/integration-kit/src/current-secret-forms.d.ts +28 -0
  15. package/dist/adapters/integration-kit/src/current-secret-forms.js +60 -0
  16. package/dist/adapters/integration-kit/src/declaration.d.ts +15 -0
  17. package/dist/adapters/integration-kit/src/declaration.js +78 -0
  18. package/dist/adapters/integration-kit/src/host.d.ts +34 -0
  19. package/dist/adapters/integration-kit/src/host.js +31 -0
  20. package/dist/adapters/integration-kit/src/index.d.ts +16 -0
  21. package/dist/adapters/integration-kit/src/index.js +22 -0
  22. package/dist/adapters/integration-kit/src/leak-attempt.d.ts +16 -0
  23. package/dist/adapters/integration-kit/src/leak-attempt.js +19 -0
  24. package/dist/adapters/integration-kit/src/limited-http.d.ts +55 -0
  25. package/dist/adapters/integration-kit/src/limited-http.js +225 -0
  26. package/dist/adapters/integration-kit/src/load-problem.d.ts +20 -0
  27. package/dist/adapters/integration-kit/src/load-problem.js +1 -0
  28. package/dist/adapters/integration-kit/src/loader.d.ts +131 -0
  29. package/dist/adapters/integration-kit/src/loader.js +251 -0
  30. package/dist/adapters/integration-kit/src/local-address.d.ts +15 -0
  31. package/dist/adapters/integration-kit/src/local-address.js +25 -0
  32. package/dist/adapters/integration-kit/src/own-request.d.ts +33 -0
  33. package/dist/adapters/integration-kit/src/own-request.js +36 -0
  34. package/dist/adapters/integration-kit/src/plugin-load.d.ts +14 -0
  35. package/dist/adapters/integration-kit/src/plugin-load.js +58 -0
  36. package/dist/adapters/integration-kit/src/policy.d.ts +83 -0
  37. package/dist/adapters/integration-kit/src/policy.js +37 -0
  38. package/dist/adapters/integration-kit/src/request-body.d.ts +38 -0
  39. package/dist/adapters/integration-kit/src/request-body.js +68 -0
  40. package/dist/adapters/integration-kit/src/request-log.d.ts +25 -0
  41. package/dist/adapters/integration-kit/src/request-log.js +17 -0
  42. package/dist/adapters/integration-kit/src/response-body.d.ts +27 -0
  43. package/dist/adapters/integration-kit/src/response-body.js +117 -0
  44. package/dist/adapters/integration-kit/src/scoped-tokens.d.ts +14 -0
  45. package/dist/adapters/integration-kit/src/scoped-tokens.js +27 -0
  46. package/dist/adapters/integration-kit/src/secret-filter.d.ts +84 -0
  47. package/dist/adapters/integration-kit/src/secret-filter.js +220 -0
  48. package/dist/adapters/integration-kit/src/secret-in-request.d.ts +62 -0
  49. package/dist/adapters/integration-kit/src/secret-in-request.js +139 -0
  50. package/dist/adapters/integration-kit/src/secret-placement.d.ts +46 -0
  51. package/dist/adapters/integration-kit/src/secret-placement.js +160 -0
  52. package/dist/adapters/integration-kit/src/sign-in-placement.d.ts +29 -0
  53. package/dist/adapters/integration-kit/src/sign-in-placement.js +92 -0
  54. package/dist/adapters/integration-kit/src/wait.d.ts +16 -0
  55. package/dist/adapters/integration-kit/src/wait.js +35 -0
  56. package/dist/core/events/src/add-usage.d.ts +10 -0
  57. package/dist/core/events/src/add-usage.js +27 -0
  58. package/dist/core/events/src/agent-resume.d.ts +24 -0
  59. package/dist/core/events/src/agent-resume.js +1 -0
  60. package/dist/core/events/src/blocked-sites.d.ts +57 -0
  61. package/dist/core/events/src/blocked-sites.js +89 -0
  62. package/dist/core/events/src/home-path.d.ts +13 -0
  63. package/dist/core/events/src/home-path.js +26 -0
  64. package/dist/core/events/src/index.d.ts +17 -0
  65. package/dist/core/events/src/index.js +10 -0
  66. package/dist/core/events/src/run-basics.d.ts +228 -0
  67. package/dist/core/events/src/run-basics.js +1 -0
  68. package/dist/core/events/src/run-event.d.ts +478 -0
  69. package/dist/core/events/src/run-event.js +1 -0
  70. package/dist/core/events/src/run-reads.d.ts +25 -0
  71. package/dist/core/events/src/run-reads.js +44 -0
  72. package/dist/core/events/src/run-sends.d.ts +47 -0
  73. package/dist/core/events/src/run-sends.js +68 -0
  74. package/dist/core/events/src/run-summary.d.ts +108 -0
  75. package/dist/core/events/src/run-summary.js +1 -0
  76. package/dist/core/events/src/sandbox-blocked.d.ts +42 -0
  77. package/dist/core/events/src/sandbox-blocked.js +26 -0
  78. package/dist/core/events/src/sandbox-opened-read.d.ts +17 -0
  79. package/dist/core/events/src/sandbox-opened-read.js +63 -0
  80. package/dist/core/events/src/sandbox-opened.d.ts +94 -0
  81. package/dist/core/events/src/sandbox-opened.js +52 -0
  82. package/dist/core/events/src/summarize.d.ts +14 -0
  83. package/dist/core/events/src/summarize.js +192 -0
  84. package/dist/core/events/src/timeline-entry.d.ts +21 -0
  85. package/dist/core/events/src/timeline-entry.js +106 -0
  86. package/dist/core/events/src/upgrade.d.ts +23 -0
  87. package/dist/core/events/src/upgrade.js +49 -0
  88. package/dist/core/format/src/compact.d.ts +30 -0
  89. package/dist/core/format/src/compact.js +72 -0
  90. package/dist/core/format/src/index.d.ts +39 -0
  91. package/dist/core/format/src/index.js +25 -0
  92. package/dist/core/format/src/integration/index.d.ts +7 -0
  93. package/dist/core/format/src/integration/index.js +10 -0
  94. package/dist/core/format/src/json-schema.d.ts +26 -0
  95. package/dist/core/format/src/json-schema.js +48 -0
  96. package/dist/core/format/src/kind.d.ts +65 -0
  97. package/dist/core/format/src/kind.js +1 -0
  98. package/dist/core/format/src/kinds/agent/kind.d.ts +4 -0
  99. package/dist/core/format/src/kinds/agent/kind.js +10 -0
  100. package/dist/core/format/src/kinds/agent/sandbox-fields.d.ts +99 -0
  101. package/dist/core/format/src/kinds/agent/sandbox-fields.js +216 -0
  102. package/dist/core/format/src/kinds/agent/schema.d.ts +147 -0
  103. package/dist/core/format/src/kinds/agent/schema.js +107 -0
  104. package/dist/core/format/src/kinds/agent/working-folder-start.d.ts +74 -0
  105. package/dist/core/format/src/kinds/agent/working-folder-start.js +312 -0
  106. package/dist/core/format/src/kinds/collection/kind.d.ts +8 -0
  107. package/dist/core/format/src/kinds/collection/kind.js +14 -0
  108. package/dist/core/format/src/kinds/collection/schema.d.ts +89 -0
  109. package/dist/core/format/src/kinds/collection/schema.js +90 -0
  110. package/dist/core/format/src/kinds/connector/is-local.d.ts +10 -0
  111. package/dist/core/format/src/kinds/connector/is-local.js +43 -0
  112. package/dist/core/format/src/kinds/connector/kind.d.ts +4 -0
  113. package/dist/core/format/src/kinds/connector/kind.js +218 -0
  114. package/dist/core/format/src/kinds/connector/schema.d.ts +74 -0
  115. package/dist/core/format/src/kinds/connector/schema.js +143 -0
  116. package/dist/core/format/src/kinds/deployments/kind.d.ts +4 -0
  117. package/dist/core/format/src/kinds/deployments/kind.js +49 -0
  118. package/dist/core/format/src/kinds/deployments/schema.d.ts +77 -0
  119. package/dist/core/format/src/kinds/deployments/schema.js +94 -0
  120. package/dist/core/format/src/kinds/hub/kind.d.ts +4 -0
  121. package/dist/core/format/src/kinds/hub/kind.js +10 -0
  122. package/dist/core/format/src/kinds/hub/schema.d.ts +54 -0
  123. package/dist/core/format/src/kinds/hub/schema.js +34 -0
  124. package/dist/core/format/src/kinds/integration/approved-sign-ins.d.ts +62 -0
  125. package/dist/core/format/src/kinds/integration/approved-sign-ins.js +125 -0
  126. package/dist/core/format/src/kinds/integration/host-key.d.ts +7 -0
  127. package/dist/core/format/src/kinds/integration/host-key.js +8 -0
  128. package/dist/core/format/src/kinds/integration/kind.d.ts +18 -0
  129. package/dist/core/format/src/kinds/integration/kind.js +175 -0
  130. package/dist/core/format/src/kinds/integration/parse-sheet.d.ts +19 -0
  131. package/dist/core/format/src/kinds/integration/parse-sheet.js +24 -0
  132. package/dist/core/format/src/kinds/integration/policy.d.ts +112 -0
  133. package/dist/core/format/src/kinds/integration/policy.js +327 -0
  134. package/dist/core/format/src/kinds/integration/schema.d.ts +410 -0
  135. package/dist/core/format/src/kinds/integration/schema.js +359 -0
  136. package/dist/core/format/src/kinds/integration/sign-in-checks.d.ts +13 -0
  137. package/dist/core/format/src/kinds/integration/sign-in-checks.js +120 -0
  138. package/dist/core/format/src/kinds/integration/sign-in-urls.d.ts +19 -0
  139. package/dist/core/format/src/kinds/integration/sign-in-urls.js +47 -0
  140. package/dist/core/format/src/kinds/knowledge/kind.d.ts +4 -0
  141. package/dist/core/format/src/kinds/knowledge/kind.js +13 -0
  142. package/dist/core/format/src/kinds/knowledge/schema.d.ts +18 -0
  143. package/dist/core/format/src/kinds/knowledge/schema.js +25 -0
  144. package/dist/core/format/src/kinds/models/kind.d.ts +4 -0
  145. package/dist/core/format/src/kinds/models/kind.js +10 -0
  146. package/dist/core/format/src/kinds/models/schema.d.ts +92 -0
  147. package/dist/core/format/src/kinds/models/schema.js +38 -0
  148. package/dist/core/format/src/kinds/plugin/backend.d.ts +22 -0
  149. package/dist/core/format/src/kinds/plugin/backend.js +31 -0
  150. package/dist/core/format/src/kinds/plugin/checks.d.ts +13 -0
  151. package/dist/core/format/src/kinds/plugin/checks.js +137 -0
  152. package/dist/core/format/src/kinds/plugin/kind.d.ts +8 -0
  153. package/dist/core/format/src/kinds/plugin/kind.js +16 -0
  154. package/dist/core/format/src/kinds/plugin/problems.d.ts +24 -0
  155. package/dist/core/format/src/kinds/plugin/problems.js +65 -0
  156. package/dist/core/format/src/kinds/plugin/schema.d.ts +672 -0
  157. package/dist/core/format/src/kinds/plugin/schema.js +261 -0
  158. package/dist/core/format/src/kinds/plugin/setting-values.d.ts +17 -0
  159. package/dist/core/format/src/kinds/plugin/setting-values.js +38 -0
  160. package/dist/core/format/src/kinds/plugin/ui-checks.d.ts +8 -0
  161. package/dist/core/format/src/kinds/plugin/ui-checks.js +85 -0
  162. package/dist/core/format/src/kinds/provider/kind.d.ts +4 -0
  163. package/dist/core/format/src/kinds/provider/kind.js +24 -0
  164. package/dist/core/format/src/kinds/provider/schema.d.ts +17 -0
  165. package/dist/core/format/src/kinds/provider/schema.js +22 -0
  166. package/dist/core/format/src/kinds/routine/kind.d.ts +8 -0
  167. package/dist/core/format/src/kinds/routine/kind.js +62 -0
  168. package/dist/core/format/src/kinds/routine/schema.d.ts +94 -0
  169. package/dist/core/format/src/kinds/routine/schema.js +115 -0
  170. package/dist/core/format/src/kinds/routine/webhook-headers.d.ts +9 -0
  171. package/dist/core/format/src/kinds/routine/webhook-headers.js +26 -0
  172. package/dist/core/format/src/kinds/runtime/kind.d.ts +4 -0
  173. package/dist/core/format/src/kinds/runtime/kind.js +13 -0
  174. package/dist/core/format/src/kinds/runtime/schema.d.ts +10 -0
  175. package/dist/core/format/src/kinds/runtime/schema.js +12 -0
  176. package/dist/core/format/src/kinds/skill/kind.d.ts +4 -0
  177. package/dist/core/format/src/kinds/skill/kind.js +10 -0
  178. package/dist/core/format/src/kinds/skill/schema.d.ts +17 -0
  179. package/dist/core/format/src/kinds/skill/schema.js +17 -0
  180. package/dist/core/format/src/kinds/skill/scripts-folder.d.ts +27 -0
  181. package/dist/core/format/src/kinds/skill/scripts-folder.js +37 -0
  182. package/dist/core/format/src/kinds/workflow/kind.d.ts +8 -0
  183. package/dist/core/format/src/kinds/workflow/kind.js +14 -0
  184. package/dist/core/format/src/kinds/workflow/schema.d.ts +162 -0
  185. package/dist/core/format/src/kinds/workflow/schema.js +106 -0
  186. package/dist/core/format/src/kinds/workflow-test/kind.d.ts +4 -0
  187. package/dist/core/format/src/kinds/workflow-test/kind.js +14 -0
  188. package/dist/core/format/src/kinds/workflow-test/schema.d.ts +67 -0
  189. package/dist/core/format/src/kinds/workflow-test/schema.js +59 -0
  190. package/dist/core/format/src/kinds/workspace/kind.d.ts +4 -0
  191. package/dist/core/format/src/kinds/workspace/kind.js +10 -0
  192. package/dist/core/format/src/kinds/workspace/schema.d.ts +72 -0
  193. package/dist/core/format/src/kinds/workspace/schema.js +66 -0
  194. package/dist/core/format/src/parse-file.d.ts +69 -0
  195. package/dist/core/format/src/parse-file.js +105 -0
  196. package/dist/core/format/src/recording/format.d.ts +81 -0
  197. package/dist/core/format/src/recording/format.js +102 -0
  198. package/dist/core/format/src/recording/index.d.ts +1 -0
  199. package/dist/core/format/src/recording/index.js +3 -0
  200. package/dist/core/format/src/registry.d.ts +64 -0
  201. package/dist/core/format/src/registry.js +61 -0
  202. package/dist/core/format/src/reserved.d.ts +20 -0
  203. package/dist/core/format/src/reserved.js +30 -0
  204. package/dist/core/format/src/shared/fields.d.ts +34 -0
  205. package/dist/core/format/src/shared/fields.js +74 -0
  206. package/dist/core/format/src/shared/guard.d.ts +32 -0
  207. package/dist/core/format/src/shared/guard.js +16 -0
  208. package/dist/core/format/src/shared/key-in-value.d.ts +28 -0
  209. package/dist/core/format/src/shared/key-in-value.js +82 -0
  210. package/dist/core/format/src/shared/legacy-keys.d.ts +8 -0
  211. package/dist/core/format/src/shared/legacy-keys.js +17 -0
  212. package/dist/core/format/src/shared/program-start.d.ts +60 -0
  213. package/dist/core/format/src/shared/program-start.js +99 -0
  214. package/dist/core/format/src/shared/relative-path.d.ts +29 -0
  215. package/dist/core/format/src/shared/relative-path.js +50 -0
  216. package/dist/core/format/src/shared/secret-name.d.ts +24 -0
  217. package/dist/core/format/src/shared/secret-name.js +107 -0
  218. package/dist/core/format/src/source.d.ts +16 -0
  219. package/dist/core/format/src/source.js +73 -0
  220. package/dist/core/ports/src/agent-placement-store.d.ts +74 -0
  221. package/dist/core/ports/src/agent-placement-store.js +27 -0
  222. package/dist/core/ports/src/agent-runs-not-available.d.ts +21 -0
  223. package/dist/core/ports/src/agent-runs-not-available.js +25 -0
  224. package/dist/core/ports/src/blob-store.d.ts +45 -0
  225. package/dist/core/ports/src/blob-store.js +24 -0
  226. package/dist/core/ports/src/cant-try-error.d.ts +35 -0
  227. package/dist/core/ports/src/cant-try-error.js +44 -0
  228. package/dist/core/ports/src/chat.d.ts +127 -0
  229. package/dist/core/ports/src/chat.js +1 -0
  230. package/dist/core/ports/src/clock.d.ts +7 -0
  231. package/dist/core/ports/src/clock.js +2 -0
  232. package/dist/core/ports/src/connection-settings-store.d.ts +57 -0
  233. package/dist/core/ports/src/connection-settings-store.js +2 -0
  234. package/dist/core/ports/src/connector-client.d.ts +303 -0
  235. package/dist/core/ports/src/connector-client.js +19 -0
  236. package/dist/core/ports/src/coordination.d.ts +84 -0
  237. package/dist/core/ports/src/coordination.js +2 -0
  238. package/dist/core/ports/src/definition-store.d.ts +229 -0
  239. package/dist/core/ports/src/definition-store.js +122 -0
  240. package/dist/core/ports/src/digest.d.ts +14 -0
  241. package/dist/core/ports/src/digest.js +2 -0
  242. package/dist/core/ports/src/folder-reader.d.ts +89 -0
  243. package/dist/core/ports/src/folder-reader.js +2 -0
  244. package/dist/core/ports/src/harness-bridge-server.d.ts +198 -0
  245. package/dist/core/ports/src/harness-bridge-server.js +37 -0
  246. package/dist/core/ports/src/harness-sign-in-command.d.ts +27 -0
  247. package/dist/core/ports/src/harness-sign-in-command.js +31 -0
  248. package/dist/core/ports/src/harness.d.ts +283 -0
  249. package/dist/core/ports/src/harness.js +45 -0
  250. package/dist/core/ports/src/host-settings-store.d.ts +116 -0
  251. package/dist/core/ports/src/host-settings-store.js +106 -0
  252. package/dist/core/ports/src/http-client.d.ts +27 -0
  253. package/dist/core/ports/src/http-client.js +2 -0
  254. package/dist/core/ports/src/id-generator.d.ts +14 -0
  255. package/dist/core/ports/src/id-generator.js +2 -0
  256. package/dist/core/ports/src/index.d.ts +45 -0
  257. package/dist/core/ports/src/index.js +44 -0
  258. package/dist/core/ports/src/instruction-trust-store.d.ts +81 -0
  259. package/dist/core/ports/src/instruction-trust-store.js +43 -0
  260. package/dist/core/ports/src/integration.d.ts +242 -0
  261. package/dist/core/ports/src/integration.js +31 -0
  262. package/dist/core/ports/src/knowledge-provider.d.ts +65 -0
  263. package/dist/core/ports/src/knowledge-provider.js +2 -0
  264. package/dist/core/ports/src/llm-cache.d.ts +13 -0
  265. package/dist/core/ports/src/llm-cache.js +2 -0
  266. package/dist/core/ports/src/llm-provider.d.ts +186 -0
  267. package/dist/core/ports/src/llm-provider.js +139 -0
  268. package/dist/core/ports/src/model-price.d.ts +34 -0
  269. package/dist/core/ports/src/model-price.js +25 -0
  270. package/dist/core/ports/src/password-hasher.d.ts +63 -0
  271. package/dist/core/ports/src/password-hasher.js +2 -0
  272. package/dist/core/ports/src/plugin-folder-writer.d.ts +104 -0
  273. package/dist/core/ports/src/plugin-folder-writer.js +95 -0
  274. package/dist/core/ports/src/port-versions.d.ts +47 -0
  275. package/dist/core/ports/src/port-versions.js +80 -0
  276. package/dist/core/ports/src/program-probe.d.ts +69 -0
  277. package/dist/core/ports/src/program-probe.js +2 -0
  278. package/dist/core/ports/src/provider-default-base-url.d.ts +10 -0
  279. package/dist/core/ports/src/provider-default-base-url.js +18 -0
  280. package/dist/core/ports/src/record-store.d.ts +79 -0
  281. package/dist/core/ports/src/record-store.js +108 -0
  282. package/dist/core/ports/src/resource-probe.d.ts +59 -0
  283. package/dist/core/ports/src/resource-probe.js +2 -0
  284. package/dist/core/ports/src/run-executor.d.ts +303 -0
  285. package/dist/core/ports/src/run-executor.js +2 -0
  286. package/dist/core/ports/src/run-failure-error.d.ts +49 -0
  287. package/dist/core/ports/src/run-failure-error.js +47 -0
  288. package/dist/core/ports/src/run-store.d.ts +194 -0
  289. package/dist/core/ports/src/run-store.js +131 -0
  290. package/dist/core/ports/src/run-target-not-found.d.ts +34 -0
  291. package/dist/core/ports/src/run-target-not-found.js +41 -0
  292. package/dist/core/ports/src/sandbox-setting-store.d.ts +68 -0
  293. package/dist/core/ports/src/sandbox-setting-store.js +33 -0
  294. package/dist/core/ports/src/sandbox.d.ts +364 -0
  295. package/dist/core/ports/src/sandbox.js +70 -0
  296. package/dist/core/ports/src/scheduler.d.ts +85 -0
  297. package/dist/core/ports/src/scheduler.js +2 -0
  298. package/dist/core/ports/src/secrets.d.ts +201 -0
  299. package/dist/core/ports/src/secrets.js +200 -0
  300. package/dist/core/ports/src/token-store.d.ts +19 -0
  301. package/dist/core/ports/src/token-store.js +2 -0
  302. package/dist/core/ports/src/tool-approval-store.d.ts +253 -0
  303. package/dist/core/ports/src/tool-approval-store.js +116 -0
  304. package/dist/core/ports/src/trust-store.d.ts +72 -0
  305. package/dist/core/ports/src/trust-store.js +2 -0
  306. package/dist/core/ports/src/unfenced-run-consent-store.d.ts +43 -0
  307. package/dist/core/ports/src/unfenced-run-consent-store.js +2 -0
  308. package/dist/core/ports/src/vcs-status.d.ts +8 -0
  309. package/dist/core/ports/src/vcs-status.js +90 -0
  310. package/dist/core/ports/src/vcs.d.ts +394 -0
  311. package/dist/core/ports/src/vcs.js +48 -0
  312. package/dist/core/schema-kit/src/builders.d.ts +50 -0
  313. package/dist/core/schema-kit/src/builders.js +72 -0
  314. package/dist/core/schema-kit/src/depth.d.ts +15 -0
  315. package/dist/core/schema-kit/src/depth.js +37 -0
  316. package/dist/core/schema-kit/src/index.d.ts +6 -0
  317. package/dist/core/schema-kit/src/index.js +6 -0
  318. package/dist/core/schema-kit/src/issue.d.ts +22 -0
  319. package/dist/core/schema-kit/src/issue.js +23 -0
  320. package/dist/core/schema-kit/src/json-schema.d.ts +23 -0
  321. package/dist/core/schema-kit/src/json-schema.js +22 -0
  322. package/dist/core/schema-kit/src/parse.d.ts +17 -0
  323. package/dist/core/schema-kit/src/parse.js +25 -0
  324. package/dist/core/schema-kit/src/schema.d.ts +12 -0
  325. package/dist/core/schema-kit/src/schema.js +1 -0
  326. package/dist/core/std/src/amount.d.ts +13 -0
  327. package/dist/core/std/src/amount.js +22 -0
  328. package/dist/core/std/src/ascii-host.d.ts +18 -0
  329. package/dist/core/std/src/ascii-host.js +110 -0
  330. package/dist/core/std/src/assert.d.ts +39 -0
  331. package/dist/core/std/src/assert.js +59 -0
  332. package/dist/core/std/src/base64url.d.ts +23 -0
  333. package/dist/core/std/src/base64url.js +65 -0
  334. package/dist/core/std/src/canonical-json.d.ts +18 -0
  335. package/dist/core/std/src/canonical-json.js +56 -0
  336. package/dist/core/std/src/clock.d.ts +27 -0
  337. package/dist/core/std/src/clock.js +33 -0
  338. package/dist/core/std/src/constant-time.d.ts +16 -0
  339. package/dist/core/std/src/constant-time.js +26 -0
  340. package/dist/core/std/src/content-digest.d.ts +24 -0
  341. package/dist/core/std/src/content-digest.js +28 -0
  342. package/dist/core/std/src/deep-clone.d.ts +15 -0
  343. package/dist/core/std/src/deep-clone.js +59 -0
  344. package/dist/core/std/src/deep-equal.d.ts +23 -0
  345. package/dist/core/std/src/deep-equal.js +64 -0
  346. package/dist/core/std/src/emitter.d.ts +42 -0
  347. package/dist/core/std/src/emitter.js +74 -0
  348. package/dist/core/std/src/error-kind.d.ts +88 -0
  349. package/dist/core/std/src/error-kind.js +98 -0
  350. package/dist/core/std/src/hex.d.ts +10 -0
  351. package/dist/core/std/src/hex.js +16 -0
  352. package/dist/core/std/src/hidden-characters.d.ts +19 -0
  353. package/dist/core/std/src/hidden-characters.js +54 -0
  354. package/dist/core/std/src/ids.d.ts +45 -0
  355. package/dist/core/std/src/ids.js +49 -0
  356. package/dist/core/std/src/index.d.ts +30 -0
  357. package/dist/core/std/src/index.js +31 -0
  358. package/dist/core/std/src/keyed-queue.d.ts +18 -0
  359. package/dist/core/std/src/keyed-queue.js +32 -0
  360. package/dist/core/std/src/line-diff.d.ts +83 -0
  361. package/dist/core/std/src/line-diff.js +179 -0
  362. package/dist/core/std/src/line-merge.d.ts +63 -0
  363. package/dist/core/std/src/line-merge.js +138 -0
  364. package/dist/core/std/src/plain-data.d.ts +32 -0
  365. package/dist/core/std/src/plain-data.js +57 -0
  366. package/dist/core/std/src/posix-path.d.ts +61 -0
  367. package/dist/core/std/src/posix-path.js +121 -0
  368. package/dist/core/std/src/public-suffixes.generated.d.ts +9 -0
  369. package/dist/core/std/src/public-suffixes.generated.js +10429 -0
  370. package/dist/core/std/src/registrable-domain.d.ts +10 -0
  371. package/dist/core/std/src/registrable-domain.js +62 -0
  372. package/dist/core/std/src/result.d.ts +55 -0
  373. package/dist/core/std/src/result.js +52 -0
  374. package/dist/core/std/src/secret-scrubber.d.ts +54 -0
  375. package/dist/core/std/src/secret-scrubber.js +124 -0
  376. package/dist/core/std/src/secret-shape.d.ts +20 -0
  377. package/dist/core/std/src/secret-shape.js +53 -0
  378. package/dist/core/std/src/secret-variable-name.d.ts +12 -0
  379. package/dist/core/std/src/secret-variable-name.js +34 -0
  380. package/dist/core/std/src/site-name.d.ts +35 -0
  381. package/dist/core/std/src/site-name.js +111 -0
  382. package/dist/core/std/src/stop-signal.d.ts +44 -0
  383. package/dist/core/std/src/stop-signal.js +77 -0
  384. package/dist/core/std/src/text.d.ts +28 -0
  385. package/dist/core/std/src/text.js +54 -0
  386. package/dist/core/std/src/url-host.d.ts +35 -0
  387. package/dist/core/std/src/url-host.js +170 -0
  388. package/dist/core/std/src/utf8.d.ts +23 -0
  389. package/dist/core/std/src/utf8.js +110 -0
  390. package/dist/core/std/src/version.d.ts +48 -0
  391. package/dist/core/std/src/version.js +103 -0
  392. package/dist/core/yaml/src/depth.d.ts +14 -0
  393. package/dist/core/yaml/src/depth.js +140 -0
  394. package/dist/core/yaml/src/edit-data.d.ts +47 -0
  395. package/dist/core/yaml/src/edit-data.js +286 -0
  396. package/dist/core/yaml/src/edit-text.d.ts +92 -0
  397. package/dist/core/yaml/src/edit-text.js +267 -0
  398. package/dist/core/yaml/src/edit.d.ts +47 -0
  399. package/dist/core/yaml/src/edit.js +198 -0
  400. package/dist/core/yaml/src/index.d.ts +5 -0
  401. package/dist/core/yaml/src/index.js +4 -0
  402. package/dist/core/yaml/src/problem.d.ts +20 -0
  403. package/dist/core/yaml/src/problem.js +1 -0
  404. package/dist/core/yaml/src/read.d.ts +47 -0
  405. package/dist/core/yaml/src/read.js +130 -0
  406. package/dist/core/yaml/src/splice-node.d.ts +47 -0
  407. package/dist/core/yaml/src/splice-node.js +333 -0
  408. package/dist/core/yaml/src/splice.d.ts +13 -0
  409. package/dist/core/yaml/src/splice.js +174 -0
  410. package/dist/core/yaml/src/unsupported.d.ts +26 -0
  411. package/dist/core/yaml/src/unsupported.js +70 -0
  412. package/dist/core/yaml/src/write.d.ts +35 -0
  413. package/dist/core/yaml/src/write.js +44 -0
  414. package/dist/testing/integration/src/canaries.d.ts +14 -0
  415. package/dist/testing/integration/src/canaries.js +17 -0
  416. package/dist/testing/integration/src/checks.d.ts +37 -0
  417. package/dist/testing/integration/src/checks.js +195 -0
  418. package/dist/testing/integration/src/describe.d.ts +35 -0
  419. package/dist/testing/integration/src/describe.js +74 -0
  420. package/dist/testing/integration/src/failure.d.ts +6 -0
  421. package/dist/testing/integration/src/failure.js +8 -0
  422. package/dist/testing/integration/src/fake-wait.d.ts +18 -0
  423. package/dist/testing/integration/src/fake-wait.js +21 -0
  424. package/dist/testing/integration/src/index.d.ts +10 -0
  425. package/dist/testing/integration/src/index.js +11 -0
  426. package/dist/testing/integration/src/load.d.ts +14 -0
  427. package/dist/testing/integration/src/load.js +47 -0
  428. package/dist/testing/integration/src/plugin-folder.d.ts +23 -0
  429. package/dist/testing/integration/src/plugin-folder.js +59 -0
  430. package/dist/testing/integration/src/plugin.d.ts +32 -0
  431. package/dist/testing/integration/src/plugin.js +57 -0
  432. package/dist/testing/integration/src/recording.d.ts +84 -0
  433. package/dist/testing/integration/src/recording.js +164 -0
  434. package/dist/testing/integration/src/run.d.ts +60 -0
  435. package/dist/testing/integration/src/run.js +81 -0
  436. package/dist/testing/integration/src/source-scan.d.ts +16 -0
  437. package/dist/testing/integration/src/source-scan.js +40 -0
  438. package/package.json +34 -3
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The timeline entry of each event of a run log: the `seq` of the event that
3
+ * opened the entry. An event that has `entry` keeps it. For a log written
4
+ * before the field existed, an event that finishes or updates an entry (such
5
+ * as `agent.finished`) gets the `seq` of the latest still-open event that
6
+ * opened it, with the same branch, item and matching fields; every other
7
+ * event opens an entry of its own. The engine writes `entry` by the same
8
+ * rules, so an old log and a new log of the same run give the same entries.
9
+ *
10
+ * @param events - one run's log, in `seq` order
11
+ * @returns the entry of each event, in the same order as `events`
12
+ *
13
+ * @example
14
+ * entryOf([
15
+ * { seq: 1, type: "agent.started", state: "s", agent: "a", ... },
16
+ * { seq: 2, type: "agent.finished", state: "s", agent: "a", ... },
17
+ * ]);
18
+ * // => [1, 1]
19
+ */
20
+ export function entryOf(events) {
21
+ // The entries still open, by opener key; the latest is last.
22
+ const open = new Map();
23
+ return events.map((event) => {
24
+ const fields = openerFields(event);
25
+ if (fields !== null) {
26
+ const entry = event.entry ?? event.seq;
27
+ const key = entryKey(event, event.type, fields);
28
+ open.set(key, [...(open.get(key) ?? []), entry]);
29
+ return entry;
30
+ }
31
+ const update = updateOf(event);
32
+ if (update === null)
33
+ return event.entry ?? event.seq;
34
+ const openEntries = open.get(entryKey(event, update.opener, update.fields)) ?? [];
35
+ const entry = event.entry ?? openEntries.at(-1) ?? event.seq;
36
+ const index = openEntries.lastIndexOf(entry);
37
+ if (update.closes && index !== -1)
38
+ openEntries.splice(index, 1);
39
+ return entry;
40
+ });
41
+ }
42
+ /** The key of an entry: its opener's type, branch, item and matched fields. */
43
+ function entryKey(event, opener, fields) {
44
+ // JSON keeps `undefined` apart from every string, as `null` in an array.
45
+ return JSON.stringify([opener, event.branch, event.item, ...fields]);
46
+ }
47
+ /**
48
+ * The fields an opening event is matched on, or `null` when the event doesn't
49
+ * open an entry that later events update.
50
+ */
51
+ function openerFields(event) {
52
+ switch (event.type) {
53
+ case "run.started":
54
+ case "run.waiting":
55
+ return [];
56
+ case "state.entered":
57
+ return [event.state];
58
+ case "agent.started":
59
+ return [event.state, event.agent, event.parent];
60
+ case "llm.request":
61
+ return [event.agent];
62
+ case "tool.called":
63
+ return [event.agent, event.tool];
64
+ case "approval.requested":
65
+ return [event.callId];
66
+ case "workflow.started":
67
+ return [event.childRunId];
68
+ default:
69
+ return null;
70
+ }
71
+ }
72
+ /** Which entry an event updates, or `null` when it doesn't update one. */
73
+ function updateOf(event) {
74
+ switch (event.type) {
75
+ case "run.completed":
76
+ case "run.failed":
77
+ case "run.cant-try":
78
+ return { opener: "run.started", fields: [], closes: true };
79
+ case "transition":
80
+ return { opener: "state.entered", fields: [event.from], closes: true };
81
+ case "agent.finished":
82
+ return {
83
+ opener: "agent.started",
84
+ fields: [event.state, event.agent, event.parent],
85
+ closes: true,
86
+ };
87
+ case "llm.response":
88
+ return { opener: "llm.request", fields: [event.agent], closes: true };
89
+ // The call goes on with the fallback model, so its response still follows.
90
+ case "llm.fallback":
91
+ return { opener: "llm.request", fields: [event.agent], closes: false };
92
+ case "tool.result":
93
+ return { opener: "tool.called", fields: [event.agent, event.tool], closes: true };
94
+ case "approval.resolved":
95
+ return { opener: "approval.requested", fields: [event.callId], closes: true };
96
+ case "workflow.finished":
97
+ return { opener: "workflow.started", fields: [event.childRunId], closes: true };
98
+ // Only while the run waits; otherwise no entry is open and it stands alone.
99
+ case "timer.fired":
100
+ case "event.received":
101
+ case "workflow.resumed":
102
+ return { opener: "run.waiting", fields: [], closes: true };
103
+ default:
104
+ return null;
105
+ }
106
+ }
@@ -0,0 +1,23 @@
1
+ import type { RunEvent } from "./run-event.js";
2
+ /**
3
+ * Read a stored event, upgrading older shapes. Run logs written before
4
+ * workflows were renamed have `flowId` on `run.started`, and logs written
5
+ * before hubs were renamed have `projectId`. Both become today's names.
6
+ * Every other event is returned as it is.
7
+ *
8
+ * @param raw - one event as read from a run log
9
+ * @returns the event in today's shape
10
+ *
11
+ * @example
12
+ * upgradeEvent({ type: "run.started", projectId: "p", flowId: "greet", ... });
13
+ * // => { type: "run.started", hubId: "p", workflowId: "greet", ... }
14
+ */
15
+ export declare function upgradeEvent(raw: unknown): RunEvent;
16
+ /**
17
+ * Parse one line of a JSON-lines run log.
18
+ *
19
+ * @param line - one line of the log, without the line break
20
+ * @returns the event, upgraded by {@link upgradeEvent}
21
+ * @throws SyntaxError when the line isn't valid JSON or isn't a JSON object
22
+ */
23
+ export declare function parseEventLine(line: string): RunEvent;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Read a stored event, upgrading older shapes. Run logs written before
3
+ * workflows were renamed have `flowId` on `run.started`, and logs written
4
+ * before hubs were renamed have `projectId`. Both become today's names.
5
+ * Every other event is returned as it is.
6
+ *
7
+ * @param raw - one event as read from a run log
8
+ * @returns the event in today's shape
9
+ *
10
+ * @example
11
+ * upgradeEvent({ type: "run.started", projectId: "p", flowId: "greet", ... });
12
+ * // => { type: "run.started", hubId: "p", workflowId: "greet", ... }
13
+ */
14
+ export function upgradeEvent(raw) {
15
+ // Stored logs are trusted to be run events; only the old names are fixed up.
16
+ const event = raw;
17
+ if (event.type !== "run.started")
18
+ return event;
19
+ const fields = raw;
20
+ const withWorkflow = renameOldField(fields, "flowId", "workflowId");
21
+ return renameOldField(withWorkflow, "projectId", "hubId");
22
+ }
23
+ /**
24
+ * Parse one line of a JSON-lines run log.
25
+ *
26
+ * @param line - one line of the log, without the line break
27
+ * @returns the event, upgraded by {@link upgradeEvent}
28
+ * @throws SyntaxError when the line isn't valid JSON or isn't a JSON object
29
+ */
30
+ export function parseEventLine(line) {
31
+ const parsed = JSON.parse(line);
32
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
33
+ throw new SyntaxError("A run log line must be a JSON object");
34
+ }
35
+ return upgradeEvent(parsed);
36
+ }
37
+ /**
38
+ * Move a string field to its new name. Only when the new name isn't set yet,
39
+ * so an event that already has both keeps both.
40
+ */
41
+ function renameOldField(fields, oldName, newName) {
42
+ if (fields[newName] !== undefined)
43
+ return fields;
44
+ const oldValue = fields[oldName];
45
+ if (typeof oldValue !== "string")
46
+ return fields;
47
+ const { [oldName]: _removed, ...rest } = fields;
48
+ return { ...rest, [newName]: oldValue };
49
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Removes the values a saved file doesn't need, so files stay small: in every
3
+ * object, a key whose value is `undefined`, an empty array or an empty object
4
+ * is left out. Each value is compacted before it is checked, so
5
+ * `{ a: { b: [] } }` loses `a` too.
6
+ *
7
+ * It behaves like the old app's `compact` (requirement `format.compact`):
8
+ * - `null`, `""`, `0` and `false` are kept.
9
+ * - Array items are compacted but never removed, not even `undefined` or `{}`,
10
+ * because removing one would shift the position of every item after it.
11
+ * - The value passed in is never removed: `compact({})` is `{}`.
12
+ * - A key named `__proto__` (`JSON.parse` can make one) is kept as an ordinary
13
+ * key; it never changes the result's prototype.
14
+ *
15
+ * Unlike the old app, it refuses any object that is neither a plain object nor
16
+ * an array, such as a `Date`, a `Map` or a class instance. The old app turned
17
+ * those into `{}` and left them out, quietly losing them; a parsed file never
18
+ * contains one, so meeting one means the caller passed the wrong value.
19
+ *
20
+ * The input is not changed; the result is a new value that shares no objects
21
+ * or arrays with it.
22
+ *
23
+ * @param value - the value about to be written, usually a parsed file
24
+ * @returns the value without empty keys
25
+ * @throws TypeError for an object that isn't a plain object or an array, naming where it is
26
+ *
27
+ * @example
28
+ * compact({ name: "triage", tags: [], layout: {} }); // { name: "triage" }
29
+ */
30
+ export declare function compact(value: unknown): unknown;
@@ -0,0 +1,72 @@
1
+ import { describeObject, isPlainObject, keyPath } from "../../std/src/index.js";
2
+ /**
3
+ * Removes the values a saved file doesn't need, so files stay small: in every
4
+ * object, a key whose value is `undefined`, an empty array or an empty object
5
+ * is left out. Each value is compacted before it is checked, so
6
+ * `{ a: { b: [] } }` loses `a` too.
7
+ *
8
+ * It behaves like the old app's `compact` (requirement `format.compact`):
9
+ * - `null`, `""`, `0` and `false` are kept.
10
+ * - Array items are compacted but never removed, not even `undefined` or `{}`,
11
+ * because removing one would shift the position of every item after it.
12
+ * - The value passed in is never removed: `compact({})` is `{}`.
13
+ * - A key named `__proto__` (`JSON.parse` can make one) is kept as an ordinary
14
+ * key; it never changes the result's prototype.
15
+ *
16
+ * Unlike the old app, it refuses any object that is neither a plain object nor
17
+ * an array, such as a `Date`, a `Map` or a class instance. The old app turned
18
+ * those into `{}` and left them out, quietly losing them; a parsed file never
19
+ * contains one, so meeting one means the caller passed the wrong value.
20
+ *
21
+ * The input is not changed; the result is a new value that shares no objects
22
+ * or arrays with it.
23
+ *
24
+ * @param value - the value about to be written, usually a parsed file
25
+ * @returns the value without empty keys
26
+ * @throws TypeError for an object that isn't a plain object or an array, naming where it is
27
+ *
28
+ * @example
29
+ * compact({ name: "triage", tags: [], layout: {} }); // { name: "triage" }
30
+ */
31
+ export function compact(value) {
32
+ return compactValue(value, "value");
33
+ }
34
+ function compactValue(value, path) {
35
+ if (Array.isArray(value)) {
36
+ return value.map((item, index) => compactValue(item, `${path}[${index}]`));
37
+ }
38
+ if (isPlainObject(value)) {
39
+ return compactObject(value, path);
40
+ }
41
+ if (typeof value === "object" && value !== null) {
42
+ throw new TypeError(`compact writes plain data only, but ${path} is ${describeObject(value)}.`);
43
+ }
44
+ return value;
45
+ }
46
+ function compactObject(value, path) {
47
+ const result = {};
48
+ for (const [key, child] of Object.entries(value)) {
49
+ const compacted = compactValue(child, keyPath(path, key));
50
+ if (isEmpty(compacted)) {
51
+ continue;
52
+ }
53
+ // defineProperty, not assignment: a "__proto__" key from JSON.parse
54
+ // stays a plain key instead of changing the result's prototype.
55
+ Object.defineProperty(result, key, {
56
+ value: compacted,
57
+ enumerable: true,
58
+ writable: true,
59
+ configurable: true,
60
+ });
61
+ }
62
+ return result;
63
+ }
64
+ function isEmpty(value) {
65
+ if (value === undefined) {
66
+ return true;
67
+ }
68
+ if (Array.isArray(value)) {
69
+ return value.length === 0;
70
+ }
71
+ return isPlainObject(value) && Object.keys(value).length === 0;
72
+ }
@@ -0,0 +1,39 @@
1
+ export { compact } from "./compact.js";
2
+ export { jsonSchemaOf } from "./json-schema.js";
3
+ export type { FileKind, FilePlace, KindCheckProblem, KindSyntax } from "./kind.js";
4
+ export { AGENT_HARNESSES, asciiAllowedSites, defaultWorkingFolder, isInWorkingFolder, MAX_ALLOWED_SITES, PROTECTED_TOP_NAMES, workingFolderProblem, } from "./kinds/agent/sandbox-fields.js";
5
+ export type { Agent, AgentMethod, AgentOutput, MethodField } from "./kinds/agent/schema.js";
6
+ export { type ConnectorStart, type FolderLookup, touchesWorkingFolder, type WorkingFolderReach, workingFolderRefusal, } from "./kinds/agent/working-folder-start.js";
7
+ export type { Collection, CollectionField, CollectionView } from "./kinds/collection/schema.js";
8
+ export { FIELD_TYPES } from "./kinds/collection/schema.js";
9
+ export { connectorIsLocal } from "./kinds/connector/is-local.js";
10
+ export { approveAll, type Connector, marksRead, needsApproval } from "./kinds/connector/schema.js";
11
+ export type { CloudflareSettings, Deployment, DeploymentLimits, Deployments, } from "./kinds/deployments/schema.js";
12
+ export type { Hub, HubUses } from "./kinds/hub/schema.js";
13
+ export { approvedSignIns, type ResolvedSignIn, } from "./kinds/integration/approved-sign-ins.js";
14
+ export { checkIntegrationSheet } from "./kinds/integration/kind.js";
15
+ export { parseIntegrationSheet, type SheetProblem } from "./kinds/integration/parse-sheet.js";
16
+ export { type DeclaredClientSecret, type DeclaredPlacement, type DeclaredSecret, type DeclaredSignIn, type DeclaredSignInPlacement, type IntegrationLimits, type IntegrationPolicy, integrationPolicy, type PolicyProblem, type ResolvedIntegration, } from "./kinds/integration/policy.js";
17
+ export { ADDRESS_CLASSES, type AddressClass, CONTENT_PATH_PATTERN, HOST_PATTERN, INTEGRATION_NAME_PATTERN, type IntegrationClientSecret, type IntegrationHost, type IntegrationSecret, type IntegrationSecretEntry, type IntegrationSecretHost, IntegrationSheet, type IntegrationSignIn, type IntegrationTool, isPlacedSecret, MAX_RESPONSE_BYTES, MAX_TIMEOUT_MS, placedSecrets, } from "./kinds/integration/schema.js";
18
+ export type { KnowledgeSource } from "./kinds/knowledge/schema.js";
19
+ export type { ModelAlias, Models } from "./kinds/models/schema.js";
20
+ export { backendSheet, pluginFromIntegrationSheet } from "./kinds/plugin/backend.js";
21
+ export { checkPlugin } from "./kinds/plugin/checks.js";
22
+ export { ARGUMENT_NAME_PATTERN, DEFAULT_BACKEND_ENTRY, ENV_NAME_PATTERN, MAX_PLUGIN_ID_LENGTH, MAX_PLUGIN_SECRET_NAME_LENGTH, NPM_EXACT_VERSION_PATTERN, networkSiteProblem, Plugin, type PluginBackend, type PluginLocalTool, type PluginUi, PYPI_EXACT_VERSION_PATTERN, pluginPathProblem, } from "./kinds/plugin/schema.js";
23
+ export { type PluginSettingField, type PluginSettingValue, settingValueProblem, } from "./kinds/plugin/setting-values.js";
24
+ export type { Provider } from "./kinds/provider/schema.js";
25
+ export type { Routine, RoutineTarget, RoutineTrigger } from "./kinds/routine/schema.js";
26
+ export { WEBHOOK_REFUSED_HEADERS } from "./kinds/routine/webhook-headers.js";
27
+ export type { Runtime } from "./kinds/runtime/schema.js";
28
+ export type { Skill } from "./kinds/skill/schema.js";
29
+ export { type PathLookup, skillScriptsRefusal, touchesSkillScripts, } from "./kinds/skill/scripts-folder.js";
30
+ export type { Branch, StateType, Transition, Workflow, WorkflowState, } from "./kinds/workflow/schema.js";
31
+ export type { WorkflowTest, WorkflowTestCase } from "./kinds/workflow-test/schema.js";
32
+ export type { SessionAssistant, WorkspaceSettings } from "./kinds/workspace/schema.js";
33
+ export { type FileProblem, type ParsedFile, type ParseFileOptions, parseFile, } from "./parse-file.js";
34
+ export { fileKinds, isKindName, type KindName, type KindValues, kindNames } from "./registry.js";
35
+ export { isReservedPath, RESERVED_FOLDER } from "./reserved.js";
36
+ export { SCHEMA_VERSION } from "./shared/fields.js";
37
+ export type { Guard } from "./shared/guard.js";
38
+ export { type NamedPath, type ProgramStart, pathsNamedBy } from "./shared/program-start.js";
39
+ export { foldName } from "./shared/relative-path.js";
@@ -0,0 +1,25 @@
1
+ // The public API of @halonicjs/format. Internal code imports by relative path.
2
+ export { compact } from "./compact.js";
3
+ export { jsonSchemaOf } from "./json-schema.js";
4
+ export { AGENT_HARNESSES, asciiAllowedSites, defaultWorkingFolder, isInWorkingFolder, MAX_ALLOWED_SITES, PROTECTED_TOP_NAMES, workingFolderProblem, } from "./kinds/agent/sandbox-fields.js";
5
+ export { touchesWorkingFolder, workingFolderRefusal, } from "./kinds/agent/working-folder-start.js";
6
+ export { FIELD_TYPES } from "./kinds/collection/schema.js";
7
+ export { connectorIsLocal } from "./kinds/connector/is-local.js";
8
+ export { approveAll, marksRead, needsApproval } from "./kinds/connector/schema.js";
9
+ export { approvedSignIns, } from "./kinds/integration/approved-sign-ins.js";
10
+ export { checkIntegrationSheet } from "./kinds/integration/kind.js";
11
+ export { parseIntegrationSheet } from "./kinds/integration/parse-sheet.js";
12
+ export { integrationPolicy, } from "./kinds/integration/policy.js";
13
+ export { ADDRESS_CLASSES, CONTENT_PATH_PATTERN, HOST_PATTERN, INTEGRATION_NAME_PATTERN, IntegrationSheet, isPlacedSecret, MAX_RESPONSE_BYTES, MAX_TIMEOUT_MS, placedSecrets, } from "./kinds/integration/schema.js";
14
+ export { backendSheet, pluginFromIntegrationSheet } from "./kinds/plugin/backend.js";
15
+ export { checkPlugin } from "./kinds/plugin/checks.js";
16
+ export { ARGUMENT_NAME_PATTERN, DEFAULT_BACKEND_ENTRY, ENV_NAME_PATTERN, MAX_PLUGIN_ID_LENGTH, MAX_PLUGIN_SECRET_NAME_LENGTH, NPM_EXACT_VERSION_PATTERN, networkSiteProblem, Plugin, PYPI_EXACT_VERSION_PATTERN, pluginPathProblem, } from "./kinds/plugin/schema.js";
17
+ export { settingValueProblem, } from "./kinds/plugin/setting-values.js";
18
+ export { WEBHOOK_REFUSED_HEADERS } from "./kinds/routine/webhook-headers.js";
19
+ export { skillScriptsRefusal, touchesSkillScripts, } from "./kinds/skill/scripts-folder.js";
20
+ export { parseFile, } from "./parse-file.js";
21
+ export { fileKinds, isKindName, kindNames } from "./registry.js";
22
+ export { isReservedPath, RESERVED_FOLDER } from "./reserved.js";
23
+ export { SCHEMA_VERSION } from "./shared/fields.js";
24
+ export { pathsNamedBy } from "./shared/program-start.js";
25
+ export { foldName } from "./shared/relative-path.js";
@@ -0,0 +1,7 @@
1
+ export { approvedSignIns, type ResolvedSignIn, } from "../kinds/integration/approved-sign-ins.js";
2
+ export { checkIntegrationSheet } from "../kinds/integration/kind.js";
3
+ export { parseIntegrationSheet, type SheetProblem } from "../kinds/integration/parse-sheet.js";
4
+ export { type DeclaredClientSecret, type DeclaredSignIn, type DeclaredSignInPlacement, type IntegrationLimits, type IntegrationPolicy, integrationPolicy, type PolicyProblem, type ResolvedIntegration, } from "../kinds/integration/policy.js";
5
+ export { ADDRESS_CLASSES, type AddressClass, CONTENT_PATH_PATTERN, HOST_PATTERN, INTEGRATION_NAME_PATTERN, type IntegrationClientSecret, type IntegrationHost, type IntegrationSecret, type IntegrationSecretEntry, type IntegrationSecretHost, IntegrationSheet, type IntegrationSignIn, type IntegrationTool, isPlacedSecret, MAX_RESPONSE_BYTES, MAX_TIMEOUT_MS, placedSecrets, } from "../kinds/integration/schema.js";
6
+ export { backendSheet, pluginFromIntegrationSheet } from "../kinds/plugin/backend.js";
7
+ export { Plugin } from "../kinds/plugin/schema.js";
@@ -0,0 +1,10 @@
1
+ // The public API of @halonicjs/format/integration: the permission sheet for
2
+ // the integration kit and the conformance suite. It must not import `yaml`,
3
+ // even indirectly; integration-entry.test.ts checks that.
4
+ export { approvedSignIns, } from "../kinds/integration/approved-sign-ins.js";
5
+ export { checkIntegrationSheet } from "../kinds/integration/kind.js";
6
+ export { parseIntegrationSheet } from "../kinds/integration/parse-sheet.js";
7
+ export { integrationPolicy, } from "../kinds/integration/policy.js";
8
+ export { ADDRESS_CLASSES, CONTENT_PATH_PATTERN, HOST_PATTERN, INTEGRATION_NAME_PATTERN, IntegrationSheet, isPlacedSecret, MAX_RESPONSE_BYTES, MAX_TIMEOUT_MS, placedSecrets, } from "../kinds/integration/schema.js";
9
+ export { backendSheet, pluginFromIntegrationSheet } from "../kinds/plugin/backend.js";
10
+ export { Plugin } from "../kinds/plugin/schema.js";
@@ -0,0 +1,26 @@
1
+ import { type JsonSchema } from "../../schema-kit/src/index.js";
2
+ import { type KindName } from "./registry.js";
3
+ /** Where the `$id` of every file kind's JSON Schema starts. Nothing is hosted there yet. */
4
+ export declare const SPEC_ID_BASE = "https://halonic.com/spec/format";
5
+ /**
6
+ * A kind's name in its spec file and `$id`: the kind name in kebab case,
7
+ * so `workflowTest` becomes `workflow-test`.
8
+ */
9
+ export declare function specName(kind: KindName): string;
10
+ /**
11
+ * The `$id` of a kind's JSON Schema. It names the schema and the file format
12
+ * version it describes, for example
13
+ * `https://halonic.com/spec/format/workflow/v1.schema.json`.
14
+ */
15
+ export declare function specId(kind: KindName): string;
16
+ /**
17
+ * The JSON Schema (2020-12) of a file kind, for editors, docs and other
18
+ * engines. It describes what a file may contain: keys with a default are
19
+ * not required. Checks over several fields can't be expressed and are left out.
20
+ *
21
+ * @example
22
+ * const schema = jsonSchemaOf("agent");
23
+ * schema["required"]; // ["id", "name"]
24
+ * schema["$id"]; // "https://halonic.com/spec/format/agent/v1.schema.json"
25
+ */
26
+ export declare function jsonSchemaOf(kind: KindName): JsonSchema;
@@ -0,0 +1,48 @@
1
+ import { JSON_SCHEMA_DRAFT, toJsonSchema } from "../../schema-kit/src/index.js";
2
+ import { fileKinds } from "./registry.js";
3
+ import { SCHEMA_VERSION } from "./shared/fields.js";
4
+ /** Where the `$id` of every file kind's JSON Schema starts. Nothing is hosted there yet. */
5
+ export const SPEC_ID_BASE = "https://halonic.com/spec/format";
6
+ /**
7
+ * A kind's name in its spec file and `$id`: the kind name in kebab case,
8
+ * so `workflowTest` becomes `workflow-test`.
9
+ */
10
+ export function specName(kind) {
11
+ return kind.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
12
+ }
13
+ /**
14
+ * The `$id` of a kind's JSON Schema. It names the schema and the file format
15
+ * version it describes, for example
16
+ * `https://halonic.com/spec/format/workflow/v1.schema.json`.
17
+ */
18
+ export function specId(kind) {
19
+ return idOf(kind, toJsonSchema(fileKinds[kind].schema));
20
+ }
21
+ function idOf(kind, schema) {
22
+ return `${SPEC_ID_BASE}/${specName(kind)}/v${kindVersion(schema)}.schema.json`;
23
+ }
24
+ /**
25
+ * The file format version a kind's schema describes: the `const` of its
26
+ * `version` key. A kind without a `version` key (`skill`, whose file is
27
+ * SKILL.md front matter) falls back to the format's SCHEMA_VERSION.
28
+ */
29
+ function kindVersion(schema) {
30
+ const properties = schema["properties"];
31
+ return properties?.["version"]?.const ?? SCHEMA_VERSION;
32
+ }
33
+ /**
34
+ * The JSON Schema (2020-12) of a file kind, for editors, docs and other
35
+ * engines. It describes what a file may contain: keys with a default are
36
+ * not required. Checks over several fields can't be expressed and are left out.
37
+ *
38
+ * @example
39
+ * const schema = jsonSchemaOf("agent");
40
+ * schema["required"]; // ["id", "name"]
41
+ * schema["$id"]; // "https://halonic.com/spec/format/agent/v1.schema.json"
42
+ */
43
+ export function jsonSchemaOf(kind) {
44
+ // `$schema` and `$id` come first, where readers of the spec file look for
45
+ // them; the spread keeps a key where it was first set.
46
+ const schema = toJsonSchema(fileKinds[kind].schema);
47
+ return { $schema: JSON_SCHEMA_DRAFT, $id: idOf(kind, schema), ...schema };
48
+ }
@@ -0,0 +1,65 @@
1
+ import type { Path, Schema } from "../../schema-kit/src/index.js";
2
+ /**
3
+ * Where files of a kind sit in a workspace, in the one layout the new loader
4
+ * reads (plan 4.2): `agents/` and `workflows/` (with `workflows/routines/`)
5
+ * and `library/`, at the workspace root and inside each `hubs/<hub>/`.
6
+ */
7
+ export interface FilePlace {
8
+ /**
9
+ * `workspace`: at the workspace root only. `hub`: inside each
10
+ * `hubs/<hub>/` folder only. `workspace-and-hub`: both; at the root the
11
+ * item is shared with every hub (for agents and workflows the root acts as
12
+ * a hub of its own).
13
+ */
14
+ readonly scope: "workspace" | "hub" | "workspace-and-hub";
15
+ /** The folder inside that place, such as `library/connectors`; `""` for the place itself. */
16
+ readonly folder: string;
17
+ /**
18
+ * The file name. `<id>` stands for the item's id: `<id>.agent.yaml` is an
19
+ * agent whose id is the file name without `.agent.yaml`, and
20
+ * `<id>/SKILL.md` is a skill whose id is its folder.
21
+ */
22
+ readonly name: string;
23
+ }
24
+ /** How a kind's text is read: plain YAML, or Markdown with YAML front matter (`SKILL.md`). */
25
+ export type KindSyntax = "yaml" | "front-matter";
26
+ /** A problem a kind's own checks find in a value that passed its schema. */
27
+ export interface KindCheckProblem {
28
+ /** An error makes the file fail; a warning only informs. */
29
+ readonly severity: "error" | "warning";
30
+ /** A stable name for the rule, such as `default-deployment-not-listed`. */
31
+ readonly code: string;
32
+ /** Where the problem sits in the file. */
33
+ readonly path: Path;
34
+ readonly message: string;
35
+ }
36
+ /**
37
+ * One kind of workspace file: how it's read, its schema with every default,
38
+ * the checks that need more than one field, and where its files sit.
39
+ * The registry lists every kind, so the loader and the tooling need no
40
+ * switch over kind names.
41
+ */
42
+ export interface FileKind<Value = unknown> {
43
+ /** The kind's name, as the old schema export named it: `workspace`, `workflowTest`, … */
44
+ readonly name: string;
45
+ /** One line on what the file is for. */
46
+ readonly about: string;
47
+ readonly syntax: KindSyntax;
48
+ /** The schema of the file's content, with every default. Its JSON Schema is the kind's. */
49
+ readonly schema: Schema<Value, unknown>;
50
+ /** Where the kind's files sit. Empty for none. */
51
+ readonly places: readonly FilePlace[];
52
+ /**
53
+ * How the id the file's place gives (its file name or folder) is used:
54
+ * `fallback` fills `id` in when the file has none, `always` overrides it,
55
+ * `none` ignores it.
56
+ */
57
+ readonly idFromPlace: "fallback" | "always" | "none";
58
+ /**
59
+ * Reads old key names as their new ones before the schema sees the data,
60
+ * so older files keep loading (for example `flow:` for `workflow:`).
61
+ */
62
+ readonly upgradeKeys?: (data: Readonly<Record<string, unknown>>) => Record<string, unknown>;
63
+ /** Checks that span several fields, run after the schema passed. */
64
+ readonly check?: (value: Value) => readonly KindCheckProblem[];
65
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { FileKind } from "../../kind.js";
2
+ import { Agent } from "./schema.js";
3
+ /** `agents/<id>.agent.yaml`, at the root or in a hub. */
4
+ export declare const agentKind: FileKind<Agent>;
@@ -0,0 +1,10 @@
1
+ import { Agent } from "./schema.js";
2
+ /** `agents/<id>.agent.yaml`, at the root or in a hub. */
3
+ export const agentKind = {
4
+ name: "agent",
5
+ about: "An agent: its model, instructions, tools, methods and character.",
6
+ syntax: "yaml",
7
+ schema: Agent,
8
+ places: [{ scope: "workspace-and-hub", folder: "agents", name: "<id>.agent.yaml" }],
9
+ idFromPlace: "fallback",
10
+ };
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The harnesses an agent can run in: Halonic's own loop, Claude Code or
3
+ * Codex. A closed list, so a typo fails `halonic validate`; each new harness
4
+ * adds a value here.
5
+ */
6
+ export declare const AgentHarness: import("zod").ZodEnum<{
7
+ "claude-code": "claude-code";
8
+ codex: "codex";
9
+ halonic: "halonic";
10
+ }>;
11
+ /** The ids of the harnesses an agent can run in, for a caller that checks one outside an agent's file. */
12
+ export declare const AGENT_HARNESSES: readonly string[];
13
+ /** The most sites one agent may name (Julian's cap, HAL-1708). */
14
+ export declare const MAX_ALLOWED_SITES = 50;
15
+ /**
16
+ * The first parts of a workspace path that hold definition files or data
17
+ * that isn't the agent's to write: git's own folder, Halonic's reserved
18
+ * folder, every kind's folder, the hubs and the kind files in the workspace
19
+ * root. A test checks that every kind's place is covered, so a new kind
20
+ * can't be missed. They are compared after {@link foldName}.
21
+ */
22
+ export declare const PROTECTED_TOP_NAMES: readonly string[];
23
+ /**
24
+ * The working folder an agent gets when its file names none.
25
+ *
26
+ * @example
27
+ * defaultWorkingFolder("writer"); // "files/agents/writer"
28
+ */
29
+ export declare function defaultWorkingFolder(agentId: string): string;
30
+ /**
31
+ * Why a working folder can't be used, or `null` when it can. It must be a
32
+ * path relative to the workspace with `/` between its parts, that stays in
33
+ * the workspace and doesn't point into a {@link PROTECTED_TOP_NAMES} entry
34
+ * or, at any depth, a folder whose name starts with `.`: tools such as git,
35
+ * Claude Code, Codex and editors read hooks, commands and tasks from those
36
+ * (`.git`, `.claude`, `.codex`, `.vscode`), and would run them outside the
37
+ * sandbox. Any depth, because a nested clone such as `vendor/lib` has a
38
+ * `.git` of its own (HAL-5951). Parts that Windows or macOS would read as
39
+ * another name are refused too, in fullwidth forms as well (see
40
+ * {@link relativePathProblem}). Symlinks are resolved later, when the
41
+ * sandbox profile is built.
42
+ *
43
+ * @param path - the `workingFolder` value
44
+ * @returns a message, or `null`
45
+ */
46
+ export declare function workingFolderProblem(path: string): string | null;
47
+ /**
48
+ * Whether a workspace path is a working folder or inside it, as a file
49
+ * system that ignores case sees it. Both are relative to the workspace root.
50
+ * `path` may be written loosely, as a program's folder or argument is: with
51
+ * `\`, `.` or `..` parts, or a part that ends in `.` or a space, which
52
+ * Windows drops. An absolute path, or one that leaves the workspace, is
53
+ * never inside: who checks those must know where the workspace is.
54
+ *
55
+ * @param path - a path relative to the workspace root
56
+ * @param workingFolder - a `workingFolder` that passed {@link workingFolderProblem}
57
+ * @returns `true` when the path is the folder or inside it
58
+ *
59
+ * @example
60
+ * isInWorkingFolder("Scripts\\mail.sh", "scripts"); // true
61
+ * isInWorkingFolder("scripts-old/mail.sh", "scripts"); // false
62
+ */
63
+ export declare function isInWorkingFolder(path: string, workingFolder: string): boolean;
64
+ /**
65
+ * Why an allowed site can't be used, or `null` when it can. A site is a host
66
+ * name with at least two labels, such as `api.example.com`, or `*.` and a
67
+ * domain with at least two labels, such as `*.example.com`. No address in any
68
+ * notation (a last label starting with a digit, so `127.0x1` too), port,
69
+ * scheme or path, no bare `*`, and no `localhost`, `local`, `localdomain`,
70
+ * `internal` or `arpa` names, which would reach this computer or the local
71
+ * network. Fullwidth forms, ideographic dots, control characters and
72
+ * invisible code points are refused, since a URL parser would map them to
73
+ * another name.
74
+ *
75
+ * @param site - an `allowedSites` entry, in any case and in Unicode or ASCII
76
+ * @returns a message, or `null`
77
+ */
78
+ export declare function allowedSiteProblem(site: string): string | null;
79
+ /**
80
+ * The allowed sites in the form the sandbox and the trust prompt use:
81
+ * lowercase, in ASCII (Punycode) and each once, in the order first named.
82
+ *
83
+ * @example
84
+ * asciiAllowedSites(["API.Example.com", "bücher.example", "api.example.com"]);
85
+ * // => ["api.example.com", "xn--bcher-kva.example"]
86
+ */
87
+ export declare function asciiAllowedSites(sites: readonly string[]): string[];
88
+ /** The `workingFolder` field: a folder in the workspace the agent may write to. */
89
+ export declare const WorkingFolder: import("zod").ZodString;
90
+ /** One `allowedSites` entry: a host name, or `*.` and a domain. */
91
+ export declare const AllowedSite: import("zod").ZodString;
92
+ /**
93
+ * A list of {@link AllowedSite}s, at most {@link MAX_ALLOWED_SITES}, for a
94
+ * field inside a union, such as a connector's `transport`. The cap is a
95
+ * refinement rather than `max`, because a union reports a list that's too
96
+ * long only as its whole input being wrong, not at the list. The JSON
97
+ * Schema still shows the cap as `maxItems`, so editors know it too.
98
+ */
99
+ export declare const AllowedSitesInUnion: import("zod").ZodArray<import("zod").ZodString>;