@dsmm/dsmm 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +2 -2
  2. package/docs/agent-presets.md +5 -5
  3. package/docs/compatibility.md +7 -1
  4. package/docs/migration-from-ocmm.md +1 -1
  5. package/docs/releasing.md +25 -65
  6. package/docs/roadmap.md +37 -2
  7. package/docs/settings-status.md +1 -1
  8. package/lib/client/DeploymentFields.d.ts +6 -2
  9. package/lib/client/DeploymentFields.js +8 -6
  10. package/lib/client/DeploymentPage.d.ts +1 -0
  11. package/lib/client/DeploymentPage.js +4 -3
  12. package/lib/client/ProfilesSection.js +3 -3
  13. package/lib/client/RoleAvailability.js +1 -1
  14. package/lib/client/SessionProfiles.js +21 -18
  15. package/lib/client/controller.d.ts +17 -0
  16. package/lib/client/controller.js +104 -18
  17. package/lib/client/deployment-locales.js +26 -27
  18. package/lib/client/deployment-modules.js +1 -1
  19. package/lib/client/index.js +10 -2
  20. package/lib/client/locales.d.ts +6 -0
  21. package/lib/client/locales.js +148 -124
  22. package/lib/client/permission-locales.js +35 -35
  23. package/lib/client.js +645 -542
  24. package/lib/index.js +10 -5
  25. package/lib/native-admission.d.ts +18 -0
  26. package/lib/native-admission.js +174 -17
  27. package/lib/permission-control.d.ts +2 -0
  28. package/lib/permission-control.js +7 -0
  29. package/lib/permission-controller.js +2 -2
  30. package/lib/permission-native-rules.js +3 -3
  31. package/lib/preset-materializer.js +3 -3
  32. package/lib/preset-registry.d.ts +20 -2
  33. package/lib/preset-registry.js +46 -17
  34. package/lib/preset-skills.d.ts +1 -1
  35. package/lib/preset-skills.js +2 -2
  36. package/lib/profile-diagnostics.js +1 -1
  37. package/lib/profile-remote.js +1 -3
  38. package/lib/profile-rpc.js +2 -0
  39. package/lib/profile-runtime.d.ts +12 -1
  40. package/lib/profile-runtime.js +122 -10
  41. package/lib/profile-store.d.ts +2 -2
  42. package/lib/profile-store.js +8 -1
  43. package/lib/profile-types.d.ts +1 -0
  44. package/lib/role-invocation.d.ts +1 -1
  45. package/lib/role-invocation.js +2 -2
  46. package/lib/role-policy.js +2 -2
  47. package/lib/role-subagents.js +18 -4
  48. package/lib/roles.d.ts +2 -0
  49. package/lib/roles.js +2 -0
  50. package/lib/settings.d.ts +1 -3
  51. package/lib/settings.js +4 -9
  52. package/lib/skills.d.ts +1 -0
  53. package/lib/skills.js +5 -1
  54. package/package.json +37 -33
@@ -18,7 +18,7 @@ function capabilityReason(reason, t) {
18
18
  case "model-unconfigured": return t("headerNoProfileModel");
19
19
  case "model-service-unavailable": return t("headerModelUnconfirmed");
20
20
  case "new-session-required": return t("sessionNewRequired");
21
- default: return t("headerUnavailable");
21
+ default: return t("headerActionUnavailable");
22
22
  }
23
23
  }
24
24
  function menuIssue(issue) {
@@ -34,8 +34,8 @@ export function SessionScope({ state, actions, t, compact = false }) {
34
34
  const labels = session === null ? null : sessionProfileLabels(session, t);
35
35
  const selected = state.snapshot?.profiles.find((profile) => profile.id === state.sessionChoice);
36
36
  const disabled = state.busy !== null || state.pendingEditor !== null || state.sessionBusy !== null || state.dirty || state.invalidFields.length > 0;
37
- const current = () => actions.readProfileView().currentSessionId === state.currentSessionId;
38
- const ready = session !== null && !session.refreshRequired && !session.selection.refreshRequired && writableSelectionVersion(session.selection.selectionRevision);
37
+ const current = () => { const live = actions.readProfileView(); return live.currentSessionId === state.currentSessionId && live.sessionViewEpoch === state.sessionViewEpoch && live.session === session; };
38
+ const ready = session !== null && !state.sessionUnconfirmed && !session.refreshRequired && !session.selection.refreshRequired && writableSelectionVersion(session.selection.selectionRevision);
39
39
  const allowed = ready && session.canApplyOverlay === true && session.applyOverlayUnavailableReason !== "new-session-required";
40
40
  const modelAllowed = ready && session.canSelectModel === true && session.profileModel !== undefined;
41
41
  const status = state.sessionNotice === null ? "" : t(state.sessionNotice === "mode-on" ? "headerModeOn" : state.sessionNotice === "mode-off" ? "headerModeOff" : state.sessionNotice === "applied-with-model" ? "sessionAppliedWithModel" : state.sessionNotice === "applied" ? "sessionApplied" : "sessionResetDone");
@@ -47,12 +47,12 @@ export function SessionScope({ state, actions, t, compact = false }) {
47
47
  catch {
48
48
  binding = undefined;
49
49
  }
50
- 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 && _jsx("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: t("sessionUnavailable") }), session?.warnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("admissionWarnings") }), _jsx(ProfileWarnings, { warnings: session.warnings, t: t })] }) : null, session !== null && !allowed && _jsx("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: capabilityReason(session.applyOverlayUnavailableReason, t) }), _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, "aria-describedby": !allowed ? `${prefix}-overlay-reason` : undefined, onChange: (event) => { if (current())
51
- 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) => _jsxs("option", { value: profile.id, disabled: !isConfigRevision(profile.revision) || profile.error !== undefined, children: [profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id, profileWarnings(profile.warnings).length ? ` — ${t("warningProfile")}` : ""] }, profile.id))] })] }), !compact && _jsxs(_Fragment, { children: [_jsx("p", { className: "dsmm-hint", children: t("sessionModelHint") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled || !modelAllowed, "aria-describedby": !modelAllowed ? `${prefix}-model-reason` : undefined, onClick: () => { if (current())
52
- void actions.useSessionProfileModel(); }, children: t("headerUseCurrentModel") }), !modelAllowed && _jsx("p", { className: "dsmm-hint", id: `${prefix}-model-reason`, children: capabilityReason(session?.selectModelUnavailableReason, t) }), session !== null && _jsxs("div", { className: "dsmm-availability", children: [_jsx("p", { children: binding === undefined ? t("bindingUnknown") : t("bindingState", { binding: binding.binding, ready: t(binding.deliveryFenceReady ? "enabled" : "disabled"), restart: t(binding.restartRequired ? "enabled" : "disabled") }) }), binding?.reason !== undefined && _jsx("p", { children: t("bindingReason", { reason: binding.reason }) })] }), session?.roles !== undefined && _jsxs("details", { children: [_jsx("summary", { children: t("admittedRoles") }), session.roles.map(role => _jsxs("div", { className: "dsmm-availability", children: [_jsx("p", { children: role.id }), _jsx(RoleAvailability, { value: role, t: t })] }, role.id))] })] }), state.dirty && _jsx("p", { className: "dsmm-hint", children: t("sessionDirty") }), (session?.refreshRequired || session?.selection.refreshRequired) && _jsx("p", { role: "status", children: t("savedRefreshRequired") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: disabled || !allowed || (state.sessionChoice !== null && !isConfigRevision(selected?.revision)), "aria-describedby": !allowed ? `${prefix}-overlay-reason` : undefined, onClick: () => { if (current())
50
+ 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("sessionChooseWorkspace") }) : _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 && _jsx("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: t("sessionUnavailable") }), session?.warnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("admissionWarnings") }), _jsx(ProfileWarnings, { warnings: session.warnings, t: t })] }) : null, session !== null && !allowed && _jsx("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: capabilityReason(session.applyOverlayUnavailableReason, t) }), _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, "aria-describedby": !allowed ? `${prefix}-overlay-reason` : undefined, onChange: (event) => { if (current())
51
+ 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) => _jsxs("option", { value: profile.id, disabled: !isConfigRevision(profile.revision) || profile.error !== undefined, children: [profile.label?.trim() || profile.id, profileWarnings(profile.warnings).length ? ` — ${t("warningProfile")}` : ""] }, profile.id))] })] }), !compact && _jsxs(_Fragment, { children: [_jsx("p", { className: "dsmm-hint", children: t("sessionModelHint") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled || !modelAllowed, "aria-describedby": !modelAllowed ? `${prefix}-model-reason` : undefined, onClick: () => { if (current())
52
+ void actions.useSessionProfileModel(); }, children: t("headerUseCurrentModel") }), !modelAllowed && _jsx("p", { className: "dsmm-hint", id: `${prefix}-model-reason`, children: capabilityReason(session?.selectModelUnavailableReason, t) }), session !== null && _jsxs("details", { children: [_jsx("summary", { children: t("technicalDetails") }), _jsxs("div", { className: "dsmm-availability", children: [_jsx("p", { children: binding === undefined ? t("bindingUnknown") : t("bindingState", { binding: binding.binding, ready: t(binding.deliveryFenceReady ? "enabled" : "disabled"), restart: t(binding.restartRequired ? "enabled" : "disabled") }) }), binding?.reason !== undefined && _jsx("p", { children: t("bindingReason", { reason: binding.reason }) })] }), session.roles !== undefined && _jsxs("details", { children: [_jsx("summary", { children: t("admittedRoles") }), session.roles.map(role => _jsxs("div", { className: "dsmm-availability", children: [_jsx("p", { children: role.id }), _jsx(RoleAvailability, { value: role, t: t })] }, role.id))] }), 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.dirty && _jsx("p", { className: "dsmm-hint", children: t("sessionDirty") }), (session?.refreshRequired || session?.selection.refreshRequired) && _jsx("p", { role: "status", children: t("sessionCommittedRefresh") }), state.sessionUnconfirmed && _jsx("p", { role: "status", children: t("sessionUnconfirmedRefresh") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: disabled || !allowed || (state.sessionChoice !== null && !isConfigRevision(selected?.revision)), "aria-describedby": !allowed ? `${prefix}-overlay-reason` : undefined, onClick: () => { if (current())
53
53
  void actions.applySession(); }, children: t(state.sessionBusy === "apply" ? "sessionApplying" : "sessionApply") }), !compact && _jsx(Button, { type: "button", variant: "outline", disabled: disabled || !allowed, "aria-describedby": !allowed ? `${prefix}-overlay-reason` : undefined, onClick: () => { if (current())
54
54
  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: () => { if (current())
55
- 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")
55
+ void actions.refreshSession(); }, children: t("sessionRefresh") })] })] }), 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")
56
56
  : state.sessionIssue.code === "conflict" ? t("sessionConflict")
57
57
  : ["busy", "maintenance", "disposed", "not-owned"].includes(state.sessionIssue.code) ? t("sessionBusy", { reason: state.sessionIssue.code })
58
58
  : t(state.sessionIssue.code === "validation" ? "validation" : "sessionUnavailable") }), state.sessionIssue !== null && _jsx(IssueDetails, { issue: state.sessionIssue, t: t }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.sessionBusy === "read" ? t("reading") : status })] });
