@cuylabs/agent-core 0.11.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-DzPiv6EK.d.ts → instance-CP24g3Le.d.ts} +1 -1
  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-CJfwfzGe.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
@@ -60,7 +60,9 @@ function anyApprovalConditions(...conditions) {
60
60
  return (context) => conditions.some((condition) => condition(context));
61
61
  }
62
62
  function matchApprovalSessions(...sessionIds) {
63
- const allowed = new Set(sessionIds.map((sessionId) => sessionId.trim()).filter(Boolean));
63
+ const allowed = new Set(
64
+ sessionIds.map((sessionId) => sessionId.trim()).filter(Boolean)
65
+ );
64
66
  return (context) => allowed.has(context.sessionId);
65
67
  }
66
68
  function matchApprovalRisks(...risks) {
@@ -118,7 +120,11 @@ function normalizeApprovalCascadePolicy(input) {
118
120
  };
119
121
  }
120
122
  function normalizeRememberScopes(scopes) {
121
- const allowed = /* @__PURE__ */ new Set(["session", "project", "user"]);
123
+ const allowed = /* @__PURE__ */ new Set([
124
+ "session",
125
+ "project",
126
+ "user"
127
+ ]);
122
128
  const normalized = (scopes ?? [DEFAULT_REMEMBER_SCOPE]).filter(
123
129
  (scope) => allowed.has(scope)
124
130
  );
@@ -283,24 +289,34 @@ function createApprovalHandler(config = {}) {
283
289
  if (defaultAction === "deny") {
284
290
  throw new ApprovalDeniedError(tool, args);
285
291
  }
286
- throw new ApprovalDeniedError(tool, args, "No approval handler configured");
292
+ throw new ApprovalDeniedError(
293
+ tool,
294
+ args,
295
+ "No approval handler configured"
296
+ );
287
297
  }
288
298
  const ac = new AbortController();
289
299
  activeRequests.add(ac);
290
300
  let timeoutId;
291
301
  try {
292
- const resolution = normalizeApprovalDecision(await Promise.race([
293
- onRequest(evaluation.request),
294
- new Promise((_, reject) => {
295
- timeoutId = setTimeout(() => {
296
- reject(new ApprovalTimeoutError(tool, timeout));
297
- }, timeout);
298
- ac.signal.addEventListener("abort", () => {
299
- clearTimeout(timeoutId);
300
- reject(new Error("Cancelled"));
301
- }, { once: true });
302
- })
303
- ]));
302
+ const resolution = normalizeApprovalDecision(
303
+ await Promise.race([
304
+ onRequest(evaluation.request),
305
+ new Promise((_, reject) => {
306
+ timeoutId = setTimeout(() => {
307
+ reject(new ApprovalTimeoutError(tool, timeout));
308
+ }, timeout);
309
+ ac.signal.addEventListener(
310
+ "abort",
311
+ () => {
312
+ clearTimeout(timeoutId);
313
+ reject(new Error("Cancelled"));
314
+ },
315
+ { once: true }
316
+ );
317
+ })
318
+ ])
319
+ );
304
320
  switch (resolution.action) {
305
321
  case "allow":
306
322
  return;
@@ -527,7 +543,9 @@ function createApprovalPolicyPreset(name, options = {}) {
527
543
  case "dangerously-allow-all":
528
544
  return createDangerouslyAllowAllApprovalPolicy(options);
529
545
  case "risk-tier":
530
- return createRiskTierApprovalPolicy(options);
546
+ return createRiskTierApprovalPolicy(
547
+ options
548
+ );
531
549
  }
532
550
  }
533
551
 
@@ -872,7 +872,10 @@ function mergePluginManifest(manifest, definition) {
872
872
  description: definition.description ?? manifest.description,
873
873
  version: definition.version ?? manifest.version,
874
874
  compatibility: mergeCompatibility(manifest.compatibility, definition.compatibility) ?? manifest.compatibility,
875
- capabilities: mergeCapabilityTags(manifest.capabilities, definition.capabilities),
875
+ capabilities: mergeCapabilityTags(
876
+ manifest.capabilities,
877
+ definition.capabilities
878
+ ),
876
879
  surfaces: mergeSurfaceContract(manifest.surfaces, definition.surfaces)
877
880
  };
878
881
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  formatApprovalDeniedReason
3
- } from "./chunk-V4RFNEET.js";
3
+ } from "./chunk-MLTJHUVG.js";
4
4
  import {
5
5
  requiresToolHost
6
6
  } from "./chunk-FII65CN7.js";
@@ -61,7 +61,10 @@ function restoreScope(snapshot, fn) {
61
61
  }
62
62
  async function* streamWithinScope(options, iterable) {
63
63
  const scope = buildScope(options, getStoredScope());
64
- const iterator = await runWithScope(scope, () => iterable[Symbol.asyncIterator]());
64
+ const iterator = await runWithScope(
65
+ scope,
66
+ () => iterable[Symbol.asyncIterator]()
67
+ );
65
68
  try {
66
69
  while (true) {
67
70
  const next = await runWithScope(scope, () => iterator.next());