openfox 1.6.76 → 1.6.78

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 (32) hide show
  1. package/README.md +18 -18
  2. package/dist/agent-defaults/code-reviewer.agent.md +1 -0
  3. package/dist/agent-defaults/explorer.agent.md +2 -1
  4. package/dist/agent-defaults/verifier.agent.md +4 -0
  5. package/dist/{auto-compaction-V3PA77WG.js → auto-compaction-AN3U2AD5.js} +5 -5
  6. package/dist/{chat-handler-7DKHGTVO.js → chat-handler-AIBOSHAQ.js} +8 -8
  7. package/dist/{chunk-LCQ3MPXD.js → chunk-2IZMUXMP.js} +3 -3
  8. package/dist/{chunk-K2V7EW5F.js → chunk-DKKDNJT7.js} +36 -22
  9. package/dist/{chunk-XKIEDGQF.js → chunk-DL6ZILAF.js} +1 -2
  10. package/dist/{chunk-H5EICXF3.js → chunk-GLVNO4DS.js} +188 -91
  11. package/dist/{chunk-NHJ2GVCF.js → chunk-NWXLRRDD.js} +4 -4
  12. package/dist/{chunk-5ZD3GZTK.js → chunk-RJRG2VER.js} +33 -2
  13. package/dist/{chunk-VAMTEAYI.js → chunk-TS5XFQ2D.js} +100 -49
  14. package/dist/{chunk-RQ4XSKUR.js → chunk-VSYJIPRI.js} +3 -3
  15. package/dist/cli/dev.js +1 -1
  16. package/dist/cli/index.js +1 -1
  17. package/dist/{events-BDXQOC7F.js → events-ND5GZBT2.js} +7 -5
  18. package/dist/{folding-2HW7FIKL.js → folding-XIKR6AFM.js} +14 -4
  19. package/dist/{inspect-proxy-Y75AXMRX.js → inspect-proxy-42ZXL2R5.js} +2 -2
  20. package/dist/{orchestrator-KCHEENHK.js → orchestrator-5BY2MH72.js} +6 -6
  21. package/dist/package.json +1 -1
  22. package/dist/{processor-6TS37IYH.js → processor-PV446N55.js} +5 -5
  23. package/dist/{serve-OLDABBV3.js → serve-6ME66XOO.js} +7 -7
  24. package/dist/server/index.js +6 -6
  25. package/dist/server/public/__inspect__.js +161 -142
  26. package/dist/{service-D6LC3CAM.js → service-TU4XSXYJ.js} +33 -2
  27. package/dist/{tools-BHYHS3RY.js → tools-6DXPHBUV.js} +5 -5
  28. package/dist/web/__inspect__.js +178 -155
  29. package/dist/web/assets/{index-DAuZ02-Q.js → index-0igqGWob.js} +65 -65
  30. package/dist/web/index.html +2 -2
  31. package/dist/web/sw.js +1 -1
  32. package/package.json +1 -1
