deepseek-coordination 0.1.8 → 0.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepseek-coordination",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Cross-platform atomic OS-interaction surface for the DeepSeek Harness: one argument-stable verb set implemented natively on each OS, with byte-exact charset, BOM and line-ending handling.",
@@ -216,7 +216,18 @@ export function apply(ctx, rawConfig) {
216
216
  if (scope && !SCOPES.includes(scope)) {
217
217
  throw new Error(`scope must be one of ${SCOPES.join(', ')}, got '${scope}'`)
218
218
  }
219
- const value = target?.value ?? '*'
219
+ // THE TARGET ARRIVES IN TWO SHAPES, and this function has to accept both.
220
+ //
221
+ // The model-facing tool declares `target` as a STRING ("Target value; * means every target") and hands
222
+ // it straight through, while this function reads `target.value` because the STORED rule is an object.
223
+ // Reading `.value` off a string yields `undefined`, so the value became '*' and `broad` became true,
224
+ // and the broad-target guard below then refused EVERY grant. The effect was that a rule scoped to one
225
+ // path could not be created at all: the documented "deny this one file" was unreachable through the
226
+ // only writer that exists, and the refusal blamed the caller for asking for too much.
227
+ //
228
+ // `query` already normalised both shapes (it reads `target?.value ?? target`); this is that treatment.
229
+ const shape = typeof target === 'string' ? { kind: 'path', value: target } : target
230
+ const value = shape?.value ?? '*'
220
231
  const broad = value === '*'
221
232
  if (broad && acknowledgeBroad !== true) {
222
233
  throw new Error(
@@ -229,7 +240,7 @@ export function apply(ctx, rawConfig) {
229
240
  const rule = {
230
241
  id: nextRuleId(document),
231
242
  verb,
232
- target: { kind: target?.kind ?? 'any', value },
243
+ target: { kind: shape?.kind ?? 'any', value },
233
244
  scope: { kind: scope ?? 'user' },
234
245
  decision,
235
246
  grantedBy: WRITER,