lobster-cli 0.1.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 (45) hide show
  1. package/README.md +389 -0
  2. package/dist/agent/core.js +1013 -0
  3. package/dist/agent/core.js.map +1 -0
  4. package/dist/agent/index.js +1027 -0
  5. package/dist/agent/index.js.map +1 -0
  6. package/dist/brain/index.js +60 -0
  7. package/dist/brain/index.js.map +1 -0
  8. package/dist/browser/dom/index.js +1096 -0
  9. package/dist/browser/dom/index.js.map +1 -0
  10. package/dist/browser/index.js +2034 -0
  11. package/dist/browser/index.js.map +1 -0
  12. package/dist/browser/manager.js +86 -0
  13. package/dist/browser/manager.js.map +1 -0
  14. package/dist/browser/page-adapter.js +1345 -0
  15. package/dist/browser/page-adapter.js.map +1 -0
  16. package/dist/cascade/index.js +138 -0
  17. package/dist/cascade/index.js.map +1 -0
  18. package/dist/config/index.js +110 -0
  19. package/dist/config/index.js.map +1 -0
  20. package/dist/config/schema.js +66 -0
  21. package/dist/config/schema.js.map +1 -0
  22. package/dist/discover/index.js +545 -0
  23. package/dist/discover/index.js.map +1 -0
  24. package/dist/index.js +5529 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/lib.js +4206 -0
  27. package/dist/lib.js.map +1 -0
  28. package/dist/llm/client.js +379 -0
  29. package/dist/llm/client.js.map +1 -0
  30. package/dist/llm/index.js +397 -0
  31. package/dist/llm/index.js.map +1 -0
  32. package/dist/llm/openai-client.js +214 -0
  33. package/dist/llm/openai-client.js.map +1 -0
  34. package/dist/output/index.js +93 -0
  35. package/dist/output/index.js.map +1 -0
  36. package/dist/pipeline/index.js +802 -0
  37. package/dist/pipeline/index.js.map +1 -0
  38. package/dist/router/decision.js +80 -0
  39. package/dist/router/decision.js.map +1 -0
  40. package/dist/router/index.js +3443 -0
  41. package/dist/router/index.js.map +1 -0
  42. package/dist/types/index.js +23 -0
  43. package/dist/types/index.js.map +1 -0
  44. package/logo.svg +11 -0
  45. package/package.json +65 -0
