@blogic-cz/agent-tools 1.5.10 → 1.5.11
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credential-guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAmB,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAI5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAM/D,8CAA8C;AAC9C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,CAAC;AAQF,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG;IAC5B,uBAAuB,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACxE,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3E,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACrD,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjF,kBAAkB,EAAE,CAAC,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C9E,eAAO,MAAM,kBAAkB,YAzxEC,MAAM,KAAK,MAAM,GAAG,IAyxEa,CAAC"}
|
package/package.json
CHANGED
|
@@ -478,7 +478,7 @@ function unwrapProofCommand(words: string[], marker: string): string[] | undefin
|
|
|
478
478
|
function isLiteralLoopCommand(words: string[], marker: string, value: string): boolean {
|
|
479
479
|
const marked = unwrapProofCommand(words, marker);
|
|
480
480
|
if (!marked) return false;
|
|
481
|
-
const argv = marked.map((word) => word.replaceAll(marker, value));
|
|
481
|
+
const argv = marked.map((word) => word.replaceAll(marker, () => value));
|
|
482
482
|
const name = argv[0];
|
|
483
483
|
const uses = marked.flatMap((word, index) => (word.includes(marker) ? [index] : []));
|
|
484
484
|
if (name === "cat")
|
|
@@ -579,7 +579,7 @@ function materializeLiteralShell(command: string): LiteralShellProof | undefined
|
|
|
579
579
|
);
|
|
580
580
|
if (size > 65_536) return undefined;
|
|
581
581
|
return {
|
|
582
|
-
command: values.map((value) => marked.text.replaceAll(marker, value)).join(";\n"),
|
|
582
|
+
command: values.map((value) => marked.text.replaceAll(marker, () => value)).join(";\n"),
|
|
583
583
|
paths: [],
|
|
584
584
|
};
|
|
585
585
|
}
|
|
@@ -621,8 +621,11 @@ function materializeLiteralShell(command: string): LiteralShellProof | undefined
|
|
|
621
621
|
(assignment[1]?.length ?? 0) +
|
|
622
622
|
7;
|
|
623
623
|
if (size > 65_536) return undefined;
|
|
624
|
-
const paths = argv.slice(3).map((word) => word.replaceAll(marker, value));
|
|
625
|
-
return {
|
|
624
|
+
const paths = argv.slice(3).map((word) => word.replaceAll(marker, () => value));
|
|
625
|
+
return {
|
|
626
|
+
command: `cd ${assignment[1]} && ${use.replaceAll(marker, () => value)}${suffix}`,
|
|
627
|
+
paths,
|
|
628
|
+
};
|
|
626
629
|
}
|
|
627
630
|
// Only the observed rg -n PATTERN PATH form; marker position proves a real file operand.
|
|
628
631
|
const brace =
|
|
@@ -662,7 +665,7 @@ function materializeLiteralShell(command: string): LiteralShellProof | undefined
|
|
|
662
665
|
new TextEncoder().encode(command.slice(0, start)).byteLength +
|
|
663
666
|
values.reduce((total, value) => total + path.length - members[0].length + value.length + 1, -1);
|
|
664
667
|
if (size > 65_536) return undefined;
|
|
665
|
-
const paths = values.map((member) => path.replace(members[0], member));
|
|
668
|
+
const paths = values.map((member) => path.replace(members[0], () => member));
|
|
666
669
|
return { command: command.slice(0, start) + paths.join(" "), paths };
|
|
667
670
|
}
|
|
668
671
|
|
|
@@ -770,7 +773,7 @@ function normalizeProgramHeredocs(command: string): string {
|
|
|
770
773
|
if (!/-\s*$/.test(heredoc.header)) return command;
|
|
771
774
|
const quoted = "'" + heredoc.body.replaceAll("'", "'\"'\"'") + "'";
|
|
772
775
|
return (
|
|
773
|
-
heredoc.header.replace(/-\s*$/, "-c " + quoted) +
|
|
776
|
+
heredoc.header.replace(/-\s*$/, () => "-c " + quoted) +
|
|
774
777
|
"\n" +
|
|
775
778
|
normalizeProgramHeredocs(heredoc.following)
|
|
776
779
|
);
|
|
@@ -987,7 +990,7 @@ function inlinePackageCommands(command: string, allowInventory: boolean): string
|
|
|
987
990
|
position === 2
|
|
988
991
|
? program.replace(
|
|
989
992
|
/\brequire\s*\(\s*(["'])\.\/\1\s*\+\s*[a-z]\s*\)/,
|
|
990
|
-
`require(${JSON.stringify(path)})`,
|
|
993
|
+
() => `require(${JSON.stringify(path)})`,
|
|
991
994
|
)
|
|
992
995
|
: word;
|
|
993
996
|
return "'" + materialized.replaceAll("'", "'\"'\"'") + "'";
|
|
@@ -1829,7 +1832,7 @@ function hasEnvironmentVariableExpansionRead(
|
|
|
1829
1832
|
if (invalidExpansion) return true;
|
|
1830
1833
|
|
|
1831
1834
|
const localMaterialized = [...localValues].reduce(
|
|
1832
|
-
(text, [marker, value]) => text.replaceAll(marker, value),
|
|
1835
|
+
(text, [marker, value]) => text.replaceAll(marker, () => value),
|
|
1833
1836
|
normalized,
|
|
1834
1837
|
);
|
|
1835
1838
|
// Options must be checked after local literals become actual argv, never as placeholders.
|
|
@@ -1887,7 +1890,7 @@ function hasEnvironmentVariableExpansionRead(
|
|
|
1887
1890
|
}
|
|
1888
1891
|
}
|
|
1889
1892
|
const materialized = [...localValues].reduce(
|
|
1890
|
-
(text, [marker, value]) => text.replaceAll(marker, value),
|
|
1893
|
+
(text, [marker, value]) => text.replaceAll(marker, () => value),
|
|
1891
1894
|
normalized.replaceAll("ENVVALUE", "SAFEENVVALUE"),
|
|
1892
1895
|
);
|
|
1893
1896
|
return hasSensitiveFileRead(materialized, isPathBlocked);
|
|
@@ -2250,7 +2253,7 @@ export function createCredentialGuard(config?: CredentialGuardConfig): Credentia
|
|
|
2250
2253
|
if (error instanceof Error) {
|
|
2251
2254
|
if (sanitized !== message) {
|
|
2252
2255
|
error.message = sanitized;
|
|
2253
|
-
if (error.stack) error.stack = error.stack.replace(message, sanitized);
|
|
2256
|
+
if (error.stack) error.stack = error.stack.replace(message, () => sanitized);
|
|
2254
2257
|
}
|
|
2255
2258
|
throw error;
|
|
2256
2259
|
}
|
package/src/shared/bun.ts
CHANGED