dsh-perm-gate 5.5.9 → 5.6.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/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
- //#region src/client/locales.ts
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.tierScopeHint": "只有落在门禁作用域(%scope)里的预设才会走到这一步;预设不在作用域内时整个门禁停用,任何开关都不会接管它的确认。",
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/凭据/不可逆一律不变。",
@@ -236,13 +248,25 @@ window.__ModuleLoader__.load({
236
248
  "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
249
  "card.permissive": "Enable the 自动审查 tier",
238
250
  "card.permissiveHint": "When off, the gate behaves exactly as before.",
239
- "card.unattended": "Unattended tiers (three implementations — each switch decides whether its own tier exists)",
251
+ "card.unattended": "Unattended tiers",
240
252
  "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
253
  "card.mode.ask": "Keep human",
242
254
  "card.mode.pass": "Mechanical pass-through",
243
255
  "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
256
  "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.tierScopeHint": "Only presets inside the gate's scope (%scope) reach this step; outside it the whole gate stands down, so no switch takes over its confirmations.",
257
+ "card.testing": "Testing & diagnostics",
258
+ "card.lists": "Allow & block lists",
259
+ "card.credentials": "Credential protection",
260
+ "card.networkOps": "Network & hot reload",
261
+ "card.summaryOn": "on",
262
+ "card.summaryOff": "off",
263
+ "card.summaryNone": "none",
264
+ "card.summaryStrategies": "%n enabled",
265
+ "card.summaryLists": "%a allow · %d block",
266
+ "card.summaryCredRw": "readwrite: %n families",
267
+ "card.summaryNetwork": "network %net · hot reload %w",
268
+ "card.denylistPresetCollapse": "Built-in keywords (%n)",
269
+ "card.denylistCustom": "Custom keywords",
246
270
  "card.yolo": "YOLO — never ask a human: block the dangerous, run the rest",
247
271
  "card.yoloExempt": "YOLO: also allow \"unknown location\" inside the workspace",
248
272
  "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.",
@@ -443,13 +467,25 @@ window.__ModuleLoader__.load({
443
467
  "card.description": "read-only / full-access / whitelist と並ぶ独立の承認モード。セッション権限ピッカーでは「自动审查」と表示されます。フロントは単一スイッチのみ。バックエンドの 4 つの承認戦略はこのパネルで組み合わせ可能で、P0 ハード拒否に対して依然 fail-closed。",
444
468
  "card.permissive": "自动审查ティアを有効化",
445
469
  "card.permissiveHint": "オフのときは以前と完全に同じ動作です。",
446
- "card.unattended": "無人確認ティア(3 つの実装 — スイッチは各自のティアの有無を決めます)",
470
+ "card.unattended": "無人確認ティア",
447
471
  "card.unattendedHint": "スイッチは三つ。それぞれ脇に書いたティアだけを制御します。実装をオフにするとそのティアは通常の人確認に戻り、別のティアに化けることはありません。",
448
472
  "card.mode.ask": "人手確認を残す",
449
473
  "card.mode.pass": "機械直通",
450
474
  "card.askHint": "機械スクリーニングは引き続き危険を絞り疑点を列挙しますが、確認は人に残り審査モデルは一度も呼びません — 審査 LLM 未接続、またはトークンを費やさない運用の形です。",
451
475
  "card.passHint": "決定論的な機械審査器のみを実行:不可逆 / 復元不能 / 読めない処理を検知したら遮断して理由を主モデルへ返し、それ以外は実行します。モデル呼び出しゼロ・人手確認なし。approval: never の審査付き版であり、LLM を外した YOLO の劣化形態でもあります。",
452
- "card.tierScopeHint": "このステップまで到達するのはゲートの適用範囲(%scope)内のプリセットだけです。範囲外ではゲート全体が停止し、どのスイッチも確認を代行しません。",
476
+ "card.testing": "テストと診断",
477
+ "card.lists": "許可・ブロックリスト",
478
+ "card.credentials": "資格情報の保護",
479
+ "card.networkOps": "ネットワークとホットリロード",
480
+ "card.summaryOn": "オン",
481
+ "card.summaryOff": "オフ",
482
+ "card.summaryNone": "なし",
483
+ "card.summaryStrategies": "%n 件有効",
484
+ "card.summaryLists": "許可 %a · ブロック %d",
485
+ "card.summaryCredRw": "readwrite: %n ファミリー",
486
+ "card.summaryNetwork": "ネットワーク %net · ホットリロード %w",
487
+ "card.denylistPresetCollapse": "内蔵語(%n)",
488
+ "card.denylistCustom": "カスタム語",
453
489
  "card.yolo": "YOLO — 人工確認は決して求めない:危険のみ遮断、他は実行",
454
490
  "card.yoloExempt": "YOLO:ワークスペース内の「場所不明」も許可",
455
491
  "card.yoloExemptHint": "YOLO 専用。オンのとき、対象の「場所」が特定できないだけの呼び出し(引数なしのツール、本文を読めていない外部スクリプト)は「見えない」としては遮断しません。エンコードされたペイロード、読めないスクリプト本文、削除・リモート書込みは従来通り遮断し、P0/資格情報/不可逆は一切変わりません。",
@@ -650,13 +686,25 @@ window.__ModuleLoader__.load({
650
686
  "card.description": "read-only / full-access / whitelist와 나란한 독립 승인 모드. 세션 권한 선택기에서는 「自动审查」로 표시됩니다. 프론트는 단일 스위치만 노출. 백엔드의 네 가지 승인 전략은 이 패널에서 조합 가능하며 P0 하드 거부에 대해 여전히 fail-closed.",
651
687
  "card.permissive": "自动审查 티어 활성화",
652
688
  "card.permissiveHint": "꺼져 있으면 이전과 완전히 동일하게 동작합니다.",
653
- "card.unattended": "무인 등급(구현 세 개 — 각 스위치가 자기 등급의 존재 여부를 정합니다)",
689
+ "card.unattended": "무인 등급",
654
690
  "card.unattendedHint": "스위치는 셋, 각자 옆에 적힌 등급만 제어합니다. 구현을 끄면 그 등급은 보통의 사람 확인으로 돌아가며, 다른 등급으로 몰래 바뀌지 않습니다.",
655
691
  "card.mode.ask": "사람 확인 유지",
656
692
  "card.mode.pass": "기계 직통과",
657
693
  "card.askHint": "기계 선별로 위험을 걸러 내고 의문점을 적지만, 확인은 그대로 사람에게 남고 심사 모델은 한 번도 부르지 않습니다 — 심사 LLM 미연결이나 토큰을 아끼는 운용에 맞는 형태입니다.",
658
694
  "card.passHint": "결정론적 기계 심사기만 실행:되돌릴 수 없음 / 복원 불가 / 읽히지 않는 처리를 감지하면 차단하고 이유를 주모델에 되돌려 보내며, 나머지는 실행합니다. 모델 호출 0회·사람 확인 없음. approval: never 의 심사판이며, LLM 을 뺀 YOLO 의 열화된 형태이기도 합니다.",
659
- "card.tierScopeHint": "게이트 적용 범위(%scope) 안의 프리셋만 이 단계까지 옵니다. 범위 밖에서는 게이트 전체가 중지되므로 어떤 스위치도 확인을 대신하지 않습니다.",
695
+ "card.testing": "테스트 및 진단",
696
+ "card.lists": "허용·차단 목록",
697
+ "card.credentials": "자격 증명 보호",
698
+ "card.networkOps": "네트워크 및 핫 리로드",
699
+ "card.summaryOn": "켜짐",
700
+ "card.summaryOff": "꺼짐",
701
+ "card.summaryNone": "없음",
702
+ "card.summaryStrategies": "%n개 활성",
703
+ "card.summaryLists": "허용 %a · 차단 %d",
704
+ "card.summaryCredRw": "readwrite: %n개 패밀리",
705
+ "card.summaryNetwork": "네트워크 %net · 핫 리로드 %w",
706
+ "card.denylistPresetCollapse": "내장 키워드(%n)",
707
+ "card.denylistCustom": "사용자 지정 키워드",
660
708
  "card.yolo": "YOLO — 사람 확인은 절대 요구하지 않음: 위험만 차단하고 나머지는 실행",
661
709
  "card.yoloExempt": "YOLO: 워크스페이스 내 “위치 불명”도 허용",
662
710
  "card.yoloExemptHint": "YOLO 전용. 켜면 대상의 “위치”만 확인할 수 없는 호출(인자 없는 도구, 본문을 읽지 못한 외부 스크립트)은 “보이지 않음”으로 차단하지 않습니다. 인코딩된 페이로드, 읽을 수 없는 스크립트 본문, 삭제·원격 쓰기는 계속 차단되며 P0/자격 증명/비가역 작업은 전혀 바뀌지 않습니다.",
@@ -857,13 +905,25 @@ window.__ModuleLoader__.load({
857
905
  "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
906
  "card.permissive": "Activer le niveau d'examen automatique",
859
907
  "card.permissiveHint": "Lorsqu'il est désactivé, la porte se comporte exactement comme avant.",
860
- "card.unattended": "Modes sans supervision (trois implémentations ; chaque interrupteur décide si son palier existe)",
908
+ "card.unattended": "Modes sans supervision",
861
909
  "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
910
  "card.mode.ask": "Garder l'humain",
863
911
  "card.mode.pass": "Passage mécanique",
864
912
  "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
913
  "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.tierScopeHint": "Seuls les préréglages compris dans le périmètre du garde (%scope) atteignent cette étape ; en dehors, le garde s'efface complètement et aucun interrupteur ne prend ses confirmations en charge.",
914
+ "card.testing": "Tests et diagnostic",
915
+ "card.lists": "Listes d'autorisation et de blocage",
916
+ "card.credentials": "Protection des identifiants",
917
+ "card.networkOps": "Réseau et rechargement à chaud",
918
+ "card.summaryOn": "activé",
919
+ "card.summaryOff": "désactivé",
920
+ "card.summaryNone": "aucun",
921
+ "card.summaryStrategies": "%n activées",
922
+ "card.summaryLists": "%a en autorisation · %d en blocage",
923
+ "card.summaryCredRw": "readwrite : %n familles",
924
+ "card.summaryNetwork": "réseau %net · rechargement %w",
925
+ "card.denylistPresetCollapse": "Mots-clés intégrés (%n)",
926
+ "card.denylistCustom": "Mots-clés personnalisés",
867
927
  "card.yolo": "YOLO — ne jamais demander un humain : bloquer le dangereux, exécuter le reste",
868
928
  "card.yoloExempt": "YOLO : autoriser aussi « lieu inconnu » dans l’espace de travail",
869
929
  "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.",
@@ -1064,13 +1124,25 @@ window.__ModuleLoader__.load({
1064
1124
  "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
1125
  "card.permissive": "Stufe „Automatische Überprüfung\" aktivieren",
1066
1126
  "card.permissiveHint": "Wenn deaktiviert, verhält sich das Gate genau wie zuvor.",
1067
- "card.unattended": "Unbeaufsichtigte Stufen (drei Implementierungen; jeder Schalter entscheidet, ob seine Stufe existiert)",
1127
+ "card.unattended": "Unbeaufsichtigte Stufen",
1068
1128
  "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
1129
  "card.mode.ask": "Mensch behalten",
1070
1130
  "card.mode.pass": "Mechanischer Durchlass",
1071
1131
  "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
1132
  "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.tierScopeHint": "Nur Presets innerhalb des Gate-Umfangs (%scope) erreichen diesen Schritt; außerhalb davon schaltet sich das Gate komplett ab, kein Schalter übernimmt dann dessen Bestätigungen.",
1133
+ "card.testing": "Tests & Diagnose",
1134
+ "card.lists": "Zulassungs- & Blocklisten",
1135
+ "card.credentials": "Schutz von Zugangsdaten",
1136
+ "card.networkOps": "Netzwerk & Hot-Reload",
1137
+ "card.summaryOn": "ein",
1138
+ "card.summaryOff": "aus",
1139
+ "card.summaryNone": "keine",
1140
+ "card.summaryStrategies": "%n aktiv",
1141
+ "card.summaryLists": "%a erlaubt · %d blockiert",
1142
+ "card.summaryCredRw": "readwrite: %n Familien",
1143
+ "card.summaryNetwork": "Netzwerk %net · Hot-Reload %w",
1144
+ "card.denylistPresetCollapse": "Eingebaute Schlüsselwörter (%n)",
1145
+ "card.denylistCustom": "Benutzerdefinierte Schlüsselwörter",
1074
1146
  "card.yolo": "YOLO — niemals einen Menschen fragen: nur Gefährliches blockieren, Rest ausführen",
1075
1147
  "card.yoloExempt": "YOLO: auch „Ort unbekannt“ im Arbeitsbereich zulassen",
1076
1148
  "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.",
@@ -1271,13 +1343,25 @@ window.__ModuleLoader__.load({
1271
1343
  "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
1344
  "card.permissive": "Abilita il livello di revisione automatica",
1273
1345
  "card.permissiveHint": "Quando disattivato, il portale si comporta esattamente come prima.",
1274
- "card.unattended": "Modalità senza supervisione (tre implementazioni; ogni interruttore decide se il proprio livello esiste)",
1346
+ "card.unattended": "Modalità senza supervisione",
1275
1347
  "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
1348
  "card.mode.ask": "Mantieni umano",
1277
1349
  "card.mode.pass": "Passaggio meccanico",
1278
1350
  "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
1351
  "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.tierScopeHint": "Solo i preset dentro l'ambito del gate (%scope) arrivano a questo passo; fuori dall'ambito il gate si disattiva del tutto e nessun interruttore prende in carico le sue conferme.",
1352
+ "card.testing": "Test e diagnostica",
1353
+ "card.lists": "Elenchi di autorizzazione e blocco",
1354
+ "card.credentials": "Protezione delle credenziali",
1355
+ "card.networkOps": "Rete e ricarica a caldo",
1356
+ "card.summaryOn": "attivo",
1357
+ "card.summaryOff": "disattivo",
1358
+ "card.summaryNone": "nessuno",
1359
+ "card.summaryStrategies": "%n attive",
1360
+ "card.summaryLists": "%a consentiti · %d bloccati",
1361
+ "card.summaryCredRw": "readwrite: %n famiglie",
1362
+ "card.summaryNetwork": "rete %net · ricarica %w",
1363
+ "card.denylistPresetCollapse": "Parole integrate (%n)",
1364
+ "card.denylistCustom": "Parole personalizzate",
1281
1365
  "card.yolo": "YOLO — non chiedere mai un umano: blocca il pericoloso, esegui il resto",
1282
1366
  "card.yoloExempt": "YOLO: consenti anche “posizione sconosciuta” nel workspace",
1283
1367
  "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.",
@@ -1478,13 +1562,25 @@ window.__ModuleLoader__.load({
1478
1562
  "card.description": "Независимый уровень одобрения: параллельно с «только чтение» / «полный доступ» / «белый список», отображается как «Автоматическая проверка» в выборе разрешений сессии. Фронтенд предоставляет один переключатель; четыре серверные стратегии одобрения комбинируемы через эту панель и остаются fail-closed против жёсткого отказа P0.",
1479
1563
  "card.permissive": "Включить уровень автоматической проверки",
1480
1564
  "card.permissiveHint": "Когда выключено, шлюз ведёт себя точно так же, как раньше.",
1481
- "card.unattended": "Режимы без подтверждения человеком (три реализации; каждый переключатель решает, существует ли его уровень)",
1565
+ "card.unattended": "Режимы без подтверждения человеком",
1482
1566
  "card.unattendedHint": "Переключателя три, каждый управляет только тем уровнем, что написан рядом: выключить реализацию — значит вернуть этот уровень обычному человеческому потоку; тайно стать другим он не может.",
1483
1567
  "card.mode.ask": "Оставить человека",
1484
1568
  "card.mode.pass": "Механический пропуск",
1485
1569
  "card.askHint": "Механический отбор фильтрует и перечисляет сомнения, но запрос остаётся человеку, а модель-ревизор не вызывается ни разу — это форма для запусков без подключённого LLM-ревизора или когда токены не стоят затрат.",
1486
1570
  "card.passHint": "Работает только детерминированный механический судья: необратимое, невосстановимое или нечитаемое действие блокируется с причиной обратно основной модели, остальное выполняется. Ни вызова модели, ни вопроса человеку — проверенная форма approval: never и YOLO без модели.",
1487
- "card.tierScopeHint": "До этого шага доходят только пресеты внутри области гейта (%scope); вне области гейт отключается целиком, и ни один переключатель не берёт его подтверждения на себя.",
1571
+ "card.testing": "Тесты и диагностика",
1572
+ "card.lists": "Списки разрешений и блокировок",
1573
+ "card.credentials": "Защита учётных данных",
1574
+ "card.networkOps": "Сеть и горячая перезагрузка",
1575
+ "card.summaryOn": "вкл",
1576
+ "card.summaryOff": "выкл",
1577
+ "card.summaryNone": "нет",
1578
+ "card.summaryStrategies": "активно: %n",
1579
+ "card.summaryLists": "разрешено %a · заблокировано %d",
1580
+ "card.summaryCredRw": "readwrite: %n семейств",
1581
+ "card.summaryNetwork": "сеть %net · перезагрузка %w",
1582
+ "card.denylistPresetCollapse": "Встроенные ключевые слова (%n)",
1583
+ "card.denylistCustom": "Пользовательские ключевые слова",
1488
1584
  "card.yolo": "YOLO — никогда не спрашивать человека: блокировать опасное, остальное выполнять",
1489
1585
  "card.yoloExempt": "YOLO: разрешить и «неизвестное расположение» внутри рабочей области",
1490
1586
  "card.yoloExemptHint": "Только для YOLO. Если включено, вызов, у которого неопределимо только «расположение» (инструмент без аргументов, скрипт вне рабочей области, тело которого не прочитано), больше не блокируется как «невидимый». Кодированные полезные нагрузки, нечитаемые тела скриптов, удаления и удалённые записи по-прежнему блокируются; P0, учётные данные и необратимые действия не меняются никогда.",
@@ -1685,13 +1781,25 @@ window.__ModuleLoader__.load({
1685
1781
  "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
1782
  "card.permissive": "Habilitar el nivel de revisión automática",
1687
1783
  "card.permissiveHint": "Cuando está desactivado, la compuerta se comporta exactamente igual que antes.",
1688
- "card.unattended": "Modos sin supervisión (tres implementaciones; cada interruptor decide si su nivel existe)",
1784
+ "card.unattended": "Modos sin supervisión",
1689
1785
  "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
1786
  "card.mode.ask": "Mantener humano",
1691
1787
  "card.mode.pass": "Paso mecánico",
1692
1788
  "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
1789
  "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.tierScopeHint": "Solo los presets dentro del alcance del gate (%scope) llegan a este paso; fuera de él el gate se aparta por completo y ningún interruptor toma sus confirmaciones.",
1790
+ "card.testing": "Pruebas y diagnóstico",
1791
+ "card.lists": "Listas de permisos y bloqueos",
1792
+ "card.credentials": "Protección de credenciales",
1793
+ "card.networkOps": "Red y recarga en caliente",
1794
+ "card.summaryOn": "sí",
1795
+ "card.summaryOff": "no",
1796
+ "card.summaryNone": "ninguno",
1797
+ "card.summaryStrategies": "%n activadas",
1798
+ "card.summaryLists": "%a permitidos · %d bloqueados",
1799
+ "card.summaryCredRw": "readwrite: %n familias",
1800
+ "card.summaryNetwork": "red %net · recarga %w",
1801
+ "card.denylistPresetCollapse": "Palabras integradas (%n)",
1802
+ "card.denylistCustom": "Palabras personalizadas",
1695
1803
  "card.yolo": "YOLO — nunca pedir un humano: bloquear lo peligroso, ejecutar el resto",
1696
1804
  "card.yoloExempt": "YOLO: permitir también “ubicación desconocida” dentro del workspace",
1697
1805
  "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.",
@@ -1892,13 +2000,25 @@ window.__ModuleLoader__.load({
1892
2000
  "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
2001
  "card.permissive": "Ativar o nível de revisão automática",
1894
2002
  "card.permissiveHint": "Quando desativado, o portal se comporta exatamente como antes.",
1895
- "card.unattended": "Modos sem supervisão (três implementações; cada interruptor decide se o seu nível existe)",
2003
+ "card.unattended": "Modos sem supervisão",
1896
2004
  "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
2005
  "card.mode.ask": "Manter humano",
1898
2006
  "card.mode.pass": "Passagem mecânica",
1899
2007
  "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
2008
  "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.tierScopeHint": "Apenas as predefinições dentro do escopo do portal (%scope) chegam a esta etapa; fora dele o portal se afasta por completo e nenhum interruptor assume as suas confirmações.",
2009
+ "card.testing": "Testes e diagnóstico",
2010
+ "card.lists": "Listas de permissão e bloqueio",
2011
+ "card.credentials": "Proteção de credenciais",
2012
+ "card.networkOps": "Rede e recarga a quente",
2013
+ "card.summaryOn": "ligado",
2014
+ "card.summaryOff": "desligado",
2015
+ "card.summaryNone": "nenhum",
2016
+ "card.summaryStrategies": "%n ativadas",
2017
+ "card.summaryLists": "%a permitidos · %d bloqueados",
2018
+ "card.summaryCredRw": "readwrite: %n famílias",
2019
+ "card.summaryNetwork": "rede %net · recarga %w",
2020
+ "card.denylistPresetCollapse": "Palavras integradas (%n)",
2021
+ "card.denylistCustom": "Palavras personalizadas",
1902
2022
  "card.yolo": "YOLO — nunca pedir uma pessoa: bloquear o perigoso, executar o resto",
1903
2023
  "card.yoloExempt": "YOLO: tolerar também “localização desconhecida” dentro do workspace",
1904
2024
  "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.",
@@ -2094,8 +2214,7 @@ window.__ModuleLoader__.load({
2094
2214
  "doubt.write": "escreve ou modifica arquivos"
2095
2215
  }
2096
2216
  };
2097
- //#endregion
2098
- //#region src/client/switch-state.ts
2217
+ // src/client/switch-state.ts
2099
2218
  /**
2100
2219
  * The optimistic state machine behind the settings card's pill switch and its tier
2101
2220
  * picker, kept out of the components so its three rules are testable without a DOM
@@ -2130,8 +2249,7 @@ window.__ModuleLoader__.load({
2130
2249
  function pendingAfterFailure(_pending) {
2131
2250
  return null;
2132
2251
  }
2133
- //#endregion
2134
- //#region src/deny-defaults.ts
2252
+ // src/deny-defaults.ts
2135
2253
  /**
2136
2254
  * Preset deny keywords inherited from dsh-approval-gate's `DEFAULT_DENY_KEYWORDS`
2137
2255
  * (the preset blacklist layer of its pipeline). One keyword per entry, matched
@@ -2174,8 +2292,7 @@ window.__ModuleLoader__.load({
2174
2292
  "docker rm",
2175
2293
  "docker system prune"
2176
2294
  ];
2177
- //#endregion
2178
- //#region src/llm-presets.ts
2295
+ // src/llm-presets.ts
2179
2296
  const LLM_PRESETS = [
2180
2297
  {
2181
2298
  id: "deepseek",
@@ -2196,8 +2313,7 @@ window.__ModuleLoader__.load({
2196
2313
  model: "gpt-4o-mini"
2197
2314
  }
2198
2315
  ];
2199
- //#endregion
2200
- //#region src/preset.ts
2316
+ // src/preset.ts
2201
2317
  /**
2202
2318
  * Presets in which the gate is active. The plugin ships five 自动审查 tiers of its own
2203
2319
  * (declared in its `cordis.patch.yml`, which is how they reach the composer picker at all):
@@ -2218,8 +2334,7 @@ window.__ModuleLoader__.load({
2218
2334
  "permissive-snet",
2219
2335
  "permissive-yolo"
2220
2336
  ];
2221
- //#endregion
2222
- //#region src/client/sediment.tsx
2337
+ // src/client/sediment.tsx
2223
2338
  /**
2224
2339
  * Learning-sediment management section — the settings-card face of verdict
2225
2340
  * learning's "沉淀" (the ⑤ card pattern demonstrated by dsh-approval-gate):
@@ -2384,8 +2499,7 @@ window.__ModuleLoader__.load({
2384
2499
  })
2385
2500
  });
2386
2501
  }
2387
- //#endregion
2388
- //#region src/client/card.tsx
2502
+ // src/client/card.tsx
2389
2503
  /**
2390
2504
  * Permissive settings card — the top-level `settings.section` (自动审查门) of dsh-perm-gate.
2391
2505
  *
@@ -2614,7 +2728,10 @@ window.__ModuleLoader__.load({
2614
2728
  (0, react.useEffect)(() => {
2615
2729
  let alive = true;
2616
2730
  fetch("/api/dsh-perm-gate/cred", { headers: { "cache-control": "no-cache" } }).then((r) => r.json()).then((b) => {
2617
- if (alive && b?.rungs !== void 0) setRungs(b.rungs);
2731
+ if (alive && b?.rungs !== void 0) {
2732
+ setRungs(b.rungs);
2733
+ props.onRungs?.(b.rungs);
2734
+ }
2618
2735
  }).catch(() => {});
2619
2736
  return () => {
2620
2737
  alive = false;
@@ -2636,8 +2753,10 @@ window.__ModuleLoader__.load({
2636
2753
  }),
2637
2754
  signal: abort.signal
2638
2755
  }).then((r) => r.json()).then((b) => {
2639
- if (b?.ok === true && b.rungs !== void 0) setRungs(b.rungs);
2640
- else setRowError({
2756
+ if (b?.ok === true && b.rungs !== void 0) {
2757
+ setRungs(b.rungs);
2758
+ props.onRungs?.(b.rungs);
2759
+ } else setRowError({
2641
2760
  family,
2642
2761
  msg: String(b?.error ?? "failed")
2643
2762
  });
@@ -2860,24 +2979,187 @@ window.__ModuleLoader__.load({
2860
2979
  })
2861
2980
  ] });
2862
2981
  }
2982
+ /** Stable snapshot served while the real scope has not resolved yet — the
2983
+ * store hook needs a referentially stable object; the diagnostic placeholder
2984
+ * renders instead of the card body in that case. */
2985
+ const EMPTY_SNAPSHOT = {
2986
+ status: "unavailable",
2987
+ value: null,
2988
+ writable: false
2989
+ };
2990
+ const drawerGroupStyle = {
2991
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))",
2992
+ borderRadius: "10px",
2993
+ background: "var(--dsw-alias-bg-surface, transparent)",
2994
+ overflow: "hidden"
2995
+ };
2996
+ const drawerHeaderStyle = {
2997
+ appearance: "none",
2998
+ width: "100%",
2999
+ font: "inherit",
3000
+ color: "inherit",
3001
+ textAlign: "left",
3002
+ cursor: "pointer",
3003
+ background: "none",
3004
+ border: 0,
3005
+ display: "flex",
3006
+ alignItems: "center",
3007
+ gap: "8px",
3008
+ padding: "10px 12px"
3009
+ };
3010
+ const drawerTitleStyle = {
3011
+ fontSize: "13px",
3012
+ fontWeight: 600,
3013
+ color: "var(--dsw-alias-label-primary)",
3014
+ flex: "0 1 auto",
3015
+ minWidth: 0
3016
+ };
3017
+ const drawerSummaryStyle = {
3018
+ flex: "1 1 auto",
3019
+ minWidth: 0,
3020
+ textAlign: "right",
3021
+ fontSize: "12px",
3022
+ lineHeight: "18px",
3023
+ color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))",
3024
+ overflowWrap: "anywhere"
3025
+ };
3026
+ const drawerBodyStyle = { padding: "2px 12px 12px" };
2863
3027
  /**
2864
- * The card body, wrapped in a disclosure shell like every peer settings card:
2865
- * a header (name + description + chevron) toggling the body, expanded by
2866
- * default so the section reads as an open page of drawers.
3028
+ * One denylist row: keyword + remove. `muted` marks built-in preset words —
3029
+ * visually quieter, because they are the default rather than a decision the
3030
+ * person made (they live inside the collapsed built-ins sublist).
2867
3031
  */
2868
- function PermissiveCard({ t, scope }) {
2869
- if (!scope) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3032
+ function DenyRow(props) {
3033
+ const { keyword, index, muted, locked, removeLabel, onRemove } = props;
3034
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2870
3035
  style: {
2871
- padding: 16,
2872
- color: "var(--dsw-alias-label-tertiary, #888)"
3036
+ display: "flex",
3037
+ alignItems: "center",
3038
+ gap: "8px",
3039
+ padding: "4px 8px",
3040
+ borderRadius: "6px",
3041
+ border: "1px solid var(--dsw-alias-border-l2)",
3042
+ background: "var(--dsw-alias-bg-surface, transparent)"
2873
3043
  },
2874
- children: [t("card.unavailable"), "(scope 未解析 — 诊断占位)"]
3044
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
3045
+ style: {
3046
+ flex: "1 1 auto",
3047
+ minWidth: 0,
3048
+ overflowWrap: "anywhere",
3049
+ font: "500 12px/18px var(--ds-font-family-code, monospace)",
3050
+ color: muted ? "var(--dsw-alias-label-tertiary)" : "var(--dsw-alias-label-primary)"
3051
+ },
3052
+ children: keyword
3053
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3054
+ type: "button",
3055
+ "aria-label": removeLabel,
3056
+ title: removeLabel,
3057
+ disabled: locked,
3058
+ onClick: () => {
3059
+ onRemove(index);
3060
+ },
3061
+ style: {
3062
+ flex: "0 0 auto",
3063
+ width: "20px",
3064
+ height: "20px",
3065
+ border: "none",
3066
+ borderRadius: "999px",
3067
+ background: "transparent",
3068
+ color: "var(--dsw-alias-label-tertiary)",
3069
+ cursor: locked ? "default" : "pointer"
3070
+ },
3071
+ children: "✕"
3072
+ })]
3073
+ });
3074
+ }
3075
+ /**
3076
+ * One collapsible group inside the settings card.
3077
+ *
3078
+ * The card body is cut into titled drawers so the front switch and the preset
3079
+ * scope note stay first-screen while every block (tiers / strategies / testing
3080
+ * / lists / credentials / network) folds behind a header. The header always
3081
+ * shows a live state summary — a drawer communicates what it is doing without
3082
+ * being opened, mirroring the outer disclosure pattern this card already uses
3083
+ * (and the multi-group precedent in thinking-levels' card).
3084
+ *
3085
+ * `onFirstOpen` fires once, on the first expansion: groups whose content costs
3086
+ * a fetch (the rules viewer) load lazily instead of on mount.
3087
+ */
3088
+ function DrawerGroup(props) {
3089
+ const { id, title, summary, onFirstOpen, children } = props;
3090
+ const [open, setOpen] = (0, react.useState)(false);
3091
+ const firedRef = (0, react.useRef)(false);
3092
+ const toggle = () => {
3093
+ const next = !open;
3094
+ setOpen(next);
3095
+ if (next && onFirstOpen !== void 0 && !firedRef.current) {
3096
+ firedRef.current = true;
3097
+ onFirstOpen();
3098
+ }
3099
+ };
3100
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
3101
+ style: drawerGroupStyle,
3102
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
3103
+ type: "button",
3104
+ "aria-expanded": open,
3105
+ "aria-controls": id,
3106
+ onClick: toggle,
3107
+ style: drawerHeaderStyle,
3108
+ children: [
3109
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
3110
+ width: "14",
3111
+ height: "14",
3112
+ viewBox: "0 0 16 16",
3113
+ "aria-hidden": true,
3114
+ style: {
3115
+ color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))",
3116
+ flex: "0 0 auto",
3117
+ transition: "transform 0.16s",
3118
+ transform: open ? "rotate(180deg)" : "none"
3119
+ },
3120
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
3121
+ d: "M4 6l4 4 4-4",
3122
+ fill: "none",
3123
+ stroke: "currentColor",
3124
+ strokeWidth: "1.5",
3125
+ strokeLinecap: "round",
3126
+ strokeLinejoin: "round"
3127
+ })
3128
+ }),
3129
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3130
+ style: drawerTitleStyle,
3131
+ children: title
3132
+ }),
3133
+ summary !== void 0 && summary !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3134
+ style: drawerSummaryStyle,
3135
+ children: summary
3136
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3137
+ "aria-hidden": true,
3138
+ style: { flex: "1 1 auto" }
3139
+ })
3140
+ ]
3141
+ }), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3142
+ id,
3143
+ style: drawerBodyStyle,
3144
+ children
3145
+ }) : null]
2875
3146
  });
