dsh-privacy-gateway 0.2.1 → 0.3.0

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/README.en.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [简体中文](README.md) | English
4
4
 
5
- ![The model only sees {{placeholder}}: secrets, credentials and personal data go out as placeholders and can come back as real values (off by default) — one interception point, every model request through the global fetch goes through it](docs/assets/screenshots/0-banner-en.png)
5
+ ![The model only sees ⟦DSH_REDACTED:…⟧: secrets, credentials and personal data go out as placeholders and can come back as real values (off by default) — one interception point, every model request through the global fetch goes through it](docs/assets/screenshots/0-banner-en.png)
6
6
 
7
7
  A redaction gateway on the host process's undici global dispatcher. Secrets in outgoing model request bodies are replaced with placeholders; by default the placeholders in the replies go into the session log as they are, so no plaintext reaches it, and `restoreLog` puts them back with the real values on request. Adapters and providers don't notice it; by default the agent gets placeholders, and with `restoreLog` on it gets the real values as before. One interception point covers every provider that goes through `fetch()`, including adapters that plugins provide.
8
8
 
@@ -15,7 +15,7 @@ If you are using an **API relay**, or you are working with **sensitive informati
15
15
  dsh plugin --profile web add dsh-privacy-gateway@latest
16
16
 
17
17
  # The same version as a GitHub Release asset (prereleases get one too)
18
- dsh plugin --profile web add https://github.com/xbzbing/dsh-privacy-gateway/releases/download/v0.2.1/dsh-privacy-gateway-0.2.1.tgz
18
+ dsh plugin --profile web add https://github.com/xbzbing/dsh-privacy-gateway/releases/download/v0.3.0/dsh-privacy-gateway-0.3.0.tgz
19
19
  ```
20
20
 
21
21
  A prerelease version has a `-` in it and goes to GitHub Releases only, never to npm. The repository does not commit `lib/`, so `dsh plugin add github:…` cannot load the plugin ([ADR-0006](docs/adr/0006-distribution-and-build-artifacts.md)).
@@ -79,7 +79,7 @@ someone@gmail.com → EMAIL
79
79
  11010519491231002X → ID_CARD
80
80
  ```
81
81
 
82
- - The Chinese wordings 「密码:…」 and 「密钥是 …」, and a password in a URL, are recorded as `{{PASSWORD_p7gqwtns}}`, apart from `SECRET`.
82
+ - The Chinese wordings 「密码:…」 and 「密钥是 …」, and a password in a URL, are recorded as `⟦DSH_REDACTED:PASSWORD_p7gqwtns⟧`, apart from `SECRET`.
83
83
  - `EMAIL`, `PHONE`, `ID_CARD` and `BANK_CARD` are off until 「脱敏个人信息」 is on.
84
84
  - A word in 「自定义敏感词」 is replaced where it appears and recorded as `TERM`; a value in 「永不脱敏的值」 or `allow` goes out as it is.
85
85
  - A private key goes whole: `-----BEGIN` to `-----END`, or a truncated one with only the opening lines and base64.
@@ -114,7 +114,7 @@ The everyday settings can be changed on the Configure page of this plugin's row
114
114
  | `maskKeys` | `true` | A **JSON key** that reads like a secret or personal data goes as a placeholder too (`{"sk-…": …}`). The protocol's own keys (`model`, `role`, `type`, `name`, `id` and so on), the tool definitions and a tool call's argument names are never touched, or the vendor could not read the request. When off, such keys go as they are ([ADR-0029](docs/adr/0029-mask-json-keys.md)) |
115
115
  | `toolGuard` | `off` | When a tool call's arguments would have a value restored and name a host off this machine: `off` only counts it, `warn` logs and records it, `block` leaves the placeholders in that call's arguments, so the tool gets the placeholder. A reply holds a restored value only with `restoreLog` on; with it off this guard never runs ([ADR-0014](docs/adr/0014-tool-guard.md)) |
116
116
  | `restoreLog` | `false` | Whether a reply's placeholders are put back before the session log is written. Off (the default): the placeholders go into the log as they are, no plaintext reaches it, and the agent sees placeholders too; on, the log and the agent both hold the real values, and session sync, backups, shares and exports carry them too ([ADR-0003](docs/adr/0003-restore-before-session-log.md)) |
117
- | `shape` | `false` | Send a key as a made-up key of its own form (same prefix, length and kinds of character) instead of a `{{…}}` placeholder; a value under 8 characters, or holding anything but letters, digits, `-`, `_` and `.`, keeps the placeholder; with `restoreLog` on, replies put it back the same way ([ADR-0015](docs/adr/0015-shape.md)) |
117
+ | `shape` | `false` | Send a key as a made-up key of its own form (same prefix, length and kinds of character) instead of a `⟦DSH_REDACTED:…⟧` placeholder; a value under 8 characters, or holding anything but letters, digits, `-`, `_` and `.`, keeps the placeholder; with `restoreLog` on, replies put it back the same way ([ADR-0015](docs/adr/0015-shape.md)) |
118
118
  | `cookieNames` | `[]` | More cookie names to mask |
119
119
  | `cookieKeep` | `['lang', 'locale', 'theme', 'tz']` | Cookie names never masked |
120
120
  | `protectEnvBlock` | `true` | Send `<env>` … `</env>` blocks as written, for providers that check them; only in text the host writes (the system prompt, `system`, `instructions`, `systemInstruction`), never in a user message or a tool result ([ADR-0004](docs/adr/0004-protected-regions.md) supplement) |
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.en.md) | 简体中文
4
4
 
5
- ![模型只看见 {{占位符}}:密钥、凭据、个人信息发出前换成占位符,回复里的占位符可换回原值(默认不换),一处拦截,每个走全局 fetch 的模型请求都经过它](docs/assets/screenshots/0-banner.png)
5
+ ![模型只看见 ⟦DSH_REDACTED:…⟧:密钥、凭据、个人信息发出前换成占位符,回复里的占位符可换回原值(默认不换),一处拦截,每个走全局 fetch 的模型请求都经过它](docs/assets/screenshots/0-banner.png)
6
6
 
7
7
  在宿主进程的 undici 全局 dispatcher 上装一层脱敏网关。出站把模型请求体里的密钥换成占位符;入站默认让回流里的占位符原样进会话日志,明文不进日志,打开 `restoreLog` 才换回真值。对 adapter、provider 无感;agent 在默认关闭时拿到的是占位符,打开 `restoreLog` 后与以前一样拿到真值。一处拦截覆盖所有走 `fetch()` 的 provider,包括插件提供的 adapter。
8
8
 
@@ -15,7 +15,7 @@
15
15
  dsh plugin --profile web add dsh-privacy-gateway@latest
16
16
 
17
17
  # 同一版本的 GitHub Release 附件(预发布也发在这里)
18
- dsh plugin --profile web add https://github.com/xbzbing/dsh-privacy-gateway/releases/download/v0.2.1/dsh-privacy-gateway-0.2.1.tgz
18
+ dsh plugin --profile web add https://github.com/xbzbing/dsh-privacy-gateway/releases/download/v0.3.0/dsh-privacy-gateway-0.3.0.tgz
19
19
  ```
20
20
 
21
21
  预发布版本号带 `-`,只发 GitHub Release、不发 npm。仓库不提交 `lib/`,`dsh plugin add github:…` 拿到的树加载不了([ADR-0006](docs/adr/0006-distribution-and-build-artifacts.md))。
@@ -79,7 +79,7 @@ someone@gmail.com → EMAIL
79
79
  11010519491231002X → ID_CARD
80
80
  ```
81
81
 
82
- - 中文写法「密码:…」「密钥是 …」和 URL 里的密码记为 `{{PASSWORD_p7gqwtns}}`,和 `SECRET` 分开记。
82
+ - 中文写法「密码:…」「密钥是 …」和 URL 里的密码记为 `⟦DSH_REDACTED:PASSWORD_p7gqwtns⟧`,和 `SECRET` 分开记。
83
83
  - `EMAIL`、`PHONE`、`ID_CARD`、`BANK_CARD` 默认不换,打开「脱敏个人信息」才生效。
84
84
  - 「自定义敏感词」里的词按词替换,记为 `TERM`;「永不脱敏的值」和 `allow` 里的原样发出。
85
85
  - 私钥整段一起换:`-----BEGIN` 到 `-----END`,或只有开头一段 base64 的截断私钥。
@@ -112,7 +112,7 @@ someone@gmail.com → EMAIL
112
112
  | `maskKeys` | `true` | 读起来像密钥或个人信息的 **JSON 键名**也换成占位符(`{"sk-…": …}`);协议自身的键(`model`、`role`、`type`、`name`、`id` 等)、工具定义和工具调用的参数名永不动,否则供应商读不懂请求。关闭后这类键名原样发出([ADR-0029](docs/adr/0029-mask-json-keys.md)) |
113
113
  | `toolGuard` | `off` | 工具调用参数里还原出值、又指向本机以外的 host 时怎么办:`off` 只计数,`warn` 告警并记一条,`block` 这次调用的参数里不还原,工具拿到占位符。只有 `restoreLog` 打开时回复里才会有还原值,关闭时这一项不会生效([ADR-0014](docs/adr/0014-tool-guard.md)) |
114
114
  | `restoreLog` | `false` | 回复里的占位符在写入会话日志前是否换回真值。默认关闭:占位符原样进日志,明文不进日志,agent 拿到的也是占位符;打开后日志与 agent 都拿到真值,会话同步、备份、分享、导出带走的也是真值([ADR-0003](docs/adr/0003-restore-before-session-log.md)) |
115
- | `shape` | `false` | 密钥换成同形的假 key(前缀、长度、字符类别不变),而不是 `{{…}}` 占位符;不足 8 个字符、或含字母数字与 `-` `_` `.` 以外字符的值仍用占位符;`restoreLog` 打开时回复里照样还原([ADR-0015](docs/adr/0015-shape.md)) |
115
+ | `shape` | `false` | 密钥换成同形的假 key(前缀、长度、字符类别不变),而不是 `⟦DSH_REDACTED:…⟧` 占位符;不足 8 个字符、或含字母数字与 `-` `_` `.` 以外字符的值仍用占位符;`restoreLog` 打开时回复里照样还原([ADR-0015](docs/adr/0015-shape.md)) |
116
116
  | `cookieNames` | `[]` | 追加要脱敏的 cookie 名 |
117
117
  | `cookieKeep` | `['lang', 'locale', 'theme', 'tz']` | 永不脱敏的 cookie 名 |
118
118
  | `protectEnvBlock` | `true` | `<env>` … `</env>` 块原样发出,供会校验它的 provider 使用;只保护宿主生成的文本(系统提示词、`system`、`instructions`、`systemInstruction`),用户消息和工具结果里的 `<env>` 不算([ADR-0004](docs/adr/0004-protected-regions.md) 补充) |
