poe-code 3.0.263 → 3.0.265

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 (309) hide show
  1. package/dist/cli/commands/harness.js +9 -3
  2. package/dist/cli/commands/harness.js.map +1 -1
  3. package/dist/cli/program.js +1 -1
  4. package/dist/cli/program.js.map +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +329 -313
  7. package/dist/index.js.map +4 -4
  8. package/dist/metafile.json +1 -1
  9. package/package.json +5 -5
  10. package/packages/agent-harness/dist/loader/extract-schema.js +1 -1
  11. package/packages/agent-harness/dist/loader/run.d.ts +1 -1
  12. package/packages/agent-harness/dist/loader/run.js +1 -1
  13. package/packages/maestro-tui/dist/run.js +1 -1
  14. package/packages/{agent-script → safejs}/dist/cli.js +6 -5
  15. package/packages/safejs/dist/dump.d.ts +2 -0
  16. package/packages/safejs/dist/dump.js +2 -0
  17. package/packages/{agent-script → safejs}/dist/interp/globals/collections.js +2 -2
  18. package/packages/{agent-script → safejs}/dist/interp/interpreter.js +1 -3
  19. package/packages/{agent-script → safejs}/dist/lint/rules/AS-import-cycle.js +2 -2
  20. package/packages/{agent-script → safejs}/dist/lint/rules/AS005.js +3 -1
  21. package/packages/{agent-script → safejs}/dist/lint/rules/AS014.js +2 -2
  22. package/packages/{agent-script → safejs}/dist/lint/rules/module-registry.d.ts +2 -2
  23. package/packages/{agent-script → safejs}/dist/lint/rules/module-registry.js +1 -1
  24. package/packages/{agent-script → safejs}/dist/loader/extract-block.js +20 -12
  25. package/packages/{agent-script → safejs}/dist/loader/frontmatter.js +2 -2
  26. package/packages/{agent-script → safejs}/dist/modules/agent.js +16 -15
  27. package/packages/{agent-script → safejs}/dist/modules/git.js +3 -9
  28. package/packages/{agent-script → safejs}/dist/modules/mcp.js +2 -6
  29. package/packages/{agent-script → safejs}/dist/restore.d.ts +2 -2
  30. package/packages/{agent-script → safejs}/dist/run.d.ts +3 -3
  31. package/packages/{agent-script → safejs}/dist/runner/run-harness.js +13 -2
  32. package/packages/{agent-script → safejs}/dist/snapshot/backend.d.ts +2 -2
  33. package/packages/{agent-script → safejs}/dist/snapshot/backend.js +2 -2
  34. package/packages/{agent-script → safejs}/dist/snapshot/dump-format.d.ts +1 -1
  35. package/packages/{agent-script → safejs}/dist/snapshot/dump-format.js +2 -2
  36. package/packages/{agent-script → safejs}/dist/snapshot/dump.js +3 -3
  37. package/packages/toolcraft-codemode/dist/execute.d.ts +1 -1
  38. package/packages/toolcraft-codemode/dist/execute.js +3 -3
  39. package/packages/agent-script/dist/dump.d.ts +0 -2
  40. package/packages/agent-script/dist/dump.js +0 -2
  41. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/event-collector.d.ts +0 -0
  42. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/event-collector.js +0 -0
  43. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/fixtures.d.ts +0 -0
  44. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/fixtures.js +0 -0
  45. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/index.d.ts +0 -0
  46. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/index.js +0 -0
  47. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/mock-spawn.d.ts +0 -0
  48. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/mock-spawn.js +0 -0
  49. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/mock-task-list.d.ts +0 -0
  50. /package/packages/{agent-maestro → maestro}/dist/__test_utils__/mock-task-list.js +0 -0
  51. /package/packages/{agent-maestro → maestro}/dist/agent/runner.d.ts +0 -0
  52. /package/packages/{agent-maestro → maestro}/dist/agent/runner.js +0 -0
  53. /package/packages/{agent-maestro → maestro}/dist/config/load.d.ts +0 -0
  54. /package/packages/{agent-maestro → maestro}/dist/config/load.js +0 -0
  55. /package/packages/{agent-maestro → maestro}/dist/config/schema.d.ts +0 -0
  56. /package/packages/{agent-maestro → maestro}/dist/config/schema.js +0 -0
  57. /package/packages/{agent-maestro → maestro}/dist/config/task-list.d.ts +0 -0
  58. /package/packages/{agent-maestro → maestro}/dist/config/task-list.js +0 -0
  59. /package/packages/{agent-maestro → maestro}/dist/config/validate.d.ts +0 -0
  60. /package/packages/{agent-maestro → maestro}/dist/config/validate.js +0 -0
  61. /package/packages/{agent-maestro → maestro}/dist/drivers/experiment.d.ts +0 -0
  62. /package/packages/{agent-maestro → maestro}/dist/drivers/experiment.js +0 -0
  63. /package/packages/{agent-maestro → maestro}/dist/drivers/harness.d.ts +0 -0
  64. /package/packages/{agent-maestro → maestro}/dist/drivers/harness.js +0 -0
  65. /package/packages/{agent-maestro → maestro}/dist/drivers/index.d.ts +0 -0
  66. /package/packages/{agent-maestro → maestro}/dist/drivers/index.js +0 -0
  67. /package/packages/{agent-maestro → maestro}/dist/drivers/kind.d.ts +0 -0
  68. /package/packages/{agent-maestro → maestro}/dist/drivers/kind.js +0 -0
  69. /package/packages/{agent-maestro → maestro}/dist/drivers/pipeline.d.ts +0 -0
  70. /package/packages/{agent-maestro → maestro}/dist/drivers/pipeline.js +0 -0
  71. /package/packages/{agent-maestro → maestro}/dist/drivers/ralph.d.ts +0 -0
  72. /package/packages/{agent-maestro → maestro}/dist/drivers/ralph.js +0 -0
  73. /package/packages/{agent-maestro → maestro}/dist/drivers/registry.d.ts +0 -0
  74. /package/packages/{agent-maestro → maestro}/dist/drivers/registry.js +0 -0
  75. /package/packages/{agent-maestro → maestro}/dist/drivers/superintendent.d.ts +0 -0
  76. /package/packages/{agent-maestro → maestro}/dist/drivers/superintendent.js +0 -0
  77. /package/packages/{agent-maestro → maestro}/dist/drivers/types.d.ts +0 -0
  78. /package/packages/{agent-maestro → maestro}/dist/drivers/types.js +0 -0
  79. /package/packages/{agent-maestro → maestro}/dist/drivers/unsupported.d.ts +0 -0
  80. /package/packages/{agent-maestro → maestro}/dist/drivers/unsupported.js +0 -0
  81. /package/packages/{agent-maestro → maestro}/dist/error-codes.d.ts +0 -0
  82. /package/packages/{agent-maestro → maestro}/dist/error-codes.js +0 -0
  83. /package/packages/{agent-maestro → maestro}/dist/index.d.ts +0 -0
  84. /package/packages/{agent-maestro → maestro}/dist/index.js +0 -0
  85. /package/packages/{agent-maestro → maestro}/dist/prompt/render.d.ts +0 -0
  86. /package/packages/{agent-maestro → maestro}/dist/prompt/render.js +0 -0
  87. /package/packages/{agent-maestro → maestro}/dist/runtime/advance.d.ts +0 -0
  88. /package/packages/{agent-maestro → maestro}/dist/runtime/advance.js +0 -0
  89. /package/packages/{agent-maestro → maestro}/dist/runtime/loop.d.ts +0 -0
  90. /package/packages/{agent-maestro → maestro}/dist/runtime/loop.js +0 -0
  91. /package/packages/{agent-maestro → maestro}/dist/runtime/phases.d.ts +0 -0
  92. /package/packages/{agent-maestro → maestro}/dist/runtime/phases.js +0 -0
  93. /package/packages/{agent-maestro → maestro}/dist/runtime/reconcile.d.ts +0 -0
  94. /package/packages/{agent-maestro → maestro}/dist/runtime/reconcile.js +0 -0
  95. /package/packages/{agent-maestro → maestro}/dist/runtime/retry.d.ts +0 -0
  96. /package/packages/{agent-maestro → maestro}/dist/runtime/retry.js +0 -0
  97. /package/packages/{agent-maestro → maestro}/dist/runtime/sanitize.d.ts +0 -0
  98. /package/packages/{agent-maestro → maestro}/dist/runtime/sanitize.js +0 -0
  99. /package/packages/{agent-maestro → maestro}/dist/runtime/state.d.ts +0 -0
  100. /package/packages/{agent-maestro → maestro}/dist/runtime/state.js +0 -0
  101. /package/packages/{agent-maestro → maestro}/dist/state-machine.d.ts +0 -0
  102. /package/packages/{agent-maestro → maestro}/dist/state-machine.js +0 -0
  103. /package/packages/{agent-maestro → maestro}/dist/tick-command.d.ts +0 -0
  104. /package/packages/{agent-maestro → maestro}/dist/tick-command.js +0 -0
  105. /package/packages/{agent-maestro → maestro}/dist/workflow-path.d.ts +0 -0
  106. /package/packages/{agent-maestro → maestro}/dist/workflow-path.js +0 -0
  107. /package/packages/{agent-maestro → maestro}/dist/workspace/manager.d.ts +0 -0
  108. /package/packages/{agent-maestro → maestro}/dist/workspace/manager.js +0 -0
  109. /package/packages/{agent-script → safejs}/dist/cli.d.ts +0 -0
  110. /package/packages/{agent-script → safejs}/dist/core.d.ts +0 -0
  111. /package/packages/{agent-script → safejs}/dist/core.js +0 -0
  112. /package/packages/{agent-script → safejs}/dist/error/format.d.ts +0 -0
  113. /package/packages/{agent-script → safejs}/dist/error/format.js +0 -0
  114. /package/packages/{agent-script → safejs}/dist/error/shape.d.ts +0 -0
  115. /package/packages/{agent-script → safejs}/dist/error/shape.js +0 -0
  116. /package/packages/{agent-script → safejs}/dist/error-codes.d.ts +0 -0
  117. /package/packages/{agent-script → safejs}/dist/error-codes.js +0 -0
  118. /package/packages/{agent-script → safejs}/dist/example-runner.d.ts +0 -0
  119. /package/packages/{agent-script → safejs}/dist/example-runner.js +0 -0
  120. /package/packages/{agent-script → safejs}/dist/graph-depth.d.ts +0 -0
  121. /package/packages/{agent-script → safejs}/dist/graph-depth.js +0 -0
  122. /package/packages/{agent-script → safejs}/dist/index.d.ts +0 -0
  123. /package/packages/{agent-script → safejs}/dist/index.js +0 -0
  124. /package/packages/{agent-script → safejs}/dist/interp/async.d.ts +0 -0
  125. /package/packages/{agent-script → safejs}/dist/interp/async.js +0 -0
  126. /package/packages/{agent-script → safejs}/dist/interp/budget.d.ts +0 -0
  127. /package/packages/{agent-script → safejs}/dist/interp/budget.js +0 -0
  128. /package/packages/{agent-script → safejs}/dist/interp/cancel.d.ts +0 -0
  129. /package/packages/{agent-script → safejs}/dist/interp/cancel.js +0 -0
  130. /package/packages/{agent-script → safejs}/dist/interp/exceptions.d.ts +0 -0
  131. /package/packages/{agent-script → safejs}/dist/interp/exceptions.js +0 -0
  132. /package/packages/{agent-script → safejs}/dist/interp/generator.d.ts +0 -0
  133. /package/packages/{agent-script → safejs}/dist/interp/generator.js +0 -0
  134. /package/packages/{agent-script → safejs}/dist/interp/globals/collections.d.ts +0 -0
  135. /package/packages/{agent-script → safejs}/dist/interp/globals/console-json.d.ts +0 -0
  136. /package/packages/{agent-script → safejs}/dist/interp/globals/console-json.js +0 -0
  137. /package/packages/{agent-script → safejs}/dist/interp/globals/error.d.ts +0 -0
  138. /package/packages/{agent-script → safejs}/dist/interp/globals/error.js +0 -0
  139. /package/packages/{agent-script → safejs}/dist/interp/globals/math.d.ts +0 -0
  140. /package/packages/{agent-script → safejs}/dist/interp/globals/math.js +0 -0
  141. /package/packages/{agent-script → safejs}/dist/interp/globals/misc.d.ts +0 -0
  142. /package/packages/{agent-script → safejs}/dist/interp/globals/misc.js +0 -0
  143. /package/packages/{agent-script → safejs}/dist/interp/globals/object-array.d.ts +0 -0
  144. /package/packages/{agent-script → safejs}/dist/interp/globals/object-array.js +0 -0
  145. /package/packages/{agent-script → safejs}/dist/interp/globals/regex.d.ts +0 -0
  146. /package/packages/{agent-script → safejs}/dist/interp/globals/regex.js +0 -0
  147. /package/packages/{agent-script → safejs}/dist/interp/host-bridge.d.ts +0 -0
  148. /package/packages/{agent-script → safejs}/dist/interp/host-bridge.js +0 -0
  149. /package/packages/{agent-script → safejs}/dist/interp/host-call.d.ts +0 -0
  150. /package/packages/{agent-script → safejs}/dist/interp/host-call.js +0 -0
  151. /package/packages/{agent-script → safejs}/dist/interp/interpreter.d.ts +0 -0
  152. /package/packages/{agent-script → safejs}/dist/interp/iteration.d.ts +0 -0
  153. /package/packages/{agent-script → safejs}/dist/interp/iteration.js +0 -0
  154. /package/packages/{agent-script → safejs}/dist/interp/methods/array.d.ts +0 -0
  155. /package/packages/{agent-script → safejs}/dist/interp/methods/array.js +0 -0
  156. /package/packages/{agent-script → safejs}/dist/interp/methods/function.d.ts +0 -0
  157. /package/packages/{agent-script → safejs}/dist/interp/methods/function.js +0 -0
  158. /package/packages/{agent-script → safejs}/dist/interp/methods/generator.d.ts +0 -0
  159. /package/packages/{agent-script → safejs}/dist/interp/methods/generator.js +0 -0
  160. /package/packages/{agent-script → safejs}/dist/interp/methods/map.d.ts +0 -0
  161. /package/packages/{agent-script → safejs}/dist/interp/methods/map.js +0 -0
  162. /package/packages/{agent-script → safejs}/dist/interp/methods/number.d.ts +0 -0
  163. /package/packages/{agent-script → safejs}/dist/interp/methods/number.js +0 -0
  164. /package/packages/{agent-script → safejs}/dist/interp/methods/regex.d.ts +0 -0
  165. /package/packages/{agent-script → safejs}/dist/interp/methods/regex.js +0 -0
  166. /package/packages/{agent-script → safejs}/dist/interp/methods/set.d.ts +0 -0
  167. /package/packages/{agent-script → safejs}/dist/interp/methods/set.js +0 -0
  168. /package/packages/{agent-script → safejs}/dist/interp/methods/string.d.ts +0 -0
  169. /package/packages/{agent-script → safejs}/dist/interp/methods/string.js +0 -0
  170. /package/packages/{agent-script → safejs}/dist/interp/patterns.d.ts +0 -0
  171. /package/packages/{agent-script → safejs}/dist/interp/patterns.js +0 -0
  172. /package/packages/{agent-script → safejs}/dist/interp/promise-tracker.d.ts +0 -0
  173. /package/packages/{agent-script → safejs}/dist/interp/promise-tracker.js +0 -0
  174. /package/packages/{agent-script → safejs}/dist/interp/promise.d.ts +0 -0
  175. /package/packages/{agent-script → safejs}/dist/interp/promise.js +0 -0
  176. /package/packages/{agent-script → safejs}/dist/interp/regex/engine.d.ts +0 -0
  177. /package/packages/{agent-script → safejs}/dist/interp/regex/engine.js +0 -0
  178. /package/packages/{agent-script → safejs}/dist/interp/regex/parse.d.ts +0 -0
  179. /package/packages/{agent-script → safejs}/dist/interp/regex/parse.js +0 -0
  180. /package/packages/{agent-script → safejs}/dist/interp/running-state.d.ts +0 -0
  181. /package/packages/{agent-script → safejs}/dist/interp/running-state.js +0 -0
  182. /package/packages/{agent-script → safejs}/dist/interp/scope.d.ts +0 -0
  183. /package/packages/{agent-script → safejs}/dist/interp/scope.js +0 -0
  184. /package/packages/{agent-script → safejs}/dist/interp/values.d.ts +0 -0
  185. /package/packages/{agent-script → safejs}/dist/interp/values.js +0 -0
  186. /package/packages/{agent-script → safejs}/dist/interp/var-hoist.d.ts +0 -0
  187. /package/packages/{agent-script → safejs}/dist/interp/var-hoist.js +0 -0
  188. /package/packages/{agent-script → safejs}/dist/lint/index.d.ts +0 -0
  189. /package/packages/{agent-script → safejs}/dist/lint/index.js +0 -0
  190. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-async-not-needed.d.ts +0 -0
  191. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-async-not-needed.js +0 -0
  192. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-await-non-promise.d.ts +0 -0
  193. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-await-non-promise.js +0 -0
  194. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-destructure-null-default.d.ts +0 -0
  195. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-destructure-null-default.js +0 -0
  196. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-export-import-meta.d.ts +0 -0
  197. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-export-import-meta.js +0 -0
  198. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-floating-promise.d.ts +0 -0
  199. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-floating-promise.js +0 -0
  200. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-frontmatter-field-unused.d.ts +0 -0
  201. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-frontmatter-field-unused.js +0 -0
  202. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-import-cycle.d.ts +0 -0
  203. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-jsdoc-type.d.ts +0 -0
  204. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-jsdoc-type.js +0 -0
  205. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-large-literal.d.ts +0 -0
  206. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-large-literal.js +0 -0
  207. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-missing-async.d.ts +0 -0
  208. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-missing-async.js +0 -0
  209. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-mutating-frozen.d.ts +0 -0
  210. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-mutating-frozen.js +0 -0
  211. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-needless-template.d.ts +0 -0
  212. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-needless-template.js +0 -0
  213. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-shadow-global.d.ts +0 -0
  214. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-shadow-global.js +0 -0
  215. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-unbounded-loop.d.ts +0 -0
  216. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-unbounded-loop.js +0 -0
  217. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-unreachable.d.ts +0 -0
  218. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-unreachable.js +0 -0
  219. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-unused-import.d.ts +0 -0
  220. /package/packages/{agent-script → safejs}/dist/lint/rules/AS-unused-import.js +0 -0
  221. /package/packages/{agent-script → safejs}/dist/lint/rules/AS001.d.ts +0 -0
  222. /package/packages/{agent-script → safejs}/dist/lint/rules/AS001.js +0 -0
  223. /package/packages/{agent-script → safejs}/dist/lint/rules/AS002.d.ts +0 -0
  224. /package/packages/{agent-script → safejs}/dist/lint/rules/AS002.js +0 -0
  225. /package/packages/{agent-script → safejs}/dist/lint/rules/AS003.d.ts +0 -0
  226. /package/packages/{agent-script → safejs}/dist/lint/rules/AS003.js +0 -0
  227. /package/packages/{agent-script → safejs}/dist/lint/rules/AS004.d.ts +0 -0
  228. /package/packages/{agent-script → safejs}/dist/lint/rules/AS004.js +0 -0
  229. /package/packages/{agent-script → safejs}/dist/lint/rules/AS005.d.ts +0 -0
  230. /package/packages/{agent-script → safejs}/dist/lint/rules/AS006-007.d.ts +0 -0
  231. /package/packages/{agent-script → safejs}/dist/lint/rules/AS006-007.js +0 -0
  232. /package/packages/{agent-script → safejs}/dist/lint/rules/AS008.d.ts +0 -0
  233. /package/packages/{agent-script → safejs}/dist/lint/rules/AS008.js +0 -0
  234. /package/packages/{agent-script → safejs}/dist/lint/rules/AS009.d.ts +0 -0
  235. /package/packages/{agent-script → safejs}/dist/lint/rules/AS009.js +0 -0
  236. /package/packages/{agent-script → safejs}/dist/lint/rules/AS010.d.ts +0 -0
  237. /package/packages/{agent-script → safejs}/dist/lint/rules/AS010.js +0 -0
  238. /package/packages/{agent-script → safejs}/dist/lint/rules/AS011.d.ts +0 -0
  239. /package/packages/{agent-script → safejs}/dist/lint/rules/AS011.js +0 -0
  240. /package/packages/{agent-script → safejs}/dist/lint/rules/AS012.d.ts +0 -0
  241. /package/packages/{agent-script → safejs}/dist/lint/rules/AS012.js +0 -0
  242. /package/packages/{agent-script → safejs}/dist/lint/rules/AS013.d.ts +0 -0
  243. /package/packages/{agent-script → safejs}/dist/lint/rules/AS013.js +0 -0
  244. /package/packages/{agent-script → safejs}/dist/lint/rules/AS014.d.ts +0 -0
  245. /package/packages/{agent-script → safejs}/dist/lint/rules/AS015.d.ts +0 -0
  246. /package/packages/{agent-script → safejs}/dist/lint/rules/AS015.js +0 -0
  247. /package/packages/{agent-script → safejs}/dist/lint/rules/known-globals.d.ts +0 -0
  248. /package/packages/{agent-script → safejs}/dist/lint/rules/known-globals.js +0 -0
  249. /package/packages/{agent-script → safejs}/dist/lint/runtime-modules.d.ts +0 -0
  250. /package/packages/{agent-script → safejs}/dist/lint/runtime-modules.js +0 -0
  251. /package/packages/{agent-script → safejs}/dist/lint.d.ts +0 -0
  252. /package/packages/{agent-script → safejs}/dist/lint.js +0 -0
  253. /package/packages/{agent-script → safejs}/dist/loader/extract-block.d.ts +0 -0
  254. /package/packages/{agent-script → safejs}/dist/loader/find-exported.d.ts +0 -0
  255. /package/packages/{agent-script → safejs}/dist/loader/find-exported.js +0 -0
  256. /package/packages/{agent-script → safejs}/dist/loader/frontmatter.d.ts +0 -0
  257. /package/packages/{agent-script → safejs}/dist/modules/agent.d.ts +0 -0
  258. /package/packages/{agent-script → safejs}/dist/modules/env.d.ts +0 -0
  259. /package/packages/{agent-script → safejs}/dist/modules/env.js +0 -0
  260. /package/packages/{agent-script → safejs}/dist/modules/fail.d.ts +0 -0
  261. /package/packages/{agent-script → safejs}/dist/modules/fail.js +0 -0
  262. /package/packages/{agent-script → safejs}/dist/modules/git.d.ts +0 -0
  263. /package/packages/{agent-script → safejs}/dist/modules/harness.d.ts +0 -0
  264. /package/packages/{agent-script → safejs}/dist/modules/harness.js +0 -0
  265. /package/packages/{agent-script → safejs}/dist/modules/log.d.ts +0 -0
  266. /package/packages/{agent-script → safejs}/dist/modules/log.js +0 -0
  267. /package/packages/{agent-script → safejs}/dist/modules/mcp.d.ts +0 -0
  268. /package/packages/{agent-script → safejs}/dist/modules/metric.d.ts +0 -0
  269. /package/packages/{agent-script → safejs}/dist/modules/metric.js +0 -0
  270. /package/packages/{agent-script → safejs}/dist/modules/registry.d.ts +0 -0
  271. /package/packages/{agent-script → safejs}/dist/modules/registry.js +0 -0
  272. /package/packages/{agent-script → safejs}/dist/modules/time.d.ts +0 -0
  273. /package/packages/{agent-script → safejs}/dist/modules/time.js +0 -0
  274. /package/packages/{agent-script → safejs}/dist/observability/otel.d.ts +0 -0
  275. /package/packages/{agent-script → safejs}/dist/observability/otel.js +0 -0
  276. /package/packages/{agent-script → safejs}/dist/output-stream.d.ts +0 -0
  277. /package/packages/{agent-script → safejs}/dist/output-stream.js +0 -0
  278. /package/packages/{agent-script → safejs}/dist/parse/assign-ids.d.ts +0 -0
  279. /package/packages/{agent-script → safejs}/dist/parse/assign-ids.js +0 -0
  280. /package/packages/{agent-script → safejs}/dist/parse/format-error.d.ts +0 -0
  281. /package/packages/{agent-script → safejs}/dist/parse/format-error.js +0 -0
  282. /package/packages/{agent-script → safejs}/dist/parse/hash.d.ts +0 -0
  283. /package/packages/{agent-script → safejs}/dist/parse/hash.js +0 -0
  284. /package/packages/{agent-script → safejs}/dist/parse/parse-export.d.ts +0 -0
  285. /package/packages/{agent-script → safejs}/dist/parse/parse-export.js +0 -0
  286. /package/packages/{agent-script → safejs}/dist/parse/parse-import-meta.d.ts +0 -0
  287. /package/packages/{agent-script → safejs}/dist/parse/parse-import-meta.js +0 -0
  288. /package/packages/{agent-script → safejs}/dist/parse/parser.d.ts +0 -0
  289. /package/packages/{agent-script → safejs}/dist/parse/parser.js +0 -0
  290. /package/packages/{agent-script → safejs}/dist/parse/tokenizer.d.ts +0 -0
  291. /package/packages/{agent-script → safejs}/dist/parse/tokenizer.js +0 -0
  292. /package/packages/{agent-script → safejs}/dist/parse.d.ts +0 -0
  293. /package/packages/{agent-script → safejs}/dist/parse.js +0 -0
  294. /package/packages/{agent-script → safejs}/dist/restore.js +0 -0
  295. /package/packages/{agent-script → safejs}/dist/run.js +0 -0
  296. /package/packages/{agent-script → safejs}/dist/runner/run-harness.d.ts +0 -0
  297. /package/packages/{agent-script → safejs}/dist/runner/signal-dump.d.ts +0 -0
  298. /package/packages/{agent-script → safejs}/dist/runner/signal-dump.js +0 -0
  299. /package/packages/{agent-script → safejs}/dist/snapshot/dump.d.ts +0 -0
  300. /package/packages/{agent-script → safejs}/dist/snapshot/policy.d.ts +0 -0
  301. /package/packages/{agent-script → safejs}/dist/snapshot/policy.js +0 -0
  302. /package/packages/{agent-script → safejs}/dist/snapshot/restore.d.ts +0 -0
  303. /package/packages/{agent-script → safejs}/dist/snapshot/restore.js +0 -0
  304. /package/packages/{agent-script → safejs}/dist/snapshot/scheduler.d.ts +0 -0
  305. /package/packages/{agent-script → safejs}/dist/snapshot/scheduler.js +0 -0
  306. /package/packages/{agent-script → safejs}/dist/snapshot/serialize.d.ts +0 -0
  307. /package/packages/{agent-script → safejs}/dist/snapshot/serialize.js +0 -0
  308. /package/packages/{agent-script → safejs}/dist/snapshot/validation.d.ts +0 -0
  309. /package/packages/{agent-script → safejs}/dist/snapshot/validation.js +0 -0
