mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-08 20:32:00 -04:00
Merge pull request #3630 from lightpanda-io/prompt-audit-cleanup
agent: drop dated prompt patterns, bump zenai
This commit is contained in:
3 files changed
+18
-25
No files matched your search
+2
-2
@@ -36,8 +36,8 @@
|
||||
.hash = "sqlite3-3.53.2-DMxLWuAOAAA_Px0arJOIOaP4AKEu5prbsQgPMA35W1zz",
|
||||
},
|
||||
.zenai = .{
|
||||
.url = "git+https://github.com/lightpanda-io/zenai.git#93583f32eb09203821539ca16bd45890823f293b",
|
||||
.hash = "zenai-0.0.0-iOY_VOKsBgDYtAH8xVzBf_1BITeTJ-rZlB4stdJDPiWX",
|
||||
.url = "git+https://github.com/lightpanda-io/zenai.git#43658858f6c677b107a0f4fb76dc92e5ac97d3a4",
|
||||
.hash = "zenai-0.0.0-iOY_VKquBgBT36nAFRpM4tQki3JNZgFvTwQY6Pz-wiQx",
|
||||
},
|
||||
.isocline = .{
|
||||
.url = "git+https://github.com/arrufat/isocline#4a99434bee4a5ed04c1639514224d48cd55e1405",
|
||||
|
||||
+6
-10
@@ -118,16 +118,12 @@ fn savePrompt(revision: bool) []const u8 {
|
||||
|
||||
const synthesis_prompt =
|
||||
\\You have used your tool budget or cannot finish the exploration.
|
||||
\\Give your best final answer NOW based ONLY on what you actually observed
|
||||
\\via tool calls in this conversation. Do NOT fall back to prior knowledge —
|
||||
\\if your snapshots show only cookie banners, 403/access-denied pages,
|
||||
\\blocked search results, or empty bodies, say that explicitly
|
||||
\\(e.g. "the page was blocked by a cookie wall and I could not extract X").
|
||||
\\Do not invent details that are not visible in the tool outputs above.
|
||||
\\Do not call any more tools.
|
||||
\\Respond with ONLY the answer — one word, one number, one short phrase,
|
||||
\\or a brief honest explanation of why the page could not be read.
|
||||
\\No prefix, no markdown.
|
||||
\\Give your best final answer using only what the tool outputs above
|
||||
\\show, not prior knowledge. If they show only cookie banners,
|
||||
\\403/access-denied pages, blocked search results, or empty bodies, say
|
||||
\\so plainly (e.g. "the page was blocked by a cookie wall and I could not
|
||||
\\extract X") rather than filling the gap. Answer at the length the
|
||||
\\question needs.
|
||||
;
|
||||
|
||||
allocator: std.mem.Allocator,
|
||||
|
||||
+10
-13
@@ -108,9 +108,7 @@ pub const driver_guidance =
|
||||
\\- Triage from `search` snippets before opening links; open only the few
|
||||
\\ most promising. Don't re-run a search you already ran, and skip
|
||||
\\ near-duplicate sources that repeat the same announcement verbatim.
|
||||
\\- Stop once the gathered material answers the question. For opinion or
|
||||
\\ discussion questions, a couple of high-signal threads (e.g. Hacker
|
||||
\\ News, Reddit) usually beat scraping a dozen news sites.
|
||||
\\- Stop once the gathered material answers the question.
|
||||
\\
|
||||
\\Selector rules:
|
||||
\\- NEVER pass backendNodeId to click/fill/hover/selectOption/setChecked.
|
||||
@@ -181,9 +179,8 @@ pub const save_synthesis_prompt =
|
||||
\\list, fan out to detail pages, aggregate, return) stating what that block
|
||||
\\accomplishes toward the goal — NOT restating the API call. One comment per
|
||||
\\step, not per line; skip self-evident lines.
|
||||
\\Output ONLY JavaScript source — no markdown fences and no prose outside the
|
||||
\\code, but DO annotate the script with the `//` intent comments described
|
||||
\\above.
|
||||
\\Output the JavaScript source alone, with no markdown fences or prose
|
||||
\\around it.
|
||||
;
|
||||
|
||||
/// Script-language rules for consumers that never see the full
|
||||
@@ -347,7 +344,7 @@ pub const Tool = enum {
|
||||
pub fn definition(self: Tool) Definition {
|
||||
return switch (self) {
|
||||
.goto => .{
|
||||
.description = "Navigate to a specified URL and load the page in memory so it can be reused later for info extraction.",
|
||||
.description = "Navigate the current page to a URL. Returns a short status once `waitUntil` fires (default `load`), or a timeout notice; content rendered by post-load JavaScript may not be there yet (see `waitForState`). The page stays loaded for later reads and actions. To navigate and read in one call, pass `url` to `markdown`, `tree` or `html` instead; use `goto` when the next step is an action or `extract`.",
|
||||
.summary = "Open a URL and keep the page in memory",
|
||||
.input_schema = minify(
|
||||
\\{
|
||||
@@ -450,7 +447,7 @@ pub const Tool = enum {
|
||||
\\{
|
||||
\\ "type": "object",
|
||||
\\ "properties": {
|
||||
\\ "script": { "type": "string" },
|
||||
\\ "script": { "type": "string", "description": "JavaScript run in the page context. A bare trailing expression, or `return` with top-level `await`, is the result." },
|
||||
\\ "url": { "type": "string", "description": "Optional URL to navigate to before evaluating." },
|
||||
\\ "timeout": { "type": "integer", "description": "Optional timeout in milliseconds. Defaults to 10000." },
|
||||
\\ "save": { "type": "string", "description": "Optional bridge-store key. The evaluate's return value is stored under this name and re-exposed as `lp.<name>` to subsequent evaluates. Objects, arrays, and strings are serialized automatically — no JSON.stringify needed." }
|
||||
@@ -491,7 +488,7 @@ pub const Tool = enum {
|
||||
),
|
||||
},
|
||||
.tree => .{
|
||||
.description = "Simplified semantic DOM tree (role, name, value, backendNodeId per node). Pass `backendNodeId` to scope, `maxDepth` to limit depth.",
|
||||
.description = "Semantic outline of the page as indented text: one node per line with its role, accessible name, value and backendNodeId, plus checked state and select options with the selected one marked. The default first read of an unfamiliar page; input and select values are already here, so no `nodeDetails` call is needed to read them. Pass `backendNodeId` to scope to a subtree and `maxDepth` to survey structure before going deeper. Read it again after any page-changing action, since the DOM it describes may have changed; use `nodeDetails` to turn a backendNodeId into a CSS selector for actions.",
|
||||
.summary = "Semantic DOM tree of the page",
|
||||
.input_schema = minify(
|
||||
\\{
|
||||
@@ -519,17 +516,17 @@ pub const Tool = enum {
|
||||
),
|
||||
},
|
||||
.interactiveElements => .{
|
||||
.description = "Extract interactive elements from the opened page. If a url is provided, it navigates to that url first.",
|
||||
.description = "List every visible interactive element on the page as a JSON array: native controls, ARIA widgets, contenteditable regions, elements with event listeners, and focusable elements. Each entry has `backendNodeId`, `tagName`, `role`, `name`, `type` (why it counts as interactive), `tabIndex`, and when present `listeners`, `disabled`, `id`, `class`, `href`, `inputType`, `value`, `elementName` and `placeholder`. Use it to survey what can be acted on; to locate one element by role or name, `findElement` is cheaper. If a url is provided, it navigates there first.",
|
||||
.summary = "List interactive elements on the page",
|
||||
.input_schema = url_params_schema,
|
||||
},
|
||||
.structuredData => .{
|
||||
.description = "Extract structured data (like JSON-LD, OpenGraph, etc) from the opened page. If a url is provided, it navigates to that url first.",
|
||||
.description = "Page metadata as JSON: `jsonLd` (each JSON-LD block as a string), `openGraph`, `twitterCard`, `meta` and `links` (key/value lists), plus `alternate` (hreflang variants) and `linkHeaders` (relations from the HTTP Link header) when present. Empty sections come back as empty arrays. Use it for publisher-declared facts such as product price, article author or canonical URL before scraping the visible text for them. If a url is provided, it navigates there first.",
|
||||
.summary = "Extract JSON-LD / OpenGraph data",
|
||||
.input_schema = url_params_schema,
|
||||
},
|
||||
.detectForms => .{
|
||||
.description = "Detect all forms on the page and return their structure including fields, types, and required status. If a url is provided, it navigates to that url first.",
|
||||
.description = "List the forms on the page as JSON: each form's `backendNodeId`, `action`, `method` and `fields`, where each field has `backendNodeId`, `tagName`, `name`, `inputType`, `required`, `disabled`, and when present `value`, `placeholder` and select `options`. Use it before filling a form to see every field it expects. It returns no CSS selectors; get one per field with `nodeDetails` so the fill calls stay replayable. If a url is provided, it navigates there first.",
|
||||
.summary = "List forms and their fields",
|
||||
.input_schema = url_params_schema,
|
||||
},
|
||||
@@ -562,7 +559,7 @@ pub const Tool = enum {
|
||||
),
|
||||
},
|
||||
.scroll => .{
|
||||
.description = "Scroll the page or a specific element. Provide a CSS selector (preferred for reproducibility) or a backendNodeId to scroll an element; omit both to scroll the window. Returns the scroll position and current page URL and title.",
|
||||
.description = "Scroll the window, or an element's scroll container, to an absolute position; an omitted axis keeps its current offset. Target an element with a CSS selector (preferred for reproducibility) or a backendNodeId; omit both to scroll the window. Page scripts receive a `scroll` event, so content that loads on scroll (infinite feeds, lazy lists) may appear: read the page again afterwards, with `waitForState` if it is still loading. Returns the final scroll position and the current page URL and title.",
|
||||
.summary = "Scroll the page or an element",
|
||||
.input_schema = minify(
|
||||
\\{
|
||||
|
||||
Reference in new issue
Block a user