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,744 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/handler.ts
|
|
3
|
+
import { manifest, base, prerendered } from "./server/manifest.js";
|
|
4
|
+
import { Server } from "./server/index.js";
|
|
5
|
+
import { env } from "./env.js";
|
|
6
|
+
import { existsSync } from "fs";
|
|
7
|
+
|
|
8
|
+
// node_modules/sirv/src/index.ts
|
|
9
|
+
import { resolve as resolve2 } from "path";
|
|
10
|
+
|
|
11
|
+
// node_modules/totalist/sync/index.mjs
|
|
12
|
+
import { join, resolve } from "path";
|
|
13
|
+
import { readdirSync, statSync } from "fs";
|
|
14
|
+
function totalist(dir, callback, pre = "") {
|
|
15
|
+
dir = resolve(".", dir);
|
|
16
|
+
let arr = readdirSync(dir);
|
|
17
|
+
let i = 0, abs, stats;
|
|
18
|
+
for (;i < arr.length; i++) {
|
|
19
|
+
abs = join(dir, arr[i]);
|
|
20
|
+
stats = statSync(abs);
|
|
21
|
+
stats.isDirectory() ? totalist(abs, callback, join(pre, arr[i])) : callback(join(pre, arr[i]), abs, stats);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// node_modules/mrmime/index.mjs
|
|
26
|
+
var mimes = {
|
|
27
|
+
"3g2": "video/3gpp2",
|
|
28
|
+
"3gp": "video/3gpp",
|
|
29
|
+
"3gpp": "video/3gpp",
|
|
30
|
+
"3mf": "model/3mf",
|
|
31
|
+
aac: "audio/aac",
|
|
32
|
+
ac: "application/pkix-attr-cert",
|
|
33
|
+
adp: "audio/adpcm",
|
|
34
|
+
adts: "audio/aac",
|
|
35
|
+
ai: "application/postscript",
|
|
36
|
+
aml: "application/automationml-aml+xml",
|
|
37
|
+
amlx: "application/automationml-amlx+zip",
|
|
38
|
+
amr: "audio/amr",
|
|
39
|
+
apng: "image/apng",
|
|
40
|
+
appcache: "text/cache-manifest",
|
|
41
|
+
appinstaller: "application/appinstaller",
|
|
42
|
+
appx: "application/appx",
|
|
43
|
+
appxbundle: "application/appxbundle",
|
|
44
|
+
asc: "application/pgp-keys",
|
|
45
|
+
atom: "application/atom+xml",
|
|
46
|
+
atomcat: "application/atomcat+xml",
|
|
47
|
+
atomdeleted: "application/atomdeleted+xml",
|
|
48
|
+
atomsvc: "application/atomsvc+xml",
|
|
49
|
+
au: "audio/basic",
|
|
50
|
+
avci: "image/avci",
|
|
51
|
+
avcs: "image/avcs",
|
|
52
|
+
avif: "image/avif",
|
|
53
|
+
aw: "application/applixware",
|
|
54
|
+
bdoc: "application/bdoc",
|
|
55
|
+
bin: "application/octet-stream",
|
|
56
|
+
bmp: "image/bmp",
|
|
57
|
+
bpk: "application/octet-stream",
|
|
58
|
+
btf: "image/prs.btif",
|
|
59
|
+
btif: "image/prs.btif",
|
|
60
|
+
buffer: "application/octet-stream",
|
|
61
|
+
ccxml: "application/ccxml+xml",
|
|
62
|
+
cdfx: "application/cdfx+xml",
|
|
63
|
+
cdmia: "application/cdmi-capability",
|
|
64
|
+
cdmic: "application/cdmi-container",
|
|
65
|
+
cdmid: "application/cdmi-domain",
|
|
66
|
+
cdmio: "application/cdmi-object",
|
|
67
|
+
cdmiq: "application/cdmi-queue",
|
|
68
|
+
cer: "application/pkix-cert",
|
|
69
|
+
cgm: "image/cgm",
|
|
70
|
+
cjs: "application/node",
|
|
71
|
+
class: "application/java-vm",
|
|
72
|
+
coffee: "text/coffeescript",
|
|
73
|
+
conf: "text/plain",
|
|
74
|
+
cpl: "application/cpl+xml",
|
|
75
|
+
cpt: "application/mac-compactpro",
|
|
76
|
+
crl: "application/pkix-crl",
|
|
77
|
+
css: "text/css",
|
|
78
|
+
csv: "text/csv",
|
|
79
|
+
cu: "application/cu-seeme",
|
|
80
|
+
cwl: "application/cwl",
|
|
81
|
+
cww: "application/prs.cww",
|
|
82
|
+
davmount: "application/davmount+xml",
|
|
83
|
+
dbk: "application/docbook+xml",
|
|
84
|
+
deb: "application/octet-stream",
|
|
85
|
+
def: "text/plain",
|
|
86
|
+
deploy: "application/octet-stream",
|
|
87
|
+
dib: "image/bmp",
|
|
88
|
+
"disposition-notification": "message/disposition-notification",
|
|
89
|
+
dist: "application/octet-stream",
|
|
90
|
+
distz: "application/octet-stream",
|
|
91
|
+
dll: "application/octet-stream",
|
|
92
|
+
dmg: "application/octet-stream",
|
|
93
|
+
dms: "application/octet-stream",
|
|
94
|
+
doc: "application/msword",
|
|
95
|
+
dot: "application/msword",
|
|
96
|
+
dpx: "image/dpx",
|
|
97
|
+
drle: "image/dicom-rle",
|
|
98
|
+
dsc: "text/prs.lines.tag",
|
|
99
|
+
dssc: "application/dssc+der",
|
|
100
|
+
dtd: "application/xml-dtd",
|
|
101
|
+
dump: "application/octet-stream",
|
|
102
|
+
dwd: "application/atsc-dwd+xml",
|
|
103
|
+
ear: "application/java-archive",
|
|
104
|
+
ecma: "application/ecmascript",
|
|
105
|
+
elc: "application/octet-stream",
|
|
106
|
+
emf: "image/emf",
|
|
107
|
+
eml: "message/rfc822",
|
|
108
|
+
emma: "application/emma+xml",
|
|
109
|
+
emotionml: "application/emotionml+xml",
|
|
110
|
+
eps: "application/postscript",
|
|
111
|
+
epub: "application/epub+zip",
|
|
112
|
+
exe: "application/octet-stream",
|
|
113
|
+
exi: "application/exi",
|
|
114
|
+
exp: "application/express",
|
|
115
|
+
exr: "image/aces",
|
|
116
|
+
ez: "application/andrew-inset",
|
|
117
|
+
fdf: "application/fdf",
|
|
118
|
+
fdt: "application/fdt+xml",
|
|
119
|
+
fits: "image/fits",
|
|
120
|
+
g3: "image/g3fax",
|
|
121
|
+
gbr: "application/rpki-ghostbusters",
|
|
122
|
+
geojson: "application/geo+json",
|
|
123
|
+
gif: "image/gif",
|
|
124
|
+
glb: "model/gltf-binary",
|
|
125
|
+
gltf: "model/gltf+json",
|
|
126
|
+
gml: "application/gml+xml",
|
|
127
|
+
gpx: "application/gpx+xml",
|
|
128
|
+
gram: "application/srgs",
|
|
129
|
+
grxml: "application/srgs+xml",
|
|
130
|
+
gxf: "application/gxf",
|
|
131
|
+
gz: "application/gzip",
|
|
132
|
+
h261: "video/h261",
|
|
133
|
+
h263: "video/h263",
|
|
134
|
+
h264: "video/h264",
|
|
135
|
+
heic: "image/heic",
|
|
136
|
+
heics: "image/heic-sequence",
|
|
137
|
+
heif: "image/heif",
|
|
138
|
+
heifs: "image/heif-sequence",
|
|
139
|
+
hej2: "image/hej2k",
|
|
140
|
+
held: "application/atsc-held+xml",
|
|
141
|
+
hjson: "application/hjson",
|
|
142
|
+
hlp: "application/winhlp",
|
|
143
|
+
hqx: "application/mac-binhex40",
|
|
144
|
+
hsj2: "image/hsj2",
|
|
145
|
+
htm: "text/html",
|
|
146
|
+
html: "text/html",
|
|
147
|
+
ics: "text/calendar",
|
|
148
|
+
ief: "image/ief",
|
|
149
|
+
ifb: "text/calendar",
|
|
150
|
+
iges: "model/iges",
|
|
151
|
+
igs: "model/iges",
|
|
152
|
+
img: "application/octet-stream",
|
|
153
|
+
in: "text/plain",
|
|
154
|
+
ini: "text/plain",
|
|
155
|
+
ink: "application/inkml+xml",
|
|
156
|
+
inkml: "application/inkml+xml",
|
|
157
|
+
ipfix: "application/ipfix",
|
|
158
|
+
iso: "application/octet-stream",
|
|
159
|
+
its: "application/its+xml",
|
|
160
|
+
jade: "text/jade",
|
|
161
|
+
jar: "application/java-archive",
|
|
162
|
+
jhc: "image/jphc",
|
|
163
|
+
jls: "image/jls",
|
|
164
|
+
jp2: "image/jp2",
|
|
165
|
+
jpe: "image/jpeg",
|
|
166
|
+
jpeg: "image/jpeg",
|
|
167
|
+
jpf: "image/jpx",
|
|
168
|
+
jpg: "image/jpeg",
|
|
169
|
+
jpg2: "image/jp2",
|
|
170
|
+
jpgm: "image/jpm",
|
|
171
|
+
jpgv: "video/jpeg",
|
|
172
|
+
jph: "image/jph",
|
|
173
|
+
jpm: "image/jpm",
|
|
174
|
+
jpx: "image/jpx",
|
|
175
|
+
js: "text/javascript",
|
|
176
|
+
json: "application/json",
|
|
177
|
+
json5: "application/json5",
|
|
178
|
+
jsonld: "application/ld+json",
|
|
179
|
+
jsonml: "application/jsonml+json",
|
|
180
|
+
jsx: "text/jsx",
|
|
181
|
+
jt: "model/jt",
|
|
182
|
+
jxl: "image/jxl",
|
|
183
|
+
jxr: "image/jxr",
|
|
184
|
+
jxra: "image/jxra",
|
|
185
|
+
jxrs: "image/jxrs",
|
|
186
|
+
jxs: "image/jxs",
|
|
187
|
+
jxsc: "image/jxsc",
|
|
188
|
+
jxsi: "image/jxsi",
|
|
189
|
+
jxss: "image/jxss",
|
|
190
|
+
kar: "audio/midi",
|
|
191
|
+
ktx: "image/ktx",
|
|
192
|
+
ktx2: "image/ktx2",
|
|
193
|
+
less: "text/less",
|
|
194
|
+
lgr: "application/lgr+xml",
|
|
195
|
+
list: "text/plain",
|
|
196
|
+
litcoffee: "text/coffeescript",
|
|
197
|
+
log: "text/plain",
|
|
198
|
+
lostxml: "application/lost+xml",
|
|
199
|
+
lrf: "application/octet-stream",
|
|
200
|
+
m1v: "video/mpeg",
|
|
201
|
+
m21: "application/mp21",
|
|
202
|
+
m2a: "audio/mpeg",
|
|
203
|
+
m2t: "video/mp2t",
|
|
204
|
+
m2ts: "video/mp2t",
|
|
205
|
+
m2v: "video/mpeg",
|
|
206
|
+
m3a: "audio/mpeg",
|
|
207
|
+
m4a: "audio/mp4",
|
|
208
|
+
m4p: "application/mp4",
|
|
209
|
+
m4s: "video/iso.segment",
|
|
210
|
+
ma: "application/mathematica",
|
|
211
|
+
mads: "application/mads+xml",
|
|
212
|
+
maei: "application/mmt-aei+xml",
|
|
213
|
+
man: "text/troff",
|
|
214
|
+
manifest: "text/cache-manifest",
|
|
215
|
+
map: "application/json",
|
|
216
|
+
mar: "application/octet-stream",
|
|
217
|
+
markdown: "text/markdown",
|
|
218
|
+
mathml: "application/mathml+xml",
|
|
219
|
+
mb: "application/mathematica",
|
|
220
|
+
mbox: "application/mbox",
|
|
221
|
+
md: "text/markdown",
|
|
222
|
+
mdx: "text/mdx",
|
|
223
|
+
me: "text/troff",
|
|
224
|
+
mesh: "model/mesh",
|
|
225
|
+
meta4: "application/metalink4+xml",
|
|
226
|
+
metalink: "application/metalink+xml",
|
|
227
|
+
mets: "application/mets+xml",
|
|
228
|
+
mft: "application/rpki-manifest",
|
|
229
|
+
mid: "audio/midi",
|
|
230
|
+
midi: "audio/midi",
|
|
231
|
+
mime: "message/rfc822",
|
|
232
|
+
mj2: "video/mj2",
|
|
233
|
+
mjp2: "video/mj2",
|
|
234
|
+
mjs: "text/javascript",
|
|
235
|
+
mml: "text/mathml",
|
|
236
|
+
mods: "application/mods+xml",
|
|
237
|
+
mov: "video/quicktime",
|
|
238
|
+
mp2: "audio/mpeg",
|
|
239
|
+
mp21: "application/mp21",
|
|
240
|
+
mp2a: "audio/mpeg",
|
|
241
|
+
mp3: "audio/mpeg",
|
|
242
|
+
mp4: "video/mp4",
|
|
243
|
+
mp4a: "audio/mp4",
|
|
244
|
+
mp4s: "application/mp4",
|
|
245
|
+
mp4v: "video/mp4",
|
|
246
|
+
mpd: "application/dash+xml",
|
|
247
|
+
mpe: "video/mpeg",
|
|
248
|
+
mpeg: "video/mpeg",
|
|
249
|
+
mpf: "application/media-policy-dataset+xml",
|
|
250
|
+
mpg: "video/mpeg",
|
|
251
|
+
mpg4: "video/mp4",
|
|
252
|
+
mpga: "audio/mpeg",
|
|
253
|
+
mpp: "application/dash-patch+xml",
|
|
254
|
+
mrc: "application/marc",
|
|
255
|
+
mrcx: "application/marcxml+xml",
|
|
256
|
+
ms: "text/troff",
|
|
257
|
+
mscml: "application/mediaservercontrol+xml",
|
|
258
|
+
msh: "model/mesh",
|
|
259
|
+
msi: "application/octet-stream",
|
|
260
|
+
msix: "application/msix",
|
|
261
|
+
msixbundle: "application/msixbundle",
|
|
262
|
+
msm: "application/octet-stream",
|
|
263
|
+
msp: "application/octet-stream",
|
|
264
|
+
mtl: "model/mtl",
|
|
265
|
+
mts: "video/mp2t",
|
|
266
|
+
musd: "application/mmt-usd+xml",
|
|
267
|
+
mxf: "application/mxf",
|
|
268
|
+
mxmf: "audio/mobile-xmf",
|
|
269
|
+
mxml: "application/xv+xml",
|
|
270
|
+
n3: "text/n3",
|
|
271
|
+
nb: "application/mathematica",
|
|
272
|
+
nq: "application/n-quads",
|
|
273
|
+
nt: "application/n-triples",
|
|
274
|
+
obj: "model/obj",
|
|
275
|
+
oda: "application/oda",
|
|
276
|
+
oga: "audio/ogg",
|
|
277
|
+
ogg: "audio/ogg",
|
|
278
|
+
ogv: "video/ogg",
|
|
279
|
+
ogx: "application/ogg",
|
|
280
|
+
omdoc: "application/omdoc+xml",
|
|
281
|
+
onepkg: "application/onenote",
|
|
282
|
+
onetmp: "application/onenote",
|
|
283
|
+
onetoc: "application/onenote",
|
|
284
|
+
onetoc2: "application/onenote",
|
|
285
|
+
opf: "application/oebps-package+xml",
|
|
286
|
+
opus: "audio/ogg",
|
|
287
|
+
otf: "font/otf",
|
|
288
|
+
owl: "application/rdf+xml",
|
|
289
|
+
oxps: "application/oxps",
|
|
290
|
+
p10: "application/pkcs10",
|
|
291
|
+
p7c: "application/pkcs7-mime",
|
|
292
|
+
p7m: "application/pkcs7-mime",
|
|
293
|
+
p7s: "application/pkcs7-signature",
|
|
294
|
+
p8: "application/pkcs8",
|
|
295
|
+
pdf: "application/pdf",
|
|
296
|
+
pfr: "application/font-tdpfr",
|
|
297
|
+
pgp: "application/pgp-encrypted",
|
|
298
|
+
pkg: "application/octet-stream",
|
|
299
|
+
pki: "application/pkixcmp",
|
|
300
|
+
pkipath: "application/pkix-pkipath",
|
|
301
|
+
pls: "application/pls+xml",
|
|
302
|
+
png: "image/png",
|
|
303
|
+
prc: "model/prc",
|
|
304
|
+
prf: "application/pics-rules",
|
|
305
|
+
provx: "application/provenance+xml",
|
|
306
|
+
ps: "application/postscript",
|
|
307
|
+
pskcxml: "application/pskc+xml",
|
|
308
|
+
pti: "image/prs.pti",
|
|
309
|
+
qt: "video/quicktime",
|
|
310
|
+
raml: "application/raml+yaml",
|
|
311
|
+
rapd: "application/route-apd+xml",
|
|
312
|
+
rdf: "application/rdf+xml",
|
|
313
|
+
relo: "application/p2p-overlay+xml",
|
|
314
|
+
rif: "application/reginfo+xml",
|
|
315
|
+
rl: "application/resource-lists+xml",
|
|
316
|
+
rld: "application/resource-lists-diff+xml",
|
|
317
|
+
rmi: "audio/midi",
|
|
318
|
+
rnc: "application/relax-ng-compact-syntax",
|
|
319
|
+
rng: "application/xml",
|
|
320
|
+
roa: "application/rpki-roa",
|
|
321
|
+
roff: "text/troff",
|
|
322
|
+
rq: "application/sparql-query",
|
|
323
|
+
rs: "application/rls-services+xml",
|
|
324
|
+
rsat: "application/atsc-rsat+xml",
|
|
325
|
+
rsd: "application/rsd+xml",
|
|
326
|
+
rsheet: "application/urc-ressheet+xml",
|
|
327
|
+
rss: "application/rss+xml",
|
|
328
|
+
rtf: "text/rtf",
|
|
329
|
+
rtx: "text/richtext",
|
|
330
|
+
rusd: "application/route-usd+xml",
|
|
331
|
+
s3m: "audio/s3m",
|
|
332
|
+
sbml: "application/sbml+xml",
|
|
333
|
+
scq: "application/scvp-cv-request",
|
|
334
|
+
scs: "application/scvp-cv-response",
|
|
335
|
+
sdp: "application/sdp",
|
|
336
|
+
senmlx: "application/senml+xml",
|
|
337
|
+
sensmlx: "application/sensml+xml",
|
|
338
|
+
ser: "application/java-serialized-object",
|
|
339
|
+
setpay: "application/set-payment-initiation",
|
|
340
|
+
setreg: "application/set-registration-initiation",
|
|
341
|
+
sgi: "image/sgi",
|
|
342
|
+
sgm: "text/sgml",
|
|
343
|
+
sgml: "text/sgml",
|
|
344
|
+
shex: "text/shex",
|
|
345
|
+
shf: "application/shf+xml",
|
|
346
|
+
shtml: "text/html",
|
|
347
|
+
sieve: "application/sieve",
|
|
348
|
+
sig: "application/pgp-signature",
|
|
349
|
+
sil: "audio/silk",
|
|
350
|
+
silo: "model/mesh",
|
|
351
|
+
siv: "application/sieve",
|
|
352
|
+
slim: "text/slim",
|
|
353
|
+
slm: "text/slim",
|
|
354
|
+
sls: "application/route-s-tsid+xml",
|
|
355
|
+
smi: "application/smil+xml",
|
|
356
|
+
smil: "application/smil+xml",
|
|
357
|
+
snd: "audio/basic",
|
|
358
|
+
so: "application/octet-stream",
|
|
359
|
+
spdx: "text/spdx",
|
|
360
|
+
spp: "application/scvp-vp-response",
|
|
361
|
+
spq: "application/scvp-vp-request",
|
|
362
|
+
spx: "audio/ogg",
|
|
363
|
+
sql: "application/sql",
|
|
364
|
+
sru: "application/sru+xml",
|
|
365
|
+
srx: "application/sparql-results+xml",
|
|
366
|
+
ssdl: "application/ssdl+xml",
|
|
367
|
+
ssml: "application/ssml+xml",
|
|
368
|
+
stk: "application/hyperstudio",
|
|
369
|
+
stl: "model/stl",
|
|
370
|
+
stpx: "model/step+xml",
|
|
371
|
+
stpxz: "model/step-xml+zip",
|
|
372
|
+
stpz: "model/step+zip",
|
|
373
|
+
styl: "text/stylus",
|
|
374
|
+
stylus: "text/stylus",
|
|
375
|
+
svg: "image/svg+xml",
|
|
376
|
+
svgz: "image/svg+xml",
|
|
377
|
+
swidtag: "application/swid+xml",
|
|
378
|
+
t: "text/troff",
|
|
379
|
+
t38: "image/t38",
|
|
380
|
+
td: "application/urc-targetdesc+xml",
|
|
381
|
+
tei: "application/tei+xml",
|
|
382
|
+
teicorpus: "application/tei+xml",
|
|
383
|
+
text: "text/plain",
|
|
384
|
+
tfi: "application/thraud+xml",
|
|
385
|
+
tfx: "image/tiff-fx",
|
|
386
|
+
tif: "image/tiff",
|
|
387
|
+
tiff: "image/tiff",
|
|
388
|
+
toml: "application/toml",
|
|
389
|
+
tr: "text/troff",
|
|
390
|
+
trig: "application/trig",
|
|
391
|
+
ts: "video/mp2t",
|
|
392
|
+
tsd: "application/timestamped-data",
|
|
393
|
+
tsv: "text/tab-separated-values",
|
|
394
|
+
ttc: "font/collection",
|
|
395
|
+
ttf: "font/ttf",
|
|
396
|
+
ttl: "text/turtle",
|
|
397
|
+
ttml: "application/ttml+xml",
|
|
398
|
+
txt: "text/plain",
|
|
399
|
+
u3d: "model/u3d",
|
|
400
|
+
u8dsn: "message/global-delivery-status",
|
|
401
|
+
u8hdr: "message/global-headers",
|
|
402
|
+
u8mdn: "message/global-disposition-notification",
|
|
403
|
+
u8msg: "message/global",
|
|
404
|
+
ubj: "application/ubjson",
|
|
405
|
+
uri: "text/uri-list",
|
|
406
|
+
uris: "text/uri-list",
|
|
407
|
+
urls: "text/uri-list",
|
|
408
|
+
vcard: "text/vcard",
|
|
409
|
+
vrml: "model/vrml",
|
|
410
|
+
vtt: "text/vtt",
|
|
411
|
+
vxml: "application/voicexml+xml",
|
|
412
|
+
war: "application/java-archive",
|
|
413
|
+
wasm: "application/wasm",
|
|
414
|
+
wav: "audio/wav",
|
|
415
|
+
weba: "audio/webm",
|
|
416
|
+
webm: "video/webm",
|
|
417
|
+
webmanifest: "application/manifest+json",
|
|
418
|
+
webp: "image/webp",
|
|
419
|
+
wgsl: "text/wgsl",
|
|
420
|
+
wgt: "application/widget",
|
|
421
|
+
wif: "application/watcherinfo+xml",
|
|
422
|
+
wmf: "image/wmf",
|
|
423
|
+
woff: "font/woff",
|
|
424
|
+
woff2: "font/woff2",
|
|
425
|
+
wrl: "model/vrml",
|
|
426
|
+
wsdl: "application/wsdl+xml",
|
|
427
|
+
wspolicy: "application/wspolicy+xml",
|
|
428
|
+
x3d: "model/x3d+xml",
|
|
429
|
+
x3db: "model/x3d+fastinfoset",
|
|
430
|
+
x3dbz: "model/x3d+binary",
|
|
431
|
+
x3dv: "model/x3d-vrml",
|
|
432
|
+
x3dvz: "model/x3d+vrml",
|
|
433
|
+
x3dz: "model/x3d+xml",
|
|
434
|
+
xaml: "application/xaml+xml",
|
|
435
|
+
xav: "application/xcap-att+xml",
|
|
436
|
+
xca: "application/xcap-caps+xml",
|
|
437
|
+
xcs: "application/calendar+xml",
|
|
438
|
+
xdf: "application/xcap-diff+xml",
|
|
439
|
+
xdssc: "application/dssc+xml",
|
|
440
|
+
xel: "application/xcap-el+xml",
|
|
441
|
+
xenc: "application/xenc+xml",
|
|
442
|
+
xer: "application/patch-ops-error+xml",
|
|
443
|
+
xfdf: "application/xfdf",
|
|
444
|
+
xht: "application/xhtml+xml",
|
|
445
|
+
xhtml: "application/xhtml+xml",
|
|
446
|
+
xhvml: "application/xv+xml",
|
|
447
|
+
xlf: "application/xliff+xml",
|
|
448
|
+
xm: "audio/xm",
|
|
449
|
+
xml: "text/xml",
|
|
450
|
+
xns: "application/xcap-ns+xml",
|
|
451
|
+
xop: "application/xop+xml",
|
|
452
|
+
xpl: "application/xproc+xml",
|
|
453
|
+
xsd: "application/xml",
|
|
454
|
+
xsf: "application/prs.xsf+xml",
|
|
455
|
+
xsl: "application/xml",
|
|
456
|
+
xslt: "application/xml",
|
|
457
|
+
xspf: "application/xspf+xml",
|
|
458
|
+
xvm: "application/xv+xml",
|
|
459
|
+
xvml: "application/xv+xml",
|
|
460
|
+
yaml: "text/yaml",
|
|
461
|
+
yang: "application/yang",
|
|
462
|
+
yin: "application/yin+xml",
|
|
463
|
+
yml: "text/yaml",
|
|
464
|
+
zip: "application/zip"
|
|
465
|
+
};
|
|
466
|
+
function lookup(extn) {
|
|
467
|
+
let tmp = ("" + extn).trim().toLowerCase();
|
|
468
|
+
let idx = tmp.lastIndexOf(".");
|
|
469
|
+
return mimes[!~idx ? tmp : tmp.substring(++idx)];
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// node_modules/sirv/src/index.ts
|
|
473
|
+
/*! MIT © Luke Edwards https://github.com/lukeed/sirv/blob/master/packages/sirv/index.js */
|
|
474
|
+
function isMatch(uri, arr) {
|
|
475
|
+
for (let i = 0;i < arr.length; i++) {
|
|
476
|
+
if (arr[i]?.test(uri))
|
|
477
|
+
return true;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
function toAssume(uri, extns) {
|
|
481
|
+
let i = 0, x, len = uri.length - 1;
|
|
482
|
+
if (uri.charCodeAt(len) === 47) {
|
|
483
|
+
uri = uri.substring(0, len);
|
|
484
|
+
}
|
|
485
|
+
const arr = [], tmp = `${uri}/index`;
|
|
486
|
+
for (;i < extns.length; i++) {
|
|
487
|
+
x = extns[i] ? `.${extns[i]}` : "";
|
|
488
|
+
if (uri)
|
|
489
|
+
arr.push(uri + x);
|
|
490
|
+
arr.push(tmp + x);
|
|
491
|
+
}
|
|
492
|
+
return arr;
|
|
493
|
+
}
|
|
494
|
+
function viaCache(cache, uri, extns) {
|
|
495
|
+
let i = 0, data, arr = toAssume(uri, extns);
|
|
496
|
+
for (;i < arr.length; i++) {
|
|
497
|
+
if (data = cache[arr[i]])
|
|
498
|
+
return data;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
function is404(req) {
|
|
502
|
+
return new Response(null, {
|
|
503
|
+
status: 404,
|
|
504
|
+
statusText: "404"
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
function send(req, data) {
|
|
508
|
+
let code = 200;
|
|
509
|
+
const opts = { end: 0, start: 0 };
|
|
510
|
+
if (req.headers.has("range")) {
|
|
511
|
+
code = 206;
|
|
512
|
+
const [x, y] = req.headers.get("range").replace("bytes=", "").split("-");
|
|
513
|
+
if (x !== undefined && y !== undefined) {
|
|
514
|
+
let end = opts.end = parseInt(y, 10) || data.stats.size - 1;
|
|
515
|
+
const start = opts.start = parseInt(x, 10) || 0;
|
|
516
|
+
if (end >= data.stats.size) {
|
|
517
|
+
end = data.stats.size - 1;
|
|
518
|
+
}
|
|
519
|
+
if (start >= data.stats.size) {
|
|
520
|
+
data.headers.set("Content-Range", `bytes */${data.stats.size}`);
|
|
521
|
+
return new Response(null, {
|
|
522
|
+
headers: data.headers,
|
|
523
|
+
status: 416
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
data.headers.set("Content-Range", `bytes ${start}-${end}/${data.stats.size}`);
|
|
527
|
+
data.headers.set("Content-Length", (end - start + 1).toString());
|
|
528
|
+
data.headers.set("Accept-Ranges", "bytes");
|
|
529
|
+
return new Response(Bun.file(data.abs).slice(opts.start, opts.end + 1), {
|
|
530
|
+
headers: data.headers,
|
|
531
|
+
status: code
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
return new Response(Bun.file(data.abs), {
|
|
536
|
+
headers: data.headers,
|
|
537
|
+
status: code
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
var ENCODING = {
|
|
541
|
+
".br": "br",
|
|
542
|
+
".gz": "gzip"
|
|
543
|
+
};
|
|
544
|
+
function toHeaders(name, stats, isEtag) {
|
|
545
|
+
const enc = ENCODING[name.slice(-3)];
|
|
546
|
+
let ctype = lookup(name.slice(0, enc ? -3 : undefined)) || "";
|
|
547
|
+
if (ctype === "text/html")
|
|
548
|
+
ctype += ";charset=utf-8";
|
|
549
|
+
const headers = new Headers({
|
|
550
|
+
"Content-Length": stats.size.toString(),
|
|
551
|
+
"Content-Type": ctype,
|
|
552
|
+
"Last-Modified": stats.mtime.toUTCString()
|
|
553
|
+
});
|
|
554
|
+
if (enc)
|
|
555
|
+
headers.set("Content-Encoding", enc);
|
|
556
|
+
if (isEtag)
|
|
557
|
+
headers.set("ETag", `W/"${stats.size}-${stats.mtime.getTime()}"`);
|
|
558
|
+
return headers;
|
|
559
|
+
}
|
|
560
|
+
function src_default(dir, opts = {}) {
|
|
561
|
+
dir = resolve2(dir || ".");
|
|
562
|
+
const isNotFound = opts.onNoMatch || is404;
|
|
563
|
+
const setHeaders = opts.setHeaders;
|
|
564
|
+
const extensions = opts.extensions || ["html", "htm"];
|
|
565
|
+
const gzips = opts.gzip && extensions.map((x) => `${x}.gz`).concat("gz");
|
|
566
|
+
const brots = opts.brotli && extensions.map((x) => `${x}.br`).concat("br");
|
|
567
|
+
const FILES = {};
|
|
568
|
+
const fallback = "/";
|
|
569
|
+
const isEtag = !!opts.etag;
|
|
570
|
+
const ignores = [];
|
|
571
|
+
if (opts.ignores !== false) {
|
|
572
|
+
ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/);
|
|
573
|
+
if (opts.dotfiles) {
|
|
574
|
+
ignores.push(/\/\.\w/);
|
|
575
|
+
} else {
|
|
576
|
+
ignores.push(/\/\.well-known/);
|
|
577
|
+
}
|
|
578
|
+
if (opts.ignores && Array.isArray(opts.ignores)) {
|
|
579
|
+
ignores.push(...opts.ignores.map((x) => new RegExp(x, "i")));
|
|
580
|
+
} else if (typeof opts.ignores === "string") {
|
|
581
|
+
ignores.push(new RegExp(opts.ignores, "i"));
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
let CacheControl = opts.maxAge != null && `public,max-age=${opts.maxAge}`;
|
|
585
|
+
if (CacheControl && opts.immutable)
|
|
586
|
+
CacheControl += ",immutable";
|
|
587
|
+
else if (CacheControl && opts.maxAge === 0)
|
|
588
|
+
CacheControl += ",must-revalidate";
|
|
589
|
+
totalist(dir, (name, abs, stats) => {
|
|
590
|
+
if (/\.well-known[\\+/]/.test(name)) {} else if (!opts.dotfiles && /(^\.|[\\+|/+]\.)/.test(name))
|
|
591
|
+
return;
|
|
592
|
+
const headers = toHeaders(name, stats, isEtag);
|
|
593
|
+
if (CacheControl)
|
|
594
|
+
headers.set("Cache-Control", CacheControl);
|
|
595
|
+
FILES["/" + name.normalize().replace(/\\+/g, "/")] = {
|
|
596
|
+
abs,
|
|
597
|
+
stats,
|
|
598
|
+
headers
|
|
599
|
+
};
|
|
600
|
+
});
|
|
601
|
+
const lookup2 = viaCache.bind(0, FILES);
|
|
602
|
+
return (req, next) => {
|
|
603
|
+
const extns = [""];
|
|
604
|
+
let pathname = new URL(req.url).pathname;
|
|
605
|
+
const val = req.headers.get("accept-encoding") || "";
|
|
606
|
+
if (gzips && val.includes("gzip"))
|
|
607
|
+
extns.unshift(...gzips);
|
|
608
|
+
if (brots && /(br|brotli)/i.test(val))
|
|
609
|
+
extns.unshift(...brots);
|
|
610
|
+
extns.push(...extensions);
|
|
611
|
+
if (pathname.indexOf("%") !== -1) {
|
|
612
|
+
try {
|
|
613
|
+
pathname = decodeURI(pathname);
|
|
614
|
+
} catch (err) {}
|
|
615
|
+
}
|
|
616
|
+
let data = lookup2(pathname, extns) || isMatch(pathname, ignores) && lookup2(fallback, extns);
|
|
617
|
+
if (!data)
|
|
618
|
+
return next ? next() : isNotFound(req);
|
|
619
|
+
if (isEtag && req.headers.get("if-none-match") === data.headers.get("ETag")) {
|
|
620
|
+
return new Response(null, {
|
|
621
|
+
status: 304
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
data = {
|
|
625
|
+
...data,
|
|
626
|
+
headers: new Headers(data.headers)
|
|
627
|
+
};
|
|
628
|
+
if (gzips || brots) {
|
|
629
|
+
data.headers.set("Vary", "Accept-Encoding");
|
|
630
|
+
}
|
|
631
|
+
if (setHeaders) {
|
|
632
|
+
data.headers = setHeaders(data.headers, pathname, data.stats);
|
|
633
|
+
}
|
|
634
|
+
return send(req, data);
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
// src/handler.ts
|
|
639
|
+
var server = new Server(manifest);
|
|
640
|
+
var { serveAssets } = {"serveAssets":true};
|
|
641
|
+
var origin = env("ORIGIN", undefined);
|
|
642
|
+
var xff_depth = parseInt(env("XFF_DEPTH", "1"), 10);
|
|
643
|
+
var address_header = env("ADDRESS_HEADER", "").toLowerCase();
|
|
644
|
+
var protocol_header = env("PROTOCOL_HEADER", "").toLowerCase();
|
|
645
|
+
var host_header = env("HOST_HEADER", "").toLowerCase();
|
|
646
|
+
var port_header = env("PORT_HEADER", "").toLowerCase();
|
|
647
|
+
var asset_dir = `${import.meta.dir}/client${base}`;
|
|
648
|
+
await server.init({
|
|
649
|
+
env: Bun.env,
|
|
650
|
+
read: (file) => Bun.file(`${asset_dir}/${file}`).stream()
|
|
651
|
+
});
|
|
652
|
+
function serve(path, client = false) {
|
|
653
|
+
if (existsSync(path)) {
|
|
654
|
+
return src_default(path, {
|
|
655
|
+
etag: true,
|
|
656
|
+
gzip: true,
|
|
657
|
+
brotli: true,
|
|
658
|
+
setHeaders: client ? (headers, pathname) => {
|
|
659
|
+
if (pathname.startsWith(`/${manifest.appDir}/immutable/`)) {
|
|
660
|
+
headers.set("cache-control", "public,max-age=31536000,immutable");
|
|
661
|
+
}
|
|
662
|
+
return headers;
|
|
663
|
+
} : undefined
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
function serve_prerendered() {
|
|
668
|
+
const handler = serve(`${import.meta.dir}/prerendered`, false);
|
|
669
|
+
return (req, next) => {
|
|
670
|
+
let { pathname, search } = new URL(req.url);
|
|
671
|
+
try {
|
|
672
|
+
pathname = decodeURIComponent(pathname);
|
|
673
|
+
} catch {}
|
|
674
|
+
if (prerendered.has(pathname)) {
|
|
675
|
+
return handler(req, next);
|
|
676
|
+
}
|
|
677
|
+
let location = pathname.at(-1) === "/" ? pathname.slice(0, -1) : pathname + "/";
|
|
678
|
+
if (prerendered.has(location)) {
|
|
679
|
+
if (search)
|
|
680
|
+
location += search;
|
|
681
|
+
return new Response(null, { status: 308, headers: { location } });
|
|
682
|
+
} else {
|
|
683
|
+
return next?.() || new Response(null, { status: 404 });
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
var ssr = async (request, bunServer) => {
|
|
688
|
+
const baseOrigin = origin || get_origin(request.headers);
|
|
689
|
+
const url = request.url.slice(request.url.split("/", 3).join("/").length);
|
|
690
|
+
const newRequest = new Request(baseOrigin + url, request);
|
|
691
|
+
return server.respond(newRequest, {
|
|
692
|
+
platform: { server: bunServer, request },
|
|
693
|
+
getClientAddress() {
|
|
694
|
+
if (address_header) {
|
|
695
|
+
if (!request.headers.has(address_header)) {
|
|
696
|
+
throw new Error(`Address header was specified with ${"" + "ADDRESS_HEADER"}=${address_header} but is absent from request`);
|
|
697
|
+
}
|
|
698
|
+
const value = request.headers.get(address_header) || "";
|
|
699
|
+
if (address_header === "x-forwarded-for") {
|
|
700
|
+
const addresses = value.split(",");
|
|
701
|
+
if (xff_depth < 1) {
|
|
702
|
+
throw new Error(`${"" + "XFF_DEPTH"} must be a positive integer`);
|
|
703
|
+
}
|
|
704
|
+
if (xff_depth > addresses.length) {
|
|
705
|
+
throw new Error(`${"" + "XFF_DEPTH"} is ${xff_depth}, but only found ${addresses.length} addresses`);
|
|
706
|
+
}
|
|
707
|
+
return addresses[addresses.length - xff_depth]?.trim() || "";
|
|
708
|
+
}
|
|
709
|
+
return value;
|
|
710
|
+
}
|
|
711
|
+
return bunServer.requestIP(request)?.address || "";
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
};
|
|
715
|
+
var getHandler = () => {
|
|
716
|
+
const websocket = server.websocket();
|
|
717
|
+
const staticHandlers = [
|
|
718
|
+
serveAssets && serve(`${import.meta.dir}/client${base}`, true),
|
|
719
|
+
serveAssets && serve_prerendered()
|
|
720
|
+
].filter(Boolean);
|
|
721
|
+
const handler = (request, server2) => {
|
|
722
|
+
function handle(i) {
|
|
723
|
+
if (i < staticHandlers.length) {
|
|
724
|
+
return staticHandlers[i](request, () => handle(i + 1));
|
|
725
|
+
} else {
|
|
726
|
+
return ssr(request, server2);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return handle(0);
|
|
730
|
+
};
|
|
731
|
+
return {
|
|
732
|
+
fetch: handler,
|
|
733
|
+
websocket
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
function get_origin(headers) {
|
|
737
|
+
const protocol = protocol_header && headers.get(protocol_header) || "https";
|
|
738
|
+
const host = host_header && headers.get(host_header) || headers.get("host");
|
|
739
|
+
const port = port_header && headers.get(port_header);
|
|
740
|
+
return port ? `${protocol}://${host}:${port}` : `${protocol}://${host}`;
|
|
741
|
+
}
|
|
742
|
+
export {
|
|
743
|
+
getHandler
|
|
744
|
+
};
|