@dsmm/dsmm 0.3.11 → 0.3.13

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 (59) hide show
  1. package/README.md +2 -2
  2. package/docs/agent-presets.md +4 -4
  3. package/docs/compatibility.md +16 -4
  4. package/docs/deferred-native-approval-risk.md +1 -1
  5. package/docs/design.md +15 -5
  6. package/docs/lsp.md +1 -1
  7. package/docs/maintenance.md +9 -3
  8. package/docs/model-routing.md +6 -6
  9. package/docs/native-permissions.md +1 -1
  10. package/docs/profiles.md +46 -5
  11. package/docs/roadmap.md +3 -3
  12. package/docs/runtime-recovery.md +5 -5
  13. package/docs/safety-guards.md +1 -1
  14. package/docs/settings-status.md +3 -3
  15. package/docs/testing.md +85 -0
  16. package/lib/child-capture.d.ts +9 -0
  17. package/lib/child-capture.js +24 -1
  18. package/lib/client/ProfileModelsDialog.d.ts +23 -0
  19. package/lib/client/ProfileModelsDialog.js +318 -0
  20. package/lib/client/ProfilesSection.js +228 -34
  21. package/lib/client/RoleToolView-data.d.ts +11 -4
  22. package/lib/client/RoleToolView-data.js +48 -1
  23. package/lib/client/RoleToolView-locales.d.ts +12 -4
  24. package/lib/client/RoleToolView-locales.js +12 -6
  25. package/lib/client/RoleToolView.js +49 -9
  26. package/lib/client/SessionProfiles.d.ts +5 -1
  27. package/lib/client/SessionProfiles.js +13 -9
  28. package/lib/client/StructuredEditor.d.ts +60 -0
  29. package/lib/client/StructuredEditor.js +73 -49
  30. package/lib/client/controller.d.ts +10 -0
  31. package/lib/client/controller.js +44 -14
  32. package/lib/client/diagnostics.d.ts +1 -0
  33. package/lib/client/diagnostics.js +9 -0
  34. package/lib/client/locales.d.ts +57 -0
  35. package/lib/client/locales.js +89 -17
  36. package/lib/client/session-labels.js +4 -1
  37. package/lib/client/structured.d.ts +4 -0
  38. package/lib/client/structured.js +16 -1
  39. package/lib/client/styles.d.ts +1 -1
  40. package/lib/client/styles.js +107 -30
  41. package/lib/client.js +2424 -1049
  42. package/lib/host-llm.js +3 -3
  43. package/lib/index.js +1 -1
  44. package/lib/model-routing.d.ts +3 -2
  45. package/lib/model-routing.js +28 -7
  46. package/lib/native-admission.d.ts +2 -0
  47. package/lib/native-admission.js +106 -34
  48. package/lib/profile-runtime.d.ts +11 -0
  49. package/lib/profile-runtime.js +48 -13
  50. package/lib/profile-store.d.ts +4 -1
  51. package/lib/profile-store.js +37 -14
  52. package/lib/role-control-rpc.js +18 -5
  53. package/lib/role-llm-runtime.js +10 -1
  54. package/lib/role-policy.d.ts +4 -3
  55. package/lib/role-policy.js +6 -6
  56. package/lib/role-providers.js +1 -0
  57. package/lib/runtime-recovery.d.ts +2 -2
  58. package/lib/runtime-recovery.js +7 -4
  59. package/package.json +7 -2
@@ -1,20 +1,29 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useId, useRef } from "react";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useId, useRef, useState } from "react";
3
3
  import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
4
4
  import { canReconcileSelection } from "./controller.js";
5
- import { StructuredEditor } from "./StructuredEditor.js";
6
- import { SessionScope } from "./SessionProfiles.js";
5
+ import { AdvancedSettings, RouteFields } from "./StructuredEditor.js";
6
+ import { ProfileModelsDialog } from "./ProfileModelsDialog.js";
7
+ import { SessionScope, SessionScopeFeedback } from "./SessionProfiles.js";
8
+ import { sessionProfileLabels } from "./session-labels.js";
7
9
  import { structuredDocument } from "./structured.js";
8
- import { draftWarnings, IssueDetails, ProfileWarnings } from "./diagnostics.js";
10
+ import { draftWarnings, IssueDetails, issueKey, ProfileWarnings } from "./diagnostics.js";
9
11
  import { configurationVersionState, sourceRelationship } from "./configuration-display.js";