@@ -1,15 +1,15 @@
1
- (function() {
2
- 'use strict';
1
+ ;(function () {
2
+ 'use strict'
3
3
 
4
- window.__foxInspectMode = false;
5
- window.__foxSessionId = null;
6
- window.__foxSessionTitle = null;
7
- window.__foxInspectEnabled = true;
8
- window.__foxSentPending = false;
9
- window.__foxPopupOpen = false;
10
- window.__foxHighlightedEl = null;
4
+ window.__foxInspectMode = false
5
+ window.__foxSessionId = null
6
+ window.__foxSessionTitle = null
7
+ window.__foxInspectEnabled = true
8
+ window.__foxSentPending = false
9
+ window.__foxPopupOpen = false
10
+ window.__foxHighlightedEl = null
11
11
 
12
- var overlayStyle = document.createElement('style');
12
+ var overlayStyle = document.createElement('style')
13
13
  overlayStyle.textContent = [
14
14
  '#__fox-overlay{position:fixed;bottom:16px;right:16px;z-index:2147483647;font-family:system-ui,sans-serif;font-size:13px;pointer-events:none}',
15
15
  '#__fox-widget{background:#1e1e1e;color:#e0e0e0;padding:8px 12px;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.4);display:flex;align-items:center;gap:10px;pointer-events:auto}',
@@ -30,75 +30,76 @@
30
30
  '#__fox-popup button.__fox-send:hover{background:#2563eb}',
31
31
  '#__fox-popup button.__fox-cancel{background:transparent;color:#888;border:1px solid #444;padding:6px 14px;border-radius:4px;cursor:pointer;font-size:12px;font-family:inherit}',
32
32
  '#__fox-popup button.__fox-cancel:hover{color:#aaa;border-color:#666}',
33
- '#__fox-popup .__fox-hint{font-size:11px;color:#666;margin-top:6px;line-height:1.4}'
34
- ].join('\n');
33
+ '#__fox-popup .__fox-hint{font-size:11px;color:#666;margin-top:6px;line-height:1.4}',
34
+ ].join('\n')
35
35
 
36
- var overlay = document.createElement('div');
37
- overlay.id = '__fox-overlay';
38
- overlay.innerHTML = '<div id="__fox-widget">' +
36
+ var overlay = document.createElement('div')
37
+ overlay.id = '__fox-overlay'
38
+ overlay.innerHTML =
39
+ '<div id="__fox-widget">' +
39
40
  '<span class="__fox-label">OpenFox</span>' +
40
41
  '<button id="__fox-toggle">Send feedback</button>' +
41
- '</div>';
42
+ '</div>'
42
43
 
43
- var toggleBtn;
44
+ var toggleBtn
44
45
 
45
46
  function setInspectMode(enabled) {
46
- window.__foxInspectMode = enabled;
47
+ window.__foxInspectMode = enabled
47
48
  if (toggleBtn) {
48
- toggleBtn.textContent = enabled ? 'Exit inspect' : 'Send feedback';
49
- toggleBtn.classList.toggle('__fox-active', enabled);
49
+ toggleBtn.textContent = enabled ? 'Exit inspect' : 'Send feedback'
50
+ toggleBtn.classList.toggle('__fox-active', enabled)
50
51
  }
51
52
  }
52
53
 
53
54
  function clearHighlights() {
54
55
  if (window.__foxHighlightedEl) {
55
- window.__foxHighlightedEl.classList.remove('__fox-highlight');
56
- window.__foxHighlightedEl = null;
56
+ window.__foxHighlightedEl.classList.remove('__fox-highlight')
57
+ window.__foxHighlightedEl = null
57
58
  }
58
59
  }
59
60
 
60
61
  function generateXPath(el) {
61
- if (!el || el.nodeType !== Node.ELEMENT_NODE) return '';
62
- var parts = [];
62
+ if (!el || el.nodeType !== Node.ELEMENT_NODE) return ''
63
+ var parts = []
63
64
  while (el && el.nodeType === Node.ELEMENT_NODE && el !== document.documentElement) {
64
- var index = 1;
65
- var sibling = el.previousSibling;
65
+ var index = 1
66
+ var sibling = el.previousSibling
66
67
  while (sibling) {
67
- if (sibling.nodeType === Node.ELEMENT_NODE && sibling.nodeName === el.nodeName) index++;
68
- sibling = sibling.previousSibling;
68
+ if (sibling.nodeType === Node.ELEMENT_NODE && sibling.nodeName === el.nodeName) index++
69
+ sibling = sibling.previousSibling
69
70
  }
70
- parts.unshift(el.nodeName.toLowerCase() + '[' + index + ']');
71
- el = el.parentNode;
71
+ parts.unshift(el.nodeName.toLowerCase() + '[' + index + ']')
72
+ el = el.parentNode
72
73
  }
73
- return '/' + parts.join('/');
74
+ return '/' + parts.join('/')
74
75
  }
75
76
 
76
77
  function stripSvgAndGetText(el) {
77
78
  try {
78
- var clone = el.cloneNode(true);
79
- var svgs = clone.querySelectorAll('svg');
79
+ var clone = el.cloneNode(true)
80
+ var svgs = clone.querySelectorAll('svg')
80
81
  for (var i = 0; i < svgs.length; i++) {
81
- svgs[i].remove();
82
+ svgs[i].remove()
82
83
  }
83
- var text = (clone.textContent || '').replace(/\s+/g, ' ').trim();
84
- return text.slice(0, 500) || null;
84
+ var text = (clone.textContent || '').replace(/\s+/g, ' ').trim()
85
+ return text.slice(0, 500) || null
85
86
  } catch (e) {
86
- return null;
87
+ return null
87
88
  }
88
89
  }
89
90
 
90
91
  function buildElementData(el) {
91
- var attrs = {};
92
+ var attrs = {}
92
93
  if (el.attributes) {
93
94
  for (var i = 0; i < el.attributes.length; i++) {
94
- var attr = el.attributes[i];
95
+ var attr = el.attributes[i]
95
96
  if (attr.name !== 'class' && attr.name !== 'id') {
96
- attrs[attr.name] = attr.value;
97
+ attrs[attr.name] = attr.value
97
98
  }
98
99
  }
99
100
  }
100
- var rect = el.getBoundingClientRect();
101
- var tagName = el.tagName ? el.tagName.toLowerCase() : '';
101
+ var rect = el.getBoundingClientRect()
102
+ var tagName = el.tagName ? el.tagName.toLowerCase() : ''
102
103
  return {
103
104
  tag: tagName,
104
105
  id: el.id || null,
@@ -108,73 +109,81 @@
108
109
  textContent: stripSvgAndGetText(el),
109
110
  outerHTML: (el.outerHTML || '').slice(0, 1000) || '',
110
111
  rect: { x: rect.left, y: rect.top, width: rect.width, height: rect.height },
111
- attributes: attrs
112
- };
112
+ attributes: attrs,
113
+ }
113
114
  }
114
115
 
115
116
  function showPopup(el, x, y) {
116
- var existing = document.getElementById('__fox-popup');
117
- if (existing) existing.remove();
117
+ var existing = document.getElementById('__fox-popup')
118
+ if (existing) existing.remove()
118
119
 
119
- window.__foxPopupOpen = true;
120
- var data = buildElementData(el);
121
- var viewportWidth = window.innerWidth;
122
- var viewportHeight = window.innerHeight;
120
+ window.__foxPopupOpen = true
121
+ var data = buildElementData(el)
122
+ var viewportWidth = window.innerWidth
123
+ var viewportHeight = window.innerHeight
123
124
 
124
- var left = x + 10;
125
- var top = y + 10;
126
- if (left + 340 > viewportWidth) left = x - 350;
127
- if (top + 280 > viewportHeight) top = y - 290;
128
- if (left < 8) left = 8;
129
- if (top < 8) top = 8;
125
+ var left = x + 10
126
+ var top = y + 10
127
+ if (left + 340 > viewportWidth) left = x - 350
128
+ if (top + 280 > viewportHeight) top = y - 290
129
+ if (left < 8) left = 8
130
+ if (top < 8) top = 8
130
131
 
131
- var popup = document.createElement('div');
132
- popup.id = '__fox-popup';
133
- popup.style.left = left + 'px';
134
- popup.style.top = top + 'px';
132
+ var popup = document.createElement('div')
133
+ popup.id = '__fox-popup'
134
+ popup.style.left = left + 'px'
135
+ popup.style.top = top + 'px'
135
136
 
136
- var tagDisplay = data.tag + (data.id ? '#' + data.id : (data.className ? '.' + data.className.split(' ')[0] : ''));
137
+ var tagDisplay = data.tag + (data.id ? '#' + data.id : data.className ? '.' + data.className.split(' ')[0] : '')
137
138
 
138
139
  popup.innerHTML =
139
- '<div class="__fox-tag">Element: <span>' + tagDisplay + '</span></div>' +
140
- '<div class="__fox-selector">' + data.xpath + '</div>' +
140
+ '<div class="__fox-tag">Element: <span>' +
141
+ tagDisplay +
142
+ '</span></div>' +
143
+ '<div class="__fox-selector">' +
144
+ data.xpath +
145
+ '</div>' +
141
146
  '<textarea placeholder="What\'s wrong with this element?"></textarea>' +
142
- '<div class="__fox-hint">Sending to: ' + (window.__foxSessionTitle || window.__foxSessionId || 'none') + '. To target a different session, close this, navigate to that session in OpenFox, and reopen the inspect window.</div>' +
147
+ '<div class="__fox-hint">Sending to: ' +
148
+ (window.__foxSessionTitle || window.__foxSessionId || 'none') +
149
+ '. To target a different session, close this, navigate to that session in OpenFox, and reopen the inspect window.</div>' +
143
150
  '<div class="__fox-actions">' +
144
- '<button class="__fox-cancel">Cancel</button>' +
145
- '<button class="__fox-send">Send to Agent</button>' +
146
- '</div>';
151
+ '<button class="__fox-cancel">Cancel</button>' +
152
+ '<button class="__fox-send">Send to Agent</button>' +
153
+ '</div>'
147
154
 
148
- document.body.appendChild(popup);
155
+ document.body.appendChild(popup)
149
156
 
150
- var textarea = popup.querySelector('textarea');
151
- textarea.focus();
157
+ var textarea = popup.querySelector('textarea')
158
+ textarea.focus()
152
159
 
153
- textarea.addEventListener('keydown', function(ke) {
160
+ textarea.addEventListener('keydown', function (ke) {
154
161
  if (ke.key === 'Enter' && !ke.shiftKey) {
155
- ke.preventDefault();
156
- popup.querySelector('.__fox-send').click();
162
+ ke.preventDefault()
163
+ popup.querySelector('.__fox-send').click()
157
164
  }
158
- });
165
+ })
159
166
 
160
- popup.querySelector('.__fox-cancel').addEventListener('click', function(e) {
161
- e.preventDefault();
162
- e.stopPropagation();
163
- window.__foxPopupOpen = false;
164
- popup.remove();
165
- });
167
+ popup.querySelector('.__fox-cancel').addEventListener('click', function (e) {
168
+ e.preventDefault()
169
+ e.stopPropagation()
170
+ window.__foxPopupOpen = false
171
+ popup.remove()
172
+ })
166
173
 
167
- popup.querySelector('.__fox-send').addEventListener('click', function(e) {
168
- e.preventDefault();
169
- e.stopPropagation();
170
- if (window.__foxSentPending) return;
171
- window.__foxSentPending = true;
172
- setTimeout(function() { window.__foxSentPending = false; }, 3000);
173
- var annotation = textarea.value.trim();
174
- window.__foxPopupOpen = false;
175
- popup.remove();
176
- clearHighlights();
177
- setInspectMode(false);
174
+ popup.querySelector('.__fox-send').addEventListener('click', function (e) {
175
+ e.preventDefault()
176
+ e.stopPropagation()
177
+ if (window.__foxSentPending) return
178
+ window.__foxSentPending = true
179
+ setTimeout(function () {
180
+ window.__foxSentPending = false
181
+ }, 3000)
182
+ var annotation = textarea.value.trim()
183
+ window.__foxPopupOpen = false
184
+ popup.remove()
185
+ clearHighlights()
186
+ setInspectMode(false)
178
187
 
179
188
  fetch('/__openfox_feedback', {
180
189
  method: 'POST',
@@ -183,95 +192,109 @@
183
192
  sessionId: window.__foxSessionId,
184
193
  element: data,
185
194
  annotation: annotation,
186
- pageUrl: window.location.href
187
- })
188
- }).catch(function(err) {
189
- console.error('Failed to send feedback:', err);
190
- });
191
- });
195
+ pageUrl: window.location.href,
196
+ }),
197
+ }).catch(function (err) {
198
+ console.error('Failed to send feedback:', err)
199
+ })
200
+ })
192
201
 
