// expect: Property 'contnet' does not exist // A misspelled field of a server type: `read.messages` returns the HTTP API's `SessionMessageInfo`, so the checker // refuses `message.contnet`, which would be `any` without the API's types in the stub. import type { Read } from "opencode:plugin" export function count(read: Read, id: string): number { let parts = 0 for (const message of read.messages(id)) { if (message.type === "assistant") { parts += message.contnet.length } } return parts }