Repository navigation
replysieve 0.3.0: npm package (WebAssembly) for Cloudflare Workers and Node - #7
Merged
Merged
Conversation
Task: US-REPLYSIEVE-0.3.0-T01
Task: US-REPLYSIEVE-0.3.0-T02
Task: US-REPLYSIEVE-0.3.0-T04
Task: US-REPLYSIEVE-0.3.0-T03
…n Debug - release.yml: npm-pack builds, tests and packs with no credential after the tag and GitHub release exist; npm publishes the tarball with provenance from the npm environment. Pre-releases go to the next dist-tag and an older version never takes latest. - The API key never appears in Debug output (native and wasm). - The JavaScript missing-key error names the apiKey argument. - package.json exports only workerd, worker and node conditions. - Timeout tests wait for the abort to reach the mock; workerd latency bound relaxed on CI runners.
Merged
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.
What
@zeroonething/replysieve: the library compiled to WebAssembly with wasm-bindgen.new Checker(options, apiKey)withcheck,checkBatchand a synchronousprecheckreturns the same verdict JSON as the CLI, inside Cloudflare Workers (theworkerdexport condition, bundled by wrangler) and Node 20+ (thenodecondition). TypeScript types included.level,preset,models,rules,stock_phrases, a TOMLconfigstring (other fields override it, as CLI flags override the file),timeout_ms,base_url,log. Unknown keys, levels and presets and invalid TOML throw anErrornamedReplysieveError.fetchwithAbortSignal.timeout, keeping the same ordered model fallback and the needs_review/model_unavailable outcome. Native keeps reqwest.clifeature; the binary requires it.cargo build --lib --no-default-features --target wasm32-unknown-unknownbuilds.std::time::Instantis replaced byweb-time;Config::loadis native-only.npm/package.jsonmatches Cargo.toml, checks the registry, and publishes to npm with provenance from thenpmenvironment (main only; trusted publishing when configured, otherwiseNPM_TOKEN). Skips when the version exists, so reruns stay idempotent. Dependabot watches/npm.Proof
cargo test --locked: 48 passed, unchanged from 0.2.0. clippy-D warningson native and wasm32, fmt, cargo-deny,cargo doc -D warnings,cargo publish --dry-runall pass.npm test: 28 passed on Node 20.20.2, 22.23.4 and 24. Includes a golden test where 15 cases (every pre-check reason, model approve and rejects, fallback, model_unavailable, config and flag precedence) give the same verdicts from the package and the CLI against one mocked OpenRouter.npm run test:workerd: 5 passed. The package is packed, installed into a scratch project, bundled and run by wrangler's local runtime. Covers fallback, timeout abort, duplicate without a network call, checkBatch and typed errors.precheckinside workerd: p99 1 ms over 300 calls.npm packis 236 KB.tsc --strictpasses against the packed types.actionlintpasses on both workflows.