dsh-privacy-gateway 0.2.0 → 0.2.1

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
@@ -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.0/dsh-privacy-gateway-0.2.0.tgz
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
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)).
@@ -31,6 +31,25 @@ In the default web profile the first install works at once, with no restart of t
31
31
  - **The `/privacy` command**: status, a temporary on / off, and `test` to preview how a text would go out.
32
32
  - **Live configuration**: everyday items are changed on the plugin page and apply from the next call; when masking fails, the request is not sent.
33
33
 
34
+ ## How it works
35
+
36
+ The gateway has this one interception point, and both directions happen at the HTTP layer:
37
+
38
+ ```mermaid
39
+ flowchart LR
40
+ A["agent / adapter<br/>(through the global fetch)"] -->|"① model request"| G["privacy gateway<br/>undici dispatcher"]
41
+ G -->|"② secrets, credentials, personal data<br/>and your own words become placeholders"| M["model service"]
42
+ M -->|"③ reply (with placeholders)"| G
43
+ G -->|"④ default: placeholders as they are"| L["agent and session log"]
44
+ G -->|"④ restoreLog on: the real values"| L
45
+ G -.->|"metadata only, never a value"| R["records / statistics"]
46
+ G -.->|"placeholder ↔ value"| T["value table (memory only)"]
47
+ ```
48
+
49
+ - **Outbound (①②)**: a value a rule finds becomes a placeholder, so the model service only ever gets placeholders; the values stay in the in-memory table, which is what makes the same value the same placeholder every turn.
50
+ - **Inbound (③④)**: with `restoreLog` off (the default) the placeholders reach the agent and the session log as they are; with it on they become the real values before the log is written, so the agent and the log agree — the reply has this one restore point.
51
+ - **Sideways**: a request records metadata only (placeholder, kind, head, length); the records, the statistics and the Remote answers never hold a value.
52
+
34
53
  ## What is masked
35
54
 
36
55
  | Kind | What | Switch |