@@ -74,12 +74,16 @@ export function SessionProfiles(props) {
74
74
  const profiles = state.snapshot?.profiles ?? [];
75
75
  const currentSaved = profiles.find((profile) => profile.id === current);
76
76
  const committing = state.sessionBusy !== null;
77
- const unavailable = id === null || committing || state.busy !== null || session === null || session.refreshRequired === true || session.selection.refreshRequired === true;
77
+ const unavailable = id === null || committing || state.busy !== null || state.sessionUnconfirmed || session === null || session.refreshRequired === true || session.selection.refreshRequired === true;
78
78
  const profileDisabled = unavailable || state.pendingEditor !== null || state.dirty || state.invalidFields.length > 0
79
79
  || session === null || !writableSelectionVersion(session.selection.selectionRevision);
80
80
  const disabled = profileDisabled || session?.canApplyOverlay !== true || session?.applyOverlayUnavailableReason === "new-session-required" || state.snapshot === null;
81
81
  let feedback = "";
82
- if (state.sessionIssue !== null)
82
+ if (state.sessionUnconfirmed)
83
+ feedback = t("sessionUnconfirmedRefresh");
84
+ else if (session?.refreshRequired || session?.selection.refreshRequired)
85
+ feedback = t("sessionCommittedRefresh");
86
+ else if (state.sessionIssue !== null)
83
87
  feedback = t(state.sessionIssue.source === "profile-model" ? state.sessionIssue.code === "model-unconfigured" ? "headerNoProfileModel" : state.sessionIssue.code === "model-choice-changed" ? "headerModelChoiceChanged" : "headerModelUnconfirmed"
84
88
  : state.sessionIssue.code === "conflict" ? "headerConflict" : state.sessionIssue.code === "activation" ? "headerActivationRefused"
85
89
  : state.sessionIssue.code === "maintenance" ? "headerMaintenanceRefused" : state.sessionIssue.code === "busy" ? "headerBusyRefused"
@@ -89,21 +93,19 @@ export function SessionProfiles(props) {
89
93
  else if (state.dirty || state.invalidFields.length > 0 || state.pendingEditor !== null)
90
94
  feedback = t("headerDraft");
91
95
  else if (id === null)
92
- feedback = t("headerNoSession");
96
+ feedback = t("sessionChooseWorkspace");
93
97
  else if (session === null || state.snapshot === null)
94
98
  feedback = t("headerUnavailable");
95
- else if (session.refreshRequired || session.selection.refreshRequired)
96
- feedback = t("savedRefreshRequired");
97
99
  else if (state.sessionNotice !== null)
98
100
  feedback = t(state.sessionNotice === "mode-on" ? "headerModeOn" : state.sessionNotice === "mode-off" ? "headerModeOff" : state.sessionNotice === "applied-with-model" ? "headerAppliedWithModel" : "headerApplied");
99
- const profileName = unknownCaptured ? t("headerCaptured") : admission !== undefined && sourceRelationship(admission, currentSaved?.revision) === "current" && currentSaved?.label?.trim() ? `${currentSaved.label} (${currentSaved.id})` : admission?.selectedId ?? t("sessionBaseline");
101
+ const profileName = unknownCaptured ? t("headerCaptured") : admission !== undefined && sourceRelationship(admission, currentSaved?.revision) === "current" && currentSaved?.label?.trim() ? currentSaved.label : admission?.selectedId ?? t("sessionBaseline");
100
102
  const currentLabel = t("headerCurrentProfile", { profile: session === null ? t("headerUnavailable") : profileName });
101
103
  const entries = [{ type: "label", id: "@current", text: currentLabel }];
102
104
  for (const warning of profileWarnings(session?.warnings))
103
105
  entries.push({ type: "label", id: `@warning:${warning.code}`, text: t("warningMarker", { code: warning.code, field: warning.field }) });
104
- if (id === null && state.snapshot !== null)
106
+ if ((id === null || session?.canApplyOverlay === true) && state.snapshot !== null)
105
107
  entries.push({ type: "label", id: "@future", text: t("sessionFutureDefault", { profile: state.snapshot.profiles.find((profile) => profile.id === state.snapshot.selectedId)?.label?.trim() || state.snapshot.selectedId || t("sessionBaseline") }) });
106
- if (feedback !== "" && (state.sessionNotice === null || state.sessionIssue !== null))
108
+ if (feedback !== "" && (state.sessionNotice === null || state.sessionIssue !== null || state.sessionUnconfirmed || session?.refreshRequired || session?.selection.refreshRequired))
107
109
  entries.push({ type: "label", id: "@status", text: feedback });
108
110
  const mode = session?.deepwork;
109
111
  entries.push({ id: "@mode", label: t(mode === undefined ? "headerModeUnavailable" : mode.locked ? "headerModePreset" : mode.active ? "headerModeDisable" : "headerModeEnable"),
@@ -112,7 +114,7 @@ export function SessionProfiles(props) {
112
114
  entries.push({ type: "label", id: "@mode-reason", text: capabilityReason(session.toggleModeUnavailableReason, t) });
113
115
  const diagnostic = state.sessionIssue === null ? null : menuIssue(state.sessionIssue);
114
116
  const diagnosticText = diagnostic === null ? "" : t("headerIssueCode", { code: diagnostic.code }) + (diagnostic.field === undefined ? "" : ` ${t("headerIssueField", { field: diagnostic.field })}`);
115
- const retryHint = t(diagnostic?.code === "maintenance" || diagnostic?.code === "busy" ? "headerWaitRetryHint" : "headerRetryHint");
117
+ const retryHint = t(state.sessionUnconfirmed ? "sessionUnconfirmedRefresh" : diagnostic?.code === "maintenance" || diagnostic?.code === "busy" ? "headerWaitRetryHint" : "headerRetryHint");
116
118
  if (diagnostic !== null)
117
119
  entries.push({ type: "label", id: "@diagnostic", text: diagnosticText }, { type: "label", id: "@retry", text: retryHint });
118
120
  if (admission?.selectedId != null && currentSaved === undefined)
@@ -129,12 +131,13 @@ export function SessionProfiles(props) {
129
131
  entries.push({ type: "label", id: "@model-reason", text: capabilityReason(session.selectModelUnavailableReason, t) });
130
132
  const open = openFor === id;
131
133
  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("headerCompactRefresh"), 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) => {
132
- if (props.readProfileView().currentSessionId !== id)
134
+ const live = props.readProfileView();
135
+ if (live.currentSessionId !== id || live.sessionViewEpoch !== state.sessionViewEpoch || live.session !== session)
133
136
  return;
134
137
  if (value === "@refresh") {
135
138
  if (committing || state.busy !== null)
136
139
  return;
137
- void (async () => { await props.refresh(); if (id !== null && props.readProfileView().currentSessionId === id)
140
+ void (async () => { await props.refresh(); if (id !== null && props.readProfileView().currentSessionId === id && props.readProfileView().sessionViewEpoch === state.sessionViewEpoch)
138
141
  await props.refreshSession(); })();
139
142
  }
140
143
  else {
@@ -1,5 +1,7 @@
1
1
  import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
2
  import type { HostObservable } from "@deepseek-ai/dsh-client-ui-slots";
3
+ import type { ConnectionGenerationState } from "@deepseek-ai/dsh-client-connection/client";
4
+ import type { ComposerBlocks } from "@deepseek-ai/dsh-client-ui-conversation/client";
3
5
  import type { SessionEventSource } from "@deepseek-ai/dsh-api-session-controller/client";
4
6
  import type { ModelDirectoryState } from "@deepseek-ai/dsh-client-ui-model-selection/client";
5
7
  import type { DsmmProfilesRemote } from "../profile-remote.js";
@@ -42,6 +44,8 @@ export interface ProfilesViewSnapshot {
42
44
  catalogBusy: boolean;
43
45
  catalogUnavailable: boolean;
44
46
  currentSessionId: string | null;
47
+ sessionViewEpoch: number;
48
+ sessionUnconfirmed: boolean;
45
49
  session: SessionProfileSnapshot | null;
46
50
  sessionChoice: string | null;
47
51
  sessionBusy: "read" | "apply" | "reset" | "mode" | null;
@@ -95,6 +99,14 @@ export declare class ProfilesController {
95
99
  private generation;
96
100
  private disposed;
97
101
  private sessionGeneration;
102
+ private pendingSessionSelections;
103
+ private connection;
104
+ private connectionBaseline;
105
+ private connectionBound;
106
+ private stopConnection;
107
+ private composerBlocks;
108
+ private composerReason;
109
+ private composerBlock;
98
110
  private catalogGeneration;
99
111
  private catalogRemote;
100
112
  private modelSelectorGeneration;
@@ -121,6 +133,11 @@ export declare class ProfilesController {
121
133
  readonly actions: ProfilesActions;
122
134
  constructor(remote: DsmmProfilesRemote);
123
135
  dispose(): void;
136
+ bindConnection(source: ConnectionGenerationState | null): void;
137
+ private connectionCurrent;
138
+ attachComposerBlocks(blocks: ComposerBlocks | null, reason?: () => string): void;
139
+ private releaseComposerBlock;
140
+ private syncComposerBlock;
124
141
  attachModelSelector(remote: ProfileModelSelectorRemote | null): void;
125
142
  attachModelSelectionSource(sessionId: string | null, source: HostObservable<unknown> | null): void;
126
143
  attachModelEventSource(sessionId: string | null, source: SessionEventSource | null): void;
@@ -28,12 +28,20 @@ export function canReconcileSelection(snapshot) {
28
28
  export class ProfilesController {
29
29
  remote;
30
30
  current = { snapshot: null, editor: null, dirty: false, busy: null, issue: null, notice: null, pendingEditor: null,
31
- catalog: null, catalogBusy: false, catalogUnavailable: true, currentSessionId: null, session: null, sessionChoice: null, sessionBusy: null, sessionIssue: null, sessionNotice: null, invalidFields: [], editorEpoch: 0, validationEpoch: 0 };
31
+ catalog: null, catalogBusy: false, catalogUnavailable: true, currentSessionId: null, sessionViewEpoch: 0, sessionUnconfirmed: false, session: null, sessionChoice: null, sessionBusy: null, sessionIssue: null, sessionNotice: null, invalidFields: [], editorEpoch: 0, validationEpoch: 0 };
32
32
  accepted = null;
33
33
  listeners = new Set();
34
34
  generation = 0;
35
35
  disposed = false;
36
36
  sessionGeneration = 0;
37
+ pendingSessionSelections = new Set();
38
+ connection = null;
39
+ connectionBaseline;
40
+ connectionBound = false;
41
+ stopConnection = null;
42
+ composerBlocks = null;
43
+ composerReason = null;
44
+ composerBlock = null;
37
45
  catalogGeneration = 0;
38
46
  catalogRemote = null;
39
47
  modelSelectorGeneration = 0;
@@ -69,7 +77,7 @@ export class ProfilesController {
69
77
  editPath: (path, value) => this.editPath(path, value), moveFallback: (role, from, to) => this.editFallbackOrder(role, from, to),
70
78
  editRoute: (path, provider, model) => this.editRoute(path, provider, model),
71
79
  refreshCatalog: () => this.refreshCatalog(), refreshSession: () => this.refreshSession(),
72
- chooseSessionProfile: (id) => { if (!this.disposed && this.current.sessionBusy === null && this.current.busy === null && !this.current.dirty)
80
+ chooseSessionProfile: (id) => { if (!this.disposed && this.connectionCurrent() && !this.current.sessionUnconfirmed && this.current.sessionBusy === null && this.current.busy === null && !this.current.dirty && this.current.pendingEditor === null && this.current.invalidFields.length === 0)
73
81
  this.publish({ sessionChoice: id, sessionNotice: null }); },
74
82
  applySession: (options) => this.selectSession(false, options), resetSession: () => this.selectSession(true),
75
83
  setDeepwork: (active) => this.setDeepwork(active), useSessionProfileModel: () => this.selectSession(false, { useProfileModel: true }, true),
@@ -86,7 +94,69 @@ export class ProfilesController {
86
94
  constructor(remote) {
87
95
  this.remote = remote;
88
96
  }
89
- dispose() { this.disposed = true; this.generation += 1; this.sessionGeneration += 1; this.catalogGeneration += 1; this.modelSelectorGeneration += 1; this.modelSelectionGeneration += 1; this.stopModelSelection?.(); this.stopModelEvents?.(); this.stopModelInteraction?.(); this.stopModelSelection = null; this.stopModelEvents = null; this.stopModelInteraction = null; this.modelSelectionSource = null; this.modelEvents = null; this.modelInteraction = null; this.catalogRemote = null; this.modelSelector = null; this.listeners.clear(); }
97
+ dispose() { this.releaseComposerBlock(); this.stopConnection?.(); this.disposed = true; this.generation += 1; this.sessionGeneration += 1; this.catalogGeneration += 1; this.modelSelectorGeneration += 1; this.modelSelectionGeneration += 1; this.stopModelSelection?.(); this.stopModelEvents?.(); this.stopModelInteraction?.(); this.stopModelSelection = null; this.stopModelEvents = null; this.stopModelInteraction = null; this.modelSelectionSource = null; this.modelEvents = null; this.modelInteraction = null; this.catalogRemote = null; this.modelSelector = null; this.listeners.clear(); }
98
+ bindConnection(source) {
99
+ if (this.disposed)
100
+ return;
101
+ const replacement = this.connectionBound && (source !== this.connection || source?.getSnapshot() !== this.connectionBaseline);
102
+ this.stopConnection?.();
103
+ this.connection = source;
104
+ this.connectionBound = true;
105
+ this.connectionBaseline = source?.getSnapshot();
106
+ const invalidate = () => {
107
+ this.connectionBaseline = source?.getSnapshot();
108
+ this.generation += 1;
109
+ this.sessionGeneration += 1;
110
+ this.modelSelectorGeneration += 1;
111
+ // A replaced connection only discards what it observed. It never records a
112
+ // durable refusal for the session: an unread configuration is read again
113
+ // by the next refresh, and typing stays available in the meantime.
114
+ this.publish({ session: null, sessionBusy: null, sessionNotice: null, sessionUnconfirmed: false,
115
+ sessionViewEpoch: this.current.sessionViewEpoch + 1, busy: null, issue: { kind: "transport", code: "unavailable" } });
116
+ };
117
+ if (replacement || source === null || this.connectionBaseline === undefined)
118
+ invalidate();
119
+ this.stopConnection = source?.subscribe(() => {
120
+ invalidate();
121
+ if (this.connectionCurrent()) {
122
+ void this.refresh();
123
+ void this.refreshSession();
124
+ }
125
+ }) ?? null;
126
+ }
127
+ connectionCurrent() {
128
+ return !this.connectionBound || this.connectionBaseline !== undefined && this.connection?.getSnapshot() === this.connectionBaseline;
129
+ }
130
+ attachComposerBlocks(blocks, reason) {
131
+ if (this.disposed)
132
+ return;
133
+ this.releaseComposerBlock();
134
+ this.composerBlocks = blocks;
135
+ this.composerReason = reason ?? null;
136
+ this.syncComposerBlock();
137
+ }
138
+ releaseComposerBlock() {
139
+ const held = this.composerBlock;
140
+ this.composerBlock = null;
141
+ // Native blocks have no owner token. Only release the exact object and
142
+ // store we installed into an empty seat; never forget or clear another owner.
143
+ if (held !== null && this.composerBlocks?.storeFor(held.id) === held.store && held.store.getSnapshot() === held.block)
144
+ this.composerBlocks.set(held.id, undefined);
145
+ }
146
+ syncComposerBlock() {
147
+ const { currentSessionId, sessionBusy, sessionUnconfirmed, session } = this.current;
148
+ const wanted = currentSessionId !== null && (sessionBusy === "apply" || sessionBusy === "reset" || sessionUnconfirmed || session?.refreshRequired || session?.selection.refreshRequired);
149
+ if (!wanted || this.composerBlock?.id !== currentSessionId)
150
+ this.releaseComposerBlock();
151
+ if (!wanted || this.composerBlock !== null || this.composerBlocks === null || this.composerReason === null)
152
+ return;
153
+ const id = currentSessionId, store = this.composerBlocks.storeFor(id);
154
+ if (store.getSnapshot() !== undefined)
155
+ return;
156
+ const block = { reason: this.composerReason() };
157
+ this.composerBlock = { id, store, block };
158
+ this.composerBlocks.set(id, block);
159
+ }
90
160
  attachModelSelector(remote) {
91
161
  if (this.disposed)
92
162
  return;
@@ -166,7 +236,7 @@ export class ProfilesController {
166
236
  this.attachModelEventSource(null, null);
167
237
  if (id !== this.modelInteractionSessionId)
168
238
  this.attachModelInteractionSource(null, null);
169
- this.publish({ currentSessionId: id, session: null, sessionChoice: null, sessionBusy: null, sessionIssue: null, sessionNotice: null });
239
+ this.publish({ currentSessionId: id, sessionViewEpoch: this.current.sessionViewEpoch + 1, sessionUnconfirmed: id !== null && this.pendingSessionSelections.has(id), session: null, sessionChoice: null, sessionBusy: null, sessionIssue: null, sessionNotice: null });
170
240
  if (id !== null)
171
241
  void this.refreshSession();
172
242
  }
@@ -195,18 +265,18 @@ export class ProfilesController {
195
265
  }
196
266
  async refreshSession(preserveFeedback = false) {
197
267
  const id = this.current.currentSessionId;
198
- if (this.disposed || id === null || this.current.sessionBusy !== null)
268
+ if (this.disposed || !this.connectionCurrent() || id === null || this.current.sessionBusy !== null)
199
269
  return;
200
270
  this.modeRefreshPending = false;
201
271
  const generation = ++this.sessionGeneration;
202
- const live = () => !this.disposed && generation === this.sessionGeneration && id === this.current.currentSessionId;
272
+ const live = () => !this.disposed && this.connectionCurrent() && generation === this.sessionGeneration && id === this.current.currentSessionId;
203
273
  this.publish({ sessionBusy: "read", ...(preserveFeedback ? {} : { sessionIssue: null, sessionNotice: null }) });
204
274
  try {
205
275
  const session = await this.unwrap(this.remote.describeSession(id));
206
276
  if (session.sessionId !== id)
207
277
  throw { kind: "assembly", code: "unavailable" };
208
278
  if (live())
209
- this.publish({ session, sessionChoice: session.selection.selectedId });
279
+ this.publish({ session, sessionChoice: (session.admittedSelection ?? session.selection).selectedId, sessionUnconfirmed: this.pendingSessionSelections.has(id) });
210
280
  }
211
281
  catch (error) {
212
282
  if (live())
@@ -221,13 +291,15 @@ export class ProfilesController {
221
291
  }
222
292
  async setDeepwork(active) {
223
293
  const { currentSessionId: id, session } = this.current;
224
- if (this.disposed || id === null || session?.deepwork === undefined || session.refreshRequired || session.selection.refreshRequired || session.deepwork.locked || session.canToggleMode !== true
294
+ if (this.disposed || !this.connectionCurrent() || this.current.sessionUnconfirmed || id === null || session?.deepwork === undefined || session.refreshRequired || session.selection.refreshRequired || session.deepwork.locked || session.canToggleMode !== true
225
295
  || this.current.sessionBusy !== null || this.current.busy !== null || this.remote.selectMode === undefined)
226
296
  return;
227
297
  const generation = ++this.sessionGeneration;
228
- const live = () => !this.disposed && generation === this.sessionGeneration && id === this.current.currentSessionId;
298
+ const live = () => !this.disposed && this.connectionCurrent() && generation === this.sessionGeneration && id === this.current.currentSessionId;
229
299
  this.publish({ sessionBusy: "mode", sessionIssue: null, sessionNotice: null });
230
300
  try {
301
+ if (!live())
302
+ return;
231
303
  const accepted = await this.unwrap(this.remote.selectMode(id, { sessionId: id, active,
232
304
  expectedModeRevision: session.deepwork.revision, expectedAdmissionEpoch: session.admissionEpoch }));
233
305
  if (accepted.sessionId !== id || accepted.deepwork?.active !== active || !accepted.deepwork.explicit)
@@ -248,13 +320,13 @@ export class ProfilesController {
248
320
  }
249
321
  async selectSession(reset, options, modelOnly = false) {
250
322
  const { currentSessionId: id, session, sessionChoice, snapshot } = this.current;
251
- if (this.disposed || id === null || session === null || session.refreshRequired || session.selection.refreshRequired || !writableSelectionVersion(session.selection.selectionRevision)
323
+ if (this.disposed || !this.connectionCurrent() || this.current.sessionUnconfirmed || id === null || session === null || session.refreshRequired || session.selection.refreshRequired || !writableSelectionVersion(session.selection.selectionRevision)
252
324
  || (modelOnly ? session.canSelectModel !== true : session.canApplyOverlay !== true || session.applyOverlayUnavailableReason === "new-session-required") || this.current.sessionBusy !== null
253
325
  || this.current.busy !== null || this.current.dirty || this.current.invalidFields.length > 0 || this.current.pendingEditor !== null)
254
326
  return;
255
327
  const selectedId = reset ? null : sessionChoice;
256
- const revision = snapshot?.profiles.find((profile) => profile.id === selectedId)?.revision;
257
- if (!modelOnly && selectedId !== null && !isConfigRevision(revision))
328
+ const profile = snapshot?.profiles.find((profile) => profile.id === selectedId), revision = profile?.revision;
329
+ if (!modelOnly && selectedId !== null && (!isConfigRevision(revision) || profile?.error !== undefined))
258
330
  return;
259
331
  const generation = ++this.sessionGeneration;
260
332
  const useProfileModel = !reset && options?.useProfileModel === true;
@@ -266,10 +338,14 @@ export class ProfilesController {
266
338
  const modeWatermark = eventSource === null ? -1 : modeIntentWatermark(eventSource.getSnapshot());
267
339
  const interaction = this.modelInteraction, interactionGeneration = this.modelInteractionGeneration;
268
340
  const pendingNativeChoice = interaction?.getSnapshot().status === "selecting";
269
- const live = () => !this.disposed && generation === this.sessionGeneration && id === this.current.currentSessionId;
341
+ const live = () => !this.disposed && this.connectionCurrent() && generation === this.sessionGeneration && id === this.current.currentSessionId;
270
342
  const selectorLive = () => live() && selector !== null && selector === this.modelSelector && selectorGeneration === this.modelSelectorGeneration;
343
+ if (!modelOnly)
344
+ this.pendingSessionSelections.add(id);
271
345
  this.publish({ sessionBusy: reset ? "reset" : "apply", sessionIssue: null, sessionNotice: null });
272
346
  try {
347
+ if (!live())
348
+ return;
273
349
  const accepted = await this.unwrap(modelOnly ? this.remote.describeSession(id) : this.remote.selectSession(id, {
274
350
  sessionId: id, id: selectedId, ...(selectedId === null ? {} : { expectedRevision: revision }),
275
351
  expectedSelectionRevision: session.selection.selectionRevision, expectedAdmissionEpoch: session.admissionEpoch,
@@ -280,7 +356,8 @@ export class ProfilesController {
280
356
  throw { kind: "domain", code: "conflict" };
281
357
  if (!live())
282
358
  return;
283
- this.publish({ session: accepted, sessionChoice: accepted.selection.selectedId, sessionNotice: useProfileModel ? null : reset ? "reset" : "applied" });
359
+ this.publish({ session: accepted, sessionChoice: (accepted.admittedSelection ?? accepted.selection).selectedId,
360
+ sessionNotice: useProfileModel || accepted.refreshRequired || accepted.selection.refreshRequired ? null : reset ? "reset" : "applied" });
284
361
  if (!useProfileModel || accepted.refreshRequired || accepted.selection.refreshRequired || !live())
285
362
  return;
286
363
  if (accepted.canSelectModel !== true || !writableSelectionVersion(accepted.selection.selectionRevision)) {
@@ -334,20 +411,29 @@ export class ProfilesController {
334
411
  }
335
412
  }
336
413
  catch (error) {
337
- if (live())
338
- this.publish({ sessionIssue: this.issue(error) });
414
+ if (live()) {
415
+ const issue = this.issue(error);
416
+ this.publish({ sessionIssue: issue, sessionUnconfirmed: !modelOnly && (issue.kind !== "domain" || issue.code === "cancelled") });
417
+ }
339
418
  }
340
419
  finally {
420
+ if (!modelOnly)
421
+ this.pendingSessionSelections.delete(id);
341
422
  if (live()) {
342
423
  this.publish({ sessionBusy: null });
343
424
  this.refreshObservedMode();
344
425
  }
426
+ else if (!modelOnly && !this.disposed && this.connectionCurrent() && id === this.current.currentSessionId) {
427
+ this.modeRefreshPending = true;
428
+ this.refreshObservedMode();
429
+ }
345
430
  }
346
431
  }
347
432
  publish(patch) {
348
433
  if (this.disposed)
349
434
  return;
350
435
  this.current = { ...this.current, ...patch };
436
+ this.syncComposerBlock();
351
437
  for (const listener of this.listeners)
352
438
  listener();
353
439
  }
@@ -373,10 +459,10 @@ export class ProfilesController {
373
459
  return { kind: "assembly", code: "unavailable" };
374
460
  }
375
461
  async perform(busy, operation) {
376
- if (this.disposed || this.current.busy !== null || this.current.sessionBusy === "apply" || this.current.sessionBusy === "reset" || this.current.pendingEditor !== null)
462
+ if (this.disposed || !this.connectionCurrent() || this.current.busy !== null || this.current.sessionBusy === "apply" || this.current.sessionBusy === "reset" || this.current.pendingEditor !== null)
377
463
  return;
378
464
  const generation = ++this.generation;
379
- const live = () => !this.disposed && generation === this.generation;
465
+ const live = () => !this.disposed && this.connectionCurrent() && generation === this.generation;
380
466
  this.publish({ busy, issue: null, notice: null });
381
467
  try {
382
468
  await operation(live);
@@ -3,27 +3,27 @@ export const deploymentEn = {
3
3
  title: "DSMM", summary: "Global config and profile overrides",
4
4
  description: "Layers save independently; native models and running sessions stay unchanged.",
5
5
  global: "DSMM Global config", globalHint: "Shared by this Home’s DSH profiles. Unset fields use built-in defaults.",
6
- profile: "Current DSH profile overrides", profileHint: "This native entry only. Ordinary Unset fields inherit Global plus Host base pins. Native runtime uses Host base/native defaults, never Global.",
6
+ profile: "Current DSH profile overrides", profileHint: "This DSH profile only. Unset fields use Global and Host defaults; native runtime uses Host defaults.",
7
7
  profileUnavailable: "Unavailable",
8
- unavailableForm: "Current profile is read-only: no verified writable native form at this connection, namespace and revision. Global configuration remains a separate authority.",
8
+ unavailableForm: "This DSH profile is read-only. Reconnect and refresh to check editing access.",
9
9
  ceiling: "Deepwork master is Global-only; profiles and session modes cannot lift its captured ceiling.",
10
10
  hostUnknown: "Host bundle status: unknown (separate switch).",
11
- boundaries: "New roots capture saved settings within startup capabilities. Save does not restart the Host; startup-only changes require a separate Host restart, which may cancel sessions.",
11
+ boundaries: "Saved settings apply to new sessions. Changes marked restart required need a separate Host restart, which may cancel sessions.",
12
12
  core: "Core", coreHint: "Core-owned desired settings. Model-parameter passthrough is ordinary config, not a subplugin. The permission-control enabled flag is startup-pinned. Save does not change current-session admission; inspect desired, startup and admitted values below. Unavailable admission stays unknown.",
13
- modelParametersHint: "Default On. Off retains saved custom/opaque model parameters without forwarding them, and DSMM reasoningEffort / reasoning_effort aliases use native defaults. Standard SDK parameters and explicit native root choices remain intact. Raw JSON and exact effort values remain editable; saving desired settings does not verify provider transport readiness.",
13
+ modelParametersHint: "Off stops sending custom parameters and uses native reasoning defaults. Saved values and your selected model stay unchanged.",
14
14
  permissionControlHint: "Permission-control mounting is startup-pinned. Saved configuration does not prove runtime coverage or remove current protections. Root rules keep their independent authority inside Permissions.",
15
- modules: "Configuration modules", scope: "Configuration scope", close: "Close module", loading: "Loading configuration…", unset: "Unset — inherit",
15
+ modules: "Configuration modules", scope: "Configuration scope", close: "Close module", loading: "Loading configuration…", unset: "Use default configuration",
16
16
  "module:run": "Run and modules", "module:routes": "Model routes and recovery", "module:workflow": "Workflow, roles and skills", "module:subagents": "Subagent settings", "module:permissions": "Permissions and guards", "module:other": "Other settings", "module:state": "Configuration state",
17
17
  saveScope: "Save selected configuration scope", pendingModules: "Pending modules in this scope", savedRefreshRequired: "Saved — refresh required before further edits", sessionObserved: "Current-session admission observed",
18
- noModuleFields: "No editable schema fields for this module in the selected scope.",
18
+ noModuleFields: "No editable settings in this scope.",
19
19
  leaveDraft: "Unsaved or invalid draft. Choose how to leave; nothing is saved or discarded automatically.", continueEditing: "Continue editing", keepDraft: "Keep draft and return", discardDraft: "Discard draft and leave",
20
- rootRules: "Current Root rules", rootRulesHint: "This transaction is separate from Global/native configuration Save. It requires an open trusted Root, writable operator authority and synchronized runtime. It never borrows Global authority to bypass a refusal.", rootRulesUnavailable: "Root rules service unavailable. No session or authority is inferred.",
20
+ rootRules: "Session permission rules", rootRulesHint: "Rules save separately. Select an open main session with editing access and synchronized permissions.", rootRulesUnavailable: "Permission rules unavailable. Reconnect and refresh.",
21
21
  nativeRuntimeHint: "Native default On; Host base pins still apply. Mounting is captured at startup. Saving stages desired configuration only; it does not start/stop providers or cancel running sessions. A separate Host restart may cancel sessions.",
22
- nativeRuntimeReadinessHint: "Official Host services own execution and JSONL storage. This snapshot reports native execution admission readiness, not guaranteed inbox acceptance or completion. Storage is configured on the native JSONL service, not DSMM.",
23
- unsetGroup: "Unset this group — restore inheritance",
22
+ nativeRuntimeReadinessHint: "Task progress is available in the session.",
23
+ unsetGroup: "Use defaults for this group",
24
24
  nativeRuntimeState: "Observed native runtime", nativeRuntimeBinding: "Observed runtime composition", nativeRuntimeFence: "Execution admission ready", nativeRuntimeRestart: "Restart required", nativeRuntimeStock: "Official Host runtime", nativeRuntimeUnavailable: "Unavailable / unknown",
25
25
  "nativeRuntimeReason-explicit-composition-required": "The Host requires an explicit native runtime composition.", "nativeRuntimeReason-duplicate-provider": "More than one native provider is present; readiness is not confirmed.", "nativeRuntimeReason-authority-not-ready": "Native execution authority is not ready.", "nativeRuntimeReason-disabled": "The saved native runtime is disabled.", "nativeRuntimeReason-pending-restart": "Saved desired state differs from the mounted native composition; restart is pending.", "nativeRuntimeReason-scope-conflict": "Native scope ownership conflicts; readiness is not confirmed.",
26
- saveGlobal: "Save Global config", saveProfile: "Save profile overrides", saving: "Saving…", refresh: "Refresh", discard: "Discard and reload", dirty: "Unsaved changes", saved: "Saved",
26
+ saveGlobal: "Save", saveProfile: "Save", saving: "Saving…", refresh: "Refresh", discard: "Discard and reload", dirty: "Unsaved changes", saved: "Saved",
27
27
  inherit: "Inherit", explicit: "Override", defaultPin: "Built-in default pinned", hostPin: "Host pin remains when cleared",
28
28
  globalSource: "Global", profileSource: "DSH profile", defaultsSource: "Built-in default", namedSource: "Named/session", startupSource: "Startup capture", deploymentCapture: "Deployment capture",
29
29
  desired: "Merged desired", startup: "Startup mounted / captured", next: "Next root", session: "Current-session admitted", noSession: "No active session: admission is unknown.",
@@ -31,41 +31,41 @@ export const deploymentEn = {
31
31
  absent: "Absent", mixedSource: "Mixed sources", inspectorStale: "Saved state, not draft",
32
32
  pending: "Pending independent restart", unknown: "Unknown", on: "On", off: "Off", state: "Field sources and effective state", module: "Deepwork module",
33
33
  versionObserved: "Metadata observed", versionAbsent: "Not stored", versionUnknown: "Version unavailable",
34
- advanced: "Advanced JSON", advancedHint: "Schema keys only; omit to inherit. Arrays replace. No credentials or scripts; use existing providers.",
34
+ advanced: "Advanced JSON", advancedHint: "Use supported fields; omit to inherit. Arrays replace inherited values. Do not enter credentials or scripts.",
35
35
  invalid: "Invalid field. Check type, bounds and keys; draft retained.",
36
36
  conflict: "Revision conflict; draft retained. Review changes, then discard and reload. Refresh does not merge.",
37
37
  unavailable: "Scope unavailable; draft retained. Reconnect and refresh.",
38
38
  "not-owned": "Read-only: requires an authenticated local Host operator.",
39
39
  validation: "Host rejected configuration; draft retained. Check fields and merged constraints.",
40
- transport: "Disconnected; draft retained. Reconnect and refresh.",
41
- unconfirmed: "The native form did not confirm Save. The Host may have committed; refresh the affected source before deciding to retry. Draft retained; no automatic replay.",
40
+ transport: "Connection lost; result unknown. Draft kept. Reconnect and refresh before retrying.",
41
+ unconfirmed: "Save result unknown. Draft kept. Refresh before retrying.",
42
42
  namedIndependent: "Deepwork Profiles is a separate named JSONC runtime-resource editor in Settings. Saving here does not apply a named profile or select its model.",
43
43
  };
44
44
  export const deploymentZh = {
45
45
  title: "DSMM", summary: "全局配置与当前配置覆盖",
46
46
  description: "两层独立保存,不改原生模型或运行中会话。",
47
47
  global: "DSMM 全局配置", globalHint: "同一 Home 的 DSH 配置共用;未设置字段使用内建默认值。",
48
- profile: "当前 DSH 配置覆盖", profileHint: "仅此原生实例。普通字段 Unset 后继承 Global 与 Host base 固定值;原生 runtime 仅取 Host base/原生默认值,不继承 Global。",
48
+ profile: "当前 DSH 配置覆盖", profileHint: "仅影响此 DSH 配置。未设置字段使用全局与宿主默认值;原生运行时使用宿主默认值。",
49
49
  profileUnavailable: "不可用",
50
- unavailableForm: "当前配置只读:连接、namespace 与版本尚无已核验的可写原生表单;Global 配置仍使用独立权限。",
50
+ unavailableForm: "此 DSH 配置只读,请重连并刷新以检查编辑权限。",
51
51
  ceiling: "Deepwork 总开关仅全局可改;配置和会话模式不能突破已捕获上限。",
52
52
  hostUnknown: "宿主整包状态:未知(独立开关)。",
53
- boundaries: "新根会话在启动能力内采用已保存设置。保存不重启宿主;仅启动时生效的更改需另行重启宿主,可能取消会话。",
53
+ boundaries: "保存的设置供新会话使用。标注「需重启」的更改需另行重启宿主,可能取消会话。",
54
54
  core: "Core 核心配置", coreHint: "Core 所有的 desired 意图配置。模型参数透传为普通配置,非子插件;权限控制 enabled 仅启动时捕获。保存不改变当前会话准入;下方可检查意图、启动与准入值,不可用的准入仍为未知。",
55
- modelParametersHint: "默认开启。关闭后仍保存 custom/opaque 模型参数但不发送;DSMM reasoningEffort/reasoning_effort 两种别名采用原生默认值。标准 SDK 参数与根会话原生显式选择保留。仍可编辑原始 JSON 和精确 effort 值;保存意图不代表提供商传输已就绪。",
55
+ modelParametersHint: "关闭后停止发送自定义参数,并使用原生推理默认值;已保存的值和所选模型不变。",
56
56
  permissionControlHint: "权限控制挂载仅启动时捕获。保存配置不证明运行时覆盖,也不移除当前保护;Root 规则在权限模块内保持独立权限。",
57
- modules: "配置模块", scope: "配置作用域", close: "关闭模块", loading: "正在加载配置…", unset: "Unset——继承",
57
+ modules: "配置模块", scope: "配置范围", close: "关闭模块", loading: "正在加载配置…", unset: "使用默认配置",
58
58
  "module:run": "运行与模块", "module:routes": "模型路由与恢复", "module:workflow": "工作流、角色与技能", "module:subagents": "子 Agent 设置", "module:permissions": "权限与保护", "module:other": "其他设置", "module:state": "配置状态",
59
59
  saveScope: "保存所选配置作用域", pendingModules: "此作用域的待保存模块", savedRefreshRequired: "已保存——需刷新后继续编辑", sessionObserved: "已观测当前会话准入",
60
- noModuleFields: "所选作用域中,此模块没有可编辑的 schema 字段。",
60
+ noModuleFields: "此范围内没有可编辑的设置。",
61
61
  leaveDraft: "仍有未保存或无效草稿,请选择离开方式;不会自动保存或丢弃。", continueEditing: "继续编辑", keepDraft: "保留草稿并返回", discardDraft: "放弃草稿并离开",
62
- rootRules: "当前 Root 规则", rootRulesHint: "此事务与 Global/native 配置保存分开,需要已打开的可信 Root、可写 operator 权限及已同步运行时;不会借 Global 权限绕过拒绝。", rootRulesUnavailable: "Root 规则服务不可用,不推断或创建会话和权限。",
62
+ rootRules: "会话权限规则", rootRulesHint: "规则单独保存。请选择已打开的主会话,并确认有编辑权限且权限已同步。", rootRulesUnavailable: "权限规则不可用,请重连后刷新。",
63
63
  nativeRuntimeHint: "原生默认开启,Host base 固定值仍适用;挂载仅启动时捕获。保存只设置 desired,不会启动/停止提供商或取消当前会话;独立 Host 重启可能取消会话。",
64
- nativeRuntimeReadinessHint: "执行和 JSONL 存储由官方 Host 服务负责。此快照只报告原生执行准入就绪,不保证收件箱接受或任务完成。存储配置属于原生 JSONL 服务,不属于 DSMM。",
65
- unsetGroup: "Unset 整组——恢复继承",
64
+ nativeRuntimeReadinessHint: "任务进度可在会话中查看。",
65
+ unsetGroup: "整组使用默认配置",
66
66
  nativeRuntimeState: "已观测原生运行时", nativeRuntimeBinding: "已观测运行时组合", nativeRuntimeFence: "执行准入已就绪", nativeRuntimeRestart: "需要重启", nativeRuntimeStock: "官方 Host 运行时", nativeRuntimeUnavailable: "不可用/未知",
67
67
  "nativeRuntimeReason-explicit-composition-required": "Host 需要显式的原生运行时组合。", "nativeRuntimeReason-duplicate-provider": "存在重复原生 provider,无法确认就绪状态。", "nativeRuntimeReason-authority-not-ready": "原生执行权限尚未就绪。", "nativeRuntimeReason-disabled": "已保存的原生运行时为关闭。", "nativeRuntimeReason-pending-restart": "已保存 desired 与已挂载原生组合不同,等待独立重启。", "nativeRuntimeReason-scope-conflict": "原生 scope 所有权冲突,无法确认就绪状态。",
68
- saveGlobal: "保存全局配置", saveProfile: "保存当前配置覆盖", saving: "正在保存…", refresh: "刷新", discard: "丢弃并重载", dirty: "未保存", saved: "已保存",
68
+ saveGlobal: "保存", saveProfile: "保存", saving: "正在保存…", refresh: "刷新", discard: "丢弃并重载", dirty: "未保存", saved: "已保存",
69
69
  inherit: "继承", explicit: "覆盖", defaultPin: "固定为内建默认值", hostPin: "清除后仍有宿主固定值",
70
70
  globalSource: "全局", profileSource: "DSH 配置", defaultsSource: "内建默认", namedSource: "具名/会话", startupSource: "启动捕获", deploymentCapture: "部署捕获",
71
71
  desired: "合并后意图", startup: "启动挂载/捕获", next: "下一个根会话", session: "当前会话准入", noSession: "没有活动会话:准入状态未知。",
@@ -73,14 +73,14 @@ export const deploymentZh = {
73
73
  absent: "不存在", mixedSource: "混合来源", inspectorStale: "已保存状态,非草稿",
74
74
  pending: "等待独立重启", unknown: "未知", on: "开启", off: "关闭", state: "字段来源与实际生效状态", module: "Deepwork 子模块",
75
75
  versionObserved: "已观测元数据", versionAbsent: "未存储", versionUnknown: "版本不可用",
76
- advanced: "高级 JSON", advancedHint: "仅 schema 声明的键;省略为继承,数组整项替换。不填凭据或脚本,仅用已有提供商。",
76
+ advanced: "高级 JSON", advancedHint: "仅使用支持的字段,省略表示继承;数组整体替换继承值。请勿填写凭据或脚本。",
77
77
  invalid: "字段无效,请核对类型、范围与键;草稿保留。",
78
78
  conflict: "版本冲突,草稿保留。核对后丢弃并重载;刷新不自动合并。",
79
79
  unavailable: "作用域不可用,草稿保留;重连后刷新。",
80
80
  "not-owned": "只读:需要本地宿主已认证 operator 权限。",
81
81
  validation: "宿主拒绝配置,草稿保留;核对字段及合并约束。",
82
- transport: "连接中断,草稿保留;重连后刷新。",
83
- unconfirmed: "原生表单未确认保存结果,Host 可能已提交。请先刷新受影响的来源再决定是否重试;草稿已保留,不会自动重放。",
82
+ transport: "连接中断,结果未知,草稿已保留。请重连并刷新后再重试。",
83
+ unconfirmed: "保存结果未知,草稿已保留。请刷新后再重试。",
84
84
  namedIndependent: "设置中的 Deepwork Profiles 是独立的具名 JSONC 运行时资源编辑器。在此保存不会应用具名配置或选择其模型。",
85
85
  };
86
86
  /** Stable public field names stay visible alongside localized context. */
@@ -94,7 +94,6 @@ export const deploymentFieldLabels = {
94
94
  subagents: ["Subagents", "子 Agent"], lsp: ["LSP", "LSP"], presets: ["Preset materialization", "预设物化"],
95
95
  promptOrder: ["Prompt order", "提示词顺序"], defaultActive: ["Default Deepwork mode", "默认 Deepwork 模式"],
96
96
  enabled: ["Enabled", "启用"], materialize: ["Materialize presets", "物化预设"], scope: ["Guard scope", "保护范围"],
97
- plannerRootEnabled: ["Planner main-chat preset (restart required)", "Planner 主聊天预设(需重启)"],
98
97
  shellCommandSafety: ["Shell command safety", "Shell 命令安全"], gitWriteGuard: ["Git write policy", "Git 写入策略"],
99
98
  toolOutputTruncation: ["Tool output truncation", "工具输出截断"], maxInlineBytes: ["Inline byte limit", "内联字节上限"],
100
99
  planFormatValidation: ["Plan format validation", "计划格式校验"], questionLabelHelper: ["Question labels", "提问标签"], maxLabelChars: ["Label character limit", "标签字符上限"], todoDisciplineHelper: ["Todo discipline", "待办纪律"],
@@ -6,7 +6,7 @@ export function moduleFor(path) {
6
6
  return "run";
7
7
  if (["roleRouting", "runtimePolicy", "runtimeRecovery"].includes(key))
8
8
  return "routes";
9
- if (["workflow", "roles", "skills", "presets", "businessLocale", "locale", "promptOrder", "plannerRootEnabled"].includes(key))
9
+ if (["workflow", "roles", "skills", "presets", "businessLocale", "locale", "promptOrder"].includes(key))
10
10
  return "workflow";
11
11
  if (key === "subagents")
12
12
  return "subagents";
@@ -83,7 +83,7 @@ export async function apply(ctx) {
83
83
  document.head.append(style);
84
84
  return () => style.remove();
85
85
  }, "dsmm: core styles");
86
- const inject = () => ({ core, remote: coreCtx.remote.dsmmConfig, workspace });
86
+ const inject = () => ({ core, remote: coreCtx.remote.dsmmConfig, workspace, permissionsT: coreCtx.locale.bind(PERMISSIONS_NS) });
87
87
  coreCtx.slots.inject("plugins.bundle.config", () => coreCtx.slots.register({ name: "plugins.bundle.config", key: "@dsmm/dsmm", locale: DEPLOYMENT_NS, inject }, DeploymentPage));
88
88
  // The canonical bundle owner passes only view. Namespace comes from the authenticated snapshot.
89
89
  void coreCtx.inject(["configForms"], formCtx => {
@@ -94,6 +94,11 @@ export async function apply(ctx) {
94
94
  });
95
95
  await ctx.inject(["remote.dsmmProfiles"], (profileCtx) => {
96
96
  const controller = new ProfilesController(profileCtx.remote.dsmmProfiles);
97
+ void profileCtx.inject(["connection"], connectionCtx => {
98
+ controller.bindConnection(connectionCtx.connection.generation);
99
+ void controller.refresh();
100
+ connectionCtx.effect(() => () => controller.bindConnection(null), "dsmm: profile connection withdrawal");
101
+ });
97
102
  profiles = controller;
98
103
  profileCtx.effect(() => controller.store.subscribe(() => { deployment?.setSession(controller.store.getSnapshot().session); }));
99
104
  profileCtx.effect(() => () => { profiles = null; deployment?.setSession(null); });
@@ -107,6 +112,10 @@ export async function apply(ctx) {
107
112
  return () => style.remove();
108
113
  }, "dsmm: profile styles");
109
114
  const t = profileCtx.locale.bind(NS);
115
+ void profileCtx.inject(["conversation"], conversationCtx => {
116
+ controller.attachComposerBlocks(conversationCtx.conversation.blocks, () => t("sessionSelectionBlock"));
117
+ conversationCtx.effect(() => () => controller.attachComposerBlocks(null), "dsmm: profile composer block lifetime");
118
+ });
110
119
  profileCtx.slots.inject("settings.section", () => profileCtx.slots.register({
111
120
  name: "settings.section", id: "dsmm-profiles", order: 30,
112
121
  label: () => t("title"), locale: NS,
@@ -158,7 +167,6 @@ export async function apply(ctx) {
158
167
  modelCtx.effect(() => () => controller.attachModelInteractionSource(null, null), "dsmm: native model interaction withdrawal");
159
168
  });
160
169
  });
161
- void controller.refresh();
162
170
  });
163
171
  }
164
172
  //# sourceMappingURL=index.js.map