ravensight-playtest 0.20.2 → 0.21.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/package.json +1 -1
- package/src/cli.js +5 -3
- package/src/commands/hosted.js +4 -3
- package/src/hosted/recordedRun.js +7 -3
- package/src/hosted/status.js +3 -1
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -264,6 +264,7 @@ export function buildProgram() {
|
|
|
264
264
|
.option('--avoid <thing>', 'something every persona stays out of, such as "the settings menu"; up to five times', (v, list) => [...list, v], [])
|
|
265
265
|
.option('--save <file>', 'a save file every persona starts from, at most 1 MiB; uploaded before the quote, free')
|
|
266
266
|
.option('--save-target <where>', 'where the game reads the save: localstorage:<key>, godot:user://<path>, idbfs:/<mount>/<path>, or hook (the default: the game reads it through window.RavensightPlaytest.save)')
|
|
267
|
+
.option('--sessions <n>', 'play each persona as 2 or 3 sessions: the game is closed and started again on its own saved data between them, inside the same minutes and price; an uploaded web build only, each session at least 4 minutes')
|
|
267
268
|
.requiredOption('--output <file>', 'save the original quote and immutable consent here')
|
|
268
269
|
.option('--game <id>', 'game id, overriding this repo’s configuration')
|
|
269
270
|
.addOption(new Option('--geri-provider <name>', "Geri's model provider: primary or alternate (ravensight.io/legal/subprocessors names both); unavailable choices are refused").choices(['primary', 'alternate']))
|
|
@@ -275,7 +276,7 @@ export function buildProgram() {
|
|
|
275
276
|
const { hostedQuote, HOSTED_URL_REFUSAL } = await import('./commands/hosted.js');
|
|
276
277
|
if (options.url !== undefined || options.buildUrl !== undefined) throw new CliError(HOSTED_URL_REFUSAL, ExitCode.ENVIRONMENT);
|
|
277
278
|
return hostedQuote(flagsFrom(command.optsWithGlobals(), { build: options.build, profile: options.profile,
|
|
278
|
-
persona: options.persona, personas: options.personas, tier: options.tier, minutes: options.minutes, start: options.start, focus: options.focus, avoid: options.avoid, save: options.save, saveTarget: options.saveTarget, output: options.output, game: options.game,
|
|
279
|
+
persona: options.persona, personas: options.personas, tier: options.tier, minutes: options.minutes, start: options.start, focus: options.focus, avoid: options.avoid, sessions: options.sessions, save: options.save, saveTarget: options.saveTarget, output: options.output, game: options.game,
|
|
279
280
|
geriProvider: options.geriProvider,
|
|
280
281
|
video: options.video }));
|
|
281
282
|
}));
|
|
@@ -292,6 +293,7 @@ export function buildProgram() {
|
|
|
292
293
|
.option('--avoid <thing>', 'something every persona stays out of, such as "the settings menu"; up to five times', (v, list) => [...list, v], [])
|
|
293
294
|
.option('--save <file>', 'a save file every persona starts from, at most 1 MiB; uploaded before the quote, free')
|
|
294
295
|
.option('--save-target <where>', 'where the game reads the save: localstorage:<key>, godot:user://<path>, idbfs:/<mount>/<path>, or hook (the default: the game reads it through window.RavensightPlaytest.save)')
|
|
296
|
+
.option('--sessions <n>', 'play each persona as 2 or 3 sessions: the game is closed and started again on its own saved data between them, inside the same minutes and price; an uploaded web build only, each session at least 4 minutes')
|
|
295
297
|
.option('--game <id>', 'game id, overriding this repo’s configuration')
|
|
296
298
|
.option('--video', 'save a video of each persona\'s game session in its report')
|
|
297
299
|
.option('--wait', 'stay until the report is ready, printing each phase change (with or without a saved quote)')
|
|
@@ -305,12 +307,12 @@ export function buildProgram() {
|
|
|
305
307
|
const { hostedRun, hostedRunDirect, HOSTED_URL_REFUSAL } = await import('./commands/hosted.js');
|
|
306
308
|
if (options.url !== undefined || options.buildUrl !== undefined) throw new CliError(HOSTED_URL_REFUSAL, ExitCode.ENVIRONMENT);
|
|
307
309
|
if (filename) {
|
|
308
|
-
const extra = ['build', 'nativeBuild', 'persona', 'personas', 'tier', 'minutes', 'start', 'save', 'saveTarget', 'game', 'video'].filter(name => options[name] !== undefined).concat(['focus', 'avoid'].filter(name => options[name]?.length));
|
|
310
|
+
const extra = ['build', 'nativeBuild', 'persona', 'personas', 'tier', 'minutes', 'start', 'sessions', 'save', 'saveTarget', 'game', 'video'].filter(name => options[name] !== undefined).concat(['focus', 'avoid'].filter(name => options[name]?.length));
|
|
309
311
|
if (extra.length) throw new CliError(`A saved quote already fixes its build, personas and options. Drop --${extra.map(name => name.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`)).join(', --')}, or run "hosted run" without a quote file.`);
|
|
310
312
|
return hostedRun(filename, flagsFrom(command.optsWithGlobals(), { wait: options.wait, waitForCapacity: options.waitForCapacity,
|
|
311
313
|
evenIfUnknown: options.evenIfUnknown }));
|
|
312
314
|
}
|
|
313
|
-
return hostedRunDirect(flagsFrom(command.optsWithGlobals(), { build: options.build, nativeBuild: options.nativeBuild, persona: options.persona, personas: options.personas, tier: options.tier, minutes: options.minutes, start: options.start, focus: options.focus, avoid: options.avoid, save: options.save, saveTarget: options.saveTarget, game: options.game,
|
|
315
|
+
return hostedRunDirect(flagsFrom(command.optsWithGlobals(), { build: options.build, nativeBuild: options.nativeBuild, persona: options.persona, personas: options.personas, tier: options.tier, minutes: options.minutes, start: options.start, focus: options.focus, avoid: options.avoid, sessions: options.sessions, save: options.save, saveTarget: options.saveTarget, game: options.game,
|
|
314
316
|
video: options.video, wait: options.wait, waitForCapacity: options.waitForCapacity, evenIfUnknown: options.evenIfUnknown }));
|
|
315
317
|
}));
|
|
316
318
|
common(hosted.command('status [run-id]'))
|
package/src/commands/hosted.js
CHANGED
|
@@ -18,12 +18,12 @@ import { ANDROID_FORMAT, ANDROID_UNAVAILABLE, ANDROID_UNAVAILABLE_CODE, androidP
|
|
|
18
18
|
/** Machine output names a Geri provider by its role, never by the server's wire id. */
|
|
19
19
|
const printJson = value => ui.json(providerRoles(value));
|
|
20
20
|
|
|
21
|
-
/** --tier, --minutes, --start, --focus and --
|
|
21
|
+
/** --tier, --minutes, --start, --focus, --avoid and --sessions as the quote request takes them. */
|
|
22
22
|
export function scopeFrom(flags = {}) {
|
|
23
23
|
const minutes = flags.minutes === undefined ? undefined : Number(flags.minutes);
|
|
24
|
-
const named = flags.start !== undefined || (flags.focus || []).length || (flags.avoid || []).length;
|
|
24
|
+
const named = flags.start !== undefined || (flags.focus || []).length || (flags.avoid || []).length || flags.sessions !== undefined;
|
|
25
25
|
return { ...(flags.tier ? { tier: flags.tier } : {}), ...(minutes !== undefined ? { minutes } : {}),
|
|
26
|
-
...(named ? { focus: focusFor({ start: flags.start, focus: flags.focus || [], avoid: flags.avoid || [] }) } : {}) };
|
|
26
|
+
...(named ? { focus: focusFor({ start: flags.start, focus: flags.focus || [], avoid: flags.avoid || [], sessions: flags.sessions }) } : {}) };
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -77,6 +77,7 @@ export function assertNativeRunFlags(flags = {}) {
|
|
|
77
77
|
if (flags.start !== undefined || flags.save !== undefined || flags.saveTarget !== undefined) {
|
|
78
78
|
throw new CliError(ANDROID_FOCUS_REFUSAL, ExitCode.ENVIRONMENT);
|
|
79
79
|
}
|
|
80
|
+
if (flags.sessions !== undefined) throw new CliError('A cloud playtest of an Android build plays as one session: drop --sessions. Nothing was uploaded or charged.', ExitCode.ENVIRONMENT);
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
/**
|
|
@@ -94,13 +94,15 @@ export async function readHostedQuote(filename) {
|
|
|
94
94
|
*/
|
|
95
95
|
export const TIERS = Object.freeze(['jam', 'small', 'medium', 'large']);
|
|
96
96
|
const plainLine = value => typeof value === 'string' && value.trim().length > 0 && value.length <= 200 && !/[\u0000-\u001f\u007f]/.test(value);
|
|
97
|
-
/** The focus block: a start query or hash,
|
|
98
|
-
export function focusFor({ start, focus = [], avoid = [] } = {}) {
|
|
97
|
+
/** The focus block: a start query or hash, up to five focus and avoid lines, and the sessions a persona plays (2 or 3). */
|
|
98
|
+
export function focusFor({ start, focus = [], avoid = [], sessions } = {}) {
|
|
99
99
|
if (start !== undefined && start !== null && start !== '' && (typeof start !== 'string' || !/^[?#][^\s\\]{0,199}$/.test(start))) fail('Choose --start as a query or hash on the build, such as ?level=3 or #boss.');
|
|
100
100
|
for (const [name, list] of [['--focus', focus], ['--avoid', avoid]]) {
|
|
101
101
|
if (!Array.isArray(list) || list.length > 5 || !list.every(plainLine)) fail(`Give ${name} at most five times, each plain text of at most 200 characters.`);
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
const n = sessions === undefined || sessions === null ? 1 : Number(sessions);
|
|
104
|
+
if (!Number.isSafeInteger(n) || n < 1 || n > 3) fail('Choose --sessions as 1, 2 or 3.');
|
|
105
|
+
return { ...(start ? { start } : {}), focus: focus.map(x => x.trim()), avoid: avoid.map(x => x.trim()), ...(n > 1 ? { sessions: n } : {}) };
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
/** Why a cloud playtest of an Android build takes no --start, --save or --save-target. Its --focus and --avoid goals are taken. */
|
|
@@ -157,6 +159,7 @@ function requestFor({ buildId, profileVersion, personas, controllers = COMBINED,
|
|
|
157
159
|
// An Android build plays on a device with its network off and has no web address: no start and no save. Its goals,
|
|
158
160
|
// --focus and --avoid, are taken as on any combined playtest (the server's focus block).
|
|
159
161
|
if (profile.driver === ANDROID_DRIVER && focus !== undefined && (focus.start || focus.save)) fail(ANDROID_FOCUS_REFUSAL);
|
|
162
|
+
if (profile.driver === ANDROID_DRIVER && focus?.sessions) fail('A cloud playtest of an Android build plays as one session: drop --sessions. Nothing was charged.');
|
|
160
163
|
return { kind: 'recorded_graphical', buildId, personas: [...list], controllers: [...controllers],
|
|
161
164
|
driver: profile.driver, runLength: 'standard', profileVersion, includeVideo, includeTranscript,
|
|
162
165
|
...(standardProvider === undefined ? {} : { standardProvider }),
|
|
@@ -270,6 +273,7 @@ export function hostedQuoteLines(offer) {
|
|
|
270
273
|
...(focus.save ? [`Start from the save file: ${printable(String(focus.save.name))} (${Number(focus.save.bytes) || 0} bytes), ${focus.save.target?.kind === 'hook' ? 'read by the game through the playtest save hook' : focus.save.target?.kind === 'local_storage' ? 'placed in local storage before the game loads' : 'placed in the game\'s browser file storage before the game loads'}.`] : []),
|
|
271
274
|
...(focus.focus?.length ? [`Focus: ${focus.focus.map(printable).join('; ')}`] : []),
|
|
272
275
|
...(focus.avoid?.length ? [`Avoid: ${focus.avoid.map(printable).join('; ')}`] : []),
|
|
276
|
+
...(Number.isSafeInteger(focus.sessions) && focus.sessions > 1 ? [`Sessions: ${focus.sessions} per persona, the game closed and started again on its own saved data between them, inside the same minutes and price.`] : []),
|
|
273
277
|
...(r.standardProvider ? [`Geri's model provider: ${providerLabel(r.standardProvider)}; policy ${q.standardProviderPolicyHash}.`] : []),
|
|
274
278
|
...personaPrices(q, r).map(row => `${row.persona}${row.persona === ALWAYS_INCLUDED_PERSONA ? ' (always included)' : ''}: ${money(row.priceCents)}.`),
|
|
275
279
|
...(q.setupFeeCents ? [`Includes a non-refundable setup fee: ${money(q.setupFeeCents)} (${money(q.setupFeeCents / r.personas.length)} a persona). It is kept even when a persona is refunded, unless it never got a machine.`] : []),
|
package/src/hosted/status.js
CHANGED
|
@@ -34,7 +34,9 @@ export function hostedPlaytestStatus(admission, job = null, runs = [], now = Dat
|
|
|
34
34
|
let detail = 'Waiting for hosted capacity.';
|
|
35
35
|
|
|
36
36
|
if (CANCELED.has(jobState) || CANCELED.has(admissionState)) {
|
|
37
|
-
phase = 'canceled'; label = 'Canceled';
|
|
37
|
+
phase = 'canceled'; label = 'Canceled';
|
|
38
|
+
// A cancel the platform made itself (no machine could be started) says why, in the server's own words.
|
|
39
|
+
detail = (admission.canceledBy === 'platform' && boundedReason(admission.cancelReason)) || 'The hosted run was canceled.';
|
|
38
40
|
} else if (FAILED.has(jobState) || FAILED.has(admissionState) || job?.summary_report === 'failed') {
|
|
39
41
|
phase = 'failed'; label = 'Failed'; detail = 'The hosted run stopped before a report was ready.';
|
|
40
42
|
} else if (job?.summary_report === 'ready' || admissionState === 'recorded_closed') {
|