@poe-platform/safe-js 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +206 -0
  3. package/dist/agent-defs/agents/claude-code.d.ts +2 -0
  4. package/dist/agent-defs/agents/claude-desktop.d.ts +2 -0
  5. package/dist/agent-defs/agents/codex.d.ts +2 -0
  6. package/dist/agent-defs/agents/cursor.d.ts +2 -0
  7. package/dist/agent-defs/agents/gemini-cli.d.ts +2 -0
  8. package/dist/agent-defs/agents/goose.d.ts +2 -0
  9. package/dist/agent-defs/agents/index.d.ts +10 -0
  10. package/dist/agent-defs/agents/kimi.d.ts +2 -0
  11. package/dist/agent-defs/agents/opencode.d.ts +2 -0
  12. package/dist/agent-defs/agents/pi.d.ts +2 -0
  13. package/dist/agent-defs/agents/poe-agent.d.ts +2 -0
  14. package/dist/agent-defs/capabilities.d.ts +14 -0
  15. package/dist/agent-defs/index.d.ts +6 -0
  16. package/dist/agent-defs/registry.d.ts +3 -0
  17. package/dist/agent-defs/specifier.d.ts +7 -0
  18. package/dist/agent-defs/types.d.ts +35 -0
  19. package/dist/agent-harness-tools/binary-exists.d.ts +10 -0
  20. package/dist/agent-harness-tools/execution-env.d.ts +108 -0
  21. package/dist/agent-harness-tools/hooks.d.ts +30 -0
  22. package/dist/agent-harness-tools/index.d.ts +18 -0
  23. package/dist/agent-harness-tools/log-stream.d.ts +28 -0
  24. package/dist/agent-harness-tools/participant.d.ts +10 -0
  25. package/dist/agent-harness-tools/paths.d.ts +14 -0
  26. package/dist/agent-harness-tools/plan-readiness.d.ts +7 -0
  27. package/dist/agent-harness-tools/plans.d.ts +35 -0
  28. package/dist/agent-harness-tools/poe-command-execution.d.ts +37 -0
  29. package/dist/agent-harness-tools/run-logs.d.ts +17 -0
  30. package/dist/agent-harness-tools/run-poe-command.d.ts +33 -0
  31. package/dist/agent-harness-tools/runner.d.ts +33 -0
  32. package/dist/agent-harness-tools/select-agent.d.ts +18 -0
  33. package/dist/agent-harness-tools/sequence.d.ts +7 -0
  34. package/dist/agent-harness-tools/skill-config.d.ts +1 -0
  35. package/dist/agent-harness-tools/stage.d.ts +22 -0
  36. package/dist/agent-harness-tools/workspace-transfer.d.ts +3 -0
  37. package/dist/agent-spawn/acp/middleware.d.ts +38 -0
  38. package/dist/agent-spawn/acp/types.d.ts +180 -0
  39. package/dist/agent-spawn/adapters/claude.d.ts +3 -0
  40. package/dist/agent-spawn/adapters/codex.d.ts +2 -0
  41. package/dist/agent-spawn/adapters/cursor.d.ts +2 -0
  42. package/dist/agent-spawn/adapters/index.d.ts +12 -0
  43. package/dist/agent-spawn/adapters/kimi.d.ts +2 -0
  44. package/dist/agent-spawn/adapters/native.d.ts +5 -0
  45. package/dist/agent-spawn/adapters/opencode.d.ts +2 -0
  46. package/dist/agent-spawn/adapters/pi.d.ts +2 -0
  47. package/dist/agent-spawn/environment.d.ts +2 -0
  48. package/dist/agent-spawn/parallel.d.ts +30 -0
  49. package/dist/agent-spawn/retry.d.ts +26 -0
  50. package/dist/agent-spawn/types.d.ts +272 -0
  51. package/dist/auth-store/create-secret-store.d.ts +2 -0
  52. package/dist/auth-store/encrypted-file-store.d.ts +47 -0
  53. package/dist/auth-store/index.d.ts +7 -0
  54. package/dist/auth-store/keychain-store.d.ts +25 -0
  55. package/dist/auth-store/provider-store.d.ts +14 -0
  56. package/dist/auth-store/types.d.ts +22 -0
  57. package/dist/config-mutations/execution/run-mutations.d.ts +7 -0
  58. package/dist/config-mutations/fs-utils.d.ts +18 -0
  59. package/dist/config-mutations/index.d.ts +8 -0
  60. package/dist/config-mutations/mutations/config-mutation.d.ts +47 -0
  61. package/dist/config-mutations/mutations/file-mutation.d.ts +62 -0
  62. package/dist/config-mutations/mutations/template-mutation.d.ts +40 -0
  63. package/dist/config-mutations/template/render.d.ts +6 -0
  64. package/dist/config-mutations/types.d.ts +168 -0
  65. package/dist/poe-code-config/compile/schema-compiler.d.ts +11 -0
  66. package/dist/poe-code-config/config.d.ts +2 -0
  67. package/dist/poe-code-config/configured-services.d.ts +29 -0
  68. package/dist/poe-code-config/index.d.ts +16 -0
  69. package/dist/poe-code-config/inspect.d.ts +13 -0
  70. package/dist/poe-code-config/memory.d.ts +14 -0
  71. package/dist/poe-code-config/merge-callbacks.d.ts +38 -0
  72. package/dist/poe-code-config/merge.d.ts +2 -0
  73. package/dist/poe-code-config/plan-scope.d.ts +8 -0
  74. package/dist/poe-code-config/provider-config.d.ts +16 -0
  75. package/dist/poe-code-config/resolve.d.ts +2 -0
  76. package/dist/poe-code-config/runtime.d.ts +114 -0
  77. package/dist/poe-code-config/schema.d.ts +14 -0
  78. package/dist/poe-code-config/state/fs.d.ts +24 -0
  79. package/dist/poe-code-config/state/index.d.ts +12 -0
  80. package/dist/poe-code-config/state/jobs.d.ts +34 -0
  81. package/dist/poe-code-config/state/templates.d.ts +18 -0
  82. package/dist/poe-code-config/store.d.ts +12 -0
  83. package/dist/poe-code-config/types.d.ts +88 -0
  84. package/dist/process-runner/docker/build-context.d.ts +5 -0
  85. package/dist/process-runner/docker/context.d.ts +3 -0
  86. package/dist/process-runner/docker/docker-execution-env.d.ts +28 -0
  87. package/dist/process-runner/docker/docker-runner.d.ts +2 -0
  88. package/dist/process-runner/docker/engine.d.ts +3 -0
  89. package/dist/process-runner/host/host-execution-env.d.ts +2 -0
  90. package/dist/process-runner/host/host-runner.d.ts +3 -0
  91. package/dist/process-runner/index.d.ts +10 -0
  92. package/dist/process-runner/testing/index.d.ts +2 -0
  93. package/dist/process-runner/testing/mock-runner.d.ts +3 -0
  94. package/dist/process-runner/types.d.ts +191 -0
  95. package/dist/process-runner/workspace-transfer.d.ts +61 -0
  96. package/dist/providers/auth/api-key.d.ts +5 -0
  97. package/dist/providers/auth/types.d.ts +14 -0
  98. package/dist/providers/compatibility.d.ts +4 -0
  99. package/dist/providers/index.d.ts +8 -0
  100. package/dist/providers/providers/anthropic.d.ts +1 -0
  101. package/dist/providers/providers/cloudflare.d.ts +1 -0
  102. package/dist/providers/providers/generated.d.ts +5 -0
  103. package/dist/providers/providers/openai.d.ts +1 -0
  104. package/dist/providers/providers/poe.d.ts +2 -0
  105. package/dist/providers/registry.d.ts +44 -0
  106. package/dist/providers/types.d.ts +54 -0
  107. package/dist/safe-fs/bridge/filesystem.d.ts +88 -0
  108. package/dist/safe-fs/bridge/index.d.ts +6 -0
  109. package/dist/safe-fs/bridge/types.d.ts +75 -0
  110. package/dist/safe-fs/config.d.ts +15 -0
  111. package/dist/safe-fs/config.node.d.ts +2 -0
  112. package/dist/safe-fs/contracts/errors.d.ts +50 -0
  113. package/dist/safe-fs/contracts/filesystem.d.ts +96 -0
  114. package/dist/safe-fs/contracts/index.d.ts +4 -0
  115. package/dist/safe-fs/contracts/io.d.ts +8 -0
  116. package/dist/safe-fs/contracts/path.d.ts +8 -0
  117. package/dist/safe-fs/contracts/portable-path.d.ts +13 -0
  118. package/dist/safe-fs/contracts/virtual-path.d.ts +7 -0
  119. package/dist/safe-fs/core.d.ts +12 -0
  120. package/dist/safe-fs/fs/memory/index.d.ts +58 -0
  121. package/dist/safe-fs/fs/mount/comparison.d.ts +19 -0
  122. package/dist/safe-fs/fs/mount/index.d.ts +44 -0
  123. package/dist/safe-fs/fs/overlay/index.d.ts +73 -0
  124. package/dist/safe-fs/fs/readonly/index.d.ts +31 -0
  125. package/dist/safe-fs/fs/real/index.d.ts +76 -0
  126. package/dist/safe-fs/fs/s3/filesystem.d.ts +93 -0
  127. package/dist/safe-fs/fs/s3/http/index.d.ts +2 -0
  128. package/dist/safe-fs/fs/s3/http/transport.d.ts +3 -0
  129. package/dist/safe-fs/fs/s3/http/types.d.ts +30 -0
  130. package/dist/safe-fs/fs/s3/index.d.ts +6 -0
  131. package/dist/safe-fs/fs/s3/mock.d.ts +48 -0
  132. package/dist/safe-fs/fs/s3/transport.d.ts +103 -0
  133. package/dist/safe-fs/fs/webdav/index.d.ts +2 -0
  134. package/dist/safe-fs/fs/webdav/webdav.d.ts +101 -0
  135. package/dist/safe-fs/index.d.ts +14 -0
  136. package/dist/safe-fs/node/filesystem.d.ts +11 -0
  137. package/dist/safe-fs/node/index.d.ts +2 -0
  138. package/dist/safe-fs/node-host.d.ts +1 -0
  139. package/dist/safe-fs/node-unavailable.d.ts +1 -0
  140. package/dist/safe-fs/platform/browser.d.ts +12 -0
  141. package/dist/safe-fs/platform/node.d.ts +13 -0
  142. package/dist/safe-js/browser/chunks/chunk-QGN6DKT5.js +4335 -0
  143. package/dist/safe-js/browser/chunks/chunk-QGN6DKT5.js.map +7 -0
  144. package/dist/safe-js/browser/safe-fs-core.js +67 -0
  145. package/dist/safe-js/browser/safe-fs-core.js.map +7 -0
  146. package/dist/safe-js/browser/safe-fs.js +67 -0
  147. package/dist/safe-js/browser/safe-fs.js.map +7 -0
  148. package/dist/safe-js/chunks/chunk-2QRYPKQQ.js +4315 -0
  149. package/dist/safe-js/chunks/chunk-2QRYPKQQ.js.map +7 -0
  150. package/dist/safe-js/chunks/chunk-4YIDX44G.js +40 -0
  151. package/dist/safe-js/chunks/chunk-4YIDX44G.js.map +7 -0
  152. package/dist/safe-js/chunks/chunk-7M2SJPSZ.js +2613 -0
  153. package/dist/safe-js/chunks/chunk-7M2SJPSZ.js.map +7 -0
  154. package/dist/safe-js/chunks/chunk-DC5B3GYM.js +8248 -0
  155. package/dist/safe-js/chunks/chunk-DC5B3GYM.js.map +7 -0
  156. package/dist/safe-js/chunks/chunk-Z3D76J4U.js +30732 -0
  157. package/dist/safe-js/chunks/chunk-Z3D76J4U.js.map +7 -0
  158. package/dist/safe-js/cli.d.ts +36 -0
  159. package/dist/safe-js/cli.js +724 -0
  160. package/dist/safe-js/cli.js.map +7 -0
  161. package/dist/safe-js/core.d.ts +6 -0
  162. package/dist/safe-js/core.js +14 -0
  163. package/dist/safe-js/core.js.map +7 -0
  164. package/dist/safe-js/dump.d.ts +2 -0
  165. package/dist/safe-js/error/format.d.ts +15 -0
  166. package/dist/safe-js/error/shape.d.ts +28 -0
  167. package/dist/safe-js/index.d.ts +56 -0
  168. package/dist/safe-js/index.js +454 -0
  169. package/dist/safe-js/index.js.map +7 -0
  170. package/dist/safe-js/interp/arguments.d.ts +10 -0
  171. package/dist/safe-js/interp/async.d.ts +56 -0
  172. package/dist/safe-js/interp/budget.d.ts +95 -0
  173. package/dist/safe-js/interp/exceptions.d.ts +45 -0
  174. package/dist/safe-js/interp/generator.d.ts +16 -0
  175. package/dist/safe-js/interp/globals/console-json.d.ts +14 -0
  176. package/dist/safe-js/interp/host-bridge.d.ts +29 -0
  177. package/dist/safe-js/interp/host-call.d.ts +130 -0
  178. package/dist/safe-js/interp/interpreter.d.ts +63 -0
  179. package/dist/safe-js/interp/promise-replay.d.ts +70 -0
  180. package/dist/safe-js/interp/regex/compile-guard.d.ts +33 -0
  181. package/dist/safe-js/interp/regex/parse.d.ts +62 -0
  182. package/dist/safe-js/interp/scope.d.ts +43 -0
  183. package/dist/safe-js/interp/values.d.ts +136 -0
  184. package/dist/safe-js/lint/index.d.ts +38 -0
  185. package/dist/safe-js/lint/rules/AS-export-import-meta.d.ts +21 -0
  186. package/dist/safe-js/lint/rules/module-registry.d.ts +33 -0
  187. package/dist/safe-js/lint.d.ts +1 -0
  188. package/dist/safe-js/loader/extract-block.d.ts +10 -0
  189. package/dist/safe-js/loader/find-exported.d.ts +2 -0
  190. package/dist/safe-js/loader/frontmatter.d.ts +5 -0
  191. package/dist/safe-js/migrate.d.ts +33 -0
  192. package/dist/safe-js/migration-file.d.ts +55 -0
  193. package/dist/safe-js/modules/agent.d.ts +132 -0
  194. package/dist/safe-js/modules/env.d.ts +14 -0
  195. package/dist/safe-js/modules/fail.d.ts +6 -0
  196. package/dist/safe-js/modules/fs-config.d.ts +12 -0
  197. package/dist/safe-js/modules/fs.d.ts +82 -0
  198. package/dist/safe-js/modules/harness.d.ts +19 -0
  199. package/dist/safe-js/modules/log.d.ts +16 -0
  200. package/dist/safe-js/modules/mcp-transport.d.ts +26 -0
  201. package/dist/safe-js/modules/mcp.d.ts +63 -0
  202. package/dist/safe-js/modules/metric.d.ts +4 -0
  203. package/dist/safe-js/modules/registry.d.ts +16 -0
  204. package/dist/safe-js/modules/time.d.ts +12 -0
  205. package/dist/safe-js/observability/otel.d.ts +21 -0
  206. package/dist/safe-js/output-stream.d.ts +12 -0
  207. package/dist/safe-js/parse/parse-export.d.ts +36 -0
  208. package/dist/safe-js/parse/parser.d.ts +356 -0
  209. package/dist/safe-js/parse/tokenizer.d.ts +26 -0
  210. package/dist/safe-js/parse.d.ts +4 -0
  211. package/dist/safe-js/random.d.ts +9 -0
  212. package/dist/safe-js/restore.d.ts +26 -0
  213. package/dist/safe-js/run.d.ts +74 -0
  214. package/dist/safe-js/runner/run-harness.d.ts +32 -0
  215. package/dist/safe-js/safe-fs-core.js +130 -0
  216. package/dist/safe-js/safe-fs-core.js.map +7 -0
  217. package/dist/safe-js/safe-fs-node.js +94 -0
  218. package/dist/safe-js/safe-fs-node.js.map +7 -0
  219. package/dist/safe-js/safe-fs.js +94 -0
  220. package/dist/safe-js/safe-fs.js.map +7 -0
  221. package/dist/safe-js/snapshot/arguments.d.ts +17 -0
  222. package/dist/safe-js/snapshot/backend.d.ts +19 -0
  223. package/dist/safe-js/snapshot/dump-format.d.ts +7 -0
  224. package/dist/safe-js/snapshot/dump.d.ts +23 -0
  225. package/dist/safe-js/snapshot/float32array.d.ts +12 -0
  226. package/dist/safe-js/snapshot/migration.d.ts +35 -0
  227. package/dist/safe-js/snapshot/policy.d.ts +49 -0
  228. package/dist/safe-js/snapshot/replay-data.d.ts +71 -0
  229. package/dist/safe-js/snapshot/validation.d.ts +15 -0
  230. package/dist/task-list/backends/gh-issues-client.d.ts +19 -0
  231. package/dist/task-list/backends/gh-issues-sync.d.ts +46 -0
  232. package/dist/task-list/backends/gh-issues.d.ts +21 -0
  233. package/dist/task-list/index.d.ts +9 -0
  234. package/dist/task-list/move.d.ts +2 -0
  235. package/dist/task-list/open.d.ts +5 -0
  236. package/dist/task-list/state-machine.d.ts +16 -0
  237. package/dist/task-list/state.d.ts +29 -0
  238. package/dist/task-list/types.d.ts +206 -0
  239. package/dist/tiny-mcp-client/index.d.ts +662 -0
  240. package/dist/tiny-stdio-mcp-server/content/audio.d.ts +15 -0
  241. package/dist/tiny-stdio-mcp-server/content/convert.d.ts +16 -0
  242. package/dist/tiny-stdio-mcp-server/content/file-type.d.ts +11 -0
  243. package/dist/tiny-stdio-mcp-server/content/file.d.ts +28 -0
  244. package/dist/tiny-stdio-mcp-server/content/image.d.ts +15 -0
  245. package/dist/tiny-stdio-mcp-server/content/index.d.ts +7 -0
  246. package/dist/tiny-stdio-mcp-server/content/mime.d.ts +7 -0
  247. package/dist/tiny-stdio-mcp-server/content/remote.d.ts +5 -0
  248. package/dist/tiny-stdio-mcp-server/index.d.ts +9 -0
  249. package/dist/tiny-stdio-mcp-server/schema.d.ts +20 -0
  250. package/dist/tiny-stdio-mcp-server/server.d.ts +35 -0
  251. package/dist/tiny-stdio-mcp-server/types.d.ts +247 -0
  252. package/dist/toolcraft-design/acp/components.d.ts +19 -0
  253. package/dist/toolcraft-design/acp/index.d.ts +4 -0
  254. package/dist/toolcraft-design/acp/writer.d.ts +13 -0
  255. package/dist/toolcraft-design/components/browser.d.ts +15 -0
  256. package/dist/toolcraft-design/components/catalog.d.ts +26 -0
  257. package/dist/toolcraft-design/components/color.d.ts +31 -0
  258. package/dist/toolcraft-design/components/command-errors.d.ts +18 -0
  259. package/dist/toolcraft-design/components/detail-card.d.ts +22 -0
  260. package/dist/toolcraft-design/components/file-changes.d.ts +16 -0
  261. package/dist/toolcraft-design/components/help-formatter-plain.d.ts +5 -0
  262. package/dist/toolcraft-design/components/help-formatter.d.ts +50 -0
  263. package/dist/toolcraft-design/components/inspector-card.d.ts +21 -0
  264. package/dist/toolcraft-design/components/logger.d.ts +11 -0
  265. package/dist/toolcraft-design/components/resource-browser.d.ts +21 -0
  266. package/dist/toolcraft-design/components/symbols.d.ts +12 -0
  267. package/dist/toolcraft-design/components/table.d.ts +16 -0
  268. package/dist/toolcraft-design/components/template.d.ts +19 -0
  269. package/dist/toolcraft-design/components/text.d.ts +16 -0
  270. package/dist/toolcraft-design/dashboard/buffer.d.ts +25 -0
  271. package/dist/toolcraft-design/dashboard/components/footer.d.ts +8 -0
  272. package/dist/toolcraft-design/dashboard/dashboard.d.ts +20 -0
  273. package/dist/toolcraft-design/dashboard/index.d.ts +8 -0
  274. package/dist/toolcraft-design/dashboard/should-use-dashboard.d.ts +10 -0
  275. package/dist/toolcraft-design/dashboard/snapshot.d.ts +10 -0
  276. package/dist/toolcraft-design/dashboard/terminal.d.ts +37 -0
  277. package/dist/toolcraft-design/dashboard/types.d.ts +38 -0
  278. package/dist/toolcraft-design/explorer/events.d.ts +77 -0
  279. package/dist/toolcraft-design/explorer/index.d.ts +8 -0
  280. package/dist/toolcraft-design/explorer/keymap.d.ts +31 -0
  281. package/dist/toolcraft-design/explorer/runtime.d.ts +2 -0
  282. package/dist/toolcraft-design/explorer/state.d.ts +224 -0
  283. package/dist/toolcraft-design/index.d.ts +62 -0
  284. package/dist/toolcraft-design/internal/output-format.d.ts +6 -0
  285. package/dist/toolcraft-design/internal/strip-ansi.d.ts +1 -0
  286. package/dist/toolcraft-design/internal/theme-detect.d.ts +12 -0
  287. package/dist/toolcraft-design/internal/theme-state.d.ts +12 -0
  288. package/dist/toolcraft-design/prompts/index.d.ts +91 -0
  289. package/dist/toolcraft-design/prompts/interactive/cancel-symbol.d.ts +2 -0
  290. package/dist/toolcraft-design/prompts/interactive/select.d.ts +18 -0
  291. package/dist/toolcraft-design/prompts/primitives/cancel.d.ts +2 -0
  292. package/dist/toolcraft-design/prompts/primitives/intro.d.ts +1 -0
  293. package/dist/toolcraft-design/prompts/primitives/log.d.ts +18 -0
  294. package/dist/toolcraft-design/prompts/primitives/note.d.ts +1 -0
  295. package/dist/toolcraft-design/prompts/primitives/outro.d.ts +1 -0
  296. package/dist/toolcraft-design/prompts/primitives/spinner.d.ts +6 -0
  297. package/dist/toolcraft-design/prompts/theme.d.ts +11 -0
  298. package/dist/toolcraft-design/screen/screen.d.ts +40 -0
  299. package/dist/toolcraft-design/screen/style.d.ts +16 -0
  300. package/dist/toolcraft-design/static/index.d.ts +4 -0
  301. package/dist/toolcraft-design/static/menu.d.ts +11 -0
  302. package/dist/toolcraft-design/static/spinner.d.ts +14 -0
  303. package/dist/toolcraft-design/terminal/driver.d.ts +34 -0
  304. package/dist/toolcraft-design/terminal/input.d.ts +25 -0
  305. package/dist/toolcraft-design/terminal-markdown/ast.d.ts +98 -0
  306. package/dist/toolcraft-design/terminal-markdown/html-renderer.d.ts +7 -0
  307. package/dist/toolcraft-design/terminal-markdown/index.d.ts +12 -0
  308. package/dist/toolcraft-design/terminal-markdown/parser.d.ts +5 -0
  309. package/dist/toolcraft-design/terminal-markdown/plaintext-renderer.d.ts +11 -0
  310. package/dist/toolcraft-design/terminal-markdown/renderer.d.ts +7 -0
  311. package/dist/toolcraft-design/tokens/brand.d.ts +5 -0
  312. package/dist/toolcraft-design/tokens/colors.d.ts +37 -0
  313. package/dist/toolcraft-design/tokens/index.d.ts +6 -0
  314. package/dist/toolcraft-design/tokens/spacing.d.ts +6 -0
  315. package/dist/toolcraft-design/tokens/typography.d.ts +7 -0
  316. package/dist/toolcraft-design/tokens/widths.d.ts +5 -0
  317. package/dist/toolcraft-schema/index.d.ts +184 -0
  318. package/dist/toolcraft-schema/json-schema/index.d.ts +5 -0
  319. package/dist/toolcraft-schema/json-schema/types.d.ts +33 -0
  320. package/dist/toolcraft-schema/json-schema-document.d.ts +14 -0
  321. package/dist/toolcraft-schema/json.d.ts +10 -0
  322. package/dist/toolcraft-schema/oneof.d.ts +15 -0
  323. package/dist/toolcraft-schema/record.d.ts +5 -0
  324. package/dist/toolcraft-schema/union.d.ts +8 -0
  325. package/dist/toolcraft-schema/validate.d.ts +17 -0
  326. package/package.json +89 -0
