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,379 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { readVscdbJson, vscodeInternalTimeToIso } = require('../lib/vscdb');
|
|
4
|
+
const { getWorkspacePathFromStorageDir } = require('../lib/vscodeWorkspace');
|
|
5
|
+
const {
|
|
6
|
+
scanHistoryForWorkspace,
|
|
7
|
+
getCodeHistoryRoots,
|
|
8
|
+
enrichEditsWithHistory,
|
|
9
|
+
mergeCodeEditSources,
|
|
10
|
+
} = require('../lib/vscodeHistory');
|
|
11
|
+
const { parseCopilotEditingSessions, listEditingSessionDirs } = require('./copilotEditingSessions');
|
|
12
|
+
|
|
13
|
+
const SOURCE = 'GitHub Copilot';
|
|
14
|
+
|
|
15
|
+
const extractText = (value) => {
|
|
16
|
+
if (Array.isArray(value)) {
|
|
17
|
+
return value
|
|
18
|
+
.map(part => {
|
|
19
|
+
if (typeof part === 'string') return part;
|
|
20
|
+
if (part && typeof part === 'object') {
|
|
21
|
+
if (part.type === 'text' && typeof part.text === 'string') return part.text;
|
|
22
|
+
if (typeof part.content === 'string') return part.content;
|
|
23
|
+
}
|
|
24
|
+
return '';
|
|
25
|
+
})
|
|
26
|
+
.join(' ')
|
|
27
|
+
.trim();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (typeof value === 'string') return value.trim();
|
|
31
|
+
if (value && typeof value === 'object') {
|
|
32
|
+
if (typeof value.text === 'string') return value.text.trim();
|
|
33
|
+
if (typeof value.content === 'string') return value.content.trim();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return String(value || '').trim();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
function extractUserRequest(renderedUserMessage) {
|
|
40
|
+
for (const part of renderedUserMessage || []) {
|
|
41
|
+
if (typeof part?.text !== 'string') continue;
|
|
42
|
+
const match = part.text.match(/<userRequest>\s*([\s\S]*?)\s*<\/userRequest>/i);
|
|
43
|
+
if (match) return match[1].trim();
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function foldChatSessionPatches(lines) {
|
|
49
|
+
let state = null;
|
|
50
|
+
|
|
51
|
+
for (const line of lines) {
|
|
52
|
+
let step;
|
|
53
|
+
try {
|
|
54
|
+
step = JSON.parse(line);
|
|
55
|
+
} catch (_) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (step.kind === 0) {
|
|
60
|
+
state = step.v;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!state || step.kind !== 1 || !Array.isArray(step.k)) continue;
|
|
65
|
+
|
|
66
|
+
let current = state;
|
|
67
|
+
for (let i = 0; i < step.k.length - 1; i++) {
|
|
68
|
+
const key = step.k[i];
|
|
69
|
+
if (current[key] === undefined) {
|
|
70
|
+
current[key] = typeof step.k[i + 1] === 'number' ? [] : {};
|
|
71
|
+
}
|
|
72
|
+
current = current[key];
|
|
73
|
+
}
|
|
74
|
+
current[step.k[step.k.length - 1]] = step.v;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return state;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function parseCopilotEventsJsonl(transcriptPath) {
|
|
81
|
+
const content = fs.readFileSync(transcriptPath, 'utf-8');
|
|
82
|
+
const lines = content.trim().split('\n').filter(Boolean);
|
|
83
|
+
const events = [];
|
|
84
|
+
let sessionStartTs = null;
|
|
85
|
+
|
|
86
|
+
for (const line of lines) {
|
|
87
|
+
try {
|
|
88
|
+
const step = JSON.parse(line);
|
|
89
|
+
|
|
90
|
+
if (step.type === 'session.start') {
|
|
91
|
+
sessionStartTs = step.timestamp || step.data?.startTime || null;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (step.type === 'user.message' && step.data?.content) {
|
|
96
|
+
const text = extractText(step.data.content);
|
|
97
|
+
if (text) {
|
|
98
|
+
events.push({
|
|
99
|
+
ts: step.timestamp,
|
|
100
|
+
kind: 'message',
|
|
101
|
+
role: 'user',
|
|
102
|
+
content: text,
|
|
103
|
+
source: SOURCE,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
} else if (step.type === 'assistant.message' && step.data?.content) {
|
|
107
|
+
const text = extractText(step.data.content);
|
|
108
|
+
if (text) {
|
|
109
|
+
events.push({
|
|
110
|
+
ts: step.timestamp,
|
|
111
|
+
kind: 'message',
|
|
112
|
+
role: 'assistant',
|
|
113
|
+
content: text,
|
|
114
|
+
source: SOURCE,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
} catch (_) { }
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return { events, sessionStartTs };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function parseCopilotChatSession(chatSessionPath) {
|
|
125
|
+
const content = fs.readFileSync(chatSessionPath, 'utf-8');
|
|
126
|
+
const lines = content.trim().split('\n').filter(Boolean);
|
|
127
|
+
if (!lines.length) return { events: [], sessionId: null, sessionStartTs: null };
|
|
128
|
+
|
|
129
|
+
let firstStep;
|
|
130
|
+
try {
|
|
131
|
+
firstStep = JSON.parse(lines[0]);
|
|
132
|
+
} catch (_) {
|
|
133
|
+
return { events: [], sessionId: null, sessionStartTs: null };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (firstStep.kind !== 0) {
|
|
137
|
+
return parseCopilotEventsJsonl(chatSessionPath);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const state = foldChatSessionPatches(lines);
|
|
141
|
+
if (!state) return { events: [], sessionId: null, sessionStartTs: null };
|
|
142
|
+
|
|
143
|
+
const sessionId = state.sessionId || path.basename(chatSessionPath, '.jsonl');
|
|
144
|
+
const sessionStartTs = state.creationDate
|
|
145
|
+
? new Date(state.creationDate).toISOString()
|
|
146
|
+
: null;
|
|
147
|
+
|
|
148
|
+
const events = [];
|
|
149
|
+
const requests = Array.isArray(state.requests) ? state.requests : [];
|
|
150
|
+
|
|
151
|
+
for (let i = 0; i < requests.length; i++) {
|
|
152
|
+
const request = requests[i];
|
|
153
|
+
const userText =
|
|
154
|
+
extractUserRequest(request?.result?.metadata?.renderedUserMessage) ||
|
|
155
|
+
(i === 0 && state.customTitle ? String(state.customTitle).trim() : null);
|
|
156
|
+
|
|
157
|
+
if (userText) {
|
|
158
|
+
events.push({
|
|
159
|
+
ts: sessionStartTs,
|
|
160
|
+
kind: 'message',
|
|
161
|
+
role: 'user',
|
|
162
|
+
content: userText,
|
|
163
|
+
source: SOURCE,
|
|
164
|
+
sessionId,
|
|
165
|
+
requestIndex: i,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return { events, sessionId, sessionStartTs };
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function findSiblingTranscript(chatSessionPath, sessionId) {
|
|
174
|
+
const workspaceDir = path.dirname(path.dirname(chatSessionPath));
|
|
175
|
+
const transcriptPath = path.join(
|
|
176
|
+
workspaceDir,
|
|
177
|
+
'GitHub.copilot-chat',
|
|
178
|
+
'transcripts',
|
|
179
|
+
`${sessionId}.jsonl`
|
|
180
|
+
);
|
|
181
|
+
return fs.existsSync(transcriptPath) ? transcriptPath : null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function mergeCopilotEvents(userEvents, transcriptEvents, sessionStartTs) {
|
|
185
|
+
const merged = userEvents.map(event => ({
|
|
186
|
+
...event,
|
|
187
|
+
ts: sessionStartTs || event.ts,
|
|
188
|
+
}));
|
|
189
|
+
|
|
190
|
+
for (const event of transcriptEvents) {
|
|
191
|
+
merged.push(event);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
merged.sort((a, b) => {
|
|
195
|
+
const ta = Date.parse(a.ts || '') || 0;
|
|
196
|
+
const tb = Date.parse(b.ts || '') || 0;
|
|
197
|
+
if (ta !== tb) return ta - tb;
|
|
198
|
+
if (a.role === 'user' && b.role !== 'user') return -1;
|
|
199
|
+
if (a.role !== 'user' && b.role === 'user') return 1;
|
|
200
|
+
return 0;
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
if (sessionStartTs && merged.length) {
|
|
204
|
+
const hasUser = merged.some(e => e.role === 'user');
|
|
205
|
+
if (!hasUser) {
|
|
206
|
+
merged.unshift({
|
|
207
|
+
ts: sessionStartTs,
|
|
208
|
+
kind: 'message',
|
|
209
|
+
role: 'user',
|
|
210
|
+
content: '(session started)',
|
|
211
|
+
source: SOURCE,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return merged;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function parseSingleChatSession(chatSessionPath) {
|
|
220
|
+
const { events: userEvents, sessionId, sessionStartTs } = parseCopilotChatSession(chatSessionPath);
|
|
221
|
+
const transcriptFile = sessionId ? findSiblingTranscript(chatSessionPath, sessionId) : null;
|
|
222
|
+
|
|
223
|
+
if (transcriptFile) {
|
|
224
|
+
const { events: transcriptEvents, sessionStartTs: transcriptStartTs } =
|
|
225
|
+
parseCopilotEventsJsonl(transcriptFile);
|
|
226
|
+
return mergeCopilotEvents(
|
|
227
|
+
userEvents,
|
|
228
|
+
transcriptEvents,
|
|
229
|
+
transcriptStartTs || sessionStartTs
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return userEvents;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function getWorkspaceStorageDir(inputPath) {
|
|
237
|
+
if (!inputPath) return null;
|
|
238
|
+
if (!fs.existsSync(inputPath)) return null;
|
|
239
|
+
|
|
240
|
+
const stat = fs.statSync(inputPath);
|
|
241
|
+
if (stat.isDirectory()) return inputPath;
|
|
242
|
+
|
|
243
|
+
let dir = path.dirname(inputPath);
|
|
244
|
+
while (dir && path.basename(dir) !== 'workspaceStorage') {
|
|
245
|
+
const base = path.basename(dir);
|
|
246
|
+
if (base === 'chatSessions' || base === 'transcripts' || base === 'GitHub.copilot-chat') {
|
|
247
|
+
return path.dirname(path.dirname(dir));
|
|
248
|
+
}
|
|
249
|
+
if (fs.existsSync(path.join(dir, 'workspace.json'))) return dir;
|
|
250
|
+
const parent = path.dirname(dir);
|
|
251
|
+
if (parent === dir) break;
|
|
252
|
+
dir = parent;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function listChatSessionFiles(workspaceStorageDir) {
|
|
259
|
+
const dir = path.join(workspaceStorageDir, 'chatSessions');
|
|
260
|
+
if (!fs.existsSync(dir)) return [];
|
|
261
|
+
|
|
262
|
+
return fs.readdirSync(dir, { withFileTypes: true })
|
|
263
|
+
.filter(entry => entry.isFile() && entry.name.endsWith('.jsonl'))
|
|
264
|
+
.map(entry => path.join(dir, entry.name));
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function assignEditTimestamps(codeEdits, sessionIndex) {
|
|
268
|
+
return codeEdits.map(event => {
|
|
269
|
+
const timing = sessionIndex?.entries?.[event.sessionId]?.timing;
|
|
270
|
+
if (!timing) {
|
|
271
|
+
return { ...event, ts: event.ts || null };
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const start = Number(timing.lastRequestStarted || timing.created) || 0;
|
|
275
|
+
const end = Number(timing.lastRequestEnded || timing.lastRequestStarted || start) || start;
|
|
276
|
+
const span = Math.max(end - start, 1);
|
|
277
|
+
const epoch = Number(event.epoch) || 0;
|
|
278
|
+
const maxEpoch = 10;
|
|
279
|
+
const ts = vscodeInternalTimeToIso(start + Math.floor((span * epoch) / maxEpoch));
|
|
280
|
+
|
|
281
|
+
return { ...event, ts: ts || event.ts };
|
|
282
|
+
}).filter(event => event.ts);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function parseCopilotWorkspace(workspaceStorageDir, options = {}) {
|
|
286
|
+
const sessionIndex = readVscdbJson(
|
|
287
|
+
path.join(workspaceStorageDir, 'state.vscdb'),
|
|
288
|
+
'chat.ChatSessionStore.index'
|
|
289
|
+
);
|
|
290
|
+
|
|
291
|
+
const chatEvents = [];
|
|
292
|
+
for (const chatSessionPath of listChatSessionFiles(workspaceStorageDir)) {
|
|
293
|
+
chatEvents.push(...parseSingleChatSession(chatSessionPath));
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const workspacePath =
|
|
297
|
+
options.workspacePath || getWorkspacePathFromStorageDir(workspaceStorageDir);
|
|
298
|
+
|
|
299
|
+
const sessionEdits = assignEditTimestamps(
|
|
300
|
+
parseCopilotEditingSessions(workspaceStorageDir, sessionIndex),
|
|
301
|
+
sessionIndex
|
|
302
|
+
);
|
|
303
|
+
|
|
304
|
+
const checkpoints = sessionEdits.filter(event => event.kind === 'checkpoint');
|
|
305
|
+
const chatEditingEdits = sessionEdits.filter(event => event.kind === 'code_edit');
|
|
306
|
+
|
|
307
|
+
const historyEdits = workspacePath
|
|
308
|
+
? scanHistoryForWorkspace(workspacePath, { roots: getCodeHistoryRoots() })
|
|
309
|
+
: [];
|
|
310
|
+
|
|
311
|
+
const enrichedSessionEdits = enrichEditsWithHistory(chatEditingEdits, historyEdits);
|
|
312
|
+
const codeEdits = mergeCodeEditSources(historyEdits, enrichedSessionEdits);
|
|
313
|
+
|
|
314
|
+
const events = [...chatEvents, ...codeEdits, ...checkpoints];
|
|
315
|
+
events.sort((a, b) => {
|
|
316
|
+
const ta = Date.parse(a.ts || '') || 0;
|
|
317
|
+
const tb = Date.parse(b.ts || '') || 0;
|
|
318
|
+
if (ta !== tb) return ta - tb;
|
|
319
|
+
const kindOrder = { message: 0, code_edit: 1, artifact: 2, checkpoint: 3 };
|
|
320
|
+
return (kindOrder[a.kind] ?? 9) - (kindOrder[b.kind] ?? 9);
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
return {
|
|
324
|
+
events,
|
|
325
|
+
workspaceStorageDir,
|
|
326
|
+
workspacePath,
|
|
327
|
+
sessionIndex,
|
|
328
|
+
sources: {
|
|
329
|
+
chatSessions: listChatSessionFiles(workspaceStorageDir),
|
|
330
|
+
editingSessions: listEditingSessionDirs(workspaceStorageDir).length,
|
|
331
|
+
vscdb: fs.existsSync(path.join(workspaceStorageDir, 'state.vscdb')),
|
|
332
|
+
localHistory: historyEdits.length,
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Reads Copilot chat + code edits from workspaceStorage (chatSessions, transcripts,
|
|
338
|
+
// chatEditingSessions, state.vscdb index, Code/User/History snapshots), or legacy paths.
|
|
339
|
+
function parseCopilot(transcriptPath, options = {}) {
|
|
340
|
+
if (!transcriptPath || !fs.existsSync(transcriptPath)) return [];
|
|
341
|
+
|
|
342
|
+
const workspaceDir = getWorkspaceStorageDir(transcriptPath);
|
|
343
|
+
if (workspaceDir && fs.statSync(transcriptPath).isDirectory()) {
|
|
344
|
+
return parseCopilotWorkspace(workspaceDir, options).events;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (workspaceDir && path.basename(path.dirname(transcriptPath)) === 'chatSessions') {
|
|
348
|
+
return parseCopilotWorkspace(workspaceDir, options).events;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
let firstLine;
|
|
352
|
+
try {
|
|
353
|
+
firstLine = fs.readFileSync(transcriptPath, 'utf-8').split('\n')[0];
|
|
354
|
+
} catch (_) {
|
|
355
|
+
return [];
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
let firstStep;
|
|
359
|
+
try {
|
|
360
|
+
firstStep = JSON.parse(firstLine);
|
|
361
|
+
} catch (_) {
|
|
362
|
+
return [];
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (firstStep.kind === 0) {
|
|
366
|
+
return parseSingleChatSession(transcriptPath);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
return parseCopilotEventsJsonl(transcriptPath).events;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
module.exports = {
|
|
373
|
+
parseCopilot,
|
|
374
|
+
parseCopilotWorkspace,
|
|
375
|
+
parseCopilotChatSession,
|
|
376
|
+
parseCopilotEventsJsonl,
|
|
377
|
+
foldChatSessionPatches,
|
|
378
|
+
getWorkspaceStorageDir,
|
|
379
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const SOURCE = 'GitHub Copilot';
|
|
5
|
+
|
|
6
|
+
function uriToPath(uri) {
|
|
7
|
+
if (!uri) return null;
|
|
8
|
+
if (typeof uri === 'string') {
|
|
9
|
+
if (uri.startsWith('file:///')) {
|
|
10
|
+
try {
|
|
11
|
+
return decodeURIComponent(uri.replace('file:///', '')).replace(/\//g, path.sep);
|
|
12
|
+
} catch (_) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return uri;
|
|
17
|
+
}
|
|
18
|
+
if (uri.fsPath) return uri.fsPath;
|
|
19
|
+
if (uri.external?.startsWith('file:///')) return uriToPath(uri.external);
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function listEditingSessionDirs(workspaceStorageDir) {
|
|
24
|
+
const root = path.join(workspaceStorageDir, 'chatEditingSessions');
|
|
25
|
+
if (!fs.existsSync(root)) return [];
|
|
26
|
+
|
|
27
|
+
return fs.readdirSync(root, { withFileTypes: true })
|
|
28
|
+
.filter(entry => entry.isDirectory())
|
|
29
|
+
.map(entry => path.join(root, entry.name));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function parseEditingSessionDir(sessionDir, sessionTiming) {
|
|
33
|
+
const statePath = path.join(sessionDir, 'state.json');
|
|
34
|
+
if (!fs.existsSync(statePath)) return [];
|
|
35
|
+
|
|
36
|
+
let state;
|
|
37
|
+
try {
|
|
38
|
+
state = JSON.parse(fs.readFileSync(statePath, 'utf-8'));
|
|
39
|
+
} catch (_) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const sessionId = path.basename(sessionDir);
|
|
44
|
+
const events = [];
|
|
45
|
+
const timeline = state.timeline || {};
|
|
46
|
+
const checkpoints = timeline.checkpoints || [];
|
|
47
|
+
const operations = timeline.operations || [];
|
|
48
|
+
const epochToCheckpoint = new Map(checkpoints.map(cp => [cp.epoch, cp]));
|
|
49
|
+
|
|
50
|
+
const baseTs = sessionTiming?.lastRequestStarted || sessionTiming?.created || null;
|
|
51
|
+
|
|
52
|
+
for (const op of operations) {
|
|
53
|
+
const filePath = uriToPath(op.uri);
|
|
54
|
+
if (!filePath || op.type !== 'textEdit') continue;
|
|
55
|
+
|
|
56
|
+
const editPreview = (op.edits || [])
|
|
57
|
+
.map(e => String(e.text || '').trim())
|
|
58
|
+
.filter(Boolean)
|
|
59
|
+
.join(' ')
|
|
60
|
+
.slice(0, 160);
|
|
61
|
+
|
|
62
|
+
const checkpoint = epochToCheckpoint.get(op.epoch);
|
|
63
|
+
events.push({
|
|
64
|
+
ts: baseTs,
|
|
65
|
+
kind: 'code_edit',
|
|
66
|
+
role: 'assistant',
|
|
67
|
+
source: SOURCE,
|
|
68
|
+
sessionId,
|
|
69
|
+
file: path.basename(filePath),
|
|
70
|
+
path: filePath,
|
|
71
|
+
action: 'textEdit',
|
|
72
|
+
editSource: 'chatEditingSession',
|
|
73
|
+
epoch: op.epoch,
|
|
74
|
+
requestId: op.requestId || checkpoint?.requestId || null,
|
|
75
|
+
summary: editPreview || checkpoint?.label || 'Copilot chat edit',
|
|
76
|
+
checkpointId: checkpoint?.checkpointId || null,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
for (const cp of checkpoints) {
|
|
81
|
+
if (cp.epoch === 0) continue;
|
|
82
|
+
const fileUri = state.initialFileContents?.[0]?.[0];
|
|
83
|
+
const filePath = uriToPath(fileUri);
|
|
84
|
+
events.push({
|
|
85
|
+
ts: baseTs,
|
|
86
|
+
kind: 'checkpoint',
|
|
87
|
+
role: 'assistant',
|
|
88
|
+
source: SOURCE,
|
|
89
|
+
sessionId,
|
|
90
|
+
file: filePath ? path.basename(filePath) : null,
|
|
91
|
+
path: filePath,
|
|
92
|
+
epoch: cp.epoch,
|
|
93
|
+
requestId: cp.requestId || null,
|
|
94
|
+
summary: cp.label || cp.description || 'Copilot edit checkpoint',
|
|
95
|
+
checkpointId: cp.checkpointId,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return events;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function parseCopilotEditingSessions(workspaceStorageDir, sessionIndex) {
|
|
103
|
+
const dirs = listEditingSessionDirs(workspaceStorageDir);
|
|
104
|
+
const events = [];
|
|
105
|
+
|
|
106
|
+
for (const dir of dirs) {
|
|
107
|
+
const sessionId = path.basename(dir);
|
|
108
|
+
const timing = sessionIndex?.entries?.[sessionId]?.timing || null;
|
|
109
|
+
events.push(...parseEditingSessionDir(dir, timing));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return events;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
module.exports = {
|
|
116
|
+
parseCopilotEditingSessions,
|
|
117
|
+
listEditingSessionDirs,
|
|
118
|
+
};
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const { normalizeTs, makeUnifiedDiff, isRedactedContent } = require('../lib/timeline');
|
|
5
|
+
const { scanHistoryForWorkspace, getCursorHistoryRoots } = require('../lib/vscodeHistory');
|
|
6
|
+
|
|
7
|
+
const SOURCE = 'Cursor';
|
|
8
|
+
const EDIT_TOOLS = new Set(['Write', 'StrReplace', 'ApplyPatch', 'EditNotebook', 'search_replace']);
|
|
9
|
+
|
|
10
|
+
const HOME = os.homedir();
|
|
11
|
+
|
|
12
|
+
function workspaceToCursorSlug(workspacePath) {
|
|
13
|
+
const norm = String(workspacePath || '')
|
|
14
|
+
.replace(/\\/g, '/')
|
|
15
|
+
.replace(/\/$/, '');
|
|
16
|
+
|
|
17
|
+
const driveMatch = norm.match(/^([a-zA-Z]):\/?(.*)$/);
|
|
18
|
+
if (driveMatch) {
|
|
19
|
+
const tail = driveMatch[2].replace(/[^a-zA-Z0-9]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '');
|
|
20
|
+
return `${driveMatch[1].toLowerCase()}-${tail}`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let slug = norm.replace(/[^a-zA-Z0-9]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '');
|
|
24
|
+
if (slug.charAt(1) === '-') slug = slug.charAt(0).toLowerCase() + slug.slice(1);
|
|
25
|
+
return slug;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function discoverCursorTranscriptDir(workspacePath) {
|
|
29
|
+
const projectsRoot = path.join(HOME, '.cursor', 'projects');
|
|
30
|
+
const slug = workspaceToCursorSlug(workspacePath);
|
|
31
|
+
const direct = path.join(projectsRoot, slug, 'agent-transcripts');
|
|
32
|
+
if (fs.existsSync(direct)) return direct;
|
|
33
|
+
|
|
34
|
+
if (!fs.existsSync(projectsRoot)) return null;
|
|
35
|
+
|
|
36
|
+
const target = workspacePath.toLowerCase().replace(/\\/g, '/').replace(/\/$/, '');
|
|
37
|
+
for (const entry of fs.readdirSync(projectsRoot, { withFileTypes: true })) {
|
|
38
|
+
if (!entry.isDirectory()) continue;
|
|
39
|
+
const candidate = path.join(projectsRoot, entry.name, 'agent-transcripts');
|
|
40
|
+
if (!fs.existsSync(candidate)) continue;
|
|
41
|
+
|
|
42
|
+
for (const file of listCursorTranscriptFiles(candidate).slice(0, 3)) {
|
|
43
|
+
try {
|
|
44
|
+
const sample = fs.readFileSync(file, 'utf-8').slice(0, 8000).toLowerCase();
|
|
45
|
+
if (sample.includes(target)) return candidate;
|
|
46
|
+
} catch (_) { }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function listCursorTranscriptFiles(transcriptDir) {
|
|
54
|
+
if (!transcriptDir || !fs.existsSync(transcriptDir)) return [];
|
|
55
|
+
|
|
56
|
+
const files = [];
|
|
57
|
+
for (const entry of fs.readdirSync(transcriptDir, { withFileTypes: true })) {
|
|
58
|
+
if (entry.isDirectory()) {
|
|
59
|
+
const jsonl = path.join(transcriptDir, entry.name, `${entry.name}.jsonl`);
|
|
60
|
+
if (fs.existsSync(jsonl)) files.push(jsonl);
|
|
61
|
+
} else if (entry.name.endsWith('.jsonl')) {
|
|
62
|
+
files.push(path.join(transcriptDir, entry.name));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return files.sort((a, b) => {
|
|
67
|
+
try { return fs.statSync(b).mtimeMs - fs.statSync(a).mtimeMs; } catch { return 0; }
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function extractUserText(content) {
|
|
72
|
+
if (!Array.isArray(content)) return '';
|
|
73
|
+
return content
|
|
74
|
+
.filter(part => part?.type === 'text' && typeof part.text === 'string')
|
|
75
|
+
.map(part => {
|
|
76
|
+
const match = part.text.match(/<user_query>\s*([\s\S]*?)\s*<\/user_query>/i);
|
|
77
|
+
return match ? match[1].trim() : part.text.trim();
|
|
78
|
+
})
|
|
79
|
+
.filter(Boolean)
|
|
80
|
+
.join('\n');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function extractAssistantText(content) {
|
|
84
|
+
if (!Array.isArray(content)) return '';
|
|
85
|
+
return content
|
|
86
|
+
.filter(part => part?.type === 'text' && typeof part.text === 'string')
|
|
87
|
+
.map(part => part.text.trim())
|
|
88
|
+
.filter(Boolean)
|
|
89
|
+
.join('\n');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function toolToCodeEdit(tool, ts) {
|
|
93
|
+
const name = tool.name;
|
|
94
|
+
if (!EDIT_TOOLS.has(name)) return null;
|
|
95
|
+
|
|
96
|
+
const input = tool.input || {};
|
|
97
|
+
const filePath = input.path || input.file_path || input.target_notebook || null;
|
|
98
|
+
if (!filePath) return null;
|
|
99
|
+
|
|
100
|
+
let diff = null;
|
|
101
|
+
let summary = `${name} ${path.basename(filePath)}`;
|
|
102
|
+
|
|
103
|
+
if (name === 'StrReplace' && input.old_string != null && input.new_string != null) {
|
|
104
|
+
diff = makeUnifiedDiff(input.old_string, input.new_string, path.basename(filePath));
|
|
105
|
+
summary = `Edited ${path.basename(filePath)}`;
|
|
106
|
+
} else if (name === 'Write' && input.contents != null) {
|
|
107
|
+
diff = makeUnifiedDiff('', input.contents, path.basename(filePath));
|
|
108
|
+
summary = `Wrote ${path.basename(filePath)}`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return {
|
|
112
|
+
ts,
|
|
113
|
+
kind: 'code_edit',
|
|
114
|
+
role: 'assistant',
|
|
115
|
+
source: SOURCE,
|
|
116
|
+
file: path.basename(filePath),
|
|
117
|
+
path: filePath,
|
|
118
|
+
action: name.toLowerCase(),
|
|
119
|
+
summary,
|
|
120
|
+
diff,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function parseCursorTranscriptFile(transcriptPath, baseTs) {
|
|
125
|
+
const content = fs.readFileSync(transcriptPath, 'utf-8');
|
|
126
|
+
const lines = content.trim().split('\n').filter(Boolean);
|
|
127
|
+
const events = [];
|
|
128
|
+
const fileMtime = fs.statSync(transcriptPath).mtimeMs;
|
|
129
|
+
const startTs = baseTs || normalizeTs(fileMtime);
|
|
130
|
+
|
|
131
|
+
lines.forEach((line, index) => {
|
|
132
|
+
try {
|
|
133
|
+
const step = JSON.parse(line);
|
|
134
|
+
const ts = startTs
|
|
135
|
+
? normalizeTs(Date.parse(startTs) + index * 1000)
|
|
136
|
+
: normalizeTs(fileMtime + index * 1000);
|
|
137
|
+
|
|
138
|
+
if (step.role === 'user') {
|
|
139
|
+
const text = extractUserText(step.message?.content);
|
|
140
|
+
if (text && !isRedactedContent(text)) {
|
|
141
|
+
events.push({
|
|
142
|
+
ts,
|
|
143
|
+
kind: 'message',
|
|
144
|
+
role: 'user',
|
|
145
|
+
content: text,
|
|
146
|
+
source: SOURCE,
|
|
147
|
+
transcriptPath,
|
|
148
|
+
lineIndex: index,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
} else if (step.role === 'assistant') {
|
|
152
|
+
const text = extractAssistantText(step.message?.content);
|
|
153
|
+
if (text && !isRedactedContent(text)) {
|
|
154
|
+
events.push({
|
|
155
|
+
ts,
|
|
156
|
+
kind: 'message',
|
|
157
|
+
role: 'assistant',
|
|
158
|
+
content: text,
|
|
159
|
+
source: SOURCE,
|
|
160
|
+
transcriptPath,
|
|
161
|
+
lineIndex: index,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const tools = Array.isArray(step.message?.content)
|
|
166
|
+
? step.message.content.filter(part => part?.type === 'tool_use')
|
|
167
|
+
: [];
|
|
168
|
+
|
|
169
|
+
for (const tool of tools) {
|
|
170
|
+
const edit = toolToCodeEdit(tool, ts);
|
|
171
|
+
if (edit) events.push(edit);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
} catch (_) { }
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
return events;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function parseCursor(inputPath, options = {}) {
|
|
181
|
+
const workspacePath = options.workspacePath;
|
|
182
|
+
let transcriptFiles = [];
|
|
183
|
+
|
|
184
|
+
if (inputPath && fs.existsSync(inputPath)) {
|
|
185
|
+
if (fs.statSync(inputPath).isDirectory()) {
|
|
186
|
+
transcriptFiles = listCursorTranscriptFiles(inputPath);
|
|
187
|
+
} else {
|
|
188
|
+
transcriptFiles = [inputPath];
|
|
189
|
+
}
|
|
190
|
+
} else if (workspacePath) {
|
|
191
|
+
const dir = discoverCursorTranscriptDir(workspacePath);
|
|
192
|
+
if (dir) transcriptFiles = listCursorTranscriptFiles(dir);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const events = [];
|
|
196
|
+
for (const file of transcriptFiles) {
|
|
197
|
+
events.push(...parseCursorTranscriptFile(file));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (workspacePath) {
|
|
201
|
+
events.push(...scanHistoryForWorkspace(workspacePath, {
|
|
202
|
+
roots: getCursorHistoryRoots(),
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
events.sort((a, b) => Date.parse(a.ts || '') - Date.parse(b.ts || ''));
|
|
207
|
+
return { events, transcriptFiles };
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
module.exports = {
|
|
211
|
+
parseCursor,
|
|
212
|
+
discoverCursorTranscriptDir,
|
|
213
|
+
listCursorTranscriptFiles,
|
|
214
|
+
workspaceToCursorSlug,
|
|
215
|
+
};
|