@dsmm/dsmm 0.3.1 → 0.3.2

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.
Files changed (119) hide show
  1. package/cordis.patch.yml +9 -0
  2. package/docs/compatibility.md +10 -0
  3. package/docs/releasing.md +25 -65
  4. package/docs/roadmap.md +44 -2
  5. package/lib/client/ChildPermissions.d.ts +43 -0
  6. package/lib/client/ChildPermissions.js +100 -0
  7. package/lib/client/ChildrenPanel.d.ts +4 -1
  8. package/lib/client/ChildrenPanel.js +3 -3
  9. package/lib/client/DeploymentFields.d.ts +6 -2
  10. package/lib/client/DeploymentFields.js +8 -6
  11. package/lib/client/DeploymentPage.d.ts +4 -1
  12. package/lib/client/DeploymentPage.js +5 -4
  13. package/lib/client/HistoryContinuation.d.ts +7 -0
  14. package/lib/client/HistoryContinuation.js +22 -0
  15. package/lib/client/PermissionPanelEntry.d.ts +8 -0
  16. package/lib/client/PermissionPanelEntry.js +11 -0
  17. package/lib/client/PermissionsPanel.d.ts +3 -1
  18. package/lib/client/PermissionsPanel.js +3 -2
  19. package/lib/client/ProfilesSection.js +3 -3
  20. package/lib/client/RoleAvailability.js +1 -1
  21. package/lib/client/SessionProfiles.js +21 -18
  22. package/lib/client/TemporaryPermissions.d.ts +21 -0
  23. package/lib/client/TemporaryPermissions.js +94 -0
  24. package/lib/client/children-locales.d.ts +4 -4
  25. package/lib/client/controller.d.ts +17 -0
  26. package/lib/client/controller.js +101 -18
  27. package/lib/client/deployment-locales.js +26 -26
  28. package/lib/client/history-controller.d.ts +29 -0
  29. package/lib/client/history-controller.js +111 -0
  30. package/lib/client/history-entry.d.ts +11 -0
  31. package/lib/client/history-entry.js +106 -0
  32. package/lib/client/history-locales.d.ts +95 -0
  33. package/lib/client/history-locales.js +41 -0
  34. package/lib/client/index.js +16 -3
  35. package/lib/client/locales.d.ts +6 -0
  36. package/lib/client/locales.js +104 -92
  37. package/lib/client/permission-locales.d.ts +26 -0
  38. package/lib/client/permission-locales.js +55 -35
  39. package/lib/client/temporary-permission-client.d.ts +20 -0
  40. package/lib/client/temporary-permission-client.js +52 -0
  41. package/lib/client/temporary-permission-entry.d.ts +6 -0
  42. package/lib/client/temporary-permission-entry.js +56 -0
  43. package/lib/client.js +3881 -1981
  44. package/lib/history-candidates.d.ts +30 -0
  45. package/lib/history-candidates.js +176 -0
  46. package/lib/history-codec.d.ts +11 -0
  47. package/lib/history-codec.js +102 -0
  48. package/lib/history-contract.d.ts +44 -0
  49. package/lib/history-contract.js +2 -0
  50. package/lib/history-controller.d.ts +42 -0
  51. package/lib/history-controller.js +329 -0
  52. package/lib/history-policy.d.ts +4 -0
  53. package/lib/history-policy.js +8 -0
  54. package/lib/history-remote.d.ts +28 -0
  55. package/lib/history-remote.js +17 -0
  56. package/lib/history-rpc.d.ts +24 -0
  57. package/lib/history-rpc.js +136 -0
  58. package/lib/history-support.d.ts +15 -0
  59. package/lib/history-support.js +21 -0
  60. package/lib/history-types.d.ts +67 -0
  61. package/lib/history-types.js +2 -0
  62. package/lib/index.d.ts +2 -0
  63. package/lib/index.js +24 -6
  64. package/lib/native-admission.d.ts +21 -0
  65. package/lib/native-admission.js +206 -16
  66. package/lib/permission-child-control.d.ts +36 -0
  67. package/lib/permission-child-control.js +164 -0
  68. package/lib/permission-control.d.ts +2 -0
  69. package/lib/permission-control.js +7 -0
  70. package/lib/permission-controller.js +2 -2
  71. package/lib/permission-exec-argv.d.ts +32 -0
  72. package/lib/permission-exec-argv.js +171 -0
  73. package/lib/permission-fs-search.js +2 -1
  74. package/lib/permission-fs.js +2 -1
  75. package/lib/permission-native-rules.js +3 -3
  76. package/lib/permission-temporary-files.d.ts +19 -0
  77. package/lib/permission-temporary-files.js +248 -0
  78. package/lib/permission-temporary-grants.d.ts +106 -0
  79. package/lib/permission-temporary-grants.js +198 -0
  80. package/lib/permission-temporary-install.d.ts +25 -0
  81. package/lib/permission-temporary-install.js +86 -0
  82. package/lib/permission-temporary-remote.d.ts +19 -0
  83. package/lib/permission-temporary-remote.js +75 -0
  84. package/lib/permission-temporary-rpc.d.ts +37 -0
  85. package/lib/permission-temporary-rpc.js +154 -0
  86. package/lib/permission-temporary-types.d.ts +47 -0
  87. package/lib/permission-temporary-types.js +2 -0
  88. package/lib/permission-temporary-web.d.ts +11 -0
  89. package/lib/permission-temporary-web.js +154 -0
  90. package/lib/permission-web.js +2 -1
  91. package/lib/preset-skills.d.ts +1 -1
  92. package/lib/preset-skills.js +2 -2
  93. package/lib/profile-rpc.js +2 -0
  94. package/lib/profile-runtime.d.ts +12 -1
  95. package/lib/profile-runtime.js +122 -10
  96. package/lib/profile-store.d.ts +2 -2
  97. package/lib/profile-store.js +8 -1
  98. package/lib/profile-types.d.ts +1 -0
  99. package/lib/role-invocation.d.ts +1 -1
  100. package/lib/role-invocation.js +2 -2
  101. package/lib/role-subagents.js +16 -3
  102. package/lib/skills.d.ts +1 -0
  103. package/lib/skills.js +5 -1
  104. package/package.json +41 -33
  105. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-gateway@0.2.1-rc.2.patch +13291 -0
  106. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-remotes@0.2.1-rc.2.patch +9133 -0
  107. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-client-ui-approval@0.2.1-rc.2.patch +156 -0
  108. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-subagent@0.2.1-rc.2.patch +3546 -0
  109. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-user-approval@0.2.1-rc.2.patch +431 -0
  110. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-web@0.2.1-rc.2.patch +119 -0
  111. package/patches/dsh-approval-settlement/README.md +41 -0
  112. package/patches/dsh-approval-settlement/metadata.json +10 -0
  113. package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-loop@0.2.1-rc.2.patch +383 -0
  114. package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-preset-registry@0.2.1-rc.2.patch +55 -0
  115. package/patches/dsh-session-activation/@deepseek-ai__dsh-api-session-controller@0.2.1-rc.2.patch +16673 -0
  116. package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-subagent@0.2.1-rc.2.patch +29 -0
  117. package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-workspace@0.2.1-rc.2.patch +196 -0
  118. package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence-jsonl@0.2.1-rc.2.patch +35 -0
  119. package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence@0.2.1-rc.2.patch +40 -0
package/cordis.patch.yml CHANGED
@@ -1,4 +1,13 @@
1
+ # The targeted native entries must be patched rc.2 implementations. Apply before Host startup.
2
+ - id: agent-loop
3
+ config:
4
+ activationAdmissionRequired: true
5
+ - id: api-session-controller
6
+ config:
7
+ activateOnFollow: false
1
8
  - insert:
9
+ - id: dsmm-history-bootstrap
10
+ name: '@dsmm/dsmm/history-support'
2
11
  - id: dsmm
3
12
  name: '@dsmm/dsmm'
4
13
  inject: [profileContext, agents]
@@ -22,6 +22,16 @@ Stores use separate CAS and atomic-write boundaries. Committed saves aren't roll
22
22
 
23
23
  ## Execution and recovery
24
24
 
25
+ ### Native history composition
26
+
27
+ History protection requires the matching Session/Agent-loop, Gateway, aggregate `api-remotes` browser descriptor and workspace/subagent UI patches, not only the DSMM plugin. The bundle mounts `@dsmm/dsmm/history-support` independently of Core. It supplies `__DSMM_HISTORY_REQUIRED__` through native `webserver/index-inject` before Client initialization; Core failure does not remove that bootstrap. Non-browser integrations must supply `historyRequired: true` when initializing both patched Gateway and Session Clients.
28
+
29
+ Required Clients obtain generation-bound readiness and an opaque full-address lease before retention. The actual receiving Host validates protected RPC/stream requests before native lookup; unsupported Hosts and missing or retired readiness owners fail closed without falling back to ordinary follow. Main navigation waits for a ready replacement before releasing the old reference, and child sidebar resources prepare before retaining. These preparations authorize only browsing, not migration, continuation or execution.
30
+
31
+ Empty-browser component coverage uses the native Renderer, workspace navigation, child resource and failure Toast with test-owned layout, controls and a logical carrier. Separate loopback HTTP/WebSocket coverage exercises socket-wait guard retirement, native Session transport retry under a separately owned stable Connection generation, and actual receiving-Host replacement with native authentication and reconnect. Full application/Desktop carrier verification remains outstanding; see the [roadmap](roadmap.md).
32
+
33
+ ### Execution ownership
34
+
25
35
  Role calls wait for native activation results by default; only `completed` is normal completion. Cancellation after publication uses activation disposal and cleanup. Enabled background execution selects `delivery: 'parent'` before start. The accepted child/message receipt and interrupt acknowledgment aren't completion. Running waiting tasks can't transfer to background.
26
36
 
27
37
  Queue/Steer/interrupt apply only to supported live direct children under exact-parent/operator authority. Descendant views are read-only. Missing native capability disables that operation with a reason; unknown sends aren't automatically resent. Requested role/model data isn't actual execution identity. See [Agent presets](agent-presets.md).
package/docs/releasing.md CHANGED
@@ -1,74 +1,34 @@
1
- # DSMM source readiness and release
1
+ # DSMM release
2
2
 
3
- DSMM uses `.github/workflows/dsmm-release.yml` and the controls under `dsmm/scripts/`. The root ocmm completion checker is not its completion authority. This document defines the current working-source contract; it does not authorize a commit, push, tag, workflow dispatch, publication or installation.
3
+ Push a `dsmm-scoped-vX.Y.Z` tag to trigger `.github/workflows/dsmm-release.yml`.
4
+ The workflow sets the DSMM package version from the tag, builds DSMM, packs it once,
5
+ publishes that archive to npm, and attaches it to the matching GitHub Release.
4
6
 
5
- ## Source and package boundary
7
+ ## Build and publication
6
8
 
7
- `@dsmm/dsmm@0.3.1` targets exactly DSH `0.2.1-rc.2`, tag `dsmm-scoped-v0.3.1` and archive `dsmm-dsmm-0.3.1.tgz`. Its runtime composition uses the official `@deepseek-ai/dsh-agent`, `@deepseek-ai/dsh-subagent` and `@deepseek-ai/dsh-session-persistence-jsonl` packages at that exact version. The published `0.3.0` tag, archive and release policy retain their original rc.1 identity and custom-owner acceptance grammar; they are historical evidence, not a policy fallback for 0.3.1. Public runtime requires Node.js 22 or later.
9
+ The workflow uses Node.js 24 and pnpm 11.9.0. It installs the locked dependencies,
10
+ materializes the declared frontend resources, builds DSMM and generates its role
11
+ assets. It does not build root OCMM, its native LSP binary or the Codex adapter.
8
12
 
9
- The 0.3.1 release contract does not freeze a guessed compiled-file inventory. It requires the main, client, preset-skill, package metadata and locale resources, validates every declared public module/resource target against the packed archive, and follows relative module imports to delivered targets. Additional public entries are admitted only through this resolvable manifest contract. Retired custom-owner entries (`./agent-registry`, `./subagent-runtime`, `./session-persistence` and `./legacy-read-host`) are not valid 0.3.1 public entries. Historical release metadata and compiled inventories remain version-bound.
13
+ The tag path does not invoke custom release contracts, version allowlists,
14
+ Docker acceptance, bootstrap imports, recovery selectors or receipt controllers.
15
+ The target runtime remains exactly DSH `0.2.1-rc.2`; publishing DSMM does not upgrade DSH.
10
16
 
11
- ## Build-only release preparation
17
+ npm publication uses GitHub Actions Trusted Publishing and provenance. Lifecycle
18
+ scripts are disabled for publication. GitHub Release receives the same packed
19
+ archive retained by the workflow. Published package versions and Release assets
20
+ are not overwritten.
12
21
 
13
- The exact 0.3.1 release lane builds and packs without running test suites, test typechecks, source-content comparisons, Docker/browser acceptance or fresh-install tests. Compilation and resource generation remain required. This exception is not a future-version range: unreviewed versions remain rejected. Use the existing approved toolchain and platform-matching dependencies; do not change root ocmm/LSP versions or the unrelated Codex adapter for a DSMM release.
22
+ ## Completion
14
23
 
15
- A cold checkout may lack ignored frontend resources. Explicitly authorized preparation uses:
24
+ Inspect the workflow run for the exact tag. npm publication and GitHub Release
25
+ delivery are separate steps: success at npm does not prove GitHub delivery.
26
+ Report a failed or partial publication as such; do not move its tag or overwrite
27
+ published artifacts to repair it in place.
16
28
 
17
- ```powershell
18
- node dsmm/scripts/materialize-frontend.mjs --sync
19
- pnpm run build
20
- pnpm --dir dsmm build
21
- pnpm --dir dsmm generate:roles
22
- ```
29
+ ## Installation
23
30
 