193
- popup.addEventListener('click', function(e) { e.stopPropagation(); });
202
+ popup.addEventListener('click', function (e) {
203
+ e.stopPropagation()
204
+ })
194
205
 
195
206
  document.addEventListener('keydown', function escHandler(e) {
196
207
  if (e.key === 'Escape') {
197
- window.__foxPopupOpen = false;
198
- popup.remove();
199
- clearHighlights();
200
- setInspectMode(false);
201
- document.removeEventListener('keydown', escHandler);
208
+ window.__foxPopupOpen = false
209
+ popup.remove()
210
+ clearHighlights()
211
+ setInspectMode(false)
212
+ document.removeEventListener('keydown', escHandler)
202
213
  }
203
- });
214
+ })
204
215
  }
205
216
 
206
- document.addEventListener('mouseover', function(e) {
207
- if (!window.__foxInspectMode || window.__foxPopupOpen) return;
208
- if (e.target === document.documentElement || e.target === document.body) return;
209
- if (overlay.contains(e.target)) return;
210
- clearHighlights();
211
- e.target.classList.add('__fox-highlight');
212
- window.__foxHighlightedEl = e.target;
213
- }, true);
217
+ document.addEventListener(
218
+ 'mouseover',
219
+ function (e) {
220
+ if (!window.__foxInspectMode || window.__foxPopupOpen) return
221
+ if (e.target === document.documentElement || e.target === document.body) return
222
+ if (overlay.contains(e.target)) return
223
+ clearHighlights()
224
+ e.target.classList.add('__fox-highlight')
225
+ window.__foxHighlightedEl = e.target
226
+ },
227
+ true,
228
+ )
214
229
 
