@selvakumaresra/specship 0.1.3 → 0.3.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/README.md +2 -2
- package/commands/ss-design-implement.md +79 -0
- package/commands/{cg-drifted.md → ss-drifted.md} +2 -2
- package/commands/{cg-fix.md → ss-fix.md} +1 -1
- package/commands/{cg-implement.md → ss-implement.md} +1 -1
- package/commands/ss-spec-author.md +43 -0
- package/commands/ss-spec-review.md +48 -0
- package/dist/bin/node-version-check.d.ts +37 -0
- package/dist/bin/node-version-check.d.ts.map +1 -0
- package/dist/bin/node-version-check.js +79 -0
- package/dist/bin/node-version-check.js.map +1 -0
- package/dist/bin/specship.d.ts +25 -0
- package/dist/bin/specship.d.ts.map +1 -0
- package/dist/bin/specship.js +2019 -0
- package/dist/bin/specship.js.map +1 -0
- package/dist/bin/uninstall.d.ts +13 -0
- package/dist/bin/uninstall.d.ts.map +1 -0
- package/dist/bin/uninstall.js +35 -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 +1289 -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 +103 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +279 -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 +462 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/queries.d.ts +357 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +1504 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.sql +419 -0
- package/dist/db/spec-queries.d.ts +101 -0
- package/dist/db/spec-queries.d.ts.map +1 -0
- package/dist/db/spec-queries.js +675 -0
- package/dist/db/spec-queries.js.map +1 -0
- package/dist/db/sqlite-adapter.d.ts +65 -0
- package/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/db/sqlite-adapter.js +214 -0
- package/dist/db/sqlite-adapter.js.map +1 -0
- package/dist/directory.d.ts +67 -0
- package/dist/directory.d.ts.map +1 -0
- package/dist/directory.js +267 -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/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/generated-detection.d.ts +30 -0
- package/dist/extraction/generated-detection.d.ts.map +1 -0
- package/dist/extraction/generated-detection.js +80 -0
- package/dist/extraction/generated-detection.js.map +1 -0
- package/dist/extraction/grammars.d.ts +100 -0
- package/dist/extraction/grammars.d.ts.map +1 -0
- package/dist/extraction/grammars.js +426 -0
- package/dist/extraction/grammars.js.map +1 -0
- package/dist/extraction/index.d.ts +138 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +1394 -0
- package/dist/extraction/index.js.map +1 -0
- package/dist/extraction/languages/c-cpp.d.ts +4 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/dist/extraction/languages/c-cpp.js +171 -0
- package/dist/extraction/languages/c-cpp.js.map +1 -0
- package/dist/extraction/languages/csharp.d.ts +3 -0
- package/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/dist/extraction/languages/csharp.js +73 -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 +192 -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 +74 -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 +51 -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 +70 -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 +90 -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 +259 -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 +133 -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 +66 -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 +107 -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/ruby.d.ts +3 -0
- package/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/dist/extraction/languages/ruby.js +114 -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 +109 -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 +139 -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 +91 -0
- package/dist/extraction/languages/swift.js.map +1 -0
- package/dist/extraction/languages/typescript.d.ts +3 -0
- package/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/dist/extraction/languages/typescript.js +129 -0
- package/dist/extraction/languages/typescript.js.map +1 -0
- package/dist/extraction/liquid-extractor.d.ts +52 -0
- package/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/dist/extraction/liquid-extractor.js +313 -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 +94 -0
- package/dist/extraction/parse-worker.js.map +1 -0
- package/dist/extraction/specs/markdown-spec-extractor.d.ts +59 -0
- package/dist/extraction/specs/markdown-spec-extractor.d.ts.map +1 -0
- package/dist/extraction/specs/markdown-spec-extractor.js +327 -0
- package/dist/extraction/specs/markdown-spec-extractor.js.map +1 -0
- package/dist/extraction/specs/types.d.ts +39 -0
- package/dist/extraction/specs/types.d.ts.map +1 -0
- package/dist/extraction/specs/types.js +8 -0
- package/dist/extraction/specs/types.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 +272 -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 +103 -0
- package/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/dist/extraction/tree-sitter-types.d.ts +193 -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 +317 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/dist/extraction/tree-sitter.js +3092 -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 +251 -0
- package/dist/extraction/vue-extractor.js.map +1 -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-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 +366 -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 +531 -0
- package/dist/graph/traversal.js.map +1 -0
- package/dist/index.d.ts +551 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1165 -0
- package/dist/index.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 +87 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +415 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/instructions-template.d.ts +18 -0
- package/dist/installer/instructions-template.d.ts.map +1 -0
- package/dist/installer/instructions-template.js +21 -0
- package/dist/installer/instructions-template.js.map +1 -0
- package/dist/installer/targets/claude.d.ts +98 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +639 -0
- package/dist/installer/targets/claude.js.map +1 -0
- package/dist/installer/targets/registry.d.ts +19 -0
- package/dist/installer/targets/registry.d.ts.map +1 -0
- package/dist/installer/targets/registry.js +31 -0
- package/dist/installer/targets/registry.js.map +1 -0
- package/dist/installer/targets/shared.d.ts +62 -0
- package/dist/installer/targets/shared.d.ts.map +1 -0
- package/dist/installer/targets/shared.js +207 -0
- package/dist/installer/targets/shared.js.map +1 -0
- package/dist/installer/targets/types.d.ts +76 -0
- package/dist/installer/targets/types.d.ts.map +1 -0
- package/dist/installer/targets/types.js +12 -0
- package/dist/installer/targets/types.js.map +1 -0
- package/dist/isolation/worktree.d.ts +65 -0
- package/dist/isolation/worktree.d.ts.map +1 -0
- package/dist/isolation/worktree.js +231 -0
- package/dist/isolation/worktree.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.d.ts +161 -0
- package/dist/mcp/daemon.d.ts.map +1 -0
- package/dist/mcp/daemon.js +403 -0
- package/dist/mcp/daemon.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 +270 -0
- package/dist/mcp/engine.js.map +1 -0
- package/dist/mcp/index.d.ts +112 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +477 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/proxy.d.ts +81 -0
- package/dist/mcp/proxy.d.ts.map +1 -0
- package/dist/mcp/proxy.js +510 -0
- package/dist/mcp/proxy.js.map +1 -0
- package/dist/mcp/server-instructions.d.ts +18 -0
- package/dist/mcp/server-instructions.d.ts.map +1 -0
- package/dist/mcp/server-instructions.js +77 -0
- package/dist/mcp/server-instructions.js.map +1 -0
- package/dist/mcp/session.d.ts +77 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +294 -0
- package/dist/mcp/session.js.map +1 -0
- package/dist/mcp/spec-tools.d.ts +39 -0
- package/dist/mcp/spec-tools.d.ts.map +1 -0
- package/dist/mcp/spec-tools.js +326 -0
- package/dist/mcp/spec-tools.js.map +1 -0
- package/dist/mcp/tools.d.ts +404 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +3066 -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 +343 -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/resolution/callback-synthesizer.d.ts +10 -0
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
- package/dist/resolution/callback-synthesizer.js +1300 -0
- package/dist/resolution/callback-synthesizer.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 +143 -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/index.d.ts +48 -0
- package/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/dist/resolution/frameworks/index.js +161 -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 +504 -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 +396 -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 +360 -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 +365 -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 +249 -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 +306 -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/import-resolver.d.ts +68 -0
- package/dist/resolution/import-resolver.d.ts.map +1 -0
- package/dist/resolution/import-resolver.js +1275 -0
- package/dist/resolution/import-resolver.js.map +1 -0
- package/dist/resolution/index.d.ts +117 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +895 -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 +32 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -0
- package/dist/resolution/name-matcher.js +596 -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/spec-link-resolver.d.ts +103 -0
- package/dist/resolution/spec-link-resolver.d.ts.map +1 -0
- package/dist/resolution/spec-link-resolver.js +259 -0
- package/dist/resolution/spec-link-resolver.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 +441 -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 +216 -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 +71 -0
- package/dist/search/query-utils.d.ts.map +1 -0
- package/dist/search/query-utils.js +380 -0
- package/dist/search/query-utils.js.map +1 -0
- package/dist/server/cli.js +152 -0
- package/dist/server/index.js +12 -0
- package/dist/server/ingest/index.js +18 -0
- package/dist/server/ingest/ingestor.js +506 -0
- package/dist/server/ingest/parser.js +104 -0
- package/dist/server/ingest/pricing.js +78 -0
- package/dist/server/ingest/types.js +9 -0
- package/dist/server/ingest/watcher.js +77 -0
- package/dist/server/package.json +3 -0
- package/dist/server/project-registry.js +101 -0
- package/dist/server/routes/claude.js +868 -0
- package/dist/server/routes/graph.js +211 -0
- package/dist/server/routes/memory.js +272 -0
- package/dist/server/routes/projects.js +197 -0
- package/dist/server/routes/spec.js +265 -0
- package/dist/server/routes/status.js +112 -0
- package/dist/server/routes/workflow.js +212 -0
- package/dist/server/server.js +206 -0
- package/dist/server/static-handler.js +87 -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 +283 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +606 -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/types.d.ts +623 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +108 -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/utils.d.ts +205 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +549 -0
- package/dist/utils.js.map +1 -0
- package/dist/web/chunk-2AJCHB7P.js +1 -0
- package/dist/web/chunk-2CPLUFCH.js +2 -0
- package/dist/web/chunk-2DHIGIOI.js +1 -0
- package/dist/web/chunk-2GBEK2GM.js +1 -0
- package/dist/web/chunk-2I7L37NS.js +1 -0
- package/dist/web/chunk-2NAWAJB5.js +1 -0
- package/dist/web/chunk-2OJBIPE4.js +1 -0
- package/dist/web/chunk-2OKMB4KX.js +2 -0
- package/dist/web/chunk-3E2WB6D5.js +1 -0
- package/dist/web/chunk-3EBFYSCH.js +2 -0
- package/dist/web/chunk-3QCQ4BXS.js +1 -0
- package/dist/web/chunk-3SEJX2BK.js +1 -0
- package/dist/web/chunk-42XVAQ6I.js +1 -0
- package/dist/web/chunk-4IMMPEYM.js +1 -0
- package/dist/web/chunk-4N5DWG46.js +1 -0
- package/dist/web/chunk-4TJQJPCZ.js +1 -0
- package/dist/web/chunk-4WZIHTPC.js +1 -0
- package/dist/web/chunk-4YVSYOSD.js +1 -0
- package/dist/web/chunk-5BQIOYKW.js +1 -0
- package/dist/web/chunk-5HGWHUJA.js +1 -0
- package/dist/web/chunk-5Y244R4G.js +1 -0
- package/dist/web/chunk-6RRDPT5Z.js +1 -0
- package/dist/web/chunk-6VKB2ZWM.js +1 -0
- package/dist/web/chunk-7DMFVTU4.js +1 -0
- package/dist/web/chunk-7RNS77UP.js +1 -0
- package/dist/web/chunk-7SMPKVEP.js +1 -0
- package/dist/web/chunk-AZJVTPLU.js +1 -0
- package/dist/web/chunk-BCZM5AXU.js +1 -0
- package/dist/web/chunk-BLBRMCN2.js +1 -0
- package/dist/web/chunk-BMIAXD2V.js +2 -0
- package/dist/web/chunk-BPECIDVO.js +1 -0
- package/dist/web/chunk-BUXWEHIY.js +1 -0
- package/dist/web/chunk-BYZFQSM6.js +1 -0
- package/dist/web/chunk-DA6SNNAF.js +1 -0
- package/dist/web/chunk-DLQPZWSI.css +1 -0
- package/dist/web/chunk-DTRN7FZR.js +1 -0
- package/dist/web/chunk-DYRFLPJA.js +1 -0
- package/dist/web/chunk-E3J3CXR5.js +1 -0
- package/dist/web/chunk-E44X4RH2.js +1 -0
- package/dist/web/chunk-E73OX2P7.js +1 -0
- package/dist/web/chunk-EAXRKDLV.js +1 -0
- package/dist/web/chunk-EBKKDHYI.js +1 -0
- package/dist/web/chunk-EE7V7Q5P.js +1 -0
- package/dist/web/chunk-EKY2FUHU.js +1 -0
- package/dist/web/chunk-EMGMOEVR.js +1 -0
- package/dist/web/chunk-EP6XOPXH.js +1 -0
- package/dist/web/chunk-ESGDLJOJ.js +1 -0
- package/dist/web/chunk-ETJG7NCY.js +1 -0
- package/dist/web/chunk-EUUEFEDI.js +1 -0
- package/dist/web/chunk-FGNZDHTL.js +11 -0
- package/dist/web/chunk-FIJW2UNJ.js +1 -0
- package/dist/web/chunk-FMV5PXRC.js +5 -0
- package/dist/web/chunk-G7VZT5KB.js +3 -0
- package/dist/web/chunk-GRZYXPSO.js +7 -0
- package/dist/web/chunk-GYGPS3AN.js +1 -0
- package/dist/web/chunk-H7AF7YS4.js +1 -0
- package/dist/web/chunk-HDZDQILN.js +1 -0
- package/dist/web/chunk-HMK6UO6N.js +1 -0
- package/dist/web/chunk-HZA6NEAB.js +1 -0
- package/dist/web/chunk-IHEE5NYJ.js +1 -0
- package/dist/web/chunk-ISNEBICW.js +1 -0
- package/dist/web/chunk-J2GZVLHH.js +1 -0
- package/dist/web/chunk-JFYVCXK3.js +1 -0
- package/dist/web/chunk-JN6W7HCN.js +17 -0
- package/dist/web/chunk-JT7P3DEK.js +6 -0
- package/dist/web/chunk-JTFXTIPE.js +903 -0
- package/dist/web/chunk-L37MTFSG.js +3 -0
- package/dist/web/chunk-LB6JPLX2.js +1 -0
- package/dist/web/chunk-LNSVDHCI.js +1 -0
- package/dist/web/chunk-LV4G6QFG.js +2 -0
- package/dist/web/chunk-LVGIY3SO.js +1 -0
- package/dist/web/chunk-LXLHIHEN.js +1 -0
- package/dist/web/chunk-MC4DFIHG.js +1 -0
- package/dist/web/chunk-MVOMVPYB.js +1 -0
- package/dist/web/chunk-N6SS4G6S.js +1 -0
- package/dist/web/chunk-NTBJG6SJ.js +1 -0
- package/dist/web/chunk-NUDB3Q2Y.js +3 -0
- package/dist/web/chunk-OXEF5E3E.js +1 -0
- package/dist/web/chunk-PDN6QYGJ.js +4 -0
- package/dist/web/chunk-PGGJPDJG.js +1 -0
- package/dist/web/chunk-PUYSJNJR.js +1 -0
- package/dist/web/chunk-Q2RVFS45.js +1 -0
- package/dist/web/chunk-Q7L6LLAK.js +1 -0
- package/dist/web/chunk-QCMKJIWY.js +1 -0
- package/dist/web/chunk-QH6CF3M3.js +1 -0
- package/dist/web/chunk-QQ5LD7PI.js +1 -0
- package/dist/web/chunk-QR6L3KAC.js +1 -0
- package/dist/web/chunk-R2DLK4HO.js +1 -0
- package/dist/web/chunk-R5W2MDZN.js +1 -0
- package/dist/web/chunk-RAAMPHPJ.js +1 -0
- package/dist/web/chunk-RD6TVPOT.js +1 -0
- package/dist/web/chunk-RKY4EJYJ.js +1 -0
- package/dist/web/chunk-RONYWVY7.js +1 -0
- package/dist/web/chunk-RXKXYF2C.js +1 -0
- package/dist/web/chunk-SBWU7JFC.js +1 -0
- package/dist/web/chunk-SEXBRGYK.js +1 -0
- package/dist/web/chunk-SHPTC4RL.js +1 -0
- package/dist/web/chunk-SUZYBYDW.js +1 -0
- package/dist/web/chunk-SWKJRNYY.js +1 -0
- package/dist/web/chunk-T66XVKGB.js +1 -0
- package/dist/web/chunk-T7AZ65JP.js +1 -0
- package/dist/web/chunk-TCZDVOHD.js +1 -0
- package/dist/web/chunk-TPTITA3V.js +1 -0
- package/dist/web/chunk-TR335633.js +1 -0
- package/dist/web/chunk-TWXZK6XM.js +1 -0
- package/dist/web/chunk-UR5KDXPX.js +1 -0
- package/dist/web/chunk-UR6O2GEH.js +1 -0
- package/dist/web/chunk-UTNMGWTP.js +1 -0
- package/dist/web/chunk-UYC52MBC.js +1 -0
- package/dist/web/chunk-VECWMHJP.js +1 -0
- package/dist/web/chunk-VUACT35R.js +3 -0
- package/dist/web/chunk-VZI7H4SZ.js +1 -0
- package/dist/web/chunk-WAI2JMZP.js +1 -0
- package/dist/web/chunk-WB6YHOD4.js +1 -0
- package/dist/web/chunk-WBT64AWV.js +1 -0
- package/dist/web/chunk-WDU3WICG.js +1 -0
- package/dist/web/chunk-WFXJIXZE.js +4 -0
- package/dist/web/chunk-WTGYRH3Z.js +298 -0
- package/dist/web/chunk-WXTCVDTP.js +1 -0
- package/dist/web/chunk-X2HTISHL.js +1 -0
- package/dist/web/chunk-XCDHWLVH.js +1 -0
- package/dist/web/chunk-Y3H6FFUZ.js +1 -0
- package/dist/web/chunk-Y4F5ULGJ.js +1 -0
- package/dist/web/chunk-YAWCRPHV.js +1 -0
- package/dist/web/chunk-YEGKAAEE.js +1 -0
- package/dist/web/chunk-YM2KU57F.js +1 -0
- package/dist/web/chunk-YRERBP6T.js +1 -0
- package/dist/web/chunk-ZLV4VCDG.js +3 -0
- package/dist/web/chunk-ZTVI5KFF.js +1 -0
- package/dist/web/favicon-16.png +0 -0
- package/dist/web/favicon-180.png +0 -0
- package/dist/web/favicon-32.png +0 -0
- package/dist/web/favicon-512.png +0 -0
- package/dist/web/favicon-small.svg +15 -0
- package/dist/web/favicon.ico +0 -0
- package/dist/web/favicon.svg +20 -0
- package/dist/web/index.html +145 -0
- package/dist/web/main-ESADRXN2.css +1 -0
- package/dist/web/main-WVI3YTDU.js +1 -0
- package/dist/web/media/codicon-LN6W7LCM.ttf +0 -0
- package/dist/web/styles-KSOPUVDA.css +1 -0
- package/dist/workflows/condition-evaluator.d.ts +75 -0
- package/dist/workflows/condition-evaluator.d.ts.map +1 -0
- package/dist/workflows/condition-evaluator.js +282 -0
- package/dist/workflows/condition-evaluator.js.map +1 -0
- package/dist/workflows/defaults/claude-design-implement.yaml +247 -0
- package/dist/workflows/defaults/index.d.ts +26 -0
- package/dist/workflows/defaults/index.d.ts.map +1 -0
- package/dist/workflows/defaults/index.js +94 -0
- package/dist/workflows/defaults/index.js.map +1 -0
- package/dist/workflows/defaults/spec-author.yaml +214 -0
- package/dist/workflows/defaults/spec-fix.yaml +110 -0
- package/dist/workflows/defaults/spec-implement.yaml +150 -0
- package/dist/workflows/defaults/spec-relink.yaml +81 -0
- package/dist/workflows/defaults/spec-verify.yaml +51 -0
- package/dist/workflows/discovery.d.ts +46 -0
- package/dist/workflows/discovery.d.ts.map +1 -0
- package/dist/workflows/discovery.js +193 -0
- package/dist/workflows/discovery.js.map +1 -0
- package/dist/workflows/executor.d.ts +83 -0
- package/dist/workflows/executor.d.ts.map +1 -0
- package/dist/workflows/executor.js +624 -0
- package/dist/workflows/executor.js.map +1 -0
- package/dist/workflows/runners/approval.d.ts +18 -0
- package/dist/workflows/runners/approval.d.ts.map +1 -0
- package/dist/workflows/runners/approval.js +34 -0
- package/dist/workflows/runners/approval.js.map +1 -0
- package/dist/workflows/runners/bash.d.ts +13 -0
- package/dist/workflows/runners/bash.d.ts.map +1 -0
- package/dist/workflows/runners/bash.js +143 -0
- package/dist/workflows/runners/bash.js.map +1 -0
- package/dist/workflows/runners/cancel.d.ts +10 -0
- package/dist/workflows/runners/cancel.d.ts.map +1 -0
- package/dist/workflows/runners/cancel.js +19 -0
- package/dist/workflows/runners/cancel.js.map +1 -0
- package/dist/workflows/runners/prompt.d.ts +28 -0
- package/dist/workflows/runners/prompt.d.ts.map +1 -0
- package/dist/workflows/runners/prompt.js +212 -0
- package/dist/workflows/runners/prompt.js.map +1 -0
- package/dist/workflows/runners/script.d.ts +17 -0
- package/dist/workflows/runners/script.d.ts.map +1 -0
- package/dist/workflows/runners/script.js +155 -0
- package/dist/workflows/runners/script.js.map +1 -0
- package/dist/workflows/runners/types.d.ts +51 -0
- package/dist/workflows/runners/types.d.ts.map +1 -0
- package/dist/workflows/runners/types.js +13 -0
- package/dist/workflows/runners/types.js.map +1 -0
- package/dist/workflows/schemas/workflow.d.ts +166 -0
- package/dist/workflows/schemas/workflow.d.ts.map +1 -0
- package/dist/workflows/schemas/workflow.js +437 -0
- package/dist/workflows/schemas/workflow.js.map +1 -0
- package/package.json +1 -1
- package/scripts/offline-install.sh +19 -6
- /package/commands/{cg-explore.md → ss-explore.md} +0 -0
- /package/commands/{cg-impact.md → ss-impact.md} +0 -0
- /package/commands/{cg-relink.md → ss-relink.md} +0 -0
- /package/commands/{cg-spec.md → ss-spec.md} +0 -0
- /package/commands/{cg-sync.md → ss-sync.md} +0 -0
- /package/commands/{cg-trace.md → ss-trace.md} +0 -0
package/dist/utils.js
ADDED
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SpecShip Utilities
|
|
4
|
+
*
|
|
5
|
+
* Common utility functions for memory management, concurrency, batching,
|
|
6
|
+
* and security validation.
|
|
7
|
+
*
|
|
8
|
+
* @module utils
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { Mutex, processInBatches, MemoryMonitor, validatePathWithinRoot } from 'specship';
|
|
13
|
+
*
|
|
14
|
+
* // Use mutex for concurrent safety
|
|
15
|
+
* const mutex = new Mutex();
|
|
16
|
+
* await mutex.withLock(async () => {
|
|
17
|
+
* await performCriticalOperation();
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // Process items in batches to manage memory
|
|
21
|
+
* const results = await processInBatches(items, 100, async (item) => {
|
|
22
|
+
* return await processItem(item);
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Monitor memory usage
|
|
26
|
+
* const monitor = new MemoryMonitor(512, (usage) => {
|
|
27
|
+
* console.warn(`Memory usage exceeded 512MB: ${usage / 1024 / 1024}MB`);
|
|
28
|
+
* });
|
|
29
|
+
* monitor.start();
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
33
|
+
if (k2 === undefined) k2 = k;
|
|
34
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
35
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
36
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
37
|
+
}
|
|
38
|
+
Object.defineProperty(o, k2, desc);
|
|
39
|
+
}) : (function(o, m, k, k2) {
|
|
40
|
+
if (k2 === undefined) k2 = k;
|
|
41
|
+
o[k2] = m[k];
|
|
42
|
+
}));
|
|
43
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
44
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
45
|
+
}) : function(o, v) {
|
|
46
|
+
o["default"] = v;
|
|
47
|
+
});
|
|
48
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
49
|
+
var ownKeys = function(o) {
|
|
50
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
51
|
+
var ar = [];
|
|
52
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
53
|
+
return ar;
|
|
54
|
+
};
|
|
55
|
+
return ownKeys(o);
|
|
56
|
+
};
|
|
57
|
+
return function (mod) {
|
|
58
|
+
if (mod && mod.__esModule) return mod;
|
|
59
|
+
var result = {};
|
|
60
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
61
|
+
__setModuleDefault(result, mod);
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
})();
|
|
65
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
+
exports.MemoryMonitor = exports.Mutex = exports.FileLock = void 0;
|
|
67
|
+
exports.validatePathWithinRoot = validatePathWithinRoot;
|
|
68
|
+
exports.validateProjectPath = validateProjectPath;
|
|
69
|
+
exports.isPathWithinRoot = isPathWithinRoot;
|
|
70
|
+
exports.isPathWithinRootReal = isPathWithinRootReal;
|
|
71
|
+
exports.safeJsonParse = safeJsonParse;
|
|
72
|
+
exports.clamp = clamp;
|
|
73
|
+
exports.normalizePath = normalizePath;
|
|
74
|
+
exports.processInBatches = processInBatches;
|
|
75
|
+
exports.readFileInChunks = readFileInChunks;
|
|
76
|
+
exports.debounce = debounce;
|
|
77
|
+
exports.throttle = throttle;
|
|
78
|
+
exports.estimateSize = estimateSize;
|
|
79
|
+
const fs = __importStar(require("fs"));
|
|
80
|
+
const path = __importStar(require("path"));
|
|
81
|
+
// ============================================================
|
|
82
|
+
// SECURITY UTILITIES
|
|
83
|
+
// ============================================================
|
|
84
|
+
/**
|
|
85
|
+
* Sensitive system directories that should never be used as project roots.
|
|
86
|
+
* Checked on all platforms; non-applicable paths are harmlessly skipped.
|
|
87
|
+
*/
|
|
88
|
+
const SENSITIVE_PATHS = new Set([
|
|
89
|
+
'/', '/etc', '/usr', '/bin', '/sbin', '/var', '/tmp', '/dev', '/proc', '/sys',
|
|
90
|
+
'/root', '/boot', '/lib', '/lib64', '/opt',
|
|
91
|
+
'c:\\', 'c:\\windows', 'c:\\windows\\system32',
|
|
92
|
+
]);
|
|
93
|
+
/**
|
|
94
|
+
* Validate that a resolved file path stays within the project root.
|
|
95
|
+
* Prevents path traversal attacks (e.g. node.filePath = "../../etc/passwd").
|
|
96
|
+
*
|
|
97
|
+
* @param projectRoot - The project root directory
|
|
98
|
+
* @param filePath - The relative file path to validate
|
|
99
|
+
* @returns The resolved absolute path, or null if it escapes the root
|
|
100
|
+
*/
|
|
101
|
+
function validatePathWithinRoot(projectRoot, filePath) {
|
|
102
|
+
const resolved = path.resolve(projectRoot, filePath);
|
|
103
|
+
const normalizedRoot = path.resolve(projectRoot);
|
|
104
|
+
if (!resolved.startsWith(normalizedRoot + path.sep) && resolved !== normalizedRoot) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
return resolved;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Validate that a path is a safe project root directory.
|
|
111
|
+
*
|
|
112
|
+
* Rejects sensitive system directories and ensures the path is
|
|
113
|
+
* a real, existing directory. Used at MCP and API entry points
|
|
114
|
+
* to prevent arbitrary directory access.
|
|
115
|
+
*
|
|
116
|
+
* @param dirPath - The path to validate
|
|
117
|
+
* @returns An error message if invalid, or null if valid
|
|
118
|
+
*/
|
|
119
|
+
function validateProjectPath(dirPath) {
|
|
120
|
+
const resolved = path.resolve(dirPath);
|
|
121
|
+
// Block sensitive system directories
|
|
122
|
+
if (SENSITIVE_PATHS.has(resolved) || SENSITIVE_PATHS.has(resolved.toLowerCase())) {
|
|
123
|
+
return `Refusing to operate on sensitive system directory: ${resolved}`;
|
|
124
|
+
}
|
|
125
|
+
// Also block common sensitive home subdirectories
|
|
126
|
+
const homeDir = require('os').homedir();
|
|
127
|
+
const sensitiveHomeDirs = ['.ssh', '.gnupg', '.aws', '.config'];
|
|
128
|
+
for (const dir of sensitiveHomeDirs) {
|
|
129
|
+
const sensitivePath = path.join(homeDir, dir);
|
|
130
|
+
if (resolved === sensitivePath || resolved.startsWith(sensitivePath + path.sep)) {
|
|
131
|
+
return `Refusing to operate on sensitive directory: ${resolved}`;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Verify it's a real directory
|
|
135
|
+
try {
|
|
136
|
+
const stats = fs.statSync(resolved);
|
|
137
|
+
if (!stats.isDirectory()) {
|
|
138
|
+
return `Path is not a directory: ${resolved}`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return `Path does not exist or is not accessible: ${resolved}`;
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Check if a file path resolves to a location within the given root directory.
|
|
148
|
+
*
|
|
149
|
+
* Prevents path traversal attacks by ensuring the resolved absolute path
|
|
150
|
+
* starts with the resolved root path. Handles '..' sequences, symlink-like
|
|
151
|
+
* relative paths, and platform-specific separators.
|
|
152
|
+
*
|
|
153
|
+
* @param filePath - The path to check (can be relative or absolute)
|
|
154
|
+
* @param rootDir - The root directory that filePath must stay within
|
|
155
|
+
* @returns true if filePath resolves to a location within rootDir
|
|
156
|
+
*/
|
|
157
|
+
function isPathWithinRoot(filePath, rootDir) {
|
|
158
|
+
const resolvedPath = path.resolve(rootDir, filePath);
|
|
159
|
+
const resolvedRoot = path.resolve(rootDir);
|
|
160
|
+
return resolvedPath.startsWith(resolvedRoot + path.sep) || resolvedPath === resolvedRoot;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Like isPathWithinRoot but also resolves symlinks via fs.realpathSync.
|
|
164
|
+
*
|
|
165
|
+
* This catches symlink escapes where the logical path appears to be within
|
|
166
|
+
* root but the real path on disk points elsewhere. Falls back to logical
|
|
167
|
+
* path checking if realpath resolution fails (e.g. broken symlink).
|
|
168
|
+
*/
|
|
169
|
+
function isPathWithinRootReal(filePath, rootDir) {
|
|
170
|
+
// First do the cheap logical check
|
|
171
|
+
if (!isPathWithinRoot(filePath, rootDir)) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
// Then verify with realpath to catch symlink escapes
|
|
175
|
+
try {
|
|
176
|
+
const realPath = fs.realpathSync(path.resolve(rootDir, filePath));
|
|
177
|
+
const realRoot = fs.realpathSync(rootDir);
|
|
178
|
+
return realPath.startsWith(realRoot + path.sep) || realPath === realRoot;
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
// If realpath fails (broken symlink, permissions), fall back to logical check
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Safely parse JSON with a fallback value.
|
|
187
|
+
* Prevents crashes from corrupted database metadata.
|
|
188
|
+
*/
|
|
189
|
+
function safeJsonParse(value, fallback) {
|
|
190
|
+
try {
|
|
191
|
+
return JSON.parse(value);
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
return fallback;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Clamp a numeric value to a range.
|
|
199
|
+
* Used to enforce sane limits on MCP tool inputs.
|
|
200
|
+
*/
|
|
201
|
+
function clamp(value, min, max) {
|
|
202
|
+
return Math.max(min, Math.min(max, value));
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Normalize a file path to use forward slashes.
|
|
206
|
+
* Fixes Windows backslash paths so glob matching works consistently.
|
|
207
|
+
*/
|
|
208
|
+
function normalizePath(filePath) {
|
|
209
|
+
return filePath.replace(/\\/g, '/');
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Cross-process file lock using a lock file with PID tracking.
|
|
213
|
+
*
|
|
214
|
+
* Prevents multiple processes (e.g., git hooks, CLI, MCP server) from
|
|
215
|
+
* writing to the same database simultaneously.
|
|
216
|
+
*/
|
|
217
|
+
class FileLock {
|
|
218
|
+
lockPath;
|
|
219
|
+
held = false;
|
|
220
|
+
/** Locks older than this are considered stale regardless of PID status */
|
|
221
|
+
static STALE_TIMEOUT_MS = 2 * 60 * 1000; // 2 minutes
|
|
222
|
+
constructor(lockPath) {
|
|
223
|
+
this.lockPath = lockPath;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Acquire the lock. Throws if the lock is held by another live process.
|
|
227
|
+
*/
|
|
228
|
+
acquire() {
|
|
229
|
+
// Check for existing lock
|
|
230
|
+
if (fs.existsSync(this.lockPath)) {
|
|
231
|
+
try {
|
|
232
|
+
const content = fs.readFileSync(this.lockPath, 'utf-8').trim();
|
|
233
|
+
const pid = parseInt(content, 10);
|
|
234
|
+
const stat = fs.statSync(this.lockPath);
|
|
235
|
+
const lockAge = Date.now() - stat.mtimeMs;
|
|
236
|
+
// Treat locks older than the timeout as stale, regardless of PID
|
|
237
|
+
if (lockAge < FileLock.STALE_TIMEOUT_MS && !isNaN(pid) && this.isProcessAlive(pid)) {
|
|
238
|
+
throw new Error(`SpecShip database is locked by another process (PID ${pid}). ` +
|
|
239
|
+
`If this is stale, run 'specship unlock' or delete ${this.lockPath}`);
|
|
240
|
+
}
|
|
241
|
+
// Stale lock (dead process or timed out) - remove it
|
|
242
|
+
fs.unlinkSync(this.lockPath);
|
|
243
|
+
}
|
|
244
|
+
catch (err) {
|
|
245
|
+
if (err instanceof Error && err.message.includes('locked by another')) {
|
|
246
|
+
throw err;
|
|
247
|
+
}
|
|
248
|
+
// Other errors reading lock file - try to remove it
|
|
249
|
+
try {
|
|
250
|
+
fs.unlinkSync(this.lockPath);
|
|
251
|
+
}
|
|
252
|
+
catch { /* ignore */ }
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// Write our PID to the lock file using exclusive create flag
|
|
256
|
+
try {
|
|
257
|
+
fs.writeFileSync(this.lockPath, String(process.pid), { flag: 'wx' });
|
|
258
|
+
this.held = true;
|
|
259
|
+
}
|
|
260
|
+
catch (err) {
|
|
261
|
+
if (err.code === 'EEXIST') {
|
|
262
|
+
// Race condition: another process grabbed the lock between our check and write
|
|
263
|
+
throw new Error('SpecShip database is locked by another process. ' +
|
|
264
|
+
`If this is stale, run 'specship unlock' or delete ${this.lockPath}`);
|
|
265
|
+
}
|
|
266
|
+
throw err;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Release the lock
|
|
271
|
+
*/
|
|
272
|
+
release() {
|
|
273
|
+
if (!this.held)
|
|
274
|
+
return;
|
|
275
|
+
try {
|
|
276
|
+
// Only remove if we still own it (check PID)
|
|
277
|
+
const content = fs.readFileSync(this.lockPath, 'utf-8').trim();
|
|
278
|
+
if (parseInt(content, 10) === process.pid) {
|
|
279
|
+
fs.unlinkSync(this.lockPath);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
catch {
|
|
283
|
+
// Lock file already gone - that's fine
|
|
284
|
+
}
|
|
285
|
+
this.held = false;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Execute a function while holding the lock
|
|
289
|
+
*/
|
|
290
|
+
withLock(fn) {
|
|
291
|
+
this.acquire();
|
|
292
|
+
try {
|
|
293
|
+
return fn();
|
|
294
|
+
}
|
|
295
|
+
finally {
|
|
296
|
+
this.release();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Execute an async function while holding the lock
|
|
301
|
+
*/
|
|
302
|
+
async withLockAsync(fn) {
|
|
303
|
+
this.acquire();
|
|
304
|
+
try {
|
|
305
|
+
return await fn();
|
|
306
|
+
}
|
|
307
|
+
finally {
|
|
308
|
+
this.release();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Check if a process is still running
|
|
313
|
+
*/
|
|
314
|
+
isProcessAlive(pid) {
|
|
315
|
+
try {
|
|
316
|
+
process.kill(pid, 0);
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
exports.FileLock = FileLock;
|
|
325
|
+
/**
|
|
326
|
+
* Process items in batches to manage memory
|
|
327
|
+
*
|
|
328
|
+
* @param items - Array of items to process
|
|
329
|
+
* @param batchSize - Number of items per batch
|
|
330
|
+
* @param processor - Function to process each item
|
|
331
|
+
* @param onBatchComplete - Optional callback after each batch
|
|
332
|
+
* @returns Array of results
|
|
333
|
+
*/
|
|
334
|
+
async function processInBatches(items, batchSize, processor, onBatchComplete) {
|
|
335
|
+
const results = [];
|
|
336
|
+
for (let i = 0; i < items.length; i += batchSize) {
|
|
337
|
+
const batch = items.slice(i, Math.min(i + batchSize, items.length));
|
|
338
|
+
const batchResults = await Promise.all(batch.map((item, idx) => processor(item, i + idx)));
|
|
339
|
+
results.push(...batchResults);
|
|
340
|
+
if (onBatchComplete) {
|
|
341
|
+
onBatchComplete(Math.min(i + batchSize, items.length), items.length);
|
|
342
|
+
}
|
|
343
|
+
// Allow GC between batches
|
|
344
|
+
if (global.gc) {
|
|
345
|
+
global.gc();
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return results;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Simple mutex lock for preventing concurrent operations
|
|
352
|
+
*/
|
|
353
|
+
class Mutex {
|
|
354
|
+
locked = false;
|
|
355
|
+
waitQueue = [];
|
|
356
|
+
/**
|
|
357
|
+
* Acquire the lock
|
|
358
|
+
*
|
|
359
|
+
* @returns A release function to call when done
|
|
360
|
+
*/
|
|
361
|
+
async acquire() {
|
|
362
|
+
while (this.locked) {
|
|
363
|
+
await new Promise((resolve) => {
|
|
364
|
+
this.waitQueue.push(resolve);
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
this.locked = true;
|
|
368
|
+
return () => {
|
|
369
|
+
this.locked = false;
|
|
370
|
+
const next = this.waitQueue.shift();
|
|
371
|
+
if (next) {
|
|
372
|
+
next();
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Execute a function while holding the lock
|
|
378
|
+
*/
|
|
379
|
+
async withLock(fn) {
|
|
380
|
+
const release = await this.acquire();
|
|
381
|
+
try {
|
|
382
|
+
return await fn();
|
|
383
|
+
}
|
|
384
|
+
finally {
|
|
385
|
+
release();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Check if the lock is currently held
|
|
390
|
+
*/
|
|
391
|
+
isLocked() {
|
|
392
|
+
return this.locked;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
exports.Mutex = Mutex;
|
|
396
|
+
/**
|
|
397
|
+
* Chunked file reader for large files
|
|
398
|
+
*
|
|
399
|
+
* Reads a file in chunks to avoid loading entire file into memory.
|
|
400
|
+
*/
|
|
401
|
+
async function* readFileInChunks(filePath, chunkSize = 64 * 1024) {
|
|
402
|
+
const fs = await Promise.resolve().then(() => __importStar(require('fs')));
|
|
403
|
+
const fd = fs.openSync(filePath, 'r');
|
|
404
|
+
const buffer = Buffer.alloc(chunkSize);
|
|
405
|
+
try {
|
|
406
|
+
let bytesRead;
|
|
407
|
+
while ((bytesRead = fs.readSync(fd, buffer, 0, chunkSize, null)) > 0) {
|
|
408
|
+
yield buffer.toString('utf-8', 0, bytesRead);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
finally {
|
|
412
|
+
fs.closeSync(fd);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Debounce a function
|
|
417
|
+
*
|
|
418
|
+
* @param fn - Function to debounce
|
|
419
|
+
* @param delay - Delay in milliseconds
|
|
420
|
+
* @returns Debounced function
|
|
421
|
+
*/
|
|
422
|
+
function debounce(fn, delay) {
|
|
423
|
+
let timeoutId = null;
|
|
424
|
+
return (...args) => {
|
|
425
|
+
if (timeoutId) {
|
|
426
|
+
clearTimeout(timeoutId);
|
|
427
|
+
}
|
|
428
|
+
timeoutId = setTimeout(() => {
|
|
429
|
+
fn(...args);
|
|
430
|
+
timeoutId = null;
|
|
431
|
+
}, delay);
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Throttle a function
|
|
436
|
+
*
|
|
437
|
+
* @param fn - Function to throttle
|
|
438
|
+
* @param limit - Minimum time between calls in milliseconds
|
|
439
|
+
* @returns Throttled function
|
|
440
|
+
*/
|
|
441
|
+
function throttle(fn, limit) {
|
|
442
|
+
let lastCall = 0;
|
|
443
|
+
let timeoutId = null;
|
|
444
|
+
return (...args) => {
|
|
445
|
+
const now = Date.now();
|
|
446
|
+
const remaining = limit - (now - lastCall);
|
|
447
|
+
if (remaining <= 0) {
|
|
448
|
+
if (timeoutId) {
|
|
449
|
+
clearTimeout(timeoutId);
|
|
450
|
+
timeoutId = null;
|
|
451
|
+
}
|
|
452
|
+
lastCall = now;
|
|
453
|
+
fn(...args);
|
|
454
|
+
}
|
|
455
|
+
else if (!timeoutId) {
|
|
456
|
+
timeoutId = setTimeout(() => {
|
|
457
|
+
lastCall = Date.now();
|
|
458
|
+
timeoutId = null;
|
|
459
|
+
fn(...args);
|
|
460
|
+
}, remaining);
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Estimate memory usage of an object (rough approximation)
|
|
466
|
+
*
|
|
467
|
+
* @param obj - Object to measure
|
|
468
|
+
* @returns Approximate size in bytes
|
|
469
|
+
*/
|
|
470
|
+
function estimateSize(obj) {
|
|
471
|
+
const seen = new WeakSet();
|
|
472
|
+
function sizeOf(value) {
|
|
473
|
+
if (value === null || value === undefined) {
|
|
474
|
+
return 0;
|
|
475
|
+
}
|
|
476
|
+
switch (typeof value) {
|
|
477
|
+
case 'boolean':
|
|
478
|
+
return 4;
|
|
479
|
+
case 'number':
|
|
480
|
+
return 8;
|
|
481
|
+
case 'string':
|
|
482
|
+
return 2 * value.length;
|
|
483
|
+
case 'object':
|
|
484
|
+
if (seen.has(value)) {
|
|
485
|
+
return 0;
|
|
486
|
+
}
|
|
487
|
+
seen.add(value);
|
|
488
|
+
if (Array.isArray(value)) {
|
|
489
|
+
return value.reduce((acc, item) => acc + sizeOf(item), 0);
|
|
490
|
+
}
|
|
491
|
+
return Object.entries(value).reduce((acc, [key, val]) => acc + sizeOf(key) + sizeOf(val), 0);
|
|
492
|
+
default:
|
|
493
|
+
return 0;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return sizeOf(obj);
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Memory monitor for tracking usage during operations
|
|
500
|
+
*/
|
|
501
|
+
class MemoryMonitor {
|
|
502
|
+
checkInterval = null;
|
|
503
|
+
peakUsage = 0;
|
|
504
|
+
threshold;
|
|
505
|
+
onThresholdExceeded;
|
|
506
|
+
constructor(thresholdMB = 500, onThresholdExceeded) {
|
|
507
|
+
this.threshold = thresholdMB * 1024 * 1024;
|
|
508
|
+
this.onThresholdExceeded = onThresholdExceeded;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Start monitoring memory usage
|
|
512
|
+
*/
|
|
513
|
+
start(intervalMs = 1000) {
|
|
514
|
+
this.stop();
|
|
515
|
+
this.peakUsage = 0;
|
|
516
|
+
this.checkInterval = setInterval(() => {
|
|
517
|
+
const usage = process.memoryUsage().heapUsed;
|
|
518
|
+
if (usage > this.peakUsage) {
|
|
519
|
+
this.peakUsage = usage;
|
|
520
|
+
}
|
|
521
|
+
if (usage > this.threshold && this.onThresholdExceeded) {
|
|
522
|
+
this.onThresholdExceeded(usage);
|
|
523
|
+
}
|
|
524
|
+
}, intervalMs);
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Stop monitoring
|
|
528
|
+
*/
|
|
529
|
+
stop() {
|
|
530
|
+
if (this.checkInterval) {
|
|
531
|
+
clearInterval(this.checkInterval);
|
|
532
|
+
this.checkInterval = null;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Get peak memory usage in bytes
|
|
537
|
+
*/
|
|
538
|
+
getPeakUsage() {
|
|
539
|
+
return this.peakUsage;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Get current memory usage in bytes
|
|
543
|
+
*/
|
|
544
|
+
getCurrentUsage() {
|
|
545
|
+
return process.memoryUsage().heapUsed;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
exports.MemoryMonitor = MemoryMonitor;
|
|
549
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BH,wDAQC;AAYD,kDA6BC;AAaD,4CAIC;AASD,oDAeC;AAMD,sCAMC;AAM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C;QAC5B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;IACxC,CAAC;CACF;AAvDD,sCAuDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-Q7L6LLAK.js";var e={comments:{lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}],folding:{offSide:!0}},t={defaultToken:"",tokenPostfix:".pug",ignoreCase:!0,brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],keywords:["append","block","case","default","doctype","each","else","extends","for","if","in","include","mixin","typeof","unless","var","when"],tags:["a","abbr","acronym","address","area","article","aside","audio","b","base","basefont","bdi","bdo","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","li","link","map","mark","menu","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","tracks","tt","u","ul","video","wbr"],symbols:/[\+\-\*\%\&\|\!\=\/\.\,\:]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)([a-zA-Z_-][\w-]*)/,{cases:{"$2@tags":{cases:{"@eos":["","tag"],"@default":["",{token:"tag",next:"@tag.$1"}]}},"$2@keywords":["",{token:"keyword.$2"}],"@default":["",""]}}],[/^(\s*)(#[a-zA-Z_-][\w-]*)/,{cases:{"@eos":["","tag.id"],"@default":["",{token:"tag.id",next:"@tag.$1"}]}}],[/^(\s*)(\.[a-zA-Z_-][\w-]*)/,{cases:{"@eos":["","tag.class"],"@default":["",{token:"tag.class",next:"@tag.$1"}]}}],[/^(\s*)(\|.*)$/,""],{include:"@whitespace"},[/[a-zA-Z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":""}}],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d+\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\d+/,"number"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],tag:[[/(\.)(\s*$)/,[{token:"delimiter",next:"@blockText.$S2."},""]],[/\s+/,{token:"",next:"@simpleText"}],[/#[a-zA-Z_-][\w-]*/,{cases:{"@eos":{token:"tag.id",next:"@pop"},"@default":"tag.id"}}],[/\.[a-zA-Z_-][\w-]*/,{cases:{"@eos":{token:"tag.class",next:"@pop"},"@default":"tag.class"}}],[/\(/,{token:"delimiter.parenthesis",next:"@attributeList"}]],simpleText:[[/[^#]+$/,{token:"",next:"@popall"}],[/[^#]+/,{token:""}],[/(#{)([^}]*)(})/,{cases:{"@eos":["interpolation.delimiter","interpolation",{token:"interpolation.delimiter",next:"@popall"}],"@default":["interpolation.delimiter","interpolation","interpolation.delimiter"]}}],[/#$/,{token:"",next:"@popall"}],[/#/,""]],attributeList:[[/\s+/,""],[/(\w+)(\s*=\s*)("|')/,["attribute.name","delimiter",{token:"attribute.value",next:"@value.$3"}]],[/\w+/,"attribute.name"],[/,/,{cases:{"@eos":{token:"attribute.delimiter",next:"@popall"},"@default":"attribute.delimiter"}}],[/\)$/,{token:"delimiter.parenthesis",next:"@popall"}],[/\)/,{token:"delimiter.parenthesis",next:"@pop"}]],whitespace:[[/^(\s*)(\/\/.*)$/,{token:"comment",next:"@blockText.$1.comment"}],[/[ \t\r\n]+/,""],[/<!--/,{token:"comment",next:"@comment"}]],blockText:[[/^\s+.*$/,{cases:{"($S2\\s+.*$)":{token:"$S3"},"@default":{token:"@rematch",next:"@popall"}}}],[/./,{token:"@rematch",next:"@popall"}]],comment:[[/[^<\-]+/,"comment.content"],[/-->/,{token:"comment",next:"@pop"}],[/<!--/,"comment.content.invalid"],[/[<\-]/,"comment.content"]],string:[[/[^\\"'#]+/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/@escapes/,{cases:{"@eos":{token:"string.escape",next:"@popall"},"@default":"string.escape"}}],[/\\./,{cases:{"@eos":{token:"string.escape.invalid",next:"@popall"},"@default":"string.escape.invalid"}}],[/(#{)([^}]*)(})/,["interpolation.delimiter","interpolation","interpolation.delimiter"]],[/#/,"string"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":{token:"string"}}}]],value:[[/[^\\"']+/,{cases:{"@eos":{token:"attribute.value",next:"@popall"},"@default":"attribute.value"}}],[/\\./,{cases:{"@eos":{token:"attribute.value",next:"@popall"},"@default":"attribute.value"}}],[/["']/,{cases:{"$#==$S2":{token:"attribute.value",next:"@pop"},"@default":{token:"attribute.value"}}}]]}};export{e as conf,t as language};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./chunk-Q7L6LLAK.js";var n=e=>`\\b${e}\\b`,t="[_a-zA-Z]",o="[_a-zA-Z0-9]",i=n(`${t}${o}*`),r=["targetScope","resource","module","param","var","output","for","in","if","existing"],s=["true","false","null"],c="[ \\t\\r\\n]",a="[0-9]+",g={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:"'''",close:"'''"}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:"'''",close:"'''",notIn:["string","comment"]}],autoCloseBefore:`:.,=}])'
|
|
2
|
+
`,indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}},l={defaultToken:"",tokenPostfix:".bicep",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~?:&|+\-*/^%]+/,keywords:r,namedLiterals:s,escapes:"\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",tokenizer:{root:[{include:"@expression"},{include:"@whitespace"}],stringVerbatim:[{regex:"(|'|'')[^']",action:{token:"string"}},{regex:"'''",action:{token:"string.quote",next:"@pop"}}],stringLiteral:[{regex:"\\${",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"[^\\\\'$]+",action:{token:"string"}},{regex:"@escapes",action:{token:"string.escape"}},{regex:"\\\\.",action:{token:"string.escape.invalid"}},{regex:"'",action:{token:"string",next:"@pop"}}],bracketCounting:[{regex:"{",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"}",action:{token:"delimiter.bracket",next:"@pop"}},{include:"expression"}],comment:[{regex:"[^\\*]+",action:{token:"comment"}},{regex:"\\*\\/",action:{token:"comment",next:"@pop"}},{regex:"[\\/*]",action:{token:"comment"}}],whitespace:[{regex:c},{regex:"\\/\\*",action:{token:"comment",next:"@comment"}},{regex:"\\/\\/.*$",action:{token:"comment"}}],expression:[{regex:"'''",action:{token:"string.quote",next:"@stringVerbatim"}},{regex:"'",action:{token:"string.quote",next:"@stringLiteral"}},{regex:a,action:{token:"number"}},{regex:i,action:{cases:{"@keywords":{token:"keyword"},"@namedLiterals":{token:"keyword"},"@default":{token:"identifier"}}}}]}};export{g as conf,l as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as W}from"./chunk-X2HTISHL.js";import{a as Q}from"./chunk-UYC52MBC.js";import{a as U}from"./chunk-SUZYBYDW.js";import{a as Y,b as G}from"./chunk-4N5DWG46.js";import{d as B}from"./chunk-SHPTC4RL.js";import{a as H}from"./chunk-7RNS77UP.js";import{a as $}from"./chunk-E44X4RH2.js";import{Aa as m,Ea as T,Fa as O,I as c,Ia as S,Ka as C,R,Ta as D,Ua as I,Va as s,W as f,Wa as g,X as E,Xa as h,Za as z,bb as u,cb as F,ea as a,eb as j,gb as L,ib as N,ka as P,lb as w,qa as M,ra as v,sa as x,ua as k,va as y,vb as A,wa as b,xa as d,ya as r,za as o,zb as J}from"./chunk-PDN6QYGJ.js";import"./chunk-Q7L6LLAK.js";var K=()=>({value:"time",label:"Latest"}),V=()=>({value:"cost",label:"Cost"}),X=()=>({value:"prompts",label:"Prompts"}),Z=(i,e,t)=>[i,e,t],ee=()=>[0,1,2,3,4],te=i=>["/sessions",i],ne=(i,e)=>e.fullId;function ie(i,e){i&1&&(r(0,"span",10),s(1,"\u26A0 refresh failed"),o()),i&2&&d("title",e)}function re(i,e){i&1&&(r(0,"div",20),m(1,"div",21),o())}function oe(i,e){i&1&&y(0,re,2,0,"div",20,k),i&2&&b(u(0,ee))}function se(i,e){i&1&&(r(0,"div",19),s(1," No sessions in this range. Either nothing's been logged yet, or the JSONL ingest watcher hasn't caught up \u2014 click Refresh. "),o())}function ae(i,e){if(i&1&&(r(0,"a",22)(1,"span",23),s(2),o(),r(3,"span",17)(4,"app-pill"),s(5),o()(),r(6,"span",24),s(7),o(),r(8,"span",25),s(9),o(),r(10,"span",25),s(11),L(12,"number"),o(),r(13,"span",26),s(14),o()()),i&2){let t=e.$implicit,n=C(2);d("routerLink",F(15,te,t.fullId)),M("aria-label","Open session "+t.id),a(2),g(t.id),a(3),g(t.project),a(2),z(" ",t.started," \u2013 ",t.ended," \xB7 ",t.model," "),a(2),g(t.prompts),a(),D("color",n.cacheColor(t.cache)),a(),h(" ",N(12,12,t.cache*100,"1.0-0"),"% "),a(3),h(" $",t.cost.toFixed(2)," ")}}function le(i,e){if(i&1&&y(0,ae,15,17,"a",22,ne),i&2){let t=C();b(t.sorted())}}var de=1e4,q=class i{api=c($);projects=c(H);refresh=c(Y);destroyRef=c(R);range=f("all");sort=f("time");ranges=["today","week","month","all"];localRefreshing=f(!1);resource=G(this.api,()=>`/api/claude/sessions?range=${this.range()}&limit=200${this.projects.projectQuery("&")}`);rows=w(()=>(this.resource.state().data?.sessions??[]).map(t=>this.adapt(t)));sorted=w(()=>{let e=this.sort();return[...this.rows()].sort((t,n)=>e==="cost"?n.cost-t.cost:e==="prompts"?n.prompts-t.prompts:n.startedAt-t.startedAt)});constructor(){let e=null,t=()=>{e===null&&(e=setInterval(()=>{typeof document<"u"&&document.visibilityState==="visible"&&this.resource.refetch()},de))},n=()=>{e!==null&&(clearInterval(e),e=null)},l=()=>{typeof document>"u"||document.visibilityState==="visible"&&this.resource.refetch()};t(),typeof document<"u"&&document.addEventListener("visibilitychange",l),this.destroyRef.onDestroy(()=>{n(),typeof document<"u"&&document.removeEventListener("visibilitychange",l)}),E(()=>{!this.resource.state().loading&&this.localRefreshing()&&this.localRefreshing.set(!1)})}async forceRefresh(){this.localRefreshing.set(!0),await this.refresh.triggerGlobalRefresh()}adapt(e){let t=(e.total_input_tokens||0)+(e.total_cache_creation_tokens||0)+(e.total_cache_read_tokens||0);return{id:(e.id||"").slice(0,8),fullId:e.id,project:(e.project_path||"").split("/").filter(Boolean).pop()||"?",startedAt:e.started_at||0,started:this.fmtTime(e.started_at),ended:this.fmtTime(e.ended_at).split(" ").pop()||"",prompts:e.prompt_count||0,cost:e.total_cost_usd||0,cache:t>0?(e.total_cache_read_tokens||0)/t:0,model:e.last_model||"unknown"}}fmtTime(e){if(!e)return"";try{let t=new Date(e),n=new Date;n.setHours(0,0,0,0);let l=864e5,p=n.getTime()-new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),_=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return p===0?"Today "+_:p===l?"Yest "+_:t.toLocaleDateString([],{month:"short",day:"numeric"})+" "+_}catch{return String(e)}}setSort(e){this.sort.set(e)}setRange(e){this.range.set(e)}cacheColor(e){return e>=.7?"var(--success)":e>=.5?"var(--warn)":"var(--error)"}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=P({type:i,selectors:[["app-sessions"]],decls:35,vars:18,consts:[[1,"page"],[2,"padding","16px 18px 12px"],["icon","sessions","title","Sessions",3,"sub"],["actions",""],["type","button","title","Force refresh: sync the index + re-ingest Claude Code transcripts","aria-label","Refresh sessions",1,"btn","btn-secondary","btn-sm","refresh-btn",3,"click","disabled"],["name","refresh",3,"size"],[1,"filter-bar",2,"padding","0 18px 12px"],["name","filter",2,"color","var(--text-muted)",3,"size"],[1,"input",2,"font-size","12px","padding","4px 8px"],[1,"grow"],[2,"color","var(--warn)","font-size","11.5px","cursor","help",3,"title"],[1,"muted",2,"font-size","11.5px"],["size","sm",3,"change","value","options"],[1,"scroll-y",2,"flex","1","padding","0 18px 18px"],[1,"card",2,"overflow","hidden"],[1,"row",2,"padding","8px 14px","font-size","10.5px","color","var(--text-muted)","text-transform","uppercase","letter-spacing","0.05em","font-weight","600","border-bottom","1px solid var(--border-subtle)"],[2,"width","90px"],[2,"width","110px"],[2,"width","70px","text-align","right"],[2,"padding","28px 18px","text-align","center","color","var(--text-secondary)","font-size","12.5px","line-height","1.5"],[1,"row",2,"padding","10px 14px","border-top","1px solid var(--border-subtle)"],[1,"skel",2,"flex","1","height","18px"],[1,"row","session-row",2,"padding","11px 14px","border-top","1px solid var(--border-subtle)","display","flex","align-items","center","gap","0","text-decoration","none","color","inherit","cursor","pointer",3,"routerLink"],[1,"mono",2,"width","90px","font-size","12px"],[1,"mono","muted","grow",2,"font-size","11.5px","overflow","hidden","text-overflow","ellipsis","white-space","nowrap"],[1,"mono","tabular",2,"width","70px","text-align","right","font-size","12px"],[1,"mono","tabular",2,"width","70px","text-align","right","font-size","12.5px","font-weight","600"]],template:function(t,n){if(t&1&&(r(0,"div",0)(1,"div",1)(2,"app-page-head",2),T(3,3),r(4,"button",4),S("click",function(){return n.forceRefresh()}),m(5,"app-icon",5),s(6),o(),O(),o()(),r(7,"div",6),m(8,"app-icon",7),r(9,"select",8)(10,"option"),s(11,"All models"),o()(),m(12,"div",9),v(13,ie,2,1,"span",10),r(14,"span",11),s(15,"sort"),o(),r(16,"app-segmented",12),S("change",function(p){return n.setSort(p)}),o()(),r(17,"div",13)(18,"div",14)(19,"div",15)(20,"span",16),s(21,"Session"),o(),r(22,"span",17),s(23,"Project"),o(),r(24,"span",9),s(25,"Window"),o(),r(26,"span",18),s(27,"Prompts"),o(),r(28,"span",18),s(29,"Cache"),o(),r(30,"span",18),s(31,"Cost"),o()(),v(32,oe,2,1)(33,se,2,0,"div",19)(34,le,2,0),o()()()),t&2){let l;a(2),d("sub",n.resource.state().loading?"loading\u2026":n.sorted().length+" sessions \xB7 across all projects"),a(2),I("spinning",n.localRefreshing()||n.refresh.loading()),d("disabled",n.refresh.loading()),a(),d("size",13),a(),h(" ",n.localRefreshing()||n.refresh.loading()?"Refreshing\u2026":"Refresh"," "),a(2),d("size",13),a(5),x((l=n.refresh.error())?13:-1,l),a(3),d("value",n.sort())("options",j(14,Z,u(11,K),u(12,V),u(13,X))),a(16),x(n.resource.state().loading&&n.sorted().length===0?32:n.sorted().length===0?33:34)}},dependencies:[B,J,Q,U,W,A],styles:["[_nghost-%COMP%]{display:contents}.page[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:0}.filter-bar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.card[_ngcontent-%COMP%]{background:var(--bg-panel);border:1px solid var(--border-subtle);border-radius:var(--r-lg)}.row[_ngcontent-%COMP%]{display:flex;align-items:center}.session-row[_ngcontent-%COMP%]:hover{background:var(--bg-hover)}.session-row[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.skel[_ngcontent-%COMP%]{background:var(--bg-elevated);border-radius:5px;animation:_ngcontent-%COMP%_skeleton 1.4s ease-in-out infinite}@keyframes _ngcontent-%COMP%_skeleton{0%,to{opacity:.5}50%{opacity:.9}}.refresh-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px}.refresh-btn.spinning[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin .9s linear infinite;color:var(--accent)}.refresh-btn[_ngcontent-%COMP%]:disabled{cursor:progress;opacity:.8}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"],changeDetection:0})};export{q as Sessions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$a as B,Aa as x,Ga as K,Ia as N,Ka as c,M as k,N as M,O as S,P as R,Ra as U,Sa as A,Ta as C,Ua as L,Va as P,W as H,Wa as Y,X as D,Xa as Q,_a as Z,ab as z,ea as s,ka as q,lb as E,ob as j,pb as w,qa as G,qb as J,ra as y,sa as _,ta as W,va as T,wa as V,xa as $,ya as p,za as u,zb as ee}from"./chunk-PDN6QYGJ.js";import{a as O,b as I}from"./chunk-Q7L6LLAK.js";var se=["host"],de=(r,t)=>t.id;function ce(r,t){if(r&1&&(S(),x(0,"path",9)),r&2){let e=c().$implicit,n=c();G("d",t)("stroke",n.edgeStroke(e))("stroke-width",n.edgeStrokeWidth(e))("opacity",n.edgeOpacity(e))("stroke-dasharray",e.kind==="synth"?"5 4":null)("marker-end",n.edgeHot(e)?"url(#gc-arrow-hi)":"url(#gc-arrow)")}}function le(r,t){if(r&1&&y(0,ce,1,6,":svg:path",9),r&2){let e,n=t.$implicit,i=c();_((e=i.edgePath(n))?0:-1,e)}}function pe(r,t){if(r&1&&(p(0,"div",12),P(1),u()),r&2){let e=c(2).$implicit;s(),Y(e.label)}}function ue(r,t){if(r&1&&(x(0,"div",11),y(1,pe,2,1,"div",12)),r&2){let e=c().$implicit,n=z(1),i=z(2),o=c();C("background",n)("transform","scale("+i+")")("box-shadow",o.isSelected(e)?"0 0 0 4px "+n+"44, 0 0 14px "+n:o.isHovered(e)?"0 0 0 3px "+n+"33":"0 0 8px "+n+"66"),s(),_(o.isHovered(e)||o.isSelected(e)?1:-1)}}function me(r,t){if(r&1&&x(0,"span",17),r&2){let e=c(2).$implicit;C("background",e.state==="drifted"?"var(--warn)":"var(--error)")}}function ge(r,t){if(r&1&&(p(0,"div",16),P(1),u()),r&2){let e=c(2).$implicit;s(),Y(e.sub)}}function he(r,t){if(r&1&&(p(0,"div",13),x(1,"span",14),P(2),y(3,me,1,2,"span",15),u(),y(4,ge,2,1,"div",16)),r&2){let e=c().$implicit,n=z(0),i=z(1),o=z(2),a=c();C("min-width",n.w,"px")("transform","scale("+o+")")("transform-origin","center center")("background","color-mix(in srgb, "+i+" 16%, var(--bg-panel))")("border-color",a.isSelected(e)||e.kind==="spec"&&(e.state==="drifted"||e.state==="broken"||e.state==="orphaned")?i:"color-mix(in srgb, "+i+" 45%, transparent)")("box-shadow",a.isSelected(e)?"0 0 0 4px "+i+"33, 0 4px 16px "+i+"44":a.isHovered(e)?"0 0 0 3px "+i+"22":"0 2px 8px rgba(0,0,0,0.4)"),L("is-rect",n.shape==="rect"),s(),C("background",i)("box-shadow","0 0 6px "+i),s(),Q(" ",e.label," "),s(),_(e.state==="drifted"||e.state==="broken"||e.state==="orphaned"?3:-1),s(),_(a.isHovered(e)&&(e.sub||e.kind==="file")?4:-1)}}function ve(r,t){if(r&1){let e=K();Z(0)(1)(2),p(3,"div",10),N("mouseenter",function(){let i=k(e).$implicit,o=c();return M(o.onHoverEnter(i.id))})("mouseleave",function(){k(e);let i=c();return M(i.onHoverLeave())}),y(4,ue,2,7)(5,he,5,21),u()}if(r&2){let e=t.$implicit,n=c(),i=B(n.box(e));s(),B(n.nodeColor(e)),s(),B(n.nodeScale(e)),s(),C("left",e.x,"px")("top",e.y,"px")("opacity",n.nodeOpacity(e)),L("is-selected",n.isSelected(e))("is-hovered",n.isHovered(e)),G("data-node",e.id),s(),_(i.shape==="dot"?4:5)}}function xe(r,t){if(r&1&&(S(),x(0,"circle",28)),r&2){let e=t.$implicit,n=c(3);G("cx",e.cx)("cy",e.cy)("r",e.kind==="route"?1.6:2.1)("fill",n.minimapNodeColor(e.kind,e.state))}}function be(r,t){if(r&1&&(S(),x(0,"rect",29)),r&2){let e=t;G("x",e.x)("y",e.y)("width",e.w)("height",e.h)}}function fe(r,t){if(r&1&&(S(),p(0,"svg",26),T(1,xe,1,4,":svg:circle",28,W),y(3,be,1,4,":svg:rect",29),u()),r&2){let e,n=c(2);s(),V(n.minimapNodes()),s(2),_((e=n.minimapViewport())?3:-1,e)}}function ye(r,t){if(r&1){let e=K();p(0,"div",18)(1,"button",19),N("click",function(){k(e);let i=c();return M(i.zoom(1.2))}),x(2,"app-icon",20),u(),p(3,"button",21),N("click",function(){k(e);let i=c();return M(i.zoom(1/1.2))}),x(4,"app-icon",22),u(),p(5,"button",23),N("click",function(){k(e);let i=c();return M(i.fitView())}),x(6,"app-icon",24),u()(),p(7,"div",25),y(8,fe,4,1,":svg:svg",26),p(9,"div",27),P(10),u()()}if(r&2){let e=c();s(2),$("size",15),s(2),$("size",15),s(2),$("size",15),s(2),_(e.positioned().length>0?8:-1),s(2),Y(e.zoomLabel())}}var te=class r{nodes=w([]);edges=w([]);selectedId=w(null);fitKey=w(0);hiddenIds=w(new Set);interactive=w(!0);dotGrid=w(!0);nodeClick=j();host=J.required("host");view=H({tx:0,ty:0,k:1});hover=H(null);draggedNodes=H({});hostSize=H({w:0,h:0});drag=null;resizeObs=null;positioned=E(()=>{let t=this.draggedNodes();return this.nodes().map(e=>{let n=t[e.id];return n?I(O({},e),{x:n.x,y:n.y}):e})});nodeMap=E(()=>{let t=new Map;for(let e of this.positioned())t.set(e.id,e);return t});neighborSet=E(()=>{let t=this.selectedId(),e=new Set;if(!t)return e;for(let n of this.edges())n.from===t&&e.add(n.to),n.to===t&&e.add(n.from);return e});degreeMap=E(()=>{let t={};for(let e of this.edges())t[e.from]=(t[e.from]??0)+1,t[e.to]=(t[e.to]??0)+1;return t});constructor(){D(()=>{this.nodes(),this.draggedNodes.set({}),queueMicrotask(()=>this.fitView())}),D(()=>{this.fitKey(),queueMicrotask(()=>this.fitView())}),D(()=>{let t=this.host()?.nativeElement;if(!t)return;this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null);let e=new ResizeObserver(n=>{let i=n[0]?.contentRect;i&&this.hostSize.set({w:i.width,h:i.height})});e.observe(t),this.resizeObs=e})}fitView(){let t=this.host()?.nativeElement;if(!t)return;let e=this.positioned();if(e.length===0){this.view.set({tx:0,ty:0,k:1});return}let n=t.clientWidth,i=t.clientHeight;if(n===0||i===0)return;let o=1/0,a=-1/0,d=1/0,m=-1/0;for(let v of e){let l=X(v);v.x<o&&(o=v.x),v.x+l.w>a&&(a=v.x+l.w),v.y<d&&(d=v.y),v.y+l.h>m&&(m=v.y+l.h)}let h=60;o-=h,d-=h,a+=h,m+=h;let b=Math.max(1,a-o),g=Math.max(1,m-d),f=Math.min(n/b,i/g,1.4)*.92;this.view.set({k:f,tx:(n-b*f)/2-o*f,ty:(i-g*f)/2-d*f})}onWheel(t){if(!this.interactive())return;t.preventDefault();let e=this.host().nativeElement.getBoundingClientRect(),n=t.clientX-e.left,i=t.clientY-e.top,o=-t.deltaY*.0016,a=this.view(),d=Math.min(2.4,Math.max(.25,a.k*(1+o))),m=d/a.k;this.view.set({k:d,tx:n-(n-a.tx)*m,ty:i-(i-a.ty)*m})}onMouseDown(t){if(!this.interactive())return;let n=t.target.closest("[data-node]");if(n){let o=n.getAttribute("data-node"),a=this.nodeMap().get(o);if(!a)return;t.stopPropagation(),this.drag={type:"node",id:o,sx:t.clientX,sy:t.clientY,ox:a.x,oy:a.y,moved:!1};return}let i=this.view();this.drag={type:"pan",sx:t.clientX,sy:t.clientY,ox:i.tx,oy:i.ty}}onMouseMove(t){let e=this.drag;if(!e)return;if(e.type==="pan"){this.view.update(a=>I(O({},a),{tx:e.ox+(t.clientX-e.sx),ty:e.oy+(t.clientY-e.sy)}));return}let n=this.view().k,i=(t.clientX-e.sx)/n,o=(t.clientY-e.sy)/n;Math.abs(t.clientX-e.sx)+Math.abs(t.clientY-e.sy)>3&&(e.moved=!0),this.draggedNodes.update(a=>I(O({},a),{[e.id]:{x:e.ox+i,y:e.oy+o}}))}onMouseUp(){let t=this.drag;t&&t.type==="node"&&!t.moved&&this.nodeClick.emit(t.id),this.drag=null}zoom(t){let e=this.host().nativeElement,n=e.clientWidth,i=e.clientHeight,o=this.view(),a=Math.min(2.4,Math.max(.25,o.k*t)),d=a/o.k;this.view.set({k:a,tx:n/2-(n/2-o.tx)*d,ty:i/2-(i/2-o.ty)*d})}onHoverEnter(t){this.hover.set(t)}onHoverLeave(){this.hover.set(null)}box(t){return X(t)}edgePath(t){let e=this.nodeMap().get(t.from),n=this.nodeMap().get(t.to);if(!e||!n)return null;let i=X(e),o=X(n),a=e.x+i.w/2,d=e.y+i.h/2,m=n.x+o.w/2,h=n.y+o.h/2,b=(a+m)/2;return`M ${a} ${d} C ${b} ${d}, ${b} ${h}, ${m} ${h}`}edgeHot(t){let e=this.selectedId();return!!e&&(t.from===e||t.to===e)}edgeStroke(t){if(this.edgeHot(t))return"var(--accent)";let n=this.nodeMap().get(t.from),i=this.nodeMap().get(t.to);return n?.kind==="spec"||i?.kind==="spec"||t.kind==="implements"?"color-mix(in srgb, var(--node-spec) 62%, transparent)":n?.kind==="test"||i?.kind==="test"?"color-mix(in srgb, var(--node-test) 62%, transparent)":"rgba(150,160,180,0.32)"}edgeStrokeWidth(t){let e=this.edgeHot(t),n=this.nodeMap().get(t.from),i=this.nodeMap().get(t.to),o=n?.kind==="spec"||i?.kind==="spec"||n?.kind==="test"||i?.kind==="test"||t.kind==="implements";return e?2:o?1.5:1.2}edgeOpacity(t){let e=this.edgeHot(t),n=this.hiddenIds();return n.size>0&&(n.has(t.from)||n.has(t.to))?.12:e?.95:.72}nodeColor(t){if(t.state==="drifted")return"var(--warn)";if(t.state==="broken"||t.state==="orphaned")return"var(--error)";switch(t.kind){case"spec":return"var(--node-spec)";case"route":return"var(--node-route)";case"test":return"var(--node-test)";case"class":return"var(--node-class, var(--accent-secondary))";case"method":case"function":return"var(--node-code)";default:return"var(--node-code)"}}nodeOpacity(t){let e=this.hiddenIds();if(e.size>0&&e.has(t.id))return .2;let n=this.selectedId();return!n||t.id===n||this.neighborSet().has(t.id)?1:.55}nodeScale(t){let e=this.degreeMap()[t.id]??0;return 1+Math.min(.24,e*.045)}isSelected(t){return t.id===this.selectedId()}isHovered(t){return t.id===this.hover()}zoomLabel(){return Math.round(this.view().k*100)+"%"}dotGridBgSize(){let t=22*this.view().k;return`${t}px ${t}px`}dotGridBgPos(){let t=this.view();return`${t.tx}px ${t.ty}px`}minimapNodes(){let t=this.positioned();if(t.length===0)return[];let e=138,n=88,i=6,{minX:o,maxX:a,minY:d,maxY:m}=ne(t),h=Math.max(1,a-o),b=Math.max(1,m-d),g=Math.min((e-i*2)/h,(n-i*2)/b),f=i+(e-i*2-h*g)/2,v=i+(n-i*2-b*g)/2;return t.map(l=>({cx:f+(l.x-o)*g,cy:v+(l.y-d)*g,kind:l.kind,state:l.state}))}minimapViewport(){let t=this.positioned();if(t.length===0)return null;let e=138,n=88,i=6,{minX:o,maxX:a,minY:d,maxY:m}=ne(t),h=Math.max(1,a-o),b=Math.max(1,m-d),g=Math.min((e-i*2)/h,(n-i*2)/b),f=i+(e-i*2-h*g)/2,v=i+(n-i*2-b*g)/2,l=this.view(),F=this.hostSize();if(F.w===0)return null;let ie=-l.tx/l.k,oe=-l.ty/l.k,re=F.w/l.k,ae=F.h/l.k;return{x:Math.max(0,f+(ie-o)*g),y:Math.max(0,v+(oe-d)*g),w:Math.min(e,re*g),h:Math.min(n,ae*g)}}minimapNodeColor(t,e){return t==="spec"?e==="drifted"?"var(--warn)":e==="broken"||e==="orphaned"?"var(--error)":"var(--node-spec)":t==="test"?"var(--node-test)":t==="route"?"var(--node-route)":"var(--node-code)"}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=q({type:r,selectors:[["app-graph-canvas"]],viewQuery:function(e,n){e&1&&U(n.host,se,5),e&2&&A()},hostVars:6,hostBindings:function(e,n){e&1&&N("wheel",function(o){return n.onWheel(o)})("mousedown",function(o){return n.onMouseDown(o)})("mousemove",function(o){return n.onMouseMove(o)})("mouseup",function(){return n.onMouseUp()})("mouseleave",function(){return n.onMouseUp()}),e&2&&(C("background-size",n.dotGridBgSize())("background-position",n.dotGridBgPos()),L("no-dot-grid",!n.dotGrid()))},inputs:{nodes:[1,"nodes"],edges:[1,"edges"],selectedId:[1,"selectedId"],fitKey:[1,"fitKey"],hiddenIds:[1,"hiddenIds"],interactive:[1,"interactive"],dotGrid:[1,"dotGrid"]},outputs:{nodeClick:"nodeClick"},decls:15,vars:4,consts:[["host",""],[1,"gc-host"],["width","100%","height","100%",1,"gc-edges"],["id","gc-arrow","viewBox","0 0 10 10","refX","8","refY","5","markerWidth","6","markerHeight","6","orient","auto-start-reverse"],["d","M0 0 L10 5 L0 10 z","fill","rgba(160,170,190,0.5)"],["id","gc-arrow-hi","viewBox","0 0 10 10","refX","8","refY","5","markerWidth","7","markerHeight","7","orient","auto-start-reverse"],["d","M0 0 L10 5 L0 10 z","fill","var(--accent)"],[1,"gc-nodes"],[1,"gc-node",3,"is-selected","is-hovered","left","top","opacity"],["fill","none"],[1,"gc-node",3,"mouseenter","mouseleave"],[1,"gc-dot"],[1,"gc-tooltip","gc-tooltip-top"],[1,"gc-chip"],[1,"gc-chip-bullet"],[1,"gc-chip-state",3,"background"],[1,"gc-tooltip"],[1,"gc-chip-state"],[1,"gc-controls"],["type","button","aria-label","Zoom in",1,"gc-btn","btn","btn-secondary",3,"click"],["name","plus",3,"size"],["type","button","aria-label","Zoom out",1,"gc-btn","btn","btn-secondary",3,"click"],["name","minus",3,"size"],["type","button","aria-label","Fit to view","title","Fit",1,"gc-btn","btn","btn-secondary",3,"click"],["name","maximize",3,"size"],[1,"gc-bottom-left"],["width","138","height","88",1,"gc-minimap"],[1,"gc-zoom-label"],["opacity","0.9"],["fill","var(--accent)","fill-opacity","0.12","stroke","var(--accent)","stroke-width","1","rx","2"]],template:function(e,n){e&1&&(p(0,"div",1,0),S(),p(2,"svg",2)(3,"defs")(4,"marker",3),x(5,"path",4),u(),p(6,"marker",5),x(7,"path",6),u()(),p(8,"g"),T(9,le,1,1,null,null,W),u()(),R(),p(11,"div",7),T(12,ve,6,15,"div",8,de),u(),y(14,ye,11,5),u()),e&2&&(s(8),G("transform","translate("+n.view().tx+" "+n.view().ty+") scale("+n.view().k+")"),s(),V(n.edges()),s(2),C("transform","translate("+n.view().tx+"px, "+n.view().ty+"px) scale("+n.view().k+")"),s(),V(n.positioned()),s(2),_(n.interactive()?14:-1))},dependencies:[ee],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative;background:var(--bg-canvas-2, var(--bg-canvas));cursor:grab;-webkit-user-select:none;user-select:none;overflow:hidden;background-image:radial-gradient(circle,var(--dot-grid, rgba(120, 130, 150, .16)) 1px,transparent 1px);background-size:22px 22px}[_nghost-%COMP%]:active{cursor:grabbing}.no-dot-grid[_nghost-%COMP%]{background-image:none}.gc-host[_ngcontent-%COMP%]{position:absolute;inset:0}.gc-edges[_ngcontent-%COMP%]{position:absolute;inset:0;pointer-events:none}.gc-nodes[_ngcontent-%COMP%]{position:absolute;inset:0;transform-origin:0 0;pointer-events:none}.gc-node[_ngcontent-%COMP%]{position:absolute;pointer-events:auto;cursor:pointer;transition:opacity .12s}.gc-dot[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%;border:2px solid var(--bg-canvas-2, var(--bg-canvas))}.gc-chip[_ngcontent-%COMP%]{height:30px;padding:0 12px;display:flex;align-items:center;gap:7px;border-radius:999px;border-width:1.5px;border-style:solid;color:var(--node-text, var(--text-primary));font-size:12.5px;font-weight:500;white-space:nowrap;font-family:var(--font-mono)}.gc-chip.is-rect[_ngcontent-%COMP%]{border-radius:7px}.gc-chip-bullet[_ngcontent-%COMP%]{width:7px;height:7px;border-radius:50%;flex-shrink:0}.gc-chip.is-rect[_ngcontent-%COMP%] .gc-chip-bullet[_ngcontent-%COMP%]{border-radius:2px}.gc-chip-state[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;margin-left:2px}.gc-tooltip[_ngcontent-%COMP%]{position:absolute;top:34px;left:50%;transform:translate(-50%);background:var(--bg-elevated);border:1px solid var(--border-strong);border-radius:5px;padding:3px 7px;font-size:10.5px;font-family:var(--font-mono);color:var(--text-secondary);white-space:nowrap;pointer-events:none;box-shadow:var(--shadow-pop, 0 4px 14px rgba(0, 0, 0, .4));z-index:5}.gc-tooltip-top[_ngcontent-%COMP%]{top:auto;bottom:22px}.gc-controls[_ngcontent-%COMP%]{position:absolute;right:14px;bottom:14px;display:flex;flex-direction:column;gap:6px;z-index:4}.gc-btn[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:7px;padding:0;display:flex;align-items:center;justify-content:center}.gc-bottom-left[_ngcontent-%COMP%]{position:absolute;left:14px;bottom:14px;display:flex;flex-direction:column;gap:6px;align-items:flex-start;z-index:4}.gc-minimap[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--bg-canvas-2, var(--bg-canvas)) 92%,transparent);border:1px solid var(--border-subtle);border-radius:7px;box-shadow:0 4px 12px #0006;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:block}.gc-zoom-label[_ngcontent-%COMP%]{font-family:var(--font-mono);font-size:10px;color:var(--text-muted);background:#0006;padding:2px 7px;border-radius:5px}'],changeDetection:0})};function X(r){return r.kind==="route"?{w:18,h:18,shape:"dot"}:{w:Math.max(64,r.label.length*(r.kind==="spec"?7.6:7.2)+26),h:30,shape:r.kind==="spec"?"rect":"pill"}}function ne(r){let t=1/0,e=-1/0,n=1/0,i=-1/0;for(let o of r)o.x<t&&(t=o.x),o.x+120>e&&(e=o.x+120),o.y<n&&(n=o.y),o.y+50>i&&(i=o.y+50);return{minX:t,maxX:e,minY:n,maxY:i}}export{te as a};
|