package/README.md CHANGED
@@ -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.0/dsh-privacy-gateway-0.2.0.tgz
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
19
19
  ```
20
20
 
21
21
  预发布版本号带 `-`,只发 GitHub Release、不发 npm。仓库不提交 `lib/`,`dsh plugin add github:…` 拿到的树加载不了([ADR-0006](docs/adr/0006-distribution-and-build-artifacts.md))。
@@ -31,6 +31,25 @@ dsh plugin --profile web add https://github.com/xbzbing/dsh-privacy-gateway/rele
31
31
  - **`/privacy` 命令**:查状态、临时开关、`test` 预览一段文本会怎样发出。
32
32
  - **配置热更新**:日常项在插件页上改,下一次调用即生效;脱敏出错时请求不发出。
33
33
 
34
+ ## 原理
35
+
36
+ 网关只有这一个拦截点,出站与入站都在 HTTP 层完成:
37
+
38
+ ```mermaid
39
+ flowchart LR
40
+ A["agent / adapter<br/>(走全局 fetch)"] -->|"① 模型请求"| G["隐私网关<br/>undici dispatcher"]
41
+ G -->|"② 密钥、凭据、个人信息、<br/>自定义词换成占位符"| M["模型服务"]
42
+ M -->|"③ 回复(含占位符)"| G
43
+ G -->|"④ 默认:占位符原样"| L["agent 与会话日志"]
44
+ G -->|"④ 打开 restoreLog:换回真值"| L
45
+ G -.->|"只记元信息,不含真值"| R["脱敏记录 / 统计"]
46
+ G -.->|"占位符 ↔ 真值"| T["值表(只在内存)"]
47
+ ```
48
+
49
+ - **出站(①②)**:请求体里命中规则的值换成占位符,模型服务只拿到占位符;原值只留在内存的值表里,同一个值每轮都是同一个占位符。
50
+ - **入站(③④)**:`restoreLog` 关闭(默认)时占位符原样交给 agent、原样写进会话日志;打开后在日志落盘前换回真值,agent 与日志都拿到真值——回复方向只有这一个还原点,两边必然一致。
51
+ - **旁路**:每个请求只记元信息(占位符、kind、开头、长度),记录、统计和 Remote 返回值里都没有真值。
52
+
34
53
  ## 脱敏范围
35
54
 
36
55
  | kind | 内容 | 开关 |
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
- "use strict";var ye=require("react");var he=require("@deepseek-ai/dsh-client-ui-primitives"),g=require("react");var M=require("@deepseek-ai/dsh-client-ui-primitives"),w=require("react");var oe=["mask","lists","record","view"],se=[{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 Fe(e,t,n){if(e.risk)switch(e.kind){case"switch":{let r=te(t,e.default),a=te(n,e.default);return(e.riskWhen==="on"?!r&&a:r&&!a)?{risk:e.risk}:void 0}case"list":case"providers":{let r=e.kind==="providers"||e.anyCase,a=u=>r?u.trim().toLowerCase():u.trim(),s=(u,h)=>{let _=new Set(u.map(a));return h.filter(k=>!_.has(a(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 r=ne(t,e.min,e.default),a=ne(n,e.min,e.default);return a<r?{risk:e.risk,from:r,to:a}:void 0}case"choice":return}}function Le(e){return e.kind==="switch"||e.kind==="choice"||e.kind==="count"}function Q(e,t){let n=se.find(r=>r.key===e&&r.kind===t);if(!n)throw new Error(`no ${t} field ${e}`);return n}function Ke(e,t){let n=r=>te(t[r],Q(r,"switch").default);switch(e){case"mask":{if(!n("enabled"))return[{key:"cfg.s.maskOff",off:!0}];let r=["secrets","personal"].filter(n),a=r.length===0?[{key:n("maskKeys")?"cfg.s.maskKeysOnly":"cfg.s.maskNothing",off:!0}]:r.map(i=>({key:`cfg.s.${i}`}));n("shape")&&a.push({key:"cfg.s.shape"});let s=Q("toolGuard","choice");return a.push({key:`cfg.s.toolGuard.${ve(t.toolGuard,s.choices,s.default)}`}),n("restoreLog")&&a.push({key:"cfg.s.restoreLog"}),a}case"lists":return[{key:"cfg.s.words",params:{n:W(t.words,Q("words","list").default).length}},{key:"cfg.s.allow",params:{n:W(t.allow,Q("allow","list").default).length}}];case"record":{let r=Q("keepDays","count"),a=n("record")?[{key:"cfg.s.record",params:{n:ne(t.keepDays,r.min,r.default)}}]:[{key:"cfg.s.recordOff",off:!0}];return n("vendorView")&&a.push({key:"cfg.s.vendorView"}),a}case"view":{let r=W(t.excludeProviders,Q("excludeProviders","providers").default).length;return[n("showPanel")?{key:"cfg.s.panel"}:{key:"cfg.s.panelOff",off:!0},r===0?{key:"cfg.s.providersAll"}:{key:"cfg.s.providersSome",params:{n:r}}]}}}function te(e,t){return typeof e=="boolean"?e:t}function ve(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 ne(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t?Math.floor(e):n}function De(e,t,n){let r=t.trim();if(r==="")return;let a=n?s=>s.trim().toLowerCase()===r.toLowerCase():s=>s.trim()===r;return e.some(a)?void 0:[...e,r]}function Ve(e,t){return e.filter(n=>n!==t)}function $e(e,t){let n=e.trim();if(!/^\d+$/.test(n))return;let r=Number(n);return Number.isSafeInteger(r)&&r>=t?r:void 0}function ze(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 Be(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 He(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)(M.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 We(e){return(0,w.createElement)(M.Switch,{checked:e.checked,label:e.label,disabled:e.disabled,onChange:e.onChange})}function xe(e){let[t,n]=(0,w.useState)(!1),r=(0,w.useId)();return(0,w.useEffect)(()=>{e.disabled&&n(!1)},[e.disabled]),(0,w.createElement)(M.Menu,{open:t,onClose:()=>n(!1),items:e.items,...e.multi?{selectedIds:e.selectedIds??[],selection:"check"}:{selectedId:e.selectedId},onSelect:a=>{e.multi||n(!1),e.onSelect(a)},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} ${r}`:void 0,disabled:e.disabled||e.items.length===0,onClick:()=>n(a=>!a)},(0,w.createElement)("span",{className:"pgw-select__label",id:r},e.label),(0,w.createElement)(M.IconChevronDownOutlineRegular,{className:"pgw-select__chevron"}))})}function je(e){let{t}=e,[n,r]=(0,w.useState)(""),[a,s]=(0,w.useState)(!1),i=De(e.list,n,e.anyCase),l=()=>{if(!i||e.disabled||a)return;let d=n;s(!0),e.onChange(i).then(u=>{s(!1),u&&r(h=>h===d?"":h)})};return(0,w.createElement)("div",{className:"pgw-cfg__list"},(0,w.createElement)("div",{className:"pgw-cfg__add"},(0,w.createElement)(M.Input,{className:"pgw-cfg__input",type:"text",value:n,placeholder:e.placeholder,"aria-label":e.label,disabled:e.disabled,onChange:d=>r(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),l())}}),(0,w.createElement)(M.Button,{variant:"outline",size:"sm",disabled:e.disabled||a||!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)(M.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(Ve(e.list,d))}},(0,w.createElement)(M.IconCloseOutlineRegular,{size:12}))))))}function Ge(e){let[t,n]=(0,w.useState)(String(e.value)),r=(0,w.useRef)(void 0);(0,w.useEffect)(()=>n(String(e.value)),[e.value]);let a=$e(t,e.min),s=()=>{a===void 0||a===e.value||a===r.current||(r.current=a,e.onChange(a).then(()=>{r.current=void 0}))};return(0,w.createElement)("div",{className:"pgw-cfg__list"},(0,w.createElement)(M.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":a===void 0,disabled:e.disabled,onChange:i=>n(i.target.value),onBlur:s,onKeyDown:i=>{i.key==="Enter"&&s()}}),a===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 qe(e,t=6,n="\u2026"){let r=Object.entries(e).filter(([,l])=>l>0).sort((l,d)=>d[1]-l[1]||(l[0]<d[0]?-1:1)),a=r.slice(0,t),s=r.slice(t).reduce((l,[,d])=>l+d,0);s>0&&a.push([n,s]);let i=a.reduce((l,[,d])=>Math.max(l,d),0);return a.map(([l,d])=>({label:l,value:d,pct:i>0?Math.max(2,Math.round(d/i*100)):0}))}var Ht={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"},Wt={rule:"hint.finder.rule",word:"hint.finder.word",known:"hint.finder.known",cookie:"hint.finder.cookie"};function Ye(e){return Ht[e]}function Je(e){return Wt[e]}function Ue(e,t){return e.filter(n=>(t.kind===void 0||n.kind===t.kind)&&(t.finder===void 0||n.finder===t.finder))}function Ce(e,t){return[...new Set(e.map(n=>n[t]).filter(n=>n!==""))].sort()}function Qe(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 Xe(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 Se(e,t=new Date){let n=new Date(e);if(Number.isNaN(n.getTime()))return"";let r=s=>String(s).padStart(2,"0");return n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate()?`${r(n.getHours())}:${r(n.getMinutes())}:${r(n.getSeconds())}`:`${r(n.getMonth()+1)}-${r(n.getDate())} ${r(n.getHours())}:${r(n.getMinutes())}`}var G=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),S=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function ie(e){let t={};if(G(e))for(let[n,r]of Object.entries(e))typeof r=="number"&&Number.isFinite(r)&&(t[n]=r);return t}function _e(e){if(!G(e))return;let t=G(e.tookMs)?e.tookMs:{};return{requests:S(e.requests),masked:S(e.masked),n:S(e.n),restored:S(e.restored),restoredInTools:S(e.restoredInTools),unmapped:S(e.unmapped),failed:S(e.failed),warned:S(e.warned),blocked:S(e.blocked),exfil:S(e.exfil),exfilBlocked:S(e.exfilBlocked),tookMs:{sum:S(t.sum),max:S(t.max)},kinds:ie(e.kinds),finders:ie(e.finders),hosts:ie(e.hosts),models:ie(e.models)}}function jt(e){return G(e)&&typeof e.key=="number"&&typeof e.time=="string"&&Array.isArray(e.values)&&e.values.every(G)}function Ze(e){if(!(!G(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 Gt(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let r of e){let a=Ze(r);a===void 0||n.has(a.path)||(n.add(a.path),t.push(a))}return t}var qt=7,Ne=e=>Math.max(0,Math.floor(S(e)));function Yt(e){if(typeof e.placeholder!="string"||e.placeholder==="")return;let t=h=>typeof h=="string"?h:void 0,n=t(e.tail),r=t(e.before),a=t(e.after),s=Ze(e.at),i=le(e.first??{}),l=Gt(e.elsewhere),d=l.slice(0,qt),u=Ne(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:Ne(e.len),n:Ne(e.n),...e.action==="warn"||e.action==="block"?{action:e.action}:{},...r!==void 0?{before:r}:{},...a!==void 0?{after:a}:{},...s?{at:s}:{},...i?{first:i}:{},...d.length>0?{elsewhere:d}:{},...u>0?{elsewhereOmitted:u}:{}}}function le(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 et(e){return`${e.turn}\xB7${e.step}`}function Jt(e){let{valuesOmitted:t,turn:n,step:r,model:a,host:s,what:i,tookMs:l,title:d,workspace:u,session:h,exfil:_,exfilHosts:k,restoredInTools:y,warned:m,failed:O,blocked:A,relay:D,...V}=e,K=L=>typeof L=="string"?L:void 0,p=S(t),F=le({turn:n,step:r}),z=K(a),I=K(d),B=K(u),N=K(h),U=S(_),ae=S(y),$=S(m),Z=Array.isArray(k)?k.filter(L=>typeof L=="string"):void 0;return{...V,host:K(s)??"",what:i==="chat"||i==="embeddings"||i==="count"||i==="search"?i:"chat",tookMs:S(l),n:S(e.n),restored:S(e.restored),unmapped:S(e.unmapped),values:e.values.map(Yt).filter(L=>L!==void 0),...z!==void 0?{model:z}:{},...I!==void 0?{title:I}:{},...B!==void 0?{workspace:B}:{},...N!==void 0?{session:N}:{},...U>0?{exfil:U}:{},...Z!==void 0&&Z.length>0?{exfilHosts:Z}:{},...ae>0?{restoredInTools:ae}:{},...$>0?{warned:$}:{},...O===!0?{failed:!0}:{},...A===!0?{blocked:!0}:{},...D===!0?{relay:!0}:{},...p>0?{valuesOmitted:p}:{},...F??{}}}function tt(e){if(!G(e)||typeof e.active!="boolean"||!G(e.stats)||!Array.isArray(e.recent))return;let t=_e(e.stats.today),n=_e(e.stats.week),r=_e(e.stats.month);if(!t||!n||!r)return;let{restoreLog:a,...s}=e;return{...s,...typeof a=="boolean"?{restoreLog:a}:{},values:S(e.values),stats:{today:t,week:n,month:r,failStreak:S(e.stats.failStreak)},recent:e.recent.filter(jt).map(Jt),...Array.isArray(e.views)?{views:e.views.filter(i=>typeof i=="number")}:{}}}function nt(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 rt(e){return e.n===0&&e.failed!==!0&&(e.unmapped??0)===0}var Ut=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function at(e){let t=e;try{t=JSON.stringify(JSON.parse(e),null,2)}catch{}return t.split(`
4
- `)}function ot(e){return e.map(t=>t.placeholder).join("\0")}function st(e,t,n,r=400){let a=[...new Set(t.filter(d=>d!==""))].sort((d,u)=>u.length-d.length),s=a.length>0?new RegExp(a.map(Ut).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>=r){l=!0;break}i.push({n:d+1,parts:h})}}return{lines:i,truncated:l}}function it(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),a=Math.min(Math.max(0,Math.floor(t)),r-1);return{items:e.slice(a*n,a*n+n),page:a,pages:r}}function lt(e){let{path:t,role:n,type:r}=e,a=t.split(".")[0]??"";return n==="system"||n==="developer"||a==="system"||a==="instructions"||a==="systemInstruction"?"place.system":n==="tool"||r==="tool_result"||r==="function_call_output"||r==="functionResponse"?"place.toolResult":r==="tool_use"||r==="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 Re(e){let t=e.split("."),n=t[0]??"",r=t[1]??"";return n!==""&&/^\d+$/.test(r)?`${n}.${r}`:n}function dt(e,t){let n=[...new Set((e.elsewhere??[]).map(a=>Re(a.path)))].filter(a=>a!=="").join(t("recent.placeSep")),r=e.elsewhereOmitted??0;return n===""?r>0?t("recent.elsewhereOmitted",{n:r}):"":r>0?t("recent.elsewhereMore",{paths:n,n:r}):t("recent.elsewhere",{paths:n})}function de(e){return e.head?e.tail?`${e.head}\u2026${e.tail}`:`${e.head}\u2026`:""}function q(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 re(e,t,n,r,a){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},a);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=r(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 ce(e,t,n,r){return re(e,"overview",r?{limit:t,session:r}:{limit:t},tt,n)}function ct(e,t,n){return re(e,"vendorView",{key:t},r=>{if(r===null)return null;let a=r?.body;return typeof a=="string"?a:void 0},n)}function ft(e){return re(e,"reset",void 0,t=>{let n=t?.files;return typeof n=="number"?n:0})}function ut(e,t,n){return re(e,"sessionMasking",{session:t,on:n},r=>{let a=r?.on;return typeof a=="boolean"?a:void 0})}function pt(e,t){return re(e,"providers",void 0,n=>Array.isArray(n)?n.flatMap(Qt):void 0,t)}function Qt(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(r){if(!Object.is(r,t)){t=r;for(let a of[...n])try{a()}catch{}}},subscribe(r){return n.add(r),()=>{n.delete(r)}}}}var Xt="Show the Privacy tab at the top of the session";function Zt(e){let t=e,n=t?.refs,a=(n!==null&&typeof n=="object"&&typeof t?.uid<"u"?n[String(t.uid)]:void 0)?.dict??t?.dict;return a!==null&&typeof a=="object"?Object.keys(a):[]}function Te(e){for(let t of e){let n=Zt(t.schema);if(n.includes("showPanel")&&(t.ns.includes("privacy-gateway")||n.includes("excludeProviders")||JSON.stringify(t.schema??null).includes(Xt)))return t.ns}}function en(e){let t=Te(e);if(t===void 0)return;let n=e.find(r=>r.ns===t)?.value;return typeof n=="object"&&n!==null&&n.showPanel===!0}function tn(e){let t=e;return t!=null&&typeof t.describe=="function"&&typeof t.get=="function"?t:void 0}var J=fe(void 0);function gt(e){let t=n=>n.effect(()=>{let r;try{r=tn(n.get("configForms"))}catch{r=void 0}return J.set(r),()=>{J.get()===r&&J.set(void 0)}},"dsh-privacy-gateway: settings service");typeof e.inject=="function"?e.inject(["configForms"],t):t(e)}var nn=6e4;function rn(e,t){return t===void 0?e:t||e===!0?!0:e===!1?!1:void 0}function mt(e,t,n=J){let r=!1,a,s,i,l=()=>{if(r)return;let y=rn(s,i);y===void 0||y===a||(a=y,t(y))},d=()=>{ce(e,1).then(y=>{r||!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 O=m,A=()=>{if(r)return;let D=O.getSnapshot().view;if(!D)return;let V=en(D.namespaces);V!==void 0&&(i=V,l())};u=O.subscribe(A),Promise.resolve(O.ensure()).then(A,A),A()}l()},_=n.subscribe(()=>h(n.get()));h(n.get()),d();let k=setInterval(d,nn);return()=>{r=!0,clearInterval(k),_();try{u?.()}catch{}}}function ht(e,t){let n=a=>t.some(s=>s.toLowerCase()===a.toLowerCase()),r=e.map(a=>({id:a.id,name:a.name,excluded:n(a.id),registered:!0}));for(let a of t)r.some(s=>s.id.toLowerCase()===a.toLowerCase())||r.push({id:a,name:a,excluded:!0,registered:!1});return r}function wt(e,t){let n=t.toLowerCase();return e.some(r=>r.toLowerCase()===n)?e.filter(r=>r.toLowerCase()!==n):[...e,t]}var It=require("react");var yt={"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","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 kt={"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.","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 Y="privacyGateway";var bt={zh:yt,en:kt};var T=require("@deepseek-ai/dsh-client-ui-primitives"),f=require("react");var x=require("@deepseek-ai/dsh-client-ui-primitives"),o=require("react");var ue=require("@deepseek-ai/dsh-client-ui-primitives"),b=require("react");function an(e,t){if(!e)return t("view.unknown");let n=e.action?` \xB7 ${t(e.action==="warn"?"action.warn":"action.block")}`:"",r=de(e);return`\u2039${e.kind} \xB7 ${r?`${r} \xB7 `:""}${e.len}${n}\u203A`}function vt(e,t,n,r){return e.parts.map((a,s)=>a.id===void 0?a.text:(0,b.createElement)("mark",{key:s,className:`pgw-view__mark${n?" pgw-view__mark--agent":""}`,title:a.id},n?an(t.get(a.id),r):a.text))}function xt(e){let{ctx:t,t:n,record:r}=e,[a,s]=(0,b.useState)({status:"loading"}),[i,l]=(0,b.useState)(!0);(0,b.useEffect)(()=>{let m=new AbortController;return s({status:"loading"}),ct(t,r.key,m.signal).then(O=>{m.signal.aborted||s(O.ok?O.value===null?{status:"gone"}:{status:"ready",body:O.value}:{status:"error",failure:O.failure})}),()=>m.abort()},[t,r.key]);let d=ot(r.values),u=(0,b.useMemo)(()=>new Map(r.values.map(m=>[m.placeholder,m])),[r.key,d]),h=a.status==="ready"?a.body:void 0,_=(0,b.useMemo)(()=>h!==void 0?at(h):void 0,[h]),k=(0,b.useMemo)(()=>_?st(_,[...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)(ue.Checkbox,{checked:i,label:n("view.onlyChanged"),className:"pgw-meta",onChange:l}),(0,b.createElement)("span",{className:"pgw-spacer"}),(0,b.createElement)(ue.Button,{variant:"outline",size:"sm",onClick:e.onClose},n("view.close")));if(!k){let m=a.status==="loading"?n("view.loading"):a.status==="gone"?n("view.gone"):a.status==="error"?n("view.failed",{reason:q(a.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"},...vt(m,u,!0,n)),(0,b.createElement)("td",{className:"pgw-view__code"},...vt(m,u,!1,n))))))),k.truncated?(0,b.createElement)("div",{className:"pgw-meta"},n("view.truncated",{n:k.lines.length})):null)}function Nt(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 Ct(e){let{totals:t,t:n}=e,r=l=>(l??0).toLocaleString(),a=Xe(t),s=e.restoreLog===!1,i=[{label:n("stat.requests"),value:r(t.requests)},{label:n("stat.masked"),value:r(t.masked)},{label:n("stat.n"),value:r(t.n)},{label:n("stat.restored"),value:s?n("stat.restoreOff"):r(t.restored),...!s&&t.restoredInTools>0?{sub:n("stat.inTools",{n:t.restoredInTools})}:{}},{label:n("stat.unmapped"),value:s?n("stat.restoreOff"):r(t.unmapped),...!s&&t.unmapped>0?{tone:"warn"}:{}},{label:n("stat.failed"),value:r(t.failed),...t.failed>0?{tone:"error"}:{}}];return(t.warned??0)>0&&i.push({label:n("stat.warned"),value:r(t.warned),tone:"warn"}),(t.blocked??0)>0&&i.push({label:n("stat.blocked"),value:r(t.blocked),tone:"warn"}),(t.exfil??0)>0&&i.push({label:n("stat.exfil"),value:r(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:a.avg}),sub:n("stat.tookMax",{max:a.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 Ie(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 on(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 pe(e){let{t,field:n}=e,r=qe(e.data,6,e.others),a=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)(Ie,{t,field:n,note:!0})});return(0,o.createElement)("div",{className:"pgw-dist"},(0,o.createElement)("div",{className:"pgw-section__title"},a),r.length===0?(0,o.createElement)("div",{className:"pgw-empty"},e.empty):r.map(s=>{let i=n===void 0?void 0:(n==="kind"?Ye:Je)(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)(on,{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 St(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 Oe="*";function _t(e){let{t,field:n}=e,[r,a]=(0,o.useState)(!1),s=t(n==="kind"?"col.kind":"col.finder"),i=[{id:Oe,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":r,"aria-label":t("filter.aria",{name:t(n==="kind"?"filter.kind":"filter.finder"),value:e.value??t("filter.all")}),onClick:()=>a(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:r,onClose:()=>a(!1),items:i,selectedId:e.value??Oe,onSelect:d=>{a(!1),e.onChange(d===Oe?void 0:d)},align:"start",portal:!0,anchor:(0,o.createElement)(x.HoverCard,{anchor:l,content:e.hint,disabled:r})})}function Rt(e){let{r:t,t:n}=e,[r,a]=(0,o.useState)(!1),[s,i]=(0,o.useState)(void 0),[l,d]=(0,o.useState)(void 0),u=Ue(t.values,{...s===void 0?{}:{kind:s},...l===void 0?{}:{finder:l}}),h=Ce(t.values,"kind"),_=Ce(t.values,"finder"),k=(0,o.useId)(),y=le(t),m=y?n("recent.stepAt",y):"",O=y?n("recent.stepSent",y):"",A=[t.workspace,t.title??t.session].filter(p=>typeof p=="string"&&p!=="").join(" \xB7 "),D=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()),V=t.failed?n("recent.failed"):t.blocked?n("recent.blocked"):t.n.toLocaleString(),K=[[n("recent.col.time"),Se(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"),A],[n("recent.col.places"),V],[n("recent.col.restored"),t.unmapped>0?`${t.restored.toLocaleString()} (+${t.unmapped})`:t.restored.toLocaleString()]].filter(([,p])=>p!=="").map(([p,F])=>n("recent.cell",{name:p,value:F})).join(n("recent.cellSep"));return(0,o.createElement)("li",{className:"pgw-recs__item"},(0,o.createElement)("button",{type:"button",className:`pgw-rec${rt(t)?" pgw-rec--zero":""}${e.open?" pgw-rec--open":""}`,"aria-expanded":e.open,"aria-controls":e.open?k:void 0,"aria-label":K,onClick:e.toggle},(0,o.createElement)(x.IconChevronRightOutlineRegular,{size:12,className:"pgw-rec__chevron"}),(0,o.createElement)("span",{className:"pgw-rec__time"},Se(t.time)),(0,o.createElement)("span",{className:"pgw-rec__step",title:m||void 0},y?et(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:A},A),(0,o.createElement)("span",{className:"pgw-rec__num"},D),(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"},O):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)(_t,{t:n,field:"kind",names:h,value:s,hint:(0,o.createElement)(Ie,{t:n,field:"kind"}),onChange:i})),(0,o.createElement)("th",{key:"col.finder"},(0,o.createElement)(_t,{t:n,field:"finder",names:_,value:l,hint:(0,o.createElement)(Ie,{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(p=>{let F=dt(p,n),z=p.first?n("recent.valueFirst",{turn:p.first.turn,step:p.first.step}):y?n("recent.valueFirstHere"):"",I=p.at!==void 0||p.before!==void 0||p.after!==void 0||F!==""||z!=="";return[(0,o.createElement)("tr",{key:p.placeholder,className:p.before!==void 0||p.after!==void 0?"pgw-values__has":void 0},(0,o.createElement)("td",{className:"pgw-mono"},p.placeholder),(0,o.createElement)("td",null,p.kind),(0,o.createElement)("td",null,p.finder),(0,o.createElement)("td",{className:"pgw-mono"},de(p)),(0,o.createElement)("td",null,p.len),(0,o.createElement)("td",null,p.n),(0,o.createElement)("td",null,p.action?n(p.action==="warn"?"action.warn":"action.block"):"")),I?(0,o.createElement)("tr",{key:`${p.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"},p.at?(0,o.createElement)(x.Tag,{tone:"neutral",className:"pgw-ctx__place",title:p.at.path},n(lt(p.at)),(0,o.createElement)("span",{className:"pgw-ctx__path pgw-mono"},`\xB7 ${Re(p.at.path)}`)):null,p.before!==void 0||p.after!==void 0?(0,o.createElement)("span",{className:"pgw-ctx__text",title:n("recent.contextHint")},p.before??"",(0,o.createElement)("mark",{className:"pgw-ctx__mark pgw-mono"},p.placeholder),p.after??""):null),F!==""?(0,o.createElement)("div",{className:"pgw-ctx__more"},F):null,z!==""?(0,o.createElement)("div",{className:"pgw-ctx__more"},z):null))):null]}))),t.valuesOmitted?(0,o.createElement)("div",{className:"pgw-meta"},n("recent.omitted",{n:t.valuesOmitted.toLocaleString()})):null,e.viewable&&!r?(0,o.createElement)("div",null,(0,o.createElement)(x.Button,{variant:"outline",size:"sm",onClick:()=>a(!0)},n("view.open"))):null,e.viewable&&r?(0,o.createElement)(xt,{ctx:e.ctx,t:n,record:t,onClose:()=>a(!1)}):null):null)}function Tt(e){let{t}=e,[n,r]=(0,o.useState)(!1),[a,s]=(0,o.useState)(!1),[i,l]=(0,o.useState)(!1),d=()=>{r(!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:q(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:()=>r(!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:a,disabled:i,onAcknowledgedChange:s,onCancel:d,onConfirm:u}))}function Ot(e){let{t}=e,[n,r]=(0,o.useState)(e.on),[a,s]=(0,o.useState)(!1),[i,l]=(0,o.useState)(!1),[d,u]=(0,o.useState)(!1);(0,o.useEffect)(()=>r(e.on),[e.on]);let h=()=>{s(!1),l(!1)},_=k=>{u(!0),ut(e.ctx,e.session,k).then(y=>{u(!1),h(),y.ok&&r(y.value),e.onDone(y.ok?null:t("session.failed",{message:q(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:a,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 sn=15e3,ln=200,dn=10,cn=["today","week","month"];function fn(e,t){let[n,r]=(0,f.useState)({status:"loading"}),[a,s]=(0,f.useState)(!1),i=(0,f.useRef)(null),l=(0,f.useCallback)(()=>{i.current?.abort();let d=new AbortController;i.current=d,s(!0),ce(e,ln,d.signal,t).then(u=>{d.signal.aborted||(s(!1),r(h=>nt(h,u)))})},[e,t]);return(0,f.useEffect)(()=>{l();let d=setInterval(()=>{(typeof document>"u"||document.visibilityState==="visible")&&l()},sn);return()=>{clearInterval(d),i.current?.abort()}},[l]),[n,l,a]}function ge(e){return(0,f.createElement)(un,{key:e.sessionId??"",...e})}function un(e){let{t}=e,[n,r,a]=fn(e.ctx,e.sessionId),[s,i]=(0,f.useState)("today"),[l,d]=(0,f.useState)(null),[u,h]=(0,f.useState)(0),[_,k]=(0,f.useState)(null),y=`pgw-card${e.panel?" pgw-card--panel":""}`,m=n.status==="ready"?n.data:void 0,O=!e.panel&&m!==void 0,A=(0,f.createElement)("div",{className:"pgw-head"},(0,f.createElement)("div",{className:"pgw-head__main"},e.panel?null:(0,f.createElement)("h3",{className:"pgw-title"},t("card.title")),e.sessionId&&m&&typeof m.sessionMasking=="boolean"?(0,f.createElement)(Ot,{ctx:e.ctx,t,session:e.sessionId,on:m.sessionMasking,onDone:N=>{k(N===null?null:{text:N,ok:!1}),r()}}):null,m&&(!e.sessionId||!m.active)?(0,f.createElement)(T.Tag,{tone:m.active?"success":"warning"},t(m.active?"card.on":"card.off")):null,e.sessionId&&m&&m.sessionMasking===void 0?(0,f.createElement)(T.Tag,{tone:"outline"},t("panel.session")):null,m&&!e.panel?(0,f.createElement)("span",{className:"pgw-meta",title:t("card.valuesHint")},t("card.values",{n:m.values})):null,m&&!m.record?(0,f.createElement)("span",{className:"pgw-meta"},t("card.memoryOnly")):null),(0,f.createElement)("div",{className:"pgw-head__actions"},m?(0,f.createElement)(T.SegmentedControl,{id:`pgw-range-${e.sessionId??"all"}`,label:t("card.range"),value:s,options:cn.map(N=>({value:N,label:t(`range.${N}`)})),onChange:i}):null,(0,f.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:a,title:t("card.refresh"),"aria-label":t("card.refresh"),onClick:r},(0,f.createElement)(T.IconRefreshOutlineRegular,{size:14})),O?(0,f.createElement)(Tt,{ctx:e.ctx,t,onDone:(N,U)=>{k({text:N,ok:U}),d(null),h(0),r()}}):null)),D=_?(0,f.createElement)("div",{className:`pgw-flash${_.ok?"":" pgw-flash--error"}`,role:"status"},_.text):null,V=n.status==="ready"&&n.stale?(0,f.createElement)("div",{className:"pgw-notice pgw-notice--error",role:"status"},(0,f.createElement)(T.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,f.createElement)("span",null,t("card.stale",{reason:q(n.stale,t)}))):null,K=e.sessionId&&m?.sessionMasking===!1?(0,f.createElement)("div",{className:"pgw-notice",role:"status"},(0,f.createElement)(T.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,f.createElement)("span",null,t("session.offNotice"))):null;if(!m){let N=n.status==="error"?`${t("card.unavailable")} ${t("card.reason",{reason:q(n.failure,t)})}`:t("card.loading");return(0,f.createElement)("section",{className:y},A,(0,f.createElement)("div",{className:"pgw-empty pgw-empty--block"},N))}if(e.sessionId&&m.recent.length===0)return(0,f.createElement)("section",{className:y},A,V,D,K,(0,f.createElement)("div",{className:"pgw-empty pgw-empty--block"},t("panel.empty")));let p=m,F=p.stats[s],z=new Set(p.vendorView?p.views??[]:[]),I=it(p.recent,u,dn),B=N=>{h(N),d(null)};return(0,f.createElement)("section",{className:y},A,V,D,K,(0,f.createElement)(Nt,{t,items:Qe(p,F)}),(0,f.createElement)(Ct,{totals:F,t,...typeof p.restoreLog=="boolean"?{restoreLog:p.restoreLog}:{}}),(0,f.createElement)("div",{className:"pgw-dists"},(0,f.createElement)(pe,{t,title:t("dist.kind"),data:F.kinds,others:t("dist.others.kind"),empty:t("dist.empty"),field:"kind"}),(0,f.createElement)(pe,{t,title:t("dist.finder"),data:F.finders,others:t("dist.others.finder"),empty:t("dist.empty"),field:"finder"}),(0,f.createElement)(pe,{t,title:t("dist.host"),data:F.hosts,others:t("dist.others.host"),empty:t("dist.empty")})),(0,f.createElement)("div",{className:"pgw-section"},(0,f.createElement)("div",{className:"pgw-section__head"},(0,f.createElement)("span",{className:"pgw-section__title"},t("recent.title")),p.recent.length>0?(0,f.createElement)("span",{className:"pgw-meta"},t("recent.count",{n:p.recent.length})):null),p.recent.length===0?(0,f.createElement)("div",{className:"pgw-empty pgw-empty--block"},t("recent.empty")):(0,f.createElement)("div",{className:"pgw-recs"},(0,f.createElement)(St,{t}),(0,f.createElement)("ul",{className:"pgw-recs__list","aria-label":t("recent.title")},I.items.map(N=>(0,f.createElement)(Rt,{key:N.key,ctx:e.ctx,r:N,open:l===N.key,toggle:()=>d(l===N.key?null:N.key),t,viewable:z.has(N.key)})))),I.pages>1?(0,f.createElement)("div",{className:"pgw-pager"},(0,f.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:I.page===0,onClick:()=>B(0)},t("page.first")),(0,f.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:I.page===0,"aria-label":t("page.prev"),title:t("page.prev"),onClick:()=>B(I.page-1)},(0,f.createElement)(T.IconChevronLeftOutlineRegular,{size:14})),(0,f.createElement)("span",{className:"pgw-meta pgw-pager__at"},t("page.at",{page:I.page+1,pages:I.pages})),(0,f.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:I.page>=I.pages-1,"aria-label":t("page.next"),title:t("page.next"),onClick:()=>B(I.page+1)},(0,f.createElement)(T.IconChevronRightOutlineRegular,{size:14}))):null))}var pn="dsh-privacy-gateway",X=fe(void 0);function At(e,t){return e.code==="noDisposer"?t("err.noDisposer"):t("err.thrown",{message:e.message})}function Et(e,t){X.set(void 0);let n;try{let r=e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:pn,order:35,locale:Y,label:()=>t("panel.tab")},a=>(0,It.createElement)(ge,{ctx:e,t,panel:!0,...a?.sessionId?{sessionId:a.sessionId}:{}})));if(typeof r!="function"){X.set({code:"noDisposer"});return}n=r}catch(r){X.set({code:"thrown",message:r instanceof Error?r.message:String(r)});return}return()=>{let r=n;n=void 0;try{r?.()}catch{}}}var me=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 r=this.waiting.length-1;r>=0;r--)if(this.waiting[r]?.path===t)return this.waiting[r]?.value;return this.current?.path===t?this.current.value:n}write(t,n){return new Promise(r=>{let a=this.waiting.find(s=>s.path===t);a?(a.value=n,a.done.push(r)):this.waiting.push({path:t,value:n,done:[r]}),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 r;try{r=await this.send(n.path,n.value,t)}catch{r=!1}this.current=void 0,t=!0;for(let a of n.done)a(r);if(!r){this.failed=!0;for(let a of this.waiting.splice(0))for(let s of a.done)s(!1)}this.notify()}}notify(){this.onState(this.state)}};function gn(){let[,e]=(0,g.useState)(0),t=(0,g.useSyncExternalStore)(J.subscribe,J.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 r=n?.getSnapshot().view,a=(0,g.useMemo)(()=>r?Te(r.namespaces):void 0,[r]),s=(0,g.useMemo)(()=>{try{return t&&a!==void 0?t.get(a):void 0}catch{return}},[t,a]);(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 Pt="dsh-privacy-gateway.config.open",mn=["mask"];function hn(){try{let e=JSON.parse(globalThis.localStorage?.getItem(Pt)??"null");if(Array.isArray(e))return oe.filter(t=>e.includes(t))}catch{}return[...mn]}function wn(e){try{globalThis.localStorage?.setItem(Pt,JSON.stringify(e))}catch{}}var j=e=>e;function Ae(e){let{ctx:t,t:n}=e,r=gn(),a=e.form??r,s=(0,g.useRef)(a);s.current=a;let[i,l]=(0,g.useState)({busy:!1,failed:!1}),[d]=(0,g.useState)(()=>new me((c,v,C)=>{let R=s.current;return R?R.mutate([{op:"set",path:[c],value:v}],C?void 0:R.state.revision):Promise.resolve(!1)},l)),[u,h]=(0,g.useState)(null),[_,k]=(0,g.useState)(!1),y=(0,g.useSyncExternalStore)(X.subscribe,X.get),m=(0,g.useId)(),[O,A]=(0,g.useState)(null),[D,V]=(0,g.useState)(!1),[K,p]=(0,g.useState)(0),[F,z]=(0,g.useState)(hn),I=c=>z(v=>{let C=v.includes(c)?v.filter(R=>R!==c):oe.filter(R=>R===c||v.includes(R));return wn(C),C}),B=a?.state,N=B?.status==="ready",U=B?.writable!==!1,ae=B?.value??{},$=c=>d.latest(c,ae[c]);if((0,g.useEffect)(()=>{let c=new AbortController;return pt(t,c.signal).then(v=>{c.signal.aborted||(V(!v.ok),A(v.ok?v.value:[]))}),()=>c.abort()},[t,K]),!a)return(0,g.createElement)("div",{className:"pgw-empty"},n("cfg.unavailable"));let Z=N?null:(0,g.createElement)("div",{className:"pgw-cfg__desc",role:"status"},n("cfg.loading")),L=!N||!U,Kt=c=>O?.find(v=>v.id.toLowerCase()===c.toLowerCase())?.name??c,ee=(c,v)=>{if(L)return Promise.resolve(!1);let C=Fe(c,$(c.key),v);return C?new Promise(R=>{k(!1),h(H=>(H?.resolve(!1),{f:c,next:v,change:C,resolve:R}))}):d.write(c.key,v)},Pe=c=>{let v=u;h(null),k(!1),v&&(c?d.write(v.f.key,v.next).then(v.resolve):v.resolve(!1))},Dt=c=>{let v=n(j(`cfg.f.${c.key}`));switch(c.kind){case"switch":return(0,g.createElement)(We,{label:v,checked:te($(c.key),c.default),disabled:L,onChange:C=>{ee(c,C)}});case"choice":{let C=ve($(c.key),c.choices,c.default);return(0,g.createElement)(xe,{label:n(j(`cfg.f.${c.key}.${C}`)),labelledBy:`${m}${c.key}`,items:c.choices.map(R=>({id:R,label:n(j(`cfg.f.${c.key}.${R}`))})),selectedId:C,disabled:L,onSelect:R=>{R!==C&&ee(c,R)}})}case"list":return(0,g.createElement)(je,{t:n,label:v,list:W($(c.key),c.default),anyCase:c.anyCase,placeholder:n(j(`cfg.f.${c.key}.placeholder`)),disabled:L,onChange:C=>ee(c,C)});case"count":return(0,g.createElement)(Ge,{t:n,value:ne($(c.key),c.min,c.default),min:c.min,label:v,disabled:L,onChange:C=>ee(c,C)});case"providers":return Vt(c)}},Vt=c=>{let v=W($(c.key),[]),C=ht(O??[],v),R=C.filter(E=>E.excluded).map(E=>E.name),H=ze(R,n("cfg.sep")),be=H.kind==="none"?n("cfg.excludedNone"):H.kind==="some"?H.names:n("cfg.excludedMany",{names:H.names,n:H.n});return(0,g.createElement)(xe,{label:be,labelledBy:`${m}${c.key}`,multi:!0,items:C.map(E=>({id:E.id,label:E.registered?E.name:n("cfg.providerAbsent",{name:E.name})})),selectedIds:C.filter(E=>E.excluded).map(E=>E.id),disabled:L,onSelect:E=>{ee(c,wt(W($(c.key),[]),E))}})},Me=c=>{if(c.key==="showPanel"&&y)return(0,g.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.sidebarFailed",{reason:At(y,n)}));if(c.key==="excludeProviders"&&D)return(0,g.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.providerListUnavailable")," ",(0,g.createElement)(he.Button,{variant:"outline",size:"sm",onClick:()=>p(v=>v+1)},n("cfg.retry")))},$t=Object.fromEntries(se.map(c=>[c.key,$(c.key)])),zt=c=>{let v=se.filter(P=>P.group===c),C=n(j(`cfg.g.${c}`)),R=F.includes(c),H=Ke(c,$t),be=v.some(P=>Me(P)!==void 0),E=N?[...H.map((P,Bt)=>(0,g.createElement)("span",{key:Bt,className:P.off?"pgw-fold__part pgw-fold__part--off":"pgw-fold__part"},n(j(P.key),P.params))),be?(0,g.createElement)("span",{key:"problem",className:"pgw-fold__part pgw-fold__part--error"},n("cfg.s.problem")):null]:null;return(0,g.createElement)(He,{key:c,title:C,summary:E,open:R,toggleLabel:n(R?"cfg.collapse":"cfg.expand",{name:C}),onToggle:()=>I(c)},v.map(P=>(0,g.createElement)(Be,{key:P.key,title:n(j(`cfg.f.${P.key}`)),titleId:`${m}${P.key}`,hint:n(j(`cfg.f.${P.key}.hint`)),note:Me(P),inline:Le(P),half:P.half===!0},Dt(P))))},ke=u?yn(u,n,u.f.key==="excludeProviders"?Kt: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,Z,(0,g.createElement)("div",{className:"pgw-cfg__folds"},oe.map(zt)),(0,g.createElement)("p",{className:"pgw-cfg__desc pgw-cfg__foot"},n("cfg.applies")," ",n("cfg.others"))),(0,g.createElement)(he.RiskConfirmation,{open:u!==null,title:ke?.title??"",description:ke?.body??"",acknowledgeLabel:ke?.ack??"",cancelLabel:n("card.cancel"),closeLabel:n("card.close"),confirmLabel:n("cfg.risk.confirm"),acknowledged:_,onAcknowledgedChange:k,onCancel:()=>Pe(!1),onConfirm:()=>Pe(!0)}))}function yn(e,t,n){let{change:r}=e,a={},s=r.added??r.removed;return s&&(a.names=s.map(n).join(t("cfg.sep"))),r.from!==void 0&&(a.from=r.from),r.to!==void 0&&(a.to=r.to),{title:t(r.risk==="send"?"cfg.risk.send.title":r.risk==="delete"?"cfg.risk.delete.title":"cfg.risk.log.title"),body:t(j(`cfg.r.${e.f.key}`),a),ack:t(r.risk==="send"?"cfg.risk.send.ack":r.risk==="delete"?"cfg.risk.delete.ack":"cfg.risk.log.ack")}}var we="dsh-privacy-gateway",Mt="dsh-privacy-gateway";var Ee="var(--ds-font-family-code,ui-monospace,monospace)",kn=`
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=`
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}
@@ -12,11 +12,27 @@ var module = { exports: {} }; var exports = module.exports;
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
14
  .pgw-spacer{flex:1}
15
- .pgw-mono{font-family:${Ee}}
15
+ .pgw-mono{font-family:${Me}}
16
16
  .pgw-reset{display:inline-flex;align-items:center;gap:4px;color:var(--dsw-alias-label-secondary)}
17
17
  @media (hover:hover){.pgw-reset:hover:not(:disabled){color:var(--dsw-alias-state-error-primary)}}
18
18
  .pgw-empty{font-size:12px;color:var(--dsw-alias-label-tertiary)}
19
19
  .pgw-empty--block{padding:24px 0;text-align:center}
20
+ .pgw-empty--diagram{display:flex;align-items:center;justify-content:center;min-height:clamp(280px,45vh,520px)}
21
+ .pgw-diagram{--pgw-diagram-accent:#686af5;display:flex;flex-direction:column;align-items:center;gap:10px;padding:8px 0 4px}
22
+ .pgw-diagram__svg{display:block;width:100%;max-width:520px;height:auto}
23
+ .pgw-diagram__box{fill:var(--dsw-alias-bg-layer-2);stroke:var(--dsw-alias-border-l1);stroke-width:1}
24
+ .pgw-diagram__gateway{fill:color-mix(in srgb,var(--pgw-diagram-accent) 10%,transparent);stroke:color-mix(in srgb,var(--pgw-diagram-accent) 55%,transparent);stroke-width:1}
25
+ .pgw-diagram__vendor{fill:color-mix(in srgb,var(--dsw-alias-state-success-primary) 9%,transparent);stroke:color-mix(in srgb,var(--dsw-alias-state-success-primary) 40%,transparent);stroke-width:1}
26
+ .pgw-diagram__title{fill:var(--dsw-alias-label-primary);font-size:12px;font-weight:500}
27
+ .pgw-diagram__sub{fill:color-mix(in srgb,var(--pgw-diagram-accent) 70%,var(--dsw-alias-label-secondary));font-size:10px}
28
+ .pgw-diagram__label{fill:var(--dsw-alias-label-tertiary);font-size:10px}
29
+ .pgw-diagram__chip{fill:var(--dsw-alias-state-warn-primary);font-size:10px;font-weight:600}
30
+ .pgw-diagram__out{fill:none;stroke:var(--pgw-diagram-accent);stroke-width:1.4}
31
+ .pgw-diagram__in{fill:none;stroke:var(--dsw-alias-label-tertiary);stroke-width:1.2}
32
+ .pgw-diagram__head-out{fill:var(--pgw-diagram-accent)}
33
+ .pgw-diagram__head-in{fill:var(--dsw-alias-label-tertiary)}
34
+ .pgw-diagram__note{max-width:520px;margin:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary);text-align:center}
35
+ .pgw-diagram__hint{max-width:520px;margin:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);text-align:center}
20
36
  .pgw-flash{font-size:12px;line-height:18px;padding:8px 12px;border-radius:8px;background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 10%,transparent);color:var(--dsw-alias-label-primary)}
