@clipy/cli 0.17.0 → 0.19.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/LICENSE-APACHE +202 -0
- package/README.md +265 -12
- package/dist/chromeForClipy.js +1 -1
- package/dist/context/importCmd.js +4 -1
- package/dist/context/readCmd.js +33 -21
- package/dist/context/ytdlp.js +108 -28
- package/dist/context-core/arec.js +66 -6
- package/dist/index.js +1180 -98
- package/dist/library.js +7 -3
- package/dist/local/arec.js +186 -0
- package/dist/local/commands.js +1103 -0
- package/dist/local/deps.js +42 -0
- package/dist/local/media.js +154 -0
- package/dist/local/pipeline.js +530 -0
- package/dist/local/ports.js +1 -0
- package/dist/local/speechEngine.js +260 -0
- package/dist/local/transcriptFile.js +54 -0
- package/dist/local/vendor/capture/capture.js +442 -0
- package/dist/local/vendor/capture/check.js +103 -0
- package/dist/local/vendor/capture/children.js +69 -0
- package/dist/local/vendor/capture/ffmpegArgs.js +108 -0
- package/dist/local/vendor/capture/index.js +36 -0
- package/dist/local/vendor/capture/proc.js +71 -0
- package/dist/local/vendor/capture/scripts.js +107 -0
- package/dist/local/vendor/capture/sidecar.js +199 -0
- package/dist/local/vendor/capture/sources.js +272 -0
- package/dist/local/vendor/capture/types.js +1 -0
- package/dist/local/vendor/capture/virtualDisplay.js +170 -0
- package/dist/local/vendor/capture/xauth.js +68 -0
- package/dist/local/vendor/config/errors.js +12 -0
- package/dist/local/vendor/config/index.js +241 -0
- package/dist/local/vendor/config/paths.js +37 -0
- package/dist/local/vendor/config/presets.js +61 -0
- package/dist/local/vendor/config/schema.js +66 -0
- package/dist/local/vendor/moments/generated/drawStrokes.js +127 -0
- package/dist/local/vendor/moments/generated/keyMomentsCursorContext.js +568 -0
- package/dist/local/vendor/moments/generated/keyMomentsFusion.js +406 -0
- package/dist/local/vendor/moments/generated/localMomentPlan.js +178 -0
- package/dist/local/vendor/moments/generated/types.js +1 -0
- package/dist/local/vendor/moments/index.js +147 -0
- package/dist/local/vendor/moments/llm.js +158 -0
- package/dist/local/vendor/transcribe/audio.js +251 -0
- package/dist/local/vendor/transcribe/chunking.js +250 -0
- package/dist/local/vendor/transcribe/index.js +89 -0
- package/dist/local/vendor/transcribe/local.js +221 -0
- package/dist/local/vendor/transcribe/localWorker.js +79 -0
- package/dist/local/vendor/transcribe/models.js +369 -0
- package/dist/local/vendor/transcribe/providers/assemblyai.js +61 -0
- package/dist/local/vendor/transcribe/providers/common.js +105 -0
- package/dist/local/vendor/transcribe/providers/deepgram.js +59 -0
- package/dist/local/vendor/transcribe/providers/elevenlabs.js +43 -0
- package/dist/local/vendor/transcribe/providers/gemini.js +102 -0
- package/dist/local/vendor/transcribe/providers/http.js +214 -0
- package/dist/local/vendor/transcribe/providers/openai.js +48 -0
- package/dist/local/vendor/transcribe/tar.js +53 -0
- package/dist/local/vendor/transcribe/types.js +1 -0
- package/dist/macBridge.js +78 -9
- package/dist/recheck.js +934 -0
- package/dist/recheckCmd.js +279 -0
- package/dist/skill.js +94 -3
- package/package.json +22 -11
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `clipy recheck` command: argument handling, Chrome for Clipy, upload and
|
|
3
|
+
* output around the pure pieces in recheck.ts. index.ts only parses flags and
|
|
4
|
+
* hands over the helpers it owns (Playwright loading and the proof upload).
|
|
5
|
+
*/
|
|
6
|
+
import { mkdirSync, mkdtempSync } from "node:fs";
|
|
7
|
+
import { homedir, tmpdir } from "node:os";
|
|
8
|
+
import { join, resolve } from "node:path";
|
|
9
|
+
import { DEFAULT_CDP_PORT, newBackgroundPage, startChrome, } from "./chromeForClipy.js";
|
|
10
|
+
import { failure, request, recordingPath } from "./library.js";
|
|
11
|
+
import { buildRecheckPlan, createPageDriver, fmtClock, frameCaption, limitationsFor, readOriginalRun, RecheckInputError, RECHECK_MAX_STEPS, RECHECK_REPORT_VERSION, renderMarkdown, routeOf, runRecheck, summarize, writeReportFiles, } from "./recheck.js";
|
|
12
|
+
const USAGE = "usage: clipy recheck <id|url> --url <start-url> [--out <dir>] [--plan] [--no-upload] [--settle-ms N] [--nav-timeout-ms N] [--max-steps N] [--fail-on-divergence] [--allow-destructive] [--port N] [--json]";
|
|
13
|
+
function stamp() {
|
|
14
|
+
return new Date().toISOString().replace(/[:.]/g, "-");
|
|
15
|
+
}
|
|
16
|
+
export async function cmdRecheck(deps, id, opts) {
|
|
17
|
+
const usage = (message) => failure(deps, "usage_error", message, "Fix the arguments; `clipy guide --json` lists every command's flags.", 2);
|
|
18
|
+
if (!id)
|
|
19
|
+
usage(USAGE);
|
|
20
|
+
if (!Number.isInteger(opts.maxSteps) || opts.maxSteps < 1 || opts.maxSteps > RECHECK_MAX_STEPS) {
|
|
21
|
+
usage(`--max-steps must be an integer from 1 to ${RECHECK_MAX_STEPS}`);
|
|
22
|
+
}
|
|
23
|
+
if (!Number.isFinite(opts.settleMs) || opts.settleMs < 0 || opts.settleMs > 30_000)
|
|
24
|
+
usage("--settle-ms must be 0-30000");
|
|
25
|
+
if (!Number.isFinite(opts.navigationTimeoutMs) || opts.navigationTimeoutMs < 0 || opts.navigationTimeoutMs > 60_000) {
|
|
26
|
+
usage("--nav-timeout-ms must be 0-60000");
|
|
27
|
+
}
|
|
28
|
+
if (opts.port !== undefined && (!Number.isInteger(opts.port) || opts.port < 1 || opts.port > 65535)) {
|
|
29
|
+
usage("--port must be an integer from 1 to 65535");
|
|
30
|
+
}
|
|
31
|
+
let startUrl = null;
|
|
32
|
+
if (opts.startUrl) {
|
|
33
|
+
try {
|
|
34
|
+
const u = new URL(opts.startUrl);
|
|
35
|
+
if (u.protocol !== "http:" && u.protocol !== "https:")
|
|
36
|
+
throw new Error("scheme");
|
|
37
|
+
startUrl = u.href;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
usage("--url must be an http(s) URL");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else if (!opts.planOnly) {
|
|
44
|
+
usage(`--url <start-url> is required (the page the workflow starts on)\n${USAGE}`);
|
|
45
|
+
}
|
|
46
|
+
const log = (m) => {
|
|
47
|
+
if (!deps.json)
|
|
48
|
+
process.stderr.write(`${deps.color.dim(m)}\n`);
|
|
49
|
+
};
|
|
50
|
+
const { pid } = recordingPath(deps, id);
|
|
51
|
+
let original;
|
|
52
|
+
try {
|
|
53
|
+
original = await readOriginalRun((path) => request(deps, "GET", path), pid);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
if (error instanceof RecheckInputError)
|
|
57
|
+
failure(deps, error.code, error.message, error.remediation);
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
const planOpts = { allowIrreversible: opts.allowDestructive };
|
|
61
|
+
const plan = buildRecheckPlan(original, opts.maxSteps, planOpts);
|
|
62
|
+
const contextUrl = original.webUrl ? `${original.webUrl}.arec` : null;
|
|
63
|
+
if (opts.planOnly) {
|
|
64
|
+
const result = {
|
|
65
|
+
ok: true,
|
|
66
|
+
type: "clipy.recheck_plan",
|
|
67
|
+
version: RECHECK_REPORT_VERSION,
|
|
68
|
+
original: {
|
|
69
|
+
id: original.id,
|
|
70
|
+
name: original.name,
|
|
71
|
+
webUrl: original.webUrl,
|
|
72
|
+
contextUrl,
|
|
73
|
+
expectedResult: original.expectedResult,
|
|
74
|
+
timelineStatus: original.timelineStatus,
|
|
75
|
+
urlPrivacy: original.urlPrivacy,
|
|
76
|
+
eventsRead: original.events.length,
|
|
77
|
+
eventsTruncated: original.eventsTruncated,
|
|
78
|
+
},
|
|
79
|
+
steps: plan.steps,
|
|
80
|
+
truncatedSteps: plan.truncatedSteps,
|
|
81
|
+
limitations: limitationsFor(original, planOpts),
|
|
82
|
+
warnings: [],
|
|
83
|
+
};
|
|
84
|
+
if (deps.json)
|
|
85
|
+
return deps.printJson(result);
|
|
86
|
+
process.stdout.write(`${deps.color.bold(`Re-check plan for ${original.name || original.id}`)} (${plan.steps.length} steps)\n`);
|
|
87
|
+
for (const step of plan.steps) {
|
|
88
|
+
const what = step.kind === "click"
|
|
89
|
+
? `click ${step.role ?? "control"}${step.label ? ` "${step.label}"` : ""}`
|
|
90
|
+
: step.kind === "start" || step.kind === "navigate"
|
|
91
|
+
? `${step.kind} ${step.route}`
|
|
92
|
+
: `${step.kind}${step.direction ? ` ${step.direction}` : ""}`;
|
|
93
|
+
process.stdout.write(`${deps.color.cyan(String(step.index).padStart(2))} ${fmtClock(step.tMs)} ${what}` +
|
|
94
|
+
(step.unmappable ? deps.color.yellow(` (could not map: ${step.unmappable})`) : "") +
|
|
95
|
+
"\n");
|
|
96
|
+
}
|
|
97
|
+
if (original.expectedResult)
|
|
98
|
+
process.stdout.write(`\nExpected result: ${original.expectedResult}\n`);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
// The default folder is private (mkdtemp is 0700): the frames are
|
|
102
|
+
// screenshots of a signed-in app, and /tmp is shared on Linux. The id comes
|
|
103
|
+
// from the server, so it is reduced to a safe name before it touches a path.
|
|
104
|
+
let outDir;
|
|
105
|
+
if (opts.outDir) {
|
|
106
|
+
outDir = resolve(opts.outDir);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
const safeId = original.id.replace(/[^A-Za-z0-9_-]/g, "").slice(0, 40) || "recording";
|
|
110
|
+
outDir = mkdtempSync(join(tmpdir(), `clipy-recheck-${safeId}-${stamp()}-`));
|
|
111
|
+
}
|
|
112
|
+
const framesDir = join(outDir, "frames");
|
|
113
|
+
mkdirSync(framesDir, { recursive: true, mode: 0o700 });
|
|
114
|
+
const chromium = await deps.loadChromium();
|
|
115
|
+
const started = await startChrome(homedir(), process.env, process.platform, opts.port ?? DEFAULT_CDP_PORT);
|
|
116
|
+
if (!started.ok) {
|
|
117
|
+
failure(deps, "chrome_unavailable", `Chrome for Clipy is not available: ${started.error}`, "Run `clipy chrome status --json` and `clipy chrome start`; sign in to the app there once if the workflow needs a login, then re-run.");
|
|
118
|
+
}
|
|
119
|
+
log(`Chrome for Clipy ready on port ${started.state.port}`);
|
|
120
|
+
let browser = null;
|
|
121
|
+
let page = null;
|
|
122
|
+
// Tabs the replayed site opened (target=_blank, window.open): closed with
|
|
123
|
+
// the re-check's own window so nothing is left behind in Chrome for Clipy.
|
|
124
|
+
const popups = [];
|
|
125
|
+
let run;
|
|
126
|
+
let runError = null;
|
|
127
|
+
const aborter = new AbortController();
|
|
128
|
+
let cleaned = null;
|
|
129
|
+
const cleanup = () => {
|
|
130
|
+
cleaned ??= (async () => {
|
|
131
|
+
for (const p of [...popups, page])
|
|
132
|
+
await p?.close().catch(() => { });
|
|
133
|
+
// Disconnects; Chrome for Clipy keeps running.
|
|
134
|
+
await browser?.close().catch(() => { });
|
|
135
|
+
})();
|
|
136
|
+
return cleaned;
|
|
137
|
+
};
|
|
138
|
+
// Ctrl-C would otherwise end the process with the window still open on the
|
|
139
|
+
// replayed site: stop taking steps, close it, then exit as interrupted.
|
|
140
|
+
const onSignal = (signal) => {
|
|
141
|
+
aborter.abort();
|
|
142
|
+
void cleanup().finally(() => process.exit(signal === "SIGINT" ? 130 : 143));
|
|
143
|
+
};
|
|
144
|
+
process.once("SIGINT", onSignal);
|
|
145
|
+
process.once("SIGTERM", onSignal);
|
|
146
|
+
try {
|
|
147
|
+
browser = await chromium.connectOverCDP(`http://127.0.0.1:${started.state.port}`);
|
|
148
|
+
const context = browser.contexts()[0];
|
|
149
|
+
if (!context)
|
|
150
|
+
throw new Error("Chrome for Clipy has no browser context to attach to");
|
|
151
|
+
// Its own background window: the re-check never takes over a tab the user
|
|
152
|
+
// or another agent is using, and never brings Chrome to the front.
|
|
153
|
+
page = await newBackgroundPage(browser, context, true);
|
|
154
|
+
page.on?.("popup", (p) => {
|
|
155
|
+
popups.push(p);
|
|
156
|
+
});
|
|
157
|
+
const driver = createPageDriver(page, { settleMs: opts.settleMs });
|
|
158
|
+
run = await runRecheck(plan, driver, {
|
|
159
|
+
startUrl: startUrl,
|
|
160
|
+
framesDir,
|
|
161
|
+
navigationTimeoutMs: opts.navigationTimeoutMs,
|
|
162
|
+
urlPrivacy: original.urlPrivacy,
|
|
163
|
+
allowIrreversible: opts.allowDestructive,
|
|
164
|
+
signal: aborter.signal,
|
|
165
|
+
log,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
runError = error;
|
|
170
|
+
}
|
|
171
|
+
finally {
|
|
172
|
+
process.off("SIGINT", onSignal);
|
|
173
|
+
process.off("SIGTERM", onSignal);
|
|
174
|
+
// Here, before any failure(): failure() exits the process, so a finally
|
|
175
|
+
// around it would never run and the window would stay open.
|
|
176
|
+
await cleanup();
|
|
177
|
+
}
|
|
178
|
+
// Interrupted: the signal handler closes the window and owns the exit.
|
|
179
|
+
if (aborter.signal.aborted)
|
|
180
|
+
return;
|
|
181
|
+
if (runError || !run) {
|
|
182
|
+
if (runError instanceof RecheckInputError)
|
|
183
|
+
failure(deps, runError.code, runError.message, runError.remediation);
|
|
184
|
+
failure(deps, "chrome_unavailable", `the re-check could not drive Chrome for Clipy: ${runError?.message ?? "no result"}`, "Run `clipy chrome status --json`; if Chrome for Clipy is running, re-run once.");
|
|
185
|
+
}
|
|
186
|
+
const summary = summarize(run.steps);
|
|
187
|
+
const report = {
|
|
188
|
+
ok: true,
|
|
189
|
+
type: "clipy.recheck_report",
|
|
190
|
+
version: RECHECK_REPORT_VERSION,
|
|
191
|
+
original: {
|
|
192
|
+
id: original.id,
|
|
193
|
+
name: original.name,
|
|
194
|
+
webUrl: original.webUrl,
|
|
195
|
+
contextUrl,
|
|
196
|
+
sourcePlatform: original.sourcePlatform,
|
|
197
|
+
expectedResult: original.expectedResult,
|
|
198
|
+
timelineStatus: original.timelineStatus,
|
|
199
|
+
urlPrivacy: original.urlPrivacy,
|
|
200
|
+
eventsRead: original.events.length,
|
|
201
|
+
eventsTruncated: original.eventsTruncated,
|
|
202
|
+
},
|
|
203
|
+
start: { route: startUrl ? routeOf(startUrl) : null, originMapping: run.originMapping },
|
|
204
|
+
run: {
|
|
205
|
+
browser: "chrome-for-clipy",
|
|
206
|
+
startedAt: run.startedAt,
|
|
207
|
+
finishedAt: run.finishedAt,
|
|
208
|
+
framesDir,
|
|
209
|
+
truncatedSteps: plan.truncatedSteps,
|
|
210
|
+
},
|
|
211
|
+
recording: null,
|
|
212
|
+
summary,
|
|
213
|
+
steps: run.steps,
|
|
214
|
+
limitations: limitationsFor(original, planOpts),
|
|
215
|
+
warnings: [],
|
|
216
|
+
};
|
|
217
|
+
// Written before the upload, so a failed upload never costs the report.
|
|
218
|
+
writeReportFiles(outDir, report);
|
|
219
|
+
if (opts.upload) {
|
|
220
|
+
const frames = run.steps
|
|
221
|
+
.filter((s) => s.observed.frame)
|
|
222
|
+
.map((s) => ({ path: s.observed.frame, caption: frameCaption(s, run.steps.length) }));
|
|
223
|
+
if (frames.length === 0) {
|
|
224
|
+
report.warnings.push({
|
|
225
|
+
code: "recheck_upload_failed",
|
|
226
|
+
error: "no step frame was captured, so there is nothing to upload",
|
|
227
|
+
remediation: "Read the report; the per-step results do not depend on the frames.",
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
try {
|
|
232
|
+
const uploaded = await deps.uploadFrames(frames, {
|
|
233
|
+
name: `Re-check: ${original.name || original.id}`,
|
|
234
|
+
description: `Re-check of ${original.webUrl ?? original.id} on ${report.start.route ?? "the start URL"}: ` +
|
|
235
|
+
`${summary.matched} matched, ${summary.controlNotFound} control not found, ${summary.differentScreen} different screen, ` +
|
|
236
|
+
`${summary.error} error, ${summary.unmapped} could not map.`,
|
|
237
|
+
log,
|
|
238
|
+
});
|
|
239
|
+
report.recording = uploaded;
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
// The upload became a recording whose completion was not confirmed:
|
|
243
|
+
// uploading the frames again would make a duplicate.
|
|
244
|
+
const stranded = error.publicId;
|
|
245
|
+
if (stranded) {
|
|
246
|
+
report.recording = {
|
|
247
|
+
id: stranded,
|
|
248
|
+
shareUrl: `${deps.apiUrl}/video/${stranded}`,
|
|
249
|
+
contextUrl: `${deps.apiUrl}/video/${stranded}.arec`,
|
|
250
|
+
};
|
|
251
|
+
report.warnings.push({
|
|
252
|
+
code: "upload_unconfirmed",
|
|
253
|
+
error: `the step frames were uploaded as ${stranded}, but the server did not confirm its completion: ${error.message}`,
|
|
254
|
+
remediation: `Do not upload again; the recording exists. Check it with: clipy show ${stranded}`,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
report.warnings.push({
|
|
259
|
+
code: "recheck_upload_failed",
|
|
260
|
+
error: `the step frames could not be uploaded: ${error.message}`,
|
|
261
|
+
remediation: `The report and frames are saved in ${outDir}. Upload them with \`clipy proof --frame\` if a share link is needed; do not re-run the whole re-check for it.`,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
writeReportFiles(outDir, report);
|
|
267
|
+
}
|
|
268
|
+
if (deps.json) {
|
|
269
|
+
deps.printJson({ ...report, files: { json: join(outDir, "report.json"), markdown: join(outDir, "report.md") } });
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
process.stdout.write(renderMarkdown(report));
|
|
273
|
+
process.stdout.write(`${deps.color.dim(`report: ${join(outDir, "report.json")}`)}\n`);
|
|
274
|
+
}
|
|
275
|
+
// exitCode, not exit(): a large report written to a pipe must be flushed
|
|
276
|
+
// before the process ends (pipe writes are asynchronous on macOS).
|
|
277
|
+
if (opts.failOnDivergence && summary.verdict !== "matches")
|
|
278
|
+
process.exitCode = 4;
|
|
279
|
+
}
|
package/dist/skill.js
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export const CLIPY_SKILL_MD = `---
|
|
12
12
|
name: clipy
|
|
13
|
-
description: Read and create Clipy screen recordings, turn screenshots or tool-native video into proof, and turn any video into agent-readable context. Use when the user shares a clipy.online/video/<id> URL (watch, summarize, or act on a recording, bug report, or walkthrough), shares a YouTube URL, a Loom share link, or a local video file as context/reference for a task ("implement what this video shows", "give me the context of this video" — import it with clipy context import), OR asks you to verify your own work and share proof through Clipy.
|
|
13
|
+
description: Read and create Clipy screen recordings, turn screenshots or tool-native video into proof, and turn any video into agent-readable context. Use when the user shares a clipy.online/video/<id> URL (watch, summarize, or act on a recording, bug report, or walkthrough), shares a YouTube URL, a Loom share link, or a local video file as context/reference for a task ("implement what this video shows", "give me the context of this video" — import it with clipy context import), OR asks you to verify your own work and share proof through Clipy, OR asks whether a recorded workflow still works on today's UI (re-check it with clipy recheck).
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
# Clipy — recordings you can read AND make
|
|
17
17
|
|
|
18
|
-
Written for @clipy/cli + @clipy/mcp 0.
|
|
18
|
+
Written for @clipy/cli + @clipy/mcp 0.19.0 (the two versions move in lockstep). If
|
|
19
19
|
\`clipy --version\` reports older, upgrade first: \`npm i -g @clipy/cli@latest\`.
|
|
20
20
|
|
|
21
21
|
Clipy (clipy.online) is the screen recorder built to be agent-readable. Every
|
|
@@ -27,7 +27,8 @@ WebM/MP4, capture a running web app headlessly, or capture the real Mac screen
|
|
|
27
27
|
through the running Clipy app, then hand back a watchable link.
|
|
28
28
|
|
|
29
29
|
Commands below use \`clipy\`. If it is not on PATH, prefix with \`npx @clipy/cli\`
|
|
30
|
-
(identical). Exit codes: \`0\` ok · \`1\` error · \`2\` usage · \`3\` artifact not ready
|
|
30
|
+
(identical). Exit codes: \`0\` ok · \`1\` error · \`2\` usage · \`3\` artifact not ready ·
|
|
31
|
+
\`4\` \`clipy recheck --fail-on-divergence\` did not match (diverged or incomplete).
|
|
31
32
|
|
|
32
33
|
The canonical live operating contract is \`https://clipy.online/agents.md\`. Fetch
|
|
33
34
|
it when network access is available. It explains which surface to choose, auth and
|
|
@@ -422,6 +423,51 @@ data, or unrelated windows. After upload, read the returned result, then run
|
|
|
422
423
|
\`clipy context <id>\` and confirm the narration matches the frames/video before
|
|
423
424
|
sharing both URLs.
|
|
424
425
|
|
|
426
|
+
## Re-check a recorded workflow against today's UI
|
|
427
|
+
|
|
428
|
+
When the user asks "does this recorded flow still work?", "re-check this
|
|
429
|
+
recording", or an agent is about to replay recorded steps, re-check it first.
|
|
430
|
+
Recorded workflows fail silently when the app changes; this tells a broken flow
|
|
431
|
+
from a redesign before anyone clicks the wrong control.
|
|
432
|
+
|
|
433
|
+
clipy recheck <id|url> --plan --json # the steps, no browser
|
|
434
|
+
clipy recheck <id|url> --url <start-url> --json # replay and report
|
|
435
|
+
|
|
436
|
+
It reads the recording's interaction timeline (clicks with element labels,
|
|
437
|
+
navigations, scrolls, typing), key moments and transcript, drives Chrome for
|
|
438
|
+
Clipy (its own background window, signed in once with \`clipy chrome start\`)
|
|
439
|
+
from \`--url\`, captures a frame per step and uploads them as a proof
|
|
440
|
+
recording (\`--no-upload\` keeps it local). \`--url\` may be another host than
|
|
441
|
+
the original (staging, localhost); recorded paths are then checked on that host, and nothing is clicked on any other host (a redirect back to production is a different screen).
|
|
442
|
+
|
|
443
|
+
Each step comes back as one of:
|
|
444
|
+
|
|
445
|
+
- \`matched\`: the page was on the recorded route and the labelled control was
|
|
446
|
+
found and clicked.
|
|
447
|
+
- \`replayed\`: a scroll, replayed by direction (the distance is not recorded).
|
|
448
|
+
- \`control_not_found\`: no visible control has the recorded label;
|
|
449
|
+
\`observed.nearbyControls\` names what is there now (often the rename).
|
|
450
|
+
- \`different_screen\`: the page is on another route, or the control is covered
|
|
451
|
+
(a dialog, a banner). Nothing is clicked.
|
|
452
|
+
- \`error\`: the step threw; the reason says what.
|
|
453
|
+
- \`unmapped\` ("could not map step"): typing (values are never captured),
|
|
454
|
+
unlabelled or right clicks, drags, a label shared by several controls with
|
|
455
|
+
no position to choose, or a control that reads as irreversible (delete, pay,
|
|
456
|
+
send, submit and similar). Never report an unmapped step as passing.
|
|
457
|
+
|
|
458
|
+
The replay clicks for real in a signed-in browser, so it never clicks an
|
|
459
|
+
irreversible-looking control on its own. Pass \`--allow-destructive\` only when
|
|
460
|
+
the user asked for those steps to be replayed and the site is one where that is
|
|
461
|
+
safe (a test account, staging). Run \`--plan\` first to see which steps those are.
|
|
462
|
+
|
|
463
|
+
Read \`summary.verdict\` (\`matches\` | \`diverged\` | \`incomplete\`) and
|
|
464
|
+
\`summary.firstDivergence\`. When \`original.expectedResult\` is set, the user
|
|
465
|
+
wrote down what should have happened: compare it with the last step's frame
|
|
466
|
+
yourself, the re-check does not judge it. Return the re-check's \`shareUrl\`
|
|
467
|
+
and \`contextUrl\`, the first diverging step, and its reason. Recordings with
|
|
468
|
+
no click or navigation data (a plain web-recorder take) fail with
|
|
469
|
+
\`no_interactions\`; there is nothing to replay.
|
|
470
|
+
|
|
425
471
|
## Making a recording — headless web app
|
|
426
472
|
|
|
427
473
|
One-shot capture of a running app (notes become the transcript, see below):
|
|
@@ -819,6 +865,51 @@ Either way the warning means the same thing: WE DO NOT KNOW that the mic is off.
|
|
|
819
865
|
Believe it, tell the user, and update the app — do not report a recording as
|
|
820
866
|
mic-free on the strength of the flag you passed.
|
|
821
867
|
|
|
868
|
+
## Local mode: keep the recording on this machine (--local)
|
|
869
|
+
|
|
870
|
+
When the user wants recordings kept on their machine, or has no Clipy account,
|
|
871
|
+
add \`--local\`. Nothing is uploaded and no login is needed; the CLI builds an AREC
|
|
872
|
+
folder (video, transcript, key moments with a screenshot each, recording.arec).
|
|
873
|
+
|
|
874
|
+
\`\`\`bash
|
|
875
|
+
clipy record --local --max 60 --json # the screen; always pass --max
|
|
876
|
+
clipy record --local --url http://localhost:3000 --for 20 --note "8: clicked Save"
|
|
877
|
+
clipy session start --url http://localhost:3000 --local # then mark, then: clipy session stop
|
|
878
|
+
clipy proof --frame before.png --frame after.png --caption "Before: ..." --caption "After: ..." --local
|
|
879
|
+
\`\`\`
|
|
880
|
+
|
|
881
|
+
On macOS, \`--source screen\` (or \`mac-screen\`) with \`--local\` records through
|
|
882
|
+
Clipy Local, the open-source local edition of the Mac app, never the official
|
|
883
|
+
Clipy app. Clipy Local must be running; if it is not, the error says so, and
|
|
884
|
+
\`clipy record --local --max 60\` (the CLI's own recorder) still works. Marks and
|
|
885
|
+
chapters become narration in its AREC.
|
|
886
|
+
|
|
887
|
+
\`\`\`bash
|
|
888
|
+
clipy session start --local --source screen --window "Chrome" --max 300
|
|
889
|
+
clipy mark "Clicked Save; the toast says Saved"
|
|
890
|
+
clipy session stop # waits for Clipy Local to process the take; prints the recording.arec path
|
|
891
|
+
\`\`\`
|
|
892
|
+
|
|
893
|
+
- The last stdout line is the absolute path of \`recording.arec\` (\`arec\` in the
|
|
894
|
+
\`--json\` object). Give the user that path and read it yourself; frames and the
|
|
895
|
+
video sit next to it.
|
|
896
|
+
- Never upload a local take unless the user asks. Do not run \`clipy upload\` on
|
|
897
|
+
it or start the session without \`--local\`. \`session stop --local\` refuses a
|
|
898
|
+
session that would upload.
|
|
899
|
+
- Pass \`--max\` (or \`--for\`) when you record: without it the take only stops on
|
|
900
|
+
Enter, a signal, or when stdin closes.
|
|
901
|
+
- On-device transcription needs a speech engine (about 35 MB from npm) that is
|
|
902
|
+
not installed with the CLI. A take that needs it and finds it missing stops
|
|
903
|
+
before recording with code \`speech_engine_required\`. Ask the user, then run
|
|
904
|
+
\`clipy speech install\` (or add \`--yes\` to the take) and re-run.
|
|
905
|
+
- \`--out <dir>\` must be new or empty (\`--force\` replaces an earlier take). If
|
|
906
|
+
processing fails, the error says where the capture was kept; nothing is lost.
|
|
907
|
+
- With no provider configured, nothing leaves the machine. If the user set a model
|
|
908
|
+
provider or a transcription key (\`clipy local status\` shows which), the
|
|
909
|
+
transcript and sampled interactions or the audio go to that provider, never to
|
|
910
|
+
Clipy. Never put a key on the command line yourself: ask the user to set
|
|
911
|
+
\`CLIPY_MODEL_API_KEY\` or \`CLIPY_TRANSCRIBE_API_KEY\`.
|
|
912
|
+
|
|
822
913
|
## Rules for recording (follow strictly)
|
|
823
914
|
|
|
824
915
|
- Record ONLY when the user asked you to make a recording, or when a shareable
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipy/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Command-line interface for Clipy
|
|
5
|
-
"license": "MIT",
|
|
3
|
+
"version": "0.19.0",
|
|
4
|
+
"description": "Command-line interface for Clipy, the AI-native screen recorder: list, search, and read your screen recordings' transcripts, AI summaries, and key moments from the terminal.",
|
|
5
|
+
"license": "MIT AND Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
15
|
"assets",
|
|
16
|
-
"README.md"
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE-APACHE"
|
|
17
18
|
],
|
|
18
19
|
"engines": {
|
|
19
20
|
"node": ">=18.17"
|
|
@@ -25,15 +26,19 @@
|
|
|
25
26
|
"transcript",
|
|
26
27
|
"srt",
|
|
27
28
|
"loom-alternative",
|
|
28
|
-
"ai-agent"
|
|
29
|
+
"ai-agent",
|
|
30
|
+
"screen-recorder",
|
|
31
|
+
"claude-code",
|
|
32
|
+
"codex",
|
|
33
|
+
"cursor"
|
|
29
34
|
],
|
|
30
|
-
"homepage": "https://clipy.online",
|
|
35
|
+
"homepage": "https://clipy.online/docs/cli",
|
|
31
36
|
"repository": {
|
|
32
37
|
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/
|
|
38
|
+
"url": "git+https://github.com/clipy-recorder/clipy-cli.git"
|
|
34
39
|
},
|
|
35
40
|
"bugs": {
|
|
36
|
-
"url": "https://github.com/
|
|
41
|
+
"url": "https://github.com/clipy-recorder/clipy-cli/issues"
|
|
37
42
|
},
|
|
38
43
|
"scripts": {
|
|
39
44
|
"build": "tsc",
|
|
@@ -41,14 +46,20 @@
|
|
|
41
46
|
"start": "node dist/index.js",
|
|
42
47
|
"test:auth": "npm run build && node scripts/mock-auth-server.test.mjs && node scripts/doctor.test.mjs && node scripts/open-url.test.mjs",
|
|
43
48
|
"test:proof": "npm run build && node scripts/proof-frames.test.mjs",
|
|
49
|
+
"test:recheck": "npm run build && node scripts/recheck.test.mjs",
|
|
44
50
|
"test:setup": "npm run build && node scripts/setup.test.mjs && node scripts/chrome-for-clipy.test.mjs && node scripts/extension-abort.test.mjs && node scripts/capture-title.test.mjs && node scripts/cdp-client.test.mjs",
|
|
45
51
|
"test:memory": "npm run build && node scripts/memory-search.test.mjs",
|
|
46
52
|
"test:library": "npm run build && node scripts/library-commands.test.mjs",
|
|
47
53
|
"test:chrome-capture": "npm run build && node scripts/chrome-capture.test.mjs",
|
|
48
54
|
"test:session": "npm run build && node scripts/auth-guard.test.mjs && node scripts/session-control.test.mjs && node scripts/cdp-diagnostics.test.mjs && node scripts/linux-screen.test.mjs",
|
|
49
|
-
"test": "npm run test:auth && npm run test:session && node scripts/setup.test.mjs && node scripts/chrome-for-clipy.test.mjs && node scripts/extension-abort.test.mjs && node scripts/capture-title.test.mjs && node scripts/cdp-client.test.mjs && node scripts/transcript-replace.test.mjs && node scripts/library-commands.test.mjs && node scripts/proof-frames.test.mjs && node scripts/memory-search.test.mjs && node scripts/agent-readiness.test.mjs && node scripts/context-sync.test.mjs && node scripts/context-frames.test.mjs && node scripts/context-youtube-transcript.test.mjs && node scripts/context-youtube-url-lang.test.mjs && node scripts/context-loom-url.test.mjs && node scripts/context-loom-import.test.mjs && node scripts/context-retry.test.mjs && node scripts/context-json-envelope.test.mjs && node scripts/context-ytdlp-update.test.mjs",
|
|
50
|
-
"prebuild": "node scripts/sync-context-core.mjs",
|
|
51
|
-
"test:context": "npm run build && node scripts/agent-readiness.test.mjs && node scripts/context-sync.test.mjs && node scripts/context-frames.test.mjs && node scripts/context-youtube-transcript.test.mjs && node scripts/context-youtube-url-lang.test.mjs && node scripts/context-loom-url.test.mjs && node scripts/context-loom-import.test.mjs && node scripts/context-retry.test.mjs && node scripts/context-json-envelope.test.mjs && node scripts/context-ytdlp-update.test.mjs"
|
|
55
|
+
"test": "npm run test:auth && npm run test:session && node scripts/setup.test.mjs && node scripts/chrome-for-clipy.test.mjs && node scripts/extension-abort.test.mjs && node scripts/capture-title.test.mjs && node scripts/cdp-client.test.mjs && node scripts/transcript-replace.test.mjs && node scripts/library-commands.test.mjs && node scripts/proof-frames.test.mjs && node scripts/recheck.test.mjs && node scripts/memory-search.test.mjs && node scripts/agent-readiness.test.mjs && node scripts/context-sync.test.mjs && node scripts/context-frames.test.mjs && node scripts/context-youtube-transcript.test.mjs && node scripts/context-youtube-url-lang.test.mjs && node scripts/context-loom-url.test.mjs && node scripts/context-loom-import.test.mjs && node scripts/context-retry.test.mjs && node scripts/context-json-envelope.test.mjs && node scripts/context-ytdlp-update.test.mjs && node scripts/local-pipeline.test.mjs && node scripts/local-commands.test.mjs && node scripts/speech-engine.test.mjs && node scripts/local-cli.test.mjs",
|
|
56
|
+
"prebuild": "node scripts/sync-context-core.mjs && node scripts/sync-local.mjs",
|
|
57
|
+
"test:context": "npm run build && node scripts/agent-readiness.test.mjs && node scripts/context-sync.test.mjs && node scripts/context-frames.test.mjs && node scripts/context-youtube-transcript.test.mjs && node scripts/context-youtube-url-lang.test.mjs && node scripts/context-loom-url.test.mjs && node scripts/context-loom-import.test.mjs && node scripts/context-retry.test.mjs && node scripts/context-json-envelope.test.mjs && node scripts/context-ytdlp-update.test.mjs",
|
|
58
|
+
"test:local": "npm run build && node scripts/local-pipeline.test.mjs && node scripts/local-commands.test.mjs && node scripts/speech-engine.test.mjs && node scripts/local-cli.test.mjs"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"seek-bzip": "^2.0.0",
|
|
62
|
+
"zod": "^4.4.3"
|
|
52
63
|
},
|
|
53
64
|
"devDependencies": {
|
|
54
65
|
"@types/node": "^22.0.0",
|