@cuylabs/agent-core 0.8.0 → 0.10.0

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 (127) hide show
  1. package/README.md +33 -17
  2. package/dist/chunk-2O4MCSQS.js +780 -0
  3. package/dist/chunk-2TTOLHBT.js +198 -0
  4. package/dist/chunk-5FMSGQVX.js +281 -0
  5. package/dist/chunk-5NVVNXPQ.js +288 -0
  6. package/dist/{chunk-CAA7FHIH.js → chunk-6HZBHFOL.js} +3 -103
  7. package/dist/chunk-CJI7PVS2.js +58 -0
  8. package/dist/{chunk-N6HWIEEA.js → chunk-CMYN2RCB.js} +278 -61
  9. package/dist/chunk-FII65CN7.js +117 -0
  10. package/dist/{chunk-IVUJDISU.js → chunk-GFTW23FV.js} +5 -14
  11. package/dist/chunk-I6PKJ7XQ.js +292 -0
  12. package/dist/{chunk-BDBZ3SLK.js → chunk-ICZ66572.js} +48 -4
  13. package/dist/chunk-KYLPMBHD.js +316 -0
  14. package/dist/chunk-MXAP4UG6.js +2956 -0
  15. package/dist/{chunk-RZITT45F.js → chunk-N3VX7FEE.js} +39 -6
  16. package/dist/{chunk-YSLSEQ6B.js → chunk-NDZWXCBZ.js} +218 -95
  17. package/dist/{chunk-P6YF7USR.js → chunk-Q742PSH3.js} +23 -38
  18. package/dist/chunk-QAL3OMI3.js +943 -0
  19. package/dist/{chunk-RFEKJKTO.js → chunk-RN6WZEUF.js} +330 -280
  20. package/dist/{chunk-ZXAKHMWH.js → chunk-ROTGCYDW.js} +22 -84
  21. package/dist/chunk-SPBFQXOT.js +0 -0
  22. package/dist/{chunk-LRHOS4ZN.js → chunk-SPILYYDF.js} +3 -2
  23. package/dist/chunk-SSFBF3US.js +602 -0
  24. package/dist/chunk-SZ2XBPTW.js +8 -0
  25. package/dist/chunk-T4UIX5D7.js +115 -0
  26. package/dist/chunk-TIHPYVAJ.js +102 -0
  27. package/dist/{chunk-YUUJK53A.js → chunk-TOTDGK3P.js} +1 -1
  28. package/dist/chunk-V4RFNEET.js +563 -0
  29. package/dist/chunk-VOUEJSW6.js +0 -0
  30. package/dist/{chunk-4BDA7DQY.js → chunk-WBPOZ7CL.js} +673 -273
  31. package/dist/chunk-X4VN4GIJ.js +185 -0
  32. package/dist/dispatch/index.d.ts +93 -0
  33. package/dist/dispatch/index.js +37 -0
  34. package/dist/events/index.d.ts +93 -0
  35. package/dist/events/index.js +6 -0
  36. package/dist/{runtime → execution}/index.d.ts +120 -34
  37. package/dist/{runtime → execution}/index.js +18 -13
  38. package/dist/index-BCqEGzBj.d.ts +251 -0
  39. package/dist/index.d.ts +490 -122
  40. package/dist/index.js +2104 -615
  41. package/dist/{errors → inference/errors}/index.d.ts +2 -2
  42. package/dist/{errors → inference/errors}/index.js +1 -1
  43. package/dist/inference/index.d.ts +16 -23
  44. package/dist/inference/index.js +45 -16
  45. package/dist/instance-BqV2D5pc.d.ts +5723 -0
  46. package/dist/logger/index.d.ts +50 -0
  47. package/dist/logger/index.js +11 -0
  48. package/dist/mcp/index.d.ts +5 -9
  49. package/dist/mcp/index.js +2 -3
  50. package/dist/middleware/index.d.ts +10 -149
  51. package/dist/middleware/index.js +11 -3
  52. package/dist/model-messages-B4nK9D1-.d.ts +13 -0
  53. package/dist/models/index.d.ts +23 -18
  54. package/dist/models/index.js +48 -11
  55. package/dist/models/reasoning/index.d.ts +4 -0
  56. package/dist/{reasoning → models/reasoning}/index.js +3 -3
  57. package/dist/plugin/index.d.ts +458 -0
  58. package/dist/plugin/index.js +32 -0
  59. package/dist/profiles/index.d.ts +55 -0
  60. package/dist/profiles/index.js +30 -0
  61. package/dist/prompt/index.d.ts +8 -12
  62. package/dist/prompt/index.js +3 -2
  63. package/dist/safety/index.d.ts +109 -14
  64. package/dist/safety/index.js +59 -3
  65. package/dist/sandbox/index.d.ts +81 -0
  66. package/dist/sandbox/index.js +1 -0
  67. package/dist/skill/index.d.ts +10 -8
  68. package/dist/skill/index.js +3 -3
  69. package/dist/storage/index.d.ts +12 -4
  70. package/dist/storage/index.js +1 -1
  71. package/dist/subagents/index.d.ts +177 -0
  72. package/dist/subagents/index.js +78 -0
  73. package/dist/team/index.d.ts +544 -0
  74. package/dist/team/index.js +41 -0
  75. package/dist/tool/host/index.d.ts +41 -0
  76. package/dist/tool/host/index.js +10 -0
  77. package/dist/tool/index.d.ts +125 -21
  78. package/dist/tool/index.js +20 -13
  79. package/dist/{types-VQgymC1N.d.ts → types-Bj_J8u_W.d.ts} +44 -64
  80. package/dist/{types-CHiPh8U2.d.ts → types-C_LCeYNg.d.ts} +7 -7
  81. package/dist/types-RSCv7nQ4.d.ts +59 -0
  82. package/package.json +58 -53
  83. package/dist/builder-UpOWQMW3.d.ts +0 -34
  84. package/dist/chunk-7MUFEN4K.js +0 -559
  85. package/dist/chunk-7VKQ4WPB.js +0 -73
  86. package/dist/chunk-BFM2YHNM.js +0 -222
  87. package/dist/chunk-DWYX7ASF.js +0 -26
  88. package/dist/chunk-KUVSERLJ.js +0 -50
  89. package/dist/chunk-N7P4PN3O.js +0 -84
  90. package/dist/chunk-SDSBEQXG.js +0 -157
  91. package/dist/chunk-SQU2AJHO.js +0 -305
  92. package/dist/chunk-VBWWUHWI.js +0 -724
  93. package/dist/chunk-VEKUXUVF.js +0 -41
  94. package/dist/chunk-VNQBHPCT.js +0 -398
  95. package/dist/chunk-WWYYNWEW.js +0 -259
  96. package/dist/context/index.d.ts +0 -259
  97. package/dist/context/index.js +0 -26
  98. package/dist/events-CE72w8W4.d.ts +0 -149
  99. package/dist/host/index.d.ts +0 -45
  100. package/dist/host/index.js +0 -8
  101. package/dist/index-CWSchSql.d.ts +0 -1058
  102. package/dist/messages-BYWGn8TY.d.ts +0 -110
  103. package/dist/presets/index.d.ts +0 -53
  104. package/dist/presets/index.js +0 -28
  105. package/dist/reasoning/index.d.ts +0 -116
  106. package/dist/registry-DwYqsQkX.d.ts +0 -164
  107. package/dist/runner-e2YRcUoX.d.ts +0 -786
  108. package/dist/scope/index.d.ts +0 -10
  109. package/dist/scope/index.js +0 -14
  110. package/dist/session-manager-B_CWGTsl.d.ts +0 -274
  111. package/dist/signal/index.d.ts +0 -28
  112. package/dist/signal/index.js +0 -6
  113. package/dist/sub-agent/index.d.ts +0 -23
  114. package/dist/sub-agent/index.js +0 -15
  115. package/dist/tool-BHbyUAy3.d.ts +0 -150
  116. package/dist/tool-DLXAR9Ce.d.ts +0 -145
  117. package/dist/tracker-DClqYqTj.d.ts +0 -96
  118. package/dist/tracking/index.d.ts +0 -111
  119. package/dist/tracking/index.js +0 -20
  120. package/dist/types-BfNpU8NS.d.ts +0 -270
  121. package/dist/types-BnpEOYV-.d.ts +0 -50
  122. package/dist/types-CQL-SvTn.d.ts +0 -29
  123. package/dist/types-CWm-7rvB.d.ts +0 -55
  124. package/dist/types-KKDrdU9Y.d.ts +0 -325
  125. package/dist/types-QA4WhEfz.d.ts +0 -138
  126. package/dist/types-QKHHQLLq.d.ts +0 -336
  127. package/dist/types-YuWV4ag7.d.ts +0 -72
