@cuylabs/agent-core 0.10.0 → 0.12.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 (58) hide show
  1. package/dist/{chunk-CMYN2RCB.js → chunk-33UIM3QS.js} +13 -7
  2. package/dist/{chunk-SPILYYDF.js → chunk-BERMUFZA.js} +22 -5
  3. package/dist/{chunk-TOTDGK3P.js → chunk-CSR75JVC.js} +4 -5
  4. package/dist/{chunk-ICZ66572.js → chunk-CZ5XOVDV.js} +40 -9
  5. package/dist/{chunk-2O4MCSQS.js → chunk-FYC33XFI.js} +31 -10
  6. package/dist/{chunk-WBPOZ7CL.js → chunk-JNN3RUIL.js} +86 -36
  7. package/dist/{chunk-SSFBF3US.js → chunk-JPBFAQNS.js} +7 -12
  8. package/dist/{chunk-5FMSGQVX.js → chunk-JZRLCTSD.js} +8 -2
  9. package/dist/{chunk-V4RFNEET.js → chunk-MLTJHUVG.js} +34 -16
  10. package/dist/{chunk-QAL3OMI3.js → chunk-MO3N6M32.js} +4 -1
  11. package/dist/{chunk-5NVVNXPQ.js → chunk-QEE5CBPM.js} +5 -2
  12. package/dist/{chunk-MXAP4UG6.js → chunk-QJV5XPPS.js} +238 -86
  13. package/dist/{chunk-T4UIX5D7.js → chunk-S6AKEPAX.js} +9 -3
  14. package/dist/{chunk-N3VX7FEE.js → chunk-STDJYXYK.js} +1 -4
  15. package/dist/{chunk-6HZBHFOL.js → chunk-TPZ37IWI.js} +10 -1
  16. package/dist/{chunk-NDZWXCBZ.js → chunk-TZ4VA4VX.js} +33 -11
  17. package/dist/{chunk-GFTW23FV.js → chunk-UECLINZM.js} +4 -2
  18. package/dist/chunk-US7S4FYW.js +610 -0
  19. package/dist/{chunk-RN6WZEUF.js → chunk-WI5JFEAI.js} +71 -36
  20. package/dist/dispatch/index.d.ts +5 -3
  21. package/dist/dispatch/index.js +3 -3
  22. package/dist/execution/index.d.ts +6 -4
  23. package/dist/execution/index.js +7 -7
  24. package/dist/index.d.ts +8 -5
  25. package/dist/index.js +117 -114
  26. package/dist/inference/errors/index.js +1 -1
  27. package/dist/inference/index.d.ts +6 -4
  28. package/dist/inference/index.js +6 -6
  29. package/dist/{instance-BqV2D5pc.d.ts → instance-CP24g3Le.d.ts} +2 -2
  30. package/dist/logger/index.js +1 -1
  31. package/dist/mcp/index.d.ts +116 -3
  32. package/dist/mcp/index.js +6 -2
  33. package/dist/middleware/index.d.ts +5 -3
  34. package/dist/middleware/index.js +3 -3
  35. package/dist/{model-messages-B4nK9D1-.d.ts → model-messages-B_MCHyiX.d.ts} +1 -1
  36. package/dist/models/index.js +2 -2
  37. package/dist/models/reasoning/index.js +2 -2
  38. package/dist/plugin/index.d.ts +4 -2
  39. package/dist/plugin/index.js +1 -1
  40. package/dist/profiles/index.d.ts +4 -2
  41. package/dist/profiles/index.js +1 -1
  42. package/dist/prompt/index.d.ts +5 -3
  43. package/dist/prompt/index.js +2 -2
  44. package/dist/safety/index.d.ts +5 -3
  45. package/dist/safety/index.js +1 -1
  46. package/dist/skill/index.d.ts +5 -3
  47. package/dist/skill/index.js +2 -2
  48. package/dist/storage/index.d.ts +5 -3
  49. package/dist/storage/index.js +1 -1
  50. package/dist/subagents/index.d.ts +4 -2
  51. package/dist/subagents/index.js +4 -4
  52. package/dist/team/index.d.ts +5 -3
  53. package/dist/team/index.js +1 -1
  54. package/dist/tool/index.d.ts +5 -3
  55. package/dist/tool/index.js +2 -2
  56. package/dist/{types-Bj_J8u_W.d.ts → types-DMjoFKKv.d.ts} +55 -7
  57. package/package.json +1 -6
  58. package/dist/chunk-ROTGCYDW.js +0 -221
