@surething/cockpit 1.1.10 → 1.1.11
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +4 -2
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/cockpit-build.json +1 -1
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/routes-manifest.json +12 -0
- package/.next-prod/server/app/_global-error/page.js +2 -2
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/agent/test/route.js +1 -1
- package/.next-prod/server/app/api/bash/route.js +1 -1
- package/.next-prod/server/app/api/bots/[id]/route.js +1 -1
- package/.next-prod/server/app/api/bots/files/route.js +1 -1
- package/.next-prod/server/app/api/bots/route.js +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
- package/.next-prod/server/app/api/chat/glm/route.js +1 -1
- package/.next-prod/server/app/api/chat/grok/route.js +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js +1 -1
- package/.next-prod/server/app/api/chat/route.js +1 -1
- package/.next-prod/server/app/api/chat/stop/route.js +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js +1 -1
- package/.next-prod/server/app/api/commands/route.js +1 -1
- package/.next-prod/server/app/api/comments/route.js +1 -1
- package/.next-prod/server/app/api/db/columns/route.js +1 -1
- package/.next-prod/server/app/api/db/connect/route.js +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/db/export/route.js +1 -1
- package/.next-prod/server/app/api/db/query/route.js +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js +2 -2
- package/.next-prod/server/app/api/deepseek/balance/route.js +1 -1
- package/.next-prod/server/app/api/deepseek/credentials/route.js +1 -1
- package/.next-prod/server/app/api/deepseek/models/route.js +1 -1
- package/.next-prod/server/app/api/dev/spans/route.js +1 -1
- package/.next-prod/server/app/api/extension/version/route.js +1 -1
- package/.next-prod/server/app/api/file/route.js +1 -1
- package/.next-prod/server/app/api/files/blame/route.js +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js +1 -1
- package/.next-prod/server/app/api/files/copy/route.js +1 -1
- package/.next-prod/server/app/api/files/delete/route.js +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js +1 -1
- package/.next-prod/server/app/api/files/index/route.js +1 -1
- package/.next-prod/server/app/api/files/init/route.js +1 -1
- package/.next-prod/server/app/api/files/paste/route.js +1 -1
- package/.next-prod/server/app/api/files/read/route.js +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js +1 -1
- package/.next-prod/server/app/api/files/recent/route.js +1 -1
- package/.next-prod/server/app/api/files/save/route.js +1 -1
- package/.next-prod/server/app/api/files/search/route.js +1 -1
- package/.next-prod/server/app/api/files/stat/route.js +1 -1
- package/.next-prod/server/app/api/files/text/route.js +1 -1
- package/.next-prod/server/app/api/fs/dirs/route.js +1 -1
- package/.next-prod/server/app/api/git/blob/route.js +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/branches/route.js +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/commits/route.js +1 -1
- package/.next-prod/server/app/api/git/current-branch/route.js +1 -1
- package/.next-prod/server/app/api/git/diff/route.js +1 -1
- package/.next-prod/server/app/api/git/discard/route.js +1 -1
- package/.next-prod/server/app/api/git/stage/route.js +1 -1
- package/.next-prod/server/app/api/git/status/route.js +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js +1 -1
- package/.next-prod/server/app/api/glm/credentials/route.js +1 -1
- package/.next-prod/server/app/api/glm/models/route.js +1 -1
- package/.next-prod/server/app/api/glm/usage/route.js +1 -1
- package/.next-prod/server/app/api/global-state/route.js +2 -2
- package/.next-prod/server/app/api/grok/models/route.js +1 -1
- package/.next-prod/server/app/api/health/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/[id]/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/files/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/route.js +1 -1
- package/.next-prod/server/app/api/instructions/config/route.js +1 -1
- package/.next-prod/server/app/api/kimi/credentials/route.js +1 -1
- package/.next-prod/server/app/api/kimi/models/route.js +1 -1
- package/.next-prod/server/app/api/kimi/usage/route.js +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js +1 -1
- package/.next-prod/server/app/api/mobile-link/route.js +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js +2 -2
- package/.next-prod/server/app/api/mysql/connect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js +2 -2
- package/.next-prod/server/app/api/neo4j/connect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js +1 -1
- package/.next-prod/server/app/api/note/list/route.js +1 -1
- package/.next-prod/server/app/api/note/route.js +1 -1
- package/.next-prod/server/app/api/ollama/config/route.js +1 -1
- package/.next-prod/server/app/api/ollama/default-model/route.js +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js +1 -1
- package/.next-prod/server/app/api/pi/thinking/route.js +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
- package/.next-prod/server/app/api/project-settings/route.js +1 -1
- package/.next-prod/server/app/api/project-state/route.js +2 -2
- package/.next-prod/server/app/api/projectGraph/affected/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callees/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callers/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/clones/route.js +1 -0
- package/.next-prod/server/app/api/projectGraph/clones/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/projectGraph/clones/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/projectGraph/coedit/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/crap/route.js +1 -0
- package/.next-prod/server/app/api/projectGraph/crap/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/projectGraph/crap/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/projectGraph/edges/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/impact/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/maps/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/related/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/symbols/route.js +1 -1
- package/.next-prod/server/app/api/projects/route.js +1 -1
- package/.next-prod/server/app/api/push/public-key/route.js +1 -1
- package/.next-prod/server/app/api/push/subscribe/route.js +1 -1
- package/.next-prod/server/app/api/push/unsubscribe/route.js +1 -1
- package/.next-prod/server/app/api/redis/command/route.js +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/redis/get/route.js +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js +1 -1
- package/.next-prod/server/app/api/redis/set/route.js +1 -1
- package/.next-prod/server/app/api/restart/route.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js +2 -2
- package/.next-prod/server/app/api/services/config/route.js +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/turn/route.js +2 -2
- package/.next-prod/server/app/api/session/image/route.js +1 -1
- package/.next-prod/server/app/api/session/user-messages/route.js +1 -1
- package/.next-prod/server/app/api/session-bots/route.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js +1 -1
- package/.next-prod/server/app/api/session-context/route.js +2 -2
- package/.next-prod/server/app/api/session-title/route.js +1 -1
- package/.next-prod/server/app/api/session-title/suggest/route.js +1 -1
- package/.next-prod/server/app/api/sessions/delegate/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
- package/.next-prod/server/app/api/sessions/search/route.js +1 -1
- package/.next-prod/server/app/api/sessions/status/route.js +1 -1
- package/.next-prod/server/app/api/settings/route.js +1 -1
- package/.next-prod/server/app/api/shutdown/route.js +1 -1
- package/.next-prod/server/app/api/skills/[id]/route.js +1 -1
- package/.next-prod/server/app/api/skills/builtin/route.js +1 -1
- package/.next-prod/server/app/api/skills/content/route.js +1 -1
- package/.next-prod/server/app/api/skills/files/route.js +1 -1
- package/.next-prod/server/app/api/skills/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/blob/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/diff/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/mark/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/range-diff/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/restore/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/route.js +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js +1 -1
- package/.next-prod/server/app/api/terminal/running/route.js +1 -1
- package/.next-prod/server/app/api/update/route.js +1 -1
- package/.next-prod/server/app/api/update-state/route.js +1 -1
- package/.next-prod/server/app/api/version/route.js +1 -1
- package/.next-prod/server/app/apps/[...path]/route.js +1 -1
- package/.next-prod/server/app/favicon.ico/route.js +1 -1
- package/.next-prod/server/app/m/page.js +1 -1
- package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route.js +1 -1
- package/.next-prod/server/app/page.js +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +4 -2
- package/.next-prod/server/chunks/4949.js +1 -1
- package/.next-prod/server/chunks/6610.js +11 -11
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/Dj5ykXLzxdIQZcSyjppsm/_buildManifest.js +1 -0
- package/.next-prod/static/chunks/{92000-31efb4d63c10446f.js → 60169-2e401ccea5e39a00.js} +21 -21
- package/.next-prod/static/chunks/{98596-ffbe0304646a9336.js → 98596-43e9fe35436097c6.js} +6 -6
- package/.next-prod/static/chunks/app/_global-error/{page-6af5bc188af96106.js → page-b40b02f6a2592427.js} +1 -1
- package/.next-prod/static/chunks/app/api/agent/test/{route-6af5bc188af96106.js → route-b40b02f6a2592427.js} +1 -1
- package/.next-prod/static/chunks/app/api/bash/{route-6af5bc188af96106.js → route-b40b02f6a2592427.js} +1 -1
- package/.next-prod/static/chunks/app/api/bots/[id]/{route-6af5bc188af96106.js → route-b40b02f6a2592427.js} +1 -1
- package/.next-prod/static/chunks/app/api/bots/files/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/bots/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/codex/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/glm/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/grok/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/kimi/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/ollama/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/stop/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/claude-stats/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/commands/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/comments/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/db/columns/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/db/connect/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/db/disconnect/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/db/export/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/db/query/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/db/schemas/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/balance/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/credentials/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/models/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/dev/spans/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/extension/version/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/file/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/blame/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/clipboard/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/copy/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/delete/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/expanded/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/index/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/init/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/paste/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/read/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/readdir/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/recent/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/save/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/search/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/stat/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/files/text/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/fs/dirs/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/blob/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branches/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commits/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/current-branch/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/diff/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/discard/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/stage/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/status/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/unstage/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/git/worktree/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/credentials/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/models/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/usage/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/global-state/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/grok/models/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/health/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/[id]/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/files/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/instructions/config/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/credentials/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/models/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/usage/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/definition/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/hover/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/references/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/status/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/mobile-link/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/columns/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/connect/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/export/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/query/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/query/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/note/list/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/note/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/config/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/default-model/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/models/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/start/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/open-cursor/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/open-vscode/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/pi/thinking/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/project-settings/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/project-state/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/clones/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/crap/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/edges/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/maps/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/symbols/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/projects/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/push/public-key/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/push/subscribe/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/command/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/connect/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/delete/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/get/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/keys/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/set/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/restart/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/services/config/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/services/scripts/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/turn/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session/image/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session/user-messages/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session-bots/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session-by-path/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session-context/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session-title/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/session-title/suggest/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/delegate/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/search/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/status/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/settings/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/shutdown/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/[id]/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/builtin/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/content/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/files/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/blob/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/diff/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/mark/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/range-diff/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/restore/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/env/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/history/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/running/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/update/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/update-state/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/api/version/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/apps/[...path]/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/{layout-7107ed4eeac1f693.js → layout-a568d04e8d2707c3.js} +1 -1
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/app/{page-338a2c84319778b1.js → page-6675d44ff6c5ebc6.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-338a2c84319778b1.js → page-6675d44ff6c5ebc6.js} +1 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-b40b02f6a2592427.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-b40b02f6a2592427.js +1 -0
- package/.next-prod/trace +86 -86
- package/.next-prod/trace-build +1 -1
- package/.next-prod/types/app/api/projectGraph/clones/route.ts +353 -0
- package/.next-prod/types/app/api/projectGraph/crap/route.ts +353 -0
- package/.next-prod/types/routes.d.ts +3 -1
- package/.next-prod/types/validator.ts +18 -0
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/bin/cock-codegraph.mjs +111 -27
- package/bin/cockpit.mjs +1 -1
- package/bin/managed-npm-updater.mjs +0 -1
- package/desktop-checksums.json +4 -4
- package/dist/scheduledTasks.mjs +22 -10
- package/dist/wsServer.mjs +899 -160
- package/package.json +1 -1
- package/scripts/copy-tree-sitter-wasms.mjs +2 -2
- package/skills/ar/SKILL.md +293 -0
- package/skills/ar/boundary.md +48 -0
- package/skills/ar/evolution.md +38 -0
- package/skills/ar/legibility.md +52 -0
- package/skills/ar/reviewer.md +261 -0
- package/skills/ar/structure.md +38 -0
- package/skills/cg/SKILL.md +85 -14
- package/skills/cr/SKILL.md +62 -293
- package/skills/cr/reviewer.md +303 -0
- package/skills/rf/SKILL.md +6 -5
- package/skills/rf/axes.md +24 -2
- package/skills/rf/fix.md +58 -10
- package/skills/rf/lenses.md +27 -6
- package/skills/rf/sources.md +86 -24
- package/.next-prod/static/IlC_BH61CJ0hFaOu_akE9/_buildManifest.js +0 -1
- package/.next-prod/static/chunks/app/api/bots/files/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/bots/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/codex/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/glm/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/grok/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/kimi/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/ollama/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/stop/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/claude-stats/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/commands/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/comments/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/db/columns/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/db/connect/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/db/disconnect/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/db/export/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/db/query/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/db/schemas/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/balance/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/credentials/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/models/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/dev/spans/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/extension/version/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/file/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/blame/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/clipboard/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/copy/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/delete/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/expanded/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/index/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/init/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/paste/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/read/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/readdir/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/recent/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/save/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/search/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/stat/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/files/text/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/fs/dirs/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/blob/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branches/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commits/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/current-branch/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/diff/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/discard/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/stage/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/status/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/unstage/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/git/worktree/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/credentials/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/models/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/usage/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/global-state/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/grok/models/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/health/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/[id]/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/files/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/instructions/config/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/credentials/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/models/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/usage/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/definition/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/hover/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/references/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/status/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/mobile-link/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/columns/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/connect/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/export/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/query/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/query/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/note/list/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/note/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/config/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/default-model/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/models/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/start/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/open-cursor/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/open-vscode/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/pi/thinking/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/project-settings/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/project-state/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/edges/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/maps/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/symbols/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/projects/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/push/public-key/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/push/subscribe/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/command/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/connect/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/delete/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/get/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/keys/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/set/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/restart/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/services/config/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/services/scripts/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/turn/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session/image/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session/user-messages/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session-bots/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session-by-path/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session-context/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session-title/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/session-title/suggest/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/delegate/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/search/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/status/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/settings/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/shutdown/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/[id]/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/builtin/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/content/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/files/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/blob/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/diff/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/mark/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/range-diff/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/restore/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/env/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/history/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/running/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/update/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/update-state/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/api/version/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/apps/[...path]/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-6af5bc188af96106.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-6af5bc188af96106.js +0 -1
- /package/.next-prod/static/{IlC_BH61CJ0hFaOu_akE9 → Dj5ykXLzxdIQZcSyjppsm}/_ssgManifest.js +0 -0
package/dist/wsServer.mjs
CHANGED
|
@@ -1451,7 +1451,23 @@ var runSessionStreamHandler = (ws, sessionId) => {
|
|
|
1451
1451
|
|
|
1452
1452
|
// packages/feature/explorer/src/server/codeMap/projectGraph/codeIndex.ts
|
|
1453
1453
|
import { getHeapStatistics } from "v8";
|
|
1454
|
-
|
|
1454
|
+
|
|
1455
|
+
// packages/feature/explorer/src/server/codeMap/eventLoopBudget.ts
|
|
1456
|
+
import { setImmediate as nextMacrotask } from "timers/promises";
|
|
1457
|
+
var SLICE_MS = 8;
|
|
1458
|
+
var sliceStarted = performance.now();
|
|
1459
|
+
var pending;
|
|
1460
|
+
function macrotask() {
|
|
1461
|
+
pending ??= Effect_exports.runPromise(Effect_exports.promise(() => nextMacrotask())).then(() => {
|
|
1462
|
+
sliceStarted = performance.now();
|
|
1463
|
+
pending = void 0;
|
|
1464
|
+
});
|
|
1465
|
+
return pending;
|
|
1466
|
+
}
|
|
1467
|
+
async function inSlice(work) {
|
|
1468
|
+
while (pending || performance.now() - sliceStarted >= SLICE_MS) await macrotask();
|
|
1469
|
+
return work();
|
|
1470
|
+
}
|
|
1455
1471
|
|
|
1456
1472
|
// packages/feature/explorer/src/server/codeMap/projectGraph/indexFiles.ts
|
|
1457
1473
|
import { execFile } from "child_process";
|
|
@@ -1468,7 +1484,8 @@ function registerHandler(handler) {
|
|
|
1468
1484
|
|
|
1469
1485
|
// packages/feature/explorer/src/server/codeMap/projectGraph/indexFiles.ts
|
|
1470
1486
|
var exec = promisify(execFile);
|
|
1471
|
-
var INDEX_SOURCE_LIMIT_BYTES =
|
|
1487
|
+
var INDEX_SOURCE_LIMIT_BYTES = 512 * 1024;
|
|
1488
|
+
var MINIFIED_MIN_BYTES = 4 * 1024;
|
|
1472
1489
|
async function run(effect) {
|
|
1473
1490
|
const result = await Effect_exports.runPromise(Effect_exports.either(effect));
|
|
1474
1491
|
if (Either_exports.isLeft(result)) throw result.left;
|
|
@@ -1700,25 +1717,63 @@ function sortAliasesByLength(aliases) {
|
|
|
1700
1717
|
// packages/feature/explorer/src/server/codeMap/handlers/typescript.ts
|
|
1701
1718
|
import path3 from "path";
|
|
1702
1719
|
|
|
1703
|
-
// packages/feature/explorer/src/
|
|
1720
|
+
// packages/feature/explorer/src/common/syntax/tupleKey.ts
|
|
1721
|
+
function tupleKey(...fields) {
|
|
1722
|
+
return JSON.stringify(fields);
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
// packages/feature/explorer/src/common/syntax/extractCalls.ts
|
|
1704
1726
|
function extractRawCalls(root) {
|
|
1705
1727
|
const out = [];
|
|
1728
|
+
const bindings = /* @__PURE__ */ new Map();
|
|
1729
|
+
const evalScopes = /* @__PURE__ */ new Map();
|
|
1730
|
+
const writeSets = writtenNames(root);
|
|
1731
|
+
const writes = {
|
|
1732
|
+
names: writeSets.names,
|
|
1733
|
+
member: (object, key) => writeSets.members.has(tupleKey(object, key)) || writeSets.members.has(tupleKey(object))
|
|
1734
|
+
};
|
|
1706
1735
|
function visit(node) {
|
|
1707
1736
|
if (node.type === "call_expression" || node.type === "call") {
|
|
1708
1737
|
const fn = node.childForFieldName("function");
|
|
1709
1738
|
const name = calleeLeafName(fn);
|
|
1710
1739
|
if (name) {
|
|
1711
1740
|
const receiverName = receiverRootName(fn);
|
|
1741
|
+
const receiverKind = receiverName ? void 0 : receiverKindOf(fn);
|
|
1742
|
+
const bare = fn?.type === "identifier";
|
|
1743
|
+
const thisBinding = receiverKind === "this" ? thisBindingOf(node) : void 0;
|
|
1744
|
+
const thisOwner = thisBinding?.owner;
|
|
1745
|
+
const receiverDepth = receiverName ? memberDepth(fn) : void 0;
|
|
1746
|
+
const written = bare ? writes.names.has(name) : receiverName ? receiverDepth === 1 && writes.member(receiverName, name) || writes.names.has(receiverName) : receiverKind === "this" ? writes.member("this", name) || !!thisOwner && writes.member(thisOwner, name) : false;
|
|
1712
1747
|
out.push({
|
|
1713
1748
|
calleeName: name,
|
|
1714
1749
|
line: node.startPosition.row + 1,
|
|
1715
|
-
...receiverName ? { receiverName } : {}
|
|
1750
|
+
...receiverName ? { receiverName, receiverDepth } : {},
|
|
1751
|
+
...receiverKind ? { receiverKind } : {},
|
|
1752
|
+
...bare && boundInEnclosingScope(node, name, bindings) ? { shadowed: true } : {},
|
|
1753
|
+
...receiverName && boundInEnclosingScope(node, receiverName, bindings) ? { receiverShadowed: true } : {},
|
|
1754
|
+
...thisOwner ? { thisOwner } : {},
|
|
1755
|
+
...thisBinding?.isStatic ? { thisStatic: true } : {},
|
|
1756
|
+
...inDynamicScope(node, evalScopes) ? { dynamicScope: true } : {},
|
|
1757
|
+
...written ? { written: true } : {}
|
|
1716
1758
|
});
|
|
1717
1759
|
}
|
|
1718
1760
|
} else if (node.type === "jsx_opening_element" || node.type === "jsx_self_closing_element") {
|
|
1719
1761
|
const nameNode = node.childForFieldName("name");
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1762
|
+
const member = jsxMember(nameNode);
|
|
1763
|
+
const name = member ? member.leaf : jsxComponentName(nameNode);
|
|
1764
|
+
if (name) {
|
|
1765
|
+
out.push({
|
|
1766
|
+
calleeName: name,
|
|
1767
|
+
line: node.startPosition.row + 1,
|
|
1768
|
+
...member ? {
|
|
1769
|
+
receiverName: member.root,
|
|
1770
|
+
receiverDepth: member.depth,
|
|
1771
|
+
...boundInEnclosingScope(node, member.root, bindings) ? { receiverShadowed: true } : {}
|
|
1772
|
+
} : boundInEnclosingScope(node, name, bindings) ? { shadowed: true } : {},
|
|
1773
|
+
...inDynamicScope(node, evalScopes) ? { dynamicScope: true } : {},
|
|
1774
|
+
...(member ? writes.names.has(member.root) || member.depth === 1 && writes.member(member.root, name) : writes.names.has(name)) ? { written: true } : {}
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1722
1777
|
}
|
|
1723
1778
|
for (let i = 0; i < node.childCount; i++) {
|
|
1724
1779
|
const c = node.child(i);
|
|
@@ -1745,6 +1800,410 @@ function receiverRootName(node) {
|
|
|
1745
1800
|
}
|
|
1746
1801
|
return void 0;
|
|
1747
1802
|
}
|
|
1803
|
+
var FUNCTION_NODES = /* @__PURE__ */ new Set([
|
|
1804
|
+
"function_declaration",
|
|
1805
|
+
"function_expression",
|
|
1806
|
+
"function",
|
|
1807
|
+
"arrow_function",
|
|
1808
|
+
"method_definition",
|
|
1809
|
+
"generator_function_declaration",
|
|
1810
|
+
"generator_function"
|
|
1811
|
+
]);
|
|
1812
|
+
var VAR_SCOPE_NODES = /* @__PURE__ */ new Set([...FUNCTION_NODES, "class_static_block"]);
|
|
1813
|
+
var DECLARATION_BINDINGS = {
|
|
1814
|
+
lexical_declaration: "binds",
|
|
1815
|
+
variable_declaration: "binds",
|
|
1816
|
+
using_declaration: "binds",
|
|
1817
|
+
function_declaration: "binds",
|
|
1818
|
+
generator_function_declaration: "binds",
|
|
1819
|
+
function_signature: "binds",
|
|
1820
|
+
class_declaration: "binds",
|
|
1821
|
+
abstract_class_declaration: "binds",
|
|
1822
|
+
enum_declaration: "binds",
|
|
1823
|
+
internal_module: "binds",
|
|
1824
|
+
module: "binds",
|
|
1825
|
+
import_alias: "binds",
|
|
1826
|
+
ambient_declaration: "binds",
|
|
1827
|
+
interface_declaration: "type-only",
|
|
1828
|
+
type_alias_declaration: "type-only"
|
|
1829
|
+
};
|
|
1830
|
+
function declarationNames(decl) {
|
|
1831
|
+
if (DECLARATION_BINDINGS[decl.type] !== "binds") return [];
|
|
1832
|
+
switch (decl.type) {
|
|
1833
|
+
case "lexical_declaration":
|
|
1834
|
+
case "variable_declaration":
|
|
1835
|
+
case "using_declaration":
|
|
1836
|
+
return declaratorNames(decl);
|
|
1837
|
+
case "import_alias": {
|
|
1838
|
+
const alias = decl.namedChild(0);
|
|
1839
|
+
return alias?.type === "identifier" ? [alias.text] : [];
|
|
1840
|
+
}
|
|
1841
|
+
case "ambient_declaration": {
|
|
1842
|
+
const inner = decl.namedChild(0);
|
|
1843
|
+
return inner ? declarationNames(inner) : [];
|
|
1844
|
+
}
|
|
1845
|
+
// `declare …`
|
|
1846
|
+
default: {
|
|
1847
|
+
const name = decl.childForFieldName("name");
|
|
1848
|
+
return name && (name.type === "identifier" || name.type === "type_identifier") ? [name.text] : [];
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
var sameNode = (a, b) => !!a && a.startIndex === b.startIndex && a.endIndex === b.endIndex && a.type === b.type;
|
|
1853
|
+
function parameterNames(params) {
|
|
1854
|
+
if (!params) return [];
|
|
1855
|
+
if (params.type === "identifier") return [params.text];
|
|
1856
|
+
return params.namedChildren.flatMap((p) => {
|
|
1857
|
+
if (!p) return [];
|
|
1858
|
+
const pattern = p.type === "required_parameter" || p.type === "optional_parameter" ? p.childForFieldName("pattern") : p;
|
|
1859
|
+
return pattern ? patternBindingNames(pattern) : [];
|
|
1860
|
+
});
|
|
1861
|
+
}
|
|
1862
|
+
function declaratorNames(decl) {
|
|
1863
|
+
return decl.namedChildren.flatMap((d) => {
|
|
1864
|
+
const name = d?.type === "variable_declarator" ? d.childForFieldName("name") : null;
|
|
1865
|
+
return name ? patternBindingNames(name) : [];
|
|
1866
|
+
});
|
|
1867
|
+
}
|
|
1868
|
+
function forInDeclared(stmt) {
|
|
1869
|
+
const kind = stmt.childForFieldName("kind")?.text;
|
|
1870
|
+
const left = stmt.childForFieldName("left");
|
|
1871
|
+
return kind && left ? { kind, names: patternBindingNames(left) } : null;
|
|
1872
|
+
}
|
|
1873
|
+
function hoistedVarNames(body) {
|
|
1874
|
+
if (!body) return [];
|
|
1875
|
+
const out = [];
|
|
1876
|
+
const visit = (n) => {
|
|
1877
|
+
if (n.type === "variable_declaration") out.push(...declaratorNames(n));
|
|
1878
|
+
if (n.type === "for_in_statement") {
|
|
1879
|
+
const d = forInDeclared(n);
|
|
1880
|
+
if (d?.kind === "var") out.push(...d.names);
|
|
1881
|
+
}
|
|
1882
|
+
for (const c of n.namedChildren) if (c && !VAR_SCOPE_NODES.has(c.type)) visit(c);
|
|
1883
|
+
};
|
|
1884
|
+
visit(body);
|
|
1885
|
+
return out;
|
|
1886
|
+
}
|
|
1887
|
+
function unwrapDeclaration(statement) {
|
|
1888
|
+
let cur = statement;
|
|
1889
|
+
for (; ; ) {
|
|
1890
|
+
if (cur.type === "export_statement") {
|
|
1891
|
+
const inner = cur.childForFieldName("declaration") ?? cur.namedChildren.find((c) => !!c && (c.type in DECLARATION_BINDINGS || c.type === "expression_statement")) ?? null;
|
|
1892
|
+
if (!inner) return cur;
|
|
1893
|
+
cur = inner;
|
|
1894
|
+
} else if (cur.type === "expression_statement" && cur.namedChild(0)?.type === "internal_module") {
|
|
1895
|
+
cur = cur.namedChild(0);
|
|
1896
|
+
} else {
|
|
1897
|
+
return cur;
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
function declaredIn(statements) {
|
|
1902
|
+
return statements.namedChildren.flatMap((c) => c ? declarationNames(unwrapDeclaration(c)) : []);
|
|
1903
|
+
}
|
|
1904
|
+
function decoratedParamFunction(node) {
|
|
1905
|
+
if (node.type !== "decorator") return null;
|
|
1906
|
+
const param = node.parent;
|
|
1907
|
+
if (param?.type !== "required_parameter" && param?.type !== "optional_parameter") return null;
|
|
1908
|
+
const fn = param.parent?.parent;
|
|
1909
|
+
return fn && FUNCTION_NODES.has(fn.type) ? fn : null;
|
|
1910
|
+
}
|
|
1911
|
+
function parameterDecorators(fn) {
|
|
1912
|
+
const params = fn.childForFieldName("parameters");
|
|
1913
|
+
return (params?.namedChildren ?? []).flatMap((p) => (p?.namedChildren ?? []).filter((c) => c?.type === "decorator"));
|
|
1914
|
+
}
|
|
1915
|
+
function* outward(node) {
|
|
1916
|
+
let from = node;
|
|
1917
|
+
let cur = node.parent;
|
|
1918
|
+
while (cur && cur.type !== "program") {
|
|
1919
|
+
const fn = decoratedParamFunction(cur);
|
|
1920
|
+
if (fn) {
|
|
1921
|
+
from = fn;
|
|
1922
|
+
cur = fn.parent;
|
|
1923
|
+
continue;
|
|
1924
|
+
}
|
|
1925
|
+
yield [from, cur];
|
|
1926
|
+
from = cur;
|
|
1927
|
+
cur = cur.parent;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
function memberPosition(fn, from) {
|
|
1931
|
+
if (sameNode(fn.childForFieldName("body"), from)) return "body";
|
|
1932
|
+
const params = fn.childForFieldName("parameters") ?? fn.childForFieldName("parameter");
|
|
1933
|
+
return sameNode(params, from) ? "params" : "outside";
|
|
1934
|
+
}
|
|
1935
|
+
function scopePart(scope, from) {
|
|
1936
|
+
if (sameNode(scope.childForFieldName("body"), from)) return "body";
|
|
1937
|
+
if (sameNode(scope.childForFieldName("parameters") ?? scope.childForFieldName("parameter"), from)) return "params";
|
|
1938
|
+
if (from.type === "class_heritage") return "heritage";
|
|
1939
|
+
return "other";
|
|
1940
|
+
}
|
|
1941
|
+
function scopeBindings(scope, part) {
|
|
1942
|
+
if (FUNCTION_NODES.has(scope.type)) {
|
|
1943
|
+
const position = part === "body" || part === "params" ? part : "outside";
|
|
1944
|
+
if (position === "outside") return [];
|
|
1945
|
+
const own = scope.type === "function_expression" || scope.type === "function" || scope.type === "generator_function" ? scope.childForFieldName("name") : null;
|
|
1946
|
+
return [
|
|
1947
|
+
...parameterNames(scope.childForFieldName("parameters") ?? scope.childForFieldName("parameter")),
|
|
1948
|
+
...own ? [own.text] : [],
|
|
1949
|
+
...scope.type === "arrow_function" ? [] : ["arguments"],
|
|
1950
|
+
// an arrow sees the outer one
|
|
1951
|
+
...position === "body" ? hoistedVarNames(scope.childForFieldName("body")) : []
|
|
1952
|
+
];
|
|
1953
|
+
}
|
|
1954
|
+
switch (scope.type) {
|
|
1955
|
+
case "class_static_block":
|
|
1956
|
+
return hoistedVarNames(scope.childForFieldName("body") ?? scope);
|
|
1957
|
+
case "statement_block":
|
|
1958
|
+
return declaredIn(scope);
|
|
1959
|
+
case "switch_body":
|
|
1960
|
+
return scope.namedChildren.flatMap((c) => c && (c.type === "switch_case" || c.type === "switch_default") ? declaredIn(c) : []);
|
|
1961
|
+
case "for_statement": {
|
|
1962
|
+
const init = scope.childForFieldName("initializer");
|
|
1963
|
+
return init && (init.type === "lexical_declaration" || init.type === "variable_declaration") ? declaratorNames(init) : [];
|
|
1964
|
+
}
|
|
1965
|
+
case "for_in_statement":
|
|
1966
|
+
return forInDeclared(scope)?.names ?? [];
|
|
1967
|
+
case "enum_body":
|
|
1968
|
+
return scope.namedChildren.flatMap((c) => {
|
|
1969
|
+
const name = c?.type === "enum_assignment" ? c.namedChild(0) : c;
|
|
1970
|
+
if (!name) return [];
|
|
1971
|
+
if (name.type === "property_identifier" || name.type === "identifier") return [name.text];
|
|
1972
|
+
const value = constantString(name);
|
|
1973
|
+
return value !== void 0 ? [value] : [];
|
|
1974
|
+
});
|
|
1975
|
+
case "catch_clause": {
|
|
1976
|
+
const param = scope.childForFieldName("parameter");
|
|
1977
|
+
return param ? patternBindingNames(param) : [];
|
|
1978
|
+
}
|
|
1979
|
+
case "class":
|
|
1980
|
+
case "class_declaration":
|
|
1981
|
+
case "abstract_class_declaration": {
|
|
1982
|
+
const name = scope.childForFieldName("name");
|
|
1983
|
+
const inside = part === "body" || part === "heritage";
|
|
1984
|
+
return name && inside ? [name.text] : [];
|
|
1985
|
+
}
|
|
1986
|
+
default:
|
|
1987
|
+
return [];
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
function boundInEnclosingScope(node, name, cache) {
|
|
1991
|
+
for (const [from, scope] of outward(node)) {
|
|
1992
|
+
const part = scopePart(scope, from);
|
|
1993
|
+
const key = tupleKey(scope.startIndex, scope.endIndex, scope.type, part);
|
|
1994
|
+
let set = cache.get(key);
|
|
1995
|
+
if (!set) {
|
|
1996
|
+
set = new Set(scopeBindings(scope, part));
|
|
1997
|
+
cache.set(key, set);
|
|
1998
|
+
}
|
|
1999
|
+
if (set.has(name)) return true;
|
|
2000
|
+
}
|
|
2001
|
+
return false;
|
|
2002
|
+
}
|
|
2003
|
+
function memberDepth(node) {
|
|
2004
|
+
let depth = 0;
|
|
2005
|
+
for (let cur = node; cur && (cur.type === "member_expression" || cur.type === "attribute"); cur = cur.childForFieldName("object")) depth++;
|
|
2006
|
+
return depth;
|
|
2007
|
+
}
|
|
2008
|
+
function isDirectEvalCallee(callee) {
|
|
2009
|
+
let cur = callee;
|
|
2010
|
+
while (cur?.type === "parenthesized_expression" && cur.namedChildCount === 1) cur = cur.namedChild(0);
|
|
2011
|
+
return cur?.type === "identifier" && cur.text === "eval";
|
|
2012
|
+
}
|
|
2013
|
+
function callsEvalDirectly(scope, part) {
|
|
2014
|
+
const visit = (n) => {
|
|
2015
|
+
if (n.type === "call_expression" && isDirectEvalCallee(n.childForFieldName("function"))) return true;
|
|
2016
|
+
return n.namedChildren.some((c) => {
|
|
2017
|
+
if (!c || c.type === "class_static_block") return false;
|
|
2018
|
+
if (decoratedParamFunction(c)) return false;
|
|
2019
|
+
if (FUNCTION_NODES.has(c.type)) {
|
|
2020
|
+
return c.namedChildren.some((p) => !!p && memberPosition(c, p) === "outside" && visit(p)) || parameterDecorators(c).some(visit);
|
|
2021
|
+
}
|
|
2022
|
+
return visit(c);
|
|
2023
|
+
});
|
|
2024
|
+
};
|
|
2025
|
+
if (!FUNCTION_NODES.has(scope.type)) return scope.namedChildren.some((c) => !!c && visit(c));
|
|
2026
|
+
return scope.namedChildren.some((c) => {
|
|
2027
|
+
if (!c) return false;
|
|
2028
|
+
const position = memberPosition(scope, c);
|
|
2029
|
+
return position !== "outside" && (part === "all" || position === "params") && visit(c);
|
|
2030
|
+
});
|
|
2031
|
+
}
|
|
2032
|
+
function inDynamicScope(node, cache) {
|
|
2033
|
+
for (const [from, cur] of outward(node)) {
|
|
2034
|
+
if (cur.type === "with_statement") return true;
|
|
2035
|
+
if (!VAR_SCOPE_NODES.has(cur.type)) continue;
|
|
2036
|
+
const position = FUNCTION_NODES.has(cur.type) ? memberPosition(cur, from) : "body";
|
|
2037
|
+
if (position === "outside") continue;
|
|
2038
|
+
const part = position === "params" ? "params" : "all";
|
|
2039
|
+
const key = tupleKey(cur.startIndex, cur.endIndex, cur.type, part);
|
|
2040
|
+
let hit = cache.get(key);
|
|
2041
|
+
if (hit === void 0) {
|
|
2042
|
+
hit = callsEvalDirectly(cur, part);
|
|
2043
|
+
cache.set(key, hit);
|
|
2044
|
+
}
|
|
2045
|
+
if (hit) return true;
|
|
2046
|
+
}
|
|
2047
|
+
return false;
|
|
2048
|
+
}
|
|
2049
|
+
function constantString(node) {
|
|
2050
|
+
if (!node) return void 0;
|
|
2051
|
+
if (node.type === "computed_property_name") return constantString(node.namedChild(0));
|
|
2052
|
+
if (node.type !== "string" && node.type !== "template_string") return void 0;
|
|
2053
|
+
const template = node.type === "template_string";
|
|
2054
|
+
let out = "";
|
|
2055
|
+
for (const c of node.namedChildren) {
|
|
2056
|
+
if (!c) continue;
|
|
2057
|
+
if (c.type === "string_fragment") {
|
|
2058
|
+
out += c.text;
|
|
2059
|
+
continue;
|
|
2060
|
+
}
|
|
2061
|
+
if (c.type !== "escape_sequence") return void 0;
|
|
2062
|
+
const decoded = decodeEscape(c.text, template);
|
|
2063
|
+
if (decoded === void 0) return void 0;
|
|
2064
|
+
out += decoded;
|
|
2065
|
+
}
|
|
2066
|
+
return out;
|
|
2067
|
+
}
|
|
2068
|
+
var SIMPLE_ESCAPES = { n: "\n", t: " ", r: "\r", b: "\b", f: "\f", v: "\v" };
|
|
2069
|
+
function decodeEscape(token, template) {
|
|
2070
|
+
const body = token.slice(1);
|
|
2071
|
+
const c = body[0];
|
|
2072
|
+
if (c === void 0) return void 0;
|
|
2073
|
+
if (body === "\n" || body === "\r" || body === "\r\n" || body === "\u2028" || body === "\u2029") return "";
|
|
2074
|
+
if (c === "u") {
|
|
2075
|
+
const m = /^u(?:\{([0-9a-fA-F]+)\}|([0-9a-fA-F]{4}))$/.exec(body);
|
|
2076
|
+
if (!m) return void 0;
|
|
2077
|
+
const cp = parseInt(m[1] ?? m[2], 16);
|
|
2078
|
+
return cp <= 1114111 ? String.fromCodePoint(cp) : void 0;
|
|
2079
|
+
}
|
|
2080
|
+
if (c === "x") {
|
|
2081
|
+
const m = /^x([0-9a-fA-F]{2})$/.exec(body);
|
|
2082
|
+
return m ? String.fromCharCode(parseInt(m[1], 16)) : void 0;
|
|
2083
|
+
}
|
|
2084
|
+
if (c >= "0" && c <= "9") {
|
|
2085
|
+
if (body === "0") return "\0";
|
|
2086
|
+
if (template) return void 0;
|
|
2087
|
+
if (c === "8" || c === "9") return body;
|
|
2088
|
+
const m = /^([0-3][0-7]{0,2}|[4-7][0-7]?)([\s\S]*)$/.exec(body);
|
|
2089
|
+
return m ? String.fromCharCode(parseInt(m[1], 8)) + m[2] : void 0;
|
|
2090
|
+
}
|
|
2091
|
+
if (body.length !== 1) return void 0;
|
|
2092
|
+
return SIMPLE_ESCAPES[c] ?? c;
|
|
2093
|
+
}
|
|
2094
|
+
var NO_RUNTIME_WRAPPERS = /* @__PURE__ */ new Set(["parenthesized_expression", "as_expression", "satisfies_expression", "non_null_expression", "type_assertion"]);
|
|
2095
|
+
function unwrapExpression(node) {
|
|
2096
|
+
let cur = node;
|
|
2097
|
+
while (cur && NO_RUNTIME_WRAPPERS.has(cur.type)) {
|
|
2098
|
+
cur = cur.type === "type_assertion" ? cur.namedChild(cur.namedChildCount - 1) : cur.namedChild(0);
|
|
2099
|
+
}
|
|
2100
|
+
return cur;
|
|
2101
|
+
}
|
|
2102
|
+
function writtenNames(root) {
|
|
2103
|
+
const names = /* @__PURE__ */ new Set();
|
|
2104
|
+
const members = /* @__PURE__ */ new Set();
|
|
2105
|
+
const record = (written) => {
|
|
2106
|
+
const target = unwrapExpression(written);
|
|
2107
|
+
if (!target) return;
|
|
2108
|
+
switch (target.type) {
|
|
2109
|
+
case "identifier":
|
|
2110
|
+
case "shorthand_property_identifier_pattern":
|
|
2111
|
+
names.add(target.text);
|
|
2112
|
+
return;
|
|
2113
|
+
case "member_expression":
|
|
2114
|
+
case "subscript_expression": {
|
|
2115
|
+
const object = unwrapExpression(target.childForFieldName("object"));
|
|
2116
|
+
if (object?.type !== "identifier" && object?.type !== "this") return;
|
|
2117
|
+
const key = target.type === "member_expression" ? target.childForFieldName("property")?.text : constantString(target.childForFieldName("index"));
|
|
2118
|
+
members.add(key === void 0 ? tupleKey(object.text) : tupleKey(object.text, key));
|
|
2119
|
+
return;
|
|
2120
|
+
}
|
|
2121
|
+
case "array_pattern":
|
|
2122
|
+
for (const c of target.namedChildren) record(c);
|
|
2123
|
+
return;
|
|
2124
|
+
case "object_pattern":
|
|
2125
|
+
for (const c of target.namedChildren) {
|
|
2126
|
+
if (!c) continue;
|
|
2127
|
+
if (c.type === "pair_pattern") record(c.childForFieldName("value"));
|
|
2128
|
+
else if (c.type === "object_assignment_pattern") record(c.childForFieldName("left"));
|
|
2129
|
+
else record(c);
|
|
2130
|
+
}
|
|
2131
|
+
return;
|
|
2132
|
+
case "assignment_pattern":
|
|
2133
|
+
record(target.childForFieldName("left"));
|
|
2134
|
+
return;
|
|
2135
|
+
case "rest_pattern":
|
|
2136
|
+
record(target.namedChild(0));
|
|
2137
|
+
return;
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
2140
|
+
const visit = (n) => {
|
|
2141
|
+
if (n.type === "assignment_expression" || n.type === "augmented_assignment_expression") record(n.childForFieldName("left"));
|
|
2142
|
+
else if (n.type === "update_expression") record(n.childForFieldName("argument"));
|
|
2143
|
+
else if (n.type === "for_in_statement" && !n.childForFieldName("kind")) record(n.childForFieldName("left"));
|
|
2144
|
+
for (const c of n.namedChildren) if (c) visit(c);
|
|
2145
|
+
};
|
|
2146
|
+
visit(root);
|
|
2147
|
+
return { names, members };
|
|
2148
|
+
}
|
|
2149
|
+
var CLASS_NODES = /* @__PURE__ */ new Set(["class_declaration", "class", "abstract_class_declaration"]);
|
|
2150
|
+
var OWN_THIS_FUNCTIONS = /* @__PURE__ */ new Set([
|
|
2151
|
+
"function_declaration",
|
|
2152
|
+
"function_expression",
|
|
2153
|
+
"function",
|
|
2154
|
+
"generator_function_declaration",
|
|
2155
|
+
"generator_function"
|
|
2156
|
+
]);
|
|
2157
|
+
function isTopLevel(node) {
|
|
2158
|
+
const parent = node.parent;
|
|
2159
|
+
return parent?.type === "program" || parent?.type === "export_statement" && parent.parent?.type === "program";
|
|
2160
|
+
}
|
|
2161
|
+
function indexedClassName(cls) {
|
|
2162
|
+
return cls.type !== "class" && isTopLevel(cls) ? cls.childForFieldName("name")?.text : void 0;
|
|
2163
|
+
}
|
|
2164
|
+
function indexedObjectName(obj) {
|
|
2165
|
+
const declarator = obj.parent;
|
|
2166
|
+
if (declarator?.type !== "variable_declarator") return void 0;
|
|
2167
|
+
const decl = declarator.parent;
|
|
2168
|
+
const name = declarator.childForFieldName("name");
|
|
2169
|
+
return decl && name?.type === "identifier" && isTopLevel(decl) ? name.text : void 0;
|
|
2170
|
+
}
|
|
2171
|
+
function classOwner(classBody) {
|
|
2172
|
+
const cls = classBody?.type === "class_body" ? classBody.parent : null;
|
|
2173
|
+
return cls && CLASS_NODES.has(cls.type) ? indexedClassName(cls) : void 0;
|
|
2174
|
+
}
|
|
2175
|
+
function thisBindingOf(node) {
|
|
2176
|
+
const isStaticMember = (member) => member.children.some((c) => c?.type === "static");
|
|
2177
|
+
for (const [from, cur] of outward(node)) {
|
|
2178
|
+
if (cur.type === "arrow_function") continue;
|
|
2179
|
+
if (OWN_THIS_FUNCTIONS.has(cur.type)) {
|
|
2180
|
+
if (memberPosition(cur, from) === "outside") continue;
|
|
2181
|
+
const pair = cur.parent;
|
|
2182
|
+
if (pair?.type === "pair" && sameNode(pair.childForFieldName("value"), cur) && pair.parent?.type === "object") {
|
|
2183
|
+
return { owner: indexedObjectName(pair.parent), isStatic: false };
|
|
2184
|
+
}
|
|
2185
|
+
return void 0;
|
|
2186
|
+
}
|
|
2187
|
+
if (cur.type === "method_definition") {
|
|
2188
|
+
if (memberPosition(cur, from) === "outside") continue;
|
|
2189
|
+
const container = cur.parent;
|
|
2190
|
+
return container?.type === "object" ? { owner: indexedObjectName(container), isStatic: false } : { owner: classOwner(container), isStatic: isStaticMember(cur) };
|
|
2191
|
+
}
|
|
2192
|
+
if (cur.type === "public_field_definition" || cur.type === "field_definition") {
|
|
2193
|
+
if (sameNode(cur.childForFieldName("value"), from)) return { owner: classOwner(cur.parent), isStatic: isStaticMember(cur) };
|
|
2194
|
+
continue;
|
|
2195
|
+
}
|
|
2196
|
+
if (cur.type === "class_static_block") return { owner: classOwner(cur.parent), isStatic: true };
|
|
2197
|
+
}
|
|
2198
|
+
return void 0;
|
|
2199
|
+
}
|
|
2200
|
+
function receiverKindOf(node) {
|
|
2201
|
+
if (!node || node.type !== "member_expression" && node.type !== "attribute") return void 0;
|
|
2202
|
+
const object = node.childForFieldName("object");
|
|
2203
|
+
if (object?.type === "this") return "this";
|
|
2204
|
+
if (object?.type === "super") return "super";
|
|
2205
|
+
return "expression";
|
|
2206
|
+
}
|
|
1748
2207
|
function calleeLeafName(node) {
|
|
1749
2208
|
if (!node) return null;
|
|
1750
2209
|
if (node.type === "identifier" || node.type === "shorthand_property_identifier") {
|
|
@@ -1758,11 +2217,22 @@ function calleeLeafName(node) {
|
|
|
1758
2217
|
const prop = node.childForFieldName("attribute");
|
|
1759
2218
|
return prop?.text ?? null;
|
|
1760
2219
|
}
|
|
1761
|
-
if (node.type === "
|
|
2220
|
+
if (node.type === "call") {
|
|
1762
2221
|
return calleeLeafName(node.childForFieldName("function"));
|
|
1763
2222
|
}
|
|
1764
2223
|
return null;
|
|
1765
2224
|
}
|
|
2225
|
+
function jsxMember(node) {
|
|
2226
|
+
if (node?.type !== "member_expression" && node?.type !== "jsx_member_expression") return null;
|
|
2227
|
+
const leaf = node.childForFieldName("property") ?? node.namedChild(node.namedChildCount - 1);
|
|
2228
|
+
let depth = 0;
|
|
2229
|
+
let cur = node;
|
|
2230
|
+
while (cur && (cur.type === "member_expression" || cur.type === "jsx_member_expression")) {
|
|
2231
|
+
depth++;
|
|
2232
|
+
cur = cur.childForFieldName("object") ?? cur.namedChild(0);
|
|
2233
|
+
}
|
|
2234
|
+
return leaf && cur?.type === "identifier" ? { root: cur.text, leaf: leaf.text, depth } : null;
|
|
2235
|
+
}
|
|
1766
2236
|
function jsxComponentName(node) {
|
|
1767
2237
|
if (!node) return null;
|
|
1768
2238
|
if (node.type === "identifier") {
|
|
@@ -1819,7 +2289,11 @@ function extractPythonImportBindingsDeep(root) {
|
|
|
1819
2289
|
}
|
|
1820
2290
|
return out;
|
|
1821
2291
|
}
|
|
2292
|
+
function isTypeOnly(node) {
|
|
2293
|
+
return node.children.some((c) => c?.type === "type");
|
|
2294
|
+
}
|
|
1822
2295
|
function extractJsTsBindings(n, src, out) {
|
|
2296
|
+
if (isTypeOnly(n)) return;
|
|
1823
2297
|
const specifier = stripQuotes(src.text);
|
|
1824
2298
|
let clause = null;
|
|
1825
2299
|
for (let j = 0; j < n.namedChildCount; j++) {
|
|
@@ -1829,7 +2303,7 @@ function extractJsTsBindings(n, src, out) {
|
|
|
1829
2303
|
break;
|
|
1830
2304
|
}
|
|
1831
2305
|
}
|
|
1832
|
-
if (!clause) return;
|
|
2306
|
+
if (!clause || isTypeOnly(clause)) return;
|
|
1833
2307
|
for (let j = 0; j < clause.namedChildCount; j++) {
|
|
1834
2308
|
const c = clause.namedChild(j);
|
|
1835
2309
|
if (!c) continue;
|
|
@@ -1841,7 +2315,7 @@ function extractJsTsBindings(n, src, out) {
|
|
|
1841
2315
|
} else if (c.type === "named_imports") {
|
|
1842
2316
|
for (let k = 0; k < c.namedChildCount; k++) {
|
|
1843
2317
|
const spec = c.namedChild(k);
|
|
1844
|
-
if (!spec || spec.type !== "import_specifier") continue;
|
|
2318
|
+
if (!spec || spec.type !== "import_specifier" || isTypeOnly(spec)) continue;
|
|
1845
2319
|
const nameNode = spec.childForFieldName("name");
|
|
1846
2320
|
const aliasNode = spec.childForFieldName("alias");
|
|
1847
2321
|
if (nameNode) {
|
|
@@ -1920,12 +2394,34 @@ function extractPythonFromBindings(n, out) {
|
|
|
1920
2394
|
out.push({ specifier, importedName: "*", localName: "*" });
|
|
1921
2395
|
}
|
|
1922
2396
|
}
|
|
2397
|
+
function patternBindingNames(node) {
|
|
2398
|
+
switch (node.type) {
|
|
2399
|
+
case "identifier":
|
|
2400
|
+
case "shorthand_property_identifier_pattern":
|
|
2401
|
+
return [node.text];
|
|
2402
|
+
case "pair_pattern": {
|
|
2403
|
+
const value = node.childForFieldName("value");
|
|
2404
|
+
return value ? patternBindingNames(value) : [];
|
|
2405
|
+
}
|
|
2406
|
+
case "object_assignment_pattern":
|
|
2407
|
+
case "assignment_pattern": {
|
|
2408
|
+
const left = node.childForFieldName("left");
|
|
2409
|
+
return left ? patternBindingNames(left) : [];
|
|
2410
|
+
}
|
|
2411
|
+
case "object_pattern":
|
|
2412
|
+
case "array_pattern":
|
|
2413
|
+
case "rest_pattern":
|
|
2414
|
+
return node.namedChildren.flatMap((c) => c ? patternBindingNames(c) : []);
|
|
2415
|
+
default:
|
|
2416
|
+
return [];
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
1923
2419
|
function extractReexports(root) {
|
|
1924
2420
|
const out = [];
|
|
1925
2421
|
for (let i = 0; i < root.namedChildCount; i++) {
|
|
1926
2422
|
const n = root.namedChild(i);
|
|
1927
2423
|
if (!n || n.type !== "export_statement") continue;
|
|
1928
|
-
if (n
|
|
2424
|
+
if (isTypeOnly(n)) continue;
|
|
1929
2425
|
const src = n.childForFieldName("source");
|
|
1930
2426
|
const specifier = src ? stripQuotes(src.text) : "";
|
|
1931
2427
|
const add = (localName, importedName = localName) => {
|
|
@@ -1952,8 +2448,8 @@ function extractReexports(root) {
|
|
|
1952
2448
|
const isDefault = n.children.some((c) => c.type === "default");
|
|
1953
2449
|
if (declaration?.type === "lexical_declaration" || declaration?.type === "variable_declaration") {
|
|
1954
2450
|
for (const declarator of declaration.namedChildren) {
|
|
1955
|
-
const name = declarator
|
|
1956
|
-
if (name
|
|
2451
|
+
const name = declarator?.childForFieldName("name");
|
|
2452
|
+
if (name) for (const bound of patternBindingNames(name)) add(bound);
|
|
1957
2453
|
}
|
|
1958
2454
|
} else {
|
|
1959
2455
|
const name = declaration?.childForFieldName("name") ?? n.childForFieldName("value");
|
|
@@ -1965,7 +2461,7 @@ function extractReexports(root) {
|
|
|
1965
2461
|
for (let k = 0; k < clause.namedChildCount; k++) {
|
|
1966
2462
|
const spec = clause.namedChild(k);
|
|
1967
2463
|
if (!spec || spec.type !== "export_specifier") continue;
|
|
1968
|
-
if (spec
|
|
2464
|
+
if (isTypeOnly(spec)) continue;
|
|
1969
2465
|
const nameNode = spec.childForFieldName("name");
|
|
1970
2466
|
const aliasNode = spec.childForFieldName("alias");
|
|
1971
2467
|
if (!nameNode) continue;
|
|
@@ -1990,7 +2486,7 @@ function firstNamedChildOfType(node, type) {
|
|
|
1990
2486
|
return null;
|
|
1991
2487
|
}
|
|
1992
2488
|
|
|
1993
|
-
// packages/feature/explorer/src/
|
|
2489
|
+
// packages/feature/explorer/src/common/syntax/extractSymbols.ts
|
|
1994
2490
|
function hashText(s) {
|
|
1995
2491
|
let h1 = 3735928559;
|
|
1996
2492
|
let h2 = 1103547991;
|
|
@@ -2089,20 +2585,25 @@ function extractClassMembers(body, parentQname) {
|
|
|
2089
2585
|
const m = body.namedChild(i);
|
|
2090
2586
|
if (!m) continue;
|
|
2091
2587
|
if (m.type === "method_definition") {
|
|
2092
|
-
out.push(
|
|
2588
|
+
out.push(withStatic(
|
|
2589
|
+
m,
|
|
2093
2590
|
makeSymbol(m, nameOf(m), "method", parentQname, [], extractParams(m))
|
|
2094
|
-
);
|
|
2591
|
+
));
|
|
2095
2592
|
} else if (m.type === "public_field_definition") {
|
|
2096
2593
|
const value = m.childForFieldName("value");
|
|
2097
2594
|
if (value && (value.type === "arrow_function" || value.type === "function_expression")) {
|
|
2098
|
-
out.push(
|
|
2595
|
+
out.push(withStatic(
|
|
2596
|
+
m,
|
|
2099
2597
|
makeSymbol(m, nameOf(m), "method", parentQname, [], extractParams(value))
|
|
2100
|
-
);
|
|
2598
|
+
));
|
|
2101
2599
|
}
|
|
2102
2600
|
}
|
|
2103
2601
|
}
|
|
2104
2602
|
return out;
|
|
2105
2603
|
}
|
|
2604
|
+
function withStatic(member, symbol) {
|
|
2605
|
+
return member.children.some((c) => c?.type === "static") ? { ...symbol, static: true } : symbol;
|
|
2606
|
+
}
|
|
2106
2607
|
function callableInitializer(value, depth = 0) {
|
|
2107
2608
|
if (!value || depth > 8) return null;
|
|
2108
2609
|
if (value.type === "arrow_function" || value.type === "function_expression") return value;
|
|
@@ -2128,6 +2629,8 @@ function callableInitializer(value, depth = 0) {
|
|
|
2128
2629
|
}
|
|
2129
2630
|
function extractFromLexical(decl, parentQname, _isExported) {
|
|
2130
2631
|
const out = [];
|
|
2632
|
+
const declarators = decl.namedChildren.filter((c) => c?.type === "variable_declarator");
|
|
2633
|
+
const rangeOf = (declarator) => declarators.length > 1 ? declarator : decl;
|
|
2131
2634
|
for (let i = 0; i < decl.namedChildCount; i++) {
|
|
2132
2635
|
const declarator = decl.namedChild(i);
|
|
2133
2636
|
if (!declarator || declarator.type !== "variable_declarator") continue;
|
|
@@ -2138,16 +2641,18 @@ function extractFromLexical(decl, parentQname, _isExported) {
|
|
|
2138
2641
|
const functionValue = callableInitializer(valueNode);
|
|
2139
2642
|
const isFn = functionValue !== null;
|
|
2140
2643
|
const params = functionValue ? extractParams(functionValue) : void 0;
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
params
|
|
2149
|
-
)
|
|
2644
|
+
const symbol = makeSymbol(
|
|
2645
|
+
rangeOf(declarator),
|
|
2646
|
+
name,
|
|
2647
|
+
isFn ? "function" : "const",
|
|
2648
|
+
parentQname,
|
|
2649
|
+
[],
|
|
2650
|
+
params
|
|
2150
2651
|
);
|
|
2652
|
+
if (nameNode.type === "object_pattern" || nameNode.type === "array_pattern") {
|
|
2653
|
+
symbol.boundNames = patternBindingNames(nameNode);
|
|
2654
|
+
}
|
|
2655
|
+
out.push(symbol);
|
|
2151
2656
|
if (valueNode && valueNode.type === "object" && !isFn) {
|
|
2152
2657
|
const childParent = parentQname ? `${parentQname}>${name}` : name;
|
|
2153
2658
|
for (let j = 0; j < valueNode.namedChildCount; j++) {
|
|
@@ -2466,7 +2971,7 @@ function extractImportHeader(rootNode) {
|
|
|
2466
2971
|
if (!c) continue;
|
|
2467
2972
|
const isHeader = (
|
|
2468
2973
|
// JS/TS: `import X from 'y'`, `import 'y'`
|
|
2469
|
-
c.type === "import_statement" || // JS/TS: `export { x } from '
|
|
2974
|
+
c.type === "import_statement" || // JS/TS: `export { x } from '../../server/codeMap/y'` (re-export with `source` field)
|
|
2470
2975
|
c.type === "export_statement" && c.childForFieldName("source") !== null || // Python: `from x import y` / `from .x import y`
|
|
2471
2976
|
c.type === "import_from_statement" || // Python: `import x` / `import x.y as z`
|
|
2472
2977
|
c.type === "future_import_statement" || // Lean 4: `import Mathlib`, `public import X`, `import all X`.
|
|
@@ -2727,16 +3232,162 @@ function readPythonModuleSpec(node) {
|
|
|
2727
3232
|
}
|
|
2728
3233
|
return "";
|
|
2729
3234
|
}
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
}
|
|
2736
|
-
function
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
3235
|
+
|
|
3236
|
+
// packages/feature/explorer/src/server/codeMap/handlers/defaults.ts
|
|
3237
|
+
function topLevelDefinition(file, name) {
|
|
3238
|
+
const own = file.symbolsByQname.get(name);
|
|
3239
|
+
return own && !own.qualifiedName.includes(">") ? own : null;
|
|
3240
|
+
}
|
|
3241
|
+
function noSubmodule() {
|
|
3242
|
+
return null;
|
|
3243
|
+
}
|
|
3244
|
+
function noStringConstants() {
|
|
3245
|
+
return /* @__PURE__ */ new Map();
|
|
3246
|
+
}
|
|
3247
|
+
async function noFileLocalContext() {
|
|
3248
|
+
return void 0;
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3251
|
+
// packages/feature/explorer/src/server/codeMap/analytics/sourceText.ts
|
|
3252
|
+
function skipString(text, start) {
|
|
3253
|
+
const q = text[start];
|
|
3254
|
+
let i = start + 1;
|
|
3255
|
+
while (i < text.length) {
|
|
3256
|
+
const c = text[i];
|
|
3257
|
+
if (c === "\\") {
|
|
3258
|
+
i += 2;
|
|
3259
|
+
continue;
|
|
3260
|
+
}
|
|
3261
|
+
if (c === q) return i + 1;
|
|
3262
|
+
if (c === "\n" && q !== "`") return i;
|
|
3263
|
+
i++;
|
|
3264
|
+
}
|
|
3265
|
+
return i;
|
|
3266
|
+
}
|
|
3267
|
+
function declaredIn2(text, decls) {
|
|
3268
|
+
const lineOf = lineIndex(text);
|
|
3269
|
+
return (name, offset) => decls.get(name) === lineOf(offset);
|
|
3270
|
+
}
|
|
3271
|
+
function jsStringConstants(text, decls) {
|
|
3272
|
+
const out = /* @__PURE__ */ new Map();
|
|
3273
|
+
const declared = declaredIn2(text, decls);
|
|
3274
|
+
const re = /^(?:export\s+)?const\s+([A-Za-z_$][\w$]*)\s*(?::\s*[\w.[\]| ]+)?=\s*(["'])((?:\\.|(?!\2)[^\\\n])*)\2\s*;?\s*$/gm;
|
|
3275
|
+
const seen = /* @__PURE__ */ new Map();
|
|
3276
|
+
for (const m of text.matchAll(re)) {
|
|
3277
|
+
if (!declared(m[1], m.index)) continue;
|
|
3278
|
+
seen.set(m[1], (seen.get(m[1]) ?? 0) + 1);
|
|
3279
|
+
out.set(m[1], m[3]);
|
|
3280
|
+
}
|
|
3281
|
+
for (const [name, n] of seen) if (n > 1) out.delete(name);
|
|
3282
|
+
return out;
|
|
3283
|
+
}
|
|
3284
|
+
function pythonStringConstants(text, decls) {
|
|
3285
|
+
const out = /* @__PURE__ */ new Map();
|
|
3286
|
+
if (/^[ \t]*from\s+\S+\s+import\s+\*/m.test(text)) return out;
|
|
3287
|
+
const declared = declaredIn2(text, decls);
|
|
3288
|
+
const re = /^([A-Za-z_]\w*)\s*(?::\s*[\w.[\]| ]+)?=\s*(["'])((?:\\.|(?!\2)[^\\\n])*)\2\s*$/gm;
|
|
3289
|
+
const inDecorator = regionIndex(decoratorArgRegions(text));
|
|
3290
|
+
const candidates = [...text.matchAll(re)].filter((m) => declared(m[1], m.index));
|
|
3291
|
+
if (!candidates.length) return out;
|
|
3292
|
+
const wanted = new Set(candidates.map((m) => m[1]));
|
|
3293
|
+
const uses = /* @__PURE__ */ new Map();
|
|
3294
|
+
for (const u of text.matchAll(/(?<![\w.])[A-Za-z_]\w*/g)) {
|
|
3295
|
+
if (!wanted.has(u[0])) continue;
|
|
3296
|
+
let at = uses.get(u[0]);
|
|
3297
|
+
if (!at) uses.set(u[0], at = []);
|
|
3298
|
+
at.push(u.index);
|
|
3299
|
+
}
|
|
3300
|
+
const walrus = /\s*:=/y;
|
|
3301
|
+
const isWalrusTarget = (end) => {
|
|
3302
|
+
walrus.lastIndex = end;
|
|
3303
|
+
return walrus.test(text);
|
|
3304
|
+
};
|
|
3305
|
+
for (const m of candidates) {
|
|
3306
|
+
const name = m[1];
|
|
3307
|
+
const definition = m.index;
|
|
3308
|
+
const proven = (uses.get(name) ?? []).every((at) => at === definition || inDecorator(at) && !isWalrusTarget(at + name.length));
|
|
3309
|
+
if (proven) out.set(name, m[3]);
|
|
3310
|
+
}
|
|
3311
|
+
return out;
|
|
3312
|
+
}
|
|
3313
|
+
function lineIndex(text) {
|
|
3314
|
+
const starts = [0];
|
|
3315
|
+
for (let i = text.indexOf("\n"); i !== -1; i = text.indexOf("\n", i + 1)) starts.push(i + 1);
|
|
3316
|
+
return (offset) => {
|
|
3317
|
+
let lo = 0, hi = starts.length - 1;
|
|
3318
|
+
while (lo < hi) {
|
|
3319
|
+
const mid = lo + hi + 1 >>> 1;
|
|
3320
|
+
if (starts[mid] <= offset) lo = mid;
|
|
3321
|
+
else hi = mid - 1;
|
|
3322
|
+
}
|
|
3323
|
+
return lo + 1;
|
|
3324
|
+
};
|
|
3325
|
+
}
|
|
3326
|
+
function regionIndex(regions) {
|
|
3327
|
+
const sorted = [...regions].sort((a, b) => a[0] - b[0]);
|
|
3328
|
+
const reach = [];
|
|
3329
|
+
for (const [, end] of sorted) reach.push(Math.max(end, reach[reach.length - 1] ?? -1));
|
|
3330
|
+
return (at) => {
|
|
3331
|
+
let lo = 0, hi = sorted.length - 1, last = -1;
|
|
3332
|
+
while (lo <= hi) {
|
|
3333
|
+
const mid = lo + hi >>> 1;
|
|
3334
|
+
if (sorted[mid][0] <= at) {
|
|
3335
|
+
last = mid;
|
|
3336
|
+
lo = mid + 1;
|
|
3337
|
+
} else hi = mid - 1;
|
|
3338
|
+
}
|
|
3339
|
+
return last >= 0 && at < reach[last];
|
|
3340
|
+
};
|
|
3341
|
+
}
|
|
3342
|
+
function decoratorArgRegions(text) {
|
|
3343
|
+
const starts = [...text.matchAll(/^[ \t]*@[\w.]+\(/gm)].map((m) => m.index + m[0].length);
|
|
3344
|
+
const out = [];
|
|
3345
|
+
const openAt = /* @__PURE__ */ new Map();
|
|
3346
|
+
let next = 0;
|
|
3347
|
+
let depth = 0;
|
|
3348
|
+
for (let i = 0; i < text.length; i++) {
|
|
3349
|
+
while (next < starts.length && starts[next] - 1 < i) {
|
|
3350
|
+
const region = scanDecoratorArgs(text, starts[next++]);
|
|
3351
|
+
if (region) out.push(region);
|
|
3352
|
+
}
|
|
3353
|
+
const c = text[i];
|
|
3354
|
+
if (c === '"' || c === "'" || c === "`") {
|
|
3355
|
+
i = skipString(text, i) - 1;
|
|
3356
|
+
continue;
|
|
3357
|
+
}
|
|
3358
|
+
if (c === "(" || c === "[" || c === "{") {
|
|
3359
|
+
if (next < starts.length && starts[next] - 1 === i) openAt.set(depth, starts[next++]);
|
|
3360
|
+
depth++;
|
|
3361
|
+
} else if (c === ")" || c === "]" || c === "}") {
|
|
3362
|
+
depth--;
|
|
3363
|
+
const start = openAt.get(depth);
|
|
3364
|
+
if (start !== void 0) {
|
|
3365
|
+
out.push([start, i]);
|
|
3366
|
+
openAt.delete(depth);
|
|
3367
|
+
}
|
|
3368
|
+
}
|
|
3369
|
+
}
|
|
3370
|
+
while (next < starts.length) {
|
|
3371
|
+
const region = scanDecoratorArgs(text, starts[next++]);
|
|
3372
|
+
if (region) out.push(region);
|
|
3373
|
+
}
|
|
3374
|
+
return out.sort((x, y) => x[0] - y[0]);
|
|
3375
|
+
}
|
|
3376
|
+
function scanDecoratorArgs(text, start) {
|
|
3377
|
+
let depth = 0;
|
|
3378
|
+
for (let i = start; i < text.length; i++) {
|
|
3379
|
+
const c = text[i];
|
|
3380
|
+
if (c === '"' || c === "'" || c === "`") {
|
|
3381
|
+
i = skipString(text, i) - 1;
|
|
3382
|
+
continue;
|
|
3383
|
+
}
|
|
3384
|
+
if (c === "(" || c === "[" || c === "{") depth++;
|
|
3385
|
+
else if (c === ")" || c === "]" || c === "}") {
|
|
3386
|
+
if (depth === 0) return [start, i];
|
|
3387
|
+
depth--;
|
|
3388
|
+
}
|
|
3389
|
+
}
|
|
3390
|
+
return null;
|
|
2740
3391
|
}
|
|
2741
3392
|
|
|
2742
3393
|
// packages/feature/explorer/src/server/codeMap/handlers/typescript.ts
|
|
@@ -2780,6 +3431,9 @@ function findExportedSymbol(file, name, depth, visited, allFiles) {
|
|
|
2780
3431
|
}
|
|
2781
3432
|
return found;
|
|
2782
3433
|
}
|
|
3434
|
+
function resolveExport(file, name, allFiles) {
|
|
3435
|
+
return findExportedSymbol(file, name, 0, /* @__PURE__ */ new Set(), allFiles);
|
|
3436
|
+
}
|
|
2783
3437
|
function findReceiverMethod(file, receiverImportedName, methodName, depth, visited, allFiles) {
|
|
2784
3438
|
if (depth > REEXPORT_MAX_DEPTH) return null;
|
|
2785
3439
|
if (receiverImportedName === "*") {
|
|
@@ -2798,18 +3452,30 @@ function findReceiverMethod(file, receiverImportedName, methodName, depth, visit
|
|
|
2798
3452
|
const receiver = findExportedSymbol(file, receiverImportedName, depth, branch, allFiles);
|
|
2799
3453
|
if (!receiver || receiver === "ambiguous") return null;
|
|
2800
3454
|
const owner = allFiles.get(receiver.filePath);
|
|
2801
|
-
const member = owner?.symbolsByQname.get(
|
|
3455
|
+
const member = owner?.symbolsByQname.get(qualify(receiver.qualifiedName, methodName));
|
|
2802
3456
|
return member && isFunctionLikeKind(member.kind) ? member : null;
|
|
2803
3457
|
}
|
|
3458
|
+
var JS_TS_DECISIONS = {
|
|
3459
|
+
nodes: /* @__PURE__ */ new Set(["if_statement", "for_statement", "for_in_statement", "while_statement", "do_statement", "switch_case", "catch_clause", "ternary_expression"]),
|
|
3460
|
+
binary: { type: "binary_expression", operators: /* @__PURE__ */ new Set(["&&", "||", "??"]) }
|
|
3461
|
+
};
|
|
2804
3462
|
function makeTsFamilyHandler(grammarId, extensions) {
|
|
2805
3463
|
return {
|
|
2806
3464
|
grammarId,
|
|
2807
3465
|
extensions,
|
|
3466
|
+
decisions: JS_TS_DECISIONS,
|
|
3467
|
+
fileLocalContext: noFileLocalContext,
|
|
3468
|
+
exportedDefinition(file, name, allFiles) {
|
|
3469
|
+
const found = resolveExport(file, name, allFiles);
|
|
3470
|
+
return found && found !== "ambiguous" ? found : null;
|
|
3471
|
+
},
|
|
3472
|
+
submoduleSpecifier: noSubmodule,
|
|
3473
|
+
moduleStringConstants: jsStringConstants,
|
|
2808
3474
|
extractSymbols(root, _source) {
|
|
2809
3475
|
return extractSymbolsFromTree(root);
|
|
2810
3476
|
},
|
|
2811
3477
|
extractImports(root) {
|
|
2812
|
-
const specs =
|
|
3478
|
+
const specs = walkForJsTsImports(root);
|
|
2813
3479
|
const baseBindings = extractImportBindings(root);
|
|
2814
3480
|
const reexportBindings = extractReexports(root);
|
|
2815
3481
|
return {
|
|
@@ -2895,87 +3561,92 @@ function makeTsFamilyHandler(grammarId, extensions) {
|
|
|
2895
3561
|
}
|
|
2896
3562
|
return null;
|
|
2897
3563
|
},
|
|
2898
|
-
resolveCall(call, from, fromFile, allFiles,
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
});
|
|
2943
|
-
}
|
|
2944
|
-
return out;
|
|
3564
|
+
resolveCall(call, from, fromFile, allFiles, ctx) {
|
|
3565
|
+
return resolveCallForm(call, from, fromFile, allFiles, ctx).filter((r) => !(r.kind === "symbol" && r.addr.filePath === from.filePath && r.addr.qualifiedName === from.qualifiedName));
|
|
3566
|
+
}
|
|
3567
|
+
};
|
|
3568
|
+
}
|
|
3569
|
+
function resolveCallForm(call, from, fromFile, allFiles, _ctx) {
|
|
3570
|
+
if (call.dynamicScope || call.written) {
|
|
3571
|
+
const { dynamicScope: _dynamic, written: _written, ...readable } = call;
|
|
3572
|
+
return resolveCallForm(readable, from, fromFile, allFiles, _ctx).map((r) => r.kind === "symbol" ? { ...r, byName: true } : r);
|
|
3573
|
+
}
|
|
3574
|
+
const local = (fromFile.symbolsByName.get(call.calleeName) ?? []).filter((s) => isFunctionLikeKind(s.kind));
|
|
3575
|
+
const toSymbol = (s, byName = false) => ({
|
|
3576
|
+
kind: "symbol",
|
|
3577
|
+
addr: { filePath: s.filePath, qualifiedName: s.qualifiedName },
|
|
3578
|
+
...byName ? { byName: true } : {}
|
|
3579
|
+
});
|
|
3580
|
+
const methodsNamed = () => local.filter((s) => s.kind === "method");
|
|
3581
|
+
if (call.receiverName) {
|
|
3582
|
+
const recvBinding = call.receiverShadowed ? void 0 : fromFile.bindingsByLocalName.get(call.receiverName);
|
|
3583
|
+
const moduleLevel = (fromFile.symbolsByName.get(call.receiverName) ?? []).some((s) => !s.qualifiedName.includes(">"));
|
|
3584
|
+
if (!call.receiverShadowed && !recvBinding && !moduleLevel) return [];
|
|
3585
|
+
if (!recvBinding || (call.receiverDepth ?? 1) !== 1) return methodsNamed().map((s) => toSymbol(s, true));
|
|
3586
|
+
const recvFilePath = fromFile.resolvedImports.get(recvBinding.specifier);
|
|
3587
|
+
if (!recvFilePath) return [];
|
|
3588
|
+
const recvTarget = allFiles.get(recvFilePath);
|
|
3589
|
+
if (!recvTarget) return [];
|
|
3590
|
+
const sym2 = findReceiverMethod(
|
|
3591
|
+
recvTarget,
|
|
3592
|
+
recvBinding.importedName,
|
|
3593
|
+
call.calleeName,
|
|
3594
|
+
0,
|
|
3595
|
+
/* @__PURE__ */ new Set(),
|
|
3596
|
+
allFiles
|
|
3597
|
+
);
|
|
3598
|
+
if (sym2) {
|
|
3599
|
+
const parentQname = sym2.qualifiedName.slice(0, Math.max(0, sym2.qualifiedName.lastIndexOf(">")));
|
|
3600
|
+
const parent = parentQname ? allFiles.get(sym2.filePath)?.symbolsByQname.get(parentQname) : void 0;
|
|
3601
|
+
return [toSymbol(sym2, parent?.kind === "class" && !sym2.static)];
|
|
3602
|
+
}
|
|
3603
|
+
return [
|
|
3604
|
+
{
|
|
3605
|
+
kind: "method-unresolved",
|
|
3606
|
+
receiverName: call.receiverName,
|
|
3607
|
+
methodName: call.calleeName
|
|
2945
3608
|
}
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
3609
|
+
];
|
|
3610
|
+
}
|
|
3611
|
+
if (call.receiverKind === "this") {
|
|
3612
|
+
const own = call.thisOwner ? local.find((s) => s.qualifiedName === `${call.thisOwner}>${call.calleeName}` && s.kind === "method" && Boolean(s.static) === Boolean(call.thisStatic)) : void 0;
|
|
3613
|
+
return own ? [toSymbol(own)] : methodsNamed().map((s) => toSymbol(s, true));
|
|
3614
|
+
}
|
|
3615
|
+
if (call.receiverKind) {
|
|
3616
|
+
const enclosing = from.qualifiedName.split(">")[0];
|
|
3617
|
+
return methodsNamed().filter((s) => !(call.receiverKind === "super" && s.qualifiedName.startsWith(`${enclosing}>`))).map((s) => toSymbol(s, true));
|
|
3618
|
+
}
|
|
3619
|
+
if (call.shadowed) return [];
|
|
3620
|
+
const functions = local.filter((s) => s.kind !== "method");
|
|
3621
|
+
if (functions.length > 0) return functions.map((s) => toSymbol(s));
|
|
3622
|
+
const binding = fromFile.bindingsByLocalName.get(call.calleeName);
|
|
3623
|
+
if (!binding) return [];
|
|
3624
|
+
const targetFile = fromFile.resolvedImports.get(binding.specifier);
|
|
3625
|
+
if (!targetFile) {
|
|
3626
|
+
return [
|
|
3627
|
+
{
|
|
3628
|
+
kind: "external",
|
|
3629
|
+
name: binding.importedName,
|
|
3630
|
+
packageSpec: binding.specifier
|
|
2957
3631
|
}
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
},
|
|
2975
|
-
moduleForFile(filePath, _ctx) {
|
|
2976
|
-
return filePath;
|
|
3632
|
+
];
|
|
3633
|
+
}
|
|
3634
|
+
const target = allFiles.get(targetFile);
|
|
3635
|
+
if (!target) return [];
|
|
3636
|
+
const sym = findExportedSymbol(
|
|
3637
|
+
target,
|
|
3638
|
+
binding.importedName,
|
|
3639
|
+
0,
|
|
3640
|
+
/* @__PURE__ */ new Set(),
|
|
3641
|
+
allFiles
|
|
3642
|
+
);
|
|
3643
|
+
if (!sym || sym === "ambiguous" || !isFunctionLikeKind(sym.kind)) return [];
|
|
3644
|
+
return [
|
|
3645
|
+
{
|
|
3646
|
+
kind: "symbol",
|
|
3647
|
+
addr: { filePath: sym.filePath, qualifiedName: sym.qualifiedName }
|
|
2977
3648
|
}
|
|
2978
|
-
|
|
3649
|
+
];
|
|
2979
3650
|
}
|
|
2980
3651
|
var typescriptHandler = makeTsFamilyHandler("typescript", [".ts"]);
|
|
2981
3652
|
var tsxHandler = makeTsFamilyHandler("tsx", [".tsx", ".jsx"]);
|
|
@@ -3041,11 +3712,20 @@ function tryPythonPaths(baseDir, modulePath, fileSet) {
|
|
|
3041
3712
|
var pythonHandler = {
|
|
3042
3713
|
grammarId: "python",
|
|
3043
3714
|
extensions: [".py", ".pyi"],
|
|
3715
|
+
// `boolean_operator` is `and` / `or`; comprehension `if` / `for` are decisions too.
|
|
3716
|
+
decisions: {
|
|
3717
|
+
nodes: /* @__PURE__ */ new Set(["if_statement", "elif_clause", "for_statement", "while_statement", "except_clause", "conditional_expression", "case_clause", "if_clause", "for_in_clause", "boolean_operator"])
|
|
3718
|
+
},
|
|
3719
|
+
fileLocalContext: noFileLocalContext,
|
|
3720
|
+
exportedDefinition: topLevelDefinition,
|
|
3721
|
+
// `from pkg import mod`: the name may be a submodule, imported whole.
|
|
3722
|
+
submoduleSpecifier: pythonSubmoduleSpec,
|
|
3723
|
+
moduleStringConstants: pythonStringConstants,
|
|
3044
3724
|
extractSymbols(root, _source) {
|
|
3045
3725
|
return extractSymbolsFromTree(root);
|
|
3046
3726
|
},
|
|
3047
3727
|
extractImports(root) {
|
|
3048
|
-
const specs =
|
|
3728
|
+
const specs = walkForPythonImports(root);
|
|
3049
3729
|
const bindings = extractPythonImportBindingsDeep(root);
|
|
3050
3730
|
return { specs, bindings };
|
|
3051
3731
|
},
|
|
@@ -3150,9 +3830,6 @@ var pythonHandler = {
|
|
|
3150
3830
|
addr: { filePath: sym.filePath, qualifiedName: sym.qualifiedName }
|
|
3151
3831
|
}
|
|
3152
3832
|
];
|
|
3153
|
-
},
|
|
3154
|
-
moduleForFile(filePath, _ctx) {
|
|
3155
|
-
return filePath;
|
|
3156
3833
|
}
|
|
3157
3834
|
};
|
|
3158
3835
|
|
|
@@ -3359,14 +4036,14 @@ function extractTopLevel(rootNode) {
|
|
|
3359
4036
|
}
|
|
3360
4037
|
return { symbols, pendingMethods };
|
|
3361
4038
|
}
|
|
3362
|
-
function attachMethods(symbols,
|
|
3363
|
-
if (
|
|
4039
|
+
function attachMethods(symbols, pending2) {
|
|
4040
|
+
if (pending2.length === 0) return symbols;
|
|
3364
4041
|
const byName = /* @__PURE__ */ new Map();
|
|
3365
4042
|
for (const s of symbols) {
|
|
3366
4043
|
if (s.kind === "class" || s.kind === "interface") byName.set(s.name, s);
|
|
3367
4044
|
}
|
|
3368
4045
|
const orphans = [];
|
|
3369
|
-
for (const m of
|
|
4046
|
+
for (const m of pending2) {
|
|
3370
4047
|
const host = byName.get(m.receiverType);
|
|
3371
4048
|
if (host) {
|
|
3372
4049
|
host.children = [...host.children, m.symbol];
|
|
@@ -3501,6 +4178,17 @@ function bucketGoFilesByDir(fileSet) {
|
|
|
3501
4178
|
var goHandler = {
|
|
3502
4179
|
grammarId: "go",
|
|
3503
4180
|
extensions: [".go"],
|
|
4181
|
+
decisions: {
|
|
4182
|
+
nodes: /* @__PURE__ */ new Set(["if_statement", "for_statement", "expression_case", "type_case", "communication_case"]),
|
|
4183
|
+
binary: { type: "binary_expression", operators: /* @__PURE__ */ new Set(["&&", "||"]) }
|
|
4184
|
+
},
|
|
4185
|
+
// Same-package calls resolve through the package context, even for one file.
|
|
4186
|
+
async fileLocalContext(cwd, filePath) {
|
|
4187
|
+
return goHandler.buildProjectContext(cwd, /* @__PURE__ */ new Set([filePath]));
|
|
4188
|
+
},
|
|
4189
|
+
exportedDefinition: topLevelDefinition,
|
|
4190
|
+
submoduleSpecifier: noSubmodule,
|
|
4191
|
+
moduleStringConstants: noStringConstants,
|
|
3504
4192
|
extractSymbols(rootNode, _source) {
|
|
3505
4193
|
const out = [];
|
|
3506
4194
|
const header = extractGoImportHeader(rootNode);
|
|
@@ -3631,12 +4319,6 @@ var goHandler = {
|
|
|
3631
4319
|
}
|
|
3632
4320
|
}
|
|
3633
4321
|
return out;
|
|
3634
|
-
},
|
|
3635
|
-
moduleForFile(filePath, ctx) {
|
|
3636
|
-
const c = ctx;
|
|
3637
|
-
const dir = path5.dirname(filePath);
|
|
3638
|
-
if (!c?.modulePath) return dir;
|
|
3639
|
-
return dir === "." ? c.modulePath : `${c.modulePath}/${dir}`;
|
|
3640
4322
|
}
|
|
3641
4323
|
};
|
|
3642
4324
|
function isCallableKind(k) {
|
|
@@ -3879,8 +4561,8 @@ function extractTopLevel2(rootNode) {
|
|
|
3879
4561
|
}
|
|
3880
4562
|
return { symbols, pendingImpls };
|
|
3881
4563
|
}
|
|
3882
|
-
function attachImplMethods(symbols,
|
|
3883
|
-
if (
|
|
4564
|
+
function attachImplMethods(symbols, pending2) {
|
|
4565
|
+
if (pending2.length === 0) return symbols;
|
|
3884
4566
|
const byName = /* @__PURE__ */ new Map();
|
|
3885
4567
|
for (const s of symbols) {
|
|
3886
4568
|
if (s.kind === "class" || s.kind === "enum" || s.kind === "interface") {
|
|
@@ -3888,7 +4570,7 @@ function attachImplMethods(symbols, pending) {
|
|
|
3888
4570
|
}
|
|
3889
4571
|
}
|
|
3890
4572
|
const orphans = [];
|
|
3891
|
-
for (const impl of
|
|
4573
|
+
for (const impl of pending2) {
|
|
3892
4574
|
const host = byName.get(impl.targetType);
|
|
3893
4575
|
if (host) {
|
|
3894
4576
|
host.children = [...host.children, ...impl.methods];
|
|
@@ -4202,6 +4884,14 @@ function resolveModPath(spec, fromModPath) {
|
|
|
4202
4884
|
var rustHandler = {
|
|
4203
4885
|
grammarId: "rust",
|
|
4204
4886
|
extensions: [".rs"],
|
|
4887
|
+
decisions: {
|
|
4888
|
+
nodes: /* @__PURE__ */ new Set(["if_expression", "while_expression", "for_expression", "loop_expression", "match_arm"]),
|
|
4889
|
+
binary: { type: "binary_expression", operators: /* @__PURE__ */ new Set(["&&", "||"]) }
|
|
4890
|
+
},
|
|
4891
|
+
fileLocalContext: noFileLocalContext,
|
|
4892
|
+
exportedDefinition: topLevelDefinition,
|
|
4893
|
+
submoduleSpecifier: noSubmodule,
|
|
4894
|
+
moduleStringConstants: noStringConstants,
|
|
4205
4895
|
extractSymbols(rootNode, _source) {
|
|
4206
4896
|
const out = [];
|
|
4207
4897
|
const header = extractRustImportHeader(rootNode);
|
|
@@ -4371,10 +5061,6 @@ var rustHandler = {
|
|
|
4371
5061
|
addr: { filePath: sym.filePath, qualifiedName: sym.qualifiedName }
|
|
4372
5062
|
}
|
|
4373
5063
|
];
|
|
4374
|
-
},
|
|
4375
|
-
moduleForFile(filePath, ctx) {
|
|
4376
|
-
const c = ctx;
|
|
4377
|
-
return c?.fileToMod.get(filePath) ?? path6.posix.dirname(filePath);
|
|
4378
5064
|
}
|
|
4379
5065
|
};
|
|
4380
5066
|
function isCallableKind2(k) {
|
|
@@ -4385,6 +5071,11 @@ function isCallableKind2(k) {
|
|
|
4385
5071
|
var leanHandler = {
|
|
4386
5072
|
grammarId: "lean",
|
|
4387
5073
|
extensions: [".lean"],
|
|
5074
|
+
decisions: null,
|
|
5075
|
+
fileLocalContext: noFileLocalContext,
|
|
5076
|
+
exportedDefinition: topLevelDefinition,
|
|
5077
|
+
submoduleSpecifier: noSubmodule,
|
|
5078
|
+
moduleStringConstants: noStringConstants,
|
|
4388
5079
|
extractSymbols(root, _source) {
|
|
4389
5080
|
return extractSymbolsFromTree(root, "lean");
|
|
4390
5081
|
},
|
|
@@ -4402,9 +5093,6 @@ var leanHandler = {
|
|
|
4402
5093
|
},
|
|
4403
5094
|
resolveCall() {
|
|
4404
5095
|
return [];
|
|
4405
|
-
},
|
|
4406
|
-
moduleForFile(filePath) {
|
|
4407
|
-
return filePath.replace(/\.lean$/i, "").replace(/[/\\]/g, ".");
|
|
4408
5096
|
}
|
|
4409
5097
|
};
|
|
4410
5098
|
|
|
@@ -4432,7 +5120,7 @@ function relationText(value) {
|
|
|
4432
5120
|
}));
|
|
4433
5121
|
}
|
|
4434
5122
|
function parseBytes(facts) {
|
|
4435
|
-
const structural = 768 + facts.flatSymbols.length * 1024 + facts.rawCalls.length * 96 + facts.importBindings.length * 192 + facts.importSpecifiers.length * 64 + facts.literals.length * 128;
|
|
5123
|
+
const structural = 768 + facts.flatSymbols.length * 1024 + facts.rawCalls.length * 96 + facts.importBindings.length * 192 + facts.importSpecifiers.length * 64 + facts.literals.length * 128 + facts.comments.length * 48;
|
|
4436
5124
|
return Math.max(structural, facts.flatSymbols.length * 4e3 / HEAP_ESTIMATE_HEADROOM);
|
|
4437
5125
|
}
|
|
4438
5126
|
var IndexSharing = class {
|
|
@@ -4440,19 +5128,49 @@ var IndexSharing = class {
|
|
|
4440
5128
|
this.repositories = /* @__PURE__ */ new Map();
|
|
4441
5129
|
this.leases = /* @__PURE__ */ new Map();
|
|
4442
5130
|
this.bytes = 0;
|
|
5131
|
+
/** Bumped on every publish: a preparation older than this may have missed
|
|
5132
|
+
* entries it should share. */
|
|
5133
|
+
this.generation = 0;
|
|
4443
5134
|
}
|
|
4444
5135
|
findParse(repository, filePath, language, hash) {
|
|
4445
5136
|
return this.repositories.get(repository)?.parses.get(parseKey(filePath, language, hash))?.value;
|
|
4446
5137
|
}
|
|
5138
|
+
/** The CPU-heavy half of publishing (serialize + hash + equality per file),
|
|
5139
|
+
* sliced so it never holds the main thread. Runs before the owner's
|
|
5140
|
+
* generation/HEAD checks; only reads the pool. `index` must be the
|
|
5141
|
+
* unpublished revision, whose relation collections nothing else mutates. */
|
|
5142
|
+
async prepareRelations(index, repository) {
|
|
5143
|
+
const prepared = { generation: this.generation, files: /* @__PURE__ */ new Map() };
|
|
5144
|
+
for (const [filePath, file] of index.files) {
|
|
5145
|
+
await inSlice(() => {
|
|
5146
|
+
const text = relationText(file);
|
|
5147
|
+
const key = JSON.stringify([filePath, createHash2("sha256").update(text).digest("hex")]);
|
|
5148
|
+
const match = this.repositories.get(repository)?.relations.get(key)?.find((entry) => relationText(entry.value) === text);
|
|
5149
|
+
prepared.files.set(filePath, { key, text, match });
|
|
5150
|
+
});
|
|
5151
|
+
}
|
|
5152
|
+
return prepared;
|
|
5153
|
+
}
|
|
5154
|
+
/** False once another root has been published since `prepared` began: its
|
|
5155
|
+
* matches would miss that root's entries, so prepare again before the commit. */
|
|
5156
|
+
isCurrent(prepared) {
|
|
5157
|
+
return prepared.generation === this.generation;
|
|
5158
|
+
}
|
|
4447
5159
|
/** Synchronous commit, called only after the owner's generation/HEAD checks.
|
|
4448
|
-
* Retain the new root before releasing the old one so equal blocks survive.
|
|
4449
|
-
|
|
5160
|
+
* Retain the new root before releasing the old one so equal blocks survive.
|
|
5161
|
+
* Pooled values are immutable, so a match found by `prepareRelations` is
|
|
5162
|
+
* still equal now if it is still pooled; one released in between is not
|
|
5163
|
+
* reused. Entries pooled in between are excluded by the caller checking
|
|
5164
|
+
* `isCurrent` first. */
|
|
5165
|
+
publish(index, repository, hashes, facts, prepared) {
|
|
5166
|
+
if (!this.isCurrent(prepared)) throw new AppError({ message: "Index relations were prepared against an older shared pool" });
|
|
4450
5167
|
let repo = this.repositories.get(repository);
|
|
4451
5168
|
if (!repo) {
|
|
4452
5169
|
repo = { roots: 0, parses: /* @__PURE__ */ new Map(), relations: /* @__PURE__ */ new Map() };
|
|
4453
5170
|
this.repositories.set(repository, repo);
|
|
4454
5171
|
}
|
|
4455
5172
|
repo.roots++;
|
|
5173
|
+
this.generation++;
|
|
4456
5174
|
const lease = { repository, parses: [], relations: [], bytes: 1024 + hashes.size * 512 };
|
|
4457
5175
|
for (const [filePath, file] of index.files) {
|
|
4458
5176
|
const parsed = facts.get(filePath);
|
|
@@ -4473,14 +5191,15 @@ var IndexSharing = class {
|
|
|
4473
5191
|
file.symbolsTree = shared.symbolsTree;
|
|
4474
5192
|
file.flatSymbols = shared.flatSymbols;
|
|
4475
5193
|
file.literals = shared.literals;
|
|
5194
|
+
file.comments = shared.comments;
|
|
5195
|
+
file.sourceHash = shared.sourceHash;
|
|
4476
5196
|
file.importBindings = shared.importBindings;
|
|
4477
5197
|
Object.assign(file, parse2.value.lookups);
|
|
4478
5198
|
parse2.references++;
|
|
4479
5199
|
lease.parses.push(parse2);
|
|
4480
|
-
const text =
|
|
4481
|
-
const relationKey = JSON.stringify([filePath, createHash2("sha256").update(text).digest("hex")]);
|
|
5200
|
+
const { key: relationKey, text, match } = prepared.files.get(filePath);
|
|
4482
5201
|
const bucket = repo.relations.get(relationKey) ?? [];
|
|
4483
|
-
let relation = bucket.
|
|
5202
|
+
let relation = match && bucket.includes(match) ? match : void 0;
|
|
4484
5203
|
if (!relation) {
|
|
4485
5204
|
const value = {
|
|
4486
5205
|
resolvedImports: file.resolvedImports,
|
|
@@ -4542,6 +5261,24 @@ var IndexSharing = class {
|
|
|
4542
5261
|
}
|
|
4543
5262
|
};
|
|
4544
5263
|
|
|
5264
|
+
// packages/feature/explorer/src/server/codeMap/projectGraph/indexLifecycle.ts
|
|
5265
|
+
function reduceOwner(s, e) {
|
|
5266
|
+
switch (e.type) {
|
|
5267
|
+
case "dirty":
|
|
5268
|
+
return { ...s, version: s.version + 1 };
|
|
5269
|
+
case "rebuildRequested":
|
|
5270
|
+
return { ...s, generation: s.generation + 1, version: s.version + 1, force: true };
|
|
5271
|
+
case "claimed":
|
|
5272
|
+
return { ...s, force: false, runningGeneration: s.generation };
|
|
5273
|
+
case "published":
|
|
5274
|
+
return { ...s, publishedVersion: e.ticket.version };
|
|
5275
|
+
case "released":
|
|
5276
|
+
return { ...s, generation: s.generation + 1, retired: true };
|
|
5277
|
+
case "revived":
|
|
5278
|
+
return { ...s, retired: false };
|
|
5279
|
+
}
|
|
5280
|
+
}
|
|
5281
|
+
|
|
4545
5282
|
// packages/feature/explorer/src/server/codeMap/projectGraph/codeIndex.ts
|
|
4546
5283
|
var indexCache = /* @__PURE__ */ new Map();
|
|
4547
5284
|
var sharing = new IndexSharing();
|
|
@@ -4593,32 +5330,34 @@ function startCodeIndexIdleSweeper() {
|
|
|
4593
5330
|
)
|
|
4594
5331
|
);
|
|
4595
5332
|
}
|
|
4596
|
-
var
|
|
5333
|
+
var owners = /* @__PURE__ */ new Map();
|
|
4597
5334
|
var buildFailures = /* @__PURE__ */ new Map();
|
|
4598
5335
|
var watcherSubscriber = null;
|
|
5336
|
+
function apply(owner, event) {
|
|
5337
|
+
owner.state = reduceOwner(owner.state, event);
|
|
5338
|
+
}
|
|
4599
5339
|
function registerWatcherSubscriber(fn) {
|
|
4600
5340
|
watcherSubscriber = fn;
|
|
4601
|
-
for (const [cwd,
|
|
4602
|
-
|
|
4603
|
-
|
|
5341
|
+
for (const [cwd, owner] of owners) {
|
|
5342
|
+
owner.unsubscribe?.();
|
|
5343
|
+
owner.unsubscribe = fn?.(cwd, () => markIndexDirty(cwd));
|
|
4604
5344
|
}
|
|
4605
5345
|
}
|
|
4606
5346
|
function markIndexDirty(cwd) {
|
|
4607
|
-
const
|
|
4608
|
-
if (
|
|
5347
|
+
const owner = owners.get(cwd);
|
|
5348
|
+
if (owner) apply(owner, { type: "dirty" });
|
|
4609
5349
|
}
|
|
4610
5350
|
function releaseIndex(cwd) {
|
|
4611
5351
|
sharing.release(cwd);
|
|
4612
5352
|
indexCache.delete(cwd);
|
|
4613
5353
|
indexLastUsed.delete(cwd);
|
|
4614
5354
|
buildFailures.delete(cwd);
|
|
4615
|
-
const
|
|
4616
|
-
if (!
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
if (!inflight.has(cwd)) updates.delete(cwd);
|
|
5355
|
+
const owner = owners.get(cwd);
|
|
5356
|
+
if (!owner) return;
|
|
5357
|
+
apply(owner, { type: "released" });
|
|
5358
|
+
owner.unsubscribe?.();
|
|
5359
|
+
owner.unsubscribe = void 0;
|
|
5360
|
+
if (!inflight.has(cwd)) owners.delete(cwd);
|
|
4622
5361
|
}
|
|
4623
5362
|
|
|
4624
5363
|
// src/lib/codeIndexSync.ts
|