@dsmm/dsmm 0.3.10 → 0.3.12
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 +1 -1
- package/agent-presets/dsmm-builder/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-code-search/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-coding/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-complex/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-creative/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-deep/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-documenting/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-frontend/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-oracle/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-planner/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-quick/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-research/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +0 -4
- package/docs/agent-presets.md +5 -5
- package/docs/compatibility.md +10 -4
- package/docs/deferred-native-approval-risk.md +11 -1
- package/docs/design.md +15 -5
- package/docs/lsp.md +1 -1
- package/docs/model-routing.md +6 -6
- package/docs/native-permissions.md +5 -1
- package/docs/profiles.md +36 -5
- package/docs/roadmap.md +3 -3
- package/docs/runtime-recovery.md +5 -5
- package/docs/safety-guards.md +23 -5
- package/docs/settings-status.md +3 -3
- package/lib/child-capture.d.ts +9 -0
- package/lib/child-capture.js +29 -2
- package/lib/client/ProfilesSection.js +65 -13
- package/lib/client/RoleToolView-data.d.ts +4 -4
- package/lib/client/RoleToolView-data.js +3 -1
- package/lib/client/RoleToolView-locales.d.ts +7 -4
- package/lib/client/RoleToolView-locales.js +10 -6
- package/lib/client/RoleToolView.js +20 -5
- package/lib/client/SessionProfiles.d.ts +5 -1
- package/lib/client/SessionProfiles.js +13 -9
- package/lib/client/StructuredEditor.d.ts +32 -0
- package/lib/client/StructuredEditor.js +75 -23
- package/lib/client/controller.d.ts +10 -0
- package/lib/client/controller.js +44 -14
- package/lib/client/deployment-locales.js +1 -0
- package/lib/client/locales.d.ts +36 -0
- package/lib/client/locales.js +47 -17
- package/lib/client/permission-locales.js +8 -8
- package/lib/client/session-labels.js +4 -1
- package/lib/client/structured.d.ts +4 -0
- package/lib/client/structured.js +16 -1
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +19 -1
- package/lib/client.js +772 -312
- package/lib/command-approval.d.ts +50 -0
- package/lib/command-approval.js +148 -0
- package/lib/core-permissions.d.ts +2 -1
- package/lib/core-permissions.js +6 -3
- package/lib/guards.d.ts +2 -1
- package/lib/guards.js +45 -8
- package/lib/host-llm.js +3 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +5 -3
- package/lib/model-routing.d.ts +3 -2
- package/lib/model-routing.js +28 -7
- package/lib/native-admission.d.ts +2 -0
- package/lib/native-admission.js +106 -34
- package/lib/permission-control.d.ts +5 -2
- package/lib/permission-control.js +46 -24
- package/lib/permission-controller.d.ts +2 -0
- package/lib/permission-controller.js +13 -8
- package/lib/permission-native-command.d.ts +2 -0
- package/lib/permission-native-command.js +9 -4
- package/lib/permission-native-rules.d.ts +2 -2
- package/lib/permission-native-rules.js +12 -10
- package/lib/profile-diagnostics.js +1 -1
- package/lib/profile-runtime.d.ts +11 -0
- package/lib/profile-runtime.js +48 -13
- package/lib/profile-store.d.ts +4 -1
- package/lib/profile-store.js +37 -14
- package/lib/profiles.js +2 -1
- package/lib/prompt-content.js +2 -2
- package/lib/role-control-rpc.js +18 -5
- package/lib/role-llm-runtime.js +10 -1
- package/lib/role-policy.d.ts +4 -3
- package/lib/role-policy.js +6 -6
- package/lib/role-providers.js +1 -0
- package/lib/runtime-recovery.d.ts +2 -2
- package/lib/runtime-recovery.js +7 -4
- package/lib/settings.d.ts +2 -0
- package/lib/settings.js +10 -0
- package/lib/shell-command.d.ts +16 -0
- package/lib/shell-command.js +443 -119
- package/package.json +1 -1
package/docs/profiles.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Deepwork runtime profiles
|
|
2
2
|
|
|
3
|
-
DSMM 0.3.
|
|
3
|
+
DSMM 0.3.12 targets exactly DSH `0.2.1-rc.2`. See [compatibility](compatibility.md) for installation boundaries.
|
|
4
4
|
|
|
5
5
|
A named Deepwork profile is a runtime-policy document, not a native deployment profile or Agent preset. Open **Settings → Deepwork Profiles** to browse and edit it. Native **Plugins → DSMM** edits deployment layers instead, as described in [settings and status](settings-status.md).
|
|
6
6
|
|
|
@@ -10,15 +10,46 @@ A named Deepwork profile is a runtime-policy document, not a native deployment p
|
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| Draft | Unsaved JSONC in the editor, including invalid input and comments |
|
|
12
12
|
| Saved revision | Validated bytes in the named document; Save changes only these bytes |
|
|
13
|
-
| Future-default
|
|
13
|
+
| Future-default selection | A named profile ID or deployment baseline selected for subsequent activations |
|
|
14
14
|
| Current admission | The actual session's captured settings, profile revision and admission epoch |
|
|
15
15
|
|
|
16
|
-
Browsing doesn't activate anything. **Save profile** doesn't select
|
|
16
|
+
Browsing doesn't activate anything. **Save profile** doesn't select it or change a resident Agent. **Set as future default** records the named ID and an archival saved revision, never a dirty draft. Subsequent activations read that ID's latest valid saved content. **Use baseline for future sessions** clears that default without deleting documents.
|
|
17
17
|
|
|
18
18
|
**Apply profile to current session** and **Pin baseline for current session** are unavailable in this version (`canApplyOverlay:false`, `new-session-required`). Save and select a future default, then create a new session. Nothing is queued, restarted or silently applied to the current root or its children.
|
|
19
19
|
|
|
20
20
|
The compact Conversation header menu shows the current admission separately from the future default. **Use profile model** asks native model selection to use the admitted immutable configuration's declared main model, not a later saved draft. It doesn't write an overlay pointer or increment the admission epoch. Native model-default persistence follows the Models tab; newer manual model or effort intent, including same-value reselection, wins. `canSelectModel`, `canToggleMode` and `canApplyOverlay` have independent reasons: unavailable live Apply doesn't disable ordinary model selection or mode switching. Sessionless controls never create a session.
|
|
21
21
|
|
|
22
|
+
## Named profiles interface layout
|
|
23
|
+
|
|
24
|
+
The redesigned Named Profiles page (`.dsmm-profiles.dsmm-named-profiles`) organizes editing into a scannable single-column layout:
|
|
25
|
+
|
|
26
|
+
1. **Header browse row** — Select profile, New draft, and Refresh inventory buttons alongside a real-time status badge (`data-dsmm-editor-state`) tracking dirty, saved, refresh-required, and applied states.
|
|
27
|
+
2. **Effective summary card** — Visible summary of future default (with inline Set as future default button) and current session admission (with a quick-locate button targeting the session settings section).
|
|
28
|
+
3. **Secondary actions** — Collapsed disclosure containing future default reset ("新会话使用插件默认" / "Use baseline for future sessions") and current-session scope controls.
|
|
29
|
+
4. **Basic settings** — Flat, uncollapsed section in normal flow:
|
|
30
|
+
- Profile name (`label`) with optional omit action.
|
|
31
|
+
- Profile ID (`id`), locked for saved revisions.
|
|
32
|
+
- Orchestrator primary model (`roleRouting.dsmm-orchestrator.primary` only), with provider/model/effort selection and a clear notice that this primary model governs the main coordinating agent.
|
|
33
|
+
- Business output language (`settings.locale`).
|
|
34
|
+
- Deepwork default active (`settings.defaultActive`).
|
|
35
|
+
- If raw JSONC syntax is invalid, a clear notice is shown here with a button to expand and focus the JSONC source.
|
|
36
|
+
5. **Advanced settings** — Collapsed `<details>` disclosure:
|
|
37
|
+
- Role models & availability: Per-role primary route, invocation levels (`low`, `high`, `max`), and ordered fallbacks with add/remove/move actions. For `dsmm-orchestrator`, explains that the primary model is configured in Basic settings with a jump button. Switching roles preserves invalid numeric drafts and keeps saving blocked until those fields are corrected or explicitly discarded.
|
|
38
|
+
- Retry policy: Strategy selection and rate-limit numeric overrides.
|
|
39
|
+
- Profile defaults: Default strategy and rate-limit bounds.
|
|
40
|
+
- Git write protection: Sparse `settings.guards.gitWriteGuard` (`ask` | `deny` | `off`) and `settings.guards.gitWriteScope` (`all-writes` | `high-risk`). When guard is `off`, the scope control is disabled with an explanatory note ("保护已关闭,检查范围暂不生效"), while Unset/inherit remains accessible.
|
|
41
|
+
- Subagent tools: Per-role tool topology configuration.
|
|
42
|
+
6. **Advanced JSONC source editor** — Collapsed `<details className="dsmm-advanced">` disclosure:
|
|
43
|
+
- Full JSONC source editor preserving comments, whitespace, and unprojected parameters.
|
|
44
|
+
- User-triggered validation refusals expand disclosures and select the exact UTF-16 character range with reduced-motion support.
|
|
45
|
+
7. **Save bar** — In normal document flow at the bottom:
|
|
46
|
+
- Status message and blocking issues.
|
|
47
|
+
- Save button (enabled only when dirty and valid).
|
|
48
|
+
- Discard button (triggers confirmation when dirty or when invalid fields exist).
|
|
49
|
+
- Reload button (available when clean).
|
|
50
|
+
|
|
51
|
+
Discard confirmation tracks the initiating control and restores focus to that control (falling back to the profile selector) on cancellation or Escape. Blocking validation errors, read-only notices, and unavailable service reasons always remain visible in normal flow outside collapsed disclosures. Save increments the editor epoch without resetting user disclosure open/close states.
|
|
52
|
+
|
|
22
53
|
## Document format
|
|
23
54
|
|
|
24
55
|
A document contains exactly `version: 1`, a filename-matching `id`, optional `label`, and `settings`. IDs contain 1 to 64 lowercase ASCII letters, digits, hyphens or underscores, start with a letter or digit, and can't be Windows reserved names. Labels are bounded text without control characters.
|
|
@@ -73,11 +104,11 @@ Successful rename is the commit point. Admission preparation finishes before ren
|
|
|
73
104
|
|
|
74
105
|
The central store is `<resolvedDshHome>/plugins/dsmm/profiles/`, a DSMM convention. Trusted home resolution uses explicit `profileContext.home`, then `DSH_HOME`, then the official `~/.dsh` default. Shared named drafts and immutable revisions are separate from selection/session state scoped to canonical native profile identity and the actual DSMM entry ID. Reads don't create files or locks. Clients and models can't choose arbitrary roots or entry identities.
|
|
75
106
|
|
|
76
|
-
|
|
107
|
+
Selection writes retain an exclusive archival `snapshot-v1-<UUID>` file in `.revisions` and a pointer with the profile ID. Pointer identity/CAS reads do not interpret that archival snapshot. An activation resolves the selected ID's latest saved content; missing old revisions or retired runtime fields in old captures do not prevent this. Missing, unsafe or invalid current content fails explicitly, without baseline or arbitrary-profile fallback. Disk selection revisions and the actual admission's content revision/epoch are separate observations.
|
|
77
108
|
|
|
78
109
|
An old `<profileContext.dir>/dsmm-profiles` library is unsupported. It remains untouched and is not replaced by a same-name central document. Invalid, missing, linked or unstable references refuse. File/path, size, schema and session identity checks remain mandatory. There is no automatic copy, import, migration, rewrite or source deletion.
|
|
79
110
|
|
|
80
|
-
Startup freezes mounted capabilities before consumers install.
|
|
111
|
+
Startup freezes mounted capabilities before consumers install. Root reactivation preserves an explicit named ID or baseline choice; without an explicit session choice it uses the current global selection. A native continuable child uses its own trusted selection or inherits its parent's selection source, resolving latest content at activation. Current deployment/module/role restrictions and the live parent's actual authority remain ceilings. `getSettings(agent)` remains immutable for a residency. Native IDs, history and tasks survive; old grants, captures, retry state and approvals do not. Read-only observation never resumes a session.
|
|
81
112
|
|
|
82
113
|
Saving or selecting a future default never changes the native root model, remounts startup services or upgrades role permissions. Deepwork mode intent is separate: explicit off wins over DW preset defaults and doesn't remove persona/read-only policy. Live children retain their original route, locale and authority, with exact-parent checks for control; see [Agent presets and child control](agent-presets.md).
|
|
83
114
|
|
package/docs/roadmap.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Version policy
|
|
4
4
|
|
|
5
|
-
**DSMM 0.3.
|
|
5
|
+
**DSMM 0.3.12 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
|
|
|
@@ -40,7 +40,7 @@ Sessions created by DSMM `0.2.x` must remain loadable under the supported curren
|
|
|
40
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
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
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.
|
|
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.12` already fulfills them.
|
|
44
44
|
|
|
45
45
|
## Working-tree implementation: profile selection before the first message
|
|
46
46
|
|
|
@@ -95,4 +95,4 @@ Existing [Fake-IP fetch](web-fetch-fakeip.md) protections remain in force.
|
|
|
95
95
|
|
|
96
96
|
## Publication and Desktop installation
|
|
97
97
|
|
|
98
|
-
0.3.
|
|
98
|
+
0.3.12 publication uses the version-bound [release controls](releasing.md). Desktop plugin installation follows publication, uses the Desktop-owned carrier and requires exact DSH `0.2.1-rc.2`. Installation doesn't authorize upgrading the Host, changing credentials or real sessions, altering unrelated configuration, or restarting active work. An incompatible Host or required data migration blocks installation rather than expanding its scope.
|
package/docs/runtime-recovery.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Runtime recovery and route strategies
|
|
2
2
|
|
|
3
|
-
DSMM 0.3.
|
|
3
|
+
DSMM 0.3.12 targets exactly DSH `0.2.1-rc.2`.
|
|
4
4
|
|
|
5
5
|
## Independent role strategies
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ Each role may use `startup-lock` (default) or explicit `rate-limit-fallback`. `r
|
|
|
8
8
|
|
|
9
9
|
Child preparation admits the primary or first resolvable configured candidate in order without a sacrificial completion. A catalog isn't an authentication/network-health check. `startup-lock` retains the admitted route for bounded safe rate-limit retries. `rate-limit-fallback` may advance its ordered chain after the configured threshold. Success resets consecutive counts, duplicate failure delivery doesn't count twice, and exhausted chains don't wrap.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Root model and effort remain native-owned even without an explicit selection event. Role/global primaries and fallback chains never implicitly replace that route. **Use profile model** is an explicit native selection action against admitted configuration, not a retry or overlay Apply. A role child's own native selection is resolved before configured-primary preflight when it resumes; its historical descriptor default does not replace that selection.
|
|
12
12
|
|
|
13
13
|
| Policy field | Default | Strict integer bound |
|
|
14
14
|
| --- | --- | --- |
|
|
@@ -49,11 +49,11 @@ Native history loading, reading, promotion, explicit/declarative restoration and
|
|
|
49
49
|
|
|
50
50
|
DSMM uses public serial `agent/created` callbacks for fresh admission. A role's first creation requires its exact pending parent/provider/invocation, standing composition, scope, tool filter and depth ceiling. Role binding precedes Agent-scoped installation; publication rechecks current owner, exact parent, cancellation and composition after installation. Fresh ordinary children of a non-controlled admitted parent inherit its captured configuration and tool ceiling without acquiring a role invocation.
|
|
51
51
|
|
|
52
|
-
Native
|
|
52
|
+
Native root resume and supported continuable children obtain fresh admission during awaited `agent/created`. Root selection identity and current named content are read separately. A child requires its exact admitted live parent, native direct catalog, own continuable descriptor and current role provider. Own independent composition is validated separately from a new pending invocation's shared composition. Old retry, approval and pending-call state isn't restored; settled one-shot children remain non-resumable.
|
|
53
53
|
|
|
54
|
-
Restricted-role continuation
|
|
54
|
+
Restricted-role continuation recomputes current readonly, delegation and depth ceilings, intersecting the parent's actual capabilities and native filters/sandbox. The child's admitted maximum depth is the narrower of current configuration and its resident parent's admitted ceiling; subsequent delegation consumes that same bound. A disabled role or module refuses role activation rather than becoming an unrestricted native child. Failed/cancelled installation rolls back through the native factory; old objects remain revoked even after the same ID is activated again. Root and child image preflight and old native persona limitations are documented in [compatibility](compatibility.md#native-history-composition).
|
|
55
55
|
|
|
56
|
-
Official Registry, Runtime and JSONL plugins own lifecycle and storage. DSMM
|
|
56
|
+
Official Registry, Runtime and JSONL plugins own lifecycle and storage. DSMM callbacks retain exact Agent and current owner checks; Agent-scoped guards remain fail-closed after that owner retires. Ordinary unadmitted native tool calls retain native approval/sandbox and applicable permission rules without acquiring DSMM role or configuration-write rights. Retired DSMM objects cannot use that native path. Restoration grants role capability only through the fresh validated admission above, never through serialized grants. No descriptor authorization ledger, cold migration, automatic history rewrite or cross-process automatic retry is provided.
|
|
57
57
|
|
|
58
58
|
Diagnostics omit request/provider bodies, credentials and goal/todo text.
|
|
59
59
|
|
package/docs/safety-guards.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DSMM Safety Guards
|
|
2
2
|
|
|
3
|
-
DSMM 0.3.
|
|
3
|
+
DSMM 0.3.12 targets exactly DSH `0.2.1-rc.2`. Its guards use `tools/pre-execute` for allow, deny and ask decisions, and `tools/post-execute` for accepted-result truncation. They don't use OpenCode hook names or mutate tool arguments. Deployment overrides belong in the `id: dsmm` Loader entry's `config` object, not a settings.yaml namespace.
|
|
4
4
|
|
|
5
5
|
## Scope
|
|
6
6
|
|
|
@@ -17,6 +17,7 @@ The default scope is `deepwork-or-dsmm-agent`: helpers apply when the agent is i
|
|
|
17
17
|
scope: deepwork-or-dsmm-agent
|
|
18
18
|
shellCommandSafety: true
|
|
19
19
|
gitWriteGuard: ask
|
|
20
|
+
gitWriteScope: all-writes
|
|
20
21
|
toolOutputTruncation:
|
|
21
22
|
enabled: true
|
|
22
23
|
maxInlineBytes: 12000
|
|
@@ -35,8 +36,8 @@ All DSMM guard messages begin with `[dsmm safety]`.
|
|
|
35
36
|
- `[dsmm safety] PowerShell command uses POSIX null redirection (...)` rejects `/dev/null` in `pwsh`.
|
|
36
37
|
- `[dsmm safety] PowerShell command uses POSIX \`source\` (...)` rejects `source` in `pwsh`.
|
|
37
38
|
- `[dsmm safety] bash command appears to use PowerShell syntax (...)` rejects `$env:` in `bash`.
|
|
38
|
-
-
|
|
39
|
-
-
|
|
39
|
+
- Git approval requests identify the applicable automatic Git actions. With `gitWriteGuard: ask`, uncovered DSMM rules require host approval; unavailable approval fails closed. Valid live-Agent rule approvals may satisfy later matching DSMM asks.
|
|
40
|
+
- Git denial messages reject actions within `gitWriteScope` when `gitWriteGuard: deny`; approval memory cannot override deny.
|
|
40
41
|
- `[dsmm safety] truncated ... output` marks accepted plain-text tool results that were replaced with a head/tail preview.
|
|
41
42
|
- `[dsmm safety] plan file contains a malformed checklist entry: ...` rejects malformed checkbox lines in writes to `docs/superpowers/plans/*.md` and `.omo/plans/*.md`.
|
|
42
43
|
- `[dsmm safety] question option label exceeds ... characters: ...` rejects `ask_user_question` option labels longer than `maxLabelChars`.
|
|
@@ -47,9 +48,26 @@ All DSMM guard messages begin with `[dsmm safety]`.
|
|
|
47
48
|
|
|
48
49
|
Shell checks inspect the command argument for `bash`, `sh`, `zsh`, `pwsh`, and `powershell`. Command parsing separates `;`, newlines, pipes, and `&&`/`||` continuations; it also honors the dialect's normal line continuation escape. Git write detection recognizes an executable named `git` or `git.exe`, including a path-qualified executable, Git global options such as `git -C repo commit`, and the `env` wrapper with its supported options and POSIX-style assignments. Other aliases, shell functions, and wrappers are deliberately unclassified rather than guessed.
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
`guards.gitWriteScope` is independent of `guards.gitWriteGuard`:
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
| Scope | Automatic Git coverage |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `all-writes` (default) | All recognized writes, including ordinary add, commit, push, fetch, pull, merge and branch/tag creation. Recognized query forms, such as `branch --show-current`, `remote -v`, `stash list`, `tag --list` and `worktree list`, do not count as writes. |
|
|
56
|
+
| `high-risk` | The closed set of force/delete/mirror pushes, hard reset, non-dry-run clean, destructive/forced branch and tag changes, commit amend, rebase rewriting, stash drop/clear, worktree remove/prune, checkout/switch discard and forced replacement, worktree restore, and recognized reference/history modification actions. Ordinary writes are outside this automatic scope. |
|
|
57
|
+
|
|
58
|
+
For either scope, `ask` requires approval of the covered rules, `deny` rejects covered actions, and `off` contributes no automatic Git decision. `high-risk` only narrows automatic Git protection: explicit shell ask/deny and object-form native command asks still apply. Guard activation, shell dialect safety, readonly ceilings and existing standing Full access/simple-command priority are unchanged. This is not a general dangerous-command detector. Unrecognized aliases/wrappers receive no automatic Git decision; uncertain syntax cannot create a reusable broad approval. All command segments are considered, so an ordinary write before a high-risk action cannot hide the latter.
|
|
59
|
+
|
|
60
|
+
The existing schema-driven **Plugins → DSMM bundle config → Permissions** fields expose both options in Global and current DSH profile scopes. Unset uses defaults in Global and restores inheritance in the profile; a named profile can also override `guards.gitWriteScope`. Sparse saves do not pin omitted values. Read-only configuration stays non-writable. Saved settings follow existing new-session admission; they do not apply a live overlay.
|
|
61
|
+
|
|
62
|
+
## Command-rule approval memory
|
|
63
|
+
|
|
64
|
+
DSMM remembers approved automatic Git actions, exact explicit shell ask rules and matched object-form native command ask rules only for the **exact live Agent object**. A Git action approval can cover parameter changes within the same action and proven tool/dialect/cwd/static Git context; approving branch creation does not approve branch deletion or a later force push. Explicit shell rules retain their exact command/cwd matching. Each applicable DSMM ask must be satisfied independently. Uncertain context may still require approval on every call.
|
|
65
|
+
|
|
66
|
+
Only the complete native approval-service result can establish memory. Denial, cancellation, unavailable approval and audit failure do not. Rule/source changes invalidate future memory; Agent disposal, session replacement or controller retirement ends it. Settings may be captured by children, but approvals are not inherited by children or siblings, persisted, restored or shared by session ID. Reducing repeated manual intervention is a behavior and risk change, not unchanged overall risk.
|
|
67
|
+
|
|
68
|
+
Memory satisfies only DSMM's rule contribution. It neither reuses a native once/sandbox target nor changes standing sandbox permissions. Native escalation, independent downstream or third-party asks/denials, cancellation and native `approval.policy=never` remain authoritative; later calls may still show approval prompts. An already pending native request retains its single-call contract when a rule source changes, without granting memory for the new source. Structured-value replacements, errors, and blocked post-tool results are not truncated into apparently successful text.
|
|
69
|
+
|
|
70
|
+
Generic Git checks bind approval to the actual invocation and registration and recheck at the existing guard boundary. They retain the Host's mutable in-process middleware trust boundary; they do not guarantee isolation from plugins replacing execution after that guard. Managed Shell retains its existing controlled final-entry checks. Neither path supplies OS isolation or a guarantee that every tool will run without prompts.
|
|
53
71
|
|
|
54
72
|
Workflow and role instructions also prefer short shell operations and repository-native tools, prohibit cross-shell destructive path composition, require exact path checks before recursive deletion, and prohibit autonomous Git writes. These instructions complement, not replace, the host sandbox and approval pipeline. Read-only role authority is bound to exact live Agent ownership/admission, not a persona label. Native caller filters remain intact. Agent admission restricts inherited tools and installs monotonic execution guards; own-layer definitions are identity-fenced, including a re-registered `read` impersonating a safe operation. rc.2 has no public hide-own-layer filter: a registration may remain displayed, but forbidden/unadmitted invocation must fail. Native sandbox/approval/observation remain authoritative.
|
|
55
73
|
|
package/docs/settings-status.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Deepwork settings and status
|
|
2
2
|
|
|
3
|
-
DSMM 0.3.
|
|
3
|
+
DSMM 0.3.12 targets exactly DSH `0.2.1-rc.2`. Named policy is covered in [profiles](profiles.md), routing in [model routing](model-routing.md), and child authority in [Agent presets](agent-presets.md).
|
|
4
4
|
|
|
5
5
|
## Deployment layers and native editors
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ Native ConfigEditor can emit `loader/partial-dispose` during empty-pending recon
|
|
|
32
32
|
|
|
33
33
|
`modules.deepwork.enabled` is a global-only ceiling and defaults true; ordinary `defaultActive` defaults false. Native profile overrides and named/session overlays can't enable the module. Cold-off leaves Core storage, captures/CAS, configuration/status and mandatory native permissions available, without mounting DW role/routing/recovery substrate. DSMM-managed LSP stays off independently of this module ceiling. Static preset files aren't proof of callable roles.
|
|
34
34
|
|
|
35
|
-
On a mounted Host, desired-off affects new
|
|
35
|
+
On a mounted Host, desired-off affects new root admissions and cold role continuations, not existing residencies or freshly delegated children inheriting a parent's admission. Desired-on after cold-off remains restart-required until an independent Host restart. No hot-mount or restart queue is implied. An idle profile change doesn't absorb newer global deployment. Mode-on can't bypass an admitted off module; mode-off can replace saved on intent without pretending the module was active.
|
|
36
36
|
|
|
37
37
|
The inspector separates merged desired, startup-mounted/captured, next-root preview, and current-session admission. Without an actual session, current admission is unknown. Host bundle enablement also remains unknown when the public interface can't observe it. Sources, capture origins, global file version, native descriptor version and named snapshot reference aren't one acknowledgment.
|
|
38
38
|
|
|
@@ -82,6 +82,6 @@ Enabled background work must choose `run_in_background:true` before `startActiva
|
|
|
82
82
|
|
|
83
83
|
Live direct-child Queue/Steer/interrupt require actual capabilities and exact parent/operator/lifetime authority. Read-only descendant inspection grants no control. Readiness loss closes DSMM execution; stale handles don't grant authority. Agent-scoped guards remain fail-closed after owner retirement. Hot replacement isn't a promise of uninterrupted live-session operation.
|
|
84
84
|
|
|
85
|
-
Native history loading
|
|
85
|
+
Native history loading and lifecycle remain Host-owned. A restored root or valid continuable role child obtains a fresh admission using current content and role policy; persisted choice revision and actual admission revision/epoch remain separate. First creation retains exact pending-call checks, while continuation validates native own identity, direct parent/catalog, current provider and composition. Readonly, filters, depth and cancellation remain enforced. Old objects and owner closures stay revoked, and old approvals/retry budgets are not restored. Read-only inspection never wakes Agents, and no automatic history rewrite is supplied. See [runtime recovery](runtime-recovery.md#cold-resume-and-lifetime) and the precise [Host limitations](compatibility.md#native-history-composition).
|
|
86
86
|
|
|
87
87
|
*Author's note: For a DSH deployment operator; distinguish a successful configuration save from captured runtime availability before applying policy.*
|
package/lib/child-capture.d.ts
CHANGED
|
@@ -66,6 +66,15 @@ export interface ChildAdmissionCaptureV3 extends ChildAdmissionCaptureBase {
|
|
|
66
66
|
invocation: ChildAdmissionCaptureV2["invocation"];
|
|
67
67
|
}
|
|
68
68
|
export type ChildAdmissionCapture = ChildAdmissionCaptureV1 | ChildAdmissionCaptureV2 | ChildAdmissionCaptureV3;
|
|
69
|
+
export interface ChildAdmissionIdentity {
|
|
70
|
+
childSessionId: string;
|
|
71
|
+
parentSessionId: string;
|
|
72
|
+
role: DsmmRoleId;
|
|
73
|
+
profileId: string | null;
|
|
74
|
+
level: DsmmInvocationLevel;
|
|
75
|
+
}
|
|
76
|
+
/** Runtime snapshots are not authority or configuration inputs for a new activation. */
|
|
77
|
+
export declare function parseChildAdmissionIdentity(input: unknown): ChildAdmissionIdentity;
|
|
69
78
|
/** Trusted native folds only; never synthesized from the current parent's settings. */
|
|
70
79
|
export interface LegacyChildEvidence {
|
|
71
80
|
version: 1;
|
package/lib/child-capture.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { copyJson, freezeSettings, resolveConfig, validateSparseConfig } from "./settings.js";
|
|
2
2
|
import { parseModelParameterPolicy } from "./model-parameter-policy.js";
|
|
3
|
-
import { validateProfileOverlay } from "./profiles.js";
|
|
3
|
+
import { validateProfileOverlay, validateProfileId } from "./profiles.js";
|
|
4
4
|
import { isProfileReference } from "./config-revision.js";
|
|
5
5
|
import { DSMM_ROLE_IDS } from "./roles.js";
|
|
6
6
|
import { CHILD_EVIDENCE_FIELDS } from "./child-evidence.js";
|
|
@@ -8,6 +8,29 @@ export { CHILD_EVIDENCE_FIELDS, parseChildAdmissionEvidenceView } from "./child-
|
|
|
8
8
|
import { DSMM_ROUTE_SOURCES } from "./profile-types.js";
|
|
9
9
|
import { normalizeModelRouteJson } from "./route-json.js";
|
|
10
10
|
export { DSMM_ROUTE_SOURCES } from "./profile-types.js";
|
|
11
|
+
/** Runtime snapshots are not authority or configuration inputs for a new activation. */
|
|
12
|
+
export function parseChildAdmissionIdentity(input) {
|
|
13
|
+
if (!input || typeof input !== "object" || Array.isArray(input))
|
|
14
|
+
fail();
|
|
15
|
+
const row = input;
|
|
16
|
+
if (row.version !== 1 && row.version !== 2 && row.version !== 3)
|
|
17
|
+
fail();
|
|
18
|
+
text(row.childSessionId, 256);
|
|
19
|
+
text(row.parentSessionId, 256);
|
|
20
|
+
role(row.role);
|
|
21
|
+
if (row.childSessionId === row.parentSessionId)
|
|
22
|
+
fail();
|
|
23
|
+
const pin = row.profilePin === null ? null : object(row.profilePin, ["id", "revision"]);
|
|
24
|
+
if (pin)
|
|
25
|
+
validateProfileId(pin.id);
|
|
26
|
+
if (!row.invocation || typeof row.invocation !== "object")
|
|
27
|
+
fail();
|
|
28
|
+
const level = row.invocation.level;
|
|
29
|
+
if (level !== "normal" && level !== "low" && level !== "high" && level !== "max")
|
|
30
|
+
fail();
|
|
31
|
+
return { childSessionId: row.childSessionId, parentSessionId: row.parentSessionId, role: row.role,
|
|
32
|
+
profileId: pin === null ? null : pin.id, level: level };
|
|
33
|
+
}
|
|
11
34
|
function fail() { throw new TypeError("Invalid child admission data"); }
|
|
12
35
|
function object(value, required, optional = []) {
|
|
13
36
|
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
@@ -124,6 +147,10 @@ export function parseChildAdmissionCapture(input) {
|
|
|
124
147
|
}
|
|
125
148
|
const policyKeys = ["modules", "roleRouting", "runtimePolicy", "workflow", "guards", "runtimeRecovery", "defaultActive", "skills", "subagents", ...version === 3 ? [] : HISTORICAL_POLICY_FIELDS];
|
|
126
149
|
const policy = object(row.runtimePolicyCapture, policyKeys);
|
|
150
|
+
const guards = object(policy.guards, Object.keys(CAPTURE_POLICY_SHAPE.guards).filter(key => key !== "gitWriteScope"), ["gitWriteScope"]);
|
|
151
|
+
// All capture versions permit omission with the original all-writes behavior.
|
|
152
|
+
if (!Object.hasOwn(guards, "gitWriteScope"))
|
|
153
|
+
guards.gitWriteScope = "all-writes";
|
|
127
154
|
if (version !== 3)
|
|
128
155
|
for (const key of HISTORICAL_POLICY_FIELDS) {
|
|
129
156
|
const choices = key.endsWith("Calibration") ? ["off", "auto", "strict"] : ["off", "low", "high"];
|
|
@@ -170,7 +197,7 @@ const CAPTURE_POLICY_SHAPE = {
|
|
|
170
197
|
modules: { deepwork: { enabled: null } },
|
|
171
198
|
runtimePolicy: { strategy: null, rateLimit: { maxRetries: null, initialDelayMs: null, maxDelayMs: null, maxTotalDelayMs: null, switchAfterRateLimits: null, maxSwitches: null } },
|
|
172
199
|
workflow: { policy: null, strictGates: null, reviewCap: null, finalReviewPolicy: null },
|
|
173
|
-
guards: { scope: null, shellCommandSafety: null, gitWriteGuard: null, toolOutputTruncation: { enabled: null, maxInlineBytes: null }, planFormatValidation: null, questionLabelHelper: { enabled: null, maxLabelChars: null }, todoDisciplineHelper: null },
|
|
200
|
+
guards: { scope: null, shellCommandSafety: null, gitWriteGuard: null, gitWriteScope: null, toolOutputTruncation: { enabled: null, maxInlineBytes: null }, planFormatValidation: null, questionLabelHelper: { enabled: null, maxLabelChars: null }, todoDisciplineHelper: null },
|
|
174
201
|
runtimeRecovery: { enabled: null, retryOnStatusCodes: null, retryOnCodes: null, fallbackRoutes: null, maxFallbackAttempts: null, idleContinuation: { enabled: null, maxContinuations: null, prompt: null } },
|
|
175
202
|
};
|
|
176
203
|
function validateLegacyRoutes(policy) {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useId, useRef } from "react";
|
|
3
3
|
import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
4
4
|
import { canReconcileSelection } from "./controller.js";
|
|
5
|
-
import {
|
|
6
|
-
import { SessionScope } from "./SessionProfiles.js";
|
|
5
|
+
import { AdvancedSettings, RouteFields } from "./StructuredEditor.js";
|
|
6
|
+
import { SessionScope, SessionScopeFeedback } from "./SessionProfiles.js";
|
|
7
|
+
import { sessionProfileLabels } from "./session-labels.js";
|
|
7
8
|
import { structuredDocument } from "./structured.js";
|
|
8
9
|
import { draftWarnings, IssueDetails, ProfileWarnings } from "./diagnostics.js";
|
|
9
10
|
import { configurationVersionState, sourceRelationship } from "./configuration-display.js";
|
|
11
|
+
import { DSMM_LOCALES } from "../profile-locale.js";
|
|
10
12
|
function issueKey(issue) {
|
|
11
13
|
if (issue.source === "selection")
|
|
12
14
|
return issue.code === "conflict" ? "selectionConflict" : "appliedInvalid";
|
|
@@ -23,13 +25,23 @@ export function ProfilesSection(props) {
|
|
|
23
25
|
const prefix = useId();
|
|
24
26
|
const selectRef = useRef(null);
|
|
25
27
|
const inputRef = useRef(null);
|
|
28
|
+
const labelRef = useRef(null);
|
|
26
29
|
const editorRef = useRef(null);
|
|
27
30
|
const advancedRef = useRef(null);
|
|
31
|
+
const advancedSettingsRef = useRef(null);
|
|
32
|
+
const moreActionsRef = useRef(null);
|
|
28
33
|
const handledValidation = useRef(0);
|
|
29
34
|
const cancelRef = useRef(null);
|
|
30
35
|
const hadConfirmation = useRef(false);
|
|
36
|
+
const initiatorRef = useRef(null);
|
|
37
|
+
const orchestratorRef = useRef(null);
|
|
38
|
+
const sessionScopeRef = useRef(null);
|
|
39
|
+
const advancedOpenRef = useRef(false);
|
|
40
|
+
const jsoncOpenRef = useRef(false);
|
|
41
|
+
const moreActionsOpenRef = useRef(false);
|
|
31
42
|
const disabled = state.busy !== null || state.pendingEditor !== null || state.sessionBusy === "apply" || state.sessionBusy === "reset";
|
|
32
43
|
const snapshot = state.snapshot;
|
|
44
|
+
const hasOrchestrator = snapshot?.roles?.some(role => role.id === "dsmm-orchestrator") === true;
|
|
33
45
|
const editor = state.editor;
|
|
34
46
|
const readOnly = snapshot?.readOnly === true;
|
|
35
47
|
const editorDisabled = disabled || readOnly || editor?.refreshRequired === true || editor?.revision === "unavailable";
|
|
@@ -37,32 +49,53 @@ export function ProfilesSection(props) {
|
|
|
37
49
|
const selectionConflict = reconcilable && snapshot?.selectionError?.code === "conflict";
|
|
38
50
|
const invalid = state.issue?.kind === "domain" && state.issue.code === "validation";
|
|
39
51
|
const idInvalid = invalid && state.issue?.field === "id" && state.issue.location === undefined && editor?.revision === null && !editorDisabled;
|
|
40
|
-
const
|
|
52
|
+
const structuredDoc = editor === null ? null : structuredDocument(editor.content);
|
|
53
|
+
const lastValidBasicDocRef = useRef(null);
|
|
54
|
+
if (structuredDoc !== null) {
|
|
55
|
+
lastValidBasicDocRef.current = structuredDoc;
|
|
56
|
+
}
|
|
57
|
+
const basicDoc = structuredDoc ?? lastValidBasicDocRef.current;
|
|
58
|
+
const rawInvalid = editor !== null && structuredDoc === null;
|
|
41
59
|
useEffect(() => {
|
|
42
60
|
if (state.pendingEditor !== null) {
|
|
43
61
|
cancelRef.current?.focus();
|
|
44
62
|
hadConfirmation.current = true;
|
|
45
63
|
}
|
|
46
64
|
else if (hadConfirmation.current) {
|
|
47
|
-
selectRef.current?.focus();
|
|
48
65
|
hadConfirmation.current = false;
|
|
66
|
+
if (initiatorRef.current && initiatorRef.current.isConnected) {
|
|
67
|
+
initiatorRef.current.focus();
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
selectRef.current?.focus();
|
|
71
|
+
}
|
|
49
72
|
}
|
|
50
73
|
}, [state.pendingEditor]);
|
|
51
74
|
useEffect(() => {
|
|
52
75
|
if (state.busy === null && state.validationEpoch > handledValidation.current && state.issue?.kind === "domain" && state.issue.code === "validation") {
|
|
53
76
|
handledValidation.current = state.validationEpoch;
|
|
77
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
78
|
+
const scrollOpt = { behavior: reducedMotion ? "auto" : "smooth", block: "nearest" };
|
|
54
79
|
if (state.issue.location === undefined && state.issue.field === "id" && inputRef.current !== null
|
|
55
|
-
&& !inputRef.current.disabled && !inputRef.current.readOnly)
|
|
80
|
+
&& !inputRef.current.disabled && !inputRef.current.readOnly) {
|
|
81
|
+
if (typeof inputRef.current.scrollIntoView === "function")
|
|
82
|
+
inputRef.current.scrollIntoView(scrollOpt);
|
|
56
83
|
inputRef.current.focus();
|
|
84
|
+
}
|
|
57
85
|
else {
|
|
58
|
-
if (advancedRef.current !== null)
|
|
86
|
+
if (advancedRef.current !== null) {
|
|
59
87
|
advancedRef.current.open = true;
|
|
88
|
+
jsoncOpenRef.current = true;
|
|
89
|
+
}
|
|
60
90
|
const input = editorRef.current;
|
|
61
91
|
if (input !== null) {
|
|
92
|
+
if (typeof input.scrollIntoView === "function")
|
|
93
|
+
input.scrollIntoView(scrollOpt);
|
|
62
94
|
input.focus();
|
|
63
95
|
const location = state.issue.location;
|
|
64
|
-
if (location !== undefined && location.offset + location.length <= input.value.length)
|
|
96
|
+
if (location !== undefined && location.offset + location.length <= input.value.length) {
|
|
65
97
|
input.setSelectionRange(location.offset, location.offset + location.length);
|
|
98
|
+
}
|
|
66
99
|
}
|
|
67
100
|
}
|
|
68
101
|
}
|
|
@@ -76,10 +109,29 @@ export function ProfilesSection(props) {
|
|
|
76
109
|
selection = t("appliedProfile", { id: snapshot.selectedId, revision: t(configurationVersionState(snapshot.sourceRevision)) });
|
|
77
110
|
const notice = state.notice === null ? "" : t(state.notice.key === "reset" ? "resetDone" : state.notice.key, { id: state.notice.id });
|
|
78
111
|
const warnings = editor === null ? [] : draftWarnings(editor.content);
|
|
79
|
-
return _jsxs("section", { className: "dsmm-profiles", "aria-label": t("title"), "aria-busy": state.busy !== null, children: [readOnly && _jsx("p", { role: "status", className: "dsmm-hint", children: t("readOnlyOrigin") }),
|
|
80
|
-
void props.open(event.currentTarget.value); }, children: [_jsx("option", { value: "", children: t(editor?.revision === null ? "newDraft" : "choose") }), snapshot.profiles.map((profile, index) => _jsxs("option", { value: profile.id, children: [profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id, profile.error === undefined ? "" : ` — ${t("invalidProfile", { id: profile.id })}`, profile.warnings?.length ? ` — ${t("warningProfile")}` : ""] }, `${index}:${profile.id}`))] }), snapshot.profiles.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("empty") })
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
112
|
+
return _jsxs("section", { className: "dsmm-profiles dsmm-named-profiles", "aria-label": t("title"), "aria-busy": state.busy !== null, children: [readOnly && _jsx("p", { role: "status", className: "dsmm-hint", children: t("readOnlyOrigin") }), _jsx("h2", { children: t("title") }), _jsx("p", { className: "dsmm-hint", children: t("description") }), _jsxs("div", { className: "dsmm-browse-row", children: [snapshot !== null && _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-select`, children: t("editorSelect") }), _jsxs("select", { ref: selectRef, id: `${prefix}-select`, disabled: disabled, value: editor?.revision == null ? "" : editor.id, onChange: (event) => { initiatorRef.current = event.currentTarget; if (event.currentTarget.value)
|
|
113
|
+
void props.open(event.currentTarget.value); }, children: [_jsx("option", { value: "", children: t(editor?.revision === null ? "newDraft" : "choose") }), snapshot.profiles.map((profile, index) => _jsxs("option", { value: profile.id, children: [profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id, profile.error === undefined ? "" : ` — ${t("invalidProfile", { id: profile.id })}`, profile.warnings?.length ? ` — ${t("warningProfile")}` : ""] }, `${index}:${profile.id}`))] })] }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || snapshot === null, onClick: (event) => { initiatorRef.current = event.currentTarget; void props.create(); }, children: t("new") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: (event) => { initiatorRef.current = event.currentTarget; void props.refresh(); }, children: t(state.busy === "refresh" ? "refreshing" : "refresh") })] }), editor !== null && _jsx("p", { className: "dsmm-badge", "data-dsmm-editor-state": state.invalidFields.length > 0 || invalid || rawInvalid ? "invalid" : state.dirty ? "dirty" : readOnly ? "readonly" : "ready", children: t(editor.refreshRequired ? "savedRefreshRequired" : state.invalidFields.length > 0 || invalid || rawInvalid ? "validation" : state.dirty ? "dirty" : applied ? "savedApplied" : relationship === "unknown" ? "savedRelationshipUnknown" : "savedNotApplied") })] }), snapshot?.profiles.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("empty") }), snapshot !== null && snapshot.profiles.some(profile => profile.error !== undefined || profile.warnings?.length) && _jsx("ul", { className: "dsmm-profile-list", "aria-label": t("savedInventory"), children: snapshot.profiles.filter(profile => profile.error !== undefined || profile.warnings?.length).map((profile, index) => _jsxs("li", { children: [_jsx("p", { children: profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id }), _jsx(ProfileWarnings, { warnings: profile.warnings, t: t }), profile.error !== undefined && _jsx(IssueDetails, { issue: profile.error, t: t })] }, `${index}:${profile.id}`)) }), state.pendingEditor !== null && _jsxs("div", { className: "dsmm-confirm", role: "group", "aria-labelledby": `${prefix}-confirm`, onKeyDown: (event) => { if (event.key === "Escape") {
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
props.cancelDiscard();
|
|
116
|
+
} }, children: [_jsx("p", { id: `${prefix}-confirm`, children: t("discardPrompt") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => { void props.discardAndOpen(); }, children: t("discard") }), _jsx(Button, { ref: cancelRef, type: "button", variant: "primary", onClick: props.cancelDiscard, children: t("cancel") })] })] }), _jsxs("div", { className: "dsmm-effective-summary", "data-dsmm-effective-summary": true, children: [_jsxs("div", { className: "dsmm-summary-row", children: [_jsxs("div", { children: [_jsx("span", { className: "dsmm-summary-label", children: t("futureDefaultSummary") }), " ", _jsx("span", { className: "dsmm-summary-val", "data-dsmm-selection": true, children: selection })] }), _jsx(Button, { type: "button", variant: "primary", size: "sm", disabled: editorDisabled || state.dirty || state.invalidFields.length > 0 || editor?.revision == null || !reconcilable || (applied && !selectionConflict), onClick: () => { void props.apply(); }, children: t(state.busy === "apply" ? "applying" : "apply") })] }), snapshot?.refreshRequired && _jsx("p", { role: "status", children: t("savedRefreshRequired") }), snapshot?.selectedWarnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("futureWarnings") }), _jsx(ProfileWarnings, { warnings: snapshot.selectedWarnings, t: t })] }) : null, snapshot?.selectionError !== undefined && _jsxs("div", { className: "dsmm-issue", children: [_jsx("p", { children: t(selectionConflict ? "selectionConflict" : "retry") }), _jsx(IssueDetails, { issue: snapshot.selectionError, t: t })] }), _jsxs("div", { className: "dsmm-summary-row", children: [_jsxs("div", { children: [_jsx("span", { className: "dsmm-summary-label", children: t("currentSessionSummary") }), " ", _jsx("span", { className: "dsmm-summary-val", children: state.session === null ? t("sessionUnavailable") : sessionProfileLabels(state.session, t).admitted })] }), _jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
|
|
117
|
+
if (moreActionsRef.current !== null) {
|
|
118
|
+
moreActionsRef.current.open = true;
|
|
119
|
+
moreActionsOpenRef.current = true;
|
|
120
|
+
}
|
|
121
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
122
|
+
sessionScopeRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
|
|
123
|
+
}, children: t("locateSessionScope") })] }), _jsx(SessionScopeFeedback, { state: state, t: t }), _jsxs("details", { ref: moreActionsRef, className: "dsmm-more-actions", open: moreActionsOpenRef.current || undefined, onToggle: e => { moreActionsOpenRef.current = e.currentTarget.open; }, children: [_jsx("summary", { children: t("moreActions") }), _jsxs("div", { children: [_jsxs("div", { children: [_jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || !reconcilable || (snapshot?.selectedId === null && !selectionConflict), onClick: () => { void props.reset(); }, children: t(state.busy === "reset" ? "resetting" : "reset") }), _jsx("p", { className: "dsmm-hint", children: t("futureResetHint") })] }), _jsx("div", { ref: sessionScopeRef, children: _jsx(SessionScope, { state: state, actions: props, t: t, showFeedback: false }) })] })] })] }), editor === null && _jsx("p", { className: "dsmm-hint", children: t("noEditor") }), editor !== null && _jsxs("div", { className: "dsmm-editor", children: [warnings.length > 0 && _jsxs("div", { children: [_jsx("p", { children: t("draftWarnings") }), _jsx(ProfileWarnings, { warnings: warnings, t: t })] }), editor.warnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("savedWarnings") }), _jsx(ProfileWarnings, { warnings: editor.warnings, t: t })] }) : null, _jsxs("div", { className: "dsmm-catalog", children: [state.catalogUnavailable && _jsx("p", { className: "dsmm-hint", children: t("catalogUnavailable") }), state.catalog?.failures.map((failure) => _jsx("p", { className: "dsmm-hint", children: t("catalogFailure", { name: failure.name, id: failure.id }) }, failure.id)), _jsx(Button, { type: "button", variant: "outline", disabled: state.catalogBusy, onClick: () => { void props.refreshCatalog(); }, children: t(state.catalogBusy ? "catalogRefreshing" : "catalogRefresh") })] }), _jsxs("div", { className: "dsmm-basic-settings", "data-dsmm-basic-settings": true, children: [structuredDoc === null && (_jsxs("div", { className: "dsmm-structured-invalid", "data-dsmm-structured-invalid": true, children: [_jsx("p", { children: t("rawInvalid") }), _jsx("p", { className: "dsmm-hint", children: t("rawInvalidFormDisabled") }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
124
|
+
if (advancedRef.current !== null) {
|
|
125
|
+
advancedRef.current.open = true;
|
|
126
|
+
jsoncOpenRef.current = true;
|
|
127
|
+
}
|
|
128
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
129
|
+
editorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
|
|
130
|
+
editorRef.current?.focus();
|
|
131
|
+
}, children: t("viewConfiguration") })] })), basicDoc !== null && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-label`, children: t("profileLabel") }), _jsx(Input, { ref: labelRef, id: `${prefix}-label`, className: "dsmm-input", value: basicDoc.label ?? "", disabled: editorDisabled || structuredDoc === null, onChange: (event) => props.editPath(["label"], event.currentTarget.value) }), _jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || structuredDoc === null || basicDoc.label === undefined, onClick: () => props.editPath(["label"], undefined), children: t("omitLabel") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-id`, children: t("profileId") }), _jsx(Input, { ref: inputRef, id: `${prefix}-id`, className: "dsmm-input", value: editor.id, disabled: editorDisabled || structuredDoc === null || editor.revision !== null, "aria-invalid": idInvalid || undefined, "aria-describedby": `${prefix}-id-hint${idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editId(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-id-hint`, className: "dsmm-hint", children: t("idHint") })] }), _jsxs("div", { ref: orchestratorRef, className: "dsmm-field", id: `${prefix}-orchestrator-primary`, children: [_jsx("label", { htmlFor: `${prefix}-orch-mode`, children: t("orchestratorModel") }), _jsx("p", { className: "dsmm-hint", children: t("orchestratorModelDesc") }), _jsxs("select", { id: `${prefix}-orch-mode`, disabled: editorDisabled || structuredDoc === null || !hasOrchestrator, "aria-describedby": !hasOrchestrator ? `${prefix}-orch-unavailable` : undefined, value: basicDoc.roleRouting["dsmm-orchestrator"]?.primary === undefined ? "inherit" : "explicit", onChange: (event) => props.editPath(["settings", "roleRouting", "dsmm-orchestrator", "primary"], event.currentTarget.value === "inherit" ? undefined : { provider: "", model: "" }), children: [_jsx("option", { value: "inherit", children: t("inheritRoute") }), _jsx("option", { value: "explicit", children: t("configuredRoute") })] }), !hasOrchestrator && _jsx("p", { className: "dsmm-hint", id: `${prefix}-orch-unavailable`, children: t("orchestratorUnavailable") }), basicDoc.roleRouting["dsmm-orchestrator"]?.primary !== undefined && (_jsx(RouteFields, { t: t, value: basicDoc.roleRouting["dsmm-orchestrator"].primary, path: ["settings", "roleRouting", "dsmm-orchestrator", "primary"], naturalLabels: true, catalog: state.catalog, disabled: editorDisabled || structuredDoc === null || !hasOrchestrator, edit: props.editPath, editRoute: props.editRoute })), _jsx("p", { className: "dsmm-hint", children: t("effortChangeHint") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-locale`, children: t("businessLocale") }), _jsxs("select", { id: `${prefix}-locale`, value: String(basicDoc.settings.locale ?? ""), disabled: editorDisabled || structuredDoc === null, "aria-describedby": `${prefix}-locale-hint`, onChange: (event) => props.editPath(["settings", "locale"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inheritLocale") }), typeof basicDoc.settings.locale === "string" && !DSMM_LOCALES.includes(basicDoc.settings.locale) && (_jsx("option", { value: basicDoc.settings.locale, children: t("unsupportedLocale") })), DSMM_LOCALES.map((locale) => (_jsx("option", { value: locale, children: locale }, locale)))] }), _jsx("p", { id: `${prefix}-locale-hint`, className: "dsmm-hint", children: t("localeHint") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-active`, children: t("defaultActive") }), _jsxs("select", { id: `${prefix}-active`, disabled: editorDisabled || structuredDoc === null, value: basicDoc.settings.defaultActive === undefined ? "" : String(basicDoc.settings.defaultActive), onChange: (event) => props.editPath(["settings", "defaultActive"], event.currentTarget.value === "" ? undefined : event.currentTarget.value === "true"), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "true", children: t("enabled") }), _jsx("option", { value: "false", children: t("disabled") })] }), _jsx("p", { className: "dsmm-hint", children: t("activeHint") })] })] }))] }, `basic:${state.editorEpoch}`), _jsxs("details", { ref: advancedSettingsRef, className: "dsmm-advanced-settings", open: advancedOpenRef.current || undefined, onToggle: e => { advancedOpenRef.current = e.currentTarget.open; }, children: [_jsx("summary", { children: t("advancedSettings") }), _jsx("div", { children: _jsx(AdvancedSettings, { state: state, actions: props, disabled: editorDisabled, onJumpToOrchestrator: () => {
|
|
132
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
133
|
+
orchestratorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
|
|
134
|
+
orchestratorRef.current?.querySelector("select, input")?.focus();
|
|
135
|
+
}, t: t }) })] }, `advanced-settings:${state.editorEpoch}`), _jsxs("details", { ref: advancedRef, className: "dsmm-advanced", open: jsoncOpenRef.current || undefined, onToggle: e => { jsoncOpenRef.current = e.currentTarget.open; }, children: [_jsx("summary", { children: t("configuration") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-content`, children: t("configuration") }), _jsx("textarea", { ref: editorRef, id: `${prefix}-content`, rows: 12, spellCheck: false, value: editor.content, readOnly: readOnly, disabled: editorDisabled, "aria-invalid": rawInvalid || (invalid && !idInvalid) || undefined, "aria-describedby": `${prefix}-content-hint ${prefix}-structural-hint${invalid && !idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editContent(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-content-hint`, className: "dsmm-hint", children: t("configurationHint") }), _jsx("p", { id: `${prefix}-structural-hint`, className: "dsmm-hint", children: t("structuralHint") })] })] }, `advanced:${state.editorEpoch}`), _jsx("div", { className: "dsmm-save-bar", children: _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: editorDisabled || !state.dirty || snapshot === null || state.invalidFields.length > 0, onClick: () => { void props.save(); }, children: t(state.busy === "save" ? "saving" : "save") }), _jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || (!state.dirty && state.invalidFields.length === 0), onClick: (event) => { initiatorRef.current = event.currentTarget; props.discard(); }, children: t("discard") }), editor.revision !== null && !state.dirty && _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: (event) => { initiatorRef.current = event.currentTarget; void props.reload(); }, children: t("reload") })] }) })] }), state.issue !== null && _jsxs("div", { className: "dsmm-issue", id: `${prefix}-issue`, role: "alert", children: [_jsx("p", { children: t(issueKey(state.issue)) }), _jsx(IssueDetails, { issue: state.issue, t: t })] }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.busy === "refresh" && snapshot === null ? t("loading") : state.busy === "read" ? t("reading") : notice })] });
|
|
84
136
|
}
|
|
85
137
|
//# sourceMappingURL=ProfilesSection.js.map
|
|
@@ -23,10 +23,10 @@ export declare function requestedRoleTool(toolName: string, raw: string): {
|
|
|
23
23
|
/** Read during render: the native owner republishes changes to these lazy answers. */
|
|
24
24
|
export declare function preparingRoleTool(toolName: string, args: ToolArgs): {
|
|
25
25
|
requested: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
description: string | undefined;
|
|
27
|
+
kind: "role" | "category";
|
|
28
|
+
target: string | undefined;
|
|
29
|
+
level: string | undefined;
|
|
30
30
|
};
|
|
31
31
|
preview: string;
|
|
32
32
|
};
|
|
@@ -32,7 +32,9 @@ export function preparingRoleTool(toolName, args) {
|
|
|
32
32
|
return value === undefined ? [] : [[key, value]];
|
|
33
33
|
}));
|
|
34
34
|
const complete = Object.fromEntries(Object.entries(received).filter(([key]) => args.complete(key)));
|
|
35
|
-
|
|
35
|
+
const requested = requestedRoleTool(toolName, args.invalid ? "" : JSON.stringify(complete));
|
|
36
|
+
const description = requested.description ?? (typeof received.description === "string" ? received.description : undefined);
|
|
37
|
+
return { requested: { ...requested, description },
|
|
36
38
|
preview: Object.keys(received).length === 0 ? "" : JSON.stringify(received, null, 2) };
|
|
37
39
|
}
|
|
38
40
|
export function actualRoleTool(toolName, meta, failed) {
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
export declare const ROLE_TOOL_NS = "conversation.dsmm-role-tool";
|
|
2
2
|
export declare const roleToolEn: {
|
|
3
3
|
readonly call: "Call";
|
|
4
|
+
readonly calling: "Calling";
|
|
4
5
|
readonly unknownTarget: "DSMM agent · target pending";
|
|
5
6
|
readonly requested: "Requested";
|
|
6
7
|
readonly actual: "Actual";
|
|
7
8
|
readonly role: "Role";
|
|
8
9
|
readonly category: "Category";
|
|
9
10
|
readonly unknown: "Unknown";
|
|
11
|
+
readonly actualUnknown: "Actual unknown";
|
|
10
12
|
readonly preparing: "Preparing";
|
|
11
|
-
readonly running: "
|
|
12
|
-
readonly result: "
|
|
13
|
-
readonly background: "
|
|
14
|
-
readonly error: "
|
|
13
|
+
readonly running: "Calling";
|
|
14
|
+
readonly result: "Returned";
|
|
15
|
+
readonly background: "Background";
|
|
16
|
+
readonly error: "Failed";
|
|
15
17
|
readonly stopped: "Interrupted";
|
|
18
|
+
readonly technicalDetails: "Technical details";
|
|
16
19
|
readonly args: "Original arguments";
|
|
17
20
|
readonly preparingArgs: "Arguments received so far";
|
|
18
21
|
readonly output: "Complete result content";
|