@nuvin/agent-core 0.2.0-rc.1 → 0.2.0-rc.3

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.
Files changed (42) hide show
  1. package/dist/VERSION +2 -2
  2. package/dist/agent/index.js +1 -1
  3. package/dist/agent/metrics.d.ts +8 -0
  4. package/dist/chunk-D5IVWJHX.js +1 -1
  5. package/dist/chunk-FFIZ6TKW.js +1 -1
  6. package/dist/chunk-IUZALP6K.js +1 -0
  7. package/dist/chunk-LIE76IJA.js +1 -0
  8. package/dist/chunk-QKOKWD5Y.js +1 -0
  9. package/dist/chunk-X7VAACWY.js +1 -1
  10. package/dist/chunk-YNOIG4FD.js +1 -0
  11. package/dist/formats/index.js +1 -1
  12. package/dist/hooks/index.js +1 -1
  13. package/dist/models/chat-model.d.ts +1 -0
  14. package/dist/models/index.d.ts +2 -0
  15. package/dist/models/index.js +1 -1
  16. package/dist/models/mock-model.d.ts +2 -0
  17. package/dist/models/model-cost.d.ts +5 -0
  18. package/dist/models/model-pricing-generator.d.ts +9 -0
  19. package/dist/models/model-pricing-products.d.ts +45 -0
  20. package/dist/models/model-pricing-types.d.ts +33 -0
  21. package/dist/models/model-pricing.d.ts +13 -0
  22. package/dist/models/model-pricing.generated.d.ts +23147 -0
  23. package/dist/models/model-registry.d.ts +8 -0
  24. package/dist/models/openai-surfaces.d.ts +4 -1
  25. package/dist/models/routed-model.d.ts +3 -0
  26. package/dist/shared/index.js +1 -1
  27. package/dist/shared/reasoning-config.d.ts +3 -4
  28. package/dist/shared/types.d.ts +49 -17
  29. package/dist/tools/index.d.ts +3 -0
  30. package/dist/tools/index.js +1 -1
  31. package/dist/tools/mcp-connection-generation.d.ts +59 -0
  32. package/dist/tools/mcp-safe-error-provenance.d.ts +4 -0
  33. package/dist/tools/mcp-safe-error.d.ts +14 -0
  34. package/dist/tools/mcp-server-manager.d.ts +3 -47
  35. package/dist/tools/mcp-tool-adapter.d.ts +26 -1
  36. package/dist/tools/runtime-manager-tools.d.ts +11 -0
  37. package/dist/tools/tools.d.ts +4 -1
  38. package/package.json +2 -2
  39. package/dist/chunk-E4R6CEFK.js +0 -1
  40. package/dist/chunk-NYZR4XKO.js +0 -1
  41. package/dist/chunk-RABU4RC2.js +0 -1
  42. package/dist/chunk-RTDLM6FU.js +0 -1
@@ -1,7 +1,9 @@
1
+ import type { ModelReasoningConfig } from "@nuvin/config";
1
2
  import type { ChatModelAuthScheme, ChatModelSurface } from "./chat-model.ts";
2
3
  export interface ModelProfile {
3
4
  contextWindow?: number;
4
5
  maxOutput?: number;
6
+ reasoning?: ModelReasoningConfig;
5
7
  surface?: ChatModelSurface;
6
8
  baseUrl?: string;
7
9
  }
@@ -29,7 +31,13 @@ export interface ResolvedModelProfile {
29
31
  supportsModelFetch?: boolean;
30
32
  contextWindow?: number;
31
33
  maxOutput?: number;
34
+ reasoning?: ModelReasoningConfig;
32
35
  }
36
+ export declare const REASONING_METADATA_VERSIONS: {
37
+ readonly anthropic: "2026-07-22";
38
+ readonly openai: "2026-07-22";
39
+ readonly codex: "0.145.0+25af12f7e61572b0bc18ddb1008be543b91519b0";
40
+ };
33
41
  export declare function getProviderProfile(provider: string): ProviderProfile | undefined;
