@dsmm/dsmm 0.3.3 → 0.3.4
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/agent-presets/dsmm-builder/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-code-search/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-coding/agent.cordis.yml +3 -2
- package/agent-presets/dsmm-complex/agent.cordis.yml +2 -1
- package/agent-presets/dsmm-creative/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-deep/agent.cordis.yml +2 -1
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-documenting/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-frontend/agent.cordis.yml +4 -2
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +3 -2
- package/agent-presets/dsmm-oracle/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +11 -1
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-planner/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-quick/agent.cordis.yml +2 -1
- package/agent-presets/dsmm-research/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +1 -1
- package/docs/native-permissions.md +11 -3
- package/docs/roadmap.md +30 -3
- package/docs/runtime-recovery.md +30 -2
- package/docs/settings-status.md +6 -4
- package/docs/skill-sync.md +13 -14
- package/lib/client/DeploymentFields.js +12 -1
- package/lib/client/DeploymentPage.js +29 -17
- package/lib/client/NativeCommandEntries.js +47 -37
- package/lib/client/PermissionRuleEntries.d.ts +17 -0
- package/lib/client/PermissionRuleEntries.js +70 -0
- package/lib/client/PermissionsPanel.js +4 -2
- package/lib/client/deployment-locales.d.ts +2 -2
- package/lib/client/deployment-locales.js +8 -8
- package/lib/client/deployment-modules.d.ts +5 -3
- package/lib/client/deployment-modules.js +4 -4
- package/lib/client/deployment-workspace.d.ts +4 -0
- package/lib/client/deployment-workspace.js +37 -11
- package/lib/client/permission-controller.d.ts +13 -0
- package/lib/client/permission-controller.js +50 -23
- package/lib/client/permission-locales.d.ts +28 -4
- package/lib/client/permission-locales.js +38 -18
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +8 -8
- package/lib/client.js +1024 -728
- package/lib/core-permission-authority.js +28 -16
- package/lib/index.js +2 -9
- package/lib/native-admission.d.ts +3 -0
- package/lib/native-admission.js +60 -26
- package/lib/permission-controller.js +1 -1
- package/lib/permission-native-command.js +6 -4
- package/lib/permission-settings.d.ts +21 -7
- package/lib/permission-settings.js +21 -9
- package/lib/role-identity.d.ts +1 -1
- package/lib/role-identity.js +16 -4
- package/lib/role-policy.d.ts +3 -0
- package/lib/role-policy.js +29 -5
- package/lib/role-subagents.js +4 -3
- package/lib/runtime-integration.js +4 -4
- package/lib/settings.js +4 -1
- package/lib/state.d.ts +4 -1
- package/lib/state.js +37 -6
- package/package.json +1 -1
- package/prompts/deepwork.md +13 -1
- package/prompts/source/agents/orchestrator.md +10 -0
- package/prompts/source/category/coding.md +2 -1
- package/prompts/source/category/complex.md +1 -0
- package/prompts/source/category/deep.md +1 -0
- package/prompts/source/category/frontend.md +3 -1
- package/prompts/source/category/normal-task.md +2 -1
- package/prompts/source/category/quick.md +1 -0
- package/prompts/source/deepwork/claude-opus-5.md +2 -0
- package/prompts/source/deepwork/default.md +12 -0
- package/prompts/source/deepwork/gemini.md +6 -1
- package/prompts/source/deepwork/glm.md +5 -1
- package/prompts/source/deepwork/gpt.md +22 -2
- package/prompts/source/deepwork/kimi-k27.md +2 -0
- package/prompts/source/deepwork/planner.md +3 -1
- package/prompts/source/deepwork/swe-2.md +2 -0
- package/prompts/source/manifest.json +3 -68
- package/prompts/source/shared/dsh-host-contract.md +1 -1
- package/skills/ast-grep/SKILL.md +1 -1
- package/skills/brainstorming/SKILL.md +1 -1
- package/skills/coding-agent-sessions/SKILL.md +1 -1
- package/skills/debugging/SKILL.md +1 -1
- package/skills/dispatching-parallel-agents/SKILL.md +1 -1
- package/skills/frontend/SKILL.md +1 -1
- package/skills/git-master/SKILL.md +1 -1
- package/skills/init-deep/SKILL.md +1 -1
- package/skills/receiving-code-review/SKILL.md +1 -1
- package/skills/remove-ai-slops/SKILL.md +1 -1
- package/skills/requesting-code-review/SKILL.md +1 -1
- package/skills/subagent-driven-development/SKILL.md +1 -1
- package/skills/using-git-worktrees/SKILL.md +1 -1
- package/skills/writing-plans/SKILL.md +1 -1
package/docs/roadmap.md
CHANGED
|
@@ -23,11 +23,11 @@ Native call views show the target in collapsed rows, distinguish requested from
|
|
|
23
23
|
| Profile selection in a new session | The working tree supports choosing a profile or deployment defaults before the first turn. | Preserve first-request, child-routing and draft behavior through supported native Client integration. |
|
|
24
24
|
| Live overlay Apply | Unavailable. Save/select a future default for a new session; ordinary model and mode actions retain independent capabilities. | Exact configuration/call/approval binding without cross-call authority reuse. See [approval boundaries](deferred-native-approval-risk.md). |
|
|
25
25
|
| Running-call background handoff | Unavailable. Select waiting or native parent delivery before starting; don't restart a task to simulate transfer. | A supported same-activation ownership/delivery handoff. |
|
|
26
|
-
|
|
|
26
|
+
| Restricted-role continuation after restoration | Native history and restoration remain available under DSH's rules; historical metadata does not grant current DSMM role authority. DSMM-specific restrictions are not guaranteed across restoration. | Supported Host lifecycle hooks that preserve the required readonly, tool and depth restrictions without a global restoration gate. |
|
|
27
27
|
| Non-disruptive hot update | No uninterrupted live-session guarantee. Retire admissions and let native owners cancel/dispose owned work; guards remain fail-closed. | Native lifecycle support that preserves active task/approval boundaries. |
|
|
28
28
|
| Catalog-backed raw combinations | Rejected where the complete composition can't be reliably reproduced, regardless of native or DSMM parameter source. Standard calls aren't affected. | A public seam that can reproduce the full catalog composition and preserve native capability/effort semantics. |
|
|
29
29
|
| Repeated read-only Git approval | Keep native approval; don't expand Allow rules based on an unexplained prompt. | Exact triggering command, working directory and approval reason. |
|
|
30
|
-
|
|
|
30
|
+
| PowerShell Fake-IP access | Verified HTTPS through the current Mihomo Fake-IP route with Node/OpenSSL in native and DSMM `workspace-write`; Windows curl/Schannel fails in both sandbox paths. | Upstream Windows sandbox/Schannel compatibility; configured proxy-environment propagation remains unverified. See [network limitations](runtime-recovery.md#powershell-in-a-fake-ip-environment). |
|
|
31
31
|
| External LSP | DSMM automatic mounting isn't delivered. DSH native definition/references/implementation/hover and independently configured MCP remain separate. | Supported APIs and explicit permissions for additional operations; no automatic external remount or scope expansion. |
|
|
32
32
|
|
|
33
33
|
Search/Fetch retain the explicitly configured native provider. DSMM doesn't automatically enable a direct API, change credentials or forward the recent human question. HTTP Fake-IP behavior and network limits are maintained in [Fake-IP fetch](web-fetch-fakeip.md).
|
|
@@ -62,10 +62,37 @@ Sessions created by DSMM `0.2.x` must remain loadable under the supported curren
|
|
|
62
62
|
|
|
63
63
|
- Register only the dispatcher as a selectable native preset. Delegation targets are not registered compositions: a delegated child shares its parent's standing composition, and the admitted invocation carries its role, identity and restrictions.
|
|
64
64
|
- Blank preset switches to any other DSMM role are refused by the native registry; the admitted composition keeps executing.
|
|
65
|
-
- DSMM installs no Host package patches.
|
|
65
|
+
- DSMM installs no Host package patches. Native restoration does not enroll reconstructed Agents in DSMM admission; history stays readable, while delegation authority and child residency are never reconstructed from logs.
|
|
66
66
|
|
|
67
67
|
Existing [Fake-IP fetch](web-fetch-fakeip.md) protections remain in force.
|
|
68
68
|
|
|
69
|
+
## Current: command-pattern allowlists
|
|
70
|
+
|
|
71
|
+
- Use command patterns as the sole native-command rule format. `go build|test` matches either subcommand with variable trailing arguments. Legacy exact-command configuration is rejected without migration or silent permission expansion. See the [implementation plan](superpowers/plans/2026-10-21-command-pattern-only.md).
|
|
72
|
+
- Match parsed command tokens rather than shell-string prefixes. A matching command does not authorize an additional pipeline, chained command or substitution. Variable arguments can still invoke the selected program's own scripts or subprocess features; sandbox and role restrictions remain necessary.
|
|
73
|
+
- Preserve native deny/never, readonly, current ownership, approval consumption and configuration CAS. Pattern matching does not itself widen the sandbox or create remembered session approval.
|
|
74
|
+
|
|
75
|
+
## Planned: session-scoped approval reuse
|
|
76
|
+
|
|
77
|
+
- Implementation is deferred pending reassessment of a newer DSH release. Prefer native remembered approvals if available; otherwise decide whether a DSMM-scoped extension is warranted. The goals below do not select an implementation or authorize Host changes.
|
|
78
|
+
- Let the model propose a command/subcommand pattern or supported path scope together with a reason. The operator chooses between approving once and remembering that explicit scope for the current session; the model cannot grant itself permission.
|
|
79
|
+
- Keep remembered grants in memory for the current live session and Host run, with a visible revoke action. Do not save them as Global/profile configuration, restore them from history, or automatically share them with other sessions or delegated Agents. Session disposal, Host restart or plugin retirement invalidates them.
|
|
80
|
+
- Display the approved command scope and sandbox mode separately. Reuse approval only for matching calls and the explicitly approved mode through the native approval service; native never/deny and readonly/role ceilings remain effective.
|
|
81
|
+
- A remembered `danger-full-access` approval, if supported, must explicitly disclose the broader OS-permitted write scope. It is not a directory-only grant. Approving one command once must not silently disable confinement for later commands.
|
|
82
|
+
- Verify reuse, non-matching calls, revocation and lifetime expiry through the supported approval path. This capability is planned, not part of the command-pattern implementation.
|
|
83
|
+
|
|
84
|
+
## Planned: external-path and temporary-directory grants
|
|
85
|
+
|
|
86
|
+
- Reassess the available public DSH interfaces before choosing an implementation. This capability remains deferred rather than blocking command-pattern or configuration improvements.
|
|
87
|
+
- Target independent read and write permissions for exact paths or directory trees: normal workspace writes, configured external reads, and writes only to explicitly authorized external locations. A dedicated system-temp `dsh` subtree is a useful opt-in scope for creating, editing and cleaning Agent-owned temporary files; it must not grant access to the entire system temp directory or authorize deleting unrelated files.
|
|
88
|
+
- DSH `0.2.1-rc.2` has no additional writable-root field in its standard execution policy. Its Windows backend supplies a private per-session/workspace `dsh-*` directory through child-process `TMP`/`TEMP`; this is neither a configurable fixed `temp/dsh` grant nor proof that native file tools share the same allowance.
|
|
89
|
+
- Broader support depends on public Host path-grant interfaces consumed consistently by native file tools and shell confinement. Preserve readonly, resolve path/link boundaries, and verify that adjacent unapproved locations remain unwritable. Do not expose a nonfunctional setting, substitute full access, or implement a private ACL framework in DSMM.
|
|
90
|
+
|
|
91
|
+
## Upstream follow-up: Windows Git Schannel
|
|
92
|
+
|
|
93
|
+
- Track the sandbox/Schannel incompatibility reproduced with DSH `0.2.1-rc.2`; an upstream fix is not yet confirmed. Details and the explicit per-command OpenSSL workaround are in [runtime limitations](runtime-recovery.md#known-host-limitation-windows-sandbox-and-git-schannel).
|
|
94
|
+
- On a candidate DSH update, verify Git HTTPS with Schannel through both native and DSMM-managed `workspace-write` execution, while retaining denial of unauthorized external writes. Do not disable certificate validation, silently change TLS backends or relax sandbox restrictions to obtain a passing result.
|
|
95
|
+
|
|
69
96
|
## Publication and Desktop installation
|
|
70
97
|
|
|
71
98
|
0.3.1 publication uses the version-bound [release controls](releasing.md). Desktop plugin installation follows publication, uses the Desktop-owned carrier and requires exact DSH `0.2.1-rc.2`. Installation doesn't authorize upgrading the Host, changing credentials or real sessions, altering unrelated configuration, or restarting active work. An incompatible Host or required data migration blocks installation rather than expanding its scope.
|
package/docs/runtime-recovery.md
CHANGED
|
@@ -45,8 +45,36 @@ Supported exact live children may receive Queue/Steer or interrupt through nativ
|
|
|
45
45
|
|
|
46
46
|
## Cold resume and lifetime
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Native history loading, reading, promotion, explicit/declarative restoration and durable restoration after provider unregistration follow DSH's own rules. DSMM doesn't add a global restoration gate or require an execution-admission SDK, owner slot or participant protocol. DSMM read-only history queries don't themselves call resume.
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
DSMM uses public serial `agent/created` callbacks for fresh admission. A role's first creation requires its exact pending parent/provider/invocation, standing composition, scope, tool filter and depth ceiling. Role binding precedes Agent-scoped installation; publication rechecks current owner, exact parent, cancellation and composition after installation. Fresh ordinary children of a non-controlled admitted parent inherit its captured configuration and tool ceiling without acquiring a role invocation.
|
|
51
|
+
|
|
52
|
+
Native `resume` doesn't enroll a reconstructed Agent in DSMM admission. Historical descriptors, role/preset labels, mode events and profile selections don't grant current DSMM role qualification. Fresh roots use current `prepareRoot` and root eligibility checks; saved profile-selection `admissionEpoch` and disk CAS retain their configuration-selection meaning, not execution authority. Old retry, approval and pending-call state isn't restored.
|
|
53
|
+
|
|
54
|
+
Restricted-role continuation can lose DSMM-specific readonly, tool-filter and depth captures on restoration. The current Host doesn't provide a supported guarantee of safe DSMM restricted-role continuation across restoration, unload/reinstall or restart. That capability is deferred; a restored native request isn't proof of valid DSMM role admission or preserved restrictions. This limitation doesn't block native restoration or ordinary configuration/UI saves.
|
|
55
|
+
|
|
56
|
+
Official Registry, Runtime and JSONL plugins own lifecycle and storage. DSMM live captures and callbacks retain their exact Agent and current owner checks; Agent-scoped guards remain fail-closed after that owner retires. They don't enroll other Agents or revoke native history globally. Ordinary unadmitted native tool calls, including managed shell calls, retain native approval/sandbox behavior and applicable permission rules through exact live registry, realm and lifetime checks, without acquiring DSMM role or configuration-write rights. Retired exact DSMM captures cannot use that native path. DSMM-specific entry points still require their applicable live admission and permission ceilings; native restoration doesn't provision those rights. No descriptor authorization ledger, persisted grant, cold migration, automatic history rewrite or cross-process automatic retry is provided.
|
|
51
57
|
|
|
52
58
|
Diagnostics omit request/provider bodies, credentials and goal/todo text.
|
|
59
|
+
|
|
60
|
+
## Known Host limitation: Windows sandbox and Git Schannel
|
|
61
|
+
|
|
62
|
+
DSH `0.2.1-rc.2` with the `windows-acl` backend can fail HTTPS Git operations under `workspace-write` with `schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030e)`. This was reproduced on 2026-10-21 using a public repository and isolated Git configuration, without account authentication.
|
|
63
|
+
|
|
64
|
+
The same Git command succeeds outside the sandbox, fails through both the native DSH executor and the DSMM-managed native tool with unchanged effective sandbox policy, and succeeds inside the same sandbox when explicitly using OpenSSL. This isolates the failure to the Windows sandbox/Schannel interaction, not a DSMM-specific permission decision. The specific restricted-token flag, SID or integrity-level interaction remains undetermined; the error does not establish missing GitHub credentials.
|
|
65
|
+
|
|
66
|
+
An explicit per-command workaround, where the installed Git supports OpenSSL and its certificate trust configuration is suitable, is:
|
|
67
|
+
|
|
68
|
+
```powershell
|
|
69
|
+
git -c http.sslBackend=openssl ls-remote https://github.com/git/git.git HEAD
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This changes the TLS trust backend, not the sandbox policy, and keeps certificate verification enabled. DSMM must not inject it silently, change global Git configuration, disable TLS verification or switch to full access to hide the failure.
|
|
73
|
+
|
|
74
|
+
Upstream fix status is unconfirmed. On a later DSH version, recheck the same read-only Git operation with Schannel through the native `workspace-write` executor and DSMM-managed path. A sandbox fix must also preserve denial of workspace-external writes; a successful full-access command is not a fix. No local Host or dependency patch is applied for this limitation.
|
|
75
|
+
|
|
76
|
+
### PowerShell in a Fake-IP environment
|
|
77
|
+
|
|
78
|
+
An isolated PowerShell 7 comparison on DSH `0.2.1-rc.2` confirmed HTTPS access to `https://example.com/` through a Mihomo route with a DNS answer in `198.18.0.0/16`. Node HTTPS/OpenSSL succeeded with certificate verification in the ordinary process, native `windows-acl` `workspace-write` executor and DSMM-managed pwsh tool. Windows curl/Schannel succeeded outside the sandbox but returned exit code 35 and `SEC_E_NO_CREDENTIALS` in both sandbox paths. These results establish connectivity for that Fake-IP route, not a general guarantee for every destination or proxy setup; they do not identify Fake-IP as the cause of the Schannel failure.
|
|
79
|
+
|
|
80
|
+
The comparison had no `HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY` or `NO_PROXY` environment variables. Propagation of explicitly configured proxies remains unverified. The DSMM tool result preserves the native command's exit code; an outer `isError: false` alone does not mean the command succeeded. The opt-in [Fake-IP web provider](web-fetch-fakeip.md) affects `ctx.web`, not shell routing or TLS. No bash, WSL or Git Bash network verification is claimed.
|
package/docs/settings-status.md
CHANGED
|
@@ -8,12 +8,14 @@ Effective settings resolve from **defaults → sparse global base → explicit n
|
|
|
8
8
|
|
|
9
9
|
<a id="native-plugins-configuration-d"></a>
|
|
10
10
|
|
|
11
|
-
**Plugins → DSMM bundle config** is the single deployment configuration surface, registered as `plugins.bundle.config` for `@dsmm/dsmm`. The scope selector chooses Global or current native-profile overrides;
|
|
11
|
+
**Plugins → DSMM bundle config** is the single deployment configuration surface, registered as `plugins.bundle.config` for `@dsmm/dsmm`. The scope selector chooses Global or current native-profile overrides. Five flat tabs cover Run and modules, Model routes and recovery, Workflow/roles/subagents, Permissions and safety, and Configuration state; Other/advanced appears only for ungrouped schema fields. Global edits use fixed `remote.dsmmConfig`. Profile edits use the public native form resolved from the authenticated snapshot's actual namespace. Runtime entry ID, package ID, row ID and form namespace aren't interchangeable. A profile write requires the actual descriptor revision and matching raw base/user provenance. Missing or mismatched identity leaves the profile scope unavailable or read-only, never falling back to Global. Named Profiles retains its separate Settings/header entries; no duplicate permission page or Conversation configuration tabs are registered.
|
|
12
12
|
|
|
13
13
|
Global and native-profile controls have independent Save, Refresh and Discard actions and revisions. There's no Save all or cross-layer transaction. Missing keys inherit, explicit same-default values pin, and Unset removes only the edited layer's key, not a higher Host pin. Plain objects merge recursively and arrays replace. Full merged validation follows sparse-layer validation; unknown/prototype keys, non-JSON values and raw volatile refs refuse.
|
|
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; background rule revalidation keeps the existing view, focus and editing controls stable. Observed revocation, conflicts, disconnection and unsynchronized runtime still withdraw the affected mutation authority without discarding its draft.
|
|
18
|
+
|
|
17
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).
|
|
18
20
|
|
|
19
21
|
### Save authority and concurrency
|
|
@@ -50,7 +52,7 @@ Only relevant effective permission changes coordinate revocation. Unrelated loca
|
|
|
50
52
|
|
|
51
53
|
## Runtime controls
|
|
52
54
|
|
|
53
|
-
`/deepwork [off|message]` changes the receiving session's mode. Explicit intent, including a same-default choice, is separate from profile defaults. Official minimal conversations default off; DW presets default on unless explicit intent says otherwise. Off hides common workflow/DSMM skills, not persona, read-only restrictions or host/Git permissions. Busy mutations refuse instead of queuing. Persisted intent doesn't
|
|
55
|
+
`/deepwork [off|message]` changes the receiving session's mode. Explicit intent, including a same-default choice, is separate from profile defaults. Official minimal conversations default off; DW presets and freshly admitted role children default on unless explicit intent says otherwise. Off hides common workflow/DSMM skills, not persona, read-only restrictions or host/Git permissions. Busy mutations refuse instead of queuing. Persisted mode/profile intent doesn't grant current DSMM role admission after reconstruction. Slash commands belong to the native command adapter, not headless task text.
|
|
54
56
|
|
|
55
57
|
`canSelectModel`, `canToggleMode` and `canApplyOverlay` describe independent actions and refusal reasons. Live overlay Apply is unavailable (`new-session-required`); save/select a future default for a new session. This doesn't disable ordinary mode changes or **Use profile model** where their own native service, idle/session identity and manual-intent checks pass. Use profile model selects from admitted immutable configuration, doesn't write a profile pointer, and respects a newer manual choice even when its value is unchanged.
|
|
56
58
|
|
|
@@ -72,12 +74,12 @@ Official AgentRegistry, SubagentRuntime and JSONL namespace plugins own executio
|
|
|
72
74
|
|
|
73
75
|
The [bundle patch](../cordis.patch.yml) adds DSMM to the native composition. Core configuration/status/permissions don't require active Deepwork or a child task. `runtime.enabled` isn't a current owner selector. Desired source, mounted capability and actual live admission remain separate facts.
|
|
74
76
|
|
|
75
|
-
`subagentRuntime` projects native `binding: stock | unavailable`, DSMM admission readiness (`deliveryFenceReady`), restart requirement and a bounded reason.
|
|
77
|
+
`subagentRuntime` projects native `binding: stock | unavailable`, DSMM admission readiness (`deliveryFenceReady`), restart requirement and a bounded reason. Readiness observes the native subagent service and activated, current DSMM admission owner. It doesn't certify every Agent, provider/control capability or restricted-role recovery across restoration. No experimental SDK API or global registry binding check is required. Saves retain actual native form revision/authorization and don't remount services.
|
|
76
78
|
|
|
77
79
|
Enabled background work must choose `run_in_background:true` before `startActivation`, using `delivery:'parent'`; otherwise delivery is to the waiting caller. Accepted child/message IDs aren't completed results. Running waiting calls have no handoff action. Native receipt disposal handles cancellation after publication and waits for cleanup.
|
|
78
80
|
|
|
79
81
|
Live direct-child Queue/Steer/interrupt require actual capabilities and exact parent/operator/lifetime authority. Read-only descendant inspection grants no control. Readiness loss closes DSMM execution; stale handles don't grant authority. Agent-scoped guards remain fail-closed after owner retirement. Hot replacement isn't a promise of uninterrupted live-session operation.
|
|
80
82
|
|
|
81
|
-
|
|
83
|
+
Native history loading, reading, promotion, explicit/declarative restoration and durable restoration after provider unregistration remain native-owned, without a global DSMM gate. Reconstruction doesn't enroll the new Agent as a DSMM role; historical metadata isn't current role authorization. Fresh root admission and blank configuration selection preserve profile-selection epochs and disk CAS; first role creation retains exact pending, parent/provider, readonly, tool-filter and depth checks. Exact admitted live objects and DSMM entry points remain guarded after owner retirement. Preserving DSMM fine-grained role restrictions across restoration isn't guaranteed on this Host and is deferred, not reported ready; restored native execution isn't verified DSMM restricted-role continuation. This limitation doesn't block configuration/UI saves. Read-only history inspection doesn't itself resume Agents. No cold migration, persistent grant or automatic history rewrite is supplied. See [runtime recovery](runtime-recovery.md#cold-resume-and-lifetime).
|
|
82
84
|
|
|
83
85
|
*Author's note: For a DSH deployment operator; distinguish a successful configuration save from captured runtime availability before applying policy.*
|
package/docs/skill-sync.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# DSMM source-content synchronization
|
|
2
2
|
|
|
3
|
-
DSMM 0.3.1 targets exactly **DSH 0.2.1-rc.2**. Source synchronization
|
|
3
|
+
DSMM 0.3.1 targets exactly **DSH 0.2.1-rc.2**. Source synchronization is a monorepo maintenance operation that directly reads the current OCMM repository-root files declared by `scripts/source-inventory.mjs`. Generated `prompts/source/manifest.json` records the repository-relative source → artifact → consumer paths, source anchors, adaptation rules, canonical role/skill inventories, attribution and exclusions. Runtime uses package-relative prepared assets only; it never reads the repository-root sources or requires an OCMM checkout, global SDK path or maintenance compiler. Root AGENTS, Codex bundles and user/provider/model configuration are not synchronization inputs.
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The source closure is limited to the two catalog TS files, `src/hooks/config.ts`, prompt-loader/model-family assembly inputs, shared shell safety, the selected v1 role/category/workflow Markdown, and the fourteen recursive skill resource trees. Local source, documentation and generated resources are not locked to recorded bytes. Required resources, repository-root containment and regular non-linked paths are checked. Third-party downloads retain their upstream integrity verification and attribution.
|
|
6
6
|
|
|
7
7
|
## Inventories and assembly
|
|
8
8
|
|
|
@@ -24,21 +24,20 @@ Ancestor snapshot precedence, incomplete-observation refusal, invocation policy
|
|
|
24
24
|
|
|
25
25
|
`preset-skills.ts` is internal: admission installs `registerAgentSkills` for the exact Agent, and that scope owns invalidation and release. It isn't a public package plugin or a separate global lifecycle owner. Mode/preset changes reconcile affected resources only; reading rechecks cancellation, scope and generation before returning a body. Agent scopes remain isolated.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Synchronize and check
|
|
28
28
|
|
|
29
|
-
Use existing Node/TypeScript/pnpm. To
|
|
29
|
+
Use existing Node/TypeScript/pnpm. To adapt the current declared repository-root sources, run from `dsmm/` with the existing complete fixed-pin frontend library:
|
|
30
30
|
|
|
31
31
|
```powershell
|
|
32
|
-
|
|
33
|
-
pnpm run sync:source # adapts the sealed snapshot; never refreshes it implicitly
|
|
32
|
+
pnpm run sync:source
|
|
34
33
|
```
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
Synchronization reads only the declared files and recursive skill trees from the same repository checkout. It rejects escaping paths, links, non-regular entries, missing inputs, source anchor drift, incomplete resource references and unknown prepared destination content. Explicit synchronization updates prepared outputs, while read-only checks report missing or additional resources without writing.
|
|
37
36
|
|
|
38
|
-
CI and
|
|
37
|
+
Repository CI and maintainers use the checkout's adapter/generator and repository-root sources:
|
|
39
38
|
|
|
40
39
|
```powershell
|
|
41
|
-
pnpm run sync:source #
|
|
40
|
+
pnpm run sync:source # rebuild prepared source targets from repository-root inputs
|
|
42
41
|
pnpm run build # offline frontend resource availability check first
|
|
43
42
|
pnpm run generate:roles # coordinated renderer owner, after build
|
|
44
43
|
pnpm run check:source # read-only resource availability and path checks
|
|
@@ -46,15 +45,15 @@ pnpm run check:source # read-only resource availability and path checks
|
|
|
46
45
|
|
|
47
46
|
`sync-source-assets.mjs --check` and `generate-role-assets.mjs --check` check required output availability without writing or enforcing byte equality. `check:source` combines those results with resource-reference and safe-path checks. Explicit generation still renders current source inputs and writes changed outputs; it is not a content-locking gate.
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
The direct regression check does not emit shared `lib/` or presets:
|
|
50
49
|
|
|
51
50
|
```powershell
|
|
52
|
-
node --import ./test/prompt-source-loader.mjs --test --experimental-strip-types --test-concurrency=1 test/source-
|
|
51
|
+
node --import ./test/prompt-source-loader.mjs --test --experimental-strip-types --test-concurrency=1 test/source-sync.test.ts
|
|
53
52
|
```
|
|
54
53
|
|
|
55
|
-
Regression coverage exercises
|
|
54
|
+
Regression coverage exercises direct repository-source loading, metadata generation, missing-resource errors, unsafe-path refusal and prepared-resource closure. It does not freeze source files, generated Markdown, licenses, line endings or local resources with hashes or whole-file comparisons. The resource synchronizer and role renderer remain separate maintenance entry points.
|
|
56
55
|
|
|
57
|
-
|
|
56
|
+
A standalone DSMM checkout or installed npm package cannot rerun source synchronization because maintenance requires the sibling repository-root source paths. This does not affect runtime: the npm package and other distribution surfaces consume only prepared package-relative prompts, skills and resources. A cold monorepo rebuild also needs the existing approved toolchain/dependencies and the **prepared complete frontend fixed-pin library**. An authorized release/build owner must preserve that library in the checkout or staging surface; missing bodies or inventory fail offline with no download or historical fallback. Separately authorized `pnpm run sync:frontend` can materialize missing fixed-pin resources, but is never an implicit CI/build/check action. No software installation is authorized by these commands.
|
|
58
57
|
|
|
59
58
|
Source Markdown is kept in full, with precise anchored changes and an explicit DSH resource/authority boundary. Native read/glob/grep, web_search/web_fetch, write/edit, bash/pwsh and skill invocation are the tools mapped here; native read uses `file_path`. Exposed `todo_write` replaces the owning Agent's whole content/status list under its actual parallel policy; exposed `ask_user_question` provides questions, otherwise conversation does. LSP, image/browser, documentation services and native controls remain actual-catalog/route capabilities. Host compaction is not OCMM `compress`. No Task, todowrite, compress or Context7 MCP interface is invented. Template fields describe an assignment, not callable parameters. Native delegation groups preserve root/stage-owner Builder versus bounded child Builder, strict-leaf research, read-only utility restrictions and local-coordinator specialists; runtime policy enforces these boundaries.
|
|
60
59
|
|
|
@@ -92,4 +91,4 @@ Body/data/Python resources and `.frontend-materialized.json` are gitignored. Lic
|
|
|
92
91
|
|
|
93
92
|
`node scripts/materialize-frontend.mjs` defaults to read-only/offline checks for required resources, safe paths and referenced dependencies. Build and readiness checks do not enforce local content hashes. Explicit `sync:frontend` fetches missing resources without replacing existing files. Runtime distribution needs package-relative resources, not an upstream checkout or network access.
|
|
94
93
|
|
|
95
|
-
**Distribution handoff:** with the authorized build toolchain and complete fixed-pin resources, run
|
|
94
|
+
**Distribution handoff:** with the authorized build toolchain, repository-root sources and complete fixed-pin resources, run `sync:source`, then coordinated build/generate/check/pack. Only separately authorized materialization uses `sync:frontend`. Prepared prompts/skills and every fixed-pin runtime resource must be delivered; ignored status does not supply them to a cold checkout. Frozen tarballs must already carry the complete library. Default build/check does not fetch resources. Local compiled/materialized content is not proof of packed delivery. Full packed inventory and missing-resource refusal remain separate evidence from native runtime/UI capability, permission and lifecycle completion.
|
|
@@ -5,11 +5,19 @@ import { at, enumValues, equal, mergeLayer, parseAdvanced, validateEditorValue }
|
|
|
5
5
|
import { deploymentFieldLabels } from "./deployment-locales.js";
|
|
6
6
|
import { permissionEn, permissionZh } from "./permission-locales.js";
|
|
7
7
|
import { NativeCommandEntries } from "./NativeCommandEntries.js";
|
|
8
|
+
import { PermissionRuleEntries } from "./PermissionRuleEntries.js";
|
|
8
9
|
export const permissionText = (t) => (key) => (t("global") === "DSMM 全局配置" ? permissionZh : permissionEn)[key];
|
|
9
10
|
export function fieldLabel(path, t) {
|
|
10
11
|
const key = path.at(-1);
|
|
11
12
|
if (path[0] === "permissionControl" && ["outsideReads", "webSearch", "webFetch", "rules", "nativeCommands", "rule"].includes(key))
|
|
12
13
|
return permissionText(t)(key);
|
|
14
|
+
if (path[0] === "guards") {
|
|
15
|
+
const guard = { scope: "guardScope", shellCommandSafety: "shellSafety", gitWriteGuard: "gitWrite", toolOutputTruncation: "toolOutputTruncation", planFormatValidation: "planValidation", questionLabelHelper: "questionLabels", todoDisciplineHelper: "todoDiscipline",
|
|
16
|
+
enabled: "enabled", maxInlineBytes: "maxInlineBytes", maxLabelChars: "maxLabelChars" };
|
|
17
|
+
const mapped = guard[key];
|
|
18
|
+
if (mapped !== undefined)
|
|
19
|
+
return permissionText(t)(mapped);
|
|
20
|
+
}
|
|
13
21
|
const item = deploymentFieldLabels[key];
|
|
14
22
|
return item === undefined ? key.replace(/^dsmm-/u, "").replace(/([a-z])([A-Z])/gu, "$1 $2") : item[t("global") === "DSMM 全局配置" ? 1 : 0];
|
|
15
23
|
}
|
|
@@ -43,13 +51,14 @@ export function AdvancedField({ schema, path, controller, inherited, upper, expa
|
|
|
43
51
|
export function ScalarField({ schema, path, controller, inherited, t }) {
|
|
44
52
|
const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot), id = useId(), name = path.join(".");
|
|
45
53
|
const value = at(state.draft, path), raw = state.raw[name], bad = raw?.invalid === true;
|
|
54
|
+
const units = name === "guards.toolOutputTruncation.maxInlineBytes" ? ` · ${permissionText(t)("unitBytes")}` : name === "guards.questionLabelHelper.maxLabelChars" ? ` · ${permissionText(t)("unitChars")}` : "";
|
|
46
55
|
return _jsxs(_Fragment, { children: [_jsx("label", { htmlFor: id, children: fieldLabel(path, t) }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Input, { className: "dsmm-input", id: id, type: "text", inputMode: schema.type === "number" ? "decimal" : undefined, value: raw?.text ?? String(value ?? inherited ?? ""), disabled: !controller.canEdit(), "aria-invalid": bad, "aria-describedby": `${id}-error`, onChange: event => {
|
|
47
56
|
const text = event.currentTarget.value, candidate = schema.type === "number" ? Number(text) : text;
|
|
48
57
|
const valid = (schema.type !== "number" || text.trim() !== "") && validateEditorValue(candidate, schema);
|
|
49
58
|
controller.setRaw(name, text, !valid);
|
|
50
59
|
if (valid)
|
|
51
60
|
controller.edit(path, candidate);
|
|
52
|
-
} }), _jsx(Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: !controller.canEdit() || value === undefined && raw === undefined, onClick: () => { controller.clearRaw(name); controller.edit(path, undefined); }, children: t("unset") })] }), _jsxs("p", { id: `${id}-error`, className: "dsmm-hint", children: [bad ? t("invalid") : "", schema.type === "number" && (schema.min !== undefined || schema.max !== undefined) ? ` ${schema.min ?? "—"} – ${schema.max ?? "—"}` : ""] })] });
|
|
61
|
+
} }), _jsx(Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: !controller.canEdit() || value === undefined && raw === undefined, onClick: () => { controller.clearRaw(name); controller.edit(path, undefined); }, children: t("unset") })] }), _jsxs("p", { id: `${id}-error`, className: "dsmm-hint", children: [bad ? t("invalid") : "", schema.type === "number" && (schema.min !== undefined || schema.max !== undefined) ? ` ${schema.min ?? "—"} – ${schema.max ?? "—"}` : "", units] })] });
|
|
53
62
|
}
|
|
54
63
|
export function Field({ schema, path, controller, initiallyOpen = false, disclosures, t }) {
|
|
55
64
|
if (schema.type === "transform" && schema.inner !== undefined)
|
|
@@ -61,6 +70,8 @@ export function Field({ schema, path, controller, initiallyOpen = false, disclos
|
|
|
61
70
|
const choices = enumValues(schema), disabled = !controller.canEdit();
|
|
62
71
|
if (name === "permissionControl.nativeCommands.entries")
|
|
63
72
|
return _jsx("div", { "data-field": name, children: _jsx(NativeCommandEntries, { controller: controller, value: explicit, inherited: (inherited ?? []), disabled: disabled, onChange: value => controller.edit(path, value), setInvalid: (key, bad) => controller.setInvalid(key, bad), t: permissionText(t) }) });
|
|
73
|
+
if (name === "permissionControl.rules")
|
|
74
|
+
return _jsx("div", { "data-field": name, children: _jsx(PermissionRuleEntries, { controller: controller, value: explicit, inherited: (inherited ?? []), disabled: disabled, onChange: value => controller.edit(path, value), expanded: open, onExpandedChange: expand, t: permissionText(t) }) });
|
|
64
75
|
if (schema.type === "object" && schema.fields !== undefined && path[0] !== "roleRouting")
|
|
65
76
|
return _jsxs("details", { className: "dsmm-deployment-group", "data-field": name, open: open, onToggle: event => expand(event.currentTarget.open), children: [_jsx("summary", { children: fieldLabel(path, t) }), _jsxs("div", { children: [name === "permissionControl" && _jsx("p", { className: "dsmm-hint", children: permissionText(t)("configPolicyHint") }), _jsx("p", { className: "dsmm-hint", children: t(explicit === undefined ? "inherit" : "explicit") }), _jsx(Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: disabled || explicit === undefined && !Object.keys(state.raw).some(key => key === name || key.startsWith(`${name}.`)), onClick: () => { controller.clearRaw(name); controller.edit(path, undefined); }, children: t("unsetGroup") }), Object.entries(schema.fields).map(([key, node]) => _jsx(Field, { schema: node, path: [...path, key], controller: controller, disclosures: disclosures, t: t }, key))] })] });
|
|
66
77
|
if (!["boolean", "string", "number"].includes(schema.type) && choices === null)
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useEffect, useId, useRef, useSyncExternalStore } from "react";
|
|
3
3
|
import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
4
4
|
import { deploymentWorkspace } from "./deployment-workspace.js";
|
|
5
|
-
import {
|
|
5
|
+
import { NAVIGATION_MODULES, moduleFields, moduleFor, moduleTitle } from "./deployment-modules.js";
|
|
6
6
|
import { at, inspectorPaths, scopeSchema, visibleDeploymentPath } from "./deployment-data.js";
|
|
7
7
|
import { Field, displayValue, permissionText } from "./DeploymentFields.js";
|
|
8
8
|
import { configurationVersionState } from "./configuration-display.js";
|
|
@@ -11,7 +11,7 @@ import { permissionEn } from "./permission-locales.js";
|
|
|
11
11
|
export function ScopeSave({ controller, workspace, refreshOnly = false, t }) {
|
|
12
12
|
const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot);
|
|
13
13
|
const pending = [...new Set(controller.pendingPaths().map(moduleFor))];
|
|
14
|
-
return _jsxs("section", { className: "dsmm-scope-save", "aria-label": t(
|
|
14
|
+
return _jsxs("section", { className: "dsmm-scope-save", "aria-label": t("saveScope"), children: [_jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: refreshOnly ? state.busy ? t("loading") : "" : state.busy ? t("saving") : state.refreshRequired ? t("savedRefreshRequired") : state.saved ? t("saved") : state.dirty ? t("dirty") : "" }), !refreshOnly && pending.length > 0 && _jsxs("p", { children: [t("pendingModules"), ": ", pending.map(module => t(moduleTitle(module))).join(" · ")] }), state.issue !== null && _jsx("p", { className: "dsmm-issue", role: "alert", children: t(state.issue) }), !refreshOnly && state.invalidFields.length > 0 && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("invalid") }), controller.layer === "profile" && !controller.canWriteProfile() && _jsx("p", { className: "dsmm-hint", children: t("unavailableForm") }), _jsxs("div", { className: "dsmm-actions", children: [!refreshOnly && _jsx(Button, { type: "button", variant: "primary", disabled: !controller.canSave(), onClick: () => void (workspace?.save() ?? controller.save()), children: t(controller.layer === "global" ? "saveGlobal" : "saveProfile") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void controller.refresh(), children: t("refresh") }), !refreshOnly && _jsx(Button, { type: "button", variant: "outline", disabled: state.busy || !state.dirty && state.issue === null && !state.refreshRequired, onClick: () => void controller.refresh(true), children: t("discard") })] })] });
|
|
15
15
|
}
|
|
16
16
|
export function NativeRuntimeState({ value, t }) {
|
|
17
17
|
return _jsxs("details", { className: "dsmm-availability", children: [_jsx("summary", { children: t("nativeRuntimeState") }), _jsxs("p", { children: [t("nativeRuntimeBinding"), ": ", t(value?.binding === "stock" ? "nativeRuntimeStock" : value?.binding === "unavailable" ? "nativeRuntimeUnavailable" : "unknown")] }), _jsxs("p", { children: [t("nativeRuntimeFence"), ": ", value === undefined ? t("unknown") : t(value.deliveryFenceReady ? "on" : "off"), " \u00B7 ", t("nativeRuntimeRestart"), ": ", value === undefined ? t("unknown") : t(value.restartRequired ? "on" : "off")] }), value?.reason !== undefined && _jsx("p", { children: t(`nativeRuntimeReason-${value.reason}`) })] });
|
|
@@ -41,6 +41,11 @@ export function DeploymentPage(props) {
|
|
|
41
41
|
void props.core.refresh(); }, [props.core, props.view]);
|
|
42
42
|
useEffect(() => { if (props.forms !== undefined)
|
|
43
43
|
workspace.bindForms(props.forms); }, [workspace, props.forms]);
|
|
44
|
+
// First visit opens the first section with editable fields (or Configuration state).
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (navigation.module === null && core.snapshot !== null)
|
|
47
|
+
workspace.request({ scope: navigation.scope, module: null });
|
|
48
|
+
}, [core.snapshot, navigation.module, navigation.scope, workspace]);
|
|
44
49
|
useEffect(() => {
|
|
45
50
|
if (active !== null)
|
|
46
51
|
heading.current?.focus();
|
|
@@ -69,25 +74,32 @@ export function DeploymentPage(props) {
|
|
|
69
74
|
if (props.view === "summary")
|
|
70
75
|
return _jsx("span", { children: t("summary") });
|
|
71
76
|
const fields = snapshot === null || active === null ? [] : moduleFields(scopeSchema(snapshot, controller.layer), active, controller.layer);
|
|
72
|
-
const
|
|
77
|
+
const tabs = NAVIGATION_MODULES.filter(module => module !== "other" || snapshot === null
|
|
78
|
+
|| moduleFields(snapshot.schema, "other", "global").length + moduleFields(scopeSchema(snapshot, "profile"), "other", "profile").length > 0);
|
|
79
|
+
const select = (module) => workspace.request({ scope: navigation.scope, module });
|
|
80
|
+
const onTabKey = (event, index) => {
|
|
81
|
+
const last = tabs.length - 1, move = (target) => { const next = tabs[(target + tabs.length) % tabs.length]; triggers.current.get(next)?.focus(); };
|
|
82
|
+
if (event.key === "ArrowRight")
|
|
83
|
+
move(index + 1);
|
|
84
|
+
else if (event.key === "ArrowLeft")
|
|
85
|
+
move(index - 1);
|
|
86
|
+
else if (event.key === "Home")
|
|
87
|
+
move(0);
|
|
88
|
+
else if (event.key === "End")
|
|
89
|
+
move(last);
|
|
90
|
+
else
|
|
91
|
+
return;
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
};
|
|
73
94
|
const scopeActions = _jsx(ScopeSave, { controller: active === "state" ? props.core : controller, workspace: workspace, refreshOnly: active === "state" || workspace.controller() === null, t: t });
|
|
74
95
|
return _jsxs("section", { className: "dsmm-profiles dsmm-deployment", "data-dsmm-page": true, "aria-label": t("title"), children: [_jsx("p", { className: "dsmm-hint", children: t("boundaries") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-scope`, children: t("scope") }), _jsxs("select", { ref: scopeControl, id: `${id}-scope`, value: navigation.scope, disabled: state.busy || navigation.pending !== null, onChange: event => {
|
|
75
96
|
const scope = event.currentTarget.value;
|
|
76
97
|
if (scope === "global" || scope === "profile")
|
|
77
|
-
workspace.request({ scope, module:
|
|
78
|
-
}, children: [_jsx("option", { value: "global", children: t("global") }), _jsx("option", { value: "profile", children: t("profile") })] })] }), _jsx("p", { className: "dsmm-hint", children: t(navigation.scope === "global" ? "globalHint" : "profileHint") }), navigation.scope === "profile" && (navigation.native === null || !navigation.native.canWriteProfile()) && _jsx("p", { className: "dsmm-hint", children: t("unavailableForm") }),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const target = event.target;
|
|
83
|
-
if (target.tagName === "SELECT" && (!globalThis.CSS?.supports("selector(select:open)") || target.matches("select:open")))
|
|
84
|
-
return;
|
|
85
|
-
event.preventDefault();
|
|
86
|
-
if (navigation.pending !== null)
|
|
87
|
-
workspace.continueEditing();
|
|
88
|
-
else
|
|
89
|
-
workspace.request({ scope: navigation.scope, module: null });
|
|
90
|
-
}, children: [_jsxs("div", { className: "dsmm-drawer-heading", children: [_jsx("h2", { id: `${id}-heading`, ref: heading, tabIndex: -1, children: t(moduleTitle(active)) }), _jsx(Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => workspace.request({ scope: navigation.scope, module: null }), children: t("close") })] }), active === "state" ? _jsxs(_Fragment, { children: [_jsx(StateInspector, { controller: props.core, t: t }), scopeActions] }) : _jsxs(_Fragment, { children: [navigation.scope === "profile" && navigation.native === null ? _jsx("p", { children: t("unavailableForm") }) : state.snapshot === null ? _jsx("p", { children: t(state.busy ? "loading" : "unavailable") }) : _jsxs("div", { "data-dsmm-layer": controller.layer, "aria-busy": state.busy, className: "dsmm-structured", children: [fields.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("noModuleFields") }), fields.map(([key, schema]) => _jsx(Field, { schema: schema, path: [key], controller: controller, initiallyOpen: fields.length === 1 && active !== "permissions", disclosures: disclosures.current[navigation.scope], t: t }, `${navigation.scope}:${key}`)), active === "run" && controller.layer === "profile" && _jsx(NativeRuntimeState, { value: state.snapshot.subagentRuntime, t: t })] }), scopeActions, active === "permissions" && _jsxs("section", { className: "dsmm-zone", children: [_jsx("h3", { children: t("rootRules") }), _jsx("p", { className: "dsmm-hint", children: t("rootRulesHint") }), workspace.permissions === undefined ? _jsx("p", { children: t("rootRulesUnavailable") }) : _jsx(PermissionsPanel, { controller: workspace.permissions, t: props.permissionsT ?? (key => Object.hasOwn(permissionEn, key) ? permissionText(t)(key) : key) })] })] })] })] }), navigation.pending !== null && _jsxs("section", { className: "dsmm-confirm", role: "group", "aria-label": t("leaveDraft"), onKeyDown: event => { if (event.key === "Escape" && !event.defaultPrevented) {
|
|
98
|
+
workspace.request({ scope, module: null });
|
|
99
|
+
}, children: [_jsx("option", { value: "global", children: t("global") }), _jsx("option", { value: "profile", children: t("profile") })] })] }), _jsx("p", { className: "dsmm-hint", children: t(navigation.scope === "global" ? "globalHint" : "profileHint") }), navigation.scope === "profile" && (navigation.native === null || !navigation.native.canWriteProfile()) && _jsx("p", { className: "dsmm-hint", children: t("unavailableForm") }), _jsx("div", { className: "dsmm-section-tabs", role: "tablist", "aria-label": t("modules"), children: tabs.map((module, index) => _jsx(Button, { ref: element => { if (element !== null)
|
|
100
|
+
triggers.current.set(module, element);
|
|
101
|
+
else
|
|
102
|
+
triggers.current.delete(module); }, role: "tab", type: "button", id: `${id}-tab-${module}`, "aria-selected": active === module, "aria-controls": `${id}-panel`, tabIndex: active === module ? 0 : -1, "data-dsmm-tab": module, onKeyDown: event => onTabKey(event, index), onClick: () => select(module), children: t(moduleTitle(module)) }, module)) }), active !== null && _jsxs("section", { id: `${id}-panel`, role: "tabpanel", className: "dsmm-section-panel", "aria-labelledby": `${id}-tab-${active}`, "data-dsmm-module": active, children: [_jsx("div", { className: "dsmm-panel-heading", children: _jsx("h2", { id: `${id}-heading`, ref: heading, tabIndex: -1, children: t(moduleTitle(active)) }) }), active === "state" ? _jsxs(_Fragment, { children: [_jsx(StateInspector, { controller: props.core, t: t }), scopeActions] }) : _jsxs(_Fragment, { children: [navigation.scope === "profile" && navigation.native === null ? _jsx("p", { children: t("unavailableForm") }) : state.snapshot === null ? _jsx("p", { children: t(state.busy ? "loading" : "unavailable") }) : _jsxs("div", { "data-dsmm-layer": controller.layer, "aria-busy": state.busy, className: "dsmm-structured", children: [fields.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("noModuleFields") }), fields.map(([key, schema]) => _jsx(Field, { schema: schema, path: [key], controller: controller, initiallyOpen: fields.length === 1 && active !== "permissions", disclosures: disclosures.current[navigation.scope], t: t }, `${navigation.scope}:${key}`)), active === "run" && controller.layer === "profile" && _jsx(NativeRuntimeState, { value: state.snapshot.subagentRuntime, t: t })] }), scopeActions, active === "permissions" && _jsxs("section", { className: "dsmm-zone dsmm-rules-transaction", "aria-label": t("rootRules"), children: [_jsx("h3", { children: t("rootRules") }), _jsx("p", { className: "dsmm-hint", children: t("rootRulesHint") }), workspace.permissions === undefined ? _jsx("p", { children: t("rootRulesUnavailable") }) : _jsx(PermissionsPanel, { controller: workspace.permissions, t: props.permissionsT ?? (key => Object.hasOwn(permissionEn, key) ? permissionText(t)(key) : key) })] })] })] }), navigation.pending !== null && _jsxs("section", { className: "dsmm-confirm", role: "group", "aria-label": t("leaveDraft"), onKeyDown: event => { if (event.key === "Escape" && !event.defaultPrevented) {
|
|
91
103
|
event.preventDefault();
|
|
92
104
|
workspace.continueEditing();
|
|
93
105
|
} }, children: [_jsx("p", { children: t("leaveDraft") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { ref: confirmation, type: "button", variant: "primary", onClick: () => workspace.continueEditing(), children: t("continueEditing") }), _jsx(Button, { type: "button", variant: "outline", onClick: () => workspace.keepAndNavigate(), children: t("keepDraft") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void workspace.discardAndNavigate(), children: t("discardDraft") })] })] })] });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId, useSyncExternalStore } from "react";
|
|
3
3
|
import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
4
|
-
import { parseNativeCommands } from "../permission-settings.js";
|
|
5
|
-
|
|
4
|
+
import { parseNativeCommandPattern, parseNativeCommands } from "../permission-settings.js";
|
|
5
|
+
const ENTRIES_PATH = "permissionControl.nativeCommands.entries";
|
|
6
6
|
export function validNativeEntries(entries) {
|
|
7
7
|
try {
|
|
8
8
|
parseNativeCommands({ entries });
|
|
@@ -13,56 +13,66 @@ export function validNativeEntries(entries) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
export function emptyNativeEntry() {
|
|
16
|
-
return { id: "", mode: "ask", sandboxMode: "workspace-write", match: { tool: "bash",
|
|
16
|
+
return { id: "", mode: "ask", sandboxMode: "workspace-write", match: { tool: "bash", workingDirectory: "", commandPattern: "" } };
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
function patternValid(value) {
|
|
19
|
+
try {
|
|
20
|
+
parseNativeCommandPattern(value);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function TextField({ id, label, value, disabled, onChange }) {
|
|
28
|
+
return _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: id, children: label }), _jsx(Input, { className: "dsmm-input", id: id, value: value, maxLength: 32768, disabled: disabled, required: true, onChange: event => onChange(event.currentTarget.value) })] });
|
|
29
|
+
}
|
|
30
|
+
function Pattern({ value, controller, name, disabled, onChange, t }) {
|
|
31
|
+
const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot), id = useId(), raw = state.raw[name], text = raw?.text ?? value, bad = raw?.invalid === true;
|
|
32
|
+
return _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-pattern`, children: t("pattern") }), _jsx(Input, { className: "dsmm-input", id: `${id}-pattern`, value: text, maxLength: 32768, disabled: disabled, required: true, "aria-invalid": bad, "aria-describedby": bad ? `${id}-error` : undefined, spellCheck: false, autoComplete: "off", onChange: event => {
|
|
33
|
+
const next = event.currentTarget.value, valid = patternValid(next);
|
|
34
|
+
controller.setRaw(name, next, !valid);
|
|
29
35
|
if (valid)
|
|
30
|
-
onChange(
|
|
31
|
-
} }), _jsx("p", { id: `${id}-error`, className: "dsmm-hint", children:
|
|
36
|
+
onChange(next);
|
|
37
|
+
} }), bad && _jsx("p", { id: `${id}-error`, className: "dsmm-hint", children: t("invalidPattern") })] });
|
|
32
38
|
}
|
|
33
|
-
function Entry({ entry, index, controller, disabled,
|
|
34
|
-
const id = useId()
|
|
39
|
+
function Entry({ entry, index, controller, disabled, change, remove, t }) {
|
|
40
|
+
const id = useId(), match = entry.match, row = `${ENTRIES_PATH}.${index}`;
|
|
35
41
|
const valid = validNativeEntries([entry]);
|
|
36
|
-
|
|
37
|
-
const value = event.currentTarget.value;
|
|
38
|
-
if (key === "id")
|
|
39
|
-
change({ ...entry, id: value });
|
|
40
|
-
else if (key === "subcommand" && value === "") {
|
|
41
|
-
const { subcommand: _omitted, ...match } = entry.match;
|
|
42
|
-
change({ ...entry, match });
|
|
43
|
-
}
|
|
44
|
-
else
|
|
45
|
-
change({ ...entry, match: { ...entry.match, [key]: value } });
|
|
46
|
-
} })] });
|
|
47
|
-
return _jsxs("fieldset", { "aria-describedby": !valid ? `${id}-error` : undefined, children: [_jsxs("legend", { children: [t("nativeCommands"), " ", index + 1] }), !valid && _jsx("p", { className: "dsmm-hint", id: `${id}-error`, children: t("invalidEntry") }), text("id", "entryId"), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-tool`, children: t("tool") }), _jsx("select", { id: `${id}-tool`, disabled: disabled, value: entry.match.tool, onChange: event => {
|
|
42
|
+
return _jsxs("fieldset", { "aria-describedby": !valid ? `${id}-error` : undefined, children: [_jsxs("legend", { children: [t("nativeCommands"), " ", index + 1] }), !valid && _jsx("p", { className: "dsmm-hint", id: `${id}-error`, children: t("invalidEntry") }), _jsx(TextField, { id: `${id}-id`, label: t("entryId"), value: entry.id, disabled: disabled, onChange: value => change({ ...entry, id: value }) }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-tool`, children: t("tool") }), _jsx("select", { id: `${id}-tool`, disabled: disabled, value: match.tool, onChange: event => {
|
|
48
43
|
const tool = event.currentTarget.value;
|
|
49
44
|
if (tool === "bash" || tool === "pwsh")
|
|
50
|
-
change({ ...entry, match: { ...
|
|
51
|
-
}, children: ["bash", "pwsh"].map(value => _jsx("option", { value: value, children: value }, value)) })] }),
|
|
45
|
+
change({ ...entry, match: { ...match, tool } });
|
|
46
|
+
}, children: ["bash", "pwsh"].map(value => _jsx("option", { value: value, children: value }, value)) })] }), _jsx(Pattern, { value: match.commandPattern, controller: controller, name: `${row}.commandPattern`, disabled: disabled, t: t, onChange: commandPattern => change({ ...entry, match: { ...match, commandPattern } }) }), _jsx(TextField, { id: `${id}-workingDirectory`, label: t("cwd"), value: match.workingDirectory, disabled: disabled, onChange: workingDirectory => change({ ...entry, match: { ...match, workingDirectory } }) }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-sandbox`, children: t("sandboxMode") }), _jsxs("select", { id: `${id}-sandbox`, disabled: disabled, value: entry.sandboxMode, onChange: event => {
|
|
52
47
|
if (event.currentTarget.value === "workspace-write")
|
|
53
48
|
change({ ...entry, sandboxMode: "workspace-write" });
|
|
54
|
-
}, children: [_jsx("option", { value: "workspace-write", children: "workspace-write" }), entry.sandboxMode === "danger-full-access" &&
|
|
49
|
+
}, children: [_jsx("option", { value: "workspace-write", children: "workspace-write" }), entry.sandboxMode === "danger-full-access" && _jsx("option", { value: "danger-full-access", disabled: true, children: t("restrictedFullAccess") })] })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-mode`, children: t("mode") }), _jsxs("select", { id: `${id}-mode`, disabled: disabled, value: entry.mode, onChange: event => {
|
|
55
50
|
const mode = event.currentTarget.value;
|
|
56
51
|
if (mode === "ask" || mode === "allow")
|
|
57
52
|
change({ ...entry, mode });
|
|
58
|
-
}, children: [_jsx("option", { value: "ask", children: t("action:ask") }), _jsx("option", { value: "allow", children: t("action:allow") })] })] }), _jsxs(Button, { type: "button", variant: "outline", disabled: disabled
|
|
53
|
+
}, children: [_jsx("option", { value: "ask", children: t("action:ask") }), _jsx("option", { value: "allow", children: t("action:allow") })] })] }), _jsxs(Button, { type: "button", variant: "outline", disabled: disabled, onClick: remove, children: [t("removeEntry"), " ", index + 1] })] });
|
|
59
54
|
}
|
|
60
55
|
export function NativeCommandEntries({ value, inherited, controller, disabled, onChange, setInvalid, t }) {
|
|
61
|
-
const entries = value ?? inherited, name =
|
|
56
|
+
const entries = value ?? inherited, name = ENTRIES_PATH;
|
|
62
57
|
const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot);
|
|
63
|
-
const
|
|
58
|
+
const invalidRows = state.invalidFields.filter(path => path.startsWith(`${name}.`) && path.endsWith(".commandPattern"));
|
|
64
59
|
const valid = validNativeEntries(entries);
|
|
65
60
|
const change = (next) => { setInvalid(name, !validNativeEntries(next ?? inherited)); onChange(next); };
|
|
66
|
-
|
|
61
|
+
const remove = (index) => {
|
|
62
|
+
const drafts = Object.entries(state.raw).flatMap(([path, draft]) => {
|
|
63
|
+
if (!path.startsWith(`${name}.`))
|
|
64
|
+
return [];
|
|
65
|
+
const [row, ...field] = path.slice(name.length + 1).split(".");
|
|
66
|
+
const position = Number(row);
|
|
67
|
+
if (!Number.isInteger(position) || field.length === 0 || position === index)
|
|
68
|
+
return [];
|
|
69
|
+
return [{ path: `${name}.${position > index ? position - 1 : position}.${field.join(".")}`, draft }];
|
|
70
|
+
});
|
|
71
|
+
controller.clearRaw(name);
|
|
72
|
+
for (const draft of drafts)
|
|
73
|
+
controller.setRaw(draft.path, draft.draft.text, draft.draft.invalid);
|
|
74
|
+
change(entries.filter((_, position) => position !== index));
|
|
75
|
+
};
|
|
76
|
+
return _jsxs("details", { className: "dsmm-deployment-group", children: [_jsxs("summary", { children: [t("nativeCommands"), " ", _jsx("code", { children: name })] }), _jsxs("div", { className: "dsmm-structured", children: [_jsx("p", { className: "dsmm-hint", children: t("nativeCommandsHint") }), _jsx("p", { className: "dsmm-hint", children: t("patternHint") }), _jsx("p", { className: "dsmm-hint", children: t("patternScope") }), _jsx("p", { className: "dsmm-hint", children: t("registrationUnresolved") }), _jsx("p", { className: "dsmm-hint", children: t(value === undefined ? "inheritedEntries" : "explicitEntries") }), !valid && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("invalidEntry") }), invalidRows.length > 0 && _jsx("p", { className: "dsmm-hint", children: t("invalidPatternHint") }), entries.length === 0 && _jsx("p", { children: t("noEntries") }), entries.map((entry, index) => _jsx(Entry, { entry: entry, index: index, controller: controller, disabled: disabled, t: t, change: next => change(entries.map((row, position) => position === index ? next : row)), remove: () => remove(index) }, index)), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: disabled || entries.length >= 1024, onClick: () => change([...entries, emptyNativeEntry()]), children: t("addEntry") }), _jsx(Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: disabled || value === undefined && invalidRows.length === 0, onClick: () => { controller.clearRaw(name); change(undefined); }, children: t("unset") })] })] })] });
|
|
67
77
|
}
|
|
68
78
|
//# sourceMappingURL=NativeCommandEntries.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PermissionRule } from "../permission-rules.js";
|
|
2
|
+
import type { DeploymentController } from "./deployment-controller.js";
|
|
3
|
+
import type { PermissionLocaleKey } from "./permission-locales.js";
|
|
4
|
+
type Text = (key: PermissionLocaleKey) => string;
|
|
5
|
+
export declare function validPermissionRules(value: unknown): boolean;
|
|
6
|
+
export declare function PermissionRuleEntries({ value, inherited, controller, disabled, onChange, expanded, onExpandedChange, t }: {
|
|
7
|
+
value: readonly PermissionRule[] | undefined;
|
|
8
|
+
inherited: readonly PermissionRule[];
|
|
9
|
+
controller: DeploymentController;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
onChange(value: readonly PermissionRule[] | undefined): void;
|
|
12
|
+
expanded?: boolean;
|
|
13
|
+
onExpandedChange?(expanded: boolean): void;
|
|
14
|
+
t: Text;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=PermissionRuleEntries.d.ts.map
|