commandmate 0.1.5 → 0.1.7
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/BUILD_ID +1 -0
- package/.next/app-build-manifest.json +72 -0
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +32 -0
- package/.next/cache/.tsbuildinfo +1 -0
- package/.next/cache/config.json +7 -0
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/1.pack +0 -0
- package/.next/cache/webpack/client-production/2.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/export-marker.json +1 -0
- package/.next/images-manifest.json +1 -0
- package/.next/next-minimal-server.js.nft.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +1 -0
- package/.next/react-loadable-manifest.json +249 -0
- package/.next/required-server-files.json +1 -0
- package/.next/routes-manifest.json +1 -0
- package/.next/server/app/_not-found/page.js +1 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/.next/server/app/_not-found.html +1 -0
- package/.next/server/app/_not-found.meta +6 -0
- package/.next/server/app/_not-found.rsc +10 -0
- package/.next/server/app/api/external-apps/[id]/health/route.js +45 -0
- package/.next/server/app/api/external-apps/[id]/health/route.js.nft.json +1 -0
- package/.next/server/app/api/external-apps/[id]/route.js +45 -0
- package/.next/server/app/api/external-apps/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/external-apps/route.js +45 -0
- package/.next/server/app/api/external-apps/route.js.nft.json +1 -0
- package/.next/server/app/api/hooks/claude-done/route.js +19 -0
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -0
- package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -0
- package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -0
- package/.next/server/app/api/repositories/clone/route.js +1 -0
- package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -0
- package/.next/server/app/api/repositories/route.js +1 -0
- package/.next/server/app/api/repositories/route.js.nft.json +1 -0
- package/.next/server/app/api/repositories/scan/route.js +1 -0
- package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -0
- package/.next/server/app/api/repositories/sync/route.js +1 -0
- package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -0
- package/.next/server/app/api/slash-commands/route.js +1 -0
- package/.next/server/app/api/slash-commands/route.js.nft.json +1 -0
- package/.next/server/app/api/slash-commands.body +1 -0
- package/.next/server/app/api/slash-commands.meta +1 -0
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/capture/route.js +2 -0
- package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/logs/route.js +19 -0
- package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/search/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/send/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/tree/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/route.js +1 -0
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -0
- package/.next/server/app/apple-icon.png/route.js +1 -0
- package/.next/server/app/apple-icon.png/route.js.nft.json +1 -0
- package/.next/server/app/apple-icon.png.body +0 -0
- package/.next/server/app/apple-icon.png.meta +1 -0
- package/.next/server/app/icon.png/route.js +1 -0
- package/.next/server/app/icon.png/route.js.nft.json +1 -0
- package/.next/server/app/icon.png.body +0 -0
- package/.next/server/app/icon.png.meta +1 -0
- package/.next/server/app/index.html +9 -0
- package/.next/server/app/index.meta +5 -0
- package/.next/server/app/index.rsc +8 -0
- package/.next/server/app/page.js +16 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +1 -0
- package/.next/server/app/proxy/[...path]/route.js +45 -0
- package/.next/server/app/proxy/[...path]/route.js.nft.json +1 -0
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -0
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -0
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/worktrees/[id]/page.js +21 -0
- package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -0
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/worktrees/[id]/simple-terminal/page.js +4 -0
- package/.next/server/app/worktrees/[id]/simple-terminal/page.js.nft.json +1 -0
- package/.next/server/app/worktrees/[id]/simple-terminal/page_client-reference-manifest.js +1 -0
- package/.next/server/app/worktrees/[id]/terminal/page.js +6 -0
- package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -0
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -0
- package/.next/server/app-paths-manifest.json +46 -0
- package/.next/server/chunks/1318.js +29 -0
- package/.next/server/chunks/1528.js +1 -0
- package/.next/server/chunks/1682.js +6 -0
- package/.next/server/chunks/2518.js +12 -0
- package/.next/server/chunks/3053.js +1 -0
- package/.next/server/chunks/3673.js +1 -0
- package/.next/server/chunks/3853.js +1 -0
- package/.next/server/chunks/434.js +1 -0
- package/.next/server/chunks/4471.js +2 -0
- package/.next/server/chunks/4893.js +2 -0
- package/.next/server/chunks/5972.js +12 -0
- package/.next/server/chunks/6550.js +1 -0
- package/.next/server/chunks/6621.js +1 -0
- package/.next/server/chunks/7213.js +1 -0
- package/.next/server/chunks/7425.js +500 -0
- package/.next/server/chunks/8585.js +1 -0
- package/.next/server/chunks/8887.js +1 -0
- package/.next/server/chunks/8948.js +2 -0
- package/.next/server/chunks/9703.js +31 -0
- package/.next/server/chunks/9723.js +19 -0
- package/.next/server/chunks/font-manifest.json +1 -0
- package/.next/server/edge-runtime-webpack.js +2 -0
- package/.next/server/edge-runtime-webpack.js.map +1 -0
- package/.next/server/font-manifest.json +1 -0
- package/.next/server/functions-config-manifest.json +1 -0
- package/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +32 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +1 -0
- package/.next/server/pages/404.html +1 -0
- package/.next/server/pages/500.html +1 -0
- package/.next/server/pages/_app.js +1 -0
- package/.next/server/pages/_app.js.nft.json +1 -0
- package/.next/server/pages/_document.js +1 -0
- package/.next/server/pages/_document.js.nft.json +1 -0
- package/.next/server/pages/_error.js +1 -0
- package/.next/server/pages/_error.js.nft.json +1 -0
- package/.next/server/pages-manifest.json +1 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +1 -0
- package/.next/server/src/middleware.js +14 -0
- package/.next/server/src/middleware.js.map +1 -0
- package/.next/server/webpack-runtime.js +1 -0
- package/.next/static/3jNZMmFnQhc5G7met-OU4/_buildManifest.js +1 -0
- package/.next/static/3jNZMmFnQhc5G7met-OU4/_ssgManifest.js +1 -0
- package/.next/static/chunks/0dbeb660.3e800dfbd28be3bd.js +53 -0
- package/.next/static/chunks/1015.0eaa4da7f61149bc.js +59 -0
- package/.next/static/chunks/1098.49268c9fe1b028fa.js +1 -0
- package/.next/static/chunks/13.feeafc7cc620f8c4.js +1 -0
- package/.next/static/chunks/1423.7b1e8bf760d28078.js +1 -0
- package/.next/static/chunks/1582.9f8590f71ff798ca.js +55 -0
- package/.next/static/chunks/1817.a66d96cedb761daa.js +262 -0
- package/.next/static/chunks/2117-d845c2cd62e344a6.js +2 -0
- package/.next/static/chunks/2398.0b21e4eb7006a230.js +93 -0
- package/.next/static/chunks/2526.8ac62b527c9ab703.js +43 -0
- package/.next/static/chunks/2626.2125083a1ff3b80a.js +29 -0
- package/.next/static/chunks/2689.720a4874b02d4211.js +174 -0
- package/.next/static/chunks/2853-d11a80b03c9a1640.js +1 -0
- package/.next/static/chunks/2957-327e43ef4c12808f.js +1 -0
- package/.next/static/chunks/2cdb6380.35626fc6e41bbba4.js +136 -0
- package/.next/static/chunks/30d07d85-393352a92199f695.js +3 -0
- package/.next/static/chunks/3559.f073f72c4466ce0e.js +1 -0
- package/.next/static/chunks/3574.7a94c27e6a496a56.js +63 -0
- package/.next/static/chunks/383.20683891c9a5f2c4.js +4 -0
- package/.next/static/chunks/3843.3fdda732987f7bb8.js +1 -0
- package/.next/static/chunks/3852.822389f445c9b427.js +1 -0
- package/.next/static/chunks/3991.4bc063cb5be3a86c.js +1 -0
- package/.next/static/chunks/4212.52c1bb34fc97d0d0.js +131 -0
- package/.next/static/chunks/4327.3b84aa049900fdeb.js +60 -0
- package/.next/static/chunks/4362.7bd6f0282e49d79b.js +1 -0
- package/.next/static/chunks/4721.40615a5f4f32b5fb.js +1 -0
- package/.next/static/chunks/4851-45df4d388db5623f.js +1 -0
- package/.next/static/chunks/5112.17318d1c6b28044b.js +1 -0
- package/.next/static/chunks/5126.93fa4e797d609286.js +56 -0
- package/.next/static/chunks/5387.47590ac4ef66c864.js +5 -0
- package/.next/static/chunks/5813.4483664ba482beb1.js +1 -0
- package/.next/static/chunks/6143.1450875bd03a2366.js +36 -0
- package/.next/static/chunks/6406.9653f0d41ab85059.js +1 -0
- package/.next/static/chunks/656.d72f25ce819bd77e.js +149 -0
- package/.next/static/chunks/6678.492e73ca42b2a273.js +62 -0
- package/.next/static/chunks/6725-f7607851b7d57eb1.js +1 -0
- package/.next/static/chunks/6792.3c01ac4dda4b5c6d.js +1 -0
- package/.next/static/chunks/7004.808cbf327ef5955e.js +1 -0
- package/.next/static/chunks/7290.09ef84cf94f90c4d.js +1 -0
- package/.next/static/chunks/7415.6b481c2baf363262.js +148 -0
- package/.next/static/chunks/7648-325564a6e12a3257.js +1 -0
- package/.next/static/chunks/7665.47fccad04449a8f9.js +215 -0
- package/.next/static/chunks/7753.6bdce86b7fde3d10.js +166 -0
- package/.next/static/chunks/8125.245a9df052d274fb.js +1 -0
- package/.next/static/chunks/816-7e340dad784be28c.js +1 -0
- package/.next/static/chunks/8288.4883743fa40672e2.js +24 -0
- package/.next/static/chunks/8522.1607e96011c66877.js +1 -0
- package/.next/static/chunks/8772.863c564498d88487.js +1 -0
- package/.next/static/chunks/8841.dadeb1ece8e46004.js +1 -0
- package/.next/static/chunks/8885.f8d9912b40d74811.js +1 -0
- package/.next/static/chunks/90542734.c1553d0fe7fc14fc.js +1 -0
- package/.next/static/chunks/9365-733d8c05712d2888.js +1 -0
- package/.next/static/chunks/9552.b7dfb7903ead934b.js +1 -0
- package/.next/static/chunks/9834.295b45635ce04f5e.js +24 -0
- package/.next/static/chunks/app/_not-found/page-a9d04e58c81115ec.js +1 -0
- package/.next/static/chunks/app/layout-37e55f11dcc8b1bf.js +1 -0
- package/.next/static/chunks/app/page-9cd00de9cc0abc43.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-9e5adf57cbbbdf05.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-8c6676303b63fdaf.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/simple-terminal/page-16feb3e86e42f4d1.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/terminal/page-be802baffc84dbd2.js +1 -0
- package/.next/static/chunks/d3ac728e.6c9c508274d4d2d5.js +1 -0
- package/.next/static/chunks/fd9d1056-bbe86e4ae099d5cd.js +1 -0
- package/.next/static/chunks/framework-8e0e0f4a6b83a956.js +1 -0
- package/.next/static/chunks/main-a960f4a5e1a2f598.js +1 -0
- package/.next/static/chunks/main-app-420d93e43682fee5.js +1 -0
- package/.next/static/chunks/pages/_app-3c9ca398d360b709.js +1 -0
- package/.next/static/chunks/pages/_error-cf5ca766ac8f493f.js +1 -0
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/.next/static/chunks/webpack-3fc79fab9bb738d7.js +1 -0
- package/.next/static/css/5eacd01f773eed7f.css +11 -0
- package/.next/static/css/85fa6dafca566008.css +1 -0
- package/.next/static/css/e174aa24f94ce607.css +3 -0
- package/.next/trace +5 -0
- package/.next/types/app/api/external-apps/[id]/health/route.ts +343 -0
- package/.next/types/app/api/external-apps/[id]/route.ts +343 -0
- package/.next/types/app/api/external-apps/route.ts +343 -0
- package/.next/types/app/api/hooks/claude-done/route.ts +343 -0
- package/.next/types/app/api/repositories/clone/[jobId]/route.ts +343 -0
- package/.next/types/app/api/repositories/clone/route.ts +343 -0
- package/.next/types/app/api/repositories/route.ts +343 -0
- package/.next/types/app/api/repositories/scan/route.ts +343 -0
- package/.next/types/app/api/repositories/sync/route.ts +343 -0
- package/.next/types/app/api/slash-commands/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/auto-yes/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/capture/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/cli-tool/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/current-output/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/files/[...path]/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/interrupt/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/kill-session/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/logs/[filename]/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/logs/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/memos/[memoId]/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/memos/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/messages/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/prompt-response/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/respond/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/search/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/send/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/slash-commands/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/start-polling/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/terminal/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/tree/[...path]/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/tree/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/upload/[...path]/route.ts +343 -0
- package/.next/types/app/api/worktrees/[id]/viewed/route.ts +343 -0
- package/.next/types/app/api/worktrees/route.ts +343 -0
- package/.next/types/app/page.ts +79 -0
- package/.next/types/app/proxy/[...path]/route.ts +343 -0
- package/.next/types/app/worktrees/[id]/files/[...path]/page.ts +79 -0
- package/.next/types/app/worktrees/[id]/page.ts +79 -0
- package/.next/types/app/worktrees/[id]/simple-terminal/page.ts +79 -0
- package/.next/types/app/worktrees/[id]/terminal/page.ts +79 -0
- package/.next/types/package.json +1 -0
- package/README.md +39 -8
- package/dist/cli/commands/init.d.ts +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +143 -27
- package/dist/cli/types/index.d.ts +18 -0
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/cli/utils/env-setup.d.ts +25 -0
- package/dist/cli/utils/env-setup.d.ts.map +1 -1
- package/dist/cli/utils/env-setup.js +56 -1
- package/dist/cli/utils/prompt.d.ts +68 -0
- package/dist/cli/utils/prompt.d.ts.map +1 -0
- package/dist/cli/utils/prompt.js +208 -0
- package/dist/server/server.js +123 -0
- package/dist/server/src/lib/claude-output.js +33 -0
- package/dist/server/src/lib/claude-session.js +312 -0
- package/dist/server/src/lib/cli-patterns.js +137 -0
- package/dist/server/src/lib/cli-session.js +73 -0
- package/dist/server/src/lib/cli-tools/base.js +51 -0
- package/dist/server/src/lib/cli-tools/claude.js +65 -0
- package/dist/server/src/lib/cli-tools/codex.js +132 -0
- package/dist/server/src/lib/cli-tools/gemini.js +122 -0
- package/dist/server/src/lib/cli-tools/index.js +22 -0
- package/dist/server/src/lib/cli-tools/manager.js +143 -0
- package/dist/server/src/lib/cli-tools/types.js +5 -0
- package/dist/server/src/lib/conversation-logger.js +25 -0
- package/dist/server/src/lib/db-instance.js +51 -0
- package/dist/server/src/lib/db-migrations.js +777 -0
- package/dist/server/src/lib/db.js +835 -0
- package/dist/server/src/lib/env.js +179 -0
- package/dist/server/src/lib/log-manager.js +234 -0
- package/dist/server/src/lib/logger.js +232 -0
- package/dist/server/src/lib/prompt-detector.js +285 -0
- package/dist/server/src/lib/response-poller.js +638 -0
- package/dist/server/src/lib/tmux.js +299 -0
- package/dist/server/src/lib/worktrees.js +231 -0
- package/dist/server/src/lib/ws-server.js +323 -0
- package/dist/server/src/types/clone.js +39 -0
- package/dist/server/src/types/conversation.js +9 -0
- package/dist/server/src/types/external-apps.js +6 -0
- package/dist/server/src/types/infinite-messages.js +65 -0
- package/dist/server/src/types/markdown-editor.js +94 -0
- package/dist/server/src/types/models.js +5 -0
- package/dist/server/src/types/sidebar.js +89 -0
- package/dist/server/src/types/slash-commands.js +47 -0
- package/dist/server/src/types/ui-actions.js +8 -0
- package/dist/server/src/types/ui-state.js +62 -0
- package/package.json +8 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports.id=6621,exports.ids=[6621],exports.modules={50338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION:function(){return n},FLIGHT_PARAMETERS:function(){return s},NEXT_DID_POSTPONE_HEADER:function(){return l},NEXT_ROUTER_PREFETCH_HEADER:function(){return o},NEXT_ROUTER_STATE_TREE:function(){return i},NEXT_RSC_UNION_QUERY:function(){return c},NEXT_URL:function(){return a},RSC_CONTENT_TYPE_HEADER:function(){return u},RSC_HEADER:function(){return r}});let r="RSC",n="Next-Action",i="Next-Router-State-Tree",o="Next-Router-Prefetch",a="Next-Url",u="text/x-component",s=[[r],[i],[o]],c="_rsc",l="x-nextjs-postponed";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},17255:e=>{(()=>{"use strict";"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=__dirname+"/");var t={};(()=>{t.parse=function(t,r){if("string"!=typeof t)throw TypeError("argument str must be a string");for(var i={},o=t.split(n),a=(r||{}).decode||e,u=0;u<o.length;u++){var s=o[u],c=s.indexOf("=");if(!(c<0)){var l=s.substr(0,c).trim(),f=s.substr(++c,s.length).trim();'"'==f[0]&&(f=f.slice(1,-1)),void 0==i[l]&&(i[l]=function(e,t){try{return t(e)}catch(t){return e}}(f,a))}}return i},t.serialize=function(e,t,n){var o=n||{},a=o.encode||r;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!i.test(e))throw TypeError("argument name is invalid");var u=a(t);if(u&&!i.test(u))throw TypeError("argument val is invalid");var s=e+"="+u;if(null!=o.maxAge){var c=o.maxAge-0;if(isNaN(c)||!isFinite(c))throw TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(c)}if(o.domain){if(!i.test(o.domain))throw TypeError("option domain is invalid");s+="; Domain="+o.domain}if(o.path){if(!i.test(o.path))throw TypeError("option path is invalid");s+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw TypeError("option expires is invalid");s+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite)switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:case"strict":s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"none":s+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return s};var e=decodeURIComponent,r=encodeURIComponent,n=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/})(),e.exports=t})()},81792:(e,t)=>{"use strict";function r(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"===n||"+"===n||"?"===n){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if("\\"===n){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if("{"===n){t.push({type:"OPEN",index:r,value:e[r++]});continue}if("}"===n){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(":"===n){for(var i="",o=r+1;o<e.length;){var a=e.charCodeAt(o);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){i+=e[o++];continue}break}if(!i)throw TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:i}),r=o;continue}if("("===n){var u=1,s="",o=r+1;if("?"===e[o])throw TypeError('Pattern cannot start with "?" at '+o);for(;o<e.length;){if("\\"===e[o]){s+=e[o++]+e[o++];continue}if(")"===e[o]){if(0==--u){o++;break}}else if("("===e[o]&&(u++,"?"!==e[o+1]))throw TypeError("Capturing groups are not allowed at "+o);s+=e[o++]}if(u)throw TypeError("Unbalanced pattern at "+r);if(!s)throw TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:s}),r=o;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,i=void 0===n?"./":n,a="[^"+o(t.delimiter||"/#?")+"]+?",u=[],s=0,c=0,l="",f=function(e){if(c<r.length&&r[c].type===e)return r[c++].value},p=function(e){var t=f(e);if(void 0!==t)return t;var n=r[c];throw TypeError("Unexpected "+n.type+" at "+n.index+", expected "+e)},d=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t};c<r.length;){var m=f("CHAR"),g=f("NAME"),h=f("PATTERN");if(g||h){var E=m||"";-1===i.indexOf(E)&&(l+=E,E=""),l&&(u.push(l),l=""),u.push({name:g||s++,prefix:E,suffix:"",pattern:h||a,modifier:f("MODIFIER")||""});continue}var y=m||f("ESCAPED_CHAR");if(y){l+=y;continue}if(l&&(u.push(l),l=""),f("OPEN")){var E=d(),R=f("NAME")||"",_=f("PATTERN")||"",v=d();p("CLOSE"),u.push({name:R||(_?s++:""),pattern:R&&!_?a:_,prefix:E,suffix:v,modifier:f("MODIFIER")||""});continue}p("END")}return u}function n(e,t){void 0===t&&(t={});var r=a(t),n=t.encode,i=void 0===n?function(e){return e}:n,o=t.validate,u=void 0===o||o,s=e.map(function(e){if("object"==typeof e)return RegExp("^(?:"+e.pattern+")$",r)});return function(t){for(var r="",n=0;n<e.length;n++){var o=e[n];if("string"==typeof o){r+=o;continue}var a=t?t[o.name]:void 0,c="?"===o.modifier||"*"===o.modifier,l="*"===o.modifier||"+"===o.modifier;if(Array.isArray(a)){if(!l)throw TypeError('Expected "'+o.name+'" to not repeat, but got an array');if(0===a.length){if(c)continue;throw TypeError('Expected "'+o.name+'" to not be empty')}for(var f=0;f<a.length;f++){var p=i(a[f],o);if(u&&!s[n].test(p))throw TypeError('Expected all "'+o.name+'" to match "'+o.pattern+'", but got "'+p+'"');r+=o.prefix+p+o.suffix}continue}if("string"==typeof a||"number"==typeof a){var p=i(String(a),o);if(u&&!s[n].test(p))throw TypeError('Expected "'+o.name+'" to match "'+o.pattern+'", but got "'+p+'"');r+=o.prefix+p+o.suffix;continue}if(!c){var d=l?"an array":"a string";throw TypeError('Expected "'+o.name+'" to be '+d)}}return r}}function i(e,t,r){void 0===r&&(r={});var n=r.decode,i=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var o=n[0],a=n.index,u=Object.create(null),s=1;s<n.length;s++)!function(e){if(void 0!==n[e]){var r=t[e-1];"*"===r.modifier||"+"===r.modifier?u[r.name]=n[e].split(r.prefix+r.suffix).map(function(e){return i(e,r)}):u[r.name]=i(n[e],r)}}(s);return{path:o,index:a,params:u}}}function o(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function a(e){return e&&e.sensitive?"":"i"}function u(e,t,r){void 0===r&&(r={});for(var n=r.strict,i=void 0!==n&&n,u=r.start,s=r.end,c=r.encode,l=void 0===c?function(e){return e}:c,f="["+o(r.endsWith||"")+"]|$",p="["+o(r.delimiter||"/#?")+"]",d=void 0===u||u?"^":"",m=0;m<e.length;m++){var g=e[m];if("string"==typeof g)d+=o(l(g));else{var h=o(l(g.prefix)),E=o(l(g.suffix));if(g.pattern){if(t&&t.push(g),h||E){if("+"===g.modifier||"*"===g.modifier){var y="*"===g.modifier?"?":"";d+="(?:"+h+"((?:"+g.pattern+")(?:"+E+h+"(?:"+g.pattern+"))*)"+E+")"+y}else d+="(?:"+h+"("+g.pattern+")"+E+")"+g.modifier}else d+="("+g.pattern+")"+g.modifier}else d+="(?:"+h+E+")"+g.modifier}}if(void 0===s||s)i||(d+=p+"?"),d+=r.endsWith?"(?="+f+")":"$";else{var R=e[e.length-1],_="string"==typeof R?p.indexOf(R[R.length-1])>-1:void 0===R;i||(d+="(?:"+p+"(?="+f+"))?"),_||(d+="(?="+p+"|"+f+")")}return new RegExp(d,a(r))}function s(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return e}(e,t):Array.isArray(e)?RegExp("(?:"+e.map(function(e){return s(e,t,n).source}).join("|")+")",a(n)):u(r(e,n),t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=r,t.compile=function(e,t){return n(r(e,t),t)},t.tokensToFunction=n,t.match=function(e,t){var r=[];return i(s(e,r,t),r,t)},t.regexpToFunction=i,t.tokensToRegexp=u,t.pathToRegexp=s},66621:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{fillMetadataSegment:function(){return f},normalizeMetadataRoute:function(){return p}});let n=r(20616),i=function(e){return e&&e.__esModule?e:{default:e}}(r(11293)),o=r(47262),a=r(55679),u=r(8785),s=r(78168),c=r(41040);function l(e){let t="";return(e.includes("(")&&e.includes(")")||e.includes("@"))&&(t=(0,u.djb2Hash)(e).toString(36).slice(0,6)),t}function f(e,t,r){let n=(0,s.normalizeAppPath)(e),u=(0,a.getNamedRouteRegex)(n,!1),f=(0,o.interpolateDynamicPath)(n,t,u),p=l(e),d=p?`-${p}`:"",{name:m,ext:g}=i.default.parse(r);return(0,c.normalizePathSep)(i.default.join(f,`${m}${d}${g}`))}function p(e){if(!(0,n.isMetadataRoute)(e))return e;let t=e,r="";if("/robots"===e?t+=".txt":"/manifest"===e?t+=".webmanifest":e.endsWith("/sitemap")?t+=".xml":r=l(e.slice(0,-(i.default.basename(e).length+1))),!t.endsWith("/route")){let{dir:o,name:a,ext:u}=i.default.parse(t),s=(0,n.isStaticMetadataRoute)(e);t=i.default.posix.join(o,`${a}${r?`-${r}`:""}${u}`,s?"":"[[...__metadata_id__]]","route")}return t}},20616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{STATIC_METADATA_IMAGES:function(){return i},isMetadataRoute:function(){return l},isMetadataRouteFile:function(){return u},isStaticMetadataRoute:function(){return c},isStaticMetadataRouteFile:function(){return s}});let n=r(41040),i={icon:{filename:"icon",extensions:["ico","jpg","jpeg","png","svg"]},apple:{filename:"apple-icon",extensions:["jpg","jpeg","png"]},favicon:{filename:"favicon",extensions:["ico"]},openGraph:{filename:"opengraph-image",extensions:["jpg","jpeg","png","gif"]},twitter:{filename:"twitter-image",extensions:["jpg","jpeg","png","gif"]}},o=["js","jsx","ts","tsx"],a=e=>`(?:${e.join("|")})`;function u(e,t,r){let o=[RegExp(`^[\\\\/]robots${r?`\\.${a(t.concat("txt"))}$`:""}`),RegExp(`^[\\\\/]manifest${r?`\\.${a(t.concat("webmanifest","json"))}$`:""}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${r?`\\.${a(t.concat("xml"))}$`:""}`),RegExp(`[\\\\/]${i.icon.filename}\\d?${r?`\\.${a(t.concat(i.icon.extensions))}$`:""}`),RegExp(`[\\\\/]${i.apple.filename}\\d?${r?`\\.${a(t.concat(i.apple.extensions))}$`:""}`),RegExp(`[\\\\/]${i.openGraph.filename}\\d?${r?`\\.${a(t.concat(i.openGraph.extensions))}$`:""}`),RegExp(`[\\\\/]${i.twitter.filename}\\d?${r?`\\.${a(t.concat(i.twitter.extensions))}$`:""}`)],u=(0,n.normalizePathSep)(e);return o.some(e=>e.test(u))}function s(e){return u(e,[],!0)}function c(e){return"/robots"===e||"/manifest"===e||s(e)}function l(e){let t=e.replace(/^\/?app\//,"").replace(/\/route$/,"");return"/"!==t[0]&&(t="/"+t),!t.endsWith("/page")&&u(t,o,!1)}},16975:(e,t,r)=>{"use strict";function n(e){return function(){let{cookie:t}=e;if(!t)return{};let{parse:n}=r(17255);return n(Array.isArray(t)?t.join("; "):t)}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getCookieParser",{enumerable:!0,get:function(){return n}})},11586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return i},extractInterceptionRouteInformation:function(){return a},isInterceptionRouteAppPath:function(){return o}});let n=r(78168),i=["(..)(..)","(.)","(..)","(...)"];function o(e){return void 0!==e.split("/").find(e=>i.find(t=>e.startsWith(t)))}function a(e){let t,r,o;for(let n of e.split("/"))if(r=i.find(e=>n.startsWith(e))){[t,o]=e.split(r,2);break}if(!t||!r||!o)throw Error(`Invalid interception route: ${e}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(t=(0,n.normalizeAppPath)(t),r){case"(.)":o="/"===t?`/${o}`:t+"/"+o;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);o=t.split("/").slice(0,-1).concat(o).join("/");break;case"(...)":o="/"+o;break;case"(..)(..)":let a=t.split("/");if(a.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);o=a.slice(0,-2).concat(o).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:o}}},47262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getUtils:function(){return g},interpolateDynamicPath:function(){return d},normalizeDynamicRouteParams:function(){return m},normalizeVercelUrl:function(){return p}});let n=r(17360),i=r(95014),o=r(3707),a=r(55679),u=r(23525),s=r(5257),c=r(37847),l=r(78168),f=r(11943);function p(e,t,r,i,o){if(i&&t&&o){let t=(0,n.parse)(e.url,!0);for(let e of(delete t.search,Object.keys(t.query))){let n=e!==f.NEXT_QUERY_PARAM_PREFIX&&e.startsWith(f.NEXT_QUERY_PARAM_PREFIX),i=e!==f.NEXT_INTERCEPTION_MARKER_PREFIX&&e.startsWith(f.NEXT_INTERCEPTION_MARKER_PREFIX);(n||i||(r||Object.keys(o.groups)).includes(e))&&delete t.query[e]}e.url=(0,n.format)(t)}}function d(e,t,r){if(!r)return e;for(let n of Object.keys(r.groups)){let{optional:i,repeat:o}=r.groups[n],a=`[${o?"...":""}${n}]`;i&&(a=`[${a}]`);let u=e.indexOf(a);if(u>-1){let r;let i=t[n];r=Array.isArray(i)?i.map(e=>e&&encodeURIComponent(e)).join("/"):i?encodeURIComponent(i):"",e=e.slice(0,u)+r+e.slice(u+a.length)}}return e}function m(e,t,r,n){let i=!0;return r?{params:e=Object.keys(r.groups).reduce((o,a)=>{let u=e[a];"string"==typeof u&&(u=(0,l.normalizeRscURL)(u)),Array.isArray(u)&&(u=u.map(e=>("string"==typeof e&&(e=(0,l.normalizeRscURL)(e)),e)));let s=n[a],c=r.groups[a].optional;return((Array.isArray(s)?s.some(e=>Array.isArray(u)?u.some(t=>t.includes(e)):null==u?void 0:u.includes(e)):null==u?void 0:u.includes(s))||void 0===u&&!(c&&t))&&(i=!1),c&&(!u||Array.isArray(u)&&1===u.length&&("index"===u[0]||u[0]===`[[...${a}]]`))&&(u=void 0,delete e[a]),u&&"string"==typeof u&&r.groups[a].repeat&&(u=u.split("/")),u&&(o[a]=u),o},{}),hasValidParams:i}:{params:e,hasValidParams:!1}}function g({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:l,trailingSlash:g,caseSensitive:h}){let E,y,R;return l&&(E=(0,a.getNamedRouteRegex)(e,!1),R=(y=(0,u.getRouteMatcher)(E))(e)),{handleRewrites:function(a,u){let f={},p=u.pathname,d=n=>{let c=(0,o.getPathMatch)(n.source+(g?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!h})(u.pathname);if((n.has||n.missing)&&c){let e=(0,s.matchHas)(a,u.query,n.has,n.missing);e?Object.assign(c,e):c=!1}if(c){let{parsedDestination:o,destQuery:a}=(0,s.prepareDestination)({appendParamsToQuery:!0,destination:n.destination,params:c,query:u.query});if(o.protocol)return!0;if(Object.assign(f,a,c),Object.assign(u.query,o.query),delete o.query,Object.assign(u,o),p=u.pathname,r&&(p=p.replace(RegExp(`^${r}`),"")||"/"),t){let e=(0,i.normalizeLocalePath)(p,t.locales);p=e.pathname,u.query.nextInternalLocale=e.detectedLocale||c.nextInternalLocale}if(p===e)return!0;if(l&&y){let e=y(p);if(e)return u.query={...u.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])d(e);if(p!==e){let t=!1;for(let e of n.afterFiles||[])if(t=d(e))break;if(!t&&!(()=>{let t=(0,c.removeTrailingSlash)(p||"");return t===(0,c.removeTrailingSlash)(e)||(null==y?void 0:y(t))})()){for(let e of n.fallback||[])if(t=d(e))break}}return f},defaultRouteRegex:E,dynamicRouteMatcher:y,defaultRouteMatches:R,getParamsFromRouteMatches:function(e,r,n){return(0,u.getRouteMatcher)(function(){let{groups:e,routeKeys:i}=E;return{re:{exec:o=>{let a=Object.fromEntries(new URLSearchParams(o)),u=t&&n&&a["1"]===n;for(let e of Object.keys(a)){let t=a[e];e!==f.NEXT_QUERY_PARAM_PREFIX&&e.startsWith(f.NEXT_QUERY_PARAM_PREFIX)&&(a[e.substring(f.NEXT_QUERY_PARAM_PREFIX.length)]=t,delete a[e])}let s=Object.keys(i||{}),c=e=>{if(t){let i=Array.isArray(e),o=i?e[0]:e;if("string"==typeof o&&t.locales.some(e=>e.toLowerCase()===o.toLowerCase()&&(n=e,r.locale=n,!0)))return i&&e.splice(0,1),!i||0===e.length}return!1};return s.every(e=>a[e])?s.reduce((t,r)=>{let n=null==i?void 0:i[r];return n&&!c(a[r])&&(t[e[n].pos]=a[r]),t},{}):Object.keys(a).reduce((e,t)=>{if(!c(a[t])){let r=t;return u&&(r=parseInt(t,10)-1+""),Object.assign(e,{[r]:a[t]})}return e},{})}},groups:e}}())(e.headers["x-now-route-matches"])},normalizeDynamicRouteParams:(e,t)=>m(e,t,E,R),normalizeVercelUrl:(e,t,r)=>p(e,t,r,l,E),interpolateDynamicPath:(e,t)=>d(e,t,E)}}},4080:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return i}});let r=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g;function i(e){return r.test(e)?e.replace(n,"\\$&"):e}},8785:(e,t)=>{"use strict";function r(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r)&4294967295;return t>>>0}function n(e){return r(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{djb2Hash:function(){return r},hexHash:function(){return n}})},95014:(e,t)=>{"use strict";function r(e,t){let r;let n=e.split("/");return(t||[]).some(t=>!!n[1]&&n[1].toLowerCase()===t.toLowerCase()&&(r=t,n.splice(1,1),e=n.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return r}})},11293:(e,t,r)=>{"use strict";let n;n=r(55315),e.exports=n},1555:(e,t)=>{"use strict";function r(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return r}})},41040:(e,t)=>{"use strict";function r(e){return e.replace(/\\/g,"/")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathSep",{enumerable:!0,get:function(){return r}})},78168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{normalizeAppPath:function(){return o},normalizeRscURL:function(){return a}});let n=r(1555),i=r(65406);function o(e){return(0,n.ensureLeadingSlash)(e.split("/").reduce((e,t,r,n)=>!t||(0,i.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:e+"/"+t,""))}function a(e){return e.replace(/\.rsc($|\?)/,"$1")}},81942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseRelativeUrl",{enumerable:!0,get:function(){return i}}),r(62569);let n=r(54869);function i(e,t){let r=new URL("http://n"),i=t?new URL(t,r):e.startsWith(".")?new URL("http://n"):r,{pathname:o,searchParams:a,search:u,hash:s,href:c,origin:l}=new URL(e,i);if(l!==r.origin)throw Error("invariant: invalid relative URL, router received "+e);return{pathname:o,query:(0,n.searchParamsToUrlQuery)(a),search:u,hash:s,href:c.slice(r.origin.length)}}},13226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseUrl",{enumerable:!0,get:function(){return o}});let n=r(54869),i=r(81942);function o(e){if(e.startsWith("/"))return(0,i.parseRelativeUrl)(e);let t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:(0,n.searchParamsToUrlQuery)(t.searchParams),search:t.search}}},3707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getPathMatch",{enumerable:!0,get:function(){return i}});let n=r(81792);function i(e,t){let r=[],i=(0,n.pathToRegexp)(e,r,{delimiter:"/",sensitive:"boolean"==typeof(null==t?void 0:t.sensitive)&&t.sensitive,strict:null==t?void 0:t.strict}),o=(0,n.regexpToFunction)((null==t?void 0:t.regexModifier)?new RegExp(t.regexModifier(i.source),i.flags):i,r);return(e,n)=>{if("string"!=typeof e)return!1;let i=o(e);if(!i)return!1;if(null==t?void 0:t.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete i.params[e.name];return{...n,...i.params}}}},5257:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{compileNonPath:function(){return f},matchHas:function(){return l},prepareDestination:function(){return p}});let n=r(81792),i=r(4080),o=r(13226),a=r(11586),u=r(50338),s=r(16975);function c(e){return e.replace(/__ESC_COLON_/gi,":")}function l(e,t,r,n){void 0===r&&(r=[]),void 0===n&&(n=[]);let i={},o=r=>{let n;let o=r.key;switch(r.type){case"header":o=o.toLowerCase(),n=e.headers[o];break;case"cookie":n="cookies"in e?e.cookies[r.key]:(0,s.getCookieParser)(e.headers)()[r.key];break;case"query":n=t[o];break;case"host":{let{host:t}=(null==e?void 0:e.headers)||{};n=null==t?void 0:t.split(":",1)[0].toLowerCase()}}if(!r.value&&n)return i[function(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);(n>64&&n<91||n>96&&n<123)&&(t+=e[r])}return t}(o)]=n,!0;if(n){let e=RegExp("^"+r.value+"$"),t=Array.isArray(n)?n.slice(-1)[0].match(e):n.match(e);if(t)return Array.isArray(t)&&(t.groups?Object.keys(t.groups).forEach(e=>{i[e]=t.groups[e]}):"host"===r.type&&t[0]&&(i.host=t[0])),!0}return!1};return!!r.every(e=>o(e))&&!n.some(e=>o(e))&&i}function f(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(":"+r)&&(e=e.replace(RegExp(":"+r+"\\*","g"),":"+r+"--ESCAPED_PARAM_ASTERISKS").replace(RegExp(":"+r+"\\?","g"),":"+r+"--ESCAPED_PARAM_QUESTION").replace(RegExp(":"+r+"\\+","g"),":"+r+"--ESCAPED_PARAM_PLUS").replace(RegExp(":"+r+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+r));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,n.compile)("/"+e,{validate:!1})(t).slice(1)}function p(e){let t;let r=Object.assign({},e.query);delete r.__nextLocale,delete r.__nextDefaultLocale,delete r.__nextDataReq,delete r.__nextInferredLocaleFromDefault,delete r[u.NEXT_RSC_UNION_QUERY];let s=e.destination;for(let t of Object.keys({...e.params,...r}))s=s.replace(RegExp(":"+(0,i.escapeStringRegexp)(t),"g"),"__ESC_COLON_"+t);let l=(0,o.parseUrl)(s),p=l.query,d=c(""+l.pathname+(l.hash||"")),m=c(l.hostname||""),g=[],h=[];(0,n.pathToRegexp)(d,g),(0,n.pathToRegexp)(m,h);let E=[];g.forEach(e=>E.push(e.name)),h.forEach(e=>E.push(e.name));let y=(0,n.compile)(d,{validate:!1}),R=(0,n.compile)(m,{validate:!1});for(let[t,r]of Object.entries(p))Array.isArray(r)?p[t]=r.map(t=>f(c(t),e.params)):"string"==typeof r&&(p[t]=f(c(r),e.params));let _=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!_.some(e=>E.includes(e)))for(let t of _)t in p||(p[t]=e.params[t]);if((0,a.isInterceptionRouteAppPath)(d))for(let t of d.split("/")){let r=a.INTERCEPTION_ROUTE_MARKERS.find(e=>t.startsWith(e));if(r){e.params["0"]=r;break}}try{let[r,n]=(t=y(e.params)).split("#",2);l.hostname=R(e.params),l.pathname=r,l.hash=(n?"#":"")+(n||""),delete l.search}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw e}return l.query={...r,...l.query},{newUrl:t,destQuery:p,parsedDestination:l}}},54869:(e,t)=>{"use strict";function r(e){let t={};return e.forEach((e,r)=>{void 0===t[r]?t[r]=e:Array.isArray(t[r])?t[r].push(e):t[r]=[t[r],e]}),t}function n(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[r,i]=e;Array.isArray(i)?i.forEach(e=>t.append(r,n(e))):t.set(r,n(i))}),t}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.forEach(t=>{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,r)=>e.append(r,t))}),e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return o},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return i}})},37847:(e,t)=>{"use strict";function r(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return r}})},23525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return i}});let n=r(62569);function i(e){let{re:t,groups:r}=e;return e=>{let i=t.exec(e);if(!i)return!1;let o=e=>{try{return decodeURIComponent(e)}catch(e){throw new n.DecodeError("failed to decode param")}},a={};return Object.keys(r).forEach(e=>{let t=r[e],n=i[t.pos];void 0!==n&&(a[e]=~n.indexOf("/")?n.split("/").map(e=>o(e)):t.repeat?[o(n)]:o(n))}),a}}},55679:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getNamedMiddlewareRegex:function(){return d},getNamedRouteRegex:function(){return p},getRouteRegex:function(){return c},parseParameter:function(){return u}});let n=r(11943),i=r(11586),o=r(4080),a=r(37847);function u(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function s(e){let t=(0,a.removeTrailingSlash)(e).slice(1).split("/"),r={},n=1;return{parameterizedRoute:t.map(e=>{let t=i.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&a){let{key:e,optional:i,repeat:s}=u(a[1]);return r[e]={pos:n++,repeat:s,optional:i},"/"+(0,o.escapeStringRegexp)(t)+"([^/]+?)"}if(!a)return"/"+(0,o.escapeStringRegexp)(e);{let{key:e,repeat:t,optional:i}=u(a[1]);return r[e]={pos:n++,repeat:t,optional:i},t?i?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:r}}function c(e){let{parameterizedRoute:t,groups:r}=s(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:r}}function l(e){let{interceptionMarker:t,getSafeRouteKey:r,segment:n,routeKeys:i,keyPrefix:a}=e,{key:s,optional:c,repeat:l}=u(n),f=s.replace(/\W/g,"");a&&(f=""+a+f);let p=!1;(0===f.length||f.length>30)&&(p=!0),isNaN(parseInt(f.slice(0,1)))||(p=!0),p&&(f=r()),a?i[f]=""+a+s:i[f]=s;let d=t?(0,o.escapeStringRegexp)(t):"";return l?c?"(?:/"+d+"(?<"+f+">.+?))?":"/"+d+"(?<"+f+">.+?)":"/"+d+"(?<"+f+">[^/]+?)"}function f(e,t){let r;let u=(0,a.removeTrailingSlash)(e).slice(1).split("/"),s=(r=0,()=>{let e="",t=++r;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),c={};return{namedParameterizedRoute:u.map(e=>{let r=i.INTERCEPTION_ROUTE_MARKERS.some(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(r&&a){let[r]=e.split(a[0]);return l({getSafeRouteKey:s,interceptionMarker:r,segment:a[1],routeKeys:c,keyPrefix:t?n.NEXT_INTERCEPTION_MARKER_PREFIX:void 0})}return a?l({getSafeRouteKey:s,segment:a[1],routeKeys:c,keyPrefix:t?n.NEXT_QUERY_PARAM_PREFIX:void 0}):"/"+(0,o.escapeStringRegexp)(e)}).join(""),routeKeys:c}}function p(e,t){let r=f(e,t);return{...c(e),namedRegex:"^"+r.namedParameterizedRoute+"(?:/)?$",routeKeys:r.routeKeys}}function d(e,t){let{parameterizedRoute:r}=s(e),{catchAll:n=!0}=t;if("/"===r)return{namedRegex:"^/"+(n?".*":"")+"$"};let{namedParameterizedRoute:i}=f(e,!1);return{namedRegex:"^"+i+(n?"(?:(/.*)?)":"")+"$"}}},65406:(e,t)=>{"use strict";function r(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DEFAULT_SEGMENT_KEY:function(){return i},PAGE_SEGMENT_KEY:function(){return n},isGroupSegment:function(){return r}});let n="__PAGE__",i="__DEFAULT__"},62569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return m},MiddlewareNotFoundError:function(){return y},MissingStaticPage:function(){return E},NormalizeError:function(){return g},PageNotFoundError:function(){return h},SP:function(){return p},ST:function(){return d},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return s},getLocationOrigin:function(){return a},getURL:function(){return u},isAbsoluteUrl:function(){return o},isResSent:function(){return c},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return l},stringifyError:function(){return R}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return r||(r=!0,t=e(...i)),t}}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>i.test(e);function a(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function u(){let{href:e}=window.location,t=a();return e.substring(t.length)}function s(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function c(e){return e.finished||e.headersSent}function l(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&c(r))return n;if(!n)throw Error('"'+s(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.');return n}let p="undefined"!=typeof performance,d=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class m extends Error{}class g extends Error{}class h extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class E extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class y extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function R(e){return JSON.stringify({message:e.message,stack:e.stack})}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=7213,exports.ids=[7213],exports.modules={62648:(t,e,s)=>{s.d(e,{Lm:()=>w,Uv:()=>c,YI:()=>m,_f:()=>h,xd:()=>d,ym:()=>u});var i=s(10927),o=s(61282);let n=(0,s(21764).promisify)(o.exec),a=null;async function r(){if(a)return a;if(process.env.CLAUDE_PATH)return a=process.env.CLAUDE_PATH;try{let{stdout:t}=await n("which claude",{timeout:5e3});return a=t.trim()}catch{for(let t of["/opt/homebrew/bin/claude","/usr/local/bin/claude","/usr/bin/claude"])try{return await n(`test -x "${t}"`,{timeout:1e3}),a=t}catch{}throw Error("Claude CLI not found. Set CLAUDE_PATH environment variable or install Claude CLI.")}}function l(t){return`mcbd-claude-${t}`}async function c(){try{return await n("which claude",{timeout:5e3}),!0}catch{return!1}}async function m(t){let e=l(t);return await (0,i.Hk)(e)}async function u(t){let{worktreeId:e,worktreePath:s}=t;if(!await c())throw Error("Claude CLI is not installed or not in PATH");let o=l(e);if(await (0,i.Hk)(o)){console.log(`Claude session ${o} already exists`);return}try{await (0,i.ed)({sessionName:o,workingDirectory:s,historyLimit:5e4});let t=await r();await (0,i.Is)(o,t,!0);let e=Date.now();for(;Date.now()-e<1e4;){await new Promise(t=>setTimeout(t,500));try{let t=await (0,i.xq)(o,{startLine:-50});if(/^>\s*$/m.test(t)||/^─{10,}$/m.test(t)){console.log(`✓ Claude initialized in ${Date.now()-e}ms`);break}}catch{}}console.log(`✓ Started Claude session: ${o}`)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to start Claude session: ${t}`)}}async function d(t,e){let s=l(t);if(!await (0,i.Hk)(s))throw Error(`Claude session ${s} does not exist. Start the session first.`);try{await (0,i.Is)(s,e,!1),await new Promise(t=>setTimeout(t,100)),await n(`tmux send-keys -t "${s}" C-m`),await new Promise(t=>setTimeout(t,200)),console.log(`✓ Sent message to Claude session: ${s}`)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to send message to Claude: ${t}`)}}async function w(t,e=1e3){let s=l(t);if(!await (0,i.Hk)(s))throw Error(`Claude session ${s} does not exist`);try{return await (0,i.xq)(s,{startLine:-e})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to capture Claude output: ${t}`)}}async function h(t){let e=l(t);try{await (0,i.Hk)(e)&&(await (0,i.Is)(e,"",!1),await n(`tmux send-keys -t "${e}" C-d`),await new Promise(t=>setTimeout(t,500)));let t=await (0,i.AJ)(e);return t&&console.log(`✓ Stopped Claude session: ${e}`),t}catch(e){let t=e instanceof Error?e.message:String(e);return console.error(`Error stopping Claude session: ${t}`),!1}}},97213:(t,e,s)=>{s.d(e,{g:()=>h});var i=s(61282),o=s(21764),n=s(10927);let a=(0,o.promisify)(i.exec);class r{async isInstalled(){try{return await a(`which ${this.command}`,{timeout:5e3}),!0}catch{return!1}}getSessionName(t){return`mcbd-${this.id}-${t}`}async interrupt(t){let e=this.getSessionName(t);await (0,n.ZV)(e,"Escape")}}var l=s(62648);class c extends r{async isInstalled(){return await (0,l.Uv)()}async isRunning(t){return await (0,l.YI)(t)}async startSession(t,e){await (0,l.ym)({worktreeId:t,worktreePath:e})}async sendMessage(t,e){await (0,l.xd)(t,e)}async killSession(t){await (0,l._f)(t)}constructor(...t){super(...t),this.id="claude",this.name="Claude Code",this.command="claude"}}let m=(0,o.promisify)(i.exec);class u extends r{async isRunning(t){let e=this.getSessionName(t);return await (0,n.Hk)(e)}async startSession(t,e){if(!await this.isInstalled())throw Error("Codex CLI is not installed or not in PATH");let s=this.getSessionName(t);if(await (0,n.Hk)(s)){console.log(`Codex session ${s} already exists`);return}try{await (0,n.ed)({sessionName:s,workingDirectory:e,historyLimit:5e4}),await new Promise(t=>setTimeout(t,100)),await (0,n.Is)(s,"codex",!0),await new Promise(t=>setTimeout(t,3e3)),await (0,n.Is)(s,"2",!0),await new Promise(t=>setTimeout(t,500)),console.log(`✓ Started Codex session: ${s}`)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to start Codex session: ${t}`)}}async sendMessage(t,e){let s=this.getSessionName(t);if(!await (0,n.Hk)(s))throw Error(`Codex session ${s} does not exist. Start the session first.`);try{await (0,n.Is)(s,e,!1),await new Promise(t=>setTimeout(t,100)),await m(`tmux send-keys -t "${s}" C-m`),await new Promise(t=>setTimeout(t,200)),console.log(`✓ Sent message to Codex session: ${s}`)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to send message to Codex: ${t}`)}}async killSession(t){let e=this.getSessionName(t);try{await (0,n.Hk)(e)&&(await m(`tmux send-keys -t "${e}" C-d`),await new Promise(t=>setTimeout(t,500))),await (0,n.AJ)(e)&&console.log(`✓ Stopped Codex session: ${e}`)}catch(e){let t=e instanceof Error?e.message:String(e);throw console.error(`Error stopping Codex session: ${t}`),e}}constructor(...t){super(...t),this.id="codex",this.name="Codex CLI",this.command="codex"}}let d=(0,o.promisify)(i.exec);class w extends r{async isRunning(t){let e=this.getSessionName(t);return await (0,n.Hk)(e)}async startSession(t,e){if(!await this.isInstalled())throw Error("Gemini CLI is not installed or not in PATH");let s=this.getSessionName(t);if(await (0,n.Hk)(s)){console.log(`Gemini session ${s} already exists`);return}try{await (0,n.ed)({sessionName:s,workingDirectory:e,historyLimit:5e4}),console.log(`✓ Started Gemini session: ${s}`)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to start Gemini session: ${t}`)}}async sendMessage(t,e){let s=this.getSessionName(t);if(!await (0,n.Hk)(s))throw Error(`Gemini session ${s} does not exist. Start the session first.`);try{let t=e.replace(/'/g,"'\\''");await (0,n.Is)(s,`echo '${t}' | gemini`,!0),console.log(`✓ Sent message to Gemini session: ${s}`)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to send message to Gemini: ${t}`)}}async killSession(t){let e=this.getSessionName(t);try{await (0,n.Hk)(e)&&(await d(`tmux send-keys -t "${e}" C-d`),await new Promise(t=>setTimeout(t,500))),await (0,n.AJ)(e)&&console.log(`✓ Stopped Gemini session: ${e}`)}catch(e){let t=e instanceof Error?e.message:String(e);throw console.error(`Error stopping Gemini session: ${t}`),e}}constructor(...t){super(...t),this.id="gemini",this.name="Gemini CLI",this.command="gemini"}}class h{constructor(){this.tools=new Map,this.tools.set("claude",new c),this.tools.set("codex",new u),this.tools.set("gemini",new w)}static getInstance(){return h.instance||(h.instance=new h),h.instance}getTool(t){let e=this.tools.get(t);if(!e)throw Error(`CLI tool '${t}' not found`);return e}getAllTools(){return Array.from(this.tools.values())}async getToolInfo(t){let e=this.getTool(t),s=await e.isInstalled();return{id:e.id,name:e.name,command:e.command,installed:s}}async getAllToolsInfo(){return Promise.all(this.getAllTools().map(async t=>{let e=await t.isInstalled();return{id:t.id,name:t.name,command:t.command,installed:e}}))}async getInstalledTools(){return(await this.getAllToolsInfo()).filter(t=>t.installed)}}},10927:(t,e,s)=>{s.d(e,{AJ:()=>c,Hk:()=>n,Is:()=>r,ZV:()=>m,ed:()=>a,xq:()=>l});var i=s(61282);let o=(0,s(21764).promisify)(i.exec);async function n(t){try{return await o(`tmux has-session -t "${t}"`,{timeout:5e3}),!0}catch{return!1}}async function a(t,e){let s,i,n;"string"==typeof t?(s=t,i=e,n=5e4):(s=t.sessionName,i=t.workingDirectory,n=t.historyLimit||5e4);try{await o(`tmux new-session -d -s "${s}" -c "${i}"`,{timeout:5e3}),await o(`tmux set-option -t "${s}" history-limit ${n}`,{timeout:5e3})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to create tmux session: ${t}`)}}async function r(t,e,s=!0){let i=e.replace(/'/g,"'\\''"),n=s?`tmux send-keys -t "${t}" '${i}' C-m`:`tmux send-keys -t "${t}" '${i}'`;try{await o(n,{timeout:5e3})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to send keys to tmux session: ${t}`)}}async function l(t,e){let s,i;"number"==typeof e?(s=-e,i="-"):e?(s=e.startLine??-1e4,i=e.endLine??"-"):(s=-1e3,i="-");try{let{stdout:e}=await o(`tmux capture-pane -t "${t}" -p -e -S ${s} -E ${i}`,{timeout:5e3,maxBuffer:10485760});return e}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to capture pane: ${t}`)}}async function c(t){try{return await o(`tmux kill-session -t "${t}"`,{timeout:5e3}),!0}catch(e){let t=e instanceof Error?e.message:String(e);if(t?.includes("no server running")||t?.includes("can't find session"))return!1;throw Error(`Failed to kill tmux session: ${t}`)}}async function m(t,e){try{await o(`tmux send-keys -t "${t}" ${e}`,{timeout:5e3})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to send special key: ${t}`)}}}};
|
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
"use strict";exports.id=7425,exports.ids=[7425],exports.modules={97425:(e,t,s)=>{s.d(t,{n:()=>T});var r=s(85890),a=s.n(r),o=s(55315),i=s.n(o),E=s(75748);let n=[{version:1,name:"initial-schema",up:e=>{(0,E.qZ)(e)},down:e=>{e.exec("DROP TABLE IF EXISTS session_states;"),e.exec("DROP TABLE IF EXISTS chat_messages;"),e.exec("DROP TABLE IF EXISTS worktrees;")}},{version:2,name:"add-multi-repo-and-memo-support",up:e=>{e.exec(`
|
|
2
|
+
ALTER TABLE worktrees ADD COLUMN repository_path TEXT;
|
|
3
|
+
ALTER TABLE worktrees ADD COLUMN repository_name TEXT;
|
|
4
|
+
ALTER TABLE worktrees ADD COLUMN memo TEXT;
|
|
5
|
+
ALTER TABLE worktrees ADD COLUMN last_user_message TEXT;
|
|
6
|
+
ALTER TABLE worktrees ADD COLUMN last_user_message_at INTEGER;
|
|
7
|
+
`),e.exec(`
|
|
8
|
+
CREATE INDEX IF NOT EXISTS idx_worktrees_repository
|
|
9
|
+
ON worktrees(repository_path);
|
|
10
|
+
`);let t=e.prepare("SELECT id, path FROM worktrees").all(),s=e.prepare(`
|
|
11
|
+
UPDATE worktrees
|
|
12
|
+
SET repository_path = ?,
|
|
13
|
+
repository_name = ?
|
|
14
|
+
WHERE id = ?
|
|
15
|
+
`);for(let e of t){let t=_(e.path),r=i().basename(t);s.run(t,r,e.id)}let r=e.prepare(`
|
|
16
|
+
UPDATE worktrees
|
|
17
|
+
SET last_user_message = ?,
|
|
18
|
+
last_user_message_at = ?
|
|
19
|
+
WHERE id = ?
|
|
20
|
+
`);for(let s of t){let t=e.prepare(`
|
|
21
|
+
SELECT content, timestamp
|
|
22
|
+
FROM chat_messages
|
|
23
|
+
WHERE worktree_id = ? AND role = 'user'
|
|
24
|
+
ORDER BY timestamp DESC
|
|
25
|
+
LIMIT 1
|
|
26
|
+
`).get(s.id);if(t){let e=t.content.substring(0,200);r.run(e,t.timestamp,s.id)}}},down:e=>{e.exec(`
|
|
27
|
+
-- Create backup table
|
|
28
|
+
CREATE TABLE worktrees_backup AS
|
|
29
|
+
SELECT id, name, path, last_message_summary, updated_at
|
|
30
|
+
FROM worktrees;
|
|
31
|
+
|
|
32
|
+
-- Drop original table
|
|
33
|
+
DROP TABLE worktrees;
|
|
34
|
+
|
|
35
|
+
-- Recreate original table
|
|
36
|
+
CREATE TABLE worktrees (
|
|
37
|
+
id TEXT PRIMARY KEY,
|
|
38
|
+
name TEXT NOT NULL,
|
|
39
|
+
path TEXT NOT NULL UNIQUE,
|
|
40
|
+
last_message_summary TEXT,
|
|
41
|
+
updated_at INTEGER
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
-- Restore data
|
|
45
|
+
INSERT INTO worktrees (id, name, path, last_message_summary, updated_at)
|
|
46
|
+
SELECT id, name, path, last_message_summary, updated_at
|
|
47
|
+
FROM worktrees_backup;
|
|
48
|
+
|
|
49
|
+
-- Drop backup table
|
|
50
|
+
DROP TABLE worktrees_backup;
|
|
51
|
+
|
|
52
|
+
-- Drop index
|
|
53
|
+
DROP INDEX IF EXISTS idx_worktrees_repository;
|
|
54
|
+
`)}},{version:3,name:"fix-worktree-repository-paths",up:e=>{let t=e.prepare("SELECT id, path FROM worktrees").all(),s=e.prepare(`
|
|
55
|
+
UPDATE worktrees
|
|
56
|
+
SET repository_path = ?,
|
|
57
|
+
repository_name = ?
|
|
58
|
+
WHERE id = ?
|
|
59
|
+
`);for(let e of t){let t=_(e.path),r=i().basename(t);s.run(t,r,e.id)}},down:()=>{console.log("No rollback needed for repository path fix")}},{version:4,name:"add-favorite-field",up:e=>{e.exec(`
|
|
60
|
+
ALTER TABLE worktrees ADD COLUMN favorite INTEGER DEFAULT 0;
|
|
61
|
+
`),e.exec(`
|
|
62
|
+
CREATE INDEX IF NOT EXISTS idx_worktrees_favorite
|
|
63
|
+
ON worktrees(favorite DESC, updated_at DESC);
|
|
64
|
+
`)},down:e=>{e.exec(`
|
|
65
|
+
-- Drop the index first
|
|
66
|
+
DROP INDEX IF EXISTS idx_worktrees_favorite;
|
|
67
|
+
|
|
68
|
+
-- Note: In production, you'd need to recreate the table without the favorite column
|
|
69
|
+
-- This is a simplified down migration
|
|
70
|
+
`)}},{version:5,name:"add-status-field",up:e=>{e.exec(`
|
|
71
|
+
ALTER TABLE worktrees ADD COLUMN status TEXT DEFAULT NULL;
|
|
72
|
+
`),e.exec(`
|
|
73
|
+
CREATE INDEX IF NOT EXISTS idx_worktrees_status
|
|
74
|
+
ON worktrees(status);
|
|
75
|
+
`)},down:e=>{e.exec(`
|
|
76
|
+
DROP INDEX IF EXISTS idx_worktrees_status;
|
|
77
|
+
`)}},{version:6,name:"add-link-field",up:e=>{e.exec(`
|
|
78
|
+
ALTER TABLE worktrees ADD COLUMN link TEXT DEFAULT NULL;
|
|
79
|
+
`)},down:()=>{console.log("No rollback needed for link field")}},{version:7,name:"add-cli-tool-id",up:e=>{e.exec(`
|
|
80
|
+
ALTER TABLE worktrees ADD COLUMN cli_tool_id TEXT DEFAULT 'claude';
|
|
81
|
+
`),e.exec(`
|
|
82
|
+
CREATE INDEX IF NOT EXISTS idx_worktrees_cli_tool
|
|
83
|
+
ON worktrees(cli_tool_id);
|
|
84
|
+
`),e.exec(`
|
|
85
|
+
UPDATE worktrees SET cli_tool_id = 'claude' WHERE cli_tool_id IS NULL;
|
|
86
|
+
`)},down:e=>{e.exec(`
|
|
87
|
+
DROP INDEX IF EXISTS idx_worktrees_cli_tool;
|
|
88
|
+
`),console.log("No full rollback for cli_tool_id column (SQLite limitation)")}},{version:8,name:"change-role-claude-to-assistant",up:e=>{e.exec(`
|
|
89
|
+
CREATE TABLE chat_messages_new (
|
|
90
|
+
id TEXT PRIMARY KEY,
|
|
91
|
+
worktree_id TEXT NOT NULL,
|
|
92
|
+
role TEXT NOT NULL CHECK (role IN ('user', 'assistant')),
|
|
93
|
+
content TEXT NOT NULL,
|
|
94
|
+
summary TEXT,
|
|
95
|
+
timestamp INTEGER NOT NULL,
|
|
96
|
+
log_file_name TEXT,
|
|
97
|
+
request_id TEXT,
|
|
98
|
+
message_type TEXT DEFAULT 'normal',
|
|
99
|
+
prompt_data TEXT,
|
|
100
|
+
cli_tool_id TEXT DEFAULT 'claude',
|
|
101
|
+
FOREIGN KEY (worktree_id) REFERENCES worktrees(id) ON DELETE CASCADE
|
|
102
|
+
);
|
|
103
|
+
`),e.exec(`
|
|
104
|
+
INSERT INTO chat_messages_new
|
|
105
|
+
SELECT
|
|
106
|
+
id,
|
|
107
|
+
worktree_id,
|
|
108
|
+
CASE WHEN role = 'claude' THEN 'assistant' ELSE role END as role,
|
|
109
|
+
content,
|
|
110
|
+
summary,
|
|
111
|
+
timestamp,
|
|
112
|
+
log_file_name,
|
|
113
|
+
request_id,
|
|
114
|
+
message_type,
|
|
115
|
+
prompt_data,
|
|
116
|
+
cli_tool_id
|
|
117
|
+
FROM chat_messages;
|
|
118
|
+
`),e.exec("DROP TABLE chat_messages;"),e.exec("ALTER TABLE chat_messages_new RENAME TO chat_messages;"),e.exec(`
|
|
119
|
+
CREATE INDEX IF NOT EXISTS idx_chat_messages_worktree
|
|
120
|
+
ON chat_messages(worktree_id);
|
|
121
|
+
`),e.exec(`
|
|
122
|
+
CREATE INDEX IF NOT EXISTS idx_chat_messages_timestamp
|
|
123
|
+
ON chat_messages(timestamp);
|
|
124
|
+
`),console.log('✓ Changed role constraint from "claude" to "assistant"'),console.log('✓ Updated existing messages with role="claude" to role="assistant"')},down:e=>{e.exec(`
|
|
125
|
+
CREATE TABLE chat_messages_new (
|
|
126
|
+
id TEXT PRIMARY KEY,
|
|
127
|
+
worktree_id TEXT NOT NULL,
|
|
128
|
+
role TEXT NOT NULL CHECK (role IN ('user', 'claude')),
|
|
129
|
+
content TEXT NOT NULL,
|
|
130
|
+
summary TEXT,
|
|
131
|
+
timestamp INTEGER NOT NULL,
|
|
132
|
+
log_file_name TEXT,
|
|
133
|
+
request_id TEXT,
|
|
134
|
+
message_type TEXT DEFAULT 'normal',
|
|
135
|
+
prompt_data TEXT,
|
|
136
|
+
cli_tool_id TEXT DEFAULT 'claude',
|
|
137
|
+
FOREIGN KEY (worktree_id) REFERENCES worktrees(id) ON DELETE CASCADE
|
|
138
|
+
);
|
|
139
|
+
`),e.exec(`
|
|
140
|
+
INSERT INTO chat_messages_new
|
|
141
|
+
SELECT
|
|
142
|
+
id,
|
|
143
|
+
worktree_id,
|
|
144
|
+
CASE WHEN role = 'assistant' THEN 'claude' ELSE role END as role,
|
|
145
|
+
content,
|
|
146
|
+
summary,
|
|
147
|
+
timestamp,
|
|
148
|
+
log_file_name,
|
|
149
|
+
request_id,
|
|
150
|
+
message_type,
|
|
151
|
+
prompt_data,
|
|
152
|
+
cli_tool_id
|
|
153
|
+
FROM chat_messages;
|
|
154
|
+
`),e.exec("DROP TABLE chat_messages;"),e.exec("ALTER TABLE chat_messages_new RENAME TO chat_messages;"),e.exec(`
|
|
155
|
+
CREATE INDEX IF NOT EXISTS idx_chat_messages_worktree
|
|
156
|
+
ON chat_messages(worktree_id);
|
|
157
|
+
`),e.exec(`
|
|
158
|
+
CREATE INDEX IF NOT EXISTS idx_chat_messages_timestamp
|
|
159
|
+
ON chat_messages(timestamp);
|
|
160
|
+
`),console.log('✓ Rolled back: Changed role constraint from "assistant" to "claude"')}},{version:9,name:"add-in-progress-message-id-to-session-states",up:e=>{e.exec(`
|
|
161
|
+
ALTER TABLE session_states ADD COLUMN in_progress_message_id TEXT DEFAULT NULL;
|
|
162
|
+
`),console.log("✓ Added in_progress_message_id column to session_states table")},down:()=>{console.log("No full rollback for in_progress_message_id column (SQLite limitation)")}},{version:10,name:"add-worktree-memos-table",up:e=>{e.exec(`
|
|
163
|
+
CREATE TABLE worktree_memos (
|
|
164
|
+
id TEXT PRIMARY KEY,
|
|
165
|
+
worktree_id TEXT NOT NULL,
|
|
166
|
+
title TEXT NOT NULL DEFAULT 'Memo',
|
|
167
|
+
content TEXT NOT NULL DEFAULT '',
|
|
168
|
+
position INTEGER NOT NULL DEFAULT 0,
|
|
169
|
+
created_at INTEGER NOT NULL,
|
|
170
|
+
updated_at INTEGER NOT NULL,
|
|
171
|
+
|
|
172
|
+
FOREIGN KEY (worktree_id) REFERENCES worktrees(id) ON DELETE CASCADE,
|
|
173
|
+
UNIQUE(worktree_id, position)
|
|
174
|
+
);
|
|
175
|
+
`),e.exec(`
|
|
176
|
+
CREATE INDEX idx_worktree_memos_worktree
|
|
177
|
+
ON worktree_memos(worktree_id, position);
|
|
178
|
+
`);let{randomUUID:t}=s(84770),r=e.prepare(`
|
|
179
|
+
SELECT id, memo FROM worktrees WHERE memo IS NOT NULL AND memo != ''
|
|
180
|
+
`).all(),a=e.prepare(`
|
|
181
|
+
INSERT INTO worktree_memos (id, worktree_id, title, content, position, created_at, updated_at)
|
|
182
|
+
VALUES (?, ?, 'Memo', ?, 0, ?, ?)
|
|
183
|
+
`),o=Date.now();for(let e of r)a.run(t(),e.id,e.memo,o,o);console.log(`✓ Created worktree_memos table`),console.log(`✓ Migrated ${r.length} existing memos to new table`)},down:e=>{e.exec("DROP TABLE IF EXISTS worktree_memos"),console.log("✓ Dropped worktree_memos table")}},{version:11,name:"add-viewed-tracking",up:e=>{e.exec(`
|
|
184
|
+
ALTER TABLE worktrees ADD COLUMN last_viewed_at TEXT;
|
|
185
|
+
`),e.exec(`
|
|
186
|
+
CREATE INDEX IF NOT EXISTS idx_chat_messages_assistant_latest
|
|
187
|
+
ON chat_messages(worktree_id, role, timestamp DESC);
|
|
188
|
+
`),console.log("✓ Added last_viewed_at column to worktrees table"),console.log("✓ Created index for assistant message queries")},down:e=>{e.exec("DROP INDEX IF EXISTS idx_chat_messages_assistant_latest"),console.log("✓ Dropped idx_chat_messages_assistant_latest index")}},{version:12,name:"add-external-apps-table",up:e=>{e.exec(`
|
|
189
|
+
CREATE TABLE IF NOT EXISTS external_apps (
|
|
190
|
+
id TEXT PRIMARY KEY,
|
|
191
|
+
|
|
192
|
+
-- Basic info
|
|
193
|
+
name TEXT NOT NULL UNIQUE,
|
|
194
|
+
display_name TEXT NOT NULL,
|
|
195
|
+
description TEXT,
|
|
196
|
+
|
|
197
|
+
-- Routing config
|
|
198
|
+
path_prefix TEXT NOT NULL UNIQUE,
|
|
199
|
+
target_port INTEGER NOT NULL,
|
|
200
|
+
target_host TEXT DEFAULT 'localhost',
|
|
201
|
+
|
|
202
|
+
-- App type
|
|
203
|
+
app_type TEXT NOT NULL CHECK(app_type IN ('sveltekit', 'streamlit', 'nextjs', 'other')),
|
|
204
|
+
|
|
205
|
+
-- WebSocket config
|
|
206
|
+
websocket_enabled INTEGER DEFAULT 0,
|
|
207
|
+
websocket_path_pattern TEXT,
|
|
208
|
+
|
|
209
|
+
-- Status
|
|
210
|
+
enabled INTEGER DEFAULT 1,
|
|
211
|
+
|
|
212
|
+
-- Metadata
|
|
213
|
+
created_at INTEGER NOT NULL,
|
|
214
|
+
updated_at INTEGER NOT NULL
|
|
215
|
+
);
|
|
216
|
+
`),e.exec(`
|
|
217
|
+
CREATE INDEX idx_external_apps_path_prefix ON external_apps(path_prefix);
|
|
218
|
+
`),e.exec(`
|
|
219
|
+
CREATE INDEX idx_external_apps_enabled ON external_apps(enabled);
|
|
220
|
+
`),console.log("✓ Created external_apps table"),console.log("✓ Created indexes for external_apps")},down:e=>{e.exec("DROP INDEX IF EXISTS idx_external_apps_enabled"),e.exec("DROP INDEX IF EXISTS idx_external_apps_path_prefix"),e.exec("DROP TABLE IF EXISTS external_apps"),console.log("✓ Dropped external_apps table and indexes")}},{version:13,name:"rename-worktree-memo-to-description",up:e=>{e.exec(`
|
|
221
|
+
ALTER TABLE worktrees RENAME COLUMN memo TO description;
|
|
222
|
+
`),console.log("✓ Renamed worktrees.memo column to description")},down:e=>{e.exec(`
|
|
223
|
+
ALTER TABLE worktrees RENAME COLUMN description TO memo;
|
|
224
|
+
`),console.log("✓ Rolled back: Renamed worktrees.description column back to memo")}},{version:14,name:"add-repositories-and-clone-jobs-tables",up:e=>{e.exec(`
|
|
225
|
+
CREATE TABLE IF NOT EXISTS repositories (
|
|
226
|
+
id TEXT PRIMARY KEY,
|
|
227
|
+
name TEXT NOT NULL,
|
|
228
|
+
path TEXT NOT NULL UNIQUE,
|
|
229
|
+
enabled INTEGER NOT NULL DEFAULT 1,
|
|
230
|
+
clone_url TEXT,
|
|
231
|
+
normalized_clone_url TEXT,
|
|
232
|
+
clone_source TEXT CHECK(clone_source IN ('local', 'https', 'ssh')) DEFAULT 'local',
|
|
233
|
+
is_env_managed INTEGER NOT NULL DEFAULT 0,
|
|
234
|
+
created_at INTEGER NOT NULL,
|
|
235
|
+
updated_at INTEGER NOT NULL
|
|
236
|
+
);
|
|
237
|
+
`),e.exec(`
|
|
238
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_repositories_normalized_clone_url
|
|
239
|
+
ON repositories(normalized_clone_url)
|
|
240
|
+
WHERE normalized_clone_url IS NOT NULL;
|
|
241
|
+
`),e.exec(`
|
|
242
|
+
CREATE INDEX IF NOT EXISTS idx_repositories_path
|
|
243
|
+
ON repositories(path);
|
|
244
|
+
`),e.exec(`
|
|
245
|
+
CREATE TABLE IF NOT EXISTS clone_jobs (
|
|
246
|
+
id TEXT PRIMARY KEY,
|
|
247
|
+
clone_url TEXT NOT NULL,
|
|
248
|
+
normalized_clone_url TEXT NOT NULL,
|
|
249
|
+
target_path TEXT NOT NULL,
|
|
250
|
+
repository_id TEXT,
|
|
251
|
+
status TEXT NOT NULL CHECK(status IN ('pending', 'running', 'completed', 'failed', 'cancelled')) DEFAULT 'pending',
|
|
252
|
+
pid INTEGER,
|
|
253
|
+
progress INTEGER NOT NULL DEFAULT 0,
|
|
254
|
+
error_category TEXT,
|
|
255
|
+
error_code TEXT,
|
|
256
|
+
error_message TEXT,
|
|
257
|
+
started_at INTEGER,
|
|
258
|
+
completed_at INTEGER,
|
|
259
|
+
created_at INTEGER NOT NULL,
|
|
260
|
+
|
|
261
|
+
FOREIGN KEY (repository_id) REFERENCES repositories(id) ON DELETE SET NULL
|
|
262
|
+
);
|
|
263
|
+
`),e.exec(`
|
|
264
|
+
CREATE INDEX IF NOT EXISTS idx_clone_jobs_status
|
|
265
|
+
ON clone_jobs(status);
|
|
266
|
+
`),e.exec(`
|
|
267
|
+
CREATE INDEX IF NOT EXISTS idx_clone_jobs_normalized_clone_url
|
|
268
|
+
ON clone_jobs(normalized_clone_url);
|
|
269
|
+
`),console.log("✓ Created repositories table"),console.log("✓ Created clone_jobs table"),console.log("✓ Created indexes for repositories and clone_jobs")},down:e=>{e.exec("DROP INDEX IF EXISTS idx_clone_jobs_normalized_clone_url"),e.exec("DROP INDEX IF EXISTS idx_clone_jobs_status"),e.exec("DROP TABLE IF EXISTS clone_jobs"),e.exec("DROP INDEX IF EXISTS idx_repositories_path"),e.exec("DROP INDEX IF EXISTS idx_repositories_normalized_clone_url"),e.exec("DROP TABLE IF EXISTS repositories"),console.log("✓ Dropped repositories and clone_jobs tables")}}];function _(e){let t=s(92048),r=e;for(;r!==i().dirname(r);){let e=i().join(r,".git");if(t.existsSync(e)){let s=t.statSync(e);if(s.isDirectory())return r;if(s.isFile()){let s=t.readFileSync(e,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(s)return s[1].split("/.git/")[0]}}r=i().dirname(r)}return e}function l(e){try{let t=e.prepare("SELECT MAX(version) as version FROM schema_version").get();return t?.version??0}catch{return 0}}let d=null;function T(){if(!d){let e=process.env.DATABASE_PATH||i().join(process.cwd(),"data","db.sqlite"),t=s(92048),r=i().dirname(e);t.existsSync(r)||t.mkdirSync(r,{recursive:!0}),function(e){!function(e){e.exec(`
|
|
270
|
+
CREATE TABLE IF NOT EXISTS schema_version (
|
|
271
|
+
version INTEGER PRIMARY KEY,
|
|
272
|
+
name TEXT NOT NULL,
|
|
273
|
+
applied_at INTEGER NOT NULL
|
|
274
|
+
);
|
|
275
|
+
`)}(e);let t=l(e);console.log(`Current schema version: ${t}`);let s=n.filter(e=>e.version>t);if(0===s.length){console.log("✓ Schema is up to date");return}for(let t of(console.log(`Found ${s.length} pending migration(s)`),s)){console.log(`Applying migration ${t.version}: ${t.name}...`);try{e.transaction(()=>{t.up(e),e.prepare(`
|
|
276
|
+
INSERT INTO schema_version (version, name, applied_at)
|
|
277
|
+
VALUES (?, ?, ?)
|
|
278
|
+
`).run(t.version,t.name,Date.now())})(),console.log(`✓ Migration ${t.version} applied successfully`)}catch(s){let e=s instanceof Error?s.message:String(s);throw console.error(`✗ Migration ${t.version} failed:`,e),Error(`Migration ${t.version} (${t.name}) failed: ${e}`)}}console.log(`✓ All migrations completed. Current version: ${l(e)}`)}(d=new(a())(e))}return d}},75748:(e,t,s)=>{s.d(t,{DF:()=>y,Db:()=>C,ER:()=>E,GA:()=>A,GP:()=>O,HE:()=>u,IH:()=>L,Mf:()=>w,Nf:()=>D,Nr:()=>h,OK:()=>R,Of:()=>T,Pv:()=>F,R3:()=>S,S$:()=>I,VW:()=>k,Xv:()=>i,ZI:()=>U,_U:()=>m,_e:()=>f,dD:()=>x,gU:()=>n,j8:()=>g,ly:()=>_,qZ:()=>o,tn:()=>p,vX:()=>c,xr:()=>l,y:()=>d,zl:()=>N});var r=s(84770);function a(e){return{id:e.id,worktreeId:e.worktree_id,role:e.role,content:e.content,summary:e.summary||void 0,timestamp:new Date(e.timestamp),logFileName:e.log_file_name||void 0,requestId:e.request_id||void 0,messageType:e.message_type||"normal",promptData:e.prompt_data?JSON.parse(e.prompt_data):void 0,cliToolId:e.cli_tool_id??"claude"}}function o(e){e.exec(`
|
|
279
|
+
CREATE TABLE IF NOT EXISTS worktrees (
|
|
280
|
+
id TEXT PRIMARY KEY,
|
|
281
|
+
name TEXT NOT NULL,
|
|
282
|
+
path TEXT NOT NULL UNIQUE,
|
|
283
|
+
last_message_summary TEXT,
|
|
284
|
+
updated_at INTEGER
|
|
285
|
+
);
|
|
286
|
+
`),e.exec(`
|
|
287
|
+
CREATE INDEX IF NOT EXISTS idx_worktrees_updated_at
|
|
288
|
+
ON worktrees(updated_at DESC);
|
|
289
|
+
`),e.exec(`
|
|
290
|
+
CREATE TABLE IF NOT EXISTS chat_messages (
|
|
291
|
+
id TEXT PRIMARY KEY,
|
|
292
|
+
worktree_id TEXT NOT NULL,
|
|
293
|
+
role TEXT NOT NULL CHECK(role IN ('user', 'assistant')),
|
|
294
|
+
content TEXT NOT NULL,
|
|
295
|
+
summary TEXT,
|
|
296
|
+
timestamp INTEGER NOT NULL,
|
|
297
|
+
log_file_name TEXT,
|
|
298
|
+
request_id TEXT,
|
|
299
|
+
message_type TEXT DEFAULT 'normal',
|
|
300
|
+
prompt_data TEXT,
|
|
301
|
+
cli_tool_id TEXT DEFAULT 'claude',
|
|
302
|
+
|
|
303
|
+
FOREIGN KEY (worktree_id) REFERENCES worktrees(id) ON DELETE CASCADE
|
|
304
|
+
);
|
|
305
|
+
`),e.exec(`
|
|
306
|
+
CREATE INDEX IF NOT EXISTS idx_messages_worktree_time
|
|
307
|
+
ON chat_messages(worktree_id, timestamp DESC);
|
|
308
|
+
`),e.exec(`
|
|
309
|
+
CREATE INDEX IF NOT EXISTS idx_messages_request_id
|
|
310
|
+
ON chat_messages(request_id);
|
|
311
|
+
`),e.exec(`
|
|
312
|
+
CREATE INDEX IF NOT EXISTS idx_messages_type
|
|
313
|
+
ON chat_messages(message_type, worktree_id);
|
|
314
|
+
`),e.exec(`
|
|
315
|
+
CREATE INDEX IF NOT EXISTS idx_messages_cli_tool
|
|
316
|
+
ON chat_messages(worktree_id, cli_tool_id, timestamp DESC);
|
|
317
|
+
`),e.exec(`
|
|
318
|
+
CREATE TABLE IF NOT EXISTS session_states (
|
|
319
|
+
worktree_id TEXT NOT NULL,
|
|
320
|
+
cli_tool_id TEXT NOT NULL DEFAULT 'claude',
|
|
321
|
+
last_captured_line INTEGER DEFAULT 0,
|
|
322
|
+
|
|
323
|
+
PRIMARY KEY (worktree_id, cli_tool_id),
|
|
324
|
+
FOREIGN KEY (worktree_id) REFERENCES worktrees(id) ON DELETE CASCADE
|
|
325
|
+
);
|
|
326
|
+
`)}function i(e,t){let s=`
|
|
327
|
+
SELECT
|
|
328
|
+
w.id, w.name, w.path, w.repository_path, w.repository_name, w.description,
|
|
329
|
+
w.last_user_message, w.last_user_message_at, w.last_message_summary,
|
|
330
|
+
w.updated_at, w.favorite, w.status, w.link, w.cli_tool_id, w.last_viewed_at,
|
|
331
|
+
(SELECT MAX(timestamp) FROM chat_messages
|
|
332
|
+
WHERE worktree_id = w.id AND role = 'assistant') as last_assistant_message_at
|
|
333
|
+
FROM worktrees w
|
|
334
|
+
`,r=[];t&&(s+=" WHERE w.repository_path = ?",r.push(t)),s+=" ORDER BY w.updated_at DESC NULLS LAST";let a=e.prepare(s).all(...r),o=function(e,t){if(0===t.length)return new Map;let s=t.map(()=>"?").join(","),r=e.prepare(`
|
|
335
|
+
WITH ranked_messages AS (
|
|
336
|
+
SELECT
|
|
337
|
+
worktree_id,
|
|
338
|
+
cli_tool_id,
|
|
339
|
+
content,
|
|
340
|
+
ROW_NUMBER() OVER (
|
|
341
|
+
PARTITION BY worktree_id, cli_tool_id
|
|
342
|
+
ORDER BY timestamp DESC
|
|
343
|
+
) as rn
|
|
344
|
+
FROM chat_messages
|
|
345
|
+
WHERE worktree_id IN (${s})
|
|
346
|
+
AND role = 'user'
|
|
347
|
+
AND cli_tool_id IN ('claude', 'codex', 'gemini')
|
|
348
|
+
)
|
|
349
|
+
SELECT worktree_id, cli_tool_id, content
|
|
350
|
+
FROM ranked_messages
|
|
351
|
+
WHERE rn = 1
|
|
352
|
+
`).all(...t),a=new Map;for(let e of t)a.set(e,{});for(let e of r){let t=a.get(e.worktree_id)||{};t[e.cli_tool_id]=e.content.substring(0,50),a.set(e.worktree_id,t)}return a}(e,a.map(e=>e.id));return a.map(e=>{let t=o.get(e.id)||{};return{id:e.id,name:e.name,path:e.path,repositoryPath:e.repository_path||"",repositoryName:e.repository_name||"",description:e.description||void 0,lastUserMessage:e.last_user_message||void 0,lastUserMessageAt:e.last_user_message_at?new Date(e.last_user_message_at):void 0,lastMessageSummary:e.last_message_summary||void 0,lastMessagesByCli:t,updatedAt:e.updated_at?new Date(e.updated_at):void 0,lastViewedAt:e.last_viewed_at?new Date(e.last_viewed_at):void 0,lastAssistantMessageAt:e.last_assistant_message_at?new Date(e.last_assistant_message_at):void 0,favorite:1===e.favorite,status:e.status||null,link:e.link||void 0,cliToolId:e.cli_tool_id??"claude"}})}function E(e){return e.prepare(`
|
|
353
|
+
SELECT
|
|
354
|
+
repository_path as path,
|
|
355
|
+
repository_name as name,
|
|
356
|
+
COUNT(*) as worktree_count
|
|
357
|
+
FROM worktrees
|
|
358
|
+
WHERE repository_path IS NOT NULL
|
|
359
|
+
GROUP BY repository_path, repository_name
|
|
360
|
+
ORDER BY repository_name ASC
|
|
361
|
+
`).all().map(e=>({path:e.path,name:e.name,worktreeCount:e.worktree_count}))}function n(e,t){let s=e.prepare(`
|
|
362
|
+
SELECT
|
|
363
|
+
w.id, w.name, w.path, w.repository_path, w.repository_name, w.description,
|
|
364
|
+
w.last_user_message, w.last_user_message_at, w.last_message_summary,
|
|
365
|
+
w.updated_at, w.favorite, w.status, w.link, w.cli_tool_id, w.last_viewed_at,
|
|
366
|
+
(SELECT MAX(timestamp) FROM chat_messages
|
|
367
|
+
WHERE worktree_id = w.id AND role = 'assistant') as last_assistant_message_at
|
|
368
|
+
FROM worktrees w
|
|
369
|
+
WHERE w.id = ?
|
|
370
|
+
`).get(t);return s?{id:s.id,name:s.name,path:s.path,repositoryPath:s.repository_path||"",repositoryName:s.repository_name||"",description:s.description||void 0,lastUserMessage:s.last_user_message||void 0,lastUserMessageAt:s.last_user_message_at?new Date(s.last_user_message_at):void 0,lastMessageSummary:s.last_message_summary||void 0,updatedAt:s.updated_at?new Date(s.updated_at):void 0,lastViewedAt:s.last_viewed_at?new Date(s.last_viewed_at):void 0,lastAssistantMessageAt:s.last_assistant_message_at?new Date(s.last_assistant_message_at):void 0,favorite:1===s.favorite,status:s.status||null,link:s.link||void 0,cliToolId:s.cli_tool_id??"claude"}:null}function _(e,t){e.prepare("DELETE FROM worktrees WHERE path = ? AND id != ?").run(t.path,t.id),e.prepare(`
|
|
371
|
+
INSERT INTO worktrees (
|
|
372
|
+
id, name, path, repository_path, repository_name, description,
|
|
373
|
+
last_user_message, last_user_message_at, last_message_summary, updated_at, cli_tool_id
|
|
374
|
+
)
|
|
375
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
376
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
377
|
+
name = excluded.name,
|
|
378
|
+
path = excluded.path,
|
|
379
|
+
repository_path = excluded.repository_path,
|
|
380
|
+
repository_name = excluded.repository_name,
|
|
381
|
+
description = COALESCE(excluded.description, worktrees.description),
|
|
382
|
+
last_user_message = COALESCE(excluded.last_user_message, worktrees.last_user_message),
|
|
383
|
+
last_user_message_at = COALESCE(excluded.last_user_message_at, worktrees.last_user_message_at),
|
|
384
|
+
last_message_summary = COALESCE(excluded.last_message_summary, worktrees.last_message_summary),
|
|
385
|
+
updated_at = COALESCE(excluded.updated_at, worktrees.updated_at),
|
|
386
|
+
cli_tool_id = COALESCE(excluded.cli_tool_id, worktrees.cli_tool_id)
|
|
387
|
+
`).run(t.id,t.name,t.path,t.repositoryPath||null,t.repositoryName||null,t.description||null,t.lastUserMessage||null,t.lastUserMessageAt?.getTime()||null,t.lastMessageSummary||null,t.updatedAt?.getTime()||null,t.cliToolId||"claude")}function l(e,t,s){e.prepare(`
|
|
388
|
+
UPDATE worktrees
|
|
389
|
+
SET description = ?
|
|
390
|
+
WHERE id = ?
|
|
391
|
+
`).run(s||null,t)}function d(e,t,s){e.prepare(`
|
|
392
|
+
UPDATE worktrees
|
|
393
|
+
SET link = ?
|
|
394
|
+
WHERE id = ?
|
|
395
|
+
`).run(s||null,t)}function T(e,t,s){e.prepare(`
|
|
396
|
+
UPDATE worktrees
|
|
397
|
+
SET last_viewed_at = ?
|
|
398
|
+
WHERE id = ?
|
|
399
|
+
`).run(s.toISOString(),t)}function p(e,t){let s=(0,r.randomUUID)();return e.prepare(`
|
|
400
|
+
INSERT INTO chat_messages
|
|
401
|
+
(id, worktree_id, role, content, summary, timestamp, log_file_name, request_id, message_type, prompt_data, cli_tool_id)
|
|
402
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
403
|
+
`).run(s,t.worktreeId,t.role,t.content,t.summary||null,t.timestamp.getTime(),t.logFileName||null,t.requestId||null,t.messageType||"normal",t.promptData?JSON.stringify(t.promptData):null,t.cliToolId||"claude"),function(e,t,s){e.prepare(`
|
|
404
|
+
UPDATE worktrees
|
|
405
|
+
SET updated_at = ?
|
|
406
|
+
WHERE id = ?
|
|
407
|
+
`).run(s.getTime(),t)}(e,t.worktreeId,t.timestamp),"user"===t.role&&R(e,t.worktreeId,t.content,t.timestamp),{id:s,...t}}function m(e,t,s,r=50,o){let i=`
|
|
408
|
+
SELECT id, worktree_id, role, content, summary, timestamp, log_file_name, request_id, message_type, prompt_data, cli_tool_id
|
|
409
|
+
FROM chat_messages
|
|
410
|
+
WHERE worktree_id = ? AND (? IS NULL OR timestamp < ?)
|
|
411
|
+
`,E=[t,s?.getTime()||null,s?.getTime()||null];return o&&(i+=" AND cli_tool_id = ?",E.push(o)),i+=" ORDER BY timestamp DESC LIMIT ?",E.push(r),e.prepare(i).all(...E).map(a)}function c(e,t){let s=e.prepare(`
|
|
412
|
+
SELECT id, worktree_id, role, content, summary, timestamp, log_file_name, request_id, message_type, prompt_data, cli_tool_id
|
|
413
|
+
FROM chat_messages
|
|
414
|
+
WHERE worktree_id = ? AND role = 'user'
|
|
415
|
+
ORDER BY timestamp DESC
|
|
416
|
+
LIMIT 1
|
|
417
|
+
`).get(t);return s?a(s):null}function u(e,t){e.prepare(`
|
|
418
|
+
DELETE FROM chat_messages
|
|
419
|
+
WHERE worktree_id = ?
|
|
420
|
+
`).run(t),console.log(`[deleteAllMessages] Deleted all messages for worktree: ${t}`)}function N(e,t,s="claude"){let r=e.prepare(`
|
|
421
|
+
SELECT worktree_id, cli_tool_id, last_captured_line, in_progress_message_id
|
|
422
|
+
FROM session_states
|
|
423
|
+
WHERE worktree_id = ? AND cli_tool_id = ?
|
|
424
|
+
`).get(t,s);return r?{worktreeId:r.worktree_id,cliToolId:r.cli_tool_id,lastCapturedLine:r.last_captured_line,inProgressMessageId:r.in_progress_message_id||null}:null}function L(e,t,s,r){e.prepare(`
|
|
425
|
+
INSERT INTO session_states (worktree_id, cli_tool_id, last_captured_line)
|
|
426
|
+
VALUES (?, ?, ?)
|
|
427
|
+
ON CONFLICT(worktree_id, cli_tool_id) DO UPDATE SET
|
|
428
|
+
last_captured_line = excluded.last_captured_line
|
|
429
|
+
`).run(t,s,r)}function w(e,t,s){!function(e,t,s,r){e.prepare(`
|
|
430
|
+
INSERT INTO session_states (worktree_id, cli_tool_id, last_captured_line, in_progress_message_id)
|
|
431
|
+
VALUES (?, ?, 0, ?)
|
|
432
|
+
ON CONFLICT(worktree_id, cli_tool_id) DO UPDATE SET
|
|
433
|
+
in_progress_message_id = excluded.in_progress_message_id
|
|
434
|
+
`).run(t,s,null)}(e,t,s,0)}function g(e,t,s){s?e.prepare(`
|
|
435
|
+
DELETE FROM session_states
|
|
436
|
+
WHERE worktree_id = ? AND cli_tool_id = ?
|
|
437
|
+
`).run(t,s):e.prepare(`
|
|
438
|
+
DELETE FROM session_states
|
|
439
|
+
WHERE worktree_id = ?
|
|
440
|
+
`).run(t)}function R(e,t,s,r){let a=e.prepare(`
|
|
441
|
+
UPDATE worktrees
|
|
442
|
+
SET last_user_message = ?,
|
|
443
|
+
last_user_message_at = ?
|
|
444
|
+
WHERE id = ?
|
|
445
|
+
`),o=s.substring(0,200);a.run(o,r.getTime(),t)}function I(e,t){let s=e.prepare(`
|
|
446
|
+
SELECT id, worktree_id, role, content, summary, timestamp, log_file_name, request_id, message_type, prompt_data, cli_tool_id
|
|
447
|
+
FROM chat_messages
|
|
448
|
+
WHERE id = ?
|
|
449
|
+
`).get(t);return s?a(s):null}function A(e,t,s){e.prepare(`
|
|
450
|
+
UPDATE chat_messages
|
|
451
|
+
SET prompt_data = ?
|
|
452
|
+
WHERE id = ?
|
|
453
|
+
`).run(JSON.stringify(s),t)}function O(e,t,s){let r=e.prepare(`
|
|
454
|
+
SELECT id, prompt_data
|
|
455
|
+
FROM chat_messages
|
|
456
|
+
WHERE worktree_id = ?
|
|
457
|
+
AND cli_tool_id = ?
|
|
458
|
+
AND message_type = 'prompt'
|
|
459
|
+
AND json_extract(prompt_data, '$.status') = 'pending'
|
|
460
|
+
ORDER BY timestamp DESC
|
|
461
|
+
`).all(t,s);if(0===r.length)return 0;let a=e.prepare(`
|
|
462
|
+
UPDATE chat_messages
|
|
463
|
+
SET prompt_data = ?
|
|
464
|
+
WHERE id = ?
|
|
465
|
+
`),o=0;for(let e of r)try{let t=JSON.parse(e.prompt_data);t.status="answered",t.answer="(answered via terminal)",t.answeredAt=new Date().toISOString(),a.run(JSON.stringify(t),e.id),o++}catch{}return o}function S(e,t,s){e.prepare(`
|
|
466
|
+
UPDATE worktrees
|
|
467
|
+
SET favorite = ?
|
|
468
|
+
WHERE id = ?
|
|
469
|
+
`).run(s?1:0,t)}function D(e,t,s){e.prepare(`
|
|
470
|
+
UPDATE worktrees
|
|
471
|
+
SET status = ?
|
|
472
|
+
WHERE id = ?
|
|
473
|
+
`).run(s,t)}function k(e,t,s){e.prepare(`
|
|
474
|
+
UPDATE worktrees
|
|
475
|
+
SET cli_tool_id = ?
|
|
476
|
+
WHERE id = ?
|
|
477
|
+
`).run(s,t)}function X(e){return{id:e.id,worktreeId:e.worktree_id,title:e.title,content:e.content,position:e.position,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}function C(e,t){return e.prepare(`
|
|
478
|
+
SELECT id, worktree_id, title, content, position, created_at, updated_at
|
|
479
|
+
FROM worktree_memos
|
|
480
|
+
WHERE worktree_id = ?
|
|
481
|
+
ORDER BY position ASC
|
|
482
|
+
`).all(t).map(X)}function U(e,t){let s=e.prepare(`
|
|
483
|
+
SELECT id, worktree_id, title, content, position, created_at, updated_at
|
|
484
|
+
FROM worktree_memos
|
|
485
|
+
WHERE id = ?
|
|
486
|
+
`).get(t);return s?X(s):null}function x(e,t,s){let a=(0,r.randomUUID)(),o=Date.now(),i=s.title??"Memo",E=s.content??"";return e.prepare(`
|
|
487
|
+
INSERT INTO worktree_memos (id, worktree_id, title, content, position, created_at, updated_at)
|
|
488
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
489
|
+
`).run(a,t,i,E,s.position,o,o),{id:a,worktreeId:t,title:i,content:E,position:s.position,createdAt:new Date(o),updatedAt:new Date(o)}}function h(e,t,s){let r=Date.now(),a=["updated_at = ?"],o=[r];void 0!==s.title&&(a.push("title = ?"),o.push(s.title)),void 0!==s.content&&(a.push("content = ?"),o.push(s.content)),o.push(t),e.prepare(`
|
|
490
|
+
UPDATE worktree_memos
|
|
491
|
+
SET ${a.join(", ")}
|
|
492
|
+
WHERE id = ?
|
|
493
|
+
`).run(...o)}function f(e,t){e.prepare(`
|
|
494
|
+
DELETE FROM worktree_memos
|
|
495
|
+
WHERE id = ?
|
|
496
|
+
`).run(t)}function F(e,t){return e.prepare(`
|
|
497
|
+
SELECT id FROM worktrees WHERE repository_path = ?
|
|
498
|
+
`).all(t).map(e=>e.id)}function y(e,t){return{deletedCount:e.prepare(`
|
|
499
|
+
DELETE FROM worktrees WHERE repository_path = ?
|
|
500
|
+
`).run(t).changes}}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=8585,exports.ids=[8585],exports.modules={39365:(e,t,r)=>{r.d(t,{ZI:()=>E,ty:()=>a});let i=[".md"],n=[{extension:".md",maxFileSize:1048576}];function E(e){if(!e)return!1;let t=e.toLowerCase();return i.includes(t)}function a(e,t){let r=e.toLowerCase(),i=n.find(e=>e.extension===r);return i?i.maxFileSize&&t.length>i.maxFileSize?{valid:!1,error:"File size exceeds limit"}:t.includes("\0")?{valid:!1,error:"Binary content detected"}:(/[\x01-\x08\x0B\x0C\x0E-\x1F]/.test(t)&&console.warn("Content contains control characters"),i.additionalValidation&&!i.additionalValidation(t))?{valid:!1,error:"Content validation failed"}:{valid:!0}:{valid:!1,error:"Unsupported extension"}}},68585:(e,t,r)=>{r.d(t,{wZ:()=>I,D5:()=>D,jN:()=>T,rN:()=>l,TG:()=>_,O2:()=>f,nz:()=>S,xH:()=>N,Kr:()=>L});var i=r(20629),n=r(92048),E=r(55315),a=r(57440),o=r(39365);let s={MAX_RECURSIVE_DELETE_FILES:100,MAX_RECURSIVE_DELETE_DEPTH:10,PROTECTED_DIRECTORIES:[".git",".github","node_modules"]},c={FILE_NOT_FOUND:"File not found",PERMISSION_DENIED:"Permission denied",INVALID_PATH:"Invalid path",INVALID_NAME:"Invalid name",DIRECTORY_NOT_EMPTY:"Directory is not empty",FILE_EXISTS:"File already exists",PROTECTED_DIRECTORY:"Protected directory cannot be deleted",DELETE_LIMIT_EXCEEDED:"Delete limit exceeded",DISK_FULL:"Disk is full",INTERNAL_ERROR:"Internal error",INVALID_EXTENSION:"Unsupported file type",INVALID_MIME_TYPE:"Invalid file format",INVALID_MAGIC_BYTES:"Invalid file format",FILE_TOO_LARGE:"File size exceeds limit",INVALID_FILENAME:"Invalid filename",INVALID_FILE_CONTENT:"Invalid file content"};function I(e,t){return{success:!1,error:{code:e,message:t||c[e]}}}function l(e){let t=(0,E.extname)(e).toLowerCase();return(0,o.ZI)(t)}let u=/[<>:"|?*]/,d=/[\x00-\x1F]/;function _(e,t){if(!e||""===e.trim())return{valid:!1,error:"Name cannot be empty"};if(e.includes(".."))return{valid:!1,error:'Name cannot contain ".."'};if(e.includes("/")||e.includes("\\"))return{valid:!1,error:"Name cannot contain path separators"};if(t?.forUpload){if(d.test(e))return{valid:!1,error:"Name cannot contain control characters"};if(u.test(e))return{valid:!1,error:"Name contains forbidden characters"};if(e.endsWith(" ")||e.endsWith("."))return{valid:!1,error:"Name cannot end with space or dot"}}return{valid:!0}}async function f(e,t){if(!(0,a.j)(t,e))return I("INVALID_PATH");let r=(0,E.join)(e,t);if(!(0,n.existsSync)(r))return I("FILE_NOT_FOUND");try{let e=await (0,i.readFile)(r,"utf-8");return{success:!0,path:t,content:e}}catch(e){if("EACCES"===e.code)return I("PERMISSION_DENIED");return I("INTERNAL_ERROR")}}async function N(e,t,r){if(!(0,a.j)(t,e))return I("INVALID_PATH");let o=(0,E.join)(e,t);if(!(0,n.existsSync)(o))return I("FILE_NOT_FOUND");try{return await (0,i.writeFile)(o,r,"utf-8"),{success:!0,path:t}}catch(e){if("EACCES"===e.code)return I("PERMISSION_DENIED");if("ENOSPC"===e.code)return I("DISK_FULL");return I("INTERNAL_ERROR")}}async function D(e,t,r,o){if(!(0,a.j)(t,e))return I("INVALID_PATH");let s=(0,E.join)(e,t);if((0,n.existsSync)(s))return I("FILE_EXISTS");try{if("directory"===r)await (0,i.mkdir)(s,{recursive:!0});else{let e=(0,E.dirname)(s);(0,n.existsSync)(e)||await (0,i.mkdir)(e,{recursive:!0}),await (0,i.writeFile)(s,o||"","utf-8")}return{success:!0,path:t}}catch(e){if("EACCES"===e.code)return I("PERMISSION_DENIED");if("ENOSPC"===e.code)return I("DISK_FULL");return I("INTERNAL_ERROR")}}async function R(e,t=0){if(t>s.MAX_RECURSIVE_DELETE_DEPTH)return s.MAX_RECURSIVE_DELETE_FILES+1;let r=0;try{for(let n of(await (0,i.readdir)(e,{withFileTypes:!0})))if(++r>s.MAX_RECURSIVE_DELETE_FILES||n.isDirectory()&&(r+=await R((0,E.join)(e,n.name),t+1))>s.MAX_RECURSIVE_DELETE_FILES)break}catch{}return r}async function T(e,t,o){if(!(0,a.j)(t,e))return I("INVALID_PATH");if(function(e){if(!e)return!1;let t=e.endsWith("/")?e.slice(0,-1):e;for(let e of s.PROTECTED_DIRECTORIES)if(t===e||t.startsWith(`${e}/`))return!0;return!1}(t))return I("PROTECTED_DIRECTORY");let c=(0,E.join)(e,t);if(!(0,n.existsSync)(c))return I("FILE_NOT_FOUND");try{let e=await (0,i.stat)(c);if(e.isDirectory()){if((await (0,i.readdir)(c)).length>0&&!o)return I("DIRECTORY_NOT_EMPTY");if(o){let e=await R(c);if(e>s.MAX_RECURSIVE_DELETE_FILES)return I("DELETE_LIMIT_EXCEEDED",`Delete limit exceeded: ${e} files (max: ${s.MAX_RECURSIVE_DELETE_FILES})`)}}if(e.isDirectory()&&!o){let{rmdir:e}=await Promise.resolve().then(r.t.bind(r,20629,23));await e(c)}else await (0,i.rm)(c,{recursive:o||!1,force:!1});return{success:!0,path:t}}catch(e){if("EACCES"===e.code)return I("PERMISSION_DENIED");if("ENOTEMPTY"===e.code)return I("DIRECTORY_NOT_EMPTY");return I("INTERNAL_ERROR")}}async function S(e,t,r){if(!(0,a.j)(t,e))return I("INVALID_PATH");let o=_(r);if(!o.valid)return I("INVALID_NAME",o.error);let s=(0,E.join)(e,t);if(!(0,n.existsSync)(s))return I("FILE_NOT_FOUND");let c=(0,E.dirname)(t),l="."===c?r:(0,E.join)(c,r),u=(0,E.join)(e,l);if(!(0,a.j)(l,e))return I("INVALID_PATH");if((0,n.existsSync)(u))return I("FILE_EXISTS");try{return await (0,i.rename)(s,u),{success:!0,path:l}}catch(e){if("EACCES"===e.code)return I("PERMISSION_DENIED");return I("INTERNAL_ERROR")}}async function L(e,t,r){if(!(0,a.j)(t,e))return I("INVALID_PATH");let o=(0,E.join)(e,t);if((0,n.existsSync)(o))return I("FILE_EXISTS");try{let e=(0,E.dirname)(o);return(0,n.existsSync)(e)||await (0,i.mkdir)(e,{recursive:!0}),await (0,i.writeFile)(o,r),{success:!0,path:t,size:r.length}}catch(e){if("EACCES"===e.code)return I("PERMISSION_DENIED");if("ENOSPC"===e.code)return I("DISK_FULL");return I("INTERNAL_ERROR")}}},57440:(e,t,r)=>{r.d(t,{j:()=>E});var i=r(55315),n=r.n(i);function E(e,t){if(!e||""===e.trim()||e.includes("\0"))return!1;let r=e;try{r=decodeURIComponent(e)}catch{r=e}if(r.includes("\0"))return!1;let i=n().resolve(t),E=n().resolve(t,r),a=n().relative(i,E);return!(a.startsWith("..")||n().isAbsolute(a))}}};
|