3147
+ }
3148
+ /**
3149
+ * The card body, wrapped in a disclosure shell like every peer settings card:
3150
+ * a header (name + description + chevron) toggling the body. The body keeps
3151
+ * the front switch and the preset-scope note first-screen, then cuts the rest
3152
+ * into six titled drawers (see DrawerGroup) so the page reads as a short
3153
+ * index with live summaries instead of one long form.
3154
+ */
3155
+ function PermissiveCard({ t, scope }) {
2876
3156
  const [open, setOpen] = (0, react.useState)(true);
2877
3157
  const [apiKeyDraft, setApiKeyDraft] = (0, react.useState)("");
2878
3158
  const [allowText, setAllowText] = (0, react.useState)("");
2879
3159
  const [allowDirty, setAllowDirty] = (0, react.useState)(false);
2880
- const snapshot = (0, react.useSyncExternalStore)((listener) => scope.subscribe(listener), () => scope.getSnapshot());
3160
+ const snapshot = (0, react.useSyncExternalStore)(scope ? (listener) => scope.subscribe(listener) : (listener) => {
3161
+ return () => {};
3162
+ }, () => scope ? scope.getSnapshot() : EMPTY_SNAPSHOT);
2881
3163
  const unavailable = snapshot.status === "unavailable";
2882
3164
  const readonly = unavailable || !snapshot.writable;
2883
3165
  const raw = snapshot.value ?? {};
@@ -2974,9 +3256,6 @@ window.__ModuleLoader__.load({
2974
3256
  setRulesBusy(false);
2975
3257
  });
2976
3258
  };
