feat: AI Search plugin with indexing, search modal, and demo site - #633
Conversation
🦋 Changeset detectedLatest commit: 5b05bc0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
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 |
Scope checkThis PR changes 11,732 lines across 42 files. Large PRs are harder to review and more likely to be closed without review. If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs. See CONTRIBUTING.md for contribution guidelines. |
|
This PR has been inactive for 14 days. It will be closed automatically in 7 days if there is no further activity. If you're still working on this, please push an update or leave a comment. |
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
42d3926 to
b01b810
Compare
8bb675d to
e60e88e
Compare
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-verification
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
Cloudflare reports a missing AI Search instance as AiSearchNotFoundError with the message ai_search_not_found, which the missing-instance check did not match. The metadata route therefore answered 503 for a fresh or deleted instance instead of reporting it as repairable.
The info() probe treated every failure as a missing instance, so a transient error or an auth failure triggered a spurious create and a second failure. Rethrow anything that is not a recognized missing-instance error, and when a concurrent initializer wins the create, re-probe rather than surfacing it.
Several AI Search call sites imported the module independently on every operation. Share one cached import, keeping the rejection uncached so a later call can retry.
Saving a narrower collection selection left the already-uploaded items of the removed collections searchable, since the selection only gated later content hooks. Persist the selection first, then delete the mirrored documents whose collection is no longer selected.
Configured plugins have no install hook, so the content hooks only cover content created or updated after AI Search is enabled. Document the manual full sync as a required setup step, and correct the admin page name.
10a8069 to
5b05bc0
Compare
What does this PR do?
Adds a Cloudflare-native AI Search plugin for EmDash, powered by Cloudflare AI Search. This includes:
packages/cloudflare/that indexes content into an AI Search namespace via the native worker binding, with content-sync hooks, a cron-flushed reindex queue, query synonyms, an index-status endpoint, and a settings admin UIdemos/cloudflare/) that register the AI Search binding, add a cron trigger to flush the reindex queue, and add a/searchpage backed by the plugin's query endpointType of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runpnpm locale:extracthas been run (if applicable)AI-generated code disclosure
Screenshots / test output