docs(browser): teach the eval-js output contract and piping - #40
Merged
Conversation
notte-cli#72 prints the evaluated value alone on stdout with the status line on stderr, so eval-js is now composable: the agent can capture it with $(...) or pipe it into jq instead of reading a banner and a "Result:" prefix. Say that where eval-js is taught, show both shapes, and recommend returning JSON.stringify(...) for structured answers so jq filters locally rather than costing another round trip through the page. Also correct the old "stdout is not captured" line - what is discarded is console.log, not the returned value - and note that a failing script now exits non-zero with the actual JavaScript error. The same piping note goes on the functions-build exploration flow, which drives eval-js to verify discovered endpoints. Verified against staging: title=$(notte page eval-js 'document.title') captures "Example Domain" and the JSON.stringify example pipes into jq. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
| Filename | Overview |
|---|---|
| plugins/notte/skills/notte-browser/SKILL.md | Documents the composable eval-js output contract and shell examples, but adds no automated regression coverage. |
| plugins/notte/skills/notte-functions-build/references/exploration.md | Adds direct jq-piping and command-substitution guidance without automated coverage. |
Prompt To Fix All With AI
### Issue 1
plugins/notte/skills/notte-browser/SKILL.md:290-296
**Output contract lacks regression coverage**
These stream-sensitive examples depend on exact stdout, stderr, JSON, and exit-status behavior, but this PR adds no unit or integration test to keep the documentation aligned with the CLI contract as it changes.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "docs(browser): teach the eval-js output ..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
nottelabs/notte-cli#72 (merged) changed what
notte page eval-jsprints: the evaluated value now lands alone on stdout (objects/arrays as JSON, a JSnullasnull) with the status line on stderr, and a failing script exits non-zero with the actual JavaScript error instead of the generic user-facing sentence.That makes eval-js composable, which matters more for a skill than for docs — the agent can now chain it instead of reading a banner and a
Result:prefix.What
In
notte-browser/SKILL.md, where eval-js is taught:-o jsonfor the full envelope).JSON.stringify(...)for structured answers sojqfilters locally instead of costing another round trip through the page.set -eand||fallbacks behave.console.log; the returned value is exactly what stdout carries now.In
notte-functions-build/references/exploration.md, add the same piping note to the endpoint-verification flow, which drives eval-js.Verification
python3 scripts/validate-plugins.py→ 37 checks, no problems. Both taught commands were run against staging with a CLI built from notte-cli main:title=$(...)capturedExample Domain, and theJSON.stringify(...) | jq lengthpipe returned a count.Gate
None for the CLI teaching — notte-cli#72 is merged; it applies once a CLI release ships. (The
session.evaluate_jsmapping added in #39 still waits on the SDK release, unchanged here.)🤖 Generated with Claude Code