@dsmm/dsmm 0.3.12 → 0.3.14

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 (48) hide show
  1. package/README.md +2 -2
  2. package/docs/agent-presets.md +1 -1
  3. package/docs/compatibility.md +8 -2
  4. package/docs/deferred-native-approval-risk.md +4 -4
  5. package/docs/design.md +1 -1
  6. package/docs/lsp.md +1 -1
  7. package/docs/maintenance.md +9 -3
  8. package/docs/model-routing.md +1 -1
  9. package/docs/native-permissions.md +12 -2
  10. package/docs/profiles.md +32 -13
  11. package/docs/roadmap.md +67 -30
  12. package/docs/runtime-recovery.md +1 -1
  13. package/docs/safety-guards.md +1 -1
  14. package/docs/settings-status.md +1 -1
  15. package/docs/testing.md +85 -0
  16. package/lib/client/DeploymentPage.js +31 -2
  17. package/lib/client/PermissionsPanel.js +1 -1
  18. package/lib/client/ProfileModelsDialog.d.ts +24 -0
  19. package/lib/client/ProfileModelsDialog.js +353 -0
  20. package/lib/client/ProfilesSection.js +209 -37
  21. package/lib/client/RoleToolView-data.d.ts +7 -0
  22. package/lib/client/RoleToolView-data.js +45 -0
  23. package/lib/client/RoleToolView-locales.d.ts +5 -0
  24. package/lib/client/RoleToolView-locales.js +2 -0
  25. package/lib/client/RoleToolView.js +33 -8
  26. package/lib/client/SessionProfiles.js +24 -6
  27. package/lib/client/StructuredEditor.d.ts +32 -4
  28. package/lib/client/StructuredEditor.js +12 -40
  29. package/lib/client/children-locales.d.ts +1 -1
  30. package/lib/client/controller.d.ts +23 -1
  31. package/lib/client/controller.js +289 -8
  32. package/lib/client/diagnostics.d.ts +1 -0
  33. package/lib/client/diagnostics.js +9 -0
  34. package/lib/client/index.js +10 -2
  35. package/lib/client/locales.d.ts +29 -0
  36. package/lib/client/locales.js +54 -2
  37. package/lib/client/profile-blank.d.ts +43 -0
  38. package/lib/client/profile-blank.js +19 -0
  39. package/lib/client/styles.d.ts +1 -1
  40. package/lib/client/styles.js +96 -32
  41. package/lib/client.js +2411 -1040
  42. package/lib/command-approval.d.ts +2 -0
  43. package/lib/command-approval.js +4 -1
  44. package/lib/index.js +2 -1
  45. package/lib/native-admission.d.ts +10 -3
  46. package/lib/native-admission.js +129 -28
  47. package/lib/profile-runtime.js +3 -5
  48. package/package.json +7 -2
@@ -31,7 +31,7 @@ function menuIssue(issue) {
31
31
  export function SessionScopeFeedback({ state, t }) {
32
32
  const session = state.session;
33
33
  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");
34
- return _jsxs("div", { "data-dsmm-session-feedback": true, children: [session?.warnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("admissionWarnings") }), _jsx(ProfileWarnings, { warnings: session.warnings, t: t })] }) : null, 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") }), state.sessionIssue !== null && _jsxs(_Fragment, { children: [_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")
34
+ return _jsxs("div", { "data-dsmm-session-feedback": true, children: [session?.warnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("admissionWarnings") }), _jsx(ProfileWarnings, { warnings: session.warnings, t: t })] }) : null, 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(state.sessionIssue?.code === "blank-identity-unconfirmed" ? "sessionPreparationUnknown" : "sessionUnconfirmedRefresh") }), state.sessionIssue !== null && _jsxs(_Fragment, { children: [_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")
35
35
  : state.sessionIssue.code === "conflict" ? t("sessionConflict")
36
36
  : ["busy", "maintenance", "disposed", "not-owned"].includes(state.sessionIssue.code) ? t("sessionBusy", { reason: state.sessionIssue.code })
37
37
  : t(state.sessionIssue.code === "validation" ? "validation" : "sessionUnavailable") }), _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 })] });
