@dsmm/dsmm 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Deepwork adapts ocmm's deepwork workflow to DeepSeek Harness. Its package remains `@dsmm/dsmm`: a DSH-native Cordis bundle, not an OpenCode compatibility layer.
4
4
 
5
- This package targets `@deepseek-ai/dsh@0.2.0-rc.2`, the npm `latest` resolved on 2026-10-03. The current `0.1.5` source contract adds structured native route controls, independently selected per-session profiles and two per-role route strategies, with human-facing **Deepwork** branding and **DW Role** display names. 0.1.5 publication and Desktop acceptance remain pending. Older tags/packages/accepted archives stay immutable, including 0.1.4's separately controlled published-origin continuation. Package, configuration, tool and role IDs retain the `dsmm` namespace.
5
+ This package targets `@deepseek-ai/dsh@0.2.0-rc.2`, the npm `latest` resolved on 2026-10-03. The current `0.1.7` source contract preserves native root-model authority and provides one icon-only native profile menu in sessionless, blank and active conversation views, alongside structured native route controls, independent session profiles and delegated-role route strategies. Human-facing names remain **Deepwork** and **DW Role**. 0.1.7 publication and Desktop acceptance remain pending. The completed 0.1.5 publication and completed 0.1.6 publication/continuation are immutable historical evidence, not proof for 0.1.7; older identities, including 0.1.4's separately controlled published-origin continuation, stay unchanged. Package, configuration, tool and role IDs retain the `dsmm` namespace.
6
6
 
7
- The immutable `dsmm-scoped-v0.1.3` tag remains at `2bdea4b`. Its CI run `37235817488` failed before packing or publication because pnpm 11 ignored the required esbuild/koffi build scripts. The later 0.1.4 origin published accepted bytes but its original verification saw a registry 404; its fixed-origin continuation preserves that failed original CI history. The successor target is 0.1.5; none of these facts authorizes rewriting earlier identities.
7
+ The immutable `dsmm-scoped-v0.1.3` tag remains at `2bdea4b`. Its CI run `37235817488` failed before packing or publication because pnpm 11 ignored the required esbuild/koffi build scripts. The later 0.1.4 origin published accepted bytes but its original verification saw a registry 404; its completed fixed-origin continuation preserves that failed original CI history. The stopped 0.1.2 frozen tag/artifact and draft Release remain untouched and unpublished. The successor target is 0.1.7; none of these facts authorizes rewriting earlier identities.
8
8
 
9
9
  ## Current functionality
10
10
 
@@ -12,8 +12,9 @@ The immutable `dsmm-scoped-v0.1.3` tag remains at `2bdea4b`. Its CI run `3723581
12
12
  - Seven scoped core workflow skills synchronized with current ocmm: risk-based discovery, complex-work planning and criticism, bounded implementation, evidence-led review, parallel execution, and behavior-preserving cleanup.
13
13
  - Twelve native roles displayed as `DW …`, with enabled DW Orchestrator, DW Builder, and DW Planner eligible for the native root Agent preset selector. The other nine roles remain auxiliary delegation roles; disabled Builder is absent from both selector and child tools. Read-only constraints are enforced through native tool composition. Models remain user-selected; Oracle names alone do not guarantee model heterogeneity.
14
14
  - Exact-route V41 Flash calibration for `deepseek-official/deepseek-flash` and `deepseek-account/deepseek-flash`, preserving V4 Pro settings. Runtime selects only adapter-advertised reasoning efforts.
15
- - Role provider/model/exact-effort controls, ordered candidates, independent per-role `startup-lock` (default) or explicit `rate-limit-fallback`, and finite correlated no-output-safe retries. Supported explicit native overrides survive for trusted live, owned, zero-prefix one-shot children. No new model-visible model-selection permission is added; exact configured efforts are not downgraded.
15
+ - Delegated-role provider/model/exact-effort controls, ordered candidates, independent per-role `startup-lock` (default) or explicit `rate-limit-fallback`, and finite correlated no-output-safe retries. Ordinary roots keep their native initial model and exact effort, not a profile-role primary; explicit native model choices remain authoritative across later turns, profile reapply and cold resume. Supported explicit overrides survive for trusted live, owned, zero-prefix one-shot children. No new model-visible model-selection permission is added; exact configured efforts are not downgraded.
16
16
  - Native Settings → Deepwork Profiles (`Deepwork 配置档`) with structured role/retry controls and byte-preserving Advanced JSONC. Global default and current-session Apply are distinct; CAS-protected sidecars pin independent immutable revisions and admission epochs. Save alone activates neither scope.
17
+ - Icon-only native header profile menu: normal switching keeps the current model. The separate explicit “Switch and use profile model” choice invokes native model selection only after successful profile CAS and saves its native default, like the Models tab. Sessionless and blank views retain an inspectable menu; disabled mutations do not hide current state or refresh. A committed profile remains applied if model selection is unavailable or unconfirmed; the UI reports the separate model result and preserves newer native choices. Refusal feedback shows only allowlisted codes/fields and refresh/retry guidance, never raw wire messages or paths.
17
18
  - Scoped shell/Git/plan/question/todo guards and separately opt-in bounded idle continuation.
18
19
  - Optional external `ocmm-lsp mcp` integration with nine tools including atomic `format`. Debugging/DAP is an on-demand skill, not additional LSP tools or automatic prompt injection.
19
20
 
@@ -25,14 +26,16 @@ Durable session metadata requires explicit deployment-only `sessionPersistence:
25
26
 
26
27
  ## Install and configure
27
28
 
