feat(core): add pluggable web search (#35558)

Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
Shoubhit Dash 2026-07-26 09:25:05 +05:30 committed by GitHub
commit efb629a33a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 1700 additions and 587 deletions

View file

@ -213,6 +213,8 @@ test("refreshes resources into reactive getters", async () => {
location,
data: [{ id: "build", request: { headers: {}, body: {} }, mode: "primary", hidden: false, permissions: [] }],
})
if (url.pathname === "/api/websearch/provider")
return json({ location, data: [{ id: "standalone", name: "Standalone" }] })
return undefined
}, events)
let data!: ReturnType<typeof useData>
@ -248,6 +250,7 @@ test("refreshes resources into reactive getters", async () => {
await data.session.sync("ses_test")
await data.session.message.sync("ses_test")
await data.location.agent.sync()
await data.location.websearch.refresh()
expect(data.session.get("ses_test")?.title).toBe("Test session")
expect(data.session.message.list("ses_test").map((message) => message.id)).toEqual(["msg_first", "msg_second"])
@ -256,6 +259,7 @@ test("refreshes resources into reactive getters", async () => {
expect(app.captureCharFrame()).toContain("msg_second")
expect(data.location.default()).toEqual({ directory, workspaceID: undefined })
expect(data.location.agent.list(location)?.map((agent) => agent.id)).toEqual(["build"])
expect(data.location.websearch.list(location)).toEqual([{ id: "standalone", name: "Standalone" }])
} finally {
app.renderer.destroy()
}