@parcha/agentrun-serve 0.1.0-beta.58 → 0.1.0-beta.60

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 (474) hide show
  1. package/CHANGELOG.md +402 -1
  2. package/README.md +516 -190
  3. package/dist/acp-package.d.ts +5 -1
  4. package/dist/acp-package.js +19 -2
  5. package/dist/adapters.d.ts +23 -2
  6. package/dist/adapters.js +106 -33
  7. package/dist/agent-delete.d.ts +6 -9
  8. package/dist/agent-delete.js +5 -3
  9. package/dist/agent-package.js +11 -1
  10. package/dist/agents-store.js +1 -1
  11. package/dist/answer-text.d.ts +3 -0
  12. package/dist/answer-text.js +22 -0
  13. package/dist/api-only.d.ts +2 -2
  14. package/dist/api-only.js +3 -3
  15. package/dist/archil-routes.d.ts +4 -1
  16. package/dist/archil-routes.js +15 -12
  17. package/dist/archil-settings.d.ts +18 -8
  18. package/dist/archil-settings.js +35 -17
  19. package/dist/attach-conformance.js +5 -4
  20. package/dist/box-paths.d.ts +3 -2
  21. package/dist/box-paths.js +5 -4
  22. package/dist/browser-computer.d.ts +3 -8
  23. package/dist/browser-computer.js +12 -35
  24. package/dist/browser-cost.js +94 -20
  25. package/dist/capacity.d.ts +1 -1
  26. package/dist/capacity.js +3 -3
  27. package/dist/chatgpt-plan.d.ts +7 -0
  28. package/dist/chatgpt-plan.js +35 -11
  29. package/dist/claude-login-token.d.ts +20 -11
  30. package/dist/claude-login-token.js +175 -107
  31. package/dist/claude-login.d.ts +124 -33
  32. package/dist/claude-login.js +562 -85
  33. package/dist/claude-sign-in.d.ts +3 -0
  34. package/dist/claude-sign-in.js +10 -1
  35. package/dist/cli-learning/connections.js +1 -1
  36. package/dist/cli.js +323 -292
  37. package/dist/composio-made.d.ts +1 -6
  38. package/dist/composio-made.js +1 -6
  39. package/dist/composio-owners.d.ts +26 -0
  40. package/dist/composio-owners.js +36 -0
  41. package/dist/composio-preset.d.ts +56 -23
  42. package/dist/composio-preset.js +173 -77
  43. package/dist/composio-triggers.d.ts +4 -4
  44. package/dist/composio-triggers.js +6 -7
  45. package/dist/compute-cost.js +11 -2
  46. package/dist/computer-attach.d.ts +6 -3
  47. package/dist/computer-attach.js +41 -29
  48. package/dist/computer-held-routes.d.ts +1 -1
  49. package/dist/computer-held-routes.js +9 -4
  50. package/dist/computer-keys.d.ts +11 -1
  51. package/dist/computer-keys.js +26 -1
  52. package/dist/computer-record.js +3 -1
  53. package/dist/computer-view.d.ts +5 -3
  54. package/dist/computer-view.js +10 -6
  55. package/dist/computer-viewer.js +36 -7
  56. package/dist/computers.d.ts +2 -1
  57. package/dist/computers.js +6 -3
  58. package/dist/console/THIRD-PARTY-NOTICES.txt +50 -0
  59. package/dist/console/assets/backend-QnwGVBeU.js +166 -0
  60. package/dist/console/assets/index-DZi-muIj.js +629 -0
  61. package/dist/console/assets/share-pz61zIn9.js +6 -0
  62. package/dist/console/assets/styles-CcceGcu2.js +291 -0
  63. package/dist/console/assets/styles-fjQBFfMv.css +1 -0
  64. package/dist/console/index.html +4 -3
  65. package/dist/console/share.html +17 -0
  66. package/dist/decisions.d.ts +17 -7
  67. package/dist/decisions.js +41 -15
  68. package/dist/dial-relay.js +10 -4
  69. package/dist/docker-daemon.js +4 -5
  70. package/dist/docker-host-addresses.js +29 -11
  71. package/dist/email/account.d.ts +6 -0
  72. package/dist/email/account.js +6 -0
  73. package/dist/email/authentication.d.ts +21 -0
  74. package/dist/email/authentication.js +106 -0
  75. package/dist/email/email-faux.d.ts +11 -2
  76. package/dist/email/email-faux.js +21 -5
  77. package/dist/email/mail.d.ts +25 -0
  78. package/dist/email/mail.js +58 -2
  79. package/dist/email/names.js +2 -2
  80. package/dist/email/tools.d.ts +9 -4
  81. package/dist/email/tools.js +95 -13
  82. package/dist/env-switch.d.ts +12 -2
  83. package/dist/env-switch.js +23 -3
  84. package/dist/errors.d.ts +1 -0
  85. package/dist/errors.js +2 -0
  86. package/dist/factory-activity.d.ts +68 -0
  87. package/dist/factory-activity.js +153 -0
  88. package/dist/factory-runs.d.ts +11 -0
  89. package/dist/factory-runs.js +52 -0
  90. package/dist/fal-price.d.ts +11 -1
  91. package/dist/fal-price.js +33 -0
  92. package/dist/faux-computers.js +1 -1
  93. package/dist/filed-answer.d.ts +2 -2
  94. package/dist/filed-answer.js +2 -2
  95. package/dist/filed-tool.d.ts +32 -0
  96. package/dist/filed-tool.js +122 -0
  97. package/dist/graph-served.d.ts +10 -5
  98. package/dist/graph-served.js +40 -10
  99. package/dist/handed-values.js +1 -2
  100. package/dist/harness-check.d.ts +2 -1
  101. package/dist/harness-check.js +45 -12
  102. package/dist/harness-keys.d.ts +1 -2
  103. package/dist/harness-keys.js +10 -8
  104. package/dist/harness-opencode/facts.js +2 -0
  105. package/dist/harness-recipe-entry.d.ts +9 -3
  106. package/dist/harness-recipe-entry.js +18 -9
  107. package/dist/harness-recipe.d.ts +21 -0
  108. package/dist/harness-recipe.js +25 -3
  109. package/dist/harness-table.d.ts +12 -0
  110. package/dist/harness-table.js +21 -6
  111. package/dist/harness.js +6 -2
  112. package/dist/helper-env.d.ts +4 -1
  113. package/dist/helper-env.js +4 -1
  114. package/dist/host-check.d.ts +2 -3
  115. package/dist/host-check.js +13 -7
  116. package/dist/hosted-search.js +1 -1
  117. package/dist/import-worker.js +2 -2
  118. package/dist/import.d.ts +20 -8
  119. package/dist/import.js +448 -187
  120. package/dist/key-refusal.d.ts +14 -2
  121. package/dist/key-refusal.js +97 -33
  122. package/dist/learn/audit.d.ts +28 -27
  123. package/dist/learn/audit.js +87 -62
  124. package/dist/learn/check.js +1 -1
  125. package/dist/learn/commit.d.ts +35 -43
  126. package/dist/learn/commit.js +62 -270
  127. package/dist/learn/compile.d.ts +9 -6
  128. package/dist/learn/compile.js +51 -28
  129. package/dist/learn/corrections.js +1 -1
  130. package/dist/learn/delete.d.ts +5 -12
  131. package/dist/learn/delete.js +17 -30
  132. package/dist/learn/field-check.d.ts +111 -0
  133. package/dist/learn/field-check.js +174 -0
  134. package/dist/learn/forget-run.d.ts +16 -0
  135. package/dist/learn/forget-run.js +53 -0
  136. package/dist/learn/index.js +1 -1
  137. package/dist/learn/learning-of.d.ts +0 -4
  138. package/dist/learn/learning-of.js +0 -5
  139. package/dist/learn/ledger.d.ts +32 -29
  140. package/dist/learn/ledger.js +26 -19
  141. package/dist/learn/{folder.d.ts → legacy/folder.d.ts} +2 -1
  142. package/dist/learn/{folder.js → legacy/folder.js} +4 -7
  143. package/dist/learn/legacy/place.d.ts +16 -0
  144. package/dist/{workspace/learning-workspace.js → learn/legacy/place.js} +12 -42
  145. package/dist/learn/legacy/scrub.d.ts +28 -0
  146. package/dist/learn/legacy/scrub.js +258 -0
  147. package/dist/learn/promote.d.ts +119 -102
  148. package/dist/learn/promote.js +119 -262
  149. package/dist/learn/reset-ledger.d.ts +18 -0
  150. package/dist/learn/reset-ledger.js +14 -0
  151. package/dist/learn/rows.d.ts +186 -0
  152. package/dist/learn/rows.js +376 -0
  153. package/dist/learn/secrets.d.ts +4 -0
  154. package/dist/learn/secrets.js +12 -0
  155. package/dist/learn/workflow-draft.d.ts +4 -1
  156. package/dist/learn/workflow-draft.js +12 -2
  157. package/dist/learned-nodes.d.ts +8 -5
  158. package/dist/learned-nodes.js +8 -5
  159. package/dist/learned-workflow.d.ts +2 -1
  160. package/dist/learned-workflow.js +13 -10
  161. package/dist/learning-cost.d.ts +25 -8
  162. package/dist/learning-cost.js +23 -8
  163. package/dist/learning-reset.d.ts +1 -1
  164. package/dist/learning-reset.js +9 -11
  165. package/dist/learning-routes.d.ts +60 -81
  166. package/dist/learning-routes.js +187 -360
  167. package/dist/learning-setting.d.ts +6 -0
  168. package/dist/learning-setting.js +11 -1
  169. package/dist/learning-words.d.ts +2 -0
  170. package/dist/learning-words.js +2 -0
  171. package/dist/learning.d.ts +18 -24
  172. package/dist/learning.js +35 -66
  173. package/dist/listen-first.d.ts +5 -4
  174. package/dist/listen-first.js +4 -5
  175. package/dist/live-reach.d.ts +7 -0
  176. package/dist/live-reach.js +7 -0
  177. package/dist/mcp-api-only-origins.d.ts +15 -0
  178. package/dist/mcp-api-only-origins.js +40 -0
  179. package/dist/mcp-gateway.d.ts +22 -2
  180. package/dist/mcp-gateway.js +85 -11
  181. package/dist/mcp-oauth.d.ts +1 -1
  182. package/dist/mcp-oauth.js +3 -2
  183. package/dist/mcp-probe.d.ts +3 -0
  184. package/dist/mcp-probe.js +3 -0
  185. package/dist/mcp-resources.d.ts +1 -1
  186. package/dist/mcp-secret-writes.d.ts +24 -2
  187. package/dist/mcp-secret-writes.js +30 -2
  188. package/dist/mcp-servers-store.d.ts +52 -14
  189. package/dist/mcp-servers-store.js +165 -61
  190. package/dist/mcp-sources.d.ts +1 -2
  191. package/dist/mcp-sources.js +1 -2
  192. package/dist/mcp-store.d.ts +5 -5
  193. package/dist/mcp-store.js +3 -3
  194. package/dist/mcp.js +1 -1
  195. package/dist/model-gateway.d.ts +1 -1
  196. package/dist/model-gateway.js +20 -36
  197. package/dist/native/discovery.d.ts +6 -0
  198. package/dist/native/discovery.js +14 -1
  199. package/dist/native/remote.d.ts +5 -0
  200. package/dist/native/remote.js +16 -0
  201. package/dist/native/runtime.js +3 -2
  202. package/dist/observation/observer.d.ts +6 -6
  203. package/dist/ollama-provider.d.ts +23 -9
  204. package/dist/ollama-provider.js +49 -20
  205. package/dist/openapi.js +290 -79
  206. package/dist/otel/genai.d.ts +83 -7
  207. package/dist/otel/genai.js +69 -9
  208. package/dist/otel/tracer.d.ts +42 -13
  209. package/dist/otel/tracer.js +241 -56
  210. package/dist/page.d.ts +7 -1
  211. package/dist/page.js +76 -22
  212. package/dist/paid-calls.d.ts +6 -4
  213. package/dist/paid-calls.js +15 -7
  214. package/dist/place-offers.d.ts +58 -34
  215. package/dist/place-offers.js +96 -54
  216. package/dist/place.d.ts +41 -20
  217. package/dist/place.js +97 -47
  218. package/dist/print.js +1 -1
  219. package/dist/provider.d.ts +3 -2
  220. package/dist/provider.js +17 -8
  221. package/dist/purged-workflow.d.ts +0 -33
  222. package/dist/purged-workflow.js +3 -71
  223. package/dist/redact/match.d.ts +42 -9
  224. package/dist/redact/match.js +356 -54
  225. package/dist/run-census.d.ts +1 -1
  226. package/dist/run-census.js +4 -5
  227. package/dist/run-cut.js +4 -5
  228. package/dist/run-export-store.d.ts +15 -0
  229. package/dist/run-export-store.js +30 -0
  230. package/dist/run-export.d.ts +139 -0
  231. package/dist/run-export.js +379 -0
  232. package/dist/run-file-cut.d.ts +5 -0
  233. package/dist/run-file-cut.js +13 -0
  234. package/dist/run-launch.d.ts +3 -3
  235. package/dist/run-launch.js +16 -3
  236. package/dist/run-learning-served.d.ts +3 -3
  237. package/dist/run-learning-served.js +1 -1
  238. package/dist/run-listing.d.ts +1 -1
  239. package/dist/run-model-key.d.ts +15 -6
  240. package/dist/run-model-key.js +30 -31
  241. package/dist/run-reads-over-store.js +4 -4
  242. package/dist/run-secrets.js +3 -5
  243. package/dist/run-timeline-served.d.ts +1 -1
  244. package/dist/run-timeline-served.js +8 -5
  245. package/dist/runnable.js +26 -9
  246. package/dist/runner/adapter-loop.d.ts +35 -18
  247. package/dist/runner/adapter-loop.js +94 -47
  248. package/dist/runner/adapter-run-spec.d.ts +14 -1
  249. package/dist/runner/adapter-run-spec.js +73 -46
  250. package/dist/runner/adapters/pi.js +4 -2
  251. package/dist/runner/audit.d.ts +10 -9
  252. package/dist/runner/audit.js +64 -67
  253. package/dist/runner/beside.js +5 -6
  254. package/dist/runner/claim-secrets.d.ts +10 -3
  255. package/dist/runner/claim-secrets.js +29 -13
  256. package/dist/runner/cli-run-spec.d.ts +18 -0
  257. package/dist/runner/cli-run-spec.js +87 -58
  258. package/dist/runner/compare-end.d.ts +2 -3
  259. package/dist/runner/compare-end.js +30 -11
  260. package/dist/runner/conformance/harness.js +2 -3
  261. package/dist/runner/conformance/subject.d.ts +4 -1
  262. package/dist/runner/disk-free.d.ts +15 -4
  263. package/dist/runner/disk-free.js +25 -7
  264. package/dist/runner/feedback-round.d.ts +1 -1
  265. package/dist/runner/feedback-round.js +2 -2
  266. package/dist/runner/harness-loops.js +3 -4
  267. package/dist/runner/held.d.ts +5 -12
  268. package/dist/runner/held.js +0 -25
  269. package/dist/runner/journal-kinds.d.ts +8 -2
  270. package/dist/runner/journal-kinds.js +23 -5
  271. package/dist/runner/learned-first.d.ts +0 -2
  272. package/dist/runner/learned-first.js +23 -7
  273. package/dist/runner/learning-end.d.ts +14 -24
  274. package/dist/runner/learning-end.js +52 -94
  275. package/dist/runner/learning-seed.d.ts +13 -16
  276. package/dist/runner/learning-seed.js +13 -23
  277. package/dist/runner/live-ticker.js +7 -5
  278. package/dist/runner/loop-contract.d.ts +0 -2
  279. package/dist/runner/loop.d.ts +7 -0
  280. package/dist/runner/loop.js +1 -0
  281. package/dist/runner/main.js +13 -12
  282. package/dist/runner/mcp-claim.js +21 -5
  283. package/dist/runner/mcp-run.d.ts +4 -0
  284. package/dist/runner/mcp-run.js +2 -0
  285. package/dist/runner/meta-tools.js +3 -2
  286. package/dist/runner/metrics.d.ts +7 -0
  287. package/dist/runner/metrics.js +19 -0
  288. package/dist/runner/model-route.d.ts +10 -7
  289. package/dist/runner/model-route.js +79 -15
  290. package/dist/runner/native-loop.js +12 -11
  291. package/dist/runner/presence.d.ts +1 -4
  292. package/dist/runner/presence.js +6 -8
  293. package/dist/runner/promotion.d.ts +39 -36
  294. package/dist/runner/promotion.js +168 -112
  295. package/dist/runner/redact.d.ts +3 -1
  296. package/dist/runner/redact.js +5 -3
  297. package/dist/runner/reflect-hook.d.ts +2 -2
  298. package/dist/runner/reflect-hook.js +4 -1
  299. package/dist/runner/responses-fetch.d.ts +36 -0
  300. package/dist/runner/responses-fetch.js +511 -0
  301. package/dist/runner/run-child-host.d.ts +21 -14
  302. package/dist/runner/run-child-host.js +187 -141
  303. package/dist/runner/run-child.js +11 -4
  304. package/dist/runner/runner-check.js +5 -1
  305. package/dist/runner/runner.d.ts +3 -4
  306. package/dist/runner/runner.js +13 -9
  307. package/dist/runner/sdk-loop.js +10 -12
  308. package/dist/runner/spec-holds.d.ts +8 -1
  309. package/dist/runner/spec-holds.js +9 -4
  310. package/dist/runner/workflow-calls.d.ts +9 -0
  311. package/dist/runner/workflow-calls.js +150 -0
  312. package/dist/runner/workflow-first.d.ts +120 -32
  313. package/dist/runner/workflow-first.js +218 -94
  314. package/dist/runner/workflow-spec.js +1 -1
  315. package/dist/runs-over-store.js +8 -7
  316. package/dist/save-once.d.ts +14 -0
  317. package/dist/save-once.js +31 -0
  318. package/dist/scrub-command.d.ts +34 -31
  319. package/dist/scrub-command.js +116 -147
  320. package/dist/sdk/check.d.ts +1 -4
  321. package/dist/sdk/check.js +2 -3
  322. package/dist/sdk/runs.d.ts +26 -7
  323. package/dist/sdk/runs.js +194 -78
  324. package/dist/seal-key.js +4 -4
  325. package/dist/secret-cut.d.ts +3 -0
  326. package/dist/secret-cut.js +7 -1
  327. package/dist/secret-rules.d.ts +8 -1
  328. package/dist/secret-rules.js +482 -53
  329. package/dist/secrets.d.ts +55 -9
  330. package/dist/secrets.js +345 -21
  331. package/dist/server-fs.d.ts +1 -1
  332. package/dist/server-fs.js +1 -1
  333. package/dist/server-keys.d.ts +10 -3
  334. package/dist/server-keys.js +16 -3
  335. package/dist/server-secrets-store.js +2 -4
  336. package/dist/server.d.ts +30 -18
  337. package/dist/server.js +520 -238
  338. package/dist/share-context.d.ts +22 -0
  339. package/dist/share-context.js +76 -0
  340. package/dist/shell-lex.d.ts +105 -0
  341. package/dist/shell-lex.js +646 -0
  342. package/dist/sign-ins-store.d.ts +5 -7
  343. package/dist/sign-ins-store.js +12 -16
  344. package/dist/sign-ins.d.ts +7 -11
  345. package/dist/sign-ins.js +40 -41
  346. package/dist/skills/agentrun-serve/SKILL.md +5 -2
  347. package/dist/source-sync/auxiliary.js +2 -2
  348. package/dist/start-switches.d.ts +6 -5
  349. package/dist/start-switches.js +8 -4
  350. package/dist/stats.d.ts +5 -1
  351. package/dist/stats.js +1 -1
  352. package/dist/store/agent-body.js +2 -2
  353. package/dist/store/dialect.d.ts +4 -0
  354. package/dist/store/dialect.js +1 -0
  355. package/dist/store/index.d.ts +2 -2
  356. package/dist/store/index.js +1 -1
  357. package/dist/store/mcp-record-keys.d.ts +10 -0
  358. package/dist/store/mcp-record-keys.js +13 -0
  359. package/dist/store/postgres/dialect.js +2 -0
  360. package/dist/store/postgres/migrations/0029_run_launch_census_settle.sql +28 -0
  361. package/dist/store/postgres/migrations/0030_learning_ledger_epoch.sql +40 -0
  362. package/dist/store/postgres/migrations/0031_learning_ledger_calls.sql +12 -0
  363. package/dist/store/postgres/migrations/0032_learning_rows.sql +65 -0
  364. package/dist/store/postgres/store.js +4 -0
  365. package/dist/store/schema.d.ts +60 -11
  366. package/dist/store/schema.js +147 -17
  367. package/dist/store/seal.d.ts +4 -1
  368. package/dist/store/sqlite/learning-rows.d.ts +23 -0
  369. package/dist/store/sqlite/learning-rows.js +559 -0
  370. package/dist/store/sqlite/run-launch.d.ts +3 -10
  371. package/dist/store/sqlite/run-launch.js +12 -23
  372. package/dist/store/sqlite/run-patch.d.ts +17 -10
  373. package/dist/store/sqlite/run-patch.js +50 -13
  374. package/dist/store/sqlite/store.d.ts +9 -0
  375. package/dist/store/sqlite/store.js +194 -46
  376. package/dist/store/store-schema.js +3 -4
  377. package/dist/store/store.d.ts +286 -38
  378. package/dist/store/store.js +27 -11
  379. package/dist/store-reads/analytics.d.ts +2 -1
  380. package/dist/store-reads/analytics.js +7 -5
  381. package/dist/store-reads/journal.d.ts +33 -3
  382. package/dist/store-reads/journal.js +99 -4
  383. package/dist/store-reads/learning.d.ts +50 -45
  384. package/dist/store-reads/learning.js +153 -116
  385. package/dist/store-reads/loop.js +1 -1
  386. package/dist/store-reads/stats.d.ts +2 -2
  387. package/dist/store-reads/stats.js +13 -7
  388. package/dist/store-view.d.ts +24 -2
  389. package/dist/store-view.js +49 -17
  390. package/dist/suggestions.d.ts +1 -1
  391. package/dist/suggestions.js +29 -13
  392. package/dist/template-eval.d.ts +72 -9
  393. package/dist/template-eval.js +358 -64
  394. package/dist/templates.d.ts +10 -2
  395. package/dist/templates.js +31 -4
  396. package/dist/timeline/labels.d.ts +1 -1
  397. package/dist/timeline/labels.js +4 -3
  398. package/dist/timeline/timeline.d.ts +23 -11
  399. package/dist/timeline/timeline.js +115 -31
  400. package/dist/timeline/web-calls.d.ts +8 -6
  401. package/dist/timeline/web-calls.js +10 -6
  402. package/dist/tool-gate.d.ts +13 -1
  403. package/dist/tool-gate.js +43 -3
  404. package/dist/tool-keys-store.js +2 -4
  405. package/dist/tool-keys.d.ts +11 -0
  406. package/dist/tool-keys.js +16 -0
  407. package/dist/tool-plane.d.ts +54 -13
  408. package/dist/tool-plane.js +103 -32
  409. package/dist/tools.d.ts +5 -1
  410. package/dist/tools.js +7 -7
  411. package/dist/trigger-email.js +12 -6
  412. package/dist/triggers.d.ts +15 -34
  413. package/dist/triggers.js +119 -126
  414. package/dist/validate.d.ts +8 -1
  415. package/dist/validate.js +163 -23
  416. package/dist/web-fake.d.ts +2 -1
  417. package/dist/web-fake.js +8 -6
  418. package/dist/web-fetch.d.ts +8 -6
  419. package/dist/web-fetch.js +13 -11
  420. package/dist/web-holds.d.ts +34 -0
  421. package/dist/web-holds.js +89 -0
  422. package/dist/web-run.d.ts +32 -5
  423. package/dist/web-run.js +76 -28
  424. package/dist/web-save.js +23 -12
  425. package/dist/web-search.js +14 -25
  426. package/dist/wires.d.ts +4 -3
  427. package/dist/wires.js +5 -4
  428. package/dist/workspace/archil-claim.d.ts +12 -5
  429. package/dist/workspace/archil-claim.js +45 -5
  430. package/dist/workspace/archil-exec.js +1 -1
  431. package/dist/workspace/archil.d.ts +1 -1
  432. package/dist/workspace/archil.js +1 -1
  433. package/dist/workspace/attach.js +52 -19
  434. package/dist/workspace/attached-computers.d.ts +6 -2
  435. package/dist/workspace/attached-computers.js +5 -4
  436. package/dist/workspace/computer-deps.d.ts +23 -6
  437. package/dist/workspace/computer-deps.js +38 -18
  438. package/dist/workspace/computer-for-claim.d.ts +21 -4
  439. package/dist/workspace/computer-for-claim.js +160 -54
  440. package/dist/workspace/computer-intervals.d.ts +2 -0
  441. package/dist/workspace/computer-intervals.js +1 -1
  442. package/dist/workspace/computer-janitor.d.ts +48 -14
  443. package/dist/workspace/computer-janitor.js +153 -44
  444. package/dist/workspace/computer-kept.d.ts +158 -32
  445. package/dist/workspace/computer-kept.js +288 -63
  446. package/dist/workspace/computer-providers.d.ts +19 -4
  447. package/dist/workspace/computer-providers.js +40 -6
  448. package/dist/workspace/index.d.ts +2 -3
  449. package/dist/workspace/index.js +2 -3
  450. package/dist/workspace/local.js +41 -1
  451. package/dist/workspace/mount-revoke-left.d.ts +31 -0
  452. package/dist/workspace/mount-revoke-left.js +72 -0
  453. package/dist/workspace/paired-route.js +4 -5
  454. package/dist/workspace/paths.d.ts +0 -4
  455. package/dist/workspace/paths.js +0 -6
  456. package/dist/workspace/resolve-computer.d.ts +5 -2
  457. package/dist/workspace/resolve-computer.js +9 -3
  458. package/dist/workspace/run-end-computers.d.ts +11 -5
  459. package/dist/workspace/run-end-computers.js +153 -28
  460. package/dist/workspace/run-tools.d.ts +22 -3
  461. package/dist/workspace/run-tools.js +17 -5
  462. package/dist/workspace/run-workspace.d.ts +14 -1
  463. package/dist/workspace/run-workspace.js +34 -1
  464. package/dist/workspace/workspace.d.ts +7 -1
  465. package/dist/workspace/workspace.js +1 -1
  466. package/package.json +13 -14
  467. package/skills/agentrun-serve/SKILL.md +5 -2
  468. package/templates/README.md +22 -6
  469. package/templates/TOOLS.md +46 -0
  470. package/dist/console/assets/backend-CSAWUqtZ.js +0 -166
  471. package/dist/console/assets/index-Bwn1oTem.css +0 -1
  472. package/dist/console/assets/index-DPh29cyz.js +0 -747
  473. package/dist/workspace/learning-workspace.d.ts +0 -24
  474. /package/dist/learn/{learning.sh → legacy/learning.sh} +0 -0
