terminal-pilot 0.0.30 → 0.0.31
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.
- package/dist/cli.js +1375 -435
- package/dist/cli.js.map +4 -4
- package/dist/commands/close-session.js +485 -6
- package/dist/commands/close-session.js.map +4 -4
- package/dist/commands/create-session.js +485 -6
- package/dist/commands/create-session.js.map +4 -4
- package/dist/commands/fill.js +485 -6
- package/dist/commands/fill.js.map +4 -4
- package/dist/commands/get-session.js +485 -6
- package/dist/commands/get-session.js.map +4 -4
- package/dist/commands/index.js +626 -44
- package/dist/commands/index.js.map +4 -4
- package/dist/commands/install.js +622 -40
- package/dist/commands/install.js.map +4 -4
- package/dist/commands/installer.js +68 -17
- package/dist/commands/installer.js.map +4 -4
- package/dist/commands/list-sessions.js +485 -6
- package/dist/commands/list-sessions.js.map +4 -4
- package/dist/commands/press-key.js +485 -6
- package/dist/commands/press-key.js.map +4 -4
- package/dist/commands/read-history.js +485 -6
- package/dist/commands/read-history.js.map +4 -4
- package/dist/commands/read-screen.js +485 -6
- package/dist/commands/read-screen.js.map +4 -4
- package/dist/commands/resize.js +485 -6
- package/dist/commands/resize.js.map +4 -4
- package/dist/commands/screenshot.js +485 -6
- package/dist/commands/screenshot.js.map +4 -4
- package/dist/commands/send-signal.js +485 -6
- package/dist/commands/send-signal.js.map +4 -4
- package/dist/commands/type.js +485 -6
- package/dist/commands/type.js.map +4 -4
- package/dist/commands/uninstall.js +550 -20
- package/dist/commands/uninstall.js.map +4 -4
- package/dist/commands/wait-for-exit.js +485 -6
- package/dist/commands/wait-for-exit.js.map +4 -4
- package/dist/commands/wait-for.js +485 -6
- package/dist/commands/wait-for.js.map +4 -4
- package/dist/testing/cli-repl.js +1375 -435
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +1385 -445
- package/dist/testing/qa-cli.js.map +4 -4
- package/node_modules/@poe-code/agent-defs/README.md +35 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/claude-code.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/claude-code.js +21 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.js +18 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/codex.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/codex.js +25 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/cursor.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/cursor.js +15 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/gemini-cli.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/gemini-cli.js +16 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/goose.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/goose.js +16 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/index.d.ts +9 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/index.js +9 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/kimi.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/kimi.js +16 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/opencode.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/opencode.js +20 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.d.ts +2 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.js +14 -0
- package/node_modules/@poe-code/agent-defs/dist/index.d.ts +5 -0
- package/node_modules/@poe-code/agent-defs/dist/index.js +3 -0
- package/node_modules/@poe-code/agent-defs/dist/registry.d.ts +3 -0
- package/node_modules/@poe-code/agent-defs/dist/registry.js +45 -0
- package/node_modules/@poe-code/agent-defs/dist/specifier.d.ts +7 -0
- package/node_modules/@poe-code/agent-defs/dist/specifier.js +40 -0
- package/node_modules/@poe-code/agent-defs/dist/types.d.ts +28 -0
- package/node_modules/@poe-code/agent-defs/dist/types.js +1 -0
- package/node_modules/@poe-code/agent-defs/package.json +20 -0
- package/node_modules/@poe-code/agent-skill-config/dist/apply.js +2 -1
- package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.d.ts +1 -0
- package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.js +37 -18
- package/node_modules/@poe-code/agent-skill-config/dist/resolve-skill-reference.js +8 -4
- package/node_modules/@poe-code/agent-skill-config/package.json +1 -5
- package/node_modules/@poe-code/config-mutations/README.md +55 -0
- package/node_modules/@poe-code/config-mutations/dist/error-codes.d.ts +1 -0
- package/node_modules/@poe-code/config-mutations/dist/error-codes.js +6 -0
- package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.d.ts +6 -0
- package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +829 -0
- package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.d.ts +17 -0
- package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.js +64 -0
- package/node_modules/@poe-code/config-mutations/dist/execution/run-mutations.d.ts +7 -0
- package/node_modules/@poe-code/config-mutations/dist/execution/run-mutations.js +39 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/index.d.ts +13 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/index.js +49 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/json.d.ts +32 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/json.js +171 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/object.d.ts +4 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/object.js +27 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/toml.d.ts +2 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/toml.js +75 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/yaml.d.ts +2 -0
- package/node_modules/@poe-code/config-mutations/dist/formats/yaml.js +76 -0
- package/node_modules/@poe-code/config-mutations/dist/fs-utils.d.ts +18 -0
- package/node_modules/@poe-code/config-mutations/dist/fs-utils.js +43 -0
- package/node_modules/@poe-code/config-mutations/dist/index.d.ts +8 -0
- package/node_modules/@poe-code/config-mutations/dist/index.js +8 -0
- package/node_modules/@poe-code/config-mutations/dist/mutations/config-mutation.d.ts +47 -0
- package/node_modules/@poe-code/config-mutations/dist/mutations/config-mutation.js +34 -0
- package/node_modules/@poe-code/config-mutations/dist/mutations/file-mutation.d.ts +62 -0
- package/node_modules/@poe-code/config-mutations/dist/mutations/file-mutation.js +55 -0
- package/node_modules/@poe-code/config-mutations/dist/mutations/template-mutation.d.ts +40 -0
- package/node_modules/@poe-code/config-mutations/dist/mutations/template-mutation.js +32 -0
- package/node_modules/@poe-code/config-mutations/dist/template/render.d.ts +6 -0
- package/node_modules/@poe-code/config-mutations/dist/template/render.js +8 -0
- package/node_modules/@poe-code/config-mutations/dist/testing/format-utils.d.ts +7 -0
- package/node_modules/@poe-code/config-mutations/dist/testing/format-utils.js +21 -0
- package/node_modules/@poe-code/config-mutations/dist/testing/index.d.ts +3 -0
- package/node_modules/@poe-code/config-mutations/dist/testing/index.js +2 -0
- package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.d.ts +25 -0
- package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.js +194 -0
- package/node_modules/@poe-code/config-mutations/dist/types.d.ts +168 -0
- package/node_modules/@poe-code/config-mutations/dist/types.js +6 -0
- package/node_modules/@poe-code/config-mutations/package.json +29 -0
- package/node_modules/@poe-code/frontmatter/README.md +35 -0
- package/node_modules/@poe-code/frontmatter/dist/fences.d.ts +25 -0
- package/node_modules/@poe-code/frontmatter/dist/fences.js +100 -0
- package/node_modules/@poe-code/frontmatter/dist/index.d.ts +3 -0
- package/node_modules/@poe-code/frontmatter/dist/index.js +3 -0
- package/node_modules/@poe-code/frontmatter/dist/parse.d.ts +20 -0
- package/node_modules/@poe-code/frontmatter/dist/parse.js +209 -0
- package/node_modules/@poe-code/frontmatter/dist/stringify.d.ts +1 -0
- package/node_modules/@poe-code/frontmatter/dist/stringify.js +48 -0
- package/node_modules/@poe-code/frontmatter/package.json +25 -0
- package/node_modules/toolcraft-design/README.md +160 -0
- package/node_modules/toolcraft-design/dist/acp/components.d.ts +12 -0
- package/node_modules/toolcraft-design/dist/acp/components.js +137 -0
- package/node_modules/toolcraft-design/dist/acp/index.d.ts +3 -0
- package/node_modules/toolcraft-design/dist/acp/index.js +2 -0
- package/node_modules/toolcraft-design/dist/acp/writer.d.ts +13 -0
- package/node_modules/toolcraft-design/dist/acp/writer.js +21 -0
- package/node_modules/toolcraft-design/dist/components/browser.d.ts +15 -0
- package/node_modules/toolcraft-design/dist/components/browser.js +31 -0
- package/node_modules/toolcraft-design/dist/components/catalog.d.ts +26 -0
- package/node_modules/toolcraft-design/dist/components/catalog.js +95 -0
- package/node_modules/toolcraft-design/dist/components/color.d.ts +31 -0
- package/node_modules/toolcraft-design/dist/components/color.js +102 -0
- package/node_modules/toolcraft-design/dist/components/command-errors.d.ts +16 -0
- package/node_modules/toolcraft-design/dist/components/command-errors.js +23 -0
- package/node_modules/toolcraft-design/dist/components/detail-card.d.ts +22 -0
- package/node_modules/toolcraft-design/dist/components/detail-card.js +45 -0
- package/node_modules/toolcraft-design/dist/components/help-formatter-plain.d.ts +5 -0
- package/node_modules/toolcraft-design/dist/components/help-formatter-plain.js +132 -0
- package/node_modules/toolcraft-design/dist/components/help-formatter.d.ts +33 -0
- package/node_modules/toolcraft-design/dist/components/help-formatter.js +213 -0
- package/node_modules/toolcraft-design/dist/components/index.d.ts +16 -0
- package/node_modules/toolcraft-design/dist/components/index.js +10 -0
- package/node_modules/toolcraft-design/dist/components/logger.d.ts +11 -0
- package/node_modules/toolcraft-design/dist/components/logger.js +60 -0
- package/node_modules/toolcraft-design/dist/components/symbols.d.ts +12 -0
- package/node_modules/toolcraft-design/dist/components/symbols.js +71 -0
- package/node_modules/toolcraft-design/dist/components/table.d.ts +15 -0
- package/node_modules/toolcraft-design/dist/components/table.js +302 -0
- package/node_modules/toolcraft-design/dist/components/template.d.ts +10 -0
- package/node_modules/toolcraft-design/dist/components/template.js +437 -0
- package/node_modules/toolcraft-design/dist/components/text.d.ts +16 -0
- package/node_modules/toolcraft-design/dist/components/text.js +145 -0
- package/node_modules/toolcraft-design/dist/dashboard/ansi.d.ts +18 -0
- package/node_modules/toolcraft-design/dist/dashboard/ansi.js +343 -0
- package/node_modules/toolcraft-design/dist/dashboard/buffer.d.ts +25 -0
- package/node_modules/toolcraft-design/dist/dashboard/buffer.js +219 -0
- package/node_modules/toolcraft-design/dist/dashboard/components/border.d.ts +9 -0
- package/node_modules/toolcraft-design/dist/dashboard/components/border.js +123 -0
- package/node_modules/toolcraft-design/dist/dashboard/components/footer.d.ts +8 -0
- package/node_modules/toolcraft-design/dist/dashboard/components/footer.js +56 -0
- package/node_modules/toolcraft-design/dist/dashboard/components/output-pane.d.ts +12 -0
- package/node_modules/toolcraft-design/dist/dashboard/components/output-pane.js +268 -0
- package/node_modules/toolcraft-design/dist/dashboard/components/stats-pane.d.ts +7 -0
- package/node_modules/toolcraft-design/dist/dashboard/components/stats-pane.js +107 -0
- package/node_modules/toolcraft-design/dist/dashboard/dashboard.d.ts +20 -0
- package/node_modules/toolcraft-design/dist/dashboard/dashboard.js +167 -0
- package/node_modules/toolcraft-design/dist/dashboard/demo.d.ts +13 -0
- package/node_modules/toolcraft-design/dist/dashboard/demo.js +145 -0
- package/node_modules/toolcraft-design/dist/dashboard/index.d.ts +8 -0
- package/node_modules/toolcraft-design/dist/dashboard/index.js +4 -0
- package/node_modules/toolcraft-design/dist/dashboard/keymap.d.ts +8 -0
- package/node_modules/toolcraft-design/dist/dashboard/keymap.js +233 -0
- package/node_modules/toolcraft-design/dist/dashboard/layout.d.ts +25 -0
- package/node_modules/toolcraft-design/dist/dashboard/layout.js +79 -0
- package/node_modules/toolcraft-design/dist/dashboard/should-use-dashboard.d.ts +10 -0
- package/node_modules/toolcraft-design/dist/dashboard/should-use-dashboard.js +7 -0
- package/node_modules/toolcraft-design/dist/dashboard/snapshot.d.ts +10 -0
- package/node_modules/toolcraft-design/dist/dashboard/snapshot.js +68 -0
- package/node_modules/toolcraft-design/dist/dashboard/store.d.ts +8 -0
- package/node_modules/toolcraft-design/dist/dashboard/store.js +51 -0
- package/node_modules/toolcraft-design/dist/dashboard/terminal-width.d.ts +4 -0
- package/node_modules/toolcraft-design/dist/dashboard/terminal-width.js +71 -0
- package/node_modules/toolcraft-design/dist/dashboard/terminal.d.ts +37 -0
- package/node_modules/toolcraft-design/dist/dashboard/terminal.js +264 -0
- package/node_modules/toolcraft-design/dist/dashboard/types.d.ts +38 -0
- package/node_modules/toolcraft-design/dist/dashboard/types.js +1 -0
- package/node_modules/toolcraft-design/dist/explorer/actions.d.ts +16 -0
- package/node_modules/toolcraft-design/dist/explorer/actions.js +39 -0
- package/node_modules/toolcraft-design/dist/explorer/demo.d.ts +13 -0
- package/node_modules/toolcraft-design/dist/explorer/demo.js +297 -0
- package/node_modules/toolcraft-design/dist/explorer/events.d.ts +67 -0
- package/node_modules/toolcraft-design/dist/explorer/events.js +1 -0
- package/node_modules/toolcraft-design/dist/explorer/filter.d.ts +10 -0
- package/node_modules/toolcraft-design/dist/explorer/filter.js +95 -0
- package/node_modules/toolcraft-design/dist/explorer/index.d.ts +8 -0
- package/node_modules/toolcraft-design/dist/explorer/index.js +8 -0
- package/node_modules/toolcraft-design/dist/explorer/jobs.d.ts +7 -0
- package/node_modules/toolcraft-design/dist/explorer/jobs.js +59 -0
- package/node_modules/toolcraft-design/dist/explorer/keymap.d.ts +21 -0
- package/node_modules/toolcraft-design/dist/explorer/keymap.js +376 -0
- package/node_modules/toolcraft-design/dist/explorer/layout.d.ts +20 -0
- package/node_modules/toolcraft-design/dist/explorer/layout.js +73 -0
- package/node_modules/toolcraft-design/dist/explorer/reducer.d.ts +9 -0
- package/node_modules/toolcraft-design/dist/explorer/reducer.js +782 -0
- package/node_modules/toolcraft-design/dist/explorer/render/detail.d.ts +4 -0
- package/node_modules/toolcraft-design/dist/explorer/render/detail.js +97 -0
- package/node_modules/toolcraft-design/dist/explorer/render/footer.d.ts +4 -0
- package/node_modules/toolcraft-design/dist/explorer/render/footer.js +73 -0
- package/node_modules/toolcraft-design/dist/explorer/render/header.d.ts +4 -0
- package/node_modules/toolcraft-design/dist/explorer/render/header.js +49 -0
- package/node_modules/toolcraft-design/dist/explorer/render/index.d.ts +8 -0
- package/node_modules/toolcraft-design/dist/explorer/render/index.js +53 -0
- package/node_modules/toolcraft-design/dist/explorer/render/list.d.ts +4 -0
- package/node_modules/toolcraft-design/dist/explorer/render/list.js +116 -0
- package/node_modules/toolcraft-design/dist/explorer/render/modal.d.ts +3 -0
- package/node_modules/toolcraft-design/dist/explorer/render/modal.js +87 -0
- package/node_modules/toolcraft-design/dist/explorer/render/test-fixtures.d.ts +8 -0
- package/node_modules/toolcraft-design/dist/explorer/render/test-fixtures.js +156 -0
- package/node_modules/toolcraft-design/dist/explorer/render/text.d.ts +12 -0
- package/node_modules/toolcraft-design/dist/explorer/render/text.js +81 -0
- package/node_modules/toolcraft-design/dist/explorer/runtime.d.ts +2 -0
- package/node_modules/toolcraft-design/dist/explorer/runtime.js +340 -0
- package/node_modules/toolcraft-design/dist/explorer/runtime.test-helpers.d.ts +50 -0
- package/node_modules/toolcraft-design/dist/explorer/runtime.test-helpers.js +101 -0
- package/node_modules/toolcraft-design/dist/explorer/state.d.ts +137 -0
- package/node_modules/toolcraft-design/dist/explorer/state.js +86 -0
- package/node_modules/toolcraft-design/dist/explorer/theme.d.ts +27 -0
- package/node_modules/toolcraft-design/dist/explorer/theme.js +29 -0
- package/node_modules/toolcraft-design/dist/index.d.ts +50 -0
- package/node_modules/toolcraft-design/dist/index.js +43 -0
- package/node_modules/toolcraft-design/dist/internal/color-support.d.ts +9 -0
- package/node_modules/toolcraft-design/dist/internal/color-support.js +12 -0
- package/node_modules/toolcraft-design/dist/internal/output-format.d.ts +6 -0
- package/node_modules/toolcraft-design/dist/internal/output-format.js +22 -0
- package/node_modules/toolcraft-design/dist/internal/strip-ansi.d.ts +1 -0
- package/node_modules/toolcraft-design/dist/internal/strip-ansi.js +50 -0
- package/node_modules/toolcraft-design/dist/internal/theme-detect.d.ts +12 -0
- package/node_modules/toolcraft-design/dist/internal/theme-detect.js +71 -0
- package/node_modules/toolcraft-design/dist/internal/theme-state.d.ts +12 -0
- package/node_modules/toolcraft-design/dist/internal/theme-state.js +35 -0
- package/node_modules/toolcraft-design/dist/prompts/index.d.ts +91 -0
- package/node_modules/toolcraft-design/dist/prompts/index.js +137 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/cancel-symbol.d.ts +2 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/cancel-symbol.js +4 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/confirm.d.ts +9 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/confirm.js +47 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/core.d.ts +55 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/core.js +274 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/glyphs.d.ts +20 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/glyphs.js +53 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/index.d.ts +6 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/index.js +6 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/keys.d.ts +2 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/keys.js +28 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/multiselect.d.ts +13 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/multiselect.js +131 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/pagination.d.ts +10 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/pagination.js +52 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/password.d.ts +10 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/password.js +55 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/select.d.ts +18 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/select.js +89 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/test-helpers.d.ts +21 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/test-helpers.js +32 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/text.d.ts +12 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/text.js +60 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/wrap.d.ts +4 -0
- package/node_modules/toolcraft-design/dist/prompts/interactive/wrap.js +18 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/cancel.d.ts +2 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/cancel.js +9 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/intro.d.ts +1 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/intro.js +16 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/log.d.ts +18 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/log.js +104 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/note.d.ts +1 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/note.js +39 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/outro.d.ts +1 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/outro.js +16 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/spinner.d.ts +6 -0
- package/node_modules/toolcraft-design/dist/prompts/primitives/spinner.js +74 -0
- package/node_modules/toolcraft-design/dist/prompts/theme.d.ts +11 -0
- package/node_modules/toolcraft-design/dist/prompts/theme.js +15 -0
- package/node_modules/toolcraft-design/dist/static/index.d.ts +4 -0
- package/node_modules/toolcraft-design/dist/static/index.js +2 -0
- package/node_modules/toolcraft-design/dist/static/menu.d.ts +11 -0
- package/node_modules/toolcraft-design/dist/static/menu.js +42 -0
- package/node_modules/toolcraft-design/dist/static/spinner.d.ts +14 -0
- package/node_modules/toolcraft-design/dist/static/spinner.js +52 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/ast.d.ts +92 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/ast.js +1 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/demo-content.d.ts +2 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/demo-content.js +139 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/index.d.ts +6 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/index.js +8 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/block.d.ts +7 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/block.js +1495 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.d.ts +8 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.js +36 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/inline.d.ts +10 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser/inline.js +1190 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser.d.ts +5 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/parser.js +42 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/renderer.d.ts +6 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/renderer.js +615 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/testing/theme-render-fixture.d.ts +1 -0
- package/node_modules/toolcraft-design/dist/terminal-markdown/testing/theme-render-fixture.js +27 -0
- package/node_modules/toolcraft-design/dist/tokens/brand.d.ts +5 -0
- package/node_modules/toolcraft-design/dist/tokens/brand.js +5 -0
- package/node_modules/toolcraft-design/dist/tokens/colors.d.ts +37 -0
- package/node_modules/toolcraft-design/dist/tokens/colors.js +85 -0
- package/node_modules/toolcraft-design/dist/tokens/index.d.ts +6 -0
- package/node_modules/toolcraft-design/dist/tokens/index.js +5 -0
- package/node_modules/toolcraft-design/dist/tokens/spacing.d.ts +6 -0
- package/node_modules/toolcraft-design/dist/tokens/spacing.js +6 -0
- package/node_modules/toolcraft-design/dist/tokens/typography.d.ts +7 -0
- package/node_modules/toolcraft-design/dist/tokens/typography.js +8 -0
- package/node_modules/toolcraft-design/dist/tokens/widths.d.ts +5 -0
- package/node_modules/toolcraft-design/dist/tokens/widths.js +5 -0
- package/node_modules/toolcraft-design/package.json +44 -0
- package/package.json +15 -5
|
@@ -79,6 +79,9 @@ function isOptionalSchema(schema) {
|
|
|
79
79
|
function getRequiredKeys(schema) {
|
|
80
80
|
return Object.keys(schema.shape).filter((key) => !isOptionalSchema(schema.shape[key])).sort();
|
|
81
81
|
}
|
|
82
|
+
function getRequiredKeyFingerprint(schema) {
|
|
83
|
+
return getRequiredKeys(schema).join("+");
|
|
84
|
+
}
|
|
82
85
|
function assertUniqueRequiredKeyFingerprints(branches) {
|
|
83
86
|
const fingerprints = /* @__PURE__ */ new Map();
|
|
84
87
|
branches.forEach((branch, index) => {
|
|
@@ -116,6 +119,451 @@ function Union(branches) {
|
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
121
|
|
|
122
|
+
// ../toolcraft-schema/src/validate.ts
|
|
123
|
+
var missingValue = /* @__PURE__ */ Symbol("missingValue");
|
|
124
|
+
function validate(schema, value) {
|
|
125
|
+
const state = { issues: [] };
|
|
126
|
+
const result = walkSchema(schema, value, [], state);
|
|
127
|
+
if (state.issues.length > 0) {
|
|
128
|
+
return { ok: false, issues: state.issues };
|
|
129
|
+
}
|
|
130
|
+
return { ok: true, value: result.present ? result.value : void 0 };
|
|
131
|
+
}
|
|
132
|
+
function walkSchema(schema, value, path10, state) {
|
|
133
|
+
if (schema.kind === "optional") {
|
|
134
|
+
return walkOptional(schema, value, path10, state);
|
|
135
|
+
}
|
|
136
|
+
if (value === missingValue) {
|
|
137
|
+
addIssue(
|
|
138
|
+
state,
|
|
139
|
+
path10,
|
|
140
|
+
expectedFor(schema),
|
|
141
|
+
"missing",
|
|
142
|
+
`Expected ${expectedFor(schema)} at ${formatPath(path10)}`
|
|
143
|
+
);
|
|
144
|
+
return { present: false };
|
|
145
|
+
}
|
|
146
|
+
if (value === null && schema.nullable === true) {
|
|
147
|
+
return { present: true, value };
|
|
148
|
+
}
|
|
149
|
+
switch (schema.kind) {
|
|
150
|
+
case "string":
|
|
151
|
+
return walkString(schema, value, path10, state);
|
|
152
|
+
case "number":
|
|
153
|
+
return walkNumber(schema, value, path10, state);
|
|
154
|
+
case "boolean":
|
|
155
|
+
return walkBoolean(value, path10, state);
|
|
156
|
+
case "enum":
|
|
157
|
+
return walkEnum(schema, value, path10, state);
|
|
158
|
+
case "array":
|
|
159
|
+
return walkArray(schema, value, path10, state);
|
|
160
|
+
case "object":
|
|
161
|
+
return walkObject(schema, value, path10, state);
|
|
162
|
+
case "oneOf":
|
|
163
|
+
return walkOneOf(schema, value, path10, state);
|
|
164
|
+
case "union":
|
|
165
|
+
return walkUnion(schema, value, path10, state);
|
|
166
|
+
case "record":
|
|
167
|
+
return walkRecord(schema, value, path10, state);
|
|
168
|
+
case "json":
|
|
169
|
+
return walkJson(value, path10, state);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function walkOptional(schema, value, path10, state) {
|
|
173
|
+
if (value === missingValue || value === void 0) {
|
|
174
|
+
const defaultValue = getDefault(schema.inner);
|
|
175
|
+
if (defaultValue.present) {
|
|
176
|
+
return walkSchema(schema.inner, cloneDefault(defaultValue.value), path10, state);
|
|
177
|
+
}
|
|
178
|
+
return { present: false };
|
|
179
|
+
}
|
|
180
|
+
return walkSchema(schema.inner, value, path10, state);
|
|
181
|
+
}
|
|
182
|
+
function walkString(schema, value, path10, state) {
|
|
183
|
+
if (typeof value !== "string") {
|
|
184
|
+
addExpectedIssue(state, path10, "string", value);
|
|
185
|
+
return { present: true, value };
|
|
186
|
+
}
|
|
187
|
+
if (schema.minLength !== void 0 && value.length < schema.minLength) {
|
|
188
|
+
const expected = `string with length at least ${schema.minLength}`;
|
|
189
|
+
addIssue(
|
|
190
|
+
state,
|
|
191
|
+
path10,
|
|
192
|
+
expected,
|
|
193
|
+
`string with length ${value.length}`,
|
|
194
|
+
`Expected ${expected} at ${formatPath(path10)}`
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
if (schema.maxLength !== void 0 && value.length > schema.maxLength) {
|
|
198
|
+
const expected = `string with length at most ${schema.maxLength}`;
|
|
199
|
+
addIssue(
|
|
200
|
+
state,
|
|
201
|
+
path10,
|
|
202
|
+
expected,
|
|
203
|
+
`string with length ${value.length}`,
|
|
204
|
+
`Expected ${expected} at ${formatPath(path10)}`
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
if (schema.pattern !== void 0) {
|
|
208
|
+
const pattern = compilePattern(schema.pattern);
|
|
209
|
+
if (pattern === void 0 || !pattern.test(value)) {
|
|
210
|
+
const expected = `string matching pattern ${schema.pattern}`;
|
|
211
|
+
addIssue(state, path10, expected, value, `Expected ${expected} at ${formatPath(path10)}`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return { present: true, value };
|
|
215
|
+
}
|
|
216
|
+
function walkNumber(schema, value, path10, state) {
|
|
217
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
218
|
+
addExpectedIssue(state, path10, schema.jsonType === "integer" ? "integer" : "number", value);
|
|
219
|
+
return { present: true, value };
|
|
220
|
+
}
|
|
221
|
+
if (schema.jsonType === "integer" && !Number.isInteger(value)) {
|
|
222
|
+
addExpectedIssue(state, path10, "integer", value);
|
|
223
|
+
}
|
|
224
|
+
if (schema.minimum !== void 0 && value < schema.minimum) {
|
|
225
|
+
const expected = `number greater than or equal to ${schema.minimum}`;
|
|
226
|
+
addIssue(state, path10, expected, String(value), `Expected ${expected} at ${formatPath(path10)}`);
|
|
227
|
+
}
|
|
228
|
+
if (schema.maximum !== void 0 && value > schema.maximum) {
|
|
229
|
+
const expected = `number less than or equal to ${schema.maximum}`;
|
|
230
|
+
addIssue(state, path10, expected, String(value), `Expected ${expected} at ${formatPath(path10)}`);
|
|
231
|
+
}
|
|
232
|
+
return { present: true, value };
|
|
233
|
+
}
|
|
234
|
+
function walkBoolean(value, path10, state) {
|
|
235
|
+
if (typeof value !== "boolean") {
|
|
236
|
+
addExpectedIssue(state, path10, "boolean", value);
|
|
237
|
+
}
|
|
238
|
+
return { present: true, value };
|
|
239
|
+
}
|
|
240
|
+
function walkEnum(schema, value, path10, state) {
|
|
241
|
+
if (!schema.values.includes(value)) {
|
|
242
|
+
const expected = `one of ${schema.values.join(", ")}`;
|
|
243
|
+
addIssue(
|
|
244
|
+
state,
|
|
245
|
+
path10,
|
|
246
|
+
expected,
|
|
247
|
+
receivedValue(value),
|
|
248
|
+
`Expected ${expected} at ${formatPath(path10)}`
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
return { present: true, value };
|
|
252
|
+
}
|
|
253
|
+
function walkArray(schema, value, path10, state) {
|
|
254
|
+
if (!Array.isArray(value)) {
|
|
255
|
+
addExpectedIssue(state, path10, "array", value);
|
|
256
|
+
return { present: true, value };
|
|
257
|
+
}
|
|
258
|
+
if (schema.minItems !== void 0 && value.length < schema.minItems) {
|
|
259
|
+
const expected = `array with at least ${schema.minItems} items`;
|
|
260
|
+
addIssue(
|
|
261
|
+
state,
|
|
262
|
+
path10,
|
|
263
|
+
expected,
|
|
264
|
+
`array with ${value.length} items`,
|
|
265
|
+
`Expected ${expected} at ${formatPath(path10)}`
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
if (schema.maxItems !== void 0 && value.length > schema.maxItems) {
|
|
269
|
+
const expected = `array with at most ${schema.maxItems} items`;
|
|
270
|
+
addIssue(
|
|
271
|
+
state,
|
|
272
|
+
path10,
|
|
273
|
+
expected,
|
|
274
|
+
`array with ${value.length} items`,
|
|
275
|
+
`Expected ${expected} at ${formatPath(path10)}`
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
const nextValue = value.map((item, index) => {
|
|
279
|
+
const result = walkSchema(schema.item, item, [...path10, String(index)], state);
|
|
280
|
+
return result.present ? result.value : item;
|
|
281
|
+
});
|
|
282
|
+
return { present: true, value: nextValue };
|
|
283
|
+
}
|
|
284
|
+
function walkObject(schema, value, path10, state, injectedProperties = {}) {
|
|
285
|
+
if (!isPlainRecord(value)) {
|
|
286
|
+
addExpectedIssue(state, path10, "object", value);
|
|
287
|
+
return { present: true, value };
|
|
288
|
+
}
|
|
289
|
+
const nextValue = {};
|
|
290
|
+
const allowedKeys = /* @__PURE__ */ new Set([...Object.keys(schema.shape), ...Object.keys(injectedProperties)]);
|
|
291
|
+
for (const [key, propertySchema] of Object.entries(schema.shape)) {
|
|
292
|
+
const propertyValue = Object.hasOwn(value, key) ? value[key] : missingValue;
|
|
293
|
+
const result = walkSchema(propertySchema, propertyValue, [...path10, key], state);
|
|
294
|
+
if (result.present) {
|
|
295
|
+
setOwnValue(nextValue, key, result.value);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
for (const [key, injectedValue] of Object.entries(injectedProperties)) {
|
|
299
|
+
if (Object.hasOwn(value, key)) {
|
|
300
|
+
setOwnValue(nextValue, key, value[key]);
|
|
301
|
+
} else {
|
|
302
|
+
setOwnValue(nextValue, key, injectedValue);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
for (const [key, propertyValue] of Object.entries(value)) {
|
|
306
|
+
if (allowedKeys.has(key)) {
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
if (schema.additionalProperties === true) {
|
|
310
|
+
setOwnValue(nextValue, key, propertyValue);
|
|
311
|
+
} else {
|
|
312
|
+
addUnexpectedPropertyIssue(state, [...path10, key]);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return { present: true, value: nextValue };
|
|
316
|
+
}
|
|
317
|
+
function walkOneOf(schema, value, path10, state) {
|
|
318
|
+
if (!isPlainRecord(value)) {
|
|
319
|
+
addExpectedIssue(state, path10, "object", value);
|
|
320
|
+
return { present: true, value };
|
|
321
|
+
}
|
|
322
|
+
const discriminatorValue = value[schema.discriminator];
|
|
323
|
+
const discriminatorPath = [...path10, schema.discriminator];
|
|
324
|
+
const branchValues = Object.keys(schema.branches);
|
|
325
|
+
const expected = `one of ${branchValues.join(", ")}`;
|
|
326
|
+
if (!Object.hasOwn(value, schema.discriminator)) {
|
|
327
|
+
addIssueWithMessage(
|
|
328
|
+
state,
|
|
329
|
+
discriminatorPath,
|
|
330
|
+
expected,
|
|
331
|
+
"missing",
|
|
332
|
+
`Missing discriminator "${schema.discriminator}" at ${formatPath(path10)}. Expected one of: ${branchValues.join(", ")}.`
|
|
333
|
+
);
|
|
334
|
+
return { present: true, value };
|
|
335
|
+
}
|
|
336
|
+
if (typeof discriminatorValue !== "string" || !Object.hasOwn(schema.branches, discriminatorValue)) {
|
|
337
|
+
addIssueWithMessage(
|
|
338
|
+
state,
|
|
339
|
+
discriminatorPath,
|
|
340
|
+
expected,
|
|
341
|
+
receivedValue(discriminatorValue),
|
|
342
|
+
`Expected ${expected} at ${formatPath(discriminatorPath)}, got ${formatReceivedDiscriminator(discriminatorValue)}`
|
|
343
|
+
);
|
|
344
|
+
return { present: true, value };
|
|
345
|
+
}
|
|
346
|
+
return walkObject(schema.branches[discriminatorValue], value, path10, state, {
|
|
347
|
+
[schema.discriminator]: discriminatorValue
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function walkUnion(schema, value, path10, state) {
|
|
351
|
+
if (isPlainRecord(value)) {
|
|
352
|
+
const candidateBranches = schema.branches.filter((branch) => hasRequiredKeys(branch, value));
|
|
353
|
+
if (candidateBranches.length === 1) {
|
|
354
|
+
return walkObject(candidateBranches[0], value, path10, state);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const matches = [];
|
|
358
|
+
for (const branch of schema.branches) {
|
|
359
|
+
const branchState = { issues: [] };
|
|
360
|
+
const result = walkObject(branch, value, path10, branchState);
|
|
361
|
+
if (branchState.issues.length === 0 && result.present) {
|
|
362
|
+
matches.push({ fingerprint: getRequiredKeyFingerprint(branch), value: result.value });
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (matches.length === 1) {
|
|
366
|
+
return { present: true, value: matches[0].value };
|
|
367
|
+
}
|
|
368
|
+
if (matches.length === 0) {
|
|
369
|
+
const branchDescriptions = schema.branches.map((branch) => getRequiredKeyFingerprint(branch));
|
|
370
|
+
addIssueWithMessage(
|
|
371
|
+
state,
|
|
372
|
+
path10,
|
|
373
|
+
"exactly one union branch",
|
|
374
|
+
"0 matching branches",
|
|
375
|
+
`No union branch matched at ${formatPath(path10)}. Tried ${schema.branches.length} branches. Expected one of: ${branchDescriptions.join(" | ")}.`
|
|
376
|
+
);
|
|
377
|
+
return { present: true, value };
|
|
378
|
+
}
|
|
379
|
+
addIssueWithMessage(
|
|
380
|
+
state,
|
|
381
|
+
path10,
|
|
382
|
+
"exactly one union branch",
|
|
383
|
+
`${matches.length} matching branches`,
|
|
384
|
+
`Expected exactly one union branch at ${formatPath(path10)}, but matched more than one branch: ${matches.map((match) => match.fingerprint).join(" | ")}`
|
|
385
|
+
);
|
|
386
|
+
return { present: true, value };
|
|
387
|
+
}
|
|
388
|
+
function hasRequiredKeys(schema, value) {
|
|
389
|
+
for (const [key, propertySchema] of Object.entries(schema.shape)) {
|
|
390
|
+
if (propertySchema.kind !== "optional" && !Object.hasOwn(value, key)) {
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
function walkRecord(schema, value, path10, state) {
|
|
397
|
+
if (!isPlainRecord(value)) {
|
|
398
|
+
addExpectedIssue(state, path10, "object", value);
|
|
399
|
+
return { present: true, value };
|
|
400
|
+
}
|
|
401
|
+
const nextValue = {};
|
|
402
|
+
for (const [key, propertyValue] of Object.entries(value)) {
|
|
403
|
+
const result = walkSchema(schema.value, propertyValue, [...path10, key], state);
|
|
404
|
+
if (result.present) {
|
|
405
|
+
setOwnValue(nextValue, key, result.value);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return { present: true, value: nextValue };
|
|
409
|
+
}
|
|
410
|
+
function walkJson(value, path10, state) {
|
|
411
|
+
if (isJsonValue(value)) {
|
|
412
|
+
return { present: true, value };
|
|
413
|
+
}
|
|
414
|
+
addExpectedIssue(state, path10, "JSON value", value);
|
|
415
|
+
return { present: true, value };
|
|
416
|
+
}
|
|
417
|
+
function getDefault(schema) {
|
|
418
|
+
if (schema.default !== void 0) {
|
|
419
|
+
return { present: true, value: schema.default };
|
|
420
|
+
}
|
|
421
|
+
if (schema.kind === "optional") {
|
|
422
|
+
return getDefault(schema.inner);
|
|
423
|
+
}
|
|
424
|
+
return { present: false };
|
|
425
|
+
}
|
|
426
|
+
function isPlainRecord(value) {
|
|
427
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
const prototype = Object.getPrototypeOf(value);
|
|
431
|
+
return prototype === Object.prototype || prototype === null;
|
|
432
|
+
}
|
|
433
|
+
function isJsonValue(value, ancestors = /* @__PURE__ */ new Set()) {
|
|
434
|
+
if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
435
|
+
return typeof value !== "number" || Number.isFinite(value);
|
|
436
|
+
}
|
|
437
|
+
if (Array.isArray(value)) {
|
|
438
|
+
if (ancestors.has(value)) {
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
ancestors.add(value);
|
|
442
|
+
const result = value.every((item) => isJsonValue(item, ancestors));
|
|
443
|
+
ancestors.delete(value);
|
|
444
|
+
return result;
|
|
445
|
+
}
|
|
446
|
+
if (isPlainRecord(value)) {
|
|
447
|
+
if (ancestors.has(value)) {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
ancestors.add(value);
|
|
451
|
+
const result = Object.values(value).every((item) => isJsonValue(item, ancestors));
|
|
452
|
+
ancestors.delete(value);
|
|
453
|
+
return result;
|
|
454
|
+
}
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
function cloneDefault(value) {
|
|
458
|
+
return structuredClone(value);
|
|
459
|
+
}
|
|
460
|
+
function setOwnValue(target, key, value) {
|
|
461
|
+
Object.defineProperty(target, key, {
|
|
462
|
+
configurable: true,
|
|
463
|
+
enumerable: true,
|
|
464
|
+
writable: true,
|
|
465
|
+
value
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
function expectedFor(schema) {
|
|
469
|
+
switch (schema.kind) {
|
|
470
|
+
case "string":
|
|
471
|
+
return "string";
|
|
472
|
+
case "number":
|
|
473
|
+
return schema.jsonType === "integer" ? "integer" : "number";
|
|
474
|
+
case "boolean":
|
|
475
|
+
return "boolean";
|
|
476
|
+
case "enum":
|
|
477
|
+
return `one of ${schema.values.join(", ")}`;
|
|
478
|
+
case "array":
|
|
479
|
+
return "array";
|
|
480
|
+
case "object":
|
|
481
|
+
case "oneOf":
|
|
482
|
+
case "record":
|
|
483
|
+
return "object";
|
|
484
|
+
case "union":
|
|
485
|
+
return "exactly one union branch";
|
|
486
|
+
case "json":
|
|
487
|
+
return "JSON value";
|
|
488
|
+
case "optional":
|
|
489
|
+
return expectedFor(schema.inner);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
function addExpectedIssue(state, path10, expected, value) {
|
|
493
|
+
addIssue(
|
|
494
|
+
state,
|
|
495
|
+
path10,
|
|
496
|
+
expected,
|
|
497
|
+
receivedType(value),
|
|
498
|
+
`Expected ${expected} at ${formatPath(path10)}`
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
function addUnexpectedPropertyIssue(state, path10) {
|
|
502
|
+
addIssue(
|
|
503
|
+
state,
|
|
504
|
+
path10,
|
|
505
|
+
"no additional properties",
|
|
506
|
+
"unknown property",
|
|
507
|
+
`Unexpected property ${formatPath(path10)}`
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
function addIssue(state, path10, expected, received, _message) {
|
|
511
|
+
state.issues.push({
|
|
512
|
+
path: path10,
|
|
513
|
+
expected,
|
|
514
|
+
received,
|
|
515
|
+
message: formatIssueMessage(expected, path10, received)
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
function addIssueWithMessage(state, path10, expected, received, message2) {
|
|
519
|
+
state.issues.push({
|
|
520
|
+
path: path10,
|
|
521
|
+
expected,
|
|
522
|
+
received,
|
|
523
|
+
message: message2
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
function formatIssueMessage(expected, path10, received) {
|
|
527
|
+
return `Expected ${expected} at ${formatPath(path10)}, got ${received}`;
|
|
528
|
+
}
|
|
529
|
+
function formatPath(path10) {
|
|
530
|
+
return path10.length === 0 ? "value" : path10.join(".");
|
|
531
|
+
}
|
|
532
|
+
function compilePattern(pattern) {
|
|
533
|
+
try {
|
|
534
|
+
return new RegExp(pattern);
|
|
535
|
+
} catch {
|
|
536
|
+
return void 0;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
function receivedType(value) {
|
|
540
|
+
if (value === null) {
|
|
541
|
+
return "null";
|
|
542
|
+
}
|
|
543
|
+
if (Array.isArray(value)) {
|
|
544
|
+
return "array";
|
|
545
|
+
}
|
|
546
|
+
if (typeof value === "number" && Number.isInteger(value)) {
|
|
547
|
+
return "integer";
|
|
548
|
+
}
|
|
549
|
+
return typeof value;
|
|
550
|
+
}
|
|
551
|
+
function receivedValue(value) {
|
|
552
|
+
if (typeof value === "string") {
|
|
553
|
+
return value;
|
|
554
|
+
}
|
|
555
|
+
if (value === void 0) {
|
|
556
|
+
return "undefined";
|
|
557
|
+
}
|
|
558
|
+
return String(value);
|
|
559
|
+
}
|
|
560
|
+
function formatReceivedDiscriminator(value) {
|
|
561
|
+
if (typeof value === "string") {
|
|
562
|
+
return JSON.stringify(value);
|
|
563
|
+
}
|
|
564
|
+
return receivedValue(value);
|
|
565
|
+
}
|
|
566
|
+
|
|
119
567
|
// ../toolcraft-schema/src/index.ts
|
|
120
568
|
function assertValidEnumValues(values) {
|
|
121
569
|
if (values.length === 0) {
|
|
@@ -139,6 +587,22 @@ function assertFiniteNumber(value, name) {
|
|
|
139
587
|
throw new Error(`${name} must be finite`);
|
|
140
588
|
}
|
|
141
589
|
}
|
|
590
|
+
function assertMinMaxOrder(minimum, maximum, minimumName, maximumName) {
|
|
591
|
+
if (minimum !== void 0 && maximum !== void 0 && minimum > maximum) {
|
|
592
|
+
throw new Error(`${minimumName} must be less than or equal to ${maximumName}`);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
function assertValidDefault(schema) {
|
|
596
|
+
if (schema.default === void 0) {
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
const result = validate(schema, schema.default);
|
|
600
|
+
if (!result.ok) {
|
|
601
|
+
throw new Error(
|
|
602
|
+
`default must satisfy schema: ${result.issues[0]?.message ?? "invalid default"}`
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
142
606
|
function assertPattern(pattern) {
|
|
143
607
|
if (pattern === void 0) {
|
|
144
608
|
return;
|
|
@@ -153,56 +617,71 @@ var S = {
|
|
|
153
617
|
String(options = {}) {
|
|
154
618
|
assertNonNegativeInteger(options.minLength, "minLength");
|
|
155
619
|
assertNonNegativeInteger(options.maxLength, "maxLength");
|
|
620
|
+
assertMinMaxOrder(options.minLength, options.maxLength, "minLength", "maxLength");
|
|
156
621
|
assertPattern(options.pattern);
|
|
157
|
-
|
|
622
|
+
const schema = {
|
|
158
623
|
kind: "string",
|
|
159
624
|
...options
|
|
160
625
|
};
|
|
626
|
+
assertValidDefault(schema);
|
|
627
|
+
return schema;
|
|
161
628
|
},
|
|
162
629
|
Number(options = {}) {
|
|
163
630
|
assertFiniteNumber(options.minimum, "minimum");
|
|
164
631
|
assertFiniteNumber(options.maximum, "maximum");
|
|
632
|
+
assertMinMaxOrder(options.minimum, options.maximum, "minimum", "maximum");
|
|
165
633
|
assertFiniteNumber(options.default, "default");
|
|
166
634
|
if (options.jsonType === "integer" && options.default !== void 0 && !Number.isInteger(options.default)) {
|
|
167
635
|
throw new Error("default must be an integer");
|
|
168
636
|
}
|
|
169
|
-
|
|
637
|
+
const schema = {
|
|
170
638
|
kind: "number",
|
|
171
639
|
...options
|
|
172
640
|
};
|
|
641
|
+
assertValidDefault(schema);
|
|
642
|
+
return schema;
|
|
173
643
|
},
|
|
174
644
|
Boolean(options = {}) {
|
|
175
|
-
|
|
645
|
+
const schema = {
|
|
176
646
|
kind: "boolean",
|
|
177
647
|
...options
|
|
178
648
|
};
|
|
649
|
+
assertValidDefault(schema);
|
|
650
|
+
return schema;
|
|
179
651
|
},
|
|
180
652
|
Enum(values, options = {}) {
|
|
181
653
|
assertValidEnumValues(values);
|
|
182
654
|
if (options.jsonType === "integer" && values.some((value) => typeof value !== "number" || !Number.isInteger(value))) {
|
|
183
655
|
throw new Error("Integer enum values must be integers");
|
|
184
656
|
}
|
|
185
|
-
|
|
657
|
+
const schema = {
|
|
186
658
|
kind: "enum",
|
|
187
659
|
values,
|
|
188
660
|
...options
|
|
189
661
|
};
|
|
662
|
+
assertValidDefault(schema);
|
|
663
|
+
return schema;
|
|
190
664
|
},
|
|
191
665
|
Array(item, options = {}) {
|
|
192
666
|
assertNonNegativeInteger(options.minItems, "minItems");
|
|
193
667
|
assertNonNegativeInteger(options.maxItems, "maxItems");
|
|
194
|
-
|
|
668
|
+
assertMinMaxOrder(options.minItems, options.maxItems, "minItems", "maxItems");
|
|
669
|
+
const schema = {
|
|
195
670
|
kind: "array",
|
|
196
671
|
item,
|
|
197
672
|
...options
|
|
198
673
|
};
|
|
674
|
+
assertValidDefault(schema);
|
|
675
|
+
return schema;
|
|
199
676
|
},
|
|
200
677
|
Object(shape, options = {}) {
|
|
201
|
-
|
|
678
|
+
const schema = {
|
|
202
679
|
kind: "object",
|
|
203
680
|
shape,
|
|
204
681
|
...options
|
|
205
682
|
};
|
|
683
|
+
assertValidDefault(schema);
|
|
684
|
+
return schema;
|
|
206
685
|
},
|
|
207
686
|
Optional(inner) {
|
|
208
687
|
return {
|
|
@@ -1081,7 +1560,54 @@ var symbols = {
|
|
|
1081
1560
|
|
|
1082
1561
|
// ../toolcraft-design/src/internal/strip-ansi.ts
|
|
1083
1562
|
function stripAnsi(value) {
|
|
1084
|
-
|
|
1563
|
+
let output = "";
|
|
1564
|
+
let index = 0;
|
|
1565
|
+
while (index < value.length) {
|
|
1566
|
+
const char = value[index];
|
|
1567
|
+
if (char === "\x1B") {
|
|
1568
|
+
index = skipEscapeSequence(value, index);
|
|
1569
|
+
continue;
|
|
1570
|
+
}
|
|
1571
|
+
if (char === "\x9B") {
|
|
1572
|
+
index = skipCsiSequence(value, index + 1);
|
|
1573
|
+
continue;
|
|
1574
|
+
}
|
|
1575
|
+
output += char;
|
|
1576
|
+
index += char.length;
|
|
1577
|
+
}
|
|
1578
|
+
return output;
|
|
1579
|
+
}
|
|
1580
|
+
function skipEscapeSequence(value, index) {
|
|
1581
|
+
const next = value[index + 1];
|
|
1582
|
+
if (next === "[") {
|
|
1583
|
+
return skipCsiSequence(value, index + 2);
|
|
1584
|
+
}
|
|
1585
|
+
if (next === "]") {
|
|
1586
|
+
return skipOscSequence(value, index + 2);
|
|
1587
|
+
}
|
|
1588
|
+
return Math.min(value.length, index + 2);
|
|
1589
|
+
}
|
|
1590
|
+
function skipCsiSequence(value, index) {
|
|
1591
|
+
while (index < value.length) {
|
|
1592
|
+
const codePoint = value.charCodeAt(index);
|
|
1593
|
+
index += 1;
|
|
1594
|
+
if (codePoint >= 64 && codePoint <= 126) {
|
|
1595
|
+
break;
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
return index;
|
|
1599
|
+
}
|
|
1600
|
+
function skipOscSequence(value, index) {
|
|
1601
|
+
while (index < value.length) {
|
|
1602
|
+
if (value[index] === "\x07") {
|
|
1603
|
+
return index + 1;
|
|
1604
|
+
}
|
|
1605
|
+
if (value[index] === "\x1B" && value[index + 1] === "\\") {
|
|
1606
|
+
return index + 2;
|
|
1607
|
+
}
|
|
1608
|
+
index += 1;
|
|
1609
|
+
}
|
|
1610
|
+
return index;
|
|
1085
1611
|
}
|
|
1086
1612
|
|
|
1087
1613
|
// ../toolcraft-design/src/prompts/primitives/log.ts
|
|
@@ -1278,6 +1804,10 @@ var graphemeSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
|
1278
1804
|
// ../toolcraft-design/src/components/table.ts
|
|
1279
1805
|
var graphemeSegmenter2 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
1280
1806
|
|
|
1807
|
+
// ../toolcraft-design/src/components/detail-card.ts
|
|
1808
|
+
import stringWidth from "fast-string-width";
|
|
1809
|
+
import { wrapAnsi } from "fast-wrap-ansi";
|
|
1810
|
+
|
|
1281
1811
|
// ../toolcraft-design/src/components/browser.ts
|
|
1282
1812
|
import { spawn } from "node:child_process";
|
|
1283
1813
|
import process2 from "node:process";
|
|
@@ -1288,13 +1818,13 @@ import { LineCounter, parse, parseDocument } from "yaml";
|
|
|
1288
1818
|
// ../frontmatter/src/stringify.ts
|
|
1289
1819
|
import { stringify } from "yaml";
|
|
1290
1820
|
|
|
1821
|
+
// ../toolcraft-design/src/dashboard/terminal-width.ts
|
|
1822
|
+
var graphemeSegmenter3 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
1823
|
+
|
|
1291
1824
|
// ../toolcraft-design/src/acp/writer.ts
|
|
1292
1825
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
1293
1826
|
var storage = new AsyncLocalStorage2();
|
|
1294
1827
|
|
|
1295
|
-
// ../toolcraft-design/src/dashboard/terminal-width.ts
|
|
1296
|
-
var graphemeSegmenter3 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
1297
|
-
|
|
1298
1828
|
// ../toolcraft-design/src/dashboard/terminal.ts
|
|
1299
1829
|
import readline from "node:readline";
|
|
1300
1830
|
import { PassThrough } from "node:stream";
|
|
@@ -1343,11 +1873,11 @@ import { EventEmitter } from "node:events";
|
|
|
1343
1873
|
import * as readline2 from "node:readline";
|
|
1344
1874
|
|
|
1345
1875
|
// ../toolcraft-design/src/prompts/interactive/wrap.ts
|
|
1346
|
-
import { wrapAnsi } from "fast-wrap-ansi";
|
|
1347
|
-
import
|
|
1876
|
+
import { wrapAnsi as wrapAnsi2 } from "fast-wrap-ansi";
|
|
1877
|
+
import stringWidth2 from "fast-string-width";
|
|
1348
1878
|
|
|
1349
1879
|
// ../toolcraft-design/src/prompts/interactive/pagination.ts
|
|
1350
|
-
import { wrapAnsi as
|
|
1880
|
+
import { wrapAnsi as wrapAnsi3 } from "fast-wrap-ansi";
|
|
1351
1881
|
|
|
1352
1882
|
// ../toolcraft-design/src/static/spinner.ts
|
|
1353
1883
|
var SPINNER_FRAMES = Object.freeze(["\u25D2", "\u25D0", "\u25D3", "\u25D1"]);
|
|
@@ -1370,17 +1900,17 @@ import path5 from "node:path";
|
|
|
1370
1900
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
1371
1901
|
|
|
1372
1902
|
// ../agent-skill-config/src/resolve-skill-reference.ts
|
|
1373
|
-
import
|
|
1903
|
+
import * as fs from "node:fs";
|
|
1374
1904
|
import path6 from "node:path";
|
|
1375
1905
|
|
|
1376
1906
|
// ../agent-skill-config/src/git-exclude.ts
|
|
1377
1907
|
import { execFileSync } from "node:child_process";
|
|
1378
1908
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
1379
|
-
import * as
|
|
1909
|
+
import * as fs2 from "node:fs";
|
|
1380
1910
|
import path7 from "node:path";
|
|
1381
1911
|
|
|
1382
1912
|
// ../agent-skill-config/src/bridge-active-skills.ts
|
|
1383
|
-
import * as
|
|
1913
|
+
import * as fs3 from "node:fs";
|
|
1384
1914
|
import { createHash, randomUUID as randomUUID3 } from "node:crypto";
|
|
1385
1915
|
import path8 from "node:path";
|
|
1386
1916
|
|
|
@@ -1434,12 +1964,12 @@ function getSkillFolderWithHome(agent, scope, cwd, homeDir) {
|
|
|
1434
1964
|
)
|
|
1435
1965
|
};
|
|
1436
1966
|
}
|
|
1437
|
-
async function assertNoSymbolicLinkPath(
|
|
1967
|
+
async function assertNoSymbolicLinkPath(fs4, targetPath) {
|
|
1438
1968
|
const rootPath = path9.parse(targetPath).root;
|
|
1439
1969
|
let currentPath = targetPath;
|
|
1440
1970
|
while (currentPath !== rootPath) {
|
|
1441
1971
|
try {
|
|
1442
|
-
if ((await
|
|
1972
|
+
if ((await fs4.lstat(currentPath)).isSymbolicLink()) {
|
|
1443
1973
|
throw new UserError(`Refusing terminal-pilot skill operation through symbolic link: ${currentPath}`);
|
|
1444
1974
|
}
|
|
1445
1975
|
} catch (error2) {
|
|
@@ -1508,9 +2038,9 @@ var uninstall = defineCommand({
|
|
|
1508
2038
|
};
|
|
1509
2039
|
}
|
|
1510
2040
|
});
|
|
1511
|
-
async function folderExists(
|
|
2041
|
+
async function folderExists(fs4, folderPath) {
|
|
1512
2042
|
try {
|
|
1513
|
-
await
|
|
2043
|
+
await fs4.stat(folderPath);
|
|
1514
2044
|
return true;
|
|
1515
2045
|
} catch (error2) {
|
|
1516
2046
|
if (hasOwnErrorCode(error2, "ENOENT")) {
|