@bitmagic/cli 0.1.54 → 0.1.55-dev.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 +43 -2
- package/dist/cli.d.ts +23 -1
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/cover.d.ts +13 -2
- package/dist/commands/cover.js +21 -7
- package/dist/commands/cover.js.map +1 -1
- package/dist/commands/forge.d.ts +14 -0
- package/dist/commands/forge.js +41 -3
- package/dist/commands/forge.js.map +1 -1
- package/dist/commands/generate.d.ts +12 -0
- package/dist/commands/generate.js +77 -24
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.js +4 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/ios.d.ts +2 -0
- package/dist/commands/ios.js +333 -0
- package/dist/commands/ios.js.map +1 -0
- package/dist/commands/reference.d.ts +41 -0
- package/dist/commands/reference.js +398 -0
- package/dist/commands/reference.js.map +1 -0
- package/dist/generate/stream.d.ts +6 -0
- package/dist/generate/stream.js +2 -1
- package/dist/generate/stream.js.map +1 -1
- package/dist/ios/app-config.d.ts +54 -0
- package/dist/ios/app-config.js +109 -0
- package/dist/ios/app-config.js.map +1 -0
- package/dist/ios/collect-urls.d.ts +73 -0
- package/dist/ios/collect-urls.js +230 -0
- package/dist/ios/collect-urls.js.map +1 -0
- package/dist/ios/icon.d.ts +12 -0
- package/dist/ios/icon.js +70 -0
- package/dist/ios/icon.js.map +1 -0
- package/dist/ios/local-server.d.ts +11 -0
- package/dist/ios/local-server.js +88 -0
- package/dist/ios/local-server.js.map +1 -0
- package/dist/ios/paths.d.ts +21 -0
- package/dist/ios/paths.js +23 -0
- package/dist/ios/paths.js.map +1 -0
- package/dist/ios/record-validate.d.ts +25 -0
- package/dist/ios/record-validate.js +98 -0
- package/dist/ios/record-validate.js.map +1 -0
- package/dist/ios/transform.d.ts +47 -0
- package/dist/ios/transform.js +67 -0
- package/dist/ios/transform.js.map +1 -0
- package/dist/ios/vendor.d.ts +29 -0
- package/dist/ios/vendor.js +113 -0
- package/dist/ios/vendor.js.map +1 -0
- package/dist/ios/xcode-template.d.ts +11 -0
- package/dist/ios/xcode-template.js +615 -0
- package/dist/ios/xcode-template.js.map +1 -0
- package/dist/ios/xcodebuild.d.ts +71 -0
- package/dist/ios/xcodebuild.js +216 -0
- package/dist/ios/xcodebuild.js.map +1 -0
- package/dist/project/jobs.d.ts +1 -1
- package/dist/project/reference-file.d.ts +44 -0
- package/dist/project/reference-file.js +94 -0
- package/dist/project/reference-file.js.map +1 -0
- package/dist/project/reference.d.ts +78 -0
- package/dist/project/reference.js +175 -0
- package/dist/project/reference.js.map +1 -0
- package/dist/scaffold/project-files.js +19 -16
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/scaffold/reference-guidance.d.ts +20 -0
- package/dist/scaffold/reference-guidance.js +79 -0
- package/dist/scaffold/reference-guidance.js.map +1 -0
- package/dist/verify/browser.d.ts +8 -0
- package/dist/verify/browser.js +2 -0
- package/dist/verify/browser.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `bitmagic ios` — package the game as a native iOS app and ship it toward the App Store.
|
|
3
|
+
* Design: docs/ios-export-design.md.
|
|
4
|
+
*
|
|
5
|
+
* build bundle → vendor every asset → prove the game boots offline → generate the Xcode
|
|
6
|
+
* shell → xcodebuild. Simulator .app by default (no signing); `--ipa` for a signed
|
|
7
|
+
* store build; `--run` installs and launches on a simulator.
|
|
8
|
+
* submit upload the archive `build --ipa` produced to App Store Connect (TestFlight).
|
|
9
|
+
*
|
|
10
|
+
* Every iOS build is a MOBILE build: the shell boots `?platform=mobile`, the engine's own
|
|
11
|
+
* override, so a desktop-primary game still gets touch controls and mobile budgets. The
|
|
12
|
+
* project's `primaryPlatform` gates nothing here.
|
|
13
|
+
*
|
|
14
|
+
* Exit codes: 1 toolchain/build failure, 3 missing prerequisite (named remedy), 5 the packaged
|
|
15
|
+
* game failed offline validation, 6 signing/upload refusal.
|
|
16
|
+
*/
|
|
17
|
+
import { defineCommand } from 'citty';
|
|
18
|
+
import * as fs from 'fs';
|
|
19
|
+
import * as os from 'os';
|
|
20
|
+
import * as path from 'path';
|
|
21
|
+
import { CliError } from '../errors.js';
|
|
22
|
+
import { createOutput } from '../output.js';
|
|
23
|
+
import { loadProjectContext } from '../project/context.js';
|
|
24
|
+
import { buildBundlePaths, readBuildManifest, runBuild } from '../publish/bundle.js';
|
|
25
|
+
import { computeFingerprint } from '../publish/fingerprint.js';
|
|
26
|
+
import { coverImagePath } from './cover.js';
|
|
27
|
+
import { resolveAppConfig } from '../ios/app-config.js';
|
|
28
|
+
import { collectUrls } from '../ios/collect-urls.js';
|
|
29
|
+
import { iosPaths } from '../ios/paths.js';
|
|
30
|
+
import { runPackagedCheck } from '../ios/record-validate.js';
|
|
31
|
+
import { transformBundleHtml } from '../ios/transform.js';
|
|
32
|
+
import { vendorBasePathFor, vendorUrls } from '../ios/vendor.js';
|
|
33
|
+
import { writeAppIcon } from '../ios/icon.js';
|
|
34
|
+
import { stampXcodeProject, TARGET_NAME } from '../ios/xcode-template.js';
|
|
35
|
+
import { archiveAndExportIpa, buildSimulatorApp, preflightXcodebuild, runOnSimulator, uploadArchive, } from '../ios/xcodebuild.js';
|
|
36
|
+
/** The bundle to package: reused when the source is unchanged, rebuilt otherwise — publish's rule. */
|
|
37
|
+
function ensureBundle(context, output) {
|
|
38
|
+
const fingerprint = computeFingerprint(context.root);
|
|
39
|
+
if (readBuildManifest(context.root)?.fingerprint !== fingerprint) {
|
|
40
|
+
output.info('Building the game bundle…');
|
|
41
|
+
runBuild(context.root, context.metadata.engineVersion);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
output.info('Reusing the existing bundle (source unchanged).');
|
|
45
|
+
}
|
|
46
|
+
const { htmlPath } = buildBundlePaths(context.root);
|
|
47
|
+
try {
|
|
48
|
+
return fs.readFileSync(htmlPath, 'utf-8');
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
throw new CliError(`The built bundle at ${htmlPath} is missing. Run \`bitmagic build\`, then package again.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Stage the payload afresh: vendored files land here, then the transformed page. The
|
|
56
|
+
* sw-cache-buster stub rides along so the engine's localhost-only service-worker registration
|
|
57
|
+
* finds its file during the validation passes; on device the hostname gate skips it entirely.
|
|
58
|
+
*/
|
|
59
|
+
function stagePayload(paths, root) {
|
|
60
|
+
fs.rmSync(paths.payloadDir, { recursive: true, force: true });
|
|
61
|
+
fs.mkdirSync(paths.payloadDir, { recursive: true });
|
|
62
|
+
const stub = path.join(root, 'sw-cache-buster.js');
|
|
63
|
+
if (fs.existsSync(stub)) {
|
|
64
|
+
fs.copyFileSync(stub, path.join(paths.payloadDir, 'sw-cache-buster.js'));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function runIosBuild(args) {
|
|
68
|
+
const output = createOutput(args.json === true);
|
|
69
|
+
const context = loadProjectContext();
|
|
70
|
+
preflightXcodebuild();
|
|
71
|
+
const paths = iosPaths(context.root);
|
|
72
|
+
const builtHtml = ensureBundle(context, output);
|
|
73
|
+
const config = resolveAppConfig({
|
|
74
|
+
root: context.root,
|
|
75
|
+
gameId: context.metadata.gameId,
|
|
76
|
+
configPath: paths.configPath,
|
|
77
|
+
nameOverride: args.name,
|
|
78
|
+
teamOverride: args.team,
|
|
79
|
+
});
|
|
80
|
+
if (args.ipa === true && config.teamId === undefined) {
|
|
81
|
+
throw new CliError('Building a signed .ipa needs your Apple Developer team id — pass `--team <TEAMID>` once '
|
|
82
|
+
+ '(it is remembered). The id is on https://developer.apple.com/account under Membership.', 3);
|
|
83
|
+
}
|
|
84
|
+
const collected = await collectUrls(context.root);
|
|
85
|
+
for (const note of collected.notes)
|
|
86
|
+
output.info(note);
|
|
87
|
+
stagePayload(paths, context.root);
|
|
88
|
+
output.info(`Vendoring ${collected.urls.size} assets into the app…`);
|
|
89
|
+
const vendored = await vendorUrls({
|
|
90
|
+
urls: collected.urls,
|
|
91
|
+
cacheDir: paths.cacheDir,
|
|
92
|
+
payloadDir: paths.payloadDir,
|
|
93
|
+
});
|
|
94
|
+
if (vendored.cacheHits > 0)
|
|
95
|
+
output.info(` ${vendored.cacheHits} from the local cache.`);
|
|
96
|
+
for (const failure of vendored.failures) {
|
|
97
|
+
// A warning, not a refusal: a stale URL the game never loads must not block packaging, and
|
|
98
|
+
// the offline validation below is the gate that catches one the game DOES load.
|
|
99
|
+
output.info(` warning: could not vendor ${failure.url} (${failure.error})`);
|
|
100
|
+
}
|
|
101
|
+
const assetMap = new Map(vendored.entries);
|
|
102
|
+
const baseRewrites = new Map();
|
|
103
|
+
for (const base of collected.bases) {
|
|
104
|
+
const rel = vendorBasePathFor(base);
|
|
105
|
+
if (rel !== null)
|
|
106
|
+
baseRewrites.set(base, rel);
|
|
107
|
+
}
|
|
108
|
+
const indexPath = path.join(paths.payloadDir, 'index.html');
|
|
109
|
+
const writeTransformed = () => {
|
|
110
|
+
const transformed = transformBundleHtml({ html: builtHtml, assetMap, baseRewrites });
|
|
111
|
+
fs.writeFileSync(indexPath, transformed.html);
|
|
112
|
+
return transformed.rewrites;
|
|
113
|
+
};
|
|
114
|
+
const rewrites = writeTransformed();
|
|
115
|
+
output.info(`Asset map: ${assetMap.size} entries, ${rewrites} URL literals rewritten.`);
|
|
116
|
+
let validation;
|
|
117
|
+
if (args['skip-validation'] === true) {
|
|
118
|
+
output.info('Offline validation skipped — this app is NOT confirmed to work without a network.');
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
// Record pass: play the game the way the app will and vendor whatever it still fetched —
|
|
122
|
+
// the empirical net under the static collection (§4e of the design).
|
|
123
|
+
output.info('Recording runtime asset requests (headless Chrome, iPhone viewport)…');
|
|
124
|
+
const recorded = await runPackagedCheck({
|
|
125
|
+
payloadDir: paths.payloadDir,
|
|
126
|
+
artifactDir: path.join(paths.checkDir, 'record'),
|
|
127
|
+
mode: 'record',
|
|
128
|
+
orientation: config.orientation,
|
|
129
|
+
});
|
|
130
|
+
if (recorded.misses.length > 0) {
|
|
131
|
+
output.info(` ${recorded.misses.length} runtime-discovered asset(s) — vendoring those too.`);
|
|
132
|
+
const extra = await vendorUrls({
|
|
133
|
+
urls: recorded.misses,
|
|
134
|
+
cacheDir: paths.cacheDir,
|
|
135
|
+
payloadDir: paths.payloadDir,
|
|
136
|
+
});
|
|
137
|
+
for (const [url, rel] of extra.entries)
|
|
138
|
+
assetMap.set(url, rel);
|
|
139
|
+
for (const failure of extra.failures) {
|
|
140
|
+
output.info(` warning: could not vendor ${failure.url} (${failure.error})`);
|
|
141
|
+
}
|
|
142
|
+
writeTransformed();
|
|
143
|
+
}
|
|
144
|
+
output.info('Validating the app works offline…');
|
|
145
|
+
const offline = await runPackagedCheck({
|
|
146
|
+
payloadDir: paths.payloadDir,
|
|
147
|
+
artifactDir: path.join(paths.checkDir, 'offline'),
|
|
148
|
+
mode: 'offline',
|
|
149
|
+
orientation: config.orientation,
|
|
150
|
+
});
|
|
151
|
+
for (const warning of offline.result.warnings)
|
|
152
|
+
output.info(` warning: ${warning}`);
|
|
153
|
+
validation = { ok: offline.result.ok && offline.misses.length === 0, misses: offline.misses.length };
|
|
154
|
+
if (!validation.ok) {
|
|
155
|
+
const misses = offline.misses.map((url) => ` ✗ still requests ${url}`).join('\n');
|
|
156
|
+
const failures = offline.result.failures.map((failure) => ` ✗ ${failure}`).join('\n');
|
|
157
|
+
throw new CliError('The packaged game does not work without a network:\n'
|
|
158
|
+
+ [failures, misses].filter((section) => section.length > 0).join('\n')
|
|
159
|
+
+ `\nArtifacts: ${path.join(paths.checkDir, 'offline')}`, 5);
|
|
160
|
+
}
|
|
161
|
+
output.info('Offline validation passed — the game renders with no network.');
|
|
162
|
+
}
|
|
163
|
+
stampXcodeProject(paths.projectDir, config);
|
|
164
|
+
const icon = writeAppIcon(path.join(paths.projectDir, 'Assets.xcassets'), coverImagePath(context.root));
|
|
165
|
+
if (icon.source === 'placeholder') {
|
|
166
|
+
output.info('App icon: flat placeholder. Run `bitmagic cover` for generated artwork.');
|
|
167
|
+
}
|
|
168
|
+
let appPath;
|
|
169
|
+
let ipaPath;
|
|
170
|
+
if (args.ipa === true) {
|
|
171
|
+
// teamId was gated non-undefined above, before any slow work.
|
|
172
|
+
const exported = archiveAndExportIpa({
|
|
173
|
+
xcodeprojDir: paths.xcodeprojDir,
|
|
174
|
+
derivedDataDir: paths.derivedDataDir,
|
|
175
|
+
distDir: paths.distDir,
|
|
176
|
+
productName: config.productName,
|
|
177
|
+
teamId: config.teamId ?? '',
|
|
178
|
+
log: output.info,
|
|
179
|
+
});
|
|
180
|
+
ipaPath = exported.ipaPath;
|
|
181
|
+
output.info(`Signed .ipa: ${ipaPath}`);
|
|
182
|
+
output.info('Upload it with `bitmagic ios submit`.');
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
const built = buildSimulatorApp({
|
|
186
|
+
xcodeprojDir: paths.xcodeprojDir,
|
|
187
|
+
derivedDataDir: paths.derivedDataDir,
|
|
188
|
+
productName: config.productName,
|
|
189
|
+
log: output.info,
|
|
190
|
+
});
|
|
191
|
+
appPath = built.appPath;
|
|
192
|
+
if (built.iconSkipped) {
|
|
193
|
+
output.info('Built without the app icon: this Xcode has no simulator runtime matching its SDK. '
|
|
194
|
+
+ 'Run `xcodebuild -downloadPlatform iOS` (or Xcode → Settings → Components) to fix that.');
|
|
195
|
+
}
|
|
196
|
+
output.info(`Simulator app: ${appPath}`);
|
|
197
|
+
if (args.run === true) {
|
|
198
|
+
runOnSimulator(appPath, config.bundleId, output.info);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
output.info('Run it with `bitmagic ios build --run`, or open .bitmagic/ios/App/App.xcodeproj.');
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
output.result({
|
|
205
|
+
ok: true,
|
|
206
|
+
bundleId: config.bundleId,
|
|
207
|
+
productName: config.productName,
|
|
208
|
+
displayName: config.displayName,
|
|
209
|
+
vendoredAssets: assetMap.size,
|
|
210
|
+
...(validation !== undefined ? { offlineValidated: validation.ok } : { offlineValidated: false }),
|
|
211
|
+
...(appPath !== undefined ? { appPath } : {}),
|
|
212
|
+
...(ipaPath !== undefined ? { ipaPath } : {}),
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
export function submitCredentialsPath(baseDir = path.join(os.homedir(), '.bitmagic')) {
|
|
216
|
+
return path.join(baseDir, 'ios-submit.json');
|
|
217
|
+
}
|
|
218
|
+
function readSubmitCredentials(filePath) {
|
|
219
|
+
const remedy = `App Store Connect credentials are not set up. Create an API key under `
|
|
220
|
+
+ 'https://appstoreconnect.apple.com/access/integrations/api (role: App Manager), then write '
|
|
221
|
+
+ `${filePath} as {"keyId": "…", "issuerId": "…", "keyPath": "/path/to/AuthKey_….p8"}.`;
|
|
222
|
+
let parsed;
|
|
223
|
+
try {
|
|
224
|
+
parsed = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
throw new CliError(remedy, 3);
|
|
228
|
+
}
|
|
229
|
+
if (typeof parsed !== 'object' || parsed === null)
|
|
230
|
+
throw new CliError(remedy, 3);
|
|
231
|
+
const record = parsed;
|
|
232
|
+
const { keyId, issuerId, keyPath } = record;
|
|
233
|
+
if (typeof keyId !== 'string' || typeof issuerId !== 'string' || typeof keyPath !== 'string') {
|
|
234
|
+
throw new CliError(remedy, 3);
|
|
235
|
+
}
|
|
236
|
+
if (!fs.existsSync(keyPath)) {
|
|
237
|
+
throw new CliError(`The App Store Connect key at ${keyPath} does not exist.`, 3);
|
|
238
|
+
}
|
|
239
|
+
return { keyId, issuerId, keyPath };
|
|
240
|
+
}
|
|
241
|
+
async function runIosSubmit(args) {
|
|
242
|
+
const output = createOutput(args.json === true);
|
|
243
|
+
const context = loadProjectContext();
|
|
244
|
+
preflightXcodebuild();
|
|
245
|
+
const paths = iosPaths(context.root);
|
|
246
|
+
const archivePath = path.join(paths.distDir, `${TARGET_NAME}.xcarchive`);
|
|
247
|
+
if (!fs.existsSync(archivePath)) {
|
|
248
|
+
throw new CliError('No archive to upload. Run `bitmagic ios build --ipa` first.', 3);
|
|
249
|
+
}
|
|
250
|
+
const config = resolveAppConfig({
|
|
251
|
+
root: context.root,
|
|
252
|
+
gameId: context.metadata.gameId,
|
|
253
|
+
configPath: paths.configPath,
|
|
254
|
+
});
|
|
255
|
+
if (config.teamId === undefined) {
|
|
256
|
+
throw new CliError('No team id on file. Run `bitmagic ios build --ipa --team <TEAMID>` first.', 3);
|
|
257
|
+
}
|
|
258
|
+
const credentials = readSubmitCredentials(submitCredentialsPath());
|
|
259
|
+
uploadArchive({
|
|
260
|
+
archivePath,
|
|
261
|
+
distDir: paths.distDir,
|
|
262
|
+
teamId: config.teamId,
|
|
263
|
+
keyPath: credentials.keyPath,
|
|
264
|
+
keyId: credentials.keyId,
|
|
265
|
+
issuerId: credentials.issuerId,
|
|
266
|
+
log: output.info,
|
|
267
|
+
});
|
|
268
|
+
output.info('Uploaded. The build appears in App Store Connect → TestFlight after processing —');
|
|
269
|
+
output.info('internal testers can install it from the TestFlight app within minutes.');
|
|
270
|
+
output.result({ ok: true, bundleId: config.bundleId, archivePath });
|
|
271
|
+
}
|
|
272
|
+
const buildCommand = defineCommand({
|
|
273
|
+
meta: {
|
|
274
|
+
name: 'build',
|
|
275
|
+
description: 'Package the game as an iOS app — all assets vendored, mobile controls forced. '
|
|
276
|
+
+ 'Simulator app by default; --ipa for a signed store build.',
|
|
277
|
+
},
|
|
278
|
+
args: {
|
|
279
|
+
run: {
|
|
280
|
+
type: 'boolean',
|
|
281
|
+
description: 'After building, boot a simulator, install the app and launch the game.',
|
|
282
|
+
},
|
|
283
|
+
ipa: {
|
|
284
|
+
type: 'boolean',
|
|
285
|
+
description: 'Archive for devices and export a signed .ipa (needs a team id).',
|
|
286
|
+
},
|
|
287
|
+
team: {
|
|
288
|
+
type: 'string',
|
|
289
|
+
description: 'Apple Developer team id for signing — remembered in .bitmagic/ios.json.',
|
|
290
|
+
},
|
|
291
|
+
name: {
|
|
292
|
+
type: 'string',
|
|
293
|
+
description: 'Override the app display name for this build only.',
|
|
294
|
+
},
|
|
295
|
+
'skip-validation': {
|
|
296
|
+
type: 'boolean',
|
|
297
|
+
description: 'Skip the record/offline passes. The app still builds; working without a network is NOT confirmed.',
|
|
298
|
+
},
|
|
299
|
+
json: {
|
|
300
|
+
type: 'boolean',
|
|
301
|
+
description: 'Print the result as JSON on stdout; all progress goes to stderr.',
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
async run({ args }) {
|
|
305
|
+
await runIosBuild(args);
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
const submitCommand = defineCommand({
|
|
309
|
+
meta: {
|
|
310
|
+
name: 'submit',
|
|
311
|
+
description: 'Upload the archive from `ios build --ipa` to App Store Connect (TestFlight).',
|
|
312
|
+
},
|
|
313
|
+
args: {
|
|
314
|
+
json: {
|
|
315
|
+
type: 'boolean',
|
|
316
|
+
description: 'Print the result as JSON on stdout; all progress goes to stderr.',
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
async run({ args }) {
|
|
320
|
+
await runIosSubmit(args);
|
|
321
|
+
},
|
|
322
|
+
});
|
|
323
|
+
export const iosCommand = defineCommand({
|
|
324
|
+
meta: {
|
|
325
|
+
name: 'ios',
|
|
326
|
+
description: 'Package and submit the game as a native iOS app.',
|
|
327
|
+
},
|
|
328
|
+
subCommands: {
|
|
329
|
+
build: buildCommand,
|
|
330
|
+
submit: submitCommand,
|
|
331
|
+
},
|
|
332
|
+
});
|
|
333
|
+
//# sourceMappingURL=ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/commands/ios.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,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AW,EAAE,yEAAyE;SACvF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oDAAoD;SAClE;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,SAAS;YACf,WAAW,EACT,mGAAmG;SACtG;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,kEAAkE;SAChF;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,aAAa,CAAC;IAClC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,8EAA8E;KAC5F;IACD,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,kEAAkE;SAChF;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;IACtC,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,kDAAkD;KAChE;IACD,WAAW,EAAE;QACX,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,aAAa;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Buffer } from 'buffer';
|
|
2
|
+
import { type GenerateRunDeps } from './generate.js';
|
|
3
|
+
import type { GenerationOutcome } from '../generate/stream.js';
|
|
4
|
+
export interface ReferenceRunDeps extends GenerateRunDeps {
|
|
5
|
+
/** Seam over the generation lane, so a test drives this without a network or a token. */
|
|
6
|
+
generate: (type: string, label: string, body: Record<string, unknown>, deps: GenerateRunDeps) => Promise<GenerationOutcome>;
|
|
7
|
+
/** Returns whether the terminal actually drew the image. */
|
|
8
|
+
renderImage: (bytes: Buffer) => boolean;
|
|
9
|
+
/** The machine-readable result, emitted only under `--json`. */
|
|
10
|
+
result: (value: unknown) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The prose the picture is drawn from: `--prompt` when given, otherwise GAME-DESIGN.md. The same
|
|
14
|
+
* source `bitmagic cover` reads, because the two pictures describe the same game — but the error
|
|
15
|
+
* paths name THIS command, since "write the design or pass --prompt" must say which command to
|
|
16
|
+
* re-run.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveReferenceDesignText(options: {
|
|
19
|
+
promptFlag?: string | undefined;
|
|
20
|
+
root: string;
|
|
21
|
+
}): string;
|
|
22
|
+
export interface ReferenceMakeArgs {
|
|
23
|
+
prompt?: string;
|
|
24
|
+
from?: string;
|
|
25
|
+
'reference-image-url'?: string;
|
|
26
|
+
/** A local image to steer this candidate by — uploaded first ("make the world like this photo"). */
|
|
27
|
+
'reference-image'?: string;
|
|
28
|
+
json?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function runReferenceMake(args: ReferenceMakeArgs, deps?: ReferenceRunDeps): Promise<void>;
|
|
31
|
+
export interface ReferenceAcceptArgs {
|
|
32
|
+
candidate: string;
|
|
33
|
+
json?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare function runReferenceAccept(args: ReferenceAcceptArgs, deps?: ReferenceRunDeps): Promise<void>;
|
|
36
|
+
export interface ReferenceShowArgs {
|
|
37
|
+
json?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare function runReferenceShow(args: ReferenceShowArgs, deps?: ReferenceRunDeps): Promise<void>;
|
|
40
|
+
export declare function runReferenceClear(args: ReferenceShowArgs, deps?: ReferenceRunDeps): Promise<void>;
|
|
41
|
+
export declare const referenceCommand: import("citty").CommandDef<import("citty").ArgsDef>;
|