Skip to main content
Use this path when your runtime is TypeScript-first and already built around the Vercel AI SDK. Run CLI Setup and TypeScript SDK first, then add the AI SDK layer. CAW does not ship a dedicated AI SDK adapter. The recommended pattern is to keep CAW behind a small set of AI SDK tools backed by @cobo/agentic-wallet.

5-minute outcome

  1. Create CAW-backed tools in TypeScript
  2. Submit a pact before execution
  3. Execute a blockchain action
  4. Return policy denials as normal tool output
  5. Track the result by request_id

Step 1: Install

Step 2: Configure environment

Step 3: Build a narrow CAW tool set

vercel_ai_sdk_quickstart.ts
Start with this subset:
  • submit_pact
  • contract_call or transfer_tokens
  • get_transaction_record_by_request_id
Add get_audit_logs once you want the model to summarize operator history too. Do not expose wallet management, delegation, and every transaction primitive unless the runtime really needs them.

Design guidance

  • keep the tool set narrow and role-specific
  • use pact submission as a mandatory step before execution
  • return policy denials as normal tool output so the model can adapt
  • prefer transaction-record tracking over raw transaction polling