Conversation
The `fs_create_file` tool previously printed raw markdown code fences in its confirmation message. Now it passes the fence through `jp_md::Formatter` to render terminal-colored syntax highlighting, falling back to the raw fence if formatting fails. Also adds a test module for `create_file` covering both the format-arguments path (checking for ANSI codes and no raw fences) and the run path (verifying the file is actually written). The `jp_md` buffer test suite is extended to verify that blank lines inside fenced code blocks are preserved as `FencedCodeLine` events. Signed-off-by: Jean Mertz <git@jeanmertz.com>
Previously, `web_fetch` returned raw HTML to the LLM, which is verbose and hard to process—full of tags, scripts, and styles that consume tokens without adding useful information. The tool now converts HTML responses to Markdown using `htmd`, stripping `<script>`, `<style>`, `<noscript>`, `<svg>`, and `<iframe>` tags in the process. The page `<title>` is extracted and prepended as an H1 heading, HTML entities in the title are decoded, and consecutive blank lines are collapsed to at most two to keep output compact. Binary content types (images, audio, video, PDFs, etc.) are now rejected early with a descriptive error rather than returning garbled bytes. For large pages exceeding 200 KB, the tool first attempts to summarize the content via Claude Haiku using the `ANTHROPIC_API_KEY` environment variable. If that's unavailable or fails, it falls back to hard truncation with a note indicating how many bytes were cut. Signed-off-by: Jean Mertz <git@jeanmertz.com>
…tput Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
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.
Previously,
web_fetchreturned raw HTML to the LLM, which is verbose and hard to process—full of tags, scripts, and styles that consume tokens without adding useful information.The tool now converts HTML responses to Markdown using
htmd, stripping<script>,<style>,<noscript>,<svg>, and<iframe>tags in the process. The page<title>is extracted and prepended as an H1 heading, HTML entities in the title are decoded, and consecutive blank lines are collapsed to at most two to keep output compact.Binary content types (images, audio, video, PDFs, etc.) are now rejected early with a descriptive error rather than returning garbled bytes.
For large pages exceeding 200 KB, the tool first attempts to summarize the content via Claude Haiku using the
ANTHROPIC_API_KEYenvironment variable. If that's unavailable or fails, it falls back to hard truncation with a note indicating how many bytes were cut.