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,59 @@
|
|
|
1
|
+
import { createHmac } from "crypto";
|
|
2
|
+
const COOKIE_NAME = "claude-mux-session";
|
|
3
|
+
const MAX_AGE = 60 * 60 * 24 * 7;
|
|
4
|
+
function isAuthEnabled() {
|
|
5
|
+
return !!process.env.CLAUDE_WATCH_PASSWORD;
|
|
6
|
+
}
|
|
7
|
+
function getPassword() {
|
|
8
|
+
return process.env.CLAUDE_WATCH_PASSWORD || "";
|
|
9
|
+
}
|
|
10
|
+
function validatePassword(password) {
|
|
11
|
+
const expected = getPassword();
|
|
12
|
+
if (!expected) return false;
|
|
13
|
+
if (password.length !== expected.length) return false;
|
|
14
|
+
let result = 0;
|
|
15
|
+
for (let i = 0; i < password.length; i++) {
|
|
16
|
+
result |= password.charCodeAt(i) ^ expected.charCodeAt(i);
|
|
17
|
+
}
|
|
18
|
+
return result === 0;
|
|
19
|
+
}
|
|
20
|
+
function createAuthToken() {
|
|
21
|
+
const timestamp = Date.now().toString();
|
|
22
|
+
const signature = createHmac("sha256", getPassword()).update(timestamp).digest("hex");
|
|
23
|
+
return `${timestamp}:${signature}`;
|
|
24
|
+
}
|
|
25
|
+
function validateAuthToken(token) {
|
|
26
|
+
if (!token || !isAuthEnabled()) return false;
|
|
27
|
+
const parts = token.split(":");
|
|
28
|
+
if (parts.length !== 2) return false;
|
|
29
|
+
const [timestamp, signature] = parts;
|
|
30
|
+
const tokenAge = Date.now() - parseInt(timestamp, 10);
|
|
31
|
+
if (isNaN(tokenAge) || tokenAge > MAX_AGE * 1e3 || tokenAge < 0) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const expectedSignature = createHmac("sha256", getPassword()).update(timestamp).digest("hex");
|
|
35
|
+
if (signature.length !== expectedSignature.length) return false;
|
|
36
|
+
let result = 0;
|
|
37
|
+
for (let i = 0; i < signature.length; i++) {
|
|
38
|
+
result |= signature.charCodeAt(i) ^ expectedSignature.charCodeAt(i);
|
|
39
|
+
}
|
|
40
|
+
return result === 0;
|
|
41
|
+
}
|
|
42
|
+
const AUTH_COOKIE = {
|
|
43
|
+
name: COOKIE_NAME,
|
|
44
|
+
maxAge: MAX_AGE,
|
|
45
|
+
options: (isSecure) => ({
|
|
46
|
+
httpOnly: true,
|
|
47
|
+
sameSite: "lax",
|
|
48
|
+
path: "/",
|
|
49
|
+
maxAge: MAX_AGE,
|
|
50
|
+
secure: isSecure
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
AUTH_COOKIE as A,
|
|
55
|
+
validateAuthToken as a,
|
|
56
|
+
createAuthToken as c,
|
|
57
|
+
isAuthEnabled as i,
|
|
58
|
+
validatePassword as v
|
|
59
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { a6 as attributes, aa as clsx$1, a7 as bind_props } from "./index2.js";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
5
|
+
function cn(...inputs) {
|
|
6
|
+
return twMerge(clsx(inputs));
|
|
7
|
+
}
|
|
8
|
+
const buttonVariants = tv({
|
|
9
|
+
base: "cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",
|
|
13
|
+
destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",
|
|
14
|
+
outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
|
|
15
|
+
secondary: "bg-[#222] text-stone-100 hover:bg-[#333] shadow-xs",
|
|
16
|
+
ghost: "text-stone-400 hover:bg-[#222] hover:text-stone-100",
|
|
17
|
+
"ghost-destructive": "bg-red-900 text-red-300 hover:bg-red-800 hover:text-white",
|
|
18
|
+
warning: "bg-amber-700 text-amber-100 hover:bg-amber-600 shadow-xs",
|
|
19
|
+
success: "bg-emerald-600 text-white hover:bg-emerald-500 active:bg-emerald-700 shadow-xs",
|
|
20
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
24
|
+
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
25
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
26
|
+
icon: "size-9",
|
|
27
|
+
"icon-sm": "size-8",
|
|
28
|
+
"icon-lg": "size-10",
|
|
29
|
+
toolbar: "flex-col gap-0.5 px-2 py-1.5 min-w-11 h-auto [&_svg]:size-[18px] text-[9px] uppercase tracking-wide"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: { variant: "default", size: "default" }
|
|
33
|
+
});
|
|
34
|
+
function Button($$renderer, $$props) {
|
|
35
|
+
$$renderer.component(($$renderer2) => {
|
|
36
|
+
let {
|
|
37
|
+
class: className,
|
|
38
|
+
variant = "default",
|
|
39
|
+
size = "default",
|
|
40
|
+
ref = null,
|
|
41
|
+
href = void 0,
|
|
42
|
+
type = "button",
|
|
43
|
+
disabled,
|
|
44
|
+
children,
|
|
45
|
+
$$slots,
|
|
46
|
+
$$events,
|
|
47
|
+
...restProps
|
|
48
|
+
} = $$props;
|
|
49
|
+
if (href) {
|
|
50
|
+
$$renderer2.push("<!--[-->");
|
|
51
|
+
$$renderer2.push(`<a${attributes({
|
|
52
|
+
"data-slot": "button",
|
|
53
|
+
class: clsx$1(cn(buttonVariants({ variant, size }), className)),
|
|
54
|
+
href: disabled ? void 0 : href,
|
|
55
|
+
"aria-disabled": disabled,
|
|
56
|
+
role: disabled ? "link" : void 0,
|
|
57
|
+
tabindex: disabled ? -1 : void 0,
|
|
58
|
+
...restProps
|
|
59
|
+
})}>`);
|
|
60
|
+
children?.($$renderer2);
|
|
61
|
+
$$renderer2.push(`<!----></a>`);
|
|
62
|
+
} else {
|
|
63
|
+
$$renderer2.push("<!--[!-->");
|
|
64
|
+
$$renderer2.push(`<button${attributes({
|
|
65
|
+
"data-slot": "button",
|
|
66
|
+
class: clsx$1(cn(buttonVariants({ variant, size }), className)),
|
|
67
|
+
type,
|
|
68
|
+
disabled,
|
|
69
|
+
...restProps
|
|
70
|
+
})}>`);
|
|
71
|
+
children?.($$renderer2);
|
|
72
|
+
$$renderer2.push(`<!----></button>`);
|
|
73
|
+
}
|
|
74
|
+
$$renderer2.push(`<!--]-->`);
|
|
75
|
+
bind_props($$props, { ref });
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
Button as B,
|
|
80
|
+
buttonVariants as b,
|
|
81
|
+
cn as c
|
|
82
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "clsx";
|
|
2
|
+
import "@sveltejs/kit/internal";
|
|
3
|
+
import "./exports.js";
|
|
4
|
+
import "./utils.js";
|
|
5
|
+
import { w as writable } from "./index.js";
|
|
6
|
+
import "@sveltejs/kit/internal/server";
|
|
7
|
+
import "./state.svelte.js";
|
|
8
|
+
function create_updated_store() {
|
|
9
|
+
const { set, subscribe } = writable(false);
|
|
10
|
+
{
|
|
11
|
+
return {
|
|
12
|
+
subscribe,
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
14
|
+
check: async () => false
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const stores = {
|
|
19
|
+
updated: /* @__PURE__ */ create_updated_store()
|
|
20
|
+
};
|
|
21
|
+
function goto(url, opts = {}) {
|
|
22
|
+
{
|
|
23
|
+
throw new Error("Cannot call goto(...) on the server");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
goto as g,
|
|
28
|
+
stores as s
|
|
29
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
var is_array = Array.isArray;
|
|
2
|
+
var index_of = Array.prototype.indexOf;
|
|
3
|
+
var includes = Array.prototype.includes;
|
|
4
|
+
var array_from = Array.from;
|
|
5
|
+
var define_property = Object.defineProperty;
|
|
6
|
+
var get_descriptor = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var object_prototype = Object.prototype;
|
|
8
|
+
var array_prototype = Array.prototype;
|
|
9
|
+
var get_prototype_of = Object.getPrototypeOf;
|
|
10
|
+
var is_extensible = Object.isExtensible;
|
|
11
|
+
const noop = () => {
|
|
12
|
+
};
|
|
13
|
+
function run(fn) {
|
|
14
|
+
return fn();
|
|
15
|
+
}
|
|
16
|
+
function run_all(arr) {
|
|
17
|
+
for (var i = 0; i < arr.length; i++) {
|
|
18
|
+
arr[i]();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function deferred() {
|
|
22
|
+
var resolve;
|
|
23
|
+
var reject;
|
|
24
|
+
var promise = new Promise((res, rej) => {
|
|
25
|
+
resolve = res;
|
|
26
|
+
reject = rej;
|
|
27
|
+
});
|
|
28
|
+
return { promise, resolve, reject };
|
|
29
|
+
}
|
|
30
|
+
function equals(value) {
|
|
31
|
+
return value === this.v;
|
|
32
|
+
}
|
|
33
|
+
function safe_not_equal(a, b) {
|
|
34
|
+
return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
|
|
35
|
+
}
|
|
36
|
+
function safe_equals(value) {
|
|
37
|
+
return !safe_not_equal(value, this.v);
|
|
38
|
+
}
|
|
39
|
+
function lifecycle_outside_component(name) {
|
|
40
|
+
{
|
|
41
|
+
throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const ATTR_REGEX = /[&"<]/g;
|
|
45
|
+
const CONTENT_REGEX = /[&<]/g;
|
|
46
|
+
function escape_html(value, is_attr) {
|
|
47
|
+
const str = String(value ?? "");
|
|
48
|
+
const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
|
|
49
|
+
pattern.lastIndex = 0;
|
|
50
|
+
let escaped = "";
|
|
51
|
+
let last = 0;
|
|
52
|
+
while (pattern.test(str)) {
|
|
53
|
+
const i = pattern.lastIndex - 1;
|
|
54
|
+
const ch = str[i];
|
|
55
|
+
escaped += str.substring(last, i) + (ch === "&" ? "&" : ch === '"' ? """ : "<");
|
|
56
|
+
last = i + 1;
|
|
57
|
+
}
|
|
58
|
+
return escaped + str.substring(last);
|
|
59
|
+
}
|
|
60
|
+
var ssr_context = null;
|
|
61
|
+
function set_ssr_context(v) {
|
|
62
|
+
ssr_context = v;
|
|
63
|
+
}
|
|
64
|
+
function getContext(key) {
|
|
65
|
+
const context_map = get_or_init_context_map();
|
|
66
|
+
const result = (
|
|
67
|
+
/** @type {T} */
|
|
68
|
+
context_map.get(key)
|
|
69
|
+
);
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
function setContext(key, context) {
|
|
73
|
+
get_or_init_context_map().set(key, context);
|
|
74
|
+
return context;
|
|
75
|
+
}
|
|
76
|
+
function hasContext(key) {
|
|
77
|
+
return get_or_init_context_map().has(key);
|
|
78
|
+
}
|
|
79
|
+
function getAllContexts() {
|
|
80
|
+
return get_or_init_context_map();
|
|
81
|
+
}
|
|
82
|
+
function get_or_init_context_map(name) {
|
|
83
|
+
if (ssr_context === null) {
|
|
84
|
+
lifecycle_outside_component();
|
|
85
|
+
}
|
|
86
|
+
return ssr_context.c ??= new Map(get_parent_context(ssr_context) || void 0);
|
|
87
|
+
}
|
|
88
|
+
function push(fn) {
|
|
89
|
+
ssr_context = { p: ssr_context, c: null, r: null };
|
|
90
|
+
}
|
|
91
|
+
function pop() {
|
|
92
|
+
ssr_context = /** @type {SSRContext} */
|
|
93
|
+
ssr_context.p;
|
|
94
|
+
}
|
|
95
|
+
function get_parent_context(ssr_context2) {
|
|
96
|
+
let parent = ssr_context2.p;
|
|
97
|
+
while (parent !== null) {
|
|
98
|
+
const context_map = parent.c;
|
|
99
|
+
if (context_map !== null) {
|
|
100
|
+
return context_map;
|
|
101
|
+
}
|
|
102
|
+
parent = parent.p;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
array_from as a,
|
|
108
|
+
get_prototype_of as b,
|
|
109
|
+
getAllContexts as c,
|
|
110
|
+
define_property as d,
|
|
111
|
+
escape_html as e,
|
|
112
|
+
ssr_context as f,
|
|
113
|
+
getContext as g,
|
|
114
|
+
hasContext as h,
|
|
115
|
+
is_array as i,
|
|
116
|
+
safe_not_equal as j,
|
|
117
|
+
run_all as k,
|
|
118
|
+
deferred as l,
|
|
119
|
+
includes as m,
|
|
120
|
+
noop as n,
|
|
121
|
+
object_prototype as o,
|
|
122
|
+
safe_equals as p,
|
|
123
|
+
equals as q,
|
|
124
|
+
run as r,
|
|
125
|
+
setContext as s,
|
|
126
|
+
array_prototype as t,
|
|
127
|
+
get_descriptor as u,
|
|
128
|
+
is_extensible as v,
|
|
129
|
+
index_of as w,
|
|
130
|
+
set_ssr_context as x,
|
|
131
|
+
push as y,
|
|
132
|
+
pop as z
|
|
133
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
let base = "";
|
|
2
|
+
let assets = base;
|
|
3
|
+
const app_dir = "_app";
|
|
4
|
+
const relative = true;
|
|
5
|
+
const initial = { base, assets };
|
|
6
|
+
function override(paths) {
|
|
7
|
+
base = paths.base;
|
|
8
|
+
assets = paths.assets;
|
|
9
|
+
}
|
|
10
|
+
function reset() {
|
|
11
|
+
base = initial.base;
|
|
12
|
+
assets = initial.assets;
|
|
13
|
+
}
|
|
14
|
+
function set_assets(path) {
|
|
15
|
+
assets = initial.assets = path;
|
|
16
|
+
}
|
|
17
|
+
let prerendering = false;
|
|
18
|
+
function set_building() {
|
|
19
|
+
}
|
|
20
|
+
function set_prerendering() {
|
|
21
|
+
prerendering = true;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
assets as a,
|
|
25
|
+
base as b,
|
|
26
|
+
app_dir as c,
|
|
27
|
+
reset as d,
|
|
28
|
+
set_building as e,
|
|
29
|
+
set_prerendering as f,
|
|
30
|
+
override as o,
|
|
31
|
+
prerendering as p,
|
|
32
|
+
relative as r,
|
|
33
|
+
set_assets as s
|
|
34
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { n as set_active_reaction, m as set_active_effect, f as active_effect, v as active_reaction, q as queue_micro_task, ad as without_reactive_context } from "./index2.js";
|
|
2
|
+
import { d as define_property } from "./context.js";
|
|
3
|
+
const all_registered_events = /* @__PURE__ */ new Set();
|
|
4
|
+
const root_event_handles = /* @__PURE__ */ new Set();
|
|
5
|
+
function create_event(event_name, dom, handler, options = {}) {
|
|
6
|
+
function target_handler(event) {
|
|
7
|
+
if (!options.capture) {
|
|
8
|
+
handle_event_propagation.call(dom, event);
|
|
9
|
+
}
|
|
10
|
+
if (!event.cancelBubble) {
|
|
11
|
+
return without_reactive_context(() => {
|
|
12
|
+
return handler?.call(this, event);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
if (event_name.startsWith("pointer") || event_name.startsWith("touch") || event_name === "wheel") {
|
|
17
|
+
queue_micro_task(() => {
|
|
18
|
+
dom.addEventListener(event_name, target_handler, options);
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
dom.addEventListener(event_name, target_handler, options);
|
|
22
|
+
}
|
|
23
|
+
return target_handler;
|
|
24
|
+
}
|
|
25
|
+
function on(element, type, handler, options = {}) {
|
|
26
|
+
var target_handler = create_event(type, element, handler, options);
|
|
27
|
+
return () => {
|
|
28
|
+
element.removeEventListener(type, target_handler, options);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
let last_propagated_event = null;
|
|
32
|
+
function handle_event_propagation(event) {
|
|
33
|
+
var handler_element = this;
|
|
34
|
+
var owner_document = (
|
|
35
|
+
/** @type {Node} */
|
|
36
|
+
handler_element.ownerDocument
|
|
37
|
+
);
|
|
38
|
+
var event_name = event.type;
|
|
39
|
+
var path = event.composedPath?.() || [];
|
|
40
|
+
var current_target = (
|
|
41
|
+
/** @type {null | Element} */
|
|
42
|
+
path[0] || event.target
|
|
43
|
+
);
|
|
44
|
+
last_propagated_event = event;
|
|
45
|
+
var path_idx = 0;
|
|
46
|
+
var handled_at = last_propagated_event === event && event.__root;
|
|
47
|
+
if (handled_at) {
|
|
48
|
+
var at_idx = path.indexOf(handled_at);
|
|
49
|
+
if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */
|
|
50
|
+
window)) {
|
|
51
|
+
event.__root = handler_element;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
var handler_idx = path.indexOf(handler_element);
|
|
55
|
+
if (handler_idx === -1) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (at_idx <= handler_idx) {
|
|
59
|
+
path_idx = at_idx;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
current_target = /** @type {Element} */
|
|
63
|
+
path[path_idx] || event.target;
|
|
64
|
+
if (current_target === handler_element) return;
|
|
65
|
+
define_property(event, "currentTarget", {
|
|
66
|
+
configurable: true,
|
|
67
|
+
get() {
|
|
68
|
+
return current_target || owner_document;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
var previous_reaction = active_reaction;
|
|
72
|
+
var previous_effect = active_effect;
|
|
73
|
+
set_active_reaction(null);
|
|
74
|
+
set_active_effect(null);
|
|
75
|
+
try {
|
|
76
|
+
var throw_error;
|
|
77
|
+
var other_errors = [];
|
|
78
|
+
while (current_target !== null) {
|
|
79
|
+
var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */
|
|
80
|
+
current_target.host || null;
|
|
81
|
+
try {
|
|
82
|
+
var delegated = current_target["__" + event_name];
|
|
83
|
+
if (delegated != null && (!/** @type {any} */
|
|
84
|
+
current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
85
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
86
|
+
event.target === current_target)) {
|
|
87
|
+
delegated.call(current_target, event);
|
|
88
|
+
}
|
|
89
|
+
} catch (error) {
|
|
90
|
+
if (throw_error) {
|
|
91
|
+
other_errors.push(error);
|
|
92
|
+
} else {
|
|
93
|
+
throw_error = error;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (event.cancelBubble || parent_element === handler_element || parent_element === null) {
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
current_target = parent_element;
|
|
100
|
+
}
|
|
101
|
+
if (throw_error) {
|
|
102
|
+
for (let error of other_errors) {
|
|
103
|
+
queueMicrotask(() => {
|
|
104
|
+
throw error;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
throw throw_error;
|
|
108
|
+
}
|
|
109
|
+
} finally {
|
|
110
|
+
event.__root = handler_element;
|
|
111
|
+
delete event.currentTarget;
|
|
112
|
+
set_active_reaction(previous_reaction);
|
|
113
|
+
set_active_effect(previous_effect);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
all_registered_events as a,
|
|
118
|
+
handle_event_propagation as h,
|
|
119
|
+
on as o,
|
|
120
|
+
root_event_handles as r
|
|
121
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
const SCHEME = /^[a-z][a-z\d+\-.]+:/i;
|
|
2
|
+
const internal = new URL("sveltekit-internal://");
|
|
3
|
+
function resolve(base, path) {
|
|
4
|
+
if (path[0] === "/" && path[1] === "/") return path;
|
|
5
|
+
let url = new URL(base, internal);
|
|
6
|
+
url = new URL(path, url);
|
|
7
|
+
return url.protocol === internal.protocol ? url.pathname + url.search + url.hash : url.href;
|
|
8
|
+
}
|
|
9
|
+
function normalize_path(path, trailing_slash) {
|
|
10
|
+
if (path === "/" || trailing_slash === "ignore") return path;
|
|
11
|
+
if (trailing_slash === "never") {
|
|
12
|
+
return path.endsWith("/") ? path.slice(0, -1) : path;
|
|
13
|
+
} else if (trailing_slash === "always" && !path.endsWith("/")) {
|
|
14
|
+
return path + "/";
|
|
15
|
+
}
|
|
16
|
+
return path;
|
|
17
|
+
}
|
|
18
|
+
function decode_pathname(pathname) {
|
|
19
|
+
return pathname.split("%25").map(decodeURI).join("%25");
|
|
20
|
+
}
|
|
21
|
+
function decode_params(params) {
|
|
22
|
+
for (const key in params) {
|
|
23
|
+
params[key] = decodeURIComponent(params[key]);
|
|
24
|
+
}
|
|
25
|
+
return params;
|
|
26
|
+
}
|
|
27
|
+
function make_trackable(url, callback, search_params_callback, allow_hash = false) {
|
|
28
|
+
const tracked = new URL(url);
|
|
29
|
+
Object.defineProperty(tracked, "searchParams", {
|
|
30
|
+
value: new Proxy(tracked.searchParams, {
|
|
31
|
+
get(obj, key) {
|
|
32
|
+
if (key === "get" || key === "getAll" || key === "has") {
|
|
33
|
+
return (param, ...rest) => {
|
|
34
|
+
search_params_callback(param);
|
|
35
|
+
return obj[key](param, ...rest);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
callback();
|
|
39
|
+
const value = Reflect.get(obj, key);
|
|
40
|
+
return typeof value === "function" ? value.bind(obj) : value;
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true
|
|
45
|
+
});
|
|
46
|
+
const tracked_url_properties = ["href", "pathname", "search", "toString", "toJSON"];
|
|
47
|
+
if (allow_hash) tracked_url_properties.push("hash");
|
|
48
|
+
for (const property of tracked_url_properties) {
|
|
49
|
+
Object.defineProperty(tracked, property, {
|
|
50
|
+
get() {
|
|
51
|
+
callback();
|
|
52
|
+
return url[property];
|
|
53
|
+
},
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
{
|
|
59
|
+
tracked[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
|
|
60
|
+
return inspect(url, opts);
|
|
61
|
+
};
|
|
62
|
+
tracked.searchParams[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
|
|
63
|
+
return inspect(url.searchParams, opts);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (!allow_hash) {
|
|
67
|
+
disable_hash(tracked);
|
|
68
|
+
}
|
|
69
|
+
return tracked;
|
|
70
|
+
}
|
|
71
|
+
function disable_hash(url) {
|
|
72
|
+
allow_nodejs_console_log(url);
|
|
73
|
+
Object.defineProperty(url, "hash", {
|
|
74
|
+
get() {
|
|
75
|
+
throw new Error(
|
|
76
|
+
"Cannot access event.url.hash. Consider using `page.url.hash` inside a component instead"
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function disable_search(url) {
|
|
82
|
+
allow_nodejs_console_log(url);
|
|
83
|
+
for (const property of ["search", "searchParams"]) {
|
|
84
|
+
Object.defineProperty(url, property, {
|
|
85
|
+
get() {
|
|
86
|
+
throw new Error(`Cannot access url.${property} on a page with prerendering enabled`);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function allow_nodejs_console_log(url) {
|
|
92
|
+
{
|
|
93
|
+
url[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = (depth, opts, inspect) => {
|
|
94
|
+
return inspect(new URL(url), opts);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function validator(expected) {
|
|
99
|
+
function validate(module, file) {
|
|
100
|
+
if (!module) return;
|
|
101
|
+
for (const key in module) {
|
|
102
|
+
if (key[0] === "_" || expected.has(key)) continue;
|
|
103
|
+
const values = [...expected.values()];
|
|
104
|
+
const hint = hint_for_supported_files(key, file?.slice(file.lastIndexOf("."))) ?? `valid exports are ${values.join(", ")}, or anything with a '_' prefix`;
|
|
105
|
+
throw new Error(`Invalid export '${key}'${file ? ` in ${file}` : ""} (${hint})`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return validate;
|
|
109
|
+
}
|
|
110
|
+
function hint_for_supported_files(key, ext = ".js") {
|
|
111
|
+
const supported_files = [];
|
|
112
|
+
if (valid_layout_exports.has(key)) {
|
|
113
|
+
supported_files.push(`+layout${ext}`);
|
|
114
|
+
}
|
|
115
|
+
if (valid_page_exports.has(key)) {
|
|
116
|
+
supported_files.push(`+page${ext}`);
|
|
117
|
+
}
|
|
118
|
+
if (valid_layout_server_exports.has(key)) {
|
|
119
|
+
supported_files.push(`+layout.server${ext}`);
|
|
120
|
+
}
|
|
121
|
+
if (valid_page_server_exports.has(key)) {
|
|
122
|
+
supported_files.push(`+page.server${ext}`);
|
|
123
|
+
}
|
|
124
|
+
if (valid_server_exports.has(key)) {
|
|
125
|
+
supported_files.push(`+server${ext}`);
|
|
126
|
+
}
|
|
127
|
+
if (supported_files.length > 0) {
|
|
128
|
+
return `'${key}' is a valid export in ${supported_files.slice(0, -1).join(", ")}${supported_files.length > 1 ? " or " : ""}${supported_files.at(-1)}`;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const valid_layout_exports = /* @__PURE__ */ new Set([
|
|
132
|
+
"load",
|
|
133
|
+
"prerender",
|
|
134
|
+
"csr",
|
|
135
|
+
"ssr",
|
|
136
|
+
"trailingSlash",
|
|
137
|
+
"config"
|
|
138
|
+
]);
|
|
139
|
+
const valid_page_exports = /* @__PURE__ */ new Set([...valid_layout_exports, "entries"]);
|
|
140
|
+
const valid_layout_server_exports = /* @__PURE__ */ new Set([...valid_layout_exports]);
|
|
141
|
+
const valid_page_server_exports = /* @__PURE__ */ new Set([...valid_layout_server_exports, "actions", "entries"]);
|
|
142
|
+
const valid_server_exports = /* @__PURE__ */ new Set([
|
|
143
|
+
"GET",
|
|
144
|
+
"POST",
|
|
145
|
+
"PATCH",
|
|
146
|
+
"PUT",
|
|
147
|
+
"DELETE",
|
|
148
|
+
"OPTIONS",
|
|
149
|
+
"HEAD",
|
|
150
|
+
"fallback",
|
|
151
|
+
"prerender",
|
|
152
|
+
"trailingSlash",
|
|
153
|
+
"config",
|
|
154
|
+
"entries"
|
|
155
|
+
]);
|
|
156
|
+
const validate_layout_exports = validator(valid_layout_exports);
|
|
157
|
+
const validate_page_exports = validator(valid_page_exports);
|
|
158
|
+
const validate_layout_server_exports = validator(valid_layout_server_exports);
|
|
159
|
+
const validate_page_server_exports = validator(valid_page_server_exports);
|
|
160
|
+
const validate_server_exports = validator(valid_server_exports);
|
|
161
|
+
export {
|
|
162
|
+
SCHEME as S,
|
|
163
|
+
decode_params as a,
|
|
164
|
+
validate_layout_exports as b,
|
|
165
|
+
validate_page_server_exports as c,
|
|
166
|
+
disable_search as d,
|
|
167
|
+
validate_page_exports as e,
|
|
168
|
+
decode_pathname as f,
|
|
169
|
+
validate_server_exports as g,
|
|
170
|
+
make_trackable as m,
|
|
171
|
+
normalize_path as n,
|
|
172
|
+
resolve as r,
|
|
173
|
+
validate_layout_server_exports as v
|
|
174
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { n as noop, j as safe_not_equal } from "./context.js";
|
|
2
|
+
import "clsx";
|
|
3
|
+
const subscriber_queue = [];
|
|
4
|
+
function readable(value, start) {
|
|
5
|
+
return {
|
|
6
|
+
subscribe: writable(value, start).subscribe
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function writable(value, start = noop) {
|
|
10
|
+
let stop = null;
|
|
11
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
12
|
+
function set(new_value) {
|
|
13
|
+
if (safe_not_equal(value, new_value)) {
|
|
14
|
+
value = new_value;
|
|
15
|
+
if (stop) {
|
|
16
|
+
const run_queue = !subscriber_queue.length;
|
|
17
|
+
for (const subscriber of subscribers) {
|
|
18
|
+
subscriber[1]();
|
|
19
|
+
subscriber_queue.push(subscriber, value);
|
|
20
|
+
}
|
|
21
|
+
if (run_queue) {
|
|
22
|
+
for (let i = 0; i < subscriber_queue.length; i += 2) {
|
|
23
|
+
subscriber_queue[i][0](subscriber_queue[i + 1]);
|
|
24
|
+
}
|
|
25
|
+
subscriber_queue.length = 0;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function update(fn) {
|
|
31
|
+
set(fn(
|
|
32
|
+
/** @type {T} */
|
|
33
|
+
value
|
|
34
|
+
));
|
|
35
|
+
}
|
|
36
|
+
function subscribe(run, invalidate = noop) {
|
|
37
|
+
const subscriber = [run, invalidate];
|
|
38
|
+
subscribers.add(subscriber);
|
|
39
|
+
if (subscribers.size === 1) {
|
|
40
|
+
stop = start(set, update) || noop;
|
|
41
|
+
}
|
|
42
|
+
run(
|
|
43
|
+
/** @type {T} */
|
|
44
|
+
value
|
|
45
|
+
);
|
|
46
|
+
return () => {
|
|
47
|
+
subscribers.delete(subscriber);
|
|
48
|
+
if (subscribers.size === 0 && stop) {
|
|
49
|
+
stop();
|
|
50
|
+
stop = null;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return { set, update, subscribe };
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
readable as r,
|
|
58
|
+
writable as w
|
|
59
|
+
};
|