codebay 0.0.1 → 0.2.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.
Files changed (202) hide show
  1. package/.mochi/import-css/index-0nwv3654.css +18 -0
  2. package/.mochi/import-css/index-xndx4980.css +54 -0
  3. package/.mochi/manifest.json +1608 -0
  4. package/.mochi/server-island.js +1 -0
  5. package/.mochi/svelte-client/HydratableIsland-ps09gjy2.js +1 -0
  6. package/.mochi/svelte-client/_hydrate-AppShell_2rtnxn6pgp2rh-62w5zwww.js +2 -0
  7. package/.mochi/svelte-client/_hydrate-AvatarsView_257s9yq1wwr4f-jmm501zf.js +13 -0
  8. package/.mochi/svelte-client/_hydrate-InstanceView_2ma45l9bybfhl-ewk4n2c0.js +1 -0
  9. package/.mochi/svelte-client/_hydrate-SettingsView_8hmarwmf8onq-e7e89md0.js +23 -0
  10. package/.mochi/svelte-client/chunk-jx5cekhh.js +2 -0
  11. package/.mochi/svelte-client/chunk-k3my1snp.js +2 -0
  12. package/.mochi/svelte-client/chunk-kgn1b2t1.js +4 -0
  13. package/.mochi/svelte-client/chunk-ry7q5zk5.js +1 -0
  14. package/.mochi/svelte-client/chunk-x843txjc.js +2 -0
  15. package/.mochi/svelte-client/chunk-zjcg8kw5.js +2 -0
  16. package/.mochi/svelte-compile/App-8k1gyxdc.server.js +1167 -0
  17. package/.mochi/svelte-compile/Avatars-f7c6rp96.server.js +351 -0
  18. package/.mochi/svelte-compile/ClientStats-z3tn9ad6.server.js +99 -0
  19. package/.mochi/svelte-compile/DefaultError-wh77vebf.server.js +52 -0
  20. package/.mochi/svelte-compile/Instance-yvps12zg.server.js +355 -0
  21. package/.mochi/svelte-compile/Settings-jwg3httb.server.js +1169 -0
  22. package/.mochi/svelte-compile/chunk-4kwy539a.js +14 -0
  23. package/.mochi/svelte-compile/chunk-9bjk7yx6.js +81 -0
  24. package/.mochi/svelte-compile/chunk-dqgstte4.js +52 -0
  25. package/.mochi/svelte-compile/chunk-sxqys3nw.js +1668 -0
  26. package/.mochi/svelte-compile/chunk-v6796ga4.js +3295 -0
  27. package/.mochi/svelte-compile/chunk-we0ggtws.js +34 -0
  28. package/.mochi/svelte-css/AppBar-3bxinv4pabv8l.css +1 -0
  29. package/.mochi/svelte-css/AppShell-36mpg5smnbmuw.css +1 -0
  30. package/.mochi/svelte-css/Avatar-24th63awm9mna.css +1 -0
  31. package/.mochi/svelte-css/AvatarEditor-1ryrs1md5g36y.css +1 -0
  32. package/.mochi/svelte-css/AvatarsView-3hq37u4dgtljn.css +1 -0
  33. package/.mochi/svelte-css/BackLink-2wlu0eovz9j86.css +1 -0
  34. package/.mochi/svelte-css/BranchBox-1yqu1q2mgnjwz.css +1 -0
  35. package/.mochi/svelte-css/Brand-1la7zw5uhcbl4.css +1 -0
  36. package/.mochi/svelte-css/Button-2vtbrzb5kgu25.css +1 -0
  37. package/.mochi/svelte-css/CheckmarkIcon-3qlazj2oc50jc.css +1 -0
  38. package/.mochi/svelte-css/ClientStats-19qzckq40p2q9.css +1 -0
  39. package/.mochi/svelte-css/CoinButton-1rej3sh3tkjud.css +1 -0
  40. package/.mochi/svelte-css/CredMenu-9hwgeptp7crb.css +1 -0
  41. package/.mochi/svelte-css/DashboardView-1cy4xpqhja9sx.css +1 -0
  42. package/.mochi/svelte-css/DefaultError-2b0daamydxgb2.css +1 -0
  43. package/.mochi/svelte-css/ErrorIcon-2x0tzsqxskw28.css +1 -0
  44. package/.mochi/svelte-css/FolderBrowser-1x428zb3f2kti.css +1 -0
  45. package/.mochi/svelte-css/HealthBox-er2her0jukwl.css +1 -0
  46. package/.mochi/svelte-css/IdeBar-2qoqi2ya9zdn3.css +1 -0
  47. package/.mochi/svelte-css/IdeLoader-26rlko8e00j3g.css +1 -0
  48. package/.mochi/svelte-css/InstanceCard-16f77aysm7lgp.css +1 -0
  49. package/.mochi/svelte-css/InstanceView-wq85bxtusont.css +1 -0
  50. package/.mochi/svelte-css/LoaderIcon-soq5wt3p05ye.css +1 -0
  51. package/.mochi/svelte-css/PortsBox-1t25b5yg7jva3.css +1 -0
  52. package/.mochi/svelte-css/SettingsCog-jftyadvo64qo.css +1 -0
  53. package/.mochi/svelte-css/SettingsView-3bbkzsvnrth3v.css +1 -0
  54. package/.mochi/svelte-css/Skeleton-8k69usiju43h.css +1 -0
  55. package/.mochi/svelte-css/StatusBadge-3mq0j7z6aq4j.css +1 -0
  56. package/.mochi/svelte-css/ThemePicker-1ir8jyocm8mvi.css +1 -0
  57. package/.mochi/svelte-css/ToastBar-3havgkmtofntq.css +1 -0
  58. package/.mochi/svelte-css/ToastIcon-2z5wrkc95khg0.css +1 -0
  59. package/.mochi/svelte-css/ToastMessage-2jfwb2og2lfa8.css +1 -0
  60. package/.mochi/svelte-css/ToastWrapper-1fbnym10rm2nv.css +1 -0
  61. package/.mochi/svelte-css/Toaster-kk60j193854n.css +1 -0
  62. package/.mochi/svelte-css/TopBar-2q87li6yt8ids.css +1 -0
  63. package/LICENSE +21 -0
  64. package/README.md +33 -3
  65. package/bin/codebay.ts +22 -0
  66. package/migrations/0001_init.sql +20 -0
  67. package/migrations/0002_port_forwards.sql +9 -0
  68. package/migrations/0003_options.sql +4 -0
  69. package/migrations/0004_instance_image.sql +1 -0
  70. package/package.json +87 -9
  71. package/public/sounds/done.wav +0 -0
  72. package/public/sounds/waiting.wav +0 -0
  73. package/src/__fixtures__/HelloWorld.svelte +4 -0
  74. package/src/additional-svelte-typings.d.ts +1 -0
  75. package/src/api.ts +61 -0
  76. package/src/avatars/anchor.ts +17 -0
  77. package/src/avatars/bear.ts +17 -0
  78. package/src/avatars/bee.ts +17 -0
  79. package/src/avatars/bob-marley.ts +17 -0
  80. package/src/avatars/car.ts +17 -0
  81. package/src/avatars/carpathians.ts +17 -0
  82. package/src/avatars/cat-body.ts +17 -0
  83. package/src/avatars/cat-sits.ts +17 -0
  84. package/src/avatars/cat.ts +17 -0
  85. package/src/avatars/celtic-cross.ts +17 -0
  86. package/src/avatars/cherry.ts +17 -0
  87. package/src/avatars/cotton.ts +17 -0
  88. package/src/avatars/crab.ts +17 -0
  89. package/src/avatars/crown.ts +17 -0
  90. package/src/avatars/diamond.ts +17 -0
  91. package/src/avatars/dog.ts +17 -0
  92. package/src/avatars/elephant.ts +17 -0
  93. package/src/avatars/fish.ts +17 -0
  94. package/src/avatars/fleur-de-lis.ts +17 -0
  95. package/src/avatars/flower.ts +17 -0
  96. package/src/avatars/fox.ts +17 -0
  97. package/src/avatars/frog.ts +17 -0
  98. package/src/avatars/ghost.ts +17 -0
  99. package/src/avatars/giraffe.ts +17 -0
  100. package/src/avatars/glasses.ts +17 -0
  101. package/src/avatars/heart.ts +17 -0
  102. package/src/avatars/index.ts +128 -0
  103. package/src/avatars/invader.ts +17 -0
  104. package/src/avatars/kangaroo.ts +17 -0
  105. package/src/avatars/key.ts +17 -0
  106. package/src/avatars/lightning.ts +17 -0
  107. package/src/avatars/mushroom.ts +17 -0
  108. package/src/avatars/octopus.ts +17 -0
  109. package/src/avatars/owl.ts +17 -0
  110. package/src/avatars/penguin.ts +17 -0
  111. package/src/avatars/planet.ts +17 -0
  112. package/src/avatars/rabbit.ts +17 -0
  113. package/src/avatars/rat.ts +17 -0
  114. package/src/avatars/robot.ts +17 -0
  115. package/src/avatars/rocket.ts +17 -0
  116. package/src/avatars/sea.ts +17 -0
  117. package/src/avatars/serialize.ts +65 -0
  118. package/src/avatars/skull.ts +17 -0
  119. package/src/avatars/snail.ts +17 -0
  120. package/src/avatars/snake.ts +17 -0
  121. package/src/avatars/snakegame.ts +17 -0
  122. package/src/avatars/star.ts +17 -0
  123. package/src/avatars/svelte.ts +17 -0
  124. package/src/avatars/target.ts +17 -0
  125. package/src/avatars/tree.ts +17 -0
  126. package/src/avatars/types.ts +24 -0
  127. package/src/avatars/ukraine.ts +17 -0
  128. package/src/avatars/whale.ts +17 -0
  129. package/src/avatars/wheat.ts +17 -0
  130. package/src/avatars/yinyan.ts +17 -0
  131. package/src/components/AppBar.svelte +35 -0
  132. package/src/components/AppShell.svelte +302 -0
  133. package/src/components/Avatar.svelte +235 -0
  134. package/src/components/AvatarEditor.svelte +321 -0
  135. package/src/components/AvatarsView.svelte +113 -0
  136. package/src/components/BranchBox.svelte +32 -0
  137. package/src/components/Brand.svelte +41 -0
  138. package/src/components/Button.svelte +161 -0
  139. package/src/components/CoinButton.svelte +121 -0
  140. package/src/components/CredMenu.svelte +171 -0
  141. package/src/components/DashboardView.svelte +198 -0
  142. package/src/components/FolderBrowser.svelte +635 -0
  143. package/src/components/HealthBox.svelte +161 -0
  144. package/src/components/IdeBar.svelte +186 -0
  145. package/src/components/IdeLoader.svelte +135 -0
  146. package/src/components/InstanceCard.svelte +220 -0
  147. package/src/components/InstanceView.svelte +565 -0
  148. package/src/components/PortsBox.svelte +73 -0
  149. package/src/components/SettingsCog.svelte +22 -0
  150. package/src/components/SettingsView.svelte +1484 -0
  151. package/src/components/Skeleton.svelte +43 -0
  152. package/src/components/StatusBadge.svelte +54 -0
  153. package/src/components/ThemePicker.svelte +77 -0
  154. package/src/components/TopBar.svelte +64 -0
  155. package/src/components/UiShowcase.svelte +578 -0
  156. package/src/components/ui-showcase/ComponentDemo.svelte +85 -0
  157. package/src/container-injections/attention-hooks.ts +117 -0
  158. package/src/container-injections/claude-aliases.ts +43 -0
  159. package/src/container-injections/claude-code-credentials.ts +145 -0
  160. package/src/container-injections/claude-code-custom.ts +125 -0
  161. package/src/container-injections/claude-no-coauthor.ts +35 -0
  162. package/src/container-injections/claude-skip-permissions.ts +38 -0
  163. package/src/container-injections/claude-statusline.ts +109 -0
  164. package/src/container-injections/git-identity.ts +63 -0
  165. package/src/container-injections/git-safe-directory.ts +18 -0
  166. package/src/container-injections/github-credentials.ts +162 -0
  167. package/src/container-injections/host-env-vars.ts +108 -0
  168. package/src/container-injections/tmux.ts +67 -0
  169. package/src/fontsource.d.ts +3 -0
  170. package/src/index.ts +81 -0
  171. package/src/lib/auth.server.ts +95 -0
  172. package/src/lib/bridge.server.ts +34 -0
  173. package/src/lib/config.server.ts +122 -0
  174. package/src/lib/crypto.server.ts +12 -0
  175. package/src/lib/db.server.ts +196 -0
  176. package/src/lib/devcontainer.server.ts +503 -0
  177. package/src/lib/docker-client.server.ts +61 -0
  178. package/src/lib/docker.server.ts +139 -0
  179. package/src/lib/exec.server.ts +92 -0
  180. package/src/lib/git.server.ts +68 -0
  181. package/src/lib/health.server.ts +105 -0
  182. package/src/lib/injections.server.ts +72 -0
  183. package/src/lib/instances.server.ts +552 -0
  184. package/src/lib/picker.server.ts +46 -0
  185. package/src/lib/ports.server.ts +9 -0
  186. package/src/lib/proxy.server.ts +170 -0
  187. package/src/lib/repo-url.ts +60 -0
  188. package/src/lib/spawn.server.ts +14 -0
  189. package/src/lib/theme.server.ts +22 -0
  190. package/src/live.ts +50 -0
  191. package/src/pages/App.svelte +14 -0
  192. package/src/pages/Avatars.svelte +7 -0
  193. package/src/pages/Instance.svelte +9 -0
  194. package/src/pages/Settings.svelte +73 -0
  195. package/src/pages/UI.svelte +10 -0
  196. package/src/routes.ts +440 -0
  197. package/src/settings.ts +14 -0
  198. package/src/shell.html +100 -0
  199. package/src/sound.ts +69 -0
  200. package/src/theme.ts +24 -0
  201. package/src/types.ts +79 -0
  202. package/svelte.config.js +5 -0
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ let {
3
+ variant = 'text',
4
+ width
5
+ }: {
6
+ variant?: 'text' | 'pill' | 'wide';
7
+ width?: string;
8
+ } = $props();
9
+ </script>
10
+
11
+ <span class="skel {variant}" style:width></span>
12
+
13
+ <style>
14
+ .skel {
15
+ display: inline-block;
16
+ height: 0.95em;
17
+ background: linear-gradient(
18
+ 90deg,
19
+ var(--rule-soft) 25%,
20
+ var(--bg-card) 50%,
21
+ var(--rule-soft) 75%
22
+ );
23
+ background-size: 200% 100%;
24
+ animation: shimmer 1.4s linear infinite;
25
+ vertical-align: middle;
26
+ }
27
+ .skel.wide {
28
+ width: min(420px, 60vw);
29
+ }
30
+ .skel.pill {
31
+ width: 64px;
32
+ height: 18px;
33
+ border-radius: 999px;
34
+ }
35
+ @keyframes shimmer {
36
+ 0% {
37
+ background-position: 200% 0;
38
+ }
39
+ 100% {
40
+ background-position: -200% 0;
41
+ }
42
+ }
43
+ </style>
@@ -0,0 +1,54 @@
1
+ <script lang="ts">
2
+ import type { Instance } from '../types.ts';
3
+
4
+ let { status }: { status: Instance['status'] } = $props();
5
+
6
+ const label: Record<Instance['status'], string> = {
7
+ creating: 'Booting…',
8
+ running: 'Running',
9
+ stopped: 'Stopped',
10
+ error: 'Error'
11
+ };
12
+ </script>
13
+
14
+ <span class="status {status}">{label[status]}</span>
15
+
16
+ <style>
17
+ /* Error is the one true alarm state, so it alone gets hue; the rest read via fill. */
18
+ .status {
19
+ font-family: var(--font-mono);
20
+ font-weight: 600;
21
+ font-size: 10px;
22
+ text-transform: uppercase;
23
+ letter-spacing: 0.1em;
24
+ padding: 3px 7px;
25
+ border: 1px solid var(--ink);
26
+ white-space: nowrap;
27
+ }
28
+ .status.running {
29
+ background: var(--ink);
30
+ color: var(--bg);
31
+ }
32
+ .status.stopped {
33
+ background: transparent;
34
+ color: var(--ink-soft);
35
+ border-color: var(--ink-faint);
36
+ }
37
+ .status.creating {
38
+ background: var(--ink);
39
+ color: var(--bg);
40
+ animation: lcd-blink 1.1s steps(1) infinite;
41
+ }
42
+ .status.error {
43
+ background: var(--danger);
44
+ color: var(--bg);
45
+ border-color: var(--danger);
46
+ font-weight: 700;
47
+ }
48
+ @keyframes lcd-blink {
49
+ 50% {
50
+ background: transparent;
51
+ color: var(--ink);
52
+ }
53
+ }
54
+ </style>
@@ -0,0 +1,77 @@
1
+ <script lang="ts">
2
+ import Sun from '@lucide/svelte/icons/sun';
3
+ import Moon from '@lucide/svelte/icons/moon';
4
+ import Monitor from '@lucide/svelte/icons/monitor';
5
+ import { getTheme, setTheme, applyTheme, type Theme } from '../theme.ts';
6
+
7
+ let theme: Theme = $state(getTheme());
8
+
9
+ const options: { value: Theme; label: string; icon: typeof Sun }[] = [
10
+ { value: 'auto', label: 'Auto', icon: Monitor },
11
+ { value: 'light', label: 'Light', icon: Sun },
12
+ { value: 'dark', label: 'Dark', icon: Moon }
13
+ ];
14
+
15
+ function select(value: Theme) {
16
+ theme = value;
17
+ setTheme(value);
18
+ applyTheme(value);
19
+ }
20
+ </script>
21
+
22
+ <div class="picker" role="radiogroup" aria-label="Theme">
23
+ {#each options as { value, label, icon: Icon } (value)}
24
+ <button
25
+ type="button"
26
+ class="segment"
27
+ class:active={theme === value}
28
+ role="radio"
29
+ aria-checked={theme === value}
30
+ onclick={() => select(value)}
31
+ >
32
+ <Icon size={13} />
33
+ {label}
34
+ </button>
35
+ {/each}
36
+ </div>
37
+
38
+ <style>
39
+ .picker {
40
+ display: inline-flex;
41
+ flex: none;
42
+ border: 1px solid var(--ink);
43
+ background: var(--bg-card);
44
+ }
45
+ .segment {
46
+ display: inline-flex;
47
+ align-items: center;
48
+ gap: 6px;
49
+ padding: 7px 12px;
50
+ font-family: var(--font-mono);
51
+ font-weight: 600;
52
+ font-size: 12px;
53
+ text-transform: uppercase;
54
+ letter-spacing: 0.06em;
55
+ border: none;
56
+ background: transparent;
57
+ color: var(--ink);
58
+ cursor: pointer;
59
+ }
60
+ .segment + .segment {
61
+ border-left: 1px solid var(--ink);
62
+ }
63
+ .segment:hover:not(.active) {
64
+ background: var(--ink);
65
+ color: var(--bg);
66
+ }
67
+ .segment.active {
68
+ font-weight: 700;
69
+ background: var(--ink);
70
+ color: var(--bg);
71
+ cursor: default;
72
+ }
73
+ .segment:focus-visible {
74
+ outline: 2px solid var(--ink);
75
+ outline-offset: -2px;
76
+ }
77
+ </style>
@@ -0,0 +1,64 @@
1
+ <script lang="ts">
2
+ import Plus from '@lucide/svelte/icons/plus';
3
+ import Component from '@lucide/svelte/icons/component';
4
+ import { isDev } from 'mochi-framework';
5
+ import type { AuthProvider } from '../types.ts';
6
+ import Brand from './Brand.svelte';
7
+ import SettingsCog from './SettingsCog.svelte';
8
+ import CredMenu from './CredMenu.svelte';
9
+ import Button from './Button.svelte';
10
+
11
+ // Action state is injected so the bar stays presentational and reusable on /debug.
12
+ let {
13
+ auth,
14
+ canDelete = false,
15
+ ready = true,
16
+ creating = false,
17
+ onNew,
18
+ onDeleteAll
19
+ }: {
20
+ auth: AuthProvider[];
21
+ canDelete?: boolean;
22
+ ready?: boolean;
23
+ creating?: boolean;
24
+ onNew?: () => void;
25
+ onDeleteAll?: () => void;
26
+ } = $props();
27
+ </script>
28
+
29
+ <header class="topbar">
30
+ <Brand />
31
+ <div class="topbar-actions">
32
+ {#if isDev}
33
+ <Button variant="default" size="sm" icon={Component} href="/debug">Debug</Button>
34
+ {/if}
35
+ <SettingsCog />
36
+ <CredMenu {auth} />
37
+ <Button variant="danger" size="sm" onclick={onDeleteAll} disabled={!canDelete}>
38
+ Delete all
39
+ </Button>
40
+ <Button
41
+ variant="primary"
42
+ icon={creating ? undefined : Plus}
43
+ onclick={onNew}
44
+ disabled={!ready || creating}
45
+ >
46
+ {creating ? 'Creating…' : 'New instance'}
47
+ </Button>
48
+ </div>
49
+ </header>
50
+
51
+ <style>
52
+ .topbar {
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: space-between;
56
+ padding: 18px 28px;
57
+ border-bottom: 1px solid var(--rule);
58
+ }
59
+ .topbar-actions {
60
+ display: inline-flex;
61
+ align-items: center;
62
+ gap: 14px;
63
+ }
64
+ </style>