@liyuera/dsh-chrome-browser 0.3.0 → 0.5.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.
Files changed (100) hide show
  1. package/README.md +238 -12
  2. package/extension/icons/icon-128.png +0 -0
  3. package/extension/icons/icon-16.png +0 -0
  4. package/extension/icons/icon-32.png +0 -0
  5. package/extension/icons/icon-48.png +0 -0
  6. package/extension/manifest.json +12 -5
  7. package/extension/service-worker.js +772 -70
  8. package/lib/activity.d.ts +65 -0
  9. package/lib/activity.d.ts.map +1 -0
  10. package/lib/activity.js +111 -0
  11. package/lib/activity.js.map +1 -0
  12. package/lib/backend.d.ts +235 -11
  13. package/lib/backend.d.ts.map +1 -1
  14. package/lib/backend.js +429 -40
  15. package/lib/backend.js.map +1 -1
  16. package/lib/cdp.d.ts +7 -1
  17. package/lib/cdp.d.ts.map +1 -1
  18. package/lib/cdp.js +17 -1
  19. package/lib/cdp.js.map +1 -1
  20. package/lib/chrome.d.ts +8 -0
  21. package/lib/chrome.d.ts.map +1 -1
  22. package/lib/chrome.js +20 -0
  23. package/lib/chrome.js.map +1 -1
  24. package/lib/client/BrowserActivity.d.ts +22 -0
  25. package/lib/client/BrowserActivity.d.ts.map +1 -0
  26. package/lib/client/BrowserActivity.js +100 -0
  27. package/lib/client/BrowserActivity.js.map +1 -0
  28. package/lib/client/activity.d.ts +27 -0
  29. package/lib/client/activity.d.ts.map +1 -0
  30. package/lib/client/activity.js +57 -0
  31. package/lib/client/activity.js.map +1 -0
  32. package/lib/client/index.d.ts +4 -6
  33. package/lib/client/index.d.ts.map +1 -1
  34. package/lib/client/index.js +13 -19
  35. package/lib/client/index.js.map +1 -1
  36. package/lib/client/tab-catalog.d.ts +11 -1
  37. package/lib/client/tab-catalog.d.ts.map +1 -1
  38. package/lib/client/tab-catalog.js.map +1 -1
  39. package/lib/client/tab-source.d.ts +8 -2
  40. package/lib/client/tab-source.d.ts.map +1 -1
  41. package/lib/client/tab-source.js.map +1 -1
  42. package/lib/client.js +177 -13
  43. package/lib/client.js.map +1 -1
  44. package/lib/console-events.d.ts +32 -0
  45. package/lib/console-events.d.ts.map +1 -0
  46. package/lib/console-events.js +106 -0
  47. package/lib/console-events.js.map +1 -0
  48. package/lib/console-log.d.ts +107 -0
  49. package/lib/console-log.d.ts.map +1 -0
  50. package/lib/console-log.js +158 -0
  51. package/lib/console-log.js.map +1 -0
  52. package/lib/expressions.d.ts +71 -2
  53. package/lib/expressions.d.ts.map +1 -1
  54. package/lib/expressions.js +277 -14
  55. package/lib/expressions.js.map +1 -1
  56. package/lib/extension-package.d.ts +49 -0
  57. package/lib/extension-package.d.ts.map +1 -1
  58. package/lib/extension-package.js +115 -0
  59. package/lib/extension-package.js.map +1 -1
  60. package/lib/help.d.ts +89 -0
  61. package/lib/help.d.ts.map +1 -0
  62. package/lib/help.js +94 -0
  63. package/lib/help.js.map +1 -0
  64. package/lib/index.d.ts +4 -2
  65. package/lib/index.d.ts.map +1 -1
  66. package/lib/index.js +30 -9
  67. package/lib/index.js.map +1 -1
  68. package/lib/presentation.d.ts +130 -0
  69. package/lib/presentation.d.ts.map +1 -0
  70. package/lib/presentation.js +361 -0
  71. package/lib/presentation.js.map +1 -0
  72. package/lib/routes.d.ts +3 -8
  73. package/lib/routes.d.ts.map +1 -1
  74. package/lib/routes.js +24 -109
  75. package/lib/routes.js.map +1 -1
  76. package/lib/skill.d.ts +50 -0
  77. package/lib/skill.d.ts.map +1 -0
  78. package/lib/skill.js +164 -0
  79. package/lib/skill.js.map +1 -0
  80. package/lib/text.d.ts +21 -0
  81. package/lib/text.d.ts.map +1 -1
  82. package/lib/text.js +18 -0
  83. package/lib/text.js.map +1 -1
  84. package/lib/tools.d.ts +22 -4
  85. package/lib/tools.d.ts.map +1 -1
  86. package/lib/tools.js +493 -75
  87. package/lib/tools.js.map +1 -1
  88. package/lib/ws.d.ts +9 -2
  89. package/lib/ws.d.ts.map +1 -1
  90. package/lib/ws.js +49 -19
  91. package/lib/ws.js.map +1 -1
  92. package/package.json +5 -3
  93. package/lib/bindings.d.ts +0 -23
  94. package/lib/bindings.d.ts.map +0 -1
  95. package/lib/bindings.js +0 -49
  96. package/lib/bindings.js.map +0 -1
  97. package/lib/client/TabPicker.d.ts +0 -54
  98. package/lib/client/TabPicker.d.ts.map +0 -1
  99. package/lib/client/TabPicker.js +0 -329
  100. package/lib/client/TabPicker.js.map +0 -1