215
- document.addEventListener('click', function(e) {
216
- if (!window.__foxInspectMode) return;
217
- if (overlay.contains(e.target)) return;
218
- if (document.getElementById('__fox-popup')) return;
230
+ document.addEventListener(
231
+ 'click',
232
+ function (e) {
233
+ if (!window.__foxInspectMode) return
234
+ if (overlay.contains(e.target)) return
235
+ if (document.getElementById('__fox-popup')) return
219
236
 
220
- e.preventDefault();
221
- e.stopPropagation();
222
- var el = window.__foxHighlightedEl;
223
- if (!el) return;
224
- showPopup(el, e.clientX, e.clientY);
225
- }, true);
237
+ e.preventDefault()
238
+ e.stopPropagation()
239
+ var el = window.__foxHighlightedEl
240
+ if (!el) return
241
+ showPopup(el, e.clientX, e.clientY)
242
+ },
243
+ true,
244
+ )
226
245
 
227
- document.addEventListener('keydown', function(e) {
246
+ document.addEventListener('keydown', function (e) {
228
247
  if (e.key === 'Escape' && window.__foxInspectMode) {
229
- clearHighlights();
230
- setInspectMode(false);
248
+ clearHighlights()
249
+ setInspectMode(false)
231
250
  }
232
251
  if (e.ctrlKey && e.shiftKey && e.key === 'X') {
233
- e.preventDefault();
234
- if (window.__foxInspectMode) clearHighlights();
235
- setInspectMode(!window.__foxInspectMode);
252
+ e.preventDefault()
253
+ if (window.__foxInspectMode) clearHighlights()
254
+ setInspectMode(!window.__foxInspectMode)
236
255
  }
237
- });
256
+ })
238
257
 
