Skip to content

Commit 3dbc4e0

Browse files
committed
Bundle optional write guards and simpler agent workflows
1 parent 1cc315b commit 3dbc4e0

62 files changed

Lines changed: 359 additions & 353 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎components.lock.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"state": "resolved",
44
"cli": {
55
"repository": "screenrig/cli",
6-
"commit": "e0e9824abed89d7da89809c61cdd8e90975800f0",
6+
"commit": "735a7fef4cdf47cf6261ed40b018cde9c13eb548",
77
"artifact": {
88
"file": "screenrig-cli.tgz",
9-
"sha256": "377c234411cb0ac52262154c9183369f79dfb3951a8c5011eef776cbc530518e"
9+
"sha256": "5d9989b5220711968b11675cbf7468c3722cf305468e6a208cb3c7c75ca4e9b9"
1010
}
1111
}
1212
}

‎plugins/screenrig/cli/README.md‎

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Use `screenrig help --all` for the complete command inventory, or
5050
immediate children. Add `--json` for structured command paths, positional arguments,
5151
option choices and defaults, relationships, and examples;
5252
help runs without configuration or authentication. Command-specific options follow
53-
that command, for example `screenrig screen update ID --name Lobby --expect-rev 1`.
53+
that command, for example `screenrig screen update ID --name Lobby`.
5454
Global options such as `--json` may appear before or after the command. Use
5555
`--name=VALUE` for a value starting with a dash, and `--` before option-like file
5656
names. Duplicate options are rejected.
@@ -137,8 +137,7 @@ is still online and limits how many offers each screen receives.
137137
`app upload` and `app update` return the same JSON data paths with or without
138138
`--no-wait`: `data.application` contains the accepted application `id`,
139139
`release_id`, and `operation_id`; `data.pack` contains `sha256` and `file_count`.
140-
The accepted response does not include an application revision. Read `app show`
141-
for the current revision before an update.
140+
The accepted response does not include an application revision. Updates need no prior read. For an optional revision guard, read `app show` and pass `--expect-rev`.
142141

143142
`data.operation` contains the observed completed operation when waiting. With
144143
`--no-wait` it is `null`: upload acceptance does not establish operation state
@@ -192,7 +191,7 @@ group/action, never request payloads. Fingerprints include the origin, credentia
192191
body, and revision. Changed requests receive different keys. A completed command
193192
clears its pending state; application acceptance followed by a failed processing
194193
wait retains it so retrying does not create another application. Definite
195-
refusals still require reconciliation; revision checks remain in force.
194+
refusals still require reconciliation; explicit revision checks remain in force.
196195

197196
Automatic replay stops after 23 hours, before the server's 24-hour replay window
198197
ends. Inspect the resource before explicitly supplying a new `--idempotency-key`
@@ -256,7 +255,7 @@ For ready images and videos, prepare a full-screen playlist in playback order:
256255
```sh
257256
screenrig playlist init med_POSTER med_VIDEO --name "Lobby loop" --screen-id scr_LOBBY --output lobby.json
258257
screenrig playlist preview lobby.json --output preview --contact-sheet
259-
screenrig screen publish scr_LOBBY lobby.json --expect-rev 7
258+
screenrig screen publish scr_LOBBY lobby.json
260259
```
261260

262261
Inspect the document and preview before publishing. `playlist init` accepts ordered
@@ -288,19 +287,15 @@ are pinned to the supplied release and use timed advancement, without controller
288287
privileges. Edit the document for application-controlled advancement.
289288

290289
With `--screen-id`, the result includes `screen_id`, `screen_revision`, and a
291-
`publish.argv` array containing the output path and observed revision. It also
290+
`publish.argv` array containing the output path and optional revision guard. It also
292291
returns `preview.argv`. These arrays preserve the selected config/API and paths
293-
with spaces; execute preview, inspect it, then use the publish arguments. A later
294-
screen change still produces a revision conflict. Target metadata stays outside
292+
with spaces; execute preview, inspect it, then use the publish arguments. Add `--expect-rev` explicitly to guard against later screen changes. Target metadata stays outside
295293
the playlist file. Override canvas dimensions with both `--target-width` and
296294
`--target-height`; these also work without `--screen-id` (no publish arguments).
297-
Unknown or multiple reported surfaces require explicit dimensions. Output files
298-
must not already exist.
295+
Unknown or multiple reported surfaces require explicit dimensions. Output files are exclusive by default; use `--overwrite` to replace an existing authoring file atomically. Parent directories are created automatically. URL and release-ID inputs with explicit dimensions work without login.
299296

300-
`screen publish <screen-id> <file>` creates a new playlist, assigns it using the
301-
expected **screen** revision, and reads back the assignment. It does not update an
302-
existing playlist by name. A name collision requires a different name or an
303-
explicit `playlist update`. Its JSON result reports `playlist_id`,
297+
`screen publish <screen-id> <file>` creates a new playlist, assigns it with an optional **screen** revision guard, and reads back the assignment. It does not update an
298+
existing playlist by name. Display names may repeat; use the playlist ID for an explicit `playlist update`. Its JSON result reports `playlist_id`,
304299
`playlist_revision`, `screen_id`, `screen_revision`, `assignment_verified`, and
305300
`playback_verified`. Assignment verification does not prove playback; request and
306301
inspect a screenshot and relevant playback evidence separately.
@@ -322,12 +317,11 @@ To edit an existing playlist:
322317

323318
```sh
324319
screenrig playlist show pl_EXISTING --output lobby.json
325-
screenrig playlist update pl_EXISTING lobby.json --expect-rev 4
320+
screenrig playlist update pl_EXISTING lobby.json
326321
```
327322

