agent-contracts-runtime 0.33.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -913,14 +913,40 @@ bindings: # optional, for guardrail hook genera
913
913
  - ./bindings/runtime.yaml
914
914
  active_guardrail_policy: default # which guardrail_policy to activate
915
915
  templates_dir: ./custom-templates # optional, overrides built-in templates
916
+
917
+ model_mapping: # optional, per-task LLM routing
918
+ fast:
919
+ adapter: gemini
920
+ model: gemini-2.5-flash
921
+ standard:
922
+ adapter: claude
923
+ model: claude-sonnet-4-20250514
924
+ thinking:
925
+ adapter: cursor
926
+ model: claude-4-opus
916
927
  ```
917
928
 
929
+ ### Per-task LLM selection
930
+
931
+ Tasks in the DSL can declare a `model_class` (`fast`, `standard`, or `thinking`) to express the required LLM capability level. The runtime resolves each `model_class` to a concrete adapter + model pair using a 4-layer priority chain:
932
+
933
+ | Priority | Source | Example |
934
+ |----------|--------|---------|
935
+ | 1 (highest) | `AGENT_RUNTIME_MODEL_{FAST\|STANDARD\|THINKING}` env var | `AGENT_RUNTIME_MODEL_THINKING=cursor:claude-4-opus` |
936
+ | 2 | `AGENT_RUNTIME_MODEL` env var (catch-all) | `AGENT_RUNTIME_MODEL=claude:claude-sonnet-4-20250514` |
937
+ | 3 | `model_mapping.<class>` in config | `model_mapping.thinking.adapter: cursor` |
938
+ | 4 (lowest) | CLI `--adapter` + adapter default model | `--adapter claude` |
939
+
940
+ Environment variable format is `adapter:model` (colon-separated). Omitting the model part (`claude:`) uses the adapter default. Omitting the adapter part (`claude-haiku`, no colon) uses the `--adapter` value.
941
+
942
+ This enables cross-provider routing — e.g. fast tasks on Gemini, thinking tasks on Cursor — within a single workflow execution.
943
+
918
944
  ## Exports
919
945
 
920
946
  | Import path | Description |
921
947
  |-------------|-------------|
922
- | `agent-contracts-runtime` | Core runtime API (`runWorkflow`, `runTask`, `createRuntime`, `buildTaskPrompt`, `pluginRegistry`, `zodSchemaToPromptDescription`) |
923
- | `agent-contracts-runtime` | Types (`WorkflowInvocation`, `HandoffInput`, `AgentExecutionRequest`, `WorkflowRegistries`, `SdkAdapter`, `AdapterSendOptions`, `TaskContext`, `TaskOutcome`, etc.) |
948
+ | `agent-contracts-runtime` | Core runtime API (`runWorkflow`, `runTask`, `createRuntime`, `buildTaskPrompt`, `pluginRegistry`, `createModelResolver`, `zodSchemaToPromptDescription`) |
949
+ | `agent-contracts-runtime` | Types (`WorkflowInvocation`, `HandoffInput`, `AgentExecutionRequest`, `WorkflowRegistries`, `SdkAdapter`, `ModelAwareSdkAdapterFactory`, `ModelResolver`, `ModelClass`, `TaskContext`, `TaskOutcome`, etc.) |
924
950
  | `agent-contracts-runtime/generator` | Generator API (`generate`, `checkFreshness`, `buildContractContext`) |
925
951
  | `agent-contracts-runtime/adapters/cursor-sdk` | Cursor SDK adapter |
926
952
  | `agent-contracts-runtime/adapters/claude-agent-sdk` | Claude Agent SDK adapter |
@@ -1,4 +1,4 @@
1
- import { S as SdkAdapter, A as AdapterSendOptions, b as AgentExecutionRequest } from '../task-runner-yKP-pDpC.js';
1
+ import { S as SdkAdapter, A as AdapterSendOptions, b as AgentExecutionRequest } from '../task-runner-D8qZhshM.js';
2
2
  import { b as GuardrailHooks } from '../guardrail-hooks-BfKq8Myc.js';
3
3
  import 'zod';
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as SdkAdapter, A as AdapterSendOptions } from '../task-runner-yKP-pDpC.js';
1
+ import { S as SdkAdapter, A as AdapterSendOptions } from '../task-runner-D8qZhshM.js';
2
2
  import { b as GuardrailHooks } from '../guardrail-hooks-BfKq8Myc.js';
3
3
  import 'zod';
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as SdkAdapter, A as AdapterSendOptions, b as AgentExecutionRequest } from '../task-runner-yKP-pDpC.js';
1
+ import { S as SdkAdapter, A as AdapterSendOptions, b as AgentExecutionRequest } from '../task-runner-D8qZhshM.js';
2
2
  import { b as GuardrailHooks } from '../guardrail-hooks-BfKq8Myc.js';
3
3
  import 'zod';
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as SdkAdapter, A as AdapterSendOptions } from '../task-runner-yKP-pDpC.js';
1
+ import { S as SdkAdapter, A as AdapterSendOptions } from '../task-runner-D8qZhshM.js';
2
2
  import 'zod';
3
3
 
4
4
  declare class MockAdapter implements SdkAdapter {
@@ -1,4 +1,4 @@
1
- import { S as SdkAdapter, A as AdapterSendOptions, b as AgentExecutionRequest } from '../task-runner-yKP-pDpC.js';
1
+ import { S as SdkAdapter, A as AdapterSendOptions, b as AgentExecutionRequest } from '../task-runner-D8qZhshM.js';
2
2
  import { b as GuardrailHooks } from '../guardrail-hooks-BfKq8Myc.js';
3
3
  import 'zod';
4
4