vibedgames 0.4.1 → 0.5.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.
- package/README.md +1 -1
- package/dist/commands/completions.d.ts +1 -1
- package/dist/commands/completions.js +21 -20
- package/dist/commands/credits.d.ts +5 -5
- package/dist/commands/credits.js +45 -47
- package/dist/commands/deploy.d.ts +10 -10
- package/dist/commands/deploy.js +157 -137
- package/dist/commands/factory.d.ts +1 -1
- package/dist/commands/factory.js +18 -15
- package/dist/commands/fork.d.ts +14 -14
- package/dist/commands/fork.js +53 -45
- package/dist/commands/generate.js +343 -286
- package/dist/commands/init.d.ts +8 -8
- package/dist/commands/init.js +31 -24
- package/dist/commands/login.js +14 -14
- package/dist/commands/logout.js +2 -2
- package/dist/commands/new.d.ts +16 -16
- package/dist/commands/new.js +191 -165
- package/dist/commands/playtest.d.ts +5 -5
- package/dist/commands/playtest.js +103 -97
- package/dist/commands/update.d.ts +7 -7
- package/dist/commands/update.js +22 -17
- package/dist/commands/whoami.d.ts +5 -5
- package/dist/commands/whoami.js +11 -10
- package/dist/index.js +12 -10
- package/dist/lib/api.d.ts +16 -4
- package/dist/lib/api.js +20 -32
- package/dist/lib/archive.d.ts +4 -4
- package/dist/lib/archive.js +123 -102
- package/dist/lib/codex.d.ts +46 -15
- package/dist/lib/codex.js +178 -108
- package/dist/lib/config-file.d.ts +6 -6
- package/dist/lib/config-file.js +33 -30
- package/dist/lib/config.d.ts +8 -8
- package/dist/lib/config.js +38 -30
- package/dist/lib/manifest.d.ts +3 -3
- package/dist/lib/manifest.js +44 -40
- package/dist/lib/media-args.d.ts +8 -6
- package/dist/lib/media-args.js +113 -94
- package/dist/lib/media-download.d.ts +9 -8
- package/dist/lib/media-download.js +158 -144
- package/dist/lib/media-poll.d.ts +8 -7
- package/dist/lib/media-poll.js +38 -32
- package/dist/lib/media-upload.d.ts +1 -1
- package/dist/lib/media-upload.js +30 -29
- package/dist/lib/output.d.ts +34 -11
- package/dist/lib/output.js +28 -20
- package/dist/lib/package-manager.d.ts +3 -3
- package/dist/lib/package-manager.js +27 -22
- package/dist/lib/run.d.ts +4 -4
- package/dist/lib/run.js +7 -4
- package/dist/lib/strict-args.d.ts +4 -4
- package/dist/lib/strict-args.js +29 -19
- package/dist/lib/types.d.ts +16 -2
- package/dist/lib/types.js +10 -4
- package/dist/lib/update.d.ts +4 -4
- package/dist/lib/update.js +47 -35
- package/dist/lib/upload.d.ts +4 -4
- package/dist/lib/upload.js +14 -9
- package/package.json +7 -8
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export declare const initCommand: import("citty").CommandDef<{
|
|
2
2
|
readonly agent: {
|
|
3
|
-
readonly type: "string";
|
|
4
|
-
readonly description: "Comma-separated target agents. Default installs for Claude Code, Cursor, and Codex (symlinked from a shared .agents/skills/ dir). Pass '*' for every supported agent.";
|
|
5
3
|
readonly alias: "a";
|
|
6
4
|
readonly default: "claude-code,cursor,codex";
|
|
5
|
+
readonly description: "Comma-separated target agents. Default installs for Claude Code, Cursor, and Codex (symlinked from a shared .agents/skills/ dir). Pass '*' for every supported agent.";
|
|
6
|
+
readonly type: "string";
|
|
7
7
|
};
|
|
8
8
|
readonly global: {
|
|
9
|
-
readonly type: "boolean";
|
|
10
|
-
readonly description: "Install to user directory instead of project";
|
|
11
|
-
readonly default: false;
|
|
12
9
|
readonly alias: "g";
|
|
10
|
+
readonly default: false;
|
|
11
|
+
readonly description: "Install to user directory instead of project";
|
|
12
|
+
readonly type: "boolean";
|
|
13
13
|
};
|
|
14
14
|
readonly yes: {
|
|
15
|
-
readonly type: "boolean";
|
|
16
|
-
readonly description: "Skip confirmation prompts";
|
|
17
|
-
readonly default: true;
|
|
18
15
|
readonly alias: "y";
|
|
16
|
+
readonly default: true;
|
|
17
|
+
readonly description: "Skip confirmation prompts";
|
|
18
|
+
readonly type: "boolean";
|
|
19
19
|
};
|
|
20
20
|
}>;
|
package/dist/commands/init.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { fileURLToPath } from "node:url";
|
|
2
1
|
import { defineCommand } from "citty";
|
|
3
|
-
import consola from "consola";
|
|
2
|
+
import { consola } from "consola";
|
|
4
3
|
import { detectPackageManager, globalInstallArgs, globalInstallCommand, PKG_NAME, } from "../lib/package-manager.js";
|
|
5
4
|
import { isMissingCommand, run } from "../lib/run.js";
|
|
6
5
|
import { assertKnownFlags } from "../lib/strict-args.js";
|
|
@@ -9,45 +8,50 @@ const DEFAULT_AGENTS = "claude-code,cursor,codex";
|
|
|
9
8
|
const description = "Install/update vibedgames skills and the vg CLI";
|
|
10
9
|
const skillsAddArgs = (agents, global, yes) => {
|
|
11
10
|
const args = ["-y", "skills", "add", REPO];
|
|
12
|
-
for (const agent of agents)
|
|
11
|
+
for (const agent of agents) {
|
|
13
12
|
args.push("-a", agent);
|
|
14
|
-
|
|
13
|
+
}
|
|
14
|
+
if (global) {
|
|
15
15
|
args.push("-g");
|
|
16
|
-
|
|
16
|
+
}
|
|
17
|
+
if (yes) {
|
|
17
18
|
args.push("-y");
|
|
19
|
+
}
|
|
18
20
|
return args;
|
|
19
21
|
};
|
|
20
22
|
const skillsUpdateArgs = (global, yes) => {
|
|
21
23
|
const args = ["-y", "skills", "update"];
|
|
22
|
-
if (global)
|
|
24
|
+
if (global) {
|
|
23
25
|
args.push("-g");
|
|
24
|
-
|
|
26
|
+
}
|
|
27
|
+
if (yes) {
|
|
25
28
|
args.push("-y");
|
|
29
|
+
}
|
|
26
30
|
return args;
|
|
27
31
|
};
|
|
28
32
|
const initArgs = {
|
|
29
33
|
agent: {
|
|
30
|
-
type: "string",
|
|
31
|
-
description: "Comma-separated target agents. Default installs for Claude Code, Cursor, and Codex (symlinked from a shared .agents/skills/ dir). Pass '*' for every supported agent.",
|
|
32
34
|
alias: "a",
|
|
33
35
|
default: DEFAULT_AGENTS,
|
|
36
|
+
description: "Comma-separated target agents. Default installs for Claude Code, Cursor, and Codex (symlinked from a shared .agents/skills/ dir). Pass '*' for every supported agent.",
|
|
37
|
+
type: "string",
|
|
34
38
|
},
|
|
35
39
|
global: {
|
|
36
|
-
type: "boolean",
|
|
37
|
-
description: "Install to user directory instead of project",
|
|
38
|
-
default: false,
|
|
39
40
|
alias: "g",
|
|
41
|
+
default: false,
|
|
42
|
+
description: "Install to user directory instead of project",
|
|
43
|
+
type: "boolean",
|
|
40
44
|
},
|
|
41
45
|
yes: {
|
|
42
|
-
type: "boolean",
|
|
43
|
-
description: "Skip confirmation prompts",
|
|
44
|
-
default: true,
|
|
45
46
|
alias: "y",
|
|
47
|
+
default: true,
|
|
48
|
+
description: "Skip confirmation prompts",
|
|
49
|
+
type: "boolean",
|
|
46
50
|
},
|
|
47
51
|
};
|
|
48
52
|
export const initCommand = defineCommand({
|
|
49
|
-
meta: { name: "init", description },
|
|
50
53
|
args: initArgs,
|
|
54
|
+
meta: { description, name: "init" },
|
|
51
55
|
run: async ({ args, rawArgs }) => {
|
|
52
56
|
assertKnownFlags(rawArgs, initArgs);
|
|
53
57
|
const agents = args.agent
|
|
@@ -57,7 +61,7 @@ export const initCommand = defineCommand({
|
|
|
57
61
|
// Whatever installed this CLI is what should upgrade it. Installing with a
|
|
58
62
|
// different manager writes a second copy into a prefix the shell may not
|
|
59
63
|
// even be looking at, so `vg --version` would not move.
|
|
60
|
-
const manager = detectPackageManager(
|
|
64
|
+
const manager = detectPackageManager(import.meta.filename);
|
|
61
65
|
consola.start("Installing/updating vibedgames skills and the vg CLI (this takes a few minutes — `skills` fetches the repo once per skill)...");
|
|
62
66
|
const [add, cli] = await Promise.all([
|
|
63
67
|
run("npx", skillsAddArgs(agents, args.global, args.yes), { stream: true }),
|
|
@@ -69,25 +73,28 @@ export const initCommand = defineCommand({
|
|
|
69
73
|
"the vg CLI is running from a standalone build — install Node, or add " +
|
|
70
74
|
`the skills yourself with: npx skills add ${REPO}`);
|
|
71
75
|
}
|
|
72
|
-
if (add.output.trim())
|
|
76
|
+
if (add.output.trim()) {
|
|
73
77
|
consola.error(add.output.trim());
|
|
78
|
+
}
|
|
74
79
|
throw new Error(`skills add exited with code ${add.code}`);
|
|
75
80
|
}
|
|
76
81
|
consola.success(`Installed vibedgames skills for ${agents.join(", ")}`);
|
|
77
82
|
const update = await run("npx", skillsUpdateArgs(args.global, args.yes), {
|
|
78
83
|
stream: true,
|
|
79
84
|
});
|
|
80
|
-
if (update.code
|
|
81
|
-
|
|
82
|
-
consola.warn(update.output.trim());
|
|
83
|
-
consola.warn(`'skills update' exited with code ${update.code}. Skills were just installed via 'add', so they should already be current.`);
|
|
85
|
+
if (update.code === 0) {
|
|
86
|
+
consola.success("Refreshed installed skills to latest");
|
|
84
87
|
}
|
|
85
88
|
else {
|
|
86
|
-
|
|
89
|
+
if (update.output.trim()) {
|
|
90
|
+
consola.warn(update.output.trim());
|
|
91
|
+
}
|
|
92
|
+
consola.warn(`'skills update' exited with code ${update.code}. Skills were just installed via 'add', so they should already be current.`);
|
|
87
93
|
}
|
|
88
94
|
if (cli.code !== 0) {
|
|
89
|
-
if (cli.output.trim() && !isMissingCommand(cli))
|
|
95
|
+
if (cli.output.trim() && !isMissingCommand(cli)) {
|
|
90
96
|
consola.warn(cli.output.trim());
|
|
97
|
+
}
|
|
91
98
|
consola.warn(isMissingCommand(cli)
|
|
92
99
|
? `Couldn't find ${manager} to update the vg CLI. Update manually: ${globalInstallCommand(manager)}`
|
|
93
100
|
: `Couldn't install the vg CLI globally (${manager} exit ${cli.code}). Install manually: ${globalInstallCommand(manager)}`);
|
package/dist/commands/login.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { exec } from "node:child_process";
|
|
2
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
2
3
|
import { defineCommand } from "citty";
|
|
3
|
-
import consola from "consola";
|
|
4
|
+
import { consola } from "consola";
|
|
4
5
|
import { createPublicClient } from "../lib/api.js";
|
|
5
6
|
import { getBaseUrl, saveConfig } from "../lib/config.js";
|
|
6
|
-
const POLL_INTERVAL_MS =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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";
|
|
10
13
|
exec(`${cmd} "${url}"`);
|
|
11
|
-
}
|
|
12
|
-
function sleep(ms) {
|
|
13
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
export const loginCommand = defineCommand({
|
|
16
16
|
meta: {
|
|
17
|
-
name: "login",
|
|
18
17
|
description: "Authenticate with vibedgames",
|
|
18
|
+
name: "login",
|
|
19
19
|
},
|
|
20
20
|
run: async () => {
|
|
21
21
|
const baseUrl = getBaseUrl();
|
|
22
22
|
const client = createPublicClient(baseUrl);
|
|
23
|
-
const { code } = await client.auth.cliInit
|
|
23
|
+
const { code } = await client.auth.cliInit();
|
|
24
24
|
consola.box(`Code: ${code}`);
|
|
25
25
|
consola.info("Opening browser to complete authentication...");
|
|
26
26
|
const authUrl = `${baseUrl}/auth/cli?code=${code}`;
|
|
27
27
|
openBrowser(authUrl);
|
|
28
28
|
consola.start("Waiting for confirmation...");
|
|
29
|
-
for (let i = 0; i < MAX_POLLS; i
|
|
29
|
+
for (let i = 0; i < MAX_POLLS; i += 1) {
|
|
30
30
|
await sleep(POLL_INTERVAL_MS);
|
|
31
|
-
const result = await client.auth.cliPoll
|
|
31
|
+
const result = await client.auth.cliPoll({ code });
|
|
32
32
|
if (result.status === "confirmed") {
|
|
33
|
-
saveConfig({ token: result.token
|
|
33
|
+
saveConfig({ baseUrl, token: result.token });
|
|
34
34
|
consola.success("Logged in successfully");
|
|
35
35
|
return;
|
|
36
36
|
}
|
package/dist/commands/logout.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
|
-
import consola from "consola";
|
|
2
|
+
import { consola } from "consola";
|
|
3
3
|
import { clearConfig } from "../lib/config.js";
|
|
4
4
|
export const logoutCommand = defineCommand({
|
|
5
5
|
meta: {
|
|
6
|
-
name: "logout",
|
|
7
6
|
description: "Log out of vibedgames",
|
|
7
|
+
name: "logout",
|
|
8
8
|
},
|
|
9
9
|
run: () => {
|
|
10
10
|
clearConfig();
|
package/dist/commands/new.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
export declare const newCommand: import("citty").CommandDef<{
|
|
2
|
-
readonly slug: {
|
|
3
|
-
readonly type: "positional";
|
|
4
|
-
readonly description: "Lowercase, hyphenated slug — used as the directory name and deploy subdomain.";
|
|
5
|
-
readonly required: true;
|
|
6
|
-
};
|
|
7
2
|
readonly engine: {
|
|
8
|
-
readonly type: "string";
|
|
9
|
-
readonly description: `Engine preset: ${string} (default: phaser).`;
|
|
10
3
|
readonly default: "phaser";
|
|
11
|
-
|
|
12
|
-
readonly template: {
|
|
4
|
+
readonly description: `Engine preset: ${string} (default: phaser).`;
|
|
13
5
|
readonly type: "string";
|
|
14
|
-
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.";
|
|
15
|
-
};
|
|
16
|
-
readonly here: {
|
|
17
|
-
readonly type: "boolean";
|
|
18
|
-
readonly description: "Write into the current directory instead of creating <slug>/.";
|
|
19
|
-
readonly default: false;
|
|
20
6
|
};
|
|
21
7
|
readonly force: {
|
|
22
|
-
readonly
|
|
8
|
+
readonly default: false;
|
|
23
9
|
readonly description: "Overwrite an existing target directory.";
|
|
10
|
+
readonly type: "boolean";
|
|
11
|
+
};
|
|
12
|
+
readonly here: {
|
|
24
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
25
|
};
|
|
26
26
|
}>;
|