@surething/cockpit 1.0.256 → 1.0.258
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 +3 -4
- package/.next-prod/build-manifest.json +3 -3
- package/.next-prod/cockpit-build.json +1 -1
- package/.next-prod/prerender-manifest.json +4 -4
- package/.next-prod/react-loadable-manifest.json +2 -1
- package/.next-prod/routes-manifest.json +0 -6
- package/.next-prod/server/app/_global-error/page.js +2 -2
- 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/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js +1 -1
- 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 +2 -2
- package/.next-prod/server/app/_not-found.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.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 -1
- package/.next-prod/server/app/api/agent/test/route.js.nft.json +1 -1
- 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 +1 -5
- package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/glm/route.js +1 -1
- package/.next-prod/server/app/api/chat/glm/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/route.js +1 -1
- package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/chat/stop/route.js +1 -1
- package/.next-prod/server/app/api/chat/stop/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 +2 -2
- package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/db/connect/route.js +1 -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 +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/deepseek/balance/route.js +1 -1
- package/.next-prod/server/app/api/deepseek/balance/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/deepseek/credentials/route.js +1 -1
- package/.next-prod/server/app/api/deepseek/credentials/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/deepseek/models/route.js +1 -1
- package/.next-prod/server/app/api/deepseek/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/dev/spans/route.js +1 -1
- package/.next-prod/server/app/api/dev/spans/route.js.nft.json +1 -1
- 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/current-branch/route.js +1 -1
- package/.next-prod/server/app/api/git/current-branch/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/glm/credentials/route.js +1 -1
- package/.next-prod/server/app/api/glm/credentials/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/glm/models/route.js +1 -1
- package/.next-prod/server/app/api/glm/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/glm/usage/route.js +1 -1
- package/.next-prod/server/app/api/glm/usage/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/health/route.js +1 -1
- package/.next-prod/server/app/api/health/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/html-apps/[id]/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/[id]/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/html-apps/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/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/kimi/credentials/route.js +1 -1
- package/.next-prod/server/app/api/kimi/credentials/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/kimi/models/route.js +1 -1
- package/.next-prod/server/app/api/kimi/models/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/kimi/usage/route.js +1 -1
- package/.next-prod/server/app/api/kimi/usage/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 +2 -2
- 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 +1 -1
- 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/config/route.js +1 -1
- package/.next-prod/server/app/api/ollama/config/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 +2 -2
- package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/affected/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/affected/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/callees/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callees/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/callers/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callers/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/coedit/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/coedit/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/context/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/context/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/impact/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/impact/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/related/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/related/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/risk/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/risk/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/prompts/config/route.js +1 -1
- package/.next-prod/server/app/api/prompts/config/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/push/public-key/route.js +1 -1
- package/.next-prod/server/app/api/push/public-key/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/push/subscribe/route.js +1 -1
- package/.next-prod/server/app/api/push/subscribe/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/push/unsubscribe/route.js +1 -1
- package/.next-prod/server/app/api/push/unsubscribe/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 +2 -6
- 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/snapshots/diff/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/diff/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/snapshots/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/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/apps/[...path]/route.js +1 -1
- package/.next-prod/server/app/apps/[...path]/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/m/page.js +1 -1
- package/.next-prod/server/app/m/page.js.nft.json +1 -1
- package/.next-prod/server/app/m/page_client-reference-manifest.js +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/page.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +3 -4
- package/.next-prod/server/chunks/1564.js +5 -0
- package/.next-prod/server/chunks/3286.js +5 -5
- package/.next-prod/server/chunks/3863.js +1 -4
- package/.next-prod/server/chunks/5750.js +419 -0
- package/.next-prod/server/chunks/6495.js +1 -0
- package/.next-prod/server/chunks/6548.js +1 -1
- package/.next-prod/server/chunks/7270.js +3 -3
- package/.next-prod/server/chunks/8557.js +114 -0
- package/.next-prod/server/chunks/8764.js +26 -0
- package/.next-prod/server/chunks/9312.js +1 -0
- package/.next-prod/server/chunks/9352.js +6 -0
- package/.next-prod/server/chunks/9830.js +1 -1
- 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 +2 -2
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/ZFNy0XuBWptMqEQGi7GTy/_buildManifest.js +1 -0
- package/.next-prod/static/chunks/1372-cc9afa045dc4eb5e.js +15 -0
- package/.next-prod/static/chunks/6784-500e233d3e8f6b41.js +381 -0
- package/.next-prod/static/chunks/7482-8478af06d5aa0972.js +25 -0
- package/.next-prod/static/chunks/9b0008ae.d0c8feea26186989.js +45 -0
- package/.next-prod/static/chunks/app/_global-error/page-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/agent/test/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/bash/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/codex/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/glm/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/kimi/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/ollama/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/stop/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/claude-stats/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/commands/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/comments/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/db/columns/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/db/connect/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/db/disconnect/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/db/export/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/db/query/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/db/schemas/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/balance/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/credentials/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/models/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/dev/spans/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/extension/version/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/file/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/blame/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/clipboard/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/copy/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/delete/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/expanded/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/index/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/init/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/paste/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/read/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/readdir/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/recent/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/save/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/search/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/stat/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/files/text/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branches/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commits/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/current-branch/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/diff/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/discard/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/stage/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/status/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/unstage/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/git/worktree/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/credentials/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/models/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/usage/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/global-state/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/health/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/[id]/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/load/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/save/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/credentials/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/models/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/usage/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/definition/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/hover/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/references/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/status/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/columns/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/connect/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/export/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/query/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/query/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/note/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/config/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/models/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/start/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/open-cursor/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/open-vscode/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/pick-folder/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/project-settings/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/project-state/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/context/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/risk/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/projects/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/prompts/config/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/push/public-key/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/push/subscribe/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/command/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/connect/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/delete/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/get/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/keys/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/set/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/review/identify/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/review/order/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/review/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/review/share-info/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/review/users/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/services/config/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/services/scripts/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/session-by-path/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/settings/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/[id]/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/content/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/diff/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/env/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/history/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/api/version/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/apps/[...path]/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/{layout-f90feff7c76b0946.js → layout-bec1cf218bc88d81.js} +1 -1
- package/.next-prod/static/chunks/app/m/page-aff83d3f5f4047c5.js +1 -0
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/app/{page-c4b0acf767168141.js → page-5e6dbc9731415743.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-c4b0acf767168141.js → page-5e6dbc9731415743.js} +1 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-3c1c06e2de280418.js +1 -0
- package/.next-prod/static/chunks/webpack-ce60587570394496.js +1 -0
- package/.next-prod/static/css/2334aed02a409f57.css +1 -0
- package/.next-prod/trace +14 -14
- package/.next-prod/trace-build +1 -1
- package/.next-prod/types/routes.d.ts +1 -2
- package/.next-prod/types/validator.ts +0 -9
- package/dist/{chunk-AK47NPAX.mjs → chunk-L5TWVHYB.mjs} +128 -7
- package/dist/{chunk-BKJB2B6J.mjs → chunk-RSRPFWNL.mjs} +42 -24
- package/dist/{chunk-47FA22UG.mjs → chunk-YEZ3U3F2.mjs} +1 -1
- package/dist/httpApi.mjs +2 -2
- package/dist/scheduledTasks.mjs +716 -867
- package/dist/{server-MAWFYWEQ.mjs → server-UZPDELUK.mjs} +2 -2
- package/dist/wsServer.mjs +74 -16
- package/package.json +3 -2
- package/public/html-lib/pdf-viewer.js +12 -12
- package/public/pdfjs/pdf.worker.min.mjs +4 -4
- package/.next-prod/server/app/api/chat/pty-input/route.js +0 -1
- package/.next-prod/server/app/api/chat/pty-input/route.js.nft.json +0 -1
- package/.next-prod/server/app/api/chat/pty-input/route_client-reference-manifest.js +0 -1
- package/.next-prod/server/chunks/304.js +0 -5
- package/.next-prod/server/chunks/3630.js +0 -131
- package/.next-prod/server/chunks/3792.js +0 -9
- package/.next-prod/server/chunks/6244.js +0 -1
- package/.next-prod/server/chunks/816.js +0 -1
- package/.next-prod/server/chunks/9658.js +0 -419
- package/.next-prod/static/Czv7BvSRgbv_YxaPTAg76/_buildManifest.js +0 -1
- package/.next-prod/static/chunks/6784-a667d5c1bad7809f.js +0 -381
- package/.next-prod/static/chunks/68-f485ff0192217706.js +0 -15
- package/.next-prod/static/chunks/8209-8bdd924515d12e09.js +0 -25
- package/.next-prod/static/chunks/9b0008ae.295c31138a16177d.js +0 -45
- package/.next-prod/static/chunks/app/_global-error/page-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/agent/test/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/bash/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/codex/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/glm/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/kimi/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/ollama/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/pty-input/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/stop/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/claude-stats/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/commands/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/comments/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/db/columns/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/db/connect/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/db/disconnect/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/db/export/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/db/query/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/db/schemas/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/balance/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/credentials/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/models/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/dev/spans/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/extension/version/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/file/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/blame/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/clipboard/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/copy/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/delete/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/expanded/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/index/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/init/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/paste/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/read/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/readdir/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/recent/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/save/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/search/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/stat/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/files/text/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branches/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commits/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/current-branch/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/diff/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/discard/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/stage/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/status/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/unstage/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/git/worktree/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/credentials/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/models/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/usage/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/global-state/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/health/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/[id]/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/load/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/save/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/credentials/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/models/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/usage/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/definition/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/hover/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/references/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/status/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/columns/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/connect/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/export/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/query/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/query/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/note/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/config/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/models/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/start/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/open-cursor/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/open-vscode/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/pick-folder/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/project-settings/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/project-state/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/context/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/risk/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/projects/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/prompts/config/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/push/public-key/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/push/subscribe/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/command/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/connect/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/delete/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/get/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/keys/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/set/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/review/identify/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/review/order/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/review/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/review/share-info/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/review/users/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/services/config/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/services/scripts/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/session-by-path/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/settings/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/[id]/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/content/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/diff/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/env/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/history/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/api/version/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/apps/[...path]/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/app/m/page-76152d251f696ab0.js +0 -1
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-9dac0ffeb2327967.js +0 -1
- package/.next-prod/static/chunks/webpack-2c0b747c5f1f1292.js +0 -1
- package/.next-prod/static/css/cec4dec703a9f1ee.css +0 -1
- package/.next-prod/types/app/api/chat/pty-input/route.ts +0 -353
- /package/.next-prod/static/{Czv7BvSRgbv_YxaPTAg76 → ZFNy0XuBWptMqEQGi7GTy}/_ssgManifest.js +0 -0
- /package/.next-prod/static/chunks/{e868780c-bf7462247eeab995.js → e868780c.bf7462247eeab995.js} +0 -0
package/dist/scheduledTasks.mjs
CHANGED
|
@@ -5,18 +5,19 @@ import {
|
|
|
5
5
|
getSessionTitle,
|
|
6
6
|
isRunActive,
|
|
7
7
|
markRunIdle,
|
|
8
|
+
mergeStashedCodexRollout,
|
|
8
9
|
mergeStashedTranscript,
|
|
9
10
|
rekeyRun,
|
|
10
11
|
requestStop,
|
|
11
12
|
setRunAbort,
|
|
12
13
|
startRun,
|
|
14
|
+
stashCodexRollout,
|
|
13
15
|
stashTranscript,
|
|
14
16
|
updateGlobalState
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-L5TWVHYB.mjs";
|
|
16
18
|
import {
|
|
17
19
|
AgentError,
|
|
18
20
|
AppRuntime,
|
|
19
|
-
CLAUDE2_DIR,
|
|
20
21
|
COCKPIT_DIR,
|
|
21
22
|
DEEPSEEK_CREDENTIALS_FILE,
|
|
22
23
|
DEEPSEEK_DIR,
|
|
@@ -34,7 +35,6 @@ import {
|
|
|
34
35
|
encodePath,
|
|
35
36
|
findCodexSessionPath,
|
|
36
37
|
getBuiltinSessionsRoot,
|
|
37
|
-
getClaude2SessionPath,
|
|
38
38
|
getClaudeSessionPath,
|
|
39
39
|
getDeepseekBuiltinSessionPath,
|
|
40
40
|
getDeepseekSessionPath,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
settlePendingRecord,
|
|
52
52
|
withFileLock,
|
|
53
53
|
writeJsonFile
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-RSRPFWNL.mjs";
|
|
55
55
|
import {
|
|
56
56
|
__export
|
|
57
57
|
} from "./chunk-7P6ASYW6.mjs";
|
|
@@ -1170,13 +1170,13 @@ Finally emit [Overall recap: end-to-end interaction verification + total deliver
|
|
|
1170
1170
|
// packages/feature/agent/src/server/lib/htmlPrompt.ts
|
|
1171
1171
|
var HTML_PROMPT_ZH = `---
|
|
1172
1172
|
name: html
|
|
1173
|
-
description: "\u751F\u6210\u53EF\u4EA4\u4E92\u7684\
|
|
1174
|
-
argument-hint: "\u63CF\u8FF0\u4F60\u60F3\u8981\u7684\
|
|
1173
|
+
description: "\u751F\u6210\u53EF\u4EA4\u4E92\u7684 HTML \u5E94\u7528\uFF1A\u5185\u7F6E cockpit bash SDK\uFF0C\u6267\u884C\u547D\u4EE4\u53D6/\u6539\u6570\u636E"
|
|
1174
|
+
argument-hint: "\u63CF\u8FF0\u4F60\u60F3\u8981\u7684 HTML \u5E94\u7528"
|
|
1175
1175
|
---
|
|
1176
1176
|
|
|
1177
|
-
# \u751F\u6210 Cockpit \
|
|
1177
|
+
# \u751F\u6210 Cockpit HTML \u5E94\u7528
|
|
1178
1178
|
|
|
1179
|
-
\u4E00\u4E2A\u80FD\u53D6/\u6539\u6570\u636E\u7684\
|
|
1179
|
+
\u4E00\u4E2A\u80FD\u53D6/\u6539\u6570\u636E\u7684 HTML \u5E94\u7528\uFF1A\u9884\u89C8\u65F6\u6CE8\u5165\u4E86\u5168\u5C40 \`window.cockpit\` SDK \u2014\u2014 \u672C\u8D28\u5C31\u662F Bash
|
|
1180
1180
|
\u5DE5\u5177\u66B4\u9732\u7ED9\u9875\u9762\uFF0C\u9875\u9762\u6309\u94AE\u80FD \`curl\`\u3001\u8BFB\u5199\u6587\u4EF6\u3001\u8DD1\u811A\u672C\u3002
|
|
1181
1181
|
|
|
1182
1182
|
**\u9ED8\u8BA4\u7528 React \u5199**\uFF08\u4E0B\u9762\u7684\u672C\u5730\u96F6\u6784\u5EFA\u6808\uFF0Cproductized\u3001AI \u6700\u719F\uFF0C\u9002\u5408\u6709\u72B6\u6001 / \u591A\u89C6\u56FE /
|
|
@@ -1187,7 +1187,7 @@ argument-hint: "\u63CF\u8FF0\u4F60\u60F3\u8981\u7684\u5C0F\u5E94\u7528"
|
|
|
1187
1187
|
|
|
1188
1188
|
**\u522B\u4E00\u4E0A\u6765\u5C31\u5199\u6587\u4EF6**\uFF0C\u5206\u4E09\u6B65\uFF1A
|
|
1189
1189
|
|
|
1190
|
-
1. **\u5BF9\u9F50\u9700\u6C42** \u2014\u2014 \u5148\u590D\u8FF0\u4F60\u5BF9\u8FD9\u4E2A\
|
|
1190
|
+
1. **\u5BF9\u9F50\u9700\u6C42** \u2014\u2014 \u5148\u590D\u8FF0\u4F60\u5BF9\u8FD9\u4E2A HTML \u5E94\u7528\u7684\u7406\u89E3\uFF08\u505A\u4EC0\u4E48\u3001\u7528 React \u8FD8\u662F\u5355\u6587\u4EF6\u3001\u6570\u636E\u4ECE\u54EA\u6765\u3001
|
|
1191
1191
|
\u5173\u952E\u529F\u80FD\u4E0E\u4EA4\u4E92\uFF09\u3002\u4EC5\u5F53\u9700\u6C42\u6709\u6B67\u4E49\u6216\u5B58\u5728\u591A\u79CD\u5408\u7406\u89E3\u8BFB\u65F6\u624D\u56DE\u95EE\uFF1B\u5DF2\u7ECF\u6E05\u695A\u5C31\u76F4\u63A5\u7ED9\u4E00\u6BB5\u7B80\u77ED
|
|
1192
1192
|
\u7684\u7406\u89E3\u6458\u8981\uFF0C\u4E0D\u5FC5\u9010\u6761\u8FFD\u95EE\u3002
|
|
1193
1193
|
2. **\u544A\u77E5\u5B58\u653E\u76EE\u5F55** \u2014\u2014 \u6309\u4E0B\u9762\u300C\u5B58\u653E\u4F4D\u7F6E\u300D\u89C4\u5219\u5B9A\u51FA \`<\u76EE\u5F55>/<name>/\`\uFF0C\u660E\u786E\u544A\u8BC9\u7528\u6237\u51C6\u5907\u5B58\u54EA\u3001
|
|
@@ -2207,9 +2207,9 @@ function listUserSkills() {
|
|
|
2207
2207
|
return [];
|
|
2208
2208
|
}
|
|
2209
2209
|
}
|
|
2210
|
-
function readSkillName(
|
|
2210
|
+
function readSkillName(path) {
|
|
2211
2211
|
try {
|
|
2212
|
-
const txt = readFileSync(
|
|
2212
|
+
const txt = readFileSync(path, "utf-8");
|
|
2213
2213
|
const fm = txt.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
2214
2214
|
const block = fm ? fm[1] : txt;
|
|
2215
2215
|
const m = block.match(/^name:\s*["']?([^"'\n]+?)["']?\s*$/m);
|
|
@@ -2443,617 +2443,6 @@ async function runSdkLoop(ctx, buildOptions2) {
|
|
|
2443
2443
|
}
|
|
2444
2444
|
}
|
|
2445
2445
|
|
|
2446
|
-
// packages/feature/agent/src/server/pty/claudePtyDriver.ts
|
|
2447
|
-
import * as fs from "fs";
|
|
2448
|
-
import * as os from "os";
|
|
2449
|
-
import * as path from "path";
|
|
2450
|
-
import * as crypto from "crypto";
|
|
2451
|
-
import * as pty from "node-pty";
|
|
2452
|
-
import { execSync } from "child_process";
|
|
2453
|
-
var shq = (s) => `'${s.replace(/'/g, `'\\''`)}'`;
|
|
2454
|
-
function hasCmd(c) {
|
|
2455
|
-
try {
|
|
2456
|
-
execSync(`command -v ${c}`, { stdio: "ignore" });
|
|
2457
|
-
return true;
|
|
2458
|
-
} catch {
|
|
2459
|
-
return false;
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
function clipboardImageSupported() {
|
|
2463
|
-
if (process.platform === "darwin") return true;
|
|
2464
|
-
if (process.platform === "linux") return hasCmd("wl-copy") || hasCmd("xclip");
|
|
2465
|
-
return false;
|
|
2466
|
-
}
|
|
2467
|
-
function setClipboardImage(file2, isPng) {
|
|
2468
|
-
try {
|
|
2469
|
-
if (process.platform === "darwin") {
|
|
2470
|
-
let png = file2;
|
|
2471
|
-
if (!isPng) {
|
|
2472
|
-
png = `${file2}.png`;
|
|
2473
|
-
execSync(`sips -s format png ${shq(file2)} --out ${shq(png)}`, { stdio: "ignore" });
|
|
2474
|
-
}
|
|
2475
|
-
execSync(`osascript -e 'set the clipboard to (read (POSIX file ${JSON.stringify(png)}) as \xABclass PNGf\xBB)'`, { stdio: "ignore" });
|
|
2476
|
-
return true;
|
|
2477
|
-
}
|
|
2478
|
-
if (process.platform === "linux") {
|
|
2479
|
-
if (hasCmd("wl-copy")) {
|
|
2480
|
-
execSync(`wl-copy --type image/png < ${shq(file2)}`, { shell: "/bin/bash", stdio: "ignore" });
|
|
2481
|
-
return true;
|
|
2482
|
-
}
|
|
2483
|
-
if (hasCmd("xclip")) {
|
|
2484
|
-
execSync(`xclip -selection clipboard -t image/png -i ${shq(file2)}`, { stdio: "ignore" });
|
|
2485
|
-
return true;
|
|
2486
|
-
}
|
|
2487
|
-
}
|
|
2488
|
-
} catch {
|
|
2489
|
-
}
|
|
2490
|
-
return false;
|
|
2491
|
-
}
|
|
2492
|
-
function getClipboardText() {
|
|
2493
|
-
try {
|
|
2494
|
-
if (process.platform === "darwin") return execSync("pbpaste", { encoding: "utf8" });
|
|
2495
|
-
if (hasCmd("wl-paste")) return execSync("wl-paste -n", { encoding: "utf8" });
|
|
2496
|
-
if (hasCmd("xclip")) return execSync("xclip -o -selection clipboard", { encoding: "utf8" });
|
|
2497
|
-
} catch {
|
|
2498
|
-
}
|
|
2499
|
-
return null;
|
|
2500
|
-
}
|
|
2501
|
-
function setClipboardText(t) {
|
|
2502
|
-
try {
|
|
2503
|
-
if (process.platform === "darwin") {
|
|
2504
|
-
execSync("pbcopy", { input: t });
|
|
2505
|
-
return;
|
|
2506
|
-
}
|
|
2507
|
-
if (hasCmd("wl-copy")) {
|
|
2508
|
-
execSync("wl-copy", { input: t });
|
|
2509
|
-
return;
|
|
2510
|
-
}
|
|
2511
|
-
if (hasCmd("xclip")) {
|
|
2512
|
-
execSync("xclip -selection clipboard", { input: t });
|
|
2513
|
-
return;
|
|
2514
|
-
}
|
|
2515
|
-
} catch {
|
|
2516
|
-
}
|
|
2517
|
-
}
|
|
2518
|
-
function sessionDirFor(cwd) {
|
|
2519
|
-
let real = cwd;
|
|
2520
|
-
try {
|
|
2521
|
-
real = fs.realpathSync(cwd);
|
|
2522
|
-
} catch {
|
|
2523
|
-
}
|
|
2524
|
-
const encoded = real.replace(/\//g, "-");
|
|
2525
|
-
return path.join(os.homedir(), ".claude", "projects", encoded);
|
|
2526
|
-
}
|
|
2527
|
-
function jsonlPathFor(cwd, sessionId) {
|
|
2528
|
-
return path.join(sessionDirFor(cwd), `${sessionId}.jsonl`);
|
|
2529
|
-
}
|
|
2530
|
-
var ASK_QUESTION_GUIDANCE = "Interactive questions cannot be displayed in this session. Do NOT retry this tool. Instead, present your questions as plain text in your reply - each question with its options and your recommended choice - then end your turn and wait for the user to answer in the next message.";
|
|
2531
|
-
function ensureHookSettings() {
|
|
2532
|
-
const p = path.join(os.tmpdir(), "cockpit-claude-hooks-v2.json");
|
|
2533
|
-
const content = JSON.stringify({
|
|
2534
|
-
hooks: {
|
|
2535
|
-
Stop: [{ hooks: [{ type: "command", command: "true" }] }],
|
|
2536
|
-
PreToolUse: [{
|
|
2537
|
-
matcher: "AskUserQuestion",
|
|
2538
|
-
hooks: [{ type: "command", command: `echo ${shq(ASK_QUESTION_GUIDANCE)} >&2; exit 2` }]
|
|
2539
|
-
}]
|
|
2540
|
-
}
|
|
2541
|
-
});
|
|
2542
|
-
try {
|
|
2543
|
-
if (fs.readFileSync(p, "utf8") === content) return p;
|
|
2544
|
-
} catch {
|
|
2545
|
-
}
|
|
2546
|
-
const tmp = `${p}.${process.pid}.tmp`;
|
|
2547
|
-
fs.writeFileSync(tmp, content);
|
|
2548
|
-
fs.renameSync(tmp, p);
|
|
2549
|
-
return p;
|
|
2550
|
-
}
|
|
2551
|
-
var ptyInputRegistry = /* @__PURE__ */ new Map();
|
|
2552
|
-
function trackBackgroundLifecycle(line, pending) {
|
|
2553
|
-
const content = line.message?.content;
|
|
2554
|
-
if (line.type === "user" && Array.isArray(content)) {
|
|
2555
|
-
for (const b of content) {
|
|
2556
|
-
if (b.type === "tool_result" && typeof b.content === "string") {
|
|
2557
|
-
const m = b.content.match(/Command running in background with ID:\s*([A-Za-z0-9_-]+)/);
|
|
2558
|
-
if (m) pending.add(m[1]);
|
|
2559
|
-
}
|
|
2560
|
-
}
|
|
2561
|
-
}
|
|
2562
|
-
const origin = line.origin;
|
|
2563
|
-
if (line.type === "user" && origin?.kind === "task-notification") {
|
|
2564
|
-
const raw = typeof content === "string" ? content : Array.isArray(content) ? content.filter((b) => b.type === "text").map((b) => b.text || "").join("") : "";
|
|
2565
|
-
const id = raw.match(/<task-id>([\s\S]*?)<\/task-id>/)?.[1]?.trim();
|
|
2566
|
-
if (id) pending.delete(id);
|
|
2567
|
-
}
|
|
2568
|
-
}
|
|
2569
|
-
function runClaudeTurn(opts) {
|
|
2570
|
-
const {
|
|
2571
|
-
cwd,
|
|
2572
|
-
prompt,
|
|
2573
|
-
onJsonlLine,
|
|
2574
|
-
onPtyData,
|
|
2575
|
-
onSubmit,
|
|
2576
|
-
onComplete,
|
|
2577
|
-
onQuestionEsc,
|
|
2578
|
-
onTurnBoundary,
|
|
2579
|
-
signal,
|
|
2580
|
-
debug = false,
|
|
2581
|
-
idleMs = 3e3,
|
|
2582
|
-
timeoutMs,
|
|
2583
|
-
cols = 80,
|
|
2584
|
-
rows = 24,
|
|
2585
|
-
stuckMs = 1e4,
|
|
2586
|
-
graceMs = 3e4,
|
|
2587
|
-
onStuck
|
|
2588
|
-
} = opts;
|
|
2589
|
-
const sessionId = opts.sessionId || crypto.randomUUID();
|
|
2590
|
-
const isResume = opts.resume === true;
|
|
2591
|
-
const jsonlPath = jsonlPathFor(cwd, sessionId);
|
|
2592
|
-
const settingsPath = ensureHookSettings();
|
|
2593
|
-
const log = (...a) => {
|
|
2594
|
-
if (debug) console.error("[driver]", ...a);
|
|
2595
|
-
};
|
|
2596
|
-
const EXT = { "image/png": "png", "image/jpeg": "jpg", "image/webp": "webp", "image/gif": "gif" };
|
|
2597
|
-
const tempImageFiles = [];
|
|
2598
|
-
for (const img of opts.images || []) {
|
|
2599
|
-
try {
|
|
2600
|
-
const p = path.join(os.tmpdir(), `cockpit-pty-img-${crypto.randomUUID()}.${EXT[img.media_type] || "png"}`);
|
|
2601
|
-
fs.writeFileSync(p, Buffer.from(img.data, "base64"));
|
|
2602
|
-
tempImageFiles.push({ path: p, isPng: img.media_type === "image/png" });
|
|
2603
|
-
} catch {
|
|
2604
|
-
}
|
|
2605
|
-
}
|
|
2606
|
-
const useClipboard = tempImageFiles.length > 0 && clipboardImageSupported();
|
|
2607
|
-
const effectivePrompt = !useClipboard && tempImageFiles.length ? `${prompt}
|
|
2608
|
-
|
|
2609
|
-
[Attached image(s)]:
|
|
2610
|
-
${tempImageFiles.map((f) => f.path).join("\n")}` : prompt;
|
|
2611
|
-
const cleanupImages = () => {
|
|
2612
|
-
for (const f of tempImageFiles) {
|
|
2613
|
-
try {
|
|
2614
|
-
fs.unlinkSync(f.path);
|
|
2615
|
-
} catch {
|
|
2616
|
-
}
|
|
2617
|
-
try {
|
|
2618
|
-
fs.unlinkSync(`${f.path}.png`);
|
|
2619
|
-
} catch {
|
|
2620
|
-
}
|
|
2621
|
-
}
|
|
2622
|
-
};
|
|
2623
|
-
return new Promise((resolve) => {
|
|
2624
|
-
let baseline = 0;
|
|
2625
|
-
try {
|
|
2626
|
-
baseline = fs.readFileSync(jsonlPath, "utf8").split("\n").filter(Boolean).length;
|
|
2627
|
-
} catch {
|
|
2628
|
-
}
|
|
2629
|
-
const flags = isResume ? ["-r", sessionId, "--dangerously-skip-permissions"] : ["--session-id", sessionId, "--dangerously-skip-permissions"];
|
|
2630
|
-
flags.push("--settings", settingsPath);
|
|
2631
|
-
const cmd = `claude ${flags.join(" ")}`;
|
|
2632
|
-
log("spawn:", cmd, "| jsonl:", jsonlPath, "| baseline:", baseline);
|
|
2633
|
-
const shell = process.env.SHELL || (process.platform === "darwin" ? "/bin/zsh" : "/bin/bash");
|
|
2634
|
-
let term;
|
|
2635
|
-
try {
|
|
2636
|
-
term = pty.spawn(shell, ["--login", "-c", cmd], {
|
|
2637
|
-
name: "xterm-256color",
|
|
2638
|
-
cols,
|
|
2639
|
-
rows,
|
|
2640
|
-
cwd,
|
|
2641
|
-
env: sanitizedSpawnEnv()
|
|
2642
|
-
});
|
|
2643
|
-
} catch (e) {
|
|
2644
|
-
cleanupImages();
|
|
2645
|
-
resolve({ sessionId, jsonlPath, completed: false, completedVia: null, exitCode: null, crashed: true, crashError: `spawn failed: ${String(e)}`, newLines: [] });
|
|
2646
|
-
return;
|
|
2647
|
-
}
|
|
2648
|
-
ptyInputRegistry.set(sessionId, (d) => {
|
|
2649
|
-
try {
|
|
2650
|
-
term.write(d);
|
|
2651
|
-
} catch {
|
|
2652
|
-
}
|
|
2653
|
-
});
|
|
2654
|
-
let rawBuf = "";
|
|
2655
|
-
let lastDataTs = Date.now();
|
|
2656
|
-
let menuHandled = false;
|
|
2657
|
-
let questionEscSent = false;
|
|
2658
|
-
let askQuestionUses = 0;
|
|
2659
|
-
let promptSent = false;
|
|
2660
|
-
let completed = false;
|
|
2661
|
-
let completedVia = null;
|
|
2662
|
-
let exitSent = false;
|
|
2663
|
-
let exited = false;
|
|
2664
|
-
let seen = baseline;
|
|
2665
|
-
let lastJsonlTs = 0;
|
|
2666
|
-
let sawAssistantText = false;
|
|
2667
|
-
let crashed = false;
|
|
2668
|
-
let crashError = "";
|
|
2669
|
-
let timedOut = false;
|
|
2670
|
-
const newLines = [];
|
|
2671
|
-
const pendingBg = /* @__PURE__ */ new Set();
|
|
2672
|
-
let awaitingNewTurn = false;
|
|
2673
|
-
term.onData((d) => {
|
|
2674
|
-
rawBuf += d;
|
|
2675
|
-
if (rawBuf.length > 2e5) rawBuf = rawBuf.slice(-15e4);
|
|
2676
|
-
lastDataTs = Date.now();
|
|
2677
|
-
onPtyData?.(d);
|
|
2678
|
-
if (!crashed && /claude-code\/cli\.js:\d+:\d+/.test(rawBuf)) {
|
|
2679
|
-
crashed = true;
|
|
2680
|
-
const m = rawBuf.match(/Cannot read properties of [^\n\x1b]+/);
|
|
2681
|
-
crashError = (m ? m[0] : "claude-code internal crash").trim();
|
|
2682
|
-
log("CRASH detected:", crashError);
|
|
2683
|
-
setTimeout(() => {
|
|
2684
|
-
if (!exited) {
|
|
2685
|
-
try {
|
|
2686
|
-
term.kill();
|
|
2687
|
-
} catch {
|
|
2688
|
-
}
|
|
2689
|
-
}
|
|
2690
|
-
}, 100);
|
|
2691
|
-
setTimeout(() => {
|
|
2692
|
-
if (!exited) {
|
|
2693
|
-
try {
|
|
2694
|
-
term.kill("SIGKILL");
|
|
2695
|
-
} catch {
|
|
2696
|
-
}
|
|
2697
|
-
}
|
|
2698
|
-
}, 1e3);
|
|
2699
|
-
return;
|
|
2700
|
-
}
|
|
2701
|
-
if (!menuHandled && /Bypass Permissions mode|Yes, I accept/i.test(rawBuf)) {
|
|
2702
|
-
menuHandled = true;
|
|
2703
|
-
log("accept menu \u2192 Down + Enter");
|
|
2704
|
-
setTimeout(() => term.write("\x1B[B"), 400);
|
|
2705
|
-
setTimeout(() => term.write("\r"), 700);
|
|
2706
|
-
}
|
|
2707
|
-
if (!questionEscSent && promptSent && !completed && /Enter to select.*Esc to cancel/i.test(rawBuf)) {
|
|
2708
|
-
questionEscSent = true;
|
|
2709
|
-
log("AskUserQuestion UI detected \u2192 ESC + end turn");
|
|
2710
|
-
onQuestionEsc?.();
|
|
2711
|
-
setTimeout(() => {
|
|
2712
|
-
try {
|
|
2713
|
-
term.write("\x1B");
|
|
2714
|
-
} catch {
|
|
2715
|
-
}
|
|
2716
|
-
}, 300);
|
|
2717
|
-
setTimeout(() => complete("question_esc"), 600);
|
|
2718
|
-
}
|
|
2719
|
-
});
|
|
2720
|
-
let replReadyTs = 0;
|
|
2721
|
-
const readyCheck = setInterval(() => {
|
|
2722
|
-
if (promptSent || exited) return;
|
|
2723
|
-
const replReady = /bypass permissions on|shift\+tab/i.test(rawBuf);
|
|
2724
|
-
if (replReady && !replReadyTs) replReadyTs = Date.now();
|
|
2725
|
-
if (!replReady) return;
|
|
2726
|
-
const settled = Date.now() - lastDataTs > 2200;
|
|
2727
|
-
const readyTimeout = Date.now() - replReadyTs > 4e3;
|
|
2728
|
-
if (settled || readyTimeout) submitPrompt();
|
|
2729
|
-
}, 300);
|
|
2730
|
-
let graceTimer = null;
|
|
2731
|
-
const stuckTimer = setTimeout(() => {
|
|
2732
|
-
if (promptSent || exited) return;
|
|
2733
|
-
log(`not ready after ${stuckMs}ms \u2192 prompt for manual handling, grace ${graceMs}ms`);
|
|
2734
|
-
onStuck?.();
|
|
2735
|
-
graceTimer = setTimeout(() => {
|
|
2736
|
-
if (promptSent || exited) return;
|
|
2737
|
-
timedOut = true;
|
|
2738
|
-
log("grace window elapsed and still not ready \u2192 kill");
|
|
2739
|
-
try {
|
|
2740
|
-
term.kill();
|
|
2741
|
-
} catch {
|
|
2742
|
-
}
|
|
2743
|
-
setTimeout(() => {
|
|
2744
|
-
if (!exited) {
|
|
2745
|
-
try {
|
|
2746
|
-
term.kill("SIGKILL");
|
|
2747
|
-
} catch {
|
|
2748
|
-
}
|
|
2749
|
-
}
|
|
2750
|
-
}, 1500);
|
|
2751
|
-
}, graceMs);
|
|
2752
|
-
}, stuckMs);
|
|
2753
|
-
const clearStartupTimers = () => {
|
|
2754
|
-
clearTimeout(stuckTimer);
|
|
2755
|
-
if (graceTimer) clearTimeout(graceTimer);
|
|
2756
|
-
};
|
|
2757
|
-
let savedClip = null;
|
|
2758
|
-
const waitImagePlaceholder = (n) => new Promise((res) => {
|
|
2759
|
-
const start = Date.now();
|
|
2760
|
-
const iv = setInterval(() => {
|
|
2761
|
-
const count = (rawBuf.match(/\[Image/g) || []).length;
|
|
2762
|
-
if (count >= n || Date.now() - start > 2500 || exited) {
|
|
2763
|
-
clearInterval(iv);
|
|
2764
|
-
res();
|
|
2765
|
-
}
|
|
2766
|
-
}, 100);
|
|
2767
|
-
});
|
|
2768
|
-
async function submitPrompt() {
|
|
2769
|
-
if (promptSent) return;
|
|
2770
|
-
promptSent = true;
|
|
2771
|
-
clearStartupTimers();
|
|
2772
|
-
if (useClipboard) {
|
|
2773
|
-
savedClip = getClipboardText();
|
|
2774
|
-
for (let i = 0; i < tempImageFiles.length && !exited; i++) {
|
|
2775
|
-
if (!setClipboardImage(tempImageFiles[i].path, tempImageFiles[i].isPng)) {
|
|
2776
|
-
log("clipboard set failed, skipping this image");
|
|
2777
|
-
continue;
|
|
2778
|
-
}
|
|
2779
|
-
term.write("");
|
|
2780
|
-
await waitImagePlaceholder(i + 1);
|
|
2781
|
-
}
|
|
2782
|
-
}
|
|
2783
|
-
log("paste prompt + Enter" + (tempImageFiles.length ? ` (${useClipboard ? "clipboard" : "path"} x${tempImageFiles.length} img)` : ""));
|
|
2784
|
-
term.write("\x1B[200~" + effectivePrompt + "\x1B[201~");
|
|
2785
|
-
setTimeout(() => term.write("\r"), 250);
|
|
2786
|
-
if (savedClip != null) setTimeout(() => {
|
|
2787
|
-
if (savedClip != null) setClipboardText(savedClip);
|
|
2788
|
-
}, 800);
|
|
2789
|
-
onSubmit?.();
|
|
2790
|
-
}
|
|
2791
|
-
const poll = setInterval(() => {
|
|
2792
|
-
let txt;
|
|
2793
|
-
try {
|
|
2794
|
-
txt = fs.readFileSync(jsonlPath, "utf8");
|
|
2795
|
-
} catch {
|
|
2796
|
-
return;
|
|
2797
|
-
}
|
|
2798
|
-
const lines = txt.split("\n").filter(Boolean);
|
|
2799
|
-
for (let i = seen; i < lines.length; i++) {
|
|
2800
|
-
let o;
|
|
2801
|
-
try {
|
|
2802
|
-
o = JSON.parse(lines[i]);
|
|
2803
|
-
} catch {
|
|
2804
|
-
continue;
|
|
2805
|
-
}
|
|
2806
|
-
newLines.push(o);
|
|
2807
|
-
lastJsonlTs = Date.now();
|
|
2808
|
-
trackBackgroundLifecycle(o, pendingBg);
|
|
2809
|
-
if (awaitingNewTurn && o.type === "assistant") {
|
|
2810
|
-
awaitingNewTurn = false;
|
|
2811
|
-
onTurnBoundary?.("init");
|
|
2812
|
-
}
|
|
2813
|
-
onJsonlLine?.(o);
|
|
2814
|
-
const blocks = Array.isArray(o.message?.content) ? o.message.content.map((b) => b.type).join(",") : "";
|
|
2815
|
-
if (o.type === "assistant" && blocks.includes("text")) sawAssistantText = true;
|
|
2816
|
-
if (o.type === "assistant" && Array.isArray(o.message?.content)) {
|
|
2817
|
-
askQuestionUses += o.message.content.filter((b) => b.type === "tool_use" && b.name === "AskUserQuestion").length;
|
|
2818
|
-
if (askQuestionUses >= 3 && !completed) {
|
|
2819
|
-
log(`AskUserQuestion x${askQuestionUses} \u2192 break retry loop, end turn`);
|
|
2820
|
-
onQuestionEsc?.();
|
|
2821
|
-
complete("question_loop");
|
|
2822
|
-
}
|
|
2823
|
-
}
|
|
2824
|
-
if (o.type === "system" && o.subtype === "stop_hook_summary" && !completed) {
|
|
2825
|
-
if (pendingBg.size === 0) {
|
|
2826
|
-
complete("stop_hook_summary");
|
|
2827
|
-
} else {
|
|
2828
|
-
log("stop_hook with background task(s) pending \u2192 staying resident", [...pendingBg]);
|
|
2829
|
-
onTurnBoundary?.("result");
|
|
2830
|
-
awaitingNewTurn = true;
|
|
2831
|
-
}
|
|
2832
|
-
}
|
|
2833
|
-
}
|
|
2834
|
-
seen = lines.length;
|
|
2835
|
-
}, 150);
|
|
2836
|
-
const idleCheck = setInterval(() => {
|
|
2837
|
-
if (completed || !promptSent) return;
|
|
2838
|
-
if (sawAssistantText && pendingBg.size === 0 && Date.now() - lastJsonlTs > idleMs && Date.now() - lastDataTs > idleMs) {
|
|
2839
|
-
complete("idle");
|
|
2840
|
-
}
|
|
2841
|
-
}, 300);
|
|
2842
|
-
function complete(via) {
|
|
2843
|
-
if (completed) return;
|
|
2844
|
-
completed = true;
|
|
2845
|
-
completedVia = via;
|
|
2846
|
-
log("complete via", via);
|
|
2847
|
-
onComplete?.(via);
|
|
2848
|
-
setTimeout(sendExit, 200);
|
|
2849
|
-
}
|
|
2850
|
-
function sendExit() {
|
|
2851
|
-
if (exitSent) return;
|
|
2852
|
-
exitSent = true;
|
|
2853
|
-
log("exit: Ctrl+C x2 \u2192 SIGHUP \u2192 SIGKILL");
|
|
2854
|
-
try {
|
|
2855
|
-
term.write("");
|
|
2856
|
-
} catch {
|
|
2857
|
-
}
|
|
2858
|
-
setTimeout(() => {
|
|
2859
|
-
try {
|
|
2860
|
-
term.write("");
|
|
2861
|
-
} catch {
|
|
2862
|
-
}
|
|
2863
|
-
}, 150);
|
|
2864
|
-
setTimeout(() => {
|
|
2865
|
-
if (!exited) {
|
|
2866
|
-
try {
|
|
2867
|
-
term.kill();
|
|
2868
|
-
} catch {
|
|
2869
|
-
}
|
|
2870
|
-
}
|
|
2871
|
-
}, 900);
|
|
2872
|
-
setTimeout(() => {
|
|
2873
|
-
if (!exited) {
|
|
2874
|
-
try {
|
|
2875
|
-
term.kill("SIGKILL");
|
|
2876
|
-
} catch {
|
|
2877
|
-
}
|
|
2878
|
-
}
|
|
2879
|
-
}, 2e3);
|
|
2880
|
-
}
|
|
2881
|
-
const onAbort = () => {
|
|
2882
|
-
log("aborted \u2192 interrupt + guaranteed kill");
|
|
2883
|
-
try {
|
|
2884
|
-
term.write("\x1B");
|
|
2885
|
-
term.write("");
|
|
2886
|
-
} catch {
|
|
2887
|
-
}
|
|
2888
|
-
setTimeout(() => {
|
|
2889
|
-
if (!exited) {
|
|
2890
|
-
try {
|
|
2891
|
-
term.kill();
|
|
2892
|
-
} catch {
|
|
2893
|
-
}
|
|
2894
|
-
}
|
|
2895
|
-
}, 500);
|
|
2896
|
-
setTimeout(() => {
|
|
2897
|
-
if (!exited) {
|
|
2898
|
-
try {
|
|
2899
|
-
term.kill("SIGKILL");
|
|
2900
|
-
} catch {
|
|
2901
|
-
}
|
|
2902
|
-
}
|
|
2903
|
-
}, 1500);
|
|
2904
|
-
};
|
|
2905
|
-
let abortListenerAdded = false;
|
|
2906
|
-
if (signal) {
|
|
2907
|
-
if (signal.aborted) onAbort();
|
|
2908
|
-
else {
|
|
2909
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
2910
|
-
abortListenerAdded = true;
|
|
2911
|
-
}
|
|
2912
|
-
}
|
|
2913
|
-
const timeout = timeoutMs ? setTimeout(() => {
|
|
2914
|
-
if (!exited) {
|
|
2915
|
-
log("TIMEOUT, killing");
|
|
2916
|
-
try {
|
|
2917
|
-
term.kill();
|
|
2918
|
-
} catch {
|
|
2919
|
-
}
|
|
2920
|
-
setTimeout(() => {
|
|
2921
|
-
if (!exited) {
|
|
2922
|
-
try {
|
|
2923
|
-
term.kill("SIGKILL");
|
|
2924
|
-
} catch {
|
|
2925
|
-
}
|
|
2926
|
-
}
|
|
2927
|
-
}, 1500);
|
|
2928
|
-
}
|
|
2929
|
-
}, timeoutMs) : null;
|
|
2930
|
-
term.onExit(({ exitCode }) => {
|
|
2931
|
-
exited = true;
|
|
2932
|
-
clearInterval(poll);
|
|
2933
|
-
clearInterval(readyCheck);
|
|
2934
|
-
clearInterval(idleCheck);
|
|
2935
|
-
clearStartupTimers();
|
|
2936
|
-
if (timeout) clearTimeout(timeout);
|
|
2937
|
-
ptyInputRegistry.delete(sessionId);
|
|
2938
|
-
cleanupImages();
|
|
2939
|
-
if (abortListenerAdded) signal?.removeEventListener("abort", onAbort);
|
|
2940
|
-
log("exit code", exitCode, "completed", completed, "via", completedVia);
|
|
2941
|
-
resolve({ sessionId, jsonlPath, completed, completedVia, exitCode, crashed, crashError, timedOut, newLines });
|
|
2942
|
-
});
|
|
2943
|
-
});
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
// packages/feature/agent/src/server/pty/ptySseMapper.ts
|
|
2947
|
-
function initEvent(sessionId) {
|
|
2948
|
-
return { type: "system", subtype: "init", session_id: sessionId };
|
|
2949
|
-
}
|
|
2950
|
-
function resultEvent(sessionId, opts) {
|
|
2951
|
-
return { type: "result", subtype: "success", session_id: sessionId, usage: opts?.usage };
|
|
2952
|
-
}
|
|
2953
|
-
function mapLineToEvents(line, sessionId) {
|
|
2954
|
-
const out = [];
|
|
2955
|
-
const content = line.message?.content;
|
|
2956
|
-
const origin = line.origin;
|
|
2957
|
-
if (line.type === "user" && origin?.kind === "task-notification") {
|
|
2958
|
-
const raw = typeof content === "string" ? content : Array.isArray(content) ? content.filter((b) => b.type === "text").map((b) => b.text || "").join("") : "";
|
|
2959
|
-
const pick2 = (tag) => raw.match(new RegExp(`<${tag}>([\\s\\S]*?)</${tag}>`))?.[1]?.trim();
|
|
2960
|
-
const ev = { type: "system", subtype: "task_notification", session_id: sessionId };
|
|
2961
|
-
const taskId = pick2("task-id");
|
|
2962
|
-
if (taskId) ev.task_id = taskId;
|
|
2963
|
-
const status = pick2("status");
|
|
2964
|
-
if (status) ev.status = status;
|
|
2965
|
-
const summary = pick2("summary");
|
|
2966
|
-
if (summary) ev.summary = summary;
|
|
2967
|
-
const outputFile = pick2("output-file");
|
|
2968
|
-
if (outputFile) ev.output_file = outputFile;
|
|
2969
|
-
out.push(ev);
|
|
2970
|
-
return out;
|
|
2971
|
-
}
|
|
2972
|
-
if (line.type === "assistant" && Array.isArray(content)) {
|
|
2973
|
-
const blocks = content;
|
|
2974
|
-
const text = blocks.filter((b) => b.type === "text" && b.text).map((b) => b.text).join("");
|
|
2975
|
-
if (text) {
|
|
2976
|
-
out.push({
|
|
2977
|
-
type: "stream_event",
|
|
2978
|
-
session_id: sessionId,
|
|
2979
|
-
event: { type: "content_block_delta", delta: { type: "text_delta", text } }
|
|
2980
|
-
});
|
|
2981
|
-
}
|
|
2982
|
-
const toolUses = blocks.filter((b) => b.type === "tool_use");
|
|
2983
|
-
if (toolUses.length > 0) {
|
|
2984
|
-
out.push({
|
|
2985
|
-
type: "assistant",
|
|
2986
|
-
session_id: sessionId,
|
|
2987
|
-
message: { role: "assistant", content: toolUses }
|
|
2988
|
-
});
|
|
2989
|
-
}
|
|
2990
|
-
return out;
|
|
2991
|
-
}
|
|
2992
|
-
if (line.type === "user" && Array.isArray(content)) {
|
|
2993
|
-
const blocks = content;
|
|
2994
|
-
const toolResults = blocks.filter((b) => b.type === "tool_result" && b.tool_use_id);
|
|
2995
|
-
if (toolResults.length > 0) {
|
|
2996
|
-
out.push({
|
|
2997
|
-
type: "user",
|
|
2998
|
-
session_id: sessionId,
|
|
2999
|
-
message: { role: "user", content: toolResults }
|
|
3000
|
-
});
|
|
3001
|
-
}
|
|
3002
|
-
return out;
|
|
3003
|
-
}
|
|
3004
|
-
return out;
|
|
3005
|
-
}
|
|
3006
|
-
|
|
3007
|
-
// packages/feature/agent/src/server/engines/shared/ptyBranch.ts
|
|
3008
|
-
async function runPtyTurn(ctx) {
|
|
3009
|
-
const sid = ctx.currentKey();
|
|
3010
|
-
const isResume = !!ctx.sessionId;
|
|
3011
|
-
const promptText = ctx.prompt ?? "";
|
|
3012
|
-
ctx.emit(initEvent(sid));
|
|
3013
|
-
ctx.rekey(sid);
|
|
3014
|
-
const turn = await runClaudeTurn({
|
|
3015
|
-
cwd: ctx.cwd || process.cwd(),
|
|
3016
|
-
prompt: promptText,
|
|
3017
|
-
sessionId: sid,
|
|
3018
|
-
resume: isResume,
|
|
3019
|
-
...ctx.images && ctx.images.length > 0 && {
|
|
3020
|
-
images: ctx.images.map((img) => ({ media_type: img.media_type, data: img.data }))
|
|
3021
|
-
},
|
|
3022
|
-
...ctx.params.ptyCols && { cols: ctx.params.ptyCols },
|
|
3023
|
-
...ctx.params.ptyRows && { rows: ctx.params.ptyRows },
|
|
3024
|
-
signal: ctx.signal,
|
|
3025
|
-
onJsonlLine: (line) => {
|
|
3026
|
-
for (const ev of mapLineToEvents(line, sid)) {
|
|
3027
|
-
ctx.emit(ev);
|
|
3028
|
-
}
|
|
3029
|
-
},
|
|
3030
|
-
// Background-task persistence: the driver stays resident across a background task and signals
|
|
3031
|
-
// synthetic turn boundaries. Map them to the SAME init/result events a normal turn emits, so the
|
|
3032
|
-
// follow-up (auto-run) turn renders in its own bubble and the completion notification's event row
|
|
3033
|
-
// shows (the client keys the row off a turn having ended).
|
|
3034
|
-
onTurnBoundary: (kind) => ctx.emit(kind === "init" ? initEvent(sid) : resultEvent(sid)),
|
|
3035
|
-
// floating-window dual-view: raw PTY output forwarded to the frontend xterm.
|
|
3036
|
-
onPtyData: (data) => ctx.emit({ type: "pty_output", data }),
|
|
3037
|
-
// Startup stuck (REPL not ready, likely a dialog) → ask the user to handle it in the terminal.
|
|
3038
|
-
onStuck: () => ctx.emit({ type: "pty_notice", level: "warning", messageKey: "chat.ptyStuck" }),
|
|
3039
|
-
// AskUserQuestion selector auto-cancelled (ESC), turn ended early.
|
|
3040
|
-
onQuestionEsc: () => ctx.emit({ type: "pty_notice", level: "warning", messageKey: "chat.ptyQuestionEsc" })
|
|
3041
|
-
});
|
|
3042
|
-
if (turn.crashed) {
|
|
3043
|
-
ctx.emit({
|
|
3044
|
-
type: "pty_notice",
|
|
3045
|
-
level: "error",
|
|
3046
|
-
terminal: true,
|
|
3047
|
-
messageKey: "chat.ptyCrash",
|
|
3048
|
-
params: { error: turn.crashError }
|
|
3049
|
-
});
|
|
3050
|
-
}
|
|
3051
|
-
if (turn.timedOut) {
|
|
3052
|
-
ctx.emit({ type: "pty_notice", level: "warning", terminal: true, messageKey: "chat.ptyTimedOut" });
|
|
3053
|
-
}
|
|
3054
|
-
ctx.emit(resultEvent(sid));
|
|
3055
|
-
}
|
|
3056
|
-
|
|
3057
2446
|
// packages/feature/agent/src/server/engines/claude.ts
|
|
3058
2447
|
var PLAN_EDIT_TOOLS = /* @__PURE__ */ new Set(["Write", "Edit", "MultiEdit", "NotebookEdit"]);
|
|
3059
2448
|
var isPlanFilePath = (p) => /(^|\/)\.claude\/plans\//.test(p);
|
|
@@ -3066,22 +2455,22 @@ function planPermission(toolName, input, opts) {
|
|
|
3066
2455
|
};
|
|
3067
2456
|
}
|
|
3068
2457
|
if (PLAN_EDIT_TOOLS.has(toolName)) {
|
|
3069
|
-
const
|
|
2458
|
+
const path = [input.file_path, input.notebook_path, input.path, opts?.blockedPath].find(
|
|
3070
2459
|
(v) => typeof v === "string"
|
|
3071
2460
|
);
|
|
3072
|
-
if (
|
|
2461
|
+
if (path && isPlanFilePath(path)) {
|
|
3073
2462
|
return { behavior: "allow", updatedInput: input };
|
|
3074
2463
|
}
|
|
3075
2464
|
return {
|
|
3076
2465
|
behavior: "deny",
|
|
3077
2466
|
// (C) read-only plan mode, no dialog → feedback instead of silent drop
|
|
3078
|
-
message: `Plan mode is read-only and this environment has no approval dialog, so "${toolName}"${
|
|
2467
|
+
message: `Plan mode is read-only and this environment has no approval dialog, so "${toolName}"${path ? ` on ${path}` : ""} can't run. Only writes under .claude/plans/ are allowed. Capture the intended changes in your plan instead of editing files now.`
|
|
3079
2468
|
};
|
|
3080
2469
|
}
|
|
3081
2470
|
return { behavior: "allow", updatedInput: input };
|
|
3082
2471
|
}
|
|
3083
2472
|
function buildClaudeOptions(ctx, independent) {
|
|
3084
|
-
const {
|
|
2473
|
+
const { permissionMode } = ctx.params;
|
|
3085
2474
|
const isPlan = permissionMode === "plan";
|
|
3086
2475
|
return (abort, resume, isRetry) => ({
|
|
3087
2476
|
// Independent task: resume is what makes the CLI load the transcript, so the first
|
|
@@ -3102,27 +2491,21 @@ function buildClaudeOptions(ctx, independent) {
|
|
|
3102
2491
|
},
|
|
3103
2492
|
includePartialMessages: true,
|
|
3104
2493
|
abortController: abort,
|
|
3105
|
-
// env is ALWAYS passed
|
|
3106
|
-
//
|
|
3107
|
-
|
|
3108
|
-
env: sanitizedSpawnEnv(engine === "claude2" ? { CLAUDE_CONFIG_DIR: CLAUDE2_DIR } : {})
|
|
2494
|
+
// env is ALWAYS passed: without it the SDK inherits process.env verbatim,
|
|
2495
|
+
// handing the agent this server's NODE_ENV=production. See sanitizedSpawnEnv.
|
|
2496
|
+
env: sanitizedSpawnEnv({})
|
|
3109
2497
|
});
|
|
3110
2498
|
}
|
|
3111
2499
|
var claudeSpec = {
|
|
3112
2500
|
name: "claude",
|
|
3113
2501
|
runner: {
|
|
3114
2502
|
async run(ctx) {
|
|
3115
|
-
const { mode, engine } = ctx.params;
|
|
3116
|
-
if (mode === "pty" && (!engine || engine === "claude" || engine === "claude2")) {
|
|
3117
|
-
await runPtyTurn(ctx);
|
|
3118
|
-
return;
|
|
3119
|
-
}
|
|
3120
2503
|
const independent = ctx.params.noHistory === true && !!ctx.sessionId;
|
|
3121
2504
|
if (!independent) {
|
|
3122
2505
|
await runSdkLoop(ctx, buildClaudeOptions(ctx, false));
|
|
3123
2506
|
return;
|
|
3124
2507
|
}
|
|
3125
|
-
const sessionPath =
|
|
2508
|
+
const sessionPath = getClaudeSessionPath(ctx.cwd, ctx.sessionId);
|
|
3126
2509
|
const stashed = stashTranscript(sessionPath);
|
|
3127
2510
|
try {
|
|
3128
2511
|
await runSdkLoop(ctx, buildClaudeOptions(ctx, true));
|
|
@@ -3153,7 +2536,7 @@ var glmApiKey = createApiKeyStore(GLM_CREDENTIALS_FILE);
|
|
|
3153
2536
|
|
|
3154
2537
|
// packages/feature/agent/src/server/engines/builtinAgent/index.ts
|
|
3155
2538
|
import { streamText, stepCountIs } from "ai";
|
|
3156
|
-
import { randomUUID as
|
|
2539
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
3157
2540
|
|
|
3158
2541
|
// packages/feature/agent/src/server/engines/builtinAgent/prompt.ts
|
|
3159
2542
|
function buildSystemPrompt(cwd) {
|
|
@@ -3217,18 +2600,18 @@ Accuracy:
|
|
|
3217
2600
|
}
|
|
3218
2601
|
|
|
3219
2602
|
// packages/feature/agent/src/server/engines/builtinAgent/session.ts
|
|
3220
|
-
import { readFileSync as
|
|
3221
|
-
import { join as
|
|
2603
|
+
import { readFileSync as readFileSync2, existsSync, mkdirSync as mkdirSync2, appendFileSync } from "fs";
|
|
2604
|
+
import { join as join2 } from "path";
|
|
3222
2605
|
function getSessionDir(root, cwd) {
|
|
3223
|
-
return
|
|
2606
|
+
return join2(root, encodePath(cwd));
|
|
3224
2607
|
}
|
|
3225
2608
|
function getSessionPath(root, cwd, sessionId) {
|
|
3226
|
-
return
|
|
2609
|
+
return join2(getSessionDir(root, cwd), `${sessionId}.jsonl`);
|
|
3227
2610
|
}
|
|
3228
2611
|
function readSessionMessages(root, cwd, sessionId) {
|
|
3229
|
-
const
|
|
3230
|
-
if (!existsSync(
|
|
3231
|
-
const lines =
|
|
2612
|
+
const path = getSessionPath(root, cwd, sessionId);
|
|
2613
|
+
if (!existsSync(path)) return [];
|
|
2614
|
+
const lines = readFileSync2(path, "utf-8").split("\n").filter(Boolean);
|
|
3232
2615
|
const transcriptEntries = [];
|
|
3233
2616
|
for (const line of lines) {
|
|
3234
2617
|
try {
|
|
@@ -3328,8 +2711,8 @@ function readSessionMessages(root, cwd, sessionId) {
|
|
|
3328
2711
|
function appendSessionLine(root, cwd, sessionId, line) {
|
|
3329
2712
|
const dir = getSessionDir(root, cwd);
|
|
3330
2713
|
mkdirSync2(dir, { recursive: true });
|
|
3331
|
-
const
|
|
3332
|
-
appendFileSync(
|
|
2714
|
+
const path = getSessionPath(root, cwd, sessionId);
|
|
2715
|
+
appendFileSync(path, JSON.stringify(line) + "\n", "utf-8");
|
|
3333
2716
|
}
|
|
3334
2717
|
function appendUserText(root, cwd, sessionId, text, opts) {
|
|
3335
2718
|
appendSessionLine(root, cwd, sessionId, {
|
|
@@ -4138,10 +3521,10 @@ function mergeDefs(...defs) {
|
|
|
4138
3521
|
function cloneDef(schema) {
|
|
4139
3522
|
return mergeDefs(schema._zod.def);
|
|
4140
3523
|
}
|
|
4141
|
-
function getElementAtPath(obj,
|
|
4142
|
-
if (!
|
|
3524
|
+
function getElementAtPath(obj, path) {
|
|
3525
|
+
if (!path)
|
|
4143
3526
|
return obj;
|
|
4144
|
-
return
|
|
3527
|
+
return path.reduce((acc, key) => acc?.[key], obj);
|
|
4145
3528
|
}
|
|
4146
3529
|
function promiseAllObject(promisesObj) {
|
|
4147
3530
|
const keys = Object.keys(promisesObj);
|
|
@@ -4524,11 +3907,11 @@ function aborted(x, startIndex = 0) {
|
|
|
4524
3907
|
}
|
|
4525
3908
|
return false;
|
|
4526
3909
|
}
|
|
4527
|
-
function prefixIssues(
|
|
3910
|
+
function prefixIssues(path, issues) {
|
|
4528
3911
|
return issues.map((iss) => {
|
|
4529
3912
|
var _a2;
|
|
4530
3913
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
4531
|
-
iss.path.unshift(
|
|
3914
|
+
iss.path.unshift(path);
|
|
4532
3915
|
return iss;
|
|
4533
3916
|
});
|
|
4534
3917
|
}
|
|
@@ -4711,7 +4094,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
|
|
|
4711
4094
|
}
|
|
4712
4095
|
function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
4713
4096
|
const result = { errors: [] };
|
|
4714
|
-
const processError = (error49,
|
|
4097
|
+
const processError = (error49, path = []) => {
|
|
4715
4098
|
var _a2, _b;
|
|
4716
4099
|
for (const issue2 of error49.issues) {
|
|
4717
4100
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -4721,7 +4104,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
4721
4104
|
} else if (issue2.code === "invalid_element") {
|
|
4722
4105
|
processError({ issues: issue2.issues }, issue2.path);
|
|
4723
4106
|
} else {
|
|
4724
|
-
const fullpath = [...
|
|
4107
|
+
const fullpath = [...path, ...issue2.path];
|
|
4725
4108
|
if (fullpath.length === 0) {
|
|
4726
4109
|
result.errors.push(mapper(issue2));
|
|
4727
4110
|
continue;
|
|
@@ -4753,8 +4136,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
4753
4136
|
}
|
|
4754
4137
|
function toDotPath(_path) {
|
|
4755
4138
|
const segs = [];
|
|
4756
|
-
const
|
|
4757
|
-
for (const seg of
|
|
4139
|
+
const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
4140
|
+
for (const seg of path) {
|
|
4758
4141
|
if (typeof seg === "number")
|
|
4759
4142
|
segs.push(`[${seg}]`);
|
|
4760
4143
|
else if (typeof seg === "symbol")
|
|
@@ -16731,13 +16114,13 @@ function resolveRef(ref, ctx) {
|
|
|
16731
16114
|
if (!ref.startsWith("#")) {
|
|
16732
16115
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
16733
16116
|
}
|
|
16734
|
-
const
|
|
16735
|
-
if (
|
|
16117
|
+
const path = ref.slice(1).split("/").filter(Boolean);
|
|
16118
|
+
if (path.length === 0) {
|
|
16736
16119
|
return ctx.rootSchema;
|
|
16737
16120
|
}
|
|
16738
16121
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
16739
|
-
if (
|
|
16740
|
-
const key =
|
|
16122
|
+
if (path[0] === defsKey) {
|
|
16123
|
+
const key = path[1];
|
|
16741
16124
|
if (!key || !ctx.defs[key]) {
|
|
16742
16125
|
throw new Error(`Reference not found: ${ref}`);
|
|
16743
16126
|
}
|
|
@@ -17140,17 +16523,17 @@ function date4(params) {
|
|
|
17140
16523
|
config(en_default());
|
|
17141
16524
|
|
|
17142
16525
|
// packages/feature/agent/src/server/engines/builtinAgent/tools.ts
|
|
17143
|
-
import { readFileSync as
|
|
16526
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
17144
16527
|
import { writeFile, mkdir, readdir, stat, unlink } from "fs/promises";
|
|
17145
|
-
import { isAbsolute, join as
|
|
17146
|
-
import { tmpdir
|
|
16528
|
+
import { isAbsolute, join as join3 } from "path";
|
|
16529
|
+
import { tmpdir } from "os";
|
|
17147
16530
|
import { exec, execFile } from "child_process";
|
|
17148
16531
|
import { promisify } from "util";
|
|
17149
16532
|
import fg from "fast-glob";
|
|
17150
16533
|
import { rgPath as RG_PATH } from "@vscode/ripgrep";
|
|
17151
16534
|
var execAsync = promisify(exec);
|
|
17152
16535
|
var execFileAsync = promisify(execFile);
|
|
17153
|
-
var SPILL_DIR =
|
|
16536
|
+
var SPILL_DIR = join3(tmpdir(), "cockpit-tool-outputs");
|
|
17154
16537
|
var SPILL_MAX_FILES = 200;
|
|
17155
16538
|
async function spillToFile(text, kind) {
|
|
17156
16539
|
try {
|
|
@@ -17160,7 +16543,7 @@ async function spillToFile(text, kind) {
|
|
|
17160
16543
|
if (entries.length >= SPILL_MAX_FILES) {
|
|
17161
16544
|
const statted = await Promise.all(
|
|
17162
16545
|
entries.map(async (name) => {
|
|
17163
|
-
const p =
|
|
16546
|
+
const p = join3(SPILL_DIR, name);
|
|
17164
16547
|
try {
|
|
17165
16548
|
return { p, mtime: (await stat(p)).mtimeMs };
|
|
17166
16549
|
} catch {
|
|
@@ -17177,7 +16560,7 @@ async function spillToFile(text, kind) {
|
|
|
17177
16560
|
}
|
|
17178
16561
|
const stamp = Date.now().toString(36);
|
|
17179
16562
|
const rand = Math.random().toString(36).slice(2, 8);
|
|
17180
|
-
const file2 =
|
|
16563
|
+
const file2 = join3(SPILL_DIR, `${kind}-${stamp}-${rand}.log`);
|
|
17181
16564
|
await writeFile(file2, text, "utf-8");
|
|
17182
16565
|
return file2;
|
|
17183
16566
|
} catch {
|
|
@@ -17236,7 +16619,7 @@ function createTools(context) {
|
|
|
17236
16619
|
execute: async ({ file_path, offset, limit }) => {
|
|
17237
16620
|
try {
|
|
17238
16621
|
if (!isAbsolute(file_path)) return "Error: file_path must be an absolute path.";
|
|
17239
|
-
const content =
|
|
16622
|
+
const content = readFileSync3(file_path, "utf-8");
|
|
17240
16623
|
const lines = content.split("\n");
|
|
17241
16624
|
const total = lines.length;
|
|
17242
16625
|
const start = Math.max(0, offset - 1);
|
|
@@ -17262,7 +16645,7 @@ function createTools(context) {
|
|
|
17262
16645
|
execute: async ({ file_path, content }) => {
|
|
17263
16646
|
try {
|
|
17264
16647
|
if (!isAbsolute(file_path)) return "Error: file_path must be an absolute path.";
|
|
17265
|
-
|
|
16648
|
+
writeFileSync2(file_path, content, "utf-8");
|
|
17266
16649
|
return `File written: ${file_path}`;
|
|
17267
16650
|
} catch (err) {
|
|
17268
16651
|
return `Error writing file: ${err.message}`;
|
|
@@ -17288,12 +16671,12 @@ function createTools(context) {
|
|
|
17288
16671
|
}) => {
|
|
17289
16672
|
try {
|
|
17290
16673
|
if (!isAbsolute(file_path)) return "Error: file_path must be an absolute path.";
|
|
17291
|
-
const content =
|
|
16674
|
+
const content = readFileSync3(file_path, "utf-8");
|
|
17292
16675
|
if (!content.includes(old_string)) {
|
|
17293
16676
|
return `Error: old_string not found in ${file_path}. The file may have changed.`;
|
|
17294
16677
|
}
|
|
17295
16678
|
const updated = replace_all ? content.split(old_string).join(new_string) : content.replace(old_string, new_string);
|
|
17296
|
-
|
|
16679
|
+
writeFileSync2(file_path, updated, "utf-8");
|
|
17297
16680
|
return `File edited: ${file_path}`;
|
|
17298
16681
|
} catch (err) {
|
|
17299
16682
|
return `Error editing file: ${err.message}`;
|
|
@@ -17384,14 +16767,14 @@ ${stderrCapped}`;
|
|
|
17384
16767
|
),
|
|
17385
16768
|
execute: async ({
|
|
17386
16769
|
pattern,
|
|
17387
|
-
path
|
|
16770
|
+
path,
|
|
17388
16771
|
ignore_case,
|
|
17389
16772
|
output_mode,
|
|
17390
16773
|
"-n": showLineNumbers
|
|
17391
16774
|
}) => {
|
|
17392
16775
|
try {
|
|
17393
|
-
if (
|
|
17394
|
-
const target =
|
|
16776
|
+
if (path && !isAbsolute(path)) return "Error: path must be an absolute path.";
|
|
16777
|
+
const target = path || context.cwd;
|
|
17395
16778
|
const args = [
|
|
17396
16779
|
"--no-heading",
|
|
17397
16780
|
"--color",
|
|
@@ -17612,7 +16995,7 @@ async function runBuiltinAgent(ctx, config2) {
|
|
|
17612
16995
|
const noHistory = ctx.params.noHistory === true;
|
|
17613
16996
|
const existing = noHistory ? [] : readSessionMessages(sessionsRoot, cwd, sid);
|
|
17614
16997
|
const messages = [...existing, { role: "user", content: prompt }];
|
|
17615
|
-
appendUserText(sessionsRoot, cwd, sid, prompt, { uuid:
|
|
16998
|
+
appendUserText(sessionsRoot, cwd, sid, prompt, { uuid: randomUUID2(), timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
17616
16999
|
emit(`data: ${JSON.stringify({ type: "system", subtype: "init", session_id: sid })}
|
|
17617
17000
|
|
|
17618
17001
|
`);
|
|
@@ -17642,7 +17025,7 @@ async function runBuiltinAgent(ctx, config2) {
|
|
|
17642
17025
|
for (const [toolUseId] of pendingToolCalls) {
|
|
17643
17026
|
try {
|
|
17644
17027
|
appendToolResult(sessionsRoot, cwd, sid, toolUseId, reason, {
|
|
17645
|
-
uuid:
|
|
17028
|
+
uuid: randomUUID2(),
|
|
17646
17029
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
17647
17030
|
is_error: true
|
|
17648
17031
|
});
|
|
@@ -17676,7 +17059,7 @@ async function runBuiltinAgent(ctx, config2) {
|
|
|
17676
17059
|
cwd,
|
|
17677
17060
|
sid,
|
|
17678
17061
|
[{ type: "tool_use", id: toolUseId, name: toolName, input }],
|
|
17679
|
-
{ uuid:
|
|
17062
|
+
{ uuid: randomUUID2(), timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
17680
17063
|
);
|
|
17681
17064
|
} catch {
|
|
17682
17065
|
}
|
|
@@ -17685,7 +17068,7 @@ async function runBuiltinAgent(ctx, config2) {
|
|
|
17685
17068
|
try {
|
|
17686
17069
|
pendingToolCalls.delete(toolUseId);
|
|
17687
17070
|
appendToolResult(sessionsRoot, cwd, sid, toolUseId, content, {
|
|
17688
|
-
uuid:
|
|
17071
|
+
uuid: randomUUID2(),
|
|
17689
17072
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
17690
17073
|
is_error: Boolean(isError)
|
|
17691
17074
|
});
|
|
@@ -17695,7 +17078,7 @@ async function runBuiltinAgent(ctx, config2) {
|
|
|
17695
17078
|
onTextFlush: (flushedText) => {
|
|
17696
17079
|
try {
|
|
17697
17080
|
appendAssistantMessage(sessionsRoot, cwd, sid, [{ type: "text", text: flushedText }], {
|
|
17698
|
-
uuid:
|
|
17081
|
+
uuid: randomUUID2(),
|
|
17699
17082
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
17700
17083
|
});
|
|
17701
17084
|
} catch {
|
|
@@ -17707,7 +17090,7 @@ async function runBuiltinAgent(ctx, config2) {
|
|
|
17707
17090
|
emitResultMessage(usage.inputTokens || 0, usage.outputTokens || 0, emit);
|
|
17708
17091
|
if (!ctx.signal.aborted) {
|
|
17709
17092
|
appendAssistantMessage(sessionsRoot, cwd, sid, text ? [{ type: "text", text }] : [], {
|
|
17710
|
-
uuid:
|
|
17093
|
+
uuid: randomUUID2(),
|
|
17711
17094
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
17712
17095
|
usage: {
|
|
17713
17096
|
input_tokens: usage.inputTokens || 0,
|
|
@@ -17729,7 +17112,7 @@ async function runBuiltinAgent(ctx, config2) {
|
|
|
17729
17112
|
cwd,
|
|
17730
17113
|
sid,
|
|
17731
17114
|
[{ type: "text", text: `\u26A0\uFE0F ${formatProviderError(error48)}` }],
|
|
17732
|
-
{ uuid:
|
|
17115
|
+
{ uuid: randomUUID2(), timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
17733
17116
|
);
|
|
17734
17117
|
} catch {
|
|
17735
17118
|
}
|
|
@@ -17989,12 +17372,104 @@ var glmProvider = {
|
|
|
17989
17372
|
var glmSpec = makeAnthropicCompatSpec(glmProvider);
|
|
17990
17373
|
|
|
17991
17374
|
// packages/feature/agent/src/server/engines/codex.ts
|
|
17992
|
-
import {
|
|
17993
|
-
import {
|
|
17994
|
-
import {
|
|
17995
|
-
import {
|
|
17996
|
-
import {
|
|
17997
|
-
|
|
17375
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
17376
|
+
import { writeFileSync as writeFileSync3, unlinkSync, mkdirSync as mkdirSync3, existsSync as existsSync2, statSync, openSync, readSync, closeSync } from "fs";
|
|
17377
|
+
import { StringDecoder } from "string_decoder";
|
|
17378
|
+
import { join as join4 } from "path";
|
|
17379
|
+
import { tmpdir as tmpdir2 } from "os";
|
|
17380
|
+
|
|
17381
|
+
// packages/feature/agent/src/server/api/session/codexTools.ts
|
|
17382
|
+
var CODEX_IMAGE_ONLY_TEXT = "[Image]";
|
|
17383
|
+
var CODEX_TOOL_NAMES = {
|
|
17384
|
+
bash: "Bash",
|
|
17385
|
+
applyPatch: "ApplyPatch",
|
|
17386
|
+
/** `spawn_agent` → claude's Task, so one bubble == one sub-agent. */
|
|
17387
|
+
task: "Task",
|
|
17388
|
+
/** `update_plan` / live `todo_list` → the checklist MessageBubble already renders. */
|
|
17389
|
+
todo: "TodoWrite",
|
|
17390
|
+
webSearch: "WebSearch",
|
|
17391
|
+
webFetch: "WebFetch"
|
|
17392
|
+
};
|
|
17393
|
+
var CODEX_MCP_NAMESPACE_PREFIX = "mcp__";
|
|
17394
|
+
var codexMcpToolName = (server, tool2) => `${CODEX_MCP_NAMESPACE_PREFIX}${server}__${tool2}`;
|
|
17395
|
+
var CODEX_SPAWN_FN_NAME = "spawn_agent";
|
|
17396
|
+
function codexTodoInput(items) {
|
|
17397
|
+
return {
|
|
17398
|
+
todos: (items ?? []).flatMap(
|
|
17399
|
+
(i) => typeof i?.text === "string" ? [{ content: i.text, status: i.completed ? "completed" : "pending" }] : []
|
|
17400
|
+
)
|
|
17401
|
+
};
|
|
17402
|
+
}
|
|
17403
|
+
function codexTodoResultText(todos) {
|
|
17404
|
+
const done = todos.filter((t) => t.status === "completed").length;
|
|
17405
|
+
return `${done}/${todos.length} completed`;
|
|
17406
|
+
}
|
|
17407
|
+
function codexWebSearchCall(query2, action) {
|
|
17408
|
+
if (action?.type === "open_page" && action.url) {
|
|
17409
|
+
return { name: CODEX_TOOL_NAMES.webFetch, input: { url: action.url }, result: action.url };
|
|
17410
|
+
}
|
|
17411
|
+
const q = action?.query || query2 || "";
|
|
17412
|
+
const queries = action?.queries?.length ? action.queries : q ? [q] : [];
|
|
17413
|
+
return {
|
|
17414
|
+
name: CODEX_TOOL_NAMES.webSearch,
|
|
17415
|
+
input: { query: q },
|
|
17416
|
+
// codex reports the queries it ran but never the hits; showing the queries beats
|
|
17417
|
+
// an empty result, which would leave the bubble looking unfinished.
|
|
17418
|
+
result: queries.join("\n")
|
|
17419
|
+
};
|
|
17420
|
+
}
|
|
17421
|
+
function codexMcpResultText(item) {
|
|
17422
|
+
if (item.error?.message) return item.error.message;
|
|
17423
|
+
if (item.result === null || item.result === void 0) return "";
|
|
17424
|
+
return typeof item.result === "string" ? item.result : JSON.stringify(item.result, null, 2);
|
|
17425
|
+
}
|
|
17426
|
+
var CODEX_AGENT_DONE = /* @__PURE__ */ new Set(["completed", "errored", "interrupted", "not_found", "failed"]);
|
|
17427
|
+
function parseCodexSpawnInput(args, extra) {
|
|
17428
|
+
const prompt = typeof args.message === "string" ? args.message : "";
|
|
17429
|
+
const agentType = typeof args.agent_type === "string" ? args.agent_type : void 0;
|
|
17430
|
+
return {
|
|
17431
|
+
...agentType ? { subagent_type: agentType } : {},
|
|
17432
|
+
description: codexSpawnDescription(extra?.nickname, agentType, prompt),
|
|
17433
|
+
prompt,
|
|
17434
|
+
...extra?.agentId ? { agent_id: extra.agentId } : {}
|
|
17435
|
+
};
|
|
17436
|
+
}
|
|
17437
|
+
function codexSpawnDescription(nickname, agentType, prompt) {
|
|
17438
|
+
if (nickname) return agentType ? `${nickname} (${agentType})` : nickname;
|
|
17439
|
+
const firstLine = prompt.split("\n", 1)[0]?.trim() || "";
|
|
17440
|
+
if (firstLine) return firstLine.slice(0, 80);
|
|
17441
|
+
return agentType || "subagent";
|
|
17442
|
+
}
|
|
17443
|
+
function parseCodexSpawnOutput(output) {
|
|
17444
|
+
try {
|
|
17445
|
+
const parsed = JSON.parse(output);
|
|
17446
|
+
if (typeof parsed?.agent_id !== "string" || !parsed.agent_id) return null;
|
|
17447
|
+
return {
|
|
17448
|
+
agentId: parsed.agent_id,
|
|
17449
|
+
...typeof parsed.nickname === "string" ? { nickname: parsed.nickname } : {}
|
|
17450
|
+
};
|
|
17451
|
+
} catch {
|
|
17452
|
+
return null;
|
|
17453
|
+
}
|
|
17454
|
+
}
|
|
17455
|
+
function parseCodexAgentsStates(states) {
|
|
17456
|
+
if (!states || typeof states !== "object") return [];
|
|
17457
|
+
return Object.entries(states).flatMap(([agentId, raw]) => {
|
|
17458
|
+
const status = typeof raw?.status === "string" ? raw.status : "";
|
|
17459
|
+
if (!status) return [];
|
|
17460
|
+
return [{
|
|
17461
|
+
agentId,
|
|
17462
|
+
status,
|
|
17463
|
+
message: typeof raw?.message === "string" ? raw.message : "",
|
|
17464
|
+
done: CODEX_AGENT_DONE.has(status)
|
|
17465
|
+
}];
|
|
17466
|
+
});
|
|
17467
|
+
}
|
|
17468
|
+
function codexAgentResultText(state) {
|
|
17469
|
+
return state.message || `(agent ${state.status})`;
|
|
17470
|
+
}
|
|
17471
|
+
|
|
17472
|
+
// packages/feature/agent/src/server/engines/codex.ts
|
|
17998
17473
|
var MEDIA_EXT = {
|
|
17999
17474
|
"image/png": ".png",
|
|
18000
17475
|
"image/jpeg": ".jpg",
|
|
@@ -18002,170 +17477,532 @@ var MEDIA_EXT = {
|
|
|
18002
17477
|
"image/gif": ".gif"
|
|
18003
17478
|
};
|
|
18004
17479
|
function writeImagesToTemp(images) {
|
|
18005
|
-
const dir =
|
|
17480
|
+
const dir = join4(tmpdir2(), "cockpit-codex-images");
|
|
18006
17481
|
if (!existsSync2(dir)) mkdirSync3(dir, { recursive: true });
|
|
18007
17482
|
return images.map((img, i) => {
|
|
18008
17483
|
const ext = MEDIA_EXT[img.media_type] || ".png";
|
|
18009
|
-
const filePath =
|
|
18010
|
-
|
|
17484
|
+
const filePath = join4(dir, `img-${Date.now()}-${i}${ext}`);
|
|
17485
|
+
writeFileSync3(filePath, Buffer.from(img.data, "base64"));
|
|
18011
17486
|
return filePath;
|
|
18012
17487
|
});
|
|
18013
17488
|
}
|
|
18014
|
-
|
|
18015
|
-
|
|
18016
|
-
|
|
18017
|
-
|
|
18018
|
-
|
|
18019
|
-
|
|
18020
|
-
|
|
18021
|
-
|
|
18022
|
-
|
|
18023
|
-
|
|
18024
|
-
|
|
18025
|
-
|
|
18026
|
-
|
|
18027
|
-
|
|
18028
|
-
|
|
18029
|
-
|
|
18030
|
-
|
|
18031
|
-
|
|
18032
|
-
|
|
18033
|
-
|
|
18034
|
-
|
|
18035
|
-
|
|
18036
|
-
|
|
18037
|
-
|
|
18038
|
-
|
|
18039
|
-
|
|
18040
|
-
|
|
18041
|
-
|
|
18042
|
-
|
|
18043
|
-
|
|
18044
|
-
|
|
18045
|
-
|
|
18046
|
-
|
|
17489
|
+
function codexToolUseId(item) {
|
|
17490
|
+
return item.call_id || item.id || `tool-${randomUUID3()}`;
|
|
17491
|
+
}
|
|
17492
|
+
var CODEX_EXEC_FN_NAMES = /* @__PURE__ */ new Set(["exec_command", "shell_command", "local_shell"]);
|
|
17493
|
+
function parsePatchFiles(input) {
|
|
17494
|
+
const files = [];
|
|
17495
|
+
const re = /^\*\*\* (?:Add|Update|Delete) File: (.+)$/gm;
|
|
17496
|
+
let m;
|
|
17497
|
+
while (m = re.exec(input)) files.push(m[1].trim());
|
|
17498
|
+
return files;
|
|
17499
|
+
}
|
|
17500
|
+
function parseCallLines(text, exec2, patch, spawns, mcps) {
|
|
17501
|
+
for (const line of text.split("\n")) {
|
|
17502
|
+
if (!line.trim()) continue;
|
|
17503
|
+
let entry;
|
|
17504
|
+
try {
|
|
17505
|
+
entry = JSON.parse(line);
|
|
17506
|
+
} catch {
|
|
17507
|
+
continue;
|
|
17508
|
+
}
|
|
17509
|
+
const p = entry.payload;
|
|
17510
|
+
if (!p) continue;
|
|
17511
|
+
if (p.type === "function_call" && p.name && CODEX_EXEC_FN_NAMES.has(p.name)) {
|
|
17512
|
+
let cmd = "";
|
|
17513
|
+
try {
|
|
17514
|
+
cmd = String(JSON.parse(p.arguments || "{}").cmd || "");
|
|
17515
|
+
} catch {
|
|
17516
|
+
}
|
|
17517
|
+
exec2.push({ callId: p.call_id, cmd });
|
|
17518
|
+
} else if (p.type === "custom_tool_call" && p.name === "apply_patch") {
|
|
17519
|
+
patch.push({ callId: p.call_id, files: parsePatchFiles(p.input || "") });
|
|
17520
|
+
} else if (p.type === "function_call" && p.name && p.namespace?.startsWith(CODEX_MCP_NAMESPACE_PREFIX)) {
|
|
17521
|
+
mcps.push({
|
|
17522
|
+
callId: p.call_id,
|
|
17523
|
+
server: p.namespace.slice(CODEX_MCP_NAMESPACE_PREFIX.length),
|
|
17524
|
+
tool: p.name
|
|
17525
|
+
});
|
|
17526
|
+
} else if (p.type === "function_call" && p.name === CODEX_SPAWN_FN_NAME) {
|
|
17527
|
+
let args = {};
|
|
17528
|
+
try {
|
|
17529
|
+
args = JSON.parse(p.arguments || "{}");
|
|
17530
|
+
} catch {
|
|
17531
|
+
}
|
|
17532
|
+
spawns.push({ callId: p.call_id, args });
|
|
17533
|
+
} else if (p.type === "function_call_output" && p.call_id) {
|
|
17534
|
+
const target = spawns.find((s) => s.callId === p.call_id && !s.agentId);
|
|
17535
|
+
if (target) {
|
|
17536
|
+
const parsed = parseCodexSpawnOutput(p.output || "");
|
|
17537
|
+
if (parsed) {
|
|
17538
|
+
target.agentId = parsed.agentId;
|
|
17539
|
+
target.nickname = parsed.nickname;
|
|
18047
17540
|
}
|
|
18048
|
-
|
|
18049
|
-
|
|
18050
|
-
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
|
|
18054
|
-
|
|
18055
|
-
|
|
18056
|
-
|
|
18057
|
-
|
|
18058
|
-
|
|
18059
|
-
|
|
18060
|
-
|
|
18061
|
-
|
|
18062
|
-
|
|
18063
|
-
|
|
18064
|
-
|
|
18065
|
-
|
|
18066
|
-
|
|
18067
|
-
|
|
18068
|
-
|
|
18069
|
-
|
|
18070
|
-
|
|
18071
|
-
|
|
18072
|
-
|
|
18073
|
-
|
|
18074
|
-
|
|
18075
|
-
|
|
18076
|
-
|
|
18077
|
-
|
|
18078
|
-
|
|
18079
|
-
|
|
18080
|
-
|
|
18081
|
-
|
|
18082
|
-
|
|
18083
|
-
|
|
17541
|
+
}
|
|
17542
|
+
}
|
|
17543
|
+
}
|
|
17544
|
+
}
|
|
17545
|
+
function createRolloutCallReader() {
|
|
17546
|
+
let boundPath = null;
|
|
17547
|
+
let offset = 0;
|
|
17548
|
+
let carry = "";
|
|
17549
|
+
let decoder = new StringDecoder("utf8");
|
|
17550
|
+
const exec2 = [];
|
|
17551
|
+
const patch = [];
|
|
17552
|
+
const spawns = [];
|
|
17553
|
+
const mcps = [];
|
|
17554
|
+
const reset = (p) => {
|
|
17555
|
+
boundPath = p;
|
|
17556
|
+
offset = 0;
|
|
17557
|
+
carry = "";
|
|
17558
|
+
decoder = new StringDecoder("utf8");
|
|
17559
|
+
exec2.length = 0;
|
|
17560
|
+
patch.length = 0;
|
|
17561
|
+
spawns.length = 0;
|
|
17562
|
+
mcps.length = 0;
|
|
17563
|
+
};
|
|
17564
|
+
return (rolloutPath) => {
|
|
17565
|
+
if (rolloutPath !== boundPath) reset(rolloutPath);
|
|
17566
|
+
let size = 0;
|
|
17567
|
+
try {
|
|
17568
|
+
size = statSync(rolloutPath).size;
|
|
17569
|
+
} catch {
|
|
17570
|
+
return { exec: exec2, patch, spawn: spawns, mcp: mcps };
|
|
17571
|
+
}
|
|
17572
|
+
if (size < offset) reset(rolloutPath);
|
|
17573
|
+
if (size === offset) return { exec: exec2, patch, spawn: spawns, mcp: mcps };
|
|
17574
|
+
let chunk = "";
|
|
17575
|
+
try {
|
|
17576
|
+
const fd = openSync(rolloutPath, "r");
|
|
17577
|
+
try {
|
|
17578
|
+
const len = size - offset;
|
|
17579
|
+
const buf = Buffer.allocUnsafe(len);
|
|
17580
|
+
const n = readSync(fd, buf, 0, len, offset);
|
|
17581
|
+
chunk = decoder.write(buf.subarray(0, n));
|
|
17582
|
+
offset += n;
|
|
17583
|
+
} finally {
|
|
17584
|
+
closeSync(fd);
|
|
17585
|
+
}
|
|
17586
|
+
} catch {
|
|
17587
|
+
return { exec: exec2, patch, spawn: spawns, mcp: mcps };
|
|
17588
|
+
}
|
|
17589
|
+
const data = carry + chunk;
|
|
17590
|
+
const lastNl = data.lastIndexOf("\n");
|
|
17591
|
+
if (lastNl === -1) {
|
|
17592
|
+
carry = data;
|
|
17593
|
+
return { exec: exec2, patch, spawn: spawns, mcp: mcps };
|
|
17594
|
+
}
|
|
17595
|
+
carry = data.slice(lastNl + 1);
|
|
17596
|
+
parseCallLines(data.slice(0, lastNl), exec2, patch, spawns, mcps);
|
|
17597
|
+
return { exec: exec2, patch, spawn: spawns, mcp: mcps };
|
|
17598
|
+
};
|
|
17599
|
+
}
|
|
17600
|
+
var basename = (p) => p.replace(/[/\\]+$/, "").split(/[/\\]/).pop() || p;
|
|
17601
|
+
function unwrapShellCommand(command) {
|
|
17602
|
+
const m = command.match(/^\/bin\/\S+ -lc (['"])([\s\S]*)\1\s*$/);
|
|
17603
|
+
return m ? m[2] : command;
|
|
17604
|
+
}
|
|
17605
|
+
function normalizeCmd(s) {
|
|
17606
|
+
return s.replace(/\s+/g, " ").trim();
|
|
17607
|
+
}
|
|
17608
|
+
var SHELL_WRAPPER_SLACK = 32;
|
|
17609
|
+
function resolveCodexCallId(execCalls, index, liveCommand) {
|
|
17610
|
+
const target = execCalls[index];
|
|
17611
|
+
if (!target?.callId) return null;
|
|
17612
|
+
const persisted = normalizeCmd(target.cmd);
|
|
17613
|
+
const live = normalizeCmd(unwrapShellCommand(liveCommand || ""));
|
|
17614
|
+
const liveRaw = normalizeCmd(liveCommand || "");
|
|
17615
|
+
if (!live || live === persisted || persisted.startsWith(live) || live.startsWith(persisted) || !!persisted && liveRaw.includes(persisted) && liveRaw.length - persisted.length <= SHELL_WRAPPER_SLACK) {
|
|
17616
|
+
return target.callId;
|
|
17617
|
+
}
|
|
17618
|
+
return null;
|
|
17619
|
+
}
|
|
17620
|
+
function resolveCodexPatchCallId(patchCalls, index, changePaths) {
|
|
17621
|
+
const target = patchCalls[index];
|
|
17622
|
+
if (!target?.callId) return null;
|
|
17623
|
+
if (target.files.length === 0 || changePaths.length === 0) return target.callId;
|
|
17624
|
+
const wanted = new Set(target.files.map(basename));
|
|
17625
|
+
if (changePaths.some((p) => wanted.has(basename(p)))) return target.callId;
|
|
17626
|
+
return null;
|
|
17627
|
+
}
|
|
17628
|
+
function resolveCodexSpawnCall(spawnCalls, index, agentId) {
|
|
17629
|
+
if (agentId) {
|
|
17630
|
+
const exact = spawnCalls.find((s) => s.agentId === agentId);
|
|
17631
|
+
if (exact?.callId) return exact;
|
|
17632
|
+
}
|
|
17633
|
+
const byOrder = spawnCalls[index];
|
|
17634
|
+
return byOrder?.callId ? byOrder : null;
|
|
17635
|
+
}
|
|
17636
|
+
function resolveCodexMcpCallId(mcpCalls, index, server, tool2) {
|
|
17637
|
+
const target = mcpCalls[index];
|
|
17638
|
+
if (!target?.callId) return null;
|
|
17639
|
+
if (server && tool2 && (target.server !== server || target.tool !== tool2)) return null;
|
|
17640
|
+
return target.callId;
|
|
17641
|
+
}
|
|
17642
|
+
function createCodexEventAdapter(ctx) {
|
|
17643
|
+
const { sessionId } = ctx;
|
|
17644
|
+
let terminated = false;
|
|
17645
|
+
let failure = null;
|
|
17646
|
+
const pendingToolCalls = /* @__PURE__ */ new Map();
|
|
17647
|
+
let rolloutPath = null;
|
|
17648
|
+
let execBase = 0;
|
|
17649
|
+
let patchBase = 0;
|
|
17650
|
+
let execSeen = 0;
|
|
17651
|
+
let patchSeen = 0;
|
|
17652
|
+
let spawnBase = 0;
|
|
17653
|
+
let spawnSeen = 0;
|
|
17654
|
+
let mcpBase = 0;
|
|
17655
|
+
let mcpSeen = 0;
|
|
17656
|
+
const agentToolUseIds = /* @__PURE__ */ new Map();
|
|
17657
|
+
let codexThreadId = sessionId || null;
|
|
17658
|
+
let rolloutLookups = 0;
|
|
17659
|
+
const MAX_ROLLOUT_LOOKUPS = 8;
|
|
17660
|
+
const resolvedToolUseIds = /* @__PURE__ */ new Map();
|
|
17661
|
+
const readRollout = createRolloutCallReader();
|
|
17662
|
+
if (sessionId) {
|
|
17663
|
+
try {
|
|
17664
|
+
rolloutPath = findCodexSessionPath(sessionId);
|
|
17665
|
+
if (rolloutPath) {
|
|
17666
|
+
const c = readRollout(rolloutPath);
|
|
17667
|
+
execBase = c.exec.length;
|
|
17668
|
+
patchBase = c.patch.length;
|
|
17669
|
+
spawnBase = c.spawn.length;
|
|
17670
|
+
mcpBase = c.mcp.length;
|
|
17671
|
+
}
|
|
17672
|
+
} catch {
|
|
17673
|
+
rolloutPath = null;
|
|
17674
|
+
execBase = 0;
|
|
17675
|
+
patchBase = 0;
|
|
17676
|
+
spawnBase = 0;
|
|
17677
|
+
mcpBase = 0;
|
|
17678
|
+
}
|
|
17679
|
+
}
|
|
17680
|
+
const ensureRolloutPath = () => {
|
|
17681
|
+
if (rolloutPath || !codexThreadId || rolloutLookups >= MAX_ROLLOUT_LOOKUPS) return rolloutPath;
|
|
17682
|
+
rolloutLookups += 1;
|
|
17683
|
+
try {
|
|
17684
|
+
rolloutPath = findCodexSessionPath(codexThreadId);
|
|
17685
|
+
} catch {
|
|
17686
|
+
rolloutPath = null;
|
|
17687
|
+
}
|
|
17688
|
+
return rolloutPath;
|
|
17689
|
+
};
|
|
17690
|
+
const resolveExecToolUseId = (item) => {
|
|
17691
|
+
const key = item.id || item.call_id || `codex-${randomUUID3()}`;
|
|
17692
|
+
const cached2 = resolvedToolUseIds.get(key);
|
|
17693
|
+
if (cached2) return cached2;
|
|
17694
|
+
let toolUseId = codexToolUseId(item);
|
|
17695
|
+
const path = ensureRolloutPath();
|
|
17696
|
+
if (!item.call_id && path) {
|
|
17697
|
+
const callId = resolveCodexCallId(readRollout(path).exec, execBase + execSeen, item.command || "");
|
|
17698
|
+
if (callId) toolUseId = callId;
|
|
17699
|
+
}
|
|
17700
|
+
resolvedToolUseIds.set(key, toolUseId);
|
|
17701
|
+
execSeen += 1;
|
|
17702
|
+
return toolUseId;
|
|
17703
|
+
};
|
|
17704
|
+
const resolvePatchToolUseId = (item) => {
|
|
17705
|
+
const key = item.id || item.call_id || `codex-${randomUUID3()}`;
|
|
17706
|
+
const cached2 = resolvedToolUseIds.get(key);
|
|
17707
|
+
if (cached2) return cached2;
|
|
17708
|
+
let toolUseId = codexToolUseId(item);
|
|
17709
|
+
const path = ensureRolloutPath();
|
|
17710
|
+
if (!item.call_id && path) {
|
|
17711
|
+
const paths = (item.changes || []).map((c) => c.path || "").filter(Boolean);
|
|
17712
|
+
const callId = resolveCodexPatchCallId(readRollout(path).patch, patchBase + patchSeen, paths);
|
|
17713
|
+
if (callId) toolUseId = callId;
|
|
17714
|
+
}
|
|
17715
|
+
resolvedToolUseIds.set(key, toolUseId);
|
|
17716
|
+
patchSeen += 1;
|
|
17717
|
+
return toolUseId;
|
|
17718
|
+
};
|
|
17719
|
+
const patchInput = (item) => ({
|
|
17720
|
+
changes: (item.changes || []).map((c) => ({ path: c.path || "", kind: c.kind || "update" }))
|
|
17721
|
+
});
|
|
17722
|
+
const patchResultText = (item) => {
|
|
17723
|
+
const cs = item.changes || [];
|
|
17724
|
+
if (cs.length === 0) return "apply_patch";
|
|
17725
|
+
return cs.map((c) => `${c.kind || "update"} ${c.path || ""}`.trim()).join("\n");
|
|
17726
|
+
};
|
|
17727
|
+
const emitSpawn = (item) => {
|
|
17728
|
+
const agentIds = item.receiver_thread_ids ?? [];
|
|
17729
|
+
const path = ensureRolloutPath();
|
|
17730
|
+
const entry = path ? resolveCodexSpawnCall(readRollout(path).spawn, spawnBase + spawnSeen, agentIds[0]) : null;
|
|
17731
|
+
spawnSeen += 1;
|
|
17732
|
+
const toolUseId = entry?.callId || codexToolUseId(item);
|
|
17733
|
+
const args = entry?.args && Object.keys(entry.args).length > 0 ? entry.args : { message: item.prompt || "" };
|
|
17734
|
+
const input = parseCodexSpawnInput(args, {
|
|
17735
|
+
nickname: entry?.nickname,
|
|
17736
|
+
agentId: agentIds[0] || entry?.agentId
|
|
17737
|
+
});
|
|
17738
|
+
for (const id of agentIds) agentToolUseIds.set(id, toolUseId);
|
|
17739
|
+
pendingToolCalls.set(toolUseId, toolUseId);
|
|
17740
|
+
ctx.emit({
|
|
17741
|
+
type: "assistant",
|
|
17742
|
+
message: { content: [{ type: "tool_use", id: toolUseId, name: CODEX_TOOL_NAMES.task, input }] }
|
|
17743
|
+
});
|
|
17744
|
+
};
|
|
17745
|
+
const emitAgentReports = (item) => {
|
|
17746
|
+
for (const state of parseCodexAgentsStates(item.agents_states)) {
|
|
17747
|
+
if (!state.done) continue;
|
|
17748
|
+
const toolUseId = agentToolUseIds.get(state.agentId);
|
|
17749
|
+
if (!toolUseId) continue;
|
|
17750
|
+
ctx.emit({
|
|
17751
|
+
type: "user",
|
|
17752
|
+
message: { content: [{ tool_use_id: toolUseId, content: codexAgentResultText(state) }] }
|
|
17753
|
+
});
|
|
17754
|
+
pendingToolCalls.delete(toolUseId);
|
|
17755
|
+
agentToolUseIds.delete(state.agentId);
|
|
17756
|
+
}
|
|
17757
|
+
};
|
|
17758
|
+
const resolveMcpToolUseId = (item) => {
|
|
17759
|
+
const key = item.id || `codex-${randomUUID3()}`;
|
|
17760
|
+
const cached2 = resolvedToolUseIds.get(key);
|
|
17761
|
+
if (cached2) return cached2;
|
|
17762
|
+
let toolUseId = codexToolUseId(item);
|
|
17763
|
+
const path = ensureRolloutPath();
|
|
17764
|
+
if (!item.call_id && path) {
|
|
17765
|
+
const callId = resolveCodexMcpCallId(readRollout(path).mcp, mcpBase + mcpSeen, item.server, item.tool);
|
|
17766
|
+
if (callId) toolUseId = callId;
|
|
17767
|
+
}
|
|
17768
|
+
resolvedToolUseIds.set(key, toolUseId);
|
|
17769
|
+
mcpSeen += 1;
|
|
17770
|
+
return toolUseId;
|
|
17771
|
+
};
|
|
17772
|
+
const emitMcpCall = (item, done) => {
|
|
17773
|
+
const toolUseId = resolveMcpToolUseId(item);
|
|
17774
|
+
const name = codexMcpToolName(item.server || "mcp", item.tool || "tool");
|
|
17775
|
+
if (!pendingToolCalls.has(toolUseId)) {
|
|
17776
|
+
pendingToolCalls.set(toolUseId, toolUseId);
|
|
17777
|
+
ctx.emit({
|
|
17778
|
+
type: "assistant",
|
|
17779
|
+
message: { content: [{ type: "tool_use", id: toolUseId, name, input: item.arguments || {} }] }
|
|
17780
|
+
});
|
|
17781
|
+
}
|
|
17782
|
+
if (!done) return;
|
|
17783
|
+
ctx.emit({
|
|
17784
|
+
type: "user",
|
|
17785
|
+
message: { content: [{ tool_use_id: toolUseId, content: codexMcpResultText(item) || `(${item.status || "completed"})` }] }
|
|
17786
|
+
});
|
|
17787
|
+
pendingToolCalls.delete(toolUseId);
|
|
17788
|
+
};
|
|
17789
|
+
const emitWebSearch = (item) => {
|
|
17790
|
+
const toolUseId = codexToolUseId(item);
|
|
17791
|
+
const { name, input, result } = codexWebSearchCall(item.query, item.action);
|
|
17792
|
+
ctx.emit({
|
|
17793
|
+
type: "assistant",
|
|
17794
|
+
message: { content: [{ type: "tool_use", id: toolUseId, name, input }] }
|
|
17795
|
+
});
|
|
17796
|
+
ctx.emit({ type: "user", message: { content: [{ tool_use_id: toolUseId, content: result }] } });
|
|
17797
|
+
};
|
|
17798
|
+
const emitTodoList = (item) => {
|
|
17799
|
+
const toolUseId = codexToolUseId(item);
|
|
17800
|
+
const input = codexTodoInput(item.items);
|
|
17801
|
+
ctx.emit({
|
|
17802
|
+
type: "assistant",
|
|
17803
|
+
message: { content: [{ type: "tool_use", id: toolUseId, name: CODEX_TOOL_NAMES.todo, input }] }
|
|
17804
|
+
});
|
|
17805
|
+
ctx.emit({
|
|
17806
|
+
type: "user",
|
|
17807
|
+
message: { content: [{ tool_use_id: toolUseId, content: codexTodoResultText(input.todos) }] }
|
|
17808
|
+
});
|
|
17809
|
+
};
|
|
17810
|
+
const handleCollabItem = (item) => {
|
|
17811
|
+
if (item.tool === CODEX_SPAWN_FN_NAME) {
|
|
17812
|
+
emitSpawn(item);
|
|
17813
|
+
return;
|
|
17814
|
+
}
|
|
17815
|
+
emitAgentReports(item);
|
|
17816
|
+
};
|
|
17817
|
+
const handle = (event) => {
|
|
17818
|
+
if (terminated) return;
|
|
17819
|
+
switch (event.type) {
|
|
17820
|
+
case "thread.started": {
|
|
17821
|
+
const threadId = event.thread_id || `codex-${randomUUID3()}`;
|
|
17822
|
+
if (event.thread_id) codexThreadId = event.thread_id;
|
|
17823
|
+
ctx.rekey(threadId);
|
|
17824
|
+
ctx.emit({ type: "system", subtype: "init", session_id: threadId });
|
|
17825
|
+
ensureRolloutPath();
|
|
17826
|
+
break;
|
|
17827
|
+
}
|
|
17828
|
+
case "item.completed": {
|
|
17829
|
+
const item = event.item;
|
|
17830
|
+
if (!item) break;
|
|
17831
|
+
if (item.type === "agent_message" && item.text) {
|
|
17832
|
+
ctx.emit({ type: "assistant", message: { content: [{ type: "text", text: item.text }] } });
|
|
17833
|
+
}
|
|
17834
|
+
if (item.type === "error" && (item.message || item.text)) {
|
|
17835
|
+
ctx.emit({ type: "error", error: item.message || item.text });
|
|
17836
|
+
}
|
|
17837
|
+
if (item.type === "reasoning" && item.text) {
|
|
17838
|
+
ctx.emit({
|
|
17839
|
+
type: "assistant",
|
|
17840
|
+
message: { content: [{ type: "text", text: `<details><summary>Reasoning</summary>
|
|
18084
17841
|
|
|
18085
17842
|
${item.text}
|
|
18086
17843
|
|
|
18087
17844
|
</details>` }] }
|
|
18088
|
-
|
|
18089
|
-
|
|
18090
|
-
|
|
18091
|
-
|
|
18092
|
-
|
|
18093
|
-
|
|
18094
|
-
|
|
18095
|
-
|
|
18096
|
-
|
|
18097
|
-
}
|
|
18098
|
-
ctx.emit({
|
|
18099
|
-
type: "user",
|
|
18100
|
-
message: { content: [{ tool_use_id: toolUseId, content: item.aggregated_output || `(exit code: ${item.exit_code ?? "unknown"})` }] }
|
|
18101
|
-
});
|
|
18102
|
-
pendingToolCalls.delete(toolUseId);
|
|
18103
|
-
}
|
|
18104
|
-
break;
|
|
18105
|
-
}
|
|
18106
|
-
case "item.started": {
|
|
18107
|
-
const item = event.item;
|
|
18108
|
-
if (item?.type === "command_execution" && item.command) {
|
|
18109
|
-
const toolUseId = item.id || `tool-${randomUUID4()}`;
|
|
18110
|
-
pendingToolCalls.set(toolUseId, toolUseId);
|
|
18111
|
-
ctx.emit({
|
|
18112
|
-
type: "assistant",
|
|
18113
|
-
message: { content: [{ type: "tool_use", id: toolUseId, name: "Bash", input: { command: item.command } }] }
|
|
18114
|
-
});
|
|
18115
|
-
}
|
|
18116
|
-
break;
|
|
18117
|
-
}
|
|
18118
|
-
case "turn.completed": {
|
|
18119
|
-
const usage = event.usage || {};
|
|
18120
|
-
ctx.emit({
|
|
18121
|
-
type: "result",
|
|
18122
|
-
subtype: "success",
|
|
18123
|
-
usage: {
|
|
18124
|
-
input_tokens: usage.input_tokens || 0,
|
|
18125
|
-
output_tokens: usage.output_tokens || 0,
|
|
18126
|
-
cache_creation_input_tokens: 0,
|
|
18127
|
-
cache_read_input_tokens: usage.cached_input_tokens || 0
|
|
18128
|
-
},
|
|
18129
|
-
total_cost_usd: 0
|
|
18130
|
-
});
|
|
18131
|
-
break;
|
|
18132
|
-
}
|
|
18133
|
-
case "turn.failed": {
|
|
18134
|
-
terminated = true;
|
|
18135
|
-
failure = new Error(event.error?.message || "Codex turn failed");
|
|
18136
|
-
break;
|
|
18137
|
-
}
|
|
18138
|
-
case "error": {
|
|
18139
|
-
terminated = true;
|
|
18140
|
-
failure = new Error(event.message || "Codex error");
|
|
18141
|
-
break;
|
|
18142
|
-
}
|
|
17845
|
+
});
|
|
17846
|
+
}
|
|
17847
|
+
if (item.type === "command_execution") {
|
|
17848
|
+
const toolUseId = resolveExecToolUseId(item);
|
|
17849
|
+
if (!pendingToolCalls.has(toolUseId)) {
|
|
17850
|
+
ctx.emit({
|
|
17851
|
+
type: "assistant",
|
|
17852
|
+
message: { content: [{ type: "tool_use", id: toolUseId, name: CODEX_TOOL_NAMES.bash, input: { command: item.command || "" } }] }
|
|
17853
|
+
});
|
|
18143
17854
|
}
|
|
17855
|
+
ctx.emit({
|
|
17856
|
+
type: "user",
|
|
17857
|
+
message: { content: [{ tool_use_id: toolUseId, content: item.aggregated_output || `(exit code: ${item.exit_code ?? "unknown"})` }] }
|
|
17858
|
+
});
|
|
17859
|
+
pendingToolCalls.delete(toolUseId);
|
|
17860
|
+
}
|
|
17861
|
+
if (item.type === "collab_tool_call") handleCollabItem(item);
|
|
17862
|
+
if (item.type === "mcp_tool_call") emitMcpCall(item, true);
|
|
17863
|
+
if (item.type === "web_search") emitWebSearch(item);
|
|
17864
|
+
if (item.type === "todo_list") emitTodoList(item);
|
|
17865
|
+
if (item.type === "file_change") {
|
|
17866
|
+
const toolUseId = resolvePatchToolUseId(item);
|
|
17867
|
+
if (!pendingToolCalls.has(toolUseId)) {
|
|
17868
|
+
ctx.emit({
|
|
17869
|
+
type: "assistant",
|
|
17870
|
+
message: { content: [{ type: "tool_use", id: toolUseId, name: CODEX_TOOL_NAMES.applyPatch, input: patchInput(item) }] }
|
|
17871
|
+
});
|
|
17872
|
+
}
|
|
17873
|
+
ctx.emit({
|
|
17874
|
+
type: "user",
|
|
17875
|
+
message: { content: [{ tool_use_id: toolUseId, content: patchResultText(item) }] }
|
|
17876
|
+
});
|
|
17877
|
+
pendingToolCalls.delete(toolUseId);
|
|
17878
|
+
}
|
|
17879
|
+
break;
|
|
17880
|
+
}
|
|
17881
|
+
case "item.started": {
|
|
17882
|
+
const item = event.item;
|
|
17883
|
+
if (item?.type === "mcp_tool_call") emitMcpCall(item, false);
|
|
17884
|
+
if (item?.type === "command_execution" && item.command) {
|
|
17885
|
+
const toolUseId = resolveExecToolUseId(item);
|
|
17886
|
+
pendingToolCalls.set(toolUseId, toolUseId);
|
|
17887
|
+
ctx.emit({
|
|
17888
|
+
type: "assistant",
|
|
17889
|
+
message: { content: [{ type: "tool_use", id: toolUseId, name: CODEX_TOOL_NAMES.bash, input: { command: item.command } }] }
|
|
17890
|
+
});
|
|
17891
|
+
}
|
|
17892
|
+
if (item?.type === "file_change" && (item.changes?.length ?? 0) > 0) {
|
|
17893
|
+
const toolUseId = resolvePatchToolUseId(item);
|
|
17894
|
+
pendingToolCalls.set(toolUseId, toolUseId);
|
|
17895
|
+
ctx.emit({
|
|
17896
|
+
type: "assistant",
|
|
17897
|
+
message: { content: [{ type: "tool_use", id: toolUseId, name: CODEX_TOOL_NAMES.applyPatch, input: patchInput(item) }] }
|
|
17898
|
+
});
|
|
17899
|
+
}
|
|
17900
|
+
break;
|
|
17901
|
+
}
|
|
17902
|
+
case "turn.completed": {
|
|
17903
|
+
const usage = event.usage || {};
|
|
17904
|
+
ctx.emit({
|
|
17905
|
+
type: "result",
|
|
17906
|
+
subtype: "success",
|
|
17907
|
+
usage: {
|
|
17908
|
+
input_tokens: usage.input_tokens || 0,
|
|
17909
|
+
output_tokens: usage.output_tokens || 0,
|
|
17910
|
+
cache_creation_input_tokens: usage.cache_write_input_tokens || 0,
|
|
17911
|
+
cache_read_input_tokens: usage.cached_input_tokens || 0
|
|
17912
|
+
},
|
|
17913
|
+
total_cost_usd: 0
|
|
18144
17914
|
});
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18158
|
-
|
|
18159
|
-
|
|
17915
|
+
break;
|
|
17916
|
+
}
|
|
17917
|
+
case "turn.failed": {
|
|
17918
|
+
terminated = true;
|
|
17919
|
+
failure = new Error(event.error?.message || "Codex turn failed");
|
|
17920
|
+
break;
|
|
17921
|
+
}
|
|
17922
|
+
case "error": {
|
|
17923
|
+
terminated = true;
|
|
17924
|
+
failure = new Error(event.message || "Codex error");
|
|
17925
|
+
break;
|
|
17926
|
+
}
|
|
17927
|
+
}
|
|
17928
|
+
};
|
|
17929
|
+
return {
|
|
17930
|
+
handle,
|
|
17931
|
+
assertSuccess() {
|
|
17932
|
+
if (failure) throw failure;
|
|
17933
|
+
}
|
|
17934
|
+
};
|
|
17935
|
+
}
|
|
17936
|
+
function cleanupImageFiles(imageFiles) {
|
|
17937
|
+
for (const f of imageFiles) {
|
|
17938
|
+
try {
|
|
17939
|
+
unlinkSync(f);
|
|
17940
|
+
} catch {
|
|
18160
17941
|
}
|
|
18161
|
-
|
|
17942
|
+
}
|
|
17943
|
+
}
|
|
17944
|
+
function codexSdkInput(prompt, imageFiles) {
|
|
17945
|
+
if (imageFiles.length === 0) return prompt;
|
|
17946
|
+
return [
|
|
17947
|
+
{ type: "text", text: prompt || CODEX_IMAGE_ONLY_TEXT },
|
|
17948
|
+
...imageFiles.map((path) => ({ type: "local_image", path }))
|
|
17949
|
+
];
|
|
17950
|
+
}
|
|
17951
|
+
function codexThreadOptions(ctx) {
|
|
17952
|
+
return {
|
|
17953
|
+
...ctx.params.model ? { model: ctx.params.model } : {},
|
|
17954
|
+
...ctx.cwd ? { workingDirectory: ctx.cwd } : {},
|
|
17955
|
+
sandboxMode: "danger-full-access",
|
|
17956
|
+
approvalPolicy: "never",
|
|
17957
|
+
skipGitRepoCheck: true
|
|
17958
|
+
};
|
|
17959
|
+
}
|
|
17960
|
+
async function runCodexSdk(ctx) {
|
|
17961
|
+
const imageFiles = ctx.images && ctx.images.length > 0 ? writeImagesToTemp(ctx.images) : [];
|
|
17962
|
+
const adapter = createCodexEventAdapter(ctx);
|
|
17963
|
+
try {
|
|
17964
|
+
const { Codex } = await import("@openai/codex-sdk");
|
|
17965
|
+
const env = sanitizedSpawnEnv({});
|
|
17966
|
+
let codex;
|
|
17967
|
+
try {
|
|
17968
|
+
codex = new Codex({ env });
|
|
17969
|
+
} catch (error48) {
|
|
17970
|
+
const message = error48 instanceof Error ? error48.message : "";
|
|
17971
|
+
if (!message.includes("Unable to locate Codex CLI binaries")) throw error48;
|
|
17972
|
+
codex = new Codex({ codexPathOverride: "codex", env });
|
|
17973
|
+
}
|
|
17974
|
+
const thread = ctx.sessionId ? codex.resumeThread(ctx.sessionId, codexThreadOptions(ctx)) : codex.startThread(codexThreadOptions(ctx));
|
|
17975
|
+
const { events } = await thread.runStreamed(codexSdkInput(ctx.prompt ?? "", imageFiles), { signal: ctx.signal });
|
|
17976
|
+
for await (const event of events) adapter.handle(event);
|
|
17977
|
+
adapter.assertSuccess();
|
|
17978
|
+
} finally {
|
|
17979
|
+
cleanupImageFiles(imageFiles);
|
|
17980
|
+
}
|
|
17981
|
+
}
|
|
17982
|
+
var codexSpec = {
|
|
17983
|
+
name: "codex",
|
|
17984
|
+
// No preflight: the orchestrator's own "prompt or images" check is sufficient.
|
|
17985
|
+
runner: {
|
|
17986
|
+
async run(ctx) {
|
|
17987
|
+
if (ctx.params.noHistory !== true || !ctx.sessionId) {
|
|
17988
|
+
await runCodexSdk(ctx);
|
|
17989
|
+
return;
|
|
17990
|
+
}
|
|
17991
|
+
const sessionPath = findCodexSessionPath(ctx.sessionId);
|
|
17992
|
+
const stashed = sessionPath ? stashCodexRollout(sessionPath) : false;
|
|
17993
|
+
try {
|
|
17994
|
+
await runCodexSdk(ctx);
|
|
17995
|
+
} finally {
|
|
17996
|
+
if (stashed && sessionPath) mergeStashedCodexRollout(sessionPath);
|
|
17997
|
+
}
|
|
17998
|
+
}
|
|
17999
|
+
// No resolveTitle -> teardown 'unread' with undefined title (matches original).
|
|
18162
18000
|
}
|
|
18163
18001
|
};
|
|
18164
18002
|
|
|
18165
18003
|
// packages/feature/agent/src/server/engines/registry.ts
|
|
18166
18004
|
var SPECS = {
|
|
18167
18005
|
claude: claudeSpec,
|
|
18168
|
-
claude2: claudeSpec,
|
|
18169
18006
|
deepseek: deepseekSpec,
|
|
18170
18007
|
ollama: ollamaSpec,
|
|
18171
18008
|
kimi: kimiSpec,
|
|
@@ -18243,10 +18080,24 @@ var en_default2 = {
|
|
|
18243
18080
|
current: "Current"
|
|
18244
18081
|
},
|
|
18245
18082
|
htmlApps: {
|
|
18083
|
+
title: "HTML Apps",
|
|
18246
18084
|
addTooltip: "Add to HTML panel",
|
|
18247
18085
|
added: "Added to HTML panel",
|
|
18248
18086
|
alreadyAdded: "Already added",
|
|
18249
|
-
addFailed: "Failed to add"
|
|
18087
|
+
addFailed: "Failed to add",
|
|
18088
|
+
add: "Add",
|
|
18089
|
+
adding: "Adding...",
|
|
18090
|
+
addHtmlApp: "Add HTML app",
|
|
18091
|
+
searchPlaceholder: "Search HTML apps...",
|
|
18092
|
+
pathLabel: "Absolute path to the .html file",
|
|
18093
|
+
invalid: "Invalid",
|
|
18094
|
+
noDescription: "No description",
|
|
18095
|
+
emptyNoApps: "No HTML apps yet.",
|
|
18096
|
+
emptyCreatePrefix: "Use",
|
|
18097
|
+
emptyCreateSuffix: "in chat to create a new app.",
|
|
18098
|
+
addExisting: "add an existing HTML file",
|
|
18099
|
+
viewDocs: "view docs",
|
|
18100
|
+
emptyNoMatch: "No HTML apps match your search."
|
|
18250
18101
|
},
|
|
18251
18102
|
skills: {
|
|
18252
18103
|
addTooltip: "Add to Skills panel",
|
|
@@ -18257,8 +18108,11 @@ var en_default2 = {
|
|
|
18257
18108
|
searchPlaceholder: "Search skills...",
|
|
18258
18109
|
clearSearch: "Clear",
|
|
18259
18110
|
addSkill: "Add Skill",
|
|
18260
|
-
emptyNoSkills:
|
|
18111
|
+
emptyNoSkills: "No skills yet.",
|
|
18112
|
+
emptyIntroPrefix: "Use",
|
|
18113
|
+
emptyIntroSuffix: "in chat to distil a reusable workflow into a SKILL.md file.",
|
|
18261
18114
|
emptyNoMatch: "No skills match your search.",
|
|
18115
|
+
viewDocs: "view docs",
|
|
18262
18116
|
pathLabel: "Absolute path to SKILL.md",
|
|
18263
18117
|
pathPlaceholder: "/Users/you/.../skills/foo/SKILL.md",
|
|
18264
18118
|
add: "Add",
|
|
@@ -18349,6 +18203,7 @@ var en_default2 = {
|
|
|
18349
18203
|
collapseSidebar: "Collapse sidebar",
|
|
18350
18204
|
notes: "Notes",
|
|
18351
18205
|
skills: "Skills",
|
|
18206
|
+
apps: "Apps",
|
|
18352
18207
|
settings: "Settings",
|
|
18353
18208
|
help: "Help",
|
|
18354
18209
|
updateAvailable: "v{{version}} available",
|
|
@@ -18669,7 +18524,7 @@ var en_default2 = {
|
|
|
18669
18524
|
context: "Context",
|
|
18670
18525
|
output: "Output",
|
|
18671
18526
|
copiedCommandTooltip: "Copied!",
|
|
18672
|
-
copyCommandTooltip: "Copy command:
|
|
18527
|
+
copyCommandTooltip: "Copy command: {{command}}",
|
|
18673
18528
|
executedCommand: "Executed `{{command}}`{{exitInfo}}, output:\n```\n{{output}}\n```",
|
|
18674
18529
|
executedCommandFailed: "Failed to execute `{{command}}`: {{error}}",
|
|
18675
18530
|
executionMode: "Execution Mode",
|
|
@@ -18685,7 +18540,6 @@ var en_default2 = {
|
|
|
18685
18540
|
quotaEmpty: "No quota returned",
|
|
18686
18541
|
quotaResetAt: "Resets {{time}}",
|
|
18687
18542
|
openProviderConsole: "Open the provider console",
|
|
18688
|
-
ptyModeHint: "Subscription billing mode: uses interactive claude CLI",
|
|
18689
18543
|
planMode: "Plan mode",
|
|
18690
18544
|
planModeDesc: "read-only \xB7 plan first, no edits",
|
|
18691
18545
|
planModeOn: "Plan mode on \u2014 read-only; send a task to get a plan",
|
|
@@ -18694,19 +18548,10 @@ var en_default2 = {
|
|
|
18694
18548
|
noHistory: "Independent task",
|
|
18695
18549
|
noHistoryDesc: "no history sent",
|
|
18696
18550
|
noHistoryHint: "Independent task: each message is sent to the model on its own, with no prior conversation. The transcript above still records everything.",
|
|
18697
|
-
noHistoryPtyHint: "Not available in PTY mode: the interactive claude CLI holds the conversation itself. Switch to SDK mode to use it.",
|
|
18698
18551
|
planTitle: "Plan (awaiting your review)",
|
|
18699
18552
|
approvePlan: "Approve & run",
|
|
18700
18553
|
planApproveHint: "No approval dialog here \u2014 click to exit plan mode and execute",
|
|
18701
|
-
approvePlanPrompt: "Approved \u2014 proceed with the plan above."
|
|
18702
|
-
ptyTerminal: "PTY Terminal",
|
|
18703
|
-
ptyRunning: "running",
|
|
18704
|
-
ptyCollapse: "Collapse",
|
|
18705
|
-
ptyExpand: "Expand",
|
|
18706
|
-
ptyStuck: "PTY seems stuck (waiting for a dialog?). Please handle it in the terminal below.",
|
|
18707
|
-
ptyTimedOut: "PTY timed out without manual handling; the turn was terminated.",
|
|
18708
|
-
ptyCrash: "Claude CLI render crash (upstream bug): {{error}}. This session's history may contain edits that fail to render.",
|
|
18709
|
-
ptyQuestionEsc: "AI asked an interactive question, which cannot be answered in this mode; it was auto-cancelled and the turn was ended. See the question in the chat and answer it in your next message."
|
|
18554
|
+
approvePlanPrompt: "Approved \u2014 proceed with the plan above."
|
|
18710
18555
|
},
|
|
18711
18556
|
console: {
|
|
18712
18557
|
enterCommandOrUrl: "Enter a command or URL to start",
|
|
@@ -18724,7 +18569,7 @@ var en_default2 = {
|
|
|
18724
18569
|
singleColumn: "Single column",
|
|
18725
18570
|
dualColumn: "Dual column",
|
|
18726
18571
|
envVars: "Environment Variables",
|
|
18727
|
-
|
|
18572
|
+
launchShell: "Launch interactive shell",
|
|
18728
18573
|
htmlApps: "HTML apps",
|
|
18729
18574
|
inputPlaceholder: "Enter command or URL and press Enter... (\u2191\u2193 history, Tab complete)",
|
|
18730
18575
|
scopeProject: "Project",
|
|
@@ -19437,10 +19282,24 @@ var zh_default = {
|
|
|
19437
19282
|
current: "\u5F53\u524D"
|
|
19438
19283
|
},
|
|
19439
19284
|
htmlApps: {
|
|
19285
|
+
title: "HTML \u5E94\u7528",
|
|
19440
19286
|
addTooltip: "\u6DFB\u52A0\u5230 HTML \u9762\u677F",
|
|
19441
19287
|
added: "\u5DF2\u6DFB\u52A0\u5230 HTML \u9762\u677F",
|
|
19442
19288
|
alreadyAdded: "\u5DF2\u6DFB\u52A0\u8FC7",
|
|
19443
|
-
addFailed: "\u6DFB\u52A0\u5931\u8D25"
|
|
19289
|
+
addFailed: "\u6DFB\u52A0\u5931\u8D25",
|
|
19290
|
+
add: "\u6DFB\u52A0",
|
|
19291
|
+
adding: "\u6DFB\u52A0\u4E2D...",
|
|
19292
|
+
addHtmlApp: "\u6DFB\u52A0 HTML \u5E94\u7528",
|
|
19293
|
+
searchPlaceholder: "\u641C\u7D22 HTML \u5E94\u7528...",
|
|
19294
|
+
pathLabel: ".html \u6587\u4EF6\u7684\u7EDD\u5BF9\u8DEF\u5F84",
|
|
19295
|
+
invalid: "\u65E0\u6548",
|
|
19296
|
+
noDescription: "\u65E0\u63CF\u8FF0",
|
|
19297
|
+
emptyNoApps: "\u8FD8\u6CA1\u6709 HTML \u5E94\u7528\u3002",
|
|
19298
|
+
emptyCreatePrefix: "\u5728\u804A\u5929\u91CC\u4F7F\u7528",
|
|
19299
|
+
emptyCreateSuffix: "\u521B\u5EFA\u65B0\u5E94\u7528\u3002",
|
|
19300
|
+
addExisting: "\u6DFB\u52A0\u5DF2\u6709 HTML \u6587\u4EF6",
|
|
19301
|
+
viewDocs: "\u67E5\u770B\u6587\u6863",
|
|
19302
|
+
emptyNoMatch: "\u6CA1\u6709\u5339\u914D\u7684 HTML \u5E94\u7528\u3002"
|
|
19444
19303
|
},
|
|
19445
19304
|
skills: {
|
|
19446
19305
|
addTooltip: "\u6DFB\u52A0\u5230 Skills \u9762\u677F",
|
|
@@ -19451,8 +19310,11 @@ var zh_default = {
|
|
|
19451
19310
|
searchPlaceholder: "\u641C\u7D22 skills...",
|
|
19452
19311
|
clearSearch: "\u6E05\u9664",
|
|
19453
19312
|
addSkill: "\u6DFB\u52A0 Skill",
|
|
19454
|
-
emptyNoSkills: "\u8FD8\u6CA1\u6709 skill\
|
|
19313
|
+
emptyNoSkills: "\u8FD8\u6CA1\u6709 skill\u3002",
|
|
19314
|
+
emptyIntroPrefix: "\u5728\u804A\u5929\u91CC\u4F7F\u7528",
|
|
19315
|
+
emptyIntroSuffix: "\u628A\u53EF\u590D\u7528\u7ECF\u9A8C\u6574\u7406\u6210 SKILL.md\u3002",
|
|
19455
19316
|
emptyNoMatch: "\u6CA1\u6709\u5339\u914D\u7684 skill\u3002",
|
|
19317
|
+
viewDocs: "\u67E5\u770B\u6587\u6863",
|
|
19456
19318
|
pathLabel: "SKILL.md \u7684\u7EDD\u5BF9\u8DEF\u5F84",
|
|
19457
19319
|
pathPlaceholder: "/Users/you/.../skills/foo/SKILL.md",
|
|
19458
19320
|
add: "\u6DFB\u52A0",
|
|
@@ -19543,6 +19405,7 @@ var zh_default = {
|
|
|
19543
19405
|
collapseSidebar: "\u6298\u53E0\u4FA7\u8FB9\u680F",
|
|
19544
19406
|
notes: "\u7B14\u8BB0",
|
|
19545
19407
|
skills: "\u6280\u80FD",
|
|
19408
|
+
apps: "\u5E94\u7528",
|
|
19546
19409
|
settings: "\u8BBE\u7F6E",
|
|
19547
19410
|
help: "\u5E2E\u52A9",
|
|
19548
19411
|
updateAvailable: "\u65B0\u7248\u672C v{{version}} \u53EF\u7528",
|
|
@@ -19863,7 +19726,7 @@ var zh_default = {
|
|
|
19863
19726
|
context: "\u4E0A\u4E0B\u6587",
|
|
19864
19727
|
output: "\u8F93\u51FA",
|
|
19865
19728
|
copiedCommandTooltip: "\u5DF2\u590D\u5236!",
|
|
19866
|
-
copyCommandTooltip: "\u590D\u5236\u547D\u4EE4:
|
|
19729
|
+
copyCommandTooltip: "\u590D\u5236\u547D\u4EE4: {{command}}",
|
|
19867
19730
|
executedCommand: "\u6267\u884C\u4E86 `{{command}}`{{exitInfo}}\uFF0C\u8F93\u51FA\uFF1A\n```\n{{output}}\n```",
|
|
19868
19731
|
executedCommandFailed: "\u6267\u884C `{{command}}` \u5931\u8D25\uFF1A{{error}}",
|
|
19869
19732
|
executionMode: "\u6267\u884C\u6A21\u5F0F",
|
|
@@ -19879,7 +19742,6 @@ var zh_default = {
|
|
|
19879
19742
|
quotaEmpty: "\u672A\u8FD4\u56DE\u989D\u5EA6\u4FE1\u606F",
|
|
19880
19743
|
quotaResetAt: "{{time}} \u91CD\u7F6E",
|
|
19881
19744
|
openProviderConsole: "\u6253\u5F00\u670D\u52A1\u5546\u63A7\u5236\u53F0",
|
|
19882
|
-
ptyModeHint: "\u8BA2\u9605\u8BA1\u8D39\u6A21\u5F0F\uFF1A\u7528\u4EA4\u4E92\u5F0F claude CLI \u9A71\u52A8",
|
|
19883
19745
|
planMode: "\u8BA1\u5212\u6A21\u5F0F",
|
|
19884
19746
|
planModeDesc: "\u53EA\u8BFB\xB7\u5148\u51FA\u8BA1\u5212\u4E0D\u6539\u4EE3\u7801",
|
|
19885
19747
|
planModeOn: "\u5DF2\u5F00\u542F\u8BA1\u5212\u6A21\u5F0F\u2014\u2014\u53EA\u8BFB;\u53D1\u4E00\u4E2A\u4EFB\u52A1\u5373\u53EF\u62FF\u5230\u8BA1\u5212",
|
|
@@ -19888,19 +19750,10 @@ var zh_default = {
|
|
|
19888
19750
|
noHistory: "\u72EC\u7ACB\u4EFB\u52A1",
|
|
19889
19751
|
noHistoryDesc: "\u4E0D\u53D1\u9001\u5386\u53F2",
|
|
19890
19752
|
noHistoryHint: "\u72EC\u7ACB\u4EFB\u52A1\uFF1A\u6BCF\u6761\u6D88\u606F\u5355\u72EC\u53D1\u7ED9\u6A21\u578B\uFF0C\u4E0D\u5E26\u4E4B\u524D\u7684\u5BF9\u8BDD\u3002\u4E0A\u65B9\u7684\u4F1A\u8BDD\u8BB0\u5F55\u7167\u5E38\u4FDD\u7559\u3002",
|
|
19891
|
-
noHistoryPtyHint: "PTY \u6A21\u5F0F\u4E0B\u4E0D\u53EF\u7528\uFF1A\u5BF9\u8BDD\u7531\u4EA4\u4E92\u5F0F claude CLI \u81EA\u5DF1\u6301\u6709\u3002\u5207\u6362\u5230 SDK \u6A21\u5F0F\u5373\u53EF\u4F7F\u7528\u3002",
|
|
19892
19753
|
planTitle: "\u8BA1\u5212\uFF08\u5F85\u4F60\u786E\u8BA4\uFF09",
|
|
19893
19754
|
approvePlan: "\u6279\u51C6\u5E76\u6267\u884C",
|
|
19894
19755
|
planApproveHint: "\u672C\u73AF\u5883\u65E0\u5BA1\u6279\u5F39\u7A97\uFF0C\u70B9\u6B64\u9000\u51FA\u8BA1\u5212\u6A21\u5F0F\u5E76\u6267\u884C",
|
|
19895
|
-
approvePlanPrompt: "\u5DF2\u6279\u51C6\uFF0C\u6309\u4E0A\u8FF0\u8BA1\u5212\u5F00\u59CB\u6267\u884C\u3002"
|
|
19896
|
-
ptyTerminal: "PTY \u7EC8\u7AEF",
|
|
19897
|
-
ptyRunning: "\u8FD0\u884C\u4E2D",
|
|
19898
|
-
ptyCollapse: "\u6536\u8D77",
|
|
19899
|
-
ptyExpand: "\u5C55\u5F00",
|
|
19900
|
-
ptyStuck: "PTY \u4F3C\u4E4E\u5361\u4F4F\uFF08\u53EF\u80FD\u5728\u7B49\u5F85\u5BF9\u8BDD\u6846\u8F93\u5165\uFF09\uFF0C\u8BF7\u5728 PTY \u7EC8\u7AEF\u624B\u52A8\u5904\u7406\u3002",
|
|
19901
|
-
ptyTimedOut: "PTY \u8D85\u65F6\u672A\u4EBA\u5DE5\u5904\u7406\uFF0C\u5DF2\u7ED3\u675F\u8BE5\u56DE\u5408\u3002",
|
|
19902
|
-
ptyCrash: "Claude CLI \u6E32\u67D3\u5D29\u6E83\uFF08\u4E0A\u6E38 bug\uFF09\uFF1A{{error}}\u3002\u8BE5\u4F1A\u8BDD\u5386\u53F2\u53EF\u80FD\u542B\u65E0\u6CD5\u6E32\u67D3\u7684\u7F16\u8F91\u8BB0\u5F55\u3002",
|
|
19903
|
-
ptyQuestionEsc: "AI \u7684\u4EA4\u4E92\u5F0F\u63D0\u95EE\u65E0\u6CD5\u5728\u672C\u6A21\u5F0F\u4E2D\u5E94\u7B54\uFF0C\u5DF2\u81EA\u52A8\u53D6\u6D88\u5E76\u7ED3\u675F\u672C\u8F6E\u3002\u95EE\u9898\u5185\u5BB9\u89C1\u804A\u5929\u533A\uFF0C\u4E0B\u4E00\u6761\u6D88\u606F\u76F4\u63A5\u56DE\u7B54\u5373\u53EF\u3002"
|
|
19756
|
+
approvePlanPrompt: "\u5DF2\u6279\u51C6\uFF0C\u6309\u4E0A\u8FF0\u8BA1\u5212\u5F00\u59CB\u6267\u884C\u3002"
|
|
19904
19757
|
},
|
|
19905
19758
|
console: {
|
|
19906
19759
|
enterCommandOrUrl: "\u8F93\u5165\u547D\u4EE4\u6216\u7F51\u5740\u5F00\u59CB\u4F7F\u7528",
|
|
@@ -19918,7 +19771,7 @@ var zh_default = {
|
|
|
19918
19771
|
singleColumn: "\u5355\u5217\u5E03\u5C40",
|
|
19919
19772
|
dualColumn: "\u53CC\u5217\u5E03\u5C40",
|
|
19920
19773
|
envVars: "\u73AF\u5883\u53D8\u91CF",
|
|
19921
|
-
|
|
19774
|
+
launchShell: "\u542F\u52A8\u4EA4\u4E92\u7EC8\u7AEF",
|
|
19922
19775
|
htmlApps: "HTML \u5E94\u7528",
|
|
19923
19776
|
inputPlaceholder: "\u8F93\u5165\u547D\u4EE4\u6216\u7F51\u5740\u5E76\u6309 Enter... (\u2191\u2193 \u5386\u53F2, Tab \u8865\u5168)",
|
|
19924
19777
|
scopeProject: "\u9879\u76EE",
|
|
@@ -20653,7 +20506,6 @@ var dispatchEngineMessageEff = (task, engine, startFresh) => Effect_exports.tryP
|
|
|
20653
20506
|
...startFresh ? {} : { sessionId: task.sessionId },
|
|
20654
20507
|
cwd: task.cwd,
|
|
20655
20508
|
engine,
|
|
20656
|
-
// selects claude2's CLAUDE_CONFIG_DIR; no-op for the others
|
|
20657
20509
|
...task.model && { model: task.model },
|
|
20658
20510
|
...builtinLoop && { mode: "builtin" },
|
|
20659
20511
|
...noHistory && { noHistory: true }
|
|
@@ -20683,9 +20535,8 @@ var dispatchEngineMessageEff = (task, engine, startFresh) => Effect_exports.tryP
|
|
|
20683
20535
|
}
|
|
20684
20536
|
return true;
|
|
20685
20537
|
},
|
|
20686
|
-
// claude2 shares the 'claude' provider for error classification (same SDK).
|
|
20687
20538
|
catch: (cause) => new AgentError({
|
|
20688
|
-
provider: engine
|
|
20539
|
+
provider: engine,
|
|
20689
20540
|
kind: "unknown",
|
|
20690
20541
|
cause
|
|
20691
20542
|
})
|
|
@@ -20705,13 +20556,11 @@ function isBuiltinLoopSession(engine, task) {
|
|
|
20705
20556
|
return !!resolve && existsSync3(resolve(task.cwd, task.sessionId));
|
|
20706
20557
|
}
|
|
20707
20558
|
async function readSessionNoHistory(task, engine, builtinLoop) {
|
|
20708
|
-
|
|
20709
|
-
if (engine !== "ollama" && !builtinLoop && !sdkClaude) return false;
|
|
20559
|
+
if (engine !== "ollama" && !builtinLoop && engine !== "claude" && engine !== "codex") return false;
|
|
20710
20560
|
const state = await readJsonFile(getSessionFilePath(task.cwd), {});
|
|
20711
20561
|
return state.noHistories?.[task.sessionId] === true;
|
|
20712
20562
|
}
|
|
20713
20563
|
function sessionPathFor(engine, task) {
|
|
20714
|
-
if (engine === "claude2") return getClaude2SessionPath(task.cwd, task.sessionId);
|
|
20715
20564
|
if (engine === "ollama") return getOllamaSessionPath(task.cwd, task.sessionId);
|
|
20716
20565
|
if (isBuiltinLoopSession(engine, task)) return BUILTIN_LOOP_PATHS[engine](task.cwd, task.sessionId);
|
|
20717
20566
|
const sdkStorePath = SDK_STORE_PATHS[engine];
|
|
@@ -20721,7 +20570,7 @@ function sessionPathFor(engine, task) {
|
|
|
20721
20570
|
}
|
|
20722
20571
|
var sendChatMessageEff = (task) => Effect_exports.gen(function* () {
|
|
20723
20572
|
const engine = task.engine ?? "claude";
|
|
20724
|
-
if (!["claude", "
|
|
20573
|
+
if (!["claude", "ollama", "codex", "kimi", "deepseek", "glm"].includes(engine)) {
|
|
20725
20574
|
return yield* Effect_exports.fail(
|
|
20726
20575
|
new AgentError({
|
|
20727
20576
|
provider: "claude",
|
|
@@ -20733,7 +20582,7 @@ var sendChatMessageEff = (task) => Effect_exports.gen(function* () {
|
|
|
20733
20582
|
if (task.taskFile && !existsSync3(task.taskFile)) {
|
|
20734
20583
|
return yield* Effect_exports.fail(
|
|
20735
20584
|
new AgentError({
|
|
20736
|
-
provider: engine
|
|
20585
|
+
provider: engine,
|
|
20737
20586
|
kind: "unknown",
|
|
20738
20587
|
cause: new Error(`task file not found: ${task.taskFile} (task ${task.id})`)
|
|
20739
20588
|
})
|