vibedgames 0.8.1 → 0.10.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 (96) hide show
  1. package/README.md +17 -8
  2. package/assets/align-framing.py +242 -0
  3. package/assets/render-model.py +406 -0
  4. package/assets/tilemap-editor.html +630 -0
  5. package/dist/THIRD_PARTY_NOTICES.txt +59 -7
  6. package/dist/chunk-2KVQJKIZ.js +6495 -0
  7. package/dist/chunk-2SBBKY5C.js +16993 -0
  8. package/dist/chunk-2ZKS7V72.js +170 -0
  9. package/dist/{chunk-RAUJA3OY.js → chunk-3HGBIUM5.js} +21 -18
  10. package/dist/chunk-3UGGMFJJ.js +22 -0
  11. package/dist/{chunk-I6O4HIDY.js → chunk-42K3BJJH.js} +163 -131
  12. package/dist/chunk-43P4U7CB.js +104 -0
  13. package/dist/chunk-4FJXCS3K.js +741 -0
  14. package/dist/{chunk-NC5XCGYU.js → chunk-4UU622RK.js} +6 -5
  15. package/dist/{chunk-2QBYTIMH.js → chunk-5535KDYI.js} +1 -1
  16. package/dist/chunk-5YPLKGY3.js +87 -0
  17. package/dist/chunk-6KXXZXSO.js +475 -0
  18. package/dist/chunk-7RPLQWR2.js +91 -0
  19. package/dist/{chunk-C2IRIRAA.js → chunk-A556KALN.js} +15 -14
  20. package/dist/{chunk-N3XAUFKH.js → chunk-ABTUEIRC.js} +576 -301
  21. package/dist/{chunk-PEUP4MZR.js → chunk-AWJNAGPE.js} +6 -3
  22. package/dist/{chunk-QGEITHUP.js → chunk-BN3Q7UEC.js} +22 -19
  23. package/dist/chunk-BZOMEG3X.js +412 -0
  24. package/dist/{chunk-ZYCSYJWX.js → chunk-COSLGSVO.js} +14 -24
  25. package/dist/{chunk-PQDBCZRT.js → chunk-CTY2WZQK.js} +204 -158
  26. package/dist/{chunk-CU7UY5YJ.js → chunk-D2RF35HJ.js} +1 -1
  27. package/dist/chunk-DB7WVFS7.js +80 -0
  28. package/dist/chunk-DOOQUFPG.js +73 -0
  29. package/dist/chunk-E3FJUPLT.js +177 -0
  30. package/dist/chunk-E7NDOZ27.js +428 -0
  31. package/dist/chunk-F42QKWBB.js +39 -0
  32. package/dist/chunk-FXXVXDTW.js +168 -0
  33. package/dist/{chunk-VFFOT7KD.js → chunk-G66HRVDW.js} +1 -1
  34. package/dist/{chunk-CAKBGDCY.js → chunk-GKDUYJ7R.js} +5 -0
  35. package/dist/chunk-GLEW7VJQ.js +45 -0
  36. package/dist/{chunk-MGIASPED.js → chunk-H2C4QUTG.js} +9 -8
  37. package/dist/{chunk-HCMTSR7E.js → chunk-HRKVAXNN.js} +21 -17
  38. package/dist/{chunk-TLRL6FHW.js → chunk-HSMG6U7J.js} +10 -9
  39. package/dist/chunk-HX5Q63UA.js +48 -0
  40. package/dist/chunk-HYOXGNWS.js +53 -0
  41. package/dist/chunk-I5LELJSK.js +22 -0
  42. package/dist/{chunk-6FZPPUQH.js → chunk-JN4WZCR7.js} +5 -4
  43. package/dist/{chunk-QJZ72MSY.js → chunk-K36EOII3.js} +7 -6
  44. package/dist/chunk-KAGVI3CE.js +62 -0
  45. package/dist/chunk-KJK5CB6E.js +58 -0
  46. package/dist/chunk-KLFBAFXD.js +25 -0
  47. package/dist/{chunk-7MKUR7Y3.js → chunk-LONQWRTR.js} +112 -81
  48. package/dist/chunk-LORGE2NB.js +2484 -0
  49. package/dist/{chunk-HKA5LBYW.js → chunk-MEAO33XW.js} +22 -19
  50. package/dist/{chunk-PM5UOIKR.js → chunk-MR5KIFI7.js} +22 -21
  51. package/dist/{chunk-GCX5KQ6A.js → chunk-N2UHAQXC.js} +18 -11
  52. package/dist/chunk-NCX6LYNJ.js +117 -0
  53. package/dist/chunk-OGX4DKIS.js +215 -0
  54. package/dist/chunk-OPUCUUID.js +41 -0
  55. package/dist/chunk-Q2QC6KAZ.js +132 -0
  56. package/dist/{chunk-2GL2WJZX.js → chunk-Q3XQPNF6.js} +14 -14
  57. package/dist/{chunk-RYFO3ZPO.js → chunk-Q5NZNXJE.js} +15 -12
  58. package/dist/{chunk-JT2AU24K.js → chunk-QARXJGI5.js} +1 -1
  59. package/dist/chunk-QLCVLCPM.js +126 -0
  60. package/dist/chunk-R2WVORGD.js +91 -0
  61. package/dist/chunk-RKS7SI5L.js +64 -0
  62. package/dist/{chunk-4BGCA3W7.js → chunk-RPJR3S5S.js} +32 -18
  63. package/dist/chunk-RPSUFZAG.js +3307 -0
  64. package/dist/chunk-RRI23NK2.js +40 -0
  65. package/dist/chunk-S7HYWITX.js +57 -0
  66. package/dist/chunk-SBXCK2I2.js +48 -0
  67. package/dist/chunk-SUSX3QIA.js +62 -0
  68. package/dist/{chunk-PHEDW6C7.js → chunk-SXYQL4GK.js} +16 -7
  69. package/dist/{chunk-ZI6PKVXG.js → chunk-TMPBGXT4.js} +6 -5
  70. package/dist/chunk-TXOE5UY5.js +72 -0
  71. package/dist/chunk-U6DTE5IX.js +124 -0
  72. package/dist/chunk-UPHB5HWO.js +115 -0
  73. package/dist/chunk-UQ7VO6B3.js +91 -0
  74. package/dist/chunk-VB4WLJR2.js +47 -0
  75. package/dist/{chunk-FNYBZNW2.js → chunk-VIEKOGKG.js} +21 -3
  76. package/dist/{chunk-QIVCBUYD.js → chunk-VZEJ2ZHE.js} +18 -18
  77. package/dist/chunk-X75Y7LUW.js +126 -0
  78. package/dist/{chunk-Z4Z24FWO.js → chunk-YNCYMWER.js} +8 -5
  79. package/dist/chunk-ZHLPE6LI.js +71 -0
  80. package/dist/index.js +48 -34
  81. package/package.json +32 -16
  82. package/templates/none/src/main.ts +4 -0
  83. package/templates/none/vite.config.ts +0 -2
  84. package/templates/phaser/src/main.ts +0 -1
  85. package/templates/phaser/src/scenes/game-scene.ts +10 -8
  86. package/templates/phaser/vite.config.ts +0 -2
  87. package/templates/react-r3f/src/app.tsx +3 -1
  88. package/templates/react-r3f/src/main.tsx +1 -0
  89. package/templates/react-r3f/vite.config.ts +0 -2
  90. package/templates/threejs/src/main.ts +10 -1
  91. package/templates/threejs/vite.config.ts +0 -2
  92. package/LICENSE +0 -21
  93. package/dist/chunk-AYJQVZXY.js +0 -39
  94. package/dist/chunk-J6PKNPI2.js +0 -26
  95. package/dist/chunk-MJQSHP3Y.js +0 -415
  96. package/dist/chunk-MYFLYNPO.js +0 -68
