demoman 0.7.3 → 0.8.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.
- package/README.md +5 -2
- package/THIRD_PARTY_NOTICES +1 -1
- package/dist/demoman.mjs +11988 -11403
- package/dist/page/render-entry.js +42 -4
- package/dist/recipe.md +29 -28
- package/dist/studio/assets/{confirm-dialog-DVfQ_GQr.js → confirm-dialog-Bcrw3f1a.js} +1 -1
- package/dist/studio/assets/{editor-lILLTndB.js → editor-DUZKtJ2T.js} +1 -1
- package/dist/studio/assets/{library-CbMXa-ad.js → library-BPokDo6m.js} +1 -1
- package/dist/studio/assets/{settings-CetO1oeR.js → settings-RZj4oUzT.js} +1 -1
- package/dist/studio/assets/{view-v5HQTLVP.js → view-SxAupNyx.js} +1 -1
- package/dist/studio/editor.html +3 -3
- package/dist/studio/library.html +2 -2
- package/dist/studio/settings.html +3 -3
- package/dist/studio/studio-build.json +3 -3
- package/package.json +1 -1
|
@@ -48210,6 +48210,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
48210
48210
|
};
|
|
48211
48211
|
}
|
|
48212
48212
|
var outputs = [];
|
|
48213
|
+
function softwareEncoded(target) {
|
|
48214
|
+
return {
|
|
48215
|
+
...target,
|
|
48216
|
+
encoder: {
|
|
48217
|
+
...target.encoder,
|
|
48218
|
+
hardwareAcceleration: target.encoder?.hardwareAcceleration ?? "prefer-software"
|
|
48219
|
+
}
|
|
48220
|
+
};
|
|
48221
|
+
}
|
|
48213
48222
|
async function render(manifest) {
|
|
48214
48223
|
const { scene, bundle, target, fileType } = manifest;
|
|
48215
48224
|
let logo = null;
|
|
@@ -48224,22 +48233,51 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
48224
48233
|
}
|
|
48225
48234
|
}
|
|
48226
48235
|
const report = globalThis[RENDER_PROGRESS_BINDING];
|
|
48236
|
+
const started = performance.now();
|
|
48237
|
+
const source = await framesFor(bundle, load);
|
|
48238
|
+
let framesMs = 0;
|
|
48239
|
+
let frameReads = 0;
|
|
48240
|
+
const frames = {
|
|
48241
|
+
at: async (ms) => {
|
|
48242
|
+
const t = performance.now();
|
|
48243
|
+
try {
|
|
48244
|
+
return await source.at(ms);
|
|
48245
|
+
} finally {
|
|
48246
|
+
framesMs += performance.now() - t;
|
|
48247
|
+
frameReads++;
|
|
48248
|
+
}
|
|
48249
|
+
},
|
|
48250
|
+
describe: () => source.describe(),
|
|
48251
|
+
...source.close === void 0 ? {} : { close: () => source.close?.() },
|
|
48252
|
+
...source.warm === void 0 ? {} : { warm: (from, to) => source.warm?.(from, to) },
|
|
48253
|
+
...source.unavailable === void 0 ? {} : { unavailable: () => source.unavailable?.() ?? [] }
|
|
48254
|
+
};
|
|
48227
48255
|
const { files, facts } = await renderOutput({
|
|
48228
48256
|
fileType,
|
|
48229
|
-
target,
|
|
48257
|
+
target: softwareEncoded(target),
|
|
48230
48258
|
scene,
|
|
48231
48259
|
bundle,
|
|
48232
|
-
frames
|
|
48260
|
+
frames,
|
|
48233
48261
|
logo,
|
|
48234
48262
|
...manifest.gifBudget === void 0 ? {} : { gifBudget: manifest.gifBudget },
|
|
48235
|
-
...manifest.mp4Cap === void 0 ? {} : {
|
|
48263
|
+
...manifest.mp4Cap === void 0 ? {} : {
|
|
48264
|
+
mp4Cap: {
|
|
48265
|
+
...manifest.mp4Cap,
|
|
48266
|
+
share: softwareEncoded(manifest.mp4Cap.share)
|
|
48267
|
+
}
|
|
48268
|
+
},
|
|
48236
48269
|
...manifest.stills === void 0 ? {} : { stills: manifest.stills },
|
|
48237
48270
|
onFrame: wholePercent((done, total, width, pass) => width === void 0 ? report?.(done, total) : pass === void 0 ? report?.(done, total, width) : report?.(done, total, width, pass))
|
|
48238
48271
|
});
|
|
48239
48272
|
outputs = files.map((f) => f.bytes);
|
|
48240
48273
|
return {
|
|
48241
48274
|
...facts,
|
|
48242
|
-
files: files.map((f) => ({ name: f.name, byteLength: f.bytes.byteLength }))
|
|
48275
|
+
files: files.map((f) => ({ name: f.name, byteLength: f.bytes.byteLength })),
|
|
48276
|
+
timing: {
|
|
48277
|
+
renderMs: performance.now() - started,
|
|
48278
|
+
framesMs,
|
|
48279
|
+
frameReads
|
|
48280
|
+
}
|
|
48243
48281
|
};
|
|
48244
48282
|
}
|
|
48245
48283
|
function readChunk(index, offset, length2) {
|
package/dist/recipe.md
CHANGED
|
@@ -430,34 +430,34 @@ too.
|
|
|
430
430
|
|
|
431
431
|
### Pull requests
|
|
432
432
|
|
|
433
|
-
Before opening a
|
|
434
|
-
|
|
433
|
+
Before opening a PR, read `status.pullRequests` (`project` for
|
|
434
|
+
another checkout): `attach`, `ask`, `off`, or `{ unreadable, file }`,
|
|
435
435
|
which is not `off`: tell the user. `off`: only when asked. If the diff
|
|
436
|
-
changes
|
|
436
|
+
changes what a user sees, record that one flow (only the change),
|
|
437
437
|
push and open the PR, then `attach({ takeId, into: "description" })`, or
|
|
438
|
-
`"comment"` on a PR that is not yours.
|
|
438
|
+
`"comment"` on a PR that is not yours. The video carries its own line; write no other. On `line.notWritten`,
|
|
439
|
+
tell the user the video lacks its line, quoting why. A later `gh pr edit --body` drops the video. `ask`: offer once; on a no, nothing to see or a failed run (say why),
|
|
439
440
|
the PR says nothing of it. `attach`: with no video, the PR description gets
|
|
440
441
|
one line, `No demo: <why>`, and so does the user.
|
|
441
442
|
`attach` takes `maxMB` as `export` does. On `stillRunning`, `report(id)`
|
|
442
|
-
until the outcome is
|
|
443
|
+
until the outcome is neither `attaching` nor `stillRunning`. On `busy`,
|
|
443
444
|
`report(id)` on the export in flight, then `attach` again. On `ghMissing`,
|
|
444
445
|
`ghOutdated`, `ghSignedOut`, `notGitHub` or `copyFailed`, call
|
|
445
|
-
`export({ takeId, maxMB: 9.5 })` and give the user
|
|
446
|
+
`export({ takeId, maxMB: 9.5 })` and give the user its `file.path` to drag
|
|
446
447
|
into the PR, saying why. On `uploadRefused`, do as its `detail` says. On `partial` or `unconfirmed`, do not
|
|
447
|
-
post again; tell the user to
|
|
448
|
-
section 7. An export that did not save comes back as the export's answer.
|
|
448
|
+
post again; tell the user to check the PR. Other reasons: section 7. An unsaved export answers as `export` does.
|
|
449
449
|
|
|
450
450
|
Hand back, on `saved`, two lines and nothing else: the `summary` as it is,
|
|
451
|
-
then the `links` as markdown links on one line, in this order
|
|
451
|
+
then the `links` as markdown links on one line, in this order, only
|
|
452
452
|
those present: `[Open in Studio](links.studio) · [<file name>](links.file) · [Copy video](links.copy)`
|
|
453
453
|
(`Copy GIF` for a GIF). Add one line only for `look.brandKitError`,
|
|
454
|
-
`size.error`, `linksError`, or something you could not fix.
|
|
455
|
-
outcome
|
|
454
|
+
`size.error`, `linksError`, or something you could not fix. Any other
|
|
455
|
+
outcome: quote its `error` or `detail`.
|
|
456
456
|
|
|
457
|
-
When the `studio` tool is listed and there is no `links.studio
|
|
458
|
-
|
|
459
|
-
opens a window
|
|
460
|
-
`{ outcome: "opened", takeId?, note? }`: say the window is open
|
|
457
|
+
When the `studio` tool is listed and there is no `links.studio`, **offer**
|
|
458
|
+
it; never open it unasked. `studio({ takeId })`
|
|
459
|
+
opens a window to edit and export the take.
|
|
460
|
+
`{ outcome: "opened", takeId?, note? }`: say the window is open;
|
|
461
461
|
quote `note` if set. Studio exports go to `~/Downloads`.
|
|
462
462
|
|
|
463
463
|
## 6. The format
|
|
@@ -540,7 +540,8 @@ recorded action each step came from (`recorded`, in `recordedFrom`):
|
|
|
540
540
|
|
|
541
541
|
| Reason | Where | What it means, and the move |
|
|
542
542
|
| --- | --- | --- |
|
|
543
|
-
| `browserMissing` | `snapshot`, `run` (`refusedBeforeRun`), `studio` | Demoman's browser
|
|
543
|
+
| `browserMissing` | `snapshot`, `run` (`refusedBeforeRun`), `studio` | Demoman's browser or its libraries are missing; `detail` gives the command. Ask the user to run it, then call again. |
|
|
544
|
+
| `unsupportedPlatform` | `snapshot`, `run`, `export` | This machine cannot record (arm64 Linux, or another OS); quote `detail` to the user. |
|
|
544
545
|
| `sessionUnreadable` | `snapshot`, `run` (`refusedBeforeRun`) | A saved session file or folder could not be read, or others can read it; `detail` names the fix. Tell the user. |
|
|
545
546
|
| `sessionNotLoaded` | `snapshot`, `run` (`refusedBeforeRun`) | The browser refused the saved sessions; `detail` says why. Tell the user to run `npx demoman signin` again for that site. |
|
|
546
547
|
| `signInFailed` | `snapshot`, `run` (`refusedBeforeRun`) | Demoman signed in as the account and the page still showed a sign-in page, or a step could not run; `detail` says where. It tried once. Fix the account's steps or the secret, or tell the user; do not run again unchanged. |
|
|
@@ -559,16 +560,16 @@ recorded action each step came from (`recorded`, in `recordedFrom`):
|
|
|
559
560
|
| `uploadRefused` | `attach` (`notAttached`) | GitHub refused the video. Retry as the Pull requests text says. |
|
|
560
561
|
| `partial` | `attach` (`notAttached`) | `gh` failed but the video is on the PR; do not post again. |
|
|
561
562
|
| `unconfirmed` | `attach` (`notAttached`) | Unknown what landed. Do not post again; tell the user to look at the PR. |
|
|
562
|
-
| `copyFailed` | `attach` (`notAttached`) | The video could not be copied
|
|
563
|
+
| `copyFailed` | `attach` (`notAttached`) | The video could not be copied; nothing was posted. Hand the user the capped export's file. |
|
|
563
564
|
| `windowDidNotOpen` | `snapshot`; `run` (`refusedBeforeRun`); `studio` | The window would not open; try once more. |
|
|
564
565
|
| `studioDidNotStart` | `studio` | The Studio did not start; `detail` quotes the end of `~/.demoman/studio.log`. Tell the user, quoting it. |
|
|
565
|
-
| `alreadyRunning` | `snapshot`, `run`, `derive` | A run, snapshot or export is in progress. Call `report(id)` on it
|
|
566
|
-
| `busy` | `export` (`refusedBeforeExport`) |
|
|
567
|
-
| `browserSilent` | `status`, `takes`, `derive`, `report` | The browser did not answer within about 50 s. Call `status` once; if
|
|
566
|
+
| `alreadyRunning` | `snapshot`, `run`, `derive` | A run, snapshot or export is in progress. Call `report(id)` on it; try again when it settles. |
|
|
567
|
+
| `busy` | `export` (`refusedBeforeExport`) | A run or snapshot is in progress. Call `report(id)` on it first. |
|
|
568
|
+
| `browserSilent` | `status`, `takes`, `derive`, `report` | The browser did not answer within about 50 s. Call `status` once; if again, tell the user. From `report`, the run may still be going: call `report(id)` again. |
|
|
568
569
|
| `libraryUnreadable` | `takes`, `studio` | The library could not be read; report it. |
|
|
569
570
|
| `libraryUnwritable` | `run` (in `notStored`) | Not a `reason`: the report has a `notStored` entry `{ "what": "take", "error": … }` and a null `provenance.takeId`. Nothing was saved; quote the `error`. |
|
|
570
|
-
| `unknownRun` | `report` | This demoman-mcp never issued that id (ids do not survive a restart
|
|
571
|
-
| `noReport` | `report` | No report for that id: this server keeps only its latest; `detail` says which. Do not run again
|
|
571
|
+
| `unknownRun` | `report` | This demoman-mcp never issued that id (ids do not survive a server restart). |
|
|
572
|
+
| `noReport` | `report` | No report for that id: this server keeps only its latest; `detail` says which. Do not run again. |
|
|
572
573
|
| `notAnObject` | `run` | The script is not a JSON object. |
|
|
573
574
|
| `invalidScript` | `run` | The schema refused the script; `field` names where. |
|
|
574
575
|
| `unfilledHoles` | `run` | A derived draft still has holes (section 3); also a re-record of a take that did not keep a value. |
|
|
@@ -581,19 +582,19 @@ recorded action each step came from (`recorded`, in `recordedFrom`):
|
|
|
581
582
|
| `versionExpired` | `export` (`refusedBeforeExport`) | The take's frames expired: `run({ video: { id } })`, then export. |
|
|
582
583
|
| `failed` | `status` (`expiry`) | Not a refusal: `expiry` is the last cleanup `{ ranAt, expired, freedBytes, skippedLeased }`. Say nothing unless it is `{ failed }` or `{ unreadable }`: quote it. |
|
|
583
584
|
| `nothingToRerecord` | `run` (`refusedBeforeRun`) | The take has no step left that acts; tell the user. |
|
|
584
|
-
| `unknownKit` | `run` (`refusedBeforeRun`) | `look.kit` names no brand kit, or one that cannot be read; `detail` lists the kits
|
|
585
|
-
| `kitsUnreadable` | `run` (`refusedBeforeRun`) | The brand kits file could not be read, so `look.kit`
|
|
586
|
-
| `invalidDevice` | `snapshot` | `device` names no phone or tablet Demoman has; `detail` lists
|
|
587
|
-
| `deviceFailed` | `snapshot`, `run` | The browser would not emulate the device; nothing was listed or recorded; `detail` says why. Tell the user; do not run
|
|
585
|
+
| `unknownKit` | `run` (`refusedBeforeRun`) | `look.kit` names no brand kit, or one that cannot be read; `detail` lists the kits. Fix the name from `snapshot`'s `kits`, or ask the user. |
|
|
586
|
+
| `kitsUnreadable` | `run` (`refusedBeforeRun`) | The brand kits file could not be read, so `look.kit` was not checked. Quote `detail` to the user; do not change the name. |
|
|
587
|
+
| `invalidDevice` | `snapshot` | `device` names no phone or tablet Demoman has; `detail` lists those it has. Use one. |
|
|
588
|
+
| `deviceFailed` | `snapshot`, `run` | The browser would not emulate the device; nothing was listed or recorded; `detail` says why. Tell the user; do not run again. |
|
|
588
589
|
| `nonHttpTarget` | `run`, `snapshot` | The target or url is not `http(s)`, or its host contains `*`. |
|
|
589
590
|
| `invalidFileType` | `export` (`refusedBeforeExport`) | Not answered here: the schema takes only `mp4`, `gif`, `stills`. |
|
|
590
591
|
| `invalidStillsOptions` | `export` (`refusedBeforeExport`) | `stills` was given for an MP4 or GIF, or holds a width outside 320-3840 (or `"native"`), a zoom other than `"none"` or `"step"`, or another field; `detail` says which. Fix the call. |
|
|
591
592
|
| `invalidQuality`, `invalidMaxMB` | `export` (`refusedBeforeExport`), `attach` | Through these tools, only `quality` or `maxMB` given for a GIF or stills; the schema rejects a bad value first. |
|
|
592
593
|
| `noTakeId`, `noFrames` | `export` (`refusedBeforeExport`) | No take id; the take has no frames to render. |
|
|
593
|
-
| `takeNotFound`, `takeUnreadable` | `export` (`refusedBeforeExport`), `run` re-record (`refusedBeforeRun`), `studio` (`takeNotFound`: call `takes`) | No such take;
|
|
594
|
+
| `takeNotFound`, `takeUnreadable` | `export` (`refusedBeforeExport`), `run` re-record (`refusedBeforeRun`), `studio` (`takeNotFound`: call `takes`) | No such take; it could not be read (or, for `run`, built into a script). |
|
|
594
595
|
| `dragEndOutOfView`, `dragNoDistance` | `run` (`stopped.reason`) | A drag's end was off screen (a drag cannot scroll), or on its start. Fix the script. |
|
|
595
596
|
| `clickNotDelivered` | `run` (`stopped.reason`) | The browser put a click elsewhere than where it was sent; `stopped.detail` says where. Not the script's fault: run again (it counts); tell the user if it repeats. |
|
|
596
|
-
| `signedOut` | `run` (`stopped.reason`) | The app sent this browser to its sign-in page. Nothing was kept. Give the user the command in `stopped.detail`; run again only after they
|
|
597
|
+
| `signedOut` | `run` (`stopped.reason`) | The app sent this browser to its sign-in page. Nothing was kept. Give the user the command in `stopped.detail`; run again only after they ran it. As an account there is no command: the detail says whether Demoman signed in again; repeat only if it says so. |
|
|
597
598
|
| `windowClosed` | `run` (`stopped.reason`) | `--headed` only: the window was closed mid-run; the script is fine. Ask the user to leave it open; run once more. In an export it answers `renderFailed`; export again. |
|
|
598
599
|
| `pageDidNotLoad` | `snapshot` | The url did not load. Ask the user whether the app is running at that address; spend no run. |
|
|
599
600
|
| `pageSilent` | `snapshot` | The page never answered. Call once more; if again, the page blocked Demoman's script; tell the user. |
|