239
- window.addEventListener('message', function(e) {
258
+ window.addEventListener('message', function (e) {
240
259
  if (e.data && e.data.type === 'setFoxSessionId') {
241
- window.__foxSessionId = e.data.sessionId;
260
+ window.__foxSessionId = e.data.sessionId
242
261
  }
243
262
  if (e.data && e.data.type === 'setFoxSessionTitle') {
244
- window.__foxSessionTitle = e.data.sessionTitle;
263
+ window.__foxSessionTitle = e.data.sessionTitle
245
264
  }
246
265
  if (e.data && e.data.type === 'setFoxInspectEnabled') {
247
- window.__foxInspectEnabled = e.data.enabled;
248
- overlay.style.display = e.data.enabled ? '' : 'none';
266
+ window.__foxInspectEnabled = e.data.enabled
267
+ overlay.style.display = e.data.enabled ? '' : 'none'
249
268
  }
250
- });
269
+ })
251
270
 
252
271
  function init() {
253
- if (window.__foxInspectInit) return;
254
- window.__foxInspectInit = true;
255
- document.head.appendChild(overlayStyle);
256
- document.body.appendChild(overlay);
257
- toggleBtn = document.getElementById('__fox-toggle');
258
- var widget = document.getElementById('__fox-widget');
259
- widget.addEventListener('mousedown', function(e) {
260
- e.preventDefault();
261
- e.stopPropagation();
262
- }, true);
263
- toggleBtn.addEventListener('click', function(e) {
264
- e.preventDefault();
265
- e.stopPropagation();
266
- if (window.__foxInspectMode) clearHighlights();
267
- setInspectMode(!window.__foxInspectMode);
268
- });
269
- overlay.style.display = window.__foxInspectEnabled ? '' : 'none';
272
+ if (window.__foxInspectInit) return
273
+ window.__foxInspectInit = true
274
+ document.head.appendChild(overlayStyle)
275
+ document.body.appendChild(overlay)
276
+ toggleBtn = document.getElementById('__fox-toggle')
277
+ var widget = document.getElementById('__fox-widget')
278
+ widget.addEventListener(
279
+ 'mousedown',
280
+ function (e) {
281
+ e.preventDefault()
282
+ e.stopPropagation()
283
+ },
284
+ true,
285
+ )
286
+ toggleBtn.addEventListener('click', function (e) {
287
+ e.preventDefault()
288
+ e.stopPropagation()
289
+ if (window.__foxInspectMode) clearHighlights()
290
+ setInspectMode(!window.__foxInspectMode)
291
+ })
292
+ overlay.style.display = window.__foxInspectEnabled ? '' : 'none'
270
293
  }
271
294
 
272
295
  if (document.body) {
273
- init();
296
+ init()
274
297
  } else {
275
- document.addEventListener('DOMContentLoaded', init);
298
+ document.addEventListener('DOMContentLoaded', init)
276
299
  }
277
- })();
300
+ })()