vibedgames 0.8.0 → 0.9.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 (40) hide show
  1. package/README.md +14 -6
  2. package/dist/THIRD_PARTY_NOTICES.txt +58 -6
  3. package/dist/{chunk-FNYBZNW2.js → chunk-25BAMW5X.js} +3 -1
  4. package/dist/{chunk-SAANBZ25.js → chunk-2VUUMXAQ.js} +4 -4
  5. package/dist/{chunk-XK5RZQMX.js → chunk-355VG7EO.js} +14 -13
  6. package/dist/{chunk-I6O4HIDY.js → chunk-3HUWAJQH.js} +76 -61
  7. package/dist/{chunk-2QBYTIMH.js → chunk-5535KDYI.js} +1 -1
  8. package/dist/chunk-56OY4TEP.js +20125 -0
  9. package/dist/{chunk-XDC7QGOF.js → chunk-6EWHKL7Z.js} +14 -6
  10. package/dist/{chunk-6FZPPUQH.js → chunk-7CXMMC5S.js} +1 -1
  11. package/dist/chunk-7QZSDU52.js +26 -0
  12. package/dist/{chunk-AZGENOOR.js → chunk-AXTLPJ2F.js} +5 -4
  13. package/dist/{chunk-IO6OM6WM.js → chunk-BMTHAVMS.js} +7 -33
  14. package/dist/{chunk-CU7UY5YJ.js → chunk-D2RF35HJ.js} +1 -1
  15. package/dist/chunk-FC233UKH.js +170 -0
  16. package/dist/{chunk-CAKBGDCY.js → chunk-GKDUYJ7R.js} +5 -0
  17. package/dist/{chunk-TYVYWBY6.js → chunk-H3IPLBXQ.js} +9 -8
  18. package/dist/{chunk-TMK6V5FV.js → chunk-HNRVSBRK.js} +7 -7
  19. package/dist/chunk-K2U7L4RU.js +183 -0
  20. package/dist/{chunk-PQDBCZRT.js → chunk-KZBZNTM4.js} +203 -153
  21. package/dist/{chunk-GUF6ADBF.js → chunk-LXS3NJYD.js} +8 -7
  22. package/dist/{chunk-W5XP4ZVU.js → chunk-LY2GQ32S.js} +11 -10
  23. package/dist/{chunk-K5SC6SXO.js → chunk-NDHXM4PL.js} +5 -5
  24. package/dist/{chunk-HASKWB6B.js → chunk-OD2MNYXD.js} +48 -22
  25. package/dist/{chunk-JT2AU24K.js → chunk-QARXJGI5.js} +1 -1
  26. package/dist/{chunk-RYFO3ZPO.js → chunk-RXHTGX7C.js} +9 -2
  27. package/dist/chunk-ST5FC2W3.js +95 -0
  28. package/dist/chunk-TBQ5BU3Q.js +39 -0
  29. package/dist/{chunk-RIGKOLNN.js → chunk-UFR6G6BL.js} +40 -65
  30. package/dist/{chunk-CZPKN32Z.js → chunk-US6QZICZ.js} +10 -10
  31. package/dist/{chunk-Y552BNFZ.js → chunk-UXCWSWWX.js} +7 -7
  32. package/dist/chunk-UZM6OSW5.js +113 -0
  33. package/dist/{chunk-FL6IFBUF.js → chunk-WSRIF6K4.js} +4 -4
  34. package/dist/chunk-X75Y7LUW.js +126 -0
  35. package/dist/chunk-Z5TFZQ5U.js +2478 -0
  36. package/dist/{chunk-H4NBRFBY.js → chunk-ZCYWDKYP.js} +30 -5
  37. package/dist/index.js +30 -19
  38. package/package.json +6 -5
  39. package/dist/chunk-RNBUX5VF.js +0 -68
  40. package/dist/chunk-X4ZABSCN.js +0 -415