2977
- (0, react.useEffect)(() => {
2978
- loadRules();
2979
- }, []);
2980
3259
  const receiverSource = (value.classifierSource ?? "custom") === "host" ? "host" : "custom";
2981
3260
  const [receiverInfo, setReceiverInfo] = (0, react.useState)(null);
2982
3261
  const [receiverNonce, setReceiverNonce] = (0, react.useState)(0);
@@ -3017,6 +3296,41 @@ window.__ModuleLoader__.load({
3017
3296
  const restoreDeny = () => {
3018
3297
  scope.unset("denyKeywords");
3019
3298
  };
3299
+ const [presetDenyOpen, setPresetDenyOpen] = (0, react.useState)(false);
3300
+ const denyPairs = denylist.map((keyword, index) => ({
3301
+ keyword,
3302
+ index,
3303
+ preset: DEFAULT_DENY_KEYWORDS.includes(keyword)
3304
+ }));
3305
+ const customDeny = denyPairs.filter((pair) => !pair.preset);
3306
+ const presetDeny = denyPairs.filter((pair) => pair.preset);
3307
+ const [credRwCount, setCredRwCount] = (0, react.useState)(null);
3308
+ const handleCredRungs = (rungs) => {
3309
+ setCredRwCount(Object.values(rungs).filter((rung) => rung === "readwrite").length);
3310
+ };
3311
+ const enabledTiers = [
3312
+ ...value.yolo === true ? ["YOLO"] : [],
3313
+ ...value.safenetPass !== false ? [t("card.mode.pass")] : [],
3314
+ ...value.safenetAsk === true ? [t("card.mode.ask")] : []
3315
+ ];
3316
+ const tiersSummary = enabledTiers.length > 0 ? enabledTiers.join(" · ") : t("card.summaryNone");
3317
+ const enabledStrategies = [
3318
+ strategies.trustAutoAllow ?? true,
3319
+ strategies.alwaysConfirm ?? false,
3320
+ strategies.llmAssist ?? false,
3321
+ strategies.trustEscalation ?? true
3322
+ ].filter((flag) => flag === true).length;
3323
+ const strategiesSummary = (enabledStrategies === 0 ? t("card.summaryNone") : t("card.summaryStrategies").replace("%n", String(enabledStrategies))) + (strategies.llmAssist === true ? " · llmAssist" : "");
3324
+ const listsSummary = t("card.summaryLists").replace("%a", String(patterns.length + (value.autoAllowTools ?? []).length)).replace("%d", String((denyActive ? denylist.length : 0) + (value.denyKeywordsExtra ?? []).length));
3325
+ const credSummary = credRwCount === null ? void 0 : t("card.summaryCredRw").replace("%n", String(credRwCount));
3326
+ 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"));
3327
+ if (!scope) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3328
+ style: {
3329
+ padding: 16,
3330
+ color: "var(--dsw-alias-label-tertiary, #888)"
3331
+ },
3332
+ children: [t("card.unavailable"), "(scope 未解析 — 诊断占位)"]
3333
+ });
3020
3334
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3021
3335
  style: {
3022
3336
  border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))",
@@ -3116,1353 +3430,1352 @@ window.__ModuleLoader__.load({
3116
3430
  style: hintStyle,
3117
3431
  children: t("card.scopeNote").replace("%scope", gateScope.join(" / "))
3118
3432
  }),
3119
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
3120
- style: sectionStyle,
3121
- children: [
3122
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3123
- style: labelStyle,
3124
- children: t("card.unattended")
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,
3433
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3434
+ style: {
3435
+ display: "flex",
3436
+ flexDirection: "column",
3437
+ gap: "10px",
3438
+ marginTop: "12px"
3439
+ },
3233
3440
  children: [
3234
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3235
- style: labelStyle,
3236
- children: t("card.strategies")
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,
3441
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
3442
+ id: "pg-drawer-unattended",
3443
+ title: t("card.unattended"),
3444
+ summary: tiersSummary,
3308
3445
  children: [
3309
3446
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3310
- style: labelStyle,
3311
- children: t("card.llmReceiver")
3447
+ style: hintStyle,
3448
+ children: t("card.unattendedHint")
3312
3449
  }),
3313
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3314
- style: fieldStyle,
3315
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3316
- style: fieldLabelStyle,
3317
- children: t("card.llmSource")
3318
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
3319
- value: value.classifierSource ?? "custom",
3320
- disabled: readonly,
3321
- style: controlStyle,
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
- })]
3332
- })]
3450
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TierRow, {
3451
+ id: "plugin-config-perm-gate-yolo",
3452
+ label: t("card.yolo"),
3453
+ preset: "permissive-yolo",
3454
+ checked: value.yolo === true,
3455
+ disabled: readonly,
3456
+ hint: t("card.yoloHint"),
3457
+ onCommit: (next) => scope.set("yolo", next)
3333
3458
  }),
3334
- (value.classifierSource ?? "custom") === "custom" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3335
- style: fieldStyle,
3336
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3337
- style: fieldLabelStyle,
3338
- children: t("card.llmPreset")
3339
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
3340
- value: "",
3341
- disabled: readonly,
3342
- style: controlStyle,
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
- ]
3376
- })]
3377
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3378
- style: fieldStyle,
3379
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3380
- style: fieldLabelStyle,
3381
- children: t("card.llmEndpoint")
3382
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3383
- type: "text",
3384
- value: value.classifierEndpoint ?? "",
3459
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3460
+ style: rowStyle,
3461
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3462
+ htmlFor: "plugin-config-perm-gate-yolo-exempt",
3463
+ style: { fontSize: "12px" },
3464
+ children: t("card.yoloExempt")
3465
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3466
+ id: "plugin-config-perm-gate-yolo-exempt",
3467
+ checked: value.yoloWorkspaceExempt === true,
3385
3468
  disabled: readonly,