@@ -54,7 +54,11 @@ export function SessionScope({ state, actions, t, compact = false, showFeedback
54
54
  catch {
55
55
  binding = undefined;
56
56
  }
57
- 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 !== 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())
57
+ 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 ? _jsxs(_Fragment, { children: [_jsx("p", { className: "dsmm-hint", children: t(state.sessionPreparationAvailable ? "sessionChooseWorkspace" : "sessionPreparationUnavailable") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-workspace`, children: t("sessionWorkspace") }), _jsxs("select", { id: `${prefix}-workspace`, value: state.sessionWorkspaceId ?? "", disabled: !state.sessionPreparationAvailable || disabled, onChange: event => { if (current())
58
+ void actions.chooseSessionWorkspace(event.currentTarget.value); }, children: [_jsx("option", { value: "", children: t("sessionWorkspacePlaceholder") }), state.sessionWorkspaces.map(workspace => _jsx("option", { value: workspace.id, children: workspace.label }, workspace.id))] })] }), state.sessionWorkspaces.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("sessionNoWorkspaces") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-choice`, children: t("sessionSelect") }), _jsxs("select", { id: `${prefix}-choice`, value: state.sessionChoice ?? "", disabled: !state.sessionPreparationAvailable || disabled || state.sessionUnconfirmed, onChange: event => { if (current())
59
+ actions.chooseSessionProfile(event.currentTarget.value || null); }, children: [_jsx("option", { value: "", children: t("sessionBaseline") }), state.snapshot?.profiles.map(profile => _jsx("option", { value: profile.id, disabled: !isConfigRevision(profile.revision) || profile.error !== undefined, children: profile.label?.trim() || profile.id }, profile.id))] })] }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: !state.sessionPreparationAvailable || disabled || state.sessionUnconfirmed || state.snapshot === null, onClick: () => { if (current())
60
+ void actions.applySession(); }, children: t("sessionPrepare") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.sessionBusy !== null || state.busy !== null || state.pendingEditor !== null, onClick: () => { if (current())
61
+ void actions.refreshSession(); }, children: t("sessionRefresh") })] })] }) : _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 !== 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())
58
62
  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", id: `${prefix}-model-hint`, children: t("useSessionProfileModelDesc") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled || !modelAllowed, "aria-describedby": `${prefix}-model-hint${!modelAllowed ? ` ${prefix}-model-reason` : ""}`, onClick: () => { if (current())
59
63
  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 }) })] })] }), _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())
60
64
  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())
