Playcode SDK 0.8: your app's features as operations
@playcode/sdk 0.8 (npm) is out. New Cloud apps start on it. In an older app, ask the agent to update the SDK: it reads the upgrade steps in the SDK's changelog first.
- Your app's operations.
@playcode/sdk/operationsdescribes each feature once, as a route with a description. Your pages, an assistant with four tools, and an MCP client with an app token call the same route through one executor. A lint checks every route, andoperationsContractproves your app keeps its half: Your app's operations. - Each change waits for a person.
operationCard()builds the card from the exact arguments and your app's own reads, never from the model's words. Customer-written text reaches the model inside marked blocks, and one run asks a person about at most 3 changes and 3 sends. - An approval check sees the run. Its second argument lists the calls the run already put to a person. Past your own line it answers
{ cap }, and the run ends with the newfinish: "cap". - A run keeps its session. Pass
sessiontoagent.handler(),run()orstart(). Every tool call reads it, so a sign-out stops the run at its next call. - What each agent spent. A named agent's model calls carry its name, so your app's AI usage reads by agent.
- Results for your page. A tool result can carry
datathat your page shows and no model reads.
Before you upgrade: a store with its own tables needs two new nullable columns, session on runs and sources on threads, and agentStoreContract checks both. A page that switches on finish adds the cap case.
Try it: Update my app's Playcode SDK to the latest version.