relay-os 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +389 -0
- package/backend/hooks/relay-antigravity-stop.js +3 -0
- package/backend/hooks/relay-claude-stop.js +3 -0
- package/backend/hooks/relay-codex-stop.js +3 -0
- package/backend/hooks/relay-copilot-stop.js +3 -0
- package/backend/hooks/relay-cursor-stop.js +3 -0
- package/backend/hooks/relay-hook-lib.js +170 -0
- package/backend/lib/relayAuth.js +41 -0
- package/backend/lib/relayCompileIr.js +276 -0
- package/backend/lib/relayContext.js +519 -0
- package/backend/lib/relayDashboard.js +118 -0
- package/backend/lib/relayHooks.js +190 -0
- package/backend/lib/relayInstall.js +339 -0
- package/backend/lib/relayMeta.js +61 -0
- package/backend/lib/relayProjects.js +225 -0
- package/backend/lib/relayServe.js +120 -0
- package/backend/lib/relayStore.js +173 -0
- package/backend/lib/relayUi.js +68 -0
- package/backend/lib/timeline.js +101 -0
- package/backend/lib/vscdb.js +42 -0
- package/backend/lib/vscodeHistory.js +227 -0
- package/backend/lib/vscodeWorkspace.js +77 -0
- package/backend/mcp/server.js +228 -0
- package/backend/node_modules/.bin/mime +16 -0
- package/backend/node_modules/.bin/mime.cmd +17 -0
- package/backend/node_modules/.bin/mime.ps1 +28 -0
- package/backend/node_modules/.package-lock.json +846 -0
- package/backend/node_modules/accepts/HISTORY.md +243 -0
- package/backend/node_modules/accepts/LICENSE +23 -0
- package/backend/node_modules/accepts/README.md +140 -0
- package/backend/node_modules/accepts/index.js +238 -0
- package/backend/node_modules/accepts/package.json +47 -0
- package/backend/node_modules/array-flatten/LICENSE +21 -0
- package/backend/node_modules/array-flatten/README.md +43 -0
- package/backend/node_modules/array-flatten/array-flatten.js +64 -0
- package/backend/node_modules/array-flatten/package.json +39 -0
- package/backend/node_modules/body-parser/HISTORY.md +686 -0
- package/backend/node_modules/body-parser/LICENSE +23 -0
- package/backend/node_modules/body-parser/README.md +476 -0
- package/backend/node_modules/body-parser/index.js +156 -0
- package/backend/node_modules/body-parser/lib/read.js +205 -0
- package/backend/node_modules/body-parser/lib/types/json.js +243 -0
- package/backend/node_modules/body-parser/lib/types/raw.js +101 -0
- package/backend/node_modules/body-parser/lib/types/text.js +121 -0
- package/backend/node_modules/body-parser/lib/types/urlencoded.js +299 -0
- package/backend/node_modules/body-parser/package.json +55 -0
- package/backend/node_modules/bytes/History.md +97 -0
- package/backend/node_modules/bytes/LICENSE +23 -0
- package/backend/node_modules/bytes/Readme.md +152 -0
- package/backend/node_modules/bytes/index.js +170 -0
- package/backend/node_modules/bytes/package.json +42 -0
- package/backend/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/backend/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/backend/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/backend/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/backend/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/backend/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/backend/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/backend/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/backend/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/backend/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/backend/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/backend/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/backend/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/backend/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/backend/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/backend/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/backend/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/backend/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/backend/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/backend/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/backend/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/backend/node_modules/call-bound/.eslintrc +13 -0
- package/backend/node_modules/call-bound/.github/FUNDING.yml +12 -0
- package/backend/node_modules/call-bound/.nycrc +9 -0
- package/backend/node_modules/call-bound/CHANGELOG.md +42 -0
- package/backend/node_modules/call-bound/LICENSE +21 -0
- package/backend/node_modules/call-bound/README.md +53 -0
- package/backend/node_modules/call-bound/index.d.ts +94 -0
- package/backend/node_modules/call-bound/index.js +19 -0
- package/backend/node_modules/call-bound/package.json +99 -0
- package/backend/node_modules/call-bound/test/index.js +61 -0
- package/backend/node_modules/call-bound/tsconfig.json +10 -0
- package/backend/node_modules/content-disposition/HISTORY.md +60 -0
- package/backend/node_modules/content-disposition/LICENSE +22 -0
- package/backend/node_modules/content-disposition/README.md +142 -0
- package/backend/node_modules/content-disposition/index.js +458 -0
- package/backend/node_modules/content-disposition/package.json +44 -0
- package/backend/node_modules/content-type/HISTORY.md +29 -0
- package/backend/node_modules/content-type/LICENSE +22 -0
- package/backend/node_modules/content-type/README.md +94 -0
- package/backend/node_modules/content-type/index.js +225 -0
- package/backend/node_modules/content-type/package.json +42 -0
- package/backend/node_modules/cookie/LICENSE +24 -0
- package/backend/node_modules/cookie/README.md +317 -0
- package/backend/node_modules/cookie/SECURITY.md +25 -0
- package/backend/node_modules/cookie/index.js +335 -0
- package/backend/node_modules/cookie/package.json +44 -0
- package/backend/node_modules/cookie-signature/History.md +42 -0
- package/backend/node_modules/cookie-signature/Readme.md +42 -0
- package/backend/node_modules/cookie-signature/index.js +51 -0
- package/backend/node_modules/cookie-signature/package.json +18 -0
- package/backend/node_modules/cors/LICENSE +22 -0
- package/backend/node_modules/cors/README.md +277 -0
- package/backend/node_modules/cors/lib/index.js +238 -0
- package/backend/node_modules/cors/package.json +42 -0
- package/backend/node_modules/debug/.coveralls.yml +1 -0
- package/backend/node_modules/debug/.eslintrc +11 -0
- package/backend/node_modules/debug/.travis.yml +14 -0
- package/backend/node_modules/debug/CHANGELOG.md +362 -0
- package/backend/node_modules/debug/LICENSE +19 -0
- package/backend/node_modules/debug/Makefile +50 -0
- package/backend/node_modules/debug/README.md +312 -0
- package/backend/node_modules/debug/component.json +19 -0
- package/backend/node_modules/debug/karma.conf.js +70 -0
- package/backend/node_modules/debug/node.js +1 -0
- package/backend/node_modules/debug/package.json +49 -0
- package/backend/node_modules/debug/src/browser.js +185 -0
- package/backend/node_modules/debug/src/debug.js +202 -0
- package/backend/node_modules/debug/src/index.js +10 -0
- package/backend/node_modules/debug/src/inspector-log.js +15 -0
- package/backend/node_modules/debug/src/node.js +248 -0
- package/backend/node_modules/depd/History.md +103 -0
- package/backend/node_modules/depd/LICENSE +22 -0
- package/backend/node_modules/depd/Readme.md +280 -0
- package/backend/node_modules/depd/index.js +538 -0
- package/backend/node_modules/depd/lib/browser/index.js +77 -0
- package/backend/node_modules/depd/package.json +45 -0
- package/backend/node_modules/destroy/LICENSE +23 -0
- package/backend/node_modules/destroy/README.md +63 -0
- package/backend/node_modules/destroy/index.js +209 -0
- package/backend/node_modules/destroy/package.json +48 -0
- package/backend/node_modules/dunder-proto/.eslintrc +5 -0
- package/backend/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/backend/node_modules/dunder-proto/.nycrc +13 -0
- package/backend/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/backend/node_modules/dunder-proto/LICENSE +21 -0
- package/backend/node_modules/dunder-proto/README.md +54 -0
- package/backend/node_modules/dunder-proto/get.d.ts +5 -0
- package/backend/node_modules/dunder-proto/get.js +30 -0
- package/backend/node_modules/dunder-proto/package.json +76 -0
- package/backend/node_modules/dunder-proto/set.d.ts +5 -0
- package/backend/node_modules/dunder-proto/set.js +35 -0
- package/backend/node_modules/dunder-proto/test/get.js +34 -0
- package/backend/node_modules/dunder-proto/test/index.js +4 -0
- package/backend/node_modules/dunder-proto/test/set.js +50 -0
- package/backend/node_modules/dunder-proto/tsconfig.json +9 -0
- package/backend/node_modules/ee-first/LICENSE +22 -0
- package/backend/node_modules/ee-first/README.md +80 -0
- package/backend/node_modules/ee-first/index.js +95 -0
- package/backend/node_modules/ee-first/package.json +29 -0
- package/backend/node_modules/encodeurl/LICENSE +22 -0
- package/backend/node_modules/encodeurl/README.md +109 -0
- package/backend/node_modules/encodeurl/index.js +60 -0
- package/backend/node_modules/encodeurl/package.json +40 -0
- package/backend/node_modules/es-define-property/.eslintrc +13 -0
- package/backend/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/backend/node_modules/es-define-property/.nycrc +9 -0
- package/backend/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/backend/node_modules/es-define-property/LICENSE +21 -0
- package/backend/node_modules/es-define-property/README.md +49 -0
- package/backend/node_modules/es-define-property/index.d.ts +3 -0
- package/backend/node_modules/es-define-property/index.js +14 -0
- package/backend/node_modules/es-define-property/package.json +81 -0
- package/backend/node_modules/es-define-property/test/index.js +56 -0
- package/backend/node_modules/es-define-property/tsconfig.json +10 -0
- package/backend/node_modules/es-errors/.eslintrc +5 -0
- package/backend/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/backend/node_modules/es-errors/CHANGELOG.md +40 -0
- package/backend/node_modules/es-errors/LICENSE +21 -0
- package/backend/node_modules/es-errors/README.md +55 -0
- package/backend/node_modules/es-errors/eval.d.ts +3 -0
- package/backend/node_modules/es-errors/eval.js +4 -0
- package/backend/node_modules/es-errors/index.d.ts +3 -0
- package/backend/node_modules/es-errors/index.js +4 -0
- package/backend/node_modules/es-errors/package.json +80 -0
- package/backend/node_modules/es-errors/range.d.ts +3 -0
- package/backend/node_modules/es-errors/range.js +4 -0
- package/backend/node_modules/es-errors/ref.d.ts +3 -0
- package/backend/node_modules/es-errors/ref.js +4 -0
- package/backend/node_modules/es-errors/syntax.d.ts +3 -0
- package/backend/node_modules/es-errors/syntax.js +4 -0
- package/backend/node_modules/es-errors/test/index.js +19 -0
- package/backend/node_modules/es-errors/tsconfig.json +49 -0
- package/backend/node_modules/es-errors/type.d.ts +3 -0
- package/backend/node_modules/es-errors/type.js +4 -0
- package/backend/node_modules/es-errors/uri.d.ts +3 -0
- package/backend/node_modules/es-errors/uri.js +4 -0
- package/backend/node_modules/es-object-atoms/.eslintrc +16 -0
- package/backend/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/backend/node_modules/es-object-atoms/CHANGELOG.md +44 -0
- package/backend/node_modules/es-object-atoms/LICENSE +21 -0
- package/backend/node_modules/es-object-atoms/README.md +63 -0
- package/backend/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/backend/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/backend/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/backend/node_modules/es-object-atoms/ToObject.js +10 -0
- package/backend/node_modules/es-object-atoms/index.d.ts +3 -0
- package/backend/node_modules/es-object-atoms/index.js +4 -0
- package/backend/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/backend/node_modules/es-object-atoms/isObject.js +6 -0
- package/backend/node_modules/es-object-atoms/package.json +79 -0
- package/backend/node_modules/es-object-atoms/test/index.js +38 -0
- package/backend/node_modules/es-object-atoms/tsconfig.json +7 -0
- package/backend/node_modules/escape-html/LICENSE +24 -0
- package/backend/node_modules/escape-html/Readme.md +43 -0
- package/backend/node_modules/escape-html/index.js +78 -0
- package/backend/node_modules/escape-html/package.json +24 -0
- package/backend/node_modules/etag/HISTORY.md +83 -0
- package/backend/node_modules/etag/LICENSE +22 -0
- package/backend/node_modules/etag/README.md +159 -0
- package/backend/node_modules/etag/index.js +131 -0
- package/backend/node_modules/etag/package.json +47 -0
- package/backend/node_modules/express/History.md +3676 -0
- package/backend/node_modules/express/LICENSE +24 -0
- package/backend/node_modules/express/Readme.md +260 -0
- package/backend/node_modules/express/index.js +11 -0
- package/backend/node_modules/express/lib/application.js +661 -0
- package/backend/node_modules/express/lib/express.js +116 -0
- package/backend/node_modules/express/lib/middleware/init.js +43 -0
- package/backend/node_modules/express/lib/middleware/query.js +47 -0
- package/backend/node_modules/express/lib/request.js +525 -0
- package/backend/node_modules/express/lib/response.js +1179 -0
- package/backend/node_modules/express/lib/router/index.js +673 -0
- package/backend/node_modules/express/lib/router/layer.js +181 -0
- package/backend/node_modules/express/lib/router/route.js +230 -0
- package/backend/node_modules/express/lib/utils.js +304 -0
- package/backend/node_modules/express/lib/view.js +182 -0
- package/backend/node_modules/express/package.json +102 -0
- package/backend/node_modules/finalhandler/HISTORY.md +216 -0
- package/backend/node_modules/finalhandler/LICENSE +22 -0
- package/backend/node_modules/finalhandler/README.md +147 -0
- package/backend/node_modules/finalhandler/SECURITY.md +25 -0
- package/backend/node_modules/finalhandler/index.js +341 -0
- package/backend/node_modules/finalhandler/package.json +47 -0
- package/backend/node_modules/forwarded/HISTORY.md +21 -0
- package/backend/node_modules/forwarded/LICENSE +22 -0
- package/backend/node_modules/forwarded/README.md +57 -0
- package/backend/node_modules/forwarded/index.js +90 -0
- package/backend/node_modules/forwarded/package.json +45 -0
- package/backend/node_modules/fresh/HISTORY.md +70 -0
- package/backend/node_modules/fresh/LICENSE +23 -0
- package/backend/node_modules/fresh/README.md +119 -0
- package/backend/node_modules/fresh/index.js +137 -0
- package/backend/node_modules/fresh/package.json +46 -0
- package/backend/node_modules/function-bind/.eslintrc +21 -0
- package/backend/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/backend/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/backend/node_modules/function-bind/.nycrc +13 -0
- package/backend/node_modules/function-bind/CHANGELOG.md +136 -0
- package/backend/node_modules/function-bind/LICENSE +20 -0
- package/backend/node_modules/function-bind/README.md +46 -0
- package/backend/node_modules/function-bind/implementation.js +84 -0
- package/backend/node_modules/function-bind/index.js +5 -0
- package/backend/node_modules/function-bind/package.json +87 -0
- package/backend/node_modules/function-bind/test/.eslintrc +9 -0
- package/backend/node_modules/function-bind/test/index.js +252 -0
- package/backend/node_modules/get-intrinsic/.eslintrc +42 -0
- package/backend/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/backend/node_modules/get-intrinsic/.nycrc +9 -0
- package/backend/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/backend/node_modules/get-intrinsic/LICENSE +21 -0
- package/backend/node_modules/get-intrinsic/README.md +71 -0
- package/backend/node_modules/get-intrinsic/index.js +378 -0
- package/backend/node_modules/get-intrinsic/package.json +97 -0
- package/backend/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/backend/node_modules/get-proto/.eslintrc +10 -0
- package/backend/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/backend/node_modules/get-proto/.nycrc +9 -0
- package/backend/node_modules/get-proto/CHANGELOG.md +21 -0
- package/backend/node_modules/get-proto/LICENSE +21 -0
- package/backend/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/backend/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/backend/node_modules/get-proto/README.md +50 -0
- package/backend/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/backend/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/backend/node_modules/get-proto/index.d.ts +5 -0
- package/backend/node_modules/get-proto/index.js +27 -0
- package/backend/node_modules/get-proto/package.json +81 -0
- package/backend/node_modules/get-proto/test/index.js +68 -0
- package/backend/node_modules/get-proto/tsconfig.json +9 -0
- package/backend/node_modules/gopd/.eslintrc +16 -0
- package/backend/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/backend/node_modules/gopd/CHANGELOG.md +45 -0
- package/backend/node_modules/gopd/LICENSE +21 -0
- package/backend/node_modules/gopd/README.md +40 -0
- package/backend/node_modules/gopd/gOPD.d.ts +1 -0
- package/backend/node_modules/gopd/gOPD.js +4 -0
- package/backend/node_modules/gopd/index.d.ts +5 -0
- package/backend/node_modules/gopd/index.js +15 -0
- package/backend/node_modules/gopd/package.json +77 -0
- package/backend/node_modules/gopd/test/index.js +36 -0
- package/backend/node_modules/gopd/tsconfig.json +9 -0
- package/backend/node_modules/has-symbols/.eslintrc +11 -0
- package/backend/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/backend/node_modules/has-symbols/.nycrc +9 -0
- package/backend/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/backend/node_modules/has-symbols/LICENSE +21 -0
- package/backend/node_modules/has-symbols/README.md +46 -0
- package/backend/node_modules/has-symbols/index.d.ts +3 -0
- package/backend/node_modules/has-symbols/index.js +14 -0
- package/backend/node_modules/has-symbols/package.json +111 -0
- package/backend/node_modules/has-symbols/shams.d.ts +3 -0
- package/backend/node_modules/has-symbols/shams.js +45 -0
- package/backend/node_modules/has-symbols/test/index.js +22 -0
- package/backend/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/backend/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/backend/node_modules/has-symbols/test/tests.js +58 -0
- package/backend/node_modules/has-symbols/tsconfig.json +10 -0
- package/backend/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/backend/node_modules/hasown/.nycrc +13 -0
- package/backend/node_modules/hasown/CHANGELOG.md +58 -0
- package/backend/node_modules/hasown/LICENSE +21 -0
- package/backend/node_modules/hasown/README.md +40 -0
- package/backend/node_modules/hasown/eslint.config.mjs +6 -0
- package/backend/node_modules/hasown/index.d.ts +3 -0
- package/backend/node_modules/hasown/index.js +8 -0
- package/backend/node_modules/hasown/package.json +91 -0
- package/backend/node_modules/hasown/tsconfig.json +6 -0
- package/backend/node_modules/http-errors/HISTORY.md +186 -0
- package/backend/node_modules/http-errors/LICENSE +23 -0
- package/backend/node_modules/http-errors/README.md +169 -0
- package/backend/node_modules/http-errors/index.js +290 -0
- package/backend/node_modules/http-errors/package.json +54 -0
- package/backend/node_modules/iconv-lite/Changelog.md +162 -0
- package/backend/node_modules/iconv-lite/LICENSE +21 -0
- package/backend/node_modules/iconv-lite/README.md +156 -0
- package/backend/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- package/backend/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- package/backend/node_modules/iconv-lite/encodings/index.js +22 -0
- package/backend/node_modules/iconv-lite/encodings/internal.js +188 -0
- package/backend/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/backend/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/backend/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
- package/backend/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/backend/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/backend/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/backend/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/backend/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/backend/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/backend/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- package/backend/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/backend/node_modules/iconv-lite/encodings/utf16.js +177 -0
- package/backend/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/backend/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/backend/node_modules/iconv-lite/lib/extend-node.js +217 -0
- package/backend/node_modules/iconv-lite/lib/index.d.ts +24 -0
- package/backend/node_modules/iconv-lite/lib/index.js +153 -0
- package/backend/node_modules/iconv-lite/lib/streams.js +121 -0
- package/backend/node_modules/iconv-lite/package.json +46 -0
- package/backend/node_modules/inherits/LICENSE +16 -0
- package/backend/node_modules/inherits/README.md +42 -0
- package/backend/node_modules/inherits/inherits.js +9 -0
- package/backend/node_modules/inherits/inherits_browser.js +27 -0
- package/backend/node_modules/inherits/package.json +29 -0
- package/backend/node_modules/ipaddr.js/LICENSE +19 -0
- package/backend/node_modules/ipaddr.js/README.md +233 -0
- package/backend/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/backend/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
- package/backend/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
- package/backend/node_modules/ipaddr.js/package.json +35 -0
- package/backend/node_modules/math-intrinsics/.eslintrc +16 -0
- package/backend/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/backend/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/backend/node_modules/math-intrinsics/LICENSE +21 -0
- package/backend/node_modules/math-intrinsics/README.md +50 -0
- package/backend/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/backend/node_modules/math-intrinsics/abs.js +4 -0
- package/backend/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/backend/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/backend/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/backend/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/backend/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/backend/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/backend/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/backend/node_modules/math-intrinsics/floor.js +4 -0
- package/backend/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/backend/node_modules/math-intrinsics/isFinite.js +12 -0
- package/backend/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/backend/node_modules/math-intrinsics/isInteger.js +16 -0
- package/backend/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/backend/node_modules/math-intrinsics/isNaN.js +6 -0
- package/backend/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/backend/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/backend/node_modules/math-intrinsics/max.d.ts +1 -0
- package/backend/node_modules/math-intrinsics/max.js +4 -0
- package/backend/node_modules/math-intrinsics/min.d.ts +1 -0
- package/backend/node_modules/math-intrinsics/min.js +4 -0
- package/backend/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/backend/node_modules/math-intrinsics/mod.js +9 -0
- package/backend/node_modules/math-intrinsics/package.json +86 -0
- package/backend/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/backend/node_modules/math-intrinsics/pow.js +4 -0
- package/backend/node_modules/math-intrinsics/round.d.ts +1 -0
- package/backend/node_modules/math-intrinsics/round.js +4 -0
- package/backend/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/backend/node_modules/math-intrinsics/sign.js +11 -0
- package/backend/node_modules/math-intrinsics/test/index.js +192 -0
- package/backend/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/backend/node_modules/media-typer/HISTORY.md +22 -0
- package/backend/node_modules/media-typer/LICENSE +22 -0
- package/backend/node_modules/media-typer/README.md +81 -0
- package/backend/node_modules/media-typer/index.js +270 -0
- package/backend/node_modules/media-typer/package.json +26 -0
- package/backend/node_modules/merge-descriptors/HISTORY.md +21 -0
- package/backend/node_modules/merge-descriptors/LICENSE +23 -0
- package/backend/node_modules/merge-descriptors/README.md +49 -0
- package/backend/node_modules/merge-descriptors/index.js +60 -0
- package/backend/node_modules/merge-descriptors/package.json +39 -0
- package/backend/node_modules/methods/HISTORY.md +29 -0
- package/backend/node_modules/methods/LICENSE +24 -0
- package/backend/node_modules/methods/README.md +51 -0
- package/backend/node_modules/methods/index.js +69 -0
- package/backend/node_modules/methods/package.json +36 -0
- package/backend/node_modules/mime/CHANGELOG.md +164 -0
- package/backend/node_modules/mime/LICENSE +21 -0
- package/backend/node_modules/mime/README.md +90 -0
- package/backend/node_modules/mime/cli.js +8 -0
- package/backend/node_modules/mime/mime.js +108 -0
- package/backend/node_modules/mime/package.json +44 -0
- package/backend/node_modules/mime/src/build.js +53 -0
- package/backend/node_modules/mime/src/test.js +60 -0
- package/backend/node_modules/mime/types.json +1 -0
- package/backend/node_modules/mime-db/HISTORY.md +507 -0
- package/backend/node_modules/mime-db/LICENSE +23 -0
- package/backend/node_modules/mime-db/README.md +100 -0
- package/backend/node_modules/mime-db/db.json +8519 -0
- package/backend/node_modules/mime-db/index.js +12 -0
- package/backend/node_modules/mime-db/package.json +60 -0
- package/backend/node_modules/mime-types/HISTORY.md +397 -0
- package/backend/node_modules/mime-types/LICENSE +23 -0
- package/backend/node_modules/mime-types/README.md +113 -0
- package/backend/node_modules/mime-types/index.js +188 -0
- package/backend/node_modules/mime-types/package.json +44 -0
- package/backend/node_modules/ms/index.js +152 -0
- package/backend/node_modules/ms/license.md +21 -0
- package/backend/node_modules/ms/package.json +37 -0
- package/backend/node_modules/ms/readme.md +51 -0
- package/backend/node_modules/negotiator/HISTORY.md +108 -0
- package/backend/node_modules/negotiator/LICENSE +24 -0
- package/backend/node_modules/negotiator/README.md +203 -0
- package/backend/node_modules/negotiator/index.js +82 -0
- package/backend/node_modules/negotiator/lib/charset.js +169 -0
- package/backend/node_modules/negotiator/lib/encoding.js +184 -0
- package/backend/node_modules/negotiator/lib/language.js +179 -0
- package/backend/node_modules/negotiator/lib/mediaType.js +294 -0
- package/backend/node_modules/negotiator/package.json +42 -0
- package/backend/node_modules/object-assign/index.js +90 -0
- package/backend/node_modules/object-assign/license +21 -0
- package/backend/node_modules/object-assign/package.json +42 -0
- package/backend/node_modules/object-assign/readme.md +61 -0
- package/backend/node_modules/object-inspect/.eslintrc +53 -0
- package/backend/node_modules/object-inspect/.github/FUNDING.yml +12 -0
- package/backend/node_modules/object-inspect/.nycrc +13 -0
- package/backend/node_modules/object-inspect/CHANGELOG.md +424 -0
- package/backend/node_modules/object-inspect/LICENSE +21 -0
- package/backend/node_modules/object-inspect/example/all.js +23 -0
- package/backend/node_modules/object-inspect/example/circular.js +6 -0
- package/backend/node_modules/object-inspect/example/fn.js +5 -0
- package/backend/node_modules/object-inspect/example/inspect.js +10 -0
- package/backend/node_modules/object-inspect/index.js +544 -0
- package/backend/node_modules/object-inspect/package-support.json +20 -0
- package/backend/node_modules/object-inspect/package.json +105 -0
- package/backend/node_modules/object-inspect/readme.markdown +84 -0
- package/backend/node_modules/object-inspect/test/bigint.js +58 -0
- package/backend/node_modules/object-inspect/test/browser/dom.js +15 -0
- package/backend/node_modules/object-inspect/test/circular.js +16 -0
- package/backend/node_modules/object-inspect/test/deep.js +12 -0
- package/backend/node_modules/object-inspect/test/element.js +53 -0
- package/backend/node_modules/object-inspect/test/err.js +48 -0
- package/backend/node_modules/object-inspect/test/fakes.js +29 -0
- package/backend/node_modules/object-inspect/test/fn.js +76 -0
- package/backend/node_modules/object-inspect/test/global.js +17 -0
- package/backend/node_modules/object-inspect/test/has.js +15 -0
- package/backend/node_modules/object-inspect/test/holes.js +15 -0
- package/backend/node_modules/object-inspect/test/indent-option.js +271 -0
- package/backend/node_modules/object-inspect/test/inspect.js +139 -0
- package/backend/node_modules/object-inspect/test/lowbyte.js +12 -0
- package/backend/node_modules/object-inspect/test/number.js +58 -0
- package/backend/node_modules/object-inspect/test/quoteStyle.js +26 -0
- package/backend/node_modules/object-inspect/test/toStringTag.js +40 -0
- package/backend/node_modules/object-inspect/test/undef.js +12 -0
- package/backend/node_modules/object-inspect/test/values.js +261 -0
- package/backend/node_modules/object-inspect/test-core-js.js +26 -0
- package/backend/node_modules/object-inspect/util.inspect.js +1 -0
- package/backend/node_modules/on-finished/HISTORY.md +98 -0
- package/backend/node_modules/on-finished/LICENSE +23 -0
- package/backend/node_modules/on-finished/README.md +162 -0
- package/backend/node_modules/on-finished/index.js +234 -0
- package/backend/node_modules/on-finished/package.json +39 -0
- package/backend/node_modules/parseurl/HISTORY.md +58 -0
- package/backend/node_modules/parseurl/LICENSE +24 -0
- package/backend/node_modules/parseurl/README.md +133 -0
- package/backend/node_modules/parseurl/index.js +158 -0
- package/backend/node_modules/parseurl/package.json +40 -0
- package/backend/node_modules/path-to-regexp/LICENSE +21 -0
- package/backend/node_modules/path-to-regexp/Readme.md +35 -0
- package/backend/node_modules/path-to-regexp/index.js +158 -0
- package/backend/node_modules/path-to-regexp/package.json +30 -0
- package/backend/node_modules/proxy-addr/HISTORY.md +161 -0
- package/backend/node_modules/proxy-addr/LICENSE +22 -0
- package/backend/node_modules/proxy-addr/README.md +139 -0
- package/backend/node_modules/proxy-addr/index.js +327 -0
- package/backend/node_modules/proxy-addr/package.json +47 -0
- package/backend/node_modules/qs/.editorconfig +46 -0
- package/backend/node_modules/qs/.github/FUNDING.yml +12 -0
- package/backend/node_modules/qs/.github/SECURITY.md +11 -0
- package/backend/node_modules/qs/.github/THREAT_MODEL.md +78 -0
- package/backend/node_modules/qs/.nycrc +13 -0
- package/backend/node_modules/qs/CHANGELOG.md +822 -0
- package/backend/node_modules/qs/LICENSE.md +29 -0
- package/backend/node_modules/qs/README.md +758 -0
- package/backend/node_modules/qs/dist/qs.js +141 -0
- package/backend/node_modules/qs/eslint.config.mjs +57 -0
- package/backend/node_modules/qs/lib/formats.js +23 -0
- package/backend/node_modules/qs/lib/index.js +11 -0
- package/backend/node_modules/qs/lib/parse.js +403 -0
- package/backend/node_modules/qs/lib/stringify.js +363 -0
- package/backend/node_modules/qs/lib/utils.js +342 -0
- package/backend/node_modules/qs/package.json +94 -0
- package/backend/node_modules/qs/test/empty-keys-cases.js +267 -0
- package/backend/node_modules/qs/test/parse.js +1703 -0
- package/backend/node_modules/qs/test/stringify.js +1448 -0
- package/backend/node_modules/qs/test/utils.js +432 -0
- package/backend/node_modules/range-parser/HISTORY.md +56 -0
- package/backend/node_modules/range-parser/LICENSE +23 -0
- package/backend/node_modules/range-parser/README.md +84 -0
- package/backend/node_modules/range-parser/index.js +162 -0
- package/backend/node_modules/range-parser/package.json +44 -0
- package/backend/node_modules/raw-body/LICENSE +22 -0
- package/backend/node_modules/raw-body/README.md +223 -0
- package/backend/node_modules/raw-body/index.d.ts +87 -0
- package/backend/node_modules/raw-body/index.js +336 -0
- package/backend/node_modules/raw-body/package.json +47 -0
- package/backend/node_modules/safe-buffer/LICENSE +21 -0
- package/backend/node_modules/safe-buffer/README.md +584 -0
- package/backend/node_modules/safe-buffer/index.d.ts +187 -0
- package/backend/node_modules/safe-buffer/index.js +65 -0
- package/backend/node_modules/safe-buffer/package.json +51 -0
- package/backend/node_modules/safer-buffer/LICENSE +21 -0
- package/backend/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/backend/node_modules/safer-buffer/Readme.md +156 -0
- package/backend/node_modules/safer-buffer/dangerous.js +58 -0
- package/backend/node_modules/safer-buffer/package.json +34 -0
- package/backend/node_modules/safer-buffer/safer.js +77 -0
- package/backend/node_modules/safer-buffer/tests.js +406 -0
- package/backend/node_modules/send/HISTORY.md +538 -0
- package/backend/node_modules/send/LICENSE +23 -0
- package/backend/node_modules/send/README.md +327 -0
- package/backend/node_modules/send/SECURITY.md +24 -0
- package/backend/node_modules/send/index.js +1142 -0
- package/backend/node_modules/send/node_modules/ms/index.js +162 -0
- package/backend/node_modules/send/node_modules/ms/license.md +21 -0
- package/backend/node_modules/send/node_modules/ms/package.json +38 -0
- package/backend/node_modules/send/node_modules/ms/readme.md +59 -0
- package/backend/node_modules/send/package.json +62 -0
- package/backend/node_modules/serve-static/HISTORY.md +493 -0
- package/backend/node_modules/serve-static/LICENSE +25 -0
- package/backend/node_modules/serve-static/README.md +257 -0
- package/backend/node_modules/serve-static/index.js +209 -0
- package/backend/node_modules/serve-static/package.json +42 -0
- package/backend/node_modules/setprototypeof/LICENSE +13 -0
- package/backend/node_modules/setprototypeof/README.md +31 -0
- package/backend/node_modules/setprototypeof/index.d.ts +2 -0
- package/backend/node_modules/setprototypeof/index.js +17 -0
- package/backend/node_modules/setprototypeof/package.json +38 -0
- package/backend/node_modules/setprototypeof/test/index.js +24 -0
- package/backend/node_modules/side-channel/.editorconfig +9 -0
- package/backend/node_modules/side-channel/.eslintrc +12 -0
- package/backend/node_modules/side-channel/.github/FUNDING.yml +12 -0
- package/backend/node_modules/side-channel/.nycrc +13 -0
- package/backend/node_modules/side-channel/CHANGELOG.md +120 -0
- package/backend/node_modules/side-channel/LICENSE +21 -0
- package/backend/node_modules/side-channel/README.md +61 -0
- package/backend/node_modules/side-channel/index.d.ts +14 -0
- package/backend/node_modules/side-channel/index.js +46 -0
- package/backend/node_modules/side-channel/package.json +85 -0
- package/backend/node_modules/side-channel/test/index.js +120 -0
- package/backend/node_modules/side-channel/tsconfig.json +9 -0
- package/backend/node_modules/side-channel-list/.editorconfig +9 -0
- package/backend/node_modules/side-channel-list/.eslintrc +11 -0
- package/backend/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
- package/backend/node_modules/side-channel-list/.nycrc +13 -0
- package/backend/node_modules/side-channel-list/CHANGELOG.md +36 -0
- package/backend/node_modules/side-channel-list/LICENSE +21 -0
- package/backend/node_modules/side-channel-list/README.md +62 -0
- package/backend/node_modules/side-channel-list/index.d.ts +13 -0
- package/backend/node_modules/side-channel-list/index.js +111 -0
- package/backend/node_modules/side-channel-list/list.d.ts +14 -0
- package/backend/node_modules/side-channel-list/package.json +77 -0
- package/backend/node_modules/side-channel-list/test/index.js +154 -0
- package/backend/node_modules/side-channel-list/tsconfig.json +9 -0
- package/backend/node_modules/side-channel-map/.editorconfig +9 -0
- package/backend/node_modules/side-channel-map/.eslintrc +11 -0
- package/backend/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
- package/backend/node_modules/side-channel-map/.nycrc +13 -0
- package/backend/node_modules/side-channel-map/CHANGELOG.md +22 -0
- package/backend/node_modules/side-channel-map/LICENSE +21 -0
- package/backend/node_modules/side-channel-map/README.md +62 -0
- package/backend/node_modules/side-channel-map/index.d.ts +15 -0
- package/backend/node_modules/side-channel-map/index.js +68 -0
- package/backend/node_modules/side-channel-map/package.json +80 -0
- package/backend/node_modules/side-channel-map/test/index.js +114 -0
- package/backend/node_modules/side-channel-map/tsconfig.json +9 -0
- package/backend/node_modules/side-channel-weakmap/.editorconfig +9 -0
- package/backend/node_modules/side-channel-weakmap/.eslintrc +12 -0
- package/backend/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
- package/backend/node_modules/side-channel-weakmap/.nycrc +13 -0
- package/backend/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
- package/backend/node_modules/side-channel-weakmap/LICENSE +21 -0
- package/backend/node_modules/side-channel-weakmap/README.md +62 -0
- package/backend/node_modules/side-channel-weakmap/index.d.ts +15 -0
- package/backend/node_modules/side-channel-weakmap/index.js +84 -0
- package/backend/node_modules/side-channel-weakmap/package.json +87 -0
- package/backend/node_modules/side-channel-weakmap/test/index.js +114 -0
- package/backend/node_modules/side-channel-weakmap/tsconfig.json +9 -0
- package/backend/node_modules/statuses/HISTORY.md +87 -0
- package/backend/node_modules/statuses/LICENSE +23 -0
- package/backend/node_modules/statuses/README.md +139 -0
- package/backend/node_modules/statuses/codes.json +65 -0
- package/backend/node_modules/statuses/index.js +146 -0
- package/backend/node_modules/statuses/package.json +49 -0
- package/backend/node_modules/toidentifier/HISTORY.md +9 -0
- package/backend/node_modules/toidentifier/LICENSE +21 -0
- package/backend/node_modules/toidentifier/README.md +61 -0
- package/backend/node_modules/toidentifier/index.js +32 -0
- package/backend/node_modules/toidentifier/package.json +38 -0
- package/backend/node_modules/type-is/HISTORY.md +259 -0
- package/backend/node_modules/type-is/LICENSE +23 -0
- package/backend/node_modules/type-is/README.md +170 -0
- package/backend/node_modules/type-is/index.js +266 -0
- package/backend/node_modules/type-is/package.json +45 -0
- package/backend/node_modules/unpipe/HISTORY.md +4 -0
- package/backend/node_modules/unpipe/LICENSE +22 -0
- package/backend/node_modules/unpipe/README.md +43 -0
- package/backend/node_modules/unpipe/index.js +69 -0
- package/backend/node_modules/unpipe/package.json +27 -0
- package/backend/node_modules/utils-merge/LICENSE +20 -0
- package/backend/node_modules/utils-merge/README.md +34 -0
- package/backend/node_modules/utils-merge/index.js +23 -0
- package/backend/node_modules/utils-merge/package.json +40 -0
- package/backend/node_modules/vary/HISTORY.md +39 -0
- package/backend/node_modules/vary/LICENSE +22 -0
- package/backend/node_modules/vary/README.md +101 -0
- package/backend/node_modules/vary/index.js +149 -0
- package/backend/node_modules/vary/package.json +43 -0
- package/backend/package-lock.json +854 -0
- package/backend/package.json +14 -0
- package/backend/parsers/antigravity.js +206 -0
- package/backend/parsers/claude.js +92 -0
- package/backend/parsers/codex.js +86 -0
- package/backend/parsers/copilot.js +379 -0
- package/backend/parsers/copilotEditingSessions.js +118 -0
- package/backend/parsers/cursor.js +215 -0
- package/backend/relay.js +835 -0
- package/backend/scripts/relay-context.js +9 -0
- package/backend/server.js +314 -0
- package/bin/relay.js +312 -0
- package/docs/QUICKSTART.md +94 -0
- package/mission-control/AGENTS.md +5 -0
- package/mission-control/CLAUDE.md +1 -0
- package/mission-control/README.md +20 -0
- package/mission-control/eslint.config.mjs +18 -0
- package/mission-control/next.config.ts +7 -0
- package/mission-control/package-lock.json +6695 -0
- package/mission-control/package.json +26 -0
- package/mission-control/page.css +1793 -0
- package/mission-control/page.html +1 -0
- package/mission-control/postcss.config.mjs +7 -0
- package/mission-control/public/file.svg +1 -0
- package/mission-control/public/globe.svg +1 -0
- package/mission-control/public/logos/1f733bb7-c1b3-4292-a7f7-71aafa2addaa.jpeg +0 -0
- package/mission-control/public/logos/Claude.png +0 -0
- package/mission-control/public/logos/Codex.png +0 -0
- package/mission-control/public/logos/Gemini_Generated_Image_7qmndr7qmndr7qmn.png +0 -0
- package/mission-control/public/logos/antigravity.png +0 -0
- package/mission-control/public/logos/cursor.png +0 -0
- package/mission-control/public/logos/github-copilot.png +0 -0
- package/mission-control/public/logos/logo.avif +0 -0
- package/mission-control/public/logos/logo.jpg +0 -0
- package/mission-control/public/logos/logo.png +0 -0
- package/mission-control/public/next.svg +1 -0
- package/mission-control/public/vercel.svg +1 -0
- package/mission-control/public/window.svg +1 -0
- package/mission-control/src/app/api/fs/route.ts +49 -0
- package/mission-control/src/app/globals.css +102 -0
- package/mission-control/src/app/layout.tsx +31 -0
- package/mission-control/src/app/onboarding/page.module.css +133 -0
- package/mission-control/src/app/onboarding/page.tsx +98 -0
- package/mission-control/src/app/page.module.css +51 -0
- package/mission-control/src/app/page.tsx +40 -0
- package/mission-control/src/components/ActivityTimeline.module.css +282 -0
- package/mission-control/src/components/ActivityTimeline.tsx +262 -0
- package/mission-control/src/components/AgentSessionChat.module.css +220 -0
- package/mission-control/src/components/AgentSessionChat.tsx +276 -0
- package/mission-control/src/components/CollaboratorsPanel.module.css +119 -0
- package/mission-control/src/components/CollaboratorsPanel.tsx +123 -0
- package/mission-control/src/components/ContextMemory.module.css +79 -0
- package/mission-control/src/components/ContextMemory.tsx +66 -0
- package/mission-control/src/components/DirectoryPicker.tsx +194 -0
- package/mission-control/src/components/GlobalHeader.module.css +165 -0
- package/mission-control/src/components/GlobalHeader.tsx +82 -0
- package/mission-control/src/components/ProjectDashboard.module.css +268 -0
- package/mission-control/src/components/ProjectDashboard.tsx +174 -0
- package/mission-control/src/components/RelayBrainPanel.module.css +85 -0
- package/mission-control/src/components/RelayBrainPanel.tsx +74 -0
- package/mission-control/src/components/Sidebar.module.css +201 -0
- package/mission-control/src/components/Sidebar.tsx +136 -0
- package/mission-control/src/components/TaskQueue.module.css +92 -0
- package/mission-control/src/components/TaskQueue.tsx +51 -0
- package/mission-control/src/components/WorkspaceRail.module.css +188 -0
- package/mission-control/src/components/WorkspaceRail.tsx +56 -0
- package/mission-control/src/lib/RelayContext.tsx +314 -0
- package/mission-control/src/lib/relay.ts +280 -0
- package/mission-control/src/lib/workspaces.ts +53 -0
- package/mission-control/tsconfig.json +34 -0
- package/package.json +48 -0
- package/scripts/postinstall.js +19 -0
- package/skills/relay-sync/SKILL.md +32 -0
- package/skills/relay-sync/agent-install.md +17 -0
package/backend/relay.js
ADDED
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const { spawnSync } = require('child_process');
|
|
5
|
+
const { parseAntigravity, getBrainDir } = require('./parsers/antigravity');
|
|
6
|
+
const { parseCodex } = require('./parsers/codex');
|
|
7
|
+
const { parseClaude } = require('./parsers/claude');
|
|
8
|
+
const { parseCopilot } = require('./parsers/copilot');
|
|
9
|
+
const { parseCursor, discoverCursorTranscriptDir } = require('./parsers/cursor');
|
|
10
|
+
const { discoverWorkspaceStorageDir } = require('./lib/vscodeWorkspace');
|
|
11
|
+
const { readVscdbJson } = require('./lib/vscdb');
|
|
12
|
+
const { buildGlobalTimeline } = require('./lib/timeline');
|
|
13
|
+
const { scaffoldIrFiles, writeRelayContext, writeCompileBrief } = require('./lib/relayContext');
|
|
14
|
+
const { compileIrSync } = require('./lib/relayCompileIr');
|
|
15
|
+
const { installRelayWorkspace, isRelayInstalled, writeAgentBootstrap } = require('./lib/relayInstall');
|
|
16
|
+
|
|
17
|
+
const HOME = os.homedir();
|
|
18
|
+
|
|
19
|
+
const AGENT_ROOTS = {
|
|
20
|
+
Antigravity: path.join(HOME, '.gemini', 'antigravity-ide', 'brain'),
|
|
21
|
+
Codex: path.join(HOME, '.codex', 'sessions'),
|
|
22
|
+
'Claude Code': path.join(HOME, '.claude', 'projects'),
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const COPILOT_DISCOVERY_ROOTS = [
|
|
26
|
+
path.join(HOME, '.copilot', 'session-state'),
|
|
27
|
+
path.join(HOME, 'AppData', 'Roaming', 'Code', 'User', 'workspaceStorage'),
|
|
28
|
+
path.join(HOME, 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', 'github.copilot-chat'),
|
|
29
|
+
path.join(HOME, '.config', 'Code', 'User', 'workspaceStorage'),
|
|
30
|
+
path.join(HOME, '.config', 'Code', 'User', 'globalStorage', 'github.copilot-chat'),
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const ANTIGRAVITY_WS_ROOTS = [
|
|
34
|
+
path.join(HOME, 'AppData', 'Roaming', 'Antigravity IDE', 'User', 'workspaceStorage'),
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
function getRelayDir(workspacePath) {
|
|
38
|
+
return path.join(workspacePath, '.relay');
|
|
39
|
+
}
|
|
40
|
+
function getConfigPath(workspacePath) {
|
|
41
|
+
return path.join(getRelayDir(workspacePath), 'config.json');
|
|
42
|
+
}
|
|
43
|
+
function getMemoryPath(workspacePath) {
|
|
44
|
+
return path.join(getRelayDir(workspacePath), 'memory.json');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function safeReadJson(filePath, fallback) {
|
|
48
|
+
try {
|
|
49
|
+
const raw = fs.readFileSync(filePath, 'utf-8').trim();
|
|
50
|
+
if (!raw) return fallback;
|
|
51
|
+
return JSON.parse(raw);
|
|
52
|
+
} catch (_) {
|
|
53
|
+
return fallback;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function registerWorkspace(workspacePath) {
|
|
58
|
+
const relayDir = getRelayDir(workspacePath);
|
|
59
|
+
if (!fs.existsSync(relayDir)) fs.mkdirSync(relayDir, { recursive: true });
|
|
60
|
+
|
|
61
|
+
const configPath = getConfigPath(workspacePath);
|
|
62
|
+
if (!fs.existsSync(configPath)) {
|
|
63
|
+
fs.writeFileSync(configPath, JSON.stringify({
|
|
64
|
+
workspace: workspacePath,
|
|
65
|
+
registeredAt: new Date().toISOString(),
|
|
66
|
+
autoUpdate: true,
|
|
67
|
+
autoAgentUpdate: true,
|
|
68
|
+
agents: {},
|
|
69
|
+
}, null, 2));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const memoryPath = getMemoryPath(workspacePath);
|
|
73
|
+
if (!fs.existsSync(memoryPath)) {
|
|
74
|
+
fs.writeFileSync(memoryPath, JSON.stringify({
|
|
75
|
+
workspace: workspacePath,
|
|
76
|
+
lastSync: null,
|
|
77
|
+
agents: {},
|
|
78
|
+
timeline: [],
|
|
79
|
+
}, null, 2));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
installRelayWorkspace(workspacePath, { packageRoot: path.join(__dirname, '..') });
|
|
83
|
+
require('./lib/relayMeta').scaffoldMissionMeta(workspacePath);
|
|
84
|
+
autoConnectAgents(workspacePath);
|
|
85
|
+
|
|
86
|
+
return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function detectCodexCli() {
|
|
90
|
+
try {
|
|
91
|
+
const result = spawnSync('codex', ['--version'], { shell: true, timeout: 3000, encoding: 'utf-8' });
|
|
92
|
+
if (result.status === 0) return 'codex';
|
|
93
|
+
} catch (_) { }
|
|
94
|
+
|
|
95
|
+
const npmGlobalBins = [
|
|
96
|
+
path.join(HOME, 'AppData', 'Roaming', 'npm', 'codex.cmd'),
|
|
97
|
+
path.join(HOME, 'AppData', 'Roaming', 'npm', 'codex'),
|
|
98
|
+
'/usr/local/bin/codex',
|
|
99
|
+
'/usr/bin/codex',
|
|
100
|
+
];
|
|
101
|
+
for (const p of npmGlobalBins) {
|
|
102
|
+
if (fs.existsSync(p)) return p;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
const r = spawnSync('npx', ['codex', '--version'], { shell: true, timeout: 5000, encoding: 'utf-8' });
|
|
107
|
+
if (r.status === 0) return 'npx codex';
|
|
108
|
+
} catch (_) { }
|
|
109
|
+
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function detectClaudeCli() {
|
|
114
|
+
try {
|
|
115
|
+
const result = spawnSync('claude', ['--version'], { shell: true, timeout: 3000, encoding: 'utf-8' });
|
|
116
|
+
if (result.status === 0) return true;
|
|
117
|
+
} catch (_) { }
|
|
118
|
+
|
|
119
|
+
const npmGlobalBins = [
|
|
120
|
+
path.join(HOME, 'AppData', 'Roaming', 'npm', 'claude.cmd'),
|
|
121
|
+
path.join(HOME, 'AppData', 'Roaming', 'npm', 'claude'),
|
|
122
|
+
'/usr/local/bin/claude',
|
|
123
|
+
'/usr/bin/claude',
|
|
124
|
+
];
|
|
125
|
+
for (const p of npmGlobalBins) {
|
|
126
|
+
if (fs.existsSync(p)) return true;
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function sendHandshake(workspacePath, agent) {
|
|
132
|
+
const safeAgent = agent.toUpperCase().replace(/ /g, '_');
|
|
133
|
+
const token = `RELAY_INIT_HANDSHAKE_${safeAgent}_${Math.random().toString(36).substring(2, 8).toUpperCase()}`;
|
|
134
|
+
|
|
135
|
+
const configPath = getConfigPath(workspacePath);
|
|
136
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
137
|
+
if (!config.agents[agent]) config.agents[agent] = {};
|
|
138
|
+
config.agents[agent].pendingToken = token;
|
|
139
|
+
config.agents[agent].status = 'handshaking';
|
|
140
|
+
|
|
141
|
+
let mode = 'unknown';
|
|
142
|
+
|
|
143
|
+
if (agent === 'Antigravity') {
|
|
144
|
+
fs.writeFileSync(path.join(getRelayDir(workspacePath), '.handshake_antigravity'), token);
|
|
145
|
+
mode = 'beacon-file';
|
|
146
|
+
console.log(`[Antigravity] Beacon written. Token: ${token}`);
|
|
147
|
+
} else if (agent === 'Codex') {
|
|
148
|
+
const codexBin = detectCodexCli();
|
|
149
|
+
if (codexBin) {
|
|
150
|
+
console.log(`[Codex] CLI found at: ${codexBin}. Sending token via CLI...`);
|
|
151
|
+
const cmd = codexBin.startsWith('npx') ? 'npx' : codexBin;
|
|
152
|
+
const args = codexBin.startsWith('npx') ? ['codex', '-q', token] : ['-q', token];
|
|
153
|
+
const result = spawnSync(cmd, args, {
|
|
154
|
+
cwd: workspacePath,
|
|
155
|
+
timeout: 20000,
|
|
156
|
+
encoding: 'utf-8',
|
|
157
|
+
shell: true,
|
|
158
|
+
});
|
|
159
|
+
mode = 'cli';
|
|
160
|
+
console.log(`[Codex CLI] stdout: ${result.stdout}`);
|
|
161
|
+
console.log(`[Codex CLI] stderr: ${result.stderr}`);
|
|
162
|
+
if (result.error) console.error(`[Codex CLI] spawn error: ${result.error.message}`);
|
|
163
|
+
} else {
|
|
164
|
+
fs.writeFileSync(path.join(getRelayDir(workspacePath), '.handshake_codex'), token);
|
|
165
|
+
mode = 'extension-cwd-match';
|
|
166
|
+
console.log(`[Codex] No CLI found. Using extension mode (cwd match). Token: ${token}`);
|
|
167
|
+
}
|
|
168
|
+
config.agents[agent].codexMode = mode;
|
|
169
|
+
} else if (agent === 'Claude Code') {
|
|
170
|
+
const hasClaudeCli = detectClaudeCli();
|
|
171
|
+
if (hasClaudeCli) {
|
|
172
|
+
console.log(`[Claude Code] CLI found. Sending token via CLI...`);
|
|
173
|
+
const result = spawnSync('claude', ['--print', token], {
|
|
174
|
+
cwd: workspacePath,
|
|
175
|
+
timeout: 20000,
|
|
176
|
+
encoding: 'utf-8',
|
|
177
|
+
shell: true,
|
|
178
|
+
});
|
|
179
|
+
mode = 'cli';
|
|
180
|
+
console.log(`[Claude Code CLI] stdout: ${result.stdout}`);
|
|
181
|
+
if (result.error) console.error(`[Claude Code CLI] spawn error: ${result.error.message}`);
|
|
182
|
+
} else {
|
|
183
|
+
fs.writeFileSync(path.join(getRelayDir(workspacePath), '.handshake_claude'), token);
|
|
184
|
+
mode = 'extension-cwd-match';
|
|
185
|
+
console.log(`[Claude Code] No CLI found. Using extension mode (cwd match). Token: ${token}`);
|
|
186
|
+
}
|
|
187
|
+
config.agents[agent].claudeMode = mode;
|
|
188
|
+
} else if (agent === 'GitHub Copilot') {
|
|
189
|
+
fs.writeFileSync(path.join(getRelayDir(workspacePath), '.handshake_copilot'), token);
|
|
190
|
+
mode = 'workspace-cwd-match';
|
|
191
|
+
console.log(`[GitHub Copilot] Beacon written. Token: ${token}`);
|
|
192
|
+
config.agents[agent].copilotMode = mode;
|
|
193
|
+
} else if (agent === 'Cursor') {
|
|
194
|
+
fs.writeFileSync(path.join(getRelayDir(workspacePath), '.handshake_cursor'), token);
|
|
195
|
+
mode = 'agent-transcripts';
|
|
196
|
+
console.log(`[Cursor] Beacon written. Token: ${token}`);
|
|
197
|
+
config.agents[agent].cursorMode = mode;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
201
|
+
return token;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function findJsonlFiles(dir, results = []) {
|
|
205
|
+
if (!fs.existsSync(dir)) return results;
|
|
206
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
207
|
+
const full = path.join(dir, entry.name);
|
|
208
|
+
if (entry.isDirectory()) findJsonlFiles(full, results);
|
|
209
|
+
else if (entry.name.endsWith('.jsonl')) results.push(full);
|
|
210
|
+
}
|
|
211
|
+
return results;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function findJsonlFilesInRoots(roots) {
|
|
215
|
+
const seen = new Set();
|
|
216
|
+
const results = [];
|
|
217
|
+
for (const root of roots) {
|
|
218
|
+
for (const file of findJsonlFiles(root)) {
|
|
219
|
+
const normalized = path.resolve(file);
|
|
220
|
+
if (seen.has(normalized)) continue;
|
|
221
|
+
seen.add(normalized);
|
|
222
|
+
results.push(normalized);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return results;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function mostRecentFile(files) {
|
|
229
|
+
if (!files.length) return null;
|
|
230
|
+
return [...files].sort((a, b) => {
|
|
231
|
+
try { return fs.statSync(b).mtimeMs - fs.statSync(a).mtimeMs; } catch { return 0; }
|
|
232
|
+
})[0];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function discoverByToken(agent, token) {
|
|
236
|
+
const root = AGENT_ROOTS[agent];
|
|
237
|
+
if (!root || !fs.existsSync(root)) return null;
|
|
238
|
+
for (const file of findJsonlFiles(root)) {
|
|
239
|
+
try {
|
|
240
|
+
if (fs.readFileSync(file, 'utf-8').includes(token)) return file;
|
|
241
|
+
} catch (_) { }
|
|
242
|
+
}
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function discoverCodexByWorkspaceCwd(workspacePath) {
|
|
247
|
+
const root = AGENT_ROOTS['Codex'];
|
|
248
|
+
if (!fs.existsSync(root)) return null;
|
|
249
|
+
|
|
250
|
+
const normalize = (p) => p.toLowerCase().replace(/\\/g, '/').replace(/\/$/, '');
|
|
251
|
+
const targetCwd = normalize(workspacePath);
|
|
252
|
+
const files = findJsonlFiles(root);
|
|
253
|
+
const matched = [];
|
|
254
|
+
|
|
255
|
+
for (const file of files) {
|
|
256
|
+
try {
|
|
257
|
+
const firstLine = fs.readFileSync(file, 'utf-8').split('\n')[0];
|
|
258
|
+
const meta = JSON.parse(firstLine);
|
|
259
|
+
if (meta.type === 'session_meta' && meta.payload?.cwd) {
|
|
260
|
+
if (normalize(meta.payload.cwd) === targetCwd) matched.push(file);
|
|
261
|
+
}
|
|
262
|
+
} catch (_) { }
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (matched.length > 0) {
|
|
266
|
+
const best = mostRecentFile(matched);
|
|
267
|
+
console.log(`[Codex] Found ${matched.length} session(s) matching workspace cwd. Using: ${best}`);
|
|
268
|
+
return best;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
console.warn('[Codex] No cwd match found. Falling back to most recent session file.');
|
|
272
|
+
return mostRecentFile(files);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function discoverCopilotSessionFiles(workspaceStorageDir) {
|
|
276
|
+
const sessions = [];
|
|
277
|
+
const chatSessionsDir = path.join(workspaceStorageDir, 'chatSessions');
|
|
278
|
+
if (fs.existsSync(chatSessionsDir)) {
|
|
279
|
+
for (const entry of fs.readdirSync(chatSessionsDir, { withFileTypes: true })) {
|
|
280
|
+
if (entry.isFile() && entry.name.endsWith('.jsonl')) {
|
|
281
|
+
sessions.push(path.join(chatSessionsDir, entry.name));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (sessions.length > 0) return sessions;
|
|
286
|
+
|
|
287
|
+
const transcriptsDir = path.join(workspaceStorageDir, 'GitHub.copilot-chat', 'transcripts');
|
|
288
|
+
if (fs.existsSync(transcriptsDir)) {
|
|
289
|
+
for (const entry of fs.readdirSync(transcriptsDir, { withFileTypes: true })) {
|
|
290
|
+
if (entry.isFile() && entry.name.endsWith('.jsonl')) {
|
|
291
|
+
sessions.push(path.join(transcriptsDir, entry.name));
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return sessions;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function discoverCopilotByWorkspaceCwd(workspacePath) {
|
|
299
|
+
const normalize = (p) => String(p || '').toLowerCase().replace(/\\/g, '/').replace(/\/$/, '');
|
|
300
|
+
const targetCwd = normalize(workspacePath);
|
|
301
|
+
|
|
302
|
+
const workspaceStorageDir = discoverWorkspaceStorageDir(workspacePath, [
|
|
303
|
+
path.join(HOME, 'AppData', 'Roaming', 'Code', 'User', 'workspaceStorage'),
|
|
304
|
+
path.join(HOME, '.config', 'Code', 'User', 'workspaceStorage'),
|
|
305
|
+
]);
|
|
306
|
+
|
|
307
|
+
if (workspaceStorageDir) {
|
|
308
|
+
const sessionFiles = discoverCopilotSessionFiles(workspaceStorageDir);
|
|
309
|
+
if (sessionFiles.length > 0) {
|
|
310
|
+
console.log(`[GitHub Copilot] Workspace storage: ${workspaceStorageDir} (${sessionFiles.length} session file(s))`);
|
|
311
|
+
return workspaceStorageDir;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const files = findJsonlFilesInRoots(COPILOT_DISCOVERY_ROOTS);
|
|
316
|
+
if (!files.length) return null;
|
|
317
|
+
|
|
318
|
+
const matched = [];
|
|
319
|
+
for (const file of files) {
|
|
320
|
+
try {
|
|
321
|
+
const firstLine = fs.readFileSync(file, 'utf-8').split('\n')[0];
|
|
322
|
+
const meta = JSON.parse(firstLine);
|
|
323
|
+
if (meta.type === 'session.start') {
|
|
324
|
+
const cwd = meta.data?.context?.cwd || meta.data?.context?.workspaceFolder?.folderPath;
|
|
325
|
+
if (normalize(cwd) === targetCwd) matched.push(file);
|
|
326
|
+
}
|
|
327
|
+
} catch (_) { }
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (matched.length > 0) {
|
|
331
|
+
const best = mostRecentFile(matched);
|
|
332
|
+
console.log(`[GitHub Copilot] Found ${matched.length} legacy session(s) matching workspace cwd. Using: ${best}`);
|
|
333
|
+
return best;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
console.warn('[GitHub Copilot] No workspace match found. Falling back to most recent Copilot session file.');
|
|
337
|
+
return mostRecentFile(files);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function discoverClaudeByWorkspaceCwd(workspacePath) {
|
|
341
|
+
const root = AGENT_ROOTS['Claude Code'];
|
|
342
|
+
if (!fs.existsSync(root)) return null;
|
|
343
|
+
|
|
344
|
+
let slug = workspacePath.replace(/[^a-zA-Z0-9]/g, '-');
|
|
345
|
+
if (slug.charAt(1) === '-') slug = slug.charAt(0).toLowerCase() + slug.slice(1);
|
|
346
|
+
|
|
347
|
+
const projectDir = path.join(root, slug);
|
|
348
|
+
if (fs.existsSync(projectDir)) {
|
|
349
|
+
const files = findJsonlFiles(projectDir);
|
|
350
|
+
if (files.length > 0) {
|
|
351
|
+
const best = mostRecentFile(files);
|
|
352
|
+
console.log(`[Claude Code] Found project dir matching workspace slug. Using: ${best}`);
|
|
353
|
+
return best;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
console.warn('[Claude Code] No slug match found. Falling back to most recent session file.');
|
|
358
|
+
return mostRecentFile(findJsonlFiles(root));
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function extractBrainUuidFromJetskiMemento(workspacePath) {
|
|
362
|
+
const wsDir = discoverWorkspaceStorageDir(workspacePath, ANTIGRAVITY_WS_ROOTS);
|
|
363
|
+
if (!wsDir) return null;
|
|
364
|
+
|
|
365
|
+
const mem = readVscdbJson(
|
|
366
|
+
path.join(wsDir, 'state.vscdb'),
|
|
367
|
+
'memento/antigravity.jetskiArtifactsEditor'
|
|
368
|
+
);
|
|
369
|
+
const viewState = mem?.['jetskiArtifactsEditor.viewState'];
|
|
370
|
+
if (!Array.isArray(viewState) || !viewState.length) return null;
|
|
371
|
+
|
|
372
|
+
for (const [uri] of viewState) {
|
|
373
|
+
if (typeof uri !== 'string') continue;
|
|
374
|
+
const match = uri.match(/antigravity-ide\/brain\/([0-9a-f-]{36})/i);
|
|
375
|
+
if (match) return match[1];
|
|
376
|
+
}
|
|
377
|
+
return null;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
function discoverAntigravityByWorkspace(workspacePath) {
|
|
381
|
+
const normalize = (p) => String(p || '').toLowerCase().replace(/\\/g, '/');
|
|
382
|
+
const target = normalize(workspacePath);
|
|
383
|
+
const root = AGENT_ROOTS['Antigravity'];
|
|
384
|
+
const matched = [];
|
|
385
|
+
|
|
386
|
+
const brainUuid = extractBrainUuidFromJetskiMemento(workspacePath);
|
|
387
|
+
if (brainUuid) {
|
|
388
|
+
const transcript = path.join(
|
|
389
|
+
root,
|
|
390
|
+
brainUuid,
|
|
391
|
+
'.system_generated',
|
|
392
|
+
'logs',
|
|
393
|
+
'transcript.jsonl'
|
|
394
|
+
);
|
|
395
|
+
if (fs.existsSync(transcript)) {
|
|
396
|
+
console.log(`[Antigravity] Matched brain via jetski memento: ${brainUuid}`);
|
|
397
|
+
return transcript;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (fs.existsSync(root)) {
|
|
402
|
+
for (const file of findJsonlFiles(root)) {
|
|
403
|
+
if (!file.endsWith('transcript.jsonl')) continue;
|
|
404
|
+
try {
|
|
405
|
+
if (normalize(fs.readFileSync(file, 'utf-8')).includes(target)) matched.push(file);
|
|
406
|
+
} catch (_) { }
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (matched.length > 0) {
|
|
411
|
+
const best = mostRecentFile(matched);
|
|
412
|
+
console.log(`[Antigravity] Found ${matched.length} transcript(s) mentioning workspace. Using: ${best}`);
|
|
413
|
+
return best;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return discoverAntigravityMostRecent();
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function discoverAntigravityMostRecent() {
|
|
420
|
+
const root = AGENT_ROOTS['Antigravity'];
|
|
421
|
+
const files = findJsonlFiles(root);
|
|
422
|
+
const transcripts = files.filter(f => f.endsWith('transcript.jsonl'));
|
|
423
|
+
return mostRecentFile(transcripts.length > 0 ? transcripts : files);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function discoverCursorByWorkspace(workspacePath) {
|
|
427
|
+
const dir = discoverCursorTranscriptDir(workspacePath);
|
|
428
|
+
if (dir) {
|
|
429
|
+
console.log(`[Cursor] Agent transcripts dir: ${dir}`);
|
|
430
|
+
return dir;
|
|
431
|
+
}
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
function normalizeParseResult(parsedData) {
|
|
436
|
+
if (Array.isArray(parsedData)) {
|
|
437
|
+
return { events: parsedData, artifacts: [], tasks: [], messages: [] };
|
|
438
|
+
}
|
|
439
|
+
return {
|
|
440
|
+
events: parsedData.events || [],
|
|
441
|
+
artifacts: parsedData.artifacts || [],
|
|
442
|
+
tasks: parsedData.tasks || [],
|
|
443
|
+
messages: parsedData.messages || [],
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function parseAgentData(agent, transcriptPath, workspacePath) {
|
|
448
|
+
if (agent === 'Antigravity') {
|
|
449
|
+
const brainDir = getBrainDir(transcriptPath);
|
|
450
|
+
return parseAntigravity(transcriptPath, { brainDir });
|
|
451
|
+
}
|
|
452
|
+
if (agent === 'Codex') return { events: parseCodex(transcriptPath), artifacts: [], tasks: [], messages: [] };
|
|
453
|
+
if (agent === 'Claude Code') {
|
|
454
|
+
return {
|
|
455
|
+
events: parseClaude(transcriptPath, { workspacePath }),
|
|
456
|
+
artifacts: [],
|
|
457
|
+
tasks: [],
|
|
458
|
+
messages: [],
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
if (agent === 'GitHub Copilot') {
|
|
462
|
+
return {
|
|
463
|
+
events: parseCopilot(transcriptPath, { workspacePath }),
|
|
464
|
+
artifacts: [],
|
|
465
|
+
tasks: [],
|
|
466
|
+
messages: [],
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
if (agent === 'Cursor') {
|
|
470
|
+
return parseCursor(transcriptPath, { workspacePath });
|
|
471
|
+
}
|
|
472
|
+
return { events: [], artifacts: [], tasks: [], messages: [] };
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
const AUTO_AGENTS = ['Cursor', 'Claude Code', 'GitHub Copilot', 'Codex', 'Antigravity'];
|
|
476
|
+
|
|
477
|
+
function discoverAgentTranscript(agent, workspacePath) {
|
|
478
|
+
if (agent === 'Antigravity') return discoverAntigravityByWorkspace(workspacePath);
|
|
479
|
+
if (agent === 'Codex') return discoverCodexByWorkspaceCwd(workspacePath);
|
|
480
|
+
if (agent === 'Claude Code') return discoverClaudeByWorkspaceCwd(workspacePath);
|
|
481
|
+
if (agent === 'GitHub Copilot') return discoverCopilotByWorkspaceCwd(workspacePath);
|
|
482
|
+
if (agent === 'Cursor') return discoverCursorByWorkspace(workspacePath);
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function connectAgentAuto(workspacePath, agent) {
|
|
487
|
+
const transcriptPath = discoverAgentTranscript(agent, workspacePath);
|
|
488
|
+
if (!transcriptPath || !fs.existsSync(transcriptPath)) {
|
|
489
|
+
return { agent, connected: false };
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const configPath = getConfigPath(workspacePath);
|
|
493
|
+
const config = safeReadJson(configPath, { agents: {} });
|
|
494
|
+
if (!config.agents) config.agents = {};
|
|
495
|
+
|
|
496
|
+
let parsed = { events: [], artifacts: [], tasks: [], messages: [] };
|
|
497
|
+
try {
|
|
498
|
+
parsed = normalizeParseResult(parseAgentData(agent, transcriptPath, workspacePath));
|
|
499
|
+
} catch (err) {
|
|
500
|
+
console.warn(`[AutoConnect] ${agent} parse error: ${err.message}`);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
config.agents[agent] = {
|
|
504
|
+
status: 'connected',
|
|
505
|
+
transcriptPath,
|
|
506
|
+
connectedAt: new Date().toISOString(),
|
|
507
|
+
autoConnected: true,
|
|
508
|
+
};
|
|
509
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
510
|
+
|
|
511
|
+
const memoryPath = getMemoryPath(workspacePath);
|
|
512
|
+
const memory = fs.existsSync(memoryPath)
|
|
513
|
+
? safeReadJson(memoryPath, { workspace: workspacePath, agents: {}, timeline: [] })
|
|
514
|
+
: { workspace: workspacePath, agents: {}, timeline: [] };
|
|
515
|
+
if (!memory.agents) memory.agents = {};
|
|
516
|
+
memory.agents[agent] = {
|
|
517
|
+
status: 'connected',
|
|
518
|
+
transcriptPath,
|
|
519
|
+
eventCount: parsed.events.length,
|
|
520
|
+
events: parsed.events.slice(-100),
|
|
521
|
+
artifacts: parsed.artifacts,
|
|
522
|
+
tasks: parsed.tasks.slice(-50),
|
|
523
|
+
messages: parsed.messages.slice(-50),
|
|
524
|
+
};
|
|
525
|
+
memory.timeline = buildGlobalTimeline(memory.agents);
|
|
526
|
+
fs.writeFileSync(memoryPath, JSON.stringify(memory, null, 2));
|
|
527
|
+
|
|
528
|
+
console.log(`[AutoConnect] ${agent} → ${transcriptPath}`);
|
|
529
|
+
return { agent, connected: true, transcriptPath, eventCount: parsed.events.length };
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
function autoConnectAgents(workspacePath) {
|
|
533
|
+
const configPath = getConfigPath(workspacePath);
|
|
534
|
+
if (!fs.existsSync(configPath)) return [];
|
|
535
|
+
|
|
536
|
+
let config = safeReadJson(configPath, null);
|
|
537
|
+
if (!config) return [];
|
|
538
|
+
if (config.autoUpdate === undefined) {
|
|
539
|
+
config.autoUpdate = true;
|
|
540
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
return AUTO_AGENTS.map(agent => connectAgentAuto(workspacePath, agent));
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function connectAgent(workspacePath, agent) {
|
|
547
|
+
const configPath = getConfigPath(workspacePath);
|
|
548
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
549
|
+
const agentConfig = config.agents[agent] || {};
|
|
550
|
+
const token = agentConfig.pendingToken;
|
|
551
|
+
|
|
552
|
+
if (!token) {
|
|
553
|
+
throw new Error(`No pending handshake for ${agent}. Call /api/handshake first.`);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
let transcriptPath = null;
|
|
557
|
+
|
|
558
|
+
if (agent === 'Antigravity') {
|
|
559
|
+
transcriptPath = discoverByToken('Antigravity', token) || discoverAntigravityByWorkspace(workspacePath);
|
|
560
|
+
} else if (agent === 'Codex') {
|
|
561
|
+
if (agentConfig.codexMode === 'cli') {
|
|
562
|
+
transcriptPath = discoverByToken('Codex', token);
|
|
563
|
+
}
|
|
564
|
+
if (!transcriptPath) transcriptPath = discoverCodexByWorkspaceCwd(workspacePath);
|
|
565
|
+
} else if (agent === 'Claude Code') {
|
|
566
|
+
if (agentConfig.claudeMode === 'cli') {
|
|
567
|
+
transcriptPath = discoverByToken('Claude Code', token);
|
|
568
|
+
}
|
|
569
|
+
if (!transcriptPath) transcriptPath = discoverClaudeByWorkspaceCwd(workspacePath);
|
|
570
|
+
} else if (agent === 'GitHub Copilot') {
|
|
571
|
+
transcriptPath = discoverCopilotByWorkspaceCwd(workspacePath);
|
|
572
|
+
} else if (agent === 'Cursor') {
|
|
573
|
+
transcriptPath = discoverCursorByWorkspace(workspacePath);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
if (!transcriptPath) {
|
|
577
|
+
throw new Error(
|
|
578
|
+
`Could not discover ${agent} transcript. ` +
|
|
579
|
+
(agent === 'Codex'
|
|
580
|
+
? 'Make sure Codex is open in this workspace in VS Code.'
|
|
581
|
+
: agent === 'GitHub Copilot'
|
|
582
|
+
? 'Make sure Copilot is open in this workspace in VS Code.'
|
|
583
|
+
: agent === 'Cursor'
|
|
584
|
+
? 'Make sure Cursor agent chats exist for this workspace.'
|
|
585
|
+
: 'The CLI may not have written a session yet.')
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
let parsed = { events: [], artifacts: [], tasks: [], messages: [] };
|
|
590
|
+
try {
|
|
591
|
+
parsed = normalizeParseResult(parseAgentData(agent, transcriptPath, workspacePath));
|
|
592
|
+
} catch (err) {
|
|
593
|
+
console.error(`[${agent}] Parse error:`, err.message);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
config.agents[agent] = {
|
|
597
|
+
status: 'connected',
|
|
598
|
+
transcriptPath,
|
|
599
|
+
connectedAt: new Date().toISOString(),
|
|
600
|
+
pendingToken: null,
|
|
601
|
+
codexMode: agentConfig.codexMode || null,
|
|
602
|
+
claudeMode: agentConfig.claudeMode || null,
|
|
603
|
+
copilotMode: agentConfig.copilotMode || null,
|
|
604
|
+
cursorMode: agentConfig.cursorMode || null,
|
|
605
|
+
};
|
|
606
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
607
|
+
|
|
608
|
+
const memoryPath = getMemoryPath(workspacePath);
|
|
609
|
+
const memory = JSON.parse(fs.readFileSync(memoryPath, 'utf-8'));
|
|
610
|
+
memory.lastSync = new Date().toISOString();
|
|
611
|
+
if (!memory.agents) memory.agents = {};
|
|
612
|
+
memory.agents[agent] = {
|
|
613
|
+
status: 'connected',
|
|
614
|
+
transcriptPath,
|
|
615
|
+
eventCount: parsed.events.length,
|
|
616
|
+
events: parsed.events.slice(-100),
|
|
617
|
+
artifacts: parsed.artifacts,
|
|
618
|
+
tasks: parsed.tasks.slice(-50),
|
|
619
|
+
messages: parsed.messages.slice(-50),
|
|
620
|
+
};
|
|
621
|
+
memory.timeline = buildGlobalTimeline(memory.agents);
|
|
622
|
+
writeRelayContext(workspacePath);
|
|
623
|
+
fs.writeFileSync(memoryPath, JSON.stringify(memory, null, 2));
|
|
624
|
+
|
|
625
|
+
return {
|
|
626
|
+
transcriptPath,
|
|
627
|
+
eventCount: parsed.events.length,
|
|
628
|
+
events: parsed.events.slice(-20),
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
function syncWorkspace(workspacePath) {
|
|
633
|
+
const configPath = getConfigPath(workspacePath);
|
|
634
|
+
const memoryPath = getMemoryPath(workspacePath);
|
|
635
|
+
if (!fs.existsSync(configPath)) throw new Error('Workspace not registered.');
|
|
636
|
+
|
|
637
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
638
|
+
const memory = fs.existsSync(memoryPath)
|
|
639
|
+
? JSON.parse(fs.readFileSync(memoryPath, 'utf-8'))
|
|
640
|
+
: { workspace: workspacePath, agents: {}, timeline: [] };
|
|
641
|
+
|
|
642
|
+
let totalEvents = 0;
|
|
643
|
+
|
|
644
|
+
for (const [agent, agentConfig] of Object.entries(config.agents)) {
|
|
645
|
+
if (agentConfig.status !== 'connected' || !agentConfig.transcriptPath) continue;
|
|
646
|
+
const transcriptPath = agentConfig.transcriptPath;
|
|
647
|
+
if (!fs.existsSync(transcriptPath)) {
|
|
648
|
+
console.warn(`[Sync] ${agent} transcript not found: ${transcriptPath}`);
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
try {
|
|
653
|
+
const parsed = normalizeParseResult(parseAgentData(agent, transcriptPath, workspacePath));
|
|
654
|
+
if (!memory.agents) memory.agents = {};
|
|
655
|
+
memory.agents[agent] = {
|
|
656
|
+
status: 'connected',
|
|
657
|
+
transcriptPath,
|
|
658
|
+
eventCount: parsed.events.length,
|
|
659
|
+
events: parsed.events.slice(-200),
|
|
660
|
+
artifacts: parsed.artifacts,
|
|
661
|
+
tasks: parsed.tasks.slice(-50),
|
|
662
|
+
messages: parsed.messages.slice(-50),
|
|
663
|
+
};
|
|
664
|
+
totalEvents += parsed.events.length;
|
|
665
|
+
console.log(`[Sync] ${agent}: ${parsed.events.length} events, ${parsed.artifacts.length} artifacts`);
|
|
666
|
+
} catch (err) {
|
|
667
|
+
console.error(`[Sync] ${agent} parse error: ${err.message}`);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
memory.timeline = buildGlobalTimeline(memory.agents);
|
|
672
|
+
memory.lastSync = new Date().toISOString();
|
|
673
|
+
fs.writeFileSync(memoryPath, JSON.stringify(memory, null, 2));
|
|
674
|
+
return {
|
|
675
|
+
totalEvents,
|
|
676
|
+
timelineCount: memory.timeline.length,
|
|
677
|
+
lastSync: memory.lastSync,
|
|
678
|
+
agents: Object.keys(config.agents),
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
async function refreshWorkspace(workspacePath, options = {}) {
|
|
683
|
+
const syncResult = syncWorkspace(workspacePath);
|
|
684
|
+
if (!options.skipBrief) {
|
|
685
|
+
writeCompileBrief(workspacePath, options);
|
|
686
|
+
}
|
|
687
|
+
const contextResult = writeRelayContext(workspacePath, options);
|
|
688
|
+
return { sync: syncResult, context: contextResult };
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
const activeWatchers = new Map();
|
|
692
|
+
const refreshInFlight = new Map();
|
|
693
|
+
|
|
694
|
+
function scheduleAutoSync(workspacePath, label) {
|
|
695
|
+
if (refreshInFlight.has(workspacePath)) return;
|
|
696
|
+
|
|
697
|
+
const configPath = getConfigPath(workspacePath);
|
|
698
|
+
if (!fs.existsSync(configPath)) return;
|
|
699
|
+
|
|
700
|
+
let config = {};
|
|
701
|
+
try {
|
|
702
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
703
|
+
} catch (_) {
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
if (config.autoUpdate === false) return;
|
|
707
|
+
|
|
708
|
+
refreshInFlight.set(workspacePath, true);
|
|
709
|
+
console.log(`[Watcher] ${label} changed — syncing...`);
|
|
710
|
+
|
|
711
|
+
autoConnectAgents(workspacePath);
|
|
712
|
+
try {
|
|
713
|
+
syncWorkspace(workspacePath);
|
|
714
|
+
writeCompileBrief(workspacePath);
|
|
715
|
+
console.log(`[Watcher] ✓ synced (agent hooks update IR on stop)`);
|
|
716
|
+
} catch (err) {
|
|
717
|
+
console.error(`[Watcher] sync error: ${err.message}`);
|
|
718
|
+
} finally {
|
|
719
|
+
refreshInFlight.delete(workspacePath);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
function watchPath(watchTarget, label, workspacePath, watchers) {
|
|
724
|
+
if (!watchTarget || !fs.existsSync(watchTarget)) return;
|
|
725
|
+
|
|
726
|
+
let debounceTimer = null;
|
|
727
|
+
const watchRecursive = fs.statSync(watchTarget).isDirectory();
|
|
728
|
+
|
|
729
|
+
const watcher = fs.watch(watchTarget, { recursive: watchRecursive }, () => {
|
|
730
|
+
clearTimeout(debounceTimer);
|
|
731
|
+
debounceTimer = setTimeout(() => {
|
|
732
|
+
scheduleAutoSync(workspacePath, label);
|
|
733
|
+
}, 2000);
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
watchers.push(watcher);
|
|
737
|
+
console.log(`[Watcher] Watching ${label}: ${watchTarget}`);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
function startWatcher(workspacePath) {
|
|
741
|
+
if (activeWatchers.has(workspacePath)) {
|
|
742
|
+
activeWatchers.get(workspacePath).forEach(w => w.close());
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
autoConnectAgents(workspacePath);
|
|
746
|
+
|
|
747
|
+
const configPath = getConfigPath(workspacePath);
|
|
748
|
+
if (!fs.existsSync(configPath)) return 0;
|
|
749
|
+
|
|
750
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
751
|
+
const watchers = [];
|
|
752
|
+
|
|
753
|
+
for (const [agent, agentConfig] of Object.entries(config.agents)) {
|
|
754
|
+
if (agentConfig.status !== 'connected' || !agentConfig.transcriptPath) continue;
|
|
755
|
+
const transcriptPath = agentConfig.transcriptPath;
|
|
756
|
+
if (!fs.existsSync(transcriptPath)) continue;
|
|
757
|
+
|
|
758
|
+
watchPath(transcriptPath, `${agent} transcript`, workspacePath, watchers);
|
|
759
|
+
|
|
760
|
+
if (agent === 'Antigravity') {
|
|
761
|
+
watchPath(getBrainDir(transcriptPath), `${agent} brain`, workspacePath, watchers);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
activeWatchers.set(workspacePath, watchers);
|
|
766
|
+
return watchers.length;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
async function startRelayWatch(workspacePath) {
|
|
770
|
+
const count = startWatcher(workspacePath);
|
|
771
|
+
syncWorkspace(workspacePath);
|
|
772
|
+
writeCompileBrief(workspacePath);
|
|
773
|
+
return { watcherCount: count };
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
function stopWatcher(workspacePath) {
|
|
777
|
+
if (!activeWatchers.has(workspacePath)) return;
|
|
778
|
+
activeWatchers.get(workspacePath).forEach(w => w.close());
|
|
779
|
+
activeWatchers.delete(workspacePath);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
function getMemory(workspacePath) {
|
|
783
|
+
const memoryPath = getMemoryPath(workspacePath);
|
|
784
|
+
if (!fs.existsSync(memoryPath)) {
|
|
785
|
+
throw new Error('Workspace not registered. Call /api/register first.');
|
|
786
|
+
}
|
|
787
|
+
return JSON.parse(fs.readFileSync(memoryPath, 'utf-8'));
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
function getRelayContext(workspacePath, options = {}) {
|
|
791
|
+
const relayDir = getRelayDir(workspacePath);
|
|
792
|
+
if (!fs.existsSync(relayDir)) {
|
|
793
|
+
throw new Error('Workspace not registered. Call /api/register first.');
|
|
794
|
+
}
|
|
795
|
+
return writeRelayContext(workspacePath, options);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
function getCompileBrief(workspacePath, options = {}) {
|
|
799
|
+
const relayDir = getRelayDir(workspacePath);
|
|
800
|
+
if (!fs.existsSync(relayDir)) {
|
|
801
|
+
throw new Error('Workspace not registered. Call /api/register first.');
|
|
802
|
+
}
|
|
803
|
+
return writeCompileBrief(workspacePath, options);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
async function compileIr(workspacePath, options = {}) {
|
|
807
|
+
const relayDir = getRelayDir(workspacePath);
|
|
808
|
+
if (!fs.existsSync(relayDir)) {
|
|
809
|
+
throw new Error('Workspace not registered. Call /api/register first.');
|
|
810
|
+
}
|
|
811
|
+
if (!options.skipBrief) {
|
|
812
|
+
writeCompileBrief(workspacePath, options);
|
|
813
|
+
}
|
|
814
|
+
return compileIrSync(workspacePath, options);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
module.exports = {
|
|
818
|
+
registerWorkspace,
|
|
819
|
+
sendHandshake,
|
|
820
|
+
connectAgent,
|
|
821
|
+
connectAgentAuto,
|
|
822
|
+
autoConnectAgents,
|
|
823
|
+
syncWorkspace,
|
|
824
|
+
refreshWorkspace,
|
|
825
|
+
startWatcher,
|
|
826
|
+
startRelayWatch,
|
|
827
|
+
stopWatcher,
|
|
828
|
+
getMemory,
|
|
829
|
+
getRelayContext,
|
|
830
|
+
getCompileBrief,
|
|
831
|
+
compileIr,
|
|
832
|
+
isRelayInstalled,
|
|
833
|
+
installRelayWorkspace,
|
|
834
|
+
writeAgentBootstrap,
|
|
835
|
+
};
|