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
|
@@ -4,12 +4,17 @@ import { promisify } from 'util';
|
|
|
4
4
|
|
|
5
5
|
const execAsync = promisify(exec);
|
|
6
6
|
|
|
7
|
+
interface StopOptions {
|
|
8
|
+
port?: number;
|
|
9
|
+
force?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
/**
|
|
8
13
|
* Find process using a specific port (Windows)
|
|
9
14
|
* @param {number} port - Port number
|
|
10
15
|
* @returns {Promise<string|null>} PID or null
|
|
11
16
|
*/
|
|
12
|
-
async function findProcessOnPort(port) {
|
|
17
|
+
async function findProcessOnPort(port: number): Promise<string | null> {
|
|
13
18
|
try {
|
|
14
19
|
const { stdout } = await execAsync(`netstat -ano | findstr :${port} | findstr LISTENING`);
|
|
15
20
|
const lines = stdout.trim().split('\n');
|
|
@@ -28,7 +33,7 @@ async function findProcessOnPort(port) {
|
|
|
28
33
|
* @param {string} pid - Process ID
|
|
29
34
|
* @returns {Promise<boolean>} Success status
|
|
30
35
|
*/
|
|
31
|
-
async function killProcess(pid) {
|
|
36
|
+
async function killProcess(pid: string): Promise<boolean> {
|
|
32
37
|
try {
|
|
33
38
|
await execAsync(`taskkill /PID ${pid} /F`);
|
|
34
39
|
return true;
|
|
@@ -41,7 +46,7 @@ async function killProcess(pid) {
|
|
|
41
46
|
* Stop command handler - stops the running CCW dashboard server
|
|
42
47
|
* @param {Object} options - Command options
|
|
43
48
|
*/
|
|
44
|
-
export async function stopCommand(options) {
|
|
49
|
+
export async function stopCommand(options: StopOptions): Promise<void> {
|
|
45
50
|
const port = options.port || 3456;
|
|
46
51
|
const force = options.force || false;
|
|
47
52
|
|
|
@@ -67,7 +72,7 @@ export async function stopCommand(options) {
|
|
|
67
72
|
await new Promise(resolve => setTimeout(resolve, 500));
|
|
68
73
|
|
|
69
74
|
console.log(chalk.green.bold('\n Server stopped successfully!\n'));
|
|
70
|
-
|
|
75
|
+
process.exit(0);
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
// No CCW server responding, check if port is in use
|
|
@@ -75,7 +80,7 @@ export async function stopCommand(options) {
|
|
|
75
80
|
|
|
76
81
|
if (!pid) {
|
|
77
82
|
console.log(chalk.yellow(` No server running on port ${port}\n`));
|
|
78
|
-
|
|
83
|
+
process.exit(0);
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
// Port is in use by another process
|
|
@@ -87,15 +92,20 @@ export async function stopCommand(options) {
|
|
|
87
92
|
|
|
88
93
|
if (killed) {
|
|
89
94
|
console.log(chalk.green.bold('\n Process killed successfully!\n'));
|
|
95
|
+
process.exit(0);
|
|
90
96
|
} else {
|
|
91
97
|
console.log(chalk.red('\n Failed to kill process. Try running as administrator.\n'));
|
|
98
|
+
process.exit(1);
|
|
92
99
|
}
|
|
93
100
|
} else {
|
|
94
101
|
console.log(chalk.gray(`\n This is not a CCW server. Use --force to kill it:`));
|
|
95
102
|
console.log(chalk.white(` ccw stop --force\n`));
|
|
103
|
+
process.exit(0);
|
|
96
104
|
}
|
|
97
105
|
|
|
98
106
|
} catch (err) {
|
|
99
|
-
|
|
107
|
+
const error = err as Error;
|
|
108
|
+
console.error(chalk.red(`\n Error: ${error.message}\n`));
|
|
109
|
+
process.exit(1);
|
|
100
110
|
}
|
|
101
111
|
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Command - Execute and manage CCW tools
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import { listTools, executeTool, getTool, getAllToolSchemas } from '../tools/index.js';
|
|
7
|
+
|
|
8
|
+
interface ToolOptions {
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ExecOptions {
|
|
13
|
+
path?: string;
|
|
14
|
+
old?: string;
|
|
15
|
+
new?: string;
|
|
16
|
+
action?: string;
|
|
17
|
+
query?: string;
|
|
18
|
+
limit?: string;
|
|
19
|
+
file?: string;
|
|
20
|
+
files?: string;
|
|
21
|
+
languages?: string;
|
|
22
|
+
mode?: string;
|
|
23
|
+
operation?: string;
|
|
24
|
+
line?: string;
|
|
25
|
+
text?: string;
|
|
26
|
+
dryRun?: boolean;
|
|
27
|
+
replaceAll?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* List all available tools
|
|
32
|
+
*/
|
|
33
|
+
async function listAction(): Promise<void> {
|
|
34
|
+
const tools = listTools();
|
|
35
|
+
|
|
36
|
+
if (tools.length === 0) {
|
|
37
|
+
console.log(chalk.yellow('No tools registered'));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
console.log(chalk.bold.cyan('\nAvailable Tools:\n'));
|
|
42
|
+
|
|
43
|
+
for (const tool of tools) {
|
|
44
|
+
console.log(chalk.bold.white(` ${tool.name}`));
|
|
45
|
+
console.log(chalk.gray(` ${tool.description}`));
|
|
46
|
+
|
|
47
|
+
if (tool.parameters?.properties) {
|
|
48
|
+
const props = tool.parameters.properties;
|
|
49
|
+
const required = tool.parameters.required || [];
|
|
50
|
+
|
|
51
|
+
console.log(chalk.gray(' Parameters:'));
|
|
52
|
+
for (const [name, schema] of Object.entries(props)) {
|
|
53
|
+
const req = required.includes(name) ? chalk.red('*') : '';
|
|
54
|
+
const defaultVal = (schema as any).default !== undefined ? chalk.gray(` (default: ${(schema as any).default})`) : '';
|
|
55
|
+
console.log(chalk.gray(` - ${name}${req}: ${(schema as any).description}${defaultVal}`));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
console.log();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Show tool schema in MCP-compatible JSON format
|
|
64
|
+
*/
|
|
65
|
+
async function schemaAction(options: ToolOptions): Promise<void> {
|
|
66
|
+
const { name } = options;
|
|
67
|
+
|
|
68
|
+
if (name) {
|
|
69
|
+
const tool = getTool(name);
|
|
70
|
+
if (!tool) {
|
|
71
|
+
console.error(chalk.red(`Tool not found: ${name}`));
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const schema = {
|
|
76
|
+
name: tool.name,
|
|
77
|
+
description: tool.description,
|
|
78
|
+
inputSchema: {
|
|
79
|
+
type: 'object',
|
|
80
|
+
properties: tool.parameters?.properties || {},
|
|
81
|
+
required: tool.parameters?.required || []
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
console.log(JSON.stringify(schema, null, 2));
|
|
85
|
+
} else {
|
|
86
|
+
const schemas = getAllToolSchemas();
|
|
87
|
+
console.log(JSON.stringify({ tools: schemas }, null, 2));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Execute a tool with given parameters
|
|
93
|
+
* @param {string} toolName - Tool name
|
|
94
|
+
* @param {string|undefined} jsonParams - JSON string of parameters
|
|
95
|
+
* @param {Object} options - CLI options
|
|
96
|
+
*/
|
|
97
|
+
async function execAction(toolName: string | undefined, jsonParams: string | undefined, options: ExecOptions): Promise<void> {
|
|
98
|
+
if (!toolName) {
|
|
99
|
+
console.error(chalk.red('Tool name is required'));
|
|
100
|
+
console.error(chalk.gray('Usage: ccw tool exec <tool_name> \'{"param": "value"}\''));
|
|
101
|
+
console.error(chalk.gray(' ccw tool exec edit_file --path file.txt --old "old" --new "new"'));
|
|
102
|
+
console.error(chalk.gray(' ccw tool exec codex_lens --action search --query "pattern"'));
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const tool = getTool(toolName);
|
|
107
|
+
if (!tool) {
|
|
108
|
+
console.error(chalk.red(`Tool not found: ${toolName}`));
|
|
109
|
+
console.error(chalk.gray('Use "ccw tool list" to see available tools'));
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Build params from CLI options or JSON
|
|
114
|
+
let params: any = {};
|
|
115
|
+
|
|
116
|
+
// Check if JSON params provided
|
|
117
|
+
if (jsonParams && jsonParams.trim().startsWith('{')) {
|
|
118
|
+
try {
|
|
119
|
+
params = JSON.parse(jsonParams);
|
|
120
|
+
} catch (e) {
|
|
121
|
+
const error = e as Error;
|
|
122
|
+
console.error(chalk.red('Invalid JSON parameters'));
|
|
123
|
+
console.error(chalk.gray(`Parse error: ${error.message}`));
|
|
124
|
+
process.exit(1);
|
|
125
|
+
}
|
|
126
|
+
} else if (toolName === 'edit_file') {
|
|
127
|
+
// Parameter mode for edit_file
|
|
128
|
+
if (!options.path || !options.old || !options.new) {
|
|
129
|
+
console.error(chalk.red('edit_file requires --path, --old, and --new parameters'));
|
|
130
|
+
console.error(chalk.gray('Usage: ccw tool exec edit_file --path file.txt --old "old text" --new "new text"'));
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
params.path = options.path;
|
|
134
|
+
params.oldText = options.old;
|
|
135
|
+
params.newText = options.new;
|
|
136
|
+
} else if (toolName === 'codex_lens') {
|
|
137
|
+
// Parameter mode for codex_lens
|
|
138
|
+
if (!options.action) {
|
|
139
|
+
console.error(chalk.red('codex_lens requires --action parameter'));
|
|
140
|
+
console.error(chalk.gray('Usage: ccw tool exec codex_lens --action search --query "pattern" --path .'));
|
|
141
|
+
console.error(chalk.gray('Actions: init, search, search_files, symbol, status, update, bootstrap, check'));
|
|
142
|
+
process.exit(1);
|
|
143
|
+
}
|
|
144
|
+
params.action = options.action;
|
|
145
|
+
if (options.path) params.path = options.path;
|
|
146
|
+
if (options.query) params.query = options.query;
|
|
147
|
+
if (options.limit) params.limit = parseInt(options.limit, 10);
|
|
148
|
+
if (options.file) params.file = options.file;
|
|
149
|
+
if (options.files) params.files = options.files.split(',').map(f => f.trim());
|
|
150
|
+
if (options.languages) params.languages = options.languages.split(',').map(l => l.trim());
|
|
151
|
+
} else if (jsonParams) {
|
|
152
|
+
// Non-JSON string provided but not for supported tools
|
|
153
|
+
console.error(chalk.red('Parameters must be valid JSON'));
|
|
154
|
+
console.error(chalk.gray(`Usage: ccw tool exec ${toolName} '{"param": "value"}'`));
|
|
155
|
+
process.exit(1);
|
|
156
|
+
}
|
|
157
|
+
// If no params provided, use empty object (tool may have defaults)
|
|
158
|
+
|
|
159
|
+
// Execute tool
|
|
160
|
+
const result = await executeTool(toolName, params);
|
|
161
|
+
|
|
162
|
+
// Always output JSON
|
|
163
|
+
console.log(JSON.stringify(result, null, 2));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Tool command entry point
|
|
168
|
+
* @param {string} subcommand - Subcommand (list, schema, exec)
|
|
169
|
+
* @param {string[]} args - Arguments array [toolName, jsonParams, ...]
|
|
170
|
+
* @param {Object} options - CLI options
|
|
171
|
+
*/
|
|
172
|
+
export async function toolCommand(subcommand: string, args: string | string[], options: ExecOptions): Promise<void> {
|
|
173
|
+
// args is now an array due to [args...] in cli.js
|
|
174
|
+
const argsArray = Array.isArray(args) ? args : (args ? [args] : []);
|
|
175
|
+
|
|
176
|
+
// Handle subcommands
|
|
177
|
+
switch (subcommand) {
|
|
178
|
+
case 'list':
|
|
179
|
+
await listAction();
|
|
180
|
+
break;
|
|
181
|
+
case 'schema':
|
|
182
|
+
await schemaAction({ name: argsArray[0] });
|
|
183
|
+
break;
|
|
184
|
+
case 'exec':
|
|
185
|
+
await execAction(argsArray[0], argsArray[1], options);
|
|
186
|
+
break;
|
|
187
|
+
default:
|
|
188
|
+
console.log(chalk.bold.cyan('\nCCW Tool System\n'));
|
|
189
|
+
console.log('Subcommands:');
|
|
190
|
+
console.log(chalk.gray(' list List all available tools'));
|
|
191
|
+
console.log(chalk.gray(' schema [name] Show tool schema (JSON)'));
|
|
192
|
+
console.log(chalk.gray(' exec <name> Execute a tool'));
|
|
193
|
+
console.log();
|
|
194
|
+
console.log('Usage:');
|
|
195
|
+
console.log(chalk.gray(' ccw tool list'));
|
|
196
|
+
console.log(chalk.gray(' ccw tool schema edit_file'));
|
|
197
|
+
console.log(chalk.gray(' ccw tool exec <tool_name> \'{"param": "value"}\''));
|
|
198
|
+
console.log(chalk.gray(' ccw tool exec edit_file --path file.txt --old "old text" --new "new text"'));
|
|
199
|
+
console.log(chalk.gray(' ccw tool exec codex_lens --action search --query "def main" --path .'));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { existsSync, unlinkSync, rmdirSync, readdirSync, statSync } from 'fs';
|
|
2
2
|
import { join, dirname, basename } from 'path';
|
|
3
|
+
import { homedir } from 'os';
|
|
3
4
|
import inquirer from 'inquirer';
|
|
4
5
|
import chalk from 'chalk';
|
|
5
6
|
import { showBanner, createSpinner, success, info, warning, error, summaryBox, divider } from '../utils/ui.js';
|
|
6
7
|
import { getAllManifests, deleteManifest } from '../core/manifest.js';
|
|
7
8
|
|
|
9
|
+
// Global subdirectories that should be protected when Global installation exists
|
|
10
|
+
const GLOBAL_SUBDIRS = ['workflows', 'scripts', 'templates'];
|
|
11
|
+
|
|
12
|
+
interface UninstallOptions {}
|
|
13
|
+
|
|
14
|
+
interface FileEntry {
|
|
15
|
+
path: string;
|
|
16
|
+
error: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
8
19
|
/**
|
|
9
20
|
* Uninstall command handler
|
|
10
21
|
* @param {Object} options - Command options
|
|
11
22
|
*/
|
|
12
|
-
export async function uninstallCommand(options) {
|
|
23
|
+
export async function uninstallCommand(options: UninstallOptions): Promise<void> {
|
|
13
24
|
showBanner();
|
|
14
25
|
console.log(chalk.cyan.bold(' Uninstall Claude Code Workflow\n'));
|
|
15
26
|
|
|
@@ -38,7 +49,7 @@ export async function uninstallCommand(options) {
|
|
|
38
49
|
divider();
|
|
39
50
|
|
|
40
51
|
// Select installation to uninstall
|
|
41
|
-
let selectedManifest;
|
|
52
|
+
let selectedManifest: any;
|
|
42
53
|
|
|
43
54
|
if (manifests.length === 1) {
|
|
44
55
|
const { confirm } = await inquirer.prompt([{
|
|
@@ -92,12 +103,28 @@ export async function uninstallCommand(options) {
|
|
|
92
103
|
|
|
93
104
|
console.log('');
|
|
94
105
|
|
|
106
|
+
// Check if this is a Path mode uninstallation and if Global installation exists
|
|
107
|
+
const isPathMode = selectedManifest.installation_mode === 'Path';
|
|
108
|
+
const globalClaudeDir = join(homedir(), '.claude');
|
|
109
|
+
let hasGlobalInstallation = false;
|
|
110
|
+
let skippedFiles = 0;
|
|
111
|
+
|
|
112
|
+
if (isPathMode) {
|
|
113
|
+
// Check if any Global installation manifest exists
|
|
114
|
+
const globalManifest = manifests.find(m => m.installation_mode === 'Global');
|
|
115
|
+
if (globalManifest) {
|
|
116
|
+
hasGlobalInstallation = true;
|
|
117
|
+
info('Global installation detected - global files will be preserved');
|
|
118
|
+
console.log('');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
95
122
|
// Perform uninstallation
|
|
96
123
|
const spinner = createSpinner('Removing files...').start();
|
|
97
124
|
|
|
98
125
|
let removedFiles = 0;
|
|
99
126
|
let removedDirs = 0;
|
|
100
|
-
let failedFiles = [];
|
|
127
|
+
let failedFiles: FileEntry[] = [];
|
|
101
128
|
|
|
102
129
|
try {
|
|
103
130
|
// Remove files first (in reverse order to handle nested files)
|
|
@@ -105,6 +132,25 @@ export async function uninstallCommand(options) {
|
|
|
105
132
|
|
|
106
133
|
for (const fileEntry of files) {
|
|
107
134
|
const filePath = fileEntry.path;
|
|
135
|
+
|
|
136
|
+
// For Path mode uninstallation, skip global files if Global installation exists
|
|
137
|
+
if (isPathMode && hasGlobalInstallation) {
|
|
138
|
+
const normalizedPath = filePath.toLowerCase().replace(/\\/g, '/');
|
|
139
|
+
const normalizedGlobalDir = globalClaudeDir.toLowerCase().replace(/\\/g, '/');
|
|
140
|
+
|
|
141
|
+
// Check if file is under global .claude directory
|
|
142
|
+
if (normalizedPath.startsWith(normalizedGlobalDir)) {
|
|
143
|
+
// Check if it's in one of the global subdirectories
|
|
144
|
+
const relativePath = normalizedPath.substring(normalizedGlobalDir.length + 1);
|
|
145
|
+
const topDir = relativePath.split('/')[0];
|
|
146
|
+
|
|
147
|
+
if (GLOBAL_SUBDIRS.includes(topDir)) {
|
|
148
|
+
skippedFiles++;
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
108
154
|
spinner.text = `Removing: ${basename(filePath)}`;
|
|
109
155
|
|
|
110
156
|
try {
|
|
@@ -113,7 +159,8 @@ export async function uninstallCommand(options) {
|
|
|
113
159
|
removedFiles++;
|
|
114
160
|
}
|
|
115
161
|
} catch (err) {
|
|
116
|
-
|
|
162
|
+
const error = err as Error;
|
|
163
|
+
failedFiles.push({ path: filePath, error: error.message });
|
|
117
164
|
}
|
|
118
165
|
}
|
|
119
166
|
|
|
@@ -121,7 +168,7 @@ export async function uninstallCommand(options) {
|
|
|
121
168
|
const directories = [...(selectedManifest.directories || [])].reverse();
|
|
122
169
|
|
|
123
170
|
// Sort by path length (deepest first)
|
|
124
|
-
directories.sort((a, b) => b.path.length - a.path.length);
|
|
171
|
+
directories.sort((a: any, b: any) => b.path.length - a.path.length);
|
|
125
172
|
|
|
126
173
|
for (const dirEntry of directories) {
|
|
127
174
|
const dirPath = dirEntry.path;
|
|
@@ -158,7 +205,8 @@ export async function uninstallCommand(options) {
|
|
|
158
205
|
|
|
159
206
|
} catch (err) {
|
|
160
207
|
spinner.fail('Uninstall failed');
|
|
161
|
-
|
|
208
|
+
const errMsg = err as Error;
|
|
209
|
+
error(errMsg.message);
|
|
162
210
|
return;
|
|
163
211
|
}
|
|
164
212
|
|
|
@@ -168,41 +216,43 @@ export async function uninstallCommand(options) {
|
|
|
168
216
|
// Show summary
|
|
169
217
|
console.log('');
|
|
170
218
|
|
|
219
|
+
const summaryLines: string[] = [];
|
|
220
|
+
|
|
171
221
|
if (failedFiles.length > 0) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
'',
|
|
177
|
-
chalk.white(`Files removed: ${chalk.green(removedFiles)}`),
|
|
178
|
-
chalk.white(`Directories removed: ${chalk.green(removedDirs)}`),
|
|
179
|
-
chalk.white(`Failed: ${chalk.red(failedFiles.length)}`),
|
|
180
|
-
'',
|
|
181
|
-
chalk.gray('Some files could not be removed.'),
|
|
182
|
-
chalk.gray('They may be in use or require elevated permissions.'),
|
|
183
|
-
],
|
|
184
|
-
borderColor: 'yellow'
|
|
185
|
-
});
|
|
222
|
+
summaryLines.push(chalk.yellow.bold('⚠ Partially Completed'));
|
|
223
|
+
} else {
|
|
224
|
+
summaryLines.push(chalk.green.bold('✓ Successfully Uninstalled'));
|
|
225
|
+
}
|
|
186
226
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
227
|
+
summaryLines.push('');
|
|
228
|
+
summaryLines.push(chalk.white(`Files removed: ${chalk.green(removedFiles.toString())}`));
|
|
229
|
+
summaryLines.push(chalk.white(`Directories removed: ${chalk.green(removedDirs.toString())}`));
|
|
230
|
+
|
|
231
|
+
if (skippedFiles > 0) {
|
|
232
|
+
summaryLines.push(chalk.white(`Global files preserved: ${chalk.cyan(skippedFiles.toString())}`));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (failedFiles.length > 0) {
|
|
236
|
+
summaryLines.push(chalk.white(`Failed: ${chalk.red(failedFiles.length.toString())}`));
|
|
237
|
+
summaryLines.push('');
|
|
238
|
+
summaryLines.push(chalk.gray('Some files could not be removed.'));
|
|
239
|
+
summaryLines.push(chalk.gray('They may be in use or require elevated permissions.'));
|
|
194
240
|
} else {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
241
|
+
summaryLines.push('');
|
|
242
|
+
summaryLines.push(chalk.gray('Manifest removed'));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
summaryBox({
|
|
246
|
+
title: ' Uninstall Summary ',
|
|
247
|
+
lines: summaryLines,
|
|
248
|
+
borderColor: failedFiles.length > 0 ? 'yellow' : 'green'
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
if (process.env.DEBUG && failedFiles.length > 0) {
|
|
252
|
+
console.log('');
|
|
253
|
+
console.log(chalk.gray('Failed files:'));
|
|
254
|
+
failedFiles.forEach(f => {
|
|
255
|
+
console.log(chalk.red(` ${f.path}: ${f.error}`));
|
|
206
256
|
});
|
|
207
257
|
}
|
|
208
258
|
|
|
@@ -213,7 +263,7 @@ export async function uninstallCommand(options) {
|
|
|
213
263
|
* Recursively remove empty directories
|
|
214
264
|
* @param {string} dirPath - Directory path
|
|
215
265
|
*/
|
|
216
|
-
async function removeEmptyDirs(dirPath) {
|
|
266
|
+
async function removeEmptyDirs(dirPath: string): Promise<void> {
|
|
217
267
|
if (!existsSync(dirPath)) return;
|
|
218
268
|
|
|
219
269
|
const stat = statSync(dirPath);
|
|
@@ -235,4 +285,3 @@ async function removeEmptyDirs(dirPath) {
|
|
|
235
285
|
rmdirSync(dirPath);
|
|
236
286
|
}
|
|
237
287
|
}
|
|
238
|
-
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, readdirSync, statSync, copyFileSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
2
2
|
import { join, dirname, basename } from 'path';
|
|
3
|
+
import { homedir } from 'os';
|
|
3
4
|
import { fileURLToPath } from 'url';
|
|
4
5
|
import inquirer from 'inquirer';
|
|
5
6
|
import chalk from 'chalk';
|
|
@@ -12,13 +13,30 @@ const __dirname = dirname(__filename);
|
|
|
12
13
|
// Source directories to install
|
|
13
14
|
const SOURCE_DIRS = ['.claude', '.codex', '.gemini', '.qwen'];
|
|
14
15
|
|
|
16
|
+
// Subdirectories that should always be installed to global (~/.claude/)
|
|
17
|
+
const GLOBAL_SUBDIRS = ['workflows', 'scripts', 'templates'];
|
|
18
|
+
|
|
19
|
+
interface UpgradeOptions {
|
|
20
|
+
all?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface UpgradeResult {
|
|
24
|
+
files: number;
|
|
25
|
+
directories: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface CopyResult {
|
|
29
|
+
files: number;
|
|
30
|
+
directories: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
15
33
|
// Get package root directory (ccw/src/commands -> ccw)
|
|
16
|
-
function getPackageRoot() {
|
|
34
|
+
function getPackageRoot(): string {
|
|
17
35
|
return join(__dirname, '..', '..');
|
|
18
36
|
}
|
|
19
37
|
|
|
20
38
|
// Get source installation directory (parent of ccw)
|
|
21
|
-
function getSourceDir() {
|
|
39
|
+
function getSourceDir(): string {
|
|
22
40
|
return join(getPackageRoot(), '..');
|
|
23
41
|
}
|
|
24
42
|
|
|
@@ -26,8 +44,15 @@ function getSourceDir() {
|
|
|
26
44
|
* Get package version
|
|
27
45
|
* @returns {string} - Version string
|
|
28
46
|
*/
|
|
29
|
-
function getVersion() {
|
|
47
|
+
function getVersion(): string {
|
|
30
48
|
try {
|
|
49
|
+
// First try root package.json (parent of ccw)
|
|
50
|
+
const rootPkgPath = join(getSourceDir(), 'package.json');
|
|
51
|
+
if (existsSync(rootPkgPath)) {
|
|
52
|
+
const pkg = JSON.parse(readFileSync(rootPkgPath, 'utf8'));
|
|
53
|
+
if (pkg.version) return pkg.version;
|
|
54
|
+
}
|
|
55
|
+
// Fallback to ccw package.json
|
|
31
56
|
const pkgPath = join(getPackageRoot(), 'package.json');
|
|
32
57
|
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
33
58
|
return pkg.version || '1.0.0';
|
|
@@ -40,7 +65,7 @@ function getVersion() {
|
|
|
40
65
|
* Upgrade command handler
|
|
41
66
|
* @param {Object} options - Command options
|
|
42
67
|
*/
|
|
43
|
-
export async function upgradeCommand(options) {
|
|
68
|
+
export async function upgradeCommand(options: UpgradeOptions): Promise<void> {
|
|
44
69
|
showBanner();
|
|
45
70
|
console.log(chalk.cyan.bold(' Upgrade Claude Code Workflow\n'));
|
|
46
71
|
|
|
@@ -58,7 +83,7 @@ export async function upgradeCommand(options) {
|
|
|
58
83
|
// Display current installations
|
|
59
84
|
console.log(chalk.white.bold(' Current installations:\n'));
|
|
60
85
|
|
|
61
|
-
const upgradeTargets = [];
|
|
86
|
+
const upgradeTargets: any[] = [];
|
|
62
87
|
|
|
63
88
|
for (let i = 0; i < manifests.length; i++) {
|
|
64
89
|
const m = manifests[i];
|
|
@@ -105,7 +130,7 @@ export async function upgradeCommand(options) {
|
|
|
105
130
|
}
|
|
106
131
|
|
|
107
132
|
// Select which installations to upgrade
|
|
108
|
-
let selectedManifests = [];
|
|
133
|
+
let selectedManifests: any[] = [];
|
|
109
134
|
|
|
110
135
|
if (options.all) {
|
|
111
136
|
selectedManifests = upgradeTargets.map(t => t.manifest);
|
|
@@ -143,12 +168,12 @@ export async function upgradeCommand(options) {
|
|
|
143
168
|
return;
|
|
144
169
|
}
|
|
145
170
|
|
|
146
|
-
selectedManifests = selections.map(i => upgradeTargets[i].manifest);
|
|
171
|
+
selectedManifests = selections.map((i: number) => upgradeTargets[i].manifest);
|
|
147
172
|
}
|
|
148
173
|
|
|
149
174
|
// Perform upgrades
|
|
150
175
|
console.log('');
|
|
151
|
-
const results = [];
|
|
176
|
+
const results: any[] = [];
|
|
152
177
|
const sourceDir = getSourceDir();
|
|
153
178
|
|
|
154
179
|
for (const manifest of selectedManifests) {
|
|
@@ -159,9 +184,10 @@ export async function upgradeCommand(options) {
|
|
|
159
184
|
upgradeSpinner.succeed(`Upgraded ${manifest.installation_mode}: ${result.files} files`);
|
|
160
185
|
results.push({ manifest, success: true, ...result });
|
|
161
186
|
} catch (err) {
|
|
187
|
+
const errMsg = err as Error;
|
|
162
188
|
upgradeSpinner.fail(`Failed to upgrade ${manifest.installation_mode}`);
|
|
163
|
-
error(
|
|
164
|
-
results.push({ manifest, success: false, error:
|
|
189
|
+
error(errMsg.message);
|
|
190
|
+
results.push({ manifest, success: false, error: errMsg.message });
|
|
165
191
|
}
|
|
166
192
|
}
|
|
167
193
|
|
|
@@ -208,8 +234,9 @@ export async function upgradeCommand(options) {
|
|
|
208
234
|
* @param {string} version - Version string
|
|
209
235
|
* @returns {Promise<Object>} - Upgrade result
|
|
210
236
|
*/
|
|
211
|
-
async function performUpgrade(manifest, sourceDir, version) {
|
|
237
|
+
async function performUpgrade(manifest: any, sourceDir: string, version: string): Promise<UpgradeResult> {
|
|
212
238
|
const installPath = manifest.installation_path;
|
|
239
|
+
const mode = manifest.installation_mode;
|
|
213
240
|
|
|
214
241
|
// Get available source directories
|
|
215
242
|
const availableDirs = SOURCE_DIRS.filter(dir => existsSync(join(sourceDir, dir)));
|
|
@@ -219,30 +246,37 @@ async function performUpgrade(manifest, sourceDir, version) {
|
|
|
219
246
|
}
|
|
220
247
|
|
|
221
248
|
// Create new manifest
|
|
222
|
-
const newManifest = createManifest(
|
|
249
|
+
const newManifest = createManifest(mode, installPath);
|
|
223
250
|
|
|
224
251
|
let totalFiles = 0;
|
|
225
252
|
let totalDirs = 0;
|
|
226
253
|
|
|
254
|
+
// For Path mode, upgrade workflows to global first
|
|
255
|
+
if (mode === 'Path') {
|
|
256
|
+
const globalPath = homedir();
|
|
257
|
+
for (const subdir of GLOBAL_SUBDIRS) {
|
|
258
|
+
const srcWorkflows = join(sourceDir, '.claude', subdir);
|
|
259
|
+
if (existsSync(srcWorkflows)) {
|
|
260
|
+
const destWorkflows = join(globalPath, '.claude', subdir);
|
|
261
|
+
const { files, directories } = await copyDirectory(srcWorkflows, destWorkflows, newManifest);
|
|
262
|
+
totalFiles += files;
|
|
263
|
+
totalDirs += directories;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
227
268
|
// Copy each directory
|
|
228
269
|
for (const dir of availableDirs) {
|
|
229
270
|
const srcPath = join(sourceDir, dir);
|
|
230
271
|
const destPath = join(installPath, dir);
|
|
231
272
|
|
|
232
|
-
|
|
273
|
+
// For Path mode on .claude, exclude global subdirs (they're already installed to global)
|
|
274
|
+
const excludeDirs = (mode === 'Path' && dir === '.claude') ? GLOBAL_SUBDIRS : [];
|
|
275
|
+
const { files, directories } = await copyDirectory(srcPath, destPath, newManifest, excludeDirs);
|
|
233
276
|
totalFiles += files;
|
|
234
277
|
totalDirs += directories;
|
|
235
278
|
}
|
|
236
279
|
|
|
237
|
-
// Copy CLAUDE.md to .claude directory
|
|
238
|
-
const claudeMdSrc = join(sourceDir, 'CLAUDE.md');
|
|
239
|
-
const claudeMdDest = join(installPath, '.claude', 'CLAUDE.md');
|
|
240
|
-
if (existsSync(claudeMdSrc) && existsSync(dirname(claudeMdDest))) {
|
|
241
|
-
copyFileSync(claudeMdSrc, claudeMdDest);
|
|
242
|
-
addFileEntry(newManifest, claudeMdDest);
|
|
243
|
-
totalFiles++;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
280
|
// Update version.json
|
|
247
281
|
const versionPath = join(installPath, '.claude', 'version.json');
|
|
248
282
|
if (existsSync(dirname(versionPath))) {
|
|
@@ -272,9 +306,15 @@ async function performUpgrade(manifest, sourceDir, version) {
|
|
|
272
306
|
* @param {string} src - Source directory
|
|
273
307
|
* @param {string} dest - Destination directory
|
|
274
308
|
* @param {Object} manifest - Manifest to track files
|
|
309
|
+
* @param {string[]} excludeDirs - Directory names to exclude (optional)
|
|
275
310
|
* @returns {Object} - Count of files and directories
|
|
276
311
|
*/
|
|
277
|
-
async function copyDirectory(
|
|
312
|
+
async function copyDirectory(
|
|
313
|
+
src: string,
|
|
314
|
+
dest: string,
|
|
315
|
+
manifest: any,
|
|
316
|
+
excludeDirs: string[] = []
|
|
317
|
+
): Promise<CopyResult> {
|
|
278
318
|
let files = 0;
|
|
279
319
|
let directories = 0;
|
|
280
320
|
|
|
@@ -288,6 +328,11 @@ async function copyDirectory(src, dest, manifest) {
|
|
|
288
328
|
const entries = readdirSync(src);
|
|
289
329
|
|
|
290
330
|
for (const entry of entries) {
|
|
331
|
+
// Skip excluded directories
|
|
332
|
+
if (excludeDirs.includes(entry)) {
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
|
|
291
336
|
const srcPath = join(src, entry);
|
|
292
337
|
const destPath = join(dest, entry);
|
|
293
338
|
const stat = statSync(srcPath);
|