34
42
  export declare function getModelProfile(provider: string, model: string): ModelProfile | undefined;
35
43
  export declare function resolveModelProfile(provider: string, model: string): ResolvedModelProfile | undefined;
@@ -43,8 +43,11 @@ interface OpenAiChatCompletionsRequest {
43
43
  messages: OpenAiChatCompletionMessage[];
44
44
  max_completion_tokens?: number;
45
45
  max_tokens?: number;
46
- reasoning_effort?: "high" | "low" | "medium" | "minimal" | "none" | "xhigh";
46
+ reasoning_effort?: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh";
47
47
  stream: boolean;
48
+ stream_options?: {
49
+ include_usage: true;
50
+ };
48
51
  tools?: OpenAiChatCompletionToolDefinition[];
49
52
  response_format?: {
50
53
  type: "json_schema";
@@ -32,6 +32,7 @@ export interface RoutedModelOptions {
32
32
  model: string;
33
33
  modelIdentity?: string;
34
34
  maxTokens?: number;
35
+ pricingProviderId?: string;
35
36
  reasoning?: ReasoningConfig;
36
37
  providerAdapter: ProviderAdapter;
37
38
  providerSessionResolver?: ProviderSessionResolver;
@@ -45,6 +46,7 @@ export declare class RoutedModel implements EngineChatModel {
45
46
  readonly model: string;
46
47
  readonly modelIdentity: string;
47
48
  readonly maxTokens?: number;
49
+ readonly pricingProviderId?: string;
48
50
  protected readonly reasoning?: ReasoningConfig;
49
51
  protected readonly apiKey?: string;
50
52
  protected readonly baseUrl: string;
@@ -83,6 +85,7 @@ export declare class RoutedModel implements EngineChatModel {
83
85
  protected mapApiError(error: Error): Error;
84
86
  protected toApiError(response: Response): Promise<Error>;
85
87
  private getSurface;
88
+ protected withPricingProviderId(request: ChatRequest): ChatRequest;
86
89
  private prepareChatRequest;
87
90
  protected applyModelDefaults(request: ChatRequest): ChatRequest;
88
91
  private sendHttpSurfaceRequest;
@@ -1 +1 @@
1
- (function(_0x1a44ae,_0x4b642c){var _0x1769c9={_0x2059bc:0x263,_0x38ba40:0x267,_0xf31b37:0x26b,_0x29ef54:0x26a,_0x42fa9f:0x269,_0x3c7788:0x262,_0x120428:0x261,_0xc4fb5d:0x224,_0x19adf5:0x21f,_0x2f92dd:0x21e,_0x2b2d28:0x266,_0x59f9ca:0x265,_0x4f2921:0x264,_0x38a5ed:0x227,_0x47f7a3:0x21d,_0x210ff3:0x222,_0x49b3aa:0x228,_0x48b494:0x223,_0x661105:0x272,_0x1c67da:0x26c,_0x212a38:0x21c,_0x56f2d4:0x21a,_0x417d50:0x220,_0x108f40:0x268},_0x13548a={_0x32b835:0x395},_0x524750=_0x1a44ae();function _0x2612ef(_0x507809,_0x3168d3,_0x388964,_0x8067bf){return _0x4438(_0x388964-0xf3,_0x8067bf);}function _0x4d3df5(_0x1461e6,_0xc32b9f,_0x5c9ca0,_0x58377a){return _0x4438(_0x5c9ca0- -_0x13548a._0x32b835,_0x1461e6);}while(!![]){try{var _0x501036=parseInt(_0x4d3df5(-0x26c,-_0x1769c9._0x2059bc,-_0x1769c9._0x38ba40,-_0x1769c9._0xf31b37))/0x1+parseInt(_0x4d3df5(-0x26d,-_0x1769c9._0x29ef54,-0x26b,-_0x1769c9._0x42fa9f))/0x2+-parseInt(_0x4d3df5(-_0x1769c9._0x3c7788,-_0x1769c9._0x120428,-0x262,-0x265))/0x3*(parseInt(_0x2612ef(0x220,_0x1769c9._0xc4fb5d,_0x1769c9._0x19adf5,_0x1769c9._0x2f92dd))/0x4)+parseInt(_0x4d3df5(-0x260,-_0x1769c9._0x2b2d28,-_0x1769c9._0x59f9ca,-_0x1769c9._0x4f2921))/0x5+-parseInt(_0x2612ef(_0x1769c9._0x38a5ed,_0x1769c9._0x47f7a3,_0x1769c9._0x210ff3,0x228))/0x6*(parseInt(_0x2612ef(_0x1769c9._0x49b3aa,0x223,0x225,_0x1769c9._0x48b494))/0x7)+-parseInt(_0x4d3df5(-0x269,-_0x1769c9._0x661105,-_0x1769c9._0x1c67da,-0x26a))/0x8*(-parseInt(_0x2612ef(_0x1769c9._0x212a38,_0x1769c9._0x56f2d4,_0x1769c9._0x417d50,0x224))/0x9)+-parseInt(_0x2612ef(0x221,0x222,0x224,0x227))/0xa*(parseInt(_0x4d3df5(-_0x1769c9._0x108f40,-0x26f,-0x26a,-0x26e))/0xb);if(_0x501036===_0x4b642c)break;else _0x524750['push'](_0x524750['shift']());}catch(_0x440116){_0x524750['push'](_0x524750['shift']());}}}(_0x212a,0x20f04));import{modelIdentityFromParts}from'../chunk-D5IVWJHX.js';function _0x212a(){var _0x47964d=['mZG1ntv2tvzXtwy','mJb6wurgDhm','mtHrzKj1vMC','mty2mdK5vgretMzs','nZj6yKLzr2q','mti3ndu0mhnWwfzNuW','ntiWsMzitvff','mteYnZKXB2rfzgje','nJC5odLdCurzqwq','mJq2ndmYDgfVs01j','mJGYndy0D0Loz21q'];_0x212a=function(){return _0x47964d;};return _0x212a();}import{mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig}from'../chunk-NYZR4XKO.js';function _0x4438(_0x2c8eb2,_0x4df041){_0x2c8eb2=_0x2c8eb2-0x129;var _0x212a73=_0x212a();var _0x4438d8=_0x212a73[_0x2c8eb2];if(_0x4438['FKnJEj']===undefined){var _0x348666=function(_0x1469e8){var _0x2177cf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3b5833='',_0x4d09b2='';for(var _0x48a4d9=0x0,_0x1baa76,_0x5cbaf4,_0xd85d51=0x0;_0x5cbaf4=_0x1469e8['charAt'](_0xd85d51++);~_0x5cbaf4&&(_0x1baa76=_0x48a4d9%0x4?_0x1baa76*0x40+_0x5cbaf4:_0x5cbaf4,_0x48a4d9++%0x4)?_0x3b5833+=String['fromCharCode'](0xff&_0x1baa76>>(-0x2*_0x48a4d9&0x6)):0x0){_0x5cbaf4=_0x2177cf['indexOf'](_0x5cbaf4);}for(var _0x3a9311=0x0,_0x1c0456=_0x3b5833['length'];_0x3a9311<_0x1c0456;_0x3a9311++){_0x4d09b2+='%'+('00'+_0x3b5833['charCodeAt'](_0x3a9311)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d09b2);};_0x4438['ixrnln']=_0x348666,_0x4438['JwTCHQ']={},_0x4438['FKnJEj']=!![];}var _0x2498ea=_0x212a73[0x0],_0x59c234=_0x2c8eb2+_0x2498ea,_0x331644=_0x4438['JwTCHQ'][_0x59c234];return!_0x331644?(_0x4438d8=_0x4438['ixrnln'](_0x4438d8),_0x4438['JwTCHQ'][_0x59c234]=_0x4438d8):_0x4438d8=_0x331644,_0x4438d8;}import{TurnFailedError}from'../chunk-FFIZ6TKW.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';export{OperationAbortedError,TurnFailedError,addAbortListener,isAbortError,mapAutoReasoningEffortToBudgetTokens,modelIdentityFromParts,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
1
+ (function(_0x52d6a9,_0x19b009){var _0x1af99f={_0x5f604f:0x187,_0x5b8d97:0x184,_0x143e9d:0xca,_0x571f70:0xc9,_0x5a51c1:0xc8,_0x29b68e:0xca,_0x3899cb:0xd3,_0x184fd0:0xd0,_0xff9145:0xcb,_0x8c15cd:0x189,_0x3a3656:0x18a,_0x161592:0x18d,_0x583c86:0x185,_0x2fd984:0x180,_0x31c6f1:0x188,_0x561f84:0xc9},_0x3ea0bf=_0x52d6a9();function _0x17f373(_0x395d31,_0x424fa5,_0x5c23f4,_0x408dee){return _0x4cd4(_0x424fa5- -0x325,_0x395d31);}function _0x4eada4(_0x275509,_0x44c80a,_0x59dfe2,_0x63b107){return _0x4cd4(_0x59dfe2- -0xcf,_0x63b107);}while(!![]){try{var _0x100239=-parseInt(_0x17f373(-0x182,-_0x1af99f._0x5f604f,-0x188,-_0x1af99f._0x5b8d97))/0x1+parseInt(_0x4eada4(_0x1af99f._0x143e9d,_0x1af99f._0x571f70,_0x1af99f._0x5a51c1,0xc6))/0x2+parseInt(_0x4eada4(0xc8,0xc6,_0x1af99f._0x29b68e,0xcc))/0x3*(parseInt(_0x4eada4(0xd5,_0x1af99f._0x3899cb,_0x1af99f._0x184fd0,_0x1af99f._0xff9145))/0x4)+-parseInt(_0x17f373(-0x184,-_0x1af99f._0x8c15cd,-0x187,-0x184))/0x5*(-parseInt(_0x17f373(-0x189,-_0x1af99f._0x3a3656,-_0x1af99f._0x161592,-0x189))/0x6)+-parseInt(_0x17f373(-0x183,-_0x1af99f._0x583c86,-_0x1af99f._0x2fd984,-0x186))/0x7*(parseInt(_0x17f373(-0x189,-0x18b,-_0x1af99f._0x5f604f,-0x18e))/0x8)+parseInt(_0x17f373(-0x186,-_0x1af99f._0x31c6f1,-0x189,-_0x1af99f._0x5f604f))/0x9+-parseInt(_0x4eada4(0xca,0xca,_0x1af99f._0x561f84,0xcb))/0xa;if(_0x100239===_0x19b009)break;else _0x3ea0bf['push'](_0x3ea0bf['shift']());}catch(_0x595eb2){_0x3ea0bf['push'](_0x3ea0bf['shift']());}}}(_0xae9d,0x93226));function _0xae9d(){var _0x2450e2=['nJqWmteYvNH5shLz','odKWotaWzvHQswT0','m0LAqxznBa','ndCYnJiZmMjQsgvPCq','nNvhtwDpAa','mtG3mte1mhjVsNj6Da','mtaZndq3mtDxs1fpsxu','odq1ndqWwLLwEMnb','mZuWmdiWneLIuhDkDa','mtr3wu1jrNC'];_0xae9d=function(){return _0x2450e2;};return _0xae9d();}import{modelIdentityFromParts}from'../chunk-D5IVWJHX.js';import{resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig}from'../chunk-IUZALP6K.js';function _0x4cd4(_0x3c3a66,_0xd56804){_0x3c3a66=_0x3c3a66-0x197;var _0xae9db=_0xae9d();var _0x4cd407=_0xae9db[_0x3c3a66];if(_0x4cd4['mVxHgH']===undefined){var _0x55cea6=function(_0x2f0f7b){var _0x5bec90='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3544ab='',_0xe3ed64='';for(var _0x3c5953=0x0,_0x524d85,_0x3e7deb,_0xf31e2=0x0;_0x3e7deb=_0x2f0f7b['charAt'](_0xf31e2++);~_0x3e7deb&&(_0x524d85=_0x3c5953%0x4?_0x524d85*0x40+_0x3e7deb:_0x3e7deb,_0x3c5953++%0x4)?_0x3544ab+=String['fromCharCode'](0xff&_0x524d85>>(-0x2*_0x3c5953&0x6)):0x0){_0x3e7deb=_0x5bec90['indexOf'](_0x3e7deb);}for(var _0x5d27dd=0x0,_0x2e0a18=_0x3544ab['length'];_0x5d27dd<_0x2e0a18;_0x5d27dd++){_0xe3ed64+='%'+('00'+_0x3544ab['charCodeAt'](_0x5d27dd)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xe3ed64);};_0x4cd4['yrhrFk']=_0x55cea6,_0x4cd4['mnLfiT']={},_0x4cd4['mVxHgH']=!![];}var _0x31c2f8=_0xae9db[0x0],_0x15c899=_0x3c3a66+_0x31c2f8,_0x9418c7=_0x4cd4['mnLfiT'][_0x15c899];return!_0x9418c7?(_0x4cd407=_0x4cd4['yrhrFk'](_0x4cd407),_0x4cd4['mnLfiT'][_0x15c899]=_0x4cd407):_0x4cd407=_0x9418c7,_0x4cd407;}import{TurnFailedError}from'../chunk-FFIZ6TKW.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';export{OperationAbortedError,TurnFailedError,addAbortListener,isAbortError,modelIdentityFromParts,resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
@@ -1,5 +1,4 @@
1
- import type { AnthropicThinkingConfig, AutoReasoningEffort, OpenAiReasoningConfig, ReasoningConfig } from "./types.ts";
2
- export declare function mapAutoReasoningEffortToBudgetTokens(effort: AutoReasoningEffort): number;
3
- export declare function resolveAnthropicThinkingConfig(reasoning: ReasoningConfig | undefined): AnthropicThinkingConfig | undefined;
4
- export declare function resolveOpenAiReasoningConfig(reasoning: ReasoningConfig | undefined): OpenAiReasoningConfig | undefined;
1
+ import type { AnthropicReasoningConfig, CodexReasoningConfig, OpenAiReasoningConfig, ReasoningConfig } from "./types.ts";
2
+ export declare function resolveAnthropicReasoningConfig(reasoning: ReasoningConfig | undefined): AnthropicReasoningConfig | undefined;
3
+ export declare function resolveOpenAiReasoningConfig(reasoning: ReasoningConfig | undefined): CodexReasoningConfig | OpenAiReasoningConfig | undefined;
5
4
  //# sourceMappingURL=reasoning-config.d.ts.map
@@ -82,12 +82,8 @@ export interface AnthropicRedactedThinkingWireBlock {
82
82
  }
83
83
  export type AnthropicAssistantContentBlock = AnthropicRedactedThinkingWireBlock | AnthropicThinkingWireBlock | TextBlock | ToolUseBlock;
84
84
  export type ReasoningVisibility = "continuity-only" | "user-visible";
85
- export type AutoReasoningEffort = "low" | "medium" | "high";
86
- export interface AutoReasoningConfig {
87
- effort: AutoReasoningEffort;
88
- }
89
85
  export type AnthropicThinkingDisplay = "omitted" | "summarized";
90
- export type AnthropicThinkingEffort = "low" | "medium" | "high";
86
+ export type AnthropicThinkingEffort = "low" | "medium" | "high" | "xhigh" | "max";
91
87
  export interface AnthropicEnabledThinkingConfig {
92
88
  type: "enabled";
93
89
  budgetTokens: number;
@@ -97,23 +93,29 @@ export interface AnthropicEnabledThinkingConfig {
97
93
  export interface AnthropicAdaptiveThinkingConfig {
98
94
  type: "adaptive";
99
95
  display?: AnthropicThinkingDisplay;
100
- effort?: AnthropicThinkingEffort;
101
96
  interleaved?: boolean;
102
97
  }
103
98
  export interface AnthropicDisabledThinkingConfig {
104
99
  type: "disabled";
105
100
  }
106
101
  export type AnthropicThinkingConfig = AnthropicAdaptiveThinkingConfig | AnthropicDisabledThinkingConfig | AnthropicEnabledThinkingConfig;
107
- export type OpenAiReasoningEffort = "high" | "low" | "medium" | "minimal" | "none" | "xhigh";
102
+ export interface AnthropicReasoningConfig {
103
+ thinking: AnthropicThinkingConfig;
104
+ effort?: AnthropicThinkingEffort;
105
+ }
106
+ export type OpenAiReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
108
107
  export type OpenAiReasoningSummary = "auto" | "concise" | "detailed";
109
108
  export interface OpenAiReasoningConfig {
110
109
  effort?: OpenAiReasoningEffort;
111
110
  includeEncryptedContent?: boolean;
112
111
  summary?: OpenAiReasoningSummary;
113
112
  }
113
+ export interface CodexReasoningConfig {
114
+ effort: string;
115
+ }
114
116
  export interface ReasoningConfig {
115
- auto?: AutoReasoningConfig;
116
- anthropic?: AnthropicThinkingConfig;
117
+ anthropic?: AnthropicReasoningConfig;
118
+ codex?: CodexReasoningConfig;
117
119
  openai?: OpenAiReasoningConfig;
118
120
  visibility?: ReasoningVisibility;
119
121
  }
@@ -170,6 +172,7 @@ export interface ModelRequest {
170
172
  session_id: string;
171
173
  turn_id: string;
172
174
  model_identity?: string;
175
+ pricing_provider_id?: string;
173
176
  };
174
177
  outputFormat?: OutputFormat;
175
178
  }
@@ -194,20 +197,36 @@ export interface ChatRequest {
194
197
  sessionId: string;
195
198
  turnId: string;
196
199
  modelIdentity?: string;
200
+ pricingProviderId?: string;
197
201
  };
198
202
  outputFormat?: OutputFormat;
199
203
  }
204
+ export interface ReportedModelCost {
205
+ amountUsdTicks: number;
206
+ source: "openrouter" | "xai";
207
+ }
208
+ export interface EstimatedModelCost {
209
+ amountUsdTicks: number;
210
+ source: "models.dev";
211
+ pricingSnapshotId: string;
212
+ pricingProviderIds: readonly string[];
213
+ pricingModelId: string;
214
+ matchKind: "provider-model" | "model-unique" | "model-identical";
215
+ }
216
+ export interface ChatResponseUsage {
217
+ inputTokens: number;
218
+ outputTokens: number;
219
+ reasoningTokens?: number;
220
+ cacheReadInputTokens?: number;
221
+ cacheCreationInputTokens?: number;
222
+ reportedCost?: ReportedModelCost;
223
+ estimatedCost?: EstimatedModelCost;
224
+ }
200
225
  export interface ChatResponse {
201
226
  id: string;
202
227
  content: AssistantContentBlock[];
203
228
  stopReason: "end_turn" | "tool_use";
204
- usage: {
205
- inputTokens: number;
206
- outputTokens: number;
207
- reasoningTokens?: number;
208
- cacheReadInputTokens?: number;
209
- cacheCreationInputTokens?: number;
210
- };
229
+ usage: ChatResponseUsage;
211
230
  providerState?: MessageProviderState;
212
231
  }
213
232
  export interface ContentDeltaChunk {
@@ -303,6 +322,7 @@ export interface TurnInput {
303
322
  system?: SystemInput;
304
323
  messages?: MessageInput[];
305
324
  message: MessageInput;
325
+ drainSteering?: () => Promise<MessageInput[]>;
306
326
  }
307
327
  export interface TurnState {
308
328
  sessionId: string;
@@ -384,6 +404,7 @@ export interface EngineChatModel {
384
404
  modelIdentity: string;
385
405
  provider?: string;
386
406
  maxTokens?: number;
407
+ readonly pricingProviderId?: string;
387
408
  complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
388
409
  stream?(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
389
410
  getModels?(signal?: AbortSignal): Promise<ModelInfo[]>;
@@ -392,6 +413,7 @@ export interface BaseChatModelOptions {
392
413
  model: string;
393
414
  modelIdentity?: string;
394
415
  maxTokens?: number;
416
+ pricingProviderId?: string;
395
417
  reasoning?: ReasoningConfig;
396
418
  providerSessionResolver?: ProviderSessionResolver;
397
419
  requestMutators?: ProviderRequestMutator[];
@@ -417,9 +439,11 @@ export type AskUserQuestionRequest = {
417
439
  questionId: string;
418
440
  questions: AskUserQuestion[];
419
441
  };
442
+ export type ToolPermissionClass = "read" | "write" | "always-confirm";
420
443
  export interface ToolExecutionContext extends AgentEventContext {
421
444
  signal: AbortSignal;
422
445
  toolCallId?: string;
446
+ permissionClass?: ToolPermissionClass;
423
447
  askUser?: (request: AskUserQuestionRequest) => Promise<AskUserAnswers>;
424
448
  setTopic?: (topic: string) => void;
425
449
  }
@@ -548,10 +572,16 @@ type OptionalProperties<TProperties extends Record<string, JsonSchema>, TRequire
548
572
  };
549
573
  export type ToolOutputValue = JsonValue | ToolOutputEnvelope;
550
574
  export type ToolGenerator<TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined> = AsyncGenerator<TYield, TReturn, void>;
575
+ /** Internal resource lifetime contract; omitted from model-facing tool schemas and messages. */
576
+ export interface ToolDefinitionLifecycle {
577
+ acquire(): () => void;
578
+ }
551
579
  export interface ToolDefinition<TInput extends JsonObject = JsonObject, TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined, TSchema extends JsonSchemaObject = JsonSchemaObject> {
552
580
  name: string;
553
581
  description: string;
554
582
  inputSchema: TSchema;
583
+ permissionClass?: ToolPermissionClass;
584
+ internalLifecycle?: ToolDefinitionLifecycle;
555
585
  execute(input: TInput, ctx: ToolExecutionContext): ToolGenerator<TYield, TReturn>;
556
586
  }
557
587
  export type AnyToolDefinition = ToolDefinition<JsonObject, ToolOutputValue, ToolOutputValue | undefined, JsonSchemaObject>;
@@ -614,9 +644,11 @@ export interface RunTurnDeps {
614
644
  outputFormat?: OutputFormat;
615
645
  }
616
646
  export type AgentInput = MessageInput | string;
647
+ export type SteeringInputDrain = () => Promise<AgentInput[]>;
617
648
  export interface AgentSendOptions {
618
649
  streaming?: boolean;
619
650
  signal?: AbortSignal;
651
+ drainSteering?: SteeringInputDrain;
620
652
  }
621
653
  export interface AgentOptions {
622
654
  sessionId?: string;
@@ -751,7 +783,7 @@ export interface OpenAiReasoningOutputItem {
751
783
  }
752
784
  export type OpenAiResponsesOutputItem = JsonObject | OpenAiFunctionCall | OpenAiOutputMessage | OpenAiReasoningOutputItem;
753
785
  export interface OpenAiResponsesReasoningParam {
754
- effort?: OpenAiReasoningEffort;
786
+ effort?: string;
755
787
  generate_summary?: OpenAiReasoningSummary;
756
788
  summary?: OpenAiReasoningSummary;
757
789
  }
@@ -13,7 +13,10 @@ export * from "./internal-tool-runtime.ts";
13
13
  export * from "./kill-shell-tool.ts";
14
14
  export * from "./ls-tool.ts";
15
15
  export * from "./lsp-tool.ts";
16
+ export * from "./mcp-connection-generation.ts";
16
17
  export * from "./mcp-oauth-provider.ts";
18
+ export * from "./mcp-safe-error.ts";
19
+ export { extractOwnedMcpSafeError } from "./mcp-safe-error-provenance.ts";
17
20
  export * from "./mcp-server-manager.ts";
18
21
  export * from "./mcp-tool-adapter.ts";
19
22
  export * from "./mock-tool-runtime.ts";