Adapter schema
The TargetAdapter interface and result shapes.
On this page
Interface
Implement TargetAdapter from @tastecase/contracts in trusted local runner code. Provider credentials stay on your machine.
interface TargetAdapter {
readonly name: string;
readonly version: string;
run(input: TargetInput, context: { signal: AbortSignal }): Promise<TargetResult>;
}TargetInput carries the resolved catalog and task versions, synthetic brief and interests, confirmed mappings and eligible catalog IDs. Schema version: 1.0.0.
Result outcomes
| Outcome | Meaning |
|---|---|
success | Structured output: ordered recommendations (catalog ID when known, name, optional reason) and optional text. Outside-catalog and name-only items are kept for later checks. |
malformed_output | Bounded, redacted invalid output with an error code. |
provider_unavailable | No usable provider response, with a safe error and a retryable flag. |
Trace
Every result has a normalised trace with completeness complete, partial or unavailable, and metadata-only events (start, completion, tool call, tool result). No headers, bodies, tool arguments or credentials. The default OpenRouter adapter records only start/end metadata and labels its trace partial.