Repository navigation
feat(search): let Site search ask a SearchSocket service - #1746
Merged
gregpriday merged 6 commits intoNov 28, 2026
Merged
Conversation
- Site settings choose the site's own index or a SearchSocket search address, with an optional section and scroll-to-text - The generated search code binds the chosen service; Foundation's Site search and the WebMCP tool call searchSite, with an abort signal - Results are kept to links the site can take, each opened at the words found with a text fragment and a fresh load - Pages hidden from site search, old addresses and the not-found page carry searchsocket:noindex with data-search-noindex - The shell, the skip link, the search form and page layers hidden at every size carry data-search-ignore - A Source export of a SearchSocket site adds searchsocket.config.ts - Refresh the Foundation pack digests
…-support-searchsocket-as-an-external
…-support-searchsocket-as-an-external # Conflicts: # src/agent/context.ts # src/agent/report.ts # src/engine/apply.ts # src/shared/ops.ts
# Conflicts: # resources/packs-dev/foundation-alt/pack.json # resources/packs.lock.json # resources/packs/foundation/pack.json # src/generator/index.ts # src/generator/search.ts
# Conflicts: # src/main/export.ts
…-support-searchsocket-as-an-external
gregpriday
deleted the
feature/issue-1403-support-searchsocket-as-an-external
branch
November 28, 2026 16:21
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.
Site settings gain a Site search section that chooses between the site's own index and a SearchSocket service the author hosts. With SearchSocket chosen, the website's Site search sections and the WebMCP
search_sitetool ask the service's public search address, optionally scoped to one part of the site and opening each result at the words found. The exported site holds no secret: it only ever asks the public address, and the keys stay with the SearchSocket deployment.Resolves #1403
Changes
site.search(src/shared/site-search.ts) holdsprovider,endpoint,pathPrefixandscrollToText, set throughsite.updateand checked the same way in the engine and in Site settings. The address must be a literalhttps://address with a host and no credentials, stored as browsers read it. Going back to the site's own index keeps the SearchSocket fields for a later switch, andnullclears them all. Held edits during an AI turn read the settings one by one, History names the change, and the agent's project summary shows the settings while SearchSocket is chosen.searchJs(state)bindssite-search.jsto the configured service, so code that imports it can't point it anywhere else, and the newsearchSite(query, { signal, limit })calls either the index or the service. The service is asked withPOST {q, topK, groupBy: 'page', pathPrefix}andcredentials: 'omit'. Results it can't link to are dropped: other origins, addresses outside the site's sub-path,//paths, escaped slashes, and anything SvelteKit'sresolve()would read as route syntax. Each remaining page gets its closing slash once. An unreachable or malformed answer fails the search instead of quietly searching the local index. With scroll-to-text on, a result link carries a#:~:text=fragment anddata-sveltekit-reload, so the browser opens the page at the matching heading or passage.site.search(both committed releases; lock digests refreshed). The component callssearchSitewith anAbortController. A newer search, a reset, a Back/Forward restore, a page change or leaving the page all stop a request in flight. The results body carriesdata-search-ignore. Like the earlier direct edits to these releases, this one needs mirroring in builder-components before the next pack refresh.<meta name="searchsocket:noindex" content="true" data-search-noindex />, and so do old-address redirects and the not-found page.data-search-ignore.searchsocket.config.ts(static-output overbuild/,respectRobotsNoindex: falseso site search follows Builder's own switch, and notes on env keys, CORS and project ID). An existing file is never overwritten.codecheck'sfetchban is unchanged. The network call lives in the generated, settings-bound helper, not in authored code.Not changed
data-search-ignore.data-search-ignore, because a placement or a variant can show them again.'') under a sub-path site is dropped. Root-relative URLs, which SearchSocket's static-output mode writes, are unaffected.Testing
tests/unit/site-search-socket.test.ts(20 tests) runs the generated helper against a fake service and covers the settings, markup, scaffold and held edits.tests/unit/site-search-visitor.test.tsruns in headless Chromium. It covers a semantic hit from?q=with a base-path link, a text fragment and reload; a failed service; an overtaken search; and leaving the page, with the stopped requests seen as aborted. Both of its tests fail on the previous Foundation source.tests/unit/site-settings-agents-text.test.ts.committed-packs,code-manifestandgeneration-cacheswapped in for the lowest-ranked; plushistory-stepsandai-turn-reviewafter the fixes), all green.tests/unit/asset-files.test.ts(damaged smaller copy, Damaged responsive image copies go undetected in Assets and editable export #1459) failed twice under load and passes alone; this change doesn't reach it.npm run typecheck:changedgreen.