package/dist/index.js CHANGED
@@ -71663,7 +71663,7 @@ var init_pipeline3 = __esm({
71663
71663
  }
71664
71664
  });
71665
71665
 
71666
- // packages/agent-maestro/src/config/load.ts
71666
+ // packages/maestro/src/config/load.ts
71667
71667
  import { readFile as readFile24 } from "node:fs/promises";
71668
71668
  import path95 from "node:path";
71669
71669
  async function loadWorkflow(workflowPath) {
@@ -71778,7 +71778,7 @@ function stripSingleLeadingBlankLine(value) {
71778
71778
  }
71779
71779
  var WorkflowLoadError;
71780
71780
  var init_load = __esm({
71781
- "packages/agent-maestro/src/config/load.ts"() {
71781
+ "packages/maestro/src/config/load.ts"() {
71782
71782
  "use strict";
71783
71783
  init_src();
71784
71784
  WorkflowLoadError = class extends Error {
@@ -71792,7 +71792,7 @@ var init_load = __esm({
71792
71792
  }
71793
71793
  });
71794
71794
 
71795
- // packages/agent-maestro/src/config/validate.ts
71795
+ // packages/maestro/src/config/validate.ts
71796
71796
  function validateStateDefinitions(value) {
71797
71797
  if (!isStateMap(value)) {
71798
71798
  throw new Error("Workflow config requires a states map.");
@@ -71954,7 +71954,7 @@ function isFiniteNumber(value) {
71954
71954
  }
71955
71955
  var taskFieldValidators;
71956
71956
  var init_validate3 = __esm({
71957
- "packages/agent-maestro/src/config/validate.ts"() {
71957
+ "packages/maestro/src/config/validate.ts"() {
71958
71958
  "use strict";
71959
71959
  init_src11();
71960
71960
  taskFieldValidators = {
@@ -71965,7 +71965,7 @@ var init_validate3 = __esm({
71965
71965
  }
71966
71966
  });
71967
71967
 
71968
- // packages/agent-maestro/src/config/schema.ts
71968
+ // packages/maestro/src/config/schema.ts
71969
71969
  import os13 from "node:os";
71970
71970
  import path96 from "node:path";
71971
71971
  function resolveConfig2(raw, cwd) {
@@ -72199,7 +72199,7 @@ function isEnvName(value) {
72199
72199
  }
72200
72200
  var maestroConfigScope;
72201
72201
  var init_schema3 = __esm({
72202
- "packages/agent-maestro/src/config/schema.ts"() {
72202
+ "packages/maestro/src/config/schema.ts"() {
72203
72203
  "use strict";
72204
72204
  init_src9();
72205
72205
  init_validate3();
@@ -72230,7 +72230,7 @@ var init_schema3 = __esm({
72230
72230
  }
72231
72231
  });
72232
72232
 
72233
- // packages/agent-maestro/src/config/task-list.ts
72233
+ // packages/maestro/src/config/task-list.ts
72234
72234
  function resolveConfiguredTaskListOptions(cfg) {
72235
72235
  const tasks = getOwnEntry31(cfg, "tasks");
72236
72236
  if (tasks === void 0) {
@@ -72271,12 +72271,12 @@ function deriveStateEvents(stateOrder, terminalStateNames) {
72271
72271
  );
72272
72272
  }
72273
72273
  var init_task_list = __esm({
72274
- "packages/agent-maestro/src/config/task-list.ts"() {
72274
+ "packages/maestro/src/config/task-list.ts"() {
72275
72275
  "use strict";
72276
72276
  }
72277
72277
  });
72278
72278
 
72279
- // packages/agent-maestro/src/drivers/kind.ts
72279
+ // packages/maestro/src/drivers/kind.ts
72280
72280
  import { parseDocument as parseDocument8 } from "yaml";
72281
72281
  function resolveWorkflowKind(task) {
72282
72282
  if (task.sourcePath === void 0) {
@@ -72325,12 +72325,12 @@ function isRecord30(value) {
72325
72325
  return typeof value === "object" && value !== null && !Array.isArray(value);
72326
72326
  }
72327
72327
  var init_kind = __esm({
72328
- "packages/agent-maestro/src/drivers/kind.ts"() {
72328
+ "packages/maestro/src/drivers/kind.ts"() {
72329
72329
  "use strict";
72330
72330
  }
72331
72331
  });
72332
72332
 
72333
- // packages/agent-maestro/src/drivers/registry.ts
72333
+ // packages/maestro/src/drivers/registry.ts
72334
72334
  function registerDriver(driver) {
72335
72335
  const existing = drivers.get(driver.kind);
72336
72336
  if (existing === driver) {
@@ -72346,13 +72346,13 @@ function getDriver(kind) {
72346
72346
  }
72347
72347
  var drivers;
72348
72348
  var init_registry4 = __esm({
72349
- "packages/agent-maestro/src/drivers/registry.ts"() {
72349
+ "packages/maestro/src/drivers/registry.ts"() {
72350
72350
  "use strict";
72351
72351
  drivers = /* @__PURE__ */ new Map();
72352
72352
  }
72353
72353
  });
72354
72354
 
72355
- // packages/agent-maestro/src/runtime/state.ts
72355
+ // packages/maestro/src/runtime/state.ts
72356
72356
  function createState(cfg) {
72357
72357
  return {
72358
72358
  cfg,
@@ -72398,22 +72398,22 @@ function cancelRetry(state, taskId) {
72398
72398
  state.retry_attempts.delete(taskId);
72399
72399
  }
72400
72400
  var init_state4 = __esm({
72401
- "packages/agent-maestro/src/runtime/state.ts"() {
72401
+ "packages/maestro/src/runtime/state.ts"() {
72402
72402
  "use strict";
72403
72403
  }
72404
72404
  });
72405
72405
 
72406
- // packages/agent-maestro/src/error-codes.ts
72406
+ // packages/maestro/src/error-codes.ts
72407
72407
  function hasOwnErrorCode23(error3, code) {
72408
72408
  return typeof error3 === "object" && error3 !== null && Object.prototype.hasOwnProperty.call(error3, "code") && error3.code === code;
72409
72409
  }
72410
72410
  var init_error_codes18 = __esm({
72411
- "packages/agent-maestro/src/error-codes.ts"() {
72411
+ "packages/maestro/src/error-codes.ts"() {
72412
72412
  "use strict";
72413
72413
  }
72414
72414
  });
72415
72415
 
72416
- // packages/agent-maestro/src/runtime/sanitize.ts
72416
+ // packages/maestro/src/runtime/sanitize.ts
72417
72417
  import crypto8 from "node:crypto";
72418
72418
  import path97 from "node:path";
72419
72419
  function sanitizeWorkspaceKey(qualifiedId) {
@@ -72471,14 +72471,14 @@ function isWorkspaceKeyCharacter(character) {
72471
72471
  }
72472
72472
  var maxWorkspaceKeyLength, workspaceKeyHashLength;
72473
72473
  var init_sanitize = __esm({
72474
- "packages/agent-maestro/src/runtime/sanitize.ts"() {
72474
+ "packages/maestro/src/runtime/sanitize.ts"() {
72475
72475
  "use strict";
72476
72476
  maxWorkspaceKeyLength = 255;
72477
72477
  workspaceKeyHashLength = 16;
72478
72478
  }
72479
72479
  });
72480
72480
 
72481
- // packages/agent-maestro/src/workspace/manager.ts
72481
+ // packages/maestro/src/workspace/manager.ts
72482
72482
  import fs9 from "node:fs/promises";
72483
72483
  import path98 from "node:path";
72484
72484
  async function ensureWorkspace(root, qualifiedId) {
@@ -72624,14 +72624,14 @@ async function lstatIfExists(filePath) {
72624
72624
  }
72625
72625
  }
72626
72626
  var init_manager = __esm({
72627
- "packages/agent-maestro/src/workspace/manager.ts"() {
72627
+ "packages/maestro/src/workspace/manager.ts"() {
72628
72628
  "use strict";
72629
72629
  init_error_codes18();
72630
72630
  init_sanitize();
72631
72631
  }
72632
72632
  });
72633
72633
 
72634
- // packages/agent-maestro/src/runtime/reconcile.ts
72634
+ // packages/maestro/src/runtime/reconcile.ts
72635
72635
  async function reconcileRunning(state, deps) {
72636
72636
  const results = [];
72637
72637
  for (const entry of [...state.running.values()]) {
@@ -72696,7 +72696,7 @@ function errorMessage4(error3) {
72696
72696
  return error3 instanceof Error ? error3.message : String(error3);
72697
72697
  }
72698
72698
  var init_reconcile = __esm({
72699
- "packages/agent-maestro/src/runtime/reconcile.ts"() {
72699
+ "packages/maestro/src/runtime/reconcile.ts"() {
72700
72700
  "use strict";
72701
72701
  init_src11();
72702
72702
  init_state4();
@@ -72704,14 +72704,14 @@ var init_reconcile = __esm({
72704
72704
  }
72705
72705
  });
72706
72706
 
72707
- // packages/agent-maestro/src/agent/runner.ts
72707
+ // packages/maestro/src/agent/runner.ts
72708
72708
  async function runAttempt(args) {
72709
72709
  const runner = new AttemptRunner(args);
72710
72710
  return runner.run();
72711
72711
  }
72712
72712
  var AttemptRunner, noopLogger;
72713
72713
  var init_runner4 = __esm({
72714
- "packages/agent-maestro/src/agent/runner.ts"() {
72714
+ "packages/maestro/src/agent/runner.ts"() {
72715
72715
  "use strict";
72716
72716
  init_src17();
72717
72717
  init_kind();
@@ -72753,7 +72753,7 @@ var init_runner4 = __esm({
72753
72753
  }
72754
72754
  });
72755
72755
 
72756
- // packages/agent-maestro/src/runtime/advance.ts
72756
+ // packages/maestro/src/runtime/advance.ts
72757
72757
  async function advanceTaskToRunning(tasks, task, options = {}) {
72758
72758
  const list = tasks.list(task.list);
72759
72759
  const events = options.events ?? [DEFAULT_RUNNING_EVENT];
@@ -72769,13 +72769,13 @@ async function advanceTaskToRunning(tasks, task, options = {}) {
72769
72769
  }
72770
72770
  var DEFAULT_RUNNING_EVENT;
72771
72771
  var init_advance = __esm({
72772
- "packages/agent-maestro/src/runtime/advance.ts"() {
72772
+ "packages/maestro/src/runtime/advance.ts"() {
72773
72773
  "use strict";
72774
72774
  DEFAULT_RUNNING_EVENT = "agent-running";
72775
72775
  }
72776
72776
  });
72777
72777
 
72778
- // packages/agent-maestro/src/runtime/retry.ts
72778
+ // packages/maestro/src/runtime/retry.ts
72779
72779
  function backoffMs(attempt, capMs) {
72780
72780
  return Math.min(1e4 * 2 ** (attempt - 1), capMs);
72781
72781
  }
@@ -72808,7 +72808,7 @@ function shouldRetry(phase, failure, ctx = {}) {
72808
72808
  }
72809
72809
  var CONTINUATION_DELAY_MS, RETRYABLE_FAILURE_CATEGORIES;
72810
72810
  var init_retry2 = __esm({
72811
- "packages/agent-maestro/src/runtime/retry.ts"() {
72811
+ "packages/maestro/src/runtime/retry.ts"() {
72812
72812
  "use strict";
72813
72813
  CONTINUATION_DELAY_MS = 1e3;
72814
72814
  RETRYABLE_FAILURE_CATEGORIES = [
@@ -72821,7 +72821,7 @@ var init_retry2 = __esm({
72821
72821
  }
72822
72822
  });
72823
72823
 
72824
- // packages/agent-maestro/src/runtime/loop.ts
72824
+ // packages/maestro/src/runtime/loop.ts
72825
72825
  async function tick(state, deps) {
72826
72826
  const now = deps.now?.() ?? Date.now();
72827
72827
  deps.onEvent?.({ type: "tick_started", running: state.running.size });
@@ -73099,7 +73099,7 @@ function outcomePhase(outcome) {
73099
73099
  return outcome.failure === "canceled" ? "canceled" : "failed";
73100
73100
  }
73101
73101
  var init_loop3 = __esm({
73102
- "packages/agent-maestro/src/runtime/loop.ts"() {
73102
+ "packages/maestro/src/runtime/loop.ts"() {
73103
73103
  "use strict";
73104
73104
  init_runner4();
73105
73105
  init_validate3();
@@ -73113,7 +73113,7 @@ var init_loop3 = __esm({
73113
73113
  }
73114
73114
  });
73115
73115
 
73116
- // packages/agent-maestro/src/workflow-path.ts
73116
+ // packages/maestro/src/workflow-path.ts
73117
73117
  import path99 from "node:path";
73118
73118
  function resolveWorkflowPath2(name, cwd) {
73119
73119
  if (name !== void 0 && !isValidWorkflowName(name)) {
@@ -73128,12 +73128,12 @@ function isValidWorkflowName(name) {
73128
73128
  return name.length > 0 && !name.includes("/") && !name.includes("\\");
73129
73129
  }
73130
73130
  var init_workflow_path = __esm({
73131
- "packages/agent-maestro/src/workflow-path.ts"() {
73131
+ "packages/maestro/src/workflow-path.ts"() {
73132
73132
  "use strict";
73133
73133
  }
73134
73134
  });
73135
73135
 
73136
- // packages/agent-maestro/src/prompt/render.ts
73136
+ // packages/maestro/src/prompt/render.ts
73137
73137
  function renderTaskPrompt(template2, vars) {
73138
73138
  return interpolateTaskVars(resolveTaskTemplate(template2), vars);
73139
73139
  }
@@ -73201,7 +73201,7 @@ function isPlainRecord3(value) {
73201
73201
  }
73202
73202
  var DEFAULT_TASK_PROMPT, TEMPLATE_VAR_NAME_PATTERN, PLACEHOLDER_PATTERN2;
73203
73203
  var init_render3 = __esm({
73204
- "packages/agent-maestro/src/prompt/render.ts"() {
73204
+ "packages/maestro/src/prompt/render.ts"() {
73205
73205
  "use strict";
73206
73206
  DEFAULT_TASK_PROMPT = "{{ task.qualifiedId }}: {{ task.name }}\n\n{{ task.description }}";
73207
73207
  TEMPLATE_VAR_NAME_PATTERN = "[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)*";
@@ -73212,7 +73212,7 @@ var init_render3 = __esm({
73212
73212
  }
73213
73213
  });
73214
73214
 
73215
- // packages/agent-maestro/src/runtime/phases.ts
73215
+ // packages/maestro/src/runtime/phases.ts
73216
73216
  function transitionPhase(current, next, ctx) {
73217
73217
  if (current === null) {
73218
73218
  if (next !== "preparing-workspace") {
@@ -73258,7 +73258,7 @@ function validatedState(baseState, next, ctx) {
73258
73258
  }
73259
73259
  var ATTEMPT_TRANSITIONS;
73260
73260
  var init_phases = __esm({
73261
- "packages/agent-maestro/src/runtime/phases.ts"() {
73261
+ "packages/maestro/src/runtime/phases.ts"() {
73262
73262
  "use strict";
73263
73263
  ATTEMPT_TRANSITIONS = Object.freeze({
73264
73264
  "preparing-workspace": Object.freeze(["running-step", "failed", "canceled"]),
@@ -73270,7 +73270,7 @@ var init_phases = __esm({
73270
73270
  }
73271
73271
  });
73272
73272
 
73273
- // packages/agent-maestro/src/drivers/pipeline.ts
73273
+ // packages/maestro/src/drivers/pipeline.ts
73274
73274
  function isRunningPhase(phase) {
73275
73275
  return phase === "running-step";
73276
73276
  }
@@ -73291,7 +73291,7 @@ function errorMessage6(error3) {
73291
73291
  }
73292
73292
  var pipelineDriver, PipelineDriverRun;
73293
73293
  var init_pipeline4 = __esm({
73294
- "packages/agent-maestro/src/drivers/pipeline.ts"() {
73294
+ "packages/maestro/src/drivers/pipeline.ts"() {
73295
73295
  "use strict";
73296
73296
  init_src17();
73297
73297
  init_render3();
@@ -73476,7 +73476,7 @@ var init_pipeline4 = __esm({
73476
73476
  }
73477
73477
  });
73478
73478
 
73479
- // packages/agent-maestro/src/drivers/ralph.ts
73479
+ // packages/maestro/src/drivers/ralph.ts
73480
73480
  import { randomUUID as randomUUID29 } from "node:crypto";
73481
73481
  import * as fs10 from "node:fs/promises";
73482
73482
  import os14 from "node:os";
@@ -73681,7 +73681,7 @@ function errorMessage7(error3) {
73681
73681
  }
73682
73682
  var ralphDriver;
73683
73683
  var init_ralph2 = __esm({
73684
- "packages/agent-maestro/src/drivers/ralph.ts"() {
73684
+ "packages/maestro/src/drivers/ralph.ts"() {
73685
73685
  "use strict";
73686
73686
  init_src17();
73687
73687
  init_src33();
@@ -73690,7 +73690,7 @@ var init_ralph2 = __esm({
73690
73690
  }
73691
73691
  });
73692
73692
 
73693
- // packages/agent-maestro/src/drivers/unsupported.ts
73693
+ // packages/maestro/src/drivers/unsupported.ts
73694
73694
  function createUnsupportedWorkflowDriver(kind) {
73695
73695
  return {
73696
73696
  kind,
@@ -73727,35 +73727,35 @@ function runUnsupportedDriver(kind, ctx) {
73727
73727
  }
73728
73728
  var FAILURE;
73729
73729
  var init_unsupported = __esm({
73730
- "packages/agent-maestro/src/drivers/unsupported.ts"() {
73730
+ "packages/maestro/src/drivers/unsupported.ts"() {
73731
73731
  "use strict";
73732
73732
  FAILURE = "step_failed";
73733
73733
  }
73734
73734
  });
73735
73735
 
73736
- // packages/agent-maestro/src/drivers/harness.ts
73736
+ // packages/maestro/src/drivers/harness.ts
73737
73737
  var harnessDriver;
73738
73738
  var init_harness = __esm({
73739
- "packages/agent-maestro/src/drivers/harness.ts"() {
73739
+ "packages/maestro/src/drivers/harness.ts"() {
73740
73740
  "use strict";
73741
73741
  init_unsupported();
73742
73742
  harnessDriver = createUnsupportedWorkflowDriver("harness");
73743
73743
  }
73744
73744
  });
73745
73745
 
73746
- // packages/agent-maestro/src/drivers/superintendent.ts
73746
+ // packages/maestro/src/drivers/superintendent.ts
73747
73747
  var superintendentDriver;
73748
73748
  var init_superintendent2 = __esm({
73749
- "packages/agent-maestro/src/drivers/superintendent.ts"() {
73749
+ "packages/maestro/src/drivers/superintendent.ts"() {
73750
73750
  "use strict";
73751
73751
  init_unsupported();
73752
73752
  superintendentDriver = createUnsupportedWorkflowDriver("superintendent");
73753
73753
  }
73754
73754
  });
73755
73755
 
73756
- // packages/agent-maestro/src/drivers/index.ts
73756
+ // packages/maestro/src/drivers/index.ts
73757
73757
  var init_drivers = __esm({
73758
- "packages/agent-maestro/src/drivers/index.ts"() {
73758
+ "packages/maestro/src/drivers/index.ts"() {
73759
73759
  "use strict";
73760
73760
  init_pipeline4();
73761
73761
  init_ralph2();
@@ -73769,10 +73769,10 @@ var init_drivers = __esm({
73769
73769
  }
73770
73770
  });
73771
73771
 
73772
- // packages/agent-maestro/src/state-machine.ts
73772
+ // packages/maestro/src/state-machine.ts
73773
73773
  var maestroTaskStateMachine;
73774
73774
  var init_state_machine3 = __esm({
73775
- "packages/agent-maestro/src/state-machine.ts"() {
73775
+ "packages/maestro/src/state-machine.ts"() {
73776
73776
  "use strict";
73777
73777
  maestroTaskStateMachine = Object.freeze({
73778
73778
  initial: "queued",
@@ -73789,7 +73789,7 @@ var init_state_machine3 = __esm({
73789
73789
  }
73790
73790
  });
73791
73791
 
73792
- // packages/agent-maestro/src/tick-command.ts
73792
+ // packages/maestro/src/tick-command.ts
73793
73793
  import path101 from "node:path";
73794
73794
  async function runMaestroTick(options) {
73795
73795
  if (options.configPath !== void 0 && options.name !== void 0) {
@@ -73875,7 +73875,7 @@ function parseTransition(transition) {
73875
73875
  };
73876
73876
  }
73877
73877
  var init_tick_command = __esm({
73878
- "packages/agent-maestro/src/tick-command.ts"() {
73878
+ "packages/maestro/src/tick-command.ts"() {
73879
73879
  "use strict";
73880
73880
  init_src11();
73881
73881
  init_load();
@@ -73887,7 +73887,7 @@ var init_tick_command = __esm({
73887
73887
  }
73888
73888
  });
73889
73889
 
73890
- // packages/agent-maestro/src/index.ts
73890
+ // packages/maestro/src/index.ts
73891
73891
  import path102 from "node:path";
73892
73892
  async function runMaestro(opts = {}) {
73893
73893
  if (opts.workflowPath !== void 0 && opts.name !== void 0) {
@@ -74171,7 +74171,7 @@ function errorMessage8(error3) {
74171
74171
  }
74172
74172
  var STOP_BUDGET_MS, logLevelPriority;
74173
74173
  var init_src36 = __esm({
74174
- "packages/agent-maestro/src/index.ts"() {
74174
+ "packages/maestro/src/index.ts"() {
74175
74175
  "use strict";
74176
74176
  init_src11();
74177
74177
  init_load();
@@ -103258,7 +103258,7 @@ var init_error_codes20 = __esm({
103258
103258
  }
103259
103259
  });
103260
103260
 
103261
- // packages/agent-script/src/parse/tokenizer.ts
103261
+ // packages/safejs/src/parse/tokenizer.ts
103262
103262
  function tokenize3(source, options = {}) {
103263
103263
  const lexer = new Lexer(source, options);
103264
103264
  return lexer.tokenize();
@@ -103354,7 +103354,7 @@ function popGroupingContext(groupingStack, expected) {
103354
103354
  }
103355
103355
  var KEYWORDS, EXPRESSION_ENDING_KEYWORDS, CONTROL_FLOW_PAREN_KEYWORDS, MAX_UNICODE_CODE_POINT, IDENTIFIER_START_PATTERN, IDENTIFIER_PART_PATTERN, PUNCTUATORS, Lexer;
103356
103356
  var init_tokenizer2 = __esm({
103357
- "packages/agent-script/src/parse/tokenizer.ts"() {
103357
+ "packages/safejs/src/parse/tokenizer.ts"() {
103358
103358
  "use strict";
103359
103359
  KEYWORDS = /* @__PURE__ */ new Set([
103360
103360
  "const",
@@ -104193,7 +104193,7 @@ var init_tokenizer2 = __esm({
104193
104193
  }
104194
104194
  });
104195
104195
 
104196
- // packages/agent-script/src/parse/assign-ids.ts
104196
+ // packages/safejs/src/parse/assign-ids.ts
104197
104197
  function assignIds(root) {
104198
104198
  const visited = /* @__PURE__ */ new Set();
104199
104199
  const children2 = [];
@@ -104294,12 +104294,12 @@ function isAstNode(value) {
104294
104294
  return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string" && "span" in value && typeof value.span?.start.offset === "number" && typeof value.span?.end.offset === "number";
104295
104295
  }
104296
104296
  var init_assign_ids = __esm({
104297
- "packages/agent-script/src/parse/assign-ids.ts"() {
104297
+ "packages/safejs/src/parse/assign-ids.ts"() {
104298
104298
  "use strict";
104299
104299
  }
104300
104300
  });
104301
104301
 
104302
- // packages/agent-script/src/error/shape.ts
104302
+ // packages/safejs/src/error/shape.ts
104303
104303
  function formatErrorStack(name, message2, stackFrames = []) {
104304
104304
  const header = message2.length === 0 ? name : `${name}: ${message2}`;
104305
104305
  return [header, ...stackFrames].join("\n");
@@ -104427,13 +104427,13 @@ function findSourceOffset(source, line, column) {
104427
104427
  }
104428
104428
  var wrappedErrorCause;
104429
104429
  var init_shape = __esm({
104430
- "packages/agent-script/src/error/shape.ts"() {
104430
+ "packages/safejs/src/error/shape.ts"() {
104431
104431
  "use strict";
104432
104432
  wrappedErrorCause = /* @__PURE__ */ Symbol("wrappedErrorCause");
104433
104433
  }
104434
104434
  });
104435
104435
 
104436
- // packages/agent-script/src/parse/format-error.ts
104436
+ // packages/safejs/src/parse/format-error.ts
104437
104437
  function formatParseError(source, filename, error3) {
104438
104438
  const location = parseErrorLocation(error3.message);
104439
104439
  if (location === void 0) {
@@ -104591,7 +104591,7 @@ function findNumberEnd(value, startIndex) {
104591
104591
  }
104592
104592
  var ParseError, MAX_EXCERPT_CONTENT_LENGTH, ELLIPSIS2;
104593
104593
  var init_format_error = __esm({
104594
- "packages/agent-script/src/parse/format-error.ts"() {
104594
+ "packages/safejs/src/parse/format-error.ts"() {
104595
104595
  "use strict";
104596
104596
  init_shape();
104597
104597
  ParseError = class extends Error {
@@ -104619,7 +104619,7 @@ var init_format_error = __esm({
104619
104619
  }
104620
104620
  });
104621
104621
 
104622
- // packages/agent-script/src/parse/parse-export.ts
104622
+ // packages/safejs/src/parse/parse-export.ts
104623
104623
  function createExportNamedDeclaration(exportToken, declaration) {
104624
104624
  return {
104625
104625
  type: "ExportNamedDeclaration",
@@ -104641,12 +104641,12 @@ function createSpan(start, end) {
104641
104641
  };
104642
104642
  }
104643
104643
  var init_parse_export = __esm({
104644
- "packages/agent-script/src/parse/parse-export.ts"() {
104644
+ "packages/safejs/src/parse/parse-export.ts"() {
104645
104645
  "use strict";
104646
104646
  }
104647
104647
  });
104648
104648
 
104649
- // packages/agent-script/src/parse/parse-import-meta.ts
104649
+ // packages/safejs/src/parse/parse-import-meta.ts
104650
104650
  function isImportMetaTokenSequence(importToken, dotToken, metaToken) {
104651
104651
  return importToken.type === "keyword" && importToken.value === "import" && dotToken.type === "punctuator" && dotToken.value === "." && metaToken.type === "identifier" && metaToken.value === "meta" && importToken.end.offset === dotToken.start.offset && dotToken.end.offset === metaToken.start.offset;
104652
104652
  }
@@ -104672,12 +104672,12 @@ function createIdentifier(token, name) {
104672
104672
  };
104673
104673
  }
104674
104674
  var init_parse_import_meta = __esm({
104675
- "packages/agent-script/src/parse/parse-import-meta.ts"() {
104675
+ "packages/safejs/src/parse/parse-import-meta.ts"() {
104676
104676
  "use strict";
104677
104677
  }
104678
104678
  });
104679
104679
 
104680
- // packages/agent-script/src/interp/regex/parse.ts
104680
+ // packages/safejs/src/interp/regex/parse.ts
104681
104681
  function parseRegex(source, flags = "") {
104682
104682
  const parsedFlags = parseFlags(flags);
104683
104683
  const parser = new RegexParser(source);
@@ -104728,7 +104728,7 @@ function allHexDigits(value) {
104728
104728
  }
104729
104729
  var RegexParser;
104730
104730
  var init_parse5 = __esm({
104731
- "packages/agent-script/src/interp/regex/parse.ts"() {
104731
+ "packages/safejs/src/interp/regex/parse.ts"() {
104732
104732
  "use strict";
104733
104733
  RegexParser = class {
104734
104734
  constructor(source) {
@@ -105002,7 +105002,7 @@ var init_parse5 = __esm({
105002
105002
  }
105003
105003
  });
105004
105004
 
105005
- // packages/agent-script/src/parse/parser.ts
105005
+ // packages/safejs/src/parse/parser.ts
105006
105006
  function parse13(source, filename = "<input>") {
105007
105007
  try {
105008
105008
  const result = assignIds(parseTokens(tokenize3(source, { allowRegexLiterals: true })));
@@ -105372,9 +105372,7 @@ function createTemplateLiteral(token, options = { allowMalformedEscapes: false }
105372
105372
  continue;
105373
105373
  }
105374
105374
  if (char === "$" && raw[cursor2 + 1] === "{") {
105375
- quasis.push(
105376
- createTemplateElement(token.start, raw, quasiStart, cursor2, false, options)
105377
- );
105375
+ quasis.push(createTemplateElement(token.start, raw, quasiStart, cursor2, false, options));
105378
105376
  const expressionStart = cursor2 + 2;
105379
105377
  const expressionEnd = findTemplateExpressionEnd(raw, expressionStart);
105380
105378
  expressions.push(
@@ -105389,9 +105387,7 @@ function createTemplateLiteral(token, options = { allowMalformedEscapes: false }
105389
105387
  }
105390
105388
  cursor2 += 1;
105391
105389
  }
105392
- quasis.push(
105393
- createTemplateElement(token.start, raw, quasiStart, raw.length - 1, true, options)
105394
- );
105390
+ quasis.push(createTemplateElement(token.start, raw, quasiStart, raw.length - 1, true, options));
105395
105391
  return {
105396
105392
  type: "TemplateLiteral",
105397
105393
  expressions,
@@ -105453,7 +105449,9 @@ function createTemplateElement(templateStart, rawTemplate, rawStart, rawEnd, tai
105453
105449
  const cooked = decodeTemplateElementCooked(rawValue, options.allowMalformedEscapes);
105454
105450
  if (cooked.invalid !== void 0 && !options.allowMalformedEscapes) {
105455
105451
  const position = positionWithinRaw(templateStart, rawTemplate, rawStart + cooked.invalid.index);
105456
- throw new Error(`${cooked.invalid.message} at line ${position.line}, column ${position.column}.`);
105452
+ throw new Error(
105453
+ `${cooked.invalid.message} at line ${position.line}, column ${position.column}.`
105454
+ );
105457
105455
  }
105458
105456
  return {
105459
105457
  type: "TemplateElement",
@@ -105892,7 +105890,7 @@ function matchingOpeningPunctuator(value) {
105892
105890
  }
105893
105891
  var MAX_CONDITIONAL_EXPRESSION_DEPTH, MAX_IF_STATEMENT_DEPTH, DisallowedSyntaxError, EQUALITY_OPERATORS, RELATIONAL_OPERATORS, SHIFT_OPERATORS, ADDITIVE_OPERATORS, MULTIPLICATIVE_OPERATORS, BITWISE_OR_OPERATORS, BITWISE_XOR_OPERATORS, BITWISE_AND_OPERATORS, MAX_UNICODE_CODE_POINT2, TOP_LEVEL_STATEMENT_KEYWORDS, Parser;
105894
105892
  var init_parser3 = __esm({
105895
- "packages/agent-script/src/parse/parser.ts"() {
105893
+ "packages/safejs/src/parse/parser.ts"() {
105896
105894
  "use strict";
105897
105895
  init_tokenizer2();
105898
105896
  init_assign_ids();
@@ -108462,15 +108460,15 @@ var init_parser3 = __esm({
108462
108460
  }
108463
108461
  });
108464
108462
 
108465
- // packages/agent-script/src/parse.ts
108463
+ // packages/safejs/src/parse.ts
108466
108464
  var init_parse6 = __esm({
108467
- "packages/agent-script/src/parse.ts"() {
108465
+ "packages/safejs/src/parse.ts"() {
108468
108466
  "use strict";
108469
108467
  init_parser3();
108470
108468
  }
108471
108469
  });
108472
108470
 
108473
- // packages/agent-script/src/lint/rules/AS001.ts
108471
+ // packages/safejs/src/lint/rules/AS001.ts
108474
108472
  function AS001(source, options = {}) {
108475
108473
  return new AS001Scanner(source, options.filename ?? "<input>").scan();
108476
108474
  }
@@ -108647,7 +108645,7 @@ function isExpressionEndingPunctuator2(value) {
108647
108645
  }
108648
108646
  var KEYWORDS2, EXPRESSION_ENDING_KEYWORDS2, CONTROL_FLOW_PAREN_KEYWORDS2, PUNCTUATORS2, AS001Scanner;
108649
108647
  var init_AS001 = __esm({
108650
- "packages/agent-script/src/lint/rules/AS001.ts"() {
108648
+ "packages/safejs/src/lint/rules/AS001.ts"() {
108651
108649
  "use strict";
108652
108650
  KEYWORDS2 = /* @__PURE__ */ new Set([
108653
108651
  "async",
@@ -109180,13 +109178,13 @@ var init_AS001 = __esm({
109180
109178
  }
109181
109179
  });
109182
109180
 
109183
- // packages/agent-script/src/lint/rules/AS002.ts
109181
+ // packages/safejs/src/lint/rules/AS002.ts
109184
109182
  function AS002(source, options = {}) {
109185
109183
  return new AS002Scanner(options.filename ?? "<input>").scan(source);
109186
109184
  }
109187
109185
  var AS002Scanner;
109188
109186
  var init_AS002 = __esm({
109189
- "packages/agent-script/src/lint/rules/AS002.ts"() {
109187
+ "packages/safejs/src/lint/rules/AS002.ts"() {
109190
109188
  "use strict";
109191
109189
  init_parser3();
109192
109190
  AS002Scanner = class {
@@ -109708,10 +109706,10 @@ var init_AS002 = __esm({
109708
109706
  }
109709
109707
  });
109710
109708
 
109711
- // packages/agent-script/src/lint/rules/known-globals.ts
109709
+ // packages/safejs/src/lint/rules/known-globals.ts
109712
109710
  var KNOWN_RUNTIME_GLOBALS;
109713
109711
  var init_known_globals = __esm({
109714
- "packages/agent-script/src/lint/rules/known-globals.ts"() {
109712
+ "packages/safejs/src/lint/rules/known-globals.ts"() {
109715
109713
  "use strict";
109716
109714
  KNOWN_RUNTIME_GLOBALS = [
109717
109715
  "AggregateError",
@@ -109741,7 +109739,7 @@ var init_known_globals = __esm({
109741
109739
  }
109742
109740
  });
109743
109741
 
109744
- // packages/agent-script/src/lint/rules/AS003.ts
109742
+ // packages/safejs/src/lint/rules/AS003.ts
109745
109743
  function AS003(source, options = {}) {
109746
109744
  return new AS003Scanner(
109747
109745
  options.filename ?? "<input>",
@@ -109781,7 +109779,7 @@ function getLevenshteinDistance2(left, right) {
109781
109779
  }
109782
109780
  var AS003Scanner;
109783
109781
  var init_AS003 = __esm({
109784
- "packages/agent-script/src/lint/rules/AS003.ts"() {
109782
+ "packages/safejs/src/lint/rules/AS003.ts"() {
109785
109783
  "use strict";
109786
109784
  init_parser3();
109787
109785
  init_known_globals();
@@ -110300,7 +110298,7 @@ var init_AS003 = __esm({
110300
110298
  }
110301
110299
  });
110302
110300
 
110303
- // packages/agent-script/src/lint/rules/module-registry.ts
110301
+ // packages/safejs/src/lint/rules/module-registry.ts
110304
110302
  function collectImportDeclarations(source, filename) {
110305
110303
  const module = parseModule(source, filename);
110306
110304
  return module.body.flatMap(
@@ -110338,7 +110336,7 @@ function normalizeModuleRegistrations(modules) {
110338
110336
  }
110339
110337
  return normalized;
110340
110338
  }
110341
- function collectAgentScriptSourceModules(modules) {
110339
+ function collectSafeJSSourceModules(modules) {
110342
110340
  return new Map(
110343
110341
  [...normalizeModuleRegistrations(modules).entries()].flatMap(
110344
110342
  ([moduleName, registration]) => registration.filename !== void 0 && registration.source !== void 0 ? [
@@ -110404,13 +110402,13 @@ function normalizeAsyncExports(exports) {
110404
110402
  );
110405
110403
  }
110406
110404
  var init_module_registry = __esm({
110407
- "packages/agent-script/src/lint/rules/module-registry.ts"() {
110405
+ "packages/safejs/src/lint/rules/module-registry.ts"() {
110408
110406
  "use strict";
110409
110407
  init_parser3();
110410
110408
  }
110411
110409
  });
110412
110410
 
110413
- // packages/agent-script/src/lint/rules/AS004.ts
110411
+ // packages/safejs/src/lint/rules/AS004.ts
110414
110412
  function AS004(source, options = {}) {
110415
110413
  const filename = options.filename ?? "<input>";
110416
110414
  const modules = normalizeModules(options.modules);
@@ -110433,13 +110431,13 @@ function AS004(source, options = {}) {
110433
110431
  });
110434
110432
  }
110435
110433
  var init_AS004 = __esm({
110436
- "packages/agent-script/src/lint/rules/AS004.ts"() {
110434
+ "packages/safejs/src/lint/rules/AS004.ts"() {
110437
110435
  "use strict";
110438
110436
  init_module_registry();
110439
110437
  }
110440
110438
  });
110441
110439
 
110442
- // packages/agent-script/src/lint/rules/AS005.ts
110440
+ // packages/safejs/src/lint/rules/AS005.ts
110443
110441
  function AS005(source, options = {}) {
110444
110442
  const filename = options.filename ?? "<input>";
110445
110443
  const modules = normalizeModules(options.modules);
@@ -110461,7 +110459,11 @@ function AS005(source, options = {}) {
110461
110459
  {
110462
110460
  code: "AS005",
110463
110461
  severity: "error",
110464
- message: createUnknownExportMessage(declaration.source.value, importName, availableExports),
110462
+ message: createUnknownExportMessage(
110463
+ declaration.source.value,
110464
+ importName,
110465
+ availableExports
110466
+ ),
110465
110467
  filename,
110466
110468
  line: span.start.line,
110467
110469
  column: span.start.column,
@@ -110472,19 +110474,19 @@ function AS005(source, options = {}) {
110472
110474
  });
110473
110475
  }
110474
110476
  var init_AS005 = __esm({
110475
- "packages/agent-script/src/lint/rules/AS005.ts"() {
110477
+ "packages/safejs/src/lint/rules/AS005.ts"() {
110476
110478
  "use strict";
110477
110479
  init_module_registry();
110478
110480
  }
110479
110481
  });
110480
110482
 
110481
- // packages/agent-script/src/lint/rules/AS006-007.ts
110483
+ // packages/safejs/src/lint/rules/AS006-007.ts
110482
110484
  function AS006_007(source, options = {}) {
110483
110485
  return new AS006007Scanner(options.filename ?? "<input>").scan(source);
110484
110486
  }
110485
110487
  var AS006007Scanner;
110486
110488
  var init_AS006_007 = __esm({
110487
- "packages/agent-script/src/lint/rules/AS006-007.ts"() {
110489
+ "packages/safejs/src/lint/rules/AS006-007.ts"() {
110488
110490
  "use strict";
110489
110491
  init_parser3();
110490
110492
  AS006007Scanner = class {
@@ -111083,13 +111085,13 @@ var init_AS006_007 = __esm({
111083
111085
  }
111084
111086
  });
111085
111087
 
111086
- // packages/agent-script/src/lint/rules/AS008.ts
111088
+ // packages/safejs/src/lint/rules/AS008.ts
111087
111089
  function AS008(source, options = {}) {
111088
111090
  return new AS008Scanner(options.filename ?? "<input>").scan(source);
111089
111091
  }
111090
111092
  var MESSAGE, AS008Scanner;
111091
111093
  var init_AS008 = __esm({
111092
- "packages/agent-script/src/lint/rules/AS008.ts"() {
111094
+ "packages/safejs/src/lint/rules/AS008.ts"() {
111093
111095
  "use strict";
111094
111096
  init_parser3();
111095
111097
  MESSAGE = "Await is only allowed at the script top level or inside async arrow functions.";
@@ -111464,13 +111466,13 @@ var init_AS008 = __esm({
111464
111466
  }
111465
111467
  });
111466
111468
 
111467
- // packages/agent-script/src/lint/rules/AS009.ts
111469
+ // packages/safejs/src/lint/rules/AS009.ts
111468
111470
  function AS009(source, options = {}) {
111469
111471
  return new AS009Scanner(options.filename ?? "<input>").scan(source);
111470
111472
  }
111471
111473
  var MESSAGE2, AS009Scanner;
111472
111474
  var init_AS009 = __esm({
111473
- "packages/agent-script/src/lint/rules/AS009.ts"() {
111475
+ "packages/safejs/src/lint/rules/AS009.ts"() {
111474
111476
  "use strict";
111475
111477
  init_parser3();
111476
111478
  MESSAGE2 = "Async arrow returns a host call without awaiting it. Add 'await' or document that this function intentionally returns a Promise.";
@@ -111942,13 +111944,13 @@ var init_AS009 = __esm({
111942
111944
  }
111943
111945
  });
111944
111946
 
111945
- // packages/agent-script/src/lint/rules/AS010.ts
111947
+ // packages/safejs/src/lint/rules/AS010.ts
111946
111948
  function AS010(source, options = {}) {
111947
111949
  return new AS010Scanner(options.filename ?? "<input>").scan(source);
111948
111950
  }
111949
111951
  var AS010Scanner;
111950
111952
  var init_AS010 = __esm({
111951
- "packages/agent-script/src/lint/rules/AS010.ts"() {
111953
+ "packages/safejs/src/lint/rules/AS010.ts"() {
111952
111954
  "use strict";
111953
111955
  init_parser3();
111954
111956
  AS010Scanner = class {
@@ -112597,13 +112599,13 @@ var init_AS010 = __esm({
112597
112599
  }
112598
112600
  });
112599
112601
 
112600
- // packages/agent-script/src/lint/rules/AS011.ts
112602
+ // packages/safejs/src/lint/rules/AS011.ts
112601
112603
  function AS011(source, options = {}) {
112602
112604
  return new AS011Scanner(options.filename ?? "<input>").scan(source);
112603
112605
  }
112604
112606
  var FORBIDDEN_PROPERTY_NAMES, MESSAGE3, AS011Scanner;
112605
112607
  var init_AS011 = __esm({
112606
- "packages/agent-script/src/lint/rules/AS011.ts"() {
112608
+ "packages/safejs/src/lint/rules/AS011.ts"() {
112607
112609
  "use strict";
112608
112610
  init_parser3();
112609
112611
  FORBIDDEN_PROPERTY_NAMES = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
@@ -112931,7 +112933,7 @@ var init_AS011 = __esm({
112931
112933
  }
112932
112934
  });
112933
112935
 
112934
- // packages/agent-script/src/lint/rules/AS012.ts
112936
+ // packages/safejs/src/lint/rules/AS012.ts
112935
112937
  function AS012(source, options = {}) {
112936
112938
  return new AS012Scanner(options.filename ?? "<input>").scan(source);
112937
112939
  }
@@ -112979,7 +112981,7 @@ function isLocaleCompareCall(node) {
112979
112981
  }
112980
112982
  var SORT_MESSAGE, NUMBER_RETURNING_BINARY_OPERATORS, AS012Scanner;
112981
112983
  var init_AS012 = __esm({
112982
- "packages/agent-script/src/lint/rules/AS012.ts"() {
112984
+ "packages/safejs/src/lint/rules/AS012.ts"() {
112983
112985
  "use strict";
112984
112986
  init_parser3();
112985
112987
  SORT_MESSAGE = "Array#sort only supports comparators that are arrows returning a number.";
@@ -113320,7 +113322,7 @@ var init_AS012 = __esm({
113320
113322
  }
113321
113323
  });
113322
113324
 
113323
- // packages/agent-script/src/lint/rules/AS013.ts
113325
+ // packages/safejs/src/lint/rules/AS013.ts
113324
113326
  function AS013(source, options = {}) {
113325
113327
  const filename = options.filename ?? "<input>";
113326
113328
  const reservedNames = new Set(normalizeModules(options.modules).keys());
@@ -113371,7 +113373,13 @@ function collectPatternDiagnostics(pattern, reservedNames, diagnostics, filename
113371
113373
  collectPatternDiagnostics(pattern.left, reservedNames, diagnostics, filename, allowedNames);
113372
113374
  return;
113373
113375
  case "RestElement":
113374
- collectPatternDiagnostics(pattern.argument, reservedNames, diagnostics, filename, allowedNames);
113376
+ collectPatternDiagnostics(
113377
+ pattern.argument,
113378
+ reservedNames,
113379
+ diagnostics,
113380
+ filename,
113381
+ allowedNames
113382
+ );
113375
113383
  return;
113376
113384
  case "ArrayPattern":
113377
113385
  for (const element of pattern.elements) {
@@ -113396,14 +113404,14 @@ function collectPatternDiagnostics(pattern, reservedNames, diagnostics, filename
113396
113404
  }
113397
113405
  }
113398
113406
  var init_AS013 = __esm({
113399
- "packages/agent-script/src/lint/rules/AS013.ts"() {
113407
+ "packages/safejs/src/lint/rules/AS013.ts"() {
113400
113408
  "use strict";
113401
113409
  init_parser3();
113402
113410
  init_module_registry();
113403
113411
  }
113404
113412
  });
113405
113413
 
113406
- // packages/agent-script/src/lint/rules/AS015.ts
113414
+ // packages/safejs/src/lint/rules/AS015.ts
113407
113415
  function AS015(source, options = {}) {
113408
113416
  return new AS015Scanner(options.filename ?? "<input>").scan(source);
113409
113417
  }
@@ -113422,7 +113430,7 @@ function isPromiseRace(node) {
113422
113430
  }
113423
113431
  var AS015Scanner;
113424
113432
  var init_AS015 = __esm({
113425
- "packages/agent-script/src/lint/rules/AS015.ts"() {
113433
+ "packages/safejs/src/lint/rules/AS015.ts"() {
113426
113434
  "use strict";
113427
113435
  init_parser3();
113428
113436
  AS015Scanner = class {
@@ -113718,7 +113726,7 @@ var init_AS015 = __esm({
113718
113726
  }
113719
113727
  });
113720
113728
 
113721
- // packages/agent-script/src/lint/rules/AS-async-not-needed.ts
113729
+ // packages/safejs/src/lint/rules/AS-async-not-needed.ts
113722
113730
  function AS_ASYNC_NOT_NEEDED(source, options = {}) {
113723
113731
  return new ASAsyncNotNeededScanner(source, options.filename ?? "<input>").scan();
113724
113732
  }
@@ -113897,7 +113905,7 @@ function patternTargetContainsAwait(node) {
113897
113905
  }
113898
113906
  var AS_ASYNC_NOT_NEEDED_MESSAGE, ASAsyncNotNeededScanner;
113899
113907
  var init_AS_async_not_needed = __esm({
113900
- "packages/agent-script/src/lint/rules/AS-async-not-needed.ts"() {
113908
+ "packages/safejs/src/lint/rules/AS-async-not-needed.ts"() {
113901
113909
  "use strict";
113902
113910
  init_parser3();
113903
113911
  AS_ASYNC_NOT_NEEDED_MESSAGE = "Async arrow functions without await should remove the async keyword.";
@@ -114260,7 +114268,7 @@ var init_AS_async_not_needed = __esm({
114260
114268
  }
114261
114269
  });
114262
114270
 
114263
- // packages/agent-script/src/lint/rules/AS-await-non-promise.ts
114271
+ // packages/safejs/src/lint/rules/AS-await-non-promise.ts
114264
114272
  function AS_AWAIT_NON_PROMISE(source, options = {}) {
114265
114273
  return new ASAwaitNonPromiseScanner(options.filename ?? "<input>").scan(source);
114266
114274
  }
@@ -114283,7 +114291,7 @@ function isKnownNonPromiseExpression(node) {
114283
114291
  }
114284
114292
  var ASAwaitNonPromiseScanner;
114285
114293
  var init_AS_await_non_promise = __esm({
114286
- "packages/agent-script/src/lint/rules/AS-await-non-promise.ts"() {
114294
+ "packages/safejs/src/lint/rules/AS-await-non-promise.ts"() {
114287
114295
  "use strict";
114288
114296
  init_parser3();
114289
114297
  ASAwaitNonPromiseScanner = class {
@@ -114558,7 +114566,7 @@ var init_AS_await_non_promise = __esm({
114558
114566
  }
114559
114567
  });
114560
114568
 
114561
- // packages/agent-script/src/lint/rules/AS-destructure-null-default.ts
114569
+ // packages/safejs/src/lint/rules/AS-destructure-null-default.ts
114562
114570
  function AS_DESTRUCTURE_NULL_DEFAULT(source, options = {}) {
114563
114571
  return new ASDestructureNullDefaultScanner(options.filename ?? "<input>").scan(source);
114564
114572
  }
@@ -114603,7 +114611,7 @@ function getStaticPropertyKey(key2) {
114603
114611
  }
114604
114612
  var MESSAGE4, HINT, ASDestructureNullDefaultScanner;
114605
114613
  var init_AS_destructure_null_default = __esm({
114606
- "packages/agent-script/src/lint/rules/AS-destructure-null-default.ts"() {
114614
+ "packages/safejs/src/lint/rules/AS-destructure-null-default.ts"() {
114607
114615
  "use strict";
114608
114616
  init_parser3();
114609
114617
  MESSAGE4 = "Destructuring default values only apply to undefined, not null.";
@@ -115001,7 +115009,7 @@ var init_AS_destructure_null_default = __esm({
115001
115009
  }
115002
115010
  });
115003
115011
 
115004
- // packages/agent-script/src/lint/rules/AS-export-import-meta.ts
115012
+ // packages/safejs/src/lint/rules/AS-export-import-meta.ts
115005
115013
  function AS_EXPORT_IMPORT_META(source, options = {}) {
115006
115014
  return new Scanner(
115007
115015
  options.filename ?? "<input>",
@@ -115050,7 +115058,7 @@ function isImportMetaAssignmentTarget2(node) {
115050
115058
  }
115051
115059
  var Scanner;
115052
115060
  var init_AS_export_import_meta = __esm({
115053
- "packages/agent-script/src/lint/rules/AS-export-import-meta.ts"() {
115061
+ "packages/safejs/src/lint/rules/AS-export-import-meta.ts"() {
115054
115062
  "use strict";
115055
115063
  init_parser3();
115056
115064
  Scanner = class {
@@ -115424,13 +115432,13 @@ var init_AS_export_import_meta = __esm({
115424
115432
  }
115425
115433
  });
115426
115434
 
115427
- // packages/agent-script/src/lint/rules/AS-floating-promise.ts
115435
+ // packages/safejs/src/lint/rules/AS-floating-promise.ts
115428
115436
  function AS_FLOATING_PROMISE(source, options = {}) {
115429
115437
  return new ASFloatingPromiseScanner(options.filename ?? "<input>", options.modules).scan(source);
115430
115438
  }
115431
115439
  var AS_FLOATING_PROMISE_MESSAGE, PROMISE_CONSUMERS, PROMISE_FACTORIES, PROMISE_CHAIN_METHODS, ASFloatingPromiseScanner;
115432
115440
  var init_AS_floating_promise = __esm({
115433
- "packages/agent-script/src/lint/rules/AS-floating-promise.ts"() {
115441
+ "packages/safejs/src/lint/rules/AS-floating-promise.ts"() {
115434
115442
  "use strict";
115435
115443
  init_parser3();
115436
115444
  init_module_registry();
@@ -116013,7 +116021,7 @@ var init_AS_floating_promise = __esm({
116013
116021
  }
116014
116022
  });
116015
116023
 
116016
- // packages/agent-script/src/lint/rules/AS-frontmatter-field-unused.ts
116024
+ // packages/safejs/src/lint/rules/AS-frontmatter-field-unused.ts
116017
116025
  function AS_FRONTMATTER_FIELD_UNUSED(source, options = {}) {
116018
116026
  if (options.frontmatterFields === void 0) {
116019
116027
  return [];
@@ -116043,7 +116051,7 @@ function readPropertyKey(node) {
116043
116051
  }
116044
116052
  var ASFrontmatterFieldUnusedScanner;
116045
116053
  var init_AS_frontmatter_field_unused = __esm({
116046
- "packages/agent-script/src/lint/rules/AS-frontmatter-field-unused.ts"() {
116054
+ "packages/safejs/src/lint/rules/AS-frontmatter-field-unused.ts"() {
116047
116055
  "use strict";
116048
116056
  init_parser3();
116049
116057
  ASFrontmatterFieldUnusedScanner = class {
@@ -116436,10 +116444,10 @@ var init_AS_frontmatter_field_unused = __esm({
116436
116444
  }
116437
116445
  });
116438
116446
 
116439
- // packages/agent-script/src/lint/rules/AS-import-cycle.ts
116447
+ // packages/safejs/src/lint/rules/AS-import-cycle.ts
116440
116448
  function AS_IMPORT_CYCLE(source, options = {}) {
116441
116449
  const filename = options.filename ?? "<input>";
116442
- const sourceModules = collectAgentScriptSourceModules(options.modules);
116450
+ const sourceModules = collectSafeJSSourceModules(options.modules);
116443
116451
  if (sourceModules.size === 0) {
116444
116452
  return [];
116445
116453
  }
@@ -116465,7 +116473,12 @@ function AS_IMPORT_CYCLE(source, options = {}) {
116465
116473
  );
116466
116474
  }
116467
116475
  return importEdges.flatMap((edge) => {
116468
- const cyclePath = findPathToModule(edge.targetModuleName, edge.moduleName, dependencyGraph, /* @__PURE__ */ new Set());
116476
+ const cyclePath = findPathToModule(
116477
+ edge.targetModuleName,
116478
+ edge.moduleName,
116479
+ dependencyGraph,
116480
+ /* @__PURE__ */ new Set()
116481
+ );
116469
116482
  return cyclePath === void 0 ? [] : [
116470
116483
  createDiagnostic(
116471
116484
  edge.declaration.source.span,
@@ -116515,7 +116528,7 @@ function findPathToModule(currentModuleName, targetModuleName, dependencyGraph,
116515
116528
  return void 0;
116516
116529
  }
116517
116530
  var init_AS_import_cycle = __esm({
116518
- "packages/agent-script/src/lint/rules/AS-import-cycle.ts"() {
116531
+ "packages/safejs/src/lint/rules/AS-import-cycle.ts"() {
116519
116532
  "use strict";
116520
116533
  init_format_error();
116521
116534
  init_parser3();
@@ -116523,7 +116536,7 @@ var init_AS_import_cycle = __esm({
116523
116536
  }
116524
116537
  });
116525
116538
 
116526
- // packages/agent-script/src/lint/rules/AS-jsdoc-type.ts
116539
+ // packages/safejs/src/lint/rules/AS-jsdoc-type.ts
116527
116540
  function AS_JSDOC_TYPE(source, options = {}) {
116528
116541
  if (!hasTypedModuleRegistrations(options.modules)) {
116529
116542
  return [];
@@ -116870,7 +116883,7 @@ function positionAt(source, offset) {
116870
116883
  }
116871
116884
  var ASJsdocTypeScanner;
116872
116885
  var init_AS_jsdoc_type = __esm({
116873
- "packages/agent-script/src/lint/rules/AS-jsdoc-type.ts"() {
116886
+ "packages/safejs/src/lint/rules/AS-jsdoc-type.ts"() {
116874
116887
  "use strict";
116875
116888
  init_parser3();
116876
116889
  init_module_registry();
@@ -117258,7 +117271,7 @@ var init_AS_jsdoc_type = __esm({
117258
117271
  }
117259
117272
  });
117260
117273
 
117261
- // packages/agent-script/src/lint/rules/AS-large-literal.ts
117274
+ // packages/safejs/src/lint/rules/AS-large-literal.ts
117262
117275
  function AS_LARGE_LITERAL(source, options = {}) {
117263
117276
  return new ASLargeLiteralScanner(
117264
117277
  options.filename ?? "<input>",
@@ -117273,7 +117286,7 @@ function createObjectMessage(count, threshold) {
117273
117286
  }
117274
117287
  var DEFAULT_LARGE_LITERAL_THRESHOLD, ASLargeLiteralScanner;
117275
117288
  var init_AS_large_literal = __esm({
117276
- "packages/agent-script/src/lint/rules/AS-large-literal.ts"() {
117289
+ "packages/safejs/src/lint/rules/AS-large-literal.ts"() {
117277
117290
  "use strict";
117278
117291
  init_parser3();
117279
117292
  DEFAULT_LARGE_LITERAL_THRESHOLD = 1e3;
@@ -117620,7 +117633,7 @@ var init_AS_large_literal = __esm({
117620
117633
  }
117621
117634
  });
117622
117635
 
117623
- // packages/agent-script/src/lint/rules/AS-missing-async.ts
117636
+ // packages/safejs/src/lint/rules/AS-missing-async.ts
117624
117637
  function AS_MISSING_ASYNC(source, options = {}) {
117625
117638
  return new ASMissingAsyncScanner(options.filename ?? "<input>").scan(source);
117626
117639
  }
@@ -117789,7 +117802,7 @@ function patternTargetContainsAwait2(node) {
117789
117802
  }
117790
117803
  var AS_MISSING_ASYNC_MESSAGE, ASMissingAsyncScanner;
117791
117804
  var init_AS_missing_async = __esm({
117792
- "packages/agent-script/src/lint/rules/AS-missing-async.ts"() {
117805
+ "packages/safejs/src/lint/rules/AS-missing-async.ts"() {
117793
117806
  "use strict";
117794
117807
  init_parser3();
117795
117808
  AS_MISSING_ASYNC_MESSAGE = "Arrow functions that contain await must be marked async.";
@@ -118143,7 +118156,7 @@ var init_AS_missing_async = __esm({
118143
118156
  }
118144
118157
  });
118145
118158
 
118146
- // packages/agent-script/src/lint/rules/AS-mutating-frozen.ts
118159
+ // packages/safejs/src/lint/rules/AS-mutating-frozen.ts
118147
118160
  function AS_MUTATING_FROZEN(source, options = {}) {
118148
118161
  return new ASMutatingFrozenScanner(options.filename ?? "<input>").scan(source);
118149
118162
  }
@@ -118182,7 +118195,7 @@ function isImmutableArrayFactoryCall(node, isBound) {
118182
118195
  }
118183
118196
  var MUTATING_ARRAY_METHODS, ASMutatingFrozenScanner;
118184
118197
  var init_AS_mutating_frozen = __esm({
118185
- "packages/agent-script/src/lint/rules/AS-mutating-frozen.ts"() {
118198
+ "packages/safejs/src/lint/rules/AS-mutating-frozen.ts"() {
118186
118199
  "use strict";
118187
118200
  init_parser3();
118188
118201
  MUTATING_ARRAY_METHODS = /* @__PURE__ */ new Set([
@@ -118661,7 +118674,7 @@ var init_AS_mutating_frozen = __esm({
118661
118674
  }
118662
118675
  });
118663
118676
 
118664
- // packages/agent-script/src/lint/rules/AS-needless-template.ts
118677
+ // packages/safejs/src/lint/rules/AS-needless-template.ts
118665
118678
  function AS_NEEDLESS_TEMPLATE(source, options = {}) {
118666
118679
  return new ASNeedlessTemplateScanner(source, options.filename ?? "<input>").scan();
118667
118680
  }
@@ -118682,7 +118695,7 @@ function isNeedlessTemplate(node) {
118682
118695
  }
118683
118696
  var AS_NEEDLESS_TEMPLATE_MESSAGE, ASNeedlessTemplateScanner;
118684
118697
  var init_AS_needless_template = __esm({
118685
- "packages/agent-script/src/lint/rules/AS-needless-template.ts"() {
118698
+ "packages/safejs/src/lint/rules/AS-needless-template.ts"() {
118686
118699
  "use strict";
118687
118700
  init_parser3();
118688
118701
  AS_NEEDLESS_TEMPLATE_MESSAGE = "Template literals with only one interpolation should use the value or String(value).";
@@ -119043,7 +119056,7 @@ var init_AS_needless_template = __esm({
119043
119056
  }
119044
119057
  });
119045
119058
 
119046
- // packages/agent-script/src/lint/rules/AS-shadow-global.ts
119059
+ // packages/safejs/src/lint/rules/AS-shadow-global.ts
119047
119060
  function AS_SHADOW_GLOBAL(source, options = {}) {
119048
119061
  return new ASShadowGlobalScanner(
119049
119062
  options.filename ?? "<input>",
@@ -119052,7 +119065,7 @@ function AS_SHADOW_GLOBAL(source, options = {}) {
119052
119065
  }
119053
119066
  var ASShadowGlobalScanner;
119054
119067
  var init_AS_shadow_global = __esm({
119055
- "packages/agent-script/src/lint/rules/AS-shadow-global.ts"() {
119068
+ "packages/safejs/src/lint/rules/AS-shadow-global.ts"() {
119056
119069
  "use strict";
119057
119070
  init_parser3();
119058
119071
  init_known_globals();
@@ -119443,7 +119456,7 @@ var init_AS_shadow_global = __esm({
119443
119456
  }
119444
119457
  });
119445
119458
 
119446
- // packages/agent-script/src/lint/rules/AS-unbounded-loop.ts
119459
+ // packages/safejs/src/lint/rules/AS-unbounded-loop.ts
119447
119460
  function AS_UNBOUNDED_LOOP(source, options = {}) {
119448
119461
  return new ASUnboundedLoopScanner(options.filename ?? "<input>").scan(source);
119449
119462
  }
@@ -119501,7 +119514,7 @@ function bodyHasExit(node, exitingLabels, allowUnlabeledBreak) {
119501
119514
  }
119502
119515
  var MESSAGE5, ASUnboundedLoopScanner;
119503
119516
  var init_AS_unbounded_loop = __esm({
119504
- "packages/agent-script/src/lint/rules/AS-unbounded-loop.ts"() {
119517
+ "packages/safejs/src/lint/rules/AS-unbounded-loop.ts"() {
119505
119518
  "use strict";
119506
119519
  init_parser3();
119507
119520
  MESSAGE5 = "Unbounded loop or generator source has no static exit with break, return, or throw.";
@@ -119804,7 +119817,7 @@ var init_AS_unbounded_loop = __esm({
119804
119817
  }
119805
119818
  });
119806
119819
 
119807
- // packages/agent-script/src/lint/rules/AS-unreachable.ts
119820
+ // packages/safejs/src/lint/rules/AS-unreachable.ts
119808
119821
  function AS_UNREACHABLE(source, options = {}) {
119809
119822
  return new ASUnreachableScanner(options.filename ?? "<input>").scan(source);
119810
119823
  }
@@ -119813,7 +119826,7 @@ function isEmptyBlockStatement(statement) {
119813
119826
  }
119814
119827
  var ASUnreachableScanner;
119815
119828
  var init_AS_unreachable = __esm({
119816
- "packages/agent-script/src/lint/rules/AS-unreachable.ts"() {
119829
+ "packages/safejs/src/lint/rules/AS-unreachable.ts"() {
119817
119830
  "use strict";
119818
119831
  init_parser3();
119819
119832
  ASUnreachableScanner = class {
@@ -120102,7 +120115,7 @@ var init_AS_unreachable = __esm({
120102
120115
  }
120103
120116
  });
120104
120117
 
120105
- // packages/agent-script/src/lint/rules/AS-unused-import.ts
120118
+ // packages/safejs/src/lint/rules/AS-unused-import.ts
120106
120119
  function AS_UNUSED_IMPORT(source, options = {}) {
120107
120120
  const filename = options.filename ?? "<input>";
120108
120121
  const unusedImports = collectUnusedImports(source, filename);
@@ -120207,7 +120220,7 @@ function skipInlineWhitespace(source, offset) {
120207
120220
  }
120208
120221
  var ASUnusedImportScanner;
120209
120222
  var init_AS_unused_import = __esm({
120210
- "packages/agent-script/src/lint/rules/AS-unused-import.ts"() {
120223
+ "packages/safejs/src/lint/rules/AS-unused-import.ts"() {
120211
120224
  "use strict";
120212
120225
  init_parser3();
120213
120226
  ASUnusedImportScanner = class {
@@ -120693,7 +120706,7 @@ var init_AS_unused_import = __esm({
120693
120706
  }
120694
120707
  });
120695
120708
 
120696
- // packages/agent-script/src/lint/index.ts
120709
+ // packages/safejs/src/lint/index.ts
120697
120710
  function lint(source, options = {}) {
120698
120711
  const diagnostics = collectDiagnostics(source, options);
120699
120712
  if (!options.fix) {
@@ -121022,7 +121035,7 @@ function hasOnlyRegexLiteralDiagnostics(diagnostics) {
121022
121035
  }
121023
121036
  var RULES, KNOWN_DIAGNOSTIC_CODES;
121024
121037
  var init_lint3 = __esm({
121025
- "packages/agent-script/src/lint/index.ts"() {
121038
+ "packages/safejs/src/lint/index.ts"() {
121026
121039
  "use strict";
121027
121040
  init_AS001();
121028
121041
  init_AS002();
@@ -121129,15 +121142,15 @@ var init_lint3 = __esm({
121129
121142
  }
121130
121143
  });
121131
121144
 
121132
- // packages/agent-script/src/lint.ts
121145
+ // packages/safejs/src/lint.ts
121133
121146
  var init_lint4 = __esm({
121134
- "packages/agent-script/src/lint.ts"() {
121147
+ "packages/safejs/src/lint.ts"() {
121135
121148
  "use strict";
121136
121149
  init_lint3();
121137
121150
  }
121138
121151
  });
121139
121152
 
121140
- // packages/agent-script/src/parse/hash.ts
121153
+ // packages/safejs/src/parse/hash.ts
121141
121154
  function hashSource(source) {
121142
121155
  try {
121143
121156
  return hashParsedAst(parse13(source));
@@ -121221,7 +121234,7 @@ function shouldIncludeTemplateRaw(record, key2, includeTemplateRaw) {
121221
121234
  }
121222
121235
  var FNV_OFFSET_BASIS, FNV_PRIME, IGNORED_KEYS;
121223
121236
  var init_hash = __esm({
121224
- "packages/agent-script/src/parse/hash.ts"() {
121237
+ "packages/safejs/src/parse/hash.ts"() {
121225
121238
  "use strict";
121226
121239
  init_parser3();
121227
121240
  FNV_OFFSET_BASIS = 2166136261;
@@ -121230,7 +121243,7 @@ var init_hash = __esm({
121230
121243
  }
121231
121244
  });
121232
121245
 
121233
- // packages/agent-script/src/interp/budget.ts
121246
+ // packages/safejs/src/interp/budget.ts
121234
121247
  function allocateRegexSteps(steps) {
121235
121248
  if (!Number.isInteger(steps) || steps < 0) {
121236
121249
  throw new Error("steps must be a non-negative integer.");
@@ -121256,7 +121269,7 @@ function normalizeLimit(name, value) {
121256
121269
  }
121257
121270
  var REGEX_STEP_LIMIT, DEADLINE_CHECK_INTERVAL, SandboxError, Budget;
121258
121271
  var init_budget2 = __esm({
121259
- "packages/agent-script/src/interp/budget.ts"() {
121272
+ "packages/safejs/src/interp/budget.ts"() {
121260
121273
  "use strict";
121261
121274
  init_shape();
121262
121275
  REGEX_STEP_LIMIT = 2e3;
@@ -121456,7 +121469,7 @@ var init_budget2 = __esm({
121456
121469
  }
121457
121470
  });
121458
121471
 
121459
- // packages/agent-script/src/graph-depth.ts
121472
+ // packages/safejs/src/graph-depth.ts
121460
121473
  function assertSandboxDataDepth(depth) {
121461
121474
  if (depth > MAX_DATA_DEPTH) {
121462
121475
  throw new SandboxError({ budget: "dataDepth", current: depth, limit: MAX_DATA_DEPTH });
@@ -121518,7 +121531,7 @@ function graphEntries(value) {
121518
121531
  }
121519
121532
  var MAX_DATA_DEPTH, SnapshotBudgetError;
121520
121533
  var init_graph_depth = __esm({
121521
- "packages/agent-script/src/graph-depth.ts"() {
121534
+ "packages/safejs/src/graph-depth.ts"() {
121522
121535
  "use strict";
121523
121536
  init_shape();
121524
121537
  init_budget2();
@@ -121541,8 +121554,8 @@ var init_graph_depth = __esm({
121541
121554
  }
121542
121555
  });
121543
121556
 
121544
- // packages/agent-script/src/snapshot/dump-format.ts
121545
- function serializeAgentScriptSnapshot(snapshot2) {
121557
+ // packages/safejs/src/snapshot/dump-format.ts
121558
+ function serializeSafeJSSnapshot(snapshot2) {
121546
121559
  for (const [key2, value] of getEnumerableDataEntries(snapshot2)) {
121547
121560
  if (key2 !== "version" && key2 !== "sourceHash" && key2 !== "heap") {
121548
121561
  assertSnapshotGraphDepth(value, key2);
@@ -121724,15 +121737,15 @@ function getEnumerableDataValues(value) {
121724
121737
  }
121725
121738
  var DUMP_FORMAT_VERSION, SKIP_VALUE;
121726
121739
  var init_dump_format = __esm({
121727
- "packages/agent-script/src/snapshot/dump-format.ts"() {
121740
+ "packages/safejs/src/snapshot/dump-format.ts"() {
121728
121741
  "use strict";
121729
121742
  init_graph_depth();
121730
121743
  DUMP_FORMAT_VERSION = 1;
121731
- SKIP_VALUE = /* @__PURE__ */ Symbol("agent-script.skip-dump-value");
121744
+ SKIP_VALUE = /* @__PURE__ */ Symbol("SafeJS.skip-dump-value");
121732
121745
  }
121733
121746
  });
121734
121747
 
121735
- // packages/agent-script/src/snapshot/validation.ts
121748
+ // packages/safejs/src/snapshot/validation.ts
121736
121749
  function validateDumpEnvelope(snapshot2) {
121737
121750
  const limits = defaultLimits();
121738
121751
  const root = requireRecord(snapshot2, "$");
@@ -122005,7 +122018,7 @@ function fail2(code, path175, detail) {
122005
122018
  }
122006
122019
  var DEFAULT_MAX_DEPTH, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_STRING_LENGTH, DEFAULT_MAX_DATA_SIZE, TAGGED_VALUE_KINDS, SnapshotValidationError;
122007
122020
  var init_validation = __esm({
122008
- "packages/agent-script/src/snapshot/validation.ts"() {
122021
+ "packages/safejs/src/snapshot/validation.ts"() {
122009
122022
  "use strict";
122010
122023
  init_shape();
122011
122024
  init_dump_format();
@@ -122042,7 +122055,7 @@ var init_validation = __esm({
122042
122055
  }
122043
122056
  });
122044
122057
 
122045
- // packages/agent-script/src/interp/running-state.ts
122058
+ // packages/safejs/src/interp/running-state.ts
122046
122059
  function enterRunningState(object) {
122047
122060
  if (runningObjects.has(object)) {
122048
122061
  throw new SandboxError("reentry");
@@ -122082,7 +122095,7 @@ function assertSnapshotInactive(snapshot2) {
122082
122095
  }
122083
122096
  var runningObjects, lockedCollections, activeSnapshots;
122084
122097
  var init_running_state = __esm({
122085
- "packages/agent-script/src/interp/running-state.ts"() {
122098
+ "packages/safejs/src/interp/running-state.ts"() {
122086
122099
  "use strict";
122087
122100
  init_budget2();
122088
122101
  runningObjects = /* @__PURE__ */ new WeakSet();
@@ -122091,7 +122104,7 @@ var init_running_state = __esm({
122091
122104
  }
122092
122105
  });
122093
122106
 
122094
- // packages/agent-script/src/restore.ts
122107
+ // packages/safejs/src/restore.ts
122095
122108
  function restore2(snapshot2, options) {
122096
122109
  assertSnapshotInactive(snapshot2);
122097
122110
  validateDumpEnvelope(snapshot2);
@@ -122103,7 +122116,7 @@ function restore2(snapshot2, options) {
122103
122116
  }
122104
122117
  var SnapshotMismatchError;
122105
122118
  var init_restore = __esm({
122106
- "packages/agent-script/src/restore.ts"() {
122119
+ "packages/safejs/src/restore.ts"() {
122107
122120
  "use strict";
122108
122121
  init_hash();
122109
122122
  init_shape();
@@ -122125,7 +122138,7 @@ var init_restore = __esm({
122125
122138
  }
122126
122139
  });
122127
122140
 
122128
- // packages/agent-script/src/observability/otel.ts
122141
+ // packages/safejs/src/observability/otel.ts
122129
122142
  function bindOtelSpan(value, span) {
122130
122143
  spanByAsyncValue.set(value, span);
122131
122144
  }
@@ -122205,7 +122218,7 @@ function readErrorMessage3(error3) {
122205
122218
  }
122206
122219
  var noopOtelSpan2, spanByAsyncValue, activeSpans, activeSinks;
122207
122220
  var init_otel2 = __esm({
122208
- "packages/agent-script/src/observability/otel.ts"() {
122221
+ "packages/safejs/src/observability/otel.ts"() {
122209
122222
  "use strict";
122210
122223
  noopOtelSpan2 = {
122211
122224
  setAttribute: () => void 0,
@@ -122218,7 +122231,7 @@ var init_otel2 = __esm({
122218
122231
  }
122219
122232
  });
122220
122233
 
122221
- // packages/agent-script/src/interp/promise-tracker.ts
122234
+ // packages/safejs/src/interp/promise-tracker.ts
122222
122235
  import { AsyncLocalStorage as AsyncLocalStorage3 } from "node:async_hooks";
122223
122236
  function createSandboxPromiseRejectionTracker() {
122224
122237
  return new SandboxPromiseRejectionTracker();
@@ -122239,7 +122252,7 @@ async function flushPromiseJobs() {
122239
122252
  }
122240
122253
  var SandboxPromiseRejectionTracker, activePromiseTracker;
122241
122254
  var init_promise_tracker = __esm({
122242
- "packages/agent-script/src/interp/promise-tracker.ts"() {
122255
+ "packages/safejs/src/interp/promise-tracker.ts"() {
122243
122256
  "use strict";
122244
122257
  SandboxPromiseRejectionTracker = class {
122245
122258
  records = /* @__PURE__ */ new Set();
@@ -122287,7 +122300,7 @@ var init_promise_tracker = __esm({
122287
122300
  }
122288
122301
  });
122289
122302
 
122290
- // packages/agent-script/src/interp/values.ts
122303
+ // packages/safejs/src/interp/values.ts
122291
122304
  function createSandboxClosure(input) {
122292
122305
  const closure = {
122293
122306
  kind: "fn",
@@ -122854,7 +122867,7 @@ function joinArrayPath(path175, key2) {
122854
122867
  }
122855
122868
  var sandboxClosureBrand, sandboxGeneratorBrand, sandboxMapBrand, sandboxPromiseBrand, sandboxRegexBrand, sandboxRegexPattern, sandboxSetBrand, sandboxRetainedValues;
122856
122869
  var init_values = __esm({
122857
- "packages/agent-script/src/interp/values.ts"() {
122870
+ "packages/safejs/src/interp/values.ts"() {
122858
122871
  "use strict";
122859
122872
  init_otel2();
122860
122873
  init_budget2();
@@ -122872,7 +122885,7 @@ var init_values = __esm({
122872
122885
  }
122873
122886
  });
122874
122887
 
122875
- // packages/agent-script/src/interp/cancel.ts
122888
+ // packages/safejs/src/interp/cancel.ts
122876
122889
  function wrapCancelableBindings(bindings, signal) {
122877
122890
  if (signal === void 0) {
122878
122891
  return bindings;
@@ -123005,14 +123018,14 @@ function isPromiseLike3(value) {
123005
123018
  return typeof value === "object" && value !== null && "then" in value;
123006
123019
  }
123007
123020
  var init_cancel2 = __esm({
123008
- "packages/agent-script/src/interp/cancel.ts"() {
123021
+ "packages/safejs/src/interp/cancel.ts"() {
123009
123022
  "use strict";
123010
123023
  init_values();
123011
123024
  init_shape();
123012
123025
  }
123013
123026
  });
123014
123027
 
123015
- // packages/agent-script/src/snapshot/policy.ts
123028
+ // packages/safejs/src/snapshot/policy.ts
123016
123029
  function registerPendingHostCallPolicy(registration) {
123017
123030
  const moduleId = readRequiredString2(registration.moduleId, "moduleId");
123018
123031
  const operation = readRequiredString2(registration.operation, "operation");
@@ -123038,7 +123051,7 @@ function readPendingHostCallPolicyModeValue(value) {
123038
123051
  }
123039
123052
  var MODULE_PENDING_HOST_CALL_POLICIES;
123040
123053
  var init_policy = __esm({
123041
- "packages/agent-script/src/snapshot/policy.ts"() {
123054
+ "packages/safejs/src/snapshot/policy.ts"() {
123042
123055
  "use strict";
123043
123056
  MODULE_PENDING_HOST_CALL_POLICIES = Object.assign(
123044
123057
  /* @__PURE__ */ Object.create(null),
@@ -123061,7 +123074,7 @@ var init_policy = __esm({
123061
123074
  }
123062
123075
  });
123063
123076
 
123064
- // packages/agent-script/src/interp/host-call.ts
123077
+ // packages/safejs/src/interp/host-call.ts
123065
123078
  import { createHash as createHash10, randomUUID as randomUUID44 } from "node:crypto";
123066
123079
  function validateRestoredRecords(records, runId, sourceHash) {
123067
123080
  const ids = /* @__PURE__ */ new Set();
@@ -123157,7 +123170,7 @@ function normalize(value, seen) {
123157
123170
  }
123158
123171
  var HostCallResumabilityError, HostCallJournal;
123159
123172
  var init_host_call = __esm({
123160
- "packages/agent-script/src/interp/host-call.ts"() {
123173
+ "packages/safejs/src/interp/host-call.ts"() {
123161
123174
  "use strict";
123162
123175
  init_policy();
123163
123176
  HostCallResumabilityError = class extends Error {
@@ -123296,7 +123309,7 @@ var init_host_call = __esm({
123296
123309
  }
123297
123310
  });
123298
123311
 
123299
- // packages/agent-script/src/interp/promise.ts
123312
+ // packages/safejs/src/interp/promise.ts
123300
123313
  function createPromiseGlobals(options) {
123301
123314
  return {
123302
123315
  Promise: {
@@ -123670,7 +123683,7 @@ function isPromiseLike4(value) {
123670
123683
  return typeof value === "object" && value !== null && "then" in value && typeof value.then === "function" && !isSandboxClosure(value) && !isSandboxPromise(value);
123671
123684
  }
123672
123685
  var init_promise = __esm({
123673
- "packages/agent-script/src/interp/promise.ts"() {
123686
+ "packages/safejs/src/interp/promise.ts"() {
123674
123687
  "use strict";
123675
123688
  init_budget2();
123676
123689
  init_promise_tracker();
@@ -123678,7 +123691,7 @@ var init_promise = __esm({
123678
123691
  }
123679
123692
  });
123680
123693
 
123681
- // packages/agent-script/src/interp/globals/console-json.ts
123694
+ // packages/safejs/src/interp/globals/console-json.ts
123682
123695
  function createConsoleJsonGlobals(options) {
123683
123696
  const sink = options.sink ?? console;
123684
123697
  return {
@@ -123928,14 +123941,14 @@ function defineDataProperty8(target, key2, value) {
123928
123941
  });
123929
123942
  }
123930
123943
  var init_console_json = __esm({
123931
- "packages/agent-script/src/interp/globals/console-json.ts"() {
123944
+ "packages/safejs/src/interp/globals/console-json.ts"() {
123932
123945
  "use strict";
123933
123946
  init_promise();
123934
123947
  init_values();
123935
123948
  }
123936
123949
  });
123937
123950
 
123938
- // packages/agent-script/src/interp/iteration.ts
123951
+ // packages/safejs/src/interp/iteration.ts
123939
123952
  function getSandboxIterator(value) {
123940
123953
  if (isSandboxGenerator(value)) {
123941
123954
  return generatorIterator(value);
@@ -123998,14 +124011,14 @@ function syncIterator(iterator) {
123998
124011
  };
123999
124012
  }
124000
124013
  var init_iteration = __esm({
124001
- "packages/agent-script/src/interp/iteration.ts"() {
124014
+ "packages/safejs/src/interp/iteration.ts"() {
124002
124015
  "use strict";
124003
124016
  init_values();
124004
124017
  init_running_state();
124005
124018
  }
124006
124019
  });
124007
124020
 
124008
- // packages/agent-script/src/interp/globals/collections.ts
124021
+ // packages/safejs/src/interp/globals/collections.ts
124009
124022
  function createCollectionGlobals(options) {
124010
124023
  const mapConstructor = createSandboxClosure({
124011
124024
  call: () => {
@@ -124111,7 +124124,7 @@ function createBudgetedSet(values, budget) {
124111
124124
  }
124112
124125
  var mapConstructors, setConstructors;
124113
124126
  var init_collections = __esm({
124114
- "packages/agent-script/src/interp/globals/collections.ts"() {
124127
+ "packages/safejs/src/interp/globals/collections.ts"() {
124115
124128
  "use strict";
124116
124129
  init_iteration();
124117
124130
  init_values();
@@ -124120,7 +124133,7 @@ var init_collections = __esm({
124120
124133
  }
124121
124134
  });
124122
124135
 
124123
- // packages/agent-script/src/interp/exceptions.ts
124136
+ // packages/safejs/src/interp/exceptions.ts
124124
124137
  async function evaluateThrowStatement(node, context, evaluateNode2) {
124125
124138
  const argument = await evaluateNode2(node.argument, context);
124126
124139
  if (argument.kind !== "normal") {
@@ -124549,7 +124562,7 @@ function copyObjectRest(value, excludedKeys) {
124549
124562
  }
124550
124563
  var capturedExceptionBrand, sandboxErrorBrand, sandboxErrorNames;
124551
124564
  var init_exceptions = __esm({
124552
- "packages/agent-script/src/interp/exceptions.ts"() {
124565
+ "packages/safejs/src/interp/exceptions.ts"() {
124553
124566
  "use strict";
124554
124567
  init_shape();
124555
124568
  init_budget2();
@@ -124570,7 +124583,7 @@ var init_exceptions = __esm({
124570
124583
  }
124571
124584
  });
124572
124585
 
124573
- // packages/agent-script/src/interp/globals/error.ts
124586
+ // packages/safejs/src/interp/globals/error.ts
124574
124587
  function createErrorGlobals(options) {
124575
124588
  return Object.fromEntries(
124576
124589
  errorNames.map((name) => [name, createErrorConstructor(name, options.budget)])
@@ -124618,7 +124631,7 @@ function isObjectLike(value) {
124618
124631
  }
124619
124632
  var errorConstructorNames, errorNames;
124620
124633
  var init_error = __esm({
124621
- "packages/agent-script/src/interp/globals/error.ts"() {
124634
+ "packages/safejs/src/interp/globals/error.ts"() {
124622
124635
  "use strict";
124623
124636
  init_exceptions();
124624
124637
  init_values();
@@ -124634,7 +124647,7 @@ var init_error = __esm({
124634
124647
  }
124635
124648
  });
124636
124649
 
124637
- // packages/agent-script/src/interp/globals/math.ts
124650
+ // packages/safejs/src/interp/globals/math.ts
124638
124651
  function createMathGlobals(options = {}) {
124639
124652
  const random = options.random ?? Math.random;
124640
124653
  const mathObject = {
@@ -124681,7 +124694,7 @@ function normalizeSeed(seed) {
124681
124694
  }
124682
124695
  var mathMethods;
124683
124696
  var init_math = __esm({
124684
- "packages/agent-script/src/interp/globals/math.ts"() {
124697
+ "packages/safejs/src/interp/globals/math.ts"() {
124685
124698
  "use strict";
124686
124699
  init_values();
124687
124700
  mathMethods = {
@@ -124723,7 +124736,7 @@ var init_math = __esm({
124723
124736
  }
124724
124737
  });
124725
124738
 
124726
- // packages/agent-script/src/interp/globals/regex.ts
124739
+ // packages/safejs/src/interp/globals/regex.ts
124727
124740
  function createRegexGlobals() {
124728
124741
  const construct = (args) => createSandboxRegex(String(args[0] ?? ""), String(args[1] ?? ""));
124729
124742
  return {
@@ -124731,13 +124744,13 @@ function createRegexGlobals() {
124731
124744
  };
124732
124745
  }
124733
124746
  var init_regex = __esm({
124734
- "packages/agent-script/src/interp/globals/regex.ts"() {
124747
+ "packages/safejs/src/interp/globals/regex.ts"() {
124735
124748
  "use strict";
124736
124749
  init_values();
124737
124750
  }
124738
124751
  });
124739
124752
 
124740
- // packages/agent-script/src/interp/globals/misc.ts
124753
+ // packages/safejs/src/interp/globals/misc.ts
124741
124754
  function createMiscGlobals(options) {
124742
124755
  return {
124743
124756
  structuredClone: createSandboxClosure({
@@ -124794,14 +124807,14 @@ function assertStructuredCloneable(value, seen) {
124794
124807
  }
124795
124808
  }
124796
124809
  var init_misc = __esm({
124797
- "packages/agent-script/src/interp/globals/misc.ts"() {
124810
+ "packages/safejs/src/interp/globals/misc.ts"() {
124798
124811
  "use strict";
124799
124812
  init_graph_depth();
124800
124813
  init_values();
124801
124814
  }
124802
124815
  });
124803
124816
 
124804
- // packages/agent-script/src/interp/globals/object-array.ts
124817
+ // packages/safejs/src/interp/globals/object-array.ts
124805
124818
  function createObjectArrayGlobals(options) {
124806
124819
  return {
124807
124820
  Object: {
@@ -125028,14 +125041,14 @@ function getTemplateRawParts(template2) {
125028
125041
  return raw;
125029
125042
  }
125030
125043
  var init_object_array = __esm({
125031
- "packages/agent-script/src/interp/globals/object-array.ts"() {
125044
+ "packages/safejs/src/interp/globals/object-array.ts"() {
125032
125045
  "use strict";
125033
125046
  init_iteration();
125034
125047
  init_values();
125035
125048
  }
125036
125049
  });
125037
125050
 
125038
- // packages/agent-script/src/interp/generator.ts
125051
+ // packages/safejs/src/interp/generator.ts
125039
125052
  function createGeneratorChannel(body) {
125040
125053
  let state = "unstarted";
125041
125054
  let signal = deferred();
@@ -125133,13 +125146,13 @@ function deferred() {
125133
125146
  return { promise, reject, resolve: resolve11 };
125134
125147
  }
125135
125148
  var init_generator = __esm({
125136
- "packages/agent-script/src/interp/generator.ts"() {
125149
+ "packages/safejs/src/interp/generator.ts"() {
125137
125150
  "use strict";
125138
125151
  init_running_state();
125139
125152
  }
125140
125153
  });
125141
125154
 
125142
- // packages/agent-script/src/interp/patterns.ts
125155
+ // packages/safejs/src/interp/patterns.ts
125143
125156
  async function bindPattern2(pattern, value, target, scope, context) {
125144
125157
  switch (pattern.type) {
125145
125158
  case "Identifier":
@@ -125347,13 +125360,13 @@ function defineProperty(target, key2, value) {
125347
125360
  });
125348
125361
  }
125349
125362
  var init_patterns = __esm({
125350
- "packages/agent-script/src/interp/patterns.ts"() {
125363
+ "packages/safejs/src/interp/patterns.ts"() {
125351
125364
  "use strict";
125352
125365
  init_values();
125353
125366
  }
125354
125367
  });
125355
125368
 
125356
- // packages/agent-script/src/interp/var-hoist.ts
125369
+ // packages/safejs/src/interp/var-hoist.ts
125357
125370
  function hoistVarDeclarations(node, scope) {
125358
125371
  if (node.type === "BlockStatement") {
125359
125372
  for (const statement of node.body) {
@@ -125483,12 +125496,12 @@ function getNestedPatternBindingNames(pattern) {
125483
125496
  }
125484
125497
  }
125485
125498
  var init_var_hoist = __esm({
125486
- "packages/agent-script/src/interp/var-hoist.ts"() {
125499
+ "packages/safejs/src/interp/var-hoist.ts"() {
125487
125500
  "use strict";
125488
125501
  }
125489
125502
  });
125490
125503
 
125491
- // packages/agent-script/src/interp/async.ts
125504
+ // packages/safejs/src/interp/async.ts
125492
125505
  function emitResumeBreakpoint(context, breakpoint) {
125493
125506
  context.onYield?.({
125494
125507
  ...breakpoint,
@@ -125730,7 +125743,7 @@ async function resolveClosureResult(result) {
125730
125743
  return resolveSandboxValue(result);
125731
125744
  }
125732
125745
  var init_async = __esm({
125733
- "packages/agent-script/src/interp/async.ts"() {
125746
+ "packages/safejs/src/interp/async.ts"() {
125734
125747
  "use strict";
125735
125748
  init_generator();
125736
125749
  init_otel2();
@@ -125741,7 +125754,7 @@ var init_async = __esm({
125741
125754
  }
125742
125755
  });
125743
125756
 
125744
- // packages/agent-script/src/interp/host-bridge.ts
125757
+ // packages/safejs/src/interp/host-bridge.ts
125745
125758
  function readHostOperationPolicy(operation) {
125746
125759
  return hostOperationPolicies.get(operation);
125747
125760
  }
@@ -126280,7 +126293,7 @@ function describeValue2(value) {
126280
126293
  }
126281
126294
  var AsyncFunction, hostOperationPolicies;
126282
126295
  var init_host_bridge = __esm({
126283
- "packages/agent-script/src/interp/host-bridge.ts"() {
126296
+ "packages/safejs/src/interp/host-bridge.ts"() {
126284
126297
  "use strict";
126285
126298
  init_async();
126286
126299
  init_shape();
@@ -126295,7 +126308,7 @@ var init_host_bridge = __esm({
126295
126308
  }
126296
126309
  });
126297
126310
 
126298
- // packages/agent-script/src/interp/methods/array.ts
126311
+ // packages/safejs/src/interp/methods/array.ts
126299
126312
  function getArrayMember(value, property, options) {
126300
126313
  const index = getArrayIndex(property);
126301
126314
  if (index !== void 0) {
@@ -126831,7 +126844,7 @@ function toIntegerOrInfinity(value) {
126831
126844
  }
126832
126845
  var arrayMethodNames;
126833
126846
  var init_array = __esm({
126834
- "packages/agent-script/src/interp/methods/array.ts"() {
126847
+ "packages/safejs/src/interp/methods/array.ts"() {
126835
126848
  "use strict";
126836
126849
  init_values();
126837
126850
  init_running_state();
@@ -126873,7 +126886,7 @@ var init_array = __esm({
126873
126886
  }
126874
126887
  });
126875
126888
 
126876
- // packages/agent-script/src/interp/methods/function.ts
126889
+ // packages/safejs/src/interp/methods/function.ts
126877
126890
  function getFunctionMember(target, property, options) {
126878
126891
  const propertyValue = target.properties?.[String(property)];
126879
126892
  if (propertyValue !== void 0 || Object.hasOwn(target.properties ?? {}, String(property))) {
@@ -126906,14 +126919,14 @@ function callFunctionMethod(target, methodName, args, options, stack) {
126906
126919
  }
126907
126920
  var functionMethodNames;
126908
126921
  var init_function = __esm({
126909
- "packages/agent-script/src/interp/methods/function.ts"() {
126922
+ "packages/safejs/src/interp/methods/function.ts"() {
126910
126923
  "use strict";
126911
126924
  init_values();
126912
126925
  functionMethodNames = /* @__PURE__ */ new Set(["apply", "call"]);
126913
126926
  }
126914
126927
  });
126915
126928
 
126916
- // packages/agent-script/src/interp/methods/map.ts
126929
+ // packages/safejs/src/interp/methods/map.ts
126917
126930
  function isMapMethodName(value) {
126918
126931
  return typeof value === "string" && mapMethodNames.has(value);
126919
126932
  }
@@ -126982,7 +126995,7 @@ async function callMapMethod(target, methodName, args, options, stack = []) {
126982
126995
  }
126983
126996
  var mapMethodNames;
126984
126997
  var init_map = __esm({
126985
- "packages/agent-script/src/interp/methods/map.ts"() {
126998
+ "packages/safejs/src/interp/methods/map.ts"() {
126986
126999
  "use strict";
126987
127000
  init_values();
126988
127001
  init_running_state();
@@ -127000,7 +127013,7 @@ var init_map = __esm({
127000
127013
  }
127001
127014
  });
127002
127015
 
127003
- // packages/agent-script/src/interp/methods/number.ts
127016
+ // packages/safejs/src/interp/methods/number.ts
127004
127017
  function getNumberMember(value, property, budget) {
127005
127018
  if (!isNumberMethodName(property)) {
127006
127019
  return void 0;
@@ -127064,7 +127077,7 @@ function toIntegerOrInfinity2(value) {
127064
127077
  }
127065
127078
  var numberMethodNames;
127066
127079
  var init_number = __esm({
127067
- "packages/agent-script/src/interp/methods/number.ts"() {
127080
+ "packages/safejs/src/interp/methods/number.ts"() {
127068
127081
  "use strict";
127069
127082
  init_values();
127070
127083
  numberMethodNames = /* @__PURE__ */ new Set([
@@ -127076,7 +127089,7 @@ var init_number = __esm({
127076
127089
  }
127077
127090
  });
127078
127091
 
127079
- // packages/agent-script/src/interp/methods/generator.ts
127092
+ // packages/safejs/src/interp/methods/generator.ts
127080
127093
  function getGeneratorMember(target, property, budget) {
127081
127094
  if (typeof property !== "string" || !generatorMethodNames.has(property)) {
127082
127095
  return void 0;
@@ -127095,7 +127108,7 @@ function getGeneratorMember(target, property, budget) {
127095
127108
  }
127096
127109
  var generatorMethodNames;
127097
127110
  var init_generator2 = __esm({
127098
- "packages/agent-script/src/interp/methods/generator.ts"() {
127111
+ "packages/safejs/src/interp/methods/generator.ts"() {
127099
127112
  "use strict";
127100
127113
  init_iteration();
127101
127114
  init_values();
@@ -127103,7 +127116,7 @@ var init_generator2 = __esm({
127103
127116
  }
127104
127117
  });
127105
127118
 
127106
- // packages/agent-script/src/interp/regex/engine.ts
127119
+ // packages/safejs/src/interp/regex/engine.ts
127107
127120
  function matchRegex(pattern, input, lastIndex = 0) {
127108
127121
  const startIndex = pattern.flags.global ? normalizeLastIndex(lastIndex) : 0;
127109
127122
  return matchRegexFrom(pattern, input, startIndex);
@@ -127333,13 +127346,13 @@ function isLineTerminator(character) {
127333
127346
  return character === "\n" || character === "\r" || character === "\u2028" || character === "\u2029";
127334
127347
  }
127335
127348
  var init_engine2 = __esm({
127336
- "packages/agent-script/src/interp/regex/engine.ts"() {
127349
+ "packages/safejs/src/interp/regex/engine.ts"() {
127337
127350
  "use strict";
127338
127351
  init_budget2();
127339
127352
  }
127340
127353
  });
127341
127354
 
127342
- // packages/agent-script/src/interp/methods/regex.ts
127355
+ // packages/safejs/src/interp/methods/regex.ts
127343
127356
  function isRegexMethodName(property) {
127344
127357
  return typeof property === "string" && regexMethodNames.has(property);
127345
127358
  }
@@ -127383,7 +127396,7 @@ function toMatchArray(match, input) {
127383
127396
  }
127384
127397
  var regexMethodNames;
127385
127398
  var init_regex2 = __esm({
127386
- "packages/agent-script/src/interp/methods/regex.ts"() {
127399
+ "packages/safejs/src/interp/methods/regex.ts"() {
127387
127400
  "use strict";
127388
127401
  init_values();
127389
127402
  init_engine2();
@@ -127391,7 +127404,7 @@ var init_regex2 = __esm({
127391
127404
  }
127392
127405
  });
127393
127406
 
127394
- // packages/agent-script/src/interp/methods/string.ts
127407
+ // packages/safejs/src/interp/methods/string.ts
127395
127408
  function getStringMember(value, property, budget) {
127396
127409
  const index = getStringIndex(property);
127397
127410
  if (index !== void 0) {
@@ -127649,7 +127662,7 @@ function asStringOrUndefined(value) {
127649
127662
  }
127650
127663
  var SPLIT_STRING_MESSAGE, stringMethodNames;
127651
127664
  var init_string = __esm({
127652
- "packages/agent-script/src/interp/methods/string.ts"() {
127665
+ "packages/safejs/src/interp/methods/string.ts"() {
127653
127666
  "use strict";
127654
127667
  init_values();
127655
127668
  init_engine2();
@@ -127688,7 +127701,7 @@ var init_string = __esm({
127688
127701
  }
127689
127702
  });
127690
127703
 
127691
- // packages/agent-script/src/interp/methods/set.ts
127704
+ // packages/safejs/src/interp/methods/set.ts
127692
127705
  function isSetMethodName(value) {
127693
127706
  return typeof value === "string" && setMethodNames.has(value);
127694
127707
  }
@@ -127754,7 +127767,7 @@ async function callSetMethod(target, methodName, args, options, stack = []) {
127754
127767
  }
127755
127768
  var setMethodNames;
127756
127769
  var init_set = __esm({
127757
- "packages/agent-script/src/interp/methods/set.ts"() {
127770
+ "packages/safejs/src/interp/methods/set.ts"() {
127758
127771
  "use strict";
127759
127772
  init_values();
127760
127773
  init_running_state();
@@ -127771,7 +127784,7 @@ var init_set = __esm({
127771
127784
  }
127772
127785
  });
127773
127786
 
127774
- // packages/agent-script/src/interp/scope.ts
127787
+ // packages/safejs/src/interp/scope.ts
127775
127788
  function defineSnapshotBinding(target, name, value) {
127776
127789
  Object.defineProperty(target, name, {
127777
127790
  configurable: true,
@@ -127782,7 +127795,7 @@ function defineSnapshotBinding(target, name, value) {
127782
127795
  }
127783
127796
  var uninitialized, Scope;
127784
127797
  var init_scope = __esm({
127785
- "packages/agent-script/src/interp/scope.ts"() {
127798
+ "packages/safejs/src/interp/scope.ts"() {
127786
127799
  "use strict";
127787
127800
  uninitialized = /* @__PURE__ */ Symbol("uninitialized");
127788
127801
  Scope = class _Scope {
@@ -127996,7 +128009,7 @@ var init_scope = __esm({
127996
128009
  }
127997
128010
  });
127998
128011
 
127999
- // packages/agent-script/src/interp/interpreter.ts
128012
+ // packages/safejs/src/interp/interpreter.ts
128000
128013
  async function interpret(node, options = {}) {
128001
128014
  const budget = options.budget ?? new Budget();
128002
128015
  const scope = options.scope === void 0 ? new Scope(
@@ -130510,7 +130523,7 @@ function isPromiseLikeResult(value) {
130510
130523
  }
130511
130524
  var taggedTemplateRawArrays, dispatchTable;
130512
130525
  var init_interpreter = __esm({
130513
- "packages/agent-script/src/interp/interpreter.ts"() {
130526
+ "packages/safejs/src/interp/interpreter.ts"() {
130514
130527
  "use strict";
130515
130528
  init_shape();
130516
130529
  init_async();
@@ -130587,7 +130600,7 @@ var init_interpreter = __esm({
130587
130600
  }
130588
130601
  });
130589
130602
 
130590
- // packages/agent-script/src/modules/registry.ts
130603
+ // packages/safejs/src/modules/registry.ts
130591
130604
  function createUnknownModuleMessage2(moduleName, moduleNames) {
130592
130605
  if (moduleNames.length === 0) {
130593
130606
  return `Unknown module '${moduleName}'. No modules are registered.`;
@@ -130697,7 +130710,7 @@ function createBindingRecord(entries) {
130697
130710
  return Object.assign(/* @__PURE__ */ Object.create(null), entries);
130698
130711
  }
130699
130712
  var init_registry6 = __esm({
130700
- "packages/agent-script/src/modules/registry.ts"() {
130713
+ "packages/safejs/src/modules/registry.ts"() {
130701
130714
  "use strict";
130702
130715
  init_shape();
130703
130716
  init_cancel2();
@@ -130706,7 +130719,7 @@ var init_registry6 = __esm({
130706
130719
  }
130707
130720
  });
130708
130721
 
130709
- // packages/agent-script/src/snapshot/dump.ts
130722
+ // packages/safejs/src/snapshot/dump.ts
130710
130723
  function attachDumpController(result, controller) {
130711
130724
  Object.defineProperty(result, RUN_DUMP_CONTROLLER, {
130712
130725
  configurable: false,
@@ -130833,19 +130846,19 @@ function isDataBudgetError(error3) {
130833
130846
  return typeof error3 === "object" && error3 !== null && "code" in error3 && error3.code === "budgetExceeded" && "budget" in error3 && error3.budget === "dataSize";
130834
130847
  }
130835
130848
  function serializeRunSnapshot(snapshot2) {
130836
- return serializeAgentScriptSnapshot(snapshot2);
130849
+ return serializeSafeJSSnapshot(snapshot2);
130837
130850
  }
130838
130851
  var RUN_DUMP_CONTROLLER;
130839
130852
  var init_dump = __esm({
130840
- "packages/agent-script/src/snapshot/dump.ts"() {
130853
+ "packages/safejs/src/snapshot/dump.ts"() {
130841
130854
  "use strict";
130842
130855
  init_dump_format();
130843
130856
  init_budget2();
130844
- RUN_DUMP_CONTROLLER = /* @__PURE__ */ Symbol("agent-script.run-dump-controller");
130857
+ RUN_DUMP_CONTROLLER = /* @__PURE__ */ Symbol("SafeJS.run-dump-controller");
130845
130858
  }
130846
130859
  });
130847
130860
 
130848
- // packages/agent-script/src/error-codes.ts
130861
+ // packages/safejs/src/error-codes.ts
130849
130862
  function getOwnErrorCode2(error3) {
130850
130863
  if (typeof error3 !== "object" || error3 === null || !Object.prototype.hasOwnProperty.call(error3, "code")) {
130851
130864
  return void 0;
@@ -130857,18 +130870,18 @@ function hasOwnErrorCode29(error3, code) {
130857
130870
  return getOwnErrorCode2(error3) === code;
130858
130871
  }
130859
130872
  var init_error_codes21 = __esm({
130860
- "packages/agent-script/src/error-codes.ts"() {
130873
+ "packages/safejs/src/error-codes.ts"() {
130861
130874
  "use strict";
130862
130875
  }
130863
130876
  });
130864
130877
 
130865
- // packages/agent-script/src/snapshot/backend.ts
130878
+ // packages/safejs/src/snapshot/backend.ts
130866
130879
  import { randomUUID as randomUUID45 } from "node:crypto";
130867
130880
  import { readFile as readFile51, rename as rename27, stat as stat31, unlink as unlink24, writeFile as writeFile28 } from "node:fs/promises";
130868
130881
  import { dirname as dirname10 } from "node:path";
130869
130882
  async function writeSnapshotAtomically(snapshotPath, snapshot2, options) {
130870
130883
  const parentPath = dirname10(snapshotPath);
130871
- const contents = serializeAgentScriptSnapshot(snapshot2);
130884
+ const contents = serializeSafeJSSnapshot(snapshot2);
130872
130885
  await assertParentDirectoryExists(snapshotPath, parentPath);
130873
130886
  for (let attempt = 1; attempt <= options.maxAttempts; attempt += 1) {
130874
130887
  try {
@@ -130980,7 +130993,7 @@ function isLockedFileError(error3) {
130980
130993
  }
130981
130994
  var DEFAULT_WRITE_MAX_ATTEMPTS, DEFAULT_WRITE_RETRY_DELAY_MS, LOCKED_FILE_ERROR_CODES, pendingOperations, FileSnapshotBackend;
130982
130995
  var init_backend = __esm({
130983
- "packages/agent-script/src/snapshot/backend.ts"() {
130996
+ "packages/safejs/src/snapshot/backend.ts"() {
130984
130997
  "use strict";
130985
130998
  init_error_codes21();
130986
130999
  init_dump_format();
@@ -131034,7 +131047,7 @@ var init_backend = __esm({
131034
131047
  }
131035
131048
  });
131036
131049
 
131037
- // packages/agent-script/src/snapshot/scheduler.ts
131050
+ // packages/safejs/src/snapshot/scheduler.ts
131038
131051
  function createSnapshotScheduler(options) {
131039
131052
  const snapshotBackend = options.snapshotBackend ?? (options.snapshotPath === void 0 ? void 0 : new FileSnapshotBackend(options.snapshotPath, createFileSnapshotBackendOptions(options)));
131040
131053
  if (snapshotBackend === void 0) {
@@ -131119,17 +131132,17 @@ function createFileSnapshotBackendOptions(options) {
131119
131132
  }
131120
131133
  var DEFAULT_SNAPSHOT_INTERVAL_MS;
131121
131134
  var init_scheduler = __esm({
131122
- "packages/agent-script/src/snapshot/scheduler.ts"() {
131135
+ "packages/safejs/src/snapshot/scheduler.ts"() {
131123
131136
  "use strict";
131124
131137
  init_backend();
131125
131138
  DEFAULT_SNAPSHOT_INTERVAL_MS = 3e4;
131126
131139
  }
131127
131140
  });
131128
131141
 
131129
- // packages/agent-script/src/snapshot/serialize.ts
131142
+ // packages/safejs/src/snapshot/serialize.ts
131130
131143
  var UnsnapshotableValueError;
131131
131144
  var init_serialize = __esm({
131132
- "packages/agent-script/src/snapshot/serialize.ts"() {
131145
+ "packages/safejs/src/snapshot/serialize.ts"() {
131133
131146
  "use strict";
131134
131147
  init_hash();
131135
131148
  init_graph_depth();
@@ -131147,7 +131160,7 @@ var init_serialize = __esm({
131147
131160
  }
131148
131161
  });
131149
131162
 
131150
- // packages/agent-script/src/run.ts
131163
+ // packages/safejs/src/run.ts
131151
131164
  function run(source, options = {}) {
131152
131165
  const lifecycle = { hostCallbackDepth: 0 };
131153
131166
  const dumpController = createDumpController(lifecycle);
@@ -131530,7 +131543,7 @@ function createPendingAwaitSnapshot(yieldPoint) {
131530
131543
  }
131531
131544
  var UnhandledRejectionError, DEFAULT_MAX_CALL_DEPTH;
131532
131545
  var init_run6 = __esm({
131533
- "packages/agent-script/src/run.ts"() {
131546
+ "packages/safejs/src/run.ts"() {
131534
131547
  "use strict";
131535
131548
  init_hash();
131536
131549
  init_shape();
@@ -131572,31 +131585,31 @@ var init_run6 = __esm({
131572
131585
  }
131573
131586
  });
131574
131587
 
131575
- // packages/agent-script/src/dump.ts
131588
+ // packages/safejs/src/dump.ts
131576
131589
  var init_dump2 = __esm({
131577
- "packages/agent-script/src/dump.ts"() {
131590
+ "packages/safejs/src/dump.ts"() {
131578
131591
  "use strict";
131579
131592
  init_dump_format();
131580
131593
  init_dump();
131581
131594
  }
131582
131595
  });
131583
131596
 
131584
- // packages/agent-script/src/error/format.ts
131597
+ // packages/safejs/src/error/format.ts
131585
131598
  var init_format3 = __esm({
131586
- "packages/agent-script/src/error/format.ts"() {
131599
+ "packages/safejs/src/error/format.ts"() {
131587
131600
  "use strict";
131588
131601
  init_budget2();
131589
131602
  }
131590
131603
  });
131591
131604
 
131592
- // packages/agent-script/src/loader/extract-block.ts
131605
+ // packages/safejs/src/loader/extract-block.ts
131593
131606
  var init_extract_block = __esm({
131594
- "packages/agent-script/src/loader/extract-block.ts"() {
131607
+ "packages/safejs/src/loader/extract-block.ts"() {
131595
131608
  "use strict";
131596
131609
  }
131597
131610
  });
131598
131611
 
131599
- // packages/agent-script/src/loader/frontmatter.ts
131612
+ // packages/safejs/src/loader/frontmatter.ts
131600
131613
  function splitFrontmatter3(markdown) {
131601
131614
  try {
131602
131615
  const parsed = parseFrontmatterDocument(markdown);
@@ -131612,12 +131625,12 @@ function splitFrontmatter3(markdown) {
131612
131625
  };
131613
131626
  } catch (error3) {
131614
131627
  if (error3 instanceof FrontmatterParseError) {
131615
- throw toAgentScriptFrontmatterError(markdown, error3);
131628
+ throw toSafeJSFrontmatterError(markdown, error3);
131616
131629
  }
131617
131630
  throw error3;
131618
131631
  }
131619
131632
  }
131620
- function toAgentScriptFrontmatterError(markdown, error3) {
131633
+ function toSafeJSFrontmatterError(markdown, error3) {
131621
131634
  if (error3.message === "Missing YAML frontmatter end delimiter (---).") {
131622
131635
  return new Error(
131623
131636
  `Invalid frontmatter at line ${countLines3(stripByteOrderMark(markdown))}: missing closing delimiter (---).`
@@ -131644,27 +131657,27 @@ function countLines3(value) {
131644
131657
  return count;
131645
131658
  }
131646
131659
  var init_frontmatter6 = __esm({
131647
- "packages/agent-script/src/loader/frontmatter.ts"() {
131660
+ "packages/safejs/src/loader/frontmatter.ts"() {
131648
131661
  "use strict";
131649
131662
  init_src();
131650
131663
  }
131651
131664
  });
131652
131665
 
131653
- // packages/agent-script/src/lint/runtime-modules.ts
131666
+ // packages/safejs/src/lint/runtime-modules.ts
131654
131667
  var AsyncFunction2;
131655
131668
  var init_runtime_modules = __esm({
131656
- "packages/agent-script/src/lint/runtime-modules.ts"() {
131669
+ "packages/safejs/src/lint/runtime-modules.ts"() {
131657
131670
  "use strict";
131658
131671
  init_values();
131659
131672
  AsyncFunction2 = (async () => void 0).constructor;
131660
131673
  }
131661
131674
  });
131662
131675
 
131663
- // packages/agent-script/src/runner/run-harness.ts
131676
+ // packages/safejs/src/runner/run-harness.ts
131664
131677
  import { readFile as readFile52, stat as stat32 } from "node:fs/promises";
131665
131678
  import { extname as extname2 } from "node:path";
131666
131679
  var init_run_harness = __esm({
131667
- "packages/agent-script/src/runner/run-harness.ts"() {
131680
+ "packages/safejs/src/runner/run-harness.ts"() {
131668
131681
  "use strict";
131669
131682
  init_configs();
131670
131683
  init_types4();
@@ -131673,11 +131686,12 @@ var init_run_harness = __esm({
131673
131686
  init_frontmatter6();
131674
131687
  init_lint4();
131675
131688
  init_runtime_modules();
131689
+ init_parser3();
131676
131690
  init_run6();
131677
131691
  }
131678
131692
  });
131679
131693
 
131680
- // packages/agent-script/src/loader/find-exported.ts
131694
+ // packages/safejs/src/loader/find-exported.ts
131681
131695
  function findExportedConstInitializer(module, name) {
131682
131696
  for (const statement of module.body) {
131683
131697
  if (statement.type === "ExportDefaultDeclaration") {
@@ -131711,12 +131725,12 @@ function findExportedConstInitializer(module, name) {
131711
131725
  return void 0;
131712
131726
  }
131713
131727
  var init_find_exported = __esm({
131714
- "packages/agent-script/src/loader/find-exported.ts"() {
131728
+ "packages/safejs/src/loader/find-exported.ts"() {
131715
131729
  "use strict";
131716
131730
  }
131717
131731
  });
131718
131732
 
131719
- // packages/agent-script/src/modules/agent.ts
131733
+ // packages/safejs/src/modules/agent.ts
131720
131734
  import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
131721
131735
  function createSpawnUsageAccumulator() {
131722
131736
  let inputTokens = 0;
@@ -132557,7 +132571,7 @@ function isRecord40(value) {
132557
132571
  }
132558
132572
  var activeUsageAccumulator, oneAttemptRetryOptions;
132559
132573
  var init_agent3 = __esm({
132560
- "packages/agent-script/src/modules/agent.ts"() {
132574
+ "packages/safejs/src/modules/agent.ts"() {
132561
132575
  "use strict";
132562
132576
  init_configs();
132563
132577
  init_parallel();
@@ -132572,14 +132586,14 @@ var init_agent3 = __esm({
132572
132586
  }
132573
132587
  });
132574
132588
 
132575
- // packages/agent-script/src/modules/env.ts
132589
+ // packages/safejs/src/modules/env.ts
132576
132590
  var init_env = __esm({
132577
- "packages/agent-script/src/modules/env.ts"() {
132591
+ "packages/safejs/src/modules/env.ts"() {
132578
132592
  "use strict";
132579
132593
  }
132580
132594
  });
132581
132595
 
132582
- // packages/agent-script/src/modules/fail.ts
132596
+ // packages/safejs/src/modules/fail.ts
132583
132597
  function makeFailModule() {
132584
132598
  function fail3(message2) {
132585
132599
  throw new HarnessFailure(readNonEmptyString5(message2, "Harness failure message"));
@@ -132599,7 +132613,7 @@ function readNonEmptyString5(value, label) {
132599
132613
  }
132600
132614
  var HarnessFailure;
132601
132615
  var init_fail = __esm({
132602
- "packages/agent-script/src/modules/fail.ts"() {
132616
+ "packages/safejs/src/modules/fail.ts"() {
132603
132617
  "use strict";
132604
132618
  HarnessFailure = class extends Error {
132605
132619
  constructor(message2) {
@@ -132610,7 +132624,7 @@ var init_fail = __esm({
132610
132624
  }
132611
132625
  });
132612
132626
 
132613
- // packages/agent-script/src/modules/git.ts
132627
+ // packages/safejs/src/modules/git.ts
132614
132628
  import { execFile as execFile3 } from "node:child_process";
132615
132629
  import { mkdir as mkdir36, realpath as realpath17, rm as rm15 } from "node:fs/promises";
132616
132630
  import { basename as basename8, dirname as dirname11, isAbsolute as isAbsolute6, relative as relative5, resolve as resolve9, sep as sep6 } from "node:path";
@@ -132956,7 +132970,7 @@ function hasOwnProperty16(value, name) {
132956
132970
  }
132957
132971
  var GIT_EXEC_MAX_BUFFER, SAVEPOINT_REF_PREFIX;
132958
132972
  var init_git2 = __esm({
132959
- "packages/agent-script/src/modules/git.ts"() {
132973
+ "packages/safejs/src/modules/git.ts"() {
132960
132974
  "use strict";
132961
132975
  init_error_codes21();
132962
132976
  GIT_EXEC_MAX_BUFFER = 10 * 1024 * 1024;
@@ -132964,7 +132978,7 @@ var init_git2 = __esm({
132964
132978
  }
132965
132979
  });
132966
132980
 
132967
- // packages/agent-script/src/modules/harness.ts
132981
+ // packages/safejs/src/modules/harness.ts
132968
132982
  function makeHarnessModule(frontmatter, meta) {
132969
132983
  const copiedFrontmatter = copyHarnessValue(frontmatter);
132970
132984
  const constraints = readConstraints(copiedFrontmatter);
@@ -133011,13 +133025,13 @@ ${constraints.map((constraint) => `- ${constraint}`).join("\n")}`;
133011
133025
  ${prompt}`;
133012
133026
  }
133013
133027
  var init_harness2 = __esm({
133014
- "packages/agent-script/src/modules/harness.ts"() {
133028
+ "packages/safejs/src/modules/harness.ts"() {
133015
133029
  "use strict";
133016
133030
  init_values();
133017
133031
  }
133018
133032
  });
133019
133033
 
133020
- // packages/agent-script/src/output-stream.ts
133034
+ // packages/safejs/src/output-stream.ts
133021
133035
  function createBrokenPipeState() {
133022
133036
  return { closed: false };
133023
133037
  }
@@ -133056,13 +133070,13 @@ function isBrokenPipeError(error3) {
133056
133070
  return hasOwnErrorCode29(error3, "EPIPE");
133057
133071
  }
133058
133072
  var init_output_stream = __esm({
133059
- "packages/agent-script/src/output-stream.ts"() {
133073
+ "packages/safejs/src/output-stream.ts"() {
133060
133074
  "use strict";
133061
133075
  init_error_codes21();
133062
133076
  }
133063
133077
  });
133064
133078
 
133065
- // packages/agent-script/src/modules/log.ts
133079
+ // packages/safejs/src/modules/log.ts
133066
133080
  function makeLogModule(sink = createJsonlStdoutSink()) {
133067
133081
  const normalizedSink = readSink(sink);
133068
133082
  return {
@@ -133171,13 +133185,13 @@ function toJsonValue(value, seen) {
133171
133185
  return String(value);
133172
133186
  }
133173
133187
  var init_log2 = __esm({
133174
- "packages/agent-script/src/modules/log.ts"() {
133188
+ "packages/safejs/src/modules/log.ts"() {
133175
133189
  "use strict";
133176
133190
  init_output_stream();
133177
133191
  }
133178
133192
  });
133179
133193
 
133180
- // packages/agent-script/src/modules/metric.ts
133194
+ // packages/safejs/src/modules/metric.ts
133181
133195
  function makeMetricModule(npmRunner) {
133182
133196
  return {
133183
133197
  async run(name) {
@@ -133214,19 +133228,19 @@ function readNonEmptyString8(value, label) {
133214
133228
  return normalizedValue;
133215
133229
  }
133216
133230
  var init_metric = __esm({
133217
- "packages/agent-script/src/modules/metric.ts"() {
133231
+ "packages/safejs/src/modules/metric.ts"() {
133218
133232
  "use strict";
133219
133233
  }
133220
133234
  });
133221
133235
 
133222
- // packages/agent-script/src/modules/mcp.ts
133236
+ // packages/safejs/src/modules/mcp.ts
133223
133237
  var init_mcp6 = __esm({
133224
- "packages/agent-script/src/modules/mcp.ts"() {
133238
+ "packages/safejs/src/modules/mcp.ts"() {
133225
133239
  "use strict";
133226
133240
  }
133227
133241
  });
133228
133242
 
133229
- // packages/agent-script/src/modules/time.ts
133243
+ // packages/safejs/src/modules/time.ts
133230
133244
  function makeTimeModule(options = {}) {
133231
133245
  const hasDeterministicRandom = options.random !== void 0 || options.seed !== void 0;
133232
133246
  const random = options.random ?? (options.seed === void 0 ? () => Math.random() : createSeededRandom(options.seed).next);
@@ -133297,15 +133311,15 @@ function createSleepAbortError() {
133297
133311
  return new Error("time.sleep aborted.");
133298
133312
  }
133299
133313
  var init_time = __esm({
133300
- "packages/agent-script/src/modules/time.ts"() {
133314
+ "packages/safejs/src/modules/time.ts"() {
133301
133315
  "use strict";
133302
133316
  init_math();
133303
133317
  }
133304
133318
  });
133305
133319
 
133306
- // packages/agent-script/src/index.ts
133320
+ // packages/safejs/src/index.ts
133307
133321
  var init_src46 = __esm({
133308
- "packages/agent-script/src/index.ts"() {
133322
+ "packages/safejs/src/index.ts"() {
133309
133323
  "use strict";
133310
133324
  init_parse6();
133311
133325
  init_parser3();
@@ -133658,22 +133672,26 @@ async function runHarnessPair2(mdPath, options) {
133658
133672
  seed: options.randomSeed,
133659
133673
  snapshot: snapshot2
133660
133674
  });
133661
- const hostCallReplay = await createHostCallReplay(snapshotPath, {
133662
- "time.now": {
133663
- restore: restoreClockState(runtimeClock),
133664
- snapshot: runtimeClock.snapshot
133665
- },
133666
- ...runtimeRandom === void 0 ? {} : {
133667
- "time.random": {
133668
- restore: restoreRandomState(runtimeRandom),
133669
- snapshot: runtimeRandom.snapshot
133675
+ const hostCallReplay = await createHostCallReplay(
133676
+ snapshotPath,
133677
+ {
133678
+ "time.now": {
133679
+ restore: restoreClockState(runtimeClock),
133680
+ snapshot: runtimeClock.snapshot
133670
133681
  },
133671
- "time.uuid": {
133672
- restore: restoreRandomState(runtimeRandom),
133673
- snapshot: runtimeRandom.snapshot
133682
+ ...runtimeRandom === void 0 ? {} : {
133683
+ "time.random": {
133684
+ restore: restoreRandomState(runtimeRandom),
133685
+ snapshot: runtimeRandom.snapshot
133686
+ },
133687
+ "time.uuid": {
133688
+ restore: restoreRandomState(runtimeRandom),
133689
+ snapshot: runtimeRandom.snapshot
133690
+ }
133674
133691
  }
133675
- }
133676
- }, { guardDefaultSnapshotPath });
133692
+ },
133693
+ { guardDefaultSnapshotPath }
133694
+ );
133677
133695
  const modules = hostCallReplay.wrapModules(
133678
133696
  withBuiltinModules(
133679
133697
  options.modulesFor(validated, meta),
@@ -134214,13 +134232,7 @@ import path171 from "node:path";
134214
134232
  import { readFile as readFile56 } from "node:fs/promises";
134215
134233
  function registerHarnessCommand(program, container) {
134216
134234
  const harness = program.command("harness").description("Run and manage agent harness pairs.");
134217
- harness.command("run").description("Run a harness pair.").argument("[md-path]", "Path to the harness .md file").option("--fix", "Apply supported lint fixes to the harness .ajs file before running.").option("--snapshot-path <path>", "File to write/read harness snapshots.").option("--resume", "Resume from the snapshot file when it exists.").option(
134218
- "--agent <name>",
134219
- "Override the agent id from the harness frontmatter agent block."
134220
- ).option(
134221
- "--model <name>",
134222
- "Override the model from the harness frontmatter agent block."
134223
- ).option(
134235
+ harness.command("run").description("Run a harness pair.").argument("[md-path]", "Path to the harness .md file").option("--fix", "Apply supported lint fixes to the harness .ajs file before running.").option("--snapshot-path <path>", "File to write/read harness snapshots.").option("--resume", "Resume from the snapshot file when it exists.").option("--agent <name>", "Override the agent id from the harness frontmatter agent block.").option("--model <name>", "Override the model from the harness frontmatter agent block.").option(
134224
134236
  "--mode <mode>",
134225
134237
  "Override the mode from the harness frontmatter agent block (read|edit|auto|yolo)."
134226
134238
  ).option("-y, --yes", "Accept defaults without prompting.").action(async (mdPath, options) => {
@@ -134370,7 +134382,9 @@ function isAlreadyReportedSpawnFailure(error3, reported) {
134370
134382
  }
134371
134383
  }
134372
134384
  if ("errors" in error3 && Array.isArray(error3.errors) && error3.errors.length > 0) {
134373
- return error3.errors.every((nestedError) => isAlreadyReportedSpawnFailure(nestedError, reported));
134385
+ return error3.errors.every(
134386
+ (nestedError) => isAlreadyReportedSpawnFailure(nestedError, reported)
134387
+ );
134374
134388
  }
134375
134389
  return false;
134376
134390
  }
@@ -134520,7 +134534,9 @@ async function executeHarnessNew(program, container, kind, basename10, options)
134520
134534
  throw new ValidationError(`Unknown harness template "${kind}".`);
134521
134535
  }
134522
134536
  if (basename10.length === 0 || basename10 === "." || basename10 === ".." || path171.basename(basename10) !== basename10) {
134523
- throw new ValidationError(`Invalid harness basename "${basename10}". Use a single directory name.`);
134537
+ throw new ValidationError(
134538
+ `Invalid harness basename "${basename10}". Use a single directory name.`
134539
+ );
134524
134540
  }
134525
134541
  const defaultDir = path171.join(".poe-code", "harnesses", basename10);
134526
134542
  const outputDir = options.dir ?? await resolveOutputDir(defaultDir, flags.assumeYes);
@@ -136004,7 +136020,7 @@ var init_package2 = __esm({
136004
136020
  "package.json"() {
136005
136021
  package_default2 = {
136006
136022
  name: "poe-code",
136007
- version: "3.0.263",
136023
+ version: "3.0.265",
136008
136024
  description: "CLI tool to configure Poe API for developer workflows.",
136009
136025
  type: "module",
136010
136026
  main: "./dist/index.js",
@@ -136123,8 +136139,8 @@ var init_package2 = __esm({
136123
136139
  "packages/agent-traces/dist",
136124
136140
  "packages/agent-hook-config/dist",
136125
136141
  "packages/agent-human-in-loop/dist",
136126
- "packages/agent-maestro/dist",
136127
- "packages/agent-script/dist",
136142
+ "packages/maestro/dist",
136143
+ "packages/safejs/dist",
136128
136144
  "packages/agent-spawn/dist",
136129
136145
  "packages/auth-store/dist",
136130
136146
  "packages/braintrust/dist",
@@ -136217,9 +136233,9 @@ var init_package2 = __esm({
136217
136233
  "@poe-code/agent-harness-tools": "*",
136218
136234
  "@poe-code/agent-hook-config": "*",
136219
136235
  "@poe-code/agent-human-in-loop": "*",
136220
- "@poe-code/agent-maestro": "*",
136236
+ "@poe-code/maestro": "*",
136221
136237
  "@poe-code/agent-mcp-config": "*",
136222
- "@poe-code/agent-script": "*",
136238
+ "@poe-code/safejs": "*",
136223
136239
  "@poe-code/agent-skill-config": "*",
136224
136240
  "@poe-code/agent-spawn": "*",
136225
136241
  "@poe-code/agent-traces": "*",