@dsmm/dsmm 0.3.6 → 0.3.7
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.
|
@@ -28,6 +28,8 @@ Configuration writes require the real native operator, exact entry/form or Root
|
|
|
28
28
|
|
|
29
29
|
Use **Plugins → DSMM bundle config → Permissions**. The selected Global/native-profile scope edits its sparse deployment policy; a separate Root-rules transaction writes Global only under the existing live operator, exact open Root, registration and synchronized-policy authority. A child, stale connection, read-only Host or shadowing native policy doesn't acquire a fallback Global write. Named Profiles can't grant these permissions. No duplicate Settings permission page or Conversation permission tab is registered.
|
|
30
30
|
|
|
31
|
+
A trusted, writable ordinary native Root can manage Global rules without DSMM role admission, including when it predates Core mounting. This does not grant it a DSMM role. Captured DSMM objects still require current admission and role checks; retired captures and unadmitted Roots currently composed with a `dsmm-` preset cannot fall back to ordinary native authority.
|
|
32
|
+
|
|
31
33
|
`permissionControl.nativeCommands` defaults off. Each entry stores exactly one match shape, `{ tool, workingDirectory, commandPattern }`. Legacy `executable`/`subcommand`/`args` entries are not migrated, converted or silently dropped: configuration, persistence, runtime and the form reject them, so an older configuration must be rewritten explicitly rather than widened in place.
|
|
32
34
|
|
|
33
35
|
Entries use `executable BLANK subcommands [BLANK "*"]`, where subcommands are `|`-separated literals: `go build|test` and `go build|test *` are equivalent and allow zero or more trailing argv. `*` only stands for the whole trailing argument list; there is no character glob, regex, executable alternative, parenthesized group or cross-token alternative. Literals allow Unicode letters/marks/digits plus `_ . / : = + % -`, and the executable may also contain Windows path backslashes; quotes, escapes and whitespace inside a path are unsupported. A single-token call or a call with no subcommand position has no pattern equivalent, and any allowed trailing arguments are broader than a formerly fixed argv list.
|
package/docs/settings-status.md
CHANGED
|
@@ -14,7 +14,7 @@ Global and native-profile controls have independent Save, Refresh and Discard ac
|
|
|
14
14
|
|
|
15
15
|
Native structural controls and bounded schema-aware Advanced JSON cover applicable deployment settings. Advanced input is strict JSON, not named-document JSONC. Invalid text and conflicts stay visible. Refresh preserves dirty input and its original revision; explicit discard/reload rebases it. Connection replacement, disconnection, entry replacement and disposal fence old writes. Saving doesn't restart, cancel, apply a named profile or respawn LSP.
|
|
16
16
|
|
|
17
|
-
Configuration edits and Global rules are separate transactions. Writable Global configuration needs no main session; Global rules use a trusted main session as their management entry but persist globally for contexts using that policy. Each transaction retains its own draft, CAS, Save, Refresh and Discard. First load and explicit Refresh show loading;
|
|
17
|
+
Configuration edits and Global rules are separate transactions. Writable Global configuration needs no main session; Global rules use a trusted main session as their management entry but persist globally for contexts using that policy. Each transaction retains its own draft, CAS, Save, Refresh and Discard. Global rules read on opening, session/owner/connection changes and explicit Refresh, without periodic polling or timed retries after failure. Save adopts its returned result. First load and explicit Refresh show loading; automatic reads over an existing observation keep its presentation stable. A same-session scope gap, owner rebind or connection change keeps the last successful rules observation readable as an explicitly unconfirmed projection while withdrawing mutation authority; a real session switch clears it. Other external policy changes are observed on the next read or save, with current authority and CAS checked by the Host on every mutation. Observed revocation, conflicts, disconnection and unsynchronized runtime still withdraw the affected mutation authority without discarding its draft.
|
|
18
18
|
|
|
19
19
|
LSP isn't an applicable UI setting in this version. Its implementation, interfaces and original configuration remain, but DSMM settings hide LSP controls and automatic MCP mounting stays off even with stored `lsp.enabled:true`. Neither a save nor a restart enables it. DSH's own LSP and independently configured MCP are unaffected; the retained historical manual patch isn't a supported DSMM activation entry. See [LSP boundary](lsp.md).
|
|
20
20
|
|
|
@@ -50,7 +50,7 @@ export class PermissionController {
|
|
|
50
50
|
this.connection = generation;
|
|
51
51
|
this.fence(true);
|
|
52
52
|
this.publish({ connected: invoke !== null });
|
|
53
|
-
this.schedule(
|
|
53
|
+
this.schedule();
|
|
54
54
|
}
|
|
55
55
|
bindScope(sessionId, owner, scope) {
|
|
56
56
|
if (this.disposed || this.state.sessionId === sessionId && this.owner === owner && this.state.scope === scope)
|
|
@@ -61,12 +61,12 @@ export class PermissionController {
|
|
|
61
61
|
// only the draft and the read-only display projection may survive for explicit recovery.
|
|
62
62
|
this.fence(sameSession, false, sameSession);
|
|
63
63
|
this.publish({ sessionId, scope });
|
|
64
|
-
this.schedule(
|
|
64
|
+
this.schedule();
|
|
65
65
|
}
|
|
66
66
|
watch() {
|
|
67
67
|
this.watchers++;
|
|
68
68
|
if (this.watchers === 1)
|
|
69
|
-
this.schedule(
|
|
69
|
+
this.schedule();
|
|
70
70
|
let active = true;
|
|
71
71
|
return () => { if (!active)
|
|
72
72
|
return; active = false; this.watchers--; if (this.watchers === 0)
|
|
@@ -75,11 +75,11 @@ export class PermissionController {
|
|
|
75
75
|
dispose() { if (this.disposed)
|
|
76
76
|
return; this.fence(false, false, false); this.disposed = true; this.listeners.clear(); this.invoke = null; this.owner = null; }
|
|
77
77
|
live(generation) { return !this.disposed && generation === this.state.generation && this.owner !== null && this.invoke !== null && this.state.scope === "root" && this.state.sessionId !== null; }
|
|
78
|
-
schedule(
|
|
78
|
+
schedule() {
|
|
79
79
|
clearTimeout(this.timer);
|
|
80
80
|
if (this.watchers === 0 || !this.live(this.state.generation))
|
|
81
81
|
return;
|
|
82
|
-
this.timer = setTimeout(() => { void this.revalidate(this.state.generation); },
|
|
82
|
+
this.timer = setTimeout(() => { void this.revalidate(this.state.generation); }, 0);
|
|
83
83
|
this.timer.unref?.();
|
|
84
84
|
}
|
|
85
85
|
issue(error) { return error instanceof PermissionClientError ? error.code : "transport"; }
|
|
@@ -125,7 +125,6 @@ export class PermissionController {
|
|
|
125
125
|
if (this.live(generation) && sequence === this.requestSequence)
|
|
126
126
|
this.publish({ reading: false, revalidating: false });
|
|
127
127
|
}
|
|
128
|
-
this.schedule();
|
|
129
128
|
}
|
|
130
129
|
edit(generation, patch) {
|
|
131
130
|
if (!this.canEdit(generation) || this.state.draft === null)
|
|
@@ -172,10 +171,8 @@ export class PermissionController {
|
|
|
172
171
|
this.publish({ rulesIssue: this.issue(error) });
|
|
173
172
|
}
|
|
174
173
|
finally {
|
|
175
|
-
if (this.live(generation))
|
|
174
|
+
if (this.live(generation))
|
|
176
175
|
this.publish({ busy: null });
|
|
177
|
-
this.schedule();
|
|
178
|
-
}
|
|
179
176
|
}
|
|
180
177
|
}
|
|
181
178
|
}
|
package/lib/client.js
CHANGED
|
@@ -7246,7 +7246,7 @@ var PermissionController = class {
|
|
|
7246
7246
|
this.connection = generation;
|
|
7247
7247
|
this.fence(true);
|
|
7248
7248
|
this.publish({ connected: invoke !== null });
|
|
7249
|
-
this.schedule(
|
|
7249
|
+
this.schedule();
|
|
7250
7250
|
}
|
|
7251
7251
|
bindScope(sessionId2, owner, scope) {
|
|
7252
7252
|
if (this.disposed || this.state.sessionId === sessionId2 && this.owner === owner && this.state.scope === scope) return;
|
|
@@ -7254,11 +7254,11 @@ var PermissionController = class {
|
|
|
7254
7254
|
this.owner = owner;
|
|
7255
7255
|
this.fence(sameSession, false, sameSession);
|
|
7256
7256
|
this.publish({ sessionId: sessionId2, scope });
|
|
7257
|
-
this.schedule(
|
|
7257
|
+
this.schedule();
|
|
7258
7258
|
}
|
|
7259
7259
|
watch() {
|
|
7260
7260
|
this.watchers++;
|
|
7261
|
-
if (this.watchers === 1) this.schedule(
|
|
7261
|
+
if (this.watchers === 1) this.schedule();
|
|
7262
7262
|
let active = true;
|
|
7263
7263
|
return () => {
|
|
7264
7264
|
if (!active) return;
|
|
@@ -7278,12 +7278,12 @@ var PermissionController = class {
|
|
|
7278
7278
|
live(generation) {
|
|
7279
7279
|
return !this.disposed && generation === this.state.generation && this.owner !== null && this.invoke !== null && this.state.scope === "root" && this.state.sessionId !== null;
|
|
7280
7280
|
}
|
|
7281
|
-
schedule(
|
|
7281
|
+
schedule() {
|
|
7282
7282
|
clearTimeout(this.timer);
|
|
7283
7283
|
if (this.watchers === 0 || !this.live(this.state.generation)) return;
|
|
7284
7284
|
this.timer = setTimeout(() => {
|
|
7285
7285
|
void this.revalidate(this.state.generation);
|
|
7286
|
-
},
|
|
7286
|
+
}, 0);
|
|
7287
7287
|
this.timer.unref?.();
|
|
7288
7288
|
}
|
|
7289
7289
|
issue(error) {
|
|
@@ -7332,7 +7332,6 @@ var PermissionController = class {
|
|
|
7332
7332
|
} finally {
|
|
7333
7333
|
if (this.live(generation) && sequence === this.requestSequence) this.publish({ reading: false, revalidating: false });
|
|
7334
7334
|
}
|
|
7335
|
-
this.schedule();
|
|
7336
7335
|
}
|
|
7337
7336
|
edit(generation, patch) {
|
|
7338
7337
|
if (!this.canEdit(generation) || this.state.draft === null) return;
|
|
@@ -7370,10 +7369,7 @@ var PermissionController = class {
|
|
|
7370
7369
|
} catch (error) {
|
|
7371
7370
|
if (this.live(generation)) this.publish({ rulesIssue: this.issue(error) });
|
|
7372
7371
|
} finally {
|
|
7373
|
-
if (this.live(generation)) {
|
|
7374
|
-
this.publish({ busy: null });
|
|
7375
|
-
this.schedule();
|
|
7376
|
-
}
|
|
7372
|
+
if (this.live(generation)) this.publish({ busy: null });
|
|
7377
7373
|
}
|
|
7378
7374
|
}
|
|
7379
7375
|
};
|
|
@@ -217,12 +217,25 @@ export function createCorePermissionAuthority(ctx, options) {
|
|
|
217
217
|
throw new PermissionRefusal("cancelled");
|
|
218
218
|
seen.add(fiber.ctx);
|
|
219
219
|
}
|
|
220
|
-
const structural = root,
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (identity.readOnly === true || DSMM_ROLES.find(role => role.id === identity.role)?.access === "read-only")
|
|
220
|
+
const structural = root, profiles = coreDomain(root), host = integration();
|
|
221
|
+
const captured = host?.owns(root) === true || capturedRoleInvocation(structural) !== undefined;
|
|
222
|
+
const native = !captured && !profiles.hasAdmission(structural);
|
|
223
|
+
if (native && root.ctx.get("agentPresets")?.composedPreset(root.ctx)?.startsWith("dsmm-"))
|
|
225
224
|
throw new PermissionRefusal("denied");
|
|
225
|
+
if (captured) {
|
|
226
|
+
if (host === undefined)
|
|
227
|
+
throw new PermissionRefusal("unavailable");
|
|
228
|
+
host.assert(root);
|
|
229
|
+
}
|
|
230
|
+
if (!native) {
|
|
231
|
+
const admission = coreAdmission(root);
|
|
232
|
+
rolePolicy.assertModuleAdmission(structural);
|
|
233
|
+
const identity = rolePolicy.identity(structural);
|
|
234
|
+
if (identity.child || identity.parent !== undefined || identity.epoch !== admission.epoch)
|
|
235
|
+
throw new PermissionRefusal("not-owned");
|
|
236
|
+
if (identity.readOnly === true || DSMM_ROLES.find(role => role.id === identity.role)?.access === "read-only")
|
|
237
|
+
throw new PermissionRefusal("denied");
|
|
238
|
+
}
|
|
226
239
|
const sandbox = root.ctx.get("sandboxPolicy");
|
|
227
240
|
if (sandbox === undefined)
|
|
228
241
|
throw new PermissionRefusal("unavailable");
|