@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
@@ -1,305 +0,0 @@
1
- import {
2
- extractModelId,
3
- extractProvider,
4
- getDefaultResolver,
5
- likelySupportsReasoning
6
- } from "./chunk-RFEKJKTO.js";
7
-
8
- // src/reasoning/types.ts
9
- var STANDARD_LEVELS = ["off", "low", "medium", "high"];
10
- var EXTENDED_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"];
11
- var FIXED_LEVELS = ["medium"];
12
- function shouldIncludeReasoningSummary() {
13
- if (typeof process !== "undefined" && process.env) {
14
- return process.env.CODE_AGENT_DISABLE_REASONING_SUMMARY !== "true";
15
- }
16
- return true;
17
- }
18
-
19
- // src/reasoning/providers.ts
20
- function buildOpenAIOptions(level, compat) {
21
- if (level === "off") return void 0;
22
- const options = {};
23
- if (compat?.supportsReasoningEffort !== false) {
24
- options.reasoningEffort = level;
25
- }
26
- if (shouldIncludeReasoningSummary()) {
27
- options.reasoningSummary = "auto";
28
- }
29
- return options;
30
- }
31
- var ANTHROPIC_BUDGETS = {
32
- off: 0,
33
- minimal: 2e3,
34
- low: 4e3,
35
- medium: 8e3,
36
- high: 16e3,
37
- xhigh: 31999
38
- };
39
- function buildAnthropicOptions(level) {
40
- if (level === "off") return void 0;
41
- return {
42
- thinking: {
43
- type: "enabled",
44
- budgetTokens: ANTHROPIC_BUDGETS[level]
45
- }
46
- };
47
- }
48
- var GOOGLE_BUDGETS = {
49
- off: 0,
50
- minimal: 2e3,
51
- low: 4e3,
52
- medium: 8e3,
53
- high: 16e3,
54
- xhigh: 24576
55
- };
56
- function buildGoogleOptions(level, modelId) {
57
- if (level === "off") return void 0;
58
- if (modelId?.includes("gemini-3") || modelId?.includes("gemini-4")) {
59
- return {
60
- thinkingConfig: {
61
- includeThoughts: true,
62
- thinkingLevel: level === "high" || level === "xhigh" ? "high" : "low"
63
- }
64
- };
65
- }
66
- return {
67
- thinkingConfig: {
68
- includeThoughts: true,
69
- thinkingBudget: GOOGLE_BUDGETS[level]
70
- }
71
- };
72
- }
73
- function buildXAIOptions(level) {
74
- if (level === "off") return void 0;
75
- return { reasoningEffort: level };
76
- }
77
- function buildGroqOptions(level) {
78
- if (level === "off") return void 0;
79
- return {
80
- includeThoughts: true,
81
- thinkingLevel: level === "high" || level === "xhigh" ? "high" : "low"
82
- };
83
- }
84
- var BEDROCK_ANTHROPIC_BUDGETS = {
85
- off: 0,
86
- minimal: 2e3,
87
- low: 4e3,
88
- medium: 8e3,
89
- high: 16e3,
90
- xhigh: 31999
91
- };
92
- function buildBedrockOptions(level, modelId) {
93
- if (level === "off") return void 0;
94
- if (modelId?.includes("anthropic") || modelId?.includes("claude")) {
95
- return {
96
- reasoningConfig: {
97
- type: "enabled",
98
- budgetTokens: BEDROCK_ANTHROPIC_BUDGETS[level]
99
- }
100
- };
101
- }
102
- return {
103
- reasoningConfig: {
104
- type: "enabled",
105
- maxReasoningEffort: level
106
- }
107
- };
108
- }
109
- function buildOpenRouterOptions(level) {
110
- if (level === "off") return void 0;
111
- return {
112
- reasoning: { effort: level }
113
- };
114
- }
115
- var PROVIDER_KEY_MAP = {
116
- "openai.chat": "openai",
117
- "openai.responses": "openai",
118
- "anthropic.messages": "anthropic",
119
- "google.generative-ai": "google",
120
- "bedrock": "bedrock",
121
- "azure": "azure",
122
- "xai": "xai",
123
- "deepinfra": "deepinfra",
124
- "togetherai": "togetherai",
125
- "groq": "groq",
126
- "mistral": "mistral"
127
- };
128
- function getProviderOptionsKey(provider) {
129
- return PROVIDER_KEY_MAP[provider] || provider.split(".")[0] || "unknown";
130
- }
131
-
132
- // src/reasoning/config.ts
133
- async function getReasoningConfig(model) {
134
- const resolver = getDefaultResolver();
135
- const result = await resolver.resolve(model);
136
- const { capabilities, compatibility } = result.entry;
137
- const provider = extractProvider(model);
138
- const modelId = extractModelId(model).toLowerCase();
139
- if (!capabilities.reasoning) {
140
- return {
141
- supportsReasoning: false,
142
- availableLevels: ["off"],
143
- getProviderOptions: () => void 0
144
- };
145
- }
146
- if (provider?.includes("openai") || modelId.includes("gpt") || modelId.match(/^o[134]/)) {
147
- if (modelId === "o1-mini") {
148
- return {
149
- supportsReasoning: true,
150
- availableLevels: FIXED_LEVELS,
151
- getProviderOptions: () => void 0
152
- };
153
- }
154
- const isAdvanced = modelId.includes("gpt-5") || modelId.includes("o3") || modelId.includes("o4");
155
- return {
156
- supportsReasoning: true,
157
- availableLevels: isAdvanced ? EXTENDED_LEVELS : STANDARD_LEVELS,
158
- getProviderOptions: (level) => buildOpenAIOptions(level, compatibility)
159
- };
160
- }
161
- if (provider?.includes("anthropic") || modelId.includes("claude")) {
162
- return {
163
- supportsReasoning: true,
164
- availableLevels: ["off", "low", "medium", "high"],
165
- getProviderOptions: buildAnthropicOptions
166
- };
167
- }
168
- if (provider?.includes("google") || modelId.includes("gemini")) {
169
- return {
170
- supportsReasoning: true,
171
- availableLevels: STANDARD_LEVELS,
172
- getProviderOptions: (level) => buildGoogleOptions(level, modelId)
173
- };
174
- }
175
- if (provider?.includes("xai") || modelId.includes("grok")) {
176
- return {
177
- supportsReasoning: true,
178
- availableLevels: STANDARD_LEVELS,
179
- getProviderOptions: buildXAIOptions
180
- };
181
- }
182
- if (provider?.includes("bedrock")) {
183
- return {
184
- supportsReasoning: true,
185
- availableLevels: STANDARD_LEVELS,
186
- getProviderOptions: (level) => buildBedrockOptions(level, modelId)
187
- };
188
- }
189
- if (provider?.includes("groq")) {
190
- return {
191
- supportsReasoning: true,
192
- availableLevels: ["off", "low", "high"],
193
- getProviderOptions: buildGroqOptions
194
- };
195
- }
196
- if (provider?.includes("openrouter")) {
197
- return {
198
- supportsReasoning: true,
199
- availableLevels: STANDARD_LEVELS,
200
- getProviderOptions: buildOpenRouterOptions
201
- };
202
- }
203
- if (modelId.includes("r1") || modelId.includes("deepseek")) {
204
- return {
205
- supportsReasoning: true,
206
- availableLevels: FIXED_LEVELS,
207
- getProviderOptions: () => void 0
208
- };
209
- }
210
- return {
211
- supportsReasoning: true,
212
- availableLevels: STANDARD_LEVELS,
213
- getProviderOptions: (level) => buildOpenAIOptions(level, compatibility)
214
- };
215
- }
216
- function getReasoningConfigSync(model) {
217
- const modelId = extractModelId(model).toLowerCase();
218
- const provider = extractProvider(model) || "";
219
- const supportsReasoning2 = modelId.match(/^o[134]/) !== null || modelId.includes("gpt-5") || modelId.includes("r1") || modelId.includes("thinking") || modelId.includes("reasoning") || modelId.includes("grok") && modelId.includes("mini");
220
- if (!supportsReasoning2) {
221
- return {
222
- supportsReasoning: false,
223
- availableLevels: ["off"],
224
- getProviderOptions: () => void 0
225
- };
226
- }
227
- const isOpenAI = provider.includes("openai") || !!modelId.match(/^o[134]/) || modelId.includes("gpt");
228
- const isAnthropic = provider.includes("anthropic") || modelId.includes("claude");
229
- const isGoogle = provider.includes("google") || modelId.includes("gemini");
230
- const isXAI = provider.includes("xai") || modelId.includes("grok");
231
- const isBedrock = provider.includes("bedrock");
232
- const isGroq = provider.includes("groq");
233
- const isOpenRouter = provider.includes("openrouter");
234
- return {
235
- supportsReasoning: true,
236
- availableLevels: STANDARD_LEVELS,
237
- getProviderOptions: (level) => {
238
- if (level === "off") return void 0;
239
- if (isOpenAI) {
240
- const opts = { reasoningEffort: level };
241
- if (shouldIncludeReasoningSummary()) opts.reasoningSummary = "auto";
242
- return opts;
243
- }
244
- if (isAnthropic) return buildAnthropicOptions(level);
245
- if (isGoogle) return buildGoogleOptions(level, modelId);
246
- if (isXAI) return buildXAIOptions(level);
247
- if (isBedrock) return buildBedrockOptions(level, modelId);
248
- if (isGroq) return buildGroqOptions(level);
249
- if (isOpenRouter) return buildOpenRouterOptions(level);
250
- const defaultOpts = { reasoningEffort: level };
251
- if (shouldIncludeReasoningSummary()) defaultOpts.reasoningSummary = "auto";
252
- return defaultOpts;
253
- }
254
- };
255
- }
256
- async function buildReasoningOptions(model, level) {
257
- if (level === "off") return void 0;
258
- const config = await getReasoningConfig(model);
259
- if (!config.supportsReasoning) return void 0;
260
- const effectiveLevel = config.availableLevels.includes(level) ? level : config.availableLevels[config.availableLevels.length - 1];
261
- const options = config.getProviderOptions(effectiveLevel);
262
- if (!options) return void 0;
263
- const provider = extractProvider(model) || "";
264
- const providerKey = getProviderOptionsKey(provider);
265
- return { [providerKey]: options };
266
- }
267
- function buildReasoningOptionsSync(model, level) {
268
- if (level === "off") return void 0;
269
- const config = getReasoningConfigSync(model);
270
- if (!config.supportsReasoning) return void 0;
271
- const effectiveLevel = config.availableLevels.includes(level) ? level : config.availableLevels[config.availableLevels.length - 1];
272
- const options = config.getProviderOptions(effectiveLevel);
273
- if (!options) return void 0;
274
- const provider = extractProvider(model) || "";
275
- const providerKey = getProviderOptionsKey(provider);
276
- return { [providerKey]: options };
277
- }
278
- async function supportsReasoning(model) {
279
- const resolver = getDefaultResolver();
280
- return resolver.supportsReasoning(model);
281
- }
282
- function supportsReasoningSync(model) {
283
- return likelySupportsReasoning(extractModelId(model));
284
- }
285
-
286
- export {
287
- STANDARD_LEVELS,
288
- EXTENDED_LEVELS,
289
- FIXED_LEVELS,
290
- shouldIncludeReasoningSummary,
291
- buildOpenAIOptions,
292
- buildAnthropicOptions,
293
- buildGoogleOptions,
294
- buildXAIOptions,
295
- buildGroqOptions,
296
- buildBedrockOptions,
297
- buildOpenRouterOptions,
298
- getProviderOptionsKey,
299
- getReasoningConfig,
300
- getReasoningConfigSync,
301
- buildReasoningOptions,
302
- buildReasoningOptionsSync,
303
- supportsReasoning,
304
- supportsReasoningSync
305
- };