dsh-act 0.1.0 → 0.1.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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/index.js +5 -3
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
- Missing subject fails closed instead of falling back to a shared `anonymous`
|
|
6
|
+
identity.
|
|
7
|
+
- Grant decisions no longer treat `{ ok: true }` as allow (fail closed).
|
|
8
|
+
- `allow.check` is called without a scope, so narrow grants can authorize.
|
|
9
|
+
|
|
3
10
|
## 0.1.0
|
|
4
11
|
|
|
5
12
|
- Add `ActService` (`register` / `unregister` / `get` / `list` / `invoke`) exposed
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Typed action registry and agent-facing action bus for DeepSeek Harness.
|
|
4
4
|
|
|
5
|
-
**Status: 0.1.
|
|
5
|
+
**Status: 0.1.1 MVP:服务/tools;UI/CLI 下一版**
|
|
6
6
|
|
|
7
7
|
0.1.0 ships the Host service `ctx.act` and the `act_list` / `act_invoke` agent
|
|
8
8
|
tools. The action panel, natural-language router, preview/undo/audit pipeline
|
package/index.js
CHANGED
|
@@ -118,7 +118,6 @@ function granted(decision) {
|
|
|
118
118
|
|| decision.permitted === true
|
|
119
119
|
|| decision.decision === 'allow'
|
|
120
120
|
|| decision.status === 'allow'
|
|
121
|
-
|| decision.ok === true
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
/** Typed action registry exposed to other plugins as `ctx.act`. */
|
|
@@ -207,9 +206,12 @@ export class ActService {
|
|
|
207
206
|
async #authorized(capability, meta) {
|
|
208
207
|
const allow = typeof this.#ctx?.get === 'function' ? this.#ctx.get('allow') : undefined
|
|
209
208
|
if (allow === undefined || allow === null || typeof allow.check !== 'function') return false
|
|
210
|
-
|
|
209
|
+
// A missing subject must fail closed: a shared 'anonymous' identity would
|
|
210
|
+
// let one grant authorize every background/plugin call.
|
|
211
|
+
const subject = meta?.subject ?? meta?.sessionId
|
|
212
|
+
if (typeof subject !== 'string' || subject === '') return false
|
|
211
213
|
try {
|
|
212
|
-
return granted(await allow.check({ subject, capability
|
|
214
|
+
return granted(await allow.check({ subject, capability }))
|
|
213
215
|
} catch {
|
|
214
216
|
return false
|
|
215
217
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-act",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Typed action registry and natural-language action panel for DeepSeek Harness.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": "^22.19.0 || >=24.9.0",
|
|
37
|
-
"dsh": ">=0.2.1-rc.2 <0.3.0
|
|
37
|
+
"dsh": ">=0.2.1-rc.2 <0.3.0-0"
|
|
38
38
|
},
|
|
39
39
|
"dsh": {
|
|
40
40
|
"manifestVersion": 1,
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
|
-
"access": "public"
|
|
46
|
+
"access": "public",
|
|
47
|
+
"registry": "https://registry.npmjs.org/"
|
|
47
48
|
},
|
|
48
49
|
"scripts": {
|
|
49
50
|
"test": "node --test"
|