feat(sdk): improve read_url error diagnostics and html table extraction - #1122
feat(sdk): improve read_url error diagnostics and html table extraction#1122nilaymallikk wants to merge 1 commit into
Conversation
|
Good instinct and correctly scoped to sdk/common (not touching any forbidden paths). The Two things need fixing before this is portable:
Also worth a nested-table caveat: the regex-based Address the pipe-escaping bug and add tests for the untested error codes and this becomes straightforward to port. |
Summary
Closes #1121.
Enhances the
read_urltool in@codebuff/sdkand common tool schemas:errorCodesuch asHTTP_ERROR,BLOCKED_ADDRESS,INVALID_URL,TOO_MANY_REDIRECTS,UNSUPPORTED_CONTENT_TYPE,RESPONSE_TOO_LARGE,TIMEOUT,ABORTED) and forwards HTTP status codes (e.g.404,429,500) so caller agents can differentiate retryable rate-limits from permanent errors.formatHtmlTablespre-processor during HTML readable text extraction to transform<table>elements into structured GitHub-Flavored Markdown tables instead of flattening cells into unformatted lines.Scope
All changes are strictly scoped within:
sdk/src/tools/read-url.tssdk/src/__tests__/read-url.test.tscommon/src/tools/params/tool/read-url.tsVerification
bun test sdk/src/__tests__/read-url.test.ts(21 pass)bun test sdk/src/__tests__/(470 pass)bun run cibun cli/scripts/smoke-binary.ts cli/bin/freebuff