Skip to content

Comments

Fix/extract config type safety#59

Open
Addison-Huff wants to merge 2 commits intobrowserbase:devfrom
Addison-Huff:fix/extract-config-type-safety
Open

Fix/extract config type safety#59
Addison-Huff wants to merge 2 commits intobrowserbase:devfrom
Addison-Huff:fix/extract-config-type-safety

Conversation

@Addison-Huff
Copy link
Contributor

Use Extend SDK types for the receipt extraction config and file upload instead of casting, so the template gets type safety and autocomplete.

  • Type receiptExtractionConfig as Extend.ExtractConfigJson and pass it to client.extract() without a cast.
  • Use fs.createReadStream(filePath) for client.files.upload() instead of Blob + cast.
  • Add minimal as Extend.* assertions only where the API accepts fields not yet in the SDK types.
  • Verified with pnpm exec tsc --noEmit and a full pnpm start run.

Addison-Huff and others added 2 commits February 11, 2026 14:56
- Type receiptExtractionConfig as Extend.ExtractConfigJson for type safety
  and autocomplete per SDK contract
- Remove 'as Parameters<...>' cast so invalid config would surface as
  type errors instead of allowing invalid payloads

Co-authored-by: Cursor <cursoragent@cursor.com>
…or API-only fields

- Use fs.createReadStream(filePath) for client.files.upload (SDK type, no cast)
- Add narrow type assertions only where API accepts fields not in SDK types
  (parseConfig.advancedOptions, advancedOptions, parseConfig for engineVersion)

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant