browserpaw 5.0.0 → 5.0.1
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/v5/cli.cjs +1207 -335
- package/dist/v5/extension/background.js +8649 -6972
- package/dist/v5/extension/browserpaw-build.json +52 -45
- package/dist/v5/extension/chunks/{popup-DjxqduQH.js → popup-BSqTH70w.js} +39 -6
- package/dist/v5/extension/content-scripts/agent-cursor.js +30 -14
- package/dist/v5/extension/inject-scripts/accessibility-tree-helper.js +377 -229
- package/dist/v5/extension/inject-scripts/keyboard-helper.js +12 -2
- package/dist/v5/extension/inject-scripts/network-helper.js +166 -1
- package/dist/v5/extension/inject-scripts/screenshot-helper.js +397 -356
- package/dist/v5/extension/inpage-engine.js +7070 -6933
- package/dist/v5/extension/manifest.json +1 -1
- package/dist/v5/extension/popup.html +1 -1
- package/dist/v5/host.cjs +445 -73
- package/dist/v5/recipes/bilibili-popular-videos.json +364 -0
- package/dist/v5/recipes/bilibili-video-detail.json +395 -0
- package/dist/v5/recipes/github-issue-thread.json +313 -0
- package/dist/v5/recipes/github-releases.json +86 -45
- package/dist/v5/recipes/github-repo-readme.json +306 -0
- package/dist/v5/recipes/github-repo-search.json +313 -0
- package/dist/v5/recipes/mdn-search.json +93 -48
- package/dist/v5/recipes/npm-compare.json +6 -4
- package/dist/v5/recipes/reddit-post-read.json +289 -0
- package/dist/v5/recipes/reddit-subreddit-posts.json +331 -0
- package/dist/v5/recipes/v2ex-node-topics.json +334 -0
- package/dist/v5/recipes/v2ex-topic-read.json +325 -0
- package/dist/v5/recipes/x-profile-posts.json +332 -0
- package/dist/v5/recipes/x-search-thread.json +13 -41
- package/dist/v5/recipes/x-visible-thread.json +40 -83
- package/dist/v5/recipes/youtube-search-videos.json +279 -0
- package/dist/v5/recipes/youtube-video-read.json +349 -0
- package/dist/v5/skill/browserpaw/SKILL.md +4 -4
- package/dist/v5/skill/browserpaw/assets/recipes/bilibili-popular-videos.json +364 -0
- package/dist/v5/skill/browserpaw/assets/recipes/bilibili-video-detail.json +395 -0
- package/dist/v5/skill/browserpaw/assets/recipes/github-issue-thread.json +313 -0
- package/dist/v5/skill/browserpaw/assets/recipes/github-releases.json +86 -45
- package/dist/v5/skill/browserpaw/assets/recipes/github-repo-readme.json +306 -0
- package/dist/v5/skill/browserpaw/assets/recipes/github-repo-search.json +313 -0
- package/dist/v5/skill/browserpaw/assets/recipes/mdn-search.json +93 -48
- package/dist/v5/skill/browserpaw/assets/recipes/npm-compare.json +6 -4
- package/dist/v5/skill/browserpaw/assets/recipes/reddit-post-read.json +289 -0
- package/dist/v5/skill/browserpaw/assets/recipes/reddit-subreddit-posts.json +331 -0
- package/dist/v5/skill/browserpaw/assets/recipes/v2ex-node-topics.json +334 -0
- package/dist/v5/skill/browserpaw/assets/recipes/v2ex-topic-read.json +325 -0
- package/dist/v5/skill/browserpaw/assets/recipes/x-profile-posts.json +332 -0
- package/dist/v5/skill/browserpaw/assets/recipes/x-search-thread.json +13 -41
- package/dist/v5/skill/browserpaw/assets/recipes/x-visible-thread.json +40 -83
- package/dist/v5/skill/browserpaw/assets/recipes/youtube-search-videos.json +279 -0
- package/dist/v5/skill/browserpaw/assets/recipes/youtube-video-read.json +349 -0
- package/dist/v5/skill/browserpaw/references/recipe-contract.md +4 -3
- package/package.json +1 -1
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "youtube-video-read",
|
|
3
|
+
"name": "YouTube video metadata and subtitles reader",
|
|
4
|
+
"description": "Read a YouTube video's metadata and optional caption transcript directly from the watch page's player data and same-origin timedtext endpoint.",
|
|
5
|
+
"source": {
|
|
6
|
+
"type": "builtin",
|
|
7
|
+
"urls": [
|
|
8
|
+
"https://www.youtube.com/watch?v=dQw4w9WgXcQ",
|
|
9
|
+
"https://www.youtube.com/oembed?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ&format=json"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"domains": [
|
|
13
|
+
"www.youtube.com",
|
|
14
|
+
"m.youtube.com",
|
|
15
|
+
"youtube.com",
|
|
16
|
+
"youtu.be"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"youtube",
|
|
20
|
+
"油管",
|
|
21
|
+
"video",
|
|
22
|
+
"subtitles",
|
|
23
|
+
"captions",
|
|
24
|
+
"transcript",
|
|
25
|
+
"视频",
|
|
26
|
+
"字幕",
|
|
27
|
+
"详情",
|
|
28
|
+
"油管视频",
|
|
29
|
+
"YouTube字幕",
|
|
30
|
+
"看视频信息"
|
|
31
|
+
],
|
|
32
|
+
"startUrl": "https://www.youtube.com/watch?v={{videoId}}",
|
|
33
|
+
"inputSchema": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"videoId": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"pattern": "^[A-Za-z0-9_-]{11}$"
|
|
39
|
+
},
|
|
40
|
+
"includeSubtitles": {
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"default": true
|
|
43
|
+
},
|
|
44
|
+
"lang": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"pattern": "^[A-Za-z0-9,_-]{1,64}$",
|
|
47
|
+
"default": "zh-Hans,zh,en"
|
|
48
|
+
},
|
|
49
|
+
"maxSubtitleChars": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"minimum": 500,
|
|
52
|
+
"maximum": 10000,
|
|
53
|
+
"default": 8000
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"required": [
|
|
57
|
+
"videoId"
|
|
58
|
+
],
|
|
59
|
+
"additionalProperties": false
|
|
60
|
+
},
|
|
61
|
+
"outputSchema": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"properties": {
|
|
64
|
+
"success": {
|
|
65
|
+
"const": true
|
|
66
|
+
},
|
|
67
|
+
"status": {
|
|
68
|
+
"const": "ok"
|
|
69
|
+
},
|
|
70
|
+
"video": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"properties": {
|
|
73
|
+
"videoId": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"pattern": "^[A-Za-z0-9_-]{11}$"
|
|
76
|
+
},
|
|
77
|
+
"title": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"minLength": 1
|
|
80
|
+
},
|
|
81
|
+
"url": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"pattern": "^https://www\\.youtube\\.com/watch\\?v=[A-Za-z0-9_-]{11}$"
|
|
84
|
+
},
|
|
85
|
+
"author": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"channelId": {
|
|
89
|
+
"type": "string"
|
|
90
|
+
},
|
|
91
|
+
"durationSeconds": {
|
|
92
|
+
"type": "integer",
|
|
93
|
+
"minimum": 0
|
|
94
|
+
},
|
|
95
|
+
"viewCount": {
|
|
96
|
+
"type": "integer",
|
|
97
|
+
"minimum": 0
|
|
98
|
+
},
|
|
99
|
+
"publishDate": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
},
|
|
102
|
+
"description": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"required": [
|
|
107
|
+
"videoId",
|
|
108
|
+
"title",
|
|
109
|
+
"url",
|
|
110
|
+
"author",
|
|
111
|
+
"channelId",
|
|
112
|
+
"durationSeconds",
|
|
113
|
+
"viewCount",
|
|
114
|
+
"publishDate",
|
|
115
|
+
"description"
|
|
116
|
+
],
|
|
117
|
+
"additionalProperties": false
|
|
118
|
+
},
|
|
119
|
+
"captionTracks": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"maxItems": 20,
|
|
122
|
+
"items": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"properties": {
|
|
125
|
+
"languageCode": {
|
|
126
|
+
"type": "string"
|
|
127
|
+
},
|
|
128
|
+
"name": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"kind": {
|
|
132
|
+
"type": "string"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"required": [
|
|
136
|
+
"languageCode",
|
|
137
|
+
"name",
|
|
138
|
+
"kind"
|
|
139
|
+
],
|
|
140
|
+
"additionalProperties": false
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"subtitle": {
|
|
144
|
+
"oneOf": [
|
|
145
|
+
{
|
|
146
|
+
"type": "null"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"type": "object",
|
|
150
|
+
"properties": {
|
|
151
|
+
"languageCode": {
|
|
152
|
+
"type": "string"
|
|
153
|
+
},
|
|
154
|
+
"kind": {
|
|
155
|
+
"type": "string"
|
|
156
|
+
},
|
|
157
|
+
"text": {
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
"truncated": {
|
|
161
|
+
"type": "boolean"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"required": [
|
|
165
|
+
"languageCode",
|
|
166
|
+
"kind",
|
|
167
|
+
"text",
|
|
168
|
+
"truncated"
|
|
169
|
+
],
|
|
170
|
+
"additionalProperties": false
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"sources": {
|
|
175
|
+
"type": "object",
|
|
176
|
+
"properties": {
|
|
177
|
+
"page": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"pattern": "^https://www\\.youtube\\.com/watch\\?v=[A-Za-z0-9_-]{11}$"
|
|
180
|
+
},
|
|
181
|
+
"subtitles": {
|
|
182
|
+
"oneOf": [
|
|
183
|
+
{
|
|
184
|
+
"type": "string",
|
|
185
|
+
"pattern": "^https://www\\.youtube\\.com/"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"type": "null"
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"required": [
|
|
194
|
+
"page",
|
|
195
|
+
"subtitles"
|
|
196
|
+
],
|
|
197
|
+
"additionalProperties": false
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"required": [
|
|
201
|
+
"success",
|
|
202
|
+
"status",
|
|
203
|
+
"video",
|
|
204
|
+
"captionTracks",
|
|
205
|
+
"subtitle",
|
|
206
|
+
"sources"
|
|
207
|
+
],
|
|
208
|
+
"additionalProperties": false
|
|
209
|
+
},
|
|
210
|
+
"steps": [
|
|
211
|
+
{
|
|
212
|
+
"tool": "chrome_javascript",
|
|
213
|
+
"args": {
|
|
214
|
+
"code": "const videoId = String(input.videoId || '').trim();\nconst includeSubtitles = input.includeSubtitles !== false;\nconst preferredLangs = String(input.lang || 'zh-Hans,zh,en').split(',').map(v => v.trim().toLowerCase()).filter(Boolean);\nconst maxSubtitleChars = Math.max(500, Math.min(Number(input.maxSubtitleChars) || 8000, 10000));\nconst pageUrl = 'https://www.youtube.com/watch?v=' + videoId;\nconst currentOrigin = typeof location !== 'undefined' && typeof location.origin === 'string' ? location.origin : '';\nconst currentHref = typeof location !== 'undefined' && typeof location.href === 'string' ? location.href : pageUrl;\nconst currentPath = typeof location !== 'undefined' && typeof location.pathname === 'string' ? location.pathname : '';\nif (/^https:\\/\\/consent\\.youtube\\.com$/i.test(currentOrigin)) {\n return { success: false, status: 'consent_required', videoId, message: 'YouTube consent wall requires user acceptance', source: currentHref };\n}\nif (!/^https:\\/\\/(?:www\\.|m\\.)?youtube\\.com$/i.test(currentOrigin)) {\n return { success: false, status: 'page_not_ready', videoId, message: 'YouTube page origin is not ready', source: pageUrl };\n}\nif (/^\\/sorry(?:\\/|$)/i.test(currentPath)) {\n return { success: false, status: 'bot_check', videoId, requiresLogin: true, message: 'YouTube requested bot verification', source: currentHref };\n}\nconst sleep = ms => new Promise(resolve => setTimeout(resolve, ms));\nconst getPlayerEl = id => {\n if (typeof document === 'undefined' || !document) return null;\n if (typeof document.getElementById === 'function') {\n const byId = document.getElementById(id);\n if (byId) return byId;\n }\n if (typeof document.querySelector === 'function') {\n return document.querySelector('#' + id);\n }\n return null;\n};\nconst readPlayer = () => {\n const root = typeof globalThis !== 'undefined' ? globalThis : {};\n const candidates = [];\n for (const playerId of ['movie_player', 'shorts-player']) {\n const player = getPlayerEl(playerId);\n if (player && typeof player.getPlayerResponse === 'function') {\n try {\n const live = player.getPlayerResponse();\n if (live && typeof live === 'object') candidates.push(live);\n } catch {}\n }\n }\n if (typeof document !== 'undefined' && document && typeof document.querySelector === 'function') {\n const flexy = document.querySelector('ytd-watch-flexy');\n if (flexy && flexy.playerData && typeof flexy.playerData === 'object') candidates.push(flexy.playerData);\n }\n if (root.ytInitialPlayerResponse && typeof root.ytInitialPlayerResponse === 'object') {\n candidates.push(root.ytInitialPlayerResponse);\n }\n const exact = candidates.find(c => c.videoDetails && c.videoDetails.videoId === videoId);\n if (exact) return exact;\n return candidates.find(c => (!c.videoDetails || !c.videoDetails.videoId) && c.playabilityStatus) || null;\n};\nconst detectWall = () => {\n if (typeof document === 'undefined' || !document) return null;\n if (typeof document.querySelector === 'function') {\n const consentEl = document.querySelector('form[action*=\"consent.youtube.com\"], ytd-consent-bump-v2-lightbox, tp-yt-paper-dialog[aria-label*=\"consent\" i], #consent-bump');\n if (consentEl && !consentEl.hidden && consentEl.getAttribute?.('aria-hidden') !== 'true') {\n return { success: false, status: 'consent_required', videoId, message: 'YouTube consent wall is blocking video playback', source: currentHref };\n }\n }\n const bodyText = String((document.body && (document.body.innerText || document.body.textContent)) || '').trim();\n if (/sign in to confirm you(?:'|\\u2019)?re not a bot/i.test(bodyText)) {\n return { success: false, status: 'bot_check', videoId, requiresLogin: true, message: 'YouTube requested bot verification', source: currentHref };\n }\n if (/before you continue to youtube/i.test(bodyText)) {\n return { success: false, status: 'consent_required', videoId, message: 'YouTube consent wall is blocking video playback', source: currentHref };\n }\n return null;\n};\nlet playerResponse = null;\nlet wallError = null;\nfor (let attempt = 0; attempt < 20; attempt += 1) {\n const candidate = readPlayer();\n if (candidate && (candidate.videoDetails || candidate.playabilityStatus)) {\n playerResponse = candidate;\n break;\n }\n wallError = detectWall();\n if (wallError) break;\n if (attempt < 19) await sleep(200);\n}\nif (wallError) {\n return wallError;\n}\nif (!playerResponse) {\n return { success: false, status: 'loading_timeout', videoId, message: 'YouTube player response did not become available', source: pageUrl };\n}\nconst playability = playerResponse.playabilityStatus || {};\nconst playStatus = String(playability.status || '').trim();\nconst playReason = String(playability.reason || '').trim();\nif (playStatus === 'LOGIN_REQUIRED') {\n if (/not a bot/i.test(playReason)) {\n return { success: false, status: 'bot_check', videoId, requiresLogin: true, message: playReason, source: pageUrl };\n }\n return { success: false, status: 'requires_auth', videoId, requiresLogin: true, message: playReason || 'YouTube requires authentication', source: pageUrl };\n}\nif (playStatus === 'AGE_CHECK_REQUIRED') {\n return { success: false, status: 'age_restricted', videoId, requiresLogin: true, message: playReason || 'YouTube requires age verification', source: pageUrl };\n}\nif (playStatus === 'CONTENT_CHECK_REQUIRED') {\n return { success: false, status: 'content_check_required', videoId, message: playReason || 'YouTube requires content warning confirmation', source: pageUrl };\n}\nif (playStatus === 'ERROR' || playStatus === 'UNPLAYABLE' || playStatus === 'LIVE_STREAM_OFFLINE') {\n return { success: false, status: 'unavailable', videoId, playabilityStatus: playStatus, message: playReason || 'YouTube video is unavailable', source: pageUrl };\n}\nconst details = playerResponse.videoDetails || {};\nconst title = String(details.title || '').trim();\nif (!title) {\n if (playStatus && playStatus !== 'OK') {\n return { success: false, status: 'unavailable', videoId, playabilityStatus: playStatus, message: playReason || 'YouTube video is unavailable', source: pageUrl };\n }\n return { success: false, status: 'schema_changed', videoId, source: pageUrl };\n}\nconst microformat = (playerResponse.microformat && playerResponse.microformat.playerMicroformatRenderer) || {};\nconst rawTracks = (playerResponse.captions && playerResponse.captions.playerCaptionsTracklistRenderer && Array.isArray(playerResponse.captions.playerCaptionsTracklistRenderer.captionTracks)) ? playerResponse.captions.playerCaptionsTracklistRenderer.captionTracks : [];\nconst captionTracks = rawTracks.slice(0, 20).map(track => ({\n languageCode: String((track && track.languageCode) || '').trim(),\n name: String((track && track.name && (track.name.simpleText || (Array.isArray(track.name.runs) && track.name.runs.map(r => r.text).join('')))) || '').trim(),\n kind: String((track && track.kind) || 'standard').trim()\n}));\nlet subtitle = null;\nlet subtitleSource = null;\nif (includeSubtitles && rawTracks.length > 0) {\n let selected = null;\n for (const pref of preferredLangs) {\n selected = rawTracks.find(t => String((t && t.languageCode) || '').toLowerCase() === pref && (!t.kind || t.kind !== 'asr'))\n || rawTracks.find(t => String((t && t.languageCode) || '').toLowerCase() === pref)\n || rawTracks.find(t => String((t && t.languageCode) || '').toLowerCase().startsWith(pref + '-'));\n if (selected) break;\n }\n if (!selected) selected = rawTracks[0];\n if (selected && typeof selected.baseUrl === 'string' && selected.baseUrl) {\n try {\n const trackUrl = new URL(selected.baseUrl, currentOrigin);\n if (/^https:\\/\\/(?:www\\.|m\\.)?youtube\\.com$/i.test(trackUrl.origin)) {\n trackUrl.searchParams.set('fmt', 'json3');\n const subRes = await fetch(trackUrl.href, { credentials: 'include' });\n if (subRes.ok) {\n const subData = await subRes.json();\n const events = Array.isArray(subData && subData.events) ? subData.events : [];\n const lines = [];\n for (const ev of events) {\n const segs = Array.isArray(ev && ev.segs) ? ev.segs : [];\n const line = segs.map(s => String((s && s.utf8) || '')).join('').replace(/\\s+/g, ' ').trim();\n if (line) lines.push(line);\n }\n const joined = lines.join('\\n').trim();\n if (joined) {\n const truncated = joined.length > maxSubtitleChars;\n subtitle = {\n languageCode: String(selected.languageCode || ''),\n kind: String(selected.kind || 'standard'),\n text: truncated ? joined.slice(0, maxSubtitleChars) : joined,\n truncated\n };\n subtitleSource = subRes.url || trackUrl.href;\n }\n }\n }\n } catch {\n // Keep metadata output even when optional timedtext fetch fails.\n }\n }\n}\nreturn {\n success: true,\n status: 'ok',\n video: {\n videoId: String(details.videoId || videoId),\n title,\n url: pageUrl,\n author: String(details.author || '').trim(),\n channelId: String(details.channelId || '').trim(),\n durationSeconds: Math.max(0, Math.floor(Number(details.lengthSeconds) || 0)),\n viewCount: Math.max(0, Math.floor(Number(details.viewCount) || 0)),\n publishDate: String(microformat.publishDate || '').trim(),\n description: String(details.shortDescription || '').trim().slice(0, 3000)\n },\n captionTracks,\n subtitle,\n sources: {\n page: pageUrl,\n subtitles: subtitleSource\n }\n};",
|
|
215
|
+
"timeoutMs": 30000
|
|
216
|
+
},
|
|
217
|
+
"resultPath": "/result"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"verification": {
|
|
221
|
+
"tool": "chrome_network_request",
|
|
222
|
+
"args": {
|
|
223
|
+
"url": "https://www.youtube.com/oembed?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D{{videoId}}&format=json",
|
|
224
|
+
"method": "GET",
|
|
225
|
+
"timeout": 30000
|
|
226
|
+
},
|
|
227
|
+
"resultPath": "/response/body"
|
|
228
|
+
},
|
|
229
|
+
"tests": [
|
|
230
|
+
{
|
|
231
|
+
"inputs": {
|
|
232
|
+
"videoId": "dQw4w9WgXcQ",
|
|
233
|
+
"includeSubtitles": false
|
|
234
|
+
},
|
|
235
|
+
"expect": {
|
|
236
|
+
"type": "object",
|
|
237
|
+
"properties": {
|
|
238
|
+
"success": {
|
|
239
|
+
"const": true
|
|
240
|
+
},
|
|
241
|
+
"video": {
|
|
242
|
+
"type": "object",
|
|
243
|
+
"properties": {
|
|
244
|
+
"videoId": {
|
|
245
|
+
"const": "dQw4w9WgXcQ"
|
|
246
|
+
},
|
|
247
|
+
"title": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"minLength": 1
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"required": [
|
|
253
|
+
"videoId",
|
|
254
|
+
"title"
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
"sources": {
|
|
258
|
+
"type": "object",
|
|
259
|
+
"required": [
|
|
260
|
+
"page"
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"required": [
|
|
265
|
+
"success",
|
|
266
|
+
"video",
|
|
267
|
+
"captionTracks",
|
|
268
|
+
"sources"
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"observe": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"properties": {
|
|
274
|
+
"title": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"minLength": 1
|
|
277
|
+
},
|
|
278
|
+
"author_name": {
|
|
279
|
+
"type": "string",
|
|
280
|
+
"minLength": 1
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"required": [
|
|
284
|
+
"title",
|
|
285
|
+
"author_name"
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"inputs": {
|
|
291
|
+
"videoId": "jNQXAC9IVRw",
|
|
292
|
+
"includeSubtitles": false
|
|
293
|
+
},
|
|
294
|
+
"expect": {
|
|
295
|
+
"type": "object",
|
|
296
|
+
"properties": {
|
|
297
|
+
"success": {
|
|
298
|
+
"const": true
|
|
299
|
+
},
|
|
300
|
+
"video": {
|
|
301
|
+
"type": "object",
|
|
302
|
+
"properties": {
|
|
303
|
+
"videoId": {
|
|
304
|
+
"const": "jNQXAC9IVRw"
|
|
305
|
+
},
|
|
306
|
+
"title": {
|
|
307
|
+
"type": "string",
|
|
308
|
+
"minLength": 1
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"required": [
|
|
312
|
+
"videoId",
|
|
313
|
+
"title"
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
"sources": {
|
|
317
|
+
"type": "object",
|
|
318
|
+
"required": [
|
|
319
|
+
"page"
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"required": [
|
|
324
|
+
"success",
|
|
325
|
+
"video",
|
|
326
|
+
"captionTracks",
|
|
327
|
+
"sources"
|
|
328
|
+
]
|
|
329
|
+
},
|
|
330
|
+
"observe": {
|
|
331
|
+
"type": "object",
|
|
332
|
+
"properties": {
|
|
333
|
+
"title": {
|
|
334
|
+
"type": "string",
|
|
335
|
+
"minLength": 1
|
|
336
|
+
},
|
|
337
|
+
"author_name": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"minLength": 1
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
"required": [
|
|
343
|
+
"title",
|
|
344
|
+
"author_name"
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
}
|
|
@@ -9,15 +9,15 @@ Run `browserpaw status` to confirm the host and extension are connected. Use `br
|
|
|
9
9
|
|
|
10
10
|
For browser history, bookmarks, or site storage, use `browserpaw help data` and [browser data](references/browser-data.md). For network, performance, or CDP work, use `browserpaw help debug` and [debugging](references/debugging.md).
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
When invoked on demand, the CLI checks npm every 24 hours, installs verified updates under `~/.browserpaw/cli-versions/`, and refreshes the host, bundled recipes, and managed Skills (`BROWSERPAW_NO_AUTO_UPDATE=1` / `BROWSERPAW_NO_UPDATE_CHECK=1` opt out). If auto-update is disabled and stderr reports an update, mention it once after finishing the task before running `browserpaw setup`. Same-major CLI updates (`5.0.x` with extension `>= 5.0.0`) stay compatible without requiring an extension reload; `browserpaw status` reports `extensionUpdateAvailable` or incompatibility for manual updates in `chrome://extensions`. Update plugin-bundled Skills via their Agent's plugin manager.
|
|
13
13
|
|
|
14
|
-
For an npx-only installation, use `npx --yes browserpaw@5.0.
|
|
14
|
+
For an npx-only installation, use `npx --yes browserpaw@5.0.1` in place of `browserpaw` throughout.
|
|
15
15
|
|
|
16
16
|
## Learned Workflows & Auto-Routing (`~/.browserpaw`)
|
|
17
17
|
|
|
18
|
-
Before manually browsing a site, check any synced `Learned Workflows` table
|
|
18
|
+
Before manually browsing a site, check any synced `Learned Workflows` table or run `browserpaw recipe find <query> --url <url>` / `browserpaw recipe list` (offline against `~/.browserpaw`). Trusted bundled read-only skills appear by default with status `bundled` (no `--all` needed); unvalidated custom or proposed candidates require `recipe list --all` and `browserpaw recipe validate ID`. When a recipe matches, inspect inputs with `browserpaw recipe show ID` if needed and run `browserpaw recipe run ID key=value...` directly.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
First `browserpaw recipe run ID ...` on a `bundled` skill auto-validates and activates it; newer bundled revisions auto-upgrade with rollback on validation failure, preserving user-created, disabled, and pinned skills. For custom or repaired candidates (`recipe list --all`), run `browserpaw recipe validate ID` once with Chrome connected. Only verified read-only workflows auto-activate; write-capable candidates remain manual.
|
|
21
21
|
|
|
22
22
|
When you solve a repeatable site workflow that has no learned entry yet (such as a site search or structured page reader), save it into `~/.browserpaw` with `browserpaw recipe save FILE` including `id`, `name`, `description`, `domains`, `keywords`, `inputs`, and `steps` (or propose a verified read-only skill). Saving creates a candidate, which remains discoverable through `recipe list --all` but does not enter automatic routing until validation. Repair one failing step with `browserpaw recipe patch ID --step INDEX -- ARGS...`; the candidate revision is written separately, so a failed repair or validation preserves the active workflow. A failed recipe returns `failedStepIndex`, `failedStep`, `completedSteps`, and a bounded page summary when a temporary task remains available. Never store passwords, cookies, tokens, tab IDs, or observed refs in saved recipes.
|
|
23
23
|
|