dsh-privacy-gateway 0.1.6 → 0.1.8
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 +6 -6
- package/README.md +6 -6
- package/docs/details/DETAIL.en.md +7 -5
- package/docs/details/DETAIL.md +7 -4
- package/lib/client.js +19 -7
- package/lib/index.d.ts +4 -2
- package/lib/index.js +26 -5
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -99,7 +99,7 @@ The everyday settings can be changed on the Configure page of this plugin's row
|
|
|
99
99
|
| `protectEnvBlock` | `true` | Send `<env>` … `</env>` blocks as written, for providers that check them ([ADR-0004](docs/adr/0004-protected-regions.md)) |
|
|
100
100
|
| `protectTools` | `true` | Send the request's `tools` array as written |
|
|
101
101
|
| `excludeHosts` | `[]` | `host` or `host:port` entries that are never rewritten |
|
|
102
|
-
| `excludeProviders` | `[]` | Provider ids whose requests are not masked; checked on the Configure page from the providers registered now ([ADR-0018](docs/adr/0018-exclude-providers.md)) |
|
|
102
|
+
| `excludeProviders` | `[]` | Provider ids whose requests are not masked; checked on the Configure page from the providers registered now. Their requests go out as they are, replies are not restored, nothing is recorded, and the log says so once for each provider ([ADR-0018](docs/adr/0018-exclude-providers.md), [ADR-0034](docs/adr/0034-log-excluded-provider.md)) |
|
|
103
103
|
| `maxValues` | `5000` | Size of the in-memory value table; when full, the oldest half is dropped |
|
|
104
104
|
| `record` | `true` | Write the masking records to disk; when off, the statistics stay in memory |
|
|
105
105
|
| `keepDays` | `30` | Days of records kept |
|
|
@@ -122,15 +122,15 @@ No answer of the command has a value in it.
|
|
|
122
122
|
|
|
123
123
|
## Records and statistics
|
|
124
124
|
|
|
125
|
-
Only a model request that had something masked or restored makes a record, one each
|
|
125
|
+
Only a model request that had something masked or restored makes a record, one each: its time and duration, host, model, session with its workspace and title, places replaced, each value's placeholder / kind / finder / head / length / every place it was at, the turn and step the request went out in, the turn and step the value was first sent in this run, the places restored in the reply (those in tool arguments counted apart), and the placeholders the value table does not know. A record never holds a value, nor a URL's query ([ADR-0008](docs/adr/0008-masking-records.md), [ADR-0020](docs/adr/0020-record-attribution.md)).
|
|
126
126
|
|
|
127
|
-
The head keeps a few characters to recognize it by: a key with a prefix keeps the prefix and the 4 characters after it, one without keeps its first 4, and a long value also keeps its last 2 (`sk-proj-g6sx…3QaZ`); shorter values keep fewer
|
|
127
|
+
The head keeps a few characters to recognize it by: a key with a prefix keeps the prefix and the 4 characters after it, one without keeps its first 4, and a long value also keeps its last 2 (`sk-proj-g6sx…3QaZ`); shorter values keep fewer, and personal data and your words keep one ([ADR-0019](docs/adr/0019-hint.md)).
|
|
128
128
|
|
|
129
|
-
Records go to a `masking/YYYY-MM-DD.jsonl`, one file a day
|
|
129
|
+
Records go to a `masking/YYYY-MM-DD.jsonl`, one file a day (directory 0700, files 0600); state lives in the current instance's own directory (`~/.dsh/profiles/<profile>/plugin-data/dsh-privacy-gateway/`), so instances never write into each other ([ADR-0027](docs/adr/0027-per-instance-state.md)). A failed write is a warning, and the request goes on.
|
|
130
130
|
|
|
131
|
-
The plugin's detail page has a statistics card
|
|
131
|
+
The plugin's detail page has a statistics card: today / 7 days / 30 days, the counts, the distributions by kind / finder / host (six entries at most, the rest summed into one 「Other kinds / finders / hosts」 row; hovering a title or a name explains it) and the latest 200 records, 10 a page. Open one to see each value: placeholder, kind / finder, head, length, times, the message it went in (`messages.3`) and the text around it, plus the other places the same value was sent. Each record says which turn and step it went out in (`42·3`, numbered as the Trajectory tab; it is the step that SENT it), and each value says where it was first sent in this run. The kind and finder column heads filter the rows, changing only what is shown ([ADR-0035](docs/adr/0035-kind-finder-hints-and-filters.md)). 「清空数据」 (Clear data), once its box is checked, deletes every record and count and cannot be undone ([ADR-0022](docs/adr/0022-reset.md)). With `showPanel` on, the same view is a 「隐私保护」 (Privacy) tab at the top of the session, counting only that session; the tab's switch turns masking off for that session alone ([ADR-0023](docs/adr/0023-session-switch.md)).
|
|
132
132
|
|
|
133
|
-
With `vendorView` on (
|
|
133
|
+
With `vendorView` on (「保留发出内容,供对照查看」 on the config page), a record shows 「查看发出内容」: replaced places on the left (kind · head · length), the body the model service received on the right; neither side ever shows a value.
|
|
134
134
|
|
|
135
135
|
## Notes
|
|
136
136
|
|
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ someone@gmail.com → EMAIL
|
|
|
97
97
|
| `protectEnvBlock` | `true` | `<env>` … `</env>` 块原样发出,供会校验它的 provider 使用([ADR-0004](docs/adr/0004-protected-regions.md)) |
|
|
98
98
|
| `protectTools` | `true` | 请求的 `tools` 数组原样发出 |
|
|
99
99
|
| `excludeHosts` | `[]` | 不改写的 `host` 或 `host:port` |
|
|
100
|
-
| `excludeProviders` | `[]` | 不脱敏的 provider id;「配置」页里从当前注册的 provider
|
|
100
|
+
| `excludeProviders` | `[]` | 不脱敏的 provider id;「配置」页里从当前注册的 provider 中勾选。放行的请求原样发出、回复不还原、不留记录,有请求发出时日志里每个 provider 提示一次([ADR-0018](docs/adr/0018-exclude-providers.md)、[ADR-0034](docs/adr/0034-log-excluded-provider.md)) |
|
|
101
101
|
| `maxValues` | `5000` | 内存值表上限,满了淘汰最老的一半 |
|
|
102
102
|
| `record` | `true` | 脱敏记录写盘;关掉只在内存里统计 |
|
|
103
103
|
| `keepDays` | `30` | 记录保留天数 |
|
|
@@ -120,15 +120,15 @@ someone@gmail.com → EMAIL
|
|
|
120
120
|
|
|
121
121
|
## 记录与统计
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
只记有脱敏或还原的模型请求,一条请求一条:时间与耗时、host、model、会话及其工作区与标题、替换处数、每个值的占位符 / kind / finder / 开头 / 长度 / 出现过的每一处、请求所在的轮次与步数、值首次被发出的轮次与步数、回复里还原的处数(工具参数里的另计),以及值表里没有的占位符数。记录里不写值本身,也不记 URL 的 query([ADR-0008](docs/adr/0008-masking-records.md)、[ADR-0020](docs/adr/0020-record-attribution.md))。
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
「开头」只留辨识用的几个字符:有前缀的留下前缀和其后 4 个,没有的留前 4 个,长值再加末尾 2 个(`sk-proj-g6sx…3QaZ`),短值更少;个人信息和自定义词只留 1 个([ADR-0019](docs/adr/0019-hint.md))。
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
记录按天写入 `masking/YYYY-MM-DD.jsonl`,目录 0700、文件 0600;状态在当前实例自己的目录(`~/.dsh/profiles/<profile>/plugin-data/dsh-privacy-gateway/`),多实例互不影响([ADR-0027](docs/adr/0027-per-instance-state.md))。写盘失败只告警,不影响请求。
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
插件详情页下方有统计卡:今日 / 7 天 / 30 天,计数、按 kind / finder / host 的分布(每栏最多 6 条,其余合并成「其余 kind / finder / host」;悬停标题和名字有说明)和最近 200 条记录(每页 10 条)。点开一条看每个值:占位符、kind / finder、开头、长度、次数,以及它在哪条消息(`messages.3`)和前后文字,同一个值在别处也出现的会一并列出。每条记录标出这次请求在第几轮第几步发出(`42·3`,与「轨迹」一致,指**发出**的那一步),每个值还标出本次运行首次发出的位置。kind / finder 列头可筛选,只影响显示([ADR-0035](docs/adr/0035-kind-finder-hints-and-filters.md))。右上角「清空数据」确认后删除全部记录与统计,无法恢复([ADR-0022](docs/adr/0022-reset.md))。打开 `showPanel` 后同样的内容出现在会话顶部的「隐私保护」标签页,只统计当前会话;页头的开关可以只关这个会话的脱敏([ADR-0023](docs/adr/0023-session-switch.md))。
|
|
130
130
|
|
|
131
|
-
打开 `vendorView
|
|
131
|
+
打开 `vendorView`(配置页叫「保留发出内容,供对照查看」)后,记录明细多一个「查看发出内容」:左列是替换处的标记(kind · 开头 · 长度),右边是模型服务收到的原文,两边都不出现真值。
|
|
132
132
|
|
|
133
133
|
## 须知
|
|
134
134
|
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Privacy Gateway
|
|
2
2
|
|
|
3
|
-
Adds a redaction gateway to the dsh process. When a request to a model has a secret in it, such as an API key, a token or a cookie, the value goes out as a placeholder; placeholders in the model's reply are replaced with the real values before the agent sees them.
|
|
3
|
+
Adds a redaction gateway to the dsh process. When a request to a model has a secret in it, such as an API key, a token or a cookie, the value goes out as a placeholder; placeholders in the model's reply are replaced with the real values before the agent sees them.
|
|
4
|
+
|
|
5
|
+
## Repository
|
|
6
|
+
|
|
7
|
+
[dsh-privacy-gateway](https://github.com/xbzbing/dsh-privacy-gateway): the configuration options, the design decisions (ADRs) and the full documentation are in the repository README.
|
|
8
|
+
|
|
9
|
+
If this project helps you, please give it a star 🌟
|
|
4
10
|
|
|
5
11
|
## Features
|
|
6
12
|
|
|
@@ -12,7 +18,3 @@ Adds a redaction gateway to the dsh process. When a request to a model has a sec
|
|
|
12
18
|
- **Look-alike keys**: optionally send a key as a made-up one with the same prefix, length and kinds of character, so the model cannot tell it was masked; a value under 8 characters, or with unusual characters, keeps the placeholder.
|
|
13
19
|
- **Records and statistics**: only requests with something masked or restored are recorded, and a record never holds a value. The `/privacy` command shows the state and a preview; the plugin's detail page has a statistics card, and a Privacy tab can be turned on at the top of the session.
|
|
14
20
|
- **Fails closed**: when masking fails, the request is not sent; `/privacy off` turns masking off for the moment.
|
|
15
|
-
|
|
16
|
-
## Repository
|
|
17
|
-
|
|
18
|
-
[github.com/xbzbing/dsh-privacy-gateway](https://github.com/xbzbing/dsh-privacy-gateway): the README there has the configuration, the design decisions (ADRs) and the full documentation.
|
package/docs/details/DETAIL.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# 隐私网关
|
|
2
2
|
|
|
3
|
-
在 dsh 的进程里装一层脱敏网关:发给模型的请求里出现密钥、令牌、cookie 等敏感值时,先换成占位符再发出;模型回复里的占位符,在交给 agent
|
|
3
|
+
在 dsh 的进程里装一层脱敏网关:发给模型的请求里出现密钥、令牌、cookie 等敏感值时,先换成占位符再发出;模型回复里的占位符,在交给 agent 之前换回真值。
|
|
4
|
+
|
|
5
|
+
## 项目仓库
|
|
6
|
+
|
|
7
|
+
[dsh-privacy-gateway](https://github.com/xbzbing/dsh-privacy-gateway):配置项、设计决策(ADR)和完整说明见仓库 README。
|
|
8
|
+
|
|
9
|
+
如果项目对你有帮助,请为项目点亮一个小星星吧🌟
|
|
4
10
|
|
|
5
11
|
## 功能
|
|
6
12
|
|
|
@@ -13,6 +19,3 @@
|
|
|
13
19
|
- **记录与统计**:只记脱敏和还原过的请求,记录里不写值本身;`/privacy` 命令查看状态和预览,插件详情页有统计卡,也可以在会话顶部打开「隐私保护」标签页。
|
|
14
20
|
- **失败不放行**:脱敏出错时请求不发出;`/privacy off` 可以临时关掉。
|
|
15
21
|
|
|
16
|
-
## 仓库
|
|
17
|
-
|
|
18
|
-
[github.com/xbzbing/dsh-privacy-gateway](https://github.com/xbzbing/dsh-privacy-gateway):配置项、设计决策(ADR)和完整说明见仓库 README。
|
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 ge=require("react");var bt=require("@deepseek-ai/dsh-client-ui-primitives"),m=require("react");var I=require("@deepseek-ai/dsh-client-ui-primitives"),h=require("react");var ne=["mask","lists","record","view"],re=[{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:"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 Te(e,t,n){if(e.risk)switch(e.kind){case"switch":return Y(t,e.default)&&!Y(n,e.default)?{risk:e.risk}:void 0;case"list":case"providers":{let r=e.kind==="providers"||e.anyCase,a=f=>r?f.trim().toLowerCase():f.trim(),i=(f,w)=>{let k=new Set(f.map(a));return w.filter(b=>!k.has(a(b)))},o=V(t,e.default),l=V(n,e.default);if(e.kind==="list"&&e.risky==="remove"){let f=i(l,o);return f.length>0?{risk:e.risk,removed:f}:void 0}let d=i(o,l);return d.length>0?{risk:e.risk,added:d}:void 0}case"count":{let r=Z(t,e.min,e.default),a=Z(n,e.min,e.default);return a<r?{risk:e.risk,from:r,to:a}:void 0}case"choice":return}}function Pe(e){return e.kind==="switch"||e.kind==="choice"||e.kind==="count"}function H(e,t){let n=re.find(r=>r.key===e&&r.kind===t);if(!n)throw new Error(`no ${t} field ${e}`);return n}function Oe(e,t){let n=r=>Y(t[r],H(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:"cfg.s.maskNothing",off:!0}]:r.map(o=>({key:`cfg.s.${o}`}));n("shape")&&a.push({key:"cfg.s.shape"});let i=H("toolGuard","choice");return a.push({key:`cfg.s.toolGuard.${he(t.toolGuard,i.choices,i.default)}`}),a}case"lists":return[{key:"cfg.s.words",params:{n:V(t.words,H("words","list").default).length}},{key:"cfg.s.allow",params:{n:V(t.allow,H("allow","list").default).length}}];case"record":{let r=H("keepDays","count"),a=n("record")?[{key:"cfg.s.record",params:{n:Z(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=V(t.excludeProviders,H("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 Y(e,t){return typeof e=="boolean"?e:t}function he(e,t,n){return typeof e=="string"&&t.includes(e)?e:n}function V(e,t){return Array.isArray(e)?e.filter(n=>typeof n=="string"):[...t]}function Z(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t?Math.floor(e):n}function Ie(e,t,n){let r=t.trim();if(r==="")return;let a=n?i=>i.trim().toLowerCase()===r.toLowerCase():i=>i.trim()===r;return e.some(a)?void 0:[...e,r]}function Fe(e,t){return e.filter(n=>n!==t)}function Me(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 Ae(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 Ee(e){let t=["pgw-cfg__row",e.inline?"pgw-cfg__row--inline":"",e.half?"pgw-cfg__row--half":""].filter(Boolean).join(" ");return(0,h.createElement)("div",{className:t},(0,h.createElement)("div",{className:"pgw-cfg__text"},(0,h.createElement)("div",{className:"pgw-cfg__name",id:e.titleId},e.title),(0,h.createElement)("div",{className:"pgw-cfg__desc"},e.hint),e.note??null),(0,h.createElement)("div",{className:"pgw-cfg__control"},e.children))}function $e(e){let t=(0,h.useId)();return(0,h.createElement)("section",{className:"pgw-fold","data-open":e.open||void 0},(0,h.createElement)("h4",{className:"pgw-fold__heading"},(0,h.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,h.createElement)(I.IconChevronDownOutlineRegular,{className:"pgw-fold__chevron"}),(0,h.createElement)("span",{className:"pgw-fold__title"},e.title),e.open?null:(0,h.createElement)("span",{className:"pgw-fold__summary"},e.summary))),e.open?(0,h.createElement)("div",{id:`${t}-b`,role:"region","aria-labelledby":`${t}-h`,className:"pgw-fold__body"},(0,h.createElement)("div",{className:"pgw-fold__grid"},e.children)):null)}function Ve(e){return(0,h.createElement)(I.Switch,{checked:e.checked,label:e.label,disabled:e.disabled,onChange:e.onChange})}function ye(e){let[t,n]=(0,h.useState)(!1),r=(0,h.useId)();return(0,h.useEffect)(()=>{e.disabled&&n(!1)},[e.disabled]),(0,h.createElement)(I.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,h.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,h.createElement)("span",{className:"pgw-select__label",id:r},e.label),(0,h.createElement)(I.IconChevronDownOutlineRegular,{className:"pgw-select__chevron"}))})}function Le(e){let{t}=e,[n,r]=(0,h.useState)(""),[a,i]=(0,h.useState)(!1),o=Ie(e.list,n,e.anyCase),l=()=>{if(!o||e.disabled||a)return;let d=n;i(!0),e.onChange(o).then(f=>{i(!1),f&&r(w=>w===d?"":w)})};return(0,h.createElement)("div",{className:"pgw-cfg__list"},(0,h.createElement)("div",{className:"pgw-cfg__add"},(0,h.createElement)(I.Input,{className:"pgw-cfg__input",type:"text",value:n,placeholder:e.placeholder,"aria-label":e.placeholder,disabled:e.disabled,onChange:d=>r(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),l())}}),(0,h.createElement)(I.Button,{variant:"outline",size:"sm",disabled:e.disabled||a||!o,onClick:l},t("cfg.add"))),e.list.length===0?(0,h.createElement)("div",{className:"pgw-cfg__desc"},t("cfg.listEmpty")):(0,h.createElement)("div",{className:"pgw-cfg__tags"},e.list.map(d=>(0,h.createElement)(I.Tag,{key:d,tone:"neutral",className:"pgw-cfg__tag",title:d},(0,h.createElement)("span",{className:"pgw-cfg__tagText"},d),(0,h.createElement)("button",{type:"button",className:"pgw-cfg__tagX","aria-label":t("cfg.remove",{name:d}),disabled:e.disabled,onClick:()=>{e.onChange(Fe(e.list,d))}},(0,h.createElement)(I.IconCloseOutlineRegular,{size:12}))))))}function De(e){let[t,n]=(0,h.useState)(String(e.value)),r=(0,h.useRef)(void 0);(0,h.useEffect)(()=>n(String(e.value)),[e.value]);let a=Me(t,e.min),i=()=>{if(a===void 0||a===e.value||a===r.current)return;let o=e.value;r.current=a,e.onChange(a).then(l=>{r.current=void 0,l||n(String(o))})};return(0,h.createElement)("div",{className:"pgw-cfg__list"},(0,h.createElement)(I.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:o=>n(o.target.value),onBlur:i,onKeyDown:o=>{o.key==="Enter"&&i()}}),a===void 0?(0,h.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error",role:"alert"},e.t("cfg.countInvalid",{min:e.min})):null)}function Ke(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),i=r.slice(t).reduce((l,[,d])=>l+d,0);i>0&&a.push([n,i]);let o=a.reduce((l,[,d])=>Math.max(l,d),0);return a.map(([l,d])=>({label:l,value:d,pct:o>0?Math.max(2,Math.round(d/o*100)):0}))}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 Be(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 ke(e,t=new Date){let n=new Date(e);if(Number.isNaN(n.getTime()))return"";let r=i=>String(i).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 D=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),N=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function ae(e){let t={};if(D(e))for(let[n,r]of Object.entries(e))typeof r=="number"&&Number.isFinite(r)&&(t[n]=r);return t}function be(e){if(!D(e))return;let t=D(e.tookMs)?e.tookMs:{};return{requests:N(e.requests),masked:N(e.masked),n:N(e.n),restored:N(e.restored),restoredInTools:N(e.restoredInTools),unmapped:N(e.unmapped),failed:N(e.failed),warned:N(e.warned),blocked:N(e.blocked),exfil:N(e.exfil),exfilBlocked:N(e.exfilBlocked),tookMs:{sum:N(t.sum),max:N(t.max)},kinds:ae(e.kinds),finders:ae(e.finders),hosts:ae(e.hosts),models:ae(e.models)}}function Ot(e){return D(e)&&typeof e.key=="number"&&typeof e.time=="string"&&Array.isArray(e.values)&&e.values.every(D)}function je(e){if(!(!D(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 It(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let r of e){let a=je(r);a===void 0||n.has(a.path)||(n.add(a.path),t.push(a))}return t}var Ft=7,Mt=["rule","word","known","cookie"],ve=e=>Math.max(0,Math.floor(N(e)));function At(e){if(typeof e.placeholder!="string"||e.placeholder==="")return;let t=w=>typeof w=="string"?w:void 0,n=t(e.tail),r=t(e.before),a=t(e.after),i=je(e.at),o=se(e.first??{}),l=It(e.elsewhere),d=l.slice(0,Ft),f=ve(e.elsewhereOmitted)+l.length-d.length;return{placeholder:e.placeholder,kind:t(e.kind)??"",finder:Mt.find(w=>w===e.finder)??"rule",head:t(e.head)??"",...n!==void 0?{tail:n}:{},len:ve(e.len),n:ve(e.n),...e.action==="warn"||e.action==="block"?{action:e.action}:{},...r!==void 0?{before:r}:{},...a!==void 0?{after:a}:{},...i?{at:i}:{},...o?{first:o}:{},...d.length>0?{elsewhere:d}:{},...f>0?{elsewhereOmitted:f}:{}}}function se(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 Ge(e){return`${e.turn}\xB7${e.step}`}function Et(e){let{valuesOmitted:t,turn:n,step:r,...a}=e,i=N(t),o=se({turn:n,step:r});return{...a,n:N(e.n),restored:N(e.restored),unmapped:N(e.unmapped),values:e.values.map(At).filter(l=>l!==void 0),...i>0?{valuesOmitted:i}:{},...o??{}}}function qe(e){if(!D(e)||typeof e.active!="boolean"||!D(e.stats)||!Array.isArray(e.recent))return;let t=be(e.stats.today),n=be(e.stats.week),r=be(e.stats.month);if(!(!t||!n||!r))return{...e,values:N(e.values),stats:{today:t,week:n,month:r,failStreak:N(e.stats.failStreak)},recent:e.recent.filter(Ot).map(Et),...Array.isArray(e.views)?{views:e.views.filter(a=>typeof a=="number")}:{}}}function He(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}}var $t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function We(e){let t=e;try{t=JSON.stringify(JSON.parse(e),null,2)}catch{}return t.split(`
|
|
4
|
-
`)}function Ue(e){return e.map(t=>t.placeholder).join("\0")}function Je(e,t,n,r=400){let a=[...new Set(t.filter(d=>d!==""))].sort((d,f)=>f.length-d.length),i=a.length>0?new RegExp(a.map($t).join("|"),"g"):void 0,o=[],l=!1;for(let d=0;d<e.length;d++){let f=e[d],w=[],k=0;if(i)for(let b of f.matchAll(i))b.index>k&&w.push({text:f.slice(k,b.index)}),w.push({text:b[0],id:b[0]}),k=b.index+b[0].length;if(!(n&&k===0)){if((k<f.length||w.length===0)&&w.push({text:f.slice(k)}),o.length>=r){l=!0;break}o.push({n:d+1,parts:w})}}return{lines:o,truncated:l}}function Qe(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 Xe(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 xe(e){let t=e.split("."),n=t[0]??"",r=t[1]??"";return n!==""&&/^\d+$/.test(r)?`${n}.${r}`:n}function Ye(e,t){let n=[...new Set((e.elsewhere??[]).map(a=>xe(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 oe(e){return e.head?e.tail?`${e.head}\u2026${e.tail}`:`${e.head}\u2026`:""}function W(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 ee(e,t,n,r,a){let i;try{i=e.get("connection")?.rpc}catch{i=void 0}if(!i||typeof i.call!="function")return{ok:!1,failure:{code:"noConnection"}};try{let o=n===void 0?{}:{request:n},l=await i.call("/api",`privacyGateway/${t}`,{args:o},a);if(l?.ok!==!0){let f=l?.error?.message;return{ok:!1,failure:typeof f=="string"&&f!==""?{code:"remote",message:f}:{code:"malformed"}}}let d=r(l.value);return d===void 0?{ok:!1,failure:{code:"malformed"}}:{ok:!0,value:d}}catch(o){return{ok:!1,failure:{code:"thrown",message:o instanceof Error?o.message:String(o)}}}}function ie(e,t,n,r){return ee(e,"overview",r?{limit:t,session:r}:{limit:t},qe,n)}function Ze(e,t,n){return ee(e,"vendorView",{key:t},r=>{let a=r?.body;return r!==null&&typeof r=="object"&&typeof a=="string"?a:null},n)}function et(e){return ee(e,"reset",void 0,t=>{let n=t?.files;return typeof n=="number"?n:0})}function tt(e,t,n){return ee(e,"sessionMasking",{session:t,on:n},r=>{let a=r?.on;return typeof a=="boolean"?a:void 0})}function nt(e,t){return ee(e,"providers",void 0,n=>Array.isArray(n)?n.flatMap(Vt):void 0,t)}function Vt(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 le(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 Lt="Show the Privacy tab at the top of the session";function Dt(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 _e(e){for(let t of e){let n=Dt(t.schema);if(n.includes("showPanel")&&(t.ns.includes("privacy-gateway")||n.includes("excludeProviders")||JSON.stringify(t.schema??null).includes(Lt)))return t.ns}}function Kt(e){let t=_e(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 zt(e){let t=e;return t!=null&&typeof t.describe=="function"&&typeof t.get=="function"?t:void 0}var G=le(void 0);function rt(e){let t=n=>n.effect(()=>{let r;try{r=zt(n.get("configForms"))}catch{r=void 0}return G.set(r),()=>{G.get()===r&&G.set(void 0)}},"dsh-privacy-gateway: settings service");typeof e.inject=="function"?e.inject(["configForms"],t):t(e)}var Bt=6e4;function jt(e,t){return t===void 0?e:t||e===!0?!0:e===!1?!1:void 0}function at(e,t,n=G){let r=!1,a,i,o,l=()=>{if(r)return;let u=jt(i,o);u===void 0||u===a||(a=u,t(u))},d=()=>{ie(e,1).then(u=>{r||!u.ok||(i=u.value.showPanel===!0,l())})},f,w=u=>{try{f?.()}catch{}f=void 0,o=void 0;let g;try{g=u?.describe()}catch{g=void 0}if(g){let T=g,M=()=>{if(r)return;let z=T.getSnapshot().view;if(!z)return;let B=Kt(z.namespaces);B!==void 0&&(o=B,l())};f=T.subscribe(M),Promise.resolve(T.ensure()).then(M,M),M()}l()},k=n.subscribe(()=>w(n.get()));w(n.get()),d();let b=setInterval(d,Bt);return()=>{r=!0,clearInterval(b),k();try{f?.()}catch{}}}function st(e,t){let n=a=>t.some(i=>i.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(i=>i.id.toLowerCase()===a.toLowerCase())||r.push({id:a,name:a,excluded:!0,registered:!1});return r}function ot(e,t){let n=t.toLowerCase();return e.some(r=>r.toLowerCase()===n)?e.filter(r=>r.toLowerCase()!==n):[...e,t]}var wt=require("react");var K="privacyGateway",Gt={"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":"\u5171 {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.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","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.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\u539F\u6587","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.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.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\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\uFF0C\u56DE\u590D\u91CC\u7167\u6837\u8FD8\u539F\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\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","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.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.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.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\uFF0C\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.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.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.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"},qt={"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":"{n} in all","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.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","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.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":"As the model service got it","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.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.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. 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. Replies are restored as usual.","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. 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.","cfg.f.toolGuard.off":"Count only","cfg.f.toolGuard.warn":"Warn and record","cfg.f.toolGuard.block":"Do not restore","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.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.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, to 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.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.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.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."},it={zh:Gt,en:qt};var R=require("@deepseek-ai/dsh-client-ui-primitives"),p=require("react");var S=require("@deepseek-ai/dsh-client-ui-primitives"),s=require("react");var de=require("@deepseek-ai/dsh-client-ui-primitives"),y=require("react");function Ht(e,t){if(!e)return t("view.unknown");let n=e.action?` \xB7 ${t(e.action==="warn"?"action.warn":"action.block")}`:"",r=oe(e);return`\u2039${e.kind} \xB7 ${r?`${r} \xB7 `:""}${e.len}${n}\u203A`}function lt(e,t,n,r){return e.parts.map((a,i)=>a.id===void 0?a.text:(0,y.createElement)("mark",{key:i,className:`pgw-view__mark${n?" pgw-view__mark--agent":""}`,title:a.id},n?Ht(t.get(a.id),r):a.text))}function dt(e){let{ctx:t,t:n,record:r}=e,[a,i]=(0,y.useState)({status:"loading"}),[o,l]=(0,y.useState)(!0);(0,y.useEffect)(()=>{let g=new AbortController;return i({status:"loading"}),Ze(t,r.key,g.signal).then(T=>{g.signal.aborted||i(T.ok?T.value===null?{status:"gone"}:{status:"ready",body:T.value}:{status:"error"})}),()=>g.abort()},[t,r.key]);let d=Ue(r.values),f=(0,y.useMemo)(()=>new Map(r.values.map(g=>[g.placeholder,g])),[r.key,d]),w=a.status==="ready"?a.body:void 0,k=(0,y.useMemo)(()=>w!==void 0?We(w):void 0,[w]),b=(0,y.useMemo)(()=>k?Je(k,[...f.keys()],o):void 0,[k,f,o]),u=(0,y.createElement)("div",{className:"pgw-head"},(0,y.createElement)("span",{className:"pgw-dist__title"},n("view.title")),(0,y.createElement)(de.Checkbox,{checked:o,label:n("view.onlyChanged"),className:"pgw-meta",onChange:l}),(0,y.createElement)("span",{className:"pgw-spacer"}),(0,y.createElement)(de.Button,{variant:"outline",size:"sm",onClick:e.onClose},n("view.close")));if(!b){let g=a.status==="loading"?"view.loading":a.status==="gone"?"view.gone":"card.unavailable";return(0,y.createElement)("div",{className:"pgw-view"},u,(0,y.createElement)("div",{className:"pgw-empty"},n(g)))}return(0,y.createElement)("div",{className:"pgw-view"},u,b.lines.length===0?(0,y.createElement)("div",{className:"pgw-empty"},n("view.none")):(0,y.createElement)("div",{className:"pgw-view__scroll"},(0,y.createElement)("table",{className:"pgw-view__table"},(0,y.createElement)("thead",null,(0,y.createElement)("tr",null,(0,y.createElement)("th",null,n("view.line")),(0,y.createElement)("th",null,n("view.agent")),(0,y.createElement)("th",null,n("view.vendor")))),(0,y.createElement)("tbody",null,b.lines.map(g=>(0,y.createElement)("tr",{key:g.n},(0,y.createElement)("td",{className:"pgw-view__n"},g.n),(0,y.createElement)("td",{className:"pgw-view__code"},...lt(g,f,!0,n)),(0,y.createElement)("td",{className:"pgw-view__code"},...lt(g,f,!1,n))))))),b.truncated?(0,y.createElement)("div",{className:"pgw-meta"},n("view.truncated",{n:b.lines.length})):null)}function ct(e){return e.items.length===0?null:(0,s.createElement)("div",{className:"pgw-notices",role:"status"},e.items.map(t=>(0,s.createElement)("div",{key:t.key,className:`pgw-notice pgw-notice--${t.tone}`},(0,s.createElement)(S.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,s.createElement)("span",null,e.t(t.key,{n:t.n})))))}function ut(e){let{totals:t,t:n}=e,r=o=>(o??0).toLocaleString(),a=Be(t),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:r(t.restored),...t.restoredInTools>0?{sub:n("stat.inTools",{n:t.restoredInTools})}:{}},{label:n("stat.unmapped"),value:r(t.unmapped),...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,s.createElement)("div",{className:"pgw-kpis"},i.map(o=>(0,s.createElement)("div",{key:o.label,className:`pgw-kpi${o.tone?` pgw-kpi--${o.tone}`:""}`},(0,s.createElement)("span",{className:"pgw-kpi__label"},o.label),(0,s.createElement)("span",{className:"pgw-kpi__value"},o.value),o.sub?(0,s.createElement)("span",{className:"pgw-kpi__sub"},o.sub):null)))}function ce(e){let t=Ke(e.data);return(0,s.createElement)("div",{className:"pgw-dist"},(0,s.createElement)("div",{className:"pgw-section__title"},e.title),t.length===0?(0,s.createElement)("div",{className:"pgw-empty"},e.empty):t.map(n=>(0,s.createElement)("div",{className:"pgw-bar",key:n.label},(0,s.createElement)("div",{className:"pgw-bar__head"},(0,s.createElement)("span",{className:"pgw-bar__label",title:n.label},n.label),(0,s.createElement)("span",{className:"pgw-bar__value"},n.value.toLocaleString())),(0,s.createElement)("div",{className:"pgw-bar__track"},(0,s.createElement)("div",{className:"pgw-bar__fill",style:{width:`${n.pct}%`}})))))}function pt(e){let{t}=e;return(0,s.createElement)("div",{className:"pgw-rec pgw-rec--head","aria-hidden":!0},(0,s.createElement)("span",null),(0,s.createElement)("span",null,t("recent.col.time")),(0,s.createElement)("span",{title:t("recent.stepHint")},t("recent.col.step")),(0,s.createElement)("span",null,t("recent.col.where")),(0,s.createElement)("span",null,t("recent.col.from")),(0,s.createElement)("span",{className:"pgw-rec__num",title:t("recent.placesHint")},t("recent.col.places")),(0,s.createElement)("span",{className:"pgw-rec__num",title:t("recent.restoredHint")},t("recent.col.restored")))}function ft(e){let{r:t,t:n}=e,[r,a]=(0,s.useState)(!1),i=(0,s.useId)(),o=se(t),l=o?n("recent.stepAt",o):"",d=o?n("recent.stepSent",o):"",f=[t.workspace,t.title??t.session].filter(u=>typeof u=="string"&&u!=="").join(" \xB7 "),w=t.failed?(0,s.createElement)(S.Tag,{tone:"danger"},n("recent.failed")):t.blocked?(0,s.createElement)(S.Tag,{tone:"danger"},n("recent.blocked")):(0,s.createElement)("span",{className:t.exfil?"pgw-rec__bad":void 0},t.n.toLocaleString()),k=t.failed?n("recent.failed"):t.blocked?n("recent.blocked"):t.n.toLocaleString(),b=[[n("recent.col.time"),ke(t.time)],[n("recent.col.step"),l],[n("recent.col.where"),[t.model??t.what,t.host].filter(Boolean).join(" \xB7 ")],[n("recent.col.from"),f],[n("recent.col.places"),k],[n("recent.col.restored"),t.restored.toLocaleString()]].filter(([,u])=>u!=="").map(([u,g])=>n("recent.cell",{name:u,value:g})).join(n("recent.cellSep"));return(0,s.createElement)("li",{className:"pgw-recs__item"},(0,s.createElement)("button",{type:"button",className:`pgw-rec${t.n===0&&!t.failed?" pgw-rec--zero":""}${e.open?" pgw-rec--open":""}`,"aria-expanded":e.open,"aria-controls":e.open?i:void 0,"aria-label":b,onClick:e.toggle},(0,s.createElement)(S.IconChevronRightOutlineRegular,{size:12,className:"pgw-rec__chevron"}),(0,s.createElement)("span",{className:"pgw-rec__time"},ke(t.time)),(0,s.createElement)("span",{className:"pgw-rec__step",title:l||void 0},o?Ge(o):""),(0,s.createElement)("span",{className:"pgw-rec__where",title:[t.model,t.host].filter(Boolean).join(" \xB7 ")},(0,s.createElement)("span",{className:"pgw-rec__model"},t.model??t.what),(0,s.createElement)("span",{className:"pgw-rec__host"},t.host)),(0,s.createElement)("span",{className:"pgw-rec__from",title:f},f),(0,s.createElement)("span",{className:"pgw-rec__num"},w),(0,s.createElement)("span",{className:"pgw-rec__num pgw-rec__dim"},t.restored.toLocaleString())),e.open?(0,s.createElement)("div",{className:"pgw-detail",id:i},t.exfil?(0,s.createElement)("div",{className:"pgw-notice pgw-notice--error"},(0,s.createElement)(S.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),n("recent.exfil",{hosts:(t.exfilHosts??[]).join(", ")})):null,o?(0,s.createElement)("div",{className:"pgw-meta"},d):null,t.values.length===0?(0,s.createElement)("div",{className:"pgw-empty"},n("recent.noValues")):(0,s.createElement)("table",{className:"pgw-values"},(0,s.createElement)("thead",null,(0,s.createElement)("tr",null,...["col.placeholder","col.kind","col.finder","col.head","col.len","col.n","col.action"].map(u=>(0,s.createElement)("th",{key:u},n(u))))),(0,s.createElement)("tbody",null,t.values.flatMap(u=>{let g=Ye(u,n),T=u.first?n("recent.valueFirst",{turn:u.first.turn,step:u.first.step}):o?n("recent.valueFirstHere"):"",M=u.at!==void 0||u.before!==void 0||u.after!==void 0||g!==""||T!=="";return[(0,s.createElement)("tr",{key:u.placeholder,className:u.before!==void 0||u.after!==void 0?"pgw-values__has":void 0},(0,s.createElement)("td",{className:"pgw-mono"},u.placeholder),(0,s.createElement)("td",null,u.kind),(0,s.createElement)("td",null,u.finder),(0,s.createElement)("td",{className:"pgw-mono"},oe(u)),(0,s.createElement)("td",null,u.len),(0,s.createElement)("td",null,u.n),(0,s.createElement)("td",null,u.action?n(u.action==="warn"?"action.warn":"action.block"):"")),M?(0,s.createElement)("tr",{key:`${u.placeholder}:ctx`,className:"pgw-values__ctx"},(0,s.createElement)("td",{colSpan:7},(0,s.createElement)("div",{className:"pgw-ctx"},(0,s.createElement)("div",{className:"pgw-ctx__line"},u.at?(0,s.createElement)(S.Tag,{tone:"neutral",className:"pgw-ctx__place",title:u.at.path},n(Xe(u.at)),(0,s.createElement)("span",{className:"pgw-ctx__path pgw-mono"},`\xB7 ${xe(u.at.path)}`)):null,u.before!==void 0||u.after!==void 0?(0,s.createElement)("span",{className:"pgw-ctx__text",title:n("recent.contextHint")},u.before??"",(0,s.createElement)("mark",{className:"pgw-ctx__mark pgw-mono"},u.placeholder),u.after??""):null),g!==""?(0,s.createElement)("div",{className:"pgw-ctx__more"},g):null,T!==""?(0,s.createElement)("div",{className:"pgw-ctx__more"},T):null))):null]}))),t.valuesOmitted?(0,s.createElement)("div",{className:"pgw-meta"},n("recent.omitted",{n:t.valuesOmitted.toLocaleString()})):null,e.viewable&&!r?(0,s.createElement)("div",null,(0,s.createElement)(S.Button,{variant:"outline",size:"sm",onClick:()=>a(!0)},n("view.open"))):null,e.viewable&&r?(0,s.createElement)(dt,{ctx:e.ctx,t:n,record:t,onClose:()=>a(!1)}):null):null)}function gt(e){let{t}=e,[n,r]=(0,s.useState)(!1),[a,i]=(0,s.useState)(!1),[o,l]=(0,s.useState)(!1),d=()=>{r(!1),i(!1)},f=()=>{l(!0),et(e.ctx).then(w=>{l(!1),d(),e.onDone(w.ok?t("card.resetDone",{n:w.value}):t("card.resetFailed",{message:W(w.failure,t)}),w.ok)})};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(S.Button,{variant:"ghost",size:"sm",className:"pgw-reset",disabled:o,onClick:()=>r(!0)},(0,s.createElement)(S.IconTrashOutlineRegular,{size:14}),(0,s.createElement)("span",null,t("card.reset"))),(0,s.createElement)(S.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:o,onAcknowledgedChange:i,onCancel:d,onConfirm:f}))}function mt(e){let{t}=e,[n,r]=(0,s.useState)(e.on),[a,i]=(0,s.useState)(!1),[o,l]=(0,s.useState)(!1),[d,f]=(0,s.useState)(!1);(0,s.useEffect)(()=>r(e.on),[e.on]);let w=()=>{i(!1),l(!1)},k=b=>{f(!0),tt(e.ctx,e.session,b).then(u=>{f(!1),w(),u.ok&&r(u.value),e.onDone(u.ok?null:t("session.failed",{message:W(u.failure,t)}))})};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("label",{className:"pgw-session"},(0,s.createElement)(S.Switch,{checked:n,disabled:d,onChange:b=>b?k(!0):i(!0)}),(0,s.createElement)("span",{className:"pgw-session__label"},t("session.mask"))),(0,s.createElement)(S.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:o,disabled:d,onAcknowledgedChange:l,onCancel:w,onConfirm:()=>k(!1)}))}var Wt=15e3,Ut=200,Jt=10,Qt=["today","week","month"];function Xt(e,t){let[n,r]=(0,p.useState)({status:"loading"}),[a,i]=(0,p.useState)(!1),o=(0,p.useRef)(null),l=(0,p.useCallback)(()=>{o.current?.abort();let d=new AbortController;o.current=d,i(!0),ie(e,Ut,d.signal,t).then(f=>{d.signal.aborted||(i(!1),r(w=>He(w,f)))})},[e,t]);return(0,p.useEffect)(()=>{l();let d=setInterval(()=>{(typeof document>"u"||document.visibilityState==="visible")&&l()},Wt);return()=>{clearInterval(d),o.current?.abort()}},[l]),[n,l,a]}function ue(e){return(0,p.createElement)(Yt,{key:e.sessionId??"",...e})}function Yt(e){let{t}=e,[n,r,a]=Xt(e.ctx,e.sessionId),[i,o]=(0,p.useState)("today"),[l,d]=(0,p.useState)(null),[f,w]=(0,p.useState)(0),[k,b]=(0,p.useState)(null),u=`pgw-card${e.panel?" pgw-card--panel":""}`,g=n.status==="ready"?n.data:void 0,T=!e.sessionId&&g!==void 0,M=(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&&g&&typeof g.sessionMasking=="boolean"?(0,p.createElement)(mt,{ctx:e.ctx,t,session:e.sessionId,on:g.sessionMasking,onDone:C=>{b(C===null?null:{text:C,ok:!1}),r()}}):null,g&&(!e.sessionId||!g.active)?(0,p.createElement)(R.Tag,{tone:g.active?"success":"warning"},t(g.active?"card.on":"card.off")):null,e.sessionId&&g&&g.sessionMasking===void 0?(0,p.createElement)(R.Tag,{tone:"outline"},t("panel.session")):null,g&&!e.sessionId?(0,p.createElement)("span",{className:"pgw-meta",title:t("card.valuesHint")},t("card.values",{n:g.values})):null,g&&!g.record?(0,p.createElement)("span",{className:"pgw-meta"},t("card.memoryOnly")):null),(0,p.createElement)("div",{className:"pgw-head__actions"},g?(0,p.createElement)(R.SegmentedControl,{id:`pgw-range-${e.sessionId??"all"}`,label:t("card.range"),value:i,options:Qt.map(C=>({value:C,label:t(`range.${C}`)})),onChange:o}):null,(0,p.createElement)(R.Button,{variant:"ghost",size:"sm",disabled:a,title:t("card.refresh"),"aria-label":t("card.refresh"),onClick:r},(0,p.createElement)(R.IconRefreshOutlineRegular,{size:14})),T?(0,p.createElement)(gt,{ctx:e.ctx,t,onDone:(C,E)=>{b({text:C,ok:E}),d(null),w(0),r()}}):null)),z=k?(0,p.createElement)("div",{className:`pgw-flash${k.ok?"":" pgw-flash--error"}`,role:"status"},k.text):null,B=n.status==="ready"&&n.stale?(0,p.createElement)("div",{className:"pgw-notice pgw-notice--error",role:"status"},(0,p.createElement)(R.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,p.createElement)("span",null,t("card.stale",{reason:W(n.stale,t)}))):null,te=e.sessionId&&g?.sessionMasking===!1?(0,p.createElement)("div",{className:"pgw-notice",role:"status"},(0,p.createElement)(R.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,p.createElement)("span",null,t("session.offNotice"))):null;if(!g){let C=n.status==="error"?`${t("card.unavailable")} ${t("card.reason",{reason:W(n.failure,t)})}`:t("card.loading");return(0,p.createElement)("section",{className:u},M,(0,p.createElement)("div",{className:"pgw-empty pgw-empty--block"},C))}if(e.sessionId&&g.recent.length===0)return(0,p.createElement)("section",{className:u},M,B,z,te,(0,p.createElement)("div",{className:"pgw-empty pgw-empty--block"},t("panel.empty")));let A=g,j=A.stats[i],J=new Set(A.vendorView?A.views??[]:[]),F=Qe(A.recent,f,Jt),Q=C=>{w(C),d(null)};return(0,p.createElement)("section",{className:u},M,B,z,te,(0,p.createElement)(ct,{t,items:ze(A,j)}),(0,p.createElement)(ut,{totals:j,t}),(0,p.createElement)("div",{className:"pgw-dists"},(0,p.createElement)(ce,{title:t("dist.kind"),data:j.kinds,empty:t("dist.empty")}),(0,p.createElement)(ce,{title:t("dist.finder"),data:j.finders,empty:t("dist.empty")}),(0,p.createElement)(ce,{title:t("dist.host"),data:j.hosts,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")),A.recent.length>0?(0,p.createElement)("span",{className:"pgw-meta"},t("recent.count",{n:A.recent.length})):null),A.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)(pt,{t}),(0,p.createElement)("ul",{className:"pgw-recs__list","aria-label":t("recent.title")},F.items.map(C=>(0,p.createElement)(ft,{key:C.key,ctx:e.ctx,r:C,open:l===C.key,toggle:()=>d(l===C.key?null:C.key),t,viewable:J.has(C.key)})))),F.pages>1?(0,p.createElement)("div",{className:"pgw-pager"},(0,p.createElement)(R.Button,{variant:"ghost",size:"sm",disabled:F.page===0,onClick:()=>Q(0)},t("page.first")),(0,p.createElement)(R.Button,{variant:"ghost",size:"sm",disabled:F.page===0,"aria-label":t("page.prev"),title:t("page.prev"),onClick:()=>Q(F.page-1)},(0,p.createElement)(R.IconChevronLeftOutlineRegular,{size:14})),(0,p.createElement)("span",{className:"pgw-meta pgw-pager__at"},t("page.at",{page:F.page+1,pages:F.pages})),(0,p.createElement)(R.Button,{variant:"ghost",size:"sm",disabled:F.page>=F.pages-1,"aria-label":t("page.next"),title:t("page.next"),onClick:()=>Q(F.page+1)},(0,p.createElement)(R.IconChevronRightOutlineRegular,{size:14}))):null))}var Zt="dsh-privacy-gateway",U=le(void 0);function ht(e,t){return e.code==="noDisposer"?t("err.noDisposer"):t("err.thrown",{message:e.message})}function yt(e,t){U.set(void 0);let n;try{let r=e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:Zt,order:35,locale:K,label:()=>t("panel.tab")},a=>(0,wt.createElement)(ue,{ctx:e,t,panel:!0,...a?.sessionId?{sessionId:a.sessionId}:{}})));if(typeof r!="function"){U.set({code:"noDisposer"});return}n=r}catch(r){U.set({code:"thrown",message:r instanceof Error?r.message:String(r)});return}return()=>{let r=n;n=void 0;try{r?.()}catch{}}}var pe=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(i=>i.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 i of a.done)i(!1)}this.notify()}}notify(){this.onState(this.state)}};function en(){let[,e]=(0,m.useState)(0),t=(0,m.useSyncExternalStore)(G.subscribe,G.get),n=(0,m.useMemo)(()=>{try{return t?.describe()}catch{return}},[t]);(0,m.useEffect)(()=>{if(n)return Promise.resolve(n.ensure()).catch(()=>{}),n.subscribe(()=>e(l=>l+1))},[n]);let r=n?.getSnapshot().view,a=(0,m.useMemo)(()=>r?_e(r.namespaces):void 0,[r]),i=(0,m.useMemo)(()=>{try{return t&&a!==void 0?t.get(a):void 0}catch{return}},[t,a]);(0,m.useEffect)(()=>i?i.subscribe(()=>e(l=>l+1)):void 0,[i]);let o=i?.getSnapshot();return(0,m.useMemo)(()=>{if(!i||!o)return;let l=i.mutate,d=l?(f,w)=>l.call(i,f,w):async f=>{for(let w of f)if(!await i.set(w.path.join("."),w.value))return!1;return!0};return{state:{status:o.status,value:o.value,revision:o.revision,writable:o.writable!==!1},mutate:d}},[i,o])}var vt="dsh-privacy-gateway.config.open",tn=["mask"];function nn(){try{let e=JSON.parse(globalThis.localStorage?.getItem(vt)??"null");if(Array.isArray(e))return ne.filter(t=>e.includes(t))}catch{}return[...tn]}function rn(e){try{globalThis.localStorage?.setItem(vt,JSON.stringify(e))}catch{}}var L=e=>e;function Ce(e){let{ctx:t,t:n}=e,r=en(),a=e.form??r,i=(0,m.useRef)(a);i.current=a;let[o,l]=(0,m.useState)({busy:!1,failed:!1}),[d]=(0,m.useState)(()=>new pe((c,v,x)=>{let _=i.current;return _?_.mutate([{op:"set",path:[c],value:v}],x?void 0:_.state.revision):Promise.resolve(!1)},l)),[f,w]=(0,m.useState)(null),[k,b]=(0,m.useState)(!1),u=(0,m.useSyncExternalStore)(U.subscribe,U.get),g=(0,m.useId)(),[T,M]=(0,m.useState)(null),[z,B]=(0,m.useState)(!1),[te,A]=(0,m.useState)(nn),j=c=>A(v=>{let x=v.includes(c)?v.filter(_=>_!==c):ne.filter(_=>_===c||v.includes(_));return rn(x),x}),J=a?.state,F=J?.status==="ready",Q=J?.writable!==!1,C=J?.value??{},E=c=>d.latest(c,C[c]);if((0,m.useEffect)(()=>{let c=new AbortController;return nt(t,c.signal).then(v=>{c.signal.aborted||(B(!v.ok),M(v.ok?v.value:[]))}),()=>c.abort()},[t]),!a)return(0,m.createElement)("div",{className:"pgw-empty"},n("cfg.unavailable"));let q=!F||!Q,Ct=c=>T?.find(v=>v.id.toLowerCase()===c.toLowerCase())?.name??c,X=(c,v)=>{if(q)return Promise.resolve(!1);let x=Te(c,E(c.key),v);return x?new Promise(_=>{b(!1),w($=>($?.resolve(!1),{f:c,next:v,change:x,resolve:_}))}):d.write(c.key,v)},Se=c=>{let v=f;w(null),b(!1),v&&(c?d.write(v.f.key,v.next).then(v.resolve):v.resolve(!1))},Nt=c=>{let v=n(L(`cfg.f.${c.key}`));switch(c.kind){case"switch":return(0,m.createElement)(Ve,{label:v,checked:Y(E(c.key),c.default),disabled:q,onChange:x=>{X(c,x)}});case"choice":{let x=he(E(c.key),c.choices,c.default);return(0,m.createElement)(ye,{label:n(L(`cfg.f.${c.key}.${x}`)),labelledBy:`${g}${c.key}`,items:c.choices.map(_=>({id:_,label:n(L(`cfg.f.${c.key}.${_}`))})),selectedId:x,disabled:q,onSelect:_=>{_!==x&&X(c,_)}})}case"list":return(0,m.createElement)(Le,{t:n,list:V(E(c.key),c.default),anyCase:c.anyCase,placeholder:n(L(`cfg.f.${c.key}.placeholder`)),disabled:q,onChange:x=>X(c,x)});case"count":return(0,m.createElement)(De,{t:n,value:Z(E(c.key),c.min,c.default),min:c.min,label:v,disabled:q,onChange:x=>X(c,x)});case"providers":return St(c)}},St=c=>{let v=V(E(c.key),[]),x=st(T??[],v),_=x.filter(P=>P.excluded).map(P=>P.name),$=Ae(_,n("cfg.sep")),we=$.kind==="none"?n("cfg.excludedNone"):$.kind==="some"?$.names:n("cfg.excludedMany",{names:$.names,n:$.n});return(0,m.createElement)(ye,{label:we,labelledBy:`${g}${c.key}`,multi:!0,items:x.map(P=>({id:P.id,label:P.registered?P.name:n("cfg.providerAbsent",{name:P.name})})),selectedIds:x.filter(P=>P.excluded).map(P=>P.id),disabled:q,onSelect:P=>{X(c,ot(V(E(c.key),[]),P))}})},Re=c=>{if(c.key==="showPanel"&&u)return(0,m.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.sidebarFailed",{reason:ht(u,n)}));if(c.key==="excludeProviders"&&z)return(0,m.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.providerListUnavailable"))},Rt=Object.fromEntries(re.map(c=>[c.key,E(c.key)])),Tt=c=>{let v=re.filter(O=>O.group===c),x=n(L(`cfg.g.${c}`)),_=te.includes(c),$=Oe(c,Rt),we=v.some(O=>Re(O)!==void 0),P=F?[...$.map((O,Pt)=>(0,m.createElement)("span",{key:Pt,className:O.off?"pgw-fold__part pgw-fold__part--off":"pgw-fold__part"},n(L(O.key),O.params))),we?(0,m.createElement)("span",{key:"problem",className:"pgw-fold__part pgw-fold__part--error"},n("cfg.s.problem")):null]:null;return(0,m.createElement)($e,{key:c,title:x,summary:P,open:_,toggleLabel:n(_?"cfg.collapse":"cfg.expand",{name:x}),onToggle:()=>j(c)},v.map(O=>(0,m.createElement)(Ee,{key:O.key,title:n(L(`cfg.f.${O.key}`)),titleId:`${g}${O.key}`,hint:n(L(`cfg.f.${O.key}.hint`)),note:Re(O),inline:Pe(O),half:O.half===!0},Nt(O))))},me=f?an(f,n,f.f.key==="excludeProviders"?Ct:c=>c):null;return(0,m.createElement)(m.Fragment,null,(0,m.createElement)("section",{className:"pgw-cfg","aria-busy":o.busy||void 0},e.form?null:(0,m.createElement)("h3",{className:"pgw-title"},n("cfg.title")),o.failed?(0,m.createElement)("div",{className:"pgw-notice pgw-notice--error",role:"alert"},n("cfg.failed")):null,(0,m.createElement)("div",{className:"pgw-cfg__folds"},ne.map(Tt)),(0,m.createElement)("p",{className:"pgw-cfg__desc pgw-cfg__foot"},n("cfg.applies")," ",n("cfg.others"))),(0,m.createElement)(bt.RiskConfirmation,{open:f!==null,title:me?.title??"",description:me?.body??"",acknowledgeLabel:me?.ack??"",cancelLabel:n("card.cancel"),closeLabel:n("card.close"),confirmLabel:n("cfg.risk.confirm"),acknowledged:k,onAcknowledgedChange:b,onCancel:()=>Se(!1),onConfirm:()=>Se(!0)}))}function an(e,t,n){let{change:r}=e,a={},i=r.added??r.removed;return i&&(a.names=i.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":"cfg.risk.delete.title"),body:t(L(`cfg.r.${e.f.key}`),a),ack:t(r.risk==="send"?"cfg.risk.send.ack":"cfg.risk.delete.ack")}}var fe="dsh-privacy-gateway",kt="dsh-privacy-gateway";var Ne="var(--ds-font-family-code,ui-monospace,monospace)",sn=`
|
|
3
|
+
"use strict";var ge=require("react");var St=require("@deepseek-ai/dsh-client-ui-primitives"),p=require("react");var O=require("@deepseek-ai/dsh-client-ui-primitives"),w=require("react");var ne=["mask","lists","record","view"],re=[{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:"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 Oe(e,t,n){if(e.risk)switch(e.kind){case"switch":return Z(t,e.default)&&!Z(n,e.default)?{risk:e.risk}:void 0;case"list":case"providers":{let r=e.kind==="providers"||e.anyCase,a=f=>r?f.trim().toLowerCase():f.trim(),s=(f,m)=>{let _=new Set(f.map(a));return m.filter(b=>!_.has(a(b)))},i=z(t,e.default),d=z(n,e.default);if(e.kind==="list"&&e.risky==="remove"){let f=s(d,i);return f.length>0?{risk:e.risk,removed:f}:void 0}let l=s(i,d);return l.length>0?{risk:e.risk,added:l}:void 0}case"count":{let r=ee(t,e.min,e.default),a=ee(n,e.min,e.default);return a<r?{risk:e.risk,from:r,to:a}:void 0}case"choice":return}}function Ee(e){return e.kind==="switch"||e.kind==="choice"||e.kind==="count"}function Y(e,t){let n=re.find(r=>r.key===e&&r.kind===t);if(!n)throw new Error(`no ${t} field ${e}`);return n}function Pe(e,t){let n=r=>Z(t[r],Y(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:"cfg.s.maskNothing",off:!0}]:r.map(i=>({key:`cfg.s.${i}`}));n("shape")&&a.push({key:"cfg.s.shape"});let s=Y("toolGuard","choice");return a.push({key:`cfg.s.toolGuard.${we(t.toolGuard,s.choices,s.default)}`}),a}case"lists":return[{key:"cfg.s.words",params:{n:z(t.words,Y("words","list").default).length}},{key:"cfg.s.allow",params:{n:z(t.allow,Y("allow","list").default).length}}];case"record":{let r=Y("keepDays","count"),a=n("record")?[{key:"cfg.s.record",params:{n:ee(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=z(t.excludeProviders,Y("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 Z(e,t){return typeof e=="boolean"?e:t}function we(e,t,n){return typeof e=="string"&&t.includes(e)?e:n}function z(e,t){return Array.isArray(e)?e.filter(n=>typeof n=="string"):[...t]}function ee(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t?Math.floor(e):n}function Fe(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 Me(e,t){return e.filter(n=>n!==t)}function Ke(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 De(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 Ve(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 Le(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)(O.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 $e(e){return(0,w.createElement)(O.Switch,{checked:e.checked,label:e.label,disabled:e.disabled,onChange:e.onChange})}function ye(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)(O.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)(O.IconChevronDownOutlineRegular,{className:"pgw-select__chevron"}))})}function ze(e){let{t}=e,[n,r]=(0,w.useState)(""),[a,s]=(0,w.useState)(!1),i=Fe(e.list,n,e.anyCase),d=()=>{if(!i||e.disabled||a)return;let l=n;s(!0),e.onChange(i).then(f=>{s(!1),f&&r(m=>m===l?"":m)})};return(0,w.createElement)("div",{className:"pgw-cfg__list"},(0,w.createElement)("div",{className:"pgw-cfg__add"},(0,w.createElement)(O.Input,{className:"pgw-cfg__input",type:"text",value:n,placeholder:e.placeholder,"aria-label":e.placeholder,disabled:e.disabled,onChange:l=>r(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),d())}}),(0,w.createElement)(O.Button,{variant:"outline",size:"sm",disabled:e.disabled||a||!i,onClick:d},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(l=>(0,w.createElement)(O.Tag,{key:l,tone:"neutral",className:"pgw-cfg__tag",title:l},(0,w.createElement)("span",{className:"pgw-cfg__tagText"},l),(0,w.createElement)("button",{type:"button",className:"pgw-cfg__tagX","aria-label":t("cfg.remove",{name:l}),disabled:e.disabled,onClick:()=>{e.onChange(Me(e.list,l))}},(0,w.createElement)(O.IconCloseOutlineRegular,{size:12}))))))}function Be(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=Ke(t,e.min),s=()=>{if(a===void 0||a===e.value||a===r.current)return;let i=e.value;r.current=a,e.onChange(a).then(d=>{r.current=void 0,d||n(String(i))})};return(0,w.createElement)("div",{className:"pgw-cfg__list"},(0,w.createElement)(O.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 He(e,t=6,n="\u2026"){let r=Object.entries(e).filter(([,d])=>d>0).sort((d,l)=>l[1]-d[1]||(d[0]<l[0]?-1:1)),a=r.slice(0,t),s=r.slice(t).reduce((d,[,l])=>d+l,0);s>0&&a.push([n,s]);let i=a.reduce((d,[,l])=>Math.max(d,l),0);return a.map(([d,l])=>({label:d,value:l,pct:i>0?Math.max(2,Math.round(l/i*100)):0}))}var Dt={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"},Vt={rule:"hint.finder.rule",word:"hint.finder.word",known:"hint.finder.known",cookie:"hint.finder.cookie"};function je(e){return Dt[e]}function Ge(e){return Vt[e]}function We(e,t){return e.filter(n=>(t.kind===void 0||n.kind===t.kind)&&(t.finder===void 0||n.finder===t.finder))}function ve(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 Ye(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 xe(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 H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),R=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function ae(e){let t={};if(H(e))for(let[n,r]of Object.entries(e))typeof r=="number"&&Number.isFinite(r)&&(t[n]=r);return t}function ke(e){if(!H(e))return;let t=H(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:ae(e.kinds),finders:ae(e.finders),hosts:ae(e.hosts),models:ae(e.models)}}function Lt(e){return H(e)&&typeof e.key=="number"&&typeof e.time=="string"&&Array.isArray(e.values)&&e.values.every(H)}function Je(e){if(!(!H(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 $t(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let r of e){let a=Je(r);a===void 0||n.has(a.path)||(n.add(a.path),t.push(a))}return t}var zt=7,Bt=["rule","word","known","cookie"],be=e=>Math.max(0,Math.floor(R(e)));function Ht(e){if(typeof e.placeholder!="string"||e.placeholder==="")return;let t=m=>typeof m=="string"?m:void 0,n=t(e.tail),r=t(e.before),a=t(e.after),s=Je(e.at),i=oe(e.first??{}),d=$t(e.elsewhere),l=d.slice(0,zt),f=be(e.elsewhereOmitted)+d.length-l.length;return{placeholder:e.placeholder,kind:t(e.kind)??"",finder:Bt.find(m=>m===e.finder)??"rule",head:t(e.head)??"",...n!==void 0?{tail:n}:{},len:be(e.len),n:be(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}:{},...l.length>0?{elsewhere:l}:{},...f>0?{elsewhereOmitted:f}:{}}}function oe(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 Ue(e){return`${e.turn}\xB7${e.step}`}function jt(e){let{valuesOmitted:t,turn:n,step:r,...a}=e,s=R(t),i=oe({turn:n,step:r});return{...a,n:R(e.n),restored:R(e.restored),unmapped:R(e.unmapped),values:e.values.map(Ht).filter(d=>d!==void 0),...s>0?{valuesOmitted:s}:{},...i??{}}}function Qe(e){if(!H(e)||typeof e.active!="boolean"||!H(e.stats)||!Array.isArray(e.recent))return;let t=ke(e.stats.today),n=ke(e.stats.week),r=ke(e.stats.month);if(!(!t||!n||!r))return{...e,values:R(e.values),stats:{today:t,week:n,month:r,failStreak:R(e.stats.failStreak)},recent:e.recent.filter(Lt).map(jt),...Array.isArray(e.views)?{views:e.views.filter(a=>typeof a=="number")}:{}}}function Xe(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}}var Gt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function Ze(e){let t=e;try{t=JSON.stringify(JSON.parse(e),null,2)}catch{}return t.split(`
|
|
4
|
+
`)}function et(e){return e.map(t=>t.placeholder).join("\0")}function tt(e,t,n,r=400){let a=[...new Set(t.filter(l=>l!==""))].sort((l,f)=>f.length-l.length),s=a.length>0?new RegExp(a.map(Gt).join("|"),"g"):void 0,i=[],d=!1;for(let l=0;l<e.length;l++){let f=e[l],m=[],_=0;if(s)for(let b of f.matchAll(s))b.index>_&&m.push({text:f.slice(_,b.index)}),m.push({text:b[0],id:b[0]}),_=b.index+b[0].length;if(!(n&&_===0)){if((_<f.length||m.length===0)&&m.push({text:f.slice(_)}),i.length>=r){d=!0;break}i.push({n:l+1,parts:m})}}return{lines:i,truncated:d}}function nt(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 rt(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 _e(e){let t=e.split("."),n=t[0]??"",r=t[1]??"";return n!==""&&/^\d+$/.test(r)?`${n}.${r}`:n}function at(e,t){let n=[...new Set((e.elsewhere??[]).map(a=>_e(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 se(e){return e.head?e.tail?`${e.head}\u2026${e.tail}`:`${e.head}\u2026`:""}function J(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 te(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},d=await s.call("/api",`privacyGateway/${t}`,{args:i},a);if(d?.ok!==!0){let f=d?.error?.message;return{ok:!1,failure:typeof f=="string"&&f!==""?{code:"remote",message:f}:{code:"malformed"}}}let l=r(d.value);return l===void 0?{ok:!1,failure:{code:"malformed"}}:{ok:!0,value:l}}catch(i){return{ok:!1,failure:{code:"thrown",message:i instanceof Error?i.message:String(i)}}}}function ie(e,t,n,r){return te(e,"overview",r?{limit:t,session:r}:{limit:t},Qe,n)}function ot(e,t,n){return te(e,"vendorView",{key:t},r=>{let a=r?.body;return r!==null&&typeof r=="object"&&typeof a=="string"?a:null},n)}function st(e){return te(e,"reset",void 0,t=>{let n=t?.files;return typeof n=="number"?n:0})}function it(e,t,n){return te(e,"sessionMasking",{session:t,on:n},r=>{let a=r?.on;return typeof a=="boolean"?a:void 0})}function lt(e,t){return te(e,"providers",void 0,n=>Array.isArray(n)?n.flatMap(Wt):void 0,t)}function Wt(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 le(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 qt="Show the Privacy tab at the top of the session";function Yt(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 Ne(e){for(let t of e){let n=Yt(t.schema);if(n.includes("showPanel")&&(t.ns.includes("privacy-gateway")||n.includes("excludeProviders")||JSON.stringify(t.schema??null).includes(qt)))return t.ns}}function Jt(e){let t=Ne(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 Ut(e){let t=e;return t!=null&&typeof t.describe=="function"&&typeof t.get=="function"?t:void 0}var G=le(void 0);function dt(e){let t=n=>n.effect(()=>{let r;try{r=Ut(n.get("configForms"))}catch{r=void 0}return G.set(r),()=>{G.get()===r&&G.set(void 0)}},"dsh-privacy-gateway: settings service");typeof e.inject=="function"?e.inject(["configForms"],t):t(e)}var Qt=6e4;function Xt(e,t){return t===void 0?e:t||e===!0?!0:e===!1?!1:void 0}function ct(e,t,n=G){let r=!1,a,s,i,d=()=>{if(r)return;let y=Xt(s,i);y===void 0||y===a||(a=y,t(y))},l=()=>{ie(e,1).then(y=>{r||!y.ok||(s=y.value.showPanel===!0,d())})},f,m=y=>{try{f?.()}catch{}f=void 0,i=void 0;let h;try{h=y?.describe()}catch{h=void 0}if(h){let P=h,F=()=>{if(r)return;let D=P.getSnapshot().view;if(!D)return;let V=Jt(D.namespaces);V!==void 0&&(i=V,d())};f=P.subscribe(F),Promise.resolve(P.ensure()).then(F,F),F()}d()},_=n.subscribe(()=>m(n.get()));m(n.get()),l();let b=setInterval(l,Qt);return()=>{r=!0,clearInterval(b),_();try{f?.()}catch{}}}function ut(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 ft(e,t){let n=t.toLowerCase();return e.some(r=>r.toLowerCase()===n)?e.filter(r=>r.toLowerCase()!==n):[...e,t]}var _t=require("react");var j="privacyGateway",Zt={"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":"\u5171 {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.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.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\u539F\u6587","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.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.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\uFF0C\u56DE\u590D\u91CC\u7167\u6837\u8FD8\u539F\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\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","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.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.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.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\uFF0C\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.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.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.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"},en={"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":"{n} in all","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.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.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":"As the model service got it","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.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.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. Replies are restored as usual.","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. 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.","cfg.f.toolGuard.off":"Count only","cfg.f.toolGuard.warn":"Warn and record","cfg.f.toolGuard.block":"Do not restore","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.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.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, to 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.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.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.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."},pt={zh:Zt,en};var T=require("@deepseek-ai/dsh-client-ui-primitives"),u=require("react");var x=require("@deepseek-ai/dsh-client-ui-primitives"),o=require("react");var de=require("@deepseek-ai/dsh-client-ui-primitives"),k=require("react");function tn(e,t){if(!e)return t("view.unknown");let n=e.action?` \xB7 ${t(e.action==="warn"?"action.warn":"action.block")}`:"",r=se(e);return`\u2039${e.kind} \xB7 ${r?`${r} \xB7 `:""}${e.len}${n}\u203A`}function gt(e,t,n,r){return e.parts.map((a,s)=>a.id===void 0?a.text:(0,k.createElement)("mark",{key:s,className:`pgw-view__mark${n?" pgw-view__mark--agent":""}`,title:a.id},n?tn(t.get(a.id),r):a.text))}function mt(e){let{ctx:t,t:n,record:r}=e,[a,s]=(0,k.useState)({status:"loading"}),[i,d]=(0,k.useState)(!0);(0,k.useEffect)(()=>{let h=new AbortController;return s({status:"loading"}),ot(t,r.key,h.signal).then(P=>{h.signal.aborted||s(P.ok?P.value===null?{status:"gone"}:{status:"ready",body:P.value}:{status:"error"})}),()=>h.abort()},[t,r.key]);let l=et(r.values),f=(0,k.useMemo)(()=>new Map(r.values.map(h=>[h.placeholder,h])),[r.key,l]),m=a.status==="ready"?a.body:void 0,_=(0,k.useMemo)(()=>m!==void 0?Ze(m):void 0,[m]),b=(0,k.useMemo)(()=>_?tt(_,[...f.keys()],i):void 0,[_,f,i]),y=(0,k.createElement)("div",{className:"pgw-head"},(0,k.createElement)("span",{className:"pgw-dist__title"},n("view.title")),(0,k.createElement)(de.Checkbox,{checked:i,label:n("view.onlyChanged"),className:"pgw-meta",onChange:d}),(0,k.createElement)("span",{className:"pgw-spacer"}),(0,k.createElement)(de.Button,{variant:"outline",size:"sm",onClick:e.onClose},n("view.close")));if(!b){let h=a.status==="loading"?"view.loading":a.status==="gone"?"view.gone":"card.unavailable";return(0,k.createElement)("div",{className:"pgw-view"},y,(0,k.createElement)("div",{className:"pgw-empty"},n(h)))}return(0,k.createElement)("div",{className:"pgw-view"},y,b.lines.length===0?(0,k.createElement)("div",{className:"pgw-empty"},n("view.none")):(0,k.createElement)("div",{className:"pgw-view__scroll"},(0,k.createElement)("table",{className:"pgw-view__table"},(0,k.createElement)("thead",null,(0,k.createElement)("tr",null,(0,k.createElement)("th",null,n("view.line")),(0,k.createElement)("th",null,n("view.agent")),(0,k.createElement)("th",null,n("view.vendor")))),(0,k.createElement)("tbody",null,b.lines.map(h=>(0,k.createElement)("tr",{key:h.n},(0,k.createElement)("td",{className:"pgw-view__n"},h.n),(0,k.createElement)("td",{className:"pgw-view__code"},...gt(h,f,!0,n)),(0,k.createElement)("td",{className:"pgw-view__code"},...gt(h,f,!1,n))))))),b.truncated?(0,k.createElement)("div",{className:"pgw-meta"},n("view.truncated",{n:b.lines.length})):null)}function wt(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 yt(e){let{totals:t,t:n}=e,r=i=>(i??0).toLocaleString(),a=Ye(t),s=[{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:r(t.restored),...t.restoredInTools>0?{sub:n("stat.inTools",{n:t.restoredInTools})}:{}},{label:n("stat.unmapped"),value:r(t.unmapped),...t.unmapped>0?{tone:"warn"}:{}},{label:n("stat.failed"),value:r(t.failed),...t.failed>0?{tone:"error"}:{}}];return(t.warned??0)>0&&s.push({label:n("stat.warned"),value:r(t.warned),tone:"warn"}),(t.blocked??0)>0&&s.push({label:n("stat.blocked"),value:r(t.blocked),tone:"warn"}),(t.exfil??0)>0&&s.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&&s.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"},s.map(i=>(0,o.createElement)("div",{key:i.label,className:`pgw-kpi${i.tone?` pgw-kpi--${i.tone}`:""}`},(0,o.createElement)("span",{className:"pgw-kpi__label"},i.label),(0,o.createElement)("span",{className:"pgw-kpi__value"},i.value),i.sub?(0,o.createElement)("span",{className:"pgw-kpi__sub"},i.sub):null)))}function Se(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 nn(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 ce(e){let{t,field:n}=e,r=He(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)(Se,{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"?je:Ge)(s.label),d=(0,o.createElement)("span",i===void 0?{className:"pgw-bar__label",title:s.label}:{className:"pgw-bar__label pgw-bar__label--hint"},s.label),l=i===void 0||n===void 0?d:(0,o.createElement)(x.HoverCard,{anchor:d,content:(0,o.createElement)(nn,{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"},l,(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 kt(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 Ce="*";function ht(e){let{t,field:n}=e,[r,a]=(0,o.useState)(!1),s=t(n==="kind"?"col.kind":"col.finder"),i=[{id:Ce,label:t("filter.all")},...e.names.map(l=>({id:l,label:l}))],d=(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(l=>!l)},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??Ce,onSelect:l=>{a(!1),e.onChange(l===Ce?void 0:l)},align:"start",portal:!0,anchor:(0,o.createElement)(x.HoverCard,{anchor:d,content:e.hint,disabled:r})})}function bt(e){let{r:t,t:n}=e,[r,a]=(0,o.useState)(!1),[s,i]=(0,o.useState)(void 0),[d,l]=(0,o.useState)(void 0),f=We(t.values,{...s===void 0?{}:{kind:s},...d===void 0?{}:{finder:d}}),m=ve(t.values,"kind"),_=ve(t.values,"finder"),b=(0,o.useId)(),y=oe(t),h=y?n("recent.stepAt",y):"",P=y?n("recent.stepSent",y):"",F=[t.workspace,t.title??t.session].filter(g=>typeof g=="string"&&g!=="").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(),W=[[n("recent.col.time"),xe(t.time)],[n("recent.col.step"),h],[n("recent.col.where"),[t.model??t.what,t.host].filter(Boolean).join(" \xB7 ")],[n("recent.col.from"),F],[n("recent.col.places"),V],[n("recent.col.restored"),t.restored.toLocaleString()]].filter(([,g])=>g!=="").map(([g,M])=>n("recent.cell",{name:g,value:M})).join(n("recent.cellSep"));return(0,o.createElement)("li",{className:"pgw-recs__item"},(0,o.createElement)("button",{type:"button",className:`pgw-rec${t.n===0&&!t.failed?" pgw-rec--zero":""}${e.open?" pgw-rec--open":""}`,"aria-expanded":e.open,"aria-controls":e.open?b:void 0,"aria-label":W,onClick:e.toggle},(0,o.createElement)(x.IconChevronRightOutlineRegular,{size:12,className:"pgw-rec__chevron"}),(0,o.createElement)("span",{className:"pgw-rec__time"},xe(t.time)),(0,o.createElement)("span",{className:"pgw-rec__step",title:h||void 0},y?Ue(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:F},F),(0,o.createElement)("span",{className:"pgw-rec__num"},D),(0,o.createElement)("span",{className:"pgw-rec__num pgw-rec__dim"},t.restored.toLocaleString())),e.open?(0,o.createElement)("div",{className:"pgw-detail",id:b},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,y?(0,o.createElement)("div",{className:"pgw-meta"},P):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)(ht,{t:n,field:"kind",names:m,value:s,hint:(0,o.createElement)(Se,{t:n,field:"kind"}),onChange:i})),(0,o.createElement)("th",{key:"col.finder"},(0,o.createElement)(ht,{t:n,field:"finder",names:_,value:d,hint:(0,o.createElement)(Se,{t:n,field:"finder"}),onChange:l})),(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,f.length===0?(0,o.createElement)("tr",{key:"none",className:"pgw-values__empty"},(0,o.createElement)("td",{colSpan:7},n("filter.none"))):f.flatMap(g=>{let M=at(g,n),L=g.first?n("recent.valueFirst",{turn:g.first.turn,step:g.first.step}):y?n("recent.valueFirstHere"):"",E=g.at!==void 0||g.before!==void 0||g.after!==void 0||M!==""||L!=="";return[(0,o.createElement)("tr",{key:g.placeholder,className:g.before!==void 0||g.after!==void 0?"pgw-values__has":void 0},(0,o.createElement)("td",{className:"pgw-mono"},g.placeholder),(0,o.createElement)("td",null,g.kind),(0,o.createElement)("td",null,g.finder),(0,o.createElement)("td",{className:"pgw-mono"},se(g)),(0,o.createElement)("td",null,g.len),(0,o.createElement)("td",null,g.n),(0,o.createElement)("td",null,g.action?n(g.action==="warn"?"action.warn":"action.block"):"")),E?(0,o.createElement)("tr",{key:`${g.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"},g.at?(0,o.createElement)(x.Tag,{tone:"neutral",className:"pgw-ctx__place",title:g.at.path},n(rt(g.at)),(0,o.createElement)("span",{className:"pgw-ctx__path pgw-mono"},`\xB7 ${_e(g.at.path)}`)):null,g.before!==void 0||g.after!==void 0?(0,o.createElement)("span",{className:"pgw-ctx__text",title:n("recent.contextHint")},g.before??"",(0,o.createElement)("mark",{className:"pgw-ctx__mark pgw-mono"},g.placeholder),g.after??""):null),M!==""?(0,o.createElement)("div",{className:"pgw-ctx__more"},M):null,L!==""?(0,o.createElement)("div",{className:"pgw-ctx__more"},L):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)(mt,{ctx:e.ctx,t:n,record:t,onClose:()=>a(!1)}):null):null)}function vt(e){let{t}=e,[n,r]=(0,o.useState)(!1),[a,s]=(0,o.useState)(!1),[i,d]=(0,o.useState)(!1),l=()=>{r(!1),s(!1)},f=()=>{d(!0),st(e.ctx).then(m=>{d(!1),l(),e.onDone(m.ok?t("card.resetDone",{n:m.value}):t("card.resetFailed",{message:J(m.failure,t)}),m.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:l,onConfirm:f}))}function xt(e){let{t}=e,[n,r]=(0,o.useState)(e.on),[a,s]=(0,o.useState)(!1),[i,d]=(0,o.useState)(!1),[l,f]=(0,o.useState)(!1);(0,o.useEffect)(()=>r(e.on),[e.on]);let m=()=>{s(!1),d(!1)},_=b=>{f(!0),it(e.ctx,e.session,b).then(y=>{f(!1),m(),y.ok&&r(y.value),e.onDone(y.ok?null:t("session.failed",{message:J(y.failure,t)}))})};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("label",{className:"pgw-session"},(0,o.createElement)(x.Switch,{checked:n,disabled:l,onChange:b=>b?_(!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:l,onAcknowledgedChange:d,onCancel:m,onConfirm:()=>_(!1)}))}var rn=15e3,an=200,on=10,sn=["today","week","month"];function ln(e,t){let[n,r]=(0,u.useState)({status:"loading"}),[a,s]=(0,u.useState)(!1),i=(0,u.useRef)(null),d=(0,u.useCallback)(()=>{i.current?.abort();let l=new AbortController;i.current=l,s(!0),ie(e,an,l.signal,t).then(f=>{l.signal.aborted||(s(!1),r(m=>Xe(m,f)))})},[e,t]);return(0,u.useEffect)(()=>{d();let l=setInterval(()=>{(typeof document>"u"||document.visibilityState==="visible")&&d()},rn);return()=>{clearInterval(l),i.current?.abort()}},[d]),[n,d,a]}function ue(e){return(0,u.createElement)(dn,{key:e.sessionId??"",...e})}function dn(e){let{t}=e,[n,r,a]=ln(e.ctx,e.sessionId),[s,i]=(0,u.useState)("today"),[d,l]=(0,u.useState)(null),[f,m]=(0,u.useState)(0),[_,b]=(0,u.useState)(null),y=`pgw-card${e.panel?" pgw-card--panel":""}`,h=n.status==="ready"?n.data:void 0,P=!e.sessionId&&h!==void 0,F=(0,u.createElement)("div",{className:"pgw-head"},(0,u.createElement)("div",{className:"pgw-head__main"},e.panel?null:(0,u.createElement)("h3",{className:"pgw-title"},t("card.title")),e.sessionId&&h&&typeof h.sessionMasking=="boolean"?(0,u.createElement)(xt,{ctx:e.ctx,t,session:e.sessionId,on:h.sessionMasking,onDone:S=>{b(S===null?null:{text:S,ok:!1}),r()}}):null,h&&(!e.sessionId||!h.active)?(0,u.createElement)(T.Tag,{tone:h.active?"success":"warning"},t(h.active?"card.on":"card.off")):null,e.sessionId&&h&&h.sessionMasking===void 0?(0,u.createElement)(T.Tag,{tone:"outline"},t("panel.session")):null,h&&!e.sessionId?(0,u.createElement)("span",{className:"pgw-meta",title:t("card.valuesHint")},t("card.values",{n:h.values})):null,h&&!h.record?(0,u.createElement)("span",{className:"pgw-meta"},t("card.memoryOnly")):null),(0,u.createElement)("div",{className:"pgw-head__actions"},h?(0,u.createElement)(T.SegmentedControl,{id:`pgw-range-${e.sessionId??"all"}`,label:t("card.range"),value:s,options:sn.map(S=>({value:S,label:t(`range.${S}`)})),onChange:i}):null,(0,u.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:a,title:t("card.refresh"),"aria-label":t("card.refresh"),onClick:r},(0,u.createElement)(T.IconRefreshOutlineRegular,{size:14})),P?(0,u.createElement)(vt,{ctx:e.ctx,t,onDone:(S,K)=>{b({text:S,ok:K}),l(null),m(0),r()}}):null)),D=_?(0,u.createElement)("div",{className:`pgw-flash${_.ok?"":" pgw-flash--error"}`,role:"status"},_.text):null,V=n.status==="ready"&&n.stale?(0,u.createElement)("div",{className:"pgw-notice pgw-notice--error",role:"status"},(0,u.createElement)(T.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,u.createElement)("span",null,t("card.stale",{reason:J(n.stale,t)}))):null,W=e.sessionId&&h?.sessionMasking===!1?(0,u.createElement)("div",{className:"pgw-notice",role:"status"},(0,u.createElement)(T.IconWarningOutlineRegular,{size:14,className:"pgw-notice__icon"}),(0,u.createElement)("span",null,t("session.offNotice"))):null;if(!h){let S=n.status==="error"?`${t("card.unavailable")} ${t("card.reason",{reason:J(n.failure,t)})}`:t("card.loading");return(0,u.createElement)("section",{className:y},F,(0,u.createElement)("div",{className:"pgw-empty pgw-empty--block"},S))}if(e.sessionId&&h.recent.length===0)return(0,u.createElement)("section",{className:y},F,V,D,W,(0,u.createElement)("div",{className:"pgw-empty pgw-empty--block"},t("panel.empty")));let g=h,M=g.stats[s],L=new Set(g.vendorView?g.views??[]:[]),E=nt(g.recent,f,on),Q=S=>{m(S),l(null)};return(0,u.createElement)("section",{className:y},F,V,D,W,(0,u.createElement)(wt,{t,items:qe(g,M)}),(0,u.createElement)(yt,{totals:M,t}),(0,u.createElement)("div",{className:"pgw-dists"},(0,u.createElement)(ce,{t,title:t("dist.kind"),data:M.kinds,others:t("dist.others.kind"),empty:t("dist.empty"),field:"kind"}),(0,u.createElement)(ce,{t,title:t("dist.finder"),data:M.finders,others:t("dist.others.finder"),empty:t("dist.empty"),field:"finder"}),(0,u.createElement)(ce,{t,title:t("dist.host"),data:M.hosts,others:t("dist.others.host"),empty:t("dist.empty")})),(0,u.createElement)("div",{className:"pgw-section"},(0,u.createElement)("div",{className:"pgw-section__head"},(0,u.createElement)("span",{className:"pgw-section__title"},t("recent.title")),g.recent.length>0?(0,u.createElement)("span",{className:"pgw-meta"},t("recent.count",{n:g.recent.length})):null),g.recent.length===0?(0,u.createElement)("div",{className:"pgw-empty pgw-empty--block"},t("recent.empty")):(0,u.createElement)("div",{className:"pgw-recs"},(0,u.createElement)(kt,{t}),(0,u.createElement)("ul",{className:"pgw-recs__list","aria-label":t("recent.title")},E.items.map(S=>(0,u.createElement)(bt,{key:S.key,ctx:e.ctx,r:S,open:d===S.key,toggle:()=>l(d===S.key?null:S.key),t,viewable:L.has(S.key)})))),E.pages>1?(0,u.createElement)("div",{className:"pgw-pager"},(0,u.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:E.page===0,onClick:()=>Q(0)},t("page.first")),(0,u.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:E.page===0,"aria-label":t("page.prev"),title:t("page.prev"),onClick:()=>Q(E.page-1)},(0,u.createElement)(T.IconChevronLeftOutlineRegular,{size:14})),(0,u.createElement)("span",{className:"pgw-meta pgw-pager__at"},t("page.at",{page:E.page+1,pages:E.pages})),(0,u.createElement)(T.Button,{variant:"ghost",size:"sm",disabled:E.page>=E.pages-1,"aria-label":t("page.next"),title:t("page.next"),onClick:()=>Q(E.page+1)},(0,u.createElement)(T.IconChevronRightOutlineRegular,{size:14}))):null))}var cn="dsh-privacy-gateway",U=le(void 0);function Nt(e,t){return e.code==="noDisposer"?t("err.noDisposer"):t("err.thrown",{message:e.message})}function Ct(e,t){U.set(void 0);let n;try{let r=e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:cn,order:35,locale:j,label:()=>t("panel.tab")},a=>(0,_t.createElement)(ue,{ctx:e,t,panel:!0,...a?.sessionId?{sessionId:a.sessionId}:{}})));if(typeof r!="function"){U.set({code:"noDisposer"});return}n=r}catch(r){U.set({code:"thrown",message:r instanceof Error?r.message:String(r)});return}return()=>{let r=n;n=void 0;try{r?.()}catch{}}}var fe=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 un(){let[,e]=(0,p.useState)(0),t=(0,p.useSyncExternalStore)(G.subscribe,G.get),n=(0,p.useMemo)(()=>{try{return t?.describe()}catch{return}},[t]);(0,p.useEffect)(()=>{if(n)return Promise.resolve(n.ensure()).catch(()=>{}),n.subscribe(()=>e(d=>d+1))},[n]);let r=n?.getSnapshot().view,a=(0,p.useMemo)(()=>r?Ne(r.namespaces):void 0,[r]),s=(0,p.useMemo)(()=>{try{return t&&a!==void 0?t.get(a):void 0}catch{return}},[t,a]);(0,p.useEffect)(()=>s?s.subscribe(()=>e(d=>d+1)):void 0,[s]);let i=s?.getSnapshot();return(0,p.useMemo)(()=>{if(!s||!i)return;let d=s.mutate,l=d?(f,m)=>d.call(s,f,m):async f=>{for(let m of f)if(!await s.set(m.path.join("."),m.value))return!1;return!0};return{state:{status:i.status,value:i.value,revision:i.revision,writable:i.writable!==!1},mutate:l}},[s,i])}var Rt="dsh-privacy-gateway.config.open",fn=["mask"];function pn(){try{let e=JSON.parse(globalThis.localStorage?.getItem(Rt)??"null");if(Array.isArray(e))return ne.filter(t=>e.includes(t))}catch{}return[...fn]}function gn(e){try{globalThis.localStorage?.setItem(Rt,JSON.stringify(e))}catch{}}var B=e=>e;function Re(e){let{ctx:t,t:n}=e,r=un(),a=e.form??r,s=(0,p.useRef)(a);s.current=a;let[i,d]=(0,p.useState)({busy:!1,failed:!1}),[l]=(0,p.useState)(()=>new fe((c,v,N)=>{let C=s.current;return C?C.mutate([{op:"set",path:[c],value:v}],N?void 0:C.state.revision):Promise.resolve(!1)},d)),[f,m]=(0,p.useState)(null),[_,b]=(0,p.useState)(!1),y=(0,p.useSyncExternalStore)(U.subscribe,U.get),h=(0,p.useId)(),[P,F]=(0,p.useState)(null),[D,V]=(0,p.useState)(!1),[W,g]=(0,p.useState)(pn),M=c=>g(v=>{let N=v.includes(c)?v.filter(C=>C!==c):ne.filter(C=>C===c||v.includes(C));return gn(N),N}),L=a?.state,E=L?.status==="ready",Q=L?.writable!==!1,S=L?.value??{},K=c=>l.latest(c,S[c]);if((0,p.useEffect)(()=>{let c=new AbortController;return lt(t,c.signal).then(v=>{c.signal.aborted||(V(!v.ok),F(v.ok?v.value:[]))}),()=>c.abort()},[t]),!a)return(0,p.createElement)("div",{className:"pgw-empty"},n("cfg.unavailable"));let q=!E||!Q,Ot=c=>P?.find(v=>v.id.toLowerCase()===c.toLowerCase())?.name??c,X=(c,v)=>{if(q)return Promise.resolve(!1);let N=Oe(c,K(c.key),v);return N?new Promise(C=>{b(!1),m($=>($?.resolve(!1),{f:c,next:v,change:N,resolve:C}))}):l.write(c.key,v)},Ie=c=>{let v=f;m(null),b(!1),v&&(c?l.write(v.f.key,v.next).then(v.resolve):v.resolve(!1))},Et=c=>{let v=n(B(`cfg.f.${c.key}`));switch(c.kind){case"switch":return(0,p.createElement)($e,{label:v,checked:Z(K(c.key),c.default),disabled:q,onChange:N=>{X(c,N)}});case"choice":{let N=we(K(c.key),c.choices,c.default);return(0,p.createElement)(ye,{label:n(B(`cfg.f.${c.key}.${N}`)),labelledBy:`${h}${c.key}`,items:c.choices.map(C=>({id:C,label:n(B(`cfg.f.${c.key}.${C}`))})),selectedId:N,disabled:q,onSelect:C=>{C!==N&&X(c,C)}})}case"list":return(0,p.createElement)(ze,{t:n,list:z(K(c.key),c.default),anyCase:c.anyCase,placeholder:n(B(`cfg.f.${c.key}.placeholder`)),disabled:q,onChange:N=>X(c,N)});case"count":return(0,p.createElement)(Be,{t:n,value:ee(K(c.key),c.min,c.default),min:c.min,label:v,disabled:q,onChange:N=>X(c,N)});case"providers":return Pt(c)}},Pt=c=>{let v=z(K(c.key),[]),N=ut(P??[],v),C=N.filter(I=>I.excluded).map(I=>I.name),$=De(C,n("cfg.sep")),he=$.kind==="none"?n("cfg.excludedNone"):$.kind==="some"?$.names:n("cfg.excludedMany",{names:$.names,n:$.n});return(0,p.createElement)(ye,{label:he,labelledBy:`${h}${c.key}`,multi:!0,items:N.map(I=>({id:I.id,label:I.registered?I.name:n("cfg.providerAbsent",{name:I.name})})),selectedIds:N.filter(I=>I.excluded).map(I=>I.id),disabled:q,onSelect:I=>{X(c,ft(z(K(c.key),[]),I))}})},Ae=c=>{if(c.key==="showPanel"&&y)return(0,p.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.sidebarFailed",{reason:Nt(y,n)}));if(c.key==="excludeProviders"&&D)return(0,p.createElement)("div",{className:"pgw-cfg__desc pgw-cfg__desc--error"},n("cfg.providerListUnavailable"))},Ft=Object.fromEntries(re.map(c=>[c.key,K(c.key)])),Mt=c=>{let v=re.filter(A=>A.group===c),N=n(B(`cfg.g.${c}`)),C=W.includes(c),$=Pe(c,Ft),he=v.some(A=>Ae(A)!==void 0),I=E?[...$.map((A,Kt)=>(0,p.createElement)("span",{key:Kt,className:A.off?"pgw-fold__part pgw-fold__part--off":"pgw-fold__part"},n(B(A.key),A.params))),he?(0,p.createElement)("span",{key:"problem",className:"pgw-fold__part pgw-fold__part--error"},n("cfg.s.problem")):null]:null;return(0,p.createElement)(Le,{key:c,title:N,summary:I,open:C,toggleLabel:n(C?"cfg.collapse":"cfg.expand",{name:N}),onToggle:()=>M(c)},v.map(A=>(0,p.createElement)(Ve,{key:A.key,title:n(B(`cfg.f.${A.key}`)),titleId:`${h}${A.key}`,hint:n(B(`cfg.f.${A.key}.hint`)),note:Ae(A),inline:Ee(A),half:A.half===!0},Et(A))))},me=f?mn(f,n,f.f.key==="excludeProviders"?Ot:c=>c):null;return(0,p.createElement)(p.Fragment,null,(0,p.createElement)("section",{className:"pgw-cfg","aria-busy":i.busy||void 0},e.form?null:(0,p.createElement)("h3",{className:"pgw-title"},n("cfg.title")),i.failed?(0,p.createElement)("div",{className:"pgw-notice pgw-notice--error",role:"alert"},n("cfg.failed")):null,(0,p.createElement)("div",{className:"pgw-cfg__folds"},ne.map(Mt)),(0,p.createElement)("p",{className:"pgw-cfg__desc pgw-cfg__foot"},n("cfg.applies")," ",n("cfg.others"))),(0,p.createElement)(St.RiskConfirmation,{open:f!==null,title:me?.title??"",description:me?.body??"",acknowledgeLabel:me?.ack??"",cancelLabel:n("card.cancel"),closeLabel:n("card.close"),confirmLabel:n("cfg.risk.confirm"),acknowledged:_,onAcknowledgedChange:b,onCancel:()=>Ie(!1),onConfirm:()=>Ie(!0)}))}function mn(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":"cfg.risk.delete.title"),body:t(B(`cfg.r.${e.f.key}`),a),ack:t(r.risk==="send"?"cfg.risk.send.ack":"cfg.risk.delete.ack")}}var pe="dsh-privacy-gateway",Tt="dsh-privacy-gateway";var Te="var(--ds-font-family-code,ui-monospace,monospace)",hn=`
|
|
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,7 +12,7 @@ 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:${
|
|
15
|
+
.pgw-mono{font-family:${Te}}
|
|
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)}
|
|
@@ -35,10 +35,12 @@ var module = { exports: {} }; var exports = module.exports;
|
|
|
35
35
|
.pgw-dist{display:flex;flex-direction:column;gap:10px;padding:12px 14px;border:.5px solid var(--dsw-alias-border-l2);border-radius:10px;min-width:0}
|
|
36
36
|
.pgw-section{display:flex;flex-direction:column;gap:8px}
|
|
37
37
|
.pgw-section__head{display:flex;align-items:baseline;gap:8px}
|
|
38
|
-
.pgw-section__title,.pgw-dist__title{font-size:12px;font-weight:600;line-height:18px;color:var(--dsw-alias-label-secondary)}
|
|
38
|
+
.pgw-section__title,.pgw-dist__title{display:flex;align-items:center;gap:4px;font-size:12px;font-weight:600;line-height:18px;color:var(--dsw-alias-label-secondary)}
|
|
39
39
|
.pgw-bar{display:flex;flex-direction:column;gap:4px;font-size:12px}
|
|
40
40
|
.pgw-bar__head{display:flex;justify-content:space-between;gap:8px}
|
|
41
|
-
.pgw-
|
|
41
|
+
.pgw-bar__head>*{min-width:0}
|
|
42
|
+
.pgw-bar__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:${Te};color:var(--dsw-alias-label-primary)}
|
|
43
|
+
.pgw-bar__label--hint{cursor:help}
|
|
42
44
|
.pgw-bar__value{flex:none;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary)}
|
|
43
45
|
.pgw-bar__track{height:4px;border-radius:2px;background:var(--dsw-alias-bg-layer-2);overflow:hidden}
|
|
44
46
|
.pgw-bar__fill{height:100%;border-radius:2px;background:var(--dsw-alias-state-business-primary)}
|
|
@@ -65,6 +67,16 @@ var module = { exports: {} }; var exports = module.exports;
|
|
|
65
67
|
.pgw-values{border-collapse:collapse;width:100%}
|
|
66
68
|
.pgw-values th{text-align:left;font-weight:500;color:var(--dsw-alias-label-tertiary);padding:4px 12px 4px 0;border-bottom:.5px solid var(--dsw-alias-border-l2);white-space:nowrap}
|
|
67
69
|
.pgw-values td{padding:4px 12px 4px 0;white-space:nowrap;font-variant-numeric:tabular-nums}
|
|
70
|
+
.pgw-values__empty td{padding:12px 0;color:var(--dsw-alias-label-tertiary)}
|
|
71
|
+
.pgw-filter{display:inline-flex;align-items:center;gap:2px;padding:0;border:none;background:none;font:inherit;font-size:12px;line-height:18px;color:inherit;cursor:pointer}
|
|
72
|
+
@media (hover:hover){.pgw-filter:hover{color:var(--dsw-alias-label-primary)}}
|
|
73
|
+
.pgw-filter--on{color:var(--dsw-alias-label-primary);font-weight:600}
|
|
74
|
+
.pgw-filter__chevron{opacity:.7}
|
|
75
|
+
.pgw-dist__anchor{display:inline-flex;align-items:center;gap:4px;cursor:help}
|
|
76
|
+
.pgw-dist__info{color:var(--dsw-alias-label-tertiary)}
|
|
77
|
+
.pgw-hint{display:flex;flex-direction:column;gap:6px;font-size:12px;line-height:18px;text-align:left;color:#fff}
|
|
78
|
+
.pgw-hint__title{font-weight:600}
|
|
79
|
+
.pgw-hint__body,.pgw-hint__note{color:#cfd3d6}
|
|
68
80
|
.pgw-values__ctx td{padding:0 12px 8px 0;white-space:normal}
|
|
69
81
|
.pgw-values__ctx td>*{vertical-align:middle}
|
|
70
82
|
.pgw-ctx{display:flex;flex-direction:column;gap:2px}
|
|
@@ -128,9 +140,9 @@ var module = { exports: {} }; var exports = module.exports;
|
|
|
128
140
|
.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}
|
|
129
141
|
.pgw-view__table th:first-child,.pgw-view__n{width:44px}
|
|
130
142
|
.pgw-view__n{color:var(--dsw-alias-label-tertiary);text-align:right;font-variant-numeric:tabular-nums;padding:2px 8px;vertical-align:top}
|
|
131
|
-
.pgw-detail .pgw-view__code{font-family:${
|
|
143
|
+
.pgw-detail .pgw-view__code{font-family:${Te};white-space:pre-wrap;word-break:break-all;padding:2px 8px;vertical-align:top;border-left:1px solid var(--dsw-alias-border-l2)}
|
|
132
144
|
.pgw-view__mark{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 18%,transparent);color:inherit;border-radius:3px;padding:0 2px}
|
|
133
145
|
.pgw-view__mark--agent{background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 18%,transparent)}
|
|
134
|
-
`,
|
|
146
|
+
`,It="dsh-privacy-gateway-styles";function At(){if(typeof document>"u"||document.getElementById(It))return;let e=document.createElement("style");e.id=It,e.textContent=hn,document.head.appendChild(e)}var wn="dsh-privacy-gateway",yn=["slots","locale","connection"];function kn(e){At(),e.effect(()=>e.locale.register(j,pt)??void 0,"dsh-privacy-gateway: dictionaries");let t=e.locale.bind(j);dt(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},d=>d.subject?.kind==="bundle"&&d.subject.pkg?.name===pe?(0,ge.createElement)(ue,{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:pe,locale:j},d=>d.view==="summary"?t("cfg.title"):(0,ge.createElement)(Re,{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:`${pe}#${Tt}`,locale:j},d=>d.view==="summary"?t("cfg.title"):(0,ge.createElement)(Re,{ctx:e,t,form:d.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=Ct(e,t):n||a()};e.effect(()=>{let i=ct(e,d=>{n=d,s()});return()=>{i(),n=!1,a()}},"dsh-privacy-gateway: view tab")}module.exports={name:wn,inject:yn,apply:kn};
|
|
135
147
|
return module.exports;
|
|
136
148
|
} });
|
package/lib/index.d.ts
CHANGED
|
@@ -171,8 +171,10 @@ interface LayerInfo {
|
|
|
171
171
|
* untouched. An upgrade a model call opens (the Codex WebSocket) is refused
|
|
172
172
|
* (docs/adr/0025); one a plugin opens outside a call — dsh-im-infoflow's
|
|
173
173
|
* inbound, say — is let through unmasked, with one warn per host
|
|
174
|
-
* (docs/adr/0032).
|
|
175
|
-
*
|
|
174
|
+
* (docs/adr/0032). A request an excluded provider sends is let through
|
|
175
|
+
* unmasked, with one warn per provider (docs/adr/0034). Masking that throws
|
|
176
|
+
* fails the request instead of sending it (docs/adr/0005). The layers under it
|
|
177
|
+
* are ordered by role (docs/adr/0012).
|
|
176
178
|
*/
|
|
177
179
|
declare class MaskingDispatcher extends Dispatcher {
|
|
178
180
|
#private;
|
package/lib/index.js
CHANGED
|
@@ -5099,8 +5099,10 @@ const RANK = {
|
|
|
5099
5099
|
* untouched. An upgrade a model call opens (the Codex WebSocket) is refused
|
|
5100
5100
|
* (docs/adr/0025); one a plugin opens outside a call — dsh-im-infoflow's
|
|
5101
5101
|
* inbound, say — is let through unmasked, with one warn per host
|
|
5102
|
-
* (docs/adr/0032).
|
|
5103
|
-
*
|
|
5102
|
+
* (docs/adr/0032). A request an excluded provider sends is let through
|
|
5103
|
+
* unmasked, with one warn per provider (docs/adr/0034). Masking that throws
|
|
5104
|
+
* fails the request instead of sending it (docs/adr/0005). The layers under it
|
|
5105
|
+
* are ordered by role (docs/adr/0012).
|
|
5104
5106
|
*/
|
|
5105
5107
|
var MaskingDispatcher = class extends Dispatcher {
|
|
5106
5108
|
#engine;
|
|
@@ -5112,6 +5114,8 @@ var MaskingDispatcher = class extends Dispatcher {
|
|
|
5112
5114
|
#order;
|
|
5113
5115
|
/** Hosts a tunnel was let through to: each warned about once, however often it reconnects. */
|
|
5114
5116
|
#warnedTunnels = /* @__PURE__ */ new Set();
|
|
5117
|
+
/** Providers whose unmasked requests were reported: once each, however many requests (docs/adr/0034). */
|
|
5118
|
+
#warnedProviders = /* @__PURE__ */ new Set();
|
|
5115
5119
|
/** Set once the gateway is disposed: every request that still reaches it (through a layer that holds it) passes through. */
|
|
5116
5120
|
bypass = false;
|
|
5117
5121
|
[kGateway] = true;
|
|
@@ -5226,10 +5230,17 @@ var MaskingDispatcher = class extends Dispatcher {
|
|
|
5226
5230
|
}
|
|
5227
5231
|
}
|
|
5228
5232
|
const next = this.downstream();
|
|
5229
|
-
if (this.bypass || !this.#
|
|
5233
|
+
if (this.bypass || !this.#maskable(opts)) return next.dispatch({
|
|
5230
5234
|
...opts,
|
|
5231
5235
|
[kHop]: next
|
|
5232
5236
|
}, handler);
|
|
5237
|
+
if (this.#passes(opts)) {
|
|
5238
|
+
this.#noteUnmasked();
|
|
5239
|
+
return next.dispatch({
|
|
5240
|
+
...opts,
|
|
5241
|
+
[kHop]: next
|
|
5242
|
+
}, handler);
|
|
5243
|
+
}
|
|
5233
5244
|
this.#intercept(opts, wrapHandler(handler));
|
|
5234
5245
|
return true;
|
|
5235
5246
|
}
|
|
@@ -5255,11 +5266,21 @@ var MaskingDispatcher = class extends Dispatcher {
|
|
|
5255
5266
|
const t = targetHost(opts);
|
|
5256
5267
|
return t !== void 0 && (this.#excludeHosts.includes(t.host) || this.#excludeHosts.includes(t.hostname));
|
|
5257
5268
|
}
|
|
5258
|
-
|
|
5269
|
+
/** Says once per provider that requests of it go out unmasked, for a provider excludeProviders lets by (docs/adr/0034). */
|
|
5270
|
+
#noteUnmasked() {
|
|
5271
|
+
const provider = bypassedProvider();
|
|
5272
|
+
const id = provider?.toLowerCase();
|
|
5273
|
+
if (id === void 0 || this.#warnedProviders.has(id)) return;
|
|
5274
|
+
if (this.#warnedProviders.size >= 32) this.#warnedProviders.clear();
|
|
5275
|
+
this.#warnedProviders.add(id);
|
|
5276
|
+
this.#logger?.warn(`dsh-privacy-gateway: requests of provider ${JSON.stringify(provider)} go out unmasked (excludeProviders); this is said once for that provider`);
|
|
5277
|
+
}
|
|
5278
|
+
/** Whether `opts` would be read and masked but for a bypass: a POST of a JSON body, not a tunnel. */
|
|
5279
|
+
#maskable(opts) {
|
|
5259
5280
|
if (String(opts.method).toUpperCase() !== "POST" || isTunnel(opts) || !isReadableBody(opts.body)) return false;
|
|
5260
5281
|
const type = headerValue(opts.headers, "content-type");
|
|
5261
5282
|
if (type !== void 0 && !type.toLowerCase().includes("json")) return false;
|
|
5262
|
-
return
|
|
5283
|
+
return true;
|
|
5263
5284
|
}
|
|
5264
5285
|
/**
|
|
5265
5286
|
* Reads, masks and sends one candidate request. Whatever fails before the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-privacy-gateway",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Process-wide HTTP redaction gateway for DSH: masks secrets in outgoing model requests and restores placeholders in the replies, for every provider.",
|
|
6
6
|
"icon": "./assets/icon.svg",
|