refactor(tool-web): port web tools to the render-intent union

master's web_search/web_fetch tools were authored against the old
ToolCallPresentation bag; the render-intent union replaces it with a
card-tagged discriminated union. Both are simple generic cards, so they
declare card:'generic' explicitly.
This commit is contained in:
Tianyi Cui
2026-07-03 22:52:18 +08:00
parent 53ebf6fc54
commit 8ca82d03ab
3 changed files with 8 additions and 8 deletions

View File

@@ -80,7 +80,7 @@ describe('search formatting', () => {
})
it('presents a search call as a search-kind card titled by the query', () => {
expect(presentSearchCall({ query: 'find me' })).toEqual({ title: 'find me', kind: 'search', rawInput: 'find me' })
expect(presentSearchCall({ query: 'find me' })).toEqual({ card: 'generic', title: 'find me', kind: 'search', rawInput: 'find me' })
})
})
@@ -116,7 +116,7 @@ describe('fetch formatting', () => {
})
it('presents a fetch call as a fetch-kind card titled by the url', () => {
expect(presentFetchCall({ url: 'https://a.test' })).toEqual({ title: 'https://a.test', kind: 'fetch', rawInput: 'https://a.test' })
expect(presentFetchCall({ url: 'https://a.test' })).toEqual({ card: 'generic', title: 'https://a.test', kind: 'fetch', rawInput: 'https://a.test' })
})
})