328323
`playlist show --output` writes the editable `{name, pages}` document and returns
329-
its path, `playlist_id`, and source `revision` on stdout. Use that returned revision
330-
for the update. It preserves dynamic selectors, schedules, motion, and pinned
324+
its path, `playlist_id`, and source `revision` on stdout. Optionally pass that revision with `--expect-rev` to guard the update. It preserves dynamic selectors, schedules, motion, and pinned
331325
application releases, removing server-derived media and timing fields. Comments
332326
remain separate. Plain `playlist show` is an inspection response; `--editable`
333327
without `--output` returns `data.document`, `data.playlist_id`, and `data.revision`.
@@ -341,26 +335,25 @@ screenrig playlist replace-release pl_EXISTING --page board-page --primitive boa
341335
```
342336

343337
Review `data.previous_release_id`, `data.release_id`, and `data.affected_screens`
344-
(including archived assignments). Then use the returned `data.revision` and
345-
`data.impact` to apply that exact replacement:
338+
(including archived assignments). Then use the returned `data.impact` to apply that exact replacement:
346339

347340
```sh
348-
screenrig playlist replace-release pl_EXISTING --page board-page --primitive board --release-id rel_NEW --apply --expect-rev 4 --expect-impact TOKEN_FROM_PREVIEW
341+
screenrig playlist replace-release pl_EXISTING --page board-page --primitive board --release-id rel_NEW --apply
349342
```
350343

351344
The CLI preserves the other primitives and playlist settings. Every screen
352345
assigned to this shared playlist receives the new pin; archived screens retain
353346
it for later use. A changed replacement, playlist revision, or observed screen
354347
impact requires a fresh preview and review. Screen assignments can change after
355-
the snapshot; the server atomically checks only the playlist revision. Release
348+
the snapshot; the server checks the playlist revision atomically only when `--expect-rev` is supplied. Release
356349
availability and ownership are validated by the server on apply. After writing,
357350
verify screen manifest revisions and playback. Existing pins stay unchanged
358351
until the replacement is applied.
359352

360353
Playlist validate, create, update, preview, and screen publish accept `-` as their
361354
input file to read stdin. JSON envelopes are never written into authored files.
362355
`--expect-rev` is the preferred revision spelling; `--if-match` remains a compatible
363-
alias. Supply only one. The HTTP revision contract is unchanged.
356+
alias. Supply only one. Omit the flag to write the current resource without a revision precondition. A supplied stale revision still returns `revision_conflict`.
364357

365358
Generation accepts either `--prompt TEXT` or `--prompt-file FILE`, including
366359
`--prompt-file -` for stdin. The file is the complete prompt, with no trimming;

‎plugins/screenrig/cli/assets/playlist-write.schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$comment": "Generated by screenrig-protocol-gen from api/openapi.yaml; sha256=6370115f975eef2fe1cfd31b6c05df55938e800e51f21697d1c8de9d009dfd89. Shape validation only; run canonical playlist-write-semantics.ts next. Reference resolution and DNS remain server checks.",
2+
"$comment": "Generated by screenrig-protocol-gen from api/openapi.yaml; sha256=0b3d50daa0155690822dedb58db295982e3b33e84389f22ffa463093b48b1e60. Shape validation only; run canonical playlist-write-semantics.ts next. Reference resolution and DNS remain server checks.",
33
"$defs": {
44
"CanvasBackground": {
55
"description": "Solid canonical uppercase #RRGGBBAA, or a top-to-bottom linear gradient.",

‎plugins/screenrig/cli/assets/screenrig.runtime.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,12 +2301,12 @@
23012301
}
23022302
async kvDelete(key, expectedRevision, options = {}) {
23032303
const context = this.requireCapability("kv.write");
2304-
if (!Number.isInteger(expectedRevision) || expectedRevision < 0) {
2304+
if (expectedRevision !== void 0 && (!Number.isInteger(expectedRevision) || expectedRevision < 0)) {
23052305
throw new SdkValidationError("invalid_revision", "expectedRevision must be a non-negative integer");
23062306
}
23072307
const payload = {
23082308
key: this.requireKey(key),
2309-
expected_revision: expectedRevision,
2309+
...expectedRevision === void 0 ? {} : { expected_revision: expectedRevision },
23102310
idempotency_key: options.idempotencyKey ?? randomIdempotencyKey(),
23112311
generation: context.generation,
23122312
nonce: context.nonce

‎plugins/screenrig/cli/dist/authoring-input.d.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ import type { CliRuntime } from "./runtime.js";
22
export declare function readAuthoringText(file: string, runtime: CliRuntime, maxBytes?: number): Promise<string>;
33
export declare function readAuthoringJson(file: string, runtime: CliRuntime): Promise<any>;
44
/** Exclusive creation keeps a prepared document safe from accidental replacement. */
5-
export declare function writeAuthoringJson(file: string, document: unknown, runtime: CliRuntime): Promise<string>;
5+
export declare function writeAuthoringJson(file: string, document: unknown, runtime: CliRuntime, overwrite?: boolean): Promise<string>;
6+
export declare function readInputBytes(file: string, cwd: string, runtime: CliRuntime | undefined, maxBytes: number): Promise<Buffer>;
67
//# sourceMappingURL=authoring-input.d.ts.map

‎plugins/screenrig/cli/dist/authoring-input.d.ts.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plugins/screenrig/cli/dist/authoring-input.js‎

Lines changed: 32 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)