Result contracts

Validated envelopes for local worker output

The SDK validates completed text, object, file, and image results before saving them. Invalid worker payloads are rejected.

Examples

Common result payloads

Text result
{
  "kind": "text",
  "summary": "Generated text.",
  "text": "A concise sentence.",
  "provider": "codexdock",
  "model": "local-codex",
  "parameters": { "usage": "scene_caption" }
}
Image result
{
  "kind": "image",
  "summary": "Generated image artifact.",
  "filename": "thumbnail.png",
  "mediaType": "image/png",
  "encoding": "base64",
  "base64": "...",
  "parameters": { "usage": "scene_thumbnail" }
}
Object result
{
  "kind": "object",
  "summary": "Generated structured data.",
  "object": {
    "cards": [
      { "title": "Fast local work", "tone": "clear" }
    ]
  },
  "parameters": { "usage": "product-preview" }
}
File result
{
  "kind": "file",
  "summary": "Generated markdown.",
  "filename": "release-notes.md",
  "mediaType": "text/markdown",
  "text": "## Release notes",
  "parameters": { "usage": "docs" }
}