@yadsh/dsh-prompt-firewall 0.1.2 → 0.2.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/README.md +2 -2
- package/compatibility.json +16 -0
- package/lib/client/index.js +11 -71
- 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 +2 -13
- package/lib/client/styles.js.map +1 -1
- package/lib/client.js +714 -571
- package/lib/client.js.map +1 -1
- package/lib/index.js +6 -5
- 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 -1
- 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 +32 -27
- package/lib/client/settings-store.js +0 -11
- package/lib/client/settings-store.js.map +0 -1
- package/lib/types/client/settings-store.d.ts +0 -11
package/lib/index.js
CHANGED
|
@@ -33,7 +33,6 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
|
|
|
33
33
|
done = true;
|
|
34
34
|
};
|
|
35
35
|
import { Context } from '@deepseek-ai/cordis';
|
|
36
|
-
import { installSettingsSection, settingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
37
36
|
import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
38
37
|
import { createHostLoggerSink, getPluginLogger, } from '@yadsh/dsh-plugin-log';
|
|
39
38
|
import { AuditStore } from './audit.js';
|
|
@@ -51,7 +50,7 @@ export * from './types.js';
|
|
|
51
50
|
/** Cordis plugin ID. */
|
|
52
51
|
export const name = 'prompt-firewall';
|
|
53
52
|
export const inject = ['systemPrompt'];
|
|
54
|
-
export const PROMPT_FIREWALL_SETTINGS_NAMESPACE =
|
|
53
|
+
export const PROMPT_FIREWALL_SETTINGS_NAMESPACE = 'prompt-firewall';
|
|
55
54
|
export const Config = ConfigSchema;
|
|
56
55
|
/** DSH Host plugin, public firewall service, and browser Remote owner. */
|
|
57
56
|
let PromptFirewall = (() => {
|
|
@@ -90,9 +89,11 @@ let PromptFirewall = (() => {
|
|
|
90
89
|
this.resolvedConfig = resolveConfig(config);
|
|
91
90
|
this.compiledRules = compileRules(this.resolvedConfig);
|
|
92
91
|
this.audits = new AuditStore(this.resolvedConfig.audit.historySize, this.resolvedConfig.audit.highlightNewSections);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
ctx.inject(['settings'], settingsCtx => {
|
|
93
|
+
settingsCtx.settings.installSection(ctx, PROMPT_FIREWALL_SETTINGS_NAMESPACE, ConfigSchema, this.entryConfig, {
|
|
94
|
+
setSource: current => { this.configSource = current; },
|
|
95
|
+
onChange: () => { this.reloadRules(); },
|
|
96
|
+
});
|
|
96
97
|
});
|
|
97
98
|
// Cordis has registration order plus `prepend`, not numeric priorities.
|
|
98
99
|
// Prepending makes this wrapper call downstream contributors first and
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAG7C,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAC9E,OAAO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AC,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;;;SA9IU,cAAc;AAiJ3B,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":136,"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":150,"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":136,"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":150,"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
|
@@ -18,7 +18,7 @@ declare module '@deepseek-ai/cordis' {
|
|
|
18
18
|
/** Cordis plugin ID. */
|
|
19
19
|
export declare const name = "prompt-firewall";
|
|
20
20
|
export declare const inject: string[];
|
|
21
|
-
export declare const PROMPT_FIREWALL_SETTINGS_NAMESPACE
|
|
21
|
+
export declare const PROMPT_FIREWALL_SETTINGS_NAMESPACE = "prompt-firewall";
|
|
22
22
|
export type Config = PromptFirewallConfig;
|
|
23
23
|
export declare const Config: import("@deepseek-ai/schemastery").default<PromptFirewallConfig>;
|
|
24
24
|
/** DSH Host plugin, public firewall service, and browser Remote owner. */
|
|
@@ -45,3 +45,4 @@ export declare class PromptFirewall extends TypertRemoteService implements Promp
|
|
|
45
45
|
reloadRules(): void;
|
|
46
46
|
}
|
|
47
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.
|
|
3
|
+
"version": "0.2.0",
|
|
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",
|
|
@@ -71,41 +73,44 @@
|
|
|
71
73
|
],
|
|
72
74
|
"license": "MIT",
|
|
73
75
|
"peerDependencies": {
|
|
74
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
75
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
76
|
-
"@deepseek-ai/dsh-api-gateway": ">=0.1.
|
|
77
|
-
"@deepseek-ai/dsh-client-
|
|
78
|
-
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.
|
|
79
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.
|
|
80
|
-
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.
|
|
81
|
-
"@deepseek-ai/dsh-settings": ">=0.1.
|
|
82
|
-
"@deepseek-ai/dsh-system-prompt": ">=0.1.
|
|
83
|
-
"@deepseek-ai/dsh-typert-protocol": ">=0.1.
|
|
84
|
-
"react": "
|
|
76
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
77
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
78
|
+
"@deepseek-ai/dsh-api-gateway": ">=0.1.5-rc.2 <0.2.0",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-renderer": ">=0.1.5-rc.2 <0.2.0",
|
|
80
|
+
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.5-rc.2 <0.2.0",
|
|
81
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.5-rc.2 <0.2.0",
|
|
82
|
+
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.5-rc.2 <0.2.0",
|
|
83
|
+
"@deepseek-ai/dsh-settings": ">=0.1.5-rc.2 <0.2.0",
|
|
84
|
+
"@deepseek-ai/dsh-system-prompt": ">=0.1.5-rc.2 <0.2.0",
|
|
85
|
+
"@deepseek-ai/dsh-typert-protocol": ">=0.1.5-rc.2 <0.2.0",
|
|
86
|
+
"react": "^18.2.0"
|
|
85
87
|
},
|
|
86
88
|
"dependencies": {
|
|
87
89
|
"zod": "^4.4.3",
|
|
88
|
-
"@yadsh/dsh-plugin-log": "^0.2.
|
|
90
|
+
"@yadsh/dsh-plugin-log": "^0.2.1"
|
|
89
91
|
},
|
|
90
92
|
"devDependencies": {
|
|
91
|
-
"@deepseek-ai/cordis": "4.0.
|
|
92
|
-
"@deepseek-ai/
|
|
93
|
-
"@deepseek-ai/dsh-
|
|
94
|
-
"@deepseek-ai/dsh-client-
|
|
95
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.1.
|
|
96
|
-
"@deepseek-ai/dsh-client-ui-
|
|
97
|
-
"@deepseek-ai/dsh-
|
|
98
|
-
"@deepseek-ai/dsh-
|
|
99
|
-
"@deepseek-ai/dsh-
|
|
100
|
-
"@deepseek-ai/dsh-typert-
|
|
101
|
-
"@deepseek-ai/
|
|
93
|
+
"@deepseek-ai/cordis": "4.0.2",
|
|
94
|
+
"@deepseek-ai/dsh-api-gateway": "0.1.5-rc.2",
|
|
95
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.1.5-rc.2",
|
|
96
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.5-rc.2",
|
|
97
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.5-rc.2",
|
|
98
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.5-rc.2",
|
|
99
|
+
"@deepseek-ai/dsh-settings": "0.1.5-rc.2",
|
|
100
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.5-rc.2",
|
|
101
|
+
"@deepseek-ai/dsh-typert-generator": "0.1.5-rc.2",
|
|
102
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.5-rc.2",
|
|
103
|
+
"@deepseek-ai/schemastery": "3.18.2",
|
|
102
104
|
"@types/node": "^26.4.0",
|
|
103
105
|
"@types/react": "18.3.28",
|
|
104
|
-
"react": "18.3.1",
|
|
105
106
|
"eslint": "10.9.1",
|
|
107
|
+
"react": "18.3.1",
|
|
106
108
|
"tsdown": "^0.22.14",
|
|
107
109
|
"typescript": "^7.0.2",
|
|
108
|
-
"vitest": "^4.1.11"
|
|
110
|
+
"vitest": "^4.1.11",
|
|
111
|
+
"@yadsh/dsh-plugin-kit": "^0.1.0",
|
|
112
|
+
"@yadsh/dsh-plugin-scripts": "^0.0.0",
|
|
113
|
+
"@yadsh/dsh-config": "^0.0.0"
|
|
109
114
|
},
|
|
110
115
|
"engines": {
|
|
111
116
|
"node": ">=20"
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React invokes external-store callbacks as plain functions. SettingsScope's
|
|
3
|
-
* methods depend on their receiver, so forward calls through stable wrappers.
|
|
4
|
-
*/
|
|
5
|
-
export function bindSettingsExternalStore(scope) {
|
|
6
|
-
return {
|
|
7
|
-
subscribe: listener => scope.subscribe(listener),
|
|
8
|
-
getSnapshot: () => scope.getSnapshot(),
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=settings-store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings-store.js","sourceRoot":"","sources":["../../src/client/settings-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAY,KAGpD;IAIC,OAAO;QACL,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;QAChD,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE;KACvC,CAAA;AACH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React invokes external-store callbacks as plain functions. SettingsScope's
|
|
3
|
-
* methods depend on their receiver, so forward calls through stable wrappers.
|
|
4
|
-
*/
|
|
5
|
-
export declare function bindSettingsExternalStore<TSnapshot>(scope: {
|
|
6
|
-
subscribe(listener: () => void): () => void;
|
|
7
|
-
getSnapshot(): TSnapshot;
|
|
8
|
-
}): {
|
|
9
|
-
subscribe(listener: () => void): () => void;
|
|
10
|
-
getSnapshot(): TSnapshot;
|
|
11
|
-
};
|