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,285 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Prompt detection for Claude CLI interactive prompts
|
|
4
|
+
* Detects yes/no confirmations and other interactive prompts
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.detectPrompt = detectPrompt;
|
|
8
|
+
exports.getAnswerInput = getAnswerInput;
|
|
9
|
+
const logger_1 = require("./logger");
|
|
10
|
+
const logger = (0, logger_1.createLogger)('prompt-detector');
|
|
11
|
+
/**
|
|
12
|
+
* Detect if output contains an interactive prompt
|
|
13
|
+
*
|
|
14
|
+
* Supports the following patterns:
|
|
15
|
+
* - (y/n)
|
|
16
|
+
* - [y/N] (N is default)
|
|
17
|
+
* - [Y/n] (Y is default)
|
|
18
|
+
* - (yes/no)
|
|
19
|
+
* - Approve?
|
|
20
|
+
* - Multiple choice (numbered list with ❯ indicator)
|
|
21
|
+
*
|
|
22
|
+
* @param output - The tmux output to analyze
|
|
23
|
+
* @returns Detection result
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const result = detectPrompt('Do you want to proceed? (y/n)');
|
|
28
|
+
* // result.isPrompt === true
|
|
29
|
+
* // result.promptData.question === 'Do you want to proceed?'
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function detectPrompt(output) {
|
|
33
|
+
logger.debug('detectPrompt:start', { outputLength: output.length });
|
|
34
|
+
const lines = output.split('\n');
|
|
35
|
+
const lastLines = lines.slice(-10).join('\n');
|
|
36
|
+
// Pattern 0: Multiple choice (numbered options with ❯ indicator)
|
|
37
|
+
// Example:
|
|
38
|
+
// Do you want to proceed?
|
|
39
|
+
// ❯ 1. Yes
|
|
40
|
+
// 2. No
|
|
41
|
+
// 3. Cancel
|
|
42
|
+
const multipleChoiceResult = detectMultipleChoicePrompt(output);
|
|
43
|
+
if (multipleChoiceResult.isPrompt) {
|
|
44
|
+
logger.info('detectPrompt:multipleChoice', {
|
|
45
|
+
isPrompt: true,
|
|
46
|
+
question: multipleChoiceResult.promptData?.question,
|
|
47
|
+
optionsCount: multipleChoiceResult.promptData?.options?.length,
|
|
48
|
+
});
|
|
49
|
+
return multipleChoiceResult;
|
|
50
|
+
}
|
|
51
|
+
// Pattern 1: (y/n)
|
|
52
|
+
const yesNoPattern = /^(.+)\s+\(y\/n\)\s*$/m;
|
|
53
|
+
const match1 = lastLines.match(yesNoPattern);
|
|
54
|
+
if (match1) {
|
|
55
|
+
return {
|
|
56
|
+
isPrompt: true,
|
|
57
|
+
promptData: {
|
|
58
|
+
type: 'yes_no',
|
|
59
|
+
question: match1[1].trim(),
|
|
60
|
+
options: ['yes', 'no'],
|
|
61
|
+
status: 'pending',
|
|
62
|
+
},
|
|
63
|
+
cleanContent: match1[1].trim(),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// Pattern 2: [y/N] (N is default)
|
|
67
|
+
const yesNoDefaultPattern = /^(.+)\s+\[y\/N\]\s*$/m;
|
|
68
|
+
const match2 = lastLines.match(yesNoDefaultPattern);
|
|
69
|
+
if (match2) {
|
|
70
|
+
return {
|
|
71
|
+
isPrompt: true,
|
|
72
|
+
promptData: {
|
|
73
|
+
type: 'yes_no',
|
|
74
|
+
question: match2[1].trim(),
|
|
75
|
+
options: ['yes', 'no'],
|
|
76
|
+
status: 'pending',
|
|
77
|
+
defaultOption: 'no',
|
|
78
|
+
},
|
|
79
|
+
cleanContent: match2[1].trim(),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
// Pattern 3: [Y/n] (Y is default)
|
|
83
|
+
const yesDefaultPattern = /^(.+)\s+\[Y\/n\]\s*$/m;
|
|
84
|
+
const match3 = lastLines.match(yesDefaultPattern);
|
|
85
|
+
if (match3) {
|
|
86
|
+
return {
|
|
87
|
+
isPrompt: true,
|
|
88
|
+
promptData: {
|
|
89
|
+
type: 'yes_no',
|
|
90
|
+
question: match3[1].trim(),
|
|
91
|
+
options: ['yes', 'no'],
|
|
92
|
+
status: 'pending',
|
|
93
|
+
defaultOption: 'yes',
|
|
94
|
+
},
|
|
95
|
+
cleanContent: match3[1].trim(),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
// Pattern 4: (yes/no)
|
|
99
|
+
const yesNoFullPattern = /^(.+)\s+\(yes\/no\)\s*$/m;
|
|
100
|
+
const match4 = lastLines.match(yesNoFullPattern);
|
|
101
|
+
if (match4) {
|
|
102
|
+
return {
|
|
103
|
+
isPrompt: true,
|
|
104
|
+
promptData: {
|
|
105
|
+
type: 'yes_no',
|
|
106
|
+
question: match4[1].trim(),
|
|
107
|
+
options: ['yes', 'no'],
|
|
108
|
+
status: 'pending',
|
|
109
|
+
},
|
|
110
|
+
cleanContent: match4[1].trim(),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
// Pattern 5: Approve?
|
|
114
|
+
// Matches "Approve?" on its own line or at the end of a line
|
|
115
|
+
const approvePattern = /^(.*?)Approve\?\s*$/m;
|
|
116
|
+
const match5 = lastLines.match(approvePattern);
|
|
117
|
+
if (match5) {
|
|
118
|
+
const content = match5[1].trim();
|
|
119
|
+
// If there's content before "Approve?", include it in the question
|
|
120
|
+
const question = content ? `${content} Approve?` : 'Approve?';
|
|
121
|
+
return {
|
|
122
|
+
isPrompt: true,
|
|
123
|
+
promptData: {
|
|
124
|
+
type: 'yes_no',
|
|
125
|
+
question: question,
|
|
126
|
+
options: ['yes', 'no'],
|
|
127
|
+
status: 'pending',
|
|
128
|
+
},
|
|
129
|
+
cleanContent: content || 'Approve?',
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
// No prompt detected
|
|
133
|
+
logger.debug('detectPrompt:complete', { isPrompt: false });
|
|
134
|
+
return {
|
|
135
|
+
isPrompt: false,
|
|
136
|
+
cleanContent: output.trim(),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Text input patterns for multiple choice options
|
|
141
|
+
* Options matching these patterns require additional text input from the user
|
|
142
|
+
*/
|
|
143
|
+
const TEXT_INPUT_PATTERNS = [
|
|
144
|
+
/type\s+here/i,
|
|
145
|
+
/tell\s+(me|claude)/i,
|
|
146
|
+
/enter\s+/i,
|
|
147
|
+
/custom/i,
|
|
148
|
+
/differently/i,
|
|
149
|
+
];
|
|
150
|
+
/**
|
|
151
|
+
* Detect multiple choice prompts (numbered list with ❯ indicator)
|
|
152
|
+
*
|
|
153
|
+
* This function scans the output from bottom to top looking for numbered options
|
|
154
|
+
* with a selection indicator (❯). It requires at least 2 options and a default
|
|
155
|
+
* indicator to be considered a valid prompt.
|
|
156
|
+
*
|
|
157
|
+
* Example:
|
|
158
|
+
* Do you want to proceed?
|
|
159
|
+
* ❯ 1. Yes
|
|
160
|
+
* 2. No
|
|
161
|
+
* 3. Cancel
|
|
162
|
+
*
|
|
163
|
+
* @param output - The tmux output to analyze (typically captured from tmux pane)
|
|
164
|
+
* @returns Detection result with prompt data if a valid multiple choice prompt is found
|
|
165
|
+
*/
|
|
166
|
+
function detectMultipleChoicePrompt(output) {
|
|
167
|
+
const lines = output.split('\n');
|
|
168
|
+
// Look for lines that match the pattern: [optional leading spaces] [❯ or spaces] [number]. [text]
|
|
169
|
+
// Note: ANSI codes sometimes cause spaces to be lost after stripping, so we use \s* instead of \s+
|
|
170
|
+
const optionPattern = /^\s*([❯ ]\s*)?(\d+)\.\s*(.+)$/;
|
|
171
|
+
const options = [];
|
|
172
|
+
let questionEndIndex = -1;
|
|
173
|
+
let firstOptionIndex = -1;
|
|
174
|
+
// Scan from the end to find options
|
|
175
|
+
// Increased from 20 to 50 to handle multi-line wrapped options
|
|
176
|
+
for (let i = lines.length - 1; i >= 0 && i >= lines.length - 50; i--) {
|
|
177
|
+
const line = lines[i].trim();
|
|
178
|
+
const rawLine = lines[i]; // Keep original indentation for checking
|
|
179
|
+
const match = line.match(optionPattern);
|
|
180
|
+
if (match) {
|
|
181
|
+
const hasDefault = Boolean(match[1] && match[1].includes('❯'));
|
|
182
|
+
const number = parseInt(match[2], 10);
|
|
183
|
+
const label = match[3].trim();
|
|
184
|
+
// Insert at beginning since we're scanning backwards
|
|
185
|
+
options.unshift({ number, label, isDefault: hasDefault });
|
|
186
|
+
if (firstOptionIndex === -1) {
|
|
187
|
+
firstOptionIndex = i;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
else if (options.length > 0 && line && !line.match(/^[-─]+$/)) {
|
|
191
|
+
// Check if this is a continuation line (indented line between options)
|
|
192
|
+
// Continuation lines typically start with spaces (like " work/github...")
|
|
193
|
+
// Also treat very short lines (< 5 chars) as potential word-wrap fragments
|
|
194
|
+
const hasLeadingSpaces = rawLine.match(/^\s{2,}[^\d]/) && !rawLine.match(/^\s*\d+\./);
|
|
195
|
+
const isShortFragment = line.length < 5 && !line.endsWith('?');
|
|
196
|
+
const isContinuationLine = hasLeadingSpaces || isShortFragment;
|
|
197
|
+
if (isContinuationLine) {
|
|
198
|
+
// Skip continuation lines and continue scanning for more options
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
// Found a non-empty, non-separator line before options - likely the question
|
|
202
|
+
questionEndIndex = i;
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// Must have at least 2 options AND at least one with ❯ indicator to be considered a prompt
|
|
207
|
+
const hasDefaultIndicator = options.some(opt => opt.isDefault);
|
|
208
|
+
if (options.length < 2 || !hasDefaultIndicator) {
|
|
209
|
+
return {
|
|
210
|
+
isPrompt: false,
|
|
211
|
+
cleanContent: output.trim(),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
// Extract question text
|
|
215
|
+
let question = '';
|
|
216
|
+
if (questionEndIndex >= 0) {
|
|
217
|
+
// Get all non-empty lines from questionEndIndex up to (but not including) first option
|
|
218
|
+
const questionLines = [];
|
|
219
|
+
for (let i = Math.max(0, questionEndIndex - 5); i <= questionEndIndex; i++) {
|
|
220
|
+
const line = lines[i].trim();
|
|
221
|
+
if (line && !line.match(/^[-─]+$/)) {
|
|
222
|
+
questionLines.push(line);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
question = questionLines.join(' ');
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
// No clear question found - use a generic one
|
|
229
|
+
question = 'Please select an option:';
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
isPrompt: true,
|
|
233
|
+
promptData: {
|
|
234
|
+
type: 'multiple_choice',
|
|
235
|
+
question: question.trim(),
|
|
236
|
+
options: options.map(opt => {
|
|
237
|
+
// Check if this option requires text input using module-level patterns
|
|
238
|
+
const requiresTextInput = TEXT_INPUT_PATTERNS.some(pattern => pattern.test(opt.label));
|
|
239
|
+
return {
|
|
240
|
+
number: opt.number,
|
|
241
|
+
label: opt.label,
|
|
242
|
+
isDefault: opt.isDefault,
|
|
243
|
+
requiresTextInput,
|
|
244
|
+
};
|
|
245
|
+
}),
|
|
246
|
+
status: 'pending',
|
|
247
|
+
},
|
|
248
|
+
cleanContent: question.trim(),
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Get tmux input string for an answer
|
|
253
|
+
*
|
|
254
|
+
* @param answer - User's answer ('yes', 'no', 'y', 'n', or number for multiple choice)
|
|
255
|
+
* @param promptType - Type of prompt (defaults to 'yes_no')
|
|
256
|
+
* @returns tmux input string ('y', 'n', or the number as string)
|
|
257
|
+
* @throws Error if answer is invalid
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* getAnswerInput('yes'); // => 'y'
|
|
262
|
+
* getAnswerInput('no'); // => 'n'
|
|
263
|
+
* getAnswerInput('Y'); // => 'y'
|
|
264
|
+
* getAnswerInput('1', 'multiple_choice'); // => '1'
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
function getAnswerInput(answer, promptType = 'yes_no') {
|
|
268
|
+
const normalized = answer.toLowerCase().trim();
|
|
269
|
+
// Handle multiple choice - just return the number
|
|
270
|
+
if (promptType === 'multiple_choice') {
|
|
271
|
+
// Validate it's a number
|
|
272
|
+
if (/^\d+$/.test(normalized)) {
|
|
273
|
+
return normalized;
|
|
274
|
+
}
|
|
275
|
+
throw new Error(`Invalid answer for multiple choice: ${answer}. Expected a number.`);
|
|
276
|
+
}
|
|
277
|
+
// Handle yes/no prompts
|
|
278
|
+
if (normalized === 'yes' || normalized === 'y') {
|
|
279
|
+
return 'y';
|
|
280
|
+
}
|
|
281
|
+
if (normalized === 'no' || normalized === 'n') {
|
|
282
|
+
return 'n';
|
|
283
|
+
}
|
|
284
|
+
throw new Error(`Invalid answer: ${answer}. Expected 'yes', 'no', 'y', or 'n'.`);
|
|
285
|
+
}
|