package/dist/secrets.d.ts CHANGED
@@ -12,10 +12,6 @@ export declare const MCP_AUTH = "AGENTRUN_MCP_AUTH";
12
12
  /** The decision keys among them: a run's process gets them only on its decision descriptor (decisions.ts), never with
13
13
  * the secrets on its pipe, which are its tools' environment. */
14
14
  export declare const DECISION_KEYS: readonly string[];
15
- /** The runner's OpenTelemetry settings (its OTEL_* variables, JSON), handed to a run's process on the same pipe so the
16
- * run's trace is exported as the runner's would be: never in any environment (an OTLP header is a backend's key), held
17
- * apart from the secrets, so no tool's environment has them. Read by otel/tracer.ts (handedOtel). */
18
- export declare const OTEL_PAIR = "AGENTRUN_OTEL";
19
15
  /** NAME=VALUE pairs, each ended by a NUL: what a pipe of secrets carries. A runner writes a run's own process its pairs
20
16
  * with it (run-child-host.ts), as a launcher writes its server's. */
21
17
  export declare const encode: (pairs: Iterable<readonly [string, string]>) => Buffer;
@@ -27,8 +23,9 @@ export type StoredKeys = (name: string) => string | undefined;
27
23
  /** This host's secrets, for a scan of what a run wrote: each one the launcher lists, as this process holds it (never in
28
24
  * the environment once handed over, so a scan of process.env alone sees none of them), and beside it the key a person
29
25
  * saved under that name on the server `stored` reads for (a run that names its tool is handed it), and the value of
30
- * every other key, token, secret or password `env` names. One shorter than the checker's MIN_SECRET,
31
- * whitespace aside, matches too much text by chance to be refused, and is left out. */
26
+ * every other key, token, secret or password `env` names, and each OTLP header value and endpoint credential
27
+ * (keptSecrets). One shorter than the checker's MIN_SECRET, whitespace aside, matches too much text by chance to be
28
+ * refused, and is left out, an OTLP header value's too. */
32
29
  export declare const hostSecrets: (env: NodeJS.ProcessEnv, stored?: StoredKeys) => string[];
