Repository navigation
feat(node): options object on every function and extractDocument - #35
Merged
Merged
Conversation
Opt-in `tool` feature adds markkit::tool: MarkkitToolBuilder -> MarkkitTool -> single-use ToolExecution, mirroring bashkit's tool module. One call converts a url, html or base64 document to Markdown; args validated before execution, base64 bounded before decode, URL via the SSRF guard, output capped by max_output_chars. Adds Markkit::extract_url_document.
wasm-bindgen build of markkit (html, docx, spreadsheet, tool) for wasm32-unknown-unknown: single-threaded, no COOP/COEP, no URL fetching. Markkit class with validated camelCase options plus MarkkitTool. Node tests, CI job gating Check, and an OIDC npm publisher.
Node functions take an optional trailing MarkkitOptions object with every builder field plus URL policy (allowPrivateNetworks, allowedHosts, maxRedirects, maxProcessingSecs); same camelCase shape as the WASM package. Adds extractDocument/extractDocumentSync with title, format, warnings and stats, and node --test binding tests in js.yml.
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.
Requested by Михайло · project thread
What changed
Node (
@everruns/markkit) catches up with Python and the new WASM package:extractHtml,extractHtmlSync,extractUrl,extractBytes) takes an optional trailingoptionsobject. Existing calls are unchanged.MarkkitOptionsuses the same camelCase builder fields as@everruns/markkit-wasm:maxInputSize,preserveLinks,preserveImages,includeSelectors,excludeSelectors(added to defaults), archive/sheet limits,includeHiddenSheets. It also adds URL policy:maxProcessingSecs,allowPrivateNetworks,allowedHosts,maxRedirects. Bindings could not reach a private-network URL before; now they can opt in.extractDocument/extractDocumentSync→{ markdown, title, format, warnings, stats, metadata }.invalid options.node --testbinding tests run injs.ymlafter the native build.knowledge/runtimes/node-package.md: API and a Python/Node/WASM parity table; README updated.Why
Roadmap: Node options parity (memory note: Node lacked
extract_html_sync_with_options; bindings had no opt-in for private-network fetch).Before / After
Before:
extractHtmlSync(html)only used defaults; no way to set selectors or URL policy from Node; no metadata.After:
including
extractUrl(local)rejectingURL blockedby default, succeeding with{ allowPrivateNetworks: true }, and rejecting again withallowedHosts: ["example.com"].Risk
Limits) keeps the builder setters this uses; its bindings follow-up can add new limits (timeout,maxOutputSize, ...) to this same options object.Checklist
Generated by Claude Code