@@ -81,10 +85,11 @@ export function SessionProfiles(props) {
81
85
  const unavailable = id === null || committing || state.busy !== null || state.sessionUnconfirmed || session === null || session.refreshRequired === true || session.selection.refreshRequired === true;
82
86
  const profileDisabled = unavailable || state.pendingEditor !== null || state.dirty || state.invalidFields.length > 0
83
87
  || session === null || !writableSelectionVersion(session.selection.selectionRevision);
84
- const disabled = profileDisabled || session?.canApplyOverlay !== true || session?.applyOverlayUnavailableReason === "new-session-required" || state.snapshot === null;
88
+ const sessionlessDisabled = !state.sessionPreparationAvailable || committing || state.busy !== null || state.sessionUnconfirmed || state.pendingEditor !== null || state.dirty || state.invalidFields.length > 0 || state.snapshot === null;
89
+ const disabled = id === null ? sessionlessDisabled : profileDisabled || session?.canApplyOverlay !== true || session?.applyOverlayUnavailableReason === "new-session-required" || state.snapshot === null;
85
90
  let feedback = "";
86
91
  if (state.sessionUnconfirmed)
87
- feedback = t("sessionUnconfirmedRefresh");
92
+ feedback = t(state.sessionIssue?.code === "blank-identity-unconfirmed" ? "sessionPreparationUnknown" : "sessionUnconfirmedRefresh");
88
93
  else if (session?.refreshRequired || session?.selection.refreshRequired)
89
94
  feedback = t("sessionCommittedRefresh");
90
95
  else if (state.sessionIssue !== null)
@@ -97,7 +102,7 @@ export function SessionProfiles(props) {
97
102
  else if (state.dirty || state.invalidFields.length > 0 || state.pendingEditor !== null)
98
103
  feedback = t("headerDraft");
99
104
  else if (id === null)
100
- feedback = t("sessionChooseWorkspace");
105
+ feedback = t(!state.sessionPreparationAvailable ? "sessionPreparationUnavailable" : state.sessionWorkspaceId === null ? "sessionChooseWorkspace" : "sessionPrepareHint");
101
106
  else if (session === null || state.snapshot === null)
102
107
  feedback = t("headerUnavailable");
103
108
  else if (state.sessionNotice !== null)
@@ -125,6 +130,13 @@ export function SessionProfiles(props) {
125
130
  entries.push({ id: admission.selectedId, label: `${admission.selectedId} — ${t("headerSavedUnavailable")}`, disabled: true });
126
131
  if (unknownCaptured)
127
132
  entries.push({ id: "__dsmm_captured_default__", label: t("headerCaptured"), disabled: true });
133
+ if (id === null) {
134
+ entries.push({ type: "separator", id: "@workspace-separator" }, { type: "label", id: "@workspace-heading", text: state.sessionPreparationPending ? t("sessionPendingProfile", { profile: profiles.find(profile => profile.id === state.sessionChoice)?.label?.trim() || state.sessionChoice || t("sessionBaseline") }) : t("sessionWorkspace") });
135
+ for (const workspace of state.sessionWorkspaces)
136
+ entries.push({ id: `@workspace:${workspace.id}`, label: `${workspace.id === state.sessionWorkspaceId ? "✓ " : ""}${workspace.label}`, disabled: !state.sessionPreparationAvailable || state.dirty || state.invalidFields.length > 0 || state.pendingEditor !== null || state.busy !== null });
137
+ if (state.sessionWorkspaces.length === 0)
138
+ entries.push({ type: "label", id: "@no-workspaces", text: t("sessionNoWorkspaces") });
139
+ }
128
140
  entries.push({ type: "separator", id: "@keep-separator" }, { type: "label", id: "@keep-heading", text: t("headerCompactProfiles") }, { id: "", label: t("sessionBaseline"), disabled });
129
141
  if (session !== null && (session.canApplyOverlay !== true || session.applyOverlayUnavailableReason === "new-session-required"))
130
142
  entries.push({ type: "label", id: "@overlay-reason", text: capabilityReason(session.applyOverlayUnavailableReason, t) });
@@ -141,13 +153,17 @@ export function SessionProfiles(props) {
141
153
  if (value === "@refresh") {
142
154
  if (committing || state.busy !== null)
143
155
  return;
144
- void (async () => { await props.refresh(); if (id !== null && props.readProfileView().currentSessionId === id && props.readProfileView().sessionViewEpoch === state.sessionViewEpoch)
156
+ void (async () => { await props.refresh(); if (props.readProfileView().currentSessionId === id && props.readProfileView().sessionViewEpoch === state.sessionViewEpoch)
145
157
  await props.refreshSession(); })();
146
158
  }
147
159
  else {
148
160
  const row = entries.find((entry) => entry.id === value && !("type" in entry));
149
161
  if (row === undefined || !("disabled" in row) || row.disabled)
150
162
  return;
163
+ if (value.startsWith("@workspace:")) {
164
+ void props.chooseSessionWorkspace(value.slice("@workspace:".length));
165
+ return;
166
+ }
151
167
  if (value === "@mode") {
152
168
  if (mode !== undefined)
153
169
  void props.setDeepwork(!mode.active);
@@ -157,6 +173,8 @@ export function SessionProfiles(props) {
157
173
  else {
158
174
  props.chooseSessionProfile(value || null);
159
175
  void props.applySession();
176
+ if (id === null && state.sessionWorkspaceId === null)
177
+ return;
160
178
  }
161
179
  }
162
180
  setOpenFor(undefined);
@@ -1,11 +1,22 @@
1
1
  import type { Ref } from "react";
2
2
  import type { PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
3
3
  import type { ModelCatalog } from "@deepseek-ai/dsh-api-session-controller";
4
- import type { DsmmModelRoute } from "../settings.js";
4
+ import type { DsmmInvocationLevel, DsmmLevelOverride, DsmmModelRoute } from "../settings.js";
5
+ import type { DsmmRateLimitPolicy, DsmmRuntimePolicyConfig, DsmmRuntimePolicySettings } from "../routing-policy.js";
5
6
  import type { ProfilesActions, ProfilesViewSnapshot } from "./controller.js";
6
- import type { JsonPath } from "./structured.js";
7
+ import type { JsonPath, StructuredDocument } from "./structured.js";
7
8
  type Locale = PropsLocale<"settings.dsmm-profiles">;
8
9
  type Edit = ProfilesActions["editPath"];
10
+ export declare function RetryNumber({ id, name, field, value, inherited, path, disabled, actions, t }: Locale & {
11
+ id: string;
12
+ name: string;
13
+ field: keyof DsmmRateLimitPolicy;
14
+ value: number | undefined;
15
+ inherited: number | undefined;
16
+ path: JsonPath;
17
+ disabled: boolean;
18
+ actions: ProfilesActions;
19
+ }): import("react").JSX.Element;
9
20
  export declare function RouteFields({ value, path, name, catalog, disabled, edit, editRoute, t, naturalLabels }: Locale & {
10
21
  value: DsmmModelRoute;
11
22
  path: JsonPath;
@@ -16,6 +27,22 @@ export declare function RouteFields({ value, path, name, catalog, disabled, edit
16
27
  editRoute: ProfilesActions["editRoute"];
17
28
  naturalLabels?: boolean;
18
29
  }): import("react").JSX.Element;
30
+ export declare function PolicyFields({ value, inherited, path, name, disabled, actions, t }: Locale & {
31
+ value: DsmmRuntimePolicyConfig;
32
+ inherited: DsmmRuntimePolicySettings | undefined;
33
+ path: JsonPath;
34
+ name: string;
35
+ disabled: boolean;
36
+ actions: ProfilesActions;
37
+ }): import("react").JSX.Element;
38
+ export declare function LevelFields({ level, value, path, catalog, disabled, actions, t }: Locale & {
39
+ level: Exclude<DsmmInvocationLevel, "normal">;
40
+ value?: DsmmLevelOverride;
41
+ path: JsonPath;
42
+ catalog: ModelCatalog | null;
43
+ disabled: boolean;
44
+ actions: ProfilesActions;
45
+ }): import("react").JSX.Element;
19
46
  export type BasicSettingsProps = Locale & {
20
47
  state: ProfilesViewSnapshot;
21
48
  actions: ProfilesActions;
@@ -30,9 +57,10 @@ export type AdvancedSettingsProps = Locale & {
30
57
  state: ProfilesViewSnapshot;
31
58
  actions: ProfilesActions;
32
59
  disabled: boolean;
33
- onJumpToOrchestrator?: () => void;
60
+ document?: StructuredDocument | null;
61
+ isInvalidProjection?: boolean;
34
62
  };
35
- export declare function AdvancedSettings({ state, actions, disabled, onJumpToOrchestrator, t }: AdvancedSettingsProps): import("react").JSX.Element | null;
63
+ export declare function AdvancedSettings({ state, actions, disabled, document: propDoc, isInvalidProjection: propInvalid, t }: AdvancedSettingsProps): import("react").JSX.Element | null;
36
64
  /** The same raw draft drives every control; there is no form-to-document rewrite. */
37
65
  export declare function StructuredEditor({ state, actions, disabled, t }: Locale & {
38
66
  state: ProfilesViewSnapshot;
@@ -1,13 +1,12 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useId, useRef, useState } from "react";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useId, useState } from "react";
3
3
  import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
4
4
  import { DSMM_LOCALES } from "../profile-locale.js";
5
- import { DSMM_RATE_LIMIT_BOUNDS, normalizeRateLimitPolicy } from "../routing-policy.js";
5
+ import { DSMM_RATE_LIMIT_BOUNDS } from "../routing-policy.js";
6
6
  import { structuredDocument } from "./structured.js";
7
7
  import { RETRY_FIELD_LABEL_KEYS } from "./locales.js";
8
- import { RoleAvailability, roleAvailability } from "./RoleAvailability.js";
9
8
  import { EditableChoice } from "./EditableChoice.js";
10
- function RetryNumber({ id, name, field, value, inherited, path, disabled, actions, t }) {
9
+ export function RetryNumber({ id, name, field, value, inherited, path, disabled, actions, t }) {
11
10
  const key = path.join(".");
12
11
  const stored = actions.getNumberDraft?.(key);
13
12
  const sourceChanged = stored !== undefined && value !== stored.sourceValue;
@@ -60,11 +59,11 @@ export function RouteFields({ value, path, name, catalog, disabled, edit, editRo
60
59
  const effortLabel = naturalLabels ? t("naturalEffort") : t("routeEffort", { name: name ?? "" });
61
60
  return _jsxs("div", { className: "dsmm-route-fields", children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-provider`, children: providerLabel }), _jsx(EditableChoice, { id: `${prefix}-provider`, label: providerLabel, value: value.provider, options: providers, disabled: disabled, onChange: provider => updateModel(provider, value.model), onSelect: provider => updateModel(provider, "") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-model`, children: modelLabel }), _jsx(EditableChoice, { id: `${prefix}-model`, label: modelLabel, value: value.model, options: group?.models ?? [], disabled: disabled, onChange: modelId => updateModel(value.provider, modelId) })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-effort`, children: effortLabel }), _jsx(EditableChoice, { id: `${prefix}-effort`, label: effortLabel, value: value.reasoningEffort ?? "", options: efforts, disabled: disabled, placeholder: t("effortDefault"), onChange: effort => edit([...path, "reasoningEffort"], effort || undefined) })] })] });
62
61
  }
63
- function PolicyFields({ value, inherited, path, name, disabled, actions, t }) {
62
+ export function PolicyFields({ value, inherited, path, name, disabled, actions, t }) {
64
63
  const prefix = useId();
65
64
  return _jsxs("div", { className: "dsmm-policy-fields", children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-strategy`, children: t("strategy", { name }) }), _jsxs("select", { id: `${prefix}-strategy`, disabled: disabled, value: value.strategy ?? "", onChange: (event) => actions.editPath([...path, "strategy"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inheritStrategy", { value: inherited?.strategy ?? t("unknownDefault") }) }), _jsx("option", { value: "startup-lock", children: t("startupLock") }), _jsx("option", { value: "rate-limit-fallback", children: t("rateFallback") })] })] }), _jsx("p", { className: "dsmm-hint", children: t("strategyHint") }), _jsx("div", { className: "dsmm-route-fields", children: Object.keys(DSMM_RATE_LIMIT_BOUNDS).map((field) => (_jsx(RetryNumber, { id: `${prefix}-${field}`, t: t, name: name, field: field, value: value.rateLimit?.[field], inherited: inherited?.rateLimit[field], path: [...path, "rateLimit", field], disabled: disabled, actions: actions }, field))) })] });
66
65
  }
67
- function LevelFields({ level, value, path, catalog, disabled, actions, t }) {
66
+ export function LevelFields({ level, value, path, catalog, disabled, actions, t }) {
68
67
  const prefix = useId();
69
68
  const mode = value === undefined ? "inherit" : value.provider === undefined ? "effort" : "route";
70
69
  return _jsxs("fieldset", { "data-dsmm-level": level, children: [_jsx("legend", { children: t("levelName", { level }) }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-mode`, children: t("levelMode", { level }) }), _jsxs("select", { id: `${prefix}-mode`, value: mode, disabled: disabled, onChange: event => actions.editPath(path, event.currentTarget.value === "inherit" ? undefined : event.currentTarget.value === "effort" ? { reasoningEffort: "" } : { provider: "", model: "" }), children: [_jsx("option", { value: "inherit", children: t("levelUnconfigured") }), _jsx("option", { value: "effort", children: t("levelEffortOnly") }), _jsx("option", { value: "route", children: t("levelFullRoute") })] })] }), mode === "effort" && _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-effort`, children: t("routeEffort", { name: level }) }), _jsx(EditableChoice, { id: `${prefix}-effort`, label: t("routeEffort", { name: level }), value: value?.reasoningEffort ?? "", options: [], disabled: disabled, onChange: effort => actions.editPath([...path, "reasoningEffort"], effort) })] }), value?.provider !== undefined && _jsx(RouteFields, { value: value, path: path, name: t("levelName", { level }), catalog: catalog, disabled: disabled, edit: actions.editPath, editRoute: actions.editRoute, t: t })] });
@@ -82,50 +81,23 @@ export function BasicSettings({ state, actions, disabled, inputRef, idInvalid, o
82
81
  const orchPath = ["settings", "roleRouting", "dsmm-orchestrator"];
83
82
  return _jsxs("div", { className: "dsmm-basic-settings", "data-dsmm-basic-settings": true, children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-label`, children: t("profileLabel") }), _jsx(Input, { id: `${prefix}-label`, className: "dsmm-input", value: document.label ?? "", disabled: disabled, onChange: (event) => actions.editPath(["label"], event.currentTarget.value) }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled || document.label === undefined, onClick: () => actions.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: disabled || editor.revision !== null, "aria-invalid": idInvalid || undefined, "aria-describedby": `${prefix}-id-hint${idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => actions.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: disabled, value: orchPolicy.primary === undefined ? "inherit" : "explicit", onChange: (event) => actions.editPath([...orchPath, "primary"], event.currentTarget.value === "inherit" ? undefined : { provider: "", model: "" }), children: [_jsx("option", { value: "inherit", children: t("inheritRoute") }), _jsx("option", { value: "explicit", children: t("configuredRoute") })] }), orchPolicy.primary !== undefined && _jsx(RouteFields, { t: t, value: orchPolicy.primary, path: [...orchPath, "primary"], naturalLabels: true, catalog: state.catalog, disabled: disabled, edit: actions.editPath, editRoute: actions.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(document.settings.locale ?? ""), disabled: disabled, "aria-describedby": `${prefix}-locale-hint`, onChange: event => actions.editPath(["settings", "locale"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inheritLocale") }), typeof document.settings.locale === "string" && !DSMM_LOCALES.includes(document.settings.locale) && _jsx("option", { value: document.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: disabled, value: document.settings.defaultActive === undefined ? "" : String(document.settings.defaultActive), onChange: (event) => actions.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") })] })] });
84
83
  }
85
- export function AdvancedSettings({ state, actions, disabled, onJumpToOrchestrator, t }) {
84
+ export function AdvancedSettings({ state, actions, disabled, document: propDoc, isInvalidProjection: propInvalid, t }) {
86
85
  const prefix = useId();
87
- const [selectedRole, setSelectedRole] = useState("dsmm-orchestrator");
88
86
  const editor = state.editor;
89
87
  if (editor === null)
90
88
  return null;
91
- const rawDoc = structuredDocument(editor.content);
92
- const lastValidDocRef = useRef(null);
93
- if (rawDoc !== null) {
94
- lastValidDocRef.current = rawDoc;
95
- }
96
- const document = rawDoc ?? lastValidDocRef.current;
97
- const isInvalidProjection = rawDoc === null;
98
- if (document === null)
89
+ const rawDoc = propDoc !== undefined ? propDoc : structuredDocument(editor.content);
90
+ const isInvalidProjection = propInvalid !== undefined ? propInvalid : (rawDoc === null);
91
+ if (rawDoc === null)
99
92
  return _jsx("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") });
93
+ const document = rawDoc;
100
94
  const effectiveDisabled = disabled || isInvalidProjection;
101
- const roles = state.snapshot?.roles ?? [];
102
- const role = roles.find((candidate) => candidate.id === selectedRole) ?? roles[0];
103
- const policy = role === undefined ? undefined : document.roleRouting[role.id] ?? {};
104
95
  const baseline = state.snapshot?.editorDefaults;
105
- let inherited;
106
- try {
107
- if (baseline !== undefined) {
108
- const profileDefaults = { strategy: document.runtimePolicy.strategy ?? baseline.strategy, rateLimit: normalizeRateLimitPolicy(document.runtimePolicy.rateLimit, baseline.rateLimit) };
109
- inherited = { strategy: role?.runtimePolicy?.strategy ?? profileDefaults.strategy, rateLimit: normalizeRateLimitPolicy(role?.runtimePolicy?.rateLimit, profileDefaults.rateLimit) };
110
- }
111
- }
112
- catch { /* Invalid effective values remain a raw/Host validation error. */ }
113
- const rolePath = ["settings", "roleRouting", role?.id ?? ""];
114
- const availability = roleAvailability(role?.availability);
115
- const namedRoles = document.settings.roles;
116
96
  const topology = document.settings.subagents?.toolTopology;
117
97
  const gitGuard = document.guards?.gitWriteGuard;
118
98
  const gitScope = document.guards?.gitWriteScope;
119
99
  const isGuardOff = gitGuard === "off";
120
- return _jsxs("div", { className: "dsmm-structured", "data-dsmm-structured": true, children: [isInvalidProjection && _jsx("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-role`, children: t("roleSelect") }), _jsxs("select", { id: `${prefix}-role`, disabled: effectiveDisabled || roles.length === 0, value: role?.id ?? "", onChange: (event) => setSelectedRole(event.currentTarget.value), children: [roles.length === 0 && _jsx("option", { value: "", children: t("rolesUnavailable") }), roles.map((candidate) => _jsxs("option", { value: candidate.id, children: [candidate.label, candidate.enabled ? "" : ` — ${t("roleDisabled")}`] }, candidate.id))] })] }), role !== undefined && policy !== undefined && _jsxs("fieldset", { "data-dsmm-role": role.id, children: [_jsx("legend", { children: role.label }), _jsx(RoleAvailability, { value: role.availability, t: t }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-role-enabled`, children: t("namedRole", { name: role.label }) }), _jsxs("select", { id: `${prefix}-role-enabled`, value: namedRoles?.[role.id] === undefined ? "" : String(namedRoles[role.id]), disabled: effectiveDisabled, "aria-describedby": `${prefix}-role-hint`, onChange: event => actions.editPath(["settings", "roles", role.id], event.currentTarget.value === "" ? undefined : event.currentTarget.value === "true"), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "true", disabled: availability === undefined || !availability.startupAvailable || !availability.deploymentEnabled || availability.reason === "module-off", children: t("enabled") }), _jsx("option", { value: "false", disabled: availability === undefined || availability.required, children: t("disabled") })] }), _jsx("p", { id: `${prefix}-role-hint`, className: "dsmm-hint", children: t("namedRoleHint") })] }), _jsx(PolicyFields, { t: t, value: policy, inherited: inherited, path: rolePath, name: role.label, disabled: effectiveDisabled, actions: actions }), role.id === "dsmm-orchestrator" ? _jsxs("div", { className: "dsmm-field", children: [_jsx("p", { className: "dsmm-hint", children: t("orchestratorInBasicNotice") }), onJumpToOrchestrator && _jsx(Button, { type: "button", variant: "outline", onClick: onJumpToOrchestrator, children: t("orchestratorJumpToBasic") }), _jsx("p", { className: "dsmm-hint", children: t("orchestratorLevels") })] }) : _jsxs(_Fragment, { children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-primary-mode`, children: t("primaryMode", { name: role.label }) }), _jsxs("select", { id: `${prefix}-primary-mode`, disabled: effectiveDisabled, value: policy.primary === undefined ? "inherit" : "explicit", onChange: (event) => actions.editPath([...rolePath, "primary"], event.currentTarget.value === "inherit" ? undefined : { provider: "", model: "" }), children: [_jsx("option", { value: "inherit", children: t("inheritRoute") }), _jsx("option", { value: "explicit", children: t("configuredRoute") })] })] }), policy.primary !== undefined && _jsx(RouteFields, { t: t, value: policy.primary, path: [...rolePath, "primary"], name: t("primaryName", { name: role.label }), catalog: state.catalog, disabled: effectiveDisabled, edit: actions.editPath, editRoute: actions.editRoute }), _jsx("p", { className: "dsmm-hint", children: t("effortChangeHint") }), _jsx("p", { className: "dsmm-hint", children: t("normalLevel") }), _jsx("p", { className: "dsmm-hint", children: t("levelsHint") }), ["low", "high", "max"].map(level => _jsx(LevelFields, { level: level, value: policy.levels?.[level], path: [...rolePath, "levels", level], catalog: state.catalog, disabled: effectiveDisabled, actions: actions, t: t }, level))] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-fallback-mode`, children: t("fallbackMode", { name: role.label }) }), _jsxs("select", { id: `${prefix}-fallback-mode`, disabled: effectiveDisabled, value: policy.fallbackRoutes === undefined ? "inherit" : "explicit", onChange: (event) => actions.editPath([...rolePath, "fallbackRoutes"], event.currentTarget.value === "inherit" ? undefined : []), children: [_jsx("option", { value: "inherit", children: t("inheritChain") }), _jsx("option", { value: "explicit", children: t("configuredChain") })] })] }), policy.fallbackRoutes?.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("emptyChain") }), policy.fallbackRoutes?.map((candidate, index) => {
121
- const name = t("fallbackName", { name: role.label, index: index + 1 });
122
- return _jsxs("fieldset", { children: [_jsx("legend", { children: name }), _jsx(RouteFields, { t: t, value: candidate, path: [...rolePath, "fallbackRoutes", index], name: name, catalog: state.catalog, disabled: effectiveDisabled, edit: actions.editPath, editRoute: actions.editRoute }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: effectiveDisabled || index === 0, onClick: () => actions.moveFallback(role.id, index, index - 1), children: t("moveUp", { name }) }), _jsx(Button, { type: "button", variant: "outline", disabled: effectiveDisabled || index === policy.fallbackRoutes.length - 1, onClick: () => actions.moveFallback(role.id, index, index + 1), children: t("moveDown", { name }) }), _jsx(Button, { type: "button", variant: "outline", disabled: effectiveDisabled, onClick: () => actions.editPath([...rolePath, "fallbackRoutes", index], undefined), children: t("removeFallback", { name }) })] })] }, index);
123
- }), _jsx(Button, { type: "button", variant: "outline", disabled: effectiveDisabled || (policy.fallbackRoutes?.length ?? 0) >= 32, onClick: () => {
124
- if (policy.fallbackRoutes === undefined)
125
- actions.editPath([...rolePath, "fallbackRoutes"], [{ provider: "", model: "" }]);
126
- else
127
- actions.editPath([...rolePath, "fallbackRoutes", policy.fallbackRoutes.length], { provider: "", model: "" });
128
- }, children: t("addFallback", { name: role.label }) })] }, role.id), _jsxs("fieldset", { children: [_jsx("legend", { children: t("profileDefaults") }), _jsx(PolicyFields, { t: t, value: document.runtimePolicy, inherited: baseline, path: ["settings", "runtimePolicy"], name: t("profileDefaults"), disabled: effectiveDisabled, actions: actions })] }), _jsxs("fieldset", { className: "dsmm-git-guard", children: [_jsx("legend", { children: t("gitWriteGuard") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-git-guard`, children: t("gitWriteGuard") }), _jsxs("select", { id: `${prefix}-git-guard`, disabled: effectiveDisabled, value: gitGuard ?? "", "aria-describedby": `${prefix}-git-guard-hint`, onChange: event => actions.editPath(["settings", "guards", "gitWriteGuard"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "ask", children: t("gitWriteAsk") }), _jsx("option", { value: "deny", children: t("gitWriteDeny") }), _jsx("option", { value: "off", children: t("gitWriteOff") })] }), _jsx("p", { id: `${prefix}-git-guard-hint`, className: "dsmm-hint", children: t("gitWriteGuardHint") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-git-scope`, children: t("gitWriteScope") }), _jsxs("select", { id: `${prefix}-git-scope`, disabled: effectiveDisabled, value: gitScope ?? "", "aria-describedby": `${prefix}-git-scope-hint`, onChange: event => actions.editPath(["settings", "guards", "gitWriteScope"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "all-writes", disabled: isGuardOff, children: t("gitWriteAllWrites") }), _jsx("option", { value: "high-risk", disabled: isGuardOff, children: t("gitWriteHighRisk") })] }), isGuardOff && _jsx("p", { id: `${prefix}-git-scope-hint`, className: "dsmm-hint", children: t("gitWriteScopeDisabledHint") })] })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-topology`, children: t("toolTopology") }), _jsxs("select", { id: `${prefix}-topology`, value: topology ?? "", disabled: effectiveDisabled, "aria-describedby": `${prefix}-topology-hint`, onChange: event => actions.editPath(["settings", "subagents", "toolTopology"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "per-role", children: t("topologyPerRole") }), _jsx("option", { value: "parameterized", children: t("topologyParameterized") })] }), _jsx("p", { id: `${prefix}-topology-hint`, className: "dsmm-hint", children: t("topologyHint") })] })] });
100
+ return _jsxs("div", { className: "dsmm-structured", "data-dsmm-structured": true, children: [isInvalidProjection && _jsx("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") }), _jsxs("fieldset", { children: [_jsx("legend", { children: t("profileDefaults") }), _jsx(PolicyFields, { t: t, value: document.runtimePolicy, inherited: baseline, path: ["settings", "runtimePolicy"], name: t("profileDefaults"), disabled: effectiveDisabled, actions: actions })] }), _jsxs("fieldset", { className: "dsmm-git-guard", children: [_jsx("legend", { children: t("gitWriteGuard") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-git-guard`, children: t("gitWriteGuard") }), _jsxs("select", { id: `${prefix}-git-guard`, disabled: effectiveDisabled, value: gitGuard ?? "", "aria-describedby": `${prefix}-git-guard-hint`, onChange: event => actions.editPath(["settings", "guards", "gitWriteGuard"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "ask", children: t("gitWriteAsk") }), _jsx("option", { value: "deny", children: t("gitWriteDeny") }), _jsx("option", { value: "off", children: t("gitWriteOff") })] }), _jsx("p", { id: `${prefix}-git-guard-hint`, className: "dsmm-hint", children: t("gitWriteGuardHint") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-git-scope`, children: t("gitWriteScope") }), _jsxs("select", { id: `${prefix}-git-scope`, disabled: effectiveDisabled, value: gitScope ?? "", "aria-describedby": `${prefix}-git-scope-hint`, onChange: event => actions.editPath(["settings", "guards", "gitWriteScope"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "all-writes", disabled: isGuardOff, children: t("gitWriteAllWrites") }), _jsx("option", { value: "high-risk", disabled: isGuardOff, children: t("gitWriteHighRisk") })] }), isGuardOff && _jsx("p", { id: `${prefix}-git-scope-hint`, className: "dsmm-hint", children: t("gitWriteScopeDisabledHint") })] })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-topology`, children: t("toolTopology") }), _jsxs("select", { id: `${prefix}-topology`, value: topology ?? "", disabled: effectiveDisabled, "aria-describedby": `${prefix}-topology-hint`, onChange: event => actions.editPath(["settings", "subagents", "toolTopology"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "per-role", children: t("topologyPerRole") }), _jsx("option", { value: "parameterized", children: t("topologyParameterized") })] }), _jsx("p", { id: `${prefix}-topology-hint`, className: "dsmm-hint", children: t("topologyHint") })] })] });
129
101
  }