33
30
  /** Lists `text` among this process's seal keys, for redaction alone, until the returned release is called. */
34
31
  export declare function holdSealKey(text: string): () => void;
@@ -46,6 +43,10 @@ export declare const secret: (name: string, stored?: StoredKeys) => string | und
46
43
  * the object, or a spawn given it (Node builds a child's environment from its enumerable keys), leaves it out. Which
47
44
  * came from a saved key is said too (savedIn), never a value. */
48
45
  export declare const withSecrets: (env: NodeJS.ProcessEnv, which?: "all" | "own", stored?: StoredKeys) => NodeJS.ProcessEnv;
46
+ /** A copy of `env` (one withSecrets made) with every own property as it is: each secret still read by name and never
47
+ * enumerated, savedIn still saying which were saved, and its symbols. A spread keeps none of the secrets, so a copy
48
+ * that is read for a key is made with this (env-copy.test.mjs scans for spreads). */
49
+ export declare const copyEnv: <T extends object>(env: T) => T;
49
50
  /** The secrets of `env` (one withSecrets made) that were saved on the server, not its own, by name. */
50
51
  export declare const savedIn: (env: NodeJS.ProcessEnv) => ReadonlySet<string>;
51
52
  /** The environment a child gets: `env` with every secret name taken out, and every other name shaped like a key
@@ -57,15 +58,60 @@ export declare const withoutSecrets: (env: NodeJS.ProcessEnv) => NodeJS.ProcessE
57
58
  /** What a run's process is handed: the secrets named `names` that this process holds, or its server saved (`stored`),
58
59
  * as its pipe carries them. */
59
60
  export declare function handover(names: readonly string[], stored?: StoredKeys): Buffer;
60
- /** The OpenTelemetry settings this process was handed (OTEL_PAIR), each an OTEL_* name's value; none when it was handed
61
- * none. */
62
- export declare function handedOtel(): Record<string, string>;
61
+ /** A `key=value,key=value` list (OTEL_EXPORTER_OTLP_HEADERS, OTEL_RESOURCE_ATTRIBUTES), each part percent-decoded; a
62
+ * part that is not one is skipped. */
63
+ export declare function keyValues(text: string | undefined): Record<string, string>;
63
64
  /** The MCP credentials this process was handed (MCP_AUTH), by server; none when it was handed none. */
64
65
  export declare function mcpCredentials(): Record<string, {
65
66
  url: string;
66
67
  headers?: Record<string, string>;
67
68
  unopened?: string;
68
69
  }>;
70
+ /** The OTLP header names whose value is not held (otlpHeaderValues), matched in any case: the standard headers that say
71
+ * how a body is sent, which carry no key. Every other header's value is held, an unknown name's too: a name not on this
72
+ * list never means its value is safe. */
73
+ export declare const OTLP_PLAIN_HEADERS: readonly string[];
74
+ /** The OTLP header names whose value is on no held list but is cut from the tracer's own lines (otlpHeaderCut), matched
75
+ * in any case: a backend's dataset or tenant, which says where spans go and carries no key. Such a value is often a
76
+ * word like `production`, which a held list would find in nearly every project a source capture reads and in served
77
+ * text. Only the names here: an unknown name's value is still held. */
78
+ export declare const OTLP_CUT_ONLY_HEADERS: readonly string[];
79
+ /** The OTLP exporter's header values `env` names (OTEL_EXPORTER_OTLP_HEADERS and OTEL_EXPORTER_OTLP_TRACES_HEADERS: a
80
+ * tracing backend's key is one), at any length (keptSecrets floors them for the held list; otlpHeaderCut does not),
81
+ * but those of a header OTLP_PLAIN_HEADERS names, and, for the held list (`held`), those OTLP_CUT_ONLY_HEADERS names.
82
+ * Each is held as written (percent-encoded) and as sent (decoded); and as the SDK reads the same variable, which it
83
+ * merges under ours (`headers`, tracer.ts exporterConfig) and which drops a `;` and what follows it, so a part ours
84
+ * can't decode still sends that much; and, under a credential-named header (credentialNamed) or after a known auth
85
+ * scheme (KNOWN_SCHEME), each of those without its first word (AUTH_SCHEME), the credential alone, as an error may
86
+ * quote it. For the held list, any other header's value is held whole, never its tail alone; for the cut (`held`
87
+ * false), every value is taken without any first word too, since cutting more of the tracer's own lines costs
88
+ * nothing. Under any header, each credential a value carries inside it (innerCredentials: a credential-named
89
+ * `name=value` pair's value, a URL's user, password and key parameters) is taken alone too. A part whose name can't
90
+ * be decoded is held. Commas split the variable, so a comma inside a value must be written `%2C`. */
91
+ export declare const otlpHeaderValues: (env: NodeJS.ProcessEnv, held: boolean) => string[];
92
+ /** The credentials the OTLP endpoints `env` names write into their URLs (OTEL_EXPORTER_OTLP_ENDPOINT and
93
+ * OTEL_EXPORTER_OTLP_TRACES_ENDPOINT; urlCredentials): a user and password, and the value of each query parameter
94
+ * whose name says it is one, each as written and decoded. An exporter's error may quote the URL it posted to. */
95
+ export declare const otlpEndpointValues: (env: NodeJS.ProcessEnv) => string[];
96
+ /** `values` and every OTLP credential `env` names (otlpValues: its header values but a cut-only header's, its
97
+ * endpoints' user, password and key parameters) as the held list keeps them: each MIN_SECRET long or more, whitespace
98
+ * aside. A shorter one matches too much text by chance to be held, and some readers of the list have no floor of their
99
+ * own (a number equal to a held value is withheld, key-refusal.ts heldNumber; a source capture refuses a path or file
100
+ * holding one), so a short header value is on no held list, nor is a dataset's or tenant's (OTLP_CUT_ONLY_HEADERS):
101
+ * otlpHeaderCut alone cuts it, from the tracer's own lines. */
102
+ export declare const keptSecrets: (values: readonly string[], env: NodeJS.ProcessEnv) => string[];
103
+ /** Text with every OTLP credential `env` names (otlpValues: its header values, a cut-only header's too, its endpoints'
104
+ * user, password and key parameters) put as "[redacted]", at any length: the one cut without the MIN_SECRET floor.
105
+ * The tracer's own lines take it, after the runner's redactor (otel/tracer.ts saidOf), since they are where one can
106
+ * show: an exporter's error may quote a header it sent or the URL it posted to, and a run's process never holds one.
107
+ * Every other cut keeps the floor on purpose: a needle of a few characters in every redactor would cut ordinary text
108
+ * everywhere. Each value is matched exactly as held, and the cut is the union of every place each one stands: at each
109
+ * character, the longest value (or a "[redacted]" already in the text) starting there is found without being taken,
110
+ * so a value starting inside another is found too, and the places, which come in order, are merged where they overlap
111
+ * or touch and each run cut as one "[redacted]". So no character of any held value is left, whichever of two
112
+ * overlapping values starts first or is longer (the SDK's reading `api_key=<key>` and a key `<key;rest>` quoted as
113
+ * `api_key=<key;rest>`), and a "[redacted]" already in the text is left whole. One pass over the text, one merge. */
114
+ export declare function otlpHeaderCut(env: NodeJS.ProcessEnv): (text: string) => string;
69
115
  /** Every header value of `credentials`: what a secret scan refuses. */
70
116
  export declare const mcpSecretValues: (credentials: Record<string, {
71
117
  headers?: Record<string, string>;
package/dist/secrets.js CHANGED
@@ -39,11 +39,6 @@ let handed;
39
39
  * the secrets, so it is no tool's environment and no key a scan looks for by name. */
40
40
  const SIGN_IN_PAIR = "AGENTRUN_SIGN_IN";
41
41
  let signIn;
42
- /** The runner's OpenTelemetry settings (its OTEL_* variables, JSON), handed to a run's process on the same pipe so the
43
- * run's trace is exported as the runner's would be: never in any environment (an OTLP header is a backend's key), held
44
- * apart from the secrets, so no tool's environment has them. Read by otel/tracer.ts (handedOtel). */
45
- export const OTEL_PAIR = "AGENTRUN_OTEL";
46
- let otel;
47
42
  /** NAME=VALUE pairs, each ended by a NUL: what a pipe of secrets carries. A runner writes a run's own process its pairs
48
43
  * with it (run-child-host.ts), as a launcher writes its server's. */
49
44
  export const encode = (pairs) => Buffer.concat([...pairs].map(([name, value]) => Buffer.from(`${name}=${value}\0`)));
@@ -54,8 +49,6 @@ function decode(bytes) {
54
49
  held.set(pair.slice(0, at), pair.slice(at + 1));
55
50
  else if (pair.slice(0, at) === SIGN_IN_PAIR)
56
51
  signIn = pair.slice(at + 1);
57
- else if (pair.slice(0, at) === OTEL_PAIR)
58
- otel = pair.slice(at + 1);
59
52
  }
60
53
  }
61
54
  /** Exactly `length` bytes of `fd`, read as the launcher's writer writes them: the end of file before then is a writer
@@ -112,13 +105,14 @@ const SECRET_NAME = /(?:^|_)(?:KEY|TOKEN|SECRET|PASSWORD)$/i;
112
105
  /** This host's secrets, for a scan of what a run wrote: each one the launcher lists, as this process holds it (never in
113
106
  * the environment once handed over, so a scan of process.env alone sees none of them), and beside it the key a person
114
107
  * saved under that name on the server `stored` reads for (a run that names its tool is handed it), and the value of
115
- * every other key, token, secret or password `env` names. One shorter than the checker's MIN_SECRET,
116
- * whitespace aside, matches too much text by chance to be refused, and is left out. */
108
+ * every other key, token, secret or password `env` names, and each OTLP header value and endpoint credential
109
+ * (keptSecrets). One shorter than the checker's MIN_SECRET, whitespace aside, matches too much text by chance to be
110
+ * refused, and is left out, an OTLP header value's too. */
117
111
  export const hostSecrets = (env, stored) => {
118
112
  // AGENTRUN_TOKENS's each secret too, not only the list whole (api-token.ts secretValues).
119
113
  const held = [...SECRET_NAMES.flatMap((name) => [...secretValues(name, secret(name) ?? ""), stored?.(name) ?? ""]), ...mcpSecretValues(mcpCredentials()), ...sealKeys.keys(), ...heldTokens];
120
114
  const named = Object.entries(env).filter(([name]) => SECRET_NAME.test(name) && !SECRET_NAMES.includes(name)).map(([, value]) => value ?? "");
121
- return [...new Set([...held, ...named])].filter((value) => value.replace(/\s+/g, "").length >= MIN_SECRET);
115
+ return keptSecrets([...held, ...named], env);
122
116
  };
123
117
  /** The seal keys this process's open stores were booted with (seal-key.ts bootSealKey), by how many hold each: several
124
118
  * data directories in one process each keep their own. Never read as a secret by name (each holder passes its own key
@@ -188,6 +182,10 @@ export const withSecrets = (env, which = "all", stored) => {
188
182
  Object.defineProperty(out, SAVED, { value: saved, enumerable: false });
189
183
  return out;
190
184
  };
185
+ /** A copy of `env` (one withSecrets made) with every own property as it is: each secret still read by name and never
186
+ * enumerated, savedIn still saying which were saved, and its symbols. A spread keeps none of the secrets, so a copy
187
+ * that is read for a key is made with this (env-copy.test.mjs scans for spreads). */
188
+ export const copyEnv = (env) => Object.create(Object.getPrototypeOf(env), Object.getOwnPropertyDescriptors(env));
191
189
  /** The secrets of `env` (one withSecrets made) that were saved on the server, not its own, by name. */
192
190
  export const savedIn = (env) => env[SAVED] ?? new Set();
193
191
  /** The environment a child gets: `env` with every secret name taken out, and every other name shaped like a key
@@ -204,18 +202,24 @@ export function handover(names, stored) {
204
202
  return value === undefined ? [] : [[name, value]];
205
203
  }));
206
204
  }
207
- /** The OpenTelemetry settings this process was handed (OTEL_PAIR), each an OTEL_* name's value; none when it was handed
208
- * none. */
209
- export function handedOtel() {
210
- try {
211
- const parsed = JSON.parse(otel ?? "{}");
212
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
213
- return {};
214
- return Object.fromEntries(Object.entries(parsed).filter((pair) => pair[0].startsWith("OTEL_") && typeof pair[1] === "string"));
215
- }
216
- catch {
217
- return {};
205
+ /** A `key=value,key=value` list (OTEL_EXPORTER_OTLP_HEADERS, OTEL_RESOURCE_ATTRIBUTES), each part percent-decoded; a
206
+ * part that is not one is skipped. */
207
+ export function keyValues(text) {
208
+ const out = {};
209
+ for (const part of (text ?? "").split(",")) {
210
+ const at = part.indexOf("=");
211
+ if (at <= 0)
212
+ continue;
213
+ try {
214
+ const key = decodeURIComponent(part.slice(0, at).trim());
215
+ if (key)
216
+ out[key] = decodeURIComponent(part.slice(at + 1).trim());
217
+ }
218
+ catch {
219
+ continue;
220
+ }
218
221
  }
222
+ return out;
219
223
  }
220
224
  /** The MCP credentials this process was handed (MCP_AUTH), by server; none when it was handed none. */
221
225
  export function mcpCredentials() {
@@ -227,6 +231,326 @@ export function mcpCredentials() {
227
231
  return {};
228
232
  }
229
233
  }
234
+ /** The OTLP header names whose value is not held (otlpHeaderValues), matched in any case: the standard headers that say
235
+ * how a body is sent, which carry no key. Every other header's value is held, an unknown name's too: a name not on this
236
+ * list never means its value is safe. */
237
+ export const OTLP_PLAIN_HEADERS = ["content-type", "accept", "content-encoding", "user-agent"];
238
+ /** `text` percent-decoded, or undefined when it can't be. */
239
+ const decoded = (text) => {
240
+ try {
241
+ return decodeURIComponent(text);
242
+ }
243
+ catch {
244
+ return undefined;
245
+ }
246
+ };
247
+ /** The OTLP header names whose value is on no held list but is cut from the tracer's own lines (otlpHeaderCut), matched
248
+ * in any case: a backend's dataset or tenant, which says where spans go and carries no key. Such a value is often a
249
+ * word like `production`, which a held list would find in nearly every project a source capture reads and in served
250
+ * text. Only the names here: an unknown name's value is still held. */
251
+ export const OTLP_CUT_ONLY_HEADERS = ["x-honeycomb-dataset", "x-axiom-dataset", "x-scope-orgid"];
252
+ /** An auth scheme before its credential, as a header writes it (`Bearer <token>`, `Basic <base64>`, `Api-Key <key>`,
253
+ * `sentry sentry_key=<key>`): a token, then a space or its `%20`. */
254
+ const AUTH_SCHEME = /^[A-Za-z][\w.+-]*(?:\s+|%20)/;
255
+ /** The auth schemes a backend's header writes before its credential, in any case, under any header name. */
256
+ const KNOWN_SCHEME = /^(?:bearer|basic|api-?key|api-?token|token|sentry|splunk|geniekey)(?:\s+|%20)/i;
257
+ /** Whether a header's or an endpoint's query parameter's name says its value is a credential (`authorization`,
258
+ * `x-sentry-auth`, `x-api-key`, `access_token`, `apiKey2`, `X-Amz-Signature`, `sessionid`): a name is split at each
259
+ * non-alphanumeric and at each lower-to-upper case change, a word's trailing digits are dropped (`key2` is `key`), and
260
+ * a word counts when it is one of CREDENTIAL_WORDS, ends in one of CREDENTIAL_ENDINGS (`accesstoken`, `dbpasswd`,
261
+ * `writekey`, `hmackey`), or starts with one of CREDENTIAL_STARTS and is more than its plural (`tokenvalue`,
262
+ * `passwordhash`; never `tokens`). `auth`, `key`, `sig` and `session` start no compound, so a word that only starts like
263
+ * one says nothing (`authority`, `keyspace`, `sessions`). */
264
+ const CREDENTIAL_WORDS = new Set(["authorization", "auth", "key", "apikey", "token", "secret", "password", "passwd", "pwd", "sig", "signature", "credential", "credentials", "jwt", "session"]);
265
+ const CREDENTIAL_ENDINGS = ["key", "token", "secret", "password", "passwd", "pwd", "auth", "authorization", "sig", "signature", "credential", "credentials", "jwt", "sessionid"];
266
+ const CREDENTIAL_STARTS = ["token", "secret", "password", "passwd", "jwt"];
267
+ const credentialWord = (word) => {
268
+ const bare = word.replace(/\d+$/, "");
269
+ return CREDENTIAL_WORDS.has(bare)
270
+ || CREDENTIAL_ENDINGS.some((ending) => bare.endsWith(ending))
271
+ || CREDENTIAL_STARTS.some((start) => bare.startsWith(start) && bare.length > start.length + 1);
272
+ };
273
+ const credentialNamed = (name) => name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase().split(/[^a-z0-9]+/).some(credentialWord);
274
+ /** Where a URL starts: a scheme, then `://`; or `//` alone (a scheme-relative URL, `//<key>@host`) at the start of the
275
+ * text or after a space, a quote, `=`, `(`, `,`, `;` or `&`, never inside a path (`/a//b`). A scheme is read at most 32
276
+ * characters long, so a long word with no `://` after it costs one short look from each of its letters. */
277
+ const URL_START = /[A-Za-z][\w+.-]{0,31}:\/\/|(?<=^|[\s"'=(,;&])\/\//;
278
+ const URL_HEAD = /(?:[A-Za-z][\w+.-]{0,31}:)?\/\//y;
279
+ /** How many readings of one URL's userinfo urlParts takes at most, and how many characters its shorter readings (all
280
+ * but the RFC's and the first `@`'s) take together at most: a value can hold thousands of `@`, and a reading at each
281
+ * would hold, and the [otel] cut compile into one pattern, their count times the value's length. */
282
+ const MAX_READINGS = 16;
283
+ const READINGS_BUDGET = 4096;
284
+ /** How many characters of URL queries one header value's read (innerCredentials) takes after the first query it reads:
285
+ * a value of URLs nested each in the last's query gives each a query running to the value's end, and reading every one
286
+ * would hold their count times the value's length. The pair read (pairValues) still covers every query's text. */
287
+ const QUERY_BUDGET = 4096;
288
+ /** A URL as RFC 3986 reads it, `text` from `start` (its scheme, or the `//` of a scheme-relative one) to `end`: its
289
+ * authority, up to the first `/`, `?` or `#`; the readings of its userinfo, the RFC's first (everything before the
290
+ * authority's last `@`, so a password's `;`, `&`, `=`, `,`, `'` or raw `@` stays in it), then, when the authority holds
291
+ * more than one `@`, the one up to its first `@` and the next shorter ones, up to MAX_READINGS in all and
292
+ * READINGS_BUDGET characters for those after the first two (a URL with no closing mark, followed by a pair holding an
293
+ * `@`, `...@relay.invalid&contact=ops@team`, reads too long a userinfo, and a redactor holding an extra candidate is
294
+ * safe where missing one leaks); and where its query is, from the first `?` to a `#`. Read in place, never copied to
295
+ * `end`: a value of thousands of URLs one inside the next costs each only its authority. Undefined when no URL starts
296
+ * at `start`. */
297
+ const urlParts = (text, start, end) => {
298
+ URL_HEAD.lastIndex = start;
299
+ if (!URL_HEAD.test(text))
300
+ return undefined;
301
+ const from = URL_HEAD.lastIndex;
302
+ let stop = from;
303
+ while (stop < end && !"/?#".includes(text[stop]))
304
+ stop++;
305
+ const authority = text.slice(from, stop);
306
+ const ats = [...authority.matchAll(/@/g)].map((at) => at.index);
307
+ const kept = ats.length > 1 ? [ats[ats.length - 1], ats[0]] : ats;
308
+ let budget = READINGS_BUDGET;
309
+ for (let next = 1; next < ats.length - 1 && kept.length < MAX_READINGS && ats[next] <= budget; next++) {
310
+ budget -= ats[next];
311
+ kept.push(ats[next]);
312
+ }
313
+ const mark = text.indexOf("?", stop);
314
+ const hash = text.indexOf("#", stop);
315
+ const query = mark >= 0 && mark < end && (hash < 0 || hash > mark) ? [mark + 1, hash >= 0 && hash < end ? hash : end] : [0, 0];
316
+ return { readings: kept.map((at) => authority.slice(0, at)), query };
317
+ };
318
+ /** A user or password as a URL parser writes it back (a client's error may quote the URL it parsed): `;`, `=`, `@`, `:`
319
+ * and the like percent-encoded. */
320
+ const asParsed = (part) => {
321
+ const url = new URL("http://host.invalid");
322
+ url.password = part;
323
+ return url.password;
324
+ };
325
+ /** The credentials a URL writes into itself (`text` from `start` to `end`, urlParts): the user and password of its
326
+ * userinfo (before its first `:` and after it), each as written, decoded and as a parser writes it back, the RFC's
327
+ * reading at any length and each shorter reading's only at MIN_SECRET or more (so a short piece of a password, `pa` of
328
+ * `pa@ss...`, cuts no ordinary word), and the value of each query parameter whose name says it is one
329
+ * (credentialNamed), the query split at `&` alone and again at `&` and `;`, as written and decoded; none when no URL
330
+ * starts at `start`. A query already in `queriesRead` (several URLs nested in one share it) is not read again, and
331
+ * after the first one read, one is read only while QUERY_BUDGET has room for all of it. */
332
+ const urlCredentials = (text, start = 0, end = text.length, queriesRead = { spans: new Set(), left: QUERY_BUDGET }) => {
333
+ const url = urlParts(text, start, end);
334
+ if (!url)
335
+ return [];
336
+ const userinfo = url.readings.flatMap((reading, at) => {
337
+ const colon = reading.indexOf(":");
338
+ const parts = (colon < 0 ? [reading] : [reading.slice(0, colon), reading.slice(colon + 1)]).flatMap((part) => [part, decoded(part) ?? part, asParsed(part)]);
339
+ return at === 0 ? parts : parts.filter((part) => part.replace(/\s+/g, "").length >= MIN_SECRET);
340
+ });
341
+ const [from, to] = url.query;
342
+ const span = `${from} ${to}`;
343
+ if (from === to || queriesRead.spans.has(span))
344
+ return userinfo;
345
+ if (queriesRead.spans.size > 0) {
346
+ if (to - from > queriesRead.left)
347
+ return userinfo;
348
+ queriesRead.left -= to - from;
349
+ }
350
+ queriesRead.spans.add(span);
351
+ // Read split at `&` alone (a WHATWG parser's reading, a value's raw `;` kept), and each `&` piece holding a `;` split
352
+ // at it too (a path parameter's or a cookie's reading): both, so a key with a `;` in it is held whole and a pair after
353
+ // a `;` alone. A query writes a space as `+`; a user and password do not.
354
+ const pieces = text.slice(from, to).split("&");
355
+ const query = [...pieces, ...pieces.filter((piece) => piece.includes(";")).flatMap((piece) => piece.split(";"))].flatMap((pair) => {
356
+ const at = pair.indexOf("=");
357
+ const name = pair.slice(0, Math.max(at, 0)).replace(/\+/g, " ");
358
+ const value = pair.slice(at + 1);
359
+ return at > 0 && credentialNamed(decoded(name) ?? name) ? [value, decoded(value.replace(/\+/g, " ")) ?? value] : [];
360
+ });
361
+ return [...userinfo, ...query];
362
+ };
363
+ /** Each URL inside a header value (a DSN, a relay's address) as the spans of text it takes, one starting at every
364
+ * `scheme://` (URL_START), so a URL inside another's query or path is read too: from its scheme to the quote that
365
+ * closes it when a `'` or `"` opens it (comes right before its scheme and is closed later), else to the first space or
366
+ * quote, and, when that is a quote, also on to the first space (RFC 3986 allows a raw `'` in a userinfo, so both
367
+ * readings are taken). Read inside a span alone (urlParts), a quoted URL's userinfo never runs past its closing quote to
368
+ * a later `@`, and an unquoted one's runs past any `;`, `&`, `=` or `,`. */
369
+ const urlSpans = (value) => {
370
+ const spans = [];
371
+ const start = new RegExp(URL_START.source, "g");
372
+ // The first match of `mark` at or after an index, found once for every index from the last one asked up to it: URLs
373
+ // nested one in the next share their end, and a search from each would read the rest of the value again.
374
+ const nextOf = (mark) => {
375
+ let asked = -1;
376
+ let found = -1;
377
+ return (from) => {
378
+ if (from < asked || from > found) {
379
+ mark.lastIndex = from;
380
+ found = mark.exec(value)?.index ?? value.length;
381
+ }
382
+ asked = from;
383
+ return found;
384
+ };
385
+ };
386
+ const nextStop = nextOf(/[\s'"]|$/g);
387
+ const nextSpace = nextOf(/\s|$/g);
388
+ for (let found = start.exec(value); found; found = start.exec(value)) {
389
+ const open = value[found.index - 1];
390
+ const from = found.index + found[0].length;
391
+ const closing = open === "'" || open === '"' ? value.indexOf(open, from) : -1;
392
+ if (closing >= 0) {
393
+ spans.push({ start: found.index, end: closing });
394
+ continue;
395
+ }
396
+ const end = nextStop(from);
397
+ spans.push({ start: found.index, end });
398
+ if (value[end] === "'" || value[end] === '"')
399
+ spans.push({ start: found.index, end: nextSpace(end) });
400
+ }
401
+ return spans;
402
+ };
403
+ /** The breaks between a header value's `name=value` pairs: `;`, `&`, a comma (or its `%2C`) and spaces; and, for a
404
+ * second, finer read, also `?`, `#` and `/`, so a pair inside a URL that is itself a pair's value
405
+ * (`upstream=https://relay/v1#access_token=<token>`) or a path's segment stands alone; and three whole reads, which keep
406
+ * a raw `;` in a value: all but `;` (LIST_BREAK), so a credential with a `;` in a list joined by `%2C`, the usual way to
407
+ * write one (`api_key=<key;rest>%2Cregion=us`), is held as itself, and `&` and spaces alone (WHOLE_BREAK), so one with
408
+ * a comma in it too (`api_key=<key;rest%2Cmore>&region=us`) is held whole, and again at their `%26` and `%20`
409
+ * (ENCODED_BREAK), so that key before an encoded `&` or space is held as written too, not only decoded, and again at
410
+ * `%26` alone (ENCODED_AMP_BREAK), so a key with a `%20` in it before a `%26` is held, as written and decoded; a text
411
+ * with neither (ENCODED_SEEN) splits at both as at WHOLE_BREAK, so those reads are skipped for it. All are held:
412
+ * every redactor matches a held value exactly, so the longer reading of any never covers a line quoting the key alone.
413
+ * WHOLE_BREAK also holds a value with the comma that ends it (sentry's `sentry_key=<key>%2C`); the others hold the value
414
+ * alone. */
415
+ const PAIR_BREAK = /[;&,\s]+|%2C/i;
416
+ const PIECE_BREAK = /[;&,\s?#/]+|%2C/i;
417
+ const LIST_BREAK = /[&,\s]+|%2C/i;
418
+ const WHOLE_BREAK = /[&\s]+/;
419
+ const ENCODED_BREAK = /[&\s]+|%26|%20/i;
420
+ const ENCODED_AMP_BREAK = /[&\s]+|%26/i;
421
+ const ENCODED_SEEN = /%26|%20/i;
422
+ /** What a credential's value whose part before its first `;` is empty (`;<key>`) holds after that `;`, whole and up to
423
+ * its next `;`, as a reader that skips an empty part reads it; nothing for any other value. */
424
+ const afterEmpty = (value) => {
425
+ if (!value.startsWith(";"))
426
+ return [];
427
+ const after = value.replace(/^;+/, "");
428
+ return [after, after.split(";")[0]];
429
+ };
430
+ /** The value of each `name=value` pair of `text` split at `breaks` whose name says it is a credential (credentialNamed),
431
+ * out of any quotes around it, raw or written `%22` or `%27`, as written and decoded. A name is what follows the last
432
+ * `/`, `?`, `#` or `:` before its `=` (a URL's query or fragment, `https://relay/v1?region=us`, names `region`). A
433
+ * value whose part before its first `;` is empty, as written or decoded (`token=;<key>` read whole, `token=%3B<key>`),
434
+ * is taken after that `;` too (afterEmpty). A value of only `=`, `;` and quotes, as written or decoded (a base64 credential's padding read as a
435
+ * pair, `token=;` before a space, a lone `'` or its `%27`), is not taken: otlpHeaderCut has no length floor, and it
436
+ * would cut that character everywhere in the tracer's lines. */
437
+ const pairValues = (text, breaks) => text.split(breaks).flatMap((pair) => {
438
+ const at = pair.indexOf("=");
439
+ if (at <= 0)
440
+ return [];
441
+ const name = pair.slice(0, at).split(/[/?#:]/).at(-1) ?? "";
442
+ if (!credentialNamed(decoded(name) ?? name))
443
+ return [];
444
+ const inner = pair.slice(at + 1).replace(/^(["']|%22|%27)(.*)\1$/, "$2");
445
+ return [inner, ...afterEmpty(inner)]
446
+ .flatMap((value) => [value, decoded(value) ?? value])
447
+ .concat(afterEmpty(decoded(inner) ?? inner))
448
+ .filter((value) => /[^=;"']/.test(value));
449
+ });
450
+ /** The credentials a header value carries inside it, the union of two reads over the whole value as written: the value
451
+ * of each `name=value` pair whose name says it is a credential (pairValues, at each of PAIR_BREAK, PIECE_BREAK,
452
+ * LIST_BREAK, WHOLE_BREAK, ENCODED_BREAK and ENCODED_AMP_BREAK: a cookie's `session=<token>`, sentry's
453
+ * `sentry_key=<key>`, a path's `;jsessionid=<id>`, a URL query's or fragment's `session=` or `access_token=`), and the
454
+ * user, password and key parameters of each URL in it (urlSpans, urlCredentials: a DSN's `https://<key>@host/1`, a
455
+ * relay's whole `user:pa;ss`). A URL only adds readings: the pair read covers its text too. A value that escapes its
456
+ * slashes (JSON's `https:\/\/`) is read again with them plain, and what that finds is held both ways. A pair named like
457
+ * no credential (`theme=dark`) is not taken. */
458
+ const innerCredentials = (value) => {
459
+ const read = (text) => {
460
+ const queriesRead = { spans: new Set(), left: QUERY_BUDGET };
461
+ return [
462
+ ...pairValues(text, PAIR_BREAK),
463
+ ...pairValues(text, PIECE_BREAK),
464
+ ...pairValues(text, LIST_BREAK),
465
+ ...pairValues(text, WHOLE_BREAK),
466
+ ...(ENCODED_SEEN.test(text) ? [...pairValues(text, ENCODED_BREAK), ...pairValues(text, ENCODED_AMP_BREAK)] : []),
467
+ ...urlSpans(text).flatMap(({ start, end }) => urlCredentials(text, start, end, queriesRead)),
468
+ ];
469
+ };
470
+ if (!value.includes("\\/"))
471
+ return read(value);
472
+ return [...read(value), ...read(value.replace(/\\\//g, "/")).flatMap((found) => [found, found.replace(/\//g, "\\/")])];
473
+ };
474
+ /** The OTLP exporter's header values `env` names (OTEL_EXPORTER_OTLP_HEADERS and OTEL_EXPORTER_OTLP_TRACES_HEADERS: a
475
+ * tracing backend's key is one), at any length (keptSecrets floors them for the held list; otlpHeaderCut does not),
476
+ * but those of a header OTLP_PLAIN_HEADERS names, and, for the held list (`held`), those OTLP_CUT_ONLY_HEADERS names.
477
+ * Each is held as written (percent-encoded) and as sent (decoded); and as the SDK reads the same variable, which it
478
+ * merges under ours (`headers`, tracer.ts exporterConfig) and which drops a `;` and what follows it, so a part ours
479
+ * can't decode still sends that much; and, under a credential-named header (credentialNamed) or after a known auth
480
+ * scheme (KNOWN_SCHEME), each of those without its first word (AUTH_SCHEME), the credential alone, as an error may
481
+ * quote it. For the held list, any other header's value is held whole, never its tail alone; for the cut (`held`
482
+ * false), every value is taken without any first word too, since cutting more of the tracer's own lines costs
483
+ * nothing. Under any header, each credential a value carries inside it (innerCredentials: a credential-named
484
+ * `name=value` pair's value, a URL's user, password and key parameters) is taken alone too. A part whose name can't
485
+ * be decoded is held. Commas split the variable, so a comma inside a value must be written `%2C`. */
486
+ export const otlpHeaderValues = (env, held) => [env.OTEL_EXPORTER_OTLP_HEADERS, env.OTEL_EXPORTER_OTLP_TRACES_HEADERS].flatMap((text) => (text ?? "").split(",").flatMap((part) => {
487
+ const at = part.indexOf("=");
488
+ if (at <= 0)
489
+ return [];
490
+ const rawName = part.slice(0, at).trim();
491
+ const name = decoded(rawName) ?? rawName;
492
+ if (OTLP_PLAIN_HEADERS.includes(name.toLowerCase()))
493
+ return [];
494
+ if (held && OTLP_CUT_ONLY_HEADERS.includes(name.toLowerCase()))
495
+ return [];
496
+ const written = part.slice(at + 1).trim();
497
+ const property = written.indexOf(";");
498
+ const forms = [written, ...(property >= 0 ? [written.slice(0, property).trim()] : [])].flatMap((value) => [value, decoded(value) ?? value]);
499
+ const named = credentialNamed(name);
500
+ return forms.flatMap((value) => [value, ...(!held || named || KNOWN_SCHEME.test(value) ? [value.replace(AUTH_SCHEME, "")] : []), ...innerCredentials(value)]);
501
+ })).filter((value) => value.trim() !== "");
502
+ /** The credentials the OTLP endpoints `env` names write into their URLs (OTEL_EXPORTER_OTLP_ENDPOINT and
503
+ * OTEL_EXPORTER_OTLP_TRACES_ENDPOINT; urlCredentials): a user and password, and the value of each query parameter
504
+ * whose name says it is one, each as written and decoded. An exporter's error may quote the URL it posted to. */
505
+ export const otlpEndpointValues = (env) => [env.OTEL_EXPORTER_OTLP_ENDPOINT, env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT].flatMap((text) => urlCredentials((text ?? "").trim())).filter((value) => value.trim() !== "");
506
+ /** Every OTLP credential `env` names: its header values (otlpHeaderValues, a cut-only header's only when not `held`) and
507
+ * its endpoints' (otlpEndpointValues). */
508
+ const otlpValues = (env, held) => [...otlpHeaderValues(env, held), ...otlpEndpointValues(env)];
509
+ /** `values` and every OTLP credential `env` names (otlpValues: its header values but a cut-only header's, its
510
+ * endpoints' user, password and key parameters) as the held list keeps them: each MIN_SECRET long or more, whitespace
511
+ * aside. A shorter one matches too much text by chance to be held, and some readers of the list have no floor of their
512
+ * own (a number equal to a held value is withheld, key-refusal.ts heldNumber; a source capture refuses a path or file
513
+ * holding one), so a short header value is on no held list, nor is a dataset's or tenant's (OTLP_CUT_ONLY_HEADERS):
514
+ * otlpHeaderCut alone cuts it, from the tracer's own lines. */
515
+ export const keptSecrets = (values, env) => [...new Set([...values, ...otlpValues(env, true)])].filter((value) => value.replace(/\s+/g, "").length >= MIN_SECRET);
516
+ const CUT = "[redacted]";
517
+ /** Text with every OTLP credential `env` names (otlpValues: its header values, a cut-only header's too, its endpoints'
518
+ * user, password and key parameters) put as "[redacted]", at any length: the one cut without the MIN_SECRET floor.
519
+ * The tracer's own lines take it, after the runner's redactor (otel/tracer.ts saidOf), since they are where one can
520
+ * show: an exporter's error may quote a header it sent or the URL it posted to, and a run's process never holds one.
521
+ * Every other cut keeps the floor on purpose: a needle of a few characters in every redactor would cut ordinary text
522
+ * everywhere. Each value is matched exactly as held, and the cut is the union of every place each one stands: at each
523
+ * character, the longest value (or a "[redacted]" already in the text) starting there is found without being taken,
524
+ * so a value starting inside another is found too, and the places, which come in order, are merged where they overlap
525
+ * or touch and each run cut as one "[redacted]". So no character of any held value is left, whichever of two
526
+ * overlapping values starts first or is longer (the SDK's reading `api_key=<key>` and a key `<key;rest>` quoted as
527
+ * `api_key=<key;rest>`), and a "[redacted]" already in the text is left whole. One pass over the text, one merge. */
528
+ export function otlpHeaderCut(env) {
529
+ const values = [...new Set([CUT, ...otlpValues(env, false)])].sort((a, b) => b.length - a.length);
530
+ if (values.length === 1)
531
+ return (text) => text;
532
+ const needle = new RegExp(`(?=(${values.map((value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")}))`, "g");
533
+ return (text) => {
534
+ if (!text)
535
+ return text;
536
+ const spans = [];
537
+ for (const found of text.matchAll(needle)) {
538
+ const [start, end] = [found.index, found.index + found[1].length];
539
+ const last = spans.at(-1);
540
+ if (last && start <= last[1])
541
+ last[1] = Math.max(last[1], end);
542
+ else
543
+ spans.push([start, end]);
544
+ }
545
+ let out = "";
546
+ let from = 0;
547
+ for (const [start, end] of spans) {
548
+ out += `${text.slice(from, start)}${CUT}`;
549
+ from = end;
550
+ }
551
+ return out + text.slice(from);
552
+ };
553
+ }
230
554
  /** Every header value of `credentials`: what a secret scan refuses. */
231
555
  export const mcpSecretValues = (credentials) => Object.values(credentials).flatMap((server) => Object.values(server.headers ?? {})).flatMap((value) => [value, value.replace(/^Bearer\s+/i, "")]);
232
556
  /** The saved sign-in this run's process was handed over its pipe, if any: read by the browser tool alone. */
@@ -15,7 +15,7 @@ export declare const defaultData: (env?: NodeJS.ProcessEnv) => string;
15
15
  /** The server's own data directory, on its reading of the environment (startServe): an npx hint names it (adapters.ts
16
16
  * npxLine). */
17
17
  export declare const DATA_ENV = "AGENTRUN_SERVE_DATA";
18
- /** Agent `agentId`'s folder on the disk, which holds its learning folder (learning.ts) and its runs: `<data>/disk/agents/<agent>`. */
18
+ /** Agent `agentId`'s folder on the disk, which holds its runs: `<data>/disk/agents/<agent>`. */
19
19
  /** The folder of a data directory that holds each agent's disk: its runs and its learning. */
20
20
  export declare const DISK_DIR = "disk";
21
21
  /** Agent `agentId`'s folder on the disk of data directory `data`: `<data>/disk/agents/<name>`. */
package/dist/server-fs.js CHANGED
@@ -31,7 +31,7 @@ export const defaultData = (env = process.env) => join(env.XDG_DATA_HOME || join
31
31
  /** The server's own data directory, on its reading of the environment (startServe): an npx hint names it (adapters.ts
32
32
  * npxLine). */
33
33
  export const DATA_ENV = "AGENTRUN_SERVE_DATA";
34
- /** Agent `agentId`'s folder on the disk, which holds its learning folder (learning.ts) and its runs: `<data>/disk/agents/<agent>`. */
34
+ /** Agent `agentId`'s folder on the disk, which holds its runs: `<data>/disk/agents/<agent>`. */
35
35
  /** The folder of a data directory that holds each agent's disk: its runs and its learning. */
36
36
  export const DISK_DIR = "disk";
37
37
  /** An agent's folder's name on the disk: its id in lower case, then 16 hex digits of the id's SHA-256, so ids that differ
@@ -9,9 +9,10 @@ export type Opened = {
9
9
  unreadable: Unreadable;
10
10
  };
11
11
  /** Why a saved harness key (harness-keys.ts) is not one its recipe's runs get, so it is entered again: saved for another
12
- * recipe file of its id (`recipe_changed`; or bound to none), or one of UNREADABLE. Here, beside UNREADABLE, so the API
13
- * document reads it without loading the keys layer. */
14
- export declare const HARNESS_KEY_REENTER: readonly ["recipe_changed", "seal_key_changed", "file_unreadable"];
12
+ * recipe file of its id (`recipe_changed`), bound to none (`not_bound`: saved before keys were bound, or its binding
13
+ * write was cut off), or one of UNREADABLE. Here, beside UNREADABLE, so the API document reads it without loading the
14
+ * keys layer. */
15
+ export declare const HARNESS_KEY_REENTER: readonly ["recipe_changed", "not_bound", "seal_key_changed", "file_unreadable"];
15
16
  /** The fingerprint of a seal key: an HMAC of a fixed label under it, stable across restarts, so a value whose fingerprint
16
17
  * no longer matches was sealed under another key (seal_key_changed), told apart from one that is simply damaged. No
17
18
  * secret: neither the key nor a hash of it. Kept beside the sealed rows, in a settings row of the layer that writes them. */
@@ -23,6 +24,12 @@ export declare function openSealed(sealKey: Buffer, name: string, sealed: Uint8A
23
24
  export declare function putSealedKey(store: {
24
25
  sealedKeys: Pick<SealedKeys, "put">;
25
26
  }, sealKey: Buffer, name: string, value: string): Promise<void>;
27
+ /** The value kept under `name`, opened now: the one saved there that opens under `sealKey`, else `value`, saved so that of
28
+ * writers racing on the row one's is kept and every one reads it back. A row that does not open (sealed under another
29
+ * key, or damaged) is replaced only while it holds the bytes read. Undefined only when the row still does not open. */
30
+ export declare function keepSealedKey(store: {
31
+ sealedKeys: Pick<SealedKeys, "get" | "putIfAbsent" | "replaceIf">;
32
+ }, sealKey: Buffer, name: string, value: string): Promise<string | undefined>;
26
33
  /** The value saved under `name`, opened now; undefined with none saved, or one that does not open under this seal key
27
34
  * (sealed under another key, or damaged). Never a value the store could read in the clear. */
28
35
  export declare function getSealedKey(store: {
@@ -8,9 +8,10 @@ import { sealColumn, sealedAt, unsealColumn } from "./store/index.js";
8
8
  /** Why a saved value does not open: sealed under another seal key (its fingerprint no longer matches), or damaged. */
9
9
  export const UNREADABLE = ["seal_key_changed", "file_unreadable"];
10
10
  /** Why a saved harness key (harness-keys.ts) is not one its recipe's runs get, so it is entered again: saved for another
11
- * recipe file of its id (`recipe_changed`; or bound to none), or one of UNREADABLE. Here, beside UNREADABLE, so the API
12
- * document reads it without loading the keys layer. */
13
- export const HARNESS_KEY_REENTER = ["recipe_changed", ...UNREADABLE];
11
+ * recipe file of its id (`recipe_changed`), bound to none (`not_bound`: saved before keys were bound, or its binding
12
+ * write was cut off), or one of UNREADABLE. Here, beside UNREADABLE, so the API document reads it without loading the
13
+ * keys layer. */
14
+ export const HARNESS_KEY_REENTER = ["recipe_changed", "not_bound", ...UNREADABLE];
14
15
  /** The fingerprint of a seal key: an HMAC of a fixed label under it, stable across restarts, so a value whose fingerprint
15
16
  * no longer matches was sealed under another key (seal_key_changed), told apart from one that is simply damaged. No
16
17
  * secret: neither the key nor a hash of it. Kept beside the sealed rows, in a settings row of the layer that writes them. */
@@ -31,6 +32,18 @@ export function openSealed(sealKey, name, sealed, fp) {
31
32
  export async function putSealedKey(store, sealKey, name, value) {
32
33
  await store.sealedKeys.put(name, sealColumn(sealKey, sealedAt.sealedKey(name), value));
33
34
  }
35
+ /** The value kept under `name`, opened now: the one saved there that opens under `sealKey`, else `value`, saved so that of
36
+ * writers racing on the row one's is kept and every one reads it back. A row that does not open (sealed under another
37
+ * key, or damaged) is replaced only while it holds the bytes read. Undefined only when the row still does not open. */
38
+ export async function keepSealedKey(store, sealKey, name, value) {
39
+ const was = await store.sealedKeys.get(name);
40
+ const sealed = sealColumn(sealKey, sealedAt.sealedKey(name), value);
41
+ if (was === undefined)
42
+ await store.sealedKeys.putIfAbsent(name, sealed);
43
+ else if (!("value" in openSealed(sealKey, name, was, undefined)))
44
+ await store.sealedKeys.replaceIf(name, was, sealed);
45
+ return getSealedKey(store, sealKey, name);
46
+ }
34
47
  /** The value saved under `name`, opened now; undefined with none saved, or one that does not open under this seal key
35
48
  * (sealed under another key, or damaged). Never a value the store could read in the clear. */
36
49
  export async function getSealedKey(store, sealKey, name) {
@@ -5,7 +5,7 @@
5
5
  // serverSecrets): what a run shows, what learning keeps and what the server answers are cut of it.
6
6
  import { sealedSettingsOverStore } from "./sealed-settings-store.js";
7
7
  import { besideTheStore } from "./server-secrets.js";
8
- import { SEAL_KEY_ENV, sealKeyOf } from "./tool-keys.js";
8
+ import { SEAL_KEY_ENV, sealKeyIn } from "./tool-keys.js";
9
9
  import { SLACK_CHANNEL, SLACK_URL_SPEC, slackUrlForms } from "./slack.js";
10
10
  import { WEBHOOK_CHANNEL, WEBHOOK_SECRET_SPEC } from "./webhooks.js";
11
11
  /** The server's own secrets over the store: what it keeps beside the store (besideTheStore), the outbound webhook's
@@ -15,9 +15,7 @@ import { WEBHOOK_CHANNEL, WEBHOOK_SECRET_SPEC } from "./webhooks.js";
15
15
  * list is whole from the first use. A value that does not open is said to `say`. */
16
16
  export async function openServerSecretsOverStore(store, data, env, adapters, say = () => { }) {
17
17
  // The server always has its seal key (seal-key.ts bootSealKey, at its start): no setting is ever kept in the clear.
18
- const key = sealKeyOf(env[SEAL_KEY_ENV]);
19
- if (!key)
20
- throw new Error(`the server starts with its seal key (${SEAL_KEY_ENV}), made at the first start when none is handed over`);
18
+ const key = sealKeyIn(env[SEAL_KEY_ENV], "the server's own secrets");
21
19
  const secrets = besideTheStore(data);
22
20
  // The outbound webhook's secret, and each it held before, kept in the store (webhooks.ts). Its secret not opening under
23
21
  // this seal key is said in the webhook's own words, naming the data directory.