@liyuera/dsh-chrome-browser 0.5.0 → 0.6.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/README.md +16 -2
- package/extension/manifest.json +1 -1
- package/extension/service-worker.js +32 -4
- package/lib/activity.d.ts +35 -22
- package/lib/activity.d.ts.map +1 -1
- package/lib/activity.js +68 -28
- package/lib/activity.js.map +1 -1
- package/lib/backend.d.ts +35 -2
- package/lib/backend.d.ts.map +1 -1
- package/lib/backend.js +57 -6
- package/lib/backend.js.map +1 -1
- package/lib/client/BrowserActivity.d.ts +14 -11
- package/lib/client/BrowserActivity.d.ts.map +1 -1
- package/lib/client/BrowserActivity.js +86 -45
- package/lib/client/BrowserActivity.js.map +1 -1
- package/lib/client/activity.d.ts +16 -9
- package/lib/client/activity.d.ts.map +1 -1
- package/lib/client/activity.js +41 -20
- package/lib/client/activity.js.map +1 -1
- package/lib/client/index.d.ts +2 -2
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/index.js +9 -8
- package/lib/client/index.js.map +1 -1
- package/lib/client.js +195 -73
- package/lib/client.js.map +1 -1
- package/lib/expressions.d.ts +11 -0
- package/lib/expressions.d.ts.map +1 -1
- package/lib/expressions.js +25 -0
- package/lib/expressions.js.map +1 -1
- package/lib/routes.d.ts.map +1 -1
- package/lib/routes.js +10 -2
- package/lib/routes.js.map +1 -1
- package/lib/skill.js +3 -3
- package/lib/tools.d.ts.map +1 -1
- package/lib/tools.js +14 -1
- package/lib/tools.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Chrome 浏览器控制插件(host + 浏览器半边):通过 Chrome 扩展桥(默
|
|
|
11
11
|
| `chrome_navigate` | 标签页导航到 URL(默认等待 `readyState=complete`) |
|
|
12
12
|
| `chrome_open` | 新开前台标签页;**默认等加载完成**(`readyState=complete`,上限 `waitLoadMs`)后返回,返回的标题已是加载后的标题。**URL 只接受 http/https/file**,其它 scheme 在开标签页**之前**就报错 |
|
|
13
13
|
| `chrome_close` | 按 id 关闭一个标签页;**`tabId` 必填,不接受 `active`**——关掉用户正在看的那一页几乎总是错的 |
|
|
14
|
-
| `chrome_screenshot` |
|
|
14
|
+
| `chrome_screenshot` | 截图落盘,返回路径/字节数/mime;模型用 `read_image` 查看。**`fullPage: true` 一次拍完整页**,`selector` 只拍某个元素(等同 DevTools 的「截取节点屏幕截图」) |
|
|
15
15
|
| `chrome_click` | CSS 选择器 `element.click()`(可选 `all` 批量)。返回**实际派发点击**的元素数(不是匹配到的数量),并报告「存在但不可点」的原因 |
|
|
16
16
|
| `chrome_hover` | 悬停到元素上,展开只在 hover 时出现的菜单/工具条 |
|
|
17
17
|
| `chrome_type` | 聚焦输入框并输入文本(默认先全选替换) |
|
|
@@ -22,7 +22,20 @@ Chrome 浏览器控制插件(host + 浏览器半边):通过 Chrome 扩展桥(默
|
|
|
22
22
|
| `chrome_console` | 采集/读取某个标签页的控制台(`action: start / read / stop`);**必须在页面出问题之前 start**,含浏览器自身抛的错误(资源加载失败、CSP 拦截) |
|
|
23
23
|
| `chrome_request_help` | 停下来请用户做只有人能做的事(登录、验证码、二次验证),等用户答复;`completed: false` 表示用户跳过了,不要重试 |
|
|
24
24
|
| `@` 标签页分组 | 在输入框敲 `@` 时列出实时标签页(行内是「标题 + URL」),选中插入一个引用芯片;发送后消息里只有这个引用,标签页的 URL 与 tabId 由宿主注入一条上下文消息给模型 |
|
|
25
|
-
|
|
|
25
|
+
| **活动状态条**已经改成**会话标题栏末尾常驻的淡色状态胶囊**。之前放在输入框上方的做法是错的:它只在调用期间出现,而 `chrome_*` 调用多数是毫秒级——一条闪 50ms 的提示不是信息,是抖动,用户根本来不及看。
|
|
26
|
+
|
|
27
|
+
现在它常驻,并且有完整的生命周期:
|
|
28
|
+
|
|
29
|
+
| 状态 | 何时 | 显示 |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `Chrome 就绪` | 扩展已连接,空闲 | 淡绿点(最弱的存在感) |
|
|
32
|
+
| `点击 · 标签页 7` | 调用进行中 | 绿色脉冲点 + 当前动作 |
|
|
33
|
+
| `完成` | 调用成功结束后 2.5 秒 | 绿点 |
|
|
34
|
+
| `失败` | 调用失败后 7 秒,悬停显示原因 | 红点 |
|
|
35
|
+
| `Chrome 未连接` | 扩展没连上 | 灰点 |
|
|
36
|
+
| `扩展待更新` | 扩展在跑旧文件 | 黄点 |
|
|
37
|
+
|
|
38
|
+
失败停留得比成功久(7 秒 vs 2.5 秒),因为它要求被读;连接类状态**优先于**调用结果——在一个断开的桥上显示「完成」是误导。所有尺寸是**内联样式**,因为一个没生效的样式表曾经让内置的 512px 图标按原尺寸渲染,把标题栏撑满了。
|
|
26
39
|
| `/chrome-browser` skill | 注册一个 agent skill:讲清什么时候用、调用顺序、失败怎么办、有哪些边界。模型通过 `skill` 工具读它,你也可以直接敲 `/chrome-browser`。宿主没有 skill 服务时静默跳过,工具照常可用 |
|
|
27
40
|
|
|
28
41
|
### chrome_read:两个阅读模式
|
|
@@ -356,6 +369,7 @@ DSH_CHROME_SMOKE=1 npx vitest run tests/smoke.spec.ts # headless Chrome 全链
|
|
|
356
369
|
- **`about:blank` 只能开、不能导航过去**:扩展注不进空白页,所以空白标签页读不了、点不了、跑不了 JS。`chrome_open` 允许开一个(当**临时中转页**用,随后 `chrome_navigate` 走),并且**不会等它加载**(没东西可等);但 `chrome_navigate` 拒绝导航到 `about:blank`——那会丢弃页面上原有的内容,只剩一个谁也读不了的标签页。
|
|
357
370
|
- **`chrome_close` 不猜目标**:`tabId` 是必填的精确 id。省略或写 `active` 都会报错——关掉「用户当前正在看的标签页」几乎总是错的。关闭窗口的最后一个标签页会连带关闭该窗口。
|
|
358
371
|
- **扩展自动更新依赖 `chrome.runtime.reload()` 能读到磁盘上的新文件**:这是该 API 的预期行为,但已加载的解压扩展由 Chrome 缓存,所以插件**只尝试一次**并在失败时明确报告,而不是无限重载。状态见 `/chrome-browser/ext/status`。
|
|
372
|
+
- **`chrome_screenshot` 默认只拍视口**:整页要显式传 `fullPage: true`(一次调用完成,不要靠滚动拼接——拼接会重复固定元素、接缝错位,而且很难对齐)。`selector` 拍单个元素,元素在首屏之下也照样能拍对。
|
|
359
373
|
- **`chrome_screenshot` 会在该标签页显示调试提示条**:它走 `chrome.debugger` 的 `Page.captureScreenshot`(与 CDP 后端同一条路),因此在标签页处于后台时照样可用,也**不会返回陈旧帧**。代价是 Chrome 在该标签页顶部显示「正在调试」提示条,且已打开 DevTools 时无法附着(会明确报错)。如果该标签页已被 `chrome_console` 采集,则复用同一会话,不产生第二次附着。
|
|
360
374
|
- ~~截图要求窗口可见~~:旧实现走 `chrome.tabs.captureVisibleTab`,窗口被遮挡时报 `image readback failed`,窗口停止重绘时**返回上一帧**(实测两张相隔数秒的截图逐字节相同,而返回的路径与字节数不会告诉你它是陈旧的)。已改为调试通道。
|
|
361
375
|
- **活动状态条是轮询的**:客户端每秒发一次本地回环 GET。将来若接入会话事件流可以去掉轮询,目前用的是插件已有的路由机制。
|
package/extension/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "dsh Chrome Control",
|
|
4
4
|
"description": "Lets the local dsh agent drive this Chrome: list tabs, read pages, click and type, run JS, capture screenshots, read console output. Talks to dsh on this machine only.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.4.0",
|
|
6
6
|
"permissions": [
|
|
7
7
|
"tabs",
|
|
8
8
|
"scripting",
|
|
@@ -112,7 +112,7 @@ const SUPPORTED_OPS = [
|
|
|
112
112
|
* user stayed on a stale extension with nothing to show for it. Only a value
|
|
113
113
|
* carried by the loaded code can tell the host which code is loaded.
|
|
114
114
|
*/
|
|
115
|
-
const BUILD_HASH = '
|
|
115
|
+
const BUILD_HASH = '9dd296539a1d1e347c833f21c3f3c207a4f62f864803aa40151aa280e9b07e37'
|
|
116
116
|
|
|
117
117
|
/** Introduce this worker: what it runs, what it can answer, and which code it is. */
|
|
118
118
|
async function hello() {
|
|
@@ -458,7 +458,10 @@ async function run(command) {
|
|
|
458
458
|
// failed" while the user is looking at something else — and when the
|
|
459
459
|
// window merely stops repainting it returns the PREVIOUS frame with no
|
|
460
460
|
// sign that it did. Page.captureScreenshot has neither problem.
|
|
461
|
-
const base64 = await captureViaDebugger(Number(command.args.tabId)
|
|
461
|
+
const base64 = await captureViaDebugger(Number(command.args.tabId), {
|
|
462
|
+
fullPage: command.args.fullPage === true,
|
|
463
|
+
selector: typeof command.args.selector === 'string' ? command.args.selector : undefined,
|
|
464
|
+
})
|
|
462
465
|
// Image bytes travel back as a plain HTTP POST, never as a WS JSON frame:
|
|
463
466
|
// an oversized frame closed the bridge right after a successful capture.
|
|
464
467
|
const blob = await (await fetch('data:image/jpeg;base64,' + base64)).blob()
|
|
@@ -481,6 +484,22 @@ async function run(command) {
|
|
|
481
484
|
}
|
|
482
485
|
}
|
|
483
486
|
|
|
487
|
+
/**
|
|
488
|
+
* One element's clip rectangle, or a failure naming the selector.
|
|
489
|
+
* @param tabId - the tab to measure in.
|
|
490
|
+
* @param selector - CSS selector of the element to capture.
|
|
491
|
+
* @returns the clip rectangle in page coordinates.
|
|
492
|
+
*/
|
|
493
|
+
async function rectOf(tabId, selector) {
|
|
494
|
+
const box = await pageExec(tabId, pageAgent, [{ op: 'rect', selector }])
|
|
495
|
+
if (box === null || typeof box !== 'object' || box.matched !== 1) {
|
|
496
|
+
throw new Error(`截图失败:没有匹配 ${selector} 的元素`)
|
|
497
|
+
}
|
|
498
|
+
const { x, y, width, height } = box
|
|
499
|
+
if (!(width > 0) || !(height > 0)) throw new Error(`截图失败:${selector} 没有可见尺寸(宽 ${width} 高 ${height})`)
|
|
500
|
+
return { x, y, width, height, scale: 1 }
|
|
501
|
+
}
|
|
502
|
+
|
|
484
503
|
/** JPEG quality the screenshot is encoded at before upload. */
|
|
485
504
|
const SCREENSHOT_QUALITY = 75
|
|
486
505
|
|
|
@@ -492,9 +511,15 @@ const SCREENSHOT_QUALITY = 75
|
|
|
492
511
|
* answer with a stale frame. It costs the debugger infobar on that tab, which is
|
|
493
512
|
* why a tab `chrome_console` already attached needs no second attach.
|
|
494
513
|
*/
|
|
495
|
-
async function captureViaDebugger(tabId) {
|
|
514
|
+
async function captureViaDebugger(tabId, options) {
|
|
496
515
|
const id = Number(tabId)
|
|
497
516
|
if (!Number.isInteger(id)) throw new Error(`无效的标签页 id:${String(tabId)}`)
|
|
517
|
+
const selector = options !== undefined && typeof options.selector === 'string' && options.selector !== ''
|
|
518
|
+
? options.selector
|
|
519
|
+
: undefined
|
|
520
|
+
// `captureBeyondViewport` is what turns a viewport grab into a whole-page
|
|
521
|
+
// one; a clip needs it too, for any element below the fold.
|
|
522
|
+
const beyond = options !== undefined && (options.fullPage === true || selector !== undefined)
|
|
498
523
|
const targets = await chrome.debugger.getTargets()
|
|
499
524
|
const existing = targets.find(target => target.tabId === id && target.attached === true)
|
|
500
525
|
if (existing !== undefined && existing.extensionId !== chrome.runtime.id) {
|
|
@@ -503,10 +528,12 @@ async function captureViaDebugger(tabId) {
|
|
|
503
528
|
const ours = existing !== undefined
|
|
504
529
|
if (!ours) await chrome.debugger.attach({ tabId: id }, '1.3')
|
|
505
530
|
try {
|
|
531
|
+
const clip = selector === undefined ? undefined : await rectOf(id, selector)
|
|
506
532
|
const response = await chrome.debugger.sendCommand({ tabId: id }, 'Page.captureScreenshot', {
|
|
507
533
|
format: 'jpeg',
|
|
508
534
|
quality: SCREENSHOT_QUALITY,
|
|
509
|
-
captureBeyondViewport:
|
|
535
|
+
captureBeyondViewport: beyond,
|
|
536
|
+
...(clip === undefined ? {} : { clip }),
|
|
510
537
|
})
|
|
511
538
|
if (response === undefined || typeof response.data !== 'string' || response.data === '') {
|
|
512
539
|
throw new Error('截图失败:调试通道没有返回图像数据')
|
|
@@ -688,6 +715,7 @@ function pageAgent(request) {
|
|
|
688
715
|
switch (request.op) {
|
|
689
716
|
case 'click': return clickSelector(request.selector, request.all === true)
|
|
690
717
|
case 'inventory': return interactiveInventory()
|
|
718
|
+
case 'rect': return elementRect(request.selector)
|
|
691
719
|
case 'press': return pressKey(request.key, request.selector)
|
|
692
720
|
default: return { __dshPageError: '未知的页面操作:' + request.op }
|
|
693
721
|
}
|
package/lib/activity.d.ts
CHANGED
|
@@ -1,38 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What the plugin is doing right now, for the
|
|
2
|
+
* What the plugin is doing right now, for the persistent header indicator.
|
|
3
3
|
*
|
|
4
4
|
* The host half is the only place that knows a call is in flight, so it records
|
|
5
5
|
* every tool execution here and serves the snapshot over its own route; the
|
|
6
|
-
* browser half polls that route and renders
|
|
7
|
-
*
|
|
6
|
+
* browser half polls that route and renders one chip in the Session header.
|
|
7
|
+
* Nothing is persisted, and nothing crosses into the model's request.
|
|
8
8
|
* @module @liyuera/dsh-chrome-browser/activity
|
|
9
9
|
*/
|
|
10
10
|
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* How long a settled call stays on screen before the chip returns to idle.
|
|
13
|
+
* Short enough not to linger, long enough that a call finishing between two
|
|
14
|
+
* polls is still seen: the browser half polls at POLL_MS, so a hold shorter
|
|
15
|
+
* than one poll interval can be missed entirely.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DONE_HOLD_MS = 2500;
|
|
18
|
+
/** How long a failure stays on screen. Longer: it asks to be read. */
|
|
19
|
+
export declare const ERROR_HOLD_MS = 7000;
|
|
20
|
+
/** Which of the four things the chip can be saying. */
|
|
21
|
+
export type ActivityPhase = 'running' | 'done' | 'error' | 'ready';
|
|
22
|
+
/** What the browser half renders from. */
|
|
12
23
|
export interface ActivitySnapshot {
|
|
13
|
-
/**
|
|
14
|
-
readonly
|
|
15
|
-
/**
|
|
24
|
+
/** Current phase for the session being asked about. */
|
|
25
|
+
readonly phase: ActivityPhase;
|
|
26
|
+
/** Tool the phase belongs to, when it belongs to a call. */
|
|
16
27
|
readonly tool?: string;
|
|
17
|
-
/** Tab
|
|
28
|
+
/** Tab that call named, when it named one. */
|
|
18
29
|
readonly tabId?: string;
|
|
19
|
-
/**
|
|
20
|
-
readonly
|
|
21
|
-
/**
|
|
22
|
-
readonly
|
|
23
|
-
/** Epoch milliseconds the most recent call finished. */
|
|
24
|
-
readonly lastAt?: number;
|
|
30
|
+
/** Failure text, shortened, when the phase is `error`. */
|
|
31
|
+
readonly detail?: string;
|
|
32
|
+
/** Epoch milliseconds this phase began, or the last call's start. */
|
|
33
|
+
readonly since: number;
|
|
25
34
|
}
|
|
26
35
|
/** Route-facing view of one snapshot. */
|
|
27
36
|
export type ActivityAnswer = Record<string, string | number | boolean>;
|
|
28
37
|
/**
|
|
29
|
-
* In-flight and
|
|
30
|
-
* has one.
|
|
31
|
-
*
|
|
38
|
+
* In-flight and recently finished browser calls, keyed by session when the
|
|
39
|
+
* caller has one.
|
|
40
|
+
*
|
|
41
|
+
* The tracker holds facts, not timers: `snapshot` decides whether a settled
|
|
42
|
+
* call is still worth showing from the clock alone. That keeps a host tick out
|
|
43
|
+
* of the loop and means a browser that polls late sees the same answer a
|
|
44
|
+
* host-side timer would have produced.
|
|
32
45
|
*/
|
|
33
46
|
export declare class ActivityTracker {
|
|
34
47
|
private readonly running;
|
|
35
|
-
private readonly
|
|
48
|
+
private readonly settled;
|
|
36
49
|
/** Session key for a caller with no session identity. */
|
|
37
50
|
private static readonly ANONYMOUS;
|
|
38
51
|
/**
|
|
@@ -40,20 +53,20 @@ export declare class ActivityTracker {
|
|
|
40
53
|
* @param tool - the tool name.
|
|
41
54
|
* @param tabId - the tab the call named, when it named one.
|
|
42
55
|
* @param sessionId - the calling session, when the execution carried one.
|
|
43
|
-
* @returns the disposer that records the call
|
|
56
|
+
* @returns the disposer that records how the call ended; idempotent.
|
|
44
57
|
*/
|
|
45
|
-
begin(tool: string, tabId: string | undefined, sessionId: string | undefined): () => void;
|
|
58
|
+
begin(tool: string, tabId: string | undefined, sessionId: string | undefined): (ok: boolean, detail?: string) => void;
|
|
46
59
|
/**
|
|
47
60
|
* The current state for one session.
|
|
48
61
|
* @param sessionId - the session to report on; omit for the most recent call in any session.
|
|
49
|
-
* @returns the snapshot the
|
|
62
|
+
* @returns the snapshot the chip renders from.
|
|
50
63
|
*/
|
|
51
64
|
snapshot(sessionId?: string): ActivitySnapshot;
|
|
52
65
|
/** Drop every record; the plugin calls this on unload. */
|
|
53
66
|
clear(): void;
|
|
54
67
|
}
|
|
55
68
|
/**
|
|
56
|
-
* Wrap one tool definition so its execution is visible to the
|
|
69
|
+
* Wrap one tool definition so its execution is visible to the header chip.
|
|
57
70
|
*
|
|
58
71
|
* Every other member is carried over untouched: this adds observation, it does
|
|
59
72
|
* not change what the tool declares or returns.
|
package/lib/activity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../src/activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../src/activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,YAAY,OAAQ,CAAA;AAEjC,sEAAsE;AACtE,eAAO,MAAM,aAAa,OAAQ,CAAA;AAKlC,uDAAuD;AACvD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAElE,0CAA0C;AAC1C,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAmBD,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;AAEtE;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD,yDAAyD;IACzD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAK;IAEtC;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI;IAyBrH;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,gBAAgB;IA8B9C,0DAA0D;IAC1D,KAAK,IAAI,IAAI;CAId;AAqBD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,GAAG,cAAc,CAgBlG"}
|
package/lib/activity.js
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What the plugin is doing right now, for the
|
|
2
|
+
* What the plugin is doing right now, for the persistent header indicator.
|
|
3
3
|
*
|
|
4
4
|
* The host half is the only place that knows a call is in flight, so it records
|
|
5
5
|
* every tool execution here and serves the snapshot over its own route; the
|
|
6
|
-
* browser half polls that route and renders
|
|
7
|
-
*
|
|
6
|
+
* browser half polls that route and renders one chip in the Session header.
|
|
7
|
+
* Nothing is persisted, and nothing crosses into the model's request.
|
|
8
8
|
* @module @liyuera/dsh-chrome-browser/activity
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* How long a settled call stays on screen before the chip returns to idle.
|
|
12
|
+
* Short enough not to linger, long enough that a call finishing between two
|
|
13
|
+
* polls is still seen: the browser half polls at POLL_MS, so a hold shorter
|
|
14
|
+
* than one poll interval can be missed entirely.
|
|
15
|
+
*/
|
|
16
|
+
export const DONE_HOLD_MS = 2_500;
|
|
17
|
+
/** How long a failure stays on screen. Longer: it asks to be read. */
|
|
18
|
+
export const ERROR_HOLD_MS = 7_000;
|
|
19
|
+
/** Longest failure text carried to the chip; the card holds the full one. */
|
|
20
|
+
const DETAIL_LIMIT = 120;
|
|
21
|
+
/**
|
|
22
|
+
* In-flight and recently finished browser calls, keyed by session when the
|
|
23
|
+
* caller has one.
|
|
24
|
+
*
|
|
25
|
+
* The tracker holds facts, not timers: `snapshot` decides whether a settled
|
|
26
|
+
* call is still worth showing from the clock alone. That keeps a host tick out
|
|
27
|
+
* of the loop and means a browser that polls late sees the same answer a
|
|
28
|
+
* host-side timer would have produced.
|
|
14
29
|
*/
|
|
15
30
|
export class ActivityTracker {
|
|
16
31
|
running = [];
|
|
17
|
-
|
|
32
|
+
settled = new Map();
|
|
18
33
|
/** Session key for a caller with no session identity. */
|
|
19
34
|
static ANONYMOUS = '';
|
|
20
35
|
/**
|
|
@@ -22,7 +37,7 @@ export class ActivityTracker {
|
|
|
22
37
|
* @param tool - the tool name.
|
|
23
38
|
* @param tabId - the tab the call named, when it named one.
|
|
24
39
|
* @param sessionId - the calling session, when the execution carried one.
|
|
25
|
-
* @returns the disposer that records the call
|
|
40
|
+
* @returns the disposer that records how the call ended; idempotent.
|
|
26
41
|
*/
|
|
27
42
|
begin(tool, tabId, sessionId) {
|
|
28
43
|
const entry = {
|
|
@@ -33,20 +48,27 @@ export class ActivityTracker {
|
|
|
33
48
|
};
|
|
34
49
|
this.running.push(entry);
|
|
35
50
|
let ended = false;
|
|
36
|
-
return () => {
|
|
51
|
+
return (ok, detail) => {
|
|
37
52
|
if (ended)
|
|
38
53
|
return;
|
|
39
54
|
ended = true;
|
|
40
55
|
const at = this.running.indexOf(entry);
|
|
41
56
|
if (at >= 0)
|
|
42
57
|
this.running.splice(at, 1);
|
|
43
|
-
|
|
58
|
+
const shortened = detail === undefined ? undefined : detail.slice(0, DETAIL_LIMIT);
|
|
59
|
+
this.settled.set(sessionId ?? ActivityTracker.ANONYMOUS, {
|
|
60
|
+
tool,
|
|
61
|
+
ok,
|
|
62
|
+
at: Date.now(),
|
|
63
|
+
...(entry.tabId === undefined ? {} : { tabId: entry.tabId }),
|
|
64
|
+
...(ok || shortened === undefined ? {} : { detail: shortened }),
|
|
65
|
+
});
|
|
44
66
|
};
|
|
45
67
|
}
|
|
46
68
|
/**
|
|
47
69
|
* The current state for one session.
|
|
48
70
|
* @param sessionId - the session to report on; omit for the most recent call in any session.
|
|
49
|
-
* @returns the snapshot the
|
|
71
|
+
* @returns the snapshot the chip renders from.
|
|
50
72
|
*/
|
|
51
73
|
snapshot(sessionId) {
|
|
52
74
|
const key = sessionId ?? ActivityTracker.ANONYMOUS;
|
|
@@ -54,23 +76,33 @@ export class ActivityTracker {
|
|
|
54
76
|
// one browser, so an unidentified call is still this caller's call.
|
|
55
77
|
const running = [...this.running].reverse()
|
|
56
78
|
.find(entry => entry.sessionId === undefined || sessionId === undefined || entry.sessionId === key);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
if (running !== undefined) {
|
|
80
|
+
return {
|
|
81
|
+
phase: 'running',
|
|
82
|
+
tool: running.tool,
|
|
83
|
+
since: running.startedAt,
|
|
84
|
+
...(running.tabId === undefined ? {} : { tabId: running.tabId }),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const settled = this.settled.get(key);
|
|
88
|
+
if (settled !== undefined) {
|
|
89
|
+
const hold = settled.ok ? DONE_HOLD_MS : ERROR_HOLD_MS;
|
|
90
|
+
if (Date.now() - settled.at < hold) {
|
|
91
|
+
return {
|
|
92
|
+
phase: settled.ok ? 'done' : 'error',
|
|
93
|
+
tool: settled.tool,
|
|
94
|
+
since: settled.at,
|
|
95
|
+
...(settled.tabId === undefined ? {} : { tabId: settled.tabId }),
|
|
96
|
+
...(settled.detail === undefined ? {} : { detail: settled.detail }),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return { phase: 'ready', since: settled?.at ?? 0 };
|
|
69
101
|
}
|
|
70
102
|
/** Drop every record; the plugin calls this on unload. */
|
|
71
103
|
clear() {
|
|
72
104
|
this.running.length = 0;
|
|
73
|
-
this.
|
|
105
|
+
this.settled.clear();
|
|
74
106
|
}
|
|
75
107
|
}
|
|
76
108
|
/** The tab a call named, as the tracker reads it from frozen arguments. */
|
|
@@ -84,8 +116,13 @@ function sessionIdOf(exec) {
|
|
|
84
116
|
const id = session?.id;
|
|
85
117
|
return typeof id === 'string' && id !== '' ? id : undefined;
|
|
86
118
|
}
|
|
119
|
+
/** A thrown value as one line of text for the chip. */
|
|
120
|
+
function messageOf(error) {
|
|
121
|
+
const text = error instanceof Error ? error.message : String(error);
|
|
122
|
+
return text.replace(/\s+/gu, ' ').trim();
|
|
123
|
+
}
|
|
87
124
|
/**
|
|
88
|
-
* Wrap one tool definition so its execution is visible to the
|
|
125
|
+
* Wrap one tool definition so its execution is visible to the header chip.
|
|
89
126
|
*
|
|
90
127
|
* Every other member is carried over untouched: this adds observation, it does
|
|
91
128
|
* not change what the tool declares or returns.
|
|
@@ -100,10 +137,13 @@ export function withActivity(definition, activity) {
|
|
|
100
137
|
async execute(args, exec) {
|
|
101
138
|
const end = activity.begin(definition.name, tabIdOf(args), sessionIdOf(exec));
|
|
102
139
|
try {
|
|
103
|
-
|
|
140
|
+
const value = await run(args, exec);
|
|
141
|
+
end(true);
|
|
142
|
+
return value;
|
|
104
143
|
}
|
|
105
|
-
|
|
106
|
-
end();
|
|
144
|
+
catch (error) {
|
|
145
|
+
end(false, messageOf(error));
|
|
146
|
+
throw error;
|
|
107
147
|
}
|
|
108
148
|
},
|
|
109
149
|
};
|
package/lib/activity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../src/activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../src/activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAA;AAEjC,sEAAsE;AACtE,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAA;AAElC,6EAA6E;AAC7E,MAAM,YAAY,GAAG,GAAG,CAAA;AAuCxB;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAe;IACT,OAAO,GAAc,EAAE,CAAA;IACvB,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAA;IAErD,yDAAyD;IACjD,MAAM,CAAU,SAAS,GAAG,EAAE,CAAA;IAEtC;;;;;;OAMG;IACH,KAAK,CAAC,IAAY,EAAE,KAAyB,EAAE,SAA6B;QAC1E,MAAM,KAAK,GAAY;YACrB,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;YACzC,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;SAClD,CAAA;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KA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AC,IAAI,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAA;YAC7E,IAAI,CAAC;gBACH,MAAM,KAAK,GAAY,MAAM,GAAG,CAAC,IAAI,EAAE,IAAa,CAAC,CAAA;gBACrD,GAAG,CAAC,IAAI,CAAC,CAAA;gBACT,OAAO,KAAK,CAAA;YACd,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;gBAC5B,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/lib/backend.d.ts
CHANGED
|
@@ -13,6 +13,18 @@ import type { CapturedMessage } from './console-events.ts';
|
|
|
13
13
|
import type { WaitState } from './expressions.ts';
|
|
14
14
|
import { Chrome } from './chrome.ts';
|
|
15
15
|
import type { ResolvedChromeConfig } from './chrome.ts';
|
|
16
|
+
/**
|
|
17
|
+
* What a screenshot should cover.
|
|
18
|
+
*
|
|
19
|
+
* Absent fields mean "the visible viewport", which is what a caller who just
|
|
20
|
+
* wants the page as the user sees it needs.
|
|
21
|
+
*/
|
|
22
|
+
export interface ScreenshotOptions {
|
|
23
|
+
/** Capture the whole scrollable page rather than the viewport. */
|
|
24
|
+
fullPage?: boolean;
|
|
25
|
+
/** Capture one element instead, matched by CSS selector. */
|
|
26
|
+
selector?: string;
|
|
27
|
+
}
|
|
16
28
|
/** One tab as tools and the picker see it. */
|
|
17
29
|
export interface BackendTab {
|
|
18
30
|
id: string;
|
|
@@ -150,7 +162,7 @@ export interface BrowserBackend {
|
|
|
150
162
|
*/
|
|
151
163
|
waitFor(tabId: string, selector: string, state: WaitState, timeoutMs: number): Promise<boolean>;
|
|
152
164
|
type(tabId: string, selector: string, text: string, clear: boolean): Promise<void>;
|
|
153
|
-
screenshot(tabId: string): Promise<{
|
|
165
|
+
screenshot(tabId: string, options?: ScreenshotOptions): Promise<{
|
|
154
166
|
data: string;
|
|
155
167
|
path?: string;
|
|
156
168
|
mime?: string;
|
|
@@ -223,6 +235,17 @@ export declare class ExtensionBackend implements BrowserBackend {
|
|
|
223
235
|
* host process both settle.
|
|
224
236
|
*/
|
|
225
237
|
private reloadAskedFor;
|
|
238
|
+
/**
|
|
239
|
+
* Set when a build the host already asked about came back unchanged.
|
|
240
|
+
*
|
|
241
|
+
* The reload usually works. When it does not, the extension is re-reading a
|
|
242
|
+
* DIFFERENT copy of its files than the one this plugin ships — which happens
|
|
243
|
+
* when the install method changes while the host is running, because the host
|
|
244
|
+
* keeps resolving its old module path while Chrome keeps serving the copy it
|
|
245
|
+
* loaded. No number of reloads can close that, so it is reported rather than
|
|
246
|
+
* retried.
|
|
247
|
+
*/
|
|
248
|
+
private reloadIneffective;
|
|
226
249
|
private seq;
|
|
227
250
|
private readonly unacked;
|
|
228
251
|
/**
|
|
@@ -277,6 +300,9 @@ export declare class ExtensionBackend implements BrowserBackend {
|
|
|
277
300
|
expectedBuild: string;
|
|
278
301
|
stale: boolean;
|
|
279
302
|
autoReloadAsked: boolean;
|
|
303
|
+
reloadAskedFor: string;
|
|
304
|
+
reloadIneffective: boolean;
|
|
305
|
+
ops: string;
|
|
280
306
|
};
|
|
281
307
|
/**
|
|
282
308
|
* Record the extension's self-report, and ask it to reload when it is running
|
|
@@ -334,11 +360,18 @@ export declare class CdpBackend implements BrowserBackend {
|
|
|
334
360
|
select(tabId: string, selector: string, value: string): Promise<SelectOutcome>;
|
|
335
361
|
waitFor(tabId: string, selector: string, state: WaitState, timeoutMs: number): Promise<boolean>;
|
|
336
362
|
type(tabId: string, selector: string, text: string, clear: boolean): Promise<void>;
|
|
337
|
-
screenshot(tabId: string): Promise<{
|
|
363
|
+
screenshot(tabId: string, options?: ScreenshotOptions): Promise<{
|
|
338
364
|
data: string;
|
|
339
365
|
path?: string;
|
|
340
366
|
mime?: string;
|
|
341
367
|
}>;
|
|
368
|
+
/**
|
|
369
|
+
* One element's clip rectangle, or a failure naming the selector.
|
|
370
|
+
* @param endpoint - the tab's CDP endpoint.
|
|
371
|
+
* @param selector - CSS selector of the element to capture.
|
|
372
|
+
* @returns the clip rectangle in page coordinates.
|
|
373
|
+
*/
|
|
374
|
+
private clipOf;
|
|
342
375
|
startConsole(tabId: string): Promise<void>;
|
|
343
376
|
stopConsole(tabId: string): Promise<void>;
|
|
344
377
|
dispose(): void;
|
package/lib/backend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAa1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAa1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAKvD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,8CAA8C;AAC9C,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAA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