cgraphx 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +243 -0
- package/dist/.claude-template/commands/my-commit.md +9 -0
- package/dist/.claude-template/commands/my-query.md +4 -0
- package/dist/.claude-template/hooks/context-monitor/context-monitor.cjs +216 -0
- package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.d.ts +4 -0
- package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.js +24 -0
- package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config-reader.d.ts +8 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config-reader.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config-reader.js +204 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config-reader.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config.d.ts +46 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config.js +220 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/constants.d.ts +10 -0
- package/dist/.claude-template/plugins/claude-hud/dist/constants.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/constants.js +10 -0
- package/dist/.claude-template/plugins/claude-hud/dist/constants.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/debug.d.ts +6 -0
- package/dist/.claude-template/plugins/claude-hud/dist/debug.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/debug.js +15 -0
- package/dist/.claude-template/plugins/claude-hud/dist/debug.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.d.ts +23 -0
- package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.js +103 -0
- package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/git.d.ts +16 -0
- package/dist/.claude-template/plugins/claude-hud/dist/git.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/git.js +86 -0
- package/dist/.claude-template/plugins/claude-hud/dist/git.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/index.d.ts +24 -0
- package/dist/.claude-template/plugins/claude-hud/dist/index.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/index.js +97 -0
- package/dist/.claude-template/plugins/claude-hud/dist/index.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.js +44 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/colors.d.ts +12 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/colors.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/colors.js +58 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/colors.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/index.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/index.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/index.js +379 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/index.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.js +30 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.js +52 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.d.ts +5 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.js +5 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.js +74 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.js +92 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.d.ts +7 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.js +247 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.js +25 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.js +43 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.d.ts +7 -0
- package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.js +62 -0
- package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/stdin.d.ts +9 -0
- package/dist/.claude-template/plugins/claude-hud/dist/stdin.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/stdin.js +136 -0
- package/dist/.claude-template/plugins/claude-hud/dist/stdin.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/transcript.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/transcript.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/transcript.js +189 -0
- package/dist/.claude-template/plugins/claude-hud/dist/transcript.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/types.d.ts +79 -0
- package/dist/.claude-template/plugins/claude-hud/dist/types.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/types.js +5 -0
- package/dist/.claude-template/plugins/claude-hud/dist/types.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/usage-api.d.ts +59 -0
- package/dist/.claude-template/plugins/claude-hud/dist/usage-api.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/usage-api.js +733 -0
- package/dist/.claude-template/plugins/claude-hud/dist/usage-api.js.map +1 -0
- package/dist/.claude-template/skills/cgraphx/SKILL.md +143 -0
- package/dist/.claude-template/skills/cgraphx/agent-prompt.md +56 -0
- package/dist/.claude-template/skills/clarify-requirements/SKILL.md +425 -0
- package/dist/.claude-template/skills/code-impact-api/SKILL.md +143 -0
- package/dist/.claude-template/skills/code-impact-api/agent-prompt.md +51 -0
- package/dist/.claude-template/skills/code-impact-docgen/SKILL.md +366 -0
- package/dist/.claude-template/skills/code-impact-docgen/template-business-html.md +242 -0
- package/dist/.claude-template/skills/code-impact-docgen/template-business-md.md +107 -0
- package/dist/.claude-template/skills/code-impact-docgen/template-technical-html.md +205 -0
- package/dist/.claude-template/skills/code-impact-docgen/template-technical-md.md +155 -0
- package/dist/.claude-template/skills/code-impact-init/SKILL.md +800 -0
- package/dist/.claude-template/skills/code-impact-markdown/SKILL.md +345 -0
- package/dist/.claude-template/skills/code-impact-markdown/template-guide.md +68 -0
- package/dist/.claude-template/skills/code-impact-markdown/template-memory.md +82 -0
- package/dist/.claude-template/skills/code-impact-markdown/template-runbook.md +58 -0
- package/dist/.claude-template/skills/db-query/SKILL.md +166 -0
- package/dist/.claude-template/skills/db-query/agent-prompt.md +55 -0
- package/dist/.claude-template/skills/developer-timeline/SKILL.md +302 -0
- package/dist/.claude-template/skills/developer-timeline/demo-single-page-report.html +657 -0
- package/dist/.claude-template/skills/implementation/SKILL.md +136 -0
- package/dist/.claude-template/skills/subagent-implement/SKILL.md +225 -0
- package/dist/.claude-template/skills/subagent-implement/implementer-prompt.md +127 -0
- package/dist/.claude-template/skills/subagent-implement/quality-reviewer-prompt.md +130 -0
- package/dist/.claude-template/skills/subagent-implement/spec-reviewer-prompt.md +112 -0
- package/dist/.claude-template/skills/write-plan/SKILL.md +322 -0
- package/dist/.claude-template/skills/write-plan/plan-document-reviewer-prompt.md +134 -0
- package/dist/.claude-template/skills/write-prd/SKILL.md +242 -0
- package/dist/.claude-template/skills/write-spec/SKILL.md +278 -0
- package/dist/bin/codegraph.d.ts +26 -0
- package/dist/bin/codegraph.d.ts.map +1 -0
- package/dist/bin/codegraph.js +2014 -0
- package/dist/bin/codegraph.js.map +1 -0
- package/dist/bin/fatal-handler.d.ts +20 -0
- package/dist/bin/fatal-handler.d.ts.map +1 -0
- package/dist/bin/fatal-handler.js +118 -0
- package/dist/bin/fatal-handler.js.map +1 -0
- package/dist/bin/node-version-check.d.ts +51 -0
- package/dist/bin/node-version-check.d.ts.map +1 -0
- package/dist/bin/node-version-check.js +114 -0
- package/dist/bin/node-version-check.js.map +1 -0
- package/dist/bin/uninstall.d.ts +14 -0
- package/dist/bin/uninstall.d.ts.map +1 -0
- package/dist/bin/uninstall.js +36 -0
- package/dist/bin/uninstall.js.map +1 -0
- package/dist/context/formatter.d.ts +30 -0
- package/dist/context/formatter.d.ts.map +1 -0
- package/dist/context/formatter.js +263 -0
- package/dist/context/formatter.js.map +1 -0
- package/dist/context/index.d.ts +119 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +1296 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/markers.d.ts +19 -0
- package/dist/context/markers.d.ts.map +1 -0
- package/dist/context/markers.js +22 -0
- package/dist/context/markers.js.map +1 -0
- package/dist/db/index.d.ts +122 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +296 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +44 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +140 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/queries.d.ts +401 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +1591 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.sql +152 -0
- package/dist/db/sqlite-adapter.d.ts +53 -0
- package/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/db/sqlite-adapter.js +117 -0
- package/dist/db/sqlite-adapter.js.map +1 -0
- package/dist/dbquery/cli.d.ts +17 -0
- package/dist/dbquery/cli.d.ts.map +1 -0
- package/dist/dbquery/cli.js +229 -0
- package/dist/dbquery/cli.js.map +1 -0
- package/dist/dbquery/config.d.ts +38 -0
- package/dist/dbquery/config.d.ts.map +1 -0
- package/dist/dbquery/config.js +244 -0
- package/dist/dbquery/config.js.map +1 -0
- package/dist/dbquery/constants.d.ts +40 -0
- package/dist/dbquery/constants.d.ts.map +1 -0
- package/dist/dbquery/constants.js +65 -0
- package/dist/dbquery/constants.js.map +1 -0
- package/dist/dbquery/drivers/mysql.d.ts +15 -0
- package/dist/dbquery/drivers/mysql.d.ts.map +1 -0
- package/dist/dbquery/drivers/mysql.js +102 -0
- package/dist/dbquery/drivers/mysql.js.map +1 -0
- package/dist/dbquery/drivers/postgres.d.ts +16 -0
- package/dist/dbquery/drivers/postgres.d.ts.map +1 -0
- package/dist/dbquery/drivers/postgres.js +105 -0
- package/dist/dbquery/drivers/postgres.js.map +1 -0
- package/dist/dbquery/errors.d.ts +40 -0
- package/dist/dbquery/errors.d.ts.map +1 -0
- package/dist/dbquery/errors.js +85 -0
- package/dist/dbquery/errors.js.map +1 -0
- package/dist/dbquery/executor.d.ts +30 -0
- package/dist/dbquery/executor.d.ts.map +1 -0
- package/dist/dbquery/executor.js +243 -0
- package/dist/dbquery/executor.js.map +1 -0
- package/dist/dbquery/format.d.ts +18 -0
- package/dist/dbquery/format.d.ts.map +1 -0
- package/dist/dbquery/format.js +174 -0
- package/dist/dbquery/format.js.map +1 -0
- package/dist/dbquery/index.d.ts +10 -0
- package/dist/dbquery/index.d.ts.map +1 -0
- package/dist/dbquery/index.js +23 -0
- package/dist/dbquery/index.js.map +1 -0
- package/dist/dbquery/init.d.ts +33 -0
- package/dist/dbquery/init.d.ts.map +1 -0
- package/dist/dbquery/init.js +125 -0
- package/dist/dbquery/init.js.map +1 -0
- package/dist/dbquery/logging.d.ts +22 -0
- package/dist/dbquery/logging.d.ts.map +1 -0
- package/dist/dbquery/logging.js +140 -0
- package/dist/dbquery/logging.js.map +1 -0
- package/dist/dbquery/mcp-tools.d.ts +29 -0
- package/dist/dbquery/mcp-tools.d.ts.map +1 -0
- package/dist/dbquery/mcp-tools.js +206 -0
- package/dist/dbquery/mcp-tools.js.map +1 -0
- package/dist/dbquery/queries.d.ts +31 -0
- package/dist/dbquery/queries.d.ts.map +1 -0
- package/dist/dbquery/queries.js +160 -0
- package/dist/dbquery/queries.js.map +1 -0
- package/dist/dbquery/safety.d.ts +35 -0
- package/dist/dbquery/safety.d.ts.map +1 -0
- package/dist/dbquery/safety.js +306 -0
- package/dist/dbquery/safety.js.map +1 -0
- package/dist/dbquery/types.d.ts +152 -0
- package/dist/dbquery/types.d.ts.map +1 -0
- package/dist/dbquery/types.js +10 -0
- package/dist/dbquery/types.js.map +1 -0
- package/dist/directory.d.ts +147 -0
- package/dist/directory.d.ts.map +1 -0
- package/dist/directory.js +523 -0
- package/dist/directory.js.map +1 -0
- package/dist/errors.d.ts +136 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +219 -0
- package/dist/errors.js.map +1 -0
- package/dist/extraction/astro-extractor.d.ts +79 -0
- package/dist/extraction/astro-extractor.d.ts.map +1 -0
- package/dist/extraction/astro-extractor.js +320 -0
- package/dist/extraction/astro-extractor.js.map +1 -0
- package/dist/extraction/dfm-extractor.d.ts +31 -0
- package/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/dist/extraction/dfm-extractor.js +151 -0
- package/dist/extraction/dfm-extractor.js.map +1 -0
- package/dist/extraction/extraction-version.d.ts +25 -0
- package/dist/extraction/extraction-version.d.ts.map +1 -0
- package/dist/extraction/extraction-version.js +28 -0
- package/dist/extraction/extraction-version.js.map +1 -0
- package/dist/extraction/function-ref.d.ts +118 -0
- package/dist/extraction/function-ref.d.ts.map +1 -0
- package/dist/extraction/function-ref.js +727 -0
- package/dist/extraction/function-ref.js.map +1 -0
- package/dist/extraction/generated-detection.d.ts +30 -0
- package/dist/extraction/generated-detection.d.ts.map +1 -0
- package/dist/extraction/generated-detection.js +83 -0
- package/dist/extraction/generated-detection.js.map +1 -0
- package/dist/extraction/grammars.d.ts +114 -0
- package/dist/extraction/grammars.d.ts.map +1 -0
- package/dist/extraction/grammars.js +477 -0
- package/dist/extraction/grammars.js.map +1 -0
- package/dist/extraction/index.d.ts +175 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +1887 -0
- package/dist/extraction/index.js.map +1 -0
- package/dist/extraction/languages/c-cpp.d.ts +12 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/dist/extraction/languages/c-cpp.js +275 -0
- package/dist/extraction/languages/c-cpp.js.map +1 -0
- package/dist/extraction/languages/csharp.d.ts +25 -0
- package/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/dist/extraction/languages/csharp.js +175 -0
- package/dist/extraction/languages/csharp.js.map +1 -0
- package/dist/extraction/languages/dart.d.ts +3 -0
- package/dist/extraction/languages/dart.d.ts.map +1 -0
- package/dist/extraction/languages/dart.js +374 -0
- package/dist/extraction/languages/dart.js.map +1 -0
- package/dist/extraction/languages/go.d.ts +3 -0
- package/dist/extraction/languages/go.d.ts.map +1 -0
- package/dist/extraction/languages/go.js +111 -0
- package/dist/extraction/languages/go.js.map +1 -0
- package/dist/extraction/languages/index.d.ts +10 -0
- package/dist/extraction/languages/index.d.ts.map +1 -0
- package/dist/extraction/languages/index.js +53 -0
- package/dist/extraction/languages/index.js.map +1 -0
- package/dist/extraction/languages/java.d.ts +3 -0
- package/dist/extraction/languages/java.d.ts.map +1 -0
- package/dist/extraction/languages/java.js +315 -0
- package/dist/extraction/languages/java.js.map +1 -0
- package/dist/extraction/languages/javascript.d.ts +3 -0
- package/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/dist/extraction/languages/javascript.js +106 -0
- package/dist/extraction/languages/javascript.js.map +1 -0
- package/dist/extraction/languages/kotlin.d.ts +3 -0
- package/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/dist/extraction/languages/kotlin.js +379 -0
- package/dist/extraction/languages/kotlin.js.map +1 -0
- package/dist/extraction/languages/lua.d.ts +3 -0
- package/dist/extraction/languages/lua.d.ts.map +1 -0
- package/dist/extraction/languages/lua.js +150 -0
- package/dist/extraction/languages/lua.js.map +1 -0
- package/dist/extraction/languages/luau.d.ts +3 -0
- package/dist/extraction/languages/luau.d.ts.map +1 -0
- package/dist/extraction/languages/luau.js +37 -0
- package/dist/extraction/languages/luau.js.map +1 -0
- package/dist/extraction/languages/objc.d.ts +3 -0
- package/dist/extraction/languages/objc.d.ts.map +1 -0
- package/dist/extraction/languages/objc.js +175 -0
- package/dist/extraction/languages/objc.js.map +1 -0
- package/dist/extraction/languages/pascal.d.ts +3 -0
- package/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/dist/extraction/languages/pascal.js +77 -0
- package/dist/extraction/languages/pascal.js.map +1 -0
- package/dist/extraction/languages/php.d.ts +3 -0
- package/dist/extraction/languages/php.d.ts.map +1 -0
- package/dist/extraction/languages/php.js +196 -0
- package/dist/extraction/languages/php.js.map +1 -0
- package/dist/extraction/languages/python.d.ts +3 -0
- package/dist/extraction/languages/python.d.ts.map +1 -0
- package/dist/extraction/languages/python.js +56 -0
- package/dist/extraction/languages/python.js.map +1 -0
- package/dist/extraction/languages/r.d.ts +3 -0
- package/dist/extraction/languages/r.d.ts.map +1 -0
- package/dist/extraction/languages/r.js +314 -0
- package/dist/extraction/languages/r.js.map +1 -0
- package/dist/extraction/languages/ruby.d.ts +3 -0
- package/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/dist/extraction/languages/ruby.js +149 -0
- package/dist/extraction/languages/ruby.js.map +1 -0
- package/dist/extraction/languages/rust.d.ts +3 -0
- package/dist/extraction/languages/rust.d.ts.map +1 -0
- package/dist/extraction/languages/rust.js +142 -0
- package/dist/extraction/languages/rust.js.map +1 -0
- package/dist/extraction/languages/scala.d.ts +3 -0
- package/dist/extraction/languages/scala.d.ts.map +1 -0
- package/dist/extraction/languages/scala.js +209 -0
- package/dist/extraction/languages/scala.js.map +1 -0
- package/dist/extraction/languages/swift.d.ts +3 -0
- package/dist/extraction/languages/swift.d.ts.map +1 -0
- package/dist/extraction/languages/swift.js +152 -0
- package/dist/extraction/languages/swift.js.map +1 -0
- package/dist/extraction/languages/typescript.d.ts +16 -0
- package/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/dist/extraction/languages/typescript.js +167 -0
- package/dist/extraction/languages/typescript.js.map +1 -0
- package/dist/extraction/liquid-extractor.d.ts +59 -0
- package/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/dist/extraction/liquid-extractor.js +357 -0
- package/dist/extraction/liquid-extractor.js.map +1 -0
- package/dist/extraction/mybatis-extractor.d.ts +48 -0
- package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
- package/dist/extraction/mybatis-extractor.js +198 -0
- package/dist/extraction/mybatis-extractor.js.map +1 -0
- package/dist/extraction/parse-worker.d.ts +8 -0
- package/dist/extraction/parse-worker.d.ts.map +1 -0
- package/dist/extraction/parse-worker.js +97 -0
- package/dist/extraction/parse-worker.js.map +1 -0
- package/dist/extraction/razor-extractor.d.ts +42 -0
- package/dist/extraction/razor-extractor.d.ts.map +1 -0
- package/dist/extraction/razor-extractor.js +285 -0
- package/dist/extraction/razor-extractor.js.map +1 -0
- package/dist/extraction/svelte-extractor.d.ts +56 -0
- package/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/dist/extraction/svelte-extractor.js +275 -0
- package/dist/extraction/svelte-extractor.js.map +1 -0
- package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-helpers.js +152 -0
- package/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/dist/extraction/tree-sitter-types.d.ts +239 -0
- package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-types.js +10 -0
- package/dist/extraction/tree-sitter-types.js.map +1 -0
- package/dist/extraction/tree-sitter.d.ts +647 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/dist/extraction/tree-sitter.js +5592 -0
- package/dist/extraction/tree-sitter.js.map +1 -0
- package/dist/extraction/vue-extractor.d.ts +51 -0
- package/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/dist/extraction/vue-extractor.js +254 -0
- package/dist/extraction/vue-extractor.js.map +1 -0
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
- package/dist/extraction/wasm-runtime-flags.js +106 -0
- package/dist/extraction/wasm-runtime-flags.js.map +1 -0
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/queries.d.ts +106 -0
- package/dist/graph/queries.d.ts.map +1 -0
- package/dist/graph/queries.js +339 -0
- package/dist/graph/queries.js.map +1 -0
- package/dist/graph/traversal.d.ts +127 -0
- package/dist/graph/traversal.d.ts.map +1 -0
- package/dist/graph/traversal.js +540 -0
- package/dist/graph/traversal.js.map +1 -0
- package/dist/index.d.ts +563 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1041 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/claude-assets.d.ts +45 -0
- package/dist/installer/claude-assets.d.ts.map +1 -0
- package/dist/installer/claude-assets.js +144 -0
- package/dist/installer/claude-assets.js.map +1 -0
- package/dist/installer/config-writer.d.ts +28 -0
- package/dist/installer/config-writer.d.ts.map +1 -0
- package/dist/installer/config-writer.js +91 -0
- package/dist/installer/config-writer.js.map +1 -0
- package/dist/installer/index.d.ts +101 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +692 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/instructions-template.d.ts +41 -0
- package/dist/installer/instructions-template.d.ts.map +1 -0
- package/dist/installer/instructions-template.js +53 -0
- package/dist/installer/instructions-template.js.map +1 -0
- package/dist/installer/targets/antigravity.d.ts +57 -0
- package/dist/installer/targets/antigravity.d.ts.map +1 -0
- package/dist/installer/targets/antigravity.js +308 -0
- package/dist/installer/targets/antigravity.js.map +1 -0
- package/dist/installer/targets/claude.d.ts +66 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +564 -0
- package/dist/installer/targets/claude.js.map +1 -0
- package/dist/installer/targets/codex.d.ts +18 -0
- package/dist/installer/targets/codex.d.ts.map +1 -0
- package/dist/installer/targets/codex.js +185 -0
- package/dist/installer/targets/codex.js.map +1 -0
- package/dist/installer/targets/cursor.d.ts +35 -0
- package/dist/installer/targets/cursor.d.ts.map +1 -0
- package/dist/installer/targets/cursor.js +254 -0
- package/dist/installer/targets/cursor.js.map +1 -0
- package/dist/installer/targets/gemini.d.ts +26 -0
- package/dist/installer/targets/gemini.d.ts.map +1 -0
- package/dist/installer/targets/gemini.js +165 -0
- package/dist/installer/targets/gemini.js.map +1 -0
- package/dist/installer/targets/hermes.d.ts +18 -0
- package/dist/installer/targets/hermes.d.ts.map +1 -0
- package/dist/installer/targets/hermes.js +359 -0
- package/dist/installer/targets/hermes.js.map +1 -0
- package/dist/installer/targets/kiro.d.ts +27 -0
- package/dist/installer/targets/kiro.d.ts.map +1 -0
- package/dist/installer/targets/kiro.js +178 -0
- package/dist/installer/targets/kiro.js.map +1 -0
- package/dist/installer/targets/opencode.d.ts +38 -0
- package/dist/installer/targets/opencode.d.ts.map +1 -0
- package/dist/installer/targets/opencode.js +288 -0
- package/dist/installer/targets/opencode.js.map +1 -0
- package/dist/installer/targets/registry.d.ts +35 -0
- package/dist/installer/targets/registry.d.ts.map +1 -0
- package/dist/installer/targets/registry.js +91 -0
- package/dist/installer/targets/registry.js.map +1 -0
- package/dist/installer/targets/shared.d.ts +101 -0
- package/dist/installer/targets/shared.d.ts.map +1 -0
- package/dist/installer/targets/shared.js +264 -0
- package/dist/installer/targets/shared.js.map +1 -0
- package/dist/installer/targets/toml.d.ts +52 -0
- package/dist/installer/targets/toml.d.ts.map +1 -0
- package/dist/installer/targets/toml.js +147 -0
- package/dist/installer/targets/toml.js.map +1 -0
- package/dist/installer/targets/types.d.ts +108 -0
- package/dist/installer/targets/types.d.ts.map +1 -0
- package/dist/installer/targets/types.js +16 -0
- package/dist/installer/targets/types.js.map +1 -0
- package/dist/markdown/cli.d.ts +16 -0
- package/dist/markdown/cli.d.ts.map +1 -0
- package/dist/markdown/cli.js +533 -0
- package/dist/markdown/cli.js.map +1 -0
- package/dist/markdown/constants.d.ts +22 -0
- package/dist/markdown/constants.d.ts.map +1 -0
- package/dist/markdown/constants.js +71 -0
- package/dist/markdown/constants.js.map +1 -0
- package/dist/markdown/dedup.d.ts +20 -0
- package/dist/markdown/dedup.d.ts.map +1 -0
- package/dist/markdown/dedup.js +64 -0
- package/dist/markdown/dedup.js.map +1 -0
- package/dist/markdown/errors.d.ts +22 -0
- package/dist/markdown/errors.d.ts.map +1 -0
- package/dist/markdown/errors.js +45 -0
- package/dist/markdown/errors.js.map +1 -0
- package/dist/markdown/extractor.d.ts +43 -0
- package/dist/markdown/extractor.d.ts.map +1 -0
- package/dist/markdown/extractor.js +152 -0
- package/dist/markdown/extractor.js.map +1 -0
- package/dist/markdown/frontmatter-parser.d.ts +47 -0
- package/dist/markdown/frontmatter-parser.d.ts.map +1 -0
- package/dist/markdown/frontmatter-parser.js +199 -0
- package/dist/markdown/frontmatter-parser.js.map +1 -0
- package/dist/markdown/indexer.d.ts +34 -0
- package/dist/markdown/indexer.d.ts.map +1 -0
- package/dist/markdown/indexer.js +256 -0
- package/dist/markdown/indexer.js.map +1 -0
- package/dist/markdown/mcp-tools.d.ts +33 -0
- package/dist/markdown/mcp-tools.d.ts.map +1 -0
- package/dist/markdown/mcp-tools.js +300 -0
- package/dist/markdown/mcp-tools.js.map +1 -0
- package/dist/markdown/query.d.ts +108 -0
- package/dist/markdown/query.d.ts.map +1 -0
- package/dist/markdown/query.js +570 -0
- package/dist/markdown/query.js.map +1 -0
- package/dist/markdown/schema-bootstrap.d.ts +40 -0
- package/dist/markdown/schema-bootstrap.d.ts.map +1 -0
- package/dist/markdown/schema-bootstrap.js +85 -0
- package/dist/markdown/schema-bootstrap.js.map +1 -0
- package/dist/markdown/schema.sql +124 -0
- package/dist/markdown/store.d.ts +77 -0
- package/dist/markdown/store.d.ts.map +1 -0
- package/dist/markdown/store.js +194 -0
- package/dist/markdown/store.js.map +1 -0
- package/dist/markdown/summary-extractor.d.ts +22 -0
- package/dist/markdown/summary-extractor.d.ts.map +1 -0
- package/dist/markdown/summary-extractor.js +66 -0
- package/dist/markdown/summary-extractor.js.map +1 -0
- package/dist/markdown/types.d.ts +159 -0
- package/dist/markdown/types.d.ts.map +1 -0
- package/dist/markdown/types.js +9 -0
- package/dist/markdown/types.js.map +1 -0
- package/dist/markdown/validator.d.ts +44 -0
- package/dist/markdown/validator.d.ts.map +1 -0
- package/dist/markdown/validator.js +95 -0
- package/dist/markdown/validator.js.map +1 -0
- package/dist/mcp/daemon-manager.d.ts +42 -0
- package/dist/mcp/daemon-manager.d.ts.map +1 -0
- package/dist/mcp/daemon-manager.js +129 -0
- package/dist/mcp/daemon-manager.js.map +1 -0
- package/dist/mcp/daemon-paths.d.ts +46 -0
- package/dist/mcp/daemon-paths.d.ts.map +1 -0
- package/dist/mcp/daemon-paths.js +125 -0
- package/dist/mcp/daemon-paths.js.map +1 -0
- package/dist/mcp/daemon-registry.d.ts +47 -0
- package/dist/mcp/daemon-registry.d.ts.map +1 -0
- package/dist/mcp/daemon-registry.js +229 -0
- package/dist/mcp/daemon-registry.js.map +1 -0
- package/dist/mcp/daemon.d.ts +220 -0
- package/dist/mcp/daemon.d.ts.map +1 -0
- package/dist/mcp/daemon.js +637 -0
- package/dist/mcp/daemon.js.map +1 -0
- package/dist/mcp/dynamic-boundaries.d.ts +41 -0
- package/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
- package/dist/mcp/dynamic-boundaries.js +359 -0
- package/dist/mcp/dynamic-boundaries.js.map +1 -0
- package/dist/mcp/engine.d.ts +105 -0
- package/dist/mcp/engine.d.ts.map +1 -0
- package/dist/mcp/engine.js +278 -0
- package/dist/mcp/engine.js.map +1 -0
- package/dist/mcp/index.d.ts +113 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +499 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/liveness-watchdog.d.ts +18 -0
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -0
- package/dist/mcp/liveness-watchdog.js +207 -0
- package/dist/mcp/liveness-watchdog.js.map +1 -0
- package/dist/mcp/ppid-watchdog.d.ts +44 -0
- package/dist/mcp/ppid-watchdog.d.ts.map +1 -0
- package/dist/mcp/ppid-watchdog.js +27 -0
- package/dist/mcp/ppid-watchdog.js.map +1 -0
- package/dist/mcp/proxy.d.ts +87 -0
- package/dist/mcp/proxy.d.ts.map +1 -0
- package/dist/mcp/proxy.js +641 -0
- package/dist/mcp/proxy.js.map +1 -0
- package/dist/mcp/server-instructions.d.ts +34 -0
- package/dist/mcp/server-instructions.d.ts.map +1 -0
- package/dist/mcp/server-instructions.js +106 -0
- package/dist/mcp/server-instructions.js.map +1 -0
- package/dist/mcp/session.d.ts +79 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +330 -0
- package/dist/mcp/session.js.map +1 -0
- package/dist/mcp/stdin-teardown.d.ts +27 -0
- package/dist/mcp/stdin-teardown.d.ts.map +1 -0
- package/dist/mcp/stdin-teardown.js +49 -0
- package/dist/mcp/stdin-teardown.js.map +1 -0
- package/dist/mcp/tools.d.ts +547 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +4122 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/transport.d.ts +188 -0
- package/dist/mcp/transport.d.ts.map +1 -0
- package/dist/mcp/transport.js +359 -0
- package/dist/mcp/transport.js.map +1 -0
- package/dist/mcp/version.d.ts +19 -0
- package/dist/mcp/version.d.ts.map +1 -0
- package/dist/mcp/version.js +71 -0
- package/dist/mcp/version.js.map +1 -0
- package/dist/project-config.d.ts +36 -0
- package/dist/project-config.d.ts.map +1 -0
- package/dist/project-config.js +235 -0
- package/dist/project-config.js.map +1 -0
- package/dist/reasoning/config.d.ts +45 -0
- package/dist/reasoning/config.d.ts.map +1 -0
- package/dist/reasoning/config.js +171 -0
- package/dist/reasoning/config.js.map +1 -0
- package/dist/reasoning/credentials.d.ts +5 -0
- package/dist/reasoning/credentials.d.ts.map +1 -0
- package/dist/reasoning/credentials.js +83 -0
- package/dist/reasoning/credentials.js.map +1 -0
- package/dist/reasoning/login.d.ts +21 -0
- package/dist/reasoning/login.d.ts.map +1 -0
- package/dist/reasoning/login.js +85 -0
- package/dist/reasoning/login.js.map +1 -0
- package/dist/reasoning/reasoner.d.ts +43 -0
- package/dist/reasoning/reasoner.d.ts.map +1 -0
- package/dist/reasoning/reasoner.js +308 -0
- package/dist/reasoning/reasoner.js.map +1 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts +33 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
- package/dist/resolution/c-fnptr-synthesizer.js +352 -0
- package/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
- package/dist/resolution/callback-synthesizer.d.ts +15 -0
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
- package/dist/resolution/callback-synthesizer.js +2926 -0
- package/dist/resolution/callback-synthesizer.js.map +1 -0
- package/dist/resolution/frameworks/astro.d.ts +9 -0
- package/dist/resolution/frameworks/astro.d.ts.map +1 -0
- package/dist/resolution/frameworks/astro.js +169 -0
- package/dist/resolution/frameworks/astro.js.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/dist/resolution/frameworks/csharp.js +241 -0
- package/dist/resolution/frameworks/csharp.js.map +1 -0
- package/dist/resolution/frameworks/drupal.d.ts +51 -0
- package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
- package/dist/resolution/frameworks/drupal.js +367 -0
- package/dist/resolution/frameworks/drupal.js.map +1 -0
- package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
- package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
- package/dist/resolution/frameworks/expo-modules.js +148 -0
- package/dist/resolution/frameworks/expo-modules.js.map +1 -0
- package/dist/resolution/frameworks/express.d.ts +8 -0
- package/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/dist/resolution/frameworks/express.js +308 -0
- package/dist/resolution/frameworks/express.js.map +1 -0
- package/dist/resolution/frameworks/fabric.d.ts +3 -0
- package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
- package/dist/resolution/frameworks/fabric.js +354 -0
- package/dist/resolution/frameworks/fabric.js.map +1 -0
- package/dist/resolution/frameworks/go.d.ts +8 -0
- package/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/dist/resolution/frameworks/go.js +161 -0
- package/dist/resolution/frameworks/go.js.map +1 -0
- package/dist/resolution/frameworks/goframe.d.ts +41 -0
- package/dist/resolution/frameworks/goframe.d.ts.map +1 -0
- package/dist/resolution/frameworks/goframe.js +112 -0
- package/dist/resolution/frameworks/goframe.js.map +1 -0
- package/dist/resolution/frameworks/index.d.ts +50 -0
- package/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/dist/resolution/frameworks/index.js +169 -0
- package/dist/resolution/frameworks/index.js.map +1 -0
- package/dist/resolution/frameworks/java.d.ts +8 -0
- package/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/dist/resolution/frameworks/java.js +509 -0
- package/dist/resolution/frameworks/java.js.map +1 -0
- package/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/dist/resolution/frameworks/laravel.js +257 -0
- package/dist/resolution/frameworks/laravel.js.map +1 -0
- package/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/dist/resolution/frameworks/nestjs.js +698 -0
- package/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/dist/resolution/frameworks/play.d.ts +19 -0
- package/dist/resolution/frameworks/play.d.ts.map +1 -0
- package/dist/resolution/frameworks/play.js +111 -0
- package/dist/resolution/frameworks/play.js.map +1 -0
- package/dist/resolution/frameworks/python.d.ts +10 -0
- package/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/dist/resolution/frameworks/python.js +400 -0
- package/dist/resolution/frameworks/python.js.map +1 -0
- package/dist/resolution/frameworks/react-native.d.ts +3 -0
- package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
- package/dist/resolution/frameworks/react-native.js +410 -0
- package/dist/resolution/frameworks/react-native.js.map +1 -0
- package/dist/resolution/frameworks/react.d.ts +8 -0
- package/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/dist/resolution/frameworks/react.js +334 -0
- package/dist/resolution/frameworks/react.js.map +1 -0
- package/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/dist/resolution/frameworks/ruby.js +302 -0
- package/dist/resolution/frameworks/ruby.js.map +1 -0
- package/dist/resolution/frameworks/rust.d.ts +8 -0
- package/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/dist/resolution/frameworks/rust.js +304 -0
- package/dist/resolution/frameworks/rust.js.map +1 -0
- package/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/dist/resolution/frameworks/svelte.js +253 -0
- package/dist/resolution/frameworks/svelte.js.map +1 -0
- package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
- package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
- package/dist/resolution/frameworks/swift-objc.js +252 -0
- package/dist/resolution/frameworks/swift-objc.js.map +1 -0
- package/dist/resolution/frameworks/swift.d.ts +10 -0
- package/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/dist/resolution/frameworks/swift.js +400 -0
- package/dist/resolution/frameworks/swift.js.map +1 -0
- package/dist/resolution/frameworks/vue.d.ts +9 -0
- package/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/dist/resolution/frameworks/vue.js +303 -0
- package/dist/resolution/frameworks/vue.js.map +1 -0
- package/dist/resolution/go-module.d.ts +26 -0
- package/dist/resolution/go-module.d.ts.map +1 -0
- package/dist/resolution/go-module.js +78 -0
- package/dist/resolution/go-module.js.map +1 -0
- package/dist/resolution/goframe-synthesizer.d.ts +28 -0
- package/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
- package/dist/resolution/goframe-synthesizer.js +158 -0
- package/dist/resolution/goframe-synthesizer.js.map +1 -0
- package/dist/resolution/import-resolver.d.ts +78 -0
- package/dist/resolution/import-resolver.d.ts.map +1 -0
- package/dist/resolution/import-resolver.js +1849 -0
- package/dist/resolution/import-resolver.js.map +1 -0
- package/dist/resolution/index.d.ts +196 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +1328 -0
- package/dist/resolution/index.js.map +1 -0
- package/dist/resolution/lru-cache.d.ts +24 -0
- package/dist/resolution/lru-cache.d.ts.map +1 -0
- package/dist/resolution/lru-cache.js +62 -0
- package/dist/resolution/lru-cache.js.map +1 -0
- package/dist/resolution/name-matcher.d.ts +93 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -0
- package/dist/resolution/name-matcher.js +1212 -0
- package/dist/resolution/name-matcher.js.map +1 -0
- package/dist/resolution/path-aliases.d.ts +68 -0
- package/dist/resolution/path-aliases.d.ts.map +1 -0
- package/dist/resolution/path-aliases.js +238 -0
- package/dist/resolution/path-aliases.js.map +1 -0
- package/dist/resolution/strip-comments.d.ts +27 -0
- package/dist/resolution/strip-comments.d.ts.map +1 -0
- package/dist/resolution/strip-comments.js +443 -0
- package/dist/resolution/strip-comments.js.map +1 -0
- package/dist/resolution/swift-objc-bridge.d.ts +134 -0
- package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
- package/dist/resolution/swift-objc-bridge.js +256 -0
- package/dist/resolution/swift-objc-bridge.js.map +1 -0
- package/dist/resolution/types.d.ts +233 -0
- package/dist/resolution/types.d.ts.map +1 -0
- package/dist/resolution/types.js +8 -0
- package/dist/resolution/types.js.map +1 -0
- package/dist/resolution/workspace-packages.d.ts +48 -0
- package/dist/resolution/workspace-packages.d.ts.map +1 -0
- package/dist/resolution/workspace-packages.js +208 -0
- package/dist/resolution/workspace-packages.js.map +1 -0
- package/dist/search/query-parser.d.ts +57 -0
- package/dist/search/query-parser.d.ts.map +1 -0
- package/dist/search/query-parser.js +177 -0
- package/dist/search/query-parser.js.map +1 -0
- package/dist/search/query-utils.d.ts +87 -0
- package/dist/search/query-utils.d.ts.map +1 -0
- package/dist/search/query-utils.js +449 -0
- package/dist/search/query-utils.js.map +1 -0
- package/dist/sync/git-hooks.d.ts +45 -0
- package/dist/sync/git-hooks.d.ts.map +1 -0
- package/dist/sync/git-hooks.js +225 -0
- package/dist/sync/git-hooks.js.map +1 -0
- package/dist/sync/index.d.ts +19 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +35 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/watch-policy.d.ts +48 -0
- package/dist/sync/watch-policy.d.ts.map +1 -0
- package/dist/sync/watch-policy.js +124 -0
- package/dist/sync/watch-policy.js.map +1 -0
- package/dist/sync/watcher.d.ts +350 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +811 -0
- package/dist/sync/watcher.js.map +1 -0
- package/dist/sync/worktree.d.ts +54 -0
- package/dist/sync/worktree.d.ts.map +1 -0
- package/dist/sync/worktree.js +137 -0
- package/dist/sync/worktree.js.map +1 -0
- package/dist/telemetry/index.d.ts +143 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +541 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/timeline/bash-semantics.d.ts +52 -0
- package/dist/timeline/bash-semantics.d.ts.map +1 -0
- package/dist/timeline/bash-semantics.js +376 -0
- package/dist/timeline/bash-semantics.js.map +1 -0
- package/dist/timeline/cli.d.ts +50 -0
- package/dist/timeline/cli.d.ts.map +1 -0
- package/dist/timeline/cli.js +367 -0
- package/dist/timeline/cli.js.map +1 -0
- package/dist/timeline/constants.d.ts +62 -0
- package/dist/timeline/constants.d.ts.map +1 -0
- package/dist/timeline/constants.js +73 -0
- package/dist/timeline/constants.js.map +1 -0
- package/dist/timeline/errors.d.ts +27 -0
- package/dist/timeline/errors.d.ts.map +1 -0
- package/dist/timeline/errors.js +51 -0
- package/dist/timeline/errors.js.map +1 -0
- package/dist/timeline/hook-runner.d.ts +36 -0
- package/dist/timeline/hook-runner.d.ts.map +1 -0
- package/dist/timeline/hook-runner.js +61 -0
- package/dist/timeline/hook-runner.js.map +1 -0
- package/dist/timeline/hooks.d.ts +45 -0
- package/dist/timeline/hooks.d.ts.map +1 -0
- package/dist/timeline/hooks.js +364 -0
- package/dist/timeline/hooks.js.map +1 -0
- package/dist/timeline/index.d.ts +12 -0
- package/dist/timeline/index.d.ts.map +1 -0
- package/dist/timeline/index.js +28 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/indexer.d.ts +37 -0
- package/dist/timeline/indexer.d.ts.map +1 -0
- package/dist/timeline/indexer.js +76 -0
- package/dist/timeline/indexer.js.map +1 -0
- package/dist/timeline/installer.d.ts +33 -0
- package/dist/timeline/installer.d.ts.map +1 -0
- package/dist/timeline/installer.js +255 -0
- package/dist/timeline/installer.js.map +1 -0
- package/dist/timeline/payload.d.ts +31 -0
- package/dist/timeline/payload.d.ts.map +1 -0
- package/dist/timeline/payload.js +58 -0
- package/dist/timeline/payload.js.map +1 -0
- package/dist/timeline/post-tool-summary.d.ts +29 -0
- package/dist/timeline/post-tool-summary.d.ts.map +1 -0
- package/dist/timeline/post-tool-summary.js +190 -0
- package/dist/timeline/post-tool-summary.js.map +1 -0
- package/dist/timeline/recorder.d.ts +36 -0
- package/dist/timeline/recorder.d.ts.map +1 -0
- package/dist/timeline/recorder.js +42 -0
- package/dist/timeline/recorder.js.map +1 -0
- package/dist/timeline/schema-bootstrap.d.ts +42 -0
- package/dist/timeline/schema-bootstrap.d.ts.map +1 -0
- package/dist/timeline/schema-bootstrap.js +81 -0
- package/dist/timeline/schema-bootstrap.js.map +1 -0
- package/dist/timeline/schema.sql +37 -0
- package/dist/timeline/store.d.ts +69 -0
- package/dist/timeline/store.d.ts.map +1 -0
- package/dist/timeline/store.js +429 -0
- package/dist/timeline/store.js.map +1 -0
- package/dist/timeline/types.d.ts +78 -0
- package/dist/timeline/types.d.ts.map +1 -0
- package/dist/timeline/types.js +9 -0
- package/dist/timeline/types.js.map +1 -0
- package/dist/types.d.ts +392 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +81 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/glyphs.d.ts +42 -0
- package/dist/ui/glyphs.d.ts.map +1 -0
- package/dist/ui/glyphs.js +78 -0
- package/dist/ui/glyphs.js.map +1 -0
- package/dist/ui/shimmer-progress.d.ts +11 -0
- package/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/dist/ui/shimmer-progress.js +90 -0
- package/dist/ui/shimmer-progress.js.map +1 -0
- package/dist/ui/shimmer-worker.d.ts +2 -0
- package/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/dist/ui/shimmer-worker.js +118 -0
- package/dist/ui/shimmer-worker.js.map +1 -0
- package/dist/ui/types.d.ts +17 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +3 -0
- package/dist/ui/types.js.map +1 -0
- package/dist/upgrade/index.d.ts +132 -0
- package/dist/upgrade/index.d.ts.map +1 -0
- package/dist/upgrade/index.js +498 -0
- package/dist/upgrade/index.js.map +1 -0
- package/dist/utils.d.ts +224 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +583 -0
- package/dist/utils.js.map +1 -0
- package/package.json +60 -0
- package/scripts/add-lang/bench.sh +60 -0
- package/scripts/add-lang/check-grammar.mjs +75 -0
- package/scripts/add-lang/dump-ast.mjs +103 -0
- package/scripts/add-lang/verify-extraction.mjs +70 -0
- package/scripts/agent-eval/ab-adoption.sh +91 -0
- package/scripts/agent-eval/ab-hook.sh +86 -0
- package/scripts/agent-eval/ab-impl.sh +78 -0
- package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -0
- package/scripts/agent-eval/ab-sufficiency.sh +78 -0
- package/scripts/agent-eval/arms-F.sh +21 -0
- package/scripts/agent-eval/arms-matrix.sh +37 -0
- package/scripts/agent-eval/audit.sh +68 -0
- package/scripts/agent-eval/bench-readme.sh +28 -0
- package/scripts/agent-eval/bench-why-repo.sh +22 -0
- package/scripts/agent-eval/block-read-hook.sh +19 -0
- package/scripts/agent-eval/hook-settings.json +15 -0
- package/scripts/agent-eval/itrun.sh +120 -0
- package/scripts/agent-eval/offload-eval-3arm.sh +72 -0
- package/scripts/agent-eval/offload-eval-cost.mjs +133 -0
- package/scripts/agent-eval/offload-eval-effort.mjs +108 -0
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -0
- package/scripts/agent-eval/offload-eval-frontload.sh +47 -0
- package/scripts/agent-eval/offload-eval-ground-truth.json +18 -0
- package/scripts/agent-eval/offload-eval-hook.mjs +84 -0
- package/scripts/agent-eval/offload-eval-judge.mjs +103 -0
- package/scripts/agent-eval/offload-eval-matrix.sh +20 -0
- package/scripts/agent-eval/offload-eval-metrics.mjs +94 -0
- package/scripts/agent-eval/offload-eval-refs1.sh +50 -0
- package/scripts/agent-eval/offload-eval-setup.sh +24 -0
- package/scripts/agent-eval/offload-eval-styles.sh +72 -0
- package/scripts/agent-eval/offload-eval-summarize.mjs +68 -0
- package/scripts/agent-eval/offload-eval.md +76 -0
- package/scripts/agent-eval/parse-arms.mjs +116 -0
- package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
- package/scripts/agent-eval/parse-run.mjs +45 -0
- package/scripts/agent-eval/parse-session.mjs +93 -0
- package/scripts/agent-eval/probe-context.mjs +21 -0
- package/scripts/agent-eval/probe-explore.mjs +40 -0
- package/scripts/agent-eval/probe-node.mjs +20 -0
- package/scripts/agent-eval/probe-sweep.mjs +119 -0
- package/scripts/agent-eval/probe-trace.mjs +20 -0
- package/scripts/agent-eval/redirect-read-hook.sh +38 -0
- package/scripts/agent-eval/run-agent.sh +34 -0
- package/scripts/agent-eval/run-all.sh +69 -0
- package/scripts/agent-eval/run-arms.sh +56 -0
- package/scripts/agent-eval/seq-matrix.mjs +137 -0
- package/scripts/build-bundle.sh +118 -0
- package/scripts/extract-release-notes.mjs +130 -0
- package/scripts/local-install.sh +41 -0
- package/scripts/npm-sdk.js +75 -0
- package/scripts/npm-shim.js +246 -0
- package/scripts/pack-npm.sh +118 -0
- package/scripts/prepare-release.mjs +270 -0
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CodeGraph Interactive Installer
|
|
4
|
+
*
|
|
5
|
+
* Multi-target: writes MCP server config + instructions for the
|
|
6
|
+
* agents the user picks (Claude Code, Cursor, Codex CLI, opencode,
|
|
7
|
+
* Hermes Agent, Gemini CLI, Antigravity IDE).
|
|
8
|
+
* Defaults to the Claude-only behavior for backwards compatibility
|
|
9
|
+
* when no targets are explicitly chosen and nothing else is detected.
|
|
10
|
+
*
|
|
11
|
+
* Uses @clack/prompts for the interactive UI; `runInstallerWithOptions`
|
|
12
|
+
* is the non-interactive entry point used by the `--target` /
|
|
13
|
+
* `--print-config` CLI flags.
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.hasPermissions = exports.hasMcpConfig = exports.writePermissions = exports.writeMcpConfig = void 0;
|
|
50
|
+
exports.runInstaller = runInstaller;
|
|
51
|
+
exports.runInstallerWithOptions = runInstallerWithOptions;
|
|
52
|
+
exports.uninstallTargets = uninstallTargets;
|
|
53
|
+
exports.runUninstaller = runUninstaller;
|
|
54
|
+
exports.offerWatchFallback = offerWatchFallback;
|
|
55
|
+
const child_process_1 = require("child_process");
|
|
56
|
+
const path = __importStar(require("path"));
|
|
57
|
+
const fs = __importStar(require("fs"));
|
|
58
|
+
const registry_1 = require("./targets/registry");
|
|
59
|
+
// Import the lightweight submodules directly (not the ../sync barrel, which
|
|
60
|
+
// re-exports FileWatcher and would transitively pull in ../extraction — the
|
|
61
|
+
// installer must stay importable even when native modules can't load).
|
|
62
|
+
const watch_policy_1 = require("../sync/watch-policy");
|
|
63
|
+
const git_hooks_1 = require("../sync/git-hooks");
|
|
64
|
+
const directory_1 = require("../directory");
|
|
65
|
+
const telemetry_1 = require("../telemetry");
|
|
66
|
+
const upgrade_1 = require("../upgrade");
|
|
67
|
+
// Backwards-compat: keep these named exports — downstream code may
|
|
68
|
+
// import them. The shim in `config-writer.ts` continues to re-export
|
|
69
|
+
// them too.
|
|
70
|
+
var config_writer_1 = require("./config-writer");
|
|
71
|
+
Object.defineProperty(exports, "writeMcpConfig", { enumerable: true, get: function () { return config_writer_1.writeMcpConfig; } });
|
|
72
|
+
Object.defineProperty(exports, "writePermissions", { enumerable: true, get: function () { return config_writer_1.writePermissions; } });
|
|
73
|
+
Object.defineProperty(exports, "hasMcpConfig", { enumerable: true, get: function () { return config_writer_1.hasMcpConfig; } });
|
|
74
|
+
Object.defineProperty(exports, "hasPermissions", { enumerable: true, get: function () { return config_writer_1.hasPermissions; } });
|
|
75
|
+
// Dynamic import helper — tsc compiles import() to require() in CJS mode,
|
|
76
|
+
// which fails for ESM-only packages. This bypasses the transformation.
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
78
|
+
const importESM = new Function('specifier', 'return import(specifier)');
|
|
79
|
+
function getVersion() {
|
|
80
|
+
try {
|
|
81
|
+
const packageJsonPath = path.join(__dirname, '..', '..', 'package.json');
|
|
82
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
83
|
+
return packageJson.version;
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return '0.0.0';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Interactive entry point — preserves the historical UX (`cgraphx
|
|
91
|
+
* install` with no args goes through the prompts), but now starts
|
|
92
|
+
* the targets multi-select pre-populated with detected agents.
|
|
93
|
+
*/
|
|
94
|
+
async function runInstaller() {
|
|
95
|
+
return runInstallerWithOptions({});
|
|
96
|
+
}
|
|
97
|
+
async function runInstallerWithOptions(opts) {
|
|
98
|
+
const clack = await importESM('@clack/prompts');
|
|
99
|
+
clack.intro(`cgraphx v${getVersion()}`);
|
|
100
|
+
// --yes implies all defaults; explicit flags still win.
|
|
101
|
+
const useDefaults = opts.yes === true;
|
|
102
|
+
// Step 1: which agent targets? Asked FIRST so the user knows what
|
|
103
|
+
// they're committing to before we touch npm or disk. Detection
|
|
104
|
+
// probes the user-provided location if known, else 'global' as the
|
|
105
|
+
// most common default — labels are a hint, not load-bearing.
|
|
106
|
+
const detectionLocation = opts.location ?? 'global';
|
|
107
|
+
const targets = await resolveTargets(clack, opts, detectionLocation, useDefaults);
|
|
108
|
+
if (targets.length === 0) {
|
|
109
|
+
clack.outro('未选择任何 agent —— 无操作。');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
// Step 2: install the cgraphx npm package on PATH (only when NOT already
|
|
113
|
+
// there). Skipped silently when the CLI is detected on PATH — running this
|
|
114
|
+
// for an already-installed user is both noise (a pointless prompt) and
|
|
115
|
+
// fragile (re-running `npm install -g <pkg>` pulls from the registry, which
|
|
116
|
+
// fails pre-publish or in air-gapped setups even though the CLI works fine).
|
|
117
|
+
if (!useDefaults) {
|
|
118
|
+
const existingPath = detectCodegraphOnPath();
|
|
119
|
+
if (existingPath) {
|
|
120
|
+
clack.log.info(`cgraphx CLI 已在 PATH 上(${existingPath})—— 跳过安装步骤。`);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
const shouldInstallGlobally = await clack.confirm({
|
|
124
|
+
message: '是否安装 cgraphx CLI 到 PATH?(agent 启动 MCP server 必须用到)',
|
|
125
|
+
initialValue: true,
|
|
126
|
+
});
|
|
127
|
+
if (clack.isCancel(shouldInstallGlobally)) {
|
|
128
|
+
clack.cancel('安装已取消。');
|
|
129
|
+
process.exit(0);
|
|
130
|
+
}
|
|
131
|
+
if (shouldInstallGlobally) {
|
|
132
|
+
const s = clack.spinner();
|
|
133
|
+
s.start('正在安装 cgraphx CLI...');
|
|
134
|
+
try {
|
|
135
|
+
// Capture stderr so the real failure (404 from registry, EACCES,
|
|
136
|
+
// network) surfaces instead of being hidden behind a guessed
|
|
137
|
+
// "permission denied" message.
|
|
138
|
+
const result = (0, child_process_1.execSync)(`npm install -g ${upgrade_1.NPM_PACKAGE}`, {
|
|
139
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
140
|
+
windowsHide: true,
|
|
141
|
+
});
|
|
142
|
+
s.stop('cgraphx CLI 已安装到 PATH');
|
|
143
|
+
void result; // output suppressed — npm progress bars aren't useful here
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
const stderr = extractStderr(err);
|
|
147
|
+
s.stop('cgraphx CLI 安装失败');
|
|
148
|
+
clack.log.warn(formatInstallHint(stderr));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
clack.log.info('已跳过 CLI 安装 —— 没有它 agent 无法启动 MCP server');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Step 3: where the per-agent config files should land.
|
|
157
|
+
// Default is LOCAL (project-level) — keeps user's global ~/.claude/,
|
|
158
|
+
// ~/.codex/ etc. untouched unless they explicitly opt in with --location=global
|
|
159
|
+
// or pick "All projects" in the prompt.
|
|
160
|
+
let location;
|
|
161
|
+
if (opts.location) {
|
|
162
|
+
location = opts.location;
|
|
163
|
+
}
|
|
164
|
+
else if (useDefaults) {
|
|
165
|
+
// --yes path: pick local unless every selected target is global-only
|
|
166
|
+
// (e.g. Codex has no project-local config slot).
|
|
167
|
+
const allGlobalOnly = targets.every((t) => !t.supportsLocation('local'));
|
|
168
|
+
location = allGlobalOnly ? 'global' : 'local';
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
// If every selected target is global-only (e.g. Codex), skip the
|
|
172
|
+
// prompt and force user-wide — project-local would just produce
|
|
173
|
+
// skip warnings.
|
|
174
|
+
const allGlobalOnly = targets.every((t) => !t.supportsLocation('local'));
|
|
175
|
+
if (allGlobalOnly) {
|
|
176
|
+
location = 'global';
|
|
177
|
+
clack.log.info('写入用户级配置(选中的 agent 不支持项目级配置)。');
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const sel = await clack.select({
|
|
181
|
+
message: '配置应用到当前项目,还是所有项目?',
|
|
182
|
+
options: [
|
|
183
|
+
{ value: 'local', label: '仅当前项目(推荐)', hint: './.claude, ./.cursor 等' },
|
|
184
|
+
{ value: 'global', label: '⚠️ 所有项目(不建议)', hint: '会影响你所有项目;如非必要不要选' },
|
|
185
|
+
],
|
|
186
|
+
initialValue: 'local',
|
|
187
|
+
});
|
|
188
|
+
if (clack.isCancel(sel)) {
|
|
189
|
+
clack.cancel('安装已取消。');
|
|
190
|
+
process.exit(0);
|
|
191
|
+
}
|
|
192
|
+
location = sel;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Step 4: auto-allow permissions (only meaningful for Claude;
|
|
196
|
+
// skipped silently by other targets).
|
|
197
|
+
let autoAllow;
|
|
198
|
+
if (opts.autoAllow !== undefined) {
|
|
199
|
+
autoAllow = opts.autoAllow;
|
|
200
|
+
}
|
|
201
|
+
else if (useDefaults) {
|
|
202
|
+
autoAllow = true;
|
|
203
|
+
}
|
|
204
|
+
else if (targets.some((t) => t.id === 'claude')) {
|
|
205
|
+
const ans = await clack.confirm({
|
|
206
|
+
message: '自动批准 cgraphx 命令?(跳过 Claude Code 中的权限确认弹窗)',
|
|
207
|
+
initialValue: true,
|
|
208
|
+
});
|
|
209
|
+
if (clack.isCancel(ans)) {
|
|
210
|
+
clack.cancel('安装已取消。');
|
|
211
|
+
process.exit(0);
|
|
212
|
+
}
|
|
213
|
+
autoAllow = ans;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
autoAllow = false;
|
|
217
|
+
}
|
|
218
|
+
// Step 4½: anonymous usage telemetry — a visible default-on toggle, asked
|
|
219
|
+
// exactly once. Skipped when an env var (DO_NOT_TRACK / CGRAPHX_TELEMETRY)
|
|
220
|
+
// already decides, or when a previous run stored a choice — re-runs and
|
|
221
|
+
// upgrades never re-ask.
|
|
222
|
+
if (!useDefaults && (0, telemetry_1.getTelemetry)().getStatus().decidedBy === 'default' && !(0, telemetry_1.getTelemetry)().hasStoredChoice()) {
|
|
223
|
+
const share = await clack.confirm({
|
|
224
|
+
message: '是否分享匿名使用统计?(不含代码、路径、名称 —— 详见 TELEMETRY.md)',
|
|
225
|
+
initialValue: true,
|
|
226
|
+
});
|
|
227
|
+
if (clack.isCancel(share)) {
|
|
228
|
+
// Don't kill the install over the telemetry question — leave it
|
|
229
|
+
// undecided (the documented default + first-run notice applies later).
|
|
230
|
+
clack.log.info('已跳过 —— 随时用 `cgraphx telemetry on|off` 切换。');
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
(0, telemetry_1.getTelemetry)().setEnabled(share, 'installer');
|
|
234
|
+
clack.log.info(share
|
|
235
|
+
? `感谢!具体收集内容见:${telemetry_1.TELEMETRY_DOCS}`
|
|
236
|
+
: '已关闭遥测 —— 不会收集或发送任何数据。');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// Step 4¾: front-load prompt hook (Claude Code only). A UserPromptSubmit hook
|
|
240
|
+
// that runs `cgraphx prompt-hook` — it injects codegraph_explore context on
|
|
241
|
+
// structural ("how / where / trace / impact") prompts so the agent reliably
|
|
242
|
+
// reaches for the graph instead of grepping. Opt-in, default-yes. Only Claude
|
|
243
|
+
// Code has UserPromptSubmit, so it's offered only when Claude is a target;
|
|
244
|
+
// other targets ignore the option. `undefined` (no Claude / not asked) leaves
|
|
245
|
+
// any existing hook untouched.
|
|
246
|
+
let promptHook;
|
|
247
|
+
if (targets.some((t) => t.id === 'claude')) {
|
|
248
|
+
if (useDefaults) {
|
|
249
|
+
promptHook = true; // --yes → on
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
const ans = await clack.confirm({
|
|
253
|
+
message: '⚠️ 是否启用 cgraphx 前置注入?(非常不建议 —— 仅对不会主动调工具的弱 agent 有用)',
|
|
254
|
+
initialValue: false,
|
|
255
|
+
});
|
|
256
|
+
if (clack.isCancel(ans)) {
|
|
257
|
+
clack.cancel('安装已取消。');
|
|
258
|
+
process.exit(0);
|
|
259
|
+
}
|
|
260
|
+
promptHook = ans; // false → opt out; install() strips any prior hook
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Step 5: per-target install loop.
|
|
264
|
+
const installedIds = [];
|
|
265
|
+
let sawCreated = false;
|
|
266
|
+
let sawUpdated = false;
|
|
267
|
+
for (const target of targets) {
|
|
268
|
+
if (!target.supportsLocation(location)) {
|
|
269
|
+
clack.log.warn(`${target.displayName}:已跳过 —— 不支持 --location=${location}。`);
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
const result = target.install(location, { autoAllow, promptHook });
|
|
273
|
+
installedIds.push(target.id);
|
|
274
|
+
for (const file of result.files) {
|
|
275
|
+
if (file.action === 'created')
|
|
276
|
+
sawCreated = true;
|
|
277
|
+
if (file.action === 'updated')
|
|
278
|
+
sawUpdated = true;
|
|
279
|
+
const verb = file.action === 'unchanged'
|
|
280
|
+
? 'Unchanged'
|
|
281
|
+
: file.action === 'created' ? 'Created'
|
|
282
|
+
: file.action === 'removed' ? 'Removed'
|
|
283
|
+
: 'Updated';
|
|
284
|
+
clack.log.success(`${target.displayName}: ${verb} ${tildify(file.path)}`);
|
|
285
|
+
}
|
|
286
|
+
for (const note of result.notes ?? []) {
|
|
287
|
+
clack.log.info(`${target.displayName}: ${note}`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// Telemetry: which agents were configured, where, fresh-vs-upgrade (derived
|
|
291
|
+
// from the file actions above). Target IDs and the location enum only.
|
|
292
|
+
if (installedIds.length > 0) {
|
|
293
|
+
(0, telemetry_1.getTelemetry)().recordLifecycle('install', {
|
|
294
|
+
targets: installedIds,
|
|
295
|
+
scope: location,
|
|
296
|
+
kind: sawCreated ? 'fresh' : sawUpdated ? 'upgrade' : 'reinstall',
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
// Step 5½: optional subsystem setup — docs / db / timeline.
|
|
300
|
+
// Each is independent and runs only if the user keeps it checked.
|
|
301
|
+
// Skipped silently under --yes if their preconditions aren't met
|
|
302
|
+
// (e.g. db init needs .cgraphx/ to exist; docs needs docs/knowledge/).
|
|
303
|
+
const projectRoot = process.cwd();
|
|
304
|
+
const codegraphExists = fs.existsSync((0, directory_1.getCodeGraphDir)(projectRoot));
|
|
305
|
+
const docsDir = path.join(projectRoot, 'docs', 'knowledge');
|
|
306
|
+
const docsHasMd = fs.existsSync(docsDir) &&
|
|
307
|
+
fs.readdirSync(docsDir).some(f => f.endsWith('.md') || f.endsWith('.mdx'));
|
|
308
|
+
let chosen;
|
|
309
|
+
if (useDefaults) {
|
|
310
|
+
chosen = ['docs', 'db', 'timeline'];
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
const sel = await clack.multiselect({
|
|
314
|
+
message: '配置可选子系统(回车确认默认全选)',
|
|
315
|
+
options: [
|
|
316
|
+
{ value: 'docs', label: '文档知识库', hint: docsHasMd ? '扫描 docs/knowledge/' : 'docs/knowledge/ 不存在 — 跳过' },
|
|
317
|
+
{ value: 'db', label: '数据库查询', hint: codegraphExists ? '生成 .cgraphx/db-profiles.json 模板' : '.cgraphx/ 不存在 — 跳过' },
|
|
318
|
+
{ value: 'timeline', label: 'Developer Timeline', hint: '装 Claude Code hooks(项目级)' },
|
|
319
|
+
],
|
|
320
|
+
initialValues: ['docs', 'db', 'timeline'],
|
|
321
|
+
required: false,
|
|
322
|
+
});
|
|
323
|
+
if (clack.isCancel(sel)) {
|
|
324
|
+
clack.cancel('取消');
|
|
325
|
+
process.exit(0);
|
|
326
|
+
}
|
|
327
|
+
chosen = sel;
|
|
328
|
+
}
|
|
329
|
+
if (chosen.includes('docs')) {
|
|
330
|
+
if (!codegraphExists) {
|
|
331
|
+
clack.log.info('.cgraphx/ 不存在 — 文档子系统跳过(跑 `cgraphx init` 后再 `cgraphx docs index`)');
|
|
332
|
+
}
|
|
333
|
+
else if (docsHasMd) {
|
|
334
|
+
const s = clack.spinner();
|
|
335
|
+
s.start('索引文档知识库...');
|
|
336
|
+
try {
|
|
337
|
+
const { indexMarkdownKnowledgeBase } = await Promise.resolve().then(() => __importStar(require('../markdown/indexer')));
|
|
338
|
+
const report = await indexMarkdownKnowledgeBase(projectRoot);
|
|
339
|
+
s.stop(`文档知识库已建(${report.indexedDocuments} 篇文档,${report.skippedFiles} 篇跳过)`);
|
|
340
|
+
}
|
|
341
|
+
catch (err) {
|
|
342
|
+
s.stop('文档索引失败');
|
|
343
|
+
clack.log.warn(`docs index 失败:${err instanceof Error ? err.message : String(err)}(可稍后手动跑 \`cgraphx docs index\`)`);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
clack.log.info('docs/knowledge/ 不存在或为空 — 文档子系统跳过(后续可创建文档后跑 `cgraphx docs index`)');
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if (chosen.includes('db')) {
|
|
351
|
+
if (codegraphExists) {
|
|
352
|
+
try {
|
|
353
|
+
const { initDbProfiles } = await Promise.resolve().then(() => __importStar(require('../dbquery/init')));
|
|
354
|
+
const report = initDbProfiles(projectRoot);
|
|
355
|
+
if (report.action === 'already-exists') {
|
|
356
|
+
clack.log.info('db-profiles.json 已存在 — 保留用户配置(如需重置加 --force 跑 `cgraphx db init`)');
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
clack.log.success(`已生成 ${report.filePath} — 编辑后填实际密码`);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
catch (err) {
|
|
363
|
+
clack.log.warn(`db init 失败:${err instanceof Error ? err.message : String(err)}`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
clack.log.info('.cgraphx/ 不存在 — 数据库子系统跳过(跑 `cgraphx init` 后再 `cgraphx db init`)');
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (chosen.includes('timeline')) {
|
|
371
|
+
try {
|
|
372
|
+
const { installTimelineHooks } = await Promise.resolve().then(() => __importStar(require('../timeline/installer')));
|
|
373
|
+
const report = installTimelineHooks(projectRoot);
|
|
374
|
+
const events = report.writtenHookEvents.length > 0
|
|
375
|
+
? report.writtenHookEvents.join('/')
|
|
376
|
+
: '已存在(幂等)';
|
|
377
|
+
const git = report.gitHookWritten
|
|
378
|
+
? ' + git post-commit'
|
|
379
|
+
: report.gitHookPath ? '(git hook 已存在)' : '(非 git 仓库,跳过 git hook)';
|
|
380
|
+
clack.log.success(`Developer Timeline 已装:${events}${git}`);
|
|
381
|
+
}
|
|
382
|
+
catch (err) {
|
|
383
|
+
clack.log.warn(`timeline install 失败:${err instanceof Error ? err.message : String(err)}`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
// Step 6: install wires up agents only — it deliberately does NOT index.
|
|
387
|
+
// Building the per-project graph is the user's explicit `cgraphx init`
|
|
388
|
+
// (or `index`), so they choose what gets indexed and when, and we never
|
|
389
|
+
// index a surprise directory (e.g. a shell sitting in $HOME). Same next step
|
|
390
|
+
// regardless of global/local scope.
|
|
391
|
+
clack.note(location === 'local'
|
|
392
|
+
? 'cgraphx init # 构建本项目的代码图(一次性;之后自动同步)'
|
|
393
|
+
: 'cd <你的项目>\ncgraphx init # 构建项目代码图(一次性;之后自动同步)', '下一步:索引一个项目');
|
|
394
|
+
// Deliver buffered telemetry while we're already in a long interactive
|
|
395
|
+
// command — bounded (~1.5s worst case), invisible after a multi-second install.
|
|
396
|
+
await (0, telemetry_1.getTelemetry)().flushNow();
|
|
397
|
+
const finalNote = targets.length > 0
|
|
398
|
+
? `完成!重启你的 agent${targets.length > 1 ? 's' : ''} 即可使用 cgraphx。`
|
|
399
|
+
: '完成!';
|
|
400
|
+
clack.outro(finalNote);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Pure uninstall sweep — no prompts, no I/O beyond the targets' own
|
|
404
|
+
* file edits. Exposed (and unit-tested) separately from the clack UI in
|
|
405
|
+
* `runUninstaller` so the aggregation logic can be asserted directly.
|
|
406
|
+
*
|
|
407
|
+
* Each target's `uninstall()` is already safe to call when nothing was
|
|
408
|
+
* installed (it returns `not-found` actions), so this is safe to run
|
|
409
|
+
* across every target unconditionally.
|
|
410
|
+
*/
|
|
411
|
+
function uninstallTargets(targets, location) {
|
|
412
|
+
return targets.map((target) => {
|
|
413
|
+
if (!target.supportsLocation(location)) {
|
|
414
|
+
const only = location === 'local' ? 'global' : 'local';
|
|
415
|
+
return {
|
|
416
|
+
id: target.id,
|
|
417
|
+
displayName: target.displayName,
|
|
418
|
+
status: 'unsupported',
|
|
419
|
+
removedPaths: [],
|
|
420
|
+
notes: [`no ${location} config — this agent is ${only}-only`],
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
const result = target.uninstall(location);
|
|
424
|
+
const removedPaths = result.files
|
|
425
|
+
.filter((f) => f.action === 'removed')
|
|
426
|
+
.map((f) => f.path);
|
|
427
|
+
return {
|
|
428
|
+
id: target.id,
|
|
429
|
+
displayName: target.displayName,
|
|
430
|
+
status: removedPaths.length > 0 ? 'removed' : 'not-configured',
|
|
431
|
+
removedPaths,
|
|
432
|
+
notes: result.notes ?? [],
|
|
433
|
+
};
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Interactive uninstaller — the inverse of `runInstallerWithOptions`.
|
|
438
|
+
* Asks global-vs-local first (unless `--location`/`--yes` is given),
|
|
439
|
+
* then sweeps every agent target (or the `--target` subset) and prints
|
|
440
|
+
* one block per agent so the user sees exactly which providers it hit.
|
|
441
|
+
*
|
|
442
|
+
* Removes only what install wrote (MCP server entry, instructions
|
|
443
|
+
* block, permissions) — never the `.cgraphx/` index, which `codegraph
|
|
444
|
+
* uninit` owns.
|
|
445
|
+
*/
|
|
446
|
+
async function runUninstaller(opts) {
|
|
447
|
+
const clack = await importESM('@clack/prompts');
|
|
448
|
+
clack.intro(`cgraphx v${getVersion()} —— 卸载`);
|
|
449
|
+
const useDefaults = opts.yes === true;
|
|
450
|
+
// Step 1: which location — asked FIRST, the one decision the user
|
|
451
|
+
// must make. Default is GLOBAL for uninstall — clean every trace of
|
|
452
|
+
// CodeGraph from the user's home (project-local files are easy for the
|
|
453
|
+
// user to delete themselves; ~/.claude/ etc. are the dangerous ones
|
|
454
|
+
// they want CodeGraph to remove for them).
|
|
455
|
+
let location;
|
|
456
|
+
if (opts.location) {
|
|
457
|
+
location = opts.location;
|
|
458
|
+
}
|
|
459
|
+
else if (useDefaults) {
|
|
460
|
+
location = 'global';
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
const sel = await clack.select({
|
|
464
|
+
message: '从所有项目移除 cgraphx,还是仅当前项目?',
|
|
465
|
+
options: [
|
|
466
|
+
{ value: 'global', label: '所有项目(全局)', hint: '~/.claude, ~/.cursor, ~/.codex, ~/.config/opencode, ~/.hermes, ~/.gemini, ~/.kiro' },
|
|
467
|
+
{ value: 'local', label: '仅当前项目(本地)', hint: './.claude, ./.cursor, ./opencode.jsonc, ./.gemini, ./.kiro' },
|
|
468
|
+
],
|
|
469
|
+
initialValue: 'global',
|
|
470
|
+
});
|
|
471
|
+
if (clack.isCancel(sel)) {
|
|
472
|
+
clack.cancel('卸载已取消。');
|
|
473
|
+
process.exit(0);
|
|
474
|
+
}
|
|
475
|
+
location = sel;
|
|
476
|
+
}
|
|
477
|
+
// Step 2: which agents. Default is every agent, so the user doesn't
|
|
478
|
+
// have to remember where they installed it — unconfigured agents are
|
|
479
|
+
// reported as "nothing to remove" and left untouched. An explicit
|
|
480
|
+
// --target subsets this.
|
|
481
|
+
let targets;
|
|
482
|
+
if (opts.target !== undefined) {
|
|
483
|
+
targets = (0, registry_1.resolveTargetFlag)(opts.target, location);
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
targets = [...registry_1.ALL_TARGETS];
|
|
487
|
+
}
|
|
488
|
+
if (targets.length === 0) {
|
|
489
|
+
clack.outro('未选择任何 agent —— 无操作。');
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
// Step 3: sweep + per-agent feedback.
|
|
493
|
+
const reports = uninstallTargets(targets, location);
|
|
494
|
+
const removed = reports.filter((r) => r.status === 'removed');
|
|
495
|
+
for (const r of reports) {
|
|
496
|
+
if (r.status === 'removed') {
|
|
497
|
+
for (const p of r.removedPaths) {
|
|
498
|
+
clack.log.success(`${r.displayName}:已移除 ${tildify(p)}`);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
else if (r.status === 'not-configured') {
|
|
502
|
+
clack.log.info(`${r.displayName}:未配置 —— 无需移除`);
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
clack.log.info(`${r.displayName}:已跳过 —— ${r.notes[0] ?? '不支持该位置'}`);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
// Step 4: for local uninstall, the index dir is separate — point at
|
|
509
|
+
// `uninit` so the user knows it's still there (and how to remove it).
|
|
510
|
+
if (location === 'local' && fs.existsSync((0, directory_1.getCodeGraphDir)(process.cwd()))) {
|
|
511
|
+
clack.log.info(`本项目的 ${(0, directory_1.codeGraphDirName)()}/ 索引仍然存在。运行 \`cgraphx uninit\` 删除。`);
|
|
512
|
+
}
|
|
513
|
+
// Telemetry churn signal (agent IDs only) — flush now, since after an
|
|
514
|
+
// uninstall there is usually no "next run" to deliver it.
|
|
515
|
+
if (removed.length > 0) {
|
|
516
|
+
(0, telemetry_1.getTelemetry)().recordLifecycle('uninstall', { targets: removed.map((r) => r.id) });
|
|
517
|
+
await (0, telemetry_1.getTelemetry)().flushNow();
|
|
518
|
+
}
|
|
519
|
+
// Step 5: summary.
|
|
520
|
+
if (removed.length > 0) {
|
|
521
|
+
const names = removed.map((r) => r.displayName).join(', ');
|
|
522
|
+
clack.outro(`已从 ${removed.length} 个 agent${removed.length > 1 ? 's' : ''} 移除 cgraphx:${names}。` +
|
|
523
|
+
`重启 ${removed.length > 1 ? '它们' : '它'} 后生效。`);
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
clack.outro(`cgraphx 未在任何 ${location} agent 中配置 —— 无需移除。`);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Replace home-directory prefix in a path with `~/` for cleaner log
|
|
531
|
+
* lines. Pure cosmetic.
|
|
532
|
+
*/
|
|
533
|
+
function tildify(p) {
|
|
534
|
+
const home = require('os').homedir();
|
|
535
|
+
if (p.startsWith(home + path.sep))
|
|
536
|
+
return '~' + p.substring(home.length);
|
|
537
|
+
return p;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Detect whether the `cgraphx` command is already resolvable on PATH.
|
|
541
|
+
*
|
|
542
|
+
* Cross-platform: `command -v` works on POSIX, `where` on Windows. Returns
|
|
543
|
+
* the resolved absolute path on success (first line of output, in case
|
|
544
|
+
* Windows `where` lists multiple matches) or null when not found / lookup
|
|
545
|
+
* failed. Never throws.
|
|
546
|
+
*/
|
|
547
|
+
function detectCodegraphOnPath() {
|
|
548
|
+
const cmd = process.platform === 'win32' ? 'where cgraphx' : 'command -v cgraphx || which cgraphx';
|
|
549
|
+
try {
|
|
550
|
+
const out = (0, child_process_1.execSync)(cmd, {
|
|
551
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
552
|
+
windowsHide: true,
|
|
553
|
+
encoding: 'utf-8',
|
|
554
|
+
});
|
|
555
|
+
const first = out.split(/\r?\n/).find(l => l.trim().length > 0);
|
|
556
|
+
return first ? first.trim() : null;
|
|
557
|
+
}
|
|
558
|
+
catch {
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Pull stderr out of an execSync error object for display. execSync wraps the
|
|
564
|
+
* underlying error in an Error with `.stderr` / `.stdout` Buffers when
|
|
565
|
+
* stdio is piped — surface that instead of guessing the cause.
|
|
566
|
+
*/
|
|
567
|
+
function extractStderr(err) {
|
|
568
|
+
if (err && typeof err === 'object') {
|
|
569
|
+
const e = err;
|
|
570
|
+
if (e.stderr)
|
|
571
|
+
return e.stderr.toString().trim();
|
|
572
|
+
if (e.stdout)
|
|
573
|
+
return e.stdout.toString().trim();
|
|
574
|
+
if (e.message)
|
|
575
|
+
return e.message;
|
|
576
|
+
}
|
|
577
|
+
return String(err);
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Build a platform-appropriate hint when `npm install -g` fails. `sudo` is
|
|
581
|
+
* meaningless on Windows — the user needs to either rerun PowerShell as
|
|
582
|
+
* Administrator or change npm's prefix to a user-writable directory.
|
|
583
|
+
*/
|
|
584
|
+
function formatInstallHint(stderr) {
|
|
585
|
+
const is404 = /404\s+not\s+found/i.test(stderr) || /cgraphx/i.test(stderr) && /not\s+found/i.test(stderr);
|
|
586
|
+
if (is404) {
|
|
587
|
+
return `${upgrade_1.NPM_PACKAGE} is not yet published to npm. Run \`npm publish\` first, or install locally with \`npm install -g ./cgraphx-<version>.tgz\`.`;
|
|
588
|
+
}
|
|
589
|
+
if (process.platform === 'win32') {
|
|
590
|
+
return `Try: open PowerShell as Administrator and run \`npm install -g ${upgrade_1.NPM_PACKAGE}\`. Or change npm prefix to a user-writable directory: \`npm config set prefix "$APPDATA\\npm"\`.`;
|
|
591
|
+
}
|
|
592
|
+
return `Try: \`sudo npm install -g ${upgrade_1.NPM_PACKAGE}\`, or change npm prefix to avoid sudo.`;
|
|
593
|
+
}
|
|
594
|
+
async function resolveTargets(clack, opts, location, useDefaults) {
|
|
595
|
+
// Explicit --target flag wins.
|
|
596
|
+
if (opts.target !== undefined) {
|
|
597
|
+
return (0, registry_1.resolveTargetFlag)(opts.target, location);
|
|
598
|
+
}
|
|
599
|
+
// --yes implies auto-detect.
|
|
600
|
+
if (useDefaults) {
|
|
601
|
+
return (0, registry_1.resolveTargetFlag)('auto', location);
|
|
602
|
+
}
|
|
603
|
+
// Interactive multi-select.
|
|
604
|
+
// cgraphx policy: default to Claude Code ALONE, regardless of how
|
|
605
|
+
// many other agents happen to be detected on the machine. The user can
|
|
606
|
+
// opt into more by arrow-keying down and selecting them — but the
|
|
607
|
+
// "press Enter to confirm" path installs only what 90% of users want.
|
|
608
|
+
// Detection still runs so the `(detected)` labels are accurate.
|
|
609
|
+
const detected = (0, registry_1.detectAll)(location);
|
|
610
|
+
const initial = ['claude'];
|
|
611
|
+
const choice = await clack.multiselect({
|
|
612
|
+
message: '要为哪些 agent 配置 cgraphx?',
|
|
613
|
+
options: registry_1.ALL_TARGETS.map((t) => {
|
|
614
|
+
const det = detected.find(({ target }) => target.id === t.id).detection;
|
|
615
|
+
const flag = det.installed ? '(detected)' : '(not found)';
|
|
616
|
+
const globalOnly = !t.supportsLocation('local') ? ' — global only' : '';
|
|
617
|
+
return {
|
|
618
|
+
value: t.id,
|
|
619
|
+
label: `${t.displayName} ${flag}${globalOnly}`,
|
|
620
|
+
};
|
|
621
|
+
}),
|
|
622
|
+
initialValues: initial,
|
|
623
|
+
required: false,
|
|
624
|
+
});
|
|
625
|
+
if (clack.isCancel(choice)) {
|
|
626
|
+
clack.cancel('Installation cancelled.');
|
|
627
|
+
process.exit(0);
|
|
628
|
+
}
|
|
629
|
+
return choice
|
|
630
|
+
.map((id) => (0, registry_1.getTarget)(id))
|
|
631
|
+
.filter((t) => t !== undefined);
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* When the live file watcher will be disabled for this project (e.g. WSL2
|
|
635
|
+
* /mnt drives, or CGRAPHX_NO_WATCH), the index would silently go stale.
|
|
636
|
+
* Explain that, and offer to keep it fresh automatically via git hooks
|
|
637
|
+
* (commit / pull / checkout) instead of manual `cgraphx sync`.
|
|
638
|
+
*
|
|
639
|
+
* No-op on environments where the watcher runs normally, so it's safe to
|
|
640
|
+
* call unconditionally after init.
|
|
641
|
+
*/
|
|
642
|
+
async function offerWatchFallback(clack, projectPath, opts = {}) {
|
|
643
|
+
const reason = (0, watch_policy_1.watchDisabledReason)(projectPath);
|
|
644
|
+
if (!reason)
|
|
645
|
+
return; // Watcher runs normally — nothing to set up.
|
|
646
|
+
clack.log.warn(`实时文件监听已禁用 —— ${reason}。`);
|
|
647
|
+
clack.log.info('在重新同步之前,cgraphx 索引将保持冻结 —— 不会自动感知文件修改。');
|
|
648
|
+
// No git repo → the commit-hook path doesn't apply; point at manual sync.
|
|
649
|
+
if (!(0, git_hooks_1.isGitRepo)(projectPath)) {
|
|
650
|
+
clack.log.info('Run `cgraphx sync` after changing files to refresh the index.');
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
// Already wired up on a previous run — confirm and move on without nagging.
|
|
654
|
+
if ((0, git_hooks_1.isSyncHookInstalled)(projectPath)) {
|
|
655
|
+
clack.log.info('Git 同步 hook 已安装 —— 索引会在 commit / pull / checkout 后自动刷新。');
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
let choice;
|
|
659
|
+
if (opts.yes) {
|
|
660
|
+
choice = 'hook';
|
|
661
|
+
}
|
|
662
|
+
else {
|
|
663
|
+
const sel = await clack.select({
|
|
664
|
+
message: 'cgraphx 如何保持索引最新?',
|
|
665
|
+
options: [
|
|
666
|
+
{ value: 'hook', label: '在 git commit / pull / checkout 时同步', hint: '安装 git hooks(推荐)' },
|
|
667
|
+
{ value: 'manual', label: '我自己跑 `cgraphx sync`', hint: '完全手动' },
|
|
668
|
+
],
|
|
669
|
+
initialValue: 'hook',
|
|
670
|
+
});
|
|
671
|
+
if (clack.isCancel(sel)) {
|
|
672
|
+
clack.log.info('已跳过 —— 修改后跑 `cgraphx sync` 刷新索引。');
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
choice = sel;
|
|
676
|
+
}
|
|
677
|
+
if (choice === 'manual') {
|
|
678
|
+
clack.log.info('Run `cgraphx sync` after changing files to refresh the index.');
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
const result = (0, git_hooks_1.installGitSyncHook)(projectPath);
|
|
682
|
+
if (result.installed.length > 0) {
|
|
683
|
+
clack.log.success(`Installed git ${result.installed.join(', ')} hook${result.installed.length > 1 ? 's' : ''} — ` +
|
|
684
|
+
'the index refreshes in the background after each.');
|
|
685
|
+
clack.log.info('Run `cgraphx sync` anytime to refresh immediately.');
|
|
686
|
+
}
|
|
687
|
+
else {
|
|
688
|
+
clack.log.warn(`Could not install git hooks${result.skipped ? ` (${result.skipped})` : ''}. ` +
|
|
689
|
+
'Run `cgraphx sync` after changes instead.');
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
//# sourceMappingURL=index.js.map
|