24
- Only explicit `--sync` fetches declared immutable upstream resources and verifies their provenance. Existing local resource bodies are not locked by file-content hashes. Normal build/check commands remain offline. [Source synchronization](skill-sync.md) describes presence, closure, attribution and path-safety requirements. Build output is not runtime verification.
25
-
26
- Release preparation resolves the trusted tag, peeled product source, workflow/control commit, event and fixed run/attempt. Pack once from the selected source checkout with pinned pnpm between the source guards. Freeze that exact tarball; never substitute a development package, repack accepted bytes or adopt another run's receipt.
27
-
28
- For exact 0.3.1, `freeze` does not require a native `--receipt`. It produces an `artifact-integrity-only` receipt from the actual package bytes, recording `sourceChecks`, native acceptance and fresh installation as `NOT_RUN_RELEASE_POLICY`. The existing receipt asset filename is a transport identity, not a claim that Docker tests ran. Package digests, tag/run identity, official runtime dependency pins, genuine provenance and non-overwrite protection remain mandatory. Exact 0.3.0 retains its own historical build-only identity; earlier versions retain their native acceptance requirements.
29
-
30
- ## Current npm publication completion
31
-
32
- The working-source topology `split-publication-v1` has six jobs: `import-bootstrap`, `prepare`, `publish`, `prepare-recovery-022`, `publish-recovery-022` and `github-release`. The selected prepare/publish pair must succeed and the other pair must be skipped. Bootstrap import succeeds only for bootstrap and is otherwise skipped. Missing or duplicate jobs, wrong identity, cancelled workflow or an unsuccessful selected publisher cannot complete.
33
-
34
- The guarded publisher uses the unchanged accepted tarball, ignored lifecycle scripts, GitHub Actions OIDC and genuine provenance. Static-token fallback, forged CI identity, implicit publish retry and package overwrite are forbidden.
35
-
36
- After an authorized matching run terminates, use its trusted control checkout and a new receipt path:
37
-
38
- ```powershell
39
- node dsmm/scripts/check-dsmm-release-completion.mjs terminal-publication --run-id <run> --run-attempt <attempt> --control-sha <trusted-control-head> --receipt <new-publication-receipt.json>
40
- ```
41
-
42
- Only exit 0 with `mode: npm-publication` and `outcome: COMPLETED` proves npm publication complete. The checker binds repository, workflow ID/path, trusted ancestry, event/ref, package/tag/peeled source, accepted bytes and checksums to the successful selected publisher. Ordinary source equals control; fixed recovery keeps separate product and control identities.
43
-
44
- This topology has no post-publication `verify` job, registry-proof artifact, registry readback or fresh registry reinstall. It records workflow and `github-release` conclusions separately. Successful npm publication does not imply a complete public GitHub Release or passing functional tests.
45
-
46
- ## Independent GitHub Release delivery
47
-
48
- `github-release` depends on both prepare/publish pairs with cancellation and selected-success/other-skipped guards. Empty or dual accepted-artifact outputs refuse before download. Transport creates only an absent draft and uploads the original tarball, integrity/acceptance receipt and `SHA256SUMS.txt`.
49
-
50
- `transport --output <new-file>` records the draft and asset IDs created by that invocation. `finalize --transport <file>` binds those IDs to accepted source/control/run/attempt and package digests, validates all three assets/checksums and the remote tag, then makes only that draft public. It cannot adopt another Release, overwrite assets or repair partial delivery. The fixed historical bootstrap draft is the sole policy exception.
51
-
52
- Exit 1 (`FAILED`) or 2 (`UNRESOLVED`) requires reporting the partial or unknown state. Preserve tags, packages, assets and receipts. Do not move/delete/recreate a tag, repack, overwrite, adopt another run's proof or repair in place. A new version or same-identity rerun requires separate authorization. Report GitHub delivery failure independently of npm publication.
53
-
54
- ## Historical proof and restricted recovery
55
-
56
- Historical five-job and seven-job `split-recovery-022-v1` runs keep their own `terminal` completion requirements, including their original verification surfaces. Use the exact released checkout and run identity:
57
-
58
- ```powershell
59
- node dsmm/scripts/check-dsmm-release-completion.mjs terminal --run-id <run> --run-attempt <attempt> --control-sha <released-control-head> --receipt <new-terminal-receipt.json>
60
- ```
61
-
62
- New six-job controls cannot retrospectively reinterpret an earlier run. Historical metadata, exports, native receipt grammars, provenance, assets and job identities remain version-bound. Existing 0.3.0 and new 0.3.1 integrity-only receipts never establish native or browser execution.
63
-
64
- The restricted `recovery=unpublished-0.2.2` selector binds original workflow `374825007`, run `38822000490`, attempt `1`, failed prepare, skipped other jobs and no accepted artifact. It requires the original immutable tag/source and complete authenticated absence of npm and public/draft Release publication at entry and immediately before publish. **An already published version is ineligible.** Unknown selectors or extra inputs refuse; omitted/empty dispatch retains the frozen bootstrap policy.
65
-
66
- Recovery uses independent control and original-product checkouts. `assert-source`, `pack` and recovery `freeze` require `--source-root`. Provenance names the actual new dispatch/control commit, while the receipt separately binds `productSourceSha` and `attestedControlSha`. No control repair is copied into the fixed product artifact.
67
-
68
- Independent registry verification is reserved for historical or explicitly requested checks. Metadata, archive and provenance share the version's deadline: normally 120,000 ms, at most 300,000 ms explicitly; historical 0.1.9 alone permits twenty minutes. Only post-publication HTTP 404 reads may wait. Other transport, byte, provenance or identity failures refuse. Absence checks remain single-shot. Legacy finalization requires `--verification`.
69
-
70
- ## Installation and rollback
71
-
72
- Publication does not authorize installation, migration, login or session repair. Desktop and CLI/TUI profiles are independent. Separately authorized installation uses the target carrier/profile and preserves providers, accounts, native model/effort, unrelated Loader rows, roles, UI preferences and history. Package installation is not proof of Electron activation.
73
-
74
- Runtime rollback explicitly selects a reviewed prior configuration under revision and ownership checks. Package rollback uses supported carrier operations and an exact immutable version. Neither operation may overwrite later drafts, restore credentials, sign out, delete sessions or perform broad cleanup. Scoped and old unscoped bundles must not compete for the same `dsmm` entry. Clean only exact task-owned temporary resources.
31
+ Publication does not install the plugin. Desktop and CLI/TUI profiles have
32
+ independent carriers. Installation requires matching DSH `0.2.1-rc.2` and separate
33
+ authorization; it must preserve accounts, credentials, history and unrelated
34
+ configuration. Restarting active Desktop work requires authorization.
package/docs/roadmap.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Version policy
4
4
 
5
- **DSMM 0.3.1 targets exactly DSH `0.2.1-rc.2`.** Each DSMM version targets the published DSH RC or stable release selected for that version. Older SDKs, old configuration schemas and historical session formats aren't compatibility targets; existing data remains untouched. A newer upstream release requires deliberate reassessment, not an automatic dependency or runtime switch.
5
+ **DSMM 0.3.1 targets exactly DSH `0.2.1-rc.2`.** Each DSMM version targets the published DSH RC or stable release selected for that version. Older SDKs and old configuration schemas aren't runtime compatibility targets. Loading sessions created by DSMM `0.2.x` is a required compatibility target, separate from retaining old runtime implementations or execution behavior. A newer upstream release requires deliberate reassessment, not an automatic dependency or runtime switch.
6
6
 
7
7
  Published `0.3.0` retains its original rc.1 package, tag, assets and version-bound release identity.
8
8
 
@@ -20,9 +20,10 @@ Native call views show the target in collapsed rows, distinguish requested from
20
20
 
21
21
  | Capability | Current behavior | Requirement for broader support |
22
22
  | --- | --- | --- |
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. |
23
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). |
24
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. |
25
- | DSMM cold resume | Refuses execution without trusted live admission and preserves history. Display metadata can't restore authority. | Native identity and trustworthy configuration/permission binding across close/reopen and record loss. |
26
+ | DSMM cold resume | Patched Host supports read-only history and explicit continuation with fresh admission. Native Client/bootstrap/navigation enforce generation-bound preparation. | Verify the complete browser/Desktop carrier and socket-retry paths before claiming supported deployment. |
26
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. |
27
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. |
28
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. |
@@ -31,6 +32,47 @@ Native call views show the target in collapsed rows, distinguish requested from
31
32
 
32
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).
33
34
 
