dsh-perm-gate 4.1.1 → 4.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/allow1.png +0 -0
- package/assets/allow2.png +0 -0
- package/assets/gateoff.png +0 -0
- package/assets/llms.png +0 -0
- package/assets/permlist.png +0 -0
- package/assets/setting-head.png +0 -0
- package/assets/setting-rules.png +0 -0
- package/dsh.plugin.json +2 -2
- package/lib/client.js +8 -8
- package/lib/client.js.map +1 -1
- package/lib/config.d.ts +120 -1
- package/lib/config.js +71 -35
- package/lib/index.js +42 -77
- package/package.json +21 -19
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/assets/llms.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dsh.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-perm-gate",
|
|
3
3
|
"name": "dsh-perm-gate",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"description": {
|
|
6
6
|
"en": "Deterministic-first, fail-closed permission gate for DeepSeek Harness 0.1.2+: a P0 hard-deny -> P1 precise session grant -> P2 static allow/deny rule chain -> P3 optional LLM classifier -> P4 ask pipeline over the tools/pre-execute waterfall, with a standalone CLI dry-run evaluator and an auditable decision log. It only vetoes with deny/ask and always delegates otherwise, and unknown or malformed rules fail loud instead of silently standing the gate down.",
|
|
7
7
|
"zh": "面向 DeepSeek Harness 0.1.2+ 的确定性优先、失败即拒的权限闸门:在 tools/pre-execute 瀑布上串起 P0 硬拒绝 → P1 精确会话授权 → P2 静态 allow/deny 规则链 → P3 可选 LLM 语义分类 → P4 ask,并附带独立 CLI 干跑评估器与可审计的决策日志。只以 deny/ask 否决、其余一律放行,规则未知或非法时直接报错,绝不静默失效。"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"engines": {
|
|
16
|
-
"dsh": ">=0.1.
|
|
16
|
+
"dsh": ">=0.1.2-alpha.1"
|
|
17
17
|
},
|
|
18
18
|
"components": {
|
|
19
19
|
"host": "lib/index.js",
|
package/lib/client.js
CHANGED
|
@@ -148,7 +148,7 @@ window.__ModuleLoader__.load({
|
|
|
148
148
|
"card.dryRunFail": "测试失败:",
|
|
149
149
|
"card.dryRunStale": "路由不存在(插件未重启?)",
|
|
150
150
|
"card.rules": "Settings 内置规则",
|
|
151
|
-
"card.rulesHint": "门禁此刻实际加载的规则(来自 settings 命名空间 dsh-perm-gate-rules
|
|
151
|
+
"card.rulesHint": "门禁此刻实际加载的规则(来自 settings 命名空间 dsh-perm-gate-rules)。只读——这里改不了任何东西。要改规则,用下面的白名单,或在设置页中编辑。",
|
|
152
152
|
"card.rulesRefresh": "刷新",
|
|
153
153
|
"card.rulesLoading": "读取中…",
|
|
154
154
|
"card.rulesPath": "来源",
|
|
@@ -300,7 +300,7 @@ window.__ModuleLoader__.load({
|
|
|
300
300
|
"card.dryRunFail": "Test failed: ",
|
|
301
301
|
"card.dryRunStale": "route missing (plugin not restarted?)",
|
|
302
302
|
"card.rules": "Settings Built-in Rules",
|
|
303
|
-
"card.rulesHint": "The rules the gate is loading right now (from the dsh-perm-gate-rules settings namespace). Read-only — nothing here can change them. To change rules, use the allowlist below or edit settings.
|
|
303
|
+
"card.rulesHint": "The rules the gate is loading right now (from the dsh-perm-gate-rules settings namespace). Read-only — nothing here can change them. To change rules, use the allowlist below or edit them on the settings page.",
|
|
304
304
|
"card.rulesRefresh": "Refresh",
|
|
305
305
|
"card.rulesLoading": "Reading…",
|
|
306
306
|
"card.rulesPath": "Source",
|
|
@@ -562,10 +562,10 @@ window.__ModuleLoader__.load({
|
|
|
562
562
|
//#endregion
|
|
563
563
|
//#region src/client/card.tsx
|
|
564
564
|
/**
|
|
565
|
-
* Permissive settings card —
|
|
565
|
+
* Permissive settings card — a `settings.plugins.tab` face of dsh-perm-gate.
|
|
566
566
|
*
|
|
567
|
-
* The card binds the `dsh-perm-gate`
|
|
568
|
-
* `
|
|
567
|
+
* The card binds the plugin's profile entry (`dsh-perm-gate`) through the
|
|
568
|
+
* `configForms` cordis service and renders its fields: the single front switch
|
|
569
569
|
* (`permissive`) plus the three combinable backend strategies
|
|
570
570
|
* (`trustAutoAllow` / `alwaysConfirm` / `llmAssist`). Every change commits
|
|
571
571
|
* immediately through the scope (no staged form); the host reads the namespace
|
|
@@ -3150,13 +3150,13 @@ window.__ModuleLoader__.load({
|
|
|
3150
3150
|
}
|
|
3151
3151
|
//#endregion
|
|
3152
3152
|
//#region src/client/index.ts
|
|
3153
|
-
/** The
|
|
3153
|
+
/** The profile entry id of this plugin — the `configForms` key (kept in lockstep with cordis.patch.yml). */
|
|
3154
3154
|
const PERMISSIVE_NS = "dsh-perm-gate";
|
|
3155
3155
|
/** Services required by the browser half. */
|
|
3156
3156
|
const inject = [
|
|
3157
3157
|
"slots",
|
|
3158
3158
|
"locale",
|
|
3159
|
-
"
|
|
3159
|
+
"configForms"
|
|
3160
3160
|
];
|
|
3161
3161
|
/**
|
|
3162
3162
|
* Client plugin body: dictionaries plus the settings page registration.
|
|
@@ -3195,7 +3195,7 @@ window.__ModuleLoader__.load({
|
|
|
3195
3195
|
label: () => t("card.title"),
|
|
3196
3196
|
locale: NS,
|
|
3197
3197
|
inject: () => {
|
|
3198
|
-
return { scope: ctx.
|
|
3198
|
+
return { scope: ctx.configForms.get(PERMISSIVE_NS) };
|
|
3199
3199
|
}
|
|
3200
3200
|
}, PermissiveCard);
|
|
3201
3201
|
});
|