@@ -0,0 +1,113 @@
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
+ getBaseUrl
9
+ } from "./chunk-RXHTGX7C.js";
10
+ import {
11
+ isJsonOutput,
12
+ outputArgs,
13
+ writeStructured
14
+ } from "./chunk-ZYCSYJWX.js";
15
+ import {
16
+ assertKnownFlags
17
+ } from "./chunk-RZ4DIJQW.js";
18
+ import {
19
+ consola
20
+ } from "./chunk-D2RF35HJ.js";
21
+ import {
22
+ isJsonObject,
23
+ isJsonString
24
+ } from "./chunk-J6PKNPI2.js";
25
+ import {
26
+ defineCommand
27
+ } from "./chunk-MBXCVCC4.js";
28
+ import "./chunk-GKDUYJ7R.js";
29
+
30
+ // src/commands/skills.ts
31
+ var skillsArgs = {
32
+ name: {
33
+ description: "A skill's name; omit to list every skill and what it is for.",
34
+ required: false,
35
+ type: "positional"
36
+ },
37
+ ...outputArgs
38
+ };
39
+ var discoveryUrl = (path) => new URL(`/.well-known/agent-skills/${path}`, getBaseUrl());
40
+ var fetchOrExit = async (url, doing) => {
41
+ try {
42
+ return await fetch(url);
43
+ } catch (error) {
44
+ consola.error(`${doing}: ${error instanceof Error ? error.message : String(error)}`);
45
+ process.exit(1);
46
+ }
47
+ };
48
+ var summaries = (index) => {
49
+ const skills = isJsonObject(index) ? index.skills : void 0;
50
+ if (!Array.isArray(skills)) {
51
+ return [];
52
+ }
53
+ return skills.flatMap((entry) => {
54
+ if (!isJsonObject(entry) || !isJsonString(entry.name) || !isJsonString(entry.description)) {
55
+ return [];
56
+ }
57
+ return [{ description: entry.description, name: entry.name }];
58
+ });
59
+ };
60
+ var listSkills = async () => {
61
+ const res = await fetchOrExit(discoveryUrl("index.json"), "Could not list the skills");
62
+ if (!res.ok) {
63
+ consola.error(`Could not list the skills: ${res.status} ${res.statusText}`);
64
+ process.exit(1);
65
+ }
66
+ const index = JSON.parse(await res.text());
67
+ return summaries(index);
68
+ };
69
+ var skillsCommand = defineCommand({
70
+ args: skillsArgs,
71
+ meta: {
72
+ description: "The game-studio skills: list them, or print one's SKILL.md (how to build, art-direct, add multiplayer to, balance and ship a browser game).",
73
+ name: "skills"
74
+ },
75
+ run: async ({ args, rawArgs }) => {
76
+ assertKnownFlags(rawArgs, skillsArgs);
77
+ if (!args.name) {
78
+ const skills = await listSkills();
79
+ if (writeStructured({ skills }, args)) {
80
+ return;
81
+ }
82
+ for (const skill of skills) {
83
+ consola.log(`${skill.name} ${skill.description}`);
84
+ }
85
+ return;
86
+ }
87
+ const name = args.name.trim();
88
+ const res = await fetchOrExit(
89
+ discoveryUrl(`${encodeURIComponent(name)}/SKILL.md`),
90
+ `Could not fetch ${name}`
91
+ );
92
+ if (res.status === 404) {
93
+ consola.error(`No skill "${name}". Run \`vg skills\` to list them.`);
94
+ process.exit(1);
95
+ }
96
+ if (!res.ok) {
97
+ consola.error(`Could not fetch ${name}: ${res.status} ${res.statusText}`);
98
+ process.exit(1);
99
+ }
100
+ const content = await res.text();
101
+ if (isJsonOutput(args) || args.field) {
102
+ const listed = await listSkills();
103
+ const summary = listed.find((skill) => skill.name === name);
104
+ writeStructured({ content, description: summary?.description ?? "", name }, args);
105
+ return;
106
+ }
107
+ process.stdout.write(content.endsWith("\n") ? content : `${content}
108
+ `);
109
+ }
110
+ });
111
+ export {
112
+ skillsCommand
113
+ };
@@ -9,11 +9,11 @@ import {
9
9
  isNewerVersion,
10
10
  markUpdateChecked,
11
11
  maybeScheduleAutoUpdate
12
- } from "./chunk-SAANBZ25.js";
13
- import "./chunk-6FZPPUQH.js";
14
- import "./chunk-RYFO3ZPO.js";
12
+ } from "./chunk-2VUUMXAQ.js";
13
+ import "./chunk-7CXMMC5S.js";
14
+ import "./chunk-RXHTGX7C.js";
15
15
  import "./chunk-J6PKNPI2.js";
16
- import "./chunk-CAKBGDCY.js";
16
+ import "./chunk-GKDUYJ7R.js";
17
17
  export {
18
18
  fetchLatestVersion,
19
19
  isNewerVersion,
@@ -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
+ };