@surething/cockpit 1.0.223 → 1.0.225
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 +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- 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_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js +2 -2
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +2 -2
- package/.next-prod/server/app/_not-found.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/api/agent/test/route.js +1 -1
- package/.next-prod/server/app/api/bash/route.js +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js +2 -2
- package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js +2 -2
- package/.next-prod/server/app/api/chat/ollama/route.js +3 -3
- package/.next-prod/server/app/api/chat/pty-input/route.js +1 -1
- package/.next-prod/server/app/api/chat/route.js +2 -2
- package/.next-prod/server/app/api/chat/stop/route.js +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js +1 -1
- package/.next-prod/server/app/api/commands/route.js +1 -1
- package/.next-prod/server/app/api/comments/route.js +1 -1
- package/.next-prod/server/app/api/db/columns/route.js +2 -2
- package/.next-prod/server/app/api/db/connect/route.js +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/db/export/route.js +1 -1
- package/.next-prod/server/app/api/db/query/route.js +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js +1 -1
- package/.next-prod/server/app/api/dev/spans/route.js +1 -1
- package/.next-prod/server/app/api/extension/version/route.js +1 -1
- package/.next-prod/server/app/api/file/route.js +1 -1
- package/.next-prod/server/app/api/files/blame/route.js +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js +1 -1
- package/.next-prod/server/app/api/files/copy/route.js +1 -1
- package/.next-prod/server/app/api/files/delete/route.js +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js +1 -1
- package/.next-prod/server/app/api/files/index/route.js +1 -1
- package/.next-prod/server/app/api/files/init/route.js +1 -1
- package/.next-prod/server/app/api/files/paste/route.js +1 -1
- package/.next-prod/server/app/api/files/read/route.js +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js +1 -1
- package/.next-prod/server/app/api/files/recent/route.js +1 -1
- package/.next-prod/server/app/api/files/save/route.js +1 -1
- package/.next-prod/server/app/api/files/search/route.js +1 -1
- package/.next-prod/server/app/api/files/stat/route.js +1 -1
- package/.next-prod/server/app/api/files/text/route.js +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/branches/route.js +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/commits/route.js +1 -1
- package/.next-prod/server/app/api/git/current-branch/route.js +1 -1
- package/.next-prod/server/app/api/git/diff/route.js +1 -1
- package/.next-prod/server/app/api/git/discard/route.js +1 -1
- package/.next-prod/server/app/api/git/stage/route.js +1 -1
- package/.next-prod/server/app/api/git/status/route.js +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js +1 -1
- package/.next-prod/server/app/api/global-state/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/load/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/save/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route.js +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js +2 -2
- package/.next-prod/server/app/api/mysql/connect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js +2 -2
- package/.next-prod/server/app/api/neo4j/connect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js +1 -1
- package/.next-prod/server/app/api/note/route.js +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js +1 -1
- package/.next-prod/server/app/api/pick-folder/route.js +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
- package/.next-prod/server/app/api/project-settings/route.js +1 -1
- package/.next-prod/server/app/api/project-state/route.js +2 -2
- package/.next-prod/server/app/api/projectGraph/affected/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callees/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callers/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/coedit/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/context/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/impact/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/related/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/risk/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
- package/.next-prod/server/app/api/projects/route.js +1 -1
- package/.next-prod/server/app/api/push/public-key/route.js +1 -1
- package/.next-prod/server/app/api/push/subscribe/route.js +1 -1
- package/.next-prod/server/app/api/push/unsubscribe/route.js +1 -1
- package/.next-prod/server/app/api/redis/command/route.js +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/redis/get/route.js +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js +1 -1
- package/.next-prod/server/app/api/redis/set/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/comments/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js +1 -1
- package/.next-prod/server/app/api/review/identify/route.js +1 -1
- package/.next-prod/server/app/api/review/order/route.js +1 -1
- package/.next-prod/server/app/api/review/route.js +1 -1
- package/.next-prod/server/app/api/review/share-info/route.js +1 -1
- package/.next-prod/server/app/api/review/users/route.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js +1 -1
- package/.next-prod/server/app/api/services/config/route.js +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
- package/.next-prod/server/app/api/sessions/route.js +1 -1
- package/.next-prod/server/app/api/settings/route.js +1 -1
- package/.next-prod/server/app/api/skills/[id]/route.js +1 -1
- package/.next-prod/server/app/api/skills/content/route.js +1 -1
- package/.next-prod/server/app/api/skills/route.js +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js +1 -1
- package/.next-prod/server/app/api/version/route.js +1 -1
- package/.next-prod/server/app/favicon.ico/route.js +1 -1
- package/.next-prod/server/app/m/page.js +2 -2
- 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/page.js +2 -2
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +2 -2
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page.js +2 -2
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +3 -4
- package/.next-prod/server/chunks/2637.js +1 -1
- package/.next-prod/server/chunks/2939.js +1 -1
- package/.next-prod/server/chunks/6955.js +1 -1
- package/.next-prod/server/chunks/7003.js +1 -1
- package/.next-prod/server/chunks/8916.js +1 -1
- package/.next-prod/server/chunks/9658.js +8 -8
- package/.next-prod/server/middleware-build-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/WSUa0F_X_5GfMavORSxeX/_buildManifest.js +1 -0
- package/.next-prod/static/chunks/2576-7459f532e98e12d6.js +25 -0
- package/.next-prod/static/chunks/5156-04537ce3c95435b2.js +3 -0
- package/.next-prod/static/chunks/9469-424d7be830f93183.js +14 -0
- package/.next-prod/static/chunks/app/_global-error/page-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/agent/test/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/bash/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/codex/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/kimi/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/ollama/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/pty-input/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/stop/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/claude-stats/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/commands/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/comments/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/db/columns/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/db/connect/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/db/disconnect/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/db/export/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/db/query/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/db/schemas/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/dev/spans/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/extension/version/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/file/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/blame/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/clipboard/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/copy/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/delete/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/expanded/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/index/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/init/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/paste/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/read/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/readdir/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/recent/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/save/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/search/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/stat/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/files/text/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branches/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commits/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/current-branch/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/diff/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/discard/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/stage/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/status/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/unstage/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/git/worktree/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/global-state/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/load/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/save/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/definition/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/hover/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/references/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/status/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/columns/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/connect/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/export/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/query/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/query/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/note/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/models/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/start/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/open-cursor/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/open-vscode/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/pick-folder/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/project-settings/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/project-state/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/context/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/risk/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/projects/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/push/public-key/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/push/subscribe/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/command/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/connect/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/delete/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/get/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/keys/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/set/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/review/identify/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/review/order/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/review/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/review/share-info/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/review/users/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/services/config/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/services/scripts/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/session-by-path/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/settings/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/[id]/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/content/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/env/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/history/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/api/version/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-cc849cd7b6f01cad.js +1 -0
- package/.next-prod/trace +13 -13
- 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-BM3ZNL5S.mjs → chunk-7T2FX6X4.mjs} +1 -1
- package/dist/{chunk-5BOGGUGT.mjs → chunk-EYFKVFTP.mjs} +9 -0
- package/dist/{chunk-5CRGWEWX.mjs → chunk-WULEYRUC.mjs} +33 -5
- package/dist/httpApi.mjs +2 -2
- package/dist/scheduledTasks.mjs +85 -52
- package/dist/{server-DRMO2DUJ.mjs → server-TRLQURYS.mjs} +2 -2
- package/dist/wsServer.mjs +4 -4
- package/package.json +1 -1
- package/.next-prod/server/app/api/push/test/route.js +0 -1
- package/.next-prod/server/app/api/push/test/route.js.nft.json +0 -1
- package/.next-prod/server/app/api/push/test/route_client-reference-manifest.js +0 -1
- package/.next-prod/static/IQwBHyZ3W2LMUZtDfCp-B/_buildManifest.js +0 -1
- package/.next-prod/static/chunks/2576-02a6e185664e2e1a.js +0 -25
- package/.next-prod/static/chunks/5156-2953531342c13696.js +0 -3
- package/.next-prod/static/chunks/9469-fb5c6f08ba6bab74.js +0 -14
- package/.next-prod/static/chunks/app/_global-error/page-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/agent/test/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/bash/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/codex/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/kimi/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/ollama/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/pty-input/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/stop/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/claude-stats/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/commands/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/comments/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/db/columns/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/db/connect/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/db/disconnect/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/db/export/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/db/query/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/db/schemas/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/dev/spans/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/extension/version/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/file/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/blame/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/clipboard/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/copy/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/delete/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/expanded/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/index/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/init/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/paste/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/read/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/readdir/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/recent/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/save/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/search/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/stat/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/files/text/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branches/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commits/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/current-branch/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/diff/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/discard/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/stage/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/status/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/unstage/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/git/worktree/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/global-state/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/load/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/save/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/definition/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/hover/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/references/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/status/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/columns/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/connect/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/export/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/query/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/query/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/note/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/models/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/start/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/open-cursor/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/open-vscode/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/pick-folder/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/project-settings/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/project-state/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/context/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/risk/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/projects/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/push/public-key/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/push/subscribe/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/push/test/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/command/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/connect/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/delete/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/get/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/keys/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/set/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/review/identify/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/review/order/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/review/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/review/share-info/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/review/users/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/services/config/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/services/scripts/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/session-by-path/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/settings/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/[id]/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/content/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/env/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/history/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/api/version/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-422b501ed5769a87.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-422b501ed5769a87.js +0 -1
- package/.next-prod/types/app/api/push/test/route.ts +0 -351
- /package/.next-prod/static/{IQwBHyZ3W2LMUZtDfCp-B → WSUa0F_X_5GfMavORSxeX}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=8834,a.ids=[8834],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},6727:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D9:()=>o,LO:()=>n,OR:()=>l,SJ:()=>p,fA:()=>k,fG:()=>m});var e=c(89705),f=c(56825),g=c(72891),h=c(770),i=c(88503),j=a([g,i,f]);[g,i,f]=j.then?(await j)():j;let k="nodejs",l="force-dynamic",m=(0,g.RL)(()=>e.JkU(function*(){let a=yield*i.Uu;return(0,g.ok)(a)})),n=(0,g.RL)(a=>e.JkU(function*(){let b,{cwd:c,tabId:d,sessionId:j,engine:k,model:l,message:m,type:n,delayMinutes:o,intervalMinutes:p,activeFrom:q,activeTo:r,cron:s}=yield*(0,g.k9)(a);if(!c||!d||!j||!m||!n)return yield*e.fJG(new h.yI({field:"cwd|tabId|sessionId|message|type",reason:"missing"}));if(k&&!["claude","claude2","ollama","codex","kimi","deepseek"].includes(k))return yield*e.fJG(new h.yI({field:"engine",reason:`unknown engine '${k}'`}));let t=Date.now();if("once"===n&&o)b=t+6e4*o;else if("interval"===n&&p)b=t+6e4*p;else{if("cron"!==n||!s)return yield*e.fJG(new h.yI({field:"type|timeConfig",reason:"Invalid type or missing time config"}));b=(0,f.$_)(s)}let u={id:`task-${t}-${Math.random().toString(36).slice(2,8)}`,cwd:c,tabId:d,sessionId:j,engine:k,model:"ollama"===k||"deepseek"===k?l:void 0,message:m,type:n,delayMinutes:"once"===n?o:void 0,intervalMinutes:"interval"===n?p:void 0,activeFrom:"interval"===n?q:void 0,activeTo:"interval"===n?r:void 0,cron:"cron"===n?s:void 0,nextFireTime:b,paused:!1,createdAt:t},v=yield*(0,i.sP)(u);return(0,g.ok)({task:v})})),o=(0,g.RL)(a=>e.JkU(function*(){let{id:b,action:c,fields:d}=yield*(0,g.k9)(a);if(!b)return yield*e.fJG(new h.yI({field:"id",reason:"missing"}));let f=yield*(0,i.ex)(b,c,d);return f.simpleSuccess?(0,g.ok)({success:!0}):(0,g.ok)({task:f.task})})),p=(0,g.RL)(a=>e.JkU(function*(){let b=yield*(0,g.k9)(a);return b.id?(yield*(0,i.OT)(b.id),(0,g.ok)({success:!0})):yield*e.fJG(new h.yI({field:"id",reason:"missing"}))}));d()}catch(a){d(a)}})},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27619:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(38616),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/scheduled-tasks/route",pathname:"/api/scheduled-tasks",filename:"route",bundlePath:"app/api/scheduled-tasks/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/scheduled-tasks/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/scheduled-tasks/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},38616:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>e.SJ,GET:()=>e.fG,PATCH:()=>e.D9,POST:()=>e.LO,dynamic:()=>e.OR,runtime:()=>e.fA});var e=c(6727),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51181:a=>{a.exports=require("web-push")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},56825:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$_:()=>o,_u:()=>s});var e=c(29021),f=c(7939),g=c(79830),h=c(82940),i=c(89705),j=c(770),k=c(8155),l=c(94506),m=a([l]);function n(a,b,c){let d=[];for(let e of a.split(","))if("*"===e)for(let a=b;a<=c;a++)d.push(a);else if(e.includes("/")){let[a,f]=e.split("/"),g=parseInt(f,10),h="*"===a?b:parseInt(a,10);for(let a=h;a<=c;a+=g)d.push(a)}else if(e.includes("-")){let[a,b]=e.split("-").map(Number);for(let c=a;c<=b;c++)d.push(c)}else d.push(parseInt(e,10));return d}function o(a,b=new Date){let c=a.trim().split(/\s+/);if(5!==c.length)return b.getTime()+6e4;let d=n(c[0],0,59),e=n(c[1],0,23),f=n(c[2],1,31),g=n(c[3],1,12),h=n(c[4],0,6),i=new Date(b);i.setSeconds(0,0),i.setMinutes(i.getMinutes()+1);for(let a=0;a<527040;a++){let a=i.getMinutes(),b=i.getHours(),c=i.getDate(),j=i.getMonth()+1,k=i.getDay();if(d.includes(a)&&e.includes(b)&&f.includes(c)&&g.includes(j)&&h.includes(k))return i.getTime();i.setMinutes(i.getMinutes()+1)}return b.getTime()+864e5}async function p(a){return l.s9.runPromise(i.JkU(function*(){let b=a.engine??"claude";if(!["claude","claude2","ollama","codex","kimi","deepseek"].includes(b))return yield*i.fJG(new j.Yv({provider:"claude",kind:"unsupported-engine",cause:Error(`scheduled tasks not supported for engine '${b}' (task ${a.id})`)}));let c="claude2"===b?(0,f.oZ)(a.cwd,a.sessionId):"ollama"===b?(0,f.yw)(a.cwd,a.sessionId):"deepseek"===b?(0,f.im)(a.cwd,a.sessionId):"codex"===b?(0,f.eg)(a.sessionId):"kimi"===b?(0,f.vI)(a.sessionId):(0,f.Kk)(a.cwd,a.sessionId);return c&&(0,e.existsSync)(c)?yield*i.$mh({try:async()=>{let c="claude"===b||"claude2"===b?`http://127.0.0.1:${a.port}/api/chat`:`http://127.0.0.1:${a.port}/api/chat/${b}`,d=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a.message,sessionId:a.sessionId,cwd:a.cwd,engine:b,...a.model&&{model:a.model}})});if(!d.ok)throw Error(`${b} chat route responded ${d.status}`);let e=await d.json().catch(()=>({}));if(!e.runKey)throw Error(`${b} chat route returned no runKey (session ${a.sessionId})`);let f=e.runKey,g=Date.now()+18e5;for(;(0,h.yQ)(f)&&Date.now()<g;)await new Promise(a=>setTimeout(a,500));if((0,h.yQ)(f))throw(0,h.Y6)(f),Error(`${b} run timed out after 30m (session ${a.sessionId})`);let i=(0,h.Si)(f);if(!i||"error"===i.status)throw Error(`${b} run failed (session ${a.sessionId})`);return!0},catch:a=>new j.Yv({provider:"claude2"===b?"claude":b,kind:"unknown",cause:a})}):yield*i.fJG(new j.Yv({provider:"claude2"===b?"claude":b,kind:"session-not-found",cause:Error(`session file missing: ${c??`(no session for ${a.sessionId})`} (task ${a.id}, engine ${b})`)}))}).pipe(i.h9N(b=>i.JkU(function*(){return console.error(`[ScheduledTask] Failed to send message for task ${a.id}:`,b),yield*i.$mh(()=>(0,g.CS)(a.cwd,a.sessionId,"unread")).pipe(i.NWQ(()=>i.rIH)),!1}))))}l=(m.then?(await m)():m)[0];class q{getPort(){if(this.port)return this.port;let a=l.s9.runSync(k.c);return this.port=a.port,this.port}async ensureInit(){if(this.initialized)return;if(this.initPromise)return this.initPromise;let a=this.getPort();if(a)return this.initPromise=this.init(a),this.initPromise}async init(a){if(this.initialized)return;this.port=a,this.initialized=!0;let b=await (0,f.JE)(f.iK,[]);for(let c of(this.tasks=b.filter(b=>b.port===a),console.log(`[ScheduledTaskManager] Loaded ${this.tasks.length} tasks for port ${a}`),this.tasks))c.paused||c.completed||this.scheduleTask(c);await this.saveToDisk()}setOnTaskFired(a){this.onTaskFired=a}async readTasksFromDisk(){let a=this.getPort();return a?(await (0,f.JE)(f.iK,[])).filter(b=>b.port===a):[]}async getTasks(){await this.ensureInit();let a=await this.readTasksFromDisk();return a.sort((a,b)=>(a.sortIndex??a.createdAt)-(b.sortIndex??b.createdAt)),a}async getUnreadCount(){return await this.ensureInit(),(await this.readTasksFromDisk()).filter(a=>a.unread).length}async addTask(a){await this.ensureInit();let b={...a,port:this.getPort()},c=await (0,f.JE)(f.iK,[]);return c.push(b),await (0,f.An)(f.iK,c),this.tasks.push(b),b.paused||b.completed||this.scheduleTask(b),b}async updateTask(a,b){await this.ensureInit();let c=await (0,f.JE)(f.iK,[]),d=c.findIndex(b=>b.id===a);if(-1===d)return null;let e={...c[d],...b};c[d]=e,await (0,f.An)(f.iK,c);let g=this.tasks.findIndex(b=>b.id===a);return -1!==g&&(this.tasks[g]=e,this.clearTimer(a),e.paused||e.completed||this.scheduleTask(e)),e}async deleteTask(a){await this.ensureInit();let b=await (0,f.JE)(f.iK,[]),c=b.findIndex(b=>b.id===a);if(-1===c)return!1;b.splice(c,1),await (0,f.An)(f.iK,b);let d=this.tasks.findIndex(b=>b.id===a);return -1!==d&&(this.clearTimer(a),this.tasks.splice(d,1)),!0}async pauseTask(a){return this.updateTask(a,{paused:!0})}async resumeTask(a){let b=(await (0,f.JE)(f.iK,[])).find(b=>b.id===a);if(!b)return null;let c=Date.now(),d=b.nextFireTime;return d<=c&&(d="interval"===b.type&&b.intervalMinutes?c+6e4*b.intervalMinutes:"cron"===b.type&&b.cron?o(b.cron):c+6e4),this.updateTask(a,{paused:!1,nextFireTime:d})}async triggerTask(a){await this.ensureInit();let b=(await (0,f.JE)(f.iK,[])).find(b=>b.id===a);if(!b)return;let c=this.tasks.findIndex(b=>b.id===a);-1!==c?this.tasks[c]=b:this.tasks.push(b),this.fireTaskManual(a).catch(b=>{console.error(`[ScheduledTask] Manual trigger failed for ${a}:`,b)})}async fireTaskManual(a){if(this.firing.has(a))return void console.warn(`[ScheduledTask] Skipping manual trigger of ${a}: still in flight`);let b=this.tasks.find(b=>b.id===a);if(b){console.log(`[ScheduledTask] Manual trigger ${a}: "${b.message}"`),this.firing.add(a);try{let a=await p(b);b.lastFiredAt=Date.now(),b.lastResult=a?"success":"error",b.unread=!0,await this.saveToDisk(),this.onTaskFired&&this.onTaskFired(b)}finally{this.firing.delete(a)}}}async markRead(a){await this.updateTask(a,{unread:!1})}async markReadBySessionId(a){await this.ensureInit();let b=this.getPort(),c=await (0,f.JE)(f.iK,[]),d=!1;for(let e of c)e.port===b&&e.sessionId===a&&e.unread&&(e.unread=!1,d=!0);d&&await (0,f.An)(f.iK,c)}async markAllRead(){await this.ensureInit();let a=this.getPort(),b=await (0,f.JE)(f.iK,[]),c=!1;for(let d of b)d.port===a&&d.unread&&(d.unread=!1,c=!0);c&&await (0,f.An)(f.iK,b)}async reorderTasks(a){await this.ensureInit();let b=await (0,f.JE)(f.iK,[]);for(let c=0;c<a.length;c++){let d=b.find(b=>b.id===a[c]);d&&(d.sortIndex=c)}await (0,f.An)(f.iK,b)}scheduleTask(a){let b=Date.now();if(a.nextFireTime<=b)if("interval"===a.type&&a.intervalMinutes)a.nextFireTime=b+6e4*a.intervalMinutes;else{if("cron"!==a.type||!a.cron)return a.completed=!0,!1;a.nextFireTime=o(a.cron)}this.clearTimer(a.id);let c=a.nextFireTime-b,d=setTimeout(()=>{this.fireTask(a.id)},c);return this.timers.set(a.id,d),!0}clearTimer(a){let b=this.timers.get(a);b&&(clearTimeout(b),this.timers.delete(a))}isInActiveRange(a){if("interval"!==a.type||!a.activeFrom||!a.activeTo)return!0;let b=new Date,[c,d]=a.activeFrom.split(":").map(Number),[e,f]=a.activeTo.split(":").map(Number),g=60*b.getHours()+b.getMinutes(),h=60*c+d,i=60*e+f;return h<=i?g>=h&&g<=i:g>=h||g<=i}async fireTask(a){if(this.firing.has(a))return void console.warn(`[ScheduledTask] Skipping reentrant fire of ${a}: still in flight`);let b=this.tasks.find(b=>b.id===a);if(b&&!b.paused){if(!this.isInActiveRange(b)){console.log(`[ScheduledTask] Skipping task ${a}: outside active range ${b.activeFrom}-${b.activeTo}`),"interval"===b.type&&b.intervalMinutes&&(b.nextFireTime=Date.now()+6e4*b.intervalMinutes,this.scheduleTask(b),await this.saveToDisk());return}console.log(`[ScheduledTask] Firing task ${a}: "${b.message}"`),this.firing.add(a);try{let a=await p(b);b.lastFiredAt=Date.now(),b.lastResult=a?"success":"error",b.unread=!0,"once"===b.type?b.completed=!0:"interval"===b.type&&b.intervalMinutes?(b.nextFireTime=Date.now()+6e4*b.intervalMinutes,this.scheduleTask(b)):"cron"===b.type&&b.cron&&(b.nextFireTime=o(b.cron),this.scheduleTask(b)),await this.saveToDisk(),this.onTaskFired&&this.onTaskFired(b)}finally{this.firing.delete(a)}}}async saveToDisk(){try{let a=(await (0,f.JE)(f.iK,[])).filter(a=>a.port!==this.port);await (0,f.An)(f.iK,[...a,...this.tasks])}catch(a){console.error("[ScheduledTaskManager] Failed to save:",a)}}constructor(){this.tasks=[],this.timers=new Map,this.firing=new Set,this.port=0,this.initialized=!1,this.initPromise=null,this.onTaskFired=null}}let r=globalThis,s=r.__scheduledTaskManager??(r.__scheduledTaskManager=new q);d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},79830:(a,b,c)=>{c.d(b,{CS:()=>j,Pn:()=>k,j8:()=>n});var d=c(7939),e=c(29021),f=c(4984),g=c(33873),h=c(38433);function i(a){if(!a)return a;let b=[...a];return b.length<=50?a:b.slice(0,50).join("")+"…"}async function j(a,b,c,f,j){if((0,e.existsSync)(a))return(0,d.Ux)(d.v4,async()=>{let e=await (0,d.JE)(d.v4,{sessions:[]});for(let a of e.sessions)a.status||(a.status=a.isLoading?"loading":"normal",delete a.isLoading);let k=e.sessions.findIndex(c=>c.cwd===a&&c.sessionId===b),l=k>=0?e.sessions[k]:void 0,n={cwd:a,sessionId:b,lastActive:Date.now(),status:c,title:i(f||l?.title),lastUserMessage:i(j||l?.lastUserMessage)};k>=0?e.sessions[k]=n:e.sessions.push(n),e.sessions.sort((a,b)=>b.lastActive-a.lastActive),e.sessions=e.sessions.slice(0,15),await (0,d.An)(d.v4,e),"unread"===c&&l?.status!=="unread"&&(async()=>{let c=await m(a,b).catch(()=>void 0)||n.lastUserMessage;await (0,h.SG)({title:(0,g.basename)(a)||"Cockpit",body:i(c)||n.title||"",data:{cwd:a,sessionId:b}})})().catch(()=>{})})}async function k(a,b){let c=(0,d.Kk)(a,b);if((0,e.existsSync)(c))return q(c);let f=(0,d.oZ)(a,b);if((0,e.existsSync)(f))return q(f);let g=(0,d.yw)(a,b);if((0,e.existsSync)(g))return q(g);let h=(0,d.eg)(b);if(h&&(0,e.existsSync)(h))return await t(h)||"Untitled Session";let i=(0,d.vI)(b);return i&&(0,e.existsSync)(i)&&await v(i)||"Untitled Session"}async function l(a,b){let c=(0,d.Kk)(a,b);if((0,e.existsSync)(c))return await r(c);let f=(0,d.oZ)(a,b);if((0,e.existsSync)(f))return await r(f);let g=(0,d.yw)(a,b);if((0,e.existsSync)(g))return await r(g);let h=(0,d.eg)(b);if(h&&(0,e.existsSync)(h))return await s(h);let i=(0,d.vI)(b);return i&&(0,e.existsSync)(i)?await u(i):[]}async function m(a,b){let c=await l(a,b);return c[c.length-1]}async function n(a,b){let c=await l(a,b),d=c[c.length-1];return c.length<=10?{lastUserMessage:d,firstMessages:c.map(a=>i(a)),lastMessages:[]}:{lastUserMessage:d,firstMessages:c.slice(0,5).map(a=>i(a)),lastMessages:c.slice(-5).map(a=>i(a))}}function o(a){let b=a.replace(/<command-[^>]*>[\s\S]*?<\/command-[^>]*>/g,"");return(b=b.replace(/<local-command-[^>]*>[\s\S]*?<\/local-command-[^>]*>/g,"")).trim()}function p(a){return!(a.startsWith("This session is being continued")||a.startsWith("Caveat: The messages below"))&&!!a.trim()}async function q(a){try{let d=(0,e.createReadStream)(a),g=(0,f.createInterface)({input:d,crlfDelay:1/0}),h="",i=[];for await(let a of g)if(a.trim())try{let b=JSON.parse(a);if("summary"===b.type&&b.summary&&(h=b.summary),"user"===b.type){let a=b.message;if(!a?.content)continue;if("string"==typeof a.content)i.push(a.content);else if(Array.isArray(a.content))for(let b of a.content)"text"===b.type&&b.text&&i.push(b.text)}}catch{}var b=h,c=i;if(b)return b;let j="";for(let a of c){let b=o(a);if(b){if(b.startsWith("/")&&!j){j=b;continue}if(j)return`${j} ${b}`;return b}}return j||"Untitled Session"}catch{return"Untitled Session"}}async function r(a){let b=[];try{let c=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:c,crlfDelay:1/0}))if(a.trim())try{let c=JSON.parse(a);if("user"!==c.type)continue;let d=c.message;if(!d?.content)continue;let e="";if("string"==typeof d.content)e=d.content;else if(Array.isArray(d.content)){for(let a of d.content)if("text"===a.type&&a.text){e=a.text;break}}if(!e)continue;let f=o(e);f&&p(f)&&b.push(f)}catch{}}catch{}return b}async function s(a){let b=[];try{let c=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:c,crlfDelay:1/0})){let c;if(!a.trim())continue;try{c=JSON.parse(a)}catch{continue}if("response_item"!==c.type)continue;let d=c.payload;if(!d||"message"!==d.type||"user"!==d.role)continue;let e=d.content?.filter(a=>"input_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(!e||e.startsWith("<")||e.startsWith("#"))continue;let f=o(e);f&&p(f)&&b.push(f)}}catch{}return b}async function t(a){try{let b=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:b,crlfDelay:1/0})){let b;if(!a.trim())continue;try{b=JSON.parse(a)}catch{continue}if("response_item"!==b.type)continue;let c=b.payload;if(!c||"message"!==c.type||"user"!==c.role)continue;let d=c.content?.filter(a=>"input_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(!(!d||d.startsWith("<")||d.startsWith("#")))return d.slice(0,80)}return}catch{return}}async function u(a){let b=[];try{let c=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:c,crlfDelay:1/0})){let c;if(!a.trim())continue;try{c=JSON.parse(a)}catch{continue}if("user"!==c.role)continue;let d="string"==typeof c.content?c.content:Array.isArray(c.content)?c.content.filter(a=>("input_text"===a.type||"text"===a.type)&&a.text).map(a=>a.text).join(""):"";if(!d||d.startsWith("<system")||d.startsWith("<environment")||d.startsWith("# AGENTS.md")||d.startsWith("<permissions"))continue;let e=o(d);e&&p(e)&&b.push(e)}}catch{}return b}async function v(a){try{let b=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:b,crlfDelay:1/0})){let b;if(!a.trim())continue;try{b=JSON.parse(a)}catch{continue}if("user"!==b.role)continue;let c="string"==typeof b.content?b.content:Array.isArray(b.content)?b.content.filter(a=>("input_text"===a.type||"text"===a.type)&&a.text).map(a=>a.text).join(""):"";if(!(!c||c.startsWith("<system")||c.startsWith("<environment")||c.startsWith("# AGENTS.md")||c.startsWith("<permissions")))return c.slice(0,80)}return}catch{return}}},82940:(a,b,c)=>{c.d(b,{AD:()=>j,GS:()=>l,HS:()=>m,Si:()=>n,Y6:()=>q,ah:()=>k,e5:()=>p,yQ:()=>o});let d=globalThis,e=d.__cockpitRunRegistry??(d.__cockpitRunRegistry=new Map),f=d.__cockpitRunListeners??(d.__cockpitRunListeners=new Map),g=d.__cockpitRunSeqByKey??(d.__cockpitRunSeqByKey=new Map);function h(a){for(let b of(a.seq+=1,a.keys))g.set(b,a.seq);return a.seq}function i(a,b){for(let c of a.keys){let a=f.get(c);if(a)for(let c of a)try{c(b)}catch{}}}function j(a,b,c){let d=e.get(a),f=d?.seq??g.get(a)??0;if(d)for(let a of(d.evictTimer&&clearTimeout(d.evictTimer),d.keys))e.delete(a);e.set(a,{keys:new Set([a]),cwd:b,status:"running",seq:f,events:[],updatedAt:Date.now()}),c&&k(a,{type:"user",_human:!0,message:{role:"user",content:c}})}function k(a,b){let c=e.get(a);c&&"running"===c.status&&(h(c),c.events.push(b),c.updatedAt=Date.now(),i(c,{seq:c.seq,message:b}))}function l(a,b){if(a===b)return;let c=e.get(a);c&&(c.keys.add(b),e.set(b,c))}function m(a,b="idle"){let c=e.get(a);if(c){if("running"!==c.status){"idle"===c.status&&"error"===b&&(c.status="error");return}c.status=b,c.updatedAt=Date.now(),h(c),i(c,{seq:c.seq,message:{type:"run-ended",status:b}}),c.evictTimer&&clearTimeout(c.evictTimer),c.evictTimer=setTimeout(()=>{for(let a of c.keys)e.delete(a)},6e4)}}function n(a){let b=e.get(a);return b?{status:b.status,seq:b.seq,events:b.events.slice()}:null}function o(a){return e.get(a)?.status==="running"}function p(a,b){let c=e.get(a);c&&(c.abort=b)}function q(a){let b=e.get(a);if(!b)return!1;try{b.abort?.()}catch{}return k(a,{type:"result",subtype:"stopped"}),m(a,"idle"),!0}},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88503:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OT:()=>n,Uu:()=>k,ex:()=>p,sP:()=>l});var e=c(89705),f=c(770),g=c(56825),h=a([g]);g=(h.then?(await h)():h)[0];let i=e.$mh({try:()=>g._u.getTasks(),catch:a=>new f.uV({message:"scheduler.getTasks failed",cause:a})}),j=e.$mh({try:()=>g._u.getUnreadCount(),catch:a=>new f.uV({message:"scheduler.getUnreadCount failed",cause:a})}),k=e.JkU(function*(){let a=yield*i,b=yield*j;return{tasks:a,unreadCount:b}}).pipe(e.DM4(()=>({tasks:[],unreadCount:0}))),l=a=>e.$mh({try:()=>g._u.addTask(a),catch:a=>new f.uV({message:"scheduler.addTask failed",cause:a})}),m=(a,b)=>e.$mh({try:()=>g._u.updateTask(a,b),catch:a=>new f.uV({message:"scheduler.updateTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))),n=a=>e.$mh({try:()=>g._u.deleteTask(a),catch:a=>new f.uV({message:"scheduler.deleteTask failed",cause:a})}).pipe(e.qIB(b=>b?e.rIH:e.fJG(new f.m_({resource:"task",id:a})))),o=e.$mh({try:()=>g._u.markAllRead(),catch:a=>new f.uV({message:"scheduler.markAllRead failed",cause:a})}),p=(a,b,c)=>{if("pause"===b)return e.$mh({try:()=>g._u.pauseTask(a),catch:a=>new f.uV({message:"scheduler.pauseTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})));if("resume"===b)return e.$mh({try:()=>g._u.resumeTask(a),catch:a=>new f.uV({message:"scheduler.resumeTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})));if("trigger"===b)return e.$mh({try:()=>g._u.triggerTask(a),catch:a=>new f.uV({message:"scheduler.triggerTask failed",cause:a})}).pipe(e.as({task:null,simpleSuccess:!0}));if("markRead"===b)return e.$mh({try:()=>g._u.markRead(a),catch:a=>new f.uV({message:"scheduler.markRead failed",cause:a})}).pipe(e.as({task:null,simpleSuccess:!0}));if("markReadBySessionId"===b&&"string"==typeof c?.sessionId){let a;return(a=c.sessionId,e.$mh({try:()=>g._u.markReadBySessionId(a),catch:a=>new f.uV({message:"scheduler.markReadBySessionId failed",cause:a})})).pipe(e.as({task:null,simpleSuccess:!0}))}if("markAllRead"===b)return o.pipe(e.as({task:null,simpleSuccess:!0}));if("reorder"===b&&Array.isArray(c?.orderedIds)){let a;return(a=c.orderedIds,e.$mh({try:()=>g._u.reorderTasks([...a]),catch:a=>new f.uV({message:"scheduler.reorderTasks failed",cause:a})})).pipe(e.as({task:null,simpleSuccess:!0}))}if("update"===b&&c){let b=Date.now(),d={...c};return"once"===c.type&&c.delayMinutes?(d.nextFireTime=b+6e4*c.delayMinutes,d.completed=!1):"interval"===c.type&&c.intervalMinutes?d.nextFireTime=b+6e4*c.intervalMinutes:"cron"===c.type&&c.cron&&(d.nextFireTime=(0,g.$_)(c.cron)),d.paused=!1,m(a,d).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})))}return c?m(a,c).pipe(e.TjK(a=>({task:a,simpleSuccess:!1}))):e.PyW({task:null,simpleSuccess:!1})};d()}catch(a){d(a)}})},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304,7003],()=>b(b.s=27619));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=8834,a.ids=[8834],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},6727:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D9:()=>o,LO:()=>n,OR:()=>l,SJ:()=>p,fA:()=>k,fG:()=>m});var e=c(89705),f=c(56825),g=c(72891),h=c(770),i=c(88503),j=a([g,i,f]);[g,i,f]=j.then?(await j)():j;let k="nodejs",l="force-dynamic",m=(0,g.RL)(()=>e.JkU(function*(){let a=yield*i.Uu;return(0,g.ok)(a)})),n=(0,g.RL)(a=>e.JkU(function*(){let b,{cwd:c,tabId:d,sessionId:j,engine:k,model:l,message:m,type:n,delayMinutes:o,intervalMinutes:p,activeFrom:q,activeTo:r,cron:s}=yield*(0,g.k9)(a);if(!c||!d||!j||!m||!n)return yield*e.fJG(new h.yI({field:"cwd|tabId|sessionId|message|type",reason:"missing"}));if(k&&!["claude","claude2","ollama","codex","kimi","deepseek"].includes(k))return yield*e.fJG(new h.yI({field:"engine",reason:`unknown engine '${k}'`}));let t=Date.now();if("once"===n&&o)b=t+6e4*o;else if("interval"===n&&p)b=t+6e4*p;else{if("cron"!==n||!s)return yield*e.fJG(new h.yI({field:"type|timeConfig",reason:"Invalid type or missing time config"}));b=(0,f.$_)(s)}let u={id:`task-${t}-${Math.random().toString(36).slice(2,8)}`,cwd:c,tabId:d,sessionId:j,engine:k,model:"ollama"===k||"deepseek"===k?l:void 0,message:m,type:n,delayMinutes:"once"===n?o:void 0,intervalMinutes:"interval"===n?p:void 0,activeFrom:"interval"===n?q:void 0,activeTo:"interval"===n?r:void 0,cron:"cron"===n?s:void 0,nextFireTime:b,paused:!1,createdAt:t},v=yield*(0,i.sP)(u);return(0,g.ok)({task:v})})),o=(0,g.RL)(a=>e.JkU(function*(){let{id:b,action:c,fields:d}=yield*(0,g.k9)(a);if(!b)return yield*e.fJG(new h.yI({field:"id",reason:"missing"}));let f=yield*(0,i.ex)(b,c,d);return f.simpleSuccess?(0,g.ok)({success:!0}):(0,g.ok)({task:f.task})})),p=(0,g.RL)(a=>e.JkU(function*(){let b=yield*(0,g.k9)(a);return b.id?(yield*(0,i.OT)(b.id),(0,g.ok)({success:!0})):yield*e.fJG(new h.yI({field:"id",reason:"missing"}))}));d()}catch(a){d(a)}})},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},38616:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>e.SJ,GET:()=>e.fG,PATCH:()=>e.D9,POST:()=>e.LO,dynamic:()=>e.OR,runtime:()=>e.fA});var e=c(6727),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51181:a=>{a.exports=require("web-push")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},56825:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$_:()=>o,_u:()=>s});var e=c(29021),f=c(7939),g=c(79830),h=c(82940),i=c(89705),j=c(770),k=c(8155),l=c(94506),m=a([l]);function n(a,b,c){let d=[];for(let e of a.split(","))if("*"===e)for(let a=b;a<=c;a++)d.push(a);else if(e.includes("/")){let[a,f]=e.split("/"),g=parseInt(f,10),h="*"===a?b:parseInt(a,10);for(let a=h;a<=c;a+=g)d.push(a)}else if(e.includes("-")){let[a,b]=e.split("-").map(Number);for(let c=a;c<=b;c++)d.push(c)}else d.push(parseInt(e,10));return d}function o(a,b=new Date){let c=a.trim().split(/\s+/);if(5!==c.length)return b.getTime()+6e4;let d=n(c[0],0,59),e=n(c[1],0,23),f=n(c[2],1,31),g=n(c[3],1,12),h=n(c[4],0,6),i=new Date(b);i.setSeconds(0,0),i.setMinutes(i.getMinutes()+1);for(let a=0;a<527040;a++){let a=i.getMinutes(),b=i.getHours(),c=i.getDate(),j=i.getMonth()+1,k=i.getDay();if(d.includes(a)&&e.includes(b)&&f.includes(c)&&g.includes(j)&&h.includes(k))return i.getTime();i.setMinutes(i.getMinutes()+1)}return b.getTime()+864e5}async function p(a){return l.s9.runPromise(i.JkU(function*(){let b=a.engine??"claude";if(!["claude","claude2","ollama","codex","kimi","deepseek"].includes(b))return yield*i.fJG(new j.Yv({provider:"claude",kind:"unsupported-engine",cause:Error(`scheduled tasks not supported for engine '${b}' (task ${a.id})`)}));let c="claude2"===b?(0,f.oZ)(a.cwd,a.sessionId):"ollama"===b?(0,f.yw)(a.cwd,a.sessionId):"deepseek"===b?(0,f.im)(a.cwd,a.sessionId):"codex"===b?(0,f.eg)(a.sessionId):"kimi"===b?(0,f.vI)(a.sessionId):(0,f.Kk)(a.cwd,a.sessionId),d=!c||!(0,e.existsSync)(c);return d&&console.warn(`[ScheduledTask] resume session missing (${c??`no session for ${a.sessionId}`}) for task ${a.id}, engine ${b}; starting a fresh session`),yield*i.$mh({try:async()=>{let c="claude"===b||"claude2"===b?`http://127.0.0.1:${a.port}/api/chat`:`http://127.0.0.1:${a.port}/api/chat/${b}`,e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a.message,...d?{}:{sessionId:a.sessionId},cwd:a.cwd,engine:b,...a.model&&{model:a.model}})});if(!e.ok)throw Error(`${b} chat route responded ${e.status}`);let f=await e.json().catch(()=>({}));if(!f.runKey)throw Error(`${b} chat route returned no runKey (session ${a.sessionId})`);let g=f.runKey,i=Date.now()+18e5;for(;(0,h.yQ)(g)&&Date.now()<i;)await new Promise(a=>setTimeout(a,500));if((0,h.yQ)(g))throw(0,h.Y6)(g),Error(`${b} run timed out after 30m (session ${a.sessionId})`);let j=(0,h.Si)(g);if(!j||"error"===j.status)throw Error(`${b} run failed (session ${a.sessionId})`);if(d){let b=(0,h.j$)(g);b&&b!==a.sessionId&&(console.warn(`[ScheduledTask] task ${a.id}: rebound session ${a.sessionId} → ${b}`),a.sessionId=b)}return!0},catch:a=>new j.Yv({provider:"claude2"===b?"claude":b,kind:"unknown",cause:a})})}).pipe(i.h9N(b=>i.JkU(function*(){return console.error(`[ScheduledTask] Failed to send message for task ${a.id}:`,b),yield*i.$mh(()=>(0,g.CS)(a.cwd,a.sessionId,"unread")).pipe(i.NWQ(()=>i.rIH)),!1}))))}l=(m.then?(await m)():m)[0];class q{getPort(){if(this.port)return this.port;let a=l.s9.runSync(k.c);return this.port=a.port,this.port}async ensureInit(){if(this.initialized)return;if(this.initPromise)return this.initPromise;let a=this.getPort();if(a)return this.initPromise=this.init(a),this.initPromise}async init(a){if(this.initialized)return;this.port=a,this.initialized=!0;let b=await (0,f.JE)(f.iK,[]);for(let c of(this.tasks=b.filter(b=>b.port===a),console.log(`[ScheduledTaskManager] Loaded ${this.tasks.length} tasks for port ${a}`),this.tasks))c.paused||c.completed||this.scheduleTask(c);await this.saveToDisk()}setOnTaskFired(a){this.onTaskFired=a}async readTasksFromDisk(){let a=this.getPort();return a?(await (0,f.JE)(f.iK,[])).filter(b=>b.port===a):[]}async getTasks(){await this.ensureInit();let a=await this.readTasksFromDisk();return a.sort((a,b)=>(a.sortIndex??a.createdAt)-(b.sortIndex??b.createdAt)),a}async getUnreadCount(){return await this.ensureInit(),(await this.readTasksFromDisk()).filter(a=>a.unread).length}async addTask(a){await this.ensureInit();let b={...a,port:this.getPort()};return await (0,f.N9)(f.iK,[],a=>[...a,b]),this.tasks.push(b),b.paused||b.completed||this.scheduleTask(b),b}async updateTask(a,b){await this.ensureInit();let c=await (0,f.Ux)(f.iK,async()=>{let c=await (0,f.JE)(f.iK,[]),d=c.findIndex(b=>b.id===a);if(-1===d)return null;let e={...c[d],...b};return c[d]=e,await (0,f.An)(f.iK,c),e});if(!c)return null;let d=this.tasks.findIndex(b=>b.id===a);return -1!==d&&(this.tasks[d]=c,this.clearTimer(a),c.paused||c.completed||this.scheduleTask(c)),c}async deleteTask(a){if(await this.ensureInit(),!await (0,f.Ux)(f.iK,async()=>{let b=await (0,f.JE)(f.iK,[]),c=b.findIndex(b=>b.id===a);return -1!==c&&(b.splice(c,1),await (0,f.An)(f.iK,b),!0)}))return!1;let b=this.tasks.findIndex(b=>b.id===a);return -1!==b&&(this.clearTimer(a),this.tasks.splice(b,1)),!0}async pauseTask(a){return this.updateTask(a,{paused:!0})}async resumeTask(a){let b=(await (0,f.JE)(f.iK,[])).find(b=>b.id===a);if(!b)return null;let c=Date.now(),d=b.nextFireTime;return d<=c&&(d="interval"===b.type&&b.intervalMinutes?c+6e4*b.intervalMinutes:"cron"===b.type&&b.cron?o(b.cron):c+6e4),this.updateTask(a,{paused:!1,nextFireTime:d,consecutiveFailures:0})}async triggerTask(a){await this.ensureInit();let b=(await (0,f.JE)(f.iK,[])).find(b=>b.id===a);if(!b)return;let c=this.tasks.findIndex(b=>b.id===a);-1!==c?this.tasks[c]=b:this.tasks.push(b),this.fireTaskManual(a).catch(b=>{console.error(`[ScheduledTask] Manual trigger failed for ${a}:`,b)})}async fireTaskManual(a){if(this.firing.has(a))return void console.warn(`[ScheduledTask] Skipping manual trigger of ${a}: still in flight`);let b=this.tasks.find(b=>b.id===a);if(b){console.log(`[ScheduledTask] Manual trigger ${a}: "${b.message}"`),this.firing.add(a);try{let a=await p(b);b.lastFiredAt=Date.now(),b.lastResult=a?"success":"error",b.consecutiveFailures=a?0:(b.consecutiveFailures??0)+1,b.unread=!0,await this.saveToDisk(),this.onTaskFired&&this.onTaskFired(b)}finally{this.firing.delete(a)}}}async markRead(a){await this.updateTask(a,{unread:!1})}async markReadBySessionId(a){await this.ensureInit();let b=this.getPort();await (0,f.Ux)(f.iK,async()=>{let c=await (0,f.JE)(f.iK,[]),d=!1;for(let e of c)e.port===b&&e.sessionId===a&&e.unread&&(e.unread=!1,d=!0);d&&await (0,f.An)(f.iK,c)})}async markAllRead(){await this.ensureInit();let a=this.getPort();await (0,f.Ux)(f.iK,async()=>{let b=await (0,f.JE)(f.iK,[]),c=!1;for(let d of b)d.port===a&&d.unread&&(d.unread=!1,c=!0);c&&await (0,f.An)(f.iK,b)})}async reorderTasks(a){await this.ensureInit(),await (0,f.Ux)(f.iK,async()=>{let b=await (0,f.JE)(f.iK,[]);for(let c=0;c<a.length;c++){let d=b.find(b=>b.id===a[c]);d&&(d.sortIndex=c)}await (0,f.An)(f.iK,b)})}scheduleTask(a){let b=Date.now();if(a.nextFireTime<=b)if("interval"===a.type&&a.intervalMinutes)a.nextFireTime=b+6e4*a.intervalMinutes;else{if("cron"!==a.type||!a.cron)return a.completed=!0,!1;a.nextFireTime=o(a.cron)}this.clearTimer(a.id);let c=a.nextFireTime-b,d=setTimeout(()=>{this.fireTask(a.id)},c);return this.timers.set(a.id,d),!0}clearTimer(a){let b=this.timers.get(a);b&&(clearTimeout(b),this.timers.delete(a))}isInActiveRange(a){if("interval"!==a.type||!a.activeFrom||!a.activeTo)return!0;let b=new Date,[c,d]=a.activeFrom.split(":").map(Number),[e,f]=a.activeTo.split(":").map(Number),g=60*b.getHours()+b.getMinutes(),h=60*c+d,i=60*e+f;return h<=i?g>=h&&g<=i:g>=h||g<=i}async fireTask(a){if(this.firing.has(a))return void console.warn(`[ScheduledTask] Skipping reentrant fire of ${a}: still in flight`);let b=this.tasks.find(b=>b.id===a);if(b&&!b.paused){if(!this.isInActiveRange(b)){console.log(`[ScheduledTask] Skipping task ${a}: outside active range ${b.activeFrom}-${b.activeTo}`),"interval"===b.type&&b.intervalMinutes&&(b.nextFireTime=Date.now()+6e4*b.intervalMinutes,this.scheduleTask(b),await this.saveToDisk());return}console.log(`[ScheduledTask] Firing task ${a}: "${b.message}"`),this.firing.add(a);try{let c=await p(b);b.lastFiredAt=Date.now(),b.lastResult=c?"success":"error",b.consecutiveFailures=c?0:(b.consecutiveFailures??0)+1,b.unread=!0;let d=!c&&(b.consecutiveFailures??0)>=3;"once"===b.type?b.completed=!0:d?(b.paused=!0,this.clearTimer(a),console.warn(`[ScheduledTask] auto-paused task ${a} after ${b.consecutiveFailures} consecutive failures`)):"interval"===b.type&&b.intervalMinutes?(b.nextFireTime=Date.now()+6e4*b.intervalMinutes,this.scheduleTask(b)):"cron"===b.type&&b.cron&&(b.nextFireTime=o(b.cron),this.scheduleTask(b)),await this.saveToDisk(),this.onTaskFired&&this.onTaskFired(b)}finally{this.firing.delete(a)}}}async saveToDisk(){try{await (0,f.N9)(f.iK,[],a=>[...a.filter(a=>a.port!==this.port),...this.tasks])}catch(a){console.error("[ScheduledTaskManager] Failed to save:",a)}}constructor(){this.tasks=[],this.timers=new Map,this.firing=new Set,this.port=0,this.initialized=!1,this.initPromise=null,this.onTaskFired=null}}let r=globalThis,s=r.__scheduledTaskManager??(r.__scheduledTaskManager=new q);d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},66200:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(38616),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/scheduled-tasks/route",pathname:"/api/scheduled-tasks",filename:"route",bundlePath:"app/api/scheduled-tasks/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/scheduled-tasks/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/scheduled-tasks/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},79830:(a,b,c)=>{c.d(b,{CS:()=>j,Pn:()=>k,j8:()=>n});var d=c(7939),e=c(29021),f=c(4984),g=c(33873),h=c(38433);function i(a){if(!a)return a;let b=[...a];return b.length<=50?a:b.slice(0,50).join("")+"…"}async function j(a,b,c,f,j){if((0,e.existsSync)(a))return(0,d.Ux)(d.v4,async()=>{let e=await (0,d.JE)(d.v4,{sessions:[]});for(let a of e.sessions)a.status||(a.status=a.isLoading?"loading":"normal",delete a.isLoading);let k=e.sessions.findIndex(c=>c.cwd===a&&c.sessionId===b),l=k>=0?e.sessions[k]:void 0,n={cwd:a,sessionId:b,lastActive:Date.now(),status:c,title:i(f||l?.title),lastUserMessage:i(j||l?.lastUserMessage)};k>=0?e.sessions[k]=n:e.sessions.push(n),e.sessions.sort((a,b)=>b.lastActive-a.lastActive),e.sessions=e.sessions.slice(0,15),await (0,d.An)(d.v4,e),"unread"===c&&l?.status!=="unread"&&(async()=>{let c=await m(a,b).catch(()=>void 0)||n.lastUserMessage;await (0,h.SG)({title:(0,g.basename)(a)||"Cockpit",body:i(c)||n.title||"",data:{cwd:a,sessionId:b}})})().catch(()=>{})})}async function k(a,b){let c=(0,d.Kk)(a,b);if((0,e.existsSync)(c))return q(c);let f=(0,d.oZ)(a,b);if((0,e.existsSync)(f))return q(f);let g=(0,d.yw)(a,b);if((0,e.existsSync)(g))return q(g);let h=(0,d.eg)(b);if(h&&(0,e.existsSync)(h))return await t(h)||"Untitled Session";let i=(0,d.vI)(b);return i&&(0,e.existsSync)(i)&&await v(i)||"Untitled Session"}async function l(a,b){let c=(0,d.Kk)(a,b);if((0,e.existsSync)(c))return await r(c);let f=(0,d.oZ)(a,b);if((0,e.existsSync)(f))return await r(f);let g=(0,d.yw)(a,b);if((0,e.existsSync)(g))return await r(g);let h=(0,d.eg)(b);if(h&&(0,e.existsSync)(h))return await s(h);let i=(0,d.vI)(b);return i&&(0,e.existsSync)(i)?await u(i):[]}async function m(a,b){let c=await l(a,b);return c[c.length-1]}async function n(a,b){let c=await l(a,b),d=c[c.length-1];return c.length<=10?{lastUserMessage:d,firstMessages:c.map(a=>i(a)),lastMessages:[]}:{lastUserMessage:d,firstMessages:c.slice(0,5).map(a=>i(a)),lastMessages:c.slice(-5).map(a=>i(a))}}function o(a){let b=a.replace(/<command-[^>]*>[\s\S]*?<\/command-[^>]*>/g,"");return(b=b.replace(/<local-command-[^>]*>[\s\S]*?<\/local-command-[^>]*>/g,"")).trim()}function p(a){return!(a.startsWith("This session is being continued")||a.startsWith("Caveat: The messages below"))&&!!a.trim()}async function q(a){try{let d=(0,e.createReadStream)(a),g=(0,f.createInterface)({input:d,crlfDelay:1/0}),h="",i=[];for await(let a of g)if(a.trim())try{let b=JSON.parse(a);if("summary"===b.type&&b.summary&&(h=b.summary),"user"===b.type){let a=b.message;if(!a?.content)continue;if("string"==typeof a.content)i.push(a.content);else if(Array.isArray(a.content))for(let b of a.content)"text"===b.type&&b.text&&i.push(b.text)}}catch{}var b=h,c=i;if(b)return b;let j="";for(let a of c){let b=o(a);if(b){if(b.startsWith("/")&&!j){j=b;continue}if(j)return`${j} ${b}`;return b}}return j||"Untitled Session"}catch{return"Untitled Session"}}async function r(a){let b=[];try{let c=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:c,crlfDelay:1/0}))if(a.trim())try{let c=JSON.parse(a);if("user"!==c.type)continue;let d=c.message;if(!d?.content)continue;let e="";if("string"==typeof d.content)e=d.content;else if(Array.isArray(d.content)){for(let a of d.content)if("text"===a.type&&a.text){e=a.text;break}}if(!e)continue;let f=o(e);f&&p(f)&&b.push(f)}catch{}}catch{}return b}async function s(a){let b=[];try{let c=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:c,crlfDelay:1/0})){let c;if(!a.trim())continue;try{c=JSON.parse(a)}catch{continue}if("response_item"!==c.type)continue;let d=c.payload;if(!d||"message"!==d.type||"user"!==d.role)continue;let e=d.content?.filter(a=>"input_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(!e||e.startsWith("<")||e.startsWith("#"))continue;let f=o(e);f&&p(f)&&b.push(f)}}catch{}return b}async function t(a){try{let b=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:b,crlfDelay:1/0})){let b;if(!a.trim())continue;try{b=JSON.parse(a)}catch{continue}if("response_item"!==b.type)continue;let c=b.payload;if(!c||"message"!==c.type||"user"!==c.role)continue;let d=c.content?.filter(a=>"input_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(!(!d||d.startsWith("<")||d.startsWith("#")))return d.slice(0,80)}return}catch{return}}async function u(a){let b=[];try{let c=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:c,crlfDelay:1/0})){let c;if(!a.trim())continue;try{c=JSON.parse(a)}catch{continue}if("user"!==c.role)continue;let d="string"==typeof c.content?c.content:Array.isArray(c.content)?c.content.filter(a=>("input_text"===a.type||"text"===a.type)&&a.text).map(a=>a.text).join(""):"";if(!d||d.startsWith("<system")||d.startsWith("<environment")||d.startsWith("# AGENTS.md")||d.startsWith("<permissions"))continue;let e=o(d);e&&p(e)&&b.push(e)}}catch{}return b}async function v(a){try{let b=(0,e.createReadStream)(a);for await(let a of(0,f.createInterface)({input:b,crlfDelay:1/0})){let b;if(!a.trim())continue;try{b=JSON.parse(a)}catch{continue}if("user"!==b.role)continue;let c="string"==typeof b.content?b.content:Array.isArray(b.content)?b.content.filter(a=>("input_text"===a.type||"text"===a.type)&&a.text).map(a=>a.text).join(""):"";if(!(!c||c.startsWith("<system")||c.startsWith("<environment")||c.startsWith("# AGENTS.md")||c.startsWith("<permissions")))return c.slice(0,80)}return}catch{return}}},82940:(a,b,c)=>{c.d(b,{AD:()=>j,GS:()=>l,HS:()=>m,Si:()=>n,Y6:()=>r,ah:()=>k,e5:()=>q,j$:()=>p,yQ:()=>o});let d=globalThis,e=d.__cockpitRunRegistry??(d.__cockpitRunRegistry=new Map),f=d.__cockpitRunListeners??(d.__cockpitRunListeners=new Map),g=d.__cockpitRunSeqByKey??(d.__cockpitRunSeqByKey=new Map);function h(a){for(let b of(a.seq+=1,a.keys))g.set(b,a.seq);return a.seq}function i(a,b){for(let c of a.keys){let a=f.get(c);if(a)for(let c of a)try{c(b)}catch{}}}function j(a,b,c){let d=e.get(a),f=d?.seq??g.get(a)??0;if(d)for(let a of(d.evictTimer&&clearTimeout(d.evictTimer),d.keys))e.delete(a);e.set(a,{keys:new Set([a]),cwd:b,status:"running",seq:f,events:[],updatedAt:Date.now()}),c&&k(a,{type:"user",_human:!0,message:{role:"user",content:c}})}function k(a,b){let c=e.get(a);c&&"running"===c.status&&(h(c),c.events.push(b),c.updatedAt=Date.now(),i(c,{seq:c.seq,message:b}))}function l(a,b){if(a===b)return;let c=e.get(a);c&&(c.keys.add(b),c.sessionId=b,e.set(b,c))}function m(a,b="idle"){let c=e.get(a);if(c){if("running"!==c.status){"idle"===c.status&&"error"===b&&(c.status="error");return}c.status=b,c.updatedAt=Date.now(),h(c),i(c,{seq:c.seq,message:{type:"run-ended",status:b}}),c.evictTimer&&clearTimeout(c.evictTimer),c.evictTimer=setTimeout(()=>{for(let a of c.keys)e.delete(a)},6e4)}}function n(a){let b=e.get(a);return b?{status:b.status,seq:b.seq,events:b.events.slice()}:null}function o(a){return e.get(a)?.status==="running"}function p(a){return e.get(a)?.sessionId??null}function q(a,b){let c=e.get(a);c&&(c.abort=b)}function r(a){let b=e.get(a);if(!b)return!1;try{b.abort?.()}catch{}return k(a,{type:"result",subtype:"stopped"}),m(a,"idle"),!0}},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88503:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OT:()=>n,Uu:()=>k,ex:()=>p,sP:()=>l});var e=c(89705),f=c(770),g=c(56825),h=a([g]);g=(h.then?(await h)():h)[0];let i=e.$mh({try:()=>g._u.getTasks(),catch:a=>new f.uV({message:"scheduler.getTasks failed",cause:a})}),j=e.$mh({try:()=>g._u.getUnreadCount(),catch:a=>new f.uV({message:"scheduler.getUnreadCount failed",cause:a})}),k=e.JkU(function*(){let a=yield*i,b=yield*j;return{tasks:a,unreadCount:b}}).pipe(e.DM4(()=>({tasks:[],unreadCount:0}))),l=a=>e.$mh({try:()=>g._u.addTask(a),catch:a=>new f.uV({message:"scheduler.addTask failed",cause:a})}),m=(a,b)=>e.$mh({try:()=>g._u.updateTask(a,b),catch:a=>new f.uV({message:"scheduler.updateTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))),n=a=>e.$mh({try:()=>g._u.deleteTask(a),catch:a=>new f.uV({message:"scheduler.deleteTask failed",cause:a})}).pipe(e.qIB(b=>b?e.rIH:e.fJG(new f.m_({resource:"task",id:a})))),o=e.$mh({try:()=>g._u.markAllRead(),catch:a=>new f.uV({message:"scheduler.markAllRead failed",cause:a})}),p=(a,b,c)=>{if("pause"===b)return e.$mh({try:()=>g._u.pauseTask(a),catch:a=>new f.uV({message:"scheduler.pauseTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})));if("resume"===b)return e.$mh({try:()=>g._u.resumeTask(a),catch:a=>new f.uV({message:"scheduler.resumeTask failed",cause:a})}).pipe(e.qIB(b=>b?e.PyW(b):e.fJG(new f.m_({resource:"task",id:a})))).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})));if("trigger"===b)return e.$mh({try:()=>g._u.triggerTask(a),catch:a=>new f.uV({message:"scheduler.triggerTask failed",cause:a})}).pipe(e.as({task:null,simpleSuccess:!0}));if("markRead"===b)return e.$mh({try:()=>g._u.markRead(a),catch:a=>new f.uV({message:"scheduler.markRead failed",cause:a})}).pipe(e.as({task:null,simpleSuccess:!0}));if("markReadBySessionId"===b&&"string"==typeof c?.sessionId){let a;return(a=c.sessionId,e.$mh({try:()=>g._u.markReadBySessionId(a),catch:a=>new f.uV({message:"scheduler.markReadBySessionId failed",cause:a})})).pipe(e.as({task:null,simpleSuccess:!0}))}if("markAllRead"===b)return o.pipe(e.as({task:null,simpleSuccess:!0}));if("reorder"===b&&Array.isArray(c?.orderedIds)){let a;return(a=c.orderedIds,e.$mh({try:()=>g._u.reorderTasks([...a]),catch:a=>new f.uV({message:"scheduler.reorderTasks failed",cause:a})})).pipe(e.as({task:null,simpleSuccess:!0}))}if("update"===b&&c){let b=Date.now(),d={...c};return"once"===c.type&&c.delayMinutes?(d.nextFireTime=b+6e4*c.delayMinutes,d.completed=!1):"interval"===c.type&&c.intervalMinutes?d.nextFireTime=b+6e4*c.intervalMinutes:"cron"===c.type&&c.cron&&(d.nextFireTime=(0,g.$_)(c.cron)),d.paused=!1,m(a,d).pipe(e.TjK(a=>({task:a,simpleSuccess:!1})))}return c?m(a,c).pipe(e.TjK(a=>({task:a,simpleSuccess:!1}))):e.PyW({task:null,simpleSuccess:!1})};d()}catch(a){d(a)}})},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304,7003],()=>b(b.s=66200));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=8387,a.ids=[8387],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},7939:(a,b,c)=>{c.d(b,{$A:()=>M,A0:()=>X,An:()=>$,BF:()=>I,Ct:()=>Q,Eu:()=>H,Ex:()=>u,GB:()=>r,JE:()=>Z,JY:()=>L,Ki:()=>C,Kk:()=>R,Kv:()=>j,LN:()=>k,Mx:()=>D,O0:()=>B,Sr:()=>J,Tb:()=>s,Ux:()=>ab,Wd:()=>Y,aO:()=>m,at:()=>y,ec:()=>o,eg:()=>V,h9:()=>x,i4:()=>G,iK:()=>p,im:()=>T,iy:()=>P,jp:()=>t,lT:()=>z,lq:()=>F,ls:()=>K,mT:()=>w,n6:()=>n,oK:()=>O,oZ:()=>S,of:()=>E,po:()=>N,tP:()=>q,th:()=>v,v4:()=>l,vI:()=>W,yw:()=>U});var d=c(21820),e=c(33873),f=c(79748),g=c(29021),h=c(79646);let i=(0,d.homedir)(),j=(0,e.join)(i,".cockpit"),k=(0,e.join)(j,"projects"),l=(0,e.join)(j,"state.json"),m=(0,e.join)(j,"pinned-sessions.json"),n=(0,e.join)(j,"push-subscriptions.json"),o=(0,e.join)(j,"note.md"),p=(0,e.join)(j,"scheduled-tasks.json"),q=(0,e.join)(j,"settings.json"),r=(0,e.join)(j,"skills.json"),s=(0,e.join)(j,"review"),t=(0,e.join)(s,"_signal");function u(){try{(0,g.existsSync)(s)||(0,g.mkdirSync)(s,{recursive:!0}),(0,g.writeFileSync)(t,Date.now().toString())}catch{}}let v=(0,e.join)(i,".claude"),w=(0,e.join)(v,"projects"),x=(0,e.join)(i,".claude2"),y=(0,e.join)(x,"projects"),z=(0,e.join)(j,"deepseek"),A=(0,e.join)(z,"projects");function B(a){return a.replace(/[/.]/g,"-")}function C(a){return(0,e.join)(k,B(a))}function D(a){return(0,e.join)(C(a),"session.json")}function E(a){return(0,e.join)(C(a),"recent-files.json")}function F(a){return(0,e.join)(C(a),"expanded-paths.json")}function G(a){return(0,e.join)(C(a),"comments.json")}function H(a){return(0,e.join)(C(a),"services.json")}function I(a){return(0,e.join)(C(a),"note.md")}function J(a,b){return(0,e.join)(C(a),`terminal-history-${b}.jsonl`)}function K(a,b){return(0,e.join)(C(a),`terminal-output-${b}.txt`)}function L(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(C(a),c)}function M(){return(0,e.join)(j,"terminal-aliases.json")}function N(){return(0,e.join)(j,"services.json")}function O(a){return(0,e.join)(C(a),"project-settings.json")}function P(a,b){return(0,e.join)(C(a),`terminal-bubble-order-${b}.json`)}function Q(a){return(0,e.join)(s,`${a}.json`)}function R(a,b){return(0,e.join)((0,e.join)(w,B(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(y,B(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(A,B(a)),`${b}.jsonl`)}function U(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",B(a)),`${b}.jsonl`)}function V(a){let b=(0,e.join)(i,".codex","sessions");if(!(0,g.existsSync)(b))return null;try{let c=(0,h.execSync)(`find ${JSON.stringify(b)} -name "*${a}.jsonl" -type f 2>/dev/null`,{encoding:"utf8",timeout:3e3}).trim();if(c)return c.split("\n")[0]}catch{}return null}function W(a){let b=(0,e.join)(i,".kimi","sessions");if(!(0,g.existsSync)(b))return null;try{for(let c of(0,g.readdirSync)(b)){let d=(0,e.join)(b,c,a,"context.jsonl");if((0,g.existsSync)(d))return d}}catch{}return null}async function X(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function Y(a){let b=(0,e.join)(a,"..");await X(b)}async function Z(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function $(a,b){await Y(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let _=globalThis,aa=_.__cockpitFileLocks??(_.__cockpitFileLocks=new Map);function ab(a,b){let c=(aa.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return aa.set(a,d),d.then(()=>{aa.get(a)===d&&aa.delete(a)}),c}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},57559:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,POST:()=>l});var e=c(89705),f=c(7939),g=c(72891),h=c(770),i=a([g]);g=(i.then?(await i)():i)[0];let j=(a,b)=>"global"===b?(0,f.po)():a?(0,f.Eu)(a):null,k=(0,g.RL)(a=>e.JkU(function*(){let b=new URL(a.url).searchParams,c=j(b.get("cwd"),b.get("scope"));if(!c)return yield*e.fJG(new h.yI({field:"cwd|scope",reason:"Missing cwd or scope"}));let d=yield*e.$mh({try:()=>(0,f.JE)(c,{customCommands:[]}),catch:a=>new h.uU({path:c,op:"read",cause:a})});return(0,g.ok)(d)})),l=(0,g.RL)(a=>e.JkU(function*(){let b=yield*(0,g.k9)(a),c=j(b.cwd??null,b.scope??null);if(!c)return yield*e.fJG(new h.yI({field:"cwd|scope",reason:"Missing cwd or scope"}));let d={customCommands:b.customCommands||[]};return yield*e.$mh({try:()=>(0,f.An)(c,d),catch:a=>new h.uU({path:c,op:"write",cause:a})}),(0,g.ok)({success:!0})}));d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},71345:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(57559),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/services/config/route",pathname:"/api/services/config",filename:"route",bundlePath:"app/api/services/config/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/services/config/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/services/config/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304],()=>b(b.s=71345));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=8387,a.ids=[8387],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},7939:(a,b,c)=>{c.d(b,{$A:()=>M,A0:()=>X,An:()=>$,BF:()=>I,Ct:()=>Q,Eu:()=>H,Ex:()=>u,GB:()=>r,JE:()=>Z,JY:()=>L,Ki:()=>C,Kk:()=>R,Kv:()=>j,LN:()=>k,Mx:()=>D,N9:()=>ac,O0:()=>B,Sr:()=>J,Tb:()=>s,Ux:()=>ab,Wd:()=>Y,aO:()=>m,at:()=>y,ec:()=>o,eg:()=>V,h9:()=>x,i4:()=>G,iK:()=>p,im:()=>T,iy:()=>P,jp:()=>t,lT:()=>z,lq:()=>F,ls:()=>K,mT:()=>w,n6:()=>n,oK:()=>O,oZ:()=>S,of:()=>E,po:()=>N,tP:()=>q,th:()=>v,v4:()=>l,vI:()=>W,yw:()=>U});var d=c(21820),e=c(33873),f=c(79748),g=c(29021),h=c(79646);let i=(0,d.homedir)(),j=(0,e.join)(i,".cockpit"),k=(0,e.join)(j,"projects"),l=(0,e.join)(j,"state.json"),m=(0,e.join)(j,"pinned-sessions.json"),n=(0,e.join)(j,"push-subscriptions.json"),o=(0,e.join)(j,"note.md"),p=(0,e.join)(j,"scheduled-tasks.json"),q=(0,e.join)(j,"settings.json"),r=(0,e.join)(j,"skills.json"),s=(0,e.join)(j,"review"),t=(0,e.join)(s,"_signal");function u(){try{(0,g.existsSync)(s)||(0,g.mkdirSync)(s,{recursive:!0}),(0,g.writeFileSync)(t,Date.now().toString())}catch{}}let v=(0,e.join)(i,".claude"),w=(0,e.join)(v,"projects"),x=(0,e.join)(i,".claude2"),y=(0,e.join)(x,"projects"),z=(0,e.join)(j,"deepseek"),A=(0,e.join)(z,"projects");function B(a){return a.replace(/[/.]/g,"-")}function C(a){return(0,e.join)(k,B(a))}function D(a){return(0,e.join)(C(a),"session.json")}function E(a){return(0,e.join)(C(a),"recent-files.json")}function F(a){return(0,e.join)(C(a),"expanded-paths.json")}function G(a){return(0,e.join)(C(a),"comments.json")}function H(a){return(0,e.join)(C(a),"services.json")}function I(a){return(0,e.join)(C(a),"note.md")}function J(a,b){return(0,e.join)(C(a),`terminal-history-${b}.jsonl`)}function K(a,b){return(0,e.join)(C(a),`terminal-output-${b}.txt`)}function L(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(C(a),c)}function M(){return(0,e.join)(j,"terminal-aliases.json")}function N(){return(0,e.join)(j,"services.json")}function O(a){return(0,e.join)(C(a),"project-settings.json")}function P(a,b){return(0,e.join)(C(a),`terminal-bubble-order-${b}.json`)}function Q(a){return(0,e.join)(s,`${a}.json`)}function R(a,b){return(0,e.join)((0,e.join)(w,B(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(y,B(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(A,B(a)),`${b}.jsonl`)}function U(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",B(a)),`${b}.jsonl`)}function V(a){let b=(0,e.join)(i,".codex","sessions");if(!(0,g.existsSync)(b))return null;try{let c=(0,h.execSync)(`find ${JSON.stringify(b)} -name "*${a}.jsonl" -type f 2>/dev/null`,{encoding:"utf8",timeout:3e3}).trim();if(c)return c.split("\n")[0]}catch{}return null}function W(a){let b=(0,e.join)(i,".kimi","sessions");if(!(0,g.existsSync)(b))return null;try{for(let c of(0,g.readdirSync)(b)){let d=(0,e.join)(b,c,a,"context.jsonl");if((0,g.existsSync)(d))return d}}catch{}return null}async function X(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function Y(a){let b=(0,e.join)(a,"..");await X(b)}async function Z(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function $(a,b){await Y(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let _=globalThis,aa=_.__cockpitFileLocks??(_.__cockpitFileLocks=new Map);function ab(a,b){let c=(aa.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return aa.set(a,d),d.then(()=>{aa.get(a)===d&&aa.delete(a)}),c}function ac(a,b,c){return ab(a,async()=>{let d=await Z(a,b),e=await c(d);return await $(a,e),e})}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},57559:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,POST:()=>l});var e=c(89705),f=c(7939),g=c(72891),h=c(770),i=a([g]);g=(i.then?(await i)():i)[0];let j=(a,b)=>"global"===b?(0,f.po)():a?(0,f.Eu)(a):null,k=(0,g.RL)(a=>e.JkU(function*(){let b=new URL(a.url).searchParams,c=j(b.get("cwd"),b.get("scope"));if(!c)return yield*e.fJG(new h.yI({field:"cwd|scope",reason:"Missing cwd or scope"}));let d=yield*e.$mh({try:()=>(0,f.JE)(c,{customCommands:[]}),catch:a=>new h.uU({path:c,op:"read",cause:a})});return(0,g.ok)(d)})),l=(0,g.RL)(a=>e.JkU(function*(){let b=yield*(0,g.k9)(a),c=j(b.cwd??null,b.scope??null);if(!c)return yield*e.fJG(new h.yI({field:"cwd|scope",reason:"Missing cwd or scope"}));let d={customCommands:b.customCommands||[]};return yield*e.$mh({try:()=>(0,f.An)(c,d),catch:a=>new h.uU({path:c,op:"write",cause:a})}),(0,g.ok)({success:!0})}));d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64730:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(57559),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/services/config/route",pathname:"/api/services/config",filename:"route",bundlePath:"app/api/services/config/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/services/config/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/services/config/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304],()=>b(b.s=64730));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=4647,a.ids=[4647],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},50977:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l});var e=c(79748),f=c(29021),g=c(33873),h=c(89705),i=c(72891),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(0,i.RL)(a=>h.JkU(function*(){let b=new URL(a.url).searchParams.get("cwd");if(!b)return yield*h.fJG(new j.yI({field:"cwd",reason:"missing"}));let c=(0,g.join)(b,"package.json");if(!(0,f.existsSync)(c))return(0,i.ok)({scripts:{}});let d=yield*h.$mh({try:()=>(0,e.readFile)(c,"utf-8"),catch:a=>new j.uU({path:c,op:"read",cause:a})}),k=yield*h.SvU({try:()=>JSON.parse(d),catch:a=>new j.yI({field:"package.json",reason:`invalid JSON: ${String(a)}`})});return(0,i.ok)({scripts:k.scripts??{}})}));d()}catch(a){d(a)}})},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63111:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(50977),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/services/scripts/route",pathname:"/api/services/scripts",filename:"route",bundlePath:"app/api/services/scripts/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/services/scripts/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/services/scripts/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304],()=>b(b.s=63111));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=4647,a.ids=[4647],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},49644:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(50977),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/services/scripts/route",pathname:"/api/services/scripts",filename:"route",bundlePath:"app/api/services/scripts/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/services/scripts/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/services/scripts/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},50977:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>l});var e=c(79748),f=c(29021),g=c(33873),h=c(89705),i=c(72891),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(0,i.RL)(a=>h.JkU(function*(){let b=new URL(a.url).searchParams.get("cwd");if(!b)return yield*h.fJG(new j.yI({field:"cwd",reason:"missing"}));let c=(0,g.join)(b,"package.json");if(!(0,f.existsSync)(c))return(0,i.ok)({scripts:{}});let d=yield*h.$mh({try:()=>(0,e.readFile)(c,"utf-8"),catch:a=>new j.uU({path:c,op:"read",cause:a})}),k=yield*h.SvU({try:()=>JSON.parse(d),catch:a=>new j.yI({field:"package.json",reason:`invalid JSON: ${String(a)}`})});return(0,i.ok)({scripts:k.scripts??{}})}));d()}catch(a){d(a)}})},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304],()=>b(b.s=49644));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=3347,a.ids=[3347],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},7939:(a,b,c)=>{c.d(b,{$A:()=>M,A0:()=>X,An:()=>$,BF:()=>I,Ct:()=>Q,Eu:()=>H,Ex:()=>u,GB:()=>r,JE:()=>Z,JY:()=>L,Ki:()=>C,Kk:()=>R,Kv:()=>j,LN:()=>k,Mx:()=>D,O0:()=>B,Sr:()=>J,Tb:()=>s,Ux:()=>ab,Wd:()=>Y,aO:()=>m,at:()=>y,ec:()=>o,eg:()=>V,h9:()=>x,i4:()=>G,iK:()=>p,im:()=>T,iy:()=>P,jp:()=>t,lT:()=>z,lq:()=>F,ls:()=>K,mT:()=>w,n6:()=>n,oK:()=>O,oZ:()=>S,of:()=>E,po:()=>N,tP:()=>q,th:()=>v,v4:()=>l,vI:()=>W,yw:()=>U});var d=c(21820),e=c(33873),f=c(79748),g=c(29021),h=c(79646);let i=(0,d.homedir)(),j=(0,e.join)(i,".cockpit"),k=(0,e.join)(j,"projects"),l=(0,e.join)(j,"state.json"),m=(0,e.join)(j,"pinned-sessions.json"),n=(0,e.join)(j,"push-subscriptions.json"),o=(0,e.join)(j,"note.md"),p=(0,e.join)(j,"scheduled-tasks.json"),q=(0,e.join)(j,"settings.json"),r=(0,e.join)(j,"skills.json"),s=(0,e.join)(j,"review"),t=(0,e.join)(s,"_signal");function u(){try{(0,g.existsSync)(s)||(0,g.mkdirSync)(s,{recursive:!0}),(0,g.writeFileSync)(t,Date.now().toString())}catch{}}let v=(0,e.join)(i,".claude"),w=(0,e.join)(v,"projects"),x=(0,e.join)(i,".claude2"),y=(0,e.join)(x,"projects"),z=(0,e.join)(j,"deepseek"),A=(0,e.join)(z,"projects");function B(a){return a.replace(/[/.]/g,"-")}function C(a){return(0,e.join)(k,B(a))}function D(a){return(0,e.join)(C(a),"session.json")}function E(a){return(0,e.join)(C(a),"recent-files.json")}function F(a){return(0,e.join)(C(a),"expanded-paths.json")}function G(a){return(0,e.join)(C(a),"comments.json")}function H(a){return(0,e.join)(C(a),"services.json")}function I(a){return(0,e.join)(C(a),"note.md")}function J(a,b){return(0,e.join)(C(a),`terminal-history-${b}.jsonl`)}function K(a,b){return(0,e.join)(C(a),`terminal-output-${b}.txt`)}function L(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(C(a),c)}function M(){return(0,e.join)(j,"terminal-aliases.json")}function N(){return(0,e.join)(j,"services.json")}function O(a){return(0,e.join)(C(a),"project-settings.json")}function P(a,b){return(0,e.join)(C(a),`terminal-bubble-order-${b}.json`)}function Q(a){return(0,e.join)(s,`${a}.json`)}function R(a,b){return(0,e.join)((0,e.join)(w,B(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(y,B(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(A,B(a)),`${b}.jsonl`)}function U(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",B(a)),`${b}.jsonl`)}function V(a){let b=(0,e.join)(i,".codex","sessions");if(!(0,g.existsSync)(b))return null;try{let c=(0,h.execSync)(`find ${JSON.stringify(b)} -name "*${a}.jsonl" -type f 2>/dev/null`,{encoding:"utf8",timeout:3e3}).trim();if(c)return c.split("\n")[0]}catch{}return null}function W(a){let b=(0,e.join)(i,".kimi","sessions");if(!(0,g.existsSync)(b))return null;try{for(let c of(0,g.readdirSync)(b)){let d=(0,e.join)(b,c,a,"context.jsonl");if((0,g.existsSync)(d))return d}}catch{}return null}async function X(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function Y(a){let b=(0,e.join)(a,"..");await X(b)}async function Z(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function $(a,b){await Y(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let _=globalThis,aa=_.__cockpitFileLocks??(_.__cockpitFileLocks=new Map);function ab(a,b){let c=(aa.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return aa.set(a,d),d.then(()=>{aa.get(a)===d&&aa.delete(a)}),c}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46789:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>e.L,runtime:()=>e.f});var e=c(74534),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72551:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(46789),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/session/[sessionId]/fork/route",pathname:"/api/session/[sessionId]/fork",filename:"route",bundlePath:"app/api/session/[sessionId]/fork/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session/[sessionId]/fork/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/fork/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},74534:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{L:()=>o,f:()=>n});var e=c(29021),f=c(79748),g=c(4984),h=c(55511),i=c(89705),j=c(7939),k=c(72891),l=c(770),m=a([k]);k=(m.then?(await m)():m)[0];let n="nodejs",o=(0,k.OZ)((a,{sessionId:b})=>i.JkU(function*(){let{cwd:c,fromMessageUuid:d}=yield*(0,k.k9)(a);if(!c)return yield*i.fJG(new l.yI({field:"cwd",reason:"missing"}));let m=(0,j.Kk)(c,b);if(!(0,e.existsSync)(m))return yield*i.fJG(new l.m_({resource:"session",id:b}));let n=yield*i.$mh({try:async()=>{let a=(0,h.randomUUID)(),c=[],f=(0,e.createReadStream)(m),i=(0,g.createInterface)({input:f,crlfDelay:1/0}),j="collecting";for await(let e of i){if("done"===j)break;if(e.trim())try{let b=JSON.parse(e);if("found_target"===j&&function(a){if("user"!==a.type)return!1;let b=a.message;if(!b)return!1;let c=b.content;return Array.isArray(c)?c.some(a=>"text"===a.type):"string"==typeof c}(b)){j="done";break}d&&b.uuid===d&&(j="found_target"),b.sessionId=a,c.push(JSON.stringify(b))}catch{let d=e.replace(RegExp(b,"g"),a);c.push(d)}}return{newSessionId:a,newLines:c,targetMissed:!!d&&"collecting"===j}},catch:a=>new l.uU({path:m,op:"read",cause:a})});if(n.targetMissed)return yield*i.fJG(new l.m_({resource:"message",id:d??"(unknown)"}));let o=(0,j.Kk)(c,n.newSessionId);return yield*i.$mh({try:()=>(0,f.writeFile)(o,n.newLines.join("\n")+"\n","utf-8"),catch:a=>new l.uU({path:o,op:"write",cause:a})}),(0,k.ok)({success:!0,originalSessionId:b,newSessionId:n.newSessionId,messageCount:n.newLines.length})}));d()}catch(a){d(a)}})},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304],()=>b(b.s=72551));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=3347,a.ids=[3347],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},7939:(a,b,c)=>{c.d(b,{$A:()=>M,A0:()=>X,An:()=>$,BF:()=>I,Ct:()=>Q,Eu:()=>H,Ex:()=>u,GB:()=>r,JE:()=>Z,JY:()=>L,Ki:()=>C,Kk:()=>R,Kv:()=>j,LN:()=>k,Mx:()=>D,N9:()=>ac,O0:()=>B,Sr:()=>J,Tb:()=>s,Ux:()=>ab,Wd:()=>Y,aO:()=>m,at:()=>y,ec:()=>o,eg:()=>V,h9:()=>x,i4:()=>G,iK:()=>p,im:()=>T,iy:()=>P,jp:()=>t,lT:()=>z,lq:()=>F,ls:()=>K,mT:()=>w,n6:()=>n,oK:()=>O,oZ:()=>S,of:()=>E,po:()=>N,tP:()=>q,th:()=>v,v4:()=>l,vI:()=>W,yw:()=>U});var d=c(21820),e=c(33873),f=c(79748),g=c(29021),h=c(79646);let i=(0,d.homedir)(),j=(0,e.join)(i,".cockpit"),k=(0,e.join)(j,"projects"),l=(0,e.join)(j,"state.json"),m=(0,e.join)(j,"pinned-sessions.json"),n=(0,e.join)(j,"push-subscriptions.json"),o=(0,e.join)(j,"note.md"),p=(0,e.join)(j,"scheduled-tasks.json"),q=(0,e.join)(j,"settings.json"),r=(0,e.join)(j,"skills.json"),s=(0,e.join)(j,"review"),t=(0,e.join)(s,"_signal");function u(){try{(0,g.existsSync)(s)||(0,g.mkdirSync)(s,{recursive:!0}),(0,g.writeFileSync)(t,Date.now().toString())}catch{}}let v=(0,e.join)(i,".claude"),w=(0,e.join)(v,"projects"),x=(0,e.join)(i,".claude2"),y=(0,e.join)(x,"projects"),z=(0,e.join)(j,"deepseek"),A=(0,e.join)(z,"projects");function B(a){return a.replace(/[/.]/g,"-")}function C(a){return(0,e.join)(k,B(a))}function D(a){return(0,e.join)(C(a),"session.json")}function E(a){return(0,e.join)(C(a),"recent-files.json")}function F(a){return(0,e.join)(C(a),"expanded-paths.json")}function G(a){return(0,e.join)(C(a),"comments.json")}function H(a){return(0,e.join)(C(a),"services.json")}function I(a){return(0,e.join)(C(a),"note.md")}function J(a,b){return(0,e.join)(C(a),`terminal-history-${b}.jsonl`)}function K(a,b){return(0,e.join)(C(a),`terminal-output-${b}.txt`)}function L(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(C(a),c)}function M(){return(0,e.join)(j,"terminal-aliases.json")}function N(){return(0,e.join)(j,"services.json")}function O(a){return(0,e.join)(C(a),"project-settings.json")}function P(a,b){return(0,e.join)(C(a),`terminal-bubble-order-${b}.json`)}function Q(a){return(0,e.join)(s,`${a}.json`)}function R(a,b){return(0,e.join)((0,e.join)(w,B(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(y,B(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(A,B(a)),`${b}.jsonl`)}function U(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",B(a)),`${b}.jsonl`)}function V(a){let b=(0,e.join)(i,".codex","sessions");if(!(0,g.existsSync)(b))return null;try{let c=(0,h.execSync)(`find ${JSON.stringify(b)} -name "*${a}.jsonl" -type f 2>/dev/null`,{encoding:"utf8",timeout:3e3}).trim();if(c)return c.split("\n")[0]}catch{}return null}function W(a){let b=(0,e.join)(i,".kimi","sessions");if(!(0,g.existsSync)(b))return null;try{for(let c of(0,g.readdirSync)(b)){let d=(0,e.join)(b,c,a,"context.jsonl");if((0,g.existsSync)(d))return d}}catch{}return null}async function X(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function Y(a){let b=(0,e.join)(a,"..");await X(b)}async function Z(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function $(a,b){await Y(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let _=globalThis,aa=_.__cockpitFileLocks??(_.__cockpitFileLocks=new Map);function ab(a,b){let c=(aa.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return aa.set(a,d),d.then(()=>{aa.get(a)===d&&aa.delete(a)}),c}function ac(a,b,c){return ab(a,async()=>{let d=await Z(a,b),e=await c(d);return await $(a,e),e})}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27660:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(46789),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/session/[sessionId]/fork/route",pathname:"/api/session/[sessionId]/fork",filename:"route",bundlePath:"app/api/session/[sessionId]/fork/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session/[sessionId]/fork/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/fork/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46789:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>e.L,runtime:()=>e.f});var e=c(74534),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},74534:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{L:()=>o,f:()=>n});var e=c(29021),f=c(79748),g=c(4984),h=c(55511),i=c(89705),j=c(7939),k=c(72891),l=c(770),m=a([k]);k=(m.then?(await m)():m)[0];let n="nodejs",o=(0,k.OZ)((a,{sessionId:b})=>i.JkU(function*(){let{cwd:c,fromMessageUuid:d}=yield*(0,k.k9)(a);if(!c)return yield*i.fJG(new l.yI({field:"cwd",reason:"missing"}));let m=(0,j.Kk)(c,b);if(!(0,e.existsSync)(m))return yield*i.fJG(new l.m_({resource:"session",id:b}));let n=yield*i.$mh({try:async()=>{let a=(0,h.randomUUID)(),c=[],f=(0,e.createReadStream)(m),i=(0,g.createInterface)({input:f,crlfDelay:1/0}),j="collecting";for await(let e of i){if("done"===j)break;if(e.trim())try{let b=JSON.parse(e);if("found_target"===j&&function(a){if("user"!==a.type)return!1;let b=a.message;if(!b)return!1;let c=b.content;return Array.isArray(c)?c.some(a=>"text"===a.type):"string"==typeof c}(b)){j="done";break}d&&b.uuid===d&&(j="found_target"),b.sessionId=a,c.push(JSON.stringify(b))}catch{let d=e.replace(RegExp(b,"g"),a);c.push(d)}}return{newSessionId:a,newLines:c,targetMissed:!!d&&"collecting"===j}},catch:a=>new l.uU({path:m,op:"read",cause:a})});if(n.targetMissed)return yield*i.fJG(new l.m_({resource:"message",id:d??"(unknown)"}));let o=(0,j.Kk)(c,n.newSessionId);return yield*i.$mh({try:()=>(0,f.writeFile)(o,n.newLines.join("\n")+"\n","utf-8"),catch:a=>new l.uU({path:o,op:"write",cause:a})}),(0,k.ok)({success:!0,originalSessionId:b,newSessionId:n.newSessionId,messageCount:n.newLines.length})}));d()}catch(a){d(a)}})},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304],()=>b(b.s=27660));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=5849,a.ids=[5849],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},7152:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OR:()=>n,fA:()=>m,fG:()=>o});var e=c(29021),f=c(4984),g=c(89705),h=c(7939),i=c(72891),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let m="nodejs",n="force-dynamic",o=(0,i.OZ)((a,{sessionId:b})=>g.JkU(function*(){if(!b)return yield*g.fJG(new j.yI({field:"sessionId",reason:"missing"}));let a=process.cwd(),c=(0,h.Kk)(a,b);if(!e.existsSync(c))return yield*g.fJG(new j.m_({resource:"session",id:b}));let d=yield*g.$mh({try:()=>l(c),catch:a=>new j.uV({message:"parseTranscriptFile failed",cause:a})});return(0,i.ok)({messages:d})}));async function l(a){let b=e.createReadStream(a),c=f.createInterface({input:b,crlfDelay:1/0}),d=[];for await(let a of c)try{let b=JSON.parse(a);("user"===b.type||"assistant"===b.type)&&d.push(b)}catch{}return function(a){let b=[],c=null,d=new Map;for(let b of a)if("user"===b.type&&b.message?.content&&Array.isArray(b.message.content))for(let a of b.message.content)"tool_result"===a.type&&a.tool_use_id&&d.set(a.tool_use_id,a.content||"");for(let e of a){if("user"===e.type&&e.message?.role==="user"&&e.message?.content){let a=e.message.content;if("string"==typeof a){c&&(b.push(c),c=null);let d={id:e.uuid||`user-${Date.now()}`,role:"user",content:a,timestamp:e.timestamp};b.push(d);continue}if(!Array.isArray(a))continue;let d=a.filter(a=>"text"===a.type),f=a.filter(a=>"image"===a.type&&a.source);if(d.length>0||f.length>0){c&&(b.push(c),c=null);let a={id:e.uuid||`user-${Date.now()}`,role:"user",content:d.map(a=>a.text||"").join("\n"),timestamp:e.timestamp};f.length>0&&(a.images=f.map(a=>({type:"base64",media_type:a.source?.media_type||"image/png",data:a.source?.data||""}))),b.push(a)}}if("assistant"===e.type&&e.message?.content){let a=e.message.content;if(!Array.isArray(a))continue;let b=a.filter(a=>"text"===a.type),f=a.filter(a=>"tool_use"===a.type);if(b.length>0&&(c?c.content+=b.map(a=>a.text||"").join("\n"):c={id:e.uuid||`assistant-${Date.now()}`,role:"assistant",content:b.map(a=>a.text||"").join("\n"),timestamp:e.timestamp,toolCalls:[]}),f.length>0)for(let a of(c||(c={id:e.uuid||`assistant-${Date.now()}`,role:"assistant",content:"",toolCalls:[]}),f))a.name&&a.id&&c.toolCalls.push({id:a.id,name:a.name,input:a.input||{},result:d.get(a.id),isLoading:!1})}}return c&&b.push(c),b}(d)}d()}catch(a){d(a)}})},7939:(a,b,c)=>{c.d(b,{$A:()=>M,A0:()=>X,An:()=>$,BF:()=>I,Ct:()=>Q,Eu:()=>H,Ex:()=>u,GB:()=>r,JE:()=>Z,JY:()=>L,Ki:()=>C,Kk:()=>R,Kv:()=>j,LN:()=>k,Mx:()=>D,O0:()=>B,Sr:()=>J,Tb:()=>s,Ux:()=>ab,Wd:()=>Y,aO:()=>m,at:()=>y,ec:()=>o,eg:()=>V,h9:()=>x,i4:()=>G,iK:()=>p,im:()=>T,iy:()=>P,jp:()=>t,lT:()=>z,lq:()=>F,ls:()=>K,mT:()=>w,n6:()=>n,oK:()=>O,oZ:()=>S,of:()=>E,po:()=>N,tP:()=>q,th:()=>v,v4:()=>l,vI:()=>W,yw:()=>U});var d=c(21820),e=c(33873),f=c(79748),g=c(29021),h=c(79646);let i=(0,d.homedir)(),j=(0,e.join)(i,".cockpit"),k=(0,e.join)(j,"projects"),l=(0,e.join)(j,"state.json"),m=(0,e.join)(j,"pinned-sessions.json"),n=(0,e.join)(j,"push-subscriptions.json"),o=(0,e.join)(j,"note.md"),p=(0,e.join)(j,"scheduled-tasks.json"),q=(0,e.join)(j,"settings.json"),r=(0,e.join)(j,"skills.json"),s=(0,e.join)(j,"review"),t=(0,e.join)(s,"_signal");function u(){try{(0,g.existsSync)(s)||(0,g.mkdirSync)(s,{recursive:!0}),(0,g.writeFileSync)(t,Date.now().toString())}catch{}}let v=(0,e.join)(i,".claude"),w=(0,e.join)(v,"projects"),x=(0,e.join)(i,".claude2"),y=(0,e.join)(x,"projects"),z=(0,e.join)(j,"deepseek"),A=(0,e.join)(z,"projects");function B(a){return a.replace(/[/.]/g,"-")}function C(a){return(0,e.join)(k,B(a))}function D(a){return(0,e.join)(C(a),"session.json")}function E(a){return(0,e.join)(C(a),"recent-files.json")}function F(a){return(0,e.join)(C(a),"expanded-paths.json")}function G(a){return(0,e.join)(C(a),"comments.json")}function H(a){return(0,e.join)(C(a),"services.json")}function I(a){return(0,e.join)(C(a),"note.md")}function J(a,b){return(0,e.join)(C(a),`terminal-history-${b}.jsonl`)}function K(a,b){return(0,e.join)(C(a),`terminal-output-${b}.txt`)}function L(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(C(a),c)}function M(){return(0,e.join)(j,"terminal-aliases.json")}function N(){return(0,e.join)(j,"services.json")}function O(a){return(0,e.join)(C(a),"project-settings.json")}function P(a,b){return(0,e.join)(C(a),`terminal-bubble-order-${b}.json`)}function Q(a){return(0,e.join)(s,`${a}.json`)}function R(a,b){return(0,e.join)((0,e.join)(w,B(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(y,B(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(A,B(a)),`${b}.jsonl`)}function U(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",B(a)),`${b}.jsonl`)}function V(a){let b=(0,e.join)(i,".codex","sessions");if(!(0,g.existsSync)(b))return null;try{let c=(0,h.execSync)(`find ${JSON.stringify(b)} -name "*${a}.jsonl" -type f 2>/dev/null`,{encoding:"utf8",timeout:3e3}).trim();if(c)return c.split("\n")[0]}catch{}return null}function W(a){let b=(0,e.join)(i,".kimi","sessions");if(!(0,g.existsSync)(b))return null;try{for(let c of(0,g.readdirSync)(b)){let d=(0,e.join)(b,c,a,"context.jsonl");if((0,g.existsSync)(d))return d}}catch{}return null}async function X(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function Y(a){let b=(0,e.join)(a,"..");await X(b)}async function Z(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function $(a,b){await Y(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let _=globalThis,aa=_.__cockpitFileLocks??(_.__cockpitFileLocks=new Map);function ab(a,b){let c=(aa.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return aa.set(a,d),d.then(()=>{aa.get(a)===d&&aa.delete(a)}),c}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64513:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>e.fG,dynamic:()=>e.OR,runtime:()=>e.fA});var e=c(7152),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},71649:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(64513),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/session/[sessionId]/history/route",pathname:"/api/session/[sessionId]/history",filename:"route",bundlePath:"app/api/session/[sessionId]/history/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session/[sessionId]/history/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/history/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304],()=>b(b.s=71649));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=5849,a.ids=[5849],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},4573:a=>{a.exports=require("node:buffer")},4984:a=>{a.exports=require("readline")},7152:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OR:()=>n,fA:()=>m,fG:()=>o});var e=c(29021),f=c(4984),g=c(89705),h=c(7939),i=c(72891),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let m="nodejs",n="force-dynamic",o=(0,i.OZ)((a,{sessionId:b})=>g.JkU(function*(){if(!b)return yield*g.fJG(new j.yI({field:"sessionId",reason:"missing"}));let a=process.cwd(),c=(0,h.Kk)(a,b);if(!e.existsSync(c))return yield*g.fJG(new j.m_({resource:"session",id:b}));let d=yield*g.$mh({try:()=>l(c),catch:a=>new j.uV({message:"parseTranscriptFile failed",cause:a})});return(0,i.ok)({messages:d})}));async function l(a){let b=e.createReadStream(a),c=f.createInterface({input:b,crlfDelay:1/0}),d=[];for await(let a of c)try{let b=JSON.parse(a);("user"===b.type||"assistant"===b.type)&&d.push(b)}catch{}return function(a){let b=[],c=null,d=new Map;for(let b of a)if("user"===b.type&&b.message?.content&&Array.isArray(b.message.content))for(let a of b.message.content)"tool_result"===a.type&&a.tool_use_id&&d.set(a.tool_use_id,a.content||"");for(let e of a){if("user"===e.type&&e.message?.role==="user"&&e.message?.content){let a=e.message.content;if("string"==typeof a){c&&(b.push(c),c=null);let d={id:e.uuid||`user-${Date.now()}`,role:"user",content:a,timestamp:e.timestamp};b.push(d);continue}if(!Array.isArray(a))continue;let d=a.filter(a=>"text"===a.type),f=a.filter(a=>"image"===a.type&&a.source);if(d.length>0||f.length>0){c&&(b.push(c),c=null);let a={id:e.uuid||`user-${Date.now()}`,role:"user",content:d.map(a=>a.text||"").join("\n"),timestamp:e.timestamp};f.length>0&&(a.images=f.map(a=>({type:"base64",media_type:a.source?.media_type||"image/png",data:a.source?.data||""}))),b.push(a)}}if("assistant"===e.type&&e.message?.content){let a=e.message.content;if(!Array.isArray(a))continue;let b=a.filter(a=>"text"===a.type),f=a.filter(a=>"tool_use"===a.type);if(b.length>0&&(c?c.content+=b.map(a=>a.text||"").join("\n"):c={id:e.uuid||`assistant-${Date.now()}`,role:"assistant",content:b.map(a=>a.text||"").join("\n"),timestamp:e.timestamp,toolCalls:[]}),f.length>0)for(let a of(c||(c={id:e.uuid||`assistant-${Date.now()}`,role:"assistant",content:"",toolCalls:[]}),f))a.name&&a.id&&c.toolCalls.push({id:a.id,name:a.name,input:a.input||{},result:d.get(a.id),isLoading:!1})}}return c&&b.push(c),b}(d)}d()}catch(a){d(a)}})},7939:(a,b,c)=>{c.d(b,{$A:()=>M,A0:()=>X,An:()=>$,BF:()=>I,Ct:()=>Q,Eu:()=>H,Ex:()=>u,GB:()=>r,JE:()=>Z,JY:()=>L,Ki:()=>C,Kk:()=>R,Kv:()=>j,LN:()=>k,Mx:()=>D,N9:()=>ac,O0:()=>B,Sr:()=>J,Tb:()=>s,Ux:()=>ab,Wd:()=>Y,aO:()=>m,at:()=>y,ec:()=>o,eg:()=>V,h9:()=>x,i4:()=>G,iK:()=>p,im:()=>T,iy:()=>P,jp:()=>t,lT:()=>z,lq:()=>F,ls:()=>K,mT:()=>w,n6:()=>n,oK:()=>O,oZ:()=>S,of:()=>E,po:()=>N,tP:()=>q,th:()=>v,v4:()=>l,vI:()=>W,yw:()=>U});var d=c(21820),e=c(33873),f=c(79748),g=c(29021),h=c(79646);let i=(0,d.homedir)(),j=(0,e.join)(i,".cockpit"),k=(0,e.join)(j,"projects"),l=(0,e.join)(j,"state.json"),m=(0,e.join)(j,"pinned-sessions.json"),n=(0,e.join)(j,"push-subscriptions.json"),o=(0,e.join)(j,"note.md"),p=(0,e.join)(j,"scheduled-tasks.json"),q=(0,e.join)(j,"settings.json"),r=(0,e.join)(j,"skills.json"),s=(0,e.join)(j,"review"),t=(0,e.join)(s,"_signal");function u(){try{(0,g.existsSync)(s)||(0,g.mkdirSync)(s,{recursive:!0}),(0,g.writeFileSync)(t,Date.now().toString())}catch{}}let v=(0,e.join)(i,".claude"),w=(0,e.join)(v,"projects"),x=(0,e.join)(i,".claude2"),y=(0,e.join)(x,"projects"),z=(0,e.join)(j,"deepseek"),A=(0,e.join)(z,"projects");function B(a){return a.replace(/[/.]/g,"-")}function C(a){return(0,e.join)(k,B(a))}function D(a){return(0,e.join)(C(a),"session.json")}function E(a){return(0,e.join)(C(a),"recent-files.json")}function F(a){return(0,e.join)(C(a),"expanded-paths.json")}function G(a){return(0,e.join)(C(a),"comments.json")}function H(a){return(0,e.join)(C(a),"services.json")}function I(a){return(0,e.join)(C(a),"note.md")}function J(a,b){return(0,e.join)(C(a),`terminal-history-${b}.jsonl`)}function K(a,b){return(0,e.join)(C(a),`terminal-output-${b}.txt`)}function L(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(C(a),c)}function M(){return(0,e.join)(j,"terminal-aliases.json")}function N(){return(0,e.join)(j,"services.json")}function O(a){return(0,e.join)(C(a),"project-settings.json")}function P(a,b){return(0,e.join)(C(a),`terminal-bubble-order-${b}.json`)}function Q(a){return(0,e.join)(s,`${a}.json`)}function R(a,b){return(0,e.join)((0,e.join)(w,B(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(y,B(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(A,B(a)),`${b}.jsonl`)}function U(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",B(a)),`${b}.jsonl`)}function V(a){let b=(0,e.join)(i,".codex","sessions");if(!(0,g.existsSync)(b))return null;try{let c=(0,h.execSync)(`find ${JSON.stringify(b)} -name "*${a}.jsonl" -type f 2>/dev/null`,{encoding:"utf8",timeout:3e3}).trim();if(c)return c.split("\n")[0]}catch{}return null}function W(a){let b=(0,e.join)(i,".kimi","sessions");if(!(0,g.existsSync)(b))return null;try{for(let c of(0,g.readdirSync)(b)){let d=(0,e.join)(b,c,a,"context.jsonl");if((0,g.existsSync)(d))return d}}catch{}return null}async function X(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function Y(a){let b=(0,e.join)(a,"..");await X(b)}async function Z(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function $(a,b){await Y(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let _=globalThis,aa=_.__cockpitFileLocks??(_.__cockpitFileLocks=new Map);function ab(a,b){let c=(aa.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return aa.set(a,d),d.then(()=>{aa.get(a)===d&&aa.delete(a)}),c}function ac(a,b,c){return ab(a,async()=>{let d=await Z(a,b),e=await c(d);return await $(a,e),e})}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},19771:a=>{a.exports=require("process")},19879:a=>{a.exports=import("@anthropic-ai/claude-agent-sdk")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64513:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>e.fG,dynamic:()=>e.OR,runtime:()=>e.fA});var e=c(7152),f=a([e]);e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})},74075:a=>{a.exports=require("zlib")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},83997:a=>{a.exports=require("tty")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89162:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(64513),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/session/[sessionId]/history/route",pathname:"/api/session/[sessionId]/history",filename:"route",bundlePath:"app/api/session/[sessionId]/history/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session/[sessionId]/history/route.ts",nextConfigOutput:"",userland:v,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/history/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L=F,L="/index"===L?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7184,304],()=>b(b.s=89162));module.exports=c})();
|