toolcraft 0.0.26 → 0.0.33
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.compile-check.js +7 -1
- package/dist/cli.d.ts +9 -1
- package/dist/cli.js +134 -62
- package/dist/design.d.ts +1 -0
- package/dist/design.js +1 -0
- package/dist/error-codes.d.ts +1 -0
- package/dist/error-codes.js +6 -0
- package/dist/error-report.js +99 -29
- package/dist/human-in-loop/approvals-commands.js +2 -1
- package/dist/human-in-loop/runner.js +2 -2
- package/dist/index.d.ts +6 -2
- package/dist/json-schema-converter.js +12 -1
- package/dist/mcp-proxy.js +26 -9
- package/dist/mcp.js +55 -4
- package/dist/renderer.js +1 -1
- package/dist/schema-scope.js +22 -1
- package/dist/sdk.js +51 -3
- package/dist/source-snippet.js +1 -1
- package/node_modules/@poe-code/agent-defs/dist/agents/claude-code.js +5 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/codex.js +10 -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/goose.js +1 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/index.d.ts +1 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/index.js +1 -0
- package/node_modules/@poe-code/agent-defs/dist/agents/opencode.js +5 -0
- package/node_modules/@poe-code/agent-defs/dist/index.d.ts +2 -2
- package/node_modules/@poe-code/agent-defs/dist/index.js +1 -1
- package/node_modules/@poe-code/agent-defs/dist/registry.js +8 -1
- package/node_modules/@poe-code/agent-defs/dist/specifier.js +7 -3
- package/node_modules/@poe-code/agent-defs/dist/types.d.ts +5 -0
- package/node_modules/@poe-code/agent-human-in-loop/dist/providers/osascript.js +7 -1
- package/node_modules/@poe-code/agent-mcp-config/dist/configs.js +6 -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.js +25 -15
- package/node_modules/@poe-code/config-mutations/dist/formats/json.js +1 -1
- package/node_modules/@poe-code/config-mutations/dist/formats/toml.js +1 -1
- package/node_modules/@poe-code/config-mutations/dist/formats/yaml.js +1 -1
- package/node_modules/@poe-code/config-mutations/dist/fs-utils.js +2 -4
- package/node_modules/@poe-code/config-mutations/dist/template/render.js +1 -1
- package/node_modules/@poe-code/config-mutations/package.json +1 -1
- package/node_modules/@poe-code/process-runner/dist/host/host-execution-env.js +18 -5
- package/node_modules/@poe-code/process-runner/dist/host/host-runner.js +38 -4
- package/node_modules/@poe-code/process-runner/dist/workspace-transfer.js +8 -2
- package/node_modules/@poe-code/task-list/dist/backends/gh-issues-sync.js +18 -7
- package/node_modules/@poe-code/task-list/dist/backends/markdown-dir.js +13 -6
- package/node_modules/@poe-code/task-list/dist/backends/utils.js +15 -10
- package/node_modules/@poe-code/task-list/dist/backends/yaml-file.js +39 -22
- package/node_modules/@poe-code/task-list/dist/move.js +4 -1
- package/node_modules/@poe-code/task-list/dist/open.js +42 -20
- package/node_modules/@poe-code/task-list/dist/state-machine.js +8 -5
- package/node_modules/auth-store/dist/create-secret-store.js +6 -1
- package/node_modules/auth-store/dist/encrypted-file-store.d.ts +1 -1
- package/node_modules/auth-store/dist/encrypted-file-store.js +32 -28
- package/node_modules/auth-store/dist/error-codes.d.ts +1 -0
- package/node_modules/auth-store/dist/error-codes.js +5 -0
- package/node_modules/auth-store/dist/keychain-store.js +23 -8
- package/node_modules/mcp-oauth/dist/client/auth-store-session-store.js +17 -5
- package/node_modules/mcp-oauth/dist/client/authorization-state.js +21 -8
- package/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +128 -55
- package/node_modules/mcp-oauth/dist/client/token-endpoint.js +27 -17
- package/node_modules/mcp-oauth/dist/server/jwks-token-verifier.js +43 -22
- package/node_modules/toolcraft-design/README.md +148 -0
- package/node_modules/toolcraft-design/dist/components/catalog.d.ts +26 -0
- package/node_modules/toolcraft-design/dist/components/catalog.js +94 -0
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/index.d.ts +2 -0
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/index.js +1 -0
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/footer.js +1 -2
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/output-pane.js +16 -19
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/stats-pane.js +1 -15
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/demo.js +2 -2
- package/node_modules/toolcraft-design/dist/explorer/theme.js +29 -0
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/index.d.ts +7 -1
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/index.js +4 -0
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/theme-detect.d.ts +1 -0
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/theme-detect.js +28 -6
- 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/{@poe-code/design-system → toolcraft-design}/dist/prompts/theme.d.ts +1 -1
- package/node_modules/toolcraft-design/dist/prompts/theme.js +15 -0
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/frontmatter.js +50 -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/{@poe-code/design-system → toolcraft-design}/dist/tokens/index.d.ts +2 -0
- package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/index.js +1 -0
- package/node_modules/toolcraft-design/package.json +42 -0
- package/package.json +10 -6
- package/node_modules/@poe-code/design-system/dist/explorer/theme.js +0 -97
- package/node_modules/@poe-code/design-system/dist/prompts/theme.js +0 -12
- package/node_modules/@poe-code/design-system/dist/tokens/colors.d.ts +0 -35
- package/node_modules/@poe-code/design-system/dist/tokens/colors.js +0 -34
- package/node_modules/@poe-code/design-system/package.json +0 -29
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/components.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/components.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/index.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/index.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/writer.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/acp/writer.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/browser.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/browser.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/color.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/color.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/command-errors.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/command-errors.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/detail-card.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/detail-card.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/help-formatter-plain.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/help-formatter-plain.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/help-formatter.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/help-formatter.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/logger.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/logger.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/symbols.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/symbols.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/table.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/table.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/template.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/template.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/text.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/text.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/ansi.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/ansi.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/buffer.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/buffer.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/border.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/border.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/footer.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/output-pane.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/components/stats-pane.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/dashboard.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/dashboard.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/demo.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/demo.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/index.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/index.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/keymap.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/keymap.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/layout.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/layout.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/should-use-dashboard.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/should-use-dashboard.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/snapshot.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/snapshot.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/store.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/store.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/terminal-width.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/terminal-width.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/terminal.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/terminal.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/types.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/dashboard/types.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/actions.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/actions.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/demo.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/events.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/events.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/filter.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/filter.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/index.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/index.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/jobs.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/jobs.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/keymap.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/keymap.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/layout.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/layout.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/reducer.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/reducer.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/detail.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/detail.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/footer.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/footer.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/header.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/header.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/index.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/index.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/list.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/list.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/modal.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/modal.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/test-fixtures.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/test-fixtures.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/text.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/render/text.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/runtime.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/runtime.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/runtime.test-helpers.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/runtime.test-helpers.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/state.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/state.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/explorer/theme.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/color-support.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/color-support.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/output-format.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/output-format.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/strip-ansi.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/strip-ansi.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/index.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/index.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/cancel.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/cancel.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/intro.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/intro.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/log.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/log.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/note.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/note.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/outro.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/outro.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/spinner.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/prompts/primitives/spinner.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/index.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/index.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/menu.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/menu.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/spinner.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/static/spinner.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/ast.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/ast.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/demo-content.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/demo-content.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/index.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/index.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/block.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/block.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/frontmatter.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/inline.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser/inline.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/parser.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/renderer.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/renderer.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/testing/theme-render-fixture.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/terminal-markdown/testing/theme-render-fixture.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/spacing.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/spacing.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/typography.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/typography.js +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/widths.d.ts +0 -0
- /package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/tokens/widths.js +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ThemePalette } from "../tokens/colors.js";
|
|
2
|
+
export type CatalogTone = "accent" | "muted" | "success" | "warning" | "error" | "info";
|
|
3
|
+
export interface CatalogMetric {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string | number;
|
|
6
|
+
tone?: CatalogTone;
|
|
7
|
+
}
|
|
8
|
+
export interface CatalogItem {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
detail?: string;
|
|
12
|
+
tone?: CatalogTone;
|
|
13
|
+
}
|
|
14
|
+
export interface CatalogGroup {
|
|
15
|
+
title: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
items: CatalogItem[];
|
|
18
|
+
}
|
|
19
|
+
export interface RenderCatalogOptions {
|
|
20
|
+
theme: ThemePalette;
|
|
21
|
+
title: string;
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
metrics?: CatalogMetric[];
|
|
24
|
+
groups: CatalogGroup[];
|
|
25
|
+
}
|
|
26
|
+
export declare function renderCatalog(options: RenderCatalogOptions): string;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { resolveOutputFormat } from "../internal/output-format.js";
|
|
2
|
+
import { stripAnsi } from "../internal/strip-ansi.js";
|
|
3
|
+
function applyTone(theme, value, tone) {
|
|
4
|
+
return tone === undefined ? value : theme[tone](value);
|
|
5
|
+
}
|
|
6
|
+
function renderMetrics(metrics, theme) {
|
|
7
|
+
return metrics
|
|
8
|
+
.map((metric) => applyTone(theme, `${metric.value} ${metric.label}`, metric.tone))
|
|
9
|
+
.join(theme.muted(" · "));
|
|
10
|
+
}
|
|
11
|
+
function renderTerminal(options) {
|
|
12
|
+
const title = [
|
|
13
|
+
options.theme.header(options.title),
|
|
14
|
+
options.subtitle === undefined ? undefined : options.theme.muted(options.subtitle)
|
|
15
|
+
]
|
|
16
|
+
.filter((value) => value !== undefined)
|
|
17
|
+
.join(" ");
|
|
18
|
+
const blocks = [
|
|
19
|
+
[title, options.metrics?.length ? renderMetrics(options.metrics, options.theme) : undefined]
|
|
20
|
+
.filter((value) => value !== undefined)
|
|
21
|
+
.join("\n")
|
|
22
|
+
];
|
|
23
|
+
for (const group of options.groups) {
|
|
24
|
+
const labelWidth = Math.max(...group.items.map((item) => item.label.length), 0);
|
|
25
|
+
const valueWidth = Math.max(...group.items.map((item) => item.value.length), 0);
|
|
26
|
+
const lines = [
|
|
27
|
+
`${options.theme.header(group.title)} ${options.theme.muted(String(group.items.length))}`,
|
|
28
|
+
...(group.description === undefined ? [] : [options.theme.muted(group.description)]),
|
|
29
|
+
...group.items.map((item) => {
|
|
30
|
+
const identity = `${applyTone(options.theme, item.label.padEnd(labelWidth), item.tone)} ${item.value.padEnd(valueWidth)}`;
|
|
31
|
+
return item.detail === undefined
|
|
32
|
+
? identity.trimEnd()
|
|
33
|
+
: `${identity} ${options.theme.muted(item.detail)}`;
|
|
34
|
+
})
|
|
35
|
+
];
|
|
36
|
+
blocks.push(lines.join("\n"));
|
|
37
|
+
}
|
|
38
|
+
return blocks.join("\n\n");
|
|
39
|
+
}
|
|
40
|
+
function escapeMarkdown(value) {
|
|
41
|
+
return stripAnsi(value).replaceAll("`", "\\`");
|
|
42
|
+
}
|
|
43
|
+
function renderMarkdown(options) {
|
|
44
|
+
const blocks = [`# ${escapeMarkdown(options.title)}`];
|
|
45
|
+
if (options.subtitle !== undefined) {
|
|
46
|
+
blocks.push(escapeMarkdown(options.subtitle));
|
|
47
|
+
}
|
|
48
|
+
if (options.metrics?.length) {
|
|
49
|
+
blocks.push(`**${options.metrics.map((metric) => `${metric.value} ${metric.label}`).join(" · ")}**`);
|
|
50
|
+
}
|
|
51
|
+
for (const group of options.groups) {
|
|
52
|
+
const header = [`## ${escapeMarkdown(group.title)} (${group.items.length})`];
|
|
53
|
+
if (group.description !== undefined) {
|
|
54
|
+
header.push(escapeMarkdown(group.description));
|
|
55
|
+
}
|
|
56
|
+
const items = group.items.map((item) => {
|
|
57
|
+
const detail = item.detail === undefined ? "" : ` — ${escapeMarkdown(item.detail)}`;
|
|
58
|
+
return `- \`${escapeMarkdown(item.label)}\` \`${escapeMarkdown(item.value)}\`${detail}`;
|
|
59
|
+
});
|
|
60
|
+
blocks.push(`${header.join("\n\n")}\n\n${items.join("\n")}`);
|
|
61
|
+
}
|
|
62
|
+
return blocks.join("\n\n");
|
|
63
|
+
}
|
|
64
|
+
function renderJson(options) {
|
|
65
|
+
return JSON.stringify({
|
|
66
|
+
title: stripAnsi(options.title),
|
|
67
|
+
...(options.subtitle === undefined ? {} : { subtitle: stripAnsi(options.subtitle) }),
|
|
68
|
+
metrics: (options.metrics ?? []).map((metric) => ({
|
|
69
|
+
...metric,
|
|
70
|
+
label: stripAnsi(metric.label),
|
|
71
|
+
value: typeof metric.value === "string" ? stripAnsi(metric.value) : metric.value
|
|
72
|
+
})),
|
|
73
|
+
groups: options.groups.map((group) => ({
|
|
74
|
+
title: stripAnsi(group.title),
|
|
75
|
+
...(group.description === undefined ? {} : { description: stripAnsi(group.description) }),
|
|
76
|
+
items: group.items.map((item) => ({
|
|
77
|
+
...item,
|
|
78
|
+
label: stripAnsi(item.label),
|
|
79
|
+
value: stripAnsi(item.value),
|
|
80
|
+
...(item.detail === undefined ? {} : { detail: stripAnsi(item.detail) })
|
|
81
|
+
}))
|
|
82
|
+
}))
|
|
83
|
+
}, null, 2);
|
|
84
|
+
}
|
|
85
|
+
export function renderCatalog(options) {
|
|
86
|
+
switch (resolveOutputFormat()) {
|
|
87
|
+
case "markdown":
|
|
88
|
+
return renderMarkdown(options);
|
|
89
|
+
case "json":
|
|
90
|
+
return renderJson(options);
|
|
91
|
+
default:
|
|
92
|
+
return renderTerminal(options);
|
|
93
|
+
}
|
|
94
|
+
}
|
package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/components/index.d.ts
RENAMED
|
@@ -10,5 +10,7 @@ export { formatCommandNotFound } from "./command-errors.js";
|
|
|
10
10
|
export { formatCommandNotFoundPanel } from "./command-errors.js";
|
|
11
11
|
export { renderTable } from "./table.js";
|
|
12
12
|
export type { TableColumn, RenderTableOptions } from "./table.js";
|
|
13
|
+
export { renderCatalog } from "./catalog.js";
|
|
14
|
+
export type { CatalogGroup, CatalogItem, CatalogMetric, CatalogTone, RenderCatalogOptions } from "./catalog.js";
|
|
13
15
|
export { getTemplatePartialNames, renderTemplate, resolveTemplatePartials } from "./template.js";
|
|
14
16
|
export type { RenderTemplateOptions, TemplateEscape } from "./template.js";
|
|
@@ -6,4 +6,5 @@ export { helpFormatter, formatColumns, formatCommand, formatUsage, formatOption,
|
|
|
6
6
|
export { formatCommandNotFound } from "./command-errors.js";
|
|
7
7
|
export { formatCommandNotFoundPanel } from "./command-errors.js";
|
|
8
8
|
export { renderTable } from "./table.js";
|
|
9
|
+
export { renderCatalog } from "./catalog.js";
|
|
9
10
|
export { getTemplatePartialNames, renderTemplate, resolveTemplatePartials } from "./template.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getTheme } from "../../internal/theme-detect.js";
|
|
2
|
-
import { light } from "../../tokens/colors.js";
|
|
3
2
|
export function renderFooter(buffer, rect, hints) {
|
|
4
3
|
buffer.clearRect(rect);
|
|
5
4
|
if (rect.width <= 0 || rect.height <= 0 || hints.length === 0) {
|
|
@@ -53,5 +52,5 @@ function truncateCells(cells, width) {
|
|
|
53
52
|
];
|
|
54
53
|
}
|
|
55
54
|
function getAccentStyle() {
|
|
56
|
-
return getTheme()
|
|
55
|
+
return getTheme().styles.accent;
|
|
57
56
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getTheme } from "../../internal/theme-detect.js";
|
|
2
2
|
import { hasAnsi, parseAnsi } from "../ansi.js";
|
|
3
3
|
import { displayWidth, expandTabs, graphemes, graphemeWidth } from "../terminal-width.js";
|
|
4
4
|
const TEXT_OFFSET = 3;
|
|
@@ -49,12 +49,11 @@ export function computeVisualLines(items, width) {
|
|
|
49
49
|
if (width <= 0) {
|
|
50
50
|
return [];
|
|
51
51
|
}
|
|
52
|
-
const
|
|
53
|
-
const mutedStyle = getMutedStyle(themeName);
|
|
52
|
+
const mutedStyle = getTheme().styles.muted;
|
|
54
53
|
const textWidth = Math.max(width - TEXT_OFFSET, 0);
|
|
55
54
|
const visualLines = [];
|
|
56
55
|
for (const item of items) {
|
|
57
|
-
const itemStyle = getItemStyle(item.kind
|
|
56
|
+
const itemStyle = getItemStyle(item.kind);
|
|
58
57
|
if (hasAnsi(item.text) || hasCursorControls(item.text)) {
|
|
59
58
|
const styledLines = parseAnsi(item.text, hasAnsi(item.text) ? {} : itemStyle);
|
|
60
59
|
let firstRow = true;
|
|
@@ -117,12 +116,12 @@ function appendSegment(segments, text, style) {
|
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
function stylesEqual(left, right) {
|
|
120
|
-
return left.fg === right.fg
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
return (left.fg === right.fg &&
|
|
120
|
+
left.bg === right.bg &&
|
|
121
|
+
left.bold === right.bold &&
|
|
122
|
+
left.dim === right.dim &&
|
|
123
|
+
left.inverse === right.inverse &&
|
|
124
|
+
left.underline === right.underline);
|
|
126
125
|
}
|
|
127
126
|
function getPrefix(kind) {
|
|
128
127
|
if (kind === "success") {
|
|
@@ -139,23 +138,21 @@ function getPrefix(kind) {
|
|
|
139
138
|
}
|
|
140
139
|
return "◇";
|
|
141
140
|
}
|
|
142
|
-
function getItemStyle(kind
|
|
141
|
+
function getItemStyle(kind) {
|
|
142
|
+
const styles = getTheme().styles;
|
|
143
143
|
if (kind === "success") {
|
|
144
|
-
return
|
|
144
|
+
return styles.success;
|
|
145
145
|
}
|
|
146
146
|
if (kind === "error") {
|
|
147
|
-
return
|
|
147
|
+
return styles.error;
|
|
148
148
|
}
|
|
149
149
|
if (kind === "tool") {
|
|
150
|
-
return
|
|
150
|
+
return styles.muted;
|
|
151
151
|
}
|
|
152
152
|
if (kind === "status") {
|
|
153
|
-
return
|
|
153
|
+
return styles.info;
|
|
154
154
|
}
|
|
155
|
-
return
|
|
156
|
-
}
|
|
157
|
-
function getMutedStyle(themeName) {
|
|
158
|
-
return themeName === "light" ? { fg: "#666666" } : { dim: true };
|
|
155
|
+
return styles.info;
|
|
159
156
|
}
|
|
160
157
|
function wrapText(value, width) {
|
|
161
158
|
const logicalLines = splitLogicalLines(value);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getTheme } from "../../internal/theme-detect.js";
|
|
2
|
-
import { light } from "../../tokens/colors.js";
|
|
3
2
|
export function renderStatsPane(buffer, rect, stats) {
|
|
4
3
|
buffer.clearRect(rect);
|
|
5
4
|
if (rect.width <= 0 || rect.height <= 0) {
|
|
@@ -104,18 +103,5 @@ function getStatusStyle(status) {
|
|
|
104
103
|
return getToneStyle("muted");
|
|
105
104
|
}
|
|
106
105
|
function getToneStyle(tone) {
|
|
107
|
-
|
|
108
|
-
if (tone === "muted") {
|
|
109
|
-
return isLightTheme ? { fg: "#666666" } : { dim: true };
|
|
110
|
-
}
|
|
111
|
-
if (tone === "info") {
|
|
112
|
-
return isLightTheme ? { fg: "#a200ff" } : { fg: "magenta" };
|
|
113
|
-
}
|
|
114
|
-
if (tone === "warning") {
|
|
115
|
-
return isLightTheme ? { fg: "#cc6600" } : { fg: "yellow" };
|
|
116
|
-
}
|
|
117
|
-
if (tone === "error") {
|
|
118
|
-
return isLightTheme ? { fg: "#cc0000" } : { fg: "red" };
|
|
119
|
-
}
|
|
120
|
-
return isLightTheme ? { fg: "#008800" } : { fg: "green" };
|
|
106
|
+
return getTheme().styles[tone];
|
|
121
107
|
}
|
|
@@ -117,14 +117,14 @@ const reviewComments = {
|
|
|
117
117
|
{
|
|
118
118
|
id: "pr-1847-comment-1",
|
|
119
119
|
title: "Review: detail loading",
|
|
120
|
-
subtitle: "packages/design
|
|
120
|
+
subtitle: "packages/toolcraft-design/src/explorer/jobs.ts:19",
|
|
121
121
|
body: "The 150 ms loading threshold is the right behavior. This demo should make that visible with --slow-detail.",
|
|
122
122
|
tone: "success"
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
id: "pr-1847-comment-2",
|
|
126
126
|
title: "Review: destructive confirm",
|
|
127
|
-
subtitle: "packages/design
|
|
127
|
+
subtitle: "packages/toolcraft-design/src/explorer/reducer.ts:435",
|
|
128
128
|
body: "Confirm modal behavior should be reachable from manual QA with a simple keybinding.",
|
|
129
129
|
tone: "warning"
|
|
130
130
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getTheme } from "../internal/theme-detect.js";
|
|
2
|
+
export function getExplorerTheme() {
|
|
3
|
+
const theme = getTheme();
|
|
4
|
+
return {
|
|
5
|
+
accent: theme.accent,
|
|
6
|
+
muted: theme.muted,
|
|
7
|
+
border: theme.muted,
|
|
8
|
+
borderFocused: theme.accent,
|
|
9
|
+
badge: (text, tone) => theme[tone](` ${text} `),
|
|
10
|
+
matchHighlight: (text) => theme.accent(`\u001b[4m${text}\u001b[24m`)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function getExplorerStyles() {
|
|
14
|
+
const styles = getTheme().styles;
|
|
15
|
+
return {
|
|
16
|
+
accent: styles.accent,
|
|
17
|
+
muted: styles.muted,
|
|
18
|
+
border: styles.muted,
|
|
19
|
+
borderFocused: styles.accent,
|
|
20
|
+
matchHighlight: { ...styles.accent, underline: true },
|
|
21
|
+
tones: {
|
|
22
|
+
success: styles.success,
|
|
23
|
+
warning: styles.warning,
|
|
24
|
+
error: styles.error,
|
|
25
|
+
info: styles.info,
|
|
26
|
+
muted: styles.muted
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * as tokens from "./tokens/index.js";
|
|
2
2
|
export { brand, dark, light } from "./tokens/colors.js";
|
|
3
|
+
export { brands } from "./tokens/brand.js";
|
|
4
|
+
export type { Brand } from "./tokens/brand.js";
|
|
3
5
|
export type { ThemeName, ThemePalette } from "./tokens/colors.js";
|
|
4
6
|
export { spacing } from "./tokens/spacing.js";
|
|
5
7
|
export { typography } from "./tokens/typography.js";
|
|
@@ -17,6 +19,8 @@ export { formatCommandNotFound } from "./components/command-errors.js";
|
|
|
17
19
|
export { formatCommandNotFoundPanel } from "./components/command-errors.js";
|
|
18
20
|
export { renderTable } from "./components/table.js";
|
|
19
21
|
export type { TableColumn, RenderTableOptions } from "./components/table.js";
|
|
22
|
+
export { renderCatalog } from "./components/catalog.js";
|
|
23
|
+
export type { CatalogGroup, CatalogItem, CatalogMetric, CatalogTone, RenderCatalogOptions } from "./components/catalog.js";
|
|
20
24
|
export { renderDetailCard } from "./components/detail-card.js";
|
|
21
25
|
export type { DetailCardRow, DetailCardSection, RenderDetailCardOptions } from "./components/detail-card.js";
|
|
22
26
|
export { getTemplatePartialNames, renderTemplate, resolveTemplatePartials } from "./components/template.js";
|
|
@@ -28,7 +32,7 @@ export { createDashboard, shouldUseInteractiveDashboard } from "./dashboard/inde
|
|
|
28
32
|
export type { Dashboard, DashboardOptions } from "./dashboard/index.js";
|
|
29
33
|
export * as explorer from "./explorer/index.js";
|
|
30
34
|
export { runExplorer, singleDetail } from "./explorer/index.js";
|
|
31
|
-
export type { Row, DetailItem, Detail, DetailCtx, Action, ActionContext, ExplorerConfig, ReorderContext, Tone
|
|
35
|
+
export type { Row, DetailItem, Detail, DetailCtx, Action, ActionContext, ExplorerConfig, ReorderContext, Tone } from "./explorer/index.js";
|
|
32
36
|
export * as prompts from "./prompts/index.js";
|
|
33
37
|
export { intro, introPlain, outro, note, select, multiselect, text as promptText, confirm, confirmOrCancel, password, spinner, withSpinner, isCancel, cancel, log, PromptCancelledError } from "./prompts/index.js";
|
|
34
38
|
export type { SelectOptions, MultiselectOptions, TextOptions, ConfirmOptions, PasswordOptions, SpinnerOptions, WithSpinnerOptions } from "./prompts/index.js";
|
|
@@ -40,5 +44,7 @@ export { parse, render, renderMarkdown } from "./terminal-markdown/index.js";
|
|
|
40
44
|
export type { MdNode, RenderOptions } from "./terminal-markdown/index.js";
|
|
41
45
|
export { getTheme, resolveThemeName, resetThemeCache } from "./internal/theme-detect.js";
|
|
42
46
|
export type { ThemeEnv } from "./internal/theme-detect.js";
|
|
47
|
+
export { configureTheme, getThemeConfig, resetTheme } from "./internal/theme-state.js";
|
|
48
|
+
export { stripAnsi } from "./internal/strip-ansi.js";
|
|
43
49
|
export { resolveOutputFormat, resetOutputFormatCache, withOutputFormat } from "./internal/output-format.js";
|
|
44
50
|
export type { OutputFormat } from "./internal/output-format.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Tokens
|
|
2
2
|
export * as tokens from "./tokens/index.js";
|
|
3
3
|
export { brand, dark, light } from "./tokens/colors.js";
|
|
4
|
+
export { brands } from "./tokens/brand.js";
|
|
4
5
|
export { spacing } from "./tokens/spacing.js";
|
|
5
6
|
export { typography } from "./tokens/typography.js";
|
|
6
7
|
export { widths } from "./tokens/widths.js";
|
|
@@ -14,6 +15,7 @@ export * as helpFormatterPlain from "./components/help-formatter-plain.js";
|
|
|
14
15
|
export { formatCommandNotFound } from "./components/command-errors.js";
|
|
15
16
|
export { formatCommandNotFoundPanel } from "./components/command-errors.js";
|
|
16
17
|
export { renderTable } from "./components/table.js";
|
|
18
|
+
export { renderCatalog } from "./components/catalog.js";
|
|
17
19
|
export { renderDetailCard } from "./components/detail-card.js";
|
|
18
20
|
export { getTemplatePartialNames, renderTemplate, resolveTemplatePartials } from "./components/template.js";
|
|
19
21
|
export { openExternal } from "./components/browser.js";
|
|
@@ -36,4 +38,6 @@ export { SPINNER_FRAMES, renderSpinnerFrame, renderSpinnerStopped, renderMenu }
|
|
|
36
38
|
export { parse, render, renderMarkdown } from "./terminal-markdown/index.js";
|
|
37
39
|
// Internal utilities (for advanced use)
|
|
38
40
|
export { getTheme, resolveThemeName, resetThemeCache } from "./internal/theme-detect.js";
|
|
41
|
+
export { configureTheme, getThemeConfig, resetTheme } from "./internal/theme-state.js";
|
|
42
|
+
export { stripAnsi } from "./internal/strip-ansi.js";
|
|
39
43
|
export { resolveOutputFormat, resetOutputFormatCache, withOutputFormat } from "./internal/output-format.js";
|
package/node_modules/{@poe-code/design-system → toolcraft-design}/dist/internal/theme-detect.js
RENAMED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getThemeConfig, getThemeRevision, isThemeBrandConfigured } from "./theme-state.js";
|
|
2
|
+
import { brands } from "../tokens/brand.js";
|
|
3
|
+
import { createPalette, dark, light } from "../tokens/colors.js";
|
|
2
4
|
function detectThemeFromEnv(env) {
|
|
3
5
|
const apple = env.APPLE_INTERFACE_STYLE;
|
|
4
6
|
if (typeof apple === "string") {
|
|
@@ -35,15 +37,35 @@ export function resolveThemeName(env = process.env) {
|
|
|
35
37
|
}
|
|
36
38
|
return "dark";
|
|
37
39
|
}
|
|
38
|
-
|
|
40
|
+
const themeCache = new Map();
|
|
41
|
+
let cachedRevision = -1;
|
|
39
42
|
export function getTheme(env) {
|
|
43
|
+
const themeName = resolveThemeName(env);
|
|
44
|
+
const config = getThemeConfig();
|
|
45
|
+
const requestedBrand = env?.POE_BRAND?.toLowerCase();
|
|
46
|
+
const activeBrandName = !isThemeBrandConfigured() && requestedBrand && Object.hasOwn(brands, requestedBrand)
|
|
47
|
+
? requestedBrand
|
|
48
|
+
: config.brand;
|
|
49
|
+
const revision = getThemeRevision();
|
|
50
|
+
if (revision !== cachedRevision) {
|
|
51
|
+
themeCache.clear();
|
|
52
|
+
cachedRevision = revision;
|
|
53
|
+
}
|
|
54
|
+
const cacheKey = `${activeBrandName}:${themeName}`;
|
|
55
|
+
const cachedTheme = themeCache.get(cacheKey);
|
|
40
56
|
if (cachedTheme) {
|
|
41
57
|
return cachedTheme;
|
|
42
58
|
}
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
59
|
+
const activeBrand = brands[activeBrandName];
|
|
60
|
+
const theme = activeBrandName === "purple"
|
|
61
|
+
? themeName === "light"
|
|
62
|
+
? light
|
|
63
|
+
: dark
|
|
64
|
+
: createPalette(activeBrand, themeName);
|
|
65
|
+
themeCache.set(cacheKey, theme);
|
|
66
|
+
return theme;
|
|
46
67
|
}
|
|
47
68
|
export function resetThemeCache() {
|
|
48
|
-
|
|
69
|
+
themeCache.clear();
|
|
70
|
+
cachedRevision = getThemeRevision();
|
|
49
71
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ThemeConfig {
|
|
2
|
+
brand: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function configureTheme(patch: {
|
|
6
|
+
brand?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
}): void;
|
|
9
|
+
export declare function getThemeConfig(): ThemeConfig;
|
|
10
|
+
export declare function getThemeRevision(): number;
|
|
11
|
+
export declare function isThemeBrandConfigured(): boolean;
|
|
12
|
+
export declare function resetTheme(): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { brands } from "../tokens/brand.js";
|
|
2
|
+
const defaults = {
|
|
3
|
+
brand: "purple",
|
|
4
|
+
label: "Poe"
|
|
5
|
+
};
|
|
6
|
+
let config = { ...defaults };
|
|
7
|
+
let revision = 0;
|
|
8
|
+
let brandConfigured = false;
|
|
9
|
+
export function configureTheme(patch) {
|
|
10
|
+
if (patch.brand !== undefined && !Object.hasOwn(brands, patch.brand)) {
|
|
11
|
+
throw new Error(`Unknown brand: ${patch.brand}`);
|
|
12
|
+
}
|
|
13
|
+
config = {
|
|
14
|
+
brand: patch.brand ?? config.brand,
|
|
15
|
+
label: patch.label ?? config.label
|
|
16
|
+
};
|
|
17
|
+
if (patch.brand !== undefined) {
|
|
18
|
+
brandConfigured = true;
|
|
19
|
+
}
|
|
20
|
+
revision += 1;
|
|
21
|
+
}
|
|
22
|
+
export function getThemeConfig() {
|
|
23
|
+
return { ...config };
|
|
24
|
+
}
|
|
25
|
+
export function getThemeRevision() {
|
|
26
|
+
return revision;
|
|
27
|
+
}
|
|
28
|
+
export function isThemeBrandConfigured() {
|
|
29
|
+
return brandConfigured;
|
|
30
|
+
}
|
|
31
|
+
export function resetTheme() {
|
|
32
|
+
config = { ...defaults };
|
|
33
|
+
brandConfigured = false;
|
|
34
|
+
revision += 1;
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getThemeConfig } from "../internal/theme-state.js";
|
|
2
|
+
import { brands } from "../tokens/brand.js";
|
|
3
|
+
export const promptTheme = {
|
|
4
|
+
symbols: {
|
|
5
|
+
initial: "◆",
|
|
6
|
+
active: "◆",
|
|
7
|
+
inactive: "○",
|
|
8
|
+
success: "◇"
|
|
9
|
+
},
|
|
10
|
+
style: {
|
|
11
|
+
get accentColor() {
|
|
12
|
+
return brands[getThemeConfig().brand].primary;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -77,6 +77,10 @@ class YamlSubsetParser {
|
|
|
77
77
|
}
|
|
78
78
|
readEntryValue(entry, currentIndent) {
|
|
79
79
|
if (entry.value !== undefined) {
|
|
80
|
+
const chomping = blockScalarChomping(entry.value);
|
|
81
|
+
if (chomping !== null) {
|
|
82
|
+
return this.readBlockScalar(currentIndent, chomping);
|
|
83
|
+
}
|
|
80
84
|
return parseScalar(entry.value);
|
|
81
85
|
}
|
|
82
86
|
const nestedLine = this.peekMeaningfulLine();
|
|
@@ -87,6 +91,25 @@ class YamlSubsetParser {
|
|
|
87
91
|
? this.parseArray(nestedLine.indent)
|
|
88
92
|
: this.parseObject(nestedLine.indent);
|
|
89
93
|
}
|
|
94
|
+
readBlockScalar(parentIndent, chomping) {
|
|
95
|
+
const collected = [];
|
|
96
|
+
while (this.position < this.lines.length) {
|
|
97
|
+
const line = this.lines[this.position];
|
|
98
|
+
if (line.content.length > 0 && line.indent <= parentIndent) {
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
collected.push(line);
|
|
102
|
+
this.position += 1;
|
|
103
|
+
}
|
|
104
|
+
const contentIndents = collected
|
|
105
|
+
.filter((line) => line.content.length > 0)
|
|
106
|
+
.map((line) => line.indent);
|
|
107
|
+
const blockIndent = contentIndents.length === 0 ? parentIndent + 1 : Math.min(...contentIndents);
|
|
108
|
+
const textLines = collected.map((line) => line.content.length === 0
|
|
109
|
+
? ""
|
|
110
|
+
: " ".repeat(Math.max(0, line.indent - blockIndent)) + line.content);
|
|
111
|
+
return chompBlockScalar(textLines, chomping);
|
|
112
|
+
}
|
|
90
113
|
peekMeaningfulLine() {
|
|
91
114
|
let index = this.position;
|
|
92
115
|
while (index < this.lines.length) {
|
|
@@ -203,6 +226,33 @@ function isArrayItem(content) {
|
|
|
203
226
|
const nextCharacter = content[1];
|
|
204
227
|
return nextCharacter === " " || nextCharacter === "\t";
|
|
205
228
|
}
|
|
229
|
+
function blockScalarChomping(value) {
|
|
230
|
+
if (value === "|") {
|
|
231
|
+
return "clip";
|
|
232
|
+
}
|
|
233
|
+
if (value === "|-") {
|
|
234
|
+
return "strip";
|
|
235
|
+
}
|
|
236
|
+
if (value === "|+") {
|
|
237
|
+
return "keep";
|
|
238
|
+
}
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
function chompBlockScalar(lines, chomping) {
|
|
242
|
+
if (chomping === "keep") {
|
|
243
|
+
return lines.map((line) => `${line}\n`).join("");
|
|
244
|
+
}
|
|
245
|
+
let end = lines.length;
|
|
246
|
+
while (end > 0 && lines[end - 1].length === 0) {
|
|
247
|
+
end -= 1;
|
|
248
|
+
}
|
|
249
|
+
const trimmed = lines.slice(0, end);
|
|
250
|
+
if (trimmed.length === 0) {
|
|
251
|
+
return "";
|
|
252
|
+
}
|
|
253
|
+
const joined = trimmed.join("\n");
|
|
254
|
+
return chomping === "clip" ? `${joined}\n` : joined;
|
|
255
|
+
}
|
|
206
256
|
function parseScalar(value) {
|
|
207
257
|
if (value.length === 0) {
|
|
208
258
|
return "";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Brand } from "./brand.js";
|
|
2
|
+
export declare const brand: string;
|
|
3
|
+
export type ThemeName = "dark" | "light";
|
|
4
|
+
export interface ThemeCellStyle {
|
|
5
|
+
fg?: string;
|
|
6
|
+
bold?: boolean;
|
|
7
|
+
dim?: boolean;
|
|
8
|
+
underline?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ThemeCellStyles {
|
|
11
|
+
accent: ThemeCellStyle;
|
|
12
|
+
muted: ThemeCellStyle;
|
|
13
|
+
success: ThemeCellStyle;
|
|
14
|
+
warning: ThemeCellStyle;
|
|
15
|
+
error: ThemeCellStyle;
|
|
16
|
+
info: ThemeCellStyle;
|
|
17
|
+
}
|
|
18
|
+
export interface ThemePalette {
|
|
19
|
+
header: (text: string) => string;
|
|
20
|
+
divider: (text: string) => string;
|
|
21
|
+
prompt: (text: string) => string;
|
|
22
|
+
number: (text: string) => string;
|
|
23
|
+
intro: (text: string) => string;
|
|
24
|
+
resolvedSymbol: string;
|
|
25
|
+
errorSymbol: string;
|
|
26
|
+
accent: (text: string) => string;
|
|
27
|
+
muted: (text: string) => string;
|
|
28
|
+
success: (text: string) => string;
|
|
29
|
+
warning: (text: string) => string;
|
|
30
|
+
error: (text: string) => string;
|
|
31
|
+
info: (text: string) => string;
|
|
32
|
+
badge: (text: string) => string;
|
|
33
|
+
styles: ThemeCellStyles;
|
|
34
|
+
}
|
|
35
|
+
export declare function createPalette(activeBrand: Brand, mode: ThemeName): ThemePalette;
|
|
36
|
+
export declare const dark: ThemePalette;
|
|
37
|
+
export declare const light: ThemePalette;
|