agentcard.ts
storeWaitMs passed, whichever comes first. Leave both options out and Agentcard chooses the wait.
Agentcard ends every store search at 30 seconds, so a storeWaitMs above 30000 waits no longer than 30000 does.
Show late cards in a streaming chat
A chat that shows cards as they come usesstoreWaitMs: 25000 and lateResults: 'stream'. Each store’s cards show the moment that store answers, so the shopper sees products long before the reply. The reply waits up to 25 seconds, and 99.7% of stores show their first products within that wait. A store that answers later sends its cards in the same turn, after the reply, with one message that says what they added:
sendLink, onProducts, or onItem. Keep each callback ready to add a card below the reply, not only above it. The turn’s onResult lists the late cards in result.products, after the answer’s own, so a cart panel or a list of products built from onResult shows them too.
Hold late cards in a texting app
A texting app that cannot add a card after it sent the reply usesstoreWaitMs: 20000 and lateResults: 'hold':
sms.ts
Set a wait for one turn
Pass the same options tobuy.turn to change them for one message. An option the turn leaves out keeps the tool’s:
chat.ts
client.buy itself sends the fields store_wait_ms and late_results on the request.
A storeWaitMs that is not a whole number of milliseconds, 0 or more, or a lateResults other than stream or hold, throws a TypeError before any call, so a typo never reaches a shopper. buyTool({ agentcard, externalUserId: shopper.id, storeWaitMs: '25s' }) throws:
agentcard.ts