@cuylabs/agent-core 0.3.0 → 0.5.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 (66) hide show
  1. package/README.md +216 -41
  2. package/dist/builder-RcTZuYnO.d.ts +34 -0
  3. package/dist/capabilities/index.d.ts +97 -0
  4. package/dist/capabilities/index.js +46 -0
  5. package/dist/chunk-6TDTQJ4P.js +116 -0
  6. package/dist/chunk-7MUFEN4K.js +559 -0
  7. package/dist/chunk-BDBZ3SLK.js +745 -0
  8. package/dist/chunk-DWYX7ASF.js +26 -0
  9. package/dist/chunk-FG4MD5MU.js +54 -0
  10. package/dist/chunk-IMGQOTU2.js +2019 -0
  11. package/dist/chunk-IVUJDISU.js +556 -0
  12. package/dist/chunk-LRHOS4ZN.js +584 -0
  13. package/dist/chunk-OTUGSCED.js +691 -0
  14. package/dist/chunk-P6YF7USR.js +182 -0
  15. package/dist/chunk-QAQADS4X.js +258 -0
  16. package/dist/chunk-QWFMX226.js +879 -0
  17. package/dist/{chunk-6VKLWNRE.js → chunk-SDSBEQXG.js} +1 -132
  18. package/dist/chunk-VBWWUHWI.js +724 -0
  19. package/dist/chunk-VEKUXUVF.js +41 -0
  20. package/dist/chunk-X635CM2F.js +305 -0
  21. package/dist/chunk-YUUJK53A.js +91 -0
  22. package/dist/chunk-ZXAKHMWH.js +283 -0
  23. package/dist/config-D2xeGEHK.d.ts +52 -0
  24. package/dist/context/index.d.ts +259 -0
  25. package/dist/context/index.js +26 -0
  26. package/dist/identifiers-BLUxFqV_.d.ts +12 -0
  27. package/dist/index-p0kOsVsE.d.ts +1067 -0
  28. package/dist/index-tmhaADz5.d.ts +198 -0
  29. package/dist/index.d.ts +185 -4316
  30. package/dist/index.js +1238 -5368
  31. package/dist/mcp/index.d.ts +26 -0
  32. package/dist/mcp/index.js +14 -0
  33. package/dist/messages-BYWGn8TY.d.ts +110 -0
  34. package/dist/middleware/index.d.ts +7 -0
  35. package/dist/middleware/index.js +12 -0
  36. package/dist/models/index.d.ts +33 -0
  37. package/dist/models/index.js +12 -0
  38. package/dist/network-D76DS5ot.d.ts +5 -0
  39. package/dist/prompt/index.d.ts +224 -0
  40. package/dist/prompt/index.js +45 -0
  41. package/dist/reasoning/index.d.ts +71 -0
  42. package/dist/reasoning/index.js +47 -0
  43. package/dist/registry-CuRWWtcT.d.ts +164 -0
  44. package/dist/resolver-DOfZ-xuk.d.ts +254 -0
  45. package/dist/runner-C7aMP_x3.d.ts +596 -0
  46. package/dist/runtime/index.d.ts +357 -0
  47. package/dist/runtime/index.js +64 -0
  48. package/dist/session-manager-Uawm2Le7.d.ts +274 -0
  49. package/dist/skill/index.d.ts +103 -0
  50. package/dist/skill/index.js +39 -0
  51. package/dist/storage/index.d.ts +167 -0
  52. package/dist/storage/index.js +50 -0
  53. package/dist/sub-agent/index.d.ts +14 -0
  54. package/dist/sub-agent/index.js +15 -0
  55. package/dist/tool/index.d.ts +173 -1
  56. package/dist/tool/index.js +12 -3
  57. package/dist/tool-DYp6-cC3.d.ts +239 -0
  58. package/dist/tool-pFAnJc5Y.d.ts +419 -0
  59. package/dist/tracker-DClqYqTj.d.ts +96 -0
  60. package/dist/tracking/index.d.ts +109 -0
  61. package/dist/tracking/index.js +20 -0
  62. package/dist/types-CQaXbRsS.d.ts +47 -0
  63. package/dist/types-MM1JoX5T.d.ts +810 -0
  64. package/dist/types-VQgymC1N.d.ts +156 -0
  65. package/package.json +89 -5
  66. package/dist/index-QR704uRr.d.ts +0 -472