@@ -0,0 +1,50 @@
1
+ import { C as ConsoleLoggerOptions, L as Logger, F as FileLoggerOptions } from '../types-RSCv7nQ4.js';
2
+ export { a as LogLevel, b as LogMeta } from '../types-RSCv7nQ4.js';
3
+
4
+ /**
5
+ * Built-in logger implementations.
6
+ *
7
+ * - `silentLogger` — no-op (default for agents)
8
+ * - `createConsoleLogger` — pretty console output with level gating
9
+ * - `createFileLogger` — append-only file output for debugging
10
+ */
11
+
12
+ /**
13
+ * A logger that discards every message.
14
+ *
15
+ * This is the default used when no logger is supplied to `createAgent()`.
16
+ */
17
+ declare const silentLogger: Logger;
18
+ /**
19
+ * Create a console-backed logger with configurable minimum level.
20
+ *
21
+ * ```ts
22
+ * import { createConsoleLogger } from "@cuylabs/agent-core";
23
+ *
24
+ * const agent = createAgent({
25
+ * model,
26
+ * logger: createConsoleLogger({ level: "debug" }),
27
+ * });
28
+ * ```
29
+ *
30
+ * Respects the `AGENT_LOG_LEVEL` environment variable when no explicit
31
+ * level is supplied, falling back to `"warn"`.
32
+ */
33
+ declare function createConsoleLogger(options?: ConsoleLoggerOptions): Logger;
34
+ /**
35
+ * Create a file-backed logger that appends timestamped entries.
36
+ *
37
+ * ```ts
38
+ * import { createFileLogger } from "@cuylabs/agent-core";
39
+ *
40
+ * const logger = createFileLogger({ filePath: "/tmp/team.log", level: "debug" });
41
+ * ```
42
+ *
43
+ * The log file is created (with parent directories) if it doesn't exist.
44
+ * All writes are non-blocking; write errors are silently swallowed.
45
+ */
46
+ declare function createFileLogger(options: FileLoggerOptions): Logger & {
47
+ close(): void;
48
+ };
49
+
50
+ export { ConsoleLoggerOptions, FileLoggerOptions, Logger, createConsoleLogger, createFileLogger, silentLogger };
@@ -0,0 +1,11 @@
1
+ import "../chunk-SPBFQXOT.js";
2
+ import {
3
+ createConsoleLogger,
4
+ createFileLogger,
5
+ silentLogger
6
+ } from "../chunk-T4UIX5D7.js";
7
+ export {
8
+ createConsoleLogger,
9
+ createFileLogger,
10
+ silentLogger
11
+ };
@@ -1,15 +1,11 @@
1
- import { M as MCPConfig, a as MCPManager, d as MCPServerConfig, H as HttpTransportConfig, S as SseTransportConfig, f as StdioTransportConfig } from '../types-VQgymC1N.js';
2
- export { b as MCPPrompt, c as MCPResource, e as MCPServerStatus } from '../types-VQgymC1N.js';
1
+ import { M as MCPConfig, a as MCPManager, R as RemoteTransportConfig, d as StdioTransportConfig } from '../types-Bj_J8u_W.js';
2
+ export { H as HttpTransportConfig, b as MCPServerConfig, c as MCPServerStatus, S as SseTransportConfig } from '../types-Bj_J8u_W.js';
3
3
  import 'ai';