35
+ ## Planned: loading sessions created by DSMM 0.2.x
36
+
37
+ Sessions created by DSMM `0.2.x` must remain loadable under the supported current DSH runtime. Changed execution behavior is acceptable; blanket refusal to load an old session is not.
38
+
39
+ - Opening a historical session must preserve its list entry, title and readable conversation, including messages and tool results. An unavailable execution capability must not make the session disappear or prevent history from loading.
40
+ - Retired presets, plugins, metadata or admission formats require interpretation, migration or an explicit degraded mode rather than whole-session rejection solely because the old implementation is unavailable. This does not require restoring the old SDK or execution owner.
41
+ - Continued execution may use current roles, routing, configuration and permission semantics. Explain material differences and request fresh authorization where necessary; never treat historical metadata or approvals as current authority. When continuation is unavailable, retain the loaded history and expose the specific limitation separately.
42
+ - Preserve original records. Any necessary migration must protect user data with a recoverable original and concurrent-write safeguards; never discard history merely to make loading succeed. Corrupt or genuinely unreadable data must produce a specific diagnostic rather than silently removing the session.
43
+ - Acceptance covers opening representative `0.2.x` root and child histories, retaining titles/list entries and readable content, and separating continuation restrictions from loading. These are pending compatibility requirements, not claims that `0.3.1` already fulfills them.
44
+
45
+ ## Working-tree implementation: profile selection before the first message
46
+
47
+ - Allow selecting a saved profile or the default configuration on the new-session page, including when a blank session has already been created.
48
+ - Show the selected profile immediately and use its settings for the first request and subsequent delegated work. Keep the user's unsent draft when changing the selection.
49
+ - Keep the choice for this session separate from the default for future sessions. Changing one must not silently change the other.
50
+ - Determine availability from whether execution has begun, rather than disabling every session with the same restriction. Preserve permission checks and protect active work when a conversation has already started.
51
+ - Verify that a user can open a new session, change its profile and send the first message with the selected settings. Do not show a “new session required” instruction on a page where that action is itself unavailable.
52
+
53
+ ## Working-tree implementation: simpler DSMM settings
54
+
55
+ - Expand drawers containing only one section by default so their controls are immediately visible. Keep multi-section drawers easy to scan and navigate.
56
+ - Remove all redundant copy: repeated headings, explanations already conveyed by a control, implementation details and “not X, but Y” comparisons.
57
+ - Use familiar, consistent names across settings and session menus. Prefer direct wording such as “本次会话配置”, “新会话默认配置”, “使用默认配置” and “保存”; keep internal terms such as admission, overlay, mounted state and CAS out of normal interface copy.
58
+ - Keep only information needed to make a choice or act: what a setting affects, when it takes effect, important permission/data consequences and a concise recovery action when something fails. Place optional technical diagnostics behind a details disclosure.
59
+ - Review every drawer and its empty, disabled, saved and error states. Users must be able to find the controls and understand their choices without reading implementation explanations; preserve keyboard access and accessible labels.
60
+
61
+ ## Planned: scoped temporary permissions
62
+
63
+ - Keep native once-only approval and add explicit per-live-session, 15-minute and 1-hour grants for exact commands and subcommands. Bind grants to actual tool execution, arguments, working directory, project and current owner; presentation text and historical approval records never confer authority. Provide an effective-grants list and revocation without a second approval queue or persistent broad command Allow rules.
64
+ - Grants don't automatically cross sessions, child agents or descendants. Explicit direct-child authorization needs a visible operator workflow, exact live ownership and a supported native approval route; preserve the default delegated `never` policy unless the operator explicitly changes an eligible child's interactive policy. Explicit prohibitions and read-only role ceilings remain effective.
65
+ - Retain native session-persisted file permission modes. File/directory read/write and website grants must state which real tool or execution backend enforces them. Tool-call rules don't isolate arbitrary shell processes or their descendants.
66
+ - Precise additional filesystem roots and whole-process network restrictions require an enforcing backend and a public execution contract absent from the current sandbox policy. This is a delivery blocker for that full scope, not permission to disable sandboxing, override native denial, broaden read-only access or ship ineffective configuration.
67
+
68
+ The native approval settlement patches, grant storage and revocation, file/website adapters and direct-child permission controls require the patched Host package graph. An explicitly composed structured argv executor refuses approval when active shell or outside-read denies cannot be enforced for that program; revoked rules and unrelated Web rules do not impose that restriction. The executor is not enabled by the default composition: trusted program classification and precise command-deny integration remain required. Native bash/pwsh are once-only.
69
+
70
+ The patched Session Host exposes generation-bound history readiness and a full `followReadOnly` stream that never promotes, with readiness revoked when its DSMM owner retires. The Gateway provides opt-in Client scope preparation and protected RPC/stream envelopes whose actual receiving Host checks the same readiness before native lookup, preserving codecs, resource access and native approval settlement. Required Client dispatch stays closed without a preparation provider. The Session Client provides connection readiness, opaque full-address leases checked before retention, synchronous scope guards, preparing `using()`, connected refresh and read-only physical follow/page preparation. Generation replacement invalidates old leases and late probes cannot restore them; cancellation is independent for each waiter. The aggregate `api-remotes` browser bundle includes the matching read-only Session descriptor.
71
+
72
+ An independently mounted bootstrap supplies the early head/global required flag through native index injection even when Core initialization fails. Native workspace navigation prepares before retention and commits only a ready replacement; cancellation and opening failure preserve the previous reference, title and draft. Child sidebar resources prepare their full address before retention. The non-required lane retains synchronous selection. Empty-browser component coverage exercises native bootstrap, ModuleLoader, Renderer, workspace navigation, child resources and visible failure Toasts, with test-owned layout, controls, draft field and logical carrier. Loopback HTTP/WebSocket coverage verifies rejection after guard retirement during a socket wait, fresh preparation on native Session transport retry under a separately owned stable Connection generation, and stale-envelope refusal at a replacement Host followed by native reconnect. Full application/Desktop carrier coverage remains incomplete; component evidence does not prove delivered deployment support.
73
+
74
+ The final requirements and implementation boundaries for historical loading, blank-session configuration, settings usability and temporary permissions are in the [product plan](../../docs/superpowers/plans/2026-10-18-dsmm-session-permissions-usability.md). Working-tree implementations do not change the capabilities of an installed published release. Existing [Fake-IP fetch](web-fetch-fakeip.md) protections remain in force.
75
+
34
76
  ## Publication and Desktop installation
35
77
 
36
78
  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.