@@ -0,0 +1,47 @@
1
+ import { createRequire as __createRequire } from "node:module";
2
+ import { dirname as __pathDirname } from "node:path";
3
+ import { fileURLToPath as __fileURLToPath } from "node:url";
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import {
8
+ failUsage,
9
+ getInt,
10
+ getString,
11
+ main,
12
+ packSpritesheet,
13
+ parseArgs,
14
+ writeJsonFile
15
+ } from "./chunk-2KVQJKIZ.js";
16
+ import "./chunk-2SBBKY5C.js";
17
+ import "./chunk-GKDUYJ7R.js";
18
+
19
+ // src/commands/asset/pack-spritesheet.ts
20
+ var run = (argv) => {
21
+ main(() => {
22
+ const args = parseArgs([...argv], {
23
+ values: ["action", "columns", "fps", "glob", "input-dir", "json-out", "out"]
24
+ });
25
+ const inputDir = getString(args, "input-dir") ?? "";
26
+ const out = getString(args, "out") ?? "";
27
+ if (inputDir === "" || out === "") {
28
+ failUsage("--input-dir and --out are required");
29
+ }
30
+ const columnsSpec = getString(args, "columns");
31
+ const { manifest, sheet } = packSpritesheet(inputDir, out, {
32
+ action: getString(args, "action") ?? "anim",
33
+ columns: columnsSpec === void 0 ? null : getInt(args, "columns", 0),
34
+ fps: getInt(args, "fps", 10),
35
+ glob: getString(args, "glob") ?? "frame-*.png"
36
+ });
37
+ sheet.toFile(out);
38
+ const manifestPath = getString(args, "json-out") ?? out.replace(/\.png$/iu, ".json");
39
+ writeJsonFile(manifestPath, manifest);
40
+ console.log(
41
+ JSON.stringify({ ...manifest, _manifestPath: manifestPath, _sheetPath: out }, null, 2)
42
+ );
43
+ });
44
+ };
45
+ export {
46
+ run
47
+ };
@@ -7,7 +7,7 @@ var __dirname = __pathDirname(__filename);
7
7
  import {
8
8
  defineCommand
9
9
  } from "./chunk-MBXCVCC4.js";
