dsh-perm-gate 5.0.4 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.ja.md +0 -2
- package/CHANGELOG.ko.md +0 -2
- package/CHANGELOG.md +4 -2
- package/INSTALL.ja.md +0 -15
- package/INSTALL.ko.md +0 -15
- package/INSTALL.md +0 -15
- package/INSTALL.zh.md +0 -15
- package/README.ja.md +6 -18
- package/README.ko.md +6 -18
- package/README.md +40 -19
- package/README.zh.md +34 -18
- package/assets/appcontainer-launcher.cs +703 -0
- package/dsh.plugin.json +2 -2
- package/lib/appcontainer/compile.d.ts +17 -0
- package/lib/appcontainer/compile.js +74 -0
- package/lib/appcontainer/exempt.d.ts +18 -0
- package/lib/appcontainer/exempt.js +71 -0
- package/lib/appcontainer/index.d.ts +85 -0
- package/lib/appcontainer/index.js +286 -0
- package/lib/appcontainer/probe.d.ts +44 -0
- package/lib/appcontainer/probe.js +66 -0
- package/lib/appcontainer/sid.d.ts +23 -0
- package/lib/appcontainer/sid.js +33 -0
- package/lib/appcontainer/wrap.d.ts +22 -0
- package/lib/appcontainer/wrap.js +40 -0
- package/lib/cli.js +0 -0
- package/lib/client.js +1425 -1108
- package/lib/client.js.map +1 -1
- package/lib/config.d.ts +41 -1
- package/lib/config.js +6 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +53 -0
- package/lib/runtime.d.ts +22 -0
- package/lib/runtime.js +24 -0
- package/locale/de.json +1 -0
- package/locale/en.json +1 -0
- package/locale/es.json +1 -0
- package/locale/fr.json +1 -0
- package/locale/it.json +1 -0
- package/locale/ja.json +1 -0
- package/locale/ko.json +1 -0
- package/locale/ru.json +1 -0
- package/locale/zh.json +1 -0
- package/package.json +28 -28
- package/scripts/patch-permission-glyph.mjs +0 -0
- package/README.de.md +0 -487
- package/README.es.md +0 -489
- package/README.fr.md +0 -498
- package/README.it.md +0 -490
- package/README.ru.md +0 -478
package/lib/config.d.ts
CHANGED
|
@@ -191,6 +191,38 @@ export interface PermGateConfig {
|
|
|
191
191
|
* Default 1800000 (30 min).
|
|
192
192
|
*/
|
|
193
193
|
readonly networkGrantTtlMs?: number;
|
|
194
|
+
/**
|
|
195
|
+
* Run gate-allowed shell commands inside a Windows AppContainer. The
|
|
196
|
+
* container token carries NO network capability, so non-loopback egress is
|
|
197
|
+
* denied by Windows Firewall (WFP) itself; the container SID is derived
|
|
198
|
+
* deterministically so the loopback exemption is a one-time step. Default
|
|
199
|
+
* false — enabling changes how allowed commands execute.
|
|
200
|
+
*/
|
|
201
|
+
readonly sandboxEnabled?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Filesystem posture inside the container: 'workspace-write' grants the
|
|
204
|
+
* workspace Modify + temp FullControl; 'read-only' grants RX only.
|
|
205
|
+
* System directories stay readable through the stock ALL APPLICATION
|
|
206
|
+
* PACKAGES ACEs. Default 'workspace-write'.
|
|
207
|
+
*/
|
|
208
|
+
readonly sandboxMode?: 'read-only' | 'workspace-write';
|
|
209
|
+
/**
|
|
210
|
+
* THE proxy parameter: the URL injected as HTTP(S)_PROXY / ALL_PROXY into
|
|
211
|
+
* sandboxed processes. Empty (default) follows the builtin filtered proxy
|
|
212
|
+
* (its actual bound 127.0.0.1 port) when networkEnabled; an explicit value
|
|
213
|
+
* must be loopback-bound (the container cannot reach anything else) and the
|
|
214
|
+
* destination filtering is that proxy's job. Neither set → no proxy env;
|
|
215
|
+
* direct egress stays WFP-blocked either way.
|
|
216
|
+
*/
|
|
217
|
+
readonly sandboxProxy?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Attempt the one-time `CheckNetIsolation LoopbackExempt -a -p=<sid>` for
|
|
220
|
+
* the container SID so sandboxed processes can reach 127.0.0.1 (the proxy
|
|
221
|
+
* and the host webServer). Denied without elevation → warning with the
|
|
222
|
+
* exact command; the sandbox still runs, only loopback stays closed.
|
|
223
|
+
* Default 'exempt'.
|
|
224
|
+
*/
|
|
225
|
+
readonly sandboxLoopback?: 'exempt' | 'off';
|
|
194
226
|
/** @deprecated Rules now live in the `dsh-perm-gate-rules` settings namespace; file watching was removed. Accepted (ignored) for composition compatibility. */
|
|
195
227
|
readonly watch?: boolean;
|
|
196
228
|
/** @deprecated See {@link watch}. */
|
|
@@ -349,6 +381,10 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
349
381
|
networkInjectEnv: z<boolean, boolean, "volatile-defined">;
|
|
350
382
|
networkAskTimeoutMs: z<number, number, "volatile-defined">;
|
|
351
383
|
networkGrantTtlMs: z<number, number, "volatile-defined">;
|
|
384
|
+
sandboxEnabled: z<boolean, boolean, "volatile-defined">;
|
|
385
|
+
sandboxMode: z<"read-only" | "workspace-write", "read-only" | "workspace-write", "volatile-defined">;
|
|
386
|
+
sandboxProxy: z<string, string, "volatile-defined">;
|
|
387
|
+
sandboxLoopback: z<"exempt" | "off", "exempt" | "off", "volatile-defined">;
|
|
352
388
|
rules: z<NoInfer<RulesConfig>, NoInfer<RulesConfig>, "volatile">;
|
|
353
389
|
watch: z<boolean, boolean, "defined">;
|
|
354
390
|
watchDebounceMs: z<number, number, "defined">;
|
|
@@ -404,6 +440,10 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
404
440
|
networkInjectEnv: z<boolean, boolean, "volatile-defined">;
|
|
405
441
|
networkAskTimeoutMs: z<number, number, "volatile-defined">;
|
|
406
442
|
networkGrantTtlMs: z<number, number, "volatile-defined">;
|
|
443
|
+
sandboxEnabled: z<boolean, boolean, "volatile-defined">;
|
|
444
|
+
sandboxMode: z<"read-only" | "workspace-write", "read-only" | "workspace-write", "volatile-defined">;
|
|
445
|
+
sandboxProxy: z<string, string, "volatile-defined">;
|
|
446
|
+
sandboxLoopback: z<"exempt" | "off", "exempt" | "off", "volatile-defined">;
|
|
407
447
|
rules: z<NoInfer<RulesConfig>, NoInfer<RulesConfig>, "volatile">;
|
|
408
448
|
watch: z<boolean, boolean, "defined">;
|
|
409
449
|
watchDebounceMs: z<number, number, "defined">;
|
|
@@ -411,7 +451,7 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
411
451
|
/** Live reference the 0.1.7 loader hands `apply` for `.volatile()` config fields. */
|
|
412
452
|
export type VolatileRef<T> = Volatile<T>;
|
|
413
453
|
/** The config fields marked `.volatile()` — live refs inside `apply`'s config. */
|
|
414
|
-
export declare const VOLATILE_CONFIG_KEYS: readonly ["defaultAction", "caseInsensitivePaths", "classifierEnabled", "classifierEndpoint", "classifierModel", "classifierApiKey", "riskTimeoutMs", "riskLearning", "riskSediment", "classifierSource", "classifierProvider", "riskThreshold", "grantTtlMs", "grantMaxUses", "permissive", "permissiveStrategies", "allowlist", "denyKeywords", "autoAllowTools", "sessionSweep", "searchUp", "badFilePolicy", "maxChainLength", "networkEnabled", "networkMode", "networkUnlisted", "networkUnattributed", "networkLoopback", "networkBind", "networkPort", "networkNoProxy", "networkInjectEnv", "networkAskTimeoutMs", "networkGrantTtlMs", "rules"];
|
|
454
|
+
export declare const VOLATILE_CONFIG_KEYS: readonly ["defaultAction", "caseInsensitivePaths", "classifierEnabled", "classifierEndpoint", "classifierModel", "classifierApiKey", "riskTimeoutMs", "riskLearning", "riskSediment", "classifierSource", "classifierProvider", "riskThreshold", "grantTtlMs", "grantMaxUses", "permissive", "permissiveStrategies", "allowlist", "denyKeywords", "autoAllowTools", "sessionSweep", "searchUp", "badFilePolicy", "maxChainLength", "networkEnabled", "networkMode", "networkUnlisted", "networkUnattributed", "networkLoopback", "networkBind", "networkPort", "networkNoProxy", "networkInjectEnv", "networkAskTimeoutMs", "networkGrantTtlMs", "rules", "sandboxEnabled", "sandboxMode", "sandboxProxy", "sandboxLoopback"];
|
|
415
455
|
/** Resolve one possibly-volatile field: a live ref on 0.1.7+, a plain value otherwise. */
|
|
416
456
|
export declare function readVolatileValue<T>(value: T | Volatile<T> | undefined): VolatileSnapshot<T> | undefined;
|
|
417
457
|
/** Shallow-resolve every volatile field into a plain snapshot (one per read). */
|
package/lib/config.js
CHANGED
|
@@ -199,6 +199,11 @@ export const Config = z.object({
|
|
|
199
199
|
networkInjectEnv: z.boolean().default(true).volatile(),
|
|
200
200
|
networkAskTimeoutMs: z.number().min(1000).max(600_000).default(120_000).volatile(),
|
|
201
201
|
networkGrantTtlMs: z.number().min(0).max(24 * 60 * 60_000).default(30 * 60_000).volatile(),
|
|
202
|
+
// AppContainer sandbox (Windows; goal 2)
|
|
203
|
+
sandboxEnabled: z.boolean().default(false).volatile(),
|
|
204
|
+
sandboxMode: z.union(['read-only', 'workspace-write']).default('workspace-write').volatile(),
|
|
205
|
+
sandboxProxy: z.string().default('').volatile(),
|
|
206
|
+
sandboxLoopback: z.union(['exempt', 'off']).default('exempt').volatile(),
|
|
202
207
|
// 0.1.7: the rules document lives on this entry as a volatile whole-object
|
|
203
208
|
// field (a second settings namespace is no longer projectable). Unconfigured
|
|
204
209
|
// (bare defaults) -> the rules file remains the source.
|
|
@@ -217,6 +222,7 @@ export const VOLATILE_CONFIG_KEYS = [
|
|
|
217
222
|
'networkEnabled', 'networkMode', 'networkUnlisted', 'networkUnattributed', 'networkLoopback',
|
|
218
223
|
'networkBind', 'networkPort', 'networkNoProxy', 'networkInjectEnv', 'networkAskTimeoutMs',
|
|
219
224
|
'networkGrantTtlMs', 'rules',
|
|
225
|
+
'sandboxEnabled', 'sandboxMode', 'sandboxProxy', 'sandboxLoopback',
|
|
220
226
|
];
|
|
221
227
|
/** Resolve one possibly-volatile field: a live ref on 0.1.7+, a plain value otherwise. */
|
|
222
228
|
export function readVolatileValue(value) {
|
package/lib/index.d.ts
CHANGED
|
@@ -53,5 +53,5 @@ export declare function makeApprovalAnswerer(runtime: Pick<PermGateRuntime, 'set
|
|
|
53
53
|
* `riskTimeoutMs` (default 20 s), and a grader failure keeps the original ask
|
|
54
54
|
* (fail-closed).
|
|
55
55
|
*/
|
|
56
|
-
export declare function makePreExecuteListener(runtime: Pick<PermGateRuntime, 'decideExecution' | 'refineAsk' | 'beginShellExecution'>): (exec: ToolExecutionLike, next: () => Promise<unknown>) => Promise<unknown>;
|
|
56
|
+
export declare function makePreExecuteListener(runtime: Pick<PermGateRuntime, 'decideExecution' | 'refineAsk' | 'beginShellExecution'> & Partial<Pick<PermGateRuntime, 'sandboxRewrite'>>): (exec: ToolExecutionLike, next: () => Promise<unknown>) => Promise<unknown>;
|
|
57
57
|
export declare function apply(ctx: Context, config?: Record<string, unknown>): PermGateRuntime;
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
+
import { SandboxController } from './appcontainer/index.js';
|
|
3
4
|
import { Config, ensureDataDir, readRulesFromSettings, readVolatileValue, resolveVolatileConfig, resolveDshHome, resolveDataDir, resolveGatePresets, resolvePermissiveStrategies, resolveRulesFile } from './config.js';
|
|
4
5
|
import { appendAllowToSettings, readRulesFileDoc, replaceAllowInSettings } from './allowlist.js';
|
|
5
6
|
import { runDryRun } from './dry-run.js';
|
|
@@ -142,6 +143,22 @@ export function makePreExecuteListener(runtime) {
|
|
|
142
143
|
// The call proceeds: register it so a network connection made by its
|
|
143
144
|
// child process can be attributed back to this session.
|
|
144
145
|
runtime.beginShellExecution(exec);
|
|
146
|
+
// AppContainer sandbox (goal 2): rewrite the allowed shell call into
|
|
147
|
+
// the launcher invocation, or fail closed. The host executes THIS exec
|
|
148
|
+
// object after the waterfall resolves, so the in-place arguments swap
|
|
149
|
+
// is the sanctioned seam; the base64 wrapper keeps every pipe/&&
|
|
150
|
+
// inside the container (outer shell sees a plain exe call).
|
|
151
|
+
if (typeof runtime.sandboxRewrite === 'function') {
|
|
152
|
+
const rewrite = await runtime.sandboxRewrite(exec);
|
|
153
|
+
if (rewrite !== undefined) {
|
|
154
|
+
if (rewrite.kind === 'deny')
|
|
155
|
+
return { kind: 'deny', reason: rewrite.reason };
|
|
156
|
+
exec.arguments = {
|
|
157
|
+
...exec.arguments,
|
|
158
|
+
command: rewrite.command,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
145
162
|
return next();
|
|
146
163
|
}
|
|
147
164
|
if (decision.kind !== 'ask')
|
|
@@ -709,6 +726,42 @@ export function apply(ctx, config = {}) {
|
|
|
709
726
|
networkRefs.snapshot = () => networkLifecycle.snapshot();
|
|
710
727
|
if (networkRefs.appliedKey === undefined)
|
|
711
728
|
networkRefs.appliedKey = networkKeyOf(current());
|
|
729
|
+
// ─── AppContainer sandbox (goal 2, Windows) ─────────────────────────
|
|
730
|
+
// The gate-aware rewrite hook: an ALLOWED shell call is rewritten into the
|
|
731
|
+
// launcher invocation (or denied, fail-closed). Settings are read per call
|
|
732
|
+
// so the card's switches apply without a reload; the controller memoizes
|
|
733
|
+
// the launcher compile + loopback exemption.
|
|
734
|
+
const readSandboxSettings = () => {
|
|
735
|
+
const live = current();
|
|
736
|
+
const str = (key, fallback) => typeof live[key] === 'string' && live[key] !== '' ? live[key] : fallback;
|
|
737
|
+
const bool = (key, fallback) => typeof live[key] === 'boolean' ? live[key] : fallback;
|
|
738
|
+
return {
|
|
739
|
+
enabled: bool('sandboxEnabled', false),
|
|
740
|
+
mode: str('sandboxMode', 'workspace-write'),
|
|
741
|
+
proxy: str('sandboxProxy', ''),
|
|
742
|
+
loopback: str('sandboxLoopback', 'exempt'),
|
|
743
|
+
};
|
|
744
|
+
};
|
|
745
|
+
const sandboxController = new SandboxController({
|
|
746
|
+
cwdRoot: () => process.cwd(),
|
|
747
|
+
builtinProxyPort: () => {
|
|
748
|
+
try {
|
|
749
|
+
const snap = networkLifecycle.snapshot();
|
|
750
|
+
return snap.proxyActive === true && typeof snap.port === 'number' ? snap.port : undefined;
|
|
751
|
+
}
|
|
752
|
+
catch {
|
|
753
|
+
return undefined;
|
|
754
|
+
}
|
|
755
|
+
},
|
|
756
|
+
log: (message) => loggerWarn(message),
|
|
757
|
+
});
|
|
758
|
+
runtime.setSandboxHook((exec) => sandboxController.wrap(readSandboxSettings(), exec));
|
|
759
|
+
// The sandbox is Windows-only: on any other platform an enabled switch is a
|
|
760
|
+
// misconfiguration — warn once and treat it as off (wrap() also guards).
|
|
761
|
+
if (readSandboxSettings().enabled && process.platform !== 'win32') {
|
|
762
|
+
loggerWarn('[dsh-perm-gate] sandbox: sandboxEnabled is set but this host is not Windows — the AppContainer sandbox stays OFF');
|
|
763
|
+
}
|
|
764
|
+
ctx.effect(() => () => { void sandboxController.dispose(); }, 'dsh-perm-gate: sandbox scratch cleanup');
|
|
712
765
|
// ─── Hot reload watcher (Phase 3, T3.6) ────────────────────────────
|
|
713
766
|
const watchEnabled = typeof config.watch === 'boolean' ? config.watch : true;
|
|
714
767
|
if (watchEnabled) {
|
package/lib/runtime.d.ts
CHANGED
|
@@ -12,6 +12,14 @@ export interface PreToolDecisionLike {
|
|
|
12
12
|
kind: 'deny' | 'ask';
|
|
13
13
|
reason: string;
|
|
14
14
|
}
|
|
15
|
+
/** The sandbox hook's verdict for one allowed shell call (appcontainer seam). */
|
|
16
|
+
export type SandboxRewriteOutcome = {
|
|
17
|
+
readonly kind: 'wrap';
|
|
18
|
+
readonly command: string;
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: 'deny';
|
|
21
|
+
readonly reason: string;
|
|
22
|
+
};
|
|
15
23
|
/**
|
|
16
24
|
* The P2 rule chain's own verdict for one call, as reported by
|
|
17
25
|
* {@link PermGateRuntime.explainRules}. Distinct from the gate's effective
|
|
@@ -349,6 +357,20 @@ export declare class PermGateRuntime {
|
|
|
349
357
|
private auditNetworkAsk;
|
|
350
358
|
/** The compiled ruleset (read-only view for network module). */
|
|
351
359
|
get compiledRuleset(): CompiledRuleset;
|
|
360
|
+
/**
|
|
361
|
+
* The sandbox hook installed by the plugin: gate-aware, fail-closed rewrite
|
|
362
|
+
* of an allowed shell call. Undefined → the feature is off entirely.
|
|
363
|
+
*/
|
|
364
|
+
private sandboxHook;
|
|
365
|
+
/** Install/clear the sandbox rewrite hook (plugin wiring). */
|
|
366
|
+
setSandboxHook(hook: ((exec: ToolExecutionLike) => Promise<SandboxRewriteOutcome | undefined>) | undefined): void;
|
|
367
|
+
/**
|
|
368
|
+
* Gate-aware sandbox rewrite for the pre-execute waterfall's allow path.
|
|
369
|
+
* Mirrors {@link decideExecution}'s stand-down: outside the gate's presets
|
|
370
|
+
* the sandbox must not silently confine either — same scope, same fence.
|
|
371
|
+
* Returns undefined when not applicable.
|
|
372
|
+
*/
|
|
373
|
+
sandboxRewrite(exec: ToolExecutionLike): Promise<SandboxRewriteOutcome | undefined>;
|
|
352
374
|
private liveRiskLearning;
|
|
353
375
|
private liveRiskSediment;
|
|
354
376
|
private liveClassifySource;
|
package/lib/runtime.js
CHANGED
|
@@ -581,6 +581,30 @@ export class PermGateRuntime {
|
|
|
581
581
|
get compiledRuleset() {
|
|
582
582
|
return this.ruleset;
|
|
583
583
|
}
|
|
584
|
+
// ─── AppContainer sandbox seam (goal 2) ─────────────────────────────
|
|
585
|
+
/**
|
|
586
|
+
* The sandbox hook installed by the plugin: gate-aware, fail-closed rewrite
|
|
587
|
+
* of an allowed shell call. Undefined → the feature is off entirely.
|
|
588
|
+
*/
|
|
589
|
+
sandboxHook;
|
|
590
|
+
/** Install/clear the sandbox rewrite hook (plugin wiring). */
|
|
591
|
+
setSandboxHook(hook) {
|
|
592
|
+
this.sandboxHook = hook;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Gate-aware sandbox rewrite for the pre-execute waterfall's allow path.
|
|
596
|
+
* Mirrors {@link decideExecution}'s stand-down: outside the gate's presets
|
|
597
|
+
* the sandbox must not silently confine either — same scope, same fence.
|
|
598
|
+
* Returns undefined when not applicable.
|
|
599
|
+
*/
|
|
600
|
+
async sandboxRewrite(exec) {
|
|
601
|
+
const hook = this.sandboxHook;
|
|
602
|
+
if (hook === undefined)
|
|
603
|
+
return undefined;
|
|
604
|
+
if (!this.gateActive(this.presetOf(exec)))
|
|
605
|
+
return undefined;
|
|
606
|
+
return hook(exec);
|
|
607
|
+
}
|
|
584
608
|
liveRiskLearning() {
|
|
585
609
|
const read = this.options.readRiskLearning;
|
|
586
610
|
if (read !== undefined)
|
package/locale/de.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "meta": { "title": "Berechtigungsschleuse", "description": "Deterministisch-zuerst, fehlgeschlossene Berechtigungsschleuse für DeepSeek Harness: P0 harte Ablehnung → P1 Sitzungsfreigabe → P2 statische Regelkette → P3 optionaler LLM-Semantik-Klassifikator → P4 manuelle Bestätigung, mit Befehls-Whitelist und -Blacklist." } }
|
package/locale/en.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "meta": { "title": "Permission Gate", "description": "Deterministic-first, fail-closed permission gate for DeepSeek Harness: P0 hard-deny → P1 session grant → P2 static rules → P3 LLM classifier → P4 ask, with command whitelist and blacklist." } }
|
package/locale/es.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "meta": { "title": "Puerta de permisos", "description": "Puerta de permisos determinista y de cierre seguro para DeepSeek Harness: P0 denegación estricta → P1 concesión de sesión → P2 cadena de reglas estáticas → P3 clasificador semántico LLM opcional → P4 confirmación manual, con lista blanca y lista negra de comandos." } }
|
package/locale/fr.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "meta": { "title": "Passerelle de permissions", "description": "Passerelle de permissions déterministe et à échec fermé pour DeepSeek Harness : P0 refus strict → P1 autorisation de session → P2 chaîne de règles statiques → P3 classifieur sémantique LLM optionnel → P4 confirmation manuelle, avec liste blanche et liste noire de commandes." } }
|
package/locale/it.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "meta": { "title": "Gateway dei permessi", "description": "Gateway dei permessi deterministico e fail-closed per DeepSeek Harness: P0 rifiuto rigido → P1 concessione di sessione → P2 catena di regole statiche → P3 classificatore semantico LLM opzionale → P4 conferma manuale, con whitelist e blacklist dei comandi." } }
|
package/locale/ja.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "meta": { "title": "権限ゲート", "description": "DeepSeek Harness 用の決定論優先・フェイルクローズド権限ゲート:P0 ハード拒否 → P1 セッション許可 → P2 静的ルールチェーン → P3 オプション LLM セマンティック分類器 → P4 人手確認、コマンドホワイトリスト/ブラックリスト付き。" } }
|
package/locale/ko.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "meta": { "title": "권한 게이트", "description": "DeepSeek Harness용 결정론 우선·실패 시 차단 권한 게이트: P0 하드 거부 → P1 세션 승인 → P2 정적 규칙 체인 → P3 선택적 LLM 시맨틱 분류기 → P4 수동 확인, 명령 화이트리스트/블랙리스트 포함." } }
|
package/locale/ru.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "meta": { "title": "Шлюз разрешений", "description": "Детерминированный шлюз разрешений с закрытием при сбое для DeepSeek Harness: P0 жёсткий запрет → P1 сессионное разрешение → P2 цепочка статических правил → P3 необязательный LLM-семантический классификатор → P4 ручной запрос, с белым и чёрным списком команд." } }
|
package/locale/zh.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "meta": { "title": "权限门禁", "description": "面向 DeepSeek Harness 的确定性优先、fail-closed 权限门禁:P0 硬拒绝 → P1 会话授权 → P2 静态规则链 → P3 可选 LLM 语义分类器 → P4 人工确认,含命令白名单与黑名单。" } }
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-perm-gate",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
|
-
"tag": "
|
|
5
|
+
"tag": "latest"
|
|
6
6
|
},
|
|
7
7
|
"description": "DSH permission-gate for the DeepSeek Harness 0.1.5 line: a single self-sufficient, deterministic-first, fail-closed gate covering P0 hard-deny -> P1 session grant -> P2 static rule (allow/deny) chain -> P3 optional LLM semantic classifier -> P4 ask, with command whitelist/blacklist.",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"files": [
|
|
10
10
|
"lib",
|
|
11
|
+
"locale",
|
|
11
12
|
"scripts/patch-permission-glyph.mjs",
|
|
12
13
|
"cordis.patch.yml",
|
|
13
14
|
"dsh.plugin.json",
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"./client": {
|
|
58
59
|
"default": "./lib/client.js"
|
|
59
60
|
},
|
|
61
|
+
"./locale/*.json": "./locale/*.json",
|
|
60
62
|
"./package.json": "./package.json"
|
|
61
63
|
},
|
|
62
64
|
"bin": {
|
|
@@ -65,13 +67,13 @@
|
|
|
65
67
|
},
|
|
66
68
|
"engines": {
|
|
67
69
|
"node": ">=24",
|
|
68
|
-
"dsh": "
|
|
70
|
+
"dsh": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2"
|
|
69
71
|
},
|
|
70
72
|
"peerDependencies": {
|
|
71
73
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
72
|
-
"@deepseek-ai/dsh-client-locale": "
|
|
73
|
-
"@deepseek-ai/dsh-client-ui-renderer": "
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-settings": "
|
|
74
|
+
"@deepseek-ai/dsh-client-locale": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.2 || 0.1.0-rc.3 || 0.1.0-rc.6 || 0.1.0-rc.7 || 0.1.0-rc.8 || 0.1.1-rc.1 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.5-rc.3 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2"
|
|
75
77
|
},
|
|
76
78
|
"dependencies": {
|
|
77
79
|
"@deepseek-ai/schemastery": "^3.18.4",
|
|
@@ -80,10 +82,10 @@
|
|
|
80
82
|
},
|
|
81
83
|
"devDependencies": {
|
|
82
84
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
83
|
-
"@deepseek-ai/dsh-client-locale": "0.2.0-rc.
|
|
84
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.
|
|
85
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.
|
|
86
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.
|
|
85
|
+
"@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
|
|
86
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
|
|
87
89
|
"@eslint/js": "^10.0.1",
|
|
88
90
|
"@types/node": "^22.0.0",
|
|
89
91
|
"@types/react": "~18.3.1",
|
|
@@ -94,23 +96,6 @@
|
|
|
94
96
|
"typescript-eslint": "^8.69.0",
|
|
95
97
|
"vitest": "^3.0.0"
|
|
96
98
|
},
|
|
97
|
-
"scripts": {
|
|
98
|
-
"build": "tsc -p tsconfig.build.json && tsdown",
|
|
99
|
-
"prepublishOnly": "npm run build",
|
|
100
|
-
"typecheck": "tsc --noEmit && tsc -p tsconfig.client.json --noEmit",
|
|
101
|
-
"lint": "eslint src test scripts tsdown.config.ts eslint.config.mjs",
|
|
102
|
-
"test": "vitest run",
|
|
103
|
-
"patch:glyph": "node scripts/patch-permission-glyph.mjs",
|
|
104
|
-
"patch:glyph:check": "node scripts/patch-permission-glyph.mjs --check",
|
|
105
|
-
"verify:line": "node scripts/verify-line.mjs next",
|
|
106
|
-
"verify:lines": "node scripts/verify-line.mjs both",
|
|
107
|
-
"check:line": "node scripts/sync-0.1.5-line.mjs check",
|
|
108
|
-
"release:latest": "npm publish --tag latest",
|
|
109
|
-
"release:2x": "npm publish --tag 2.x",
|
|
110
|
-
"release:legacy": "npm publish --tag legacy",
|
|
111
|
-
"release:3x": "npm publish --tag dsh-0.1.5",
|
|
112
|
-
"release:5x": "npm publish --tag dsh-0.2.0"
|
|
113
|
-
},
|
|
114
99
|
"license": "MIT",
|
|
115
100
|
"repository": {
|
|
116
101
|
"type": "git",
|
|
@@ -154,5 +139,20 @@
|
|
|
154
139
|
"@deepseek-ai/dsh-client-ui-settings": {
|
|
155
140
|
"optional": true
|
|
156
141
|
}
|
|
142
|
+
},
|
|
143
|
+
"scripts": {
|
|
144
|
+
"build": "tsc -p tsconfig.build.json && tsdown",
|
|
145
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.client.json --noEmit",
|
|
146
|
+
"lint": "eslint src test scripts tsdown.config.ts eslint.config.mjs",
|
|
147
|
+
"test": "vitest run",
|
|
148
|
+
"patch:glyph": "node scripts/patch-permission-glyph.mjs",
|
|
149
|
+
"patch:glyph:check": "node scripts/patch-permission-glyph.mjs --check",
|
|
150
|
+
"verify:line": "node scripts/verify-line.mjs new",
|
|
151
|
+
"verify:lines": "node scripts/verify-line.mjs both",
|
|
152
|
+
"check:line": "node scripts/sync-0.1.5-line.mjs check",
|
|
153
|
+
"release:latest": "npm publish --tag latest",
|
|
154
|
+
"release:2x": "npm publish --tag 2.x",
|
|
155
|
+
"release:legacy": "npm publish --tag legacy",
|
|
156
|
+
"release:3x": "npm publish --tag dsh-0.1.5"
|
|
157
157
|
}
|
|
158
|
-
}
|
|
158
|
+
}
|
|
File without changes
|