@@ -0,0 +1,65 @@
1
+ /**
2
+ * What the plugin is doing right now, for the in-page status strip.
3
+ *
4
+ * The host half is the only place that knows a call is in flight, so it records
5
+ * every tool execution here and serves the snapshot over its own route; the
6
+ * browser half polls that route and renders a strip only while something is
7
+ * running. Nothing is persisted, and nothing crosses into the model's request.
8
+ * @module @liyuera/dsh-chrome-browser/activity
9
+ */
10
+ import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
11
+ /** What one in-flight (or most recent) call looks like to the UI. */
12
+ export interface ActivitySnapshot {
13
+ /** Whether a call is running right now. */
14
+ readonly active: boolean;
15
+ /** Name of the running call, when one is running. */
16
+ readonly tool?: string;
17
+ /** Tab the running call named, when it named one. */
18
+ readonly tabId?: string;
19
+ /** Epoch milliseconds the running call started. */
20
+ readonly startedAt?: number;
21
+ /** Name of the most recently finished call, when one has finished. */
22
+ readonly lastTool?: string;
23
+ /** Epoch milliseconds the most recent call finished. */
24
+ readonly lastAt?: number;
25
+ }
26
+ /** Route-facing view of one snapshot. */
27
+ export type ActivityAnswer = Record<string, string | number | boolean>;
28
+ /**
29
+ * In-flight and last-finished browser calls, keyed by session when the caller
30
+ * has one. A session that has never called anything reports inactive, which is
31
+ * what the strip needs: absence of a call, not absence of a plugin.
32
+ */
33
+ export declare class ActivityTracker {
34
+ private readonly running;
35
+ private readonly finished;
36
+ /** Session key for a caller with no session identity. */
37
+ private static readonly ANONYMOUS;
38
+ /**
39
+ * Record one call as started.
40
+ * @param tool - the tool name.
41
+ * @param tabId - the tab the call named, when it named one.
42
+ * @param sessionId - the calling session, when the execution carried one.
43
+ * @returns the disposer that records the call as finished; idempotent.
44
+ */
45
+ begin(tool: string, tabId: string | undefined, sessionId: string | undefined): () => void;
46
+ /**
47
+ * The current state for one session.
48
+ * @param sessionId - the session to report on; omit for the most recent call in any session.
49
+ * @returns the snapshot the strip renders from.
50
+ */
51
+ snapshot(sessionId?: string): ActivitySnapshot;
52
+ /** Drop every record; the plugin calls this on unload. */
53
+ clear(): void;
54
+ }
55
+ /**
56
+ * Wrap one tool definition so its execution is visible to the status strip.
57
+ *
58
+ * Every other member is carried over untouched: this adds observation, it does
59
+ * not change what the tool declares or returns.
60
+ * @param definition - the registered definition.
61
+ * @param activity - the tracker the browser half reads.
62
+ * @returns an equivalent definition that reports the call.
63
+ */
64
+ export declare function withActivity(definition: ToolDefinition, activity: ActivityTracker): ToolDefinition;
65
+ //# sourceMappingURL=activity.d.ts.map
@@ -0,0 +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,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,qDAAqD;IACrD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,qDAAqD;IACrD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,mDAAmD;IACnD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAUD,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;AAEtE;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkD;IAE3E,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,MAAM,IAAI;IAkBzF;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,gBAAgB;IAoB9C,0DAA0D;IAC1D,KAAK,IAAI,IAAI;CAId;AAeD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,GAAG,cAAc,CAalG"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * What the plugin is doing right now, for the in-page status strip.
3
+ *
4
+ * The host half is the only place that knows a call is in flight, so it records
5
+ * every tool execution here and serves the snapshot over its own route; the
6
+ * browser half polls that route and renders a strip only while something is
7
+ * running. Nothing is persisted, and nothing crosses into the model's request.
8
+ * @module @liyuera/dsh-chrome-browser/activity
9
+ */
10
+ /**
11
+ * In-flight and last-finished browser calls, keyed by session when the caller
12
+ * has one. A session that has never called anything reports inactive, which is
13
+ * what the strip needs: absence of a call, not absence of a plugin.
14
+ */
15
+ export class ActivityTracker {
16
+ running = [];
17
+ finished = new Map();
18
+ /** Session key for a caller with no session identity. */
19
+ static ANONYMOUS = '';
20
+ /**
21
+ * Record one call as started.
22
+ * @param tool - the tool name.
23
+ * @param tabId - the tab the call named, when it named one.
24
+ * @param sessionId - the calling session, when the execution carried one.
25
+ * @returns the disposer that records the call as finished; idempotent.
26
+ */
27
+ begin(tool, tabId, sessionId) {
28
+ const entry = {
29
+ tool,
30
+ startedAt: Date.now(),
31
+ ...(tabId === undefined ? {} : { tabId }),
32
+ ...(sessionId === undefined ? {} : { sessionId }),
33
+ };
34
+ this.running.push(entry);
35
+ let ended = false;
36
+ return () => {
37
+ if (ended)
38
+ return;
39
+ ended = true;
40
+ const at = this.running.indexOf(entry);
41
+ if (at >= 0)
42
+ this.running.splice(at, 1);
43
+ this.finished.set(sessionId ?? ActivityTracker.ANONYMOUS, { tool, at: Date.now() });
44
+ };
45
+ }
46
+ /**
47
+ * The current state for one session.
48
+ * @param sessionId - the session to report on; omit for the most recent call in any session.
49
+ * @returns the snapshot the strip renders from.
50
+ */
51
+ snapshot(sessionId) {
52
+ const key = sessionId ?? ActivityTracker.ANONYMOUS;
53
+ // A call that named no session belongs to whoever is asking: the plugin has
54
+ // one browser, so an unidentified call is still this caller's call.
55
+ const running = [...this.running].reverse()
56
+ .find(entry => entry.sessionId === undefined || sessionId === undefined || entry.sessionId === key);
57
+ const last = this.finished.get(key);
58
+ return {
59
+ active: running !== undefined,
60
+ ...(running === undefined
61
+ ? {}
62
+ : {
63
+ tool: running.tool,
64
+ startedAt: running.startedAt,
65
+ ...(running.tabId === undefined ? {} : { tabId: running.tabId }),
66
+ }),
67
+ ...(last === undefined ? {} : { lastTool: last.tool, lastAt: last.at }),
68
+ };
69
+ }
70
+ /** Drop every record; the plugin calls this on unload. */
71
+ clear() {
72
+ this.running.length = 0;
73
+ this.finished.clear();
74
+ }
75
+ }
76
+ /** The tab a call named, as the tracker reads it from frozen arguments. */
77
+ function tabIdOf(args) {
78
+ const value = args?.tabId;
79
+ return typeof value === 'string' && value !== '' ? value : undefined;
80
+ }
81
+ /** The executing session id, as the tracker reads it from the execution. */
82
+ function sessionIdOf(exec) {
83
+ const session = exec?.agent?.session;
84
+ const id = session?.id;
85
+ return typeof id === 'string' && id !== '' ? id : undefined;
86
+ }
87
+ /**
88
+ * Wrap one tool definition so its execution is visible to the status strip.
89
+ *
90
+ * Every other member is carried over untouched: this adds observation, it does
91
+ * not change what the tool declares or returns.
92
+ * @param definition - the registered definition.
93
+ * @param activity - the tracker the browser half reads.
94
+ * @returns an equivalent definition that reports the call.
95
+ */
96
+ export function withActivity(definition, activity) {
97
+ const run = definition.execute;
98
+ return {
99
+ ...definition,
100
+ async execute(args, exec) {
101
+ const end = activity.begin(definition.name, tabIdOf(args), sessionIdOf(exec));
102
+ try {
103
+ return await run(args, exec);
104
+ }
105
+ finally {
106
+ end();
107
+ }
108
+ },
109
+ };
110
+ }
111
+ //# sourceMappingURL=activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity.js","sourceRoot":"","sources":["../src/activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+BH;;;;GAIG;AACH,MAAM,OAAO,eAAe;IACT,OAAO,GAAc,EAAE,CAAA;IACvB,QAAQ,GAAG,IAAI,GAAG,EAAwC,CAAA;IAE3E,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,KAAK,CAAC,CAAA;QACxB,IAAI,KAAK,GAAG,KAAK,CAAA;QACjB,OAAO,GAAG,EAAE;YACV,IAAI,KAAK;gBAAE,OAAM;YACjB,KAAK,GAAG,IAAI,CAAA;YACZ,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;YACtC,IAAI,EAAE,IAAI,CAA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
  */
