@amaster.ai/dsh-policy 0.1.3 → 0.1.5

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 CHANGED
@@ -81,14 +81,14 @@ Plugin-level fields: `enabled` (master switch) and `commandKeys` (argument keys
81
81
 
82
82
  Everything registered in `ctx.tools` passes `tools/pre-execute` — the gate is tool-agnostic and needs no per-tool support:
83
83
 
84
- - **Official tools** (verified against the 0.1.5-rc.1 sources): `bash`, `pwsh`, `read`, `write`, `edit`, `read_image`, `web_search`, `web_fetch`, `list_subagent_models` and the delegation tool, `run_code`, plus goal/skill/workflow/cordis tools. Match them by `tool` + `argsPattern` (the object form fits their argument shapes: `file_path` for `write`/`edit`, `url` for `web_fetch`, `query` for `web_search`, …).
84
+ - **Official tools** (verified against the 0.1.6-alpha.2 sources): `bash`, `pwsh`, `read`, `write`, `edit`, `read_image`, `web_search`, `web_fetch`, `list_subagent_models` and the delegation tool, `run_code`, plus goal/skill/workflow/cordis tools. Match them by `tool` + `argsPattern` (the object form fits their argument shapes: `file_path` for `write`/`edit`, `url` for `web_fetch`, `query` for `web_search`, …).
85
85
  - **`commandPrefix`/`commandRegex`** apply to tools whose arguments carry a shell command string — `bash` and `pwsh` both use `command` (covered by the default `commandKeys`).
86
86
  - **PTC mode**: `run_code` sub-dispatches re-enter the scheduler's `prepare` stage, which runs the same pre-execute gate — rules apply per sub-call, not just per `run_code`.
87
87
  - **MCP tools** bridged by `dsh-mcp-client` register into the same `ctx.tools` pipeline — match them by their registered names like any other tool.
88
88
 
89
89
  ### The `ask` decision
90
90
 
91
- `ask` is resolved by dsh itself: through the composed answerers of `@deepseek-ai/dsh-user-approval` (a UI prompt, an auto-answerer, …), failing closed to deny when no approval service is composed, and short-circuiting to reject under a session's `approval/policy: never`. The model-facing deny reason is the rule's `message` only when no approval service exists at all; a `rejected`/`cancelled`/`unavailable` outcome carries dsh-tools' own reason wording (verified against `dsh-tools@0.1.5-rc.1`). Gemini's `modes` (`default`/`autoEdit`/`yolo`/`plan`) have no dsh counterpart — dsh models that axis as the per-session approval policy (see `dsh-permission-presets` for the user-facing selector), and dsh profiles/`cordis.patch.yml` already scope config per deployment, so the plugin carries no mode axis of its own.
91
+ `ask` is resolved by dsh itself: through the composed answerers of `@deepseek-ai/dsh-user-approval` (a UI prompt, an auto-answerer, …), failing closed to deny when no approval service is composed, and short-circuiting to reject under a session's `approval/policy: never`. The model-facing deny reason is the rule's `message` only when no approval service exists at all; a `rejected`/`cancelled`/`unavailable` outcome carries dsh-tools' own reason wording (verified against `dsh-tools@0.1.6-alpha.2`). Gemini's `modes` (`default`/`autoEdit`/`yolo`/`plan`) have no dsh counterpart — dsh models that axis as the per-session approval policy (see `dsh-permission-presets` for the user-facing selector), and dsh profiles/`cordis.patch.yml` already scope config per deployment, so the plugin carries no mode axis of its own.
92
92
 
93
93
  ## Gemini CLI policy mapping
94
94
 
@@ -111,7 +111,7 @@ A policy plugin is advisory gating, not containment: deny rules keep a well-beha
111
111
 
112
112
  | @amaster.ai/dsh-policy | dsh | cordis |
113
113
  | --- | --- | --- |
114
- | 0.1.x | `0.1.5-rc.1` | `^4.0.1` |
114
+ | 0.1.x | `>=0.1.5-rc.1 || >=0.1.6-alpha.1` (tested `0.1.6-alpha.2`) | `^4.0.1` |
115
115
 
116
116
  Peer dependency: `@deepseek-ai/dsh-tools` (the `tools/pre-execute` gate). The approval seam (`@deepseek-ai/dsh-user-approval`) is optional and only involved in `ask` decisions.
117
117
 
package/lib/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
  * no answerer is composed). A call no rule matches is delegated onward via
15
15
  * `next()` — the plugin only ever speaks for the calls its rules cover.
16
16
  *
