@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,27 @@
1
+ /** Version of the {@link HttpClient} port. A breaking change bumps it and comes with an ADR. */
2
+ export declare const httpClientVersion = 1;
3
+ /**
4
+ * Outbound HTTP for adapters and the host: model APIs, HTTP connectors,
5
+ * Google, webhooks. Replaces the old `FetchLike`. The same signature as the
6
+ * Web `fetch`, so most adapters wrap it directly. Some refuse addresses:
7
+ * the container target refuses loopback, link-local and private addresses
8
+ * unless a connector is explicitly allowed.
9
+ *
10
+ * An adapter that refuses addresses checks every redirect hop, and the
11
+ * address a host name resolves to when it connects, not only the first URL.
12
+ * Otherwise a redirect or a DNS answer that changes between check and
13
+ * connect (DNS rebinding) gets around it.
14
+ *
15
+ * Every adapter passes `init.redirect` and `init.signal` through to the
16
+ * request. Callers rely on both: `redirect: "error"` keeps a bearer token
17
+ * from following a redirect to another address, and `signal` is how they
18
+ * put a time limit on a request.
19
+ */
20
+ export interface HttpClient {
21
+ /**
22
+ * Sends one request. An HTTP error status still resolves; check `ok`.
23
+ *
24
+ * @throws when the network fails, the request is aborted or the address is refused
25
+ */
26
+ fetch(url: string, init?: RequestInit): Promise<Response>;
27
+ }
@@ -0,0 +1,2 @@
1
+ /** Version of the {@link HttpClient} port. A breaking change bumps it and comes with an ADR. */
2
+ export const httpClientVersion = 1;
@@ -0,0 +1,14 @@
1
+ /** Version of the {@link IdGenerator} port. A breaking change bumps it and comes with an ADR. */
2
+ export declare const idGeneratorVersion = 1;
3
+ /**
4
+ * Makes unique ids. Passed in, so the core needs no platform randomness and
5
+ * tests can record event logs with fixed ids.
6
+ *
7
+ * Ids are unique, **not secret**: tests make them predictable on purpose.
8
+ * Anything that must be unguessable, such as a session token, uses
9
+ * `crypto.getRandomValues` instead.
10
+ */
11
+ export interface IdGenerator {
12
+ /** A new id that starts with the prefix, such as "run_…". */
13
+ next(prefix: string): string;
14
+ }
@@ -0,0 +1,2 @@
1
+ /** Version of the {@link IdGenerator} port. A breaking change bumps it and comes with an ADR. */
2
+ export const idGeneratorVersion = 1;
@@ -0,0 +1,45 @@
1
+ export { type AgentPlacementKey, type AgentPlacementRecord, type AgentPlacementStore, agentPlacementStoreVersion, isAgentPlacementFor, } from "./agent-placement-store.js";
2
+ export { AgentRunsNotAvailable, isAgentRunsNotAvailable } from "./agent-runs-not-available.js";
3
+ export { type BlobRef, type BlobStore, blobStoreVersion, checkBlobMediaType, isBlobHash, } from "./blob-store.js";
4
+ export { CantTryError, isCantTryError } from "./cant-try-error.js";
5
+ export type { ChatMessage, ChatParams, ChatRequest, ChatResponse, ChatStreamEvent, ProviderReplay, ToolCall, ToolDefinition, } from "./chat.js";
6
+ export { type Clock, clockVersion } from "./clock.js";
7
+ export { type ConnectionKey, type ConnectionSettingsRecord, type ConnectionSettingsStore, connectionSettingsStoreVersion, } from "./connection-settings-store.js";
8
+ export { type ConnectorCallOptions, type ConnectorClient, type ConnectorConfig, type ConnectorFactory, type ConnectorFactoryContext, type ConnectorPin, type ConnectorTool, type ConnectorTransport, connectorClientVersion, passesNameRule, type ToolRisk, type TrustGrant, } from "./connector-client.js";
9
+ export { type Coordination, type CounterResult, coordinationVersion, type Lease, type WindowCount, } from "./coordination.js";
10
+ export { checkPublicWorkspacePath, checkWorkspacePath, type DefinitionSource, type DefinitionStore, type DefinitionWatch, type DefinitionWatchListener, definitionStoreVersion, type ExpectedContent, isPrivateWorkspacePath, isUnreadableWorkspaceFolderError, type RemoveOptions, type RemoveResult, segmentAsOpened, UnreadableWorkspaceFolderError, type WorkspaceFileChange, type WriteOptions, type WriteResult, } from "./definition-store.js";
11
+ export { type Digest, digestVersion } from "./digest.js";
12
+ export { type FolderEntriesOptions, type FolderEntry, type FolderReader, folderReaderVersion, } from "./folder-reader.js";
13
+ export { addHarnessEnvironment, type Harness, type HarnessBridge, type HarnessDetection, type HarnessDetectOptions, type HarnessEvent, type HarnessInput, type HarnessRun, type HarnessSignIn, type HarnessTask, harnessBridgeTokenHeader, harnessVersion, } from "./harness.js";
14
+ export { type BridgeApprovalDecision, type BridgeApprovalRequest, type BridgeApprovals, type BridgeCallCharge, type BridgeEvent, type BridgeProvider, type BridgeProviderAccess, type BridgeRecorder, type BridgeToolCheck, type BridgeToolResult, type BridgeTools, bridgeCallCharge, bridgeCallCost, type HarnessBridgeOptions, type HarnessBridgeServer, harnessBridgeServerVersion, type OpenHarnessBridge, } from "./harness-bridge-server.js";
15
+ export { type SignInShell, signInCommandText } from "./harness-sign-in-command.js";
16
+ export { changeSavedHostSettings, type HostSettingsStore, type HostSettingValue, type HostSettingValues, hostSettingsMaxBytes, hostSettingsStoreVersion, isHostSettingKey, readSavedHostSettings, type SavedHostSettingsChange, } from "./host-settings-store.js";
17
+ export { type HttpClient, httpClientVersion } from "./http-client.js";
18
+ export { type IdGenerator, idGeneratorVersion } from "./id-generator.js";
19
+ export { type InstructionChanges, type InstructionPin, type InstructionTrustKey, type InstructionTrustRecord, type InstructionTrustStore, instructionTrustStoreVersion, isInstructionTrustFor, } from "./instruction-trust-store.js";
20
+ export { type AuthPlacement, type Integration, type IntegrationConnection, type IntegrationHost, type IntegrationHttpClient, type IntegrationRequestInit, type IntegrationTool, integrationVersion, maxIntegrationWaitMs, type SecretPlacement, SignInNeededError, type SignInPlacement, type SignInTokens, } from "./integration.js";
21
+ export { type KnowledgeCapabilities, type KnowledgeDoc, type KnowledgeHit, type KnowledgeProvider, type KnowledgeProviderContext, type KnowledgeProviderFactory, knowledgeProviderVersion, } from "./knowledge-provider.js";
22
+ export { type LlmCache, llmCacheVersion } from "./llm-cache.js";
23
+ export { isModelCallError, isModelOutOfMemory, isVendorErrorText, type LlmCapabilities, type LlmProvider, type LlmProviderFactory, llmProviderVersion, ModelCallError, type ModelCallErrorReason, modelCallErrorReasons, type ProviderConfig, type ProviderFactoryContext, VendorErrorText, } from "./llm-provider.js";
24
+ export { type ModelPrice, priceOf } from "./model-price.js";
25
+ export { type PasswordHasher, passwordHasherVersion } from "./password-hasher.js";
26
+ export { checkPluginFiles, checkPluginId, type PlacePluginOptions, type PluginFolderWriter, type PluginPlacement, pluginFolderWriterVersion, } from "./plugin-folder-writer.js";
27
+ export { type PortName, portVersions } from "./port-versions.js";
28
+ export { type ProgramProbe, type ProgramProbeResult, type ProgramQuestion, type ProgramSettingsFolder, programProbeVersion, } from "./program-probe.js";
29
+ export { defaultBaseUrl } from "./provider-default-base-url.js";
30
+ export { type CurrentRecord, compactedChanges, foldRecords, formatRecordLines, parseRecordLines, type RecordChange, type RecordStore, recordStoreVersion, } from "./record-store.js";
31
+ export { type FolderSize, type ProcessUsage, type ResourceProbe, resourceProbeVersion, } from "./resource-probe.js";
32
+ export { type ChatAgentSettings, type ChatTurnRefusal, type ChatTurnRequest, type ChatTurnResponse, type ChatTurnSkip, type EngineConnection, type EngineConnectionState, type RunEventListener, type RunExecutor, type RunSubscription, runExecutorVersion, type SendOptions, type StartAgentRequest, type StartRunRequest, } from "./run-executor.js";
33
+ export { type AdapterFailure, adapterFailures, isRunFailureError, RunFailureError, } from "./run-failure-error.js";
34
+ export { type AppendOptions, type AppendResult, checkRunAppend, checkRunId, compareRunSummaries, formatLogLines, isRunId, matchesRunFilter, parseLogLines, type RunFilter, type RunLockRecord, type RunSnapshot, type RunStore, runLockFormat, runLockStaleAfterMs, runLockTakeoverStaleAfterMs, runStoreVersion, startedAtOrAfter, } from "./run-store.js";
35
+ export { isRunTargetNotFound, type RunTargetKind, RunTargetNotFound, } from "./run-target-not-found.js";
36
+ export { type Sandbox, type SandboxBlock, type SandboxBlockListener, type SandboxBridge, type SandboxCapabilities, type SandboxCheck, type SandboxCommand, type SandboxExit, type SandboxFence, type SandboxFileAccess, type SandboxFix, type SandboxNetwork, type SandboxPackageManager, type SandboxProcess, type SandboxProfile, type SandboxSession, type SandboxStrength, type SandboxUnavailableReason, sandboxPackageManagers, sandboxUnavailableReasons, sandboxVersion, } from "./sandbox.js";
37
+ export { isSandboxSetting, type SandboxBackendId, type SandboxSetting, type SandboxSettingStore, sandboxBackendIds, sandboxSettingStoreVersion, } from "./sandbox-setting-store.js";
38
+ export { type ScheduledTimer, type Scheduler, type SchedulerFactory, type SchedulerListener, schedulerVersion, } from "./scheduler.js";
39
+ export { checkSecretValue, describeSecretName, halonicSecretNames, isHalonicSecretName, isPluginSecretName, isQuotableSecretName, isSecretName, maxSecretNameLength, maxSecretValueLength, pluginSecretNamePrefix, pluginSecretSeparator, pluginSecrets, type SecretStore, type Secrets, secretKey, secretsVersion, tokenNamePrefix, workspaceSecrets, } from "./secrets.js";
40
+ export { type TokenStore, tokenStoreVersion } from "./token-store.js";
41
+ export { isUnreadableToolApprovalError, keptWaitingVersions, type ListedToolFingerprint, type ListedToolText, listedToolFingerprintPattern, maxWaitingTools, maxWaitingVersions, type ToolApproval, type ToolApprovalKey, type ToolApprovalStore, type ToolServer, toolApprovalStoreVersion, UnreadableToolApprovalError, type WaitingVersion, type WrittenDigest, waitingVersionKeptMs, } from "./tool-approval-store.js";
42
+ export { type TrustOrigin, type TrustRecord, type TrustStore, trustStoreVersion, } from "./trust-store.js";
43
+ export { type UnfencedRunConsent, type UnfencedRunConsentStore, unfencedRunConsentStoreVersion, } from "./unfenced-run-consent-store.js";
44
+ export { checkCommitId, checkProposalRef, unversionedFolders, type Vcs, type VcsApplyOptions, type VcsChange, type VcsCommit, type VcsCommitVersionOptions, type VcsCommitWorktreeOptions, type VcsDiffStatus, type VcsFileDiff, type VcsFileStatus, type VcsStatus, type VcsWorktree, vcsVersion, } from "./vcs.js";
45
+ export { parseStatus } from "./vcs-status.js";
@@ -0,0 +1,44 @@
1
+ export { agentPlacementStoreVersion, isAgentPlacementFor, } from "./agent-placement-store.js";
2
+ export { AgentRunsNotAvailable, isAgentRunsNotAvailable } from "./agent-runs-not-available.js";
3
+ export { blobStoreVersion, checkBlobMediaType, isBlobHash, } from "./blob-store.js";
4
+ export { CantTryError, isCantTryError } from "./cant-try-error.js";
5
+ export { clockVersion } from "./clock.js";
6
+ export { connectionSettingsStoreVersion, } from "./connection-settings-store.js";
7
+ export { connectorClientVersion, passesNameRule, } from "./connector-client.js";
8
+ export { coordinationVersion, } from "./coordination.js";
9
+ export { checkPublicWorkspacePath, checkWorkspacePath, definitionStoreVersion, isPrivateWorkspacePath, isUnreadableWorkspaceFolderError, segmentAsOpened, UnreadableWorkspaceFolderError, } from "./definition-store.js";
10
+ export { digestVersion } from "./digest.js";
11
+ export { folderReaderVersion, } from "./folder-reader.js";
12
+ export { addHarnessEnvironment, harnessBridgeTokenHeader, harnessVersion, } from "./harness.js";
13
+ export { bridgeCallCharge, bridgeCallCost, harnessBridgeServerVersion, } from "./harness-bridge-server.js";
14
+ export { signInCommandText } from "./harness-sign-in-command.js";
15
+ export { changeSavedHostSettings, hostSettingsMaxBytes, hostSettingsStoreVersion, isHostSettingKey, readSavedHostSettings, } from "./host-settings-store.js";
16
+ export { httpClientVersion } from "./http-client.js";
17
+ export { idGeneratorVersion } from "./id-generator.js";
18
+ export { instructionTrustStoreVersion, isInstructionTrustFor, } from "./instruction-trust-store.js";
19
+ export { integrationVersion, maxIntegrationWaitMs, SignInNeededError, } from "./integration.js";
20
+ export { knowledgeProviderVersion, } from "./knowledge-provider.js";
21
+ export { llmCacheVersion } from "./llm-cache.js";
22
+ export { isModelCallError, isModelOutOfMemory, isVendorErrorText, llmProviderVersion, ModelCallError, modelCallErrorReasons, VendorErrorText, } from "./llm-provider.js";
23
+ export { priceOf } from "./model-price.js";
24
+ export { passwordHasherVersion } from "./password-hasher.js";
25
+ export { checkPluginFiles, checkPluginId, pluginFolderWriterVersion, } from "./plugin-folder-writer.js";
26
+ export { portVersions } from "./port-versions.js";
27
+ export { programProbeVersion, } from "./program-probe.js";
28
+ export { defaultBaseUrl } from "./provider-default-base-url.js";
29
+ export { compactedChanges, foldRecords, formatRecordLines, parseRecordLines, recordStoreVersion, } from "./record-store.js";
30
+ export { resourceProbeVersion, } from "./resource-probe.js";
31
+ export { runExecutorVersion, } from "./run-executor.js";
32
+ export { adapterFailures, isRunFailureError, RunFailureError, } from "./run-failure-error.js";
33
+ export { checkRunAppend, checkRunId, compareRunSummaries, formatLogLines, isRunId, matchesRunFilter, parseLogLines, runLockFormat, runLockStaleAfterMs, runLockTakeoverStaleAfterMs, runStoreVersion, startedAtOrAfter, } from "./run-store.js";
34
+ export { isRunTargetNotFound, RunTargetNotFound, } from "./run-target-not-found.js";
35
+ export { sandboxPackageManagers, sandboxUnavailableReasons, sandboxVersion, } from "./sandbox.js";
36
+ export { isSandboxSetting, sandboxBackendIds, sandboxSettingStoreVersion, } from "./sandbox-setting-store.js";
37
+ export { schedulerVersion, } from "./scheduler.js";
38
+ export { checkSecretValue, describeSecretName, halonicSecretNames, isHalonicSecretName, isPluginSecretName, isQuotableSecretName, isSecretName, maxSecretNameLength, maxSecretValueLength, pluginSecretNamePrefix, pluginSecretSeparator, pluginSecrets, secretKey, secretsVersion, tokenNamePrefix, workspaceSecrets, } from "./secrets.js";
39
+ export { tokenStoreVersion } from "./token-store.js";
40
+ export { isUnreadableToolApprovalError, keptWaitingVersions, listedToolFingerprintPattern, maxWaitingTools, maxWaitingVersions, toolApprovalStoreVersion, UnreadableToolApprovalError, waitingVersionKeptMs, } from "./tool-approval-store.js";
41
+ export { trustStoreVersion, } from "./trust-store.js";
42
+ export { unfencedRunConsentStoreVersion, } from "./unfenced-run-consent-store.js";
43
+ export { checkCommitId, checkProposalRef, unversionedFolders, vcsVersion, } from "./vcs.js";
44
+ export { parseStatus } from "./vcs-status.js";
@@ -0,0 +1,81 @@
1
+ /** Version of the {@link InstructionTrustStore} port. A breaking change bumps it and comes with an ADR. */
2
+ export declare const instructionTrustStoreVersion = 1;
3
+ /** What a run's instructions were: a digest per file, and one digest for all of them. */
4
+ export interface InstructionPin {
5
+ /** The digest of the whole set, so two runs with the same instructions share it. */
6
+ readonly digest: string;
7
+ /** Each file's `sha256:` digest, by file name. */
8
+ readonly files: Readonly<Record<string, string>>;
9
+ }
10
+ /** How a set of instructions differs from a trusted pin. */
11
+ export interface InstructionChanges {
12
+ readonly added: readonly string[];
13
+ readonly removed: readonly string[];
14
+ readonly changed: readonly string[];
15
+ }
16
+ /** Which agent's instructions a trusted pin is for. */
17
+ export interface InstructionTrustKey {
18
+ /** The workspace's resolved real path, as in a `TrustRecord`. */
19
+ location: string;
20
+ /** The agent's id in the workspace. */
21
+ agent: string;
22
+ }
23
+ /**
24
+ * The instructions a person trusted for one agent (requirement
25
+ * `ports.instruction-trust-store`): the pin of its `AGENTS.md` and skills as
26
+ * they were when the person said yes. Without a record, nothing is trusted
27
+ * and a person is asked.
28
+ *
29
+ * @example
30
+ * const trusted: InstructionTrustRecord = {
31
+ * location: "/workspaces/acme",
32
+ * agent: "coder",
33
+ * pin: { digest: "sha256:9f86d0…", files: { "AGENTS.md": "sha256:2c26b4…" } },
34
+ * grantedAt: "2026-11-15T10:00:00.000Z",
35
+ * };
36
+ */
37
+ export interface InstructionTrustRecord extends InstructionTrustKey {
38
+ /** The instructions the person trusted. */
39
+ pin: InstructionPin;
40
+ /** When the person trusted them, as ISO text. */
41
+ grantedAt: string;
42
+ }
43
+ /**
44
+ * Each agent's trusted instructions, in the user's profile next to the trust
45
+ * records: the profile folder for the CLI and `serve`, the app data folder
46
+ * for the desktop app, memory for tests and the browser demo. **Never inside
47
+ * a workspace**, so an agent that edits its own instructions can't also trust
48
+ * them.
49
+ *
50
+ * The port only stores pins. `instructionTrust` in `core/app` compares one
51
+ * with the instructions a run has, and the engine asks. Only a person trusts
52
+ * instructions: no tool the model can call reaches this store.
53
+ *
54
+ * A record that exists but can't be read makes `get` throw, never return
55
+ * `null`: the caller then asks the person, never trusts, and says why. The
56
+ * error names the record's key, and `remove` still deletes it.
57
+ */
58
+ export interface InstructionTrustStore {
59
+ /** The trusted instructions for one agent, or `null` when there are none. */
60
+ get(key: InstructionTrustKey): Promise<InstructionTrustRecord | null>;
61
+ /** Saves trusted instructions, replacing any with the same key. */
62
+ save(record: InstructionTrustRecord): Promise<void>;
63
+ /**
64
+ * Deletes the trusted instructions for one agent, even a record that can't
65
+ * be read. Removing a record that isn't there is not an error.
66
+ */
67
+ remove(key: InstructionTrustKey): Promise<void>;
68
+ }
69
+ /**
70
+ * Whether `value`, as read back from a store, is valid trusted instructions
71
+ * for `key`: exactly the fields of an {@link InstructionTrustRecord}, the key
72
+ * asked for, a pin whose `digest` and every file digest are in `sha256:` form,
73
+ * and a time that is text. Anything else is a damaged or borrowed record, such
74
+ * as a hand edit or a file copied from another agent, and must never count as
75
+ * trust. Every adapter checks what it reads with this, and the service in
76
+ * `core/app` checks what an adapter gives back with it again.
77
+ *
78
+ * @example
79
+ * isInstructionTrustFor(key, JSON.parse(text)); // false for `{ ...record, trusted: true }`
80
+ */
81
+ export declare function isInstructionTrustFor(key: InstructionTrustKey, value: unknown): value is InstructionTrustRecord;
@@ -0,0 +1,43 @@
1
+ /** Version of the {@link InstructionTrustStore} port. A breaking change bumps it and comes with an ADR. */
2
+ export const instructionTrustStoreVersion = 1;
3
+ const recordFields = ["location", "agent", "pin", "grantedAt"];
4
+ const pinFields = ["digest", "files"];
5
+ const digestPattern = /^sha256:[0-9a-f]{64}$/u;
6
+ /** Whether `value` is a plain object with exactly `fields`, each its own property. */
7
+ function hasExactlyFields(value, fields) {
8
+ if (typeof value !== "object" || value === null || Array.isArray(value))
9
+ return false;
10
+ return (Object.keys(value).length === fields.length &&
11
+ fields.every((field) => Object.hasOwn(value, field)));
12
+ }
13
+ function isPin(value) {
14
+ if (!hasExactlyFields(value, pinFields))
15
+ return false;
16
+ const digest = value["digest"];
17
+ const files = value["files"];
18
+ if (typeof digest !== "string" || !digestPattern.test(digest))
19
+ return false;
20
+ if (typeof files !== "object" || files === null || Array.isArray(files))
21
+ return false;
22
+ return Object.values(files).every((fileDigest) => typeof fileDigest === "string" && digestPattern.test(fileDigest));
23
+ }
24
+ /**
25
+ * Whether `value`, as read back from a store, is valid trusted instructions
26
+ * for `key`: exactly the fields of an {@link InstructionTrustRecord}, the key
27
+ * asked for, a pin whose `digest` and every file digest are in `sha256:` form,
28
+ * and a time that is text. Anything else is a damaged or borrowed record, such
29
+ * as a hand edit or a file copied from another agent, and must never count as
30
+ * trust. Every adapter checks what it reads with this, and the service in
31
+ * `core/app` checks what an adapter gives back with it again.
32
+ *
33
+ * @example
34
+ * isInstructionTrustFor(key, JSON.parse(text)); // false for `{ ...record, trusted: true }`
35
+ */
36
+ export function isInstructionTrustFor(key, value) {
37
+ if (!hasExactlyFields(value, recordFields))
38
+ return false;
39
+ return (value["location"] === key.location &&
40
+ value["agent"] === key.agent &&
41
+ typeof value["grantedAt"] === "string" &&
42
+ isPin(value["pin"]));
43
+ }
@@ -0,0 +1,242 @@
1
+ import type { ConnectorTool, ToolRisk } from "./connector-client.js";
2
+ import type { HttpClient } from "./http-client.js";
3
+ import type { KnowledgeProvider } from "./knowledge-provider.js";
4
+ import type { LlmProvider, ProviderConfig } from "./llm-provider.js";
5
+ import type { TokenStore } from "./token-store.js";
6
+ /**
7
+ * Version of the {@link Integration} and {@link IntegrationHost} ports. A
8
+ * change bumps it and comes with an ADR. An integration's permission sheet
9
+ * names the version it was built against (`kit`), and the loader refuses one
10
+ * built against a newer version than this. Version 2 adds the sheet's
11
+ * `signIns` and {@link SignInPlacement}; an integration built for version 1
12
+ * runs unchanged.
13
+ */
14
+ export declare const integrationVersion = 2;
15
+ /**
16
+ * The longest {@link IntegrationHost.wait} waits, in milliseconds (30 s). The
17
+ * host enforces it; it is exported so an integration can tell in advance
18
+ * that a server asks for a longer pause and give up instead.
19
+ */
20
+ export declare const maxIntegrationWaitMs = 30000;
21
+ /**
22
+ * A tool an integration offers: the {@link ConnectorTool} shape, with its
23
+ * `risk` required. The permission sheet lists the same tools with the same
24
+ * `risk` and `untrusted`, and the conformance suite fails when they differ.
25
+ */
26
+ export interface IntegrationTool extends ConnectorTool {
27
+ risk: ToolRisk;
28
+ }
29
+ /**
30
+ * Puts a configured secret into one request. The integration names the
31
+ * secret; the host looks up the value and places it, and only when the
32
+ * permission sheet allows that secret to go to the request's host. The
33
+ * integration never sees the value, so it can't put it in a URL, a tool
34
+ * result, an error or a log.
35
+ */
36
+ export type SecretPlacement =
37
+ /** `Authorization: Bearer <value>`. */
38
+ {
39
+ secret: string;
40
+ as: "bearer";
41
+ }
42
+ /** `<header>: <prefix><value>`, such as `x-api-key`. */
43
+ | {
44
+ secret: string;
45
+ as: "header";
46
+ header: string;
47
+ prefix?: string;
48
+ }
49
+ /** A field in a form body (`application/x-www-form-urlencoded`), such as an OAuth `client_secret`. */
50
+ | {
51
+ secret: string;
52
+ as: "form";
53
+ field: string;
54
+ };
55
+ /**
56
+ * Puts the access token of one sign-in the permission sheet declares into a
57
+ * request. Like a secret, the integration names the sign-in and the host
58
+ * places the token, only on the hosts the sheet lists for that sign-in. The
59
+ * integration can use the token but never read it. Only the access token can
60
+ * be placed: there is no `form` form.
61
+ */
62
+ export type SignInPlacement =
63
+ /** `Authorization: Bearer <value>`. */
64
+ {
65
+ signIn: string;
66
+ as: "bearer";
67
+ }
68
+ /** `<header>: <prefix><value>`. */
69
+ | {
70
+ signIn: string;
71
+ as: "header";
72
+ header: string;
73
+ prefix?: string;
74
+ };
75
+ /** A secret or a sign-in's access token, placed by the host. `secret` and `signIn` never appear together. */
76
+ export type AuthPlacement = SecretPlacement | SignInPlacement;
77
+ /** A request as an integration sends it: a Web `RequestInit`, plus where to put a secret or token. */
78
+ export interface IntegrationRequestInit extends RequestInit {
79
+ /** The secrets and sign-in tokens to place in this request. Each must be declared and allowed for the host. */
80
+ auth?: AuthPlacement | readonly AuthPlacement[];
81
+ }
82
+ /**
83
+ * Fresh access tokens for one integration's sign-ins, on Halonic's side of
84
+ * the line. The kit asks it for a token to place; it is never given to an
85
+ * integration, so a token can't be read, only used.
86
+ */
87
+ export interface SignInTokens {
88
+ /**
89
+ * A token valid for at least 60 more seconds, refreshed if needed.
90
+ *
91
+ * @throws {SignInNeededError} when the sign-in isn't signed in, or the
92
+ * server no longer accepts its refresh token, so the user must sign in
93
+ * again. Any other failure, such as a network error, is thrown as it is.
94
+ */
95
+ access(signIn: string, signal?: AbortSignal): Promise<string>;
96
+ /**
97
+ * The server answered 401 to `value`. Counts only if `value` is the
98
+ * current token of that sign-in.
99
+ */
100
+ rejected(signIn: string, value: string): void;
101
+ /**
102
+ * Every value the secret filter must remove: access tokens not yet
103
+ * expired, the refresh token and the client secret. Synchronous, so it
104
+ * holds only what has been loaded: before the first `access` for a
105
+ * sign-in it holds nothing for it, and nothing has been placed yet.
106
+ */
107
+ filterValues(): readonly string[];
108
+ }
109
+ /**
110
+ * The user has to sign in (again) before the sign-in's token can be used.
111
+ * {@link SignInTokens.access} throws it when there is no sign-in yet or the
112
+ * server answered `invalid_grant` to the refresh token. The kit turns it into
113
+ * the refusal `sign-in-needed`; a failure that signing in wouldn't fix, such
114
+ * as a network error, is not this error.
115
+ */
116
+ export declare class SignInNeededError extends Error {
117
+ readonly name = "SignInNeededError";
118
+ /** The sign-in, as the sheet names it. */
119
+ readonly signIn: string;
120
+ constructor(signIn: string, options?: ErrorOptions);
121
+ }
122
+ /**
123
+ * The only way an integration reaches the network. It sends only to the
124
+ * hosts the permission sheet declares (exact host, `https`), checks every
125
+ * redirect hop the same way, and places secrets for the integration.
126
+ *
127
+ * @example
128
+ * const response = await host.http.fetch("https://api.example.com/v1/forecast?city=Ghent", {
129
+ * auth: { secret: "example-key", as: "header", header: "x-api-key" },
130
+ * signal,
131
+ * });
132
+ */
133
+ export interface IntegrationHttpClient extends HttpClient {
134
+ /**
135
+ * Sends one request. An HTTP error status still resolves; check `ok`.
136
+ *
137
+ * @throws when the host, the scheme or a redirect isn't allowed, a secret
138
+ * isn't declared or isn't allowed for the host, the network fails, the
139
+ * request times out or is aborted, or the response is too large
140
+ */
141
+ fetch(url: string, init?: IntegrationRequestInit): Promise<Response>;
142
+ }
143
+ /**
144
+ * What an integration is given, and all it is given. There is no raw
145
+ * `HttpClient`, no `Secrets`, no file system and no timer: an integration
146
+ * reaches the outside world, and waits, only through these.
147
+ */
148
+ export interface IntegrationHost {
149
+ /** Outbound HTTP, limited to the declared hosts and secrets. */
150
+ readonly http: IntegrationHttpClient;
151
+ /**
152
+ * Tokens this integration writes itself, such as a refresh token. Only the
153
+ * names its permission sheet declares, and only its own: two integrations
154
+ * with a token of the same name never see each other's.
155
+ */
156
+ readonly tokens: TokenStore;
157
+ /**
158
+ * The settings the workspace gives this integration, such as a `baseUrl`
159
+ * or an account name. Never a secret value.
160
+ */
161
+ readonly settings: Readonly<Record<string, unknown>>;
162
+ /**
163
+ * Waits `ms` milliseconds, at most {@link maxIntegrationWaitMs}, such as
164
+ * the pause a server asks for with SSE `retry:` or `Retry-After`. The host
165
+ * clamps `ms`: `NaN` and negative values wait 0, `Infinity` waits the
166
+ * maximum. Pass the tool call's own `signal`, so cancelling the call also
167
+ * cancels the pause and a wait never outlives its call.
168
+ *
169
+ * @example
170
+ * await host.wait(retryMs, signal);
171
+ *
172
+ * @throws `signal.reason` when `signal` aborts during the wait or is already aborted
173
+ */
174
+ wait(ms: number, signal?: AbortSignal): Promise<void>;
175
+ }
176
+ /**
177
+ * One integration connected through its host. Created by
178
+ * {@link Integration.connect}; the host closes it when the workspace no
179
+ * longer needs it.
180
+ */
181
+ export interface IntegrationConnection {
182
+ /**
183
+ * Calls one of the integration's tools and returns its text result.
184
+ *
185
+ * @throws when the tool fails, the host refuses a request or `signal` aborts the call
186
+ */
187
+ callTool(name: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<string>;
188
+ /**
189
+ * The tools offered now, when they can change while connected (an MCP
190
+ * server). Without it the declared `tools` are the list. The host treats a
191
+ * tool it finds here but not in the declaration as `risk: "write"` unless
192
+ * the workspace sets a lower one.
193
+ *
194
+ * A server the workspace chose wrote such a tool, so the host also rebuilds
195
+ * its parameters from an allow-list, fences off its description, schema
196
+ * texts and results as untrusted text, and refuses tools that are too large
197
+ * or whose names it can't check (requirement
198
+ * `ports.untrusted-tool-listings`). Don't fence them here, and don't mark
199
+ * them trusted. For a declared name, the host uses the declared tool
200
+ * instead of the listed one.
201
+ */
202
+ listTools?(): Promise<IntegrationTool[]>;
203
+ /** Builds a model provider, for an integration whose sheet `provides` `llm`. */
204
+ createLlmProvider?(config: ProviderConfig): LlmProvider;
205
+ /** Builds a knowledge source, for an integration whose sheet `provides` `knowledge`. */
206
+ createKnowledgeProvider?(source: {
207
+ id: string;
208
+ config: Record<string, unknown>;
209
+ }): KnowledgeProvider;
210
+ /** Releases what the connection holds. Safe to call twice. */
211
+ close(): Promise<void>;
212
+ }
213
+ /**
214
+ * An integration as its package exports it: what it is, which tools it
215
+ * offers, and how to connect it. Its permission sheet (`integration.yaml`)
216
+ * declares the same name, version and tools, plus the hosts, secrets and
217
+ * tokens it may use.
218
+ *
219
+ * @example
220
+ * export const weather: Integration = {
221
+ * name: "weather",
222
+ * version: "1.0.0",
223
+ * tools: [{ name: "forecast", description: "…", parameters: { type: "object" }, risk: "read", untrusted: true }],
224
+ * connect: (host) => ({
225
+ * callTool: async (_name, args, signal) => {
226
+ * const response = await host.http.fetch(`https://api.example.com/v1/forecast?city=${encodeURIComponent(String(args["city"]))}`, { signal });
227
+ * return await response.text();
228
+ * },
229
+ * close: async () => {},
230
+ * }),
231
+ * };
232
+ */
233
+ export interface Integration {
234
+ /** The integration's name: lower-case words joined by `-`. The sheet's `id`. */
235
+ readonly name: string;
236
+ /** Its version, `major.minor.patch`. The sheet's `version`. */
237
+ readonly version: string;
238
+ /** The tools it offers. Empty for an integration that only provides a model or knowledge. */
239
+ readonly tools: readonly IntegrationTool[];
240
+ /** Connects through the host. Must not send a request before the first call. */
241
+ connect(host: IntegrationHost): IntegrationConnection;
242
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Version of the {@link Integration} and {@link IntegrationHost} ports. A
3
+ * change bumps it and comes with an ADR. An integration's permission sheet
4
+ * names the version it was built against (`kit`), and the loader refuses one
5
+ * built against a newer version than this. Version 2 adds the sheet's
6
+ * `signIns` and {@link SignInPlacement}; an integration built for version 1
7
+ * runs unchanged.
8
+ */
9
+ export const integrationVersion = 2;
10
+ /**
11
+ * The longest {@link IntegrationHost.wait} waits, in milliseconds (30 s). The
12
+ * host enforces it; it is exported so an integration can tell in advance
13
+ * that a server asks for a longer pause and give up instead.
14
+ */
15
+ export const maxIntegrationWaitMs = 30_000;
16
+ /**
17
+ * The user has to sign in (again) before the sign-in's token can be used.
18
+ * {@link SignInTokens.access} throws it when there is no sign-in yet or the
19
+ * server answered `invalid_grant` to the refresh token. The kit turns it into
20
+ * the refusal `sign-in-needed`; a failure that signing in wouldn't fix, such
21
+ * as a network error, is not this error.
22
+ */
23
+ export class SignInNeededError extends Error {
24
+ name = "SignInNeededError";
25
+ /** The sign-in, as the sheet names it. */
26
+ signIn;
27
+ constructor(signIn, options) {
28
+ super(`The sign-in "${signIn}" needs the user to sign in again.`, options);
29
+ this.signIn = signIn;
30
+ }
31
+ }
@@ -0,0 +1,65 @@
1
+ import type { DefinitionSource } from "./definition-store.js";
2
+ import type { HttpClient } from "./http-client.js";
3
+ import type { Secrets } from "./secrets.js";
4
+ /** Version of the {@link KnowledgeProvider} and {@link KnowledgeProviderFactory} ports. A breaking change bumps it and comes with an ADR. */
5
+ export declare const knowledgeProviderVersion = 1;
6
+ /** One search result. */
7
+ export interface KnowledgeHit {
8
+ ref: string;
9
+ title: string;
10
+ snippet: string;
11
+ score: number;
12
+ }
13
+ /** One whole document. */
14
+ export interface KnowledgeDoc {
15
+ ref: string;
16
+ title: string;
17
+ content: string;
18
+ }
19
+ /** What a knowledge source can do. */
20
+ export interface KnowledgeCapabilities {
21
+ search: boolean;
22
+ semantic: boolean;
23
+ ingest: boolean;
24
+ }
25
+ /** A knowledge source agents can search and read. */
26
+ export interface KnowledgeProvider {
27
+ readonly id: string;
28
+ readonly capabilities: KnowledgeCapabilities;
29
+ /**
30
+ * Whether hits and documents may hold text someone outside the workspace
31
+ * wrote, such as a remote server's answers. Halonic fences that text off
32
+ * like an untrusted tool result, so instructions in it aren't followed.
33
+ * Leaving it out counts as `true`: only a source whose content the
34
+ * workspace itself wrote, such as its own files, says `false`.
35
+ */
36
+ readonly untrusted?: boolean;
37
+ /** The best matches first. */
38
+ search(query: string, options?: {
39
+ limit?: number;
40
+ }): Promise<KnowledgeHit[]>;
41
+ /** The document, or `null` when there is no such ref. */
42
+ get(ref: string): Promise<KnowledgeDoc | null>;
43
+ /** Every document's ref and title, when the provider can list them (for prompts and summaries). */
44
+ list?(): Promise<{
45
+ ref: string;
46
+ title: string;
47
+ }[]>;
48
+ }
49
+ /** What a factory may use to build a knowledge source. */
50
+ export interface KnowledgeProviderContext {
51
+ /** The workspace files; read-only, because a knowledge source never edits them. */
52
+ store: DefinitionSource;
53
+ /** The folder of the hub or workspace the source belongs to, relative to the store. */
54
+ basePath: string;
55
+ http: HttpClient;
56
+ secrets: Secrets;
57
+ }
58
+ /** Creates knowledge sources of one type from their config. */
59
+ export interface KnowledgeProviderFactory {
60
+ readonly type: string;
61
+ create(source: {
62
+ id: string;
63
+ config: Record<string, unknown>;
64
+ }, context: KnowledgeProviderContext): KnowledgeProvider;
65
+ }
@@ -0,0 +1,2 @@
1
+ /** Version of the {@link KnowledgeProvider} and {@link KnowledgeProviderFactory} ports. A breaking change bumps it and comes with an ADR. */
2
+ export const knowledgeProviderVersion = 1;
@@ -0,0 +1,13 @@
1
+ import type { ChatResponse } from "./chat.js";
2
+ /** Version of the {@link LlmCache} port. A breaking change bumps it and comes with an ADR. */
3
+ export declare const llmCacheVersion = 1;
4
+ /**
5
+ * Model answers by request: a hash of model, messages, tools and settings.
6
+ * A simulation re-run reuses them instead of calling the model again.
7
+ */
8
+ export interface LlmCache {
9
+ /** The cached answer, or `null` when there is none. */
10
+ get(key: string): Promise<ChatResponse | null>;
11
+ /** Stores an answer, replacing any answer already stored under the key. */
12
+ set(key: string, response: ChatResponse): Promise<void>;
13
+ }
@@ -0,0 +1,2 @@
1
+ /** Version of the {@link LlmCache} port. A breaking change bumps it and comes with an ADR. */
2
+ export const llmCacheVersion = 1;