@putdotio/rokit 1.6.0 → 2.0.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/AGENTS.md +90 -0
- package/CONTRIBUTING.md +52 -0
- package/README.md +83 -105
- package/SECURITY.md +38 -0
- package/dist/index.d.mts +20 -1
- package/dist/index.mjs +2 -2
- package/dist/rokit.mjs +798 -66
- package/dist/{roku-CXHAzYR-.mjs → roku-BxnS6Axs.mjs} +132 -8
- package/docs/DISTRIBUTION.md +60 -0
- package/docs/READINESS.md +80 -0
- package/docs/skills/rokit-harness/SKILL.md +40 -0
- package/examples/live-probe-channel/components/MainScene.xml +26 -0
- package/examples/live-probe-channel/manifest +5 -0
- package/examples/live-probe-channel/source/main.brs +14 -0
- package/package.json +15 -5
package/AGENTS.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Agent Guide
|
|
2
|
+
|
|
3
|
+
`rokit` is a small Node CLI that wraps generic Roku device harness primitives.
|
|
4
|
+
Keep it platform-focused, typed, and useful for both humans and agents.
|
|
5
|
+
|
|
6
|
+
## Generic Tool Boundary
|
|
7
|
+
|
|
8
|
+
- Keep `rokit` free of put.io product behavior. Do not add put.io app IDs,
|
|
9
|
+
deep links, content IDs, account data, credentials, journeys, UI node names,
|
|
10
|
+
or product assertions.
|
|
11
|
+
- `@putdotio/rokit`, `putdotio/rokit`, release-bot wiring, copyright, and
|
|
12
|
+
security contacts are ownership/publishing metadata only; do not treat them
|
|
13
|
+
as permission to add product-specific fixtures.
|
|
14
|
+
- Use neutral examples such as `dev`, `Example Channel`, `videoPlayerScreen`,
|
|
15
|
+
and synthetic SceneGraph/XML data when docs or tests need sample app data.
|
|
16
|
+
- Consumer app repos own product scenario scripts, app-specific selectors,
|
|
17
|
+
playback/content assertions, and review artifacts.
|
|
18
|
+
|
|
19
|
+
## Patterns
|
|
20
|
+
|
|
21
|
+
- Use Effect at the runtime boundary and for reusable effectful operations. Keep
|
|
22
|
+
errors schema-backed and render them without stack traces in CLI output.
|
|
23
|
+
- Keep CLI wiring thin: parse/dispatch commands, then call named Roku helpers.
|
|
24
|
+
- Keep human output stable; `--json` / `--output json` should wrap every
|
|
25
|
+
command result and error in a deterministic object for agents.
|
|
26
|
+
- Keep `src/index.ts` as the public library surface for app-specific scenario
|
|
27
|
+
scripts. Export generic Roku/SceneGraph primitives only.
|
|
28
|
+
- Treat `process.cwd()` as the consumer app root.
|
|
29
|
+
- Keep `.rokit/` consumer-local; it can hold env, generated artifacts, and
|
|
30
|
+
transient device state.
|
|
31
|
+
- Keep `examples/live-probe-channel` generic. It exists only to prove package,
|
|
32
|
+
install, launch, input, SceneGraph, screenshot, and proof mechanics.
|
|
33
|
+
- Wrap `roku-deploy` for package publish, screenshots, and device metadata when
|
|
34
|
+
it already owns the platform mechanics.
|
|
35
|
+
- Use Roku ECP for launch, keypresses, active-app queries, and raw runtime
|
|
36
|
+
state.
|
|
37
|
+
- Media-player helpers can parse and wait on Roku `/query/media-player` state,
|
|
38
|
+
but app repos own expectations about specific content, playback URLs, and
|
|
39
|
+
containers.
|
|
40
|
+
- Keep SceneGraph helpers generic: node state, text, attributes, focus/state
|
|
41
|
+
waits, and raw tree output are okay; product-specific screen contracts stay in
|
|
42
|
+
app repos.
|
|
43
|
+
- Keep app journeys, content IDs, account data, and product assertions out of
|
|
44
|
+
the generic harness.
|
|
45
|
+
|
|
46
|
+
## Sharp Edges
|
|
47
|
+
|
|
48
|
+
- Missing config/env and child-command failures should not print stack traces.
|
|
49
|
+
- `ROKIT_PASSWORD` is required only for developer-installer operations such as
|
|
50
|
+
install and screenshot.
|
|
51
|
+
- `ROKU_DEV_TARGET` and `ROKU_DEV_PASSWORD` are compatibility fallbacks, not the
|
|
52
|
+
primary public contract.
|
|
53
|
+
- Avoid sleeps in generic commands. App repos can add meaningful wait/assert
|
|
54
|
+
loops around `rokit` primitives.
|
|
55
|
+
- Release details live in `docs/DISTRIBUTION.md`; readiness details live in
|
|
56
|
+
`docs/READINESS.md`.
|
|
57
|
+
|
|
58
|
+
## When Contracts Change
|
|
59
|
+
|
|
60
|
+
- Command, env, or output changes: update `README.md` and CLI tests.
|
|
61
|
+
- CI/release/publishing changes: update workflow docs or release config in the
|
|
62
|
+
same change.
|
|
63
|
+
- Keep `CLAUDE.md` as a symlink to this file if Claude-compatible discovery is
|
|
64
|
+
added.
|
|
65
|
+
|
|
66
|
+
## Checks
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
vp install
|
|
70
|
+
vp run verify
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Fast loops:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
vp run check
|
|
77
|
+
vp run typecheck
|
|
78
|
+
vp run smoke
|
|
79
|
+
vp run test
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Live Roku checks when a developer-enabled device exists:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
ROKIT_TARGET=<roku-ip> vp run live:smoke
|
|
86
|
+
ROKIT_TARGET=<roku-ip> ROKIT_PASSWORD=<password> vp run live:probe
|
|
87
|
+
ROKIT_TARGET=<roku-ip> vp exec rokit check
|
|
88
|
+
ROKIT_TARGET=<roku-ip> vp exec rokit launch dev
|
|
89
|
+
ROKIT_TARGET=<roku-ip> vp exec rokit press Info Back
|
|
90
|
+
```
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp install
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Run Locally
|
|
10
|
+
|
|
11
|
+
Use the built CLI through the package scripts while developing:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
vp run smoke
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
For live Roku checks, set local environment variables in your shell or
|
|
18
|
+
`.rokit/.env`.
|
|
19
|
+
|
|
20
|
+
## Validation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
vp run verify
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`verify` runs static checks, TypeScript, packaging, tests, and an npm pack dry
|
|
27
|
+
run.
|
|
28
|
+
|
|
29
|
+
## Live Checks
|
|
30
|
+
|
|
31
|
+
Live checks require a developer-enabled Roku on the same network:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ROKIT_TARGET=<roku-ip> vp run live:smoke
|
|
35
|
+
ROKIT_TARGET=<roku-ip> vp exec rokit press Info Back
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Screenshots and installs require `ROKIT_PASSWORD`.
|
|
39
|
+
|
|
40
|
+
Keep local device details in `.rokit/.env` or your shell. Do not commit device
|
|
41
|
+
IPs, passwords, signing keys, tokens, or account-specific app data.
|
|
42
|
+
|
|
43
|
+
## Pull Requests
|
|
44
|
+
|
|
45
|
+
- Keep changes focused.
|
|
46
|
+
- Add or update tests when command behavior, parsing, output, or public exports change.
|
|
47
|
+
- Include the most useful verification evidence for the change.
|
|
48
|
+
- Keep app-specific journeys out of `rokit`; add those to the consuming app repo instead.
|
|
49
|
+
|
|
50
|
+
## Distribution
|
|
51
|
+
|
|
52
|
+
Release and publishing details live in [Distribution](./docs/DISTRIBUTION.md).
|
package/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
+
<p>
|
|
3
|
+
<img src="https://static.put.io/images/putio-boncuk.png" width="72" alt="put.io Boncuk logo">
|
|
4
|
+
</p>
|
|
5
|
+
|
|
2
6
|
<h1>rokit</h1>
|
|
3
7
|
|
|
4
|
-
<p>
|
|
8
|
+
<p>Roku device harness primitives for package, launch, input, state, and proof loops.</p>
|
|
9
|
+
<p>Generic by design: app journeys, credentials, content IDs, and product assertions stay in consumer repos.</p>
|
|
5
10
|
|
|
6
11
|
<p>
|
|
7
12
|
<a href="https://github.com/putdotio/rokit/actions/workflows/ci.yml?query=branch%3Amain" style="text-decoration:none;"><img src="https://img.shields.io/github/actions/workflow/status/putdotio/rokit/ci.yml?branch=main&style=flat&label=ci&colorA=000000&colorB=000000" alt="CI"></a>
|
|
@@ -16,37 +21,86 @@
|
|
|
16
21
|
pnpm add -D @putdotio/rokit
|
|
17
22
|
```
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
own app-specific journeys, content IDs, credentials, or product assertions.
|
|
24
|
+
Node `>=24.14 <25`
|
|
21
25
|
|
|
22
|
-
##
|
|
26
|
+
## Quick Start
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
Set the target Roku in the app repo that consumes `rokit`:
|
|
25
29
|
|
|
26
30
|
```bash
|
|
27
|
-
ROKIT_TARGET=<roku-ip>
|
|
28
|
-
ROKIT_PASSWORD=<developer-mode-password>
|
|
31
|
+
export ROKIT_TARGET=<roku-ip>
|
|
32
|
+
export ROKIT_PASSWORD=<developer-mode-password>
|
|
29
33
|
```
|
|
30
34
|
|
|
31
|
-
Then run:
|
|
35
|
+
Then run the generic device checks and actions you need:
|
|
32
36
|
|
|
33
37
|
```bash
|
|
34
38
|
pnpm exec rokit check
|
|
39
|
+
pnpm exec rokit package --out artifacts/live/channel.zip
|
|
40
|
+
pnpm exec rokit install artifacts/live/channel.zip
|
|
35
41
|
pnpm exec rokit launch dev
|
|
36
42
|
pnpm exec rokit press Down Select
|
|
37
|
-
pnpm exec rokit
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
pnpm exec rokit proof artifacts/live/proof --screenshot
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`ROKIT_PASSWORD` is required for developer-installer operations such as
|
|
47
|
+
`install` and `screenshot`. `ROKU_DEV_TARGET` and `ROKU_DEV_PASSWORD` are
|
|
48
|
+
accepted as compatibility fallbacks for app repos that already use Roku dev
|
|
49
|
+
naming.
|
|
50
|
+
|
|
51
|
+
## Automation
|
|
52
|
+
|
|
53
|
+
Prefer JSON when `rokit` feeds another tool:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pnpm exec rokit describe
|
|
41
57
|
pnpm exec rokit --json active-app
|
|
58
|
+
pnpm exec rokit --dry-run launch dev
|
|
59
|
+
pnpm exec rokit --fields status,data.state media-player
|
|
60
|
+
pnpm exec rokit --input-json '{"command":"press","keys":["Down","Select"]}'
|
|
42
61
|
```
|
|
43
62
|
|
|
44
|
-
|
|
63
|
+
`describe` prints the machine-readable command surface, including command
|
|
64
|
+
names, parameters, JSON payload fields, global options, and automation feature
|
|
65
|
+
flags. When stdout is not a TTY, command output defaults to JSON unless
|
|
66
|
+
`--output text` is explicit.
|
|
67
|
+
|
|
68
|
+
## Command Surface
|
|
69
|
+
|
|
70
|
+
Common commands:
|
|
71
|
+
|
|
72
|
+
| Command | Purpose |
|
|
73
|
+
| -------------------------------------------------- | -------------------------------------------------- |
|
|
74
|
+
| `describe` | Print the machine-readable command surface |
|
|
75
|
+
| `check` | Confirm ECP and developer-installer reachability |
|
|
76
|
+
| `discover` | Find Roku ECP devices with SSDP |
|
|
77
|
+
| `device-info` | Read Roku device metadata |
|
|
78
|
+
| `active-app` | Read the foreground app |
|
|
79
|
+
| `media-player` | Read parsed `/query/media-player` state |
|
|
80
|
+
| `snapshot` | Read a compact state snapshot |
|
|
81
|
+
| `proof <output-dir>` | Write reviewable local proof artifacts |
|
|
82
|
+
| `package --out <zip-path>` | Create a sideload ZIP from the current app root |
|
|
83
|
+
| `install <zip-path>` | Publish an existing ZIP to the Roku developer slot |
|
|
84
|
+
| `launch <app-id>` | Launch an app by id with optional params |
|
|
85
|
+
| `press <key...>` | Send Roku remote keys |
|
|
86
|
+
| `query <ecp-path>` | Print a raw ECP response |
|
|
87
|
+
| `sgnodes` | Print the raw SceneGraph tree |
|
|
88
|
+
| `assert-node` / `wait-node` | Check generic SceneGraph node state |
|
|
89
|
+
| `wait-active` / `wait-media-player` / `wait-ready` | Poll generic runtime readiness |
|
|
90
|
+
| `screenshot <output-path>` | Save a developer screenshot |
|
|
91
|
+
|
|
92
|
+
Mutating commands support `--dry-run` where the platform can validate without
|
|
93
|
+
changing device or filesystem state. ECP paths reject query strings, fragments,
|
|
94
|
+
traversal, backslashes, control characters, and percent-encoded path segments.
|
|
95
|
+
Generated output paths must stay within the current working directory.
|
|
96
|
+
|
|
97
|
+
## Library Use
|
|
98
|
+
|
|
99
|
+
App-specific scenario scripts can import the generic helpers:
|
|
45
100
|
|
|
46
101
|
```ts
|
|
47
102
|
import {
|
|
48
|
-
|
|
49
|
-
assertNamedNodeTranslation,
|
|
103
|
+
assertMediaPlayerContainer,
|
|
50
104
|
assertSceneGraphNode,
|
|
51
105
|
pressKey,
|
|
52
106
|
querySceneGraph,
|
|
@@ -55,7 +109,6 @@ import {
|
|
|
55
109
|
} from "@putdotio/rokit";
|
|
56
110
|
|
|
57
111
|
const target = process.env.ROKIT_TARGET;
|
|
58
|
-
|
|
59
112
|
if (!target) {
|
|
60
113
|
throw new Error("ROKIT_TARGET is not set");
|
|
61
114
|
}
|
|
@@ -67,103 +120,28 @@ const context: RokuContext = {
|
|
|
67
120
|
};
|
|
68
121
|
|
|
69
122
|
await pressKey(context, "Info");
|
|
70
|
-
|
|
123
|
+
await querySceneGraph(context, { attempts: 3, requireComplete: true });
|
|
71
124
|
await assertSceneGraphNode(context, "videoPlayerScreen", { state: "visible" });
|
|
72
|
-
|
|
73
|
-
await waitForSceneGraphAssertion(context, "
|
|
74
|
-
|
|
125
|
+
await assertMediaPlayerContainer(context, "mp4");
|
|
126
|
+
await waitForSceneGraphAssertion(context, "player ready", (xml) => {
|
|
127
|
+
if (!xml.includes("videoPlayerScreen")) {
|
|
128
|
+
throw new Error("expected player screen");
|
|
129
|
+
}
|
|
75
130
|
});
|
|
76
131
|
```
|
|
77
132
|
|
|
78
|
-
## Commands
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
rokit check
|
|
82
|
-
rokit device-info
|
|
83
|
-
rokit active-app
|
|
84
|
-
rokit media-player
|
|
85
|
-
rokit wait-active <app-id> [--timeout-ms <ms>]
|
|
86
|
-
rokit wait-media-player <state> [--timeout-ms <ms>]
|
|
87
|
-
rokit launch <app-id> [--param key=value]
|
|
88
|
-
rokit press [--delay-ms <ms>] <key> [key...]
|
|
89
|
-
rokit query <ecp-path>
|
|
90
|
-
rokit sgnodes
|
|
91
|
-
rokit assert-node <node-name> <visible|hidden|absent|text|attr> [value]
|
|
92
|
-
rokit wait-node <node-name> <visible|hidden|absent|text|attr> [value] [--timeout-ms <ms>]
|
|
93
|
-
rokit screenshot <output-path>
|
|
94
|
-
rokit install <zip-path>
|
|
95
|
-
rokit --version
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Global options:
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
rokit --json <command>
|
|
102
|
-
rokit --output json <command>
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
JSON mode wraps command output as `{ "status": "ok", "command": "...", ... }`
|
|
106
|
-
and reports failures as `{ "status": "failed", "error": { "message": "..." } }`.
|
|
107
|
-
|
|
108
|
-
- `check` confirms the Roku ECP endpoint responds and the developer installer
|
|
109
|
-
is reachable.
|
|
110
|
-
- `device-info` prints enhanced Roku device metadata as JSON.
|
|
111
|
-
- `active-app` prints the foreground app.
|
|
112
|
-
- `media-player` prints parsed `/query/media-player` playback state, including
|
|
113
|
-
state, container, position, duration, and format metadata.
|
|
114
|
-
- `wait-active` waits until the requested app is foregrounded and tolerates
|
|
115
|
-
transient ECP read failures while polling.
|
|
116
|
-
- `wait-media-player` waits until `/query/media-player` reports a target state
|
|
117
|
-
such as `play`, `pause`, or `buffer`.
|
|
118
|
-
- `launch` opens an app and waits until it is active. Use repeated `--param`
|
|
119
|
-
values for deeplink parameters. Roku launch responses can race app startup, so
|
|
120
|
-
launch accepts transient timeout/fetch failures and then verifies foreground
|
|
121
|
-
state.
|
|
122
|
-
- `press` sends Roku remote keys through ECP. Use `--delay-ms` for navigation
|
|
123
|
-
sequences that need a stable gap between keys.
|
|
124
|
-
- `query` prints a raw ECP response such as `/query/sgnodes/all`.
|
|
125
|
-
- `sgnodes` prints the raw SceneGraph tree from `/query/sgnodes/all`. Library
|
|
126
|
-
callers can pass retry options to `querySceneGraph`.
|
|
127
|
-
- `assert-node` checks a named SceneGraph node once.
|
|
128
|
-
- `wait-node` polls SceneGraph until a named node condition matches.
|
|
129
|
-
- `screenshot` saves a developer screenshot. It requires `ROKIT_PASSWORD`.
|
|
130
|
-
- `install` publishes an existing ZIP through `roku-deploy`. It requires
|
|
131
|
-
`ROKIT_PASSWORD`.
|
|
132
|
-
|
|
133
|
-
## Environment
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
ROKIT_TARGET=<roku-ip>
|
|
137
|
-
ROKIT_PASSWORD=<developer-mode-password>
|
|
138
|
-
ROKIT_USERNAME=rokudev
|
|
139
|
-
ROKIT_TIMEOUT_MS=10000
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
`ROKU_DEV_TARGET` and `ROKU_DEV_PASSWORD` are accepted as fallbacks for app
|
|
143
|
-
repos that already use Roku dev naming.
|
|
144
|
-
|
|
145
|
-
Keep `.rokit/` local. Device IPs, Developer Mode passwords, signing keys, user
|
|
146
|
-
tokens, and app-specific media identifiers do not belong in git.
|
|
147
|
-
|
|
148
133
|
## Boundaries
|
|
149
134
|
|
|
150
|
-
`rokit`
|
|
135
|
+
`rokit` owns generic Roku mechanics:
|
|
151
136
|
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
- launch and deeplink parameters
|
|
155
|
-
- remote keypresses
|
|
156
|
-
- raw ECP queries
|
|
157
|
-
- parsed media-player state from `/query/media-player`
|
|
137
|
+
- package, install, launch, deeplink params, and remote keypresses
|
|
138
|
+
- raw ECP queries and parsed media-player state
|
|
158
139
|
- SceneGraph state queries and named-node assertions
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
App repositories should keep their own scenario commands for product behavior,
|
|
165
|
-
such as opening a specific route, asserting playback state, generating review
|
|
166
|
-
HTML, or checking app-specific UI nodes.
|
|
140
|
+
- screenshots, snapshots, and proof artifacts
|
|
141
|
+
|
|
142
|
+
Consumer app repos own product behavior: opening specific routes, asserting
|
|
143
|
+
playback for real content, checking app-specific UI nodes, and generating review
|
|
144
|
+
artifacts.
|
|
167
145
|
|
|
168
146
|
## Docs
|
|
169
147
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
If you believe you have found a security or privacy issue in this project,
|
|
4
|
+
please report it privately.
|
|
5
|
+
|
|
6
|
+
## Contact
|
|
7
|
+
|
|
8
|
+
- email: devs@put.io
|
|
9
|
+
|
|
10
|
+
Private reports are preferred for security and privacy issues.
|
|
11
|
+
|
|
12
|
+
If you are unsure whether something is sensitive, email first instead of opening
|
|
13
|
+
a public issue.
|
|
14
|
+
|
|
15
|
+
## Scope
|
|
16
|
+
|
|
17
|
+
Useful reports usually include issues involving:
|
|
18
|
+
|
|
19
|
+
- token, secret, or credential exposure
|
|
20
|
+
- unsafe handling of device passwords or signing keys
|
|
21
|
+
- command injection through CLI arguments, env values, or device responses
|
|
22
|
+
- publishing, release, or package integrity problems
|
|
23
|
+
- private device, account, or media identifier exposure
|
|
24
|
+
|
|
25
|
+
## Guidelines
|
|
26
|
+
|
|
27
|
+
- test only against devices, accounts, environments, and data you control
|
|
28
|
+
- keep testing non-destructive, low-volume, and service-safe
|
|
29
|
+
- do not include device passwords, signing keys, account tokens, private content IDs, or local device identifiers in public issues, pull requests, examples, or logs
|
|
30
|
+
|
|
31
|
+
## Supported Versions
|
|
32
|
+
|
|
33
|
+
Only the latest published version receives routine fixes.
|
|
34
|
+
|
|
35
|
+
## Disclosure
|
|
36
|
+
|
|
37
|
+
Please allow a reasonable amount of time to investigate and fix the issue before
|
|
38
|
+
sharing details publicly.
|
package/dist/index.d.mts
CHANGED
|
@@ -23,6 +23,9 @@ declare const readNamedNodeTranslation: (xml: string, nodeName: string) => Scene
|
|
|
23
23
|
declare const readSceneGraphStatus: (xml: string) => SceneGraphStatus;
|
|
24
24
|
declare const readSceneGraphFailure: (xml: string) => string | undefined;
|
|
25
25
|
declare const isNamedNodeVisible: (xml: string, nodeName: string) => boolean;
|
|
26
|
+
declare const isCompleteSceneGraph: (xml: string) => boolean;
|
|
27
|
+
declare const escapeXmlAttribute: (value: string) => string;
|
|
28
|
+
declare const sceneGraphContainsText: (xml: string, text: string) => boolean;
|
|
26
29
|
declare const assertSceneGraphNumberNear: (actual: number | undefined, expected: number, label: string, tolerance?: number) => void;
|
|
27
30
|
declare const assertNamedNodeTranslation: (xml: string, nodeName: string, expectedX: number, expectedY: number, tolerance?: number) => void;
|
|
28
31
|
declare const assertNamedNodeSize: (xml: string, nodeName: string, expectedWidth: number, expectedHeight: number, tolerance?: number) => void;
|
|
@@ -57,6 +60,12 @@ type DeviceSummary = {
|
|
|
57
60
|
readonly model: string;
|
|
58
61
|
readonly name: string;
|
|
59
62
|
};
|
|
63
|
+
type DiscoveredRokuDevice = {
|
|
64
|
+
readonly location: string;
|
|
65
|
+
readonly server?: string;
|
|
66
|
+
readonly target?: string;
|
|
67
|
+
readonly usn?: string;
|
|
68
|
+
};
|
|
60
69
|
type MediaPlayerState = "buffer" | "close" | "error" | "none" | "open" | "pause" | "play" | "stop" | string;
|
|
61
70
|
type MediaPlayerInfo = {
|
|
62
71
|
readonly audio?: string;
|
|
@@ -77,6 +86,7 @@ type MediaPlayerInfo = {
|
|
|
77
86
|
};
|
|
78
87
|
type RetryOptions = {
|
|
79
88
|
readonly attempts?: number;
|
|
89
|
+
readonly requireComplete?: boolean;
|
|
80
90
|
readonly retryDelayMs?: number;
|
|
81
91
|
};
|
|
82
92
|
type SceneGraphAssertion = (xml: string) => void;
|
|
@@ -84,20 +94,27 @@ type WaitForSceneGraphAssertionOptions = {
|
|
|
84
94
|
readonly pollIntervalMs?: number;
|
|
85
95
|
readonly timeoutMs?: number;
|
|
86
96
|
};
|
|
97
|
+
type PackageResult = {
|
|
98
|
+
readonly path: string;
|
|
99
|
+
};
|
|
87
100
|
declare const checkDevice: (context: RokuContext) => Promise<DeviceSummary>;
|
|
88
101
|
declare const getDeviceInfo: (context: RokuContext) => Promise<rokuDeploy.DeviceInfo>;
|
|
89
102
|
declare const queryActiveApp: (context: RokuContext) => Promise<ActiveApp>;
|
|
103
|
+
declare const discoverRokuDevices: (timeoutMs?: number) => Promise<DiscoveredRokuDevice[]>;
|
|
90
104
|
declare const waitForActiveApp: (context: RokuContext, appId: string, timeoutMs?: number) => Promise<ActiveApp>;
|
|
91
105
|
declare const launchApp: (context: RokuContext, appId: string, params?: ReadonlyMap<string, string>) => Promise<ActiveApp>;
|
|
92
106
|
declare const pressKey: (context: RokuContext, key: string) => Promise<void>;
|
|
93
107
|
declare const queryEcp: (context: RokuContext, path: string) => Promise<string>;
|
|
94
108
|
declare const queryMediaPlayerXml: (context: RokuContext) => Promise<string>;
|
|
95
109
|
declare const queryMediaPlayer: (context: RokuContext) => Promise<MediaPlayerInfo>;
|
|
110
|
+
declare const queryMediaPlayerXmlSafe: (context: RokuContext) => Promise<string | undefined>;
|
|
111
|
+
declare const queryMediaPlayerSafe: (context: RokuContext) => Promise<MediaPlayerInfo | undefined>;
|
|
96
112
|
declare const readMediaPlayerInfo: (xml: string) => MediaPlayerInfo;
|
|
97
113
|
declare const readMediaPlayerState: (xml: string) => MediaPlayerState | undefined;
|
|
98
114
|
declare const readMediaPlayerPositionMs: (xml: string) => number | undefined;
|
|
99
115
|
declare const readMediaPlayerContainer: (xml: string) => string | undefined;
|
|
100
116
|
declare const isActiveMediaPlayerState: (state: string | undefined) => boolean;
|
|
117
|
+
declare const assertMediaPlayerContainer: (context: RokuContext, expectedContainer: string) => Promise<MediaPlayerInfo>;
|
|
101
118
|
declare const waitForMediaPlayerState: (context: RokuContext, expectedState: MediaPlayerState, timeoutMs?: number) => Promise<MediaPlayerInfo>;
|
|
102
119
|
declare const querySceneGraph: (context: RokuContext, options?: RetryOptions) => Promise<string>;
|
|
103
120
|
declare const assertSceneGraphNode: (context: RokuContext, nodeName: string, expectation: NodeExpectation) => Promise<void>;
|
|
@@ -109,6 +126,8 @@ declare const installPackage: (context: RokuContext & {
|
|
|
109
126
|
declare const takeScreenshot: (context: RokuContext & {
|
|
110
127
|
readonly password: string;
|
|
111
128
|
}, outputPath: string) => Promise<string>;
|
|
129
|
+
declare const packageChannel: (outputPath: string, rootDir?: string) => Promise<PackageResult>;
|
|
130
|
+
declare const validateEcpPath: (path: string) => string;
|
|
112
131
|
declare const validateRemoteKey: (key: string) => void;
|
|
113
132
|
//#endregion
|
|
114
|
-
export { type ActiveApp, type DeviceSummary, type MediaPlayerInfo, type MediaPlayerState, type NodeExpectation, type NodeState, type RemoteKey, type RetryOptions, type RokuContext, type SceneGraphAssertion, type SceneGraphBounds, type SceneGraphPoint, type SceneGraphStatus, type WaitForSceneGraphAssertionOptions, assertNamedNode, assertNamedNodeSize, assertNamedNodeState, assertNamedNodeText, assertNamedNodeTranslation, assertSceneGraphNode, assertSceneGraphNumberNear, checkDevice, getDeviceInfo, installPackage, isActiveMediaPlayerState, isNamedNodeVisible, launchApp, parseSceneGraphNumberList, pressKey, queryActiveApp, queryEcp, queryMediaPlayer, queryMediaPlayerXml, querySceneGraph, readActiveApp, readMediaPlayerContainer, readMediaPlayerInfo, readMediaPlayerPositionMs, readMediaPlayerState, readNamedNodeAttribute, readNamedNodeAttributes, readNamedNodeBounds, readNamedNodeNumber, readNamedNodeTranslation, readSceneGraphFailure, readSceneGraphStatus, readXmlAttribute, readXmlTag, takeScreenshot, validateRemoteKey, waitForActiveApp, waitForMediaPlayerState, waitForSceneGraphAssertion, waitForSceneGraphNode };
|
|
133
|
+
export { type ActiveApp, type DeviceSummary, type DiscoveredRokuDevice, type MediaPlayerInfo, type MediaPlayerState, type NodeExpectation, type NodeState, type PackageResult, type RemoteKey, type RetryOptions, type RokuContext, type SceneGraphAssertion, type SceneGraphBounds, type SceneGraphPoint, type SceneGraphStatus, type WaitForSceneGraphAssertionOptions, assertMediaPlayerContainer, assertNamedNode, assertNamedNodeSize, assertNamedNodeState, assertNamedNodeText, assertNamedNodeTranslation, assertSceneGraphNode, assertSceneGraphNumberNear, checkDevice, discoverRokuDevices, escapeXmlAttribute, getDeviceInfo, installPackage, isActiveMediaPlayerState, isCompleteSceneGraph, isNamedNodeVisible, launchApp, packageChannel, parseSceneGraphNumberList, pressKey, queryActiveApp, queryEcp, queryMediaPlayer, queryMediaPlayerSafe, queryMediaPlayerXml, queryMediaPlayerXmlSafe, querySceneGraph, readActiveApp, readMediaPlayerContainer, readMediaPlayerInfo, readMediaPlayerPositionMs, readMediaPlayerState, readNamedNodeAttribute, readNamedNodeAttributes, readNamedNodeBounds, readNamedNodeNumber, readNamedNodeTranslation, readSceneGraphFailure, readSceneGraphStatus, readXmlAttribute, readXmlTag, sceneGraphContainsText, takeScreenshot, validateEcpPath, validateRemoteKey, waitForActiveApp, waitForMediaPlayerState, waitForSceneGraphAssertion, waitForSceneGraphNode };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { assertNamedNode, assertNamedNodeSize, assertNamedNodeState, assertNamedNodeText, assertNamedNodeTranslation, assertSceneGraphNode, assertSceneGraphNumberNear, checkDevice, getDeviceInfo, installPackage, isActiveMediaPlayerState, isNamedNodeVisible, launchApp, parseSceneGraphNumberList, pressKey, queryActiveApp, queryEcp, queryMediaPlayer, queryMediaPlayerXml, querySceneGraph, readActiveApp, readMediaPlayerContainer, readMediaPlayerInfo, readMediaPlayerPositionMs, readMediaPlayerState, readNamedNodeAttribute, readNamedNodeAttributes, readNamedNodeBounds, readNamedNodeNumber, readNamedNodeTranslation, readSceneGraphFailure, readSceneGraphStatus, readXmlAttribute, readXmlTag, takeScreenshot, validateRemoteKey, waitForActiveApp, waitForMediaPlayerState, waitForSceneGraphAssertion, waitForSceneGraphNode };
|
|
1
|
+
import { A as assertNamedNode, B as readNamedNodeAttribute, C as takeScreenshot, D as waitForMediaPlayerState, E as waitForActiveApp, F as assertSceneGraphNumberNear, G as readSceneGraphFailure, H as readNamedNodeBounds, I as escapeXmlAttribute, J as readActiveApp, K as readSceneGraphStatus, L as isCompleteSceneGraph, M as assertNamedNodeState, N as assertNamedNodeText, O as waitForSceneGraphAssertion, P as assertNamedNodeTranslation, R as isNamedNodeVisible, T as validateRemoteKey, U as readNamedNodeNumber, V as readNamedNodeAttributes, W as readNamedNodeTranslation, X as readXmlTag, Y as readXmlAttribute, _ as querySceneGraph, a as getDeviceInfo, b as readMediaPlayerPositionMs, c as launchApp, d as queryActiveApp, f as queryEcp, g as queryMediaPlayerXmlSafe, h as queryMediaPlayerXml, i as discoverRokuDevices, j as assertNamedNodeSize, k as waitForSceneGraphNode, l as packageChannel, m as queryMediaPlayerSafe, n as assertSceneGraphNode, o as installPackage, p as queryMediaPlayer, q as sceneGraphContainsText, r as checkDevice, s as isActiveMediaPlayerState, t as assertMediaPlayerContainer, u as pressKey, v as readMediaPlayerContainer, w as validateEcpPath, x as readMediaPlayerState, y as readMediaPlayerInfo, z as parseSceneGraphNumberList } from "./roku-BxnS6Axs.mjs";
|
|
2
|
+
export { assertMediaPlayerContainer, assertNamedNode, assertNamedNodeSize, assertNamedNodeState, assertNamedNodeText, assertNamedNodeTranslation, assertSceneGraphNode, assertSceneGraphNumberNear, checkDevice, discoverRokuDevices, escapeXmlAttribute, getDeviceInfo, installPackage, isActiveMediaPlayerState, isCompleteSceneGraph, isNamedNodeVisible, launchApp, packageChannel, parseSceneGraphNumberList, pressKey, queryActiveApp, queryEcp, queryMediaPlayer, queryMediaPlayerSafe, queryMediaPlayerXml, queryMediaPlayerXmlSafe, querySceneGraph, readActiveApp, readMediaPlayerContainer, readMediaPlayerInfo, readMediaPlayerPositionMs, readMediaPlayerState, readNamedNodeAttribute, readNamedNodeAttributes, readNamedNodeBounds, readNamedNodeNumber, readNamedNodeTranslation, readSceneGraphFailure, readSceneGraphStatus, readXmlAttribute, readXmlTag, sceneGraphContainsText, takeScreenshot, validateEcpPath, validateRemoteKey, waitForActiveApp, waitForMediaPlayerState, waitForSceneGraphAssertion, waitForSceneGraphNode };
|