17
- * Gate shape verified against @deepseek-ai/dsh-tools@0.1.5-rc.1
17
+ * Gate shape verified against @deepseek-ai/dsh-tools@0.1.6-alpha.2
18
18
  * (lib/types/index.d.ts: tools/pre-execute + PreToolDecision).
19
19
  *
20
20
  * @module dsh-policy
@@ -14,7 +14,7 @@
14
14
  * no answerer is composed). A call no rule matches is delegated onward via
15
15
  * `next()` — the plugin only ever speaks for the calls its rules cover.
16
16
  *
17
- * Gate shape verified against @deepseek-ai/dsh-tools@0.1.5-rc.1
17
+ * Gate shape verified against @deepseek-ai/dsh-tools@0.1.6-alpha.2
18
18
  * (lib/types/index.d.ts: tools/pre-execute + PreToolDecision).
19
19
  *
20
20
  * @module dsh-policy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/dsh-policy",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Declarative tool-call policy for DeepSeek Harness: config-driven allow/deny/ask rules (tool name, args pattern, shell command prefix/regex, priority) on the tools/pre-execute gate — Gemini CLI-style policy files expressed as plain plugin config.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -36,26 +36,26 @@
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/cordis": "^4.0.1",
39
- "@deepseek-ai/dsh-tools": "^0.1.5-rc.1"
39
+ "@deepseek-ai/dsh-tools": ">=0.1.5-rc.1 || >=0.1.6-alpha.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@deepseek-ai/cordis": "^4.0.1",
43
- "@deepseek-ai/dsh-agent": "0.1.5-rc.1",
44
- "@deepseek-ai/dsh-home-paths": "0.1.5-rc.1",
45
- "@deepseek-ai/dsh-http-proxy": "0.1.5-rc.1",
46
- "@deepseek-ai/dsh-invariants": "0.1.5-rc.1",
47
- "@deepseek-ai/dsh-jobs": "0.1.5-rc.1",
48
- "@deepseek-ai/dsh-llm": "0.1.5-rc.1",
49
- "@deepseek-ai/dsh-sandbox": "0.1.5-rc.1",
50
- "@deepseek-ai/dsh-sandbox-policy": "0.1.5-rc.1",
51
- "@deepseek-ai/dsh-scope": "0.1.5-rc.1",
52
- "@deepseek-ai/dsh-shell": "0.1.5-rc.1",
53
- "@deepseek-ai/dsh-shell-env": "0.1.5-rc.1",
54
- "@deepseek-ai/dsh-subprocess": "0.1.5-rc.1",
55
- "@deepseek-ai/dsh-system-prompt": "0.1.5-rc.1",
56
- "@deepseek-ai/dsh-tool-bash": "0.1.5-rc.1",
57
- "@deepseek-ai/dsh-tools": "0.1.5-rc.1",
58
- "@deepseek-ai/dsh-user-approval": "0.1.5-rc.1",
43
+ "@deepseek-ai/dsh-agent": "0.1.6-alpha.2",
44
+ "@deepseek-ai/dsh-home-paths": "0.1.6-alpha.2",
45
+ "@deepseek-ai/dsh-http-proxy": "0.1.6-alpha.2",
46
+ "@deepseek-ai/dsh-invariants": "0.1.6-alpha.2",
47
+ "@deepseek-ai/dsh-jobs": "0.1.6-alpha.2",
48
+ "@deepseek-ai/dsh-llm": "0.1.6-alpha.2",
49
+ "@deepseek-ai/dsh-sandbox": "0.1.6-alpha.2",
50
+ "@deepseek-ai/dsh-sandbox-policy": "0.1.6-alpha.2",
51
+ "@deepseek-ai/dsh-scope": "0.1.6-alpha.2",
52
+ "@deepseek-ai/dsh-shell": "0.1.6-alpha.2",
53
+ "@deepseek-ai/dsh-shell-env": "0.1.6-alpha.2",
54
+ "@deepseek-ai/dsh-subprocess": "0.1.6-alpha.2",
55
+ "@deepseek-ai/dsh-system-prompt": "0.1.6-alpha.2",
56
+ "@deepseek-ai/dsh-tool-bash": "0.1.6-alpha.2",
57
+ "@deepseek-ai/dsh-tools": "0.1.6-alpha.2",
58
+ "@deepseek-ai/dsh-user-approval": "0.1.6-alpha.2",
59
59
  "@types/node": "^22.0.0",
60
60
  "typescript": "^5.6.3",
61
61
  "vitest": "^4.1.11"