21
37
  .pgw-flash--error{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent)}
22
38
  .pgw-notices{display:flex;flex-direction:column;gap:6px}
@@ -39,7 +55,7 @@ var module = { exports: {} }; var exports = module.exports;
39
55
  .pgw-bar{display:flex;flex-direction:column;gap:4px;font-size:12px}
40
56
  .pgw-bar__head{display:flex;justify-content:space-between;gap:8px}
41
57
  .pgw-bar__head>*{min-width:0}
42
- .pgw-bar__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:${Ee};color:var(--dsw-alias-label-primary)}
58
+ .pgw-bar__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:${Me};color:var(--dsw-alias-label-primary)}
43
59
  .pgw-bar__label--hint{cursor:help}
44
60
  .pgw-bar__value{flex:none;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary)}
45
61
  .pgw-bar__track{height:4px;border-radius:2px;background:var(--dsw-alias-bg-layer-2);overflow:hidden}
@@ -141,9 +157,9 @@ var module = { exports: {} }; var exports = module.exports;
141
157
  .pgw-view__table th{position:sticky;top:0;background:var(--dsw-alias-bg-layer-2);font-weight:500;color:var(--dsw-alias-label-tertiary);text-align:left;padding:4px 8px}
142
158
  .pgw-view__table th:first-child,.pgw-view__n{width:44px}
