claude-code-plus-plus 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.d.ts +52 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +318 -0
- package/dist/app.js.map +1 -0
- package/dist/cli/commands/index.d.ts +5 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +5 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/start.d.ts +16 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/commands/start.js +20 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/parser.d.ts +31 -0
- package/dist/cli/parser.d.ts.map +1 -0
- package/dist/cli/parser.js +112 -0
- package/dist/cli/parser.js.map +1 -0
- package/dist/cli/validators.d.ts +46 -0
- package/dist/cli/validators.d.ts.map +1 -0
- package/dist/cli/validators.js +149 -0
- package/dist/cli/validators.js.map +1 -0
- package/dist/config/defaults.d.ts +14 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +27 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +12 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +38 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +107 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/paths.d.ts +47 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +86 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/schema.d.ts +15 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +32 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/core/index.d.ts +13 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +13 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/session/index.d.ts +7 -0
- package/dist/core/session/index.d.ts.map +1 -0
- package/dist/core/session/index.js +6 -0
- package/dist/core/session/index.js.map +1 -0
- package/dist/core/session/session-manager.d.ts +46 -0
- package/dist/core/session/session-manager.d.ts.map +1 -0
- package/dist/core/session/session-manager.js +245 -0
- package/dist/core/session/session-manager.js.map +1 -0
- package/dist/core/session/session.d.ts +44 -0
- package/dist/core/session/session.d.ts.map +1 -0
- package/dist/core/session/session.js +78 -0
- package/dist/core/session/session.js.map +1 -0
- package/dist/core/terminal/index.d.ts +7 -0
- package/dist/core/terminal/index.d.ts.map +1 -0
- package/dist/core/terminal/index.js +6 -0
- package/dist/core/terminal/index.js.map +1 -0
- package/dist/core/terminal/terminal-manager.d.ts +36 -0
- package/dist/core/terminal/terminal-manager.d.ts.map +1 -0
- package/dist/core/terminal/terminal-manager.js +182 -0
- package/dist/core/terminal/terminal-manager.js.map +1 -0
- package/dist/core/terminal/terminal.d.ts +27 -0
- package/dist/core/terminal/terminal.d.ts.map +1 -0
- package/dist/core/terminal/terminal.js +38 -0
- package/dist/core/terminal/terminal.js.map +1 -0
- package/dist/core/workspace/index.d.ts +7 -0
- package/dist/core/workspace/index.d.ts.map +1 -0
- package/dist/core/workspace/index.js +6 -0
- package/dist/core/workspace/index.js.map +1 -0
- package/dist/core/workspace/workspace-manager.d.ts +59 -0
- package/dist/core/workspace/workspace-manager.d.ts.map +1 -0
- package/dist/core/workspace/workspace-manager.js +224 -0
- package/dist/core/workspace/workspace-manager.js.map +1 -0
- package/dist/core/workspace/workspace.d.ts +56 -0
- package/dist/core/workspace/workspace.d.ts.map +1 -0
- package/dist/core/workspace/workspace.js +96 -0
- package/dist/core/workspace/workspace.js.map +1 -0
- package/dist/core/worktree/index.d.ts +7 -0
- package/dist/core/worktree/index.d.ts.map +1 -0
- package/dist/core/worktree/index.js +6 -0
- package/dist/core/worktree/index.js.map +1 -0
- package/dist/core/worktree/worktree-manager.d.ts +47 -0
- package/dist/core/worktree/worktree-manager.d.ts.map +1 -0
- package/dist/core/worktree/worktree-manager.js +170 -0
- package/dist/core/worktree/worktree-manager.js.map +1 -0
- package/dist/core/worktree/worktree.d.ts +35 -0
- package/dist/core/worktree/worktree.d.ts.map +1 -0
- package/dist/core/worktree/worktree.js +50 -0
- package/dist/core/worktree/worktree.js.map +1 -0
- package/dist/events/bus.d.ts +76 -0
- package/dist/events/bus.d.ts.map +1 -0
- package/dist/events/bus.js +223 -0
- package/dist/events/bus.js.map +1 -0
- package/dist/events/handlers/index.d.ts +28 -0
- package/dist/events/handlers/index.d.ts.map +1 -0
- package/dist/events/handlers/index.js +44 -0
- package/dist/events/handlers/index.js.map +1 -0
- package/dist/events/handlers/session-events.d.ts +12 -0
- package/dist/events/handlers/session-events.d.ts.map +1 -0
- package/dist/events/handlers/session-events.js +38 -0
- package/dist/events/handlers/session-events.js.map +1 -0
- package/dist/events/handlers/terminal-events.d.ts +12 -0
- package/dist/events/handlers/terminal-events.d.ts.map +1 -0
- package/dist/events/handlers/terminal-events.js +37 -0
- package/dist/events/handlers/terminal-events.js.map +1 -0
- package/dist/events/handlers/ui-events.d.ts +11 -0
- package/dist/events/handlers/ui-events.d.ts.map +1 -0
- package/dist/events/handlers/ui-events.js +202 -0
- package/dist/events/handlers/ui-events.js.map +1 -0
- package/dist/events/index.d.ts +9 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +10 -0
- package/dist/events/index.js.map +1 -0
- package/dist/git/index.d.ts +5 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +5 -0
- package/dist/git/index.js.map +1 -0
- package/dist/git/worktree.d.ts +44 -0
- package/dist/git/worktree.d.ts.map +1 -0
- package/dist/git/worktree.js +158 -0
- package/dist/git/worktree.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -144
- package/dist/index.js.map +1 -1
- package/dist/launcher/index.d.ts +24 -0
- package/dist/launcher/index.d.ts.map +1 -0
- package/dist/launcher/index.js +226 -0
- package/dist/launcher/index.js.map +1 -0
- package/dist/multiplexer/base.d.ts +73 -0
- package/dist/multiplexer/base.d.ts.map +1 -0
- package/dist/multiplexer/base.js +68 -0
- package/dist/multiplexer/base.js.map +1 -0
- package/dist/multiplexer/factory.d.ts +28 -0
- package/dist/multiplexer/factory.d.ts.map +1 -0
- package/dist/multiplexer/factory.js +72 -0
- package/dist/multiplexer/factory.js.map +1 -0
- package/dist/multiplexer/index.d.ts +14 -0
- package/dist/multiplexer/index.d.ts.map +1 -0
- package/dist/multiplexer/index.js +15 -0
- package/dist/multiplexer/index.js.map +1 -0
- package/dist/multiplexer/tmux/index.d.ts +9 -0
- package/dist/multiplexer/tmux/index.d.ts.map +1 -0
- package/dist/multiplexer/tmux/index.js +7 -0
- package/dist/multiplexer/tmux/index.js.map +1 -0
- package/dist/multiplexer/tmux/tmux-commands.d.ts +96 -0
- package/dist/multiplexer/tmux/tmux-commands.d.ts.map +1 -0
- package/dist/multiplexer/tmux/tmux-commands.js +282 -0
- package/dist/multiplexer/tmux/tmux-commands.js.map +1 -0
- package/dist/multiplexer/tmux/tmux-config.d.ts +57 -0
- package/dist/multiplexer/tmux/tmux-config.d.ts.map +1 -0
- package/dist/multiplexer/tmux/tmux-config.js +103 -0
- package/dist/multiplexer/tmux/tmux-config.js.map +1 -0
- package/dist/multiplexer/tmux/tmux-multiplexer.d.ts +94 -0
- package/dist/multiplexer/tmux/tmux-multiplexer.d.ts.map +1 -0
- package/dist/multiplexer/tmux/tmux-multiplexer.js +302 -0
- package/dist/multiplexer/tmux/tmux-multiplexer.js.map +1 -0
- package/dist/multiplexer/windows/index.d.ts +5 -0
- package/dist/multiplexer/windows/index.d.ts.map +1 -0
- package/dist/multiplexer/windows/index.js +5 -0
- package/dist/multiplexer/windows/index.js.map +1 -0
- package/dist/multiplexer/windows/windows-multiplexer.d.ts +61 -0
- package/dist/multiplexer/windows/windows-multiplexer.d.ts.map +1 -0
- package/dist/multiplexer/windows/windows-multiplexer.js +151 -0
- package/dist/multiplexer/windows/windows-multiplexer.js.map +1 -0
- package/dist/platform/clipboard.d.ts +26 -0
- package/dist/platform/clipboard.d.ts.map +1 -0
- package/dist/platform/clipboard.js +154 -0
- package/dist/platform/clipboard.js.map +1 -0
- package/dist/platform/detector.d.ts +78 -0
- package/dist/platform/detector.d.ts.map +1 -0
- package/dist/platform/detector.js +169 -0
- package/dist/platform/detector.js.map +1 -0
- package/dist/platform/index.d.ts +14 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +15 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/paths.d.ts +63 -0
- package/dist/platform/paths.d.ts.map +1 -0
- package/dist/platform/paths.js +149 -0
- package/dist/platform/paths.js.map +1 -0
- package/dist/platform/shell.d.ts +43 -0
- package/dist/platform/shell.d.ts.map +1 -0
- package/dist/platform/shell.js +187 -0
- package/dist/platform/shell.js.map +1 -0
- package/dist/services/claude/claude-detector.d.ts +37 -0
- package/dist/services/claude/claude-detector.d.ts.map +1 -0
- package/dist/services/claude/claude-detector.js +83 -0
- package/dist/services/claude/claude-detector.js.map +1 -0
- package/dist/services/claude/claude-service.d.ts +57 -0
- package/dist/services/claude/claude-service.d.ts.map +1 -0
- package/dist/services/claude/claude-service.js +108 -0
- package/dist/services/claude/claude-service.js.map +1 -0
- package/dist/services/claude/index.d.ts +7 -0
- package/dist/services/claude/index.d.ts.map +1 -0
- package/dist/services/claude/index.js +6 -0
- package/dist/services/claude/index.js.map +1 -0
- package/dist/services/git/branch-service.d.ts +64 -0
- package/dist/services/git/branch-service.d.ts.map +1 -0
- package/dist/services/git/branch-service.js +217 -0
- package/dist/services/git/branch-service.js.map +1 -0
- package/dist/services/git/git-service.d.ts +44 -0
- package/dist/services/git/git-service.d.ts.map +1 -0
- package/dist/services/git/git-service.js +145 -0
- package/dist/services/git/git-service.js.map +1 -0
- package/dist/services/git/index.d.ts +8 -0
- package/dist/services/git/index.d.ts.map +1 -0
- package/dist/services/git/index.js +7 -0
- package/dist/services/git/index.js.map +1 -0
- package/dist/services/git/worktree-service.d.ts +61 -0
- package/dist/services/git/worktree-service.d.ts.map +1 -0
- package/dist/services/git/worktree-service.js +243 -0
- package/dist/services/git/worktree-service.js.map +1 -0
- package/dist/services/index.d.ts +12 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +12 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/process/index.d.ts +8 -0
- package/dist/services/process/index.d.ts.map +1 -0
- package/dist/services/process/index.js +6 -0
- package/dist/services/process/index.js.map +1 -0
- package/dist/services/process/process-monitor.d.ts +98 -0
- package/dist/services/process/process-monitor.d.ts.map +1 -0
- package/dist/services/process/process-monitor.js +173 -0
- package/dist/services/process/process-monitor.js.map +1 -0
- package/dist/services/process/process-spawner.d.ts +55 -0
- package/dist/services/process/process-spawner.d.ts.map +1 -0
- package/dist/services/process/process-spawner.js +93 -0
- package/dist/services/process/process-spawner.js.map +1 -0
- package/dist/sidebar/app.d.ts +70 -0
- package/dist/sidebar/app.d.ts.map +1 -0
- package/dist/sidebar/app.js +1203 -0
- package/dist/sidebar/app.js.map +1 -0
- package/dist/sidebar/index.d.ts +8 -0
- package/dist/sidebar/index.d.ts.map +1 -0
- package/dist/sidebar/index.js +26 -0
- package/dist/sidebar/index.js.map +1 -0
- package/dist/sidebar/input.d.ts +33 -0
- package/dist/sidebar/input.d.ts.map +1 -0
- package/dist/sidebar/input.js +153 -0
- package/dist/sidebar/input.js.map +1 -0
- package/dist/sidebar/render.d.ts +73 -0
- package/dist/sidebar/render.d.ts.map +1 -0
- package/dist/sidebar/render.js +403 -0
- package/dist/sidebar/render.js.map +1 -0
- package/dist/state/actions.d.ts +49 -0
- package/dist/state/actions.d.ts.map +1 -0
- package/dist/state/actions.js +512 -0
- package/dist/state/actions.js.map +1 -0
- package/dist/state/index.d.ts +16 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +28 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/middleware/index.d.ts +7 -0
- package/dist/state/middleware/index.d.ts.map +1 -0
- package/dist/state/middleware/index.js +6 -0
- package/dist/state/middleware/index.js.map +1 -0
- package/dist/state/middleware/logger.d.ts +22 -0
- package/dist/state/middleware/logger.d.ts.map +1 -0
- package/dist/state/middleware/logger.js +45 -0
- package/dist/state/middleware/logger.js.map +1 -0
- package/dist/state/middleware/persistence.d.ts +29 -0
- package/dist/state/middleware/persistence.d.ts.map +1 -0
- package/dist/state/middleware/persistence.js +71 -0
- package/dist/state/middleware/persistence.js.map +1 -0
- package/dist/state/persistence/file-adapter.d.ts +48 -0
- package/dist/state/persistence/file-adapter.d.ts.map +1 -0
- package/dist/state/persistence/file-adapter.js +96 -0
- package/dist/state/persistence/file-adapter.js.map +1 -0
- package/dist/state/persistence/index.d.ts +8 -0
- package/dist/state/persistence/index.d.ts.map +1 -0
- package/dist/state/persistence/index.js +6 -0
- package/dist/state/persistence/index.js.map +1 -0
- package/dist/state/persistence/serializer.d.ts +41 -0
- package/dist/state/persistence/serializer.d.ts.map +1 -0
- package/dist/state/persistence/serializer.js +114 -0
- package/dist/state/persistence/serializer.js.map +1 -0
- package/dist/state/selectors.d.ts +67 -0
- package/dist/state/selectors.d.ts.map +1 -0
- package/dist/state/selectors.js +177 -0
- package/dist/state/selectors.js.map +1 -0
- package/dist/state/store.d.ts +86 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/store.js +161 -0
- package/dist/state/store.js.map +1 -0
- package/dist/state/types.d.ts +269 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/state/types.js +7 -0
- package/dist/state/types.js.map +1 -0
- package/dist/terminal/bar-handler.d.ts +15 -0
- package/dist/terminal/bar-handler.d.ts.map +1 -0
- package/dist/terminal/bar-handler.js +242 -0
- package/dist/terminal/bar-handler.js.map +1 -0
- package/dist/terminal/bar-render.d.ts +33 -0
- package/dist/terminal/bar-render.d.ts.map +1 -0
- package/dist/terminal/bar-render.js +122 -0
- package/dist/terminal/bar-render.js.map +1 -0
- package/dist/terminal/index.d.ts +8 -0
- package/dist/terminal/index.d.ts.map +1 -0
- package/dist/terminal/index.js +9 -0
- package/dist/terminal/index.js.map +1 -0
- package/dist/tmux/commands.d.ts +26 -0
- package/dist/tmux/commands.d.ts.map +1 -0
- package/dist/tmux/commands.js +67 -0
- package/dist/tmux/commands.js.map +1 -0
- package/dist/tmux/index.d.ts +6 -0
- package/dist/tmux/index.d.ts.map +1 -0
- package/dist/tmux/index.js +16 -0
- package/dist/tmux/index.js.map +1 -0
- package/dist/tmux/pane.d.ts +111 -0
- package/dist/tmux/pane.d.ts.map +1 -0
- package/dist/tmux/pane.js +206 -0
- package/dist/tmux/pane.js.map +1 -0
- package/dist/types/config.d.ts +103 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +7 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/entities.d.ts +88 -0
- package/dist/types/entities.d.ts.map +1 -0
- package/dist/types/entities.js +8 -0
- package/dist/types/entities.js.map +1 -0
- package/dist/types/events.d.ts +156 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +8 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/multiplexer.d.ts +238 -0
- package/dist/types/multiplexer.d.ts.map +1 -0
- package/dist/types/multiplexer.js +8 -0
- package/dist/types/multiplexer.js.map +1 -0
- package/dist/types.d.ts +67 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -2
- package/dist/types.js.map +1 -1
- package/dist/ui/components/base.d.ts +155 -0
- package/dist/ui/components/base.d.ts.map +1 -0
- package/dist/ui/components/base.js +269 -0
- package/dist/ui/components/base.js.map +1 -0
- package/dist/ui/components/index.d.ts +10 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +10 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/components/input-field.d.ts +98 -0
- package/dist/ui/components/input-field.d.ts.map +1 -0
- package/dist/ui/components/input-field.js +274 -0
- package/dist/ui/components/input-field.js.map +1 -0
- package/dist/ui/components/list.d.ts +94 -0
- package/dist/ui/components/list.d.ts.map +1 -0
- package/dist/ui/components/list.js +294 -0
- package/dist/ui/components/list.js.map +1 -0
- package/dist/ui/components/modal.d.ts +83 -0
- package/dist/ui/components/modal.d.ts.map +1 -0
- package/dist/ui/components/modal.js +249 -0
- package/dist/ui/components/modal.js.map +1 -0
- package/dist/ui/components/tabs.d.ts +97 -0
- package/dist/ui/components/tabs.d.ts.map +1 -0
- package/dist/ui/components/tabs.js +252 -0
- package/dist/ui/components/tabs.js.map +1 -0
- package/dist/ui/components/text.d.ts +60 -0
- package/dist/ui/components/text.d.ts.map +1 -0
- package/dist/ui/components/text.js +224 -0
- package/dist/ui/components/text.js.map +1 -0
- package/dist/ui/index.d.ts +12 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +18 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input/index.d.ts +8 -0
- package/dist/ui/input/index.d.ts.map +1 -0
- package/dist/ui/input/index.js +8 -0
- package/dist/ui/input/index.js.map +1 -0
- package/dist/ui/input/input-manager.d.ts +83 -0
- package/dist/ui/input/input-manager.d.ts.map +1 -0
- package/dist/ui/input/input-manager.js +200 -0
- package/dist/ui/input/input-manager.js.map +1 -0
- package/dist/ui/input/keybindings.d.ts +47 -0
- package/dist/ui/input/keybindings.d.ts.map +1 -0
- package/dist/ui/input/keybindings.js +168 -0
- package/dist/ui/input/keybindings.js.map +1 -0
- package/dist/ui/input/keyboard.d.ts +24 -0
- package/dist/ui/input/keyboard.d.ts.map +1 -0
- package/dist/ui/input/keyboard.js +230 -0
- package/dist/ui/input/keyboard.js.map +1 -0
- package/dist/ui/input/mouse.d.ts +44 -0
- package/dist/ui/input/mouse.d.ts.map +1 -0
- package/dist/ui/input/mouse.js +161 -0
- package/dist/ui/input/mouse.js.map +1 -0
- package/dist/ui/layout/box.d.ts +63 -0
- package/dist/ui/layout/box.d.ts.map +1 -0
- package/dist/ui/layout/box.js +160 -0
- package/dist/ui/layout/box.js.map +1 -0
- package/dist/ui/layout/constraints.d.ts +77 -0
- package/dist/ui/layout/constraints.d.ts.map +1 -0
- package/dist/ui/layout/constraints.js +154 -0
- package/dist/ui/layout/constraints.js.map +1 -0
- package/dist/ui/layout/flex.d.ts +59 -0
- package/dist/ui/layout/flex.d.ts.map +1 -0
- package/dist/ui/layout/flex.js +163 -0
- package/dist/ui/layout/flex.js.map +1 -0
- package/dist/ui/layout/index.d.ts +7 -0
- package/dist/ui/layout/index.d.ts.map +1 -0
- package/dist/ui/layout/index.js +7 -0
- package/dist/ui/layout/index.js.map +1 -0
- package/dist/ui/modals/delete-modal.d.ts +27 -0
- package/dist/ui/modals/delete-modal.d.ts.map +1 -0
- package/dist/ui/modals/delete-modal.js +59 -0
- package/dist/ui/modals/delete-modal.js.map +1 -0
- package/dist/ui/modals/index.d.ts +7 -0
- package/dist/ui/modals/index.d.ts.map +1 -0
- package/dist/ui/modals/index.js +7 -0
- package/dist/ui/modals/index.js.map +1 -0
- package/dist/ui/modals/input-modal.d.ts +66 -0
- package/dist/ui/modals/input-modal.d.ts.map +1 -0
- package/dist/ui/modals/input-modal.js +185 -0
- package/dist/ui/modals/input-modal.js.map +1 -0
- package/dist/ui/modals/quit-modal.d.ts +30 -0
- package/dist/ui/modals/quit-modal.d.ts.map +1 -0
- package/dist/ui/modals/quit-modal.js +65 -0
- package/dist/ui/modals/quit-modal.js.map +1 -0
- package/dist/ui/renderer/ansi.d.ts +206 -0
- package/dist/ui/renderer/ansi.d.ts.map +1 -0
- package/dist/ui/renderer/ansi.js +318 -0
- package/dist/ui/renderer/ansi.js.map +1 -0
- package/dist/ui/renderer/canvas.d.ts +126 -0
- package/dist/ui/renderer/canvas.d.ts.map +1 -0
- package/dist/ui/renderer/canvas.js +346 -0
- package/dist/ui/renderer/canvas.js.map +1 -0
- package/dist/ui/renderer/colors.d.ts +65 -0
- package/dist/ui/renderer/colors.d.ts.map +1 -0
- package/dist/ui/renderer/colors.js +260 -0
- package/dist/ui/renderer/colors.js.map +1 -0
- package/dist/ui/renderer/index.d.ts +8 -0
- package/dist/ui/renderer/index.d.ts.map +1 -0
- package/dist/ui/renderer/index.js +8 -0
- package/dist/ui/renderer/index.js.map +1 -0
- package/dist/ui/renderer/symbols.d.ts +176 -0
- package/dist/ui/renderer/symbols.d.ts.map +1 -0
- package/dist/ui/renderer/symbols.js +246 -0
- package/dist/ui/renderer/symbols.js.map +1 -0
- package/dist/ui/views/index.d.ts +7 -0
- package/dist/ui/views/index.d.ts.map +1 -0
- package/dist/ui/views/index.js +7 -0
- package/dist/ui/views/index.js.map +1 -0
- package/dist/ui/views/sidebar-view.d.ts +89 -0
- package/dist/ui/views/sidebar-view.d.ts.map +1 -0
- package/dist/ui/views/sidebar-view.js +259 -0
- package/dist/ui/views/sidebar-view.js.map +1 -0
- package/dist/ui/views/terminal-bar-view.d.ts +67 -0
- package/dist/ui/views/terminal-bar-view.d.ts.map +1 -0
- package/dist/ui/views/terminal-bar-view.js +172 -0
- package/dist/ui/views/terminal-bar-view.js.map +1 -0
- package/dist/ui/views/welcome-view.d.ts +34 -0
- package/dist/ui/views/welcome-view.d.ts.map +1 -0
- package/dist/ui/views/welcome-view.js +116 -0
- package/dist/ui/views/welcome-view.js.map +1 -0
- package/dist/utils/async.d.ts +68 -0
- package/dist/utils/async.d.ts.map +1 -0
- package/dist/utils/async.js +138 -0
- package/dist/utils/async.js.map +1 -0
- package/dist/utils/errors.d.ts +136 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +224 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/id.d.ts +51 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +79 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +75 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +212 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/string.d.ts +71 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +163 -0
- package/dist/utils/string.js.map +1 -0
- package/dist/utils/validation.d.ts +72 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +196 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clipboard Operations
|
|
3
|
+
*
|
|
4
|
+
* Platform-specific clipboard copy/paste functionality.
|
|
5
|
+
*/
|
|
6
|
+
import { execSync, spawn } from 'child_process';
|
|
7
|
+
import { detectPlatform, isCommandAvailable } from './detector';
|
|
8
|
+
/**
|
|
9
|
+
* Get the clipboard command for the current platform
|
|
10
|
+
*/
|
|
11
|
+
function getClipboardCommand() {
|
|
12
|
+
const os = detectPlatform();
|
|
13
|
+
switch (os) {
|
|
14
|
+
case 'darwin':
|
|
15
|
+
return {
|
|
16
|
+
copy: ['pbcopy'],
|
|
17
|
+
paste: ['pbpaste'],
|
|
18
|
+
};
|
|
19
|
+
case 'linux':
|
|
20
|
+
// Try xclip first, then xsel
|
|
21
|
+
if (isCommandAvailable('xclip')) {
|
|
22
|
+
return {
|
|
23
|
+
copy: ['xclip', '-selection', 'clipboard'],
|
|
24
|
+
paste: ['xclip', '-selection', 'clipboard', '-o'],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
if (isCommandAvailable('xsel')) {
|
|
28
|
+
return {
|
|
29
|
+
copy: ['xsel', '--clipboard', '--input'],
|
|
30
|
+
paste: ['xsel', '--clipboard', '--output'],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Try wl-copy for Wayland
|
|
34
|
+
if (isCommandAvailable('wl-copy')) {
|
|
35
|
+
return {
|
|
36
|
+
copy: ['wl-copy'],
|
|
37
|
+
paste: ['wl-paste'],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
case 'win32':
|
|
42
|
+
return {
|
|
43
|
+
copy: ['clip'],
|
|
44
|
+
paste: ['powershell', '-command', 'Get-Clipboard'],
|
|
45
|
+
};
|
|
46
|
+
default:
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Check if clipboard operations are available
|
|
52
|
+
*/
|
|
53
|
+
export function isClipboardAvailable() {
|
|
54
|
+
return getClipboardCommand() !== null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Copy text to the system clipboard
|
|
58
|
+
*/
|
|
59
|
+
export async function copyToClipboard(text) {
|
|
60
|
+
const commands = getClipboardCommand();
|
|
61
|
+
if (!commands) {
|
|
62
|
+
throw new Error('Clipboard not available on this platform');
|
|
63
|
+
}
|
|
64
|
+
return new Promise((resolve, reject) => {
|
|
65
|
+
const [cmd, ...args] = commands.copy;
|
|
66
|
+
const proc = spawn(cmd, args, {
|
|
67
|
+
stdio: ['pipe', 'ignore', 'ignore'],
|
|
68
|
+
});
|
|
69
|
+
proc.on('error', (err) => {
|
|
70
|
+
reject(new Error(`Failed to copy to clipboard: ${err.message}`));
|
|
71
|
+
});
|
|
72
|
+
proc.on('close', (code) => {
|
|
73
|
+
if (code === 0) {
|
|
74
|
+
resolve();
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
reject(new Error(`Clipboard command exited with code ${code}`));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
proc.stdin.write(text);
|
|
81
|
+
proc.stdin.end();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Copy text to clipboard synchronously
|
|
86
|
+
*/
|
|
87
|
+
export function copyToClipboardSync(text) {
|
|
88
|
+
const commands = getClipboardCommand();
|
|
89
|
+
if (!commands) {
|
|
90
|
+
throw new Error('Clipboard not available on this platform');
|
|
91
|
+
}
|
|
92
|
+
const [cmd, ...args] = commands.copy;
|
|
93
|
+
const command = [cmd, ...args].join(' ');
|
|
94
|
+
try {
|
|
95
|
+
execSync(command, {
|
|
96
|
+
input: text,
|
|
97
|
+
stdio: ['pipe', 'ignore', 'ignore'],
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
throw new Error(`Failed to copy to clipboard: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Paste text from the system clipboard
|
|
106
|
+
*/
|
|
107
|
+
export async function pasteFromClipboard() {
|
|
108
|
+
const commands = getClipboardCommand();
|
|
109
|
+
if (!commands) {
|
|
110
|
+
throw new Error('Clipboard not available on this platform');
|
|
111
|
+
}
|
|
112
|
+
return new Promise((resolve, reject) => {
|
|
113
|
+
const [cmd, ...args] = commands.paste;
|
|
114
|
+
const proc = spawn(cmd, args, {
|
|
115
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
116
|
+
});
|
|
117
|
+
let output = '';
|
|
118
|
+
proc.stdout.on('data', (data) => {
|
|
119
|
+
output += data.toString();
|
|
120
|
+
});
|
|
121
|
+
proc.on('error', (err) => {
|
|
122
|
+
reject(new Error(`Failed to paste from clipboard: ${err.message}`));
|
|
123
|
+
});
|
|
124
|
+
proc.on('close', (code) => {
|
|
125
|
+
if (code === 0) {
|
|
126
|
+
resolve(output);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
reject(new Error(`Clipboard command exited with code ${code}`));
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Paste text from clipboard synchronously
|
|
136
|
+
*/
|
|
137
|
+
export function pasteFromClipboardSync() {
|
|
138
|
+
const commands = getClipboardCommand();
|
|
139
|
+
if (!commands) {
|
|
140
|
+
throw new Error('Clipboard not available on this platform');
|
|
141
|
+
}
|
|
142
|
+
const [cmd, ...args] = commands.paste;
|
|
143
|
+
try {
|
|
144
|
+
const output = execSync([cmd, ...args].join(' '), {
|
|
145
|
+
encoding: 'utf-8',
|
|
146
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
147
|
+
});
|
|
148
|
+
return output;
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
throw new Error(`Failed to paste from clipboard: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../src/platform/clipboard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhE;;GAEG;AACH,SAAS,mBAAmB;IAI1B,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IAE5B,QAAQ,EAAE,EAAE,CAAC;QACX,KAAK,QAAQ;YACX,OAAO;gBACL,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,KAAK,EAAE,CAAC,SAAS,CAAC;aACnB,CAAC;QAEJ,KAAK,OAAO;YACV,6BAA6B;YAC7B,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChC,OAAO;oBACL,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,WAAW,CAAC;oBAC1C,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,I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AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IAEvC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEtC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAChD,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;SACpC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAC9F,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Detection
|
|
3
|
+
*
|
|
4
|
+
* Detects the current operating system and environment.
|
|
5
|
+
*/
|
|
6
|
+
export type Platform = 'darwin' | 'linux' | 'win32' | 'unknown';
|
|
7
|
+
export type Architecture = 'x64' | 'arm64' | 'arm' | 'unknown';
|
|
8
|
+
export interface PlatformInfo {
|
|
9
|
+
/** Operating system */
|
|
10
|
+
os: Platform;
|
|
11
|
+
/** CPU architecture */
|
|
12
|
+
arch: Architecture;
|
|
13
|
+
/** OS version/release string */
|
|
14
|
+
version: string;
|
|
15
|
+
/** User's home directory */
|
|
16
|
+
homeDir: string;
|
|
17
|
+
/** System temp directory */
|
|
18
|
+
tempDir: string;
|
|
19
|
+
/** Whether running in a TTY */
|
|
20
|
+
isTTY: boolean;
|
|
21
|
+
/** Whether running in CI environment */
|
|
22
|
+
isCI: boolean;
|
|
23
|
+
/** Default shell */
|
|
24
|
+
shell: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Detect the current platform
|
|
28
|
+
*/
|
|
29
|
+
export declare function detectPlatform(): Platform;
|
|
30
|
+
/**
|
|
31
|
+
* Detect the CPU architecture
|
|
32
|
+
*/
|
|
33
|
+
export declare function detectArchitecture(): Architecture;
|
|
34
|
+
/**
|
|
35
|
+
* Detect the default shell
|
|
36
|
+
*/
|
|
37
|
+
export declare function detectShell(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Check if running in a CI environment
|
|
40
|
+
*/
|
|
41
|
+
export declare function isCI(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Check if running in a TTY
|
|
44
|
+
*/
|
|
45
|
+
export declare function isTTY(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Get complete platform information
|
|
48
|
+
*/
|
|
49
|
+
export declare function getPlatformInfo(): PlatformInfo;
|
|
50
|
+
/**
|
|
51
|
+
* Check if a command is available in PATH
|
|
52
|
+
*/
|
|
53
|
+
export declare function isCommandAvailable(command: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Get the version of a command
|
|
56
|
+
*/
|
|
57
|
+
export declare function getCommandVersion(command: string, versionFlag?: string): string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Check if tmux is available
|
|
60
|
+
*/
|
|
61
|
+
export declare function isTmuxAvailable(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Get tmux version
|
|
64
|
+
*/
|
|
65
|
+
export declare function getTmuxVersion(): string | null;
|
|
66
|
+
/**
|
|
67
|
+
* Check if git is available
|
|
68
|
+
*/
|
|
69
|
+
export declare function isGitAvailable(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Get git version
|
|
72
|
+
*/
|
|
73
|
+
export declare function getGitVersion(): string | null;
|
|
74
|
+
/**
|
|
75
|
+
* Check if claude CLI is available
|
|
76
|
+
*/
|
|
77
|
+
export declare function isClaudeAvailable(): boolean;
|
|
78
|
+
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../src/platform/detector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;AAE/D,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,EAAE,EAAE,QAAQ,CAAC;IACb,uBAAuB;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,wCAAwC;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CAYzC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAYjD;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAmBpC;AAED;;GAEG;AACH,wBAAgB,IAAI,IAAI,OAAO,CAW9B;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAW9C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAY3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,MAAoB,GAChC,MAAM,GAAG,IAAI,CAUf;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAQ9C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAQ7C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Detection
|
|
3
|
+
*
|
|
4
|
+
* Detects the current operating system and environment.
|
|
5
|
+
*/
|
|
6
|
+
import { platform, arch, release, homedir, tmpdir } from 'os';
|
|
7
|
+
import { execSync } from 'child_process';
|
|
8
|
+
/**
|
|
9
|
+
* Detect the current platform
|
|
10
|
+
*/
|
|
11
|
+
export function detectPlatform() {
|
|
12
|
+
const p = platform();
|
|
13
|
+
switch (p) {
|
|
14
|
+
case 'darwin':
|
|
15
|
+
return 'darwin';
|
|
16
|
+
case 'linux':
|
|
17
|
+
return 'linux';
|
|
18
|
+
case 'win32':
|
|
19
|
+
return 'win32';
|
|
20
|
+
default:
|
|
21
|
+
return 'unknown';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Detect the CPU architecture
|
|
26
|
+
*/
|
|
27
|
+
export function detectArchitecture() {
|
|
28
|
+
const a = arch();
|
|
29
|
+
switch (a) {
|
|
30
|
+
case 'x64':
|
|
31
|
+
return 'x64';
|
|
32
|
+
case 'arm64':
|
|
33
|
+
return 'arm64';
|
|
34
|
+
case 'arm':
|
|
35
|
+
return 'arm';
|
|
36
|
+
default:
|
|
37
|
+
return 'unknown';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Detect the default shell
|
|
42
|
+
*/
|
|
43
|
+
export function detectShell() {
|
|
44
|
+
// Check SHELL environment variable first
|
|
45
|
+
const envShell = process.env.SHELL;
|
|
46
|
+
if (envShell) {
|
|
47
|
+
return envShell;
|
|
48
|
+
}
|
|
49
|
+
// Platform-specific defaults
|
|
50
|
+
const os = detectPlatform();
|
|
51
|
+
switch (os) {
|
|
52
|
+
case 'darwin':
|
|
53
|
+
return '/bin/zsh';
|
|
54
|
+
case 'linux':
|
|
55
|
+
return '/bin/bash';
|
|
56
|
+
case 'win32':
|
|
57
|
+
return process.env.COMSPEC || 'cmd.exe';
|
|
58
|
+
default:
|
|
59
|
+
return '/bin/sh';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Check if running in a CI environment
|
|
64
|
+
*/
|
|
65
|
+
export function isCI() {
|
|
66
|
+
return (process.env.CI === 'true' ||
|
|
67
|
+
process.env.CI === '1' ||
|
|
68
|
+
process.env.CONTINUOUS_INTEGRATION === 'true' ||
|
|
69
|
+
process.env.GITHUB_ACTIONS === 'true' ||
|
|
70
|
+
process.env.GITLAB_CI === 'true' ||
|
|
71
|
+
process.env.CIRCLECI === 'true' ||
|
|
72
|
+
process.env.TRAVIS === 'true' ||
|
|
73
|
+
process.env.JENKINS_URL !== undefined);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Check if running in a TTY
|
|
77
|
+
*/
|
|
78
|
+
export function isTTY() {
|
|
79
|
+
return process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get complete platform information
|
|
83
|
+
*/
|
|
84
|
+
export function getPlatformInfo() {
|
|
85
|
+
return {
|
|
86
|
+
os: detectPlatform(),
|
|
87
|
+
arch: detectArchitecture(),
|
|
88
|
+
version: release(),
|
|
89
|
+
homeDir: homedir(),
|
|
90
|
+
tempDir: tmpdir(),
|
|
91
|
+
isTTY: isTTY(),
|
|
92
|
+
isCI: isCI(),
|
|
93
|
+
shell: detectShell(),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Check if a command is available in PATH
|
|
98
|
+
*/
|
|
99
|
+
export function isCommandAvailable(command) {
|
|
100
|
+
const os = detectPlatform();
|
|
101
|
+
const checkCommand = os === 'win32' ? 'where' : 'which';
|
|
102
|
+
try {
|
|
103
|
+
execSync(`${checkCommand} ${command}`, {
|
|
104
|
+
stdio: 'ignore',
|
|
105
|
+
});
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get the version of a command
|
|
114
|
+
*/
|
|
115
|
+
export function getCommandVersion(command, versionFlag = '--version') {
|
|
116
|
+
try {
|
|
117
|
+
const output = execSync(`${command} ${versionFlag}`, {
|
|
118
|
+
encoding: 'utf-8',
|
|
119
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
120
|
+
});
|
|
121
|
+
return output.trim();
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Check if tmux is available
|
|
129
|
+
*/
|
|
130
|
+
export function isTmuxAvailable() {
|
|
131
|
+
return isCommandAvailable('tmux');
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get tmux version
|
|
135
|
+
*/
|
|
136
|
+
export function getTmuxVersion() {
|
|
137
|
+
const version = getCommandVersion('tmux', '-V');
|
|
138
|
+
if (version) {
|
|
139
|
+
// Parse "tmux 3.4" to "3.4"
|
|
140
|
+
const match = version.match(/tmux\s+(\d+\.\d+[a-z]?)/i);
|
|
141
|
+
return match ? match[1] : version;
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Check if git is available
|
|
147
|
+
*/
|
|
148
|
+
export function isGitAvailable() {
|
|
149
|
+
return isCommandAvailable('git');
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get git version
|
|
153
|
+
*/
|
|
154
|
+
export function getGitVersion() {
|
|
155
|
+
const version = getCommandVersion('git', '--version');
|
|
156
|
+
if (version) {
|
|
157
|
+
// Parse "git version 2.39.0" to "2.39.0"
|
|
158
|
+
const match = version.match(/git version (\d+\.\d+\.\d+)/i);
|
|
159
|
+
return match ? match[1] : version;
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Check if claude CLI is available
|
|
165
|
+
*/
|
|
166
|
+
export function isClaudeAvailable() {
|
|
167
|
+
return isCommandAvailable('claude');
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.js","sourceRoot":"","sources":["../../src/platform/detector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAwBzC;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC;QACV,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC;QACV,KAAK,KAAK;YACR,OAAO,KAAK,CAAC;QACf,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,KAAK,CAAC;QACf;YACE,OAAO,S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B;QAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QACxD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACpC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACtD,IAAI,OAAO,EAAE,CAAC;QACZ,yCAAyC;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAC5D,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACpC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Module
|
|
3
|
+
*
|
|
4
|
+
* Platform detection and abstraction layer.
|
|
5
|
+
* Isolates all platform-specific code to enable cross-platform support.
|
|
6
|
+
*/
|
|
7
|
+
export { detectPlatform, detectArchitecture, detectShell, isCI, isTTY, getPlatformInfo, isCommandAvailable, getCommandVersion, isTmuxAvailable, getTmuxVersion, isGitAvailable, getGitVersion, isClaudeAvailable, } from './detector';
|
|
8
|
+
export type { Platform, Architecture, PlatformInfo } from './detector';
|
|
9
|
+
export { getHomeDir, getTempDir, getAppDataDir, getConfigDir, getCacheDir, getWorktreesDir, getTempFilePath, getDebugLogPath, getProjectPaths, resolvePath, getNullDevice, } from './paths';
|
|
10
|
+
export type { ProjectPaths } from './paths';
|
|
11
|
+
export { isClipboardAvailable, copyToClipboard, copyToClipboardSync, pasteFromClipboard, pasteFromClipboardSync, } from './clipboard';
|
|
12
|
+
export { getShellType, getShellInfo, getInteractiveShellCommand, getShellExecCommand, escapeShellArg, shellSupports, } from './shell';
|
|
13
|
+
export type { ShellType, ShellInfo } from './shell';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGvE,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Module
|
|
3
|
+
*
|
|
4
|
+
* Platform detection and abstraction layer.
|
|
5
|
+
* Isolates all platform-specific code to enable cross-platform support.
|
|
6
|
+
*/
|
|
7
|
+
// Platform detection
|
|
8
|
+
export { detectPlatform, detectArchitecture, detectShell, isCI, isTTY, getPlatformInfo, isCommandAvailable, getCommandVersion, isTmuxAvailable, getTmuxVersion, isGitAvailable, getGitVersion, isClaudeAvailable, } from './detector';
|
|
9
|
+
// Platform paths
|
|
10
|
+
export { getHomeDir, getTempDir, getAppDataDir, getConfigDir, getCacheDir, getWorktreesDir, getTempFilePath, getDebugLogPath, getProjectPaths, resolvePath, getNullDevice, } from './paths';
|
|
11
|
+
// Clipboard operations
|
|
12
|
+
export { isClipboardAvailable, copyToClipboard, copyToClipboardSync, pasteFromClipboard, pasteFromClipboardSync, } from './clipboard';
|
|
13
|
+
// Shell utilities
|
|
14
|
+
export { getShellType, getShellInfo, getInteractiveShellCommand, getShellExecCommand, escapeShellArg, shellSupports, } from './shell';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qBAAqB;AACrB,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,iBAAiB;AACjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,uBAAuB;AACvB,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,kBAAkB;AAClB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-Specific Paths
|
|
3
|
+
*
|
|
4
|
+
* Computes paths for application data, config, and temp files.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get the user's home directory
|
|
8
|
+
*/
|
|
9
|
+
export declare function getHomeDir(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Get the system temp directory
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTempDir(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Get the application data directory based on platform conventions
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAppDataDir(appName?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Get the application config directory based on platform conventions
|
|
20
|
+
*/
|
|
21
|
+
export declare function getConfigDir(appName?: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the application cache directory
|
|
24
|
+
*/
|
|
25
|
+
export declare function getCacheDir(appName?: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get the default worktrees base directory
|
|
28
|
+
*/
|
|
29
|
+
export declare function getWorktreesDir(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get a temp file path with a unique name
|
|
32
|
+
*/
|
|
33
|
+
export declare function getTempFilePath(prefix: string, extension?: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Get the debug log file path
|
|
36
|
+
*/
|
|
37
|
+
export declare function getDebugLogPath(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Path configuration for a specific project
|
|
40
|
+
*/
|
|
41
|
+
export interface ProjectPaths {
|
|
42
|
+
/** Root project directory */
|
|
43
|
+
root: string;
|
|
44
|
+
/** Project data directory (for state, etc.) */
|
|
45
|
+
data: string;
|
|
46
|
+
/** State file path */
|
|
47
|
+
state: string;
|
|
48
|
+
/** Terminal state file path pattern */
|
|
49
|
+
terminalState: (sessionId: string) => string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get paths for a specific project
|
|
53
|
+
*/
|
|
54
|
+
export declare function getProjectPaths(projectPath: string, projectId: string): ProjectPaths;
|
|
55
|
+
/**
|
|
56
|
+
* Resolve a path that may contain ~ for home directory
|
|
57
|
+
*/
|
|
58
|
+
export declare function resolvePath(path: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Get the appropriate null device for the platform
|
|
61
|
+
*/
|
|
62
|
+
export declare function getNullDevice(): string;
|
|
63
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/platform/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAA2B,GAAG,MAAM,CA4B1E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,MAA2B,GAAG,MAAM,CAyBzE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,MAA2B,GAAG,MAAM,CAyBxE;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,GAAE,MAAW,GAAG,MAAM,CAK9E;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC9C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,YAAY,CAWd;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAGtC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-Specific Paths
|
|
3
|
+
*
|
|
4
|
+
* Computes paths for application data, config, and temp files.
|
|
5
|
+
*/
|
|
6
|
+
import { homedir, tmpdir } from 'os';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
import { detectPlatform } from './detector';
|
|
9
|
+
/**
|
|
10
|
+
* Get the user's home directory
|
|
11
|
+
*/
|
|
12
|
+
export function getHomeDir() {
|
|
13
|
+
return homedir();
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get the system temp directory
|
|
17
|
+
*/
|
|
18
|
+
export function getTempDir() {
|
|
19
|
+
return tmpdir();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the application data directory based on platform conventions
|
|
23
|
+
*/
|
|
24
|
+
export function getAppDataDir(appName = 'claude-plus-plus') {
|
|
25
|
+
const os = detectPlatform();
|
|
26
|
+
const home = homedir();
|
|
27
|
+
switch (os) {
|
|
28
|
+
case 'darwin':
|
|
29
|
+
// macOS: ~/.claude-plus-plus (simple) or ~/Library/Application Support/
|
|
30
|
+
return join(home, `.${appName}`);
|
|
31
|
+
case 'linux':
|
|
32
|
+
// Linux: Follow XDG Base Directory spec if set
|
|
33
|
+
const xdgData = process.env.XDG_DATA_HOME;
|
|
34
|
+
if (xdgData) {
|
|
35
|
+
return join(xdgData, appName);
|
|
36
|
+
}
|
|
37
|
+
return join(home, `.${appName}`);
|
|
38
|
+
case 'win32':
|
|
39
|
+
// Windows: Use APPDATA
|
|
40
|
+
const appData = process.env.APPDATA;
|
|
41
|
+
if (appData) {
|
|
42
|
+
return join(appData, appName);
|
|
43
|
+
}
|
|
44
|
+
return join(home, `.${appName}`);
|
|
45
|
+
default:
|
|
46
|
+
return join(home, `.${appName}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get the application config directory based on platform conventions
|
|
51
|
+
*/
|
|
52
|
+
export function getConfigDir(appName = 'claude-plus-plus') {
|
|
53
|
+
const os = detectPlatform();
|
|
54
|
+
const home = homedir();
|
|
55
|
+
switch (os) {
|
|
56
|
+
case 'darwin':
|
|
57
|
+
return join(home, `.${appName}`);
|
|
58
|
+
case 'linux':
|
|
59
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
60
|
+
if (xdgConfig) {
|
|
61
|
+
return join(xdgConfig, appName);
|
|
62
|
+
}
|
|
63
|
+
return join(home, `.${appName}`);
|
|
64
|
+
case 'win32':
|
|
65
|
+
const appData = process.env.APPDATA;
|
|
66
|
+
if (appData) {
|
|
67
|
+
return join(appData, appName);
|
|
68
|
+
}
|
|
69
|
+
return join(home, `.${appName}`);
|
|
70
|
+
default:
|
|
71
|
+
return join(home, `.${appName}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get the application cache directory
|
|
76
|
+
*/
|
|
77
|
+
export function getCacheDir(appName = 'claude-plus-plus') {
|
|
78
|
+
const os = detectPlatform();
|
|
79
|
+
const home = homedir();
|
|
80
|
+
switch (os) {
|
|
81
|
+
case 'darwin':
|
|
82
|
+
return join(home, 'Library', 'Caches', appName);
|
|
83
|
+
case 'linux':
|
|
84
|
+
const xdgCache = process.env.XDG_CACHE_HOME;
|
|
85
|
+
if (xdgCache) {
|
|
86
|
+
return join(xdgCache, appName);
|
|
87
|
+
}
|
|
88
|
+
return join(home, '.cache', appName);
|
|
89
|
+
case 'win32':
|
|
90
|
+
const localAppData = process.env.LOCALAPPDATA;
|
|
91
|
+
if (localAppData) {
|
|
92
|
+
return join(localAppData, appName, 'cache');
|
|
93
|
+
}
|
|
94
|
+
return join(home, `.${appName}`, 'cache');
|
|
95
|
+
default:
|
|
96
|
+
return join(home, `.${appName}`, 'cache');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get the default worktrees base directory
|
|
101
|
+
*/
|
|
102
|
+
export function getWorktreesDir() {
|
|
103
|
+
return join(homedir(), '.claude-worktrees');
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get a temp file path with a unique name
|
|
107
|
+
*/
|
|
108
|
+
export function getTempFilePath(prefix, extension = '') {
|
|
109
|
+
const timestamp = Date.now();
|
|
110
|
+
const random = Math.random().toString(36).substring(2, 8);
|
|
111
|
+
const filename = `${prefix}-${timestamp}-${random}${extension}`;
|
|
112
|
+
return join(tmpdir(), filename);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get the debug log file path
|
|
116
|
+
*/
|
|
117
|
+
export function getDebugLogPath() {
|
|
118
|
+
return join(tmpdir(), 'claude-pp-debug.log');
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Get paths for a specific project
|
|
122
|
+
*/
|
|
123
|
+
export function getProjectPaths(projectPath, projectId) {
|
|
124
|
+
const appData = getAppDataDir();
|
|
125
|
+
const projectData = join(appData, projectId);
|
|
126
|
+
return {
|
|
127
|
+
root: projectPath,
|
|
128
|
+
data: projectData,
|
|
129
|
+
state: join(projectData, 'state.json'),
|
|
130
|
+
terminalState: (sessionId) => join(tmpdir(), `claude-pp-term-${sessionId}.json`),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Resolve a path that may contain ~ for home directory
|
|
135
|
+
*/
|
|
136
|
+
export function resolvePath(path) {
|
|
137
|
+
if (path.startsWith('~')) {
|
|
138
|
+
return join(homedir(), path.slice(1));
|
|
139
|
+
}
|
|
140
|
+
return path;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Get the appropriate null device for the platform
|
|
144
|
+
*/
|
|
145
|
+
export function getNullDevice() {
|
|
146
|
+
const os = detectPlatform();
|
|
147
|
+
return os === 'win32' ? 'NUL' : '/dev/null';
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=paths.js.map
|