4
4
 
5
5
  /**
6
6
  * Create an MCP manager for connecting to multiple MCP servers.
7
7
  */
8
8
  declare function createMCPManager(config: MCPConfig): MCPManager;
9
- /**
10
- * Helper to define a single MCP server config.
11
- */
12
- declare function defineServer(config: MCPServerConfig): MCPServerConfig;
13
9
  /**
14
10
  * Helper to create a stdio server config.
15
11
  */
@@ -17,10 +13,10 @@ declare function stdioServer(command: string, args?: string[], options?: Omit<St
17
13
  /**
18
14
  * Helper to create an HTTP server config.
19
15
  */
20
- declare function httpServer(url: string, options?: Omit<HttpTransportConfig, "transport" | "url">): HttpTransportConfig;
16
+ declare function httpServer(url: string, options?: Omit<RemoteTransportConfig, "transport" | "url">): RemoteTransportConfig;
21
17
  /**
22
18
  * Helper to create an SSE server config.
23
19
  */
24
- declare function sseServer(url: string, options?: Omit<SseTransportConfig, "transport" | "url">): SseTransportConfig;
20
+ declare function sseServer(url: string, options?: Omit<RemoteTransportConfig, "transport" | "url">): RemoteTransportConfig;
25
21
 
26
- export { HttpTransportConfig, MCPConfig, MCPManager, MCPServerConfig, SseTransportConfig, StdioTransportConfig, createMCPManager, defineServer, httpServer, sseServer, stdioServer };
22
+ export { MCPConfig, MCPManager, RemoteTransportConfig, StdioTransportConfig, createMCPManager, httpServer, sseServer, stdioServer };
package/dist/mcp/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import {
2
2
  createMCPManager,
3
- defineServer,
4
3
  httpServer,
5
4
  sseServer,
6
5
  stdioServer
7
- } from "../chunk-ZXAKHMWH.js";
6
+ } from "../chunk-ROTGCYDW.js";
7
+ import "../chunk-T4UIX5D7.js";
8
8
  export {
9
9
  createMCPManager,
10
- defineServer,
11
10
  httpServer,
12
11
  sseServer,
13
12
  stdioServer
@@ -1,153 +1,14 @@
1
- import { A as AgentMiddleware } from '../runner-e2YRcUoX.js';
2
- export { f as AgentModelHooks, B as BlockedModelCall, M as MiddlewareRunner, h as ModelCallContext, e as ModelCallInput, i as ModelCallOutput, j as PluginCommand, k as PluginContext, l as PluginInit, T as ToolCallDecision } from '../runner-e2YRcUoX.js';
3
- import { a as ApprovalConfig, R as RiskLevel } from '../types-CWm-7rvB.js';
4
- import { TelemetrySettings } from 'ai';
5
- import '@ai-sdk/provider-utils';
6
- import '../events-CE72w8W4.js';
7
- import '../messages-BYWGn8TY.js';
8
- import '../types-BfNpU8NS.js';
9
- import '../types-CQL-SvTn.js';
10
- import '../tool-DLXAR9Ce.js';
11
- import '../types-CHiPh8U2.js';
12
- import '../tool-BHbyUAy3.js';
1
+ import { bR as OtelMiddlewareConfig, L as AgentMiddleware, de as TelemetryConfig, df as TelemetryConfigResult } from '../instance-BqV2D5pc.js';
2
+ export { N as AgentModelHooks, ac as ApprovalAgentMiddleware, al as ApprovalMiddlewareConfig, as as BlockedModelCall, au as ChatLifecycleContext, b as MiddlewareRunner, d as ModelCallContext, bK as ModelCallInput, bL as ModelCallOutput, dh as ToolCallDecision, di as ToolCallOutput, dz as approvalMiddleware, dM as isApprovalMiddleware, dN as isBlockedModelCall } from '../instance-BqV2D5pc.js';
3
+ import '../types-C_LCeYNg.js';
4
+ import 'ai';
5
+ import '../types-RSCv7nQ4.js';
13
6
  import 'zod';
14
7
  import '../types-CQaXbRsS.js';
15
-
16
- /**
17
- * Approval Middleware
18
- *
19
- * Wraps the existing approval system as an AgentMiddleware.
20
- * This is how approval finally gets wired into the tool execution
21
- * pipeline — no more dead code.
22
- *
23
- * @example
24
- * ```typescript
25
- * import { createAgent, approvalMiddleware } from "@cuylabs/agent-core";
26
- *
27
- * const agent = createAgent({
28
- * model: anthropic("claude-sonnet-4-20250514"),
29
- * tools: [read, write, bash],
30
- * middleware: [
31
- * approvalMiddleware({
32
- * rules: [
33
- * { pattern: "src/*", tool: "read_file", action: "allow" },
34
- * ],
35
- * onRequest: async (req) => {
36
- * // Prompt user in your UI
37
- * return await askUser(req);
38
- * },
39
- * }),
40
- * ],
41
- * });
42
- * ```
43
- */
44
-
45
- /**
46
- * Configuration for the approval middleware.
47
- *
48
- * Extends the existing ApprovalConfig with middleware-specific options.
49
- */
50
- interface ApprovalMiddlewareConfig extends ApprovalConfig {
51
- /**
52
- * Custom risk classification for tools.
53
- *
54
- * Overrides the built-in risk map. Tools not listed here
55
- * fall back to the default classification.
56
- *
57
- * @example
58
- * ```typescript
59
- * customRisks: {
60
- * "my_deploy_tool": "dangerous",
61
- * "my_lint_tool": "safe",
62
- * }
63
- * ```
64
- */
65
- customRisks?: Record<string, RiskLevel>;
66
- }
67
- /**
68
- * Create an approval middleware from an ApprovalConfig.
69
- *
70
- * This bridges the existing `createApprovalHandler` into the middleware
71
- * system. The `beforeToolCall` hook checks rules, classifies risk,
72
- * and calls the approval handler when needed.
73
- *
74
- * @param config - Approval configuration (rules, handler, timeout, etc.)
75
- * @returns An AgentMiddleware that gates tool execution
76
- */
77
- declare function approvalMiddleware(config?: ApprovalMiddlewareConfig): AgentMiddleware;
78
-
79
- /**
80
- * Configuration for the OpenTelemetry middleware.
81
- */
82
- interface OtelMiddlewareConfig {
83
- /**
84
- * Whether to record tool call arguments as span attributes.
85
- * Defaults to `true`.
86
- */
87
- recordInputs?: boolean;
88
- /**
89
- * Whether to record tool results as span attributes.
90
- * Defaults to `true`.
91
- */
92
- recordOutputs?: boolean;
93
- /**
94
- * Agent name — used in the root span name and attributes.
95
- * Falls back to `"agent"`.
96
- */
97
- agentName?: string;
98
- /** Agent description — recorded as `gen_ai.agent.description`. */
99
- agentDescription?: string;
100
- /**
101
- * Whether to emit `execute_tool` spans for tool calls.
102
- * Defaults to `true`.
103
- */
104
- emitToolSpans?: boolean;
105
- /**
106
- * TTL in milliseconds for orphaned spans.
107
- * Defaults to 5 minutes.
108
- */
109
- spanTimeoutMs?: number;
110
- }
111
- /**
112
- * Configuration for `createTelemetryConfig()`.
113
- */
114
- interface TelemetryConfig {
115
- /** Agent name — used in span names and `gen_ai.agent.name`. */
116
- agentName: string;
117
- /** Agent description — recorded as `gen_ai.agent.description`. */
118
- agentDescription?: string;
119
- /** Record tool arguments and LLM prompts in spans. Defaults to `true`. */
120
- recordInputs?: boolean;
121
- /** Record tool results and LLM responses in spans. Defaults to `true`. */
122
- recordOutputs?: boolean;
123
- /** Emit `execute_tool` spans from our middleware. Defaults to `true`. */
124
- emitToolSpans?: boolean;
125
- /** TTL in ms for orphaned spans. Defaults to 5 minutes. */
126
- spanTimeoutMs?: number;
127
- /**
128
- * An OTel `SpanProcessor` to auto-create and register a `NodeTracerProvider`.
129
- */
130
- spanProcessor?: unknown;
131
- /**
132
- * OTel service name for the `NodeTracerProvider` resource.
133
- * Defaults to `agentName`.
134
- */
135
- serviceName?: string;
136
- }
137
- /**
138
- * Result of `createTelemetryConfig()`.
139
- */
140
- interface TelemetryConfigResult {
141
- /** Agent-core middleware. */
142
- middleware: AgentMiddleware;
143
- /** AI SDK telemetry settings. */
144
- telemetry: TelemetrySettings;
145
- /**
146
- * Flush and shut down the auto-created tracer provider.
147
- * No-op when no provider was auto-created.
148
- */
149
- shutdown: () => Promise<void>;
150
- }
8
+ import '../types-Bj_J8u_W.js';
9
+ import '@ai-sdk/provider-utils';
10
+ import '../sandbox/index.js';
11
+ import '../llm-error-D93FNNLY.js';
151
12
 
152
13
  declare function otelMiddleware(config?: OtelMiddlewareConfig): AgentMiddleware;
153
14
 
@@ -246,4 +107,4 @@ interface PromptCacheConfig {
246
107
  */
247
108
  declare function promptCacheMiddleware(config?: PromptCacheConfig): AgentMiddleware;
248
109
 
249
- export { AgentMiddleware, type ApprovalMiddlewareConfig, type CacheTTL, type OtelMiddlewareConfig, type PromptCacheConfig, type TelemetryConfig, type TelemetryConfigResult, approvalMiddleware, createTelemetryConfig, otelMiddleware, promptCacheMiddleware };
110
+ export { AgentMiddleware, type CacheTTL, OtelMiddlewareConfig, type PromptCacheConfig, TelemetryConfig, TelemetryConfigResult, createTelemetryConfig, otelMiddleware, promptCacheMiddleware };
@@ -2,15 +2,23 @@ import {
2
2
  MiddlewareRunner,
3
3
  approvalMiddleware,
4
4
  createTelemetryConfig,
5
+ isApprovalMiddleware,
5
6
  otelMiddleware,
6
7
  promptCacheMiddleware
7
- } from "../chunk-YSLSEQ6B.js";
8
- import "../chunk-BFM2YHNM.js";
9
- import "../chunk-DWYX7ASF.js";
8
+ } from "../chunk-NDZWXCBZ.js";
9
+ import {
10
+ isBlockedModelCall
11
+ } from "../chunk-CJI7PVS2.js";
12
+ import "../chunk-I6PKJ7XQ.js";
13
+ import "../chunk-V4RFNEET.js";
14
+ import "../chunk-FII65CN7.js";
15
+ import "../chunk-T4UIX5D7.js";
10
16
  export {
11
17
  MiddlewareRunner,
12
18
  approvalMiddleware,
13
19
  createTelemetryConfig,
20
+ isApprovalMiddleware,
21
+ isBlockedModelCall,
14
22
  otelMiddleware,
15
23
  promptCacheMiddleware
16
24
  };
@@ -0,0 +1,13 @@
1
+ import { ModelMessage } from 'ai';
2
+ import { M as Message } from './instance-BqV2D5pc.js';
3
+
4
+ /**
5
+ * Convert framework messages into Vercel AI SDK model messages.
6
+ *
7
+ * This keeps the message translation logic reusable for workflow activities
8
+ * and other runtime integrations without forcing those integrations to reach
9
+ * into `Agent` internals.
10
+ */
11
+ declare function convertAgentMessagesToModelMessages(messages: Message[]): ModelMessage[];
12
+
13
+ export { convertAgentMessagesToModelMessages as c };
@@ -1,6 +1,9 @@
1
1
  import { LanguageModel } from 'ai';
2
- import { C as CapabilitySource, S as SourcePriority, b as SourceResult, P as ProviderCompatibility, R as ResolverOptions, a as ModelEntry, M as ModelCapabilities } from '../types-QA4WhEfz.js';
3
- export { D as DEFAULT_RESOLVER_OPTIONS, I as InputModality, O as OutputModality } from '../types-QA4WhEfz.js';
2
+ import { C as CapabilitySource, S as SourcePriority, b as SourceResult, P as ProviderCompatibility, R as ResolverOptions, a as ModelEntry, M as ModelCapabilities } from '../index-BCqEGzBj.js';
3
+ export { D as DEFAULT_RESOLVER_OPTIONS, I as InputModality, O as OutputModality, c as buildAnthropicOptions, d as buildBedrockOptions, e as buildGoogleOptions, f as buildGroqOptions, g as buildOpenAIOptions, h as buildOpenRouterOptions, i as buildReasoningOptions, j as buildReasoningOptionsSync, k as buildXAIOptions, l as getProviderOptionsKey, m as getReasoningConfig, n as getReasoningConfigSync, s as supportsReasoning, o as supportsReasoningSync } from '../index-BCqEGzBj.js';
4
+ import { L as Logger } from '../types-RSCv7nQ4.js';
5
+ export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, a as ReasoningConfig, R as ReasoningLevel, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from '../types-CQaXbRsS.js';
6
+ import '@ai-sdk/provider-utils';
4
7
 
5
8
  /**
6
9
  * Extract a model ID string from a LanguageModel instance.
@@ -10,6 +13,19 @@ declare function getModelId(model: LanguageModel): string;
10
13
  * Extract a provider identifier from a LanguageModel instance.
11
14
  */
12
15
  declare function getProviderId(model: LanguageModel): string | undefined;
16
+ /**
17
+ * Extract model ID from a LanguageModel.
18
+ *
19
+ * Canonical helper — use this instead of `getModelId` in consumer code.
20
+ */
21
+ declare const extractModelId: (model: LanguageModel) => string;
22
+ /**
23
+ * Extract provider from a LanguageModel.
24
+ *
25
+ * Tries the model's `.provider` property first, then falls back
26
+ * to pattern-matching the model ID via `inferProvider`.
27
+ */
28
+ declare function extractProvider(model: LanguageModel): string | undefined;
13
29
 
14
30
  type AdapterKind = "openai" | "anthropic" | "google" | "openai-compatible" | "openrouter" | "azure" | "bedrock" | "vertex" | "xai" | "mistral" | "groq";
15
31
  type AdapterSettings = {
@@ -33,11 +49,6 @@ type Directory = {
33
49
  entries?: Record<string, ModelSpec>;
34
50
  };
35
51
  type Resolver = (key: string) => Promise<LanguageModel>;
36
- /**
37
- * @deprecated Use `Resolver` (async) instead. Kept for backwards compatibility
38
- * with custom `build` functions that return synchronously.
39
- */
40
- type SyncResolver = (key: string) => LanguageModel;
41
52
  declare function createResolver(directory: Directory): Resolver;
42
53
 
43
54
  /**
@@ -90,7 +101,8 @@ declare class CapabilityCache {
90
101
  private memoryCache;
91
102
  private ttlMs;
92
103
  private loaded;
93
- constructor(options?: Partial<ResolverOptions>);
104
+ private readonly log;
105
+ constructor(options?: Partial<ResolverOptions>, logger?: Logger);
94
106
  private load;
95
107
  get(modelId: string, provider?: string): Promise<ModelEntry | undefined>;
96
108
  set(entry: ModelEntry): Promise<void>;
@@ -158,14 +170,6 @@ declare class RemoteCapabilitySource implements CapabilitySource {
158
170
  * Designed for the Vercel AI SDK v6 ecosystem.
159
171
  */
160
172
 
161
- /**
162
- * Extract model ID from LanguageModel
163
- */
164
- declare function extractModelId(model: LanguageModel): string;
165
- /**
166
- * Extract provider from LanguageModel
167
- */
168
- declare function extractProvider(model: LanguageModel): string | undefined;
169
173
  /**
170
174
  * Resolution result with source information
171
175
  */
@@ -191,7 +195,8 @@ declare class ModelCapabilityResolver {
191
195
  private sources;
192
196
  private initialized;
193
197
  private initPromise;
194
- constructor(options?: Partial<ResolverOptions>);
198
+ private readonly log;
199
+ constructor(options?: Partial<ResolverOptions>, logger?: Logger);
195
200
  /**
196
201
  * Initialize the resolver (load cache, optionally fetch remote)
197
202
  */
@@ -253,4 +258,4 @@ declare function getDefaultResolver(): ModelCapabilityResolver;
253
258
  */
254
259
  declare function configureResolver(options: Partial<ResolverOptions>): void;
255
260
 
256
- export { type AdapterSettings, CacheCapabilitySource, CapabilityCache, type CapabilityOverrides, CapabilitySource, type Directory, type EngineSpec, ModelCapabilities, ModelCapabilityResolver, ModelEntry, type ModelSpec, type NetworkStatus, PatternCapabilitySource, ProviderCompatibility, RemoteCapabilityFetcher, RemoteCapabilitySource, type ResolutionResult, type Resolver, ResolverOptions, SourcePriority, SourceResult, type SyncResolver, applyCapabilityOverride, configureResolver, createResolver, extractModelId, extractProvider, findCapabilityOverride, getDefaultResolver, getModelId, getNetworkStatus, getProviderCompatibility, getProviderId, inferContextWindow, inferProvider, likelySupportsReasoning };
261
+ export { type AdapterSettings, CacheCapabilitySource, CapabilityCache, type CapabilityOverrides, CapabilitySource, type Directory, type EngineSpec, ModelCapabilities, ModelCapabilityResolver, ModelEntry, type ModelSpec, type NetworkStatus, PatternCapabilitySource, ProviderCompatibility, RemoteCapabilityFetcher, RemoteCapabilitySource, type ResolutionResult, type Resolver, ResolverOptions, SourcePriority, SourceResult, applyCapabilityOverride, configureResolver, createResolver, extractModelId, extractProvider, findCapabilityOverride, getDefaultResolver, getModelId, getNetworkStatus, getProviderCompatibility, getProviderId, inferContextWindow, inferProvider, likelySupportsReasoning };
@@ -1,39 +1,70 @@
1
1
  import {
2
2
  CacheCapabilitySource,
3
3
  CapabilityCache,
4
- DEFAULT_RESOLVER_OPTIONS,
4
+ EXTENDED_LEVELS,
5
+ FIXED_LEVELS,
5
6
  ModelCapabilityResolver,
6
- PatternCapabilitySource,
7
7
  RemoteCapabilityFetcher,
8
8
  RemoteCapabilitySource,
9
- SourcePriority,
9
+ STANDARD_LEVELS,
10
10
  applyCapabilityOverride,
11
+ buildAnthropicOptions,
12
+ buildBedrockOptions,
13
+ buildGoogleOptions,
14
+ buildGroqOptions,
15
+ buildOpenAIOptions,
16
+ buildOpenRouterOptions,
17
+ buildReasoningOptions,
18
+ buildReasoningOptionsSync,
19
+ buildXAIOptions,
11
20
  configureResolver,
12
21
  createResolver,
13
- extractModelId,
14
- extractProvider,
15
22
  findCapabilityOverride,
16
23
  getDefaultResolver,
17
24
  getNetworkStatus,
25
+ getProviderOptionsKey,
26
+ getReasoningConfig,
27
+ getReasoningConfigSync,
28
+ shouldIncludeReasoningSummary,
29
+ supportsReasoning,
30
+ supportsReasoningSync
31
+ } from "../chunk-RN6WZEUF.js";
32
+ import {
33
+ DEFAULT_RESOLVER_OPTIONS,
34
+ PatternCapabilitySource,
35
+ SourcePriority,
36
+ extractModelId,
37
+ extractProvider,
38
+ getModelId,
18
39
  getProviderCompatibility,
40
+ getProviderId,
19
41
  inferContextWindow,
20
42
  inferProvider,
21
43
  likelySupportsReasoning
22
- } from "../chunk-RFEKJKTO.js";
23
- import {
24
- getModelId,
25
- getProviderId
26
- } from "../chunk-DWYX7ASF.js";
44
+ } from "../chunk-I6PKJ7XQ.js";
45
+ import "../chunk-T4UIX5D7.js";
27
46
  export {
28
47
  CacheCapabilitySource,
29
48
  CapabilityCache,
30
49
  DEFAULT_RESOLVER_OPTIONS,
50
+ EXTENDED_LEVELS,
51
+ FIXED_LEVELS,
31
52
  ModelCapabilityResolver,
32
53
  PatternCapabilitySource,
33
54
  RemoteCapabilityFetcher,
34
55
  RemoteCapabilitySource,
56
+ STANDARD_LEVELS,
35
57
  SourcePriority,
36
58
  applyCapabilityOverride,
59
+ buildAnthropicOptions,
60
+ buildBedrockOptions,
61
+ buildGoogleOptions,
62
+ buildGroqOptions,
63
+ buildOpenAIOptions,
64
+ buildOpenRouterOptions,
65
+ buildReasoningOptions,
66
+ buildReasoningOptionsSync,
67
+ buildXAIOptions,
37
68
  configureResolver,
38
69
  createResolver,
39
70
  extractModelId,
@@ -44,7 +75,13 @@ export {
44
75
  getNetworkStatus,
45
76
  getProviderCompatibility,
46
77
  getProviderId,
78
+ getProviderOptionsKey,
79
+ getReasoningConfig,
80
+ getReasoningConfigSync,
47
81
  inferContextWindow,
48
82
  inferProvider,
49
- likelySupportsReasoning
83
+ likelySupportsReasoning,
84
+ shouldIncludeReasoningSummary,
85
+ supportsReasoning,
86
+ supportsReasoningSync
50
87
  };
@@ -0,0 +1,4 @@
1
+ export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, a as ReasoningConfig, R as ReasoningLevel, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from '../../types-CQaXbRsS.js';
2
+ export { c as buildAnthropicOptions, d as buildBedrockOptions, e as buildGoogleOptions, f as buildGroqOptions, g as buildOpenAIOptions, h as buildOpenRouterOptions, i as buildReasoningOptions, j as buildReasoningOptionsSync, k as buildXAIOptions, l as getProviderOptionsKey, m as getReasoningConfig, n as getReasoningConfigSync, s as supportsReasoning, o as supportsReasoningSync } from '../../index-BCqEGzBj.js';
3
+ import 'ai';
4
+ import '@ai-sdk/provider-utils';
@@ -17,9 +17,9 @@ import {
17
17
  shouldIncludeReasoningSummary,
18
18
  supportsReasoning,
19
19
  supportsReasoningSync
20
- } from "../chunk-SQU2AJHO.js";
21
- import "../chunk-RFEKJKTO.js";
22
- import "../chunk-DWYX7ASF.js";
20
+ } from "../../chunk-RN6WZEUF.js";
21
+ import "../../chunk-I6PKJ7XQ.js";
22
+ import "../../chunk-T4UIX5D7.js";
23
23
  export {
24
24
  EXTENDED_LEVELS,
25
25
  FIXED_LEVELS,