@runalabs/rill-cli 0.1.2 → 0.1.4
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 +226 -16
- package/dist/cli.js +58 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,31 +1,241 @@
|
|
|
1
1
|
# @runalabs/rill-cli
|
|
2
2
|
|
|
3
|
-
Record,
|
|
3
|
+
Record a browser flow, keep its video and runtime evidence together, and return an inspectable share link. Use Rill to reproduce a bug, verify a change, or hand a browser run to another developer or agent.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Rill starts a local Chromium recorder. Your browser tool drives the returned CDP endpoint; Rill captures the selected page and uploads the result when you stop.
|
|
6
|
+
|
|
7
|
+
[Getting started](https://userill.dev/docs) · [Website CLI reference](https://userill.dev/docs/cli) · [Agent instructions](https://userill.dev/docs/cli#agents)
|
|
8
|
+
|
|
9
|
+
## Install and verify
|
|
10
|
+
|
|
11
|
+
Browser recording runs on macOS and Linux. Install Node.js 22+, Google Chrome or Chromium, and ffmpeg on `PATH`.
|
|
6
12
|
|
|
7
13
|
```sh
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
# macOS
|
|
15
|
+
brew install ffmpeg
|
|
16
|
+
# Debian / Ubuntu
|
|
17
|
+
sudo apt install ffmpeg
|
|
10
18
|
```
|
|
11
19
|
|
|
12
|
-
|
|
13
|
-
The CLI connects to `https://userill.dev` by default.
|
|
14
|
-
|
|
15
|
-
## Record
|
|
20
|
+
Then install the scoped package:
|
|
16
21
|
|
|
17
22
|
```sh
|
|
23
|
+
npm install --global @runalabs/rill-cli
|
|
24
|
+
rill --version
|
|
18
25
|
rill login
|
|
19
26
|
rill doctor
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Do not use `npx rill`: the unscoped package belongs to a different product. Doctor checks Node, API reachability, CLI compatibility, authentication, Chrome, and ffmpeg. Resolve failed checks before starting a run.
|
|
30
|
+
|
|
31
|
+
## Authenticate
|
|
32
|
+
|
|
33
|
+
### Interactive login
|
|
34
|
+
|
|
35
|
+
`rill login` prints a verification URL and device code. Open the URL, sign in, and approve the request. The CLI waits for approval and stores the credential in macOS Keychain or Linux Secret Service using `secret-tool`. Linux needs an available Secret Service keyring; use token authentication on headless machines without one.
|
|
36
|
+
|
|
37
|
+
### CI and unattended agents
|
|
38
|
+
|
|
39
|
+
Create a scoped, expiring agent credential in Rill Settings. Inject it as `RILL_TOKEN` through your environment's secret manager, then run `rill doctor`. This token takes precedence over the OS keychain. Do not put real tokens in source files or command examples.
|
|
40
|
+
|
|
41
|
+
The default API is `https://userill.dev`. `RILL_API_URL` changes it; the global `--api-url <url>` flag takes precedence. Login stores credentials per API URL. Manage and revoke credentials in Settings.
|
|
42
|
+
|
|
43
|
+
## First recording
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
rill record start --url https://example.com --title "Checkout verification"
|
|
47
|
+
# Save recordingId and connect your browser tool to the returned cdpUrl.
|
|
48
|
+
# Perform the flow in the existing recorded page.
|
|
22
49
|
rill record stop <recording-id>
|
|
50
|
+
rill inspect https://userill.dev/s/<share-secret>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Start returns `recordingId`, `cdpUrl`, `status`, `bodyCaptureEnabled`, and `maxDurationSeconds`. Stop finalizes capture, uploads video and diagnostics, and waits for playback. Confirm `status: "ready"` and a non-null `shareUrl` before returning the evidence link. Local capture finishing does not establish remote readiness.
|
|
54
|
+
|
|
55
|
+
### Connect Playwright
|
|
56
|
+
|
|
57
|
+
In a project with `playwright-core` installed, save this as `rill-run.mjs`:
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
import { chromium } from 'playwright-core';
|
|
61
|
+
|
|
62
|
+
const browser = await chromium.connectOverCDP(process.argv[2]);
|
|
63
|
+
try {
|
|
64
|
+
const page = browser.contexts()[0].pages()[0];
|
|
65
|
+
if (!page) throw new Error('The recorded page is unavailable.');
|
|
66
|
+
await page.waitForLoadState('domcontentloaded');
|
|
67
|
+
// Add your flow and assertions here, using this page.
|
|
68
|
+
console.log(await page.title());
|
|
69
|
+
} finally {
|
|
70
|
+
// Disconnect this client; let rill record stop finalize the recording.
|
|
71
|
+
await browser.close();
|
|
72
|
+
}
|
|
23
73
|
```
|
|
24
74
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
75
|
+
Run `node rill-run.mjs "<cdpUrl>"` with the exact endpoint from start. Then run `rill record stop <recording-id>`, including when your verification fails. A page title alone does not verify your app's behavior.
|
|
76
|
+
|
|
77
|
+
Capture follows the first page selected at recording start. Keep the flow in that page: new tabs and popups do not receive complete video and diagnostic coverage. Keep the recorded page open until Rill stops.
|
|
78
|
+
|
|
79
|
+
### Recording options
|
|
80
|
+
|
|
81
|
+
| Option | Behavior |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `--url <url>` | Open the target in a managed browser. |
|
|
84
|
+
| `--title <title>` | Name the run; defaults to a timestamped title. |
|
|
85
|
+
| `--description <text>` | Describe what the run demonstrates. |
|
|
86
|
+
| `--headed` | Show the managed browser; default is headless. |
|
|
87
|
+
| `--cdp-url <url>` | Attach to an existing Chromium browser and record its first open page. Navigate that page with your browser tool. |
|
|
88
|
+
| `--width <pixels>` / `--height <pixels>` | Managed viewport; defaults to 1280 × 720. |
|
|
89
|
+
| `--max-duration <seconds>` | Automatically finalize local capture; defaults to 600. Still call `record stop` to upload. |
|
|
90
|
+
|
|
91
|
+
Rill closes browsers it launches during finalization. Attached browsers remain open.
|
|
92
|
+
|
|
93
|
+
## Set up a coding agent
|
|
94
|
+
|
|
95
|
+
Install and authenticate the CLI where the agent runs. No separate skill installation is required. Optionally save the following workflow in your agent's project instructions or skill setup; it is also available in the [public agent instructions](https://userill.dev/docs/cli#agents):
|
|
96
|
+
|
|
97
|
+
1. Run `rill doctor` and resolve failed checks.
|
|
98
|
+
2. Start a run titled with the claim to verify.
|
|
99
|
+
3. Preserve `recordingId`; connect to `cdpUrl` using a browser tool that supports CDP.
|
|
100
|
+
4. Perform the authorized flow in the existing recorded page.
|
|
101
|
+
5. Stop the same recording and wait for readiness.
|
|
102
|
+
6. Inspect the returned share URL.
|
|
103
|
+
7. Return the link with what passed, failed, or could not be verified.
|
|
104
|
+
|
|
105
|
+
For a bug fix, record the reproduction and verification as separate runs. Attach the ready link to the handoff or pull request.
|
|
106
|
+
|
|
107
|
+
## Inspect a shared run
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
rill inspect https://userill.dev/s/<share-secret>
|
|
111
|
+
rill inspect https://userill.dev/s/<share-secret> > context.json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Inspect returns bounded JSON context for another agent without requiring login. Browser recordings carry video and synchronized console messages, exceptions, network metadata, navigation, and interaction events. Treat this as bounded evidence, not a guarantee of complete capture. Use the share page to watch the run and examine its diagnostics.
|
|
115
|
+
|
|
116
|
+
An active share URL is required. Expired, replaced, revoked, or deleted shares cannot be inspected; ask the owner for a current link.
|
|
117
|
+
|
|
118
|
+
## Upload an existing video
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
rill upload ./test-results/checkout.webm --title "Checkout test"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Upload WebM or MP4 evidence. The command waits for readiness and returns the recording ID and share URL. Existing uploads report `diagnosticsAvailable: false`; they do not import Playwright traces or reconstruct diagnostic events.
|
|
125
|
+
|
|
126
|
+
Both `upload` and `record stop` accept `--no-wait`. This still waits for upload but skips playback processing: the result is `status: "processing"` with `shareUrl: null`. Check the recording in the dashboard before sharing.
|
|
127
|
+
|
|
128
|
+
## Command reference
|
|
129
|
+
|
|
130
|
+
Use `rill --help` or `<command> --help` for supported flags.
|
|
131
|
+
|
|
132
|
+
| Command | Behavior |
|
|
133
|
+
| --- | --- |
|
|
134
|
+
| `rill login` | Authorize a device code and store a credential. |
|
|
135
|
+
| `rill doctor` | Check prerequisites, API compatibility, and authentication. |
|
|
136
|
+
| `rill record start [options]` | Start a managed or attached browser recording. |
|
|
137
|
+
| `rill record stop <recording-id>` | Finalize and upload; supports `--no-wait` and `--no-feedback`. |
|
|
138
|
+
| `rill record status <recording-id>` | Read local state, falling back to remote state if the local session is unavailable. |
|
|
139
|
+
| `rill record cancel <recording-id>` | Abandon a run created by this credential and release its remote quota reservation. |
|
|
140
|
+
| `rill upload <video-file>` | Upload video-only evidence; supports `--title` and `--no-wait`. |
|
|
141
|
+
| `rill inspect <share-url>` | Read bounded context without login. |
|
|
142
|
+
| `rill drafts list` | List directory names under the local draft root. |
|
|
143
|
+
| `rill drafts purge` | Delete draft directories last modified more than 24 hours ago. |
|
|
144
|
+
| `rill feedback submit <recording-id>` | Submit optional Rill-specific feedback. |
|
|
145
|
+
|
|
146
|
+
## Output and errors
|
|
147
|
+
|
|
148
|
+
Data commands emit JSON on stdout and human progress on stderr. Use global `--pretty` for indented JSON. Help and version commands print plain text.
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
rill --pretty record status <recording-id>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Selected fields from a successful stop result:
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"schemaVersion": 1,
|
|
159
|
+
"recordingId": "<recording-id>",
|
|
160
|
+
"status": "ready",
|
|
161
|
+
"shareUrl": "https://userill.dev/s/<share-secret>"
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Stop also returns duration, stop reason, diagnostic summary, and feedback instructions when applicable.
|
|
166
|
+
|
|
167
|
+
Success exits 0; command failures exit 1. Runtime failures emit an `error` object on stdout containing `code`, `message`, and optional `recovery` and `details`. Argument parsing failures may print plain text to stderr. Doctor exits 1 with its JSON check report when a check fails.
|
|
168
|
+
|
|
169
|
+
Check the exit status first, then structured fields. Known codes include `authentication_required`, `scope_denied`, `quota_exceeded`, `browser_unavailable`, `recording_not_found`, `upload_interrupted`, `processing_failed`, `share_revoked`, `validation_failed`, and the fallback `internal_error`. Not every failure has a specific code; avoid branching on message text.
|
|
170
|
+
|
|
171
|
+
## Recovery and troubleshooting
|
|
172
|
+
|
|
173
|
+
- **Doctor fails:** read the failed check's recovery field. Correct the credential, API connectivity, or executable path before recording.
|
|
174
|
+
- **Quota exceeded:** inspect `error.details.quota.type` and `blockingRecordingId` when present. Check the blocking recording; cancel only an abandoned run. Review storage and daily allowance in Billing.
|
|
175
|
+
- **Upload interrupted or processing timed out:** keep the recording ID and local artifacts. Check the dashboard for remote readiness. `record status` prefers local state and can report local `ready` without a share URL; this does not prove remote playback readiness.
|
|
176
|
+
- **Duration limit reached:** local capture finalizes automatically, but `record stop` is still needed to upload.
|
|
177
|
+
- **Local session missing:** `record status` falls back to remote state. `drafts list` locates local directories, which may be incomplete. There is no `drafts resume` command.
|
|
178
|
+
- **Share cannot be inspected:** open the complete URL in a browser; ask the owner for a current link if needed.
|
|
179
|
+
|
|
180
|
+
A failed local startup automatically attempts to cancel the remote reservation it just created. `record cancel` changes remote state and does not stop the local browser; finish local capture before abandoning the remote reservation.
|
|
181
|
+
|
|
182
|
+
When finalized artifacts survive, retain `recording.webm` and `diagnostics-v1.ndjson.gz` in the recording's draft directory. `rill upload <path-to-recording.webm>` is a video-only fallback: it creates a new recording and does not restore the original diagnostics. Successful stop with readiness removes that run's local artifact directory.
|
|
183
|
+
|
|
184
|
+
`drafts purge` deletes local draft directories older than 24 hours by modification time, without a confirmation prompt. Recover needed evidence before purging.
|
|
185
|
+
|
|
186
|
+
## Environment variables
|
|
187
|
+
|
|
188
|
+
| Variable | Purpose |
|
|
189
|
+
| --- | --- |
|
|
190
|
+
| `RILL_TOKEN` | Agent credential; overrides the keychain. |
|
|
191
|
+
| `RILL_API_URL` | API origin; defaults to `https://userill.dev`. Global `--api-url` takes precedence. |
|
|
192
|
+
| `RILL_CHROME_PATH` | Chrome or Chromium executable path. |
|
|
193
|
+
| `RILL_FFMPEG` | ffmpeg executable; defaults to `ffmpeg` on `PATH`. |
|
|
194
|
+
| `RILL_HOME` | Recorder state directory; defaults to `~/.rill`. |
|
|
195
|
+
| `RILL_SOCKET` | Recorder socket; defaults to `recorder.sock` inside `RILL_HOME`. |
|
|
196
|
+
| `RILL_TEMP` | Artifact root; defaults to `rill-recordings` inside the system temporary directory. |
|
|
197
|
+
|
|
198
|
+
Set recorder variables before starting the background recorder; an existing recorder retains its original environment. Use the same configuration for recording, stopping, and draft recovery.
|
|
199
|
+
|
|
200
|
+
## Sharing and privacy
|
|
201
|
+
|
|
202
|
+
Ready recordings get an unlisted share link that expires after seven days. In the recording page, copy it, replace it with a fresh link, or stop sharing. Finished recordings can be deleted after a five-second undo window.
|
|
203
|
+
|
|
204
|
+
Diagnostic redaction targets cookies, credential headers, URL query values, fragments, embedded credentials, and secret-shaped values. Network-body capture defaults off and is controlled by the human-issued credential; the agent cannot enable it for itself. Redaction is best-effort and does not mask the video. Avoid displaying secrets, review evidence before sharing, and treat share URLs as sensitive.
|
|
205
|
+
|
|
206
|
+
## Optional agent feedback
|
|
207
|
+
|
|
208
|
+
After `record stop`, compatible hosts may receive `feedbackRequested: true` and a structured `suggestedAction`. When requested, agents should submit a short Rill-specific review if practical. Workspace opt-in pre-authorizes it; feedback is optional and must not delay or affect the recording result.
|
|
209
|
+
|
|
210
|
+
```sh
|
|
211
|
+
rill feedback submit <recording-id> --outcome succeeded --improvement "Make processing progress clearer"
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
`--outcome` must be `succeeded`, `failed`, or `abandoned`. Include at least one of `--helped`, `--friction`, or `--improvement`. Omit credentials, personal data, and copied page content. Feedback goes to Rill's operators and is not shown on public evidence pages.
|
|
215
|
+
|
|
216
|
+
Skip feedback when it is not requested. Use `rill record stop <recording-id> --no-feedback` to opt out for one run. A feedback failure must not delay returning the share URL.
|
|
217
|
+
|
|
218
|
+
## Update and uninstall
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
npm install --global @runalabs/rill-cli@latest
|
|
222
|
+
rill --version
|
|
223
|
+
rill doctor
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Remove the package:
|
|
227
|
+
|
|
228
|
+
```sh
|
|
229
|
+
npm uninstall --global @runalabs/rill-cli
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
This leaves keychain credentials, recorder state, local drafts, and remote recordings in place. Revoke the credential in Settings if access should end, and remove `RILL_TOKEN` from the environment or secret manager. To remove a stored local credential for the default API:
|
|
233
|
+
|
|
234
|
+
```sh
|
|
235
|
+
# macOS
|
|
236
|
+
security delete-generic-password -a https://userill.dev -s rill
|
|
237
|
+
# Linux
|
|
238
|
+
secret-tool clear service rill api-url https://userill.dev
|
|
239
|
+
```
|
|
29
240
|
|
|
30
|
-
|
|
31
|
-
progress is written to stderr.
|
|
241
|
+
Substitute your API URL if you configured another environment. These commands clear the local credential; server-side revocation is managed in Settings.
|
package/dist/cli.js
CHANGED
|
@@ -621,6 +621,12 @@ var ControlPlaneClient = class {
|
|
|
621
621
|
body: JSON.stringify(input)
|
|
622
622
|
});
|
|
623
623
|
}
|
|
624
|
+
submitRecordingFeedback(recordingId, input) {
|
|
625
|
+
return this.request(`/api/recordings/${recordingId}/feedback`, {
|
|
626
|
+
method: "POST",
|
|
627
|
+
body: JSON.stringify(input)
|
|
628
|
+
});
|
|
629
|
+
}
|
|
624
630
|
provisionVideo(recordingId, input) {
|
|
625
631
|
return this.request(`/api/recordings/${recordingId}/video-upload`, { method: "POST", body: JSON.stringify(input) });
|
|
626
632
|
}
|
|
@@ -939,6 +945,28 @@ function controlPlaneUrl(environmentUrl) {
|
|
|
939
945
|
return environmentUrl ?? PRODUCTION_API_URL;
|
|
940
946
|
}
|
|
941
947
|
|
|
948
|
+
// src/feedback-protocol.ts
|
|
949
|
+
function suggestedFeedbackAction(recordingId) {
|
|
950
|
+
return {
|
|
951
|
+
type: "rill.feedback.submit",
|
|
952
|
+
recommended: true,
|
|
953
|
+
authorizedBy: "workspace_opt_in",
|
|
954
|
+
confirmationRequired: false,
|
|
955
|
+
failurePolicy: "non_blocking",
|
|
956
|
+
recordingId
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function recordingFeedbackFields(recordingId, feedbackRequested) {
|
|
960
|
+
return feedbackRequested ? { feedbackRequested: true, suggestedAction: suggestedFeedbackAction(recordingId) } : { feedbackRequested: false };
|
|
961
|
+
}
|
|
962
|
+
function feedbackSubmissionReceipt(recordingId) {
|
|
963
|
+
return {
|
|
964
|
+
schemaVersion: 1,
|
|
965
|
+
recordingId,
|
|
966
|
+
feedbackStatus: "submitted"
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
|
|
942
970
|
// src/cli.ts
|
|
943
971
|
var program = new Command();
|
|
944
972
|
program.name("rill").description("Record, inspect, and share agent browser runs.").version(CLI_VERSION).option("--api-url <url>", "Rill control plane", controlPlaneUrl(process.env.RILL_API_URL)).option("--pretty", "Pretty-print JSON output", false);
|
|
@@ -992,27 +1020,52 @@ record.command("start").option("--url <url>").option("--title <title>").option("
|
|
|
992
1020
|
}).catch(() => void 0);
|
|
993
1021
|
emit({ schemaVersion: 1, recordingId: remote.recordingId, status: local.status, cdpUrl: local.cdpUrl, bodyCaptureEnabled: remote.bodyCaptureEnabled, maxDurationSeconds: Number(commandOptions.maxDuration) }, options.pretty);
|
|
994
1022
|
});
|
|
995
|
-
record.command("stop").argument("<recording-id>").option("--no-wait").action(async (recordingId, commandOptions) => {
|
|
1023
|
+
record.command("stop").argument("<recording-id>").option("--no-wait").option("--no-feedback").action(async (recordingId, commandOptions) => {
|
|
996
1024
|
const options = program.opts();
|
|
997
1025
|
await ensureDaemon(process.argv[1]);
|
|
998
1026
|
const local = await stopRecording(recordingId);
|
|
999
1027
|
if (!local.result) throw new Error(local.error ?? "The recorder did not produce an artifact.");
|
|
1000
1028
|
const token = await loadCredential(options.apiUrl);
|
|
1001
1029
|
const client = new ControlPlaneClient(options.apiUrl, token);
|
|
1002
|
-
await client.markRecordingStopped(recordingId, {
|
|
1030
|
+
const stopped = await client.markRecordingStopped(recordingId, {
|
|
1003
1031
|
durationSeconds: local.result.durationSeconds,
|
|
1004
1032
|
stoppedReason: local.result.stoppedReason,
|
|
1005
|
-
diagnosticsAvailable: true
|
|
1006
|
-
|
|
1033
|
+
diagnosticsAvailable: true,
|
|
1034
|
+
requestFeedback: commandOptions.feedback
|
|
1035
|
+
}).catch(() => null);
|
|
1007
1036
|
const video = await stat2(local.result.videoPath);
|
|
1008
1037
|
const provisioned = await client.provisionVideo(recordingId, { sizeBytes: video.size, filename: basename(local.result.videoPath), uploadKind: "recorded_browser" });
|
|
1009
1038
|
await Promise.all([client.uploadVideo(provisioned.uploadUrl, local.result.videoPath), client.uploadDiagnostics(recordingId, local.result.diagnosticsPath, local.result.diagnostics)]);
|
|
1010
1039
|
const remote = commandOptions.wait === false ? null : await client.waitUntilPlayable(recordingId);
|
|
1011
1040
|
if (remote) process.stderr.write("\n");
|
|
1012
|
-
const result = {
|
|
1041
|
+
const result = {
|
|
1042
|
+
schemaVersion: 1,
|
|
1043
|
+
recordingId,
|
|
1044
|
+
status: remote ? "ready" : "processing",
|
|
1045
|
+
shareUrl: remote?.shareUrl ?? null,
|
|
1046
|
+
durationSeconds: local.result.durationSeconds,
|
|
1047
|
+
stoppedReason: local.result.stoppedReason,
|
|
1048
|
+
diagnostics: local.result.diagnostics,
|
|
1049
|
+
...recordingFeedbackFields(recordingId, stopped?.feedbackRequested ?? false)
|
|
1050
|
+
};
|
|
1013
1051
|
emit(result, options.pretty);
|
|
1014
1052
|
if (remote) await rm2(dirname2(local.result.videoPath), { recursive: true, force: true });
|
|
1015
1053
|
});
|
|
1054
|
+
var feedback = program.command("feedback").description("Submit a short Rill product review for a recorded run.");
|
|
1055
|
+
feedback.command("submit").argument("<recording-id>").requiredOption("--outcome <outcome>", "succeeded, failed, or abandoned").option("--helped <text>", "What helped during the run", "").option("--friction <text>", "What created friction during the run", "").option("--improvement <text>", "The single most useful Rill improvement", "").action(async (recordingId, commandOptions) => {
|
|
1056
|
+
if (!["succeeded", "failed", "abandoned"].includes(commandOptions.outcome)) throw new Error("validation_failed: Feedback outcome must be succeeded, failed, or abandoned.");
|
|
1057
|
+
if (![commandOptions.helped, commandOptions.friction, commandOptions.improvement].some((value) => value.trim())) throw new Error("validation_failed: Include at least one short feedback answer.");
|
|
1058
|
+
const options = program.opts();
|
|
1059
|
+
const token = await loadCredential(options.apiUrl);
|
|
1060
|
+
const client = new ControlPlaneClient(options.apiUrl, token);
|
|
1061
|
+
await client.submitRecordingFeedback(recordingId, {
|
|
1062
|
+
outcome: commandOptions.outcome,
|
|
1063
|
+
whatHelped: commandOptions.helped,
|
|
1064
|
+
friction: commandOptions.friction,
|
|
1065
|
+
improvement: commandOptions.improvement
|
|
1066
|
+
});
|
|
1067
|
+
emit(feedbackSubmissionReceipt(recordingId), options.pretty);
|
|
1068
|
+
});
|
|
1016
1069
|
record.command("status").argument("<recording-id>").action(async (recordingId) => {
|
|
1017
1070
|
const options = program.opts();
|
|
1018
1071
|
const token = await loadCredential(options.apiUrl);
|