Skip to content

Commit 55bd56d

Browse files
committed
Teach agent capabilities and bundle the CLI
1 parent e8d0dbe commit 55bd56d

33 files changed

Lines changed: 199 additions & 28 deletions

‎components.lock.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"commit": "b55296d2019f343fbc0bbcc3237eb35943528c73",
77
"artifact": {
88
"file": "screenrig-cli.tgz",
9-
"sha256": "cac3047920e94720269050ecf290ccc27290b0686edf5668158dfc1eae8b677c"
9+
"sha256": "cd4bec4b5d2986d3cd31c5a474db0cce69c6d3f6ecdcac24fae458bd1d5033d9"
1010
}
1111
}
1212
}

‎plugins/screenrig/cli/README.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,39 @@ Without `--wait`, `--timeout` can shorten but never extend the one-second
759759
snapshot budget. Approval requests expire after 24 hours. Terminal denial,
760760
cancellation, and expiry remain errors.
761761
762+
### Agent credential capabilities
763+
764+
`agent enroll` grants its first agent all six capabilities. For an existing
765+
project, request only what this installation needs:
766+
767+
```sh
768+
screenrig agent connect --capability advertising --print-url
769+
screenrig agent connect --capability content --capability playlists --capability screens --print-url
770+
screenrig agent status
771+
```
772+
773+
`--capability` is repeatable. Valid names, in canonical order, are `screens`,
774+
`content`, `playlists`, `advertising`, `reports`, and `project`. Omit the flag to
775+
request all six; unknown, empty, or duplicate names fail locally. The dashboard
776+
approver can grant a non-empty subset of the requested set. Resume without
777+
changing capabilities; `agent status` and enrollment/connection results show
778+
the granted `agent.capabilities`.
779+
780+
The area capabilities permit their area's reads and writes. `content` covers
781+
media, applications and operation cancellation; `project` covers project
782+
changes, browser-link claims, webhooks, invitations and billing. `reports`
783+
permits area reads and is required for events and playback reports. Basic
784+
project, current-agent and operation-status reads remain available to any
785+
active credential. These permissions are distinct from project feature
786+
entitlements (`project capabilities`); both must allow an operation.
787+
788+
Capabilities cannot be changed on a credential. A capability refusal is HTTP
789+
403 `forbidden`, with `This agent credential lacks the <name> capability.`
790+
Follow the CLI's `error.next` guidance: connect a new agent with the needed
791+
capabilities using a separate private `--config` path, obtain dashboard
792+
approval, verify it with `agent status`, then disconnect the old agent. Do not
793+
retry the denied write unchanged or broaden permissions without authorization.
794+
762795
### Recovering writes
763796
764797
Ordinary application uploads/updates, playlist creates/updates/deletes, screen

‎plugins/screenrig/cli/assets/playlist-write-v2.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=422df6fb4da39573702d8e6e182b11b722f4e2358386048af0cc38f2bd763deb. Shape validation for the adslot page union. Run canonical playlist-write-semantics.ts next. At most 16 adslot pages and one ordinary page with no visibility remain server checks.",
2+
"$comment": "Generated by screenrig-protocol-gen from api/openapi.yaml; sha256=748fbac08592b462d8f69b375f9f6a8d1f22343b297b67e8dc8a3b0d9d232fd8. Shape validation for the adslot page union. Run canonical playlist-write-semantics.ts next. At most 16 adslot pages and one ordinary page with no visibility remain server checks.",
33
"$defs": {
44
"AdslotPageWrite": {
55
"additionalProperties": false,

‎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=422df6fb4da39573702d8e6e182b11b722f4e2358386048af0cc38f2bd763deb. 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=748fbac08592b462d8f69b375f9f6a8d1f22343b297b67e8dc8a3b0d9d232fd8. 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/dist/adapters/protocol.d.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,12 @@ export interface CLIEnrollmentRequest {
111111
platform?: string;
112112
version?: string;
113113
}
114+
export declare const AGENT_CAPABILITIES: readonly ["screens", "content", "playlists", "advertising", "reports", "project"];
115+
export type AgentCapability = typeof AGENT_CAPABILITIES[number];
114116
export interface Agent {
115117
agent_type: string;
116118
authenticated_requests: number;
119+
capabilities: AgentCapability[];
117120
connected_at?: string;
118121
created_at: string;
119122
id: string;
@@ -137,6 +140,7 @@ export interface X25519PublicJWK {
137140
}
138141
export interface AgentConnectionRequest {
139142
agent_type?: string;
143+
capabilities?: AgentCapability[];
140144
name?: string;
141145
platform?: string;
142146
recipient_public_key: X25519PublicJWK;
@@ -150,6 +154,7 @@ export interface AgentConnectionStart {
150154
}
151155
export interface AgentConnection {
152156
agent_type: string;
157+
capabilities: AgentCapability[];
153158
connection_id: string;
154159
created_at: string;
155160
expires_at: string;

‎plugins/screenrig/cli/dist/adapters/protocol.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/adapters/protocol.js‎

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

‎plugins/screenrig/cli/dist/adapters/protocol.js.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/agent-identity.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/agent-identity.js‎

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

0 commit comments

Comments
 (0)