claude-code-workflow 6.1.3 → 6.2.1
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/README.md +145 -274
- package/bin/ccw-mcp.js +7 -0
- package/bin/ccw.js +10 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +219 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/cli.d.ts +32 -0
- package/dist/commands/cli.d.ts.map +1 -0
- package/dist/commands/cli.js +619 -0
- package/dist/commands/cli.js.map +1 -0
- package/dist/commands/core-memory.d.ts +32 -0
- package/dist/commands/core-memory.d.ts.map +1 -0
- package/dist/commands/core-memory.js +640 -0
- package/dist/commands/core-memory.js.map +1 -0
- package/dist/commands/hook.d.ts +16 -0
- package/dist/commands/hook.d.ts.map +1 -0
- package/dist/commands/hook.js +276 -0
- package/dist/commands/hook.js.map +1 -0
- package/dist/commands/install.d.ts +12 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +443 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/list.d.ts +5 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +32 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/memory.d.ts +57 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +890 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/serve.d.ts +12 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +63 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/session-path-resolver.d.ts +45 -0
- package/dist/commands/session-path-resolver.d.ts.map +1 -0
- package/dist/commands/session-path-resolver.js +302 -0
- package/dist/commands/session-path-resolver.js.map +1 -0
- package/dist/commands/session.d.ts +12 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +954 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/stop.d.ts +11 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/stop.js +96 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/commands/tool.d.ts +29 -0
- package/dist/commands/tool.d.ts.map +1 -0
- package/dist/commands/tool.js +173 -0
- package/dist/commands/tool.js.map +1 -0
- package/dist/commands/uninstall.d.ts +9 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +239 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/upgrade.d.ts +10 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +288 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/view.d.ts +14 -0
- package/dist/commands/view.d.ts.map +1 -0
- package/dist/commands/view.js +100 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/config/storage-paths.d.ts +184 -0
- package/dist/config/storage-paths.d.ts.map +1 -0
- package/dist/config/storage-paths.js +536 -0
- package/dist/config/storage-paths.js.map +1 -0
- package/dist/core/cache-manager.d.ts +80 -0
- package/dist/core/cache-manager.d.ts.map +1 -0
- package/dist/core/cache-manager.js +260 -0
- package/dist/core/cache-manager.js.map +1 -0
- package/dist/core/claude-freshness.d.ts +53 -0
- package/dist/core/claude-freshness.d.ts.map +1 -0
- package/dist/core/claude-freshness.js +232 -0
- package/dist/core/claude-freshness.js.map +1 -0
- package/dist/core/core-memory-store.d.ts +320 -0
- package/dist/core/core-memory-store.d.ts.map +1 -0
- package/dist/core/core-memory-store.js +1177 -0
- package/dist/core/core-memory-store.js.map +1 -0
- package/dist/core/dashboard-generator-patch.d.ts +2 -0
- package/dist/core/dashboard-generator-patch.d.ts.map +1 -0
- package/dist/core/dashboard-generator-patch.js +48 -0
- package/dist/core/dashboard-generator-patch.js.map +1 -0
- package/dist/core/dashboard-generator.d.ts +8 -0
- package/dist/core/dashboard-generator.d.ts.map +1 -0
- package/dist/core/dashboard-generator.js +695 -0
- package/dist/core/dashboard-generator.js.map +1 -0
- package/dist/core/data-aggregator.d.ts +145 -0
- package/dist/core/data-aggregator.d.ts.map +1 -0
- package/dist/core/data-aggregator.js +416 -0
- package/dist/core/data-aggregator.js.map +1 -0
- package/dist/core/history-importer.d.ts +102 -0
- package/dist/core/history-importer.d.ts.map +1 -0
- package/dist/core/history-importer.js +493 -0
- package/dist/core/history-importer.js.map +1 -0
- package/dist/core/lite-scanner-complete.d.ts +81 -0
- package/dist/core/lite-scanner-complete.d.ts.map +1 -0
- package/dist/core/lite-scanner-complete.js +368 -0
- package/dist/core/lite-scanner-complete.js.map +1 -0
- package/dist/core/lite-scanner.d.ts +81 -0
- package/dist/core/lite-scanner.d.ts.map +1 -0
- package/dist/core/lite-scanner.js +368 -0
- package/dist/core/lite-scanner.js.map +1 -0
- package/dist/core/manifest.d.ts +88 -0
- package/dist/core/manifest.d.ts.map +1 -0
- package/dist/core/manifest.js +214 -0
- package/dist/core/manifest.js.map +1 -0
- package/dist/core/memory-embedder-bridge.d.ts +83 -0
- package/dist/core/memory-embedder-bridge.d.ts.map +1 -0
- package/dist/core/memory-embedder-bridge.js +181 -0
- package/dist/core/memory-embedder-bridge.js.map +1 -0
- package/dist/core/memory-store.d.ts +249 -0
- package/dist/core/memory-store.d.ts.map +1 -0
- package/dist/core/memory-store.js +781 -0
- package/dist/core/memory-store.js.map +1 -0
- package/dist/core/routes/ccw-routes.d.ts +20 -0
- package/dist/core/routes/ccw-routes.d.ts.map +1 -0
- package/dist/core/routes/ccw-routes.js +70 -0
- package/dist/core/routes/ccw-routes.js.map +1 -0
- package/dist/core/routes/claude-routes.d.ts +19 -0
- package/dist/core/routes/claude-routes.d.ts.map +1 -0
- package/dist/core/routes/claude-routes.js +1017 -0
- package/dist/core/routes/claude-routes.js.map +1 -0
- package/dist/core/routes/cli-routes.d.ts +20 -0
- package/dist/core/routes/cli-routes.d.ts.map +1 -0
- package/dist/core/routes/cli-routes.js +468 -0
- package/dist/core/routes/cli-routes.js.map +1 -0
- package/dist/core/routes/codexlens-routes.d.ts +20 -0
- package/dist/core/routes/codexlens-routes.d.ts.map +1 -0
- package/dist/core/routes/codexlens-routes.js +754 -0
- package/dist/core/routes/codexlens-routes.js.map +1 -0
- package/dist/core/routes/core-memory-routes.d.ts +21 -0
- package/dist/core/routes/core-memory-routes.d.ts.map +1 -0
- package/dist/core/routes/core-memory-routes.js +520 -0
- package/dist/core/routes/core-memory-routes.js.map +1 -0
- package/dist/core/routes/files-routes.d.ts +20 -0
- package/dist/core/routes/files-routes.d.ts.map +1 -0
- package/dist/core/routes/files-routes.js +374 -0
- package/dist/core/routes/files-routes.js.map +1 -0
- package/dist/core/routes/graph-routes.d.ts +20 -0
- package/dist/core/routes/graph-routes.d.ts.map +1 -0
- package/dist/core/routes/graph-routes.js +517 -0
- package/dist/core/routes/graph-routes.js.map +1 -0
- package/dist/core/routes/help-routes.d.ts +20 -0
- package/dist/core/routes/help-routes.d.ts.map +1 -0
- package/dist/core/routes/help-routes.js +250 -0
- package/dist/core/routes/help-routes.js.map +1 -0
- package/dist/core/routes/hooks-routes.d.ts +21 -0
- package/dist/core/routes/hooks-routes.d.ts.map +1 -0
- package/dist/core/routes/hooks-routes.js +346 -0
- package/dist/core/routes/hooks-routes.js.map +1 -0
- package/dist/core/routes/mcp-routes.d.ts +20 -0
- package/dist/core/routes/mcp-routes.d.ts.map +1 -0
- package/dist/core/routes/mcp-routes.js +1129 -0
- package/dist/core/routes/mcp-routes.js.map +1 -0
- package/dist/core/routes/mcp-templates-db.d.ts +54 -0
- package/dist/core/routes/mcp-templates-db.d.ts.map +1 -0
- package/dist/core/routes/mcp-templates-db.js +226 -0
- package/dist/core/routes/mcp-templates-db.js.map +1 -0
- package/dist/core/routes/memory-routes.d.ts +21 -0
- package/dist/core/routes/memory-routes.d.ts.map +1 -0
- package/dist/core/routes/memory-routes.js +1095 -0
- package/dist/core/routes/memory-routes.js.map +1 -0
- package/dist/core/routes/rules-routes.d.ts +20 -0
- package/dist/core/routes/rules-routes.d.ts.map +1 -0
- package/dist/core/routes/rules-routes.js +442 -0
- package/dist/core/routes/rules-routes.js.map +1 -0
- package/dist/core/routes/session-routes.d.ts +20 -0
- package/dist/core/routes/session-routes.d.ts.map +1 -0
- package/dist/core/routes/session-routes.js +423 -0
- package/dist/core/routes/session-routes.js.map +1 -0
- package/dist/core/routes/skills-routes.d.ts +20 -0
- package/dist/core/routes/skills-routes.d.ts.map +1 -0
- package/dist/core/routes/skills-routes.js +533 -0
- package/dist/core/routes/skills-routes.js.map +1 -0
- package/dist/core/routes/status-routes.d.ts +20 -0
- package/dist/core/routes/status-routes.d.ts.map +1 -0
- package/dist/core/routes/status-routes.js +38 -0
- package/dist/core/routes/status-routes.js.map +1 -0
- package/dist/core/routes/system-routes.d.ts +22 -0
- package/dist/core/routes/system-routes.d.ts.map +1 -0
- package/dist/core/routes/system-routes.js +354 -0
- package/dist/core/routes/system-routes.js.map +1 -0
- package/dist/core/server.d.ts +17 -0
- package/dist/core/server.d.ts.map +1 -0
- package/dist/core/server.js +386 -0
- package/dist/core/server.js.map +1 -0
- package/dist/core/session-clustering-service.d.ts +153 -0
- package/dist/core/session-clustering-service.d.ts.map +1 -0
- package/dist/core/session-clustering-service.js +1065 -0
- package/dist/core/session-clustering-service.js.map +1 -0
- package/dist/core/session-scanner.d.ts +32 -0
- package/dist/core/session-scanner.d.ts.map +1 -0
- package/dist/core/session-scanner.js +253 -0
- package/dist/core/session-scanner.js.map +1 -0
- package/dist/core/websocket.d.ts +23 -0
- package/dist/core/websocket.d.ts.map +1 -0
- package/dist/core/websocket.js +168 -0
- package/dist/core/websocket.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/index.d.ts +7 -0
- package/dist/mcp-server/index.d.ts.map +1 -0
- package/dist/mcp-server/index.js +157 -0
- package/dist/mcp-server/index.js.map +1 -0
- package/dist/tools/classify-folders.d.ts +26 -0
- package/dist/tools/classify-folders.d.ts.map +1 -0
- package/dist/tools/classify-folders.js +201 -0
- package/dist/tools/classify-folders.js.map +1 -0
- package/dist/tools/cli-config-manager.d.ts +62 -0
- package/dist/tools/cli-config-manager.d.ts.map +1 -0
- package/dist/tools/cli-config-manager.js +221 -0
- package/dist/tools/cli-config-manager.js.map +1 -0
- package/dist/tools/cli-executor.d.ts +373 -0
- package/dist/tools/cli-executor.d.ts.map +1 -0
- package/dist/tools/cli-executor.js +1625 -0
- package/dist/tools/cli-executor.js.map +1 -0
- package/dist/tools/cli-history-store.d.ts +330 -0
- package/dist/tools/cli-history-store.d.ts.map +1 -0
- package/dist/tools/cli-history-store.js +916 -0
- package/dist/tools/cli-history-store.js.map +1 -0
- package/dist/tools/codex-lens.d.ts +118 -0
- package/dist/tools/codex-lens.d.ts.map +1 -0
- package/dist/tools/codex-lens.js +962 -0
- package/dist/tools/codex-lens.js.map +1 -0
- package/dist/tools/convert-tokens-to-css.d.ts +14 -0
- package/dist/tools/convert-tokens-to-css.d.ts.map +1 -0
- package/dist/tools/convert-tokens-to-css.js +244 -0
- package/dist/tools/convert-tokens-to-css.js.map +1 -0
- package/dist/tools/core-memory.d.ts +66 -0
- package/dist/tools/core-memory.d.ts.map +1 -0
- package/dist/tools/core-memory.js +324 -0
- package/dist/tools/core-memory.js.map +1 -0
- package/dist/tools/detect-changed-modules.d.ts +24 -0
- package/dist/tools/detect-changed-modules.d.ts.map +1 -0
- package/dist/tools/detect-changed-modules.js +277 -0
- package/dist/tools/detect-changed-modules.js.map +1 -0
- package/dist/tools/discover-design-files.d.ts +36 -0
- package/dist/tools/discover-design-files.d.ts.map +1 -0
- package/dist/tools/discover-design-files.js +147 -0
- package/dist/tools/discover-design-files.js.map +1 -0
- package/dist/tools/edit-file.d.ts +28 -0
- package/dist/tools/edit-file.d.ts.map +1 -0
- package/dist/tools/edit-file.js +479 -0
- package/dist/tools/edit-file.js.map +1 -0
- package/dist/tools/generate-module-docs.d.ts +22 -0
- package/dist/tools/generate-module-docs.d.ts.map +1 -0
- package/dist/tools/generate-module-docs.js +379 -0
- package/dist/tools/generate-module-docs.js.map +1 -0
- package/dist/tools/get-modules-by-depth.d.ts +15 -0
- package/dist/tools/get-modules-by-depth.d.ts.map +1 -0
- package/dist/tools/get-modules-by-depth.js +296 -0
- package/dist/tools/get-modules-by-depth.js.map +1 -0
- package/dist/tools/index.d.ts +55 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +304 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/native-session-discovery.d.ts +97 -0
- package/dist/tools/native-session-discovery.d.ts.map +1 -0
- package/dist/tools/native-session-discovery.js +700 -0
- package/dist/tools/native-session-discovery.js.map +1 -0
- package/dist/tools/notifier.d.ts +50 -0
- package/dist/tools/notifier.d.ts.map +1 -0
- package/dist/tools/notifier.js +90 -0
- package/dist/tools/notifier.js.map +1 -0
- package/dist/tools/read-file.d.ts +32 -0
- package/dist/tools/read-file.d.ts.map +1 -0
- package/dist/tools/read-file.js +329 -0
- package/dist/tools/read-file.js.map +1 -0
- package/dist/tools/resume-strategy.d.ts +48 -0
- package/dist/tools/resume-strategy.d.ts.map +1 -0
- package/dist/tools/resume-strategy.js +248 -0
- package/dist/tools/resume-strategy.js.map +1 -0
- package/dist/tools/session-content-parser.d.ts +58 -0
- package/dist/tools/session-content-parser.d.ts.map +1 -0
- package/dist/tools/session-content-parser.js +420 -0
- package/dist/tools/session-content-parser.js.map +1 -0
- package/dist/tools/session-manager.d.ts +9 -0
- package/dist/tools/session-manager.d.ts.map +1 -0
- package/dist/tools/session-manager.js +834 -0
- package/dist/tools/session-manager.js.map +1 -0
- package/dist/tools/smart-context.d.ts +35 -0
- package/dist/tools/smart-context.d.ts.map +1 -0
- package/dist/tools/smart-context.js +182 -0
- package/dist/tools/smart-context.js.map +1 -0
- package/dist/tools/smart-search.d.ts +105 -0
- package/dist/tools/smart-search.d.ts.map +1 -0
- package/dist/tools/smart-search.js +1753 -0
- package/dist/tools/smart-search.js.map +1 -0
- package/dist/tools/storage-manager.d.ts +114 -0
- package/dist/tools/storage-manager.d.ts.map +1 -0
- package/dist/tools/storage-manager.js +392 -0
- package/dist/tools/storage-manager.js.map +1 -0
- package/dist/tools/ui-generate-preview.d.ts +39 -0
- package/dist/tools/ui-generate-preview.d.ts.map +1 -0
- package/dist/tools/ui-generate-preview.js +300 -0
- package/dist/tools/ui-generate-preview.js.map +1 -0
- package/dist/tools/ui-instantiate-prototypes.d.ts +75 -0
- package/dist/tools/ui-instantiate-prototypes.d.ts.map +1 -0
- package/dist/tools/ui-instantiate-prototypes.js +256 -0
- package/dist/tools/ui-instantiate-prototypes.js.map +1 -0
- package/dist/tools/update-module-claude.d.ts +80 -0
- package/dist/tools/update-module-claude.d.ts.map +1 -0
- package/dist/tools/update-module-claude.js +351 -0
- package/dist/tools/update-module-claude.js.map +1 -0
- package/dist/tools/write-file.d.ts +19 -0
- package/dist/tools/write-file.d.ts.map +1 -0
- package/dist/tools/write-file.js +193 -0
- package/dist/tools/write-file.js.map +1 -0
- package/dist/types/config.d.ts +11 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/session.d.ts +20 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +2 -0
- package/dist/types/session.js.map +1 -0
- package/dist/types/tool.d.ts +36 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/tool.js +11 -0
- package/dist/types/tool.js.map +1 -0
- package/dist/utils/browser-launcher.d.ts +13 -0
- package/dist/utils/browser-launcher.d.ts.map +1 -0
- package/dist/utils/browser-launcher.js +60 -0
- package/dist/utils/browser-launcher.js.map +1 -0
- package/dist/utils/file-utils.d.ts +25 -0
- package/dist/utils/file-utils.d.ts.map +1 -0
- package/dist/utils/file-utils.js +48 -0
- package/dist/utils/file-utils.js.map +1 -0
- package/dist/utils/path-resolver.d.ts +80 -0
- package/dist/utils/path-resolver.d.ts.map +1 -0
- package/dist/utils/path-resolver.js +260 -0
- package/dist/utils/path-resolver.js.map +1 -0
- package/dist/utils/path-validator.d.ts +49 -0
- package/dist/utils/path-validator.d.ts.map +1 -0
- package/dist/utils/path-validator.js +123 -0
- package/dist/utils/path-validator.js.map +1 -0
- package/dist/utils/ui.d.ts +62 -0
- package/dist/utils/ui.d.ts.map +1 -0
- package/dist/utils/ui.js +129 -0
- package/dist/utils/ui.js.map +1 -0
- package/package.json +65 -67
- package/src/.workflow/.cli-history/history.db +0 -0
- package/src/.workflow/.cli-history/history.db-shm +0 -0
- package/src/.workflow/.cli-history/history.db-wal +0 -0
- package/src/cli.ts +244 -0
- package/src/commands/cli.ts +740 -0
- package/src/commands/core-memory.ts +770 -0
- package/src/commands/hook.ts +315 -0
- package/src/commands/install.ts +519 -0
- package/src/commands/list.ts +37 -0
- package/src/commands/memory.ts +1090 -0
- package/src/commands/serve.ts +76 -0
- package/src/commands/session-path-resolver.ts +372 -0
- package/src/commands/session.ts +1141 -0
- package/src/commands/stop.ts +111 -0
- package/src/commands/tool.ts +201 -0
- package/src/commands/uninstall.ts +287 -0
- package/src/commands/upgrade.ts +352 -0
- package/src/commands/view.ts +119 -0
- package/src/config/storage-paths.ts +670 -0
- package/src/core/cache-manager.ts +294 -0
- package/src/core/claude-freshness.ts +319 -0
- package/src/core/core-memory-store.ts +1528 -0
- package/src/core/dashboard-generator-patch.ts +47 -0
- package/src/core/dashboard-generator.ts +739 -0
- package/src/core/data-aggregator.ts +584 -0
- package/src/core/history-importer.ts +625 -0
- package/src/core/lite-scanner-complete.ts +469 -0
- package/src/core/lite-scanner.ts +469 -0
- package/src/core/manifest.ts +271 -0
- package/src/core/memory-embedder-bridge.ts +262 -0
- package/src/core/memory-store.ts +978 -0
- package/src/core/routes/ccw-routes.ts +96 -0
- package/src/core/routes/claude-routes.ts +1183 -0
- package/src/core/routes/cli-routes.ts +561 -0
- package/src/core/routes/codexlens-routes.ts +806 -0
- package/src/core/routes/core-memory-routes.ts +605 -0
- package/src/core/routes/files-routes.ts +428 -0
- package/src/core/routes/graph-routes.md +164 -0
- package/src/core/routes/graph-routes.ts +626 -0
- package/src/core/routes/help-routes.ts +308 -0
- package/src/core/routes/hooks-routes.ts +405 -0
- package/src/core/routes/mcp-routes.ts +1271 -0
- package/src/core/routes/mcp-routes.ts.backup +550 -0
- package/src/core/routes/mcp-templates-db.ts +268 -0
- package/src/core/routes/memory-routes.ts +1206 -0
- package/src/core/routes/rules-routes.ts +526 -0
- package/src/core/routes/session-routes.ts +467 -0
- package/src/core/routes/skills-routes.ts +599 -0
- package/src/core/routes/status-routes.ts +57 -0
- package/src/core/routes/system-routes.ts +427 -0
- package/src/core/server.ts +431 -0
- package/src/core/session-clustering-service.ts +1258 -0
- package/src/core/session-scanner.ts +283 -0
- package/src/core/websocket.ts +190 -0
- package/src/index.ts +10 -0
- package/src/mcp-server/index.ts +186 -0
- package/src/templates/assets/css/github-dark.min.css +10 -0
- package/src/templates/assets/css/github.min.css +10 -0
- package/src/templates/assets/js/cytoscape.min.js +32 -0
- package/src/templates/assets/js/d3.min.js +2 -0
- package/src/templates/assets/js/highlight.min.js +1244 -0
- package/src/templates/assets/js/lucide.min.js +12 -0
- package/src/templates/assets/js/marked.min.js +69 -0
- package/src/templates/assets/js/tailwind.js +83 -0
- package/src/templates/dashboard-css/01-base.css +302 -0
- package/src/templates/dashboard-css/02-session.css +748 -0
- package/src/templates/dashboard-css/04-lite-tasks.css +1181 -0
- package/src/templates/dashboard-css/06-cards.css +1576 -0
- package/src/templates/dashboard-css/07-managers.css +2107 -0
- package/src/templates/dashboard-css/09-explorer.css +1408 -0
- package/src/templates/dashboard-css/10-cli-status.css +337 -0
- package/src/templates/dashboard-css/11-cli-history.css +271 -0
- package/src/templates/dashboard-css/12-cli-legacy.css +796 -0
- package/src/templates/dashboard-css/13-cli-ccw.css +199 -0
- package/src/templates/dashboard-css/14-cli-modals.css +258 -0
- package/src/templates/dashboard-css/15-cli-endpoints.css +305 -0
- package/src/templates/dashboard-css/16-cli-session.css +241 -0
- package/src/templates/dashboard-css/17-cli-conversation.css +283 -0
- package/src/templates/dashboard-css/18-cli-settings.css +160 -0
- package/src/templates/dashboard-css/19-cli-native-session.css +496 -0
- package/src/templates/dashboard-css/20-cli-taskqueue.css +188 -0
- package/src/templates/dashboard-css/21-cli-toolmgmt.css +310 -0
- package/src/templates/dashboard-css/22-cli-semantic.css +240 -0
- package/src/templates/dashboard-css/23-memory.css +2390 -0
- package/src/templates/dashboard-css/24-prompt-history.css +1089 -0
- package/src/templates/dashboard-css/25-skills-rules.css +326 -0
- package/src/templates/dashboard-css/26-claude-manager.css +908 -0
- package/src/templates/dashboard-css/27-graph-explorer.css +1678 -0
- package/src/templates/dashboard-css/28-mcp-manager.css +748 -0
- package/src/templates/dashboard-css/29-help.css +264 -0
- package/src/templates/dashboard-css/30-core-memory.css +1700 -0
- package/src/templates/dashboard-js/api.js +220 -0
- package/src/templates/dashboard-js/components/carousel.js +398 -0
- package/src/templates/dashboard-js/components/cli-history.js +876 -0
- package/src/templates/dashboard-js/components/cli-status.js +978 -0
- package/src/templates/dashboard-js/components/global-notifications.js +508 -0
- package/src/templates/dashboard-js/components/hook-manager.js +1278 -0
- package/src/templates/dashboard-js/components/index-manager.js +302 -0
- package/src/templates/dashboard-js/components/mcp-manager.js +1219 -0
- package/src/templates/dashboard-js/components/modals.js +326 -0
- package/src/templates/dashboard-js/components/navigation.js +313 -0
- package/src/templates/dashboard-js/components/notifications.js +758 -0
- package/src/templates/dashboard-js/components/storage-manager.js +478 -0
- package/src/templates/dashboard-js/components/tabs-other.js +424 -0
- package/src/templates/dashboard-js/components/task-queue-sidebar.js +716 -0
- package/src/templates/dashboard-js/help-i18n.js +272 -0
- package/src/templates/dashboard-js/i18n.js +2807 -0
- package/src/templates/dashboard-js/main.js +87 -0
- package/src/templates/dashboard-js/state.js +243 -0
- package/src/templates/dashboard-js/utils.js +199 -0
- package/src/templates/dashboard-js/views/claude-manager.js +912 -0
- package/src/templates/dashboard-js/views/cli-manager.js +2272 -0
- package/src/templates/dashboard-js/views/codexlens-manager.js +964 -0
- package/src/templates/dashboard-js/views/core-memory-clusters.js +503 -0
- package/src/templates/dashboard-js/views/core-memory.js +782 -0
- package/src/templates/dashboard-js/views/explorer.js +888 -0
- package/src/templates/dashboard-js/views/graph-explorer.js +1157 -0
- package/src/templates/dashboard-js/views/help.js +856 -0
- package/src/templates/dashboard-js/views/history.js +337 -0
- package/src/templates/dashboard-js/views/home.js +243 -0
- package/src/templates/dashboard-js/views/hook-manager.js +660 -0
- package/src/templates/dashboard-js/views/lite-tasks.js +861 -0
- package/src/templates/dashboard-js/views/mcp-manager.js +2187 -0
- package/src/templates/dashboard-js/views/mcp-manager.js.backup +1729 -0
- package/src/templates/dashboard-js/views/mcp-manager.js.new +928 -0
- package/src/templates/dashboard-js/views/memory.js +1221 -0
- package/src/templates/dashboard-js/views/prompt-history.js +713 -0
- package/src/templates/dashboard-js/views/rules-manager.js +828 -0
- package/src/templates/dashboard-js/views/session-detail.js +781 -0
- package/src/templates/dashboard-js/views/skills-manager.js +819 -0
- package/src/templates/dashboard.html +831 -0
- package/src/templates/hooks-config-example.json +60 -0
- package/src/tools/classify-folders.ts +245 -0
- package/src/tools/cli-config-manager.ts +268 -0
- package/src/tools/cli-executor.ts +2014 -0
- package/src/tools/cli-history-store.ts +1195 -0
- package/src/tools/codex-lens.ts +1141 -0
- package/src/tools/convert-tokens-to-css.ts +300 -0
- package/src/tools/core-memory.ts +444 -0
- package/src/tools/detect-changed-modules.ts +325 -0
- package/src/tools/discover-design-files.ts +184 -0
- package/src/tools/edit-file.ts +568 -0
- package/src/tools/generate-module-docs.ts +438 -0
- package/src/tools/get-modules-by-depth.ts +349 -0
- package/src/tools/index.ts +370 -0
- package/src/tools/native-session-discovery.ts +795 -0
- package/src/tools/notifier.ts +129 -0
- package/src/tools/read-file.ts +410 -0
- package/src/tools/resume-strategy.ts +345 -0
- package/src/tools/session-content-parser.ts +619 -0
- package/src/tools/session-manager.ts +1026 -0
- package/src/tools/smart-context.ts +228 -0
- package/src/tools/smart-search.ts +2065 -0
- package/src/tools/smart-search.ts.backup +1233 -0
- package/src/tools/storage-manager.ts +455 -0
- package/src/tools/write-file.ts +222 -0
- package/src/types/config.ts +11 -0
- package/src/types/index.ts +3 -0
- package/src/types/session.ts +25 -0
- package/src/types/tool.ts +41 -0
- package/src/utils/browser-launcher.ts +62 -0
- package/src/utils/file-utils.ts +48 -0
- package/src/utils/path-resolver.ts +315 -0
- package/src/utils/path-validator.ts +153 -0
- package/src/utils/ui.ts +155 -0
- package/.claude/agents/action-planning-agent.md +0 -778
- package/.claude/agents/cli-execution-agent.md +0 -270
- package/.claude/agents/cli-explore-agent.md +0 -182
- package/.claude/agents/cli-lite-planning-agent.md +0 -396
- package/.claude/agents/cli-planning-agent.md +0 -558
- package/.claude/agents/code-developer.md +0 -310
- package/.claude/agents/conceptual-planning-agent.md +0 -308
- package/.claude/agents/context-search-agent.md +0 -582
- package/.claude/agents/doc-generator.md +0 -330
- package/.claude/agents/memory-bridge.md +0 -94
- package/.claude/agents/test-context-search-agent.md +0 -399
- package/.claude/agents/test-fix-agent.md +0 -343
- package/.claude/agents/ui-design-agent.md +0 -593
- package/.claude/agents/universal-executor.md +0 -131
- package/.claude/commands/cli/cli-init.md +0 -440
- package/.claude/commands/enhance-prompt.md +0 -93
- package/.claude/commands/memory/code-map-memory.md +0 -687
- package/.claude/commands/memory/docs-full-cli.md +0 -471
- package/.claude/commands/memory/docs-related-cli.md +0 -386
- package/.claude/commands/memory/docs.md +0 -615
- package/.claude/commands/memory/load-skill-memory.md +0 -182
- package/.claude/commands/memory/load.md +0 -240
- package/.claude/commands/memory/skill-memory.md +0 -525
- package/.claude/commands/memory/style-skill-memory.md +0 -396
- package/.claude/commands/memory/tech-research.md +0 -477
- package/.claude/commands/memory/update-full.md +0 -332
- package/.claude/commands/memory/update-related.md +0 -332
- package/.claude/commands/memory/workflow-skill-memory.md +0 -517
- package/.claude/commands/task/breakdown.md +0 -204
- package/.claude/commands/task/create.md +0 -152
- package/.claude/commands/task/execute.md +0 -270
- package/.claude/commands/task/replan.md +0 -437
- package/.claude/commands/version.md +0 -254
- package/.claude/commands/workflow/action-plan-verify.md +0 -447
- package/.claude/commands/workflow/brainstorm/api-designer.md +0 -585
- package/.claude/commands/workflow/brainstorm/artifacts.md +0 -452
- package/.claude/commands/workflow/brainstorm/auto-parallel.md +0 -443
- package/.claude/commands/workflow/brainstorm/data-architect.md +0 -220
- package/.claude/commands/workflow/brainstorm/product-manager.md +0 -200
- package/.claude/commands/workflow/brainstorm/product-owner.md +0 -200
- package/.claude/commands/workflow/brainstorm/scrum-master.md +0 -200
- package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
- package/.claude/commands/workflow/brainstorm/synthesis.md +0 -398
- package/.claude/commands/workflow/brainstorm/system-architect.md +0 -387
- package/.claude/commands/workflow/brainstorm/ui-designer.md +0 -221
- package/.claude/commands/workflow/brainstorm/ux-expert.md +0 -221
- package/.claude/commands/workflow/execute.md +0 -460
- package/.claude/commands/workflow/init.md +0 -164
- package/.claude/commands/workflow/lite-execute.md +0 -686
- package/.claude/commands/workflow/lite-fix.md +0 -621
- package/.claude/commands/workflow/lite-plan.md +0 -592
- package/.claude/commands/workflow/plan.md +0 -551
- package/.claude/commands/workflow/replan.md +0 -515
- package/.claude/commands/workflow/review-fix.md +0 -606
- package/.claude/commands/workflow/review-module-cycle.md +0 -765
- package/.claude/commands/workflow/review-session-cycle.md +0 -776
- package/.claude/commands/workflow/review.md +0 -291
- package/.claude/commands/workflow/session/complete.md +0 -500
- package/.claude/commands/workflow/session/list.md +0 -96
- package/.claude/commands/workflow/session/resume.md +0 -61
- package/.claude/commands/workflow/session/start.md +0 -200
- package/.claude/commands/workflow/tdd-plan.md +0 -460
- package/.claude/commands/workflow/tdd-verify.md +0 -386
- package/.claude/commands/workflow/test-cycle-execute.md +0 -498
- package/.claude/commands/workflow/test-fix-gen.md +0 -699
- package/.claude/commands/workflow/test-gen.md +0 -529
- package/.claude/commands/workflow/tools/conflict-resolution.md +0 -680
- package/.claude/commands/workflow/tools/context-gather.md +0 -434
- package/.claude/commands/workflow/tools/task-generate-agent.md +0 -291
- package/.claude/commands/workflow/tools/task-generate-tdd.md +0 -518
- package/.claude/commands/workflow/tools/tdd-coverage-analysis.md +0 -309
- package/.claude/commands/workflow/tools/test-concept-enhanced.md +0 -163
- package/.claude/commands/workflow/tools/test-context-gather.md +0 -235
- package/.claude/commands/workflow/tools/test-task-generate.md +0 -256
- package/.claude/commands/workflow/ui-design/animation-extract.md +0 -1150
- package/.claude/commands/workflow/ui-design/codify-style.md +0 -652
- package/.claude/commands/workflow/ui-design/design-sync.md +0 -454
- package/.claude/commands/workflow/ui-design/explore-auto.md +0 -678
- package/.claude/commands/workflow/ui-design/generate.md +0 -504
- package/.claude/commands/workflow/ui-design/imitate-auto.md +0 -745
- package/.claude/commands/workflow/ui-design/import-from-code.md +0 -537
- package/.claude/commands/workflow/ui-design/layout-extract.md +0 -788
- package/.claude/commands/workflow/ui-design/reference-page-generator.md +0 -356
- package/.claude/commands/workflow/ui-design/style-extract.md +0 -773
- 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/skills/command-guide/SKILL.md +0 -388
- package/.claude/skills/command-guide/UPDATE-GUIDELINE.md +0 -592
- package/.claude/skills/command-guide/guides/cli-tools-guide.md +0 -410
- package/.claude/skills/command-guide/guides/examples.md +0 -537
- package/.claude/skills/command-guide/guides/getting-started.md +0 -242
- package/.claude/skills/command-guide/guides/implementation-details.md +0 -1010
- package/.claude/skills/command-guide/guides/index-structure.md +0 -326
- package/.claude/skills/command-guide/guides/troubleshooting.md +0 -92
- package/.claude/skills/command-guide/guides/ui-design-workflow-guide.md +0 -316
- package/.claude/skills/command-guide/guides/workflow-patterns.md +0 -662
- package/.claude/skills/command-guide/index/all-commands.json +0 -772
- package/.claude/skills/command-guide/index/by-category.json +0 -800
- package/.claude/skills/command-guide/index/by-use-case.json +0 -786
- package/.claude/skills/command-guide/index/command-relationships.json +0 -307
- package/.claude/skills/command-guide/index/essential-commands.json +0 -112
- package/.claude/skills/command-guide/reference/agents/action-planning-agent.md +0 -778
- package/.claude/skills/command-guide/reference/agents/cli-execution-agent.md +0 -270
- package/.claude/skills/command-guide/reference/agents/cli-explore-agent.md +0 -182
- package/.claude/skills/command-guide/reference/agents/cli-lite-planning-agent.md +0 -396
- package/.claude/skills/command-guide/reference/agents/cli-planning-agent.md +0 -558
- package/.claude/skills/command-guide/reference/agents/code-developer.md +0 -310
- package/.claude/skills/command-guide/reference/agents/conceptual-planning-agent.md +0 -308
- package/.claude/skills/command-guide/reference/agents/context-search-agent.md +0 -582
- package/.claude/skills/command-guide/reference/agents/doc-generator.md +0 -330
- package/.claude/skills/command-guide/reference/agents/memory-bridge.md +0 -94
- package/.claude/skills/command-guide/reference/agents/test-context-search-agent.md +0 -399
- package/.claude/skills/command-guide/reference/agents/test-fix-agent.md +0 -343
- package/.claude/skills/command-guide/reference/agents/ui-design-agent.md +0 -593
- package/.claude/skills/command-guide/reference/agents/universal-executor.md +0 -131
- package/.claude/skills/command-guide/reference/commands/cli/cli-init.md +0 -440
- package/.claude/skills/command-guide/reference/commands/enhance-prompt.md +0 -93
- package/.claude/skills/command-guide/reference/commands/memory/code-map-memory.md +0 -687
- package/.claude/skills/command-guide/reference/commands/memory/docs-full-cli.md +0 -471
- package/.claude/skills/command-guide/reference/commands/memory/docs-related-cli.md +0 -386
- package/.claude/skills/command-guide/reference/commands/memory/docs.md +0 -615
- package/.claude/skills/command-guide/reference/commands/memory/load-skill-memory.md +0 -182
- package/.claude/skills/command-guide/reference/commands/memory/load.md +0 -240
- package/.claude/skills/command-guide/reference/commands/memory/skill-memory.md +0 -525
- package/.claude/skills/command-guide/reference/commands/memory/style-skill-memory.md +0 -396
- package/.claude/skills/command-guide/reference/commands/memory/tech-research.md +0 -477
- package/.claude/skills/command-guide/reference/commands/memory/update-full.md +0 -332
- package/.claude/skills/command-guide/reference/commands/memory/update-related.md +0 -332
- package/.claude/skills/command-guide/reference/commands/memory/workflow-skill-memory.md +0 -517
- package/.claude/skills/command-guide/reference/commands/task/breakdown.md +0 -204
- package/.claude/skills/command-guide/reference/commands/task/create.md +0 -152
- package/.claude/skills/command-guide/reference/commands/task/execute.md +0 -270
- package/.claude/skills/command-guide/reference/commands/task/replan.md +0 -437
- package/.claude/skills/command-guide/reference/commands/version.md +0 -254
- package/.claude/skills/command-guide/reference/commands/workflow/action-plan-verify.md +0 -447
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/api-designer.md +0 -585
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/artifacts.md +0 -452
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/auto-parallel.md +0 -443
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/data-architect.md +0 -220
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-manager.md +0 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-owner.md +0 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/scrum-master.md +0 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/synthesis.md +0 -398
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/system-architect.md +0 -387
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ui-designer.md +0 -221
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ux-expert.md +0 -221
- package/.claude/skills/command-guide/reference/commands/workflow/execute.md +0 -460
- package/.claude/skills/command-guide/reference/commands/workflow/init.md +0 -164
- package/.claude/skills/command-guide/reference/commands/workflow/lite-execute.md +0 -686
- package/.claude/skills/command-guide/reference/commands/workflow/lite-fix.md +0 -621
- package/.claude/skills/command-guide/reference/commands/workflow/lite-plan.md +0 -592
- package/.claude/skills/command-guide/reference/commands/workflow/plan.md +0 -551
- package/.claude/skills/command-guide/reference/commands/workflow/replan.md +0 -515
- package/.claude/skills/command-guide/reference/commands/workflow/review-fix.md +0 -606
- package/.claude/skills/command-guide/reference/commands/workflow/review-module-cycle.md +0 -765
- package/.claude/skills/command-guide/reference/commands/workflow/review-session-cycle.md +0 -776
- package/.claude/skills/command-guide/reference/commands/workflow/review.md +0 -291
- package/.claude/skills/command-guide/reference/commands/workflow/session/complete.md +0 -500
- package/.claude/skills/command-guide/reference/commands/workflow/session/list.md +0 -96
- package/.claude/skills/command-guide/reference/commands/workflow/session/resume.md +0 -61
- package/.claude/skills/command-guide/reference/commands/workflow/session/start.md +0 -200
- package/.claude/skills/command-guide/reference/commands/workflow/tdd-plan.md +0 -460
- package/.claude/skills/command-guide/reference/commands/workflow/tdd-verify.md +0 -386
- package/.claude/skills/command-guide/reference/commands/workflow/test-cycle-execute.md +0 -498
- package/.claude/skills/command-guide/reference/commands/workflow/test-fix-gen.md +0 -699
- package/.claude/skills/command-guide/reference/commands/workflow/test-gen.md +0 -529
- package/.claude/skills/command-guide/reference/commands/workflow/tools/conflict-resolution.md +0 -680
- package/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md +0 -434
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-agent.md +0 -291
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md +0 -518
- package/.claude/skills/command-guide/reference/commands/workflow/tools/tdd-coverage-analysis.md +0 -309
- package/.claude/skills/command-guide/reference/commands/workflow/tools/test-concept-enhanced.md +0 -163
- package/.claude/skills/command-guide/reference/commands/workflow/tools/test-context-gather.md +0 -235
- package/.claude/skills/command-guide/reference/commands/workflow/tools/test-task-generate.md +0 -256
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/animation-extract.md +0 -1150
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/codify-style.md +0 -652
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/design-sync.md +0 -454
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/explore-auto.md +0 -678
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/generate.md +0 -504
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/imitate-auto.md +0 -745
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/import-from-code.md +0 -537
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/layout-extract.md +0 -788
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/reference-page-generator.md +0 -356
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/style-extract.md +0 -773
- package/.claude/skills/command-guide/scripts/analyze_commands.py +0 -502
- package/.claude/skills/command-guide/scripts/update-index.sh +0 -130
- package/.claude/skills/command-guide/templates/issue-bug.md +0 -104
- package/.claude/skills/command-guide/templates/issue-diagnosis.md +0 -275
- package/.claude/skills/command-guide/templates/issue-feature.md +0 -97
- package/.claude/skills/command-guide/templates/issue-question.md +0 -141
- package/.claude/skills/prompt-enhancer/SKILL.md +0 -124
- package/.claude/workflows/_template-compare-matrix.html +0 -692
- package/.claude/workflows/cli-templates/fix-plan-template.json +0 -75
- package/.claude/workflows/cli-templates/fix-progress-template.json +0 -48
- package/.claude/workflows/cli-templates/memory/style-skill-memory/skill-md-template.md +0 -299
- package/.claude/workflows/cli-templates/planning-roles/data-architect.md +0 -120
- package/.claude/workflows/cli-templates/planning-roles/product-manager.md +0 -119
- package/.claude/workflows/cli-templates/planning-roles/product-owner.md +0 -261
- package/.claude/workflows/cli-templates/planning-roles/scrum-master.md +0 -186
- package/.claude/workflows/cli-templates/planning-roles/subject-matter-expert.md +0 -281
- package/.claude/workflows/cli-templates/planning-roles/synthesis-role.md +0 -414
- package/.claude/workflows/cli-templates/planning-roles/system-architect.md +0 -106
- package/.claude/workflows/cli-templates/planning-roles/test-strategist.md +0 -124
- package/.claude/workflows/cli-templates/planning-roles/ui-designer.md +0 -379
- package/.claude/workflows/cli-templates/planning-roles/ux-expert.md +0 -240
- package/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt +0 -127
- package/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt +0 -115
- package/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt +0 -37
- package/.claude/workflows/cli-templates/prompts/analysis/02-analyze-technical-document.txt +0 -33
- package/.claude/workflows/cli-templates/prompts/analysis/02-review-architecture.txt +0 -29
- package/.claude/workflows/cli-templates/prompts/analysis/02-review-code-quality.txt +0 -28
- package/.claude/workflows/cli-templates/prompts/analysis/03-analyze-performance.txt +0 -29
- package/.claude/workflows/cli-templates/prompts/analysis/03-assess-security-risks.txt +0 -29
- package/.claude/workflows/cli-templates/prompts/analysis/03-review-quality-standards.txt +0 -29
- package/.claude/workflows/cli-templates/prompts/development/02-generate-tests.txt +0 -70
- package/.claude/workflows/cli-templates/prompts/development/02-implement-component-ui.txt +0 -55
- package/.claude/workflows/cli-templates/prompts/development/02-implement-feature.txt +0 -58
- package/.claude/workflows/cli-templates/prompts/development/02-refactor-codebase.txt +0 -55
- package/.claude/workflows/cli-templates/prompts/development/03-debug-runtime-issues.txt +0 -55
- package/.claude/workflows/cli-templates/prompts/documentation/api.txt +0 -15
- package/.claude/workflows/cli-templates/prompts/documentation/folder-navigation.txt +0 -27
- package/.claude/workflows/cli-templates/prompts/documentation/module-readme.txt +0 -49
- package/.claude/workflows/cli-templates/prompts/documentation/project-architecture.txt +0 -41
- package/.claude/workflows/cli-templates/prompts/documentation/project-examples.txt +0 -35
- package/.claude/workflows/cli-templates/prompts/documentation/project-readme.txt +0 -35
- package/.claude/workflows/cli-templates/prompts/memory/02-document-module-structure.txt +0 -165
- package/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt +0 -109
- package/.claude/workflows/cli-templates/prompts/planning/02-breakdown-task-steps.txt +0 -30
- package/.claude/workflows/cli-templates/prompts/planning/02-design-component-spec.txt +0 -28
- package/.claude/workflows/cli-templates/prompts/planning/03-evaluate-concept-feasibility.txt +0 -127
- package/.claude/workflows/cli-templates/prompts/planning/03-plan-migration-strategy.txt +0 -30
- package/.claude/workflows/cli-templates/prompts/tech/tech-module-format.txt +0 -359
- package/.claude/workflows/cli-templates/prompts/tech/tech-skill-index.txt +0 -185
- package/.claude/workflows/cli-templates/prompts/test/test-concept-analysis.txt +0 -179
- package/.claude/workflows/cli-templates/prompts/universal/00-universal-creative-style.txt +0 -95
- package/.claude/workflows/cli-templates/prompts/universal/00-universal-rigorous-style.txt +0 -92
- package/.claude/workflows/cli-templates/prompts/verification/codex-technical.txt +0 -28
- package/.claude/workflows/cli-templates/prompts/verification/cross-validation.txt +0 -28
- package/.claude/workflows/cli-templates/prompts/verification/gemini-strategic.txt +0 -27
- package/.claude/workflows/cli-templates/prompts/workflow/analysis-results-structure.txt +0 -224
- package/.claude/workflows/cli-templates/prompts/workflow/codex-feasibility-validation.txt +0 -176
- package/.claude/workflows/cli-templates/prompts/workflow/gemini-solution-design.txt +0 -131
- package/.claude/workflows/cli-templates/prompts/workflow/impl-plan-template.txt +0 -286
- package/.claude/workflows/cli-templates/prompts/workflow/skill-aggregation.txt +0 -172
- package/.claude/workflows/cli-templates/prompts/workflow/skill-conflict-patterns.txt +0 -98
- package/.claude/workflows/cli-templates/prompts/workflow/skill-index.txt +0 -224
- package/.claude/workflows/cli-templates/prompts/workflow/skill-lessons-learned.txt +0 -98
- package/.claude/workflows/cli-templates/prompts/workflow/skill-sessions-timeline.txt +0 -53
- package/.claude/workflows/cli-templates/prompts/workflow/task-json-agent-mode.txt +0 -123
- package/.claude/workflows/cli-templates/prompts/workflow/task-json-cli-mode.txt +0 -182
- package/.claude/workflows/cli-templates/schemas/diagnosis-json-schema.json +0 -234
- package/.claude/workflows/cli-templates/schemas/explore-json-schema.json +0 -124
- package/.claude/workflows/cli-templates/schemas/fix-plan-json-schema.json +0 -273
- package/.claude/workflows/cli-templates/schemas/plan-json-schema.json +0 -219
- package/.claude/workflows/cli-templates/schemas/project-json-schema.json +0 -221
- package/.claude/workflows/cli-templates/schemas/review-deep-dive-results-schema.json +0 -82
- package/.claude/workflows/cli-templates/schemas/review-dimension-results-schema.json +0 -51
- package/.claude/workflows/cli-templates/tech-stacks/go-dev.md +0 -91
- package/.claude/workflows/cli-templates/tech-stacks/java-dev.md +0 -107
- package/.claude/workflows/cli-templates/tech-stacks/javascript-dev.md +0 -58
- package/.claude/workflows/cli-templates/tech-stacks/python-dev.md +0 -79
- package/.claude/workflows/cli-templates/tech-stacks/react-dev.md +0 -103
- package/.claude/workflows/cli-templates/tech-stacks/typescript-dev.md +0 -83
- package/.claude/workflows/cli-templates/ui-design/systems/animation-tokens.json +0 -247
- package/.claude/workflows/cli-templates/ui-design/systems/design-tokens.json +0 -342
- package/.claude/workflows/cli-templates/ui-design/systems/layout-templates.json +0 -145
- package/.claude/workflows/context-search-strategy.md +0 -77
- package/.claude/workflows/intelligent-tools-strategy.md +0 -662
- package/.claude/workflows/review-directory-specification.md +0 -336
- package/.claude/workflows/task-core.md +0 -214
- package/.claude/workflows/tool-strategy.md +0 -79
- package/.claude/workflows/workflow-architecture.md +0 -942
- package/.codex/AGENTS.md +0 -330
- package/.gemini/GEMINI.md +0 -164
- package/.qwen/QWEN.md +0 -164
- package/CLAUDE.md +0 -91
- package/LICENSE +0 -21
- package/ccw/README.md +0 -121
- package/ccw/bin/ccw.js +0 -10
- package/ccw/package.json +0 -47
- package/ccw/src/cli.js +0 -119
- package/ccw/src/commands/install.js +0 -324
- package/ccw/src/commands/list.js +0 -37
- package/ccw/src/commands/serve.js +0 -67
- package/ccw/src/commands/stop.js +0 -101
- package/ccw/src/commands/tool.js +0 -138
- package/ccw/src/commands/uninstall.js +0 -238
- package/ccw/src/commands/upgrade.js +0 -307
- package/ccw/src/commands/view.js +0 -105
- package/ccw/src/core/dashboard-generator-patch.js +0 -29
- package/ccw/src/core/dashboard-generator.js +0 -682
- package/ccw/src/core/data-aggregator.js +0 -409
- package/ccw/src/core/lite-scanner.js +0 -314
- package/ccw/src/core/manifest.js +0 -201
- package/ccw/src/core/server.js +0 -2063
- package/ccw/src/core/session-scanner.js +0 -235
- package/ccw/src/index.js +0 -9
- package/ccw/src/templates/dashboard-css/01-base.css +0 -291
- package/ccw/src/templates/dashboard-css/02-session.css +0 -726
- package/ccw/src/templates/dashboard-css/04-lite-tasks.css +0 -843
- package/ccw/src/templates/dashboard-css/06-cards.css +0 -1570
- package/ccw/src/templates/dashboard-css/07-managers.css +0 -936
- package/ccw/src/templates/dashboard-css/09-explorer.css +0 -1397
- package/ccw/src/templates/dashboard-js/api.js +0 -200
- package/ccw/src/templates/dashboard-js/components/carousel.js +0 -398
- package/ccw/src/templates/dashboard-js/components/global-notifications.js +0 -219
- package/ccw/src/templates/dashboard-js/components/hook-manager.js +0 -283
- package/ccw/src/templates/dashboard-js/components/mcp-manager.js +0 -528
- package/ccw/src/templates/dashboard-js/components/modals.js +0 -260
- package/ccw/src/templates/dashboard-js/components/navigation.js +0 -245
- package/ccw/src/templates/dashboard-js/components/notifications.js +0 -194
- package/ccw/src/templates/dashboard-js/components/tabs-other.js +0 -273
- package/ccw/src/templates/dashboard-js/main.js +0 -72
- package/ccw/src/templates/dashboard-js/state.js +0 -42
- package/ccw/src/templates/dashboard-js/utils.js +0 -153
- package/ccw/src/templates/dashboard-js/views/explorer.js +0 -852
- package/ccw/src/templates/dashboard-js/views/home.js +0 -197
- package/ccw/src/templates/dashboard-js/views/hook-manager.js +0 -392
- package/ccw/src/templates/dashboard-js/views/lite-tasks.js +0 -395
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +0 -411
- package/ccw/src/templates/dashboard-js/views/session-detail.js +0 -780
- package/ccw/src/templates/dashboard.html +0 -731
- package/ccw/src/tools/classify-folders.js +0 -204
- package/ccw/src/tools/convert-tokens-to-css.js +0 -250
- package/ccw/src/tools/detect-changed-modules.js +0 -288
- package/ccw/src/tools/discover-design-files.js +0 -134
- package/ccw/src/tools/edit-file.js +0 -266
- package/ccw/src/tools/generate-module-docs.js +0 -416
- package/ccw/src/tools/get-modules-by-depth.js +0 -308
- package/ccw/src/tools/index.js +0 -176
- package/ccw/src/utils/browser-launcher.js +0 -60
- package/ccw/src/utils/file-utils.js +0 -48
- package/ccw/src/utils/path-resolver.js +0 -279
- package/ccw/src/utils/ui.js +0 -148
- /package/{ccw/src → src}/templates/dashboard-css/03-tasks.css +0 -0
- /package/{ccw/src → src}/templates/dashboard-css/05-context.css +0 -0
- /package/{ccw/src → src}/templates/dashboard-css/08-review.css +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/_conflict_tab.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/_exp_helpers.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/_review_tab.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/flowchart.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/sidebar.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/tabs-context.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/task-drawer-core.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/task-drawer-renderers.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/theme.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/components/version-check.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/views/fix-session.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/views/project-overview.js +0 -0
- /package/{ccw/src → src}/templates/dashboard-js/views/review-session.js +0 -0
- /package/{ccw/src → src}/templates/review-cycle-dashboard.html +0 -0
- /package/{ccw/src → src}/templates/workflow-dashboard.html +0 -0
- /package/{ccw/src → src}/tools/ui-generate-preview.js +0 -0
- /package/{ccw/src → src}/tools/ui-instantiate-prototypes.js +0 -0
- /package/{ccw/src → src}/tools/update-module-claude.js +0 -0
|
@@ -0,0 +1,1183 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* CLAUDE.md Routes Module
|
|
4
|
+
* Handles all CLAUDE.md memory rules management endpoints
|
|
5
|
+
*/
|
|
6
|
+
import type { IncomingMessage, ServerResponse } from 'http';
|
|
7
|
+
import { readFileSync, writeFileSync, existsSync, readdirSync, statSync } from 'fs';
|
|
8
|
+
import { join, relative } from 'path';
|
|
9
|
+
import { homedir } from 'os';
|
|
10
|
+
|
|
11
|
+
export interface RouteContext {
|
|
12
|
+
pathname: string;
|
|
13
|
+
url: URL;
|
|
14
|
+
req: IncomingMessage;
|
|
15
|
+
res: ServerResponse;
|
|
16
|
+
initialPath: string;
|
|
17
|
+
handlePostRequest: (req: IncomingMessage, res: ServerResponse, handler: (body: unknown) => Promise<any>) => void;
|
|
18
|
+
broadcastToClients: (data: unknown) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ClaudeFile {
|
|
22
|
+
id: string;
|
|
23
|
+
level: 'user' | 'project' | 'module';
|
|
24
|
+
path: string;
|
|
25
|
+
relativePath: string;
|
|
26
|
+
name: string;
|
|
27
|
+
content?: string;
|
|
28
|
+
size: number;
|
|
29
|
+
lastModified: string;
|
|
30
|
+
frontmatter?: { paths?: string[] };
|
|
31
|
+
stats?: { lines: number; words: number; characters: number };
|
|
32
|
+
isMainFile: boolean;
|
|
33
|
+
parentDirectory?: string;
|
|
34
|
+
depth?: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ClaudeFilesHierarchy {
|
|
38
|
+
user: { main: ClaudeFile | null };
|
|
39
|
+
project: { main: ClaudeFile | null };
|
|
40
|
+
modules: ClaudeFile[];
|
|
41
|
+
summary: { totalFiles: number; totalSize: number; lastSync?: string };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Parse frontmatter from markdown file
|
|
46
|
+
* Reuses logic from rules-routes.ts
|
|
47
|
+
*/
|
|
48
|
+
function parseClaudeFrontmatter(content: string) {
|
|
49
|
+
const result = {
|
|
50
|
+
paths: [] as string[],
|
|
51
|
+
content: content
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
if (content.startsWith('---')) {
|
|
55
|
+
const endIndex = content.indexOf('---', 3);
|
|
56
|
+
if (endIndex > 0) {
|
|
57
|
+
const frontmatter = content.substring(3, endIndex).trim();
|
|
58
|
+
result.content = content.substring(endIndex + 3).trim();
|
|
59
|
+
|
|
60
|
+
const lines = frontmatter.split('\n');
|
|
61
|
+
for (const line of lines) {
|
|
62
|
+
const colonIndex = line.indexOf(':');
|
|
63
|
+
if (colonIndex > 0) {
|
|
64
|
+
const key = line.substring(0, colonIndex).trim().toLowerCase();
|
|
65
|
+
const value = line.substring(colonIndex + 1).trim();
|
|
66
|
+
|
|
67
|
+
if (key === 'paths') {
|
|
68
|
+
result.paths = value.replace(/^\[|\]$/g, '').split(',').map(t => t.trim()).filter(Boolean);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Calculate file statistics
|
|
80
|
+
*/
|
|
81
|
+
function calculateFileStats(content: string) {
|
|
82
|
+
const lines = content.split('\n').length;
|
|
83
|
+
const words = content.split(/\s+/).filter(w => w.length > 0).length;
|
|
84
|
+
const characters = content.length;
|
|
85
|
+
return { lines, words, characters };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Create ClaudeFile object from file path
|
|
90
|
+
*/
|
|
91
|
+
function createClaudeFile(
|
|
92
|
+
filePath: string,
|
|
93
|
+
level: 'user' | 'project' | 'module',
|
|
94
|
+
basePath: string,
|
|
95
|
+
isMainFile: boolean,
|
|
96
|
+
depth?: number
|
|
97
|
+
): ClaudeFile | null {
|
|
98
|
+
try {
|
|
99
|
+
if (!existsSync(filePath)) return null;
|
|
100
|
+
|
|
101
|
+
const stat = statSync(filePath);
|
|
102
|
+
const content = readFileSync(filePath, 'utf8');
|
|
103
|
+
const parsed = parseClaudeFrontmatter(content);
|
|
104
|
+
const relativePath = relative(basePath, filePath).replace(/\\/g, '/');
|
|
105
|
+
const fileName = filePath.split(/[\\/]/).pop() || 'CLAUDE.md';
|
|
106
|
+
|
|
107
|
+
// Parent directory for module-level files
|
|
108
|
+
const parentDir = level === 'module'
|
|
109
|
+
? filePath.split(/[\\/]/).slice(-2, -1)[0]
|
|
110
|
+
: undefined;
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
id: `${level}-${relativePath}`,
|
|
114
|
+
level,
|
|
115
|
+
path: filePath,
|
|
116
|
+
relativePath,
|
|
117
|
+
name: fileName,
|
|
118
|
+
content: parsed.content,
|
|
119
|
+
size: stat.size,
|
|
120
|
+
lastModified: stat.mtime.toISOString(),
|
|
121
|
+
frontmatter: { paths: parsed.paths },
|
|
122
|
+
stats: calculateFileStats(content),
|
|
123
|
+
isMainFile,
|
|
124
|
+
parentDirectory: parentDir,
|
|
125
|
+
depth
|
|
126
|
+
};
|
|
127
|
+
} catch (e) {
|
|
128
|
+
console.error(`Error creating ClaudeFile for ${filePath}:`, e);
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Scan rules directory (recursive)
|
|
135
|
+
* Adapted from rules-routes.ts::scanRulesDirectory
|
|
136
|
+
*/
|
|
137
|
+
function scanClaudeRulesDirectory(dirPath: string, level: 'user' | 'project', basePath: string): ClaudeFile[] {
|
|
138
|
+
const files: ClaudeFile[] = [];
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
const entries = readdirSync(dirPath, { withFileTypes: true });
|
|
142
|
+
for (const entry of entries) {
|
|
143
|
+
const fullPath = join(dirPath, entry.name);
|
|
144
|
+
|
|
145
|
+
if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
146
|
+
const file = createClaudeFile(fullPath, level, basePath, false);
|
|
147
|
+
if (file) files.push(file);
|
|
148
|
+
} else if (entry.isDirectory()) {
|
|
149
|
+
const subFiles = scanClaudeRulesDirectory(fullPath, level, basePath);
|
|
150
|
+
files.push(...subFiles);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
} catch (e) {
|
|
154
|
+
// Ignore errors
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return files;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Scan modules for CLAUDE.md files
|
|
162
|
+
* Uses get-modules-by-depth logic
|
|
163
|
+
*/
|
|
164
|
+
function scanModules(projectPath: string): ClaudeFile[] {
|
|
165
|
+
const modules: ClaudeFile[] = [];
|
|
166
|
+
const visited = new Set<string>();
|
|
167
|
+
|
|
168
|
+
// Directories to exclude (from get-modules-by-depth.ts)
|
|
169
|
+
const SYSTEM_EXCLUDES = [
|
|
170
|
+
'.git', '.svn', '.hg', '__pycache__', 'node_modules', '.npm', '.yarn',
|
|
171
|
+
'dist', 'build', 'out', '.cache', '.venv', 'venv', 'env', 'coverage'
|
|
172
|
+
];
|
|
173
|
+
|
|
174
|
+
function scanDirectory(dirPath: string, depth: number) {
|
|
175
|
+
try {
|
|
176
|
+
const entries = readdirSync(dirPath, { withFileTypes: true });
|
|
177
|
+
|
|
178
|
+
// Check for CLAUDE.md in current directory
|
|
179
|
+
const claudePath = join(dirPath, 'CLAUDE.md');
|
|
180
|
+
if (existsSync(claudePath) && !visited.has(claudePath)) {
|
|
181
|
+
visited.add(claudePath);
|
|
182
|
+
const file = createClaudeFile(claudePath, 'module', projectPath, true, depth);
|
|
183
|
+
if (file) modules.push(file);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Recurse into subdirectories
|
|
187
|
+
for (const entry of entries) {
|
|
188
|
+
if (!entry.isDirectory()) continue;
|
|
189
|
+
if (SYSTEM_EXCLUDES.includes(entry.name)) continue;
|
|
190
|
+
|
|
191
|
+
const fullPath = join(dirPath, entry.name);
|
|
192
|
+
scanDirectory(fullPath, depth + 1);
|
|
193
|
+
}
|
|
194
|
+
} catch (e) {
|
|
195
|
+
// Ignore permission errors
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
scanDirectory(projectPath, 0);
|
|
200
|
+
return modules.sort((a, b) => (b.depth || 0) - (a.depth || 0)); // Deepest first
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Scan all CLAUDE.md files
|
|
205
|
+
*/
|
|
206
|
+
function scanAllClaudeFiles(projectPath: string): ClaudeFilesHierarchy {
|
|
207
|
+
const result: ClaudeFilesHierarchy = {
|
|
208
|
+
user: { main: null },
|
|
209
|
+
project: { main: null },
|
|
210
|
+
modules: [],
|
|
211
|
+
summary: { totalFiles: 0, totalSize: 0 }
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// User-level files (only main CLAUDE.md, no rules)
|
|
215
|
+
const userHome = homedir();
|
|
216
|
+
const userClaudeDir = join(userHome, '.claude');
|
|
217
|
+
const userClaudePath = join(userClaudeDir, 'CLAUDE.md');
|
|
218
|
+
|
|
219
|
+
if (existsSync(userClaudePath)) {
|
|
220
|
+
result.user.main = createClaudeFile(userClaudePath, 'user', userHome, true);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Project-level files (only main CLAUDE.md, no rules)
|
|
224
|
+
const projectClaudeDir = join(projectPath, '.claude');
|
|
225
|
+
const projectClaudePath = join(projectClaudeDir, 'CLAUDE.md');
|
|
226
|
+
|
|
227
|
+
if (existsSync(projectClaudePath)) {
|
|
228
|
+
result.project.main = createClaudeFile(projectClaudePath, 'project', projectPath, true);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Module-level files
|
|
232
|
+
result.modules = scanModules(projectPath);
|
|
233
|
+
|
|
234
|
+
// Calculate summary (only main CLAUDE.md files, no rules)
|
|
235
|
+
const allFiles = [
|
|
236
|
+
result.user.main,
|
|
237
|
+
result.project.main,
|
|
238
|
+
...result.modules
|
|
239
|
+
].filter(f => f !== null) as ClaudeFile[];
|
|
240
|
+
|
|
241
|
+
result.summary = {
|
|
242
|
+
totalFiles: allFiles.length,
|
|
243
|
+
totalSize: allFiles.reduce((sum, f) => sum + f.size, 0),
|
|
244
|
+
lastSync: new Date().toISOString()
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Get single file content
|
|
252
|
+
*/
|
|
253
|
+
function getClaudeFile(filePath: string): ClaudeFile | null {
|
|
254
|
+
try {
|
|
255
|
+
if (!existsSync(filePath)) {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const stat = statSync(filePath);
|
|
260
|
+
const content = readFileSync(filePath, 'utf8');
|
|
261
|
+
const parsed = parseClaudeFrontmatter(content);
|
|
262
|
+
|
|
263
|
+
// Determine level based on path
|
|
264
|
+
let level: 'user' | 'project' | 'module' = 'module';
|
|
265
|
+
if (filePath.includes(join(homedir(), '.claude'))) {
|
|
266
|
+
level = 'user';
|
|
267
|
+
} else if (filePath.includes('.claude')) {
|
|
268
|
+
level = 'project';
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const isMainFile = filePath.endsWith('CLAUDE.md') && !filePath.includes('rules');
|
|
272
|
+
|
|
273
|
+
return {
|
|
274
|
+
id: `${level}-${filePath}`,
|
|
275
|
+
level,
|
|
276
|
+
path: filePath,
|
|
277
|
+
relativePath: filePath,
|
|
278
|
+
name: filePath.split(/[\\/]/).pop() || 'CLAUDE.md',
|
|
279
|
+
content: parsed.content,
|
|
280
|
+
size: stat.size,
|
|
281
|
+
lastModified: stat.mtime.toISOString(),
|
|
282
|
+
frontmatter: { paths: parsed.paths },
|
|
283
|
+
stats: calculateFileStats(content),
|
|
284
|
+
isMainFile
|
|
285
|
+
};
|
|
286
|
+
} catch (error) {
|
|
287
|
+
console.error('Error reading CLAUDE.md file:', error);
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Save file content
|
|
294
|
+
*/
|
|
295
|
+
function saveClaudeFile(filePath: string, content: string, createBackup: boolean = false): { success: boolean; error?: string } {
|
|
296
|
+
try {
|
|
297
|
+
if (!existsSync(filePath)) {
|
|
298
|
+
return { success: false, error: 'File not found' };
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Create backup if requested
|
|
302
|
+
if (createBackup) {
|
|
303
|
+
const backupPath = `${filePath}.backup-${Date.now()}`;
|
|
304
|
+
const originalContent = readFileSync(filePath, 'utf8');
|
|
305
|
+
writeFileSync(backupPath, originalContent, 'utf8');
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Write new content
|
|
309
|
+
writeFileSync(filePath, content, 'utf8');
|
|
310
|
+
|
|
311
|
+
return { success: true };
|
|
312
|
+
} catch (error) {
|
|
313
|
+
return { success: false, error: (error as Error).message };
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Generate CLI prompt for syncing CLAUDE.md files
|
|
319
|
+
*/
|
|
320
|
+
function generateSyncPrompt(level: 'user' | 'project' | 'module', modulePath?: string): string {
|
|
321
|
+
if (level === 'module' && modulePath) {
|
|
322
|
+
// Module-level prompt
|
|
323
|
+
return `PURPOSE: Generate module-level CLAUDE.md for ${modulePath}
|
|
324
|
+
TASK: • Analyze module's purpose and responsibilities • Document public APIs and interfaces • Identify dependencies and integration points • Note testing patterns and conventions
|
|
325
|
+
MODE: analysis
|
|
326
|
+
CONTEXT: @${modulePath}/**/* | Memory: Project conventions from .claude/CLAUDE.md
|
|
327
|
+
EXPECTED: Module-level CLAUDE.md with: - Module purpose (1-2 sentences) - Key files and their roles - Public API documentation - Integration points - Testing approach
|
|
328
|
+
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/planning/02-design-component-spec.txt) | Module-level perspective only | Concrete examples | analysis=READ-ONLY`;
|
|
329
|
+
} else {
|
|
330
|
+
// User/Project level prompt
|
|
331
|
+
const contextPath = level === 'user' ? '~/.claude' : '.claude';
|
|
332
|
+
return `PURPOSE: Update CLAUDE.md with current ${level} understanding
|
|
333
|
+
TASK: • Analyze ${level} configuration and conventions • Identify common patterns and anti-patterns • Generate concise, actionable rules • Maintain existing structure and formatting
|
|
334
|
+
MODE: analysis
|
|
335
|
+
CONTEXT: @${contextPath}/**/*
|
|
336
|
+
EXPECTED: Updated CLAUDE.md content with: - Preserved existing sections - New insights appended to relevant sections - Timestamp header - Focus on ${level}-level concerns
|
|
337
|
+
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt) | Maintain existing CLAUDE.md structure | Focus on actionable rules | analysis=READ-ONLY`;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Smart merge CLAUDE.md content (update mode)
|
|
343
|
+
*/
|
|
344
|
+
function smartMergeContent(existingContent: string, cliOutput: string): string {
|
|
345
|
+
// For now, use simple append strategy
|
|
346
|
+
// TODO: Implement intelligent section-based merging
|
|
347
|
+
const timestamp = new Date().toISOString();
|
|
348
|
+
const separator = '\n\n---\n\n';
|
|
349
|
+
const header = `## Updated: ${timestamp}\n\n`;
|
|
350
|
+
|
|
351
|
+
return existingContent + separator + header + cliOutput;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Scan all files in project directory
|
|
356
|
+
*/
|
|
357
|
+
function scanAllProjectFiles(projectPath: string): any {
|
|
358
|
+
const SYSTEM_EXCLUDES = [
|
|
359
|
+
'.git', '.svn', '.hg', '__pycache__', 'node_modules', '.npm', '.yarn',
|
|
360
|
+
'dist', 'build', 'out', '.cache', '.venv', 'venv', 'env', 'coverage',
|
|
361
|
+
'.next', '.nuxt', '.output', '.turbo', '.parcel-cache', 'logs', 'tmp', 'temp'
|
|
362
|
+
];
|
|
363
|
+
|
|
364
|
+
const results: any = {
|
|
365
|
+
files: [],
|
|
366
|
+
summary: { totalFiles: 0, totalDirectories: 0, totalSize: 0 }
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
function scanDir(dirPath: string, depth: number = 0): any[] {
|
|
370
|
+
if (depth > 10) return []; // Max depth limit
|
|
371
|
+
|
|
372
|
+
const files: any[] = [];
|
|
373
|
+
|
|
374
|
+
try {
|
|
375
|
+
const entries = readdirSync(dirPath, { withFileTypes: true });
|
|
376
|
+
|
|
377
|
+
for (const entry of entries) {
|
|
378
|
+
// Skip system excludes and hidden files (except .claude and .workflow)
|
|
379
|
+
if (SYSTEM_EXCLUDES.includes(entry.name)) continue;
|
|
380
|
+
if (entry.name.startsWith('.') && entry.name !== '.claude' && entry.name !== '.workflow') continue;
|
|
381
|
+
|
|
382
|
+
const fullPath = join(dirPath, entry.name);
|
|
383
|
+
const relativePath = relative(projectPath, fullPath).replace(/\\/g, '/');
|
|
384
|
+
|
|
385
|
+
if (entry.isDirectory()) {
|
|
386
|
+
results.summary.totalDirectories++;
|
|
387
|
+
|
|
388
|
+
const dirNode: any = {
|
|
389
|
+
path: fullPath,
|
|
390
|
+
name: entry.name,
|
|
391
|
+
type: 'directory',
|
|
392
|
+
depth,
|
|
393
|
+
children: scanDir(fullPath, depth + 1)
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
files.push(dirNode);
|
|
397
|
+
} else {
|
|
398
|
+
const stat = statSync(fullPath);
|
|
399
|
+
results.summary.totalFiles++;
|
|
400
|
+
results.summary.totalSize += stat.size;
|
|
401
|
+
|
|
402
|
+
files.push({
|
|
403
|
+
path: fullPath,
|
|
404
|
+
name: entry.name,
|
|
405
|
+
type: 'file',
|
|
406
|
+
size: stat.size,
|
|
407
|
+
lastModified: stat.mtime.toISOString(),
|
|
408
|
+
depth
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
} catch (e) {
|
|
413
|
+
// Ignore permission errors
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return files;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
results.files = scanDir(projectPath);
|
|
420
|
+
return results;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Read single file content
|
|
425
|
+
*/
|
|
426
|
+
function readSingleFile(filePath: string): { content: string; size: number; lastModified: string } | null {
|
|
427
|
+
try {
|
|
428
|
+
if (!existsSync(filePath)) return null;
|
|
429
|
+
const stat = statSync(filePath);
|
|
430
|
+
const content = readFileSync(filePath, 'utf8');
|
|
431
|
+
return {
|
|
432
|
+
content,
|
|
433
|
+
size: stat.size,
|
|
434
|
+
lastModified: stat.mtime.toISOString()
|
|
435
|
+
};
|
|
436
|
+
} catch (e) {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Delete CLAUDE.md file
|
|
443
|
+
*/
|
|
444
|
+
function deleteClaudeFile(filePath: string): { success: boolean; error?: string } {
|
|
445
|
+
try {
|
|
446
|
+
if (!existsSync(filePath)) {
|
|
447
|
+
return { success: false, error: 'File not found' };
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Create backup before deletion
|
|
451
|
+
const backupPath = `${filePath}.deleted-${Date.now()}`;
|
|
452
|
+
const content = readFileSync(filePath, 'utf8');
|
|
453
|
+
writeFileSync(backupPath, content, 'utf8');
|
|
454
|
+
|
|
455
|
+
// Delete original file
|
|
456
|
+
const fs = require('fs');
|
|
457
|
+
fs.unlinkSync(filePath);
|
|
458
|
+
|
|
459
|
+
return { success: true };
|
|
460
|
+
} catch (error) {
|
|
461
|
+
return { success: false, error: (error as Error).message };
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Create new CLAUDE.md file with template
|
|
467
|
+
*/
|
|
468
|
+
function createNewClaudeFile(level: 'user' | 'project' | 'module', template: string, pathParam?: string): { success: boolean; path?: string; error?: string } {
|
|
469
|
+
try {
|
|
470
|
+
let filePath: string;
|
|
471
|
+
let content: string;
|
|
472
|
+
|
|
473
|
+
// Determine file path
|
|
474
|
+
if (level === 'user') {
|
|
475
|
+
filePath = join(homedir(), '.claude', 'CLAUDE.md');
|
|
476
|
+
} else if (level === 'project' && pathParam) {
|
|
477
|
+
filePath = join(pathParam, '.claude', 'CLAUDE.md');
|
|
478
|
+
} else if (level === 'module' && pathParam) {
|
|
479
|
+
filePath = join(pathParam, 'CLAUDE.md');
|
|
480
|
+
} else {
|
|
481
|
+
return { success: false, error: 'Invalid parameters' };
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// Check if file already exists
|
|
485
|
+
if (existsSync(filePath)) {
|
|
486
|
+
return { success: false, error: 'File already exists' };
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// Generate content based on template
|
|
490
|
+
const timestamp = new Date().toISOString();
|
|
491
|
+
|
|
492
|
+
if (template === 'minimal') {
|
|
493
|
+
content = `# CLAUDE.md (${level.toUpperCase()} Level)\n\n> Created: ${timestamp}\n\n## Purpose\n\n[Describe the purpose of this ${level}-level context]\n\n## Guidelines\n\n- [Add guideline 1]\n- [Add guideline 2]\n`;
|
|
494
|
+
} else if (template === 'comprehensive') {
|
|
495
|
+
content = `# CLAUDE.md (${level.toUpperCase()} Level)\n\n> Created: ${timestamp}\n\n## Purpose\n\n[Describe the purpose and scope]\n\n## Architecture\n\n[Describe key architectural decisions]\n\n## Coding Conventions\n\n### Naming\n\n- [Convention 1]\n- [Convention 2]\n\n### Patterns\n\n- [Pattern 1]\n- [Pattern 2]\n\n## Testing Guidelines\n\n[Testing approach and conventions]\n\n## Dependencies\n\n[Key dependencies and integration points]\n\n## Common Tasks\n\n### Task 1\n\n[Steps for task 1]\n\n### Task 2\n\n[Steps for task 2]\n`;
|
|
496
|
+
} else {
|
|
497
|
+
// default template
|
|
498
|
+
content = `# CLAUDE.md (${level.toUpperCase()} Level)\n\n> Created: ${timestamp}\n\n## Overview\n\n[Brief description of this ${level}-level context]\n\n## Key Conventions\n\n- [Convention 1]\n- [Convention 2]\n- [Convention 3]\n\n## Guidelines\n\n### Code Style\n\n[Style guidelines]\n\n### Best Practices\n\n[Best practices]\n`;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// Ensure directory exists
|
|
502
|
+
const dir = filePath.substring(0, filePath.lastIndexOf('/') || filePath.lastIndexOf('\\'));
|
|
503
|
+
const fs = require('fs');
|
|
504
|
+
if (!existsSync(dir)) {
|
|
505
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// Write file
|
|
509
|
+
writeFileSync(filePath, content, 'utf8');
|
|
510
|
+
|
|
511
|
+
return { success: true, path: filePath };
|
|
512
|
+
} catch (error) {
|
|
513
|
+
return { success: false, error: (error as Error).message };
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Handle CLAUDE.md routes
|
|
519
|
+
*/
|
|
520
|
+
export async function handleClaudeRoutes(ctx: RouteContext): Promise<boolean> {
|
|
521
|
+
const { pathname, url, req, res, initialPath, handlePostRequest, broadcastToClients } = ctx;
|
|
522
|
+
|
|
523
|
+
// API: Scan all CLAUDE.md files
|
|
524
|
+
if (pathname === '/api/memory/claude/scan') {
|
|
525
|
+
const projectPathParam = url.searchParams.get('path') || initialPath;
|
|
526
|
+
const filesData = scanAllClaudeFiles(projectPathParam);
|
|
527
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
528
|
+
res.end(JSON.stringify(filesData));
|
|
529
|
+
return true;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// API: Scan all project files (not just CLAUDE.md)
|
|
533
|
+
if (pathname === '/api/memory/claude/scan-all') {
|
|
534
|
+
const projectPathParam = url.searchParams.get('path') || initialPath;
|
|
535
|
+
const filesData = scanAllProjectFiles(projectPathParam);
|
|
536
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
537
|
+
res.end(JSON.stringify(filesData));
|
|
538
|
+
return true;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// API: Read single file
|
|
542
|
+
if (pathname === '/api/memory/claude/read-file' && req.method === 'GET') {
|
|
543
|
+
const filePath = url.searchParams.get('path');
|
|
544
|
+
if (!filePath) {
|
|
545
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
546
|
+
res.end(JSON.stringify({ error: 'Missing path parameter' }));
|
|
547
|
+
return true;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const fileData = readSingleFile(filePath);
|
|
551
|
+
if (!fileData) {
|
|
552
|
+
res.writeHead(404, { 'Content-Type': 'application/json' });
|
|
553
|
+
res.end(JSON.stringify({ error: 'File not found' }));
|
|
554
|
+
return true;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
558
|
+
res.end(JSON.stringify(fileData));
|
|
559
|
+
return true;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// API: CLI Sync (analyze and update CLAUDE.md using CLI tools)
|
|
563
|
+
if (pathname === '/api/memory/claude/sync' && req.method === 'POST') {
|
|
564
|
+
handlePostRequest(req, res, async (body: any) => {
|
|
565
|
+
const { level, path: modulePath, tool = 'gemini', mode = 'update', targets } = body;
|
|
566
|
+
|
|
567
|
+
if (!level) {
|
|
568
|
+
return { error: 'Missing level parameter', status: 400 };
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
try {
|
|
572
|
+
// Import CLI executor
|
|
573
|
+
const { executeCliTool } = await import('../../tools/cli-executor.js');
|
|
574
|
+
|
|
575
|
+
// Determine file path based on level
|
|
576
|
+
let filePath: string;
|
|
577
|
+
let workingDir: string;
|
|
578
|
+
|
|
579
|
+
if (level === 'user') {
|
|
580
|
+
filePath = join(homedir(), '.claude', 'CLAUDE.md');
|
|
581
|
+
workingDir = join(homedir(), '.claude');
|
|
582
|
+
} else if (level === 'project') {
|
|
583
|
+
filePath = join(initialPath, '.claude', 'CLAUDE.md');
|
|
584
|
+
workingDir = join(initialPath, '.claude');
|
|
585
|
+
} else if (level === 'module' && modulePath) {
|
|
586
|
+
filePath = join(modulePath, 'CLAUDE.md');
|
|
587
|
+
workingDir = modulePath;
|
|
588
|
+
} else {
|
|
589
|
+
return { error: 'Invalid level or missing path for module level', status: 400 };
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
// Check if file exists (for update/append modes)
|
|
593
|
+
const fileExists = existsSync(filePath);
|
|
594
|
+
if (!fileExists && mode !== 'generate') {
|
|
595
|
+
return { error: 'File does not exist. Use generate mode to create it.', status: 404 };
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
// Read existing content
|
|
599
|
+
const existingContent = fileExists ? readFileSync(filePath, 'utf8') : '';
|
|
600
|
+
|
|
601
|
+
// Generate CLI prompt
|
|
602
|
+
const cliPrompt = generateSyncPrompt(level, modulePath);
|
|
603
|
+
|
|
604
|
+
// Execute CLI tool
|
|
605
|
+
const syncId = `claude-sync-${level}-${Date.now()}`;
|
|
606
|
+
const result = await executeCliTool({
|
|
607
|
+
tool: tool === 'qwen' ? 'qwen' : 'gemini',
|
|
608
|
+
prompt: cliPrompt,
|
|
609
|
+
mode: 'analysis',
|
|
610
|
+
format: 'plain',
|
|
611
|
+
cd: workingDir,
|
|
612
|
+
timeout: 600000, // 10 minutes
|
|
613
|
+
stream: false,
|
|
614
|
+
category: 'internal',
|
|
615
|
+
id: syncId
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
if (!result.success || !result.execution?.output) {
|
|
619
|
+
return {
|
|
620
|
+
error: 'CLI execution failed',
|
|
621
|
+
details: result.execution?.error || 'No output received',
|
|
622
|
+
status: 500
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// Extract CLI output
|
|
627
|
+
const cliOutput = typeof result.execution.output === 'string'
|
|
628
|
+
? result.execution.output
|
|
629
|
+
: result.execution.output.stdout || '';
|
|
630
|
+
|
|
631
|
+
if (!cliOutput || cliOutput.trim().length === 0) {
|
|
632
|
+
return { error: 'CLI returned empty output', status: 500 };
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
// Process content based on mode
|
|
636
|
+
let finalContent: string;
|
|
637
|
+
|
|
638
|
+
if (mode === 'generate') {
|
|
639
|
+
// Full replace
|
|
640
|
+
const timestamp = new Date().toISOString();
|
|
641
|
+
finalContent = `# CLAUDE.md (${level.toUpperCase()} Level)\n\n> Auto-generated using ${tool.toUpperCase()}\n> Last updated: ${timestamp}\n\n---\n\n${cliOutput}`;
|
|
642
|
+
} else if (mode === 'append') {
|
|
643
|
+
// Simple append
|
|
644
|
+
const timestamp = new Date().toISOString();
|
|
645
|
+
finalContent = existingContent + `\n\n---\n\n## Updated: ${timestamp}\n\n${cliOutput}`;
|
|
646
|
+
} else {
|
|
647
|
+
// Smart merge (update mode)
|
|
648
|
+
finalContent = smartMergeContent(existingContent, cliOutput);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// Write updated content
|
|
652
|
+
writeFileSync(filePath, finalContent, 'utf8');
|
|
653
|
+
|
|
654
|
+
// Mark file as updated for freshness tracking
|
|
655
|
+
try {
|
|
656
|
+
const { markFileAsUpdated } = await import('../claude-freshness.js');
|
|
657
|
+
markFileAsUpdated(filePath, level, 'cli_sync', initialPath, { tool, mode });
|
|
658
|
+
} catch (e) {
|
|
659
|
+
console.error('Failed to mark file as updated:', e);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// Broadcast WebSocket event
|
|
663
|
+
broadcastToClients({
|
|
664
|
+
type: 'CLAUDE_FILE_SYNCED',
|
|
665
|
+
payload: {
|
|
666
|
+
path: filePath,
|
|
667
|
+
level,
|
|
668
|
+
tool,
|
|
669
|
+
mode,
|
|
670
|
+
executionId: syncId,
|
|
671
|
+
timestamp: new Date().toISOString()
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
|
|
675
|
+
return {
|
|
676
|
+
success: true,
|
|
677
|
+
path: filePath,
|
|
678
|
+
executionId: syncId,
|
|
679
|
+
mode,
|
|
680
|
+
tool
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
} catch (error) {
|
|
684
|
+
console.error('Error syncing CLAUDE.md file:', error);
|
|
685
|
+
return {
|
|
686
|
+
error: 'Sync failed',
|
|
687
|
+
details: (error as Error).message,
|
|
688
|
+
status: 500
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
return true;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// API: Get single file
|
|
696
|
+
if (pathname === '/api/memory/claude/file' && req.method === 'GET') {
|
|
697
|
+
const filePath = url.searchParams.get('path');
|
|
698
|
+
if (!filePath) {
|
|
699
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
700
|
+
res.end(JSON.stringify({ error: 'Missing path parameter' }));
|
|
701
|
+
return true;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
const file = getClaudeFile(filePath);
|
|
705
|
+
if (!file) {
|
|
706
|
+
res.writeHead(404, { 'Content-Type': 'application/json' });
|
|
707
|
+
res.end(JSON.stringify({ error: 'File not found' }));
|
|
708
|
+
return true;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
712
|
+
res.end(JSON.stringify(file));
|
|
713
|
+
return true;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
// API: Save file
|
|
717
|
+
if (pathname === '/api/memory/claude/file' && req.method === 'POST') {
|
|
718
|
+
handlePostRequest(req, res, async (body: any) => {
|
|
719
|
+
const { path: filePath, content, createBackup } = body;
|
|
720
|
+
|
|
721
|
+
if (!filePath || content === undefined) {
|
|
722
|
+
return { error: 'Missing path or content parameter', status: 400 };
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
const result = saveClaudeFile(filePath, content, createBackup);
|
|
726
|
+
|
|
727
|
+
if (result.success) {
|
|
728
|
+
// Broadcast update to all clients
|
|
729
|
+
ctx.broadcastToClients({
|
|
730
|
+
type: 'CLAUDE_FILE_UPDATED',
|
|
731
|
+
data: { path: filePath }
|
|
732
|
+
});
|
|
733
|
+
return { success: true, path: filePath };
|
|
734
|
+
} else {
|
|
735
|
+
return { error: result.error, status: 500 };
|
|
736
|
+
}
|
|
737
|
+
});
|
|
738
|
+
return true;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// API: Delete file
|
|
742
|
+
if (pathname === '/api/memory/claude/file' && req.method === 'DELETE') {
|
|
743
|
+
const filePath = url.searchParams.get('path');
|
|
744
|
+
const confirm = url.searchParams.get('confirm');
|
|
745
|
+
|
|
746
|
+
if (!filePath) {
|
|
747
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
748
|
+
res.end(JSON.stringify({ error: 'Missing path parameter' }));
|
|
749
|
+
return true;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
if (confirm !== 'true') {
|
|
753
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
754
|
+
res.end(JSON.stringify({ error: 'Confirmation required' }));
|
|
755
|
+
return true;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
const result = deleteClaudeFile(filePath);
|
|
759
|
+
|
|
760
|
+
if (result.success) {
|
|
761
|
+
broadcastToClients({
|
|
762
|
+
type: 'CLAUDE_FILE_DELETED',
|
|
763
|
+
data: { path: filePath }
|
|
764
|
+
});
|
|
765
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
766
|
+
res.end(JSON.stringify({ success: true }));
|
|
767
|
+
} else {
|
|
768
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
769
|
+
res.end(JSON.stringify({ error: result.error }));
|
|
770
|
+
}
|
|
771
|
+
return true;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// API: Create file
|
|
775
|
+
if (pathname === '/api/memory/claude/create' && req.method === 'POST') {
|
|
776
|
+
handlePostRequest(req, res, async (body: any) => {
|
|
777
|
+
const { level, path, template = 'default' } = body;
|
|
778
|
+
|
|
779
|
+
if (!level) {
|
|
780
|
+
return { error: 'Missing level parameter', status: 400 };
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
let result: any;
|
|
784
|
+
|
|
785
|
+
if (level === 'project') {
|
|
786
|
+
// For project level, use initialPath
|
|
787
|
+
const filePath = join(initialPath, '.claude', 'CLAUDE.md');
|
|
788
|
+
result = createNewClaudeFile(level, template, initialPath);
|
|
789
|
+
} else if (level === 'module') {
|
|
790
|
+
if (!path) {
|
|
791
|
+
return { error: 'Module path required', status: 400 };
|
|
792
|
+
}
|
|
793
|
+
result = createNewClaudeFile(level, template, path);
|
|
794
|
+
} else {
|
|
795
|
+
result = createNewClaudeFile(level, template);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
if (result.success) {
|
|
799
|
+
broadcastToClients({
|
|
800
|
+
type: 'CLAUDE_FILE_CREATED',
|
|
801
|
+
data: { path: result.path, level }
|
|
802
|
+
});
|
|
803
|
+
return { success: true, path: result.path };
|
|
804
|
+
} else {
|
|
805
|
+
return { error: result.error, status: 500 };
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
return true;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// API: Get Chinese response setting status
|
|
812
|
+
if (pathname === '/api/language/chinese-response' && req.method === 'GET') {
|
|
813
|
+
try {
|
|
814
|
+
const userClaudePath = join(homedir(), '.claude', 'CLAUDE.md');
|
|
815
|
+
const chineseRefPattern = /@.*chinese-response\.md/i;
|
|
816
|
+
|
|
817
|
+
let enabled = false;
|
|
818
|
+
let guidelinesPath = '';
|
|
819
|
+
|
|
820
|
+
// Check if user CLAUDE.md exists and contains Chinese response reference
|
|
821
|
+
if (existsSync(userClaudePath)) {
|
|
822
|
+
const content = readFileSync(userClaudePath, 'utf8');
|
|
823
|
+
enabled = chineseRefPattern.test(content);
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
// Find guidelines file path - always use user-level path
|
|
827
|
+
const userGuidelinesPath = join(homedir(), '.claude', 'workflows', 'chinese-response.md');
|
|
828
|
+
|
|
829
|
+
if (existsSync(userGuidelinesPath)) {
|
|
830
|
+
guidelinesPath = userGuidelinesPath;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
834
|
+
res.end(JSON.stringify({
|
|
835
|
+
enabled,
|
|
836
|
+
guidelinesPath,
|
|
837
|
+
guidelinesExists: !!guidelinesPath,
|
|
838
|
+
userClaudeMdExists: existsSync(userClaudePath)
|
|
839
|
+
}));
|
|
840
|
+
return true;
|
|
841
|
+
} catch (error) {
|
|
842
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
843
|
+
res.end(JSON.stringify({ error: (error as Error).message }));
|
|
844
|
+
return true;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
// API: Toggle Chinese response setting
|
|
849
|
+
if (pathname === '/api/language/chinese-response' && req.method === 'POST') {
|
|
850
|
+
handlePostRequest(req, res, async (body: any) => {
|
|
851
|
+
const { enabled } = body;
|
|
852
|
+
|
|
853
|
+
if (typeof enabled !== 'boolean') {
|
|
854
|
+
return { error: 'Missing or invalid enabled parameter', status: 400 };
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
try {
|
|
858
|
+
const userClaudePath = join(homedir(), '.claude', 'CLAUDE.md');
|
|
859
|
+
const userClaudeDir = join(homedir(), '.claude');
|
|
860
|
+
|
|
861
|
+
// Find guidelines file path - always use user-level path with ~ shorthand
|
|
862
|
+
const userGuidelinesPath = join(homedir(), '.claude', 'workflows', 'chinese-response.md');
|
|
863
|
+
|
|
864
|
+
if (!existsSync(userGuidelinesPath)) {
|
|
865
|
+
return { error: 'Chinese response guidelines file not found at ~/.claude/workflows/chinese-response.md', status: 404 };
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
const guidelinesRef = '~/.claude/workflows/chinese-response.md';
|
|
869
|
+
|
|
870
|
+
const chineseRefLine = `- **中文回复准则**: @${guidelinesRef}`;
|
|
871
|
+
const chineseRefPattern = /^- \*\*中文回复准则\*\*:.*chinese-response\.md.*$/gm;
|
|
872
|
+
|
|
873
|
+
// Ensure user .claude directory exists
|
|
874
|
+
if (!existsSync(userClaudeDir)) {
|
|
875
|
+
const fs = require('fs');
|
|
876
|
+
fs.mkdirSync(userClaudeDir, { recursive: true });
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
let content = '';
|
|
880
|
+
if (existsSync(userClaudePath)) {
|
|
881
|
+
content = readFileSync(userClaudePath, 'utf8');
|
|
882
|
+
} else {
|
|
883
|
+
// Create new CLAUDE.md with header
|
|
884
|
+
content = '# Claude Instructions\n\n';
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
if (enabled) {
|
|
888
|
+
// Check if reference already exists
|
|
889
|
+
if (chineseRefPattern.test(content)) {
|
|
890
|
+
return { success: true, message: 'Already enabled' };
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// Add reference after the header line or at the beginning
|
|
894
|
+
const headerMatch = content.match(/^# Claude Instructions\n\n?/);
|
|
895
|
+
if (headerMatch) {
|
|
896
|
+
const insertPosition = headerMatch[0].length;
|
|
897
|
+
content = content.slice(0, insertPosition) + chineseRefLine + '\n' + content.slice(insertPosition);
|
|
898
|
+
} else {
|
|
899
|
+
// Add header and reference
|
|
900
|
+
content = '# Claude Instructions\n\n' + chineseRefLine + '\n' + content;
|
|
901
|
+
}
|
|
902
|
+
} else {
|
|
903
|
+
// Remove reference
|
|
904
|
+
content = content.replace(chineseRefPattern, '').replace(/\n{3,}/g, '\n\n').trim();
|
|
905
|
+
if (content) content += '\n';
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
writeFileSync(userClaudePath, content, 'utf8');
|
|
909
|
+
|
|
910
|
+
// Broadcast update
|
|
911
|
+
broadcastToClients({
|
|
912
|
+
type: 'LANGUAGE_SETTING_CHANGED',
|
|
913
|
+
data: { chineseResponse: enabled }
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
return { success: true, enabled };
|
|
917
|
+
} catch (error) {
|
|
918
|
+
return { error: (error as Error).message, status: 500 };
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
return true;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
// API: Get Windows platform setting status
|
|
925
|
+
if (pathname === '/api/language/windows-platform' && req.method === 'GET') {
|
|
926
|
+
try {
|
|
927
|
+
const userClaudePath = join(homedir(), '.claude', 'CLAUDE.md');
|
|
928
|
+
const windowsRefPattern = /@.*windows-platform\.md/i;
|
|
929
|
+
|
|
930
|
+
let enabled = false;
|
|
931
|
+
let guidelinesPath = '';
|
|
932
|
+
|
|
933
|
+
// Check if user CLAUDE.md exists and contains Windows platform reference
|
|
934
|
+
if (existsSync(userClaudePath)) {
|
|
935
|
+
const content = readFileSync(userClaudePath, 'utf8');
|
|
936
|
+
enabled = windowsRefPattern.test(content);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// Find guidelines file path - always use user-level path
|
|
940
|
+
const userGuidelinesPath = join(homedir(), '.claude', 'workflows', 'windows-platform.md');
|
|
941
|
+
|
|
942
|
+
if (existsSync(userGuidelinesPath)) {
|
|
943
|
+
guidelinesPath = userGuidelinesPath;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
947
|
+
res.end(JSON.stringify({
|
|
948
|
+
enabled,
|
|
949
|
+
guidelinesPath,
|
|
950
|
+
guidelinesExists: !!guidelinesPath,
|
|
951
|
+
userClaudeMdExists: existsSync(userClaudePath)
|
|
952
|
+
}));
|
|
953
|
+
return true;
|
|
954
|
+
} catch (error) {
|
|
955
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
956
|
+
res.end(JSON.stringify({ error: (error as Error).message }));
|
|
957
|
+
return true;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
// API: Toggle Windows platform setting
|
|
962
|
+
if (pathname === '/api/language/windows-platform' && req.method === 'POST') {
|
|
963
|
+
handlePostRequest(req, res, async (body: any) => {
|
|
964
|
+
const { enabled } = body;
|
|
965
|
+
|
|
966
|
+
if (typeof enabled !== 'boolean') {
|
|
967
|
+
return { error: 'Missing or invalid enabled parameter', status: 400 };
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
try {
|
|
971
|
+
const userClaudePath = join(homedir(), '.claude', 'CLAUDE.md');
|
|
972
|
+
const userClaudeDir = join(homedir(), '.claude');
|
|
973
|
+
|
|
974
|
+
// Find guidelines file path - always use user-level path with ~ shorthand
|
|
975
|
+
const userGuidelinesPath = join(homedir(), '.claude', 'workflows', 'windows-platform.md');
|
|
976
|
+
|
|
977
|
+
if (!existsSync(userGuidelinesPath)) {
|
|
978
|
+
return { error: 'Windows platform guidelines file not found at ~/.claude/workflows/windows-platform.md', status: 404 };
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
const guidelinesRef = '~/.claude/workflows/windows-platform.md';
|
|
982
|
+
|
|
983
|
+
const windowsRefLine = `- **Windows Platform**: @${guidelinesRef}`;
|
|
984
|
+
const windowsRefPattern = /^- \*\*Windows Platform\*\*:.*windows-platform\.md.*$/gm;
|
|
985
|
+
|
|
986
|
+
// Ensure user .claude directory exists
|
|
987
|
+
if (!existsSync(userClaudeDir)) {
|
|
988
|
+
const fs = require('fs');
|
|
989
|
+
fs.mkdirSync(userClaudeDir, { recursive: true });
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
let content = '';
|
|
993
|
+
if (existsSync(userClaudePath)) {
|
|
994
|
+
content = readFileSync(userClaudePath, 'utf8');
|
|
995
|
+
} else {
|
|
996
|
+
// Create new CLAUDE.md with header
|
|
997
|
+
content = '# Claude Instructions\n\n';
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
if (enabled) {
|
|
1001
|
+
// Check if reference already exists
|
|
1002
|
+
if (windowsRefPattern.test(content)) {
|
|
1003
|
+
return { success: true, message: 'Already enabled' };
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// Add reference after the header line or at the beginning
|
|
1007
|
+
const headerMatch = content.match(/^# Claude Instructions\n\n?/);
|
|
1008
|
+
if (headerMatch) {
|
|
1009
|
+
const insertPosition = headerMatch[0].length;
|
|
1010
|
+
content = content.slice(0, insertPosition) + windowsRefLine + '\n' + content.slice(insertPosition);
|
|
1011
|
+
} else {
|
|
1012
|
+
// Add header and reference
|
|
1013
|
+
content = '# Claude Instructions\n\n' + windowsRefLine + '\n' + content;
|
|
1014
|
+
}
|
|
1015
|
+
} else {
|
|
1016
|
+
// Remove reference
|
|
1017
|
+
content = content.replace(windowsRefPattern, '').replace(/\n{3,}/g, '\n\n').trim();
|
|
1018
|
+
if (content) content += '\n';
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
writeFileSync(userClaudePath, content, 'utf8');
|
|
1022
|
+
|
|
1023
|
+
// Broadcast update
|
|
1024
|
+
broadcastToClients({
|
|
1025
|
+
type: 'LANGUAGE_SETTING_CHANGED',
|
|
1026
|
+
data: { windowsPlatform: enabled }
|
|
1027
|
+
});
|
|
1028
|
+
|
|
1029
|
+
return { success: true, enabled };
|
|
1030
|
+
} catch (error) {
|
|
1031
|
+
return { error: (error as Error).message, status: 500 };
|
|
1032
|
+
}
|
|
1033
|
+
});
|
|
1034
|
+
return true;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
// API: Get freshness scores for all CLAUDE.md files
|
|
1038
|
+
if (pathname === '/api/memory/claude/freshness' && req.method === 'GET') {
|
|
1039
|
+
try {
|
|
1040
|
+
const { calculateAllFreshness } = await import('../claude-freshness.js');
|
|
1041
|
+
|
|
1042
|
+
const projectPathParam = url.searchParams.get('path') || initialPath;
|
|
1043
|
+
const threshold = parseInt(url.searchParams.get('threshold') || '20', 10);
|
|
1044
|
+
|
|
1045
|
+
// Get all CLAUDE.md files
|
|
1046
|
+
const filesData = scanAllClaudeFiles(projectPathParam);
|
|
1047
|
+
|
|
1048
|
+
// Prepare file list for freshness calculation
|
|
1049
|
+
const claudeFiles: Array<{
|
|
1050
|
+
path: string;
|
|
1051
|
+
level: 'user' | 'project' | 'module';
|
|
1052
|
+
lastModified: string;
|
|
1053
|
+
}> = [];
|
|
1054
|
+
|
|
1055
|
+
if (filesData.user.main) {
|
|
1056
|
+
claudeFiles.push({
|
|
1057
|
+
path: filesData.user.main.path,
|
|
1058
|
+
level: 'user',
|
|
1059
|
+
lastModified: filesData.user.main.lastModified
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
if (filesData.project.main) {
|
|
1064
|
+
claudeFiles.push({
|
|
1065
|
+
path: filesData.project.main.path,
|
|
1066
|
+
level: 'project',
|
|
1067
|
+
lastModified: filesData.project.main.lastModified
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
for (const module of filesData.modules) {
|
|
1072
|
+
claudeFiles.push({
|
|
1073
|
+
path: module.path,
|
|
1074
|
+
level: 'module',
|
|
1075
|
+
lastModified: module.lastModified
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
// Calculate freshness
|
|
1080
|
+
const freshnessData = calculateAllFreshness(claudeFiles, projectPathParam, threshold);
|
|
1081
|
+
|
|
1082
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
1083
|
+
res.end(JSON.stringify(freshnessData));
|
|
1084
|
+
return true;
|
|
1085
|
+
} catch (error) {
|
|
1086
|
+
console.error('Error calculating freshness:', error);
|
|
1087
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
1088
|
+
res.end(JSON.stringify({ error: (error as Error).message }));
|
|
1089
|
+
return true;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
// API: Mark a CLAUDE.md file as updated
|
|
1094
|
+
if (pathname === '/api/memory/claude/mark-updated' && req.method === 'POST') {
|
|
1095
|
+
handlePostRequest(req, res, async (body: any) => {
|
|
1096
|
+
const { path: filePath, source, metadata } = body;
|
|
1097
|
+
|
|
1098
|
+
if (!filePath) {
|
|
1099
|
+
return { error: 'Missing path parameter', status: 400 };
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
if (!source || !['manual', 'cli_sync', 'dashboard', 'api'].includes(source)) {
|
|
1103
|
+
return { error: 'Invalid or missing source parameter', status: 400 };
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
try {
|
|
1107
|
+
const { markFileAsUpdated } = await import('../claude-freshness.js');
|
|
1108
|
+
|
|
1109
|
+
// Determine file level
|
|
1110
|
+
let level: 'user' | 'project' | 'module' = 'module';
|
|
1111
|
+
if (filePath.includes(join(homedir(), '.claude'))) {
|
|
1112
|
+
level = 'user';
|
|
1113
|
+
} else if (filePath.includes('.claude')) {
|
|
1114
|
+
level = 'project';
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
const record = markFileAsUpdated(filePath, level, source, initialPath, metadata);
|
|
1118
|
+
|
|
1119
|
+
// Broadcast update
|
|
1120
|
+
broadcastToClients({
|
|
1121
|
+
type: 'CLAUDE_FRESHNESS_UPDATED',
|
|
1122
|
+
data: {
|
|
1123
|
+
path: filePath,
|
|
1124
|
+
level,
|
|
1125
|
+
updatedAt: record.updated_at,
|
|
1126
|
+
source
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1129
|
+
|
|
1130
|
+
return {
|
|
1131
|
+
success: true,
|
|
1132
|
+
record: {
|
|
1133
|
+
id: record.id,
|
|
1134
|
+
updated_at: record.updated_at,
|
|
1135
|
+
filesChangedBeforeUpdate: record.files_changed_before_update
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
} catch (error) {
|
|
1139
|
+
console.error('Error marking file as updated:', error);
|
|
1140
|
+
return { error: (error as Error).message, status: 500 };
|
|
1141
|
+
}
|
|
1142
|
+
});
|
|
1143
|
+
return true;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
// API: Get update history for a CLAUDE.md file
|
|
1147
|
+
if (pathname === '/api/memory/claude/history' && req.method === 'GET') {
|
|
1148
|
+
const filePath = url.searchParams.get('path');
|
|
1149
|
+
const limit = parseInt(url.searchParams.get('limit') || '50', 10);
|
|
1150
|
+
|
|
1151
|
+
if (!filePath) {
|
|
1152
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
1153
|
+
res.end(JSON.stringify({ error: 'Missing path parameter' }));
|
|
1154
|
+
return true;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
try {
|
|
1158
|
+
const { getUpdateHistory } = await import('../claude-freshness.js');
|
|
1159
|
+
|
|
1160
|
+
const records = getUpdateHistory(filePath, initialPath, limit);
|
|
1161
|
+
|
|
1162
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
1163
|
+
res.end(JSON.stringify({
|
|
1164
|
+
records: records.map(r => ({
|
|
1165
|
+
id: r.id,
|
|
1166
|
+
updated_at: r.updated_at,
|
|
1167
|
+
update_source: r.update_source,
|
|
1168
|
+
git_commit_hash: r.git_commit_hash,
|
|
1169
|
+
files_changed_before_update: r.files_changed_before_update,
|
|
1170
|
+
metadata: r.metadata ? JSON.parse(r.metadata) : undefined
|
|
1171
|
+
}))
|
|
1172
|
+
}));
|
|
1173
|
+
return true;
|
|
1174
|
+
} catch (error) {
|
|
1175
|
+
console.error('Error getting update history:', error);
|
|
1176
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
1177
|
+
res.end(JSON.stringify({ error: (error as Error).message }));
|
|
1178
|
+
return true;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
return false;
|
|
1183
|
+
}
|