10
- function issueKey(issue) {
11
- if (issue.source === "selection")
12
- return issue.code === "conflict" ? "selectionConflict" : "appliedInvalid";
13
- if (issue.kind === "assembly")
14
- return "unavailable";
15
- if (issue.kind === "transport")
16
- return "transport";
17
- return issue.code === "conflict" || issue.code === "validation" ? issue.code : "io";
12
+ import { DSMM_LOCALES } from "../profile-locale.js";
13
+ import { DSMM_RATE_LIMIT_BOUNDS } from "../routing-policy.js";
14
+ function locateGlobalField(container, field) {
15
+ const path = field.replace(/^settings\./, "");
16
+ const selectors = {
17
+ "runtimePolicy.strategy": "select[id$='-strategy']",
18
+ "guards.gitWriteGuard": "select[id$='-git-guard']",
19
+ "guards.gitWriteScope": "select[id$='-git-scope']",
20
+ "subagents.toolTopology": "select[id$='-topology']",
21
+ };
22
+ const rateLimit = /^runtimePolicy\.rateLimit\.([a-zA-Z]+)$/.exec(path);
23
+ const selector = rateLimit && Object.hasOwn(DSMM_RATE_LIMIT_BOUNDS, rateLimit[1])
24
+ ? `input[data-dsmm-policy-field='${rateLimit[1]}']`
25
+ : Object.hasOwn(selectors, path) ? selectors[path] : undefined;
26
+ return selector === undefined ? null : container.querySelector(selector);
18
27
  }
19
28
  /** One native settings.section; policy selection is never coupled to browsing. */
20
29
  export function ProfilesSection(props) {
@@ -23,13 +32,28 @@ export function ProfilesSection(props) {
23
32
  const prefix = useId();
24
33
  const selectRef = useRef(null);
25
34
  const inputRef = useRef(null);
35
+ const labelRef = useRef(null);
26
36
  const editorRef = useRef(null);
27
37
  const advancedRef = useRef(null);
38
+ const advancedSettingsRef = useRef(null);
39
+ const moreActionsRef = useRef(null);
28
40
  const handledValidation = useRef(0);
29
41
  const cancelRef = useRef(null);
30
42
  const hadConfirmation = useRef(false);
43
+ const initiatorRef = useRef(null);
44
+ const dialogInitiatorRef = useRef(null);
45
+ const orchestratorRef = useRef(null);
46
+ const sessionScopeRef = useRef(null);
47
+ const [modelsDialogOpen, setModelsDialogOpen] = useState(false);
48
+ const [targetRole, setTargetRole] = useState(null);
49
+ const [targetRoleField, setTargetRoleField] = useState(null);
50
+ const pendingDialogFocus = useRef(null);
51
+ const advancedOpenRef = useRef(false);
52
+ const jsoncOpenRef = useRef(false);
53
+ const moreActionsOpenRef = useRef(false);
31
54
  const disabled = state.busy !== null || state.pendingEditor !== null || state.sessionBusy === "apply" || state.sessionBusy === "reset";
32
55
  const snapshot = state.snapshot;
56
+ const hasOrchestrator = snapshot?.roles?.some(role => role.id === "dsmm-orchestrator") === true;
33
57
  const editor = state.editor;
34
58
  const readOnly = snapshot?.readOnly === true;
35
59
  const editorDisabled = disabled || readOnly || editor?.refreshRequired === true || editor?.revision === "unavailable";
@@ -37,36 +61,120 @@ export function ProfilesSection(props) {
37
61
  const selectionConflict = reconcilable && snapshot?.selectionError?.code === "conflict";
38
62
  const invalid = state.issue?.kind === "domain" && state.issue.code === "validation";
39
63
  const idInvalid = invalid && state.issue?.field === "id" && state.issue.location === undefined && editor?.revision === null && !editorDisabled;
40
- const rawInvalid = editor !== null && structuredDocument(editor.content) === null;
64
+ const structuredDoc = editor === null ? null : structuredDocument(editor.content);
65
+ const lastValidBasicDocRef = useRef(null);
66
+ if (editor !== null && structuredDoc !== null) {
67
+ lastValidBasicDocRef.current = { id: editor.id, epoch: state.editorEpoch, doc: structuredDoc };
68
+ }
69
+ const basicDoc = structuredDoc ?? (lastValidBasicDocRef.current !== null && lastValidBasicDocRef.current.id === editor?.id && lastValidBasicDocRef.current.epoch === state.editorEpoch ? lastValidBasicDocRef.current.doc : null);
70
+ const rawInvalid = editor !== null && structuredDoc === null;
71
+ function focusJsonc(location) {
72
+ if (advancedRef.current !== null) {
73
+ advancedRef.current.open = true;
74
+ jsoncOpenRef.current = true;
75
+ }
76
+ const input = editorRef.current;
77
+ if (input === null)
78
+ return false;
79
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
80
+ input.scrollIntoView?.({ behavior: reducedMotion ? "auto" : "smooth", block: "nearest" });
81
+ input.focus();
82
+ if (input.ownerDocument.activeElement !== input)
83
+ return false;
84
+ if (location !== undefined && location.offset + location.length <= input.value.length) {
85
+ input.setSelectionRange(location.offset, location.offset + location.length);
86
+ }
87
+ return true;
88
+ }
89
+ function focusGlobalField(field) {
90
+ const container = advancedSettingsRef.current;
91
+ if (container === null)
92
+ return false;
93
+ const target = locateGlobalField(container, field);
94
+ if (target === null)
95
+ return false;
96
+ container.open = true;
97
+ advancedOpenRef.current = true;
98
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
99
+ target.scrollIntoView?.({ behavior: reducedMotion ? "auto" : "smooth", block: "nearest" });
100
+ target.focus();
101
+ return target.ownerDocument.activeElement === target;
102
+ }
103
+ function closeModelsDialog(kind) {
104
+ pendingDialogFocus.current = { kind, editorEpoch: state.editorEpoch, validationEpoch: state.validationEpoch,
105
+ issue: state.issue, trigger: dialogInitiatorRef.current };
106
+ setModelsDialogOpen(false);
107
+ setTargetRole(null);
108
+ setTargetRoleField(null);
109
+ }
110
+ // Passive effect cleanup restores Modal isolation before the new focus destination runs.
111
+ useEffect(() => {
112
+ if (modelsDialogOpen)
113
+ return;
114
+ const pending = pendingDialogFocus.current;
115
+ if (pending === null)
116
+ return;
117
+ pendingDialogFocus.current = null;
118
+ if (pending.editorEpoch !== state.editorEpoch || pending.validationEpoch !== state.validationEpoch || pending.issue !== state.issue)
119
+ return;
120
+ if (pending.kind === "jsonc") {
121
+ if (focusJsonc(pending.issue?.location))
122
+ handledValidation.current = pending.validationEpoch;
123
+ }
124
+ else if (pending.trigger?.isConnected) {
125
+ pending.trigger.focus();
126
+ }
127
+ }, [modelsDialogOpen, state.editorEpoch, state.validationEpoch, state.issue]);
41
128
  useEffect(() => {
42
129
  if (state.pendingEditor !== null) {
43
130
  cancelRef.current?.focus();
44
131
  hadConfirmation.current = true;
45
132
  }
46
133
  else if (hadConfirmation.current) {
47
- selectRef.current?.focus();
48
134
  hadConfirmation.current = false;
135
+ if (initiatorRef.current && initiatorRef.current.isConnected) {
136
+ initiatorRef.current.focus();
137
+ }
138
+ else {
139
+ selectRef.current?.focus();
140
+ }
49
141
  }
50
142
  }, [state.pendingEditor]);
51
143
  useEffect(() => {
52
144
  if (state.busy === null && state.validationEpoch > handledValidation.current && state.issue?.kind === "domain" && state.issue.code === "validation") {
53
- handledValidation.current = state.validationEpoch;
54
- if (state.issue.location === undefined && state.issue.field === "id" && inputRef.current !== null
55
- && !inputRef.current.disabled && !inputRef.current.readOnly)
145
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
146
+ const scrollOpt = { behavior: reducedMotion ? "auto" : "smooth", block: "nearest" };
147
+ // Case 1: ID field
148
+ if (state.issue.location === undefined && (state.issue.field === "id" || state.issue.field === "newId") && inputRef.current !== null
149
+ && !inputRef.current.disabled && !inputRef.current.readOnly) {
150
+ handledValidation.current = state.validationEpoch;
151
+ if (typeof inputRef.current.scrollIntoView === "function")
152
+ inputRef.current.scrollIntoView(scrollOpt);
56
153
  inputRef.current.focus();
57
- else {
58
- if (advancedRef.current !== null)
59
- advancedRef.current.open = true;
60
- const input = editorRef.current;
61
- if (input !== null) {
62
- input.focus();
63
- const location = state.issue.location;
64
- if (location !== undefined && location.offset + location.length <= input.value.length)
65
- input.setSelectionRange(location.offset, location.offset + location.length);
66
- }
154
+ return;
155
+ }
156
+ // Case 2: Role field that maps to snapshot role
157
+ const field = state.issue.field ?? "";
158
+ const roleMatch = /^(?:settings\.)?(?:roleRouting|roles)\.([a-zA-Z0-9_-]+)(?:\.|$)/.exec(field);
159
+ const roleId = roleMatch?.[1];
160
+ if (roleId && snapshot?.roles?.some(r => r.id === roleId)) {
161
+ setTargetRole(roleId);
162
+ setTargetRoleField(field);
163
+ setModelsDialogOpen(true);
164
+ return;
165
+ }
166
+ // Case 3: Global setting in advanced settings
167
+ if (focusGlobalField(field)) {
168
+ handledValidation.current = state.validationEpoch;
169
+ return;
67
170
  }
171
+ // Case 4: Unmapped Host diagnostic or missing role in inventory -> JSONC fallback with UTF16 offset/length
172
+ if (modelsDialogOpen)
173
+ closeModelsDialog("jsonc");
174
+ else if (focusJsonc(state.issue.location))
175
+ handledValidation.current = state.validationEpoch;
68
176
  }
69
- }, [state.issue, state.busy, state.validationEpoch]);
177
+ }, [state.issue, state.busy, state.validationEpoch, snapshot?.roles]);
70
178
  const relationship = editor?.revision != null && editor.id === snapshot?.selectedId ? sourceRelationship(snapshot, editor.revision) : "changed";
71
179
  const applied = relationship === "current";
72
180
  let selection = t(snapshot === null ? "unavailable" : "baseline");
@@ -76,10 +184,96 @@ export function ProfilesSection(props) {
76
184
  selection = t("appliedProfile", { id: snapshot.selectedId, revision: t(configurationVersionState(snapshot.sourceRevision)) });
77
185
  const notice = state.notice === null ? "" : t(state.notice.key === "reset" ? "resetDone" : state.notice.key, { id: state.notice.id });
78
186
  const warnings = editor === null ? [] : draftWarnings(editor.content);
79
- return _jsxs("section", { className: "dsmm-profiles", "aria-label": t("title"), "aria-busy": state.busy !== null, children: [readOnly && _jsx("p", { role: "status", className: "dsmm-hint", children: t("readOnlyOrigin") }), _jsxs("section", { className: "dsmm-zone", "aria-labelledby": `${prefix}-browse`, "data-dsmm-zone": "browse", children: [_jsx("h3", { id: `${prefix}-browse`, children: t("browseZone") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || snapshot === null, onClick: () => { void props.create(); }, children: t("new") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => { void props.refresh(); }, children: t(state.busy === "refresh" ? "refreshing" : "refresh") })] }), snapshot !== null && _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-select`, children: t("editorSelect") }), _jsxs("select", { ref: selectRef, id: `${prefix}-select`, disabled: disabled, value: editor?.revision == null ? "" : editor.id, onChange: (event) => { if (event.currentTarget.value)
80
- void props.open(event.currentTarget.value); }, children: [_jsx("option", { value: "", children: t(editor?.revision === null ? "newDraft" : "choose") }), snapshot.profiles.map((profile, index) => _jsxs("option", { value: profile.id, children: [profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id, profile.error === undefined ? "" : ` — ${t("invalidProfile", { id: profile.id })}`, profile.warnings?.length ? ` — ${t("warningProfile")}` : ""] }, `${index}:${profile.id}`))] }), snapshot.profiles.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("empty") })] }), snapshot !== null && snapshot.profiles.some(profile => profile.error !== undefined || profile.warnings?.length) && _jsx("ul", { className: "dsmm-profile-list", "aria-label": t("savedInventory"), children: snapshot.profiles.filter(profile => profile.error !== undefined || profile.warnings?.length).map((profile, index) => _jsxs("li", { children: [_jsx("p", { children: profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id }), _jsx(ProfileWarnings, { warnings: profile.warnings, t: t }), profile.error !== undefined && _jsx(IssueDetails, { issue: profile.error, t: t })] }, `${index}:${profile.id}`)) }), state.pendingEditor !== null && _jsxs("div", { className: "dsmm-confirm", role: "group", "aria-labelledby": `${prefix}-confirm`, onKeyDown: (event) => { if (event.key === "Escape") {
81
- event.preventDefault();
82
- props.cancelDiscard();
83
- } }, children: [_jsx("p", { id: `${prefix}-confirm`, children: t("discardPrompt") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => { void props.discardAndOpen(); }, children: t("discard") }), _jsx(Button, { ref: cancelRef, type: "button", variant: "primary", onClick: props.cancelDiscard, children: t("cancel") })] })] })] }), _jsxs("section", { className: "dsmm-zone", "aria-labelledby": `${prefix}-edit`, "data-dsmm-zone": "edit", children: [_jsx("h3", { id: `${prefix}-edit`, children: t("editZone") }), editor === null && _jsx("p", { className: "dsmm-hint", children: t("noEditor") }), editor !== null && _jsxs("div", { className: "dsmm-editor", children: [_jsx("p", { "data-dsmm-editor-state": true, children: t(editor.refreshRequired ? "savedRefreshRequired" : state.dirty ? "dirty" : applied ? "savedApplied" : relationship === "unknown" ? "savedRelationshipUnknown" : "savedNotApplied") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: editorDisabled || !state.dirty || snapshot === null || state.invalidFields.length > 0, onClick: () => { void props.save(); }, children: t(state.busy === "save" ? "saving" : "save") }), editor.revision !== null && _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => { void props.reload(); }, children: t("reload") })] }), warnings.length > 0 && _jsxs("div", { children: [_jsx("p", { children: t("draftWarnings") }), _jsx(ProfileWarnings, { warnings: warnings, t: t })] }), editor.warnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("savedWarnings") }), _jsx(ProfileWarnings, { warnings: editor.warnings, t: t })] }) : null, _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-id`, children: t("profileId") }), _jsx(Input, { ref: inputRef, id: `${prefix}-id`, className: "dsmm-input", value: editor.id, disabled: editorDisabled || editor.revision !== null, "aria-invalid": idInvalid || undefined, "aria-describedby": `${prefix}-id-hint${idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editId(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-id-hint`, className: "dsmm-hint", children: t("idHint") })] }), _jsxs("div", { className: "dsmm-catalog", children: [state.catalogUnavailable && _jsx("p", { className: "dsmm-hint", children: t("catalogUnavailable") }), state.catalog?.failures.map((failure) => _jsx("p", { className: "dsmm-hint", children: t("catalogFailure", { name: failure.name, id: failure.id }) }, failure.id)), _jsx(Button, { type: "button", variant: "outline", disabled: state.catalogBusy, onClick: () => { void props.refreshCatalog(); }, children: t(state.catalogBusy ? "catalogRefreshing" : "catalogRefresh") })] }), _jsx(StructuredEditor, { state: state, actions: props, disabled: editorDisabled, t: t }, `structured:${state.editorEpoch}`), _jsxs("details", { ref: advancedRef, className: "dsmm-advanced", children: [_jsx("summary", { children: t("advanced") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-content`, children: t("configuration") }), _jsx("textarea", { ref: editorRef, id: `${prefix}-content`, rows: 12, spellCheck: false, value: editor.content, readOnly: readOnly, disabled: editorDisabled, "aria-invalid": rawInvalid || (invalid && !idInvalid) || undefined, "aria-describedby": `${prefix}-content-hint ${prefix}-structural-hint${invalid && !idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editContent(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-content-hint`, className: "dsmm-hint", children: t("configurationHint") }), _jsx("p", { id: `${prefix}-structural-hint`, className: "dsmm-hint", children: t("structuralHint") })] })] }, `advanced:${state.editorEpoch}`)] }), state.issue !== null && _jsxs("div", { className: "dsmm-issue", id: `${prefix}-issue`, role: "alert", children: [_jsx("p", { children: t(issueKey(state.issue)) }), _jsx(IssueDetails, { issue: state.issue, t: t })] })] }), _jsxs("section", { className: "dsmm-zone", "aria-labelledby": `${prefix}-global`, "data-dsmm-zone": "future-default", children: [_jsx("h3", { id: `${prefix}-global`, children: t("globalScope") }), _jsx("p", { id: `${prefix}-global-action`, className: "dsmm-hint", children: t("newSessions") }), _jsx("p", { "data-dsmm-selection": true, children: selection }), snapshot?.refreshRequired && _jsx("p", { role: "status", children: t("savedRefreshRequired") }), snapshot?.selectedWarnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("futureWarnings") }), _jsx(ProfileWarnings, { warnings: snapshot.selectedWarnings, t: t })] }) : null, _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", "aria-describedby": `${prefix}-global-action`, disabled: editorDisabled || state.dirty || editor?.revision == null || !reconcilable || (applied && !selectionConflict), onClick: () => { void props.apply(); }, children: t(state.busy === "apply" ? "applying" : "apply") }), _jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || !reconcilable || (snapshot?.selectedId === null && !selectionConflict), onClick: () => { void props.reset(); }, children: t(state.busy === "reset" ? "resetting" : "reset") })] }), snapshot?.selectionError !== undefined && _jsxs("div", { className: "dsmm-issue", children: [_jsx("p", { children: t(selectionConflict ? "selectionConflict" : "retry") }), _jsx(IssueDetails, { issue: snapshot.selectionError, t: t })] })] }), _jsx("section", { className: "dsmm-zone", "aria-label": t("sessionScope"), "data-dsmm-zone": "current-session", children: _jsx(SessionScope, { state: state, actions: props, t: t }) }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.busy === "refresh" && snapshot === null ? t("loading") : state.busy === "read" ? t("reading") : notice })] });
187
+ return _jsxs("section", { className: "dsmm-profiles dsmm-named-profiles", "aria-label": t("title"), "aria-busy": state.busy !== null, children: [readOnly && _jsx("p", { role: "status", className: "dsmm-hint", children: t("readOnlyOrigin") }), _jsx("h2", { children: t("title") }), _jsx("p", { className: "dsmm-hint", children: t("description") }), _jsxs("div", { className: "dsmm-browse-row", children: [snapshot !== null && _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-select`, children: t("editorSelect") }), _jsxs("select", { ref: selectRef, id: `${prefix}-select`, disabled: disabled, value: editor?.revision == null ? "" : editor.id, onChange: (event) => { initiatorRef.current = event.currentTarget; if (event.currentTarget.value)
188
+ void props.open(event.currentTarget.value); }, children: [_jsx("option", { value: "", children: t(editor?.revision === null ? "newDraft" : "choose") }), snapshot.profiles.map((profile, index) => _jsxs("option", { value: profile.id, children: [profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id, profile.error === undefined ? "" : ` — ${t("invalidProfile", { id: profile.id })}`, profile.warnings?.length ? ` — ${t("warningProfile")}` : ""] }, `${index}:${profile.id}`))] })] }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || snapshot === null, onClick: (event) => { initiatorRef.current = event.currentTarget; void props.create(); }, children: t("new") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: (event) => { initiatorRef.current = event.currentTarget; void props.refresh(); }, children: t(state.busy === "refresh" ? "refreshing" : "refresh") })] }), editor !== null && _jsx("p", { className: "dsmm-badge", "data-dsmm-editor-state": state.invalidFields.length > 0 || invalid || rawInvalid ? "invalid" : state.dirty ? "dirty" : readOnly ? "readonly" : "ready", children: t(editor.refreshRequired ? "savedRefreshRequired" : state.invalidFields.length > 0 || invalid || rawInvalid ? "validation" : state.dirty ? "dirty" : applied ? "savedApplied" : relationship === "unknown" ? "savedRelationshipUnknown" : "savedNotApplied") })] }), snapshot?.profiles.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("empty") }), snapshot !== null && snapshot.profiles.some(profile => profile.error !== undefined || profile.warnings?.length) && _jsx("ul", { className: "dsmm-profile-list", "aria-label": t("savedInventory"), children: snapshot.profiles.filter(profile => profile.error !== undefined || profile.warnings?.length).map((profile, index) => _jsxs("li", { children: [_jsx("p", { children: profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id }), _jsx(ProfileWarnings, { warnings: profile.warnings, t: t }), profile.error !== undefined && _jsx(IssueDetails, { issue: profile.error, t: t })] }, `${index}:${profile.id}`)) }), state.pendingEditor !== null && _jsxs("div", { className: "dsmm-confirm", role: "group", "aria-labelledby": `${prefix}-confirm`, onKeyDown: (event) => { if (event.key === "Escape") {
189
+ event.preventDefault();
190
+ props.cancelDiscard();
191
+ } }, children: [_jsx("p", { id: `${prefix}-confirm`, children: t("discardPrompt") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => { void props.discardAndOpen(); }, children: t("discard") }), _jsx(Button, { ref: cancelRef, type: "button", variant: "primary", onClick: props.cancelDiscard, children: t("cancel") })] })] }), _jsxs("div", { className: "dsmm-effective-summary", "data-dsmm-effective-summary": true, children: [_jsxs("div", { className: "dsmm-summary-row", children: [_jsxs("div", { children: [_jsx("span", { className: "dsmm-summary-label", children: t("futureDefaultSummary") }), " ", _jsx("span", { className: "dsmm-summary-val", "data-dsmm-selection": true, children: selection })] }), _jsx(Button, { type: "button", variant: "primary", size: "sm", disabled: editorDisabled || state.dirty || state.invalidFields.length > 0 || editor?.revision == null || !reconcilable || (applied && !selectionConflict), onClick: () => { void props.apply(); }, children: t(state.busy === "apply" ? "applying" : "apply") })] }), snapshot?.refreshRequired && _jsx("p", { role: "status", children: t("savedRefreshRequired") }), snapshot?.selectedWarnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("futureWarnings") }), _jsx(ProfileWarnings, { warnings: snapshot.selectedWarnings, t: t })] }) : null, snapshot?.selectionError !== undefined && _jsxs("div", { className: "dsmm-issue", children: [_jsx("p", { children: t(selectionConflict ? "selectionConflict" : "retry") }), _jsx(IssueDetails, { issue: snapshot.selectionError, t: t })] }), _jsxs("div", { className: "dsmm-summary-row", children: [_jsxs("div", { children: [_jsx("span", { className: "dsmm-summary-label", children: t("currentSessionSummary") }), " ", _jsx("span", { className: "dsmm-summary-val", children: state.session === null ? t("sessionUnavailable") : sessionProfileLabels(state.session, t).admitted })] }), _jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
192
+ if (moreActionsRef.current !== null) {
193
+ moreActionsRef.current.open = true;
194
+ moreActionsOpenRef.current = true;
195
+ }
196
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
197
+ sessionScopeRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
198
+ }, children: t("locateSessionScope") })] }), _jsx(SessionScopeFeedback, { state: state, t: t }), _jsxs("details", { ref: moreActionsRef, className: "dsmm-more-actions", open: moreActionsOpenRef.current || undefined, onToggle: e => { moreActionsOpenRef.current = e.currentTarget.open; }, children: [_jsx("summary", { children: t("moreActions") }), _jsxs("div", { children: [_jsxs("div", { children: [_jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || !reconcilable || (snapshot?.selectedId === null && !selectionConflict), onClick: () => { void props.reset(); }, children: t(state.busy === "reset" ? "resetting" : "reset") }), _jsx("p", { className: "dsmm-hint", children: t("futureResetHint") })] }), _jsx("div", { ref: sessionScopeRef, children: _jsx(SessionScope, { state: state, actions: props, t: t, showFeedback: false }) })] })] })] }), editor === null && _jsx("p", { className: "dsmm-hint", children: t("noEditor") }), editor !== null && _jsxs("div", { className: "dsmm-editor", children: [warnings.length > 0 && _jsxs("div", { children: [_jsx("p", { children: t("draftWarnings") }), _jsx(ProfileWarnings, { warnings: warnings, t: t })] }), editor.warnings?.length ? _jsxs("div", { children: [_jsx("p", { children: t("savedWarnings") }), _jsx(ProfileWarnings, { warnings: editor.warnings, t: t })] }) : null, _jsxs("div", { className: "dsmm-catalog", children: [state.catalogUnavailable && _jsx("p", { className: "dsmm-hint", children: t("catalogUnavailable") }), state.catalog?.failures.map((failure) => _jsx("p", { className: "dsmm-hint", children: t("catalogFailure", { name: failure.name, id: failure.id }) }, failure.id)), _jsx(Button, { type: "button", variant: "outline", disabled: state.catalogBusy, onClick: () => { void props.refreshCatalog(); }, children: t(state.catalogBusy ? "catalogRefreshing" : "catalogRefresh") })] }), _jsxs("div", { className: "dsmm-basic-settings", "data-dsmm-basic-settings": true, children: [structuredDoc === null && (_jsxs("div", { className: "dsmm-structured-invalid", "data-dsmm-structured-invalid": true, children: [_jsx("p", { children: t("rawInvalid") }), _jsx("p", { className: "dsmm-hint", children: t("rawInvalidFormDisabled") }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
199
+ if (advancedRef.current !== null) {
200
+ advancedRef.current.open = true;
201
+ jsoncOpenRef.current = true;
202
+ }
203
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
204
+ editorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
205
+ editorRef.current?.focus();
206
+ }, children: t("viewConfiguration") })] })), basicDoc !== null && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-label`, children: t("profileLabel") }), _jsx(Input, { ref: labelRef, id: `${prefix}-label`, className: "dsmm-input", value: basicDoc.label ?? "", disabled: editorDisabled || structuredDoc === null, onChange: (event) => props.editPath(["label"], event.currentTarget.value) }), _jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || structuredDoc === null || basicDoc.label === undefined, onClick: () => props.editPath(["label"], undefined), children: t("omitLabel") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-id`, children: t("profileId") }), _jsx(Input, { ref: inputRef, id: `${prefix}-id`, className: "dsmm-input", value: editor.id, disabled: editorDisabled || structuredDoc === null || editor.revision !== null, "aria-invalid": idInvalid || undefined, "aria-describedby": `${prefix}-id-hint${idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editId(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-id-hint`, className: "dsmm-hint", children: t("idHint") })] }), _jsxs("div", { ref: orchestratorRef, className: "dsmm-field", id: `${prefix}-orchestrator-primary`, children: [_jsx("label", { htmlFor: `${prefix}-orch-mode`, children: t("orchestratorModel") }), _jsx("p", { className: "dsmm-hint", children: t("orchestratorModelDesc") }), _jsxs("select", { id: `${prefix}-orch-mode`, disabled: editorDisabled || structuredDoc === null || !hasOrchestrator, "aria-describedby": !hasOrchestrator ? `${prefix}-orch-unavailable` : undefined, value: basicDoc.roleRouting["dsmm-orchestrator"]?.primary === undefined ? "inherit" : "explicit", onChange: (event) => props.editPath(["settings", "roleRouting", "dsmm-orchestrator", "primary"], event.currentTarget.value === "inherit" ? undefined : { provider: "", model: "" }), children: [_jsx("option", { value: "inherit", children: t("inheritRoute") }), _jsx("option", { value: "explicit", children: t("configuredRoute") })] }), !hasOrchestrator && _jsx("p", { className: "dsmm-hint", id: `${prefix}-orch-unavailable`, children: t("orchestratorUnavailable") }), basicDoc.roleRouting["dsmm-orchestrator"]?.primary !== undefined && (_jsx(RouteFields, { t: t, value: basicDoc.roleRouting["dsmm-orchestrator"].primary, path: ["settings", "roleRouting", "dsmm-orchestrator", "primary"], naturalLabels: true, catalog: state.catalog, disabled: editorDisabled || structuredDoc === null || !hasOrchestrator, edit: props.editPath, editRoute: props.editRoute })), _jsx("p", { className: "dsmm-hint", children: t("effortChangeHint") })] }), _jsxs("div", { className: "dsmm-field dsmm-configure-models-field", children: [_jsx("label", { children: t("configureAllAgentModels") }), _jsx("p", { className: "dsmm-hint", children: t("modelsDialogDesc") }), _jsx("div", { children: _jsx(Button, { type: "button", variant: "outline", className: "dsmm-open-models-dialog-btn", disabled: editorDisabled || structuredDoc === null, onClick: (event) => {
207
+ dialogInitiatorRef.current = event.currentTarget;
208
+ setModelsDialogOpen(true);
209
+ }, children: t("configureAllAgentModels") }) })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-locale`, children: t("businessLocale") }), _jsxs("select", { id: `${prefix}-locale`, value: String(basicDoc.settings.locale ?? ""), disabled: editorDisabled || structuredDoc === null, "aria-describedby": `${prefix}-locale-hint`, onChange: (event) => props.editPath(["settings", "locale"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inheritLocale") }), typeof basicDoc.settings.locale === "string" && !DSMM_LOCALES.includes(basicDoc.settings.locale) && (_jsx("option", { value: basicDoc.settings.locale, children: t("unsupportedLocale") })), DSMM_LOCALES.map((locale) => (_jsx("option", { value: locale, children: locale }, locale)))] }), _jsx("p", { id: `${prefix}-locale-hint`, className: "dsmm-hint", children: t("localeHint") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-active`, children: t("defaultActive") }), _jsxs("select", { id: `${prefix}-active`, disabled: editorDisabled || structuredDoc === null, value: basicDoc.settings.defaultActive === undefined ? "" : String(basicDoc.settings.defaultActive), onChange: (event) => props.editPath(["settings", "defaultActive"], event.currentTarget.value === "" ? undefined : event.currentTarget.value === "true"), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "true", children: t("enabled") }), _jsx("option", { value: "false", children: t("disabled") })] }), _jsx("p", { className: "dsmm-hint", children: t("activeHint") })] })] }))] }, `basic:${state.editorEpoch}`), _jsxs("details", { ref: advancedSettingsRef, className: "dsmm-advanced-settings", open: advancedOpenRef.current || undefined, onToggle: e => { advancedOpenRef.current = e.currentTarget.open; }, children: [_jsx("summary", { children: t("advancedSettings") }), _jsx("div", { children: _jsx(AdvancedSettings, { state: state, actions: props, disabled: editorDisabled, document: basicDoc, isInvalidProjection: rawInvalid, t: t }) })] }, `advanced-settings:${state.editorEpoch}`), _jsxs("details", { ref: advancedRef, className: "dsmm-advanced", open: jsoncOpenRef.current || undefined, onToggle: e => { jsoncOpenRef.current = e.currentTarget.open; }, children: [_jsx("summary", { children: t("configuration") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-content`, children: t("configuration") }), _jsx("textarea", { ref: editorRef, id: `${prefix}-content`, rows: 12, spellCheck: false, value: editor.content, readOnly: readOnly, disabled: editorDisabled, "aria-invalid": rawInvalid || (invalid && !idInvalid) || undefined, "aria-describedby": `${prefix}-content-hint ${prefix}-structural-hint${invalid && !idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editContent(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-content-hint`, className: "dsmm-hint", children: t("configurationHint") }), _jsx("p", { id: `${prefix}-structural-hint`, className: "dsmm-hint", children: t("structuralHint") })] })] }, `advanced:${state.editorEpoch}`), _jsx(ProfileModelsDialog, { open: modelsDialogOpen, onClose: () => closeModelsDialog("trigger"), state: state, actions: props, disabled: editorDisabled, document: basicDoc, isInvalidProjection: rawInvalid, targetRoleId: targetRole, targetField: targetRoleField, onTargetLocated: () => {
210
+ handledValidation.current = state.validationEpoch;
211
+ setTargetRole(null);
212
+ setTargetRoleField(null);
213
+ }, onJumpToJsonc: () => closeModelsDialog("jsonc"), t: t }), _jsxs("div", { className: "dsmm-save-bar", children: [(() => {
214
+ const isSaveLocked = (state.dirty || state.invalidFields.length > 0) && !editorDisabled && snapshot !== null && (state.invalidFields.length > 0 || rawInvalid || invalid);
215
+ if (!isSaveLocked)
216
+ return null;
217
+ return (_jsxs("div", { className: "dsmm-save-lock-reason", role: "status", children: [_jsx("span", { className: "dsmm-save-lock-text", children: rawInvalid
218
+ ? t("rawInvalid")
219
+ : state.invalidFields.length > 0
220
+ ? t("saveLockedReason", { count: state.invalidFields.length })
221
+ : t("validation") }), _jsxs("div", { className: "dsmm-save-lock-action", children: [rawInvalid && (_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
222
+ if (advancedRef.current !== null) {
223
+ advancedRef.current.open = true;
224
+ jsoncOpenRef.current = true;
225
+ }
226
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
227
+ editorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
228
+ editorRef.current?.focus();
229
+ }, children: t("jumpToJsonc") })), !rawInvalid && state.invalidFields.length > 0 && (() => {
230
+ const firstInvalid = state.invalidFields[0];
231
+ const roleMatch = /^(?:settings\.)?(?:roleRouting|roles)\.([a-zA-Z0-9_-]+)(?:\.|$)/.exec(firstInvalid);
232
+ const roleId = roleMatch?.[1];
233
+ if (roleId) {
234
+ return (_jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: (e) => {
235
+ dialogInitiatorRef.current = e.currentTarget;
236
+ setTargetRole(roleId);
237
+ setTargetRoleField(firstInvalid);
238
+ setModelsDialogOpen(true);
239
+ }, children: [t("jumpToField"), ": ", firstInvalid] }));
240
+ }
241
+ return (_jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
242
+ if (!focusGlobalField(firstInvalid))
243
+ focusJsonc(state.issue?.location);
244
+ }, children: [t("jumpToField"), ": ", firstInvalid] }));
245
+ })(), !rawInvalid && state.invalidFields.length === 0 && invalid && (() => {
246
+ if (state.issue?.field === "id" || state.issue?.field === "newId") {
247
+ return (_jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
248
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
249
+ inputRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
250
+ inputRef.current?.focus();
251
+ }, children: [t("jumpToField"), ": ID"] }));
252
+ }
253
+ const roleMatch = /^(?:settings\.)?(?:roleRouting|roles)\.([a-zA-Z0-9_-]+)(?:\.|$)/.exec(state.issue?.field ?? "");
254
+ const roleId = roleMatch?.[1];
255
+ if (roleId && snapshot?.roles?.some(r => r.id === roleId)) {
256
+ return (_jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: (e) => {
257
+ dialogInitiatorRef.current = e.currentTarget;
258
+ setTargetRole(roleId);
259
+ setTargetRoleField(state.issue?.field ?? null);
260
+ setModelsDialogOpen(true);
261
+ }, children: [t("jumpToRole"), ": ", roleId] }));
262
+ }
263
+ return (_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
264
+ if (advancedRef.current !== null) {
265
+ advancedRef.current.open = true;
266
+ jsoncOpenRef.current = true;
267
+ }
268
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
269
+ editorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
270
+ editorRef.current?.focus();
271
+ const location = state.issue?.location;
272
+ if (location !== undefined && editorRef.current && location.offset + location.length <= editorRef.current.value.length) {
273
+ editorRef.current.setSelectionRange(location.offset, location.offset + location.length);
274
+ }
275
+ }, children: t("jumpToJsonc") }));
276
+ })()] })] }));
277
+ })(), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: editorDisabled || !state.dirty || snapshot === null || state.invalidFields.length > 0 || rawInvalid, onClick: () => { void props.save(); }, children: t(state.busy === "save" ? "saving" : "save") }), _jsx(Button, { type: "button", variant: "outline", disabled: editorDisabled || (!state.dirty && state.invalidFields.length === 0), onClick: (event) => { initiatorRef.current = event.currentTarget; props.discard(); }, children: t("discard") }), editor.revision !== null && !state.dirty && _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: (event) => { initiatorRef.current = event.currentTarget; void props.reload(); }, children: t("reload") })] })] })] }), state.issue !== null && !modelsDialogOpen && _jsxs("div", { className: "dsmm-issue", id: `${prefix}-issue`, role: "alert", children: [_jsx("p", { children: t(issueKey(state.issue)) }), _jsx(IssueDetails, { issue: state.issue, t: t })] }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.busy === "refresh" && snapshot === null ? t("loading") : state.busy === "read" ? t("reading") : notice })] });
84
278
  }
85
279
  //# sourceMappingURL=ProfilesSection.js.map
@@ -23,13 +23,20 @@ export declare function requestedRoleTool(toolName: string, raw: string): {
23
23
  /** Read during render: the native owner republishes changes to these lazy answers. */
24
24
  export declare function preparingRoleTool(toolName: string, args: ToolArgs): {
25
25
  requested: {
26
- readonly kind: "role" | "category";
27
- readonly target: string | undefined;
28
- readonly level: string | undefined;
29
- readonly description: string | undefined;
26
+ description: string | undefined;
27
+ kind: "role" | "category";
28
+ target: string | undefined;
29
+ level: string | undefined;
30
30
  };
31
31
  preview: string;
32
32
  };
33
33
  export declare function actualRoleTool(toolName: string, meta: unknown, failed: boolean): DsmmInvocationView | undefined;
34
34
  export declare function roleToolDisplay(target: string): string;
35
+ export interface TechnicalRow {
36
+ property: string;
37
+ value: unknown;
38
+ isComplex: boolean;
39
+ }
40
+ export declare function technicalTableRows(toolName: string, callId: string, rawArgs: string, meta?: unknown, routeSource?: string): TechnicalRow[];
41
+ export declare function technicalJsonData(toolName: string, callId: string, rawArgs: string, meta?: unknown, routeSource?: string): Record<string, unknown>;
35
42
  //# sourceMappingURL=RoleToolView-data.d.ts.map
@@ -32,7 +32,9 @@ export function preparingRoleTool(toolName, args) {
32
32
  return value === undefined ? [] : [[key, value]];
33
33
  }));
34
34
  const complete = Object.fromEntries(Object.entries(received).filter(([key]) => args.complete(key)));
35
- return { requested: requestedRoleTool(toolName, args.invalid ? "" : JSON.stringify(complete)),
35
+ const requested = requestedRoleTool(toolName, args.invalid ? "" : JSON.stringify(complete));
36
+ const description = requested.description ?? (typeof received.description === "string" ? received.description : undefined);
37
+ return { requested: { ...requested, description },
36
38
  preview: Object.keys(received).length === 0 ? "" : JSON.stringify(received, null, 2) };
37
39
  }
38
40
  export function actualRoleTool(toolName, meta, failed) {
@@ -49,4 +51,49 @@ export function actualRoleTool(toolName, meta, failed) {
49
51
  export function roleToolDisplay(target) {
50
52
  return target.slice("dsmm-".length).split("-").map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
51
53
  }
54
+ export function technicalTableRows(toolName, callId, rawArgs, meta, routeSource) {
55
+ const rows = [];
56
+ rows.push({ property: "toolName", value: toolName, isComplex: false });
57
+ rows.push({ property: "callId", value: callId, isComplex: false });
58
+ if (routeSource !== undefined) {
59
+ rows.push({ property: "routeSource", value: routeSource, isComplex: false });
60
+ }
61
+ const argsObj = roleToolArguments(rawArgs);
62
+ if (argsObj !== undefined) {
63
+ for (const [k, v] of Object.entries(argsObj)) {
64
+ const isComplex = typeof v === "object" && v !== null;
65
+ rows.push({ property: `args.${k}`, value: v, isComplex });
66
+ }
67
+ }
68
+ else if (rawArgs !== "") {
69
+ rows.push({ property: "args", value: rawArgs, isComplex: false });
70
+ }
71
+ if (meta !== undefined && meta !== null) {
72
+ if (typeof meta === "object" && !Array.isArray(meta)) {
73
+ for (const [k, v] of Object.entries(meta)) {
74
+ const isComplex = typeof v === "object" && v !== null;
75
+ rows.push({ property: `meta.${k}`, value: v, isComplex });
76
+ }
77
+ }
78
+ else {
79
+ rows.push({ property: "meta", value: meta, isComplex: typeof meta === "object" });
80
+ }
81
+ }
82
+ return rows;
83
+ }
84
+ export function technicalJsonData(toolName, callId, rawArgs, meta, routeSource) {
85
+ const parsedArgs = roleToolArguments(rawArgs);
86
+ const data = {
87
+ toolName,
88
+ callId,
89
+ };
90
+ if (routeSource !== undefined) {
91
+ data.routeSource = routeSource;
92
+ }
93
+ data.args = parsedArgs !== undefined ? parsedArgs : rawArgs;
94
+ if (meta !== undefined && meta !== null) {
95
+ data.meta = meta;
96
+ }
97
+ return data;
98
+ }
52
99
  //# sourceMappingURL=RoleToolView-data.js.map
@@ -1,18 +1,21 @@
1
1
  export declare const ROLE_TOOL_NS = "conversation.dsmm-role-tool";
2
2
  export declare const roleToolEn: {
3
3
  readonly call: "Call";
4
+ readonly calling: "Calling";
4
5
  readonly unknownTarget: "DSMM agent · target pending";
5
6
  readonly requested: "Requested";
6
7
  readonly actual: "Actual";
7
8
  readonly role: "Role";
8
9
  readonly category: "Category";
9
10
  readonly unknown: "Unknown";
11
+ readonly actualUnknown: "Actual unknown";
10
12
  readonly preparing: "Preparing";
11
- readonly running: "Running";
12
- readonly result: "Tool returned · child completion not inferred";
13
- readonly background: "Started / handed off · child completion not confirmed";
14
- readonly error: "Tool error";
13
+ readonly running: "Calling";
14
+ readonly result: "Returned";
15
+ readonly background: "Background";
16
+ readonly error: "Failed";
15
17
  readonly stopped: "Interrupted";
18
+ readonly technicalDetails: "Technical details";
16
19
  readonly args: "Original arguments";
17
20
  readonly preparingArgs: "Arguments received so far";
18
21
  readonly output: "Complete result content";
@@ -26,6 +29,11 @@ export declare const roleToolEn: {
26
29
  readonly level: "Level";
27
30
  readonly route: "Reported route";
28
31
  readonly routeSource: "Route source";
32
+ readonly table: "Table";
33
+ readonly json: "JSON";
34
+ readonly viewMode: "View mode";
35
+ readonly property: "Property";
36
+ readonly value: "Value";
29
37
  };
30
38
  export declare const roleToolZh: Record<keyof typeof roleToolEn, string>;
31
39
  declare module "@deepseek-ai/dsh-client-ui-slots" {
@@ -1,20 +1,26 @@
1
1
  export const ROLE_TOOL_NS = "conversation.dsmm-role-tool";
2
2
  export const roleToolEn = {
3
- call: "Call", unknownTarget: "DSMM agent · target pending",
3
+ call: "Call", calling: "Calling", unknownTarget: "DSMM agent · target pending",
4
4
  requested: "Requested", actual: "Actual", role: "Role", category: "Category", unknown: "Unknown",
5
- preparing: "Preparing", running: "Running", result: "Tool returned · child completion not inferred",
6
- background: "Started / handed off · child completion not confirmed", error: "Tool error", stopped: "Interrupted",
5
+ actualUnknown: "Actual unknown",
6
+ preparing: "Preparing", running: "Calling", result: "Returned",
7
+ background: "Background", error: "Failed", stopped: "Interrupted",
8
+ technicalDetails: "Technical details",
7
9
  args: "Original arguments", preparingArgs: "Arguments received so far", output: "Complete result content", failure: "Error details", metadata: "Invocation metadata",
8
10
  inspect: "Inspect tool call", copy: "Copy", copied: "Copied", emptyArgs: "Arguments not available yet",
9
11
  unavailable: "Actual identity unavailable; requested identity only", level: "Level", route: "Reported route", routeSource: "Route source",
12
+ table: "Table", json: "JSON", viewMode: "View mode", property: "Property", value: "Value",
10
13
  };
11
14
  export const roleToolZh = {
12
- call: "调用", unknownTarget: "DSMM 代理 · 目标待确定",
15
+ call: "调用", calling: "正在调用", unknownTarget: "DSMM 代理 · 目标待确定",
13
16
  requested: "请求", actual: "实际", role: "角色", category: "类别", unknown: "未知",
14
- preparing: "准备中", running: "运行中", result: "工具已返回 · 不推断子任务完成",
15
- background: "已启动/移交 · 尚未确认子任务完成", error: "工具错误", stopped: "已中断",
17
+ actualUnknown: "实际未知",
18
+ preparing: "准备中", running: "调用中", result: "已返回",
19
+ background: "后台调用", error: "失败", stopped: "已中断",
20
+ technicalDetails: "技术详情",
16
21
  args: "原始参数", preparingArgs: "目前已收到的参数", output: "完整结果内容", failure: "错误详情", metadata: "调用元数据",
17
22
  inspect: "检查工具调用", copy: "复制", copied: "已复制", emptyArgs: "参数尚不可用",
18
23
  unavailable: "实际身份不可用,仅显示请求身份", level: "等级", route: "报告的路由", routeSource: "路由来源",
24
+ table: "表格", json: "JSON", viewMode: "视图模式", property: "属性", value: "值",
19
25
  };
20
26
  //# sourceMappingURL=RoleToolView-locales.js.map