claude-code-workflow 6.1.4 → 6.2.2
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/.claude/CLAUDE.md +10 -0
- package/.claude/agents/action-planning-agent.md +857 -778
- package/.claude/agents/cli-execution-agent.md +266 -269
- package/.claude/agents/cli-explore-agent.md +2 -2
- package/.claude/agents/cli-lite-planning-agent.md +142 -92
- package/.claude/agents/cli-planning-agent.md +4 -4
- package/.claude/agents/code-developer.md +7 -6
- package/.claude/agents/conceptual-planning-agent.md +2 -2
- package/.claude/agents/context-search-agent.md +31 -32
- package/.claude/agents/doc-generator.md +4 -4
- package/.claude/agents/memory-bridge.md +93 -93
- package/.claude/agents/test-context-search-agent.md +8 -7
- package/.claude/agents/test-fix-agent.md +7 -6
- package/.claude/commands/clean.md +516 -0
- package/.claude/commands/memory/compact.md +383 -0
- package/.claude/commands/memory/docs-full-cli.md +471 -471
- package/.claude/commands/memory/docs-related-cli.md +386 -386
- package/.claude/commands/memory/docs.md +615 -615
- package/.claude/commands/memory/load.md +5 -5
- package/.claude/commands/memory/tech-research-rules.md +310 -0
- package/.claude/commands/memory/update-full.md +332 -332
- package/.claude/commands/memory/workflow-skill-memory.md +4 -4
- package/.claude/commands/task/create.md +151 -151
- package/.claude/commands/version.md +254 -254
- package/.claude/commands/workflow/brainstorm/api-designer.md +587 -585
- package/.claude/commands/workflow/brainstorm/artifacts.md +1 -0
- package/.claude/commands/workflow/brainstorm/auto-parallel.md +443 -443
- package/.claude/commands/workflow/brainstorm/data-architect.md +220 -220
- package/.claude/commands/workflow/brainstorm/product-manager.md +200 -200
- package/.claude/commands/workflow/brainstorm/product-owner.md +200 -200
- package/.claude/commands/workflow/brainstorm/scrum-master.md +200 -200
- package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +200 -200
- package/.claude/commands/workflow/brainstorm/system-architect.md +389 -387
- package/.claude/commands/workflow/brainstorm/ui-designer.md +221 -221
- package/.claude/commands/workflow/brainstorm/ux-expert.md +221 -221
- package/.claude/commands/workflow/debug.md +321 -0
- package/.claude/commands/workflow/execute.md +13 -0
- package/.claude/commands/workflow/init.md +165 -164
- package/.claude/commands/workflow/lite-execute.md +119 -13
- package/.claude/commands/workflow/lite-fix.md +623 -621
- package/.claude/commands/workflow/lite-plan.md +610 -592
- package/.claude/commands/workflow/plan.md +5 -5
- package/.claude/commands/workflow/review-module-cycle.md +2 -0
- package/.claude/commands/workflow/review-session-cycle.md +2 -0
- package/.claude/commands/workflow/review.md +297 -291
- package/.claude/commands/workflow/session/complete.md +153 -500
- package/.claude/commands/workflow/session/list.md +95 -95
- package/.claude/commands/workflow/session/resume.md +60 -60
- package/.claude/commands/workflow/session/start.md +199 -199
- package/.claude/commands/workflow/tdd-plan.md +3 -3
- package/.claude/commands/workflow/tdd-verify.md +23 -9
- package/.claude/commands/workflow/test-cycle-execute.md +2 -0
- package/.claude/commands/workflow/test-fix-gen.md +699 -699
- package/.claude/commands/workflow/tools/conflict-resolution.md +104 -18
- package/.claude/commands/workflow/tools/context-gather.md +436 -434
- package/.claude/commands/workflow/tools/task-generate-agent.md +490 -291
- package/.claude/commands/workflow/tools/task-generate-tdd.md +18 -10
- package/.claude/commands/workflow/tools/test-concept-enhanced.md +2 -1
- package/.claude/commands/workflow/tools/test-context-gather.md +1 -0
- package/.claude/commands/workflow/tools/test-task-generate.md +1 -0
- package/.claude/commands/workflow/ui-design/import-from-code.md +9 -6
- package/.claude/skills/command-guide/SKILL.md +5 -5
- package/.claude/skills/command-guide/index/all-commands.json +1 -1
- package/.claude/skills/command-guide/index/by-category.json +1 -1
- package/.claude/skills/command-guide/index/by-use-case.json +1 -1
- package/.claude/skills/command-guide/reference/agents/action-planning-agent.md +857 -778
- package/.claude/skills/command-guide/reference/agents/cli-execution-agent.md +266 -269
- package/.claude/skills/command-guide/reference/agents/cli-explore-agent.md +2 -2
- package/.claude/skills/command-guide/reference/agents/cli-lite-planning-agent.md +142 -92
- package/.claude/skills/command-guide/reference/agents/cli-planning-agent.md +4 -4
- package/.claude/skills/command-guide/reference/agents/code-developer.md +7 -6
- package/.claude/skills/command-guide/reference/agents/conceptual-planning-agent.md +2 -2
- package/.claude/skills/command-guide/reference/agents/context-search-agent.md +31 -32
- package/.claude/skills/command-guide/reference/agents/doc-generator.md +4 -4
- package/.claude/skills/command-guide/reference/agents/memory-bridge.md +93 -93
- package/.claude/skills/command-guide/reference/agents/test-context-search-agent.md +8 -7
- package/.claude/skills/command-guide/reference/agents/test-fix-agent.md +7 -6
- package/.claude/skills/command-guide/reference/commands/memory/docs-full-cli.md +471 -471
- package/.claude/skills/command-guide/reference/commands/memory/docs-related-cli.md +386 -386
- package/.claude/skills/command-guide/reference/commands/memory/docs.md +17 -16
- package/.claude/skills/command-guide/reference/commands/memory/load.md +5 -5
- package/.claude/skills/command-guide/reference/commands/memory/tech-research.md +194 -357
- package/.claude/skills/command-guide/reference/commands/memory/update-full.md +332 -332
- package/.claude/skills/command-guide/reference/commands/memory/workflow-skill-memory.md +4 -4
- package/.claude/skills/command-guide/reference/commands/task/create.md +151 -151
- package/.claude/skills/command-guide/reference/commands/version.md +254 -254
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/api-designer.md +585 -585
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/auto-parallel.md +443 -443
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/data-architect.md +220 -220
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-manager.md +200 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-owner.md +200 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/scrum-master.md +200 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/subject-matter-expert.md +200 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/system-architect.md +387 -387
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ui-designer.md +221 -221
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ux-expert.md +221 -221
- package/.claude/skills/command-guide/reference/commands/workflow/execute.md +25 -20
- package/.claude/skills/command-guide/reference/commands/workflow/init.md +164 -164
- package/.claude/skills/command-guide/reference/commands/workflow/lite-execute.md +748 -686
- package/.claude/skills/command-guide/reference/commands/workflow/lite-fix.md +664 -621
- package/.claude/skills/command-guide/reference/commands/workflow/lite-plan.md +645 -592
- package/.claude/skills/command-guide/reference/commands/workflow/plan.md +5 -5
- package/.claude/skills/command-guide/reference/commands/workflow/review.md +25 -18
- package/.claude/skills/command-guide/reference/commands/workflow/session/complete.md +547 -500
- package/.claude/skills/command-guide/reference/commands/workflow/session/list.md +45 -27
- package/.claude/skills/command-guide/reference/commands/workflow/session/resume.md +35 -19
- package/.claude/skills/command-guide/reference/commands/workflow/session/start.md +90 -33
- package/.claude/skills/command-guide/reference/commands/workflow/tdd-plan.md +3 -3
- package/.claude/skills/command-guide/reference/commands/workflow/tdd-verify.md +23 -9
- package/.claude/skills/command-guide/reference/commands/workflow/test-fix-gen.md +699 -699
- package/.claude/skills/command-guide/reference/commands/workflow/tools/conflict-resolution.md +103 -17
- package/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md +434 -434
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-agent.md +487 -291
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md +17 -10
- package/.claude/skills/command-guide/reference/commands/workflow/tools/test-concept-enhanced.md +1 -1
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/import-from-code.md +6 -6
- package/.claude/workflows/chinese-response.md +38 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-api.txt +122 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-components.txt +122 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-config.txt +89 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-core.txt +60 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-patterns.txt +70 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-testing.txt +81 -0
- package/.claude/workflows/cli-templates/prompts/rules/tech-rules-agent-prompt.txt +89 -0
- package/.claude/workflows/cli-templates/prompts/workflow/gemini-solution-design.txt +131 -131
- package/.claude/workflows/cli-templates/prompts/workflow/skill-conflict-patterns.txt +5 -9
- package/.claude/workflows/cli-templates/prompts/workflow/skill-lessons-learned.txt +5 -9
- package/.claude/workflows/cli-templates/protocols/analysis-protocol.md +112 -0
- package/.claude/workflows/cli-templates/protocols/write-protocol.md +201 -0
- package/.claude/workflows/cli-templates/schemas/conflict-resolution-schema.json +137 -0
- package/.claude/workflows/cli-templates/schemas/debug-log-json-schema.json +127 -0
- package/.claude/workflows/cli-templates/schemas/fix-plan-json-schema.json +25 -0
- package/.claude/workflows/cli-templates/schemas/plan-json-schema.json +25 -0
- package/.claude/workflows/cli-tools-usage.md +526 -0
- package/{CLAUDE.md → .claude/workflows/coding-philosophy.md} +24 -45
- package/.claude/workflows/context-tools.md +84 -0
- package/.claude/workflows/file-modification.md +64 -0
- package/.claude/workflows/tool-strategy.md +216 -79
- package/.claude/workflows/windows-platform.md +16 -0
- package/.claude/workflows/workflow-architecture.md +942 -942
- package/.codex/AGENTS.md +63 -330
- package/.codex/prompts/debug.md +318 -0
- package/.codex/prompts/execute.md +273 -0
- package/.codex/prompts/lite-execute.md +164 -0
- package/.codex/prompts/lite-plan.md +469 -0
- package/.codex/prompts.zip +0 -0
- package/.gemini/GEMINI.md +25 -164
- package/.qwen/QWEN.md +0 -139
- package/README.md +29 -9
- package/ccw/README.md +30 -6
- package/ccw/bin/ccw-mcp.js +7 -0
- package/ccw/bin/ccw.js +9 -9
- package/ccw/package.json +65 -47
- package/ccw/src/.workflow/.cli-history/history.db +0 -0
- package/ccw/src/.workflow/.cli-history/history.db-shm +0 -0
- package/ccw/src/.workflow/.cli-history/history.db-wal +0 -0
- package/ccw/src/cli.ts +244 -0
- package/ccw/src/commands/cli.ts +740 -0
- package/ccw/src/commands/core-memory.ts +770 -0
- package/ccw/src/commands/hook.ts +315 -0
- package/ccw/src/commands/install.ts +519 -0
- package/ccw/src/commands/{list.js → list.ts} +1 -1
- package/ccw/src/commands/memory.ts +1090 -0
- package/ccw/src/commands/{serve.js → serve.ts} +14 -5
- package/ccw/src/commands/session-path-resolver.ts +372 -0
- package/ccw/src/commands/session.ts +1141 -0
- package/ccw/src/commands/{stop.js → stop.ts} +16 -6
- package/ccw/src/commands/tool.ts +201 -0
- package/ccw/src/commands/{uninstall.js → uninstall.ts} +89 -40
- package/ccw/src/commands/{upgrade.js → upgrade.ts} +68 -23
- package/ccw/src/commands/{view.js → view.ts} +22 -8
- package/ccw/src/config/storage-paths.ts +670 -0
- package/ccw/src/core/cache-manager.ts +294 -0
- package/ccw/src/core/claude-freshness.ts +319 -0
- package/ccw/src/core/core-memory-store.ts +1528 -0
- package/ccw/src/core/{dashboard-generator-patch.js → dashboard-generator-patch.ts} +18 -0
- package/ccw/src/core/{dashboard-generator.js → dashboard-generator.ts} +69 -12
- package/ccw/src/core/data-aggregator.ts +584 -0
- package/ccw/src/core/history-importer.ts +625 -0
- package/ccw/src/core/{lite-scanner.js → lite-scanner-complete.ts} +162 -66
- package/ccw/src/core/lite-scanner.ts +469 -0
- package/ccw/src/core/{manifest.js → manifest.ts} +104 -34
- package/ccw/src/core/memory-embedder-bridge.ts +262 -0
- package/ccw/src/core/memory-store.ts +978 -0
- package/ccw/src/core/routes/ccw-routes.ts +96 -0
- package/ccw/src/core/routes/claude-routes.ts +1183 -0
- package/ccw/src/core/routes/cli-routes.ts +561 -0
- package/ccw/src/core/routes/codexlens-routes.ts +806 -0
- package/ccw/src/core/routes/core-memory-routes.ts +605 -0
- package/ccw/src/core/routes/files-routes.ts +428 -0
- package/ccw/src/core/routes/graph-routes.md +164 -0
- package/ccw/src/core/routes/graph-routes.ts +626 -0
- package/ccw/src/core/routes/help-routes.ts +308 -0
- package/ccw/src/core/routes/hooks-routes.ts +405 -0
- package/ccw/src/core/routes/mcp-routes.ts +1271 -0
- package/ccw/src/core/routes/mcp-routes.ts.backup +550 -0
- package/ccw/src/core/routes/mcp-templates-db.ts +268 -0
- package/ccw/src/core/routes/memory-routes.ts +1206 -0
- package/ccw/src/core/routes/rules-routes.ts +526 -0
- package/ccw/src/core/routes/session-routes.ts +467 -0
- package/ccw/src/core/routes/skills-routes.ts +599 -0
- package/ccw/src/core/routes/status-routes.ts +57 -0
- package/ccw/src/core/routes/system-routes.ts +427 -0
- package/ccw/src/core/server.ts +431 -0
- package/ccw/src/core/session-clustering-service.ts +1258 -0
- package/ccw/src/core/session-scanner.ts +283 -0
- package/ccw/src/core/websocket.ts +190 -0
- package/ccw/src/{index.js → index.ts} +1 -0
- package/ccw/src/mcp-server/index.ts +186 -0
- package/ccw/src/templates/assets/css/github-dark.min.css +10 -0
- package/ccw/src/templates/assets/css/github.min.css +10 -0
- package/ccw/src/templates/assets/js/cytoscape.min.js +32 -0
- package/ccw/src/templates/assets/js/d3.min.js +2 -0
- package/ccw/src/templates/assets/js/highlight.min.js +1244 -0
- package/ccw/src/templates/assets/js/lucide.min.js +12 -0
- package/ccw/src/templates/assets/js/marked.min.js +69 -0
- package/ccw/src/templates/assets/js/tailwind.js +83 -0
- package/ccw/src/templates/dashboard-css/01-base.css +11 -0
- package/ccw/src/templates/dashboard-css/02-session.css +22 -0
- package/ccw/src/templates/dashboard-css/04-lite-tasks.css +10 -0
- package/ccw/src/templates/dashboard-css/06-cards.css +10 -4
- package/ccw/src/templates/dashboard-css/07-managers.css +1178 -7
- package/ccw/src/templates/dashboard-css/09-explorer.css +23 -12
- package/ccw/src/templates/dashboard-css/10-cli-status.css +337 -0
- package/ccw/src/templates/dashboard-css/11-cli-history.css +271 -0
- package/ccw/src/templates/dashboard-css/12-cli-legacy.css +796 -0
- package/ccw/src/templates/dashboard-css/13-cli-ccw.css +199 -0
- package/ccw/src/templates/dashboard-css/14-cli-modals.css +258 -0
- package/ccw/src/templates/dashboard-css/15-cli-endpoints.css +305 -0
- package/ccw/src/templates/dashboard-css/16-cli-session.css +241 -0
- package/ccw/src/templates/dashboard-css/17-cli-conversation.css +283 -0
- package/ccw/src/templates/dashboard-css/18-cli-settings.css +160 -0
- package/ccw/src/templates/dashboard-css/19-cli-native-session.css +496 -0
- package/ccw/src/templates/dashboard-css/20-cli-taskqueue.css +188 -0
- package/ccw/src/templates/dashboard-css/21-cli-toolmgmt.css +310 -0
- package/ccw/src/templates/dashboard-css/22-cli-semantic.css +240 -0
- package/ccw/src/templates/dashboard-css/23-memory.css +2390 -0
- package/ccw/src/templates/dashboard-css/24-prompt-history.css +1089 -0
- package/ccw/src/templates/dashboard-css/25-skills-rules.css +326 -0
- package/ccw/src/templates/dashboard-css/26-claude-manager.css +908 -0
- package/ccw/src/templates/dashboard-css/27-graph-explorer.css +1678 -0
- package/ccw/src/templates/dashboard-css/28-mcp-manager.css +748 -0
- package/ccw/src/templates/dashboard-css/29-help.css +264 -0
- package/ccw/src/templates/dashboard-css/30-core-memory.css +1700 -0
- package/ccw/src/templates/dashboard-js/api.js +162 -142
- package/ccw/src/templates/dashboard-js/components/carousel.js +4 -4
- package/ccw/src/templates/dashboard-js/components/cli-history.js +876 -0
- package/ccw/src/templates/dashboard-js/components/cli-status.js +978 -0
- package/ccw/src/templates/dashboard-js/components/global-notifications.js +508 -219
- package/ccw/src/templates/dashboard-js/components/hook-manager.js +1277 -282
- package/ccw/src/templates/dashboard-js/components/index-manager.js +302 -0
- package/ccw/src/templates/dashboard-js/components/mcp-manager.js +718 -27
- package/ccw/src/templates/dashboard-js/components/modals.js +66 -0
- package/ccw/src/templates/dashboard-js/components/navigation.js +80 -12
- package/ccw/src/templates/dashboard-js/components/notifications.js +758 -194
- package/ccw/src/templates/dashboard-js/components/storage-manager.js +478 -0
- package/ccw/src/templates/dashboard-js/components/tabs-other.js +157 -6
- package/ccw/src/templates/dashboard-js/components/task-queue-sidebar.js +716 -0
- package/ccw/src/templates/dashboard-js/help-i18n.js +272 -0
- package/ccw/src/templates/dashboard-js/i18n.js +2807 -0
- package/ccw/src/templates/dashboard-js/main.js +15 -0
- package/ccw/src/templates/dashboard-js/state.js +243 -42
- package/ccw/src/templates/dashboard-js/utils.js +47 -1
- package/ccw/src/templates/dashboard-js/views/claude-manager.js +912 -0
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +2272 -0
- package/ccw/src/templates/dashboard-js/views/codexlens-manager.js +964 -0
- package/ccw/src/templates/dashboard-js/views/core-memory-clusters.js +503 -0
- package/ccw/src/templates/dashboard-js/views/core-memory.js +782 -0
- package/ccw/src/templates/dashboard-js/views/explorer.js +888 -852
- package/ccw/src/templates/dashboard-js/views/graph-explorer.js +1157 -0
- package/ccw/src/templates/dashboard-js/views/help.js +856 -0
- package/ccw/src/templates/dashboard-js/views/history.js +337 -0
- package/ccw/src/templates/dashboard-js/views/home.js +61 -15
- package/ccw/src/templates/dashboard-js/views/hook-manager.js +311 -43
- package/ccw/src/templates/dashboard-js/views/lite-tasks.js +204 -28
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +2187 -411
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js.backup +1729 -0
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js.new +928 -0
- package/ccw/src/templates/dashboard-js/views/memory.js +1221 -0
- package/ccw/src/templates/dashboard-js/views/prompt-history.js +713 -0
- package/ccw/src/templates/dashboard-js/views/rules-manager.js +828 -0
- package/ccw/src/templates/dashboard-js/views/session-detail.js +54 -53
- package/ccw/src/templates/dashboard-js/views/skills-manager.js +819 -0
- package/ccw/src/templates/dashboard.html +185 -85
- package/ccw/src/templates/hooks-config-example.json +60 -0
- package/ccw/src/tools/classify-folders.ts +245 -0
- package/ccw/src/tools/cli-config-manager.ts +268 -0
- package/ccw/src/tools/cli-executor.ts +2014 -0
- package/ccw/src/tools/cli-history-store.ts +1195 -0
- package/ccw/src/tools/codex-lens.ts +1141 -0
- package/ccw/src/tools/{convert-tokens-to-css.js → convert-tokens-to-css.ts} +73 -23
- package/ccw/src/tools/core-memory.ts +444 -0
- package/ccw/src/tools/detect-changed-modules.ts +325 -0
- package/ccw/src/tools/{discover-design-files.js → discover-design-files.ts} +74 -24
- package/ccw/src/tools/edit-file.ts +568 -0
- package/ccw/src/tools/{generate-module-docs.js → generate-module-docs.ts} +207 -185
- package/ccw/src/tools/{get-modules-by-depth.js → get-modules-by-depth.ts} +120 -79
- package/ccw/src/tools/index.ts +370 -0
- package/ccw/src/tools/native-session-discovery.ts +795 -0
- package/ccw/src/tools/notifier.ts +129 -0
- package/ccw/src/tools/read-file.ts +410 -0
- package/ccw/src/tools/resume-strategy.ts +345 -0
- package/ccw/src/tools/session-content-parser.ts +619 -0
- package/ccw/src/tools/session-manager.ts +1026 -0
- package/ccw/src/tools/smart-context.ts +228 -0
- package/ccw/src/tools/smart-search.ts +2065 -0
- package/ccw/src/tools/smart-search.ts.backup +1233 -0
- package/ccw/src/tools/storage-manager.ts +455 -0
- package/ccw/src/tools/write-file.ts +222 -0
- package/ccw/src/types/config.ts +11 -0
- package/ccw/src/types/index.ts +3 -0
- package/ccw/src/types/session.ts +25 -0
- package/ccw/src/types/tool.ts +41 -0
- package/ccw/src/utils/{browser-launcher.js → browser-launcher.ts} +10 -8
- package/ccw/src/utils/file-utils.ts +48 -0
- package/ccw/src/utils/{path-resolver.js → path-resolver.ts} +114 -78
- package/ccw/src/utils/path-validator.ts +153 -0
- package/ccw/src/utils/{ui.js → ui.ts} +32 -25
- package/codex-lens/pyproject.toml +48 -0
- package/codex-lens/src/codexlens/.workflow/.cli-history/history.db +0 -0
- package/codex-lens/src/codexlens/__init__.py +28 -0
- package/codex-lens/src/codexlens/__main__.py +14 -0
- package/codex-lens/src/codexlens/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/__main__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/errors.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__init__.py +27 -0
- package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/commands.py +1931 -0
- package/codex-lens/src/codexlens/cli/embedding_manager.py +620 -0
- package/codex-lens/src/codexlens/cli/model_manager.py +289 -0
- package/codex-lens/src/codexlens/cli/output.py +124 -0
- package/codex-lens/src/codexlens/config.py +201 -0
- package/codex-lens/src/codexlens/entities.py +121 -0
- package/codex-lens/src/codexlens/errors.py +55 -0
- package/codex-lens/src/codexlens/indexing/README.md +77 -0
- package/codex-lens/src/codexlens/indexing/__init__.py +4 -0
- package/codex-lens/src/codexlens/indexing/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/indexing/symbol_extractor.py +243 -0
- package/codex-lens/src/codexlens/parsers/__init__.py +8 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/encoding.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/encoding.py +202 -0
- package/codex-lens/src/codexlens/parsers/factory.py +256 -0
- package/codex-lens/src/codexlens/parsers/tokenizer.py +98 -0
- package/codex-lens/src/codexlens/parsers/treesitter_parser.py +335 -0
- package/codex-lens/src/codexlens/search/__init__.py +15 -0
- package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/enrichment.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/query_parser.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/chain_search.py +647 -0
- package/codex-lens/src/codexlens/search/enrichment.py +150 -0
- package/codex-lens/src/codexlens/search/hybrid_search.py +313 -0
- package/codex-lens/src/codexlens/search/query_parser.py +242 -0
- package/codex-lens/src/codexlens/search/ranking.py +274 -0
- package/codex-lens/src/codexlens/semantic/__init__.py +39 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/code_extractor.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/graph_analyzer.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/llm_enhancer.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/ann_index.py +414 -0
- package/codex-lens/src/codexlens/semantic/chunker.py +448 -0
- package/codex-lens/src/codexlens/semantic/code_extractor.py +274 -0
- package/codex-lens/src/codexlens/semantic/embedder.py +185 -0
- package/codex-lens/src/codexlens/semantic/vector_store.py +955 -0
- package/codex-lens/src/codexlens/storage/__init__.py +29 -0
- package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/file_cache.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/migration_manager.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/dir_index.py +1850 -0
- package/codex-lens/src/codexlens/storage/file_cache.py +32 -0
- package/codex-lens/src/codexlens/storage/index_tree.py +776 -0
- package/codex-lens/src/codexlens/storage/migration_manager.py +154 -0
- package/codex-lens/src/codexlens/storage/migrations/__init__.py +1 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_001_normalize_keywords.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_002_add_token_metadata.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_003_code_relationships.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_004_dual_fts.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_005_cleanup_unused_fields.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/migration_001_normalize_keywords.py +123 -0
- package/codex-lens/src/codexlens/storage/migrations/migration_002_add_token_metadata.py +48 -0
- package/codex-lens/src/codexlens/storage/migrations/migration_004_dual_fts.py +232 -0
- package/codex-lens/src/codexlens/storage/migrations/migration_005_cleanup_unused_fields.py +196 -0
- package/codex-lens/src/codexlens/storage/path_mapper.py +274 -0
- package/codex-lens/src/codexlens/storage/registry.py +670 -0
- package/codex-lens/src/codexlens/storage/sqlite_store.py +576 -0
- package/codex-lens/src/codexlens/storage/sqlite_utils.py +64 -0
- package/package.json +4 -1
- package/.claude/commands/memory/tech-research.md +0 -477
- package/.claude/scripts/classify-folders.sh +0 -39
- package/.claude/scripts/convert_tokens_to_css.sh +0 -229
- package/.claude/scripts/detect_changed_modules.sh +0 -161
- package/.claude/scripts/discover-design-files.sh +0 -87
- package/.claude/scripts/extract-animations.js +0 -243
- package/.claude/scripts/extract-computed-styles.js +0 -118
- package/.claude/scripts/extract-layout-structure.js +0 -411
- package/.claude/scripts/generate_module_docs.sh +0 -717
- package/.claude/scripts/get_modules_by_depth.sh +0 -170
- package/.claude/scripts/ui-generate-preview.sh +0 -395
- package/.claude/scripts/ui-instantiate-prototypes.sh +0 -815
- package/.claude/scripts/update_module_claude.sh +0 -337
- package/.claude/workflows/context-search-strategy.md +0 -77
- package/.claude/workflows/intelligent-tools-strategy.md +0 -662
- package/ccw/src/cli.js +0 -119
- package/ccw/src/commands/install.js +0 -324
- package/ccw/src/commands/tool.js +0 -138
- package/ccw/src/core/data-aggregator.js +0 -409
- package/ccw/src/core/server.js +0 -2063
- package/ccw/src/core/session-scanner.js +0 -235
- package/ccw/src/tools/classify-folders.js +0 -204
- package/ccw/src/tools/detect-changed-modules.js +0 -288
- package/ccw/src/tools/edit-file.js +0 -266
- package/ccw/src/tools/index.js +0 -176
- package/ccw/src/utils/file-utils.js +0 -48
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, statSync, copyFileSync, readFileSync, writeFileSync, unlinkSync, rmdirSync } from 'fs';
|
|
2
|
+
import { join, dirname, basename } from 'path';
|
|
3
|
+
import { homedir } from 'os';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import inquirer from 'inquirer';
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
import { showHeader, createSpinner, info, warning, error, summaryBox, divider } from '../utils/ui.js';
|
|
8
|
+
import { createManifest, addFileEntry, addDirectoryEntry, saveManifest, findManifest, getAllManifests } from '../core/manifest.js';
|
|
9
|
+
import { validatePath } from '../utils/path-resolver.js';
|
|
10
|
+
import type { Ora } from 'ora';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = dirname(__filename);
|
|
14
|
+
|
|
15
|
+
// Source directories to install (includes .codex with prompts folder)
|
|
16
|
+
const SOURCE_DIRS = ['.claude', '.codex', '.gemini', '.qwen'];
|
|
17
|
+
|
|
18
|
+
// Subdirectories that should always be installed to global (~/.claude/)
|
|
19
|
+
const GLOBAL_SUBDIRS = ['workflows', 'scripts', 'templates'];
|
|
20
|
+
|
|
21
|
+
// Files that should be excluded from cleanup (user-specific settings)
|
|
22
|
+
const EXCLUDED_FILES = ['settings.json', 'settings.local.json'];
|
|
23
|
+
|
|
24
|
+
interface InstallOptions {
|
|
25
|
+
mode?: string;
|
|
26
|
+
path?: string;
|
|
27
|
+
force?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface CopyResult {
|
|
31
|
+
files: number;
|
|
32
|
+
directories: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Get package root directory (ccw/src/commands -> ccw)
|
|
36
|
+
function getPackageRoot(): string {
|
|
37
|
+
return join(__dirname, '..', '..');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Get source installation directory (parent of ccw)
|
|
41
|
+
function getSourceDir(): string {
|
|
42
|
+
return join(getPackageRoot(), '..');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Install command handler
|
|
47
|
+
* @param {Object} options - Command options
|
|
48
|
+
*/
|
|
49
|
+
export async function installCommand(options: InstallOptions): Promise<void> {
|
|
50
|
+
const version = getVersion();
|
|
51
|
+
|
|
52
|
+
// Show beautiful header
|
|
53
|
+
showHeader(version);
|
|
54
|
+
|
|
55
|
+
// Check for existing installations
|
|
56
|
+
const existingManifests = getAllManifests();
|
|
57
|
+
if (existingManifests.length > 0 && !options.force) {
|
|
58
|
+
info('Existing installations detected:');
|
|
59
|
+
console.log('');
|
|
60
|
+
existingManifests.forEach((m, i) => {
|
|
61
|
+
console.log(chalk.gray(` ${i + 1}. ${m.installation_mode} - ${m.installation_path}`));
|
|
62
|
+
console.log(chalk.gray(` Installed: ${new Date(m.installation_date).toLocaleDateString()}`));
|
|
63
|
+
});
|
|
64
|
+
console.log('');
|
|
65
|
+
|
|
66
|
+
const { proceed } = await inquirer.prompt([{
|
|
67
|
+
type: 'confirm',
|
|
68
|
+
name: 'proceed',
|
|
69
|
+
message: 'Continue with new installation?',
|
|
70
|
+
default: true
|
|
71
|
+
}]);
|
|
72
|
+
|
|
73
|
+
if (!proceed) {
|
|
74
|
+
info('Installation cancelled');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Local installation from package source
|
|
80
|
+
const sourceDir = getSourceDir();
|
|
81
|
+
|
|
82
|
+
// Interactive mode selection
|
|
83
|
+
const mode = options.mode || await selectMode();
|
|
84
|
+
|
|
85
|
+
let installPath: string;
|
|
86
|
+
if (mode === 'Global') {
|
|
87
|
+
installPath = homedir();
|
|
88
|
+
info(`Global installation to: ${installPath}`);
|
|
89
|
+
} else {
|
|
90
|
+
const inputPath = options.path || await selectPath();
|
|
91
|
+
|
|
92
|
+
// Validate the installation path
|
|
93
|
+
const pathValidation = validatePath(inputPath, { mustExist: true });
|
|
94
|
+
if (!pathValidation.valid || !pathValidation.path) {
|
|
95
|
+
error(`Invalid installation path: ${pathValidation.error}`);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
installPath = pathValidation.path;
|
|
100
|
+
info(`Path installation to: ${installPath}`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Validate source directories exist
|
|
104
|
+
const availableDirs = SOURCE_DIRS.filter(dir => existsSync(join(sourceDir, dir)));
|
|
105
|
+
|
|
106
|
+
if (availableDirs.length === 0) {
|
|
107
|
+
error('No source directories found to install.');
|
|
108
|
+
error(`Expected directories in: ${sourceDir}`);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
console.log('');
|
|
113
|
+
info(`Found ${availableDirs.length} directories to install: ${availableDirs.join(', ')}`);
|
|
114
|
+
|
|
115
|
+
// Show what will be installed including .codex/prompts
|
|
116
|
+
if (availableDirs.includes('.codex')) {
|
|
117
|
+
const promptsPath = join(sourceDir, '.codex', 'prompts');
|
|
118
|
+
if (existsSync(promptsPath)) {
|
|
119
|
+
const promptFiles = readdirSync(promptsPath, { recursive: true });
|
|
120
|
+
info(` └─ .codex/prompts: ${promptFiles.length} files (workflow execute, lite-execute)`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
divider();
|
|
125
|
+
|
|
126
|
+
// Check for existing installation manifest
|
|
127
|
+
const existingManifest = findManifest(installPath, mode);
|
|
128
|
+
let cleanStats = { removed: 0, skipped: 0 };
|
|
129
|
+
|
|
130
|
+
if (existingManifest) {
|
|
131
|
+
// Has manifest - clean based on manifest records
|
|
132
|
+
warning('Existing installation found at this location');
|
|
133
|
+
info(` Files in manifest: ${existingManifest.files?.length || 0}`);
|
|
134
|
+
info(` Installed: ${new Date(existingManifest.installation_date).toLocaleDateString()}`);
|
|
135
|
+
|
|
136
|
+
const { backup } = await inquirer.prompt([{
|
|
137
|
+
type: 'confirm',
|
|
138
|
+
name: 'backup',
|
|
139
|
+
message: 'Create backup before reinstalling?',
|
|
140
|
+
default: true
|
|
141
|
+
}]);
|
|
142
|
+
|
|
143
|
+
if (backup) {
|
|
144
|
+
await createBackup(existingManifest);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Clean based on manifest records
|
|
148
|
+
console.log('');
|
|
149
|
+
const cleanSpinner = createSpinner('Cleaning previous installation...').start();
|
|
150
|
+
|
|
151
|
+
try {
|
|
152
|
+
cleanSpinner.text = 'Removing manifest files...';
|
|
153
|
+
cleanStats = await cleanManifestFiles(existingManifest, cleanSpinner);
|
|
154
|
+
|
|
155
|
+
if (cleanStats.removed > 0 || cleanStats.skipped > 0) {
|
|
156
|
+
cleanSpinner.succeed(`Cleanup: ${cleanStats.removed} files removed, ${cleanStats.skipped} settings preserved`);
|
|
157
|
+
} else {
|
|
158
|
+
cleanSpinner.succeed('Cleanup: no files to remove');
|
|
159
|
+
}
|
|
160
|
+
} catch (err) {
|
|
161
|
+
const errMsg = err as Error;
|
|
162
|
+
cleanSpinner.warn(`Cleanup warning: ${errMsg.message}`);
|
|
163
|
+
}
|
|
164
|
+
} else {
|
|
165
|
+
// No manifest - first install or manual install, just overwrite
|
|
166
|
+
const existingDirs = SOURCE_DIRS.filter(dir => existsSync(join(installPath, dir)));
|
|
167
|
+
if (existingDirs.length > 0) {
|
|
168
|
+
info('No installation manifest found, files will be overwritten');
|
|
169
|
+
info(` Existing directories: ${existingDirs.join(', ')}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Create manifest
|
|
174
|
+
const manifest = createManifest(mode, installPath);
|
|
175
|
+
|
|
176
|
+
// Perform installation
|
|
177
|
+
console.log('');
|
|
178
|
+
const spinner = createSpinner('Installing files...').start();
|
|
179
|
+
|
|
180
|
+
let totalFiles = 0;
|
|
181
|
+
let totalDirs = 0;
|
|
182
|
+
|
|
183
|
+
try {
|
|
184
|
+
// For Path mode, install workflows to global first
|
|
185
|
+
if (mode === 'Path') {
|
|
186
|
+
const globalPath = homedir();
|
|
187
|
+
for (const subdir of GLOBAL_SUBDIRS) {
|
|
188
|
+
const srcWorkflows = join(sourceDir, '.claude', subdir);
|
|
189
|
+
if (existsSync(srcWorkflows)) {
|
|
190
|
+
const destWorkflows = join(globalPath, '.claude', subdir);
|
|
191
|
+
spinner.text = `Installing ${subdir} to global...`;
|
|
192
|
+
const { files, directories } = await copyDirectory(srcWorkflows, destWorkflows, manifest);
|
|
193
|
+
totalFiles += files;
|
|
194
|
+
totalDirs += directories;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
for (const dir of availableDirs) {
|
|
200
|
+
const srcPath = join(sourceDir, dir);
|
|
201
|
+
const destPath = join(installPath, dir);
|
|
202
|
+
|
|
203
|
+
spinner.text = `Installing ${dir}...`;
|
|
204
|
+
|
|
205
|
+
// For Path mode on .claude, exclude global subdirs (they're already installed to global)
|
|
206
|
+
const excludeDirs = (mode === 'Path' && dir === '.claude') ? GLOBAL_SUBDIRS : [];
|
|
207
|
+
const { files, directories } = await copyDirectory(srcPath, destPath, manifest, excludeDirs);
|
|
208
|
+
totalFiles += files;
|
|
209
|
+
totalDirs += directories;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Create version.json
|
|
213
|
+
const versionPath = join(installPath, '.claude', 'version.json');
|
|
214
|
+
if (existsSync(dirname(versionPath))) {
|
|
215
|
+
const versionData = {
|
|
216
|
+
version: version,
|
|
217
|
+
installedAt: new Date().toISOString(),
|
|
218
|
+
mode: mode,
|
|
219
|
+
installer: 'ccw'
|
|
220
|
+
};
|
|
221
|
+
writeFileSync(versionPath, JSON.stringify(versionData, null, 2), 'utf8');
|
|
222
|
+
addFileEntry(manifest, versionPath);
|
|
223
|
+
totalFiles++;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
spinner.succeed('Installation complete!');
|
|
227
|
+
|
|
228
|
+
} catch (err) {
|
|
229
|
+
spinner.fail('Installation failed');
|
|
230
|
+
const errMsg = err as Error;
|
|
231
|
+
error(errMsg.message);
|
|
232
|
+
process.exit(1);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Save manifest
|
|
236
|
+
const manifestPath = saveManifest(manifest);
|
|
237
|
+
|
|
238
|
+
// Show summary
|
|
239
|
+
console.log('');
|
|
240
|
+
const summaryLines = [
|
|
241
|
+
chalk.green.bold('✓ Installation Successful'),
|
|
242
|
+
'',
|
|
243
|
+
chalk.white(`Mode: ${chalk.cyan(mode)}`),
|
|
244
|
+
chalk.white(`Path: ${chalk.cyan(installPath)}`),
|
|
245
|
+
chalk.white(`Version: ${chalk.cyan(version)}`),
|
|
246
|
+
'',
|
|
247
|
+
chalk.gray(`Files installed: ${totalFiles}`),
|
|
248
|
+
chalk.gray(`Directories created: ${totalDirs}`)
|
|
249
|
+
];
|
|
250
|
+
|
|
251
|
+
// Add cleanup stats if any files were processed
|
|
252
|
+
if (cleanStats.removed > 0 || cleanStats.skipped > 0) {
|
|
253
|
+
summaryLines.push(chalk.gray(`Old files removed: ${cleanStats.removed}`));
|
|
254
|
+
if (cleanStats.skipped > 0) {
|
|
255
|
+
summaryLines.push(chalk.gray(`Settings preserved: ${cleanStats.skipped}`));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
summaryLines.push('');
|
|
260
|
+
summaryLines.push(chalk.gray(`Manifest: ${basename(manifestPath)}`));
|
|
261
|
+
|
|
262
|
+
// Add codex prompts info if installed
|
|
263
|
+
if (availableDirs.includes('.codex')) {
|
|
264
|
+
summaryLines.push('');
|
|
265
|
+
summaryLines.push(chalk.cyan('Codex Prompts: ✓ Installed'));
|
|
266
|
+
summaryLines.push(chalk.gray(` Path: ${join(installPath, '.codex', 'prompts')}`));
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
summaryBox({
|
|
270
|
+
title: ' Installation Summary ',
|
|
271
|
+
lines: summaryLines,
|
|
272
|
+
borderColor: 'green'
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
// Show next steps
|
|
276
|
+
console.log('');
|
|
277
|
+
info('Next steps:');
|
|
278
|
+
console.log(chalk.gray(' 1. Restart Claude Code or your IDE'));
|
|
279
|
+
console.log(chalk.gray(' 2. Run: ccw view - to open the workflow dashboard'));
|
|
280
|
+
console.log(chalk.gray(' 3. Run: ccw uninstall - to remove this installation'));
|
|
281
|
+
console.log('');
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Interactive mode selection
|
|
286
|
+
* @returns {Promise<string>} - Selected mode
|
|
287
|
+
*/
|
|
288
|
+
async function selectMode(): Promise<string> {
|
|
289
|
+
const { mode } = await inquirer.prompt([{
|
|
290
|
+
type: 'list',
|
|
291
|
+
name: 'mode',
|
|
292
|
+
message: 'Select installation mode:',
|
|
293
|
+
choices: [
|
|
294
|
+
{
|
|
295
|
+
name: `${chalk.cyan('Global')} - Install to home directory (recommended)`,
|
|
296
|
+
value: 'Global'
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: `${chalk.yellow('Path')} - Install to specific project path`,
|
|
300
|
+
value: 'Path'
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
}]);
|
|
304
|
+
|
|
305
|
+
return mode;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Interactive path selection
|
|
310
|
+
* @returns {Promise<string>} - Selected path
|
|
311
|
+
*/
|
|
312
|
+
async function selectPath(): Promise<string> {
|
|
313
|
+
const { path } = await inquirer.prompt([{
|
|
314
|
+
type: 'input',
|
|
315
|
+
name: 'path',
|
|
316
|
+
message: 'Enter installation path:',
|
|
317
|
+
default: process.cwd(),
|
|
318
|
+
validate: (input: string) => {
|
|
319
|
+
if (!input) return 'Path is required';
|
|
320
|
+
if (!existsSync(input)) {
|
|
321
|
+
return `Path does not exist: ${input}`;
|
|
322
|
+
}
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
325
|
+
}]);
|
|
326
|
+
|
|
327
|
+
return path;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Clean files based on manifest record
|
|
332
|
+
* Only removes files that were installed by the previous installation
|
|
333
|
+
* @param manifest - Existing manifest with file records
|
|
334
|
+
* @param spinner - Spinner for progress display
|
|
335
|
+
* @returns Count of removed files and skipped files
|
|
336
|
+
*/
|
|
337
|
+
async function cleanManifestFiles(
|
|
338
|
+
manifest: any,
|
|
339
|
+
spinner: Ora
|
|
340
|
+
): Promise<{ removed: number; skipped: number }> {
|
|
341
|
+
let removed = 0;
|
|
342
|
+
let skipped = 0;
|
|
343
|
+
|
|
344
|
+
const files = manifest.files || [];
|
|
345
|
+
const directories = manifest.directories || [];
|
|
346
|
+
|
|
347
|
+
// Remove files in reverse order (process deepest paths first)
|
|
348
|
+
const sortedFiles = [...files].sort((a: any, b: any) => b.path.length - a.path.length);
|
|
349
|
+
|
|
350
|
+
for (const fileEntry of sortedFiles) {
|
|
351
|
+
const filePath = fileEntry.path;
|
|
352
|
+
const fileName = basename(filePath);
|
|
353
|
+
|
|
354
|
+
// Skip excluded files (user settings)
|
|
355
|
+
if (EXCLUDED_FILES.includes(fileName)) {
|
|
356
|
+
skipped++;
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
try {
|
|
361
|
+
if (existsSync(filePath)) {
|
|
362
|
+
spinner.text = `Removing: ${fileName}`;
|
|
363
|
+
unlinkSync(filePath);
|
|
364
|
+
removed++;
|
|
365
|
+
}
|
|
366
|
+
} catch {
|
|
367
|
+
// Ignore errors during cleanup
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Clean up empty directories (deepest first)
|
|
372
|
+
const sortedDirs = [...directories].sort((a: any, b: any) => b.path.length - a.path.length);
|
|
373
|
+
|
|
374
|
+
for (const dirEntry of sortedDirs) {
|
|
375
|
+
const dirPath = dirEntry.path;
|
|
376
|
+
try {
|
|
377
|
+
if (existsSync(dirPath)) {
|
|
378
|
+
const contents = readdirSync(dirPath);
|
|
379
|
+
if (contents.length === 0) {
|
|
380
|
+
rmdirSync(dirPath);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
} catch {
|
|
384
|
+
// Ignore errors during cleanup
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return { removed, skipped };
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Create backup of files recorded in manifest
|
|
393
|
+
* @param manifest - Existing manifest with file records
|
|
394
|
+
*/
|
|
395
|
+
async function createBackup(manifest: any): Promise<void> {
|
|
396
|
+
const spinner = createSpinner('Creating backup...').start();
|
|
397
|
+
|
|
398
|
+
try {
|
|
399
|
+
const installPath = manifest.installation_path;
|
|
400
|
+
const timestamp = new Date().toISOString().replace(/[-:]/g, '').replace('T', '-').split('.')[0];
|
|
401
|
+
const backupDir = join(installPath, `.claude-backup-${timestamp}`);
|
|
402
|
+
|
|
403
|
+
const files = manifest.files || [];
|
|
404
|
+
let backedUp = 0;
|
|
405
|
+
|
|
406
|
+
for (const fileEntry of files) {
|
|
407
|
+
const filePath = fileEntry.path;
|
|
408
|
+
|
|
409
|
+
if (!existsSync(filePath)) continue;
|
|
410
|
+
|
|
411
|
+
// Calculate relative path from install path
|
|
412
|
+
const relativePath = filePath.replace(installPath, '').replace(/^[\\/]/, '');
|
|
413
|
+
const backupPath = join(backupDir, relativePath);
|
|
414
|
+
|
|
415
|
+
// Create directory structure
|
|
416
|
+
const backupFileDir = dirname(backupPath);
|
|
417
|
+
if (!existsSync(backupFileDir)) {
|
|
418
|
+
mkdirSync(backupFileDir, { recursive: true });
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Copy file
|
|
422
|
+
try {
|
|
423
|
+
spinner.text = `Backing up: ${basename(filePath)}`;
|
|
424
|
+
copyFileSync(filePath, backupPath);
|
|
425
|
+
backedUp++;
|
|
426
|
+
} catch {
|
|
427
|
+
// Ignore individual file errors
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (backedUp > 0) {
|
|
432
|
+
spinner.succeed(`Backup created: ${backupDir} (${backedUp} files)`);
|
|
433
|
+
} else {
|
|
434
|
+
spinner.info('No files to backup');
|
|
435
|
+
// Remove empty backup dir
|
|
436
|
+
try { rmdirSync(backupDir); } catch { /* ignore */ }
|
|
437
|
+
}
|
|
438
|
+
} catch (err) {
|
|
439
|
+
const errMsg = err as Error;
|
|
440
|
+
spinner.warn(`Backup failed: ${errMsg.message}`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Copy directory recursively
|
|
446
|
+
* @param {string} src - Source directory
|
|
447
|
+
* @param {string} dest - Destination directory
|
|
448
|
+
* @param {Object} manifest - Manifest to track files (optional)
|
|
449
|
+
* @param {string[]} excludeDirs - Directory names to exclude (optional)
|
|
450
|
+
* @returns {Object} - Count of files and directories
|
|
451
|
+
*/
|
|
452
|
+
async function copyDirectory(
|
|
453
|
+
src: string,
|
|
454
|
+
dest: string,
|
|
455
|
+
manifest: any = null,
|
|
456
|
+
excludeDirs: string[] = [],
|
|
457
|
+
excludeFiles: string[] = EXCLUDED_FILES
|
|
458
|
+
): Promise<CopyResult> {
|
|
459
|
+
let files = 0;
|
|
460
|
+
let directories = 0;
|
|
461
|
+
|
|
462
|
+
// Create destination directory
|
|
463
|
+
if (!existsSync(dest)) {
|
|
464
|
+
mkdirSync(dest, { recursive: true });
|
|
465
|
+
directories++;
|
|
466
|
+
if (manifest) addDirectoryEntry(manifest, dest);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
const entries = readdirSync(src);
|
|
470
|
+
|
|
471
|
+
for (const entry of entries) {
|
|
472
|
+
// Skip excluded directories
|
|
473
|
+
if (excludeDirs.includes(entry)) {
|
|
474
|
+
continue;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// Skip excluded files
|
|
478
|
+
if (excludeFiles.includes(entry)) {
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
const srcPath = join(src, entry);
|
|
483
|
+
const destPath = join(dest, entry);
|
|
484
|
+
const stat = statSync(srcPath);
|
|
485
|
+
|
|
486
|
+
if (stat.isDirectory()) {
|
|
487
|
+
const result = await copyDirectory(srcPath, destPath, manifest, [], excludeFiles);
|
|
488
|
+
files += result.files;
|
|
489
|
+
directories += result.directories;
|
|
490
|
+
} else {
|
|
491
|
+
copyFileSync(srcPath, destPath);
|
|
492
|
+
files++;
|
|
493
|
+
if (manifest) addFileEntry(manifest, destPath);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
return { files, directories };
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Get package version
|
|
502
|
+
* @returns {string} - Version string
|
|
503
|
+
*/
|
|
504
|
+
function getVersion(): string {
|
|
505
|
+
try {
|
|
506
|
+
// First try root package.json (parent of ccw)
|
|
507
|
+
const rootPkgPath = join(getSourceDir(), 'package.json');
|
|
508
|
+
if (existsSync(rootPkgPath)) {
|
|
509
|
+
const pkg = JSON.parse(readFileSync(rootPkgPath, 'utf8'));
|
|
510
|
+
if (pkg.version) return pkg.version;
|
|
511
|
+
}
|
|
512
|
+
// Fallback to ccw package.json
|
|
513
|
+
const pkgPath = join(getPackageRoot(), 'package.json');
|
|
514
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
515
|
+
return pkg.version || '1.0.0';
|
|
516
|
+
} catch {
|
|
517
|
+
return '1.0.0';
|
|
518
|
+
}
|
|
519
|
+
}
|
|
@@ -5,7 +5,7 @@ import { getAllManifests } from '../core/manifest.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* List command handler - shows all installations
|
|
7
7
|
*/
|
|
8
|
-
export async function listCommand() {
|
|
8
|
+
export async function listCommand(): Promise<void> {
|
|
9
9
|
showBanner();
|
|
10
10
|
console.log(chalk.cyan.bold(' Installed Claude Code Workflow Instances\n'));
|
|
11
11
|
|