Skip to content

Reference

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.

TargetAdapter
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

OutcomeMeaning
successStructured 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_outputBounded, redacted invalid output with an error code.
provider_unavailableNo 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.