3386
- placeholder: "https://api.openai.com/v1",
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
- }
3469
+ onCommit: (next) => scope.set("yoloWorkspaceExempt", next)
3394
3470
  })]
3395
- })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
3396
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3397
- style: hintStyle,
3398
- children: t("card.llmSourceHostHint")
3399
- }),
3400
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3401
- style: fieldStyle,
3402
- children: [
3403
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3404
- style: fieldLabelStyle,
3405
- children: t("card.llmProvider")
3406
- }),
3407
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3408
- type: "text",
3409
- list: "perm-gate-provider-options",
3410
- value: value.classifierProvider ?? "",
3411
- disabled: readonly,
3412
- placeholder: t("card.llmProviderPlaceholder"),
3413
- style: controlStyle,
3414
- onChange: (event) => {
3415
- scope.set("classifierProvider", event.currentTarget.value);
3416
- },
3417
- onBlur: (event) => {
3418
- if (event.currentTarget.value.trim() === "") scope.unset("classifierProvider");
3419
- }
3420
- }),
3421
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("datalist", {
3422
- id: "perm-gate-provider-options",
3423
- children: (receiverInfo?.providers ?? []).map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
3424
- value: p.id,
3425
- children: [p.name, p.error !== void 0 ? ` (${p.error})` : ""]
3426
- }, p.id))
3427
- })
3428
- ]
3429
- }),
3430
- receiverInfo?.selection !== null && receiverInfo?.selection !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3431
- style: hintStyle,
3432
- children: t("card.llmResolved").replace("%p", receiverInfo.selection.provider).replace("%m", receiverInfo.selection.model)
3433
- }) : null
3434
- ] }),
3435
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3436
- style: fieldStyle,
3437
- children: [
3438
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3439
- style: fieldLabelStyle,
3440
- children: t("card.llmModel")
3441
- }),
3442
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3443
- type: "text",
3444
- list: receiverSource === "host" ? "perm-gate-model-options" : void 0,
3445
- value: value.classifierModel ?? "",
3446
- disabled: readonly,
3447
- placeholder: receiverSource === "host" ? t("card.llmModelHostPlaceholder") : "deepseek-chat",
3448
- style: controlStyle,
3449
- onChange: (event) => {
3450
- scope.set("classifierModel", event.currentTarget.value);
3451
- },
3452
- onBlur: (event) => {
3453
- if (event.currentTarget.value.trim() === "") scope.unset("classifierModel");
3454
- }
3455
- }),
3456
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("datalist", {
3457
- id: "perm-gate-model-options",
3458
- children: (receiverInfo?.providers ?? []).filter((p) => receiverProviderDraft === "" || p.id === receiverProviderDraft).flatMap((p) => p.models).map((m) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3459
- value: m.id,
3460
- children: m.name
3461
- }, `${m.id}`))
3462
- })
3463
- ]
3464
3471
  }),
3465
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3466
- style: fieldStyle,
3467
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3468
- style: fieldLabelStyle,
3469
- children: t("card.llmEffort")
3470
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
3471
- value: value.classifierEffort ?? "",
3472
- disabled: readonly || receiverSource !== "host",
3473
- style: controlStyle,
3474
- title: t("card.llmEffortHint"),
3475
- onChange: (event) => {
3476
- scope.set("classifierEffort", event.currentTarget.value);
3477
- },
3478
- children: [
3479
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3480
- value: "",
3481
- children: t("card.llmEffortHost")
3482
- }),
3483
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3484
- value: "off",
3485
- children: "off"
3486
- }),
3487
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3488
- value: "low",
3489
- children: "low"
3490
- }),
3491
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3492
- value: "medium",
3493
- children: "medium"
3494
- }),
3495
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3496
- value: "high",
3497
- children: "high"
3498
- })
3499
- ]
3500
- })]
3472
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3473
+ style: hintStyle,
3474
+ children: t("card.yoloExemptHint")
3501
3475
  }),
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")
3508
- }),
3509
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3510
- style: {
3511
- display: "flex",
3512
- gap: "6px"
3513
- },
3514
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3515
- type: "password",
3516
- autoComplete: "off",
3517
- spellCheck: false,
3518
- value: apiKeyDraft,
3519
- disabled: readonly,
3520
- placeholder: hasApiKey ? t("card.llmKeyMasked") : t("card.llmKeyHidden"),
3521
- style: {
3522
- ...controlStyle,
3523
- flex: "1 1 0%"
3524
- },
3525
- onChange: (event) => setApiKeyDraft(event.currentTarget.value),
3526
- onBlur: commitApiKey,
3527
- onKeyDown: (event) => {
3528
- if (event.key === "Enter") event.currentTarget.blur();
3529
- }
3530
- }), hasApiKey ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3531
- type: "button",
3532
- disabled: readonly,
3533
- onClick: clearApiKey,
3534
- style: controlStyle,
3535
- children: t("card.llmKeyClear")
3536
- }) : null]
3537
- }),
3538
- hasApiKey && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3539
- style: hintStyle,
3540
- children: t("card.llmKeyOverwrite")
3541
- })
3542
- ]
3476
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TierRow, {
3477
+ id: "plugin-config-perm-gate-safenet-pass",
3478
+ label: t("card.mode.pass"),
3479
+ preset: "permissive-mech",
3480
+ checked: value.safenetPass !== false,
3481
+ disabled: readonly,
3482
+ hint: t("card.passHint"),
3483
+ onCommit: (next) => scope.set("safenetPass", next)
3484
+ }),
3485
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TierRow, {
3486
+ id: "plugin-config-perm-gate-safenet-ask",
3487
+ label: t("card.mode.ask"),
3488
+ preset: "permissive-snet",
3489
+ checked: value.safenetAsk === true,
3490
+ disabled: readonly,
3491
+ hint: t("card.askHint"),
3492
+ onCommit: (next) => scope.set("safenetAsk", next)
3543
3493
  }),
