@synkro-sh/cli 1.7.4 → 1.7.5
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/bootstrap.js +7 -7
- package/dist/bootstrap.js.map +1 -1
- package/package.json +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -5487,10 +5487,10 @@ async function main() {
|
|
|
5487
5487
|
const id = m.replace(/<\/?rule_id>/g, '').trim().replace(/^cwe-/, 'CWE-');
|
|
5488
5488
|
if (id && !cweIds.includes(id)) cweIds.push(id);
|
|
5489
5489
|
}
|
|
5490
|
-
const fMatches = gradeResp.match(/<suggested_fix>([
|
|
5490
|
+
const fMatches = gradeResp.match(/<(?:suggested_fix|required_fix)>([\s\S]*?)<\/(?:suggested_fix|required_fix)>/g) || [];
|
|
5491
5491
|
const respIds = ruleIdMatches.map(rm => rm.replace(/<\/?rule_id>/g, '').trim().replace(/^cwe-/, 'CWE-'));
|
|
5492
5492
|
for (let i = 0; i < Math.min(respIds.length, fMatches.length); i++) {
|
|
5493
|
-
if (!fixes[respIds[i]]) fixes[respIds[i]] = fMatches[i].replace(/<\/?suggested_fix>/g, '').trim();
|
|
5493
|
+
if (!fixes[respIds[i]]) fixes[respIds[i]] = fMatches[i].replace(/<\/?(?:suggested_fix|required_fix)>/g, '').trim();
|
|
5494
5494
|
}
|
|
5495
5495
|
// Per-<violation> pass for the verbatim snippet (code may contain '<'),
|
|
5496
5496
|
// paired with its rule_id so each finding carries its own offending code.
|
|
@@ -5540,9 +5540,9 @@ async function main() {
|
|
|
5540
5540
|
// Fix is dropped when it just restates the explanation so no line double-prints.
|
|
5541
5541
|
const cweBlocks = activeCweIds.map(id => {
|
|
5542
5542
|
const why = oneSentence(reasons[id] || verdict.reason || cweNameMap.get(id.toUpperCase()) || 'code weakness detected');
|
|
5543
|
-
const fix = fixes[id] ?
|
|
5543
|
+
const fix = fixes[id] ? String(fixes[id]).replace(/[\x00-\x08\x0B-\x1F\x7F]/g, ' ').trim().slice(0, 1200) : '';
|
|
5544
5544
|
const showFix = !!fix && !why.toLowerCase().includes(fix.slice(0, 40).toLowerCase());
|
|
5545
|
-
return '[' + id + '] ' + why + (showFix ? '
|
|
5545
|
+
return '[' + id + '] ' + why + (showFix ? ' REQUIRED FIX (apply exactly — do not substitute a different library/format/approach): ' + fix : '');
|
|
5546
5546
|
});
|
|
5547
5547
|
// Bound the total: list as many CWEs as fit, spill the rest to a "+N more" note.
|
|
5548
5548
|
let denyDetail = cweBlocks.join('\n');
|
|
@@ -5553,7 +5553,7 @@ async function main() {
|
|
|
5553
5553
|
const more = cweBlocks.length - kept.length;
|
|
5554
5554
|
denyDetail = kept.join('\n') + (more > 0 ? '\n(+' + more + ' more CWE weakness' + (more === 1 ? '' : 'es') + ' — fix these first, then re-run to surface the rest)' : '');
|
|
5555
5555
|
}
|
|
5556
|
-
const ctx = 'CWE weaknesses to fix (' + count + '):\n' + denyDetail + '\
|
|
5556
|
+
const ctx = 'CWE weaknesses to fix (' + count + '):\n' + denyDetail + '\nThese are REQUIRED FIXES — apply each one exactly as given; do NOT substitute your own approach or a different library/format. Do NOT ask the user to make the edit manually — resolve every weakness in code yourself.';
|
|
5557
5557
|
|
|
5558
5558
|
emitBlockScanFindings(
|
|
5559
5559
|
jwt,
|
|
@@ -11611,7 +11611,7 @@ function writeConfigEnv(opts) {
|
|
|
11611
11611
|
`SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
|
|
11612
11612
|
`SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
|
|
11613
11613
|
`SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
|
|
11614
|
-
`SYNKRO_VERSION=${shellQuoteSingle("1.7.
|
|
11614
|
+
`SYNKRO_VERSION=${shellQuoteSingle("1.7.5")}`
|
|
11615
11615
|
];
|
|
11616
11616
|
if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
|
|
11617
11617
|
if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
|
|
@@ -15674,7 +15674,7 @@ var args = process.argv.slice(2);
|
|
|
15674
15674
|
var cmd = args[0] || "";
|
|
15675
15675
|
var subArgs = args.slice(1);
|
|
15676
15676
|
function printVersion() {
|
|
15677
|
-
console.log("1.7.
|
|
15677
|
+
console.log("1.7.5");
|
|
15678
15678
|
}
|
|
15679
15679
|
function printHelp2() {
|
|
15680
15680
|
console.log(`Synkro CLI \u2014 runtime safety for AI coding agents
|