130
102
  /** The same raw draft drives every control; there is no form-to-document rewrite. */
131
103
  export function StructuredEditor({ state, actions, disabled, t }) {
@@ -259,8 +259,8 @@ export declare const childrenLocaleZh: {
259
259
  pending: string;
260
260
  yes: string;
261
261
  no: string;
262
- activity: string;
263
262
  runtime: string;
263
+ activity: string;
264
264
  refresh: string;
265
265
  images: string;
266
266
  title: string;
@@ -2,13 +2,14 @@ import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
2
  import type { HostObservable } from "@deepseek-ai/dsh-client-ui-slots";
3
3
  import type { ConnectionGenerationState } from "@deepseek-ai/dsh-client-connection/client";
4
4
  import type { ComposerBlocks } from "@deepseek-ai/dsh-client-ui-conversation/client";
5
- import type { SessionEventSource } from "@deepseek-ai/dsh-api-session-controller/client";
5
+ import type { SessionEventSource, SessionSnapshot } from "@deepseek-ai/dsh-api-session-controller/client";
6
6
  import type { ModelDirectoryState } from "@deepseek-ai/dsh-client-ui-model-selection/client";
7
7
  import type { DsmmProfilesRemote } from "../profile-remote.js";
8
8
  import type { ProfileDiagnostic, ProfileDiagnosticCode, ProfileDiagnosticLocation, ProfileErrorInfo, ProfileReadResult, ProfileSnapshot } from "../profile-types.js";
9
9
  import type { SessionProfileSnapshot } from "../profile-types.js";
10
10
  import type { ModelCatalog, SessionSelectModelRequest, SessionSelectModelValue } from "@deepseek-ai/dsh-api-session-controller";
11
11
  import type { JsonPath } from "./structured.js";
12
+ import type { ProfileBlankNative, ProfileWorkspace } from "./profile-blank.js";
12
13
  export interface ProfileEditor {
13
14
  id: string;
14
15
  content: string;
@@ -48,6 +49,10 @@ export interface ProfilesViewSnapshot {
48
49
  sessionUnconfirmed: boolean;
49
50
  session: SessionProfileSnapshot | null;
50
51
  sessionChoice: string | null;
52
+ sessionWorkspaces: readonly ProfileWorkspace[];
53
+ sessionWorkspaceId: string | null;
54
+ sessionPreparationAvailable: boolean;
55
+ sessionPreparationPending: boolean;
51
56
  sessionBusy: "read" | "apply" | "reset" | "mode" | null;
52
57
  sessionIssue: ProfilesIssue | null;
53
58
  sessionNotice: "applied" | "reset" | "applied-with-model" | "mode-on" | "mode-off" | null;
@@ -75,6 +80,7 @@ export interface ProfilesActions {
75
80
  refreshCatalog(): Promise<void>;
76
81
  refreshSession(): Promise<void>;
77
82
  chooseSessionProfile(id: string | null): void;
83
+ chooseSessionWorkspace(id: string): Promise<void>;
78
84
  applySession(options?: SessionApplyOptions): Promise<void>;
79
85
  resetSession(): Promise<void>;
80
86
  setDeepwork(active: boolean): Promise<void>;
@@ -107,6 +113,9 @@ export declare class ProfilesController {
107
113
  private generation;
108
114
  private disposed;
109
115
  private sessionGeneration;
116
+ private blankNative;
117
+ private stopWorkspaces;
118
+ private preparation;
110
119
  private pendingSessionSelections;
111
120
  private connection;
112
121
  private connectionBaseline;
@@ -129,6 +138,9 @@ export declare class ProfilesController {
129
138
  private modelEventsWatermark;
130
139
  private modeEventsWatermark;
131
140
  private modeRefreshPending;
141
+ private sessionSource;
142
+ private sessionSourceId;
143
+ private stopSessionSource;
132
144
  private stopModelEvents;
133
145
  private modelInteraction;
134
146
  private modelInteractionSessionId;
@@ -144,11 +156,21 @@ export declare class ProfilesController {
144
156
  dispose(): void;
145
157
  bindConnection(source: ConnectionGenerationState | null): void;
146
158
  private connectionCurrent;
159
+ attachBlankNative(native: ProfileBlankNative | null): void;
160
+ private releasePreparation;
161
+ private cancelPreparation;
162
+ private chooseSessionWorkspace;
163
+ private preparationOwned;
164
+ private preparationCurrent;
165
+ private preparationConfirmed;
166
+ private openPrepared;
167
+ private prepareSession;
147
168
  attachComposerBlocks(blocks: ComposerBlocks | null, reason?: () => string): void;
148
169
  private releaseComposerBlock;
149
170
  private syncComposerBlock;
150
171
  attachModelSelector(remote: ProfileModelSelectorRemote | null): void;
151
172
  attachModelSelectionSource(sessionId: string | null, source: HostObservable<unknown> | null): void;
173
+ attachSessionSource(sessionId: string | null, source: HostObservable<SessionSnapshot> | null): void;
152
174
  attachModelEventSource(sessionId: string | null, source: SessionEventSource | null): void;
153
175
  attachModelInteractionSource(sessionId: string | null, source: ModelInteractionSource | null): void;
154
176
  attachCatalog(remote: ModelCatalogRemote | null): void;