@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,37 @@
1
+ import { type RunnerScope, type ResolvedConfig, type StateManager } from "../poe-code-config/index.js";
2
+ import { selectExecutionEnv, type OpenSpec } from "./execution-env.js";
3
+ export type RuntimeOverrideOptions = {
4
+ runtime?: "host" | "docker";
5
+ runtimeImage?: string;
6
+ detach?: boolean;
7
+ mountPoeCode?: boolean;
8
+ runnerSync?: RunnerScope["sync"];
9
+ };
10
+ export declare function resolvePoeCommandExecution(input: {
11
+ cwd: string;
12
+ runtimeConfigCwd?: string;
13
+ env: Record<string, string>;
14
+ argv: string[];
15
+ displayArgv?: string[];
16
+ tool: string;
17
+ runtime?: RuntimeOverrideOptions;
18
+ context?: {
19
+ homeDir?: string;
20
+ state?: StateManager;
21
+ };
22
+ openSpec?: Partial<Pick<OpenSpec, "execution" | "shellSpec">>;
23
+ }): {
24
+ factory: ReturnType<typeof selectExecutionEnv>;
25
+ openSpec: OpenSpec;
26
+ detach: boolean;
27
+ state: StateManager;
28
+ };
29
+ /** Raised when a requested runner capability is not offered by the resolved execution env. */
30
+ export declare class UnsupportedRuntimeCapabilityError extends Error {
31
+ constructor(message: string);
32
+ }
33
+ export interface LoadedRuntimeConfig extends ResolvedConfig {
34
+ /** Raw merged runtime scope preserved for re-parsing when overrides change the type. */
35
+ rawScope: Record<string, unknown>;
36
+ }
37
+ export declare function applyRuntimeOverrides(config: ResolvedConfig | LoadedRuntimeConfig, overrides: RuntimeOverrideOptions | undefined, cwd?: string): ResolvedConfig;
@@ -0,0 +1,17 @@
1
+ export interface ResolveRunLogDirOptions {
2
+ planPath: string;
3
+ runner: string;
4
+ homeDir: string;
5
+ }
6
+ export interface RunLogFileSystem {
7
+ mkdir(path: string, options?: {
8
+ recursive?: boolean;
9
+ }): Promise<void>;
10
+ realpath?(path: string): Promise<string>;
11
+ }
12
+ export declare function resolveRunLogDir(options: ResolveRunLogDirOptions): string;
13
+ export declare function ensureSafeRunLogDir(options: ResolveRunLogDirOptions & {
14
+ fs?: RunLogFileSystem;
15
+ }): Promise<string>;
16
+ export declare function slugifyPlanPath(planPath: string): string;
17
+ export declare function makeRunLogFileName(role: string, date?: Date): string;
@@ -0,0 +1,33 @@
1
+ import type { StateManager } from "../poe-code-config/index.js";
2
+ import type { DownloadResult, ExecutionEnvFactory, OpenSpec } from "./execution-env.js";
3
+ export declare function runPoeCommand(opts: {
4
+ factory: ExecutionEnvFactory;
5
+ openSpec: OpenSpec;
6
+ detach: boolean;
7
+ state: StateManager;
8
+ signal?: AbortSignal;
9
+ }): Promise<{
10
+ kind: "sync";
11
+ exitCode: number;
12
+ download: DownloadResult;
13
+ stdout?: string;
14
+ stderr?: string;
15
+ } | {
16
+ kind: "detached";
17
+ jobId: string;
18
+ envId: string;
19
+ }>;
20
+ export interface PoeCommandSession {
21
+ run(openSpec: OpenSpec, signal?: AbortSignal): Promise<{
22
+ kind: "sync";
23
+ exitCode: number;
24
+ download: DownloadResult;
25
+ stdout?: string;
26
+ stderr?: string;
27
+ }>;
28
+ close(): Promise<void>;
29
+ }
30
+ export declare function createPoeCommandSession(opts: {
31
+ factory: ExecutionEnvFactory;
32
+ state: StateManager;
33
+ }): PoeCommandSession;
@@ -0,0 +1,33 @@
1
+ import { type RunAgentFn } from "./hooks.js";
2
+ export interface WorkflowFileStat {
3
+ isFile(): boolean;
4
+ isDirectory(): boolean;
5
+ mtimeMs: number;
6
+ }
7
+ export interface WorkflowFileSystem {
8
+ readFile(path: string, encoding: BufferEncoding): Promise<string>;
9
+ mkdir(path: string, options?: {
10
+ recursive?: boolean;
11
+ }): Promise<void>;
12
+ rmdir(path: string): Promise<void>;
13
+ stat(path: string): Promise<WorkflowFileStat>;
14
+ }
15
+ export interface DocumentWorkflowOptions {
16
+ cwd: string;
17
+ homeDir: string;
18
+ docPath: string;
19
+ fs: WorkflowFileSystem;
20
+ runAgent: RunAgentFn;
21
+ readConfig: (content: string) => {
22
+ frontmatter: any;
23
+ body: string;
24
+ } | Promise<{
25
+ frontmatter: any;
26
+ body: string;
27
+ }>;
28
+ signal?: AbortSignal;
29
+ onIterationStart?: (iteration: number) => void | Promise<void>;
30
+ onIterationEnd?: (iteration: number, result: IterationResult) => void | Promise<void>;
31
+ }
32
+ export type IterationResult = "completed" | "nothing_to_run" | "failed";
33
+ export declare function runDocumentWorkflow(options: DocumentWorkflowOptions): Promise<void>;
@@ -0,0 +1,18 @@
1
+ type Select = typeof import("../toolcraft-design/index.js").select;
2
+ type IsCancel = typeof import("../toolcraft-design/index.js").isCancel;
3
+ export interface ResolveLoopAgentInput {
4
+ providedAgent?: string;
5
+ configuredDefaultAgent?: string | null;
6
+ frontmatterAgent?: string | string[];
7
+ assumeYes: boolean;
8
+ fallbackAgent: string;
9
+ message: string;
10
+ select: Select;
11
+ isCancel: IsCancel;
12
+ }
13
+ export declare function resolveLoopAgent(input: ResolveLoopAgentInput): Promise<{
14
+ agent: string;
15
+ } | {
16
+ cancelled: true;
17
+ }>;
18
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type DocumentWorkflowOptions } from "./runner.js";
2
+ export interface DocumentWorkflowSequenceOptions extends Omit<DocumentWorkflowOptions, "docPath"> {
3
+ docPaths: string[];
4
+ stopOnFailure?: boolean;
5
+ onSequenceProgress?: (index: number, total: number, docPath: string) => void;
6
+ }
7
+ export declare function runDocumentWorkflowSequence(options: DocumentWorkflowSequenceOptions): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function skillPlanConfigSection(subcommand: string): string;
@@ -0,0 +1,22 @@
1
+ import { type RunAgentFn, type RunAgentHooks, type WorkflowMode } from "./hooks.js";
2
+ import { type WorkflowParticipant } from "./participant.js";
3
+ export interface WorkflowStage {
4
+ id: string;
5
+ participant: string;
6
+ prompt?: string;
7
+ mode?: WorkflowMode;
8
+ skills?: string[];
9
+ hooks?: RunAgentHooks;
10
+ onFailure?: "stop" | "continue";
11
+ }
12
+ export interface StageContext {
13
+ cwd: string;
14
+ participants: Record<string, WorkflowParticipant>;
15
+ runAgent: RunAgentFn;
16
+ signal?: AbortSignal;
17
+ iteration: number;
18
+ }
19
+ export declare function runWorkflowStage(stage: WorkflowStage, context: StageContext): Promise<{
20
+ success: boolean;
21
+ error?: Error;
22
+ }>;
@@ -0,0 +1,3 @@
1
+ export { downloadWorkspace, uploadWorkspace } from "../process-runner/index.js";
2
+ export type { WorkspaceDownloadOptions, WorkspaceTransferDirent, WorkspaceTransferEnv, WorkspaceTransferFileSystem, WorkspaceTransferOptions, WorkspaceTransferRunnerOptions, WorkspaceTransferStats } from "../process-runner/index.js";
3
+ export type { DownloadResult, UploadResult } from "./execution-env.js";
@@ -0,0 +1,38 @@
1
+ import type { SpawnMode, SpawnUsage } from "../types.js";
2
+ import type { AcpEvent } from "./types.js";
3
+ export interface SessionToolCall {
4
+ id?: string;
5
+ kind?: string;
6
+ title?: string;
7
+ input?: unknown;
8
+ path?: string;
9
+ }
10
+ export interface SessionResult {
11
+ output: string;
12
+ messages: string[];
13
+ toolCalls: SessionToolCall[];
14
+ }
15
+ export interface SpawnContext {
16
+ sessionId: string;
17
+ agent: string;
18
+ logPath?: string;
19
+ logDir?: string;
20
+ logFileName?: string;
21
+ logContent?: boolean;
22
+ events: AcpEvent[];
23
+ usage: SpawnUsage;
24
+ eventStream?: AsyncIterable<AcpEvent>;
25
+ sessionResult?: SessionResult;
26
+ threadId?: string;
27
+ prompt?: string;
28
+ model?: string;
29
+ mode?: SpawnMode;
30
+ cwd?: string;
31
+ startedAt?: Date;
32
+ logFile?: string;
33
+ /** Reason the spawn log could not be written, when logging failed. */
34
+ logError?: string;
35
+ metadata?: Record<string, unknown>;
36
+ }
37
+ export type AcpMiddleware = (ctx: SpawnContext, next: () => Promise<void>) => Promise<void>;
38
+ export declare function applyMiddlewares(middlewares: AcpMiddleware[], ctx: SpawnContext): Promise<void>;
@@ -0,0 +1,180 @@
1
+ /**
2
+ * ACP-related types used by `agent-spawn`.
3
+ *
4
+ * We intentionally keep these types *structurally compatible* with the official ACP schema (but do not
5
+ * depend on ACP packages) so we can move closer to full ACP compliance later without rewriting adapters.
6
+ *
7
+ * This file contains two related shapes:
8
+ * - `SessionUpdate` types (`tool_call`, `tool_call_update`, etc.) which mirror the official ACP schema.
9
+ * - `AcpEvent` (our internal rendering stream), which is *not* full ACP and uses a simplified vocabulary
10
+ * for clearer semantics in the UI.
11
+ *
12
+ * Note: The official ACP docs/spec live at:
13
+ * - https://agentclientprotocol.com/
14
+ * - https://github.com/agentclientprotocol/agent-client-protocol
15
+ *
16
+ * TODO: Consider full ACP alignment (JSON-RPC, official discriminators, `execute` tool kind) if we need
17
+ * interop with Zed/JetBrains/other ACP clients.
18
+ */
19
+ export type ToolKind = "read" | "edit" | "delete" | "move" | "search" | "execute" | "think" | "fetch" | "switch_mode" | "other";
20
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
21
+ export type ToolCallStatus = "pending" | "in_progress" | "completed" | "failed" | "cancelled";
22
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
23
+ export interface ContentChunk {
24
+ type: "text";
25
+ text: string;
26
+ }
27
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
28
+ export interface AgentMessageChunk {
29
+ sessionUpdate: "agent_message_chunk";
30
+ content: ContentChunk;
31
+ }
32
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
33
+ export interface AgentThoughtChunk {
34
+ sessionUpdate: "agent_thought_chunk";
35
+ content: ContentChunk;
36
+ }
37
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
38
+ export interface ToolCall {
39
+ sessionUpdate: "tool_call";
40
+ toolCallId: string;
41
+ title: string;
42
+ content?: ToolCallContent[];
43
+ kind?: ToolKind;
44
+ locations?: ToolCallLocation[];
45
+ status?: ToolCallStatus;
46
+ rawInput?: unknown;
47
+ rawOutput?: unknown;
48
+ _meta?: Record<string, unknown>;
49
+ }
50
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
51
+ export type ToolCallContent = {
52
+ type: "text";
53
+ text: string;
54
+ } | {
55
+ type: "image";
56
+ mimeType: string;
57
+ data: string;
58
+ };
59
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
60
+ export interface ToolCallLocation {
61
+ path: string;
62
+ lineNumber?: number | null;
63
+ _meta?: Record<string, unknown>;
64
+ }
65
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
66
+ export interface ToolCallUpdate {
67
+ sessionUpdate: "tool_call_update";
68
+ toolCallId: string;
69
+ kind?: ToolKind;
70
+ status?: ToolCallStatus | null;
71
+ rawOutput?: unknown;
72
+ rawInput?: unknown;
73
+ content?: ToolCallContent[] | null;
74
+ locations?: ToolCallLocation[] | null;
75
+ title?: string | null;
76
+ _meta?: Record<string, unknown>;
77
+ }
78
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
79
+ export interface UsageUpdate {
80
+ sessionUpdate: "usage_update";
81
+ used: number;
82
+ size: number;
83
+ cost?: {
84
+ amount: number;
85
+ currency: string;
86
+ };
87
+ _meta?: Record<string, unknown>;
88
+ }
89
+ /** ACP-compatible type - @see https://agentclientprotocol.com/ - no package dependency, structural compatibility only */
90
+ export type SessionUpdate = AgentMessageChunk | AgentThoughtChunk | ToolCall | ToolCallUpdate | UsageUpdate;
91
+ export interface SessionStartEvent {
92
+ event: "session_start";
93
+ threadId?: string;
94
+ _meta?: Record<string, unknown>;
95
+ }
96
+ export interface AgentMessageEvent {
97
+ event: "agent_message";
98
+ text: string;
99
+ _meta?: Record<string, unknown>;
100
+ }
101
+ /**
102
+ * Internal event representing the start of a tool invocation.
103
+ *
104
+ * ACP models tools via `tool_call` and subsequent `tool_call_update` messages. We instead emit a clearer
105
+ * pair of events (`tool_start` / `tool_complete`) because our renderer wants an explicit lifecycle with
106
+ * unambiguous "start" vs "done" semantics.
107
+ *
108
+ * @see https://agentclientprotocol.com/protocol/tool-calls - we use simplified internal format
109
+ */
110
+ export interface ToolStartEvent {
111
+ event: "tool_start";
112
+ /**
113
+ * Tool kind for rendering/logging.
114
+ *
115
+ * Note: our internal stream uses `"exec"` instead of ACP `"execute"` for brevity. This is intentionally
116
+ * not typed as `ToolKind` to avoid implying full ACP compliance.
117
+ */
118
+ kind: string;
119
+ title: string;
120
+ id?: string;
121
+ _meta?: Record<string, unknown>;
122
+ }
123
+ /**
124
+ * Internal event representing completion of a tool invocation.
125
+ *
126
+ * This corresponds conceptually to an ACP `tool_call_update` whose status is terminal (`completed`/`failed`),
127
+ * but is intentionally simpler for UI consumption.
128
+ */
129
+ export interface ToolCompleteEvent {
130
+ event: "tool_complete";
131
+ kind: string;
132
+ path: string;
133
+ id?: string;
134
+ _meta?: Record<string, unknown>;
135
+ }
136
+ export interface ReasoningEvent {
137
+ event: "reasoning";
138
+ text: string;
139
+ _meta?: Record<string, unknown>;
140
+ }
141
+ export interface UsageEvent {
142
+ event: "usage";
143
+ inputTokens: number;
144
+ outputTokens: number;
145
+ cachedTokens?: number;
146
+ costUsd?: number;
147
+ costSource?: "reported" | "estimated";
148
+ _meta?: Record<string, unknown>;
149
+ }
150
+ export interface ErrorEvent {
151
+ event: "error";
152
+ message: string;
153
+ stack?: string;
154
+ _meta?: Record<string, unknown>;
155
+ }
156
+ /** Emitted when auto mode rejects an agent permission request, so the rejection is visible as the cause. */
157
+ export interface PermissionRejectedEvent {
158
+ event: "permission_rejected";
159
+ title: string;
160
+ _meta?: Record<string, unknown>;
161
+ }
162
+ export interface SpawnResultEvent {
163
+ event: "spawn_result";
164
+ exitCode: number;
165
+ threadId?: string;
166
+ usage?: {
167
+ inputTokens: number;
168
+ outputTokens: number;
169
+ cachedTokens?: number;
170
+ costUsd?: number;
171
+ costSource?: "reported" | "estimated";
172
+ };
173
+ protocolVersion?: number;
174
+ _meta?: Record<string, unknown>;
175
+ }
176
+ export type KnownAcpEvent = SessionStartEvent | AgentMessageEvent | ToolStartEvent | ToolCompleteEvent | ReasoningEvent | UsageEvent | ErrorEvent | PermissionRejectedEvent | SpawnResultEvent;
177
+ export type UnknownAcpEvent = {
178
+ event: string;
179
+ } & Record<string, unknown>;
180
+ export type AcpEvent = KnownAcpEvent | UnknownAcpEvent;
@@ -0,0 +1,3 @@
1
+ import type { AcpEvent } from "../acp/types.js";
2
+ export declare const TOOL_KIND_MAP: Record<string, string>;
3
+ export declare function adaptClaude(lines: AsyncIterable<string>): AsyncGenerator<AcpEvent>;
@@ -0,0 +1,2 @@
1
+ import type { AcpEvent } from "../acp/types.js";
2
+ export declare function adaptCodex(lines: AsyncIterable<string>): AsyncGenerator<AcpEvent>;
@@ -0,0 +1,2 @@
1
+ import type { AcpEvent } from "../acp/types.js";
2
+ export declare function adaptCursor(lines: AsyncIterable<string>): AsyncGenerator<AcpEvent>;
@@ -0,0 +1,12 @@
1
+ import type { AcpEvent, SessionUpdate } from "../acp/types.js";
2
+ export { adaptCodex } from "./codex.js";
3
+ export { adaptClaude } from "./claude.js";
4
+ export { adaptKimi } from "./kimi.js";
5
+ export { adaptNative } from "./native.js";
6
+ export { adaptOpenCode } from "./opencode.js";
7
+ export { adaptPi } from "./pi.js";
8
+ export { adaptCursor } from "./cursor.js";
9
+ export type AdapterType = "codex" | "claude" | "cursor" | "kimi" | "native" | "opencode" | "pi";
10
+ export type AdapterOutput = AcpEvent | SessionUpdate;
11
+ export type Adapter = (lines: AsyncIterable<string>) => AsyncGenerator<AdapterOutput>;
12
+ export declare function getAdapter(type: AdapterType): Adapter;
@@ -0,0 +1,2 @@
1
+ import type { AcpEvent } from "../acp/types.js";
2
+ export declare function adaptKimi(lines: AsyncIterable<string>): AsyncGenerator<AcpEvent>;
@@ -0,0 +1,5 @@
1
+ type AcpEvent = {
2
+ event: string;
3
+ } & Record<string, unknown>;
4
+ export declare function adaptNative(lines: AsyncIterable<string>): AsyncGenerator<AcpEvent>;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { AcpEvent } from "../acp/types.js";
2
+ export declare function adaptOpenCode(lines: AsyncIterable<string>): AsyncGenerator<AcpEvent>;
@@ -0,0 +1,2 @@
1
+ import type { AcpEvent } from "../acp/types.js";
2
+ export declare function adaptPi(lines: AsyncIterable<string>): AsyncGenerator<AcpEvent>;
@@ -0,0 +1,2 @@
1
+ export type SpawnEnvironment = Record<string, string | undefined>;
2
+ export declare function mergeSpawnEnvironment(...sources: Array<SpawnEnvironment | NodeJS.ProcessEnv | undefined>): Record<string, string>;
@@ -0,0 +1,30 @@
1
+ import type { SpawnHandle } from "./retry.js";
2
+ export type SpawnParallelTuple<TService, TOptions> = readonly [
3
+ service: TService,
4
+ options: TOptions
5
+ ];
6
+ export type SpawnParallelThunk<TResult extends {
7
+ exitCode: number;
8
+ }> = (signal?: AbortSignal) => SpawnHandle<TResult>;
9
+ export type SpawnParallelCall<TService, TOptions, TResult extends {
10
+ exitCode: number;
11
+ }> = SpawnParallelTuple<TService, TOptions> | SpawnParallelThunk<TResult>;
12
+ export type SpawnParallelOptions = {
13
+ check?: boolean;
14
+ maxConcurrent?: number;
15
+ failFast?: boolean;
16
+ signal?: AbortSignal;
17
+ };
18
+ export declare class SpawnParallelError<TResult extends {
19
+ exitCode: number;
20
+ }> extends Error {
21
+ readonly index: number;
22
+ readonly result: TResult;
23
+ readonly results: Array<TResult | undefined>;
24
+ constructor(index: number, result: TResult, results: Array<TResult | undefined>);
25
+ }
26
+ export declare function createSpawnParallel<TService, TOptions extends {
27
+ signal?: AbortSignal;
28
+ }, TResult extends {
29
+ exitCode: number;
30
+ }>(spawnOnce: (service: TService, options: TOptions) => SpawnHandle<TResult>): (calls: Array<SpawnParallelCall<TService, TOptions, TResult>>, options?: SpawnParallelOptions) => Promise<TResult[]>;
@@ -0,0 +1,26 @@
1
+ import type { AcpEvent } from "./acp/types.js";
2
+ export type SpawnRetryOptions<TResult extends {
3
+ exitCode: number;
4
+ }> = {
5
+ maxAttempts: number;
6
+ backoffMs: number;
7
+ isRetryable?: (result: TResult) => boolean;
8
+ };
9
+ export type SpawnHandle<TResult> = {
10
+ events: AsyncIterable<AcpEvent>;
11
+ result: Promise<TResult>;
12
+ };
13
+ export type SpawnRetryFunction<TOptions extends {
14
+ signal?: AbortSignal;
15
+ }, TResult extends {
16
+ exitCode: number;
17
+ }> = (service: string, options: TOptions, retryOptions: SpawnRetryOptions<TResult>) => SpawnHandle<TResult>;
18
+ export declare function createSpawnRetry<TOptions extends {
19
+ signal?: AbortSignal;
20
+ }, TResult extends {
21
+ exitCode: number;
22
+ }>(spawnOnce: (service: string, options: TOptions) => SpawnHandle<TResult>): SpawnRetryFunction<TOptions, TResult>;
23
+ export declare function defaultIsRetryable(result: {
24
+ exitCode: number;
25
+ }): boolean;
26
+ export declare function calculateBackoffMs(baseBackoffMs: number, completedAttempt: number): number;