@puzzmo/cli 1.0.68 → 1.0.70
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 +12 -4
- package/docs/games-changed.md +28 -10
- package/lib/agents/claude.js.map +1 -1
- package/lib/agents/codex.js.map +1 -1
- package/lib/agents/copilot.js.map +1 -1
- package/lib/agents/gemini.js.map +1 -1
- package/lib/agents/opencode.js.map +1 -1
- package/lib/agents/stream-json-cli.js.map +1 -1
- package/lib/commands/agent-test.js.map +1 -1
- package/lib/commands/changed.js +17 -6
- package/lib/commands/changed.js.map +1 -1
- package/lib/commands/game/create.js.map +1 -1
- package/lib/commands/game/detectRepo.js.map +1 -1
- package/lib/commands/login.js.map +1 -1
- package/lib/commands/migrate.js.map +1 -1
- package/lib/commands/upload.js +15 -12
- package/lib/commands/upload.js.map +1 -1
- package/lib/commands/validate.js.map +1 -1
- package/lib/download/page-downloader.d.ts +1 -1
- package/lib/download/page-downloader.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/queries/__generated__/cliGameRuntimesQuery.graphql.js.map +1 -1
- package/lib/queries/gameRuntimes.js.map +1 -1
- package/lib/skills/mcp-client.d.ts +1 -1
- package/lib/skills/mcp-client.js.map +1 -1
- package/lib/skills/runner.js.map +1 -1
- package/lib/tui/pipeline.js.map +1 -1
- package/lib/util/api.d.ts +1 -1
- package/lib/util/api.js.map +1 -1
- package/lib/util/belay.js.map +1 -1
- package/lib/util/config.d.ts +4 -1
- package/lib/util/config.js +43 -6
- package/lib/util/config.js.map +1 -1
- package/lib/util/createGame.js.map +1 -1
- package/lib/util/discoverGames.js +5 -1
- package/lib/util/discoverGames.js.map +1 -1
- package/lib/util/exec.d.ts +1 -1
- package/lib/util/exec.js.map +1 -1
- package/lib/util/lintPuzzmoFile.js.map +1 -1
- package/lib/util/validatePuzzmoFile.js.map +1 -1
- package/package.json +3 -3
- package/src/commands/changed.ts +21 -6
- package/src/commands/upload.ts +16 -11
- package/src/util/config.ts +45 -6
- package/src/util/discoverGames.ts +7 -1
package/lib/util/exec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/util/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAI7C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/util/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAI7C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,OAAoB,EAAE,EAAE,EAAE;IAChE,QAAQ,CAAC,GAAG,EAAE;QACZ,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,wCAAwC;AACxC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,OAAoB,EAAE,EAAU,EAAE;IAC9E,OAAO,QAAQ,CAAC,GAAG,EAAE;QACnB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC,IAAI,EAAE,CAAA;AACX,CAAC,CAAA;AAED,2BAA2B;AAC3B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,OAAoB,EAAE,EAAE,EAAE;IACnE,QAAQ,CAAC,kBAAkB,OAAO,GAAG,EAAE;QACrC,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,KAAK,EAAE,SAAS;KACjB,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAY,EAAE;IAC1C,IAAI,CAAC;QACH,QAAQ,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC9C,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAED,kDAAkD;AAClD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAwC,EAAE;IAC/E,IAAI,CAAC;QACH,QAAQ,CAAC,gBAAgB,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;QACrE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;IACrE,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lintPuzzmoFile.js","sourceRoot":"","sources":["../../src/util/lintPuzzmoFile.ts"],"names":[],"mappings":"AAEA,+FAA+F;AAC/F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAsB,EAAY,EAAE
|
|
1
|
+
{"version":3,"file":"lintPuzzmoFile.js","sourceRoot":"","sources":["../../src/util/lintPuzzmoFile.ts"],"names":[],"mappings":"AAEA,+FAA+F;AAC/F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAsB,EAAY,EAAE;IACjE,MAAM,QAAQ,GAAa,EAAE,CAAA;IAC7B,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,IAAI,EAAE,CAAA;IAElD,MAAM,YAAY,GAAG,YAAY,CAAC,YAAY,CAAA;IAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,KAAK,MAAM,WAAW,IAAI,YAA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,gBAAgB,CAAC,qBAAqB,CAAC,UAAU,CAAC,EAAE,uCAAuC,CAAC,CAAA;AAE9F,MAAM,gBAAgB,GAAG,CAAC,UAAkB,EAAE,OAAe,EAAY,EAAE;IACzE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAA;IAC/B,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IACrE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAA;AACnB,CAAC,CAAA;AAED,+FAA+F;AAC/F,MAAM,qBAAqB,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAA;AAEjG,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validatePuzzmoFile.js","sourceRoot":"","sources":["../../src/util/validatePuzzmoFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,uBAAuB,CAAA;AAI9D,MAAM,SAAS,GAAG,8DAA8D,CAAA,CAAC,yDAAyD;AAE1I,IAAI,eAAsC,CAAA;AAE1C,uEAAuE;AACvE,MAAM,YAAY,GAAG,KAAK,IAAI,EAAE
|
|
1
|
+
{"version":3,"file":"validatePuzzmoFile.js","sourceRoot":"","sources":["../../src/util/validatePuzzmoFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,uBAAuB,CAAA;AAI9D,MAAM,SAAS,GAAG,8DAA8D,CAAA,CAAC,yDAAyD;AAE1I,IAAI,eAAsC,CAAA;AAE1C,uEAAuE;AAC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
17
|
"registry": "https://registry.npmjs.org/"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "
|
|
21
|
-
"type-check": "
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"type-check": "tsc --noEmit",
|
|
22
22
|
"test": "vitest run"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
package/src/commands/changed.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type ChangedOptions = {
|
|
|
18
18
|
includeUncommitted?: boolean
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
type GameStatus = "changed" | "unchanged" | "new"
|
|
21
|
+
type GameStatus = "changed" | "unchanged" | "new" | "skipped"
|
|
22
22
|
|
|
23
23
|
type ChangedEntry = {
|
|
24
24
|
slug: string
|
|
@@ -29,6 +29,8 @@ type ChangedEntry = {
|
|
|
29
29
|
ref: string
|
|
30
30
|
status: GameStatus
|
|
31
31
|
changedFiles: number
|
|
32
|
+
/** Why the game was left out of the buildable set; only set when status is "skipped" */
|
|
33
|
+
skipReason?: string
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
type EvalResult = { entry: ChangedEntry } | { error: string }
|
|
@@ -79,7 +81,7 @@ export const changed = async (dir: string, options: ChangedOptions = {}) => {
|
|
|
79
81
|
else hardErrors.push(result.error)
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
const buildable = report.filter(
|
|
84
|
+
const buildable = report.filter(isBuildable)
|
|
83
85
|
|
|
84
86
|
if (json) console.log(JSON.stringify(report, null, 2))
|
|
85
87
|
else if (matrix) console.log(JSON.stringify({ include: buildable.map((entry) => ({ dir: entry.dir, slug: entry.slug })) }))
|
|
@@ -87,6 +89,13 @@ export const changed = async (dir: string, options: ChangedOptions = {}) => {
|
|
|
87
89
|
else if (report.length) printTable(report)
|
|
88
90
|
else if (!hardErrors.length) console.log(`No puzzmo.json files found under ${rootDir}`)
|
|
89
91
|
|
|
92
|
+
// Skips go to stderr so --list/--matrix stdout stays machine-readable, but never pass silently.
|
|
93
|
+
const skipped = report.filter((entry) => entry.status === "skipped")
|
|
94
|
+
if (skipped.length && !json) {
|
|
95
|
+
console.error(`\n${skipped.length} game${skipped.length === 1 ? "" : "s"} skipped, they cannot be uploaded from here:`)
|
|
96
|
+
for (const entry of skipped) console.error(` ${entry.slug}: ${entry.skipReason}`)
|
|
97
|
+
}
|
|
98
|
+
|
|
90
99
|
if (hardErrors.length) {
|
|
91
100
|
console.error(`\n${hardErrors.length} error${hardErrors.length === 1 ? "" : "s"}:`)
|
|
92
101
|
for (const message of hardErrors) console.error(` ${message}`)
|
|
@@ -109,14 +118,15 @@ const evaluateGame = async (game: DiscoveredGame, ctx: EvalContext): Promise<Eva
|
|
|
109
118
|
const { slug, teamID } = game.puzzmoFile.game
|
|
110
119
|
const dir = toPosix(path.relative(ctx.repoRoot, game.puzzmoJsonDir)) || "."
|
|
111
120
|
|
|
121
|
+
// A game we have no token for can't be uploaded, so it is skipped rather than failing the run.
|
|
112
122
|
const credential = await resolveServerForTeam(teamID)
|
|
113
123
|
if (!credential) {
|
|
114
124
|
const matches = findTokensForTeam(teamID)
|
|
115
125
|
const message =
|
|
116
126
|
matches.length === 0
|
|
117
|
-
? `
|
|
118
|
-
: `
|
|
119
|
-
return {
|
|
127
|
+
? `no token for team ${teamID}`
|
|
128
|
+
: `token for team ${teamID} is registered against ${matches.map((m) => m.source).join(", ")}, none of which are reachable`
|
|
129
|
+
return { entry: makeEntry(game, dir, null, ctx.refSha, "skipped", 0, message) }
|
|
120
130
|
}
|
|
121
131
|
|
|
122
132
|
let versions: GameVersions | undefined
|
|
@@ -148,6 +158,7 @@ const makeEntry = (
|
|
|
148
158
|
ref: string,
|
|
149
159
|
status: GameStatus,
|
|
150
160
|
changedFiles: number,
|
|
161
|
+
skipReason?: string,
|
|
151
162
|
): ChangedEntry => ({
|
|
152
163
|
slug: game.puzzmoFile.game.slug,
|
|
153
164
|
displayName: game.puzzmoFile.game.displayName,
|
|
@@ -157,6 +168,7 @@ const makeEntry = (
|
|
|
157
168
|
ref,
|
|
158
169
|
status,
|
|
159
170
|
changedFiles,
|
|
171
|
+
...(skipReason ? { skipReason } : {}),
|
|
160
172
|
})
|
|
161
173
|
|
|
162
174
|
/** Fetches a team's per-game runtime SHAs once, memoizing the in-flight promise so concurrent games share the call. */
|
|
@@ -202,10 +214,13 @@ const printTable = (report: ChangedEntry[]) => {
|
|
|
202
214
|
console.log(format(headers))
|
|
203
215
|
for (const row of rows) console.log(format(row))
|
|
204
216
|
|
|
205
|
-
const changedCount = report.filter(
|
|
217
|
+
const changedCount = report.filter(isBuildable).length
|
|
206
218
|
console.log(`\n${changedCount} of ${report.length} game${report.length === 1 ? "" : "s"} changed.`)
|
|
207
219
|
}
|
|
208
220
|
|
|
221
|
+
/** Games worth building: changed or never deployed. Unchanged and skipped ones are left out. */
|
|
222
|
+
const isBuildable = (entry: ChangedEntry): boolean => entry.status === "changed" || entry.status === "new"
|
|
223
|
+
|
|
209
224
|
const getRepoRoot = (cwd: string): string | null => tryGit(["rev-parse", "--show-toplevel"], cwd)
|
|
210
225
|
|
|
211
226
|
const revParseShort = (ref: string, cwd: string): string | null => tryGit(["rev-parse", "--short", ref], cwd)
|
package/src/commands/upload.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execSync } from "node:child_process"
|
|
1
|
+
import { type ExecSyncOptionsWithStringEncoding, execSync } from "node:child_process"
|
|
2
2
|
import crypto from "node:crypto"
|
|
3
3
|
import fs from "node:fs"
|
|
4
4
|
import path from "node:path"
|
|
@@ -76,12 +76,14 @@ export const upload = async (dir: string, options: UploadOptions = {}) => {
|
|
|
76
76
|
for (const game of games) {
|
|
77
77
|
console.log(` - ${game.puzzmoFile.game.slug} (${path.relative(rootDir, game.distDir) || "."})`)
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Always report unloadable files: with a single game they are the only output before exit 1.
|
|
82
|
+
if (discoveryErrors.length) {
|
|
83
|
+
console.error(`${multi ? "\n" : ""}${plural(discoveryErrors.length, "puzzmo.json file")} could not be loaded:`)
|
|
84
|
+
for (const err of discoveryErrors) {
|
|
85
|
+
console.error(` - ${path.relative(rootDir, err.puzzmoJsonPath)}${err.slug ? ` (${err.slug})` : ""}`)
|
|
86
|
+
for (const e of err.errors) console.error(` ${e}`)
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
|
|
@@ -215,7 +217,7 @@ const printSummary = (results: GameResult[], multi: boolean) => {
|
|
|
215
217
|
const failures = results.filter((r): r is GameFailure => !r.ok)
|
|
216
218
|
|
|
217
219
|
if (successes.length === 0) {
|
|
218
|
-
if (
|
|
220
|
+
if (failures.length) console.error(`\n${plural(failures.length, "game")} failed.`)
|
|
219
221
|
return
|
|
220
222
|
}
|
|
221
223
|
|
|
@@ -273,7 +275,7 @@ const collectFiles = (dir: string): string[] => {
|
|
|
273
275
|
/** Tries to get the shortest unique git SHA, returns null if not in a git repo */
|
|
274
276
|
const getGitSHA = (cwd: string): string | null => {
|
|
275
277
|
try {
|
|
276
|
-
return execSync("git rev-parse --short HEAD",
|
|
278
|
+
return execSync("git rev-parse --short HEAD", gitExecOptions(cwd)).trim()
|
|
277
279
|
} catch {
|
|
278
280
|
return null
|
|
279
281
|
}
|
|
@@ -282,7 +284,7 @@ const getGitSHA = (cwd: string): string | null => {
|
|
|
282
284
|
/** Gets the subject line of the latest commit, or null if not in a git repo */
|
|
283
285
|
const getGitMessage = (cwd: string): string | null => {
|
|
284
286
|
try {
|
|
285
|
-
return execSync("git log -1 --pretty=%s",
|
|
287
|
+
return execSync("git log -1 --pretty=%s", gitExecOptions(cwd)).trim() || null
|
|
286
288
|
} catch {
|
|
287
289
|
return null
|
|
288
290
|
}
|
|
@@ -291,7 +293,7 @@ const getGitMessage = (cwd: string): string | null => {
|
|
|
291
293
|
/** Gets the origin remote URL normalized to https, or null if unavailable */
|
|
292
294
|
const getGitRepoURL = (cwd: string): string | null => {
|
|
293
295
|
try {
|
|
294
|
-
const raw = execSync("git config --get remote.origin.url",
|
|
296
|
+
const raw = execSync("git config --get remote.origin.url", gitExecOptions(cwd)).trim()
|
|
295
297
|
return raw ? normalizeRepoURL(raw) : null
|
|
296
298
|
} catch {
|
|
297
299
|
return null
|
|
@@ -413,6 +415,9 @@ const warnAboutAbsoluteScriptURLs = (distDir: string): void => {
|
|
|
413
415
|
/** True for URLs that resolve outside the game's own folder: site-root ("/x"), protocol-relative ("//x"), or fully-qualified ("https://x"). */
|
|
414
416
|
const isAbsoluteAssetURL = (url: string): boolean => url.startsWith("/") || /^[a-z][a-z0-9+.-]*:\/\//i.test(url)
|
|
415
417
|
|
|
418
|
+
/** Git lookups are best-effort, so their stderr is dropped rather than leaked into the upload output */
|
|
419
|
+
const gitExecOptions = (cwd: string): ExecSyncOptionsWithStringEncoding => ({ encoding: "utf-8", cwd, stdio: ["ignore", "pipe", "ignore"] })
|
|
420
|
+
|
|
416
421
|
/** Formats a byte count as a human-readable string */
|
|
417
422
|
const formatBytes = (bytes: number): string => {
|
|
418
423
|
if (bytes < 1024) return `${bytes} B`
|
package/src/util/config.ts
CHANGED
|
@@ -50,14 +50,53 @@ export const removeToken = (source: string): boolean => {
|
|
|
50
50
|
return true
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Returns saved tokens. Env vars override the config file entirely: `PUZZMO_TOKEN`, plus any
|
|
55
|
+
* `PUZZMO_TOKEN_<NAME>` so one environment can hold tokens for several teams.
|
|
56
|
+
*/
|
|
54
57
|
export const getTokens = (): TokenEntry[] => {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
const envTokens = readEnvTokens()
|
|
59
|
+
return envTokens.length ? envTokens : readConfig().tokens
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const envTokenPrefix = "PUZZMO_TOKEN_"
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Reads tokens out of the environment: `PUZZMO_TOKEN` first, then every `PUZZMO_TOKEN_<NAME>`.
|
|
66
|
+
* `<NAME>` is only a label — a token's team comes from its JWT — but it does pick that token's
|
|
67
|
+
* server via `PUZZMO_API_URL_<NAME>`, falling back to `PUZZMO_API_URL` then the default.
|
|
68
|
+
*/
|
|
69
|
+
const readEnvTokens = (): TokenEntry[] => {
|
|
70
|
+
const fallbackSource = process.env.PUZZMO_API_URL ?? defaultSource
|
|
71
|
+
const entries: TokenEntry[] = []
|
|
72
|
+
|
|
73
|
+
const add = (token: string | undefined, source: string) => {
|
|
74
|
+
const trimmed = token?.trim()
|
|
75
|
+
if (!trimmed) return
|
|
76
|
+
entries.push({ source: normalizeSource(source), token: trimmed })
|
|
59
77
|
}
|
|
60
|
-
|
|
78
|
+
|
|
79
|
+
add(process.env.PUZZMO_TOKEN, fallbackSource)
|
|
80
|
+
// Sorted so the token order is stable regardless of how the environment was assembled.
|
|
81
|
+
for (const name of Object.keys(process.env).sort()) {
|
|
82
|
+
if (!name.startsWith(envTokenPrefix)) continue
|
|
83
|
+
const suffix = name.slice(envTokenPrefix.length)
|
|
84
|
+
if (!suffix) continue
|
|
85
|
+
add(process.env[name], process.env[`PUZZMO_API_URL_${suffix}`] ?? fallbackSource)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return dedupeTokens(entries)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Drops repeats of the same token against the same server, keeping the first occurrence */
|
|
92
|
+
const dedupeTokens = (tokens: TokenEntry[]): TokenEntry[] => {
|
|
93
|
+
const seen = new Set<string>()
|
|
94
|
+
return tokens.filter((entry) => {
|
|
95
|
+
const key = `${entry.source} ${entry.token}`
|
|
96
|
+
if (seen.has(key)) return false
|
|
97
|
+
seen.add(key)
|
|
98
|
+
return true
|
|
99
|
+
})
|
|
61
100
|
}
|
|
62
101
|
|
|
63
102
|
/** Best-guess token for clients that don't care which server it points at (e.g. .mcp.json scaffolding) */
|
|
@@ -78,7 +78,13 @@ export const discoverGames = async (rootDir: string, options: DiscoverOptions =
|
|
|
78
78
|
|
|
79
79
|
if (requireDist) {
|
|
80
80
|
if (!distDir) {
|
|
81
|
-
|
|
81
|
+
// output.dir set but missing usually means "not built yet", which the generic message hides.
|
|
82
|
+
const configured = puzzmoFile.output?.dir
|
|
83
|
+
fileErrors.push(
|
|
84
|
+
configured
|
|
85
|
+
? `Build output folder not found for ${puzzmoFile.game.slug}: "${configured}" (${path.resolve(puzzmoJsonDir, configured)}) does not exist. Build the game first, or fix "output.dir" in puzzmo.json.`
|
|
86
|
+
: `Could not find a dist/build folder for ${puzzmoFile.game.slug}. Set "output.dir" in puzzmo.json.`,
|
|
87
|
+
)
|
|
82
88
|
} else if (!hasFiles(distDir)) {
|
|
83
89
|
fileErrors.push(`Dist folder is empty: ${distDir}`)
|
|
84
90
|
}
|