3544
3494
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3545
- style: {
3546
- display: "flex",
3547
- alignItems: "center",
3548
- gap: "8px",
3549
- marginTop: "4px"
3550
- },
3551
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3552
- type: "button",
3553
- disabled: readonly || healthBusy,
3554
- onClick: () => {
3555
- setHealthBusy(true);
3556
- setHealthResult(null);
3557
- fetch("/api/dsh-perm-gate/health", {
3558
- method: "POST",
3559
- headers: { "content-type": "application/json" },
3560
- body: "{}"
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}`);
3568
- }
3569
- }).then((res) => {
3570
- 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"));
3571
- setReceiverNonce((n) => n + 1);
3572
- }).catch((e) => {
3573
- setHealthResult(t("card.healthFail") + String(e?.message ?? e));
3574
- }).finally(() => {
3575
- setHealthBusy(false);
3576
- });
3577
- },
3578
- style: {
3579
- ...controlStyle,
3580
- cursor: readonly || healthBusy ? "default" : "pointer"
3581
- },
3582
- children: healthBusy ? t("card.healthRunning") : t("card.healthTest")
3583
- }), healthResult !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3584
- style: {
3585
- fontSize: "12px",
3586
- lineHeight: "18px",
3587
- color: "var(--dsw-alias-label-secondary, inherit)",
3588
- overflowWrap: "anywhere"
3589
- },
3590
- children: healthResult
3495
+ style: rowStyle,
3496
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3497
+ htmlFor: "plugin-config-perm-gate-rules-fallback",
3498
+ style: { fontSize: "12px" },
3499
+ children: t("card.rulesFallback")
3500
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3501
+ id: "plugin-config-perm-gate-rules-fallback",
3502
+ checked: value.rulesFallback === true,
3503
+ disabled: readonly,
3504
+ onCommit: (next) => scope.set("rulesFallback", next)
3591
3505
  })]
3592
3506
  }),
3507
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3508
+ style: hintStyle,
3509
+ children: t("card.rulesFallbackHint")
3510
+ }),
3593
3511
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3594
3512
  style: rowStyle,
3595
3513
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3596
- htmlFor: "plugin-config-perm-gate-risk-learning",
3514
+ htmlFor: "plugin-config-perm-gate-allow-protected-push",
3597
3515
  style: { fontSize: "12px" },
3598
- children: t("card.riskLearning")
3516
+ children: t("card.allowProtectedBranchPush")
3599
3517
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3600
- id: "plugin-config-perm-gate-risk-learning",
3601
- checked: value.riskLearning ?? false,
3602
- disabled: readonly || !effective,
3603
- onCommit: (next) => scope.set("riskLearning", next)
3518
+ id: "plugin-config-perm-gate-allow-protected-push",
3519
+ checked: value.allowProtectedBranchPush === true,
3520
+ disabled: readonly,
3521
+ onCommit: (next) => scope.set("allowProtectedBranchPush", next)
3604
3522
  })]
3605
3523
  }),
3606
3524
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3607
3525
  style: hintStyle,
3608
- children: t("card.riskLearningHint")
3526
+ children: t("card.allowProtectedBranchPushHint")
3527
+ }),
3528
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3529
+ style: rowStyle,
3530
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3531
+ htmlFor: "plugin-config-perm-gate-script-review",
3532
+ style: { fontSize: "12px" },
3533
+ children: t("card.scriptReview")
3534
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3535
+ id: "plugin-config-perm-gate-script-review",
3536
+ checked: value.scriptReview !== false,
3537
+ disabled: readonly,
3538
+ onCommit: (next) => scope.set("scriptReview", next)
3539
+ })]
3609
3540
  }),
3610
- value.riskLearning === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3611
- style: fieldStyle,
3612
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3613
- style: fieldLabelStyle,
3614
- children: t("card.riskThreshold")
3615
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3616
- id: "plugin-config-perm-gate-risk-threshold",
3617
- type: "number",
3618
- min: 1,
3619
- max: 10,
3620
- value: value.riskThreshold ?? 3,
3541
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3542
+ style: hintStyle,
3543
+ children: t("card.scriptReviewHint")
3544
+ })
3545
+ ]
3546
+ }),
3547
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
3548
+ id: "pg-drawer-strategies",
3549
+ title: t("card.strategies"),
3550
+ summary: strategiesSummary,
3551
+ children: [
3552
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3553
+ style: rowStyle,
3554
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3555
+ htmlFor: "plugin-config-perm-gate-trust",
3556
+ style: { fontSize: "12px" },
3557
+ children: t("card.strategy.trustAutoAllow")
3558
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3559
+ id: "plugin-config-perm-gate-trust",
3560
+ checked: strategies.trustAutoAllow ?? true,
3621
3561
  disabled: readonly || !effective,
3622
- style: {
3623
- ...controlStyle,
3624
- width: "96px"
3625
- },
3626
- onChange: (event) => {
3627
- const n = Number.parseInt(event.currentTarget.value, 10);
3628
- if (Number.isFinite(n) && n >= 1 && n <= 10) scope.set("riskThreshold", n);
3629
- }
3630
- })]
3631
- }) : null,
3632
- value.riskLearning === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
3633
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3634
- style: rowStyle,
3635
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3636
- htmlFor: "plugin-config-perm-gate-risk-sediment",
3637
- style: { fontSize: "12px" },
3638
- children: t("card.riskSediment")
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)
3644
- })]
3645
- }),
3646
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3647
- style: hintStyle,
3648
- children: t("card.riskSedimentHint")
3649
- }),
3650
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3651
- style: sectionStyle,
3652
- children: [
3653
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3654
- style: labelStyle,
3655
- children: t("card.sediment")
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();
3709
- },
3710
- style: controlStyle
3711
- })]
3712
- }),
3713
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3714
- style: {
3715
- display: "flex",
3716
- flexDirection: "column",
3717
- gap: "4px",
3718
- flex: "1 1 260px",
3719
- minWidth: 0
3720
- },
3721
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3722
- style: fieldLabelStyle,
3723
- children: t("card.dryRunCommand")
3724
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
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();
3734
- },
3735
- style: controlStyle
3562
+ onCommit: (next) => scope.set("permissiveStrategies", {
3563
+ ...strategies,
3564
+ trustAutoAllow: next
3565
+ })
3736
3566
  })]
3737
3567
  }),
3738
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3739
- type: "button",
3740
- disabled: readonly || dryBusy,
3741
- onClick: runDryRunTest,
3742
- style: {
3743
- ...controlStyle,
3744
- flex: "0 0 auto",
3745
- cursor: readonly || dryBusy ? "default" : "pointer"
3746
- },
3747
- children: dryBusy ? t("card.dryRunRunning") : t("card.dryRunTest")
3748
- })
3749
- ]
3750
- }),
3751
- dryError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
3752
- style: {
3753
- ...hintStyle,
3754
- color: "var(--dsw-alias-label-error, #c0392b)"
3755
- },
3756
- children: [t("card.dryRunFail"), dryError]
3757
- }),
3758
- dryReport === null ? dryError === null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3759
- style: hintStyle,
3760
- children: t("card.dryRunEmpty")
3761
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
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
- },
3773
- children: [
3774
3568
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3775
- style: {
3776
- display: "flex",
3777
- alignItems: "center",
3778
- gap: "8px"
3779
- },
3780
- children: [
3781
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3782
- style: fieldLabelStyle,
3783
- children: t("card.dryRunVerdict")
3784
- }),
3785
- (() => {
3786
- const verdict = dryReport.verdict ?? "ask";
3787
- const colour = verdict === "deny" ? "var(--dsw-alias-label-error, #c0392b)" : verdict === "allow" ? "var(--dsw-alias-label-success, #2e7d32)" : "var(--dsw-alias-label-warning, #b26a00)";
3788
- const text = verdict === "deny" ? t("card.dryRunDeny") : verdict === "allow" ? t("card.dryRunAllow") : t("card.dryRunAsk");
3789
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
3790
- style: { color: colour },
3791
- children: text
3792
- });
3793
- })(),
3794
- (dryReport.ruleCount ?? 0) === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3795
- style: { color: "var(--dsw-alias-label-secondary, inherit)" },
3796
- children: t("card.dryRunNoRules")
3569
+ style: rowStyle,
3570
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3571
+ htmlFor: "plugin-config-perm-gate-confirm",
3572
+ style: { fontSize: "12px" },
3573
+ children: t("card.strategy.alwaysConfirm")
3574
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3575
+ id: "plugin-config-perm-gate-confirm",
3576
+ checked: strategies.alwaysConfirm ?? false,
3577
+ disabled: readonly || !effective,
3578
+ onCommit: (next) => scope.set("permissiveStrategies", {
3579
+ ...strategies,
3580
+ alwaysConfirm: next
3797
3581
  })
3798
- ]
3799
- }),
3800
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3801
- style: {
3802
- display: "flex",
3803
- gap: "8px",
3804
- overflowWrap: "anywhere"
3805
- },
3806
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3807
- style: fieldLabelStyle,
3808
- children: t("card.dryRunRule")
3809
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
3810
- style: {
3811
- font: "500 12px/18px var(--ds-font-family-code, monospace)",
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
3582
  })]
3816
3583
  }),
3817
3584
  /* @__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(", ")
3585
+ style: rowStyle,
3586
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3587
+ htmlFor: "plugin-config-perm-gate-llm",
3588
+ style: { fontSize: "12px" },
3589
+ children: t("card.strategy.llmAssist")
3590
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3591
+ id: "plugin-config-perm-gate-llm",
3592
+ checked: strategies.llmAssist ?? false,
3593
+ disabled: readonly || !effective,
3594
+ onCommit: (next) => scope.set("permissiveStrategies", {
3595
+ ...strategies,
3596
+ llmAssist: next
3597
+ })
3832
3598
  })]
3833
3599
  }),
3834
3600
  /* @__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 ?? ""
3601
+ style: rowStyle,
3602
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3603
+ htmlFor: "plugin-config-perm-gate-escalation",
3604
+ style: { fontSize: "12px" },
3605
+ children: t("card.strategy.trustEscalation")
3606
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3607
+ id: "plugin-config-perm-gate-escalation",
3608
+ checked: strategies.trustEscalation ?? true,
3609
+ disabled: readonly || !effective,
3610
+ onCommit: (next) => scope.set("permissiveStrategies", {
3611
+ ...strategies,
3612
+ trustEscalation: next
3613
+ })
3846
3614
  })]
3847
3615
  }),
3848
3616
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3849
- style: {
3850
- ...hintStyle,
3851
- margin: 0
3852
- },
3853
- children: t("card.dryRunNote")
3854
- })
3617
+ style: hintStyle,
3618
+ children: t("card.strategy.trustEscalationHint")
3619
+ }),
3620
+ strategies.llmAssist === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
3621
+ style: sectionStyle,
3622
+ children: [
3623
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3624
+ style: labelStyle,
3625
+ children: t("card.llmReceiver")
3626
+ }),
3627
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3628
+ style: fieldStyle,
3629
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3630
+ style: fieldLabelStyle,
3631
+ children: t("card.llmSource")
3632
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
3633
+ value: value.classifierSource ?? "custom",
3634
+ disabled: readonly,
3635
+ style: controlStyle,
3636
+ onChange: (event) => {
3637
+ scope.set("classifierSource", event.currentTarget.value);
3638
+ },
3639
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3640
+ value: "custom",
3641
+ children: t("card.llmSourceCustom")
3642
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3643
+ value: "host",
3644
+ children: t("card.llmSourceHost")
3645
+ })]
3646
+ })]
3647
+ }),
3648
+ (value.classifierSource ?? "custom") === "custom" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3649
+ style: fieldStyle,
3650
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3651
+ style: fieldLabelStyle,
3652
+ children: t("card.llmPreset")
3653
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
3654
+ value: "",
3655
+ disabled: readonly,
3656
+ style: controlStyle,
3657
+ onChange: (event) => {
3658
+ const v = event.currentTarget.value;
3659
+ if (v.startsWith("host:")) {
3660
+ scope.set("classifierSource", "host");
3661
+ scope.set("classifierProvider", v.slice(5));
3662
+ return;
3663
+ }
3664
+ const preset = LLM_PRESETS.find((p) => p.id === v);
3665
+ if (preset !== void 0) {
3666
+ scope.set("classifierEndpoint", preset.endpoint);
3667
+ scope.set("classifierModel", preset.model);
3668
+ }
3669
+ },
3670
+ children: [
3671
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3672
+ value: "",
3673
+ children: t("card.llmPresetChoose")
3674
+ }),
3675
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
3676
+ label: t("card.llmPresetPublic"),
3677
+ children: LLM_PRESETS.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3678
+ value: preset.id,
3679
+ children: preset.label
3680
+ }, preset.id))
3681
+ }),
3682
+ (receiverInfo?.providers ?? []).length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
3683
+ label: t("card.llmPresetHost"),
3684
+ children: (receiverInfo?.providers ?? []).map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3685
+ value: `host:${p.id}`,
3686
+ children: `${t("card.llmSourceHost")} · ${p.id}`
3687
+ }, `host:${p.id}`))
3688
+ }) : null
3689
+ ]
3690
+ })]
3691
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3692
+ style: fieldStyle,
3693
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3694
+ style: fieldLabelStyle,
3695
+ children: t("card.llmEndpoint")
3696
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3697
+ type: "text",
3698
+ value: value.classifierEndpoint ?? "",
3699
+ disabled: readonly,
3700
+ placeholder: "https://api.openai.com/v1",
3701
+ style: controlStyle,
3702
+ onChange: (event) => {
3703
+ scope.set("classifierEndpoint", event.currentTarget.value);
3704
+ },
3705
+ onBlur: (event) => {
3706
+ if (event.currentTarget.value.trim() === "") scope.unset("classifierEndpoint");
3707
+ }
3708
+ })]
3709
+ })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
3710
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3711
+ style: hintStyle,
3712
+ children: t("card.llmSourceHostHint")
3713
+ }),
3714
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3715
+ style: fieldStyle,
3716
+ children: [
3717
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3718
+ style: fieldLabelStyle,
3719
+ children: t("card.llmProvider")
3720
+ }),
3721
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3722
+ type: "text",
3723
+ list: "perm-gate-provider-options",
3724
+ value: value.classifierProvider ?? "",
3725
+ disabled: readonly,
3726
+ placeholder: t("card.llmProviderPlaceholder"),
3727
+ style: controlStyle,
3728
+ onChange: (event) => {
3729
+ scope.set("classifierProvider", event.currentTarget.value);
3730
+ },
3731
+ onBlur: (event) => {
3732
+ if (event.currentTarget.value.trim() === "") scope.unset("classifierProvider");
3733
+ }
3734
+ }),
3735
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("datalist", {
3736
+ id: "perm-gate-provider-options",
3737
+ children: (receiverInfo?.providers ?? []).map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
3738
+ value: p.id,
3739
+ children: [p.name, p.error !== void 0 ? ` (${p.error})` : ""]
3740
+ }, p.id))
3741
+ })
3742
+ ]
3743
+ }),
3744
+ receiverInfo?.selection !== null && receiverInfo?.selection !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3745
+ style: hintStyle,
3746
+ children: t("card.llmResolved").replace("%p", receiverInfo.selection.provider).replace("%m", receiverInfo.selection.model)
3747
+ }) : null
3748
+ ] }),
3749
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3750
+ style: fieldStyle,
3751
+ children: [
3752
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3753
+ style: fieldLabelStyle,
3754
+ children: t("card.llmModel")
3755
+ }),
3756
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3757
+ type: "text",
3758
+ list: receiverSource === "host" ? "perm-gate-model-options" : void 0,
3759
+ value: value.classifierModel ?? "",
3760
+ disabled: readonly,
3761
+ placeholder: receiverSource === "host" ? t("card.llmModelHostPlaceholder") : "deepseek-chat",
3762
+ style: controlStyle,
3763
+ onChange: (event) => {
3764
+ scope.set("classifierModel", event.currentTarget.value);
3765
+ },
3766
+ onBlur: (event) => {
3767
+ if (event.currentTarget.value.trim() === "") scope.unset("classifierModel");
3768
+ }
3769
+ }),
3770
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("datalist", {
3771
+ id: "perm-gate-model-options",
3772
+ children: (receiverInfo?.providers ?? []).filter((p) => receiverProviderDraft === "" || p.id === receiverProviderDraft).flatMap((p) => p.models).map((m) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3773
+ value: m.id,
3774
+ children: m.name
3775
+ }, `${m.id}`))
3776
+ })
3777
+ ]
3778
+ }),
3779
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3780
+ style: fieldStyle,
3781
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3782
+ style: fieldLabelStyle,
3783
+ children: t("card.llmEffort")
3784
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
3785
+ value: value.classifierEffort ?? "",
3786
+ disabled: readonly || receiverSource !== "host",
3787
+ style: controlStyle,
3788
+ title: t("card.llmEffortHint"),
3789
+ onChange: (event) => {
3790
+ scope.set("classifierEffort", event.currentTarget.value);
3791
+ },
3792
+ children: [
3793
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3794
+ value: "",
3795
+ children: t("card.llmEffortHost")
3796
+ }),
3797
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3798
+ value: "off",
3799
+ children: "off"
3800
+ }),
3801
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3802
+ value: "low",
3803
+ children: "low"
3804
+ }),
3805
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3806
+ value: "medium",
3807
+ children: "medium"
3808
+ }),
3809
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
3810
+ value: "high",
3811
+ children: "high"
3812
+ })
3813
+ ]
3814
+ })]
3815
+ }),
3816
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3817
+ style: fieldStyle,
3818
+ children: [
3819
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3820
+ style: fieldLabelStyle,
3821
+ children: t("card.llmKey")
3822
+ }),
3823
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3824
+ style: {
3825
+ display: "flex",
3826
+ gap: "6px"
3827
+ },
3828
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3829
+ type: "password",
3830
+ autoComplete: "off",
3831
+ spellCheck: false,
3832
+ value: apiKeyDraft,
3833
+ disabled: readonly,
3834
+ placeholder: hasApiKey ? t("card.llmKeyMasked") : t("card.llmKeyHidden"),
3835
+ style: {
3836
+ ...controlStyle,
3837
+ flex: "1 1 0%"
3838
+ },
3839
+ onChange: (event) => setApiKeyDraft(event.currentTarget.value),
3840
+ onBlur: commitApiKey,
3841
+ onKeyDown: (event) => {
3842
+ if (event.key === "Enter") event.currentTarget.blur();
3843
+ }
3844
+ }), hasApiKey ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3845
+ type: "button",
3846
+ disabled: readonly,
3847
+ onClick: clearApiKey,
3848
+ style: controlStyle,
3849
+ children: t("card.llmKeyClear")
3850
+ }) : null]
3851
+ }),
3852
+ hasApiKey && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3853
+ style: hintStyle,
3854
+ children: t("card.llmKeyOverwrite")
3855
+ })
3856
+ ]
3857
+ }),
3858
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3859
+ style: {
3860
+ display: "flex",
3861
+ alignItems: "center",
3862
+ gap: "8px",
3863
+ marginTop: "4px"
3864
+ },
3865
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3866
+ type: "button",
3867
+ disabled: readonly || healthBusy,
3868
+ onClick: () => {
3869
+ setHealthBusy(true);
3870
+ setHealthResult(null);
3871
+ fetch("/api/dsh-perm-gate/health", {
3872
+ method: "POST",
3873
+ headers: { "content-type": "application/json" },
3874
+ body: "{}"
3875
+ }).then(async (r) => {
3876
+ const text = await r.text();
3877
+ if (r.status === 404) throw new Error(t("card.healthStale"));
3878
+ try {
3879
+ return JSON.parse(text);
3880
+ } catch {
3881
+ throw new Error(text.trim().slice(0, 120) !== "" ? text.trim().slice(0, 120) : `HTTP ${r.status}`);
3882
+ }
3883
+ }).then((res) => {
3884
+ 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"));
3885
+ setReceiverNonce((n) => n + 1);
3886
+ }).catch((e) => {
3887
+ setHealthResult(t("card.healthFail") + String(e?.message ?? e));
3888
+ }).finally(() => {
3889
+ setHealthBusy(false);
3890
+ });
3891
+ },
3892
+ style: {
3893
+ ...controlStyle,
3894
+ cursor: readonly || healthBusy ? "default" : "pointer"
3895
+ },
3896
+ children: healthBusy ? t("card.healthRunning") : t("card.healthTest")
3897
+ }), healthResult !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3898
+ style: {
3899
+ fontSize: "12px",
3900
+ lineHeight: "18px",
3901
+ color: "var(--dsw-alias-label-secondary, inherit)",
3902
+ overflowWrap: "anywhere"
3903
+ },
3904
+ children: healthResult
3905
+ })]
3906
+ }),
3907
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3908
+ style: rowStyle,
3909
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3910
+ htmlFor: "plugin-config-perm-gate-risk-learning",
3911
+ style: { fontSize: "12px" },
3912
+ children: t("card.riskLearning")
3913
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3914
+ id: "plugin-config-perm-gate-risk-learning",
3915
+ checked: value.riskLearning ?? false,
3916
+ disabled: readonly || !effective,
3917
+ onCommit: (next) => scope.set("riskLearning", next)
3918
+ })]
3919
+ }),
3920
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3921
+ style: hintStyle,
3922
+ children: t("card.riskLearningHint")
3923
+ }),
3924
+ value.riskLearning === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
3925
+ style: fieldStyle,
3926
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3927
+ style: fieldLabelStyle,
3928
+ children: t("card.riskThreshold")
3929
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3930
+ id: "plugin-config-perm-gate-risk-threshold",
3931
+ type: "number",
3932
+ min: 1,
3933
+ max: 10,
3934
+ value: value.riskThreshold ?? 3,
3935
+ disabled: readonly || !effective,
3936
+ style: {
3937
+ ...controlStyle,
3938
+ width: "96px"
3939
+ },
3940
+ onChange: (event) => {
3941
+ const n = Number.parseInt(event.currentTarget.value, 10);
3942
+ if (Number.isFinite(n) && n >= 1 && n <= 10) scope.set("riskThreshold", n);
3943
+ }
3944
+ })]
3945
+ }) : null,
3946
+ value.riskLearning === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
3947
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3948
+ style: rowStyle,
3949
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
3950
+ htmlFor: "plugin-config-perm-gate-risk-sediment",
3951
+ style: { fontSize: "12px" },
3952
+ children: t("card.riskSediment")
3953
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
3954
+ id: "plugin-config-perm-gate-risk-sediment",
3955
+ checked: value.riskSediment ?? true,
3956
+ disabled: readonly || !effective,
3957
+ onCommit: (next) => scope.set("riskSediment", next)
3958
+ })]
3959
+ }),
3960
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3961
+ style: hintStyle,
3962
+ children: t("card.riskSedimentHint")
3963
+ }),
3964
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3965
+ style: sectionStyle,
3966
+ children: [
3967
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3968
+ style: labelStyle,
3969
+ children: t("card.sediment")
3970
+ }),
3971
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3972
+ style: hintStyle,
3973
+ children: t("card.sedimentHint")
3974
+ }),
3975
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SedimentSection, { t })
3976
+ ]
3977
+ })
3978
+ ] }) : null
3979
+ ]
3980
+ }) : null
3855
3981
  ]
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
3982
  }),
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
- },
3983
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
3984
+ id: "pg-drawer-testing",
3985
+ title: t("card.testing"),
3986
+ onFirstOpen: loadRules,
3987
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
3988
+ style: sectionStyle,
3921
3989
  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", {
3990
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3991
+ style: labelStyle,
3992
+ children: t("card.dryRun")
3993
+ }),
3994
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3995
+ style: hintStyle,
3996
+ children: t("card.dryRunHint")
3997
+ }),
3998
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3926
3999
  style: {
3927
- font: "500 12px/18px var(--ds-font-family-code, monospace)",
3928
- color: "var(--dsw-alias-label-primary)"
4000
+ display: "flex",
4001
+ flexWrap: "wrap",
4002
+ gap: "8px",
4003
+ alignItems: "flex-end",
4004
+ margin: "6px 0"
4005
+ },
4006
+ children: [
4007
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
4008
+ style: {
4009
+ display: "flex",
4010
+ flexDirection: "column",
4011
+ gap: "4px",
4012
+ flex: "0 0 120px"
4013
+ },
4014
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4015
+ style: fieldLabelStyle,
4016
+ children: t("card.dryRunTool")
4017
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4018
+ type: "text",
4019
+ value: dryTool,
4020
+ disabled: readonly,
4021
+ placeholder: "shell",
4022
+ onChange: (e) => {
4023
+ setDryTool(e.target.value);
4024
+ },
4025
+ onKeyDown: (e) => {
4026
+ if (e.key === "Enter") runDryRunTest();
4027
+ },
4028
+ style: controlStyle
4029
+ })]
4030
+ }),
4031
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
4032
+ style: {
4033
+ display: "flex",
4034
+ flexDirection: "column",
4035
+ gap: "4px",
4036
+ flex: "1 1 260px",
4037
+ minWidth: 0
4038
+ },
4039
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4040
+ style: fieldLabelStyle,
4041
+ children: t("card.dryRunCommand")
4042
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4043
+ type: "text",
4044
+ value: dryCommand,
4045
+ disabled: readonly,
4046
+ placeholder: t("card.dryRunCommandPlaceholder"),
4047
+ onChange: (e) => {
4048
+ setDryCommand(e.target.value);
4049
+ },
4050
+ onKeyDown: (e) => {
4051
+ if (e.key === "Enter") runDryRunTest();
4052
+ },
4053
+ style: controlStyle
4054
+ })]
4055
+ }),
4056
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4057
+ type: "button",
4058
+ disabled: readonly || dryBusy,
4059
+ onClick: runDryRunTest,
4060
+ style: {
4061
+ ...controlStyle,
4062
+ flex: "0 0 auto",
4063
+ cursor: readonly || dryBusy ? "default" : "pointer"
4064
+ },
4065
+ children: dryBusy ? t("card.dryRunRunning") : t("card.dryRunTest")
4066
+ })
4067
+ ]
4068
+ }),
4069
+ dryError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
4070
+ style: {
4071
+ ...hintStyle,
4072
+ color: "var(--dsw-alias-label-error, #c0392b)"
3929
4073
  },
3930
- children: `deny ${rulesBody.counts?.deny ?? 0} · allow ${rulesBody.counts?.allow ?? 0} · ask ${rulesBody.counts?.ask ?? 0}`
3931
- })] }),
3932
- rulesBody.defaultAction !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
3933
- style: fieldLabelStyle,
3934
- children: [t("card.rulesDefault"), " "]
3935
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
4074
+ children: [t("card.dryRunFail"), dryError]
4075
+ }),
4076
+ dryReport === null ? dryError === null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4077
+ style: hintStyle,
4078
+ children: t("card.dryRunEmpty")
4079
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3936
4080
  style: {
3937
- font: "500 12px/18px var(--ds-font-family-code, monospace)",
3938
- color: "var(--dsw-alias-label-primary)"
4081
+ display: "flex",
4082
+ flexDirection: "column",
4083
+ gap: "4px",
4084
+ padding: "8px 10px",
4085
+ borderRadius: "6px",
4086
+ border: "1px solid var(--dsw-alias-border-l2)",
4087
+ background: "var(--dsw-alias-bg-surface, transparent)",
4088
+ fontSize: "12px",
4089
+ lineHeight: "18px"
3939
4090
  },
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))
4091
+ children: [
4092
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4093
+ style: {
4094
+ display: "flex",
4095
+ alignItems: "center",
4096
+ gap: "8px"
4097
+ },
4098
+ children: [
4099
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4100
+ style: fieldLabelStyle,
4101
+ children: t("card.dryRunVerdict")
4102
+ }),
4103
+ (() => {
4104
+ const verdict = dryReport.verdict ?? "ask";
4105
+ const colour = verdict === "deny" ? "var(--dsw-alias-label-error, #c0392b)" : verdict === "allow" ? "var(--dsw-alias-label-success, #2e7d32)" : "var(--dsw-alias-label-warning, #b26a00)";
4106
+ const text = verdict === "deny" ? t("card.dryRunDeny") : verdict === "allow" ? t("card.dryRunAllow") : t("card.dryRunAsk");
4107
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
4108
+ style: { color: colour },
4109
+ children: text
4110
+ });
4111
+ })(),
4112
+ (dryReport.ruleCount ?? 0) === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4113
+ style: { color: "var(--dsw-alias-label-secondary, inherit)" },
4114
+ children: t("card.dryRunNoRules")
4115
+ })
4116
+ ]
4117
+ }),
4118
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4119
+ style: {
4120
+ display: "flex",
4121
+ gap: "8px",
4122
+ overflowWrap: "anywhere"
4123
+ },
4124
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4125
+ style: fieldLabelStyle,
4126
+ children: t("card.dryRunRule")
4127
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
4128
+ style: {
4129
+ font: "500 12px/18px var(--ds-font-family-code, monospace)",
4130
+ color: "var(--dsw-alias-label-primary)"
4131
+ },
4132
+ children: dryReport.ruleLayer?.ruleIndex === void 0 ? t("card.dryRunRuleNone").replace("%d", dryReport.defaultAction ?? "ask") : `#${dryReport.ruleLayer.ruleIndex} (${dryReport.ruleLayer.action ?? "?"})`
4133
+ })]
4134
+ }),
4135
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4136
+ style: {
4137
+ display: "flex",
4138
+ gap: "8px",
4139
+ overflowWrap: "anywhere"
4140
+ },
4141
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4142
+ style: fieldLabelStyle,
4143
+ children: t("card.dryRunDimensions")
4144
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
4145
+ style: {
4146
+ font: "500 12px/18px var(--ds-font-family-code, monospace)",
4147
+ color: "var(--dsw-alias-label-primary)"
4148
+ },
4149
+ children: (dryReport.ruleLayer?.matchedDimensions ?? []).length === 0 ? "—" : (dryReport.ruleLayer?.matchedDimensions ?? []).join(", ")
4150
+ })]
4151
+ }),
4152
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4153
+ style: {
4154
+ display: "flex",
4155
+ gap: "8px",
4156
+ overflowWrap: "anywhere"
4157
+ },
4158
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4159
+ style: fieldLabelStyle,
4160
+ children: t("card.dryRunReason")
4161
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4162
+ style: { color: "var(--dsw-alias-label-secondary, inherit)" },
4163
+ children: dryReport.reason ?? ""
4164
+ })]
4165
+ }),
4166
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4167
+ style: {
4168
+ ...hintStyle,
4169
+ margin: 0
4170
+ },
4171
+ children: t("card.dryRunNote")
4172
+ })
4173
+ ]
3945
4174
  })
