@yadsh/dsh-prompt-firewall 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/compatibility.json +16 -0
- package/lib/client/index.js +32 -78
- package/lib/client/index.js.map +1 -1
- package/lib/client/sections.js +75 -0
- package/lib/client/sections.js.map +1 -0
- package/lib/client/styles.js +16 -5
- package/lib/client/styles.js.map +1 -1
- package/lib/client.js +757 -557
- package/lib/client.js.map +1 -1
- package/lib/index.js +17 -1
- package/lib/index.js.map +1 -1
- package/lib/typert.host.js +2 -2
- package/lib/typert.remote-client.js +2 -2
- package/lib/types/audit.d.ts +1 -0
- package/lib/types/client/index.d.ts +1 -0
- package/lib/types/client/sections.d.ts +39 -0
- package/lib/types/client/styles.d.ts +1 -0
- package/lib/types/config.d.ts +1 -0
- package/lib/types/firewall.d.ts +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/metrics.d.ts +1 -0
- package/lib/types/presets.d.ts +1 -0
- package/lib/types/rules.d.ts +1 -0
- package/lib/types/types.d.ts +1 -0
- package/package.json +13 -7
package/lib/index.js
CHANGED
|
@@ -35,6 +35,7 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
35
35
|
import { Context } from '@deepseek-ai/cordis';
|
|
36
36
|
import { installSettingsSection, settingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
37
37
|
import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
38
|
+
import { createHostLoggerSink, getPluginLogger, } from '@yadsh/dsh-plugin-log';
|
|
38
39
|
import { AuditStore } from './audit.js';
|
|
39
40
|
import { ConfigSchema, resolveConfig } from './config.js';
|
|
40
41
|
import { applyFirewall } from './firewall.js';
|
|
@@ -75,8 +76,15 @@ let PromptFirewall = (() => {
|
|
|
75
76
|
compiledRules;
|
|
76
77
|
audits;
|
|
77
78
|
metrics = new FirewallMetrics();
|
|
79
|
+
logger;
|
|
78
80
|
constructor(ctx, config = {}) {
|
|
79
81
|
super(ctx, 'promptFirewall', { namespace: 'promptFirewall' });
|
|
82
|
+
this.logger = getPluginLogger({
|
|
83
|
+
pluginId: 'dsh-prompt-firewall',
|
|
84
|
+
console: 'trace',
|
|
85
|
+
consoleSink: createHostLoggerSink(ctx.logger),
|
|
86
|
+
});
|
|
87
|
+
ctx.effect(() => async () => this.logger.close(), 'dsh-prompt-firewall.logger');
|
|
80
88
|
this.entryConfig = structuredClone(config);
|
|
81
89
|
this.configSource = () => this.entryConfig;
|
|
82
90
|
this.resolvedConfig = resolveConfig(config);
|
|
@@ -95,10 +103,14 @@ let PromptFirewall = (() => {
|
|
|
95
103
|
config: this.resolvedConfig,
|
|
96
104
|
auditStore: this.audits,
|
|
97
105
|
metrics: this.metrics,
|
|
98
|
-
logger:
|
|
106
|
+
logger: this.logger,
|
|
99
107
|
evaluate: section => evaluateSection(section, this.compiledRules),
|
|
100
108
|
});
|
|
101
109
|
}, { prepend: true });
|
|
110
|
+
this.logger.info('plugin.ready', {
|
|
111
|
+
enabled: this.resolvedConfig.enabled,
|
|
112
|
+
mode: this.resolvedConfig.mode,
|
|
113
|
+
});
|
|
102
114
|
}
|
|
103
115
|
inspectLast() {
|
|
104
116
|
return this.audits.last();
|
|
@@ -158,6 +170,10 @@ let PromptFirewall = (() => {
|
|
|
158
170
|
this.resolvedConfig = resolveConfig(this.configSource());
|
|
159
171
|
this.compiledRules = compileRules(this.resolvedConfig);
|
|
160
172
|
this.audits.configure(this.resolvedConfig.audit.historySize, this.resolvedConfig.audit.highlightNewSections);
|
|
173
|
+
this.logger.info('firewall.rules.reloaded', {
|
|
174
|
+
enabled: this.resolvedConfig.enabled,
|
|
175
|
+
mode: this.resolvedConfig.mode,
|
|
176
|
+
});
|
|
161
177
|
}
|
|
162
178
|
};
|
|
163
179
|
})();
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sour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C,CAAA;YAE3D,MAAM,QAAQ,CAAC,MAAM,CAAC,kCAAkC,EAAE;gBACxD,eAAe;gBACf,eAAe;gBACf,iBAAiB;aAClB,EAAE,gBAAgB,CAAC,CAAA;YACpB,wEAAwE;YACxE,gFAAgF;YAChF,IAAI,CAAC,WAAW,EAAE,CAAA;QACpB,CAAC;QAED,WAAW;YACT,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAA;YACxD,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;YACtD,IAAI,CAAC,MAAM,CAAC,SAAS,CACnB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,EACrC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,oBAAoB,CAC/C,CAAA;YACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE;gBAC1C,OAAO,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO;gBACpC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI;aAC/B,CAAC,CAAA;QACJ,CAAC;;;SAlJU,cAAc;AAqJ3B,eAAe,cAAc,CAAA"}
|
package/lib/typert.host.js
CHANGED
|
@@ -90,7 +90,7 @@ export const TYPERT = {
|
|
|
90
90
|
typeSymbol: '@yadsh/dsh-prompt-firewall/types#PromptFirewallInspectorSnapshot',
|
|
91
91
|
schema: _yadsh_dsh_prompt_firewall_promptFirewall_inspect_result$schema,
|
|
92
92
|
},
|
|
93
|
-
sourceLocation: {"file":"packages/dsh-prompt-firewall/src/index.ts","line":
|
|
93
|
+
sourceLocation: {"file":"packages/dsh-prompt-firewall/src/index.ts","line":140,"column":3},
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
id: '@yadsh/dsh-prompt-firewall#promptFirewall/setSectionPolicy',
|
|
@@ -136,7 +136,7 @@ export const TYPERT = {
|
|
|
136
136
|
typeSymbol: '@yadsh/dsh-prompt-firewall#promptFirewall/setSectionPolicy:result',
|
|
137
137
|
schema: _yadsh_dsh_prompt_firewall_promptFirewall_setSectionPolicy_result$schema,
|
|
138
138
|
},
|
|
139
|
-
sourceLocation: {"file":"packages/dsh-prompt-firewall/src/index.ts","line":
|
|
139
|
+
sourceLocation: {"file":"packages/dsh-prompt-firewall/src/index.ts","line":154,"column":9},
|
|
140
140
|
},
|
|
141
141
|
],
|
|
142
142
|
model: {
|
|
@@ -87,7 +87,7 @@ export const TYPERT_REMOTE = {
|
|
|
87
87
|
typeSymbol: '@yadsh/dsh-prompt-firewall/types#PromptFirewallInspectorSnapshot',
|
|
88
88
|
schema: _yadsh_dsh_prompt_firewall_promptFirewall_inspect_result$schema,
|
|
89
89
|
},
|
|
90
|
-
sourceLocation: {"file":"packages/dsh-prompt-firewall/src/index.ts","line":
|
|
90
|
+
sourceLocation: {"file":"packages/dsh-prompt-firewall/src/index.ts","line":140,"column":3},
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
id: '@yadsh/dsh-prompt-firewall#promptFirewall/setSectionPolicy',
|
|
@@ -133,7 +133,7 @@ export const TYPERT_REMOTE = {
|
|
|
133
133
|
typeSymbol: '@yadsh/dsh-prompt-firewall#promptFirewall/setSectionPolicy:result',
|
|
134
134
|
schema: _yadsh_dsh_prompt_firewall_promptFirewall_setSectionPolicy_result$schema,
|
|
135
135
|
},
|
|
136
|
-
sourceLocation: {"file":"packages/dsh-prompt-firewall/src/index.ts","line":
|
|
136
|
+
sourceLocation: {"file":"packages/dsh-prompt-firewall/src/index.ts","line":154,"column":9},
|
|
137
137
|
},
|
|
138
138
|
],
|
|
139
139
|
}
|
package/lib/types/audit.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
2
2
|
export declare const inject: string[];
|
|
3
3
|
/** Mount the generated Remote contribution and register the native Settings card. */
|
|
4
4
|
export declare function apply(ctx: Context): Promise<() => Promise<void>>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PromptFirewallConfig, PromptFirewallInspectorSnapshot, SectionPolicy } from '../types.js';
|
|
2
|
+
export type RuleField = 'allowedSections' | 'blockedSections' | 'protectedSections' | 'allowedPrefixes' | 'blockedPrefixes' | 'allowedPatterns' | 'blockedPatterns';
|
|
3
|
+
export declare function Toggle(props: {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
label: string;
|
|
7
|
+
hint: string;
|
|
8
|
+
onChange(checked: boolean): void;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
type ConfigSetter = (path: string[], value: unknown) => void;
|
|
11
|
+
export declare function PolicySection(props: {
|
|
12
|
+
config: PromptFirewallConfig | undefined;
|
|
13
|
+
writable: boolean;
|
|
14
|
+
setPath: ConfigSetter;
|
|
15
|
+
unsetPreset(): void;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function LastRequestSection(props: {
|
|
18
|
+
config: PromptFirewallConfig | undefined;
|
|
19
|
+
inspector: PromptFirewallInspectorSnapshot | null;
|
|
20
|
+
refreshing: boolean;
|
|
21
|
+
onRefresh(): void;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function RulesSection(props: {
|
|
24
|
+
config: PromptFirewallConfig | undefined;
|
|
25
|
+
writable: boolean;
|
|
26
|
+
setPath: ConfigSetter;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function AuditSection(props: {
|
|
29
|
+
config: PromptFirewallConfig | undefined;
|
|
30
|
+
writable: boolean;
|
|
31
|
+
setPath: ConfigSetter;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function InspectorSection(props: {
|
|
34
|
+
inspector: PromptFirewallInspectorSnapshot | null;
|
|
35
|
+
writable: boolean;
|
|
36
|
+
setPolicy(name: string, policy: SectionPolicy): Promise<void>;
|
|
37
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=sections.d.ts.map
|
package/lib/types/config.d.ts
CHANGED
|
@@ -6,3 +6,4 @@ export declare const DEFAULT_CONFIG: ResolvedPromptFirewallConfig;
|
|
|
6
6
|
/** Runtime schema consumed by the Cordis loader. */
|
|
7
7
|
export declare const ConfigSchema: z<PromptFirewallConfig>;
|
|
8
8
|
export declare function resolveConfig(config?: PromptFirewallConfig): ResolvedPromptFirewallConfig;
|
|
9
|
+
//# sourceMappingURL=config.d.ts.map
|
package/lib/types/firewall.d.ts
CHANGED
package/lib/types/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare class PromptFirewall extends TypertRemoteService implements Promp
|
|
|
31
31
|
private compiledRules;
|
|
32
32
|
private readonly audits;
|
|
33
33
|
private readonly metrics;
|
|
34
|
+
private readonly logger;
|
|
34
35
|
constructor(ctx: Context, config?: PromptFirewallConfig);
|
|
35
36
|
inspectLast(): PromptAuditResult | null;
|
|
36
37
|
inspectHistory(): PromptAuditResult[];
|
|
@@ -44,3 +45,4 @@ export declare class PromptFirewall extends TypertRemoteService implements Promp
|
|
|
44
45
|
reloadRules(): void;
|
|
45
46
|
}
|
|
46
47
|
export default PromptFirewall;
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/metrics.d.ts
CHANGED
package/lib/types/presets.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import type { FirewallPreset, PromptFirewallConfig } from './types.js';
|
|
|
2
2
|
export declare const CLEAN_BLOCKED_SECTIONS: readonly ["plugin:dsh-liangshen", "plugin:dsh-ssh", "plugin:task-board", "plugin:dsh-desktop-launcher"];
|
|
3
3
|
export declare const PRESETS: Readonly<Record<FirewallPreset, Readonly<PromptFirewallConfig>>>;
|
|
4
4
|
export declare function getPreset(name: FirewallPreset | undefined): Readonly<PromptFirewallConfig>;
|
|
5
|
+
//# sourceMappingURL=presets.d.ts.map
|
package/lib/types/rules.d.ts
CHANGED
|
@@ -23,3 +23,4 @@ export declare function globToRegExp(glob: string): RegExp;
|
|
|
23
23
|
export declare function compileRules(config: ResolvedPromptFirewallConfig): CompiledRules;
|
|
24
24
|
export declare function evaluateSection(section: FirewallSection, rules: CompiledRules): FirewallDecision;
|
|
25
25
|
export {};
|
|
26
|
+
//# sourceMappingURL=rules.d.ts.map
|
package/lib/types/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yadsh/dsh-prompt-firewall",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Prompt hygiene, observability, and policy middleware for DeepSeek Harness",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -60,7 +60,9 @@
|
|
|
60
60
|
"lib/**/*.d.ts",
|
|
61
61
|
"lib/client.js",
|
|
62
62
|
"cordis.patch.yml",
|
|
63
|
-
"
|
|
63
|
+
"compatibility.json",
|
|
64
|
+
"README.md",
|
|
65
|
+
"LICENSE"
|
|
64
66
|
],
|
|
65
67
|
"keywords": [
|
|
66
68
|
"deepseek-harness",
|
|
@@ -81,14 +83,14 @@
|
|
|
81
83
|
"@deepseek-ai/dsh-settings": ">=0.1.1-rc.2 <0.2.0",
|
|
82
84
|
"@deepseek-ai/dsh-system-prompt": ">=0.1.1-rc.2 <0.2.0",
|
|
83
85
|
"@deepseek-ai/dsh-typert-protocol": ">=0.1.1-rc.2 <0.2.0",
|
|
84
|
-
"react": "
|
|
86
|
+
"react": "^18.2.0"
|
|
85
87
|
},
|
|
86
88
|
"dependencies": {
|
|
87
|
-
"zod": "^4.4.3"
|
|
89
|
+
"zod": "^4.4.3",
|
|
90
|
+
"@yadsh/dsh-plugin-log": "^0.2.1"
|
|
88
91
|
},
|
|
89
92
|
"devDependencies": {
|
|
90
93
|
"@deepseek-ai/cordis": "4.0.1",
|
|
91
|
-
"@deepseek-ai/schemastery": "3.18.1",
|
|
92
94
|
"@deepseek-ai/dsh-api-gateway": "0.1.1-rc.2",
|
|
93
95
|
"@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
|
|
94
96
|
"@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
|
|
@@ -98,13 +100,17 @@
|
|
|
98
100
|
"@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2",
|
|
99
101
|
"@deepseek-ai/dsh-typert-generator": "0.1.1-rc.2",
|
|
100
102
|
"@deepseek-ai/dsh-typert-protocol": "0.1.1-rc.2",
|
|
103
|
+
"@deepseek-ai/schemastery": "3.18.1",
|
|
101
104
|
"@types/node": "^26.4.0",
|
|
102
105
|
"@types/react": "18.3.28",
|
|
103
|
-
"react": "18.3.1",
|
|
104
106
|
"eslint": "10.9.1",
|
|
107
|
+
"react": "18.3.1",
|
|
105
108
|
"tsdown": "^0.22.14",
|
|
106
109
|
"typescript": "^7.0.2",
|
|
107
|
-
"vitest": "^4.1.11"
|
|
110
|
+
"vitest": "^4.1.11",
|
|
111
|
+
"@yadsh/dsh-config": "^0.0.0",
|
|
112
|
+
"@yadsh/dsh-plugin-scripts": "^0.0.0",
|
|
113
|
+
"@yadsh/dsh-plugin-kit": "^0.1.0"
|
|
108
114
|
},
|
|
109
115
|
"engines": {
|
|
110
116
|
"node": ">=20"
|