143
159
  .pgw-view__n{color:var(--dsw-alias-label-tertiary);text-align:right;font-variant-numeric:tabular-nums;padding:2px 8px;vertical-align:top}
144
- .pgw-detail .pgw-view__code{font-family:${Ee};white-space:pre-wrap;word-break:break-all;padding:2px 8px;vertical-align:top;border-left:1px solid var(--dsw-alias-border-l2)}
160
+ .pgw-detail .pgw-view__code{font-family:${Me};white-space:pre-wrap;word-break:break-all;padding:2px 8px;vertical-align:top;border-left:1px solid var(--dsw-alias-border-l2)}
145
161
  .pgw-view__mark{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 18%,transparent);color:inherit;border-radius:3px;padding:0 2px}
146
162
  .pgw-view__mark--agent{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 18%,transparent)}
147
- `,Ft="dsh-privacy-gateway-styles";function Lt(){if(typeof document>"u"||document.getElementById(Ft))return;let e=document.createElement("style");e.id=Ft,e.textContent=kn,document.head.appendChild(e)}var bn="dsh-privacy-gateway",vn=["slots","locale","connection"];function xn(e){Lt(),e.effect(()=>e.locale.register(Y,bt)??void 0,"dsh-privacy-gateway: dictionaries");let t=e.locale.bind(Y);gt(e),e.effect(()=>{let i=e.slots.inject("plugins.detail.section",()=>e.slots.register({name:"plugins.detail.section",id:"dsh-privacy-gateway-stats",locale:Y},l=>l.subject?.kind==="bundle"&&l.subject.pkg?.name===we?(0,ye.createElement)(ge,{ctx:e,t}):null));return typeof i=="function"?i:void 0},"dsh-privacy-gateway: statistics card"),e.effect(()=>{let i=e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:we,locale:Y},l=>l.view==="summary"?t("cfg.title"):(0,ye.createElement)(Ae,{ctx:e,t})));return typeof i=="function"?i:void 0},"dsh-privacy-gateway: configuration (bundle page)"),e.effect(()=>{let i=e.slots.inject("plugins.row.config",()=>e.slots.register({name:"plugins.row.config",key:`${we}#${Mt}`,locale:Y},l=>l.view==="summary"?t("cfg.title"):(0,ye.createElement)(Ae,{ctx:e,t,form:l.form})));return typeof i=="function"?i:void 0},"dsh-privacy-gateway: configuration (row page)");let n=!1,r,a=()=>{let i=r;r=void 0,i?.()},s=()=>{n&&!r?r=Et(e,t):n||a()};e.effect(()=>{let i=mt(e,l=>{n=l,s()});return()=>{i(),n=!1,a()}},"dsh-privacy-gateway: view tab")}module.exports={name:bn,inject:vn,apply:xn};
163
+ `,Vt="dsh-privacy-gateway-styles";function $t(){if(typeof document>"u"||document.getElementById(Vt))return;let e=document.createElement("style");e.id=Vt,e.textContent=_n,document.head.appendChild(e)}var Nn="dsh-privacy-gateway",Cn=["slots","locale","connection"];function Rn(e){$t(),e.effect(()=>e.locale.register(J,xt)??void 0,"dsh-privacy-gateway: dictionaries");let t=e.locale.bind(J);ht(e),e.effect(()=>{let i=e.slots.inject("plugins.detail.section",()=>e.slots.register({name:"plugins.detail.section",id:"dsh-privacy-gateway-stats",locale:J},l=>l.subject?.kind==="bundle"&&l.subject.pkg?.name===ke?(0,be.createElement)(he,{ctx:e,t}):null));return typeof i=="function"?i:void 0},"dsh-privacy-gateway: statistics card"),e.effect(()=>{let i=e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:ke,locale:J},l=>l.view==="summary"?t("cfg.title"):(0,be.createElement)(Pe,{ctx:e,t})));return typeof i=="function"?i:void 0},"dsh-privacy-gateway: configuration (bundle page)"),e.effect(()=>{let i=e.slots.inject("plugins.row.config",()=>e.slots.register({name:"plugins.row.config",key:`${ke}#${Dt}`,locale:J},l=>l.view==="summary"?t("cfg.title"):(0,be.createElement)(Pe,{ctx:e,t,form:l.form})));return typeof i=="function"?i:void 0},"dsh-privacy-gateway: configuration (row page)");let n=!1,a,r=()=>{let i=a;a=void 0,i?.()},s=()=>{n&&!a?a=Ft(e,t):n||r()};e.effect(()=>{let i=wt(e,l=>{n=l,s()});return()=>{i(),n=!1,r()}},"dsh-privacy-gateway: view tab")}module.exports={name:Nn,inject:Cn,apply:Rn};
148
164
  return module.exports;
149
165
  } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-privacy-gateway",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
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",