diff --git a/page-agent.user.js b/page-agent.user.js
index 637bfc7..3875444 100644
--- a/page-agent.user.js
+++ b/page-agent.user.js
@@ -1,8 +1,8 @@
// ==UserScript==
-// @name Page Agent — LLM in the page
+// @name Page Agent - LLM in the page
// @namespace https://github.com/example/page-agent
// @version 0.1.0
-// @description Turn any web page into an LLM agent that can run JS in the page to inspect, extract, fetch and act — then bake what it learned into a standalone, LLM-free userscript.
+// @description Turn any web page into an LLM agent that can run JS in the page to inspect, extract, fetch and act - then bake what it learned into a standalone, LLM-free userscript.
// @match *://*/*
// @run-at document-idle
// @grant GM.xmlHttpRequest
@@ -41,12 +41,12 @@
const maxSteps = 8; // upper bound on the agent's tool-use loop
// The panel starts fully hidden. Reveal it with:
- // Desktop — Ctrl+Shift+Space (see HOTKEY)
- // Mobile — three-finger tap anywhere on the page
+ // Desktop - Ctrl+Shift+Space (see HOTKEY)
+ // Mobile - three-finger tap anywhere on the page
const HOTKEY = { ctrl: true, shift: true, alt: false, code: 'Space', label: 'Ctrl+Shift+Space' };
// ============================================================
- // safeStringify — serialize arbitrary values without blowing up
+ // safeStringify - serialize arbitrary values without blowing up
// ============================================================
function safeStringify(value, maxLen = 20000) {
const seen = new WeakSet();
@@ -70,7 +70,7 @@
if (out === undefined) out = String(value); // undefined coercion
if (out.length > maxLen) {
const total = out.length;
- out = out.slice(0, maxLen) + '…[truncated, ' + total + ' chars]';
+ out = out.slice(0, maxLen) + '...[truncated, ' + total + ' chars]';
}
return out;
}
@@ -86,7 +86,7 @@
'Execute JavaScript in the context of the current web page. Your code runs ' +
'as the BODY of an async function, so you can use `await` and you MUST `return` ' +
'a value to see any result. The returned value is JSON-stringified and sent back ' +
- 'to you, so keep it SMALL and RELEVANT — return only the specific fields/text you ' +
+ 'to you, so keep it SMALL and RELEVANT - return only the specific fields/text you ' +
'need, never whole DOM trees or huge arrays. Use it to query selectors, extract ' +
'content, call fetch(), read/modify the page, click, fill and navigate. Take ' +
'several small targeted steps rather than one giant snippet.',
@@ -190,9 +190,9 @@
args = { code: '' };
}
const code = args.code || '';
- log('» run_js:\n' + code);
+ log('>> run_js:\n' + code);
const result = await runJs(code);
- log('« result: ' + result.slice(0, 500));
+ log('<< result: ' + result.slice(0, 500));
messages.push({ role: 'tool', tool_call_id: tc.id, content: result });
}
}
@@ -201,7 +201,7 @@
}
// ============================================================
- // UI — floating panel (bottom-right, dark), hidden by default
+ // UI - floating panel (bottom-right, dark), hidden by default
// ============================================================
const PANEL_ID = 'llm-page-agent-panel';
if (document.getElementById(PANEL_ID)) return; // avoid double-inject
@@ -254,15 +254,15 @@
panel.className = 'pa-hidden'; // hidden until revealed
panel.innerHTML =
'