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,246 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
//
|
|
4
|
+
// npm thin-installer launcher for CodeGraph.
|
|
5
|
+
//
|
|
6
|
+
// The heavy artifact (a vendored Node runtime + the app) ships as a per-platform
|
|
7
|
+
// optionalDependency: cgraphx-<platform>-<arch>. npm installs
|
|
8
|
+
// only the one matching the host, via each package's `os`/`cpu` fields (the
|
|
9
|
+
// esbuild pattern). This shim — run by the user's OWN Node — locates that bundle
|
|
10
|
+
// and execs its launcher, so the real work always runs on the bundled Node 24
|
|
11
|
+
// (with node:sqlite), regardless of the user's Node version. The user's Node is
|
|
12
|
+
// only ever a launcher; even an ancient version can run this file.
|
|
13
|
+
//
|
|
14
|
+
// Self-heal (issue #303): some registries — notably the npmmirror/cnpm mirrors,
|
|
15
|
+
// and some corporate proxies — don't reliably mirror the per-platform
|
|
16
|
+
// optionalDependencies. npm treats an unfetchable optional dep as success and
|
|
17
|
+
// silently skips it, so the bundle goes missing and every command fails. When
|
|
18
|
+
// the installed bundle can't be resolved, this shim falls back to downloading
|
|
19
|
+
// the matching bundle straight from GitHub Releases — the very archive
|
|
20
|
+
// install.sh uses — into a cache dir, then runs that. Knobs:
|
|
21
|
+
// CGRAPHX_NO_DOWNLOAD=1 disable the network fallback (print guidance)
|
|
22
|
+
// CGRAPHX_INSTALL_DIR=DIR cache location (default: ~/.cgraphx)
|
|
23
|
+
// CGRAPHX_DOWNLOAD_BASE=URL release-download base (for mirrors/air-gapped)
|
|
24
|
+
//
|
|
25
|
+
// Wired up at release time as the main package's `bin`:
|
|
26
|
+
// "bin": { "cgraphx": "npm-shim.js" }
|
|
27
|
+
// with the platform packages listed in `optionalDependencies`.
|
|
28
|
+
|
|
29
|
+
var childProcess = require('child_process');
|
|
30
|
+
var fs = require('fs');
|
|
31
|
+
var os = require('os');
|
|
32
|
+
var path = require('path');
|
|
33
|
+
|
|
34
|
+
var target = process.platform + '-' + process.arch; // e.g. darwin-arm64, linux-x64
|
|
35
|
+
var pkg = 'cgraphx-' + target;
|
|
36
|
+
var isWindows = process.platform === 'win32';
|
|
37
|
+
var REPO = 'smdnkB/cgraphx';
|
|
38
|
+
|
|
39
|
+
main().catch(function (e) {
|
|
40
|
+
process.stderr.write('cgraphx: ' + (e && e.message ? e.message : String(e)) + '\n');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
async function main() {
|
|
45
|
+
// Happy path: the npm-installed optional dependency. Fall back to a download
|
|
46
|
+
// when the registry didn't deliver it.
|
|
47
|
+
var resolved = resolveInstalledBundle() || (await selfHealBundle());
|
|
48
|
+
var res = childProcess.spawnSync(resolved.command, resolved.args, { stdio: 'inherit' });
|
|
49
|
+
if (res.error) {
|
|
50
|
+
process.stderr.write('cgraphx: ' + res.error.message + '\n');
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
process.exit(res.status === null ? 1 : res.status);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Resolve the launcher from the installed per-platform optionalDependency.
|
|
57
|
+
// Returns {command, args} or null if the package isn't installed.
|
|
58
|
+
function resolveInstalledBundle() {
|
|
59
|
+
try {
|
|
60
|
+
if (isWindows) {
|
|
61
|
+
// Modern Node refuses to spawn the bundle's .cmd directly (EINVAL, the
|
|
62
|
+
// CVE-2024-27980 hardening on Node 24), so invoke the bundled node.exe
|
|
63
|
+
// against the app entry point and pass --liftoff-only here.
|
|
64
|
+
var nodeExe = require.resolve(pkg + '/node.exe');
|
|
65
|
+
var entry = require.resolve(pkg + '/lib/dist/bin/codegraph.js');
|
|
66
|
+
return { command: nodeExe, args: liftoff(entry) };
|
|
67
|
+
}
|
|
68
|
+
return { command: require.resolve(pkg + '/bin/cgraphx'), args: process.argv.slice(2) };
|
|
69
|
+
} catch (e) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Locate the launcher inside an extracted GitHub bundle directory (same
|
|
75
|
+
// node/lib/bin layout as the npm platform package). Returns {command, args} or
|
|
76
|
+
// null when the directory doesn't hold a usable bundle yet.
|
|
77
|
+
function launcherIn(dir) {
|
|
78
|
+
if (isWindows) {
|
|
79
|
+
var nodeExe = path.join(dir, 'node.exe');
|
|
80
|
+
var entry = path.join(dir, 'lib', 'dist', 'bin', 'codegraph.js');
|
|
81
|
+
if (fs.existsSync(nodeExe) && fs.existsSync(entry)) {
|
|
82
|
+
return { command: nodeExe, args: liftoff(entry) };
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
var launcher = path.join(dir, 'bin', 'cgraphx');
|
|
86
|
+
if (fs.existsSync(launcher)) return { command: launcher, args: process.argv.slice(2) };
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// --liftoff-only keeps tree-sitter's WASM grammars off V8's turboshaft tier to
|
|
92
|
+
// avoid the Zone OOM on Node >= 22 (issues #293/#298). The unix bin/cgraphx
|
|
93
|
+
// launcher already passes it; on Windows we invoke node.exe directly so add it.
|
|
94
|
+
function liftoff(entry) {
|
|
95
|
+
return ['--liftoff-only', entry].concat(process.argv.slice(2));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Download + cache the platform bundle from GitHub Releases. Returns
|
|
99
|
+
// {command, args}; exits the process with guidance if it can't.
|
|
100
|
+
async function selfHealBundle() {
|
|
101
|
+
var version = readVersion();
|
|
102
|
+
var bundlesDir = path.join(process.env.CGRAPHX_INSTALL_DIR || path.join(os.homedir(), '.cgraphx'), 'bundles');
|
|
103
|
+
var dest = path.join(bundlesDir, target + '-' + version);
|
|
104
|
+
|
|
105
|
+
// Already downloaded by a previous run? Use it even when downloads are
|
|
106
|
+
// disabled — CGRAPHX_NO_DOWNLOAD blocks fetching, not a cached bundle.
|
|
107
|
+
var cached = launcherIn(dest);
|
|
108
|
+
if (cached) return cached;
|
|
109
|
+
|
|
110
|
+
if (process.env.CGRAPHX_NO_DOWNLOAD) {
|
|
111
|
+
fail('the network fallback is disabled (CGRAPHX_NO_DOWNLOAD is set).');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
var asset = 'cgraphx-' + target + (isWindows ? '.zip' : '.tar.gz');
|
|
115
|
+
var base = process.env.CGRAPHX_DOWNLOAD_BASE || ('https://github.com/' + REPO + '/releases/download');
|
|
116
|
+
var url = base + '/v' + version + '/' + asset;
|
|
117
|
+
|
|
118
|
+
process.stderr.write(
|
|
119
|
+
'cgraphx: platform bundle missing (registry did not provide ' + pkg + ').\n' +
|
|
120
|
+
'cgraphx: downloading ' + asset + ' from GitHub Releases (' + version + ')...\n'
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
// Stage inside bundlesDir so the final rename is on the same filesystem (atomic,
|
|
124
|
+
// no EXDEV across tmpfs). Strip the archive's top-level cgraphx-<target>/ dir.
|
|
125
|
+
fs.mkdirSync(bundlesDir, { recursive: true });
|
|
126
|
+
var stage = fs.mkdtempSync(path.join(bundlesDir, '.dl-'));
|
|
127
|
+
try {
|
|
128
|
+
var archivePath = path.join(stage, asset);
|
|
129
|
+
await download(url, archivePath, 6);
|
|
130
|
+
await verifyChecksum(archivePath, asset, base, version);
|
|
131
|
+
var extracted = path.join(stage, 'bundle');
|
|
132
|
+
fs.mkdirSync(extracted);
|
|
133
|
+
extract(archivePath, extracted);
|
|
134
|
+
|
|
135
|
+
var raced = launcherIn(dest); // another process may have finished meanwhile
|
|
136
|
+
if (raced) { rmrf(stage); return raced; }
|
|
137
|
+
try {
|
|
138
|
+
fs.renameSync(extracted, dest);
|
|
139
|
+
} catch (e) {
|
|
140
|
+
var other = launcherIn(dest); // lost the race but theirs is valid
|
|
141
|
+
if (other) { rmrf(stage); return other; }
|
|
142
|
+
throw e;
|
|
143
|
+
}
|
|
144
|
+
} catch (e) {
|
|
145
|
+
rmrf(stage);
|
|
146
|
+
fail('download failed (' + e.message + ').\n URL: ' + url);
|
|
147
|
+
}
|
|
148
|
+
rmrf(stage);
|
|
149
|
+
|
|
150
|
+
var ready = launcherIn(dest);
|
|
151
|
+
if (!ready) fail('downloaded bundle is missing its launcher under ' + dest + '.');
|
|
152
|
+
process.stderr.write('cgraphx: bundle ready.\n');
|
|
153
|
+
return ready;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function readVersion() {
|
|
157
|
+
try {
|
|
158
|
+
return require(path.join(__dirname, 'package.json')).version;
|
|
159
|
+
} catch (e) {
|
|
160
|
+
fail('could not read this package\'s version to locate a matching release.');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// GET with manual redirect following (GitHub release URLs redirect to a CDN).
|
|
165
|
+
function download(url, dest, redirectsLeft) {
|
|
166
|
+
return new Promise(function (resolve, reject) {
|
|
167
|
+
var https = require('https');
|
|
168
|
+
// timeout is an idle/inactivity timeout — it won't kill a slow-but-progressing
|
|
169
|
+
// download, only a stalled connection (so a blocked mirror fails fast with
|
|
170
|
+
// guidance instead of hanging the user's command forever).
|
|
171
|
+
var req = https.get(url, { headers: { 'User-Agent': 'codegraph-npm-shim' }, timeout: 30000 }, function (res) {
|
|
172
|
+
var status = res.statusCode;
|
|
173
|
+
if (status >= 300 && status < 400 && res.headers.location) {
|
|
174
|
+
res.resume();
|
|
175
|
+
if (redirectsLeft <= 0) { reject(new Error('too many redirects')); return; }
|
|
176
|
+
download(new URL(res.headers.location, url).toString(), dest, redirectsLeft - 1).then(resolve, reject);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (status !== 200) { res.resume(); reject(new Error('HTTP ' + status)); return; }
|
|
180
|
+
var file = fs.createWriteStream(dest);
|
|
181
|
+
res.on('error', reject);
|
|
182
|
+
res.pipe(file);
|
|
183
|
+
file.on('error', reject);
|
|
184
|
+
file.on('finish', function () { file.close(function () { resolve(); }); });
|
|
185
|
+
});
|
|
186
|
+
req.on('timeout', function () { req.destroy(new Error('connection timed out')); });
|
|
187
|
+
req.on('error', reject);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Best-effort integrity check. When the release publishes a SHA256SUMS file, the
|
|
192
|
+
// downloaded archive MUST match its listed hash or we abort. When that file is
|
|
193
|
+
// absent (older releases) or simply unreachable, we proceed — the archive still
|
|
194
|
+
// arrived from GitHub over TLS. So tampering/corruption is caught, while a
|
|
195
|
+
// missing checksum never breaks an install.
|
|
196
|
+
async function verifyChecksum(archivePath, asset, base, version) {
|
|
197
|
+
var sumsPath = archivePath + '.SHA256SUMS';
|
|
198
|
+
try {
|
|
199
|
+
await download(base + '/v' + version + '/SHA256SUMS', sumsPath, 6);
|
|
200
|
+
} catch (e) {
|
|
201
|
+
return; // not published / unreachable → skip
|
|
202
|
+
}
|
|
203
|
+
var expected = null;
|
|
204
|
+
var lines = fs.readFileSync(sumsPath, 'utf8').split('\n');
|
|
205
|
+
for (var i = 0; i < lines.length; i++) {
|
|
206
|
+
var m = lines[i].trim().match(/^([0-9a-fA-F]{64})\s+\*?(.+)$/);
|
|
207
|
+
if (m && path.basename(m[2].trim()) === asset) { expected = m[1].toLowerCase(); break; }
|
|
208
|
+
}
|
|
209
|
+
if (!expected) return; // asset not listed → nothing to check
|
|
210
|
+
var actual = require('crypto').createHash('sha256').update(fs.readFileSync(archivePath)).digest('hex');
|
|
211
|
+
if (actual !== expected) {
|
|
212
|
+
throw new Error('checksum mismatch for ' + asset +
|
|
213
|
+
' (expected ' + expected.slice(0, 12) + '…, got ' + actual.slice(0, 12) + '…)');
|
|
214
|
+
}
|
|
215
|
+
process.stderr.write('cgraphx: checksum verified.\n');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Extract via the system tar — present on macOS, Linux, and Windows 10+
|
|
219
|
+
// (bsdtar reads .zip too). No third-party dependency in the shim.
|
|
220
|
+
function extract(archive, destDir) {
|
|
221
|
+
var args = isWindows
|
|
222
|
+
? ['-xf', archive, '-C', destDir, '--strip-components=1']
|
|
223
|
+
: ['-xzf', archive, '-C', destDir, '--strip-components=1'];
|
|
224
|
+
var res = childProcess.spawnSync('tar', args, { stdio: 'ignore' });
|
|
225
|
+
if (res.error) throw new Error('tar unavailable: ' + res.error.message);
|
|
226
|
+
if (res.status !== 0) throw new Error('tar exited ' + res.status);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function rmrf(p) {
|
|
230
|
+
try { fs.rmSync(p, { recursive: true, force: true }); } catch (e) { /* best effort */ }
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function fail(reason) {
|
|
234
|
+
process.stderr.write(
|
|
235
|
+
'cgraphx: no prebuilt bundle for ' + target + '.\n' +
|
|
236
|
+
(reason ? 'cgraphx: ' + reason + '\n' : '') +
|
|
237
|
+
'Expected the optional package ' + pkg + ' to be installed.\n' +
|
|
238
|
+
'A registry mirror (e.g. npmmirror/cnpm) that did not mirror the per-platform\n' +
|
|
239
|
+
'package is the usual cause. Fixes:\n' +
|
|
240
|
+
' - install from the official registry:\n' +
|
|
241
|
+
' npm i -g cgraphx --registry=https://registry.npmjs.org\n' +
|
|
242
|
+
' - or use the standalone installer (no Node required):\n' +
|
|
243
|
+
' curl -fsSL https://raw.githubusercontent.com/' + REPO + '/main/install.sh | sh\n'
|
|
244
|
+
);
|
|
245
|
+
process.exit(1);
|
|
246
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# Assemble the npm thin-installer packages from built bundles (esbuild pattern).
|
|
4
|
+
#
|
|
5
|
+
# Produces, under release/npm/:
|
|
6
|
+
# cgraphx-<target>/ one per built bundle — the vendored Node + app, tagged
|
|
7
|
+
# with os/cpu so npm installs only the matching one.
|
|
8
|
+
# main/ the cgraphx shim package: a tiny bin
|
|
9
|
+
# that execs the matching platform bundle, with every
|
|
10
|
+
# platform package in optionalDependencies.
|
|
11
|
+
#
|
|
12
|
+
# The release pipeline then `npm publish`es each dir. This does NOT touch the
|
|
13
|
+
# repo's package.json — the dev/from-source path keeps working; the *published*
|
|
14
|
+
# main package's shape is generated here.
|
|
15
|
+
#
|
|
16
|
+
# Prereq: run build-bundle.sh for each target first (release/cgraphx-*.tar.gz).
|
|
17
|
+
# Usage: scripts/pack-npm.sh [version] (default: version from package.json)
|
|
18
|
+
set -euo pipefail
|
|
19
|
+
|
|
20
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
21
|
+
VERSION="${1:-$(node -p "require('$ROOT/package.json').version")}"
|
|
22
|
+
REL="$ROOT/release"
|
|
23
|
+
NPM="$REL/npm"
|
|
24
|
+
|
|
25
|
+
rm -rf "$NPM"
|
|
26
|
+
mkdir -p "$NPM/main"
|
|
27
|
+
|
|
28
|
+
shopt -s nullglob
|
|
29
|
+
archives=("$REL"/cgraphx-*.tar.gz "$REL"/cgraphx-*.zip)
|
|
30
|
+
[ ${#archives[@]} -gt 0 ] || { echo "[pack-npm] no bundles in $REL — run build-bundle.sh first" >&2; exit 1; }
|
|
31
|
+
|
|
32
|
+
targets=()
|
|
33
|
+
for archive in "${archives[@]}"; do
|
|
34
|
+
fname="$(basename "$archive")"
|
|
35
|
+
case "$fname" in
|
|
36
|
+
*.tar.gz) base="${fname%.tar.gz}" ;; # cgraphx-<target>
|
|
37
|
+
*.zip) base="${fname%.zip}" ;;
|
|
38
|
+
esac
|
|
39
|
+
target="${base#cgraphx-}" # <target>, e.g. darwin-arm64 / win32-x64
|
|
40
|
+
os="${target%-*}" # darwin | linux | win32
|
|
41
|
+
arch="${target##*-}" # arm64 | x64
|
|
42
|
+
pkgdir="$NPM/$base"
|
|
43
|
+
mkdir -p "$pkgdir"
|
|
44
|
+
case "$fname" in
|
|
45
|
+
*.zip)
|
|
46
|
+
tmpx="$(mktemp -d)"
|
|
47
|
+
unzip -q "$archive" -d "$tmpx"
|
|
48
|
+
mv "$tmpx/cgraphx-${target}"/* "$pkgdir"/
|
|
49
|
+
rm -rf "$tmpx"
|
|
50
|
+
nodefile="node.exe"
|
|
51
|
+
;;
|
|
52
|
+
*)
|
|
53
|
+
tar -xzf "$archive" -C "$pkgdir" --strip-components=1
|
|
54
|
+
nodefile="node"
|
|
55
|
+
;;
|
|
56
|
+
esac
|
|
57
|
+
VERSION="$VERSION" TARGET="$target" OSV="$os" ARCHV="$arch" NODEFILE="$nodefile" \
|
|
58
|
+
node -e '
|
|
59
|
+
const fs=require("fs");
|
|
60
|
+
fs.writeFileSync(process.argv[1], JSON.stringify({
|
|
61
|
+
name: `cgraphx-${process.env.TARGET}`,
|
|
62
|
+
version: process.env.VERSION,
|
|
63
|
+
description: `CodeGraph self-contained bundle for ${process.env.TARGET}`,
|
|
64
|
+
os: [process.env.OSV], cpu: [process.env.ARCHV],
|
|
65
|
+
files: [process.env.NODEFILE, "lib", "bin"],
|
|
66
|
+
license: "MIT"
|
|
67
|
+
}, null, 2) + "\n");
|
|
68
|
+
' "$pkgdir/package.json"
|
|
69
|
+
targets+=("$target")
|
|
70
|
+
echo "[pack-npm] cgraphx-${target}@${VERSION}"
|
|
71
|
+
done
|
|
72
|
+
|
|
73
|
+
# Main shim package.
|
|
74
|
+
# npm-shim.js CLI/MCP launcher (execs the bundled Node) — the `bin`.
|
|
75
|
+
# npm-sdk.js programmatic/embedded entry (#354): re-exports the installed
|
|
76
|
+
# platform bundle's compiled library — the `main`.
|
|
77
|
+
# dist/ the .d.ts tree only (types). The runtime .js stays in the
|
|
78
|
+
# per-platform bundle so its deps aren't duplicated here.
|
|
79
|
+
cp "$ROOT/scripts/npm-shim.js" "$NPM/main/npm-shim.js"
|
|
80
|
+
cp "$ROOT/scripts/npm-sdk.js" "$NPM/main/npm-sdk.js"
|
|
81
|
+
[ -f "$ROOT/README.md" ] && cp "$ROOT/README.md" "$NPM/main/README.md"
|
|
82
|
+
|
|
83
|
+
# Ship the type declarations so `types`/`exports.types` resolve. Built from this
|
|
84
|
+
# same release, so they can't skew from the runtime npm-sdk.js re-exports.
|
|
85
|
+
[ -f "$ROOT/dist/index.d.ts" ] || ( echo "[pack-npm] building dist for .d.ts" >&2 && cd "$ROOT" && npm run build >/dev/null )
|
|
86
|
+
ROOT="$ROOT" DEST="$NPM/main" node -e '
|
|
87
|
+
const fs=require("fs"), path=require("path");
|
|
88
|
+
const src=path.join(process.env.ROOT,"dist"), dest=path.join(process.env.DEST,"dist");
|
|
89
|
+
fs.cpSync(src, dest, { recursive:true, filter(s){
|
|
90
|
+
try { return fs.statSync(s).isDirectory() || s.endsWith(".d.ts"); } catch (e) { return false; }
|
|
91
|
+
}});
|
|
92
|
+
'
|
|
93
|
+
|
|
94
|
+
VERSION="$VERSION" TARGETS="${targets[*]}" \
|
|
95
|
+
node -e '
|
|
96
|
+
const fs=require("fs");
|
|
97
|
+
const opt={};
|
|
98
|
+
for (const t of process.env.TARGETS.split(/\s+/).filter(Boolean))
|
|
99
|
+
opt[`cgraphx-${t}`]=process.env.VERSION;
|
|
100
|
+
fs.writeFileSync(process.argv[1], JSON.stringify({
|
|
101
|
+
name: `cgraphx`,
|
|
102
|
+
version: process.env.VERSION,
|
|
103
|
+
description: "Local-first code intelligence for AI agents (MCP). Self-contained — bundles its own runtime.",
|
|
104
|
+
bin: { cgraphx: "npm-shim.js" },
|
|
105
|
+
main: "npm-sdk.js",
|
|
106
|
+
types: "dist/index.d.ts",
|
|
107
|
+
exports: {
|
|
108
|
+
".": { types: "./dist/index.d.ts", default: "./npm-sdk.js" },
|
|
109
|
+
"./package.json": "./package.json"
|
|
110
|
+
},
|
|
111
|
+
optionalDependencies: opt,
|
|
112
|
+
files: ["npm-shim.js","npm-sdk.js","dist","README.md"],
|
|
113
|
+
license: "MIT"
|
|
114
|
+
}, null, 2) + "\n");
|
|
115
|
+
' "$NPM/main/package.json"
|
|
116
|
+
|
|
117
|
+
echo "[pack-npm] cgraphx@${VERSION} (${#targets[@]} platform packages in optionalDependencies)"
|
|
118
|
+
echo "[pack-npm] output: $NPM"
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Promote `## [Unreleased]` content into `## [<version>]` in CHANGELOG.md
|
|
4
|
+
* so the release.yml workflow's `extract-release-notes.mjs <version>` call
|
|
5
|
+
* picks up everything that landed since the last release.
|
|
6
|
+
*
|
|
7
|
+
* **Why this exists:** the release workflow used to do a literal
|
|
8
|
+
* `extract-release-notes.mjs <version>` lookup with an `[Unreleased]`
|
|
9
|
+
* fallback. The fallback only triggers if the `[<version>]` block
|
|
10
|
+
* doesn't exist at all — and in practice maintainers sometimes had a
|
|
11
|
+
* sparse `[<version>]` block pre-populated (e.g. one early fix
|
|
12
|
+
* documented before the rest of the work landed). The workflow then
|
|
13
|
+
* extracted that sparse block, ignoring the much larger `[Unreleased]`
|
|
14
|
+
* section above it — so the published release notes were missing most
|
|
15
|
+
* of what shipped. See v0.9.5 for the canonical post-mortem.
|
|
16
|
+
*
|
|
17
|
+
* **What it does**, idempotently:
|
|
18
|
+
*
|
|
19
|
+
* Case A — `[<version>]` does not exist yet:
|
|
20
|
+
* Rename the `[Unreleased]` header to `[<version>] - <YYYY-MM-DD>`
|
|
21
|
+
* and add a fresh empty `## [Unreleased]` block above it. This is
|
|
22
|
+
* the common case.
|
|
23
|
+
*
|
|
24
|
+
* Case B — `[<version>]` exists AND `[Unreleased]` has content:
|
|
25
|
+
* Merge `[Unreleased]`'s sub-sections (### Added / ### Fixed /
|
|
26
|
+
* ### Changed / ### Removed / ### Deprecated / ### Security) into
|
|
27
|
+
* the corresponding sub-sections of `[<version>]`. Unmatched
|
|
28
|
+
* sub-sections are appended to `[<version>]`. The `[Unreleased]`
|
|
29
|
+
* block is then emptied.
|
|
30
|
+
*
|
|
31
|
+
* Case C — `[Unreleased]` has no content:
|
|
32
|
+
* No-op. Exit 0. Re-runs of the workflow are safe.
|
|
33
|
+
*
|
|
34
|
+
* **Where the date comes from:** for Case A, `<YYYY-MM-DD>` is the
|
|
35
|
+
* UTC date at run time. Matches the existing CHANGELOG convention.
|
|
36
|
+
*
|
|
37
|
+
* **Usage:**
|
|
38
|
+
*
|
|
39
|
+
* node scripts/prepare-release.mjs # reads version from package.json
|
|
40
|
+
* node scripts/prepare-release.mjs 1.2.3 # explicit version
|
|
41
|
+
*
|
|
42
|
+
* **Output:**
|
|
43
|
+
*
|
|
44
|
+
* Writes CHANGELOG.md in place. Prints a summary line to stdout
|
|
45
|
+
* like `prepare-release: 0.9.5 — promoted 6 Unreleased entries`.
|
|
46
|
+
* Exits non-zero on parse failures.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
50
|
+
import { resolve } from 'node:path';
|
|
51
|
+
|
|
52
|
+
const CHANGELOG_PATH = resolve(process.cwd(), 'CHANGELOG.md');
|
|
53
|
+
|
|
54
|
+
function readPackageVersion() {
|
|
55
|
+
const pkg = JSON.parse(readFileSync(resolve(process.cwd(), 'package.json'), 'utf8'));
|
|
56
|
+
if (!pkg.version) throw new Error('package.json has no "version" field');
|
|
57
|
+
return pkg.version;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function todayUtcIsoDate() {
|
|
61
|
+
// YYYY-MM-DD in UTC. Matches the CHANGELOG's existing convention
|
|
62
|
+
// (the existing dated entries don't disclose a timezone, but UTC is
|
|
63
|
+
// stable across runners and is what the workflow's runner produces
|
|
64
|
+
// by default anyway).
|
|
65
|
+
return new Date().toISOString().slice(0, 10);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Split the CHANGELOG into a header preface + an ordered list of
|
|
70
|
+
* version blocks `{ header, body[] }`, preserving line content
|
|
71
|
+
* verbatim so we can re-join without surprises.
|
|
72
|
+
*/
|
|
73
|
+
function parseChangelog(text) {
|
|
74
|
+
const lines = text.split('\n');
|
|
75
|
+
const versionHeaderRe = /^## \[([^\]]+)\](?:\s+-\s+(.+))?\s*$/;
|
|
76
|
+
const preface = [];
|
|
77
|
+
const blocks = []; // { header: string, name: string, body: string[] }
|
|
78
|
+
let cur = null;
|
|
79
|
+
for (const line of lines) {
|
|
80
|
+
const m = line.match(versionHeaderRe);
|
|
81
|
+
if (m) {
|
|
82
|
+
if (cur) blocks.push(cur);
|
|
83
|
+
cur = { header: line, name: m[1], date: m[2] ?? null, body: [] };
|
|
84
|
+
} else if (cur) {
|
|
85
|
+
cur.body.push(line);
|
|
86
|
+
} else {
|
|
87
|
+
preface.push(line);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (cur) blocks.push(cur);
|
|
91
|
+
return { preface, blocks };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function joinChangelog({ preface, blocks }) {
|
|
95
|
+
const parts = [preface.join('\n')];
|
|
96
|
+
for (const b of blocks) {
|
|
97
|
+
// Reconstruct: header + body. The block body INCLUDES the blank
|
|
98
|
+
// line after the header (it was captured verbatim).
|
|
99
|
+
parts.push([b.header, ...b.body].join('\n'));
|
|
100
|
+
}
|
|
101
|
+
return parts.join('\n');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Split a block body into ordered sub-sections keyed by their
|
|
106
|
+
* `### Heading`. Lines before the first `### Heading` go in
|
|
107
|
+
* `leading`. Preserves the original (line-array) body inside each
|
|
108
|
+
* sub-section so we can splice cleanly when merging.
|
|
109
|
+
*/
|
|
110
|
+
function splitSubsections(body) {
|
|
111
|
+
const subsectionRe = /^### (\w+)\s*$/;
|
|
112
|
+
const leading = [];
|
|
113
|
+
const subs = []; // { heading: 'Added' | 'Fixed' | …, headerLine: string, body: string[] }
|
|
114
|
+
let cur = null;
|
|
115
|
+
for (const line of body) {
|
|
116
|
+
const m = line.match(subsectionRe);
|
|
117
|
+
if (m) {
|
|
118
|
+
if (cur) subs.push(cur);
|
|
119
|
+
cur = { heading: m[1], headerLine: line, body: [] };
|
|
120
|
+
} else if (cur) {
|
|
121
|
+
cur.body.push(line);
|
|
122
|
+
} else {
|
|
123
|
+
leading.push(line);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (cur) subs.push(cur);
|
|
127
|
+
return { leading, subs };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function rebuildBody({ leading, subs }) {
|
|
131
|
+
const parts = [];
|
|
132
|
+
if (leading.length) parts.push(leading.join('\n'));
|
|
133
|
+
for (const s of subs) {
|
|
134
|
+
parts.push([s.headerLine, ...s.body].join('\n'));
|
|
135
|
+
}
|
|
136
|
+
return parts.join('\n').split('\n');
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Return true when the block has any meaningful entries (a bullet line
|
|
141
|
+
* starting with `-`, `*`, or a digit) — vs. being empty / just
|
|
142
|
+
* whitespace / just sub-section headers with nothing under them.
|
|
143
|
+
*/
|
|
144
|
+
function blockHasContent(body) {
|
|
145
|
+
for (const line of body) {
|
|
146
|
+
if (/^\s*([-*]|\d+\.)\s+/.test(line)) return true;
|
|
147
|
+
}
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Trim trailing blank lines from an array of lines, then return.
|
|
153
|
+
* Keeps the output tidy when merging.
|
|
154
|
+
*/
|
|
155
|
+
function trimTrailingBlank(arr) {
|
|
156
|
+
let i = arr.length;
|
|
157
|
+
while (i > 0 && /^\s*$/.test(arr[i - 1])) i--;
|
|
158
|
+
return arr.slice(0, i);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function main() {
|
|
162
|
+
const versionArg = process.argv[2];
|
|
163
|
+
const version = versionArg || readPackageVersion();
|
|
164
|
+
|
|
165
|
+
const text = readFileSync(CHANGELOG_PATH, 'utf8');
|
|
166
|
+
const parsed = parseChangelog(text);
|
|
167
|
+
|
|
168
|
+
const unrelIdx = parsed.blocks.findIndex((b) => b.name === 'Unreleased');
|
|
169
|
+
const verIdx = parsed.blocks.findIndex((b) => b.name === version);
|
|
170
|
+
|
|
171
|
+
if (unrelIdx === -1) {
|
|
172
|
+
console.log(`prepare-release: no [Unreleased] block — nothing to do`);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const unrel = parsed.blocks[unrelIdx];
|
|
177
|
+
if (!blockHasContent(unrel.body)) {
|
|
178
|
+
console.log(`prepare-release: [Unreleased] is empty — nothing to do`);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (verIdx === -1) {
|
|
183
|
+
// Case A — promote Unreleased → [version].
|
|
184
|
+
const today = todayUtcIsoDate();
|
|
185
|
+
const promoted = {
|
|
186
|
+
header: `## [${version}] - ${today}`,
|
|
187
|
+
name: version,
|
|
188
|
+
date: today,
|
|
189
|
+
body: trimTrailingBlank(unrel.body).concat(['']), // single trailing blank
|
|
190
|
+
};
|
|
191
|
+
const emptied = {
|
|
192
|
+
header: `## [Unreleased]`,
|
|
193
|
+
name: 'Unreleased',
|
|
194
|
+
date: null,
|
|
195
|
+
body: ['', ''], // two blank lines for the next round of entries
|
|
196
|
+
};
|
|
197
|
+
parsed.blocks.splice(unrelIdx, 1, emptied, promoted);
|
|
198
|
+
const next = joinChangelog(parsed);
|
|
199
|
+
writeFileSync(CHANGELOG_PATH, appendLinkRef(next, version));
|
|
200
|
+
console.log(`prepare-release: ${version} — renamed [Unreleased] to [${version}] - ${today}`);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Case B — merge Unreleased sub-sections into the existing
|
|
205
|
+
// [version] sub-sections. New sub-section headings encountered in
|
|
206
|
+
// Unreleased that don't exist in [version] get appended.
|
|
207
|
+
const ver = parsed.blocks[verIdx];
|
|
208
|
+
const unrelSubs = splitSubsections(unrel.body);
|
|
209
|
+
const verSubs = splitSubsections(ver.body);
|
|
210
|
+
|
|
211
|
+
let merged = 0;
|
|
212
|
+
for (const us of unrelSubs.subs) {
|
|
213
|
+
const target = verSubs.subs.find((s) => s.heading === us.heading);
|
|
214
|
+
const usBody = trimTrailingBlank(us.body);
|
|
215
|
+
if (usBody.length === 0) continue;
|
|
216
|
+
if (target) {
|
|
217
|
+
// Append Unreleased's entries to the end of the version's matching
|
|
218
|
+
// sub-section, keeping their original ordering. Insert a separating
|
|
219
|
+
// blank line if the existing sub-section doesn't already end in one.
|
|
220
|
+
const existing = trimTrailingBlank(target.body);
|
|
221
|
+
const sep = existing.length && !/^\s*$/.test(existing[existing.length - 1]) ? [''] : [];
|
|
222
|
+
target.body = existing.concat(sep, usBody, ['']);
|
|
223
|
+
} else {
|
|
224
|
+
// Append the whole sub-section to the end.
|
|
225
|
+
verSubs.subs.push({
|
|
226
|
+
heading: us.heading,
|
|
227
|
+
headerLine: us.headerLine,
|
|
228
|
+
body: usBody.concat(['']),
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
merged += usBody.filter((l) => /^\s*([-*]|\d+\.)\s+/.test(l)).length;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
ver.body = rebuildBody(verSubs);
|
|
235
|
+
// Empty out Unreleased.
|
|
236
|
+
unrel.body = ['', ''];
|
|
237
|
+
|
|
238
|
+
const merged_text = joinChangelog(parsed);
|
|
239
|
+
writeFileSync(CHANGELOG_PATH, appendLinkRef(merged_text, version));
|
|
240
|
+
console.log(`prepare-release: ${version} — merged ${merged} Unreleased entries into existing [${version}] block`);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Append a `[X.Y.Z]: https://github.com/smdnkB/cgraphx/releases/tag/vX.Y.Z`
|
|
245
|
+
* link reference at the end of the file IF one doesn't already exist. The
|
|
246
|
+
* link ref is what makes `## [X.Y.Z]` heading text auto-link to its tag in
|
|
247
|
+
* GitHub's renderer; without it the heading still renders, just unlinked.
|
|
248
|
+
*
|
|
249
|
+
* Idempotent. The existing CHANGELOG mixes link refs scattered through the
|
|
250
|
+
* file and a sorted block at the bottom — we just append at the very end,
|
|
251
|
+
* which CommonMark accepts regardless.
|
|
252
|
+
*/
|
|
253
|
+
function appendLinkRef(text, version) {
|
|
254
|
+
const refLine = `[${version}]: https://github.com/smdnkB/cgraphx/releases/tag/v${version}`;
|
|
255
|
+
// Already there? Look for a line that EQUALS this (anywhere in the file)
|
|
256
|
+
// to keep idempotency robust against the scattered-vs-block layout.
|
|
257
|
+
const lines = text.split('\n');
|
|
258
|
+
if (lines.some((l) => l.trim() === refLine)) return text;
|
|
259
|
+
// Append, separated by a blank line from the prior content. Preserve a
|
|
260
|
+
// single trailing newline at EOF.
|
|
261
|
+
const trailingNewline = text.endsWith('\n') ? '' : '\n';
|
|
262
|
+
return text + trailingNewline + refLine + '\n';
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
try {
|
|
266
|
+
main();
|
|
267
|
+
} catch (err) {
|
|
268
|
+
console.error(`prepare-release: ${err?.message ?? err}`);
|
|
269
|
+
process.exit(1);
|
|
270
|
+
}
|