package/lib/client.js CHANGED
@@ -1,7 +1,7 @@
1
1
  window.__ModuleLoader__.load({ id: "dsh-privacy-gateway", factory: (require) => {
2
2
  var module = { exports: {} }; var exports = module.exports;
3
3
  "use strict";var be=require("react");var ye=require("@deepseek-ai/dsh-client-ui-primitives"),g=require("react");var L=require("@deepseek-ai/dsh-client-ui-primitives"),w=require("react");var ie=["mask","lists","record","view"],le=[{key:"enabled",group:"mask",kind:"switch",default:!0,risk:"send"},{key:"secrets",group:"mask",kind:"switch",default:!0,half:!0,risk:"send"},{key:"personal",group:"mask",kind:"switch",default:!1,half:!0,risk:"send"},{key:"shape",group:"mask",kind:"switch",default:!1,half:!0},{key:"toolGuard",group:"mask",kind:"choice",choices:["off","warn","block"],default:"off",half:!0},{key:"restoreLog",group:"mask",kind:"switch",default:!1,risk:"log",riskWhen:"on"},{key:"maskKeys",group:"mask",kind:"switch",default:!0,risk:"send"},{key:"words",group:"lists",kind:"list",default:[],anyCase:!1,half:!0,risk:"send",risky:"remove"},{key:"allow",group:"lists",kind:"list",default:[],anyCase:!0,half:!0,risk:"send",risky:"add"},{key:"record",group:"record",kind:"switch",default:!0,half:!0,risk:"delete"},{key:"keepDays",group:"record",kind:"count",min:1,default:30,half:!0,risk:"delete"},{key:"recordContext",group:"record",kind:"switch",default:!0},{key:"vendorView",group:"record",kind:"switch",default:!1,risk:"delete"},{key:"showPanel",group:"view",kind:"switch",default:!1},{key:"excludeProviders",group:"view",kind:"providers",default:[],risk:"send"}];function Ke(e,t,n){if(e.risk)switch(e.kind){case"switch":{let a=ae(t,e.default),r=ae(n,e.default);return(e.riskWhen==="on"?!a&&r:a&&!r)?{risk:e.risk}:void 0}case"list":case"providers":{let a=e.kind==="providers"||e.anyCase,r=u=>a?u.trim().toLowerCase():u.trim(),s=(u,h)=>{let _=new Set(u.map(r));return h.filter(k=>!_.has(r(k)))},i=W(t,e.default),l=W(n,e.default);if(e.kind==="list"&&e.risky==="remove"){let u=s(l,i);return u.length>0?{risk:e.risk,removed:u}:void 0}let d=s(i,l);return d.length>0?{risk:e.risk,added:d}:void 0}case"count":{let a=re(t,e.min,e.default),r=re(n,e.min,e.default);return r<a?{risk:e.risk,from:a,to:r}:void 0}case"choice":return}}function De(e){return e.kind==="switch"||e.kind==="choice"||e.kind==="count"}function Z(e,t){let n=le.find(a=>a.key===e&&a.kind===t);if(!n)throw new Error(`no ${t} field ${e}`);return n}function Ve(e,t){let n=a=>ae(t[a],Z(a,"switch").default);switch(e){case"mask":{if(!n("enabled"))return[{key:"cfg.s.maskOff",off:!0}];let a=["secrets","personal"].filter(n),r=a.length===0?[{key:n("maskKeys")?"cfg.s.maskKeysOnly":"cfg.s.maskNothing",off:!0}]:a.map(i=>({key:`cfg.s.${i}`}));n("shape")&&r.push({key:"cfg.s.shape"});let s=Z("toolGuard","choice");return r.push({key:`cfg.s.toolGuard.${_e(t.toolGuard,s.choices,s.default)}`}),n("restoreLog")&&r.push({key:"cfg.s.restoreLog"}),r}case"lists":return[{key:"cfg.s.words",params:{n:W(t.words,Z("words","list").default).length}},{key:"cfg.s.allow",params:{n:W(t.allow,Z("allow","list").default).length}}];case"record":{let a=Z("keepDays","count"),r=n("record")?[{key:"cfg.s.record",params:{n:re(t.keepDays,a.min,a.default)}}]:[{key:"cfg.s.recordOff",off:!0}];return n("vendorView")&&r.push({key:"cfg.s.vendorView"}),r}case"view":{let a=W(t.excludeProviders,Z("excludeProviders","providers").default).length;return[n("showPanel")?{key:"cfg.s.panel"}:{key:"cfg.s.panelOff",off:!0},a===0?{key:"cfg.s.providersAll"}:{key:"cfg.s.providersSome",params:{n:a}}]}}}function ae(e,t){return typeof e=="boolean"?e:t}function _e(e,t,n){return typeof e=="string"&&t.includes(e)?e:n}function W(e,t){return Array.isArray(e)?e.filter(n=>typeof n=="string"):[...t]}function re(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t?Math.floor(e):n}function $e(e,t,n){let a=t.trim();if(a==="")return;let r=n?s=>s.trim().toLowerCase()===a.toLowerCase():s=>s.trim()===a;return e.some(r)?void 0:[...e,a]}function ze(e,t){return e.filter(n=>n!==t)}function Be(e,t){let n=e.trim();if(!/^\d+$/.test(n))return;let a=Number(n);return Number.isSafeInteger(a)&&a>=t?a:void 0}function He(e,t){return e.length===0?{kind:"none"}:e.length<=2?{kind:"some",names:e.join(t)}:{kind:"many",names:e.slice(0,2).join(t),n:e.length}}function Ge(e){let t=["pgw-cfg__row",e.inline?"pgw-cfg__row--inline":"",e.half?"pgw-cfg__row--half":""].filter(Boolean).join(" ");return(0,w.createElement)("div",{className:t},(0,w.createElement)("div",{className:"pgw-cfg__text"},(0,w.createElement)("div",{className:"pgw-cfg__name",id:e.titleId},e.title),(0,w.createElement)("div",{className:"pgw-cfg__desc"},e.hint),e.note??null),(0,w.createElement)("div",{className:"pgw-cfg__control"},e.children))}function We(e){let t=(0,w.useId)();return(0,w.createElement)("section",{className:"pgw-fold","data-open":e.open||void 0},(0,w.createElement)("h4",{className:"pgw-fold__heading"},(0,w.createElement)("button",{type:"button",id:`${t}-h`,className:"pgw-fold__head","aria-expanded":e.open,"aria-controls":e.open?`${t}-b`:void 0,title:e.toggleLabel,onClick:e.onToggle},(0,w.createElement)(L.IconChevronDownOutlineRegular,{className:"pgw-fold__chevron"}),(0,w.createElement)("span",{className:"pgw-fold__title"},e.title),e.open?null:(0,w.createElement)("span",{className:"pgw-fold__summary"},e.summary))),e.open?(0,w.createElement)("div",{id:`${t}-b`,role:"region","aria-labelledby":`${t}-h`,className:"pgw-fold__body"},(0,w.createElement)("div",{className:"pgw-fold__grid"},e.children)):null)}function je(e){return(0,w.createElement)(L.Switch,{checked:e.checked,label:e.label,disabled:e.disabled,onChange:e.onChange})}function Ne(e){let[t,n]=(0,w.useState)(!1),a=(0,w.useId)();return(0,w.useEffect)(()=>{e.disabled&&n(!1)},[e.disabled]),(0,w.createElement)(L.Menu,{open:t,onClose:()=>n(!1),items:e.items,...e.multi?{selectedIds:e.selectedIds??[],selection:"check"}:{selectedId:e.selectedId},onSelect:r=>{e.multi||n(!1),e.onSelect(r)},align:"start",portal:!0,anchor:(0,w.createElement)("button",{type:"button",className:"pgw-select","aria-haspopup":"menu","aria-expanded":t,"aria-labelledby":e.labelledBy?`${e.labelledBy} ${a}`:void 0,disabled:e.disabled||e.items.length===0,onClick:()=>n(r=>!r)},(0,w.createElement)("span",{className:"pgw-select__label",id:a},e.label),(0,w.createElement)(L.IconChevronDownOutlineRegular,{className:"pgw-select__chevron"}))})}function qe(e){let{t}=e,[n,a]=(0,w.useState)(""),[r,s]=(0,w.useState)(!1),i=$e(e.list,n,e.anyCase),l=()=>{if(!i||e.disabled||r)return;let d=n;s(!0),e.onChange(i).then(u=>{s(!1),u&&a(h=>h===d?"":h)})};return(0,w.createElement)("div",{className:"pgw-cfg__list"},(0,w.createElement)("div",{className:"pgw-cfg__add"},(0,w.createElement)(L.Input,{className:"pgw-cfg__input",type:"text",value:n,placeholder:e.placeholder,"aria-label":e.label,disabled:e.disabled,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),l())}}),(0,w.createElement)(L.Button,{variant:"outline",size:"sm",disabled:e.disabled||r||!i,onClick:l},t("cfg.add"))),e.list.length===0?(0,w.createElement)("div",{className:"pgw-cfg__desc"},t("cfg.listEmpty")):(0,w.createElement)("div",{className:"pgw-cfg__tags"},e.list.map(d=>(0,w.createElement)(L.Tag,{key:d,tone:"neutral",className:"pgw-cfg__tag",title:d},(0,w.createElement)("span",{className:"pgw-cfg__tagText"},d),(0,w.createElement)("button",{type:"button",className:"pgw-cfg__tagX","aria-label":t("cfg.remove",{name:d}),disabled:e.disabled,onClick:()=>{e.onChange(ze(e.list,d))}},(0,w.createElement)(L.IconCloseOutlineRegular,{size:12}))))))}function Ye(e){let[t,n]=(0,w.useState)(String(e.value)),a=(0,w.useRef)(void 0);(0,w.useEffect)(()=>n(String(e.value)),[e.value]);let r=Be(t,e.min),s=()=>{r===void 0||r===e.value||r===a.current||(a.current=r,e.onChange(r).then(()=>{a.current=void 0}))};return(0,w.createElement)("div",{className:"pgw-cfg__list"},(0,w.createElement)(L.Input,{className:"pgw-cfg__input pgw-cfg__input--count",type:"number",inputMode:"numeric",min:e.min,step:1,value:t,"aria-label":e.label,"aria-invalid":r===void 0,disabled:e.disabled,onChange:i=>n(i.target.value),onBlur:s,onKeyDown:i=>{i.key==="Enter"&&s()}}),r===void 0?(0,w.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error",role:"alert"},e.t("cfg.countInvalid",{min:e.min})):null)}function Je(e,t=6,n="\u2026"){let a=Object.entries(e).filter(([,l])=>l>0).sort((l,d)=>d[1]-l[1]||(l[0]<d[0]?-1:1)),r=a.slice(0,t),s=a.slice(t).reduce((l,[,d])=>l+d,0);s>0&&r.push([n,s]);let i=r.reduce((l,[,d])=>Math.max(l,d),0);return r.map(([l,d])=>({label:l,value:d,pct:i>0?Math.max(2,Math.round(d/i*100)):0}))}var qt={SECRET:"hint.kind.SECRET",PASSWORD:"hint.kind.PASSWORD",API_KEY:"hint.kind.API_KEY",TOKEN:"hint.kind.TOKEN",PRIVATE_KEY:"hint.kind.PRIVATE_KEY",COOKIE:"hint.kind.COOKIE",EMAIL:"hint.kind.EMAIL",PHONE:"hint.kind.PHONE",ID_CARD:"hint.kind.ID_CARD",BANK_CARD:"hint.kind.BANK_CARD",TERM:"hint.kind.TERM"},Yt={rule:"hint.finder.rule",word:"hint.finder.word",known:"hint.finder.known",cookie:"hint.finder.cookie"};function Ue(e){return qt[e]}function Qe(e){return Yt[e]}function Xe(e,t){return e.filter(n=>(t.kind===void 0||n.kind===t.kind)&&(t.finder===void 0||n.finder===t.finder))}function Se(e,t){return[...new Set(e.map(n=>n[t]).filter(n=>n!==""))].sort()}function Ze(e,t){let n=[];return e.stats.failStreak>0&&n.push({key:"warn.streak",n:e.stats.failStreak,tone:"error"}),t.unmapped>0&&n.push({key:"warn.unmapped",n:t.unmapped,tone:"warn"}),(t.exfil??0)>0?n.push({key:"warn.exfil",n:t.exfil,tone:"error"}):t.restoredInTools>0&&n.push({key:"warn.inTools",n:t.restoredInTools,tone:"warn"}),n}function et(e){let t=n=>Math.round(n*100)/100;return{avg:e.requests>0?t(e.tookMs.sum/e.requests):0,max:t(e.tookMs.max)}}function Te(e,t=new Date){let n=new Date(e);if(Number.isNaN(n.getTime()))return"";let a=s=>String(s).padStart(2,"0");return n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate()?`${a(n.getHours())}:${a(n.getMinutes())}:${a(n.getSeconds())}`:`${a(n.getMonth()+1)}-${a(n.getDate())} ${a(n.getHours())}:${a(n.getMinutes())}`}var q=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),R=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function de(e){let t={};if(q(e))for(let[n,a]of Object.entries(e))typeof a=="number"&&Number.isFinite(a)&&(t[n]=a);return t}function Ce(e){if(!q(e))return;let t=q(e.tookMs)?e.tookMs:{};return{requests:R(e.requests),masked:R(e.masked),n:R(e.n),restored:R(e.restored),restoredInTools:R(e.restoredInTools),unmapped:R(e.unmapped),failed:R(e.failed),warned:R(e.warned),blocked:R(e.blocked),exfil:R(e.exfil),exfilBlocked:R(e.exfilBlocked),tookMs:{sum:R(t.sum),max:R(t.max)},kinds:de(e.kinds),finders:de(e.finders),hosts:de(e.hosts),models:de(e.models)}}function Jt(e){return q(e)&&typeof e.key=="number"&&typeof e.time=="string"&&Array.isArray(e.values)&&e.values.every(q)}function tt(e){if(!(!q(e)||typeof e.path!="string"||e.path===""))return{path:e.path,...typeof e.role=="string"?{role:e.role}:{},...typeof e.type=="string"?{type:e.type}:{}}}function Ut(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let a of e){let r=tt(a);r===void 0||n.has(r.path)||(n.add(r.path),t.push(r))}return t}var Qt=7,Re=e=>Math.max(0,Math.floor(R(e)));function Xt(e){if(typeof e.placeholder!="string"||e.placeholder==="")return;let t=h=>typeof h=="string"?h:void 0,n=t(e.tail),a=t(e.before),r=t(e.after),s=tt(e.at),i=ce(e.first??{}),l=Ut(e.elsewhere),d=l.slice(0,Qt),u=Re(e.elsewhereOmitted)+l.length-d.length;return{placeholder:e.placeholder,kind:t(e.kind)??"",finder:t(e.finder)??"",head:t(e.head)??"",...n!==void 0?{tail:n}:{},len:Re(e.len),n:Re(e.n),...e.action==="warn"||e.action==="block"?{action:e.action}:{},...a!==void 0?{before:a}:{},...r!==void 0?{after:r}:{},...s?{at:s}:{},...i?{first:i}:{},...d.length>0?{elsewhere:d}:{},...u>0?{elsewhereOmitted:u}:{}}}function ce(e){let t=e.turn,n=e.step;if(!(typeof t!="number"||typeof n!="number")&&!(!Number.isSafeInteger(t)||!Number.isSafeInteger(n)||t<1||n<1))return{turn:t,step:n}}function nt(e){return`${e.turn}\xB7${e.step}`}function Zt(e){let{valuesOmitted:t,turn:n,step:a,model:r,host:s,what:i,tookMs:l,title:d,workspace:u,session:h,exfil:_,exfilHosts:k,restoredInTools:y,warned:m,failed:A,blocked:E,relay:V,...$}=e,D=K=>typeof K=="string"?K:void 0,f=R(t),F=ce({turn:n,step:a}),B=D(r),I=D(d),H=D(u),N=D(h),X=R(_),se=R(y),z=R(m),te=Array.isArray(k)?k.filter(K=>typeof K=="string"):void 0;return{...$,host:D(s)??"",what:i==="chat"||i==="embeddings"||i==="count"||i==="search"?i:"chat",tookMs:R(l),n:R(e.n),restored:R(e.restored),unmapped:R(e.unmapped),values:e.values.map(Xt).filter(K=>K!==void 0),...B!==void 0?{model:B}:{},...I!==void 0?{title:I}:{},...H!==void 0?{workspace:H}:{},...N!==void 0?{session:N}:{},...X>0?{exfil:X}:{},...te!==void 0&&te.length>0?{exfilHosts:te}:{},...se>0?{restoredInTools:se}:{},...z>0?{warned:z}:{},...A===!0?{failed:!0}:{},...E===!0?{blocked:!0}:{},...V===!0?{relay:!0}:{},...f>0?{valuesOmitted:f}:{},...F??{}}}function at(e){if(!q(e)||typeof e.active!="boolean"||!q(e.stats)||!Array.isArray(e.recent))return;let t=Ce(e.stats.today),n=Ce(e.stats.week),a=Ce(e.stats.month);if(!t||!n||!a)return;let{restoreLog:r,...s}=e;return{...s,...typeof r=="boolean"?{restoreLog:r}:{},values:R(e.values),stats:{today:t,week:n,month:a,failStreak:R(e.stats.failStreak)},recent:e.recent.filter(Jt).map(Zt),...Array.isArray(e.views)?{views:e.views.filter(i=>typeof i=="number")}:{}}}function rt(e,t){return t.ok?{status:"ready",data:t.value}:e.status==="ready"?{status:"ready",data:e.data,stale:t.failure}:{status:"error",failure:t.failure}}function ot(e){return e.n===0&&e.failed!==!0&&(e.unmapped??0)===0}var en=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function st(e){let t=e;try{t=JSON.stringify(JSON.parse(e),null,2)}catch{}return t.split(`
4
- `)}function it(e){return e.map(t=>t.placeholder).join("\0")}function lt(e,t,n,a=400){let r=[...new Set(t.filter(d=>d!==""))].sort((d,u)=>u.length-d.length),s=r.length>0?new RegExp(r.map(en).join("|"),"g"):void 0,i=[],l=!1;for(let d=0;d<e.length;d++){let u=e[d],h=[],_=0;if(s)for(let k of u.matchAll(s))k.index>_&&h.push({text:u.slice(_,k.index)}),h.push({text:k[0],id:k[0]}),_=k.index+k[0].length;if(!(n&&_===0)){if((_<u.length||h.length===0)&&h.push({text:u.slice(_)}),i.length>=a){l=!0;break}i.push({n:d+1,parts:h})}}return{lines:i,truncated:l}}function dt(e,t,n){let a=Math.max(1,Math.ceil(e.length/n)),r=Math.min(Math.max(0,Math.floor(t)),a-1);return{items:e.slice(r*n,r*n+n),page:r,pages:a}}function ct(e){let{path:t,role:n,type:a}=e,r=t.split(".")[0]??"";return n==="system"||n==="developer"||r==="system"||r==="instructions"||r==="systemInstruction"?"place.system":n==="tool"||a==="tool_result"||a==="function_call_output"||a==="functionResponse"?"place.toolResult":a==="tool_use"||a==="function_call"||/(^|\.)(tool_calls|function_call)(\.|$)/.test(t)||t.endsWith(".arguments")?"place.toolCall":n==="user"?"place.user":n==="assistant"||n==="model"?"place.assistant":"place.other"}function Oe(e){let t=e.split("."),n=t[0]??"",a=t[1]??"";return n!==""&&/^\d+$/.test(a)?`${n}.${a}`:n}function pt(e,t){let n=[...new Set((e.elsewhere??[]).map(r=>Oe(r.path)))].filter(r=>r!=="").join(t("recent.placeSep")),a=e.elsewhereOmitted??0;return n===""?a>0?t("recent.elsewhereOmitted",{n:a}):"":a>0?t("recent.elsewhereMore",{paths:n,n:a}):t("recent.elsewhere",{paths:n})}function pe(e){return e.head?e.tail?`${e.head}\u2026${e.tail}`:`${e.head}\u2026`:""}function Y(e,t){return t({noConnection:"err.noConnection",malformed:"err.malformed",remote:"err.remote",thrown:"err.thrown"}[e.code],"message"in e?{message:e.message}:void 0)}async function oe(e,t,n,a,r){let s;try{s=e.get("connection")?.rpc}catch{s=void 0}if(!s||typeof s.call!="function")return{ok:!1,failure:{code:"noConnection"}};try{let i=n===void 0?{}:{request:n},l=await s.call("/api",`privacyGateway/${t}`,{args:i},r);if(l?.ok!==!0){let u=l?.error?.message;return{ok:!1,failure:typeof u=="string"&&u!==""?{code:"remote",message:u}:{code:"malformed"}}}let d=a(l.value);return d===void 0?{ok:!1,failure:{code:"malformed"}}:{ok:!0,value:d}}catch(i){return{ok:!1,failure:{code:"thrown",message:i instanceof Error?i.message:String(i)}}}}function ue(e,t,n,a){return oe(e,"overview",a?{limit:t,session:a}:{limit:t},at,n)}function ut(e,t,n){return oe(e,"vendorView",{key:t},a=>{if(a===null)return null;let r=a?.body;return typeof r=="string"?r:void 0},n)}function ft(e){return oe(e,"reset",void 0,t=>{let n=t?.files;return typeof n=="number"?n:0})}function gt(e,t,n){return oe(e,"sessionMasking",{session:t,on:n},a=>{let r=a?.on;return typeof r=="boolean"?r:void 0})}function mt(e,t){return oe(e,"providers",void 0,n=>Array.isArray(n)?n.flatMap(tn):void 0,t)}function tn(e){let t=e;return t!==null&&typeof t=="object"&&typeof t.id=="string"&&t.id!==""?[{id:t.id,name:typeof t.name=="string"&&t.name!==""?t.name:t.id}]:[]}function fe(e){let t=e,n=new Set;return{get:()=>t,set(a){if(!Object.is(a,t)){t=a;for(let r of[...n])try{r()}catch{}}},subscribe(a){return n.add(a),()=>{n.delete(a)}}}}var nn="Show the Privacy tab at the top of the session";function an(e){let t=e,n=t?.refs,r=(n!==null&&typeof n=="object"&&typeof t?.uid<"u"?n[String(t.uid)]:void 0)?.dict??t?.dict;return r!==null&&typeof r=="object"?Object.keys(r):[]}function Ae(e){for(let t of e){let n=an(t.schema);if(n.includes("showPanel")&&(t.ns.includes("privacy-gateway")||n.includes("excludeProviders")||JSON.stringify(t.schema??null).includes(nn)))return t.ns}}function rn(e){let t=Ae(e);if(t===void 0)return;let n=e.find(a=>a.ns===t)?.value;return typeof n=="object"&&n!==null&&n.showPanel===!0}function on(e){let t=e;return t!=null&&typeof t.describe=="function"&&typeof t.get=="function"?t:void 0}var Q=fe(void 0);function ht(e){let t=n=>n.effect(()=>{let a;try{a=on(n.get("configForms"))}catch{a=void 0}return Q.set(a),()=>{Q.get()===a&&Q.set(void 0)}},"dsh-privacy-gateway: settings service");typeof e.inject=="function"?e.inject(["configForms"],t):t(e)}var sn=6e4;function ln(e,t){return t===void 0?e:t||e===!0?!0:e===!1?!1:void 0}function wt(e,t,n=Q){let a=!1,r,s,i,l=()=>{if(a)return;let y=ln(s,i);y===void 0||y===r||(r=y,t(y))},d=()=>{ue(e,1).then(y=>{a||!y.ok||(s=y.value.showPanel===!0,l())})},u,h=y=>{try{u?.()}catch{}u=void 0,i=void 0;let m;try{m=y?.describe()}catch{m=void 0}if(m){let A=m,E=()=>{if(a)return;let V=A.getSnapshot().view;if(!V)return;let $=rn(V.namespaces);$!==void 0&&(i=$,l())};u=A.subscribe(E),Promise.resolve(A.ensure()).then(E,E),E()}l()},_=n.subscribe(()=>h(n.get()));h(n.get()),d();let k=setInterval(d,sn);return()=>{a=!0,clearInterval(k),_();try{u?.()}catch{}}}function yt(e,t){let n=r=>t.some(s=>s.toLowerCase()===r.toLowerCase()),a=e.map(r=>({id:r.id,name:r.name,excluded:n(r.id),registered:!0}));for(let r of t)a.some(s=>s.id.toLowerCase()===r.toLowerCase())||a.push({id:r,name:r,excluded:!0,registered:!1});return a}function kt(e,t){let n=t.toLowerCase();return e.some(a=>a.toLowerCase()===n)?e.filter(a=>a.toLowerCase()!==n):[...e,t]}var Mt=require("react");var bt={"card.title":"\u8131\u654F\u7EDF\u8BA1","card.on":"\u8131\u654F\u5F00\u542F","card.off":"\u8131\u654F\u5DF2\u5173\u95ED","card.refresh":"\u5237\u65B0","card.loading":"\u6B63\u5728\u8BFB\u53D6\u2026","card.unavailable":"\u8BFB\u4E0D\u5230\u7EDF\u8BA1\uFF1A\u63D2\u4EF6\u7684 host \u7AEF\u6CA1\u6709\u8FD0\u884C\uFF0C\u6216\u9700\u8981\u91CD\u542F dsh\u3002","card.memoryOnly":"\u8BB0\u5F55\u53EA\u5728\u5185\u5B58\uFF08record \u5DF2\u5173\u95ED\uFF09","card.values":"\u5185\u5B58\u91CC\u53EF\u8FD8\u539F\u7684\u503C {n} \u4E2A","card.range":"\u7EDF\u8BA1\u8303\u56F4","card.reset":"\u6E05\u7A7A\u6570\u636E","card.resetTitle":"\u6E05\u7A7A\u9690\u79C1\u4FDD\u62A4\u7684\u5386\u53F2\u6570\u636E\uFF1F","card.resetBody":"\u4F1A\u5220\u9664\u6240\u6709\u4F1A\u8BDD\u7684\u8131\u654F\u8BB0\u5F55\u548C\u7EDF\u8BA1\uFF0C\u5305\u62EC\u78C1\u76D8\u4E0A\u672C\u5B9E\u4F8B\u72B6\u6001\u76EE\u5F55\u91CC masking/ \u4E0B\u7684\u8BB0\u5F55\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5185\u5B58\u91CC\u4FDD\u7559\u7684\u53D1\u51FA\u5185\u5BB9\u526F\u672C\u3002\u6E05\u7A7A\u540E\u65E0\u6CD5\u6062\u590D\u3002\u8131\u654F\u89C4\u5219\u3001\u914D\u7F6E\u548C\u6B63\u5728\u8FDB\u884C\u7684\u8BF7\u6C42\u4E0D\u53D7\u5F71\u54CD\u3002","card.resetAck":"\u6211\u77E5\u9053\u6E05\u7A7A\u540E\u65E0\u6CD5\u6062\u590D","card.resetConfirm":"\u6E05\u7A7A","card.cancel":"\u53D6\u6D88","card.close":"\u5173\u95ED","card.resetDone":"\u5DF2\u6E05\u7A7A\uFF0C\u5220\u9664\u4E86 {n} \u4E2A\u8BB0\u5F55\u6587\u4EF6\u3002","card.resetFailed":"\u6CA1\u80FD\u6E05\u7A7A\uFF1A{message}","stat.took":"\u5E73\u5747\u8017\u65F6","stat.tookMax":"\u6700\u957F {max} ms","stat.ms":"{n} ms","recent.count":"\u6700\u8FD1 {n} \u6761","recent.col.time":"\u65F6\u95F4","recent.col.step":"\u8F6E\xB7\u6B65","recent.stepHint":"\u8FD9\u6B21\u8BF7\u6C42\u5728\u7B2C\u51E0\u8F6E\u7B2C\u51E0\u6B65\u53D1\u51FA\uFF0C\u7F16\u53F7\u4E0E\u300C\u8F68\u8FF9\u300D\u6807\u7B7E\u9875\u4E00\u81F4\u3002\u6CE8\u610F\u8BB0\u7684\u662F\u300C\u53D1\u51FA\u300D\u7684\u90A3\u4E00\u6B65\uFF1A\u67D0\u4E00\u6B65\u7684\u8F93\u51FA\u8981\u5230\u4E0B\u4E00\u6B65\u7684\u8BF7\u6C42\u91CC\u624D\u53D1\u51FA\u53BB\uFF0C\u6240\u4EE5\u6309\u503C\u5728\u8F68\u8FF9\u91CC\u641C\u5230\u7684\u5F80\u5F80\u662F\u66F4\u65E9\u4E00\u6B65","recent.stepAt":"\u7B2C {turn} \u8F6E \xB7 \u7B2C {step} \u6B65\u53D1\u51FA","recent.stepSent":"\u8FD9\u6B21\u8BF7\u6C42\u5728\u7B2C {turn} \u8F6E \xB7 \u7B2C {step} \u6B65\u53D1\u51FA\uFF1B\u503C\u672C\u8EAB\u53EF\u80FD\u6765\u81EA\u66F4\u65E9\u7684\u67D0\u4E00\u6B65\uFF08\u770B\u5B83\u4E0B\u9762\u7684\u4F4D\u7F6E\uFF09","recent.valueFirst":"\u503C\u9996\u6B21\u88AB\u53D1\u51FA\uFF1A\u7B2C {turn} \u8F6E \xB7 \u7B2C {step} \u6B65","recent.valueFirstHere":"\u672C\u6B21\u8FD0\u884C\u5185\u9996\u6B21\u88AB\u53D1\u51FA","recent.col.where":"\u6A21\u578B / host","recent.col.from":"\u6765\u6E90","recent.col.places":"\u66FF\u6362","recent.col.restored":"\u8FD8\u539F","page.at":"{page} / {pages}","range.today":"\u4ECA\u65E5","range.week":"7 \u5929","range.month":"30 \u5929","stat.requests":"\u8BB0\u5F55\u7684\u8BF7\u6C42","stat.masked":"\u6709\u8131\u654F","stat.n":"\u66FF\u6362\u5904","stat.restored":"\u8FD8\u539F\u5904","stat.restoreOff":"\u5DF2\u5173\u95ED","stat.inTools":"\u5176\u4E2D\u5DE5\u5177\u53C2\u6570 {n}","stat.unmapped":"\u672A\u77E5\u5360\u4F4D\u7B26","stat.failed":"\u8131\u654F\u5931\u8D25","dist.kind":"\u6309 kind","dist.finder":"\u6309 finder","dist.host":"\u6309 host","dist.empty":"\u6682\u65E0","dist.others.kind":"\u5176\u4F59 kind","dist.others.finder":"\u5176\u4F59 finder","dist.others.host":"\u5176\u4F59 host","hint.kind.title":"kind\uFF1A\u503C\u7684\u7C7B\u522B","hint.kind.body":"\u89C4\u5219\u6216\u8BCD\u8868\u8BA4\u51FA\u503C\u540E\u5B9A\u7684\u7C7B\u522B\uFF1B\u5360\u4F4D\u7B26\u6309\u5B83\u547D\u540D\uFF0C\u52A8\u4F5C\u4E5F\u6309 kind \u914D\u7F6E\u3002","hint.finder.title":"finder\uFF1A\u8C01\u627E\u5230\u7684","hint.finder.body":"\u8FD9\u6761\u503C\u7531\u8C01\u627E\u5230\uFF1A\u5185\u7F6E\u89C4\u5219\u3001\u81EA\u5B9A\u4E49\u8BCD\u3001\u4E4B\u524D\u8131\u654F\u8FC7\u7684\u503C\u6216 cookie\u3002","hint.count":"\u6570\u5B57\u662F\u66FF\u6362\u5904\u6570\uFF0C\u4E0D\u662F\u8BF7\u6C42\u6570\uFF1Bwarn / block \u4E0D\u8BA1\u5165\u3002","hint.kind.SECRET":"\u5176\u5B83\u5BC6\u94A5\u7C7B\u5B57\u6BB5\uFF1Asecret / token / key=\u2026\uFF0C\u4EE5\u53CA\u4E2D\u6587\u300C\u5BC6\u94A5\u662F\u2026\u300D","hint.kind.PASSWORD":"\u5BC6\u7801\uFF1AURL \u91CC\u7684\u51ED\u636E\u3001password=\u2026 \u5B57\u6BB5\u3001\u4E2D\u6587\u300C\u5BC6\u7801\u4E3A\u2026\u300D","hint.kind.API_KEY":"\u5404\u5E73\u53F0\u7684\u5BC6\u94A5\uFF1AOpenAI / Anthropic sk-\u2026\u3001GitHub \u4EE4\u724C\u3001AWS AKIA\u2026\u3001Google AIza\u2026 \u7B49","hint.kind.TOKEN":"JWT\uFF08eyJ\u2026 \u4E09\u6BB5\u70B9\u5206\uFF09\uFF0C\u4EE5\u53CA Authorization \u5934\u91CC Bearer / Token \u540E\u9762\u7684\u4EE4\u724C","hint.kind.PRIVATE_KEY":"PEM \u79C1\u94A5\u5757","hint.kind.COOKIE":"Cookie \u5934\u3001curl -b\u3001cookies.txt \u91CC\u7684\u4F1A\u8BDD\u503C\uFF08BDUSS\u3001JSESSIONID \u7B49\uFF09","hint.kind.EMAIL":"\u90AE\u7BB1\u5730\u5740","hint.kind.PHONE":"\u5927\u9646\u624B\u673A\u53F7","hint.kind.ID_CARD":"\u8EAB\u4EFD\u8BC1\u53F7\uFF08\u6821\u9A8C\u4F4D\u6709\u6548\uFF09","hint.kind.BANK_CARD":"\u94F6\u884C\u5361\u53F7\uFF08Luhn \u6821\u9A8C\uFF09","hint.kind.TERM":"\u914D\u7F6E words \u91CC\u5217\u51FA\u7684\u81EA\u5B9A\u4E49\u654F\u611F\u8BCD","hint.finder.rule":"\u5185\u7F6E\u6B63\u5219\u89C4\u5219\u8BA4\u51FA\u7684\u503C\uFF1A\u5404\u7C7B\u5BC6\u94A5\u3001\u5BC6\u7801\u3001\u4E2A\u4EBA\u4FE1\u606F","hint.finder.word":"\u914D\u7F6E words \u91CC\u5217\u51FA\u7684\u8BCD","hint.finder.known":"\u672C\u6B21\u8FD0\u884C\u91CC\u5DF2\u7ECF\u8131\u654F\u8FC7\u7684\u503C\u53C8\u5728\u8BF7\u6C42\u522B\u5904\u51FA\u73B0\uFF08\u91CD\u53D1\u7684\u5386\u53F2\u591A\u8D70\u8FD9\u6761\uFF09","hint.finder.cookie":"\u6309 Cookie \u5934\u3001curl -b\u3001cookies.txt \u6216 cookie \u540D\u8BA4\u51FA\u7684\u4F1A\u8BDD\u503C","filter.kind":"\u6309 kind \u7B5B\u9009","filter.finder":"\u6309 finder \u7B5B\u9009","filter.all":"\u5168\u90E8","filter.none":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u7684\u503C\u3002","filter.aria":"{name}\uFF1A{value}","warn.streak":"\u8FDE\u7EED {n} \u6B21\u8131\u654F\u5931\u8D25\uFF0C\u8BF7\u6C42\u672A\u53D1\u51FA\u3002\u7528 /privacy off \u6B62\u8840\u3002","warn.unmapped":"\u56DE\u590D\u91CC\u6709 {n} \u4E2A\u503C\u8868\u91CC\u6CA1\u6709\u7684\u5360\u4F4D\u7B26\uFF0C\u53EF\u80FD\u88AB\u6A21\u578B\u6539\u574F\u4E86\u3002","warn.inTools":"\u6709 {n} \u5904\u8FD8\u539F\u843D\u5728\u5DE5\u5177\u8C03\u7528\u53C2\u6570\u91CC\uFF0C\u5DE5\u5177\u6267\u884C\u65F6\u771F\u503C\u4F1A\u88AB\u7528\u5230\uFF1B\u5982\u679C\u4E0D\u662F\u4F60\u9884\u671F\u7684\uFF0C\u68C0\u67E5\u6700\u8FD1\u7684\u5DE5\u5177\u8C03\u7528\u3002","recent.title":"\u6700\u8FD1\u8BB0\u5F55","recent.empty":"\u8FD8\u6CA1\u6709\u8BB0\u5F55\u3002","recent.failed":"\u5931\u8D25","col.placeholder":"\u5360\u4F4D\u7B26","col.kind":"kind","col.finder":"finder","col.head":"\u5F00\u5934","recent.placesHint":"\u8BF7\u6C42\u91CC\u88AB\u6362\u6210\u5360\u4F4D\u7B26\u7684\u5904\u6570\uFF08\u4E0D\u662F\u53D1\u51FA\u53BB\u7684\u503C\u7684\u6570\u91CF\uFF09","recent.restoredHint":"\u56DE\u590D\u91CC\u51FA\u73B0\u5360\u4F4D\u7B26\u3001\u88AB\u6362\u56DE\u771F\u503C\u7684\u5904\u6570\uFF1B\u6A21\u578B\u4E0D\u5FC5\u590D\u8FF0\u6BCF\u4E2A\u503C\uFF0C\u6240\u4EE5\u4E24\u8005\u901A\u5E38\u4E0D\u76F8\u7B49","col.len":"\u957F\u5EA6","col.n":"\u6B21\u6570","recent.noValues":"\u8FD9\u6B21\u8BF7\u6C42\u6CA1\u6709\u8131\u654F\u3002","recent.unmapped":"\u56DE\u590D\u91CC\u6709 {n} \u4E2A\u503C\u8868\u91CC\u6CA1\u6709\u7684\u5360\u4F4D\u7B26\uFF1A\u53EF\u80FD\u662F\u6A21\u578B\u628A\u5360\u4F4D\u7B26\u6539\u574F\u4E86\uFF0C\u4E5F\u53EF\u80FD\u5B83\u5728\u590D\u8FF0\u793A\u4F8B\u6216\u91CD\u542F\u524D\u7684\u503C\u3002","recent.omitted":"\u53E6\u6709 {n} \u4E2A\u503C\u8D85\u51FA\u5355\u6761\u8BB0\u5F55\u7684\u4E0A\u9650\uFF0C\u6CA1\u6709\u5217\u51FA\u3002","stat.warned":"warn \u7167\u53D1","stat.blocked":"block \u62E6\u4E0B","stat.exfil":"\u5916\u5E26\u5DE5\u5177\u8C03\u7528","stat.exfilBlocked":"\u5176\u4E2D {n} \u5904\u672A\u8FD8\u539F","warn.exfil":"\u6709 {n} \u6B21\u5DE5\u5177\u8C03\u7528\u628A\u8FD8\u539F\u51FA\u7684\u503C\u5199\u8FDB\u4E86\u6307\u5411\u672C\u673A\u4EE5\u5916 host \u7684\u53C2\u6570\uFF0C\u5C55\u5F00\u6700\u8FD1\u8BB0\u5F55\u67E5\u770B host\u3002","recent.blocked":"\u5DF2\u62E6\u4E0B","recent.exfil":"\u5916\u5E26\uFF1A{hosts}","col.action":"\u52A8\u4F5C","action.warn":"warn \u7167\u53D1","action.block":"block \u62E6\u4E0B","view.open":"\u67E5\u770B\u53D1\u51FA\u5185\u5BB9","view.title":"\u8FD9\u6B21\u8BF7\u6C42\u5B9E\u9645\u53D1\u51FA\u7684\u5185\u5BB9","view.agent":"\u66FF\u6362\u5904\u6807\u6CE8\uFF08kind \xB7 \u5F00\u5934 \xB7 \u957F\u5EA6\uFF09","view.vendor":"\u6A21\u578B\u670D\u52A1\u6536\u5230\u7684\u5185\u5BB9\uFF08\u5360\u4F4D\u7B26\u5DF2\u66FF\u6362\uFF09","view.onlyChanged":"\u53EA\u770B\u6709\u66FF\u6362\u7684\u884C","view.loading":"\u6B63\u5728\u8BFB\u53D6\u2026","view.gone":"\u8FD9\u4EFD\u526F\u672C\u5DF2\u4E0D\u5728\u5185\u5B58\u91CC\uFF1A\u8D85\u51FA\u4E86\u4FDD\u7559\u4E0A\u9650\uFF0C\u6216 dsh \u5DF2\u91CD\u542F\u3002","view.failed":"\u8BFB\u4E0D\u5230\u8FD9\u4EFD\u526F\u672C\uFF1A{reason}","view.truncated":"\u53EA\u663E\u793A\u524D {n} \u884C\u3002","view.none":"\u6CA1\u6709\u6709\u66FF\u6362\u7684\u884C\u3002","view.close":"\u6536\u8D77","panel.tab":"\u9690\u79C1\u4FDD\u62A4","panel.session":"\u672C\u4F1A\u8BDD","panel.empty":"\u672C\u4F1A\u8BDD\u8FD8\u6CA1\u6709\u8BB0\u5F55\u3002\u53EA\u6709\u53D1\u751F\u8131\u654F\u6216\u8FD8\u539F\u7684\u6A21\u578B\u8BF7\u6C42\u624D\u4F1A\u7559\u4E0B\u8BB0\u5F55\u3002","panel.diagramAgent":"agent / adapter","panel.diagramGateway":"\u9690\u79C1\u7F51\u5173","panel.diagramGatewaySub":"\u8131\u654F \xB7 \u8FD8\u539F","panel.diagramVendor":"\u6A21\u578B\u670D\u52A1","panel.diagramRequest":"\u2460 \u8BF7\u6C42","panel.diagramReply":"\u2461 \u56DE\u590D","panel.diagramPlaceholder":"\u5360\u4F4D\u7B26","panel.diagramNote":"\u5BC6\u94A5\u3001\u51ED\u636E\u3001\u4E2A\u4EBA\u4FE1\u606F\u5728\u79BB\u5F00\u672C\u673A\u524D\u6362\u6210\u5360\u4F4D\u7B26\uFF1B\u56DE\u590D\u9ED8\u8BA4\u4E0D\u8FD8\u539F\uFF0C\u5360\u4F4D\u7B26\u539F\u6837\u8FDB\u4F1A\u8BDD\u65E5\u5FD7\u3002","page.first":"\u9996\u9875","page.prev":"\u4E0A\u4E00\u9875","page.next":"\u4E0B\u4E00\u9875","cfg.title":"\u914D\u7F6E","cfg.f.showPanel":"\u5728\u4F1A\u8BDD\u9876\u90E8\u663E\u793A\u300C\u9690\u79C1\u4FDD\u62A4\u300D\u6807\u7B7E\u9875","cfg.f.showPanel.hint":"\u6253\u5F00\u540E\uFF0C\u5BF9\u8BDD / \u8F68\u8FF9 \u65C1\u8FB9\u591A\u4E00\u4E2A\u300C\u9690\u79C1\u4FDD\u62A4\u300D\uFF0C\u5185\u5BB9\u662F\u672C\u4F1A\u8BDD\u7684\u8131\u654F\u8BB0\u5F55\u4E0E\u7EDF\u8BA1\u3002","cfg.unavailable":"\u8BFB\u4E0D\u5230\u8BBE\u7F6E\uFF1A\u5BBF\u4E3B\u6CA1\u6709\u63D0\u4F9B\u8BBE\u7F6E\u670D\u52A1\uFF0C\u6216\u63D2\u4EF6\u7684 host \u7AEF\u8FD8\u6CA1\u52A0\u8F7D\u65B0\u7248\u672C\u3002","cfg.loading":"\u6B63\u5728\u8BFB\u53D6\u5F53\u524D\u914D\u7F6E\u2026","cfg.retry":"\u91CD\u8BD5","cfg.failed":"\u6CA1\u80FD\u4FDD\u5B58\uFF0C\u8BF7\u91CD\u8BD5\u3002","cfg.sidebarFailed":"\u6807\u7B7E\u9875\u6CE8\u518C\u5931\u8D25\uFF1A{reason}","cfg.f.excludeProviders":"\u4E0D\u8131\u654F\u7684 provider","cfg.excludedNone":"\u4E0D\u9009\uFF1A\u5168\u90E8\u8131\u654F","cfg.sep":"\u3001","cfg.excludedMany":"{names} \u7B49 {n} \u4E2A","cfg.providerListUnavailable":"\u8BFB\u4E0D\u5230 provider \u5217\u8868\uFF1A\u5BBF\u4E3B\u6CA1\u6709\u6CE8\u518C\u4EFB\u4F55 provider\uFF0C\u6216\u8FD9\u6B21\u8C03\u7528\u5931\u8D25\u3002","cfg.remove":"\u79FB\u9664 {name}","cfg.f.excludeProviders.hint":"\u52FE\u9009\u7684 provider \u53D1\u51FA\u7684\u8BF7\u6C42\u539F\u6837\u9001\u51FA\uFF0C\u56DE\u590D\u4E5F\u4E0D\u8FD8\u539F\uFF0C\u4E0D\u7559\u8BB0\u5F55\uFF1B\u6709\u8BF7\u6C42\u53D1\u51FA\u65F6\uFF0C\u65E5\u5FD7\u91CC\u6BCF\u4E2A provider \u63D0\u793A\u4E00\u6B21\u3002\u6539\u52A8\u4ECE\u4E0B\u4E00\u6B21\u6A21\u578B\u8C03\u7528\u8D77\u751F\u6548\u3002","cfg.providerAbsent":"{name}\uFF08\u5F53\u524D\u672A\u6CE8\u518C\uFF09","cfg.add":"\u6DFB\u52A0","cfg.listEmpty":"\u8FD8\u6CA1\u6709","cfg.countInvalid":"\u8981\u586B\u4E0D\u5C0F\u4E8E {min} \u7684\u6574\u6570\u3002","cfg.applies":"\u6539\u52A8\u5373\u65F6\u4FDD\u5B58\uFF0C\u4ECE\u4E0B\u4E00\u6B21\u6A21\u578B\u8C03\u7528\u8D77\u751F\u6548\uFF0C\u4E0D\u7528\u91CD\u542F\u3002","cfg.others":"\u5176\u4F59\u914D\u7F6E\u9879\uFF08actions\u3001cookieNames\u3001excludeHosts\u3001maxValues \u7B49\uFF09\u5728 cordis.patch.yml \u91CC\u4FEE\u6539\uFF0C\u8BF4\u660E\u89C1 README\u3002","cfg.g.mask":"\u8131\u654F","cfg.g.lists":"\u8BCD\u8868","cfg.g.record":"\u8BB0\u5F55","cfg.g.view":"\u6807\u7B7E\u9875\u4E0E provider","cfg.f.enabled":"\u542F\u7528\u8131\u654F","cfg.f.enabled.hint":"\u603B\u5F00\u5173\u3002\u5173\u6389\u540E\u7F51\u5173\u4E0D\u518D\u6539\u5199\u8BF7\u6C42\uFF0C\u7EDF\u8BA1\u4E0E\u8BB0\u5F55\u4E5F\u505C\u4E0B\u3002","cfg.f.secrets":"\u8131\u654F\u5BC6\u94A5\u4E0E\u51ED\u636E","cfg.f.secrets.hint":"API key\u3001\u4EE4\u724C\u3001\u5BC6\u7801\u3001\u79C1\u94A5\u3001cookie\u3002","cfg.f.personal":"\u8131\u654F\u4E2A\u4EBA\u4FE1\u606F","cfg.f.personal.hint":"\u90AE\u7BB1\u3001\u5927\u9646\u624B\u673A\u53F7\u3001\u8EAB\u4EFD\u8BC1\u53F7\u3001\u94F6\u884C\u5361\u53F7\u3002","cfg.f.shape":"\u5BC6\u94A5\u6362\u6210\u540C\u5F62\u5047 key","cfg.f.shape.hint":"\u524D\u7F00\u3001\u957F\u5EA6\u3001\u5B57\u7B26\u7C7B\u522B\u4E0D\u53D8\uFF0C\u4EE3\u66FF {{\u2026}} \u5360\u4F4D\u7B26\uFF1B\u4E0D\u8DB3 8 \u5B57\u7B26\u6216\u542B\u7279\u6B8A\u5B57\u7B26\u7684\u503C\u4ECD\u7528\u5360\u4F4D\u7B26\u3002restoreLog \u6253\u5F00\u65F6\uFF0C\u56DE\u590D\u91CC\u7684\u5047 key \u7167\u6837\u6362\u56DE\u771F\u503C\u3002","cfg.f.maskKeys":"JSON \u952E\u4E5F\u8131\u654F","cfg.f.maskKeys.hint":'\u8BF7\u6C42 body \u91CC\u8BFB\u8D77\u6765\u50CF\u5BC6\u94A5\u6216\u4E2A\u4EBA\u4FE1\u606F\u7684\u952E\u540D\uFF08\u4F8B\u5982 {"sk-\u2026": \u2026}\uFF09\u548C\u503C\u4E00\u6837\u6362\u6210\u5360\u4F4D\u7B26\uFF1BrestoreLog \u6253\u5F00\u65F6\uFF0C\u56DE\u590D\u91CC\u518D\u6362\u56DE\u6765\u3002\u534F\u8BAE\u81EA\u8EAB\u7684\u952E\uFF08model\u3001role\u3001type\u3001name \u7B49\uFF09\u3001\u5DE5\u5177\u5B9A\u4E49\u4EE5\u53CA\u5DE5\u5177\u8C03\u7528\u7684\u53C2\u6570\u540D\u4E0D\u52A8\uFF0C\u5426\u5219\u4F9B\u5E94\u5546\u8BFB\u4E0D\u61C2\u8FD9\u4EFD\u8BF7\u6C42\u3002',"cfg.f.toolGuard":"\u5DE5\u5177\u8C03\u7528\u5916\u53D1\u4FDD\u62A4","cfg.f.toolGuard.hint":"\u5DE5\u5177\u8C03\u7528\u7684\u53C2\u6570\u91CC\u8FD8\u539F\u51FA\u4E86\u503C\u3001\u53C8\u6307\u5411\u672C\u673A\u4EE5\u5916\u7684 host \u65F6\u600E\u4E48\u5904\u7406\u3002\u53EA\u6709 restoreLog \u6253\u5F00\u65F6\u624D\u53EF\u80FD\u6709\u8FD8\u539F\u503C\uFF0C\u5173\u95ED\u65F6\u5B83\u4E0D\u4F1A\u751F\u6548\u3002","cfg.f.toolGuard.off":"\u53EA\u8BA1\u6570","cfg.f.toolGuard.warn":"\u544A\u8B66\u5E76\u8BB0\u5F55","cfg.f.toolGuard.block":"\u4E0D\u8FD8\u539F","cfg.f.restoreLog":"\u4F1A\u8BDD\u65E5\u5FD7\u5199\u5165\u771F\u503C","cfg.f.restoreLog.hint":"\u5173\u95ED\uFF08\u9ED8\u8BA4\uFF09\u65F6\uFF0C\u56DE\u590D\u91CC\u7684\u5360\u4F4D\u7B26\u539F\u6837\u5199\u8FDB\u4F1A\u8BDD\u65E5\u5FD7\uFF0C\u660E\u6587\u4E0D\u8FDB\u65E5\u5FD7\uFF0Cagent \u62FF\u5230\u7684\u4E5F\u662F\u5360\u4F4D\u7B26\uFF1B\u6253\u5F00\u540E\u5360\u4F4D\u7B26\u5728\u843D\u76D8\u524D\u6362\u56DE\u771F\u503C\uFF0Cagent \u4E0E\u65E5\u5FD7\u90FD\u62FF\u5230\u771F\u503C\u2014\u2014\u56DE\u590D\u65B9\u5411\u53EA\u6709\u8FD9\u4E00\u4E2A\u8FD8\u539F\u70B9\uFF0C\u4E24\u8FB9\u5FC5\u7136\u4E00\u81F4\u3002\u6253\u5F00\u540E\u4F1A\u8BDD\u540C\u6B65\u3001\u5907\u4EFD\u3001\u5206\u4EAB\u3001\u5BFC\u51FA\u4F1A\u5E26\u8D70\u771F\u503C\uFF0C\u6240\u4EE5\u6253\u5F00\u524D\u8981\u786E\u8BA4\u3002","cfg.f.words":"\u81EA\u5B9A\u4E49\u654F\u611F\u8BCD","cfg.f.words.hint":"\u9879\u76EE\u4EE3\u53F7\u3001\u5BA2\u6237\u540D\u7B49\uFF0C\u6309\u539F\u6837\u6362\u6210 TERM \u5360\u4F4D\u7B26\u3002\u56DE\u8F66\u6216\u70B9\u300C\u6DFB\u52A0\u300D\u52A0\u5165\u3002","cfg.f.words.placeholder":"\u8F93\u5165\u4E00\u4E2A\u8BCD","cfg.f.allow":"\u6C38\u4E0D\u8131\u654F\u7684\u503C","cfg.f.allow.hint":"\u6574\u503C\u5339\u914D\uFF0C\u4E0D\u5206\u5927\u5C0F\u5199\uFF0C\u54EA\u6761\u89C4\u5219\u627E\u5230\u90FD\u4E0D\u6362\u3002","cfg.f.allow.placeholder":"\u8F93\u5165\u4E00\u4E2A\u503C","cfg.f.record":"\u8BB0\u5F55\u5199\u76D8","cfg.f.record.hint":"\u5199\u5230\u672C\u5B9E\u4F8B\u72B6\u6001\u76EE\u5F55\u7684 masking/ \u4E0B\uFF08\u6BCF\u4E2A\u5B9E\u4F8B\u4E00\u4E2A\u76EE\u5F55\uFF09\uFF0C\u53EA\u8BB0\u5143\u4FE1\u606F\u3001\u4E0D\u8BB0\u503C\u672C\u8EAB\uFF1B\u5173\u6389\u53EA\u5728\u5185\u5B58\u91CC\u7EDF\u8BA1\u3002","cfg.f.keepDays":"\u8BB0\u5F55\u4FDD\u7559\u5929\u6570","cfg.f.keepDays.hint":"\u8D85\u8FC7\u7684\u6309\u5929\u5220\u9664\uFF0C\u81F3\u5C11 1 \u5929\u3002","cfg.f.vendorView":"\u4FDD\u7559\u53D1\u51FA\u5185\u5BB9\uFF0C\u4F9B\u5BF9\u7167\u67E5\u770B","cfg.f.vendorView.hint":"\u5F00\u542F\u540E\uFF0C\u4E4B\u540E\u7684\u8BB0\u5F55\u591A\u4E00\u4E2A\u300C\u67E5\u770B\u53D1\u51FA\u5185\u5BB9\u300D\u6309\u94AE\uFF0C\u53EF\u4EE5\u6838\u5BF9\u6A21\u578B\u670D\u52A1\u5B9E\u9645\u6536\u5230\u4E86\u4EC0\u4E48\u3001\u6709\u6CA1\u6709\u6F0F\u8131\u654F\u3002\u526F\u672C\u5DF2\u8131\u654F\uFF0C\u4E0D\u542B\u771F\u503C\uFF1B\u53EA\u5B58\u5728\u5185\u5B58\u91CC\uFF0C\u6700\u591A 100 \u4EFD\u3001\u5171 64 MiB\uFF0C\u91CD\u542F\u5373\u6E05\u7A7A\u3002\u526F\u672C\u542B\u5B8C\u6574\u7684\u63D0\u793A\u8BCD\u548C\u5BF9\u8BDD\uFF0C\u5E73\u65F6\u4E0D\u5FC5\u5F00\u3002","cfg.expand":"\u5C55\u5F00\u300C{name}\u300D","cfg.collapse":"\u6536\u8D77\u300C{name}\u300D","cfg.s.maskOff":"\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6C42\u539F\u6837\u53D1\u51FA","cfg.s.maskNothing":"\u6CA1\u6709\u9009\u8131\u654F\u7C7B\u578B","cfg.s.maskKeysOnly":"\u53EA\u8131\u654F\u952E\u540D","cfg.s.secrets":"\u5BC6\u94A5\u4E0E\u51ED\u636E","cfg.s.personal":"\u4E2A\u4EBA\u4FE1\u606F","cfg.s.shape":"\u540C\u5F62\u5047 key","cfg.s.toolGuard.off":"\u5916\u53D1\u4FDD\u62A4\uFF1A\u53EA\u8BA1\u6570","cfg.s.toolGuard.warn":"\u5916\u53D1\u4FDD\u62A4\uFF1A\u544A\u8B66","cfg.s.toolGuard.block":"\u5916\u53D1\u4FDD\u62A4\uFF1A\u4E0D\u8FD8\u539F","cfg.s.restoreLog":"\u65E5\u5FD7\u5199\u771F\u503C","cfg.s.words":"\u654F\u611F\u8BCD {n} \u4E2A","cfg.s.allow":"\u653E\u884C {n} \u4E2A","cfg.s.record":"\u5199\u76D8\uFF0C\u4FDD\u7559 {n} \u5929","cfg.s.recordOff":"\u53EA\u5728\u5185\u5B58","cfg.s.vendorView":"\u4FDD\u7559\u53D1\u51FA\u5185\u5BB9","cfg.s.panel":"\u663E\u793A\u6807\u7B7E\u9875","cfg.s.panelOff":"\u4E0D\u663E\u793A\u6807\u7B7E\u9875","cfg.s.providersAll":"\u5168\u90E8 provider \u8131\u654F","cfg.s.providersSome":"{n} \u4E2A provider \u4E0D\u8131\u654F","cfg.s.problem":"\u6709\u63D0\u793A\uFF0C\u5C55\u5F00\u67E5\u770B","card.valuesHint":"\u88AB\u6362\u4E0B\u6765\u7684\u539F\u503C\u53EA\u5B58\u5728\u5185\u5B58\u91CC\uFF0CrestoreLog \u6253\u5F00\u65F6\u7528\u6765\u628A\u6A21\u578B\u56DE\u590D\u91CC\u7684\u5360\u4F4D\u7B26\u6362\u56DE\u539F\u503C\u3002\u6240\u6709\u4F1A\u8BDD\u5171\u7528\uFF0C\u91CD\u542F dsh \u540E\u6E05\u7A7A\u3002","session.mask":"\u672C\u4F1A\u8BDD\u8131\u654F","session.offTitle":"\u5173\u95ED\u672C\u4F1A\u8BDD\u7684\u8131\u654F\uFF1F","session.offBody":"\u5173\u95ED\u540E\uFF0C\u672C\u4F1A\u8BDD\u4E4B\u540E\u7684\u6A21\u578B\u8BF7\u6C42\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\uFF1A\u5BC6\u94A5\u3001\u51ED\u636E\u3001\u4E2A\u4EBA\u4FE1\u606F\u548C\u81EA\u5B9A\u4E49\u654F\u611F\u8BCD\u90FD\u4E0D\u518D\u66FF\u6362\uFF0C\u56DE\u590D\u4E0D\u518D\u8FD8\u539F\uFF0C\u4E5F\u4E0D\u7559\u8BB0\u5F55\u3002\u5176\u4ED6\u4F1A\u8BDD\u4E0D\u53D7\u5F71\u54CD\uFF0C\u968F\u65F6\u53EF\u4EE5\u5728\u8FD9\u91CC\u91CD\u65B0\u6253\u5F00\u3002","session.offAck":"\u6211\u77E5\u9053\u672C\u4F1A\u8BDD\u7684\u5185\u5BB9\u4F1A\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1","session.offConfirm":"\u5173\u95ED\u8131\u654F","session.offNotice":"\u672C\u4F1A\u8BDD\u5DF2\u5173\u95ED\u8131\u654F\uFF1A\u8BF7\u6C42\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\uFF0C\u4E0D\u7559\u8BB0\u5F55\u3002","session.failed":"\u6CA1\u80FD\u5207\u6362\uFF1A{message}","cfg.f.recordContext":"\u8BB0\u5F55\u66FF\u6362\u5904\u7684\u4E0A\u4E0B\u6587","cfg.f.recordContext.hint":"\u6BCF\u4E2A\u66FF\u6362\u5904\u524D\u540E\u5404\u7EA6 80 \u4E2A\u5B57\u7B26\u548C\u5B83\u6240\u5728\u7684\u4F4D\u7F6E\uFF08\u7528\u6237\u6D88\u606F\u3001\u5DE5\u5177\u7ED3\u679C\u7B49\uFF09\u4E00\u8D77\u8BB0\u4E0B\uFF0C\u65B9\u4FBF\u786E\u8BA4\u662F\u5728\u4EC0\u4E48\u573A\u5408\u66FF\u6362\u7684\u3002\u8FD9\u6BB5\u6587\u5B57\u53D6\u81EA\u53D1\u51FA\u7684\u5185\u5BB9\uFF0C\u91CC\u9762\u88AB\u8131\u654F\u7684\u503C\u90FD\u5DF2\u662F\u5360\u4F4D\u7B26\uFF1B\u6CA1\u5F00\u4E2A\u4EBA\u4FE1\u606F\u8131\u654F\u65F6\uFF0C\u90AE\u7BB1\u3001\u624B\u673A\u53F7\u7B49\u4F1A\u539F\u6837\u51FA\u73B0\u5728\u8FD9\u6BB5\u6587\u5B57\u91CC\u3002","recent.contextHint":"\u66FF\u6362\u5904\u524D\u540E\u7684\u6587\u5B57\uFF0C\u53D6\u81EA\u53D1\u51FA\u7684\u5185\u5BB9\uFF0C\u88AB\u8131\u654F\u7684\u503C\u90FD\u662F\u5360\u4F4D\u7B26","recent.elsewhere":"\u8FD8\u51FA\u73B0\u5728 {paths}","recent.elsewhereMore":"\u8FD8\u51FA\u73B0\u5728 {paths}\uFF08\u53E6\u6709 {n} \u5904\u6CA1\u5217\u51FA\uFF09","recent.elsewhereOmitted":"\u53E6\u6709 {n} \u5904\u6CA1\u5217\u51FA","recent.placeSep":"\u3001","place.system":"\u7CFB\u7EDF\u63D0\u793A","place.toolResult":"\u5DE5\u5177\u7ED3\u679C","place.toolCall":"\u5DE5\u5177\u8C03\u7528","place.user":"\u7528\u6237\u6D88\u606F","place.assistant":"\u6A21\u578B\u56DE\u590D","place.other":"\u5176\u4ED6","err.noConnection":"\u8FD8\u6CA1\u6709\u8FDE\u4E0A dsh","err.malformed":"\u63D2\u4EF6 host \u7AEF\u7684\u56DE\u7B54\u683C\u5F0F\u4E0D\u5BF9\uFF0Chost \u7AEF\u548C\u9875\u9762\u53EF\u80FD\u4E0D\u662F\u540C\u4E00\u7248\u672C","err.remote":"{message}","err.thrown":"{message}","err.noDisposer":"\u4F1A\u8BDD\u89C6\u56FE\u6761\u6CA1\u6709\u4EA4\u56DE\u64A4\u9500\u6CE8\u518C\u7684\u51FD\u6570","card.stale":"\u5237\u65B0\u5931\u8D25\uFF08{reason}\uFF09\u3002\u4E0B\u9762\u662F\u4E0A\u6B21\u8BFB\u5230\u7684\u6570\u636E\uFF0C\u53EF\u80FD\u5DF2\u8FC7\u671F\u3002","card.reason":"\u539F\u56E0\uFF1A{reason}","recent.cell":"{name}\uFF1A{value}","recent.cellSep":"\uFF0C","view.unknown":"\u2039\u672A\u77E5\u5360\u4F4D\u7B26\u203A","view.line":"\u884C","cfg.risk.send.title":"\u8FD9\u9879\u6539\u52A8\u4F1A\u8BA9\u5185\u5BB9\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1","cfg.risk.delete.title":"\u8FD9\u9879\u6539\u52A8\u4F1A\u5220\u9664\u5DF2\u6709\u6570\u636E","cfg.risk.log.title":"\u8FD9\u9879\u6539\u52A8\u4F1A\u8BA9\u771F\u503C\u5199\u8FDB\u4F1A\u8BDD\u65E5\u5FD7","cfg.risk.send.ack":"\u6211\u77E5\u9053\u76F8\u5173\u5185\u5BB9\u4F1A\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1","cfg.risk.delete.ack":"\u6211\u77E5\u9053\u5220\u9664\u7684\u6570\u636E\u65E0\u6CD5\u6062\u590D","cfg.risk.log.ack":"\u6211\u77E5\u9053\u771F\u503C\u4F1A\u5199\u8FDB\u4F1A\u8BDD\u65E5\u5FD7\uFF0C\u5E76\u968F\u540C\u6B65\u3001\u5907\u4EFD\u3001\u5206\u4EAB\u3001\u5BFC\u51FA\u5E26\u8D70","cfg.risk.confirm":"\u786E\u8BA4\u4FEE\u6539","cfg.r.enabled":"\u5173\u95ED\u540E\uFF0C\u6240\u6709\u4F1A\u8BDD\u7684\u6A21\u578B\u8BF7\u6C42\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\uFF1A\u5BC6\u94A5\u3001\u51ED\u636E\u3001\u4E2A\u4EBA\u4FE1\u606F\u548C\u81EA\u5B9A\u4E49\u654F\u611F\u8BCD\u90FD\u4E0D\u518D\u66FF\u6362\uFF0C\u56DE\u590D\u4E0D\u518D\u8FD8\u539F\uFF0C\u4E5F\u4E0D\u7559\u8BB0\u5F55\u3002","cfg.r.secrets":"\u5173\u95ED\u540E\uFF0CAPI key\u3001\u4EE4\u724C\u3001\u5BC6\u7801\u3001\u79C1\u94A5\u548C cookie \u4E0D\u518D\u66FF\u6362\uFF0C\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\u3002","cfg.r.personal":"\u5173\u95ED\u540E\uFF0C\u90AE\u7BB1\u3001\u624B\u673A\u53F7\u3001\u8EAB\u4EFD\u8BC1\u53F7\u548C\u94F6\u884C\u5361\u53F7\u4E0D\u518D\u66FF\u6362\uFF0C\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\u3002","cfg.r.maskKeys":"\u5173\u95ED\u540E\uFF0C\u8BF7\u6C42\u91CC\u8BFB\u8D77\u6765\u50CF\u5BC6\u94A5\u6216\u4E2A\u4EBA\u4FE1\u606F\u7684\u952E\u540D\u4E0D\u518D\u66FF\u6362\uFF0C\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\uFF1B\u5DE5\u5177\u5B9A\u4E49\u548C\u5DE5\u5177\u53C2\u6570\u540D\u672C\u6765\u5C31\u4E0D\u52A8\u3002","cfg.r.words":"\u53BB\u6389\u7684\u654F\u611F\u8BCD\uFF08{names}\uFF09\u4EE5\u540E\u4E0D\u518D\u8131\u654F\uFF0C\u51FA\u73B0\u5728\u8BF7\u6C42\u91CC\u65F6\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\u3002","cfg.r.allow":"\u65B0\u52A0\u7684\u503C\uFF08{names}\uFF09\u4EE5\u540E\u4E0D\u518D\u8131\u654F\uFF0C\u51FA\u73B0\u5728\u8BF7\u6C42\u91CC\u65F6\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\u3002","cfg.r.excludeProviders":"\u65B0\u52FE\u9009\u7684 provider\uFF08{names}\uFF09\u53D1\u51FA\u7684\u8BF7\u6C42\u539F\u6837\u9001\u51FA\uFF0C\u56DE\u590D\u4E0D\u8FD8\u539F\uFF0C\u4E5F\u4E0D\u7559\u8BB0\u5F55\u3002","cfg.r.record":"\u5173\u95ED\u540E\uFF0C\u6392\u961F\u7B49\u5F85\u5199\u76D8\u7684\u8BB0\u5F55\u4E0D\u518D\u5199\u5165\uFF0C\u4E4B\u540E\u7684\u8BB0\u5F55\u53EA\u5728\u5185\u5B58\u91CC\u7EDF\u8BA1\uFF0C\u91CD\u542F dsh \u540E\u4E22\u5931\u3002","cfg.r.keepDays":"\u4FDD\u7559\u5929\u6570\u4ECE {from} \u5929\u6539\u4E3A {to} \u5929\uFF0C\u4E0B\u6B21\u5199\u76D8\u65F6\u8D85\u51FA\u7684\u8BB0\u5F55\u6587\u4EF6\u4F1A\u88AB\u5220\u9664\uFF0C\u65E0\u6CD5\u6062\u590D\u3002","cfg.r.restoreLog":"\u6253\u5F00\u540E\uFF0C\u56DE\u590D\u91CC\u7684\u5360\u4F4D\u7B26\u5728\u5199\u5165\u4F1A\u8BDD\u65E5\u5FD7\u524D\u6362\u56DE\u771F\u503C\uFF1A\u771F\u503C\u4F1A\u5199\u8FDB\u4F1A\u8BDD\u65E5\u5FD7\uFF0C\u5E76\u968F\u5B83\u7684\u540C\u6B65\u3001\u5907\u4EFD\u3001\u5206\u4EAB\u3001\u5BFC\u51FA\u5E26\u8D70\u3002","cfg.r.vendorView":"\u5173\u95ED\u540E\uFF0C\u5185\u5B58\u91CC\u5DF2\u4FDD\u7559\u7684\u53D1\u51FA\u5185\u5BB9\u526F\u672C\u7ACB\u5373\u6E05\u7A7A\uFF0C\u4E4B\u524D\u7684\u8BB0\u5F55\u4E0D\u80FD\u518D\u67E5\u770B\u53D1\u51FA\u5185\u5BB9\u3002"};var vt={"card.title":"Masking statistics","card.on":"Masking on","card.off":"Masking off","card.refresh":"Refresh","card.loading":"Loading\u2026","card.unavailable":"No statistics: the plugin\u2019s host half is not running, or dsh needs a restart.","card.memoryOnly":"Records in memory only (record is off)","card.values":"{n} values kept for restoring","card.range":"Range","card.reset":"Clear data","card.resetTitle":"Clear the Privacy history?","card.resetBody":"This deletes the masking records and counts of every session, including the record files under this instance's masking/ and the copies of what was sent kept in memory. It cannot be undone. The rules, the settings and requests under way are not affected.","card.resetAck":"I understand this cannot be undone","card.resetConfirm":"Clear","card.cancel":"Cancel","card.close":"Close","card.resetDone":"Cleared; {n} record files deleted.","card.resetFailed":"Could not clear: {message}","stat.took":"Mean time","stat.tookMax":"longest {max} ms","stat.ms":"{n} ms","recent.count":"Latest {n}","recent.col.time":"Time","recent.col.step":"Turn\xB7Step","recent.stepHint":"The turn and step this request went out in, numbered as the Trajectory tab numbers them. It is the step that SENT it: a step\u2019s output only reaches the next step\u2019s request, so searching the trajectory for a value usually finds it one step earlier","recent.stepAt":"sent in turn {turn}, step {step}","recent.stepSent":"This request went out in turn {turn}, step {step}; a value in it may come from an earlier step (see the place under it)","recent.valueFirst":"first sent in turn {turn}, step {step}","recent.valueFirstHere":"first sent by this request, in this run","recent.col.where":"Model / host","recent.col.from":"From","recent.col.places":"Replaced","recent.col.restored":"Restored","page.at":"{page} / {pages}","range.today":"Today","range.week":"7 days","range.month":"30 days","stat.requests":"Recorded requests","stat.masked":"Masked","stat.n":"Replaced","stat.restored":"Restored","stat.restoreOff":"Off","stat.inTools":"{n} in tool arguments","stat.unmapped":"Unknown placeholders","stat.failed":"Failures","dist.kind":"By kind","dist.finder":"By finder","dist.host":"By host","dist.empty":"None yet","dist.others.kind":"Other kinds","dist.others.finder":"Other finders","dist.others.host":"Other hosts","hint.kind.title":"kind: the value\u2019s kind","hint.kind.body":"The kind given to a value a rule or your words find; placeholders are named by it and actions are set per kind.","hint.finder.title":"finder: what found it","hint.finder.body":"What found the value: a built-in rule, your words, a value masked earlier, or a cookie.","hint.count":"Places replaced, not requests; warn / block values are not counted.","hint.kind.SECRET":"Other secret fields: secret / token / key=\u2026, and the Chinese \u201C\u5BC6\u94A5\u662F\u2026\u201D","hint.kind.PASSWORD":"A password: credentials in a URL, password=\u2026 fields, the Chinese \u201C\u5BC6\u7801\u4E3A\u2026\u201D","hint.kind.API_KEY":"Keys of the platforms: OpenAI / Anthropic sk-\u2026, GitHub tokens, AWS AKIA\u2026, Google AIza\u2026 and so on","hint.kind.TOKEN":"A JWT (three dot-separated eyJ\u2026 parts), and the token after Bearer / Token in an Authorization header","hint.kind.PRIVATE_KEY":"A PEM private-key block","hint.kind.COOKIE":"Session values in Cookie headers, curl -b and cookies.txt (BDUSS, JSESSIONID \u2026)","hint.kind.EMAIL":"An email address","hint.kind.PHONE":"A mainland China mobile number","hint.kind.ID_CARD":"A Chinese ID number with a valid checksum","hint.kind.BANK_CARD":"A bank card number that passes the Luhn check","hint.kind.TERM":"A word from the configured words","hint.finder.rule":"Values the built-in rules recognize: keys, passwords, personal data","hint.finder.word":"A word from the configured words","hint.finder.known":"A value masked earlier in this run, met again elsewhere in a request (resent history mostly goes this way)","hint.finder.cookie":"A session value recognized by Cookie headers, curl -b, cookies.txt or a cookie name","filter.kind":"Filter by kind","filter.finder":"Filter by finder","filter.all":"All","filter.none":"No values match the filter.","filter.aria":"{name}: {value}","warn.streak":"Masking failed {n} times in a row; those requests were not sent. /privacy off stops it.","warn.unmapped":"Replies had {n} placeholders the table has no value for; a model may have changed them.","warn.inTools":"{n} restored places were in tool call arguments, so the tool ran with the real value. If you did not expect that, check the latest tool calls.","recent.title":"Latest records","recent.empty":"No records yet.","recent.failed":"failed","col.placeholder":"Placeholder","col.kind":"Kind","col.finder":"Finder","col.head":"Head","recent.placesHint":"Places in the request that a placeholder replaced (not how many values were sent)","recent.restoredHint":"Places where the reply had a placeholder put back; the model need not repeat every value, so the two counts usually differ","col.len":"Length","col.n":"Times","recent.noValues":"Nothing was masked in this request.","recent.unmapped":"The reply has {n} placeholders the value table has no value for: a model may have changed them, or be repeating an example or a value from before the restart.","recent.omitted":"{n} more values are past the limit of one record and not listed.","stat.warned":"Warned","stat.blocked":"Blocked","stat.exfil":"Tool calls sending values away","stat.exfilBlocked":"{n} places left unrestored","warn.exfil":"{n} tool calls had a restored value in arguments that name a host off this machine; open the latest records to see the hosts.","recent.blocked":"blocked","recent.exfil":"sent to: {hosts}","col.action":"Action","action.warn":"warn, sent","action.block":"block","view.open":"What was sent","view.title":"What this request actually sent","view.agent":"Replaced places marked (kind \xB7 head \xB7 length)","view.vendor":"What the model service received (placeholders replaced)","view.onlyChanged":"Only lines with replacements","view.loading":"Loading\u2026","view.gone":"This copy is no longer in memory: past the limits, or dsh restarted.","view.failed":"This copy could not be read: {reason}","view.truncated":"First {n} lines only.","view.none":"No line has a replacement.","view.close":"Close","panel.tab":"Privacy","panel.session":"This session","panel.empty":"No records in this session yet. Only a model request that had something masked or restored leaves one.","panel.diagramAgent":"agent / adapter","panel.diagramGateway":"privacy gateway","panel.diagramGatewaySub":"mask \xB7 restore","panel.diagramVendor":"model service","panel.diagramRequest":"\u2460 request","panel.diagramReply":"\u2461 reply","panel.diagramPlaceholder":"placeholder","panel.diagramNote":"Secrets, credentials and personal data leave this machine as placeholders; by default a reply is not restored, so the session log keeps the placeholders.","page.first":"First","page.prev":"Previous","page.next":"Next","cfg.title":"Configure","cfg.f.showPanel":"Show a Privacy tab at the top of the session","cfg.f.showPanel.hint":"When on, a Privacy tab sits beside Chat and Trajectory with this session\u2019s masking records and counts.","cfg.unavailable":"Settings cannot be read: the host offers no settings service, or the plugin\u2019s host half has not loaded the new version yet.","cfg.loading":"Reading the current configuration\u2026","cfg.retry":"Retry","cfg.failed":"Could not save; try again.","cfg.sidebarFailed":"The tab could not be registered: {reason}","cfg.f.excludeProviders":"Providers not masked","cfg.excludedNone":"None: everything is masked","cfg.sep":", ","cfg.excludedMany":"{names} and {n} in all","cfg.providerListUnavailable":"The provider list could not be read: the host has registered none, or the call failed.","cfg.remove":"Remove {name}","cfg.f.excludeProviders.hint":"Requests from a checked provider go out as they are, its replies are not restored, and nothing is recorded; the log says so once for each provider. A change applies from the next model call.","cfg.providerAbsent":"{name} (not registered now)","cfg.add":"Add","cfg.listEmpty":"None yet","cfg.countInvalid":"Enter a whole number of at least {min}.","cfg.applies":"Changes are saved at once and apply from the next model call; no restart needed.","cfg.others":"The other settings (actions, cookieNames, excludeHosts, maxValues and so on) are changed in cordis.patch.yml; see the README.","cfg.g.mask":"Masking","cfg.g.lists":"Word lists","cfg.g.record":"Records","cfg.g.view":"Tab and providers","cfg.f.enabled":"Mask requests","cfg.f.enabled.hint":"The master switch. Off, the gateway stops rewriting requests, and counting and recording stop too.","cfg.f.secrets":"Mask secrets","cfg.f.secrets.hint":"API keys, tokens, passwords, private keys, cookies.","cfg.f.personal":"Mask personal data","cfg.f.personal.hint":"Emails, mainland phone numbers, ID card and bank card numbers.","cfg.f.shape":"Same-shape fake keys","cfg.f.shape.hint":"A secret goes as a made-up key with the same prefix, length and kinds of character instead of a {{\u2026}} placeholder; a value under 8 characters, or with unusual characters, keeps the placeholder. With restoreLog on, replies put the made-up key back the same way.","cfg.f.maskKeys":"Mask JSON keys too","cfg.f.maskKeys.hint":'A key in a request body that reads like a secret or personal data ({"sk-\u2026": \u2026}) goes as a placeholder the way a value does, and comes back in the reply with restoreLog on. The protocol\u2019s own keys (model, role, type, name and so on), the tool definitions and the argument names of a tool call are left alone, or the vendor could not read the request.',"cfg.f.toolGuard":"Tool call guard","cfg.f.toolGuard.hint":"What happens when a tool call\u2019s arguments would have a value put back and name a host off this machine. A reply holds a real value only with restoreLog on; with it off this guard never runs.","cfg.f.toolGuard.off":"Count only","cfg.f.toolGuard.warn":"Warn and record","cfg.f.toolGuard.block":"Do not restore","cfg.f.restoreLog":"Real values in the session log","cfg.f.restoreLog.hint":"Off (the default), a reply\u2019s placeholders go into the session log as they are: no plaintext reaches the log, and the agent sees placeholders too. On, they are put back before the log is written, so the agent and the log both hold the real values \u2014 the reply has this one restore point, so the two cannot differ. With it on, session sync, backups, shares and exports carry the real values, so turning it on asks first.","cfg.f.words":"Your own words","cfg.f.words.hint":"Code names, customer names and the like, replaced as written with a TERM placeholder. Press Enter or Add.","cfg.f.words.placeholder":"A word","cfg.f.allow":"Values never masked","cfg.f.allow.hint":"Whole values, in any case, left alone whichever rule finds them.","cfg.f.allow.placeholder":"A value","cfg.f.record":"Write records to disk","cfg.f.record.hint":"Into this instance's own masking/ (one directory per instance), metadata only, never the values; off keeps the counts in memory.","cfg.f.keepDays":"Days of records kept","cfg.f.keepDays.hint":"Older days are deleted; at least 1.","cfg.f.vendorView":"Keep what was sent, to compare","cfg.f.vendorView.hint":"When on, records from then on have a \u201CWhat was sent\u201D button to check what the model service actually got and whether anything slipped through. The copy is masked, with no real values; it lives in memory only, at most 100 copies and 64 MiB in all, gone on restart. It holds the whole prompt and conversation, so leave it off unless you need it.","cfg.expand":"Expand {name}","cfg.collapse":"Collapse {name}","cfg.s.maskOff":"Off: requests go out as they are","cfg.s.maskNothing":"No kind chosen","cfg.s.maskKeysOnly":"Keys only","cfg.s.secrets":"Secrets","cfg.s.personal":"Personal data","cfg.s.shape":"Same-shape keys","cfg.s.toolGuard.off":"Tool guard: count","cfg.s.toolGuard.warn":"Tool guard: warn","cfg.s.toolGuard.block":"Tool guard: no restore","cfg.s.restoreLog":"Real values in log","cfg.s.words":"{n} words","cfg.s.allow":"{n} allowed","cfg.s.record":"On disk, {n} days","cfg.s.recordOff":"Memory only","cfg.s.vendorView":"Keeping what was sent","cfg.s.panel":"Tab shown","cfg.s.panelOff":"Tab hidden","cfg.s.providersAll":"Every provider masked","cfg.s.providersSome":"{n} providers not masked","cfg.s.problem":"Needs a look; expand","card.valuesHint":"The values swapped out are kept in memory only; with restoreLog on they are put back in place of the placeholders in replies. Shared by every session; cleared when dsh restarts.","session.mask":"Mask this session","session.offTitle":"Turn masking off for this session?","session.offBody":"From then on this session\u2019s model requests go to the model service as they are: secrets, credentials, personal data and your own words are no longer replaced, replies are not restored, and nothing is recorded. Other sessions are not affected; you can turn it back on here at any time.","session.offAck":"I understand this session\u2019s content goes out as it is","session.offConfirm":"Turn off","session.offNotice":"Masking is off for this session: requests go out as they are and nothing is recorded.","session.failed":"Could not switch: {message}","cfg.f.recordContext":"Record the text around each value","cfg.f.recordContext.hint":"About 80 characters each side of every replaced place, and where it was (a user message, a tool result and so on), are kept with the record, so you can tell what it was replaced in. The text is taken from what was sent, so masked values in it are placeholders; with personal data not masked, emails, phone numbers and the like appear in it as they are.","recent.contextHint":"The text around the place, as sent; masked values in it are placeholders","recent.elsewhere":"Also at {paths}","recent.elsewhereMore":"Also at {paths} ({n} more places not listed)","recent.elsewhereOmitted":"{n} more places not listed","recent.placeSep":", ","place.system":"System prompt","place.toolResult":"Tool result","place.toolCall":"Tool call","place.user":"User message","place.assistant":"Model reply","place.other":"Other","err.noConnection":"Not connected to dsh yet","err.malformed":"The plugin\u2019s host half answered in a form this page does not know; the host half and the page may be different versions","err.remote":"{message}","err.thrown":"{message}","err.noDisposer":"The view strip gave back no way to remove the registration","card.stale":"Refresh failed ({reason}). The figures below are the last ones read and may be out of date.","card.reason":"Reason: {reason}","recent.cell":"{name}: {value}","recent.cellSep":", ","view.unknown":"\u2039unknown placeholder\u203A","view.line":"Line","cfg.risk.send.title":"This change sends content to the model service as it is","cfg.risk.delete.title":"This change deletes data already kept","cfg.risk.log.title":"This change writes real values into the session log","cfg.risk.send.ack":"I understand this content goes to the model service as it is","cfg.risk.delete.ack":"I understand the deleted data cannot be recovered","cfg.risk.log.ack":"I understand the real values go into the session log and travel with its sync, backups, shares and exports","cfg.risk.confirm":"Change it","cfg.r.enabled":"Off, every session\u2019s model requests go to the model service as they are: secrets, credentials, personal data and your own words are no longer replaced, replies are not restored, and nothing is recorded.","cfg.r.secrets":"Off, API keys, tokens, passwords, private keys and cookies are no longer replaced and go to the model service as they are.","cfg.r.personal":"Off, emails, phone numbers, ID card and bank card numbers are no longer replaced and go to the model service as they are.","cfg.r.maskKeys":"Off, a key that reads like a secret or personal data is no longer replaced and goes to the model service as it is; the tool definitions and a tool call\u2019s argument names were never touched.","cfg.r.words":"The words taken out ({names}) are no longer masked: where a request has them, they go to the model service as they are.","cfg.r.allow":"The values added ({names}) are never masked from now on: where a request has them, they go to the model service as they are.","cfg.r.excludeProviders":"Requests from the providers newly checked ({names}) go out as they are, their replies are not restored, and nothing is recorded.","cfg.r.record":"Off, the records still waiting to be written are not written, and records from then on are counted in memory only and lost when dsh restarts.","cfg.r.keepDays":"Records are kept {to} days instead of {from}: the record files past that are deleted at the next write and cannot be recovered.","cfg.r.restoreLog":"On, a reply\u2019s placeholders become the real values before the session log is written: those values go into the log and travel with its sync, backups, shares and exports.","cfg.r.vendorView":"Off, the copies of what was sent kept in memory are cleared at once, and earlier records can no longer show what was sent."};var J="privacyGateway";var xt={zh:bt,en:vt};var T=require("@deepseek-ai/dsh-client-ui-primitives"),p=require("react");var x=require("@deepseek-ai/dsh-client-ui-primitives"),o=require("react");var ge=require("@deepseek-ai/dsh-client-ui-primitives"),b=require("react");function dn(e,t){if(!e)return t("view.unknown");let n=e.action?` \xB7 ${t(e.action==="warn"?"action.warn":"action.block")}`:"",a=pe(e);return`\u2039${e.kind} \xB7 ${a?`${a} \xB7 `:""}${e.len}${n}\u203A`}function _t(e,t,n,a){return e.parts.map((r,s)=>r.id===void 0?r.text:(0,b.createElement)("mark",{key:s,className:`pgw-view__mark${n?" pgw-view__mark--agent":""}`,title:r.id},n?dn(t.get(r.id),a):r.text))}function Nt(e){let{ctx:t,t:n,record:a}=e,[r,s]=(0,b.useState)({status:"loading"}),[i,l]=(0,b.useState)(!0);(0,b.useEffect)(()=>{let m=new AbortController;return s({status:"loading"}),ut(t,a.key,m.signal).then(A=>{m.signal.aborted||s(A.ok?A.value===null?{status:"gone"}:{status:"ready",body:A.value}:{status:"error",failure:A.failure})}),()=>m.abort()},[t,a.key]);let d=it(a.values),u=(0,b.useMemo)(()=>new Map(a.values.map(m=>[m.placeholder,m])),[a.key,d]),h=r.status==="ready"?r.body:void 0,_=(0,b.useMemo)(()=>h!==void 0?st(h):void 0,[h]),k=(0,b.useMemo)(()=>_?lt(_,[...u.keys()],i):void 0,[_,u,i]),y=(0,b.createElement)("div",{className:"pgw-head"},(0,b.createElement)("span",{className:"pgw-dist__title"},n("view.title")),(0,b.createElement)(ge.Checkbox,{checked:i,label:n("view.onlyChanged"),className:"pgw-meta",onChange:l}),(0,b.createElement)("span",{className:"pgw-spacer"}),(0,b.createElement)(ge.Button,{variant:"outline",size:"sm",onClick:e.onClose},n("view.close")));if(!k){let m=r.status==="loading"?n("view.loading"):r.status==="gone"?n("view.gone"):r.status==="error"?n("view.failed",{reason:Y(r.failure,n)}):n("card.unavailable");return(0,b.createElement)("div",{className:"pgw-view"},y,(0,b.createElement)("div",{className:"pgw-empty"},m))}return(0,b.createElement)("div",{className:"pgw-view"},y,k.lines.length===0?(0,b.createElement)("div",{className:"pgw-empty"},n("view.none")):(0,b.createElement)("div",{className:"pgw-view__scroll"},(0,b.createElement)("table",{className:"pgw-view__table"},(0,b.createElement)("thead",null,(0,b.createElement)("tr",null,(0,b.createElement)("th",null,n("view.line")),(0,b.createElement)("th",null,n("view.agent")),(0,b.createElement)("th",null,n("view.vendor")))),(0,b.createElement)("tbody",null,k.lines.map(m=>(0,b.createElement)("tr",{key:m.n},(0,b.createElement)("td",{className:"pgw-view__n"},m.n),(0,b.createElement)("td",{className:"pgw-view__code"},..._t(m,u,!0,n)),(0,b.createElement)("td",{className:"pgw-view__code"},..._t(m,u,!1,n))))))),k.truncated?(0,b.createElement)("div",{className:"pgw-meta"},n("view.truncated",{n:k.lines.length})):null)}function Rt(e){return e.items.length===0?null:(0,o.createElement)("div",{className:"pgw-notices",role:"status"},e.items.map(t=>(0,o.createElement)("div",{key:t.key,className:`pgw-notice pgw-notice--${t.tone}`},(0,o.createElement)(x.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,o.createElement)("span",null,e.t(t.key,{n:t.n})))))}function St(e){let{totals:t,t:n}=e,a=l=>(l??0).toLocaleString(),r=et(t),s=e.restoreLog===!1,i=[{label:n("stat.requests"),value:a(t.requests)},{label:n("stat.masked"),value:a(t.masked)},{label:n("stat.n"),value:a(t.n)},{label:n("stat.restored"),value:s?n("stat.restoreOff"):a(t.restored),...!s&&t.restoredInTools>0?{sub:n("stat.inTools",{n:t.restoredInTools})}:{}},{label:n("stat.unmapped"),value:s?n("stat.restoreOff"):a(t.unmapped),...!s&&t.unmapped>0?{tone:"warn"}:{}},{label:n("stat.failed"),value:a(t.failed),...t.failed>0?{tone:"error"}:{}}];return(t.warned??0)>0&&i.push({label:n("stat.warned"),value:a(t.warned),tone:"warn"}),(t.blocked??0)>0&&i.push({label:n("stat.blocked"),value:a(t.blocked),tone:"warn"}),(t.exfil??0)>0&&i.push({label:n("stat.exfil"),value:a(t.exfil),tone:"error",...(t.exfilBlocked??0)>0?{sub:n("stat.exfilBlocked",{n:t.exfilBlocked})}:{}}),t.requests>0&&i.push({label:n("stat.took"),value:n("stat.ms",{n:r.avg}),sub:n("stat.tookMax",{max:r.max})}),(0,o.createElement)("div",{className:"pgw-kpis"},i.map(l=>(0,o.createElement)("div",{key:l.label,className:`pgw-kpi${l.tone?` pgw-kpi--${l.tone}`:""}`},(0,o.createElement)("span",{className:"pgw-kpi__label"},l.label),(0,o.createElement)("span",{className:"pgw-kpi__value"},l.value),l.sub?(0,o.createElement)("span",{className:"pgw-kpi__sub"},l.sub):null)))}function Ee(e){let{t,field:n}=e;return(0,o.createElement)("div",{className:"pgw-hint"},(0,o.createElement)("div",{className:"pgw-hint__title"},t(n==="kind"?"hint.kind.title":"hint.finder.title")),(0,o.createElement)("div",{className:"pgw-hint__body"},t(n==="kind"?"hint.kind.body":"hint.finder.body")),e.note===!0?(0,o.createElement)("div",{className:"pgw-hint__note"},t("hint.count")):null)}function cn(e){return(0,o.createElement)("div",{className:"pgw-hint"},(0,o.createElement)("div",{className:"pgw-hint__title pgw-mono"},e.name),(0,o.createElement)("div",{className:"pgw-hint__body"},e.t(e.meaning)))}function me(e){let{t,field:n}=e,a=Je(e.data,6,e.others),r=n===void 0?e.title:(0,o.createElement)(x.HoverCard,{anchor:(0,o.createElement)("span",{className:"pgw-dist__anchor"},e.title,(0,o.createElement)(x.IconInfoOutlineRegular,{size:12,className:"pgw-dist__info"})),content:(0,o.createElement)(Ee,{t,field:n,note:!0})});return(0,o.createElement)("div",{className:"pgw-dist"},(0,o.createElement)("div",{className:"pgw-section__title"},r),a.length===0?(0,o.createElement)("div",{className:"pgw-empty"},e.empty):a.map(s=>{let i=n===void 0?void 0:(n==="kind"?Ue:Qe)(s.label),l=(0,o.createElement)("span",i===void 0?{className:"pgw-bar__label",title:s.label}:{className:"pgw-bar__label pgw-bar__label--hint"},s.label),d=i===void 0||n===void 0?l:(0,o.createElement)(x.HoverCard,{anchor:l,content:(0,o.createElement)(cn,{t,name:s.label,meaning:i})});return(0,o.createElement)("div",{className:"pgw-bar",key:s.label},(0,o.createElement)("div",{className:"pgw-bar__head"},d,(0,o.createElement)("span",{className:"pgw-bar__value"},s.value.toLocaleString())),(0,o.createElement)("div",{className:"pgw-bar__track"},(0,o.createElement)("div",{className:"pgw-bar__fill",style:{width:`${s.pct}%`}})))}))}function Tt(e){let{t}=e;return(0,o.createElement)("div",{className:"pgw-rec pgw-rec--head","aria-hidden":!0},(0,o.createElement)("span",null),(0,o.createElement)("span",null,t("recent.col.time")),(0,o.createElement)("span",{title:t("recent.stepHint")},t("recent.col.step")),(0,o.createElement)("span",null,t("recent.col.where")),(0,o.createElement)("span",null,t("recent.col.from")),(0,o.createElement)("span",{className:"pgw-rec__num",title:t("recent.placesHint")},t("recent.col.places")),(0,o.createElement)("span",{className:"pgw-rec__num",title:t("recent.restoredHint")},t("recent.col.restored")))}var Ie="*";function Ct(e){let{t,field:n}=e,[a,r]=(0,o.useState)(!1),s=t(n==="kind"?"col.kind":"col.finder"),i=[{id:Ie,label:t("filter.all")},...e.names.map(d=>({id:d,label:d}))],l=(0,o.createElement)("button",{type:"button",className:`pgw-filter${e.value===void 0?"":" pgw-filter--on"}`,"aria-haspopup":"menu","aria-expanded":a,"aria-label":t("filter.aria",{name:t(n==="kind"?"filter.kind":"filter.finder"),value:e.value??t("filter.all")}),onClick:()=>r(d=>!d)},e.value===void 0?s:`${s} \xB7 ${e.value}`,(0,o.createElement)(x.IconChevronDownOutlineRegular,{size:10,className:"pgw-filter__chevron"}));return(0,o.createElement)(x.Menu,{open:a,onClose:()=>r(!1),items:i,selectedId:e.value??Ie,onSelect:d=>{r(!1),e.onChange(d===Ie?void 0:d)},align:"start",portal:!0,anchor:(0,o.createElement)(x.HoverCard,{anchor:l,content:e.hint,disabled:a})})}function Ot(e){let{r:t,t:n}=e,[a,r]=(0,o.useState)(!1),[s,i]=(0,o.useState)(void 0),[l,d]=(0,o.useState)(void 0),u=Xe(t.values,{...s===void 0?{}:{kind:s},...l===void 0?{}:{finder:l}}),h=Se(t.values,"kind"),_=Se(t.values,"finder"),k=(0,o.useId)(),y=ce(t),m=y?n("recent.stepAt",y):"",A=y?n("recent.stepSent",y):"",E=[t.workspace,t.title??t.session].filter(f=>typeof f=="string"&&f!=="").join(" \xB7 "),V=t.failed?(0,o.createElement)(x.Tag,{tone:"danger"},n("recent.failed")):t.blocked?(0,o.createElement)(x.Tag,{tone:"danger"},n("recent.blocked")):(0,o.createElement)("span",{className:t.exfil?"pgw-rec__bad":void 0},t.n.toLocaleString()),$=t.failed?n("recent.failed"):t.blocked?n("recent.blocked"):t.n.toLocaleString(),D=[[n("recent.col.time"),Te(t.time)],[n("recent.col.step"),m],[n("recent.col.where"),[t.model??t.what,t.host].filter(Boolean).join(" \xB7 ")],[n("recent.col.from"),E],[n("recent.col.places"),$],[n("recent.col.restored"),t.unmapped>0?`${t.restored.toLocaleString()} (+${t.unmapped})`:t.restored.toLocaleString()]].filter(([,f])=>f!=="").map(([f,F])=>n("recent.cell",{name:f,value:F})).join(n("recent.cellSep"));return(0,o.createElement)("li",{className:"pgw-recs__item"},(0,o.createElement)("button",{type:"button",className:`pgw-rec${ot(t)?" pgw-rec--zero":""}${e.open?" pgw-rec--open":""}`,"aria-expanded":e.open,"aria-controls":e.open?k:void 0,"aria-label":D,onClick:e.toggle},(0,o.createElement)(x.IconChevronRightOutlineRegular,{size:12,className:"pgw-rec__chevron"}),(0,o.createElement)("span",{className:"pgw-rec__time"},Te(t.time)),(0,o.createElement)("span",{className:"pgw-rec__step",title:m||void 0},y?nt(y):""),(0,o.createElement)("span",{className:"pgw-rec__where",title:[t.model,t.host].filter(Boolean).join(" \xB7 ")},(0,o.createElement)("span",{className:"pgw-rec__model"},t.model??t.what),(0,o.createElement)("span",{className:"pgw-rec__host"},t.host)),(0,o.createElement)("span",{className:"pgw-rec__from",title:E},E),(0,o.createElement)("span",{className:"pgw-rec__num"},V),(0,o.createElement)("span",{className:"pgw-rec__num pgw-rec__dim"},t.restored.toLocaleString(),t.unmapped>0?(0,o.createElement)("span",{className:"pgw-rec__unknown",title:n("recent.unmapped",{n:t.unmapped})},` ?${t.unmapped}`):null)),e.open?(0,o.createElement)("div",{className:"pgw-detail",id:k},t.exfil?(0,o.createElement)("div",{className:"pgw-notice pgw-notice--error"},(0,o.createElement)(x.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),n("recent.exfil",{hosts:(t.exfilHosts??[]).join(", ")})):null,t.unmapped>0?(0,o.createElement)("div",{className:"pgw-notice pgw-notice--warn"},(0,o.createElement)(x.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,o.createElement)("span",null,n("recent.unmapped",{n:t.unmapped}))):null,y?(0,o.createElement)("div",{className:"pgw-meta"},A):null,t.values.length===0?(0,o.createElement)("div",{className:"pgw-empty"},n("recent.noValues")):(0,o.createElement)("table",{className:"pgw-values"},(0,o.createElement)("thead",null,(0,o.createElement)("tr",null,(0,o.createElement)("th",{key:"col.placeholder"},n("col.placeholder")),(0,o.createElement)("th",{key:"col.kind"},(0,o.createElement)(Ct,{t:n,field:"kind",names:h,value:s,hint:(0,o.createElement)(Ee,{t:n,field:"kind"}),onChange:i})),(0,o.createElement)("th",{key:"col.finder"},(0,o.createElement)(Ct,{t:n,field:"finder",names:_,value:l,hint:(0,o.createElement)(Ee,{t:n,field:"finder"}),onChange:d})),(0,o.createElement)("th",{key:"col.head"},n("col.head")),(0,o.createElement)("th",{key:"col.len"},n("col.len")),(0,o.createElement)("th",{key:"col.n"},n("col.n")),(0,o.createElement)("th",{key:"col.action"},n("col.action")))),(0,o.createElement)("tbody",null,u.length===0?(0,o.createElement)("tr",{key:"none",className:"pgw-values__empty"},(0,o.createElement)("td",{colSpan:7},n("filter.none"))):u.flatMap(f=>{let F=pt(f,n),B=f.first?n("recent.valueFirst",{turn:f.first.turn,step:f.first.step}):y?n("recent.valueFirstHere"):"",I=f.at!==void 0||f.before!==void 0||f.after!==void 0||F!==""||B!=="";return[(0,o.createElement)("tr",{key:f.placeholder,className:f.before!==void 0||f.after!==void 0?"pgw-values__has":void 0},(0,o.createElement)("td",{className:"pgw-mono"},f.placeholder),(0,o.createElement)("td",null,f.kind),(0,o.createElement)("td",null,f.finder),(0,o.createElement)("td",{className:"pgw-mono"},pe(f)),(0,o.createElement)("td",null,f.len),(0,o.createElement)("td",null,f.n),(0,o.createElement)("td",null,f.action?n(f.action==="warn"?"action.warn":"action.block"):"")),I?(0,o.createElement)("tr",{key:`${f.placeholder}:ctx`,className:"pgw-values__ctx"},(0,o.createElement)("td",{colSpan:7},(0,o.createElement)("div",{className:"pgw-ctx"},(0,o.createElement)("div",{className:"pgw-ctx__line"},f.at?(0,o.createElement)(x.Tag,{tone:"neutral",className:"pgw-ctx__place",title:f.at.path},n(ct(f.at)),(0,o.createElement)("span",{className:"pgw-ctx__path pgw-mono"},`\xB7 ${Oe(f.at.path)}`)):null,f.before!==void 0||f.after!==void 0?(0,o.createElement)("span",{className:"pgw-ctx__text",title:n("recent.contextHint")},f.before??"",(0,o.createElement)("mark",{className:"pgw-ctx__mark pgw-mono"},f.placeholder),f.after??""):null),F!==""?(0,o.createElement)("div",{className:"pgw-ctx__more"},F):null,B!==""?(0,o.createElement)("div",{className:"pgw-ctx__more"},B):null))):null]}))),t.valuesOmitted?(0,o.createElement)("div",{className:"pgw-meta"},n("recent.omitted",{n:t.valuesOmitted.toLocaleString()})):null,e.viewable&&!a?(0,o.createElement)("div",null,(0,o.createElement)(x.Button,{variant:"outline",size:"sm",onClick:()=>r(!0)},n("view.open"))):null,e.viewable&&a?(0,o.createElement)(Nt,{ctx:e.ctx,t:n,record:t,onClose:()=>r(!1)}):null):null)}function At(e){let{t}=e,[n,a]=(0,o.useState)(!1),[r,s]=(0,o.useState)(!1),[i,l]=(0,o.useState)(!1),d=()=>{a(!1),s(!1)},u=()=>{l(!0),ft(e.ctx).then(h=>{l(!1),d(),e.onDone(h.ok?t("card.resetDone",{n:h.value}):t("card.resetFailed",{message:Y(h.failure,t)}),h.ok)})};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(x.Button,{variant:"ghost",size:"sm",className:"pgw-reset",disabled:i,onClick:()=>a(!0)},(0,o.createElement)(x.IconTrashOutlineRegular,{size:14}),(0,o.createElement)("span",null,t("card.reset"))),(0,o.createElement)(x.RiskConfirmation,{open:n,title:t("card.resetTitle"),description:t("card.resetBody"),acknowledgeLabel:t("card.resetAck"),cancelLabel:t("card.cancel"),closeLabel:t("card.close"),confirmLabel:t("card.resetConfirm"),acknowledged:r,disabled:i,onAcknowledgedChange:s,onCancel:d,onConfirm:u}))}function It(e){let{t}=e,[n,a]=(0,o.useState)(e.on),[r,s]=(0,o.useState)(!1),[i,l]=(0,o.useState)(!1),[d,u]=(0,o.useState)(!1);(0,o.useEffect)(()=>a(e.on),[e.on]);let h=()=>{s(!1),l(!1)},_=k=>{u(!0),gt(e.ctx,e.session,k).then(y=>{u(!1),h(),y.ok&&a(y.value),e.onDone(y.ok?null:t("session.failed",{message:Y(y.failure,t)}))})};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("label",{className:"pgw-session"},(0,o.createElement)(x.Switch,{checked:n,label:t("session.mask"),disabled:d,onChange:k=>k?_(!0):s(!0)}),(0,o.createElement)("span",{className:"pgw-session__label"},t("session.mask"))),(0,o.createElement)(x.RiskConfirmation,{open:r,title:t("session.offTitle"),description:t("session.offBody"),acknowledgeLabel:t("session.offAck"),cancelLabel:t("card.cancel"),closeLabel:t("card.close"),confirmLabel:t("session.offConfirm"),acknowledged:i,disabled:d,onAcknowledgedChange:l,onCancel:h,onConfirm:()=>_(!1)}))}var O=require("react");function U(e,t,n,a){return(0,O.createElement)("text",{x:e,y:t,textAnchor:"middle",className:n},a)}function Et(e,t){return(0,O.createElement)("marker",{id:e,viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:6,markerHeight:6,orient:"auto-start-reverse"},(0,O.createElement)("path",{d:"M 0 0 L 10 5 L 0 10 z",className:t}))}function Pt(e){let{t}=e,n=(0,O.useId)().replace(/[^a-zA-Z0-9_-]/g,""),a=`pgw-diagram-out-${n}`,r=`pgw-diagram-back-${n}`;return(0,O.createElement)("div",{className:"pgw-diagram"},(0,O.createElement)("svg",{className:"pgw-diagram__svg",viewBox:"0 0 640 200",role:"img","aria-label":t("panel.diagramNote")},(0,O.createElement)("defs",null,Et(a,"pgw-diagram__head-out"),Et(r,"pgw-diagram__head-in")),(0,O.createElement)("rect",{x:8,y:68,width:140,height:64,rx:10,className:"pgw-diagram__box"}),(0,O.createElement)("rect",{x:228,y:52,width:184,height:96,rx:10,className:"pgw-diagram__gateway"}),(0,O.createElement)("rect",{x:492,y:68,width:140,height:64,rx:10,className:"pgw-diagram__vendor"}),U(78,104,"pgw-diagram__title",t("panel.diagramAgent")),U(320,94,"pgw-diagram__title",t("panel.diagramGateway")),U(320,112,"pgw-diagram__sub",t("panel.diagramGatewaySub")),U(562,104,"pgw-diagram__title",t("panel.diagramVendor")),(0,O.createElement)("path",{d:"M 148 84 L 228 84",className:"pgw-diagram__out",markerEnd:`url(#${a})`}),(0,O.createElement)("path",{d:"M 412 84 L 492 84",className:"pgw-diagram__out",markerEnd:`url(#${a})`}),(0,O.createElement)("path",{d:"M 492 116 L 412 116",className:"pgw-diagram__in",markerEnd:`url(#${r})`}),(0,O.createElement)("path",{d:"M 228 116 L 148 116",className:"pgw-diagram__in",markerEnd:`url(#${r})`}),U(188,75,"pgw-diagram__label",t("panel.diagramRequest")),U(452,75,"pgw-diagram__chip",t("panel.diagramPlaceholder")),U(452,129,"pgw-diagram__chip",t("panel.diagramPlaceholder")),U(188,129,"pgw-diagram__label",t("panel.diagramReply"))),(0,O.createElement)("p",{className:"pgw-diagram__note"},t("panel.diagramNote")),(0,O.createElement)("p",{className:"pgw-diagram__hint"},t("panel.empty")))}var pn=15e3,un=200,fn=10,gn=["today","week","month"];function mn(e,t){let[n,a]=(0,p.useState)({status:"loading"}),[r,s]=(0,p.useState)(!1),i=(0,p.useRef)(null),l=(0,p.useCallback)(()=>{i.current?.abort();let d=new AbortController;i.current=d,s(!0),ue(e,un,d.signal,t).then(u=>{d.signal.aborted||(s(!1),a(h=>rt(h,u)))})},[e,t]);return(0,p.useEffect)(()=>{l();let d=setInterval(()=>{(typeof document>"u"||document.visibilityState==="visible")&&l()},pn);return()=>{clearInterval(d),i.current?.abort()}},[l]),[n,l,r]}function he(e){return(0,p.createElement)(hn,{key:e.sessionId??"",...e})}function hn(e){let{t}=e,[n,a,r]=mn(e.ctx,e.sessionId),[s,i]=(0,p.useState)("today"),[l,d]=(0,p.useState)(null),[u,h]=(0,p.useState)(0),[_,k]=(0,p.useState)(null),y=`pgw-card${e.panel?" pgw-card--panel":""}`,m=n.status==="ready"?n.data:void 0,A=!e.panel&&m!==void 0,E=(0,p.createElement)("div",{className:"pgw-head"},(0,p.createElement)("div",{className:"pgw-head__main"},e.panel?null:(0,p.createElement)("h3",{className:"pgw-title"},t("card.title")),e.sessionId&&m&&typeof m.sessionMasking=="boolean"?(0,p.createElement)(It,{ctx:e.ctx,t,session:e.sessionId,on:m.sessionMasking,onDone:N=>{k(N===null?null:{text:N,ok:!1}),a()}}):null,m&&(!e.sessionId||!m.active)?(0,p.createElement)(T.Tag,{tone:m.active?"success":"warning"},t(m.active?"card.on":"card.off")):null,e.sessionId&&m&&m.sessionMasking===void 0?(0,p.createElement)(T.Tag,{tone:"outline"},t("panel.session")):null,m&&!e.panel?(0,p.createElement)("span",{className:"pgw-meta",title:t("card.valuesHint")},t("card.values",{n:m.values})):null,m&&!m.record?(0,p.createElement)("span",{className:"pgw-meta"},t("card.memoryOnly")):null),(0,p.createElement)("div",{className:"pgw-head__actions"},m?(0,p.createElement)(T.SegmentedControl,{id:`pgw-range-${e.sessionId??"all"}`,label:t("card.range"),value:s,options:gn.map(N=>({value:N,label:t(`range.${N}`)})),onChange:i}):null,(0,p.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:r,title:t("card.refresh"),"aria-label":t("card.refresh"),onClick:a},(0,p.createElement)(T.IconRefreshOutlineRegular,{size:14})),A?(0,p.createElement)(At,{ctx:e.ctx,t,onDone:(N,X)=>{k({text:N,ok:X}),d(null),h(0),a()}}):null)),V=_?(0,p.createElement)("div",{className:`pgw-flash${_.ok?"":" pgw-flash--error"}`,role:"status"},_.text):null,$=n.status==="ready"&&n.stale?(0,p.createElement)("div",{className:"pgw-notice pgw-notice--error",role:"status"},(0,p.createElement)(T.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,p.createElement)("span",null,t("card.stale",{reason:Y(n.stale,t)}))):null,D=e.sessionId&&m?.sessionMasking===!1?(0,p.createElement)("div",{className:"pgw-notice",role:"status"},(0,p.createElement)(T.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,p.createElement)("span",null,t("session.offNotice"))):null;if(!m){let N=n.status==="error"?`${t("card.unavailable")} ${t("card.reason",{reason:Y(n.failure,t)})}`:t("card.loading");return(0,p.createElement)("section",{className:y},E,(0,p.createElement)("div",{className:"pgw-empty pgw-empty--block"},N))}if(e.sessionId&&m.recent.length===0)return(0,p.createElement)("section",{className:y},E,$,V,D,(0,p.createElement)("div",{className:"pgw-empty pgw-empty--block pgw-empty--diagram"},(0,p.createElement)(Pt,{t})));let f=m,F=f.stats[s],B=new Set(f.vendorView?f.views??[]:[]),I=dt(f.recent,u,fn),H=N=>{h(N),d(null)};return(0,p.createElement)("section",{className:y},E,$,V,D,(0,p.createElement)(Rt,{t,items:Ze(f,F)}),(0,p.createElement)(St,{totals:F,t,...typeof f.restoreLog=="boolean"?{restoreLog:f.restoreLog}:{}}),(0,p.createElement)("div",{className:"pgw-dists"},(0,p.createElement)(me,{t,title:t("dist.kind"),data:F.kinds,others:t("dist.others.kind"),empty:t("dist.empty"),field:"kind"}),(0,p.createElement)(me,{t,title:t("dist.finder"),data:F.finders,others:t("dist.others.finder"),empty:t("dist.empty"),field:"finder"}),(0,p.createElement)(me,{t,title:t("dist.host"),data:F.hosts,others:t("dist.others.host"),empty:t("dist.empty")})),(0,p.createElement)("div",{className:"pgw-section"},(0,p.createElement)("div",{className:"pgw-section__head"},(0,p.createElement)("span",{className:"pgw-section__title"},t("recent.title")),f.recent.length>0?(0,p.createElement)("span",{className:"pgw-meta"},t("recent.count",{n:f.recent.length})):null),f.recent.length===0?(0,p.createElement)("div",{className:"pgw-empty pgw-empty--block"},t("recent.empty")):(0,p.createElement)("div",{className:"pgw-recs"},(0,p.createElement)(Tt,{t}),(0,p.createElement)("ul",{className:"pgw-recs__list","aria-label":t("recent.title")},I.items.map(N=>(0,p.createElement)(Ot,{key:N.key,ctx:e.ctx,r:N,open:l===N.key,toggle:()=>d(l===N.key?null:N.key),t,viewable:B.has(N.key)})))),I.pages>1?(0,p.createElement)("div",{className:"pgw-pager"},(0,p.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:I.page===0,onClick:()=>H(0)},t("page.first")),(0,p.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:I.page===0,"aria-label":t("page.prev"),title:t("page.prev"),onClick:()=>H(I.page-1)},(0,p.createElement)(T.IconChevronLeftOutlineRegular,{size:14})),(0,p.createElement)("span",{className:"pgw-meta pgw-pager__at"},t("page.at",{page:I.page+1,pages:I.pages})),(0,p.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:I.page>=I.pages-1,"aria-label":t("page.next"),title:t("page.next"),onClick:()=>H(I.page+1)},(0,p.createElement)(T.IconChevronRightOutlineRegular,{size:14}))):null))}var wn="dsh-privacy-gateway",ee=fe(void 0);function Lt(e,t){return e.code==="noDisposer"?t("err.noDisposer"):t("err.thrown",{message:e.message})}function Ft(e,t){ee.set(void 0);let n;try{let a=e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:wn,order:35,locale:J,label:()=>t("panel.tab")},r=>(0,Mt.createElement)(he,{ctx:e,t,panel:!0,...r?.sessionId?{sessionId:r.sessionId}:{}})));if(typeof a!="function"){ee.set({code:"noDisposer"});return}n=a}catch(a){ee.set({code:"thrown",message:a instanceof Error?a.message:String(a)});return}return()=>{let a=n;n=void 0;try{a?.()}catch{}}}var we=class{waiting=[];current;failed=!1;send;onState;constructor(t,n=()=>{}){this.send=t,this.onState=n}get state(){return{busy:this.current!==void 0||this.waiting.length>0,failed:this.failed}}latest(t,n){for(let a=this.waiting.length-1;a>=0;a--)if(this.waiting[a]?.path===t)return this.waiting[a]?.value;return this.current?.path===t?this.current.value:n}write(t,n){return new Promise(a=>{let r=this.waiting.find(s=>s.path===t);r?(r.value=n,r.done.push(a)):this.waiting.push({path:t,value:n,done:[a]}),this.failed=!1,this.notify(),this.current||this.drain()})}async drain(){let t=!1;for(;this.waiting.length>0;){let n=this.waiting.shift();this.current=n;let a;try{a=await this.send(n.path,n.value,t)}catch{a=!1}this.current=void 0,t=!0;for(let r of n.done)r(a);if(!a){this.failed=!0;for(let r of this.waiting.splice(0))for(let s of r.done)s(!1)}this.notify()}}notify(){this.onState(this.state)}};function yn(){let[,e]=(0,g.useState)(0),t=(0,g.useSyncExternalStore)(Q.subscribe,Q.get),n=(0,g.useMemo)(()=>{try{return t?.describe()}catch{return}},[t]);(0,g.useEffect)(()=>{if(n)return Promise.resolve(n.ensure()).catch(()=>{}),n.subscribe(()=>e(l=>l+1))},[n]);let a=n?.getSnapshot().view,r=(0,g.useMemo)(()=>a?Ae(a.namespaces):void 0,[a]),s=(0,g.useMemo)(()=>{try{return t&&r!==void 0?t.get(r):void 0}catch{return}},[t,r]);(0,g.useEffect)(()=>s?s.subscribe(()=>e(l=>l+1)):void 0,[s]);let i=s?.getSnapshot();return(0,g.useMemo)(()=>{if(!s||!i)return;let l=s.mutate,d=l?(u,h)=>l.call(s,u,h):async u=>{for(let h of u)if(!await s.set(h.path.join("."),h.value))return!1;return!0};return{state:{status:i.status,value:i.value,revision:i.revision,writable:i.writable!==!1},mutate:d}},[s,i])}var Kt="dsh-privacy-gateway.config.open",kn=["mask"];function bn(){try{let e=JSON.parse(globalThis.localStorage?.getItem(Kt)??"null");if(Array.isArray(e))return ie.filter(t=>e.includes(t))}catch{}return[...kn]}function vn(e){try{globalThis.localStorage?.setItem(Kt,JSON.stringify(e))}catch{}}var j=e=>e;function Pe(e){let{ctx:t,t:n}=e,a=yn(),r=e.form??a,s=(0,g.useRef)(r);s.current=r;let[i,l]=(0,g.useState)({busy:!1,failed:!1}),[d]=(0,g.useState)(()=>new we((c,v,C)=>{let S=s.current;return S?S.mutate([{op:"set",path:[c],value:v}],C?void 0:S.state.revision):Promise.resolve(!1)},l)),[u,h]=(0,g.useState)(null),[_,k]=(0,g.useState)(!1),y=(0,g.useSyncExternalStore)(ee.subscribe,ee.get),m=(0,g.useId)(),[A,E]=(0,g.useState)(null),[V,$]=(0,g.useState)(!1),[D,f]=(0,g.useState)(0),[F,B]=(0,g.useState)(bn),I=c=>B(v=>{let C=v.includes(c)?v.filter(S=>S!==c):ie.filter(S=>S===c||v.includes(S));return vn(C),C}),H=r?.state,N=H?.status==="ready",X=H?.writable!==!1,se=H?.value??{},z=c=>d.latest(c,se[c]);if((0,g.useEffect)(()=>{let c=new AbortController;return mt(t,c.signal).then(v=>{c.signal.aborted||($(!v.ok),E(v.ok?v.value:[]))}),()=>c.abort()},[t,D]),!r)return(0,g.createElement)("div",{className:"pgw-empty"},n("cfg.unavailable"));let te=N?null:(0,g.createElement)("div",{className:"pgw-cfg__desc",role:"status"},n("cfg.loading")),K=!N||!X,zt=c=>A?.find(v=>v.id.toLowerCase()===c.toLowerCase())?.name??c,ne=(c,v)=>{if(K)return Promise.resolve(!1);let C=Ke(c,z(c.key),v);return C?new Promise(S=>{k(!1),h(G=>(G?.resolve(!1),{f:c,next:v,change:C,resolve:S}))}):d.write(c.key,v)},Le=c=>{let v=u;h(null),k(!1),v&&(c?d.write(v.f.key,v.next).then(v.resolve):v.resolve(!1))},Bt=c=>{let v=n(j(`cfg.f.${c.key}`));switch(c.kind){case"switch":return(0,g.createElement)(je,{label:v,checked:ae(z(c.key),c.default),disabled:K,onChange:C=>{ne(c,C)}});case"choice":{let C=_e(z(c.key),c.choices,c.default);return(0,g.createElement)(Ne,{label:n(j(`cfg.f.${c.key}.${C}`)),labelledBy:`${m}${c.key}`,items:c.choices.map(S=>({id:S,label:n(j(`cfg.f.${c.key}.${S}`))})),selectedId:C,disabled:K,onSelect:S=>{S!==C&&ne(c,S)}})}case"list":return(0,g.createElement)(qe,{t:n,label:v,list:W(z(c.key),c.default),anyCase:c.anyCase,placeholder:n(j(`cfg.f.${c.key}.placeholder`)),disabled:K,onChange:C=>ne(c,C)});case"count":return(0,g.createElement)(Ye,{t:n,value:re(z(c.key),c.min,c.default),min:c.min,label:v,disabled:K,onChange:C=>ne(c,C)});case"providers":return Ht(c)}},Ht=c=>{let v=W(z(c.key),[]),C=yt(A??[],v),S=C.filter(P=>P.excluded).map(P=>P.name),G=He(S,n("cfg.sep")),xe=G.kind==="none"?n("cfg.excludedNone"):G.kind==="some"?G.names:n("cfg.excludedMany",{names:G.names,n:G.n});return(0,g.createElement)(Ne,{label:xe,labelledBy:`${m}${c.key}`,multi:!0,items:C.map(P=>({id:P.id,label:P.registered?P.name:n("cfg.providerAbsent",{name:P.name})})),selectedIds:C.filter(P=>P.excluded).map(P=>P.id),disabled:K,onSelect:P=>{ne(c,kt(W(z(c.key),[]),P))}})},Fe=c=>{if(c.key==="showPanel"&&y)return(0,g.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.sidebarFailed",{reason:Lt(y,n)}));if(c.key==="excludeProviders"&&V)return(0,g.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.providerListUnavailable")," ",(0,g.createElement)(ye.Button,{variant:"outline",size:"sm",onClick:()=>f(v=>v+1)},n("cfg.retry")))},Gt=Object.fromEntries(le.map(c=>[c.key,z(c.key)])),Wt=c=>{let v=le.filter(M=>M.group===c),C=n(j(`cfg.g.${c}`)),S=F.includes(c),G=Ve(c,Gt),xe=v.some(M=>Fe(M)!==void 0),P=N?[...G.map((M,jt)=>(0,g.createElement)("span",{key:jt,className:M.off?"pgw-fold__part pgw-fold__part--off":"pgw-fold__part"},n(j(M.key),M.params))),xe?(0,g.createElement)("span",{key:"problem",className:"pgw-fold__part pgw-fold__part--error"},n("cfg.s.problem")):null]:null;return(0,g.createElement)(We,{key:c,title:C,summary:P,open:S,toggleLabel:n(S?"cfg.collapse":"cfg.expand",{name:C}),onToggle:()=>I(c)},v.map(M=>(0,g.createElement)(Ge,{key:M.key,title:n(j(`cfg.f.${M.key}`)),titleId:`${m}${M.key}`,hint:n(j(`cfg.f.${M.key}.hint`)),note:Fe(M),inline:De(M),half:M.half===!0},Bt(M))))},ve=u?xn(u,n,u.f.key==="excludeProviders"?zt:c=>c):null;return(0,g.createElement)(g.Fragment,null,(0,g.createElement)("section",{className:"pgw-cfg","aria-busy":i.busy||void 0},e.form?null:(0,g.createElement)("h3",{className:"pgw-title"},n("cfg.title")),i.failed?(0,g.createElement)("div",{className:"pgw-notice pgw-notice--error",role:"alert"},n("cfg.failed")):null,te,(0,g.createElement)("div",{className:"pgw-cfg__folds"},ie.map(Wt)),(0,g.createElement)("p",{className:"pgw-cfg__desc pgw-cfg__foot"},n("cfg.applies")," ",n("cfg.others"))),(0,g.createElement)(ye.RiskConfirmation,{open:u!==null,title:ve?.title??"",description:ve?.body??"",acknowledgeLabel:ve?.ack??"",cancelLabel:n("card.cancel"),closeLabel:n("card.close"),confirmLabel:n("cfg.risk.confirm"),acknowledged:_,onAcknowledgedChange:k,onCancel:()=>Le(!1),onConfirm:()=>Le(!0)}))}function xn(e,t,n){let{change:a}=e,r={},s=a.added??a.removed;return s&&(r.names=s.map(n).join(t("cfg.sep"))),a.from!==void 0&&(r.from=a.from),a.to!==void 0&&(r.to=a.to),{title:t(a.risk==="send"?"cfg.risk.send.title":a.risk==="delete"?"cfg.risk.delete.title":"cfg.risk.log.title"),body:t(j(`cfg.r.${e.f.key}`),r),ack:t(a.risk==="send"?"cfg.risk.send.ack":a.risk==="delete"?"cfg.risk.delete.ack":"cfg.risk.log.ack")}}var ke="dsh-privacy-gateway",Dt="dsh-privacy-gateway";var Me="var(--ds-font-family-code,ui-monospace,monospace)",_n=`
4
+ `)}function it(e){return e.map(t=>t.placeholder).join("\0")}function lt(e,t,n,a=400){let r=[...new Set(t.filter(d=>d!==""))].sort((d,u)=>u.length-d.length),s=r.length>0?new RegExp(r.map(en).join("|"),"g"):void 0,i=[],l=!1;for(let d=0;d<e.length;d++){let u=e[d],h=[],_=0;if(s)for(let k of u.matchAll(s))k.index>_&&h.push({text:u.slice(_,k.index)}),h.push({text:k[0],id:k[0]}),_=k.index+k[0].length;if(!(n&&_===0)){if((_<u.length||h.length===0)&&h.push({text:u.slice(_)}),i.length>=a){l=!0;break}i.push({n:d+1,parts:h})}}return{lines:i,truncated:l}}function dt(e,t,n){let a=Math.max(1,Math.ceil(e.length/n)),r=Math.min(Math.max(0,Math.floor(t)),a-1);return{items:e.slice(r*n,r*n+n),page:r,pages:a}}function ct(e){let{path:t,role:n,type:a}=e,r=t.split(".")[0]??"";return n==="system"||n==="developer"||r==="system"||r==="instructions"||r==="systemInstruction"?"place.system":n==="tool"||a==="tool_result"||a==="function_call_output"||a==="functionResponse"?"place.toolResult":a==="tool_use"||a==="function_call"||/(^|\.)(tool_calls|function_call)(\.|$)/.test(t)||t.endsWith(".arguments")?"place.toolCall":n==="user"?"place.user":n==="assistant"||n==="model"?"place.assistant":"place.other"}function Oe(e){let t=e.split("."),n=t[0]??"",a=t[1]??"";return n!==""&&/^\d+$/.test(a)?`${n}.${a}`:n}function pt(e,t){let n=[...new Set((e.elsewhere??[]).map(r=>Oe(r.path)))].filter(r=>r!=="").join(t("recent.placeSep")),a=e.elsewhereOmitted??0;return n===""?a>0?t("recent.elsewhereOmitted",{n:a}):"":a>0?t("recent.elsewhereMore",{paths:n,n:a}):t("recent.elsewhere",{paths:n})}function pe(e){return e.head?e.tail?`${e.head}\u2026${e.tail}`:`${e.head}\u2026`:""}function Y(e,t){return t({noConnection:"err.noConnection",malformed:"err.malformed",remote:"err.remote",thrown:"err.thrown"}[e.code],"message"in e?{message:e.message}:void 0)}async function oe(e,t,n,a,r){let s;try{s=e.get("connection")?.rpc}catch{s=void 0}if(!s||typeof s.call!="function")return{ok:!1,failure:{code:"noConnection"}};try{let i=n===void 0?{}:{request:n},l=await s.call("/api",`privacyGateway/${t}`,{args:i},r);if(l?.ok!==!0){let u=l?.error?.message;return{ok:!1,failure:typeof u=="string"&&u!==""?{code:"remote",message:u}:{code:"malformed"}}}let d=a(l.value);return d===void 0?{ok:!1,failure:{code:"malformed"}}:{ok:!0,value:d}}catch(i){return{ok:!1,failure:{code:"thrown",message:i instanceof Error?i.message:String(i)}}}}function ue(e,t,n,a){return oe(e,"overview",a?{limit:t,session:a}:{limit:t},at,n)}function ut(e,t,n){return oe(e,"vendorView",{key:t},a=>{if(a===null)return null;let r=a?.body;return typeof r=="string"?r:void 0},n)}function ft(e){return oe(e,"reset",void 0,t=>{let n=t?.files;return typeof n=="number"?n:0})}function gt(e,t,n){return oe(e,"sessionMasking",{session:t,on:n},a=>{let r=a?.on;return typeof r=="boolean"?r:void 0})}function mt(e,t){return oe(e,"providers",void 0,n=>Array.isArray(n)?n.flatMap(tn):void 0,t)}function tn(e){let t=e;return t!==null&&typeof t=="object"&&typeof t.id=="string"&&t.id!==""?[{id:t.id,name:typeof t.name=="string"&&t.name!==""?t.name:t.id}]:[]}function fe(e){let t=e,n=new Set;return{get:()=>t,set(a){if(!Object.is(a,t)){t=a;for(let r of[...n])try{r()}catch{}}},subscribe(a){return n.add(a),()=>{n.delete(a)}}}}var nn="Show the Privacy tab at the top of the session";function an(e){let t=e,n=t?.refs,r=(n!==null&&typeof n=="object"&&typeof t?.uid<"u"?n[String(t.uid)]:void 0)?.dict??t?.dict;return r!==null&&typeof r=="object"?Object.keys(r):[]}function Ae(e){for(let t of e){let n=an(t.schema);if(n.includes("showPanel")&&(t.ns.includes("privacy-gateway")||n.includes("excludeProviders")||JSON.stringify(t.schema??null).includes(nn)))return t.ns}}function rn(e){let t=Ae(e);if(t===void 0)return;let n=e.find(a=>a.ns===t)?.value;return typeof n=="object"&&n!==null&&n.showPanel===!0}function on(e){let t=e;return t!=null&&typeof t.describe=="function"&&typeof t.get=="function"?t:void 0}var Q=fe(void 0);function ht(e){let t=n=>n.effect(()=>{let a;try{a=on(n.get("configForms"))}catch{a=void 0}return Q.set(a),()=>{Q.get()===a&&Q.set(void 0)}},"dsh-privacy-gateway: settings service");typeof e.inject=="function"?e.inject(["configForms"],t):t(e)}var sn=6e4;function ln(e,t){return t===void 0?e:t||e===!0?!0:e===!1?!1:void 0}function wt(e,t,n=Q){let a=!1,r,s,i,l=()=>{if(a)return;let y=ln(s,i);y===void 0||y===r||(r=y,t(y))},d=()=>{ue(e,1).then(y=>{a||!y.ok||(s=y.value.showPanel===!0,l())})},u,h=y=>{try{u?.()}catch{}u=void 0,i=void 0;let m;try{m=y?.describe()}catch{m=void 0}if(m){let A=m,E=()=>{if(a)return;let V=A.getSnapshot().view;if(!V)return;let $=rn(V.namespaces);$!==void 0&&(i=$,l())};u=A.subscribe(E),Promise.resolve(A.ensure()).then(E,E),E()}l()},_=n.subscribe(()=>h(n.get()));h(n.get()),d();let k=setInterval(d,sn);return()=>{a=!0,clearInterval(k),_();try{u?.()}catch{}}}function yt(e,t){let n=r=>t.some(s=>s.toLowerCase()===r.toLowerCase()),a=e.map(r=>({id:r.id,name:r.name,excluded:n(r.id),registered:!0}));for(let r of t)a.some(s=>s.id.toLowerCase()===r.toLowerCase())||a.push({id:r,name:r,excluded:!0,registered:!1});return a}function kt(e,t){let n=t.toLowerCase();return e.some(a=>a.toLowerCase()===n)?e.filter(a=>a.toLowerCase()!==n):[...e,t]}var Mt=require("react");var bt={"card.title":"\u8131\u654F\u7EDF\u8BA1","card.on":"\u8131\u654F\u5F00\u542F","card.off":"\u8131\u654F\u5DF2\u5173\u95ED","card.refresh":"\u5237\u65B0","card.loading":"\u6B63\u5728\u8BFB\u53D6\u2026","card.unavailable":"\u8BFB\u4E0D\u5230\u7EDF\u8BA1\uFF1A\u63D2\u4EF6\u7684 host \u7AEF\u6CA1\u6709\u8FD0\u884C\uFF0C\u6216\u9700\u8981\u91CD\u542F dsh\u3002","card.memoryOnly":"\u8BB0\u5F55\u53EA\u5728\u5185\u5B58\uFF08record \u5DF2\u5173\u95ED\uFF09","card.values":"\u5185\u5B58\u91CC\u53EF\u8FD8\u539F\u7684\u503C {n} \u4E2A","card.range":"\u7EDF\u8BA1\u8303\u56F4","card.reset":"\u6E05\u7A7A\u6570\u636E","card.resetTitle":"\u6E05\u7A7A\u9690\u79C1\u4FDD\u62A4\u7684\u5386\u53F2\u6570\u636E\uFF1F","card.resetBody":"\u4F1A\u5220\u9664\u6240\u6709\u4F1A\u8BDD\u7684\u8131\u654F\u8BB0\u5F55\u548C\u7EDF\u8BA1\uFF0C\u5305\u62EC\u78C1\u76D8\u4E0A\u672C\u5B9E\u4F8B\u72B6\u6001\u76EE\u5F55\u91CC masking/ \u4E0B\u7684\u8BB0\u5F55\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5185\u5B58\u91CC\u4FDD\u7559\u7684\u53D1\u51FA\u5185\u5BB9\u526F\u672C\u3002\u6E05\u7A7A\u540E\u65E0\u6CD5\u6062\u590D\u3002\u8131\u654F\u89C4\u5219\u3001\u914D\u7F6E\u548C\u6B63\u5728\u8FDB\u884C\u7684\u8BF7\u6C42\u4E0D\u53D7\u5F71\u54CD\u3002","card.resetAck":"\u6211\u77E5\u9053\u6E05\u7A7A\u540E\u65E0\u6CD5\u6062\u590D","card.resetConfirm":"\u6E05\u7A7A","card.cancel":"\u53D6\u6D88","card.close":"\u5173\u95ED","card.resetDone":"\u5DF2\u6E05\u7A7A\uFF0C\u5220\u9664\u4E86 {n} \u4E2A\u8BB0\u5F55\u6587\u4EF6\u3002","card.resetFailed":"\u6CA1\u80FD\u6E05\u7A7A\uFF1A{message}","stat.took":"\u5E73\u5747\u8017\u65F6","stat.tookMax":"\u6700\u957F {max} ms","stat.ms":"{n} ms","recent.count":"\u6700\u8FD1 {n} \u6761","recent.col.time":"\u65F6\u95F4","recent.col.step":"\u8F6E\xB7\u6B65","recent.stepHint":"\u8FD9\u6B21\u8BF7\u6C42\u5728\u7B2C\u51E0\u8F6E\u7B2C\u51E0\u6B65\u53D1\u51FA\uFF0C\u7F16\u53F7\u4E0E\u300C\u8F68\u8FF9\u300D\u6807\u7B7E\u9875\u4E00\u81F4\u3002\u6CE8\u610F\u8BB0\u7684\u662F\u300C\u53D1\u51FA\u300D\u7684\u90A3\u4E00\u6B65\uFF1A\u67D0\u4E00\u6B65\u7684\u8F93\u51FA\u8981\u5230\u4E0B\u4E00\u6B65\u7684\u8BF7\u6C42\u91CC\u624D\u53D1\u51FA\u53BB\uFF0C\u6240\u4EE5\u6309\u503C\u5728\u8F68\u8FF9\u91CC\u641C\u5230\u7684\u5F80\u5F80\u662F\u66F4\u65E9\u4E00\u6B65","recent.stepAt":"\u7B2C {turn} \u8F6E \xB7 \u7B2C {step} \u6B65\u53D1\u51FA","recent.stepSent":"\u8FD9\u6B21\u8BF7\u6C42\u5728\u7B2C {turn} \u8F6E \xB7 \u7B2C {step} \u6B65\u53D1\u51FA\uFF1B\u503C\u672C\u8EAB\u53EF\u80FD\u6765\u81EA\u66F4\u65E9\u7684\u67D0\u4E00\u6B65\uFF08\u770B\u5B83\u4E0B\u9762\u7684\u4F4D\u7F6E\uFF09","recent.valueFirst":"\u503C\u9996\u6B21\u88AB\u53D1\u51FA\uFF1A\u7B2C {turn} \u8F6E \xB7 \u7B2C {step} \u6B65","recent.valueFirstHere":"\u672C\u6B21\u8FD0\u884C\u5185\u9996\u6B21\u88AB\u53D1\u51FA","recent.col.where":"\u6A21\u578B / host","recent.col.from":"\u6765\u6E90","recent.col.places":"\u66FF\u6362","recent.col.restored":"\u8FD8\u539F","page.at":"{page} / {pages}","range.today":"\u4ECA\u65E5","range.week":"7 \u5929","range.month":"30 \u5929","stat.requests":"\u8BB0\u5F55\u7684\u8BF7\u6C42","stat.masked":"\u6709\u8131\u654F","stat.n":"\u66FF\u6362\u5904","stat.restored":"\u8FD8\u539F\u5904","stat.restoreOff":"\u5DF2\u5173\u95ED","stat.inTools":"\u5176\u4E2D\u5DE5\u5177\u53C2\u6570 {n}","stat.unmapped":"\u672A\u77E5\u5360\u4F4D\u7B26","stat.failed":"\u8131\u654F\u5931\u8D25","dist.kind":"\u6309 kind","dist.finder":"\u6309 finder","dist.host":"\u6309 host","dist.empty":"\u6682\u65E0","dist.others.kind":"\u5176\u4F59 kind","dist.others.finder":"\u5176\u4F59 finder","dist.others.host":"\u5176\u4F59 host","hint.kind.title":"kind\uFF1A\u503C\u7684\u7C7B\u522B","hint.kind.body":"\u89C4\u5219\u6216\u8BCD\u8868\u8BA4\u51FA\u503C\u540E\u5B9A\u7684\u7C7B\u522B\uFF1B\u5360\u4F4D\u7B26\u6309\u5B83\u547D\u540D\uFF0C\u52A8\u4F5C\u4E5F\u6309 kind \u914D\u7F6E\u3002","hint.finder.title":"finder\uFF1A\u8C01\u627E\u5230\u7684","hint.finder.body":"\u8FD9\u6761\u503C\u7531\u8C01\u627E\u5230\uFF1A\u5185\u7F6E\u89C4\u5219\u3001\u81EA\u5B9A\u4E49\u8BCD\u3001\u4E4B\u524D\u8131\u654F\u8FC7\u7684\u503C\u6216 cookie\u3002","hint.count":"\u6570\u5B57\u662F\u66FF\u6362\u5904\u6570\uFF0C\u4E0D\u662F\u8BF7\u6C42\u6570\uFF1Bwarn / block \u4E0D\u8BA1\u5165\u3002","hint.kind.SECRET":"\u5176\u5B83\u5BC6\u94A5\u7C7B\u5B57\u6BB5\uFF1Asecret / token / key=\u2026\uFF0C\u4EE5\u53CA\u4E2D\u6587\u300C\u5BC6\u94A5\u662F\u2026\u300D","hint.kind.PASSWORD":"\u5BC6\u7801\uFF1AURL \u91CC\u7684\u51ED\u636E\u3001password=\u2026 \u5B57\u6BB5\u3001\u4E2D\u6587\u300C\u5BC6\u7801\u4E3A\u2026\u300D","hint.kind.API_KEY":"\u5404\u5E73\u53F0\u7684\u5BC6\u94A5\uFF1AOpenAI / Anthropic sk-\u2026\u3001GitHub \u4EE4\u724C\u3001AWS AKIA\u2026\u3001Google AIza\u2026 \u7B49","hint.kind.TOKEN":"JWT\uFF08eyJ\u2026 \u4E09\u6BB5\u70B9\u5206\uFF09\uFF0C\u4EE5\u53CA Authorization \u5934\u91CC Bearer / Token \u540E\u9762\u7684\u4EE4\u724C","hint.kind.PRIVATE_KEY":"PEM \u79C1\u94A5\u5757","hint.kind.COOKIE":"Cookie \u5934\u3001curl -b\u3001cookies.txt \u91CC\u7684\u4F1A\u8BDD\u503C\uFF08BDUSS\u3001JSESSIONID \u7B49\uFF09","hint.kind.EMAIL":"\u90AE\u7BB1\u5730\u5740","hint.kind.PHONE":"\u5927\u9646\u624B\u673A\u53F7","hint.kind.ID_CARD":"\u8EAB\u4EFD\u8BC1\u53F7\uFF08\u6821\u9A8C\u4F4D\u6709\u6548\uFF09","hint.kind.BANK_CARD":"\u94F6\u884C\u5361\u53F7\uFF08Luhn \u6821\u9A8C\uFF09","hint.kind.TERM":"\u914D\u7F6E words \u91CC\u5217\u51FA\u7684\u81EA\u5B9A\u4E49\u654F\u611F\u8BCD","hint.finder.rule":"\u5185\u7F6E\u6B63\u5219\u89C4\u5219\u8BA4\u51FA\u7684\u503C\uFF1A\u5404\u7C7B\u5BC6\u94A5\u3001\u5BC6\u7801\u3001\u4E2A\u4EBA\u4FE1\u606F","hint.finder.word":"\u914D\u7F6E words \u91CC\u5217\u51FA\u7684\u8BCD","hint.finder.known":"\u672C\u6B21\u8FD0\u884C\u91CC\u5DF2\u7ECF\u8131\u654F\u8FC7\u7684\u503C\u53C8\u5728\u8BF7\u6C42\u522B\u5904\u51FA\u73B0\uFF08\u91CD\u53D1\u7684\u5386\u53F2\u591A\u8D70\u8FD9\u6761\uFF09","hint.finder.cookie":"\u6309 Cookie \u5934\u3001curl -b\u3001cookies.txt \u6216 cookie \u540D\u8BA4\u51FA\u7684\u4F1A\u8BDD\u503C","filter.kind":"\u6309 kind \u7B5B\u9009","filter.finder":"\u6309 finder \u7B5B\u9009","filter.all":"\u5168\u90E8","filter.none":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u7684\u503C\u3002","filter.aria":"{name}\uFF1A{value}","warn.streak":"\u8FDE\u7EED {n} \u6B21\u8131\u654F\u5931\u8D25\uFF0C\u8BF7\u6C42\u672A\u53D1\u51FA\u3002\u7528 /privacy off \u6B62\u8840\u3002","warn.unmapped":"\u56DE\u590D\u91CC\u6709 {n} \u4E2A\u503C\u8868\u91CC\u6CA1\u6709\u7684\u5360\u4F4D\u7B26\uFF0C\u53EF\u80FD\u88AB\u6A21\u578B\u6539\u574F\u4E86\u3002","warn.inTools":"\u6709 {n} \u5904\u8FD8\u539F\u843D\u5728\u5DE5\u5177\u8C03\u7528\u53C2\u6570\u91CC\uFF0C\u5DE5\u5177\u6267\u884C\u65F6\u771F\u503C\u4F1A\u88AB\u7528\u5230\uFF1B\u5982\u679C\u4E0D\u662F\u4F60\u9884\u671F\u7684\uFF0C\u68C0\u67E5\u6700\u8FD1\u7684\u5DE5\u5177\u8C03\u7528\u3002","recent.title":"\u6700\u8FD1\u8BB0\u5F55","recent.empty":"\u8FD8\u6CA1\u6709\u8BB0\u5F55\u3002","recent.failed":"\u5931\u8D25","col.placeholder":"\u5360\u4F4D\u7B26","col.kind":"kind","col.finder":"finder","col.head":"\u5F00\u5934","recent.placesHint":"\u8BF7\u6C42\u91CC\u88AB\u6362\u6210\u5360\u4F4D\u7B26\u7684\u5904\u6570\uFF08\u4E0D\u662F\u53D1\u51FA\u53BB\u7684\u503C\u7684\u6570\u91CF\uFF09","recent.restoredHint":"\u56DE\u590D\u91CC\u51FA\u73B0\u5360\u4F4D\u7B26\u3001\u88AB\u6362\u56DE\u771F\u503C\u7684\u5904\u6570\uFF1B\u6A21\u578B\u4E0D\u5FC5\u590D\u8FF0\u6BCF\u4E2A\u503C\uFF0C\u6240\u4EE5\u4E24\u8005\u901A\u5E38\u4E0D\u76F8\u7B49","col.len":"\u957F\u5EA6","col.n":"\u6B21\u6570","recent.noValues":"\u8FD9\u6B21\u8BF7\u6C42\u6CA1\u6709\u8131\u654F\u3002","recent.unmapped":"\u56DE\u590D\u91CC\u6709 {n} \u4E2A\u503C\u8868\u91CC\u6CA1\u6709\u7684\u5360\u4F4D\u7B26\uFF1A\u53EF\u80FD\u662F\u6A21\u578B\u628A\u5360\u4F4D\u7B26\u6539\u574F\u4E86\uFF0C\u4E5F\u53EF\u80FD\u5B83\u5728\u590D\u8FF0\u793A\u4F8B\u6216\u91CD\u542F\u524D\u7684\u503C\u3002","recent.omitted":"\u53E6\u6709 {n} \u4E2A\u503C\u8D85\u51FA\u5355\u6761\u8BB0\u5F55\u7684\u4E0A\u9650\uFF0C\u6CA1\u6709\u5217\u51FA\u3002","stat.warned":"warn \u7167\u53D1","stat.blocked":"block \u62E6\u4E0B","stat.exfil":"\u5916\u5E26\u5DE5\u5177\u8C03\u7528","stat.exfilBlocked":"\u5176\u4E2D {n} \u5904\u672A\u8FD8\u539F","warn.exfil":"\u6709 {n} \u6B21\u5DE5\u5177\u8C03\u7528\u628A\u8FD8\u539F\u51FA\u7684\u503C\u5199\u8FDB\u4E86\u6307\u5411\u672C\u673A\u4EE5\u5916 host \u7684\u53C2\u6570\uFF0C\u5C55\u5F00\u6700\u8FD1\u8BB0\u5F55\u67E5\u770B host\u3002","recent.blocked":"\u5DF2\u62E6\u4E0B","recent.exfil":"\u5916\u5E26\uFF1A{hosts}","col.action":"\u52A8\u4F5C","action.warn":"warn \u7167\u53D1","action.block":"block \u62E6\u4E0B","view.open":"\u67E5\u770B\u53D1\u51FA\u5185\u5BB9","view.title":"\u8FD9\u6B21\u8BF7\u6C42\u5B9E\u9645\u53D1\u51FA\u7684\u5185\u5BB9","view.agent":"\u66FF\u6362\u5904\u6807\u6CE8\uFF08kind \xB7 \u5F00\u5934 \xB7 \u957F\u5EA6\uFF09","view.vendor":"\u6A21\u578B\u670D\u52A1\u6536\u5230\u7684\u5185\u5BB9\uFF08\u5360\u4F4D\u7B26\u5DF2\u66FF\u6362\uFF09","view.onlyChanged":"\u53EA\u770B\u6709\u66FF\u6362\u7684\u884C","view.loading":"\u6B63\u5728\u8BFB\u53D6\u2026","view.gone":"\u8FD9\u4EFD\u526F\u672C\u5DF2\u4E0D\u5728\u5185\u5B58\u91CC\uFF1A\u8D85\u51FA\u4E86\u4FDD\u7559\u4E0A\u9650\uFF0C\u6216 dsh \u5DF2\u91CD\u542F\u3002","view.failed":"\u8BFB\u4E0D\u5230\u8FD9\u4EFD\u526F\u672C\uFF1A{reason}","view.truncated":"\u53EA\u663E\u793A\u524D {n} \u884C\u3002","view.none":"\u6CA1\u6709\u6709\u66FF\u6362\u7684\u884C\u3002","view.close":"\u6536\u8D77","panel.tab":"\u9690\u79C1\u4FDD\u62A4","panel.session":"\u672C\u4F1A\u8BDD","panel.empty":"\u672C\u4F1A\u8BDD\u8FD8\u6CA1\u6709\u8BB0\u5F55\u3002\u53EA\u6709\u53D1\u751F\u8131\u654F\u6216\u8FD8\u539F\u7684\u6A21\u578B\u8BF7\u6C42\u624D\u4F1A\u7559\u4E0B\u8BB0\u5F55\u3002","panel.diagramAgent":"agent / adapter","panel.diagramGateway":"\u9690\u79C1\u7F51\u5173","panel.diagramGatewaySub":"\u8131\u654F \xB7 \u8FD8\u539F","panel.diagramVendor":"\u6A21\u578B\u670D\u52A1","panel.diagramRequest":"\u2460 \u8BF7\u6C42","panel.diagramReply":"\u2461 \u56DE\u590D","panel.diagramPlaceholder":"\u5360\u4F4D\u7B26","panel.diagramNote":"\u5BC6\u94A5\u3001\u51ED\u636E\u3001\u4E2A\u4EBA\u4FE1\u606F\u5728\u79BB\u5F00\u672C\u673A\u524D\u6362\u6210\u5360\u4F4D\u7B26\uFF1B\u56DE\u590D\u9ED8\u8BA4\u4E0D\u8FD8\u539F\uFF0C\u5360\u4F4D\u7B26\u539F\u6837\u8FDB\u4F1A\u8BDD\u65E5\u5FD7\u3002","page.first":"\u9996\u9875","page.prev":"\u4E0A\u4E00\u9875","page.next":"\u4E0B\u4E00\u9875","cfg.title":"\u914D\u7F6E","cfg.f.showPanel":"\u5728\u4F1A\u8BDD\u9876\u90E8\u663E\u793A\u300C\u9690\u79C1\u4FDD\u62A4\u300D\u6807\u7B7E\u9875","cfg.f.showPanel.hint":"\u6253\u5F00\u540E\uFF0C\u5BF9\u8BDD / \u8F68\u8FF9 \u65C1\u8FB9\u591A\u4E00\u4E2A\u300C\u9690\u79C1\u4FDD\u62A4\u300D\uFF0C\u5185\u5BB9\u662F\u672C\u4F1A\u8BDD\u7684\u8131\u654F\u8BB0\u5F55\u4E0E\u7EDF\u8BA1\u3002","cfg.unavailable":"\u8BFB\u4E0D\u5230\u8BBE\u7F6E\uFF1A\u5BBF\u4E3B\u6CA1\u6709\u63D0\u4F9B\u8BBE\u7F6E\u670D\u52A1\uFF0C\u6216\u63D2\u4EF6\u7684 host \u7AEF\u8FD8\u6CA1\u52A0\u8F7D\u65B0\u7248\u672C\u3002","cfg.loading":"\u6B63\u5728\u8BFB\u53D6\u5F53\u524D\u914D\u7F6E\u2026","cfg.retry":"\u91CD\u8BD5","cfg.failed":"\u6CA1\u80FD\u4FDD\u5B58\uFF0C\u8BF7\u91CD\u8BD5\u3002","cfg.sidebarFailed":"\u6807\u7B7E\u9875\u6CE8\u518C\u5931\u8D25\uFF1A{reason}","cfg.f.excludeProviders":"\u4E0D\u8131\u654F\u7684 provider","cfg.excludedNone":"\u4E0D\u9009\uFF1A\u5168\u90E8\u8131\u654F","cfg.sep":"\u3001","cfg.excludedMany":"{names} \u7B49 {n} \u4E2A","cfg.providerListUnavailable":"\u8BFB\u4E0D\u5230 provider \u5217\u8868\uFF1A\u5BBF\u4E3B\u6CA1\u6709\u6CE8\u518C\u4EFB\u4F55 provider\uFF0C\u6216\u8FD9\u6B21\u8C03\u7528\u5931\u8D25\u3002","cfg.remove":"\u79FB\u9664 {name}","cfg.f.excludeProviders.hint":"\u52FE\u9009\u7684 provider \u53D1\u51FA\u7684\u8BF7\u6C42\u539F\u6837\u9001\u51FA\uFF0C\u56DE\u590D\u4E5F\u4E0D\u8FD8\u539F\uFF0C\u4E0D\u7559\u8BB0\u5F55\uFF1B\u6709\u8BF7\u6C42\u53D1\u51FA\u65F6\uFF0C\u65E5\u5FD7\u91CC\u6BCF\u4E2A provider \u63D0\u793A\u4E00\u6B21\u3002\u6539\u52A8\u4ECE\u4E0B\u4E00\u6B21\u6A21\u578B\u8C03\u7528\u8D77\u751F\u6548\u3002","cfg.providerAbsent":"{name}\uFF08\u5F53\u524D\u672A\u6CE8\u518C\uFF09","cfg.add":"\u6DFB\u52A0","cfg.listEmpty":"\u8FD8\u6CA1\u6709","cfg.countInvalid":"\u8981\u586B\u4E0D\u5C0F\u4E8E {min} \u7684\u6574\u6570\u3002","cfg.applies":"\u6539\u52A8\u5373\u65F6\u4FDD\u5B58\uFF0C\u4ECE\u4E0B\u4E00\u6B21\u6A21\u578B\u8C03\u7528\u8D77\u751F\u6548\uFF0C\u4E0D\u7528\u91CD\u542F\u3002","cfg.others":"\u5176\u4F59\u914D\u7F6E\u9879\uFF08actions\u3001cookieNames\u3001excludeHosts\u3001maxValues \u7B49\uFF09\u5728 cordis.patch.yml \u91CC\u4FEE\u6539\uFF0C\u8BF4\u660E\u89C1 README\u3002","cfg.g.mask":"\u8131\u654F","cfg.g.lists":"\u8BCD\u8868","cfg.g.record":"\u8BB0\u5F55","cfg.g.view":"\u6807\u7B7E\u9875\u4E0E provider","cfg.f.enabled":"\u542F\u7528\u8131\u654F","cfg.f.enabled.hint":"\u603B\u5F00\u5173\u3002\u5173\u6389\u540E\u7F51\u5173\u4E0D\u518D\u6539\u5199\u8BF7\u6C42\uFF0C\u7EDF\u8BA1\u4E0E\u8BB0\u5F55\u4E5F\u505C\u4E0B\u3002","cfg.f.secrets":"\u8131\u654F\u5BC6\u94A5\u4E0E\u51ED\u636E","cfg.f.secrets.hint":"API key\u3001\u4EE4\u724C\u3001\u5BC6\u7801\u3001\u79C1\u94A5\u3001cookie\u3002","cfg.f.personal":"\u8131\u654F\u4E2A\u4EBA\u4FE1\u606F","cfg.f.personal.hint":"\u90AE\u7BB1\u3001\u5927\u9646\u624B\u673A\u53F7\u3001\u8EAB\u4EFD\u8BC1\u53F7\u3001\u94F6\u884C\u5361\u53F7\u3002","cfg.f.shape":"\u5BC6\u94A5\u6362\u6210\u540C\u5F62\u5047 key","cfg.f.shape.hint":"\u524D\u7F00\u3001\u957F\u5EA6\u3001\u5B57\u7B26\u7C7B\u522B\u4E0D\u53D8\uFF0C\u4EE3\u66FF \u27E6DSH_REDACTED:\u2026\u27E7 \u5360\u4F4D\u7B26\uFF1B\u4E0D\u8DB3 8 \u5B57\u7B26\u6216\u542B\u7279\u6B8A\u5B57\u7B26\u7684\u503C\u4ECD\u7528\u5360\u4F4D\u7B26\u3002restoreLog \u6253\u5F00\u65F6\uFF0C\u56DE\u590D\u91CC\u7684\u5047 key \u7167\u6837\u6362\u56DE\u771F\u503C\u3002","cfg.f.maskKeys":"JSON \u952E\u4E5F\u8131\u654F","cfg.f.maskKeys.hint":'\u8BF7\u6C42 body \u91CC\u8BFB\u8D77\u6765\u50CF\u5BC6\u94A5\u6216\u4E2A\u4EBA\u4FE1\u606F\u7684\u952E\u540D\uFF08\u4F8B\u5982 {"sk-\u2026": \u2026}\uFF09\u548C\u503C\u4E00\u6837\u6362\u6210\u5360\u4F4D\u7B26\uFF1BrestoreLog \u6253\u5F00\u65F6\uFF0C\u56DE\u590D\u91CC\u518D\u6362\u56DE\u6765\u3002\u534F\u8BAE\u81EA\u8EAB\u7684\u952E\uFF08model\u3001role\u3001type\u3001name \u7B49\uFF09\u3001\u5DE5\u5177\u5B9A\u4E49\u4EE5\u53CA\u5DE5\u5177\u8C03\u7528\u7684\u53C2\u6570\u540D\u4E0D\u52A8\uFF0C\u5426\u5219\u4F9B\u5E94\u5546\u8BFB\u4E0D\u61C2\u8FD9\u4EFD\u8BF7\u6C42\u3002',"cfg.f.toolGuard":"\u5DE5\u5177\u8C03\u7528\u5916\u53D1\u4FDD\u62A4","cfg.f.toolGuard.hint":"\u5DE5\u5177\u8C03\u7528\u7684\u53C2\u6570\u91CC\u8FD8\u539F\u51FA\u4E86\u503C\u3001\u53C8\u6307\u5411\u672C\u673A\u4EE5\u5916\u7684 host \u65F6\u600E\u4E48\u5904\u7406\u3002\u53EA\u6709 restoreLog \u6253\u5F00\u65F6\u624D\u53EF\u80FD\u6709\u8FD8\u539F\u503C\uFF0C\u5173\u95ED\u65F6\u5B83\u4E0D\u4F1A\u751F\u6548\u3002","cfg.f.toolGuard.off":"\u53EA\u8BA1\u6570","cfg.f.toolGuard.warn":"\u544A\u8B66\u5E76\u8BB0\u5F55","cfg.f.toolGuard.block":"\u4E0D\u8FD8\u539F","cfg.f.restoreLog":"\u4F1A\u8BDD\u65E5\u5FD7\u5199\u5165\u771F\u503C","cfg.f.restoreLog.hint":"\u5173\u95ED\uFF08\u9ED8\u8BA4\uFF09\u65F6\uFF0C\u56DE\u590D\u91CC\u7684\u5360\u4F4D\u7B26\u539F\u6837\u5199\u8FDB\u4F1A\u8BDD\u65E5\u5FD7\uFF0C\u660E\u6587\u4E0D\u8FDB\u65E5\u5FD7\uFF0Cagent \u62FF\u5230\u7684\u4E5F\u662F\u5360\u4F4D\u7B26\uFF1B\u6253\u5F00\u540E\u5360\u4F4D\u7B26\u5728\u843D\u76D8\u524D\u6362\u56DE\u771F\u503C\uFF0Cagent \u4E0E\u65E5\u5FD7\u90FD\u62FF\u5230\u771F\u503C\u2014\u2014\u56DE\u590D\u65B9\u5411\u53EA\u6709\u8FD9\u4E00\u4E2A\u8FD8\u539F\u70B9\uFF0C\u4E24\u8FB9\u5FC5\u7136\u4E00\u81F4\u3002\u6253\u5F00\u540E\u4F1A\u8BDD\u540C\u6B65\u3001\u5907\u4EFD\u3001\u5206\u4EAB\u3001\u5BFC\u51FA\u4F1A\u5E26\u8D70\u771F\u503C\uFF0C\u6240\u4EE5\u6253\u5F00\u524D\u8981\u786E\u8BA4\u3002","cfg.f.words":"\u81EA\u5B9A\u4E49\u654F\u611F\u8BCD","cfg.f.words.hint":"\u9879\u76EE\u4EE3\u53F7\u3001\u5BA2\u6237\u540D\u7B49\uFF0C\u6309\u539F\u6837\u6362\u6210 TERM \u5360\u4F4D\u7B26\u3002\u56DE\u8F66\u6216\u70B9\u300C\u6DFB\u52A0\u300D\u52A0\u5165\u3002","cfg.f.words.placeholder":"\u8F93\u5165\u4E00\u4E2A\u8BCD","cfg.f.allow":"\u6C38\u4E0D\u8131\u654F\u7684\u503C","cfg.f.allow.hint":"\u6574\u503C\u5339\u914D\uFF0C\u4E0D\u5206\u5927\u5C0F\u5199\uFF0C\u54EA\u6761\u89C4\u5219\u627E\u5230\u90FD\u4E0D\u6362\u3002","cfg.f.allow.placeholder":"\u8F93\u5165\u4E00\u4E2A\u503C","cfg.f.record":"\u8BB0\u5F55\u5199\u76D8","cfg.f.record.hint":"\u5199\u5230\u672C\u5B9E\u4F8B\u72B6\u6001\u76EE\u5F55\u7684 masking/ \u4E0B\uFF08\u6BCF\u4E2A\u5B9E\u4F8B\u4E00\u4E2A\u76EE\u5F55\uFF09\uFF0C\u53EA\u8BB0\u5143\u4FE1\u606F\u3001\u4E0D\u8BB0\u503C\u672C\u8EAB\uFF1B\u5173\u6389\u53EA\u5728\u5185\u5B58\u91CC\u7EDF\u8BA1\u3002","cfg.f.keepDays":"\u8BB0\u5F55\u4FDD\u7559\u5929\u6570","cfg.f.keepDays.hint":"\u8D85\u8FC7\u7684\u6309\u5929\u5220\u9664\uFF0C\u81F3\u5C11 1 \u5929\u3002","cfg.f.vendorView":"\u4FDD\u7559\u53D1\u51FA\u5185\u5BB9\uFF0C\u4F9B\u5BF9\u7167\u67E5\u770B","cfg.f.vendorView.hint":"\u5F00\u542F\u540E\uFF0C\u4E4B\u540E\u7684\u8BB0\u5F55\u591A\u4E00\u4E2A\u300C\u67E5\u770B\u53D1\u51FA\u5185\u5BB9\u300D\u6309\u94AE\uFF0C\u53EF\u4EE5\u6838\u5BF9\u6A21\u578B\u670D\u52A1\u5B9E\u9645\u6536\u5230\u4E86\u4EC0\u4E48\u3001\u6709\u6CA1\u6709\u6F0F\u8131\u654F\u3002\u526F\u672C\u5DF2\u8131\u654F\uFF0C\u4E0D\u542B\u771F\u503C\uFF1B\u53EA\u5B58\u5728\u5185\u5B58\u91CC\uFF0C\u6700\u591A 100 \u4EFD\u3001\u5171 64 MiB\uFF0C\u91CD\u542F\u5373\u6E05\u7A7A\u3002\u526F\u672C\u542B\u5B8C\u6574\u7684\u63D0\u793A\u8BCD\u548C\u5BF9\u8BDD\uFF0C\u5E73\u65F6\u4E0D\u5FC5\u5F00\u3002","cfg.expand":"\u5C55\u5F00\u300C{name}\u300D","cfg.collapse":"\u6536\u8D77\u300C{name}\u300D","cfg.s.maskOff":"\u5DF2\u5173\u95ED\uFF0C\u8BF7\u6C42\u539F\u6837\u53D1\u51FA","cfg.s.maskNothing":"\u6CA1\u6709\u9009\u8131\u654F\u7C7B\u578B","cfg.s.maskKeysOnly":"\u53EA\u8131\u654F\u952E\u540D","cfg.s.secrets":"\u5BC6\u94A5\u4E0E\u51ED\u636E","cfg.s.personal":"\u4E2A\u4EBA\u4FE1\u606F","cfg.s.shape":"\u540C\u5F62\u5047 key","cfg.s.toolGuard.off":"\u5916\u53D1\u4FDD\u62A4\uFF1A\u53EA\u8BA1\u6570","cfg.s.toolGuard.warn":"\u5916\u53D1\u4FDD\u62A4\uFF1A\u544A\u8B66","cfg.s.toolGuard.block":"\u5916\u53D1\u4FDD\u62A4\uFF1A\u4E0D\u8FD8\u539F","cfg.s.restoreLog":"\u65E5\u5FD7\u5199\u771F\u503C","cfg.s.words":"\u654F\u611F\u8BCD {n} \u4E2A","cfg.s.allow":"\u653E\u884C {n} \u4E2A","cfg.s.record":"\u5199\u76D8\uFF0C\u4FDD\u7559 {n} \u5929","cfg.s.recordOff":"\u53EA\u5728\u5185\u5B58","cfg.s.vendorView":"\u4FDD\u7559\u53D1\u51FA\u5185\u5BB9","cfg.s.panel":"\u663E\u793A\u6807\u7B7E\u9875","cfg.s.panelOff":"\u4E0D\u663E\u793A\u6807\u7B7E\u9875","cfg.s.providersAll":"\u5168\u90E8 provider \u8131\u654F","cfg.s.providersSome":"{n} \u4E2A provider \u4E0D\u8131\u654F","cfg.s.problem":"\u6709\u63D0\u793A\uFF0C\u5C55\u5F00\u67E5\u770B","card.valuesHint":"\u88AB\u6362\u4E0B\u6765\u7684\u539F\u503C\u53EA\u5B58\u5728\u5185\u5B58\u91CC\uFF0CrestoreLog \u6253\u5F00\u65F6\u7528\u6765\u628A\u6A21\u578B\u56DE\u590D\u91CC\u7684\u5360\u4F4D\u7B26\u6362\u56DE\u539F\u503C\u3002\u6240\u6709\u4F1A\u8BDD\u5171\u7528\uFF0C\u91CD\u542F dsh \u540E\u6E05\u7A7A\u3002","session.mask":"\u672C\u4F1A\u8BDD\u8131\u654F","session.offTitle":"\u5173\u95ED\u672C\u4F1A\u8BDD\u7684\u8131\u654F\uFF1F","session.offBody":"\u5173\u95ED\u540E\uFF0C\u672C\u4F1A\u8BDD\u4E4B\u540E\u7684\u6A21\u578B\u8BF7\u6C42\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\uFF1A\u5BC6\u94A5\u3001\u51ED\u636E\u3001\u4E2A\u4EBA\u4FE1\u606F\u548C\u81EA\u5B9A\u4E49\u654F\u611F\u8BCD\u90FD\u4E0D\u518D\u66FF\u6362\uFF0C\u56DE\u590D\u4E0D\u518D\u8FD8\u539F\uFF0C\u4E5F\u4E0D\u7559\u8BB0\u5F55\u3002\u5176\u4ED6\u4F1A\u8BDD\u4E0D\u53D7\u5F71\u54CD\uFF0C\u968F\u65F6\u53EF\u4EE5\u5728\u8FD9\u91CC\u91CD\u65B0\u6253\u5F00\u3002","session.offAck":"\u6211\u77E5\u9053\u672C\u4F1A\u8BDD\u7684\u5185\u5BB9\u4F1A\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1","session.offConfirm":"\u5173\u95ED\u8131\u654F","session.offNotice":"\u672C\u4F1A\u8BDD\u5DF2\u5173\u95ED\u8131\u654F\uFF1A\u8BF7\u6C42\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\uFF0C\u4E0D\u7559\u8BB0\u5F55\u3002","session.failed":"\u6CA1\u80FD\u5207\u6362\uFF1A{message}","cfg.f.recordContext":"\u8BB0\u5F55\u66FF\u6362\u5904\u7684\u4E0A\u4E0B\u6587","cfg.f.recordContext.hint":"\u6BCF\u4E2A\u66FF\u6362\u5904\u524D\u540E\u5404\u7EA6 80 \u4E2A\u5B57\u7B26\u548C\u5B83\u6240\u5728\u7684\u4F4D\u7F6E\uFF08\u7528\u6237\u6D88\u606F\u3001\u5DE5\u5177\u7ED3\u679C\u7B49\uFF09\u4E00\u8D77\u8BB0\u4E0B\uFF0C\u65B9\u4FBF\u786E\u8BA4\u662F\u5728\u4EC0\u4E48\u573A\u5408\u66FF\u6362\u7684\u3002\u8FD9\u6BB5\u6587\u5B57\u53D6\u81EA\u53D1\u51FA\u7684\u5185\u5BB9\uFF0C\u91CC\u9762\u88AB\u8131\u654F\u7684\u503C\u90FD\u5DF2\u662F\u5360\u4F4D\u7B26\uFF1B\u6CA1\u5F00\u4E2A\u4EBA\u4FE1\u606F\u8131\u654F\u65F6\uFF0C\u90AE\u7BB1\u3001\u624B\u673A\u53F7\u7B49\u4F1A\u539F\u6837\u51FA\u73B0\u5728\u8FD9\u6BB5\u6587\u5B57\u91CC\u3002","recent.contextHint":"\u66FF\u6362\u5904\u524D\u540E\u7684\u6587\u5B57\uFF0C\u53D6\u81EA\u53D1\u51FA\u7684\u5185\u5BB9\uFF0C\u88AB\u8131\u654F\u7684\u503C\u90FD\u662F\u5360\u4F4D\u7B26","recent.elsewhere":"\u8FD8\u51FA\u73B0\u5728 {paths}","recent.elsewhereMore":"\u8FD8\u51FA\u73B0\u5728 {paths}\uFF08\u53E6\u6709 {n} \u5904\u6CA1\u5217\u51FA\uFF09","recent.elsewhereOmitted":"\u53E6\u6709 {n} \u5904\u6CA1\u5217\u51FA","recent.placeSep":"\u3001","place.system":"\u7CFB\u7EDF\u63D0\u793A","place.toolResult":"\u5DE5\u5177\u7ED3\u679C","place.toolCall":"\u5DE5\u5177\u8C03\u7528","place.user":"\u7528\u6237\u6D88\u606F","place.assistant":"\u6A21\u578B\u56DE\u590D","place.other":"\u5176\u4ED6","err.noConnection":"\u8FD8\u6CA1\u6709\u8FDE\u4E0A dsh","err.malformed":"\u63D2\u4EF6 host \u7AEF\u7684\u56DE\u7B54\u683C\u5F0F\u4E0D\u5BF9\uFF0Chost \u7AEF\u548C\u9875\u9762\u53EF\u80FD\u4E0D\u662F\u540C\u4E00\u7248\u672C","err.remote":"{message}","err.thrown":"{message}","err.noDisposer":"\u4F1A\u8BDD\u89C6\u56FE\u6761\u6CA1\u6709\u4EA4\u56DE\u64A4\u9500\u6CE8\u518C\u7684\u51FD\u6570","card.stale":"\u5237\u65B0\u5931\u8D25\uFF08{reason}\uFF09\u3002\u4E0B\u9762\u662F\u4E0A\u6B21\u8BFB\u5230\u7684\u6570\u636E\uFF0C\u53EF\u80FD\u5DF2\u8FC7\u671F\u3002","card.reason":"\u539F\u56E0\uFF1A{reason}","recent.cell":"{name}\uFF1A{value}","recent.cellSep":"\uFF0C","view.unknown":"\u2039\u672A\u77E5\u5360\u4F4D\u7B26\u203A","view.line":"\u884C","cfg.risk.send.title":"\u8FD9\u9879\u6539\u52A8\u4F1A\u8BA9\u5185\u5BB9\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1","cfg.risk.delete.title":"\u8FD9\u9879\u6539\u52A8\u4F1A\u5220\u9664\u5DF2\u6709\u6570\u636E","cfg.risk.log.title":"\u8FD9\u9879\u6539\u52A8\u4F1A\u8BA9\u771F\u503C\u5199\u8FDB\u4F1A\u8BDD\u65E5\u5FD7","cfg.risk.send.ack":"\u6211\u77E5\u9053\u76F8\u5173\u5185\u5BB9\u4F1A\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1","cfg.risk.delete.ack":"\u6211\u77E5\u9053\u5220\u9664\u7684\u6570\u636E\u65E0\u6CD5\u6062\u590D","cfg.risk.log.ack":"\u6211\u77E5\u9053\u771F\u503C\u4F1A\u5199\u8FDB\u4F1A\u8BDD\u65E5\u5FD7\uFF0C\u5E76\u968F\u540C\u6B65\u3001\u5907\u4EFD\u3001\u5206\u4EAB\u3001\u5BFC\u51FA\u5E26\u8D70","cfg.risk.confirm":"\u786E\u8BA4\u4FEE\u6539","cfg.r.enabled":"\u5173\u95ED\u540E\uFF0C\u6240\u6709\u4F1A\u8BDD\u7684\u6A21\u578B\u8BF7\u6C42\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\uFF1A\u5BC6\u94A5\u3001\u51ED\u636E\u3001\u4E2A\u4EBA\u4FE1\u606F\u548C\u81EA\u5B9A\u4E49\u654F\u611F\u8BCD\u90FD\u4E0D\u518D\u66FF\u6362\uFF0C\u56DE\u590D\u4E0D\u518D\u8FD8\u539F\uFF0C\u4E5F\u4E0D\u7559\u8BB0\u5F55\u3002","cfg.r.secrets":"\u5173\u95ED\u540E\uFF0CAPI key\u3001\u4EE4\u724C\u3001\u5BC6\u7801\u3001\u79C1\u94A5\u548C cookie \u4E0D\u518D\u66FF\u6362\uFF0C\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\u3002","cfg.r.personal":"\u5173\u95ED\u540E\uFF0C\u90AE\u7BB1\u3001\u624B\u673A\u53F7\u3001\u8EAB\u4EFD\u8BC1\u53F7\u548C\u94F6\u884C\u5361\u53F7\u4E0D\u518D\u66FF\u6362\uFF0C\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\u3002","cfg.r.maskKeys":"\u5173\u95ED\u540E\uFF0C\u8BF7\u6C42\u91CC\u8BFB\u8D77\u6765\u50CF\u5BC6\u94A5\u6216\u4E2A\u4EBA\u4FE1\u606F\u7684\u952E\u540D\u4E0D\u518D\u66FF\u6362\uFF0C\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\uFF1B\u5DE5\u5177\u5B9A\u4E49\u548C\u5DE5\u5177\u53C2\u6570\u540D\u672C\u6765\u5C31\u4E0D\u52A8\u3002","cfg.r.words":"\u53BB\u6389\u7684\u654F\u611F\u8BCD\uFF08{names}\uFF09\u4EE5\u540E\u4E0D\u518D\u8131\u654F\uFF0C\u51FA\u73B0\u5728\u8BF7\u6C42\u91CC\u65F6\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\u3002","cfg.r.allow":"\u65B0\u52A0\u7684\u503C\uFF08{names}\uFF09\u4EE5\u540E\u4E0D\u518D\u8131\u654F\uFF0C\u51FA\u73B0\u5728\u8BF7\u6C42\u91CC\u65F6\u539F\u6837\u53D1\u7ED9\u6A21\u578B\u670D\u52A1\u3002","cfg.r.excludeProviders":"\u65B0\u52FE\u9009\u7684 provider\uFF08{names}\uFF09\u53D1\u51FA\u7684\u8BF7\u6C42\u539F\u6837\u9001\u51FA\uFF0C\u56DE\u590D\u4E0D\u8FD8\u539F\uFF0C\u4E5F\u4E0D\u7559\u8BB0\u5F55\u3002","cfg.r.record":"\u5173\u95ED\u540E\uFF0C\u6392\u961F\u7B49\u5F85\u5199\u76D8\u7684\u8BB0\u5F55\u4E0D\u518D\u5199\u5165\uFF0C\u4E4B\u540E\u7684\u8BB0\u5F55\u53EA\u5728\u5185\u5B58\u91CC\u7EDF\u8BA1\uFF0C\u91CD\u542F dsh \u540E\u4E22\u5931\u3002","cfg.r.keepDays":"\u4FDD\u7559\u5929\u6570\u4ECE {from} \u5929\u6539\u4E3A {to} \u5929\uFF0C\u4E0B\u6B21\u5199\u76D8\u65F6\u8D85\u51FA\u7684\u8BB0\u5F55\u6587\u4EF6\u4F1A\u88AB\u5220\u9664\uFF0C\u65E0\u6CD5\u6062\u590D\u3002","cfg.r.restoreLog":"\u6253\u5F00\u540E\uFF0C\u56DE\u590D\u91CC\u7684\u5360\u4F4D\u7B26\u5728\u5199\u5165\u4F1A\u8BDD\u65E5\u5FD7\u524D\u6362\u56DE\u771F\u503C\uFF1A\u771F\u503C\u4F1A\u5199\u8FDB\u4F1A\u8BDD\u65E5\u5FD7\uFF0C\u5E76\u968F\u5B83\u7684\u540C\u6B65\u3001\u5907\u4EFD\u3001\u5206\u4EAB\u3001\u5BFC\u51FA\u5E26\u8D70\u3002","cfg.r.vendorView":"\u5173\u95ED\u540E\uFF0C\u5185\u5B58\u91CC\u5DF2\u4FDD\u7559\u7684\u53D1\u51FA\u5185\u5BB9\u526F\u672C\u7ACB\u5373\u6E05\u7A7A\uFF0C\u4E4B\u524D\u7684\u8BB0\u5F55\u4E0D\u80FD\u518D\u67E5\u770B\u53D1\u51FA\u5185\u5BB9\u3002"};var vt={"card.title":"Masking statistics","card.on":"Masking on","card.off":"Masking off","card.refresh":"Refresh","card.loading":"Loading\u2026","card.unavailable":"No statistics: the plugin\u2019s host half is not running, or dsh needs a restart.","card.memoryOnly":"Records in memory only (record is off)","card.values":"{n} values kept for restoring","card.range":"Range","card.reset":"Clear data","card.resetTitle":"Clear the Privacy history?","card.resetBody":"This deletes the masking records and counts of every session, including the record files under this instance's masking/ and the copies of what was sent kept in memory. It cannot be undone. The rules, the settings and requests under way are not affected.","card.resetAck":"I understand this cannot be undone","card.resetConfirm":"Clear","card.cancel":"Cancel","card.close":"Close","card.resetDone":"Cleared; {n} record files deleted.","card.resetFailed":"Could not clear: {message}","stat.took":"Mean time","stat.tookMax":"longest {max} ms","stat.ms":"{n} ms","recent.count":"Latest {n}","recent.col.time":"Time","recent.col.step":"Turn\xB7Step","recent.stepHint":"The turn and step this request went out in, numbered as the Trajectory tab numbers them. It is the step that SENT it: a step\u2019s output only reaches the next step\u2019s request, so searching the trajectory for a value usually finds it one step earlier","recent.stepAt":"sent in turn {turn}, step {step}","recent.stepSent":"This request went out in turn {turn}, step {step}; a value in it may come from an earlier step (see the place under it)","recent.valueFirst":"first sent in turn {turn}, step {step}","recent.valueFirstHere":"first sent by this request, in this run","recent.col.where":"Model / host","recent.col.from":"From","recent.col.places":"Replaced","recent.col.restored":"Restored","page.at":"{page} / {pages}","range.today":"Today","range.week":"7 days","range.month":"30 days","stat.requests":"Recorded requests","stat.masked":"Masked","stat.n":"Replaced","stat.restored":"Restored","stat.restoreOff":"Off","stat.inTools":"{n} in tool arguments","stat.unmapped":"Unknown placeholders","stat.failed":"Failures","dist.kind":"By kind","dist.finder":"By finder","dist.host":"By host","dist.empty":"None yet","dist.others.kind":"Other kinds","dist.others.finder":"Other finders","dist.others.host":"Other hosts","hint.kind.title":"kind: the value\u2019s kind","hint.kind.body":"The kind given to a value a rule or your words find; placeholders are named by it and actions are set per kind.","hint.finder.title":"finder: what found it","hint.finder.body":"What found the value: a built-in rule, your words, a value masked earlier, or a cookie.","hint.count":"Places replaced, not requests; warn / block values are not counted.","hint.kind.SECRET":"Other secret fields: secret / token / key=\u2026, and the Chinese \u201C\u5BC6\u94A5\u662F\u2026\u201D","hint.kind.PASSWORD":"A password: credentials in a URL, password=\u2026 fields, the Chinese \u201C\u5BC6\u7801\u4E3A\u2026\u201D","hint.kind.API_KEY":"Keys of the platforms: OpenAI / Anthropic sk-\u2026, GitHub tokens, AWS AKIA\u2026, Google AIza\u2026 and so on","hint.kind.TOKEN":"A JWT (three dot-separated eyJ\u2026 parts), and the token after Bearer / Token in an Authorization header","hint.kind.PRIVATE_KEY":"A PEM private-key block","hint.kind.COOKIE":"Session values in Cookie headers, curl -b and cookies.txt (BDUSS, JSESSIONID \u2026)","hint.kind.EMAIL":"An email address","hint.kind.PHONE":"A mainland China mobile number","hint.kind.ID_CARD":"A Chinese ID number with a valid checksum","hint.kind.BANK_CARD":"A bank card number that passes the Luhn check","hint.kind.TERM":"A word from the configured words","hint.finder.rule":"Values the built-in rules recognize: keys, passwords, personal data","hint.finder.word":"A word from the configured words","hint.finder.known":"A value masked earlier in this run, met again elsewhere in a request (resent history mostly goes this way)","hint.finder.cookie":"A session value recognized by Cookie headers, curl -b, cookies.txt or a cookie name","filter.kind":"Filter by kind","filter.finder":"Filter by finder","filter.all":"All","filter.none":"No values match the filter.","filter.aria":"{name}: {value}","warn.streak":"Masking failed {n} times in a row; those requests were not sent. /privacy off stops it.","warn.unmapped":"Replies had {n} placeholders the table has no value for; a model may have changed them.","warn.inTools":"{n} restored places were in tool call arguments, so the tool ran with the real value. If you did not expect that, check the latest tool calls.","recent.title":"Latest records","recent.empty":"No records yet.","recent.failed":"failed","col.placeholder":"Placeholder","col.kind":"Kind","col.finder":"Finder","col.head":"Head","recent.placesHint":"Places in the request that a placeholder replaced (not how many values were sent)","recent.restoredHint":"Places where the reply had a placeholder put back; the model need not repeat every value, so the two counts usually differ","col.len":"Length","col.n":"Times","recent.noValues":"Nothing was masked in this request.","recent.unmapped":"The reply has {n} placeholders the value table has no value for: a model may have changed them, or be repeating an example or a value from before the restart.","recent.omitted":"{n} more values are past the limit of one record and not listed.","stat.warned":"Warned","stat.blocked":"Blocked","stat.exfil":"Tool calls sending values away","stat.exfilBlocked":"{n} places left unrestored","warn.exfil":"{n} tool calls had a restored value in arguments that name a host off this machine; open the latest records to see the hosts.","recent.blocked":"blocked","recent.exfil":"sent to: {hosts}","col.action":"Action","action.warn":"warn, sent","action.block":"block","view.open":"What was sent","view.title":"What this request actually sent","view.agent":"Replaced places marked (kind \xB7 head \xB7 length)","view.vendor":"What the model service received (placeholders replaced)","view.onlyChanged":"Only lines with replacements","view.loading":"Loading\u2026","view.gone":"This copy is no longer in memory: past the limits, or dsh restarted.","view.failed":"This copy could not be read: {reason}","view.truncated":"First {n} lines only.","view.none":"No line has a replacement.","view.close":"Close","panel.tab":"Privacy","panel.session":"This session","panel.empty":"No records in this session yet. Only a model request that had something masked or restored leaves one.","panel.diagramAgent":"agent / adapter","panel.diagramGateway":"privacy gateway","panel.diagramGatewaySub":"mask \xB7 restore","panel.diagramVendor":"model service","panel.diagramRequest":"\u2460 request","panel.diagramReply":"\u2461 reply","panel.diagramPlaceholder":"placeholder","panel.diagramNote":"Secrets, credentials and personal data leave this machine as placeholders; by default a reply is not restored, so the session log keeps the placeholders.","page.first":"First","page.prev":"Previous","page.next":"Next","cfg.title":"Configure","cfg.f.showPanel":"Show a Privacy tab at the top of the session","cfg.f.showPanel.hint":"When on, a Privacy tab sits beside Chat and Trajectory with this session\u2019s masking records and counts.","cfg.unavailable":"Settings cannot be read: the host offers no settings service, or the plugin\u2019s host half has not loaded the new version yet.","cfg.loading":"Reading the current configuration\u2026","cfg.retry":"Retry","cfg.failed":"Could not save; try again.","cfg.sidebarFailed":"The tab could not be registered: {reason}","cfg.f.excludeProviders":"Providers not masked","cfg.excludedNone":"None: everything is masked","cfg.sep":", ","cfg.excludedMany":"{names} and {n} in all","cfg.providerListUnavailable":"The provider list could not be read: the host has registered none, or the call failed.","cfg.remove":"Remove {name}","cfg.f.excludeProviders.hint":"Requests from a checked provider go out as they are, its replies are not restored, and nothing is recorded; the log says so once for each provider. A change applies from the next model call.","cfg.providerAbsent":"{name} (not registered now)","cfg.add":"Add","cfg.listEmpty":"None yet","cfg.countInvalid":"Enter a whole number of at least {min}.","cfg.applies":"Changes are saved at once and apply from the next model call; no restart needed.","cfg.others":"The other settings (actions, cookieNames, excludeHosts, maxValues and so on) are changed in cordis.patch.yml; see the README.","cfg.g.mask":"Masking","cfg.g.lists":"Word lists","cfg.g.record":"Records","cfg.g.view":"Tab and providers","cfg.f.enabled":"Mask requests","cfg.f.enabled.hint":"The master switch. Off, the gateway stops rewriting requests, and counting and recording stop too.","cfg.f.secrets":"Mask secrets","cfg.f.secrets.hint":"API keys, tokens, passwords, private keys, cookies.","cfg.f.personal":"Mask personal data","cfg.f.personal.hint":"Emails, mainland phone numbers, ID card and bank card numbers.","cfg.f.shape":"Same-shape fake keys","cfg.f.shape.hint":"A secret goes as a made-up key with the same prefix, length and kinds of character instead of a \u27E6DSH_REDACTED:\u2026\u27E7 placeholder; a value under 8 characters, or with unusual characters, keeps the placeholder. With restoreLog on, replies put the made-up key back the same way.","cfg.f.maskKeys":"Mask JSON keys too","cfg.f.maskKeys.hint":'A key in a request body that reads like a secret or personal data ({"sk-\u2026": \u2026}) goes as a placeholder the way a value does, and comes back in the reply with restoreLog on. The protocol\u2019s own keys (model, role, type, name and so on), the tool definitions and the argument names of a tool call are left alone, or the vendor could not read the request.',"cfg.f.toolGuard":"Tool call guard","cfg.f.toolGuard.hint":"What happens when a tool call\u2019s arguments would have a value put back and name a host off this machine. A reply holds a real value only with restoreLog on; with it off this guard never runs.","cfg.f.toolGuard.off":"Count only","cfg.f.toolGuard.warn":"Warn and record","cfg.f.toolGuard.block":"Do not restore","cfg.f.restoreLog":"Real values in the session log","cfg.f.restoreLog.hint":"Off (the default), a reply\u2019s placeholders go into the session log as they are: no plaintext reaches the log, and the agent sees placeholders too. On, they are put back before the log is written, so the agent and the log both hold the real values \u2014 the reply has this one restore point, so the two cannot differ. With it on, session sync, backups, shares and exports carry the real values, so turning it on asks first.","cfg.f.words":"Your own words","cfg.f.words.hint":"Code names, customer names and the like, replaced as written with a TERM placeholder. Press Enter or Add.","cfg.f.words.placeholder":"A word","cfg.f.allow":"Values never masked","cfg.f.allow.hint":"Whole values, in any case, left alone whichever rule finds them.","cfg.f.allow.placeholder":"A value","cfg.f.record":"Write records to disk","cfg.f.record.hint":"Into this instance's own masking/ (one directory per instance), metadata only, never the values; off keeps the counts in memory.","cfg.f.keepDays":"Days of records kept","cfg.f.keepDays.hint":"Older days are deleted; at least 1.","cfg.f.vendorView":"Keep what was sent, to compare","cfg.f.vendorView.hint":"When on, records from then on have a \u201CWhat was sent\u201D button to check what the model service actually got and whether anything slipped through. The copy is masked, with no real values; it lives in memory only, at most 100 copies and 64 MiB in all, gone on restart. It holds the whole prompt and conversation, so leave it off unless you need it.","cfg.expand":"Expand {name}","cfg.collapse":"Collapse {name}","cfg.s.maskOff":"Off: requests go out as they are","cfg.s.maskNothing":"No kind chosen","cfg.s.maskKeysOnly":"Keys only","cfg.s.secrets":"Secrets","cfg.s.personal":"Personal data","cfg.s.shape":"Same-shape keys","cfg.s.toolGuard.off":"Tool guard: count","cfg.s.toolGuard.warn":"Tool guard: warn","cfg.s.toolGuard.block":"Tool guard: no restore","cfg.s.restoreLog":"Real values in log","cfg.s.words":"{n} words","cfg.s.allow":"{n} allowed","cfg.s.record":"On disk, {n} days","cfg.s.recordOff":"Memory only","cfg.s.vendorView":"Keeping what was sent","cfg.s.panel":"Tab shown","cfg.s.panelOff":"Tab hidden","cfg.s.providersAll":"Every provider masked","cfg.s.providersSome":"{n} providers not masked","cfg.s.problem":"Needs a look; expand","card.valuesHint":"The values swapped out are kept in memory only; with restoreLog on they are put back in place of the placeholders in replies. Shared by every session; cleared when dsh restarts.","session.mask":"Mask this session","session.offTitle":"Turn masking off for this session?","session.offBody":"From then on this session\u2019s model requests go to the model service as they are: secrets, credentials, personal data and your own words are no longer replaced, replies are not restored, and nothing is recorded. Other sessions are not affected; you can turn it back on here at any time.","session.offAck":"I understand this session\u2019s content goes out as it is","session.offConfirm":"Turn off","session.offNotice":"Masking is off for this session: requests go out as they are and nothing is recorded.","session.failed":"Could not switch: {message}","cfg.f.recordContext":"Record the text around each value","cfg.f.recordContext.hint":"About 80 characters each side of every replaced place, and where it was (a user message, a tool result and so on), are kept with the record, so you can tell what it was replaced in. The text is taken from what was sent, so masked values in it are placeholders; with personal data not masked, emails, phone numbers and the like appear in it as they are.","recent.contextHint":"The text around the place, as sent; masked values in it are placeholders","recent.elsewhere":"Also at {paths}","recent.elsewhereMore":"Also at {paths} ({n} more places not listed)","recent.elsewhereOmitted":"{n} more places not listed","recent.placeSep":", ","place.system":"System prompt","place.toolResult":"Tool result","place.toolCall":"Tool call","place.user":"User message","place.assistant":"Model reply","place.other":"Other","err.noConnection":"Not connected to dsh yet","err.malformed":"The plugin\u2019s host half answered in a form this page does not know; the host half and the page may be different versions","err.remote":"{message}","err.thrown":"{message}","err.noDisposer":"The view strip gave back no way to remove the registration","card.stale":"Refresh failed ({reason}). The figures below are the last ones read and may be out of date.","card.reason":"Reason: {reason}","recent.cell":"{name}: {value}","recent.cellSep":", ","view.unknown":"\u2039unknown placeholder\u203A","view.line":"Line","cfg.risk.send.title":"This change sends content to the model service as it is","cfg.risk.delete.title":"This change deletes data already kept","cfg.risk.log.title":"This change writes real values into the session log","cfg.risk.send.ack":"I understand this content goes to the model service as it is","cfg.risk.delete.ack":"I understand the deleted data cannot be recovered","cfg.risk.log.ack":"I understand the real values go into the session log and travel with its sync, backups, shares and exports","cfg.risk.confirm":"Change it","cfg.r.enabled":"Off, every session\u2019s model requests go to the model service as they are: secrets, credentials, personal data and your own words are no longer replaced, replies are not restored, and nothing is recorded.","cfg.r.secrets":"Off, API keys, tokens, passwords, private keys and cookies are no longer replaced and go to the model service as they are.","cfg.r.personal":"Off, emails, phone numbers, ID card and bank card numbers are no longer replaced and go to the model service as they are.","cfg.r.maskKeys":"Off, a key that reads like a secret or personal data is no longer replaced and goes to the model service as it is; the tool definitions and a tool call\u2019s argument names were never touched.","cfg.r.words":"The words taken out ({names}) are no longer masked: where a request has them, they go to the model service as they are.","cfg.r.allow":"The values added ({names}) are never masked from now on: where a request has them, they go to the model service as they are.","cfg.r.excludeProviders":"Requests from the providers newly checked ({names}) go out as they are, their replies are not restored, and nothing is recorded.","cfg.r.record":"Off, the records still waiting to be written are not written, and records from then on are counted in memory only and lost when dsh restarts.","cfg.r.keepDays":"Records are kept {to} days instead of {from}: the record files past that are deleted at the next write and cannot be recovered.","cfg.r.restoreLog":"On, a reply\u2019s placeholders become the real values before the session log is written: those values go into the log and travel with its sync, backups, shares and exports.","cfg.r.vendorView":"Off, the copies of what was sent kept in memory are cleared at once, and earlier records can no longer show what was sent."};var J="privacyGateway";var xt={zh:bt,en:vt};var T=require("@deepseek-ai/dsh-client-ui-primitives"),p=require("react");var x=require("@deepseek-ai/dsh-client-ui-primitives"),o=require("react");var ge=require("@deepseek-ai/dsh-client-ui-primitives"),b=require("react");function dn(e,t){if(!e)return t("view.unknown");let n=e.action?` \xB7 ${t(e.action==="warn"?"action.warn":"action.block")}`:"",a=pe(e);return`\u2039${e.kind} \xB7 ${a?`${a} \xB7 `:""}${e.len}${n}\u203A`}function _t(e,t,n,a){return e.parts.map((r,s)=>r.id===void 0?r.text:(0,b.createElement)("mark",{key:s,className:`pgw-view__mark${n?" pgw-view__mark--agent":""}`,title:r.id},n?dn(t.get(r.id),a):r.text))}function Nt(e){let{ctx:t,t:n,record:a}=e,[r,s]=(0,b.useState)({status:"loading"}),[i,l]=(0,b.useState)(!0);(0,b.useEffect)(()=>{let m=new AbortController;return s({status:"loading"}),ut(t,a.key,m.signal).then(A=>{m.signal.aborted||s(A.ok?A.value===null?{status:"gone"}:{status:"ready",body:A.value}:{status:"error",failure:A.failure})}),()=>m.abort()},[t,a.key]);let d=it(a.values),u=(0,b.useMemo)(()=>new Map(a.values.map(m=>[m.placeholder,m])),[a.key,d]),h=r.status==="ready"?r.body:void 0,_=(0,b.useMemo)(()=>h!==void 0?st(h):void 0,[h]),k=(0,b.useMemo)(()=>_?lt(_,[...u.keys()],i):void 0,[_,u,i]),y=(0,b.createElement)("div",{className:"pgw-head"},(0,b.createElement)("span",{className:"pgw-dist__title"},n("view.title")),(0,b.createElement)(ge.Checkbox,{checked:i,label:n("view.onlyChanged"),className:"pgw-meta",onChange:l}),(0,b.createElement)("span",{className:"pgw-spacer"}),(0,b.createElement)(ge.Button,{variant:"outline",size:"sm",onClick:e.onClose},n("view.close")));if(!k){let m=r.status==="loading"?n("view.loading"):r.status==="gone"?n("view.gone"):r.status==="error"?n("view.failed",{reason:Y(r.failure,n)}):n("card.unavailable");return(0,b.createElement)("div",{className:"pgw-view"},y,(0,b.createElement)("div",{className:"pgw-empty"},m))}return(0,b.createElement)("div",{className:"pgw-view"},y,k.lines.length===0?(0,b.createElement)("div",{className:"pgw-empty"},n("view.none")):(0,b.createElement)("div",{className:"pgw-view__scroll"},(0,b.createElement)("table",{className:"pgw-view__table"},(0,b.createElement)("thead",null,(0,b.createElement)("tr",null,(0,b.createElement)("th",null,n("view.line")),(0,b.createElement)("th",null,n("view.agent")),(0,b.createElement)("th",null,n("view.vendor")))),(0,b.createElement)("tbody",null,k.lines.map(m=>(0,b.createElement)("tr",{key:m.n},(0,b.createElement)("td",{className:"pgw-view__n"},m.n),(0,b.createElement)("td",{className:"pgw-view__code"},..._t(m,u,!0,n)),(0,b.createElement)("td",{className:"pgw-view__code"},..._t(m,u,!1,n))))))),k.truncated?(0,b.createElement)("div",{className:"pgw-meta"},n("view.truncated",{n:k.lines.length})):null)}function Rt(e){return e.items.length===0?null:(0,o.createElement)("div",{className:"pgw-notices",role:"status"},e.items.map(t=>(0,o.createElement)("div",{key:t.key,className:`pgw-notice pgw-notice--${t.tone}`},(0,o.createElement)(x.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,o.createElement)("span",null,e.t(t.key,{n:t.n})))))}function St(e){let{totals:t,t:n}=e,a=l=>(l??0).toLocaleString(),r=et(t),s=e.restoreLog===!1,i=[{label:n("stat.requests"),value:a(t.requests)},{label:n("stat.masked"),value:a(t.masked)},{label:n("stat.n"),value:a(t.n)},{label:n("stat.restored"),value:s?n("stat.restoreOff"):a(t.restored),...!s&&t.restoredInTools>0?{sub:n("stat.inTools",{n:t.restoredInTools})}:{}},{label:n("stat.unmapped"),value:s?n("stat.restoreOff"):a(t.unmapped),...!s&&t.unmapped>0?{tone:"warn"}:{}},{label:n("stat.failed"),value:a(t.failed),...t.failed>0?{tone:"error"}:{}}];return(t.warned??0)>0&&i.push({label:n("stat.warned"),value:a(t.warned),tone:"warn"}),(t.blocked??0)>0&&i.push({label:n("stat.blocked"),value:a(t.blocked),tone:"warn"}),(t.exfil??0)>0&&i.push({label:n("stat.exfil"),value:a(t.exfil),tone:"error",...(t.exfilBlocked??0)>0?{sub:n("stat.exfilBlocked",{n:t.exfilBlocked})}:{}}),t.requests>0&&i.push({label:n("stat.took"),value:n("stat.ms",{n:r.avg}),sub:n("stat.tookMax",{max:r.max})}),(0,o.createElement)("div",{className:"pgw-kpis"},i.map(l=>(0,o.createElement)("div",{key:l.label,className:`pgw-kpi${l.tone?` pgw-kpi--${l.tone}`:""}`},(0,o.createElement)("span",{className:"pgw-kpi__label"},l.label),(0,o.createElement)("span",{className:"pgw-kpi__value"},l.value),l.sub?(0,o.createElement)("span",{className:"pgw-kpi__sub"},l.sub):null)))}function Ee(e){let{t,field:n}=e;return(0,o.createElement)("div",{className:"pgw-hint"},(0,o.createElement)("div",{className:"pgw-hint__title"},t(n==="kind"?"hint.kind.title":"hint.finder.title")),(0,o.createElement)("div",{className:"pgw-hint__body"},t(n==="kind"?"hint.kind.body":"hint.finder.body")),e.note===!0?(0,o.createElement)("div",{className:"pgw-hint__note"},t("hint.count")):null)}function cn(e){return(0,o.createElement)("div",{className:"pgw-hint"},(0,o.createElement)("div",{className:"pgw-hint__title pgw-mono"},e.name),(0,o.createElement)("div",{className:"pgw-hint__body"},e.t(e.meaning)))}function me(e){let{t,field:n}=e,a=Je(e.data,6,e.others),r=n===void 0?e.title:(0,o.createElement)(x.HoverCard,{anchor:(0,o.createElement)("span",{className:"pgw-dist__anchor"},e.title,(0,o.createElement)(x.IconInfoOutlineRegular,{size:12,className:"pgw-dist__info"})),content:(0,o.createElement)(Ee,{t,field:n,note:!0})});return(0,o.createElement)("div",{className:"pgw-dist"},(0,o.createElement)("div",{className:"pgw-section__title"},r),a.length===0?(0,o.createElement)("div",{className:"pgw-empty"},e.empty):a.map(s=>{let i=n===void 0?void 0:(n==="kind"?Ue:Qe)(s.label),l=(0,o.createElement)("span",i===void 0?{className:"pgw-bar__label",title:s.label}:{className:"pgw-bar__label pgw-bar__label--hint"},s.label),d=i===void 0||n===void 0?l:(0,o.createElement)(x.HoverCard,{anchor:l,content:(0,o.createElement)(cn,{t,name:s.label,meaning:i})});return(0,o.createElement)("div",{className:"pgw-bar",key:s.label},(0,o.createElement)("div",{className:"pgw-bar__head"},d,(0,o.createElement)("span",{className:"pgw-bar__value"},s.value.toLocaleString())),(0,o.createElement)("div",{className:"pgw-bar__track"},(0,o.createElement)("div",{className:"pgw-bar__fill",style:{width:`${s.pct}%`}})))}))}function Tt(e){let{t}=e;return(0,o.createElement)("div",{className:"pgw-rec pgw-rec--head","aria-hidden":!0},(0,o.createElement)("span",null),(0,o.createElement)("span",null,t("recent.col.time")),(0,o.createElement)("span",{title:t("recent.stepHint")},t("recent.col.step")),(0,o.createElement)("span",null,t("recent.col.where")),(0,o.createElement)("span",null,t("recent.col.from")),(0,o.createElement)("span",{className:"pgw-rec__num",title:t("recent.placesHint")},t("recent.col.places")),(0,o.createElement)("span",{className:"pgw-rec__num",title:t("recent.restoredHint")},t("recent.col.restored")))}var Ie="*";function Ct(e){let{t,field:n}=e,[a,r]=(0,o.useState)(!1),s=t(n==="kind"?"col.kind":"col.finder"),i=[{id:Ie,label:t("filter.all")},...e.names.map(d=>({id:d,label:d}))],l=(0,o.createElement)("button",{type:"button",className:`pgw-filter${e.value===void 0?"":" pgw-filter--on"}`,"aria-haspopup":"menu","aria-expanded":a,"aria-label":t("filter.aria",{name:t(n==="kind"?"filter.kind":"filter.finder"),value:e.value??t("filter.all")}),onClick:()=>r(d=>!d)},e.value===void 0?s:`${s} \xB7 ${e.value}`,(0,o.createElement)(x.IconChevronDownOutlineRegular,{size:10,className:"pgw-filter__chevron"}));return(0,o.createElement)(x.Menu,{open:a,onClose:()=>r(!1),items:i,selectedId:e.value??Ie,onSelect:d=>{r(!1),e.onChange(d===Ie?void 0:d)},align:"start",portal:!0,anchor:(0,o.createElement)(x.HoverCard,{anchor:l,content:e.hint,disabled:a})})}function Ot(e){let{r:t,t:n}=e,[a,r]=(0,o.useState)(!1),[s,i]=(0,o.useState)(void 0),[l,d]=(0,o.useState)(void 0),u=Xe(t.values,{...s===void 0?{}:{kind:s},...l===void 0?{}:{finder:l}}),h=Se(t.values,"kind"),_=Se(t.values,"finder"),k=(0,o.useId)(),y=ce(t),m=y?n("recent.stepAt",y):"",A=y?n("recent.stepSent",y):"",E=[t.workspace,t.title??t.session].filter(f=>typeof f=="string"&&f!=="").join(" \xB7 "),V=t.failed?(0,o.createElement)(x.Tag,{tone:"danger"},n("recent.failed")):t.blocked?(0,o.createElement)(x.Tag,{tone:"danger"},n("recent.blocked")):(0,o.createElement)("span",{className:t.exfil?"pgw-rec__bad":void 0},t.n.toLocaleString()),$=t.failed?n("recent.failed"):t.blocked?n("recent.blocked"):t.n.toLocaleString(),D=[[n("recent.col.time"),Te(t.time)],[n("recent.col.step"),m],[n("recent.col.where"),[t.model??t.what,t.host].filter(Boolean).join(" \xB7 ")],[n("recent.col.from"),E],[n("recent.col.places"),$],[n("recent.col.restored"),t.unmapped>0?`${t.restored.toLocaleString()} (+${t.unmapped})`:t.restored.toLocaleString()]].filter(([,f])=>f!=="").map(([f,F])=>n("recent.cell",{name:f,value:F})).join(n("recent.cellSep"));return(0,o.createElement)("li",{className:"pgw-recs__item"},(0,o.createElement)("button",{type:"button",className:`pgw-rec${ot(t)?" pgw-rec--zero":""}${e.open?" pgw-rec--open":""}`,"aria-expanded":e.open,"aria-controls":e.open?k:void 0,"aria-label":D,onClick:e.toggle},(0,o.createElement)(x.IconChevronRightOutlineRegular,{size:12,className:"pgw-rec__chevron"}),(0,o.createElement)("span",{className:"pgw-rec__time"},Te(t.time)),(0,o.createElement)("span",{className:"pgw-rec__step",title:m||void 0},y?nt(y):""),(0,o.createElement)("span",{className:"pgw-rec__where",title:[t.model,t.host].filter(Boolean).join(" \xB7 ")},(0,o.createElement)("span",{className:"pgw-rec__model"},t.model??t.what),(0,o.createElement)("span",{className:"pgw-rec__host"},t.host)),(0,o.createElement)("span",{className:"pgw-rec__from",title:E},E),(0,o.createElement)("span",{className:"pgw-rec__num"},V),(0,o.createElement)("span",{className:"pgw-rec__num pgw-rec__dim"},t.restored.toLocaleString(),t.unmapped>0?(0,o.createElement)("span",{className:"pgw-rec__unknown",title:n("recent.unmapped",{n:t.unmapped})},` ?${t.unmapped}`):null)),e.open?(0,o.createElement)("div",{className:"pgw-detail",id:k},t.exfil?(0,o.createElement)("div",{className:"pgw-notice pgw-notice--error"},(0,o.createElement)(x.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),n("recent.exfil",{hosts:(t.exfilHosts??[]).join(", ")})):null,t.unmapped>0?(0,o.createElement)("div",{className:"pgw-notice pgw-notice--warn"},(0,o.createElement)(x.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,o.createElement)("span",null,n("recent.unmapped",{n:t.unmapped}))):null,y?(0,o.createElement)("div",{className:"pgw-meta"},A):null,t.values.length===0?(0,o.createElement)("div",{className:"pgw-empty"},n("recent.noValues")):(0,o.createElement)("table",{className:"pgw-values"},(0,o.createElement)("thead",null,(0,o.createElement)("tr",null,(0,o.createElement)("th",{key:"col.placeholder"},n("col.placeholder")),(0,o.createElement)("th",{key:"col.kind"},(0,o.createElement)(Ct,{t:n,field:"kind",names:h,value:s,hint:(0,o.createElement)(Ee,{t:n,field:"kind"}),onChange:i})),(0,o.createElement)("th",{key:"col.finder"},(0,o.createElement)(Ct,{t:n,field:"finder",names:_,value:l,hint:(0,o.createElement)(Ee,{t:n,field:"finder"}),onChange:d})),(0,o.createElement)("th",{key:"col.head"},n("col.head")),(0,o.createElement)("th",{key:"col.len"},n("col.len")),(0,o.createElement)("th",{key:"col.n"},n("col.n")),(0,o.createElement)("th",{key:"col.action"},n("col.action")))),(0,o.createElement)("tbody",null,u.length===0?(0,o.createElement)("tr",{key:"none",className:"pgw-values__empty"},(0,o.createElement)("td",{colSpan:7},n("filter.none"))):u.flatMap(f=>{let F=pt(f,n),B=f.first?n("recent.valueFirst",{turn:f.first.turn,step:f.first.step}):y?n("recent.valueFirstHere"):"",I=f.at!==void 0||f.before!==void 0||f.after!==void 0||F!==""||B!=="";return[(0,o.createElement)("tr",{key:f.placeholder,className:f.before!==void 0||f.after!==void 0?"pgw-values__has":void 0},(0,o.createElement)("td",{className:"pgw-mono"},f.placeholder),(0,o.createElement)("td",null,f.kind),(0,o.createElement)("td",null,f.finder),(0,o.createElement)("td",{className:"pgw-mono"},pe(f)),(0,o.createElement)("td",null,f.len),(0,o.createElement)("td",null,f.n),(0,o.createElement)("td",null,f.action?n(f.action==="warn"?"action.warn":"action.block"):"")),I?(0,o.createElement)("tr",{key:`${f.placeholder}:ctx`,className:"pgw-values__ctx"},(0,o.createElement)("td",{colSpan:7},(0,o.createElement)("div",{className:"pgw-ctx"},(0,o.createElement)("div",{className:"pgw-ctx__line"},f.at?(0,o.createElement)(x.Tag,{tone:"neutral",className:"pgw-ctx__place",title:f.at.path},n(ct(f.at)),(0,o.createElement)("span",{className:"pgw-ctx__path pgw-mono"},`\xB7 ${Oe(f.at.path)}`)):null,f.before!==void 0||f.after!==void 0?(0,o.createElement)("span",{className:"pgw-ctx__text",title:n("recent.contextHint")},f.before??"",(0,o.createElement)("mark",{className:"pgw-ctx__mark pgw-mono"},f.placeholder),f.after??""):null),F!==""?(0,o.createElement)("div",{className:"pgw-ctx__more"},F):null,B!==""?(0,o.createElement)("div",{className:"pgw-ctx__more"},B):null))):null]}))),t.valuesOmitted?(0,o.createElement)("div",{className:"pgw-meta"},n("recent.omitted",{n:t.valuesOmitted.toLocaleString()})):null,e.viewable&&!a?(0,o.createElement)("div",null,(0,o.createElement)(x.Button,{variant:"outline",size:"sm",onClick:()=>r(!0)},n("view.open"))):null,e.viewable&&a?(0,o.createElement)(Nt,{ctx:e.ctx,t:n,record:t,onClose:()=>r(!1)}):null):null)}function At(e){let{t}=e,[n,a]=(0,o.useState)(!1),[r,s]=(0,o.useState)(!1),[i,l]=(0,o.useState)(!1),d=()=>{a(!1),s(!1)},u=()=>{l(!0),ft(e.ctx).then(h=>{l(!1),d(),e.onDone(h.ok?t("card.resetDone",{n:h.value}):t("card.resetFailed",{message:Y(h.failure,t)}),h.ok)})};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(x.Button,{variant:"ghost",size:"sm",className:"pgw-reset",disabled:i,onClick:()=>a(!0)},(0,o.createElement)(x.IconTrashOutlineRegular,{size:14}),(0,o.createElement)("span",null,t("card.reset"))),(0,o.createElement)(x.RiskConfirmation,{open:n,title:t("card.resetTitle"),description:t("card.resetBody"),acknowledgeLabel:t("card.resetAck"),cancelLabel:t("card.cancel"),closeLabel:t("card.close"),confirmLabel:t("card.resetConfirm"),acknowledged:r,disabled:i,onAcknowledgedChange:s,onCancel:d,onConfirm:u}))}function It(e){let{t}=e,[n,a]=(0,o.useState)(e.on),[r,s]=(0,o.useState)(!1),[i,l]=(0,o.useState)(!1),[d,u]=(0,o.useState)(!1);(0,o.useEffect)(()=>a(e.on),[e.on]);let h=()=>{s(!1),l(!1)},_=k=>{u(!0),gt(e.ctx,e.session,k).then(y=>{u(!1),h(),y.ok&&a(y.value),e.onDone(y.ok?null:t("session.failed",{message:Y(y.failure,t)}))})};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("label",{className:"pgw-session"},(0,o.createElement)(x.Switch,{checked:n,label:t("session.mask"),disabled:d,onChange:k=>k?_(!0):s(!0)}),(0,o.createElement)("span",{className:"pgw-session__label"},t("session.mask"))),e.version===void 0?null:(0,o.createElement)("span",{className:"pgw-version"},`v${e.version}`),(0,o.createElement)(x.RiskConfirmation,{open:r,title:t("session.offTitle"),description:t("session.offBody"),acknowledgeLabel:t("session.offAck"),cancelLabel:t("card.cancel"),closeLabel:t("card.close"),confirmLabel:t("session.offConfirm"),acknowledged:i,disabled:d,onAcknowledgedChange:l,onCancel:h,onConfirm:()=>_(!1)}))}var O=require("react");function U(e,t,n,a){return(0,O.createElement)("text",{x:e,y:t,textAnchor:"middle",className:n},a)}function Et(e,t){return(0,O.createElement)("marker",{id:e,viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:6,markerHeight:6,orient:"auto-start-reverse"},(0,O.createElement)("path",{d:"M 0 0 L 10 5 L 0 10 z",className:t}))}function Pt(e){let{t}=e,n=(0,O.useId)().replace(/[^a-zA-Z0-9_-]/g,""),a=`pgw-diagram-out-${n}`,r=`pgw-diagram-back-${n}`;return(0,O.createElement)("div",{className:"pgw-diagram"},(0,O.createElement)("svg",{className:"pgw-diagram__svg",viewBox:"0 0 640 200",role:"img","aria-label":t("panel.diagramNote")},(0,O.createElement)("defs",null,Et(a,"pgw-diagram__head-out"),Et(r,"pgw-diagram__head-in")),(0,O.createElement)("rect",{x:8,y:68,width:140,height:64,rx:10,className:"pgw-diagram__box"}),(0,O.createElement)("rect",{x:228,y:52,width:184,height:96,rx:10,className:"pgw-diagram__gateway"}),(0,O.createElement)("rect",{x:492,y:68,width:140,height:64,rx:10,className:"pgw-diagram__vendor"}),U(78,104,"pgw-diagram__title",t("panel.diagramAgent")),U(320,94,"pgw-diagram__title",t("panel.diagramGateway")),U(320,112,"pgw-diagram__sub",t("panel.diagramGatewaySub")),U(562,104,"pgw-diagram__title",t("panel.diagramVendor")),(0,O.createElement)("path",{d:"M 148 84 L 228 84",className:"pgw-diagram__out",markerEnd:`url(#${a})`}),(0,O.createElement)("path",{d:"M 412 84 L 492 84",className:"pgw-diagram__out",markerEnd:`url(#${a})`}),(0,O.createElement)("path",{d:"M 492 116 L 412 116",className:"pgw-diagram__in",markerEnd:`url(#${r})`}),(0,O.createElement)("path",{d:"M 228 116 L 148 116",className:"pgw-diagram__in",markerEnd:`url(#${r})`}),U(188,75,"pgw-diagram__label",t("panel.diagramRequest")),U(452,75,"pgw-diagram__chip",t("panel.diagramPlaceholder")),U(452,129,"pgw-diagram__chip",t("panel.diagramPlaceholder")),U(188,129,"pgw-diagram__label",t("panel.diagramReply"))),(0,O.createElement)("p",{className:"pgw-diagram__note"},t("panel.diagramNote")),(0,O.createElement)("p",{className:"pgw-diagram__hint"},t("panel.empty")))}var pn=15e3,un=200,fn=10,gn=["today","week","month"];function mn(e,t){let[n,a]=(0,p.useState)({status:"loading"}),[r,s]=(0,p.useState)(!1),i=(0,p.useRef)(null),l=(0,p.useCallback)(()=>{i.current?.abort();let d=new AbortController;i.current=d,s(!0),ue(e,un,d.signal,t).then(u=>{d.signal.aborted||(s(!1),a(h=>rt(h,u)))})},[e,t]);return(0,p.useEffect)(()=>{l();let d=setInterval(()=>{(typeof document>"u"||document.visibilityState==="visible")&&l()},pn);return()=>{clearInterval(d),i.current?.abort()}},[l]),[n,l,r]}function he(e){return(0,p.createElement)(hn,{key:e.sessionId??"",...e})}function hn(e){let{t}=e,[n,a,r]=mn(e.ctx,e.sessionId),[s,i]=(0,p.useState)("today"),[l,d]=(0,p.useState)(null),[u,h]=(0,p.useState)(0),[_,k]=(0,p.useState)(null),y=`pgw-card${e.panel?" pgw-card--panel":""}`,m=n.status==="ready"?n.data:void 0,A=!e.panel&&m!==void 0,E=(0,p.createElement)("div",{className:"pgw-head"},(0,p.createElement)("div",{className:"pgw-head__main"},e.panel?null:(0,p.createElement)("h3",{className:"pgw-title"},t("card.title")),e.sessionId&&m&&typeof m.sessionMasking=="boolean"?(0,p.createElement)(It,{ctx:e.ctx,t,session:e.sessionId,on:m.sessionMasking,...m.version!==void 0?{version:m.version}:{},onDone:N=>{k(N===null?null:{text:N,ok:!1}),a()}}):null,m&&(!e.sessionId||!m.active)?(0,p.createElement)(T.Tag,{tone:m.active?"success":"warning"},t(m.active?"card.on":"card.off")):null,e.sessionId&&m&&m.sessionMasking===void 0?(0,p.createElement)(T.Tag,{tone:"outline"},t("panel.session")):null,m&&!e.panel?(0,p.createElement)("span",{className:"pgw-meta",title:t("card.valuesHint")},t("card.values",{n:m.values})):null,m&&!m.record?(0,p.createElement)("span",{className:"pgw-meta"},t("card.memoryOnly")):null),(0,p.createElement)("div",{className:"pgw-head__actions"},m?(0,p.createElement)(T.SegmentedControl,{id:`pgw-range-${e.sessionId??"all"}`,label:t("card.range"),value:s,options:gn.map(N=>({value:N,label:t(`range.${N}`)})),onChange:i}):null,(0,p.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:r,title:t("card.refresh"),"aria-label":t("card.refresh"),onClick:a},(0,p.createElement)(T.IconRefreshOutlineRegular,{size:14})),A?(0,p.createElement)(At,{ctx:e.ctx,t,onDone:(N,X)=>{k({text:N,ok:X}),d(null),h(0),a()}}):null)),V=_?(0,p.createElement)("div",{className:`pgw-flash${_.ok?"":" pgw-flash--error"}`,role:"status"},_.text):null,$=n.status==="ready"&&n.stale?(0,p.createElement)("div",{className:"pgw-notice pgw-notice--error",role:"status"},(0,p.createElement)(T.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,p.createElement)("span",null,t("card.stale",{reason:Y(n.stale,t)}))):null,D=e.sessionId&&m?.sessionMasking===!1?(0,p.createElement)("div",{className:"pgw-notice",role:"status"},(0,p.createElement)(T.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,p.createElement)("span",null,t("session.offNotice"))):null;if(!m){let N=n.status==="error"?`${t("card.unavailable")} ${t("card.reason",{reason:Y(n.failure,t)})}`:t("card.loading");return(0,p.createElement)("section",{className:y},E,(0,p.createElement)("div",{className:"pgw-empty pgw-empty--block"},N))}if(e.sessionId&&m.recent.length===0)return(0,p.createElement)("section",{className:y},E,$,V,D,(0,p.createElement)("div",{className:"pgw-empty pgw-empty--block pgw-empty--diagram"},(0,p.createElement)(Pt,{t})));let f=m,F=f.stats[s],B=new Set(f.vendorView?f.views??[]:[]),I=dt(f.recent,u,fn),H=N=>{h(N),d(null)};return(0,p.createElement)("section",{className:y},E,$,V,D,(0,p.createElement)(Rt,{t,items:Ze(f,F)}),(0,p.createElement)(St,{totals:F,t,...typeof f.restoreLog=="boolean"?{restoreLog:f.restoreLog}:{}}),(0,p.createElement)("div",{className:"pgw-dists"},(0,p.createElement)(me,{t,title:t("dist.kind"),data:F.kinds,others:t("dist.others.kind"),empty:t("dist.empty"),field:"kind"}),(0,p.createElement)(me,{t,title:t("dist.finder"),data:F.finders,others:t("dist.others.finder"),empty:t("dist.empty"),field:"finder"}),(0,p.createElement)(me,{t,title:t("dist.host"),data:F.hosts,others:t("dist.others.host"),empty:t("dist.empty")})),(0,p.createElement)("div",{className:"pgw-section"},(0,p.createElement)("div",{className:"pgw-section__head"},(0,p.createElement)("span",{className:"pgw-section__title"},t("recent.title")),f.recent.length>0?(0,p.createElement)("span",{className:"pgw-meta"},t("recent.count",{n:f.recent.length})):null),f.recent.length===0?(0,p.createElement)("div",{className:"pgw-empty pgw-empty--block"},t("recent.empty")):(0,p.createElement)("div",{className:"pgw-recs"},(0,p.createElement)(Tt,{t}),(0,p.createElement)("ul",{className:"pgw-recs__list","aria-label":t("recent.title")},I.items.map(N=>(0,p.createElement)(Ot,{key:N.key,ctx:e.ctx,r:N,open:l===N.key,toggle:()=>d(l===N.key?null:N.key),t,viewable:B.has(N.key)})))),I.pages>1?(0,p.createElement)("div",{className:"pgw-pager"},(0,p.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:I.page===0,onClick:()=>H(0)},t("page.first")),(0,p.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:I.page===0,"aria-label":t("page.prev"),title:t("page.prev"),onClick:()=>H(I.page-1)},(0,p.createElement)(T.IconChevronLeftOutlineRegular,{size:14})),(0,p.createElement)("span",{className:"pgw-meta pgw-pager__at"},t("page.at",{page:I.page+1,pages:I.pages})),(0,p.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:I.page>=I.pages-1,"aria-label":t("page.next"),title:t("page.next"),onClick:()=>H(I.page+1)},(0,p.createElement)(T.IconChevronRightOutlineRegular,{size:14}))):null))}var wn="dsh-privacy-gateway",ee=fe(void 0);function Lt(e,t){return e.code==="noDisposer"?t("err.noDisposer"):t("err.thrown",{message:e.message})}function Ft(e,t){ee.set(void 0);let n;try{let a=e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:wn,order:35,locale:J,label:()=>t("panel.tab")},r=>(0,Mt.createElement)(he,{ctx:e,t,panel:!0,...r?.sessionId?{sessionId:r.sessionId}:{}})));if(typeof a!="function"){ee.set({code:"noDisposer"});return}n=a}catch(a){ee.set({code:"thrown",message:a instanceof Error?a.message:String(a)});return}return()=>{let a=n;n=void 0;try{a?.()}catch{}}}var we=class{waiting=[];current;failed=!1;send;onState;constructor(t,n=()=>{}){this.send=t,this.onState=n}get state(){return{busy:this.current!==void 0||this.waiting.length>0,failed:this.failed}}latest(t,n){for(let a=this.waiting.length-1;a>=0;a--)if(this.waiting[a]?.path===t)return this.waiting[a]?.value;return this.current?.path===t?this.current.value:n}write(t,n){return new Promise(a=>{let r=this.waiting.find(s=>s.path===t);r?(r.value=n,r.done.push(a)):this.waiting.push({path:t,value:n,done:[a]}),this.failed=!1,this.notify(),this.current||this.drain()})}async drain(){let t=!1;for(;this.waiting.length>0;){let n=this.waiting.shift();this.current=n;let a;try{a=await this.send(n.path,n.value,t)}catch{a=!1}this.current=void 0,t=!0;for(let r of n.done)r(a);if(!a){this.failed=!0;for(let r of this.waiting.splice(0))for(let s of r.done)s(!1)}this.notify()}}notify(){this.onState(this.state)}};function yn(){let[,e]=(0,g.useState)(0),t=(0,g.useSyncExternalStore)(Q.subscribe,Q.get),n=(0,g.useMemo)(()=>{try{return t?.describe()}catch{return}},[t]);(0,g.useEffect)(()=>{if(n)return Promise.resolve(n.ensure()).catch(()=>{}),n.subscribe(()=>e(l=>l+1))},[n]);let a=n?.getSnapshot().view,r=(0,g.useMemo)(()=>a?Ae(a.namespaces):void 0,[a]),s=(0,g.useMemo)(()=>{try{return t&&r!==void 0?t.get(r):void 0}catch{return}},[t,r]);(0,g.useEffect)(()=>s?s.subscribe(()=>e(l=>l+1)):void 0,[s]);let i=s?.getSnapshot();return(0,g.useMemo)(()=>{if(!s||!i)return;let l=s.mutate,d=l?(u,h)=>l.call(s,u,h):async u=>{for(let h of u)if(!await s.set(h.path.join("."),h.value))return!1;return!0};return{state:{status:i.status,value:i.value,revision:i.revision,writable:i.writable!==!1},mutate:d}},[s,i])}var Kt="dsh-privacy-gateway.config.open",kn=["mask"];function bn(){try{let e=JSON.parse(globalThis.localStorage?.getItem(Kt)??"null");if(Array.isArray(e))return ie.filter(t=>e.includes(t))}catch{}return[...kn]}function vn(e){try{globalThis.localStorage?.setItem(Kt,JSON.stringify(e))}catch{}}var j=e=>e;function Pe(e){let{ctx:t,t:n}=e,a=yn(),r=e.form??a,s=(0,g.useRef)(r);s.current=r;let[i,l]=(0,g.useState)({busy:!1,failed:!1}),[d]=(0,g.useState)(()=>new we((c,v,C)=>{let S=s.current;return S?S.mutate([{op:"set",path:[c],value:v}],C?void 0:S.state.revision):Promise.resolve(!1)},l)),[u,h]=(0,g.useState)(null),[_,k]=(0,g.useState)(!1),y=(0,g.useSyncExternalStore)(ee.subscribe,ee.get),m=(0,g.useId)(),[A,E]=(0,g.useState)(null),[V,$]=(0,g.useState)(!1),[D,f]=(0,g.useState)(0),[F,B]=(0,g.useState)(bn),I=c=>B(v=>{let C=v.includes(c)?v.filter(S=>S!==c):ie.filter(S=>S===c||v.includes(S));return vn(C),C}),H=r?.state,N=H?.status==="ready",X=H?.writable!==!1,se=H?.value??{},z=c=>d.latest(c,se[c]);if((0,g.useEffect)(()=>{let c=new AbortController;return mt(t,c.signal).then(v=>{c.signal.aborted||($(!v.ok),E(v.ok?v.value:[]))}),()=>c.abort()},[t,D]),!r)return(0,g.createElement)("div",{className:"pgw-empty"},n("cfg.unavailable"));let te=N?null:(0,g.createElement)("div",{className:"pgw-cfg__desc",role:"status"},n("cfg.loading")),K=!N||!X,zt=c=>A?.find(v=>v.id.toLowerCase()===c.toLowerCase())?.name??c,ne=(c,v)=>{if(K)return Promise.resolve(!1);let C=Ke(c,z(c.key),v);return C?new Promise(S=>{k(!1),h(G=>(G?.resolve(!1),{f:c,next:v,change:C,resolve:S}))}):d.write(c.key,v)},Le=c=>{let v=u;h(null),k(!1),v&&(c?d.write(v.f.key,v.next).then(v.resolve):v.resolve(!1))},Bt=c=>{let v=n(j(`cfg.f.${c.key}`));switch(c.kind){case"switch":return(0,g.createElement)(je,{label:v,checked:ae(z(c.key),c.default),disabled:K,onChange:C=>{ne(c,C)}});case"choice":{let C=_e(z(c.key),c.choices,c.default);return(0,g.createElement)(Ne,{label:n(j(`cfg.f.${c.key}.${C}`)),labelledBy:`${m}${c.key}`,items:c.choices.map(S=>({id:S,label:n(j(`cfg.f.${c.key}.${S}`))})),selectedId:C,disabled:K,onSelect:S=>{S!==C&&ne(c,S)}})}case"list":return(0,g.createElement)(qe,{t:n,label:v,list:W(z(c.key),c.default),anyCase:c.anyCase,placeholder:n(j(`cfg.f.${c.key}.placeholder`)),disabled:K,onChange:C=>ne(c,C)});case"count":return(0,g.createElement)(Ye,{t:n,value:re(z(c.key),c.min,c.default),min:c.min,label:v,disabled:K,onChange:C=>ne(c,C)});case"providers":return Ht(c)}},Ht=c=>{let v=W(z(c.key),[]),C=yt(A??[],v),S=C.filter(P=>P.excluded).map(P=>P.name),G=He(S,n("cfg.sep")),xe=G.kind==="none"?n("cfg.excludedNone"):G.kind==="some"?G.names:n("cfg.excludedMany",{names:G.names,n:G.n});return(0,g.createElement)(Ne,{label:xe,labelledBy:`${m}${c.key}`,multi:!0,items:C.map(P=>({id:P.id,label:P.registered?P.name:n("cfg.providerAbsent",{name:P.name})})),selectedIds:C.filter(P=>P.excluded).map(P=>P.id),disabled:K,onSelect:P=>{ne(c,kt(W(z(c.key),[]),P))}})},Fe=c=>{if(c.key==="showPanel"&&y)return(0,g.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.sidebarFailed",{reason:Lt(y,n)}));if(c.key==="excludeProviders"&&V)return(0,g.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.providerListUnavailable")," ",(0,g.createElement)(ye.Button,{variant:"outline",size:"sm",onClick:()=>f(v=>v+1)},n("cfg.retry")))},Gt=Object.fromEntries(le.map(c=>[c.key,z(c.key)])),Wt=c=>{let v=le.filter(M=>M.group===c),C=n(j(`cfg.g.${c}`)),S=F.includes(c),G=Ve(c,Gt),xe=v.some(M=>Fe(M)!==void 0),P=N?[...G.map((M,jt)=>(0,g.createElement)("span",{key:jt,className:M.off?"pgw-fold__part pgw-fold__part--off":"pgw-fold__part"},n(j(M.key),M.params))),xe?(0,g.createElement)("span",{key:"problem",className:"pgw-fold__part pgw-fold__part--error"},n("cfg.s.problem")):null]:null;return(0,g.createElement)(We,{key:c,title:C,summary:P,open:S,toggleLabel:n(S?"cfg.collapse":"cfg.expand",{name:C}),onToggle:()=>I(c)},v.map(M=>(0,g.createElement)(Ge,{key:M.key,title:n(j(`cfg.f.${M.key}`)),titleId:`${m}${M.key}`,hint:n(j(`cfg.f.${M.key}.hint`)),note:Fe(M),inline:De(M),half:M.half===!0},Bt(M))))},ve=u?xn(u,n,u.f.key==="excludeProviders"?zt:c=>c):null;return(0,g.createElement)(g.Fragment,null,(0,g.createElement)("section",{className:"pgw-cfg","aria-busy":i.busy||void 0},e.form?null:(0,g.createElement)("h3",{className:"pgw-title"},n("cfg.title")),i.failed?(0,g.createElement)("div",{className:"pgw-notice pgw-notice--error",role:"alert"},n("cfg.failed")):null,te,(0,g.createElement)("div",{className:"pgw-cfg__folds"},ie.map(Wt)),(0,g.createElement)("p",{className:"pgw-cfg__desc pgw-cfg__foot"},n("cfg.applies")," ",n("cfg.others"))),(0,g.createElement)(ye.RiskConfirmation,{open:u!==null,title:ve?.title??"",description:ve?.body??"",acknowledgeLabel:ve?.ack??"",cancelLabel:n("card.cancel"),closeLabel:n("card.close"),confirmLabel:n("cfg.risk.confirm"),acknowledged:_,onAcknowledgedChange:k,onCancel:()=>Le(!1),onConfirm:()=>Le(!0)}))}function xn(e,t,n){let{change:a}=e,r={},s=a.added??a.removed;return s&&(r.names=s.map(n).join(t("cfg.sep"))),a.from!==void 0&&(r.from=a.from),a.to!==void 0&&(r.to=a.to),{title:t(a.risk==="send"?"cfg.risk.send.title":a.risk==="delete"?"cfg.risk.delete.title":"cfg.risk.log.title"),body:t(j(`cfg.r.${e.f.key}`),r),ack:t(a.risk==="send"?"cfg.risk.send.ack":a.risk==="delete"?"cfg.risk.delete.ack":"cfg.risk.log.ack")}}var ke="dsh-privacy-gateway",Dt="dsh-privacy-gateway";var Me="var(--ds-font-family-code,ui-monospace,monospace)",_n=`
5
5
  .pgw-card{display:flex;flex-direction:column;gap:16px;padding:16px 20px 20px;border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-lg,12px);background:var(--dsw-alias-bg-layer-1,transparent);color:var(--dsw-alias-label-primary);font-size:13px}
6
6
  .pgw-card--panel{box-sizing:border-box;width:min(calc(100% - 32px),var(--dsh-chat-content-width,920px));margin:0 auto;border:none;border-radius:0;background:transparent;padding:12px 0 20px}
7
7
  .pgw-session{display:inline-flex;align-items:center;gap:8px;font-size:13px;line-height:20px;color:var(--dsw-alias-label-primary);cursor:pointer}
@@ -11,6 +11,7 @@ var module = { exports: {} }; var exports = module.exports;
11
11
  .pgw-head__actions>:first-child{margin-right:8px}
12
12
  .pgw-title{font-size:15px;font-weight:600;line-height:22px;margin:0}
13
13
  .pgw-meta{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
14
+ .pgw-version{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums}
14
15
  .pgw-spacer{flex:1}
15
16
  .pgw-mono{font-family:${Me}}
16
17
  .pgw-reset{display:inline-flex;align-items:center;gap:4px;color:var(--dsw-alias-label-secondary)}
package/lib/index.js CHANGED
@@ -1,8 +1,8 @@
1
+ import { createReadStream, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
1
2
  import { dirname, join } from "node:path";
2
3
  import Schema from "@deepseek-ai/schemastery";
3
4
  import zlib from "node:zlib";
4
5
  import { Dispatcher, Dispatcher1Wrapper, getGlobalDispatcher, setGlobalDispatcher } from "undici";
5
- import { createReadStream, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
6
6
  import { chmod, mkdir, open, readdir, stat, unlink } from "node:fs/promises";
7
7
  import { createInterface } from "node:readline";
8
8
  import { createHash, createHmac, randomBytes } from "node:crypto";
@@ -1256,6 +1256,147 @@ function isWordChar(c) {
1256
1256
  return c !== void 0 && /[A-Za-z0-9_]/.test(c);
1257
1257
  }
1258
1258
 
1259
+ //#endregion
1260
+ //#region src/redact/placeholder.ts
1261
+ /**
1262
+ * The placeholder protocol: `⟦DSH_REDACTED:KIND_hash⟧` (docs/adr/0037).
1263
+ *
1264
+ * The brackets are U+27E6 and U+27E7, which no template language writes and
1265
+ * no config file has, and the namespace says what the text is: a value the
1266
+ * gateway took out, not one a tool may use. `{{KIND_hash}}` read as a
1267
+ * placeholder only by the gateway: a Go template, Helm, Jinja and Vue all
1268
+ * write the same braces, so an agent could not tell one from its own
1269
+ * variables (issue #2).
1270
+ *
1271
+ * The kind and the hash stay joined by `_`, as they were inside the braces: a
1272
+ * colon there (`API_KEY:hash`) is exactly the `name: value` a secret rule
1273
+ * masks, and the gateway would mask its own placeholder a second time
1274
+ * wherever the protection in `mask.ts` did not reach — a placeholder inside a
1275
+ * placeholder, with the value's mapping lost.
1276
+ */
1277
+ /** The namespace between the brackets: what tells a reader the text is a value the gateway took out. */
1278
+ const NAMESPACE = "DSH_REDACTED";
1279
+ /** The brackets around a placeholder. */
1280
+ const OPEN = "⟦";
1281
+ const CLOSE = "⟧";
1282
+ /** The longest kind a placeholder names: the masker's own, and a user's rule. */
1283
+ const MAX_KIND = 24;
1284
+ /** The longest placeholder the masker writes: ⟦, the namespace, :, a kind, _, the 8 of the hash, ⟧. */
1285
+ const MAX_PLACEHOLDER = 14 + MAX_KIND + 1 + 8 + 1;
1286
+ /** A body's pattern, as the masker writes it and as a model may write it back in another case. */
1287
+ const BODY_SOURCE = `${NAMESPACE}[ \\t]*:[ \\t]*([A-Za-z][A-Za-z0-9_]{0,${MAX_KIND - 1}})[ \\t]*_[ \\t]*([A-Za-z2-7]{8})`;
1288
+ /** A body of one text: no `g`, so reading one leaves no place for the next read to start. */
1289
+ const BODY_ONE = new RegExp(BODY_SOURCE, "i");
1290
+ /** A body in a scan: `g`, and its `lastIndex` is reset before each scan by `bodies`. */
1291
+ const BODY = new RegExp(BODY_SOURCE, "gi");
1292
+ /** Where a placeholder may start: its opening bracket, or the namespace with no bracket. */
1293
+ const START = new RegExp(`${OPEN}|${NAMESPACE}`, "gi");
1294
+ /**
1295
+ * The placeholder of `kind` with `hash`, whatever case it is given in. The
1296
+ * hash is the first 8 base32 characters of HMAC-SHA256(key, kind NUL value),
1297
+ * so the same value is the same placeholder every time (docs/adr/0002).
1298
+ */
1299
+ function format(kind, hash) {
1300
+ return `${OPEN}${NAMESPACE}:${kind.toUpperCase()}_${hash.toLowerCase()}${CLOSE}`;
1301
+ }
1302
+ /** The kind `p`, a placeholder, names; `''` where it names none. */
1303
+ function kindOf(p$1) {
1304
+ const m = BODY_ONE.exec(p$1);
1305
+ return m ? m[1].toUpperCase() : "";
1306
+ }
1307
+ /**
1308
+ * Where `s` has a placeholder, left to right, none overlapping: the body the
1309
+ * masker writes, or one a model wrote back with a bracket changed, dropped or
1310
+ * spaced, or in another case. The span takes in the brackets and the spaces
1311
+ * inside them, so a value put back replaces them too.
1312
+ *
1313
+ * A body with no namespace is no placeholder: `API_KEY_k3v9x2mq` is also a
1314
+ * name and a word, and putting a value there is a guess. A guess that is
1315
+ * wrong sends a value where it was not meant to go; a placeholder left as it
1316
+ * is only fails to put one back.
1317
+ */
1318
+ function bodies(s$1) {
1319
+ BODY.lastIndex = 0;
1320
+ const out = [];
1321
+ for (const m of s$1.matchAll(BODY)) {
1322
+ const a = m.index;
1323
+ const z = a + m[0].length;
1324
+ let start = a;
1325
+ let after = a;
1326
+ while (after > 0 && (s$1[after - 1] === " " || s$1[after - 1] === " ")) after--;
1327
+ if (after > 0 && s$1[after - 1] === OPEN) start = after - 1;
1328
+ else if (start > 0 && isWordChar(s$1[start - 1])) continue;
1329
+ let end = z;
1330
+ let before = z;
1331
+ while (before < s$1.length && (s$1[before] === " " || s$1[before] === " ")) before++;
1332
+ if (before < s$1.length && s$1[before] === CLOSE) end = before + 1;
1333
+ else if (end < s$1.length && isWordChar(s$1[end])) continue;
1334
+ out.push({
1335
+ start,
1336
+ end,
1337
+ kind: m[1],
1338
+ hash: m[2]
1339
+ });
1340
+ }
1341
+ return out;
1342
+ }
1343
+ /** Whether `s` holds what reads as a placeholder: the brackets, or the namespace in any case. */
1344
+ function hasPlaceholder(s$1) {
1345
+ return s$1.includes(OPEN) || s$1.toUpperCase().includes(NAMESPACE);
1346
+ }
1347
+ /**
1348
+ * How much of the end of `s` may be the start of a placeholder the next piece
1349
+ * of a stream finishes: from a ⟦ or a namespace on, up to a body that is not
1350
+ * whole yet, or a last word that starts the namespace (`d`, `ds`, `dsh_`).
1351
+ */
1352
+ function tailLen(s$1) {
1353
+ const at$1 = startOf(s$1);
1354
+ if (at$1 >= 0) {
1355
+ const t = s$1.slice(at$1);
1356
+ if (t.length <= MAX_PLACEHOLDER + 4 && couldStart(t)) return t.length;
1357
+ }
1358
+ let i = s$1.length;
1359
+ while (i > 0 && isWordChar(s$1[i - 1])) i--;
1360
+ const w = s$1.slice(i);
1361
+ if (w !== "" && w.length < 12 && NAMESPACE.startsWith(w.toUpperCase())) return w.length;
1362
+ return 0;
1363
+ }
1364
+ /** Where the last run that may open a placeholder starts, the bracket before its namespace included; -1 where none. */
1365
+ function startOf(s$1) {
1366
+ let open$1 = -1;
1367
+ let ns = -1;
1368
+ for (const m of s$1.matchAll(START)) if (s$1[m.index] === OPEN) open$1 = m.index;
1369
+ else ns = m.index;
1370
+ if (ns < 0) return open$1;
1371
+ if (open$1 >= 0 && open$1 < ns && s$1.slice(open$1 + 1, ns).trim() === "") return open$1;
1372
+ return ns;
1373
+ }
1374
+ /** Whether `t`, a tail of a text, may still become a placeholder with more characters after it. */
1375
+ function couldStart(t) {
1376
+ let i = 0;
1377
+ if (t[i] === OPEN) i++;
1378
+ i = skip(t, i);
1379
+ for (let k = 0; k < 12; k++) {
1380
+ if (i >= t.length) return true;
1381
+ if (t[i].toUpperCase() !== NAMESPACE[k]) return false;
1382
+ i++;
1383
+ }
1384
+ i = skip(t, i);
1385
+ if (i >= t.length) return true;
1386
+ if (t[i] !== ":") return false;
1387
+ const from = skip(t, i + 1);
1388
+ i = from;
1389
+ while (i < t.length && isWordChar(t[i])) i++;
1390
+ if (t.slice(from, i).length > MAX_KIND + 1 + 8) return false;
1391
+ i = skip(t, i);
1392
+ if (i < t.length) return false;
1393
+ return true;
1394
+ }
1395
+ function skip(s$1, i) {
1396
+ while (i < s$1.length && (s$1[i] === " " || s$1[i] === " ")) i++;
1397
+ return i;
1398
+ }
1399
+
1259
1400
  //#endregion
1260
1401
  //#region src/redact/ids.ts
1261
1402
  /** The kinds of personal data (Options.personal); any other is a secret's. */
@@ -1568,10 +1709,6 @@ function gram(s$1, i) {
1568
1709
  const g = (s$1.charCodeAt(i) ^ s$1.charCodeAt(i + 1) << 7 ^ s$1.charCodeAt(i + 2) << 14 ^ s$1.charCodeAt(i + 3) << 21) >>> 0;
1569
1710
  return Math.imul(g, 2654435761) >>> 12;
1570
1711
  }
1571
- function kindOf(p$1) {
1572
- const i = p$1.lastIndexOf("_");
1573
- return i > 2 ? p$1.slice(2, i) : "";
1574
- }
1575
1712
  /**
1576
1713
  * s[a:b] is the known value itself, not a piece of a longer one: a number
1577
1714
  * with no letter or digit beside it, an email not part of a longer address
@@ -2471,13 +2608,14 @@ function base32Head(bytes) {
2471
2608
  return out;
2472
2609
  }
2473
2610
  /**
2474
- * The placeholder a value of `kind` goes as: `{{KIND_xxxxxxxx}}`, the hash
2475
- * part the first 8 base32 characters of HMAC-SHA256(key, kind NUL value).
2476
- * The same value is the same placeholder every time, so a conversation's
2477
- * history reads the same turn after turn and masking it again changes nothing.
2611
+ * The placeholder a value of `kind` goes as: `⟦DSH_REDACTED:KIND_xxxxxxxx⟧`,
2612
+ * the hash part the first 8 base32 characters of HMAC-SHA256(key, kind NUL
2613
+ * value). The same value is the same placeholder every time, so a
2614
+ * conversation's history reads the same turn after turn and masking it again
2615
+ * changes nothing. The protocol is `placeholder.ts`'s (docs/adr/0037).
2478
2616
  */
2479
2617
  function tagOf(key, kind, value$1) {
2480
- return `{{${kind}_${base32Head(createHmac("sha256", key).update(`${kind}\0${value$1}`, "utf8").digest())}}}`;
2618
+ return format(kind, base32Head(createHmac("sha256", key).update(`${kind}\0${value$1}`, "utf8").digest()));
2481
2619
  }
2482
2620
 
2483
2621
  //#endregion
@@ -3308,8 +3446,6 @@ function placeOf(doc, path) {
3308
3446
  }
3309
3447
  return place;
3310
3448
  }
3311
- /** A placeholder as the masker writes it. */
3312
- const PLACEHOLDER_RE = /\{\{[A-Z][A-Z0-9_]*_[a-z2-7]{8}\}\}/g;
3313
3449
  /** A key holding an identifier the vendor matches against another (tool_call_id against its call's id). */
3314
3450
  function isID(key) {
3315
3451
  return key === "id" || key === "ids" || key.endsWith("_id") || key.endsWith("_ids") || key.endsWith("Id") || key.endsWith("Ids");
@@ -3587,10 +3723,13 @@ var Masker = class {
3587
3723
  let found = this.#find(raw, view, escaped, pass, knownOnly);
3588
3724
  if (found.length === 0) return none;
3589
3725
  const fixed = [...keep];
3590
- if (raw.includes("{{")) for (const m of raw.matchAll(PLACEHOLDER_RE)) fixed.push({
3591
- start: m.index,
3592
- end: m.index + m[0].length
3593
- });
3726
+ if (view !== void 0) {
3727
+ const seen = bodies(view.text);
3728
+ if (seen.length > 0) fixed.push(...inRaw(raw, view, seen.map((b) => ({
3729
+ ...b,
3730
+ by: "known"
3731
+ }))));
3732
+ } else if (hasPlaceholder(raw)) fixed.push(...bodies(raw));
3594
3733
  if (this.#table.shapes > 0) fixed.push(...this.#table.shapeSpans(raw));
3595
3734
  if (fixed.length > 0) found = found.filter((f) => !fixed.some((r) => overlaps(f, r)));
3596
3735
  found.sort((a, b) => a.start - b.start || b.end - a.end);
@@ -3766,11 +3905,6 @@ var Masker = class {
3766
3905
  //#endregion
3767
3906
  //#region src/redact/guard.ts
3768
3907
  /**
3769
- * Whether a tool call's arguments send a value put back off this machine
3770
- * (design §13 R15, docs/adr/0014): the hosts they name that are not this
3771
- * machine's.
3772
- */
3773
- /**
3774
3908
  * A URL's host: after the scheme and any user:password@, up to a port, a
3775
3909
  * path, a query or the end. The user part has no ? or #: in
3776
3910
  * https://evil.example#@localhost/ the @ is in the fragment, and the host is
@@ -3829,7 +3963,7 @@ function hostsOf(text, out) {
3829
3963
  if (text.includes("://")) for (const m of text.matchAll(URL_HOST)) {
3830
3964
  const scheme$1 = m[1].toLowerCase();
3831
3965
  const host = m[2].toLowerCase();
3832
- if (LOCAL_SCHEMES.has(scheme$1) || isLocalHost(host) || host.includes("{{")) continue;
3966
+ if (LOCAL_SCHEMES.has(scheme$1) || isLocalHost(host) || hasPlaceholder(host)) continue;
3833
3967
  out.add(host);
3834
3968
  }
3835
3969
  if (text.includes("@")) for (const m of text.matchAll(SCP_HOST)) {
@@ -3840,17 +3974,6 @@ function hostsOf(text, out) {
3840
3974
 
3841
3975
  //#endregion
3842
3976
  //#region src/redact/restore.ts
3843
- /**
3844
- * A placeholder's body, without its braces, as a model may write one back:
3845
- * API_KEY_k3v9x2mq, api_key_k3v9x2mq, API_KEY_K3V9X2MQ. A whole word, with a
3846
- * kind of 24 characters at most: tried from every place in a long word, an
3847
- * unbounded kind read the rest of it each time.
3848
- */
3849
- const PLACEHOLDER_BODY = /(?<![A-Za-z0-9_])[A-Za-z][A-Za-z0-9_]{0,23}_[A-Za-z2-7]{8}(?![A-Za-z0-9_])/g;
3850
- /** A placeholder as the masker writes it: one the table lacks is counted as unmapped (design §13 R11). */
3851
- const STRICT = /\{\{[A-Z][A-Z0-9_]*_[a-z2-7]{8}\}\}/g;
3852
- /** The longest placeholder the masker writes: {{, a kind of up to 24, _, the 8 of the hash, }}. */
3853
- const MAX_PLACEHOLDER = 37;
3854
3977
  function newTally() {
3855
3978
  return {
3856
3979
  restored: /* @__PURE__ */ new Map(),
@@ -3873,36 +3996,6 @@ const TOOL_PATH = /(?:^|\.)(?:tool_calls|function_call|functionCall|tool_use|arg
3873
3996
  function inToolCall(path, key, type) {
3874
3997
  return asJSON(key, type) || TOOL_PATH.test(path) || key === "delta" && type.includes("custom_tool_call_input");
3875
3998
  }
3876
- /** The placeholder the masker wrote for `body`, whatever its case. */
3877
- function canonical(body) {
3878
- const cut = body.length - 8;
3879
- return `{{${body.slice(0, cut).toUpperCase()}${body.slice(cut).toLowerCase()}}}`;
3880
- }
3881
- /**
3882
- * Widens s[a:z], a placeholder's body, over the braces the model wrote around
3883
- * it and the spaces inside them: both of {{ and }}, one of them dropped
3884
- * ({{X} or {X}}), or just {{ or just }}. A single brace on one side alone is
3885
- * the text's own ({X as in code) and stays (magpie `braces`).
3886
- */
3887
- function braces(s$1, a, z) {
3888
- let la = a;
3889
- let l = 0;
3890
- while (la > 0 && (s$1[la - 1] === " " || s$1[la - 1] === " ")) la--;
3891
- while (l < 2 && la > 0 && s$1[la - 1] === "{") {
3892
- la--;
3893
- l++;
3894
- }
3895
- let rz = z;
3896
- let r = 0;
3897
- while (rz < s$1.length && (s$1[rz] === " " || s$1[rz] === " ")) rz++;
3898
- while (r < 2 && rz < s$1.length && s$1[rz] === "}") {
3899
- rz++;
3900
- r++;
3901
- }
3902
- if (l === 2 || l === 1 && r >= 1) a = la;
3903
- if (r === 2 || r === 1 && l >= 1) z = rz;
3904
- return [a, z];
3905
- }
3906
3999
  /** How long the whole comment lines (": keep-alive") and blank lines at the start of b are: none of them is part of an event. */
3907
4000
  function commentLines(b) {
3908
4001
  let n = 0;
@@ -3925,7 +4018,7 @@ function splitEvent(ev) {
3925
4018
  let name$1 = "";
3926
4019
  const lines = ev.split(/(?<=\n)/);
3927
4020
  const at$1 = [];
3928
- const bodies = [];
4021
+ const bodies$1 = [];
3929
4022
  lines.forEach((l, i) => {
3930
4023
  const t = l.replace(/\r?\n$/, "");
3931
4024
  if (t.startsWith("event:")) name$1 = t.slice(6).trim();
@@ -3936,11 +4029,11 @@ function splitEvent(ev) {
3936
4029
  head: t.slice(0, start),
3937
4030
  eol: l.slice(t.length)
3938
4031
  });
3939
- bodies.push(t.slice(start));
4032
+ bodies$1.push(t.slice(start));
3940
4033
  }
3941
4034
  });
3942
4035
  if (at$1.length === 0) return void 0;
3943
- const data = bodies.join("\n");
4036
+ const data = bodies$1.join("\n");
3944
4037
  if (data[0] !== "{" && data[0] !== "[") return void 0;
3945
4038
  return {
3946
4039
  name: name$1,
@@ -3992,11 +4085,44 @@ function typeOf(data) {
3992
4085
  function sealedText(key, s$1) {
3993
4086
  return SIGNATURE_KEYS.has(key) || s$1.startsWith("data:") || key === "data" && s$1.length >= 64 && !/[ \n]/.test(s$1);
3994
4087
  }
4088
+ /** `⟦` or `⟧` as JSON text may have escaped it: a nested JSON text keeps the escape. */
4089
+ const BRACKET_ESCAPE = "\\\\u27e([67])";
4090
+ /**
4091
+ * `s` with a bracket escape read as the character it stands for, and where the
4092
+ * character taken from `at[i]` in `s` sits: a tool call's arguments are JSON
4093
+ * inside JSON, and a provider may write the brackets of a placeholder as
4094
+ * `\u27e6`/`\u27e7` there. `at` has one entry more than `text`, so a span's end
4095
+ * maps too.
4096
+ */
4097
+ function readable(s$1) {
4098
+ const re = new RegExp(BRACKET_ESCAPE, "gi");
4099
+ let text = "";
4100
+ const at$1 = [];
4101
+ let last = 0;
4102
+ for (let m = re.exec(s$1); m !== null; m = re.exec(s$1)) {
4103
+ for (let i = last; i < m.index; i++) {
4104
+ text += s$1[i];
4105
+ at$1.push(i);
4106
+ }
4107
+ text += m[1] === "6" ? OPEN : CLOSE;
4108
+ at$1.push(m.index);
4109
+ last = m.index + m[0].length;
4110
+ }
4111
+ for (let i = last; i < s$1.length; i++) {
4112
+ text += s$1[i];
4113
+ at$1.push(i);
4114
+ }
4115
+ at$1.push(s$1.length);
4116
+ return {
4117
+ text,
4118
+ at: at$1
4119
+ };
4120
+ }
3995
4121
  /**
3996
4122
  * Puts the values back in what the vendor says (magpie `Restore`): any
3997
- * placeholder this gateway made, also with its braces changed, dropped or
3998
- * spaced, or in another case, as long as its kind and the 8 of its hash
3999
- * name one in the table.
4123
+ * placeholder this gateway made, also with a bracket changed, dropped or
4124
+ * spaced, or in another case, as long as its kind and the 8 of its hash name
4125
+ * one in the table (docs/adr/0037).
4000
4126
  */
4001
4127
  var Restorer = class {
4002
4128
  #table;
@@ -4049,20 +4175,23 @@ var Restorer = class {
4049
4175
  return out.join("");
4050
4176
  }
4051
4177
  #placeholders(s$1, escaped, tally, tool, plain) {
4052
- if (tally && s$1.includes("{{")) {
4053
- for (const m of s$1.matchAll(STRICT)) if (this.#table.get(m[0]) === void 0) tally.unmapped++;
4054
- }
4178
+ const view = readable(s$1);
4179
+ const text = view ? view.text : s$1;
4180
+ const found = bodies(text);
4181
+ if (found.length === 0) return s$1;
4055
4182
  const out = [];
4056
4183
  let last = 0;
4057
- for (const m of s$1.matchAll(PLACEHOLDER_BODY)) {
4058
- let a = m.index;
4059
- let z = a + m[0].length;
4184
+ for (const f of found) {
4185
+ const a = view ? view.at[f.start] : f.start;
4186
+ const z = view ? view.at[f.end] : f.end;
4060
4187
  if (a < last) continue;
4061
- const p$1 = canonical(m[0]);
4188
+ const p$1 = format(f.kind, f.hash);
4062
4189
  const v = this.#table.get(p$1);
4063
- if (v === void 0 || plain && jsonEscape(v) !== v) continue;
4064
- [a, z] = braces(s$1, a, z);
4065
- if (a < last) continue;
4190
+ if (v === void 0) {
4191
+ if (tally && text.slice(f.start, f.end) === p$1) tally.unmapped++;
4192
+ continue;
4193
+ }
4194
+ if (plain && jsonEscape(v) !== v) continue;
4066
4195
  if (tally) {
4067
4196
  tally.restored.set(p$1, (tally.restored.get(p$1) ?? 0) + 1);
4068
4197
  if (tool) tally.inTools++;
@@ -4109,31 +4238,17 @@ var Restorer = class {
4109
4238
  return true;
4110
4239
  }
4111
4240
  /**
4112
- * How much of the end of s may be the start of a placeholder the next
4113
- * event finishes (magpie `partialTail`): from a { or {{ on, or a last word
4114
- * that starts as a kind this table has, up to the 8 of its hash.
4241
+ * How much of the end of s may be the start of a placeholder the next event
4242
+ * finishes (magpie `partialTail`): from a ⟦ or a namespace on, up to a body
4243
+ * that is not whole yet.
4115
4244
  */
4116
4245
  #partialTail(s$1) {
4117
- const n = braceTail(s$1);
4118
- return Math.max(n > 0 ? n : this.#wordTail(s$1), this.#table.shapeTail(s$1));
4119
- }
4120
- #wordTail(s$1) {
4121
- let i = s$1.length;
4122
- while (i > 0 && isWordChar(s$1[i - 1])) i--;
4123
- const w = s$1.slice(i);
4124
- if (w === "" || w.length > 33 || !/[A-Za-z]/.test(w[0])) return 0;
4125
- const u = w.toUpperCase();
4126
- for (const kind of this.#table.kinds()) {
4127
- const k = `${kind}_`;
4128
- if (k.startsWith(u)) return w.length;
4129
- if (u.startsWith(k) && u.length - k.length <= 8 && /^[a-z2-7]*$/.test(u.slice(k.length).toLowerCase())) return w.length;
4130
- }
4131
- return 0;
4246
+ return Math.max(tailLen(s$1), this.#table.shapeTail(s$1));
4132
4247
  }
4133
4248
  /**
4134
4249
  * A restorer for one `text/event-stream` reply, event by event as it comes
4135
4250
  * (magpie writer.go). A placeholder a stream splits between two events,
4136
- * {{API_ in one text delta and KEY_k3v9x2mq}} in the next, is put back
4251
+ * ⟦DSH_REDACTED:API_ in one text delta and KEY_k3v9x2mq⟧ in the next, is put back
4137
4252
  * whole: an event whose text ends in what may be the start of one is held
4138
4253
  * until the next, and if that one goes on with the same text the start
4139
4254
  * moves over to it. Nothing is added or dropped. Comment lines go on as
@@ -4289,27 +4404,6 @@ function eventToolText(ev) {
4289
4404
  if (!e) return void 0;
4290
4405
  return toolText(e.data, typeOf(e.data) || e.name, "");
4291
4406
  }
4292
- /** A tail from { or {{ on: then spaces, a placeholder's body or the start of one, then spaces and one } at most. */
4293
- function braceTail(s$1) {
4294
- let i = s$1.lastIndexOf("{");
4295
- if (i < 0) return 0;
4296
- if (i > 0 && s$1[i - 1] === "{") i--;
4297
- const t = s$1.slice(i);
4298
- if (t.length >= MAX_PLACEHOLDER + 4 || t.includes("}}")) return 0;
4299
- const body = t.replace(/^\{+/, "").replace(/^[ \t]+/, "");
4300
- if (body === "") return t.length;
4301
- if (!/[A-Za-z]/.test(body[0])) return 0;
4302
- let j = 0;
4303
- while (j < body.length && isWordChar(body[j])) j++;
4304
- const rest = body.slice(j).replace(/^[ \t]+/, "");
4305
- if (rest !== "" && rest !== "}") return 0;
4306
- if (j < body.length) {
4307
- const word = body.slice(0, j);
4308
- const m = word.match(PLACEHOLDER_BODY);
4309
- if (!m || m[0] !== word) return 0;
4310
- }
4311
- return t.length;
4312
- }
4313
4407
 
4314
4408
  //#endregion
4315
4409
  //#region src/first.ts
@@ -5729,6 +5823,21 @@ const COMMAND_TEXT = {
5729
5823
  hint: "status | on | off | test <text>"
5730
5824
  }
5731
5825
  };
5826
+ /**
5827
+ * The plugin's own version, from the `package.json` beside `lib/` (the package
5828
+ * ships both, docs/adr/0006). Undefined where it cannot be read: a build that
5829
+ * put the entry elsewhere still works, and the tab then shows no version.
5830
+ */
5831
+ function readVersion() {
5832
+ try {
5833
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
5834
+ return typeof pkg.version === "string" && pkg.version !== "" ? pkg.version : void 0;
5835
+ } catch {
5836
+ return;
5837
+ }
5838
+ }
5839
+ /** Read once: a running process's version does not change. */
5840
+ const currentVersion = readVersion();
5732
5841
  const name = "dsh-privacy-gateway";
5733
5842
  /** The longest title or workspace name a record keeps, in characters (docs/adr/0020). */
5734
5843
  const NAME_CHARS = 200;
@@ -5875,7 +5984,8 @@ function apply(ctx, config = {}) {
5875
5984
  views: c.vendorView ? views.keys() : [],
5876
5985
  showPanel: liveBool(config.showPanel, c.showPanel),
5877
5986
  excludeProviders: excludedProviders(),
5878
- ...session ? { sessionMasking: !sessions.isOff(session) } : {}
5987
+ ...session ? { sessionMasking: !sessions.isOff(session) } : {},
5988
+ ...currentVersion !== void 0 ? { version: currentVersion } : {}
5879
5989
  };
5880
5990
  },
5881
5991
  setSessionMasking: (session, on) => {
@@ -5926,13 +6036,13 @@ function apply(ctx, config = {}) {
5926
6036
  ctx.on?.("session/event", (session, event) => stepBook.observe(session, event));
5927
6037
  ctx.on?.("llm/stream", (call, next) => routeStream(call?.provider, excludedProviders(), next, call?.sessionId));
5928
6038
  ctx.effect(() => {
5929
- const skip = makeSkip({
6039
+ const skip$1 = makeSkip({
5930
6040
  enabled: () => engine.active && current$1().enabled,
5931
6041
  sessionOff: (session) => sessions.isOff(session)
5932
6042
  });
5933
6043
  const gateway = installGateway(engine, {
5934
6044
  excludeHosts: cfg.excludeHosts,
5935
- skip,
6045
+ skip: skip$1,
5936
6046
  logger: ctx.logger
5937
6047
  });
5938
6048
  ctx.logger.info("dsh-privacy-gateway: installed in front of the global dispatcher");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-privacy-gateway",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Process-wide HTTP redaction gateway for DSH: masks secrets in outgoing model requests; replies keep placeholders in the session log by default, and restoreLog writes the real values back before it is written, for every provider.",
6
6
  "icon": "./assets/icon.svg",