dsh-perm-gate 5.5.10 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.ja.md +4 -0
- package/CHANGELOG.ko.md +4 -0
- package/CHANGELOG.md +13 -1
- package/CHANGELOG.pt.md +4 -0
- package/assets/perm-behavior-log.png +0 -0
- package/assets/perm-gate-secret.png +0 -0
- package/assets/perm-gate-settings.png +0 -0
- package/docs/cc-safety-net-parity-audit.md +64 -0
- package/dsh.plugin.json +1 -1
- package/lib/client.js +2377 -1379
- package/lib/client.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -6,7 +6,7 @@ window.__ModuleLoader__.load({
|
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
-
|
|
9
|
+
// src/client/locales.ts
|
|
10
10
|
/** `dsh-perm-gate` client dictionaries (zh / en / ja / ko / fr / de / it / ru / es / pt). */
|
|
11
11
|
/** Dictionary namespace owned by this plugin. */
|
|
12
12
|
const NS = "dsh-perm-gate";
|
|
@@ -29,13 +29,25 @@ window.__ModuleLoader__.load({
|
|
|
29
29
|
"card.description": "独立审批档位:与只读 / 完全权限 / 白名单平行,在会话权限下拉中显示为「自动审查」。前端只暴露一个开关;后台四个审批策略可组合、由此处设置决定,仍对 P0 硬拒绝保持 fail-closed。",
|
|
30
30
|
"card.permissive": "启用自动审查档位",
|
|
31
31
|
"card.permissiveHint": "关闭时门禁行为与此前完全一致。",
|
|
32
|
-
"card.unattended": "
|
|
32
|
+
"card.unattended": "无人值守档位",
|
|
33
33
|
"card.unattendedHint": "三颗开关,每颗只管它旁边标着的那一档:关掉即实现不存在,那一档退回普通人工流,不会偷偷变成别的档。",
|
|
34
34
|
"card.mode.ask": "保留人工",
|
|
35
35
|
"card.mode.pass": "机械直通",
|
|
36
36
|
"card.askHint": "(危险/不确定才人工确认)仍接回沙箱组:作用域内的安全操作照由 trustAutoAllow 自动静默放行、不弹确认;确定性机械审查器只对运行前的危险(破坏性 Git 与文件系统命令、SSH 密钥/.env 等机密访问)与未知残局列出疑点、交人工确认,一次审查模型都不叫——不触发确认的安全操作照常执行。适用于无审查 LLM 可用、或不值当花 token 的运行。",
|
|
37
37
|
"card.passHint": "(检查通过直接放行、不问人)只跑确定性机械审查器:运行前命中不可逆 / 不可沉淀 / 读不懂的载荷(含破坏性 Git 与文件系统命令、SSH 密钥/.env 等机密访问)就拦截并把理由回喂主模型,检查后无问题的其余照常直接执行。零模型调用——相当于 approval: never 的有审查版,也是 yolo 拿掉 LLM 后的劣化形态。",
|
|
38
|
-
"card.
|
|
38
|
+
"card.testing": "测试与诊断",
|
|
39
|
+
"card.lists": "放行与拦截清单",
|
|
40
|
+
"card.credentials": "凭据保护",
|
|
41
|
+
"card.networkOps": "网络与热重载",
|
|
42
|
+
"card.summaryOn": "开",
|
|
43
|
+
"card.summaryOff": "关",
|
|
44
|
+
"card.summaryNone": "无",
|
|
45
|
+
"card.summaryStrategies": "%n 项启用",
|
|
46
|
+
"card.summaryLists": "放行 %a 项 · 拦截 %d 项",
|
|
47
|
+
"card.summaryCredRw": "readwrite:%n 族",
|
|
48
|
+
"card.summaryNetwork": "网络 %net · 热重载 %w",
|
|
49
|
+
"card.denylistPresetCollapse": "内置词(%n)",
|
|
50
|
+
"card.denylistCustom": "自定义词",
|
|
39
51
|
"card.yolo": "YOLO — 永不人工确认:危险才拦,其余放行",
|
|
40
52
|
"card.yoloExempt": "YOLO:工作区内「落点未知」也放行",
|
|
41
53
|
"card.yoloExemptHint": "只在 YOLO 档生效。打开后,仅「位置判不清」的调用(无参数工具、工作区外脚本未读到正文)不再按「看不见」拦截;编码载荷、读不到正文的脚本、删除与远端写仍然拦,P0/凭据/不可逆一律不变。",
|
|
@@ -228,7 +240,37 @@ window.__ModuleLoader__.load({
|
|
|
228
240
|
"doubt.exec-external": "会执行工作区之外的代码,本次调用无法静态看清它做什么",
|
|
229
241
|
"doubt.outside-paths": "涉及工作区之外的路径",
|
|
230
242
|
"doubt.model-flagged": "风险模型认为可疑(它只能升级,不能放行)",
|
|
231
|
-
"doubt.write": "会写入或修改文件"
|
|
243
|
+
"doubt.write": "会写入或修改文件",
|
|
244
|
+
"verdict.rule": "规则命中",
|
|
245
|
+
"verdict.grant": "会话授权",
|
|
246
|
+
"verdict.hard-deny": "硬拒绝",
|
|
247
|
+
"verdict.deny-keyword": "黑名单关键词",
|
|
248
|
+
"verdict.default": "默认策略",
|
|
249
|
+
"verdict.ask": "默认策略",
|
|
250
|
+
"verdict.permissive": "自动审查放行",
|
|
251
|
+
"verdict.classifier": "LLM 裁决",
|
|
252
|
+
"verdict.llm-safe": "LLM 判定安全",
|
|
253
|
+
"verdict.llm-learned": "LLM 学习放行",
|
|
254
|
+
"verdict.learned-sediment": "沉淀规则放行",
|
|
255
|
+
"verdict.learned-confirm": "学习确认",
|
|
256
|
+
"verdict.human-approved": "人工通过",
|
|
257
|
+
"verdict.human-rejected": "人工拒绝",
|
|
258
|
+
"verdict.human-cancelled": "人工取消",
|
|
259
|
+
"verdict.no-approval-channel": "无审批通道",
|
|
260
|
+
"verdict.preset-passthrough": "审批策略 never · 已放行",
|
|
261
|
+
"verdict.stand-down": "门禁停用",
|
|
262
|
+
"verdict.yolo-allow": "YOLO 放行",
|
|
263
|
+
"verdict.yolo-allow-no-reviewer": "YOLO 放行(无审查模型·机械处置)",
|
|
264
|
+
"verdict.yolo-block": "YOLO 拦截",
|
|
265
|
+
"verdict.rules-fallback-allow": "无模型规则闸门放行",
|
|
266
|
+
"verdict.rules-fallback-block": "无模型规则闸门拦截",
|
|
267
|
+
"verdict.safety-net-passthrough-allow": "机械审查放行(零模型)",
|
|
268
|
+
"verdict.safety-net-passthrough-block": "机械审查拦截(零模型)",
|
|
269
|
+
"verdict.cleanup-safe": "清理类安全放行",
|
|
270
|
+
"verdict.escalation-auto": "沙箱升级自动放行",
|
|
271
|
+
"verdict.learned-granted": "学习授权放行",
|
|
272
|
+
"verdict.network-ask": "网络审批",
|
|
273
|
+
"card.scopeUnresolved": "(scope 未解析 — 诊断占位)"
|
|
232
274
|
},
|
|
233
275
|
en: {
|
|
234
276
|
"card.title": "自动审查 (Auto review)",
|
|
@@ -236,13 +278,25 @@ window.__ModuleLoader__.load({
|
|
|
236
278
|
"card.description": "Independent approval tier, parallel to read-only / full-access / whitelist, shown as 自动审查 in the session permission picker. The front-end exposes a single switch; the four backend approval strategies are combinable via this panel and still fail-closed against P0 hard-deny.",
|
|
237
279
|
"card.permissive": "Enable the 自动审查 tier",
|
|
238
280
|
"card.permissiveHint": "When off, the gate behaves exactly as before.",
|
|
239
|
-
"card.unattended": "Unattended tiers
|
|
281
|
+
"card.unattended": "Unattended tiers",
|
|
240
282
|
"card.unattendedHint": "Three switches, each governing only the tier named beside it: switching an implementation off returns that tier to the ordinary human flow — it never quietly becomes a different tier.",
|
|
241
283
|
"card.mode.ask": "Keep human",
|
|
242
284
|
"card.mode.pass": "Mechanical pass-through",
|
|
243
285
|
"card.askHint": "(Manual confirmation only for danger / uncertainty) Still on the sandbox group: safe operations inside the scope are auto-allowed silently by trustAutoAllow with no popup; the deterministic mechanical screen lists its doubts and asks a person only for pre-execution danger (destructive Git and filesystem commands, access to SSH keys / .env credentials) and unreadable or unknown residuals, calling no grader at all — anything that does not trigger a confirmation runs as normal. The shape for runs with no reviewer LLM connected, or where the tokens are not worth spending.",
|
|
244
286
|
"card.passHint": "(Auto-allow once the check passes, no human prompt) Runs the deterministic mechanical judge only: before execution an irreversible, unlearnable or unreadable call (including destructive Git and filesystem commands and access to SSH keys / .env credentials) is blocked and the reason fed back to the main model, everything that passes runs directly. No model call — the reviewed form of approval: never, and YOLO with the model taken away.",
|
|
245
|
-
"card.
|
|
287
|
+
"card.testing": "Testing & diagnostics",
|
|
288
|
+
"card.lists": "Allow & block lists",
|
|
289
|
+
"card.credentials": "Credential protection",
|
|
290
|
+
"card.networkOps": "Network & hot reload",
|
|
291
|
+
"card.summaryOn": "on",
|
|
292
|
+
"card.summaryOff": "off",
|
|
293
|
+
"card.summaryNone": "none",
|
|
294
|
+
"card.summaryStrategies": "%n enabled",
|
|
295
|
+
"card.summaryLists": "%a allow · %d block",
|
|
296
|
+
"card.summaryCredRw": "readwrite: %n families",
|
|
297
|
+
"card.summaryNetwork": "network %net · hot reload %w",
|
|
298
|
+
"card.denylistPresetCollapse": "Built-in keywords (%n)",
|
|
299
|
+
"card.denylistCustom": "Custom keywords",
|
|
246
300
|
"card.yolo": "YOLO — never ask a human: block the dangerous, run the rest",
|
|
247
301
|
"card.yoloExempt": "YOLO: also allow \"unknown location\" inside the workspace",
|
|
248
302
|
"card.yoloExemptHint": "YOLO only. When on, a call whose target simply cannot be pinned down (no-argument tools, a script outside the workspace whose body was not read) is no longer blocked as \"unseen\". Encoded payloads, unreadable script bodies, deletes and remote writes are still blocked; P0, credentials and irreversible acts never change.",
|
|
@@ -435,7 +489,37 @@ window.__ModuleLoader__.load({
|
|
|
435
489
|
"doubt.exec-external": "it runs code from outside the workspace, which this call cannot inspect",
|
|
436
490
|
"doubt.outside-paths": "it touches paths outside the workspace",
|
|
437
491
|
"doubt.model-flagged": "the risk model flagged it (it can only escalate, never clear)",
|
|
438
|
-
"doubt.write": "it writes or modifies files"
|
|
492
|
+
"doubt.write": "it writes or modifies files",
|
|
493
|
+
"verdict.rule": "Rule matched",
|
|
494
|
+
"verdict.grant": "Session grant",
|
|
495
|
+
"verdict.hard-deny": "Hard deny",
|
|
496
|
+
"verdict.deny-keyword": "Denylist keyword",
|
|
497
|
+
"verdict.default": "Default policy",
|
|
498
|
+
"verdict.ask": "Default policy",
|
|
499
|
+
"verdict.permissive": "Auto-reviewed allow",
|
|
500
|
+
"verdict.classifier": "LLM verdict",
|
|
501
|
+
"verdict.llm-safe": "LLM judged safe",
|
|
502
|
+
"verdict.llm-learned": "LLM learned allow",
|
|
503
|
+
"verdict.learned-sediment": "Settled-rule allow",
|
|
504
|
+
"verdict.learned-confirm": "Learning confirm",
|
|
505
|
+
"verdict.human-approved": "Approved by human",
|
|
506
|
+
"verdict.human-rejected": "Rejected by human",
|
|
507
|
+
"verdict.human-cancelled": "Cancelled by human",
|
|
508
|
+
"verdict.no-approval-channel": "No approval channel",
|
|
509
|
+
"verdict.preset-passthrough": "Policy never · allowed",
|
|
510
|
+
"verdict.stand-down": "Gate inactive",
|
|
511
|
+
"verdict.yolo-allow": "YOLO allow",
|
|
512
|
+
"verdict.yolo-allow-no-reviewer": "YOLO allow (no reviewer · mechanical)",
|
|
513
|
+
"verdict.yolo-block": "YOLO block",
|
|
514
|
+
"verdict.rules-fallback-allow": "Model-free rule gate allow",
|
|
515
|
+
"verdict.rules-fallback-block": "Model-free rule gate block",
|
|
516
|
+
"verdict.safety-net-passthrough-allow": "Mechanical review allow (zero-model)",
|
|
517
|
+
"verdict.safety-net-passthrough-block": "Mechanical review block (zero-model)",
|
|
518
|
+
"verdict.cleanup-safe": "Cleanup safe allow",
|
|
519
|
+
"verdict.escalation-auto": "Sandbox escalation auto-allow",
|
|
520
|
+
"verdict.learned-granted": "Learned grant allow",
|
|
521
|
+
"verdict.network-ask": "Network approval",
|
|
522
|
+
"card.scopeUnresolved": " (scope unresolved — diagnostic placeholder)"
|
|
439
523
|
},
|
|
440
524
|
ja: {
|
|
441
525
|
"card.title": "自动审查(自動審査)ティア",
|
|
@@ -443,13 +527,25 @@ window.__ModuleLoader__.load({
|
|
|
443
527
|
"card.description": "read-only / full-access / whitelist と並ぶ独立の承認モード。セッション権限ピッカーでは「自动审查」と表示されます。フロントは単一スイッチのみ。バックエンドの 4 つの承認戦略はこのパネルで組み合わせ可能で、P0 ハード拒否に対して依然 fail-closed。",
|
|
444
528
|
"card.permissive": "自动审查ティアを有効化",
|
|
445
529
|
"card.permissiveHint": "オフのときは以前と完全に同じ動作です。",
|
|
446
|
-
"card.unattended": "
|
|
530
|
+
"card.unattended": "無人確認ティア",
|
|
447
531
|
"card.unattendedHint": "スイッチは三つ。それぞれ脇に書いたティアだけを制御します。実装をオフにするとそのティアは通常の人確認に戻り、別のティアに化けることはありません。",
|
|
448
532
|
"card.mode.ask": "人手確認を残す",
|
|
449
533
|
"card.mode.pass": "機械直通",
|
|
450
534
|
"card.askHint": "機械スクリーニングは引き続き危険を絞り疑点を列挙しますが、確認は人に残り審査モデルは一度も呼びません — 審査 LLM 未接続、またはトークンを費やさない運用の形です。",
|
|
451
535
|
"card.passHint": "決定論的な機械審査器のみを実行:不可逆 / 復元不能 / 読めない処理を検知したら遮断して理由を主モデルへ返し、それ以外は実行します。モデル呼び出しゼロ・人手確認なし。approval: never の審査付き版であり、LLM を外した YOLO の劣化形態でもあります。",
|
|
452
|
-
"card.
|
|
536
|
+
"card.testing": "テストと診断",
|
|
537
|
+
"card.lists": "許可・ブロックリスト",
|
|
538
|
+
"card.credentials": "資格情報の保護",
|
|
539
|
+
"card.networkOps": "ネットワークとホットリロード",
|
|
540
|
+
"card.summaryOn": "オン",
|
|
541
|
+
"card.summaryOff": "オフ",
|
|
542
|
+
"card.summaryNone": "なし",
|
|
543
|
+
"card.summaryStrategies": "%n 件有効",
|
|
544
|
+
"card.summaryLists": "許可 %a · ブロック %d",
|
|
545
|
+
"card.summaryCredRw": "readwrite: %n ファミリー",
|
|
546
|
+
"card.summaryNetwork": "ネットワーク %net · ホットリロード %w",
|
|
547
|
+
"card.denylistPresetCollapse": "内蔵語(%n)",
|
|
548
|
+
"card.denylistCustom": "カスタム語",
|
|
453
549
|
"card.yolo": "YOLO — 人工確認は決して求めない:危険のみ遮断、他は実行",
|
|
454
550
|
"card.yoloExempt": "YOLO:ワークスペース内の「場所不明」も許可",
|
|
455
551
|
"card.yoloExemptHint": "YOLO 専用。オンのとき、対象の「場所」が特定できないだけの呼び出し(引数なしのツール、本文を読めていない外部スクリプト)は「見えない」としては遮断しません。エンコードされたペイロード、読めないスクリプト本文、削除・リモート書込みは従来通り遮断し、P0/資格情報/不可逆は一切変わりません。",
|
|
@@ -642,7 +738,37 @@ window.__ModuleLoader__.load({
|
|
|
642
738
|
"doubt.exec-external": "ワークスペース外のコードを実行します。この呼び出しでは内容を抜き取れません",
|
|
643
739
|
"doubt.outside-paths": "ワークスペース外のパ스에接触します",
|
|
644
740
|
"doubt.model-flagged": "风险モデルが疑わしいと判定(エスカレートののみ可能、クリアは不可)",
|
|
645
|
-
"doubt.write": "ファイルを書き込みまたは変更します"
|
|
741
|
+
"doubt.write": "ファイルを書き込みまたは変更します",
|
|
742
|
+
"verdict.rule": "ルール適用",
|
|
743
|
+
"verdict.grant": "セッション承認",
|
|
744
|
+
"verdict.hard-deny": "強制拒否",
|
|
745
|
+
"verdict.deny-keyword": "拒否リストのキーワード",
|
|
746
|
+
"verdict.default": "既定ポリシー",
|
|
747
|
+
"verdict.ask": "既定ポリシー",
|
|
748
|
+
"verdict.permissive": "自動審査で許可",
|
|
749
|
+
"verdict.classifier": "LLM 判定",
|
|
750
|
+
"verdict.llm-safe": "LLM が安全と判定",
|
|
751
|
+
"verdict.llm-learned": "LLM 学習で許可",
|
|
752
|
+
"verdict.learned-sediment": "定塁ルールで許可",
|
|
753
|
+
"verdict.learned-confirm": "学習の確認",
|
|
754
|
+
"verdict.human-approved": "人が承認",
|
|
755
|
+
"verdict.human-rejected": "人が拒否",
|
|
756
|
+
"verdict.human-cancelled": "人が取消",
|
|
757
|
+
"verdict.no-approval-channel": "承認経路なし",
|
|
758
|
+
"verdict.preset-passthrough": "承認ポリシー never · 許可済み",
|
|
759
|
+
"verdict.stand-down": "ゲート停止中",
|
|
760
|
+
"verdict.yolo-allow": "YOLO 許可",
|
|
761
|
+
"verdict.yolo-allow-no-reviewer": "YOLO 許可(レビュー模型なし·機械処理)",
|
|
762
|
+
"verdict.yolo-block": "YOLO 遮断",
|
|
763
|
+
"verdict.rules-fallback-allow": "モデルなしルールゲートで許可",
|
|
764
|
+
"verdict.rules-fallback-block": "モデルなしルールゲートで遮断",
|
|
765
|
+
"verdict.safety-net-passthrough-allow": "機械審査で許可(モデルなし)",
|
|
766
|
+
"verdict.safety-net-passthrough-block": "機械審査で遮断(モデルなし)",
|
|
767
|
+
"verdict.cleanup-safe": "クリーンアップ系で安全許可",
|
|
768
|
+
"verdict.escalation-auto": "サンドボックス昇格を自動許可",
|
|
769
|
+
"verdict.learned-granted": "学習承認で許可",
|
|
770
|
+
"verdict.network-ask": "ネットワーク承認",
|
|
771
|
+
"card.scopeUnresolved": "(scope 未解決 — 診断用プレースホルダー)"
|
|
646
772
|
},
|
|
647
773
|
ko: {
|
|
648
774
|
"card.title": "自动审查(자동 검토) 티어",
|
|
@@ -650,13 +776,25 @@ window.__ModuleLoader__.load({
|
|
|
650
776
|
"card.description": "read-only / full-access / whitelist와 나란한 독립 승인 모드. 세션 권한 선택기에서는 「自动审查」로 표시됩니다. 프론트는 단일 스위치만 노출. 백엔드의 네 가지 승인 전략은 이 패널에서 조합 가능하며 P0 하드 거부에 대해 여전히 fail-closed.",
|
|
651
777
|
"card.permissive": "自动审查 티어 활성화",
|
|
652
778
|
"card.permissiveHint": "꺼져 있으면 이전과 완전히 동일하게 동작합니다.",
|
|
653
|
-
"card.unattended": "무인 등급
|
|
779
|
+
"card.unattended": "무인 등급",
|
|
654
780
|
"card.unattendedHint": "스위치는 셋, 각자 옆에 적힌 등급만 제어합니다. 구현을 끄면 그 등급은 보통의 사람 확인으로 돌아가며, 다른 등급으로 몰래 바뀌지 않습니다.",
|
|
655
781
|
"card.mode.ask": "사람 확인 유지",
|
|
656
782
|
"card.mode.pass": "기계 직통과",
|
|
657
783
|
"card.askHint": "기계 선별로 위험을 걸러 내고 의문점을 적지만, 확인은 그대로 사람에게 남고 심사 모델은 한 번도 부르지 않습니다 — 심사 LLM 미연결이나 토큰을 아끼는 운용에 맞는 형태입니다.",
|
|
658
784
|
"card.passHint": "결정론적 기계 심사기만 실행:되돌릴 수 없음 / 복원 불가 / 읽히지 않는 처리를 감지하면 차단하고 이유를 주모델에 되돌려 보내며, 나머지는 실행합니다. 모델 호출 0회·사람 확인 없음. approval: never 의 심사판이며, LLM 을 뺀 YOLO 의 열화된 형태이기도 합니다.",
|
|
659
|
-
"card.
|
|
785
|
+
"card.testing": "테스트 및 진단",
|
|
786
|
+
"card.lists": "허용·차단 목록",
|
|
787
|
+
"card.credentials": "자격 증명 보호",
|
|
788
|
+
"card.networkOps": "네트워크 및 핫 리로드",
|
|
789
|
+
"card.summaryOn": "켜짐",
|
|
790
|
+
"card.summaryOff": "꺼짐",
|
|
791
|
+
"card.summaryNone": "없음",
|
|
792
|
+
"card.summaryStrategies": "%n개 활성",
|
|
793
|
+
"card.summaryLists": "허용 %a · 차단 %d",
|
|
794
|
+
"card.summaryCredRw": "readwrite: %n개 패밀리",
|
|
795
|
+
"card.summaryNetwork": "네트워크 %net · 핫 리로드 %w",
|
|
796
|
+
"card.denylistPresetCollapse": "내장 키워드(%n)",
|
|
797
|
+
"card.denylistCustom": "사용자 지정 키워드",
|
|
660
798
|
"card.yolo": "YOLO — 사람 확인은 절대 요구하지 않음: 위험만 차단하고 나머지는 실행",
|
|
661
799
|
"card.yoloExempt": "YOLO: 워크스페이스 내 “위치 불명”도 허용",
|
|
662
800
|
"card.yoloExemptHint": "YOLO 전용. 켜면 대상의 “위치”만 확인할 수 없는 호출(인자 없는 도구, 본문을 읽지 못한 외부 스크립트)은 “보이지 않음”으로 차단하지 않습니다. 인코딩된 페이로드, 읽을 수 없는 스크립트 본문, 삭제·원격 쓰기는 계속 차단되며 P0/자격 증명/비가역 작업은 전혀 바뀌지 않습니다.",
|
|
@@ -849,7 +987,37 @@ window.__ModuleLoader__.load({
|
|
|
849
987
|
"doubt.exec-external": "작업 공간 밖의 코드를 실행합니다. 이 호출에서는 내용을 확인할 수 없습니다",
|
|
850
988
|
"doubt.outside-paths": "작업 공간 밖 경로에 접촉합니다",
|
|
851
989
|
"doubt.model-flagged": "위험 모델이 의심됨 (증액만 가능, 해소 불가)",
|
|
852
|
-
"doubt.write": "파일을 쓰거나 수정합니다"
|
|
990
|
+
"doubt.write": "파일을 쓰거나 수정합니다",
|
|
991
|
+
"verdict.rule": "규칙 적중",
|
|
992
|
+
"verdict.grant": "세션 승인",
|
|
993
|
+
"verdict.hard-deny": "강제 거부",
|
|
994
|
+
"verdict.deny-keyword": "거부 목록 키워드",
|
|
995
|
+
"verdict.default": "기본 정책",
|
|
996
|
+
"verdict.ask": "기본 정책",
|
|
997
|
+
"verdict.permissive": "자동 심사 허용",
|
|
998
|
+
"verdict.classifier": "LLM 판정",
|
|
999
|
+
"verdict.llm-safe": "LLM 안전 판정",
|
|
1000
|
+
"verdict.llm-learned": "LLM 학습 허용",
|
|
1001
|
+
"verdict.learned-sediment": "정착 규칙 허용",
|
|
1002
|
+
"verdict.learned-confirm": "학습 확인",
|
|
1003
|
+
"verdict.human-approved": "사람 승인",
|
|
1004
|
+
"verdict.human-rejected": "사람 거부",
|
|
1005
|
+
"verdict.human-cancelled": "사람 취소",
|
|
1006
|
+
"verdict.no-approval-channel": "승인 경로 없음",
|
|
1007
|
+
"verdict.preset-passthrough": "승인 정책 never · 허용됨",
|
|
1008
|
+
"verdict.stand-down": "게이트 비활성",
|
|
1009
|
+
"verdict.yolo-allow": "YOLO 허용",
|
|
1010
|
+
"verdict.yolo-allow-no-reviewer": "YOLO 허용(검토 모델 없음·기계 처리)",
|
|
1011
|
+
"verdict.yolo-block": "YOLO 차단",
|
|
1012
|
+
"verdict.rules-fallback-allow": "모델 없는 규칙 게이트 허용",
|
|
1013
|
+
"verdict.rules-fallback-block": "모델 없는 규칙 게이트 차단",
|
|
1014
|
+
"verdict.safety-net-passthrough-allow": "기계 심사 허용(모델 없음)",
|
|
1015
|
+
"verdict.safety-net-passthrough-block": "기계 심사 차단(모델 없음)",
|
|
1016
|
+
"verdict.cleanup-safe": "정리 작업 안전 허용",
|
|
1017
|
+
"verdict.escalation-auto": "샌드박스 승격 자동 허용",
|
|
1018
|
+
"verdict.learned-granted": "학습 승인 허용",
|
|
1019
|
+
"verdict.network-ask": "네트워크 승인",
|
|
1020
|
+
"card.scopeUnresolved": "(scope 미해석 — 진단용 자리표시자)"
|
|
853
1021
|
},
|
|
854
1022
|
fr: {
|
|
855
1023
|
"card.title": "Examen automatique",
|
|
@@ -857,13 +1025,25 @@ window.__ModuleLoader__.load({
|
|
|
857
1025
|
"card.description": "Niveau d'approbation indépendant : parallèle à lecture seule / accès complet / liste blanche, affiché comme « Examen automatique » dans le sélecteur de permissions de session. Le front-end n'expose qu'un seul interrupteur ; les quatre stratégies d'approbation backend sont combinables via ce panneau et restent fail-closed contre le refus dur P0.",
|
|
858
1026
|
"card.permissive": "Activer le niveau d'examen automatique",
|
|
859
1027
|
"card.permissiveHint": "Lorsqu'il est désactivé, la porte se comporte exactement comme avant.",
|
|
860
|
-
"card.unattended": "Modes sans supervision
|
|
1028
|
+
"card.unattended": "Modes sans supervision",
|
|
861
1029
|
"card.unattendedHint": "Trois interrupteurs, chacun ne régit que le palier nommé à côté : éteindre une implémentation rend ce palier au flux humain ordinaire — il ne devient jamais un autre palier en secret.",
|
|
862
1030
|
"card.mode.ask": "Garder l'humain",
|
|
863
1031
|
"card.mode.pass": "Passage mécanique",
|
|
864
1032
|
"card.askHint": "Le tamis mécanique filtre toujours et expose ses doutes, mais la demande reste soumise à une personne et aucun évaluateur n'est appelé — la forme qui convient quand aucun LLM relecteur n'est branché, ou quand les jetons ne valent pas la dépense.",
|
|
865
1033
|
"card.passHint": "N'exécute que le juge mécanique déterministe : une opération irréversible, irrécupérable ou illisible est bloquée et justifiée en retour au modèle principal, le reste s'exécute. Aucun appel de modèle, aucune demande humaine — la version examinée de approval: never, et le YOLO privé de son modèle.",
|
|
866
|
-
"card.
|
|
1034
|
+
"card.testing": "Tests et diagnostic",
|
|
1035
|
+
"card.lists": "Listes d'autorisation et de blocage",
|
|
1036
|
+
"card.credentials": "Protection des identifiants",
|
|
1037
|
+
"card.networkOps": "Réseau et rechargement à chaud",
|
|
1038
|
+
"card.summaryOn": "activé",
|
|
1039
|
+
"card.summaryOff": "désactivé",
|
|
1040
|
+
"card.summaryNone": "aucun",
|
|
1041
|
+
"card.summaryStrategies": "%n activées",
|
|
1042
|
+
"card.summaryLists": "%a en autorisation · %d en blocage",
|
|
1043
|
+
"card.summaryCredRw": "readwrite : %n familles",
|
|
1044
|
+
"card.summaryNetwork": "réseau %net · rechargement %w",
|
|
1045
|
+
"card.denylistPresetCollapse": "Mots-clés intégrés (%n)",
|
|
1046
|
+
"card.denylistCustom": "Mots-clés personnalisés",
|
|
867
1047
|
"card.yolo": "YOLO — ne jamais demander un humain : bloquer le dangereux, exécuter le reste",
|
|
868
1048
|
"card.yoloExempt": "YOLO : autoriser aussi « lieu inconnu » dans l’espace de travail",
|
|
869
1049
|
"card.yoloExemptHint": "Mode YOLO uniquement. Activé, un appel dont seule la « localisation » est indéterminable (outil sans argument, script hors de l’espace de travail dont le corps n’a pas été lu) n’est plus bloqué comme « invisible ». Les charges encodées, les corps illisibles, les suppressions et les écritures distantes restent bloqués ; P0, identifiants et irréversible ne changent jamais.",
|
|
@@ -1056,7 +1236,37 @@ window.__ModuleLoader__.load({
|
|
|
1056
1236
|
"doubt.exec-external": "exécute du code hors workspace, non inspectable par cet appel",
|
|
1057
1237
|
"doubt.outside-paths": "accède à des chemins hors workspace",
|
|
1058
1238
|
"doubt.model-flagged": "le modèle de risque l’a signalé (il peut uniquement escalader, jamais lever)",
|
|
1059
|
-
"doubt.write": "écrit ou modifie des fichiers"
|
|
1239
|
+
"doubt.write": "écrit ou modifie des fichiers",
|
|
1240
|
+
"verdict.rule": "Règle appliquée",
|
|
1241
|
+
"verdict.grant": "Autorisation de session",
|
|
1242
|
+
"verdict.hard-deny": "Refus strict",
|
|
1243
|
+
"verdict.deny-keyword": "Mot-clé de liste noire",
|
|
1244
|
+
"verdict.default": "Politique par défaut",
|
|
1245
|
+
"verdict.ask": "Politique par défaut",
|
|
1246
|
+
"verdict.permissive": "Autorisation après vérification auto",
|
|
1247
|
+
"verdict.classifier": "Verdict du LLM",
|
|
1248
|
+
"verdict.llm-safe": "LLM : jugé sûr",
|
|
1249
|
+
"verdict.llm-learned": "LLM : apprentissage autorisé",
|
|
1250
|
+
"verdict.learned-sediment": "Règle consolidée : autorisé",
|
|
1251
|
+
"verdict.learned-confirm": "Confirmation d’apprentissage",
|
|
1252
|
+
"verdict.human-approved": "Approuvé par un humain",
|
|
1253
|
+
"verdict.human-rejected": "Refusé par un humain",
|
|
1254
|
+
"verdict.human-cancelled": "Annulé par un humain",
|
|
1255
|
+
"verdict.no-approval-channel": "Aucun canal d’approbation",
|
|
1256
|
+
"verdict.preset-passthrough": "Politique never · autorisé",
|
|
1257
|
+
"verdict.stand-down": "Porte désactivée",
|
|
1258
|
+
"verdict.yolo-allow": "YOLO : autorisé",
|
|
1259
|
+
"verdict.yolo-allow-no-reviewer": "YOLO : autorisé (sans modèle de revue · traitement mécanique)",
|
|
1260
|
+
"verdict.yolo-block": "YOLO : bloqué",
|
|
1261
|
+
"verdict.rules-fallback-allow": "Porte de règles sans modèle : autorisé",
|
|
1262
|
+
"verdict.rules-fallback-block": "Porte de règles sans modèle : bloqué",
|
|
1263
|
+
"verdict.safety-net-passthrough-allow": "Vérification mécanique : autorisé (sans modèle)",
|
|
1264
|
+
"verdict.safety-net-passthrough-block": "Vérification mécanique : bloqué (sans modèle)",
|
|
1265
|
+
"verdict.cleanup-safe": "Nettoyage : autorisation sûre",
|
|
1266
|
+
"verdict.escalation-auto": "Élévation de bac à sable : auto-autorisée",
|
|
1267
|
+
"verdict.learned-granted": "Autorisation apprise",
|
|
1268
|
+
"verdict.network-ask": "Approbation réseau",
|
|
1269
|
+
"card.scopeUnresolved": " (scope non résolu — emplacement de diagnostic)"
|
|
1060
1270
|
},
|
|
1061
1271
|
de: {
|
|
1062
1272
|
"card.title": "Automatische Überprüfung",
|
|
@@ -1064,13 +1274,25 @@ window.__ModuleLoader__.load({
|
|
|
1064
1274
|
"card.description": "Unabhängige Genehmigungsstufe: parallel zu Nur-Lesen / Vollzugriff / Whitelist, angezeigt als „Automatische Überprüfung\" im Sitzungs-Berechtigungswähler. Das Frontend bietet einen einzigen Schalter; die vier Backend-Genehmigungsstrategien sind über dieses Panel kombinierbar und bleiben fail-closed gegen P0-Hartablehnung.",
|
|
1065
1275
|
"card.permissive": "Stufe „Automatische Überprüfung\" aktivieren",
|
|
1066
1276
|
"card.permissiveHint": "Wenn deaktiviert, verhält sich das Gate genau wie zuvor.",
|
|
1067
|
-
"card.unattended": "Unbeaufsichtigte Stufen
|
|
1277
|
+
"card.unattended": "Unbeaufsichtigte Stufen",
|
|
1068
1278
|
"card.unattendedHint": "Drei Schalter, jeder steuert nur die Stufe daneben: wer die Implementierung abschaltet, lässt diese Stufe zum normalen Menschenablauf zurückkehren — sie wird nie stillschweigend zu einer anderen.",
|
|
1069
1279
|
"card.mode.ask": "Mensch behalten",
|
|
1070
1280
|
"card.mode.pass": "Mechanischer Durchlass",
|
|
1071
1281
|
"card.askHint": "Die mechanische Vorprüfung filtert und nennt ihre Zweifel, aber die Anfrage bleibt bei einem Menschen, und das Bewertungsmodell wird kein einziges Mal aufgerufen — die Form für Läufe ohne verbundenen Reviewer-LLM oder wenn sich die Tokens nicht lohnen.",
|
|
1072
1282
|
"card.passHint": "Lässt nur den deterministischen mechanischen Prüfer laufen: eine irreversible, nicht rücknehmbare oder unlesbare Anfrage wird blockt und dem Hauptmodell begründet zurückgemeldet, alles andere läuft. Kein Modellaufruf, keine Frage an einen Menschen — die geprüfte Form von approval: never und YOLO ohne Modell.",
|
|
1073
|
-
"card.
|
|
1283
|
+
"card.testing": "Tests & Diagnose",
|
|
1284
|
+
"card.lists": "Zulassungs- & Blocklisten",
|
|
1285
|
+
"card.credentials": "Schutz von Zugangsdaten",
|
|
1286
|
+
"card.networkOps": "Netzwerk & Hot-Reload",
|
|
1287
|
+
"card.summaryOn": "ein",
|
|
1288
|
+
"card.summaryOff": "aus",
|
|
1289
|
+
"card.summaryNone": "keine",
|
|
1290
|
+
"card.summaryStrategies": "%n aktiv",
|
|
1291
|
+
"card.summaryLists": "%a erlaubt · %d blockiert",
|
|
1292
|
+
"card.summaryCredRw": "readwrite: %n Familien",
|
|
1293
|
+
"card.summaryNetwork": "Netzwerk %net · Hot-Reload %w",
|
|
1294
|
+
"card.denylistPresetCollapse": "Eingebaute Schlüsselwörter (%n)",
|
|
1295
|
+
"card.denylistCustom": "Benutzerdefinierte Schlüsselwörter",
|
|
1074
1296
|
"card.yolo": "YOLO — niemals einen Menschen fragen: nur Gefährliches blockieren, Rest ausführen",
|
|
1075
1297
|
"card.yoloExempt": "YOLO: auch „Ort unbekannt“ im Arbeitsbereich zulassen",
|
|
1076
1298
|
"card.yoloExemptHint": "Nur YOLO. Aktiviert wird ein Aufruf, bei dem nur der „Ort“ unbestimmbar ist (Werkzeug ohne Argumente, Skript außerhalb des Arbeitsbereichs ohne gelesenen Rumpf), nicht mehr als „unsichtbar“ blockiert. Kodierte Nutzlasten, unlesbare Skriptrümpfe, Löschungen und Remote-Schreibvorgänge bleiben blockiert; P0, Anmeldedaten und Unwiederbringliches ändern sich nie.",
|
|
@@ -1263,7 +1485,37 @@ window.__ModuleLoader__.load({
|
|
|
1263
1485
|
"doubt.exec-external": "führt Code außerhalb des Workspaces aus, nicht überprüfbar durch diesen Aufruf",
|
|
1264
1486
|
"doubt.outside-paths": "berührt Pfade außerhalb des Workspaces",
|
|
1265
1487
|
"doubt.model-flagged": "das Risikomodell hat es markiert (nur Eskalation möglich, keine Freigabe)",
|
|
1266
|
-
"doubt.write": "schreibt oder ändert Dateien"
|
|
1488
|
+
"doubt.write": "schreibt oder ändert Dateien",
|
|
1489
|
+
"verdict.rule": "Regel greift",
|
|
1490
|
+
"verdict.grant": "Sitzungsfreigabe",
|
|
1491
|
+
"verdict.hard-deny": "Harte Ablehnung",
|
|
1492
|
+
"verdict.deny-keyword": "Sperrlisten-Stichwort",
|
|
1493
|
+
"verdict.default": "Standardrichtlinie",
|
|
1494
|
+
"verdict.ask": "Standardrichtlinie",
|
|
1495
|
+
"verdict.permissive": "Automatisch geprüft erlaubt",
|
|
1496
|
+
"verdict.classifier": "LLM-Urteil",
|
|
1497
|
+
"verdict.llm-safe": "LLM: als sicher bewertet",
|
|
1498
|
+
"verdict.llm-learned": "LLM: gelernt erlaubt",
|
|
1499
|
+
"verdict.learned-sediment": "Gesetzte Regel erlaubt",
|
|
1500
|
+
"verdict.learned-confirm": "Lernbestätigung",
|
|
1501
|
+
"verdict.human-approved": "Von Mensch genehmigt",
|
|
1502
|
+
"verdict.human-rejected": "Von Mensch abgelehnt",
|
|
1503
|
+
"verdict.human-cancelled": "Von Mensch abgebrochen",
|
|
1504
|
+
"verdict.no-approval-channel": "Kein Genehmigungskanal",
|
|
1505
|
+
"verdict.preset-passthrough": "Richtlinie never · erlaubt",
|
|
1506
|
+
"verdict.stand-down": "Gate deaktiviert",
|
|
1507
|
+
"verdict.yolo-allow": "YOLO erlaubt",
|
|
1508
|
+
"verdict.yolo-allow-no-reviewer": "YOLO erlaubt (kein Prüfmodell · mechanisch)",
|
|
1509
|
+
"verdict.yolo-block": "YOLO blockiert",
|
|
1510
|
+
"verdict.rules-fallback-allow": "Regelschleuse ohne Modell erlaubt",
|
|
1511
|
+
"verdict.rules-fallback-block": "Regelschleuse ohne Modell blockiert",
|
|
1512
|
+
"verdict.safety-net-passthrough-allow": "Mechanische Prüfung erlaubt (ohne Modell)",
|
|
1513
|
+
"verdict.safety-net-passthrough-block": "Mechanische Prüfung blockiert (ohne Modell)",
|
|
1514
|
+
"verdict.cleanup-safe": "Aufräumen sicher erlaubt",
|
|
1515
|
+
"verdict.escalation-auto": "Sandbox-Eskalation automatisch erlaubt",
|
|
1516
|
+
"verdict.learned-granted": "Gelernte Freigabe erlaubt",
|
|
1517
|
+
"verdict.network-ask": "Netzwerk-Genehmigung",
|
|
1518
|
+
"card.scopeUnresolved": " (scope nicht aufgelöst — Diagnose-Platzhalter)"
|
|
1267
1519
|
},
|
|
1268
1520
|
it: {
|
|
1269
1521
|
"card.title": "Revisione automatica",
|
|
@@ -1271,13 +1523,25 @@ window.__ModuleLoader__.load({
|
|
|
1271
1523
|
"card.description": "Livello di approvazione indipendente: parallelo a sola lettura / accesso completo / whitelist, mostrato come «Revisione automatica» nel selettore delle autorizzazioni della sessione. Il front-end espone un unico interruttore; le quattro strategie di approvazione backend sono combinabili tramite questo pannello e restano fail-closed contro il rifiuto rigido P0.",
|
|
1272
1524
|
"card.permissive": "Abilita il livello di revisione automatica",
|
|
1273
1525
|
"card.permissiveHint": "Quando disattivato, il portale si comporta esattamente come prima.",
|
|
1274
|
-
"card.unattended": "Modalità senza supervisione
|
|
1526
|
+
"card.unattended": "Modalità senza supervisione",
|
|
1275
1527
|
"card.unattendedHint": "Tre interruttori, ciascuno governa solo il livello scritto accanto: spegnere un'implementazione fa tornare quel livello al flusso umano ordinario, senza che diventi di nascosto un altro.",
|
|
1276
1528
|
"card.mode.ask": "Mantieni umano",
|
|
1277
1529
|
"card.mode.pass": "Passaggio meccanico",
|
|
1278
1530
|
"card.askHint": "La selezione meccanica filtra ed elenca i dubbi, ma la richiesta resta a una persona e il modello revisore non viene chiamato nemmeno una volta — la forma adatta quando nessun LLM revisore è collegato o quando i token non valgono la spesa.",
|
|
1279
1531
|
"card.passHint": "Esegue solo il giudice meccanico deterministico: un'operazione irreversibile, irrecuperabile o illeggibile viene bloccata e motivata al modello principale, il resto esegue. Nessuna chiamata al modello, nessuna richiesta umana: la forma esaminata di approval: never, e YOLO privato del modello.",
|
|
1280
|
-
"card.
|
|
1532
|
+
"card.testing": "Test e diagnostica",
|
|
1533
|
+
"card.lists": "Elenchi di autorizzazione e blocco",
|
|
1534
|
+
"card.credentials": "Protezione delle credenziali",
|
|
1535
|
+
"card.networkOps": "Rete e ricarica a caldo",
|
|
1536
|
+
"card.summaryOn": "attivo",
|
|
1537
|
+
"card.summaryOff": "disattivo",
|
|
1538
|
+
"card.summaryNone": "nessuno",
|
|
1539
|
+
"card.summaryStrategies": "%n attive",
|
|
1540
|
+
"card.summaryLists": "%a consentiti · %d bloccati",
|
|
1541
|
+
"card.summaryCredRw": "readwrite: %n famiglie",
|
|
1542
|
+
"card.summaryNetwork": "rete %net · ricarica %w",
|
|
1543
|
+
"card.denylistPresetCollapse": "Parole integrate (%n)",
|
|
1544
|
+
"card.denylistCustom": "Parole personalizzate",
|
|
1281
1545
|
"card.yolo": "YOLO — non chiedere mai un umano: blocca il pericoloso, esegui il resto",
|
|
1282
1546
|
"card.yoloExempt": "YOLO: consenti anche “posizione sconosciuta” nel workspace",
|
|
1283
1547
|
"card.yoloExemptHint": "Solo YOLO. Se attivo, una chiamata di cui è indeterminabile solo la “posizione” (strumento senza argomenti, script fuori dal workspace il cui corpo non è stato letto) non viene più bloccata come “invisibile”. Payload codificati, corpi illeggibili, eliminazioni e scritture remote restano bloccati; P0, credenziali e operazioni irreversibili non cambiano mai.",
|
|
@@ -1470,7 +1734,37 @@ window.__ModuleLoader__.load({
|
|
|
1470
1734
|
"doubt.exec-external": "esegue codice fuori dal workspace, non ispezionabile da questa chiamata",
|
|
1471
1735
|
"doubt.outside-paths": "tocca percorsi fuori dal workspace",
|
|
1472
1736
|
"doubt.model-flagged": "il modello di rischio lo ha segnalato (può solo elevare, non autorizzare)",
|
|
1473
|
-
"doubt.write": "scrive o modifica file"
|
|
1737
|
+
"doubt.write": "scrive o modifica file",
|
|
1738
|
+
"verdict.rule": "Regola applicata",
|
|
1739
|
+
"verdict.grant": "Autorizzazione di sessione",
|
|
1740
|
+
"verdict.hard-deny": "Rifiuto netto",
|
|
1741
|
+
"verdict.deny-keyword": "Parola chiave in lista nera",
|
|
1742
|
+
"verdict.default": "Criterio predefinito",
|
|
1743
|
+
"verdict.ask": "Criterio predefinito",
|
|
1744
|
+
"verdict.permissive": "Consentito dopo verifica automatica",
|
|
1745
|
+
"verdict.classifier": "Verdetto LLM",
|
|
1746
|
+
"verdict.llm-safe": "LLM: giudicato sicuro",
|
|
1747
|
+
"verdict.llm-learned": "LLM: appreso consentito",
|
|
1748
|
+
"verdict.learned-sediment": "Regola consolidata: consentito",
|
|
1749
|
+
"verdict.learned-confirm": "Conferma di apprendimento",
|
|
1750
|
+
"verdict.human-approved": "Approvato da umano",
|
|
1751
|
+
"verdict.human-rejected": "Rifiutato da umano",
|
|
1752
|
+
"verdict.human-cancelled": "Annullato da umano",
|
|
1753
|
+
"verdict.no-approval-channel": "Nessun canale di approvazione",
|
|
1754
|
+
"verdict.preset-passthrough": "Criterio never · consentito",
|
|
1755
|
+
"verdict.stand-down": "Cancello disattivato",
|
|
1756
|
+
"verdict.yolo-allow": "YOLO consentito",
|
|
1757
|
+
"verdict.yolo-allow-no-reviewer": "YOLO consentito (nessun modello di revisione · gestione meccanica)",
|
|
1758
|
+
"verdict.yolo-block": "YOLO bloccato",
|
|
1759
|
+
"verdict.rules-fallback-allow": "Cancello a regole senza modello: consentito",
|
|
1760
|
+
"verdict.rules-fallback-block": "Cancello a regole senza modello: bloccato",
|
|
1761
|
+
"verdict.safety-net-passthrough-allow": "Verifica meccanica consentita (senza modello)",
|
|
1762
|
+
"verdict.safety-net-passthrough-block": "Verifica meccanica bloccata (senza modello)",
|
|
1763
|
+
"verdict.cleanup-safe": "Pulizia: consentito in sicurezza",
|
|
1764
|
+
"verdict.escalation-auto": "Escalation sandbox consentita automaticamente",
|
|
1765
|
+
"verdict.learned-granted": "Autorizzazione appresa",
|
|
1766
|
+
"verdict.network-ask": "Approvazione di rete",
|
|
1767
|
+
"card.scopeUnresolved": " (scope non risolto — segnaposto diagnostico)"
|
|
1474
1768
|
},
|
|
1475
1769
|
ru: {
|
|
1476
1770
|
"card.title": "Автоматическая проверка",
|
|
@@ -1478,13 +1772,25 @@ window.__ModuleLoader__.load({
|
|
|
1478
1772
|
"card.description": "Независимый уровень одобрения: параллельно с «только чтение» / «полный доступ» / «белый список», отображается как «Автоматическая проверка» в выборе разрешений сессии. Фронтенд предоставляет один переключатель; четыре серверные стратегии одобрения комбинируемы через эту панель и остаются fail-closed против жёсткого отказа P0.",
|
|
1479
1773
|
"card.permissive": "Включить уровень автоматической проверки",
|
|
1480
1774
|
"card.permissiveHint": "Когда выключено, шлюз ведёт себя точно так же, как раньше.",
|
|
1481
|
-
"card.unattended": "Режимы без подтверждения человеком
|
|
1775
|
+
"card.unattended": "Режимы без подтверждения человеком",
|
|
1482
1776
|
"card.unattendedHint": "Переключателя три, каждый управляет только тем уровнем, что написан рядом: выключить реализацию — значит вернуть этот уровень обычному человеческому потоку; тайно стать другим он не может.",
|
|
1483
1777
|
"card.mode.ask": "Оставить человека",
|
|
1484
1778
|
"card.mode.pass": "Механический пропуск",
|
|
1485
1779
|
"card.askHint": "Механический отбор фильтрует и перечисляет сомнения, но запрос остаётся человеку, а модель-ревизор не вызывается ни разу — это форма для запусков без подключённого LLM-ревизора или когда токены не стоят затрат.",
|
|
1486
1780
|
"card.passHint": "Работает только детерминированный механический судья: необратимое, невосстановимое или нечитаемое действие блокируется с причиной обратно основной модели, остальное выполняется. Ни вызова модели, ни вопроса человеку — проверенная форма approval: never и YOLO без модели.",
|
|
1487
|
-
"card.
|
|
1781
|
+
"card.testing": "Тесты и диагностика",
|
|
1782
|
+
"card.lists": "Списки разрешений и блокировок",
|
|
1783
|
+
"card.credentials": "Защита учётных данных",
|
|
1784
|
+
"card.networkOps": "Сеть и горячая перезагрузка",
|
|
1785
|
+
"card.summaryOn": "вкл",
|
|
1786
|
+
"card.summaryOff": "выкл",
|
|
1787
|
+
"card.summaryNone": "нет",
|
|
1788
|
+
"card.summaryStrategies": "активно: %n",
|
|
1789
|
+
"card.summaryLists": "разрешено %a · заблокировано %d",
|
|
1790
|
+
"card.summaryCredRw": "readwrite: %n семейств",
|
|
1791
|
+
"card.summaryNetwork": "сеть %net · перезагрузка %w",
|
|
1792
|
+
"card.denylistPresetCollapse": "Встроенные ключевые слова (%n)",
|
|
1793
|
+
"card.denylistCustom": "Пользовательские ключевые слова",
|
|
1488
1794
|
"card.yolo": "YOLO — никогда не спрашивать человека: блокировать опасное, остальное выполнять",
|
|
1489
1795
|
"card.yoloExempt": "YOLO: разрешить и «неизвестное расположение» внутри рабочей области",
|
|
1490
1796
|
"card.yoloExemptHint": "Только для YOLO. Если включено, вызов, у которого неопределимо только «расположение» (инструмент без аргументов, скрипт вне рабочей области, тело которого не прочитано), больше не блокируется как «невидимый». Кодированные полезные нагрузки, нечитаемые тела скриптов, удаления и удалённые записи по-прежнему блокируются; P0, учётные данные и необратимые действия не меняются никогда.",
|
|
@@ -1677,7 +1983,37 @@ window.__ModuleLoader__.load({
|
|
|
1677
1983
|
"doubt.exec-external": "выполняет код за пределами рабочего пространства, не подлежит инспекции",
|
|
1678
1984
|
"doubt.outside-paths": "затрагивает пути вне рабочего пространства",
|
|
1679
1985
|
"doubt.model-flagged": "модель риска пометила (только усиливает, не снижает)",
|
|
1680
|
-
"doubt.write": "записывает или изменяет файлы"
|
|
1986
|
+
"doubt.write": "записывает или изменяет файлы",
|
|
1987
|
+
"verdict.rule": "Правило сработало",
|
|
1988
|
+
"verdict.grant": "Разрешение сеанса",
|
|
1989
|
+
"verdict.hard-deny": "Жёсткий отказ",
|
|
1990
|
+
"verdict.deny-keyword": "Ключевое слово из чёрного списка",
|
|
1991
|
+
"verdict.default": "Политика по умолчанию",
|
|
1992
|
+
"verdict.ask": "Политика по умолчанию",
|
|
1993
|
+
"verdict.permissive": "Автопроверка разрешила",
|
|
1994
|
+
"verdict.classifier": "Вердикт LLM",
|
|
1995
|
+
"verdict.llm-safe": "LLM: признано безопасным",
|
|
1996
|
+
"verdict.llm-learned": "LLM: обучено — разрешено",
|
|
1997
|
+
"verdict.learned-sediment": "Закреплённое правило: разрешено",
|
|
1998
|
+
"verdict.learned-confirm": "Подтверждение обучения",
|
|
1999
|
+
"verdict.human-approved": "Одобрено человеком",
|
|
2000
|
+
"verdict.human-rejected": "Отклонено человеком",
|
|
2001
|
+
"verdict.human-cancelled": "Отменено человеком",
|
|
2002
|
+
"verdict.no-approval-channel": "Нет канала одобрения",
|
|
2003
|
+
"verdict.preset-passthrough": "Политика never · разрешено",
|
|
2004
|
+
"verdict.stand-down": "Шлюз выключен",
|
|
2005
|
+
"verdict.yolo-allow": "YOLO: разрешено",
|
|
2006
|
+
"verdict.yolo-allow-no-reviewer": "YOLO: разрешено (без модели-ревьюера · механически)",
|
|
2007
|
+
"verdict.yolo-block": "YOLO: заблокировано",
|
|
2008
|
+
"verdict.rules-fallback-allow": "Шлюз правил без модели: разрешено",
|
|
2009
|
+
"verdict.rules-fallback-block": "Шлюз правил без модели: заблокировано",
|
|
2010
|
+
"verdict.safety-net-passthrough-allow": "Механическая проверка: разрешено (без модели)",
|
|
2011
|
+
"verdict.safety-net-passthrough-block": "Механическая проверка: заблокировано (без модели)",
|
|
2012
|
+
"verdict.cleanup-safe": "Очистка: безопасное разрешение",
|
|
2013
|
+
"verdict.escalation-auto": "Повышение песочницы: авторазрешение",
|
|
2014
|
+
"verdict.learned-granted": "Выученное разрешение",
|
|
2015
|
+
"verdict.network-ask": "Сетевые одобрения",
|
|
2016
|
+
"card.scopeUnresolved": " (scope не разрешён — заглушка диагностики)"
|
|
1681
2017
|
},
|
|
1682
2018
|
es: {
|
|
1683
2019
|
"card.title": "Revisión automática",
|
|
@@ -1685,13 +2021,25 @@ window.__ModuleLoader__.load({
|
|
|
1685
2021
|
"card.description": "Nivel de aprobación independiente: paralelo a solo lectura / acceso completo / lista blanca, mostrado como «Revisión automática» en el selector de permisos de sesión. El frontend expone un único interruptor; las cuatro estrategias de aprobación del backend son combinables mediante este panel y permanecen fail-closed contra la denegación dura P0.",
|
|
1686
2022
|
"card.permissive": "Habilitar el nivel de revisión automática",
|
|
1687
2023
|
"card.permissiveHint": "Cuando está desactivado, la compuerta se comporta exactamente igual que antes.",
|
|
1688
|
-
"card.unattended": "Modos sin supervisión
|
|
2024
|
+
"card.unattended": "Modos sin supervisión",
|
|
1689
2025
|
"card.unattendedHint": "Tres interruptores, cada uno gobierna solo el nivel escrito a su lado: apagar una implementación devuelve ese nivel al flujo humano ordinario, sin convertirse a escondidas en otro.",
|
|
1690
2026
|
"card.mode.ask": "Mantener humano",
|
|
1691
2027
|
"card.mode.pass": "Paso mecánico",
|
|
1692
2028
|
"card.askHint": "El tamiz mecánico filtra y enumera sus dudas, pero la solicitud sigue quedando con una persona y no se llama al modelo revisor ni una vez — la forma para ejecuciones sin LLM revisor conectado, o cuando los tokens no valen la pena.",
|
|
1693
2029
|
"card.passHint": "Ejecuta solo el juez mecánico determinista: una operación irreversible, irrecuperable o ilegible se bloquea y se devuelve justificada al modelo principal; lo demás corre. Ninguna llamada al modelo, ninguna pregunta humana: la forma revisada de approval: never, y un YOLO sin modelo.",
|
|
1694
|
-
"card.
|
|
2030
|
+
"card.testing": "Pruebas y diagnóstico",
|
|
2031
|
+
"card.lists": "Listas de permisos y bloqueos",
|
|
2032
|
+
"card.credentials": "Protección de credenciales",
|
|
2033
|
+
"card.networkOps": "Red y recarga en caliente",
|
|
2034
|
+
"card.summaryOn": "sí",
|
|
2035
|
+
"card.summaryOff": "no",
|
|
2036
|
+
"card.summaryNone": "ninguno",
|
|
2037
|
+
"card.summaryStrategies": "%n activadas",
|
|
2038
|
+
"card.summaryLists": "%a permitidos · %d bloqueados",
|
|
2039
|
+
"card.summaryCredRw": "readwrite: %n familias",
|
|
2040
|
+
"card.summaryNetwork": "red %net · recarga %w",
|
|
2041
|
+
"card.denylistPresetCollapse": "Palabras integradas (%n)",
|
|
2042
|
+
"card.denylistCustom": "Palabras personalizadas",
|
|
1695
2043
|
"card.yolo": "YOLO — nunca pedir un humano: bloquear lo peligroso, ejecutar el resto",
|
|
1696
2044
|
"card.yoloExempt": "YOLO: permitir también “ubicación desconocida” dentro del workspace",
|
|
1697
2045
|
"card.yoloExemptHint": "Solo YOLO. Activado, una llamada en la que solo la “ubicación” es indeterminable (herramienta sin argumentos, script fuera del workspace cuyo cuerpo no se leyó) ya no se bloquea por “invisible”. Las cargas codificadas, los cuerpos ilegibles, los borrados y las escrituras remotas siguen bloqueados; P0, credenciales e irreversible nunca cambian.",
|
|
@@ -1884,7 +2232,37 @@ window.__ModuleLoader__.load({
|
|
|
1884
2232
|
"doubt.exec-external": "ejecuta código fuera del workspace, no inspeccionable por esta llamada",
|
|
1885
2233
|
"doubt.outside-paths": "usa rutas fuera del workspace",
|
|
1886
2234
|
"doubt.model-flagged": "el modelo de riesgo lo marcó (solo puede escalar, nunca aprobar)",
|
|
1887
|
-
"doubt.write": "escribe o modifica archivos"
|
|
2235
|
+
"doubt.write": "escribe o modifica archivos",
|
|
2236
|
+
"verdict.rule": "Regla aplicada",
|
|
2237
|
+
"verdict.grant": "Autorización de sesión",
|
|
2238
|
+
"verdict.hard-deny": "Denegación estricta",
|
|
2239
|
+
"verdict.deny-keyword": "Palabra clave en lista negra",
|
|
2240
|
+
"verdict.default": "Política predeterminada",
|
|
2241
|
+
"verdict.ask": "Política predeterminada",
|
|
2242
|
+
"verdict.permissive": "Permitido tras revisión automática",
|
|
2243
|
+
"verdict.classifier": "Veredicto del LLM",
|
|
2244
|
+
"verdict.llm-safe": "LLM: considerado seguro",
|
|
2245
|
+
"verdict.llm-learned": "LLM: aprendido y permitido",
|
|
2246
|
+
"verdict.learned-sediment": "Regla consolidada: permitido",
|
|
2247
|
+
"verdict.learned-confirm": "Confirmación de aprendizaje",
|
|
2248
|
+
"verdict.human-approved": "Aprobado por una persona",
|
|
2249
|
+
"verdict.human-rejected": "Rechazado por una persona",
|
|
2250
|
+
"verdict.human-cancelled": "Cancelado por una persona",
|
|
2251
|
+
"verdict.no-approval-channel": "Sin canal de aprobación",
|
|
2252
|
+
"verdict.preset-passthrough": "Política never · permitido",
|
|
2253
|
+
"verdict.stand-down": "Puerta desactivada",
|
|
2254
|
+
"verdict.yolo-allow": "YOLO permitido",
|
|
2255
|
+
"verdict.yolo-allow-no-reviewer": "YOLO permitido (sin modelo revisor · gestión mecánica)",
|
|
2256
|
+
"verdict.yolo-block": "YOLO bloqueado",
|
|
2257
|
+
"verdict.rules-fallback-allow": "Puerta de reglas sin modelo: permitido",
|
|
2258
|
+
"verdict.rules-fallback-block": "Puerta de reglas sin modelo: bloqueado",
|
|
2259
|
+
"verdict.safety-net-passthrough-allow": "Revisión mecánica permitida (sin modelo)",
|
|
2260
|
+
"verdict.safety-net-passthrough-block": "Revisión mecánica bloqueada (sin modelo)",
|
|
2261
|
+
"verdict.cleanup-safe": "Limpieza: permiso seguro",
|
|
2262
|
+
"verdict.escalation-auto": "Elevación de sandbox permitida automáticamente",
|
|
2263
|
+
"verdict.learned-granted": "Permiso aprendido",
|
|
2264
|
+
"verdict.network-ask": "Aprobación de red",
|
|
2265
|
+
"card.scopeUnresolved": " (scope sin resolver — marcador de diagnóstico)"
|
|
1888
2266
|
},
|
|
1889
2267
|
pt: {
|
|
1890
2268
|
"card.title": "Revisão automática",
|
|
@@ -1892,13 +2270,25 @@ window.__ModuleLoader__.load({
|
|
|
1892
2270
|
"card.description": "Nível de aprovação independente: paralelo a somente leitura / acesso total / lista de permissões, exibido como «Revisão automática» no seletor de permissões da sessão. A interface expõe um único interruptor; as quatro estratégias de aprovação do backend são combináveis neste painel e continuam fail-closed diante da negação dura P0.",
|
|
1893
2271
|
"card.permissive": "Ativar o nível de revisão automática",
|
|
1894
2272
|
"card.permissiveHint": "Quando desativado, o portal se comporta exatamente como antes.",
|
|
1895
|
-
"card.unattended": "Modos sem supervisão
|
|
2273
|
+
"card.unattended": "Modos sem supervisão",
|
|
1896
2274
|
"card.unattendedHint": "Três interruptores, cada um governa apenas o nível escrito ao seu lado: desligar uma implementação devolve aquele nível ao fluxo humano ordinário, sem transformá-lo às escondidas em outro.",
|
|
1897
2275
|
"card.mode.ask": "Manter humano",
|
|
1898
2276
|
"card.mode.pass": "Passagem mecânica",
|
|
1899
2277
|
"card.askHint": "O crivo mecânico filtra e lista suas dúvidas, mas a solicitação continua com uma pessoa; o modelo revisor nem é chamado — a forma para execuções sem um revisor LLM conectado, ou quando os tokens não valem a pena.",
|
|
1900
2278
|
"card.passHint": "Executa apenas o julgador mecânico determinístico: uma operação irreversível, irrecuperável ou ilegível é bloqueada e devolvida com justificativa ao modelo principal; o resto roda. Nenhuma chamada de modelo, nenhuma pergunta humana: a forma revisada de approval: never, e um YOLO sem modelo.",
|
|
1901
|
-
"card.
|
|
2279
|
+
"card.testing": "Testes e diagnóstico",
|
|
2280
|
+
"card.lists": "Listas de permissão e bloqueio",
|
|
2281
|
+
"card.credentials": "Proteção de credenciais",
|
|
2282
|
+
"card.networkOps": "Rede e recarga a quente",
|
|
2283
|
+
"card.summaryOn": "ligado",
|
|
2284
|
+
"card.summaryOff": "desligado",
|
|
2285
|
+
"card.summaryNone": "nenhum",
|
|
2286
|
+
"card.summaryStrategies": "%n ativadas",
|
|
2287
|
+
"card.summaryLists": "%a permitidos · %d bloqueados",
|
|
2288
|
+
"card.summaryCredRw": "readwrite: %n famílias",
|
|
2289
|
+
"card.summaryNetwork": "rede %net · recarga %w",
|
|
2290
|
+
"card.denylistPresetCollapse": "Palavras integradas (%n)",
|
|
2291
|
+
"card.denylistCustom": "Palavras personalizadas",
|
|
1902
2292
|
"card.yolo": "YOLO — nunca pedir uma pessoa: bloquear o perigoso, executar o resto",
|
|
1903
2293
|
"card.yoloExempt": "YOLO: tolerar também “localização desconhecida” dentro do workspace",
|
|
1904
2294
|
"card.yoloExemptHint": "Só YOLO. Ativado, uma chamada em que apenas a “localização” é indeterminável (ferramenta sem argumentos, script fora do workspace cujo corpo não foi lido) deixa de ser bloqueada por “invisível”. Cargas codificadas, corpos ilegíveis, exclusões e escritas remotas continuam bloqueadas; P0, credenciais e irreversível nunca mudam.",
|
|
@@ -2091,11 +2481,40 @@ window.__ModuleLoader__.load({
|
|
|
2091
2481
|
"doubt.exec-external": "executa código fora do workspace, não inspecionável por esta chamada",
|
|
2092
2482
|
"doubt.outside-paths": "usa caminhos fora do workspace",
|
|
2093
2483
|
"doubt.model-flagged": "o modelo de risco sinalizou (só pode escalar, nunca aprovar)",
|
|
2094
|
-
"doubt.write": "escreve ou modifica arquivos"
|
|
2484
|
+
"doubt.write": "escreve ou modifica arquivos",
|
|
2485
|
+
"verdict.rule": "Regra aplicada",
|
|
2486
|
+
"verdict.grant": "Autorização de sessão",
|
|
2487
|
+
"verdict.hard-deny": "Negação rígida",
|
|
2488
|
+
"verdict.deny-keyword": "Palavra-chave da lista de bloqueio",
|
|
2489
|
+
"verdict.default": "Política padrão",
|
|
2490
|
+
"verdict.ask": "Política padrão",
|
|
2491
|
+
"verdict.permissive": "Permitido após revisão automática",
|
|
2492
|
+
"verdict.classifier": "Veredito do LLM",
|
|
2493
|
+
"verdict.llm-safe": "LLM: considerado seguro",
|
|
2494
|
+
"verdict.llm-learned": "LLM: aprendido e permitido",
|
|
2495
|
+
"verdict.learned-sediment": "Regra consolidada: permitido",
|
|
2496
|
+
"verdict.learned-confirm": "Confirmação de aprendizado",
|
|
2497
|
+
"verdict.human-approved": "Aprovado por humano",
|
|
2498
|
+
"verdict.human-rejected": "Rejeitado por humano",
|
|
2499
|
+
"verdict.human-cancelled": "Cancelado por humano",
|
|
2500
|
+
"verdict.no-approval-channel": "Sem canal de aprovação",
|
|
2501
|
+
"verdict.preset-passthrough": "Política never · permitido",
|
|
2502
|
+
"verdict.stand-down": "Portão desativado",
|
|
2503
|
+
"verdict.yolo-allow": "YOLO permitido",
|
|
2504
|
+
"verdict.yolo-allow-no-reviewer": "YOLO permitido (sem modelo revisor · gestão mecânica)",
|
|
2505
|
+
"verdict.yolo-block": "YOLO bloqueado",
|
|
2506
|
+
"verdict.rules-fallback-allow": "Portão de regras sem modelo: permitido",
|
|
2507
|
+
"verdict.rules-fallback-block": "Portão de regras sem modelo: bloqueado",
|
|
2508
|
+
"verdict.safety-net-passthrough-allow": "Revisão mecânica permitida (sem modelo)",
|
|
2509
|
+
"verdict.safety-net-passthrough-block": "Revisão mecânica bloqueada (sem modelo)",
|
|
2510
|
+
"verdict.cleanup-safe": "Limpeza: permissão segura",
|
|
2511
|
+
"verdict.escalation-auto": "Elevação de sandbox permitida automaticamente",
|
|
2512
|
+
"verdict.learned-granted": "Permissão aprendida",
|
|
2513
|
+
"verdict.network-ask": "Aprovação de rede",
|
|
2514
|
+
"card.scopeUnresolved": " (scope não resolvido — espaço de diagnóstico)"
|
|
2095
2515
|
}
|
|
2096
2516
|
};
|
|
2097
|
-
|
|
2098
|
-
//#region src/client/switch-state.ts
|
|
2517
|
+
// src/client/switch-state.ts
|
|
2099
2518
|
/**
|
|
2100
2519
|
* The optimistic state machine behind the settings card's pill switch and its tier
|
|
2101
2520
|
* picker, kept out of the components so its three rules are testable without a DOM
|
|
@@ -2130,8 +2549,7 @@ window.__ModuleLoader__.load({
|
|
|
2130
2549
|
function pendingAfterFailure(_pending) {
|
|
2131
2550
|
return null;
|
|
2132
2551
|
}
|
|
2133
|
-
|
|
2134
|
-
//#region src/deny-defaults.ts
|
|
2552
|
+
// src/deny-defaults.ts
|
|
2135
2553
|
/**
|
|
2136
2554
|
* Preset deny keywords inherited from dsh-approval-gate's `DEFAULT_DENY_KEYWORDS`
|
|
2137
2555
|
* (the preset blacklist layer of its pipeline). One keyword per entry, matched
|
|
@@ -2174,8 +2592,7 @@ window.__ModuleLoader__.load({
|
|
|
2174
2592
|
"docker rm",
|
|
2175
2593
|
"docker system prune"
|
|
2176
2594
|
];
|
|
2177
|
-
|
|
2178
|
-
//#region src/llm-presets.ts
|
|
2595
|
+
// src/llm-presets.ts
|
|
2179
2596
|
const LLM_PRESETS = [
|
|
2180
2597
|
{
|
|
2181
2598
|
id: "deepseek",
|
|
@@ -2196,8 +2613,7 @@ window.__ModuleLoader__.load({
|
|
|
2196
2613
|
model: "gpt-4o-mini"
|
|
2197
2614
|
}
|
|
2198
2615
|
];
|
|
2199
|
-
|
|
2200
|
-
//#region src/preset.ts
|
|
2616
|
+
// src/preset.ts
|
|
2201
2617
|
/**
|
|
2202
2618
|
* Presets in which the gate is active. The plugin ships five 自动审查 tiers of its own
|
|
2203
2619
|
* (declared in its `cordis.patch.yml`, which is how they reach the composer picker at all):
|
|
@@ -2218,8 +2634,7 @@ window.__ModuleLoader__.load({
|
|
|
2218
2634
|
"permissive-snet",
|
|
2219
2635
|
"permissive-yolo"
|
|
2220
2636
|
];
|
|
2221
|
-
|
|
2222
|
-
//#region src/client/sediment.tsx
|
|
2637
|
+
// src/client/sediment.tsx
|
|
2223
2638
|
/**
|
|
2224
2639
|
* Learning-sediment management section — the settings-card face of verdict
|
|
2225
2640
|
* learning's "沉淀" (the ⑤ card pattern demonstrated by dsh-approval-gate):
|
|
@@ -2384,8 +2799,380 @@ window.__ModuleLoader__.load({
|
|
|
2384
2799
|
})
|
|
2385
2800
|
});
|
|
2386
2801
|
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2802
|
+
// src/client/guide.tsx
|
|
2803
|
+
/**
|
|
2804
|
+
* ⚠️ 生成副本 —— 请勿手改。真源:mine-dsh-plugins/_tools/guide-kit/guide.tsx
|
|
2805
|
+
* 重新同步:node _tools/guide-kit/sync.mjs
|
|
2806
|
+
*/
|
|
2807
|
+
/**
|
|
2808
|
+
* guide-kit —— 九插件共用的「首次使用引导」件(**生成副本,勿手改**)。
|
|
2809
|
+
*
|
|
2810
|
+
* 唯一真源:`mine-dsh-plugins/_tools/guide-kit/guide.tsx`
|
|
2811
|
+
* 同步命令:`node _tools/guide-kit/sync.mjs`(会覆盖本文件;改这里等于白改)
|
|
2812
|
+
*
|
|
2813
|
+
* 六条契约(见 .agents/plans/unified-i18n-onboarding/spec.md §2):
|
|
2814
|
+
* 1. Skip 恒定可见,任何步骤都能退;
|
|
2815
|
+
* 2. 永远有字:引导外壳(标题/按钮/步进)自带 10 语词表,按 <html lang> 取词,
|
|
2816
|
+
* 认不出的一律落 en;步骤正文按「本语 → en → zh → 任意可用」逐级回退,绝不留空白;
|
|
2817
|
+
* 3. 重启入口:`GuideRestartButton`(或自己调 `resetGuide(ns)` + setOpen(true))就地重开;
|
|
2818
|
+
* 4. 零依赖:只 react + localStorage,不 import 平台包,不抢宿主设置表单;
|
|
2819
|
+
* 5. 引导自己绝不能成为卡面渲染的失败点:样式注入与存储访问全部 try/catch + 能力探测;
|
|
2820
|
+
* 6. 外壳词表与步骤正文分离:外壳跨插件统一(本文件),正文每插件一份 `guide-steps.ts`。
|
|
2821
|
+
*/
|
|
2822
|
+
/** 生态通用的十个语言码(与各插件 `locale/*.json`、README 的十语镜像同口径)。 */
|
|
2823
|
+
const GUIDE_LOCALES = [
|
|
2824
|
+
"zh",
|
|
2825
|
+
"en",
|
|
2826
|
+
"ja",
|
|
2827
|
+
"ko",
|
|
2828
|
+
"fr",
|
|
2829
|
+
"de",
|
|
2830
|
+
"it",
|
|
2831
|
+
"ru",
|
|
2832
|
+
"es",
|
|
2833
|
+
"pt"
|
|
2834
|
+
];
|
|
2835
|
+
/**
|
|
2836
|
+
* 引导外壳词表(10 语)。
|
|
2837
|
+
*
|
|
2838
|
+
* 为什么不塞进各插件 locales:这七个词是**跨插件同一套**,塞进九个字典要重复翻译
|
|
2839
|
+
* 9×10 次,且一旦措辞调整就得动九个仓。外壳留在本文件,正文留各插件。
|
|
2840
|
+
*/
|
|
2841
|
+
const GUIDE_COPY = {
|
|
2842
|
+
zh: {
|
|
2843
|
+
title: "快速上手",
|
|
2844
|
+
skip: "跳过引导",
|
|
2845
|
+
next: "下一步",
|
|
2846
|
+
prev: "上一步",
|
|
2847
|
+
done: "开始使用",
|
|
2848
|
+
restart: "重新查看引导",
|
|
2849
|
+
stepOf: (current, total) => `第 ${current} / ${total} 步`
|
|
2850
|
+
},
|
|
2851
|
+
en: {
|
|
2852
|
+
title: "Quick start",
|
|
2853
|
+
skip: "Skip guide",
|
|
2854
|
+
next: "Next",
|
|
2855
|
+
prev: "Back",
|
|
2856
|
+
done: "Get started",
|
|
2857
|
+
restart: "Show guide again",
|
|
2858
|
+
stepOf: (current, total) => `Step ${current} of ${total}`
|
|
2859
|
+
},
|
|
2860
|
+
ja: {
|
|
2861
|
+
title: "クイックスタート",
|
|
2862
|
+
skip: "ガイドをスキップ",
|
|
2863
|
+
next: "次へ",
|
|
2864
|
+
prev: "戻る",
|
|
2865
|
+
done: "はじめる",
|
|
2866
|
+
restart: "ガイドをもう一度表示",
|
|
2867
|
+
stepOf: (current, total) => `ステップ ${current} / ${total}`
|
|
2868
|
+
},
|
|
2869
|
+
ko: {
|
|
2870
|
+
title: "빠른 시작",
|
|
2871
|
+
skip: "가이드 건너뛰기",
|
|
2872
|
+
next: "다음",
|
|
2873
|
+
prev: "이전",
|
|
2874
|
+
done: "시작하기",
|
|
2875
|
+
restart: "가이드 다시 보기",
|
|
2876
|
+
stepOf: (current, total) => `${current} / ${total} 단계`
|
|
2877
|
+
},
|
|
2878
|
+
fr: {
|
|
2879
|
+
title: "Démarrage rapide",
|
|
2880
|
+
skip: "Ignorer le guide",
|
|
2881
|
+
next: "Suivant",
|
|
2882
|
+
prev: "Retour",
|
|
2883
|
+
done: "Commencer",
|
|
2884
|
+
restart: "Revoir le guide",
|
|
2885
|
+
stepOf: (current, total) => `Étape ${current} sur ${total}`
|
|
2886
|
+
},
|
|
2887
|
+
de: {
|
|
2888
|
+
title: "Schnellstart",
|
|
2889
|
+
skip: "Anleitung überspringen",
|
|
2890
|
+
next: "Weiter",
|
|
2891
|
+
prev: "Zurück",
|
|
2892
|
+
done: "Loslegen",
|
|
2893
|
+
restart: "Anleitung erneut anzeigen",
|
|
2894
|
+
stepOf: (current, total) => `Schritt ${current} von ${total}`
|
|
2895
|
+
},
|
|
2896
|
+
it: {
|
|
2897
|
+
title: "Avvio rapido",
|
|
2898
|
+
skip: "Salta la guida",
|
|
2899
|
+
next: "Avanti",
|
|
2900
|
+
prev: "Indietro",
|
|
2901
|
+
done: "Inizia",
|
|
2902
|
+
restart: "Rivedi la guida",
|
|
2903
|
+
stepOf: (current, total) => `Passo ${current} di ${total}`
|
|
2904
|
+
},
|
|
2905
|
+
ru: {
|
|
2906
|
+
title: "Быстрый старт",
|
|
2907
|
+
skip: "Пропустить руководство",
|
|
2908
|
+
next: "Далее",
|
|
2909
|
+
prev: "Назад",
|
|
2910
|
+
done: "Начать",
|
|
2911
|
+
restart: "Показать руководство снова",
|
|
2912
|
+
stepOf: (current, total) => `Шаг ${current} из ${total}`
|
|
2913
|
+
},
|
|
2914
|
+
es: {
|
|
2915
|
+
title: "Inicio rápido",
|
|
2916
|
+
skip: "Omitir la guía",
|
|
2917
|
+
next: "Siguiente",
|
|
2918
|
+
prev: "Atrás",
|
|
2919
|
+
done: "Empezar",
|
|
2920
|
+
restart: "Ver la guía de nuevo",
|
|
2921
|
+
stepOf: (current, total) => `Paso ${current} de ${total}`
|
|
2922
|
+
},
|
|
2923
|
+
pt: {
|
|
2924
|
+
title: "Início rápido",
|
|
2925
|
+
skip: "Ignorar o guia",
|
|
2926
|
+
next: "Próximo",
|
|
2927
|
+
prev: "Voltar",
|
|
2928
|
+
done: "Começar",
|
|
2929
|
+
restart: "Ver o guia novamente",
|
|
2930
|
+
stepOf: (current, total) => `Passo ${current} de ${total}`
|
|
2931
|
+
}
|
|
2932
|
+
};
|
|
2933
|
+
/** 语言标签 → 语言码:只认主标签,认不出的落 null(由调用方回退 en)。 */
|
|
2934
|
+
function normalizeGuideLocale(tag) {
|
|
2935
|
+
const primary = tag.toLowerCase().trim().split(/[-_]/)[0] ?? "";
|
|
2936
|
+
return GUIDE_LOCALES.includes(primary) ? primary : null;
|
|
2937
|
+
}
|
|
2938
|
+
function htmlLang() {
|
|
2939
|
+
try {
|
|
2940
|
+
return typeof document === "undefined" ? "" : document.documentElement?.lang ?? "";
|
|
2941
|
+
} catch {
|
|
2942
|
+
return "";
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
/**
|
|
2946
|
+
* 当前引导语言:以宿主 `<html lang>` 为准(语言切换会改写这个属性)。
|
|
2947
|
+
*
|
|
2948
|
+
* 认不出 → en:引导是「帮助」面,宁可给英文也不能给空白或中文硬串。
|
|
2949
|
+
*/
|
|
2950
|
+
function currentGuideLocale() {
|
|
2951
|
+
return normalizeGuideLocale(htmlLang()) ?? "en";
|
|
2952
|
+
}
|
|
2953
|
+
/** 引导外壳取词。 */
|
|
2954
|
+
function guideLabels(locale = currentGuideLocale()) {
|
|
2955
|
+
return GUIDE_COPY[locale] ?? GUIDE_COPY.en;
|
|
2956
|
+
}
|
|
2957
|
+
/**
|
|
2958
|
+
* 步骤正文取词:本语 → en → zh → 表里第一个可用。
|
|
2959
|
+
*
|
|
2960
|
+
* 为什么需要回退链:九插件分批补语种,某个插件可能只有 zh/en 而宿主是 ru;
|
|
2961
|
+
* 这时给英文是可用的,给空白等于「引导坏了」。`undefined` 步骤表按空表处理。
|
|
2962
|
+
*/
|
|
2963
|
+
function guideSteps(map) {
|
|
2964
|
+
if (map === void 0) return [];
|
|
2965
|
+
const order = [
|
|
2966
|
+
currentGuideLocale(),
|
|
2967
|
+
"en",
|
|
2968
|
+
"zh"
|
|
2969
|
+
];
|
|
2970
|
+
for (const key of order) {
|
|
2971
|
+
const hit = key === void 0 ? void 0 : map[key];
|
|
2972
|
+
if (hit !== void 0 && hit.length > 0) return hit;
|
|
2973
|
+
}
|
|
2974
|
+
for (const key of GUIDE_LOCALES) {
|
|
2975
|
+
const hit = map[key];
|
|
2976
|
+
if (hit !== void 0 && hit.length > 0) return hit;
|
|
2977
|
+
}
|
|
2978
|
+
return [];
|
|
2979
|
+
}
|
|
2980
|
+
function guideStorageKey(ns) {
|
|
2981
|
+
return `dsh.guide.${ns}.skipped`;
|
|
2982
|
+
}
|
|
2983
|
+
/** 是否已跳过(存储不可用时按「未跳过」处理:宁可多教一次,不要静默不教)。 */
|
|
2984
|
+
function isGuideSkipped(ns) {
|
|
2985
|
+
try {
|
|
2986
|
+
return typeof localStorage !== "undefined" && localStorage.getItem(guideStorageKey(ns)) === "1";
|
|
2987
|
+
} catch {
|
|
2988
|
+
return false;
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
/** 记下跳过;写失败不抛(隐私模式 / 存储禁用)。 */
|
|
2992
|
+
function skipGuide(ns) {
|
|
2993
|
+
try {
|
|
2994
|
+
localStorage?.setItem(guideStorageKey(ns), "1");
|
|
2995
|
+
} catch {}
|
|
2996
|
+
}
|
|
2997
|
+
/** 清标记 = 允许重新教学。 */
|
|
2998
|
+
function resetGuide(ns) {
|
|
2999
|
+
try {
|
|
3000
|
+
localStorage?.removeItem(guideStorageKey(ns));
|
|
3001
|
+
} catch {}
|
|
3002
|
+
}
|
|
3003
|
+
const GUIDE_CSS = `
|
|
3004
|
+
.sgGuide{border:1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.28));background:var(--dsw-alias-bg-layer-2, rgba(127,127,127,.06));border-radius:12px;padding:14px 16px;margin:0 0 12px}
|
|
3005
|
+
.sgGuideHead{display:flex;align-items:center;gap:8px;margin:0 0 10px}
|
|
3006
|
+
.sgGuideTitle{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary, currentColor)}
|
|
3007
|
+
.sgGuideStep{font-size:12px;color:var(--dsw-alias-label-tertiary, rgba(127,127,127,.9));margin-left:auto}
|
|
3008
|
+
.sgGuideBody{font-size:13px;line-height:1.6;color:var(--dsw-alias-label-secondary, currentColor);min-height:52px}
|
|
3009
|
+
.sgGuideBody b{color:var(--dsw-alias-label-primary, currentColor);font-weight:600}
|
|
3010
|
+
.sgGuideDots{display:flex;gap:6px;margin:10px 0 0}
|
|
3011
|
+
.sgGuideDot{width:6px;height:6px;border-radius:50%;background:var(--dsw-alias-border-l2, rgba(127,127,127,.3))}
|
|
3012
|
+
.sgGuideDot-on{background:var(--dsw-alias-button-primary-fill, #4d6bfe)}
|
|
3013
|
+
.sgGuideFoot{display:flex;align-items:center;gap:8px;margin:12px 0 0}
|
|
3014
|
+
.sgGuideBtn{appearance:none;font:inherit;font-size:12px;padding:5px 12px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.3));background:transparent;color:var(--dsw-alias-label-primary, currentColor);cursor:pointer}
|
|
3015
|
+
.sgGuideBtn-primary{background:var(--dsw-alias-button-primary-fill, #4d6bfe);border-color:transparent;color:#fff}
|
|
3016
|
+
.sgGuideBtn-skip{margin-right:auto;color:var(--dsw-alias-label-tertiary, rgba(127,127,127,.9));border-color:transparent;text-decoration:underline}
|
|
3017
|
+
.sgGuideRestart{appearance:none;font:inherit;font-size:12px;padding:0;border:0;background:transparent;color:var(--dsw-alias-link-primary, #4d6bfe);cursor:pointer;text-decoration:underline}
|
|
3018
|
+
`;
|
|
3019
|
+
function injectGuideCss() {
|
|
3020
|
+
try {
|
|
3021
|
+
if (typeof document === "undefined") return;
|
|
3022
|
+
if (typeof document.querySelector !== "function") return;
|
|
3023
|
+
if (typeof document.createElement !== "function") return;
|
|
3024
|
+
if (!document.head) return;
|
|
3025
|
+
if (document.querySelector("style[data-plugin-css=\"guide-kit\"]") !== null) return;
|
|
3026
|
+
const tag = document.createElement("style");
|
|
3027
|
+
tag.dataset.pluginCss = "guide-kit";
|
|
3028
|
+
tag.textContent = GUIDE_CSS;
|
|
3029
|
+
document.head.appendChild(tag);
|
|
3030
|
+
} catch {}
|
|
3031
|
+
}
|
|
3032
|
+
/** 语言变更订阅:语言切换后重渲染词表(引导是短生命周期,直接跟随 <html lang>)。 */
|
|
3033
|
+
function useLangTick() {
|
|
3034
|
+
const [, setTick] = (0, react.useState)(0);
|
|
3035
|
+
(0, react.useEffect)(() => {
|
|
3036
|
+
try {
|
|
3037
|
+
if (typeof MutationObserver === "undefined" || typeof document === "undefined") return;
|
|
3038
|
+
if (!document.documentElement) return;
|
|
3039
|
+
const observer = new MutationObserver(() => setTick((n) => n + 1));
|
|
3040
|
+
observer.observe(document.documentElement, {
|
|
3041
|
+
attributes: true,
|
|
3042
|
+
attributeFilter: ["lang"]
|
|
3043
|
+
});
|
|
3044
|
+
return () => observer.disconnect();
|
|
3045
|
+
} catch {
|
|
3046
|
+
return;
|
|
3047
|
+
}
|
|
3048
|
+
}, []);
|
|
3049
|
+
}
|
|
3050
|
+
/**
|
|
3051
|
+
* 引导主体:3 步以内的小教学 + 恒定可见的 Skip。
|
|
3052
|
+
*
|
|
3053
|
+
* `onClose` 由宿主卡面传:Skip/Done 都会调用它(Skip 同时写标记)。
|
|
3054
|
+
*/
|
|
3055
|
+
function GuidePanel(props) {
|
|
3056
|
+
const { ns, steps, onClose } = props;
|
|
3057
|
+
const [index, setIndex] = (0, react.useState)(0);
|
|
3058
|
+
useLangTick();
|
|
3059
|
+
const labels = guideLabels();
|
|
3060
|
+
(0, react.useEffect)(() => {
|
|
3061
|
+
injectGuideCss();
|
|
3062
|
+
}, []);
|
|
3063
|
+
if (steps.length === 0) return null;
|
|
3064
|
+
const current = steps[Math.min(index, steps.length - 1)];
|
|
3065
|
+
const last = index >= steps.length - 1;
|
|
3066
|
+
const finish = () => {
|
|
3067
|
+
skipGuide(ns);
|
|
3068
|
+
onClose();
|
|
3069
|
+
};
|
|
3070
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3071
|
+
className: "sgGuide",
|
|
3072
|
+
"aria-label": labels.title,
|
|
3073
|
+
children: [
|
|
3074
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
3075
|
+
className: "sgGuideHead",
|
|
3076
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3077
|
+
className: "sgGuideTitle",
|
|
3078
|
+
children: labels.title
|
|
3079
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3080
|
+
className: "sgGuideStep",
|
|
3081
|
+
children: labels.stepOf(index + 1, steps.length)
|
|
3082
|
+
})]
|
|
3083
|
+
}),
|
|
3084
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3085
|
+
className: "sgGuideBody",
|
|
3086
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: current.title }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: current.body })]
|
|
3087
|
+
}),
|
|
3088
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3089
|
+
className: "sgGuideDots",
|
|
3090
|
+
"aria-hidden": "true",
|
|
3091
|
+
children: steps.map((step, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "sgGuideDot" + (i === index ? " sgGuideDot-on" : "") }, step.title))
|
|
3092
|
+
}),
|
|
3093
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", {
|
|
3094
|
+
className: "sgGuideFoot",
|
|
3095
|
+
children: [
|
|
3096
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3097
|
+
type: "button",
|
|
3098
|
+
className: "sgGuideBtn sgGuideBtn-skip",
|
|
3099
|
+
onClick: () => finish(),
|
|
3100
|
+
children: labels.skip
|
|
3101
|
+
}),
|
|
3102
|
+
index > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3103
|
+
type: "button",
|
|
3104
|
+
className: "sgGuideBtn",
|
|
3105
|
+
onClick: () => setIndex(index - 1),
|
|
3106
|
+
children: labels.prev
|
|
3107
|
+
}),
|
|
3108
|
+
last ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3109
|
+
type: "button",
|
|
3110
|
+
className: "sgGuideBtn sgGuideBtn-primary",
|
|
3111
|
+
onClick: () => finish(),
|
|
3112
|
+
children: labels.done
|
|
3113
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3114
|
+
type: "button",
|
|
3115
|
+
className: "sgGuideBtn sgGuideBtn-primary",
|
|
3116
|
+
onClick: () => setIndex(index + 1),
|
|
3117
|
+
children: labels.next
|
|
3118
|
+
})
|
|
3119
|
+
]
|
|
3120
|
+
})
|
|
3121
|
+
]
|
|
3122
|
+
});
|
|
3123
|
+
}
|
|
3124
|
+
/**
|
|
3125
|
+
* 重启入口:清标记 + 就地重开引导。
|
|
3126
|
+
*
|
|
3127
|
+
* 统一件,避免九插件各写一份(措辞/样式/清标记时机容易走样)。跳过之后
|
|
3128
|
+
* 用户想再看一次,不需要去清浏览器存储。
|
|
3129
|
+
*/
|
|
3130
|
+
function GuideRestartButton(props) {
|
|
3131
|
+
const { ns, onOpen, style } = props;
|
|
3132
|
+
useLangTick();
|
|
3133
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3134
|
+
type: "button",
|
|
3135
|
+
className: "sgGuideRestart",
|
|
3136
|
+
style,
|
|
3137
|
+
onClick: () => {
|
|
3138
|
+
resetGuide(ns);
|
|
3139
|
+
onOpen();
|
|
3140
|
+
},
|
|
3141
|
+
children: guideLabels().restart
|
|
3142
|
+
});
|
|
3143
|
+
}
|
|
3144
|
+
// src/client/guide-steps.ts
|
|
3145
|
+
const PERM_GATE_GUIDE_STEPS = {
|
|
3146
|
+
zh: [
|
|
3147
|
+
{
|
|
3148
|
+
title: "它管的是「要不要问你」",
|
|
3149
|
+
body: "总开关叫「宽松模式」:关着时按宿主权限档走;打开后由本插件判断哪些工具调用可以直接放行、哪些必须问你。"
|
|
3150
|
+
},
|
|
3151
|
+
{
|
|
3152
|
+
title: "三种后端策略,可叠加",
|
|
3153
|
+
body: "信任自动放行 / 一律确认 / LLM 评审。只想少弹窗就开第一个;处理陌生仓库时打开第二个,宁可多问一句。"
|
|
3154
|
+
},
|
|
3155
|
+
{
|
|
3156
|
+
title: "被拦了什么,去「判定记录」看",
|
|
3157
|
+
body: "输入框旁的提示条和侧栏历史记录会列出每次判定及理由;误判就地加入白名单或补一条拒绝关键词,下次不再问。"
|
|
3158
|
+
}
|
|
3159
|
+
],
|
|
3160
|
+
en: [
|
|
3161
|
+
{
|
|
3162
|
+
title: "It decides whether to ask you",
|
|
3163
|
+
body: "The master switch is \"permissive\": off means the host permission tier rules; on means this plugin decides which tool calls pass straight through and which must ask you."
|
|
3164
|
+
},
|
|
3165
|
+
{
|
|
3166
|
+
title: "Three backend strategies, combinable",
|
|
3167
|
+
body: "Trust-auto-allow / always-confirm / LLM review. Turn on the first if you just want fewer prompts; turn on the second on unfamiliar repos — better one extra question."
|
|
3168
|
+
},
|
|
3169
|
+
{
|
|
3170
|
+
title: "See what got gated",
|
|
3171
|
+
body: "The notice strip beside the composer and the sidebar history list every decision with its reason. Add a whitelist pattern or a deny keyword right there and it stops asking next time."
|
|
3172
|
+
}
|
|
3173
|
+
]
|
|
3174
|
+
};
|
|
3175
|
+
// src/client/card.tsx
|
|
2389
3176
|
/**
|
|
2390
3177
|
* Permissive settings card — the top-level `settings.section` (自动审查门) of dsh-perm-gate.
|
|
2391
3178
|
*
|
|
@@ -2614,7 +3401,10 @@ window.__ModuleLoader__.load({
|
|
|
2614
3401
|
(0, react.useEffect)(() => {
|
|
2615
3402
|
let alive = true;
|
|
2616
3403
|
fetch("/api/dsh-perm-gate/cred", { headers: { "cache-control": "no-cache" } }).then((r) => r.json()).then((b) => {
|
|
2617
|
-
if (alive && b?.rungs !== void 0)
|
|
3404
|
+
if (alive && b?.rungs !== void 0) {
|
|
3405
|
+
setRungs(b.rungs);
|
|
3406
|
+
props.onRungs?.(b.rungs);
|
|
3407
|
+
}
|
|
2618
3408
|
}).catch(() => {});
|
|
2619
3409
|
return () => {
|
|
2620
3410
|
alive = false;
|
|
@@ -2636,8 +3426,10 @@ window.__ModuleLoader__.load({
|
|
|
2636
3426
|
}),
|
|
2637
3427
|
signal: abort.signal
|
|
2638
3428
|
}).then((r) => r.json()).then((b) => {
|
|
2639
|
-
if (b?.ok === true && b.rungs !== void 0)
|
|
2640
|
-
|
|
3429
|
+
if (b?.ok === true && b.rungs !== void 0) {
|
|
3430
|
+
setRungs(b.rungs);
|
|
3431
|
+
props.onRungs?.(b.rungs);
|
|
3432
|
+
} else setRowError({
|
|
2641
3433
|
family,
|
|
2642
3434
|
msg: String(b?.error ?? "failed")
|
|
2643
3435
|
});
|
|
@@ -2860,24 +3652,188 @@ window.__ModuleLoader__.load({
|
|
|
2860
3652
|
})
|
|
2861
3653
|
] });
|
|
2862
3654
|
}
|
|
3655
|
+
/** Stable snapshot served while the real scope has not resolved yet — the
|
|
3656
|
+
* store hook needs a referentially stable object; the diagnostic placeholder
|
|
3657
|
+
* renders instead of the card body in that case. */
|
|
3658
|
+
const EMPTY_SNAPSHOT = {
|
|
3659
|
+
status: "unavailable",
|
|
3660
|
+
value: null,
|
|
3661
|
+
writable: false
|
|
3662
|
+
};
|
|
3663
|
+
const drawerGroupStyle = {
|
|
3664
|
+
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))",
|
|
3665
|
+
borderRadius: "10px",
|
|
3666
|
+
background: "var(--dsw-alias-bg-surface, transparent)",
|
|
3667
|
+
overflow: "hidden"
|
|
3668
|
+
};
|
|
3669
|
+
const drawerHeaderStyle = {
|
|
3670
|
+
appearance: "none",
|
|
3671
|
+
width: "100%",
|
|
3672
|
+
font: "inherit",
|
|
3673
|
+
color: "inherit",
|
|
3674
|
+
textAlign: "left",
|
|
3675
|
+
cursor: "pointer",
|
|
3676
|
+
background: "none",
|
|
3677
|
+
border: 0,
|
|
3678
|
+
display: "flex",
|
|
3679
|
+
alignItems: "center",
|
|
3680
|
+
gap: "8px",
|
|
3681
|
+
padding: "10px 12px"
|
|
3682
|
+
};
|
|
3683
|
+
const drawerTitleStyle = {
|
|
3684
|
+
fontSize: "13px",
|
|
3685
|
+
fontWeight: 600,
|
|
3686
|
+
color: "var(--dsw-alias-label-primary)",
|
|
3687
|
+
flex: "0 1 auto",
|
|
3688
|
+
minWidth: 0
|
|
3689
|
+
};
|
|
3690
|
+
const drawerSummaryStyle = {
|
|
3691
|
+
flex: "1 1 auto",
|
|
3692
|
+
minWidth: 0,
|
|
3693
|
+
textAlign: "right",
|
|
3694
|
+
fontSize: "12px",
|
|
3695
|
+
lineHeight: "18px",
|
|
3696
|
+
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))",
|
|
3697
|
+
overflowWrap: "anywhere"
|
|
3698
|
+
};
|
|
3699
|
+
const drawerBodyStyle = { padding: "2px 12px 12px" };
|
|
2863
3700
|
/**
|
|
2864
|
-
*
|
|
2865
|
-
*
|
|
2866
|
-
*
|
|
3701
|
+
* One denylist row: keyword + remove. `muted` marks built-in preset words —
|
|
3702
|
+
* visually quieter, because they are the default rather than a decision the
|
|
3703
|
+
* person made (they live inside the collapsed built-ins sublist).
|
|
2867
3704
|
*/
|
|
2868
|
-
function
|
|
2869
|
-
|
|
3705
|
+
function DenyRow(props) {
|
|
3706
|
+
const { keyword, index, muted, locked, removeLabel, onRemove } = props;
|
|
3707
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2870
3708
|
style: {
|
|
2871
|
-
|
|
2872
|
-
|
|
3709
|
+
display: "flex",
|
|
3710
|
+
alignItems: "center",
|
|
3711
|
+
gap: "8px",
|
|
3712
|
+
padding: "4px 8px",
|
|
3713
|
+
borderRadius: "6px",
|
|
3714
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
3715
|
+
background: "var(--dsw-alias-bg-surface, transparent)"
|
|
2873
3716
|
},
|
|
2874
|
-
children: [
|
|
3717
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
3718
|
+
style: {
|
|
3719
|
+
flex: "1 1 auto",
|
|
3720
|
+
minWidth: 0,
|
|
3721
|
+
overflowWrap: "anywhere",
|
|
3722
|
+
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
3723
|
+
color: muted ? "var(--dsw-alias-label-tertiary)" : "var(--dsw-alias-label-primary)"
|
|
3724
|
+
},
|
|
3725
|
+
children: keyword
|
|
3726
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3727
|
+
type: "button",
|
|
3728
|
+
"aria-label": removeLabel,
|
|
3729
|
+
title: removeLabel,
|
|
3730
|
+
disabled: locked,
|
|
3731
|
+
onClick: () => {
|
|
3732
|
+
onRemove(index);
|
|
3733
|
+
},
|
|
3734
|
+
style: {
|
|
3735
|
+
flex: "0 0 auto",
|
|
3736
|
+
width: "20px",
|
|
3737
|
+
height: "20px",
|
|
3738
|
+
border: "none",
|
|
3739
|
+
borderRadius: "999px",
|
|
3740
|
+
background: "transparent",
|
|
3741
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
3742
|
+
cursor: locked ? "default" : "pointer"
|
|
3743
|
+
},
|
|
3744
|
+
children: "✕"
|
|
3745
|
+
})]
|
|
3746
|
+
});
|
|
3747
|
+
}
|
|
3748
|
+
/**
|
|
3749
|
+
* One collapsible group inside the settings card.
|
|
3750
|
+
*
|
|
3751
|
+
* The card body is cut into titled drawers so the front switch and the preset
|
|
3752
|
+
* scope note stay first-screen while every block (tiers / strategies / testing
|
|
3753
|
+
* / lists / credentials / network) folds behind a header. The header always
|
|
3754
|
+
* shows a live state summary — a drawer communicates what it is doing without
|
|
3755
|
+
* being opened, mirroring the outer disclosure pattern this card already uses
|
|
3756
|
+
* (and the multi-group precedent in thinking-levels' card).
|
|
3757
|
+
*
|
|
3758
|
+
* `onFirstOpen` fires once, on the first expansion: groups whose content costs
|
|
3759
|
+
* a fetch (the rules viewer) load lazily instead of on mount.
|
|
3760
|
+
*/
|
|
3761
|
+
function DrawerGroup(props) {
|
|
3762
|
+
const { id, title, summary, onFirstOpen, children } = props;
|
|
3763
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
3764
|
+
const firedRef = (0, react.useRef)(false);
|
|
3765
|
+
const toggle = () => {
|
|
3766
|
+
const next = !open;
|
|
3767
|
+
setOpen(next);
|
|
3768
|
+
if (next && onFirstOpen !== void 0 && !firedRef.current) {
|
|
3769
|
+
firedRef.current = true;
|
|
3770
|
+
onFirstOpen();
|
|
3771
|
+
}
|
|
3772
|
+
};
|
|
3773
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3774
|
+
style: drawerGroupStyle,
|
|
3775
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3776
|
+
type: "button",
|
|
3777
|
+
"aria-expanded": open,
|
|
3778
|
+
"aria-controls": id,
|
|
3779
|
+
onClick: toggle,
|
|
3780
|
+
style: drawerHeaderStyle,
|
|
3781
|
+
children: [
|
|
3782
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
3783
|
+
width: "14",
|
|
3784
|
+
height: "14",
|
|
3785
|
+
viewBox: "0 0 16 16",
|
|
3786
|
+
"aria-hidden": true,
|
|
3787
|
+
style: {
|
|
3788
|
+
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))",
|
|
3789
|
+
flex: "0 0 auto",
|
|
3790
|
+
transition: "transform 0.16s",
|
|
3791
|
+
transform: open ? "rotate(180deg)" : "none"
|
|
3792
|
+
},
|
|
3793
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
3794
|
+
d: "M4 6l4 4 4-4",
|
|
3795
|
+
fill: "none",
|
|
3796
|
+
stroke: "currentColor",
|
|
3797
|
+
strokeWidth: "1.5",
|
|
3798
|
+
strokeLinecap: "round",
|
|
3799
|
+
strokeLinejoin: "round"
|
|
3800
|
+
})
|
|
3801
|
+
}),
|
|
3802
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3803
|
+
style: drawerTitleStyle,
|
|
3804
|
+
children: title
|
|
3805
|
+
}),
|
|
3806
|
+
summary !== void 0 && summary !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3807
|
+
style: drawerSummaryStyle,
|
|
3808
|
+
children: summary
|
|
3809
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3810
|
+
"aria-hidden": true,
|
|
3811
|
+
style: { flex: "1 1 auto" }
|
|
3812
|
+
})
|
|
3813
|
+
]
|
|
3814
|
+
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3815
|
+
id,
|
|
3816
|
+
style: drawerBodyStyle,
|
|
3817
|
+
children
|
|
3818
|
+
}) : null]
|
|
2875
3819
|
});
|
|
3820
|
+
}
|
|
3821
|
+
/**
|
|
3822
|
+
* The card body, wrapped in a disclosure shell like every peer settings card:
|
|
3823
|
+
* a header (name + description + chevron) toggling the body. The body keeps
|
|
3824
|
+
* the front switch and the preset-scope note first-screen, then cuts the rest
|
|
3825
|
+
* into six titled drawers (see DrawerGroup) so the page reads as a short
|
|
3826
|
+
* index with live summaries instead of one long form.
|
|
3827
|
+
*/
|
|
3828
|
+
function PermissiveCard({ t, scope }) {
|
|
2876
3829
|
const [open, setOpen] = (0, react.useState)(true);
|
|
3830
|
+
const [guideOpen, setGuideOpen] = (0, react.useState)(() => !isGuideSkipped("perm-gate"));
|
|
2877
3831
|
const [apiKeyDraft, setApiKeyDraft] = (0, react.useState)("");
|
|
2878
3832
|
const [allowText, setAllowText] = (0, react.useState)("");
|
|
2879
3833
|
const [allowDirty, setAllowDirty] = (0, react.useState)(false);
|
|
2880
|
-
const snapshot = (0, react.useSyncExternalStore)((listener) => scope.subscribe(listener)
|
|
3834
|
+
const snapshot = (0, react.useSyncExternalStore)(scope ? (listener) => scope.subscribe(listener) : (listener) => {
|
|
3835
|
+
return () => {};
|
|
3836
|
+
}, () => scope ? scope.getSnapshot() : EMPTY_SNAPSHOT);
|
|
2881
3837
|
const unavailable = snapshot.status === "unavailable";
|
|
2882
3838
|
const readonly = unavailable || !snapshot.writable;
|
|
2883
3839
|
const raw = snapshot.value ?? {};
|
|
@@ -2974,9 +3930,6 @@ window.__ModuleLoader__.load({
|
|
|
2974
3930
|
setRulesBusy(false);
|
|
2975
3931
|
});
|
|
2976
3932
|
};
|
|
2977
|
-
(0, react.useEffect)(() => {
|
|
2978
|
-
loadRules();
|
|
2979
|
-
}, []);
|
|
2980
3933
|
const receiverSource = (value.classifierSource ?? "custom") === "host" ? "host" : "custom";
|
|
2981
3934
|
const [receiverInfo, setReceiverInfo] = (0, react.useState)(null);
|
|
2982
3935
|
const [receiverNonce, setReceiverNonce] = (0, react.useState)(0);
|
|
@@ -3017,6 +3970,41 @@ window.__ModuleLoader__.load({
|
|
|
3017
3970
|
const restoreDeny = () => {
|
|
3018
3971
|
scope.unset("denyKeywords");
|
|
3019
3972
|
};
|
|
3973
|
+
const [presetDenyOpen, setPresetDenyOpen] = (0, react.useState)(false);
|
|
3974
|
+
const denyPairs = denylist.map((keyword, index) => ({
|
|
3975
|
+
keyword,
|
|
3976
|
+
index,
|
|
3977
|
+
preset: DEFAULT_DENY_KEYWORDS.includes(keyword)
|
|
3978
|
+
}));
|
|
3979
|
+
const customDeny = denyPairs.filter((pair) => !pair.preset);
|
|
3980
|
+
const presetDeny = denyPairs.filter((pair) => pair.preset);
|
|
3981
|
+
const [credRwCount, setCredRwCount] = (0, react.useState)(null);
|
|
3982
|
+
const handleCredRungs = (rungs) => {
|
|
3983
|
+
setCredRwCount(Object.values(rungs).filter((rung) => rung === "readwrite").length);
|
|
3984
|
+
};
|
|
3985
|
+
const enabledTiers = [
|
|
3986
|
+
...value.yolo === true ? ["YOLO"] : [],
|
|
3987
|
+
...value.safenetPass !== false ? [t("card.mode.pass")] : [],
|
|
3988
|
+
...value.safenetAsk === true ? [t("card.mode.ask")] : []
|
|
3989
|
+
];
|
|
3990
|
+
const tiersSummary = enabledTiers.length > 0 ? enabledTiers.join(" · ") : t("card.summaryNone");
|
|
3991
|
+
const enabledStrategies = [
|
|
3992
|
+
strategies.trustAutoAllow ?? true,
|
|
3993
|
+
strategies.alwaysConfirm ?? false,
|
|
3994
|
+
strategies.llmAssist ?? false,
|
|
3995
|
+
strategies.trustEscalation ?? true
|
|
3996
|
+
].filter((flag) => flag === true).length;
|
|
3997
|
+
const strategiesSummary = (enabledStrategies === 0 ? t("card.summaryNone") : t("card.summaryStrategies").replace("%n", String(enabledStrategies))) + (strategies.llmAssist === true ? " · llmAssist" : "");
|
|
3998
|
+
const listsSummary = t("card.summaryLists").replace("%a", String(patterns.length + (value.autoAllowTools ?? []).length)).replace("%d", String((denyActive ? denylist.length : 0) + (value.denyKeywordsExtra ?? []).length));
|
|
3999
|
+
const credSummary = credRwCount === null ? void 0 : t("card.summaryCredRw").replace("%n", String(credRwCount));
|
|
4000
|
+
const networkSummary = t("card.summaryNetwork").replace("%net", value.networkEnabled === true ? t("card.summaryOn") : t("card.summaryOff")).replace("%w", value.watch !== false ? t("card.summaryOn") : t("card.summaryOff"));
|
|
4001
|
+
if (!scope) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4002
|
+
style: {
|
|
4003
|
+
padding: 16,
|
|
4004
|
+
color: "var(--dsw-alias-label-tertiary, #888)"
|
|
4005
|
+
},
|
|
4006
|
+
children: [t("card.unavailable"), t("card.scopeUnresolved")]
|
|
4007
|
+
});
|
|
3020
4008
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3021
4009
|
style: {
|
|
3022
4010
|
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))",
|
|
@@ -3095,6 +4083,13 @@ window.__ModuleLoader__.load({
|
|
|
3095
4083
|
children: t("card.unavailable")
|
|
3096
4084
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3097
4085
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: switchCss }),
|
|
4086
|
+
guideOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GuidePanel, {
|
|
4087
|
+
ns: "perm-gate",
|
|
4088
|
+
steps: guideSteps(PERM_GATE_GUIDE_STEPS),
|
|
4089
|
+
onClose: () => {
|
|
4090
|
+
setGuideOpen(false);
|
|
4091
|
+
}
|
|
4092
|
+
}) : null,
|
|
3098
4093
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3099
4094
|
style: rowStyle,
|
|
3100
4095
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
@@ -3116,1353 +4111,1352 @@ window.__ModuleLoader__.load({
|
|
|
3116
4111
|
style: hintStyle,
|
|
3117
4112
|
children: t("card.scopeNote").replace("%scope", gateScope.join(" / "))
|
|
3118
4113
|
}),
|
|
3119
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
3120
|
-
style:
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3127
|
-
style: hintStyle,
|
|
3128
|
-
children: t("card.unattendedHint")
|
|
3129
|
-
}),
|
|
3130
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TierRow, {
|
|
3131
|
-
id: "plugin-config-perm-gate-yolo",
|
|
3132
|
-
label: t("card.yolo"),
|
|
3133
|
-
preset: "permissive-yolo",
|
|
3134
|
-
checked: value.yolo === true,
|
|
3135
|
-
disabled: readonly,
|
|
3136
|
-
hint: t("card.yoloHint"),
|
|
3137
|
-
onCommit: (next) => scope.set("yolo", next)
|
|
3138
|
-
}),
|
|
3139
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3140
|
-
style: rowStyle,
|
|
3141
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
3142
|
-
htmlFor: "plugin-config-perm-gate-yolo-exempt",
|
|
3143
|
-
style: { fontSize: "12px" },
|
|
3144
|
-
children: t("card.yoloExempt")
|
|
3145
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
3146
|
-
id: "plugin-config-perm-gate-yolo-exempt",
|
|
3147
|
-
checked: value.yoloWorkspaceExempt === true,
|
|
3148
|
-
disabled: readonly,
|
|
3149
|
-
onCommit: (next) => scope.set("yoloWorkspaceExempt", next)
|
|
3150
|
-
})]
|
|
3151
|
-
}),
|
|
3152
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3153
|
-
style: hintStyle,
|
|
3154
|
-
children: t("card.yoloExemptHint")
|
|
3155
|
-
}),
|
|
3156
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TierRow, {
|
|
3157
|
-
id: "plugin-config-perm-gate-safenet-pass",
|
|
3158
|
-
label: t("card.mode.pass"),
|
|
3159
|
-
preset: "permissive-mech",
|
|
3160
|
-
checked: value.safenetPass !== false,
|
|
3161
|
-
disabled: readonly,
|
|
3162
|
-
hint: t("card.passHint"),
|
|
3163
|
-
onCommit: (next) => scope.set("safenetPass", next)
|
|
3164
|
-
}),
|
|
3165
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TierRow, {
|
|
3166
|
-
id: "plugin-config-perm-gate-safenet-ask",
|
|
3167
|
-
label: t("card.mode.ask"),
|
|
3168
|
-
preset: "permissive-snet",
|
|
3169
|
-
checked: value.safenetAsk === true,
|
|
3170
|
-
disabled: readonly,
|
|
3171
|
-
hint: t("card.askHint"),
|
|
3172
|
-
onCommit: (next) => scope.set("safenetAsk", next)
|
|
3173
|
-
}),
|
|
3174
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3175
|
-
style: hintStyle,
|
|
3176
|
-
children: t("card.tierScopeHint").replace("%scope", gateScope.join(" / "))
|
|
3177
|
-
}),
|
|
3178
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3179
|
-
style: rowStyle,
|
|
3180
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
3181
|
-
htmlFor: "plugin-config-perm-gate-rules-fallback",
|
|
3182
|
-
style: { fontSize: "12px" },
|
|
3183
|
-
children: t("card.rulesFallback")
|
|
3184
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
3185
|
-
id: "plugin-config-perm-gate-rules-fallback",
|
|
3186
|
-
checked: value.rulesFallback === true,
|
|
3187
|
-
disabled: readonly,
|
|
3188
|
-
onCommit: (next) => scope.set("rulesFallback", next)
|
|
3189
|
-
})]
|
|
3190
|
-
}),
|
|
3191
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3192
|
-
style: hintStyle,
|
|
3193
|
-
children: t("card.rulesFallbackHint")
|
|
3194
|
-
}),
|
|
3195
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3196
|
-
style: rowStyle,
|
|
3197
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
3198
|
-
htmlFor: "plugin-config-perm-gate-allow-protected-push",
|
|
3199
|
-
style: { fontSize: "12px" },
|
|
3200
|
-
children: t("card.allowProtectedBranchPush")
|
|
3201
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
3202
|
-
id: "plugin-config-perm-gate-allow-protected-push",
|
|
3203
|
-
checked: value.allowProtectedBranchPush === true,
|
|
3204
|
-
disabled: readonly,
|
|
3205
|
-
onCommit: (next) => scope.set("allowProtectedBranchPush", next)
|
|
3206
|
-
})]
|
|
3207
|
-
}),
|
|
3208
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3209
|
-
style: hintStyle,
|
|
3210
|
-
children: t("card.allowProtectedBranchPushHint")
|
|
3211
|
-
}),
|
|
3212
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3213
|
-
style: rowStyle,
|
|
3214
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
3215
|
-
htmlFor: "plugin-config-perm-gate-script-review",
|
|
3216
|
-
style: { fontSize: "12px" },
|
|
3217
|
-
children: t("card.scriptReview")
|
|
3218
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
3219
|
-
id: "plugin-config-perm-gate-script-review",
|
|
3220
|
-
checked: value.scriptReview !== false,
|
|
3221
|
-
disabled: readonly,
|
|
3222
|
-
onCommit: (next) => scope.set("scriptReview", next)
|
|
3223
|
-
})]
|
|
3224
|
-
}),
|
|
3225
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3226
|
-
style: hintStyle,
|
|
3227
|
-
children: t("card.scriptReviewHint")
|
|
3228
|
-
})
|
|
3229
|
-
]
|
|
3230
|
-
}),
|
|
3231
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3232
|
-
style: sectionStyle,
|
|
4114
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4115
|
+
style: {
|
|
4116
|
+
display: "flex",
|
|
4117
|
+
flexDirection: "column",
|
|
4118
|
+
gap: "10px",
|
|
4119
|
+
marginTop: "12px"
|
|
4120
|
+
},
|
|
3233
4121
|
children: [
|
|
3234
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3239
|
-
style: rowStyle,
|
|
3240
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
3241
|
-
htmlFor: "plugin-config-perm-gate-trust",
|
|
3242
|
-
style: { fontSize: "12px" },
|
|
3243
|
-
children: t("card.strategy.trustAutoAllow")
|
|
3244
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
3245
|
-
id: "plugin-config-perm-gate-trust",
|
|
3246
|
-
checked: strategies.trustAutoAllow ?? true,
|
|
3247
|
-
disabled: readonly || !effective,
|
|
3248
|
-
onCommit: (next) => scope.set("permissiveStrategies", {
|
|
3249
|
-
...strategies,
|
|
3250
|
-
trustAutoAllow: next
|
|
3251
|
-
})
|
|
3252
|
-
})]
|
|
3253
|
-
}),
|
|
3254
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3255
|
-
style: rowStyle,
|
|
3256
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
3257
|
-
htmlFor: "plugin-config-perm-gate-confirm",
|
|
3258
|
-
style: { fontSize: "12px" },
|
|
3259
|
-
children: t("card.strategy.alwaysConfirm")
|
|
3260
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
3261
|
-
id: "plugin-config-perm-gate-confirm",
|
|
3262
|
-
checked: strategies.alwaysConfirm ?? false,
|
|
3263
|
-
disabled: readonly || !effective,
|
|
3264
|
-
onCommit: (next) => scope.set("permissiveStrategies", {
|
|
3265
|
-
...strategies,
|
|
3266
|
-
alwaysConfirm: next
|
|
3267
|
-
})
|
|
3268
|
-
})]
|
|
3269
|
-
}),
|
|
3270
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3271
|
-
style: rowStyle,
|
|
3272
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
3273
|
-
htmlFor: "plugin-config-perm-gate-llm",
|
|
3274
|
-
style: { fontSize: "12px" },
|
|
3275
|
-
children: t("card.strategy.llmAssist")
|
|
3276
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
3277
|
-
id: "plugin-config-perm-gate-llm",
|
|
3278
|
-
checked: strategies.llmAssist ?? false,
|
|
3279
|
-
disabled: readonly || !effective,
|
|
3280
|
-
onCommit: (next) => scope.set("permissiveStrategies", {
|
|
3281
|
-
...strategies,
|
|
3282
|
-
llmAssist: next
|
|
3283
|
-
})
|
|
3284
|
-
})]
|
|
3285
|
-
}),
|
|
3286
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3287
|
-
style: rowStyle,
|
|
3288
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
3289
|
-
htmlFor: "plugin-config-perm-gate-escalation",
|
|
3290
|
-
style: { fontSize: "12px" },
|
|
3291
|
-
children: t("card.strategy.trustEscalation")
|
|
3292
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
3293
|
-
id: "plugin-config-perm-gate-escalation",
|
|
3294
|
-
checked: strategies.trustEscalation ?? true,
|
|
3295
|
-
disabled: readonly || !effective,
|
|
3296
|
-
onCommit: (next) => scope.set("permissiveStrategies", {
|
|
3297
|
-
...strategies,
|
|
3298
|
-
trustEscalation: next
|
|
3299
|
-
})
|
|
3300
|
-
})]
|
|
3301
|
-
}),
|
|
3302
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3303
|
-
style: hintStyle,
|
|
3304
|
-
children: t("card.strategy.trustEscalationHint")
|
|
3305
|
-
}),
|
|
3306
|
-
strategies.llmAssist === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3307
|
-
style: sectionStyle,
|
|
4122
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
|
|
4123
|
+
id: "pg-drawer-unattended",
|
|
4124
|
+
title: t("card.unattended"),
|
|
4125
|
+
summary: tiersSummary,
|
|
3308
4126
|
children: [
|
|
3309
4127
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3310
|
-
style:
|
|
3311
|
-
children: t("card.
|
|
4128
|
+
style: hintStyle,
|
|
4129
|
+
children: t("card.unattendedHint")
|
|
4130
|
+
}),
|
|
4131
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TierRow, {
|
|
4132
|
+
id: "plugin-config-perm-gate-yolo",
|
|
4133
|
+
label: t("card.yolo"),
|
|
4134
|
+
preset: "permissive-yolo",
|
|
4135
|
+
checked: value.yolo === true,
|
|
4136
|
+
disabled: readonly,
|
|
4137
|
+
hint: t("card.yoloHint"),
|
|
4138
|
+
onCommit: (next) => scope.set("yolo", next)
|
|
3312
4139
|
}),
|
|
3313
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
3314
|
-
style:
|
|
3315
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
4140
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4141
|
+
style: rowStyle,
|
|
4142
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4143
|
+
htmlFor: "plugin-config-perm-gate-yolo-exempt",
|
|
4144
|
+
style: { fontSize: "12px" },
|
|
4145
|
+
children: t("card.yoloExempt")
|
|
4146
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4147
|
+
id: "plugin-config-perm-gate-yolo-exempt",
|
|
4148
|
+
checked: value.yoloWorkspaceExempt === true,
|
|
3320
4149
|
disabled: readonly,
|
|
3321
|
-
|
|
3322
|
-
onChange: (event) => {
|
|
3323
|
-
scope.set("classifierSource", event.currentTarget.value);
|
|
3324
|
-
},
|
|
3325
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3326
|
-
value: "custom",
|
|
3327
|
-
children: t("card.llmSourceCustom")
|
|
3328
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3329
|
-
value: "host",
|
|
3330
|
-
children: t("card.llmSourceHost")
|
|
3331
|
-
})]
|
|
4150
|
+
onCommit: (next) => scope.set("yoloWorkspaceExempt", next)
|
|
3332
4151
|
})]
|
|
3333
4152
|
}),
|
|
3334
|
-
|
|
3335
|
-
style:
|
|
3336
|
-
children:
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
4153
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4154
|
+
style: hintStyle,
|
|
4155
|
+
children: t("card.yoloExemptHint")
|
|
4156
|
+
}),
|
|
4157
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TierRow, {
|
|
4158
|
+
id: "plugin-config-perm-gate-safenet-pass",
|
|
4159
|
+
label: t("card.mode.pass"),
|
|
4160
|
+
preset: "permissive-mech",
|
|
4161
|
+
checked: value.safenetPass !== false,
|
|
4162
|
+
disabled: readonly,
|
|
4163
|
+
hint: t("card.passHint"),
|
|
4164
|
+
onCommit: (next) => scope.set("safenetPass", next)
|
|
4165
|
+
}),
|
|
4166
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TierRow, {
|
|
4167
|
+
id: "plugin-config-perm-gate-safenet-ask",
|
|
4168
|
+
label: t("card.mode.ask"),
|
|
4169
|
+
preset: "permissive-snet",
|
|
4170
|
+
checked: value.safenetAsk === true,
|
|
4171
|
+
disabled: readonly,
|
|
4172
|
+
hint: t("card.askHint"),
|
|
4173
|
+
onCommit: (next) => scope.set("safenetAsk", next)
|
|
4174
|
+
}),
|
|
4175
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4176
|
+
style: rowStyle,
|
|
4177
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4178
|
+
htmlFor: "plugin-config-perm-gate-rules-fallback",
|
|
4179
|
+
style: { fontSize: "12px" },
|
|
4180
|
+
children: t("card.rulesFallback")
|
|
4181
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4182
|
+
id: "plugin-config-perm-gate-rules-fallback",
|
|
4183
|
+
checked: value.rulesFallback === true,
|
|
3341
4184
|
disabled: readonly,
|
|
3342
|
-
|
|
3343
|
-
onChange: (event) => {
|
|
3344
|
-
const v = event.currentTarget.value;
|
|
3345
|
-
if (v.startsWith("host:")) {
|
|
3346
|
-
scope.set("classifierSource", "host");
|
|
3347
|
-
scope.set("classifierProvider", v.slice(5));
|
|
3348
|
-
return;
|
|
3349
|
-
}
|
|
3350
|
-
const preset = LLM_PRESETS.find((p) => p.id === v);
|
|
3351
|
-
if (preset !== void 0) {
|
|
3352
|
-
scope.set("classifierEndpoint", preset.endpoint);
|
|
3353
|
-
scope.set("classifierModel", preset.model);
|
|
3354
|
-
}
|
|
3355
|
-
},
|
|
3356
|
-
children: [
|
|
3357
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3358
|
-
value: "",
|
|
3359
|
-
children: t("card.llmPresetChoose")
|
|
3360
|
-
}),
|
|
3361
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
|
|
3362
|
-
label: t("card.llmPresetPublic"),
|
|
3363
|
-
children: LLM_PRESETS.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3364
|
-
value: preset.id,
|
|
3365
|
-
children: preset.label
|
|
3366
|
-
}, preset.id))
|
|
3367
|
-
}),
|
|
3368
|
-
(receiverInfo?.providers ?? []).length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
|
|
3369
|
-
label: t("card.llmPresetHost"),
|
|
3370
|
-
children: (receiverInfo?.providers ?? []).map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3371
|
-
value: `host:${p.id}`,
|
|
3372
|
-
children: `${t("card.llmSourceHost")} · ${p.id}`
|
|
3373
|
-
}, `host:${p.id}`))
|
|
3374
|
-
}) : null
|
|
3375
|
-
]
|
|
4185
|
+
onCommit: (next) => scope.set("rulesFallback", next)
|
|
3376
4186
|
})]
|
|
3377
|
-
}),
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
4187
|
+
}),
|
|
4188
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4189
|
+
style: hintStyle,
|
|
4190
|
+
children: t("card.rulesFallbackHint")
|
|
4191
|
+
}),
|
|
4192
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4193
|
+
style: rowStyle,
|
|
4194
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4195
|
+
htmlFor: "plugin-config-perm-gate-allow-protected-push",
|
|
4196
|
+
style: { fontSize: "12px" },
|
|
4197
|
+
children: t("card.allowProtectedBranchPush")
|
|
4198
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4199
|
+
id: "plugin-config-perm-gate-allow-protected-push",
|
|
4200
|
+
checked: value.allowProtectedBranchPush === true,
|
|
3385
4201
|
disabled: readonly,
|
|
3386
|
-
|
|
3387
|
-
style: controlStyle,
|
|
3388
|
-
onChange: (event) => {
|
|
3389
|
-
scope.set("classifierEndpoint", event.currentTarget.value);
|
|
3390
|
-
},
|
|
3391
|
-
onBlur: (event) => {
|
|
3392
|
-
if (event.currentTarget.value.trim() === "") scope.unset("classifierEndpoint");
|
|
3393
|
-
}
|
|
4202
|
+
onCommit: (next) => scope.set("allowProtectedBranchPush", next)
|
|
3394
4203
|
})]
|
|
3395
|
-
})
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
4204
|
+
}),
|
|
4205
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4206
|
+
style: hintStyle,
|
|
4207
|
+
children: t("card.allowProtectedBranchPushHint")
|
|
4208
|
+
}),
|
|
4209
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4210
|
+
style: rowStyle,
|
|
4211
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4212
|
+
htmlFor: "plugin-config-perm-gate-script-review",
|
|
4213
|
+
style: { fontSize: "12px" },
|
|
4214
|
+
children: t("card.scriptReview")
|
|
4215
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4216
|
+
id: "plugin-config-perm-gate-script-review",
|
|
4217
|
+
checked: value.scriptReview !== false,
|
|
4218
|
+
disabled: readonly,
|
|
4219
|
+
onCommit: (next) => scope.set("scriptReview", next)
|
|
4220
|
+
})]
|
|
4221
|
+
}),
|
|
4222
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4223
|
+
style: hintStyle,
|
|
4224
|
+
children: t("card.scriptReviewHint")
|
|
4225
|
+
})
|
|
4226
|
+
]
|
|
4227
|
+
}),
|
|
4228
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
|
|
4229
|
+
id: "pg-drawer-strategies",
|
|
4230
|
+
title: t("card.strategies"),
|
|
4231
|
+
summary: strategiesSummary,
|
|
4232
|
+
children: [
|
|
4233
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4234
|
+
style: rowStyle,
|
|
4235
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4236
|
+
htmlFor: "plugin-config-perm-gate-trust",
|
|
4237
|
+
style: { fontSize: "12px" },
|
|
4238
|
+
children: t("card.strategy.trustAutoAllow")
|
|
4239
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4240
|
+
id: "plugin-config-perm-gate-trust",
|
|
4241
|
+
checked: strategies.trustAutoAllow ?? true,
|
|
4242
|
+
disabled: readonly || !effective,
|
|
4243
|
+
onCommit: (next) => scope.set("permissiveStrategies", {
|
|
4244
|
+
...strategies,
|
|
4245
|
+
trustAutoAllow: next
|
|
4246
|
+
})
|
|
4247
|
+
})]
|
|
4248
|
+
}),
|
|
4249
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4250
|
+
style: rowStyle,
|
|
4251
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4252
|
+
htmlFor: "plugin-config-perm-gate-confirm",
|
|
4253
|
+
style: { fontSize: "12px" },
|
|
4254
|
+
children: t("card.strategy.alwaysConfirm")
|
|
4255
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4256
|
+
id: "plugin-config-perm-gate-confirm",
|
|
4257
|
+
checked: strategies.alwaysConfirm ?? false,
|
|
4258
|
+
disabled: readonly || !effective,
|
|
4259
|
+
onCommit: (next) => scope.set("permissiveStrategies", {
|
|
4260
|
+
...strategies,
|
|
4261
|
+
alwaysConfirm: next
|
|
4262
|
+
})
|
|
4263
|
+
})]
|
|
4264
|
+
}),
|
|
4265
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4266
|
+
style: rowStyle,
|
|
4267
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4268
|
+
htmlFor: "plugin-config-perm-gate-llm",
|
|
4269
|
+
style: { fontSize: "12px" },
|
|
4270
|
+
children: t("card.strategy.llmAssist")
|
|
4271
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4272
|
+
id: "plugin-config-perm-gate-llm",
|
|
4273
|
+
checked: strategies.llmAssist ?? false,
|
|
4274
|
+
disabled: readonly || !effective,
|
|
4275
|
+
onCommit: (next) => scope.set("permissiveStrategies", {
|
|
4276
|
+
...strategies,
|
|
4277
|
+
llmAssist: next
|
|
4278
|
+
})
|
|
4279
|
+
})]
|
|
4280
|
+
}),
|
|
4281
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4282
|
+
style: rowStyle,
|
|
4283
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4284
|
+
htmlFor: "plugin-config-perm-gate-escalation",
|
|
4285
|
+
style: { fontSize: "12px" },
|
|
4286
|
+
children: t("card.strategy.trustEscalation")
|
|
4287
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4288
|
+
id: "plugin-config-perm-gate-escalation",
|
|
4289
|
+
checked: strategies.trustEscalation ?? true,
|
|
4290
|
+
disabled: readonly || !effective,
|
|
4291
|
+
onCommit: (next) => scope.set("permissiveStrategies", {
|
|
4292
|
+
...strategies,
|
|
4293
|
+
trustEscalation: next
|
|
4294
|
+
})
|
|
4295
|
+
})]
|
|
4296
|
+
}),
|
|
4297
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4298
|
+
style: hintStyle,
|
|
4299
|
+
children: t("card.strategy.trustEscalationHint")
|
|
4300
|
+
}),
|
|
4301
|
+
strategies.llmAssist === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4302
|
+
style: sectionStyle,
|
|
4303
|
+
children: [
|
|
4304
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4305
|
+
style: labelStyle,
|
|
4306
|
+
children: t("card.llmReceiver")
|
|
4307
|
+
}),
|
|
4308
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4309
|
+
style: fieldStyle,
|
|
4310
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3404
4311
|
style: fieldLabelStyle,
|
|
3405
|
-
children: t("card.
|
|
3406
|
-
}),
|
|
3407
|
-
|
|
4312
|
+
children: t("card.llmSource")
|
|
4313
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
4314
|
+
value: value.classifierSource ?? "custom",
|
|
4315
|
+
disabled: readonly,
|
|
4316
|
+
style: controlStyle,
|
|
4317
|
+
onChange: (event) => {
|
|
4318
|
+
scope.set("classifierSource", event.currentTarget.value);
|
|
4319
|
+
},
|
|
4320
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4321
|
+
value: "custom",
|
|
4322
|
+
children: t("card.llmSourceCustom")
|
|
4323
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4324
|
+
value: "host",
|
|
4325
|
+
children: t("card.llmSourceHost")
|
|
4326
|
+
})]
|
|
4327
|
+
})]
|
|
4328
|
+
}),
|
|
4329
|
+
(value.classifierSource ?? "custom") === "custom" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4330
|
+
style: fieldStyle,
|
|
4331
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4332
|
+
style: fieldLabelStyle,
|
|
4333
|
+
children: t("card.llmPreset")
|
|
4334
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
4335
|
+
value: "",
|
|
4336
|
+
disabled: readonly,
|
|
4337
|
+
style: controlStyle,
|
|
4338
|
+
onChange: (event) => {
|
|
4339
|
+
const v = event.currentTarget.value;
|
|
4340
|
+
if (v.startsWith("host:")) {
|
|
4341
|
+
scope.set("classifierSource", "host");
|
|
4342
|
+
scope.set("classifierProvider", v.slice(5));
|
|
4343
|
+
return;
|
|
4344
|
+
}
|
|
4345
|
+
const preset = LLM_PRESETS.find((p) => p.id === v);
|
|
4346
|
+
if (preset !== void 0) {
|
|
4347
|
+
scope.set("classifierEndpoint", preset.endpoint);
|
|
4348
|
+
scope.set("classifierModel", preset.model);
|
|
4349
|
+
}
|
|
4350
|
+
},
|
|
4351
|
+
children: [
|
|
4352
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4353
|
+
value: "",
|
|
4354
|
+
children: t("card.llmPresetChoose")
|
|
4355
|
+
}),
|
|
4356
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
|
|
4357
|
+
label: t("card.llmPresetPublic"),
|
|
4358
|
+
children: LLM_PRESETS.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4359
|
+
value: preset.id,
|
|
4360
|
+
children: preset.label
|
|
4361
|
+
}, preset.id))
|
|
4362
|
+
}),
|
|
4363
|
+
(receiverInfo?.providers ?? []).length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
|
|
4364
|
+
label: t("card.llmPresetHost"),
|
|
4365
|
+
children: (receiverInfo?.providers ?? []).map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4366
|
+
value: `host:${p.id}`,
|
|
4367
|
+
children: `${t("card.llmSourceHost")} · ${p.id}`
|
|
4368
|
+
}, `host:${p.id}`))
|
|
4369
|
+
}) : null
|
|
4370
|
+
]
|
|
4371
|
+
})]
|
|
4372
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4373
|
+
style: fieldStyle,
|
|
4374
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4375
|
+
style: fieldLabelStyle,
|
|
4376
|
+
children: t("card.llmEndpoint")
|
|
4377
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3408
4378
|
type: "text",
|
|
3409
|
-
|
|
3410
|
-
value: value.classifierProvider ?? "",
|
|
4379
|
+
value: value.classifierEndpoint ?? "",
|
|
3411
4380
|
disabled: readonly,
|
|
3412
|
-
placeholder:
|
|
4381
|
+
placeholder: "https://api.openai.com/v1",
|
|
3413
4382
|
style: controlStyle,
|
|
3414
4383
|
onChange: (event) => {
|
|
3415
|
-
scope.set("
|
|
4384
|
+
scope.set("classifierEndpoint", event.currentTarget.value);
|
|
3416
4385
|
},
|
|
3417
4386
|
onBlur: (event) => {
|
|
3418
|
-
if (event.currentTarget.value.trim() === "") scope.unset("
|
|
4387
|
+
if (event.currentTarget.value.trim() === "") scope.unset("classifierEndpoint");
|
|
3419
4388
|
}
|
|
4389
|
+
})]
|
|
4390
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
4391
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4392
|
+
style: hintStyle,
|
|
4393
|
+
children: t("card.llmSourceHostHint")
|
|
3420
4394
|
}),
|
|
3421
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
3422
|
-
|
|
3423
|
-
children:
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
4395
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4396
|
+
style: fieldStyle,
|
|
4397
|
+
children: [
|
|
4398
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4399
|
+
style: fieldLabelStyle,
|
|
4400
|
+
children: t("card.llmProvider")
|
|
4401
|
+
}),
|
|
4402
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4403
|
+
type: "text",
|
|
4404
|
+
list: "perm-gate-provider-options",
|
|
4405
|
+
value: value.classifierProvider ?? "",
|
|
4406
|
+
disabled: readonly,
|
|
4407
|
+
placeholder: t("card.llmProviderPlaceholder"),
|
|
4408
|
+
style: controlStyle,
|
|
4409
|
+
onChange: (event) => {
|
|
4410
|
+
scope.set("classifierProvider", event.currentTarget.value);
|
|
4411
|
+
},
|
|
4412
|
+
onBlur: (event) => {
|
|
4413
|
+
if (event.currentTarget.value.trim() === "") scope.unset("classifierProvider");
|
|
4414
|
+
}
|
|
4415
|
+
}),
|
|
4416
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("datalist", {
|
|
4417
|
+
id: "perm-gate-provider-options",
|
|
4418
|
+
children: (receiverInfo?.providers ?? []).map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
|
|
4419
|
+
value: p.id,
|
|
4420
|
+
children: [p.name, p.error !== void 0 ? ` (${p.error})` : ""]
|
|
4421
|
+
}, p.id))
|
|
4422
|
+
})
|
|
4423
|
+
]
|
|
4424
|
+
}),
|
|
4425
|
+
receiverInfo?.selection !== null && receiverInfo?.selection !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4426
|
+
style: hintStyle,
|
|
4427
|
+
children: t("card.llmResolved").replace("%p", receiverInfo.selection.provider).replace("%m", receiverInfo.selection.model)
|
|
4428
|
+
}) : null
|
|
4429
|
+
] }),
|
|
4430
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4431
|
+
style: fieldStyle,
|
|
4432
|
+
children: [
|
|
4433
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4434
|
+
style: fieldLabelStyle,
|
|
4435
|
+
children: t("card.llmModel")
|
|
4436
|
+
}),
|
|
4437
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4438
|
+
type: "text",
|
|
4439
|
+
list: receiverSource === "host" ? "perm-gate-model-options" : void 0,
|
|
4440
|
+
value: value.classifierModel ?? "",
|
|
4441
|
+
disabled: readonly,
|
|
4442
|
+
placeholder: receiverSource === "host" ? t("card.llmModelHostPlaceholder") : "deepseek-chat",
|
|
4443
|
+
style: controlStyle,
|
|
4444
|
+
onChange: (event) => {
|
|
4445
|
+
scope.set("classifierModel", event.currentTarget.value);
|
|
4446
|
+
},
|
|
4447
|
+
onBlur: (event) => {
|
|
4448
|
+
if (event.currentTarget.value.trim() === "") scope.unset("classifierModel");
|
|
4449
|
+
}
|
|
4450
|
+
}),
|
|
4451
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("datalist", {
|
|
4452
|
+
id: "perm-gate-model-options",
|
|
4453
|
+
children: (receiverInfo?.providers ?? []).filter((p) => receiverProviderDraft === "" || p.id === receiverProviderDraft).flatMap((p) => p.models).map((m) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4454
|
+
value: m.id,
|
|
4455
|
+
children: m.name
|
|
4456
|
+
}, `${m.id}`))
|
|
4457
|
+
})
|
|
4458
|
+
]
|
|
3441
4459
|
}),
|
|
3442
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
4460
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4461
|
+
style: fieldStyle,
|
|
4462
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4463
|
+
style: fieldLabelStyle,
|
|
4464
|
+
children: t("card.llmEffort")
|
|
4465
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
4466
|
+
value: value.classifierEffort ?? "",
|
|
4467
|
+
disabled: readonly || receiverSource !== "host",
|
|
4468
|
+
style: controlStyle,
|
|
4469
|
+
title: t("card.llmEffortHint"),
|
|
4470
|
+
onChange: (event) => {
|
|
4471
|
+
scope.set("classifierEffort", event.currentTarget.value);
|
|
4472
|
+
},
|
|
4473
|
+
children: [
|
|
4474
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4475
|
+
value: "",
|
|
4476
|
+
children: t("card.llmEffortHost")
|
|
4477
|
+
}),
|
|
4478
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4479
|
+
value: "off",
|
|
4480
|
+
children: "off"
|
|
4481
|
+
}),
|
|
4482
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4483
|
+
value: "low",
|
|
4484
|
+
children: "low"
|
|
4485
|
+
}),
|
|
4486
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4487
|
+
value: "medium",
|
|
4488
|
+
children: "medium"
|
|
4489
|
+
}),
|
|
4490
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
4491
|
+
value: "high",
|
|
4492
|
+
children: "high"
|
|
4493
|
+
})
|
|
4494
|
+
]
|
|
4495
|
+
})]
|
|
3455
4496
|
}),
|
|
3456
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
3457
|
-
|
|
3458
|
-
children:
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
children: "high"
|
|
3498
|
-
})
|
|
3499
|
-
]
|
|
3500
|
-
})]
|
|
3501
|
-
}),
|
|
3502
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3503
|
-
style: fieldStyle,
|
|
3504
|
-
children: [
|
|
3505
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3506
|
-
style: fieldLabelStyle,
|
|
3507
|
-
children: t("card.llmKey")
|
|
4497
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4498
|
+
style: fieldStyle,
|
|
4499
|
+
children: [
|
|
4500
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4501
|
+
style: fieldLabelStyle,
|
|
4502
|
+
children: t("card.llmKey")
|
|
4503
|
+
}),
|
|
4504
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4505
|
+
style: {
|
|
4506
|
+
display: "flex",
|
|
4507
|
+
gap: "6px"
|
|
4508
|
+
},
|
|
4509
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4510
|
+
type: "password",
|
|
4511
|
+
autoComplete: "off",
|
|
4512
|
+
spellCheck: false,
|
|
4513
|
+
value: apiKeyDraft,
|
|
4514
|
+
disabled: readonly,
|
|
4515
|
+
placeholder: hasApiKey ? t("card.llmKeyMasked") : t("card.llmKeyHidden"),
|
|
4516
|
+
style: {
|
|
4517
|
+
...controlStyle,
|
|
4518
|
+
flex: "1 1 0%"
|
|
4519
|
+
},
|
|
4520
|
+
onChange: (event) => setApiKeyDraft(event.currentTarget.value),
|
|
4521
|
+
onBlur: commitApiKey,
|
|
4522
|
+
onKeyDown: (event) => {
|
|
4523
|
+
if (event.key === "Enter") event.currentTarget.blur();
|
|
4524
|
+
}
|
|
4525
|
+
}), hasApiKey ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4526
|
+
type: "button",
|
|
4527
|
+
disabled: readonly,
|
|
4528
|
+
onClick: clearApiKey,
|
|
4529
|
+
style: controlStyle,
|
|
4530
|
+
children: t("card.llmKeyClear")
|
|
4531
|
+
}) : null]
|
|
4532
|
+
}),
|
|
4533
|
+
hasApiKey && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4534
|
+
style: hintStyle,
|
|
4535
|
+
children: t("card.llmKeyOverwrite")
|
|
4536
|
+
})
|
|
4537
|
+
]
|
|
3508
4538
|
}),
|
|
3509
4539
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3510
4540
|
style: {
|
|
3511
4541
|
display: "flex",
|
|
3512
|
-
|
|
4542
|
+
alignItems: "center",
|
|
4543
|
+
gap: "8px",
|
|
4544
|
+
marginTop: "4px"
|
|
3513
4545
|
},
|
|
3514
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
3515
|
-
type: "
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
4546
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4547
|
+
type: "button",
|
|
4548
|
+
disabled: readonly || healthBusy,
|
|
4549
|
+
onClick: () => {
|
|
4550
|
+
setHealthBusy(true);
|
|
4551
|
+
setHealthResult(null);
|
|
4552
|
+
fetch("/api/dsh-perm-gate/health", {
|
|
4553
|
+
method: "POST",
|
|
4554
|
+
headers: { "content-type": "application/json" },
|
|
4555
|
+
body: "{}"
|
|
4556
|
+
}).then(async (r) => {
|
|
4557
|
+
const text = await r.text();
|
|
4558
|
+
if (r.status === 404) throw new Error(t("card.healthStale"));
|
|
4559
|
+
try {
|
|
4560
|
+
return JSON.parse(text);
|
|
4561
|
+
} catch {
|
|
4562
|
+
throw new Error(text.trim().slice(0, 120) !== "" ? text.trim().slice(0, 120) : `HTTP ${r.status}`);
|
|
4563
|
+
}
|
|
4564
|
+
}).then((res) => {
|
|
4565
|
+
setHealthResult(res.ok === true && typeof res.ms === "number" ? t("card.healthOk").replace("%ms", String(res.ms)) + (typeof res.detail === "string" ? ` · ${res.detail}` : "") : t("card.healthFail") + (res.detail ?? res.error ?? "unknown"));
|
|
4566
|
+
setReceiverNonce((n) => n + 1);
|
|
4567
|
+
}).catch((e) => {
|
|
4568
|
+
setHealthResult(t("card.healthFail") + String(e?.message ?? e));
|
|
4569
|
+
}).finally(() => {
|
|
4570
|
+
setHealthBusy(false);
|
|
4571
|
+
});
|
|
4572
|
+
},
|
|
3521
4573
|
style: {
|
|
3522
4574
|
...controlStyle,
|
|
3523
|
-
|
|
4575
|
+
cursor: readonly || healthBusy ? "default" : "pointer"
|
|
3524
4576
|
},
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
4577
|
+
children: healthBusy ? t("card.healthRunning") : t("card.healthTest")
|
|
4578
|
+
}), healthResult !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4579
|
+
style: {
|
|
4580
|
+
fontSize: "12px",
|
|
4581
|
+
lineHeight: "18px",
|
|
4582
|
+
color: "var(--dsw-alias-label-secondary, inherit)",
|
|
4583
|
+
overflowWrap: "anywhere"
|
|
4584
|
+
},
|
|
4585
|
+
children: healthResult
|
|
4586
|
+
})]
|
|
4587
|
+
}),
|
|
4588
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4589
|
+
style: rowStyle,
|
|
4590
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4591
|
+
htmlFor: "plugin-config-perm-gate-risk-learning",
|
|
4592
|
+
style: { fontSize: "12px" },
|
|
4593
|
+
children: t("card.riskLearning")
|
|
4594
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4595
|
+
id: "plugin-config-perm-gate-risk-learning",
|
|
4596
|
+
checked: value.riskLearning ?? false,
|
|
4597
|
+
disabled: readonly || !effective,
|
|
4598
|
+
onCommit: (next) => scope.set("riskLearning", next)
|
|
4599
|
+
})]
|
|
3537
4600
|
}),
|
|
3538
|
-
|
|
4601
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3539
4602
|
style: hintStyle,
|
|
3540
|
-
children: t("card.
|
|
3541
|
-
})
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
}).then(async (r) => {
|
|
3562
|
-
const text = await r.text();
|
|
3563
|
-
if (r.status === 404) throw new Error(t("card.healthStale"));
|
|
3564
|
-
try {
|
|
3565
|
-
return JSON.parse(text);
|
|
3566
|
-
} catch {
|
|
3567
|
-
throw new Error(text.trim().slice(0, 120) !== "" ? text.trim().slice(0, 120) : `HTTP ${r.status}`);
|
|
4603
|
+
children: t("card.riskLearningHint")
|
|
4604
|
+
}),
|
|
4605
|
+
value.riskLearning === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4606
|
+
style: fieldStyle,
|
|
4607
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4608
|
+
style: fieldLabelStyle,
|
|
4609
|
+
children: t("card.riskThreshold")
|
|
4610
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4611
|
+
id: "plugin-config-perm-gate-risk-threshold",
|
|
4612
|
+
type: "number",
|
|
4613
|
+
min: 1,
|
|
4614
|
+
max: 10,
|
|
4615
|
+
value: value.riskThreshold ?? 3,
|
|
4616
|
+
disabled: readonly || !effective,
|
|
4617
|
+
style: {
|
|
4618
|
+
...controlStyle,
|
|
4619
|
+
width: "96px"
|
|
4620
|
+
},
|
|
4621
|
+
onChange: (event) => {
|
|
4622
|
+
const n = Number.parseInt(event.currentTarget.value, 10);
|
|
4623
|
+
if (Number.isFinite(n) && n >= 1 && n <= 10) scope.set("riskThreshold", n);
|
|
3568
4624
|
}
|
|
3569
|
-
})
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
4625
|
+
})]
|
|
4626
|
+
}) : null,
|
|
4627
|
+
value.riskLearning === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
4628
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4629
|
+
style: rowStyle,
|
|
4630
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4631
|
+
htmlFor: "plugin-config-perm-gate-risk-sediment",
|
|
4632
|
+
style: { fontSize: "12px" },
|
|
4633
|
+
children: t("card.riskSediment")
|
|
4634
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4635
|
+
id: "plugin-config-perm-gate-risk-sediment",
|
|
4636
|
+
checked: value.riskSediment ?? true,
|
|
4637
|
+
disabled: readonly || !effective,
|
|
4638
|
+
onCommit: (next) => scope.set("riskSediment", next)
|
|
4639
|
+
})]
|
|
4640
|
+
}),
|
|
4641
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4642
|
+
style: hintStyle,
|
|
4643
|
+
children: t("card.riskSedimentHint")
|
|
4644
|
+
}),
|
|
4645
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4646
|
+
style: sectionStyle,
|
|
4647
|
+
children: [
|
|
4648
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4649
|
+
style: labelStyle,
|
|
4650
|
+
children: t("card.sediment")
|
|
4651
|
+
}),
|
|
4652
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4653
|
+
style: hintStyle,
|
|
4654
|
+
children: t("card.sedimentHint")
|
|
4655
|
+
}),
|
|
4656
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SedimentSection, { t })
|
|
4657
|
+
]
|
|
4658
|
+
})
|
|
4659
|
+
] }) : null
|
|
4660
|
+
]
|
|
4661
|
+
}) : null
|
|
4662
|
+
]
|
|
4663
|
+
}),
|
|
4664
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
|
|
4665
|
+
id: "pg-drawer-testing",
|
|
4666
|
+
title: t("card.testing"),
|
|
4667
|
+
onFirstOpen: loadRules,
|
|
4668
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4669
|
+
style: sectionStyle,
|
|
4670
|
+
children: [
|
|
4671
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4672
|
+
style: labelStyle,
|
|
4673
|
+
children: t("card.dryRun")
|
|
4674
|
+
}),
|
|
4675
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4676
|
+
style: hintStyle,
|
|
4677
|
+
children: t("card.dryRunHint")
|
|
4678
|
+
}),
|
|
4679
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4680
|
+
style: {
|
|
4681
|
+
display: "flex",
|
|
4682
|
+
flexWrap: "wrap",
|
|
4683
|
+
gap: "8px",
|
|
4684
|
+
alignItems: "flex-end",
|
|
4685
|
+
margin: "6px 0"
|
|
3577
4686
|
},
|
|
4687
|
+
children: [
|
|
4688
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4689
|
+
style: {
|
|
4690
|
+
display: "flex",
|
|
4691
|
+
flexDirection: "column",
|
|
4692
|
+
gap: "4px",
|
|
4693
|
+
flex: "0 0 120px"
|
|
4694
|
+
},
|
|
4695
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4696
|
+
style: fieldLabelStyle,
|
|
4697
|
+
children: t("card.dryRunTool")
|
|
4698
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4699
|
+
type: "text",
|
|
4700
|
+
value: dryTool,
|
|
4701
|
+
disabled: readonly,
|
|
4702
|
+
placeholder: "shell",
|
|
4703
|
+
onChange: (e) => {
|
|
4704
|
+
setDryTool(e.target.value);
|
|
4705
|
+
},
|
|
4706
|
+
onKeyDown: (e) => {
|
|
4707
|
+
if (e.key === "Enter") runDryRunTest();
|
|
4708
|
+
},
|
|
4709
|
+
style: controlStyle
|
|
4710
|
+
})]
|
|
4711
|
+
}),
|
|
4712
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
4713
|
+
style: {
|
|
4714
|
+
display: "flex",
|
|
4715
|
+
flexDirection: "column",
|
|
4716
|
+
gap: "4px",
|
|
4717
|
+
flex: "1 1 260px",
|
|
4718
|
+
minWidth: 0
|
|
4719
|
+
},
|
|
4720
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4721
|
+
style: fieldLabelStyle,
|
|
4722
|
+
children: t("card.dryRunCommand")
|
|
4723
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4724
|
+
type: "text",
|
|
4725
|
+
value: dryCommand,
|
|
4726
|
+
disabled: readonly,
|
|
4727
|
+
placeholder: t("card.dryRunCommandPlaceholder"),
|
|
4728
|
+
onChange: (e) => {
|
|
4729
|
+
setDryCommand(e.target.value);
|
|
4730
|
+
},
|
|
4731
|
+
onKeyDown: (e) => {
|
|
4732
|
+
if (e.key === "Enter") runDryRunTest();
|
|
4733
|
+
},
|
|
4734
|
+
style: controlStyle
|
|
4735
|
+
})]
|
|
4736
|
+
}),
|
|
4737
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4738
|
+
type: "button",
|
|
4739
|
+
disabled: readonly || dryBusy,
|
|
4740
|
+
onClick: runDryRunTest,
|
|
4741
|
+
style: {
|
|
4742
|
+
...controlStyle,
|
|
4743
|
+
flex: "0 0 auto",
|
|
4744
|
+
cursor: readonly || dryBusy ? "default" : "pointer"
|
|
4745
|
+
},
|
|
4746
|
+
children: dryBusy ? t("card.dryRunRunning") : t("card.dryRunTest")
|
|
4747
|
+
})
|
|
4748
|
+
]
|
|
4749
|
+
}),
|
|
4750
|
+
dryError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
3578
4751
|
style: {
|
|
3579
|
-
...
|
|
3580
|
-
|
|
4752
|
+
...hintStyle,
|
|
4753
|
+
color: "var(--dsw-alias-label-error, #c0392b)"
|
|
3581
4754
|
},
|
|
3582
|
-
children:
|
|
3583
|
-
}),
|
|
4755
|
+
children: [t("card.dryRunFail"), dryError]
|
|
4756
|
+
}),
|
|
4757
|
+
dryReport === null ? dryError === null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4758
|
+
style: hintStyle,
|
|
4759
|
+
children: t("card.dryRunEmpty")
|
|
4760
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3584
4761
|
style: {
|
|
4762
|
+
display: "flex",
|
|
4763
|
+
flexDirection: "column",
|
|
4764
|
+
gap: "4px",
|
|
4765
|
+
padding: "8px 10px",
|
|
4766
|
+
borderRadius: "6px",
|
|
4767
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
4768
|
+
background: "var(--dsw-alias-bg-surface, transparent)",
|
|
3585
4769
|
fontSize: "12px",
|
|
3586
|
-
lineHeight: "18px"
|
|
3587
|
-
color: "var(--dsw-alias-label-secondary, inherit)",
|
|
3588
|
-
overflowWrap: "anywhere"
|
|
4770
|
+
lineHeight: "18px"
|
|
3589
4771
|
},
|
|
3590
|
-
children:
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
4772
|
+
children: [
|
|
4773
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4774
|
+
style: {
|
|
4775
|
+
display: "flex",
|
|
4776
|
+
alignItems: "center",
|
|
4777
|
+
gap: "8px"
|
|
4778
|
+
},
|
|
4779
|
+
children: [
|
|
4780
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4781
|
+
style: fieldLabelStyle,
|
|
4782
|
+
children: t("card.dryRunVerdict")
|
|
4783
|
+
}),
|
|
4784
|
+
(() => {
|
|
4785
|
+
const verdict = dryReport.verdict ?? "ask";
|
|
4786
|
+
const colour = verdict === "deny" ? "var(--dsw-alias-label-error, #c0392b)" : verdict === "allow" ? "var(--dsw-alias-label-success, #2e7d32)" : "var(--dsw-alias-label-warning, #b26a00)";
|
|
4787
|
+
const text = verdict === "deny" ? t("card.dryRunDeny") : verdict === "allow" ? t("card.dryRunAllow") : t("card.dryRunAsk");
|
|
4788
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
4789
|
+
style: { color: colour },
|
|
4790
|
+
children: text
|
|
4791
|
+
});
|
|
4792
|
+
})(),
|
|
4793
|
+
(dryReport.ruleCount ?? 0) === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4794
|
+
style: { color: "var(--dsw-alias-label-secondary, inherit)" },
|
|
4795
|
+
children: t("card.dryRunNoRules")
|
|
4796
|
+
})
|
|
4797
|
+
]
|
|
4798
|
+
}),
|
|
4799
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4800
|
+
style: {
|
|
4801
|
+
display: "flex",
|
|
4802
|
+
gap: "8px",
|
|
4803
|
+
overflowWrap: "anywhere"
|
|
4804
|
+
},
|
|
4805
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4806
|
+
style: fieldLabelStyle,
|
|
4807
|
+
children: t("card.dryRunRule")
|
|
4808
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
4809
|
+
style: {
|
|
4810
|
+
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
4811
|
+
color: "var(--dsw-alias-label-primary)"
|
|
4812
|
+
},
|
|
4813
|
+
children: dryReport.ruleLayer?.ruleIndex === void 0 ? t("card.dryRunRuleNone").replace("%d", dryReport.defaultAction ?? "ask") : `#${dryReport.ruleLayer.ruleIndex} (${dryReport.ruleLayer.action ?? "?"})`
|
|
4814
|
+
})]
|
|
4815
|
+
}),
|
|
4816
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4817
|
+
style: {
|
|
4818
|
+
display: "flex",
|
|
4819
|
+
gap: "8px",
|
|
4820
|
+
overflowWrap: "anywhere"
|
|
4821
|
+
},
|
|
4822
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4823
|
+
style: fieldLabelStyle,
|
|
4824
|
+
children: t("card.dryRunDimensions")
|
|
4825
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
4826
|
+
style: {
|
|
4827
|
+
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
4828
|
+
color: "var(--dsw-alias-label-primary)"
|
|
4829
|
+
},
|
|
4830
|
+
children: (dryReport.ruleLayer?.matchedDimensions ?? []).length === 0 ? "—" : (dryReport.ruleLayer?.matchedDimensions ?? []).join(", ")
|
|
4831
|
+
})]
|
|
4832
|
+
}),
|
|
4833
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4834
|
+
style: {
|
|
4835
|
+
display: "flex",
|
|
4836
|
+
gap: "8px",
|
|
4837
|
+
overflowWrap: "anywhere"
|
|
4838
|
+
},
|
|
4839
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4840
|
+
style: fieldLabelStyle,
|
|
4841
|
+
children: t("card.dryRunReason")
|
|
4842
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4843
|
+
style: { color: "var(--dsw-alias-label-secondary, inherit)" },
|
|
4844
|
+
children: dryReport.reason ?? ""
|
|
4845
|
+
})]
|
|
4846
|
+
}),
|
|
4847
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4848
|
+
style: {
|
|
4849
|
+
...hintStyle,
|
|
4850
|
+
margin: 0
|
|
4851
|
+
},
|
|
4852
|
+
children: t("card.dryRunNote")
|
|
4853
|
+
})
|
|
4854
|
+
]
|
|
4855
|
+
})
|
|
4856
|
+
]
|
|
4857
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4858
|
+
style: sectionStyle,
|
|
4859
|
+
children: [
|
|
4860
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3622
4861
|
style: {
|
|
3623
|
-
|
|
3624
|
-
|
|
4862
|
+
display: "flex",
|
|
4863
|
+
alignItems: "center",
|
|
4864
|
+
justifyContent: "space-between",
|
|
4865
|
+
gap: "8px"
|
|
3625
4866
|
},
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
}
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
children: t("card.
|
|
3639
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
3640
|
-
id: "plugin-config-perm-gate-risk-sediment",
|
|
3641
|
-
checked: value.riskSediment ?? true,
|
|
3642
|
-
disabled: readonly || !effective,
|
|
3643
|
-
onCommit: (next) => scope.set("riskSediment", next)
|
|
4867
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4868
|
+
style: labelStyle,
|
|
4869
|
+
children: t("card.rules")
|
|
4870
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4871
|
+
type: "button",
|
|
4872
|
+
disabled: rulesBusy,
|
|
4873
|
+
onClick: loadRules,
|
|
4874
|
+
style: {
|
|
4875
|
+
...controlStyle,
|
|
4876
|
+
flex: "0 0 auto",
|
|
4877
|
+
cursor: rulesBusy ? "default" : "pointer"
|
|
4878
|
+
},
|
|
4879
|
+
children: rulesBusy ? t("card.rulesLoading") : t("card.rulesRefresh")
|
|
3644
4880
|
})]
|
|
3645
4881
|
}),
|
|
3646
4882
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3647
4883
|
style: hintStyle,
|
|
3648
|
-
children: t("card.
|
|
4884
|
+
children: t("card.rulesHint")
|
|
3649
4885
|
}),
|
|
3650
4886
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3651
|
-
style:
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
}),
|
|
3657
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3658
|
-
style: hintStyle,
|
|
3659
|
-
children: t("card.sedimentHint")
|
|
3660
|
-
}),
|
|
3661
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SedimentSection, { t })
|
|
3662
|
-
]
|
|
3663
|
-
})
|
|
3664
|
-
] }) : null
|
|
3665
|
-
]
|
|
3666
|
-
}) : null
|
|
3667
|
-
]
|
|
3668
|
-
}),
|
|
3669
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3670
|
-
style: sectionStyle,
|
|
3671
|
-
children: [
|
|
3672
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3673
|
-
style: labelStyle,
|
|
3674
|
-
children: t("card.dryRun")
|
|
3675
|
-
}),
|
|
3676
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3677
|
-
style: hintStyle,
|
|
3678
|
-
children: t("card.dryRunHint")
|
|
3679
|
-
}),
|
|
3680
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3681
|
-
style: {
|
|
3682
|
-
display: "flex",
|
|
3683
|
-
flexWrap: "wrap",
|
|
3684
|
-
gap: "8px",
|
|
3685
|
-
alignItems: "flex-end",
|
|
3686
|
-
margin: "6px 0"
|
|
3687
|
-
},
|
|
3688
|
-
children: [
|
|
3689
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3690
|
-
style: {
|
|
3691
|
-
display: "flex",
|
|
3692
|
-
flexDirection: "column",
|
|
3693
|
-
gap: "4px",
|
|
3694
|
-
flex: "0 0 120px"
|
|
3695
|
-
},
|
|
3696
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3697
|
-
style: fieldLabelStyle,
|
|
3698
|
-
children: t("card.dryRunTool")
|
|
3699
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3700
|
-
type: "text",
|
|
3701
|
-
value: dryTool,
|
|
3702
|
-
disabled: readonly,
|
|
3703
|
-
placeholder: "shell",
|
|
3704
|
-
onChange: (e) => {
|
|
3705
|
-
setDryTool(e.target.value);
|
|
3706
|
-
},
|
|
3707
|
-
onKeyDown: (e) => {
|
|
3708
|
-
if (e.key === "Enter") runDryRunTest();
|
|
4887
|
+
style: {
|
|
4888
|
+
display: "flex",
|
|
4889
|
+
gap: "8px",
|
|
4890
|
+
overflowWrap: "anywhere",
|
|
4891
|
+
marginTop: "6px"
|
|
3709
4892
|
},
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
},
|
|
3721
|
-
|
|
3722
|
-
style:
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
type: "text",
|
|
3726
|
-
value: dryCommand,
|
|
3727
|
-
disabled: readonly,
|
|
3728
|
-
placeholder: t("card.dryRunCommandPlaceholder"),
|
|
3729
|
-
onChange: (e) => {
|
|
3730
|
-
setDryCommand(e.target.value);
|
|
3731
|
-
},
|
|
3732
|
-
onKeyDown: (e) => {
|
|
3733
|
-
if (e.key === "Enter") runDryRunTest();
|
|
4893
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4894
|
+
style: fieldLabelStyle,
|
|
4895
|
+
children: t("card.rulesPath")
|
|
4896
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
4897
|
+
style: {
|
|
4898
|
+
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
4899
|
+
color: "var(--dsw-alias-label-primary)"
|
|
4900
|
+
},
|
|
4901
|
+
children: rulesBody?.path !== void 0 && rulesBody.path !== "" ? rulesBody.path : t("card.rulesNone")
|
|
4902
|
+
})]
|
|
4903
|
+
}),
|
|
4904
|
+
rulesError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
4905
|
+
style: {
|
|
4906
|
+
...hintStyle,
|
|
4907
|
+
color: "var(--dsw-alias-label-error, #c0392b)"
|
|
3734
4908
|
},
|
|
3735
|
-
|
|
3736
|
-
})
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
4909
|
+
children: [t("card.rulesError"), rulesError]
|
|
4910
|
+
}),
|
|
4911
|
+
rulesBody !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
4912
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4913
|
+
style: {
|
|
4914
|
+
display: "flex",
|
|
4915
|
+
flexWrap: "wrap",
|
|
4916
|
+
gap: "12px",
|
|
4917
|
+
marginTop: "4px"
|
|
4918
|
+
},
|
|
4919
|
+
children: [
|
|
4920
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4921
|
+
style: fieldLabelStyle,
|
|
4922
|
+
children: [t("card.rulesCounts"), " "]
|
|
4923
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
4924
|
+
style: {
|
|
4925
|
+
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
4926
|
+
color: "var(--dsw-alias-label-primary)"
|
|
4927
|
+
},
|
|
4928
|
+
children: `deny ${rulesBody.counts?.deny ?? 0} · allow ${rulesBody.counts?.allow ?? 0} · ask ${rulesBody.counts?.ask ?? 0}`
|
|
4929
|
+
})] }),
|
|
4930
|
+
rulesBody.defaultAction !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4931
|
+
style: fieldLabelStyle,
|
|
4932
|
+
children: [t("card.rulesDefault"), " "]
|
|
4933
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
4934
|
+
style: {
|
|
4935
|
+
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
4936
|
+
color: "var(--dsw-alias-label-primary)"
|
|
4937
|
+
},
|
|
4938
|
+
children: rulesBody.defaultAction
|
|
4939
|
+
})] }),
|
|
4940
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4941
|
+
style: fieldLabelStyle,
|
|
4942
|
+
children: t("card.rulesStats").replace("%b", String(rulesBody.bytes ?? 0)).replace("%l", String(rulesBody.lines ?? 0))
|
|
4943
|
+
})
|
|
4944
|
+
]
|
|
4945
|
+
}),
|
|
4946
|
+
rulesBody.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4947
|
+
style: {
|
|
4948
|
+
...hintStyle,
|
|
4949
|
+
color: "var(--dsw-alias-label-error, #c0392b)"
|
|
4950
|
+
},
|
|
4951
|
+
children: rulesBody.error
|
|
4952
|
+
}),
|
|
4953
|
+
rulesBody.exists === false && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4954
|
+
style: hintStyle,
|
|
4955
|
+
children: t("card.rulesMissing")
|
|
4956
|
+
}),
|
|
4957
|
+
rulesBody.truncated === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4958
|
+
style: hintStyle,
|
|
4959
|
+
children: t("card.rulesTruncated")
|
|
4960
|
+
}),
|
|
4961
|
+
(rulesBody.raw ?? "") !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
4962
|
+
style: {
|
|
4963
|
+
margin: "6px 0 0",
|
|
4964
|
+
padding: "8px 10px",
|
|
4965
|
+
maxHeight: "260px",
|
|
4966
|
+
overflow: "auto",
|
|
4967
|
+
borderRadius: "6px",
|
|
4968
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
4969
|
+
background: "var(--dsw-alias-bg-surface, transparent)",
|
|
4970
|
+
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
4971
|
+
color: "var(--dsw-alias-label-primary)",
|
|
4972
|
+
whiteSpace: "pre"
|
|
4973
|
+
},
|
|
4974
|
+
children: rulesBody.raw
|
|
4975
|
+
}),
|
|
4976
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4977
|
+
style: {
|
|
4978
|
+
...hintStyle,
|
|
4979
|
+
margin: 0
|
|
4980
|
+
},
|
|
4981
|
+
children: t("card.rulesNote")
|
|
4982
|
+
})
|
|
4983
|
+
] })
|
|
4984
|
+
]
|
|
4985
|
+
})]
|
|
3757
4986
|
}),
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
style: {
|
|
3763
|
-
display: "flex",
|
|
3764
|
-
flexDirection: "column",
|
|
3765
|
-
gap: "4px",
|
|
3766
|
-
padding: "8px 10px",
|
|
3767
|
-
borderRadius: "6px",
|
|
3768
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
3769
|
-
background: "var(--dsw-alias-bg-surface, transparent)",
|
|
3770
|
-
fontSize: "12px",
|
|
3771
|
-
lineHeight: "18px"
|
|
3772
|
-
},
|
|
4987
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
|
|
4988
|
+
id: "pg-drawer-lists",
|
|
4989
|
+
title: t("card.lists"),
|
|
4990
|
+
summary: listsSummary,
|
|
3773
4991
|
children: [
|
|
3774
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
3775
|
-
style:
|
|
3776
|
-
display: "flex",
|
|
3777
|
-
alignItems: "center",
|
|
3778
|
-
gap: "8px"
|
|
3779
|
-
},
|
|
4992
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4993
|
+
style: sectionStyle,
|
|
3780
4994
|
children: [
|
|
3781
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
3782
|
-
style:
|
|
3783
|
-
children: t("card.
|
|
4995
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4996
|
+
style: labelStyle,
|
|
4997
|
+
children: t("card.allowlist")
|
|
3784
4998
|
}),
|
|
3785
|
-
((
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
4999
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5000
|
+
style: hintStyle,
|
|
5001
|
+
children: t("card.allowlistHint")
|
|
5002
|
+
}),
|
|
5003
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5004
|
+
style: hintStyle,
|
|
5005
|
+
children: t("card.allowlistPresetNote")
|
|
5006
|
+
}),
|
|
5007
|
+
patterns.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5008
|
+
style: {
|
|
5009
|
+
padding: "6px 0",
|
|
5010
|
+
fontSize: "12px",
|
|
5011
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
5012
|
+
},
|
|
5013
|
+
children: t("card.allowlistEmpty")
|
|
5014
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5015
|
+
style: {
|
|
5016
|
+
display: "flex",
|
|
5017
|
+
flexDirection: "column",
|
|
5018
|
+
gap: "4px",
|
|
5019
|
+
margin: "6px 0"
|
|
5020
|
+
},
|
|
5021
|
+
children: patterns.map((pattern, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5022
|
+
style: {
|
|
5023
|
+
display: "flex",
|
|
5024
|
+
alignItems: "center",
|
|
5025
|
+
gap: "8px",
|
|
5026
|
+
padding: "4px 8px",
|
|
5027
|
+
borderRadius: "6px",
|
|
5028
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
5029
|
+
background: "var(--dsw-alias-bg-surface, transparent)"
|
|
5030
|
+
},
|
|
5031
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
5032
|
+
style: {
|
|
5033
|
+
flex: "1 1 auto",
|
|
5034
|
+
minWidth: 0,
|
|
5035
|
+
overflowWrap: "anywhere",
|
|
5036
|
+
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
5037
|
+
color: "var(--dsw-alias-label-primary)"
|
|
5038
|
+
},
|
|
5039
|
+
children: pattern
|
|
5040
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5041
|
+
type: "button",
|
|
5042
|
+
"aria-label": t("card.allowlistRemove"),
|
|
5043
|
+
title: t("card.allowlistRemove"),
|
|
5044
|
+
disabled: readonly,
|
|
5045
|
+
onClick: () => {
|
|
5046
|
+
removePattern(index);
|
|
5047
|
+
},
|
|
5048
|
+
style: {
|
|
5049
|
+
flex: "0 0 auto",
|
|
5050
|
+
width: "20px",
|
|
5051
|
+
height: "20px",
|
|
5052
|
+
border: "none",
|
|
5053
|
+
borderRadius: "999px",
|
|
5054
|
+
background: "transparent",
|
|
5055
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
5056
|
+
cursor: readonly ? "default" : "pointer"
|
|
5057
|
+
},
|
|
5058
|
+
children: "✕"
|
|
5059
|
+
})]
|
|
5060
|
+
}, `${index}:${pattern}`))
|
|
5061
|
+
}),
|
|
5062
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5063
|
+
style: {
|
|
5064
|
+
display: "flex",
|
|
5065
|
+
gap: "6px",
|
|
5066
|
+
marginTop: "6px"
|
|
5067
|
+
},
|
|
5068
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5069
|
+
type: "text",
|
|
5070
|
+
value: addDraft,
|
|
5071
|
+
disabled: readonly,
|
|
5072
|
+
placeholder: t("card.allowlistPlaceholder"),
|
|
5073
|
+
spellCheck: false,
|
|
5074
|
+
style: {
|
|
5075
|
+
...controlStyle,
|
|
5076
|
+
flex: "1 1 auto",
|
|
5077
|
+
minWidth: 0
|
|
5078
|
+
},
|
|
5079
|
+
onChange: (event) => {
|
|
5080
|
+
setAddDraft(event.currentTarget.value);
|
|
5081
|
+
},
|
|
5082
|
+
onKeyDown: (event) => {
|
|
5083
|
+
if (event.key === "Enter") addPattern();
|
|
5084
|
+
}
|
|
5085
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5086
|
+
type: "button",
|
|
5087
|
+
disabled: readonly || addDraft.trim() === "",
|
|
5088
|
+
onClick: addPattern,
|
|
5089
|
+
style: {
|
|
5090
|
+
...controlStyle,
|
|
5091
|
+
flex: "0 0 auto",
|
|
5092
|
+
cursor: readonly || addDraft.trim() === "" ? "default" : "pointer",
|
|
5093
|
+
opacity: readonly || addDraft.trim() === "" ? .5 : 1
|
|
5094
|
+
},
|
|
5095
|
+
children: t("card.allowlistAdd")
|
|
5096
|
+
})]
|
|
5097
|
+
}),
|
|
5098
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5099
|
+
style: {
|
|
5100
|
+
display: "flex",
|
|
5101
|
+
justifyContent: "flex-end",
|
|
5102
|
+
marginTop: "6px"
|
|
5103
|
+
},
|
|
5104
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5105
|
+
type: "button",
|
|
5106
|
+
onClick: () => {
|
|
5107
|
+
setBulkOpen((current) => !current);
|
|
5108
|
+
},
|
|
5109
|
+
style: {
|
|
5110
|
+
...controlStyle,
|
|
5111
|
+
cursor: "pointer",
|
|
5112
|
+
border: "none",
|
|
5113
|
+
background: "transparent",
|
|
5114
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
5115
|
+
},
|
|
5116
|
+
children: bulkOpen ? t("card.allowlistBulkHide") : t("card.allowlistBulk")
|
|
5117
|
+
})
|
|
5118
|
+
}),
|
|
5119
|
+
bulkOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
5120
|
+
id: "plugin-config-perm-gate-allowlist",
|
|
5121
|
+
value: allowlistShown,
|
|
5122
|
+
disabled: readonly,
|
|
5123
|
+
rows: 6,
|
|
5124
|
+
spellCheck: false,
|
|
5125
|
+
style: {
|
|
5126
|
+
...controlStyle,
|
|
5127
|
+
width: "100%",
|
|
5128
|
+
boxSizing: "border-box",
|
|
5129
|
+
resize: "vertical",
|
|
5130
|
+
fontFamily: "var(--ds-font-family-code, monospace)",
|
|
5131
|
+
whiteSpace: "pre"
|
|
5132
|
+
},
|
|
5133
|
+
onChange: (event) => {
|
|
5134
|
+
setAllowDirty(true);
|
|
5135
|
+
setAllowText(event.currentTarget.value);
|
|
5136
|
+
},
|
|
5137
|
+
onKeyDown: (event) => {
|
|
5138
|
+
if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) commitAllowlist();
|
|
5139
|
+
}
|
|
5140
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5141
|
+
style: {
|
|
5142
|
+
display: "flex",
|
|
5143
|
+
justifyContent: "flex-end",
|
|
5144
|
+
marginTop: "6px"
|
|
5145
|
+
},
|
|
5146
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5147
|
+
type: "button",
|
|
5148
|
+
disabled: readonly || !allowDirty,
|
|
5149
|
+
onClick: commitAllowlist,
|
|
5150
|
+
style: {
|
|
5151
|
+
...controlStyle,
|
|
5152
|
+
cursor: readonly || !allowDirty ? "default" : "pointer",
|
|
5153
|
+
opacity: readonly || !allowDirty ? .5 : 1
|
|
5154
|
+
},
|
|
5155
|
+
children: t("card.allowlistSave")
|
|
5156
|
+
})
|
|
5157
|
+
})] }) : null
|
|
3798
5158
|
]
|
|
3799
5159
|
}),
|
|
3800
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
3801
|
-
style:
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
color: "var(--dsw-alias-label-primary)"
|
|
3813
|
-
},
|
|
3814
|
-
children: dryReport.ruleLayer?.ruleIndex === void 0 ? t("card.dryRunRuleNone").replace("%d", dryReport.defaultAction ?? "ask") : `#${dryReport.ruleLayer.ruleIndex} (${dryReport.ruleLayer.action ?? "?"})`
|
|
3815
|
-
})]
|
|
3816
|
-
}),
|
|
3817
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3818
|
-
style: {
|
|
3819
|
-
display: "flex",
|
|
3820
|
-
gap: "8px",
|
|
3821
|
-
overflowWrap: "anywhere"
|
|
3822
|
-
},
|
|
3823
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3824
|
-
style: fieldLabelStyle,
|
|
3825
|
-
children: t("card.dryRunDimensions")
|
|
3826
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
3827
|
-
style: {
|
|
3828
|
-
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
3829
|
-
color: "var(--dsw-alias-label-primary)"
|
|
3830
|
-
},
|
|
3831
|
-
children: (dryReport.ruleLayer?.matchedDimensions ?? []).length === 0 ? "—" : (dryReport.ruleLayer?.matchedDimensions ?? []).join(", ")
|
|
3832
|
-
})]
|
|
3833
|
-
}),
|
|
3834
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3835
|
-
style: {
|
|
3836
|
-
display: "flex",
|
|
3837
|
-
gap: "8px",
|
|
3838
|
-
overflowWrap: "anywhere"
|
|
3839
|
-
},
|
|
3840
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3841
|
-
style: fieldLabelStyle,
|
|
3842
|
-
children: t("card.dryRunReason")
|
|
3843
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3844
|
-
style: { color: "var(--dsw-alias-label-secondary, inherit)" },
|
|
3845
|
-
children: dryReport.reason ?? ""
|
|
3846
|
-
})]
|
|
3847
|
-
}),
|
|
3848
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3849
|
-
style: {
|
|
3850
|
-
...hintStyle,
|
|
3851
|
-
margin: 0
|
|
3852
|
-
},
|
|
3853
|
-
children: t("card.dryRunNote")
|
|
3854
|
-
})
|
|
3855
|
-
]
|
|
3856
|
-
})
|
|
3857
|
-
]
|
|
3858
|
-
}),
|
|
3859
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3860
|
-
style: sectionStyle,
|
|
3861
|
-
children: [
|
|
3862
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3863
|
-
style: {
|
|
3864
|
-
display: "flex",
|
|
3865
|
-
alignItems: "center",
|
|
3866
|
-
justifyContent: "space-between",
|
|
3867
|
-
gap: "8px"
|
|
3868
|
-
},
|
|
3869
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3870
|
-
style: labelStyle,
|
|
3871
|
-
children: t("card.rules")
|
|
3872
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3873
|
-
type: "button",
|
|
3874
|
-
disabled: rulesBusy,
|
|
3875
|
-
onClick: loadRules,
|
|
3876
|
-
style: {
|
|
3877
|
-
...controlStyle,
|
|
3878
|
-
flex: "0 0 auto",
|
|
3879
|
-
cursor: rulesBusy ? "default" : "pointer"
|
|
3880
|
-
},
|
|
3881
|
-
children: rulesBusy ? t("card.rulesLoading") : t("card.rulesRefresh")
|
|
3882
|
-
})]
|
|
3883
|
-
}),
|
|
3884
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3885
|
-
style: hintStyle,
|
|
3886
|
-
children: t("card.rulesHint")
|
|
3887
|
-
}),
|
|
3888
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3889
|
-
style: {
|
|
3890
|
-
display: "flex",
|
|
3891
|
-
gap: "8px",
|
|
3892
|
-
overflowWrap: "anywhere",
|
|
3893
|
-
marginTop: "6px"
|
|
3894
|
-
},
|
|
3895
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3896
|
-
style: fieldLabelStyle,
|
|
3897
|
-
children: t("card.rulesPath")
|
|
3898
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
3899
|
-
style: {
|
|
3900
|
-
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
3901
|
-
color: "var(--dsw-alias-label-primary)"
|
|
3902
|
-
},
|
|
3903
|
-
children: rulesBody?.path !== void 0 && rulesBody.path !== "" ? rulesBody.path : t("card.rulesNone")
|
|
3904
|
-
})]
|
|
3905
|
-
}),
|
|
3906
|
-
rulesError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
3907
|
-
style: {
|
|
3908
|
-
...hintStyle,
|
|
3909
|
-
color: "var(--dsw-alias-label-error, #c0392b)"
|
|
3910
|
-
},
|
|
3911
|
-
children: [t("card.rulesError"), rulesError]
|
|
3912
|
-
}),
|
|
3913
|
-
rulesBody !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3914
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3915
|
-
style: {
|
|
3916
|
-
display: "flex",
|
|
3917
|
-
flexWrap: "wrap",
|
|
3918
|
-
gap: "12px",
|
|
3919
|
-
marginTop: "4px"
|
|
3920
|
-
},
|
|
3921
|
-
children: [
|
|
3922
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3923
|
-
style: fieldLabelStyle,
|
|
3924
|
-
children: [t("card.rulesCounts"), " "]
|
|
3925
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
3926
|
-
style: {
|
|
3927
|
-
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
3928
|
-
color: "var(--dsw-alias-label-primary)"
|
|
5160
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
5161
|
+
style: sectionStyle,
|
|
5162
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
5163
|
+
label: t("card.autoAllowTools"),
|
|
5164
|
+
hint: t("card.autoAllowToolsHint"),
|
|
5165
|
+
placeholder: t("card.autoAllowToolsPlaceholder"),
|
|
5166
|
+
addLabel: t("card.denylistAdd"),
|
|
5167
|
+
removeLabel: t("card.listRemove"),
|
|
5168
|
+
items: value.autoAllowTools ?? [],
|
|
5169
|
+
locked: readonly,
|
|
5170
|
+
onAdd: (entry) => {
|
|
5171
|
+
scope.set("autoAllowTools", [...value.autoAllowTools ?? [], entry]);
|
|
3929
5172
|
},
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
style: fieldLabelStyle,
|
|
3934
|
-
children: [t("card.rulesDefault"), " "]
|
|
3935
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
3936
|
-
style: {
|
|
3937
|
-
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
3938
|
-
color: "var(--dsw-alias-label-primary)"
|
|
3939
|
-
},
|
|
3940
|
-
children: rulesBody.defaultAction
|
|
3941
|
-
})] }),
|
|
3942
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3943
|
-
style: fieldLabelStyle,
|
|
3944
|
-
children: t("card.rulesStats").replace("%b", String(rulesBody.bytes ?? 0)).replace("%l", String(rulesBody.lines ?? 0))
|
|
5173
|
+
onRemove: (index) => {
|
|
5174
|
+
scope.set("autoAllowTools", (value.autoAllowTools ?? []).filter((_, i) => i !== index));
|
|
5175
|
+
}
|
|
3945
5176
|
})
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
style: {
|
|
3950
|
-
...hintStyle,
|
|
3951
|
-
color: "var(--dsw-alias-label-error, #c0392b)"
|
|
3952
|
-
},
|
|
3953
|
-
children: rulesBody.error
|
|
3954
|
-
}),
|
|
3955
|
-
rulesBody.exists === false && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3956
|
-
style: hintStyle,
|
|
3957
|
-
children: t("card.rulesMissing")
|
|
3958
|
-
}),
|
|
3959
|
-
rulesBody.truncated === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3960
|
-
style: hintStyle,
|
|
3961
|
-
children: t("card.rulesTruncated")
|
|
3962
|
-
}),
|
|
3963
|
-
(rulesBody.raw ?? "") !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
3964
|
-
style: {
|
|
3965
|
-
margin: "6px 0 0",
|
|
3966
|
-
padding: "8px 10px",
|
|
3967
|
-
maxHeight: "260px",
|
|
3968
|
-
overflow: "auto",
|
|
3969
|
-
borderRadius: "6px",
|
|
3970
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
3971
|
-
background: "var(--dsw-alias-bg-surface, transparent)",
|
|
3972
|
-
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
3973
|
-
color: "var(--dsw-alias-label-primary)",
|
|
3974
|
-
whiteSpace: "pre"
|
|
3975
|
-
},
|
|
3976
|
-
children: rulesBody.raw
|
|
3977
|
-
}),
|
|
3978
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3979
|
-
style: {
|
|
3980
|
-
...hintStyle,
|
|
3981
|
-
margin: 0
|
|
3982
|
-
},
|
|
3983
|
-
children: t("card.rulesNote")
|
|
3984
|
-
})
|
|
3985
|
-
] })
|
|
3986
|
-
]
|
|
3987
|
-
}),
|
|
3988
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3989
|
-
style: sectionStyle,
|
|
3990
|
-
children: [
|
|
3991
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3992
|
-
style: labelStyle,
|
|
3993
|
-
children: t("card.allowlist")
|
|
3994
|
-
}),
|
|
3995
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3996
|
-
style: hintStyle,
|
|
3997
|
-
children: t("card.allowlistHint")
|
|
3998
|
-
}),
|
|
3999
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4000
|
-
style: hintStyle,
|
|
4001
|
-
children: t("card.allowlistPresetNote")
|
|
4002
|
-
}),
|
|
4003
|
-
patterns.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4004
|
-
style: {
|
|
4005
|
-
padding: "6px 0",
|
|
4006
|
-
fontSize: "12px",
|
|
4007
|
-
color: "var(--dsw-alias-label-tertiary)"
|
|
4008
|
-
},
|
|
4009
|
-
children: t("card.allowlistEmpty")
|
|
4010
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4011
|
-
style: {
|
|
4012
|
-
display: "flex",
|
|
4013
|
-
flexDirection: "column",
|
|
4014
|
-
gap: "4px",
|
|
4015
|
-
margin: "6px 0"
|
|
4016
|
-
},
|
|
4017
|
-
children: patterns.map((pattern, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4018
|
-
style: {
|
|
4019
|
-
display: "flex",
|
|
4020
|
-
alignItems: "center",
|
|
4021
|
-
gap: "8px",
|
|
4022
|
-
padding: "4px 8px",
|
|
4023
|
-
borderRadius: "6px",
|
|
4024
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
4025
|
-
background: "var(--dsw-alias-bg-surface, transparent)"
|
|
4026
|
-
},
|
|
4027
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
4028
|
-
style: {
|
|
4029
|
-
flex: "1 1 auto",
|
|
4030
|
-
minWidth: 0,
|
|
4031
|
-
overflowWrap: "anywhere",
|
|
4032
|
-
font: "500 12px/18px var(--ds-font-family-code, monospace)",
|
|
4033
|
-
color: "var(--dsw-alias-label-primary)"
|
|
4034
|
-
},
|
|
4035
|
-
children: pattern
|
|
4036
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4037
|
-
type: "button",
|
|
4038
|
-
"aria-label": t("card.allowlistRemove"),
|
|
4039
|
-
title: t("card.allowlistRemove"),
|
|
4040
|
-
disabled: readonly,
|
|
4041
|
-
onClick: () => {
|
|
4042
|
-
removePattern(index);
|
|
4043
|
-
},
|
|
4044
|
-
style: {
|
|
4045
|
-
flex: "0 0 auto",
|
|
4046
|
-
width: "20px",
|
|
4047
|
-
height: "20px",
|
|
4048
|
-
border: "none",
|
|
4049
|
-
borderRadius: "999px",
|
|
4050
|
-
background: "transparent",
|
|
4051
|
-
color: "var(--dsw-alias-label-tertiary)",
|
|
4052
|
-
cursor: readonly ? "default" : "pointer"
|
|
4053
|
-
},
|
|
4054
|
-
children: "✕"
|
|
4055
|
-
})]
|
|
4056
|
-
}, `${index}:${pattern}`))
|
|
4057
|
-
}),
|
|
4058
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4059
|
-
style: {
|
|
4060
|
-
display: "flex",
|
|
4061
|
-
gap: "6px",
|
|
4062
|
-
marginTop: "6px"
|
|
4063
|
-
},
|
|
4064
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4065
|
-
type: "text",
|
|
4066
|
-
value: addDraft,
|
|
4067
|
-
disabled: readonly,
|
|
4068
|
-
placeholder: t("card.allowlistPlaceholder"),
|
|
4069
|
-
spellCheck: false,
|
|
4070
|
-
style: {
|
|
4071
|
-
...controlStyle,
|
|
4072
|
-
flex: "1 1 auto",
|
|
4073
|
-
minWidth: 0
|
|
4074
|
-
},
|
|
4075
|
-
onChange: (event) => {
|
|
4076
|
-
setAddDraft(event.currentTarget.value);
|
|
4077
|
-
},
|
|
4078
|
-
onKeyDown: (event) => {
|
|
4079
|
-
if (event.key === "Enter") addPattern();
|
|
4080
|
-
}
|
|
4081
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4082
|
-
type: "button",
|
|
4083
|
-
disabled: readonly || addDraft.trim() === "",
|
|
4084
|
-
onClick: addPattern,
|
|
4085
|
-
style: {
|
|
4086
|
-
...controlStyle,
|
|
4087
|
-
flex: "0 0 auto",
|
|
4088
|
-
cursor: readonly || addDraft.trim() === "" ? "default" : "pointer",
|
|
4089
|
-
opacity: readonly || addDraft.trim() === "" ? .5 : 1
|
|
4090
|
-
},
|
|
4091
|
-
children: t("card.allowlistAdd")
|
|
4092
|
-
})]
|
|
4093
|
-
}),
|
|
4094
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4095
|
-
style: {
|
|
4096
|
-
display: "flex",
|
|
4097
|
-
justifyContent: "flex-end",
|
|
4098
|
-
marginTop: "6px"
|
|
4099
|
-
},
|
|
4100
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4101
|
-
type: "button",
|
|
4102
|
-
onClick: () => {
|
|
4103
|
-
setBulkOpen((current) => !current);
|
|
4104
|
-
},
|
|
4105
|
-
style: {
|
|
4106
|
-
...controlStyle,
|
|
4107
|
-
cursor: "pointer",
|
|
4108
|
-
border: "none",
|
|
4109
|
-
background: "transparent",
|
|
4110
|
-
color: "var(--dsw-alias-label-tertiary)"
|
|
4111
|
-
},
|
|
4112
|
-
children: bulkOpen ? t("card.allowlistBulkHide") : t("card.allowlistBulk")
|
|
4113
|
-
})
|
|
4114
|
-
}),
|
|
4115
|
-
bulkOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
4116
|
-
id: "plugin-config-perm-gate-allowlist",
|
|
4117
|
-
value: allowlistShown,
|
|
4118
|
-
disabled: readonly,
|
|
4119
|
-
rows: 6,
|
|
4120
|
-
spellCheck: false,
|
|
4121
|
-
style: {
|
|
4122
|
-
...controlStyle,
|
|
4123
|
-
width: "100%",
|
|
4124
|
-
boxSizing: "border-box",
|
|
4125
|
-
resize: "vertical",
|
|
4126
|
-
fontFamily: "var(--ds-font-family-code, monospace)",
|
|
4127
|
-
whiteSpace: "pre"
|
|
4128
|
-
},
|
|
4129
|
-
onChange: (event) => {
|
|
4130
|
-
setAllowDirty(true);
|
|
4131
|
-
setAllowText(event.currentTarget.value);
|
|
4132
|
-
},
|
|
4133
|
-
onKeyDown: (event) => {
|
|
4134
|
-
if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) commitAllowlist();
|
|
4135
|
-
}
|
|
4136
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4137
|
-
style: {
|
|
4138
|
-
display: "flex",
|
|
4139
|
-
justifyContent: "flex-end",
|
|
4140
|
-
marginTop: "6px"
|
|
4141
|
-
},
|
|
4142
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4143
|
-
type: "button",
|
|
4144
|
-
disabled: readonly || !allowDirty,
|
|
4145
|
-
onClick: commitAllowlist,
|
|
4146
|
-
style: {
|
|
4147
|
-
...controlStyle,
|
|
4148
|
-
cursor: readonly || !allowDirty ? "default" : "pointer",
|
|
4149
|
-
opacity: readonly || !allowDirty ? .5 : 1
|
|
4150
|
-
},
|
|
4151
|
-
children: t("card.allowlistSave")
|
|
4152
|
-
})
|
|
4153
|
-
})] }) : null
|
|
4154
|
-
]
|
|
4155
|
-
}),
|
|
4156
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
4157
|
-
style: sectionStyle,
|
|
4158
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
4159
|
-
label: t("card.autoAllowTools"),
|
|
4160
|
-
hint: t("card.autoAllowToolsHint"),
|
|
4161
|
-
placeholder: t("card.autoAllowToolsPlaceholder"),
|
|
4162
|
-
addLabel: t("card.denylistAdd"),
|
|
4163
|
-
removeLabel: t("card.listRemove"),
|
|
4164
|
-
items: value.autoAllowTools ?? [],
|
|
4165
|
-
locked: readonly,
|
|
4166
|
-
onAdd: (entry) => {
|
|
4167
|
-
scope.set("autoAllowTools", [...value.autoAllowTools ?? [], entry]);
|
|
4168
|
-
},
|
|
4169
|
-
onRemove: (index) => {
|
|
4170
|
-
scope.set("autoAllowTools", (value.autoAllowTools ?? []).filter((_, i) => i !== index));
|
|
4171
|
-
}
|
|
4172
|
-
})
|
|
4173
|
-
}),
|
|
4174
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4175
|
-
style: sectionStyle,
|
|
4176
|
-
children: [
|
|
4177
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
4178
|
-
label: t("card.credentialPaths"),
|
|
4179
|
-
hint: t("card.credentialPathsHint"),
|
|
4180
|
-
placeholder: t("card.credentialPathsPlaceholder"),
|
|
4181
|
-
addLabel: t("card.denylistAdd"),
|
|
4182
|
-
removeLabel: t("card.listRemove"),
|
|
4183
|
-
items: value.credentialPaths ?? [],
|
|
4184
|
-
locked: readonly,
|
|
4185
|
-
onAdd: (entry) => {
|
|
4186
|
-
scope.set("credentialPaths", [...value.credentialPaths ?? [], entry]);
|
|
4187
|
-
},
|
|
4188
|
-
onRemove: (index) => {
|
|
4189
|
-
scope.set("credentialPaths", (value.credentialPaths ?? []).filter((_, i) => i !== index));
|
|
4190
|
-
}
|
|
4191
|
-
}),
|
|
4192
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "10px" } }),
|
|
4193
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
4194
|
-
label: t("card.denyKeywordsExtra"),
|
|
4195
|
-
hint: t("card.denyKeywordsExtraHint"),
|
|
4196
|
-
placeholder: t("card.denylistPlaceholder"),
|
|
4197
|
-
addLabel: t("card.denylistAdd"),
|
|
4198
|
-
removeLabel: t("card.listRemove"),
|
|
4199
|
-
items: value.denyKeywordsExtra ?? [],
|
|
4200
|
-
locked: readonly,
|
|
4201
|
-
onAdd: (entry) => {
|
|
4202
|
-
scope.set("denyKeywordsExtra", [...value.denyKeywordsExtra ?? [], entry]);
|
|
4203
|
-
},
|
|
4204
|
-
onRemove: (index) => {
|
|
4205
|
-
scope.set("denyKeywordsExtra", (value.denyKeywordsExtra ?? []).filter((_, i) => i !== index));
|
|
4206
|
-
}
|
|
4207
|
-
}),
|
|
4208
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "10px" } }),
|
|
4209
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
4210
|
-
label: t("card.extraContentArgKeys"),
|
|
4211
|
-
hint: t("card.extraContentArgKeysHint"),
|
|
4212
|
-
placeholder: t("card.extraContentArgKeysPlaceholder"),
|
|
4213
|
-
addLabel: t("card.denylistAdd"),
|
|
4214
|
-
removeLabel: t("card.listRemove"),
|
|
4215
|
-
items: value.extraContentArgKeys ?? [],
|
|
4216
|
-
locked: readonly,
|
|
4217
|
-
onAdd: (entry) => {
|
|
4218
|
-
scope.set("extraContentArgKeys", [...value.extraContentArgKeys ?? [], entry]);
|
|
4219
|
-
},
|
|
4220
|
-
onRemove: (index) => {
|
|
4221
|
-
scope.set("extraContentArgKeys", (value.extraContentArgKeys ?? []).filter((_, i) => i !== index));
|
|
4222
|
-
}
|
|
4223
|
-
}),
|
|
4224
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "10px" } }),
|
|
4225
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
4226
|
-
label: t("card.extraOperationArgKeys"),
|
|
4227
|
-
hint: t("card.extraOperationArgKeysHint"),
|
|
4228
|
-
placeholder: t("card.extraContentArgKeysPlaceholder"),
|
|
4229
|
-
addLabel: t("card.denylistAdd"),
|
|
4230
|
-
removeLabel: t("card.listRemove"),
|
|
4231
|
-
items: value.extraOperationArgKeys ?? [],
|
|
4232
|
-
locked: readonly,
|
|
4233
|
-
onAdd: (entry) => {
|
|
4234
|
-
scope.set("extraOperationArgKeys", [...value.extraOperationArgKeys ?? [], entry]);
|
|
4235
|
-
},
|
|
4236
|
-
onRemove: (index) => {
|
|
4237
|
-
scope.set("extraOperationArgKeys", (value.extraOperationArgKeys ?? []).filter((_, i) => i !== index));
|
|
4238
|
-
}
|
|
4239
|
-
})
|
|
4240
|
-
]
|
|
4241
|
-
}),
|
|
4242
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredLadderSection, {
|
|
4243
|
-
t,
|
|
4244
|
-
readonly
|
|
4245
|
-
}),
|
|
4246
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4247
|
-
style: sectionStyle,
|
|
4248
|
-
children: [
|
|
4249
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4250
|
-
style: labelStyle,
|
|
4251
|
-
children: t("card.denylist")
|
|
4252
|
-
}),
|
|
4253
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4254
|
-
style: hintStyle,
|
|
4255
|
-
children: t("card.denylistHint")
|
|
4256
|
-
}),
|
|
4257
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4258
|
-
style: {
|
|
4259
|
-
display: "flex",
|
|
4260
|
-
flexDirection: "column",
|
|
4261
|
-
gap: "4px",
|
|
4262
|
-
margin: "6px 0"
|
|
4263
|
-
},
|
|
4264
|
-
children: denylist.map((keyword, index) => {
|
|
4265
|
-
const preset = DEFAULT_DENY_KEYWORDS.includes(keyword);
|
|
4266
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4267
|
-
style: {
|
|
4268
|
-
display: "flex",
|
|
4269
|
-
alignItems: "center",
|
|
4270
|
-
gap: "8px",
|
|
4271
|
-
padding: "4px 8px",
|
|
4272
|
-
borderRadius: "6px",
|
|
4273
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
4274
|
-
background: "var(--dsw-alias-bg-surface, transparent)"
|
|
4275
|
-
},
|
|
5177
|
+
}),
|
|
5178
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
5179
|
+
style: sectionStyle,
|
|
4276
5180
|
children: [
|
|
4277
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
5181
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
5182
|
+
label: t("card.denyKeywordsExtra"),
|
|
5183
|
+
hint: t("card.denyKeywordsExtraHint"),
|
|
5184
|
+
placeholder: t("card.denylistPlaceholder"),
|
|
5185
|
+
addLabel: t("card.denylistAdd"),
|
|
5186
|
+
removeLabel: t("card.listRemove"),
|
|
5187
|
+
items: value.denyKeywordsExtra ?? [],
|
|
5188
|
+
locked: readonly,
|
|
5189
|
+
onAdd: (entry) => {
|
|
5190
|
+
scope.set("denyKeywordsExtra", [...value.denyKeywordsExtra ?? [], entry]);
|
|
5191
|
+
},
|
|
5192
|
+
onRemove: (index) => {
|
|
5193
|
+
scope.set("denyKeywordsExtra", (value.denyKeywordsExtra ?? []).filter((_, i) => i !== index));
|
|
5194
|
+
}
|
|
5195
|
+
}),
|
|
5196
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "10px" } }),
|
|
5197
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
5198
|
+
label: t("card.extraContentArgKeys"),
|
|
5199
|
+
hint: t("card.extraContentArgKeysHint"),
|
|
5200
|
+
placeholder: t("card.extraContentArgKeysPlaceholder"),
|
|
5201
|
+
addLabel: t("card.denylistAdd"),
|
|
5202
|
+
removeLabel: t("card.listRemove"),
|
|
5203
|
+
items: value.extraContentArgKeys ?? [],
|
|
5204
|
+
locked: readonly,
|
|
5205
|
+
onAdd: (entry) => {
|
|
5206
|
+
scope.set("extraContentArgKeys", [...value.extraContentArgKeys ?? [], entry]);
|
|
4284
5207
|
},
|
|
4285
|
-
|
|
5208
|
+
onRemove: (index) => {
|
|
5209
|
+
scope.set("extraContentArgKeys", (value.extraContentArgKeys ?? []).filter((_, i) => i !== index));
|
|
5210
|
+
}
|
|
4286
5211
|
}),
|
|
4287
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
5212
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "10px" } }),
|
|
5213
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
5214
|
+
label: t("card.extraOperationArgKeys"),
|
|
5215
|
+
hint: t("card.extraOperationArgKeysHint"),
|
|
5216
|
+
placeholder: t("card.extraContentArgKeysPlaceholder"),
|
|
5217
|
+
addLabel: t("card.denylistAdd"),
|
|
5218
|
+
removeLabel: t("card.listRemove"),
|
|
5219
|
+
items: value.extraOperationArgKeys ?? [],
|
|
5220
|
+
locked: readonly,
|
|
5221
|
+
onAdd: (entry) => {
|
|
5222
|
+
scope.set("extraOperationArgKeys", [...value.extraOperationArgKeys ?? [], entry]);
|
|
5223
|
+
},
|
|
5224
|
+
onRemove: (index) => {
|
|
5225
|
+
scope.set("extraOperationArgKeys", (value.extraOperationArgKeys ?? []).filter((_, i) => i !== index));
|
|
5226
|
+
}
|
|
5227
|
+
})
|
|
5228
|
+
]
|
|
5229
|
+
}),
|
|
5230
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
5231
|
+
style: sectionStyle,
|
|
5232
|
+
children: [
|
|
5233
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5234
|
+
style: labelStyle,
|
|
5235
|
+
children: t("card.denylist")
|
|
5236
|
+
}),
|
|
5237
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5238
|
+
style: hintStyle,
|
|
5239
|
+
children: t("card.denylistHint")
|
|
5240
|
+
}),
|
|
5241
|
+
customDeny.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4288
5242
|
style: {
|
|
4289
|
-
|
|
4290
|
-
fontSize: "
|
|
4291
|
-
lineHeight: "16px",
|
|
4292
|
-
padding: "0 6px",
|
|
4293
|
-
borderRadius: "8px",
|
|
4294
|
-
color: preset ? "var(--dsw-alias-label-tertiary)" : "var(--dsw-alias-label-secondary, inherit)",
|
|
4295
|
-
border: "1px solid var(--dsw-alias-border-l2)"
|
|
5243
|
+
...labelStyle,
|
|
5244
|
+
fontSize: "12px"
|
|
4296
5245
|
},
|
|
4297
|
-
children:
|
|
5246
|
+
children: t("card.denylistCustom")
|
|
4298
5247
|
}),
|
|
4299
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
5248
|
+
customDeny.map((pair) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5249
|
+
style: { margin: "6px 0" },
|
|
5250
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DenyRow, {
|
|
5251
|
+
keyword: pair.keyword,
|
|
5252
|
+
index: pair.index,
|
|
5253
|
+
muted: false,
|
|
5254
|
+
locked: readonly,
|
|
5255
|
+
removeLabel: t("card.denylistRemove"),
|
|
5256
|
+
onRemove: removeDeny
|
|
5257
|
+
})
|
|
5258
|
+
}, `${pair.index}:${pair.keyword}`)),
|
|
5259
|
+
presetDeny.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4300
5260
|
type: "button",
|
|
4301
|
-
"aria-
|
|
4302
|
-
title: t("card.denylistRemove"),
|
|
4303
|
-
disabled: readonly,
|
|
5261
|
+
"aria-expanded": presetDenyOpen,
|
|
4304
5262
|
onClick: () => {
|
|
4305
|
-
|
|
5263
|
+
setPresetDenyOpen((current) => !current);
|
|
4306
5264
|
},
|
|
4307
5265
|
style: {
|
|
4308
|
-
|
|
4309
|
-
width: "
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
borderRadius: "999px",
|
|
4313
|
-
background: "transparent",
|
|
4314
|
-
color: "var(--dsw-alias-label-tertiary)",
|
|
4315
|
-
cursor: readonly ? "default" : "pointer"
|
|
5266
|
+
...drawerHeaderStyle,
|
|
5267
|
+
width: "auto",
|
|
5268
|
+
alignSelf: "flex-start",
|
|
5269
|
+
padding: "6px 4px"
|
|
4316
5270
|
},
|
|
4317
|
-
children: "
|
|
4318
|
-
|
|
5271
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
5272
|
+
width: "12",
|
|
5273
|
+
height: "12",
|
|
5274
|
+
viewBox: "0 0 16 16",
|
|
5275
|
+
"aria-hidden": true,
|
|
5276
|
+
style: {
|
|
5277
|
+
color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))",
|
|
5278
|
+
flex: "0 0 auto",
|
|
5279
|
+
transition: "transform 0.16s",
|
|
5280
|
+
transform: presetDenyOpen ? "rotate(180deg)" : "none"
|
|
5281
|
+
},
|
|
5282
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
5283
|
+
d: "M4 6l4 4 4-4",
|
|
5284
|
+
fill: "none",
|
|
5285
|
+
stroke: "currentColor",
|
|
5286
|
+
strokeWidth: "1.5",
|
|
5287
|
+
strokeLinecap: "round",
|
|
5288
|
+
strokeLinejoin: "round"
|
|
5289
|
+
})
|
|
5290
|
+
}), t("card.denylistPresetCollapse").replace("%n", String(presetDeny.length))]
|
|
5291
|
+
}), presetDenyOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5292
|
+
style: {
|
|
5293
|
+
display: "flex",
|
|
5294
|
+
flexDirection: "column",
|
|
5295
|
+
gap: "4px",
|
|
5296
|
+
margin: "6px 0"
|
|
5297
|
+
},
|
|
5298
|
+
children: presetDeny.map((pair) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DenyRow, {
|
|
5299
|
+
keyword: pair.keyword,
|
|
5300
|
+
index: pair.index,
|
|
5301
|
+
muted: true,
|
|
5302
|
+
locked: readonly,
|
|
5303
|
+
removeLabel: t("card.denylistRemove"),
|
|
5304
|
+
onRemove: removeDeny
|
|
5305
|
+
}, `${pair.index}:${pair.keyword}`))
|
|
5306
|
+
}) : null] }),
|
|
5307
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5308
|
+
style: {
|
|
5309
|
+
display: "flex",
|
|
5310
|
+
gap: "6px",
|
|
5311
|
+
marginTop: "6px"
|
|
5312
|
+
},
|
|
5313
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5314
|
+
type: "text",
|
|
5315
|
+
value: denyDraft,
|
|
5316
|
+
disabled: readonly,
|
|
5317
|
+
placeholder: t("card.denylistPlaceholder"),
|
|
5318
|
+
spellCheck: false,
|
|
5319
|
+
style: {
|
|
5320
|
+
...controlStyle,
|
|
5321
|
+
flex: "1 1 auto",
|
|
5322
|
+
minWidth: 0
|
|
5323
|
+
},
|
|
5324
|
+
onChange: (event) => {
|
|
5325
|
+
setDenyDraft(event.currentTarget.value);
|
|
5326
|
+
},
|
|
5327
|
+
onKeyDown: (event) => {
|
|
5328
|
+
if (event.key === "Enter") addDeny();
|
|
5329
|
+
}
|
|
5330
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5331
|
+
type: "button",
|
|
5332
|
+
disabled: readonly || denyDraft.trim() === "",
|
|
5333
|
+
onClick: addDeny,
|
|
5334
|
+
style: {
|
|
5335
|
+
...controlStyle,
|
|
5336
|
+
flex: "0 0 auto",
|
|
5337
|
+
cursor: readonly || denyDraft.trim() === "" ? "default" : "pointer",
|
|
5338
|
+
opacity: readonly || denyDraft.trim() === "" ? .5 : 1
|
|
5339
|
+
},
|
|
5340
|
+
children: t("card.denylistAdd")
|
|
5341
|
+
})]
|
|
5342
|
+
}),
|
|
5343
|
+
denyActive ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5344
|
+
style: {
|
|
5345
|
+
display: "flex",
|
|
5346
|
+
justifyContent: "flex-end",
|
|
5347
|
+
marginTop: "6px"
|
|
5348
|
+
},
|
|
5349
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5350
|
+
type: "button",
|
|
5351
|
+
disabled: readonly,
|
|
5352
|
+
onClick: restoreDeny,
|
|
5353
|
+
style: {
|
|
5354
|
+
...controlStyle,
|
|
5355
|
+
cursor: readonly ? "default" : "pointer",
|
|
5356
|
+
border: "none",
|
|
5357
|
+
background: "transparent",
|
|
5358
|
+
color: "var(--dsw-alias-label-tertiary)"
|
|
5359
|
+
},
|
|
5360
|
+
children: t("card.denylistRestore")
|
|
5361
|
+
})
|
|
5362
|
+
}) : null
|
|
4319
5363
|
]
|
|
4320
|
-
}
|
|
4321
|
-
|
|
5364
|
+
})
|
|
5365
|
+
]
|
|
4322
5366
|
}),
|
|
4323
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
disabled: readonly || denyDraft.trim() === "",
|
|
4349
|
-
onClick: addDeny,
|
|
4350
|
-
style: {
|
|
4351
|
-
...controlStyle,
|
|
4352
|
-
flex: "0 0 auto",
|
|
4353
|
-
cursor: readonly || denyDraft.trim() === "" ? "default" : "pointer",
|
|
4354
|
-
opacity: readonly || denyDraft.trim() === "" ? .5 : 1
|
|
4355
|
-
},
|
|
4356
|
-
children: t("card.denylistAdd")
|
|
5367
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
|
|
5368
|
+
id: "pg-drawer-credentials",
|
|
5369
|
+
title: t("card.credentials"),
|
|
5370
|
+
summary: credSummary,
|
|
5371
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
5372
|
+
style: sectionStyle,
|
|
5373
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
|
|
5374
|
+
label: t("card.credentialPaths"),
|
|
5375
|
+
hint: t("card.credentialPathsHint"),
|
|
5376
|
+
placeholder: t("card.credentialPathsPlaceholder"),
|
|
5377
|
+
addLabel: t("card.denylistAdd"),
|
|
5378
|
+
removeLabel: t("card.listRemove"),
|
|
5379
|
+
items: value.credentialPaths ?? [],
|
|
5380
|
+
locked: readonly,
|
|
5381
|
+
onAdd: (entry) => {
|
|
5382
|
+
scope.set("credentialPaths", [...value.credentialPaths ?? [], entry]);
|
|
5383
|
+
},
|
|
5384
|
+
onRemove: (index) => {
|
|
5385
|
+
scope.set("credentialPaths", (value.credentialPaths ?? []).filter((_, i) => i !== index));
|
|
5386
|
+
}
|
|
5387
|
+
})
|
|
5388
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredLadderSection, {
|
|
5389
|
+
t,
|
|
5390
|
+
readonly,
|
|
5391
|
+
onRungs: handleCredRungs
|
|
4357
5392
|
})]
|
|
4358
5393
|
}),
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
style: {
|
|
4426
|
-
display: "flex",
|
|
4427
|
-
alignItems: "center",
|
|
4428
|
-
gap: "8px",
|
|
4429
|
-
marginTop: "6px"
|
|
4430
|
-
},
|
|
4431
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4432
|
-
id: "plugin-config-perm-gate-network-inject-env",
|
|
4433
|
-
label: t("card.networkInjectEnv"),
|
|
4434
|
-
checked: value.networkInjectEnv !== false,
|
|
4435
|
-
disabled: readonly,
|
|
4436
|
-
onCommit: (next) => scope.set("networkInjectEnv", next)
|
|
4437
|
-
})
|
|
4438
|
-
})
|
|
4439
|
-
]
|
|
4440
|
-
}),
|
|
4441
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
4442
|
-
style: sectionStyle,
|
|
4443
|
-
children: [
|
|
4444
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4445
|
-
style: labelStyle,
|
|
4446
|
-
children: t("card.watch")
|
|
4447
|
-
}),
|
|
4448
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4449
|
-
style: hintStyle,
|
|
4450
|
-
children: t("card.watchHint")
|
|
4451
|
-
}),
|
|
4452
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4453
|
-
style: {
|
|
4454
|
-
display: "flex",
|
|
4455
|
-
alignItems: "center",
|
|
4456
|
-
gap: "8px",
|
|
4457
|
-
marginTop: "6px"
|
|
4458
|
-
},
|
|
4459
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
4460
|
-
id: "plugin-config-perm-gate-watch",
|
|
4461
|
-
label: t("card.watch"),
|
|
4462
|
-
checked: value.watch !== false,
|
|
4463
|
-
disabled: readonly,
|
|
4464
|
-
onCommit: (next) => scope.set("watch", next)
|
|
4465
|
-
})
|
|
5394
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
|
|
5395
|
+
id: "pg-drawer-network",
|
|
5396
|
+
title: t("card.networkOps"),
|
|
5397
|
+
summary: networkSummary,
|
|
5398
|
+
children: [
|
|
5399
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5400
|
+
style: rowStyle,
|
|
5401
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5402
|
+
htmlFor: "plugin-config-perm-gate-network-enabled",
|
|
5403
|
+
style: { fontSize: "12px" },
|
|
5404
|
+
children: t("card.networkEnabled")
|
|
5405
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
5406
|
+
id: "plugin-config-perm-gate-network-enabled",
|
|
5407
|
+
label: t("card.networkEnabled"),
|
|
5408
|
+
checked: value.networkEnabled === true,
|
|
5409
|
+
disabled: readonly,
|
|
5410
|
+
onCommit: (next) => scope.set("networkEnabled", next)
|
|
5411
|
+
})]
|
|
5412
|
+
}),
|
|
5413
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5414
|
+
style: hintStyle,
|
|
5415
|
+
children: t("card.networkEnabledHint")
|
|
5416
|
+
}),
|
|
5417
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5418
|
+
style: hintStyle,
|
|
5419
|
+
children: t("card.networkRebindNote")
|
|
5420
|
+
}),
|
|
5421
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "8px" } }),
|
|
5422
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5423
|
+
style: rowStyle,
|
|
5424
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5425
|
+
htmlFor: "plugin-config-perm-gate-network-inject-env",
|
|
5426
|
+
style: { fontSize: "12px" },
|
|
5427
|
+
children: t("card.networkInjectEnv")
|
|
5428
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
5429
|
+
id: "plugin-config-perm-gate-network-inject-env",
|
|
5430
|
+
label: t("card.networkInjectEnv"),
|
|
5431
|
+
checked: value.networkInjectEnv !== false,
|
|
5432
|
+
disabled: readonly,
|
|
5433
|
+
onCommit: (next) => scope.set("networkInjectEnv", next)
|
|
5434
|
+
})]
|
|
5435
|
+
}),
|
|
5436
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5437
|
+
style: hintStyle,
|
|
5438
|
+
children: t("card.networkInjectEnvHint")
|
|
5439
|
+
}),
|
|
5440
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "8px" } }),
|
|
5441
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5442
|
+
style: rowStyle,
|
|
5443
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5444
|
+
htmlFor: "plugin-config-perm-gate-watch",
|
|
5445
|
+
style: { fontSize: "12px" },
|
|
5446
|
+
children: t("card.watch")
|
|
5447
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
5448
|
+
id: "plugin-config-perm-gate-watch",
|
|
5449
|
+
label: t("card.watch"),
|
|
5450
|
+
checked: value.watch !== false,
|
|
5451
|
+
disabled: readonly,
|
|
5452
|
+
onCommit: (next) => scope.set("watch", next)
|
|
5453
|
+
})]
|
|
5454
|
+
}),
|
|
5455
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5456
|
+
style: hintStyle,
|
|
5457
|
+
children: t("card.watchHint")
|
|
5458
|
+
})
|
|
5459
|
+
]
|
|
4466
5460
|
})
|
|
4467
5461
|
]
|
|
4468
5462
|
}),
|
|
@@ -4473,13 +5467,21 @@ window.__ModuleLoader__.load({
|
|
|
4473
5467
|
color: "var(--dsw-alias-label-tertiary)"
|
|
4474
5468
|
},
|
|
4475
5469
|
children: t("card.readonly")
|
|
5470
|
+
}),
|
|
5471
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5472
|
+
style: { margin: "10px 0 0" },
|
|
5473
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GuideRestartButton, {
|
|
5474
|
+
ns: "perm-gate",
|
|
5475
|
+
onOpen: () => {
|
|
5476
|
+
setGuideOpen(true);
|
|
5477
|
+
}
|
|
5478
|
+
})
|
|
4476
5479
|
})
|
|
4477
5480
|
] })
|
|
4478
5481
|
}) : null]
|
|
4479
5482
|
});
|
|
4480
5483
|
}
|
|
4481
|
-
|
|
4482
|
-
//#region src/client/feed.ts
|
|
5484
|
+
// src/client/feed.ts
|
|
4483
5485
|
/** Fetch decision events for one session; `since > 0` returns only newer ones. */
|
|
4484
5486
|
async function fetchEvents(sessionId, since) {
|
|
4485
5487
|
const query = `/api/dsh-perm-gate/events?sessionId=${encodeURIComponent(sessionId)}${since > 0 ? `&since=${since}` : ""}`;
|
|
@@ -4646,40 +5648,41 @@ window.__ModuleLoader__.load({
|
|
|
4646
5648
|
}
|
|
4647
5649
|
}
|
|
4648
5650
|
/**
|
|
4649
|
-
* Decision-path labels shown beside an event's tool name.
|
|
4650
|
-
* `
|
|
4651
|
-
*
|
|
5651
|
+
* Decision-path labels shown beside an event's tool name. The values are
|
|
5652
|
+
* `verdict.*` dictionary keys (not copy): the history view renders them
|
|
5653
|
+
* through `tr()`, so ru/es read their own language instead of the Chinese
|
|
5654
|
+
* source. An unknown verdict falls through to its raw string.
|
|
4652
5655
|
*/
|
|
4653
5656
|
const VERDICT_LABELS = {
|
|
4654
|
-
rule: "
|
|
4655
|
-
grant: "
|
|
4656
|
-
"hard-deny": "
|
|
4657
|
-
"deny-keyword": "
|
|
4658
|
-
default: "
|
|
4659
|
-
ask: "
|
|
4660
|
-
permissive: "
|
|
4661
|
-
classifier: "
|
|
4662
|
-
"llm-safe": "
|
|
4663
|
-
"llm-learned": "
|
|
4664
|
-
"learned-sediment": "
|
|
4665
|
-
"learned-confirm": "
|
|
4666
|
-
"human-approved": "
|
|
4667
|
-
"human-rejected": "
|
|
4668
|
-
"human-cancelled": "
|
|
4669
|
-
"no-approval-channel": "
|
|
4670
|
-
"preset-passthrough": "
|
|
4671
|
-
"stand-down": "
|
|
4672
|
-
"yolo-allow": "
|
|
4673
|
-
"yolo-allow-no-reviewer": "
|
|
4674
|
-
"yolo-block": "
|
|
4675
|
-
"rules-fallback-allow": "
|
|
4676
|
-
"rules-fallback-block": "
|
|
4677
|
-
"safety-net-passthrough-allow": "
|
|
4678
|
-
"safety-net-passthrough-block": "
|
|
4679
|
-
"cleanup-safe": "
|
|
4680
|
-
"escalation-auto": "
|
|
4681
|
-
"learned-granted": "
|
|
4682
|
-
"network-ask": "
|
|
5657
|
+
rule: "verdict.rule",
|
|
5658
|
+
grant: "verdict.grant",
|
|
5659
|
+
"hard-deny": "verdict.hard-deny",
|
|
5660
|
+
"deny-keyword": "verdict.deny-keyword",
|
|
5661
|
+
default: "verdict.default",
|
|
5662
|
+
ask: "verdict.ask",
|
|
5663
|
+
permissive: "verdict.permissive",
|
|
5664
|
+
classifier: "verdict.classifier",
|
|
5665
|
+
"llm-safe": "verdict.llm-safe",
|
|
5666
|
+
"llm-learned": "verdict.llm-learned",
|
|
5667
|
+
"learned-sediment": "verdict.learned-sediment",
|
|
5668
|
+
"learned-confirm": "verdict.learned-confirm",
|
|
5669
|
+
"human-approved": "verdict.human-approved",
|
|
5670
|
+
"human-rejected": "verdict.human-rejected",
|
|
5671
|
+
"human-cancelled": "verdict.human-cancelled",
|
|
5672
|
+
"no-approval-channel": "verdict.no-approval-channel",
|
|
5673
|
+
"preset-passthrough": "verdict.preset-passthrough",
|
|
5674
|
+
"stand-down": "verdict.stand-down",
|
|
5675
|
+
"yolo-allow": "verdict.yolo-allow",
|
|
5676
|
+
"yolo-allow-no-reviewer": "verdict.yolo-allow-no-reviewer",
|
|
5677
|
+
"yolo-block": "verdict.yolo-block",
|
|
5678
|
+
"rules-fallback-allow": "verdict.rules-fallback-allow",
|
|
5679
|
+
"rules-fallback-block": "verdict.rules-fallback-block",
|
|
5680
|
+
"safety-net-passthrough-allow": "verdict.safety-net-passthrough-allow",
|
|
5681
|
+
"safety-net-passthrough-block": "verdict.safety-net-passthrough-block",
|
|
5682
|
+
"cleanup-safe": "verdict.cleanup-safe",
|
|
5683
|
+
"escalation-auto": "verdict.escalation-auto",
|
|
5684
|
+
"learned-granted": "verdict.learned-granted",
|
|
5685
|
+
"network-ask": "verdict.network-ask"
|
|
4683
5686
|
};
|
|
4684
5687
|
/** Compact wall-clock rendering of an ISO timestamp. */
|
|
4685
5688
|
function clockTime(iso) {
|
|
@@ -4767,8 +5770,7 @@ window.__ModuleLoader__.load({
|
|
|
4767
5770
|
};
|
|
4768
5771
|
}
|
|
4769
5772
|
}
|
|
4770
|
-
|
|
4771
|
-
//#region src/client/notice.tsx
|
|
5773
|
+
// src/client/notice.tsx
|
|
4772
5774
|
/**
|
|
4773
5775
|
* Gate decision notice strip — the `conversation.input.dock` face of
|
|
4774
5776
|
* dsh-perm-gate (a simplified version of the review-feed pattern demonstrated
|
|
@@ -4900,8 +5902,7 @@ window.__ModuleLoader__.load({
|
|
|
4900
5902
|
]
|
|
4901
5903
|
});
|
|
4902
5904
|
}
|
|
4903
|
-
|
|
4904
|
-
//#region src/client/history.tsx
|
|
5905
|
+
// src/client/history.tsx
|
|
4905
5906
|
/**
|
|
4906
5907
|
* Approval-history view — the `conversation.view` face of dsh-perm-gate,
|
|
4907
5908
|
* following the session-scoped review-page pattern demonstrated by
|
|
@@ -5434,7 +6435,8 @@ window.__ModuleLoader__.load({
|
|
|
5434
6435
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: events.map((ev) => {
|
|
5435
6436
|
const style = presentation(ev.kind);
|
|
5436
6437
|
const mark = glyphOf(ev.kind);
|
|
5437
|
-
const
|
|
6438
|
+
const label = ev.verdict === void 0 ? void 0 : VERDICT_LABELS[ev.verdict];
|
|
6439
|
+
const verdict = ev.verdict === void 0 ? "" : label === void 0 ? ev.verdict : t(label);
|
|
5438
6440
|
const files = ev.files ?? [];
|
|
5439
6441
|
const chips = [];
|
|
5440
6442
|
const seenBase = /* @__PURE__ */ new Set();
|
|
@@ -5640,8 +6642,7 @@ window.__ModuleLoader__.load({
|
|
|
5640
6642
|
]
|
|
5641
6643
|
});
|
|
5642
6644
|
}
|
|
5643
|
-
|
|
5644
|
-
//#region src/client/compat.ts
|
|
6645
|
+
// src/client/compat.ts
|
|
5645
6646
|
/**
|
|
5646
6647
|
* Resolve the plugin's durable settings scope through whichever service this
|
|
5647
6648
|
* host line carries, then hand it to `onScope` exactly once.
|
|
@@ -5660,8 +6661,7 @@ window.__ModuleLoader__.load({
|
|
|
5660
6661
|
onScope(settingsScope.bind({ namespace }), "settingsScope");
|
|
5661
6662
|
});
|
|
5662
6663
|
}
|
|
5663
|
-
|
|
5664
|
-
//#region src/client/bridge-scope.ts
|
|
6664
|
+
// src/client/bridge-scope.ts
|
|
5665
6665
|
/** 与 server 侧 bridgeRoutesFor(src/bridge.ts)必须逐字符一致。 */
|
|
5666
6666
|
function bridgeRoutesFor(ns) {
|
|
5667
6667
|
return {
|
|
@@ -5766,8 +6766,7 @@ window.__ModuleLoader__.load({
|
|
|
5766
6766
|
this.notify();
|
|
5767
6767
|
}
|
|
5768
6768
|
};
|
|
5769
|
-
|
|
5770
|
-
//#region src/client/index.ts
|
|
6769
|
+
// src/client/index.ts
|
|
5771
6770
|
/** The profile entry id of this plugin — the `configForms` key (kept in lockstep with cordis.patch.yml). */
|
|
5772
6771
|
const PERMISSIVE_NS = "dsh-perm-gate";
|
|
5773
6772
|
/** Services required by the browser half — generation-neutral only.
|
|
@@ -5840,7 +6839,6 @@ window.__ModuleLoader__.load({
|
|
|
5840
6839
|
}, PermissiveCard));
|
|
5841
6840
|
});
|
|
5842
6841
|
}
|
|
5843
|
-
//#endregion
|
|
5844
6842
|
exports.apply = apply;
|
|
5845
6843
|
exports.inject = inject;
|
|
5846
6844
|
return module.exports;
|