@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.
- package/dist/{chunk-CMYN2RCB.js → chunk-33UIM3QS.js} +13 -7
- package/dist/{chunk-SPILYYDF.js → chunk-BERMUFZA.js} +22 -5
- package/dist/{chunk-TOTDGK3P.js → chunk-CSR75JVC.js} +4 -5
- package/dist/{chunk-ICZ66572.js → chunk-CZ5XOVDV.js} +40 -9
- package/dist/{chunk-2O4MCSQS.js → chunk-FYC33XFI.js} +31 -10
- package/dist/{chunk-WBPOZ7CL.js → chunk-JNN3RUIL.js} +86 -36
- package/dist/{chunk-SSFBF3US.js → chunk-JPBFAQNS.js} +7 -12
- package/dist/{chunk-5FMSGQVX.js → chunk-JZRLCTSD.js} +8 -2
- package/dist/{chunk-V4RFNEET.js → chunk-MLTJHUVG.js} +34 -16
- package/dist/{chunk-QAL3OMI3.js → chunk-MO3N6M32.js} +4 -1
- package/dist/{chunk-5NVVNXPQ.js → chunk-QEE5CBPM.js} +5 -2
- package/dist/{chunk-MXAP4UG6.js → chunk-QJV5XPPS.js} +238 -86
- package/dist/{chunk-T4UIX5D7.js → chunk-S6AKEPAX.js} +9 -3
- package/dist/{chunk-N3VX7FEE.js → chunk-STDJYXYK.js} +1 -4
- package/dist/{chunk-6HZBHFOL.js → chunk-TPZ37IWI.js} +10 -1
- package/dist/{chunk-NDZWXCBZ.js → chunk-TZ4VA4VX.js} +33 -11
- package/dist/{chunk-GFTW23FV.js → chunk-UECLINZM.js} +4 -2
- package/dist/chunk-US7S4FYW.js +610 -0
- package/dist/{chunk-RN6WZEUF.js → chunk-WI5JFEAI.js} +71 -36
- package/dist/dispatch/index.d.ts +5 -3
- package/dist/dispatch/index.js +3 -3
- package/dist/execution/index.d.ts +6 -4
- package/dist/execution/index.js +7 -7
- package/dist/index.d.ts +8 -5
- package/dist/index.js +117 -114
- package/dist/inference/errors/index.js +1 -1
- package/dist/inference/index.d.ts +6 -4
- package/dist/inference/index.js +6 -6
- package/dist/{instance-DzPiv6EK.d.ts → instance-CP24g3Le.d.ts} +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/mcp/index.d.ts +116 -3
- package/dist/mcp/index.js +6 -2
- package/dist/middleware/index.d.ts +5 -3
- package/dist/middleware/index.js +3 -3
- package/dist/{model-messages-CJfwfzGe.d.ts → model-messages-B_MCHyiX.d.ts} +1 -1
- package/dist/models/index.js +2 -2
- package/dist/models/reasoning/index.js +2 -2
- package/dist/plugin/index.d.ts +4 -2
- package/dist/plugin/index.js +1 -1
- package/dist/profiles/index.d.ts +4 -2
- package/dist/profiles/index.js +1 -1
- package/dist/prompt/index.d.ts +5 -3
- package/dist/prompt/index.js +2 -2
- package/dist/safety/index.d.ts +5 -3
- package/dist/safety/index.js +1 -1
- package/dist/skill/index.d.ts +5 -3
- package/dist/skill/index.js +2 -2
- package/dist/storage/index.d.ts +5 -3
- package/dist/storage/index.js +1 -1
- package/dist/subagents/index.d.ts +4 -2
- package/dist/subagents/index.js +4 -4
- package/dist/team/index.d.ts +5 -3
- package/dist/team/index.js +1 -1
- package/dist/tool/index.d.ts +5 -3
- package/dist/tool/index.js +2 -2
- package/dist/{types-Bj_J8u_W.d.ts → types-DMjoFKKv.d.ts} +55 -7
- package/package.json +1 -6
- 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(
|
|
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([
|
|
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(
|
|
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(
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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(
|
|
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(
|
|
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-
|
|
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(
|
|
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());
|