@surething/cockpit 1.0.194 → 1.0.196
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 +6 -5
- package/.next-prod/build-manifest.json +3 -3
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/react-loadable-manifest.json +1 -1
- package/.next-prod/routes-manifest.json +6 -0
- package/.next-prod/server/app/_global-error/page.js +3 -3
- 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 +2 -2
- 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 +16 -0
- package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/chat/deepseek/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/chat/kimi/route.js +13 -13
- package/.next-prod/server/app/api/chat/ollama/route.js +2 -2
- package/.next-prod/server/app/api/chat/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/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/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 +1 -1
- package/.next-prod/server/app/api/projects/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/manifest.webmanifest/route.js +2 -2
- package/.next-prod/server/app/page.js +3 -3
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +5 -5
- 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 +6 -5
- package/.next-prod/server/chunks/4098.js +1 -1
- package/.next-prod/server/chunks/4490.js +1 -1
- package/.next-prod/server/chunks/5394.js +1 -1
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/middleware-react-loadable-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +2 -2
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/5dqS4JCjRSMJN3cvcnCBI/_buildManifest.js +1 -0
- package/.next-prod/static/chunks/{700.0aaec5a3a570d182.js → 700.642136ad4fbe16ca.js} +4 -4
- package/.next-prod/static/chunks/app/{api/bash/route-94e40d01eb0846a0.js → _global-error/page-aa58df485295770f.js} +1 -1
- package/.next-prod/static/chunks/app/api/{chat/codex/route-94e40d01eb0846a0.js → bash/route-aa58df485295770f.js} +1 -1
- package/.next-prod/static/chunks/app/api/chat/{kimi/route-94e40d01eb0846a0.js → codex/route-aa58df485295770f.js} +1 -1
- package/.next-prod/static/chunks/app/{_global-error/page-94e40d01eb0846a0.js → api/chat/deepseek/route-aa58df485295770f.js} +1 -1
- package/.next-prod/static/chunks/app/api/chat/kimi/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/ollama/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/claude-stats/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/commands/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/comments/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/db/columns/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/db/connect/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/db/disconnect/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/db/export/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/db/query/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/db/schemas/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/extension/version/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/file/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/blame/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/clipboard/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/copy/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/delete/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/expanded/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/index/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/init/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/paste/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/read/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/readdir/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/recent/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/save/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/search/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/stat/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/files/text/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branches/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commits/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/diff/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/discard/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/stage/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/status/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/unstage/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/git/worktree/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/global-state/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/load/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/save/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/definition/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/hover/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/references/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/status/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/columns/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/connect/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/export/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/query/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/query/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/note/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/models/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/start/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/open-cursor/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/open-vscode/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/pick-folder/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/project-settings/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/project-state/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/projects/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/command/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/connect/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/delete/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/get/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/keys/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/set/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/review/identify/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/review/order/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/review/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/review/share-info/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/review/users/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/services/config/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/services/scripts/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/session-by-path/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/settings/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/[id]/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/content/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/env/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/history/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/api/version/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/app/project/page-3a148e22b1d92a17.js +29 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-aa58df485295770f.js +1 -0
- package/.next-prod/static/chunks/{webpack-9a8ea3995034c536.js → webpack-c669c0003eb75661.js} +1 -1
- package/.next-prod/static/css/18aae55f9fdae00a.css +1 -0
- package/.next-prod/trace +12 -12
- package/.next-prod/trace-build +1 -1
- package/.next-prod/types/app/api/chat/deepseek/route.ts +351 -0
- package/.next-prod/types/routes.d.ts +2 -1
- package/.next-prod/types/validator.ts +9 -0
- package/README.md +154 -61
- package/README.zh.md +141 -54
- package/bin/cock-browser.mjs +19 -19
- package/bin/cock-terminal.mjs +8 -8
- package/bin/cock.mjs +7 -5
- package/bin/cockpit.mjs +14 -0
- package/dist/{chunk-ZDTXJE6Z.mjs → chunk-J6PMXUI4.mjs} +2 -0
- package/dist/scheduledTasks.mjs +1 -1
- package/dist/wsServer.mjs +1 -1
- package/package.json +27 -5
- package/.next-prod/static/GrlHt_NxoSxuOTl-aMQdx/_buildManifest.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/ollama/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/claude-stats/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/commands/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/comments/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/db/columns/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/db/connect/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/db/disconnect/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/db/export/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/db/query/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/db/schemas/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/extension/version/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/file/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/blame/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/clipboard/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/copy/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/delete/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/expanded/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/index/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/init/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/paste/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/read/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/readdir/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/recent/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/save/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/search/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/stat/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/files/text/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branches/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commits/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/diff/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/discard/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/stage/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/status/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/unstage/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/git/worktree/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/global-state/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/load/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/save/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/definition/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/hover/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/references/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/status/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/columns/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/connect/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/export/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/query/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/query/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/note/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/models/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/start/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/open-cursor/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/open-vscode/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/pick-folder/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/project-settings/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/project-state/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/projects/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/command/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/connect/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/delete/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/get/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/keys/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/set/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/review/identify/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/review/order/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/review/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/review/share-info/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/review/users/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/services/config/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/services/scripts/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/session-by-path/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/settings/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/[id]/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/content/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/env/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/history/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/api/version/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/app/project/page-66c22be12277e5c1.js +0 -29
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-94e40d01eb0846a0.js +0 -1
- package/.next-prod/static/css/2a6d4c877711db09.css +0 -1
- /package/.next-prod/static/{GrlHt_NxoSxuOTl-aMQdx → 5dqS4JCjRSMJN3cvcnCBI}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=8387,a.ids=[8387],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>J,A0:()=>T,An:()=>W,BF:()=>F,Ct:()=>N,Eu:()=>E,Ex:()=>t,GB:()=>q,JE:()=>V,JY:()=>I,Ki:()=>z,Kk:()=>O,Kv:()=>j,LN:()=>k,Mx:()=>A,O0:()=>y,Sr:()=>G,Tb:()=>r,Ux:()=>Y,Wd:()=>U,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>R,h9:()=>w,i4:()=>D,iK:()=>o,iy:()=>M,lq:()=>C,ls:()=>H,mT:()=>v,oK:()=>L,oZ:()=>P,of:()=>B,po:()=>K,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>S,yw:()=>Q});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects");function y(a){return a.replace(/[/.]/g,"-")}function z(a){return(0,e.join)(k,y(a))}function A(a){return(0,e.join)(z(a),"session.json")}function B(a){return(0,e.join)(z(a),"recent-files.json")}function C(a){return(0,e.join)(z(a),"expanded-paths.json")}function D(a){return(0,e.join)(z(a),"comments.json")}function E(a){return(0,e.join)(z(a),"services.json")}function F(a){return(0,e.join)(z(a),"note.md")}function G(a,b){return(0,e.join)(z(a),`terminal-history-${b}.jsonl`)}function H(a,b){return(0,e.join)(z(a),`terminal-output-${b}.txt`)}function I(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(z(a),c)}function J(){return(0,e.join)(j,"terminal-aliases.json")}function K(){return(0,e.join)(j,"services.json")}function L(a){return(0,e.join)(z(a),"project-settings.json")}function M(a,b){return(0,e.join)(z(a),`terminal-bubble-order-${b}.json`)}function N(a){return(0,e.join)(r,`${a}.json`)}function O(a,b){return(0,e.join)((0,e.join)(v,y(a)),`${b}.jsonl`)}function P(a,b){return(0,e.join)((0,e.join)(x,y(a)),`${b}.jsonl`)}function Q(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",y(a)),`${b}.jsonl`)}function R(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 S(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 T(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function U(a){let b=(0,e.join)(a,"..");await T(b)}async function V(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function W(a,b){await U(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let X=new Map;function Y(a,b){let c=(X.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return X.set(a,d),d.then(()=>{X.get(a)===d&&X.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},59032:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{GET:()=>x,POST:()=>y});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(23211),w=c(25813);async function x(a){try{let b=a.nextUrl.searchParams,c=b.get("cwd"),d=b.get("scope"),e="global"===d?(0,w.po)():c?(0,w.Eu)(c):null;if(!e)return v.NextResponse.json({error:"Missing cwd or scope"},{status:400});let f=await (0,w.JE)(e,{customCommands:[]});return v.NextResponse.json(f)}catch(a){return console.error("Failed to read services config:",a),v.NextResponse.json({error:a instanceof Error?a.message:"Failed to read config"},{status:500})}}async function y(a){try{let{cwd:b,scope:c,customCommands:d}=await a.json(),e="global"===c?(0,w.po)():b?(0,w.Eu)(b):null;if(!e)return v.NextResponse.json({error:"Missing cwd or scope"},{status:400});return await (0,w.An)(e,{customCommands:d||[]}),v.NextResponse.json({success:!0})}catch(a){return console.error("Failed to write services config:",a),v.NextResponse.json({error:a instanceof Error?a.message:"Failed to write config"},{status:500})}}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:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=59032));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=8387,a.ids=[8387],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>L,A0:()=>W,An:()=>Z,BF:()=>H,Ct:()=>P,Eu:()=>G,Ex:()=>t,GB:()=>q,JE:()=>Y,JY:()=>K,Ki:()=>B,Kk:()=>Q,Kv:()=>j,LN:()=>k,Mx:()=>C,O0:()=>A,Sr:()=>I,Tb:()=>r,Ux:()=>_,Wd:()=>X,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>U,h9:()=>w,i4:()=>F,iK:()=>o,im:()=>S,iy:()=>O,lT:()=>y,lq:()=>E,ls:()=>J,mT:()=>v,oK:()=>N,oZ:()=>R,of:()=>D,po:()=>M,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>V,yw:()=>T});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects"),y=(0,e.join)(j,"deepseek"),z=(0,e.join)(y,"projects");function A(a){return a.replace(/[/.]/g,"-")}function B(a){return(0,e.join)(k,A(a))}function C(a){return(0,e.join)(B(a),"session.json")}function D(a){return(0,e.join)(B(a),"recent-files.json")}function E(a){return(0,e.join)(B(a),"expanded-paths.json")}function F(a){return(0,e.join)(B(a),"comments.json")}function G(a){return(0,e.join)(B(a),"services.json")}function H(a){return(0,e.join)(B(a),"note.md")}function I(a,b){return(0,e.join)(B(a),`terminal-history-${b}.jsonl`)}function J(a,b){return(0,e.join)(B(a),`terminal-output-${b}.txt`)}function K(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(B(a),c)}function L(){return(0,e.join)(j,"terminal-aliases.json")}function M(){return(0,e.join)(j,"services.json")}function N(a){return(0,e.join)(B(a),"project-settings.json")}function O(a,b){return(0,e.join)(B(a),`terminal-bubble-order-${b}.json`)}function P(a){return(0,e.join)(r,`${a}.json`)}function Q(a,b){return(0,e.join)((0,e.join)(v,A(a)),`${b}.jsonl`)}function R(a,b){return(0,e.join)((0,e.join)(x,A(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(z,A(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",A(a)),`${b}.jsonl`)}function U(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 V(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 W(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function X(a){let b=(0,e.join)(a,"..");await W(b)}async function Y(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function Z(a,b){await X(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let $=new Map;function _(a,b){let c=($.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return $.set(a,d),d.then(()=>{$.get(a)===d&&$.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72813:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{GET:()=>x,POST:()=>y});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(23211),w=c(25813);async function x(a){try{let b=a.nextUrl.searchParams,c=b.get("cwd"),d=b.get("scope"),e="global"===d?(0,w.po)():c?(0,w.Eu)(c):null;if(!e)return v.NextResponse.json({error:"Missing cwd or scope"},{status:400});let f=await (0,w.JE)(e,{customCommands:[]});return v.NextResponse.json(f)}catch(a){return console.error("Failed to read services config:",a),v.NextResponse.json({error:a instanceof Error?a.message:"Failed to read config"},{status:500})}}async function y(a){try{let{cwd:b,scope:c,customCommands:d}=await a.json(),e="global"===c?(0,w.po)():b?(0,w.Eu)(b):null;if(!e)return v.NextResponse.json({error:"Missing cwd or scope"},{status:400});return await (0,w.An)(e,{customCommands:d||[]}),v.NextResponse.json({success:!0})}catch(a){return console.error("Failed to write services config:",a),v.NextResponse.json({error:a instanceof Error?a.message:"Failed to write config"},{status:500})}}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:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=72813));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=4647,a.ids=[4647],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},
|
|
1
|
+
(()=>{var a={};a.id=4647,a.ids=[4647],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12861:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{GET:()=>z});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(23211),w=c(79748),x=c(33873),y=c(29021);async function z(a){try{let b=a.nextUrl.searchParams.get("cwd");if(!b)return v.NextResponse.json({error:"Missing cwd"},{status:400});let c=(0,x.join)(b,"package.json");if(!(0,y.existsSync)(c))return v.NextResponse.json({scripts:{}});let d=await (0,w.readFile)(c,"utf-8"),e=JSON.parse(d).scripts||{};return v.NextResponse.json({scripts:e})}catch(a){return console.error("Failed to read package.json:",a),v.NextResponse.json({error:a instanceof Error?a.message:"Failed to read package.json"},{status:500})}}let A=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:d,...{}}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),A.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/services/scripts/route";"/index"===d&&(d="/");let e=await A.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||A.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===A.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await A.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>A.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>A.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 A.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await A.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=12861));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=3347,a.ids=[3347],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{"use strict";a.exports=require("readline")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>J,A0:()=>T,An:()=>W,BF:()=>F,Ct:()=>N,Eu:()=>E,Ex:()=>t,GB:()=>q,JE:()=>V,JY:()=>I,Ki:()=>z,Kk:()=>O,Kv:()=>j,LN:()=>k,Mx:()=>A,O0:()=>y,Sr:()=>G,Tb:()=>r,Ux:()=>Y,Wd:()=>U,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>R,h9:()=>w,i4:()=>D,iK:()=>o,iy:()=>M,lq:()=>C,ls:()=>H,mT:()=>v,oK:()=>L,oZ:()=>P,of:()=>B,po:()=>K,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>S,yw:()=>Q});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects");function y(a){return a.replace(/[/.]/g,"-")}function z(a){return(0,e.join)(k,y(a))}function A(a){return(0,e.join)(z(a),"session.json")}function B(a){return(0,e.join)(z(a),"recent-files.json")}function C(a){return(0,e.join)(z(a),"expanded-paths.json")}function D(a){return(0,e.join)(z(a),"comments.json")}function E(a){return(0,e.join)(z(a),"services.json")}function F(a){return(0,e.join)(z(a),"note.md")}function G(a,b){return(0,e.join)(z(a),`terminal-history-${b}.jsonl`)}function H(a,b){return(0,e.join)(z(a),`terminal-output-${b}.txt`)}function I(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(z(a),c)}function J(){return(0,e.join)(j,"terminal-aliases.json")}function K(){return(0,e.join)(j,"services.json")}function L(a){return(0,e.join)(z(a),"project-settings.json")}function M(a,b){return(0,e.join)(z(a),`terminal-bubble-order-${b}.json`)}function N(a){return(0,e.join)(r,`${a}.json`)}function O(a,b){return(0,e.join)((0,e.join)(v,y(a)),`${b}.jsonl`)}function P(a,b){return(0,e.join)((0,e.join)(x,y(a)),`${b}.jsonl`)}function Q(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",y(a)),`${b}.jsonl`)}function R(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 S(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 T(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function U(a){let b=(0,e.join)(a,"..");await T(b)}async function V(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function W(a,b){await U(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let X=new Map;function Y(a,b){let c=(X.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return X.set(a,d),d.then(()=>{X.get(a)===d&&X.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},83201:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>I,patchFetch:()=>H,routeModule:()=>D,serverHooks:()=>G,workAsyncStorage:()=>E,workUnitAsyncStorage:()=>F});var d={};c.r(d),c.d(d,{POST:()=>C,runtime:()=>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(23211),w=c(29021),x=c(79748),y=c(4984),z=c(55511),A=c(25813);let B="nodejs";async function C(a,{params:b}){try{let{sessionId:c}=await b,{cwd:d,fromMessageUuid:e}=await a.json();if(!d)return v.NextResponse.json({error:"Missing cwd parameter"},{status:400});let f=(0,A.Kk)(d,c);if(!(0,w.existsSync)(f))return v.NextResponse.json({error:"Original session not found"},{status:404});let g=(0,z.randomUUID)(),h=[],i=(0,w.createReadStream)(f),j=(0,y.createInterface)({input:i,crlfDelay:1/0}),k="collecting";for await(let a of j){if("done"===k)break;if(a.trim())try{let b=JSON.parse(a);if("found_target"===k&&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)){k="done";break}e&&b.uuid===e&&(k="found_target"),b.sessionId=g,h.push(JSON.stringify(b))}catch{let b=a.replace(RegExp(c,"g"),g);h.push(b)}}let l=(0,A.Kk)(d,g);return await (0,x.writeFile)(l,h.join("\n")+"\n","utf-8"),v.NextResponse.json({success:!0,originalSessionId:c,newSessionId:g,messageCount:h.length})}catch(a){return console.error("Fork session error:",a),v.NextResponse.json({error:"Failed to fork session"},{status:500})}}let D=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:d,...{}}),{workAsyncStorage:E,workUnitAsyncStorage:F,serverHooks:G}=D;function H(){return(0,g.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:F})}async function I(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),D.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/fork/route";"/index"===d&&(d="/");let e=await D.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||D.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===D.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await D.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>D.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>D.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 D.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await D.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await D.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=83201));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=3347,a.ids=[3347],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{"use strict";a.exports=require("readline")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>L,A0:()=>W,An:()=>Z,BF:()=>H,Ct:()=>P,Eu:()=>G,Ex:()=>t,GB:()=>q,JE:()=>Y,JY:()=>K,Ki:()=>B,Kk:()=>Q,Kv:()=>j,LN:()=>k,Mx:()=>C,O0:()=>A,Sr:()=>I,Tb:()=>r,Ux:()=>_,Wd:()=>X,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>U,h9:()=>w,i4:()=>F,iK:()=>o,im:()=>S,iy:()=>O,lT:()=>y,lq:()=>E,ls:()=>J,mT:()=>v,oK:()=>N,oZ:()=>R,of:()=>D,po:()=>M,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>V,yw:()=>T});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects"),y=(0,e.join)(j,"deepseek"),z=(0,e.join)(y,"projects");function A(a){return a.replace(/[/.]/g,"-")}function B(a){return(0,e.join)(k,A(a))}function C(a){return(0,e.join)(B(a),"session.json")}function D(a){return(0,e.join)(B(a),"recent-files.json")}function E(a){return(0,e.join)(B(a),"expanded-paths.json")}function F(a){return(0,e.join)(B(a),"comments.json")}function G(a){return(0,e.join)(B(a),"services.json")}function H(a){return(0,e.join)(B(a),"note.md")}function I(a,b){return(0,e.join)(B(a),`terminal-history-${b}.jsonl`)}function J(a,b){return(0,e.join)(B(a),`terminal-output-${b}.txt`)}function K(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(B(a),c)}function L(){return(0,e.join)(j,"terminal-aliases.json")}function M(){return(0,e.join)(j,"services.json")}function N(a){return(0,e.join)(B(a),"project-settings.json")}function O(a,b){return(0,e.join)(B(a),`terminal-bubble-order-${b}.json`)}function P(a){return(0,e.join)(r,`${a}.json`)}function Q(a,b){return(0,e.join)((0,e.join)(v,A(a)),`${b}.jsonl`)}function R(a,b){return(0,e.join)((0,e.join)(x,A(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(z,A(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",A(a)),`${b}.jsonl`)}function U(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 V(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 W(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function X(a){let b=(0,e.join)(a,"..");await W(b)}async function Y(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function Z(a,b){await X(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let $=new Map;function _(a,b){let c=($.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return $.set(a,d),d.then(()=>{$.get(a)===d&&$.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29691:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>I,patchFetch:()=>H,routeModule:()=>D,serverHooks:()=>G,workAsyncStorage:()=>E,workUnitAsyncStorage:()=>F});var d={};c.r(d),c.d(d,{POST:()=>C,runtime:()=>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(23211),w=c(29021),x=c(79748),y=c(4984),z=c(55511),A=c(25813);let B="nodejs";async function C(a,{params:b}){try{let{sessionId:c}=await b,{cwd:d,fromMessageUuid:e}=await a.json();if(!d)return v.NextResponse.json({error:"Missing cwd parameter"},{status:400});let f=(0,A.Kk)(d,c);if(!(0,w.existsSync)(f))return v.NextResponse.json({error:"Original session not found"},{status:404});let g=(0,z.randomUUID)(),h=[],i=(0,w.createReadStream)(f),j=(0,y.createInterface)({input:i,crlfDelay:1/0}),k="collecting";for await(let a of j){if("done"===k)break;if(a.trim())try{let b=JSON.parse(a);if("found_target"===k&&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)){k="done";break}e&&b.uuid===e&&(k="found_target"),b.sessionId=g,h.push(JSON.stringify(b))}catch{let b=a.replace(RegExp(c,"g"),g);h.push(b)}}let l=(0,A.Kk)(d,g);return await (0,x.writeFile)(l,h.join("\n")+"\n","utf-8"),v.NextResponse.json({success:!0,originalSessionId:c,newSessionId:g,messageCount:h.length})}catch(a){return console.error("Fork session error:",a),v.NextResponse.json({error:"Failed to fork session"},{status:500})}}let D=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:d,...{}}),{workAsyncStorage:E,workUnitAsyncStorage:F,serverHooks:G}=D;function H(){return(0,g.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:F})}async function I(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),D.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/fork/route";"/index"===d&&(d="/");let e=await D.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||D.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===D.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await D.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>D.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>D.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 D.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await D.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await D.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=29691));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=5849,a.ids=[5849],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},4984:a=>{"use strict";a.exports=require("readline")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>J,A0:()=>T,An:()=>W,BF:()=>F,Ct:()=>N,Eu:()=>E,Ex:()=>t,GB:()=>q,JE:()=>V,JY:()=>I,Ki:()=>z,Kk:()=>O,Kv:()=>j,LN:()=>k,Mx:()=>A,O0:()=>y,Sr:()=>G,Tb:()=>r,Ux:()=>Y,Wd:()=>U,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>R,h9:()=>w,i4:()=>D,iK:()=>o,iy:()=>M,lq:()=>C,ls:()=>H,mT:()=>v,oK:()=>L,oZ:()=>P,of:()=>B,po:()=>K,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>S,yw:()=>Q});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects");function y(a){return a.replace(/[/.]/g,"-")}function z(a){return(0,e.join)(k,y(a))}function A(a){return(0,e.join)(z(a),"session.json")}function B(a){return(0,e.join)(z(a),"recent-files.json")}function C(a){return(0,e.join)(z(a),"expanded-paths.json")}function D(a){return(0,e.join)(z(a),"comments.json")}function E(a){return(0,e.join)(z(a),"services.json")}function F(a){return(0,e.join)(z(a),"note.md")}function G(a,b){return(0,e.join)(z(a),`terminal-history-${b}.jsonl`)}function H(a,b){return(0,e.join)(z(a),`terminal-output-${b}.txt`)}function I(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(z(a),c)}function J(){return(0,e.join)(j,"terminal-aliases.json")}function K(){return(0,e.join)(j,"services.json")}function L(a){return(0,e.join)(z(a),"project-settings.json")}function M(a,b){return(0,e.join)(z(a),`terminal-bubble-order-${b}.json`)}function N(a){return(0,e.join)(r,`${a}.json`)}function O(a,b){return(0,e.join)((0,e.join)(v,y(a)),`${b}.jsonl`)}function P(a,b){return(0,e.join)((0,e.join)(x,y(a)),`${b}.jsonl`)}function Q(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",y(a)),`${b}.jsonl`)}function R(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 S(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 T(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function U(a){let b=(0,e.join)(a,"..");await T(b)}async function V(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function W(a,b){await U(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let X=new Map;function Y(a,b){let c=(X.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return X.set(a,d),d.then(()=>{X.get(a)===d&&X.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},36302:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{GET:()=>A,dynamic:()=>z,runtime:()=>y});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(29021),w=c(4984),x=c(25813);let y="nodejs",z="force-dynamic";async function A(a,{params:b}){try{let{sessionId:a}=await b;if(!a)return new Response(JSON.stringify({error:"Missing sessionId"}),{status:400,headers:{"Content-Type":"application/json"}});let c=process.cwd(),d=(0,x.Kk)(c,a);if(!v.existsSync(d))return new Response(JSON.stringify({error:"Session not found",messages:[]}),{status:404,headers:{"Content-Type":"application/json"}});let e=await B(d);return new Response(JSON.stringify({messages:e}),{status:200,headers:{"Content-Type":"application/json"}})}catch(a){return console.error("History API error:",a),new Response(JSON.stringify({error:"Internal server error"}),{status:500,headers:{"Content-Type":"application/json"}})}}async function B(a){let b=v.createReadStream(a),c=w.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)}let C=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:d,...{}}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/history/route";"/index"===d&&(d="/");let e=await C.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||C.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===C.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await C.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>C.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>C.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&D&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await C.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=36302));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=5849,a.ids=[5849],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},4984:a=>{"use strict";a.exports=require("readline")},6714:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{GET:()=>A,dynamic:()=>z,runtime:()=>y});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(29021),w=c(4984),x=c(25813);let y="nodejs",z="force-dynamic";async function A(a,{params:b}){try{let{sessionId:a}=await b;if(!a)return new Response(JSON.stringify({error:"Missing sessionId"}),{status:400,headers:{"Content-Type":"application/json"}});let c=process.cwd(),d=(0,x.Kk)(c,a);if(!v.existsSync(d))return new Response(JSON.stringify({error:"Session not found",messages:[]}),{status:404,headers:{"Content-Type":"application/json"}});let e=await B(d);return new Response(JSON.stringify({messages:e}),{status:200,headers:{"Content-Type":"application/json"}})}catch(a){return console.error("History API error:",a),new Response(JSON.stringify({error:"Internal server error"}),{status:500,headers:{"Content-Type":"application/json"}})}}async function B(a){let b=v.createReadStream(a),c=w.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)}let C=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:d,...{}}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session/[sessionId]/history/route";"/index"===d&&(d="/");let e=await C.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||C.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===C.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await C.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>C.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>C.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&D&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await C.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>L,A0:()=>W,An:()=>Z,BF:()=>H,Ct:()=>P,Eu:()=>G,Ex:()=>t,GB:()=>q,JE:()=>Y,JY:()=>K,Ki:()=>B,Kk:()=>Q,Kv:()=>j,LN:()=>k,Mx:()=>C,O0:()=>A,Sr:()=>I,Tb:()=>r,Ux:()=>_,Wd:()=>X,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>U,h9:()=>w,i4:()=>F,iK:()=>o,im:()=>S,iy:()=>O,lT:()=>y,lq:()=>E,ls:()=>J,mT:()=>v,oK:()=>N,oZ:()=>R,of:()=>D,po:()=>M,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>V,yw:()=>T});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects"),y=(0,e.join)(j,"deepseek"),z=(0,e.join)(y,"projects");function A(a){return a.replace(/[/.]/g,"-")}function B(a){return(0,e.join)(k,A(a))}function C(a){return(0,e.join)(B(a),"session.json")}function D(a){return(0,e.join)(B(a),"recent-files.json")}function E(a){return(0,e.join)(B(a),"expanded-paths.json")}function F(a){return(0,e.join)(B(a),"comments.json")}function G(a){return(0,e.join)(B(a),"services.json")}function H(a){return(0,e.join)(B(a),"note.md")}function I(a,b){return(0,e.join)(B(a),`terminal-history-${b}.jsonl`)}function J(a,b){return(0,e.join)(B(a),`terminal-output-${b}.txt`)}function K(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(B(a),c)}function L(){return(0,e.join)(j,"terminal-aliases.json")}function M(){return(0,e.join)(j,"services.json")}function N(a){return(0,e.join)(B(a),"project-settings.json")}function O(a,b){return(0,e.join)(B(a),`terminal-bubble-order-${b}.json`)}function P(a){return(0,e.join)(r,`${a}.json`)}function Q(a,b){return(0,e.join)((0,e.join)(v,A(a)),`${b}.jsonl`)}function R(a,b){return(0,e.join)((0,e.join)(x,A(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(z,A(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",A(a)),`${b}.jsonl`)}function U(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 V(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 W(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function X(a){let b=(0,e.join)(a,"..");await W(b)}async function Y(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function Z(a,b){await X(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let $=new Map;function _(a,b){let c=($.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return $.set(a,d),d.then(()=>{$.get(a)===d&&$.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=6714));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=3456,a.ids=[3456],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},4984:a=>{"use strict";a.exports=require("readline")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>J,A0:()=>T,An:()=>W,BF:()=>F,Ct:()=>N,Eu:()=>E,Ex:()=>t,GB:()=>q,JE:()=>V,JY:()=>I,Ki:()=>z,Kk:()=>O,Kv:()=>j,LN:()=>k,Mx:()=>A,O0:()=>y,Sr:()=>G,Tb:()=>r,Ux:()=>Y,Wd:()=>U,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>R,h9:()=>w,i4:()=>D,iK:()=>o,iy:()=>M,lq:()=>C,ls:()=>H,mT:()=>v,oK:()=>L,oZ:()=>P,of:()=>B,po:()=>K,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>S,yw:()=>Q});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects");function y(a){return a.replace(/[/.]/g,"-")}function z(a){return(0,e.join)(k,y(a))}function A(a){return(0,e.join)(z(a),"session.json")}function B(a){return(0,e.join)(z(a),"recent-files.json")}function C(a){return(0,e.join)(z(a),"expanded-paths.json")}function D(a){return(0,e.join)(z(a),"comments.json")}function E(a){return(0,e.join)(z(a),"services.json")}function F(a){return(0,e.join)(z(a),"note.md")}function G(a,b){return(0,e.join)(z(a),`terminal-history-${b}.jsonl`)}function H(a,b){return(0,e.join)(z(a),`terminal-output-${b}.txt`)}function I(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(z(a),c)}function J(){return(0,e.join)(j,"terminal-aliases.json")}function K(){return(0,e.join)(j,"services.json")}function L(a){return(0,e.join)(z(a),"project-settings.json")}function M(a,b){return(0,e.join)(z(a),`terminal-bubble-order-${b}.json`)}function N(a){return(0,e.join)(r,`${a}.json`)}function O(a,b){return(0,e.join)((0,e.join)(v,y(a)),`${b}.jsonl`)}function P(a,b){return(0,e.join)((0,e.join)(x,y(a)),`${b}.jsonl`)}function Q(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",y(a)),`${b}.jsonl`)}function R(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 S(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 T(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function U(a){let b=(0,e.join)(a,"..");await T(b)}async function V(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function W(a,b){await U(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let X=new Map;function Y(a,b){let c=(X.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return X.set(a,d),d.then(()=>{X.get(a)===d&&X.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71040:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{POST:()=>A,dynamic:()=>z,runtime:()=>y});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(29021),w=c(4984),x=c(25813);let y="nodejs",z="force-dynamic";async function A(a){try{var b;let c,d=await a.json(),e=d.cwd,f=d.sessionId,g=d.limit,h=d.beforeTurnIndex,i=d.ifFingerprint;if(!e||!f)return new Response(JSON.stringify({error:"Missing cwd or sessionId"}),{status:400,headers:{"Content-Type":"application/json"}});let j=(0,x.Kk)(e,f),k="claude";if(!v.existsSync(j)){let a=(0,x.oZ)(e,f);if(v.existsSync(a))j=a,k="claude2";else{let a=(0,x.eg)(f);if(a)j=a,k="codex";else{let a=(0,x.vI)(f);if(a)j=a,k="kimi";else{let a=(0,x.yw)(e,f);if(!v.existsSync(a))return new Response(JSON.stringify({error:"Session not found",messages:[]}),{status:404,headers:{"Content-Type":"application/json"}});j=a,k="ollama"}}}}let l=(b=j,c=v.statSync(b),`${c.mtimeMs}-${c.size}`);if(i&&i===l)return new Response(JSON.stringify({notModified:!0,fingerprint:l}),{status:200,headers:{"Content-Type":"application/json"}});let m="codex"===k?await C(j):"kimi"===k?await D(j):"ollama"===k?await (async()=>{let a=await B(j,g,h);return 0===a.messages.length?await E(j):a})():await B(j,g,h),{messages:n,title:o,usage:p}=m,q="totalTurns"in m?m.totalTurns:0,r="hasMore"in m&&m.hasMore;return new Response(JSON.stringify({messages:n,sessionId:f,title:o,usage:p,totalTurns:q,hasMore:r,fingerprint:l}),{status:200,headers:{"Content-Type":"application/json"}})}catch(a){return console.error("Session by path API error:",a),new Response(JSON.stringify({error:"Internal server error"}),{status:500,headers:{"Content-Type":"application/json"}})}}async function B(a,b,c){let d,e=v.createReadStream(a),f=w.createInterface({input:e,crlfDelay:1/0}),g=[],h="",i=[];for await(let a of f)try{let b=JSON.parse(a);if("user"===b.type||"assistant"===b.type){if("user"===b.type&&g.length>0){let a=g[g.length-1];if("user"===a.type&&a.timestamp&&b.timestamp&&1e3>Math.abs(new Date(b.timestamp).getTime()-new Date(a.timestamp).getTime())&&JSON.stringify(a.message?.content)===JSON.stringify(b.message?.content))continue}if(g.push(b),"assistant"===b.type&&b.message?.usage&&(d=b.message.usage),"user"===b.type&&!b.isMeta&&b.message?.content){let a=b.message.content;if("string"==typeof a)i.push(a);else if(Array.isArray(a))for(let b of a.filter(a=>"text"===a.type))b.text&&i.push(b.text)}}"summary"===b.type&&b.summary&&(h=b.summary)}catch{}let j=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:"",timestamp:e.timestamp,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}(g),k=function(a,b){if(a)return a;let c="";for(let a of b){let b=function(a){let b=a.match(/<command-args>([^<]*)<\/command-args>/);if(b&&b[1].trim())return b[1].trim();let c=a.match(/<command-name>([^<]*)<\/command-name>/);if(c&&c[1].trim())return c[1].trim();let d=a.replace(/<command-message>[^<]*<\/command-message>/g,"");return(d=(d=(d=(d=d.replace(/<command-name>[^<]*<\/command-name>/g,"")).replace(/<command-args>[^<]*<\/command-args>/g,"")).replace(/<local-command-stdout>[\s\S]*?<\/local-command-stdout>/g,"")).replace(/<local-command-caveat>[\s\S]*?<\/local-command-caveat>/g,"")).trim()}(a);if(b){if(b.startsWith("/")&&!c){c=b;continue}if(c)return`${c} ${b}`;return b}}return c||"Untitled Session"}(h,i),l=[],m=[];for(let a of j)"user"===a.role?(m.length>0&&l.push(m),m=[a]):m.push(a);m.length>0&&l.push(m);let n=l.length;if(void 0===b)return{messages:j,title:k,usage:d,totalTurns:n,hasMore:!1};let o=void 0!==c?c:n,p=Math.max(0,o-b),q=p>0;return{messages:l.slice(p,o).flat(),title:k,usage:d,totalTurns:n,hasMore:q}}async function C(a){let b,c=v.createReadStream(a),d=w.createInterface({input:c,crlfDelay:1/0}),e=[],f=null,g="Untitled Session",h=0,i=()=>{f&&(e.push(f),f=null)},j=a=>(f||(f={id:`codex-assistant-${h++}`,role:"assistant",content:"",toolCalls:[],timestamp:a}),f);for await(let a of d){let c;if(!a.trim())continue;try{c=JSON.parse(a)}catch{continue}let{type:d,payload:f,timestamp:k}=c;if(f){if("response_item"===d){if("message"===f.type&&"user"===f.role){let a=f.content?.filter(a=>"input_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(!a||a.startsWith("<")||a.startsWith("#"))continue;i(),e.push({id:`codex-user-${h++}`,role:"user",content:a,timestamp:k}),"Untitled Session"===g&&(g=a.slice(0,80))}if("message"===f.type&&"assistant"===f.role){let a=f.content?.filter(a=>"output_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(a){let b=j(k);b.content=(b.content||"")+a}}if(f.type,"function_call"===f.type&&f.name){let a=j(k),b={};try{b=JSON.parse(f.arguments||"{}")}catch{}a.toolCalls=a.toolCalls||[],a.toolCalls.push({id:f.call_id||`tool-${h++}`,name:"shell_command"===f.name?"Bash":f.name,input:b,isLoading:!1})}if("function_call_output"===f.type&&f.call_id){let a=j(k),b=a.toolCalls?.find(a=>a.id===f.call_id);b&&(b.result=f.output||"",b.isLoading=!1)}}if("response_completed"===d){let a=f.usage;a&&(b=a),i()}}}return i(),{messages:e,title:g,usage:b}}async function D(a){let b=v.createReadStream(a),c=w.createInterface({input:b,crlfDelay:1/0}),d=[],e="Untitled Session",f=0;for await(let a of c){let b;if(a.trim()){try{b=JSON.parse(a)}catch{continue}if(!(!b.role||b.role.startsWith("_"))){if("user"===b.role){let a="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(!a||a.startsWith("<system")||a.startsWith("<environment")||a.startsWith("# AGENTS.md")||a.startsWith("<permissions"))continue;d.push({id:`kimi-user-${f++}`,role:"user",content:a}),"Untitled Session"===e&&(e=a.slice(0,80))}if("assistant"===b.role){let a="";if("string"==typeof b.content)a=b.content;else if(Array.isArray(b.content))for(let c of b.content)"text"===c.type&&c.text&&(a+=c.text);let c=[],e=b.tool_calls;if(e&&Array.isArray(e)){for(let a of e)if(a.function?.name){let b={};try{b=JSON.parse(a.function.arguments||"{}")}catch{}c.push({id:a.id||`tool-${f++}`,name:"Shell"===a.function.name?"Bash":a.function.name,input:b,isLoading:!1})}}let g=d.length>0?d[d.length-1]:null;g&&"assistant"===g.role&&g.toolCalls&&g.toolCalls.length>0?(c.length>0&&g.toolCalls.push(...c),a&&(g.content=(g.content||"")+a)):(a||c.length>0)&&d.push({id:`kimi-assistant-${f++}`,role:"assistant",content:a,...c.length>0?{toolCalls:c}:{}})}if("tool"===b.role){let a=b.tool_call_id;if(a&&d.length>0){let c=d[d.length-1];if("assistant"===c.role&&c.toolCalls){let d=c.toolCalls.find(b=>b.id===a);if(d){let a="";"string"==typeof b.content?a=b.content:Array.isArray(b.content)&&(a=b.content.filter(a=>"text"===a.type&&a.text).map(a=>a.text).join("\n")),d.result=a}}}}}}}return{messages:d,title:e}}async function E(a){let b=v.createReadStream(a),c=w.createInterface({input:b,crlfDelay:1/0}),d="Untitled Session",e=0,f=[],g=new Map;for await(let a of c)if(a.trim()){f.push(a);try{let b=JSON.parse(a);if("tool"===b.role&&Array.isArray(b.content))for(let a of b.content)"tool-result"===a.type&&a.toolCallId&&g.set(a.toolCallId,String(a.result??""))}catch{}}let h=[],i=null,j=()=>{i&&(h.push(i),i=null)};for(let a of f)try{let b=JSON.parse(a);if("user"===b.role){j();let a="";"string"==typeof b.content?a=b.content:Array.isArray(b.content)&&(a=b.content.filter(a=>"text"===a.type).map(a=>a.text||"").join("\n")),"Untitled Session"===d&&a&&(d=a.slice(0,80)),h.push({id:`ollama-user-${e++}`,role:"user",content:a})}else if("assistant"===b.role){let a="",c=[];if("string"==typeof b.content)a=b.content;else if(Array.isArray(b.content)){for(let d of b.content)if("text"===d.type&&"string"==typeof d.text)a+=(a?"\n":"")+d.text;else if("tool-call"===d.type){let a=String(d.toolCallId||""),b=String(d.toolName||""),e={};try{"string"==typeof d.args?e=JSON.parse(d.args):"object"==typeof d.args&&null!==d.args&&(e=d.args)}catch{}c.push({id:a,name:b,input:e,result:g.get(a),isLoading:!1})}}i?i.content+=(i.content&&a?"\n":"")+a:i={id:`ollama-assistant-${e++}`,role:"assistant",content:a,toolCalls:[]},c.length>0&&(i.toolCalls=i.toolCalls||[],i.toolCalls.push(...c))}}catch{}return j(),{messages:h,title:d}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/session-by-path/route",pathname:"/api/session-by-path",filename:"route",bundlePath:"app/api/session-by-path/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session-by-path/route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session-by-path/route";"/index"===d&&(d="/");let e=await F.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||F.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===F.isDev||!I,M=I&&!L;G&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>F.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>F.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await F.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=71040));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=3456,a.ids=[3456],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},4984:a=>{"use strict";a.exports=require("readline")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>L,A0:()=>W,An:()=>Z,BF:()=>H,Ct:()=>P,Eu:()=>G,Ex:()=>t,GB:()=>q,JE:()=>Y,JY:()=>K,Ki:()=>B,Kk:()=>Q,Kv:()=>j,LN:()=>k,Mx:()=>C,O0:()=>A,Sr:()=>I,Tb:()=>r,Ux:()=>_,Wd:()=>X,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>U,h9:()=>w,i4:()=>F,iK:()=>o,im:()=>S,iy:()=>O,lT:()=>y,lq:()=>E,ls:()=>J,mT:()=>v,oK:()=>N,oZ:()=>R,of:()=>D,po:()=>M,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>V,yw:()=>T});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects"),y=(0,e.join)(j,"deepseek"),z=(0,e.join)(y,"projects");function A(a){return a.replace(/[/.]/g,"-")}function B(a){return(0,e.join)(k,A(a))}function C(a){return(0,e.join)(B(a),"session.json")}function D(a){return(0,e.join)(B(a),"recent-files.json")}function E(a){return(0,e.join)(B(a),"expanded-paths.json")}function F(a){return(0,e.join)(B(a),"comments.json")}function G(a){return(0,e.join)(B(a),"services.json")}function H(a){return(0,e.join)(B(a),"note.md")}function I(a,b){return(0,e.join)(B(a),`terminal-history-${b}.jsonl`)}function J(a,b){return(0,e.join)(B(a),`terminal-output-${b}.txt`)}function K(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(B(a),c)}function L(){return(0,e.join)(j,"terminal-aliases.json")}function M(){return(0,e.join)(j,"services.json")}function N(a){return(0,e.join)(B(a),"project-settings.json")}function O(a,b){return(0,e.join)(B(a),`terminal-bubble-order-${b}.json`)}function P(a){return(0,e.join)(r,`${a}.json`)}function Q(a,b){return(0,e.join)((0,e.join)(v,A(a)),`${b}.jsonl`)}function R(a,b){return(0,e.join)((0,e.join)(x,A(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(z,A(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",A(a)),`${b}.jsonl`)}function U(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 V(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 W(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function X(a){let b=(0,e.join)(a,"..");await W(b)}async function Y(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function Z(a,b){await X(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let $=new Map;function _(a,b){let c=($.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return $.set(a,d),d.then(()=>{$.get(a)===d&&$.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44339:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{POST:()=>A,dynamic:()=>z,runtime:()=>y});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(29021),w=c(4984),x=c(25813);let y="nodejs",z="force-dynamic";async function A(a){try{var b;let c,d=await a.json(),e=d.cwd,f=d.sessionId,g=d.limit,h=d.beforeTurnIndex,i=d.ifFingerprint;if(!e||!f)return new Response(JSON.stringify({error:"Missing cwd or sessionId"}),{status:400,headers:{"Content-Type":"application/json"}});let j=(0,x.Kk)(e,f),k="claude";if(!v.existsSync(j)){let a=(0,x.oZ)(e,f);if(v.existsSync(a))j=a,k="claude2";else{let a=(0,x.im)(e,f);if(v.existsSync(a))j=a,k="deepseek";else{let a=(0,x.eg)(f);if(a)j=a,k="codex";else{let a=(0,x.vI)(f);if(a)j=a,k="kimi";else{let a=(0,x.yw)(e,f);if(!v.existsSync(a))return new Response(JSON.stringify({error:"Session not found",messages:[]}),{status:404,headers:{"Content-Type":"application/json"}});j=a,k="ollama"}}}}}let l=(b=j,c=v.statSync(b),`${c.mtimeMs}-${c.size}`);if(i&&i===l)return new Response(JSON.stringify({notModified:!0,fingerprint:l}),{status:200,headers:{"Content-Type":"application/json"}});let m="codex"===k?await C(j):"kimi"===k?await D(j):"ollama"===k?await (async()=>{let a=await B(j,g,h);return 0===a.messages.length?await E(j):a})():await B(j,g,h),{messages:n,title:o,usage:p}=m,q="totalTurns"in m?m.totalTurns:0,r="hasMore"in m&&m.hasMore;return new Response(JSON.stringify({messages:n,sessionId:f,title:o,usage:p,totalTurns:q,hasMore:r,fingerprint:l}),{status:200,headers:{"Content-Type":"application/json"}})}catch(a){return console.error("Session by path API error:",a),new Response(JSON.stringify({error:"Internal server error"}),{status:500,headers:{"Content-Type":"application/json"}})}}async function B(a,b,c){let d,e=v.createReadStream(a),f=w.createInterface({input:e,crlfDelay:1/0}),g=[],h="",i=[];for await(let a of f)try{let b=JSON.parse(a);if("user"===b.type||"assistant"===b.type){if("user"===b.type&&g.length>0){let a=g[g.length-1];if("user"===a.type&&a.timestamp&&b.timestamp&&1e3>Math.abs(new Date(b.timestamp).getTime()-new Date(a.timestamp).getTime())&&JSON.stringify(a.message?.content)===JSON.stringify(b.message?.content))continue}if(g.push(b),"assistant"===b.type&&b.message?.usage&&(d=b.message.usage),"user"===b.type&&!b.isMeta&&b.message?.content){let a=b.message.content;if("string"==typeof a)i.push(a);else if(Array.isArray(a))for(let b of a.filter(a=>"text"===a.type))b.text&&i.push(b.text)}}"summary"===b.type&&b.summary&&(h=b.summary)}catch{}let j=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:"",timestamp:e.timestamp,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}(g),k=function(a,b){if(a)return a;let c="";for(let a of b){let b=function(a){let b=a.match(/<command-args>([^<]*)<\/command-args>/);if(b&&b[1].trim())return b[1].trim();let c=a.match(/<command-name>([^<]*)<\/command-name>/);if(c&&c[1].trim())return c[1].trim();let d=a.replace(/<command-message>[^<]*<\/command-message>/g,"");return(d=(d=(d=(d=d.replace(/<command-name>[^<]*<\/command-name>/g,"")).replace(/<command-args>[^<]*<\/command-args>/g,"")).replace(/<local-command-stdout>[\s\S]*?<\/local-command-stdout>/g,"")).replace(/<local-command-caveat>[\s\S]*?<\/local-command-caveat>/g,"")).trim()}(a);if(b){if(b.startsWith("/")&&!c){c=b;continue}if(c)return`${c} ${b}`;return b}}return c||"Untitled Session"}(h,i),l=[],m=[];for(let a of j)"user"===a.role?(m.length>0&&l.push(m),m=[a]):m.push(a);m.length>0&&l.push(m);let n=l.length;if(void 0===b)return{messages:j,title:k,usage:d,totalTurns:n,hasMore:!1};let o=void 0!==c?c:n,p=Math.max(0,o-b),q=p>0;return{messages:l.slice(p,o).flat(),title:k,usage:d,totalTurns:n,hasMore:q}}async function C(a){let b,c=v.createReadStream(a),d=w.createInterface({input:c,crlfDelay:1/0}),e=[],f=null,g="Untitled Session",h=0,i=()=>{f&&(e.push(f),f=null)},j=a=>(f||(f={id:`codex-assistant-${h++}`,role:"assistant",content:"",toolCalls:[],timestamp:a}),f);for await(let a of d){let c;if(!a.trim())continue;try{c=JSON.parse(a)}catch{continue}let{type:d,payload:f,timestamp:k}=c;if(f){if("response_item"===d){if("message"===f.type&&"user"===f.role){let a=f.content?.filter(a=>"input_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(!a||a.startsWith("<")||a.startsWith("#"))continue;i(),e.push({id:`codex-user-${h++}`,role:"user",content:a,timestamp:k}),"Untitled Session"===g&&(g=a.slice(0,80))}if("message"===f.type&&"assistant"===f.role){let a=f.content?.filter(a=>"output_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(a){let b=j(k);b.content=(b.content||"")+a}}if(f.type,"function_call"===f.type&&f.name){let a=j(k),b={};try{b=JSON.parse(f.arguments||"{}")}catch{}a.toolCalls=a.toolCalls||[],a.toolCalls.push({id:f.call_id||`tool-${h++}`,name:"shell_command"===f.name?"Bash":f.name,input:b,isLoading:!1})}if("function_call_output"===f.type&&f.call_id){let a=j(k),b=a.toolCalls?.find(a=>a.id===f.call_id);b&&(b.result=f.output||"",b.isLoading=!1)}}if("response_completed"===d){let a=f.usage;a&&(b=a),i()}}}return i(),{messages:e,title:g,usage:b}}async function D(a){let b=v.createReadStream(a),c=w.createInterface({input:b,crlfDelay:1/0}),d=[],e="Untitled Session",f=0;for await(let a of c){let b;if(a.trim()){try{b=JSON.parse(a)}catch{continue}if(!(!b.role||b.role.startsWith("_"))){if("user"===b.role){let a="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(!a||a.startsWith("<system")||a.startsWith("<environment")||a.startsWith("# AGENTS.md")||a.startsWith("<permissions"))continue;d.push({id:`kimi-user-${f++}`,role:"user",content:a}),"Untitled Session"===e&&(e=a.slice(0,80))}if("assistant"===b.role){let a="";if("string"==typeof b.content)a=b.content;else if(Array.isArray(b.content))for(let c of b.content)"text"===c.type&&c.text&&(a+=c.text);let c=[],e=b.tool_calls;if(e&&Array.isArray(e)){for(let a of e)if(a.function?.name){let b={};try{b=JSON.parse(a.function.arguments||"{}")}catch{}c.push({id:a.id||`tool-${f++}`,name:"Shell"===a.function.name?"Bash":a.function.name,input:b,isLoading:!1})}}let g=d.length>0?d[d.length-1]:null;g&&"assistant"===g.role&&g.toolCalls&&g.toolCalls.length>0?(c.length>0&&g.toolCalls.push(...c),a&&(g.content=(g.content||"")+a)):(a||c.length>0)&&d.push({id:`kimi-assistant-${f++}`,role:"assistant",content:a,...c.length>0?{toolCalls:c}:{}})}if("tool"===b.role){let a=b.tool_call_id;if(a&&d.length>0){let c=d[d.length-1];if("assistant"===c.role&&c.toolCalls){let d=c.toolCalls.find(b=>b.id===a);if(d){let a="";"string"==typeof b.content?a=b.content:Array.isArray(b.content)&&(a=b.content.filter(a=>"text"===a.type&&a.text).map(a=>a.text).join("\n")),d.result=a}}}}}}}return{messages:d,title:e}}async function E(a){let b=v.createReadStream(a),c=w.createInterface({input:b,crlfDelay:1/0}),d="Untitled Session",e=0,f=[],g=new Map;for await(let a of c)if(a.trim()){f.push(a);try{let b=JSON.parse(a);if("tool"===b.role&&Array.isArray(b.content))for(let a of b.content)"tool-result"===a.type&&a.toolCallId&&g.set(a.toolCallId,String(a.result??""))}catch{}}let h=[],i=null,j=()=>{i&&(h.push(i),i=null)};for(let a of f)try{let b=JSON.parse(a);if("user"===b.role){j();let a="";"string"==typeof b.content?a=b.content:Array.isArray(b.content)&&(a=b.content.filter(a=>"text"===a.type).map(a=>a.text||"").join("\n")),"Untitled Session"===d&&a&&(d=a.slice(0,80)),h.push({id:`ollama-user-${e++}`,role:"user",content:a})}else if("assistant"===b.role){let a="",c=[];if("string"==typeof b.content)a=b.content;else if(Array.isArray(b.content)){for(let d of b.content)if("text"===d.type&&"string"==typeof d.text)a+=(a?"\n":"")+d.text;else if("tool-call"===d.type){let a=String(d.toolCallId||""),b=String(d.toolName||""),e={};try{"string"==typeof d.args?e=JSON.parse(d.args):"object"==typeof d.args&&null!==d.args&&(e=d.args)}catch{}c.push({id:a,name:b,input:e,result:g.get(a),isLoading:!1})}}i?i.content+=(i.content&&a?"\n":"")+a:i={id:`ollama-assistant-${e++}`,role:"assistant",content:a,toolCalls:[]},c.length>0&&(i.toolCalls=i.toolCalls||[],i.toolCalls.push(...c))}}catch{}return j(),{messages:h,title:d}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/session-by-path/route",pathname:"/api/session-by-path",filename:"route",bundlePath:"app/api/session-by-path/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/session-by-path/route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/session-by-path/route";"/index"===d&&(d="/");let e=await F.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||F.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===F.isDev||!I,M=I&&!L;G&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>F.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>F.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await F.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=44339));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=1772,a.ids=[1772],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},4984:a=>{"use strict";a.exports=require("readline")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>J,A0:()=>T,An:()=>W,BF:()=>F,Ct:()=>N,Eu:()=>E,Ex:()=>t,GB:()=>q,JE:()=>V,JY:()=>I,Ki:()=>z,Kk:()=>O,Kv:()=>j,LN:()=>k,Mx:()=>A,O0:()=>y,Sr:()=>G,Tb:()=>r,Ux:()=>Y,Wd:()=>U,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>R,h9:()=>w,i4:()=>D,iK:()=>o,iy:()=>M,lq:()=>C,ls:()=>H,mT:()=>v,oK:()=>L,oZ:()=>P,of:()=>B,po:()=>K,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>S,yw:()=>Q});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects");function y(a){return a.replace(/[/.]/g,"-")}function z(a){return(0,e.join)(k,y(a))}function A(a){return(0,e.join)(z(a),"session.json")}function B(a){return(0,e.join)(z(a),"recent-files.json")}function C(a){return(0,e.join)(z(a),"expanded-paths.json")}function D(a){return(0,e.join)(z(a),"comments.json")}function E(a){return(0,e.join)(z(a),"services.json")}function F(a){return(0,e.join)(z(a),"note.md")}function G(a,b){return(0,e.join)(z(a),`terminal-history-${b}.jsonl`)}function H(a,b){return(0,e.join)(z(a),`terminal-output-${b}.txt`)}function I(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(z(a),c)}function J(){return(0,e.join)(j,"terminal-aliases.json")}function K(){return(0,e.join)(j,"services.json")}function L(a){return(0,e.join)(z(a),"project-settings.json")}function M(a,b){return(0,e.join)(z(a),`terminal-bubble-order-${b}.json`)}function N(a){return(0,e.join)(r,`${a}.json`)}function O(a,b){return(0,e.join)((0,e.join)(v,y(a)),`${b}.jsonl`)}function P(a,b){return(0,e.join)((0,e.join)(x,y(a)),`${b}.jsonl`)}function Q(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",y(a)),`${b}.jsonl`)}function R(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 S(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 T(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function U(a){let b=(0,e.join)(a,"..");await T(b)}async function V(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function W(a,b){await U(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let X=new Map;function Y(a,b){let c=(X.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return X.set(a,d),d.then(()=>{X.get(a)===d&&X.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33773:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>O,patchFetch:()=>N,routeModule:()=>J,serverHooks:()=>M,workAsyncStorage:()=>K,workUnitAsyncStorage:()=>L});var d={};c.r(d),c.d(d,{GET:()=>I,dynamic:()=>A,runtime:()=>z});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(29021),w=c(33873),x=c(4984),y=c(25813);let z="nodejs",A="force-dynamic";function B(a,b=50){return a.length<=b?a:a.slice(0,b)+"..."}function C(a,b){if(a)return a;let c="";for(let a of b){let b=function(a){let b=a.match(/<command-args>([^<]*)<\/command-args>/);if(b&&b[1].trim())return b[1].trim();let c=a.match(/<command-name>([^<]*)<\/command-name>/);if(c&&c[1].trim())return c[1].trim();let d=a.replace(/<command-message>[^<]*<\/command-message>/g,"");return(d=(d=(d=(d=d.replace(/<command-name>[^<]*<\/command-name>/g,"")).replace(/<command-args>[^<]*<\/command-args>/g,"")).replace(/<local-command-stdout>[\s\S]*?<\/local-command-stdout>/g,"")).replace(/<local-command-caveat>[\s\S]*?<\/local-command-caveat>/g,"")).trim()}(a);if(b){if(b.startsWith("/")&&!c){c=b;continue}if(c)return`${c} ${b}`;return b}}return c||"Untitled Session"}async function D(a){let b=v.createReadStream(a),c=x.createInterface({input:b,crlfDelay:1/0}),d="",e=[];for await(let a of c)try{let b=JSON.parse(a);"summary"===b.type&&b.summary&&(d=b.summary);let c=function(a){if("user"!==a.type||a.isMeta)return null;let b=a.message?.content;if(!b)return null;if("string"==typeof b)return b;if(Array.isArray(b)){let a=b.filter(a=>"text"===a.type);if(a.length>0)return a.map(a=>a.text||"").join(" ")}return null}(b);c&&e.push(c)}catch{}return{title:d,userMessages:e}}function E(a){return v.statSync(a).mtime}function F(a,b){if(!v.existsSync(a))return[];try{return v.readdirSync(a).filter(a=>a.endsWith(".jsonl")&&!a.startsWith("agent-")).map(c=>({name:c,path:w.join(a,c),modifiedAt:E(w.join(a,c)),engine:b}))}catch{return[]}}async function G(a){let b=v.createReadStream(a),c=x.createInterface({input:b,crlfDelay:1/0}),d=[];for await(let a of c)if(a.trim())try{let b=JSON.parse(a);if("response_item"!==b.type)continue;let c=b.payload;if(!c||"message"!==c.type||"user"!==c.role)continue;let e=c.content?.filter(a=>"input_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(!e||e.startsWith("<")||e.startsWith("#"))continue;d.push(e)}catch{}return{title:"",userMessages:d}}async function H(a){let b=v.createReadStream(a),c=x.createInterface({input:b,crlfDelay:1/0}),d=[];for await(let a of c)if(a.trim())try{let b=JSON.parse(a);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"))continue;d.push(c)}catch{}return{title:"",userMessages:d}}async function I(a,{params:b}){try{let{encodedPath:a}=await b;if(!a)return new Response(JSON.stringify({error:"Missing encodedPath"}),{status:400,headers:{"Content-Type":"application/json"}});let c=w.join(y.mT,a),d=w.join(y.at,a),e=w.join(y.Kv,"ollama-sessions",a),f=[...F(c,"claude"),...F(d,"claude2"),...F(e,"ollama")],g=new Set,h=f.filter(a=>!g.has(a.name)&&(g.add(a.name),!0)).sort((a,b)=>b.modifiedAt.getTime()-a.modifiedAt.getTime()),i=[];for(let a of h)try{let{title:b,userMessages:c}=await D(a.path);if(0===c.length)continue;let d=[],e=[];c.length<=10?d=c.map(a=>B(a)):(d=c.slice(0,5).map(a=>B(a)),e=c.slice(-5).map(a=>B(a))),i.push({path:a.path,title:C(b,c),modifiedAt:a.modifiedAt.toISOString(),firstMessages:d,lastMessages:e,engine:a.engine})}catch(b){console.error(`Error parsing session file ${a.path}:`,b)}for(let{sessionId:b,engine:c}of function(a){try{let b=w.join(y.LN,a,"session.json");if(!v.existsSync(b))return[];let c=v.readFileSync(b,"utf-8"),d=JSON.parse(c);if(!d.sessions||!d.engines)return[];let e=[];for(let a of d.sessions){let b=d.engines[a];("codex"===b||"kimi"===b)&&e.push({sessionId:a,engine:b})}return e}catch{return[]}}(a))if(!g.has(`${b}.jsonl`))try{let a=null,d=null;if("codex"===c?(a=(0,y.eg)(b))&&v.existsSync(a)&&(d=await G(a)):"kimi"===c&&(a=(0,y.vI)(b))&&v.existsSync(a)&&(d=await H(a)),!a||!d||0===d.userMessages.length)continue;let e=E(a),{userMessages:f}=d,g=[],h=[];f.length<=10?g=f.map(a=>B(a)):(g=f.slice(0,5).map(a=>B(a)),h=f.slice(-5).map(a=>B(a))),i.push({path:a,title:C("",f),modifiedAt:e.toISOString(),firstMessages:g,lastMessages:h,engine:c})}catch(a){console.error(`Error parsing ${c} session ${b}:`,a)}return i.sort((a,b)=>new Date(b.modifiedAt).getTime()-new Date(a.modifiedAt).getTime()),new Response(JSON.stringify(i),{status:200,headers:{"Content-Type":"application/json"}})}catch(a){return console.error("Project sessions API error:",a),new Response(JSON.stringify({error:"Internal server error"}),{status:500,headers:{"Content-Type":"application/json"}})}}let J=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/projects/[encodedPath]/route",pathname:"/api/sessions/projects/[encodedPath]",filename:"route",bundlePath:"app/api/sessions/projects/[encodedPath]/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/sessions/projects/[encodedPath]/route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:K,workUnitAsyncStorage:L,serverHooks:M}=J;function N(){return(0,g.patchFetch)({workAsyncStorage:K,workUnitAsyncStorage:L})}async function O(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),J.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/projects/[encodedPath]/route";"/index"===d&&(d="/");let e=await J.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:F}=e,G=(0,k.normalizeAppPath)(d),H=!!(z.dynamicRoutes[G]||z.routes[D]),I=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(H&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[G];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await I();throw new t.NoFallbackError}}let K=null;!H||J.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===J.isDev||!H,M=H&&!L;F&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:F});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await J.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>J.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>J.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!H)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 J.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await J.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!H)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&H||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await J.onRequestError(a,b,{routerKind:"App Router",routePath:G,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),H)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=33773));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=1772,a.ids=[1772],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},4984:a=>{"use strict";a.exports=require("readline")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>L,A0:()=>W,An:()=>Z,BF:()=>H,Ct:()=>P,Eu:()=>G,Ex:()=>t,GB:()=>q,JE:()=>Y,JY:()=>K,Ki:()=>B,Kk:()=>Q,Kv:()=>j,LN:()=>k,Mx:()=>C,O0:()=>A,Sr:()=>I,Tb:()=>r,Ux:()=>_,Wd:()=>X,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>U,h9:()=>w,i4:()=>F,iK:()=>o,im:()=>S,iy:()=>O,lT:()=>y,lq:()=>E,ls:()=>J,mT:()=>v,oK:()=>N,oZ:()=>R,of:()=>D,po:()=>M,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>V,yw:()=>T});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects"),y=(0,e.join)(j,"deepseek"),z=(0,e.join)(y,"projects");function A(a){return a.replace(/[/.]/g,"-")}function B(a){return(0,e.join)(k,A(a))}function C(a){return(0,e.join)(B(a),"session.json")}function D(a){return(0,e.join)(B(a),"recent-files.json")}function E(a){return(0,e.join)(B(a),"expanded-paths.json")}function F(a){return(0,e.join)(B(a),"comments.json")}function G(a){return(0,e.join)(B(a),"services.json")}function H(a){return(0,e.join)(B(a),"note.md")}function I(a,b){return(0,e.join)(B(a),`terminal-history-${b}.jsonl`)}function J(a,b){return(0,e.join)(B(a),`terminal-output-${b}.txt`)}function K(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(B(a),c)}function L(){return(0,e.join)(j,"terminal-aliases.json")}function M(){return(0,e.join)(j,"services.json")}function N(a){return(0,e.join)(B(a),"project-settings.json")}function O(a,b){return(0,e.join)(B(a),`terminal-bubble-order-${b}.json`)}function P(a){return(0,e.join)(r,`${a}.json`)}function Q(a,b){return(0,e.join)((0,e.join)(v,A(a)),`${b}.jsonl`)}function R(a,b){return(0,e.join)((0,e.join)(x,A(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(z,A(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",A(a)),`${b}.jsonl`)}function U(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 V(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 W(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function X(a){let b=(0,e.join)(a,"..");await W(b)}async function Y(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function Z(a,b){await X(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let $=new Map;function _(a,b){let c=($.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return $.set(a,d),d.then(()=>{$.get(a)===d&&$.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88648:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>O,patchFetch:()=>N,routeModule:()=>J,serverHooks:()=>M,workAsyncStorage:()=>K,workUnitAsyncStorage:()=>L});var d={};c.r(d),c.d(d,{GET:()=>I,dynamic:()=>A,runtime:()=>z});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(29021),w=c(33873),x=c(4984),y=c(25813);let z="nodejs",A="force-dynamic";function B(a,b=50){return a.length<=b?a:a.slice(0,b)+"..."}function C(a,b){if(a)return a;let c="";for(let a of b){let b=function(a){let b=a.match(/<command-args>([^<]*)<\/command-args>/);if(b&&b[1].trim())return b[1].trim();let c=a.match(/<command-name>([^<]*)<\/command-name>/);if(c&&c[1].trim())return c[1].trim();let d=a.replace(/<command-message>[^<]*<\/command-message>/g,"");return(d=(d=(d=(d=d.replace(/<command-name>[^<]*<\/command-name>/g,"")).replace(/<command-args>[^<]*<\/command-args>/g,"")).replace(/<local-command-stdout>[\s\S]*?<\/local-command-stdout>/g,"")).replace(/<local-command-caveat>[\s\S]*?<\/local-command-caveat>/g,"")).trim()}(a);if(b){if(b.startsWith("/")&&!c){c=b;continue}if(c)return`${c} ${b}`;return b}}return c||"Untitled Session"}async function D(a){let b=v.createReadStream(a),c=x.createInterface({input:b,crlfDelay:1/0}),d="",e=[];for await(let a of c)try{let b=JSON.parse(a);"summary"===b.type&&b.summary&&(d=b.summary);let c=function(a){if("user"!==a.type||a.isMeta)return null;let b=a.message?.content;if(!b)return null;if("string"==typeof b)return b;if(Array.isArray(b)){let a=b.filter(a=>"text"===a.type);if(a.length>0)return a.map(a=>a.text||"").join(" ")}return null}(b);c&&e.push(c)}catch{}return{title:d,userMessages:e}}function E(a){return v.statSync(a).mtime}function F(a,b){if(!v.existsSync(a))return[];try{return v.readdirSync(a).filter(a=>a.endsWith(".jsonl")&&!a.startsWith("agent-")).map(c=>({name:c,path:w.join(a,c),modifiedAt:E(w.join(a,c)),engine:b}))}catch{return[]}}async function G(a){let b=v.createReadStream(a),c=x.createInterface({input:b,crlfDelay:1/0}),d=[];for await(let a of c)if(a.trim())try{let b=JSON.parse(a);if("response_item"!==b.type)continue;let c=b.payload;if(!c||"message"!==c.type||"user"!==c.role)continue;let e=c.content?.filter(a=>"input_text"===a.type&&a.text).map(a=>a.text).join("")||"";if(!e||e.startsWith("<")||e.startsWith("#"))continue;d.push(e)}catch{}return{title:"",userMessages:d}}async function H(a){let b=v.createReadStream(a),c=x.createInterface({input:b,crlfDelay:1/0}),d=[];for await(let a of c)if(a.trim())try{let b=JSON.parse(a);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"))continue;d.push(c)}catch{}return{title:"",userMessages:d}}async function I(a,{params:b}){try{let{encodedPath:a}=await b;if(!a)return new Response(JSON.stringify({error:"Missing encodedPath"}),{status:400,headers:{"Content-Type":"application/json"}});let c=w.join(y.mT,a),d=w.join(y.at,a),e=w.join(y.Kv,"ollama-sessions",a),f=[...F(c,"claude"),...F(d,"claude2"),...F(e,"ollama")],g=new Set,h=f.filter(a=>!g.has(a.name)&&(g.add(a.name),!0)).sort((a,b)=>b.modifiedAt.getTime()-a.modifiedAt.getTime()),i=[];for(let a of h)try{let{title:b,userMessages:c}=await D(a.path);if(0===c.length)continue;let d=[],e=[];c.length<=10?d=c.map(a=>B(a)):(d=c.slice(0,5).map(a=>B(a)),e=c.slice(-5).map(a=>B(a))),i.push({path:a.path,title:C(b,c),modifiedAt:a.modifiedAt.toISOString(),firstMessages:d,lastMessages:e,engine:a.engine})}catch(b){console.error(`Error parsing session file ${a.path}:`,b)}for(let{sessionId:b,engine:c}of function(a){try{let b=w.join(y.LN,a,"session.json");if(!v.existsSync(b))return[];let c=v.readFileSync(b,"utf-8"),d=JSON.parse(c);if(!d.sessions||!d.engines)return[];let e=[];for(let a of d.sessions){let b=d.engines[a];("codex"===b||"kimi"===b)&&e.push({sessionId:a,engine:b})}return e}catch{return[]}}(a))if(!g.has(`${b}.jsonl`))try{let a=null,d=null;if("codex"===c?(a=(0,y.eg)(b))&&v.existsSync(a)&&(d=await G(a)):"kimi"===c&&(a=(0,y.vI)(b))&&v.existsSync(a)&&(d=await H(a)),!a||!d||0===d.userMessages.length)continue;let e=E(a),{userMessages:f}=d,g=[],h=[];f.length<=10?g=f.map(a=>B(a)):(g=f.slice(0,5).map(a=>B(a)),h=f.slice(-5).map(a=>B(a))),i.push({path:a,title:C("",f),modifiedAt:e.toISOString(),firstMessages:g,lastMessages:h,engine:c})}catch(a){console.error(`Error parsing ${c} session ${b}:`,a)}return i.sort((a,b)=>new Date(b.modifiedAt).getTime()-new Date(a.modifiedAt).getTime()),new Response(JSON.stringify(i),{status:200,headers:{"Content-Type":"application/json"}})}catch(a){return console.error("Project sessions API error:",a),new Response(JSON.stringify({error:"Internal server error"}),{status:500,headers:{"Content-Type":"application/json"}})}}let J=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/projects/[encodedPath]/route",pathname:"/api/sessions/projects/[encodedPath]",filename:"route",bundlePath:"app/api/sessions/projects/[encodedPath]/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/sessions/projects/[encodedPath]/route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:K,workUnitAsyncStorage:L,serverHooks:M}=J;function N(){return(0,g.patchFetch)({workAsyncStorage:K,workUnitAsyncStorage:L})}async function O(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),J.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/projects/[encodedPath]/route";"/index"===d&&(d="/");let e=await J.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:F}=e,G=(0,k.normalizeAppPath)(d),H=!!(z.dynamicRoutes[G]||z.routes[D]),I=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(H&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[G];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await I();throw new t.NoFallbackError}}let K=null;!H||J.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===J.isDev||!H,M=H&&!L;F&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:F});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await J.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>J.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>J.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!H)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 J.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await J.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!H)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&H||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await J.onRequestError(a,b,{routerKind:"App Router",routePath:G,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),H)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=88648));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=50,a.ids=[50],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>J,A0:()=>T,An:()=>W,BF:()=>F,Ct:()=>N,Eu:()=>E,Ex:()=>t,GB:()=>q,JE:()=>V,JY:()=>I,Ki:()=>z,Kk:()=>O,Kv:()=>j,LN:()=>k,Mx:()=>A,O0:()=>y,Sr:()=>G,Tb:()=>r,Ux:()=>Y,Wd:()=>U,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>R,h9:()=>w,i4:()=>D,iK:()=>o,iy:()=>M,lq:()=>C,ls:()=>H,mT:()=>v,oK:()=>L,oZ:()=>P,of:()=>B,po:()=>K,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>S,yw:()=>Q});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects");function y(a){return a.replace(/[/.]/g,"-")}function z(a){return(0,e.join)(k,y(a))}function A(a){return(0,e.join)(z(a),"session.json")}function B(a){return(0,e.join)(z(a),"recent-files.json")}function C(a){return(0,e.join)(z(a),"expanded-paths.json")}function D(a){return(0,e.join)(z(a),"comments.json")}function E(a){return(0,e.join)(z(a),"services.json")}function F(a){return(0,e.join)(z(a),"note.md")}function G(a,b){return(0,e.join)(z(a),`terminal-history-${b}.jsonl`)}function H(a,b){return(0,e.join)(z(a),`terminal-output-${b}.txt`)}function I(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(z(a),c)}function J(){return(0,e.join)(j,"terminal-aliases.json")}function K(){return(0,e.join)(j,"services.json")}function L(a){return(0,e.join)(z(a),"project-settings.json")}function M(a,b){return(0,e.join)(z(a),`terminal-bubble-order-${b}.json`)}function N(a){return(0,e.join)(r,`${a}.json`)}function O(a,b){return(0,e.join)((0,e.join)(v,y(a)),`${b}.jsonl`)}function P(a,b){return(0,e.join)((0,e.join)(x,y(a)),`${b}.jsonl`)}function Q(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",y(a)),`${b}.jsonl`)}function R(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 S(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 T(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function U(a){let b=(0,e.join)(a,"..");await T(b)}async function V(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function W(a,b){await U(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let X=new Map;function Y(a,b){let c=(X.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return X.set(a,d),d.then(()=>{X.get(a)===d&&X.delete(a)}),c}},27474:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>I,patchFetch:()=>H,routeModule:()=>D,serverHooks:()=>G,workAsyncStorage:()=>E,workUnitAsyncStorage:()=>F});var d={};c.r(d),c.d(d,{GET:()=>C,dynamic:()=>z,runtime:()=>y});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(29021),w=c(33873),x=c(25813);let y="nodejs",z="force-dynamic";function A(a,b,c){if(c){let a=function(a){let b=w.join(a,"sessions-index.json");if(!v.existsSync(b))return null;try{let a=v.readFileSync(b,"utf-8"),c=JSON.parse(a);if(c.originalPath)return c.originalPath;if(c.entries&&c.entries.length>0&&c.entries[0].projectPath)return c.entries[0].projectPath}catch{}return null}(c);if(a)return a;let b=function(a){try{for(let b of v.readdirSync(a).filter(a=>a.endsWith(".jsonl")&&!a.startsWith("agent-"))){let c=w.join(a,b);for(let a of v.readFileSync(c,"utf-8").split("\n"))if(a.trim())try{let b=JSON.parse(a);if(b.cwd)return b.cwd}catch{}}}catch{}return null}(c);if(b)return b}let d=b.get(a);return d||null}function B(a){try{if(!v.existsSync(a))return 0;return v.readdirSync(a).filter(a=>a.endsWith(".jsonl")&&!a.startsWith("agent-")).length}catch{return 0}}async function C(){try{let a=function(){let a=new Map;try{if(!v.existsSync(x.v4))return a;let b=v.readFileSync(x.v4,"utf-8"),c=JSON.parse(b);if(c.sessions)for(let b of c.sessions)b.cwd&&a.set((0,x.O0)(b.cwd),b.cwd)}catch{}return a}(),b=new Map;if(v.existsSync(x.mT))for(let c of v.readdirSync(x.mT,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)){let d=w.join(x.mT,c),e=A(c,a,d);if(!e)continue;let f=B(d);f>0&&b.set(c,{fullPath:e,sessionCount:f})}if(v.existsSync(x.at))for(let c of v.readdirSync(x.at,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)){let d=w.join(x.at,c),e=A(c,a,d);if(!e)continue;let f=B(d);if(0===f)continue;let g=b.get(c);g?g.sessionCount+=f:b.set(c,{fullPath:e,sessionCount:f})}let c=w.join(x.Kv,"ollama-sessions");if(v.existsSync(c))for(let d of v.readdirSync(c,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)){let e=w.join(c,d),f=B(e);if(0===f)continue;let g=b.get(d);if(g)g.sessionCount+=f;else{let c=w.join(x.mT,d),e=v.existsSync(c)?c:void 0,g=A(d,a,e);if(!g)continue;b.set(d,{fullPath:g,sessionCount:f})}}if(v.existsSync(x.LN))for(let c of v.readdirSync(x.LN,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)){let d=function(a){try{let b=w.join(x.LN,a,"session.json");if(!v.existsSync(b))return 0;let c=v.readFileSync(b,"utf-8"),d=JSON.parse(c);if(!d.sessions||!d.engines)return 0;let e=0;for(let a of d.sessions){let b=d.engines[a];("codex"===b||"kimi"===b)&&e++}return e}catch{return 0}}(c);if(0===d)continue;let e=b.get(c);if(e)e.sessionCount+=d;else{let e=w.join(x.mT,c),f=v.existsSync(e)?e:void 0,g=A(c,a,f);if(!g)continue;b.set(c,{fullPath:g,sessionCount:d})}}let d=[];for(let[a,{fullPath:c,sessionCount:e}]of b)d.push({name:w.basename(c),fullPath:c,encodedPath:a,sessionCount:e});return d.sort((a,b)=>a.name.localeCompare(b.name)),new Response(JSON.stringify(d),{status:200,headers:{"Content-Type":"application/json"}})}catch(a){return console.error("Projects API error:",a),new Response(JSON.stringify({error:"Internal server error"}),{status:500,headers:{"Content-Type":"application/json"}})}}let D=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/projects/route",pathname:"/api/sessions/projects",filename:"route",bundlePath:"app/api/sessions/projects/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/sessions/projects/route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:E,workUnitAsyncStorage:F,serverHooks:G}=D;function H(){return(0,g.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:F})}async function I(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),D.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/projects/route";"/index"===d&&(d="/");let e=await D.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||D.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===D.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await D.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>D.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>D.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 D.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await D.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await D.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=27474));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=50,a.ids=[50],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},21820:a=>{"use strict";a.exports=require("os")},25813:(a,b,c)=>{"use strict";c.d(b,{$A:()=>L,A0:()=>W,An:()=>Z,BF:()=>H,Ct:()=>P,Eu:()=>G,Ex:()=>t,GB:()=>q,JE:()=>Y,JY:()=>K,Ki:()=>B,Kk:()=>Q,Kv:()=>j,LN:()=>k,Mx:()=>C,O0:()=>A,Sr:()=>I,Tb:()=>r,Ux:()=>_,Wd:()=>X,aO:()=>m,at:()=>x,ec:()=>n,eg:()=>U,h9:()=>w,i4:()=>F,iK:()=>o,im:()=>S,iy:()=>O,lT:()=>y,lq:()=>E,ls:()=>J,mT:()=>v,oK:()=>N,oZ:()=>R,of:()=>D,po:()=>M,tP:()=>p,th:()=>u,v4:()=>l,vI:()=>V,yw:()=>T});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,"note.md"),o=(0,e.join)(j,"scheduled-tasks.json"),p=(0,e.join)(j,"settings.json"),q=(0,e.join)(j,"skills.json"),r=(0,e.join)(j,"review"),s=(0,e.join)(r,"_signal");function t(){try{(0,g.existsSync)(r)||(0,g.mkdirSync)(r,{recursive:!0}),(0,g.writeFileSync)(s,Date.now().toString())}catch{}}let u=(0,e.join)(i,".claude"),v=(0,e.join)(u,"projects"),w=(0,e.join)(i,".claude2"),x=(0,e.join)(w,"projects"),y=(0,e.join)(j,"deepseek"),z=(0,e.join)(y,"projects");function A(a){return a.replace(/[/.]/g,"-")}function B(a){return(0,e.join)(k,A(a))}function C(a){return(0,e.join)(B(a),"session.json")}function D(a){return(0,e.join)(B(a),"recent-files.json")}function E(a){return(0,e.join)(B(a),"expanded-paths.json")}function F(a){return(0,e.join)(B(a),"comments.json")}function G(a){return(0,e.join)(B(a),"services.json")}function H(a){return(0,e.join)(B(a),"note.md")}function I(a,b){return(0,e.join)(B(a),`terminal-history-${b}.jsonl`)}function J(a,b){return(0,e.join)(B(a),`terminal-output-${b}.txt`)}function K(a,b){let c=b?`terminal-env-${b}.json`:"terminal-env-global.json";return(0,e.join)(B(a),c)}function L(){return(0,e.join)(j,"terminal-aliases.json")}function M(){return(0,e.join)(j,"services.json")}function N(a){return(0,e.join)(B(a),"project-settings.json")}function O(a,b){return(0,e.join)(B(a),`terminal-bubble-order-${b}.json`)}function P(a){return(0,e.join)(r,`${a}.json`)}function Q(a,b){return(0,e.join)((0,e.join)(v,A(a)),`${b}.jsonl`)}function R(a,b){return(0,e.join)((0,e.join)(x,A(a)),`${b}.jsonl`)}function S(a,b){return(0,e.join)((0,e.join)(z,A(a)),`${b}.jsonl`)}function T(a,b){return(0,e.join)((0,e.join)(j,"ollama-sessions",A(a)),`${b}.jsonl`)}function U(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 V(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 W(a){(0,g.existsSync)(a)||await (0,f.mkdir)(a,{recursive:!0})}async function X(a){let b=(0,e.join)(a,"..");await W(b)}async function Y(a,b){try{let b=await (0,f.readFile)(a,"utf-8");return JSON.parse(b)}catch{return b}}async function Z(a,b){await X(a),await (0,f.writeFile)(a,JSON.stringify(b,null,2),"utf-8")}let $=new Map;function _(a,b){let c=($.get(a)??Promise.resolve()).then(b),d=c.then(()=>{},()=>{});return $.set(a,d),d.then(()=>{$.get(a)===d&&$.delete(a)}),c}},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46197:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>I,patchFetch:()=>H,routeModule:()=>D,serverHooks:()=>G,workAsyncStorage:()=>E,workUnitAsyncStorage:()=>F});var d={};c.r(d),c.d(d,{GET:()=>C,dynamic:()=>z,runtime:()=>y});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(29021),w=c(33873),x=c(25813);let y="nodejs",z="force-dynamic";function A(a,b,c){if(c){let a=function(a){let b=w.join(a,"sessions-index.json");if(!v.existsSync(b))return null;try{let a=v.readFileSync(b,"utf-8"),c=JSON.parse(a);if(c.originalPath)return c.originalPath;if(c.entries&&c.entries.length>0&&c.entries[0].projectPath)return c.entries[0].projectPath}catch{}return null}(c);if(a)return a;let b=function(a){try{for(let b of v.readdirSync(a).filter(a=>a.endsWith(".jsonl")&&!a.startsWith("agent-"))){let c=w.join(a,b);for(let a of v.readFileSync(c,"utf-8").split("\n"))if(a.trim())try{let b=JSON.parse(a);if(b.cwd)return b.cwd}catch{}}}catch{}return null}(c);if(b)return b}let d=b.get(a);return d||null}function B(a){try{if(!v.existsSync(a))return 0;return v.readdirSync(a).filter(a=>a.endsWith(".jsonl")&&!a.startsWith("agent-")).length}catch{return 0}}async function C(){try{let a=function(){let a=new Map;try{if(!v.existsSync(x.v4))return a;let b=v.readFileSync(x.v4,"utf-8"),c=JSON.parse(b);if(c.sessions)for(let b of c.sessions)b.cwd&&a.set((0,x.O0)(b.cwd),b.cwd)}catch{}return a}(),b=new Map;if(v.existsSync(x.mT))for(let c of v.readdirSync(x.mT,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)){let d=w.join(x.mT,c),e=A(c,a,d);if(!e)continue;let f=B(d);f>0&&b.set(c,{fullPath:e,sessionCount:f})}if(v.existsSync(x.at))for(let c of v.readdirSync(x.at,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)){let d=w.join(x.at,c),e=A(c,a,d);if(!e)continue;let f=B(d);if(0===f)continue;let g=b.get(c);g?g.sessionCount+=f:b.set(c,{fullPath:e,sessionCount:f})}let c=w.join(x.Kv,"ollama-sessions");if(v.existsSync(c))for(let d of v.readdirSync(c,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)){let e=w.join(c,d),f=B(e);if(0===f)continue;let g=b.get(d);if(g)g.sessionCount+=f;else{let c=w.join(x.mT,d),e=v.existsSync(c)?c:void 0,g=A(d,a,e);if(!g)continue;b.set(d,{fullPath:g,sessionCount:f})}}if(v.existsSync(x.LN))for(let c of v.readdirSync(x.LN,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)){let d=function(a){try{let b=w.join(x.LN,a,"session.json");if(!v.existsSync(b))return 0;let c=v.readFileSync(b,"utf-8"),d=JSON.parse(c);if(!d.sessions||!d.engines)return 0;let e=0;for(let a of d.sessions){let b=d.engines[a];("codex"===b||"kimi"===b)&&e++}return e}catch{return 0}}(c);if(0===d)continue;let e=b.get(c);if(e)e.sessionCount+=d;else{let e=w.join(x.mT,c),f=v.existsSync(e)?e:void 0,g=A(c,a,f);if(!g)continue;b.set(c,{fullPath:g,sessionCount:d})}}let d=[];for(let[a,{fullPath:c,sessionCount:e}]of b)d.push({name:w.basename(c),fullPath:c,encodedPath:a,sessionCount:e});return d.sort((a,b)=>a.name.localeCompare(b.name)),new Response(JSON.stringify(d),{status:200,headers:{"Content-Type":"application/json"}})}catch(a){return console.error("Projects API error:",a),new Response(JSON.stringify({error:"Internal server error"}),{status:500,headers:{"Content-Type":"application/json"}})}}let D=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/projects/route",pathname:"/api/sessions/projects",filename:"route",bundlePath:"app/api/sessions/projects/route"},distDir:".next-prod",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/cockpit/cockpit/src/app/api/sessions/projects/route.ts",nextConfigOutput:"",userland:d,...{}}),{workAsyncStorage:E,workUnitAsyncStorage:F,serverHooks:G}=D;function H(){return(0,g.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:F})}async function I(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),D.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/projects/route";"/index"===d&&(d="/");let e=await D.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,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||D.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===D.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await D.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>D.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>D.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.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=`${N} ${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(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!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=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.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!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.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 D.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await D.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)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});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||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)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await D.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=46197));module.exports=c})();
|