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,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
|
+
import { useRelay } from '@/lib/RelayContext';
|
|
6
|
+
import styles from './WorkspaceRail.module.css';
|
|
7
|
+
|
|
8
|
+
export default function WorkspaceRail() {
|
|
9
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
10
|
+
const router = useRouter();
|
|
11
|
+
const { workspaces, selectWorkspace } = useRelay();
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setIsExpanded(localStorage.getItem('relay_rail_expanded') === '1');
|
|
15
|
+
}, []);
|
|
16
|
+
|
|
17
|
+
const toggle = () => {
|
|
18
|
+
setIsExpanded((prev) => {
|
|
19
|
+
const next = !prev;
|
|
20
|
+
localStorage.setItem('relay_rail_expanded', next ? '1' : '0');
|
|
21
|
+
return next;
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<nav className={`${styles.rail} ${isExpanded ? styles.expanded : ''}`}>
|
|
27
|
+
<div className={styles.topSection}>
|
|
28
|
+
<div className={styles.itemWrapper} onClick={toggle} title={isExpanded ? 'Collapse' : 'Expand'}>
|
|
29
|
+
<div className={styles.actionIcon}>{isExpanded ? '«' : '☰'}</div>
|
|
30
|
+
{isExpanded && <span className={styles.itemText}>Collapse</span>}
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
{isExpanded && <div className={styles.sectionTitle}>WORKSPACES</div>}
|
|
34
|
+
|
|
35
|
+
{workspaces.map((ws) => (
|
|
36
|
+
<div
|
|
37
|
+
key={ws.id}
|
|
38
|
+
className={`${styles.itemWrapper} ${ws.active ? styles.activeWrapper : ''}`}
|
|
39
|
+
onClick={() => selectWorkspace(ws.id)}
|
|
40
|
+
title={ws.localPath}
|
|
41
|
+
>
|
|
42
|
+
<div className={`${styles.workspaceIcon} ${ws.active ? styles.active : ''}`}>
|
|
43
|
+
{ws.name}
|
|
44
|
+
</div>
|
|
45
|
+
{isExpanded && <span className={styles.itemText}>{ws.full}</span>}
|
|
46
|
+
</div>
|
|
47
|
+
))}
|
|
48
|
+
|
|
49
|
+
<div className={styles.itemWrapper} onClick={() => router.push('/onboarding')}>
|
|
50
|
+
<div className={styles.addWorkspace}>+</div>
|
|
51
|
+
{isExpanded && <span className={styles.itemText}>Add Workspace</span>}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</nav>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, {
|
|
4
|
+
createContext,
|
|
5
|
+
useCallback,
|
|
6
|
+
useContext,
|
|
7
|
+
useEffect,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
} from 'react';
|
|
12
|
+
import {
|
|
13
|
+
AGENTS,
|
|
14
|
+
AgentId,
|
|
15
|
+
RelayDashboard,
|
|
16
|
+
RelayDashboardIr,
|
|
17
|
+
RelayMemory,
|
|
18
|
+
RelayProject,
|
|
19
|
+
connectAgent as apiConnect,
|
|
20
|
+
getMemory,
|
|
21
|
+
getProject,
|
|
22
|
+
getProjectDashboard,
|
|
23
|
+
listProjects,
|
|
24
|
+
pingRelay,
|
|
25
|
+
registerWorkspace,
|
|
26
|
+
sendHandshake,
|
|
27
|
+
syncProject,
|
|
28
|
+
syncWorkspace,
|
|
29
|
+
} from './relay';
|
|
30
|
+
import {
|
|
31
|
+
Workspace,
|
|
32
|
+
WORKSPACES_CHANGED_EVENT,
|
|
33
|
+
badgeFromName,
|
|
34
|
+
getActiveWorkspace,
|
|
35
|
+
loadWorkspaces,
|
|
36
|
+
saveWorkspaces,
|
|
37
|
+
} from './workspaces';
|
|
38
|
+
|
|
39
|
+
export type AgentStatus = 'idle' | 'handshaking' | 'connected' | 'error';
|
|
40
|
+
|
|
41
|
+
export interface AgentState {
|
|
42
|
+
id: AgentId;
|
|
43
|
+
status: AgentStatus;
|
|
44
|
+
eventCount: number;
|
|
45
|
+
error?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface RelayContextValue {
|
|
49
|
+
workspaces: Workspace[];
|
|
50
|
+
activeWorkspace: Workspace | null;
|
|
51
|
+
activeProject: RelayProject | null;
|
|
52
|
+
relayOnline: boolean;
|
|
53
|
+
memory: RelayMemory | null;
|
|
54
|
+
dashboard: RelayDashboard | null;
|
|
55
|
+
agentStates: AgentState[];
|
|
56
|
+
syncing: boolean;
|
|
57
|
+
addWorkspace: (ws: Omit<Workspace, 'active'>) => void;
|
|
58
|
+
selectWorkspace: (id: string) => void;
|
|
59
|
+
removeWorkspace: (id: string) => void;
|
|
60
|
+
registerAndAdd: (ws: Omit<Workspace, 'active'>) => Promise<void>;
|
|
61
|
+
connect: (agent: AgentId) => Promise<void>;
|
|
62
|
+
refresh: (opts?: { full?: boolean }) => Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const RelayContext = createContext<RelayContextValue | null>(null);
|
|
66
|
+
|
|
67
|
+
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
|
|
68
|
+
|
|
69
|
+
function memoryFingerprint(mem: RelayMemory | null): string {
|
|
70
|
+
if (!mem) return '';
|
|
71
|
+
return `${mem.lastSync || ''}:${mem.timeline?.length || 0}`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function dashboardFingerprint(d: RelayDashboard | null): string {
|
|
75
|
+
if (!d) return '';
|
|
76
|
+
const ir = d.ir || ({} as RelayDashboardIr);
|
|
77
|
+
return [
|
|
78
|
+
d.lastSync || '',
|
|
79
|
+
d.handoff?.markdown?.length || 0,
|
|
80
|
+
ir.currentTask?.length || 0,
|
|
81
|
+
ir.decisions?.length || 0,
|
|
82
|
+
ir.failures?.length || 0,
|
|
83
|
+
ir.project?.length || 0,
|
|
84
|
+
].join(':');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function RelayProvider({ children }: { children: React.ReactNode }) {
|
|
88
|
+
const [workspaces, setWorkspaces] = useState<Workspace[]>([]);
|
|
89
|
+
const [relayOnline, setRelayOnline] = useState(false);
|
|
90
|
+
const [memory, setMemory] = useState<RelayMemory | null>(null);
|
|
91
|
+
const [dashboard, setDashboard] = useState<RelayDashboard | null>(null);
|
|
92
|
+
const [activeProject, setActiveProject] = useState<RelayProject | null>(null);
|
|
93
|
+
const [syncing, setSyncing] = useState(false);
|
|
94
|
+
const [pending, setPending] = useState<
|
|
95
|
+
Partial<Record<AgentId, { status: 'handshaking' | 'error'; error?: string }>>
|
|
96
|
+
>({});
|
|
97
|
+
|
|
98
|
+
const activeWorkspace = useMemo(() => getActiveWorkspace(workspaces), [workspaces]);
|
|
99
|
+
const activePath = activeWorkspace?.localPath || null;
|
|
100
|
+
const projectId = activeWorkspace?.relayProjectId || activeProject?.id || null;
|
|
101
|
+
|
|
102
|
+
const lastMemFp = useRef('');
|
|
103
|
+
const lastDashFp = useRef('');
|
|
104
|
+
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const loaded = loadWorkspaces();
|
|
107
|
+
setWorkspaces(loaded);
|
|
108
|
+
saveWorkspaces(loaded);
|
|
109
|
+
const reload = () => setWorkspaces(loadWorkspaces());
|
|
110
|
+
window.addEventListener('storage', reload);
|
|
111
|
+
window.addEventListener(WORKSPACES_CHANGED_EVENT, reload);
|
|
112
|
+
return () => {
|
|
113
|
+
window.removeEventListener('storage', reload);
|
|
114
|
+
window.removeEventListener(WORKSPACES_CHANGED_EVENT, reload);
|
|
115
|
+
};
|
|
116
|
+
}, []);
|
|
117
|
+
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
let alive = true;
|
|
120
|
+
const check = async () => {
|
|
121
|
+
const ok = await pingRelay();
|
|
122
|
+
if (alive) setRelayOnline(ok);
|
|
123
|
+
};
|
|
124
|
+
check();
|
|
125
|
+
const t = setInterval(check, 10000);
|
|
126
|
+
return () => {
|
|
127
|
+
alive = false;
|
|
128
|
+
clearInterval(t);
|
|
129
|
+
};
|
|
130
|
+
}, []);
|
|
131
|
+
|
|
132
|
+
const resolveProject = useCallback(async (path: string) => {
|
|
133
|
+
try {
|
|
134
|
+
const { projects } = await listProjects();
|
|
135
|
+
return projects.find((p) => p.workspacePath === path) || null;
|
|
136
|
+
} catch {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
}, []);
|
|
140
|
+
|
|
141
|
+
const refresh = useCallback(
|
|
142
|
+
async (opts: { full?: boolean } = {}) => {
|
|
143
|
+
if (!activePath) return;
|
|
144
|
+
setSyncing(true);
|
|
145
|
+
try {
|
|
146
|
+
let project = activeProject;
|
|
147
|
+
if (!project) {
|
|
148
|
+
project = await resolveProject(activePath);
|
|
149
|
+
if (project) setActiveProject(project);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (opts.full) {
|
|
153
|
+
if (project?.id) await syncProject(project.id);
|
|
154
|
+
else await syncWorkspace(activePath);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (project?.id) {
|
|
158
|
+
const { dashboard: d } = await getProjectDashboard(project.id, { limit: 200 });
|
|
159
|
+
const { project: fullProject } = await getProject(project.id);
|
|
160
|
+
setActiveProject(fullProject);
|
|
161
|
+
const fp = dashboardFingerprint(d);
|
|
162
|
+
if (fp !== lastDashFp.current) {
|
|
163
|
+
lastDashFp.current = fp;
|
|
164
|
+
setDashboard(d);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const mem = await getMemory(activePath);
|
|
169
|
+
const memFp = memoryFingerprint(mem);
|
|
170
|
+
if (memFp !== lastMemFp.current) {
|
|
171
|
+
lastMemFp.current = memFp;
|
|
172
|
+
setMemory(mem);
|
|
173
|
+
}
|
|
174
|
+
} catch {
|
|
175
|
+
/* keep last state — no flash to empty */
|
|
176
|
+
} finally {
|
|
177
|
+
setSyncing(false);
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
[activePath, activeProject, resolveProject],
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
const refreshRef = useRef(refresh);
|
|
184
|
+
refreshRef.current = refresh;
|
|
185
|
+
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
setPending({});
|
|
188
|
+
if (!activePath) {
|
|
189
|
+
setMemory(null);
|
|
190
|
+
setDashboard(null);
|
|
191
|
+
setActiveProject(null);
|
|
192
|
+
lastMemFp.current = '';
|
|
193
|
+
lastDashFp.current = '';
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
let cancelled = false;
|
|
198
|
+
(async () => {
|
|
199
|
+
const project = await resolveProject(activePath);
|
|
200
|
+
if (cancelled) return;
|
|
201
|
+
if (project) setActiveProject(project);
|
|
202
|
+
lastMemFp.current = '';
|
|
203
|
+
lastDashFp.current = '';
|
|
204
|
+
await refreshRef.current({ full: true });
|
|
205
|
+
})();
|
|
206
|
+
|
|
207
|
+
const t = setInterval(() => refreshRef.current({ full: false }), 12000);
|
|
208
|
+
return () => {
|
|
209
|
+
cancelled = true;
|
|
210
|
+
clearInterval(t);
|
|
211
|
+
};
|
|
212
|
+
}, [activePath, resolveProject]);
|
|
213
|
+
|
|
214
|
+
const addWorkspace = useCallback((ws: Omit<Workspace, 'active'>) => {
|
|
215
|
+
setWorkspaces((prev) => {
|
|
216
|
+
const others = prev.filter((w) => w.id !== ws.id).map((w) => ({ ...w, active: false }));
|
|
217
|
+
const next = [...others, { ...ws, active: true }];
|
|
218
|
+
saveWorkspaces(next);
|
|
219
|
+
return next;
|
|
220
|
+
});
|
|
221
|
+
}, []);
|
|
222
|
+
|
|
223
|
+
const registerAndAdd = useCallback(
|
|
224
|
+
async (ws: Omit<Workspace, 'active'>) => {
|
|
225
|
+
const { project } = await registerWorkspace(ws.localPath, ws.full);
|
|
226
|
+
addWorkspace({
|
|
227
|
+
...ws,
|
|
228
|
+
relayProjectId: project.id,
|
|
229
|
+
name: badgeFromName(project.name || ws.full),
|
|
230
|
+
full: project.name || ws.full,
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
[addWorkspace],
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
const selectWorkspace = useCallback((id: string) => {
|
|
237
|
+
setWorkspaces((prev) => {
|
|
238
|
+
const next = prev.map((w) => ({ ...w, active: w.id === id }));
|
|
239
|
+
saveWorkspaces(next);
|
|
240
|
+
return next;
|
|
241
|
+
});
|
|
242
|
+
}, []);
|
|
243
|
+
|
|
244
|
+
const removeWorkspace = useCallback((id: string) => {
|
|
245
|
+
setWorkspaces((prev) => {
|
|
246
|
+
const remaining = prev.filter((w) => w.id !== id);
|
|
247
|
+
if (remaining.length && !remaining.some((w) => w.active)) remaining[0].active = true;
|
|
248
|
+
saveWorkspaces(remaining);
|
|
249
|
+
return remaining;
|
|
250
|
+
});
|
|
251
|
+
}, []);
|
|
252
|
+
|
|
253
|
+
const connect = useCallback(
|
|
254
|
+
async (agent: AgentId) => {
|
|
255
|
+
if (!activePath) throw new Error('Select a workspace first.');
|
|
256
|
+
setPending((p) => ({ ...p, [agent]: { status: 'handshaking' } }));
|
|
257
|
+
try {
|
|
258
|
+
await sendHandshake(activePath, agent, projectId || undefined);
|
|
259
|
+
await sleep(2000);
|
|
260
|
+
await apiConnect(activePath, agent, projectId || undefined);
|
|
261
|
+
setPending((p) => {
|
|
262
|
+
const next = { ...p };
|
|
263
|
+
delete next[agent];
|
|
264
|
+
return next;
|
|
265
|
+
});
|
|
266
|
+
await refresh({ full: true });
|
|
267
|
+
} catch (err) {
|
|
268
|
+
const message = err instanceof Error ? err.message : 'Connection failed';
|
|
269
|
+
setPending((p) => ({ ...p, [agent]: { status: 'error', error: message } }));
|
|
270
|
+
throw err;
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
[activePath, projectId, refresh],
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
const agentStates = useMemo<AgentState[]>(() => {
|
|
277
|
+
return AGENTS.map(({ id }) => {
|
|
278
|
+
const p = pending[id];
|
|
279
|
+
const mem = memory?.agents?.[id];
|
|
280
|
+
const dashAgent = dashboard?.agents?.find((a) => a.name === id);
|
|
281
|
+
const eventCount = mem?.eventCount ?? dashAgent?.eventCount ?? 0;
|
|
282
|
+
if (p) return { id, status: p.status, eventCount, error: p.error };
|
|
283
|
+
if (mem?.status === 'connected' || dashAgent?.status === 'connected') {
|
|
284
|
+
return { id, status: 'connected', eventCount };
|
|
285
|
+
}
|
|
286
|
+
return { id, status: 'idle', eventCount: 0 };
|
|
287
|
+
});
|
|
288
|
+
}, [pending, memory, dashboard]);
|
|
289
|
+
|
|
290
|
+
const value: RelayContextValue = {
|
|
291
|
+
workspaces,
|
|
292
|
+
activeWorkspace,
|
|
293
|
+
activeProject,
|
|
294
|
+
relayOnline,
|
|
295
|
+
memory,
|
|
296
|
+
dashboard,
|
|
297
|
+
agentStates,
|
|
298
|
+
syncing,
|
|
299
|
+
addWorkspace,
|
|
300
|
+
selectWorkspace,
|
|
301
|
+
removeWorkspace,
|
|
302
|
+
registerAndAdd,
|
|
303
|
+
connect,
|
|
304
|
+
refresh,
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
return <RelayContext.Provider value={value}>{children}</RelayContext.Provider>;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export function useRelay(): RelayContextValue {
|
|
311
|
+
const ctx = useContext(RelayContext);
|
|
312
|
+
if (!ctx) throw new Error('useRelay must be used within <RelayProvider>');
|
|
313
|
+
return ctx;
|
|
314
|
+
}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
// Typed client for the Relay companion backend (backend/server.js).
|
|
2
|
+
|
|
3
|
+
export const RELAY_URL =
|
|
4
|
+
process.env.NEXT_PUBLIC_RELAY_URL || 'http://localhost:3001';
|
|
5
|
+
|
|
6
|
+
export type AgentId =
|
|
7
|
+
| 'Antigravity'
|
|
8
|
+
| 'Codex'
|
|
9
|
+
| 'Claude Code'
|
|
10
|
+
| 'GitHub Copilot'
|
|
11
|
+
| 'Cursor';
|
|
12
|
+
|
|
13
|
+
export interface AgentMeta {
|
|
14
|
+
id: AgentId;
|
|
15
|
+
label: string;
|
|
16
|
+
logo: string;
|
|
17
|
+
desc: string;
|
|
18
|
+
accent: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const AGENTS: AgentMeta[] = [
|
|
22
|
+
{ id: 'Claude Code', label: 'Claude', logo: '/logos/Claude.png', desc: 'Anthropic Claude Code CLI', accent: '#fcd34d' },
|
|
23
|
+
{ id: 'Codex', label: 'Codex', logo: '/logos/Codex.png', desc: 'OpenAI Codex CLI', accent: '#6ee7b7' },
|
|
24
|
+
{ id: 'GitHub Copilot', label: 'Copilot', logo: '/logos/github-copilot.png', desc: 'GitHub Copilot sessions', accent: '#93c5fd' },
|
|
25
|
+
{ id: 'Cursor', label: 'Cursor', logo: '/logos/cursor.png', desc: 'Cursor agent transcripts', accent: '#f9a8d4' },
|
|
26
|
+
{ id: 'Antigravity', label: 'Antigravity', logo: '/logos/antigravity.png', desc: 'Antigravity IDE agent', accent: '#a5b4fc' },
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
export const AGENT_BY_ID = Object.fromEntries(AGENTS.map((a) => [a.id, a])) as Record<AgentId, AgentMeta>;
|
|
30
|
+
|
|
31
|
+
export type EventKind = 'message' | 'code_edit' | 'artifact';
|
|
32
|
+
|
|
33
|
+
export interface RelayEvent {
|
|
34
|
+
source?: string;
|
|
35
|
+
role?: 'user' | 'assistant' | string;
|
|
36
|
+
kind?: EventKind;
|
|
37
|
+
content?: string;
|
|
38
|
+
file?: string;
|
|
39
|
+
path?: string;
|
|
40
|
+
summary?: string;
|
|
41
|
+
diff?: string;
|
|
42
|
+
ts?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface RelayArtifact {
|
|
46
|
+
name: string;
|
|
47
|
+
content: string;
|
|
48
|
+
metadata?: string;
|
|
49
|
+
source?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface RelayTask {
|
|
53
|
+
id: string;
|
|
54
|
+
preview: string;
|
|
55
|
+
source?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface RelayMessage {
|
|
59
|
+
type?: string;
|
|
60
|
+
payload?: unknown;
|
|
61
|
+
source?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface RelayAgentMemory {
|
|
65
|
+
status: 'connected' | 'handshaking' | 'idle' | 'error';
|
|
66
|
+
transcriptPath?: string;
|
|
67
|
+
eventCount?: number;
|
|
68
|
+
events?: RelayEvent[];
|
|
69
|
+
artifacts?: RelayArtifact[];
|
|
70
|
+
tasks?: RelayTask[];
|
|
71
|
+
messages?: RelayMessage[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface RelayMemory {
|
|
75
|
+
workspace: string;
|
|
76
|
+
lastSync: string | null;
|
|
77
|
+
agents: Partial<Record<AgentId, RelayAgentMemory>>;
|
|
78
|
+
timeline: RelayEvent[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface RelayProjectStats {
|
|
82
|
+
totalEvents: number;
|
|
83
|
+
lastSync: string | null;
|
|
84
|
+
connectedAgents: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface RelayProject {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
workspacePath: string;
|
|
91
|
+
apiKey?: string;
|
|
92
|
+
createdAt?: string;
|
|
93
|
+
updatedAt?: string;
|
|
94
|
+
stats?: RelayProjectStats;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface RelayDashboardIr {
|
|
98
|
+
project: string;
|
|
99
|
+
currentTask: string;
|
|
100
|
+
decisions: string;
|
|
101
|
+
failures: string;
|
|
102
|
+
architecture: string;
|
|
103
|
+
compileBrief: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface RelayDashboard {
|
|
107
|
+
workspace: string;
|
|
108
|
+
lastSync: string | null;
|
|
109
|
+
stats: {
|
|
110
|
+
totalEvents: number;
|
|
111
|
+
byKind: Record<string, number>;
|
|
112
|
+
bySource: Record<string, number>;
|
|
113
|
+
connectedAgents: number;
|
|
114
|
+
};
|
|
115
|
+
agents: { name: string; status: string; eventCount: number; transcriptPath?: string | null }[];
|
|
116
|
+
handoff: { markdown: string; updatedAt?: string | null };
|
|
117
|
+
ir: RelayDashboardIr;
|
|
118
|
+
recentEdits: RelayEvent[];
|
|
119
|
+
activity: { total: number; offset: number; limit: number; events: RelayEvent[] };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface MissionChatMessage {
|
|
123
|
+
id: string;
|
|
124
|
+
author: string;
|
|
125
|
+
agent?: AgentId | null;
|
|
126
|
+
mentions?: AgentId[];
|
|
127
|
+
role: 'user' | 'system';
|
|
128
|
+
text: string;
|
|
129
|
+
ts: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface MissionMeta {
|
|
133
|
+
version: number;
|
|
134
|
+
collaborators: string[];
|
|
135
|
+
chat: MissionChatMessage[];
|
|
136
|
+
updatedAt?: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async function relayFetch<T>(path: string, init?: RequestInit): Promise<T> {
|
|
140
|
+
let res: Response;
|
|
141
|
+
try {
|
|
142
|
+
res = await fetch(`${RELAY_URL}${path}`, {
|
|
143
|
+
...init,
|
|
144
|
+
headers: { 'Content-Type': 'application/json', ...(init?.headers || {}) },
|
|
145
|
+
});
|
|
146
|
+
} catch {
|
|
147
|
+
throw new Error(`Relay backend offline at ${RELAY_URL}. Start it with: relay serve`);
|
|
148
|
+
}
|
|
149
|
+
let data: Record<string, unknown> = {};
|
|
150
|
+
try {
|
|
151
|
+
data = await res.json();
|
|
152
|
+
} catch {
|
|
153
|
+
/* non-JSON */
|
|
154
|
+
}
|
|
155
|
+
if (!res.ok || data.ok === false) {
|
|
156
|
+
throw new Error((data.error as string) || `Relay request failed (${res.status})`);
|
|
157
|
+
}
|
|
158
|
+
return data as T;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function listProjects() {
|
|
162
|
+
return relayFetch<{ ok: true; projects: RelayProject[] }>('/api/projects');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function createProject(workspacePath: string, name?: string) {
|
|
166
|
+
return relayFetch<{ ok: true; project: RelayProject }>('/api/projects', {
|
|
167
|
+
method: 'POST',
|
|
168
|
+
body: JSON.stringify({ workspacePath, name }),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function getProject(projectId: string) {
|
|
173
|
+
return relayFetch<{ ok: true; project: RelayProject }>(`/api/projects/${projectId}`);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function updateProjectName(projectId: string, name: string) {
|
|
177
|
+
return relayFetch<{ ok: true; project: RelayProject }>(`/api/projects/${projectId}`, {
|
|
178
|
+
method: 'PATCH',
|
|
179
|
+
body: JSON.stringify({ name }),
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function registerWorkspace(workspacePath: string, name?: string) {
|
|
184
|
+
return relayFetch<{ ok: true; project: RelayProject }>('/api/register', {
|
|
185
|
+
method: 'POST',
|
|
186
|
+
body: JSON.stringify({ workspacePath, name }),
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function sendHandshake(workspacePath: string, agent: AgentId, projectId?: string) {
|
|
191
|
+
return relayFetch<{ ok: true; token: string; message: string }>('/api/handshake', {
|
|
192
|
+
method: 'POST',
|
|
193
|
+
body: JSON.stringify({ workspacePath, agent, projectId }),
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function connectAgent(workspacePath: string, agent: AgentId, projectId?: string) {
|
|
198
|
+
return relayFetch<{ ok: true; transcriptPath: string; eventCount: number; events: RelayEvent[] }>(
|
|
199
|
+
'/api/connect',
|
|
200
|
+
{ method: 'POST', body: JSON.stringify({ workspacePath, agent, projectId }) },
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function syncProject(projectId: string) {
|
|
205
|
+
return relayFetch<{ ok: true; totalEvents: number; timelineCount: number; lastSync: string }>(
|
|
206
|
+
`/api/projects/${projectId}/sync`,
|
|
207
|
+
{ method: 'POST' },
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function syncWorkspace(workspacePath: string) {
|
|
212
|
+
return relayFetch<{ ok: true; totalEvents: number; timelineCount: number; lastSync: string }>(
|
|
213
|
+
'/api/sync',
|
|
214
|
+
{ method: 'POST', body: JSON.stringify({ workspacePath }) },
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export async function getMemory(workspacePath: string): Promise<RelayMemory> {
|
|
219
|
+
const data = await relayFetch<{ ok: true; memory: RelayMemory }>(
|
|
220
|
+
`/api/memory?workspacePath=${encodeURIComponent(workspacePath)}`,
|
|
221
|
+
);
|
|
222
|
+
return data.memory;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export async function getProjectDashboard(
|
|
226
|
+
projectId: string,
|
|
227
|
+
params: { limit?: number; offset?: number; kind?: string; source?: string; role?: string } = {},
|
|
228
|
+
): Promise<{ project: RelayProject; dashboard: RelayDashboard }> {
|
|
229
|
+
const q = new URLSearchParams();
|
|
230
|
+
if (params.limit != null) q.set('limit', String(params.limit));
|
|
231
|
+
if (params.offset != null) q.set('offset', String(params.offset));
|
|
232
|
+
if (params.kind) q.set('kind', params.kind);
|
|
233
|
+
if (params.source) q.set('source', params.source);
|
|
234
|
+
if (params.role) q.set('role', params.role);
|
|
235
|
+
const data = await relayFetch<{ ok: true; project: RelayProject; dashboard: RelayDashboard }>(
|
|
236
|
+
`/api/projects/${projectId}/dashboard?${q}`,
|
|
237
|
+
);
|
|
238
|
+
return { project: data.project, dashboard: data.dashboard };
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export async function pingRelay(): Promise<boolean> {
|
|
242
|
+
try {
|
|
243
|
+
const res = await fetch(`${RELAY_URL}/api/health`);
|
|
244
|
+
const data = await res.json();
|
|
245
|
+
return res.ok && data.ok === true;
|
|
246
|
+
} catch {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export function getMissionMeta(workspacePath: string) {
|
|
252
|
+
return relayFetch<{ ok: true; meta: MissionMeta }>(
|
|
253
|
+
`/api/mission-meta?workspacePath=${encodeURIComponent(workspacePath)}`,
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export function saveMissionMeta(workspacePath: string, meta: Partial<MissionMeta>) {
|
|
258
|
+
return relayFetch<{ ok: true; meta: MissionMeta }>(
|
|
259
|
+
`/api/mission-meta?workspacePath=${encodeURIComponent(workspacePath)}`,
|
|
260
|
+
{ method: 'PUT', body: JSON.stringify(meta) },
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export function isRedactedContent(text?: string | null): boolean {
|
|
265
|
+
if (!text) return false;
|
|
266
|
+
const s = text.trim();
|
|
267
|
+
if (s === '[REDACTED]') return true;
|
|
268
|
+
if (/^\[REDACTED\]\s*$/i.test(s)) return true;
|
|
269
|
+
const stripped = s.replace(/\[REDACTED\]/gi, '').trim();
|
|
270
|
+
return !stripped && /\[REDACTED\]/i.test(s);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export function filterTimeline(events: RelayEvent[]): RelayEvent[] {
|
|
274
|
+
return events.filter((e) => {
|
|
275
|
+
if (e.kind === 'message' || e.kind === 'artifact') {
|
|
276
|
+
return !isRedactedContent(e.content);
|
|
277
|
+
}
|
|
278
|
+
return true;
|
|
279
|
+
});
|
|
280
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Workspace registry in localStorage (single-user, local machine).
|
|
2
|
+
|
|
3
|
+
export interface Workspace {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
full: string;
|
|
7
|
+
source: 'local';
|
|
8
|
+
localPath: string;
|
|
9
|
+
relayProjectId?: string;
|
|
10
|
+
active: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const STORAGE_KEY = 'relay_workspaces';
|
|
14
|
+
export const WORKSPACES_CHANGED_EVENT = 'relay:workspaces-changed';
|
|
15
|
+
|
|
16
|
+
function isRealWorkspace(w: unknown): w is Workspace {
|
|
17
|
+
return (
|
|
18
|
+
!!w &&
|
|
19
|
+
typeof w === 'object' &&
|
|
20
|
+
typeof (w as Workspace).localPath === 'string' &&
|
|
21
|
+
(w as Workspace).localPath.length > 0
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function loadWorkspaces(): Workspace[] {
|
|
26
|
+
if (typeof window === 'undefined') return [];
|
|
27
|
+
try {
|
|
28
|
+
const raw = localStorage.getItem(STORAGE_KEY);
|
|
29
|
+
if (!raw) return [];
|
|
30
|
+
const parsed = JSON.parse(raw);
|
|
31
|
+
if (!Array.isArray(parsed)) return [];
|
|
32
|
+
const real = parsed.filter(isRealWorkspace);
|
|
33
|
+
if (real.length && !real.some((w) => w.active)) real[0].active = true;
|
|
34
|
+
return real;
|
|
35
|
+
} catch {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function saveWorkspaces(workspaces: Workspace[]) {
|
|
41
|
+
if (typeof window === 'undefined') return;
|
|
42
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(workspaces));
|
|
43
|
+
window.dispatchEvent(new CustomEvent(WORKSPACES_CHANGED_EVENT));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function badgeFromName(full: string): string {
|
|
47
|
+
const leaf = full.split(/[/\\]/).filter(Boolean).pop() || full;
|
|
48
|
+
return leaf.slice(0, 2).toUpperCase();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function getActiveWorkspace(workspaces: Workspace[]): Workspace | null {
|
|
52
|
+
return workspaces.find((w) => w.active) || null;
|
|
53
|
+
}
|