vibedgames 0.6.3 → 0.8.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 (140) hide show
  1. package/README.md +14 -9
  2. package/dist/THIRD_PARTY_NOTICES.txt +383 -0
  3. package/dist/chunk-2QBYTIMH.js +511 -0
  4. package/dist/chunk-6FZPPUQH.js +107 -0
  5. package/dist/chunk-AZGENOOR.js +22 -0
  6. package/dist/chunk-CAKBGDCY.js +47 -0
  7. package/dist/chunk-CU7UY5YJ.js +1108 -0
  8. package/dist/chunk-CZPKN32Z.js +257 -0
  9. package/dist/chunk-FL6IFBUF.js +22 -0
  10. package/dist/chunk-FNYBZNW2.js +165 -0
  11. package/dist/chunk-GUF6ADBF.js +273 -0
  12. package/dist/chunk-H4NBRFBY.js +79 -0
  13. package/dist/chunk-HASKWB6B.js +111 -0
  14. package/dist/chunk-I6O4HIDY.js +1063 -0
  15. package/dist/chunk-IO6OM6WM.js +466 -0
  16. package/dist/chunk-J6PKNPI2.js +26 -0
  17. package/dist/chunk-JT2AU24K.js +759 -0
  18. package/dist/chunk-K5SC6SXO.js +172 -0
  19. package/dist/chunk-MBXCVCC4.js +478 -0
  20. package/dist/chunk-PEUP4MZR.js +59 -0
  21. package/dist/chunk-PQDBCZRT.js +2017 -0
  22. package/dist/chunk-RIGKOLNN.js +1360 -0
  23. package/dist/chunk-RNBUX5VF.js +68 -0
  24. package/dist/chunk-RYFO3ZPO.js +71 -0
  25. package/dist/chunk-RZ4DIJQW.js +68 -0
  26. package/dist/chunk-SAANBZ25.js +118 -0
  27. package/dist/chunk-TMK6V5FV.js +395 -0
  28. package/dist/chunk-TYVYWBY6.js +69 -0
  29. package/dist/chunk-VFFOT7KD.js +2980 -0
  30. package/dist/chunk-W5XP4ZVU.js +159 -0
  31. package/dist/chunk-X4ZABSCN.js +415 -0
  32. package/dist/chunk-XDC7QGOF.js +32 -0
  33. package/dist/chunk-XK5RZQMX.js +1780 -0
  34. package/dist/chunk-Y552BNFZ.js +41 -0
  35. package/dist/chunk-Z4Z24FWO.js +39 -0
  36. package/dist/chunk-ZI6PKVXG.js +64 -0
  37. package/dist/chunk-ZYCSYJWX.js +87 -0
  38. package/dist/index.js +67 -60
  39. package/package.json +13 -16
  40. package/templates/none/_gitignore +3 -0
  41. package/templates/none/index.html +29 -0
  42. package/templates/none/package.json +16 -0
  43. package/templates/none/src/main.ts +16 -0
  44. package/templates/none/tsconfig.json +18 -0
  45. package/templates/none/vite.config.ts +8 -0
  46. package/templates/phaser/_gitignore +3 -0
  47. package/templates/phaser/index.html +24 -0
  48. package/templates/phaser/package.json +19 -0
  49. package/templates/phaser/src/main.ts +16 -0
  50. package/templates/phaser/src/scenes/game-scene.ts +65 -0
  51. package/templates/phaser/tsconfig.json +18 -0
  52. package/templates/phaser/vite.config.ts +8 -0
  53. package/templates/react-r3f/_gitignore +3 -0
  54. package/templates/react-r3f/index.html +24 -0
  55. package/templates/react-r3f/package.json +27 -0
  56. package/templates/react-r3f/src/app.tsx +33 -0
  57. package/templates/react-r3f/src/main.tsx +15 -0
  58. package/templates/react-r3f/tsconfig.json +19 -0
  59. package/templates/react-r3f/vite.config.ts +10 -0
  60. package/templates/threejs/_gitignore +3 -0
  61. package/templates/threejs/index.html +36 -0
  62. package/templates/threejs/package.json +20 -0
  63. package/templates/threejs/src/main.ts +44 -0
  64. package/templates/threejs/tsconfig.json +18 -0
  65. package/templates/threejs/vite.config.ts +8 -0
  66. package/dist/commands/completions.d.ts +0 -7
  67. package/dist/commands/completions.js +0 -145
  68. package/dist/commands/credits.d.ts +0 -10
  69. package/dist/commands/credits.js +0 -136
  70. package/dist/commands/deploy.d.ts +0 -26
  71. package/dist/commands/deploy.js +0 -257
  72. package/dist/commands/factory.d.ts +0 -3
  73. package/dist/commands/factory.js +0 -73
  74. package/dist/commands/fork.d.ts +0 -29
  75. package/dist/commands/fork.js +0 -124
  76. package/dist/commands/generate.d.ts +0 -1
  77. package/dist/commands/generate.js +0 -565
  78. package/dist/commands/init.d.ts +0 -20
  79. package/dist/commands/init.js +0 -105
  80. package/dist/commands/login.d.ts +0 -1
  81. package/dist/commands/login.js +0 -45
  82. package/dist/commands/logout.d.ts +0 -1
  83. package/dist/commands/logout.js +0 -13
  84. package/dist/commands/new.d.ts +0 -26
  85. package/dist/commands/new.js +0 -318
  86. package/dist/commands/playtest-run.d.ts +0 -66
  87. package/dist/commands/playtest-run.js +0 -268
  88. package/dist/commands/playtest.d.ts +0 -76
  89. package/dist/commands/playtest.js +0 -372
  90. package/dist/commands/update.d.ts +0 -13
  91. package/dist/commands/update.js +0 -82
  92. package/dist/commands/whoami.d.ts +0 -10
  93. package/dist/commands/whoami.js +0 -44
  94. package/dist/index.d.ts +0 -2
  95. package/dist/lib/api.d.ts +0 -18
  96. package/dist/lib/api.js +0 -27
  97. package/dist/lib/archive.d.ts +0 -17
  98. package/dist/lib/archive.js +0 -228
  99. package/dist/lib/codex.d.ts +0 -117
  100. package/dist/lib/codex.js +0 -426
  101. package/dist/lib/config-file.d.ts +0 -16
  102. package/dist/lib/config-file.js +0 -54
  103. package/dist/lib/config.d.ts +0 -11
  104. package/dist/lib/config.js +0 -54
  105. package/dist/lib/manifest.d.ts +0 -10
  106. package/dist/lib/manifest.js +0 -91
  107. package/dist/lib/media-args.d.ts +0 -30
  108. package/dist/lib/media-args.js +0 -219
  109. package/dist/lib/media-download.d.ts +0 -37
  110. package/dist/lib/media-download.js +0 -268
  111. package/dist/lib/media-poll.d.ts +0 -18
  112. package/dist/lib/media-poll.js +0 -86
  113. package/dist/lib/media-upload.d.ts +0 -12
  114. package/dist/lib/media-upload.js +0 -52
  115. package/dist/lib/output.d.ts +0 -68
  116. package/dist/lib/output.js +0 -102
  117. package/dist/lib/package-manager.d.ts +0 -25
  118. package/dist/lib/package-manager.js +0 -77
  119. package/dist/lib/playtest/agent.d.ts +0 -192
  120. package/dist/lib/playtest/agent.js +0 -652
  121. package/dist/lib/playtest/browser.d.ts +0 -109
  122. package/dist/lib/playtest/browser.js +0 -219
  123. package/dist/lib/playtest/controls.d.ts +0 -47
  124. package/dist/lib/playtest/controls.js +0 -218
  125. package/dist/lib/playtest/errors.d.ts +0 -9
  126. package/dist/lib/playtest/errors.js +0 -12
  127. package/dist/lib/playtest/keys.d.ts +0 -41
  128. package/dist/lib/playtest/keys.js +0 -157
  129. package/dist/lib/playtest/run.d.ts +0 -195
  130. package/dist/lib/playtest/run.js +0 -409
  131. package/dist/lib/run.d.ts +0 -19
  132. package/dist/lib/run.js +0 -23
  133. package/dist/lib/strict-args.d.ts +0 -27
  134. package/dist/lib/strict-args.js +0 -78
  135. package/dist/lib/types.d.ts +0 -16
  136. package/dist/lib/types.js +0 -10
  137. package/dist/lib/update.d.ts +0 -10
  138. package/dist/lib/update.js +0 -110
  139. package/dist/lib/upload.d.ts +0 -16
  140. package/dist/lib/upload.js +0 -41