3946
4175
  ]
3947
- }),
3948
- rulesBody.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
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")
4176
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4177
+ style: sectionStyle,
4178
+ children: [
4179
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4180
+ style: {
4181
+ display: "flex",
4182
+ alignItems: "center",
4183
+ justifyContent: "space-between",
4184
+ gap: "8px"
4185
+ },
4186
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4187
+ style: labelStyle,
4188
+ children: t("card.rules")
4189
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4190
+ type: "button",
4191
+ disabled: rulesBusy,
4192
+ onClick: loadRules,
4193
+ style: {
4194
+ ...controlStyle,
4195
+ flex: "0 0 auto",
4196
+ cursor: rulesBusy ? "default" : "pointer"
4197
+ },
4198
+ children: rulesBusy ? t("card.rulesLoading") : t("card.rulesRefresh")
4199
+ })]
4200
+ }),
4201
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4202
+ style: hintStyle,
4203
+ children: t("card.rulesHint")
4204
+ }),
4205
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4206
+ style: {
4207
+ display: "flex",
4208
+ gap: "8px",
4209
+ overflowWrap: "anywhere",
4210
+ marginTop: "6px"
4211
+ },
4212
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4213
+ style: fieldLabelStyle,
4214
+ children: t("card.rulesPath")
4215
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
4216
+ style: {
4217
+ font: "500 12px/18px var(--ds-font-family-code, monospace)",
4218
+ color: "var(--dsw-alias-label-primary)"
4219
+ },
4220
+ children: rulesBody?.path !== void 0 && rulesBody.path !== "" ? rulesBody.path : t("card.rulesNone")
4221
+ })]
4222
+ }),
4223
+ rulesError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
4224
+ style: {
4225
+ ...hintStyle,
4226
+ color: "var(--dsw-alias-label-error, #c0392b)"
4227
+ },
4228
+ children: [t("card.rulesError"), rulesError]
4229
+ }),
4230
+ rulesBody !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
4231
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4232
+ style: {
4233
+ display: "flex",
4234
+ flexWrap: "wrap",
4235
+ gap: "12px",
4236
+ marginTop: "4px"
4237
+ },
4238
+ children: [
4239
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
4240
+ style: fieldLabelStyle,
4241
+ children: [t("card.rulesCounts"), " "]
4242
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
4243
+ style: {
4244
+ font: "500 12px/18px var(--ds-font-family-code, monospace)",
4245
+ color: "var(--dsw-alias-label-primary)"
4246
+ },
4247
+ children: `deny ${rulesBody.counts?.deny ?? 0} · allow ${rulesBody.counts?.allow ?? 0} · ask ${rulesBody.counts?.ask ?? 0}`
4248
+ })] }),
4249
+ rulesBody.defaultAction !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
4250
+ style: fieldLabelStyle,
4251
+ children: [t("card.rulesDefault"), " "]
4252
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
4253
+ style: {
4254
+ font: "500 12px/18px var(--ds-font-family-code, monospace)",
4255
+ color: "var(--dsw-alias-label-primary)"
4256
+ },
4257
+ children: rulesBody.defaultAction
4258
+ })] }),
4259
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4260
+ style: fieldLabelStyle,
4261
+ children: t("card.rulesStats").replace("%b", String(rulesBody.bytes ?? 0)).replace("%l", String(rulesBody.lines ?? 0))
4262
+ })
4263
+ ]
4264
+ }),
4265
+ rulesBody.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4266
+ style: {
4267
+ ...hintStyle,
4268
+ color: "var(--dsw-alias-label-error, #c0392b)"
4269
+ },
4270
+ children: rulesBody.error
4271
+ }),
4272
+ rulesBody.exists === false && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4273
+ style: hintStyle,
4274
+ children: t("card.rulesMissing")
4275
+ }),
4276
+ rulesBody.truncated === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4277
+ style: hintStyle,
4278
+ children: t("card.rulesTruncated")
4279
+ }),
4280
+ (rulesBody.raw ?? "") !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
4281
+ style: {
4282
+ margin: "6px 0 0",
4283
+ padding: "8px 10px",
4284
+ maxHeight: "260px",
4285
+ overflow: "auto",
4286
+ borderRadius: "6px",
4287
+ border: "1px solid var(--dsw-alias-border-l2)",
4288
+ background: "var(--dsw-alias-bg-surface, transparent)",
4289
+ font: "500 12px/18px var(--ds-font-family-code, monospace)",
4290
+ color: "var(--dsw-alias-label-primary)",
4291
+ whiteSpace: "pre"
4292
+ },
4293
+ children: rulesBody.raw
4294
+ }),
4295
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4296
+ style: {
4297
+ ...hintStyle,
4298
+ margin: 0
4299
+ },
4300
+ children: t("card.rulesNote")
4301
+ })
4302
+ ] })
4303
+ ]
4092
4304
  })]
