@selvakumaresra/specship 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/.claude-plugin/plugin.json +6 -0
- package/LICENSE +21 -0
- package/README.md +573 -0
- package/agents/specship-explorer.md +29 -0
- package/commands/cg-drifted.md +23 -0
- package/commands/cg-explore.md +13 -0
- package/commands/cg-fix.md +21 -0
- package/commands/cg-impact.md +13 -0
- package/commands/cg-implement.md +23 -0
- package/commands/cg-relink.md +21 -0
- package/commands/cg-spec.md +19 -0
- package/commands/cg-sync.md +8 -0
- package/commands/cg-trace.md +13 -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 +2018 -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 +101 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +276 -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 +427 -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 +410 -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 +57 -0
- package/dist/directory.d.ts.map +1 -0
- package/dist/directory.js +253 -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 +409 -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 +88 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +582 -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 +406 -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 +480 -0
- package/dist/server/routes/graph.js +149 -0
- package/dist/server/routes/memory.js +272 -0
- package/dist/server/routes/projects.js +197 -0
- package/dist/server/routes/spec.js +105 -0
- package/dist/server/routes/status.js +35 -0
- package/dist/server/routes/workflow.js +184 -0
- package/dist/server/server.js +202 -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-2YZXEHZ2.js +1 -0
- package/dist/web/chunk-3GIC555L.js +18 -0
- package/dist/web/chunk-3IIIGRMT.js +1 -0
- package/dist/web/chunk-47QYKLE5.js +1 -0
- package/dist/web/chunk-4LHBWWP7.js +1 -0
- package/dist/web/chunk-4OAZLD5W.js +1 -0
- package/dist/web/chunk-5OQKAJAE.js +1 -0
- package/dist/web/chunk-7B525GKQ.js +1 -0
- package/dist/web/chunk-BPDXCOOZ.js +1 -0
- package/dist/web/chunk-DT37HTZB.js +1 -0
- package/dist/web/chunk-EIMUHJND.js +1 -0
- package/dist/web/chunk-FTESTUEO.js +1 -0
- package/dist/web/chunk-GLJZV6MU.js +1 -0
- package/dist/web/chunk-I7LS67U5.js +1 -0
- package/dist/web/chunk-L4TVIPSR.js +1 -0
- package/dist/web/chunk-MASCULC2.js +1 -0
- package/dist/web/chunk-MW7ICSRM.js +1 -0
- package/dist/web/chunk-OI5VP2A3.js +1 -0
- package/dist/web/chunk-RA6EBF6I.js +1 -0
- package/dist/web/chunk-RP3WU5Y6.js +1 -0
- package/dist/web/chunk-RQDRMTXN.js +1 -0
- package/dist/web/chunk-TQMT6UDU.js +1 -0
- package/dist/web/chunk-U7IYOV7T.js +1 -0
- package/dist/web/chunk-UE227MWF.js +1 -0
- package/dist/web/chunk-WV573J4K.js +1 -0
- package/dist/web/chunk-WVCKOJZL.js +4 -0
- package/dist/web/chunk-XZKLVPHE.js +1 -0
- package/dist/web/chunk-ZABKKHJ3.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-RI5CO5Z4.js +1 -0
- package/dist/web/styles-CYN7IKT4.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/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-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 +623 -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/hooks/hooks.json +27 -0
- package/package.json +67 -0
- package/scripts/add-lang/bench.sh +60 -0
- package/scripts/add-lang/check-grammar.mjs +75 -0
- package/scripts/add-lang/dump-ast.mjs +103 -0
- package/scripts/add-lang/verify-extraction.mjs +70 -0
- package/scripts/agent-eval/arms-F.sh +21 -0
- package/scripts/agent-eval/arms-matrix.sh +37 -0
- package/scripts/agent-eval/audit.sh +68 -0
- package/scripts/agent-eval/bench-readme.sh +28 -0
- package/scripts/agent-eval/bench-why-repo.sh +22 -0
- package/scripts/agent-eval/block-read-hook.sh +19 -0
- package/scripts/agent-eval/hook-settings.json +15 -0
- package/scripts/agent-eval/itrun.sh +120 -0
- package/scripts/agent-eval/parse-arms.mjs +116 -0
- package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
- package/scripts/agent-eval/parse-run.mjs +45 -0
- package/scripts/agent-eval/parse-session.mjs +93 -0
- package/scripts/agent-eval/probe-context.mjs +21 -0
- package/scripts/agent-eval/probe-explore.mjs +40 -0
- package/scripts/agent-eval/probe-node.mjs +20 -0
- package/scripts/agent-eval/probe-sweep.mjs +119 -0
- package/scripts/agent-eval/probe-trace.mjs +20 -0
- package/scripts/agent-eval/run-agent.sh +34 -0
- package/scripts/agent-eval/run-all.sh +67 -0
- package/scripts/agent-eval/run-arms.sh +56 -0
- package/scripts/agent-eval/seq-matrix.mjs +137 -0
- package/scripts/build-bundle.sh +118 -0
- package/scripts/build-server-bundle.mjs +80 -0
- package/scripts/build-web-bundle.mjs +66 -0
- package/scripts/extract-release-notes.mjs +130 -0
- package/scripts/local-install.sh +41 -0
- package/scripts/npm-sdk.js +75 -0
- package/scripts/npm-shim.js +246 -0
- package/scripts/offline-install.ps1 +148 -0
- package/scripts/offline-install.sh +136 -0
- package/scripts/pack-npm.sh +119 -0
- package/scripts/prepare-release.mjs +270 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Build the current branch and link it as the global `specship` for
|
|
3
|
+
# hands-on testing. Replaces any existing global install for as long
|
|
4
|
+
# as the symlink is in place.
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# ./scripts/local-install.sh # build + link
|
|
8
|
+
# ./scripts/local-install.sh --undo # unlink + restore the published version
|
|
9
|
+
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
cd "$(dirname "$0")/.."
|
|
13
|
+
|
|
14
|
+
PKG=$(node -p "require('./package.json').name")
|
|
15
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
16
|
+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
17
|
+
|
|
18
|
+
if [ "${1:-}" = "--undo" ]; then
|
|
19
|
+
echo "→ unlinking ${PKG}"
|
|
20
|
+
npm unlink -g "${PKG}" >/dev/null 2>&1 || true
|
|
21
|
+
echo "→ reinstalling published ${PKG}"
|
|
22
|
+
npm install -g "${PKG}"
|
|
23
|
+
echo "done: global specship -> $(command -v specship)"
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
echo "→ building ${PKG} ${VERSION} (${BRANCH})"
|
|
28
|
+
npm run build
|
|
29
|
+
|
|
30
|
+
echo "→ linking globally"
|
|
31
|
+
npm link
|
|
32
|
+
|
|
33
|
+
LINKED=$(command -v specship || echo "(not on PATH)")
|
|
34
|
+
echo
|
|
35
|
+
echo "✓ global specship now points to this branch"
|
|
36
|
+
echo " binary: ${LINKED}"
|
|
37
|
+
echo " branch: ${BRANCH}"
|
|
38
|
+
echo " version: ${VERSION}"
|
|
39
|
+
echo
|
|
40
|
+
echo "To restore the published version:"
|
|
41
|
+
echo " ./scripts/local-install.sh --undo"
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
//
|
|
3
|
+
// Programmatic / embedded SDK entry for @selvakumaresra/specship (issue #354).
|
|
4
|
+
//
|
|
5
|
+
// The CLI/MCP `bin` (npm-shim.js) execs the per-platform bundle's OWN Node 24 so
|
|
6
|
+
// the tool never depends on the user's runtime. Embedded library consumers are
|
|
7
|
+
// the opposite case: they already run their own Node and just want the compiled
|
|
8
|
+
// API — `require("@selvakumaresra/specship")` returning the SpecShip class et al.
|
|
9
|
+
//
|
|
10
|
+
// The compiled library + its production dependencies (web-tree-sitter,
|
|
11
|
+
// tree-sitter-wasms, …) ship INSIDE the per-platform bundle, at
|
|
12
|
+
// @selvakumaresra/specship-<platform>-<arch>/lib/dist/index.js
|
|
13
|
+
// (with the deps in the sibling lib/node_modules). Re-exporting that bundle keeps
|
|
14
|
+
// the main package thin — no second 50 MB copy of the grammars — while making the
|
|
15
|
+
// SDK work in the consumer's process. Types are a separate concern: the main
|
|
16
|
+
// package ships its own dist/**/*.d.ts tree (pointed at by `types`), built from
|
|
17
|
+
// the same release so it can never skew from the runtime it re-exports.
|
|
18
|
+
//
|
|
19
|
+
// node:sqlite (Node >= 22.5) is required to OPEN a graph, but only lazily inside
|
|
20
|
+
// the SQLite adapter — so loading this module is safe on older Node, and the
|
|
21
|
+
// node:sqlite requirement surfaces with an actionable error only when a DB is
|
|
22
|
+
// actually opened. Heavy extraction additionally wants the bundled launcher's
|
|
23
|
+
// --liftoff-only flag (the WASM Zone-OOM guard, issues #293/#298); an embedded
|
|
24
|
+
// host that drives large indexing should pass that flag to its own Node.
|
|
25
|
+
|
|
26
|
+
var path = require('path');
|
|
27
|
+
var os = require('os');
|
|
28
|
+
var fs = require('fs');
|
|
29
|
+
|
|
30
|
+
var target = process.platform + '-' + process.arch; // e.g. darwin-arm64, linux-x64
|
|
31
|
+
var pkg = '@selvakumaresra/specship-' + target;
|
|
32
|
+
|
|
33
|
+
module.exports = require(resolveLibrary());
|
|
34
|
+
|
|
35
|
+
// Locate the compiled library entry inside the installed per-platform bundle.
|
|
36
|
+
// Throws an actionable error (rather than a bare MODULE_NOT_FOUND) when no bundle
|
|
37
|
+
// is present, so an embedded consumer knows exactly what to install.
|
|
38
|
+
function resolveLibrary() {
|
|
39
|
+
// 1) The npm-installed optional dependency — the normal case.
|
|
40
|
+
try {
|
|
41
|
+
return require.resolve(pkg + '/lib/dist/index.js');
|
|
42
|
+
} catch (e) {
|
|
43
|
+
/* fall through to the self-healed cache */
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 2) A bundle the CLI shim self-healed from GitHub Releases into the cache
|
|
47
|
+
// (issue #303). Same node/lib/bin layout as the npm package. We only REUSE a
|
|
48
|
+
// cached bundle here — unlike the CLI shim we never trigger a network
|
|
49
|
+
// download from inside require(), which must stay synchronous and cheap.
|
|
50
|
+
var cached = cachedLibrary();
|
|
51
|
+
if (cached) return cached;
|
|
52
|
+
|
|
53
|
+
throw new Error(
|
|
54
|
+
'specship: the programmatic API is unavailable because the platform bundle\n' +
|
|
55
|
+
'(' + pkg + ') is not installed.\n' +
|
|
56
|
+
'The compiled library ships inside that per-platform optional dependency.\n' +
|
|
57
|
+
'Fixes:\n' +
|
|
58
|
+
' - install from the official npm registry so the matching bundle is fetched:\n' +
|
|
59
|
+
' npm i @selvakumaresra/specship --registry=https://registry.npmjs.org\n' +
|
|
60
|
+
' - or run the CLI once (e.g. `npx @selvakumaresra/specship status`) to\n' +
|
|
61
|
+
' self-heal the bundle into ~/.specship, then require() will find it.'
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function cachedLibrary() {
|
|
66
|
+
try {
|
|
67
|
+
var version = require(path.join(__dirname, 'package.json')).version;
|
|
68
|
+
var base = process.env.SPECSHIP_INSTALL_DIR || path.join(os.homedir(), '.specship');
|
|
69
|
+
var lib = path.join(base, 'bundles', target + '-' + version, 'lib', 'dist', 'index.js');
|
|
70
|
+
if (fs.existsSync(lib)) return lib;
|
|
71
|
+
} catch (e) {
|
|
72
|
+
/* no readable cache → caller reports the install guidance */
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
//
|
|
4
|
+
// npm thin-installer launcher for SpecShip.
|
|
5
|
+
//
|
|
6
|
+
// The heavy artifact (a vendored Node runtime + the app) ships as a per-platform
|
|
7
|
+
// optionalDependency: @selvakumaresra/specship-<platform>-<arch>. npm installs
|
|
8
|
+
// only the one matching the host, via each package's `os`/`cpu` fields (the
|
|
9
|
+
// esbuild pattern). This shim — run by the user's OWN Node — locates that bundle
|
|
10
|
+
// and execs its launcher, so the real work always runs on the bundled Node 24
|
|
11
|
+
// (with node:sqlite), regardless of the user's Node version. The user's Node is
|
|
12
|
+
// only ever a launcher; even an ancient version can run this file.
|
|
13
|
+
//
|
|
14
|
+
// Self-heal (issue #303): some registries — notably the npmmirror/cnpm mirrors,
|
|
15
|
+
// and some corporate proxies — don't reliably mirror the per-platform
|
|
16
|
+
// optionalDependencies. npm treats an unfetchable optional dep as success and
|
|
17
|
+
// silently skips it, so the bundle goes missing and every command fails. When
|
|
18
|
+
// the installed bundle can't be resolved, this shim falls back to downloading
|
|
19
|
+
// the matching bundle straight from GitHub Releases — the very archive
|
|
20
|
+
// install.sh uses — into a cache dir, then runs that. Knobs:
|
|
21
|
+
// SPECSHIP_NO_DOWNLOAD=1 disable the network fallback (print guidance)
|
|
22
|
+
// SPECSHIP_INSTALL_DIR=DIR cache location (default: ~/.specship)
|
|
23
|
+
// SPECSHIP_DOWNLOAD_BASE=URL release-download base (for mirrors/air-gapped)
|
|
24
|
+
//
|
|
25
|
+
// Wired up at release time as the main package's `bin`:
|
|
26
|
+
// "bin": { "specship": "npm-shim.js" }
|
|
27
|
+
// with the platform packages listed in `optionalDependencies`.
|
|
28
|
+
|
|
29
|
+
var childProcess = require('child_process');
|
|
30
|
+
var fs = require('fs');
|
|
31
|
+
var os = require('os');
|
|
32
|
+
var path = require('path');
|
|
33
|
+
|
|
34
|
+
var target = process.platform + '-' + process.arch; // e.g. darwin-arm64, linux-x64
|
|
35
|
+
var pkg = '@selvakumaresra/specship-' + target;
|
|
36
|
+
var isWindows = process.platform === 'win32';
|
|
37
|
+
var REPO = 'selvakumarEsra/specship';
|
|
38
|
+
|
|
39
|
+
main().catch(function (e) {
|
|
40
|
+
process.stderr.write('specship: ' + (e && e.message ? e.message : String(e)) + '\n');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
async function main() {
|
|
45
|
+
// Happy path: the npm-installed optional dependency. Fall back to a download
|
|
46
|
+
// when the registry didn't deliver it.
|
|
47
|
+
var resolved = resolveInstalledBundle() || (await selfHealBundle());
|
|
48
|
+
var res = childProcess.spawnSync(resolved.command, resolved.args, { stdio: 'inherit' });
|
|
49
|
+
if (res.error) {
|
|
50
|
+
process.stderr.write('specship: ' + res.error.message + '\n');
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
process.exit(res.status === null ? 1 : res.status);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Resolve the launcher from the installed per-platform optionalDependency.
|
|
57
|
+
// Returns {command, args} or null if the package isn't installed.
|
|
58
|
+
function resolveInstalledBundle() {
|
|
59
|
+
try {
|
|
60
|
+
if (isWindows) {
|
|
61
|
+
// Modern Node refuses to spawn the bundle's .cmd directly (EINVAL, the
|
|
62
|
+
// CVE-2024-27980 hardening on Node 24), so invoke the bundled node.exe
|
|
63
|
+
// against the app entry point and pass --liftoff-only here.
|
|
64
|
+
var nodeExe = require.resolve(pkg + '/node.exe');
|
|
65
|
+
var entry = require.resolve(pkg + '/lib/dist/bin/specship.js');
|
|
66
|
+
return { command: nodeExe, args: liftoff(entry) };
|
|
67
|
+
}
|
|
68
|
+
return { command: require.resolve(pkg + '/bin/specship'), args: process.argv.slice(2) };
|
|
69
|
+
} catch (e) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Locate the launcher inside an extracted GitHub bundle directory (same
|
|
75
|
+
// node/lib/bin layout as the npm platform package). Returns {command, args} or
|
|
76
|
+
// null when the directory doesn't hold a usable bundle yet.
|
|
77
|
+
function launcherIn(dir) {
|
|
78
|
+
if (isWindows) {
|
|
79
|
+
var nodeExe = path.join(dir, 'node.exe');
|
|
80
|
+
var entry = path.join(dir, 'lib', 'dist', 'bin', 'specship.js');
|
|
81
|
+
if (fs.existsSync(nodeExe) && fs.existsSync(entry)) {
|
|
82
|
+
return { command: nodeExe, args: liftoff(entry) };
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
var launcher = path.join(dir, 'bin', 'specship');
|
|
86
|
+
if (fs.existsSync(launcher)) return { command: launcher, args: process.argv.slice(2) };
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// --liftoff-only keeps tree-sitter's WASM grammars off V8's turboshaft tier to
|
|
92
|
+
// avoid the Zone OOM on Node >= 22 (issues #293/#298). The unix bin/specship
|
|
93
|
+
// launcher already passes it; on Windows we invoke node.exe directly so add it.
|
|
94
|
+
function liftoff(entry) {
|
|
95
|
+
return ['--liftoff-only', entry].concat(process.argv.slice(2));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Download + cache the platform bundle from GitHub Releases. Returns
|
|
99
|
+
// {command, args}; exits the process with guidance if it can't.
|
|
100
|
+
async function selfHealBundle() {
|
|
101
|
+
var version = readVersion();
|
|
102
|
+
var bundlesDir = path.join(process.env.SPECSHIP_INSTALL_DIR || path.join(os.homedir(), '.specship'), 'bundles');
|
|
103
|
+
var dest = path.join(bundlesDir, target + '-' + version);
|
|
104
|
+
|
|
105
|
+
// Already downloaded by a previous run? Use it even when downloads are
|
|
106
|
+
// disabled — SPECSHIP_NO_DOWNLOAD blocks fetching, not a cached bundle.
|
|
107
|
+
var cached = launcherIn(dest);
|
|
108
|
+
if (cached) return cached;
|
|
109
|
+
|
|
110
|
+
if (process.env.SPECSHIP_NO_DOWNLOAD) {
|
|
111
|
+
fail('the network fallback is disabled (SPECSHIP_NO_DOWNLOAD is set).');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
var asset = 'specship-' + target + (isWindows ? '.zip' : '.tar.gz');
|
|
115
|
+
var base = process.env.SPECSHIP_DOWNLOAD_BASE || ('https://github.com/' + REPO + '/releases/download');
|
|
116
|
+
var url = base + '/v' + version + '/' + asset;
|
|
117
|
+
|
|
118
|
+
process.stderr.write(
|
|
119
|
+
'specship: platform bundle missing (registry did not provide ' + pkg + ').\n' +
|
|
120
|
+
'specship: downloading ' + asset + ' from GitHub Releases (' + version + ')...\n'
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
// Stage inside bundlesDir so the final rename is on the same filesystem (atomic,
|
|
124
|
+
// no EXDEV across tmpfs). Strip the archive's top-level specship-<target>/ dir.
|
|
125
|
+
fs.mkdirSync(bundlesDir, { recursive: true });
|
|
126
|
+
var stage = fs.mkdtempSync(path.join(bundlesDir, '.dl-'));
|
|
127
|
+
try {
|
|
128
|
+
var archivePath = path.join(stage, asset);
|
|
129
|
+
await download(url, archivePath, 6);
|
|
130
|
+
await verifyChecksum(archivePath, asset, base, version);
|
|
131
|
+
var extracted = path.join(stage, 'bundle');
|
|
132
|
+
fs.mkdirSync(extracted);
|
|
133
|
+
extract(archivePath, extracted);
|
|
134
|
+
|
|
135
|
+
var raced = launcherIn(dest); // another process may have finished meanwhile
|
|
136
|
+
if (raced) { rmrf(stage); return raced; }
|
|
137
|
+
try {
|
|
138
|
+
fs.renameSync(extracted, dest);
|
|
139
|
+
} catch (e) {
|
|
140
|
+
var other = launcherIn(dest); // lost the race but theirs is valid
|
|
141
|
+
if (other) { rmrf(stage); return other; }
|
|
142
|
+
throw e;
|
|
143
|
+
}
|
|
144
|
+
} catch (e) {
|
|
145
|
+
rmrf(stage);
|
|
146
|
+
fail('download failed (' + e.message + ').\n URL: ' + url);
|
|
147
|
+
}
|
|
148
|
+
rmrf(stage);
|
|
149
|
+
|
|
150
|
+
var ready = launcherIn(dest);
|
|
151
|
+
if (!ready) fail('downloaded bundle is missing its launcher under ' + dest + '.');
|
|
152
|
+
process.stderr.write('specship: bundle ready.\n');
|
|
153
|
+
return ready;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function readVersion() {
|
|
157
|
+
try {
|
|
158
|
+
return require(path.join(__dirname, 'package.json')).version;
|
|
159
|
+
} catch (e) {
|
|
160
|
+
fail('could not read this package\'s version to locate a matching release.');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// GET with manual redirect following (GitHub release URLs redirect to a CDN).
|
|
165
|
+
function download(url, dest, redirectsLeft) {
|
|
166
|
+
return new Promise(function (resolve, reject) {
|
|
167
|
+
var https = require('https');
|
|
168
|
+
// timeout is an idle/inactivity timeout — it won't kill a slow-but-progressing
|
|
169
|
+
// download, only a stalled connection (so a blocked mirror fails fast with
|
|
170
|
+
// guidance instead of hanging the user's command forever).
|
|
171
|
+
var req = https.get(url, { headers: { 'User-Agent': 'specship-npm-shim' }, timeout: 30000 }, function (res) {
|
|
172
|
+
var status = res.statusCode;
|
|
173
|
+
if (status >= 300 && status < 400 && res.headers.location) {
|
|
174
|
+
res.resume();
|
|
175
|
+
if (redirectsLeft <= 0) { reject(new Error('too many redirects')); return; }
|
|
176
|
+
download(new URL(res.headers.location, url).toString(), dest, redirectsLeft - 1).then(resolve, reject);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (status !== 200) { res.resume(); reject(new Error('HTTP ' + status)); return; }
|
|
180
|
+
var file = fs.createWriteStream(dest);
|
|
181
|
+
res.on('error', reject);
|
|
182
|
+
res.pipe(file);
|
|
183
|
+
file.on('error', reject);
|
|
184
|
+
file.on('finish', function () { file.close(function () { resolve(); }); });
|
|
185
|
+
});
|
|
186
|
+
req.on('timeout', function () { req.destroy(new Error('connection timed out')); });
|
|
187
|
+
req.on('error', reject);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Best-effort integrity check. When the release publishes a SHA256SUMS file, the
|
|
192
|
+
// downloaded archive MUST match its listed hash or we abort. When that file is
|
|
193
|
+
// absent (older releases) or simply unreachable, we proceed — the archive still
|
|
194
|
+
// arrived from GitHub over TLS. So tampering/corruption is caught, while a
|
|
195
|
+
// missing checksum never breaks an install.
|
|
196
|
+
async function verifyChecksum(archivePath, asset, base, version) {
|
|
197
|
+
var sumsPath = archivePath + '.SHA256SUMS';
|
|
198
|
+
try {
|
|
199
|
+
await download(base + '/v' + version + '/SHA256SUMS', sumsPath, 6);
|
|
200
|
+
} catch (e) {
|
|
201
|
+
return; // not published / unreachable → skip
|
|
202
|
+
}
|
|
203
|
+
var expected = null;
|
|
204
|
+
var lines = fs.readFileSync(sumsPath, 'utf8').split('\n');
|
|
205
|
+
for (var i = 0; i < lines.length; i++) {
|
|
206
|
+
var m = lines[i].trim().match(/^([0-9a-fA-F]{64})\s+\*?(.+)$/);
|
|
207
|
+
if (m && path.basename(m[2].trim()) === asset) { expected = m[1].toLowerCase(); break; }
|
|
208
|
+
}
|
|
209
|
+
if (!expected) return; // asset not listed → nothing to check
|
|
210
|
+
var actual = require('crypto').createHash('sha256').update(fs.readFileSync(archivePath)).digest('hex');
|
|
211
|
+
if (actual !== expected) {
|
|
212
|
+
throw new Error('checksum mismatch for ' + asset +
|
|
213
|
+
' (expected ' + expected.slice(0, 12) + '…, got ' + actual.slice(0, 12) + '…)');
|
|
214
|
+
}
|
|
215
|
+
process.stderr.write('specship: checksum verified.\n');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Extract via the system tar — present on macOS, Linux, and Windows 10+
|
|
219
|
+
// (bsdtar reads .zip too). No third-party dependency in the shim.
|
|
220
|
+
function extract(archive, destDir) {
|
|
221
|
+
var args = isWindows
|
|
222
|
+
? ['-xf', archive, '-C', destDir, '--strip-components=1']
|
|
223
|
+
: ['-xzf', archive, '-C', destDir, '--strip-components=1'];
|
|
224
|
+
var res = childProcess.spawnSync('tar', args, { stdio: 'ignore' });
|
|
225
|
+
if (res.error) throw new Error('tar unavailable: ' + res.error.message);
|
|
226
|
+
if (res.status !== 0) throw new Error('tar exited ' + res.status);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function rmrf(p) {
|
|
230
|
+
try { fs.rmSync(p, { recursive: true, force: true }); } catch (e) { /* best effort */ }
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function fail(reason) {
|
|
234
|
+
process.stderr.write(
|
|
235
|
+
'specship: no prebuilt bundle for ' + target + '.\n' +
|
|
236
|
+
(reason ? 'specship: ' + reason + '\n' : '') +
|
|
237
|
+
'Expected the optional package ' + pkg + ' to be installed.\n' +
|
|
238
|
+
'A registry mirror (e.g. npmmirror/cnpm) that did not mirror the per-platform\n' +
|
|
239
|
+
'package is the usual cause. Fixes:\n' +
|
|
240
|
+
' - install from the official registry:\n' +
|
|
241
|
+
' npm i -g @selvakumaresra/specship --registry=https://registry.npmjs.org\n' +
|
|
242
|
+
' - or use the standalone installer (no Node required):\n' +
|
|
243
|
+
' curl -fsSL https://raw.githubusercontent.com/' + REPO + '/main/install.sh | sh\n'
|
|
244
|
+
);
|
|
245
|
+
process.exit(1);
|
|
246
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Offline / air-gapped install of SpecShip from this source folder (Windows).
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
Assumes the client workstation has:
|
|
7
|
+
- Node.js (>=18 <25) and npm on PATH
|
|
8
|
+
- npm configured against a registry it CAN reach (e.g. a private mirror)
|
|
9
|
+
- No git, no public GitHub access required
|
|
10
|
+
|
|
11
|
+
Does NOT call git, does NOT download anything from github.com. Dependencies
|
|
12
|
+
are pulled from whatever registry npm is already pointed at.
|
|
13
|
+
|
|
14
|
+
.PARAMETER SkipClaude
|
|
15
|
+
Skip wiring Claude Code at the end.
|
|
16
|
+
|
|
17
|
+
.PARAMETER Undo
|
|
18
|
+
Unlink the global `specship` symlink and exit.
|
|
19
|
+
|
|
20
|
+
.EXAMPLE
|
|
21
|
+
.\scripts\offline-install.ps1
|
|
22
|
+
.\scripts\offline-install.ps1 -SkipClaude
|
|
23
|
+
.\scripts\offline-install.ps1 -Undo
|
|
24
|
+
#>
|
|
25
|
+
[CmdletBinding()]
|
|
26
|
+
param(
|
|
27
|
+
[switch]$SkipClaude,
|
|
28
|
+
[switch]$Undo
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
$ErrorActionPreference = 'Stop'
|
|
32
|
+
|
|
33
|
+
# Resolve repo root from this script's location (no git).
|
|
34
|
+
$Repo = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
|
|
35
|
+
Set-Location $Repo
|
|
36
|
+
|
|
37
|
+
$Pkg = node -p "require('./package.json').name"
|
|
38
|
+
$Version = node -p "require('./package.json').version"
|
|
39
|
+
|
|
40
|
+
if ($Undo) {
|
|
41
|
+
Write-Host "[offline-install] unlinking $Pkg"
|
|
42
|
+
& npm unlink -g $Pkg 2>$null
|
|
43
|
+
Write-Host "[offline-install] done"
|
|
44
|
+
exit 0
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# --- Node version gate ---------------------------------------------------
|
|
48
|
+
# Tighter than package.json engines (>=18 <25): the runtime needs node:sqlite
|
|
49
|
+
# (Node 22.5+) AND that SQLite must have FTS5 compiled in. SpecShip's own
|
|
50
|
+
# release bundle pins v24.16.0 for that reason; older Node builds either lack
|
|
51
|
+
# node:sqlite entirely or ship SQLite without FTS5.
|
|
52
|
+
$NodeMajor = [int](node -p "process.versions.node.split('.')[0]")
|
|
53
|
+
$NodeMinor = [int](node -p "process.versions.node.split('.')[1]")
|
|
54
|
+
if ($NodeMajor -lt 22 -or
|
|
55
|
+
($NodeMajor -eq 22 -and $NodeMinor -lt 5) -or
|
|
56
|
+
$NodeMajor -ge 25) {
|
|
57
|
+
$nv = node --version
|
|
58
|
+
Write-Error "[offline-install] Node $nv is unsupported. Requires >=22.5 <25 (Node 24.x recommended)."
|
|
59
|
+
exit 1
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# --- FTS5 capability probe ---------------------------------------------
|
|
63
|
+
# Fail fast with a clear remediation message instead of letting `specship init`
|
|
64
|
+
# die with a cryptic "no such module: fts5" deep inside indexing. node:sqlite
|
|
65
|
+
# is present from 22.5+, but FTS5 is only enabled in newer Node builds —
|
|
66
|
+
# Node 22.x typically ships SQLite without it.
|
|
67
|
+
$probeScript = @'
|
|
68
|
+
try {
|
|
69
|
+
const { DatabaseSync } = require('node:sqlite');
|
|
70
|
+
const db = new DatabaseSync(':memory:');
|
|
71
|
+
db.exec("CREATE VIRTUAL TABLE t USING fts5(x)");
|
|
72
|
+
console.log('OK');
|
|
73
|
+
} catch (e) {
|
|
74
|
+
console.log('FAIL:' + e.message);
|
|
75
|
+
}
|
|
76
|
+
'@
|
|
77
|
+
$probe = (node -e $probeScript 2>$null)
|
|
78
|
+
if ($probe -eq 'OK') {
|
|
79
|
+
# FTS5 ok
|
|
80
|
+
} elseif ($probe -like 'FAIL:*') {
|
|
81
|
+
$msg = $probe.Substring(5)
|
|
82
|
+
$nv = node --version
|
|
83
|
+
Write-Error @"
|
|
84
|
+
[offline-install] SQLite probe failed: $msg
|
|
85
|
+
|
|
86
|
+
SpecShip requires Node.js whose bundled SQLite has FTS5 enabled. Your Node
|
|
87
|
+
($nv) does not. Install Node 24.x and re-run this script. SpecShip's
|
|
88
|
+
release bundle pins v24.16.0 as the known-good version.
|
|
89
|
+
"@
|
|
90
|
+
exit 1
|
|
91
|
+
} else {
|
|
92
|
+
Write-Error "[offline-install] unable to probe node:sqlite. Need Node >=22.5 (24.x recommended)."
|
|
93
|
+
exit 1
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
$Registry = npm config get registry
|
|
97
|
+
Write-Host "[offline-install] repo: $Repo"
|
|
98
|
+
Write-Host "[offline-install] package: $Pkg@$Version"
|
|
99
|
+
Write-Host "[offline-install] node: $(node --version)"
|
|
100
|
+
Write-Host "[offline-install] registry: $Registry"
|
|
101
|
+
|
|
102
|
+
# --- install deps --------------------------------------------------------
|
|
103
|
+
if (Test-Path 'package-lock.json') {
|
|
104
|
+
Write-Host "[offline-install] npm ci"
|
|
105
|
+
& npm ci
|
|
106
|
+
} else {
|
|
107
|
+
Write-Host "[offline-install] npm install"
|
|
108
|
+
& npm install
|
|
109
|
+
}
|
|
110
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
111
|
+
|
|
112
|
+
# --- build ---------------------------------------------------------------
|
|
113
|
+
Write-Host "[offline-install] npm run build"
|
|
114
|
+
& npm run build
|
|
115
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
116
|
+
|
|
117
|
+
# --- link as global specship -------------------------------------------
|
|
118
|
+
Write-Host "[offline-install] npm link"
|
|
119
|
+
& npm link
|
|
120
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
121
|
+
|
|
122
|
+
# Avoid PS 7+ null-conditional (?.) — locked-down Windows clients often ship
|
|
123
|
+
# only Windows PowerShell 5.1, where ?. fails to parse.
|
|
124
|
+
$cmd = Get-Command specship -ErrorAction SilentlyContinue
|
|
125
|
+
$Linked = if ($cmd) { $cmd.Source } else { '(not on PATH)' }
|
|
126
|
+
Write-Host "[offline-install] specship -> $Linked"
|
|
127
|
+
|
|
128
|
+
# --- wire Claude Code (non-interactive) ---------------------------------
|
|
129
|
+
# Invoke the just-built binary directly instead of relying on `specship` being
|
|
130
|
+
# visible on PATH in this PowerShell session — `npm link`'s shim may not be
|
|
131
|
+
# picked up until the user opens a new shell.
|
|
132
|
+
if (-not $SkipClaude) {
|
|
133
|
+
Write-Host "[offline-install] wiring Claude Code"
|
|
134
|
+
& node (Join-Path $Repo 'dist/bin/specship.js') install --target claude -y
|
|
135
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
Write-Host ""
|
|
139
|
+
Write-Host "[OK] SpecShip $Version installed offline from source."
|
|
140
|
+
Write-Host " binary: $Linked"
|
|
141
|
+
Write-Host " source: $Repo"
|
|
142
|
+
Write-Host ""
|
|
143
|
+
Write-Host "Next:"
|
|
144
|
+
Write-Host " specship --version"
|
|
145
|
+
Write-Host " cd <your-project>; specship init; specship index"
|
|
146
|
+
Write-Host ""
|
|
147
|
+
Write-Host "To uninstall:"
|
|
148
|
+
Write-Host " .\scripts\offline-install.ps1 -Undo"
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# Offline / air-gapped install of SpecShip from this source folder.
|
|
4
|
+
#
|
|
5
|
+
# Assumes the client workstation has:
|
|
6
|
+
# - Node.js (>=18 <25) and npm on PATH
|
|
7
|
+
# - npm configured against a registry it CAN reach (e.g. a private mirror)
|
|
8
|
+
# - No git, no public GitHub access required
|
|
9
|
+
#
|
|
10
|
+
# Does NOT call git, does NOT download anything from github.com. Dependencies
|
|
11
|
+
# are pulled from whatever registry npm is already pointed at.
|
|
12
|
+
#
|
|
13
|
+
# Usage:
|
|
14
|
+
# ./scripts/offline-install.sh # build, link, wire Claude Code
|
|
15
|
+
# ./scripts/offline-install.sh --skip-claude # build + link only
|
|
16
|
+
# ./scripts/offline-install.sh --undo # unlink the global symlink
|
|
17
|
+
#
|
|
18
|
+
# After install: `specship --version` should print the package.json version.
|
|
19
|
+
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
|
|
22
|
+
cd "$(dirname "$0")/.."
|
|
23
|
+
REPO="$(pwd)"
|
|
24
|
+
|
|
25
|
+
PKG=$(node -p "require('./package.json').name")
|
|
26
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
27
|
+
|
|
28
|
+
# --- undo path ---------------------------------------------------------------
|
|
29
|
+
if [ "${1:-}" = "--undo" ]; then
|
|
30
|
+
echo "[offline-install] unlinking ${PKG}"
|
|
31
|
+
npm unlink -g "${PKG}" >/dev/null 2>&1 || true
|
|
32
|
+
echo "[offline-install] done"
|
|
33
|
+
exit 0
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
SKIP_CLAUDE=0
|
|
37
|
+
[ "${1:-}" = "--skip-claude" ] && SKIP_CLAUDE=1
|
|
38
|
+
|
|
39
|
+
# --- Node version gate -------------------------------------------------------
|
|
40
|
+
# Tighter than package.json engines (>=18 <25): the runtime needs node:sqlite
|
|
41
|
+
# (Node 22.5+) AND that SQLite must have FTS5 compiled in. SpecShip's own
|
|
42
|
+
# release bundle pins v24.16.0 for that reason; older Node builds either lack
|
|
43
|
+
# node:sqlite entirely or ship SQLite without FTS5.
|
|
44
|
+
NODE_MAJOR=$(node -p "process.versions.node.split('.')[0]")
|
|
45
|
+
NODE_MINOR=$(node -p "process.versions.node.split('.')[1]")
|
|
46
|
+
if [ "$NODE_MAJOR" -lt 22 ] \
|
|
47
|
+
|| { [ "$NODE_MAJOR" -eq 22 ] && [ "$NODE_MINOR" -lt 5 ]; } \
|
|
48
|
+
|| [ "$NODE_MAJOR" -ge 25 ]; then
|
|
49
|
+
echo "[offline-install] error: Node $(node --version) is unsupported. Requires >=22.5 <25 (Node 24.x recommended)." >&2
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
# --- FTS5 capability probe ---------------------------------------------------
|
|
54
|
+
# Fail fast with a clear remediation message instead of letting `specship init`
|
|
55
|
+
# die with a cryptic "no such module: fts5" deep inside indexing. node:sqlite
|
|
56
|
+
# is present from 22.5+, but FTS5 is only enabled in newer Node builds —
|
|
57
|
+
# Node 22.x typically ships SQLite without it.
|
|
58
|
+
PROBE=$(node -e "
|
|
59
|
+
try {
|
|
60
|
+
const { DatabaseSync } = require('node:sqlite');
|
|
61
|
+
const db = new DatabaseSync(':memory:');
|
|
62
|
+
db.exec('CREATE VIRTUAL TABLE t USING fts5(x)');
|
|
63
|
+
console.log('OK');
|
|
64
|
+
} catch (e) {
|
|
65
|
+
console.log('FAIL:' + e.message);
|
|
66
|
+
}
|
|
67
|
+
" 2>/dev/null)
|
|
68
|
+
case "$PROBE" in
|
|
69
|
+
OK) ;;
|
|
70
|
+
FAIL:*)
|
|
71
|
+
cat >&2 <<EOF
|
|
72
|
+
[offline-install] error: SQLite probe failed: ${PROBE#FAIL:}
|
|
73
|
+
|
|
74
|
+
SpecShip requires Node.js whose bundled SQLite has FTS5 enabled. Your Node
|
|
75
|
+
($(node --version)) does not. Install Node 24.x and re-run:
|
|
76
|
+
|
|
77
|
+
nvm install 24 && nvm use 24
|
|
78
|
+
./scripts/offline-install.sh
|
|
79
|
+
|
|
80
|
+
(SpecShip's release bundle pins v24.16.0 as the known-good version.)
|
|
81
|
+
EOF
|
|
82
|
+
exit 1
|
|
83
|
+
;;
|
|
84
|
+
*)
|
|
85
|
+
echo "[offline-install] error: unable to probe node:sqlite. Need Node >=22.5 (24.x recommended)." >&2
|
|
86
|
+
exit 1
|
|
87
|
+
;;
|
|
88
|
+
esac
|
|
89
|
+
|
|
90
|
+
echo "[offline-install] repo: ${REPO}"
|
|
91
|
+
echo "[offline-install] package: ${PKG}@${VERSION}"
|
|
92
|
+
echo "[offline-install] node: $(node --version)"
|
|
93
|
+
echo "[offline-install] registry: $(npm config get registry)"
|
|
94
|
+
|
|
95
|
+
# --- install deps (offline-friendly: respects whatever registry npm is on) ---
|
|
96
|
+
if [ -f package-lock.json ]; then
|
|
97
|
+
echo "[offline-install] npm ci"
|
|
98
|
+
npm ci
|
|
99
|
+
else
|
|
100
|
+
echo "[offline-install] npm install"
|
|
101
|
+
npm install
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
# --- build -------------------------------------------------------------------
|
|
105
|
+
echo "[offline-install] npm run build"
|
|
106
|
+
npm run build
|
|
107
|
+
|
|
108
|
+
# --- link as global specship ------------------------------------------------
|
|
109
|
+
echo "[offline-install] npm link"
|
|
110
|
+
npm link
|
|
111
|
+
|
|
112
|
+
LINKED=$(command -v specship || echo "(not on PATH)")
|
|
113
|
+
echo "[offline-install] specship -> ${LINKED}"
|
|
114
|
+
|
|
115
|
+
# --- wire Claude Code (non-interactive) --------------------------------------
|
|
116
|
+
# Invoke the just-built binary directly instead of relying on `specship` being
|
|
117
|
+
# visible on PATH in this shell session — `npm link`'s shim may not be picked
|
|
118
|
+
# up until the user opens a new shell.
|
|
119
|
+
if [ "$SKIP_CLAUDE" -eq 0 ]; then
|
|
120
|
+
echo "[offline-install] wiring Claude Code"
|
|
121
|
+
node "$REPO/dist/bin/specship.js" install --target claude -y
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
cat <<EOF
|
|
125
|
+
|
|
126
|
+
✓ SpecShip ${VERSION} installed offline from source.
|
|
127
|
+
binary: ${LINKED}
|
|
128
|
+
source: ${REPO}
|
|
129
|
+
|
|
130
|
+
Next:
|
|
131
|
+
specship --version
|
|
132
|
+
cd <your-project> && specship init && specship index
|
|
133
|
+
|
|
134
|
+
To uninstall:
|
|
135
|
+
./scripts/offline-install.sh --undo
|
|
136
|
+
EOF
|