10
- import "./chunk-CAKBGDCY.js";
10
+ import "./chunk-GKDUYJ7R.js";
11
11
 
12
12
  // src/commands/completions.ts
13
13
  var SUPPORTED = /* @__PURE__ */ new Set(["bash", "zsh", "fish"]);
@@ -18,17 +18,35 @@ var SUBCOMMANDS = [
18
18
  "login",
19
19
  "logout",
20
20
  "deploy",
21
+ "deployments",
21
22
  "playtest",
22
23
  "factory",
23
24
  "fork",
24
25
  "generate",
25
26
  "credits",
27
+ "skills",
26
28
  "config",
27
29
  "update",
28
30
  "completions",
29
31
  "whoami"
30
32
  ];
31
- var GENERATE_SUBCOMMANDS = ["run", "status", "models", "schema", "pricing", "docs", "upload"];
33
+ var GENERATE_SUBCOMMANDS = [
34
+ "run",
35
+ "status",
36
+ "models",
37
+ "schema",
38
+ "pricing",
39
+ "docs",
40
+ "upload",
41
+ "image",
42
+ "video",
43
+ "3d",
44
+ "animate-3d",
45
+ "music",
46
+ "sound",
47
+ "speech",
48
+ "remove-background"
49
+ ];
32
50
  var COMMON_FLAGS = ["--help", "--version"];
