@maind-dev/mcp-bridge 0.6.0 → 0.8.1

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.
Files changed (40) hide show
  1. package/build/index.js +764 -157
  2. package/build/meta.json +1 -1
  3. package/package.json +16 -14
  4. package/build/auth.js +0 -179
  5. package/build/auth.js.map +0 -1
  6. package/build/client-detect.js +0 -109
  7. package/build/client-detect.js.map +0 -1
  8. package/build/device-id.js +0 -149
  9. package/build/device-id.js.map +0 -1
  10. package/build/forward.js +0 -433
  11. package/build/forward.js.map +0 -1
  12. package/build/index.js.map +0 -1
  13. package/build/install/atomic-write.js +0 -115
  14. package/build/install/atomic-write.js.map +0 -1
  15. package/build/install/browser-pair.js +0 -139
  16. package/build/install/browser-pair.js.map +0 -1
  17. package/build/install/client-targets.js +0 -135
  18. package/build/install/client-targets.js.map +0 -1
  19. package/build/install/flags.js +0 -139
  20. package/build/install/flags.js.map +0 -1
  21. package/build/install/hook-merge.js +0 -195
  22. package/build/install/hook-merge.js.map +0 -1
  23. package/build/install/index.js +0 -187
  24. package/build/install/index.js.map +0 -1
  25. package/build/install/json-merge.js +0 -160
  26. package/build/install/json-merge.js.map +0 -1
  27. package/build/install/preamble.js +0 -119
  28. package/build/install/preamble.js.map +0 -1
  29. package/build/install/project-root.js +0 -120
  30. package/build/install/project-root.js.map +0 -1
  31. package/build/install/report.js +0 -89
  32. package/build/install/report.js.map +0 -1
  33. package/build/install/telemetry.js +0 -83
  34. package/build/install/telemetry.js.map +0 -1
  35. package/build/install/toml-merge.js +0 -148
  36. package/build/install/toml-merge.js.map +0 -1
  37. package/build/project-key.js +0 -73
  38. package/build/project-key.js.map +0 -1
  39. package/build/version.js +0 -7
  40. package/build/version.js.map +0 -1
