@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,12 @@
1
+ export interface ThemeConfig {
2
+ brand: string;
3
+ label: string;
4
+ }
5
+ export declare function configureTheme(patch: {
6
+ brand?: string;
7
+ label?: string;
8
+ }): void;
9
+ export declare function getThemeConfig(): ThemeConfig;
10
+ export declare function getThemeRevision(): number;
11
+ export declare function isThemeBrandConfigured(): boolean;
12
+ export declare function resetTheme(): void;
@@ -0,0 +1,91 @@
1
+ import type { CANCEL } from "./interactive/cancel-symbol.js";
2
+ import { type SelectOption } from "./interactive/select.js";
3
+ import { cancel, isCancel } from "./primitives/cancel.js";
4
+ import { intro } from "./primitives/intro.js";
5
+ import { log } from "./primitives/log.js";
6
+ import { note } from "./primitives/note.js";
7
+ import { outro } from "./primitives/outro.js";
8
+ import { spinner } from "./primitives/spinner.js";
9
+ export { isCancel, cancel, log };
10
+ export { intro, outro, note, spinner };
11
+ export declare function introPlain(title: string): void;
12
+ export interface SelectOptions<Value> {
13
+ message: string;
14
+ options: Array<SelectOption<Value>>;
15
+ initialValue?: Value;
16
+ maxItems?: number;
17
+ signal?: AbortSignal;
18
+ input?: NodeJS.ReadableStream;
19
+ output?: NodeJS.WritableStream;
20
+ }
21
+ export declare function select<Value>(opts: SelectOptions<Value>): Promise<Value | typeof CANCEL>;
22
+ export interface MultiselectOptions<Value> {
23
+ message: string;
24
+ options: Array<SelectOption<Value>>;
25
+ initialValues?: Value[];
26
+ required?: boolean;
27
+ maxItems?: number;
28
+ signal?: AbortSignal;
29
+ input?: NodeJS.ReadableStream;
30
+ output?: NodeJS.WritableStream;
31
+ }
32
+ /**
33
+ * Prompts the user to select one or more values from a list.
34
+ *
35
+ * Returns the selected values as an array, or a cancellation symbol if the
36
+ * user cancels. Use `isCancel` to check for cancellation.
37
+ *
38
+ * @example
39
+ * const result = await multiselect({
40
+ * message: "Pick workflows to run",
41
+ * options: [{ label: "Fix Vulnerabilities", value: "fix-vulnerabilities" }],
42
+ * required: true
43
+ * });
44
+ * if (!isCancel(result)) {
45
+ * // result is Value[]
46
+ * }
47
+ */
48
+ export declare function multiselect<Value>(opts: MultiselectOptions<Value>): Promise<Value[] | typeof CANCEL>;
49
+ export interface TextOptions {
50
+ message: string;
51
+ placeholder?: string;
52
+ defaultValue?: string;
53
+ initialValue?: string;
54
+ validate?: (value: string) => string | Error | undefined;
55
+ signal?: AbortSignal;
56
+ input?: NodeJS.ReadableStream;
57
+ output?: NodeJS.WritableStream;
58
+ }
59
+ export declare function text(opts: TextOptions): Promise<string | typeof CANCEL>;
60
+ export interface ConfirmOptions {
61
+ message: string;
62
+ initialValue?: boolean;
63
+ signal?: AbortSignal;
64
+ input?: NodeJS.ReadableStream;
65
+ output?: NodeJS.WritableStream;
66
+ }
67
+ export declare function confirm(opts: ConfirmOptions): Promise<boolean | typeof CANCEL>;
68
+ export declare class PromptCancelledError extends Error {
69
+ constructor(message?: string);
70
+ }
71
+ export declare function confirmOrCancel(opts: ConfirmOptions): Promise<boolean>;
72
+ export interface PasswordOptions {
73
+ message: string;
74
+ validate?: (value: string) => string | Error | undefined;
75
+ signal?: AbortSignal;
76
+ input?: NodeJS.ReadableStream;
77
+ output?: NodeJS.WritableStream;
78
+ }
79
+ export declare function password(opts: PasswordOptions): Promise<string | typeof CANCEL>;
80
+ export type SpinnerOptions = {
81
+ start: (message?: string) => void;
82
+ stop: (message?: string, code?: number) => void;
83
+ message: (message?: string) => void;
84
+ };
85
+ export interface WithSpinnerOptions<T> {
86
+ message: string | (() => string);
87
+ fn: () => Promise<T>;
88
+ stopMessage?: (result: T) => string;
89
+ subtext?: (result: T) => string | undefined;
90
+ }
91
+ export declare function withSpinner<T>(options: WithSpinnerOptions<T>): Promise<T>;
@@ -0,0 +1,2 @@
1
+ export declare const CANCEL: unique symbol;
2
+ export declare function isCancel(value: unknown): value is typeof CANCEL;
@@ -0,0 +1,18 @@
1
+ import { CANCEL } from "./cancel-symbol.js";
2
+ export interface SelectOption<Value> {
3
+ value: Value;
4
+ label: string;
5
+ hint?: string;
6
+ disabled?: boolean;
7
+ }
8
+ export interface SelectOptions<Value> {
9
+ message: string;
10
+ options: Array<SelectOption<Value>>;
11
+ initialValue?: Value;
12
+ maxItems?: number;
13
+ signal?: AbortSignal;
14
+ input?: NodeJS.ReadableStream;
15
+ output?: NodeJS.WritableStream;
16
+ }
17
+ export declare function findNonDisabled<Value>(start: number, direction: 1 | -1, options: Array<SelectOption<Value>>): number;
18
+ export declare function selectPrompt<Value>(opts: SelectOptions<Value>): Promise<Value | typeof CANCEL>;
@@ -0,0 +1,2 @@
1
+ export { isCancel } from "../interactive/cancel-symbol.js";
2
+ export declare function cancel(msg?: string): void;
@@ -0,0 +1 @@
1
+ export declare function intro(title: string): void;
@@ -0,0 +1,18 @@
1
+ export interface LogMessageOptions {
2
+ symbol?: string;
3
+ secondarySymbol?: string;
4
+ spacing?: number;
5
+ withGuide?: boolean;
6
+ }
7
+ export declare function message(msg: string, options?: LogMessageOptions): void;
8
+ export declare function info(msg: string): void;
9
+ export declare function success(msg: string): void;
10
+ export declare function warn(msg: string): void;
11
+ export declare function error(msg: string): void;
12
+ export declare const log: {
13
+ info: typeof info;
14
+ success: typeof success;
15
+ message: typeof message;
16
+ warn: typeof warn;
17
+ error: typeof error;
18
+ };
@@ -0,0 +1 @@
1
+ export declare function note(message: string, title?: string): void;
@@ -0,0 +1 @@
1
+ export declare function outro(message: string): void;
@@ -0,0 +1,6 @@
1
+ export interface SpinnerOptions {
2
+ start: (message?: string) => void;
3
+ stop: (message?: string, code?: number) => void;
4
+ message: (message?: string) => void;
5
+ }
6
+ export declare function spinner(): SpinnerOptions;
@@ -0,0 +1,11 @@
1
+ export declare const promptTheme: {
2
+ readonly symbols: {
3
+ readonly initial: "◆";
4
+ readonly active: "◆";
5
+ readonly inactive: "○";
6
+ readonly success: "◇";
7
+ };
8
+ readonly style: {
9
+ readonly accentColor: string;
10
+ };
11
+ };
@@ -0,0 +1,40 @@
1
+ import type { CellStyle, Rect } from "../dashboard/types.js";
2
+ import { type PackedStyle } from "./style.js";
3
+ export interface Cell {
4
+ ch: string;
5
+ width: 1 | 2;
6
+ style: PackedStyle;
7
+ fg: number;
8
+ bg: number;
9
+ }
10
+ export interface ScreenSize {
11
+ cols: number;
12
+ rows: number;
13
+ }
14
+ export interface ScreenSurface {
15
+ readonly width: number;
16
+ readonly height: number;
17
+ put(x: number, y: number, text: string, style?: CellStyle | PackedStyle): void;
18
+ clearRect(rect: Rect, style?: CellStyle | PackedStyle): void;
19
+ }
20
+ export declare class Screen {
21
+ private cols;
22
+ private rows;
23
+ private front;
24
+ private back;
25
+ private outputStyle;
26
+ private readonly colors;
27
+ constructor(size?: ScreenSize, options?: {
28
+ colors?: boolean;
29
+ });
30
+ get width(): number;
31
+ get height(): number;
32
+ resize(size: ScreenSize): void;
33
+ cell(x: number, y: number, ch: string, style?: PackedStyle): void;
34
+ text(x: number, y: number, text: string, style?: PackedStyle): void;
35
+ put(x: number, y: number, text: string, style?: CellStyle | PackedStyle): void;
36
+ clearRect(rect: Rect, style?: CellStyle | PackedStyle): void;
37
+ flush(): string;
38
+ private index;
39
+ private inBounds;
40
+ }
@@ -0,0 +1,16 @@
1
+ export declare const STYLE_BOLD: number;
2
+ export declare const STYLE_DIM: number;
3
+ export declare const STYLE_UNDERLINE: number;
4
+ export declare const STYLE_INVERSE: number;
5
+ export type PackedStyle = number;
6
+ export declare function packStyle(style: {
7
+ bold?: boolean;
8
+ dim?: boolean;
9
+ underline?: boolean;
10
+ inverse?: boolean;
11
+ fg?: number;
12
+ bg?: number;
13
+ }): PackedStyle;
14
+ export declare function foreground(style: PackedStyle): number;
15
+ export declare function background(style: PackedStyle): number;
16
+ export declare function styleToSgrDelta(previous: PackedStyle, next: PackedStyle, colors?: boolean): string;
@@ -0,0 +1,4 @@
1
+ export { SPINNER_FRAMES, renderSpinnerFrame, renderSpinnerStopped } from "./spinner.js";
2
+ export type { SpinnerFrameOptions, SpinnerStoppedOptions } from "./spinner.js";
3
+ export { renderMenu } from "./menu.js";
4
+ export type { MenuOption, RenderMenuOptions } from "./menu.js";
@@ -0,0 +1,11 @@
1
+ export interface MenuOption {
2
+ label: string;
3
+ value: string;
4
+ hint?: string;
5
+ }
6
+ export interface RenderMenuOptions {
7
+ message: string;
8
+ options: MenuOption[];
9
+ selectedIndex?: number;
10
+ }
11
+ export declare function renderMenu(opts: RenderMenuOptions): string;
@@ -0,0 +1,14 @@
1
+ export declare const SPINNER_FRAMES: readonly ["◒", "◐", "◓", "◑"];
2
+ export interface SpinnerFrameOptions {
3
+ frame?: number;
4
+ message: string;
5
+ timer?: string;
6
+ }
7
+ export declare function renderSpinnerFrame(options: SpinnerFrameOptions): string;
8
+ export interface SpinnerStoppedOptions {
9
+ message: string;
10
+ code?: number;
11
+ timer?: string;
12
+ subtext?: string;
13
+ }
14
+ export declare function renderSpinnerStopped(options: SpinnerStoppedOptions): string;
@@ -0,0 +1,34 @@
1
+ import { type TerminalInputEvent } from "./input.js";
2
+ export interface Size {
3
+ cols: number;
4
+ rows: number;
5
+ }
6
+ export interface TerminalDriver {
7
+ start(): void;
8
+ stop(): void;
9
+ onEvent(fn: (event: TerminalInputEvent) => void): () => void;
10
+ onResize(fn: (size: Size) => void): () => void;
11
+ getSize(): Size;
12
+ writeFrame(ansi: string): void;
13
+ }
14
+ interface InputStream {
15
+ setRawMode?: (enabled: boolean) => void;
16
+ resume(): void;
17
+ pause(): void;
18
+ on(event: "data", listener: (chunk: Buffer | string) => void): unknown;
19
+ off(event: "data", listener: (chunk: Buffer | string) => void): unknown;
20
+ }
21
+ interface OutputStream {
22
+ columns?: number;
23
+ rows?: number;
24
+ write(value: string): boolean;
25
+ on(event: "resize", listener: () => void): unknown;
26
+ off(event: "resize", listener: () => void): unknown;
27
+ }
28
+ export declare function createTerminalDriver(options?: {
29
+ input?: InputStream;
30
+ output?: OutputStream;
31
+ escTimeoutMs?: number;
32
+ mouse?: boolean;
33
+ }): TerminalDriver;
34
+ export type { TerminalInputEvent } from "./input.js";
@@ -0,0 +1,25 @@
1
+ export type TerminalInputEvent = {
2
+ type: "key";
3
+ name: string;
4
+ ch?: string;
5
+ ctrl: boolean;
6
+ alt: boolean;
7
+ shift: boolean;
8
+ } | {
9
+ type: "paste";
10
+ text: string;
11
+ } | {
12
+ type: "wheel";
13
+ direction: "up" | "down";
14
+ x: number;
15
+ y: number;
16
+ };
17
+ export interface InputParser {
18
+ feed(chunk: Buffer): TerminalInputEvent[];
19
+ flush(): TerminalInputEvent[];
20
+ destroy(): void;
21
+ }
22
+ export declare function createInputParser(options?: {
23
+ escTimeoutMs?: number;
24
+ onEvent?: (event: TerminalInputEvent) => void;
25
+ }): InputParser;
@@ -0,0 +1,98 @@
1
+ export type MdRange = {
2
+ start: number;
3
+ end: number;
4
+ };
5
+ export type CodeTokenKind = "anchor" | "at-rule" | "attribute" | "boolean" | "color" | "command" | "comment" | "decorator" | "directive" | "flag" | "function" | "identifier" | "important" | "invalid" | "key" | "keyword" | "label" | "null" | "number" | "operator" | "parameter" | "plain" | "property" | "punctuation" | "regex" | "selector" | "string" | "tag" | "template" | "type" | "variable";
6
+ export type CodeToken = {
7
+ kind: CodeTokenKind;
8
+ value: string;
9
+ };
10
+ type MdNodeWithRange = {
11
+ range?: MdRange;
12
+ };
13
+ export type MdNode = MdNodeWithRange & ({
14
+ type: "root";
15
+ children: MdNode[];
16
+ } | {
17
+ type: "heading";
18
+ depth: 1 | 2 | 3 | 4 | 5 | 6;
19
+ children: MdNode[];
20
+ } | {
21
+ type: "paragraph";
22
+ children: MdNode[];
23
+ } | {
24
+ type: "blockquote";
25
+ children: MdNode[];
26
+ } | {
27
+ type: "code";
28
+ lang?: string;
29
+ meta?: string;
30
+ value: string;
31
+ tokens?: CodeToken[];
32
+ } | {
33
+ type: "list";
34
+ ordered: boolean;
35
+ start?: number;
36
+ children: MdNode[];
37
+ } | {
38
+ type: "listItem";
39
+ checked?: boolean;
40
+ children: MdNode[];
41
+ } | {
42
+ type: "thematicBreak";
43
+ } | {
44
+ type: "table";
45
+ align: Array<"left" | "center" | "right" | null>;
46
+ children: MdNode[];
47
+ } | {
48
+ type: "tableRow";
49
+ children: MdNode[];
50
+ } | {
51
+ type: "tableCell";
52
+ children: MdNode[];
53
+ } | {
54
+ type: "html";
55
+ value: string;
56
+ } | {
57
+ type: "text";
58
+ value: string;
59
+ } | {
60
+ type: "emphasis";
61
+ children: MdNode[];
62
+ } | {
63
+ type: "strong";
64
+ children: MdNode[];
65
+ } | {
66
+ type: "strikethrough";
67
+ children: MdNode[];
68
+ } | {
69
+ type: "inlineCode";
70
+ value: string;
71
+ } | {
72
+ type: "link";
73
+ url: string;
74
+ title?: string;
75
+ children: MdNode[];
76
+ } | {
77
+ type: "image";
78
+ url: string;
79
+ alt: string;
80
+ title?: string;
81
+ } | {
82
+ type: "break";
83
+ } | {
84
+ type: "frontmatter";
85
+ data: Record<string, unknown>;
86
+ } | {
87
+ type: "alert";
88
+ kind: "NOTE" | "TIP" | "IMPORTANT" | "WARNING" | "CAUTION";
89
+ children: MdNode[];
90
+ } | {
91
+ type: "footnoteDefinition";
92
+ label: string;
93
+ children: MdNode[];
94
+ } | {
95
+ type: "footnoteReference";
96
+ label: string;
97
+ });
98
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { MdNode } from "./ast.js";
2
+ export interface HtmlRenderOptions {
3
+ showFrontmatter?: boolean;
4
+ allowRawHtml?: boolean;
5
+ syntaxHighlight?: boolean;
6
+ }
7
+ export declare function renderHtml(ast: MdNode, options?: HtmlRenderOptions): string;
@@ -0,0 +1,12 @@
1
+ import { type HtmlRenderOptions } from "./html-renderer.js";
2
+ import { type RenderOptions } from "./renderer.js";
3
+ export type { CodeToken, CodeTokenKind, MdNode } from "./ast.js";
4
+ export { renderHtml } from "./html-renderer.js";
5
+ export type { HtmlRenderOptions } from "./html-renderer.js";
6
+ export { renderPlaintext, renderMarkdownPlaintext } from "./plaintext-renderer.js";
7
+ export type { PlaintextRenderOptions } from "./plaintext-renderer.js";
8
+ export { parse } from "./parser.js";
9
+ export { render } from "./renderer.js";
10
+ export type { RenderOptions } from "./renderer.js";
11
+ export declare function renderMarkdown(markdown: string, options?: RenderOptions): string;
12
+ export declare function renderMarkdownHtml(markdown: string, options?: HtmlRenderOptions): string;
@@ -0,0 +1,5 @@
1
+ import type { MdNode } from "./ast.js";
2
+ export declare function parse(markdown: string): {
3
+ frontmatter?: Record<string, unknown>;
4
+ ast: MdNode;
5
+ };
@@ -0,0 +1,11 @@
1
+ import type { MdNode } from "./ast.js";
2
+ export interface PlaintextRenderOptions {
3
+ announceHeadings?: boolean;
4
+ announceCode?: boolean;
5
+ announceAlerts?: boolean;
6
+ showLinks?: boolean;
7
+ expandLinks?: boolean;
8
+ includeFrontmatter?: boolean;
9
+ }
10
+ export declare function renderPlaintext(ast: MdNode, options?: PlaintextRenderOptions): string;
11
+ export declare function renderMarkdownPlaintext(markdown: string, options?: PlaintextRenderOptions): string;
@@ -0,0 +1,7 @@
1
+ import type { MdNode } from "./ast.js";
2
+ export interface RenderOptions {
3
+ width?: number;
4
+ showFrontmatter?: boolean;
5
+ syntaxHighlight?: boolean;
6
+ }
7
+ export declare function render(ast: MdNode, options?: RenderOptions): string;
@@ -0,0 +1,5 @@
1
+ export interface Brand {
2
+ name: string;
3
+ primary: string;
4
+ }
5
+ export declare const brands: Record<string, Brand>;
@@ -0,0 +1,37 @@
1
+ import { type Brand } from "./brand.js";
2
+ export declare const brand: string;
3
+ export type ThemeName = "dark" | "light";
4
+ export interface ThemeCellStyle {
5
+ fg?: string;
6
+ bold?: boolean;
7
+ dim?: boolean;
8
+ underline?: boolean;
9
+ }
10
+ export interface ThemeCellStyles {
11
+ accent: ThemeCellStyle;
12
+ muted: ThemeCellStyle;
13
+ success: ThemeCellStyle;
14
+ warning: ThemeCellStyle;
15
+ error: ThemeCellStyle;
16
+ info: ThemeCellStyle;
17
+ }
18
+ export interface ThemePalette {
19
+ header: (text: string) => string;
20
+ divider: (text: string) => string;
21
+ prompt: (text: string) => string;
22
+ number: (text: string) => string;
23
+ intro: (text: string) => string;
24
+ resolvedSymbol: string;
25
+ errorSymbol: string;
26
+ accent: (text: string) => string;
27
+ muted: (text: string) => string;
28
+ success: (text: string) => string;
29
+ warning: (text: string) => string;
30
+ error: (text: string) => string;
31
+ info: (text: string) => string;
32
+ badge: (text: string) => string;
33
+ styles: ThemeCellStyles;
34
+ }
35
+ export declare function createPalette(activeBrand: Brand, mode: ThemeName): ThemePalette;
36
+ export declare const dark: ThemePalette;
37
+ export declare const light: ThemePalette;
@@ -0,0 +1,6 @@
1
+ export * from "./colors.js";
2
+ export { brands } from "./brand.js";
3
+ export type { Brand } from "./brand.js";
4
+ export { spacing } from "./spacing.js";
5
+ export { typography } from "./typography.js";
6
+ export { widths } from "./widths.js";
@@ -0,0 +1,6 @@
1
+ export declare const spacing: {
2
+ readonly sm: 1;
3
+ readonly md: 2;
4
+ readonly lg: 4;
5
+ readonly xl: 8;
6
+ };
@@ -0,0 +1,7 @@
1
+ export declare const typography: {
2
+ readonly bold: (text: string) => string;
3
+ readonly dim: (text: string) => string;
4
+ readonly italic: (text: string) => string;
5
+ readonly underline: (text: string) => string;
6
+ readonly strikethrough: (text: string) => string;
7
+ };
@@ -0,0 +1,5 @@
1
+ export declare const widths: {
2
+ readonly header: 60;
3
+ readonly helpColumn: 24;
4
+ readonly maxLine: 80;
5
+ };