@clipy/cli 0.5.0 → 0.8.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/dist/skill.js CHANGED
@@ -15,6 +15,9 @@ description: Read and create Clipy screen recordings. Use when the user shares a
15
15
 
16
16
  # Clipy — recordings you can read AND make
17
17
 
18
+ Written for @clipy/cli + @clipy/mcp 0.8.0 (the two versions move in lockstep). If
19
+ \`clipy --version\` reports older, upgrade first: \`npm i -g @clipy/cli@latest\`.
20
+
18
21
  Clipy (clipy.online) is the screen recorder built to be agent-readable. Every
19
22
  recording has a share link, an AI transcript + summary, key moments, and a
20
23
  machine-readable context document. With the CLI you can also CREATE recordings:
@@ -78,6 +81,29 @@ Notes are absolute (\`"12: text"\`) or pass-scoped (\`"pass2: text"\`,
78
81
  \`"pass2@5: text"\`). Pass-scoped notes anchor to a --viewports pass's REAL start,
79
82
  so they stay aligned when load time shifts the pass boundaries.
80
83
 
84
+ ## Recording a logged-in app (headless web capture)
85
+
86
+ The headless browser starts signed out. To record a page behind auth, seed the
87
+ session BEFORE the first navigation — otherwise the app's route guard runs before
88
+ your credentials exist and redirects to /login (seeding localStorage AFTER visiting
89
+ a guarded route loses that race). \`--storage-state\` and \`--init-script\` apply
90
+ BEFORE any page script structurally, which is what avoids the trap. All four flags
91
+ work on both \`record\` and \`session start\` (web only; rejected on --source mac-screen):
92
+
93
+ # reuse a saved Playwright login (cookies + per-origin localStorage)
94
+ clipy record --url https://app.example.com/dashboard --for 20 --storage-state ./auth.json
95
+
96
+ # or seed a token / cookie directly
97
+ clipy session start --url https://app.example.com/dashboard \\
98
+ --local-storage "authToken=eyJ…" --cookie "sid=abc; Domain=app.example.com; Secure"
99
+
100
+ - \`--storage-state <file>\` — a Playwright storageState JSON (log in once, save
101
+ \`context.storageState({ path })\`); passed straight to newContext. Never printed.
102
+ - \`--cookie "name=value[; Domain=d; Path=p; Secure; HttpOnly; SameSite=Lax]"\` —
103
+ repeatable; without a Domain it's url-scoped to the target.
104
+ - \`--local-storage "key=value"\` — repeatable; origin-guarded to the target.
105
+ - \`--init-script <file>\` — a JS file run before every page's own scripts.
106
+
81
107
  ## Session mode — you drive the app, Clipy records
82
108
 
83
109
  clipy session start --url http://localhost:3000 --title "Overflow fix"
@@ -104,6 +130,76 @@ Headless captures are silent, so your notes/marks BECOME the transcript (honestl
104
130
  labeled as agent narration, never passed off as speech). Narrate every meaningful
105
131
  step.
106
132
 
133
+ ### Assert what you claim (assertion marks)
134
+
135
+ A plain mark is an unverified claim — you can write \`clipy mark "the Redemptions
136
+ tab is active"\` whether it's true or not, and the transcript reads as fact either
137
+ way. Make marks EVIDENCE by attaching an assertion the recording daemon checks
138
+ against its live page:
139
+
140
+ clipy mark "opened redemptions" --assert-url "**/redemptions"
141
+ clipy mark "status is Active" --assert-selector ".status-badge" --assert-text "Active"
142
+
143
+ - \`--assert-selector <css>\` — the element must match (its trimmed text is recorded
144
+ as the observed value).
145
+ - \`--assert-text <substr>\` — that element's text must contain the substring (needs
146
+ --assert-selector).
147
+ - \`--assert-url <glob>\` — the page URL must match (\`**\` = anything, \`*\` = any
148
+ non-slash segment, no \`*\` = substring). Combine freely; all checks must pass.
149
+
150
+ A pass annotates the mark \`… [assert ✓ <observed>]\`; a fail annotates it
151
+ \`… [ASSERT ✗ expected …; observed …]\` — a wrong claim is preserved AS a failed
152
+ assertion, it can never read as fact. \`--fail-mode warn\` (default) records the ✗
153
+ and keeps going; \`--fail-mode abort\` DISCARDS the whole session (nothing uploaded,
154
+ non-zero exit) so you never ship a clip that asserted its way into a broken state.
155
+ If any assertions ran, a leading \`[verification] N assertion(s): P passed, F failed\`
156
+ note opens the transcript. Assertions need a WEB session (rejected on --source
157
+ mac-screen — there's no page to probe). Prefer asserting the specific claims a
158
+ reviewer cares about over narrating them unverified.
159
+
160
+ ### Before/after in one recording (clipy chapter)
161
+
162
+ \`clipy chapter "<label>"\` marks a section boundary, so one video carries a BEFORE
163
+ and an AFTER — the PR-review shape:
164
+
165
+ clipy session start --url http://localhost:3000/settings --title "Overflow fix"
166
+ clipy mark "sidebar overflows" --assert-selector ".sidebar.is-overflowing"
167
+ clipy chapter "AFTER — fix applied"
168
+ # (git switch fix-branch, restart the dev server, reload)
169
+ clipy mark "sidebar wraps" --assert-selector ".sidebar:not(.is-overflowing)"
170
+ clipy session stop
171
+
172
+ ### Crash-safe wrapping (clipy session run)
173
+
174
+ If your driver script crashes, a plain \`session start\` keeps recording dead air to
175
+ \`--max\` and uploads it. \`session run\` guarantees cleanup:
176
+
177
+ clipy session run --url http://localhost:3000 --expose-cdp -- node driver.js
178
+
179
+ It starts the session, runs everything after \`--\` with inherited stdio, then: exit
180
+ 0 → \`session stop\` (upload); any non-zero exit or signal → \`session abort\` (discard)
181
+ with the child's exit code propagated. The command runs with \`CLIPY_SESSION=1\` set
182
+ (and \`CLIPY_CDP_URL=<cdpHttpUrl>\` when --expose-cdp). All session-start flags apply
183
+ before the \`--\`.
184
+
185
+ ### Mark timing (backdating + in-page marks)
186
+
187
+ Each \`clipy mark\` is a process spawn (~100-300ms), so a mark can land slightly after
188
+ the state it describes. Backdate onto the recording clock:
189
+
190
+ clipy mark "toast appeared" --ago 2 # 2s before now
191
+ clipy mark "page loaded" --at 4 # absolute 4s on the recording clock
192
+
193
+ When you drive over --expose-cdp, emit marks IN-PAGE with zero spawn latency by
194
+ calling the bindings the daemon exposes:
195
+
196
+ await page.evaluate(() => window.__clipyMark("clicked Export"));
197
+ await page.evaluate(() => window.__clipyChapter("AFTER — fix applied"));
198
+
199
+ (While CDP is exposed the page's own scripts can call these too — same trust model as
200
+ --expose-cdp itself.) \`clipy playwright-path\` prints the node_modules dir to resolve
201
+ Playwright for your driver: \`NODE_PATH=$(clipy playwright-path) node driver.js\`.
202
+
107
203
  ## Record the real Mac screen — a window or a display
108
204
 
109
205
  Add \`--source mac-screen\` to \`record\` or \`session start\` to capture the REAL
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipy/cli",
3
- "version": "0.5.0",
3
+ "version": "0.8.0",
4
4
  "description": "Command-line interface for Clipy — list, search, and read your screen recordings' transcripts, AI summaries, and key moments from the terminal.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,7 +38,9 @@
38
38
  "build": "tsc",
39
39
  "prepublishOnly": "npm run build",
40
40
  "start": "node dist/index.js",
41
- "test:auth": "npm run build && node scripts/mock-auth-server.test.mjs && node scripts/doctor.test.mjs"
41
+ "test:auth": "npm run build && node scripts/mock-auth-server.test.mjs && node scripts/doctor.test.mjs",
42
+ "test:session": "npm run build && node scripts/auth-guard.test.mjs && node scripts/session-control.test.mjs",
43
+ "test": "npm run test:auth && npm run test:session"
42
44
  },
43
45
  "devDependencies": {
44
46
  "@types/node": "^22.0.0",