package/build/meta.json CHANGED
@@ -1 +1 @@
1
- {"inputs":{"src/client-detect.ts":{"bytes":3979,"imports":[],"format":"esm"},"src/forward.ts":{"bytes":20978,"imports":[{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:timers/promises","kind":"import-statement","external":true},{"path":"src/client-detect.ts","kind":"import-statement","original":"./client-detect.js"}],"format":"esm"},"src/device-id.ts":{"bytes":5476,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/auth.ts":{"bytes":8214,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"}],"format":"esm"},"src/version.ts":{"bytes":305,"imports":[],"format":"esm"},"src/project-key.ts":{"bytes":2719,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/install/flags.ts":{"bytes":5802,"imports":[],"format":"esm"},"src/install/report.ts":{"bytes":4292,"imports":[],"format":"esm"},"src/install/project-root.ts":{"bytes":4032,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"src/install/client-targets.ts":{"bytes":5727,"imports":[{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/install/atomic-write.ts":{"bytes":4154,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/install/json-merge.ts":{"bytes":5180,"imports":[{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/toml-merge.ts":{"bytes":4819,"imports":[{"path":"smol-toml","kind":"import-statement","external":true},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"../../packages/integration-snippets/build/index.js":{"bytes":35437,"imports":[],"format":"esm"},"src/install/preamble.ts":{"bytes":4556,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/integration-snippets/build/index.js","kind":"import-statement","original":"@maind-dev/integration-snippets"},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/hook-merge.ts":{"bytes":6597,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/browser-pair.ts":{"bytes":4543,"imports":[{"path":"src/auth.ts","kind":"import-statement","original":"../auth.js"},{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"}],"format":"esm"},"src/install/telemetry.ts":{"bytes":3027,"imports":[],"format":"esm"},"src/install/index.ts":{"bytes":7188,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/install/flags.ts","kind":"import-statement","original":"./flags.js"},{"path":"src/install/report.ts","kind":"import-statement","original":"./report.js"},{"path":"src/install/project-root.ts","kind":"import-statement","original":"./project-root.js"},{"path":"src/install/client-targets.ts","kind":"import-statement","original":"./client-targets.js"},{"path":"src/install/json-merge.ts","kind":"import-statement","original":"./json-merge.js"},{"path":"src/install/toml-merge.ts","kind":"import-statement","original":"./toml-merge.js"},{"path":"src/install/preamble.ts","kind":"import-statement","original":"./preamble.js"},{"path":"src/install/hook-merge.ts","kind":"import-statement","original":"./hook-merge.js"},{"path":"src/install/browser-pair.ts","kind":"import-statement","original":"./browser-pair.js"},{"path":"src/install/telemetry.ts","kind":"import-statement","original":"./telemetry.js"}],"format":"esm"},"../../packages/project-key/build/index.js":{"bytes":3446,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/keys.js":{"bytes":448,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/types.js":{"bytes":768,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/shared.js":{"bytes":2278,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/python.js":{"bytes":4535,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/lang/typescript.js":{"bytes":5949,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytes":1941,"imports":[{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytes":3231,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../types.js"},{"path":"../../packages/code-index/build/parse/lang/python.js","kind":"import-statement","original":"../lang/python.js"},{"path":"../../packages/code-index/build/parse/lang/typescript.js","kind":"import-statement","original":"../lang/typescript.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"../lang/shared.js"},{"path":"../../packages/code-index/build/parse/tree-sitter/grammars.js","kind":"import-statement","original":"./grammars.js"}],"format":"esm"},"../../packages/code-index/build/embed/recipe.js":{"bytes":594,"imports":[],"format":"esm"},"../../packages/code-index/build/embed/types.js":{"bytes":505,"imports":[],"format":"esm"},"../../packages/code-index/build/util/vector.js":{"bytes":707,"imports":[],"format":"esm"},"../../packages/code-index/build/graph/resolve.js":{"bytes":3928,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../parse/keys.js"}],"format":"esm"},"../../packages/code-index/build/incremental/discover.js":{"bytes":5200,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../parse/types.js"}],"format":"esm"},"../../packages/code-index/build/store/schema.js":{"bytes":3047,"imports":[],"format":"esm"},"../../packages/code-index/build/util/identifiers.js":{"bytes":2180,"imports":[],"format":"esm"},"../../packages/code-index/build/query/engine.js":{"bytes":14302,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/embed/recipe.js","kind":"import-statement","original":"../embed/recipe.js"},{"path":"../../packages/code-index/build/embed/types.js","kind":"import-statement","original":"../embed/types.js"},{"path":"../../packages/code-index/build/util/vector.js","kind":"import-statement","original":"../util/vector.js"},{"path":"../../packages/code-index/build/graph/resolve.js","kind":"import-statement","original":"../graph/resolve.js"},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/store/node-sqlite.js":{"bytes":11850,"imports":[{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"./schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/sync/types.js":{"bytes":1779,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/sync/client.js":{"bytes":10021,"imports":[{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/sync/types.js","kind":"import-statement","original":"./types.js"}],"format":"esm"},"../../packages/code-index/build/node.js":{"bytes":2578,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"},{"path":"../../packages/code-index/build/parse/tree-sitter/parser.js","kind":"import-statement","original":"./parse/tree-sitter/parser.js"},{"path":"../../packages/code-index/build/query/engine.js","kind":"import-statement","original":"./query/engine.js"},{"path":"../../packages/code-index/build/store/node-sqlite.js","kind":"import-statement","original":"./store/node-sqlite.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"}],"format":"esm"},"src/local-tools/engine.ts":{"bytes":1138,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"}],"format":"esm"},"src/local-tools/tools.ts":{"bytes":9138,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/local-tools/router.ts":{"bytes":3736,"imports":[{"path":"src/local-tools/engine.ts","kind":"import-statement","original":"./engine.js"},{"path":"src/local-tools/tools.ts","kind":"import-statement","original":"./tools.js"}],"format":"esm"},"src/index.ts":{"bytes":7321,"imports":[{"path":"src/forward.ts","kind":"import-statement","original":"./forward.js"},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/version.ts","kind":"import-statement","original":"./version.js"},{"path":"src/project-key.ts","kind":"import-statement","original":"./project-key.js"},{"path":"src/install/index.ts","kind":"import-statement","original":"./install/index.js"},{"path":"src/local-tools/router.ts","kind":"import-statement","original":"./local-tools/router.js"}],"format":"esm"}},"outputs":{"build/index.js":{"imports":[{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"smol-toml","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/forward.ts":{"bytesInOutput":13217},"src/client-detect.ts":{"bytesInOutput":2068},"src/device-id.ts":{"bytesInOutput":2233},"src/auth.ts":{"bytesInOutput":5089},"src/version.ts":{"bytesInOutput":30},"src/project-key.ts":{"bytesInOutput":1318},"src/install/index.ts":{"bytesInOutput":4992},"src/install/flags.ts":{"bytesInOutput":4255},"src/install/report.ts":{"bytesInOutput":3091},"src/install/project-root.ts":{"bytesInOutput":2188},"src/install/client-targets.ts":{"bytesInOutput":2805},"src/install/atomic-write.ts":{"bytesInOutput":1758},"src/install/json-merge.ts":{"bytesInOutput":3341},"src/install/toml-merge.ts":{"bytesInOutput":3262},"src/install/preamble.ts":{"bytesInOutput":2812},"../../packages/integration-snippets/build/index.js":{"bytesInOutput":27539},"src/install/hook-merge.ts":{"bytesInOutput":4594},"src/install/browser-pair.ts":{"bytesInOutput":2683},"src/install/telemetry.ts":{"bytesInOutput":1798},"src/local-tools/engine.ts":{"bytesInOutput":481},"../../packages/code-index/build/node.js":{"bytesInOutput":530},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytesInOutput":2043},"../../packages/code-index/build/parse/keys.js":{"bytesInOutput":169},"../../packages/code-index/build/parse/types.js":{"bytesInOutput":546},"../../packages/code-index/build/parse/lang/shared.js":{"bytesInOutput":1131},"../../packages/code-index/build/parse/lang/python.js":{"bytesInOutput":3747},"../../packages/code-index/build/parse/lang/typescript.js":{"bytesInOutput":4716},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytesInOutput":523},"../../packages/code-index/build/query/engine.js":{"bytesInOutput":10593},"../../packages/code-index/build/embed/recipe.js":{"bytesInOutput":197},"../../packages/code-index/build/embed/types.js":{"bytesInOutput":105},"../../packages/code-index/build/util/vector.js":{"bytesInOutput":339},"../../packages/code-index/build/graph/resolve.js":{"bytesInOutput":2482},"../../packages/code-index/build/incremental/discover.js":{"bytesInOutput":3513},"../../packages/code-index/build/store/schema.js":{"bytesInOutput":2170},"../../packages/code-index/build/util/identifiers.js":{"bytesInOutput":1094},"../../packages/code-index/build/store/node-sqlite.js":{"bytesInOutput":9759},"src/local-tools/tools.ts":{"bytesInOutput":7492},"src/local-tools/router.ts":{"bytesInOutput":2481},"src/index.ts":{"bytesInOutput":4076}},"bytes":149113}}}
1
+ {"inputs":{"src/client-detect.ts":{"bytes":3979,"imports":[],"format":"esm"},"src/forward.ts":{"bytes":20978,"imports":[{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:timers/promises","kind":"import-statement","external":true},{"path":"src/client-detect.ts","kind":"import-statement","original":"./client-detect.js"}],"format":"esm"},"src/device-id.ts":{"bytes":5476,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/auth.ts":{"bytes":8214,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"}],"format":"esm"},"src/version.ts":{"bytes":305,"imports":[],"format":"esm"},"src/project-key.ts":{"bytes":2719,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/install/flags.ts":{"bytes":5802,"imports":[],"format":"esm"},"src/install/report.ts":{"bytes":4292,"imports":[],"format":"esm"},"src/install/project-root.ts":{"bytes":4032,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"src/install/client-targets.ts":{"bytes":5727,"imports":[{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/install/atomic-write.ts":{"bytes":4154,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/install/json-merge.ts":{"bytes":5180,"imports":[{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/toml-merge.ts":{"bytes":4819,"imports":[{"path":"smol-toml","kind":"import-statement","external":true},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"../../packages/integration-snippets/build/index.js":{"bytes":35437,"imports":[],"format":"esm"},"src/install/preamble.ts":{"bytes":4556,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/integration-snippets/build/index.js","kind":"import-statement","original":"@maind-dev/integration-snippets"},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/hook-merge.ts":{"bytes":8176,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/browser-pair.ts":{"bytes":4543,"imports":[{"path":"src/auth.ts","kind":"import-statement","original":"../auth.js"},{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"}],"format":"esm"},"src/install/telemetry.ts":{"bytes":3027,"imports":[],"format":"esm"},"src/install/index.ts":{"bytes":7285,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/install/flags.ts","kind":"import-statement","original":"./flags.js"},{"path":"src/install/report.ts","kind":"import-statement","original":"./report.js"},{"path":"src/install/project-root.ts","kind":"import-statement","original":"./project-root.js"},{"path":"src/install/client-targets.ts","kind":"import-statement","original":"./client-targets.js"},{"path":"src/install/json-merge.ts","kind":"import-statement","original":"./json-merge.js"},{"path":"src/install/toml-merge.ts","kind":"import-statement","original":"./toml-merge.js"},{"path":"src/install/preamble.ts","kind":"import-statement","original":"./preamble.js"},{"path":"src/install/hook-merge.ts","kind":"import-statement","original":"./hook-merge.js"},{"path":"src/install/browser-pair.ts","kind":"import-statement","original":"./browser-pair.js"},{"path":"src/install/telemetry.ts","kind":"import-statement","original":"./telemetry.js"}],"format":"esm"},"../../packages/project-key/build/index.js":{"bytes":3446,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/keys.js":{"bytes":448,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/types.js":{"bytes":768,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/shared.js":{"bytes":2278,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/python.js":{"bytes":4535,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/lang/typescript.js":{"bytes":5949,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytes":1941,"imports":[{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytes":3231,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../types.js"},{"path":"../../packages/code-index/build/parse/lang/python.js","kind":"import-statement","original":"../lang/python.js"},{"path":"../../packages/code-index/build/parse/lang/typescript.js","kind":"import-statement","original":"../lang/typescript.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"../lang/shared.js"},{"path":"../../packages/code-index/build/parse/tree-sitter/grammars.js","kind":"import-statement","original":"./grammars.js"}],"format":"esm"},"../../packages/code-index/build/embed/recipe.js":{"bytes":594,"imports":[],"format":"esm"},"../../packages/code-index/build/embed/types.js":{"bytes":505,"imports":[],"format":"esm"},"../../packages/code-index/build/util/vector.js":{"bytes":707,"imports":[],"format":"esm"},"../../packages/code-index/build/graph/resolve.js":{"bytes":3928,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../parse/keys.js"}],"format":"esm"},"../../packages/code-index/build/incremental/discover.js":{"bytes":5200,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../parse/types.js"}],"format":"esm"},"../../packages/code-index/build/store/schema.js":{"bytes":3047,"imports":[],"format":"esm"},"../../packages/code-index/build/util/identifiers.js":{"bytes":2180,"imports":[],"format":"esm"},"../../packages/code-index/build/query/engine.js":{"bytes":14302,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/embed/recipe.js","kind":"import-statement","original":"../embed/recipe.js"},{"path":"../../packages/code-index/build/embed/types.js","kind":"import-statement","original":"../embed/types.js"},{"path":"../../packages/code-index/build/util/vector.js","kind":"import-statement","original":"../util/vector.js"},{"path":"../../packages/code-index/build/graph/resolve.js","kind":"import-statement","original":"../graph/resolve.js"},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/store/node-sqlite.js":{"bytes":11850,"imports":[{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"./schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/sync/types.js":{"bytes":1779,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/sync/client.js":{"bytes":10021,"imports":[{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/sync/types.js","kind":"import-statement","original":"./types.js"}],"format":"esm"},"../../packages/code-index/build/node.js":{"bytes":2578,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"},{"path":"../../packages/code-index/build/parse/tree-sitter/parser.js","kind":"import-statement","original":"./parse/tree-sitter/parser.js"},{"path":"../../packages/code-index/build/query/engine.js","kind":"import-statement","original":"./query/engine.js"},{"path":"../../packages/code-index/build/store/node-sqlite.js","kind":"import-statement","original":"./store/node-sqlite.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"}],"format":"esm"},"src/local-tools/engine.ts":{"bytes":1138,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"}],"format":"esm"},"src/local-tools/token-estimate.ts":{"bytes":898,"imports":[],"format":"esm"},"src/local-tools/savings.ts":{"bytes":3781,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/local-tools/token-estimate.ts","kind":"import-statement","original":"./token-estimate.js"}],"format":"esm"},"src/local-tools/tools.ts":{"bytes":9138,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/local-tools/router.ts":{"bytes":5550,"imports":[{"path":"src/local-tools/engine.ts","kind":"import-statement","original":"./engine.js"},{"path":"src/local-tools/savings.ts","kind":"import-statement","original":"./savings.js"},{"path":"src/local-tools/tools.ts","kind":"import-statement","original":"./tools.js"}],"format":"esm"},"src/functions-origin.ts":{"bytes":714,"imports":[],"format":"esm"},"src/metrics-post.ts":{"bytes":2619,"imports":[{"path":"src/functions-origin.ts","kind":"import-statement","original":"./functions-origin.js"}],"format":"esm"},"../../packages/claude-code-telemetry/dist/types.js":{"bytes":338,"imports":[],"format":"esm"},"../../packages/claude-code-telemetry/dist/transcript.js":{"bytes":2017,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"../../packages/claude-code-telemetry/dist/decisions.js":{"bytes":6845,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"../../packages/claude-code-telemetry/dist/effort.js":{"bytes":1858,"imports":[],"format":"esm"},"../../packages/claude-code-telemetry/dist/session-analysis.js":{"bytes":12237,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"../../packages/claude-code-telemetry/dist/effort.js","kind":"import-statement","original":"./effort.js"}],"format":"esm"},"../../packages/claude-code-telemetry/dist/parse.js":{"bytes":7254,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"../../packages/claude-code-telemetry/dist/effort.js","kind":"import-statement","original":"./effort.js"},{"path":"../../packages/claude-code-telemetry/dist/types.js","kind":"import-statement","original":"./types.js"}],"format":"esm"},"../../packages/claude-code-telemetry/dist/windows.js":{"bytes":3963,"imports":[],"format":"esm"},"../../packages/claude-code-telemetry/dist/projects.js":{"bytes":3166,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"../../packages/claude-code-telemetry/dist/index.js":{"bytes":685,"imports":[{"path":"../../packages/claude-code-telemetry/dist/types.js","kind":"import-statement","original":"./types.js"},{"path":"../../packages/claude-code-telemetry/dist/transcript.js","kind":"import-statement","original":"./transcript.js"},{"path":"../../packages/claude-code-telemetry/dist/decisions.js","kind":"import-statement","original":"./decisions.js"},{"path":"../../packages/claude-code-telemetry/dist/session-analysis.js","kind":"import-statement","original":"./session-analysis.js"},{"path":"../../packages/claude-code-telemetry/dist/parse.js","kind":"import-statement","original":"./parse.js"},{"path":"../../packages/claude-code-telemetry/dist/effort.js","kind":"import-statement","original":"./effort.js"},{"path":"../../packages/claude-code-telemetry/dist/windows.js","kind":"import-statement","original":"./windows.js"},{"path":"../../packages/claude-code-telemetry/dist/projects.js","kind":"import-statement","original":"./projects.js"}],"format":"esm"},"src/session-end/index.ts":{"bytes":3483,"imports":[{"path":"../../packages/claude-code-telemetry/dist/index.js","kind":"import-statement","original":"@maind/claude-code-telemetry"},{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"}],"format":"esm"},"src/index.ts":{"bytes":9764,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/forward.ts","kind":"import-statement","original":"./forward.js"},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/version.ts","kind":"import-statement","original":"./version.js"},{"path":"src/project-key.ts","kind":"import-statement","original":"./project-key.js"},{"path":"src/install/index.ts","kind":"import-statement","original":"./install/index.js"},{"path":"src/local-tools/router.ts","kind":"import-statement","original":"./local-tools/router.js"},{"path":"src/local-tools/savings.ts","kind":"import-statement","original":"./local-tools/savings.js"},{"path":"src/metrics-post.ts","kind":"import-statement","original":"./metrics-post.js"},{"path":"src/session-end/index.ts","kind":"dynamic-import","original":"./session-end/index.js"}],"format":"esm"}},"outputs":{"build/index.js":{"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"smol-toml","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/device-id.ts":{"bytesInOutput":2356},"src/version.ts":{"bytesInOutput":126},"../../packages/claude-code-telemetry/dist/types.js":{"bytesInOutput":110},"../../packages/claude-code-telemetry/dist/transcript.js":{"bytesInOutput":120},"../../packages/claude-code-telemetry/dist/decisions.js":{"bytesInOutput":118},"../../packages/claude-code-telemetry/dist/effort.js":{"bytesInOutput":596},"../../packages/claude-code-telemetry/dist/session-analysis.js":{"bytesInOutput":7774},"../../packages/claude-code-telemetry/dist/parse.js":{"bytesInOutput":147},"../../packages/claude-code-telemetry/dist/windows.js":{"bytesInOutput":219},"../../packages/claude-code-telemetry/dist/projects.js":{"bytesInOutput":326},"../../packages/claude-code-telemetry/dist/index.js":{"bytesInOutput":279},"src/session-end/index.ts":{"bytesInOutput":2476},"src/index.ts":{"bytesInOutput":5306},"src/forward.ts":{"bytesInOutput":13217},"src/client-detect.ts":{"bytesInOutput":2068},"src/auth.ts":{"bytesInOutput":5107},"src/project-key.ts":{"bytesInOutput":1318},"src/install/index.ts":{"bytesInOutput":5049},"src/install/flags.ts":{"bytesInOutput":4255},"src/install/report.ts":{"bytesInOutput":3091},"src/install/project-root.ts":{"bytesInOutput":2188},"src/install/client-targets.ts":{"bytesInOutput":2805},"src/install/atomic-write.ts":{"bytesInOutput":1758},"src/install/json-merge.ts":{"bytesInOutput":3341},"src/install/toml-merge.ts":{"bytesInOutput":3262},"src/install/preamble.ts":{"bytesInOutput":2812},"../../packages/integration-snippets/build/index.js":{"bytesInOutput":27539},"src/install/hook-merge.ts":{"bytesInOutput":5372},"src/install/browser-pair.ts":{"bytesInOutput":2701},"src/install/telemetry.ts":{"bytesInOutput":1798},"src/local-tools/engine.ts":{"bytesInOutput":481},"../../packages/code-index/build/node.js":{"bytesInOutput":530},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytesInOutput":2043},"../../packages/code-index/build/parse/keys.js":{"bytesInOutput":169},"../../packages/code-index/build/parse/types.js":{"bytesInOutput":546},"../../packages/code-index/build/parse/lang/shared.js":{"bytesInOutput":1131},"../../packages/code-index/build/parse/lang/python.js":{"bytesInOutput":3747},"../../packages/code-index/build/parse/lang/typescript.js":{"bytesInOutput":4716},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytesInOutput":523},"../../packages/code-index/build/query/engine.js":{"bytesInOutput":10593},"../../packages/code-index/build/embed/recipe.js":{"bytesInOutput":197},"../../packages/code-index/build/embed/types.js":{"bytesInOutput":105},"../../packages/code-index/build/util/vector.js":{"bytesInOutput":339},"../../packages/code-index/build/graph/resolve.js":{"bytesInOutput":2482},"../../packages/code-index/build/incremental/discover.js":{"bytesInOutput":3513},"../../packages/code-index/build/store/schema.js":{"bytesInOutput":2170},"../../packages/code-index/build/util/identifiers.js":{"bytesInOutput":1094},"../../packages/code-index/build/store/node-sqlite.js":{"bytesInOutput":9759},"src/local-tools/savings.ts":{"bytesInOutput":1923},"src/local-tools/token-estimate.ts":{"bytesInOutput":133},"src/local-tools/tools.ts":{"bytesInOutput":7492},"src/local-tools/router.ts":{"bytesInOutput":3827},"src/functions-origin.ts":{"bytesInOutput":259},"src/metrics-post.ts":{"bytesInOutput":1285}},"bytes":169635}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maind-dev/mcp-bridge",
3
- "version": "0.6.0",
4
- "description": "Local MCP bridge for maind.dev — wraps any MCP-compatible client (Claude Code, Cursor, Windsurf) and pins your API key to a single device via the maind device authorization flow.",
3
+ "version": "0.8.1",
4
+ "description": "Local MCP bridge for maind.dev \u2014 wraps any MCP-compatible client (Claude Code, Cursor, Windsurf) and pins your API key to a single device via the maind device authorization flow.",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
7
7
  "bin": {
@@ -11,6 +11,15 @@
11
11
  "build",
12
12
  "README.md"
13
13
  ],
14
+ "scripts": {
15
+ "build": "node scripts/bundle.mjs",
16
+ "prepublishOnly": "pnpm build",
17
+ "start": "node build/index.js",
18
+ "dev": "node --watch --watch-path=src --import tsx src/index.ts",
19
+ "test": "node --import tsx --test 'test/**/*.test.ts'",
20
+ "type-check": "tsc --noEmit",
21
+ "typecheck": "tsc --noEmit"
22
+ },
14
23
  "dependencies": {
15
24
  "@modelcontextprotocol/sdk": "^1.0.0",
16
25
  "better-sqlite3": "^12.11.1",
@@ -19,12 +28,13 @@
19
28
  "web-tree-sitter": "0.24.7"
20
29
  },
21
30
  "devDependencies": {
31
+ "@maind-dev/integration-snippets": "workspace:*",
32
+ "@maind/claude-code-telemetry": "workspace:*",
33
+ "@maind/code-index": "workspace:*",
22
34
  "@types/node": "^20.11.0",
23
35
  "esbuild": "^0.24.0",
24
36
  "tsx": "^4.7.0",
25
- "typescript": "^5.4.0",
26
- "@maind-dev/integration-snippets": "0.1.0",
27
- "@maind/code-index": "0.0.0"
37
+ "typescript": "^5.4.0"
28
38
  },
29
39
  "engines": {
30
40
  "node": ">=20.0.0"
@@ -39,13 +49,5 @@
39
49
  "license": "MIT",
40
50
  "publishConfig": {
41
51
  "access": "public"
42
- },
43
- "scripts": {
44
- "build": "node scripts/bundle.mjs",
45
- "start": "node build/index.js",
46
- "dev": "node --watch --watch-path=src --import tsx src/index.ts",
47
- "test": "node --import tsx --test 'test/**/*.test.ts'",
48
- "type-check": "tsc --noEmit",
49
- "typecheck": "tsc --noEmit"
50
52
  }
51
- }
53
+ }
package/build/auth.js DELETED
@@ -1,179 +0,0 @@
1
- // Device-Authorization-Flow client (RFC 8628, adapted for Supabase Edge Functions).
2
- //
3
- // Mirrors apps/vscode-extension/src/auth/deviceFlow.ts. The server side
4
- // (device-authorization-start / -poll Edge Functions + approve_device_authorization
5
- // RPC chain) is shared between the bridge and the VS Code extension. By using
6
- // the same flow we get the existing devices-aggregate + revoke-on-pair
7
- // (ADR-103) for free.
8
- //
9
- // Critical: the bridge speaks MCP over stdio. STDOUT is reserved for the JSON-RPC
10
- // protocol — any progress or auth-flow text MUST go to STDERR. Writing to
11
- // STDOUT here would corrupt the MCP framing and crash the upstream client.
12
- import { spawn } from "node:child_process";
13
- import { platform } from "node:os";
14
- import { clientMeta, writeApiKey, clearApiKey, ensureDeviceId } from "./device-id.js";
15
- /**
16
- * Default Supabase Edge Function origin. Override via env `MAIND_FUNCTIONS_ORIGIN`
17
- * for self-hosted/preview environments. Production points at the maind
18
- * project's Supabase Functions endpoint.
19
- */
20
- const DEFAULT_FUNCTIONS_ORIGIN = "https://vsddmiosisvfrairepxv.supabase.co/functions/v1";
21
- function functionsOrigin() {
22
- const v = process.env.MAIND_FUNCTIONS_ORIGIN;
23
- return v && v.length > 0 ? v.replace(/\/+$/, "") : DEFAULT_FUNCTIONS_ORIGIN;
24
- }
25
- /**
26
- * Runs the device-authorization flow end-to-end:
27
- * 1. POST /device-authorization-start → user_code + verification_uri_complete
28
- * 2. Open the verification URL in the user's default browser (best-effort)
29
- * 3. Print the user_code to STDERR as a fallback (so the user can paste manually)
30
- * 4. Poll /device-authorization-poll every `interval` seconds until approved/denied/expired
31
- *
32
- * On approval, persists the returned api_key to disk (api-key file in configDir)
33
- * and returns it for immediate use. On denial/expiry/timeout, returns null —
34
- * the caller should exit non-zero so the MCP client treats the bridge as failed.
35
- */
36
- export async function runDeviceFlow(version) {
37
- const origin = functionsOrigin();
38
- const startUrl = `${origin}/device-authorization-start`;
39
- const pollUrl = `${origin}/device-authorization-poll`;
40
- const meta = clientMeta(version);
41
- const label = `mcp-bridge-${meta.device_id.slice(0, 8)}`;
42
- const startRes = await fetch(startUrl, {
43
- method: "POST",
44
- headers: { "content-type": "application/json" },
45
- body: JSON.stringify({ label, meta }),
46
- });
47
- if (!startRes.ok) {
48
- const txt = await startRes.text();
49
- throw new Error(`device-authorization-start failed: ${startRes.status} ${txt}`);
50
- }
51
- const start = (await startRes.json());
52
- // Best-effort browser open. If it fails (headless servers, CI, restricted
53
- // sandbox), the printed verification_uri + user_code is the fallback path.
54
- await openExternalBrowser(start.verification_uri_complete).catch(() => {
55
- // ignore — printed instructions below cover the fallback
56
- });
57
- printAuthInstructions(start);
58
- const deadline = Date.now() + start.expires_in * 1000;
59
- const intervalMs = Math.max(start.interval, 3) * 1000;
60
- while (Date.now() < deadline) {
61
- await sleep(intervalMs);
62
- const poll = await pollOnce(pollUrl, start.device_code).catch((e) => {
63
- // Transient network failures shouldn't abort the flow; the user has
64
- // expires_in seconds to sort it out. Log to stderr for visibility.
65
- process.stderr.write(`[maind-mcp-bridge] poll error (will retry): ${String(e)}\n`);
66
- return null;
67
- });
68
- if (!poll)
69
- continue;
70
- if (poll.status === "approved") {
71
- writeApiKey(poll.api_key);
72
- process.stderr.write(`[maind-mcp-bridge] signed in (plan: ${poll.plan}). API key saved to ~/.config/maind/api-key\n`);
73
- return { apiKey: poll.api_key, plan: poll.plan };
74
- }
75
- if (poll.status === "denied") {
76
- process.stderr.write("[maind-mcp-bridge] sign-in denied by user\n");
77
- return null;
78
- }
79
- if (poll.status === "expired" || poll.status === "consumed") {
80
- process.stderr.write(`[maind-mcp-bridge] sign-in ${poll.status}\n`);
81
- return null;
82
- }
83
- // status: "pending" → keep polling
84
- }
85
- process.stderr.write("[maind-mcp-bridge] sign-in timed out\n");
86
- return null;
87
- }
88
- async function pollOnce(url, deviceCode) {
89
- const res = await fetch(url, {
90
- method: "POST",
91
- headers: { "content-type": "application/json" },
92
- body: JSON.stringify({ device_code: deviceCode }),
93
- });
94
- if (!res.ok) {
95
- const txt = await res.text();
96
- throw new Error(`poll ${res.status}: ${txt}`);
97
- }
98
- return (await res.json());
99
- }
100
- function sleep(ms) {
101
- return new Promise((resolve) => setTimeout(resolve, ms));
102
- }
103
- function printAuthInstructions(start) {
104
- const lines = [
105
- "",
106
- " ┌─────────────────────────────────────────────────────────────────┐",
107
- " │ │",
108
- " │ maind-mcp-bridge — first-time setup │",
109
- " │ │",
110
- " │ Approve this bridge to bind it to your maind account: │",
111
- " │ │",
112
- ` │ Open: ${pad(start.verification_uri, 56)} │`,
113
- ` │ Code: ${pad(start.user_code, 56)} │`,
114
- " │ │",
115
- ` │ (expires in ${Math.round(start.expires_in / 60)} minutes)`.padEnd(67) + "│",
116
- " │ │",
117
- " └─────────────────────────────────────────────────────────────────┘",
118
- "",
119
- ];
120
- // STDERR — STDOUT is the MCP framing channel
121
- process.stderr.write(lines.join("\n") + "\n");
122
- }
123
- function pad(s, width) {
124
- if (s.length >= width)
125
- return s.slice(0, width);
126
- return s + " ".repeat(width - s.length);
127
- }
128
- /**
129
- * Spawns a platform-appropriate command to open the given URL in the user's
130
- * default browser. Detached so it doesn't keep the bridge process alive.
131
- * Errors are swallowed — the printed verification_uri + user_code in
132
- * printAuthInstructions() is the fallback path.
133
- */
134
- async function openExternalBrowser(url) {
135
- let cmd;
136
- let args;
137
- switch (platform()) {
138
- case "darwin":
139
- cmd = "open";
140
- args = [url];
141
- break;
142
- case "win32":
143
- cmd = "cmd";
144
- args = ["/c", "start", "", url];
145
- break;
146
- default:
147
- cmd = "xdg-open";
148
- args = [url];
149
- break;
150
- }
151
- return new Promise((resolve, reject) => {
152
- try {
153
- const child = spawn(cmd, args, {
154
- stdio: "ignore",
155
- detached: true,
156
- });
157
- child.on("error", reject);
158
- child.unref();
159
- // Resolve immediately — we don't wait for the browser process to finish.
160
- resolve();
161
- }
162
- catch (err) {
163
- reject(err);
164
- }
165
- });
166
- }
167
- /**
168
- * Forces a re-authorization after the server reports the api_key was revoked.
169
- * The device-id is preserved — the server will recognize the re-pair on its
170
- * side and atomically revoke the old key + bind the new one (see ADR-103
171
- * `upsert_device_on_pair`).
172
- */
173
- export async function reauthorize(version) {
174
- clearApiKey();
175
- // Make sure the device-id is materialised even if it wasn't before.
176
- ensureDeviceId();
177
- return runDeviceFlow(version);
178
- }
179
- //# sourceMappingURL=auth.js.map
package/build/auth.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,wEAAwE;AACxE,oFAAoF;AACpF,8EAA8E;AAC9E,uEAAuE;AACvE,sBAAsB;AACtB,EAAE;AACF,kFAAkF;AAClF,0EAA0E;AAC1E,2EAA2E;AAE3E,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAqBtF;;;;GAIG;AACH,MAAM,wBAAwB,GAAG,uDAAuD,CAAC;AAEzF,SAAS,eAAe;IACtB,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC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;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAe;IAC/C,WAAW,EAAE,CAAC;IACd,oEAAoE;IACpE,cAAc,EAAE,CAAC;IACjB,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
@@ -1,109 +0,0 @@
1
- // MIRROR of packages/types/src/client-families.ts — DO NOT EDIT IN ISOLATION.
2
- //
3
- // This file lives in the bridge package so the published npm artifact stays
4
- // self-contained (no workspace runtime imports). The mapping MUST match the
5
- // canonical version at packages/types/src/client-families.ts byte-for-byte
6
- // (or at least value-for-value) — apps/mcp-bridge/test/client-detect.test.ts
7
- // asserts data-equivalence and will fail CI on drift.
8
- //
9
- // When adding a new client family or rename pattern: update BOTH files in the
10
- // same commit. The pre-commit hook (Block 5) catches diffs that touch
11
- // apps/mcp-bridge/src/ without a corresponding package.json version bump,
12
- // which is the failure mode that caused the multi-day Codex-as-mcp-bridge
13
- // mis-attribution incident on 2026-05-24..28.
14
- export const CLIENT_FAMILIES = [
15
- "claude-code",
16
- "codex",
17
- "copilot",
18
- "cursor",
19
- "windsurf",
20
- "mcp-bridge",
21
- "vscode-extension",
22
- "claude-desktop",
23
- "mcp-inspector",
24
- "maind-cli",
25
- "unknown",
26
- ];
27
- export const CLIENT_INFO_NAME_PATTERNS = [
28
- // Anthropic
29
- ["claude-code", "claude-code"],
30
- ["claude-cli", "claude-code"],
31
- ["claude-desktop", "claude-desktop"],
32
- ["claude.app", "claude-desktop"],
33
- // OpenAI
34
- ["openai-codex", "codex"],
35
- ["codex-cli", "codex"],
36
- ["codex", "codex"],
37
- // GitHub / Microsoft
38
- ["github-copilot", "copilot"],
39
- ["vscode-copilot", "copilot"],
40
- ["copilot", "copilot"],
41
- // Editors / IDE clients
42
- ["cursor", "cursor"],
43
- ["windsurf", "windsurf"],
44
- ["codeium", "windsurf"],
45
- ["vscode-extension", "vscode-extension"],
46
- ["maind-vscode", "vscode-extension"],
47
- // Tooling
48
- ["mcp-inspector", "mcp-inspector"],
49
- // Headless CI CLI (@maind-dev/cli — `maind context`). Matched before the
50
- // bridge entry; "maind-cli" is not a substring of "maind-mcp-bridge".
51
- ["maind-cli", "maind-cli"],
52
- // Bridge identifying itself explicitly (rare; usually we want the upstream client)
53
- ["maind-mcp-bridge", "mcp-bridge"],
54
- ];
55
- export function mapClientInfoNameToFamily(rawName) {
56
- if (typeof rawName !== "string")
57
- return null;
58
- const name = rawName.trim().toLowerCase();
59
- if (name.length === 0)
60
- return null;
61
- for (const [pattern, family] of CLIENT_INFO_NAME_PATTERNS) {
62
- if (name.includes(pattern))
63
- return family;
64
- }
65
- return null;
66
- }
67
- /**
68
- * Parses an arbitrary string that the bridge is forwarding as a JSON-RPC frame
69
- * and, if it's an MCP `initialize` request with a usable clientInfo.name,
70
- * returns the canonical family + version. Returns null for everything else.
71
- *
72
- * Used by Forwarder.forwardFrame() to auto-detect the client family from the
73
- * very first frame without requiring per-user MAIND_CLIENT_FAMILY config.
74
- *
75
- * Defensively try/catch: a malformed frame is normal (clients send all sorts
76
- * of garbage); we never throw here. Worst case = null = no auto-detection.
77
- */
78
- export function tryExtractInitializeClient(frame) {
79
- let parsed;
80
- try {
81
- parsed = JSON.parse(frame);
82
- }
83
- catch {
84
- return null;
85
- }
86
- if (!isRecord(parsed))
87
- return null;
88
- if (parsed.method !== "initialize")
89
- return null;
90
- const params = parsed.params;
91
- if (!isRecord(params))
92
- return null;
93
- const clientInfo = params.clientInfo;
94
- if (!isRecord(clientInfo))
95
- return null;
96
- const rawName = clientInfo.name;
97
- const family = mapClientInfoNameToFamily(typeof rawName === "string" ? rawName : null);
98
- if (family === null)
99
- return null;
100
- const rawVersion = clientInfo.version;
101
- const version = typeof rawVersion === "string" && rawVersion.length > 0
102
- ? rawVersion.slice(0, 64)
103
- : null;
104
- return { family, version };
105
- }
106
- function isRecord(v) {
107
- return typeof v === "object" && v !== null && !Array.isArray(v);
108
- }
109
- //# sourceMappingURL=client-detect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-detect.js","sourceRoot":"","sources":["../src/client-detect.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,6EAA6E;AAC7E,sDAAsD;AACtD,EAAE;AACF,8EAA8E;AAC9E,sEAAsE;AACtE,0EAA0E;AAC1E,0EAA0E;AAC1E,8CAA8C;AAE9C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,aAAa;IACb,OAAO;IACP,SAAS;IACT,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,WAAW;IACX,SAAS;CACD,CAAC;AAIX,MAAM,CAAC,MAAM,yBAAyB,GAAmD;IACvF,YAAY;IACZ,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,YAAY,EAAE,aAAa,CAAC;IAC7B,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,YAAY,EAAE,gBAAgB,CAAC;IAEhC,SAAS;IACT,CAAC,cAAc,EAAE,OAAO,CAAC;IACzB,CAAC,WAAW,EAAE,OAAO,CAAC;IACtB,CAAC,OAAO,EAAE,OAAO,CAAC;IAElB,qBAAqB;IACrB,CAAC,gBAAgB,EAAE,SAAS,CAAC;IAC7B,CAAC,gBAAgB,EAAE,SAAS,CAAC;IAC7B,CAAC,SAAS,EAAE,SAAS,CAAC;IAEtB,wBAAwB;IACxB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,UAAU,EAAE,UAAU,CAAC;IACxB,CAAC,SAAS,EAAE,UAAU,CAAC;IACvB,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACxC,CAAC,cAAc,EAAE,kBAAkB,CAAC;IAEpC,UAAU;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