cloudaxe-opencode/packages/opencode
Kyle Mistele 32ef11da1f feat: add structured output (JSON schema) support
Add outputFormat option to session.prompt() for requesting structured JSON
output. When type is 'json_schema', injects a StructuredOutput tool that
validates model output against the provided schema.

- Add OutputFormat schema types (text, json_schema) to message-v2.ts
- Add structured_output field to AssistantMessage
- Add StructuredOutputError for validation failures
- Implement createStructuredOutputTool helper in prompt.ts
- Integrate structured output into agent loop with retry support
- Regenerate OpenAPI spec with new types
- Add unit tests for schema validation
2026-01-12 20:09:51 -08:00
..
bin fix: windows install (#4293) 2025-11-13 12:22:07 -06:00
script try uploading artifacts in workflow 2025-12-22 17:08:44 +08:00
src feat: add structured output (JSON schema) support 2026-01-12 20:09:51 -08:00
test feat: add structured output (JSON schema) support 2026-01-12 20:09:51 -08:00
.gitignore
AGENTS.md ci: send stats to posthog 2025-08-05 12:01:48 -04:00
bunfig.toml OpenTUI is here (#2685) 2025-10-31 15:07:36 -04:00
Dockerfile add ARM64 Docker image support (#5483) 2025-12-13 13:01:59 -06:00
package.json release: v1.0.193 2025-12-23 15:16:20 +00:00
parsers-config.ts Add YAML language server support (#4508) 2025-11-19 14:47:04 -06:00
README.md
sst-env.d.ts wip: zen 2025-12-02 18:36:15 -05:00
tsconfig.json try tsgo 2025-10-14 18:30:32 -04:00

js

To install dependencies:

bun install

To run:

bun run index.ts

This project was created using bun init in bun v1.2.12. Bun is a fast all-in-one JavaScript runtime.