11
11
  import type { Duplex } from 'node:stream';
12
+ import type { CapturedMessage } from './console-events.ts';
13
+ import type { WaitState } from './expressions.ts';
12
14
  import { Chrome } from './chrome.ts';
13
15
  import type { ResolvedChromeConfig } from './chrome.ts';
14
16
  /** One tab as tools and the picker see it. */
@@ -26,6 +28,89 @@ export interface BackendRead {
26
28
  text: string;
27
29
  html: string;
28
30
  }
31
+ /** One interactive element, as the page reports it. */
32
+ export interface InteractiveElement {
33
+ /** Selector that addresses this element from the document root. */
34
+ selector: string;
35
+ /** ARIA role, or the tag name when the element declares none. */
36
+ role: string;
37
+ /** Label, text, value or placeholder — whichever the element offers first. */
38
+ name: string;
39
+ /** Whether the element's centre lies inside the viewport. */
40
+ inView: boolean;
41
+ /** Natively disabled, or marked `aria-disabled="true"`. */
42
+ disabled: boolean;
43
+ /** Another element sits at the element's centre, so a real click would miss it. */
44
+ covered: boolean;
45
+ }
46
+ /** What one page's interactive elements are, and how many were left out. */
47
+ export interface BackendInventory {
48
+ /** Page title when the listing was taken. */
49
+ title: string;
50
+ /** Page URL when the listing was taken. */
51
+ url: string;
52
+ /** Elements the inventory selector matched, before the cap. */
53
+ matched: number;
54
+ /** The reported elements, in document order. */
55
+ items: InteractiveElement[];
56
+ }
57
+ /**
58
+ * What one click actually did. `clicked` counts elements that received a
59
+ * dispatched click event — never merely elements the selector matched, which is
60
+ * the distinction a caller needs to tell "the page ignored it" from "nothing
61
+ * was there". The remaining counters explain clicks that were refused or that a
62
+ * real pointer could not have delivered.
63
+ */
64
+ export interface ClickOutcome {
65
+ /** Elements the selector matched. */
66
+ matched: number;
67
+ /** Elements that received a dispatched click event. */
68
+ clicked: number;
69
+ /** Matched elements whose native `disabled` state suppresses the click event. */
70
+ disabled: number;
71
+ /** Clicked elements with no layout box, or `display:none` / `visibility:hidden`. */
72
+ invisible: number;
73
+ /** Clicked elements whose centre lies outside the viewport. */
74
+ offscreen: number;
75
+ /** Clicked elements where a hit test at their centre lands on another element. */
76
+ covered: number;
77
+ /** Clicked elements carrying `aria-disabled="true"`, which dispatches but asks consumers to ignore it. */
78
+ ariaDisabled: number;
79
+ }
80
+ /** Where captured console messages go: the host's bounded per-tab buffer. */
81
+ export type ConsoleSink = (tabId: string, message: CapturedMessage) => void;
82
+ /** What one key press did. */
83
+ export interface PressOutcome {
84
+ /** Whether a target existed: the selector's match, or whatever had focus. */
85
+ found: boolean;
86
+ /** Whether the key events were dispatched. */
87
+ pressed: boolean;
88
+ /**
89
+ * Whether the owning form was submitted explicitly. Synthetic key events
90
+ * trigger no browser default action, so Enter would otherwise do nothing.
91
+ */
92
+ submitted: boolean;
93
+ }
94
+ /** What one `<select>` assignment did. */
95
+ export interface SelectOutcome {
96
+ /** Elements the selector matched. */
97
+ matched: number;
98
+ /** Whether the value actually changed; false means the control was left alone. */
99
+ changed: boolean;
100
+ /** The value in effect after the attempt. */
101
+ value: string;
102
+ /** Values the control offered, so a failed match can name them. */
103
+ options: string[];
104
+ /** Why the control could not be selected, when it is not a `<select>`. */
105
+ reason?: string;
106
+ }
107
+ /** What one hover did. */
108
+ export interface HoverOutcome {
109
+ /** Elements the selector matched. */
110
+ matched: number;
111
+ /** Whether the first match received the hover events. */
112
+ hovered: boolean;
113
+ }
29
114
  /** The face every chrome_* tool speaks to. */