28
- Install the exact registry version after terminal verified publication with `dsh plugin --profile <profile> add @dsmm/dsmm@0.1.5`. For isolated development verification, use a built and packed artifact:
29
+ Install the exact registry version after terminal verified publication with `dsh plugin --profile <profile> add @dsmm/dsmm@0.1.7`. For isolated development verification, use a built and packed artifact:
30
+
31
+ Desktop and CLI/TUI have independent native deployment profiles. Installing into `desktop` does not install into `dsh-tui`. The existing official CLI/TUI `@dsmm/dsmm@0.1.6` installation is already verified and enabled with `defaultActive: true`; it is not unfinished rollout work and this Desktop upgrade does not repeat TUI setup. For a separately authorized future TUI upgrade after 0.1.7 terminal completion, the exact-version command is `dsh plugin --profile dsh-tui add @dsmm/dsmm@0.1.7 --save-exact`. Launch with `dsh --profile dsh-tui` (or the TUI launcher); a bare `dsh` does not select the Desktop profile. Keep the existing TUI bundle, provider, model, effort and environment-based preset/resume settings. Do not copy Desktop credentials or providers. When enabling durable Deepwork metadata, also follow the single-provider [persistence startup procedure](docs/compatibility.md#session-persistence-compatibility), preserving the existing root and compression. Merely adding the package does not activate Deepwork.
29
32
 
30
33
  ```powershell
31
34
  pnpm --dir dsmm build
32
35
  pnpm --dir dsmm pack --pack-destination <temporary-artifact-directory>
33
36
  $env:DSH_HOME = "<disposable-test-home>"
34
37
  dsh --profile <profile> --from-default-profile headless --dump-config
35
- dsh plugin --profile <profile> add <absolute-path-to-dsmm-dsmm-0.1.5.tgz>
38
+ dsh plugin --profile <profile> add <absolute-path-to-dsmm-dsmm-0.1.7.tgz>
36
39
  dsh --profile <profile> --dump-config
37
40
  ```
38
41
 
@@ -54,9 +57,9 @@ This runtime-baseline example is not the full durable-persistence patch. Native
54
57
 
55
58
  Do not copy the old `settings.yaml` namespace or preset-discovery roots into the new host. Runtime drafts instead live at `<profileContext.dir>/dsmm-profiles/<id>.jsonc`; there is no embedded profiles object in plugin config. See [runtime profiles](docs/profiles.md), [settings/status](docs/settings-status.md), and [agent roles](docs/agent-presets.md).
56
59
 
57
- The [historical 0.1.1 migration guide](docs/migration-from-ocmm.md) explains the earlier ocmm/DSH adapter migration; use the current profile and upgrade guides above for 0.1.5 behavior.
60
+ The [historical 0.1.1 migration guide](docs/migration-from-ocmm.md) explains the earlier ocmm/DSH adapter migration; use the current profile and upgrade guides above for 0.1.7 behavior.
58
61
 
59
- For a role-specific model, configure `roleRouting.dsmm-reviewer.primary` with native `provider`, `model`, and optional `reasoningEffort`, then choose its strategy/retry policy where needed. There are no built-in provider routes or API keys. See [model routing](docs/model-routing.md) and [runtime recovery](docs/runtime-recovery.md) for admission, bounded RATE_LIMIT rollover and migration from old generic automatic fallback.
62
+ For a delegated-role model, configure `roleRouting.dsmm-reviewer.primary` with native `provider`, `model`, and optional `reasoningEffort`, then choose its strategy/retry policy where needed. These policies do not silently replace the ordinary root's native model; using a profile's main-model choice is an explicit user action. There are no built-in provider routes or API keys. See [model routing](docs/model-routing.md) and [runtime recovery](docs/runtime-recovery.md) for admission, bounded RATE_LIMIT rollover and migration from old generic automatic fallback.
60
63
 
61
64
  Without active mode or a selected DSMM Agent preset, DSMM workflow prompts and default-scoped guards do not apply. Applying a runtime profile does not select a role. Global Apply leaves existing live Agents, including blank Agents, unchanged. A separate current-session Apply reserves native idle maintenance and changes only that root's admission epoch; old children stay old, later native children inherit the new snapshot. Cold resume honors an explicit session sidecar, otherwise the current global default. Headless task text is not a slash-command adapter.
62
65
 
@@ -69,7 +72,7 @@ pnpm --dir dsmm check:release
69
72
  pnpm --dir dsmm smoke:docker
70
73
  ```
71
74
 
72
- A separately authorized credentialed, packed real-model diagnostic is also available from this checkout. It is **not** the independent 0.1.5 Docker/UI release gate; that gate must not copy credentials, sessions, Desktop configuration or browser authentication:
75
+ A separately authorized credentialed, packed real-model diagnostic is also available from this checkout. It is **not** the independent 0.1.7 Docker/UI release gate; that gate must not copy credentials, sessions, Desktop configuration or browser authentication:
73
76
 
74
77
  ```powershell
75
78
  node dsmm/scripts/live-dsh-smoke.mjs --runtime <npm-prefix-with-pinned-dsh> --package <packed-dsmm.tgz> --provider deepseek-account --credentials <existing-dsh-credentials-file> --receipt <sanitized-receipt.json>
@@ -79,4 +82,4 @@ Add `--delegate` to verify the actual `dsmm_reviewer` child persona, inherited F
79
82
 
80
83
  The test copies only native account records into a temporary home, verifies a real read/write/model round-trip, checks the exact route and DSMM prompt, and removes temporary credentials and sessions. It does not print reasoning or credentials, log into a browser, modify the original credential file, or silently use a different model. API-key testing uses `--provider deepseek-official` and an existing `DEEPSEEK_API_KEY` environment variable.
81
84
 
82
- These commands are verification procedures, not a claim they have passed for the final 0.1.5 artifact. The dedicated DSMM workflow builds a fresh CI tarball with pnpm, Docker-gates its exact bytes, and publishes through OIDC with genuine provenance; the old 0.1.2 bootstrap is not used. See [compatibility](docs/compatibility.md) and [release policy](docs/releasing.md) for terminal publication and later Desktop evidence boundaries.
85
+ These commands are verification procedures, not a claim they have passed for the final 0.1.7 artifact. The dedicated DSMM workflow builds a fresh CI tarball with pnpm, Docker-gates its exact bytes, and publishes through OIDC with genuine provenance; the old 0.1.2 bootstrap is not used. See [compatibility](docs/compatibility.md) and [release policy](docs/releasing.md) for terminal publication and later Desktop evidence boundaries.
@@ -1,8 +1,8 @@
1
- # Deepwork 0.1.5 Compatibility and Upgrade
1
+ # Deepwork 0.1.7 Compatibility and Upgrade
2
2
 
3
- This document describes the 0.1.5 source contract and required acceptance evidence. It does not claim that the final 0.1.5 artifact has passed Docker, been published, or been activated in Desktop. Historical 0.1.1 checks and the stopped 0.1.2 frozen draft are not substitute evidence for this update; the old 0.1.2 tag/artifact/draft stay untouched and unpublished.
3
+ This document describes the 0.1.7 source contract and required acceptance evidence. It does not claim that the final 0.1.7 artifact has passed Docker, been published, or been activated in Desktop. Completed 0.1.5 and 0.1.6 publication/continuation evidence stays immutable and does not prove 0.1.7. Historical 0.1.1 checks and the stopped 0.1.2 frozen draft are not substitute evidence for this update; the old 0.1.2 tag/artifact/draft stay untouched and unpublished.
4
4
 
5
- The immutable 0.1.3 tag at `2bdea4b` is also preserved. Its run `37235817488` failed before pack/publish on pnpm 11's ignored esbuild/koffi build scripts. 0.1.4's published-origin bytes and failed original verify/404 history are preserved by their separate fixed continuation controls, not rewritten by 0.1.5. The 0.1.5 gate requires fresh clean Linux installation/build evidence; existing compiled output is not a substitute.
5
+ The immutable 0.1.3 tag at `2bdea4b` is also preserved. Its run `37235817488` failed before pack/publish on pnpm 11's ignored esbuild/koffi build scripts. 0.1.4's published-origin bytes and failed original verify/404 history are preserved by their separate fixed continuation controls, not rewritten by a successor. The 0.1.7 gate requires fresh clean Linux installation/build evidence; existing compiled output is not a substitute.
6
6
 
7
7
  Deepwork is the native plugin title in both exported metadata locales, with localized descriptions. Profiles are displayed as **Deepwork Profiles** / **Deepwork 配置档**, and twelve roles as `DW …`. Package `@dsmm/dsmm`, Loader `dsmm`, role/tool/provider IDs, commands, schemas and persistence vocabulary remain compatible. Native metadata-reader and actual UI evidence must prove the display names; a manifest `displayName` is not a supported substitute.
8
8
 
@@ -27,7 +27,7 @@ The installation contracts include `@deepseek-ai/cordis@~4.0.4`, `@deepseek-ai/s
27
27
  | macOS | `Node >=22` | supported by contract |
28
28
  | Native Settings | additive Deepwork Profiles client and authenticated RPC | compiled UI/RPC/storage and actual Desktop are separate proofs |
29
29
  | Headless | deployment config and native role tools | no Agent preset selection in the one-shot runner |
30
- | TUI | `DSH 0.2.0-rc.2` | unavailable |
30
+ | TUI | `DSH 0.2.0-rc.2` | existing official 0.1.6 CLI/TUI installation verified; new 0.1.7 menu proof is Web/Desktop only |
31
31
  | LSP/MCP | `external ocmm-lsp mcp` | optional |
32
32
  | Runtime recovery | `process-local` | optional |
33
33
  | Per-role model/effort/fallback policy | native request, subagent and descriptor seams | opt-in; exact configured capability required |
@@ -40,13 +40,15 @@ The installation contracts include `@deepseek-ai/cordis@~4.0.4`, `@deepseek-ai/s
40
40
 
41
41
  `/deepwork` and `/dsmm-status` are host-adapter commands, not headless task-text commands. The current native client provides Settings → Deepwork Profiles without replacing native navigation, provider/account UI, or the Agent preset selector. There are no model-visible profile-management tools or anonymous file endpoints.
42
42
 
43
+ The 0.1.7 Web/Desktop header contributes one icon-only native profile menu in sessionless, blank and active views, yielding to native navigation ownership. Normal selection keeps the current model; only the distinct explicit profile-model action requests native model selection after successful profile CAS. Disabled mutations leave the menu inspectable and refreshable. Safe refusal details use allowlisted codes/fields and refresh/retry guidance, never raw messages or paths. These are required new-menu contracts, not a claim of authenticated Desktop acceptance; the historical 0.1.6 SELECT proof remains unchanged.
44
+
43
45
  Headless uses profile `cordis.patch.yml` plus `--dump-config`; real task execution requires a separately configured provider and uses `dsmm.defaultActive: true`. Old `$DSH_HOME/settings.yaml` namespaces must be migrated explicitly; DSMM does not mutate that file.
44
46
 
45
47
  The old directory discovery `roots/includeUserRoot` no longer configures the native preset registry. DSMM registers only enabled `primary`/`all` roots: Orchestrator, Builder and Planner. Disabled Builder is absent from both selector and child tools. The other nine roles remain auxiliary delegation roles; all twelve static `agent-presets/` directories are inspection templates, not scan roots. The loading correction is native `persona.prefix` plus instructions `maxBytes: 65536`.
46
48
 
47
49
  DSH's headless one-shot runner does not select or compose Agent presets: headless role delegation must use native role tools, not a registry default. Native preset selection must be tested through a preset-capable host with a blank session. The managed preset-directory materializer remains an opt-in export facility, not discovery evidence.
48
50
 
49
- Trusted live, owned, zero-prefix native one-shot children preserve supported explicit provider/model/effort overrides through final request headers. The role primary supplies alias defaults; it is not an unconditional child override. Roots, cold/unowned children and parent-seeded forks retain profile-primary resolution. `modelSelectionSettings:false` and native tool/permission/depth/cancellation limits are unchanged; this adds no model-visible model-selection authority. See [model routing](model-routing.md).
51
+ Trusted live, owned, zero-prefix native one-shot children preserve supported explicit provider/model/effort overrides through final request headers. The role primary supplies alias defaults; it is not an unconditional child override. Ordinary roots preserve their native initial and explicit provider/model/exact effort rather than profile-primary resolution, including later turns, profile reapply and cold resume. Delegated-child policies retain their separate ownership and request-preflight restrictions. `modelSelectionSettings:false` and native tool/permission/depth/cancellation limits are unchanged; this adds no model-visible model-selection authority. See [model routing](model-routing.md).
50
52
 
51
53
  ## Session persistence compatibility
52
54
 
@@ -93,7 +95,7 @@ Global/system Desktop migration is the **third phase**: independent frozen-artif
93
95
 
94
96
  The Linux packed-lifecycle smoke pins pnpm `12.8.1` and retains DSH's native `nodeLinker: hoisted` profile layout. On Linux Node 22, pnpm `11.9.0` with that layout and DSMM's auto-installed peer graph can print `Done` after removal without exiting; the same failure was reproduced directly without DSH, while `12.8.1` returned normally. A printed `Done` is not uninstall completion. This does not claim the same failure on Windows or modify a user's existing package manager or profile. The smoke enforces a bounded fail-closed timeout and checks actual remove/reinstall exits and profile state.
95
97
 
96
- The matrix separates required 0.1.5 evidence from historical CLI/configuration, source-contract and credentialed model evidence. A version string or unit test alone establishes neither native preset health nor UI/runtime behavior. Windows, Linux, Web, and macOS evidence are not interchangeable.
98
+ The matrix separates required 0.1.7 evidence from historical CLI/configuration, source-contract and credentialed model evidence. A version string or unit test alone establishes neither native preset health nor UI/runtime behavior. Windows, Linux, Web, and macOS evidence are not interchangeable. The already verified official CLI/TUI 0.1.6 installation is not unfinished rollout work and must not be repeated as part of the new Desktop upgrade.
97
99
 
98
100
  The independent Docker gate installs the exact frozen tarball into a fresh pinned native runtime/home and verifies root selection, actual read-only child denials, aliased-parent route preflight, runtime snapshot behavior, and the **same compiled DSMM UI** using native client/slots/RPC and real profile storage. A supported composition-owned in-process operator/Gateway carrier and test-owned browser bridge provide no-credential native component/RPC/storage proof. No user login, copied cookie, launcher token, browser state, Desktop data, account records or authentication bypass is permitted. This proof is not authenticated Desktop/Web-launch proof; actual Desktop mounting and authorized operations remain the later check.
99
101
 
@@ -39,15 +39,17 @@
39
39
  enabled: false
40
40
  ```
41
41
 
42
- A `primary` supplies the default role route for directly selected roots and active top-level deepwork sessions as orchestrator when no DSMM preset is selected. An explicit public native model selection is higher priority: the user's exact provider/model/effort wins, including an effort-only change, subsequent turns and cold resume. Ordinary profile apply changes defaults, strategy and admission epoch without silently erasing that native choice. DSMM captures the typed native intent at prompt-assembly start; a concurrent later choice belongs to the next assembly, not the already assembled frame. A fresh same-value selection still fences an older retry reservation.
42
+ An ordinary top-level Agent always uses the native DSH model tab's assembled provider/model/effort, including its implicit default before the first request. Enabling Deepwork, selecting a role preset, loading a profile or switching a profile normally does not replace that selection. Root requests do not replay historical model choices, calibrate the effort or automatically switch channels/models. Bounded, positively no-output-safe rate-limit retries stay on the same native route. This applies to every top-level role, not only Orchestrator.
43
+
44
+ `primary` supplies child-role defaults and is also an advisory model for an explicit **switch profile and use its model** action. That opt-in action submits through native `session/selectModel`; native projection and the actual picker reflect the accepted result. A later model-tab choice remains authoritative. Native model selection has its ordinary background-default persistence behavior; editing profile fields, saving drafts and normal profile switches never call that endpoint. DSMM captures native intent only to fence old retry work; a concurrent later choice belongs to the next assembly, not the already assembled frame.
43
45
 
44
46
  For a trusted native one-shot role alias, `primary` is also a default rather than an unconditional overwrite of explicit native child options. That live-child exception requires genuine native parent ownership and zero inherited event prefix. Root, cold/unowned child and parent-seeded fork requests cannot claim that exception. A parent's manual native choice does not replace a configured child's own role primary; genuine child-local authority remains distinct. Unconfigured/disabled roles, unrecognized children, and out-of-scope sessions do not acquire another role's policy. Disabled-role configuration may be retained but does not create a callable role. Auxiliary role policies apply through delegation, not additional root presets.
45
47
 
46
48
  Settings resolve from built-in defaults, then deployment configuration, then the admitted immutable runtime revision. Global profile apply affects newly created unscoped Agents only; explicit idle current-session apply creates a new epoch for that root and later children. Existing children retain their previous snapshot. Cold resume uses a committed session sidecar when present, otherwise the current global default. Changing a draft alone changes none of these policies; see [profiles](profiles.md). Explicit empty fallback lists remain empty instead of inheriting an omitted global chain.
47
49
 
48
- At Agent entry, native preparation chooses the primary or first resolvable configured candidate in order. This does not make a sacrificial request or claim account/network health. Missing catalog rows do not make a custom route unavailable; malformed/unsupported exact efforts remain hard errors. Apply may retain dormant unavailable alternatives when another candidate is admissible. No admissible candidate means a visible no-request refusal, never a silent native baseline.
50
+ For child Agents, native preparation chooses the primary or first resolvable configured candidate in order. This does not make a sacrificial request or claim account/network health. Missing catalog rows do not make a custom route unavailable; malformed/unsupported exact efforts remain hard errors. Apply may retain dormant unavailable alternatives when another candidate is admissible. No admissible child candidate means a visible no-request refusal, never a silent native baseline. An unrelated configured primary cannot block an ordinary root's native chosen model.
49
51
 
50
- `startup-lock` is the default, including old documents with an omitted strategy. Once admitted, it keeps the exact provider/model/effort across turns and bounded `RATE_LIMIT` retries. `rate-limit-fallback` starts identically, but distinct positively no-output-safe rate-limit failures reaching the configured threshold advance the ordered chain within finite switch/delay caps. Per-role overrides inherit only omitted fields from `runtimePolicy`; different roles and sessions never share route locks or counters. Success resets consecutive rate-limit counts. Duplicate errors do not count twice and exhausted chains never wrap to primary.
52
+ For child Agents, `startup-lock` is the default, including old documents with an omitted strategy. Once admitted, it keeps the exact provider/model/effort across turns and bounded `RATE_LIMIT` retries. `rate-limit-fallback` starts identically, but distinct positively no-output-safe rate-limit failures reaching the configured threshold advance the ordered chain within finite switch/delay caps. Per-role overrides inherit only omitted fields from `runtimePolicy`; different roles and sessions never share route locks or counters. Success resets consecutive rate-limit counts. Duplicate errors do not count twice and exhausted chains never wrap to primary. Ordinary roots retain the native model even when a child-role policy specifies fallback switching.
51
53
 
52
54
  Only an exact native `NO_ADAPTER` or adapter-proven `UNKNOWN_MODEL` failure on the first actual request, before any accepted output/tool fragment, may advance a remaining startup candidate. Later generic, transport, authorization, quota, payment, context and cancelled failures do not authorize inferred hopping. Exact rate limit is never startup unavailability. Every automatic retry or switch requires a positively correlated native attempt and its matching live/durable no-output settlement; partial text, reasoning, tool fragments or completed blocks forbid even same-route retries. See [runtime recovery](runtime-recovery.md).
53
55
 
@@ -63,7 +65,7 @@ On DSH 0.2.0-rc.2, durable custom metadata requires explicit deployment-only `se
63
65
 
64
66
  ## Legacy exact-route calibration
65
67
 
66
- DSMM calibrates only exact verified routes while deepwork mode or a selected DSMM preset is in scope:
68
+ DSMM calibrates only child Agents on exact verified routes while deepwork mode or a selected DSMM preset is in scope. Ordinary roots preserve native effort without calibration:
67
69
 
68
70
  | Route | Calibration settings | Default |
69
71
  | --- | --- | --- |
package/docs/profiles.md CHANGED
@@ -1,6 +1,6 @@
1
- # Deepwork runtime profiles (0.1.5 source contract)
1
+ # Deepwork runtime profiles (0.1.7 source contract)
2
2
 
3
- This guide describes the 0.1.5 source contract. It is not evidence of a published package or completed Docker/Desktop acceptance; see [releasing](releasing.md). Deepwork is the display name; package, storage and configuration IDs retain `dsmm` for compatibility. Historical 0.1.4 release identities and continuation evidence stay immutable.
3
+ This guide describes the 0.1.7 source contract. It is not evidence of a published package or completed Docker/Desktop acceptance; see [releasing](releasing.md). Deepwork is the display name; package, storage and configuration IDs retain `dsmm` for compatibility. Historical release identities and completed 0.1.4/0.1.6 continuation evidence stay immutable.
4
4
 
5
5
  A Deepwork runtime profile is a named file containing runtime policy, not a native deployment profile or an Agent role preset. Native Settings → **Deepwork Profiles** / **Deepwork 配置档** provides create/read/edit/save, explicit apply, and reset to the deployment baseline. The native Agent preset selector remains a separate role selector, displaying `DW …` names under unchanged `dsmm-*` IDs.
6
6
 
@@ -72,6 +72,10 @@ Saving validates the draft and preserves edited raw JSONC/comments, but does not
72
72
 
73
73
  **Current-session profile / Apply profile to current session** uses the actual native view's session ID, not the profile being edited or a guessed latest session. It commits only that session's sidecar under a genuine native idle-maintenance reservation. Both the expected sidecar revision and admission epoch must still match. **Pin baseline for current session** writes an explicit baseline choice without changing the global default. Sessionless Settings cannot apply to a session; busy, maintenance-owned, disposed, replaced, child or unauthorized targets refuse visibly. Cold targets are resumed only through native session authority after backend authorization and strict decoding.
74
74
 
75
+ The Conversation header has one icon-only button opening the native Profile menu. Profile names, current selection, status, disabled reasons and refresh are shown only inside that menu, not as standalone header text. It is present on blank sessions and the sessionless welcome screen; without an actual session it is read-only and never creates a session or changes the global default. The single leading slot yields to any higher-priority native/plugin navigation owner.
76
+
77
+ Normal menu options switch only the session profile and preserve the current native model. A separately labelled opt-in group switches the profile **and uses its configured main model** through DSH's native selection endpoint, so the picker and subsequent request agree. No configured main model or a refused model selection is reported in the menu; a successfully committed profile is not falsely rolled back if the separate native model operation fails. Full editing and revisions remain in Settings. A refused profile change keeps the prior admission; refresh the menu before retrying and use its sanitized reason/field to resolve configuration errors. Refresh never applies a profile or selects a model on its own.
78
+
75
79
  Save/apply requests use expected revisions. A concurrent UI save or external file edit produces a conflict instead of overwriting later bytes; reread and reconcile. Validation, missing file, revision conflict, lock/IO, authorization, or activation failures must be visible, not reported as success. Invalid/missing/linked files and digest mismatches never silently select another profile or model. Pointer failure retains the prior disk selection and current settings; an unused immutable revision may remain.
76
80
 
77
81
  Storage uses bounded validated content, containment/link checks under a cross-process writer lock, and same-directory atomic replacement. Lock timeouts are errors; stale-looking locks are not stolen. Immutable revision files are never overwritten or hand-edited. Operations accept stable IDs, not arbitrary filesystem paths. Profile summaries do not expose credentials or deployment configuration.
@@ -80,7 +84,7 @@ Storage uses bounded validated content, containment/link checks under a cross-pr
80
84
 
81
85
  Global applying or resetting affects **new unscoped Agents only**. Every existing live Agent, including a blank one, retains its admitted immutable runtime snapshot. An explicit current-session apply is different: a truly idle ordinary root receives a new immutable admission epoch after the durable sidecar commit. Even reapplying the same revision creates a new epoch. Existing children retain their captured old epoch; later genuinely owned native children inherit the new one. Other roots, the global default, completed tools and native persona/tool/skill composition remain unchanged.
82
86
 
83
- Native model selection is separate user intent, not a profile sidecar setting. The exact public native provider/model/effort choice takes priority over the profile's role default, remains on subsequent turns/cold resume, and is not silently cleared by ordinary profile apply. An effort-only or same-value native selection is still fresh intent and fences stale retry work. Parent manual choice does not overwrite a configured child's own role route. Structured profile editing never selects the native/global model default; only the user's native selection endpoint has the host's normal background-default persistence behavior.
87
+ Native model selection is separate user intent, not a profile sidecar setting. Every ordinary top-level request respects the native assembled provider/model/effort, including an implicit default with no prior selection event. Profile primary/defaults and calibration never overwrite it. An effort-only or same-value native selection still fences stale retry work. Parent model choice does not overwrite a configured child's own role route. Structured editing, save, global apply and normal session apply never select the native/global model default. Only the explicit switch-and-use-model option invokes native model selection, with the same background-default persistence behavior as the model tab; later manual model changes remain authoritative.
84
88
 
85
89
  After restart, a session with a committed sidecar admits that exact immutable revision or explicit baseline, even if its draft/global default changed. A session without a sidecar preserves the historical global-current cold-resume behavior; it does not infer a previous profile from lineage/history. Corrupt, missing, linked or digest-mismatched sidecars/revisions fail visibly instead of falling back to baseline. Sidecars add no new session event vocabulary, so stock native history readers remain authoritative. Native clear/compact changes the session identity and does not automatically transfer an old choice.
86
90
 
package/docs/releasing.md CHANGED
@@ -1,10 +1,10 @@
1
- # Deepwork 0.1.5 Release and Rollback
1
+ # Deepwork 0.1.7 Release and Rollback
2
2
 
3
- This is a future procedure for 0.1.5, not a completed-release receipt. The new identities are `@dsmm/dsmm@0.1.5`, tag `dsmm-scoped-v0.1.5`, and `dsmm-dsmm-0.1.5.tgz`. Deepwork/DW display names do not rename package or protocol IDs. Existing 0.1.1 and older releases remain immutable. The stopped 0.1.2 tag, frozen artifact and draft Release remain untouched and unpublished: do not dispatch its bootstrap publisher, finalize its draft, overwrite its bytes or move/delete/recreate its tag.
3
+ This is a future procedure for 0.1.7, not a completed-release receipt. The new identities are `@dsmm/dsmm@0.1.7`, tag `dsmm-scoped-v0.1.7`, and `dsmm-dsmm-0.1.7.tgz`. Deepwork/DW display names do not rename package or protocol IDs. Existing 0.1.1 and older releases remain immutable. The stopped 0.1.2 tag, frozen artifact and draft Release remain untouched and unpublished: do not dispatch its bootstrap publisher, finalize its draft, overwrite its bytes or move/delete/recreate its tag.
4
4
 
5
- The `dsmm-scoped-v0.1.3` tag at `2bdea4b` is immutable too. Run `37235817488` failed **before pack/publish** because pnpm 11 ignored esbuild/koffi build scripts. Preserve that tag and its historical plan; do not reroute it to the successor. 0.1.5 must obtain its own fresh source, clean Linux build, packed bytes and receipt.
5
+ The `dsmm-scoped-v0.1.3` tag at `2bdea4b` is immutable too. Run `37235817488` failed **before pack/publish** because pnpm 11 ignored esbuild/koffi build scripts. Preserve that tag and its historical plan; do not reroute it to the successor. 0.1.7 must obtain its own fresh source, clean Linux build, packed bytes and receipt.
6
6
 
7
- The completed 0.1.4 publication and its separately authorized continuation remain historical evidence: original run `37240470628/1` and continuation `37243216939/1` are not 0.1.5 proof. Their exact fourteen UI checks and nine installed compiled-file checks remain unchanged.
7
+ The completed 0.1.4 publication and its separately authorized continuation remain historical evidence: original run `37240470628/1` and continuation `37243216939/1` are not 0.1.7 proof. Their exact fourteen UI checks and nine installed compiled-file checks remain unchanged. The completed 0.1.5 publication and completed 0.1.6 publication/continuation, immutable packages/tags/accepted bytes and their own terminal completion evidence also remain historical; do not republish them or relabel their receipts as 0.1.7 acceptance. New proof requirements are version-gated, never retroactively applied to completed identities. The 0.1.6 SELECT receipt grammar remains valid for that historical identity, not for the new native-menu proof.
8
8
 
9
9
  The mandatory sequence is **fresh CI pack → independent frozen-byte Docker acceptance → verified OIDC npm/GitHub publication and terminal completion → authorized official-carrier Desktop rollout**. No global/system DSH, Desktop configuration, account/provider, credential, or real-session writes may occur before terminal verified publication. Local readiness alone does not authorize publication or migration.
10
10
 
@@ -31,11 +31,11 @@ The root typecheck, test and build must pass before committing. Build before gen
31
31
 
32
32
  Use pnpm for actual install/build/test/**pack/publish**. The `npm pack --dry-run --json` above is only the existing read-only, size-rich metadata diagnostic, not release packaging. Do not blindly substitute pnpm's differently shaped preview JSON or fabricate missing size fields. Source-checkout Docker runs are development evidence; final acceptance must use the CI-frozen artifact and expected SHA256 without building or repacking. A checker or successful install is not runtime, UI, publication or Desktop proof.
33
33
 
34
- For 0.1.5, clean Linux install/build verification must exercise the reviewed pnpm `allowBuilds` policy for exactly `esbuild@0.25.12` and `koffi@3.1.1`, with `strictDepBuilds: true`. A cached native binary or pre-existing `lib` tree cannot establish that the ignored-script failure is repaired. This is distinct from the deliberately script-free metadata dry-run above; do not weaken that diagnostic's lifecycle-script protection or approve all dependency scripts.
34
+ For 0.1.7, clean Linux install/build verification must exercise the reviewed pnpm `allowBuilds` policy for exactly `esbuild@0.25.12` and `koffi@3.1.1`, with `strictDepBuilds: true`. A cached native binary or pre-existing `lib` tree cannot establish that the ignored-script failure is repaired. This is distinct from the deliberately script-free metadata dry-run above; do not weaken that diagnostic's lifecycle-script protection or approve all dependency scripts.
35
35
 
36
36
  ## Phase 1: frozen artifact and independent Docker gate
37
37
 
38
- Use the dedicated `.github/workflows/dsmm-release.yml` **future tag path** for the authorized `dsmm-scoped-v0.1.5` push, not the old bootstrap dispatch. Tag/version, peeled source commit, control commit and event identity must agree. CI uses pinned Node 24 / pnpm 11.9.0, checks/builds the exact source, verifies generated assets, and packs **one new actual tarball** with pnpm. Inspect `dsmm-dsmm-0.1.5.tgz`, record its actual size/SHA256/SHA1/SHA512 integrity, and freeze it. Never reuse the old 0.1.2 hash/receipt/artifact.
38
+ Use the dedicated `.github/workflows/dsmm-release.yml` **future tag path** for the authorized `dsmm-scoped-v0.1.7` push, not the old bootstrap dispatch. Tag/version, peeled source commit, control commit and event identity must agree. CI uses pinned Node 24 / pnpm 11.9.0, checks/builds the exact source, verifies generated assets, and packs **one new actual tarball** with pnpm. Inspect `dsmm-dsmm-0.1.7.tgz`, record its actual size/SHA256/SHA1/SHA512 integrity, and freeze it. Never reuse the old 0.1.2 hash/receipt/artifact or any completed successor's bytes.
39
39
 
40
40
  Run the full independent Docker runner with that **explicit artifact path and expected SHA256**, required compiled-UI hook and trusted support files. It must fail closed if required inputs are missing/mismatched and must not build, repack, or silently choose another tarball. The new completed receipt's `packedSha256` must match the fresh frozen file and its run/attempt/source identity. Only these accepted unchanged bytes may proceed to publish.
41
41
 
@@ -51,15 +51,21 @@ Successor acceptance additionally requires the compiled structured editor's nati
51
51
 
52
52
  Actual native `followup/whenIdle` requests must prove primary/first-available startup locks, finite same-route rate-limit exhaustion, threshold-ordered rollover, same-profile/different-role and different-profile isolation, first-request unavailable versus partial/later refusal, and both strategies' partial-text/tool-fragment no-retry fences. Bind each real provider call to its native request header, live attempt ID, matching durable stream and settlement; successful outputs and terminal outcomes must agree. A competing native always-retry handler must remain unused and tools must not replay. The added native model-selection scenario must invoke strict public `session/selectModel`, demonstrate a route different from the Orchestrator profile primary, exact effort-only changes and subsequent-request retention, and validate the final native headers rather than an acknowledgement alone.
53
53
 
54
- Bind the hook and all three support files explicitly: `profile-ui-harness-server.mjs`, `profile-ui-harness-browser.mjs`, and `profile-ui-harness-native.mjs`. The successor receipt's exact check and installed compiled-file inventories are version-gated; historical receipt grammars are not expanded. CI source/pack/publish/installed verification uses Node 24 / pnpm 11.9.0; the independent borrowed Docker runtime uses its recorded Node 22 / pnpm 12.8.1 environment. These are distinct evidence surfaces, not interchangeable build claims.
54
+ Ordinary roots remain native-owned in 0.1.7: their initial provider/model/exact effort remain authoritative even before any explicit model-selection event. Profile-role primary and fallback chains apply to genuinely owned delegated children, not silently to the root. Prove this with actual native request headers before and after explicit model/effort changes, profile reapply and cold resume; retain supported explicit child overrides and native read-only permissions. Startup failure evidence must identify the failed `installProfiles` child through its public parent-fiber ownership of the actual Loader entry, preserve the native failure exit, and observe absent runtime/zero request preparations/tools; never fabricate an outer Loader failure or accept a foreign failed fiber.
55
+
56
+ Exercise one icon-only native profile menu in sessionless, blank and active native conversation views. Normal profile switching keeps the current model and native model default unchanged, with zero `session/selectModel` calls. The distinct explicit “Switch and use profile model” action calls native `session/selectModel` only after successful profile CAS and has the same native-default persistence consequence as the Models tab. Missing profile primary, unconfirmed model changes or a newer native choice must produce truthful feedback without undoing a committed profile or silently overriding the newer choice. Global-default Apply and draft Save retain their separate scopes. Owned component/endpoint proof does not establish authenticated Desktop or production model-picker interaction; retain explicit nonclaims for any unexercised surface.
57
+
58
+ The trusted artifact version alone chooses historical 0.1.6 SELECT proof versus 0.1.7 native-menu proof; later versions require an explicitly reviewed proof contract. Reject a relabelled old receipt, SELECT-only/old-slot evidence, missing states or mismatched digest/version; retain every native request/header/projection, CAS-ordering, race, busy, partial-model-failure, no-model and cleanup check. Use the installed native `Menu` through pointer and keyboard open/close/focus/arrow actions and refresh/session withdrawal. At widths 375, 768 and 1280, require one visible icon trigger, zero header SELECTs, bounded focus/header geometry, readable long labels/status in a viewport-contained portal, and sessionless/blank coverage before any request. Pending CAS and refusals preserve admission/model and show only allowlisted codes/fields with refresh/retry guidance, never arbitrary wire messages, provider/credential identifiers or paths.
59
+
60
+ Bind the hook and every trusted support module explicitly, including `profile-ui-harness-server.mjs`, `profile-ui-harness-browser.mjs`, `profile-ui-harness-native.mjs` and the `native-picker-{harness,browser,proof}.mjs` modules. The successor receipt's exact check and installed compiled-file inventories are version-gated; historical receipt grammars are not expanded. CI source/pack/publish/installed verification uses Node 24 / pnpm 11.9.0; the independent borrowed Docker runtime uses its recorded Node 22 / pnpm 12.8.1 environment. These are distinct evidence surfaces, not interchangeable build claims. Use supported native artifact installation and normal public dependency provisioning in owned Docker homes; offline exploratory A–F startup limitations are not the final gate or native browser proof.
55
61
 
56
62
  The native component/RPC/storage test uses a supported composition-owned in-process carrier, not an anonymous production route or copied login. It is distinct from authenticated Desktop activation. Preserve sanitized scenario evidence and inspect the full intended diff before parent-owned authorized release operations. If any required scenario fails or the frozen bytes change, stop before publication/global migration.
57
63
 
58
64
  ## Phase 2: authorized immutable publication
59
65
 
60
- Publication requires explicit authorization for the new identity. Recheck `@dsmm/dsmm@0.1.5` and `dsmm-scoped-v0.1.5` are absent. Confirm the one-time npm Trusted Publisher registration for repository `hugefiver/ocmm`, workflow filename `dsmm-release.yml`, with direct publish allowed. If supported setup/MFA is still missing, request that step; do not add a static token fallback or recurring manual release gate. The main ocmm workflow/checker does not cover DSMM: its dedicated workflow and DSMM terminal checker do.
66
+ Publication requires explicit authorization for the new identity. Recheck `@dsmm/dsmm@0.1.7` and `dsmm-scoped-v0.1.7` are absent. Confirm the one-time npm Trusted Publisher registration for repository `hugefiver/ocmm`, workflow filename `dsmm-release.yml`, with direct publish allowed. If supported setup/MFA is still missing, request that step; do not add a static token fallback or recurring manual release gate. The main ocmm workflow/checker does not cover DSMM: its dedicated workflow and DSMM terminal checker do.
61
67
 
62
- The earlier unscoped `dsmm-v0.1.0` GitHub release, scoped 0.1.0 release and scoped 0.1.1 release stay intact. A new-release authorization covers ordinary commit/push/tag/npm/GitHub actions for 0.1.5 only, not rewriting prior publications, the old 0.1.2 draft, app upgrades, global package-manager changes or authentication workarounds.
68
+ The earlier unscoped `dsmm-v0.1.0` GitHub release, scoped 0.1.0 release and scoped 0.1.1 release stay intact. A new-release authorization covers ordinary parent-owned commit/push/tag/npm/GitHub actions for 0.1.7 only, not rewriting prior publications, the old 0.1.2 draft, app upgrades, global package-manager changes or authentication workarounds. The separately authorized official-carrier Desktop DSMM upgrade still waits for terminal completion of this exact new identity; the already verified official CLI/TUI 0.1.6 installation is not unfinished rollout work.
63
69
 
64
70
  The future publish job revalidates the accepted run/attempt-bound bytes and publishes **that exact tarball with native pnpm**, public npmjs access, lifecycle scripts ignored, OIDC and genuine provenance enabled. Do not forge GitHub identity variables, use the old bootstrap's `provenance=false`, or repack after acceptance. Preserve non-canceling package-wide publication concurrency and least-permission separated jobs. Registry byte/integrity and fresh installed-package verification precede non-overwriting public GitHub finalization with the same tarball and `SHA256SUMS.txt`.
65
71
 
@@ -73,22 +79,38 @@ After the matching workflow terminates, run `scripts/check-dsmm-release-completi
73
79
 
74
80
  ```powershell
75
81
  $env:DSH_HOME = "<fresh-task-owned-verification-home>"
76
- dsh --profile dsmm-0.1.5-verify --from-default-profile headless --dump-config
77
- dsh plugin --profile dsmm-0.1.5-verify add @dsmm/dsmm@0.1.5
78
- dsh plugin --profile dsmm-0.1.5-verify list
79
- dsh --profile dsmm-0.1.5-verify --dump-config
80
- npm view @dsmm/dsmm@0.1.5 dist.integrity --registry "https://registry.npmjs.org/"
82
+ dsh --profile dsmm-0.1.7-verify --from-default-profile headless --dump-config
83
+ dsh plugin --profile dsmm-0.1.7-verify add @dsmm/dsmm@0.1.7
84
+ dsh plugin --profile dsmm-0.1.7-verify list
85
+ dsh --profile dsmm-0.1.7-verify --dump-config
86
+ npm view @dsmm/dsmm@0.1.7 dist.integrity --registry "https://registry.npmjs.org/"
87
+ ```
88
+
89
+ ### Published 0.1.6 continuation (separately authorized)
90
+
91
+ Historical audit reference only: this completed 0.1.6 publication/continuation remains immutable. Do not dispatch it again, republish its package or substitute its completion for the prospective 0.1.7 gate. The preserved identities and original failed history below belong only to 0.1.6.
92
+
93
+ The original `dsmm-scoped-v0.1.6` publication run `37281521750/1` published the immutable npm bytes but failed its verify job; its GitHub Release job was skipped. Preserve that failed history, original source/tag at `d2e499b3a61ef76033d417efbec3402a4739a8fe`, and original npm provenance. Supplemental verification does not rerun that workflow or republish npm.
94
+
95
+ Only the dedicated no-input `.github/workflows/dsmm-published-continuation-016.yml` may continue this separately authorized identity. Its fixed `--origin-version 0.1.6` policy binds accepted artifact `11332299033`, archive size `359262`, archive digest `sha256:3fedc92c35a88f0a75fdfc6ac8ef9a37ef138d902e5698f90ac969f66f6f4eb9`, and tarball SHA256 `b7b36fc69e892fb22b06a2428d360181d33bd95526ee2bc403c04b6307ed6c35`. The two jobs independently reload original acceptance and verify current registry bytes/provenance plus a fresh isolated Linux/Node 24 native install, then create/finalize only the missing original-byte GitHub Release. Any existing public Release or partial draft stops without adoption, repair, overwrite or deletion. No source pack/build, npm publisher/OIDC, tag mutation, full-workflow rerun or global install belongs to this continuation.
96
+
97
+ After the dedicated run terminates, use its actual run/attempt/control SHA and a new receipt path:
98
+
99
+ ```powershell
100
+ node scripts/check-dsmm-release-completion.mjs terminal-continuation --origin-version 0.1.6 --run-id <actual-continuation-run> --run-attempt <actual-attempt> --control-sha <trusted-continuation-control-sha> --receipt <new-016-continuation-receipt.json>
81
101
  ```
82
102
 
103
+ Only exit `0` with `COMPLETED` establishes that historical two-run terminal proof for 0.1.6, not permission for the new 0.1.7 rollout below. A green supplemental run alone is insufficient; `FAILED`/`UNRESOLVED` preserve immutable partial state. The omitted-selector APIs/CLI and old continuation workflow remain fixed to historical 0.1.4; neither that receipt nor its archive/provenance can establish 0.1.6 completion.
104
+
83
105
  ## Phase 3: official installed-carrier Desktop rollout
84
106
 
85
- Only after terminal 0.1.5 completion may authorized global migration begin. First perform the separately bounded isolated real-model/tool check against the exact registry package. Coordinate a fully quit Desktop, recheck concurrent edits, and preserve a recoverable local snapshot of only task-changed package-manager/DSMM-owned files—not the entire credential or session store. Use the exact installed official Desktop carrier to install `@dsmm/dsmm@0.1.5`. It may manage packages while the app is quit; it may **not** boot/dump the reserved Desktop profile. Never substitute standalone npm DSH, a renamed/copied profile, checkout imports, `app.asar` patches, global PATH/pnpm changes, or auth bypasses.
107
+ Only after terminal 0.1.7 completion may authorized global migration begin. First perform the separately bounded isolated real-model/tool check against the exact registry package. Coordinate a fully quit Desktop, recheck concurrent edits, and preserve a recoverable local snapshot of only task-changed package-manager/DSMM-owned files—not the entire credential or session store. Use the exact installed official Desktop carrier to install `@dsmm/dsmm@0.1.7`. It may manage packages while the app is quit; it may **not** boot/dump the reserved Desktop profile. Never substitute standalone npm DSH, a renamed/copied profile, checkout imports, `app.asar` patches, global PATH/pnpm changes, or auth bypasses. Preserve the enabled state and do not repeat unrelated CLI/TUI installation.
86
108
 
87
109
  Preserve base/web bundles, deployment roles/skills, all configured policies, disabled Builder, active mode, provider/model catalog, account state and UI preferences. Saving supported baseline settings as a runtime draft is explicit and reversible; it does not change structural configuration. Disclose committed-sidecar versus absent-sidecar cold resume and the unknown removed auxiliary-root ID limitation in [compatibility](compatibility.md) before rollout. Do not silently substitute personas or delete history.
88
110
 
89
111
  Any old unmarked-log repair remains a separately authorized exact private target, native-lease-held, same-directory backup-first, metadata-only operation with concurrency checks and actual installed-reader parity. The naming release does not itself authorize session edits, and an old observed digest is not permission to overwrite newer history.
90
112
 
91
- After a supported restart, verify actual Desktop package 0.1.5 activation, native Deepwork metadata, healthy selectable DW root names, retained auxiliary delegation/read-only denial, and actual Deepwork Profiles UI create/edit/save/apply/reset with independent file/pointer bytes. Verify live even-blank Agents remain unchanged on apply and current pinned selection persists across restart. Check unrelated deployment/provider/account/UI state remained intact. If authenticated native Desktop behavior cannot be observed, report that pending boundary; disk files, native metadata reads, headless tests and Docker component proof alone are insufficient for complete integration.
113
+ After a supported restart, verify actual Desktop package 0.1.7 activation, native Deepwork metadata, healthy selectable DW root names, retained auxiliary delegation/read-only denial, and actual Deepwork Profiles UI create/edit/save/apply/reset with independent file/pointer bytes. Verify live even-blank Agents remain unchanged on global Apply and current pinned selection persists across restart. Check one icon-only native profile menu in sessionless, blank and active views, safe refusal feedback and explicit model/effort authority, including normal profile switching versus explicit switch-and-use-model. Check unrelated deployment/provider/account/UI state remained intact. If authenticated native Desktop behavior cannot be observed, report that pending boundary; disk files, native metadata reads, headless tests and Docker component proof alone are insufficient for complete integration.
92
114
 
93
115
  ## Rollback
94
116
 
@@ -4,7 +4,9 @@
4
4
 
5
5
  Every enabled DSMM role in each profile independently selects `startup-lock` (default) or `rate-limit-fallback`. Optional `runtimePolicy` supplies inherited defaults; a role's `strategy` / `rateLimit` overrides only explicit fields. Different profiles can assign different strategies to the same role. No profile contains native account/auth configuration.
6
6
 
7
- Native preparation admits the primary or first resolvable ordered candidate without sending a sacrificial completion. Catalog listing is advisory, not account/network health. `startup-lock` then retains that exact route/effort across turns and bounded RATE_LIMIT retries. `rate-limit-fallback` may advance the ordered chain after its threshold of distinct safe RATE_LIMIT failures. Success resets consecutive counts; duplicate delivery does not count twice and exhausted chains never wrap.
7
+ For child Agents, native preparation admits the primary or first resolvable ordered candidate without sending a sacrificial completion. Catalog listing is advisory, not account/network health. `startup-lock` then retains that exact route/effort across turns and bounded RATE_LIMIT retries. `rate-limit-fallback` may advance the ordered chain after its threshold of distinct safe RATE_LIMIT failures. Success resets consecutive counts; duplicate delivery does not count twice and exhausted chains never wrap.
8
+
9
+ Ordinary top-level Agents always honor the native model tab's assembled provider/model/effort, even before a first explicit selection event. Their finite, positively no-output-safe RATE_LIMIT retries stay on that route; role/global primary and fallback chains do not automatically replace it. Roots are never legacy-calibrated. Switching a profile normally preserves the native model; only the explicit switch-and-use-profile-model action submits a native model selection and updates the picker.
8
10
 
9
11
  | Policy field | Default | Strict integer bound |
10
12
  | --- | --- | --- |
@@ -42,13 +42,13 @@ Risk-based behavior scales discovery, planning, and review to uncertainty and in
42
42
 
43
43
  ## Other settings
44
44
 
45
- `roleRouting` defaults to an empty map. Each canonical role accepts optional `primary`, ordered `fallbackRoutes`, `strategy` and bounded `rateLimit` fields. Profile-level `runtimePolicy` supplies inherited strategy/retry defaults. Startup lock is the default; rate-limit rollover is explicit per role. Native catalog/form controls edit JSONC paths without changing native global model defaults. The deployment-only `roles` enable map remains separate. Unknown keys/malformed routes fail; omitted and explicit empty chains differ. See [model routing](model-routing.md) and [runtime recovery](runtime-recovery.md).
45
+ `roleRouting` defaults to an empty map. Each canonical role accepts optional `primary`, ordered `fallbackRoutes`, `strategy` and bounded `rateLimit` fields. Profile-level `runtimePolicy` supplies inherited strategy/retry defaults. Child Agents use their configured startup lock or explicit per-role rate-limit rollover. Ordinary top-level Agents instead preserve the native model tab's exact model/effort and only retry on that same route. Native catalog/form controls edit JSONC paths without changing native global model defaults. Only the explicit header option to switch a profile and use its model invokes native model selection; a normal profile switch does not. The deployment-only `roles` enable map remains separate. Unknown keys/malformed routes fail; omitted and explicit empty chains differ. See [model routing](model-routing.md) and [runtime recovery](runtime-recovery.md).
46
46
 
47
47
  The public schema and exported `DEFAULT_DSMM_SETTINGS` are the complete defaults. Seven core skill toggles and all twelve role toggles default on; effective application is scoped to active mode or a selected DSMM role, not global task policy. Managed preset-directory materialization remains off by default and is an export facility rather than native discovery.
48
48
 
49
49
  Runtime overlays allow only `defaultActive`, `roleRouting`, `runtimePolicy`, `workflow`, `guards`, `runtimeRecovery`, and both `deepseekV4Pro*`/`deepseekFlash*` Calibration, DefaultReasoningEffort and MaxReasoningPresets fields. `roles`, `skills`, `modeName`, `promptOrder`, `section`, `presets`, `lsp`, `sessionPersistence`, native provider/account/install controls, embedded profiles and unknown fields are rejected. Defaults resolve before deployment settings, then the admitted immutable overlay. A missing global selection leaves the deployment baseline unchanged.
50
50
 
51
- Existing `deepseekV4ProCalibration`, `deepseekV4ProDefaultReasoningEffort`, and `deepseekV4ProMaxReasoningPresets` remain compatible. Flash has independent corresponding `deepseekFlash*` settings; calibration modes are off/auto/strict. Auto preserves explicit effort, strict chooses supported policy effort, and unsupported capabilities never justify guessed parameters.
51
+ Existing `deepseekV4ProCalibration`, `deepseekV4ProDefaultReasoningEffort`, and `deepseekV4ProMaxReasoningPresets` remain compatible for child Agents. Flash has independent corresponding `deepseekFlash*` settings; calibration modes are off/auto/strict. Auto preserves explicit effort, strict chooses supported policy effort, and unsupported capabilities never justify guessed parameters. Ordinary root effort is always native-owned, including when a calibration setting says strict.
52
52
 
53
53
  Guard scope defaults to `deepwork-or-dsmm-agent`; shell safety and helpers remain enabled and Git writes require host approval. LSP and runtime recovery default off. Recovery caps are finite; an empty fallback list does not enable automatic model discovery or substitution.
54
54
 
@@ -60,4 +60,6 @@ Status does not perform capability/network queries, expose credentials or provid
60
60
 
61
61
  Configured role policy/chain and the actual persisted current route are distinct facts. The normalized settings snapshot defensively copies nested role routes and lists; configuration presence is not a claim of successful provider authentication or a completed fallback.
62
62
 
63
+ For ordinary roots, effective status reports `startup-lock`, no applied profile primary/fallback chain, and reasoning action `native-owned`. The original child-role configuration remains available under `effectiveSettings`; it is not falsely presented as an automatic main-model override. `profileModel` in a session-profile response is only the declared model for an explicit user action, never proof that the native model has already changed.
64
+
63
65
  Status describes the receiving Agent's admitted profile/revision/epoch, resolved strategy/retry policy and actual route state separately from future global defaults. Settings and the header selector display those scopes distinctly; a global change can intentionally differ from a live Agent. `--dump-config` shows deployment composition, not proof of runtime-profile application or authenticated UI behavior.
@@ -4,6 +4,7 @@ type Injected = ProfilesActions & {
4
4
  hooks: {
5
5
  profiles: ProfilesController["store"];
6
6
  };
7
+ readProfileView: ProfilesController["store"]["getSnapshot"];
7
8
  };
8
9
  export type SessionProfilesProps = InjectFace<Injected> & PropsLocale<"settings.dsmm-profiles"> & {
9
10
  sessionId?: string;
@@ -13,7 +14,7 @@ export declare function SessionScope({ state, actions, t, compact }: PropsLocale
13
14
  actions: ProfilesActions;
14
15
  compact?: boolean;
15
16
  }): import("react").JSX.Element;
16
- /** Additive native header contribution; never operates on a different view seat. */
17
+ /** Root-scoped native menu; an explicitly scoped foreign occurrence still refuses. */
17
18
  export declare function SessionProfiles(props: SessionProfilesProps): import("react").JSX.Element | null;
18
19
  export {};
19
20
  //# sourceMappingURL=SessionProfiles.d.ts.map
@@ -1,7 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useId } from "react";
3
- import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
2
+ import { useEffect, useId, useState } from "react";
3
+ import { Button, IconBranchOutlineRegular, Menu } from "@deepseek-ai/dsh-client-ui-primitives";
4
4
  import { sessionProfileLabels } from "./session-labels.js";
