Skip to content

feat: update AI Search type definitions for new binding#6390

Open
G4brym wants to merge 1 commit intocloudflare:mainfrom
G4brym:gmassadas/ai-search-binding-types-v5
Open

feat: update AI Search type definitions for new binding#6390
G4brym wants to merge 1 commit intocloudflare:mainfrom
G4brym:gmassadas/ai-search-binding-types-v5

Conversation

@G4brym
Copy link
Copy Markdown
Member

@G4brym G4brym commented Mar 23, 2026

Updates the AI Search TypeScript type definitions to align with final binding spec (path-based namespaces, two separate binding types).

This enables Wrangler type generation to produce correct types for the ai_search_namespaces and ai_search bindings once the workers-sdk PR lands.

@G4brym G4brym changed the title feat: update AI Search type definitions for V5 namespace binding spec feat: update AI Search type definitions for new binding Mar 23, 2026
@G4brym G4brym force-pushed the gmassadas/ai-search-binding-types-v5 branch 6 times, most recently from 2d7b7a1 to fe2fb5e Compare March 23, 2026 18:58
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.65%. Comparing base (d62d62a) to head (66f9f72).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6390      +/-   ##
==========================================
- Coverage   70.81%   70.65%   -0.16%     
==========================================
  Files         425      425              
  Lines      116296   116845     +549     
  Branches    18773    18880     +107     
==========================================
+ Hits        82357    82561     +204     
- Misses      22707    23039     +332     
- Partials    11232    11245      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@G4brym G4brym force-pushed the gmassadas/ai-search-binding-types-v5 branch from fe2fb5e to 0460ee3 Compare March 23, 2026 19:08
Aligns ai-search.d.ts with the V5 binding spec (path-based namespaces).

Key changes:
- Rename AiSearchAccountService -> AiSearchNamespace (namespace-scoped, not account-scoped)
- Rename AiSearchInstanceService -> AiSearchInstance
- Add delete(name) to AiSearchNamespace (namespace-level deletion)
- Remove delete() from AiSearchInstance (moved to namespace level)
- Add update(), stats(), items, jobs to AiSearchInstance
- Add sub-service types: AiSearchItems, AiSearchItem, AiSearchJobs, AiSearchJob
- Add item/job metadata types and request/response types
- Remove AiSearchNameNotSetError (V4 concept, namespace always present in V5)
- Update Ai.aiSearch() return type and JSDoc
- Update AutoRAG @see references
@G4brym G4brym force-pushed the gmassadas/ai-search-binding-types-v5 branch from 0460ee3 to 66f9f72 Compare March 24, 2026 16:52
@G4brym G4brym marked this pull request as ready for review March 27, 2026 11:18
@G4brym G4brym requested review from a team as code owners March 27, 2026 11:18
@G4brym G4brym requested a review from ascorbic March 27, 2026 11:18
Copy link
Copy Markdown
Contributor

@joshthoward joshthoward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving only to remove the need for a DO approval. I have only confirmed that DO does not object to these changes.

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.

4 participants