@@ -1,45 +0,0 @@
1
- import { exec } from "node:child_process";
2
- import { setTimeout as sleep } from "node:timers/promises";
3
- import { defineCommand } from "citty";
4
- import { consola } from "consola";
5
- import { createPublicClient } from "../lib/api.js";
6
- import { getBaseUrl, saveConfig } from "../lib/config.js";
7
- const POLL_INTERVAL_MS = 2000;
8
- // 5 min at 2s intervals
9
- const MAX_POLLS = 150;
10
- const openBrowser = (url) => {
11
- const openers = { darwin: "open", win32: "start" };
12
- const cmd = openers[process.platform] ?? "xdg-open";
13
- exec(`${cmd} "${url}"`);
14
- };
15
- export const loginCommand = defineCommand({
16
- meta: {
17
- description: "Authenticate with vibedgames",
18
- name: "login",
19
- },
20
- run: async () => {
21
- const baseUrl = getBaseUrl();
22
- const client = createPublicClient(baseUrl);
23
- const { code } = await client.auth.cliInit();
24
- consola.box(`Code: ${code}`);
25
- consola.info("Opening browser to complete authentication...");
26
- const authUrl = `${baseUrl}/auth/cli?code=${code}`;
27
- openBrowser(authUrl);
28
- consola.start("Waiting for confirmation...");
29
- for (let i = 0; i < MAX_POLLS; i += 1) {
30
- await sleep(POLL_INTERVAL_MS);
31
- const result = await client.auth.cliPoll({ code });
32
- if (result.status === "confirmed") {
33
- saveConfig({ baseUrl, token: result.token });
34
- consola.success("Logged in successfully");
35
- return;
36
- }
37
- if (result.status === "expired") {
38
- consola.error("Code expired. Run `vg login` to try again.");
39
- process.exit(1);
40
- }
41
- }
42
- consola.error("Timed out waiting for confirmation.");
43
- process.exit(1);
44
- },
45
- });
@@ -1 +0,0 @@
1
- export declare const logoutCommand: import("citty").CommandDef<import("citty").ArgsDef>;
@@ -1,13 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import { consola } from "consola";
3
- import { clearConfig } from "../lib/config.js";
4
- export const logoutCommand = defineCommand({
5
- meta: {
6
- description: "Log out of vibedgames",
7
- name: "logout",
8
- },
9
- run: () => {
10
- clearConfig();
11
- consola.success("Logged out");
12
- },
13
- });
@@ -1,26 +0,0 @@
1
- export declare const newCommand: import("citty").CommandDef<{
2
- readonly engine: {
3
- readonly default: "phaser";
4
- readonly description: `Engine preset: ${string} (default: phaser).`;
5
- readonly type: "string";
6
- };
7
- readonly force: {
8
- readonly default: false;
9
- readonly description: "Overwrite an existing target directory.";
10
- readonly type: "boolean";
11
- };
12
- readonly here: {
13
- readonly default: false;
14
- readonly description: "Write into the current directory instead of creating <slug>/.";
15
- readonly type: "boolean";
16
- };
17
- readonly slug: {
18
- readonly description: "Lowercase, hyphenated slug — used as the directory name and deploy subdomain.";
19
- readonly required: true;
20
- readonly type: "positional";
21
- };
22
- readonly template: {
23
- readonly description: "Override the engine preset and fetch from an arbitrary degit spec (e.g. owner/repo, owner/repo#branch). Skips the engine preset entirely.";
24
- readonly type: "string";
25
- };
26
- }>;
@@ -1,318 +0,0 @@
1
- import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
2
- import path from "node:path";
3
- import { defineCommand } from "citty";
4
- import { consola } from "consola";
5
- import tiged from "tiged";
6
- import { SLUG_RE } from "../lib/config-file.js";
7
- import { assertKnownFlags } from "../lib/strict-args.js";
8
- import { isJsonObject, isJsonString } from "../lib/types.js";
9
- const ENGINES = new Map([
10
- // phaserjs/template-vite-ts is the official Phaser 4 + Vite + TypeScript
11
- // starter (despite the description still saying "Phaser 3" — package.json
12
- // pins phaser@^4). Pulled fresh on each `vg new`.
13
- [
14
- "phaser",
15
- {
16
- label: "Phaser 4 + Vite + TypeScript (official)",
17
- postNotes: [
18
- "The phaser template ships a `log.js` telemetry shim and uses `vite/config.*.mjs` for build configs — both are upstream, not vibedgames.",
19
- ],
20
- repo: "phaserjs/template-vite-ts",
21
- skill: "phaser",
22
- },
23
- ],
24
- // No officially-blessed Three.js starter exists. Using the most-starred
25
- // community Vite+TS starter that's been kept current.
26
- [
27
- "threejs",
28
- {
29
- label: "Three.js + Vite + TypeScript (community)",
30
- postNotes: [
31
- "The demo scene (src/scene.ts) wires lil-gui, stats.js and Drag/OrbitControls as a showcase — replace it with your game and drop the debug deps for production.",
32
- ],
33
- repo: "pachoclo/vite-threejs-ts-template",
34
- skill: "threejs",
35
- },
36
- ],
37
- // React Three Fiber. Same author as the threejs preset — Vite + TS +
38
- // React 18 + R3F 8 + drei, with leva and r3f-perf wired up for debug.
39
- // The pmndrs org doesn't ship an official R3F starter (its templates
40
- // are all Next.js-based), and the highest-starred R3F template on
41
- // GitHub is still on CRA + React 17, so this is the cleanest current
42
- // option for an agent.
43
- [
44
- "react-r3f",
45
- {
46
- label: "React + React Three Fiber + Vite + TypeScript (community)",
47
- repo: "pachoclo/vite-r3f-ts-template",
48
- skill: "threejs",
49
- },
50
- ],
51
- // Engine-agnostic fallback for "I'll wire it up myself" / non-canvas
52
- // games. Stays inline so we don't get blocked on a network fetch when
53
- // the user explicitly asked for a minimal start.
54
- [
55
- "none",
56
- {
57
- inline: true,
58
- label: "minimal Vite + TypeScript canvas",
59
- skill: "deploy",
60
- },
61
- ],
62
- ]);
63
- const NONE_FILES = [
64
- {
65
- content: (slug) => `${JSON.stringify({
66
- devDependencies: { typescript: "^5.6.0", vite: "^7.0.0" },
67
- name: slug,
68
- private: true,
69
- scripts: {
70
- build: "vite build",
71
- dev: "vite",
72
- preview: "vite preview",
73
- },
74
- type: "module",
75
- version: "0.0.0",
76
- }, null, 2)}\n`,
77
- path: "package.json",
78
- },
79
- {
80
- content: () => `${JSON.stringify({
81
- compilerOptions: {
82
- esModuleInterop: true,
83
- isolatedModules: true,
84
- lib: ["ES2022", "DOM", "DOM.Iterable"],
85
- module: "Preserve",
86
- moduleResolution: "Bundler",
87
- noEmit: true,
88
- noUncheckedIndexedAccess: true,
89
- skipLibCheck: true,
90
- strict: true,
91
- target: "ES2022",
92
- types: ["vite/client"],
93
- },
94
- include: ["src", "vite.config.ts"],
95
- }, null, 2)}\n`,
96
- path: "tsconfig.json",
97
- },
98
- {
99
- content: () => `import { defineConfig } from "vite";\n\nexport default defineConfig({\n base: "./",\n server: { port: 5173 },\n});\n`,
100
- path: "vite.config.ts",
101
- },
102
- {
103
- content: (slug) => `<!doctype html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <title>${slug}</title>\n <style>html,body{margin:0;background:#0f1020;color:#fff;font-family:system-ui,sans-serif;}#game{display:flex;align-items:center;justify-content:center;height:100vh;}</style>\n </head>\n <body>\n <div id="game"></div>\n <script type="module" src="/src/main.ts"></script>\n </body>\n</html>\n`,
104
- path: "index.html",
105
- },
106
- {
107
- content: (slug) => `const canvas = document.createElement("canvas");\ncanvas.width = 800;\ncanvas.height = 600;\ndocument.getElementById("game")!.appendChild(canvas);\nconst ctx = canvas.getContext("2d")!;\n\nctx.fillStyle = "#fff";\nctx.textAlign = "center";\nctx.font = "28px system-ui";\nctx.fillText("${slug}", canvas.width / 2, canvas.height / 2 - 8);\nctx.font = "14px system-ui";\nctx.fillStyle = "#aaa";\nctx.fillText("Edit src/main.ts to start building.", canvas.width / 2, canvas.height / 2 + 22);\n`,
108
- path: "src/main.ts",
109
- },
110
- { content: () => `node_modules\ndist\n.DS_Store\n`, path: ".gitignore" },
111
- ];
112
- // Derived so `--help` and the error message can't drift from the presets again.
113
- const ENGINE_IDS = [...ENGINES.keys()];
114
- const newArgs = {
115
- engine: {
116
- default: "phaser",
117
- description: `Engine preset: ${ENGINE_IDS.join(", ")} (default: phaser).`,
118
- type: "string",
119
- },
120
- force: {
121
- default: false,
122
- description: "Overwrite an existing target directory.",
123
- type: "boolean",
124
- },
125
- here: {
126
- default: false,
127
- description: "Write into the current directory instead of creating <slug>/.",
128
- type: "boolean",
129
- },
130
- slug: {
131
- description: "Lowercase, hyphenated slug — used as the directory name and deploy subdomain.",
132
- required: true,
133
- type: "positional",
134
- },
135
- template: {
136
- description: "Override the engine preset and fetch from an arbitrary degit spec (e.g. owner/repo, owner/repo#branch). Skips the engine preset entirely.",
137
- type: "string",
138
- },
139
- };
140
- const fetchTemplate = async (repo, target, force) => {
141
- const emitter = tiged(repo, { force, mode: "tar", verbose: false });
142
- await emitter.clone(target);
143
- };
144
- /** Remove template-repo artifacts that never apply to a scaffolded game:
145
- * the template's own lockfile (wrong for whatever package manager the user
146
- * runs) and its CI workflows (reference the template repo, fail elsewhere). */
147
- const cleanTemplateArtifacts = (target) => {
148
- for (const f of ["package-lock.json", "yarn.lock", "pnpm-lock.yaml", "bun.lockb", "bun.lock"]) {
149
- const p = path.resolve(target, f);
150
- if (existsSync(p)) {
151
- rmSync(p);
152
- }
153
- }
154
- const gh = path.resolve(target, ".github");
155
- if (existsSync(gh)) {
156
- rmSync(gh, { recursive: true });
157
- }
158
- };
159
- /** Some templates (threejs) ship no vite config at all, which means no
160
- * relative `base` — write a minimal one so built asset URLs are relative
161
- * and the bundle works wherever it's hosted. Never touches templates that
162
- * bring their own config (phaser uses a vite/ config dir wired into its
163
- * npm scripts). */
164
- const ensureViteConfig = (target) => {
165
- const hasConfig = ["vite.config.ts", "vite.config.js", "vite.config.mjs"].some((f) => existsSync(path.resolve(target, f))) || existsSync(path.resolve(target, "vite"));
166
- if (hasConfig) {
167
- return;
168
- }
169
- writeFileSync(path.resolve(target, "vite.config.ts"), `import { defineConfig } from "vite";\n\nexport default defineConfig({\n base: "./",\n});\n`);
170
- };
171
- /** Agents lean on \`npm run typecheck\` to verify changes without a full
172
- * build — add it when the template doesn't define one. */
173
- const ensureTypecheckScript = (target) => {
174
- const pkgPath = path.resolve(target, "package.json");
175
- if (!existsSync(pkgPath)) {
176
- return;
177
- }
178
- try {
179
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
180
- if (!isJsonObject(pkg)) {
181
- return;
182
- }
183
- const scripts = isJsonObject(pkg.scripts) ? pkg.scripts : {};
184
- if (isJsonString(scripts.typecheck)) {
185
- return;
186
- }
187
- scripts.typecheck = "tsc --noEmit";
188
- pkg.scripts = scripts;
189
- writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
190
- }
191
- catch {
192
- // malformed package.json — rewritePackageName will warn about it
193
- }
194
- };
195
- const writeInlineTemplate = (target, slug, force) => {
196
- for (const file of NONE_FILES) {
197
- const dest = path.resolve(target, file.path);
198
- if (existsSync(dest) && !force) {
199
- continue;
200
- }
201
- mkdirSync(dest.slice(0, dest.lastIndexOf("/")), { recursive: true });
202
- writeFileSync(dest, file.content(slug));
203
- }
204
- };
205
- const rewritePackageName = (target, slug) => {
206
- const pkgPath = path.resolve(target, "package.json");
207
- if (!existsSync(pkgPath)) {
208
- return;
209
- }
210
- try {
211
- const raw = readFileSync(pkgPath, "utf-8");
212
- const pkg = JSON.parse(raw);
213
- if (!isJsonObject(pkg)) {
214
- throw new Error("package.json is not a JSON object");
215
- }
216
- pkg.name = slug;
217
- delete pkg.repository;
218
- delete pkg.bugs;
219
- delete pkg.homepage;
220
- writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
221
- }
222
- catch (error) {
223
- consola.warn(`Could not rewrite package.json name to ${slug}: ${error instanceof Error ? error.message : String(error)}`);
224
- }
225
- };
226
- const writeVibedgamesJson = (target, slug) => {
227
- writeFileSync(path.resolve(target, "vibedgames.json"), `${JSON.stringify({ name: slug.replaceAll("-", " "), slug }, null, 2)}\n`);
228
- };
229
- const writeReadme = (target, slug, preset) => {
230
- const readmePath = path.resolve(target, "README.md");
231
- // Keep the template's README if present (it usually has engine docs).
232
- // Append a vibedgames-specific footer so devs see the deploy flow.
233
- const footer = `\n\n---\n\n## Vibedgames\n\n` +
234
- `This project was scaffolded with \`vg new ${slug}\` (${preset.label}).\n\n` +
235
- `\`\`\`sh\nnpm install\nnpm run dev # local preview\nnpm run build\nvg deploy ./dist # ships to ${slug}.vibedgames.com\n\`\`\`\n\n` +
236
- `For engine-specific work, the \`${preset.skill}\` skill loads automatically in Claude Code.\n`;
237
- if (existsSync(readmePath)) {
238
- const existing = readFileSync(readmePath, "utf-8");
239
- if (existing.includes("## Vibedgames")) {
240
- return;
241
- }
242
- writeFileSync(readmePath, existing.replace(/\s*$/u, "") + footer);
243
- return;
244
- }
245
- writeFileSync(readmePath, `# ${slug}${footer}`);
246
- };
247
- export const newCommand = defineCommand({
248
- args: newArgs,
249
- meta: {
250
- description: "Scaffold a new browser game. Pulls an engine template (phaser, threejs, react-r3f) or generates a minimal canvas starter.",
251
- name: "new",
252
- },
253
- run: async ({ args, rawArgs }) => {
254
- assertKnownFlags(rawArgs, newArgs);
255
- const slug = args.slug.trim().toLowerCase();
256
- if (!SLUG_RE.test(slug)) {
257
- consola.error(`Invalid slug: ${args.slug}\n Use lowercase letters, digits, and hyphens (e.g. "asteroid-belt").`);
258
- process.exit(1);
259
- }
260
- const preset = args.template
261
- ? {
262
- label: `custom: ${args.template}`,
263
- repo: args.template,
264
- skill: "deploy",
265
- }
266
- : ENGINES.get(args.engine);
267
- if (!preset) {
268
- consola.error(`Unknown engine: ${args.engine}. Use one of: ${ENGINE_IDS.join(", ")}.`);
269
- process.exit(1);
270
- }
271
- const target = args.here ? process.cwd() : path.resolve(process.cwd(), slug);
272
- if (!args.here) {
273
- if (existsSync(target) && !args.force) {
274
- consola.error(`Directory ${target} already exists. Pass --force to overwrite, or pick a different slug.`);
275
- process.exit(1);
276
- }
277
- mkdirSync(target, { recursive: true });
278
- }
279
- consola.start(`Scaffolding ${slug} with ${preset.label}`);
280
- if ("inline" in preset) {
281
- writeInlineTemplate(target, slug, args.force);
282
- }
283
- else {
284
- try {
285
- await fetchTemplate(preset.repo, target, args.force);
286
- }
287
- catch (error) {
288
- consola.error(`Failed to fetch template ${preset.repo}: ${error instanceof Error ? error.message : String(error)}\n ` +
289
- `Check your network connection, or pass --engine none to scaffold a minimal starter offline.`);
290
- process.exit(1);
291
- }
292
- }
293
- // Post-process: strip template-repo artifacts, then name + vibedgames.json
294
- // + README link to skills.
295
- if (!("inline" in preset)) {
296
- cleanTemplateArtifacts(target);
297
- ensureViteConfig(target);
298
- ensureTypecheckScript(target);
299
- }
300
- rewritePackageName(target, slug);
301
- writeVibedgamesJson(target, slug);
302
- writeReadme(target, slug, preset);
303
- consola.success(`Scaffolded ${slug} in ${target}`);
304
- if ("postNotes" in preset && preset.postNotes) {
305
- for (const n of preset.postNotes) {
306
- consola.info(n);
307
- }
308
- }
309
- consola.log("");
310
- consola.info("Next steps:");
311
- consola.log(` cd ${args.here ? "." : slug}`);
312
- consola.log(" npm install");
313
- consola.log(" npm run dev");
314
- consola.log(" # then: npm run build && vg deploy ./dist");
315
- consola.log("");
316
- consola.log(`Skill to load for engine work: ${preset.skill} (Claude Code: triggered automatically by package.json deps)`);
317
- },
318
- });
@@ -1,66 +0,0 @@
1
- export declare const playtestRunCommand: import("citty").CommandDef<{
2
- readonly field: {
3
- readonly description: "Print a single value from the JSON result, e.g. --field request_id or --field images[0].url. Prints scalars bare for shell capture.";
4
- readonly type: "string";
5
- };
6
- readonly json: {
7
- readonly description: "Print structured JSON to stdout.";
8
- readonly type: "boolean";
9
- };
10
- readonly controls: {
11
- readonly description: `Control scheme: a preset (${string}) or a JSON file. Default: the game's window.__GAME_PLAYTEST__ if it publishes one, else wasd.`;
12
- readonly type: "string";
13
- };
14
- readonly expectProgress: {
15
- readonly description: "Assert the objective advances (score rises) during the run.";
16
- readonly type: "boolean";
17
- };
18
- readonly game: {
19
- readonly description: "Deployed game slug to playtest (mutually exclusive with --url).";
20
- readonly type: "string";
21
- };
22
- readonly goal: {
23
- readonly description: "What the playtester is trying to do — what wins, what kills, which way is progress. Overrides the scheme's goal.";
24
- readonly type: "string";
25
- };
26
- readonly headed: {
27
- readonly description: "Show the browser.";
28
- readonly type: "boolean";
29
- };
30
- readonly keepOpen: {
31
- readonly description: "Leave the page open afterwards.";
32
- readonly type: "boolean";
33
- };
34
- readonly minDisplacement: {
35
- readonly description: "Per-decision movement that proves input works, in the units of the game's player.x/y (default 5 — pixels; a game in world units needs far less). Overrides the scheme's.";
36
- readonly type: "string";
37
- };
38
- readonly model: {
39
- readonly default: "jev-latest";
40
- readonly description: "Decision model id.";
41
- readonly type: "string";
42
- };
43
- readonly pinMove: {
44
- readonly description: "Hold this one move for the whole run and never call the model — for tuning a reflex deterministically, for free. The report's decisions are then yours, not the model's.";
45
- readonly type: "string";
46
- };
47
- readonly seed: {
48
- readonly default: "12345";
49
- readonly description: "Seed for the game's RNG.";
50
- readonly type: "string";
51
- };
52
- readonly tickMs: {
53
- readonly default: string;
54
- readonly description: `Minimum time each decision's inputs stay held (ms). The default caps the playtester near a fast player's cadence; 0 = as fast as decisions arrive.`;
55
- readonly type: "string";
56
- };
57
- readonly ticks: {
58
- readonly default: "60";
59
- readonly description: "Decisions to make.";
60
- readonly type: "string";
61
- };
62
- readonly url: {
63
- readonly description: "Where the game is served (mutually exclusive with --game).";
64
- readonly type: "string";
65
- };
66
- }>;