30
115
  export interface BrowserBackend {
31
116
  /** Bring the browser online; throws a user-actionable error when impossible. */
@@ -34,18 +119,71 @@ export interface BrowserBackend {
34
119
  activeTabId(): Promise<string>;
35
120
  listTabs(): Promise<BackendTab[]>;
36
121
  openTab(url: string): Promise<BackendTab>;
122
+ /** Close one tab. Closing the last tab of a window closes that window. */
123
+ closeTab(tabId: string): Promise<void>;
37
124
  read(tabId: string, includeHtml: boolean): Promise<BackendRead>;
125
+ /** List one tab's interactive elements with what a reader must know before acting on them. */
126
+ inventory(tabId: string): Promise<BackendInventory>;
38
127
  navigate(tabId: string, url: string, waitLoad: boolean, waitLoadMs: number): Promise<void>;
128
+ /** Wait for one tab to reach `readyState === "complete"`, or the bound to elapse. */
129
+ waitForLoad(tabId: string, waitLoadMs: number): Promise<void>;
39
130
  evaluate(tabId: string, expression: string): Promise<unknown>;
40
- click(tabId: string, selector: string, all: boolean): Promise<number>;
131
+ /**
132
+ * How the most recent `evaluate` reached the page. `'main'` is the page's own
133
+ * world, where its JavaScript globals live. `'debugger'` is the debugger
134
+ * protocol, taken when the page's Content-Security-Policy forbids `eval` —
135
+ * same semantics, different mechanism, and it shows the debugger infobar on
136
+ * that tab. `chrome_eval` reports the non-default route. Undefined before the
137
+ * first evaluation, and on backends that have only the one route.
138
+ */
139
+ readonly lastEvalWorld: 'main' | 'debugger' | undefined;
140
+ click(tabId: string, selector: string, all: boolean): Promise<ClickOutcome>;
141
+ /** Dispatch hover input on the first element matching the selector. */
142
+ hover(tabId: string, selector: string): Promise<HoverOutcome>;
143
+ /** Press one key on the selector's match, or on whatever currently has focus. */
144
+ press(tabId: string, key: string, selector?: string): Promise<PressOutcome>;
145
+ /** Set a `<select>`'s value. */
146
+ select(tabId: string, selector: string, value: string): Promise<SelectOutcome>;
147
+ /**
148
+ * Poll one element condition until it holds or the bound elapses.
149
+ * @returns whether it held; false means the bound passed, not that the page failed.
150
+ */
151
+ waitFor(tabId: string, selector: string, state: WaitState, timeoutMs: number): Promise<boolean>;
41
152
  type(tabId: string, selector: string, text: string, clear: boolean): Promise<void>;
42
153
  screenshot(tabId: string): Promise<{
43
154
  data: string;
44
155
  path?: string;
45
156
  mime?: string;
46
157
  }>;
158
+ /** Begin forwarding one tab's console output to the sink; idempotent. */
159
+ startConsole(tabId: string): Promise<void>;
160
+ /** Stop forwarding one tab's console output; idempotent. */
161
+ stopConsole(tabId: string): Promise<void>;
47
162
  dispose(): void;
48
163
  }
164
+ /** Read a hover result from the page or the bridge. */
165
+ export declare function mapHover(value: unknown): HoverOutcome;
166
+ /** Read a press result from the page or the bridge. */
167
+ export declare function mapPress(value: unknown): PressOutcome;
168
+ /** Read a select result from the page or the bridge. */
169
+ export declare function mapSelect(value: unknown): SelectOutcome;
170
+ /**
171
+ * Map a click result onto {@link ClickOutcome}. A bare number is accepted as the
172
+ * pre-0.4 bridge's "matched and clicked" count, so a Chrome extension still
173
+ * loaded from an older package keeps working until it is reloaded.
174
+ * @param value - the evaluated page value or the bridge's reply payload.
175
+ * @returns the outcome, with every field defaulted.
176
+ */
177
+ export declare function mapClickOutcome(value: unknown): ClickOutcome;
178
+ /**
179
+ * Map an inventory result from the page or the bridge onto
180
+ * {@link BackendInventory}. An unusable reply becomes an empty inventory rather
181
+ * than an error: the caller asked what it can act on, and "nothing reported" is
182
+ * a truthful answer for a page that would not answer.
183
+ * @param value - the evaluated page value or the bridge's reply payload.
184
+ * @returns the inventory, with unreadable entries dropped.
185
+ */
186
+ export declare function mapInventory(value: unknown): BackendInventory;
49
187
  /**
50
188
  * Extension bridge backend: commands are queued, sent over the bridge
51
189
  * WebSocket, and resolved when the extension replies. The socket is attached
@@ -53,12 +191,17 @@ export interface BrowserBackend {
53
191
  */
54
192
  export declare class ExtensionBackend implements BrowserBackend {
55
193
  private readonly config;
194
+ private readonly onConsole;
195
+ /** @inheritdoc BrowserBackend.lastEvalWorld */
196
+ lastEvalWorld: 'main' | 'debugger' | undefined;
56
197
  /**
57
198
  * Ops a disconnect may transparently retry on the next reconnect: they are
58
- * side-effect free, so a lost result is safe to recompute. Side-effectful
59
- * ops (open/navigate/click/type) are NEVER auto-resent — the caller gets
60
- * the disconnect error and the model retries explicitly (no duplicate
61
- * tabs/clicks/typing from hidden replays).
199
+ * side-effect free or idempotent, so a lost result is safe to recompute.
200
+ * Side-effectful ops (open/navigate/click/type) are NEVER auto-resent — the
201
+ * caller gets the disconnect error and the model retries explicitly (no
202
+ * duplicate tabs/clicks/typing from hidden replays). Console capture is
203
+ * idempotent and the extension re-arms it on reconnect, so retrying it is
204
+ * how a restarted service worker gets its capture back.
62
205
  */
63
206
  private static readonly SAFE_RETRY_OPS;
64
207
  /**
@@ -68,6 +211,18 @@ export declare class ExtensionBackend implements BrowserBackend {
68
211
  */
69
212
  private readonly inFlight;
70
213
  private conn;
214
+ /** What the extension last said about itself; null before its first hello. */
215
+ private extension;
216
+ /**
217
+ * The stale build stamp an automatic reload was last asked for, or null.
218
+ *
219
+ * Keyed by stamp rather than by attempt: a reload that cannot move the
220
+ * extension off one build must never be asked for twice — that would reload
221
+ * it on every heartbeat — while a mismatch at a *different* build is a
222
+ * different problem and deserves its own attempt, so two upgrades within one
223
+ * host process both settle.
224
+ */
225
+ private reloadAskedFor;
71
226
  private seq;
72
227
  private readonly unacked;
73
228
  /**
@@ -77,7 +232,8 @@ export declare class ExtensionBackend implements BrowserBackend {
77
232
  */
78
233
  private readonly pending;
79
234
  private pingTimer;
80
- constructor(config: ResolvedChromeConfig);
235
+ /** Where console messages from the bridge land. */
236
+ constructor(config: ResolvedChromeConfig, onConsole?: ConsoleSink);
81
237
  /** The WS upgrade route calls this after a successful handshake. */
82
238
  attach(socket: Duplex, head: Buffer): void;
83
239
  detach(): void;
@@ -90,44 +246,112 @@ export declare class ExtensionBackend implements BrowserBackend {
90
246
  listTabs(): Promise<BackendTab[]>;
91
247
  openTab(url: string): Promise<BackendTab>;
92
248
  read(tabId: string, includeHtml: boolean): Promise<BackendRead>;
249
+ inventory(tabId: string): Promise<BackendInventory>;
250
+ closeTab(tabId: string): Promise<void>;
93
251
  navigate(tabId: string, url: string, waitLoad: boolean, waitLoadMs: number): Promise<void>;
252
+ waitForLoad(tabId: string, waitLoadMs: number): Promise<void>;
94
253
  evaluate(tabId: string, expression: string): Promise<unknown>;
95
- click(tabId: string, selector: string, all: boolean): Promise<number>;
254
+ click(tabId: string, selector: string, all: boolean): Promise<ClickOutcome>;
255
+ hover(tabId: string, selector: string): Promise<HoverOutcome>;
256
+ press(tabId: string, key: string, selector?: string): Promise<PressOutcome>;
257
+ select(tabId: string, selector: string, value: string): Promise<SelectOutcome>;
258
+ waitFor(tabId: string, selector: string, state: WaitState, timeoutMs: number): Promise<boolean>;
96
259
  type(tabId: string, selector: string, text: string, clear: boolean): Promise<void>;
97
260
  screenshot(tabId: string): Promise<{
98
261
  data: string;
99
262
  path?: string;
100
263
  mime?: string;
101
264
  }>;
265
+ startConsole(tabId: string): Promise<void>;
266
+ stopConsole(tabId: string): Promise<void>;
102
267
  dispose(): void;
268
+ /**
269
+ * What the connected extension reports about itself, for the status route.
270
+ * `stale` means its files are older than the ones this package ships, which
271
+ * only a reload of the extension can fix.
272
+ */
273
+ extensionStatus(): {
274
+ version: string;
275
+ expectedVersion: string;
276
+ build: string;
277
+ expectedBuild: string;
278
+ stale: boolean;
279
+ autoReloadAsked: boolean;
280
+ };
281
+ /**
282
+ * Record the extension's self-report, and ask it to reload when it is running
283
+ * older files than this package ships.
284
+ *
285
+ * Chrome never re-reads an unpacked extension's files, so an upgraded plugin
286
+ * would otherwise keep driving a stale bridge until the user reloaded it by
287
+ * hand. `chrome.runtime.reload()` is the only thing that re-reads them.
288
+ */
289
+ private noteExtensionHello;
290
+ /**
291
+ * Refuse an op the connected extension does not advertise.
292
+ *
293
+ * Sending it anyway earns `unknown op` back — an internal error that says
294
+ * nothing about the real cause, which is an extension whose files are older
295
+ * than the plugin driving it.
296
+ */
297
+ private assertExtensionSupports;
103
298
  private push;
104
299
  private onFrame;
300
+ /**
301
+ * One pushed console batch. Anything unrecognized is dropped rather than
302
+ * throwing: this is a wire boundary, and a malformed event must not kill the
303
+ * connection that carries the commands.
304
+ */
305
+ private onEventFrame;
105
306
  private flush;
106
307
  }
107
308
  /** CDP backend: the Chrome class plus per-tab endpoint operations. */
108
309
  export declare class CdpBackend implements BrowserBackend {
310
+ private readonly onConsole;
311
+ /** @inheritdoc BrowserBackend.lastEvalWorld */
312
+ lastEvalWorld: 'main' | 'debugger' | undefined;
109
313
  private readonly chrome;
110
- constructor(chrome: Chrome);
314
+ /**
315
+ * Long-lived sessions held open for console capture, one per capturing tab.
316
+ * Every other operation opens and closes its own session; capture cannot,
317
+ * because the events arrive between calls.
318
+ */
319
+ private readonly captures;
320
+ constructor(chrome: Chrome, onConsole?: ConsoleSink);
111
321
  ensure(): Promise<void>;
112
322
  activeTabId(): Promise<string>;
113
323
  listTabs(): Promise<BackendTab[]>;
114
324
  openTab(url: string): Promise<BackendTab>;
115
325
  read(tabId: string, includeHtml: boolean): Promise<BackendRead>;
326
+ inventory(tabId: string): Promise<BackendInventory>;
327
+ closeTab(tabId: string): Promise<void>;
116
328
  navigate(tabId: string, url: string, waitLoad: boolean, waitLoadMs: number): Promise<void>;
329
+ waitForLoad(tabId: string, waitLoadMs: number): Promise<void>;
117
330
  evaluate(tabId: string, expression: string): Promise<unknown>;
118
- click(tabId: string, selector: string, all: boolean): Promise<number>;
331
+ click(tabId: string, selector: string, all: boolean): Promise<ClickOutcome>;
332
+ hover(tabId: string, selector: string): Promise<HoverOutcome>;
333
+ press(tabId: string, key: string, selector?: string): Promise<PressOutcome>;
334
+ select(tabId: string, selector: string, value: string): Promise<SelectOutcome>;
335
+ waitFor(tabId: string, selector: string, state: WaitState, timeoutMs: number): Promise<boolean>;
119
336
  type(tabId: string, selector: string, text: string, clear: boolean): Promise<void>;
120
337
  screenshot(tabId: string): Promise<{
121
338
  data: string;
122
339
  path?: string;
123
340
  mime?: string;
124
341
  }>;
342
+ startConsole(tabId: string): Promise<void>;
343
+ stopConsole(tabId: string): Promise<void>;
125
344
  dispose(): void;
126
345
  private withTab;
127
346
  private evaluatePage;
128
347
  }
129
- /** Build the configured backend. */
130
- export declare function buildBackend(config: ResolvedChromeConfig): {
348
+ /**
349
+ * Build the configured backend.
350
+ * @param config - the resolved plugin configuration.
351
+ * @param onConsole - where captured console messages land.
352
+ * @returns the backend, plus the `Chrome` instance the CDP path owns.
353
+ */
354
+ export declare function buildBackend(config: ResolvedChromeConfig, onConsole?: ConsoleSink): {
131
355
  backend: BrowserBackend;
132
356
  chrome?: Chrome;
133
357
  };
@@ -1 +1 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA;;;;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