@tangle-network/agent-app 3.0.31 → 3.0.32
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/chat-routes/index.js +1 -1
- package/dist/chat-routes/redact-values.d.ts +2 -1
- package/dist/{chunk-HP5KD7ZI.js → chunk-S4QFJSLR.js} +2 -2
- package/dist/chunk-S4QFJSLR.js.map +1 -0
- package/dist/public-consultation/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-HP5KD7ZI.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type ValueRedactor = <T>(value: T) => T;
|
|
2
|
-
/** A redactor for these values, or undefined when none qualifies
|
|
2
|
+
/** A redactor for these values, or undefined when none qualifies: object keys and string values alike. Longest first, so
|
|
3
|
+
* a value that contains another wins. */
|
|
3
4
|
export declare function valueRedactor(values: readonly string[] | undefined): ValueRedactor | undefined;
|
|
4
5
|
/** Every event of a stream, redacted. A value split across two text deltas is caught where the turn is stored, not live. */
|
|
5
6
|
export declare function redactEvents<T>(source: AsyncIterable<T>, redact: ValueRedactor): AsyncGenerator<T>;
|
|
@@ -143,7 +143,7 @@ function valueRedactor(values) {
|
|
|
143
143
|
const secrets = [...new Set((values ?? []).filter((v) => typeof v === "string" && v.length >= MIN_SECRET_LENGTH))].sort((a, b) => b.length - a.length);
|
|
144
144
|
if (secrets.length === 0) return void 0;
|
|
145
145
|
const text = (s) => secrets.some((v) => s.includes(v)) ? secrets.reduce((acc, v) => acc.split(v).join(REDACTED), s) : s;
|
|
146
|
-
const walk = (v) => typeof v === "string" ? text(v) : Array.isArray(v) ? v.map(walk) : v !== null && typeof v === "object" ? Object.fromEntries(Object.entries(v).map(([k, x]) => [k, walk(x)])) : v;
|
|
146
|
+
const walk = (v) => typeof v === "string" ? text(v) : Array.isArray(v) ? v.map(walk) : v !== null && typeof v === "object" ? Object.fromEntries(Object.entries(v).map(([k, x]) => [text(k), walk(x)])) : v;
|
|
147
147
|
return walk;
|
|
148
148
|
}
|
|
149
149
|
async function* redactEvents(source, redact) {
|
|
@@ -4220,4 +4220,4 @@ export {
|
|
|
4220
4220
|
createChatTurnRoutes,
|
|
4221
4221
|
streamChatRouteAsSandboxEvents
|
|
4222
4222
|
};
|
|
4223
|
-
//# sourceMappingURL=chunk-
|
|
4223
|
+
//# sourceMappingURL=chunk-S4QFJSLR.js.map
|