@@ -0,0 +1,26 @@
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';
3
+ import 'ai';
4
+
5
+ /**
6
+ * Create an MCP manager for connecting to multiple MCP servers.
7
+ */
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
+ /**
14
+ * Helper to create a stdio server config.
15
+ */
16
+ declare function stdioServer(command: string, args?: string[], options?: Omit<StdioTransportConfig, "transport" | "command" | "args">): StdioTransportConfig;
17
+ /**
18
+ * Helper to create an HTTP server config.
19
+ */
20
+ declare function httpServer(url: string, options?: Omit<HttpTransportConfig, "transport" | "url">): HttpTransportConfig;
21
+ /**
22
+ * Helper to create an SSE server config.
23
+ */
24
+ declare function sseServer(url: string, options?: Omit<SseTransportConfig, "transport" | "url">): SseTransportConfig;
25
+
26
+ export { HttpTransportConfig, MCPConfig, MCPManager, MCPServerConfig, SseTransportConfig, StdioTransportConfig, createMCPManager, defineServer, httpServer, sseServer, stdioServer };
@@ -0,0 +1,14 @@
1
+ import {
2
+ createMCPManager,
3
+ defineServer,
4
+ httpServer,
5
+ sseServer,
6
+ stdioServer
7
+ } from "../chunk-ZXAKHMWH.js";
8
+ export {
9
+ createMCPManager,
10
+ defineServer,
11
+ httpServer,
12
+ sseServer,
13
+ stdioServer
14
+ };
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Message and token types for @cuylabs/agent-core
3
+ *
4
+ * Defines the message model used across conversations,
5
+ * including all role variants and token usage tracking.
6
+ */
7
+ /**
8
+ * Message roles
9
+ */
10
+ type MessageRole = "user" | "assistant" | "tool" | "system";
11
+ /**
12
+ * Base message interface
13
+ */
14
+ interface MessageBase {
15
+ id: string;
16
+ role: MessageRole;
17
+ createdAt: Date;
18
+ }
19
+ /**
20
+ * User message
21
+ */
22
+ interface UserMessage extends MessageBase {
23
+ role: "user";
24
+ content: string;
25
+ /** Optional custom system prompt for this message */
26
+ system?: string;
27
+ }
28
+ /**
29
+ * Assistant message
30
+ */
31
+ interface AssistantMessage extends MessageBase {
32
+ role: "assistant";
33
+ content: string;
34
+ /** Finish reason */
35
+ finish?: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown";
36
+ /** Token usage for this response */
37
+ tokens?: TokenUsage;
38
+ /** Cost in USD */
39
+ cost?: number;
40
+ /** Error if any */
41
+ error?: MessageError;
42
+ /** Tool calls made by the assistant (when finish === "tool-calls") */
43
+ toolCalls?: Array<{
44
+ toolCallId: string;
45
+ toolName: string;
46
+ args: unknown;
47
+ }>;
48
+ }
49
+ /**
50
+ * Tool result message
51
+ */
52
+ interface ToolMessage extends MessageBase {
53
+ role: "tool";
54
+ content: string;
55
+ toolCallId: string;
56
+ toolName: string;
57
+ result: unknown;
58
+ /**
59
+ * Timestamp when this tool result was compacted/pruned.
60
+ * Once set, this message won't be pruned again.
61
+ */
62
+ compactedAt?: number;
63
+ }
64
+ /**
65
+ * System message
66
+ */
67
+ interface SystemMessage extends MessageBase {
68
+ role: "system";
69
+ content: string;
70
+ }
71
+ /**
72
+ * Union of all message types
73
+ */
74
+ type Message = UserMessage | AssistantMessage | ToolMessage | SystemMessage;
75
+ /**
76
+ * Error in a message
77
+ */
78
+ interface MessageError {
79
+ name: string;
80
+ message: string;
81
+ code?: string;
82
+ status?: number;
83
+ }
84
+ /**
85
+ * Token usage statistics
86
+ */
87
+ interface TokenUsage {
88
+ inputTokens?: number;
89
+ outputTokens?: number;
90
+ totalTokens?: number;
91
+ /** Cache read tokens (if supported) */
92
+ cacheReadTokens?: number;
93
+ /** Cache write tokens (if supported) */
94
+ cacheWriteTokens?: number;
95
+ }
96
+ /**
97
+ * Session state
98
+ */
99
+ interface Session {
100
+ id: string;
101
+ messages: Message[];
102
+ createdAt: Date;
103
+ updatedAt: Date;
104
+ /** Optional title */
105
+ title?: string;
106
+ /** Parent session ID for forking */
107
+ parentID?: string;
108
+ }
109
+
110
+ export type { AssistantMessage as A, Message as M, Session as S, TokenUsage as T, UserMessage as U, MessageBase as a, MessageError as b, MessageRole as c, SystemMessage as d, ToolMessage as e };
@@ -0,0 +1,7 @@
1
+ export { f as AgentMiddleware, M as MiddlewareRunner, T as ToolCallDecision } from '../runner-C7aMP_x3.js';
2
+ export { c as ApprovalMiddlewareConfig, O as OtelMiddlewareConfig, T as TelemetryConfig, e as TelemetryConfigResult, f as approvalMiddleware, g as createTelemetryConfig, o as otelMiddleware } from '../index-tmhaADz5.js';
3
+ import 'ai';
4
+ import '../messages-BYWGn8TY.js';
5
+ import '../tool-pFAnJc5Y.js';
6
+ import 'zod';
7
+ import '../tool-DYp6-cC3.js';
@@ -0,0 +1,12 @@
1
+ import {
2
+ MiddlewareRunner,
3
+ approvalMiddleware,
4
+ createTelemetryConfig,
5
+ otelMiddleware
6
+ } from "../chunk-OTUGSCED.js";
7
+ export {
8
+ MiddlewareRunner,
9
+ approvalMiddleware,
10
+ createTelemetryConfig,
11
+ otelMiddleware
12
+ };
@@ -0,0 +1,33 @@
1
+ export { g as getModelId, a as getProviderId } from '../identifiers-BLUxFqV_.js';
2
+ import { LanguageModel } from 'ai';
3
+
4
+ type AdapterKind = "openai" | "anthropic" | "google" | "openai-compatible";
5
+ type AdapterSettings = {
6
+ apiKey?: string;
7
+ baseUrl?: string;
8
+ headers?: Record<string, string>;
9
+ extra?: Record<string, unknown>;
10
+ };
11
+ type EngineSpec = {
12
+ adapter: AdapterKind | string;
13
+ settings?: AdapterSettings;
14
+ build?: (modelId: string, settings: AdapterSettings) => LanguageModel;
15
+ };
16
+ type ModelSpec = {
17
+ engine: string;
18
+ id: string;
19
+ settings?: AdapterSettings;
20
+ };
21
+ type Directory = {
22
+ engines: Record<string, EngineSpec>;
23
+ entries?: Record<string, ModelSpec>;
24
+ };
25
+ type Resolver = (key: string) => Promise<LanguageModel>;
26
+ /**
27
+ * @deprecated Use `Resolver` (async) instead. Kept for backwards compatibility
28
+ * with custom `build` functions that return synchronously.
29
+ */
30
+ type SyncResolver = (key: string) => LanguageModel;
31
+ declare function createResolver(directory: Directory): Resolver;
32
+
33
+ export { type AdapterSettings, type Directory, type EngineSpec, type ModelSpec, type Resolver, type SyncResolver, createResolver };
@@ -0,0 +1,12 @@
1
+ import {
2
+ createResolver
3
+ } from "../chunk-6TDTQJ4P.js";
4
+ import {
5
+ getModelId,
6
+ getProviderId
7
+ } from "../chunk-DWYX7ASF.js";
8
+ export {
9
+ createResolver,
10
+ getModelId,
11
+ getProviderId
12
+ };
@@ -0,0 +1,5 @@
1
+ import { N as NetworkStatus } from './resolver-DOfZ-xuk.js';
2
+
3
+ declare function getNetworkStatus(): NetworkStatus;
4
+
5
+ export { getNetworkStatus as g };
@@ -0,0 +1,224 @@
1
+ import { c as ModelFamily, E as EnvironmentInfo, I as InstructionFile } from '../runner-C7aMP_x3.js';
2
+ export { a as PromptBuildContext, P as PromptConfig, b as PromptSection } from '../runner-C7aMP_x3.js';
3
+ import { LanguageModel } from 'ai';
4
+ export { P as PromptBuilder, c as createPromptBuilder } from '../builder-RcTZuYnO.js';
5
+ export { d as SkillConfig } from '../tool-pFAnJc5Y.js';
6
+ import '../messages-BYWGn8TY.js';
7
+ import '../tool-DYp6-cC3.js';
8
+ import '../registry-CuRWWtcT.js';
9
+ import 'zod';
10
+
11
+ /**
12
+ * Prompt Templates — Base system prompts per model family
13
+ *
14
+ * agent-core provides **generic, domain-agnostic** templates.
15
+ * These establish the agent's general approach and tool-use discipline
16
+ * without assuming a specific domain (coding, browsing, etc.).
17
+ *
18
+ * Domain-specific templates belong in consumer packages:
19
+ * - agent-code → coding templates ("read files before editing", etc.)
20
+ * - computer-agent → computer-use templates
21
+ * - your-custom-agent → whatever you need
22
+ *
23
+ * Consumer packages inject their templates via:
24
+ * createPromptBuilder({ baseTemplate: MY_CODING_TEMPLATE })
25
+ * builder.addSection({ id: "coding", ... })
26
+ *
27
+ * This file also contains model family detection, which IS infrastructure
28
+ * and belongs here — any consumer benefits from knowing the model family
29
+ * to optimize prompt formatting.
30
+ */
31
+
32
+ /**
33
+ * Detect which model family a LanguageModel belongs to.
34
+ *
35
+ * Uses the provider string first (most reliable), then falls back
36
+ * to pattern matching on the model ID.
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * import { anthropic } from "@ai-sdk/anthropic";
41
+ * detectModelFamily(anthropic("claude-sonnet-4-20250514")); // "anthropic"
42
+ *
43
+ * import { openai } from "@ai-sdk/openai";
44
+ * detectModelFamily(openai("gpt-4o")); // "openai"
45
+ * ```
46
+ */
47
+ declare function detectModelFamily(model: LanguageModel): ModelFamily;
48
+ /**
49
+ * Get the base template for a model family.
50
+ *
51
+ * @param family - Model family identifier
52
+ * @returns The generic system prompt template
53
+ */
54
+ declare function getTemplate(family: ModelFamily): string;
55
+ /**
56
+ * Get all available template families.
57
+ * Useful for debugging or letting users choose.
58
+ */
59
+ declare function getAvailableFamilies(): ModelFamily[];
60
+
61
+ /**
62
+ * Environment Block — Runtime context for the system prompt
63
+ *
64
+ * Gathers information about the working environment (cwd, platform,
65
+ * git status, date, shell) and formats it as a structured block
66
+ * that gets injected into the prompt at priority 20.
67
+ *
68
+ * This gives the model awareness of:
69
+ * - Where it's working (directory, project)
70
+ * - What platform it's on (affects path separators, commands)
71
+ * - Current time (useful for time-sensitive tasks)
72
+ * - Git state (branch, clean/dirty)
73
+ */
74
+
75
+ /**
76
+ * Gather runtime environment information.
77
+ *
78
+ * Collects cwd, platform, git status, date, and shell.
79
+ * Git commands use a short timeout to avoid hanging on slow repos.
80
+ *
81
+ * @param cwd - Working directory to gather info for
82
+ * @returns Environment info object
83
+ */
84
+ declare function gatherEnvironment(cwd: string): EnvironmentInfo;
85
+ /**
86
+ * Format environment info as a prompt-friendly block.
87
+ *
88
+ * Output example:
89
+ * ```
90
+ * <workspace>
91
+ * Directory: /Users/dev/my-project
92
+ * Project: my-project
93
+ * Platform: macOS (darwin arm64)
94
+ * Date: Saturday, February 8, 2026
95
+ * Shell: /bin/zsh
96
+ * Git: main (clean)
97
+ * </workspace>
98
+ * ```
99
+ */
100
+ declare function formatEnvironment(info: EnvironmentInfo): string;
101
+ /**
102
+ * Create a short one-line summary of the environment.
103
+ * Useful for compact contexts or logging.
104
+ */
105
+ declare function summarizeEnvironment(info: EnvironmentInfo): string;
106
+
107
+ /**
108
+ * Instruction File Discovery — Project rules from the filesystem
109
+ *
110
+ * Discovers instruction files (AGENTS.md, CLAUDE.md, COPILOT.md, etc.)
111
+ * by walking up the directory tree from cwd. These files provide
112
+ * project-specific or workspace-level guidance to the agent.
113
+ *
114
+ * Discovery order (general → specific):
115
+ * 1. Global instruction files (from config)
116
+ * 2. Workspace-level files (found near git root or higher directories)
117
+ * 3. Project-level files (found in or near cwd)
118
+ *
119
+ * All discovered files are included, ordered from most general to most
120
+ * specific. This means project-level instructions appear last and
121
+ * effectively take precedence in case of conflicting guidance.
122
+ *
123
+ * Compatible with:
124
+ * - AGENTS.md convention
125
+ * - CLAUDE.md convention
126
+ * - COPILOT.md convention
127
+ * - CuyLabs' own .cuylabs/instructions.md
128
+ */
129
+
130
+ /**
131
+ * Default file patterns to search for.
132
+ * Checked in each directory when walking up from cwd.
133
+ */
134
+ declare const DEFAULT_INSTRUCTION_PATTERNS: string[];
135
+ /**
136
+ * Maximum file size for instruction files (50KB).
137
+ * Files larger than this are skipped to prevent prompt bloat.
138
+ */
139
+ declare const DEFAULT_MAX_FILE_SIZE = 51200;
140
+ /**
141
+ * Maximum directories to walk up from cwd.
142
+ */
143
+ declare const DEFAULT_MAX_DEPTH = 10;
144
+ /**
145
+ * Discover instruction files by walking up the directory tree from cwd.
146
+ *
147
+ * Searches for files matching the given patterns in each directory,
148
+ * starting from `cwd` and walking up to the filesystem root (or until
149
+ * `maxDepth` is reached).
150
+ *
151
+ * Results are ordered from **most general** (shallowest/root-level) to
152
+ * **most specific** (deepest/cwd-level), so that specific project rules
153
+ * appear last and take natural precedence.
154
+ *
155
+ * @param cwd - Starting directory for the search
156
+ * @param patterns - File name patterns to look for (e.g. ["AGENTS.md"])
157
+ * @param options - Discovery options
158
+ * @returns Array of discovered instruction files, general → specific
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * const files = await discoverInstructions("/Users/dev/project/src", [
163
+ * "AGENTS.md",
164
+ * "CLAUDE.md",
165
+ * ]);
166
+ *
167
+ * // Might find:
168
+ * // 1. /Users/dev/project/AGENTS.md (depth: 1, workspace)
169
+ * // 2. /Users/dev/project/src/AGENTS.md (depth: 0, project)
170
+ * ```
171
+ */
172
+ declare function discoverInstructions(cwd: string, patterns?: string[], options?: {
173
+ maxDepth?: number;
174
+ maxFileSize?: number;
175
+ stopAtGitRoot?: boolean;
176
+ }): Promise<InstructionFile[]>;
177
+ /**
178
+ * Load global instruction files from explicit paths.
179
+ *
180
+ * Global instructions are always included regardless of cwd.
181
+ * Useful for organization-wide coding standards or team rules.
182
+ *
183
+ * @param paths - Absolute paths to global instruction files
184
+ * @param maxSize - Maximum file size in bytes
185
+ * @returns Array of loaded instruction files
186
+ */
187
+ declare function loadGlobalInstructions(paths: string[], maxSize?: number): Promise<InstructionFile[]>;
188
+ /**
189
+ * Format discovered instruction files into a prompt block.
190
+ *
191
+ * Each file is wrapped in a tagged block with its source path
192
+ * for transparency. Files are already ordered general → specific.
193
+ *
194
+ * Output example:
195
+ * ```
196
+ * <project-instructions>
197
+ *
198
+ * <instructions source="AGENTS.md" scope="workspace">
199
+ * ... workspace-level content ...
200
+ * </instructions>
201
+ *
202
+ * <instructions source="src/AGENTS.md" scope="project">
203
+ * ... project-specific content ...
204
+ * </instructions>
205
+ *
206
+ * </project-instructions>
207
+ * ```
208
+ */
209
+ declare function formatInstructions(files: InstructionFile[], basePath?: string): string;
210
+
211
+ /** Priority for the base template section. */
212
+ declare const PRIORITY_BASE = 10;
213
+ /** Priority for the environment block section. */
214
+ declare const PRIORITY_ENVIRONMENT = 20;
215
+ /** Priority for instruction files. */
216
+ declare const PRIORITY_INSTRUCTIONS = 30;
217
+ /** Priority for custom user-defined sections. */
218
+ declare const PRIORITY_CUSTOM = 50;
219
+ /** Priority for skill summary injection. */
220
+ declare const PRIORITY_SKILLS = 70;
221
+ /** Priority for per-turn override content. */
222
+ declare const PRIORITY_OVERRIDE = 90;
223
+
224
+ export { DEFAULT_INSTRUCTION_PATTERNS, DEFAULT_MAX_DEPTH, DEFAULT_MAX_FILE_SIZE, EnvironmentInfo, InstructionFile, ModelFamily, PRIORITY_BASE, PRIORITY_CUSTOM, PRIORITY_ENVIRONMENT, PRIORITY_INSTRUCTIONS, PRIORITY_OVERRIDE, PRIORITY_SKILLS, detectModelFamily, discoverInstructions, formatEnvironment, formatInstructions, gatherEnvironment, getAvailableFamilies, getTemplate, loadGlobalInstructions, summarizeEnvironment };
@@ -0,0 +1,45 @@
1
+ import {
2
+ DEFAULT_INSTRUCTION_PATTERNS,
3
+ DEFAULT_MAX_DEPTH,
4
+ DEFAULT_MAX_FILE_SIZE,
5
+ PRIORITY_BASE,
6
+ PRIORITY_CUSTOM,
7
+ PRIORITY_ENVIRONMENT,
8
+ PRIORITY_INSTRUCTIONS,
9
+ PRIORITY_OVERRIDE,
10
+ PRIORITY_SKILLS,
11
+ PromptBuilder,
12
+ createPromptBuilder,
13
+ detectModelFamily,
14
+ discoverInstructions,
15
+ formatEnvironment,
16
+ formatInstructions,
17
+ gatherEnvironment,
18
+ getAvailableFamilies,
19
+ getTemplate,
20
+ loadGlobalInstructions,
21
+ summarizeEnvironment
22
+ } from "../chunk-IVUJDISU.js";
23
+ import "../chunk-LRHOS4ZN.js";
24
+ export {
25
+ DEFAULT_INSTRUCTION_PATTERNS,
26
+ DEFAULT_MAX_DEPTH,
27
+ DEFAULT_MAX_FILE_SIZE,
28
+ PRIORITY_BASE,
29
+ PRIORITY_CUSTOM,
30
+ PRIORITY_ENVIRONMENT,
31
+ PRIORITY_INSTRUCTIONS,
32
+ PRIORITY_OVERRIDE,
33
+ PRIORITY_SKILLS,
34
+ PromptBuilder,
35
+ createPromptBuilder,
36
+ detectModelFamily,
37
+ discoverInstructions,
38
+ formatEnvironment,
39
+ formatInstructions,
40
+ gatherEnvironment,
41
+ getAvailableFamilies,
42
+ getTemplate,
43
+ loadGlobalInstructions,
44
+ summarizeEnvironment
45
+ };
@@ -0,0 +1,71 @@
1
+ import { R as ReasoningLevel } from '../types-CQaXbRsS.js';
2
+ export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, a as ReasoningConfig, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from '../types-CQaXbRsS.js';
3
+ import { P as ProviderCompatibility } from '../resolver-DOfZ-xuk.js';
4
+ export { e as extractModelId, a as extractProvider } from '../resolver-DOfZ-xuk.js';
5
+ export { b as buildReasoningOptions, a as buildReasoningOptionsSync, g as getReasoningConfig, c as getReasoningConfigSync, s as supportsReasoning, d as supportsReasoningSync } from '../config-D2xeGEHK.js';
6
+ import 'ai';
7
+ import '@ai-sdk/provider-utils';
8
+
9
+ /**
10
+ * Provider-Specific Reasoning Option Builders
11
+ *
12
+ * Each function takes a {@link ReasoningLevel} and returns the
13
+ * provider-options object expected by the Vercel AI SDK's
14
+ * `providerOptions` parameter.
15
+ *
16
+ * Provider key mapping (`getProviderOptionsKey`) is also defined
17
+ * here so that callers can wrap the raw options correctly.
18
+ */
19
+
20
+ /**
21
+ * Build OpenAI reasoning options.
22
+ *
23
+ * OpenAI reasoning models use:
24
+ * - `reasoningEffort` — controls depth
25
+ * - `reasoningSummary` — controls whether reasoning is streamed
26
+ * (`"auto"` = condensed summary, `"detailed"` = full)
27
+ *
28
+ * `reasoningSummary` requires a verified OpenAI organisation.
29
+ * Set `CODE_AGENT_DISABLE_REASONING_SUMMARY=true` to skip it.
30
+ */
31
+ declare function buildOpenAIOptions(level: ReasoningLevel, compat?: ProviderCompatibility): Record<string, unknown> | undefined;
32
+ /**
33
+ * Build Anthropic thinking options.
34
+ *
35
+ * Uses `thinking.type: "enabled"` with `budgetTokens`.
36
+ */
37
+ declare function buildAnthropicOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
38
+ /**
39
+ * Build Google / Gemini reasoning options.
40
+ *
41
+ * - **Gemini 3+** uses `thinkingLevel` (`"low"` / `"high"`)
42
+ * - **Gemini 2.5 and earlier** uses `thinkingBudget` (token count)
43
+ */
44
+ declare function buildGoogleOptions(level: ReasoningLevel, modelId?: string): Record<string, unknown> | undefined;
45
+ /**
46
+ * Build xAI / Grok reasoning options.
47
+ */
48
+ declare function buildXAIOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
49
+ /**
50
+ * Build Groq reasoning options.
51
+ */
52
+ declare function buildGroqOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
53
+ /**
54
+ * Build Amazon Bedrock reasoning options.
55
+ *
56
+ * - Anthropic / Claude models use `budgetTokens`
57
+ * - Amazon Nova models use `maxReasoningEffort`
58
+ */
59
+ declare function buildBedrockOptions(level: ReasoningLevel, modelId?: string): Record<string, unknown> | undefined;
60
+ /**
61
+ * Build OpenRouter reasoning options.
62
+ */
63
+ declare function buildOpenRouterOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
64
+ /**
65
+ * Resolve the `providerOptions` key for a given SDK provider string.
66
+ *
67
+ * Falls back to the first dot-segment (e.g. `"foo.bar"` → `"foo"`).
68
+ */
69
+ declare function getProviderOptionsKey(provider: string): string;
70
+
71
+ export { ReasoningLevel, buildAnthropicOptions, buildBedrockOptions, buildGoogleOptions, buildGroqOptions, buildOpenAIOptions, buildOpenRouterOptions, buildXAIOptions, getProviderOptionsKey };
@@ -0,0 +1,47 @@
1
+ import {
2
+ EXTENDED_LEVELS,
3
+ FIXED_LEVELS,
4
+ STANDARD_LEVELS,
5
+ buildAnthropicOptions,
6
+ buildBedrockOptions,
7
+ buildGoogleOptions,
8
+ buildGroqOptions,
9
+ buildOpenAIOptions,
10
+ buildOpenRouterOptions,
11
+ buildReasoningOptions,
12
+ buildReasoningOptionsSync,
13
+ buildXAIOptions,
14
+ getProviderOptionsKey,
15
+ getReasoningConfig,
16
+ getReasoningConfigSync,
17
+ shouldIncludeReasoningSummary,
18
+ supportsReasoning,
19
+ supportsReasoningSync
20
+ } from "../chunk-X635CM2F.js";
21
+ import {
22
+ extractModelId,
23
+ extractProvider
24
+ } from "../chunk-QWFMX226.js";
25
+ import "../chunk-DWYX7ASF.js";
26
+ export {
27
+ EXTENDED_LEVELS,
28
+ FIXED_LEVELS,
29
+ STANDARD_LEVELS,
30
+ buildAnthropicOptions,
31
+ buildBedrockOptions,
32
+ buildGoogleOptions,
33
+ buildGroqOptions,
34
+ buildOpenAIOptions,
35
+ buildOpenRouterOptions,
36
+ buildReasoningOptions,
37
+ buildReasoningOptionsSync,
38
+ buildXAIOptions,
39
+ extractModelId,
40
+ extractProvider,
41
+ getProviderOptionsKey,
42
+ getReasoningConfig,
43
+ getReasoningConfigSync,
44
+ shouldIncludeReasoningSummary,
45
+ supportsReasoning,
46
+ supportsReasoningSync
47
+ };