@@ -0,0 +1,43 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ import type { PropsLocale, PropsRenderSlots } from "@deepseek-ai/dsh-client-ui-slots";
3
+ import type { ConnectionHandle } from "@deepseek-ai/dsh-client-connection/client";
4
+ import type { ISessions } from "@deepseek-ai/dsh-api-session-controller/client";
5
+ import type { UiSession } from "@deepseek-ai/dsh-client-ui-session/client";
6
+ import type { RoleControlChildView } from "../role-control-types.js";
7
+ import { PERMISSIONS_NS } from "./permission-locales.js";
8
+ interface Owner {
9
+ parentSessionId: string;
10
+ child: RoleControlChildView;
11
+ }
12
+ interface Services {
13
+ sessions: ISessions;
14
+ uiSession: UiSession;
15
+ connection: ConnectionHandle;
16
+ }
17
+ type Locale = PropsLocale<typeof PERMISSIONS_NS>;
18
+ type Composer = PropsRenderSlots<"conversation.composer">;
19
+ /** Direct-child card action. Retention is Client-only; it never keeps the Host child alive. */
20
+ export declare function ChildPermissions(props: Owner & Services & Composer & Locale): import("react").JSX.Element | null;
21
+ export declare const CHILD_PERMISSION_SLOTS: {
22
+ readonly "conversation.dsmm-child-permissions": {
23
+ readonly kind: "list";
24
+ readonly scope: "root";
25
+ };
26
+ };
27
+ export declare function registerChildPermissionEntry(ctx: Context): void;
28
+ declare module "@deepseek-ai/dsh-client-ui-slots" {
29
+ interface SlotMap {
30
+ "conversation.dsmm-child-permissions": {
31
+ kind: "list";
32
+ scope: "root";
33
+ owner: Owner;
34
+ };
35
+ }
36
+ }
37
+ declare module "@deepseek-ai/dsh-api-session-controller/client" {
38
+ interface SessionReferenceSourceMap {
39
+ dsmmChildPermissions: unknown;
40
+ }
41
+ }
42
+ export {};
43
+ //# sourceMappingURL=ChildPermissions.d.ts.map
@@ -0,0 +1,100 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
+ import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
4
+ import { temporaryPermissionClient } from "./temporary-permission-client.js";
5
+ import { TemporaryGrants } from "./TemporaryPermissions.js";
6
+ import { PERMISSIONS_NS } from "./permission-locales.js";
7
+ function NativeChildApproval(props) {
8
+ const { active, uiSession, SessionProvider } = props;
9
+ const session = useSyncExternalStore(listener => active.binding.session.subscribe(listener), () => active.binding.session.getSnapshot());
10
+ const statuses = useSyncExternalStore(listener => uiSession.sessionStatus.subscribe(listener), () => uiSession.sessionStatus.getSnapshot());
11
+ if (!props.current())
12
+ return _jsx("p", { className: "dsmm-hint", children: props.t("childUnavailable") });
13
+ return _jsx(SessionProvider, { session: active.reference, children: props.renderSlotChain("conversation.composer", {
14
+ sessionId: active.binding.sessionId, session, pendingInteraction: statuses.get(active.binding.sessionId)?.pendingInteraction,
15
+ }, { fallback: _jsx("p", { className: "dsmm-hint", children: props.t("childNoPending") }) }) });
16
+ }
17
+ /** Direct-child card action. Retention is Client-only; it never keeps the Host child alive. */
18
+ export function ChildPermissions(props) {
19
+ const id = useId(), trigger = useRef(null), heading = useRef(null);
20
+ const generation = useSyncExternalStore(listener => props.connection.generation.subscribe(listener), () => props.connection.generation.getSnapshot());
21
+ useSyncExternalStore(listener => props.sessions.list.subscribe(listener), () => props.sessions.list.getSnapshot());
22
+ const identity = useMemo(() => ({}), [props.parentSessionId, props.child.id, props.sessions, props.uiSession, props.connection, generation]);
23
+ const latest = useRef(identity);
24
+ latest.current = identity;
25
+ const [open, setOpen] = useState(false), [refresh, setRefresh] = useState(0), [active, setActive] = useState();
26
+ const [view, setView] = useState(), [busy, setBusy] = useState(false), [error, setError] = useState(false);
27
+ const current = () => !!active && active.identity === identity && latest.current === identity && !active.signal.aborted
28
+ && props.connection.generation.getSnapshot() === generation && props.sessions.binding(active.binding.sessionId) === active.binding
29
+ && active.binding.session.getSnapshot().openState === "open" && !active.binding.session.getSnapshot().removed;
30
+ useEffect(() => {
31
+ setActive(undefined);
32
+ setView(undefined);
33
+ setBusy(false);
34
+ setError(false);
35
+ if (!open || generation === undefined)
36
+ return;
37
+ const abort = new AbortController();
38
+ const reference = props.sessions.retain({ parentSessionId: props.parentSessionId,
39
+ childSessionId: props.child.id, mode: "continuable" }, { source: "dsmmChildPermissions", signal: abort.signal });
40
+ const remote = temporaryPermissionClient(props.connection, abort.signal);
41
+ void reference.ready.then(async (binding) => {
42
+ if (abort.signal.aborted || latest.current !== identity)
43
+ return;
44
+ if (props.sessions.scopeOf(binding.ctx) !== props.child.id || props.sessions.binding(binding.sessionId) !== binding)
45
+ throw new Error("Native child scope changed.");
46
+ setActive({ identity, reference, binding, remote, signal: abort.signal });
47
+ const value = await remote.child(props.parentSessionId, props.child.id);
48
+ if (!abort.signal.aborted && latest.current === identity && props.sessions.binding(binding.sessionId) === binding)
49
+ setView(value);
50
+ }).catch(() => { if (!abort.signal.aborted && latest.current === identity)
51
+ setError(true); });
52
+ return () => { abort.abort(); reference.release(); };
53
+ }, [identity, open, refresh]);
54
+ useEffect(() => { if (open)
55
+ heading.current?.focus(); }, [open]);
56
+ if (props.child.mode !== "continuable" || props.child.parentSessionId !== props.parentSessionId)
57
+ return null;
58
+ const available = current() && !busy && view?.parentSessionId === props.parentSessionId && view.childSessionId === props.child.id;
59
+ async function change(operation) {
60
+ if (!available || !active)
61
+ return;
62
+ const captured = active;
63
+ setBusy(true);
64
+ setError(false);
65
+ try {
66
+ const value = await captured.remote[operation](props.parentSessionId, props.child.id);
67
+ if (latest.current === identity && !captured.signal.aborted)
68
+ setView(value);
69
+ }
70
+ catch {
71
+ if (latest.current === identity && !captured.signal.aborted) {
72
+ setView(undefined);
73
+ setError(true);
74
+ }
75
+ }
76
+ finally {
77
+ if (latest.current === identity && !captured.signal.aborted)
78
+ setBusy(false);
79
+ }
80
+ }
81
+ return _jsxs("div", { className: "dsmm-child-permissions", children: [_jsx(Button, { ref: trigger, type: "button", variant: "outline", "aria-expanded": open, "aria-controls": id, onClick: () => {
82
+ if (open) {
83
+ setOpen(false);
84
+ trigger.current?.focus();
85
+ }
86
+ else
87
+ setOpen(true);
88
+ }, children: props.t("childPermissions") }), open && _jsxs("section", { id: id, className: "dsmm-zone", "aria-labelledby": `${id}-heading`, "aria-busy": busy, children: [_jsx("h3", { id: `${id}-heading`, ref: heading, tabIndex: -1, children: props.child.label ?? props.child.id }), _jsx("p", { children: props.child.id }), _jsx("p", { className: "dsmm-hint", children: props.t("childPermissionBoundary") }), view && _jsxs(_Fragment, { children: [_jsxs("p", { children: [props.t("childProject"), ": ", view.project] }), _jsxs("p", { children: [props.t("childRole"), ": ", view.role ?? props.t("unknown"), view.readOnly ? ` · ${props.t("childReadOnly")}` : ""] }), _jsx("p", { role: "status", "aria-live": "polite", children: props.t(view.state === "enabled" ? "childEnabled" : view.state === "disabled" ? "childDisabled" : "childUnavailable") })] }), (!current() || !view) && !error && _jsx("p", { role: "status", children: props.t(generation === undefined ? "childUnavailable" : "reading") }), error && _jsx("p", { className: "dsmm-issue", role: "alert", children: props.t("childUnconfirmed") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: !available || !view?.canEnable || view.state === "enabled", onClick: () => void change("enableChild"), children: props.t("childEnable") }), _jsx(Button, { type: "button", variant: "outline", disabled: !available || !view?.canRevoke, onClick: () => void change("revokeChild"), children: props.t("childRevoke") }), _jsx(Button, { type: "button", variant: "outline", disabled: busy || generation === undefined, onClick: () => setRefresh(value => value + 1), children: props.t("temporaryRefresh") })] }), active?.identity === identity && current() && _jsxs(_Fragment, { children: [_jsx(NativeChildApproval, { ...props, active: active, current: current }), view?.state === "enabled" && _jsx(TemporaryGrants, { sessionId: props.child.id, remote: active.remote, t: props.t, child: true })] })] })] });
89
+ }
90
+ export const CHILD_PERMISSION_SLOTS = { "conversation.dsmm-child-permissions": { kind: "list", scope: "root" } };
91
+ export function registerChildPermissionEntry(ctx) {
92
+ void ctx.inject(["sessions", "uiSession", "connection"], scope => {
93
+ scope.slots.inject("conversation.dsmm-child-permissions", () => scope.slots.register({
94
+ name: "conversation.dsmm-child-permissions", id: "dsmm-child-permissions", locale: PERMISSIONS_NS,
95
+ children: { "conversation.composer": { kind: "chain", scope: "session" } },
96
+ inject: () => ({ sessions: scope.sessions, uiSession: scope.uiSession, connection: scope.connection }),
97
+ }, ChildPermissions));
98
+ });
99
+ }
100
+ //# sourceMappingURL=ChildPermissions.js.map
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from "react";
1
2
  import type { InjectFace, PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
2
3
  import type { DsmmInvocationView, RoleControlAvailability, RoleControlChildView } from "../role-control-types.js";
3
4
  import type { DsmmRoleRouteComparison } from "../profile-types.js";
@@ -11,6 +12,7 @@ export type ChildrenInjected = ChildrenActions & {
11
12
  };
12
13
  export type ChildrenPanelProps = InjectFace<ChildrenInjected> & Locale & {
13
14
  sessionId?: string;
15
+ renderChildPermissions?: (child: RoleControlChildView) => ReactNode;
14
16
  };
15
17
  export declare function ControlAvailability({ value, label, t }: Locale & {
16
18
  value?: RoleControlAvailability;
@@ -28,11 +30,12 @@ export declare function ChildComposer({ child, state, actions, t }: Locale & {
28
30
  state: ChildrenSnapshot;
29
31
  actions: ChildrenActions;
30
32
  }): import("react").JSX.Element;
31
- export declare function ChildDetails({ child, state, actions, t, inspection }: Locale & {
33
+ export declare function ChildDetails({ child, state, actions, t, inspection, renderChildPermissions }: Locale & {
32
34
  child: RoleControlChildView;
33
35
  state: ChildrenSnapshot;
34
36
  actions: ChildrenActions;
35
37
  inspection?: boolean;
38
+ renderChildPermissions?: ChildrenPanelProps["renderChildPermissions"];
36
39
  }): import("react").JSX.Element;
37
40
  /** Native session-scoped Conversation View, not a replacement composer or navigation shell. */
38
41
  export declare function ChildrenPanel(props: ChildrenPanelProps): import("react").JSX.Element;
@@ -52,8 +52,8 @@ export function ChildComposer({ child, state, actions, t }) {
52
52
  } }), _jsx(Button, { type: "button", variant: "outline", disabled: !canImages, "aria-describedby": `${prefix}-images-hint`, onClick: () => { if (canImages)
53
53
  picker.current?.click(); }, children: t("images") }), _jsx(ControlAvailability, { value: state.snapshot?.capabilities.images, label: "imageAvailability", t: t }), draft.images.length > 0 && _jsx("ul", { className: "dsmm-profile-list", children: draft.images.map((image, index) => _jsxs("li", { children: [_jsxs("p", { children: [image.name ?? image.mediaType, " \u00B7 ", image.mediaType] }), _jsx(Button, { type: "button", variant: "outline", disabled: pending || draft.imageBusy, onClick: () => actions.removeImage(generation, child.id, image), "aria-label": `${t("removeImage")}: ${image.name ?? image.mediaType}`, children: t("removeImage") })] }, index)) })] }), draft.uncertain && _jsxs("div", { className: "dsmm-warning", children: [_jsx("p", { id: `${prefix}-unknown`, children: t("unknown") }), _jsx(Button, { type: "button", variant: "outline", disabled: !state.fresh || state.reading || pending, onClick: () => actions.acknowledgeUnknown(generation, child.id), children: t("acknowledge") })] }), _jsx(ControlAvailability, { value: !enabled(state.snapshot?.capabilities.prompt) ? state.snapshot?.capabilities.prompt : child.controls.prompt, label: "promptAvailability", t: t }), draft.text.trim() === "" && draft.images.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("emptyMessage") }), draft.images.length > 0 && !enabled(state.snapshot?.capabilities.images) && _jsx("p", { className: "dsmm-hint", children: t("deniedImages") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "submit", variant: "primary", disabled: !submit, children: t("send") }), _jsx(Button, { type: "button", variant: "outline", disabled: !available || !enabled(state.snapshot?.capabilities.interrupt) || !enabled(child.controls.interrupt) || child.readonly || child.mode !== "continuable", onClick: () => void actions.interrupt(generation, child.id), children: t("interrupt") })] }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: pending ? t("pending") : draft.imageBusy ? t("imageReading") : "" })] });