33
51
  var GENERATE_FLAGS = [
34
52
  "--async",
@@ -144,7 +162,7 @@ var completionsCommand = defineCommand({
144
162
  name: "completions"
145
163
  },
146
164
  run: ({ args }) => {
147
- const shell = String(args.shell ?? "");
165
+ const shell = args.shell ?? "";
148
166
  if (!isShell(shell)) {
149
167
  process.stderr.write(
150
168
  `Unsupported shell "${shell}". Expected: ${[...SUPPORTED].join(", ")}
@@ -4,30 +4,32 @@ import { fileURLToPath as __fileURLToPath } from "node:url";
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import {
8
- authErrorCode,
9
- createClient
10
- } from "./chunk-PQDBCZRT.js";
11
- import "./chunk-Z4Z24FWO.js";
12
- import "./chunk-PEUP4MZR.js";
13
- import {
14
- outputArgs,
15
- writeStructured
16
- } from "./chunk-ZYCSYJWX.js";
17
7
  import {
18
8
  assertKnownFlags
19
9
  } from "./chunk-RZ4DIJQW.js";
10
+ import {
11
+ authErrorCode,
12
+ createClient
13
+ } from "./chunk-CTY2WZQK.js";
14
+ import "./chunk-E3FJUPLT.js";
20
15
  import {
21
16
  getToken
22
- } from "./chunk-RYFO3ZPO.js";
17
+ } from "./chunk-Q5NZNXJE.js";
23
18
  import {
24
- consola
25
- } from "./chunk-CU7UY5YJ.js";
26
- import "./chunk-J6PKNPI2.js";
19
+ outputArgs,
20
+ writeStructured
21
+ } from "./chunk-COSLGSVO.js";
27
22
  import {
28
23
  defineCommand
29
24
  } from "./chunk-MBXCVCC4.js";
30
- import "./chunk-CAKBGDCY.js";
25
+ import {
26
+ consola
27
+ } from "./chunk-D2RF35HJ.js";
28
+ import "./chunk-YNCYMWER.js";
29
+ import "./chunk-AWJNAGPE.js";
30
+ import "./chunk-RPSUFZAG.js";
31
+ import "./chunk-2SBBKY5C.js";
32
+ import "./chunk-GKDUYJ7R.js";
31
33
 
32
34
  // src/commands/credits.ts
33
35
  var creditsArgs = { ...outputArgs };
@@ -94,7 +96,7 @@ var formatWhen = (date, now) => {
94
96
  return date.toLocaleDateString("en-US", opts);
95
97
  };
96
98
  var requireLogin = () => {
97
- if (!getToken()) {
99
+ if ((getToken() ?? "") === "") {
98
100
  consola.warn("Not logged in. Run `vg login` to authenticate.");
99
101
  process.exit(1);
100
102
  }
@@ -123,7 +125,6 @@ var balanceCommand = defineCommand({
123
125
  note: e.note,
124
126
  request_id: e.requestId
125
127
  })),
126
- // Whether `vg credits buy` can take a card payment; false means codes only.
127
128
  purchases_enabled: purchasesEnabled
128
129
  };
129
130
  if (writeStructured(payload, args)) {
@@ -255,7 +256,6 @@ var buyCommand = defineCommand({
255
256
  }
256
257
  });
257
258
  var creditsCommand = defineCommand({
258
- // Declared so citty skips `--field <value>` when looking for a subcommand.
259
259
  args: outputArgs,
260
260
  default: "balance",
261
261
  meta: {
@@ -0,0 +1,126 @@
1
+ import { createRequire as __createRequire } from "node:module";
2
+ import { dirname as __pathDirname } from "node:path";
3
+ import { fileURLToPath as __fileURLToPath } from "node:url";
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+
8
+ // src/lib/build-dir.ts
9
+ import { existsSync } from "node:fs";
10
+ import path from "node:path";
11
+ var BUILD_OUTPUTS = ["dist", "build", "out"];
12
+ var resolveBuildDir = (dir) => {
13
+ if (!existsSync(path.join(dir, "package.json"))) {
14
+ return { dir, kind: "plain" };
15
+ }
16
+ for (const name of BUILD_OUTPUTS) {
17
+ if (existsSync(path.join(dir, name, "index.html"))) {
18
+ return { dir: path.join(dir, name), kind: "build", name };
19
+ }
20
+ }
21
+ return { dir, kind: "unbuilt" };
22
+ };
23
+
24
+ // src/lib/manifest.ts
25
+ import { createHash } from "node:crypto";
26
+ import { readFileSync, readdirSync, statSync } from "node:fs";
27
+ import path2 from "node:path";
28
+
29
+ // ../../packages/contract/src/deploy/content-types.ts
30
+ var CONTENT_TYPES = new Map(
31
+ Object.entries({
32
+ avif: "image/avif",
33
+ cjs: "application/javascript; charset=utf-8",
34
+ css: "text/css; charset=utf-8",
35
+ gif: "image/gif",
36
+ glb: "model/gltf-binary",
37
+ gltf: "model/gltf+json",
38
+ htm: "text/html; charset=utf-8",
39
+ html: "text/html; charset=utf-8",
40
+ ico: "image/x-icon",
41
+ jpeg: "image/jpeg",
42
+ jpg: "image/jpeg",
43
+ js: "application/javascript; charset=utf-8",
44
+ json: "application/json; charset=utf-8",
45
+ m4a: "audio/mp4",
46
+ map: "application/json; charset=utf-8",
47
+ mjs: "application/javascript; charset=utf-8",
48
+ mp3: "audio/mpeg",
49
+ mp4: "video/mp4",
50
+ ogg: "audio/ogg",
51
+ otf: "font/otf",
52
+ png: "image/png",
53
+ svg: "image/svg+xml",
54
+ ttf: "font/ttf",
55
+ txt: "text/plain; charset=utf-8",
56
+ wasm: "application/wasm",
57
+ wav: "audio/wav",
58
+ webm: "video/webm",
59
+ webp: "image/webp",
60
+ woff: "font/woff",
61
+ woff2: "font/woff2",
62
+ xml: "application/xml"
63
+ })
64
+ );
65
+ var contentTypeForPath = (file) => {
66
+ const ext = file.split(".").pop()?.toLowerCase() ?? "";
67
+ return CONTENT_TYPES.get(ext) ?? "application/octet-stream";
68
+ };
69
+
70
+ // src/lib/manifest.ts
71
+ var IGNORED_TOP_LEVEL = /* @__PURE__ */ new Set([
72
+ "node_modules",
73
+ ".git",
74
+ ".turbo",
75
+ ".cache",
76
+ ".DS_Store",
77
+ "vibedgames.json"
78
+ ]);
79
+ var shouldIgnore = (relPath) => {
80
+ const top = relPath.split(path2.sep)[0] ?? "";
81
+ if (IGNORED_TOP_LEVEL.has(top)) {
82
+ return true;
83
+ }
84
+ if (relPath.split(path2.sep).some((seg) => seg.startsWith("."))) {
85
+ return true;
86
+ }
87
+ return false;
88
+ };
89
+ var buildManifest = (rootDir) => {
90
+ const files = [];
91
+ const walk = (dir) => {
92
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
93
+ const abs = path2.join(dir, entry.name);
94
+ const rel = path2.relative(rootDir, abs);
95
+ if (shouldIgnore(rel)) {
96
+ continue;
97
+ }
98
+ if (entry.isDirectory()) {
99
+ walk(abs);
100
+ continue;
101
+ }
102
+ if (!entry.isFile()) {
103
+ continue;
104
+ }
105
+ const stat = statSync(abs);
106
+ const buf = readFileSync(abs);
107
+ const sha256 = createHash("sha256").update(buf).digest("hex");
108
+ const posixPath = rel.split(path2.sep).join("/");
109
+ files.push({
110
+ absolutePath: abs,
111
+ contentType: contentTypeForPath(posixPath),
112
+ path: posixPath,
113
+ sha256,
114
+ size: stat.size
115
+ });
116
+ }
117
+ };
118
+ walk(rootDir);
119
+ return files;
120
+ };
121
+
122
+ export {
123
+ resolveBuildDir,
124
+ contentTypeForPath,
125
+ buildManifest
126
+ };
@@ -6,11 +6,12 @@ var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
7
  import {
8
8
  PKG_NAME
9
- } from "./chunk-PEUP4MZR.js";
9
+ } from "./chunk-AWJNAGPE.js";
10
10
  import {
11
11
  isJsonObject,
12
- isJsonString
13
- } from "./chunk-J6PKNPI2.js";
12
+ isJsonString,
13
+ parseJson
14
+ } from "./chunk-RPSUFZAG.js";
14
15
 
15
16
  // src/lib/package-root.ts
16
17
  import { existsSync, readFileSync } from "node:fs";
@@ -18,7 +19,7 @@ import path from "node:path";
18
19
  var findPackage = (dir) => {
19
20
  const manifestPath = path.join(dir, "package.json");
20
21
  if (existsSync(manifestPath)) {
21
- const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
22
+ const manifest = parseJson(readFileSync(manifestPath, "utf-8"));
22
23
  if (isJsonObject(manifest) && manifest.name === PKG_NAME && isJsonString(manifest.version)) {
23
24
  return { root: dir, version: manifest.version };
24
25
  }
@@ -32,8 +33,10 @@ var findPackage = (dir) => {
32
33
  var found = findPackage(import.meta.dirname);
33
34
  var PACKAGE_ROOT = found.root;
34
35
  var PACKAGE_VERSION = found.version;
36
+ var ASSETS_DIR = path.join(PACKAGE_ROOT, "assets");
35
37
 
36
38
  export {
37
39
  PACKAGE_ROOT,
38
- PACKAGE_VERSION
40
+ PACKAGE_VERSION,
41
+ ASSETS_DIR
39
42
  };
@@ -0,0 +1,71 @@
1
+ import { createRequire as __createRequire } from "node:module";
2
+ import { dirname as __pathDirname } from "node:path";
3
+ import { fileURLToPath as __fileURLToPath } from "node:url";
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ import {
8
+ getFlag,
9
+ getInt,
10
+ inspectAseprite,
11
+ main,
12
+ parseArgs
13
+ } from "./chunk-2KVQJKIZ.js";
14
+ import "./chunk-2SBBKY5C.js";
15
+ import "./chunk-GKDUYJ7R.js";
16
+
17
+ // src/commands/asset/aseprite-inspect.ts
18
+ import { readFileSync } from "node:fs";
19
+ var USAGE = `usage: vg asset aseprite-inspect [-h] [--json] [--pretty] [--decode-cels]
20
+ [--max-decompress-mib MAX_DECOMPRESS_MIB]
21
+ [--palette-entries PALETTE_ENTRIES]
22
+ [--treat-index0-transparent]
23
+ file
24
+
25
+ Inspect an Aseprite .ase/.aseprite file and emit JSON.
26
+
27
+ positional arguments:
28
+ file Path to .ase/.aseprite (sometimes typo .aes).
29
+
30
+ options:
31
+ --json Emit JSON to stdout (default).
32
+ --pretty Pretty-print JSON.
33
+ --decode-cels Zlib-decompress cel/tilemap data for extra inference
34
+ (bounds/summaries).
35
+ --max-decompress-mib MAX_DECOMPRESS_MIB
36
+ Safety limit for decompressed bytes (MiB). Default 64.
37
+ --palette-entries PALETTE_ENTRIES
38
+ How many palette entries to include per palette chunk
39
+ preview. Default 16.
40
+ --treat-index0-transparent
41
+ For indexed sprites, also treat palette index 0 as
42
+ transparent when inferring bounds (heuristic; off by
43
+ default).`;
44
+ var run = (argv) => {
45
+ main(() => {
46
+ const args = parseArgs([...argv], {
47
+ booleans: ["decode-cels", "json", "pretty", "treat-index0-transparent"],
48
+ values: ["max-decompress-mib", "palette-entries"]
49
+ });
50
+ const [file] = args.positionals;
51
+ if (file === void 0) {
52
+ process.stderr.write(`${USAGE}
53
+
54
+ error: the following arguments are required: file
55
+ `);
56
+ process.exit(2);
57
+ }
58
+ const report = inspectAseprite(file, readFileSync(file), {
59
+ decodeCels: getFlag(args, "decode-cels"),
60
+ maxDecompressMib: getInt(args, "max-decompress-mib", 64),
61
+ paletteEntries: getInt(args, "palette-entries", 16),
62
+ treatIndex0Transparent: getFlag(args, "treat-index0-transparent")
63
+ });
64
+ const json = getFlag(args, "pretty") ? JSON.stringify(report, null, 2) : JSON.stringify(report);
65
+ process.stdout.write(`${json}
66
+ `);
67
+ });
68
+ };
69
+ export {
70
+ run
71
+ };
package/dist/index.js CHANGED
@@ -5,18 +5,27 @@ import { fileURLToPath as __fileURLToPath } from "node:url";
5
5
  const require = __createRequire(import.meta.url);
6
6
  var __filename = __fileURLToPath(import.meta.url);
7
7
  var __dirname = __pathDirname(__filename);
8
- import {
9
- PACKAGE_VERSION
10
- } from "./chunk-Z4Z24FWO.js";
11
- import "./chunk-PEUP4MZR.js";
12
- import "./chunk-J6PKNPI2.js";
13
8
  import {
14
9
  defineCommand,
15
10
  runMain
16
11
  } from "./chunk-MBXCVCC4.js";
17
- import "./chunk-CAKBGDCY.js";
12
+ import {
13
+ PACKAGE_VERSION
14
+ } from "./chunk-YNCYMWER.js";
15
+ import "./chunk-AWJNAGPE.js";
16
+ import "./chunk-RPSUFZAG.js";
17
+ import "./chunk-2SBBKY5C.js";
18
+ import "./chunk-GKDUYJ7R.js";
18
19
 
19
20
  // src/index.ts
21
+ for (const stream of [process.stdout, process.stderr]) {
22
+ stream.on("error", (error) => {
23
+ if (error.code === "EPIPE") {
24
+ process.exit(0);
25
+ }
26
+ throw error;
27
+ });
28
+ }
20
29
  var lazy = (load, key) => async () => {
21
30
  const module = await load();
22
31
  return module[key];
@@ -27,50 +36,55 @@ var main = defineCommand({
27
36
  name: "vg",
28
37
  version: PACKAGE_VERSION
29
38
  },
30
- // Each command is imported when it runs, so a call loads that command's code
31
- // and dependencies alone. `vg --help` loads them all, for their descriptions.
32
39
  subCommands: {
33
- completions: lazy(() => import("./chunk-FNYBZNW2.js"), "completionsCommand"),
34
- config: lazy(() => import("./chunk-2GL2WJZX.js"), "configCommand"),
35
- credits: lazy(() => import("./chunk-QIVCBUYD.js"), "creditsCommand"),
36
- deploy: lazy(() => import("./chunk-MJQSHP3Y.js"), "deployCommand"),
37
- factory: lazy(() => import("./chunk-QJZ72MSY.js"), "factoryCommand"),
38
- fork: lazy(() => import("./chunk-HKA5LBYW.js"), "forkCommand"),
39
- generate: lazy(() => import("./chunk-N3XAUFKH.js"), "generateCommand"),
40
- init: lazy(() => import("./chunk-MGIASPED.js"), "initCommand"),
41
- login: lazy(() => import("./chunk-MYFLYNPO.js"), "loginCommand"),
42
- logout: lazy(() => import("./chunk-PHEDW6C7.js"), "logoutCommand"),
43
- new: lazy(() => import("./chunk-QGEITHUP.js"), "newCommand"),
44
- // `run` is the one `vg playtest` verb that is ours rather than
45
- // agent-browser's: the model-driven playtest. index.ts routes every other
46
- // `vg playtest …` straight to the binary below. Only the meta is reused:
47
- // citty runs a parent's `run` AFTER its subcommand, so carrying the
48
- // passthrough here would forward `run …` to agent-browser once the
49
- // playtest had finished and turn every passing run into an exit 1.
40
+ asset: lazy(async () => await import("./chunk-Q2QC6KAZ.js"), "assetCommand"),
41
+ check: lazy(async () => await import("./chunk-SBXCK2I2.js"), "checkCommand"),
42
+ completions: lazy(async () => await import("./chunk-VIEKOGKG.js"), "completionsCommand"),
43
+ config: lazy(async () => await import("./chunk-Q3XQPNF6.js"), "configCommand"),
44
+ credits: lazy(async () => await import("./chunk-VZEJ2ZHE.js"), "creditsCommand"),
45
+ deploy: lazy(async () => await import("./chunk-E7NDOZ27.js"), "deployCommand"),
46
+ deployments: lazy(async () => await import("./chunk-2ZKS7V72.js"), "deploymentsCommand"),
47
+ distribute: lazy(async () => await import("./chunk-LORGE2NB.js"), "distributeCommand"),
48
+ factory: lazy(async () => await import("./chunk-K36EOII3.js"), "factoryCommand"),
49
+ fork: lazy(async () => await import("./chunk-MEAO33XW.js"), "forkCommand"),
50
+ generate: lazy(async () => await import("./chunk-ABTUEIRC.js"), "generateCommand"),
51
+ init: lazy(async () => await import("./chunk-H2C4QUTG.js"), "initCommand"),
52
+ login: lazy(async () => await import("./chunk-43P4U7CB.js"), "loginCommand"),
53
+ logout: lazy(async () => await import("./chunk-SXYQL4GK.js"), "logoutCommand"),
54
+ new: lazy(async () => await import("./chunk-BN3Q7UEC.js"), "newCommand"),
50
55
  playtest: async () => {
51
- const { playtestCommand } = await import("./chunk-TLRL6FHW.js");
56
+ const { playtestCommand } = await import("./chunk-HSMG6U7J.js");
52
57
  return defineCommand({
53
58
  meta: playtestCommand.meta,
54
59
  subCommands: {
55
- run: lazy(() => import("./chunk-7MKUR7Y3.js"), "playtestRunCommand")
60
+ run: lazy(async () => await import("./chunk-LONQWRTR.js"), "playtestRunCommand")
56
61
  }
57
62
  });
58
63
  },
59
- update: lazy(() => import("./chunk-PM5UOIKR.js"), "updateCommand"),
60
- whoami: lazy(() => import("./chunk-HCMTSR7E.js"), "whoamiCommand")
64
+ skills: lazy(async () => await import("./chunk-UPHB5HWO.js"), "skillsCommand"),
65
+ update: lazy(async () => await import("./chunk-MR5KIFI7.js"), "updateCommand"),
66
+ whoami: lazy(async () => await import("./chunk-HRKVAXNN.js"), "whoamiCommand")
61
67
  }
62
68
  });
63
69
  var subcommand = process.argv.at(2);
64
- if (subcommand && !["update", "init", "completions"].includes(subcommand)) {
65
- const { maybeScheduleAutoUpdate } = await import("./chunk-NC5XCGYU.js");
70
+ if (subcommand !== void 0 && subcommand !== "" && !["update", "init", "completions"].includes(subcommand)) {
71
+ const { maybeScheduleAutoUpdate } = await import("./chunk-4UU622RK.js");
66
72
  maybeScheduleAutoUpdate();
67
73
  }
68
74
  if (subcommand === "factory") {
69
- const { runFactory } = await import("./chunk-QJZ72MSY.js");
75
+ const { runFactory } = await import("./chunk-K36EOII3.js");
70
76
  runFactory(process.argv.slice(3));
71
77
  }
72
78
  if (subcommand === "playtest" && process.argv.at(3) !== "run") {
73
- const { runPlaytest } = await import("./chunk-TLRL6FHW.js");
79
+ const { runPlaytest } = await import("./chunk-HSMG6U7J.js");
74
80
  runPlaytest(process.argv.slice(3));
75
81
  }
76
- await runMain(main);
82
+ if (subcommand === "asset") {
83
+ const { runAsset } = await import("./chunk-Q2QC6KAZ.js");
84
+ await runAsset(process.argv.slice(3));
85
+ } else if (subcommand === "check") {
86
+ const { runCheck } = await import("./chunk-SBXCK2I2.js");
87
+ await runCheck(process.argv.slice(3));
88
+ } else {
89
+ await runMain(main);
90
+ }
package/package.json CHANGED
@@ -1,34 +1,50 @@
1
1
  {
2
2
  "name": "vibedgames",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "vg": "./dist/index.js"
7
7
  },
8
8
  "files": [
9
+ "assets",
9
10
  "dist",
10
11
  "templates"
11
12
  ],
12
13
  "type": "module",
14
+ "scripts": {
15
+ "build": "node scripts/build.ts",
16
+ "dev": "node scripts/build.ts --watch",
17
+ "clean": "rm -rf .turbo dist node_modules",
18
+ "test": "node --import tsx --test \"test/*.test.ts\" \"src/**/*.test.ts\"",
19
+ "typecheck": "tsc --noEmit && tsc --noEmit -p templates/none && tsc --noEmit -p templates/phaser && tsc --noEmit -p templates/react-r3f && tsc --noEmit -p templates/threejs"
20
+ },
13
21
  "devDependencies": {
14
- "@kyh/tsconfig": "^1.2.0",
15
- "@orpc/client": "2.0.0-beta.42",
16
- "@repo/contract": "^0.1.0",
22
+ "@kyh/tsconfig": "catalog:",
23
+ "@orpc/client": "catalog:",
24
+ "@react-three/drei": "^10.7.9",
25
+ "@react-three/fiber": "^9.8.2",
26
+ "@repo/asset-tools": "workspace:^",
27
+ "@repo/contract": "workspace:^",
17
28
  "@types/cross-spawn": "^6.0.6",
18
- "@types/node": "^26.6.4",
29
+ "@types/node": "catalog:",
30
+ "@types/react": "catalog:",
31
+ "@types/react-dom": "catalog:",
32
+ "@types/three": "^0.186.0",
33
+ "@vitejs/plugin-react": "catalog:",
19
34
  "citty": "^0.2.2",
20
35
  "consola": "^3.4.2",
21
36
  "cross-spawn": "^7.0.6",
22
37
  "esbuild": "^0.28.2",
23
- "ignore": "^7.0.12",
24
- "tar": "^7.5.22",
25
- "typescript": "^7.0.2"
26
- },
27
- "scripts": {
28
- "build": "node scripts/build.mjs",
29
- "dev": "node scripts/build.mjs --watch",
30
- "clean": "rm -rf .turbo dist node_modules",
31
- "test": "node --import tsx --test test/*.test.ts",
32
- "typecheck": "tsc --noEmit"
38
+ "fflate": "^0.8.3",
39
+ "ignore": "^7.0.16",
40
+ "msw": "2.11.3",
41
+ "phaser": "^4.2.1",
42
+ "react": "catalog:",
43
+ "react-dom": "catalog:",
44
+ "tar": "^7.5.23",
45
+ "three": "^0.186.1",
46
+ "typescript": "catalog:",
47
+ "vite": "catalog:",
48
+ "zod": "catalog:"
33
49
  }
34
- }
50
+ }
@@ -1,10 +1,14 @@
1
1
  const host = document.querySelector("#game");
2
2
  const canvas = document.createElement("canvas");
3
+
3
4
  canvas.width = 800;
5
+
4
6
  canvas.height = 600;
7
+
5
8
  host?.append(canvas);
6
9
 
7
10
  const ctx = canvas.getContext("2d");
11
+
8
12
  if (ctx) {
9
13
  ctx.fillStyle = "#fff";
10
14
  ctx.textAlign = "center";
@@ -1,7 +1,5 @@
1
1
  import { defineConfig } from "vite";
2
2
 
3
- // A relative base keeps built asset URLs relative, so the bundle works wherever it is
4
- // hosted — including {slug}.vibedgames.com after `vg deploy ./dist`.
5
3
  export default defineConfig({
6
4
  base: "./",
7
5
  server: { port: 5173 },
@@ -7,7 +7,6 @@ const config: Types.Core.GameConfig = {
7
7
  backgroundColor: "#0e1020",
8
8
  parent: "game",
9
9
  physics: { arcade: { debug: false }, default: "arcade" },
10
- // A fixed 960×540 world, letterboxed to fit any window.
11
10
  scale: { autoCenter: Scale.CENTER_BOTH, height: 540, mode: Scale.FIT, width: 960 },
12
11
  scene: [GameScene],
13
12
  type: AUTO,