Skip to content

[wrangler] Add type generation for AI Search bindings#13151

Merged
petebacondarwin merged 2 commits intocloudflare:mainfrom
G4brym:add-ai-search-type-generation
Apr 1, 2026
Merged

[wrangler] Add type generation for AI Search bindings#13151
petebacondarwin merged 2 commits intocloudflare:mainfrom
G4brym:add-ai-search-type-generation

Conversation

@G4brym
Copy link
Copy Markdown
Member

@G4brym G4brym commented Mar 31, 2026

Fixes RAG-1028.

Add AiSearchNamespace and AiSearchInstance type generation to wrangler types for ai_search_namespaces and ai_search config bindings. Both simple and per-environment modes are now supported.

Previously, AI Search bindings were fully integrated into wrangler (config, validation, deployment, local dev, CLI commands) but were missing from wrangler types output. This PR closes that gap so that running wrangler types now generates the correct TypeScript types for both binding kinds:

interface Env {
  AI_SEARCH_NS: AiSearchNamespace;  // from ai_search_namespaces config
  BLOG_SEARCH: AiSearchInstance;     // from ai_search config
}

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This is an internal type generation change with no user-facing documentation impact.

Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: f1560da

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 31, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13151

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13151

miniflare

npm i https://pkg.pr.new/miniflare@13151

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13151

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13151

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13151

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13151

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13151

wrangler

npm i https://pkg.pr.new/wrangler@13151

commit: f1560da

@G4brym G4brym marked this pull request as ready for review March 31, 2026 18:24
@G4brym G4brym requested a review from a team as a code owner March 31, 2026 18:24
@G4brym G4brym requested a review from jamesopstad March 31, 2026 18:24
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 31, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@petebacondarwin petebacondarwin force-pushed the add-ai-search-type-generation branch from db1f1db to 73940b9 Compare March 31, 2026 19:17
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 31, 2026
@G4brym G4brym force-pushed the add-ai-search-type-generation branch from 73940b9 to 4291385 Compare March 31, 2026 19:28
@G4brym
Copy link
Copy Markdown
Member Author

G4brym commented Mar 31, 2026

This needs workerd to also be updated in this repo before merge.
workerd changes are already released

@petebacondarwin petebacondarwin marked this pull request as draft March 31, 2026 20:23
@petebacondarwin petebacondarwin added the blocked Blocked on other work label Mar 31, 2026
@petebacondarwin
Copy link
Copy Markdown
Contributor

Blocked on #13155

@petebacondarwin petebacondarwin removed the blocked Blocked on other work label Mar 31, 2026
@petebacondarwin petebacondarwin force-pushed the add-ai-search-type-generation branch from 4291385 to bf55102 Compare March 31, 2026 20:28
@petebacondarwin petebacondarwin marked this pull request as ready for review March 31, 2026 20:28
@G4brym
Copy link
Copy Markdown
Member Author

G4brym commented Mar 31, 2026

This pr is now ready to merge, i tested the preview package after rebase, and it successfully created the expected types

G4brym added 2 commits April 1, 2026 06:33
Add AiSearchNamespace and AiSearchInstance type generation to
`wrangler types` for ai_search_namespaces and ai_search config
bindings. Both simple and per-environment modes are supported.
@petebacondarwin petebacondarwin force-pushed the add-ai-search-type-generation branch from bf55102 to f1560da Compare April 1, 2026 05:33
@petebacondarwin petebacondarwin merged commit 9c4035b into cloudflare:main Apr 1, 2026
53 of 54 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants