claude-mux 0.7.0
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/.beads/README.md +81 -0
- package/.beads/config.yaml +62 -0
- package/.beads/interactions.jsonl +0 -0
- package/.beads/issues.jsonl +5 -0
- package/.beads/metadata.json +4 -0
- package/.eslintrc.json +25 -0
- package/.gitattributes +3 -0
- package/.prettierrc +7 -0
- package/CLAUDE.md +123 -0
- package/LICENSE +21 -0
- package/PLAN-beads-integration.md +250 -0
- package/README.md +366 -0
- package/dist/app.d.ts +2 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +147 -0
- package/dist/app.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +65 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +5 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/serve.d.ts +8 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +59 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/setup.d.ts +4 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +12 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/tui.d.ts +9 -0
- package/dist/commands/tui.d.ts.map +1 -0
- package/dist/commands/tui.js +234 -0
- package/dist/commands/tui.js.map +1 -0
- package/dist/commands/uninstall.d.ts +4 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +12 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/components/Header.d.ts +7 -0
- package/dist/components/Header.d.ts.map +1 -0
- package/dist/components/Header.js +14 -0
- package/dist/components/Header.js.map +1 -0
- package/dist/components/HelpDialog.d.ts +6 -0
- package/dist/components/HelpDialog.d.ts.map +1 -0
- package/dist/components/HelpDialog.js +14 -0
- package/dist/components/HelpDialog.js.map +1 -0
- package/dist/components/SessionEntry.d.ts +17 -0
- package/dist/components/SessionEntry.d.ts.map +1 -0
- package/dist/components/SessionEntry.js +102 -0
- package/dist/components/SessionEntry.js.map +1 -0
- package/dist/components/SessionList.d.ts +14 -0
- package/dist/components/SessionList.d.ts.map +1 -0
- package/dist/components/SessionList.js +57 -0
- package/dist/components/SessionList.js.map +1 -0
- package/dist/components/StatusBar.d.ts +6 -0
- package/dist/components/StatusBar.d.ts.map +1 -0
- package/dist/components/StatusBar.js +7 -0
- package/dist/components/StatusBar.js.map +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +6 -0
- package/dist/components/index.js.map +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +3 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema.d.ts +4 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +23 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/db/sessions-json.d.ts +85 -0
- package/dist/db/sessions-json.d.ts.map +1 -0
- package/dist/db/sessions-json.js +242 -0
- package/dist/db/sessions-json.js.map +1 -0
- package/dist/db/sessions.d.ts +38 -0
- package/dist/db/sessions.d.ts.map +1 -0
- package/dist/db/sessions.js +87 -0
- package/dist/db/sessions.js.map +1 -0
- package/dist/hooks/claude-mux-hook.d.ts +15 -0
- package/dist/hooks/claude-mux-hook.d.ts.map +1 -0
- package/dist/hooks/claude-mux-hook.js +396 -0
- package/dist/hooks/claude-mux-hook.js.map +1 -0
- package/dist/hooks/claude-watch-hook.d.ts +15 -0
- package/dist/hooks/claude-watch-hook.d.ts.map +1 -0
- package/dist/hooks/claude-watch-hook.js +396 -0
- package/dist/hooks/claude-watch-hook.js.map +1 -0
- package/dist/server/custom-server.d.ts +13 -0
- package/dist/server/custom-server.d.ts.map +1 -0
- package/dist/server/custom-server.js +63 -0
- package/dist/server/custom-server.js.map +1 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +1143 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/middleware/cors.d.ts +2 -0
- package/dist/server/middleware/cors.d.ts.map +1 -0
- package/dist/server/middleware/cors.js +11 -0
- package/dist/server/middleware/cors.js.map +1 -0
- package/dist/server/routes/sessions.d.ts +3 -0
- package/dist/server/routes/sessions.d.ts.map +1 -0
- package/dist/server/routes/sessions.js +78 -0
- package/dist/server/routes/sessions.js.map +1 -0
- package/dist/server/routes/stream.d.ts +3 -0
- package/dist/server/routes/stream.d.ts.map +1 -0
- package/dist/server/routes/stream.js +45 -0
- package/dist/server/routes/stream.js.map +1 -0
- package/dist/server/types.d.ts +28 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/types.js +2 -0
- package/dist/server/types.js.map +1 -0
- package/dist/server/watcher.d.ts +22 -0
- package/dist/server/watcher.d.ts.map +1 -0
- package/dist/server/watcher.js +119 -0
- package/dist/server/watcher.js.map +1 -0
- package/dist/server/websocket.d.ts +51 -0
- package/dist/server/websocket.d.ts.map +1 -0
- package/dist/server/websocket.js +156 -0
- package/dist/server/websocket.js.map +1 -0
- package/dist/server/ws-handlers.d.ts +174 -0
- package/dist/server/ws-handlers.d.ts.map +1 -0
- package/dist/server/ws-handlers.js +695 -0
- package/dist/server/ws-handlers.js.map +1 -0
- package/dist/setup/hooks.d.ts +44 -0
- package/dist/setup/hooks.d.ts.map +1 -0
- package/dist/setup/hooks.js +267 -0
- package/dist/setup/hooks.js.map +1 -0
- package/dist/setup/index.d.ts +3 -0
- package/dist/setup/index.d.ts.map +1 -0
- package/dist/setup/index.js +3 -0
- package/dist/setup/index.js.map +1 -0
- package/dist/setup/wizard.d.ts +4 -0
- package/dist/setup/wizard.d.ts.map +1 -0
- package/dist/setup/wizard.js +72 -0
- package/dist/setup/wizard.js.map +1 -0
- package/dist/tmux/detect.d.ts +25 -0
- package/dist/tmux/detect.d.ts.map +1 -0
- package/dist/tmux/detect.js +71 -0
- package/dist/tmux/detect.js.map +1 -0
- package/dist/tmux/navigate.d.ts +13 -0
- package/dist/tmux/navigate.d.ts.map +1 -0
- package/dist/tmux/navigate.js +41 -0
- package/dist/tmux/navigate.js.map +1 -0
- package/dist/tmux/pane.d.ts +57 -0
- package/dist/tmux/pane.d.ts.map +1 -0
- package/dist/tmux/pane.js +156 -0
- package/dist/tmux/pane.js.map +1 -0
- package/dist/tmux/resize.d.ts +10 -0
- package/dist/tmux/resize.d.ts.map +1 -0
- package/dist/tmux/resize.js +25 -0
- package/dist/tmux/resize.js.map +1 -0
- package/dist/utils/paths.d.ts +7 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +9 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/pid.d.ts +5 -0
- package/dist/utils/pid.d.ts.map +1 -0
- package/dist/utils/pid.js +14 -0
- package/dist/utils/pid.js.map +1 -0
- package/dist/utils/version.d.ts +6 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +6 -0
- package/dist/utils/version.js.map +1 -0
- package/dist/web/client/_app/immutable/assets/0.WptSHSUl.css +1 -0
- package/dist/web/client/_app/immutable/assets/2.s6Kx4oz1.css +1 -0
- package/dist/web/client/_app/immutable/assets/4.DoNWy7tW.css +1 -0
- package/dist/web/client/_app/immutable/assets/AllSessionsPanel.CGHY3HLy.css +1 -0
- package/dist/web/client/_app/immutable/chunks/-3mUPuLP.js +1 -0
- package/dist/web/client/_app/immutable/chunks/B5U4_V3d.js +1 -0
- package/dist/web/client/_app/immutable/chunks/BHwiZXRv.js +1 -0
- package/dist/web/client/_app/immutable/chunks/C9P-coqM.js +1 -0
- package/dist/web/client/_app/immutable/chunks/Cegv0r8x.js +1 -0
- package/dist/web/client/_app/immutable/chunks/DU91Ml7U.js +3 -0
- package/dist/web/client/_app/immutable/chunks/DmdO6ygw.js +1 -0
- package/dist/web/client/_app/immutable/chunks/HKNo9LID.js +5 -0
- package/dist/web/client/_app/immutable/chunks/U4ip-C0d.js +2 -0
- package/dist/web/client/_app/immutable/chunks/cgUjKIhX.js +2 -0
- package/dist/web/client/_app/immutable/entry/app.CGIBnoln.js +2 -0
- package/dist/web/client/_app/immutable/entry/start.CJk8zB1j.js +1 -0
- package/dist/web/client/_app/immutable/nodes/0.CqlJ9a31.js +1 -0
- package/dist/web/client/_app/immutable/nodes/1.BQUZh2-w.js +1 -0
- package/dist/web/client/_app/immutable/nodes/2.CCV1YdgF.js +1 -0
- package/dist/web/client/_app/immutable/nodes/3.D9tDCdq8.js +1 -0
- package/dist/web/client/_app/immutable/nodes/4.BqPyNkFA.js +6 -0
- package/dist/web/client/_app/version.json +1 -0
- package/dist/web/client/robots.txt +3 -0
- package/dist/web/env.js +32 -0
- package/dist/web/handler.js +744 -0
- package/dist/web/index.js +49 -0
- package/dist/web/server/chunks/0-BHWsmCJv.js +23 -0
- package/dist/web/server/chunks/0-BHWsmCJv.js.map +1 -0
- package/dist/web/server/chunks/1-YRx6A8Tm.js +17 -0
- package/dist/web/server/chunks/1-YRx6A8Tm.js.map +1 -0
- package/dist/web/server/chunks/2-eC6JuGAo.js +22 -0
- package/dist/web/server/chunks/2-eC6JuGAo.js.map +1 -0
- package/dist/web/server/chunks/3-Bk-wV20p.js +32 -0
- package/dist/web/server/chunks/3-Bk-wV20p.js.map +1 -0
- package/dist/web/server/chunks/4-nteBgDrW.js +21 -0
- package/dist/web/server/chunks/4-nteBgDrW.js.map +1 -0
- package/dist/web/server/chunks/AllSessionsPanel.svelte_svelte_type_style_lang-Bt4B0-oi.js +35 -0
- package/dist/web/server/chunks/AllSessionsPanel.svelte_svelte_type_style_lang-Bt4B0-oi.js.map +1 -0
- package/dist/web/server/chunks/_layout.svelte-BIF9eZCY.js +453 -0
- package/dist/web/server/chunks/_layout.svelte-BIF9eZCY.js.map +1 -0
- package/dist/web/server/chunks/_page.svelte-Be6iabRn.js +34 -0
- package/dist/web/server/chunks/_page.svelte-Be6iabRn.js.map +1 -0
- package/dist/web/server/chunks/_page.svelte-C_fGJVSE.js +576 -0
- package/dist/web/server/chunks/_page.svelte-C_fGJVSE.js.map +1 -0
- package/dist/web/server/chunks/_page.svelte-CnfJk6cu.js +2722 -0
- package/dist/web/server/chunks/_page.svelte-CnfJk6cu.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-3WAmKvn2.js +34 -0
- package/dist/web/server/chunks/_server.ts-3WAmKvn2.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-BAWJCSFb.js +29 -0
- package/dist/web/server/chunks/_server.ts-BAWJCSFb.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-BPpMOZCm.js +24 -0
- package/dist/web/server/chunks/_server.ts-BPpMOZCm.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-BUKgRb6U.js +13 -0
- package/dist/web/server/chunks/_server.ts-BUKgRb6U.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-BVHUS8fm.js +41 -0
- package/dist/web/server/chunks/_server.ts-BVHUS8fm.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-BrF3od0O.js +45 -0
- package/dist/web/server/chunks/_server.ts-BrF3od0O.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-C4oPmOJR.js +38 -0
- package/dist/web/server/chunks/_server.ts-C4oPmOJR.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-CDAUUmG_.js +21 -0
- package/dist/web/server/chunks/_server.ts-CDAUUmG_.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-CR0uWvpz.js +24 -0
- package/dist/web/server/chunks/_server.ts-CR0uWvpz.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-CSqdCNGi.js +21 -0
- package/dist/web/server/chunks/_server.ts-CSqdCNGi.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-DI9fzUo9.js +52 -0
- package/dist/web/server/chunks/_server.ts-DI9fzUo9.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-DNjJTClI.js +46 -0
- package/dist/web/server/chunks/_server.ts-DNjJTClI.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-DdbOAkOj.js +22 -0
- package/dist/web/server/chunks/_server.ts-DdbOAkOj.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-Df2isGQc.js +41 -0
- package/dist/web/server/chunks/_server.ts-Df2isGQc.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-Vpw25_-3.js +12 -0
- package/dist/web/server/chunks/_server.ts-Vpw25_-3.js.map +1 -0
- package/dist/web/server/chunks/_server.ts-WldRpSRi.js +26 -0
- package/dist/web/server/chunks/_server.ts-WldRpSRi.js.map +1 -0
- package/dist/web/server/chunks/alert-dialog-description-DDA6u-nS.js +2890 -0
- package/dist/web/server/chunks/alert-dialog-description-DDA6u-nS.js.map +1 -0
- package/dist/web/server/chunks/auth-DrUf-v4J.js +51 -0
- package/dist/web/server/chunks/auth-DrUf-v4J.js.map +1 -0
- package/dist/web/server/chunks/button-D6xS9rHt.js +2335 -0
- package/dist/web/server/chunks/button-D6xS9rHt.js.map +1 -0
- package/dist/web/server/chunks/chunk-EKzHsMy_.js +42 -0
- package/dist/web/server/chunks/chunks-DmdqVYC7.js +58 -0
- package/dist/web/server/chunks/chunks-DmdqVYC7.js.map +1 -0
- package/dist/web/server/chunks/client-CUrSQijh.js +18 -0
- package/dist/web/server/chunks/client-CUrSQijh.js.map +1 -0
- package/dist/web/server/chunks/clsx-FzI4_gi0.js +332 -0
- package/dist/web/server/chunks/clsx-FzI4_gi0.js.map +1 -0
- package/dist/web/server/chunks/error.svelte-D-c-9pTE.js +27 -0
- package/dist/web/server/chunks/error.svelte-D-c-9pTE.js.map +1 -0
- package/dist/web/server/chunks/events-BDBlYddw.js +89 -0
- package/dist/web/server/chunks/events-BDBlYddw.js.map +1 -0
- package/dist/web/server/chunks/exports-CCurQ-Tl.js +131 -0
- package/dist/web/server/chunks/exports-CCurQ-Tl.js.map +1 -0
- package/dist/web/server/chunks/hooks.server-BK1bopsh.js +86 -0
- package/dist/web/server/chunks/hooks.server-BK1bopsh.js.map +1 -0
- package/dist/web/server/chunks/index2-BQnysSj-.js +2588 -0
- package/dist/web/server/chunks/index2-BQnysSj-.js.map +1 -0
- package/dist/web/server/chunks/internal-DLENj6YI.js +61 -0
- package/dist/web/server/chunks/internal-DLENj6YI.js.map +1 -0
- package/dist/web/server/chunks/pane-Dg3pKvsm.js +94 -0
- package/dist/web/server/chunks/pane-Dg3pKvsm.js.map +1 -0
- package/dist/web/server/chunks/sessions-json-DgfkCLO7.js +107 -0
- package/dist/web/server/chunks/sessions-json-DgfkCLO7.js.map +1 -0
- package/dist/web/server/chunks/sessions.svelte-Ds82MvkB.js +178 -0
- package/dist/web/server/chunks/sessions.svelte-Ds82MvkB.js.map +1 -0
- package/dist/web/server/chunks/state.svelte-xeAZvWZ6.js +7 -0
- package/dist/web/server/chunks/state.svelte-xeAZvWZ6.js.map +1 -0
- package/dist/web/server/chunks/ws-handlers-B4r5eSP2.js +733 -0
- package/dist/web/server/chunks/ws-handlers-B4r5eSP2.js.map +1 -0
- package/dist/web/server/index.js +4907 -0
- package/dist/web/server/index.js.map +1 -0
- package/dist/web/server/manifest.js +233 -0
- package/dist/web/server/manifest.js.map +1 -0
- package/docs/images/desktop-dashboard.png +0 -0
- package/docs/images/desktop-session.png +0 -0
- package/docs/images/mobile-dashboard.png +0 -0
- package/docs/images/mobile-session.png +0 -0
- package/docs/release-checklist.md +228 -0
- package/docs/removing-hooks.md +135 -0
- package/docs/state-transitions.md +109 -0
- package/package.json +71 -0
- package/src/app.tsx +188 -0
- package/src/cli.ts +83 -0
- package/src/commands/index.ts +4 -0
- package/src/commands/serve.ts +75 -0
- package/src/commands/setup.ts +13 -0
- package/src/commands/tui.ts +255 -0
- package/src/commands/uninstall.ts +13 -0
- package/src/components/Header.tsx +32 -0
- package/src/components/HelpDialog.tsx +45 -0
- package/src/components/SessionEntry.tsx +202 -0
- package/src/components/SessionList.tsx +98 -0
- package/src/components/StatusBar.tsx +26 -0
- package/src/components/index.ts +5 -0
- package/src/db/index.ts +20 -0
- package/src/db/sessions-json.ts +314 -0
- package/src/hooks/claude-mux-hook.ts +498 -0
- package/src/server/watcher.ts +128 -0
- package/src/server/ws-handlers.ts +922 -0
- package/src/setup/hooks.ts +333 -0
- package/src/setup/index.ts +2 -0
- package/src/setup/wizard.ts +81 -0
- package/src/tmux/detect.ts +87 -0
- package/src/tmux/navigate.ts +42 -0
- package/src/tmux/pane.ts +167 -0
- package/src/tmux/resize.ts +28 -0
- package/src/utils/paths.ts +11 -0
- package/src/utils/pid.ts +12 -0
- package/src/utils/version.ts +5 -0
- package/tests/components/Header.test.tsx +42 -0
- package/tests/components/SessionEntry-extended.test.tsx +165 -0
- package/tests/components/SessionEntry.test.tsx +138 -0
- package/tests/components/SessionList.test.tsx +110 -0
- package/tests/components/StatusBar.test.tsx +31 -0
- package/tests/db/index.test.ts +78 -0
- package/tests/db/sessions.test.ts +230 -0
- package/tests/server/integration.test.ts +319 -0
- package/tests/server/sessions.test.ts +114 -0
- package/tests/setup/hooks-integration.test.ts +148 -0
- package/tests/setup/hooks.test.ts +123 -0
- package/tests/tmux/detect.test.ts +54 -0
- package/tests/tmux/navigate.test.ts +30 -0
- package/tests/utils/pid.test.ts +17 -0
- package/tsconfig.cli.json +9 -0
- package/tsconfig.json +22 -0
- package/vitest.config.ts +29 -0
- package/web/.svelte-kit/adapter-bun/.vite/manifest.json +408 -0
- package/web/.svelte-kit/adapter-bun/_app/immutable/assets/AllSessionsPanel.BKhqOrbV.css +1 -0
- package/web/.svelte-kit/adapter-bun/_app/immutable/assets/_layout.WptSHSUl.css +1 -0
- package/web/.svelte-kit/adapter-bun/_app/immutable/assets/_page.DldLgTc-.css +1 -0
- package/web/.svelte-kit/adapter-bun/_app/immutable/assets/_page.DoNWy7tW.css +1 -0
- package/web/.svelte-kit/adapter-bun/chunks/AllSessionsPanel.svelte_svelte_type_style_lang.js +49 -0
- package/web/.svelte-kit/adapter-bun/chunks/alert-dialog-description.js +2670 -0
- package/web/.svelte-kit/adapter-bun/chunks/auth.js +59 -0
- package/web/.svelte-kit/adapter-bun/chunks/button.js +82 -0
- package/web/.svelte-kit/adapter-bun/chunks/client.js +29 -0
- package/web/.svelte-kit/adapter-bun/chunks/context.js +133 -0
- package/web/.svelte-kit/adapter-bun/chunks/environment.js +34 -0
- package/web/.svelte-kit/adapter-bun/chunks/events.js +121 -0
- package/web/.svelte-kit/adapter-bun/chunks/exports.js +174 -0
- package/web/.svelte-kit/adapter-bun/chunks/false.js +4 -0
- package/web/.svelte-kit/adapter-bun/chunks/index.js +59 -0
- package/web/.svelte-kit/adapter-bun/chunks/index2.js +2828 -0
- package/web/.svelte-kit/adapter-bun/chunks/internal.js +920 -0
- package/web/.svelte-kit/adapter-bun/chunks/pane.js +82 -0
- package/web/.svelte-kit/adapter-bun/chunks/sessions-json.js +124 -0
- package/web/.svelte-kit/adapter-bun/chunks/sessions.svelte.js +229 -0
- package/web/.svelte-kit/adapter-bun/chunks/shared.js +542 -0
- package/web/.svelte-kit/adapter-bun/chunks/state.svelte.js +16 -0
- package/web/.svelte-kit/adapter-bun/chunks/utils.js +43 -0
- package/web/.svelte-kit/adapter-bun/chunks/ws-handlers.js +782 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/auth/login/_server.ts.js +22 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/auth/logout/_server.ts.js +9 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/beads/_server.ts.js +22 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/browse/_server.ts.js +50 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/chrome/_server.ts.js +30 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/files/image/_server.ts.js +53 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/health/_server.ts.js +7 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/projects/new-session/_server.ts.js +44 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/sessions/_id_/_server.ts.js +20 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/sessions/_id_/kill/_server.ts.js +36 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/sessions/_id_/restart/_server.ts.js +40 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/sessions/_id_/screenshots/_server.ts.js +28 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/sessions/_id_/send/_server.ts.js +29 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/sessions/_server.ts.js +49 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/sessions/_target_/output/_server.ts.js +14 -0
- package/web/.svelte-kit/adapter-bun/entries/endpoints/api/tmux/panes/_server.ts.js +21 -0
- package/web/.svelte-kit/adapter-bun/entries/fallbacks/error.svelte.js +27 -0
- package/web/.svelte-kit/adapter-bun/entries/hooks.server.js +105 -0
- package/web/.svelte-kit/adapter-bun/entries/pages/_layout.svelte.js +499 -0
- package/web/.svelte-kit/adapter-bun/entries/pages/_page.svelte.js +3057 -0
- package/web/.svelte-kit/adapter-bun/entries/pages/login/_page.server.ts.js +15 -0
- package/web/.svelte-kit/adapter-bun/entries/pages/login/_page.svelte.js +37 -0
- package/web/.svelte-kit/adapter-bun/entries/pages/session/_target_/_page.svelte.js +653 -0
- package/web/.svelte-kit/adapter-bun/index.js +3864 -0
- package/web/.svelte-kit/adapter-bun/internal.js +13 -0
- package/web/.svelte-kit/adapter-bun/manifest-full.js +167 -0
- package/web/.svelte-kit/adapter-bun/manifest.js +171 -0
- package/web/.svelte-kit/adapter-bun/nodes/0.js +8 -0
- package/web/.svelte-kit/adapter-bun/nodes/1.js +8 -0
- package/web/.svelte-kit/adapter-bun/nodes/2.js +8 -0
- package/web/.svelte-kit/adapter-bun/nodes/3.js +10 -0
- package/web/.svelte-kit/adapter-bun/nodes/4.js +8 -0
- package/web/.svelte-kit/adapter-bun/remote-entry.js +541 -0
- package/web/.svelte-kit/adapter-node/.vite/manifest.json +223 -0
- package/web/.svelte-kit/adapter-node/_app/immutable/assets/_layout.4NiX29PU.css +1 -0
- package/web/.svelte-kit/adapter-node/_app/immutable/assets/_page.BEMzYUGV.css +1 -0
- package/web/.svelte-kit/adapter-node/_app/immutable/assets/_page.DOJn7TG7.css +1 -0
- package/web/.svelte-kit/adapter-node/chunks/context.js +121 -0
- package/web/.svelte-kit/adapter-node/chunks/environment.js +34 -0
- package/web/.svelte-kit/adapter-node/chunks/exports.js +174 -0
- package/web/.svelte-kit/adapter-node/chunks/false.js +4 -0
- package/web/.svelte-kit/adapter-node/chunks/index.js +59 -0
- package/web/.svelte-kit/adapter-node/chunks/index2.js +2710 -0
- package/web/.svelte-kit/adapter-node/chunks/internal.js +1005 -0
- package/web/.svelte-kit/adapter-node/chunks/sessions-json.js +109 -0
- package/web/.svelte-kit/adapter-node/chunks/sessions.svelte.js +67 -0
- package/web/.svelte-kit/adapter-node/chunks/shared.js +542 -0
- package/web/.svelte-kit/adapter-node/chunks/state.svelte.js +16 -0
- package/web/.svelte-kit/adapter-node/chunks/utils.js +43 -0
- package/web/.svelte-kit/adapter-node/entries/endpoints/api/browse/_server.ts.js +50 -0
- package/web/.svelte-kit/adapter-node/entries/endpoints/api/health/_server.ts.js +7 -0
- package/web/.svelte-kit/adapter-node/entries/endpoints/api/projects/new-session/_server.ts.js +44 -0
- package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_id_/_server.ts.js +20 -0
- package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_id_/kill/_server.ts.js +30 -0
- package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_id_/send/_server.ts.js +22 -0
- package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_server.ts.js +126 -0
- package/web/.svelte-kit/adapter-node/entries/endpoints/api/sessions/_target_/output/_server.ts.js +14 -0
- package/web/.svelte-kit/adapter-node/entries/fallbacks/error.svelte.js +44 -0
- package/web/.svelte-kit/adapter-node/entries/pages/_layout.svelte.js +12 -0
- package/web/.svelte-kit/adapter-node/entries/pages/_page.svelte.js +87 -0
- package/web/.svelte-kit/adapter-node/entries/pages/session/_target_/_page.svelte.js +76 -0
- package/web/.svelte-kit/adapter-node/index.js +3864 -0
- package/web/.svelte-kit/adapter-node/internal.js +13 -0
- package/web/.svelte-kit/adapter-node/manifest-full.js +103 -0
- package/web/.svelte-kit/adapter-node/manifest.js +107 -0
- package/web/.svelte-kit/adapter-node/nodes/0.js +8 -0
- package/web/.svelte-kit/adapter-node/nodes/1.js +8 -0
- package/web/.svelte-kit/adapter-node/nodes/2.js +8 -0
- package/web/.svelte-kit/adapter-node/nodes/3.js +8 -0
- package/web/.svelte-kit/adapter-node/remote-entry.js +541 -0
- package/web/.svelte-kit/ambient.d.ts +187 -0
- package/web/.svelte-kit/generated/client/app.js +33 -0
- package/web/.svelte-kit/generated/client/matchers.js +1 -0
- package/web/.svelte-kit/generated/client/nodes/0.js +1 -0
- package/web/.svelte-kit/generated/client/nodes/1.js +1 -0
- package/web/.svelte-kit/generated/client/nodes/2.js +1 -0
- package/web/.svelte-kit/generated/client/nodes/3.js +1 -0
- package/web/.svelte-kit/generated/client/nodes/4.js +1 -0
- package/web/.svelte-kit/generated/client-optimized/app.js +33 -0
- package/web/.svelte-kit/generated/client-optimized/matchers.js +1 -0
- package/web/.svelte-kit/generated/client-optimized/nodes/0.js +1 -0
- package/web/.svelte-kit/generated/client-optimized/nodes/1.js +1 -0
- package/web/.svelte-kit/generated/client-optimized/nodes/2.js +1 -0
- package/web/.svelte-kit/generated/client-optimized/nodes/3.js +1 -0
- package/web/.svelte-kit/generated/client-optimized/nodes/4.js +1 -0
- package/web/.svelte-kit/generated/root.js +3 -0
- package/web/.svelte-kit/generated/root.svelte +68 -0
- package/web/.svelte-kit/generated/server/internal.js +53 -0
- package/web/.svelte-kit/non-ambient.d.ts +73 -0
- package/web/.svelte-kit/output/client/.vite/manifest.json +203 -0
- package/web/.svelte-kit/output/client/_app/immutable/assets/0.WptSHSUl.css +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/assets/2.s6Kx4oz1.css +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/assets/4.DoNWy7tW.css +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/assets/AllSessionsPanel.CGHY3HLy.css +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/-3mUPuLP.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/B5U4_V3d.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/BHwiZXRv.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/C9P-coqM.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/Cegv0r8x.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DU91Ml7U.js +3 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DmdO6ygw.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/HKNo9LID.js +5 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/U4ip-C0d.js +2 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/cgUjKIhX.js +2 -0
- package/web/.svelte-kit/output/client/_app/immutable/entry/app.CGIBnoln.js +2 -0
- package/web/.svelte-kit/output/client/_app/immutable/entry/start.CJk8zB1j.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/0.CqlJ9a31.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/1.BQUZh2-w.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/2.CCV1YdgF.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/3.D9tDCdq8.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/4.BqPyNkFA.js +6 -0
- package/web/.svelte-kit/output/client/_app/version.json +1 -0
- package/web/.svelte-kit/output/client/robots.txt +3 -0
- package/web/.svelte-kit/output/server/.vite/manifest.json +408 -0
- package/web/.svelte-kit/output/server/_app/immutable/assets/AllSessionsPanel.BKhqOrbV.css +1 -0
- package/web/.svelte-kit/output/server/_app/immutable/assets/_layout.WptSHSUl.css +1 -0
- package/web/.svelte-kit/output/server/_app/immutable/assets/_page.DldLgTc-.css +1 -0
- package/web/.svelte-kit/output/server/_app/immutable/assets/_page.DoNWy7tW.css +1 -0
- package/web/.svelte-kit/output/server/chunks/AllSessionsPanel.svelte_svelte_type_style_lang.js +49 -0
- package/web/.svelte-kit/output/server/chunks/alert-dialog-description.js +2670 -0
- package/web/.svelte-kit/output/server/chunks/auth.js +59 -0
- package/web/.svelte-kit/output/server/chunks/button.js +82 -0
- package/web/.svelte-kit/output/server/chunks/client.js +29 -0
- package/web/.svelte-kit/output/server/chunks/context.js +133 -0
- package/web/.svelte-kit/output/server/chunks/environment.js +34 -0
- package/web/.svelte-kit/output/server/chunks/events.js +121 -0
- package/web/.svelte-kit/output/server/chunks/exports.js +174 -0
- package/web/.svelte-kit/output/server/chunks/false.js +4 -0
- package/web/.svelte-kit/output/server/chunks/index.js +59 -0
- package/web/.svelte-kit/output/server/chunks/index2.js +2828 -0
- package/web/.svelte-kit/output/server/chunks/internal.js +920 -0
- package/web/.svelte-kit/output/server/chunks/pane.js +82 -0
- package/web/.svelte-kit/output/server/chunks/sessions-json.js +124 -0
- package/web/.svelte-kit/output/server/chunks/sessions.svelte.js +229 -0
- package/web/.svelte-kit/output/server/chunks/shared.js +542 -0
- package/web/.svelte-kit/output/server/chunks/state.svelte.js +16 -0
- package/web/.svelte-kit/output/server/chunks/utils.js +43 -0
- package/web/.svelte-kit/output/server/chunks/ws-handlers.js +782 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/auth/login/_server.ts.js +22 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/auth/logout/_server.ts.js +9 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/beads/_server.ts.js +22 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/browse/_server.ts.js +50 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/chrome/_server.ts.js +30 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/files/image/_server.ts.js +53 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/health/_server.ts.js +7 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/projects/new-session/_server.ts.js +44 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/sessions/_id_/_server.ts.js +20 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/sessions/_id_/kill/_server.ts.js +36 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/sessions/_id_/restart/_server.ts.js +40 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/sessions/_id_/screenshots/_server.ts.js +28 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/sessions/_id_/send/_server.ts.js +29 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/sessions/_server.ts.js +49 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/sessions/_target_/output/_server.ts.js +14 -0
- package/web/.svelte-kit/output/server/entries/endpoints/api/tmux/panes/_server.ts.js +21 -0
- package/web/.svelte-kit/output/server/entries/fallbacks/error.svelte.js +27 -0
- package/web/.svelte-kit/output/server/entries/hooks.server.js +105 -0
- package/web/.svelte-kit/output/server/entries/pages/_layout.svelte.js +499 -0
- package/web/.svelte-kit/output/server/entries/pages/_page.svelte.js +3057 -0
- package/web/.svelte-kit/output/server/entries/pages/login/_page.server.ts.js +15 -0
- package/web/.svelte-kit/output/server/entries/pages/login/_page.svelte.js +37 -0
- package/web/.svelte-kit/output/server/entries/pages/session/_target_/_page.svelte.js +653 -0
- package/web/.svelte-kit/output/server/index.js +3864 -0
- package/web/.svelte-kit/output/server/internal.js +13 -0
- package/web/.svelte-kit/output/server/manifest-full.js +167 -0
- package/web/.svelte-kit/output/server/manifest.js +167 -0
- package/web/.svelte-kit/output/server/nodes/0.js +8 -0
- package/web/.svelte-kit/output/server/nodes/1.js +8 -0
- package/web/.svelte-kit/output/server/nodes/2.js +8 -0
- package/web/.svelte-kit/output/server/nodes/3.js +10 -0
- package/web/.svelte-kit/output/server/nodes/4.js +8 -0
- package/web/.svelte-kit/output/server/remote-entry.js +541 -0
- package/web/.svelte-kit/tsconfig.json +58 -0
- package/web/.svelte-kit/types/route_meta_data.json +55 -0
- package/web/.svelte-kit/types/src/routes/$types.d.ts +24 -0
- package/web/.svelte-kit/types/src/routes/api/auth/login/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/api/auth/logout/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/api/beads/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/api/browse/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/api/chrome/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/api/files/image/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/api/health/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/api/projects/new-session/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/api/sessions/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/api/sessions/[id]/$types.d.ts +11 -0
- package/web/.svelte-kit/types/src/routes/api/sessions/[id]/kill/$types.d.ts +11 -0
- package/web/.svelte-kit/types/src/routes/api/sessions/[id]/restart/$types.d.ts +11 -0
- package/web/.svelte-kit/types/src/routes/api/sessions/[id]/screenshots/$types.d.ts +11 -0
- package/web/.svelte-kit/types/src/routes/api/sessions/[id]/send/$types.d.ts +11 -0
- package/web/.svelte-kit/types/src/routes/api/sessions/[target]/output/$types.d.ts +11 -0
- package/web/.svelte-kit/types/src/routes/api/tmux/panes/$types.d.ts +10 -0
- package/web/.svelte-kit/types/src/routes/login/$types.d.ts +25 -0
- package/web/.svelte-kit/types/src/routes/login/proxy+page.server.ts +19 -0
- package/web/.svelte-kit/types/src/routes/session/[target]/$types.d.ts +19 -0
- package/web/README.md +42 -0
- package/web/components.json +16 -0
- package/web/package.json +35 -0
- package/web/src/app.css +128 -0
- package/web/src/app.d.ts +13 -0
- package/web/src/app.html +11 -0
- package/web/src/hooks.server.ts +156 -0
- package/web/src/lib/assets/favicon.svg +1 -0
- package/web/src/lib/components/AllSessionsPanel.svelte +789 -0
- package/web/src/lib/components/BeadsPanel.svelte +146 -0
- package/web/src/lib/components/IssueItem.svelte +287 -0
- package/web/src/lib/components/ScreenshotsPanel.svelte +336 -0
- package/web/src/lib/components/SessionsSidebar.svelte +312 -0
- package/web/src/lib/components/TerminalRenderer.svelte +189 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +18 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +18 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +29 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte +17 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte +20 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte +20 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-portal.svelte +7 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-title.svelte +17 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog-trigger.svelte +7 -0
- package/web/src/lib/components/ui/alert-dialog/alert-dialog.svelte +7 -0
- package/web/src/lib/components/ui/alert-dialog/index.ts +37 -0
- package/web/src/lib/components/ui/badge/badge.svelte +50 -0
- package/web/src/lib/components/ui/badge/index.ts +2 -0
- package/web/src/lib/components/ui/button/button.svelte +86 -0
- package/web/src/lib/components/ui/button/index.ts +17 -0
- package/web/src/lib/components/ui/checkbox/checkbox.svelte +36 -0
- package/web/src/lib/components/ui/checkbox/index.ts +6 -0
- package/web/src/lib/components/ui/dialog/dialog-close.svelte +7 -0
- package/web/src/lib/components/ui/dialog/dialog-content.svelte +45 -0
- package/web/src/lib/components/ui/dialog/dialog-description.svelte +17 -0
- package/web/src/lib/components/ui/dialog/dialog-footer.svelte +20 -0
- package/web/src/lib/components/ui/dialog/dialog-header.svelte +20 -0
- package/web/src/lib/components/ui/dialog/dialog-overlay.svelte +20 -0
- package/web/src/lib/components/ui/dialog/dialog-portal.svelte +7 -0
- package/web/src/lib/components/ui/dialog/dialog-title.svelte +17 -0
- package/web/src/lib/components/ui/dialog/dialog-trigger.svelte +7 -0
- package/web/src/lib/components/ui/dialog/dialog.svelte +7 -0
- package/web/src/lib/components/ui/dialog/index.ts +34 -0
- package/web/src/lib/components/ui/scroll-area/index.ts +10 -0
- package/web/src/lib/components/ui/scroll-area/scroll-area-scrollbar.svelte +31 -0
- package/web/src/lib/components/ui/scroll-area/scroll-area.svelte +43 -0
- package/web/src/lib/components/ui/textarea/index.ts +7 -0
- package/web/src/lib/components/ui/textarea/textarea.svelte +23 -0
- package/web/src/lib/index.ts +1 -0
- package/web/src/lib/server/auth.ts +90 -0
- package/web/src/lib/stores/beads.svelte.ts +163 -0
- package/web/src/lib/stores/input-injection.svelte.ts +39 -0
- package/web/src/lib/stores/preferences.svelte.ts +55 -0
- package/web/src/lib/stores/sessions.svelte.ts +108 -0
- package/web/src/lib/stores/terminal.svelte.ts +96 -0
- package/web/src/lib/stores/websocket-base.svelte.ts +209 -0
- package/web/src/lib/types/terminal.ts +31 -0
- package/web/src/lib/utils/terminal-parser.ts +239 -0
- package/web/src/lib/utils.ts +13 -0
- package/web/src/routes/+layout.svelte +450 -0
- package/web/src/routes/+page.svelte +19 -0
- package/web/src/routes/api/auth/login/+server.ts +34 -0
- package/web/src/routes/api/auth/logout/+server.ts +10 -0
- package/web/src/routes/api/beads/+server.ts +28 -0
- package/web/src/routes/api/browse/+server.ts +59 -0
- package/web/src/routes/api/chrome/+server.ts +35 -0
- package/web/src/routes/api/files/image/+server.ts +64 -0
- package/web/src/routes/api/health/+server.ts +6 -0
- package/web/src/routes/api/projects/new-session/+server.ts +50 -0
- package/web/src/routes/api/sessions/+server.ts +62 -0
- package/web/src/routes/api/sessions/[id]/+server.ts +19 -0
- package/web/src/routes/api/sessions/[id]/kill/+server.ts +46 -0
- package/web/src/routes/api/sessions/[id]/restart/+server.ts +59 -0
- package/web/src/routes/api/sessions/[id]/screenshots/+server.ts +32 -0
- package/web/src/routes/api/sessions/[id]/send/+server.ts +31 -0
- package/web/src/routes/api/sessions/[target]/output/+server.ts +13 -0
- package/web/src/routes/api/tmux/panes/+server.ts +32 -0
- package/web/src/routes/login/+page.server.ts +18 -0
- package/web/src/routes/login/+page.svelte +69 -0
- package/web/src/routes/session/[target]/+page.svelte +450 -0
- package/web/static/robots.txt +3 -0
- package/web/svelte.config.js +20 -0
- package/web/tsconfig.json +20 -0
- package/web/vite.config.ts +154 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '../app.css';
|
|
3
|
+
import { page } from '$app/stores';
|
|
4
|
+
import { browser } from '$app/environment';
|
|
5
|
+
import { onMount, onDestroy } from 'svelte';
|
|
6
|
+
import { sessionStore } from '$lib/stores/sessions.svelte';
|
|
7
|
+
import SessionsSidebar from '$lib/components/SessionsSidebar.svelte';
|
|
8
|
+
import AllSessionsPanel from '$lib/components/AllSessionsPanel.svelte';
|
|
9
|
+
|
|
10
|
+
let { children } = $props();
|
|
11
|
+
|
|
12
|
+
let drawerOpen = $state(false);
|
|
13
|
+
let sidebarElement: HTMLElement | null = $state(null);
|
|
14
|
+
let touchStartX = 0;
|
|
15
|
+
let touchCurrentX = 0;
|
|
16
|
+
let isDragging = false;
|
|
17
|
+
|
|
18
|
+
// Desktop split-view detection
|
|
19
|
+
const SPLIT_VIEW_BREAKPOINT = 1200;
|
|
20
|
+
let isDesktop = $state(false);
|
|
21
|
+
|
|
22
|
+
// Resizable sidebar state
|
|
23
|
+
const SIDEBAR_WIDTH_KEY = 'claude-mux-sidebar-width';
|
|
24
|
+
const SPLIT_PANEL_WIDTH_KEY = 'claude-mux-split-panel-width';
|
|
25
|
+
const MIN_WIDTH = 200;
|
|
26
|
+
const MAX_WIDTH = 500;
|
|
27
|
+
const DEFAULT_WIDTH = 250;
|
|
28
|
+
const DEFAULT_SPLIT_WIDTH = 350;
|
|
29
|
+
|
|
30
|
+
let sidebarWidth = $state(DEFAULT_WIDTH);
|
|
31
|
+
let splitPanelWidth = $state(DEFAULT_SPLIT_WIDTH);
|
|
32
|
+
let isResizing = $state(false);
|
|
33
|
+
let isResizingSplit = $state(false);
|
|
34
|
+
let sidebarRightEdge = 0; // Track sidebar's right edge for resize calculation (when on right side)
|
|
35
|
+
|
|
36
|
+
// Show sidebar only on session detail pages (not on main page)
|
|
37
|
+
const showSidebar = $derived($page.url.pathname.startsWith('/session/'));
|
|
38
|
+
|
|
39
|
+
// Connect session store at layout level so sidebar always has data
|
|
40
|
+
onMount(() => {
|
|
41
|
+
sessionStore.connect();
|
|
42
|
+
|
|
43
|
+
// Desktop detection
|
|
44
|
+
if (browser) {
|
|
45
|
+
isDesktop = window.innerWidth >= SPLIT_VIEW_BREAKPOINT;
|
|
46
|
+
|
|
47
|
+
const handleResize = () => {
|
|
48
|
+
isDesktop = window.innerWidth >= SPLIT_VIEW_BREAKPOINT;
|
|
49
|
+
};
|
|
50
|
+
window.addEventListener('resize', handleResize);
|
|
51
|
+
|
|
52
|
+
// Load saved sidebar width
|
|
53
|
+
const saved = localStorage.getItem(SIDEBAR_WIDTH_KEY);
|
|
54
|
+
if (saved) {
|
|
55
|
+
const width = parseInt(saved, 10);
|
|
56
|
+
if (width >= MIN_WIDTH && width <= MAX_WIDTH) {
|
|
57
|
+
sidebarWidth = width;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Load saved split panel width
|
|
62
|
+
const savedSplit = localStorage.getItem(SPLIT_PANEL_WIDTH_KEY);
|
|
63
|
+
if (savedSplit) {
|
|
64
|
+
const width = parseInt(savedSplit, 10);
|
|
65
|
+
if (width >= MIN_WIDTH && width <= MAX_WIDTH) {
|
|
66
|
+
splitPanelWidth = width;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
onDestroy(() => {
|
|
75
|
+
sessionStore.disconnect();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Resize handlers
|
|
79
|
+
function handleResizeStart(e: MouseEvent) {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
isResizing = true;
|
|
82
|
+
// Store the sidebar's right edge for resize calculation (sidebar is on right side on desktop)
|
|
83
|
+
if (sidebarElement) {
|
|
84
|
+
sidebarRightEdge = sidebarElement.getBoundingClientRect().right;
|
|
85
|
+
}
|
|
86
|
+
document.addEventListener('mousemove', handleResizeMove);
|
|
87
|
+
document.addEventListener('mouseup', handleResizeEnd);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function handleResizeMove(e: MouseEvent) {
|
|
91
|
+
if (!isResizing) return;
|
|
92
|
+
// On desktop (sidebar on right): width = rightEdge - mouseX
|
|
93
|
+
// On tablet (sidebar on left): width = mouseX - leftEdge (but we use rightEdge - (rightEdge - width) pattern)
|
|
94
|
+
if (isDesktop) {
|
|
95
|
+
// Sidebar is on the right, resize handle on left edge
|
|
96
|
+
// Dragging left = increase width, dragging right = decrease width
|
|
97
|
+
const newWidth = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, sidebarRightEdge - e.clientX));
|
|
98
|
+
sidebarWidth = newWidth;
|
|
99
|
+
} else {
|
|
100
|
+
// Sidebar is on the left, resize handle on right edge
|
|
101
|
+
// Use left edge calculation: leftEdge = rightEdge - currentWidth
|
|
102
|
+
const sidebarLeftEdge = sidebarRightEdge - sidebarWidth;
|
|
103
|
+
const newWidth = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, e.clientX - sidebarLeftEdge));
|
|
104
|
+
sidebarWidth = newWidth;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function handleResizeEnd() {
|
|
109
|
+
isResizing = false;
|
|
110
|
+
document.removeEventListener('mousemove', handleResizeMove);
|
|
111
|
+
document.removeEventListener('mouseup', handleResizeEnd);
|
|
112
|
+
// Save to localStorage
|
|
113
|
+
if (browser) {
|
|
114
|
+
localStorage.setItem(SIDEBAR_WIDTH_KEY, sidebarWidth.toString());
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Split panel resize handlers
|
|
119
|
+
function handleSplitResizeStart(e: MouseEvent) {
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
isResizingSplit = true;
|
|
122
|
+
document.addEventListener('mousemove', handleSplitResizeMove);
|
|
123
|
+
document.addEventListener('mouseup', handleSplitResizeEnd);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function handleSplitResizeMove(e: MouseEvent) {
|
|
127
|
+
if (!isResizingSplit) return;
|
|
128
|
+
const newWidth = Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, e.clientX));
|
|
129
|
+
splitPanelWidth = newWidth;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function handleSplitResizeEnd() {
|
|
133
|
+
isResizingSplit = false;
|
|
134
|
+
document.removeEventListener('mousemove', handleSplitResizeMove);
|
|
135
|
+
document.removeEventListener('mouseup', handleSplitResizeEnd);
|
|
136
|
+
// Save to localStorage
|
|
137
|
+
if (browser) {
|
|
138
|
+
localStorage.setItem(SPLIT_PANEL_WIDTH_KEY, splitPanelWidth.toString());
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function closeDrawer() {
|
|
143
|
+
drawerOpen = false;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function handleTouchStart(e: TouchEvent) {
|
|
147
|
+
touchStartX = e.touches[0].clientX;
|
|
148
|
+
touchCurrentX = touchStartX;
|
|
149
|
+
isDragging = true;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function handleTouchMove(e: TouchEvent) {
|
|
153
|
+
if (!isDragging || !sidebarElement) return;
|
|
154
|
+
touchCurrentX = e.touches[0].clientX;
|
|
155
|
+
const diff = touchCurrentX - touchStartX;
|
|
156
|
+
// Only allow dragging left (negative diff)
|
|
157
|
+
if (diff < 0) {
|
|
158
|
+
sidebarElement.style.transform = `translateX(${diff}px)`;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function handleTouchEnd() {
|
|
163
|
+
if (!isDragging || !sidebarElement) return;
|
|
164
|
+
isDragging = false;
|
|
165
|
+
const diff = touchCurrentX - touchStartX;
|
|
166
|
+
// If swiped left more than 80px, close the drawer
|
|
167
|
+
if (diff < -80) {
|
|
168
|
+
closeDrawer();
|
|
169
|
+
}
|
|
170
|
+
// Reset transform to let CSS handle it
|
|
171
|
+
sidebarElement.style.transform = '';
|
|
172
|
+
}
|
|
173
|
+
</script>
|
|
174
|
+
|
|
175
|
+
<svelte:head>
|
|
176
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
|
177
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
178
|
+
<script src="https://code.iconify.design/iconify-icon/2.1.0/iconify-icon.min.js"></script>
|
|
179
|
+
</svelte:head>
|
|
180
|
+
|
|
181
|
+
{#if showSidebar}
|
|
182
|
+
<div class="app-shell" class:split-view={isDesktop} class:resizing-any={isResizing || isResizingSplit}>
|
|
183
|
+
<!-- Split panel (all sessions): only on desktop, LEFT side -->
|
|
184
|
+
{#if isDesktop}
|
|
185
|
+
<aside
|
|
186
|
+
class="split-panel"
|
|
187
|
+
class:resizing={isResizingSplit}
|
|
188
|
+
style="--split-panel-width: {splitPanelWidth}px"
|
|
189
|
+
>
|
|
190
|
+
<AllSessionsPanel compact />
|
|
191
|
+
<div
|
|
192
|
+
class="resize-handle"
|
|
193
|
+
onmousedown={handleSplitResizeStart}
|
|
194
|
+
role="separator"
|
|
195
|
+
aria-orientation="vertical"
|
|
196
|
+
></div>
|
|
197
|
+
</aside>
|
|
198
|
+
{/if}
|
|
199
|
+
|
|
200
|
+
<!-- Main content: CENTER -->
|
|
201
|
+
<main class="content">
|
|
202
|
+
<button class="hamburger" onclick={() => (drawerOpen = !drawerOpen)} aria-label="Toggle menu">
|
|
203
|
+
<iconify-icon icon="mdi:menu"></iconify-icon>
|
|
204
|
+
</button>
|
|
205
|
+
{@render children()}
|
|
206
|
+
</main>
|
|
207
|
+
|
|
208
|
+
<!-- Project sidebar: RIGHT on desktop, LEFT on tablet, drawer on mobile -->
|
|
209
|
+
<aside
|
|
210
|
+
class="sidebar"
|
|
211
|
+
class:open={drawerOpen}
|
|
212
|
+
class:resizing={isResizing}
|
|
213
|
+
style="--sidebar-width: {sidebarWidth}px"
|
|
214
|
+
bind:this={sidebarElement}
|
|
215
|
+
ontouchstart={handleTouchStart}
|
|
216
|
+
ontouchmove={handleTouchMove}
|
|
217
|
+
ontouchend={handleTouchEnd}
|
|
218
|
+
>
|
|
219
|
+
<!-- Left resize handle (desktop: sidebar on right) -->
|
|
220
|
+
<div
|
|
221
|
+
class="resize-handle resize-handle-left"
|
|
222
|
+
onmousedown={handleResizeStart}
|
|
223
|
+
role="separator"
|
|
224
|
+
aria-orientation="vertical"
|
|
225
|
+
></div>
|
|
226
|
+
<SessionsSidebar onSelect={closeDrawer} hideSessionsList={isDesktop} />
|
|
227
|
+
<!-- Right resize handle (tablet: sidebar on left) -->
|
|
228
|
+
<div
|
|
229
|
+
class="resize-handle resize-handle-right"
|
|
230
|
+
onmousedown={handleResizeStart}
|
|
231
|
+
role="separator"
|
|
232
|
+
aria-orientation="vertical"
|
|
233
|
+
></div>
|
|
234
|
+
</aside>
|
|
235
|
+
|
|
236
|
+
{#if drawerOpen}
|
|
237
|
+
<button class="backdrop" onclick={closeDrawer} aria-label="Close menu"></button>
|
|
238
|
+
{/if}
|
|
239
|
+
</div>
|
|
240
|
+
{:else}
|
|
241
|
+
{@render children()}
|
|
242
|
+
{/if}
|
|
243
|
+
|
|
244
|
+
<style>
|
|
245
|
+
:global(body) {
|
|
246
|
+
margin: 0;
|
|
247
|
+
min-height: 100vh;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
:global(iconify-icon) {
|
|
251
|
+
font-size: 18px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
:global(iconify-icon.spin) {
|
|
255
|
+
animation: spin 1s linear infinite;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@keyframes spin {
|
|
259
|
+
from {
|
|
260
|
+
transform: rotate(0deg);
|
|
261
|
+
}
|
|
262
|
+
to {
|
|
263
|
+
transform: rotate(360deg);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* App shell with sidebar */
|
|
268
|
+
.app-shell {
|
|
269
|
+
display: flex;
|
|
270
|
+
height: 100vh;
|
|
271
|
+
overflow: hidden;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.app-shell.resizing-any {
|
|
275
|
+
cursor: col-resize;
|
|
276
|
+
user-select: none;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* Split panel for desktop */
|
|
280
|
+
.split-panel {
|
|
281
|
+
width: var(--split-panel-width, 350px);
|
|
282
|
+
flex-shrink: 0;
|
|
283
|
+
background: hsl(var(--background));
|
|
284
|
+
border-right: 1px solid hsl(var(--border));
|
|
285
|
+
overflow: hidden;
|
|
286
|
+
position: relative;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.split-panel.resizing {
|
|
290
|
+
user-select: none;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.split-panel .resize-handle {
|
|
294
|
+
position: absolute;
|
|
295
|
+
top: 0;
|
|
296
|
+
right: 0;
|
|
297
|
+
width: 4px;
|
|
298
|
+
height: 100%;
|
|
299
|
+
cursor: col-resize;
|
|
300
|
+
background: transparent;
|
|
301
|
+
transition: background 0.15s;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.split-panel .resize-handle:hover,
|
|
305
|
+
.split-panel.resizing .resize-handle {
|
|
306
|
+
background: color-mix(in oklch, var(--primary), transparent 50%);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.sidebar {
|
|
310
|
+
width: var(--sidebar-width, 250px);
|
|
311
|
+
flex-shrink: 0;
|
|
312
|
+
background: hsl(var(--background));
|
|
313
|
+
border-right: 1px solid hsl(var(--border));
|
|
314
|
+
overflow: hidden;
|
|
315
|
+
position: relative;
|
|
316
|
+
order: 1; /* Default: left side (tablet) */
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* Desktop: sidebar moves to right */
|
|
320
|
+
.split-view .sidebar {
|
|
321
|
+
order: 3;
|
|
322
|
+
border-right: none;
|
|
323
|
+
border-left: 1px solid hsl(var(--border));
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.sidebar.resizing {
|
|
327
|
+
user-select: none;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.resize-handle {
|
|
331
|
+
position: absolute;
|
|
332
|
+
top: 0;
|
|
333
|
+
right: 0;
|
|
334
|
+
width: 4px;
|
|
335
|
+
height: 100%;
|
|
336
|
+
cursor: col-resize;
|
|
337
|
+
background: transparent;
|
|
338
|
+
transition: background 0.15s;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* Left-side resize handle (for right sidebar on desktop) */
|
|
342
|
+
.resize-handle-left {
|
|
343
|
+
right: auto;
|
|
344
|
+
left: 0;
|
|
345
|
+
display: none; /* Hidden by default (tablet/mobile) */
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* Right-side resize handle (for left sidebar on tablet) */
|
|
349
|
+
.resize-handle-right {
|
|
350
|
+
right: 0;
|
|
351
|
+
left: auto;
|
|
352
|
+
display: block; /* Shown by default (tablet) */
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/* Desktop: show left handle, hide right handle on sidebar */
|
|
356
|
+
.split-view .sidebar .resize-handle-left {
|
|
357
|
+
display: block;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.split-view .sidebar .resize-handle-right {
|
|
361
|
+
display: none;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.resize-handle:hover,
|
|
365
|
+
.sidebar.resizing .resize-handle {
|
|
366
|
+
background: color-mix(in oklch, var(--primary), transparent 50%);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.content {
|
|
370
|
+
flex: 1;
|
|
371
|
+
overflow: hidden;
|
|
372
|
+
position: relative;
|
|
373
|
+
order: 2; /* Always in center */
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.hamburger {
|
|
377
|
+
display: none;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.backdrop {
|
|
381
|
+
display: none;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/* Hide split panel below desktop breakpoint (CSS fallback) */
|
|
385
|
+
@media (max-width: 1199px) {
|
|
386
|
+
.split-panel {
|
|
387
|
+
display: none;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* Mobile responsive */
|
|
392
|
+
@media (max-width: 768px) {
|
|
393
|
+
.sidebar {
|
|
394
|
+
position: fixed;
|
|
395
|
+
left: 0;
|
|
396
|
+
top: 0;
|
|
397
|
+
bottom: 0;
|
|
398
|
+
width: 100% !important;
|
|
399
|
+
z-index: 60;
|
|
400
|
+
transform: translateX(-100%);
|
|
401
|
+
transition: transform 0.2s ease;
|
|
402
|
+
background: hsl(var(--background) / 0.85);
|
|
403
|
+
backdrop-filter: blur(12px);
|
|
404
|
+
-webkit-backdrop-filter: blur(12px);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.sidebar.open {
|
|
408
|
+
transform: translateX(0);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.resize-handle {
|
|
412
|
+
display: none;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.hamburger {
|
|
416
|
+
display: flex;
|
|
417
|
+
align-items: center;
|
|
418
|
+
justify-content: center;
|
|
419
|
+
position: fixed;
|
|
420
|
+
top: 12px;
|
|
421
|
+
left: 12px;
|
|
422
|
+
z-index: 50;
|
|
423
|
+
width: 44px;
|
|
424
|
+
height: 44px;
|
|
425
|
+
background: hsl(var(--secondary));
|
|
426
|
+
border: none;
|
|
427
|
+
border-radius: 8px;
|
|
428
|
+
color: hsl(var(--foreground));
|
|
429
|
+
cursor: pointer;
|
|
430
|
+
font-size: 22px;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.hamburger:hover {
|
|
434
|
+
background: hsl(var(--accent));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.backdrop {
|
|
438
|
+
display: block;
|
|
439
|
+
position: fixed;
|
|
440
|
+
top: 0;
|
|
441
|
+
left: 0;
|
|
442
|
+
right: 0;
|
|
443
|
+
bottom: 0;
|
|
444
|
+
background: rgba(0, 0, 0, 0.4);
|
|
445
|
+
z-index: 55;
|
|
446
|
+
border: none;
|
|
447
|
+
cursor: pointer;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import AllSessionsPanel from '$lib/components/AllSessionsPanel.svelte';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svelte:head>
|
|
6
|
+
<title>claude-mux</title>
|
|
7
|
+
</svelte:head>
|
|
8
|
+
|
|
9
|
+
<div class="root-page">
|
|
10
|
+
<AllSessionsPanel />
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
.root-page {
|
|
15
|
+
height: 100vh;
|
|
16
|
+
max-width: 800px;
|
|
17
|
+
margin: 0 auto;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { json } from '@sveltejs/kit';
|
|
2
|
+
import type { RequestHandler } from './$types';
|
|
3
|
+
import {
|
|
4
|
+
isAuthEnabled,
|
|
5
|
+
validatePassword,
|
|
6
|
+
createAuthToken,
|
|
7
|
+
AUTH_COOKIE
|
|
8
|
+
} from '$lib/server/auth.js';
|
|
9
|
+
|
|
10
|
+
export const POST: RequestHandler = async ({ request, cookies, url }) => {
|
|
11
|
+
// If auth is not enabled, just return success
|
|
12
|
+
if (!isAuthEnabled()) {
|
|
13
|
+
return json({ success: true, message: 'Auth not enabled' });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const body = await request.json().catch(() => ({}));
|
|
17
|
+
const password = body.password;
|
|
18
|
+
|
|
19
|
+
if (!password || typeof password !== 'string') {
|
|
20
|
+
return json({ error: 'Password required' }, { status: 400 });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!validatePassword(password)) {
|
|
24
|
+
return json({ error: 'Invalid password' }, { status: 401 });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Create and set auth token cookie
|
|
28
|
+
const token = createAuthToken();
|
|
29
|
+
const isSecure = url.protocol === 'https:';
|
|
30
|
+
|
|
31
|
+
cookies.set(AUTH_COOKIE.name, token, AUTH_COOKIE.options(isSecure));
|
|
32
|
+
|
|
33
|
+
return json({ success: true });
|
|
34
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { json } from '@sveltejs/kit';
|
|
2
|
+
import type { RequestHandler } from './$types';
|
|
3
|
+
import { AUTH_COOKIE } from '$lib/server/auth.js';
|
|
4
|
+
|
|
5
|
+
export const POST: RequestHandler = async ({ cookies }) => {
|
|
6
|
+
// Clear the auth cookie
|
|
7
|
+
cookies.delete(AUTH_COOKIE.name, { path: '/' });
|
|
8
|
+
|
|
9
|
+
return json({ success: true });
|
|
10
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { json } from '@sveltejs/kit';
|
|
2
|
+
import type { RequestHandler } from './$types';
|
|
3
|
+
import { getBeadsIssues } from '$shared/server/ws-handlers.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* GET /api/beads?project=/path/to/project
|
|
7
|
+
* Returns beads issues for a project (REST fallback)
|
|
8
|
+
*/
|
|
9
|
+
export const GET: RequestHandler = async ({ url }) => {
|
|
10
|
+
const project = url.searchParams.get('project');
|
|
11
|
+
|
|
12
|
+
if (!project) {
|
|
13
|
+
return json({ error: 'Missing project parameter' }, { status: 400 });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const projectPath = decodeURIComponent(project);
|
|
18
|
+
const issues = getBeadsIssues(projectPath);
|
|
19
|
+
|
|
20
|
+
return json({
|
|
21
|
+
issues,
|
|
22
|
+
project: projectPath,
|
|
23
|
+
timestamp: Date.now()
|
|
24
|
+
});
|
|
25
|
+
} catch (err) {
|
|
26
|
+
return json({ error: 'Failed to fetch beads issues' }, { status: 500 });
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { json } from '@sveltejs/kit';
|
|
2
|
+
import type { RequestHandler } from './$types';
|
|
3
|
+
import { homedir } from 'os';
|
|
4
|
+
import { existsSync, statSync, readdirSync } from 'fs';
|
|
5
|
+
import { resolve, dirname, join } from 'path';
|
|
6
|
+
|
|
7
|
+
export const GET: RequestHandler = async ({ url }) => {
|
|
8
|
+
let targetPath = url.searchParams.get('path') || homedir();
|
|
9
|
+
const showHidden = url.searchParams.get('showHidden') === 'true';
|
|
10
|
+
|
|
11
|
+
// Normalize and resolve path
|
|
12
|
+
if (targetPath.startsWith('~')) {
|
|
13
|
+
targetPath = targetPath.replace('~', homedir());
|
|
14
|
+
}
|
|
15
|
+
targetPath = resolve(targetPath);
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
if (!existsSync(targetPath)) {
|
|
19
|
+
return json({ error: 'Directory not found' }, { status: 404 });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const stat = statSync(targetPath);
|
|
23
|
+
if (!stat.isDirectory()) {
|
|
24
|
+
return json({ error: 'Not a directory' }, { status: 400 });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const entries = readdirSync(targetPath, { withFileTypes: true });
|
|
28
|
+
const folders = entries
|
|
29
|
+
.filter((e) => {
|
|
30
|
+
if (!e.isDirectory()) return false;
|
|
31
|
+
if (!showHidden && e.name.startsWith('.')) return false;
|
|
32
|
+
return true;
|
|
33
|
+
})
|
|
34
|
+
.map((e) => ({
|
|
35
|
+
name: e.name,
|
|
36
|
+
path: join(targetPath, e.name)
|
|
37
|
+
}))
|
|
38
|
+
.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()));
|
|
39
|
+
|
|
40
|
+
const parent = dirname(targetPath);
|
|
41
|
+
const isRoot = targetPath === '/' || targetPath === parent;
|
|
42
|
+
|
|
43
|
+
return json({
|
|
44
|
+
current: targetPath,
|
|
45
|
+
parent: isRoot ? null : parent,
|
|
46
|
+
isRoot,
|
|
47
|
+
folders
|
|
48
|
+
});
|
|
49
|
+
} catch (err: unknown) {
|
|
50
|
+
const error = err as { code?: string };
|
|
51
|
+
if (error.code === 'ENOENT') {
|
|
52
|
+
return json({ error: 'Directory not found' }, { status: 404 });
|
|
53
|
+
}
|
|
54
|
+
if (error.code === 'EACCES') {
|
|
55
|
+
return json({ error: 'Permission denied' }, { status: 403 });
|
|
56
|
+
}
|
|
57
|
+
return json({ error: 'Failed to read directory' }, { status: 500 });
|
|
58
|
+
}
|
|
59
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { json } from '@sveltejs/kit';
|
|
2
|
+
import type { RequestHandler } from './$types';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
|
|
5
|
+
export const DELETE: RequestHandler = async () => {
|
|
6
|
+
try {
|
|
7
|
+
// Find and kill Chrome/Brave processes with remote debugging enabled
|
|
8
|
+
let killed = 0;
|
|
9
|
+
try {
|
|
10
|
+
// Find Chrome/Chromium/Brave processes with --remote-debugging (pipe or port)
|
|
11
|
+
const psOutput = execSync(
|
|
12
|
+
"ps aux | grep -E '(chrome|chromium|brave)' | grep -E 'remote-debugging-(pipe|port)' | grep -v grep | awk '{print $2}'",
|
|
13
|
+
{ encoding: 'utf-8' }
|
|
14
|
+
).trim();
|
|
15
|
+
|
|
16
|
+
if (psOutput) {
|
|
17
|
+
const pids = psOutput.split('\n').filter(Boolean);
|
|
18
|
+
for (const pid of pids) {
|
|
19
|
+
try {
|
|
20
|
+
execSync(`kill ${pid}`, { stdio: 'ignore' });
|
|
21
|
+
killed++;
|
|
22
|
+
} catch {
|
|
23
|
+
// Process may have already exited
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} catch {
|
|
28
|
+
// No matching processes found
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return json({ ok: true, killed });
|
|
32
|
+
} catch {
|
|
33
|
+
return json({ error: 'Failed to close Chrome' }, { status: 500 });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { json } from '@sveltejs/kit';
|
|
2
|
+
import type { RequestHandler } from './$types';
|
|
3
|
+
import { existsSync, readFileSync, statSync } from 'fs';
|
|
4
|
+
import { extname } from 'path';
|
|
5
|
+
|
|
6
|
+
const MIME_TYPES: Record<string, string> = {
|
|
7
|
+
'.png': 'image/png',
|
|
8
|
+
'.jpg': 'image/jpeg',
|
|
9
|
+
'.jpeg': 'image/jpeg',
|
|
10
|
+
'.webp': 'image/webp',
|
|
11
|
+
'.gif': 'image/gif'
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const GET: RequestHandler = async ({ url }) => {
|
|
15
|
+
const path = url.searchParams.get('path');
|
|
16
|
+
|
|
17
|
+
if (!path) {
|
|
18
|
+
return json({ error: 'path parameter required' }, { status: 400 });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Basic security: don't allow path traversal
|
|
22
|
+
if (path.includes('..')) {
|
|
23
|
+
return json({ error: 'Invalid path' }, { status: 400 });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
if (!existsSync(path)) {
|
|
28
|
+
return json({ error: 'File not found' }, { status: 404 });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const stat = statSync(path);
|
|
32
|
+
if (!stat.isFile()) {
|
|
33
|
+
return json({ error: 'Not a file' }, { status: 400 });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Limit file size to 50MB
|
|
37
|
+
if (stat.size > 50 * 1024 * 1024) {
|
|
38
|
+
return json({ error: 'File too large' }, { status: 413 });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const ext = extname(path).toLowerCase();
|
|
42
|
+
const mimeType = MIME_TYPES[ext];
|
|
43
|
+
|
|
44
|
+
if (!mimeType) {
|
|
45
|
+
return json({ error: 'Unsupported image format' }, { status: 400 });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const content = readFileSync(path);
|
|
49
|
+
|
|
50
|
+
return new Response(content, {
|
|
51
|
+
headers: {
|
|
52
|
+
'Content-Type': mimeType,
|
|
53
|
+
'Content-Length': String(content.length),
|
|
54
|
+
'Cache-Control': 'public, max-age=300'
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
} catch (err: unknown) {
|
|
58
|
+
const e = err as { code?: string };
|
|
59
|
+
if (e.code === 'EACCES') {
|
|
60
|
+
return json({ error: 'Permission denied' }, { status: 403 });
|
|
61
|
+
}
|
|
62
|
+
return json({ error: 'Failed to read file' }, { status: 500 });
|
|
63
|
+
}
|
|
64
|
+
};
|