@surething/cockpit 1.0.208 → 1.0.210
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 +12 -10
- package/.next-prod/build-manifest.json +4 -4
- package/.next-prod/diagnostics/framework.json +1 -1
- package/.next-prod/next-server.js.nft.json +1 -1
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/react-loadable-manifest.json +25 -1
- package/.next-prod/routes-manifest.json +12 -0
- package/.next-prod/server/app/_global-error/page.js +3 -3
- package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
- 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/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.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 +2 -2
- package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +1 -1
- package/.next-prod/server/app/_not-found.rsc +16 -17
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +16 -17
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +5 -6
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next-prod/server/app/api/agent/test/route.js +1 -0
- package/.next-prod/server/app/api/agent/test/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/agent/test/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/bash/route.js +1 -1
- package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js +18 -18
- package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js +4 -4
- package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js +18 -18
- package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js +20 -109
- package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/route.js +4 -4
- package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/commands/route.js +1 -1
- package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/comments/route.js +1 -1
- package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/columns/route.js +15 -15
- package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/connect/route.js +3 -1
- package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/export/route.js +1 -1
- package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/query/route.js +1 -1
- package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js +2 -2
- package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/dev/spans/route.js +1 -0
- package/.next-prod/server/app/api/dev/spans/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/dev/spans/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/extension/version/route.js +1 -1
- package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/file/route.js +1 -1
- package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/blame/route.js +1 -1
- package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/copy/route.js +1 -1
- package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/delete/route.js +1 -1
- package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/index/route.js +1 -1
- package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/init/route.js +1 -1
- package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/paste/route.js +1 -1
- package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/read/route.js +1 -1
- package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/recent/route.js +1 -1
- package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/save/route.js +1 -1
- package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/search/route.js +1 -1
- package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/stat/route.js +1 -1
- package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/files/text/route.js +1 -1
- package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/branches/route.js +1 -1
- package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/commits/route.js +1 -1
- package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/diff/route.js +1 -1
- package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/discard/route.js +1 -1
- package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/stage/route.js +1 -1
- package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/status/route.js +1 -1
- package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/global-state/route.js +1 -1
- package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/load/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/load/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/save/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/save/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js +9 -9
- package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/connect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js +2 -2
- package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/note/route.js +1 -1
- package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pick-folder/route.js +1 -1
- package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-settings/route.js +1 -1
- package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/project-state/route.js +1 -1
- package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projects/route.js +1 -1
- package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/command/route.js +1 -1
- package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/get/route.js +1 -1
- package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/redis/set/route.js +1 -1
- package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/comments/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/identify/route.js +1 -1
- package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/order/route.js +1 -1
- package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/route.js +1 -1
- package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/share-info/route.js +1 -1
- package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/review/users/route.js +1 -1
- package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/config/route.js +1 -1
- package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/sessions/route.js +1 -1
- package/.next-prod/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/settings/route.js +1 -1
- package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/[id]/route.js +1 -1
- package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/content/route.js +1 -1
- package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/skills/route.js +1 -1
- package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/version/route.js +1 -1
- package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/favicon.ico/route.js +1 -1
- package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route.js +2 -2
- package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next-prod/server/app/manifest.webmanifest.body +1 -1
- package/.next-prod/server/app/page.js +2 -2
- package/.next-prod/server/app/page.js.nft.json +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +2 -2
- package/.next-prod/server/app/project/page.js.nft.json +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page.js +2 -2
- package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +12 -10
- package/.next-prod/server/chunks/2728.js +1 -0
- package/.next-prod/server/chunks/304.js +1 -0
- package/.next-prod/server/chunks/3718.js +1 -0
- package/.next-prod/server/chunks/3863.js +1 -0
- package/.next-prod/server/chunks/4034.js +114 -0
- package/.next-prod/server/chunks/4741.js +2 -2
- package/.next-prod/server/chunks/5159.js +1 -0
- package/.next-prod/server/chunks/{6007.js → 5292.js} +2 -2
- package/.next-prod/server/chunks/5616.js +1 -0
- package/.next-prod/server/chunks/6955.js +1 -0
- package/.next-prod/server/chunks/7184.js +244 -0
- package/.next-prod/server/chunks/7973.js +15 -0
- package/.next-prod/server/chunks/8916.js +1 -0
- package/.next-prod/server/chunks/9658.js +42 -0
- package/.next-prod/server/functions-config-manifest.json +2 -0
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/middleware-react-loadable-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +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/LJRtmjYCuVrSA_dcelxlR/_buildManifest.js +1 -0
- package/.next-prod/static/chunks/2580.69af80de5bcfcefe.js +1 -0
- package/.next-prod/static/chunks/2708.7263182a029113c8.js +1 -0
- package/.next-prod/static/chunks/327-9ffab8f0b2b0b4cd.js +13 -0
- package/.next-prod/static/chunks/{3794-3fb4e6ee851037bb.js → 3794-ba2500baa4c52d55.js} +3 -3
- package/.next-prod/static/chunks/5188-6ad3d686c5e9fb28.js +29 -0
- package/.next-prod/static/chunks/{5204-c8293184aa55cdd5.js → 5204-babf0d0290febbec.js} +1 -1
- package/.next-prod/static/chunks/6345-3c06cdc8c89677b8.js +14 -0
- package/.next-prod/static/chunks/7562.8fdc3abdd45c77ab.js +1 -0
- package/.next-prod/static/chunks/9012.6ed079104670001d.js +1 -0
- package/.next-prod/static/chunks/9617.d038e8ea9fc93e24.js +1 -0
- package/.next-prod/static/chunks/96c8525a-f1e0653013503d49.js +2 -0
- package/.next-prod/static/chunks/app/_global-error/page-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/agent/test/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/bash/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/codex/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/kimi/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/ollama/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/claude-stats/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/commands/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/comments/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/db/columns/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/db/connect/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/db/disconnect/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/db/export/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/db/query/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/db/schemas/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/dev/spans/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/extension/version/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/file/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/blame/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/clipboard/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/copy/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/delete/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/expanded/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/index/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/init/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/paste/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/read/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/readdir/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/recent/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/save/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/search/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/stat/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/files/text/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branches/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commits/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/diff/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/discard/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/stage/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/status/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/unstage/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/git/worktree/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/global-state/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/load/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/save/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/definition/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/hover/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/references/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/status/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/columns/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/connect/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/export/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/query/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/query/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/note/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/models/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/start/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/open-cursor/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/open-vscode/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/pick-folder/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/project-settings/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/project-state/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/projects/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/command/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/connect/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/delete/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/get/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/keys/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/set/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/review/identify/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/review/order/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/review/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/review/share-info/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/review/users/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/services/config/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/services/scripts/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/session-by-path/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/settings/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/[id]/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/content/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/env/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/history/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/api/version/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/layout-a0362651ba6e6e6f.js +1 -0
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/app/{page-db32ebfdf1ac9174.js → page-1b14cabf47df9ff7.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-db32ebfdf1ac9174.js → page-1b14cabf47df9ff7.js} +1 -1
- package/.next-prod/static/chunks/app/review/[id]/page-7db3a48a13f1840c.js +1 -0
- package/.next-prod/static/chunks/bc21e3dd-a78364524623b9b0.js +1 -0
- package/.next-prod/static/chunks/{main-5a46314a5491113b.js → main-79827b1543335b12.js} +3 -3
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-826847d169541fa9.js +1 -0
- package/.next-prod/static/chunks/webpack-b618ac52d349e5ca.js +1 -0
- package/.next-prod/static/css/dcde719317bea028.css +1 -0
- package/.next-prod/trace +12 -12
- package/.next-prod/trace-build +1 -1
- package/.next-prod/types/app/api/agent/test/route.ts +351 -0
- package/.next-prod/types/app/api/dev/spans/route.ts +351 -0
- package/.next-prod/types/routes.d.ts +3 -1
- package/.next-prod/types/validator.ts +18 -0
- package/README.md +29 -8
- package/README.zh.md +30 -9
- package/dist/{chunk-VCZEGP64.mjs → chunk-FBR4KJI5.mjs} +24 -250
- package/dist/chunk-OWUW2O3D.mjs +28475 -0
- package/dist/{chunk-RSHKDWJM.mjs → chunk-TXBVUZVH.mjs} +94 -0
- package/dist/httpApi.mjs +239 -0
- package/dist/scheduledTasks.mjs +1239 -66
- package/dist/{server-K6XWP7DX.mjs → server-E7G55DY7.mjs} +9 -10
- package/dist/wsServer.mjs +867 -704
- package/package.json +17 -4
- package/server.mjs +3 -1
- package/.next-prod/server/chunks/240.js +0 -1
- package/.next-prod/server/chunks/3204.js +0 -42
- package/.next-prod/server/chunks/5466.js +0 -1
- package/.next-prod/server/chunks/7264.js +0 -5
- package/.next-prod/server/chunks/8465.js +0 -15
- package/.next-prod/server/chunks/8750.js +0 -1
- package/.next-prod/server/chunks/900.js +0 -1
- package/.next-prod/server/chunks/9255.js +0 -1
- package/.next-prod/server/chunks/9755.js +0 -101
- package/.next-prod/server/chunks/987.js +0 -139
- package/.next-prod/static/WsSesL2O_jRoZztt2Y5r6/_buildManifest.js +0 -1
- package/.next-prod/static/chunks/327.8ecab0b86d52b597.js +0 -1
- package/.next-prod/static/chunks/5660-3d87dfb12f95e96d.js +0 -29
- package/.next-prod/static/chunks/6028-1d6ced1439a3f01f.js +0 -1
- package/.next-prod/static/chunks/6345-6b34b0528ff833a1.js +0 -14
- package/.next-prod/static/chunks/app/_global-error/page-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/bash/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/codex/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/kimi/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/ollama/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/claude-stats/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/commands/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/comments/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/db/columns/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/db/connect/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/db/disconnect/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/db/export/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/db/query/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/db/schemas/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/extension/version/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/file/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/blame/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/clipboard/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/copy/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/delete/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/expanded/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/index/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/init/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/paste/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/read/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/readdir/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/recent/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/save/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/search/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/stat/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/files/text/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branches/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commits/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/diff/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/discard/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/stage/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/status/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/unstage/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/git/worktree/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/global-state/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/load/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/save/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/definition/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/hover/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/references/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/status/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/columns/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/connect/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/export/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/query/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/query/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/note/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/models/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/start/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/open-cursor/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/open-vscode/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/pick-folder/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/project-settings/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/project-state/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/projects/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/command/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/connect/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/delete/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/get/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/keys/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/set/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/review/identify/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/review/order/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/review/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/review/share-info/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/review/users/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/services/config/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/services/scripts/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/session-by-path/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/settings/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/[id]/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/content/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/env/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/history/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/api/version/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/layout-92d5dcd25bad9196.js +0 -1
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/app/review/[id]/page-05cd4cb51babd64c.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-7975a2b8c7d0b214.js +0 -1
- package/.next-prod/static/chunks/webpack-bb0c02e3a9602d78.js +0 -1
- package/.next-prod/static/css/a7974d62fe853925.css +0 -1
- package/dist/chunk-HIRLDMCH.mjs +0 -314
- /package/.next-prod/static/{WsSesL2O_jRoZztt2Y5r6 → LJRtmjYCuVrSA_dcelxlR}/_ssgManifest.js +0 -0
package/dist/scheduledTasks.mjs
CHANGED
|
@@ -1,16 +1,1169 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AgentError,
|
|
3
|
+
Config_exports,
|
|
4
|
+
Context_exports,
|
|
5
|
+
DBError,
|
|
6
|
+
Duration_exports,
|
|
7
|
+
Effect_exports,
|
|
8
|
+
Fiber_exports,
|
|
9
|
+
Layer_exports,
|
|
10
|
+
LogLevel_exports,
|
|
11
|
+
Logger_exports,
|
|
12
|
+
ManagedRuntime_exports,
|
|
13
|
+
Option_exports,
|
|
14
|
+
Queue_exports,
|
|
15
|
+
Ref_exports,
|
|
16
|
+
Schedule_exports,
|
|
17
|
+
Stream_exports,
|
|
18
|
+
Tracer_exports,
|
|
2
19
|
getSessionTitle,
|
|
3
20
|
updateGlobalState
|
|
4
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-OWUW2O3D.mjs";
|
|
5
22
|
import {
|
|
6
23
|
CLAUDE2_DIR,
|
|
7
24
|
SCHEDULED_TASKS_FILE,
|
|
25
|
+
createNeo4jDriver,
|
|
8
26
|
readJsonFile,
|
|
27
|
+
runCypherWithDriver,
|
|
9
28
|
writeJsonFile
|
|
10
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TXBVUZVH.mjs";
|
|
11
30
|
|
|
12
31
|
// packages/feature/agent/src/server/scheduledTasks.ts
|
|
32
|
+
import { query as query2 } from "@anthropic-ai/claude-agent-sdk";
|
|
33
|
+
|
|
34
|
+
// packages/shared/utils/src/ollamaEnv.ts
|
|
35
|
+
var DEFAULT_BASE = "http://127.0.0.1:11434";
|
|
36
|
+
function getOllamaBaseURL() {
|
|
37
|
+
const raw = process.env.OLLAMA_BASE_URL || DEFAULT_BASE;
|
|
38
|
+
return raw.replace(/\/v1\/?$/, "").replace(/\/+$/, "");
|
|
39
|
+
}
|
|
40
|
+
function getOllamaOpenAIBaseURL() {
|
|
41
|
+
return `${getOllamaBaseURL()}/v1/`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// packages/shared/effect-core/src/logger.ts
|
|
45
|
+
var parseLevel = (raw) => {
|
|
46
|
+
switch ((raw ?? "").toLowerCase()) {
|
|
47
|
+
case "all":
|
|
48
|
+
return LogLevel_exports.All;
|
|
49
|
+
case "trace":
|
|
50
|
+
return LogLevel_exports.Trace;
|
|
51
|
+
case "debug":
|
|
52
|
+
return LogLevel_exports.Debug;
|
|
53
|
+
case "info":
|
|
54
|
+
return LogLevel_exports.Info;
|
|
55
|
+
case "warning":
|
|
56
|
+
case "warn":
|
|
57
|
+
return LogLevel_exports.Warning;
|
|
58
|
+
case "error":
|
|
59
|
+
return LogLevel_exports.Error;
|
|
60
|
+
case "fatal":
|
|
61
|
+
return LogLevel_exports.Fatal;
|
|
62
|
+
case "none":
|
|
63
|
+
return LogLevel_exports.None;
|
|
64
|
+
default:
|
|
65
|
+
return LogLevel_exports.Info;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var LoggerLivePretty = Layer_exports.mergeAll(
|
|
69
|
+
Logger_exports.pretty,
|
|
70
|
+
Logger_exports.minimumLogLevel(parseLevel(process.env.COCKPIT_LOG_LEVEL))
|
|
71
|
+
);
|
|
72
|
+
var appendLogFile = async (line, filePath) => {
|
|
73
|
+
const { appendFile, mkdir } = await import("fs/promises");
|
|
74
|
+
const { dirname } = await import("path");
|
|
75
|
+
try {
|
|
76
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
77
|
+
await appendFile(filePath, line + "\n", "utf-8");
|
|
78
|
+
} catch {
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var normalizeMessage = (m) => {
|
|
82
|
+
if (Array.isArray(m)) {
|
|
83
|
+
return m.length === 1 ? m[0] : m;
|
|
84
|
+
}
|
|
85
|
+
return m;
|
|
86
|
+
};
|
|
87
|
+
var fileLogger = (filePath) => Logger_exports.make(({ logLevel, message, date, fiberId, spans, annotations }) => {
|
|
88
|
+
const payload = {
|
|
89
|
+
time: date.toISOString(),
|
|
90
|
+
level: logLevel.label,
|
|
91
|
+
// fiberId is a FiberId object; extract its numeric id
|
|
92
|
+
fiber: typeof fiberId === "object" && fiberId !== null && "id" in fiberId ? fiberId.id : String(fiberId),
|
|
93
|
+
msg: normalizeMessage(message),
|
|
94
|
+
spans: Array.from(spans).map((s) => ({
|
|
95
|
+
label: s.label,
|
|
96
|
+
startTime: s.startTime
|
|
97
|
+
})),
|
|
98
|
+
annotations: Object.fromEntries(annotations)
|
|
99
|
+
};
|
|
100
|
+
void appendLogFile(JSON.stringify(payload), filePath);
|
|
101
|
+
});
|
|
102
|
+
var LoggerLiveProd = (logFile) => Layer_exports.mergeAll(
|
|
103
|
+
Logger_exports.pretty,
|
|
104
|
+
// still write to stdout for ops readability
|
|
105
|
+
Logger_exports.add(fileLogger(logFile)),
|
|
106
|
+
// also append to the file
|
|
107
|
+
Logger_exports.minimumLogLevel(parseLevel(process.env.COCKPIT_LOG_LEVEL))
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// packages/shared/effect-core/src/spanRecorder.ts
|
|
111
|
+
var MAX_SPANS = 500;
|
|
112
|
+
var g = globalThis;
|
|
113
|
+
var ring = g.__cockpitSpanRing ??= {
|
|
114
|
+
buffer: [],
|
|
115
|
+
index: /* @__PURE__ */ new Map()
|
|
116
|
+
};
|
|
117
|
+
function recordSpanStart(span) {
|
|
118
|
+
ring.buffer.push(span);
|
|
119
|
+
ring.index.set(span.spanId, ring.buffer.length - 1);
|
|
120
|
+
if (ring.buffer.length > MAX_SPANS) {
|
|
121
|
+
const removed = ring.buffer.shift();
|
|
122
|
+
ring.index.clear();
|
|
123
|
+
for (let i = 0; i < ring.buffer.length; i++) {
|
|
124
|
+
ring.index.set(ring.buffer[i].spanId, i);
|
|
125
|
+
}
|
|
126
|
+
void removed;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function recordSpanEnd(spanId, endTimeNs, exit) {
|
|
130
|
+
const idx = ring.index.get(spanId);
|
|
131
|
+
if (idx === void 0) return;
|
|
132
|
+
const existing = ring.buffer[idx];
|
|
133
|
+
if (!existing) return;
|
|
134
|
+
const startNs = BigInt(existing.startTimeNs);
|
|
135
|
+
const durationMs = Number(endTimeNs - startNs) / 1e6;
|
|
136
|
+
ring.buffer[idx] = {
|
|
137
|
+
...existing,
|
|
138
|
+
endTimeNs: endTimeNs.toString(),
|
|
139
|
+
durationMs: Math.round(durationMs * 100) / 100,
|
|
140
|
+
status: exit._tag === "Success" ? "ok" : "error",
|
|
141
|
+
errorMessage: exit._tag === "Failure" ? prettyPrintCause(exit.cause) : void 0
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function recordSpanAttribute(spanId, key, value) {
|
|
145
|
+
const idx = ring.index.get(spanId);
|
|
146
|
+
if (idx === void 0) return;
|
|
147
|
+
const existing = ring.buffer[idx];
|
|
148
|
+
if (!existing) return;
|
|
149
|
+
ring.buffer[idx] = {
|
|
150
|
+
...existing,
|
|
151
|
+
attributes: { ...existing.attributes, [key]: value }
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function recordSpanEvent(spanId, eventName, timeNs, attributes) {
|
|
155
|
+
const idx = ring.index.get(spanId);
|
|
156
|
+
if (idx === void 0) return;
|
|
157
|
+
const existing = ring.buffer[idx];
|
|
158
|
+
if (!existing) return;
|
|
159
|
+
ring.buffer[idx] = {
|
|
160
|
+
...existing,
|
|
161
|
+
events: [
|
|
162
|
+
...existing.events,
|
|
163
|
+
{ name: eventName, timeNs: timeNs.toString(), attributes }
|
|
164
|
+
]
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function prettyPrintCause(cause) {
|
|
168
|
+
if (cause instanceof Error) return cause.message;
|
|
169
|
+
if (typeof cause === "string") return cause;
|
|
170
|
+
try {
|
|
171
|
+
return JSON.stringify(cause);
|
|
172
|
+
} catch {
|
|
173
|
+
return String(cause);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function makeStartedRecord(spanId, traceId, parentSpanId, name, kind, startTimeNs) {
|
|
177
|
+
return {
|
|
178
|
+
traceId,
|
|
179
|
+
spanId,
|
|
180
|
+
parentSpanId,
|
|
181
|
+
name,
|
|
182
|
+
kind,
|
|
183
|
+
startTimeNs: startTimeNs.toString(),
|
|
184
|
+
endTimeNs: null,
|
|
185
|
+
durationMs: null,
|
|
186
|
+
attributes: {},
|
|
187
|
+
events: [],
|
|
188
|
+
status: "started"
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function getParentSpanId(parent) {
|
|
192
|
+
return Option_exports.isSome(parent) ? parent.value.spanId : null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// packages/shared/effect-core/src/tracer.ts
|
|
196
|
+
var randomHexString = (length) => {
|
|
197
|
+
const chars = "abcdef0123456789";
|
|
198
|
+
let s = "";
|
|
199
|
+
for (let i = 0; i < length; i++) {
|
|
200
|
+
s += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
201
|
+
}
|
|
202
|
+
return s;
|
|
203
|
+
};
|
|
204
|
+
var RecordingSpan = class {
|
|
205
|
+
constructor(name, parent, context, links, startTime, kind) {
|
|
206
|
+
this.name = name;
|
|
207
|
+
this.parent = parent;
|
|
208
|
+
this.context = context;
|
|
209
|
+
this.startTime = startTime;
|
|
210
|
+
this.kind = kind;
|
|
211
|
+
this._tag = "Span";
|
|
212
|
+
this.sampled = true;
|
|
213
|
+
this.attributes = /* @__PURE__ */ new Map();
|
|
214
|
+
this.events = [];
|
|
215
|
+
this.traceId = Option_exports.isSome(parent) ? parent.value.traceId : randomHexString(32);
|
|
216
|
+
this.spanId = randomHexString(16);
|
|
217
|
+
this.status = { _tag: "Started", startTime };
|
|
218
|
+
this.links = Array.from(links);
|
|
219
|
+
recordSpanStart(
|
|
220
|
+
makeStartedRecord(
|
|
221
|
+
this.spanId,
|
|
222
|
+
this.traceId,
|
|
223
|
+
getParentSpanId(parent),
|
|
224
|
+
name,
|
|
225
|
+
kind,
|
|
226
|
+
startTime
|
|
227
|
+
)
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
end(endTime, exit) {
|
|
231
|
+
this.status = {
|
|
232
|
+
_tag: "Ended",
|
|
233
|
+
endTime,
|
|
234
|
+
exit,
|
|
235
|
+
startTime: this.status.startTime
|
|
236
|
+
};
|
|
237
|
+
recordSpanEnd(
|
|
238
|
+
this.spanId,
|
|
239
|
+
endTime,
|
|
240
|
+
exit._tag === "Success" ? { _tag: "Success" } : { _tag: "Failure", cause: exit.cause }
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
attribute(key, value) {
|
|
244
|
+
this.attributes.set(key, value);
|
|
245
|
+
recordSpanAttribute(this.spanId, key, value);
|
|
246
|
+
}
|
|
247
|
+
event(name, startTime, attributes) {
|
|
248
|
+
this.events.push([name, startTime, attributes ?? {}]);
|
|
249
|
+
recordSpanEvent(this.spanId, name, startTime, attributes);
|
|
250
|
+
}
|
|
251
|
+
addLinks(links) {
|
|
252
|
+
this.links.push(...links);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
var recordingTracer = Tracer_exports.make({
|
|
256
|
+
span: (name, parent, context, links, startTime, kind) => new RecordingSpan(name, parent, context, links, startTime, kind),
|
|
257
|
+
context: (f) => f()
|
|
258
|
+
});
|
|
259
|
+
var TracerLivePretty = Layer_exports.succeed(
|
|
260
|
+
Tracer_exports.Tracer,
|
|
261
|
+
recordingTracer
|
|
262
|
+
);
|
|
263
|
+
var TracerLiveNoop = Layer_exports.empty;
|
|
264
|
+
|
|
265
|
+
// packages/shared/effect-core/src/config.ts
|
|
266
|
+
var envConfig = Config_exports.literal("dev", "prod")("COCKPIT_ENV").pipe(
|
|
267
|
+
Config_exports.withDefault("prod")
|
|
268
|
+
);
|
|
269
|
+
var hostConfig = Config_exports.string("COCKPIT_HOST").pipe(
|
|
270
|
+
Config_exports.withDefault("127.0.0.1")
|
|
271
|
+
);
|
|
272
|
+
var portConfig = Config_exports.integer("COCKPIT_PORT").pipe(
|
|
273
|
+
Config_exports.orElse(() => Config_exports.integer("PORT")),
|
|
274
|
+
Config_exports.withDefault(3457)
|
|
275
|
+
);
|
|
276
|
+
var openProjectConfig = Config_exports.option(
|
|
277
|
+
Config_exports.string("COCKPIT_OPEN_PROJECT")
|
|
278
|
+
).pipe(
|
|
279
|
+
Config_exports.map((opt) => opt._tag === "Some" ? opt.value : void 0)
|
|
280
|
+
);
|
|
281
|
+
var noOpenConfig = Config_exports.boolean("COCKPIT_NO_OPEN").pipe(
|
|
282
|
+
Config_exports.withDefault(false)
|
|
283
|
+
);
|
|
284
|
+
var logLevelConfig = Config_exports.string("COCKPIT_LOG_LEVEL").pipe(
|
|
285
|
+
Config_exports.withDefault("info")
|
|
286
|
+
);
|
|
287
|
+
var cockpitDirConfigOpt = Config_exports.option(Config_exports.string("COCKPIT_DIR"));
|
|
288
|
+
var CockpitConfig = Effect_exports.gen(
|
|
289
|
+
function* () {
|
|
290
|
+
const env = yield* envConfig;
|
|
291
|
+
const host = yield* hostConfig;
|
|
292
|
+
const port = yield* portConfig;
|
|
293
|
+
const openProject = yield* openProjectConfig;
|
|
294
|
+
const noOpen = yield* noOpenConfig;
|
|
295
|
+
const logLevel = yield* logLevelConfig;
|
|
296
|
+
const cockpitDirOpt = yield* cockpitDirConfigOpt;
|
|
297
|
+
const cockpitDir = yield* Effect_exports.sync(() => {
|
|
298
|
+
if (cockpitDirOpt._tag === "Some") return cockpitDirOpt.value;
|
|
299
|
+
const env2 = typeof process !== "undefined" ? process.env : void 0;
|
|
300
|
+
const home = env2?.HOME || env2?.USERPROFILE || ".";
|
|
301
|
+
return home + "/.cockpit";
|
|
302
|
+
});
|
|
303
|
+
const logFile = cockpitDir + "/logs/cockpit.log";
|
|
304
|
+
return {
|
|
305
|
+
env,
|
|
306
|
+
host,
|
|
307
|
+
port: port === 3457 && env === "dev" ? 3456 : port,
|
|
308
|
+
// dev defaults to 3456
|
|
309
|
+
cockpitDir,
|
|
310
|
+
openProject,
|
|
311
|
+
openBrowser: !noOpen,
|
|
312
|
+
logLevel,
|
|
313
|
+
logFile
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
).pipe(Effect_exports.orDie);
|
|
317
|
+
var ConfigLive = Layer_exports.empty;
|
|
318
|
+
|
|
319
|
+
// packages/shared/effect-core/src/schedule.ts
|
|
320
|
+
var wsReconnect = Schedule_exports.exponential(
|
|
321
|
+
Duration_exports.seconds(1),
|
|
322
|
+
1.5
|
|
323
|
+
).pipe(
|
|
324
|
+
Schedule_exports.either(Schedule_exports.spaced(Duration_exports.seconds(10))),
|
|
325
|
+
// cap at 10s
|
|
326
|
+
Schedule_exports.intersect(Schedule_exports.recurs(10))
|
|
327
|
+
// up to 10 attempts
|
|
328
|
+
);
|
|
329
|
+
var dbRetry = Schedule_exports.exponential(
|
|
330
|
+
Duration_exports.millis(200),
|
|
331
|
+
2
|
|
332
|
+
).pipe(
|
|
333
|
+
Schedule_exports.either(Schedule_exports.spaced(Duration_exports.seconds(5))),
|
|
334
|
+
Schedule_exports.intersect(Schedule_exports.recurs(5))
|
|
335
|
+
);
|
|
336
|
+
var agentRetry = Schedule_exports.exponential(
|
|
337
|
+
Duration_exports.seconds(1),
|
|
338
|
+
2
|
|
339
|
+
).pipe(
|
|
340
|
+
Schedule_exports.jittered,
|
|
341
|
+
// jitter to avoid thundering herd
|
|
342
|
+
Schedule_exports.either(Schedule_exports.spaced(Duration_exports.seconds(30))),
|
|
343
|
+
Schedule_exports.intersect(Schedule_exports.recurs(8))
|
|
344
|
+
);
|
|
345
|
+
var wsHeartbeat = Schedule_exports.spaced(Duration_exports.seconds(30));
|
|
346
|
+
var shortPoll = Schedule_exports.spaced(Duration_exports.seconds(1));
|
|
347
|
+
var longPoll = Schedule_exports.spaced(Duration_exports.seconds(30));
|
|
348
|
+
var fileChangeDebounce = Duration_exports.millis(50);
|
|
349
|
+
var cron = Schedule_exports.cron;
|
|
350
|
+
|
|
351
|
+
// packages/feature/console/src/effect/pgLive.ts
|
|
352
|
+
import pg from "pg";
|
|
353
|
+
|
|
354
|
+
// packages/shared/effect-services/src/db.ts
|
|
355
|
+
var PgService = Context_exports.GenericTag("@cockpit/PgService");
|
|
356
|
+
var MySQLService = Context_exports.GenericTag("@cockpit/MySQLService");
|
|
357
|
+
var RedisService = Context_exports.GenericTag("@cockpit/RedisService");
|
|
358
|
+
var Neo4jService = Context_exports.GenericTag("@cockpit/Neo4jService");
|
|
359
|
+
var MongoService = Context_exports.GenericTag("@cockpit/MongoService");
|
|
360
|
+
|
|
361
|
+
// packages/shared/effect-services/src/agent.ts
|
|
362
|
+
var AgentService = Context_exports.GenericTag("@cockpit/AgentService");
|
|
363
|
+
|
|
364
|
+
// packages/shared/effect-services/src/scheduler.ts
|
|
365
|
+
var Scheduler = Context_exports.GenericTag("@cockpit/Scheduler");
|
|
366
|
+
|
|
367
|
+
// packages/feature/console/src/effect/pgLive.ts
|
|
368
|
+
var { Pool } = pg;
|
|
369
|
+
var handleAsync = (op, f) => Effect_exports.tryPromise({
|
|
370
|
+
try: f,
|
|
371
|
+
catch: (cause) => new DBError({ db: "pg", op, cause })
|
|
372
|
+
});
|
|
373
|
+
var acquirePool = (poolsRef, id, connectionString) => Effect_exports.gen(function* () {
|
|
374
|
+
const pools = yield* Ref_exports.get(poolsRef);
|
|
375
|
+
const existing = pools.get(id);
|
|
376
|
+
if (existing && existing.connectionString === connectionString) {
|
|
377
|
+
return existing.pool;
|
|
378
|
+
}
|
|
379
|
+
if (existing) {
|
|
380
|
+
yield* handleAsync("end", () => existing.pool.end()).pipe(
|
|
381
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
const pool = new Pool({
|
|
385
|
+
connectionString,
|
|
386
|
+
max: 5,
|
|
387
|
+
idleTimeoutMillis: 6e4,
|
|
388
|
+
connectionTimeoutMillis: 1e4
|
|
389
|
+
});
|
|
390
|
+
yield* Ref_exports.update(poolsRef, (m) => {
|
|
391
|
+
const next = new Map(m);
|
|
392
|
+
next.set(id, { pool, connectionString, createdAt: Date.now() });
|
|
393
|
+
return next;
|
|
394
|
+
});
|
|
395
|
+
return pool;
|
|
396
|
+
});
|
|
397
|
+
var disconnectPool = (poolsRef, id) => Effect_exports.gen(function* () {
|
|
398
|
+
const pools = yield* Ref_exports.get(poolsRef);
|
|
399
|
+
const managed = pools.get(id);
|
|
400
|
+
if (!managed) return;
|
|
401
|
+
yield* handleAsync("disconnect", () => managed.pool.end()).pipe(
|
|
402
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
403
|
+
);
|
|
404
|
+
yield* Ref_exports.update(poolsRef, (m) => {
|
|
405
|
+
const next = new Map(m);
|
|
406
|
+
next.delete(id);
|
|
407
|
+
return next;
|
|
408
|
+
});
|
|
409
|
+
});
|
|
410
|
+
var PgServiceLive = Layer_exports.scoped(
|
|
411
|
+
PgService,
|
|
412
|
+
Effect_exports.gen(function* () {
|
|
413
|
+
const poolsRef = yield* Ref_exports.make(/* @__PURE__ */ new Map());
|
|
414
|
+
yield* Effect_exports.addFinalizer(
|
|
415
|
+
() => Effect_exports.gen(function* () {
|
|
416
|
+
const pools = yield* Ref_exports.get(poolsRef);
|
|
417
|
+
for (const { pool } of pools.values()) {
|
|
418
|
+
yield* Effect_exports.tryPromise({
|
|
419
|
+
try: () => pool.end(),
|
|
420
|
+
catch: (cause) => new DBError({ db: "pg", op: "shutdown end", cause })
|
|
421
|
+
}).pipe(Effect_exports.orElse(() => Effect_exports.void));
|
|
422
|
+
}
|
|
423
|
+
yield* Ref_exports.set(poolsRef, /* @__PURE__ */ new Map());
|
|
424
|
+
yield* Effect_exports.logInfo(
|
|
425
|
+
`[PgServiceLive] disposed ${pools.size} pool(s)`
|
|
426
|
+
);
|
|
427
|
+
})
|
|
428
|
+
);
|
|
429
|
+
return PgService.of({
|
|
430
|
+
query: (id, connStr, sql, params) => Effect_exports.gen(function* () {
|
|
431
|
+
const pool = yield* acquirePool(poolsRef, id, connStr);
|
|
432
|
+
const result = yield* handleAsync(
|
|
433
|
+
"query",
|
|
434
|
+
() => pool.query(sql, params)
|
|
435
|
+
);
|
|
436
|
+
return result.rows;
|
|
437
|
+
}).pipe(Effect_exports.withSpan("pg.query", { attributes: { id } })),
|
|
438
|
+
queryWithMeta: (id, connStr, sql, params) => Effect_exports.gen(function* () {
|
|
439
|
+
const pool = yield* acquirePool(poolsRef, id, connStr);
|
|
440
|
+
const start = performance.now();
|
|
441
|
+
const result = yield* handleAsync(
|
|
442
|
+
"queryWithMeta",
|
|
443
|
+
() => pool.query(sql, params)
|
|
444
|
+
);
|
|
445
|
+
const duration = Math.round((performance.now() - start) * 100) / 100;
|
|
446
|
+
const meta = {
|
|
447
|
+
rows: result.rows ?? [],
|
|
448
|
+
fields: result.fields ? result.fields.map(
|
|
449
|
+
(f) => ({
|
|
450
|
+
name: f.name,
|
|
451
|
+
dataTypeID: f.dataTypeID
|
|
452
|
+
})
|
|
453
|
+
) : null,
|
|
454
|
+
rowCount: result.rowCount ?? null,
|
|
455
|
+
command: result.command ?? null,
|
|
456
|
+
duration
|
|
457
|
+
};
|
|
458
|
+
return meta;
|
|
459
|
+
}).pipe(
|
|
460
|
+
Effect_exports.withSpan("pg.queryWithMeta", { attributes: { id } })
|
|
461
|
+
),
|
|
462
|
+
stream: (id, connStr, sql, params) => Stream_exports.unwrap(
|
|
463
|
+
Effect_exports.gen(function* () {
|
|
464
|
+
const pool = yield* acquirePool(poolsRef, id, connStr);
|
|
465
|
+
const result = yield* handleAsync(
|
|
466
|
+
"query",
|
|
467
|
+
() => pool.query(sql, params)
|
|
468
|
+
);
|
|
469
|
+
return Stream_exports.fromIterable(result.rows);
|
|
470
|
+
})
|
|
471
|
+
),
|
|
472
|
+
withTx: (id, connStr, f) => Effect_exports.gen(function* () {
|
|
473
|
+
const pool = yield* acquirePool(poolsRef, id, connStr);
|
|
474
|
+
const client = yield* handleAsync("connect", () => pool.connect());
|
|
475
|
+
yield* handleAsync("BEGIN", () => client.query("BEGIN"));
|
|
476
|
+
const tx = {
|
|
477
|
+
query: (sql, params) => handleAsync(
|
|
478
|
+
"tx.query",
|
|
479
|
+
() => client.query(sql, params).then((r) => r.rows)
|
|
480
|
+
)
|
|
481
|
+
};
|
|
482
|
+
const result = yield* f(tx).pipe(
|
|
483
|
+
Effect_exports.tapBoth({
|
|
484
|
+
onSuccess: () => handleAsync("COMMIT", () => client.query("COMMIT")),
|
|
485
|
+
onFailure: () => handleAsync(
|
|
486
|
+
"ROLLBACK",
|
|
487
|
+
() => client.query("ROLLBACK")
|
|
488
|
+
).pipe(Effect_exports.orElse(() => Effect_exports.void))
|
|
489
|
+
}),
|
|
490
|
+
Effect_exports.ensuring(Effect_exports.sync(() => client.release()))
|
|
491
|
+
);
|
|
492
|
+
return result;
|
|
493
|
+
}).pipe(Effect_exports.withSpan("pg.withTx", { attributes: { id } })),
|
|
494
|
+
disconnect: (id) => disconnectPool(poolsRef, id)
|
|
495
|
+
});
|
|
496
|
+
})
|
|
497
|
+
);
|
|
498
|
+
|
|
499
|
+
// packages/feature/console/src/effect/mysqlLive.ts
|
|
500
|
+
import mysql from "mysql2/promise";
|
|
501
|
+
var handleAsync2 = (op, f) => Effect_exports.tryPromise({
|
|
502
|
+
try: f,
|
|
503
|
+
catch: (cause) => new DBError({ db: "mysql", op, cause })
|
|
504
|
+
});
|
|
505
|
+
var acquirePool2 = (poolsRef, id, connectionString) => Effect_exports.gen(function* () {
|
|
506
|
+
const pools = yield* Ref_exports.get(poolsRef);
|
|
507
|
+
const existing = pools.get(id);
|
|
508
|
+
if (existing && existing.connectionString === connectionString) {
|
|
509
|
+
return existing.pool;
|
|
510
|
+
}
|
|
511
|
+
if (existing) {
|
|
512
|
+
yield* handleAsync2("end", () => existing.pool.end()).pipe(
|
|
513
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
const pool = mysql.createPool({
|
|
517
|
+
uri: connectionString,
|
|
518
|
+
connectionLimit: 5,
|
|
519
|
+
idleTimeout: 6e4,
|
|
520
|
+
connectTimeout: 1e4
|
|
521
|
+
});
|
|
522
|
+
yield* Ref_exports.update(poolsRef, (m) => {
|
|
523
|
+
const next = new Map(m);
|
|
524
|
+
next.set(id, { pool, connectionString, createdAt: Date.now() });
|
|
525
|
+
return next;
|
|
526
|
+
});
|
|
527
|
+
return pool;
|
|
528
|
+
});
|
|
529
|
+
var disconnectPool2 = (poolsRef, id) => Effect_exports.gen(function* () {
|
|
530
|
+
const pools = yield* Ref_exports.get(poolsRef);
|
|
531
|
+
const managed = pools.get(id);
|
|
532
|
+
if (!managed) return;
|
|
533
|
+
yield* handleAsync2("disconnect", () => managed.pool.end()).pipe(
|
|
534
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
535
|
+
);
|
|
536
|
+
yield* Ref_exports.update(poolsRef, (m) => {
|
|
537
|
+
const next = new Map(m);
|
|
538
|
+
next.delete(id);
|
|
539
|
+
return next;
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
var MySQLServiceLive = Layer_exports.scoped(
|
|
543
|
+
MySQLService,
|
|
544
|
+
Effect_exports.gen(function* () {
|
|
545
|
+
const poolsRef = yield* Ref_exports.make(/* @__PURE__ */ new Map());
|
|
546
|
+
yield* Effect_exports.addFinalizer(
|
|
547
|
+
() => Effect_exports.gen(function* () {
|
|
548
|
+
const pools = yield* Ref_exports.get(poolsRef);
|
|
549
|
+
for (const { pool } of pools.values()) {
|
|
550
|
+
yield* Effect_exports.tryPromise({
|
|
551
|
+
try: () => pool.end(),
|
|
552
|
+
catch: (cause) => new DBError({ db: "mysql", op: "shutdown end", cause })
|
|
553
|
+
}).pipe(Effect_exports.orElse(() => Effect_exports.void));
|
|
554
|
+
}
|
|
555
|
+
yield* Ref_exports.set(poolsRef, /* @__PURE__ */ new Map());
|
|
556
|
+
yield* Effect_exports.logInfo(
|
|
557
|
+
`[MySQLServiceLive] disposed ${pools.size} pool(s)`
|
|
558
|
+
);
|
|
559
|
+
})
|
|
560
|
+
);
|
|
561
|
+
return MySQLService.of({
|
|
562
|
+
query: (id, connStr, sql, params) => Effect_exports.gen(function* () {
|
|
563
|
+
const pool = yield* acquirePool2(poolsRef, id, connStr);
|
|
564
|
+
const [rows] = yield* handleAsync2(
|
|
565
|
+
"query",
|
|
566
|
+
() => pool.query(sql, params)
|
|
567
|
+
);
|
|
568
|
+
return rows;
|
|
569
|
+
}).pipe(Effect_exports.withSpan("mysql.query", { attributes: { id } })),
|
|
570
|
+
queryWithMeta: (id, connStr, sql, params) => Effect_exports.gen(function* () {
|
|
571
|
+
const pool = yield* acquirePool2(poolsRef, id, connStr);
|
|
572
|
+
const start = performance.now();
|
|
573
|
+
const [result, fieldPackets] = yield* handleAsync2(
|
|
574
|
+
"queryWithMeta",
|
|
575
|
+
() => pool.query(sql, params)
|
|
576
|
+
);
|
|
577
|
+
const duration = Math.round((performance.now() - start) * 100) / 100;
|
|
578
|
+
if (Array.isArray(result) && Array.isArray(fieldPackets)) {
|
|
579
|
+
const rows = result;
|
|
580
|
+
const fields = fieldPackets.map((f) => ({ name: f.name, dataTypeID: f.columnType ?? 0 }));
|
|
581
|
+
const meta2 = {
|
|
582
|
+
rows,
|
|
583
|
+
fields,
|
|
584
|
+
rowCount: rows.length,
|
|
585
|
+
command: null,
|
|
586
|
+
duration
|
|
587
|
+
};
|
|
588
|
+
return meta2;
|
|
589
|
+
}
|
|
590
|
+
const header = result;
|
|
591
|
+
const meta = {
|
|
592
|
+
rows: [],
|
|
593
|
+
fields: null,
|
|
594
|
+
rowCount: header.affectedRows ?? 0,
|
|
595
|
+
command: sql.trim().split(/\s+/)[0]?.toUpperCase() || "QUERY",
|
|
596
|
+
duration
|
|
597
|
+
};
|
|
598
|
+
return meta;
|
|
599
|
+
}).pipe(
|
|
600
|
+
Effect_exports.withSpan("mysql.queryWithMeta", { attributes: { id } })
|
|
601
|
+
),
|
|
602
|
+
withTx: (id, connStr, f) => Effect_exports.gen(function* () {
|
|
603
|
+
const pool = yield* acquirePool2(poolsRef, id, connStr);
|
|
604
|
+
const conn = yield* handleAsync2(
|
|
605
|
+
"getConnection",
|
|
606
|
+
() => pool.getConnection()
|
|
607
|
+
);
|
|
608
|
+
yield* handleAsync2("BEGIN", () => conn.beginTransaction());
|
|
609
|
+
const tx = {
|
|
610
|
+
query: (sql, params) => handleAsync2(
|
|
611
|
+
"tx.query",
|
|
612
|
+
() => conn.query(sql, params).then(([rows]) => rows)
|
|
613
|
+
)
|
|
614
|
+
};
|
|
615
|
+
const result = yield* f(tx).pipe(
|
|
616
|
+
Effect_exports.tapBoth({
|
|
617
|
+
onSuccess: () => handleAsync2("COMMIT", () => conn.commit()),
|
|
618
|
+
onFailure: () => handleAsync2("ROLLBACK", () => conn.rollback()).pipe(
|
|
619
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
620
|
+
)
|
|
621
|
+
}),
|
|
622
|
+
Effect_exports.ensuring(Effect_exports.sync(() => conn.release()))
|
|
623
|
+
);
|
|
624
|
+
return result;
|
|
625
|
+
}).pipe(Effect_exports.withSpan("mysql.withTx", { attributes: { id } })),
|
|
626
|
+
disconnect: (id) => disconnectPool2(poolsRef, id)
|
|
627
|
+
});
|
|
628
|
+
})
|
|
629
|
+
);
|
|
630
|
+
|
|
631
|
+
// packages/feature/console/src/effect/redisLive.ts
|
|
632
|
+
import Redis from "ioredis";
|
|
633
|
+
var handleAsync3 = (op, f) => Effect_exports.tryPromise({
|
|
634
|
+
try: f,
|
|
635
|
+
catch: (cause) => new DBError({ db: "redis", op, cause })
|
|
636
|
+
});
|
|
637
|
+
var acquireClient = (clientsRef, id, connectionString) => Effect_exports.gen(function* () {
|
|
638
|
+
const clients = yield* Ref_exports.get(clientsRef);
|
|
639
|
+
const existing = clients.get(id);
|
|
640
|
+
if (existing && existing.connectionString === connectionString) {
|
|
641
|
+
if (existing.client.status === "ready") return existing.client;
|
|
642
|
+
yield* handleAsync3("quit", () => existing.client.quit()).pipe(
|
|
643
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
644
|
+
);
|
|
645
|
+
} else if (existing) {
|
|
646
|
+
yield* handleAsync3("quit", () => existing.client.quit()).pipe(
|
|
647
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
const client = yield* handleAsync3("connect", async () => {
|
|
651
|
+
const c = new Redis(connectionString, {
|
|
652
|
+
lazyConnect: true,
|
|
653
|
+
connectTimeout: 1e4,
|
|
654
|
+
maxRetriesPerRequest: 1
|
|
655
|
+
});
|
|
656
|
+
await c.connect();
|
|
657
|
+
return c;
|
|
658
|
+
});
|
|
659
|
+
yield* Ref_exports.update(clientsRef, (m) => {
|
|
660
|
+
const next = new Map(m);
|
|
661
|
+
next.set(id, { client, connectionString, createdAt: Date.now() });
|
|
662
|
+
return next;
|
|
663
|
+
});
|
|
664
|
+
return client;
|
|
665
|
+
});
|
|
666
|
+
var disconnectClient = (clientsRef, id) => Effect_exports.gen(function* () {
|
|
667
|
+
const clients = yield* Ref_exports.get(clientsRef);
|
|
668
|
+
const managed = clients.get(id);
|
|
669
|
+
if (!managed) return;
|
|
670
|
+
yield* handleAsync3("disconnect", () => managed.client.quit()).pipe(
|
|
671
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
672
|
+
);
|
|
673
|
+
yield* Ref_exports.update(clientsRef, (m) => {
|
|
674
|
+
const next = new Map(m);
|
|
675
|
+
next.delete(id);
|
|
676
|
+
return next;
|
|
677
|
+
});
|
|
678
|
+
});
|
|
679
|
+
var subscribeStream = (connStr, pattern) => Stream_exports.unwrapScoped(
|
|
680
|
+
Effect_exports.gen(function* () {
|
|
681
|
+
const queue = yield* Queue_exports.unbounded();
|
|
682
|
+
const sub = yield* Effect_exports.acquireRelease(
|
|
683
|
+
handleAsync3("subscribeConnect", async () => {
|
|
684
|
+
const c = new Redis(connStr, {
|
|
685
|
+
lazyConnect: true,
|
|
686
|
+
connectTimeout: 1e4,
|
|
687
|
+
maxRetriesPerRequest: 1
|
|
688
|
+
});
|
|
689
|
+
await c.connect();
|
|
690
|
+
return c;
|
|
691
|
+
}),
|
|
692
|
+
(c) => Effect_exports.tryPromise({
|
|
693
|
+
try: () => c.quit(),
|
|
694
|
+
catch: () => new DBError({ db: "redis", op: "subscribeQuit", cause: null })
|
|
695
|
+
}).pipe(Effect_exports.orElse(() => Effect_exports.void))
|
|
696
|
+
);
|
|
697
|
+
const isPattern = pattern.includes("*") || pattern.includes("?");
|
|
698
|
+
yield* handleAsync3(
|
|
699
|
+
"psubscribe",
|
|
700
|
+
() => isPattern ? sub.psubscribe(pattern) : sub.subscribe(pattern)
|
|
701
|
+
);
|
|
702
|
+
sub.on(isPattern ? "pmessage" : "message", (...args) => {
|
|
703
|
+
const channel = isPattern ? args[1] : args[0];
|
|
704
|
+
const message = isPattern ? args[2] : args[1];
|
|
705
|
+
Effect_exports.runFork(Queue_exports.offer(queue, { channel, message }));
|
|
706
|
+
});
|
|
707
|
+
return Stream_exports.fromQueue(queue);
|
|
708
|
+
})
|
|
709
|
+
);
|
|
710
|
+
var RedisServiceLive = Layer_exports.scoped(
|
|
711
|
+
RedisService,
|
|
712
|
+
Effect_exports.gen(function* () {
|
|
713
|
+
const clientsRef = yield* Ref_exports.make(/* @__PURE__ */ new Map());
|
|
714
|
+
yield* Effect_exports.addFinalizer(
|
|
715
|
+
() => Effect_exports.gen(function* () {
|
|
716
|
+
const clients = yield* Ref_exports.get(clientsRef);
|
|
717
|
+
for (const { client } of clients.values()) {
|
|
718
|
+
yield* Effect_exports.tryPromise({
|
|
719
|
+
try: () => client.quit(),
|
|
720
|
+
catch: (cause) => new DBError({ db: "redis", op: "shutdown quit", cause })
|
|
721
|
+
}).pipe(Effect_exports.orElse(() => Effect_exports.void));
|
|
722
|
+
}
|
|
723
|
+
yield* Ref_exports.set(clientsRef, /* @__PURE__ */ new Map());
|
|
724
|
+
yield* Effect_exports.logInfo(
|
|
725
|
+
`[RedisServiceLive] disposed ${clients.size} client(s)`
|
|
726
|
+
);
|
|
727
|
+
})
|
|
728
|
+
);
|
|
729
|
+
return RedisService.of({
|
|
730
|
+
command: (id, connStr, cmd, args) => Effect_exports.gen(function* () {
|
|
731
|
+
const client = yield* acquireClient(clientsRef, id, connStr);
|
|
732
|
+
const result = yield* handleAsync3(
|
|
733
|
+
"call",
|
|
734
|
+
() => client.call(cmd, ...args ?? [])
|
|
735
|
+
);
|
|
736
|
+
return result;
|
|
737
|
+
}).pipe(Effect_exports.withSpan("redis.command", { attributes: { id, cmd } })),
|
|
738
|
+
subscribe: (_id, connStr, pattern) => subscribeStream(connStr, pattern),
|
|
739
|
+
disconnect: (id) => disconnectClient(clientsRef, id)
|
|
740
|
+
});
|
|
741
|
+
})
|
|
742
|
+
);
|
|
743
|
+
|
|
744
|
+
// packages/feature/console/src/effect/neo4jLive.ts
|
|
745
|
+
var handleAsync4 = (op, f) => Effect_exports.tryPromise({
|
|
746
|
+
try: f,
|
|
747
|
+
catch: (cause) => new DBError({ db: "neo4j", op, cause })
|
|
748
|
+
});
|
|
749
|
+
var acquireDriver = (driversRef, id, connectionString) => Effect_exports.gen(function* () {
|
|
750
|
+
const drivers = yield* Ref_exports.get(driversRef);
|
|
751
|
+
const existing = drivers.get(id);
|
|
752
|
+
if (existing && existing.connectionString === connectionString) {
|
|
753
|
+
return existing.driver;
|
|
754
|
+
}
|
|
755
|
+
if (existing) {
|
|
756
|
+
yield* handleAsync4("close", () => existing.driver.close()).pipe(
|
|
757
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
758
|
+
);
|
|
759
|
+
}
|
|
760
|
+
const driver = yield* handleAsync4(
|
|
761
|
+
"createDriver",
|
|
762
|
+
() => createNeo4jDriver(connectionString)
|
|
763
|
+
);
|
|
764
|
+
yield* Ref_exports.update(driversRef, (m) => {
|
|
765
|
+
const next = new Map(m);
|
|
766
|
+
next.set(id, { driver, connectionString, createdAt: Date.now() });
|
|
767
|
+
return next;
|
|
768
|
+
});
|
|
769
|
+
return driver;
|
|
770
|
+
});
|
|
771
|
+
var disconnectDriver = (driversRef, id) => Effect_exports.gen(function* () {
|
|
772
|
+
const drivers = yield* Ref_exports.get(driversRef);
|
|
773
|
+
const managed = drivers.get(id);
|
|
774
|
+
if (!managed) return;
|
|
775
|
+
yield* handleAsync4("disconnect", () => managed.driver.close()).pipe(
|
|
776
|
+
Effect_exports.orElse(() => Effect_exports.void)
|
|
777
|
+
);
|
|
778
|
+
yield* Ref_exports.update(driversRef, (m) => {
|
|
779
|
+
const next = new Map(m);
|
|
780
|
+
next.delete(id);
|
|
781
|
+
return next;
|
|
782
|
+
});
|
|
783
|
+
});
|
|
784
|
+
var Neo4jServiceLive = Layer_exports.scoped(
|
|
785
|
+
Neo4jService,
|
|
786
|
+
Effect_exports.gen(function* () {
|
|
787
|
+
const driversRef = yield* Ref_exports.make(/* @__PURE__ */ new Map());
|
|
788
|
+
yield* Effect_exports.addFinalizer(
|
|
789
|
+
() => Effect_exports.gen(function* () {
|
|
790
|
+
const drivers = yield* Ref_exports.get(driversRef);
|
|
791
|
+
for (const { driver } of drivers.values()) {
|
|
792
|
+
yield* Effect_exports.tryPromise({
|
|
793
|
+
try: () => driver.close(),
|
|
794
|
+
catch: (cause) => new DBError({ db: "neo4j", op: "shutdown close", cause })
|
|
795
|
+
}).pipe(Effect_exports.orElse(() => Effect_exports.void));
|
|
796
|
+
}
|
|
797
|
+
yield* Ref_exports.set(driversRef, /* @__PURE__ */ new Map());
|
|
798
|
+
yield* Effect_exports.logInfo(
|
|
799
|
+
`[Neo4jServiceLive] disposed ${drivers.size} driver(s)`
|
|
800
|
+
);
|
|
801
|
+
})
|
|
802
|
+
);
|
|
803
|
+
return Neo4jService.of({
|
|
804
|
+
run: (id, connStr, cypher, params) => Effect_exports.gen(function* () {
|
|
805
|
+
const driver = yield* acquireDriver(driversRef, id, connStr);
|
|
806
|
+
const result = yield* handleAsync4(
|
|
807
|
+
"run",
|
|
808
|
+
() => runCypherWithDriver(driver, cypher, params)
|
|
809
|
+
);
|
|
810
|
+
return result.records;
|
|
811
|
+
}).pipe(Effect_exports.withSpan("neo4j.run", { attributes: { id } })),
|
|
812
|
+
runWithMeta: (id, connStr, cypher, params) => Effect_exports.gen(function* () {
|
|
813
|
+
const driver = yield* acquireDriver(driversRef, id, connStr);
|
|
814
|
+
const result = yield* handleAsync4(
|
|
815
|
+
"runWithMeta",
|
|
816
|
+
() => runCypherWithDriver(driver, cypher, params)
|
|
817
|
+
);
|
|
818
|
+
const meta = {
|
|
819
|
+
records: result.records,
|
|
820
|
+
keys: result.keys,
|
|
821
|
+
duration: result.duration,
|
|
822
|
+
counters: result.counters
|
|
823
|
+
};
|
|
824
|
+
return meta;
|
|
825
|
+
}).pipe(
|
|
826
|
+
Effect_exports.withSpan("neo4j.runWithMeta", { attributes: { id } })
|
|
827
|
+
),
|
|
828
|
+
disconnect: (id) => disconnectDriver(driversRef, id)
|
|
829
|
+
});
|
|
830
|
+
})
|
|
831
|
+
);
|
|
832
|
+
|
|
833
|
+
// packages/feature/console/src/effect/mongoLive.ts
|
|
834
|
+
var notImpl = (op) => Effect_exports.fail(
|
|
835
|
+
new DBError({
|
|
836
|
+
db: "mongo",
|
|
837
|
+
op,
|
|
838
|
+
cause: new Error("MongoServiceLive not implemented (mongodb driver not installed)")
|
|
839
|
+
})
|
|
840
|
+
);
|
|
841
|
+
var MongoServiceLive = Layer_exports.succeed(
|
|
842
|
+
MongoService,
|
|
843
|
+
MongoService.of({
|
|
844
|
+
find: () => notImpl("find"),
|
|
845
|
+
command: () => notImpl("command"),
|
|
846
|
+
disconnect: () => Effect_exports.void
|
|
847
|
+
// No connection, disconnect is a no-op
|
|
848
|
+
})
|
|
849
|
+
);
|
|
850
|
+
|
|
851
|
+
// packages/feature/agent/src/effect/schedulerLive.ts
|
|
852
|
+
var SchedulerLive = Layer_exports.scoped(
|
|
853
|
+
Scheduler,
|
|
854
|
+
Effect_exports.gen(function* () {
|
|
855
|
+
const fibersRef = yield* Ref_exports.make(
|
|
856
|
+
/* @__PURE__ */ new Map()
|
|
857
|
+
);
|
|
858
|
+
yield* Effect_exports.addFinalizer(
|
|
859
|
+
() => Effect_exports.gen(function* () {
|
|
860
|
+
const fibers = yield* Ref_exports.get(fibersRef);
|
|
861
|
+
for (const f of fibers.values()) {
|
|
862
|
+
yield* Fiber_exports.interrupt(f);
|
|
863
|
+
}
|
|
864
|
+
yield* Ref_exports.set(fibersRef, /* @__PURE__ */ new Map());
|
|
865
|
+
})
|
|
866
|
+
);
|
|
867
|
+
return Scheduler.of({
|
|
868
|
+
schedule: (id, task, policy) => Effect_exports.gen(function* () {
|
|
869
|
+
const existing = yield* Ref_exports.get(fibersRef).pipe(
|
|
870
|
+
Effect_exports.map((m) => m.get(id))
|
|
871
|
+
);
|
|
872
|
+
if (existing) {
|
|
873
|
+
yield* Fiber_exports.interrupt(existing);
|
|
874
|
+
}
|
|
875
|
+
const fiber = yield* Effect_exports.forkScoped(
|
|
876
|
+
task.pipe(
|
|
877
|
+
Effect_exports.repeat(policy),
|
|
878
|
+
Effect_exports.tapError(
|
|
879
|
+
(e) => Effect_exports.logError(`[scheduler] task '${id}' failed`).pipe(
|
|
880
|
+
Effect_exports.annotateLogs("error", String(e))
|
|
881
|
+
)
|
|
882
|
+
)
|
|
883
|
+
)
|
|
884
|
+
);
|
|
885
|
+
yield* Ref_exports.update(
|
|
886
|
+
fibersRef,
|
|
887
|
+
(m) => new Map(m).set(id, fiber)
|
|
888
|
+
);
|
|
889
|
+
yield* Effect_exports.logInfo(`[scheduler] task '${id}' started`);
|
|
890
|
+
return { id, fiber };
|
|
891
|
+
}),
|
|
892
|
+
list: Effect_exports.gen(function* () {
|
|
893
|
+
const fibers = yield* Ref_exports.get(fibersRef);
|
|
894
|
+
return Array.from(fibers.keys());
|
|
895
|
+
}),
|
|
896
|
+
cancel: (id) => Effect_exports.gen(function* () {
|
|
897
|
+
const fibers = yield* Ref_exports.get(fibersRef);
|
|
898
|
+
const f = fibers.get(id);
|
|
899
|
+
if (f) {
|
|
900
|
+
yield* Fiber_exports.interrupt(f);
|
|
901
|
+
yield* Ref_exports.update(fibersRef, (m) => {
|
|
902
|
+
const next = new Map(m);
|
|
903
|
+
next.delete(id);
|
|
904
|
+
return next;
|
|
905
|
+
});
|
|
906
|
+
yield* Effect_exports.logInfo(`[scheduler] task '${id}' cancelled`);
|
|
907
|
+
}
|
|
908
|
+
})
|
|
909
|
+
});
|
|
910
|
+
})
|
|
911
|
+
);
|
|
912
|
+
|
|
913
|
+
// packages/feature/agent/src/effect/claudeSdkAdapter.ts
|
|
13
914
|
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
915
|
+
var providerEnvFor = (provider, apiKeyOverride) => {
|
|
916
|
+
switch (provider) {
|
|
917
|
+
case "claude":
|
|
918
|
+
return apiKeyOverride ? { apiKey: apiKeyOverride } : {};
|
|
919
|
+
case "codex":
|
|
920
|
+
return {
|
|
921
|
+
baseUrl: "https://api.openai.com/v1",
|
|
922
|
+
apiKey: apiKeyOverride
|
|
923
|
+
};
|
|
924
|
+
case "kimi":
|
|
925
|
+
return {
|
|
926
|
+
baseUrl: "https://api.moonshot.cn/anthropic",
|
|
927
|
+
apiKey: apiKeyOverride
|
|
928
|
+
};
|
|
929
|
+
case "deepseek":
|
|
930
|
+
return {
|
|
931
|
+
baseUrl: "https://api.deepseek.com/anthropic",
|
|
932
|
+
apiKey: apiKeyOverride
|
|
933
|
+
};
|
|
934
|
+
case "ollama":
|
|
935
|
+
return {};
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
var buildOptions = (req, apiKeyOverride) => {
|
|
939
|
+
const env = providerEnvFor(req.provider, apiKeyOverride);
|
|
940
|
+
return {
|
|
941
|
+
model: req.model,
|
|
942
|
+
env: {
|
|
943
|
+
...process.env,
|
|
944
|
+
...env.baseUrl ? { ANTHROPIC_BASE_URL: env.baseUrl } : {},
|
|
945
|
+
...env.apiKey ? { ANTHROPIC_API_KEY: env.apiKey } : {}
|
|
946
|
+
}
|
|
947
|
+
};
|
|
948
|
+
};
|
|
949
|
+
var messagesToPrompt = (req) => {
|
|
950
|
+
const last = [...req.messages].reverse().find((m) => m.role === "user");
|
|
951
|
+
return last?.content ?? "";
|
|
952
|
+
};
|
|
953
|
+
var claudeChat = (req, apiKeyOverride) => Effect_exports.gen(function* () {
|
|
954
|
+
const chunks = yield* Stream_exports.runCollect(claudeStream(req, apiKeyOverride));
|
|
955
|
+
let text = "";
|
|
956
|
+
let usage;
|
|
957
|
+
for (const c of chunks) {
|
|
958
|
+
if (c._tag === "text") text += c.delta;
|
|
959
|
+
else if (c._tag === "done") usage = c.usage;
|
|
960
|
+
}
|
|
961
|
+
return {
|
|
962
|
+
message: { role: "assistant", content: text },
|
|
963
|
+
usage
|
|
964
|
+
};
|
|
965
|
+
}).pipe(Effect_exports.withSpan("agent.chat", { attributes: { provider: req.provider, model: req.model } }));
|
|
966
|
+
var claudeStream = (req, apiKeyOverride) => Stream_exports.async((emit) => {
|
|
967
|
+
const provider = req.provider;
|
|
968
|
+
const options = buildOptions(req, apiKeyOverride);
|
|
969
|
+
const prompt = messagesToPrompt(req);
|
|
970
|
+
let cancelled = false;
|
|
971
|
+
void (async () => {
|
|
972
|
+
try {
|
|
973
|
+
const response = query({ prompt, options });
|
|
974
|
+
for await (const message of response) {
|
|
975
|
+
if (cancelled) break;
|
|
976
|
+
const msg = message;
|
|
977
|
+
if (msg.type === "assistant" && msg.message?.content) {
|
|
978
|
+
for (const block of msg.message.content) {
|
|
979
|
+
if (block.type === "text" && block.text) {
|
|
980
|
+
void emit.single({ _tag: "text", delta: block.text });
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
if (msg.type === "result") {
|
|
985
|
+
void emit.single({
|
|
986
|
+
_tag: "done",
|
|
987
|
+
usage: msg.usage ? {
|
|
988
|
+
inputTokens: msg.usage.input_tokens ?? 0,
|
|
989
|
+
outputTokens: msg.usage.output_tokens ?? 0
|
|
990
|
+
} : void 0
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
void emit.end();
|
|
995
|
+
} catch (cause) {
|
|
996
|
+
void emit.fail(
|
|
997
|
+
new AgentError({
|
|
998
|
+
provider,
|
|
999
|
+
kind: "protocol",
|
|
1000
|
+
cause
|
|
1001
|
+
})
|
|
1002
|
+
);
|
|
1003
|
+
}
|
|
1004
|
+
})();
|
|
1005
|
+
return Effect_exports.sync(() => {
|
|
1006
|
+
cancelled = true;
|
|
1007
|
+
});
|
|
1008
|
+
});
|
|
1009
|
+
|
|
1010
|
+
// packages/feature/agent/src/effect/ollamaAdapter.ts
|
|
1011
|
+
import { streamText } from "ai";
|
|
1012
|
+
|
|
1013
|
+
// packages/feature/agent/src/server/api/chat/ollama/model.ts
|
|
1014
|
+
import { createOpenAI } from "@ai-sdk/openai";
|
|
1015
|
+
var ollamaFetch = async (input, init) => {
|
|
1016
|
+
if (init && typeof init.body === "string") {
|
|
1017
|
+
try {
|
|
1018
|
+
const body = JSON.parse(init.body);
|
|
1019
|
+
if (Array.isArray(body.messages)) {
|
|
1020
|
+
let mutated = false;
|
|
1021
|
+
for (const m of body.messages) {
|
|
1022
|
+
if (m && m.role === "assistant" && m.content == null) {
|
|
1023
|
+
m.content = "";
|
|
1024
|
+
mutated = true;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
if (mutated) init = { ...init, body: JSON.stringify(body) };
|
|
1028
|
+
}
|
|
1029
|
+
} catch {
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
return fetch(input, init);
|
|
1033
|
+
};
|
|
1034
|
+
function createOllamaModel(modelName) {
|
|
1035
|
+
const provider = createOpenAI({
|
|
1036
|
+
// EFFECT.md §0 exemption: third-party plugin API key in the same category as
|
|
1037
|
+
// OPENAI_API_KEY / ANTHROPIC_API_KEY; not pulled into CockpitConfig (would over-couple
|
|
1038
|
+
// cockpit configuration with third-party authentication).
|
|
1039
|
+
apiKey: process.env.OLLAMA_API_KEY || "ollama",
|
|
1040
|
+
baseURL: getOllamaOpenAIBaseURL(),
|
|
1041
|
+
fetch: ollamaFetch
|
|
1042
|
+
});
|
|
1043
|
+
return provider.chat(modelName);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
// packages/feature/agent/src/effect/ollamaAdapter.ts
|
|
1047
|
+
var toModelMessages = (messages) => messages.map((m) => ({
|
|
1048
|
+
role: m.role,
|
|
1049
|
+
content: m.content
|
|
1050
|
+
}));
|
|
1051
|
+
var ollamaChat = (req) => Effect_exports.gen(function* () {
|
|
1052
|
+
const chunks = yield* Stream_exports.runCollect(ollamaStream(req));
|
|
1053
|
+
let text = "";
|
|
1054
|
+
let usage;
|
|
1055
|
+
for (const c of chunks) {
|
|
1056
|
+
if (c._tag === "text") text += c.delta;
|
|
1057
|
+
else if (c._tag === "done") usage = c.usage;
|
|
1058
|
+
}
|
|
1059
|
+
return {
|
|
1060
|
+
message: { role: "assistant", content: text },
|
|
1061
|
+
usage
|
|
1062
|
+
};
|
|
1063
|
+
}).pipe(Effect_exports.withSpan("agent.chat", { attributes: { provider: "ollama", model: req.model } }));
|
|
1064
|
+
var ollamaStream = (req) => Stream_exports.async((emit) => {
|
|
1065
|
+
const abortController = new AbortController();
|
|
1066
|
+
void (async () => {
|
|
1067
|
+
try {
|
|
1068
|
+
const ollamaModel = createOllamaModel(req.model);
|
|
1069
|
+
const result = streamText({
|
|
1070
|
+
model: ollamaModel,
|
|
1071
|
+
messages: toModelMessages(req.messages),
|
|
1072
|
+
temperature: req.temperature ?? 0,
|
|
1073
|
+
abortSignal: abortController.signal
|
|
1074
|
+
});
|
|
1075
|
+
for await (const part of result.fullStream) {
|
|
1076
|
+
if (part.type === "text-delta") {
|
|
1077
|
+
const delta = part.text;
|
|
1078
|
+
if (delta) void emit.single({ _tag: "text", delta });
|
|
1079
|
+
} else if (part.type === "finish") {
|
|
1080
|
+
const u = part.totalUsage;
|
|
1081
|
+
void emit.single({
|
|
1082
|
+
_tag: "done",
|
|
1083
|
+
usage: u ? { inputTokens: u.inputTokens ?? 0, outputTokens: u.outputTokens ?? 0 } : void 0
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
void emit.end();
|
|
1088
|
+
} catch (cause) {
|
|
1089
|
+
void emit.fail(
|
|
1090
|
+
new AgentError({ provider: "ollama", kind: "protocol", cause })
|
|
1091
|
+
);
|
|
1092
|
+
}
|
|
1093
|
+
})();
|
|
1094
|
+
return Effect_exports.sync(() => abortController.abort());
|
|
1095
|
+
});
|
|
1096
|
+
|
|
1097
|
+
// packages/feature/agent/src/effect/agentLive.ts
|
|
1098
|
+
var retryableKinds = /* @__PURE__ */ new Set([
|
|
1099
|
+
"rate-limit",
|
|
1100
|
+
"timeout",
|
|
1101
|
+
"unknown"
|
|
1102
|
+
]);
|
|
1103
|
+
var isRetryable = (e) => retryableKinds.has(e.kind);
|
|
1104
|
+
var withAgentRetry = (effect) => effect.pipe(
|
|
1105
|
+
Effect_exports.retry({
|
|
1106
|
+
schedule: agentRetry,
|
|
1107
|
+
while: (e) => isRetryable(e)
|
|
1108
|
+
})
|
|
1109
|
+
);
|
|
1110
|
+
var dispatchChat = (req) => {
|
|
1111
|
+
switch (req.provider) {
|
|
1112
|
+
case "ollama":
|
|
1113
|
+
return ollamaChat(req);
|
|
1114
|
+
case "claude":
|
|
1115
|
+
case "codex":
|
|
1116
|
+
case "kimi":
|
|
1117
|
+
case "deepseek":
|
|
1118
|
+
return claudeChat(req);
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
var dispatchStream = (req) => {
|
|
1122
|
+
switch (req.provider) {
|
|
1123
|
+
case "ollama":
|
|
1124
|
+
return ollamaStream(req);
|
|
1125
|
+
case "claude":
|
|
1126
|
+
case "codex":
|
|
1127
|
+
case "kimi":
|
|
1128
|
+
case "deepseek":
|
|
1129
|
+
return claudeStream(req);
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
var AgentServiceLive = Layer_exports.succeed(
|
|
1133
|
+
AgentService,
|
|
1134
|
+
AgentService.of({
|
|
1135
|
+
chat: (req) => withAgentRetry(dispatchChat(req)),
|
|
1136
|
+
stream: (req) => dispatchStream(req)
|
|
1137
|
+
// Streaming is excluded from retry (mid-stream retry would drop already-emitted content)
|
|
1138
|
+
})
|
|
1139
|
+
);
|
|
1140
|
+
|
|
1141
|
+
// packages/shared/effect-runtime/src/server/runtime.ts
|
|
1142
|
+
var isDev = process.env.COCKPIT_ENV === "dev";
|
|
1143
|
+
var ServerBaseLayer = Layer_exports.unwrapEffect(
|
|
1144
|
+
Effect_exports.gen(function* () {
|
|
1145
|
+
const cfg = yield* CockpitConfig;
|
|
1146
|
+
const loggerLayer = isDev ? LoggerLivePretty : LoggerLiveProd(cfg.logFile);
|
|
1147
|
+
const tracerLayer = isDev ? TracerLivePretty : TracerLiveNoop;
|
|
1148
|
+
return Layer_exports.mergeAll(loggerLayer, tracerLayer, ConfigLive);
|
|
1149
|
+
})
|
|
1150
|
+
);
|
|
1151
|
+
var AppLayer = Layer_exports.mergeAll(
|
|
1152
|
+
ServerBaseLayer,
|
|
1153
|
+
// DB services
|
|
1154
|
+
PgServiceLive,
|
|
1155
|
+
MySQLServiceLive,
|
|
1156
|
+
RedisServiceLive,
|
|
1157
|
+
Neo4jServiceLive,
|
|
1158
|
+
MongoServiceLive,
|
|
1159
|
+
// Scheduler
|
|
1160
|
+
SchedulerLive,
|
|
1161
|
+
// Agent
|
|
1162
|
+
AgentServiceLive
|
|
1163
|
+
);
|
|
1164
|
+
var AppRuntime = ManagedRuntime_exports.make(AppLayer);
|
|
1165
|
+
|
|
1166
|
+
// packages/feature/agent/src/server/scheduledTasks.ts
|
|
14
1167
|
function parseCronField(field, min, max) {
|
|
15
1168
|
const values = [];
|
|
16
1169
|
for (const part of field.split(",")) {
|
|
@@ -55,61 +1208,82 @@ function getNextCronTime(cronExpr, after = /* @__PURE__ */ new Date()) {
|
|
|
55
1208
|
}
|
|
56
1209
|
return after.getTime() + 864e5;
|
|
57
1210
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
...
|
|
81
|
-
env: { ...process.env, CLAUDE_CONFIG_DIR: CLAUDE2_DIR }
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
await updateGlobalState(task.cwd, task.sessionId, "loading", void 0, task.message).catch(() => {
|
|
85
|
-
});
|
|
86
|
-
const MAX_COMPACTION_RETRIES = 1;
|
|
87
|
-
for (let attempt = 0; attempt <= MAX_COMPACTION_RETRIES; attempt++) {
|
|
88
|
-
let receivedResult = false;
|
|
89
|
-
const response = query({
|
|
90
|
-
// First attempt: send the actual message
|
|
91
|
-
// Retry after compaction: send 'continue' to resume
|
|
92
|
-
prompt: attempt === 0 ? task.message : "continue",
|
|
93
|
-
options
|
|
94
|
-
});
|
|
95
|
-
for await (const message of response) {
|
|
96
|
-
const msg = message;
|
|
97
|
-
if (msg.type === "result") {
|
|
98
|
-
receivedResult = true;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (receivedResult) break;
|
|
102
|
-
console.log(`[ScheduledTask] Stream ended without result, resuming (attempt ${attempt + 1}/${MAX_COMPACTION_RETRIES})`);
|
|
1211
|
+
var sendChatMessageEff = (task) => {
|
|
1212
|
+
const options = {
|
|
1213
|
+
resume: task.sessionId,
|
|
1214
|
+
cwd: task.cwd,
|
|
1215
|
+
settingSources: ["user", "project", "local"],
|
|
1216
|
+
allowedTools: [
|
|
1217
|
+
"Read",
|
|
1218
|
+
"Write",
|
|
1219
|
+
"Edit",
|
|
1220
|
+
"Bash",
|
|
1221
|
+
"Glob",
|
|
1222
|
+
"Grep",
|
|
1223
|
+
"WebFetch",
|
|
1224
|
+
"WebSearch",
|
|
1225
|
+
"Task",
|
|
1226
|
+
"TodoWrite",
|
|
1227
|
+
"mcp__*"
|
|
1228
|
+
],
|
|
1229
|
+
permissionMode: "bypassPermissions",
|
|
1230
|
+
allowDangerouslySkipPermissions: true,
|
|
1231
|
+
// For claude2 engine, override config directory to ~/.claude2
|
|
1232
|
+
...task.engine === "claude2" && {
|
|
1233
|
+
env: { ...process.env, CLAUDE_CONFIG_DIR: CLAUDE2_DIR }
|
|
103
1234
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
1235
|
+
};
|
|
1236
|
+
const MAX_COMPACTION_RETRIES = 1;
|
|
1237
|
+
return Effect_exports.gen(function* () {
|
|
1238
|
+
yield* Effect_exports.tryPromise(
|
|
1239
|
+
() => updateGlobalState(task.cwd, task.sessionId, "loading", void 0, task.message)
|
|
1240
|
+
).pipe(Effect_exports.orElse(() => Effect_exports.void));
|
|
1241
|
+
yield* Effect_exports.tryPromise({
|
|
1242
|
+
try: async () => {
|
|
1243
|
+
for (let attempt = 0; attempt <= MAX_COMPACTION_RETRIES; attempt++) {
|
|
1244
|
+
let receivedResult = false;
|
|
1245
|
+
const response = query2({
|
|
1246
|
+
prompt: attempt === 0 ? task.message : "continue",
|
|
1247
|
+
options
|
|
1248
|
+
});
|
|
1249
|
+
for await (const message of response) {
|
|
1250
|
+
const msg = message;
|
|
1251
|
+
if (msg.type === "result") receivedResult = true;
|
|
1252
|
+
}
|
|
1253
|
+
if (receivedResult) break;
|
|
1254
|
+
console.log(`[ScheduledTask] Stream ended without result, resuming (attempt ${attempt + 1}/${MAX_COMPACTION_RETRIES})`);
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
catch: (cause) => (
|
|
1258
|
+
// claude2 is a separate Anthropic credential set; the SDK is still claude. Classify under the 'claude' provider.
|
|
1259
|
+
new AgentError({
|
|
1260
|
+
provider: "claude",
|
|
1261
|
+
kind: "unknown",
|
|
1262
|
+
cause
|
|
1263
|
+
})
|
|
1264
|
+
)
|
|
110
1265
|
});
|
|
111
|
-
|
|
112
|
-
|
|
1266
|
+
const title = yield* Effect_exports.tryPromise(() => getSessionTitle(task.cwd, task.sessionId)).pipe(
|
|
1267
|
+
Effect_exports.orElseSucceed(() => void 0)
|
|
1268
|
+
);
|
|
1269
|
+
yield* Effect_exports.tryPromise(
|
|
1270
|
+
() => updateGlobalState(task.cwd, task.sessionId, "unread", title)
|
|
1271
|
+
).pipe(Effect_exports.orElse(() => Effect_exports.void));
|
|
1272
|
+
return true;
|
|
1273
|
+
}).pipe(
|
|
1274
|
+
Effect_exports.catchAll(
|
|
1275
|
+
(err) => Effect_exports.gen(function* () {
|
|
1276
|
+
console.error(`[ScheduledTask] Failed to send message for task ${task.id}:`, err);
|
|
1277
|
+
yield* Effect_exports.tryPromise(
|
|
1278
|
+
() => updateGlobalState(task.cwd, task.sessionId, "unread")
|
|
1279
|
+
).pipe(Effect_exports.orElse(() => Effect_exports.void));
|
|
1280
|
+
return false;
|
|
1281
|
+
})
|
|
1282
|
+
)
|
|
1283
|
+
);
|
|
1284
|
+
};
|
|
1285
|
+
async function sendChatMessage(task) {
|
|
1286
|
+
return AppRuntime.runPromise(sendChatMessageEff(task));
|
|
113
1287
|
}
|
|
114
1288
|
var ScheduledTaskManager = class {
|
|
115
1289
|
constructor() {
|
|
@@ -123,17 +1297,15 @@ var ScheduledTaskManager = class {
|
|
|
123
1297
|
this.onTaskFired = null;
|
|
124
1298
|
}
|
|
125
1299
|
/**
|
|
126
|
-
* Return the current port (from explicit init or
|
|
1300
|
+
* Return the current port (from explicit init or CockpitConfig).
|
|
1301
|
+
* CockpitConfig handles `Config.orElse(COCKPIT_PORT, PORT)` plus derived
|
|
1302
|
+
* dev/prod defaults; a single sync runPromise gets the unified typed value,
|
|
1303
|
+
* cached into this.port.
|
|
127
1304
|
*/
|
|
128
1305
|
getPort() {
|
|
129
1306
|
if (this.port) return this.port;
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
this.port = envPort;
|
|
133
|
-
return this.port;
|
|
134
|
-
}
|
|
135
|
-
const isDev = process.env.COCKPIT_ENV === "dev";
|
|
136
|
-
this.port = isDev ? 3456 : 3457;
|
|
1307
|
+
const cfg = AppRuntime.runSync(CockpitConfig);
|
|
1308
|
+
this.port = cfg.port;
|
|
137
1309
|
return this.port;
|
|
138
1310
|
}
|
|
139
1311
|
/**
|
|
@@ -466,9 +1638,10 @@ var ScheduledTaskManager = class {
|
|
|
466
1638
|
}
|
|
467
1639
|
}
|
|
468
1640
|
};
|
|
469
|
-
var
|
|
470
|
-
var scheduledTaskManager =
|
|
1641
|
+
var g2 = globalThis;
|
|
1642
|
+
var scheduledTaskManager = g2.__scheduledTaskManager ?? (g2.__scheduledTaskManager = new ScheduledTaskManager());
|
|
471
1643
|
export {
|
|
472
1644
|
getNextCronTime,
|
|
473
|
-
scheduledTaskManager
|
|
1645
|
+
scheduledTaskManager,
|
|
1646
|
+
sendChatMessageEff
|
|
474
1647
|
};
|