@@ -71,8 +71,10 @@ function createFileLoggerWithPrefix(stream, minLevel, prefix) {
71
71
  function emit(level, message, meta) {
72
72
  if (!shouldLog(level)) return;
73
73
  const metaStr = meta ? formatMeta(meta) : "";
74
- stream.write(`${formatTimestamp()} ${level.toUpperCase().padEnd(5)} [${prefix}] ${message}${metaStr}
75
- `);
74
+ stream.write(
75
+ `${formatTimestamp()} ${level.toUpperCase().padEnd(5)} [${prefix}] ${message}${metaStr}
76
+ `
77
+ );
76
78
  }
77
79
  return {
78
80
  debug(message, meta) {
@@ -88,7 +90,11 @@ function createFileLoggerWithPrefix(stream, minLevel, prefix) {
88
90
  emit("error", message, meta);
89
91
  },
90
92
  child(namespace) {
91
- return createFileLoggerWithPrefix(stream, minLevel, `${prefix}:${namespace}`);
93
+ return createFileLoggerWithPrefix(
94
+ stream,
95
+ minLevel,
96
+ `${prefix}:${namespace}`
97
+ );
92
98
  }
93
99
  };
94
100
  }
@@ -151,10 +151,7 @@ var LLMError = class _LLMError extends Error {
151
151
  this.headers = options.headers;
152
152
  this.provider = options.provider;
153
153
  this.model = options.model;
154
- this.category = options.category ?? classifyFromStatusAndMessage(
155
- options.status,
156
- options.message
157
- );
154
+ this.category = options.category ?? classifyFromStatusAndMessage(options.status, options.message);
158
155
  this.isRetryable = isRetryableCategory(this.category);
159
156
  this.retryDelayMs = this.headers ? parseRetryDelay(this.headers) : void 0;
160
157
  }
@@ -139,7 +139,16 @@ Error recovery:
139
139
  var watch = {
140
140
  name: "watch",
141
141
  description: "Process monitoring mode for running and watching long commands",
142
- allowTools: ["bash*", "exec*", "run*", "read*", "grep*", "glob*", "list*", "find*"],
142
+ allowTools: [
143
+ "bash*",
144
+ "exec*",
145
+ "run*",
146
+ "read*",
147
+ "grep*",
148
+ "glob*",
149
+ "list*",
150
+ "find*"
151
+ ],
143
152
  denyTools: ["write*", "edit*", "delete*", "remove*"],
144
153
  systemPrompt: `{basePrompt}
145
154
 
@@ -11,10 +11,10 @@ import {
11
11
  createApprovalCorrection,
12
12
  createApprovalHandler,
13
13
  formatApprovalDeniedReason
14
- } from "./chunk-V4RFNEET.js";
14
+ } from "./chunk-MLTJHUVG.js";
15
15
  import {
16
16
  silentLogger
17
- } from "./chunk-T4UIX5D7.js";
17
+ } from "./chunk-S6AKEPAX.js";
18
18
 
19
19
  // src/middleware/runner.ts
20
20
  var MiddlewareRunner = class {
@@ -76,7 +76,9 @@ var MiddlewareRunner = class {
76
76
  current = next;
77
77
  }
78
78
  } catch (err) {
79
- this.log.warn(`"${mw.name}" model.chunk error: ${err instanceof Error ? err.message : String(err)}`);
79
+ this.log.warn(
80
+ `"${mw.name}" model.chunk error: ${err instanceof Error ? err.message : String(err)}`
81
+ );
80
82
  }
81
83
  }
82
84
  return current ?? void 0;
@@ -95,7 +97,9 @@ var MiddlewareRunner = class {
95
97
  current = next;
96
98
  }
97
99
  } catch (err) {
98
- this.log.warn(`"${mw.name}" model.output error: ${err instanceof Error ? err.message : String(err)}`);
100
+ this.log.warn(
101
+ `"${mw.name}" model.output error: ${err instanceof Error ? err.message : String(err)}`
102
+ );
99
103
  }
100
104
  }
101
105
  return current;
@@ -158,7 +162,9 @@ var MiddlewareRunner = class {
158
162
  try {
159
163
  current = await mw.afterToolCall(tool, args, current, ctx);
160
164
  } catch (err) {
161
- this.log.warn(`"${mw.name}" afterToolCall error: ${err instanceof Error ? err.message : String(err)}`);
165
+ this.log.warn(
166
+ `"${mw.name}" afterToolCall error: ${err instanceof Error ? err.message : String(err)}`
167
+ );
162
168
  }
163
169
  }
164
170
  return current;
@@ -185,7 +191,9 @@ var MiddlewareRunner = class {
185
191
  sections.push(result);
186
192
  }
187
193
  } catch (err) {
188
- this.log.warn(`"${mw.name}" promptSections error: ${err instanceof Error ? err.message : String(err)}`);
194
+ this.log.warn(
195
+ `"${mw.name}" promptSections error: ${err instanceof Error ? err.message : String(err)}`
196
+ );
189
197
  }
190
198
  }
191
199
  return sections;
@@ -236,7 +244,9 @@ var MiddlewareRunner = class {
236
244
  try {
237
245
  await mw.onChatStart(sessionId, message, ctx);
238
246
  } catch (err) {
239
- this.log.warn(`"${mw.name}" onChatStart error: ${err instanceof Error ? err.message : String(err)}`);
247
+ this.log.warn(
248
+ `"${mw.name}" onChatStart error: ${err instanceof Error ? err.message : String(err)}`
249
+ );
240
250
  }
241
251
  }
242
252
  }
@@ -255,7 +265,9 @@ var MiddlewareRunner = class {
255
265
  try {
256
266
  await mw.onChatEnd(sessionId, result, ctx);
257
267
  } catch (err) {
258
- this.log.warn(`"${mw.name}" onChatEnd error: ${err instanceof Error ? err.message : String(err)}`);
268
+ this.log.warn(
269
+ `"${mw.name}" onChatEnd error: ${err instanceof Error ? err.message : String(err)}`
270
+ );
259
271
  }
260
272
  }
261
273
  }
@@ -507,7 +519,10 @@ function otelMiddleware(config = {}) {
507
519
  const outputValue = (typeof result.output === "string" ? result.output : JSON.stringify(result.output)).slice(0, 4096);
508
520
  entry.span.setAttribute("gen_ai.tool.call.result", outputValue);
509
521
  entry.span.setAttribute("output.value", outputValue);
510
- entry.span.setAttribute("output.mime_type", getInputMimeType(outputValue));
522
+ entry.span.setAttribute(
523
+ "output.mime_type",
524
+ getInputMimeType(outputValue)
525
+ );
511
526
  }
512
527
  entry.span.setStatus({ code: otel?.SpanStatusCode.OK ?? 1 });
513
528
  entry.span.end();
@@ -561,7 +576,10 @@ function otelMiddleware(config = {}) {
561
576
  const outputValue = result.output.slice(0, 4096);
562
577
  entry.span.setAttribute("gen_ai.output.text", outputValue);
563
578
  entry.span.setAttribute("output.value", outputValue);
564
- entry.span.setAttribute("output.mime_type", getInputMimeType(outputValue));
579
+ entry.span.setAttribute(
580
+ "output.mime_type",
581
+ getInputMimeType(outputValue)
582
+ );
565
583
  }
566
584
  if (result.error) {
567
585
  entry.span.setStatus({
@@ -653,7 +671,11 @@ async function releaseSharedProvider(providerPromise) {
653
671
  }
654
672
  }
655
673
  async function createAndRegisterProvider(spanProcessor, serviceName) {
656
- const [{ NodeTracerProvider }, { resourceFromAttributes }, { ATTR_SERVICE_NAME }] = await Promise.all([
674
+ const [
675
+ { NodeTracerProvider },
676
+ { resourceFromAttributes },
677
+ { ATTR_SERVICE_NAME }
678
+ ] = await Promise.all([
657
679
  import("@opentelemetry/sdk-trace-node"),
658
680
  import("@opentelemetry/resources"),
659
681
  import("@opentelemetry/semantic-conventions")
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createSkillRegistry,
3
3
  emptySkillRegistry
4
- } from "./chunk-SPILYYDF.js";
4
+ } from "./chunk-BERMUFZA.js";
5
5
  import {
6
6
  extractModelId,
7
7
  extractProvider
@@ -311,7 +311,9 @@ function formatInstructions(files, basePath) {
311
311
  for (const file of files) {
312
312
  const displayPath = basePath ? file.path.replace(basePath + sep, "").replace(basePath, "") : basename2(file.path);
313
313
  blocks.push("");
314
- blocks.push(`<instructions source="${displayPath}" scope="${file.source}">`);
314
+ blocks.push(
315
+ `<instructions source="${displayPath}" scope="${file.source}">`
316
+ );
315
317
  blocks.push(file.content);
316
318
  blocks.push("</instructions>");
317
319
  }