54
54
  }
55
- export function ChildDetails({ child, state, actions, t, inspection = false }) {
56
- return _jsxs("fieldset", { children: [_jsx("legend", { children: child.label?.trim() ? child.label : child.id }), _jsxs("p", { children: [t("childId"), ": ", child.id] }), _jsxs("p", { children: [t("parentId"), ": ", child.parentSessionId] }), _jsxs("p", { children: [t("mode"), ": ", child.mode] }), _jsxs("p", { children: [t("activity"), ": ", child.activity] }), (inspection || child.readonly) && _jsx("p", { children: t("readonly") }), child.mode === "one-shot" && _jsx("p", { className: "dsmm-hint", children: t("oneShot") }), _jsx(RouteComparisonDetails, { value: child.routeComparison, t: t }), _jsx(InvocationDetails, { value: child.invocation, t: t, showComparison: false }), (!inspection || !child.controls.prompt.enabled) && _jsx(ControlAvailability, { value: child.controls.prompt, label: "promptAvailability", t: t }), (!inspection || !child.controls.interrupt.enabled) && _jsx(ControlAvailability, { value: child.controls.interrupt, label: "interruptAvailability", t: t }), !inspection && child.mode === "continuable" && !child.readonly && _jsx(ChildComposer, { child: child, state: state, actions: actions, t: t }), !inspection && _jsxs(_Fragment, { children: [_jsx(Issue, { value: state.issues.get(childActionKey(child.id)), t: t }), _jsx(Outcome, { value: state.outcomes.get(childActionKey(child.id)), t: t })] })] });
55
+ export function ChildDetails({ child, state, actions, t, inspection = false, renderChildPermissions }) {
56
+ return _jsxs("fieldset", { children: [_jsx("legend", { children: child.label?.trim() ? child.label : child.id }), _jsxs("p", { children: [t("childId"), ": ", child.id] }), _jsxs("p", { children: [t("parentId"), ": ", child.parentSessionId] }), _jsxs("p", { children: [t("mode"), ": ", child.mode] }), _jsxs("p", { children: [t("activity"), ": ", child.activity] }), (inspection || child.readonly) && _jsx("p", { children: t("readonly") }), child.mode === "one-shot" && _jsx("p", { className: "dsmm-hint", children: t("oneShot") }), _jsx(RouteComparisonDetails, { value: child.routeComparison, t: t }), _jsx(InvocationDetails, { value: child.invocation, t: t, showComparison: false }), (!inspection || !child.controls.prompt.enabled) && _jsx(ControlAvailability, { value: child.controls.prompt, label: "promptAvailability", t: t }), (!inspection || !child.controls.interrupt.enabled) && _jsx(ControlAvailability, { value: child.controls.interrupt, label: "interruptAvailability", t: t }), !inspection && child.mode === "continuable" && !child.readonly && _jsx(ChildComposer, { child: child, state: state, actions: actions, t: t }), !inspection && child.mode === "continuable" && !child.readonly && renderChildPermissions?.(child), !inspection && _jsxs(_Fragment, { children: [_jsx(Issue, { value: state.issues.get(childActionKey(child.id)), t: t }), _jsx(Outcome, { value: state.outcomes.get(childActionKey(child.id)), t: t })] })] });
57
57
  }
58
58
  /** Native session-scoped Conversation View, not a replacement composer or navigation shell. */
59
59
  export function ChildrenPanel(props) {
@@ -63,7 +63,7 @@ export function ChildrenPanel(props) {
63
63
  const data = state.snapshot;
64
64
  const refreshingDisabled = state.reading || state.pending.size > 0 || [...state.drafts.values()].some(draft => draft.imageBusy);
65
65
  return _jsxs("section", { className: "dsmm-profiles dsmm-children", "aria-label": t("title"), "aria-busy": state.reading, children: [_jsx("h2", { children: t("title") }), _jsx("p", { className: "dsmm-hint", children: t("description") }), _jsxs("p", { children: [t("session"), ": ", state.sessionId] }), _jsx("div", { className: "dsmm-actions", children: _jsx(Button, { type: "button", variant: "outline", disabled: refreshingDisabled, onClick: () => void props.refresh(generation), children: t("refresh") }) }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: state.reading ? t("reading") : state.pending.size > 0 ? t("pending") : !state.fresh ? t(data === null ? "unavailable" : "stale") : "" }), _jsx(Issue, { value: state.issue, t: t }), data !== null && _jsxs(_Fragment, { children: [_jsxs("p", { children: [t("epoch"), ": ", data.admissionEpoch] }), _jsxs("section", { className: "dsmm-availability", children: [_jsxs("p", { children: [t("runtime"), ": ", data.capabilities.runtime.binding] }), _jsxs("p", { children: [t("fence"), ": ", t(data.capabilities.runtime.deliveryFenceReady ? "yes" : "no")] }), _jsxs("p", { children: [t("restart"), ": ", t(data.capabilities.runtime.restartRequired ? "yes" : "no")] }), data.capabilities.runtime.reason !== undefined && _jsx("p", { children: t("authority") }), _jsx(ControlAvailability, { value: data.capabilities.prompt, label: "promptAvailability", t: t }), _jsx(ControlAvailability, { value: data.capabilities.interrupt, label: "interruptAvailability", t: t })] }), _jsx("p", { className: "dsmm-hint", children: t("backgroundHint") }), _jsxs("section", { className: "dsmm-zone", "aria-label": t("children"), children: [_jsx("h3", { children: t("children") }), data.children.length === 0 ? _jsx("p", { className: "dsmm-hint", children: t("emptyChildren") })
66
- : data.children.map(child => _jsx(ChildDetails, { child: child, state: state, actions: props, t: t }, child.id))] })] }), _jsxs("section", { className: "dsmm-zone", "aria-label": t("descendants"), children: [_jsx("h3", { children: t("descendants") }), _jsx(Issue, { value: state.descendantIssue, t: t }), state.descendants === null ? _jsx("p", { className: "dsmm-hint", children: t("treeUnavailable") }) : state.descendants.descendants.length === 0 ? _jsx("p", { className: "dsmm-hint", children: t("emptyDescendants") })
66
+ : data.children.map(child => _jsx(ChildDetails, { child: child, state: state, actions: props, t: t, renderChildPermissions: props.renderChildPermissions }, child.id))] })] }), _jsxs("section", { className: "dsmm-zone", "aria-label": t("descendants"), children: [_jsx("h3", { children: t("descendants") }), _jsx(Issue, { value: state.descendantIssue, t: t }), state.descendants === null ? _jsx("p", { className: "dsmm-hint", children: t("treeUnavailable") }) : state.descendants.descendants.length === 0 ? _jsx("p", { className: "dsmm-hint", children: t("emptyDescendants") })
67
67
  : state.descendants.descendants.map((entry, index) => _jsxs("div", { className: "dsmm-availability", children: [_jsxs("p", { children: [t("depth"), ": ", entry.depth] }), entry.kind === "diagnostic" ? _jsxs("div", { className: "dsmm-issue", children: [_jsx("p", { children: t("diagnostic", { reason: entry.reason }) }), _jsxs("p", { children: [t("childId"), ": ", entry.id] }), _jsxs("p", { children: [t("parentId"), ": ", entry.parentSessionId] })] })
68
68
  : _jsxs(_Fragment, { children: [_jsxs("p", { children: [t("subtree"), ": ", t(entry.hasChildren ? "yes" : "no")] }), _jsx(ChildDetails, { child: entry.child, state: state, actions: props, t: t, inspection: true })] })] }, index))] })] });
