@isaacriehm/cairn-core 0.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/dist/.tsbuildinfo +1 -0
- package/dist/claude/error.d.ts +33 -0
- package/dist/claude/error.js +58 -0
- package/dist/claude/error.js.map +1 -0
- package/dist/claude/index.d.ts +3 -0
- package/dist/claude/index.js +3 -0
- package/dist/claude/index.js.map +1 -0
- package/dist/claude/runner.d.ts +11 -0
- package/dist/claude/runner.js +132 -0
- package/dist/claude/runner.js.map +1 -0
- package/dist/claude/types.d.ts +52 -0
- package/dist/claude/types.js +14 -0
- package/dist/claude/types.js.map +1 -0
- package/dist/context/checkpoint.d.ts +10 -0
- package/dist/context/checkpoint.js +29 -0
- package/dist/context/checkpoint.js.map +1 -0
- package/dist/context/handoff-builder.d.ts +11 -0
- package/dist/context/handoff-builder.js +268 -0
- package/dist/context/handoff-builder.js.map +1 -0
- package/dist/context/index.d.ts +11 -0
- package/dist/context/index.js +11 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/spec-delta.d.ts +47 -0
- package/dist/context/spec-delta.js +237 -0
- package/dist/context/spec-delta.js.map +1 -0
- package/dist/decision-capture/capture.d.ts +57 -0
- package/dist/decision-capture/capture.js +186 -0
- package/dist/decision-capture/capture.js.map +1 -0
- package/dist/decision-capture/extractor.d.ts +20 -0
- package/dist/decision-capture/extractor.js +103 -0
- package/dist/decision-capture/extractor.js.map +1 -0
- package/dist/decision-capture/id.d.ts +21 -0
- package/dist/decision-capture/id.js +60 -0
- package/dist/decision-capture/id.js.map +1 -0
- package/dist/decision-capture/index.d.ts +25 -0
- package/dist/decision-capture/index.js +21 -0
- package/dist/decision-capture/index.js.map +1 -0
- package/dist/decision-capture/prompt.d.ts +15 -0
- package/dist/decision-capture/prompt.js +68 -0
- package/dist/decision-capture/prompt.js.map +1 -0
- package/dist/decision-capture/refinement-prompt.d.ts +25 -0
- package/dist/decision-capture/refinement-prompt.js +146 -0
- package/dist/decision-capture/refinement-prompt.js.map +1 -0
- package/dist/decision-capture/refinement-schema.d.ts +52 -0
- package/dist/decision-capture/refinement-schema.js +61 -0
- package/dist/decision-capture/refinement-schema.js.map +1 -0
- package/dist/decision-capture/refinement.d.ts +60 -0
- package/dist/decision-capture/refinement.js +439 -0
- package/dist/decision-capture/refinement.js.map +1 -0
- package/dist/decision-capture/schema.d.ts +70 -0
- package/dist/decision-capture/schema.js +71 -0
- package/dist/decision-capture/schema.js.map +1 -0
- package/dist/decision-capture/types.d.ts +201 -0
- package/dist/decision-capture/types.js +20 -0
- package/dist/decision-capture/types.js.map +1 -0
- package/dist/decision-capture/writer.d.ts +90 -0
- package/dist/decision-capture/writer.js +267 -0
- package/dist/decision-capture/writer.js.map +1 -0
- package/dist/doctor/index.d.ts +48 -0
- package/dist/doctor/index.js +460 -0
- package/dist/doctor/index.js.map +1 -0
- package/dist/events/index.d.ts +15 -0
- package/dist/events/index.js +14 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/paths.d.ts +2 -0
- package/dist/events/paths.js +6 -0
- package/dist/events/paths.js.map +1 -0
- package/dist/events/reader.d.ts +40 -0
- package/dist/events/reader.js +139 -0
- package/dist/events/reader.js.map +1 -0
- package/dist/events/writer.d.ts +61 -0
- package/dist/events/writer.js +68 -0
- package/dist/events/writer.js.map +1 -0
- package/dist/frontend-types.d.ts +243 -0
- package/dist/frontend-types.js +15 -0
- package/dist/frontend-types.js.map +1 -0
- package/dist/gc/apply.d.ts +26 -0
- package/dist/gc/apply.js +48 -0
- package/dist/gc/apply.js.map +1 -0
- package/dist/gc/canary.d.ts +42 -0
- package/dist/gc/canary.js +134 -0
- package/dist/gc/canary.js.map +1 -0
- package/dist/gc/citation-integrity.d.ts +24 -0
- package/dist/gc/citation-integrity.js +151 -0
- package/dist/gc/citation-integrity.js.map +1 -0
- package/dist/gc/classify.d.ts +25 -0
- package/dist/gc/classify.js +89 -0
- package/dist/gc/classify.js.map +1 -0
- package/dist/gc/completion-integrity.d.ts +22 -0
- package/dist/gc/completion-integrity.js +165 -0
- package/dist/gc/completion-integrity.js.map +1 -0
- package/dist/gc/doc-gardening.d.ts +29 -0
- package/dist/gc/doc-gardening.js +146 -0
- package/dist/gc/doc-gardening.js.map +1 -0
- package/dist/gc/frontmatter.d.ts +35 -0
- package/dist/gc/frontmatter.js +105 -0
- package/dist/gc/frontmatter.js.map +1 -0
- package/dist/gc/generator-drift.d.ts +28 -0
- package/dist/gc/generator-drift.js +53 -0
- package/dist/gc/generator-drift.js.map +1 -0
- package/dist/gc/index.d.ts +42 -0
- package/dist/gc/index.js +30 -0
- package/dist/gc/index.js.map +1 -0
- package/dist/gc/quality-update.d.ts +23 -0
- package/dist/gc/quality-update.js +69 -0
- package/dist/gc/quality-update.js.map +1 -0
- package/dist/gc/scope-coverage.d.ts +20 -0
- package/dist/gc/scope-coverage.js +70 -0
- package/dist/gc/scope-coverage.js.map +1 -0
- package/dist/gc/stub-hits.d.ts +31 -0
- package/dist/gc/stub-hits.js +78 -0
- package/dist/gc/stub-hits.js.map +1 -0
- package/dist/gc/sweep.d.ts +56 -0
- package/dist/gc/sweep.js +205 -0
- package/dist/gc/sweep.js.map +1 -0
- package/dist/gc/types.d.ts +129 -0
- package/dist/gc/types.js +26 -0
- package/dist/gc/types.js.map +1 -0
- package/dist/gc/walk-source.d.ts +14 -0
- package/dist/gc/walk-source.js +59 -0
- package/dist/gc/walk-source.js.map +1 -0
- package/dist/ground/drift.d.ts +8 -0
- package/dist/ground/drift.js +23 -0
- package/dist/ground/drift.js.map +1 -0
- package/dist/ground/frontmatter.d.ts +20 -0
- package/dist/ground/frontmatter.js +49 -0
- package/dist/ground/frontmatter.js.map +1 -0
- package/dist/ground/glob.d.ts +10 -0
- package/dist/ground/glob.js +46 -0
- package/dist/ground/glob.js.map +1 -0
- package/dist/ground/index.d.ts +16 -0
- package/dist/ground/index.js +11 -0
- package/dist/ground/index.js.map +1 -0
- package/dist/ground/ledgers.d.ts +18 -0
- package/dist/ground/ledgers.js +103 -0
- package/dist/ground/ledgers.js.map +1 -0
- package/dist/ground/manifest.d.ts +10 -0
- package/dist/ground/manifest.js +88 -0
- package/dist/ground/manifest.js.map +1 -0
- package/dist/ground/paths.d.ts +20 -0
- package/dist/ground/paths.js +61 -0
- package/dist/ground/paths.js.map +1 -0
- package/dist/ground/quality-grades.d.ts +11 -0
- package/dist/ground/quality-grades.js +98 -0
- package/dist/ground/quality-grades.js.map +1 -0
- package/dist/ground/schemas.d.ts +306 -0
- package/dist/ground/schemas.js +188 -0
- package/dist/ground/schemas.js.map +1 -0
- package/dist/ground/scope-index.d.ts +48 -0
- package/dist/ground/scope-index.js +120 -0
- package/dist/ground/scope-index.js.map +1 -0
- package/dist/ground/walk.d.ts +7 -0
- package/dist/ground/walk.js +53 -0
- package/dist/ground/walk.js.map +1 -0
- package/dist/hooks/bypass-detection.d.ts +28 -0
- package/dist/hooks/bypass-detection.js +106 -0
- package/dist/hooks/bypass-detection.js.map +1 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/index.js +13 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/post-tool-use/allowlist-reader.d.ts +14 -0
- package/dist/hooks/post-tool-use/allowlist-reader.js +69 -0
- package/dist/hooks/post-tool-use/allowlist-reader.js.map +1 -0
- package/dist/hooks/post-tool-use/citation-scanner.d.ts +23 -0
- package/dist/hooks/post-tool-use/citation-scanner.js +59 -0
- package/dist/hooks/post-tool-use/citation-scanner.js.map +1 -0
- package/dist/hooks/post-tool-use/copy-scanner.d.ts +25 -0
- package/dist/hooks/post-tool-use/copy-scanner.js +192 -0
- package/dist/hooks/post-tool-use/copy-scanner.js.map +1 -0
- package/dist/hooks/post-tool-use/index.d.ts +19 -0
- package/dist/hooks/post-tool-use/index.js +15 -0
- package/dist/hooks/post-tool-use/index.js.map +1 -0
- package/dist/hooks/post-tool-use/ledger-cache.d.ts +32 -0
- package/dist/hooks/post-tool-use/ledger-cache.js +236 -0
- package/dist/hooks/post-tool-use/ledger-cache.js.map +1 -0
- package/dist/hooks/post-tool-use/legend-builder.d.ts +15 -0
- package/dist/hooks/post-tool-use/legend-builder.js +84 -0
- package/dist/hooks/post-tool-use/legend-builder.js.map +1 -0
- package/dist/hooks/post-tool-use/read-enricher.d.ts +13 -0
- package/dist/hooks/post-tool-use/read-enricher.js +157 -0
- package/dist/hooks/post-tool-use/read-enricher.js.map +1 -0
- package/dist/hooks/post-tool-use/write-guardian.d.ts +17 -0
- package/dist/hooks/post-tool-use/write-guardian.js +176 -0
- package/dist/hooks/post-tool-use/write-guardian.js.map +1 -0
- package/dist/hooks/read-enrich.d.ts +6 -0
- package/dist/hooks/read-enrich.js +11 -0
- package/dist/hooks/read-enrich.js.map +1 -0
- package/dist/hooks/runners/index.d.ts +12 -0
- package/dist/hooks/runners/index.js +11 -0
- package/dist/hooks/runners/index.js.map +1 -0
- package/dist/hooks/runners/payload.d.ts +32 -0
- package/dist/hooks/runners/payload.js +70 -0
- package/dist/hooks/runners/payload.js.map +1 -0
- package/dist/hooks/runners/session-end.d.ts +7 -0
- package/dist/hooks/runners/session-end.js +42 -0
- package/dist/hooks/runners/session-end.js.map +1 -0
- package/dist/hooks/runners/session-start.d.ts +10 -0
- package/dist/hooks/runners/session-start.js +167 -0
- package/dist/hooks/runners/session-start.js.map +1 -0
- package/dist/hooks/runners/stop.d.ts +18 -0
- package/dist/hooks/runners/stop.js +165 -0
- package/dist/hooks/runners/stop.js.map +1 -0
- package/dist/hooks/session-end.d.ts +5 -0
- package/dist/hooks/session-end.js +10 -0
- package/dist/hooks/session-end.js.map +1 -0
- package/dist/hooks/session-start.d.ts +7 -0
- package/dist/hooks/session-start.js +12 -0
- package/dist/hooks/session-start.js.map +1 -0
- package/dist/hooks/stop.d.ts +5 -0
- package/dist/hooks/stop.js +10 -0
- package/dist/hooks/stop.js.map +1 -0
- package/dist/hooks/write-guard.d.ts +6 -0
- package/dist/hooks/write-guard.js +11 -0
- package/dist/hooks/write-guard.js.map +1 -0
- package/dist/inbox.d.ts +17 -0
- package/dist/inbox.js +30 -0
- package/dist/inbox.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/init/baseline-audit.d.ts +71 -0
- package/dist/init/baseline-audit.js +377 -0
- package/dist/init/baseline-audit.js.map +1 -0
- package/dist/init/brand-setup.d.ts +44 -0
- package/dist/init/brand-setup.js +201 -0
- package/dist/init/brand-setup.js.map +1 -0
- package/dist/init/daemon-autostart.d.ts +16 -0
- package/dist/init/daemon-autostart.js +95 -0
- package/dist/init/daemon-autostart.js.map +1 -0
- package/dist/init/detect.d.ts +25 -0
- package/dist/init/detect.js +319 -0
- package/dist/init/detect.js.map +1 -0
- package/dist/init/index.d.ts +32 -0
- package/dist/init/index.js +18 -0
- package/dist/init/index.js.map +1 -0
- package/dist/init/ingest-docs.d.ts +74 -0
- package/dist/init/ingest-docs.js +499 -0
- package/dist/init/ingest-docs.js.map +1 -0
- package/dist/init/init.d.ts +165 -0
- package/dist/init/init.js +1166 -0
- package/dist/init/init.js.map +1 -0
- package/dist/init/mapper-legacy.d.ts +148 -0
- package/dist/init/mapper-legacy.js +238 -0
- package/dist/init/mapper-legacy.js.map +1 -0
- package/dist/init/mapper-merge.d.ts +38 -0
- package/dist/init/mapper-merge.js +238 -0
- package/dist/init/mapper-merge.js.map +1 -0
- package/dist/init/mapper-parallel.d.ts +48 -0
- package/dist/init/mapper-parallel.js +409 -0
- package/dist/init/mapper-parallel.js.map +1 -0
- package/dist/init/mapper-prompts.d.ts +135 -0
- package/dist/init/mapper-prompts.js +189 -0
- package/dist/init/mapper-prompts.js.map +1 -0
- package/dist/init/mapper.d.ts +211 -0
- package/dist/init/mapper.js +151 -0
- package/dist/init/mapper.js.map +1 -0
- package/dist/init/module-slicer.d.ts +39 -0
- package/dist/init/module-slicer.js +809 -0
- package/dist/init/module-slicer.js.map +1 -0
- package/dist/init/multi-dev/index.d.ts +2 -0
- package/dist/init/multi-dev/index.js +2 -0
- package/dist/init/multi-dev/index.js.map +1 -0
- package/dist/init/multi-dev/install.d.ts +40 -0
- package/dist/init/multi-dev/install.js +139 -0
- package/dist/init/multi-dev/install.js.map +1 -0
- package/dist/init/preflight-guards.d.ts +42 -0
- package/dist/init/preflight-guards.js +108 -0
- package/dist/init/preflight-guards.js.map +1 -0
- package/dist/init/prompts.d.ts +61 -0
- package/dist/init/prompts.js +66 -0
- package/dist/init/prompts.js.map +1 -0
- package/dist/init/rules-merge/discover.d.ts +21 -0
- package/dist/init/rules-merge/discover.js +78 -0
- package/dist/init/rules-merge/discover.js.map +1 -0
- package/dist/init/rules-merge/index.d.ts +10 -0
- package/dist/init/rules-merge/index.js +6 -0
- package/dist/init/rules-merge/index.js.map +1 -0
- package/dist/init/rules-merge/ingest.d.ts +56 -0
- package/dist/init/rules-merge/ingest.js +336 -0
- package/dist/init/rules-merge/ingest.js.map +1 -0
- package/dist/init/rules-merge/keep-markers.d.ts +39 -0
- package/dist/init/rules-merge/keep-markers.js +97 -0
- package/dist/init/rules-merge/keep-markers.js.map +1 -0
- package/dist/init/rules-merge/parse-sections.d.ts +24 -0
- package/dist/init/rules-merge/parse-sections.js +71 -0
- package/dist/init/rules-merge/parse-sections.js.map +1 -0
- package/dist/init/rules-merge/regenerate.d.ts +33 -0
- package/dist/init/rules-merge/regenerate.js +163 -0
- package/dist/init/rules-merge/regenerate.js.map +1 -0
- package/dist/init/secrets.d.ts +18 -0
- package/dist/init/secrets.js +76 -0
- package/dist/init/secrets.js.map +1 -0
- package/dist/init/seed.d.ts +21 -0
- package/dist/init/seed.js +96 -0
- package/dist/init/seed.js.map +1 -0
- package/dist/init/setup-runners.d.ts +15 -0
- package/dist/init/setup-runners.js +143 -0
- package/dist/init/setup-runners.js.map +1 -0
- package/dist/init/source-comments/classify.d.ts +98 -0
- package/dist/init/source-comments/classify.js +244 -0
- package/dist/init/source-comments/classify.js.map +1 -0
- package/dist/init/source-comments/index.d.ts +8 -0
- package/dist/init/source-comments/index.js +5 -0
- package/dist/init/source-comments/index.js.map +1 -0
- package/dist/init/source-comments/ingest.d.ts +51 -0
- package/dist/init/source-comments/ingest.js +236 -0
- package/dist/init/source-comments/ingest.js.map +1 -0
- package/dist/init/source-comments/strip-replace.d.ts +106 -0
- package/dist/init/source-comments/strip-replace.js +284 -0
- package/dist/init/source-comments/strip-replace.js.map +1 -0
- package/dist/init/source-comments/walker.d.ts +65 -0
- package/dist/init/source-comments/walker.js +777 -0
- package/dist/init/source-comments/walker.js.map +1 -0
- package/dist/init/submodules.d.ts +48 -0
- package/dist/init/submodules.js +149 -0
- package/dist/init/submodules.js.map +1 -0
- package/dist/init/types.d.ts +55 -0
- package/dist/init/types.js +10 -0
- package/dist/init/types.js.map +1 -0
- package/dist/init/visual.d.ts +69 -0
- package/dist/init/visual.js +265 -0
- package/dist/init/visual.js.map +1 -0
- package/dist/init/walker.d.ts +82 -0
- package/dist/init/walker.js +585 -0
- package/dist/init/walker.js.map +1 -0
- package/dist/init/workflow-block.d.ts +34 -0
- package/dist/init/workflow-block.js +110 -0
- package/dist/init/workflow-block.js.map +1 -0
- package/dist/join/index.d.ts +67 -0
- package/dist/join/index.js +256 -0
- package/dist/join/index.js.map +1 -0
- package/dist/lock.d.ts +39 -0
- package/dist/lock.js +129 -0
- package/dist/lock.js.map +1 -0
- package/dist/logger.d.ts +13 -0
- package/dist/logger.js +78 -0
- package/dist/logger.js.map +1 -0
- package/dist/mcp/bootstrap-guard.d.ts +29 -0
- package/dist/mcp/bootstrap-guard.js +47 -0
- package/dist/mcp/bootstrap-guard.js.map +1 -0
- package/dist/mcp/context.d.ts +23 -0
- package/dist/mcp/context.js +9 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/errors.d.ts +17 -0
- package/dist/mcp/errors.js +23 -0
- package/dist/mcp/errors.js.map +1 -0
- package/dist/mcp/history/index.d.ts +6 -0
- package/dist/mcp/history/index.js +5 -0
- package/dist/mcp/history/index.js.map +1 -0
- package/dist/mcp/history/prompt.d.ts +32 -0
- package/dist/mcp/history/prompt.js +99 -0
- package/dist/mcp/history/prompt.js.map +1 -0
- package/dist/mcp/history/schema.d.ts +58 -0
- package/dist/mcp/history/schema.js +41 -0
- package/dist/mcp/history/schema.js.map +1 -0
- package/dist/mcp/history/summarizer.d.ts +81 -0
- package/dist/mcp/history/summarizer.js +196 -0
- package/dist/mcp/history/summarizer.js.map +1 -0
- package/dist/mcp/history/walker.d.ts +57 -0
- package/dist/mcp/history/walker.js +156 -0
- package/dist/mcp/history/walker.js.map +1 -0
- package/dist/mcp/index.d.ts +13 -0
- package/dist/mcp/index.js +9 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/path-allowlist.d.ts +29 -0
- package/dist/mcp/path-allowlist.js +71 -0
- package/dist/mcp/path-allowlist.js.map +1 -0
- package/dist/mcp/result.d.ts +8 -0
- package/dist/mcp/result.js +18 -0
- package/dist/mcp/result.js.map +1 -0
- package/dist/mcp/schemas.d.ts +192 -0
- package/dist/mcp/schemas.js +174 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/serve.d.ts +15 -0
- package/dist/mcp/serve.js +71 -0
- package/dist/mcp/serve.js.map +1 -0
- package/dist/mcp/server.d.ts +11 -0
- package/dist/mcp/server.js +58 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/telemetry.d.ts +15 -0
- package/dist/mcp/telemetry.js +13 -0
- package/dist/mcp/telemetry.js.map +1 -0
- package/dist/mcp/tools/append-run-note.d.ts +18 -0
- package/dist/mcp/tools/append-run-note.js +47 -0
- package/dist/mcp/tools/append-run-note.js.map +1 -0
- package/dist/mcp/tools/append.d.ts +8 -0
- package/dist/mcp/tools/append.js +37 -0
- package/dist/mcp/tools/append.js.map +1 -0
- package/dist/mcp/tools/archive.d.ts +8 -0
- package/dist/mcp/tools/archive.js +72 -0
- package/dist/mcp/tools/archive.js.map +1 -0
- package/dist/mcp/tools/ask-operator.d.ts +34 -0
- package/dist/mcp/tools/ask-operator.js +97 -0
- package/dist/mcp/tools/ask-operator.js.map +1 -0
- package/dist/mcp/tools/canonical-for-topic.d.ts +6 -0
- package/dist/mcp/tools/canonical-for-topic.js +40 -0
- package/dist/mcp/tools/canonical-for-topic.js.map +1 -0
- package/dist/mcp/tools/decision-get.d.ts +6 -0
- package/dist/mcp/tools/decision-get.js +49 -0
- package/dist/mcp/tools/decision-get.js.map +1 -0
- package/dist/mcp/tools/decisions-for-symbol.d.ts +7 -0
- package/dist/mcp/tools/decisions-for-symbol.js +42 -0
- package/dist/mcp/tools/decisions-for-symbol.js.map +1 -0
- package/dist/mcp/tools/decisions-in-scope.d.ts +7 -0
- package/dist/mcp/tools/decisions-in-scope.js +47 -0
- package/dist/mcp/tools/decisions-in-scope.js.map +1 -0
- package/dist/mcp/tools/drop-task.d.ts +12 -0
- package/dist/mcp/tools/drop-task.js +68 -0
- package/dist/mcp/tools/drop-task.js.map +1 -0
- package/dist/mcp/tools/get-full.d.ts +7 -0
- package/dist/mcp/tools/get-full.js +46 -0
- package/dist/mcp/tools/get-full.js.map +1 -0
- package/dist/mcp/tools/ground-get.d.ts +7 -0
- package/dist/mcp/tools/ground-get.js +77 -0
- package/dist/mcp/tools/ground-get.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.js +40 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/invariant-get.d.ts +6 -0
- package/dist/mcp/tools/invariant-get.js +49 -0
- package/dist/mcp/tools/invariant-get.js.map +1 -0
- package/dist/mcp/tools/invariants-in-scope.d.ts +7 -0
- package/dist/mcp/tools/invariants-in-scope.js +62 -0
- package/dist/mcp/tools/invariants-in-scope.js.map +1 -0
- package/dist/mcp/tools/query-history.d.ts +20 -0
- package/dist/mcp/tools/query-history.js +51 -0
- package/dist/mcp/tools/query-history.js.map +1 -0
- package/dist/mcp/tools/record-decision.d.ts +14 -0
- package/dist/mcp/tools/record-decision.js +98 -0
- package/dist/mcp/tools/record-decision.js.map +1 -0
- package/dist/mcp/tools/record-run-event.d.ts +10 -0
- package/dist/mcp/tools/record-run-event.js +32 -0
- package/dist/mcp/tools/record-run-event.js.map +1 -0
- package/dist/mcp/tools/resolve-attention.d.ts +31 -0
- package/dist/mcp/tools/resolve-attention.js +191 -0
- package/dist/mcp/tools/resolve-attention.js.map +1 -0
- package/dist/mcp/tools/search.d.ts +9 -0
- package/dist/mcp/tools/search.js +164 -0
- package/dist/mcp/tools/search.js.map +1 -0
- package/dist/mcp/tools/supersedes-chain.d.ts +6 -0
- package/dist/mcp/tools/supersedes-chain.js +66 -0
- package/dist/mcp/tools/supersedes-chain.js.map +1 -0
- package/dist/mcp/tools/timeline.d.ts +9 -0
- package/dist/mcp/tools/timeline.js +65 -0
- package/dist/mcp/tools/timeline.js.map +1 -0
- package/dist/mcp/tools/types.d.ts +9 -0
- package/dist/mcp/tools/types.js +2 -0
- package/dist/mcp/tools/types.js.map +1 -0
- package/dist/mirror/clone.d.ts +6 -0
- package/dist/mirror/clone.js +48 -0
- package/dist/mirror/clone.js.map +1 -0
- package/dist/mirror/dirty-overlap.d.ts +13 -0
- package/dist/mirror/dirty-overlap.js +42 -0
- package/dist/mirror/dirty-overlap.js.map +1 -0
- package/dist/mirror/index.d.ts +7 -0
- package/dist/mirror/index.js +7 -0
- package/dist/mirror/index.js.map +1 -0
- package/dist/mirror/paths.d.ts +18 -0
- package/dist/mirror/paths.js +45 -0
- package/dist/mirror/paths.js.map +1 -0
- package/dist/mirror/push.d.ts +9 -0
- package/dist/mirror/push.js +27 -0
- package/dist/mirror/push.js.map +1 -0
- package/dist/mirror/state.d.ts +4 -0
- package/dist/mirror/state.js +36 -0
- package/dist/mirror/state.js.map +1 -0
- package/dist/mirror/sync.d.ts +9 -0
- package/dist/mirror/sync.js +33 -0
- package/dist/mirror/sync.js.map +1 -0
- package/dist/mirror/types.d.ts +77 -0
- package/dist/mirror/types.js +2 -0
- package/dist/mirror/types.js.map +1 -0
- package/dist/paths/index.d.ts +23 -0
- package/dist/paths/index.js +50 -0
- package/dist/paths/index.js.map +1 -0
- package/dist/profiles/index.d.ts +3 -0
- package/dist/profiles/index.js +3 -0
- package/dist/profiles/index.js.map +1 -0
- package/dist/profiles/registry.d.ts +5 -0
- package/dist/profiles/registry.js +31 -0
- package/dist/profiles/registry.js.map +1 -0
- package/dist/profiles/types.d.ts +48 -0
- package/dist/profiles/types.js +11 -0
- package/dist/profiles/types.js.map +1 -0
- package/dist/profiles/unknown.d.ts +9 -0
- package/dist/profiles/unknown.js +17 -0
- package/dist/profiles/unknown.js.map +1 -0
- package/dist/prompt.d.ts +19 -0
- package/dist/prompt.js +50 -0
- package/dist/prompt.js.map +1 -0
- package/dist/sensors/attestation.d.ts +44 -0
- package/dist/sensors/attestation.js +262 -0
- package/dist/sensors/attestation.js.map +1 -0
- package/dist/sensors/catalog.d.ts +41 -0
- package/dist/sensors/catalog.js +123 -0
- package/dist/sensors/catalog.js.map +1 -0
- package/dist/sensors/decisions.d.ts +30 -0
- package/dist/sensors/decisions.js +393 -0
- package/dist/sensors/decisions.js.map +1 -0
- package/dist/sensors/diff.d.ts +27 -0
- package/dist/sensors/diff.js +148 -0
- package/dist/sensors/diff.js.map +1 -0
- package/dist/sensors/index.d.ts +13 -0
- package/dist/sensors/index.js +9 -0
- package/dist/sensors/index.js.map +1 -0
- package/dist/sensors/remediation.d.ts +20 -0
- package/dist/sensors/remediation.js +65 -0
- package/dist/sensors/remediation.js.map +1 -0
- package/dist/sensors/runner.d.ts +44 -0
- package/dist/sensors/runner.js +95 -0
- package/dist/sensors/runner.js.map +1 -0
- package/dist/sensors/structural.d.ts +30 -0
- package/dist/sensors/structural.js +204 -0
- package/dist/sensors/structural.js.map +1 -0
- package/dist/sensors/stub-catalog.d.ts +39 -0
- package/dist/sensors/stub-catalog.js +115 -0
- package/dist/sensors/stub-catalog.js.map +1 -0
- package/dist/sensors/types.d.ts +135 -0
- package/dist/sensors/types.js +14 -0
- package/dist/sensors/types.js.map +1 -0
- package/dist/session/events-marker.d.ts +39 -0
- package/dist/session/events-marker.js +74 -0
- package/dist/session/events-marker.js.map +1 -0
- package/dist/session/id.d.ts +83 -0
- package/dist/session/id.js +166 -0
- package/dist/session/id.js.map +1 -0
- package/dist/session/index.d.ts +14 -0
- package/dist/session/index.js +13 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session-start/build.d.ts +53 -0
- package/dist/session-start/build.js +645 -0
- package/dist/session-start/build.js.map +1 -0
- package/dist/session-start/index.d.ts +18 -0
- package/dist/session-start/index.js +18 -0
- package/dist/session-start/index.js.map +1 -0
- package/dist/session-start/templates.d.ts +6 -0
- package/dist/session-start/templates.js +38 -0
- package/dist/session-start/templates.js.map +1 -0
- package/dist/status-line/format.d.ts +14 -0
- package/dist/status-line/format.js +40 -0
- package/dist/status-line/format.js.map +1 -0
- package/dist/status-line/index.d.ts +29 -0
- package/dist/status-line/index.js +14 -0
- package/dist/status-line/index.js.map +1 -0
- package/dist/status-line/reader.d.ts +13 -0
- package/dist/status-line/reader.js +76 -0
- package/dist/status-line/reader.js.map +1 -0
- package/dist/status-line/writer.d.ts +33 -0
- package/dist/status-line/writer.js +72 -0
- package/dist/status-line/writer.js.map +1 -0
- package/dist/tier0/classify.d.ts +10 -0
- package/dist/tier0/classify.js +110 -0
- package/dist/tier0/classify.js.map +1 -0
- package/dist/tier0/index.d.ts +2 -0
- package/dist/tier0/index.js +2 -0
- package/dist/tier0/index.js.map +1 -0
- package/dist/tier0/ollama.d.ts +22 -0
- package/dist/tier0/ollama.js +63 -0
- package/dist/tier0/ollama.js.map +1 -0
- package/dist/tier0/types.d.ts +24 -0
- package/dist/tier0/types.js +9 -0
- package/dist/tier0/types.js.map +1 -0
- package/dist/tightener/index.d.ts +4 -0
- package/dist/tightener/index.js +4 -0
- package/dist/tightener/index.js.map +1 -0
- package/dist/tightener/prompt.d.ts +3 -0
- package/dist/tightener/prompt.js +67 -0
- package/dist/tightener/prompt.js.map +1 -0
- package/dist/tightener/schema.d.ts +68 -0
- package/dist/tightener/schema.js +44 -0
- package/dist/tightener/schema.js.map +1 -0
- package/dist/tightener/tighten.d.ts +2 -0
- package/dist/tightener/tighten.js +66 -0
- package/dist/tightener/tighten.js.map +1 -0
- package/dist/tightener/types.d.ts +74 -0
- package/dist/tightener/types.js +6 -0
- package/dist/tightener/types.js.map +1 -0
- package/dist/voice/index.d.ts +4 -0
- package/dist/voice/index.js +4 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/model.d.ts +23 -0
- package/dist/voice/model.js +46 -0
- package/dist/voice/model.js.map +1 -0
- package/dist/voice/pipe.d.ts +9 -0
- package/dist/voice/pipe.js +47 -0
- package/dist/voice/pipe.js.map +1 -0
- package/dist/voice/transcribe.d.ts +3 -0
- package/dist/voice/transcribe.js +43 -0
- package/dist/voice/transcribe.js.map +1 -0
- package/dist/voice/types.d.ts +26 -0
- package/dist/voice/types.js +9 -0
- package/dist/voice/types.js.map +1 -0
- package/package.json +54 -0
- package/templates/.archive/README.md +67 -0
- package/templates/.cairn/JOIN.md +87 -0
- package/templates/.cairn/config/sensors.yaml +185 -0
- package/templates/.cairn/config/stub-patterns.yaml +231 -0
- package/templates/.cairn/config/trust-policy.yaml +95 -0
- package/templates/.cairn/config/workflow.md +230 -0
- package/templates/.cairn/git-hooks/commit-msg +17 -0
- package/templates/.cairn/git-hooks/post-commit +28 -0
- package/templates/.cairn/git-hooks/pre-commit +24 -0
- package/templates/.cairn/ground/brand/overview.md +24 -0
- package/templates/.cairn/ground/brand/voice.md +20 -0
- package/templates/.cairn/ground/canonical-map/topics.yaml +54 -0
- package/templates/.cairn/ground/capabilities/mcp-tools.yaml +4 -0
- package/templates/.cairn/ground/capabilities/skills.yaml +3 -0
- package/templates/.cairn/ground/capabilities/snippets.yaml +3 -0
- package/templates/.cairn/ground/manifest.yaml +16 -0
- package/templates/.cairn/ground/product/personas.yaml +4 -0
- package/templates/.cairn/ground/product/positioning.md +21 -0
- package/templates/.claude/settings.json +57 -0
- package/templates/.github/workflows/cairn-check.yml +31 -0
- package/templates/.mcp.json +8 -0
- package/templates/README.md +24 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual.js","sourceRoot":"","sources":["../../src/init/visual.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,GAAiB,MAAM,KAAK,CAAC;AAUpC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAa,CAAC;AAC7C,IAAI,sBAAsB,GAAG,KAAK,CAAC;AACnC,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAEjC,SAAS,eAAe,CAAC,EAAa;IACpC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACxB,OAAO,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,UAAU;IACjB,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;AACH,CAAC;AAED,SAAS,cAAc;IACrB,KAAK,MAAM,EAAE,IAAI,eAAe,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,EAAE,EAAE,CAAC;QACP,CAAC;QAAC,MAAM,CAAC;YACP,cAAc;QAChB,CAAC;IACH,CAAC;IACD,eAAe,CAAC,KAAK,EAAE,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,yBAAyB;IACvC,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5B,sBAAsB,GAAG,IAAI,CAAC;QAC9B,MAAM,QAAQ,GAAG,CAAC,MAAsB,EAAQ,EAAE;YAChD,cAAc,EAAE,CAAC;YACjB,UAAU,EAAE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KAAK,SAAS,EAAE,CAAC;gBAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,UAAU,IAAI,CACrD,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,CAAS;IAC1B,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,CAAC,GAAG;IACf,IAAI,EAAE,CAAC,CAAS,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,GAAG,EAAE,CAAC,CAAS,EAAU,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,KAAK,EAAE,CAAC,CAAS,EAAU,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAS,EAAU,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,GAAG,EAAE,CAAC,CAAS,EAAU,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,IAAI,EAAE,CAAC,CAAS,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;CAC3C,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo walker — produces a structural inventory the init mapper consumes.
|
|
3
|
+
*
|
|
4
|
+
* Walks the adopted project's working tree at adoption time, respecting
|
|
5
|
+
* `.gitignore` (via `git ls-files --cached --others --exclude-standard`
|
|
6
|
+
* when a git repo is present) and a hardcoded set of vendored / generated
|
|
7
|
+
* directory names.
|
|
8
|
+
*
|
|
9
|
+
* Two-pass priority walk:
|
|
10
|
+
* • Pass 1 — high-signal source trees (any path with a segment in
|
|
11
|
+
* HIGH_SIGNAL_DIRS: src, lib, app, pages, components, services,
|
|
12
|
+
* controllers, routes, models, schemas, domain). No depth limit so
|
|
13
|
+
* deeply nested src/auth/services/guards/*.ts is reachable. Cap 500.
|
|
14
|
+
* • Pass 2 — everything else, depth ≤ 6. Cap 200. (Shallow config /
|
|
15
|
+
* manifests / top-level docs.)
|
|
16
|
+
* • Overall belt-and-suspenders cap: 3000. If exceeded, Pass 2 truncates
|
|
17
|
+
* before Pass 1.
|
|
18
|
+
*
|
|
19
|
+
* No prompts, no LLM calls, no side effects beyond reading files. Output is
|
|
20
|
+
* a `RepoSummary` of:
|
|
21
|
+
* - top-level entries
|
|
22
|
+
* - file-count breakdowns by extension and by top-level dir
|
|
23
|
+
* - manifest previews (package.json / pyproject.toml / Gemfile / go.mod /
|
|
24
|
+
* Cargo.toml / mix.exs / deno.json / etc., first 80 lines each)
|
|
25
|
+
* - notable files (README, schema.prisma, openapi.{json,yaml}, Dockerfile,
|
|
26
|
+
* compose, AGENTS.md, etc.)
|
|
27
|
+
* - notable directories whose name matches common framework conventions
|
|
28
|
+
* (controllers, routes, handlers, services, models, migrations, schema,
|
|
29
|
+
* apps, packages, ...)
|
|
30
|
+
* - framework signals scraped out of manifest deps
|
|
31
|
+
*
|
|
32
|
+
* The mapper turns this into the `<slug>:` extension block (route_handler_globs,
|
|
33
|
+
* dto_globs, generator_source_globs, high_stakes_globs, off_limits_globs,
|
|
34
|
+
* pilot_module, key_modules, proposed_sensors, domain_summary).
|
|
35
|
+
*/
|
|
36
|
+
export interface ManifestPreview {
|
|
37
|
+
path: string;
|
|
38
|
+
preview: string;
|
|
39
|
+
}
|
|
40
|
+
export interface RepoSummary {
|
|
41
|
+
repo_root: string;
|
|
42
|
+
total_files: number;
|
|
43
|
+
total_dirs: number;
|
|
44
|
+
truncated_at_file_cap: boolean;
|
|
45
|
+
truncated_at_depth_cap: boolean;
|
|
46
|
+
used_git_ls_files: boolean;
|
|
47
|
+
top_level: string[];
|
|
48
|
+
package_manifests: ManifestPreview[];
|
|
49
|
+
by_extension: Record<string, number>;
|
|
50
|
+
by_top_dir: Record<string, number>;
|
|
51
|
+
notable_files: string[];
|
|
52
|
+
notable_dir_paths: string[];
|
|
53
|
+
framework_signals: string[];
|
|
54
|
+
}
|
|
55
|
+
export interface BuildRepoSummaryOptions {
|
|
56
|
+
repoRoot: string;
|
|
57
|
+
/**
|
|
58
|
+
* Hard cap on Pass-1 (high-signal-dir) file count. Default 500.
|
|
59
|
+
*/
|
|
60
|
+
pass1Cap?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Hard cap on Pass-2 (other) file count. Default 200.
|
|
63
|
+
*/
|
|
64
|
+
pass2Cap?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Max directory depth for Pass 2 (paths NOT under a high-signal dir).
|
|
67
|
+
* Pass 1 has no depth limit. Default 6.
|
|
68
|
+
*/
|
|
69
|
+
pass2DepthCap?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Backwards-compat alias for `pass2DepthCap`. Older callers (smokes, the
|
|
72
|
+
* `cairn scope rebuild` command) used `depthCap` against the legacy
|
|
73
|
+
* single-pass walker. Treated as `pass2DepthCap` so they keep working.
|
|
74
|
+
*/
|
|
75
|
+
depthCap?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Belt-and-suspenders total cap. Default 3000. If exceeded, Pass 2 is
|
|
78
|
+
* truncated first.
|
|
79
|
+
*/
|
|
80
|
+
fileCap?: number;
|
|
81
|
+
}
|
|
82
|
+
export declare function buildRepoSummary(opts: BuildRepoSummaryOptions): RepoSummary;
|
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo walker — produces a structural inventory the init mapper consumes.
|
|
3
|
+
*
|
|
4
|
+
* Walks the adopted project's working tree at adoption time, respecting
|
|
5
|
+
* `.gitignore` (via `git ls-files --cached --others --exclude-standard`
|
|
6
|
+
* when a git repo is present) and a hardcoded set of vendored / generated
|
|
7
|
+
* directory names.
|
|
8
|
+
*
|
|
9
|
+
* Two-pass priority walk:
|
|
10
|
+
* • Pass 1 — high-signal source trees (any path with a segment in
|
|
11
|
+
* HIGH_SIGNAL_DIRS: src, lib, app, pages, components, services,
|
|
12
|
+
* controllers, routes, models, schemas, domain). No depth limit so
|
|
13
|
+
* deeply nested src/auth/services/guards/*.ts is reachable. Cap 500.
|
|
14
|
+
* • Pass 2 — everything else, depth ≤ 6. Cap 200. (Shallow config /
|
|
15
|
+
* manifests / top-level docs.)
|
|
16
|
+
* • Overall belt-and-suspenders cap: 3000. If exceeded, Pass 2 truncates
|
|
17
|
+
* before Pass 1.
|
|
18
|
+
*
|
|
19
|
+
* No prompts, no LLM calls, no side effects beyond reading files. Output is
|
|
20
|
+
* a `RepoSummary` of:
|
|
21
|
+
* - top-level entries
|
|
22
|
+
* - file-count breakdowns by extension and by top-level dir
|
|
23
|
+
* - manifest previews (package.json / pyproject.toml / Gemfile / go.mod /
|
|
24
|
+
* Cargo.toml / mix.exs / deno.json / etc., first 80 lines each)
|
|
25
|
+
* - notable files (README, schema.prisma, openapi.{json,yaml}, Dockerfile,
|
|
26
|
+
* compose, AGENTS.md, etc.)
|
|
27
|
+
* - notable directories whose name matches common framework conventions
|
|
28
|
+
* (controllers, routes, handlers, services, models, migrations, schema,
|
|
29
|
+
* apps, packages, ...)
|
|
30
|
+
* - framework signals scraped out of manifest deps
|
|
31
|
+
*
|
|
32
|
+
* The mapper turns this into the `<slug>:` extension block (route_handler_globs,
|
|
33
|
+
* dto_globs, generator_source_globs, high_stakes_globs, off_limits_globs,
|
|
34
|
+
* pilot_module, key_modules, proposed_sensors, domain_summary).
|
|
35
|
+
*/
|
|
36
|
+
import { execFileSync } from "node:child_process";
|
|
37
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
38
|
+
import { extname, join } from "node:path";
|
|
39
|
+
const DEFAULT_OFF_LIMITS_DIRS = new Set([
|
|
40
|
+
".git",
|
|
41
|
+
"node_modules",
|
|
42
|
+
"dist",
|
|
43
|
+
"build",
|
|
44
|
+
"target",
|
|
45
|
+
"out",
|
|
46
|
+
"__pycache__",
|
|
47
|
+
"vendor",
|
|
48
|
+
".venv",
|
|
49
|
+
".direnv",
|
|
50
|
+
".cache",
|
|
51
|
+
"coverage",
|
|
52
|
+
".next",
|
|
53
|
+
".turbo",
|
|
54
|
+
".nuxt",
|
|
55
|
+
".svelte-kit",
|
|
56
|
+
".astro",
|
|
57
|
+
".parcel-cache",
|
|
58
|
+
".vercel",
|
|
59
|
+
".netlify",
|
|
60
|
+
".pytest_cache",
|
|
61
|
+
".mypy_cache",
|
|
62
|
+
".ruff_cache",
|
|
63
|
+
".tox",
|
|
64
|
+
".gradle",
|
|
65
|
+
".idea",
|
|
66
|
+
".vscode",
|
|
67
|
+
".cairn",
|
|
68
|
+
".archive",
|
|
69
|
+
]);
|
|
70
|
+
/**
|
|
71
|
+
* Per-pass + total caps. Per-pass caps keep the mapper prompt focused; the
|
|
72
|
+
* 3000 total is a forward-looking safety net (the per-pass sum is well below
|
|
73
|
+
* it but kept so future cap raises don't bypass a single bound).
|
|
74
|
+
*/
|
|
75
|
+
const HIGH_SIGNAL_DIRS = new Set([
|
|
76
|
+
"src",
|
|
77
|
+
"lib",
|
|
78
|
+
"app",
|
|
79
|
+
"pages",
|
|
80
|
+
"components",
|
|
81
|
+
"services",
|
|
82
|
+
"controllers",
|
|
83
|
+
"routes",
|
|
84
|
+
"models",
|
|
85
|
+
"schemas",
|
|
86
|
+
"domain",
|
|
87
|
+
]);
|
|
88
|
+
const DEFAULT_PASS1_CAP = 500;
|
|
89
|
+
const DEFAULT_PASS2_CAP = 200;
|
|
90
|
+
const DEFAULT_PASS2_DEPTH_CAP = 6;
|
|
91
|
+
const DEFAULT_TOTAL_CAP = 3000;
|
|
92
|
+
/** Legacy single-pass depth cap, retained for the fallback walker only. */
|
|
93
|
+
const DEFAULT_DEPTH_CAP = 10;
|
|
94
|
+
const MANIFEST_PREVIEW_LINES = 80;
|
|
95
|
+
const MANIFEST_FILES = new Set([
|
|
96
|
+
"package.json",
|
|
97
|
+
"pyproject.toml",
|
|
98
|
+
"requirements.txt",
|
|
99
|
+
"Pipfile",
|
|
100
|
+
"Gemfile",
|
|
101
|
+
"go.mod",
|
|
102
|
+
"Cargo.toml",
|
|
103
|
+
"mix.exs",
|
|
104
|
+
"pom.xml",
|
|
105
|
+
"build.gradle",
|
|
106
|
+
"build.gradle.kts",
|
|
107
|
+
"composer.json",
|
|
108
|
+
"deno.json",
|
|
109
|
+
"deno.jsonc",
|
|
110
|
+
"Package.swift",
|
|
111
|
+
]);
|
|
112
|
+
const NOTABLE_FILE_PATTERNS = [
|
|
113
|
+
/^README(?:\.[a-z]+)?$/i,
|
|
114
|
+
/^ARCHITECTURE\.[a-z]+$/i,
|
|
115
|
+
/^DESIGN\.[a-z]+$/i,
|
|
116
|
+
/^AGENTS?\.md$/i,
|
|
117
|
+
/^CLAUDE\.md$/i,
|
|
118
|
+
/^schema\.prisma$/i,
|
|
119
|
+
/^openapi\.(?:json|yaml|yml)$/i,
|
|
120
|
+
/^docker-compose(?:\.[a-z0-9_-]+)?\.ya?ml$/i,
|
|
121
|
+
/^compose\.ya?ml$/i,
|
|
122
|
+
/^Dockerfile(?:\..+)?$/i,
|
|
123
|
+
/^drizzle\.config\.(?:ts|js|mts|mjs)$/i,
|
|
124
|
+
/^prisma\.config\.(?:ts|js)$/i,
|
|
125
|
+
/^next\.config\.(?:ts|js|mjs)$/i,
|
|
126
|
+
/^nest-cli\.json$/i,
|
|
127
|
+
/^astro\.config\.(?:ts|js|mjs)$/i,
|
|
128
|
+
/^remix\.config\.(?:ts|js|mjs)$/i,
|
|
129
|
+
/^tsconfig\.json$/i,
|
|
130
|
+
/^tsconfig\.base\.json$/i,
|
|
131
|
+
/^pnpm-workspace\.ya?ml$/i,
|
|
132
|
+
/^turbo\.json$/i,
|
|
133
|
+
/^nx\.json$/i,
|
|
134
|
+
/^manage\.py$/i,
|
|
135
|
+
/^alembic\.ini$/i,
|
|
136
|
+
/^Procfile$/i,
|
|
137
|
+
];
|
|
138
|
+
const NOTABLE_DIR_NAMES = new Set([
|
|
139
|
+
"migrations",
|
|
140
|
+
"schemas",
|
|
141
|
+
"schema",
|
|
142
|
+
"controllers",
|
|
143
|
+
"routes",
|
|
144
|
+
"handlers",
|
|
145
|
+
"services",
|
|
146
|
+
"models",
|
|
147
|
+
"domain",
|
|
148
|
+
"core",
|
|
149
|
+
"apps",
|
|
150
|
+
"packages",
|
|
151
|
+
"src",
|
|
152
|
+
"lib",
|
|
153
|
+
"api",
|
|
154
|
+
"web",
|
|
155
|
+
"mobile",
|
|
156
|
+
"frontend",
|
|
157
|
+
"backend",
|
|
158
|
+
"server",
|
|
159
|
+
"client",
|
|
160
|
+
"auth",
|
|
161
|
+
"billing",
|
|
162
|
+
"payments",
|
|
163
|
+
"integrations",
|
|
164
|
+
"telephony",
|
|
165
|
+
"events",
|
|
166
|
+
"dto",
|
|
167
|
+
"dtos",
|
|
168
|
+
"guards",
|
|
169
|
+
"middlewares",
|
|
170
|
+
"middleware",
|
|
171
|
+
"queues",
|
|
172
|
+
"workers",
|
|
173
|
+
]);
|
|
174
|
+
export function buildRepoSummary(opts) {
|
|
175
|
+
const root = opts.repoRoot;
|
|
176
|
+
const pass1Cap = opts.pass1Cap ?? DEFAULT_PASS1_CAP;
|
|
177
|
+
const pass2Cap = opts.pass2Cap ?? DEFAULT_PASS2_CAP;
|
|
178
|
+
// pass2DepthCap explicit > legacy depthCap > default 6
|
|
179
|
+
const pass2DepthCap = opts.pass2DepthCap ?? opts.depthCap ?? DEFAULT_PASS2_DEPTH_CAP;
|
|
180
|
+
const fileCap = opts.fileCap ?? DEFAULT_TOTAL_CAP;
|
|
181
|
+
const { paths, dirs, truncatedFile, truncatedDepth, usedGit } = listFiles({
|
|
182
|
+
root,
|
|
183
|
+
pass1Cap,
|
|
184
|
+
pass2Cap,
|
|
185
|
+
pass2DepthCap,
|
|
186
|
+
fileCap,
|
|
187
|
+
});
|
|
188
|
+
return summarize({
|
|
189
|
+
root,
|
|
190
|
+
paths,
|
|
191
|
+
dirs,
|
|
192
|
+
truncatedFile,
|
|
193
|
+
truncatedDepth,
|
|
194
|
+
usedGit,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function listFiles(args) {
|
|
198
|
+
const fromGit = tryGitLsFiles(args.root);
|
|
199
|
+
if (fromGit !== null) {
|
|
200
|
+
return filterGitListing({ ...args, fromGit });
|
|
201
|
+
}
|
|
202
|
+
return walkFilesystem(args);
|
|
203
|
+
}
|
|
204
|
+
function isHighSignalPath(rel) {
|
|
205
|
+
for (const seg of rel.split("/")) {
|
|
206
|
+
if (HIGH_SIGNAL_DIRS.has(seg))
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
function addAncestors(dirs, rel) {
|
|
212
|
+
const segs = rel.split("/");
|
|
213
|
+
for (let i = 1; i <= segs.length - 1; i++) {
|
|
214
|
+
dirs.add(segs.slice(0, i).join("/"));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function tryGitLsFiles(root) {
|
|
218
|
+
if (!existsSync(join(root, ".git")))
|
|
219
|
+
return null;
|
|
220
|
+
// We need TWO listings unioned because git ls-files cannot combine
|
|
221
|
+
// `--recurse-submodules` with `--others` (git rejects it as "unsupported
|
|
222
|
+
// mode"). Without --recurse-submodules, submodule contents (initialized or
|
|
223
|
+
// not) never enumerate — `core/`, `platform/`, `site/` show as bare
|
|
224
|
+
// gitlink entries and the mapper sees none of their source.
|
|
225
|
+
// 1) `--cached --recurse-submodules` → tracked files including submodule contents
|
|
226
|
+
// 2) `--others --exclude-standard` → untracked-but-not-ignored files at parent
|
|
227
|
+
const tracked = runGitLsFiles(root, [
|
|
228
|
+
"--cached",
|
|
229
|
+
"--recurse-submodules",
|
|
230
|
+
]);
|
|
231
|
+
if (tracked === null)
|
|
232
|
+
return null;
|
|
233
|
+
const untracked = runGitLsFiles(root, ["--others", "--exclude-standard"]);
|
|
234
|
+
if (untracked === null)
|
|
235
|
+
return tracked;
|
|
236
|
+
// Dedup — `--cached` and `--others` are disjoint by definition, but
|
|
237
|
+
// submodule paths may appear in tracked as the bare gitlink in some git
|
|
238
|
+
// versions; a Set keeps us safe.
|
|
239
|
+
const set = new Set();
|
|
240
|
+
for (const p of tracked)
|
|
241
|
+
set.add(p);
|
|
242
|
+
for (const p of untracked)
|
|
243
|
+
set.add(p);
|
|
244
|
+
return [...set];
|
|
245
|
+
}
|
|
246
|
+
function runGitLsFiles(root, extraArgs) {
|
|
247
|
+
try {
|
|
248
|
+
const out = execFileSync("git", ["-C", root, "ls-files", ...extraArgs, "-z"], { encoding: "buffer", maxBuffer: 100 * 1024 * 1024 });
|
|
249
|
+
return out
|
|
250
|
+
.toString("utf8")
|
|
251
|
+
.split("\0")
|
|
252
|
+
.filter((s) => s.length > 0);
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function filterGitListing(args) {
|
|
259
|
+
const dirs = new Set();
|
|
260
|
+
const pass1 = [];
|
|
261
|
+
const pass2 = [];
|
|
262
|
+
let pass1Hit = false;
|
|
263
|
+
let pass2Hit = false;
|
|
264
|
+
// Single sweep — partition each path into pass1 (high-signal) or pass2.
|
|
265
|
+
for (const rel of args.fromGit) {
|
|
266
|
+
const segs = rel.split("/");
|
|
267
|
+
if (segs.some((s) => DEFAULT_OFF_LIMITS_DIRS.has(s)))
|
|
268
|
+
continue;
|
|
269
|
+
if (isHighSignalPath(rel)) {
|
|
270
|
+
if (pass1.length >= args.pass1Cap) {
|
|
271
|
+
pass1Hit = true;
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
pass1.push(rel);
|
|
275
|
+
addAncestors(dirs, rel);
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
if (segs.length - 1 > args.pass2DepthCap)
|
|
279
|
+
continue;
|
|
280
|
+
if (pass2.length >= args.pass2Cap) {
|
|
281
|
+
pass2Hit = true;
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
pass2.push(rel);
|
|
285
|
+
addAncestors(dirs, rel);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const { combined, totalHit } = applyTotalCap(pass1, pass2, args.fileCap);
|
|
289
|
+
return {
|
|
290
|
+
paths: combined,
|
|
291
|
+
dirs,
|
|
292
|
+
truncatedFile: pass1Hit || pass2Hit || totalHit,
|
|
293
|
+
truncatedDepth: false,
|
|
294
|
+
usedGit: true,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
function walkFilesystem(args) {
|
|
298
|
+
const dirs = new Set();
|
|
299
|
+
const pass1 = [];
|
|
300
|
+
const pass2 = [];
|
|
301
|
+
let pass1Hit = false;
|
|
302
|
+
let pass2Hit = false;
|
|
303
|
+
let truncatedDepth = false;
|
|
304
|
+
const stack = [
|
|
305
|
+
{ abs: args.root, rel: "", depth: 0, underHigh: false },
|
|
306
|
+
];
|
|
307
|
+
while (stack.length > 0) {
|
|
308
|
+
const cur = stack.pop();
|
|
309
|
+
if (cur === undefined)
|
|
310
|
+
break;
|
|
311
|
+
let entries;
|
|
312
|
+
try {
|
|
313
|
+
entries = readdirSync(cur.abs);
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
for (const name of entries) {
|
|
319
|
+
if (DEFAULT_OFF_LIMITS_DIRS.has(name))
|
|
320
|
+
continue;
|
|
321
|
+
const abs = join(cur.abs, name);
|
|
322
|
+
const rel = cur.rel === "" ? name : `${cur.rel}/${name}`;
|
|
323
|
+
let s;
|
|
324
|
+
try {
|
|
325
|
+
s = statSync(abs);
|
|
326
|
+
}
|
|
327
|
+
catch {
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
if (s.isDirectory()) {
|
|
331
|
+
const childUnderHigh = cur.underHigh || HIGH_SIGNAL_DIRS.has(name);
|
|
332
|
+
// Pass-2 depth cap: only enforced for non-high-signal subtrees.
|
|
333
|
+
if (!childUnderHigh && cur.depth + 1 > args.pass2DepthCap) {
|
|
334
|
+
truncatedDepth = true;
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
// Defensive belt: hard cap depth even under high-signal subtrees so
|
|
338
|
+
// a runaway symlink loop or pathological tree can't OOM us.
|
|
339
|
+
if (cur.depth + 1 > DEFAULT_DEPTH_CAP * 4) {
|
|
340
|
+
truncatedDepth = true;
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
dirs.add(rel);
|
|
344
|
+
stack.push({
|
|
345
|
+
abs,
|
|
346
|
+
rel,
|
|
347
|
+
depth: cur.depth + 1,
|
|
348
|
+
underHigh: childUnderHigh,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
else if (s.isFile()) {
|
|
352
|
+
if (cur.underHigh) {
|
|
353
|
+
if (pass1.length >= args.pass1Cap) {
|
|
354
|
+
pass1Hit = true;
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
pass1.push(rel);
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
if (pass2.length >= args.pass2Cap) {
|
|
361
|
+
pass2Hit = true;
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
pass2.push(rel);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
const { combined, totalHit } = applyTotalCap(pass1, pass2, args.fileCap);
|
|
370
|
+
return {
|
|
371
|
+
paths: combined,
|
|
372
|
+
dirs,
|
|
373
|
+
truncatedFile: pass1Hit || pass2Hit || totalHit,
|
|
374
|
+
truncatedDepth,
|
|
375
|
+
usedGit: false,
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
function applyTotalCap(pass1, pass2, totalCap) {
|
|
379
|
+
const combined = [...pass1, ...pass2];
|
|
380
|
+
if (combined.length <= totalCap)
|
|
381
|
+
return { combined, totalHit: false };
|
|
382
|
+
// Drop Pass 2 first.
|
|
383
|
+
const room = Math.max(0, totalCap - pass1.length);
|
|
384
|
+
return {
|
|
385
|
+
combined: pass1.slice(0, totalCap).concat(pass2.slice(0, room)),
|
|
386
|
+
totalHit: true,
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function summarize(args) {
|
|
390
|
+
const byExt = {};
|
|
391
|
+
const byTopDir = {};
|
|
392
|
+
const manifests = [];
|
|
393
|
+
const notableFiles = [];
|
|
394
|
+
const topLevel = new Set();
|
|
395
|
+
for (const rel of args.paths) {
|
|
396
|
+
const segs = rel.split("/");
|
|
397
|
+
const top = segs[0];
|
|
398
|
+
if (top !== undefined)
|
|
399
|
+
topLevel.add(top);
|
|
400
|
+
if (segs.length > 1 && top !== undefined) {
|
|
401
|
+
byTopDir[top] = (byTopDir[top] ?? 0) + 1;
|
|
402
|
+
}
|
|
403
|
+
const ext = extname(rel).toLowerCase();
|
|
404
|
+
if (ext.length > 0)
|
|
405
|
+
byExt[ext] = (byExt[ext] ?? 0) + 1;
|
|
406
|
+
const fileName = segs[segs.length - 1] ?? "";
|
|
407
|
+
if (MANIFEST_FILES.has(fileName)) {
|
|
408
|
+
manifests.push({
|
|
409
|
+
path: rel,
|
|
410
|
+
preview: readPreview(join(args.root, rel), MANIFEST_PREVIEW_LINES),
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
if (NOTABLE_FILE_PATTERNS.some((p) => p.test(fileName))) {
|
|
414
|
+
notableFiles.push(rel);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
const notableDirs = collectNotableDirs(args.dirs);
|
|
418
|
+
const frameworkSignals = detectFrameworkSignals(manifests);
|
|
419
|
+
return {
|
|
420
|
+
repo_root: args.root,
|
|
421
|
+
total_files: args.paths.length,
|
|
422
|
+
total_dirs: args.dirs.size,
|
|
423
|
+
truncated_at_file_cap: args.truncatedFile,
|
|
424
|
+
truncated_at_depth_cap: args.truncatedDepth,
|
|
425
|
+
used_git_ls_files: args.usedGit,
|
|
426
|
+
top_level: [...topLevel].sort(),
|
|
427
|
+
package_manifests: manifests,
|
|
428
|
+
by_extension: topN(byExt, 25),
|
|
429
|
+
by_top_dir: topN(byTopDir, 30),
|
|
430
|
+
notable_files: notableFiles.sort(),
|
|
431
|
+
notable_dir_paths: notableDirs.sort(),
|
|
432
|
+
framework_signals: frameworkSignals.sort(),
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
function collectNotableDirs(dirs) {
|
|
436
|
+
const out = [];
|
|
437
|
+
for (const dir of dirs) {
|
|
438
|
+
const segs = dir.split("/");
|
|
439
|
+
const last = (segs[segs.length - 1] ?? "").toLowerCase();
|
|
440
|
+
if (NOTABLE_DIR_NAMES.has(last))
|
|
441
|
+
out.push(dir);
|
|
442
|
+
}
|
|
443
|
+
return out;
|
|
444
|
+
}
|
|
445
|
+
function readPreview(path, maxLines) {
|
|
446
|
+
try {
|
|
447
|
+
const text = readFileSync(path, "utf8");
|
|
448
|
+
return text.split("\n").slice(0, maxLines).join("\n");
|
|
449
|
+
}
|
|
450
|
+
catch {
|
|
451
|
+
return "";
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function topN(m, n) {
|
|
455
|
+
const sorted = Object.entries(m)
|
|
456
|
+
.sort(([, a], [, b]) => b - a)
|
|
457
|
+
.slice(0, n);
|
|
458
|
+
const out = {};
|
|
459
|
+
for (const [k, v] of sorted)
|
|
460
|
+
out[k] = v;
|
|
461
|
+
return out;
|
|
462
|
+
}
|
|
463
|
+
const TS_FRAMEWORKS = [
|
|
464
|
+
"next",
|
|
465
|
+
"@nestjs/core",
|
|
466
|
+
"@nestjs/common",
|
|
467
|
+
"express",
|
|
468
|
+
"fastify",
|
|
469
|
+
"hono",
|
|
470
|
+
"@trpc/server",
|
|
471
|
+
"drizzle-orm",
|
|
472
|
+
"@prisma/client",
|
|
473
|
+
"kysely",
|
|
474
|
+
"@apollo/server",
|
|
475
|
+
"apollo-server",
|
|
476
|
+
"react",
|
|
477
|
+
"vue",
|
|
478
|
+
"svelte",
|
|
479
|
+
"vite",
|
|
480
|
+
"astro",
|
|
481
|
+
"remix",
|
|
482
|
+
"@sveltejs/kit",
|
|
483
|
+
"nuxt",
|
|
484
|
+
"@tanstack/router",
|
|
485
|
+
"@tanstack/react-router",
|
|
486
|
+
"tailwindcss",
|
|
487
|
+
"react-native",
|
|
488
|
+
"expo",
|
|
489
|
+
"electron",
|
|
490
|
+
"stripe",
|
|
491
|
+
"discord.js",
|
|
492
|
+
"zod",
|
|
493
|
+
"graphql",
|
|
494
|
+
"@effect/platform",
|
|
495
|
+
];
|
|
496
|
+
const PY_FRAMEWORKS = [
|
|
497
|
+
"fastapi",
|
|
498
|
+
"django",
|
|
499
|
+
"flask",
|
|
500
|
+
"starlette",
|
|
501
|
+
"pydantic",
|
|
502
|
+
"sqlalchemy",
|
|
503
|
+
"alembic",
|
|
504
|
+
"celery",
|
|
505
|
+
"pytest",
|
|
506
|
+
"ruff",
|
|
507
|
+
"mypy",
|
|
508
|
+
"uvicorn",
|
|
509
|
+
"tortoise-orm",
|
|
510
|
+
];
|
|
511
|
+
const RB_FRAMEWORKS = [
|
|
512
|
+
"rails",
|
|
513
|
+
"sinatra",
|
|
514
|
+
"sidekiq",
|
|
515
|
+
"rspec",
|
|
516
|
+
"rubocop",
|
|
517
|
+
"hanami",
|
|
518
|
+
"grape",
|
|
519
|
+
];
|
|
520
|
+
const GO_FRAMEWORKS = [
|
|
521
|
+
"gin-gonic/gin",
|
|
522
|
+
"go-chi/chi",
|
|
523
|
+
"labstack/echo",
|
|
524
|
+
"gofiber/fiber",
|
|
525
|
+
"gorm.io/gorm",
|
|
526
|
+
"sqlc-dev/sqlc",
|
|
527
|
+
"uber-go/zap",
|
|
528
|
+
"google/wire",
|
|
529
|
+
];
|
|
530
|
+
const RUST_FRAMEWORKS = [
|
|
531
|
+
"axum",
|
|
532
|
+
"actix-web",
|
|
533
|
+
"rocket",
|
|
534
|
+
"warp",
|
|
535
|
+
"tower",
|
|
536
|
+
"sqlx",
|
|
537
|
+
"diesel",
|
|
538
|
+
"sea-orm",
|
|
539
|
+
"tokio",
|
|
540
|
+
];
|
|
541
|
+
function detectFrameworkSignals(manifests) {
|
|
542
|
+
const signals = new Set();
|
|
543
|
+
for (const m of manifests) {
|
|
544
|
+
const fileName = m.path.split("/").pop() ?? "";
|
|
545
|
+
const text = m.preview;
|
|
546
|
+
if (fileName === "package.json") {
|
|
547
|
+
for (const f of TS_FRAMEWORKS) {
|
|
548
|
+
if (new RegExp(`"${escapeReg(f)}"\\s*:`, "i").test(text))
|
|
549
|
+
signals.add(f);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
else if (fileName === "pyproject.toml" ||
|
|
553
|
+
fileName === "requirements.txt" ||
|
|
554
|
+
fileName === "Pipfile") {
|
|
555
|
+
for (const f of PY_FRAMEWORKS) {
|
|
556
|
+
if (new RegExp(`\\b${escapeReg(f)}\\b`, "i").test(text))
|
|
557
|
+
signals.add(f);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
else if (fileName === "Gemfile") {
|
|
561
|
+
for (const f of RB_FRAMEWORKS) {
|
|
562
|
+
if (new RegExp(`gem\\s+["']${escapeReg(f)}["']`, "i").test(text)) {
|
|
563
|
+
signals.add(f);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
else if (fileName === "go.mod") {
|
|
568
|
+
for (const f of GO_FRAMEWORKS) {
|
|
569
|
+
if (text.includes(f))
|
|
570
|
+
signals.add(f);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
else if (fileName === "Cargo.toml") {
|
|
574
|
+
for (const f of RUST_FRAMEWORKS) {
|
|
575
|
+
if (new RegExp(`\\b${escapeReg(f)}\\s*=`, "i").test(text))
|
|
576
|
+
signals.add(f);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return [...signals];
|
|
581
|
+
}
|
|
582
|
+
function escapeReg(s) {
|
|
583
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
584
|
+
}
|
|
585
|
+
//# sourceMappingURL=walker.js.map
|