terminal-pilot 0.0.30 → 0.0.32
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 +1599 -497
- package/dist/cli.js.map +4 -4
- package/dist/commands/close-session.js +489 -6
- package/dist/commands/close-session.js.map +4 -4
- package/dist/commands/create-session.js +489 -6
- package/dist/commands/create-session.js.map +4 -4
- package/dist/commands/fill.js +489 -6
- package/dist/commands/fill.js.map +4 -4
- package/dist/commands/get-session.js +489 -6
- package/dist/commands/get-session.js.map +4 -4
- package/dist/commands/index.js +630 -44
- package/dist/commands/index.js.map +4 -4
- package/dist/commands/install.js +626 -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 +489 -6
- package/dist/commands/list-sessions.js.map +4 -4
- package/dist/commands/press-key.js +489 -6
- package/dist/commands/press-key.js.map +4 -4
- package/dist/commands/read-history.js +489 -6
- package/dist/commands/read-history.js.map +4 -4
- package/dist/commands/read-screen.js +489 -6
- package/dist/commands/read-screen.js.map +4 -4
- package/dist/commands/resize.js +489 -6
- package/dist/commands/resize.js.map +4 -4
- package/dist/commands/runtime.js.map +1 -1
- package/dist/commands/screenshot.js +489 -6
- package/dist/commands/screenshot.js.map +4 -4
- package/dist/commands/send-signal.js +489 -6
- package/dist/commands/send-signal.js.map +4 -4
- package/dist/commands/type.js +489 -6
- package/dist/commands/type.js.map +4 -4
- package/dist/commands/uninstall.js +554 -20
- package/dist/commands/uninstall.js.map +4 -4
- package/dist/commands/wait-for-exit.js +489 -6
- package/dist/commands/wait-for-exit.js.map +4 -4
- package/dist/commands/wait-for.js +489 -6
- package/dist/commands/wait-for.js.map +4 -4
- package/dist/testing/cli-repl.js +1599 -497
- package/dist/testing/cli-repl.js.map +4 -4
- package/dist/testing/qa-cli.js +1609 -507
- 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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @poe-code/agent-defs
|
|
2
|
+
|
|
3
|
+
Shared catalog of supported coding-agent definitions.
|
|
4
|
+
|
|
5
|
+
This package owns the declarative agent metadata used by CLI, SDK, spawn,
|
|
6
|
+
configuration, and UI surfaces: stable ids, labels, aliases, config paths,
|
|
7
|
+
binary names, API-shape support, OTEL capture wiring, and brand colors.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { allAgents, normalizeAgentId, parseAgentSpecifier } from "@poe-code/agent-defs";
|
|
13
|
+
|
|
14
|
+
const specifier = parseAgentSpecifier("claude:sonnet");
|
|
15
|
+
const normalized = normalizeAgentId(specifier.agent);
|
|
16
|
+
const codex = allAgents.find((agent) => agent.id === "codex");
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Public API
|
|
20
|
+
|
|
21
|
+
- `allAgents`: frozen list of built-in `AgentDefinition` records.
|
|
22
|
+
- `resolveAgentId(input)`: resolves ids, names, and aliases to a stable agent id.
|
|
23
|
+
- `parseAgentSpecifier(input)`: parses `agent` or `agent:model` input.
|
|
24
|
+
- `formatAgentSpecifier(specifier)`: formats an agent specifier.
|
|
25
|
+
- `normalizeAgentId(input)`: normalizes the agent part through the registry.
|
|
26
|
+
- Agent definition exports such as `codexAgent`, `claudeCodeAgent`, and `geminiCliAgent`.
|
|
27
|
+
|
|
28
|
+
## Config Options
|
|
29
|
+
|
|
30
|
+
This package does not load external config. Agent definitions are declared in
|
|
31
|
+
source and exposed as immutable data.
|
|
32
|
+
|
|
33
|
+
## Environment Variables
|
|
34
|
+
|
|
35
|
+
This package does not read or expose environment variables.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const claudeCodeAgent = {
|
|
2
|
+
id: "claude-code",
|
|
3
|
+
name: "claude-code",
|
|
4
|
+
label: "Claude Code",
|
|
5
|
+
summary: "Configure Claude Code to route through Poe.",
|
|
6
|
+
aliases: ["claude"],
|
|
7
|
+
binaryName: "claude",
|
|
8
|
+
apiShapes: ["anthropic-messages"],
|
|
9
|
+
otelCapture: {
|
|
10
|
+
env: {
|
|
11
|
+
CLAUDE_CODE_ENABLE_TELEMETRY: "1"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
configPath: "~/.claude.json",
|
|
15
|
+
branding: {
|
|
16
|
+
colors: {
|
|
17
|
+
dark: "#C15F3C",
|
|
18
|
+
light: "#C15F3C"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const claudeDesktopAgent = {
|
|
2
|
+
id: "claude-desktop",
|
|
3
|
+
name: "claude-desktop",
|
|
4
|
+
label: "Claude Desktop",
|
|
5
|
+
summary: "Anthropic's official desktop application for Claude",
|
|
6
|
+
configPath: "~/.config/Claude/claude_desktop_config.json",
|
|
7
|
+
configPaths: {
|
|
8
|
+
darwin: "~/Library/Application Support/Claude/claude_desktop_config.json",
|
|
9
|
+
linux: "~/.config/Claude/claude_desktop_config.json",
|
|
10
|
+
win32: "~/AppData/Roaming/Claude/claude_desktop_config.json"
|
|
11
|
+
},
|
|
12
|
+
branding: {
|
|
13
|
+
colors: {
|
|
14
|
+
dark: "#D97757",
|
|
15
|
+
light: "#D97757"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const codexAgent = {
|
|
2
|
+
id: "codex",
|
|
3
|
+
name: "codex",
|
|
4
|
+
label: "Codex",
|
|
5
|
+
summary: "Configure Codex to use Poe as the model provider.",
|
|
6
|
+
binaryName: "codex",
|
|
7
|
+
apiShapes: ["openai-responses"],
|
|
8
|
+
otelCapture: {
|
|
9
|
+
args: (endpoint, content) => [
|
|
10
|
+
"-c",
|
|
11
|
+
`otel.trace_exporter={"otlp-http"={endpoint=${JSON.stringify(`${endpoint}/v1/traces`)},protocol="json"}}`,
|
|
12
|
+
"-c",
|
|
13
|
+
`otel.exporter={"otlp-http"={endpoint=${JSON.stringify(`${endpoint}/v1/logs`)},protocol="json"}}`,
|
|
14
|
+
"-c",
|
|
15
|
+
`otel.log_user_prompt=${content}`
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
configPath: "~/.codex/config.toml",
|
|
19
|
+
branding: {
|
|
20
|
+
colors: {
|
|
21
|
+
dark: "#D5D9DF",
|
|
22
|
+
light: "#7A7F86"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const cursorAgent = {
|
|
2
|
+
id: "cursor",
|
|
3
|
+
name: "cursor",
|
|
4
|
+
aliases: ["cursor-agent"],
|
|
5
|
+
label: "Cursor",
|
|
6
|
+
summary: "Cursor's CLI coding agent.",
|
|
7
|
+
binaryName: "cursor-agent",
|
|
8
|
+
configPath: "~/.cursor/mcp.json",
|
|
9
|
+
branding: {
|
|
10
|
+
colors: {
|
|
11
|
+
dark: "#FFFFFF",
|
|
12
|
+
light: "#000000"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const geminiCliAgent = {
|
|
2
|
+
id: "gemini-cli",
|
|
3
|
+
name: "gemini-cli",
|
|
4
|
+
aliases: ["gemini"],
|
|
5
|
+
label: "Gemini CLI",
|
|
6
|
+
summary: "Configure Google's Gemini CLI to use a compatible Google generations API.",
|
|
7
|
+
binaryName: "gemini",
|
|
8
|
+
configPath: "~/.gemini/settings.json",
|
|
9
|
+
apiShapes: ["google-generations"],
|
|
10
|
+
branding: {
|
|
11
|
+
colors: {
|
|
12
|
+
dark: "#8AB4F8",
|
|
13
|
+
light: "#1A73E8"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const gooseAgent = {
|
|
2
|
+
id: "goose",
|
|
3
|
+
name: "goose",
|
|
4
|
+
label: "Goose",
|
|
5
|
+
summary: "Block's open-source AI agent with ACP support.",
|
|
6
|
+
binaryName: "goose",
|
|
7
|
+
apiShapes: ["openai-chat-completions"],
|
|
8
|
+
otelCapture: {},
|
|
9
|
+
configPath: "~/.config/goose/config.yaml",
|
|
10
|
+
branding: {
|
|
11
|
+
colors: {
|
|
12
|
+
dark: "#FF6B35",
|
|
13
|
+
light: "#E85D26"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { claudeCodeAgent } from "./claude-code.js";
|
|
2
|
+
export { claudeDesktopAgent } from "./claude-desktop.js";
|
|
3
|
+
export { codexAgent } from "./codex.js";
|
|
4
|
+
export { cursorAgent } from "./cursor.js";
|
|
5
|
+
export { geminiCliAgent } from "./gemini-cli.js";
|
|
6
|
+
export { openCodeAgent } from "./opencode.js";
|
|
7
|
+
export { kimiAgent } from "./kimi.js";
|
|
8
|
+
export { gooseAgent } from "./goose.js";
|
|
9
|
+
export { poeAgentAgent } from "./poe-agent.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { claudeCodeAgent } from "./claude-code.js";
|
|
2
|
+
export { claudeDesktopAgent } from "./claude-desktop.js";
|
|
3
|
+
export { codexAgent } from "./codex.js";
|
|
4
|
+
export { cursorAgent } from "./cursor.js";
|
|
5
|
+
export { geminiCliAgent } from "./gemini-cli.js";
|
|
6
|
+
export { openCodeAgent } from "./opencode.js";
|
|
7
|
+
export { kimiAgent } from "./kimi.js";
|
|
8
|
+
export { gooseAgent } from "./goose.js";
|
|
9
|
+
export { poeAgentAgent } from "./poe-agent.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const kimiAgent = {
|
|
2
|
+
id: "kimi",
|
|
3
|
+
name: "kimi",
|
|
4
|
+
label: "Kimi",
|
|
5
|
+
summary: "Configure Kimi CLI to use Poe API",
|
|
6
|
+
aliases: ["kimi-cli"],
|
|
7
|
+
binaryName: "kimi",
|
|
8
|
+
apiShapes: ["openai-chat-completions"],
|
|
9
|
+
configPath: "~/.kimi/mcp.json",
|
|
10
|
+
branding: {
|
|
11
|
+
colors: {
|
|
12
|
+
dark: "#7B68EE",
|
|
13
|
+
light: "#6A5ACD"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const openCodeAgent = {
|
|
2
|
+
id: "opencode",
|
|
3
|
+
name: "opencode",
|
|
4
|
+
label: "OpenCode CLI",
|
|
5
|
+
summary: "Configure OpenCode CLI to use the Poe API.",
|
|
6
|
+
binaryName: "opencode",
|
|
7
|
+
apiShapes: ["openai-chat-completions"],
|
|
8
|
+
otelCapture: {
|
|
9
|
+
env: {
|
|
10
|
+
OPENCODE_CONFIG_CONTENT: '{"experimental":{"openTelemetry":true}}'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
configPath: "~/.config/opencode/opencode.json",
|
|
14
|
+
branding: {
|
|
15
|
+
colors: {
|
|
16
|
+
dark: "#4A4F55",
|
|
17
|
+
light: "#2F3338"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const poeAgentAgent = {
|
|
2
|
+
id: "poe-agent",
|
|
3
|
+
name: "poe-agent",
|
|
4
|
+
label: "Poe Agent",
|
|
5
|
+
summary: "Run one-shot prompts with the built-in Poe agent runtime.",
|
|
6
|
+
apiShapes: ["openai-responses", "openai-chat-completions"],
|
|
7
|
+
configPath: "~/.poe-code/config.json",
|
|
8
|
+
branding: {
|
|
9
|
+
colors: {
|
|
10
|
+
dark: "#A465F7",
|
|
11
|
+
light: "#7A3FD3"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { AgentDefinition, ApiShapeId, OtelCaptureDefinition } from "./types.js";
|
|
2
|
+
export type { AgentSpecifier } from "./specifier.js";
|
|
3
|
+
export { claudeCodeAgent, claudeDesktopAgent, codexAgent, cursorAgent, geminiCliAgent, openCodeAgent, kimiAgent, gooseAgent, poeAgentAgent } from "./agents/index.js";
|
|
4
|
+
export { allAgents, resolveAgentId } from "./registry.js";
|
|
5
|
+
export { parseAgentSpecifier, formatAgentSpecifier, normalizeAgentId } from "./specifier.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { claudeCodeAgent, claudeDesktopAgent, codexAgent, cursorAgent, geminiCliAgent, openCodeAgent, kimiAgent, gooseAgent, poeAgentAgent } from "./agents/index.js";
|
|
2
|
+
export { allAgents, resolveAgentId } from "./registry.js";
|
|
3
|
+
export { parseAgentSpecifier, formatAgentSpecifier, normalizeAgentId } from "./specifier.js";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { claudeCodeAgent, claudeDesktopAgent, codexAgent, cursorAgent, geminiCliAgent, openCodeAgent, kimiAgent, gooseAgent, poeAgentAgent } from "./agents/index.js";
|
|
2
|
+
function freezeAgent(agent) {
|
|
3
|
+
if (agent.aliases !== undefined) {
|
|
4
|
+
Object.freeze(agent.aliases);
|
|
5
|
+
}
|
|
6
|
+
if (agent.apiShapes !== undefined) {
|
|
7
|
+
Object.freeze(agent.apiShapes);
|
|
8
|
+
}
|
|
9
|
+
if (agent.otelCapture?.env !== undefined) {
|
|
10
|
+
Object.freeze(agent.otelCapture.env);
|
|
11
|
+
}
|
|
12
|
+
if (agent.otelCapture !== undefined) {
|
|
13
|
+
Object.freeze(agent.otelCapture);
|
|
14
|
+
}
|
|
15
|
+
Object.freeze(agent.branding.colors);
|
|
16
|
+
Object.freeze(agent.branding);
|
|
17
|
+
return Object.freeze(agent);
|
|
18
|
+
}
|
|
19
|
+
export const allAgents = Object.freeze([
|
|
20
|
+
freezeAgent(claudeCodeAgent),
|
|
21
|
+
freezeAgent(claudeDesktopAgent),
|
|
22
|
+
freezeAgent(codexAgent),
|
|
23
|
+
freezeAgent(cursorAgent),
|
|
24
|
+
freezeAgent(geminiCliAgent),
|
|
25
|
+
freezeAgent(openCodeAgent),
|
|
26
|
+
freezeAgent(kimiAgent),
|
|
27
|
+
freezeAgent(gooseAgent),
|
|
28
|
+
freezeAgent(poeAgentAgent)
|
|
29
|
+
]);
|
|
30
|
+
const lookup = new Map();
|
|
31
|
+
for (const agent of allAgents) {
|
|
32
|
+
const values = [agent.id, agent.name, ...(agent.aliases ?? [])];
|
|
33
|
+
for (const value of values) {
|
|
34
|
+
const normalized = value.toLowerCase();
|
|
35
|
+
if (!lookup.has(normalized)) {
|
|
36
|
+
lookup.set(normalized, agent.id);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function resolveAgentId(input) {
|
|
41
|
+
if (!input) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
return lookup.get(input.trim().toLowerCase());
|
|
45
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface AgentSpecifier {
|
|
2
|
+
agent: string;
|
|
3
|
+
model?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function parseAgentSpecifier(input: string): AgentSpecifier;
|
|
6
|
+
export declare function formatAgentSpecifier(specifier: AgentSpecifier): string;
|
|
7
|
+
export declare function normalizeAgentId(input: string): string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { resolveAgentId } from "./registry.js";
|
|
2
|
+
function getOwnModel(specifier) {
|
|
3
|
+
return Object.prototype.hasOwnProperty.call(specifier, "model") ? specifier.model : undefined;
|
|
4
|
+
}
|
|
5
|
+
function requireNonBlank(value, field) {
|
|
6
|
+
const trimmed = value.trim();
|
|
7
|
+
if (trimmed.length === 0) {
|
|
8
|
+
throw new TypeError(`${field} must not be empty`);
|
|
9
|
+
}
|
|
10
|
+
return trimmed;
|
|
11
|
+
}
|
|
12
|
+
export function parseAgentSpecifier(input) {
|
|
13
|
+
const colonIndex = input.indexOf(":");
|
|
14
|
+
if (colonIndex === -1) {
|
|
15
|
+
return { agent: requireNonBlank(input, "agent") };
|
|
16
|
+
}
|
|
17
|
+
const agent = requireNonBlank(input.slice(0, colonIndex), "agent");
|
|
18
|
+
const model = input.slice(colonIndex + 1).trim();
|
|
19
|
+
return {
|
|
20
|
+
agent,
|
|
21
|
+
...(model.length > 0 ? { model } : {})
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function formatAgentSpecifier(specifier) {
|
|
25
|
+
const agent = requireNonBlank(specifier.agent, "agent");
|
|
26
|
+
const model = getOwnModel(specifier);
|
|
27
|
+
const normalizedModel = model?.trim();
|
|
28
|
+
if (normalizedModel) {
|
|
29
|
+
return `${agent}:${normalizedModel}`;
|
|
30
|
+
}
|
|
31
|
+
return agent;
|
|
32
|
+
}
|
|
33
|
+
export function normalizeAgentId(input) {
|
|
34
|
+
const specifier = parseAgentSpecifier(input.trim());
|
|
35
|
+
const agent = resolveAgentId(specifier.agent) ?? specifier.agent;
|
|
36
|
+
return formatAgentSpecifier({
|
|
37
|
+
agent,
|
|
38
|
+
model: getOwnModel(specifier)
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type ApiShapeId = "openai-chat-completions" | "openai-responses" | "anthropic-messages" | "google-generations";
|
|
2
|
+
export interface OtelCaptureDefinition {
|
|
3
|
+
env?: Record<string, string>;
|
|
4
|
+
args?: (endpoint: string, content: boolean) => string[];
|
|
5
|
+
}
|
|
6
|
+
export interface AgentDefinition {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
label: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
aliases?: string[];
|
|
12
|
+
/** Binary name for CLI agents. Optional for GUI-only apps like Claude Desktop. */
|
|
13
|
+
binaryName?: string;
|
|
14
|
+
readonly apiShapes?: readonly ApiShapeId[];
|
|
15
|
+
readonly otelCapture?: OtelCaptureDefinition;
|
|
16
|
+
configPath: string;
|
|
17
|
+
readonly configPaths?: {
|
|
18
|
+
readonly darwin: string;
|
|
19
|
+
readonly linux: string;
|
|
20
|
+
readonly win32: string;
|
|
21
|
+
};
|
|
22
|
+
branding: {
|
|
23
|
+
colors: {
|
|
24
|
+
dark: string;
|
|
25
|
+
light: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@poe-code/agent-defs",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "node ../../scripts/guard-package-dist.mjs && tsc"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -117,6 +117,7 @@ export async function installSkill(agentId, skill, options) {
|
|
|
117
117
|
const scope = options.scope ?? "local";
|
|
118
118
|
const config = support.config;
|
|
119
119
|
if (skill.name.length === 0 ||
|
|
120
|
+
skill.name !== skill.name.trim() ||
|
|
120
121
|
skill.name === "." ||
|
|
121
122
|
skill.name === ".." ||
|
|
122
123
|
skill.name.includes("/") ||
|
|
@@ -156,5 +157,5 @@ export async function installSkill(agentId, skill, options) {
|
|
|
156
157
|
throw new Error(`Unknown template: ${templateId}`);
|
|
157
158
|
}
|
|
158
159
|
});
|
|
159
|
-
return { skillPath:
|
|
160
|
+
return { skillPath: absoluteSkillPath, displayPath };
|
|
160
161
|
}
|
|
@@ -20,10 +20,16 @@ function pathExists(targetPath) {
|
|
|
20
20
|
throw error;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
function assertNoSymbolicLinkUnder(rootPath, targetPath) {
|
|
24
|
+
const root = path.resolve(rootPath);
|
|
25
|
+
const target = path.resolve(targetPath);
|
|
26
|
+
const relative = path.relative(root, target);
|
|
27
|
+
if (relative.startsWith("..") || path.isAbsolute(relative)) {
|
|
28
|
+
throw new Error(`Refusing to bridge skills outside root ${root}: ${target}`);
|
|
29
|
+
}
|
|
30
|
+
let current = root;
|
|
31
|
+
const segments = relative.length === 0 ? [] : relative.split(path.sep);
|
|
32
|
+
for (const segment of segments) {
|
|
27
33
|
if (segment.length === 0) {
|
|
28
34
|
continue;
|
|
29
35
|
}
|
|
@@ -86,7 +92,6 @@ function formatResolutionFailureError(failures) {
|
|
|
86
92
|
return new Error(lines.join("\n"));
|
|
87
93
|
}
|
|
88
94
|
function copyDirectory(sourcePath, targetPath) {
|
|
89
|
-
assertNoSymbolicLink(sourcePath);
|
|
90
95
|
fs.mkdirSync(targetPath, { recursive: true });
|
|
91
96
|
for (const dirent of fs.readdirSync(sourcePath, { withFileTypes: true })) {
|
|
92
97
|
const childSource = path.join(sourcePath, dirent.name);
|
|
@@ -100,7 +105,9 @@ function copyDirectory(sourcePath, targetPath) {
|
|
|
100
105
|
}
|
|
101
106
|
if (dirent.isFile()) {
|
|
102
107
|
fs.copyFileSync(childSource, childTarget);
|
|
108
|
+
continue;
|
|
103
109
|
}
|
|
110
|
+
throw new Error(`Refusing to bridge unsupported filesystem entry: ${childSource}`);
|
|
104
111
|
}
|
|
105
112
|
}
|
|
106
113
|
function directoryFingerprint(targetPath) {
|
|
@@ -236,17 +243,24 @@ export function bridgeActiveSkills(spawnAgentId, cwd, refs, homeDir, runId) {
|
|
|
236
243
|
}
|
|
237
244
|
const activeTarget = activeTargets.get(item.targetPath);
|
|
238
245
|
if (activeTarget && pathExists(item.targetPath)) {
|
|
239
|
-
if (activeTarget.sourcePath === item.source.sourcePath
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
if (activeTarget.sourcePath === item.source.sourcePath) {
|
|
247
|
+
const sourceRoot = item.source.scope === "project" ? cwd : homeDir;
|
|
248
|
+
assertNoSymbolicLinkUnder(sourceRoot, item.source.sourcePath);
|
|
249
|
+
const sourceFingerprint = directoryFingerprint(item.source.sourcePath);
|
|
250
|
+
if (sourceFingerprint === activeTarget.sourceFingerprint &&
|
|
251
|
+
hasOwnershipToken(item.targetPath, activeTarget.token) &&
|
|
252
|
+
directoryFingerprint(item.targetPath) === activeTarget.fingerprint) {
|
|
253
|
+
activeTarget.references += 1;
|
|
254
|
+
claimedTargets.add(item.targetPath);
|
|
255
|
+
entries.push({
|
|
256
|
+
ref: item.ref,
|
|
257
|
+
sourcePath: item.source.sourcePath,
|
|
258
|
+
targetPath: item.targetPath,
|
|
259
|
+
createdParents: []
|
|
260
|
+
});
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
warnings.push(warning("local-collision", item.ref, item.source.sourcePath, item.targetPath));
|
|
250
264
|
continue;
|
|
251
265
|
}
|
|
252
266
|
activeTargets.delete(item.targetPath);
|
|
@@ -259,8 +273,11 @@ export function bridgeActiveSkills(spawnAgentId, cwd, refs, homeDir, runId) {
|
|
|
259
273
|
warnings.push(warning("global-collision", item.ref, item.source.sourcePath, item.globalTargetPath));
|
|
260
274
|
continue;
|
|
261
275
|
}
|
|
276
|
+
const sourceRoot = item.source.scope === "project" ? cwd : homeDir;
|
|
277
|
+
assertNoSymbolicLinkUnder(sourceRoot, item.source.sourcePath);
|
|
278
|
+
const sourceFingerprint = directoryFingerprint(item.source.sourcePath);
|
|
262
279
|
const createdParents = collectMissingParents(item.targetPath);
|
|
263
|
-
|
|
280
|
+
assertNoSymbolicLinkUnder(cwd, path.dirname(item.targetPath));
|
|
264
281
|
fs.mkdirSync(path.dirname(item.targetPath), { recursive: true });
|
|
265
282
|
const token = randomUUID();
|
|
266
283
|
try {
|
|
@@ -277,6 +294,7 @@ export function bridgeActiveSkills(spawnAgentId, cwd, refs, homeDir, runId) {
|
|
|
277
294
|
activeTargets.set(item.targetPath, {
|
|
278
295
|
createdParents,
|
|
279
296
|
fingerprint,
|
|
297
|
+
sourceFingerprint,
|
|
280
298
|
sourcePath: item.source.sourcePath,
|
|
281
299
|
references: 1,
|
|
282
300
|
token
|
|
@@ -298,6 +316,7 @@ export function bridgeActiveSkills(spawnAgentId, cwd, refs, homeDir, runId) {
|
|
|
298
316
|
spawnAgentId,
|
|
299
317
|
cwd,
|
|
300
318
|
runId,
|
|
319
|
+
...(excludeBlockId !== undefined && excludeBlockId !== runId ? { excludeBlockId } : {}),
|
|
301
320
|
entries,
|
|
302
321
|
warnings
|
|
303
322
|
};
|
|
@@ -314,7 +333,7 @@ export function cleanupBridgedSkills(manifest) {
|
|
|
314
333
|
if (state?.cleaned) {
|
|
315
334
|
return;
|
|
316
335
|
}
|
|
317
|
-
removeExcludeBlock(manifest.cwd, state?.excludeBlockId ?? manifest.runId);
|
|
336
|
+
removeExcludeBlock(manifest.cwd, state?.excludeBlockId ?? manifest.excludeBlockId ?? manifest.runId);
|
|
318
337
|
for (const entry of manifest.entries) {
|
|
319
338
|
const activeTarget = activeTargets.get(entry.targetPath);
|
|
320
339
|
if (!activeTarget) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { getAgentConfig, resolveAgentSupport, resolveSkillDir } from "./configs.js";
|
|
4
|
+
import { hasOwnErrorCode } from "./error-codes.js";
|
|
4
5
|
function isMalformedSegment(segment) {
|
|
5
6
|
return (segment.length === 0 ||
|
|
6
7
|
segment !== segment.trim() ||
|
|
@@ -11,10 +12,13 @@ function isMalformedSegment(segment) {
|
|
|
11
12
|
}
|
|
12
13
|
function isDirectory(targetPath) {
|
|
13
14
|
try {
|
|
14
|
-
return statSync(targetPath).isDirectory();
|
|
15
|
+
return fs.statSync(targetPath).isDirectory();
|
|
15
16
|
}
|
|
16
|
-
catch {
|
|
17
|
-
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (hasOwnErrorCode(error, "ENOENT") || hasOwnErrorCode(error, "ENOTDIR")) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
throw error;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
function findSkill(ref, name, tiers, sourceAgentId) {
|