5
+ const MENU_ISSUE_CODES = new Set(["validation", "conflict", "not-found", "lock-timeout", "unsafe-path", "io", "activation", "corrupt-selection", "limit", "busy", "maintenance", "disposed", "not-owned", "unavailable", "cancelled", "model-unconfigured", "model-choice-changed", "model-service-unavailable", "model-observation-unavailable", "model-selection-failed"]);
6
+ const MENU_ROLE_FIELD = /^(?:settings\.roleRouting\.)?dsmm-(?:orchestrator|planner|plan-critic|builder|reviewer|oracle|oracle-2nd|creative|code-search|doc-search|clarifier|media-reader)(?:\.(?:primary|fallbackRoutes)(?:\[[0-7]\])?(?:\.(?:provider|model|reasoningEffort))?|\.strategy|\.rateLimit(?:\.(?:maxRetries|initialDelayMs|maxDelayMs|maxTotalDelayMs|switchAfterRateLimits|maxSwitches))?)?$/u;
7
+ const MENU_COMMON_FIELD = /^(?:version|id|label|content|sessionId|expectedRevision|expectedSelectionRevision|expectedAdmissionEpoch|settings(?:\.(?:defaultActive|roleRouting|workflow|guards|runtimeRecovery|runtimePolicy))?)$/u;
8
+ function menuIssue(issue) {
9
+ const code = MENU_ISSUE_CODES.has(issue.code) ? issue.code : issue.kind === "transport" ? "transport" : "unavailable";
10
+ const field = issue.field;
11
+ // Only closed configuration grammar is displayable; never echo messages,
12
+ // arbitrary wire fields, provider identifiers, credentials or file paths.
13
+ return { code, ...(typeof field === "string" && field.length <= 128 && (MENU_ROLE_FIELD.test(field) || MENU_COMMON_FIELD.test(field)) ? { field } : {}) };
14
+ }
5
15
  export function SessionScope({ state, actions, t, compact = false }) {
6
16
  const prefix = useId();
7
17
  const session = state.session;
@@ -9,16 +19,91 @@ export function SessionScope({ state, actions, t, compact = false }) {
9
19
  const selected = state.snapshot?.profiles.find((profile) => profile.id === state.sessionChoice);
10
20
  const disabled = state.busy !== null || state.pendingEditor !== null || state.sessionBusy !== null || state.dirty;
11
21
  const allowed = session !== null && session.switchAllowed && /^[a-f0-9]{64}$|^absent$/u.test(session.selection.selectionRevision);
12
- const status = state.sessionNotice === null ? "" : t(state.sessionNotice === "applied" ? "sessionApplied" : "sessionResetDone");
13
- return _jsxs("div", { className: "dsmm-session-scope", "aria-busy": state.sessionBusy !== null, "data-dsmm-session-scope": true, children: [!compact && _jsx("h3", { children: t("sessionScope") }), state.currentSessionId === null ? _jsx("p", { className: "dsmm-hint", children: t("noSession") }) : _jsxs(_Fragment, { children: [labels !== null && _jsx("p", { "data-dsmm-session-state": true, children: labels.admitted }), labels !== null && !compact && _jsx("p", { className: "dsmm-hint", "data-dsmm-session-future-default": true, children: labels.futureDefault }), session !== null && !session.switchAllowed && _jsx("p", { className: "dsmm-hint", children: t("sessionBusy", { reason: session.switchUnavailableReason ?? "unavailable" }) }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-choice`, children: t("sessionSelect") }), _jsxs("select", { id: `${prefix}-choice`, value: state.sessionChoice ?? "", disabled: disabled || !allowed, onChange: (event) => actions.chooseSessionProfile(event.currentTarget.value || null), children: [_jsx("option", { value: "", children: t("sessionBaseline") }), state.sessionChoice !== null && selected === undefined && _jsx("option", { value: state.sessionChoice, children: state.sessionChoice }), state.snapshot?.profiles.map((profile) => _jsx("option", { value: profile.id, disabled: profile.revision === null || profile.error !== undefined, children: profile.label === undefined ? profile.id : `${profile.label} (${profile.id})` }, profile.id))] })] }), state.dirty && _jsx("p", { className: "dsmm-hint", children: t("sessionDirty") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: disabled || !allowed || (state.sessionChoice !== null && selected?.revision == null), onClick: () => { void actions.applySession(); }, children: t(state.sessionBusy === "apply" ? "sessionApplying" : "sessionApply") }), !compact && _jsx(Button, { type: "button", variant: "outline", disabled: disabled || !allowed, onClick: () => { void actions.resetSession(); }, children: t(state.sessionBusy === "reset" ? "sessionResetting" : "sessionReset") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.sessionBusy !== null || state.busy !== null || state.pendingEditor !== null, onClick: () => { void actions.refreshSession(); }, children: t("sessionRefresh") })] }), !compact && session?.rolePolicy !== undefined && _jsx("p", { "data-dsmm-session-policy": true, children: t("roleState", { route: session.rolePolicy.route === undefined ? t("inheritRoute") : `${session.rolePolicy.route.provider}/${session.rolePolicy.route.model}${session.rolePolicy.route.reasoningEffort === undefined ? "" : ` (${session.rolePolicy.route.reasoningEffort})`}`, strategy: session.rolePolicy.strategy, retries: session.rolePolicy.retries, failures: session.rolePolicy.rateLimitFailures, switches: session.rolePolicy.switches, delay: session.rolePolicy.totalDelayMs }) })] }), state.sessionIssue !== null && _jsx("p", { role: "alert", children: state.sessionIssue.code === "conflict" ? t("sessionConflict")
14
- : ["busy", "maintenance", "disposed", "not-owned"].includes(state.sessionIssue.code) ? t("sessionBusy", { reason: state.sessionIssue.code })
15
- : t(state.sessionIssue.code === "validation" ? "validation" : "sessionUnavailable") }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.sessionBusy === "read" ? t("reading") : status })] });
22
+ const status = state.sessionNotice === null ? "" : t(state.sessionNotice === "applied-with-model" ? "sessionAppliedWithModel" : state.sessionNotice === "applied" ? "sessionApplied" : "sessionResetDone");
23
+ return _jsxs("div", { className: "dsmm-session-scope", "aria-busy": state.sessionBusy !== null, "data-dsmm-session-scope": true, children: [!compact && _jsx("h3", { children: t("sessionScope") }), state.currentSessionId === null ? _jsx("p", { className: "dsmm-hint", children: t("noSession") }) : _jsxs(_Fragment, { children: [labels !== null && _jsx("p", { "data-dsmm-session-state": true, children: labels.admitted }), labels !== null && !compact && _jsx("p", { className: "dsmm-hint", "data-dsmm-session-future-default": true, children: labels.futureDefault }), session !== null && !session.switchAllowed && _jsx("p", { className: "dsmm-hint", children: t("sessionBusy", { reason: session.switchUnavailableReason ?? "unavailable" }) }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-choice`, children: t("sessionSelect") }), _jsxs("select", { id: `${prefix}-choice`, value: state.sessionChoice ?? "", disabled: disabled || !allowed, onChange: (event) => actions.chooseSessionProfile(event.currentTarget.value || null), children: [_jsx("option", { value: "", children: t("sessionBaseline") }), state.sessionChoice !== null && selected === undefined && _jsx("option", { value: state.sessionChoice, children: state.sessionChoice }), state.snapshot?.profiles.map((profile) => _jsx("option", { value: profile.id, disabled: profile.revision === null || profile.error !== undefined, children: profile.label === undefined ? profile.id : `${profile.label} (${profile.id})` }, profile.id))] })] }), state.dirty && _jsx("p", { className: "dsmm-hint", children: t("sessionDirty") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: disabled || !allowed || (state.sessionChoice !== null && selected?.revision == null), onClick: () => { void actions.applySession(); }, children: t(state.sessionBusy === "apply" ? "sessionApplying" : "sessionApply") }), !compact && _jsx(Button, { type: "button", variant: "outline", disabled: disabled || !allowed, onClick: () => { void actions.resetSession(); }, children: t(state.sessionBusy === "reset" ? "sessionResetting" : "sessionReset") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.sessionBusy !== null || state.busy !== null || state.pendingEditor !== null, onClick: () => { void actions.refreshSession(); }, children: t("sessionRefresh") })] }), !compact && session?.rolePolicy !== undefined && _jsx("p", { "data-dsmm-session-policy": true, children: t("roleState", { route: session.rolePolicy.route === undefined ? t("inheritRoute") : `${session.rolePolicy.route.provider}/${session.rolePolicy.route.model}${session.rolePolicy.route.reasoningEffort === undefined ? "" : ` (${session.rolePolicy.route.reasoningEffort})`}`, strategy: session.rolePolicy.strategy, retries: session.rolePolicy.retries, failures: session.rolePolicy.rateLimitFailures, switches: session.rolePolicy.switches, delay: session.rolePolicy.totalDelayMs }) })] }), state.sessionIssue !== null && _jsx("p", { role: "alert", children: state.sessionIssue.source === "profile-model" ? t(state.sessionIssue.code === "model-unconfigured" ? "headerNoProfileModel" : state.sessionIssue.code === "model-choice-changed" ? "headerModelChoiceChanged" : "headerModelUnconfirmed")
24
+ : state.sessionIssue.code === "conflict" ? t("sessionConflict")
25
+ : ["busy", "maintenance", "disposed", "not-owned"].includes(state.sessionIssue.code) ? t("sessionBusy", { reason: state.sessionIssue.code })
26
+ : t(state.sessionIssue.code === "validation" ? "validation" : "sessionUnavailable") }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.sessionBusy === "read" ? t("reading") : status })] });
16
27
  }
