@selvakumaresra/specship 0.1.3 → 0.4.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 +84 -0
- package/commands/ss-design-loop.md +125 -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 +2085 -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/designer/artifact-store.js +54 -0
- package/dist/designer/browser.js +141 -0
- package/dist/designer/cdp-ensure.js +60 -0
- package/dist/designer/cdp-env.js +18 -0
- package/dist/designer/cdp-trace.js +599 -0
- package/dist/designer/cross-platform.js +74 -0
- package/dist/designer/designer-controller.js +1413 -0
- package/dist/designer/file-panel.js +39 -0
- package/dist/designer/interstitials.js +97 -0
- package/dist/designer/oopif-reader.js +176 -0
- package/dist/designer/package-meta.js +18 -0
- package/dist/designer/preview-host.js +50 -0
- package/dist/designer/repo-root.js +31 -0
- package/dist/designer/run-state.js +353 -0
- package/dist/designer/session-store.js +59 -0
- package/dist/designer/ui-anchors.js +651 -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 +92 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +416 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/instructions-template.d.ts +35 -0
- package/dist/installer/instructions-template.d.ts.map +1 -0
- package/dist/installer/instructions-template.js +51 -0
- package/dist/installer/instructions-template.js.map +1 -0
- package/dist/installer/targets/claude.d.ts +117 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +736 -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 +76 -0
- package/dist/installer/targets/shared.d.ts.map +1 -0
- package/dist/installer/targets/shared.js +256 -0
- package/dist/installer/targets/shared.js.map +1 -0
- package/dist/installer/targets/types.d.ts +84 -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/designer-tools.d.ts +33 -0
- package/dist/mcp/designer-tools.d.ts.map +1 -0
- package/dist/mcp/designer-tools.js +313 -0
- package/dist/mcp/designer-tools.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 +3087 -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-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-2YUJNZ2Y.js +6 -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-42XVAQ6I.js +1 -0
- package/dist/web/chunk-45QHGCB4.js +17 -0
- package/dist/web/chunk-4IMMPEYM.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-A5R3MJMO.js +1 -0
- package/dist/web/chunk-ASZ77FMZ.js +1 -0
- package/dist/web/chunk-AZJVTPLU.js +1 -0
- package/dist/web/chunk-B3YPFY6A.js +1 -0
- package/dist/web/chunk-BLBRMCN2.js +1 -0
- package/dist/web/chunk-BMIAXD2V.js +2 -0
- package/dist/web/chunk-BUXWEHIY.js +1 -0
- package/dist/web/chunk-BYZFQSM6.js +1 -0
- package/dist/web/chunk-D5OCNEJA.js +2 -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-FHZHD2ZG.js +1 -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-GR72OOCN.js +1 -0
- package/dist/web/chunk-GRZYXPSO.js +7 -0
- package/dist/web/chunk-GWPVKJIY.js +1 -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-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-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-NZEZCT65.js +1 -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-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-UBOZGQNK.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-WCKHQIYN.js +1 -0
- package/dist/web/chunk-WDU3WICG.js +1 -0
- package/dist/web/chunk-WFXJIXZE.js +4 -0
- package/dist/web/chunk-WLIMNDS3.js +1 -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-YAMRN47K.js +2 -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-R53HA54V.js +1 -0
- package/dist/web/media/codicon-LN6W7LCM.ttf +0 -0
- package/dist/web/styles-KSOPUVDA.css +1 -0
- package/dist/web/sw.js +69 -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 +336 -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/hooks/hooks.json +11 -0
- package/package.json +7 -3
- package/scripts/offline-install.sh +19 -6
- package/selectors.json +41 -0
- /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
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RunStateObserver = exports.TURN_RPCS = exports.OMELETTE_TURN_SERVICE = void 0;
|
|
4
|
+
exports.turnRpcFromUrl = turnRpcFromUrl;
|
|
5
|
+
exports.observedRpcPathFromUrl = observedRpcPathFromUrl;
|
|
6
|
+
exports.isTurnRpcUrl = isTurnRpcUrl;
|
|
7
|
+
exports.classifyEvent = classifyEvent;
|
|
8
|
+
const cdp_trace_1 = require("./cdp-trace");
|
|
9
|
+
exports.OMELETTE_TURN_SERVICE = 'anthropic.omelette.api.v1alpha.OmeletteService';
|
|
10
|
+
exports.TURN_RPCS = ['Chat', 'RenewTurn', 'ReleaseTurn'];
|
|
11
|
+
function num(v) {
|
|
12
|
+
return typeof v === 'number' && Number.isFinite(v) ? v : null;
|
|
13
|
+
}
|
|
14
|
+
function eventWallMs(params) {
|
|
15
|
+
const syntheticTraceTs = num(params.ts);
|
|
16
|
+
if (syntheticTraceTs !== null)
|
|
17
|
+
return syntheticTraceTs;
|
|
18
|
+
const wallTime = num(params.wallTime);
|
|
19
|
+
return wallTime !== null ? wallTime * 1000 : null;
|
|
20
|
+
}
|
|
21
|
+
function requestId(params) {
|
|
22
|
+
return typeof params.requestId === 'string' ? params.requestId : undefined;
|
|
23
|
+
}
|
|
24
|
+
function turnRpcFromUrl(url) {
|
|
25
|
+
if (!url)
|
|
26
|
+
return null;
|
|
27
|
+
let path = url;
|
|
28
|
+
try {
|
|
29
|
+
path = new URL(url).pathname;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// Some tests pass path fragments directly.
|
|
33
|
+
}
|
|
34
|
+
const escapedService = exports.OMELETTE_TURN_SERVICE.replace(/\./g, '\\.');
|
|
35
|
+
const match = path.match(new RegExp(`(?:^|/)${escapedService}/(Chat|RenewTurn|ReleaseTurn)(?:$|[/?#])`));
|
|
36
|
+
if (!match?.[1])
|
|
37
|
+
return null;
|
|
38
|
+
return exports.TURN_RPCS.includes(match[1]) ? match[1] : null;
|
|
39
|
+
}
|
|
40
|
+
function observedRpcPathFromUrl(url) {
|
|
41
|
+
if (!url)
|
|
42
|
+
return null;
|
|
43
|
+
let path = url;
|
|
44
|
+
try {
|
|
45
|
+
path = new URL(url).pathname;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// Some tests pass path fragments directly.
|
|
49
|
+
}
|
|
50
|
+
const serviceIdx = path.indexOf(`${exports.OMELETTE_TURN_SERVICE}/`);
|
|
51
|
+
if (serviceIdx >= 0)
|
|
52
|
+
return path.slice(serviceIdx);
|
|
53
|
+
const idx = path.indexOf('OmeletteService/');
|
|
54
|
+
return idx >= 0 ? path.slice(idx) : null;
|
|
55
|
+
}
|
|
56
|
+
function isTurnRpcUrl(url) {
|
|
57
|
+
return turnRpcFromUrl(url) !== null;
|
|
58
|
+
}
|
|
59
|
+
function urlFromParams(method, params) {
|
|
60
|
+
if (typeof params.requestUrl === 'string')
|
|
61
|
+
return params.requestUrl;
|
|
62
|
+
if (typeof params.url === 'string')
|
|
63
|
+
return params.url;
|
|
64
|
+
if (method === 'Network.requestWillBeSent') {
|
|
65
|
+
const req = (0, cdp_trace_1.asRec)(params.request);
|
|
66
|
+
return typeof req.url === 'string' ? req.url : '';
|
|
67
|
+
}
|
|
68
|
+
if (method === 'Network.responseReceived') {
|
|
69
|
+
const resp = (0, cdp_trace_1.asRec)(params.response);
|
|
70
|
+
return typeof resp.url === 'string' ? resp.url : '';
|
|
71
|
+
}
|
|
72
|
+
return '';
|
|
73
|
+
}
|
|
74
|
+
function isCriticalRpc(rpc) {
|
|
75
|
+
return rpc === 'Chat' || rpc === 'RenewTurn';
|
|
76
|
+
}
|
|
77
|
+
function classifyEvent(method, rawParams, runStartTs) {
|
|
78
|
+
const params = (0, cdp_trace_1.asRec)(rawParams);
|
|
79
|
+
const wallMs = eventWallMs(params);
|
|
80
|
+
if (wallMs !== null && wallMs < runStartTs)
|
|
81
|
+
return null;
|
|
82
|
+
const url = urlFromParams(method, params);
|
|
83
|
+
const rpc = turnRpcFromUrl(url);
|
|
84
|
+
if (method === 'Network.requestWillBeSent') {
|
|
85
|
+
if (rpc === 'Chat')
|
|
86
|
+
return { kind: 'chat-open', requestId: requestId(params) };
|
|
87
|
+
if (rpc === 'RenewTurn')
|
|
88
|
+
return { kind: 'heartbeat', requestId: requestId(params) };
|
|
89
|
+
if (rpc === 'ReleaseTurn')
|
|
90
|
+
return { kind: 'release', requestId: requestId(params) };
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
if (method === 'Network.dataReceived' && rpc === 'Chat') {
|
|
94
|
+
return { kind: 'chat-chunk', requestId: requestId(params) };
|
|
95
|
+
}
|
|
96
|
+
if (method === 'Network.responseReceived') {
|
|
97
|
+
const response = (0, cdp_trace_1.asRec)(params.response);
|
|
98
|
+
const status = num(response.status);
|
|
99
|
+
if (status !== null && status >= 400 && isCriticalRpc(rpc)) {
|
|
100
|
+
return { kind: 'critical-error', rpc, status };
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
if (method === 'Network.loadingFailed' && isCriticalRpc(rpc)) {
|
|
105
|
+
return { kind: 'critical-error', rpc, status: 'failed' };
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
class RunStateObserver extends cdp_trace_1.CdpSession {
|
|
110
|
+
now;
|
|
111
|
+
currentState = 'idle';
|
|
112
|
+
runStartTs = 0;
|
|
113
|
+
lastActivity = 0;
|
|
114
|
+
priorRunSignals = 0;
|
|
115
|
+
terminalResult = null;
|
|
116
|
+
watchdog = null;
|
|
117
|
+
waiters = [];
|
|
118
|
+
requestUrls = new Map();
|
|
119
|
+
observedRpcPaths = new Set();
|
|
120
|
+
signalCounts = {
|
|
121
|
+
chatOpen: 0,
|
|
122
|
+
chatChunk: 0,
|
|
123
|
+
heartbeat: 0,
|
|
124
|
+
release: 0,
|
|
125
|
+
criticalError: 0,
|
|
126
|
+
observerLost: 0
|
|
127
|
+
};
|
|
128
|
+
closeCount = 0;
|
|
129
|
+
constructor(ws, target, opts = {}) {
|
|
130
|
+
super(ws, target, opts);
|
|
131
|
+
this.now = opts.now ?? (() => Date.now());
|
|
132
|
+
}
|
|
133
|
+
static async attach(opts = {}) {
|
|
134
|
+
if (typeof WebSocket === 'undefined')
|
|
135
|
+
return null;
|
|
136
|
+
try {
|
|
137
|
+
const { ws, target } = await RunStateObserver.connectTarget(opts);
|
|
138
|
+
const observer = new RunStateObserver(ws, target, opts);
|
|
139
|
+
await observer.start();
|
|
140
|
+
return observer;
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async start() {
|
|
147
|
+
await this.enableDomains();
|
|
148
|
+
}
|
|
149
|
+
beginRun() {
|
|
150
|
+
if (this.terminalResult)
|
|
151
|
+
return;
|
|
152
|
+
this.runStartTs = this.now();
|
|
153
|
+
this.lastActivity = this.runStartTs;
|
|
154
|
+
this.priorRunSignals = 0;
|
|
155
|
+
this.requestUrls.clear();
|
|
156
|
+
this.observedRpcPaths.clear();
|
|
157
|
+
this.resetSignalCounts();
|
|
158
|
+
this.currentState = 'running';
|
|
159
|
+
}
|
|
160
|
+
get state() {
|
|
161
|
+
if (this.terminalResult)
|
|
162
|
+
return this.terminalResult.terminal;
|
|
163
|
+
return this.currentState;
|
|
164
|
+
}
|
|
165
|
+
awaitTerminal({ stallMs = 25_000, hardTimeoutMs = 20 * 60_000 } = {}) {
|
|
166
|
+
if (this.terminalResult)
|
|
167
|
+
return Promise.resolve(this.terminalResult);
|
|
168
|
+
this.armWatchdog(stallMs, hardTimeoutMs);
|
|
169
|
+
this.checkSilence(stallMs, hardTimeoutMs);
|
|
170
|
+
if (this.terminalResult)
|
|
171
|
+
return Promise.resolve(this.terminalResult);
|
|
172
|
+
return new Promise((resolve) => {
|
|
173
|
+
this.waiters.push(resolve);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
close() {
|
|
177
|
+
this.clearWatchdog();
|
|
178
|
+
if (this.closeSocket())
|
|
179
|
+
this.closeCount++;
|
|
180
|
+
}
|
|
181
|
+
signalSummary() {
|
|
182
|
+
return {
|
|
183
|
+
...this.signalCounts,
|
|
184
|
+
observedRpcPaths: [...this.observedRpcPaths].sort()
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
closeCountForTest() {
|
|
188
|
+
return this.closeCount;
|
|
189
|
+
}
|
|
190
|
+
consumeSignalForTest(signal) {
|
|
191
|
+
this.consumeSignal(signal);
|
|
192
|
+
}
|
|
193
|
+
socketGapForTest(detail = { reason: 'test' }) {
|
|
194
|
+
this.onSocketGap(detail);
|
|
195
|
+
}
|
|
196
|
+
tickForTest({ stallMs = 25_000, hardTimeoutMs = 20 * 60_000 } = {}) {
|
|
197
|
+
this.checkSilence(stallMs, hardTimeoutMs);
|
|
198
|
+
}
|
|
199
|
+
onEvent(method, rawParams, _sessionId) {
|
|
200
|
+
if (this.currentState === 'idle' && !this.terminalResult)
|
|
201
|
+
return;
|
|
202
|
+
const params = this.enrichParams(method, rawParams);
|
|
203
|
+
// Terminal events (responseReceived / loadingFailed) carry no `wallTime`, so
|
|
204
|
+
// classifyEvent's stale-timestamp guard cannot filter a prior turn's late
|
|
205
|
+
// failure. Only honor them when the request was first seen *this run* — its
|
|
206
|
+
// id is in `requestUrls`, which `enrichParams` populates at requestWillBeSent
|
|
207
|
+
// for events at/after `runStartTs`. Otherwise a stale 4xx for a pre-run RPC
|
|
208
|
+
// would read its own `response.url` and falsely latch BLOCKED.
|
|
209
|
+
if (method === 'Network.responseReceived' || method === 'Network.loadingFailed') {
|
|
210
|
+
const id = requestId(params);
|
|
211
|
+
if (!id || !this.requestUrls.has(id))
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const signal = classifyEvent(method, params, this.runStartTs);
|
|
215
|
+
if (signal)
|
|
216
|
+
this.consumeSignal(signal);
|
|
217
|
+
}
|
|
218
|
+
onSocketGap(_detail) {
|
|
219
|
+
// A one-shot ReleaseTurn fired during a CDP reconnect gap can't be recovered
|
|
220
|
+
// (CDP won't re-deliver events from the gap), so even a *successful* reconnect
|
|
221
|
+
// would leave an active run waiting out the hard timeout. Degrade to
|
|
222
|
+
// observer-lost immediately for an active run so the controller hands off to
|
|
223
|
+
// the HTML waiter. The observer-lost latch also stops the base reconnect loop
|
|
224
|
+
// (it sets `stopped`), which is what we want once we've handed off.
|
|
225
|
+
if (this.currentState === 'running' || this.currentState === 'stalled') {
|
|
226
|
+
this.consumeSignal({ kind: 'observer-lost' });
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
onSocketReconnectFailed() {
|
|
230
|
+
this.consumeSignal({ kind: 'observer-lost' });
|
|
231
|
+
}
|
|
232
|
+
enrichParams(method, rawParams) {
|
|
233
|
+
const params = { ...(0, cdp_trace_1.asRec)(rawParams) };
|
|
234
|
+
const id = requestId(params);
|
|
235
|
+
if (method === 'Network.requestWillBeSent' && id) {
|
|
236
|
+
const wallMs = eventWallMs(params);
|
|
237
|
+
if (wallMs !== null && wallMs < this.runStartTs)
|
|
238
|
+
return params;
|
|
239
|
+
const req = (0, cdp_trace_1.asRec)(params.request);
|
|
240
|
+
const url = typeof req.url === 'string' ? req.url : '';
|
|
241
|
+
if (url) {
|
|
242
|
+
this.requestUrls.set(id, url);
|
|
243
|
+
const rpcPath = observedRpcPathFromUrl(url);
|
|
244
|
+
if (rpcPath)
|
|
245
|
+
this.observedRpcPaths.add(rpcPath);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
else if (id && !params.requestUrl) {
|
|
249
|
+
const url = this.requestUrls.get(id);
|
|
250
|
+
if (url)
|
|
251
|
+
params.requestUrl = url;
|
|
252
|
+
}
|
|
253
|
+
return params;
|
|
254
|
+
}
|
|
255
|
+
consumeSignal(signal) {
|
|
256
|
+
if (this.terminalResult)
|
|
257
|
+
return;
|
|
258
|
+
this.countSignal(signal);
|
|
259
|
+
if (signal.kind === 'observer-lost') {
|
|
260
|
+
this.latch('observer-lost');
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (this.currentState === 'idle')
|
|
264
|
+
return;
|
|
265
|
+
if (signal.kind === 'chat-open' || signal.kind === 'chat-chunk' || signal.kind === 'heartbeat') {
|
|
266
|
+
this.lastActivity = this.now();
|
|
267
|
+
this.priorRunSignals++;
|
|
268
|
+
this.currentState = 'running';
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (signal.kind === 'release') {
|
|
272
|
+
if (this.priorRunSignals === 0)
|
|
273
|
+
return;
|
|
274
|
+
this.latch('finished');
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (signal.kind === 'critical-error') {
|
|
278
|
+
this.latch('blocked', `${signal.rpc} ${signal.status === 'failed' ? 'failed' : `HTTP ${signal.status}`}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
countSignal(signal) {
|
|
282
|
+
if (signal.kind === 'chat-open')
|
|
283
|
+
this.signalCounts.chatOpen++;
|
|
284
|
+
else if (signal.kind === 'chat-chunk')
|
|
285
|
+
this.signalCounts.chatChunk++;
|
|
286
|
+
else if (signal.kind === 'heartbeat')
|
|
287
|
+
this.signalCounts.heartbeat++;
|
|
288
|
+
else if (signal.kind === 'release')
|
|
289
|
+
this.signalCounts.release++;
|
|
290
|
+
else if (signal.kind === 'critical-error')
|
|
291
|
+
this.signalCounts.criticalError++;
|
|
292
|
+
else if (signal.kind === 'observer-lost')
|
|
293
|
+
this.signalCounts.observerLost++;
|
|
294
|
+
}
|
|
295
|
+
resetSignalCounts() {
|
|
296
|
+
this.signalCounts.chatOpen = 0;
|
|
297
|
+
this.signalCounts.chatChunk = 0;
|
|
298
|
+
this.signalCounts.heartbeat = 0;
|
|
299
|
+
this.signalCounts.release = 0;
|
|
300
|
+
this.signalCounts.criticalError = 0;
|
|
301
|
+
this.signalCounts.observerLost = 0;
|
|
302
|
+
}
|
|
303
|
+
checkSilence(stallMs, hardTimeoutMs) {
|
|
304
|
+
if (this.terminalResult || this.currentState === 'idle')
|
|
305
|
+
return;
|
|
306
|
+
const now = this.now();
|
|
307
|
+
const silence = now - this.lastActivity;
|
|
308
|
+
const elapsed = now - this.runStartTs;
|
|
309
|
+
if (silence > hardTimeoutMs) {
|
|
310
|
+
this.latch('timeout', `silent for ${silence}ms`);
|
|
311
|
+
}
|
|
312
|
+
else if (elapsed > hardTimeoutMs) {
|
|
313
|
+
// Absolute wall-clock cap. A run that keeps heartbeating (RenewTurn ~10s)
|
|
314
|
+
// but never releases never accumulates enough *silence* to time out — so
|
|
315
|
+
// without this it would hang indefinitely (worse than the old HTML waiter,
|
|
316
|
+
// which always had a true Date.now()-based budget). Bound total duration.
|
|
317
|
+
this.latch('timeout', `exceeded ${hardTimeoutMs}ms wall-clock budget (elapsed ${elapsed}ms)`);
|
|
318
|
+
}
|
|
319
|
+
else if (silence > stallMs) {
|
|
320
|
+
this.currentState = 'stalled';
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
armWatchdog(stallMs, hardTimeoutMs) {
|
|
324
|
+
if (this.watchdog)
|
|
325
|
+
return;
|
|
326
|
+
const intervalMs = Math.max(250, Math.min(1000, stallMs, hardTimeoutMs));
|
|
327
|
+
this.watchdog = setInterval(() => this.checkSilence(stallMs, hardTimeoutMs), intervalMs);
|
|
328
|
+
}
|
|
329
|
+
clearWatchdog() {
|
|
330
|
+
if (!this.watchdog)
|
|
331
|
+
return;
|
|
332
|
+
clearInterval(this.watchdog);
|
|
333
|
+
this.watchdog = null;
|
|
334
|
+
}
|
|
335
|
+
latch(terminal, reason) {
|
|
336
|
+
if (this.terminalResult)
|
|
337
|
+
return;
|
|
338
|
+
this.terminalResult = {
|
|
339
|
+
terminal,
|
|
340
|
+
// runStartTs stays 0 if the socket died before beginRun() ran; report 0
|
|
341
|
+
// elapsed rather than now()-0 (epoch millis), which would otherwise
|
|
342
|
+
// collapse the controller's HTML-fallback budget to ~1ms.
|
|
343
|
+
elapsedMs: this.runStartTs === 0 ? 0 : Math.max(0, this.now() - this.runStartTs),
|
|
344
|
+
...(reason ? { reason } : {})
|
|
345
|
+
};
|
|
346
|
+
this.clearWatchdog();
|
|
347
|
+
this.close();
|
|
348
|
+
const waiters = this.waiters.splice(0);
|
|
349
|
+
for (const resolve of waiters)
|
|
350
|
+
resolve(this.terminalResult);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
exports.RunStateObserver = RunStateObserver;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getSession = getSession;
|
|
7
|
+
exports.upsertSession = upsertSession;
|
|
8
|
+
exports.listSessions = listSessions;
|
|
9
|
+
exports.appendHistory = appendHistory;
|
|
10
|
+
exports.stateDir = stateDir;
|
|
11
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
12
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
14
|
+
const ROOT = process.env.DESIGNER_STATE_DIR || node_path_1.default.join(node_os_1.default.homedir(), '.designer');
|
|
15
|
+
const SESSIONS_FILE = node_path_1.default.join(ROOT, 'sessions.json');
|
|
16
|
+
function ensureRoot() {
|
|
17
|
+
node_fs_1.default.mkdirSync(ROOT, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
function readAll() {
|
|
20
|
+
ensureRoot();
|
|
21
|
+
if (!node_fs_1.default.existsSync(SESSIONS_FILE))
|
|
22
|
+
return {};
|
|
23
|
+
try {
|
|
24
|
+
return JSON.parse(node_fs_1.default.readFileSync(SESSIONS_FILE, 'utf8')) || {};
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function writeAll(data) {
|
|
31
|
+
ensureRoot();
|
|
32
|
+
node_fs_1.default.writeFileSync(SESSIONS_FILE, JSON.stringify(data, null, 2));
|
|
33
|
+
}
|
|
34
|
+
function getSession(key) {
|
|
35
|
+
return readAll()[key] || null;
|
|
36
|
+
}
|
|
37
|
+
function upsertSession(key, patch) {
|
|
38
|
+
const all = readAll();
|
|
39
|
+
const prev = all[key] || { key, createdAt: new Date().toISOString(), history: [] };
|
|
40
|
+
const next = { ...prev, ...patch, updatedAt: new Date().toISOString() };
|
|
41
|
+
all[key] = next;
|
|
42
|
+
writeAll(all);
|
|
43
|
+
return next;
|
|
44
|
+
}
|
|
45
|
+
function listSessions() {
|
|
46
|
+
return Object.values(readAll());
|
|
47
|
+
}
|
|
48
|
+
function appendHistory(key, entry) {
|
|
49
|
+
const all = readAll();
|
|
50
|
+
const prev = all[key] || { key, createdAt: new Date().toISOString(), history: [] };
|
|
51
|
+
prev.history = [...(prev.history || []), { ...entry, at: new Date().toISOString() }];
|
|
52
|
+
prev.updatedAt = new Date().toISOString();
|
|
53
|
+
all[key] = prev;
|
|
54
|
+
writeAll(all);
|
|
55
|
+
return prev;
|
|
56
|
+
}
|
|
57
|
+
function stateDir() {
|
|
58
|
+
return ROOT;
|
|
59
|
+
}
|