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
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const crypto = require('crypto');
|
|
5
|
+
|
|
6
|
+
const REGISTRY_DIR = path.join(os.homedir(), '.relay-os');
|
|
7
|
+
const REGISTRY_PATH = path.join(REGISTRY_DIR, 'projects.json');
|
|
8
|
+
|
|
9
|
+
function ensureRegistryDir() {
|
|
10
|
+
if (!fs.existsSync(REGISTRY_DIR)) fs.mkdirSync(REGISTRY_DIR, { recursive: true });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function loadRegistry() {
|
|
14
|
+
ensureRegistryDir();
|
|
15
|
+
if (!fs.existsSync(REGISTRY_PATH)) {
|
|
16
|
+
return { version: 1, projects: [] };
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
return JSON.parse(fs.readFileSync(REGISTRY_PATH, 'utf-8'));
|
|
20
|
+
} catch (_) {
|
|
21
|
+
return { version: 1, projects: [] };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function saveRegistry(registry) {
|
|
26
|
+
ensureRegistryDir();
|
|
27
|
+
fs.writeFileSync(REGISTRY_PATH, JSON.stringify(registry, null, 2), 'utf-8');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function generateId() {
|
|
31
|
+
return crypto.randomBytes(8).toString('hex');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function generateApiKey() {
|
|
35
|
+
return `relay_${crypto.randomBytes(24).toString('hex')}`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function defaultProjectName(workspacePath) {
|
|
39
|
+
return path.basename(path.resolve(workspacePath)) || 'Untitled project';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function writeProjectManifest(workspacePath, project) {
|
|
43
|
+
const relayDir = path.join(path.resolve(workspacePath), '.relay');
|
|
44
|
+
if (!fs.existsSync(relayDir)) fs.mkdirSync(relayDir, { recursive: true });
|
|
45
|
+
|
|
46
|
+
const uiPort = Number(process.env.RELAY_UI_PORT) || 6374;
|
|
47
|
+
const manifest = {
|
|
48
|
+
id: project.id,
|
|
49
|
+
name: project.name,
|
|
50
|
+
apiKey: project.apiKey,
|
|
51
|
+
workspacePath: path.resolve(workspacePath),
|
|
52
|
+
dashboardUrl: `http://localhost:${uiPort}/?project=${project.id}`,
|
|
53
|
+
setupUrl: `http://localhost:${uiPort}/?setup=${project.id}`,
|
|
54
|
+
updatedAt: new Date().toISOString(),
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
fs.writeFileSync(
|
|
58
|
+
path.join(relayDir, 'project.json'),
|
|
59
|
+
JSON.stringify(manifest, null, 2),
|
|
60
|
+
'utf-8'
|
|
61
|
+
);
|
|
62
|
+
return manifest;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function readProjectManifest(workspacePath) {
|
|
66
|
+
const manifestPath = path.join(path.resolve(workspacePath), '.relay', 'project.json');
|
|
67
|
+
if (!fs.existsSync(manifestPath)) return null;
|
|
68
|
+
try {
|
|
69
|
+
return JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
70
|
+
} catch (_) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function getProjectStats(workspacePath) {
|
|
76
|
+
const memoryPath = path.join(path.resolve(workspacePath), '.relay', 'memory.json');
|
|
77
|
+
if (!fs.existsSync(memoryPath)) {
|
|
78
|
+
return { totalEvents: 0, lastSync: null, connectedAgents: 0 };
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const memory = JSON.parse(fs.readFileSync(memoryPath, 'utf-8'));
|
|
82
|
+
const timeline = Array.isArray(memory.timeline) ? memory.timeline : [];
|
|
83
|
+
const connectedAgents = Object.values(memory.agents || {}).filter(
|
|
84
|
+
(a) => a.status === 'connected'
|
|
85
|
+
).length;
|
|
86
|
+
return {
|
|
87
|
+
totalEvents: timeline.length,
|
|
88
|
+
lastSync: memory.lastSync || null,
|
|
89
|
+
connectedAgents,
|
|
90
|
+
};
|
|
91
|
+
} catch (_) {
|
|
92
|
+
return { totalEvents: 0, lastSync: null, connectedAgents: 0 };
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function enrichProject(project, { includeApiKey = false } = {}) {
|
|
97
|
+
const stats = getProjectStats(project.workspacePath);
|
|
98
|
+
const base = {
|
|
99
|
+
id: project.id,
|
|
100
|
+
name: project.name,
|
|
101
|
+
workspacePath: project.workspacePath,
|
|
102
|
+
createdAt: project.createdAt,
|
|
103
|
+
updatedAt: project.updatedAt,
|
|
104
|
+
stats,
|
|
105
|
+
};
|
|
106
|
+
if (includeApiKey) base.apiKey = project.apiKey;
|
|
107
|
+
return base;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function registerProject(workspacePath, options = {}) {
|
|
111
|
+
const resolved = path.resolve(workspacePath);
|
|
112
|
+
const registry = loadRegistry();
|
|
113
|
+
let project = registry.projects.find((p) => p.workspacePath === resolved);
|
|
114
|
+
|
|
115
|
+
if (project) {
|
|
116
|
+
if (options.name && options.name !== project.name) {
|
|
117
|
+
project.name = options.name.trim();
|
|
118
|
+
project.updatedAt = new Date().toISOString();
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
project = {
|
|
122
|
+
id: generateId(),
|
|
123
|
+
name: (options.name || defaultProjectName(resolved)).trim(),
|
|
124
|
+
workspacePath: resolved,
|
|
125
|
+
apiKey: generateApiKey(),
|
|
126
|
+
createdAt: new Date().toISOString(),
|
|
127
|
+
updatedAt: new Date().toISOString(),
|
|
128
|
+
};
|
|
129
|
+
registry.projects.push(project);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
saveRegistry(registry);
|
|
133
|
+
const manifest = writeProjectManifest(resolved, project);
|
|
134
|
+
return { project: enrichProject(project, { includeApiKey: true }), manifest };
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function listProjects(options = {}) {
|
|
138
|
+
const registry = loadRegistry();
|
|
139
|
+
return registry.projects
|
|
140
|
+
.map((p) => enrichProject(p, { includeApiKey: options.includeApiKey }))
|
|
141
|
+
.sort((a, b) => new Date(b.updatedAt) - new Date(a.updatedAt));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function getProject(projectId, options = {}) {
|
|
145
|
+
const registry = loadRegistry();
|
|
146
|
+
const project = registry.projects.find((p) => p.id === projectId);
|
|
147
|
+
if (!project) return null;
|
|
148
|
+
return enrichProject(project, { includeApiKey: options.includeApiKey });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function getProjectByWorkspace(workspacePath, options = {}) {
|
|
152
|
+
const resolved = path.resolve(workspacePath);
|
|
153
|
+
const registry = loadRegistry();
|
|
154
|
+
const project = registry.projects.find((p) => p.workspacePath === resolved);
|
|
155
|
+
if (!project) return null;
|
|
156
|
+
return enrichProject(project, { includeApiKey: options.includeApiKey });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function getProjectByApiKey(apiKey) {
|
|
160
|
+
if (!apiKey) return null;
|
|
161
|
+
const registry = loadRegistry();
|
|
162
|
+
const project = registry.projects.find((p) => p.apiKey === apiKey);
|
|
163
|
+
if (!project) return null;
|
|
164
|
+
return enrichProject(project, { includeApiKey: true });
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function updateProjectName(projectId, name) {
|
|
168
|
+
const registry = loadRegistry();
|
|
169
|
+
const project = registry.projects.find((p) => p.id === projectId);
|
|
170
|
+
if (!project) throw new Error('Project not found');
|
|
171
|
+
project.name = String(name || '').trim() || defaultProjectName(project.workspacePath);
|
|
172
|
+
project.updatedAt = new Date().toISOString();
|
|
173
|
+
saveRegistry(registry);
|
|
174
|
+
writeProjectManifest(project.workspacePath, project);
|
|
175
|
+
return enrichProject(project, { includeApiKey: true });
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function resolveProjectWorkspace(projectId) {
|
|
179
|
+
const project = getProject(projectId);
|
|
180
|
+
if (!project) throw new Error('Project not found');
|
|
181
|
+
return project.workspacePath;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function syncFromManifest(workspacePath) {
|
|
185
|
+
const manifest = readProjectManifest(workspacePath);
|
|
186
|
+
if (!manifest || !manifest.id || !manifest.apiKey) return null;
|
|
187
|
+
|
|
188
|
+
const registry = loadRegistry();
|
|
189
|
+
let project = registry.projects.find((p) => p.id === manifest.id);
|
|
190
|
+
|
|
191
|
+
if (!project) {
|
|
192
|
+
project = {
|
|
193
|
+
id: manifest.id,
|
|
194
|
+
name: manifest.name || defaultProjectName(workspacePath),
|
|
195
|
+
workspacePath: path.resolve(workspacePath),
|
|
196
|
+
apiKey: manifest.apiKey,
|
|
197
|
+
createdAt: manifest.updatedAt || new Date().toISOString(),
|
|
198
|
+
updatedAt: new Date().toISOString(),
|
|
199
|
+
};
|
|
200
|
+
registry.projects.push(project);
|
|
201
|
+
} else {
|
|
202
|
+
project.name = manifest.name || project.name;
|
|
203
|
+
project.apiKey = manifest.apiKey;
|
|
204
|
+
project.workspacePath = path.resolve(workspacePath);
|
|
205
|
+
project.updatedAt = new Date().toISOString();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
saveRegistry(registry);
|
|
209
|
+
return enrichProject(project, { includeApiKey: true });
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
module.exports = {
|
|
213
|
+
REGISTRY_PATH,
|
|
214
|
+
registerProject,
|
|
215
|
+
listProjects,
|
|
216
|
+
getProject,
|
|
217
|
+
getProjectByWorkspace,
|
|
218
|
+
getProjectByApiKey,
|
|
219
|
+
updateProjectName,
|
|
220
|
+
resolveProjectWorkspace,
|
|
221
|
+
syncFromManifest,
|
|
222
|
+
writeProjectManifest,
|
|
223
|
+
readProjectManifest,
|
|
224
|
+
getProjectStats,
|
|
225
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
const http = require('http');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
|
|
5
|
+
const PACKAGE_ROOT = path.join(__dirname, '..', '..');
|
|
6
|
+
const BACKEND = path.join(PACKAGE_ROOT, 'backend');
|
|
7
|
+
|
|
8
|
+
function getApiPort() {
|
|
9
|
+
return Number(process.env.RELAY_PORT) || 3001;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getUiPort() {
|
|
13
|
+
return Number(process.env.RELAY_UI_PORT) || 6374;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function pingHealth(port) {
|
|
17
|
+
return new Promise((resolve) => {
|
|
18
|
+
const req = http.get(`http://127.0.0.1:${port}/api/health`, (res) => {
|
|
19
|
+
res.resume();
|
|
20
|
+
resolve(res.statusCode === 200);
|
|
21
|
+
});
|
|
22
|
+
req.on('error', () => resolve(false));
|
|
23
|
+
req.setTimeout(1500, () => {
|
|
24
|
+
req.destroy();
|
|
25
|
+
resolve(false);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function isRelayApiRunning(port = getApiPort()) {
|
|
31
|
+
return pingHealth(port);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function spawnDetached(args, env, cwd) {
|
|
35
|
+
const child = spawn(process.execPath, args, {
|
|
36
|
+
detached: true,
|
|
37
|
+
stdio: 'ignore',
|
|
38
|
+
env,
|
|
39
|
+
cwd,
|
|
40
|
+
windowsHide: true,
|
|
41
|
+
});
|
|
42
|
+
child.unref();
|
|
43
|
+
return child;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function startRelayServeForeground(options = {}) {
|
|
47
|
+
const port = options.port || getApiPort();
|
|
48
|
+
const uiPort = options.uiPort || getUiPort();
|
|
49
|
+
const apiOnly = Boolean(options.apiOnly);
|
|
50
|
+
const { startMissionControlUi } = require('./relayUi');
|
|
51
|
+
const serverPath = path.join(BACKEND, 'server.js');
|
|
52
|
+
const env = { ...process.env, RELAY_PORT: String(port), RELAY_UI_PORT: String(uiPort) };
|
|
53
|
+
|
|
54
|
+
let uiChild = null;
|
|
55
|
+
if (!apiOnly) {
|
|
56
|
+
try {
|
|
57
|
+
uiChild = startMissionControlUi({ apiPort: port, uiPort });
|
|
58
|
+
} catch (err) {
|
|
59
|
+
console.warn(`Mission Control UI failed to start: ${err.message || err}`);
|
|
60
|
+
console.warn('Continuing with API only.');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const apiChild = spawn(process.execPath, [serverPath], {
|
|
65
|
+
stdio: 'inherit',
|
|
66
|
+
env,
|
|
67
|
+
cwd: BACKEND,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
function shutdown() {
|
|
71
|
+
if (uiChild && !uiChild.killed) uiChild.kill();
|
|
72
|
+
if (apiChild && !apiChild.killed) apiChild.kill();
|
|
73
|
+
process.exit(0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
process.on('SIGINT', shutdown);
|
|
77
|
+
process.on('SIGTERM', shutdown);
|
|
78
|
+
|
|
79
|
+
if (uiChild) {
|
|
80
|
+
uiChild.on('exit', (code) => {
|
|
81
|
+
if (code && code !== 0) console.warn(`Mission Control exited (${code})`);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return { apiChild, uiChild, port, uiPort };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function startRelayServeBackground(options = {}) {
|
|
89
|
+
const port = options.port || getApiPort();
|
|
90
|
+
const uiPort = options.uiPort || getUiPort();
|
|
91
|
+
|
|
92
|
+
if (await isRelayApiRunning(port)) {
|
|
93
|
+
return { started: false, alreadyRunning: true, port, uiPort };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const relayBin = path.join(PACKAGE_ROOT, 'bin', 'relay.js');
|
|
97
|
+
const args = [relayBin, 'serve', '--port', String(port), '--ui-port', String(uiPort)];
|
|
98
|
+
if (options.apiOnly) args.push('--api-only');
|
|
99
|
+
|
|
100
|
+
const env = { ...process.env, RELAY_PORT: String(port), RELAY_UI_PORT: String(uiPort) };
|
|
101
|
+
spawnDetached(args, env, PACKAGE_ROOT);
|
|
102
|
+
|
|
103
|
+
for (let i = 0; i < 20; i += 1) {
|
|
104
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
105
|
+
if (await isRelayApiRunning(port)) {
|
|
106
|
+
return { started: true, alreadyRunning: false, port, uiPort };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return { started: true, alreadyRunning: false, port, uiPort, warming: true };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
module.exports = {
|
|
114
|
+
PACKAGE_ROOT,
|
|
115
|
+
getApiPort,
|
|
116
|
+
getUiPort,
|
|
117
|
+
isRelayApiRunning,
|
|
118
|
+
startRelayServeForeground,
|
|
119
|
+
startRelayServeBackground,
|
|
120
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const IR_FILES = [
|
|
5
|
+
'relay_context.md',
|
|
6
|
+
'compile_brief.md',
|
|
7
|
+
'project.md',
|
|
8
|
+
'current_task.md',
|
|
9
|
+
'decisions.md',
|
|
10
|
+
'failures.md',
|
|
11
|
+
'architecture.md',
|
|
12
|
+
'AGENT_BOOTSTRAP.md',
|
|
13
|
+
'memory.json',
|
|
14
|
+
'config.json',
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const SKIP_DIRS = new Set(['node_modules', '.git']);
|
|
18
|
+
|
|
19
|
+
function getRelayDir(workspacePath) {
|
|
20
|
+
return path.join(path.resolve(workspacePath), '.relay');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function assertRelayPath(relayDir, relPath) {
|
|
24
|
+
const normalized = path.normalize(relPath).replace(/^(\.\.(\/|\\|$))+/, '');
|
|
25
|
+
const full = path.resolve(relayDir, normalized);
|
|
26
|
+
if (!full.startsWith(path.resolve(relayDir))) {
|
|
27
|
+
throw new Error('Path escapes .relay directory');
|
|
28
|
+
}
|
|
29
|
+
return { full, rel: normalized.replace(/\\/g, '/') };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function listRelayFiles(workspacePath, subPath = '') {
|
|
33
|
+
const relayDir = getRelayDir(workspacePath);
|
|
34
|
+
if (!fs.existsSync(relayDir)) {
|
|
35
|
+
throw new Error('Workspace not registered. Run relay init first.');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const { full, rel } = assertRelayPath(relayDir, subPath || '.');
|
|
39
|
+
if (!fs.existsSync(full)) return { path: rel === '.' ? '' : rel, entries: [] };
|
|
40
|
+
|
|
41
|
+
const stat = fs.statSync(full);
|
|
42
|
+
if (!stat.isDirectory()) {
|
|
43
|
+
return { path: rel === '.' ? '' : rel, entries: [] };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const entries = fs
|
|
47
|
+
.readdirSync(full, { withFileTypes: true })
|
|
48
|
+
.filter((e) => !e.name.startsWith('.') || e.name === '.relay-hook-continuing')
|
|
49
|
+
.filter((e) => !SKIP_DIRS.has(e.name))
|
|
50
|
+
.map((e) => {
|
|
51
|
+
const childRel = rel === '.' || !rel ? e.name : `${rel}/${e.name}`;
|
|
52
|
+
const childFull = path.join(full, e.name);
|
|
53
|
+
const childStat = fs.statSync(childFull);
|
|
54
|
+
return {
|
|
55
|
+
name: e.name,
|
|
56
|
+
path: childRel.replace(/\\/g, '/'),
|
|
57
|
+
type: childStat.isDirectory() ? 'dir' : 'file',
|
|
58
|
+
size: childStat.isFile() ? childStat.size : null,
|
|
59
|
+
updatedAt: childStat.mtime.toISOString(),
|
|
60
|
+
};
|
|
61
|
+
})
|
|
62
|
+
.sort((a, b) => {
|
|
63
|
+
if (a.type !== b.type) return a.type === 'dir' ? -1 : 1;
|
|
64
|
+
return a.name.localeCompare(b.name);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
return { path: rel === '.' ? '' : rel, entries };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function readRelayFile(workspacePath, relPath) {
|
|
71
|
+
const relayDir = getRelayDir(workspacePath);
|
|
72
|
+
if (!fs.existsSync(relayDir)) {
|
|
73
|
+
throw new Error('Workspace not registered. Run relay init first.');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const { full, rel } = assertRelayPath(relayDir, relPath);
|
|
77
|
+
if (!fs.existsSync(full) || !fs.statSync(full).isFile()) {
|
|
78
|
+
throw new Error(`File not found: ${rel}`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const stat = fs.statSync(full);
|
|
82
|
+
const content = fs.readFileSync(full, 'utf-8');
|
|
83
|
+
return {
|
|
84
|
+
path: rel,
|
|
85
|
+
content,
|
|
86
|
+
size: stat.size,
|
|
87
|
+
updatedAt: stat.mtime.toISOString(),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function writeRelayFile(workspacePath, relPath, content) {
|
|
92
|
+
const relayDir = getRelayDir(workspacePath);
|
|
93
|
+
if (!fs.existsSync(relayDir)) {
|
|
94
|
+
throw new Error('Workspace not registered. Run relay init first.');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const { full, rel } = assertRelayPath(relayDir, relPath);
|
|
98
|
+
fs.mkdirSync(path.dirname(full), { recursive: true });
|
|
99
|
+
fs.writeFileSync(full, content, 'utf-8');
|
|
100
|
+
const stat = fs.statSync(full);
|
|
101
|
+
return {
|
|
102
|
+
path: rel,
|
|
103
|
+
size: stat.size,
|
|
104
|
+
updatedAt: stat.mtime.toISOString(),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function buildRelayTree(workspacePath, maxDepth = 3) {
|
|
109
|
+
const relayDir = getRelayDir(workspacePath);
|
|
110
|
+
if (!fs.existsSync(relayDir)) return [];
|
|
111
|
+
|
|
112
|
+
function walk(dir, rel, depth) {
|
|
113
|
+
if (depth > maxDepth) return [];
|
|
114
|
+
let entries;
|
|
115
|
+
try {
|
|
116
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
117
|
+
} catch (_) {
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return entries
|
|
122
|
+
.filter((e) => !SKIP_DIRS.has(e.name))
|
|
123
|
+
.filter((e) => !e.name.startsWith('.') || IR_FILES.includes(e.name))
|
|
124
|
+
.map((e) => {
|
|
125
|
+
const childRel = rel ? `${rel}/${e.name}` : e.name;
|
|
126
|
+
const childFull = path.join(dir, e.name);
|
|
127
|
+
if (e.isDirectory()) {
|
|
128
|
+
return {
|
|
129
|
+
name: e.name,
|
|
130
|
+
path: childRel.replace(/\\/g, '/'),
|
|
131
|
+
type: 'dir',
|
|
132
|
+
children: walk(childFull, childRel, depth + 1),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const stat = fs.statSync(childFull);
|
|
136
|
+
return {
|
|
137
|
+
name: e.name,
|
|
138
|
+
path: childRel.replace(/\\/g, '/'),
|
|
139
|
+
type: 'file',
|
|
140
|
+
size: stat.size,
|
|
141
|
+
updatedAt: stat.mtime.toISOString(),
|
|
142
|
+
};
|
|
143
|
+
})
|
|
144
|
+
.sort((a, b) => {
|
|
145
|
+
if (a.type !== b.type) return a.type === 'dir' ? -1 : 1;
|
|
146
|
+
return a.name.localeCompare(b.name);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return walk(relayDir, '', 0);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function readIrFiles(workspacePath) {
|
|
154
|
+
const relayDir = getRelayDir(workspacePath);
|
|
155
|
+
const out = {};
|
|
156
|
+
for (const name of IR_FILES) {
|
|
157
|
+
const full = path.join(relayDir, name);
|
|
158
|
+
if (fs.existsSync(full) && fs.statSync(full).isFile()) {
|
|
159
|
+
out[name] = fs.readFileSync(full, 'utf-8');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return out;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
module.exports = {
|
|
166
|
+
IR_FILES,
|
|
167
|
+
getRelayDir,
|
|
168
|
+
listRelayFiles,
|
|
169
|
+
readRelayFile,
|
|
170
|
+
writeRelayFile,
|
|
171
|
+
buildRelayTree,
|
|
172
|
+
readIrFiles,
|
|
173
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { spawn, execSync } = require('child_process');
|
|
4
|
+
|
|
5
|
+
const PACKAGE_ROOT = path.join(__dirname, '..', '..');
|
|
6
|
+
const UI_DIR = path.join(PACKAGE_ROOT, 'mission-control');
|
|
7
|
+
|
|
8
|
+
function getUiPort() {
|
|
9
|
+
return Number(process.env.RELAY_UI_PORT) || 6374;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getApiPort() {
|
|
13
|
+
return Number(process.env.RELAY_PORT) || 3001;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getDashboardBaseUrl() {
|
|
17
|
+
return `http://localhost:${getUiPort()}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function npmCommand() {
|
|
21
|
+
return process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function ensureMissionControlDeps(options = {}) {
|
|
25
|
+
if (!fs.existsSync(UI_DIR)) {
|
|
26
|
+
throw new Error('Mission Control UI not found in relay-os package');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const nodeModules = path.join(UI_DIR, 'node_modules');
|
|
30
|
+
if (fs.existsSync(nodeModules) && !options.force) return UI_DIR;
|
|
31
|
+
|
|
32
|
+
if (options.quiet) {
|
|
33
|
+
execSync(`${npmCommand()} install`, { cwd: UI_DIR, stdio: 'ignore', shell: process.platform === 'win32' });
|
|
34
|
+
} else {
|
|
35
|
+
console.log('[relay] Installing Mission Control UI dependencies (first run)…');
|
|
36
|
+
execSync(`${npmCommand()} install`, { cwd: UI_DIR, stdio: 'inherit', shell: process.platform === 'win32' });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return UI_DIR;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function startMissionControlUi(options = {}) {
|
|
43
|
+
ensureMissionControlDeps(options);
|
|
44
|
+
const uiPort = options.uiPort || getUiPort();
|
|
45
|
+
const apiPort = options.apiPort || getApiPort();
|
|
46
|
+
|
|
47
|
+
const env = {
|
|
48
|
+
...process.env,
|
|
49
|
+
NEXT_PUBLIC_RELAY_URL: `http://localhost:${apiPort}`,
|
|
50
|
+
PORT: String(uiPort),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return spawn(npmCommand(), ['run', 'dev'], {
|
|
54
|
+
cwd: UI_DIR,
|
|
55
|
+
stdio: 'inherit',
|
|
56
|
+
env,
|
|
57
|
+
shell: process.platform === 'win32',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = {
|
|
62
|
+
UI_DIR,
|
|
63
|
+
getUiPort,
|
|
64
|
+
getApiPort,
|
|
65
|
+
getDashboardBaseUrl,
|
|
66
|
+
ensureMissionControlDeps,
|
|
67
|
+
startMissionControlUi,
|
|
68
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
function normalizeTs(value) {
|
|
2
|
+
if (value == null || value === '') return null;
|
|
3
|
+
|
|
4
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
5
|
+
const date = new Date(value);
|
|
6
|
+
return Number.isNaN(date.getTime()) ? null : date.toISOString();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const str = String(value).trim();
|
|
10
|
+
if (!str) return null;
|
|
11
|
+
|
|
12
|
+
const parsed = Date.parse(str);
|
|
13
|
+
if (!Number.isNaN(parsed)) return new Date(parsed).toISOString();
|
|
14
|
+
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const KIND_ORDER = {
|
|
19
|
+
message: 0,
|
|
20
|
+
code_edit: 1,
|
|
21
|
+
artifact: 2,
|
|
22
|
+
checkpoint: 3,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const REDACTED_RE = /\[REDACTED\]/i;
|
|
26
|
+
|
|
27
|
+
function isRedactedContent(text) {
|
|
28
|
+
if (text == null) return false;
|
|
29
|
+
const s = String(text).trim();
|
|
30
|
+
if (!s) return false;
|
|
31
|
+
if (s === '[REDACTED]') return true;
|
|
32
|
+
if (/^\[REDACTED\]\s*$/.test(s)) return true;
|
|
33
|
+
const stripped = s.replace(/\[REDACTED\]/gi, '').trim();
|
|
34
|
+
if (!stripped && REDACTED_RE.test(s)) return true;
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function shouldSkipEvent(event) {
|
|
39
|
+
if (!event) return true;
|
|
40
|
+
if (event.kind === 'message' && isRedactedContent(event.content)) return true;
|
|
41
|
+
if (event.kind === 'artifact' && isRedactedContent(event.content)) return true;
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function compareEvents(a, b) {
|
|
46
|
+
const ta = Date.parse(a.ts || '') || 0;
|
|
47
|
+
const tb = Date.parse(b.ts || '') || 0;
|
|
48
|
+
if (ta !== tb) return ta - tb;
|
|
49
|
+
|
|
50
|
+
const ka = KIND_ORDER[a.kind] ?? 9;
|
|
51
|
+
const kb = KIND_ORDER[b.kind] ?? 9;
|
|
52
|
+
if (ka !== kb) return ka - kb;
|
|
53
|
+
|
|
54
|
+
if (a.role === 'user' && b.role !== 'user') return -1;
|
|
55
|
+
if (a.role !== 'user' && b.role === 'user') return 1;
|
|
56
|
+
|
|
57
|
+
return String(a.source || '').localeCompare(String(b.source || ''));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function buildGlobalTimeline(agentsMemory = {}) {
|
|
61
|
+
const merged = [];
|
|
62
|
+
|
|
63
|
+
for (const [agentName, agentData] of Object.entries(agentsMemory || {})) {
|
|
64
|
+
if (!agentData || agentData.status !== 'connected') continue;
|
|
65
|
+
|
|
66
|
+
for (const event of agentData.events || []) {
|
|
67
|
+
if (shouldSkipEvent(event)) continue;
|
|
68
|
+
merged.push({
|
|
69
|
+
...event,
|
|
70
|
+
source: event.source || agentName,
|
|
71
|
+
ts: normalizeTs(event.ts) || event.ts || null,
|
|
72
|
+
kind: event.kind || (event.role ? 'message' : 'message'),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
merged.sort(compareEvents);
|
|
78
|
+
return merged;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function makeUnifiedDiff(oldStr, newStr, filePath) {
|
|
82
|
+
const oldLines = String(oldStr ?? '').split('\n');
|
|
83
|
+
const newLines = String(newStr ?? '').split('\n');
|
|
84
|
+
const header = `--- a/${filePath || 'file'}\n+++ b/${filePath || 'file'}`;
|
|
85
|
+
const body = [
|
|
86
|
+
`@@ -1,${oldLines.length} +1,${newLines.length} @@`,
|
|
87
|
+
...oldLines.map(line => `-${line}`),
|
|
88
|
+
...newLines.map(line => `+${line}`),
|
|
89
|
+
];
|
|
90
|
+
return `${header}\n${body.join('\n')}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
module.exports = {
|
|
94
|
+
normalizeTs,
|
|
95
|
+
compareEvents,
|
|
96
|
+
buildGlobalTimeline,
|
|
97
|
+
makeUnifiedDiff,
|
|
98
|
+
isRedactedContent,
|
|
99
|
+
shouldSkipEvent,
|
|
100
|
+
KIND_ORDER,
|
|
101
|
+
};
|