69
69
  }
@@ -6,12 +6,14 @@ type Locale = PropsLocale<"plugins.dsmm">;
6
6
  export declare const permissionText: (t: Locale["t"]) => (key: PermissionLocaleKey) => string;
7
7
  export declare function fieldLabel(path: readonly string[], t: Locale["t"]): string;
8
8
  export declare function displayValue(value: unknown, t: Locale["t"]): string;
9
- export declare function AdvancedField({ schema, path, controller, inherited, upper, t }: Locale & {
9
+ export declare function AdvancedField({ schema, path, controller, inherited, upper, expanded, onExpandedChange, t }: Locale & {
10
10
  schema: DeploymentSchemaNode;
11
11
  path: string[];
12
12
  controller: DeploymentController;
13
13
  inherited: unknown;
14
14
  upper: unknown;
15
+ expanded?: boolean;
16
+ onExpandedChange?: (expanded: boolean) => void;
15
17
  }): import("react").JSX.Element;
16
18
  export declare function ScalarField({ schema, path, controller, inherited, t }: Locale & {
17
19
  schema: DeploymentSchemaNode;
@@ -19,10 +21,12 @@ export declare function ScalarField({ schema, path, controller, inherited, t }:
19
21
  controller: DeploymentController;
20
22
  inherited: unknown;
21
23
  }): import("react").JSX.Element;
22
- export declare function Field({ schema, path, controller, t }: Locale & {
24
+ export declare function Field({ schema, path, controller, initiallyOpen, disclosures, t }: Locale & {
23
25
  schema: DeploymentSchemaNode;
24
26
  path: string[];
25
27
  controller: DeploymentController;
28
+ initiallyOpen?: boolean;
29
+ disclosures?: Map<string, boolean>;
26
30
  }): import("react").JSX.Element;
27
31
  export {};
28
32
  //# sourceMappingURL=DeploymentFields.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useId, useSyncExternalStore } from "react";
2
+ import { useId, useState, useSyncExternalStore } from "react";
3
3
  import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
4
4
  import { at, enumValues, equal, mergeLayer, parseAdvanced, validateEditorValue } from "./deployment-data.js";
5
5
  import { deploymentFieldLabels } from "./deployment-locales.js";
@@ -21,10 +21,10 @@ export function displayValue(value, t) {
21
21
  const text = JSON.stringify(value);
22
22
  return text.length > 120 ? `${text.slice(0, 120)}…` : text;
23
23
  }
24
- export function AdvancedField({ schema, path, controller, inherited, upper, t }) {
24
+ export function AdvancedField({ schema, path, controller, inherited, upper, expanded, onExpandedChange, t }) {
25
25
  const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot), id = useId(), name = path.join(".");
26
26
  const value = at(state.draft, path), raw = state.raw[name], text = raw?.text ?? (value === undefined ? "" : JSON.stringify(value, null, 2)), invalid = raw?.invalid === true;
27
- return _jsxs("details", { className: "dsmm-deployment-group", "data-field": name, children: [_jsxs("summary", { children: [fieldLabel(path, t), " \u00B7 ", t("advanced")] }), _jsxs("div", { className: "dsmm-field", children: [_jsxs("label", { htmlFor: id, children: [fieldLabel(path, t), " \u00B7 ", t("advanced")] }), _jsx("p", { className: "dsmm-hint", id: `${id}-hint`, children: t("advancedHint") }), path[0] === "permissionControl" && _jsx("p", { className: "dsmm-hint", children: permissionText(t)("configRulesHint") }), _jsx("p", { className: "dsmm-hint", children: t(value === undefined ? "inherit" : "explicit") }), upper !== undefined && _jsxs("p", { className: "dsmm-hint", children: [t("profileSource"), ": ", displayValue(upper, t)] }), _jsx("textarea", { id: id, rows: 6, maxLength: 32768, value: text, disabled: !controller.canEdit(), "aria-invalid": invalid, "aria-describedby": `${id}-hint ${id}-error`, onChange: event => {
27
+ return _jsxs("details", { className: "dsmm-deployment-group", "data-field": name, open: expanded, onToggle: event => onExpandedChange?.(event.currentTarget.open), children: [_jsxs("summary", { id: `${id}-label`, children: [fieldLabel(path, t), " \u00B7 ", t("advanced")] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("p", { className: "dsmm-hint", id: `${id}-hint`, children: t("advancedHint") }), path[0] === "permissionControl" && _jsx("p", { className: "dsmm-hint", children: permissionText(t)("configRulesHint") }), _jsx("p", { className: "dsmm-hint", children: t(value === undefined ? "inherit" : "explicit") }), upper !== undefined && _jsxs("p", { className: "dsmm-hint", children: [t("profileSource"), ": ", displayValue(upper, t)] }), _jsx("textarea", { id: id, rows: 6, maxLength: 32768, value: text, disabled: !controller.canEdit(), "aria-labelledby": `${id}-label`, "aria-invalid": invalid, "aria-describedby": `${id}-hint ${id}-error`, onChange: event => {
28
28
  const next = event.currentTarget.value;
29
29
  let parsed, valid = true;
30
30
  try {
@@ -51,18 +51,20 @@ export function ScalarField({ schema, path, controller, inherited, t }) {
51
51
  controller.edit(path, candidate);
52
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 ?? "—"}` : ""] })] });
53
53
  }
54
- export function Field({ schema, path, controller, t }) {
54
+ export function Field({ schema, path, controller, initiallyOpen = false, disclosures, t }) {
55
55
  if (schema.type === "transform" && schema.inner !== undefined)
56
56
  schema = schema.inner;
57
57
  const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot), snapshot = state.snapshot, id = useId(), name = path.join(".");
58
+ const [open, setOpen] = useState(disclosures?.get(name) ?? initiallyOpen);
59
+ const expand = (expanded) => { disclosures?.set(name, expanded); setOpen(expanded); };
58
60
  const explicit = at(state.draft, path), inherited = controller.layer === "global" ? at(snapshot.defaults, path) : at(mergeLayer(mergeLayer(snapshot.defaults, snapshot.global), snapshot.nativeForm?.base ?? {}), path);
59
61
  const choices = enumValues(schema), disabled = !controller.canEdit();
60
62
  if (name === "permissionControl.nativeCommands.entries")
61
63
  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) }) });
62
64
  if (schema.type === "object" && schema.fields !== undefined && path[0] !== "roleRouting")
63
- return _jsxs("details", { className: "dsmm-deployment-group", "data-field": name, 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, t: t }, key))] })] });
65
+ 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))] })] });
64
66
  if (!["boolean", "string", "number"].includes(schema.type) && choices === null)
65
- return _jsx(AdvancedField, { schema: schema, path: path, controller: controller, inherited: inherited, upper: controller.layer === "global" ? at(snapshot.profile, path) : undefined, t: t });
67
+ return _jsx(AdvancedField, { schema: schema, path: path, controller: controller, inherited: inherited, upper: controller.layer === "global" ? at(snapshot.profile, path) : undefined, expanded: open, onExpandedChange: expand, t: t });
66
68
  return _jsxs("div", { className: "dsmm-field dsmm-deployment-field", "data-field": name, children: [schema.type === "boolean" || choices !== null ? _jsxs(_Fragment, { children: [_jsx("label", { htmlFor: id, children: fieldLabel(path, t) }), _jsxs("select", { id: id, disabled: disabled, value: explicit === undefined ? "inherit" : JSON.stringify(explicit), onChange: event => controller.edit(path, event.currentTarget.value === "inherit" ? undefined : JSON.parse(event.currentTarget.value)), children: [_jsx("option", { value: "inherit", children: `${t("unset")} · ${displayValue(inherited, t)}` }), (choices ?? [true, false]).map(choice => _jsx("option", { value: JSON.stringify(choice), children: displayValue(choice, t) }, String(choice)))] })] }) : _jsx(ScalarField, { schema: schema, path: path, controller: controller, inherited: inherited, t: t }), name === "modelParameters.passthrough" && _jsx("p", { className: "dsmm-hint", children: t("modelParametersHint") }), name === "permissionControl.enabled" && _jsx("p", { className: "dsmm-hint", children: permissionText(t)("coldHint") }), explicit !== undefined && _jsx("p", { className: "dsmm-hint", children: t(equal(explicit, at(snapshot.defaults, path)) ? "defaultPin" : "explicit") }), controller.layer === "profile" && at(snapshot.nativeForm?.base, path) !== undefined && _jsx("p", { className: "dsmm-hint", children: t("hostPin") }), controller.layer === "global" && at(snapshot.profile, path) !== undefined && _jsxs("p", { className: "dsmm-hint", children: [t("profileSource"), ": ", displayValue(at(snapshot.profile, path), t), " \u00B7 ", t("explicit")] })] });
67
69
  }
68
70
  //# sourceMappingURL=DeploymentFields.js.map
@@ -1,4 +1,5 @@
1
- import type { PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
1
+ import type { HostObservable, PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
2
+ import type { TemporaryPermissionRemote } from "../permission-temporary-types.js";
2
3
  import type { ConfigForms } from "@deepseek-ai/dsh-client-ui-settings/client";
3
4
  import type { DsmmConfigRemote } from "../profile-remote.js";
4
5
  import type { SubagentRuntimeAdmissionView } from "../profile-types.js";
@@ -12,6 +13,8 @@ export interface DeploymentPageProps extends Locale {
12
13
  remote: DsmmConfigRemote;
13
14
  workspace?: DeploymentWorkspace;
14
15
  permissions?: PermissionController;
16
+ temporaryPermissions?: HostObservable<TemporaryPermissionRemote | undefined>;
17
+ permissionsT?: PropsLocale<"settings.dsmm-permissions">["t"];
15
18
  forms?: ConfigForms;
16
19
  }
17
20
  export declare function ScopeSave({ controller, workspace, refreshOnly, t }: Locale & {