OmniRoute/@omniroute/opencode-provider/tsconfig.json
Mourad Maatoug 57354ac6d7 feat(@omniroute/opencode-provider): model capabilities, agent block, mode block (UI helpers)
Adds three UI-surface helpers on top of T1–T8 in PR #2375:

A) Model capability flags
   - ModelCapabilities interface (label, attachment, reasoning, temperature, tool_call)
   - OMNIROUTE_DEFAULT_MODEL_CAPABILITIES seeds capabilities for all 7 default
     model ids
   - OmniRouteProviderOptions.modelCapabilities merges over defaults per id
   - createOmniRouteProvider emits capability flags inline in models[id], per
     OpenCode's ProviderConfig.models schema (snake_case JSON keys, optional)
   - Label precedence: modelCapabilities[id].label > modelLabels[id] > id

B) createOmniRouteAgentBlock
   - OmniRouteAgentRole + OmniRouteAgentBlockOptions + OpenCodeAgentEntry
   - Emits Record<role, { model: 'omniroute/<id>', temperature?, top_p?,
     tools?: Record<string, boolean>, prompt? }>
   - Only fields present in OpenCode's AgentConfig schema are emitted
   - Tools normalized to Record<string, boolean> per schema (not string[])
   - Roles with empty modelId are skipped

C) createOmniRouteModesBlock (deprecated alias)
   - Same shape as createOmniRouteAgentBlock since OpenCode treats top-level
     'mode' block identically to 'agent' (both reference AgentConfig)
   - Helper kept for back-compat; @deprecated tags steer callers to agent

Shared helper buildAgentEntry eliminates duplication between A/B helpers.

Schema validation
- All emitted keys verified against https://opencode.ai/config.json
- Removed initially-considered reasoningEffort + max_tokens fields (not in
  AgentConfig schema)
- tools shape changed from string[] to Record<string, boolean> per schema

Build hygiene
- tsconfig.json narrowed to lib: ['ES2022'] + types: ['node'] (no DOM lib
  leakage); @types/node added as devDep
- Tests: 32 → 45 green (+13 net)
- Build: ESM 10.39 KB / CJS 11.01 KB / DTS 18.87 KB
2026-05-18 17:06:13 +02:00

20 lines
495 B
JSON

{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"lib": ["ES2022"],
"types": ["node"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"declaration": true,
"isolatedModules": true,
"forceConsistentCasingInFileNames": true,
"noUncheckedIndexedAccess": false,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src/**/*.ts"],
"exclude": ["dist", "node_modules", "tests"]
}