nexus-agents 2.81.2 → 2.81.3
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-37ZXD5B6.js → chunk-755EZIUF.js} +13 -85
- package/dist/{chunk-37ZXD5B6.js.map → chunk-755EZIUF.js.map} +1 -1
- package/dist/{chunk-MRCURXAX.js → chunk-EKLY4LBJ.js} +2 -2
- package/dist/{chunk-6KO6LO3L.js → chunk-WLAQXITV.js} +3 -3
- package/dist/cli.js +3 -3
- package/dist/index.d.ts +27 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/{setup-command-JBTK3LGD.js → setup-command-3VQHU7BZ.js} +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-MRCURXAX.js.map → chunk-EKLY4LBJ.js.map} +0 -0
- /package/dist/{chunk-6KO6LO3L.js.map → chunk-WLAQXITV.js.map} +0 -0
- /package/dist/{setup-command-JBTK3LGD.js.map → setup-command-3VQHU7BZ.js.map} +0 -0
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
DEFAULT_TASK_TTL_MS,
|
|
78
78
|
DEFAULT_TOOL_RATE_LIMITS,
|
|
79
79
|
clampTaskTtl
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-WLAQXITV.js";
|
|
81
81
|
import {
|
|
82
82
|
getAvailabilityCache,
|
|
83
83
|
resolveFallback
|
|
@@ -28246,15 +28246,12 @@ var PolicyEngine = class {
|
|
|
28246
28246
|
return matched.sort((a, b) => b.priority - a.priority);
|
|
28247
28247
|
}
|
|
28248
28248
|
};
|
|
28249
|
-
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
28250
|
-
var COST_WARNING_THRESHOLD = 0.8;
|
|
28251
28249
|
var trustTierRule = {
|
|
28252
28250
|
id: "trust-tier",
|
|
28253
28251
|
priority: 100,
|
|
28254
28252
|
evaluate(context) {
|
|
28255
|
-
const
|
|
28256
|
-
const
|
|
28257
|
-
const numericTier = typeof tierVal === "number" ? tierVal : typeof tierVal === "string" ? Number(tierVal) : Number.NaN;
|
|
28253
|
+
const tierVal = context.pipelineState.trustTier;
|
|
28254
|
+
const numericTier = tierVal === void 0 ? Number.NaN : Number(tierVal);
|
|
28258
28255
|
const tier = Number.isFinite(numericTier) ? numericTier : void 0;
|
|
28259
28256
|
if (tier !== void 0 && tier >= 3 && context.stageType === "execute") {
|
|
28260
28257
|
return {
|
|
@@ -28266,83 +28263,7 @@ var trustTierRule = {
|
|
|
28266
28263
|
return { allow: true };
|
|
28267
28264
|
}
|
|
28268
28265
|
};
|
|
28269
|
-
var
|
|
28270
|
-
id: "security-review",
|
|
28271
|
-
priority: 90,
|
|
28272
|
-
evaluate(context) {
|
|
28273
|
-
const state = context.pipelineState;
|
|
28274
|
-
const needsReview = state["securityReviewRequired"] === true;
|
|
28275
|
-
const hasReview = state["securityReviewComplete"] === true;
|
|
28276
|
-
if (needsReview && !hasReview && context.stageType === "execute") {
|
|
28277
|
-
return {
|
|
28278
|
-
allow: false,
|
|
28279
|
-
reason: "Security review required before implementation"
|
|
28280
|
-
};
|
|
28281
|
-
}
|
|
28282
|
-
return { allow: true };
|
|
28283
|
-
}
|
|
28284
|
-
};
|
|
28285
|
-
var boundedIterationRule = {
|
|
28286
|
-
id: "bounded-iteration",
|
|
28287
|
-
priority: 80,
|
|
28288
|
-
evaluate(context) {
|
|
28289
|
-
const state = context.pipelineState;
|
|
28290
|
-
const attemptsVal = state["stageAttempts"];
|
|
28291
|
-
const attempts = typeof attemptsVal === "number" ? attemptsVal : void 0;
|
|
28292
|
-
if (attempts !== void 0 && attempts >= DEFAULT_MAX_ATTEMPTS) {
|
|
28293
|
-
return {
|
|
28294
|
-
allow: false,
|
|
28295
|
-
reason: `Stage "${context.stageId}" exceeded max retries`
|
|
28296
|
-
};
|
|
28297
|
-
}
|
|
28298
|
-
return { allow: true };
|
|
28299
|
-
}
|
|
28300
|
-
};
|
|
28301
|
-
var costBudgetRule = {
|
|
28302
|
-
id: "cost-budget",
|
|
28303
|
-
priority: 70,
|
|
28304
|
-
evaluate(context) {
|
|
28305
|
-
const state = context.pipelineState;
|
|
28306
|
-
const spentVal = state["costAccumulator"];
|
|
28307
|
-
const spent = typeof spentVal === "number" ? spentVal : void 0;
|
|
28308
|
-
const budgetVal = state["costBudget"];
|
|
28309
|
-
const budget = typeof budgetVal === "number" ? budgetVal : void 0;
|
|
28310
|
-
if (spent !== void 0 && budget !== void 0) {
|
|
28311
|
-
if (spent > budget * COST_WARNING_THRESHOLD) {
|
|
28312
|
-
return {
|
|
28313
|
-
allow: false,
|
|
28314
|
-
reason: "Approaching cost budget limit",
|
|
28315
|
-
escalateTo: "user"
|
|
28316
|
-
};
|
|
28317
|
-
}
|
|
28318
|
-
}
|
|
28319
|
-
return { allow: true };
|
|
28320
|
-
}
|
|
28321
|
-
};
|
|
28322
|
-
var highRiskApprovalRule = {
|
|
28323
|
-
id: "high-risk-approval",
|
|
28324
|
-
priority: 60,
|
|
28325
|
-
evaluate(context) {
|
|
28326
|
-
const state = context.pipelineState;
|
|
28327
|
-
const isHighRisk = state["highRisk"] === true;
|
|
28328
|
-
const approved = state["userApproved"] === true;
|
|
28329
|
-
if (isHighRisk && !approved) {
|
|
28330
|
-
return {
|
|
28331
|
-
allow: false,
|
|
28332
|
-
reason: "High-risk action requires user approval",
|
|
28333
|
-
escalateTo: "user"
|
|
28334
|
-
};
|
|
28335
|
-
}
|
|
28336
|
-
return { allow: true };
|
|
28337
|
-
}
|
|
28338
|
-
};
|
|
28339
|
-
var BUILT_IN_RULES = [
|
|
28340
|
-
trustTierRule,
|
|
28341
|
-
securityReviewRule,
|
|
28342
|
-
boundedIterationRule,
|
|
28343
|
-
costBudgetRule,
|
|
28344
|
-
highRiskApprovalRule
|
|
28345
|
-
];
|
|
28266
|
+
var BUILT_IN_RULES = [trustTierRule];
|
|
28346
28267
|
function createDefaultPolicyEngine() {
|
|
28347
28268
|
const engine = new PolicyEngine();
|
|
28348
28269
|
for (const rule of BUILT_IN_RULES) {
|
|
@@ -28482,6 +28403,10 @@ function buildBaseTaskContract(input) {
|
|
|
28482
28403
|
}
|
|
28483
28404
|
|
|
28484
28405
|
// src/pipeline/v2-delegate.ts
|
|
28406
|
+
function toPipelineStateSnapshot(metadata) {
|
|
28407
|
+
const trustTier = metadata["trustTier"];
|
|
28408
|
+
return typeof trustTier === "string" ? { trustTier } : {};
|
|
28409
|
+
}
|
|
28485
28410
|
var logger22 = createLogger({ component: "V2Delegate" });
|
|
28486
28411
|
function createDelegatePipeline(task) {
|
|
28487
28412
|
const plan = buildPlan(task);
|
|
@@ -28541,7 +28466,10 @@ function checkPipelinePolicy(task, stageType) {
|
|
|
28541
28466
|
taskId: task.id,
|
|
28542
28467
|
stageId: `pre-execution-${stageType}`,
|
|
28543
28468
|
stageType,
|
|
28544
|
-
|
|
28469
|
+
// #2932: typed extraction. The untyped `task.metadata` is the producer
|
|
28470
|
+
// surface — we narrow to the policy snapshot here so adding a new rule
|
|
28471
|
+
// forces an explicit producer wire-up at this single chokepoint.
|
|
28472
|
+
pipelineState: toPipelineStateSnapshot(task.metadata)
|
|
28545
28473
|
};
|
|
28546
28474
|
const result = evaluatePolicy2({ engine, mode }, context);
|
|
28547
28475
|
if (!result.allowed) {
|
|
@@ -50301,4 +50229,4 @@ export {
|
|
|
50301
50229
|
detectBackend,
|
|
50302
50230
|
createTaskTracker
|
|
50303
50231
|
};
|
|
50304
|
-
//# sourceMappingURL=chunk-
|
|
50232
|
+
//# sourceMappingURL=chunk-755EZIUF.js.map
|