17
- /** Additive native header contribution; never operates on a different view seat. */
28
+ /** Root-scoped native menu; an explicitly scoped foreign occurrence still refuses. */
18
29
  export function SessionProfiles(props) {
30
+ const prefix = useId();
19
31
  const state = props.useProfiles((snapshot) => snapshot);
20
- if (props.sessionId !== state.currentSessionId)
32
+ const id = state.currentSessionId;
33
+ const [openFor, setOpenFor] = useState(undefined);
34
+ useEffect(() => { setOpenFor(undefined); }, [id]);
35
+ if (props.sessionId !== undefined && props.sessionId !== id)
21
36
  return null;
22
- return _jsx("div", { className: "dsmm-profiles dsmm-header-profiles", children: _jsxs("details", { children: [_jsx("summary", { children: props.t("title") }), _jsx(SessionScope, { state: state, actions: props, t: props.t, compact: true })] }) });
37
+ const { t } = props;
38
+ const session = state.session;
39
+ const admission = session?.admittedSelection ?? (session?.scope === "global-default" ? undefined : session?.selection);
40
+ const unknownCaptured = session !== null && admission === undefined;
41
+ const current = session === null ? "__dsmm_session_unavailable__" : unknownCaptured ? "__dsmm_captured_default__" : admission?.selectedId ?? "";
42
+ const profiles = state.snapshot?.profiles ?? [];
43
+ const currentSaved = profiles.find((profile) => profile.id === current);
44
+ const committing = state.sessionBusy !== null;
45
+ const disabled = id === null || committing || state.busy !== null || state.pendingEditor !== null || state.dirty || state.invalidFields.length > 0
46
+ || session === null || !session.switchAllowed || state.snapshot === null;
47
+ let feedback = "";
48
+ if (state.sessionIssue !== null)
49
+ feedback = t(state.sessionIssue.source === "profile-model" ? state.sessionIssue.code === "model-unconfigured" ? "headerNoProfileModel" : state.sessionIssue.code === "model-choice-changed" ? "headerModelChoiceChanged" : "headerModelUnconfirmed"
50
+ : state.sessionIssue.code === "conflict" ? "headerConflict" : state.sessionIssue.code === "activation" ? "headerActivationRefused"
51
+ : state.sessionIssue.code === "maintenance" ? "headerMaintenanceRefused" : state.sessionIssue.code === "busy" ? "headerBusyRefused"
52
+ : state.sessionIssue.code === "cancelled" ? "headerCancelledRefused" : state.sessionIssue.code === "unavailable" || state.sessionIssue.kind === "assembly" ? "headerUnavailableRefused" : "headerSelectionRefused");
53
+ else if (committing || state.busy !== null)
54
+ feedback = t(state.sessionBusy === "apply" || state.sessionBusy === "reset" ? "headerApplying" : "headerLoading");
55
+ else if (state.dirty || state.invalidFields.length > 0 || state.pendingEditor !== null)
56
+ feedback = t("headerDraft");
57
+ else if (id === null)
58
+ feedback = t("noSession");
59
+ else if (session === null || state.snapshot === null)
60
+ feedback = t("headerUnavailable");
61
+ else if (!session.switchAllowed)
62
+ feedback = t("headerBusy");
63
+ else if (state.sessionNotice !== null)
64
+ feedback = t(state.sessionNotice === "applied-with-model" ? "headerAppliedWithModel" : "headerApplied");
65
+ const capturedSuffix = session?.scope === "global-default" && !unknownCaptured ? ` — ${t("headerCaptured")}` : "";
66
+ const profileName = unknownCaptured ? t("headerCaptured") : currentSaved?.label === undefined ? admission?.selectedId ?? t("sessionBaseline") : `${currentSaved.label} (${currentSaved.id})`;
67
+ const currentLabel = t("headerCurrentProfile", { profile: session === null ? t("headerUnavailable") : profileName + capturedSuffix });
68
+ const entries = [{ type: "label", id: "@current", text: currentLabel }];
69
+ if (id === null && state.snapshot !== null)
70
+ entries.push({ type: "label", id: "@future", text: t("sessionFutureDefault", { profile: state.snapshot.profiles.find((profile) => profile.id === state.snapshot.selectedId)?.label ?? state.snapshot.selectedId ?? t("sessionBaseline") }) });
71
+ if (feedback !== "")
72
+ entries.push({ type: "label", id: "@status", text: feedback });
73
+ const diagnostic = state.sessionIssue === null ? null : menuIssue(state.sessionIssue);
74
+ const diagnosticText = diagnostic === null ? "" : t("headerIssueCode", { code: diagnostic.code }) + (diagnostic.field === undefined ? "" : ` ${t("headerIssueField", { field: diagnostic.field })}`);
75
+ const retryHint = t(diagnostic?.code === "maintenance" || diagnostic?.code === "busy" ? "headerWaitRetryHint" : "headerRetryHint");
76
+ if (diagnostic !== null)
77
+ entries.push({ type: "label", id: "@diagnostic", text: diagnosticText }, { type: "label", id: "@retry", text: retryHint });
78
+ if (admission?.selectedId != null && currentSaved === undefined)
79
+ entries.push({ id: admission.selectedId, label: `${admission.selectedId} — ${t("headerSavedUnavailable")}${capturedSuffix}`, disabled: true });
80
+ if (unknownCaptured)
81
+ entries.push({ id: "__dsmm_captured_default__", label: t("headerCaptured"), disabled: true });
82
+ entries.push({ type: "separator", id: "@keep-separator" }, { type: "label", id: "@keep-heading", text: t("headerKeepModelGroup") }, { id: "", label: t("sessionBaseline") + (current === "" ? capturedSuffix : ""), disabled });
83
+ for (const profile of profiles)
84
+ entries.push({ id: profile.id, label: (profile.label ?? profile.id) + (profile.id === current ? capturedSuffix : "") + (profile.error === undefined && profile.revision !== null ? "" : ` — ${t("headerSavedUnavailable")}`), disabled: disabled || profile.revision === null || profile.error !== undefined });
85
+ entries.push({ type: "separator", id: "@model-separator" }, { type: "label", id: "@model-heading", text: t("headerUseModelGroup") }, { type: "label", id: "@model-hint", text: t("headerModelDefaultHint") }, { id: "@model:", label: t("sessionBaseline"), disabled });
86
+ for (const profile of profiles)
87
+ entries.push({ id: `@model:${profile.id}`, label: t("headerUseModelAction", { profile: profile.label ?? profile.id }) + (profile.error === undefined && profile.revision !== null ? "" : ` — ${t("headerSavedUnavailable")}`), disabled: disabled || profile.revision === null || profile.error !== undefined });
88
+ const open = openFor === id;
89
+ return _jsxs("div", { className: "dsmm-header-profiles", "data-dsmm-header-profile": true, "aria-busy": committing, children: [_jsx(Menu, { open: open, autoFocus: true, portal: true, align: "start", className: "dsmm-profile-anchor", listClassName: "dsmm-profile-menu", items: entries, selectedId: current, footer: [{ id: "@refresh", label: t("headerRefresh"), disabled: committing || state.busy !== null }], anchor: _jsx(Button, { type: "button", size: "sm", variant: "toolbar", className: "dsmm-profile-trigger", icon: _jsx(IconBranchOutlineRegular, {}), "aria-label": t("headerProfileLabel"), "aria-haspopup": "menu", "aria-expanded": open, "aria-describedby": `${prefix}-feedback`, onClick: () => setOpenFor(open ? undefined : id) }), onClose: () => setOpenFor(undefined), onSelect: (value) => {
90
+ if (props.readProfileView().currentSessionId !== id)
91
+ return;
92
+ if (value === "@refresh") {
93
+ if (committing || state.busy !== null)
94
+ return;
95
+ void (async () => { await props.refresh(); if (id !== null && props.readProfileView().currentSessionId === id)
96
+ await props.refreshSession(); })();
97
+ }
98
+ else {
99
+ const row = entries.find((entry) => entry.id === value && !("type" in entry));
100
+ if (row === undefined || !("disabled" in row) || row.disabled)
101
+ return;
102
+ const useProfileModel = value.startsWith("@model:");
103
+ props.chooseSessionProfile((useProfileModel ? value.slice("@model:".length) : value) || null);
104
+ void props.applySession(useProfileModel ? { useProfileModel: true } : undefined);
105
+ }
106
+ setOpenFor(undefined);
107
+ } }), _jsxs("span", { className: "dsmm-profile-announcement", id: `${prefix}-feedback`, role: state.sessionIssue === null ? "status" : "alert", "aria-live": "polite", "aria-atomic": "true", children: [feedback || currentLabel, diagnostic === null ? "" : ` ${diagnosticText} ${retryHint}`] })] });
23
108
  }
24
109
  //# sourceMappingURL=SessionProfiles.js.map