From 3369f261e15063f1535fa40cdbf9278488b8e40c Mon Sep 17 00:00:00 2001 From: Fengzdadi <453788063@qq.com> Date: Fri, 13 Nov 2026 15:51:45 -0500 Subject: [PATCH] fix(integrations): rebuild the Cindy and DSH pet bundles from current sources Three pull requests merged on 11-13 within four minutes. #2608 added the committed DSH pet bundle. #2516 added the `X-PowerContext-Resolve-Target` header parameter to `check_context` in the generated operation table. #2625 changed `containsSecret` in the DSH plugin's `src/secrets.ts`. The Cindy worker and the DSH pet bundle include those modules, and neither committed bundle was rebuilt for the combination. So `make cindy-test` and `make js-test` fail their freshness checks on master and on every pull request that selects those suites. Only the two bundles are regenerated, with the existing builds. Their credential checks now follow the shared prompt-privacy rule, as their sources have since #2625. The pet does not call `check_context`. --- .../powercontext-hooks/node/worker.cjs | 21 ++++++++++++----- integrations/dsh/plugins/dsh-pet/lib/index.js | 23 +++++++++++++------ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/integrations/cindy/plugins/powercontext-hooks/node/worker.cjs b/integrations/cindy/plugins/powercontext-hooks/node/worker.cjs index 6a0bf6520e..fcd1a89482 100644 --- a/integrations/cindy/plugins/powercontext-hooks/node/worker.cjs +++ b/integrations/cindy/plugins/powercontext-hooks/node/worker.cjs @@ -2172,13 +2172,22 @@ function validatePreparedContext(response, path = "/v1/context/prepare", maxByte //#endregion //#region src/secrets.ts -const SECRET_MARKERS = [ - "sk-", - "api_key", - "BEGIN PRIVATE" +const SECRET_PATTERNS = [ + /-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z0-9 ]*PRIVATE KEY-----|$)/giu, + /(? text.includes(marker)); +/** Return text with recognized credential-shaped values replaced. */ +function scrubSecrets(text, authorization$1) { + const credential = authorization$1?.replace(/^Bearer\s+/iu, ""); + if (credential) text = text.replaceAll(credential, "[REDACTED]"); + return SECRET_PATTERNS.reduce((scrubbed, pattern) => scrubbed.replace(pattern, "[REDACTED]"), text); +} +/** Detect secrets without rejecting ordinary words that merely contain a marker. */ +function containsSecret(text, authorization$1) { + return scrubSecrets(text, authorization$1) !== text; } //#endregion diff --git a/integrations/dsh/plugins/dsh-pet/lib/index.js b/integrations/dsh/plugins/dsh-pet/lib/index.js index cab5aeaf49..deb8f4c305 100644 --- a/integrations/dsh/plugins/dsh-pet/lib/index.js +++ b/integrations/dsh/plugins/dsh-pet/lib/index.js @@ -580,7 +580,7 @@ const OPERATIONS = { scopeMode: "current", pathParameters: [], queryParams: [], - headerParams: [], + headerParams: ["X-PowerContext-Resolve-Target"], successStatuses: [200], emptyStatuses: [] }, @@ -2174,13 +2174,22 @@ function boundedRecallQuery(prompt) { //#endregion //#region src/secrets.ts -const SECRET_MARKERS = [ - "sk-", - "api_key", - "BEGIN PRIVATE" +const SECRET_PATTERNS = [ + /-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z0-9 ]*PRIVATE KEY-----|$)/giu, + /(? text.includes(marker)); +/** Return text with recognized credential-shaped values replaced. */ +function scrubSecrets(text, authorization) { + const credential = authorization?.replace(/^Bearer\s+/iu, ""); + if (credential) text = text.replaceAll(credential, "[REDACTED]"); + return SECRET_PATTERNS.reduce((scrubbed, pattern) => scrubbed.replace(pattern, "[REDACTED]"), text); +} +/** Detect secrets without rejecting ordinary words that merely contain a marker. */ +function containsSecret(text, authorization) { + return scrubSecrets(text, authorization) !== text; } //#endregion