@@ -0,0 +1,1096 @@
1
+ // src/browser/dom/flat-tree.ts
2
+ var FLAT_TREE_SCRIPT = `
3
+ (() => {
4
+ const INTERACTIVE_TAGS = new Set([
5
+ 'a', 'button', 'input', 'select', 'textarea', 'details', 'summary',
6
+ 'label', 'option', 'fieldset', 'legend',
7
+ ]);
8
+
9
+ const INTERACTIVE_ROLES = new Set([
10
+ 'button', 'link', 'textbox', 'checkbox', 'radio', 'combobox',
11
+ 'listbox', 'menu', 'menuitem', 'tab', 'switch', 'slider',
12
+ 'searchbox', 'spinbutton', 'option', 'menuitemcheckbox', 'menuitemradio',
13
+ ]);
14
+
15
+ const ATTR_WHITELIST = [
16
+ 'type', 'role', 'aria-label', 'aria-expanded', 'aria-selected',
17
+ 'aria-checked', 'aria-disabled', 'placeholder', 'title', 'href',
18
+ 'value', 'name', 'alt', 'src',
19
+ ];
20
+
21
+ let highlightIndex = 0;
22
+ const nodes = {};
23
+ const selectorMap = {};
24
+
25
+ function isVisible(el) {
26
+ if (el.offsetWidth === 0 && el.offsetHeight === 0) return false;
27
+ const style = getComputedStyle(el);
28
+ if (style.display === 'none' || style.visibility === 'hidden' || style.opacity === '0') return false;
29
+ return true;
30
+ }
31
+
32
+ function isInteractive(el) {
33
+ const tag = el.tagName.toLowerCase();
34
+ if (INTERACTIVE_TAGS.has(tag)) return true;
35
+ const role = el.getAttribute('role');
36
+ if (role && INTERACTIVE_ROLES.has(role)) return true;
37
+ if (el.getAttribute('contenteditable') === 'true') return true;
38
+ if (el.getAttribute('tabindex') !== null && parseInt(el.getAttribute('tabindex')) >= 0) return true;
39
+ if (el.onclick || el.getAttribute('onclick')) return true;
40
+ return false;
41
+ }
42
+
43
+ function getAttributes(el) {
44
+ const attrs = {};
45
+ for (const attr of ATTR_WHITELIST) {
46
+ const val = el.getAttribute(attr);
47
+ if (val !== null && val !== '') attrs[attr] = val;
48
+ }
49
+ return attrs;
50
+ }
51
+
52
+ function getScrollable(el) {
53
+ const style = getComputedStyle(el);
54
+ const overflowY = style.overflowY;
55
+ const overflowX = style.overflowX;
56
+ const isScrollableY = (overflowY === 'auto' || overflowY === 'scroll') && el.scrollHeight > el.clientHeight;
57
+ const isScrollableX = (overflowX === 'auto' || overflowX === 'scroll') && el.scrollWidth > el.clientWidth;
58
+ if (!isScrollableY && !isScrollableX) return null;
59
+ return {
60
+ left: el.scrollLeft,
61
+ top: el.scrollTop,
62
+ right: el.scrollWidth - el.clientWidth - el.scrollLeft,
63
+ bottom: el.scrollHeight - el.clientHeight - el.scrollTop,
64
+ };
65
+ }
66
+
67
+ function walk(el, parentId) {
68
+ if (!el || el.nodeType === 8) return; // skip comments
69
+
70
+ if (el.nodeType === 3) { // text node
71
+ const text = el.textContent.trim();
72
+ if (!text) return;
73
+ const id = 'text_' + Math.random().toString(36).slice(2, 8);
74
+ nodes[id] = { id, tagName: '#text', text, parentId };
75
+ if (parentId && nodes[parentId]) {
76
+ nodes[parentId].children = nodes[parentId].children || [];
77
+ nodes[parentId].children.push(id);
78
+ }
79
+ return;
80
+ }
81
+
82
+ if (el.nodeType !== 1) return; // only elements
83
+
84
+ const tag = el.tagName.toLowerCase();
85
+ if (['script', 'style', 'noscript', 'svg', 'path'].includes(tag)) return;
86
+ if (!isVisible(el)) return;
87
+
88
+ const id = tag + '_' + Math.random().toString(36).slice(2, 8);
89
+ const interactive = isInteractive(el);
90
+ const node = {
91
+ id,
92
+ tagName: tag,
93
+ attributes: getAttributes(el),
94
+ parentId,
95
+ children: [],
96
+ isInteractive: interactive,
97
+ };
98
+
99
+ if (interactive) {
100
+ node.highlightIndex = highlightIndex;
101
+ selectorMap[highlightIndex] = id;
102
+ highlightIndex++;
103
+ }
104
+
105
+ const scrollable = getScrollable(el);
106
+ if (scrollable) node.scrollable = scrollable;
107
+
108
+ const text = [];
109
+ for (const child of el.childNodes) {
110
+ if (child.nodeType === 3 && child.textContent.trim()) {
111
+ text.push(child.textContent.trim());
112
+ }
113
+ }
114
+ if (text.length > 0) node.text = text.join(' ').slice(0, 200);
115
+
116
+ nodes[id] = node;
117
+
118
+ if (parentId && nodes[parentId]) {
119
+ nodes[parentId].children.push(id);
120
+ }
121
+
122
+ for (const child of el.children) {
123
+ walk(child, id);
124
+ }
125
+ }
126
+
127
+ const rootId = 'root';
128
+ nodes[rootId] = { id: rootId, tagName: 'body', children: [], attributes: {} };
129
+ for (const child of document.body.children) {
130
+ walk(child, rootId);
131
+ }
132
+
133
+ return { rootId, map: nodes, selectorMap };
134
+ })()
135
+ `;
136
+ function flatTreeToString(tree) {
137
+ const lines = [];
138
+ function walk(nodeId, depth) {
139
+ const node = tree.map[nodeId];
140
+ if (!node) return;
141
+ const indent = " ".repeat(depth);
142
+ if (node.tagName === "#text") {
143
+ if (node.text) lines.push(`${indent}${node.text}`);
144
+ return;
145
+ }
146
+ const attrs = node.attributes || {};
147
+ const attrStr = Object.entries(attrs).map(([k, v]) => v === "" ? k : `${k}="${v}"`).join(" ");
148
+ const prefix = node.highlightIndex !== void 0 ? `[${node.highlightIndex}]` : "";
149
+ const scrollInfo = node.scrollable ? ` |scroll: ${Math.round(node.scrollable.top)}px up, ${Math.round(node.scrollable.bottom)}px down|` : "";
150
+ const text = node.text || "";
151
+ const tag = node.tagName;
152
+ if (prefix || text || node.children?.length > 0) {
153
+ const opening = `${indent}${prefix}<${tag}${attrStr ? " " + attrStr : ""}${scrollInfo}>`;
154
+ if (!node.children?.length || node.children.length === 0 && text) {
155
+ lines.push(`${opening}${text}</>`);
156
+ } else {
157
+ lines.push(`${opening}${text}`);
158
+ for (const childId of node.children || []) {
159
+ walk(childId, depth + 1);
160
+ }
161
+ }
162
+ } else {
163
+ for (const childId of node.children || []) {
164
+ walk(childId, depth);
165
+ }
166
+ }
167
+ }
168
+ walk(tree.rootId, 0);
169
+ return lines.join("\n");
170
+ }
171
+
172
+ // src/browser/dom/snapshot.ts
173
+ function buildSnapshotScript(previousHashes) {
174
+ return SNAPSHOT_SCRIPT_FN(previousHashes || []);
175
+ }
176
+ function SNAPSHOT_SCRIPT_FN(prevHashes) {
177
+ return `
178
+ (() => {
179
+ let idx = 0;
180
+ const __prevHashes = new Set(${JSON.stringify(prevHashes)});
181
+ const __currentHashes = [];
182
+ `;
183
+ }
184
+ var SNAPSHOT_SCRIPT = `
185
+ (() => {
186
+ let idx = 0;
187
+ const __prevHashes = (window.__lobster_prev_hashes) ? new Set(window.__lobster_prev_hashes) : null;
188
+ const __currentHashes = [];
189
+
190
+ const SKIP_TAGS = new Set([
191
+ 'script','style','noscript','svg','path','meta','link','head',
192
+ 'template','slot','colgroup','col',
193
+ ]);
194
+
195
+ const INTERACTIVE_TAGS = new Set([
196
+ 'a','button','input','select','textarea','details','summary','label',
197
+ ]);
198
+
199
+ const INTERACTIVE_ROLES = new Set([
200
+ 'button','link','textbox','checkbox','radio','combobox','listbox',
201
+ 'menu','menuitem','tab','switch','slider','searchbox','spinbutton',
202
+ 'option','menuitemcheckbox','menuitemradio','treeitem',
203
+ ]);
204
+
205
+ const ATTR_WHITELIST = [
206
+ 'type','role','aria-label','aria-expanded','aria-selected','aria-checked',
207
+ 'aria-disabled','aria-haspopup','aria-pressed','placeholder','title',
208
+ 'href','value','name','alt','src','action','method','for',
209
+ 'data-testid','data-id','contenteditable','tabindex',
210
+ ];
211
+
212
+ const AD_PATTERNS = /ad[-_]?banner|ad[-_]?container|google[-_]?ad|doubleclick|adsbygoogle|sponsored|^ad$/i;
213
+
214
+ // \u2500\u2500 Stage 1: Visibility check \u2500\u2500
215
+ function isVisible(el) {
216
+ if (el.offsetWidth === 0 && el.offsetHeight === 0 && el.tagName !== 'INPUT') return false;
217
+ const s = getComputedStyle(el);
218
+ if (s.display === 'none') return false;
219
+ if (s.visibility === 'hidden' || s.visibility === 'collapse') return false;
220
+ if (s.opacity === '0') return false;
221
+ if (s.clipPath === 'inset(100%)') return false;
222
+ // Check for offscreen positioning
223
+ const rect = el.getBoundingClientRect();
224
+ if (rect.right < 0 || rect.bottom < 0) return false;
225
+ return true;
226
+ }
227
+
228
+ // \u2500\u2500 Stage 2: Interactive detection \u2500\u2500
229
+ function isInteractive(el) {
230
+ const tag = el.tagName.toLowerCase();
231
+ if (INTERACTIVE_TAGS.has(tag)) {
232
+ // Skip disabled elements
233
+ if (el.disabled) return false;
234
+ // Skip hidden inputs
235
+ if (tag === 'input' && el.type === 'hidden') return false;
236
+ return true;
237
+ }
238
+ const role = el.getAttribute('role');
239
+ if (role && INTERACTIVE_ROLES.has(role)) return true;
240
+ if (el.contentEditable === 'true') return true;
241
+ if (el.tabIndex >= 0 && el.getAttribute('tabindex') !== null) return true;
242
+ if (el.onclick) return true;
243
+ return false;
244
+ }
245
+
246
+ // \u2500\u2500 Stage 8: Attribute filtering \u2500\u2500
247
+ function getAttrs(el) {
248
+ const parts = [];
249
+ for (const name of ATTR_WHITELIST) {
250
+ let v = el.getAttribute(name);
251
+ if (v === null || v === '') continue;
252
+ // Truncate long values
253
+ if (v.length > 80) v = v.slice(0, 77) + '...';
254
+ // Skip href="javascript:..."
255
+ if (name === 'href' && v.startsWith('javascript:')) continue;
256
+ parts.push(name + '=' + v);
257
+ }
258
+ return parts.length ? ' ' + parts.join(' ') : '';
259
+ }
260
+
261
+ // \u2500\u2500 Stage 9: Ad filtering \u2500\u2500
262
+ function isAd(el) {
263
+ const id = el.id || '';
264
+ const cls = el.className || '';
265
+ if (typeof cls === 'string' && AD_PATTERNS.test(cls)) return true;
266
+ if (AD_PATTERNS.test(id)) return true;
267
+ if (el.tagName === 'IFRAME' && AD_PATTERNS.test(el.src || '')) return true;
268
+ return false;
269
+ }
270
+
271
+ // \u2500\u2500 Stage 10: Scroll info \u2500\u2500
272
+ function getScrollInfo(el) {
273
+ const s = getComputedStyle(el);
274
+ const overflowY = s.overflowY;
275
+ const overflowX = s.overflowX;
276
+ const scrollableY = (overflowY === 'auto' || overflowY === 'scroll') && el.scrollHeight > el.clientHeight;
277
+ const scrollableX = (overflowX === 'auto' || overflowX === 'scroll') && el.scrollWidth > el.clientWidth;
278
+ if (!scrollableY && !scrollableX) return '';
279
+
280
+ const parts = [];
281
+ if (scrollableY) {
282
+ const up = Math.round(el.scrollTop);
283
+ const down = Math.round(el.scrollHeight - el.clientHeight - el.scrollTop);
284
+ if (up > 0) parts.push(up + 'px up');
285
+ if (down > 0) parts.push(down + 'px down');
286
+ }
287
+ if (scrollableX) {
288
+ const left = Math.round(el.scrollLeft);
289
+ const right = Math.round(el.scrollWidth - el.clientWidth - el.scrollLeft);
290
+ if (left > 0) parts.push(left + 'px left');
291
+ if (right > 0) parts.push(right + 'px right');
292
+ }
293
+ return parts.length ? ' |scroll: ' + parts.join(', ') + '|' : '';
294
+ }
295
+
296
+ // \u2500\u2500 Stage 6: Bounding-box dedup \u2500\u2500
297
+ // If a parent and child are both interactive and have ~same bounding box,
298
+ // skip the parent (e.g., <a><button>Click</button></a>)
299
+ function isWrappingInteractive(el) {
300
+ if (!isInteractive(el)) return false;
301
+ const rect = el.getBoundingClientRect();
302
+ if (rect.width === 0 || rect.height === 0) return false;
303
+ for (const child of el.children) {
304
+ if (!isInteractive(child)) continue;
305
+ const cr = child.getBoundingClientRect();
306
+ const overlapX = Math.min(rect.right, cr.right) - Math.max(rect.left, cr.left);
307
+ const overlapY = Math.min(rect.bottom, cr.bottom) - Math.max(rect.top, cr.top);
308
+ const overlapArea = Math.max(0, overlapX) * Math.max(0, overlapY);
309
+ const parentArea = rect.width * rect.height;
310
+ if (parentArea > 0 && overlapArea / parentArea > 0.85) return true;
311
+ }
312
+ return false;
313
+ }
314
+
315
+ // \u2500\u2500 Stage 7: Occlusion detection \u2500\u2500
316
+ function isOccluded(el) {
317
+ const rect = el.getBoundingClientRect();
318
+ if (rect.width === 0 || rect.height === 0) return false;
319
+ const cx = rect.left + rect.width / 2;
320
+ const cy = rect.top + rect.height / 2;
321
+ const topEl = document.elementFromPoint(cx, cy);
322
+ if (!topEl) return false;
323
+ if (topEl === el || el.contains(topEl) || topEl.contains(el)) return false;
324
+ // Check z-index \u2014 if top element is a modal/overlay, mark as occluded
325
+ const topZ = parseInt(getComputedStyle(topEl).zIndex) || 0;
326
+ const elZ = parseInt(getComputedStyle(el).zIndex) || 0;
327
+ return topZ > elZ + 10;
328
+ }
329
+
330
+ // \u2500\u2500 Stage 5: Iframe content extraction \u2500\u2500
331
+ function getIframeContent(iframe, depth, maxDepth) {
332
+ try {
333
+ const doc = iframe.contentDocument;
334
+ if (!doc || !doc.body) return '';
335
+ return '\\n' + walkNode(doc.body, depth, maxDepth);
336
+ } catch { return ''; }
337
+ }
338
+
339
+ // \u2500\u2500 Stage 4: Shadow DOM traversal \u2500\u2500
340
+ function getShadowContent(el, depth, maxDepth) {
341
+ if (!el.shadowRoot) return '';
342
+ let out = '';
343
+ for (const child of el.shadowRoot.childNodes) {
344
+ out += walkNode(child, depth, maxDepth);
345
+ }
346
+ return out;
347
+ }
348
+
349
+ // \u2500\u2500 Input value hint \u2500\u2500
350
+ function getInputHint(el) {
351
+ const tag = el.tagName.toLowerCase();
352
+ if (tag === 'input') {
353
+ const type = el.type || 'text';
354
+ const val = el.value || '';
355
+ const checked = el.checked;
356
+ if (type === 'checkbox' || type === 'radio') {
357
+ return checked ? ' [checked]' : ' [unchecked]';
358
+ }
359
+ if (val) return ' value="' + val.slice(0, 50) + '"';
360
+ }
361
+ if (tag === 'textarea' && el.value) {
362
+ return ' value="' + el.value.slice(0, 50) + '"';
363
+ }
364
+ if (tag === 'select' && el.selectedOptions?.length) {
365
+ return ' selected="' + el.selectedOptions[0].text.slice(0, 40) + '"';
366
+ }
367
+ return '';
368
+ }
369
+
370
+ const MAX_DEPTH = 25;
371
+ const MAX_TEXT = 150;
372
+
373
+ function walkNode(node, depth, maxDepth) {
374
+ if (depth > maxDepth) return '';
375
+ if (!node) return '';
376
+
377
+ // Text node
378
+ if (node.nodeType === 3) {
379
+ const t = node.textContent.trim();
380
+ if (!t) return '';
381
+ const text = t.length > MAX_TEXT ? t.slice(0, MAX_TEXT) + '...' : t;
382
+ return ' '.repeat(depth) + text + '\\n';
383
+ }
384
+
385
+ // Comment node \u2014 skip
386
+ if (node.nodeType === 8) return '';
387
+
388
+ // Only element nodes from here
389
+ if (node.nodeType !== 1) return '';
390
+
391
+ const el = node;
392
+ const tag = el.tagName.toLowerCase();
393
+
394
+ // \u2500\u2500 Stage 3: Skip tags \u2500\u2500
395
+ if (SKIP_TAGS.has(tag)) return '';
396
+
397
+ // \u2500\u2500 Stage 2: Visibility \u2500\u2500
398
+ if (!isVisible(el)) return '';
399
+
400
+ // \u2500\u2500 Stage 9: Ad filtering \u2500\u2500
401
+ if (isAd(el)) return '';
402
+
403
+ // \u2500\u2500 Stage 6: Bbox dedup \u2014 skip wrapping interactive parent \u2500\u2500
404
+ const skipSelf = isWrappingInteractive(el);
405
+
406
+ const indent = ' '.repeat(depth);
407
+ const inter = !skipSelf && isInteractive(el);
408
+ let prefix = '';
409
+ if (inter) {
410
+ const thisIdx = idx++;
411
+ // Hash: tag + text + key attributes for diff tracking
412
+ const hashText = tag + ':' + (el.textContent || '').trim().slice(0, 40) + ':' + (el.getAttribute('href') || '') + ':' + (el.getAttribute('aria-label') || '');
413
+ __currentHashes.push(hashText);
414
+ const isNew = __prevHashes && __prevHashes.size > 0 && !__prevHashes.has(hashText);
415
+ prefix = isNew ? '*[' + thisIdx + ']' : '[' + thisIdx + ']';
416
+ }
417
+
418
+ // \u2500\u2500 Stage 11: Annotate with data-ref \u2500\u2500
419
+ if (inter) {
420
+ try { el.dataset.ref = String(idx - 1); } catch {}
421
+ }
422
+
423
+ // \u2500\u2500 Stage 7: Occlusion check for interactive elements \u2500\u2500
424
+ if (inter && isOccluded(el)) {
425
+ // Still include but mark as occluded
426
+ // (agent needs to know element exists but may need to scroll/close modal)
427
+ }
428
+
429
+ const a = getAttrs(el);
430
+ const scrollInfo = getScrollInfo(el);
431
+ const inputHint = inter ? getInputHint(el) : '';
432
+
433
+ // Leaf text extraction
434
+ let leafText = '';
435
+ if (el.childNodes.length === 1 && el.childNodes[0].nodeType === 3) {
436
+ const t = el.childNodes[0].textContent.trim();
437
+ if (t) leafText = t.length > MAX_TEXT ? t.slice(0, MAX_TEXT) + '...' : t;
438
+ }
439
+
440
+ // \u2500\u2500 Stage 5: Iframe \u2500\u2500
441
+ if (tag === 'iframe') {
442
+ const iframeContent = getIframeContent(el, depth + 1, maxDepth);
443
+ if (iframeContent) {
444
+ return indent + prefix + '<iframe' + a + '>\\n' + iframeContent;
445
+ }
446
+ return '';
447
+ }
448
+
449
+ // Build output
450
+ let out = '';
451
+
452
+ if (skipSelf) {
453
+ // Skip self but render children
454
+ for (const c of el.childNodes) out += walkNode(c, depth, maxDepth);
455
+ out += getShadowContent(el, depth, maxDepth);
456
+ return out;
457
+ }
458
+
459
+ if (inter || leafText || el.children.length === 0) {
460
+ if (leafText) {
461
+ out = indent + prefix + '<' + tag + a + scrollInfo + inputHint + '>' + leafText + '</' + tag + '>\\n';
462
+ } else {
463
+ out = indent + prefix + '<' + tag + a + scrollInfo + inputHint + '>\\n';
464
+ for (const c of el.childNodes) out += walkNode(c, depth + 1, maxDepth);
465
+ out += getShadowContent(el, depth + 1, maxDepth);
466
+ }
467
+ } else {
468
+ // Non-interactive container \u2014 flatten depth if no useful info
469
+ if (scrollInfo) {
470
+ out = indent + '<' + tag + scrollInfo + '>\\n';
471
+ for (const c of el.childNodes) out += walkNode(c, depth + 1, maxDepth);
472
+ out += getShadowContent(el, depth + 1, maxDepth);
473
+ } else {
474
+ for (const c of el.childNodes) out += walkNode(c, depth, maxDepth);
475
+ out += getShadowContent(el, depth, maxDepth);
476
+ }
477
+ }
478
+
479
+ return out;
480
+ }
481
+
482
+ // \u2500\u2500 Page-level scroll info header \u2500\u2500
483
+ const scrollY = window.scrollY;
484
+ const scrollMax = document.documentElement.scrollHeight - window.innerHeight;
485
+ const scrollPct = scrollMax > 0 ? Math.round((scrollY / scrollMax) * 100) : 0;
486
+ const vpW = window.innerWidth;
487
+ const vpH = window.innerHeight;
488
+ const pageH = document.documentElement.scrollHeight;
489
+
490
+ let header = '';
491
+ header += 'viewport: ' + vpW + 'x' + vpH + ' | page_height: ' + pageH + 'px';
492
+ header += ' | scroll: ' + scrollPct + '%';
493
+ if (scrollY > 50) header += ' (' + Math.round(scrollY) + 'px from top)';
494
+ if (scrollMax - scrollY > 50) header += ' (' + Math.round(scrollMax - scrollY) + 'px more below)';
495
+ header += '\\n---\\n';
496
+
497
+ // Store current hashes for next diff comparison
498
+ window.__lobster_prev_hashes = __currentHashes;
499
+
500
+ return header + walkNode(document.body, 0, MAX_DEPTH);
501
+ })()
502
+ `;
503
+
504
+ // src/browser/dom/semantic-tree.ts
505
+ var SEMANTIC_TREE_SCRIPT = `
506
+ (() => {
507
+ const SKIP = new Set(['script','style','noscript','svg','head','meta','link','template']);
508
+
509
+ const ROLE_MAP = {
510
+ a: 'link', button: 'button', input: 'textbox', select: 'combobox',
511
+ textarea: 'textbox', h1: 'heading', h2: 'heading', h3: 'heading',
512
+ h4: 'heading', h5: 'heading', h6: 'heading', nav: 'navigation',
513
+ main: 'main', header: 'banner', footer: 'contentinfo', aside: 'complementary',
514
+ form: 'form', table: 'table', img: 'img', ul: 'list', ol: 'list', li: 'listitem',
515
+ section: 'region', article: 'article', dialog: 'dialog', details: 'group',
516
+ summary: 'button', progress: 'progressbar', meter: 'meter', output: 'status',
517
+ label: 'label', legend: 'legend', fieldset: 'group', option: 'option',
518
+ tr: 'row', td: 'cell', th: 'columnheader', caption: 'caption',
519
+ };
520
+
521
+ const INTERACTIVE_ROLES = new Set([
522
+ 'button','link','textbox','checkbox','radio','combobox','listbox',
523
+ 'menu','menuitem','tab','switch','slider','searchbox','spinbutton',
524
+ 'option','menuitemcheckbox','menuitemradio','treeitem',
525
+ ]);
526
+
527
+ // \u2500\u2500 W3C Accessible Name Algorithm (simplified) \u2500\u2500
528
+ function getAccessibleName(el) {
529
+ // 1. aria-labelledby (highest priority)
530
+ const labelledBy = el.getAttribute('aria-labelledby');
531
+ if (labelledBy) {
532
+ const ids = labelledBy.split(/\\s+/);
533
+ const parts = ids.map(id => {
534
+ const ref = document.getElementById(id);
535
+ return ref ? ref.textContent.trim() : '';
536
+ }).filter(Boolean);
537
+ if (parts.length > 0) return parts.join(' ').slice(0, 120);
538
+ }
539
+
540
+ // 2. aria-label
541
+ const ariaLabel = el.getAttribute('aria-label');
542
+ if (ariaLabel) return ariaLabel.slice(0, 120);
543
+
544
+ // 3. alt (for images)
545
+ const alt = el.getAttribute('alt');
546
+ if (alt) return alt.slice(0, 120);
547
+
548
+ // 4. title
549
+ const title = el.getAttribute('title');
550
+ if (title) return title.slice(0, 120);
551
+
552
+ // 5. placeholder (for inputs)
553
+ const placeholder = el.getAttribute('placeholder');
554
+ if (placeholder) return placeholder.slice(0, 120);
555
+
556
+ // 6. value (for buttons)
557
+ if (el.tagName === 'INPUT' && (el.type === 'submit' || el.type === 'button')) {
558
+ const val = el.getAttribute('value');
559
+ if (val) return val.slice(0, 120);
560
+ }
561
+
562
+ // 7. Associated label
563
+ if (el.id) {
564
+ const label = document.querySelector('label[for="' + el.id + '"]');
565
+ if (label) return label.textContent.trim().slice(0, 120);
566
+ }
567
+
568
+ // 8. Direct text content (only for leaf-ish elements)
569
+ if (el.children.length <= 2) {
570
+ const text = el.textContent.trim();
571
+ if (text && text.length < 120) return text;
572
+ }
573
+
574
+ return '';
575
+ }
576
+
577
+ // \u2500\u2500 XPath generation \u2500\u2500
578
+ function getXPath(el) {
579
+ const parts = [];
580
+ let current = el;
581
+ while (current && current.nodeType === 1) {
582
+ let index = 1;
583
+ let sibling = current.previousElementSibling;
584
+ while (sibling) {
585
+ if (sibling.tagName === current.tagName) index++;
586
+ sibling = sibling.previousElementSibling;
587
+ }
588
+ const tag = current.tagName.toLowerCase();
589
+ parts.unshift(tag + '[' + index + ']');
590
+ current = current.parentElement;
591
+ }
592
+ return '/' + parts.join('/');
593
+ }
594
+
595
+ // \u2500\u2500 Interactivity classification \u2500\u2500
596
+ function classifyInteractivity(el) {
597
+ const types = [];
598
+ const tag = el.tagName.toLowerCase();
599
+
600
+ // Native
601
+ if (['a','button','input','select','textarea','details','summary'].includes(tag)) {
602
+ if (tag === 'a' && !el.href) {} // anchor without href is not interactive
603
+ else if (tag === 'input' && el.type === 'hidden') {} // hidden inputs
604
+ else types.push('native');
605
+ }
606
+
607
+ // ARIA role
608
+ const role = el.getAttribute('role');
609
+ if (role && INTERACTIVE_ROLES.has(role)) types.push('aria');
610
+
611
+ // Contenteditable
612
+ if (el.contentEditable === 'true') types.push('contenteditable');
613
+
614
+ // Focusable
615
+ if (el.tabIndex >= 0 && el.getAttribute('tabindex') !== null) types.push('focusable');
616
+
617
+ // Event listeners (check onclick and common inline handlers)
618
+ if (el.onclick || el.onmousedown || el.onkeydown || el.onkeypress ||
619
+ el.getAttribute('onclick') || el.getAttribute('onmousedown')) {
620
+ types.push('listener');
621
+ }
622
+
623
+ return types;
624
+ }
625
+
626
+ // \u2500\u2500 Disabled state with fieldset inheritance \u2500\u2500
627
+ function isDisabled(el) {
628
+ if (el.disabled) return true;
629
+ // Check fieldset disabled inheritance
630
+ let parent = el.parentElement;
631
+ while (parent) {
632
+ if (parent.tagName === 'FIELDSET' && parent.disabled) {
633
+ // Exception: elements inside the first legend child are NOT disabled
634
+ const firstLegend = parent.querySelector(':scope > legend');
635
+ if (firstLegend && firstLegend.contains(el)) return false;
636
+ return true;
637
+ }
638
+ parent = parent.parentElement;
639
+ }
640
+ return false;
641
+ }
642
+
643
+ // \u2500\u2500 Walk the DOM \u2500\u2500
644
+ function walk(el, depth, maxDepth) {
645
+ if (!el || depth > maxDepth) return '';
646
+
647
+ if (el.nodeType === 3) {
648
+ const t = el.textContent.trim();
649
+ return t ? ' '.repeat(depth) + 'text "' + t.slice(0, 100) + '"\\n' : '';
650
+ }
651
+
652
+ if (el.nodeType !== 1) return '';
653
+ const tag = el.tagName.toLowerCase();
654
+ if (SKIP.has(tag)) return '';
655
+
656
+ const style = getComputedStyle(el);
657
+ if (style.display === 'none' || style.visibility === 'hidden') return '';
658
+
659
+ const indent = ' '.repeat(depth);
660
+ const role = el.getAttribute('role') || ROLE_MAP[tag] || '';
661
+ const name = getAccessibleName(el);
662
+ const interTypes = classifyInteractivity(el);
663
+ const interactive = interTypes.length > 0;
664
+ const disabled = interactive && isDisabled(el);
665
+
666
+ let line = indent;
667
+ line += role || tag;
668
+
669
+ if (name) line += ' "' + name.slice(0, 80) + '"';
670
+
671
+ if (interactive) {
672
+ line += ' [' + interTypes.join(',') + ']';
673
+ if (disabled) line += ' {disabled}';
674
+ line += ' xpath=' + getXPath(el);
675
+ }
676
+
677
+ // Input state
678
+ if (tag === 'input') {
679
+ const type = el.type || 'text';
680
+ line += ' type=' + type;
681
+ if (type === 'checkbox' || type === 'radio') {
682
+ line += el.checked ? ' [checked]' : ' [unchecked]';
683
+ } else if (el.value) {
684
+ line += ' value="' + el.value.slice(0, 50) + '"';
685
+ }
686
+ }
687
+ if (tag === 'textarea' && el.value) {
688
+ line += ' value="' + el.value.slice(0, 50) + '"';
689
+ }
690
+ if (tag === 'select') {
691
+ const opts = Array.from(el.options || []).map(o => ({
692
+ text: o.text.slice(0, 30),
693
+ value: o.value,
694
+ selected: o.selected,
695
+ }));
696
+ const selected = opts.find(o => o.selected);
697
+ if (selected) line += ' selected="' + selected.text + '"';
698
+ if (opts.length <= 10) {
699
+ line += ' options=[' + opts.map(o => o.text).join('|') + ']';
700
+ }
701
+ }
702
+
703
+ line += '\\n';
704
+
705
+ let out = line;
706
+ for (const c of el.childNodes) {
707
+ out += walk(c, depth + 1, maxDepth);
708
+ }
709
+
710
+ // Shadow DOM
711
+ if (el.shadowRoot) {
712
+ for (const c of el.shadowRoot.childNodes) {
713
+ out += walk(c, depth + 1, maxDepth);
714
+ }
715
+ }
716
+
717
+ return out;
718
+ }
719
+
720
+ return walk(document.body, 0, 20);
721
+ })()
722
+ `;
723
+
724
+ // src/browser/dom/markdown.ts
725
+ var MARKDOWN_SCRIPT = `
726
+ (() => {
727
+ const SKIP = new Set(['script','style','noscript','svg','head','template']);
728
+ const baseUrl = location.href;
729
+
730
+ // Resolve relative URLs to absolute
731
+ function resolveUrl(href) {
732
+ if (!href || href.startsWith('javascript:') || href.startsWith('#')) return href;
733
+ try { return new URL(href, baseUrl).href; } catch { return href; }
734
+ }
735
+
736
+ // Escape Markdown special chars in text
737
+ function escapeText(text) {
738
+ return text
739
+ .replace(/\\\\/g, '\\\\\\\\')
740
+ .replace(/([*_~\`\\[\\]|])/g, '\\\\$1');
741
+ }
742
+
743
+ // State tracking
744
+ let listDepth = 0;
745
+ let orderedCounters = [];
746
+ let inPre = false;
747
+ let inTable = false;
748
+
749
+ function listIndent() { return ' '.repeat(listDepth); }
750
+
751
+ function walk(el) {
752
+ if (!el) return '';
753
+
754
+ // Text node
755
+ if (el.nodeType === 3) {
756
+ const text = el.textContent || '';
757
+ if (inPre) return text;
758
+ // Collapse whitespace
759
+ const collapsed = text.replace(/\\s+/g, ' ');
760
+ return collapsed === ' ' && !el.previousSibling && !el.nextSibling ? '' : collapsed;
761
+ }
762
+
763
+ if (el.nodeType !== 1) return '';
764
+ const tag = el.tagName.toLowerCase();
765
+ if (SKIP.has(tag)) return '';
766
+
767
+ // Visibility check
768
+ try {
769
+ const s = getComputedStyle(el);
770
+ if (s.display === 'none' || s.visibility === 'hidden') return '';
771
+ } catch {}
772
+
773
+ // Get children content
774
+ function childContent() {
775
+ let out = '';
776
+ for (const c of el.childNodes) out += walk(c);
777
+ return out;
778
+ }
779
+
780
+ switch (tag) {
781
+ // \u2500\u2500 Headings \u2500\u2500
782
+ case 'h1': return '\\n\\n# ' + childContent().trim() + '\\n\\n';
783
+ case 'h2': return '\\n\\n## ' + childContent().trim() + '\\n\\n';
784
+ case 'h3': return '\\n\\n### ' + childContent().trim() + '\\n\\n';
785
+ case 'h4': return '\\n\\n#### ' + childContent().trim() + '\\n\\n';
786
+ case 'h5': return '\\n\\n##### ' + childContent().trim() + '\\n\\n';
787
+ case 'h6': return '\\n\\n###### ' + childContent().trim() + '\\n\\n';
788
+
789
+ // \u2500\u2500 Block elements \u2500\u2500
790
+ case 'p': return '\\n\\n' + childContent().trim() + '\\n\\n';
791
+ case 'br': return '\\n';
792
+ case 'hr': return '\\n\\n---\\n\\n';
793
+
794
+ // \u2500\u2500 Inline formatting \u2500\u2500
795
+ case 'strong': case 'b': {
796
+ const inner = childContent().trim();
797
+ return inner ? '**' + inner + '**' : '';
798
+ }
799
+ case 'em': case 'i': {
800
+ const inner = childContent().trim();
801
+ return inner ? '*' + inner + '*' : '';
802
+ }
803
+ case 's': case 'del': case 'strike': {
804
+ const inner = childContent().trim();
805
+ return inner ? '~~' + inner + '~~' : '';
806
+ }
807
+ case 'code': {
808
+ if (inPre) return childContent();
809
+ const inner = childContent();
810
+ return inner ? '\\x60' + inner + '\\x60' : '';
811
+ }
812
+
813
+ // \u2500\u2500 Code blocks \u2500\u2500
814
+ case 'pre': {
815
+ inPre = true;
816
+ const inner = childContent();
817
+ inPre = false;
818
+ const lang = el.querySelector('code')?.className?.match(/language-(\\w+)/)?.[1] || '';
819
+ return '\\n\\n\\x60\\x60\\x60' + lang + '\\n' + inner.trim() + '\\n\\x60\\x60\\x60\\n\\n';
820
+ }
821
+
822
+ // \u2500\u2500 Links \u2500\u2500
823
+ case 'a': {
824
+ const href = resolveUrl(el.getAttribute('href') || '');
825
+ const inner = childContent().trim();
826
+ const name = inner || el.getAttribute('aria-label') || el.getAttribute('title') || '';
827
+ if (!name) return '';
828
+ if (!href || href === '#' || href.startsWith('javascript:')) return name;
829
+ return '[' + name + '](' + href + ')';
830
+ }
831
+
832
+ // \u2500\u2500 Images \u2500\u2500
833
+ case 'img': {
834
+ const alt = el.getAttribute('alt') || '';
835
+ const src = resolveUrl(el.getAttribute('src') || '');
836
+ return src ? '![' + alt + '](' + src + ')' : '';
837
+ }
838
+
839
+ // \u2500\u2500 Lists \u2500\u2500
840
+ case 'ul': {
841
+ listDepth++;
842
+ orderedCounters.push(0);
843
+ const inner = childContent();
844
+ listDepth--;
845
+ orderedCounters.pop();
846
+ return '\\n' + inner;
847
+ }
848
+ case 'ol': {
849
+ listDepth++;
850
+ orderedCounters.push(0);
851
+ const inner = childContent();
852
+ listDepth--;
853
+ orderedCounters.pop();
854
+ return '\\n' + inner;
855
+ }
856
+ case 'li': {
857
+ const parent = el.parentElement?.tagName?.toLowerCase();
858
+ const isOrdered = parent === 'ol';
859
+ const inner = childContent().trim();
860
+ if (!inner) return '';
861
+ if (isOrdered) {
862
+ const counter = orderedCounters.length > 0
863
+ ? ++orderedCounters[orderedCounters.length - 1] : 1;
864
+ return listIndent() + counter + '. ' + inner + '\\n';
865
+ }
866
+ return listIndent() + '- ' + inner + '\\n';
867
+ }
868
+
869
+ // \u2500\u2500 Blockquote \u2500\u2500
870
+ case 'blockquote': {
871
+ const inner = childContent().trim();
872
+ if (!inner) return '';
873
+ return '\\n\\n' + inner.split('\\n').map(line => '> ' + line).join('\\n') + '\\n\\n';
874
+ }
875
+
876
+ // \u2500\u2500 Tables \u2500\u2500
877
+ case 'table': {
878
+ inTable = true;
879
+ let out = '\\n\\n';
880
+ const rows = el.querySelectorAll('tr');
881
+ let headerDone = false;
882
+
883
+ for (let i = 0; i < rows.length; i++) {
884
+ const cells = rows[i].querySelectorAll('th, td');
885
+ const isHeader = rows[i].querySelector('th') !== null;
886
+ const cellTexts = [];
887
+ for (const cell of cells) {
888
+ let cellText = '';
889
+ for (const c of cell.childNodes) cellText += walk(c);
890
+ cellTexts.push(cellText.trim().replace(/\\|/g, '\\\\|').replace(/\\n/g, ' '));
891
+ }
892
+
893
+ out += '| ' + cellTexts.join(' | ') + ' |\\n';
894
+
895
+ if (isHeader && !headerDone) {
896
+ out += '| ' + cellTexts.map(() => '---').join(' | ') + ' |\\n';
897
+ headerDone = true;
898
+ }
899
+
900
+ // First data row without headers \u2014 synthesize separator
901
+ if (i === 0 && !isHeader && !headerDone) {
902
+ out += '| ' + cellTexts.map(() => '---').join(' | ') + ' |\\n';
903
+ headerDone = true;
904
+ }
905
+ }
906
+
907
+ inTable = false;
908
+ return out + '\\n';
909
+ }
910
+ case 'thead': case 'tbody': case 'tfoot':
911
+ return childContent();
912
+ case 'tr': case 'td': case 'th':
913
+ // Handled by table walker above; fallback for orphaned elements
914
+ return childContent();
915
+
916
+ // \u2500\u2500 Definition lists \u2500\u2500
917
+ case 'dl': return '\\n\\n' + childContent() + '\\n\\n';
918
+ case 'dt': return '\\n**' + childContent().trim() + '**\\n';
919
+ case 'dd': return ': ' + childContent().trim() + '\\n';
920
+
921
+ // \u2500\u2500 Figure \u2500\u2500
922
+ case 'figure': return '\\n\\n' + childContent().trim() + '\\n\\n';
923
+ case 'figcaption': return '\\n*' + childContent().trim() + '*\\n';
924
+
925
+ // \u2500\u2500 Details/Summary \u2500\u2500
926
+ case 'details': return '\\n\\n' + childContent() + '\\n\\n';
927
+ case 'summary': return '**' + childContent().trim() + '**\\n\\n';
928
+
929
+ // \u2500\u2500 Generic blocks \u2500\u2500
930
+ case 'div': case 'section': case 'article': case 'main': case 'aside':
931
+ case 'header': case 'footer': case 'nav':
932
+ return '\\n' + childContent() + '\\n';
933
+
934
+ case 'span': case 'small': case 'sub': case 'sup': case 'abbr':
935
+ case 'time': case 'mark': case 'cite': case 'q':
936
+ return childContent();
937
+
938
+ default:
939
+ return childContent();
940
+ }
941
+ }
942
+
943
+ const raw = walk(document.body);
944
+ // Clean up: collapse 3+ newlines to 2, trim
945
+ return raw.replace(/\\n{3,}/g, '\\n\\n').replace(/^\\n+|\\n+$/g, '').trim();
946
+ })()
947
+ `;
948
+
949
+ // src/browser/dom/interactive.ts
950
+ var INTERACTIVE_ELEMENTS_SCRIPT = `
951
+ (() => {
952
+ const results = [];
953
+
954
+ function classify(el) {
955
+ const tag = el.tagName.toLowerCase();
956
+ const role = el.getAttribute('role');
957
+ const types = [];
958
+
959
+ // Native interactive
960
+ if (['a', 'button', 'input', 'select', 'textarea', 'details', 'summary'].includes(tag)) {
961
+ types.push('native');
962
+ }
963
+
964
+ // ARIA role interactive
965
+ if (role && ['button', 'link', 'textbox', 'checkbox', 'radio', 'combobox', 'tab', 'switch', 'menuitem', 'slider'].includes(role)) {
966
+ types.push('aria');
967
+ }
968
+
969
+ // Contenteditable
970
+ if (el.contentEditable === 'true') types.push('contenteditable');
971
+
972
+ // Focusable
973
+ if (el.tabIndex >= 0 && el.getAttribute('tabindex') !== null) types.push('focusable');
974
+
975
+ // Has click listener (approximate)
976
+ if (el.onclick) types.push('listener');
977
+
978
+ return types;
979
+ }
980
+
981
+ let idx = 0;
982
+ const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);
983
+ let node;
984
+ while (node = walker.nextNode()) {
985
+ const types = classify(node);
986
+ if (types.length === 0) continue;
987
+
988
+ const style = getComputedStyle(node);
989
+ if (style.display === 'none' || style.visibility === 'hidden') continue;
990
+
991
+ const rect = node.getBoundingClientRect();
992
+ results.push({
993
+ index: idx++,
994
+ tag: node.tagName.toLowerCase(),
995
+ role: node.getAttribute('role') || '',
996
+ text: (node.textContent || '').trim().slice(0, 100),
997
+ types,
998
+ ariaLabel: node.getAttribute('aria-label') || '',
999
+ rect: { x: rect.x, y: rect.y, width: rect.width, height: rect.height },
1000
+ });
1001
+ }
1002
+
1003
+ return results;
1004
+ })()
1005
+ `;
1006
+
1007
+ // src/browser/dom/form-state.ts
1008
+ var FORM_STATE_SCRIPT = `
1009
+ (() => {
1010
+ function extractField(el) {
1011
+ const tag = el.tagName.toLowerCase();
1012
+ const type = (el.getAttribute('type') || tag).toLowerCase();
1013
+
1014
+ // Skip non-user-facing inputs
1015
+ if (['hidden', 'submit', 'button', 'reset', 'image'].includes(type)) return null;
1016
+
1017
+ const name = el.name || el.id || '';
1018
+
1019
+ // Find label via multiple strategies
1020
+ const label =
1021
+ el.getAttribute('aria-label') ||
1022
+ (el.id ? document.querySelector('label[for="' + el.id + '"]')?.textContent?.trim() : null) ||
1023
+ el.closest('label')?.textContent?.trim() ||
1024
+ el.placeholder ||
1025
+ '';
1026
+
1027
+ // Extract value based on type
1028
+ let value;
1029
+ if (tag === 'select') {
1030
+ const selected = el.options[el.selectedIndex];
1031
+ value = selected ? selected.textContent.trim() : '';
1032
+ } else if (type === 'checkbox' || type === 'radio') {
1033
+ value = el.checked;
1034
+ } else if (type === 'password') {
1035
+ value = el.value ? '\u2022\u2022\u2022\u2022' : '';
1036
+ } else if (el.isContentEditable) {
1037
+ value = el.textContent?.trim()?.slice(0, 200) || '';
1038
+ } else {
1039
+ value = el.value || '';
1040
+ }
1041
+
1042
+ return {
1043
+ tag,
1044
+ type,
1045
+ name,
1046
+ label: label.slice(0, 80),
1047
+ value: typeof value === 'string' ? value.slice(0, 200) : value,
1048
+ required: !!el.required,
1049
+ disabled: !!el.disabled,
1050
+ ref: el.dataset?.ref || null,
1051
+ };
1052
+ }
1053
+
1054
+ const result = { forms: [], orphanFields: [] };
1055
+
1056
+ // Collect forms
1057
+ for (const form of document.forms) {
1058
+ const fields = [];
1059
+ for (const el of form.elements) {
1060
+ const field = extractField(el);
1061
+ if (field) fields.push(field);
1062
+ }
1063
+ result.forms.push({
1064
+ id: form.id || '',
1065
+ name: form.name || '',
1066
+ action: form.action || '',
1067
+ method: (form.method || 'get').toUpperCase(),
1068
+ fields,
1069
+ });
1070
+ }
1071
+
1072
+ // Collect orphan fields (not in a <form>)
1073
+ const allInputs = document.querySelectorAll(
1074
+ 'input, textarea, select, [contenteditable="true"]'
1075
+ );
1076
+ for (const el of allInputs) {
1077
+ if (!el.form) {
1078
+ const field = extractField(el);
1079
+ if (field) result.orphanFields.push(field);
1080
+ }
1081
+ }
1082
+
1083
+ return result;
1084
+ })()
1085
+ `;
1086
+ export {
1087
+ FLAT_TREE_SCRIPT,
1088
+ FORM_STATE_SCRIPT,
1089
+ INTERACTIVE_ELEMENTS_SCRIPT,
1090
+ MARKDOWN_SCRIPT,
1091
+ SEMANTIC_TREE_SCRIPT,
1092
+ SNAPSHOT_SCRIPT,
1093
+ buildSnapshotScript,
1094
+ flatTreeToString
1095
+ };
1096
+ //# sourceMappingURL=index.js.map