nexus-agents 8.3.1 → 8.3.2
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-AQF22T74.js → chunk-3OU7XMEP.js} +2 -2
- package/dist/{chunk-LW6FPSPN.js → chunk-3RMLDTUF.js} +3 -3
- package/dist/{chunk-6SPKOLVU.js → chunk-44I4XVRU.js} +2 -2
- package/dist/chunk-LZBARHPR.js +7 -0
- package/dist/{chunk-OFUJNXH3.js → chunk-ONSYYUB4.js} +104 -90
- package/dist/chunk-ONSYYUB4.js.map +1 -0
- package/dist/{chunk-TSZWXRF7.js → chunk-VULYVX6X.js} +24 -9
- package/dist/chunk-VULYVX6X.js.map +1 -0
- package/dist/cli.js +7 -7
- package/dist/{consensus-vote-44WT45UN.js → consensus-vote-H67IAMI2.js} +4 -4
- package/dist/{improvement-review-P7JBYDL6.js → improvement-review-UECHDBER.js} +4 -4
- package/dist/index.d.ts +41 -21
- package/dist/index.js +7 -7
- package/dist/{setup-data-dir-Y4F4R2BJ.js → setup-data-dir-HJCC6U4N.js} +3 -3
- package/package.json +2 -2
- package/dist/chunk-2OS7HTUM.js +0 -7
- package/dist/chunk-OFUJNXH3.js.map +0 -1
- package/dist/chunk-TSZWXRF7.js.map +0 -1
- /package/dist/{chunk-AQF22T74.js.map → chunk-3OU7XMEP.js.map} +0 -0
- /package/dist/{chunk-LW6FPSPN.js.map → chunk-3RMLDTUF.js.map} +0 -0
- /package/dist/{chunk-6SPKOLVU.js.map → chunk-44I4XVRU.js.map} +0 -0
- /package/dist/{chunk-2OS7HTUM.js.map → chunk-LZBARHPR.js.map} +0 -0
- /package/dist/{consensus-vote-44WT45UN.js.map → consensus-vote-H67IAMI2.js.map} +0 -0
- /package/dist/{improvement-review-P7JBYDL6.js.map → improvement-review-UECHDBER.js.map} +0 -0
- /package/dist/{setup-data-dir-Y4F4R2BJ.js.map → setup-data-dir-HJCC6U4N.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LZBARHPR.js";
|
|
4
4
|
import {
|
|
5
5
|
emitClawGuardViolation
|
|
6
6
|
} from "./chunk-U5YJKJK2.js";
|
|
@@ -1029,24 +1029,37 @@ function checkSecurityTier(config, sanitizeResult, logger) {
|
|
|
1029
1029
|
});
|
|
1030
1030
|
}
|
|
1031
1031
|
function runPreChecks(config, args, mode, requestContext, logger) {
|
|
1032
|
+
const noSanitization = { wasModified: false, commentsRemoved: 0 };
|
|
1032
1033
|
const sizeResult = checkInputSize(args, logger, requestContext.requestId);
|
|
1033
|
-
if (sizeResult)
|
|
1034
|
+
if (sizeResult) {
|
|
1035
|
+
return {
|
|
1036
|
+
error: sizeResult,
|
|
1037
|
+
sanitizedArgs: args,
|
|
1038
|
+
nearMiss: false,
|
|
1039
|
+
sanitization: noSanitization
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1034
1042
|
const sanitizeResult = sanitizeToolInput(args);
|
|
1035
1043
|
logSanitizationResult(sanitizeResult, logger, config.toolName);
|
|
1036
1044
|
const sanitizedArgs = sanitizeResult.wasModified ? sanitizeResult.sanitized : args;
|
|
1045
|
+
const sanitization = {
|
|
1046
|
+
wasModified: sanitizeResult.wasModified,
|
|
1047
|
+
commentsRemoved: sanitizeResult.commentsRemoved
|
|
1048
|
+
};
|
|
1037
1049
|
const tierError = checkSecurityTier(config, sanitizeResult, logger);
|
|
1038
|
-
if (tierError !== null) return { error: tierError, sanitizedArgs, nearMiss: false };
|
|
1050
|
+
if (tierError !== null) return { error: tierError, sanitizedArgs, nearMiss: false, sanitization };
|
|
1039
1051
|
if (config.rateLimiter) {
|
|
1040
1052
|
const rlResult = checkRateLimit(config.rateLimiter, logger);
|
|
1041
1053
|
if (rlResult) {
|
|
1042
1054
|
if (config.auditLogger)
|
|
1043
1055
|
emitRateLimitAudit(config.auditLogger, config.toolName, requestContext);
|
|
1044
|
-
return { error: rlResult, sanitizedArgs, nearMiss: false };
|
|
1056
|
+
return { error: rlResult, sanitizedArgs, nearMiss: false, sanitization };
|
|
1045
1057
|
}
|
|
1046
1058
|
}
|
|
1047
1059
|
const policy = runPolicyCheck(config, sanitizedArgs, mode, logger, requestContext);
|
|
1048
|
-
if (policy.error)
|
|
1049
|
-
|
|
1060
|
+
if (policy.error)
|
|
1061
|
+
return { error: policy.error, sanitizedArgs, nearMiss: policy.nearMiss, sanitization };
|
|
1062
|
+
return { error: null, sanitizedArgs, nearMiss: policy.nearMiss, sanitization };
|
|
1050
1063
|
}
|
|
1051
1064
|
function createSecureHandler(handler, config) {
|
|
1052
1065
|
const logger = config.logger ?? createLogger({ tool: config.toolName });
|
|
@@ -1066,13 +1079,15 @@ function createSecureHandler(handler, config) {
|
|
|
1066
1079
|
const {
|
|
1067
1080
|
error: preCheckError,
|
|
1068
1081
|
sanitizedArgs,
|
|
1069
|
-
nearMiss
|
|
1082
|
+
nearMiss,
|
|
1083
|
+
sanitization
|
|
1070
1084
|
} = runPreChecks(config, args, mode, requestContext, requestLogger);
|
|
1071
1085
|
if (preCheckError) return preCheckError;
|
|
1072
1086
|
return executeAndAudit(handler, sanitizedArgs, config, {
|
|
1073
1087
|
requestContext,
|
|
1074
1088
|
requestLogger,
|
|
1075
1089
|
nearMiss,
|
|
1090
|
+
sanitization,
|
|
1076
1091
|
logLifecycle: inherited === void 0
|
|
1077
1092
|
});
|
|
1078
1093
|
};
|
|
@@ -1084,7 +1099,7 @@ async function executeAndAudit(handler, sanitizedArgs, config, invocation) {
|
|
|
1084
1099
|
const result = await executeHandler(
|
|
1085
1100
|
handler,
|
|
1086
1101
|
sanitizedArgs,
|
|
1087
|
-
{ requestContext, logger: requestLogger },
|
|
1102
|
+
{ requestContext, logger: requestLogger, sanitization: invocation.sanitization },
|
|
1088
1103
|
requestLogger,
|
|
1089
1104
|
invocation.logLifecycle
|
|
1090
1105
|
);
|
|
@@ -2231,4 +2246,4 @@ export {
|
|
|
2231
2246
|
VOTING_THRESHOLDS,
|
|
2232
2247
|
ConsensusMetricsSchema
|
|
2233
2248
|
};
|
|
2234
|
-
//# sourceMappingURL=chunk-
|
|
2249
|
+
//# sourceMappingURL=chunk-VULYVX6X.js.map
|