4093
4305
  }),
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
- },
4306
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
4307
+ id: "pg-drawer-lists",
4308
+ title: t("card.lists"),
4309
+ summary: listsSummary,
4310
+ children: [
4311
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4312
+ style: sectionStyle,
4276
4313
  children: [
4277
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
4314
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4315
+ style: labelStyle,
4316
+ children: t("card.allowlist")
4317
+ }),
4318
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4319
+ style: hintStyle,
4320
+ children: t("card.allowlistHint")
4321
+ }),
4322
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4323
+ style: hintStyle,
4324
+ children: t("card.allowlistPresetNote")
4325
+ }),
4326
+ patterns.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4278
4327
  style: {
4279
- flex: "1 1 auto",
4280
- minWidth: 0,
4281
- overflowWrap: "anywhere",
4282
- font: "500 12px/18px var(--ds-font-family-code, monospace)",
4283
- color: "var(--dsw-alias-label-primary)"
4328
+ padding: "6px 0",
4329
+ fontSize: "12px",
4330
+ color: "var(--dsw-alias-label-tertiary)"
4331
+ },
4332
+ children: t("card.allowlistEmpty")
4333
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4334
+ style: {
4335
+ display: "flex",
4336
+ flexDirection: "column",
4337
+ gap: "4px",
4338
+ margin: "6px 0"
4284
4339
  },
4285
- children: keyword
4340
+ children: patterns.map((pattern, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4341
+ style: {
4342
+ display: "flex",
4343
+ alignItems: "center",
4344
+ gap: "8px",
4345
+ padding: "4px 8px",
4346
+ borderRadius: "6px",
4347
+ border: "1px solid var(--dsw-alias-border-l2)",
4348
+ background: "var(--dsw-alias-bg-surface, transparent)"
4349
+ },
4350
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
4351
+ style: {
4352
+ flex: "1 1 auto",
4353
+ minWidth: 0,
4354
+ overflowWrap: "anywhere",
4355
+ font: "500 12px/18px var(--ds-font-family-code, monospace)",
4356
+ color: "var(--dsw-alias-label-primary)"
4357
+ },
4358
+ children: pattern
4359
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4360
+ type: "button",
4361
+ "aria-label": t("card.allowlistRemove"),
4362
+ title: t("card.allowlistRemove"),
4363
+ disabled: readonly,
4364
+ onClick: () => {
4365
+ removePattern(index);
4366
+ },
4367
+ style: {
4368
+ flex: "0 0 auto",
4369
+ width: "20px",
4370
+ height: "20px",
4371
+ border: "none",
4372
+ borderRadius: "999px",
4373
+ background: "transparent",
4374
+ color: "var(--dsw-alias-label-tertiary)",
4375
+ cursor: readonly ? "default" : "pointer"
4376
+ },
4377
+ children: "✕"
4378
+ })]
4379
+ }, `${index}:${pattern}`))
4286
4380
  }),
4287
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4381
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4288
4382
  style: {
4289
- flex: "0 0 auto",
4290
- fontSize: "11px",
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)"
4383
+ display: "flex",
4384
+ gap: "6px",
4385
+ marginTop: "6px"
4386
+ },
4387
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4388
+ type: "text",
4389
+ value: addDraft,
4390
+ disabled: readonly,
4391
+ placeholder: t("card.allowlistPlaceholder"),
4392
+ spellCheck: false,
4393
+ style: {
4394
+ ...controlStyle,
4395
+ flex: "1 1 auto",
4396
+ minWidth: 0
4397
+ },
4398
+ onChange: (event) => {
4399
+ setAddDraft(event.currentTarget.value);
4400
+ },
4401
+ onKeyDown: (event) => {
4402
+ if (event.key === "Enter") addPattern();
4403
+ }
4404
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4405
+ type: "button",
4406
+ disabled: readonly || addDraft.trim() === "",
4407
+ onClick: addPattern,
4408
+ style: {
4409
+ ...controlStyle,
4410
+ flex: "0 0 auto",
4411
+ cursor: readonly || addDraft.trim() === "" ? "default" : "pointer",
4412
+ opacity: readonly || addDraft.trim() === "" ? .5 : 1
4413
+ },
4414
+ children: t("card.allowlistAdd")
4415
+ })]
4416
+ }),
4417
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4418
+ style: {
4419
+ display: "flex",
4420
+ justifyContent: "flex-end",
4421
+ marginTop: "6px"
4296
4422
  },
4297
- children: preset ? t("card.denylistTagPreset") : t("card.denylistTagCustom")
4423
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4424
+ type: "button",
4425
+ onClick: () => {
4426
+ setBulkOpen((current) => !current);
4427
+ },
4428
+ style: {
4429
+ ...controlStyle,
4430
+ cursor: "pointer",
4431
+ border: "none",
4432
+ background: "transparent",
4433
+ color: "var(--dsw-alias-label-tertiary)"
4434
+ },
4435
+ children: bulkOpen ? t("card.allowlistBulkHide") : t("card.allowlistBulk")
4436
+ })
4298
4437
  }),
4299
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4300
- type: "button",
4301
- "aria-label": t("card.denylistRemove"),
4302
- title: t("card.denylistRemove"),
4438
+ bulkOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
4439
+ id: "plugin-config-perm-gate-allowlist",
4440
+ value: allowlistShown,
4303
4441
  disabled: readonly,
4304
- onClick: () => {
4305
- removeDeny(index);
4442
+ rows: 6,
4443
+ spellCheck: false,
4444
+ style: {
4445
+ ...controlStyle,
4446
+ width: "100%",
4447
+ boxSizing: "border-box",
4448
+ resize: "vertical",
4449
+ fontFamily: "var(--ds-font-family-code, monospace)",
4450
+ whiteSpace: "pre"
4306
4451
  },
4452
+ onChange: (event) => {
4453
+ setAllowDirty(true);
4454
+ setAllowText(event.currentTarget.value);
4455
+ },
4456
+ onKeyDown: (event) => {
4457
+ if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) commitAllowlist();
4458
+ }
4459
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4307
4460
  style: {
4308
- flex: "0 0 auto",
4309
- width: "20px",
4310
- height: "20px",
4311
- border: "none",
4312
- borderRadius: "999px",
4313
- background: "transparent",
4314
- color: "var(--dsw-alias-label-tertiary)",
4315
- cursor: readonly ? "default" : "pointer"
4461
+ display: "flex",
4462
+ justifyContent: "flex-end",
4463
+ marginTop: "6px"
4316
4464
  },
4317
- children: "✕"
4465
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4466
+ type: "button",
4467
+ disabled: readonly || !allowDirty,
4468
+ onClick: commitAllowlist,
4469
+ style: {
4470
+ ...controlStyle,
4471
+ cursor: readonly || !allowDirty ? "default" : "pointer",
4472
+ opacity: readonly || !allowDirty ? .5 : 1
4473
+ },
4474
+ children: t("card.allowlistSave")
4475
+ })
4476
+ })] }) : null
4477
+ ]
4478
+ }),
4479
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
4480
+ style: sectionStyle,
4481
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
4482
+ label: t("card.autoAllowTools"),
4483
+ hint: t("card.autoAllowToolsHint"),
4484
+ placeholder: t("card.autoAllowToolsPlaceholder"),
4485
+ addLabel: t("card.denylistAdd"),
4486
+ removeLabel: t("card.listRemove"),
4487
+ items: value.autoAllowTools ?? [],
4488
+ locked: readonly,
4489
+ onAdd: (entry) => {
4490
+ scope.set("autoAllowTools", [...value.autoAllowTools ?? [], entry]);
4491
+ },
4492
+ onRemove: (index) => {
4493
+ scope.set("autoAllowTools", (value.autoAllowTools ?? []).filter((_, i) => i !== index));
4494
+ }
4495
+ })
4496
+ }),
4497
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4498
+ style: sectionStyle,
4499
+ children: [
4500
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
4501
+ label: t("card.denyKeywordsExtra"),
4502
+ hint: t("card.denyKeywordsExtraHint"),
4503
+ placeholder: t("card.denylistPlaceholder"),
4504
+ addLabel: t("card.denylistAdd"),
4505
+ removeLabel: t("card.listRemove"),
4506
+ items: value.denyKeywordsExtra ?? [],
4507
+ locked: readonly,
4508
+ onAdd: (entry) => {
4509
+ scope.set("denyKeywordsExtra", [...value.denyKeywordsExtra ?? [], entry]);
4510
+ },
4511
+ onRemove: (index) => {
4512
+ scope.set("denyKeywordsExtra", (value.denyKeywordsExtra ?? []).filter((_, i) => i !== index));
4513
+ }
4514
+ }),
4515
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "10px" } }),
4516
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
4517
+ label: t("card.extraContentArgKeys"),
4518
+ hint: t("card.extraContentArgKeysHint"),
4519
+ placeholder: t("card.extraContentArgKeysPlaceholder"),
4520
+ addLabel: t("card.denylistAdd"),
4521
+ removeLabel: t("card.listRemove"),
4522
+ items: value.extraContentArgKeys ?? [],
4523
+ locked: readonly,
4524
+ onAdd: (entry) => {
4525
+ scope.set("extraContentArgKeys", [...value.extraContentArgKeys ?? [], entry]);
4526
+ },
4527
+ onRemove: (index) => {
4528
+ scope.set("extraContentArgKeys", (value.extraContentArgKeys ?? []).filter((_, i) => i !== index));
4529
+ }
4530
+ }),
4531
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "10px" } }),
4532
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
4533
+ label: t("card.extraOperationArgKeys"),
4534
+ hint: t("card.extraOperationArgKeysHint"),
4535
+ placeholder: t("card.extraContentArgKeysPlaceholder"),
4536
+ addLabel: t("card.denylistAdd"),
4537
+ removeLabel: t("card.listRemove"),
4538
+ items: value.extraOperationArgKeys ?? [],
4539
+ locked: readonly,
4540
+ onAdd: (entry) => {
4541
+ scope.set("extraOperationArgKeys", [...value.extraOperationArgKeys ?? [], entry]);
4542
+ },
4543
+ onRemove: (index) => {
4544
+ scope.set("extraOperationArgKeys", (value.extraOperationArgKeys ?? []).filter((_, i) => i !== index));
4545
+ }
4318
4546
  })
4319
4547
  ]
