codebay 0.0.1 → 0.2.1

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 (204) 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 +1612 -0
  4. package/.mochi/server-island.js +1 -0
  5. package/.mochi/svelte-client/HydratableIsland-wrq79y0w.js +1 -0
  6. package/.mochi/svelte-client/_hydrate-AppShell_2rtnxn6pgp2rh-7xgbmxxg.js +2 -0
  7. package/.mochi/svelte-client/_hydrate-AvatarsView_257s9yq1wwr4f-3cnbjpz2.js +13 -0
  8. package/.mochi/svelte-client/_hydrate-InstanceView_2ma45l9bybfhl-2ntmdm3e.js +1 -0
  9. package/.mochi/svelte-client/_hydrate-SettingsView_8hmarwmf8onq-t08spym1.js +23 -0
  10. package/.mochi/svelte-client/chunk-04qv4w6w.js +2 -0
  11. package/.mochi/svelte-client/chunk-5jnepvzx.js +2 -0
  12. package/.mochi/svelte-client/chunk-hcztrd75.js +1 -0
  13. package/.mochi/svelte-client/chunk-qxwt25hn.js +4 -0
  14. package/.mochi/svelte-client/chunk-sjmcgh7f.js +2 -0
  15. package/.mochi/svelte-client/chunk-tr67wtwn.js +2 -0
  16. package/.mochi/svelte-compile/App-f0q5n4rk.server.js +1168 -0
  17. package/.mochi/svelte-compile/Avatars-p8gfef7x.server.js +332 -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-atjwsczx.server.js +356 -0
  21. package/.mochi/svelte-compile/Settings-q88xw6h8.server.js +1173 -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-btmcxhqy.js +58 -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-1nfdwnm16cpp2.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 +34 -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/name-prompts.ts +30 -0
  109. package/src/avatars/octopus.ts +17 -0
  110. package/src/avatars/owl.ts +17 -0
  111. package/src/avatars/penguin.ts +17 -0
  112. package/src/avatars/planet.ts +17 -0
  113. package/src/avatars/rabbit.ts +17 -0
  114. package/src/avatars/rat.ts +17 -0
  115. package/src/avatars/robot.ts +17 -0
  116. package/src/avatars/rocket.ts +17 -0
  117. package/src/avatars/sea.ts +17 -0
  118. package/src/avatars/serialize.ts +65 -0
  119. package/src/avatars/skull.ts +17 -0
  120. package/src/avatars/snail.ts +17 -0
  121. package/src/avatars/snake.ts +17 -0
  122. package/src/avatars/snakegame.ts +17 -0
  123. package/src/avatars/star.ts +17 -0
  124. package/src/avatars/svelte.ts +17 -0
  125. package/src/avatars/target.ts +17 -0
  126. package/src/avatars/tree.ts +17 -0
  127. package/src/avatars/types.ts +24 -0
  128. package/src/avatars/ukraine.ts +17 -0
  129. package/src/avatars/whale.ts +17 -0
  130. package/src/avatars/wheat.ts +17 -0
  131. package/src/avatars/yinyan.ts +17 -0
  132. package/src/components/AppBar.svelte +35 -0
  133. package/src/components/AppShell.svelte +302 -0
  134. package/src/components/Avatar.svelte +235 -0
  135. package/src/components/AvatarEditor.svelte +297 -0
  136. package/src/components/AvatarsView.svelte +115 -0
  137. package/src/components/BranchBox.svelte +32 -0
  138. package/src/components/Brand.svelte +41 -0
  139. package/src/components/Button.svelte +161 -0
  140. package/src/components/CoinButton.svelte +121 -0
  141. package/src/components/CredMenu.svelte +171 -0
  142. package/src/components/DashboardView.svelte +198 -0
  143. package/src/components/FolderBrowser.svelte +635 -0
  144. package/src/components/HealthBox.svelte +161 -0
  145. package/src/components/IdeBar.svelte +186 -0
  146. package/src/components/IdeLoader.svelte +135 -0
  147. package/src/components/InstanceCard.svelte +220 -0
  148. package/src/components/InstanceView.svelte +567 -0
  149. package/src/components/PortsBox.svelte +74 -0
  150. package/src/components/SettingsCog.svelte +22 -0
  151. package/src/components/SettingsView.svelte +1494 -0
  152. package/src/components/Skeleton.svelte +43 -0
  153. package/src/components/StatusBadge.svelte +54 -0
  154. package/src/components/ThemePicker.svelte +77 -0
  155. package/src/components/TopBar.svelte +64 -0
  156. package/src/components/UiShowcase.svelte +578 -0
  157. package/src/components/ui-showcase/ComponentDemo.svelte +85 -0
  158. package/src/container-injections/attention-hooks.ts +117 -0
  159. package/src/container-injections/claude-aliases.ts +43 -0
  160. package/src/container-injections/claude-code-credentials.ts +145 -0
  161. package/src/container-injections/claude-code-custom.ts +125 -0
  162. package/src/container-injections/claude-no-coauthor.ts +35 -0
  163. package/src/container-injections/claude-skip-permissions.ts +38 -0
  164. package/src/container-injections/claude-statusline.ts +109 -0
  165. package/src/container-injections/git-identity.ts +63 -0
  166. package/src/container-injections/git-safe-directory.ts +18 -0
  167. package/src/container-injections/github-credentials.ts +162 -0
  168. package/src/container-injections/host-env-vars.ts +108 -0
  169. package/src/container-injections/tmux.ts +67 -0
  170. package/src/fontsource.d.ts +3 -0
  171. package/src/index.ts +81 -0
  172. package/src/lib/auth.server.ts +95 -0
  173. package/src/lib/bridge.server.ts +34 -0
  174. package/src/lib/config.server.ts +140 -0
  175. package/src/lib/crypto.server.ts +12 -0
  176. package/src/lib/db.server.ts +196 -0
  177. package/src/lib/devcontainer.server.ts +511 -0
  178. package/src/lib/docker-client.server.ts +61 -0
  179. package/src/lib/docker.server.ts +139 -0
  180. package/src/lib/exec.server.ts +92 -0
  181. package/src/lib/git.server.ts +68 -0
  182. package/src/lib/health.server.ts +105 -0
  183. package/src/lib/injections.server.ts +72 -0
  184. package/src/lib/instances.server.ts +552 -0
  185. package/src/lib/links.ts +9 -0
  186. package/src/lib/picker.server.ts +46 -0
  187. package/src/lib/ports.server.ts +9 -0
  188. package/src/lib/proxy.server.ts +170 -0
  189. package/src/lib/repo-url.ts +60 -0
  190. package/src/lib/spawn.server.ts +14 -0
  191. package/src/lib/theme.server.ts +22 -0
  192. package/src/live.ts +50 -0
  193. package/src/pages/App.svelte +14 -0
  194. package/src/pages/Avatars.svelte +9 -0
  195. package/src/pages/Instance.svelte +9 -0
  196. package/src/pages/Settings.svelte +76 -0
  197. package/src/pages/UI.svelte +10 -0
  198. package/src/routes.ts +444 -0
  199. package/src/settings.ts +14 -0
  200. package/src/shell.html +100 -0
  201. package/src/sound.ts +69 -0
  202. package/src/theme.ts +24 -0
  203. package/src/types.ts +79 -0
  204. package/svelte.config.js +5 -0
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'bob-marley',
5
+ pixels: [
6
+ '..####..',
7
+ '.######.',
8
+ '##....##',
9
+ '#.#..#.#',
10
+ '#......#',
11
+ '##.##.##',
12
+ '#.####.#',
13
+ '#..##..#'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'car',
5
+ pixels: [
6
+ '........',
7
+ '..####..',
8
+ '..#..#..',
9
+ '..#..#..',
10
+ '########',
11
+ '########',
12
+ '########',
13
+ '.##..##.'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'carpathians',
5
+ pixels: [
6
+ '........',
7
+ '.#......',
8
+ '......##',
9
+ '.....###',
10
+ '#...####',
11
+ '##.#####',
12
+ '###.####',
13
+ '####.###'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'cat-body',
5
+ pixels: [
6
+ '....##..',
7
+ '#.#..###',
8
+ '###....#',
9
+ '###..###',
10
+ '########',
11
+ '########',
12
+ '#.#..#.#',
13
+ '#.#..#.#'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'cat-sits',
5
+ pixels: [
6
+ '..#..#..',
7
+ '..####..',
8
+ '..####..',
9
+ '.####...',
10
+ '####..##',
11
+ '####.#.#',
12
+ '####...#',
13
+ '.######.'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'cat',
5
+ pixels: [
6
+ '##....##',
7
+ '##....##',
8
+ '########',
9
+ '##.##.##',
10
+ '########',
11
+ '#.####.#',
12
+ '########',
13
+ '.####.##'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'celtic-cross',
5
+ pixels: [
6
+ '...##...',
7
+ '.#.##.#.',
8
+ '...##...',
9
+ '########',
10
+ '########',
11
+ '...##...',
12
+ '.#.##.#.',
13
+ '...##...'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'cherry',
5
+ pixels: [
6
+ '......##',
7
+ '....###.',
8
+ '...##.#.',
9
+ '..#..#..',
10
+ '.##.##..',
11
+ '#.###.#.',
12
+ '#.###.#.',
13
+ '.###.#..'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'cotton',
5
+ pixels: [
6
+ '....##..',
7
+ '....##..',
8
+ '.##.....',
9
+ '.##..##.',
10
+ '...#.##.',
11
+ '....#...',
12
+ '...#....',
13
+ '...#....'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'crab',
5
+ pixels: [
6
+ '.#....#.',
7
+ '##....##',
8
+ '##.##.##',
9
+ '.######.',
10
+ '########',
11
+ '##.##.##',
12
+ '##....##',
13
+ '.#....#.'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'crown',
5
+ pixels: [
6
+ '#......#',
7
+ '#..##..#',
8
+ '##.##.##',
9
+ '##.##.##',
10
+ '########',
11
+ '#.#.#.#.',
12
+ '########',
13
+ '########'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'diamond',
5
+ pixels: [
6
+ '.######.',
7
+ '#.#..#.#',
8
+ '########',
9
+ '##.##.##',
10
+ '.#.##.#.',
11
+ '.##..##.',
12
+ '..####..',
13
+ '...##...'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'dog',
5
+ pixels: [
6
+ '##....##',
7
+ '##.##.##',
8
+ '########',
9
+ '###..###',
10
+ '########',
11
+ '########',
12
+ '##.##.##',
13
+ '.######.'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'elephant',
5
+ pixels: [
6
+ '...###..',
7
+ '.#####..',
8
+ '####.#..',
9
+ '######..',
10
+ '######.#',
11
+ '##.##.#.',
12
+ '##.##...',
13
+ '##.##...'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'fish',
5
+ pixels: [
6
+ '......#.',
7
+ '.###.##.',
8
+ '#####.##',
9
+ '#.#####.',
10
+ '#.#####.',
11
+ '#####.##',
12
+ '.###.##.',
13
+ '......#.'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'fleur-de-lis',
5
+ pixels: [
6
+ '...##...',
7
+ '...#....',
8
+ '.###.##.',
9
+ '#.##...#',
10
+ '...##...',
11
+ '.#.##.#.',
12
+ '.######.',
13
+ '...##...'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'flower',
5
+ pixels: [
6
+ '..#..#..',
7
+ '.###.##.',
8
+ '########',
9
+ '.######.',
10
+ '..####..',
11
+ '...##...',
12
+ '..##.##.',
13
+ '...##...'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'fox',
5
+ pixels: [
6
+ '##....##',
7
+ '##....##',
8
+ '########',
9
+ '###..###',
10
+ '########',
11
+ '########',
12
+ '.######.',
13
+ '..####..'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'frog',
5
+ pixels: [
6
+ '.#....#.',
7
+ '###..###',
8
+ '########',
9
+ '########',
10
+ '########',
11
+ '########',
12
+ '.######.',
13
+ '..####..'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'ghost',
5
+ pixels: [
6
+ '..####..',
7
+ '.######.',
8
+ '##.##.##',
9
+ '##.##.##',
10
+ '########',
11
+ '########',
12
+ '########',
13
+ '#.##.##.'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'giraffe',
5
+ pixels: [
6
+ '....#.#.',
7
+ '....####',
8
+ '....#...',
9
+ '....#...',
10
+ '....#...',
11
+ '....#...',
12
+ '#####...',
13
+ '##.##...'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'glasses',
5
+ pixels: [
6
+ '##..##..',
7
+ '#.#.##.#',
8
+ '.#######',
9
+ '........',
10
+ '.##..##.',
11
+ '.##..##.',
12
+ '#..##..#',
13
+ '########'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'heart',
5
+ pixels: [
6
+ '.##..##.',
7
+ '########',
8
+ '########',
9
+ '########',
10
+ '.######.',
11
+ '..####..',
12
+ '...##...',
13
+ '........'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,128 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ import anchor from './anchor.ts';
4
+ import bear from './bear.ts';
5
+ import bee from './bee.ts';
6
+ import bobMarley from './bob-marley.ts';
7
+ import car from './car.ts';
8
+ import carpathians from './carpathians.ts';
9
+ import cat from './cat.ts';
10
+ import catBody from './cat-body.ts';
11
+ import catSits from './cat-sits.ts';
12
+ import celticCross from './celtic-cross.ts';
13
+ import cherry from './cherry.ts';
14
+ import cotton from './cotton.ts';
15
+ import crab from './crab.ts';
16
+ import crown from './crown.ts';
17
+ import diamond from './diamond.ts';
18
+ import dog from './dog.ts';
19
+ import elephant from './elephant.ts';
20
+ import fish from './fish.ts';
21
+ import fleurDeLis from './fleur-de-lis.ts';
22
+ import flower from './flower.ts';
23
+ import fox from './fox.ts';
24
+ import frog from './frog.ts';
25
+ import ghost from './ghost.ts';
26
+ import giraffe from './giraffe.ts';
27
+ import glasses from './glasses.ts';
28
+ import heart from './heart.ts';
29
+ import invader from './invader.ts';
30
+ import kangaroo from './kangaroo.ts';
31
+ import key from './key.ts';
32
+ import lightning from './lightning.ts';
33
+ import mushroom from './mushroom.ts';
34
+ import octopus from './octopus.ts';
35
+ import owl from './owl.ts';
36
+ import penguin from './penguin.ts';
37
+ import planet from './planet.ts';
38
+ import rabbit from './rabbit.ts';
39
+ import rat from './rat.ts';
40
+ import robot from './robot.ts';
41
+ import rocket from './rocket.ts';
42
+ import sea from './sea.ts';
43
+ import skull from './skull.ts';
44
+ import snail from './snail.ts';
45
+ import snake from './snake.ts';
46
+ import snakegame from './snakegame.ts';
47
+ import star from './star.ts';
48
+ import svelte from './svelte.ts';
49
+ import target from './target.ts';
50
+ import tree from './tree.ts';
51
+ import ukraine from './ukraine.ts';
52
+ import whale from './whale.ts';
53
+ import wheat from './wheat.ts';
54
+ import yinyan from './yinyan.ts';
55
+
56
+ // Order must stay stable, or every container's artwork changes on the next restart.
57
+ export const avatars: AvatarArt[] = [
58
+ anchor,
59
+ bear,
60
+ bee,
61
+ bobMarley,
62
+ car,
63
+ carpathians,
64
+ cat,
65
+ catBody,
66
+ catSits,
67
+ celticCross,
68
+ cherry,
69
+ cotton,
70
+ crab,
71
+ crown,
72
+ diamond,
73
+ dog,
74
+ elephant,
75
+ fish,
76
+ fleurDeLis,
77
+ flower,
78
+ fox,
79
+ frog,
80
+ ghost,
81
+ giraffe,
82
+ glasses,
83
+ heart,
84
+ invader,
85
+ kangaroo,
86
+ key,
87
+ lightning,
88
+ mushroom,
89
+ octopus,
90
+ owl,
91
+ penguin,
92
+ planet,
93
+ rabbit,
94
+ rat,
95
+ robot,
96
+ rocket,
97
+ sea,
98
+ skull,
99
+ snail,
100
+ snake,
101
+ snakegame,
102
+ star,
103
+ svelte,
104
+ target,
105
+ tree,
106
+ ukraine,
107
+ whale,
108
+ wheat,
109
+ yinyan
110
+ ];
111
+
112
+ // FNV-1a, chosen because it's pure and cheap — the mapping must hold across processes.
113
+ function fnv1a(s: string): number {
114
+ let h = 2166136261;
115
+ for (let i = 0; i < s.length; i++) {
116
+ h ^= s.charCodeAt(i);
117
+ h = Math.imul(h, 16777619);
118
+ }
119
+ return h >>> 0;
120
+ }
121
+
122
+ // Duplicates are possible but rare, since the hash spreads ids evenly across the catalog.
123
+ export function pickAvatar(id: string): AvatarArt {
124
+ return avatars[fnv1a(id) % avatars.length]!;
125
+ }
126
+
127
+ export { decode } from './types.ts';
128
+ export type { AvatarArt } from './types.ts';
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'invader',
5
+ pixels: [
6
+ '#......#',
7
+ '.#....#.',
8
+ '########',
9
+ '##.##.##',
10
+ '########',
11
+ '..####..',
12
+ '.##..##.',
13
+ '#.#..#.#'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'kangaroo',
5
+ pixels: [
6
+ '..#.#...',
7
+ '..###...',
8
+ '.####...',
9
+ '...##...',
10
+ '..#####.',
11
+ '...####.',
12
+ '...##.#.',
13
+ '..###..#'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'key',
5
+ pixels: [
6
+ '.####...',
7
+ '##..##..',
8
+ '##..##..',
9
+ '##..##..',
10
+ '.####...',
11
+ '..##....',
12
+ '..####..',
13
+ '..##.##.'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'lightning',
5
+ pixels: [
6
+ '...#####',
7
+ '..####..',
8
+ '.####...',
9
+ '.#######',
10
+ '..######',
11
+ '...#####',
12
+ '..####..',
13
+ '.###....'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,17 @@
1
+ import type { AvatarArt } from './types.ts';
2
+
3
+ const art: AvatarArt = {
4
+ name: 'mushroom',
5
+ pixels: [
6
+ '..####..',
7
+ '.######.',
8
+ '########',
9
+ '########',
10
+ '########',
11
+ '..####..',
12
+ '..####..',
13
+ '.######.'
14
+ ]
15
+ };
16
+
17
+ export default art;
@@ -0,0 +1,30 @@
1
+ // Lives outside the editor component so the route can roll the hint server-side —
2
+ // rolling it during component init would re-roll it again at hydration.
3
+ export const NAME_PROMPTS = [
4
+ 'dragon',
5
+ 'unicorn',
6
+ 'cactus',
7
+ 'comet',
8
+ 'pretzel',
9
+ 'volcano',
10
+ 'narwhal',
11
+ 'waffle',
12
+ 'satellite',
13
+ 'pineapple',
14
+ 'kraken',
15
+ 'yeti',
16
+ 'moose',
17
+ 'lighthouse',
18
+ 'toaster',
19
+ 'hedgehog',
20
+ 'walrus',
21
+ 'pumpkin',
22
+ 'jellyfish',
23
+ 'tornado',
24
+ 'igloo',
25
+ 'boomerang'
26
+ ];
27
+
28
+ export function pickNamePrompt(): string {
29
+ return NAME_PROMPTS[Math.floor(Math.random() * NAME_PROMPTS.length)]!;
30
+ }