@@ -0,0 +1,272 @@
1
+ import type { AdapterType } from "./adapters/index.js";
2
+ import type { RuntimeOverrideOptions } from "../agent-harness-tools/index.js";
3
+ import type { StateManager } from "../poe-code-config/index.js";
4
+ import type { AcpMiddleware } from "./acp/middleware.js";
5
+ import type { SpawnEnvironment } from "./environment.js";
6
+ export declare const SPAWN_MODES: readonly ["yolo", "auto", "edit", "read"];
7
+ export type SpawnMode = (typeof SPAWN_MODES)[number];
8
+ /**
9
+ * The single source of truth for the permission mode used when a caller does not
10
+ * ask for one. `auto` uses the provider's unattended safe-action policy.
11
+ * Providers without an auto mode reject the spawn instead of silently selecting
12
+ * a more permissive mode. `yolo` must always be requested explicitly.
13
+ */
14
+ export declare const DEFAULT_SPAWN_MODE: SpawnMode;
15
+ export type SpawnModeConfig = string[] | {
16
+ args?: string[];
17
+ env?: Record<string, string>;
18
+ };
19
+ /**
20
+ * `auto` is optional: it maps to the agent's native ask-style approval mode and
21
+ * must be omitted when the agent has no approval channel in headless runs.
22
+ */
23
+ export type SpawnModesConfig = Record<Exclude<SpawnMode, "auto">, SpawnModeConfig> & {
24
+ auto?: SpawnModeConfig;
25
+ };
26
+ export declare function resolveModeConfig(modeConfig: SpawnModeConfig): {
27
+ args: string[];
28
+ env?: Record<string, string>;
29
+ };
30
+ export declare function resolveAgentModeConfig(config: Pick<CliSpawnConfig, "agentId" | "modes">, mode: SpawnMode | undefined): {
31
+ args: string[];
32
+ env?: Record<string, string>;
33
+ };
34
+ export interface McpSpawnServer {
35
+ command: string;
36
+ args?: string[];
37
+ env?: Record<string, string>;
38
+ /**
39
+ * Whether Codex should automatically approve tools exposed by this explicitly configured server.
40
+ * Defaults to true so headless read/edit spawns can use caller-trusted MCP tools.
41
+ */
42
+ autoApprove?: boolean;
43
+ /**
44
+ * Maximum time in seconds the agent should wait for a single tool call
45
+ * to this MCP server before timing out. Omit to use the agent's default.
46
+ */
47
+ timeout?: number;
48
+ }
49
+ export type McpSpawnConfig = Record<string, McpSpawnServer>;
50
+ export interface McpFileSpec {
51
+ relativePath: string;
52
+ content: (servers: McpSpawnConfig) => Record<string, unknown>;
53
+ }
54
+ export type OtelSpan = {
55
+ setAttribute(key: string, value: unknown): void;
56
+ addEvent(name: string, attrs: Record<string, unknown>): void;
57
+ end(): void;
58
+ };
59
+ export interface OtelSink {
60
+ startSpan(name: string, attrs: Record<string, unknown>): OtelSpan;
61
+ recordException(span: ReturnType<OtelSink["startSpan"]>, error: unknown): void;
62
+ }
63
+ export interface HookBridgeOptions {
64
+ from: string;
65
+ strategy?: "auto" | "symlink" | "transform";
66
+ scope?: "project" | "user" | "merged";
67
+ }
68
+ export interface SpawnOptions {
69
+ prompt: string;
70
+ cwd?: string;
71
+ model?: string;
72
+ mode?: SpawnMode;
73
+ args?: string[];
74
+ mcpServers?: McpSpawnConfig;
75
+ /** Skill references to bridge into the spawned agent for this run. */
76
+ skills?: string[];
77
+ /** Hooks to bridge from another agent configuration for this run. */
78
+ hooks?: HookBridgeOptions;
79
+ /** Resume a prior provider thread/session before sending the prompt. */
80
+ resumeThreadId?: string;
81
+ useStdin?: boolean;
82
+ interactive?: boolean;
83
+ signal?: AbortSignal;
84
+ otelSink?: OtelSink;
85
+ /** Capture native OTLP telemetry emitted by the spawned agent. */
86
+ captureOtel?: boolean;
87
+ /** Include prompt and tool content in native OTLP telemetry. */
88
+ captureOtelContent?: boolean;
89
+ /** Additional environment passed to the spawned agent. */
90
+ env?: SpawnEnvironment;
91
+ middlewares?: AcpMiddleware[];
92
+ tee?: {
93
+ stdout?: {
94
+ write(chunk: string): void;
95
+ };
96
+ stderr?: {
97
+ write(chunk: string): void;
98
+ };
99
+ };
100
+ /**
101
+ * Kill the spawned process after this many milliseconds of inactivity (no stdout data).
102
+ * Resets on every chunk of stdout/stderr received. Disabled when undefined.
103
+ */
104
+ activityTimeoutMs?: number;
105
+ /**
106
+ * Full path for the spawn log file. When set, stdout (and stderr for CLI spawns)
107
+ * are appended to this file, and the absolute path is returned in `SpawnResult.logFile`.
108
+ * Takes precedence over `logDir` + `logFileName`.
109
+ */
110
+ logPath?: string;
111
+ /**
112
+ * Directory for the spawn log file. When set together with `logFileName`, stdout
113
+ * (and stderr for CLI spawns) are appended to `<logDir>/<logFileName>`, and the
114
+ * absolute path is returned in `SpawnResult.logFile`.
115
+ */
116
+ logDir?: string;
117
+ /** Overrides the auto-generated log filename. Must be used together with `logDir`. */
118
+ logFileName?: string;
119
+ /** Per-invocation runtime/runner config overrides. */
120
+ runtime?: RuntimeOverrideOptions["runtime"];
121
+ /** Docker image override for docker runtime. */
122
+ runtimeImage?: string;
123
+ /** Directory used to load runtime config/templates when different from cwd. */
124
+ runtimeConfigCwd?: string;
125
+ /** Run through a detached runtime job when the backend supports it. */
126
+ detach?: boolean;
127
+ /** Mount the local poe-code checkout into the runtime for development. */
128
+ mountPoeCode?: boolean;
129
+ /** Override runner workspace sync behavior. */
130
+ runnerSync?: RuntimeOverrideOptions["runnerSync"];
131
+ }
132
+ export interface SpawnUsage {
133
+ inputTokens: number;
134
+ outputTokens: number;
135
+ cachedTokens?: number;
136
+ costUsd?: number;
137
+ }
138
+ export interface SpawnResult {
139
+ stdout: string;
140
+ stderr: string;
141
+ exitCode: number;
142
+ durationMs?: number;
143
+ threadId?: string;
144
+ usage?: SpawnUsage;
145
+ logFile?: string;
146
+ detached?: {
147
+ jobId: string;
148
+ envId: string;
149
+ };
150
+ }
151
+ export interface AutonomousResult {
152
+ summary?: string;
153
+ log?: string;
154
+ output?: string;
155
+ stdout?: string;
156
+ text?: string;
157
+ logFile?: string;
158
+ toolCalls?: unknown[];
159
+ sessionResult?: {
160
+ toolCalls?: unknown[];
161
+ };
162
+ }
163
+ export interface SpawnLogger {
164
+ dryRun(message: string): void;
165
+ }
166
+ export interface SpawnContext {
167
+ dryRun?: boolean;
168
+ logger?: SpawnLogger;
169
+ homeDir?: string;
170
+ state?: StateManager;
171
+ }
172
+ export interface StdinMode {
173
+ omitPrompt: boolean;
174
+ extraArgs: string[];
175
+ automaticFallback?: boolean;
176
+ }
177
+ export interface InteractiveSpawnConfig {
178
+ defaultArgs: string[];
179
+ defaultArgsPosition?: "beforePrompt" | "afterPrompt";
180
+ promptFlag?: string;
181
+ }
182
+ export interface CliSpawnConfig {
183
+ kind: "cli";
184
+ agentId: string;
185
+ adapter: AdapterType;
186
+ promptFlag?: string;
187
+ defaultArgs: string[];
188
+ defaultArgsPosition?: "beforePrompt" | "afterPrompt";
189
+ modes: SpawnModesConfig;
190
+ stdinMode?: StdinMode;
191
+ modelFlag?: string;
192
+ /**
193
+ * Controls whether the provider prefix is stripped from model IDs before passing to the CLI binary.
194
+ *
195
+ * When `true`: "anthropic/claude-opus-4.6" → "claude-opus-4.6", "openai/gpt-5.2" → "gpt-5.2"
196
+ * When `false`: "anthropic/claude-opus-4.6" stays as-is, "openai/gpt-5.2" stays as-is
197
+ *
198
+ * Most CLI binaries only accept bare model IDs (e.g. `claude --model claude-opus-4.6`),
199
+ * so they need `true`. OpenCode routes through poe and needs the full provider path, so it uses `false`.
200
+ */
201
+ modelStripProviderPrefix: boolean;
202
+ /** Transform model ID before passing to CLI. Runs after provider prefix stripping (if enabled). */
203
+ modelTransform?: (model: string) => string;
204
+ /**
205
+ * Transforms MCP server config into CLI args for this agent.
206
+ * Presence of this function declares spawn-time MCP support.
207
+ */
208
+ mcpArgs?: (servers: McpSpawnConfig) => string[];
209
+ /**
210
+ * Transforms MCP server config into env vars for this agent.
211
+ * Use instead of `mcpArgs` when the agent reads MCP config from the environment.
212
+ */
213
+ mcpEnv?: (servers: McpSpawnConfig) => Record<string, string>;
214
+ mcpFile?: McpFileSpec;
215
+ /**
216
+ * Controls where serialized MCP args are inserted relative to the command.
217
+ *
218
+ * - "beforeCommand": before the prompt/subcommand section (e.g. `codex -c ... exec "prompt"`)
219
+ * - "beforePrompt": after `defaultArgs` but before the prompt/model section
220
+ * - "afterCommand": after `defaultArgs` (default)
221
+ */
222
+ mcpArgsPosition?: "beforeCommand" | "beforePrompt" | "afterCommand";
223
+ /**
224
+ * @deprecated Prefer `mcpArgsPosition`.
225
+ * When true, MCP args are placed before the subcommand (e.g. `codex -c ... exec "prompt"`).
226
+ * When false/undefined, they are placed after defaultArgs (e.g. `claude -p "prompt" --mcp-servers ...`).
227
+ */
228
+ mcpArgsBeforeCommand?: boolean;
229
+ interactive?: InteractiveSpawnConfig;
230
+ resume?: ResumeSpec;
231
+ }
232
+ export interface ResumeSpec {
233
+ /** Args injected into the live spawn for non-interactive resume. */
234
+ args: (threadId: string, cwd: string) => string[];
235
+ /** Position of `args` relative to the prompt token. Default `afterPrompt`. */
236
+ position?: "beforePrompt" | "afterPrompt";
237
+ /**
238
+ * Some CLIs implement resume as a subcommand under the normal prompt command
239
+ * and require command options before the resume token.
240
+ */
241
+ commandOptionsPosition?: "beforeResume";
242
+ /**
243
+ * Optional override for the printed copy-paste resume hint (e.g. an interactive
244
+ * shell command). When omitted, the hint composes binaryName + `args`.
245
+ */
246
+ hintArgs?: (threadId: string, cwd: string) => string[];
247
+ }
248
+ export interface FileSpawnConfig {
249
+ kind: "file";
250
+ agentId: string;
251
+ launchCommand?: string;
252
+ launchArgs?: string[];
253
+ }
254
+ export interface AcpSpawnConfig {
255
+ kind: "acp";
256
+ agentId: string;
257
+ /** Args passed to the agent binary to start its ACP server (e.g. ["acp"]). */
258
+ acpArgs: string[] | ((options: {
259
+ model?: string;
260
+ mode?: SpawnMode;
261
+ mcpServers?: McpSpawnConfig;
262
+ }) => string[]);
263
+ /** Environment variables required by the ACP server process. */
264
+ env?: Record<string, string>;
265
+ /** Whether to skip the ACP authenticate step (workaround for servers that advertise but don't implement auth). */
266
+ skipAuth?: boolean;
267
+ /** Whether MCP servers may be forwarded through ACP sessions. Defaults to true. */
268
+ supportsMcpServers?: boolean;
269
+ /** MCP server env serializer, same as CliSpawnConfig. */
270
+ mcpEnv?: (servers: McpSpawnConfig) => Record<string, string>;
271
+ }
272
+ export type SpawnConfig = CliSpawnConfig | FileSpawnConfig | AcpSpawnConfig;
@@ -0,0 +1,2 @@
1
+ import type { CreateSecretStoreInput, CreateSecretStoreResult } from "./types.js";
2
+ export declare function createSecretStore(input: CreateSecretStoreInput): CreateSecretStoreResult;
@@ -0,0 +1,47 @@
1
+ import type { SecretStore } from "./types.js";
2
+ export interface MachineIdentity {
3
+ hostname: string;
4
+ username: string;
5
+ }
6
+ export interface EncryptedFileStoreFileSystem {
7
+ readFile(path: string, encoding: BufferEncoding): Promise<string>;
8
+ writeFile(path: string, data: string | NodeJS.ArrayBufferView, options?: {
9
+ encoding?: BufferEncoding;
10
+ flag?: string;
11
+ mode?: number;
12
+ }): Promise<void>;
13
+ mkdir(path: string, options?: {
14
+ recursive?: boolean;
15
+ }): Promise<void | string | undefined>;
16
+ rename(oldPath: string, newPath: string): Promise<void>;
17
+ lstat(path: string): Promise<{
18
+ isSymbolicLink(): boolean;
19
+ }>;
20
+ unlink(path: string): Promise<void>;
21
+ chmod(path: string, mode: number): Promise<void>;
22
+ }
23
+ export interface EncryptedFileStoreInput {
24
+ fs?: EncryptedFileStoreFileSystem;
25
+ filePath?: string;
26
+ salt: string;
27
+ defaultDirectory?: string;
28
+ defaultFileName?: string;
29
+ getMachineIdentity?: () => MachineIdentity | Promise<MachineIdentity>;
30
+ getHomeDirectory?: () => string;
31
+ getRandomBytes?: (size: number) => Buffer;
32
+ }
33
+ export declare class EncryptedFileStore implements SecretStore {
34
+ private readonly fs;
35
+ private readonly filePath;
36
+ private readonly symbolicLinkCheckStartPath;
37
+ private readonly salt;
38
+ private readonly getMachineIdentity;
39
+ private readonly getRandomBytes;
40
+ private keyPromise;
41
+ constructor(input: EncryptedFileStoreInput);
42
+ get(): Promise<string | null>;
43
+ set(value: string): Promise<void>;
44
+ delete(): Promise<void>;
45
+ private assertCredentialPathHasNoSymbolicLinks;
46
+ private getEncryptionKey;
47
+ }
@@ -0,0 +1,7 @@
1
+ export { createSecretStore } from "./create-secret-store.js";
2
+ export { EncryptedFileStore } from "./encrypted-file-store.js";
3
+ export { KeychainStore } from "./keychain-store.js";
4
+ export { key, MigratingSecretStore } from "./provider-store.js";
5
+ export type { SecretStore, StoreBackend, CreateSecretStoreInput, CreateSecretStoreResult } from "./types.js";
6
+ export type { MachineIdentity, EncryptedFileStoreInput, EncryptedFileStoreFileSystem } from "./encrypted-file-store.js";
7
+ export type { KeychainStoreInput, KeychainCommandRunner, KeychainCommandResult, KeychainCommandOptions } from "./keychain-store.js";
@@ -0,0 +1,25 @@
1
+ import type { SecretStore } from "./types.js";
2
+ export interface KeychainCommandResult {
3
+ stdout: string;
4
+ stderr: string;
5
+ exitCode: number;
6
+ }
7
+ export interface KeychainCommandOptions {
8
+ stdin?: string;
9
+ }
10
+ export type KeychainCommandRunner = (command: string, args: string[], options?: KeychainCommandOptions) => Promise<KeychainCommandResult>;
11
+ export interface KeychainStoreInput {
12
+ runCommand?: KeychainCommandRunner;
13
+ service: string;
14
+ account: string;
15
+ }
16
+ export declare class KeychainStore implements SecretStore {
17
+ private readonly runCommand;
18
+ private readonly service;
19
+ private readonly account;
20
+ constructor(input: KeychainStoreInput);
21
+ get(): Promise<string | null>;
22
+ set(value: string): Promise<void>;
23
+ delete(): Promise<void>;
24
+ private executeSecurityCommand;
25
+ }
@@ -0,0 +1,14 @@
1
+ import type { SecretStore } from "./types.js";
2
+ export declare function key(providerId: string): string;
3
+ export declare class MigratingSecretStore implements SecretStore {
4
+ private readonly store;
5
+ private readonly legacyStore;
6
+ private pendingMutation;
7
+ constructor(store: SecretStore, legacyStore?: SecretStore | null);
8
+ get(options?: {
9
+ readOnly?: boolean;
10
+ }): Promise<string | null>;
11
+ set(value: string): Promise<void>;
12
+ delete(): Promise<void>;
13
+ private mutate;
14
+ }
@@ -0,0 +1,22 @@
1
+ import type { EncryptedFileStoreInput } from "./encrypted-file-store.js";
2
+ import type { KeychainStoreInput } from "./keychain-store.js";
3
+ export interface SecretStore {
4
+ get(options?: {
5
+ readOnly?: boolean;
6
+ }): Promise<string | null>;
7
+ set(value: string): Promise<void>;
8
+ delete(): Promise<void>;
9
+ }
10
+ export type StoreBackend = "file" | "keychain";
11
+ export interface CreateSecretStoreInput {
12
+ backend?: StoreBackend;
13
+ env?: NodeJS.ProcessEnv;
14
+ platform?: NodeJS.Platform;
15
+ backendEnvVar?: string;
16
+ fileStore?: EncryptedFileStoreInput;
17
+ keychainStore?: KeychainStoreInput;
18
+ }
19
+ export interface CreateSecretStoreResult {
20
+ store: SecretStore;
21
+ backend: StoreBackend;
22
+ }
@@ -0,0 +1,7 @@
1
+ import type { Mutation, MutationContext, MutationResult, MutationOptions } from "../types.js";
2
+ /**
3
+ * Execute an array of mutations in order.
4
+ *
5
+ * All dependencies must be injected - no defaults, no globals.
6
+ */
7
+ export declare function runMutations(mutations: Mutation[], context: MutationContext, options?: MutationOptions): Promise<MutationResult>;
@@ -0,0 +1,18 @@
1
+ import type { FileSystem } from "./types.js";
2
+ /**
3
+ * Check if an error is a "file not found" (ENOENT) error.
4
+ */
5
+ export declare function isNotFound(error: unknown): boolean;
6
+ /**
7
+ * Read a file if it exists, returning null if not found.
8
+ */
9
+ export declare function readFileIfExists(fs: FileSystem, target: string): Promise<string | null>;
10
+ /**
11
+ * Check if a path exists (file or directory).
12
+ */
13
+ export declare function pathExists(fs: FileSystem, target: string): Promise<boolean>;
14
+ /**
15
+ * Create an ISO timestamp safe for use in filenames.
16
+ * Replaces colons and dots with dashes.
17
+ */
18
+ export declare function createTimestamp(): string;
@@ -0,0 +1,8 @@
1
+ export { configMutation } from "./mutations/config-mutation.js";
2
+ export { fileMutation } from "./mutations/file-mutation.js";
3
+ export { templateMutation } from "./mutations/template-mutation.js";
4
+ export { runMutations } from "./execution/run-mutations.js";
5
+ export { renderTemplate, type TemplateVariables } from "./template/render.js";
6
+ export { isNotFound, readFileIfExists, pathExists, createTimestamp } from "./fs-utils.js";
7
+ export type { ConfigObject, ConfigValue, Mutation, MutationContext, MutationResult, MutationObservers, MutationDetails, MutationOutcome, FileSystem, TemplateLoader, ConfigFormat, PathMapper } from "./types.js";
8
+ export { isConfigObject } from "./types.js";
@@ -0,0 +1,47 @@
1
+ import type { ConfigMergeMutation, ConfigPruneMutation, ConfigTransformMutation, ConfigObject, ValueResolver, MutationOptions } from "../types.js";
2
+ export interface MergeOptions {
3
+ /** Target file path (must start with ~) */
4
+ target: ValueResolver<string>;
5
+ /** Value to merge into the config file */
6
+ value: ValueResolver<ConfigObject>;
7
+ /** Optional explicit format override */
8
+ format?: "json" | "toml" | "yaml";
9
+ /** Optional prune by prefix before merging (TOML) */
10
+ pruneByPrefix?: Record<string, string>;
11
+ /** Optional human-readable label for logging */
12
+ label?: string;
13
+ }
14
+ export interface PruneOptions {
15
+ /** Target file path (must start with ~) */
16
+ target: ValueResolver<string>;
17
+ /** Shape to prune from the config file */
18
+ shape: ValueResolver<ConfigObject>;
19
+ /** Optional explicit format override */
20
+ format?: "json" | "toml" | "yaml";
21
+ /** Optional guard - only prune if predicate returns true */
22
+ onlyIf?: (doc: ConfigObject, ctx: MutationOptions) => boolean;
23
+ /** Optional human-readable label for logging */
24
+ label?: string;
25
+ }
26
+ export interface TransformOptions {
27
+ /** Target file path (must start with ~) */
28
+ target: ValueResolver<string>;
29
+ /** Optional explicit format override */
30
+ format?: "json" | "toml" | "yaml";
31
+ /** Transform function - receives parsed content, returns transformed content */
32
+ transform: (content: ConfigObject, ctx: MutationOptions) => {
33
+ content: ConfigObject | null;
34
+ changed: boolean;
35
+ };
36
+ /** Optional human-readable label for logging */
37
+ label?: string;
38
+ }
39
+ declare function merge(options: MergeOptions): ConfigMergeMutation;
40
+ declare function prune(options: PruneOptions): ConfigPruneMutation;
41
+ declare function transform(options: TransformOptions): ConfigTransformMutation;
42
+ export declare const configMutation: {
43
+ merge: typeof merge;
44
+ prune: typeof prune;
45
+ transform: typeof transform;
46
+ };
47
+ export {};
@@ -0,0 +1,62 @@
1
+ import type { EnsureDirectoryMutation, RemoveDirectoryMutation, RemoveFileMutation, ChmodMutation, BackupMutation, RestoreBackupMutation, ValueResolver } from "../types.js";
2
+ export interface EnsureDirectoryOptions {
3
+ /** Directory path (must start with ~) */
4
+ path: ValueResolver<string>;
5
+ /** Optional human-readable label for logging */
6
+ label?: string;
7
+ }
8
+ export interface RemoveOptions {
9
+ /** Target file path (must start with ~) */
10
+ target: ValueResolver<string>;
11
+ /** Only remove if file is empty/whitespace */
12
+ whenEmpty?: boolean;
13
+ /** Only remove if content matches regex */
14
+ whenContentMatches?: RegExp;
15
+ /** Optional human-readable label for logging */
16
+ label?: string;
17
+ }
18
+ export interface RemoveDirectoryOptions {
19
+ /** Directory path (must start with ~) */
20
+ path: ValueResolver<string>;
21
+ /** Remove directory even when not empty */
22
+ force?: boolean;
23
+ /** Optional human-readable label for logging */
24
+ label?: string;
25
+ }
26
+ export interface ChmodOptions {
27
+ /** Target file path (must start with ~) */
28
+ target: ValueResolver<string>;
29
+ /** File permission mode (e.g., 0o755) */
30
+ mode: number;
31
+ /** Optional human-readable label for logging */
32
+ label?: string;
33
+ }
34
+ export interface BackupOptions {
35
+ /** Target file path to backup (must start with ~) */
36
+ target: ValueResolver<string>;
37
+ /** Keep the first baseline only, including an originally missing target. */
38
+ once?: boolean;
39
+ /** Optional human-readable label for logging */
40
+ label?: string;
41
+ }
42
+ export interface RestoreBackupOptions {
43
+ /** Target file path whose latest generated backup should be restored. */
44
+ target: ValueResolver<string>;
45
+ /** Optional human-readable label for logging */
46
+ label?: string;
47
+ }
48
+ declare function ensureDirectory(options: EnsureDirectoryOptions): EnsureDirectoryMutation;
49
+ declare function remove(options: RemoveOptions): RemoveFileMutation;
50
+ declare function removeDirectory(options: RemoveDirectoryOptions): RemoveDirectoryMutation;
51
+ declare function chmod(options: ChmodOptions): ChmodMutation;
52
+ declare function backup(options: BackupOptions): BackupMutation;
53
+ declare function restoreBackup(options: RestoreBackupOptions): RestoreBackupMutation;
54
+ export declare const fileMutation: {
55
+ ensureDirectory: typeof ensureDirectory;
56
+ remove: typeof remove;
57
+ removeDirectory: typeof removeDirectory;
58
+ chmod: typeof chmod;
59
+ backup: typeof backup;
60
+ restoreBackup: typeof restoreBackup;
61
+ };
62
+ export {};
@@ -0,0 +1,40 @@
1
+ import type { TemplateWriteMutation, TemplateMergeTomlMutation, TemplateMergeJsonMutation, ConfigObject, ValueResolver } from "../types.js";
2
+ export interface WriteOptions {
3
+ /** Target file path (must start with ~) */
4
+ target: ValueResolver<string>;
5
+ /** Template ID to load via template loader */
6
+ templateId: string;
7
+ /** Context to pass to renderTemplate() */
8
+ context?: ValueResolver<ConfigObject>;
9
+ /** Optional human-readable label for logging */
10
+ label?: string;
11
+ }
12
+ export interface MergeTomlOptions {
13
+ /** Target TOML file path (must start with ~) */
14
+ target: ValueResolver<string>;
15
+ /** Template ID to load via template loader */
16
+ templateId: string;
17
+ /** Context to pass to renderTemplate() */
18
+ context?: ValueResolver<ConfigObject>;
19
+ /** Optional human-readable label for logging */
20
+ label?: string;
21
+ }
22
+ export interface MergeJsonOptions {
23
+ /** Target JSON file path (must start with ~) */
24
+ target: ValueResolver<string>;
25
+ /** Template ID to load via template loader */
26
+ templateId: string;
27
+ /** Context to pass to renderTemplate() */
28
+ context?: ValueResolver<ConfigObject>;
29
+ /** Optional human-readable label for logging */
30
+ label?: string;
31
+ }
32
+ declare function write(options: WriteOptions): TemplateWriteMutation;
33
+ declare function mergeToml(options: MergeTomlOptions): TemplateMergeTomlMutation;
34
+ declare function mergeJson(options: MergeJsonOptions): TemplateMergeJsonMutation;
35
+ export declare const templateMutation: {
36
+ write: typeof write;
37
+ mergeToml: typeof mergeToml;
38
+ mergeJson: typeof mergeJson;
39
+ };
40
+ export {};
@@ -0,0 +1,6 @@
1
+ export type TemplateVariables = Record<string, string | number | boolean | string[]>;
2
+ /**
3
+ * Render a mustache template with the given variables.
4
+ * HTML escaping is disabled.
5
+ */
6
+ export declare function renderTemplate(template: string, variables: TemplateVariables): string;