4320
- }, `${index}:${keyword}`);
4321
- })
4548
+ }),
4549
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4550
+ style: sectionStyle,
4551
+ children: [
4552
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4553
+ style: labelStyle,
4554
+ children: t("card.denylist")
4555
+ }),
4556
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4557
+ style: hintStyle,
4558
+ children: t("card.denylistHint")
4559
+ }),
4560
+ customDeny.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4561
+ style: {
4562
+ ...labelStyle,
4563
+ fontSize: "12px"
4564
+ },
4565
+ children: t("card.denylistCustom")
4566
+ }),
4567
+ customDeny.map((pair) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4568
+ style: { margin: "6px 0" },
4569
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DenyRow, {
4570
+ keyword: pair.keyword,
4571
+ index: pair.index,
4572
+ muted: false,
4573
+ locked: readonly,
4574
+ removeLabel: t("card.denylistRemove"),
4575
+ onRemove: removeDeny
4576
+ })
4577
+ }, `${pair.index}:${pair.keyword}`)),
4578
+ presetDeny.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4579
+ type: "button",
4580
+ "aria-expanded": presetDenyOpen,
4581
+ onClick: () => {
4582
+ setPresetDenyOpen((current) => !current);
4583
+ },
4584
+ style: {
4585
+ ...drawerHeaderStyle,
4586
+ width: "auto",
4587
+ alignSelf: "flex-start",
4588
+ padding: "6px 4px"
4589
+ },
4590
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
4591
+ width: "12",
4592
+ height: "12",
4593
+ viewBox: "0 0 16 16",
4594
+ "aria-hidden": true,
4595
+ style: {
4596
+ color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))",
4597
+ flex: "0 0 auto",
4598
+ transition: "transform 0.16s",
4599
+ transform: presetDenyOpen ? "rotate(180deg)" : "none"
4600
+ },
4601
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
4602
+ d: "M4 6l4 4 4-4",
4603
+ fill: "none",
4604
+ stroke: "currentColor",
4605
+ strokeWidth: "1.5",
4606
+ strokeLinecap: "round",
4607
+ strokeLinejoin: "round"
4608
+ })
4609
+ }), t("card.denylistPresetCollapse").replace("%n", String(presetDeny.length))]
4610
+ }), presetDenyOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4611
+ style: {
4612
+ display: "flex",
4613
+ flexDirection: "column",
4614
+ gap: "4px",
4615
+ margin: "6px 0"
4616
+ },
4617
+ children: presetDeny.map((pair) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DenyRow, {
4618
+ keyword: pair.keyword,
4619
+ index: pair.index,
4620
+ muted: true,
4621
+ locked: readonly,
4622
+ removeLabel: t("card.denylistRemove"),
4623
+ onRemove: removeDeny
4624
+ }, `${pair.index}:${pair.keyword}`))
4625
+ }) : null] }),
4626
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4627
+ style: {
4628
+ display: "flex",
4629
+ gap: "6px",
4630
+ marginTop: "6px"
4631
+ },
4632
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4633
+ type: "text",
4634
+ value: denyDraft,
4635
+ disabled: readonly,
4636
+ placeholder: t("card.denylistPlaceholder"),
4637
+ spellCheck: false,
4638
+ style: {
4639
+ ...controlStyle,
4640
+ flex: "1 1 auto",
4641
+ minWidth: 0
4642
+ },
4643
+ onChange: (event) => {
4644
+ setDenyDraft(event.currentTarget.value);
4645
+ },
4646
+ onKeyDown: (event) => {
4647
+ if (event.key === "Enter") addDeny();
4648
+ }
4649
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4650
+ type: "button",
4651
+ disabled: readonly || denyDraft.trim() === "",
4652
+ onClick: addDeny,
4653
+ style: {
4654
+ ...controlStyle,
4655
+ flex: "0 0 auto",
4656
+ cursor: readonly || denyDraft.trim() === "" ? "default" : "pointer",
4657
+ opacity: readonly || denyDraft.trim() === "" ? .5 : 1
4658
+ },
4659
+ children: t("card.denylistAdd")
4660
+ })]
4661
+ }),
4662
+ denyActive ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4663
+ style: {
4664
+ display: "flex",
4665
+ justifyContent: "flex-end",
4666
+ marginTop: "6px"
4667
+ },
4668
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4669
+ type: "button",
4670
+ disabled: readonly,
4671
+ onClick: restoreDeny,
4672
+ style: {
4673
+ ...controlStyle,
4674
+ cursor: readonly ? "default" : "pointer",
4675
+ border: "none",
4676
+ background: "transparent",
4677
+ color: "var(--dsw-alias-label-tertiary)"
4678
+ },
4679
+ children: t("card.denylistRestore")
4680
+ })
4681
+ }) : null
4682
+ ]
4683
+ })
4684
+ ]
4322
4685
  }),
4323
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4324
- style: {
4325
- display: "flex",
4326
- gap: "6px",
4327
- marginTop: "6px"
4328
- },
4329
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4330
- type: "text",
4331
- value: denyDraft,
4332
- disabled: readonly,
4333
- placeholder: t("card.denylistPlaceholder"),
4334
- spellCheck: false,
4335
- style: {
4336
- ...controlStyle,
4337
- flex: "1 1 auto",
4338
- minWidth: 0
4339
- },
4340
- onChange: (event) => {
4341
- setDenyDraft(event.currentTarget.value);
4342
- },
4343
- onKeyDown: (event) => {
4344
- if (event.key === "Enter") addDeny();
4345
- }
4346
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4347
- type: "button",
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")
4686
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
4687
+ id: "pg-drawer-credentials",
4688
+ title: t("card.credentials"),
4689
+ summary: credSummary,
4690
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
4691
+ style: sectionStyle,
4692
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringListField, {
4693
+ label: t("card.credentialPaths"),
4694
+ hint: t("card.credentialPathsHint"),
4695
+ placeholder: t("card.credentialPathsPlaceholder"),
4696
+ addLabel: t("card.denylistAdd"),
4697
+ removeLabel: t("card.listRemove"),
4698
+ items: value.credentialPaths ?? [],
4699
+ locked: readonly,
4700
+ onAdd: (entry) => {
4701
+ scope.set("credentialPaths", [...value.credentialPaths ?? [], entry]);
4702
+ },
4703
+ onRemove: (index) => {
4704
+ scope.set("credentialPaths", (value.credentialPaths ?? []).filter((_, i) => i !== index));
4705
+ }
4706
+ })
4707
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredLadderSection, {
4708
+ t,
4709
+ readonly,
4710
+ onRungs: handleCredRungs
4357
4711
  })]
4358
4712
  }),
4359
- denyActive ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4360
- style: {
4361
- display: "flex",
4362
- justifyContent: "flex-end",
4363
- marginTop: "6px"
4364
- },
4365
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4366
- type: "button",
4367
- disabled: readonly,
4368
- onClick: restoreDeny,
4369
- style: {
4370
- ...controlStyle,
4371
- cursor: readonly ? "default" : "pointer",
4372
- border: "none",
4373
- background: "transparent",
4374
- color: "var(--dsw-alias-label-tertiary)"
4375
- },
4376
- children: t("card.denylistRestore")
4377
- })
4378
- }) : null
4379
- ]
4380
- }),
4381
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4382
- style: sectionStyle,
4383
- children: [
4384
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4385
- style: labelStyle,
4386
- children: t("card.networkEnabled")
4387
- }),
4388
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4389
- style: hintStyle,
4390
- children: t("card.networkEnabledHint")
4391
- }),
4392
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4393
- style: {
4394
- display: "flex",
4395
- alignItems: "center",
4396
- gap: "8px",
4397
- marginTop: "6px"
4398
- },
4399
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
4400
- id: "plugin-config-perm-gate-network-enabled",
4401
- label: t("card.networkEnabled"),
4402
- checked: value.networkEnabled === true,
4403
- disabled: readonly,
4404
- onCommit: (next) => scope.set("networkEnabled", next)
4405
- })
4406
- }),
4407
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4408
- style: hintStyle,
4409
- children: t("card.networkRebindNote")
4410
- })
4411
- ]
4412
- }),
4413
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4414
- style: sectionStyle,
4415
- children: [
4416
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4417
- style: labelStyle,
4418
- children: t("card.networkInjectEnv")
4419
- }),
4420
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4421
- style: hintStyle,
4422
- children: t("card.networkInjectEnvHint")
4423
- }),
4424
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
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
- })
4713
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerGroup, {
4714
+ id: "pg-drawer-network",
4715
+ title: t("card.networkOps"),
4716
+ summary: networkSummary,
4717
+ children: [
4718
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4719
+ style: rowStyle,
4720
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
4721
+ htmlFor: "plugin-config-perm-gate-network-enabled",
4722
+ style: { fontSize: "12px" },
4723
+ children: t("card.networkEnabled")
4724
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
4725
+ id: "plugin-config-perm-gate-network-enabled",
4726
+ label: t("card.networkEnabled"),
4727
+ checked: value.networkEnabled === true,
4728
+ disabled: readonly,
4729
+ onCommit: (next) => scope.set("networkEnabled", next)
4730
+ })]
4731
+ }),
4732
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4733
+ style: hintStyle,
4734
+ children: t("card.networkEnabledHint")
4735
+ }),
4736
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4737
+ style: hintStyle,
4738
+ children: t("card.networkRebindNote")
4739
+ }),
4740
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "8px" } }),
4741
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4742
+ style: rowStyle,
4743
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
4744
+ htmlFor: "plugin-config-perm-gate-network-inject-env",
4745
+ style: { fontSize: "12px" },
4746
+ children: t("card.networkInjectEnv")
4747
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
4748
+ id: "plugin-config-perm-gate-network-inject-env",
4749
+ label: t("card.networkInjectEnv"),
4750
+ checked: value.networkInjectEnv !== false,
4751
+ disabled: readonly,
4752
+ onCommit: (next) => scope.set("networkInjectEnv", next)
4753
+ })]
4754
+ }),
4755
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4756
+ style: hintStyle,
4757
+ children: t("card.networkInjectEnvHint")
4758
+ }),
4759
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: { height: "8px" } }),
4760
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4761
+ style: rowStyle,
4762
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
4763
+ htmlFor: "plugin-config-perm-gate-watch",
4764
+ style: { fontSize: "12px" },
4765
+ children: t("card.watch")
4766
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
4767
+ id: "plugin-config-perm-gate-watch",
4768
+ label: t("card.watch"),
4769
+ checked: value.watch !== false,
4770
+ disabled: readonly,
4771
+ onCommit: (next) => scope.set("watch", next)
4772
+ })]
4773
+ }),
4774
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4775
+ style: hintStyle,
4776
+ children: t("card.watchHint")
4777
+ })
4778
+ ]
4466
4779
  })
4467
4780
  ]
4468
4781
  }),
@@ -4478,8 +4791,7 @@ window.__ModuleLoader__.load({
4478
4791
  }) : null]
4479
4792
  });
4480
4793
  }
4481
- //#endregion
4482
- //#region src/client/feed.ts
4794
+ // src/client/feed.ts
4483
4795
  /** Fetch decision events for one session; `since > 0` returns only newer ones. */
4484
4796
  async function fetchEvents(sessionId, since) {
4485
4797
  const query = `/api/dsh-perm-gate/events?sessionId=${encodeURIComponent(sessionId)}${since > 0 ? `&since=${since}` : ""}`;
@@ -4767,8 +5079,7 @@ window.__ModuleLoader__.load({
4767
5079
  };
4768
5080
  }
4769
5081
  }
4770
- //#endregion
4771
- //#region src/client/notice.tsx
5082
+ // src/client/notice.tsx
4772
5083
  /**
4773
5084
  * Gate decision notice strip — the `conversation.input.dock` face of
4774
5085
  * dsh-perm-gate (a simplified version of the review-feed pattern demonstrated
@@ -4900,8 +5211,7 @@ window.__ModuleLoader__.load({
4900
5211
  ]
4901
5212
  });
4902
5213
  }
4903
- //#endregion
4904
- //#region src/client/history.tsx
5214
+ // src/client/history.tsx
4905
5215
  /**
4906
5216
  * Approval-history view — the `conversation.view` face of dsh-perm-gate,
4907
5217
  * following the session-scoped review-page pattern demonstrated by
@@ -5640,8 +5950,7 @@ window.__ModuleLoader__.load({
5640
5950
  ]
5641
5951
  });
5642
5952
  }
5643
- //#endregion
5644
- //#region src/client/compat.ts
5953
+ // src/client/compat.ts
5645
5954
  /**
5646
5955
  * Resolve the plugin's durable settings scope through whichever service this
5647
5956
  * host line carries, then hand it to `onScope` exactly once.
@@ -5660,8 +5969,7 @@ window.__ModuleLoader__.load({
5660
5969
  onScope(settingsScope.bind({ namespace }), "settingsScope");
5661
5970
  });
5662
5971
  }
5663
- //#endregion
5664
- //#region src/client/bridge-scope.ts
5972
+ // src/client/bridge-scope.ts
5665
5973
  /** 与 server 侧 bridgeRoutesFor(src/bridge.ts)必须逐字符一致。 */
5666
5974
  function bridgeRoutesFor(ns) {
5667
5975
  return {
@@ -5766,8 +6074,7 @@ window.__ModuleLoader__.load({
5766
6074
  this.notify();
5767
6075
  }
5768
6076
  };
5769
- //#endregion
5770
- //#region src/client/index.ts
6077
+ // src/client/index.ts
5771
6078
  /** The profile entry id of this plugin — the `configForms` key (kept in lockstep with cordis.patch.yml). */
5772
6079
  const PERMISSIVE_NS = "dsh-perm-gate";
5773
6080
  /** Services required by the browser half — generation-neutral only.
@@ -5840,7 +6147,6 @@ window.__ModuleLoader__.load({
5840
6147
  }, PermissiveCard));
5841
6148
  });
5842
6149
  }
5843
- //#endregion
5844
6150
  exports.apply = apply;
5845
6151
  exports.inject = inject;
5846
6152
  return module.exports;