@dsmm/dsmm 0.3.11 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/docs/agent-presets.md +4 -4
  3. package/docs/compatibility.md +10 -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/model-routing.md +6 -6
  8. package/docs/native-permissions.md +1 -1
  9. package/docs/profiles.md +36 -5
  10. package/docs/roadmap.md +3 -3
  11. package/docs/runtime-recovery.md +5 -5
  12. package/docs/safety-guards.md +1 -1
  13. package/docs/settings-status.md +3 -3
  14. package/lib/child-capture.d.ts +9 -0
  15. package/lib/child-capture.js +24 -1
  16. package/lib/client/ProfilesSection.js +65 -13
  17. package/lib/client/RoleToolView-data.d.ts +4 -4
  18. package/lib/client/RoleToolView-data.js +3 -1
  19. package/lib/client/RoleToolView-locales.d.ts +7 -4
  20. package/lib/client/RoleToolView-locales.js +10 -6
  21. package/lib/client/RoleToolView.js +20 -5
  22. package/lib/client/SessionProfiles.d.ts +5 -1
  23. package/lib/client/SessionProfiles.js +13 -9
  24. package/lib/client/StructuredEditor.d.ts +32 -0
  25. package/lib/client/StructuredEditor.js +75 -23
  26. package/lib/client/controller.d.ts +10 -0
  27. package/lib/client/controller.js +44 -14
  28. package/lib/client/locales.d.ts +36 -0
  29. package/lib/client/locales.js +47 -17
  30. package/lib/client/session-labels.js +4 -1
  31. package/lib/client/structured.d.ts +4 -0
  32. package/lib/client/structured.js +16 -1
  33. package/lib/client/styles.d.ts +1 -1
  34. package/lib/client/styles.js +19 -1
  35. package/lib/client.js +762 -303
  36. package/lib/host-llm.js +3 -3
  37. package/lib/index.js +1 -1
  38. package/lib/model-routing.d.ts +3 -2
  39. package/lib/model-routing.js +28 -7
  40. package/lib/native-admission.d.ts +2 -0
  41. package/lib/native-admission.js +106 -34
  42. package/lib/profile-runtime.d.ts +11 -0
  43. package/lib/profile-runtime.js +48 -13
  44. package/lib/profile-store.d.ts +4 -1
  45. package/lib/profile-store.js +37 -14
  46. package/lib/role-control-rpc.js +18 -5
  47. package/lib/role-llm-runtime.js +10 -1
  48. package/lib/role-policy.d.ts +4 -3
  49. package/lib/role-policy.js +6 -6
  50. package/lib/role-providers.js +1 -0
  51. package/lib/runtime-recovery.d.ts +2 -2
  52. package/lib/runtime-recovery.js +7 -4
  53. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -3457,6 +3457,18 @@ function structuredDocument(content2) {
3457
3457
  if (settings.subagents !== void 0 && (!record(settings.subagents) || Object.keys(settings.subagents).some((key) => key !== "toolTopology") || settings.subagents.toolTopology !== void 0 && (typeof settings.subagents.toolTopology !== "string" || !["per-role", "parameterized"].includes(settings.subagents.toolTopology)))) return null;
3458
3458
  if (settings.roleRouting !== void 0 && !record(settings.roleRouting)) return null;
3459
3459
  if (settings.runtimePolicy !== void 0 && !record(settings.runtimePolicy)) return null;
3460
+ let guards;
3461
+ if (settings.guards !== void 0) {
3462
+ if (!record(settings.guards)) return null;
3463
+ const rawGitWriteGuard = settings.guards.gitWriteGuard;
3464
+ const rawGitWriteScope = settings.guards.gitWriteScope;
3465
+ if (rawGitWriteGuard !== void 0 && (typeof rawGitWriteGuard !== "string" || !["ask", "deny", "off"].includes(rawGitWriteGuard))) return null;
3466
+ if (rawGitWriteScope !== void 0 && (typeof rawGitWriteScope !== "string" || !["all-writes", "high-risk"].includes(rawGitWriteScope))) return null;
3467
+ guards = {
3468
+ gitWriteGuard: rawGitWriteGuard,
3469
+ gitWriteScope: rawGitWriteScope
3470
+ };
3471
+ }
3460
3472
  const runtimePolicy2 = settings.runtimePolicy ?? {};
3461
3473
  const policies = settings.roleRouting ?? {};
3462
3474
  try {
@@ -3474,7 +3486,7 @@ function structuredDocument(content2) {
3474
3486
  } catch {
3475
3487
  return null;
3476
3488
  }
3477
- return { label: document2.label, settings, roleRouting: policies, runtimePolicy: runtimePolicy2 };
3489
+ return { label: document2.label, settings, roleRouting: policies, runtimePolicy: runtimePolicy2, guards };
3478
3490
  }
3479
3491
  function editStructuredPath(content2, path, value) {
3480
3492
  if (structuredDocument(content2) === null) return null;
@@ -3499,14 +3511,14 @@ function moveFallback(content2, role3, from2, to) {
3499
3511
  }
3500
3512
 
3501
3513
  // src/client/controller.ts
3502
- function modelSelectionWatermark(window) {
3514
+ function modelSelectionWatermark(window2) {
3503
3515
  let watermark = -1;
3504
- for (const entry of window.entries) if (entry.type === "event" && entry.event.type === "model/selection") watermark = Math.max(watermark, Number(entry.event.seq));
3516
+ for (const entry of window2.entries) if (entry.type === "event" && entry.event.type === "model/selection") watermark = Math.max(watermark, Number(entry.event.seq));
3505
3517
  return watermark;
3506
3518
  }
3507
- function modeIntentWatermark(window) {
3519
+ function modeIntentWatermark(window2) {
3508
3520
  let watermark = -1;
3509
- for (const entry of window.entries) if (entry.type === "event" && (entry.event.type === "deepwork/mode" || entry.event.type === "agent-preset/selected")) watermark = Math.max(watermark, Number(entry.event.seq));
3521
+ for (const entry of window2.entries) if (entry.type === "event" && (entry.event.type === "deepwork/mode" || entry.event.type === "agent-preset/selected")) watermark = Math.max(watermark, Number(entry.event.seq));
3510
3522
  return watermark;
3511
3523
  }
3512
3524
  var NEW_EDITOR = "";
@@ -3593,6 +3605,7 @@ var ProfilesController = class {
3593
3605
  save: () => this.save(),
3594
3606
  apply: () => this.apply(),
3595
3607
  reset: () => this.reset(),
3608
+ discard: () => this.discard(),
3596
3609
  discardAndOpen: () => this.discardAndOpen(),
3597
3610
  cancelDiscard: () => this.publish({ pendingEditor: null }),
3598
3611
  editPath: (path, value) => this.editPath(path, value),
@@ -3612,10 +3625,21 @@ var ProfilesController = class {
3612
3625
  const invalidFields = this.current.invalidFields.filter((candidate) => candidate !== field);
3613
3626
  if (invalid2) invalidFields.push(field);
3614
3627
  if (invalidFields.join("\n") !== this.current.invalidFields.join("\n")) this.publish({ invalidFields, ...invalid2 ? { dirty: true } : {} });
3615
- }
3628
+ },
3629
+ setNumberDraft: (key, entry) => {
3630
+ if (this.disposed) return;
3631
+ if (entry === null) {
3632
+ this.numberDrafts.delete(key);
3633
+ } else {
3634
+ this.numberDrafts.set(key, entry);
3635
+ }
3636
+ },
3637
+ getNumberDraft: (key) => this.numberDrafts.get(key)
3616
3638
  };
3639
+ numberDrafts = /* @__PURE__ */ new Map();
3617
3640
  dispose() {
3618
3641
  this.releaseComposerBlock();
3642
+ this.numberDrafts.clear();
3619
3643
  this.stopConnection?.();
3620
3644
  this.disposed = true;
3621
3645
  this.generation += 1;
@@ -3717,7 +3741,7 @@ var ProfilesController = class {
3717
3741
  this.modelEventsWatermark = source === null ? -1 : modelSelectionWatermark(source.getSnapshot());
3718
3742
  this.modeEventsWatermark = source === null ? -1 : modeIntentWatermark(source.getSnapshot());
3719
3743
  this.stopModelEvents = source?.subscribe(() => {
3720
- const window = source.getSnapshot(), change = window.change;
3744
+ const window2 = source.getSnapshot(), change = window2.change;
3721
3745
  if (change.kind === "settle-assistant") return;
3722
3746
  let watermark = change.kind === "replace" ? -1 : this.modelEventsWatermark;
3723
3747
  for (const entry of change.entries) if (entry.type === "event" && entry.event.type === "model/selection") watermark = Math.max(watermark, Number(entry.event.seq));
@@ -3925,6 +3949,7 @@ var ProfilesController = class {
3925
3949
  for (const listener of this.listeners) listener();
3926
3950
  }
3927
3951
  accept(document2) {
3952
+ this.numberDrafts.clear();
3928
3953
  this.accepted = { ...document2 };
3929
3954
  this.publish({ editor: { ...document2 }, dirty: false, pendingEditor: null, invalidFields: [], editorEpoch: this.current.editorEpoch + 1 });
3930
3955
  }
@@ -3968,7 +3993,7 @@ var ProfilesController = class {
3968
3993
  async open(id2) {
3969
3994
  if (this.disposed || this.current.busy !== null || this.current.pendingEditor !== null) return;
3970
3995
  if (id2 !== NEW_EDITOR && this.current.editor?.id === id2) return;
3971
- if (this.current.dirty) {
3996
+ if (this.current.dirty || this.current.invalidFields.length > 0) {
3972
3997
  this.publish({ pendingEditor: id2 });
3973
3998
  return;
3974
3999
  }
@@ -3977,14 +4002,21 @@ var ProfilesController = class {
3977
4002
  async reload() {
3978
4003
  const editor = this.current.editor;
3979
4004
  if (editor === null || editor.revision === null || this.current.busy !== null || this.current.pendingEditor !== null) return;
3980
- if (this.current.dirty) {
4005
+ if (this.current.dirty || this.current.invalidFields.length > 0) {
3981
4006
  this.publish({ pendingEditor: editor.id });
3982
4007
  return;
3983
4008
  }
3984
4009
  await this.loadEditor(editor.id);
3985
4010
  }
4011
+ discard() {
4012
+ const editor = this.current.editor;
4013
+ if (this.disposed || editor === null || this.current.busy !== null || this.current.pendingEditor !== null) return;
4014
+ if (!this.current.dirty && this.current.invalidFields.length === 0) return;
4015
+ this.publish({ pendingEditor: editor.revision === null ? NEW_EDITOR : editor.id });
4016
+ }
3986
4017
  async loadEditor(id2) {
3987
4018
  if (id2 === NEW_EDITOR) {
4019
+ this.numberDrafts.clear();
3988
4020
  this.accepted = null;
3989
4021
  this.publish({ editor: { id: "new-profile", content: NEW_PROFILE_CONTENT, revision: null }, dirty: true, issue: null, notice: null, pendingEditor: null, invalidFields: [], editorEpoch: this.current.editorEpoch + 1 });
3990
4022
  return;
@@ -3998,13 +4030,7 @@ var ProfilesController = class {
3998
4030
  const wanted = this.current.pendingEditor;
3999
4031
  if (wanted === null || this.current.busy !== null) return;
4000
4032
  this.publish({ pendingEditor: null });
4001
- const previous = this.current.editor;
4002
- const accepted = this.accepted;
4003
4033
  await this.loadEditor(wanted);
4004
- if (this.current.issue !== null && previous !== null) {
4005
- this.accepted = accepted;
4006
- this.publish({ editor: previous, dirty: true });
4007
- }
4008
4034
  }
4009
4035
  editId(id2) {
4010
4036
  const editor = this.current.editor;
@@ -4019,7 +4045,21 @@ var ProfilesController = class {
4019
4045
  editContent(content2) {
4020
4046
  const editor = this.current.editor;
4021
4047
  if (editor === null || editor.refreshRequired || this.current.busy !== null || this.current.pendingEditor !== null) return;
4022
- this.publish({ editor: { ...editor, content: content2 }, dirty: this.accepted === null || this.accepted.content !== content2 || this.accepted.id !== editor.id, issue: null, notice: null });
4048
+ const document2 = structuredDocument(content2);
4049
+ let invalidFields = this.current.invalidFields;
4050
+ if (document2 !== null) {
4051
+ for (const [key, draft2] of this.numberDrafts) {
4052
+ let value = document2;
4053
+ for (const segment of key.split(".")) {
4054
+ value = value !== null && typeof value === "object" && Object.hasOwn(value, segment) ? value[segment] : void 0;
4055
+ }
4056
+ if (value !== draft2.sourceValue) {
4057
+ this.numberDrafts.delete(key);
4058
+ invalidFields = invalidFields.filter((field) => field !== key);
4059
+ }
4060
+ }
4061
+ }
4062
+ this.publish({ editor: { ...editor, content: content2 }, invalidFields, dirty: this.accepted === null || this.accepted.content !== content2 || this.accepted.id !== editor.id, issue: null, notice: null });
4023
4063
  }
4024
4064
  editPath(path, value) {
4025
4065
  const editor = this.current.editor;
@@ -4069,8 +4109,8 @@ var ProfilesController = class {
4069
4109
  });
4070
4110
  }
4071
4111
  async apply() {
4072
- const { editor, snapshot: snapshot4, dirty } = this.current;
4073
- if (editor?.refreshRequired || !isConfigRevision(editor?.revision) || !canReconcileSelection(snapshot4) || dirty) return;
4112
+ const { editor, snapshot: snapshot4, dirty, invalidFields } = this.current;
4113
+ if (editor?.refreshRequired || !isConfigRevision(editor?.revision) || !canReconcileSelection(snapshot4) || dirty || invalidFields.length > 0) return;
4074
4114
  await this.perform("apply", async (live) => {
4075
4115
  const accepted = await this.unwrap(this.remote.select({ id: editor.id, expectedRevision: editor.revision, expectedSelectionRevision: snapshot4.selectionRevision }));
4076
4116
  if (live()) this.acceptSelection(accepted, { key: "applied", id: accepted.selectedId ?? void 0 });
@@ -4128,9 +4168,9 @@ var en = {
4128
4168
  warningProfile: "has warnings",
4129
4169
  omitLabel: "Use the ID as the name",
4130
4170
  businessLocale: "Output language",
4131
- inheritLocale: "Use the app language",
4171
+ inheritLocale: "Inherit plugin configuration",
4132
4172
  unsupportedLocale: "Choose a supported language",
4133
- localeHint: "A request in the conversation still decides the reply language.",
4173
+ localeHint: "Inherits plugin configuration and Host/user guidance when unset. An explicit request in the conversation still decides the reply language.",
4134
4174
  toolTopology: "Subagent tools",
4135
4175
  topologyHint: "per-role: one tool per role, plus one category tool. parameterized: pick the role or category in the tool arguments.",
4136
4176
  levelName: "Level: {level}",
@@ -4171,8 +4211,41 @@ var en = {
4171
4211
  headerModeOn: "Deepwork enabled.",
4172
4212
  headerModeOff: "Deepwork disabled.",
4173
4213
  headerUseCurrentModel: "Use profile model",
4174
- title: "Deepwork Profiles",
4175
- description: "Save configurations and choose the default for new sessions.",
4214
+ title: "Profiles",
4215
+ description: "Save Deepwork configurations; saving and activation are separate operations.",
4216
+ effectiveSummary: "Effective summary",
4217
+ futureDefaultSummary: "Future default:",
4218
+ currentSessionSummary: "This session:",
4219
+ locateSessionScope: "Select session profile",
4220
+ moreActions: "More actions",
4221
+ futureResetHint: "Restore new sessions to inherit the deployment baseline.",
4222
+ basicSettings: "Basic settings",
4223
+ profileIdHint: "Editable when creating; read-only after saving.",
4224
+ orchestratorModel: "Orchestrator model",
4225
+ orchestratorModelDesc: "Configure the primary model for the orchestrator role; saving does not switch the current session model.",
4226
+ orchestratorUnavailable: "The current role inventory does not include the orchestrator. Refresh to check; its stored configuration is kept.",
4227
+ orchestratorInBasicNotice: "The orchestrator model is configured above in Basic settings.",
4228
+ orchestratorJumpToBasic: "Edit in Basic settings",
4229
+ useSessionProfileModelDesc: "Uses the primary model of the profile currently admitted in this session; has the same effect as native model selection and may update the native default model.",
4230
+ rawInvalidFormDisabled: "The configuration has syntax errors; structured editing is unavailable.",
4231
+ viewConfiguration: "View JSONC source",
4232
+ advancedSettings: "Advanced settings",
4233
+ gitWriteGuard: "Git write protection",
4234
+ gitWriteScope: "Inspection scope",
4235
+ gitWriteScopeDisabledHint: "Protection is off; inspection scope is inactive",
4236
+ gitWriteGuardHint: "Inspection scope adjusts automatic Git protection only; explicit ask/deny still applies. Turning off does not authorize operations.",
4237
+ gitWriteAsk: "Ask",
4238
+ gitWriteDeny: "Deny",
4239
+ gitWriteOff: "Off",
4240
+ gitWriteAllWrites: "All Git write operations",
4241
+ gitWriteHighRisk: "High-risk Git operations only",
4242
+ topologyPerRole: "One tool per role",
4243
+ topologyParameterized: "Select role in tool arguments",
4244
+ roleModels: "Role models and availability",
4245
+ callingLevels: "Calling levels",
4246
+ fallbackRoutes: "Fallback routes",
4247
+ retryPolicy: "Retry policy",
4248
+ roleRoutingNotice: "Role routing configuration",
4176
4249
  newSessions: "Choose the configuration new sessions use. Existing sessions stay unchanged.",
4177
4250
  editorSelect: "Profile",
4178
4251
  choose: "Choose a profile",
@@ -4187,7 +4260,7 @@ var en = {
4187
4260
  saving: "Saving…",
4188
4261
  apply: "Set as default for new sessions",
4189
4262
  applying: "Setting default…",
4190
- reset: "Use default configuration",
4263
+ reset: "New sessions: use plugin defaults",
4191
4264
  resetting: "Restoring default…",
4192
4265
  refresh: "Refresh",
4193
4266
  refreshing: "Refreshing…",
@@ -4211,7 +4284,7 @@ var en = {
4211
4284
  applied: "New sessions will use {id}. Existing sessions stay unchanged.",
4212
4285
  resetDone: "New sessions will use the default configuration. Existing sessions stay unchanged.",
4213
4286
  discardPrompt: "Discard the unsaved draft?",
4214
- discard: "Discard",
4287
+ discard: "Discard changes",
4215
4288
  cancel: "Cancel",
4216
4289
  conflict: "The saved file or selection changed elsewhere. Your draft was kept. Refresh, then reload the profile or review your draft before retrying.",
4217
4290
  validation: "This profile is not valid. Fix the field below; your draft is unchanged.",
@@ -4269,7 +4342,7 @@ var en = {
4269
4342
  sessionConflict: "The session configuration changed elsewhere. Your draft was kept. Refresh before retrying.",
4270
4343
  sessionApply: "Use this profile",
4271
4344
  sessionApplying: "Applying…",
4272
- sessionReset: "Use default configuration",
4345
+ sessionReset: "This session: use plugin defaults",
4273
4346
  sessionResetting: "Restoring default…",
4274
4347
  sessionRefresh: "Refresh session state",
4275
4348
  sessionApplied: "Applied to this session only. The default for new sessions and existing children stay unchanged.",
@@ -4333,6 +4406,9 @@ var en = {
4333
4406
  unset: "not set",
4334
4407
  effortDefault: "Default (no explicit effort)",
4335
4408
  effortChangeHint: "Changing the provider or model clears this route's reasoning effort.",
4409
+ naturalProvider: "Provider",
4410
+ naturalModel: "Model",
4411
+ naturalEffort: "Reasoning Effort",
4336
4412
  advanced: "Advanced JSONC",
4337
4413
  rawInvalid: "Fix the invalid draft in Advanced JSONC to use these controls. Your draft was kept.",
4338
4414
  invalidNumber: "Enter a whole number within the limits."
@@ -4370,9 +4446,9 @@ var zh = {
4370
4446
  warningProfile: "有警告",
4371
4447
  omitLabel: "使用 ID 作为名称",
4372
4448
  businessLocale: "输出语言",
4373
- inheritLocale: "使用界面语言",
4449
+ inheritLocale: "继承插件配置",
4374
4450
  unsupportedLocale: "请选择支持的语言",
4375
- localeHint: "对话中的明确要求仍然决定回复语言。",
4451
+ localeHint: "未设置时继承插件配置与 Host/用户指导;对话中的明确要求仍然决定回复语言。",
4376
4452
  toolTopology: "子代理工具",
4377
4453
  topologyHint: "per-role:每个角色一个工具,另有一个类别工具。parameterized:在工具参数中选择角色或类别。",
4378
4454
  levelName: "等级:{level}",
@@ -4412,24 +4488,57 @@ var zh = {
4412
4488
  headerModeUnavailable: "Deepwork 不可用",
4413
4489
  headerModeOn: "Deepwork 已启用。",
4414
4490
  headerModeOff: "Deepwork 已关闭。",
4415
- headerUseCurrentModel: "使用配置中的模型",
4416
- title: "Deepwork 配置",
4417
- description: "保存配置并选择新会话使用的默认配置。",
4491
+ headerUseCurrentModel: "切换会话模型",
4492
+ title: "预设方案",
4493
+ description: "用于保存 Deepwork 配置;保存与生效是不同操作。",
4494
+ effectiveSummary: "生效摘要",
4495
+ futureDefaultSummary: "新会话默认:",
4496
+ currentSessionSummary: "本次会话:",
4497
+ locateSessionScope: "选择会话方案",
4498
+ moreActions: "更多生效操作",
4499
+ futureResetHint: "新会话将恢复为继承插件部署基线。",
4500
+ basicSettings: "基础设置",
4501
+ profileIdHint: "新建时可编辑;保存后只读。",
4502
+ orchestratorModel: "主协调模型",
4503
+ orchestratorModelDesc: "配置方案中的主协调角色;保存不会切换当前会话模型。",
4504
+ orchestratorInBasicNotice: "主协调模型在上方「基础设置」中配置。",
4505
+ orchestratorJumpToBasic: "在基础设置中编辑",
4506
+ useSessionProfileModelDesc: "使用本次会话已采用方案的角色主力模型;与原生模型选择具有相同效果,可能更新原生默认模型。",
4507
+ orchestratorUnavailable: "当前角色库存未包含主协调角色,请刷新确认;已存配置会保留。",
4508
+ rawInvalidFormDisabled: "配置内容有错误,暂时无法使用表单编辑",
4509
+ viewConfiguration: "查看配置内容",
4510
+ advancedSettings: "高级设置",
4511
+ gitWriteGuard: "Git 写入保护",
4512
+ gitWriteScope: "检查范围",
4513
+ gitWriteScopeDisabledHint: "保护已关闭,检查范围暂不生效",
4514
+ gitWriteGuardHint: "检查范围只调整自动 Git 保护,显式 ask/deny 仍生效;关闭不代表授权。",
4515
+ gitWriteAsk: "询问",
4516
+ gitWriteDeny: "禁止",
4517
+ gitWriteOff: "关闭",
4518
+ gitWriteAllWrites: "所有 Git 写操作",
4519
+ gitWriteHighRisk: "仅高危 Git 操作",
4520
+ topologyPerRole: "每个角色独立入口",
4521
+ topologyParameterized: "统一入口中选择角色",
4522
+ roleModels: "角色模型与可用性",
4523
+ callingLevels: "调用档位",
4524
+ fallbackRoutes: "备用模型",
4525
+ retryPolicy: "重试策略",
4526
+ roleRoutingNotice: "角色路由配置",
4418
4527
  newSessions: "选择新会话使用的配置,已有会话不变。",
4419
- editorSelect: "配置",
4528
+ editorSelect: "方案",
4420
4529
  choose: "选择配置",
4421
4530
  newDraft: "未保存的新配置",
4422
- new: "新建配置",
4423
- profileId: "配置 ID",
4531
+ new: "新建",
4532
+ profileId: "方案 ID",
4424
4533
  idHint: "1–64 个小写字母、数字、连字符或下划线,保存后不可修改。",
4425
4534
  configuration: "配置内容(JSONC)",
4426
4535
  configurationHint: "使用 version: 1、与上方一致的 ID 和 settings;label 可选,用于显示名称。",
4427
4536
  structuralHint: "权限、账户和插件在应用设置中管理。",
4428
4537
  save: "保存",
4429
4538
  saving: "正在保存…",
4430
- apply: "设为新会话默认配置",
4539
+ apply: "设为新会话默认",
4431
4540
  applying: "正在设置…",
4432
- reset: "使用默认配置",
4541
+ reset: "新会话使用插件默认",
4433
4542
  resetting: "正在恢复…",
4434
4543
  refresh: "刷新",
4435
4544
  refreshing: "正在刷新…",
@@ -4453,7 +4562,7 @@ var zh = {
4453
4562
  applied: "新会话将使用 {id},已有会话不变。",
4454
4563
  resetDone: "新会话将使用默认配置,已有会话不变。",
4455
4564
  discardPrompt: "是否丢弃未保存的草稿?",
4456
- discard: "丢弃",
4565
+ discard: "放弃更改",
4457
4566
  cancel: "取消",
4458
4567
  conflict: "已保存文件或选择在别处改变,草稿已保留。请刷新后重新加载或检查草稿再重试。",
4459
4568
  validation: "此配置无效,请修正下方字段;草稿未改变。",
@@ -4509,9 +4618,9 @@ var zh = {
4509
4618
  sessionAdmittedProfile: "{id}",
4510
4619
  sessionFutureDefault: "新会话默认配置:{profile}。",
4511
4620
  sessionConflict: "会话配置已在别处改变,草稿已保留。请刷新后重试。",
4512
- sessionApply: "使用此配置",
4621
+ sessionApply: "应用到本次会话",
4513
4622
  sessionApplying: "正在应用…",
4514
- sessionReset: "使用默认配置",
4623
+ sessionReset: "本次会话使用插件默认",
4515
4624
  sessionResetting: "正在恢复…",
4516
4625
  sessionRefresh: "刷新会话状态",
4517
4626
  sessionApplied: "已仅应用到本次会话,新会话默认配置和已有子会话不变。",
@@ -4525,19 +4634,19 @@ var zh = {
4525
4634
  catalogRefresh: "刷新模型目录",
4526
4635
  catalogRefreshing: "正在刷新…",
4527
4636
  catalogFailure: "提供商目录不可用:{name}({id})。",
4528
- profileLabel: "配置名称",
4637
+ profileLabel: "方案名称",
4529
4638
  defaultActive: "默认 Deepwork 模式",
4530
4639
  activeHint: "会话中选择的模式优先。",
4531
4640
  enabled: "启用",
4532
4641
  disabled: "禁用",
4533
- inherit: "使用部署基线",
4642
+ inherit: "继承插件配置",
4534
4643
  profileDefaults: "默认值",
4535
4644
  roleSelect: "角色",
4536
4645
  rolesUnavailable: "角色列表不可用,请刷新或使用高级编辑器。",
4537
4646
  roleEnabled: "应用设置中已启用",
4538
4647
  roleDisabled: "应用设置中已禁用",
4539
4648
  strategy: "{name} 策略",
4540
- inheritStrategy: "继承({value})",
4649
+ inheritStrategy: "继承插件配置({value})",
4541
4650
  startupLock: "保留起始路由",
4542
4651
  rateFallback: "多次限流后切换",
4543
4652
  strategyHint: "仅在限流且没有输出时切换模型;认证或配额错误会停止尝试。留空表示继承,零是明确值。",
@@ -4552,11 +4661,11 @@ var zh = {
4552
4661
  switchThreshold: "切换前的限流次数",
4553
4662
  maxSwitches: "最大切换次数",
4554
4663
  primaryMode: "{name} 主路由",
4555
- inheritRoute: "继承部署路由",
4664
+ inheritRoute: "继承插件配置",
4556
4665
  configuredRoute: "配置主路由",
4557
4666
  primaryName: "{name} 主路由",
4558
4667
  fallbackMode: "{name} 备用链",
4559
- inheritChain: "继承部署备用链",
4668
+ inheritChain: "继承插件配置",
4560
4669
  configuredChain: "明确的有序备用链",
4561
4670
  emptyChain: "空备用链:没有备用路由。",
4562
4671
  fallbackName: "{name} 备用 {index}",
@@ -4575,6 +4684,9 @@ var zh = {
4575
4684
  unset: "未设置",
4576
4685
  effortDefault: "默认(不指定强度)",
4577
4686
  effortChangeHint: "更改提供商或模型会清除该路由的推理强度。",
4687
+ naturalProvider: "提供商",
4688
+ naturalModel: "模型",
4689
+ naturalEffort: "推理强度",
4578
4690
  advanced: "高级 JSONC",
4579
4691
  rawInvalid: "请先在高级 JSONC 中修正草稿,再使用这些控件。草稿已保留。",
4580
4692
  invalidNumber: "请输入范围内的整数。"
@@ -4732,18 +4844,24 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
4732
4844
  // src/client/StructuredEditor.tsx
4733
4845
  var import_jsx_runtime4 = require("react/jsx-runtime");
4734
4846
  function RetryNumber({ id: id2, name: name2, field, value, inherited, path, disabled, actions: actions3, t }) {
4735
- const [draft2, setDraft] = (0, import_react2.useState)(value === void 0 ? "" : String(value));
4736
- const [invalid2, setInvalid] = (0, import_react2.useState)(false);
4737
- const [min, max] = DSMM_RATE_LIMIT_BOUNDS[field];
4738
4847
  const key = path.join(".");
4848
+ const stored = actions3.getNumberDraft?.(key);
4849
+ const sourceChanged = stored !== void 0 && value !== stored.sourceValue;
4850
+ const [draft2, setDraft] = (0, import_react2.useState)(stored && !sourceChanged ? stored.draft : value === void 0 ? "" : String(value));
4851
+ const [invalid2, setInvalid] = (0, import_react2.useState)(stored && !sourceChanged ? stored.invalid : false);
4852
+ const [min, max] = DSMM_RATE_LIMIT_BOUNDS[field];
4739
4853
  (0, import_react2.useEffect)(() => {
4740
- setDraft(value === void 0 ? "" : String(value));
4741
- setInvalid(false);
4742
- }, [value]);
4743
- (0, import_react2.useEffect)(() => {
4744
- actions3.setFieldInvalid(key, invalid2);
4745
- return () => actions3.setFieldInvalid(key, false);
4746
- }, [actions3.setFieldInvalid, key, invalid2]);
4854
+ const currentStored = actions3.getNumberDraft?.(key);
4855
+ if (currentStored && value !== currentStored.sourceValue) {
4856
+ setDraft(value === void 0 ? "" : String(value));
4857
+ setInvalid(false);
4858
+ } else if (!currentStored) {
4859
+ setDraft(value === void 0 ? "" : String(value));
4860
+ setInvalid(false);
4861
+ }
4862
+ }, [value, key, actions3]);
4863
+ const displayDraft = sourceChanged ? value === void 0 ? "" : String(value) : draft2;
4864
+ const isInvalid = sourceChanged ? false : invalid2;
4747
4865
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4748
4866
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: id2, children: t("retryField", { name: name2, field: t(RETRY_FIELD_LABEL_KEYS[field]) }) }),
4749
4867
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
@@ -4758,25 +4876,32 @@ function RetryNumber({ id: id2, name: name2, field, value, inherited, path, disa
4758
4876
  max,
4759
4877
  step: 1,
4760
4878
  disabled,
4761
- value: draft2,
4879
+ value: displayDraft,
4762
4880
  placeholder: inherited === void 0 ? t("unknownDefault") : t("inheritNumber", { value: inherited }),
4763
- "aria-invalid": invalid2 || void 0,
4764
- "aria-describedby": `${id2}-hint${invalid2 ? ` ${id2}-invalid` : ""}`,
4881
+ "aria-invalid": isInvalid || void 0,
4882
+ "aria-describedby": `${id2}-hint${isInvalid ? ` ${id2}-invalid` : ""}`,
4765
4883
  onChange: (event) => {
4766
4884
  const input = event.currentTarget;
4767
- setDraft(input.value);
4768
- const valid = input.validity.valid && (input.value === "" || Number.isSafeInteger(input.valueAsNumber));
4885
+ const valStr = input.value;
4886
+ const valid = input.validity.valid && (valStr === "" || Number.isSafeInteger(input.valueAsNumber));
4887
+ setDraft(valStr);
4769
4888
  setInvalid(!valid);
4770
- actions3.setFieldInvalid(key, !valid);
4771
- if (valid) actions3.editPath(path, input.value === "" ? void 0 : input.valueAsNumber);
4889
+ if (!valid) {
4890
+ actions3.setNumberDraft?.(key, { draft: valStr, invalid: true, sourceValue: value });
4891
+ actions3.setFieldInvalid(key, true);
4892
+ } else {
4893
+ actions3.setNumberDraft?.(key, null);
4894
+ actions3.setFieldInvalid(key, false);
4895
+ actions3.editPath(path, valStr === "" ? void 0 : input.valueAsNumber);
4896
+ }
4772
4897
  }
4773
4898
  }
4774
4899
  ),
4775
4900
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", id: `${id2}-hint`, children: t("retryBounds", { min, max, value: inherited ?? t("unknownDefault") }) }),
4776
- invalid2 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${id2}-invalid`, children: t("invalidNumber") })
4901
+ isInvalid && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${id2}-invalid`, children: t("invalidNumber") })
4777
4902
  ] });
4778
4903
  }
4779
- function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRoute, t }) {
4904
+ function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRoute, t, naturalLabels }) {
4780
4905
  const prefix = (0, import_react2.useId)();
4781
4906
  const providers = catalog?.groups ?? [];
4782
4907
  const group = providers.find((candidate) => candidate.id === value.provider);
@@ -4785,14 +4910,17 @@ function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRo
4785
4910
  const updateModel = (provider, modelId) => {
4786
4911
  editRoute(path, provider, modelId);
4787
4912
  };
4913
+ const providerLabel = naturalLabels ? t("naturalProvider") : t("routeProvider", { name: name2 ?? "" });
4914
+ const modelLabel = naturalLabels ? t("naturalModel") : t("routeModel", { name: name2 ?? "" });
4915
+ const effortLabel = naturalLabels ? t("naturalEffort") : t("routeEffort", { name: name2 ?? "" });
4788
4916
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-route-fields", children: [
4789
4917
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4790
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-provider`, children: t("routeProvider", { name: name2 }) }),
4918
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-provider`, children: providerLabel }),
4791
4919
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4792
4920
  EditableChoice,
4793
4921
  {
4794
4922
  id: `${prefix}-provider`,
4795
- label: t("routeProvider", { name: name2 }),
4923
+ label: providerLabel,
4796
4924
  value: value.provider,
4797
4925
  options: providers,
4798
4926
  disabled,
@@ -4802,12 +4930,12 @@ function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRo
4802
4930
  )
4803
4931
  ] }),
4804
4932
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4805
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-model`, children: t("routeModel", { name: name2 }) }),
4933
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-model`, children: modelLabel }),
4806
4934
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4807
4935
  EditableChoice,
4808
4936
  {
4809
4937
  id: `${prefix}-model`,
4810
- label: t("routeModel", { name: name2 }),
4938
+ label: modelLabel,
4811
4939
  value: value.model,
4812
4940
  options: group?.models ?? [],
4813
4941
  disabled,
@@ -4816,12 +4944,12 @@ function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRo
4816
4944
  )
4817
4945
  ] }),
4818
4946
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4819
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-effort`, children: t("routeEffort", { name: name2 }) }),
4947
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-effort`, children: effortLabel }),
4820
4948
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4821
4949
  EditableChoice,
4822
4950
  {
4823
4951
  id: `${prefix}-effort`,
4824
- label: t("routeEffort", { name: name2 }),
4952
+ label: effortLabel,
4825
4953
  value: value.reasoningEffort ?? "",
4826
4954
  options: efforts,
4827
4955
  disabled,
@@ -4844,7 +4972,21 @@ function PolicyFields({ value, inherited, path, name: name2, disabled, actions:
4844
4972
  ] })
4845
4973
  ] }),
4846
4974
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("strategyHint") }),
4847
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "dsmm-route-fields", children: Object.keys(DSMM_RATE_LIMIT_BOUNDS).map((field) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RetryNumber, { id: `${prefix}-${field}`, t, name: name2, field, value: value.rateLimit?.[field], inherited: inherited?.rateLimit[field], path: [...path, "rateLimit", field], disabled, actions: actions3 }, field)) })
4975
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "dsmm-route-fields", children: Object.keys(DSMM_RATE_LIMIT_BOUNDS).map((field) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4976
+ RetryNumber,
4977
+ {
4978
+ id: `${prefix}-${field}`,
4979
+ t,
4980
+ name: name2,
4981
+ field,
4982
+ value: value.rateLimit?.[field],
4983
+ inherited: inherited?.rateLimit[field],
4984
+ path: [...path, "rateLimit", field],
4985
+ disabled,
4986
+ actions: actions3
4987
+ },
4988
+ field
4989
+ )) })
4848
4990
  ] });
4849
4991
  }
4850
4992
  function LevelFields({ level: level2, value, path, catalog, disabled, actions: actions3, t }) {
@@ -4880,11 +5022,20 @@ function LevelFields({ level: level2, value, path, catalog, disabled, actions: a
4880
5022
  value?.provider !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { value, path, name: t("levelName", { level: level2 }), catalog, disabled, edit: actions3.editPath, editRoute: actions3.editRoute, t })
4881
5023
  ] });
4882
5024
  }
4883
- function StructuredEditor({ state, actions: actions3, disabled, t }) {
5025
+ function AdvancedSettings({ state, actions: actions3, disabled, onJumpToOrchestrator, t }) {
4884
5026
  const prefix = (0, import_react2.useId)();
4885
5027
  const [selectedRole, setSelectedRole] = (0, import_react2.useState)("dsmm-orchestrator");
4886
- const document2 = state.editor === null ? null : structuredDocument(state.editor.content);
5028
+ const editor = state.editor;
5029
+ if (editor === null) return null;
5030
+ const rawDoc = structuredDocument(editor.content);
5031
+ const lastValidDocRef = (0, import_react2.useRef)(null);
5032
+ if (rawDoc !== null) {
5033
+ lastValidDocRef.current = rawDoc;
5034
+ }
5035
+ const document2 = rawDoc ?? lastValidDocRef.current;
5036
+ const isInvalidProjection = rawDoc === null;
4887
5037
  if (document2 === null) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") });
5038
+ const effectiveDisabled = disabled || isInvalidProjection;
4888
5039
  const roles2 = state.snapshot?.roles ?? [];
4889
5040
  const role3 = roles2.find((candidate) => candidate.id === selectedRole) ?? roles2[0];
4890
5041
  const policy = role3 === void 0 ? void 0 : document2.roleRouting[role3.id] ?? {};
@@ -4901,46 +5052,14 @@ function StructuredEditor({ state, actions: actions3, disabled, t }) {
4901
5052
  const availability2 = roleAvailability(role3?.availability);
4902
5053
  const namedRoles = document2.settings.roles;
4903
5054
  const topology = document2.settings.subagents?.toolTopology;
5055
+ const gitGuard = document2.guards?.gitWriteGuard;
5056
+ const gitScope = document2.guards?.gitWriteScope;
5057
+ const isGuardOff = gitGuard === "off";
4904
5058
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-structured", "data-dsmm-structured": true, children: [
4905
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4906
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-label`, children: t("profileLabel") }),
4907
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Input, { id: `${prefix}-label`, className: "dsmm-input", value: document2.label ?? "", disabled, onChange: (event) => actions3.editPath(["label"], event.currentTarget.value) }),
4908
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || document2.label === void 0, onClick: () => actions3.editPath(["label"], void 0), children: t("omitLabel") })
4909
- ] }),
4910
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4911
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-locale`, children: t("businessLocale") }),
4912
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-locale`, value: String(document2.settings.locale ?? ""), disabled, "aria-describedby": `${prefix}-locale-hint`, onChange: (event) => actions3.editPath(["settings", "locale"], event.currentTarget.value || void 0), children: [
4913
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inheritLocale") }),
4914
- typeof document2.settings.locale === "string" && !DSMM_LOCALES.includes(document2.settings.locale) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: document2.settings.locale, children: t("unsupportedLocale") }),
4915
- DSMM_LOCALES.map((locale) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: locale, children: locale }, locale))
4916
- ] }),
4917
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${prefix}-locale-hint`, className: "dsmm-hint", children: t("localeHint") })
4918
- ] }),
4919
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4920
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-topology`, children: t("toolTopology") }),
4921
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-topology`, value: topology ?? "", disabled, "aria-describedby": `${prefix}-topology-hint`, onChange: (event) => actions3.editPath(["settings", "subagents", "toolTopology"], event.currentTarget.value || void 0), children: [
4922
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
4923
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "per-role", children: "per-role" }),
4924
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "parameterized", children: "parameterized" })
4925
- ] }),
4926
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${prefix}-topology-hint`, className: "dsmm-hint", children: t("topologyHint") })
4927
- ] }),
4928
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4929
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-active`, children: t("defaultActive") }),
4930
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-active`, disabled, value: document2.settings.defaultActive === void 0 ? "" : String(document2.settings.defaultActive), onChange: (event) => actions3.editPath(["settings", "defaultActive"], event.currentTarget.value === "" ? void 0 : event.currentTarget.value === "true"), children: [
4931
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
4932
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "true", children: t("enabled") }),
4933
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "false", children: t("disabled") })
4934
- ] }),
4935
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("activeHint") })
4936
- ] }),
4937
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { children: [
4938
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: t("profileDefaults") }),
4939
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PolicyFields, { t, value: document2.runtimePolicy, inherited: baseline, path: ["settings", "runtimePolicy"], name: t("profileDefaults"), disabled, actions: actions3 })
4940
- ] }),
5059
+ isInvalidProjection && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") }),
4941
5060
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4942
5061
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-role`, children: t("roleSelect") }),
4943
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-role`, disabled: disabled || roles2.length === 0 || state.invalidFields.length > 0, value: role3?.id ?? "", onChange: (event) => setSelectedRole(event.currentTarget.value), children: [
5062
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-role`, disabled: effectiveDisabled || roles2.length === 0, value: role3?.id ?? "", onChange: (event) => setSelectedRole(event.currentTarget.value), children: [
4944
5063
  roles2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("rolesUnavailable") }),
4945
5064
  roles2.map((candidate) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("option", { value: candidate.id, children: [
4946
5065
  candidate.label,
@@ -4953,31 +5072,35 @@ function StructuredEditor({ state, actions: actions3, disabled, t }) {
4953
5072
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RoleAvailability, { value: role3.availability, t }),
4954
5073
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4955
5074
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-role-enabled`, children: t("namedRole", { name: role3.label }) }),
4956
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-role-enabled`, value: namedRoles?.[role3.id] === void 0 ? "" : String(namedRoles[role3.id]), disabled, "aria-describedby": `${prefix}-role-hint`, onChange: (event) => actions3.editPath(["settings", "roles", role3.id], event.currentTarget.value === "" ? void 0 : event.currentTarget.value === "true"), children: [
5075
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-role-enabled`, value: namedRoles?.[role3.id] === void 0 ? "" : String(namedRoles[role3.id]), disabled: effectiveDisabled, "aria-describedby": `${prefix}-role-hint`, onChange: (event) => actions3.editPath(["settings", "roles", role3.id], event.currentTarget.value === "" ? void 0 : event.currentTarget.value === "true"), children: [
4957
5076
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
4958
5077
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "true", disabled: availability2 === void 0 || !availability2.startupAvailable || !availability2.deploymentEnabled || availability2.reason === "module-off", children: t("enabled") }),
4959
5078
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "false", disabled: availability2 === void 0 || availability2.required, children: t("disabled") })
4960
5079
  ] }),
4961
5080
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${prefix}-role-hint`, className: "dsmm-hint", children: t("namedRoleHint") })
4962
5081
  ] }),
4963
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PolicyFields, { t, value: policy, inherited, path: rolePath, name: role3.label, disabled, actions: actions3 }),
4964
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4965
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-primary-mode`, children: t("primaryMode", { name: role3.label }) }),
4966
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-primary-mode`, disabled, value: policy.primary === void 0 ? "inherit" : "explicit", onChange: (event) => actions3.editPath([...rolePath, "primary"], event.currentTarget.value === "inherit" ? void 0 : { provider: "", model: "" }), children: [
4967
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "inherit", children: t("inheritRoute") }),
4968
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "explicit", children: t("configuredRoute") })
4969
- ] })
4970
- ] }),
4971
- policy.primary !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { t, value: policy.primary, path: [...rolePath, "primary"], name: t("primaryName", { name: role3.label }), catalog: state.catalog, disabled, edit: actions3.editPath, editRoute: actions3.editRoute }),
4972
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("effortChangeHint") }),
4973
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("normalLevel") }),
4974
- role3.id === "dsmm-orchestrator" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("orchestratorLevels") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
5082
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PolicyFields, { t, value: policy, inherited, path: rolePath, name: role3.label, disabled: effectiveDisabled, actions: actions3 }),
5083
+ role3.id === "dsmm-orchestrator" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
5084
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("orchestratorInBasicNotice") }),
5085
+ onJumpToOrchestrator && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", onClick: onJumpToOrchestrator, children: t("orchestratorJumpToBasic") }),
5086
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("orchestratorLevels") })
5087
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
5088
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
5089
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-primary-mode`, children: t("primaryMode", { name: role3.label }) }),
5090
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-primary-mode`, disabled: effectiveDisabled, value: policy.primary === void 0 ? "inherit" : "explicit", onChange: (event) => actions3.editPath([...rolePath, "primary"], event.currentTarget.value === "inherit" ? void 0 : { provider: "", model: "" }), children: [
5091
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "inherit", children: t("inheritRoute") }),
5092
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "explicit", children: t("configuredRoute") })
5093
+ ] })
5094
+ ] }),
5095
+ policy.primary !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { t, value: policy.primary, path: [...rolePath, "primary"], name: t("primaryName", { name: role3.label }), catalog: state.catalog, disabled: effectiveDisabled, edit: actions3.editPath, editRoute: actions3.editRoute }),
5096
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("effortChangeHint") }),
5097
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("normalLevel") }),
4975
5098
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("levelsHint") }),
4976
- ["low", "high", "max"].map((level2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LevelFields, { level: level2, value: policy.levels?.[level2], path: [...rolePath, "levels", level2], catalog: state.catalog, disabled, actions: actions3, t }, level2))
5099
+ ["low", "high", "max"].map((level2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LevelFields, { level: level2, value: policy.levels?.[level2], path: [...rolePath, "levels", level2], catalog: state.catalog, disabled: effectiveDisabled, actions: actions3, t }, level2))
4977
5100
  ] }),
4978
5101
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
4979
5102
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-fallback-mode`, children: t("fallbackMode", { name: role3.label }) }),
4980
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-fallback-mode`, disabled, value: policy.fallbackRoutes === void 0 ? "inherit" : "explicit", onChange: (event) => actions3.editPath([...rolePath, "fallbackRoutes"], event.currentTarget.value === "inherit" ? void 0 : []), children: [
5103
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-fallback-mode`, disabled: effectiveDisabled, value: policy.fallbackRoutes === void 0 ? "inherit" : "explicit", onChange: (event) => actions3.editPath([...rolePath, "fallbackRoutes"], event.currentTarget.value === "inherit" ? void 0 : []), children: [
4981
5104
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "inherit", children: t("inheritChain") }),
4982
5105
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "explicit", children: t("configuredChain") })
4983
5106
  ] })
@@ -4987,19 +5110,54 @@ function StructuredEditor({ state, actions: actions3, disabled, t }) {
4987
5110
  const name2 = t("fallbackName", { name: role3.label, index: index + 1 });
4988
5111
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { children: [
4989
5112
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: name2 }),
4990
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { t, value: candidate, path: [...rolePath, "fallbackRoutes", index], name: name2, catalog: state.catalog, disabled, edit: actions3.editPath, editRoute: actions3.editRoute }),
5113
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { t, value: candidate, path: [...rolePath, "fallbackRoutes", index], name: name2, catalog: state.catalog, disabled: effectiveDisabled, edit: actions3.editPath, editRoute: actions3.editRoute }),
4991
5114
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-actions", children: [
4992
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || index === 0, onClick: () => actions3.moveFallback(role3.id, index, index - 1), children: t("moveUp", { name: name2 }) }),
4993
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || index === policy.fallbackRoutes.length - 1, onClick: () => actions3.moveFallback(role3.id, index, index + 1), children: t("moveDown", { name: name2 }) }),
4994
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled, onClick: () => actions3.editPath([...rolePath, "fallbackRoutes", index], void 0), children: t("removeFallback", { name: name2 }) })
5115
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: effectiveDisabled || index === 0, onClick: () => actions3.moveFallback(role3.id, index, index - 1), children: t("moveUp", { name: name2 }) }),
5116
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: effectiveDisabled || index === policy.fallbackRoutes.length - 1, onClick: () => actions3.moveFallback(role3.id, index, index + 1), children: t("moveDown", { name: name2 }) }),
5117
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: effectiveDisabled, onClick: () => actions3.editPath([...rolePath, "fallbackRoutes", index], void 0), children: t("removeFallback", { name: name2 }) })
4995
5118
  ] })
4996
5119
  ] }, index);
4997
5120
  }),
4998
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || (policy.fallbackRoutes?.length ?? 0) >= 32, onClick: () => {
5121
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: effectiveDisabled || (policy.fallbackRoutes?.length ?? 0) >= 32, onClick: () => {
4999
5122
  if (policy.fallbackRoutes === void 0) actions3.editPath([...rolePath, "fallbackRoutes"], [{ provider: "", model: "" }]);
5000
5123
  else actions3.editPath([...rolePath, "fallbackRoutes", policy.fallbackRoutes.length], { provider: "", model: "" });
5001
5124
  }, children: t("addFallback", { name: role3.label }) })
5002
- ] }, role3.id)
5125
+ ] }, role3.id),
5126
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { children: [
5127
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: t("profileDefaults") }),
5128
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PolicyFields, { t, value: document2.runtimePolicy, inherited: baseline, path: ["settings", "runtimePolicy"], name: t("profileDefaults"), disabled: effectiveDisabled, actions: actions3 })
5129
+ ] }),
5130
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { className: "dsmm-git-guard", children: [
5131
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: t("gitWriteGuard") }),
5132
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
5133
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-git-guard`, children: t("gitWriteGuard") }),
5134
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-git-guard`, disabled: effectiveDisabled, value: gitGuard ?? "", "aria-describedby": `${prefix}-git-guard-hint`, onChange: (event) => actions3.editPath(["settings", "guards", "gitWriteGuard"], event.currentTarget.value || void 0), children: [
5135
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
5136
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "ask", children: t("gitWriteAsk") }),
5137
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "deny", children: t("gitWriteDeny") }),
5138
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "off", children: t("gitWriteOff") })
5139
+ ] }),
5140
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${prefix}-git-guard-hint`, className: "dsmm-hint", children: t("gitWriteGuardHint") })
5141
+ ] }),
5142
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
5143
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-git-scope`, children: t("gitWriteScope") }),
5144
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-git-scope`, disabled: effectiveDisabled, value: gitScope ?? "", "aria-describedby": `${prefix}-git-scope-hint`, onChange: (event) => actions3.editPath(["settings", "guards", "gitWriteScope"], event.currentTarget.value || void 0), children: [
5145
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
5146
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "all-writes", disabled: isGuardOff, children: t("gitWriteAllWrites") }),
5147
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "high-risk", disabled: isGuardOff, children: t("gitWriteHighRisk") })
5148
+ ] }),
5149
+ isGuardOff && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${prefix}-git-scope-hint`, className: "dsmm-hint", children: t("gitWriteScopeDisabledHint") })
5150
+ ] })
5151
+ ] }),
5152
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
5153
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-topology`, children: t("toolTopology") }),
5154
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-topology`, value: topology ?? "", disabled: effectiveDisabled, "aria-describedby": `${prefix}-topology-hint`, onChange: (event) => actions3.editPath(["settings", "subagents", "toolTopology"], event.currentTarget.value || void 0), children: [
5155
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
5156
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "per-role", children: t("topologyPerRole") }),
5157
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "parameterized", children: t("topologyParameterized") })
5158
+ ] }),
5159
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${prefix}-topology-hint`, className: "dsmm-hint", children: t("topologyHint") })
5160
+ ] })
5003
5161
  ] });
5004
5162
  }
5005
5163
 
@@ -5014,7 +5172,9 @@ function sessionProfileLabels(session, t) {
5014
5172
  const future = session.globalDefault;
5015
5173
  return {
5016
5174
  admitted: t("sessionState", { profile, scope: session.scope }),
5017
- futureDefault: t("sessionFutureDefault", { profile: future.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: future.selectedId, revision: t(configurationVersionState(future.sourceRevision)) }) })
5175
+ futureDefault: t("sessionFutureDefault", {
5176
+ profile: !future || future.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: future.selectedId, revision: t(configurationVersionState(future.sourceRevision)) })
5177
+ })
5018
5178
  };
5019
5179
  }
5020
5180
 
@@ -5046,7 +5206,25 @@ function menuIssue(issue) {
5046
5206
  const field = issue.field;
5047
5207
  return { code, ...isSafeDiagnosticField(field) ? { field } : {} };
5048
5208
  }
5049
- function SessionScope({ state, actions: actions3, t, compact = false }) {
5209
+ function SessionScopeFeedback({ state, t }) {
5210
+ const session = state.session;
5211
+ 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");
5212
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { "data-dsmm-session-feedback": true, children: [
5213
+ session?.warnings?.length ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
5214
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: t("admissionWarnings") }),
5215
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ProfileWarnings, { warnings: session.warnings, t })
5216
+ ] }) : null,
5217
+ state.dirty && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", children: t("sessionDirty") }),
5218
+ (session?.refreshRequired || session?.selection.refreshRequired) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { role: "status", children: t("sessionCommittedRefresh") }),
5219
+ state.sessionUnconfirmed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { role: "status", children: t("sessionUnconfirmedRefresh") }),
5220
+ state.sessionIssue !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
5221
+ /* @__PURE__ */ (0, import_jsx_runtime5.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") : state.sessionIssue.code === "conflict" ? t("sessionConflict") : ["busy", "maintenance", "disposed", "not-owned"].includes(state.sessionIssue.code) ? t("sessionBusy", { reason: state.sessionIssue.code }) : t(state.sessionIssue.code === "validation" ? "validation" : "sessionUnavailable") }),
5222
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IssueDetails, { issue: state.sessionIssue, t })
5223
+ ] }),
5224
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.sessionBusy === "read" ? t("reading") : status })
5225
+ ] });
5226
+ }
5227
+ function SessionScope({ state, actions: actions3, t, compact = false, showFeedback = true }) {
5050
5228
  const prefix = (0, import_react3.useId)();
5051
5229
  const session = state.session;
5052
5230
  const labels = session === null ? null : sessionProfileLabels(session, t);
@@ -5059,7 +5237,6 @@ function SessionScope({ state, actions: actions3, t, compact = false }) {
5059
5237
  const ready = session !== null && !state.sessionUnconfirmed && !session.refreshRequired && !session.selection.refreshRequired && writableSelectionVersion(session.selection.selectionRevision);
5060
5238
  const allowed = ready && session.canApplyOverlay === true && session.applyOverlayUnavailableReason !== "new-session-required";
5061
5239
  const modelAllowed = ready && session.canSelectModel === true && session.profileModel !== void 0;
5062
- 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");
5063
5240
  let binding = session?.subagentRuntime;
5064
5241
  try {
5065
5242
  if (binding !== void 0) binding = parseSubagentRuntimeAdmissionView(binding);
@@ -5072,10 +5249,6 @@ function SessionScope({ state, actions: actions3, t, compact = false }) {
5072
5249
  labels !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { "data-dsmm-session-state": true, children: labels.admitted }),
5073
5250
  labels !== null && !compact && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", "data-dsmm-session-future-default": true, children: labels.futureDefault }),
5074
5251
  session === null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: t("sessionUnavailable") }),
5075
- session?.warnings?.length ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
5076
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: t("admissionWarnings") }),
5077
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ProfileWarnings, { warnings: session.warnings, t })
5078
- ] }) : null,
5079
5252
  session !== null && !allowed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: capabilityReason(session.applyOverlayUnavailableReason, t) }),
5080
5253
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field", children: [
5081
5254
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-choice`, children: t("sessionSelect") }),
@@ -5091,8 +5264,8 @@ function SessionScope({ state, actions: actions3, t, compact = false }) {
5091
5264
  ] })
5092
5265
  ] }),
5093
5266
  !compact && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
5094
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", children: t("sessionModelHint") }),
5095
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { type: "button", variant: "outline", disabled: disabled || !modelAllowed, "aria-describedby": !modelAllowed ? `${prefix}-model-reason` : void 0, onClick: () => {
5267
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", id: `${prefix}-model-hint`, children: t("useSessionProfileModelDesc") }),
5268
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { type: "button", variant: "outline", disabled: disabled || !modelAllowed, "aria-describedby": `${prefix}-model-hint${!modelAllowed ? ` ${prefix}-model-reason` : ""}`, onClick: () => {
5096
5269
  if (current()) void actions3.useSessionProfileModel();
5097
5270
  }, children: t("headerUseCurrentModel") }),
5098
5271
  !modelAllowed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", id: `${prefix}-model-reason`, children: capabilityReason(session?.selectModelUnavailableReason, t) }),
@@ -5112,9 +5285,6 @@ function SessionScope({ state, actions: actions3, t, compact = false }) {
5112
5285
  session.rolePolicy !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { "data-dsmm-session-policy": true, children: t("roleState", { route: session.rolePolicy.route === void 0 ? t("inheritRoute") : `${session.rolePolicy.route.provider}/${session.rolePolicy.route.model}${session.rolePolicy.route.reasoningEffort === void 0 ? "" : ` (${session.rolePolicy.route.reasoningEffort})`}`, strategy: session.rolePolicy.strategy, retries: session.rolePolicy.retries, failures: session.rolePolicy.rateLimitFailures, switches: session.rolePolicy.switches, delay: session.rolePolicy.totalDelayMs }) })
5113
5286
  ] })
5114
5287
  ] }),
5115
- state.dirty && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", children: t("sessionDirty") }),
5116
- (session?.refreshRequired || session?.selection.refreshRequired) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { role: "status", children: t("sessionCommittedRefresh") }),
5117
- state.sessionUnconfirmed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { role: "status", children: t("sessionUnconfirmedRefresh") }),
5118
5288
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-actions", children: [
5119
5289
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { type: "button", variant: "outline", disabled: disabled || !allowed || state.sessionChoice !== null && !isConfigRevision(selected?.revision), "aria-describedby": !allowed ? `${prefix}-overlay-reason` : void 0, onClick: () => {
5120
5290
  if (current()) void actions3.applySession();
@@ -5127,9 +5297,7 @@ function SessionScope({ state, actions: actions3, t, compact = false }) {
5127
5297
  }, children: t("sessionRefresh") })
5128
5298
  ] })
5129
5299
  ] }),
5130
- state.sessionIssue !== null && /* @__PURE__ */ (0, import_jsx_runtime5.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") : state.sessionIssue.code === "conflict" ? t("sessionConflict") : ["busy", "maintenance", "disposed", "not-owned"].includes(state.sessionIssue.code) ? t("sessionBusy", { reason: state.sessionIssue.code }) : t(state.sessionIssue.code === "validation" ? "validation" : "sessionUnavailable") }),
5131
- state.sessionIssue !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IssueDetails, { issue: state.sessionIssue, t }),
5132
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.sessionBusy === "read" ? t("reading") : status })
5300
+ showFeedback && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SessionScopeFeedback, { state, t })
5133
5301
  ] });
5134
5302
  }
5135
5303
  function SessionProfiles(props) {
@@ -5246,13 +5414,23 @@ function ProfilesSection(props) {
5246
5414
  const prefix = (0, import_react4.useId)();
5247
5415
  const selectRef = (0, import_react4.useRef)(null);
5248
5416
  const inputRef = (0, import_react4.useRef)(null);
5417
+ const labelRef = (0, import_react4.useRef)(null);
5249
5418
  const editorRef = (0, import_react4.useRef)(null);
5250
5419
  const advancedRef = (0, import_react4.useRef)(null);
5420
+ const advancedSettingsRef = (0, import_react4.useRef)(null);
5421
+ const moreActionsRef = (0, import_react4.useRef)(null);
5251
5422
  const handledValidation = (0, import_react4.useRef)(0);
5252
5423
  const cancelRef = (0, import_react4.useRef)(null);
5253
5424
  const hadConfirmation = (0, import_react4.useRef)(false);
5425
+ const initiatorRef = (0, import_react4.useRef)(null);
5426
+ const orchestratorRef = (0, import_react4.useRef)(null);
5427
+ const sessionScopeRef = (0, import_react4.useRef)(null);
5428
+ const advancedOpenRef = (0, import_react4.useRef)(false);
5429
+ const jsoncOpenRef = (0, import_react4.useRef)(false);
5430
+ const moreActionsOpenRef = (0, import_react4.useRef)(false);
5254
5431
  const disabled = state.busy !== null || state.pendingEditor !== null || state.sessionBusy === "apply" || state.sessionBusy === "reset";
5255
5432
  const snapshot4 = state.snapshot;
5433
+ const hasOrchestrator = snapshot4?.roles?.some((role3) => role3.id === "dsmm-orchestrator") === true;
5256
5434
  const editor = state.editor;
5257
5435
  const readOnly = snapshot4?.readOnly === true;
5258
5436
  const editorDisabled = disabled || readOnly || editor?.refreshRequired === true || editor?.revision === "unavailable";
@@ -5260,27 +5438,47 @@ function ProfilesSection(props) {
5260
5438
  const selectionConflict = reconcilable && snapshot4?.selectionError?.code === "conflict";
5261
5439
  const invalid2 = state.issue?.kind === "domain" && state.issue.code === "validation";
5262
5440
  const idInvalid = invalid2 && state.issue?.field === "id" && state.issue.location === void 0 && editor?.revision === null && !editorDisabled;
5263
- const rawInvalid = editor !== null && structuredDocument(editor.content) === null;
5441
+ const structuredDoc = editor === null ? null : structuredDocument(editor.content);
5442
+ const lastValidBasicDocRef = (0, import_react4.useRef)(null);
5443
+ if (structuredDoc !== null) {
5444
+ lastValidBasicDocRef.current = structuredDoc;
5445
+ }
5446
+ const basicDoc = structuredDoc ?? lastValidBasicDocRef.current;
5447
+ const rawInvalid = editor !== null && structuredDoc === null;
5264
5448
  (0, import_react4.useEffect)(() => {
5265
5449
  if (state.pendingEditor !== null) {
5266
5450
  cancelRef.current?.focus();
5267
5451
  hadConfirmation.current = true;
5268
5452
  } else if (hadConfirmation.current) {
5269
- selectRef.current?.focus();
5270
5453
  hadConfirmation.current = false;
5454
+ if (initiatorRef.current && initiatorRef.current.isConnected) {
5455
+ initiatorRef.current.focus();
5456
+ } else {
5457
+ selectRef.current?.focus();
5458
+ }
5271
5459
  }
5272
5460
  }, [state.pendingEditor]);
5273
5461
  (0, import_react4.useEffect)(() => {
5274
5462
  if (state.busy === null && state.validationEpoch > handledValidation.current && state.issue?.kind === "domain" && state.issue.code === "validation") {
5275
5463
  handledValidation.current = state.validationEpoch;
5276
- if (state.issue.location === void 0 && state.issue.field === "id" && inputRef.current !== null && !inputRef.current.disabled && !inputRef.current.readOnly) inputRef.current.focus();
5277
- else {
5278
- if (advancedRef.current !== null) advancedRef.current.open = true;
5464
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
5465
+ const scrollOpt = { behavior: reducedMotion ? "auto" : "smooth", block: "nearest" };
5466
+ if (state.issue.location === void 0 && state.issue.field === "id" && inputRef.current !== null && !inputRef.current.disabled && !inputRef.current.readOnly) {
5467
+ if (typeof inputRef.current.scrollIntoView === "function") inputRef.current.scrollIntoView(scrollOpt);
5468
+ inputRef.current.focus();
5469
+ } else {
5470
+ if (advancedRef.current !== null) {
5471
+ advancedRef.current.open = true;
5472
+ jsoncOpenRef.current = true;
5473
+ }
5279
5474
  const input = editorRef.current;
5280
5475
  if (input !== null) {
5476
+ if (typeof input.scrollIntoView === "function") input.scrollIntoView(scrollOpt);
5281
5477
  input.focus();
5282
5478
  const location = state.issue.location;
5283
- if (location !== void 0 && location.offset + location.length <= input.value.length) input.setSelectionRange(location.offset, location.offset + location.length);
5479
+ if (location !== void 0 && location.offset + location.length <= input.value.length) {
5480
+ input.setSelectionRange(location.offset, location.offset + location.length);
5481
+ }
5284
5482
  }
5285
5483
  }
5286
5484
  }
@@ -5292,21 +5490,15 @@ function ProfilesSection(props) {
5292
5490
  else if (snapshot4?.selectedId !== null && snapshot4?.selectedId !== void 0) selection = t("appliedProfile", { id: snapshot4.selectedId, revision: t(configurationVersionState(snapshot4.sourceRevision)) });
5293
5491
  const notice = state.notice === null ? "" : t(state.notice.key === "reset" ? "resetDone" : state.notice.key, { id: state.notice.id });
5294
5492
  const warnings2 = editor === null ? [] : draftWarnings(editor.content);
5295
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsmm-profiles", "aria-label": t("title"), "aria-busy": state.busy !== null, children: [
5493
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsmm-profiles dsmm-named-profiles", "aria-label": t("title"), "aria-busy": state.busy !== null, children: [
5296
5494
  readOnly && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", className: "dsmm-hint", children: t("readOnlyOrigin") }),
5297
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsmm-zone", "aria-labelledby": `${prefix}-browse`, "data-dsmm-zone": "browse", children: [
5298
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { id: `${prefix}-browse`, children: t("browseZone") }),
5299
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-actions", children: [
5300
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: editorDisabled || snapshot4 === null, onClick: () => {
5301
- void props.create();
5302
- }, children: t("new") }),
5303
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled, onClick: () => {
5304
- void props.refresh();
5305
- }, children: t(state.busy === "refresh" ? "refreshing" : "refresh") })
5306
- ] }),
5495
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { children: t("title") }),
5496
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("description") }),
5497
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-browse-row", children: [
5307
5498
  snapshot4 !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
5308
5499
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-select`, children: t("editorSelect") }),
5309
5500
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { ref: selectRef, id: `${prefix}-select`, disabled, value: editor?.revision == null ? "" : editor.id, onChange: (event) => {
5501
+ initiatorRef.current = event.currentTarget;
5310
5502
  if (event.currentTarget.value) void props.open(event.currentTarget.value);
5311
5503
  }, children: [
5312
5504
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: t(editor?.revision === null ? "newDraft" : "choose") }),
@@ -5315,101 +5507,312 @@ function ProfilesSection(props) {
5315
5507
  profile.error === void 0 ? "" : ` — ${t("invalidProfile", { id: profile.id })}`,
5316
5508
  profile.warnings?.length ? ` — ${t("warningProfile")}` : ""
5317
5509
  ] }, `${index}:${profile.id}`))
5318
- ] }),
5319
- snapshot4.profiles.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("empty") })
5320
- ] }),
5321
- snapshot4 !== null && snapshot4.profiles.some((profile) => profile.error !== void 0 || profile.warnings?.length) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "dsmm-profile-list", "aria-label": t("savedInventory"), children: snapshot4.profiles.filter((profile) => profile.error !== void 0 || profile.warnings?.length).map((profile, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { children: [
5322
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id }),
5323
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProfileWarnings, { warnings: profile.warnings, t }),
5324
- profile.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IssueDetails, { issue: profile.error, t })
5325
- ] }, `${index}:${profile.id}`)) }),
5326
- state.pendingEditor !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-confirm", role: "group", "aria-labelledby": `${prefix}-confirm`, onKeyDown: (event) => {
5327
- if (event.key === "Escape") {
5328
- event.preventDefault();
5329
- props.cancelDiscard();
5330
- }
5331
- }, children: [
5332
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-confirm`, children: t("discardPrompt") }),
5333
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-actions", children: [
5334
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", onClick: () => {
5335
- void props.discardAndOpen();
5336
- }, children: t("discard") }),
5337
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { ref: cancelRef, type: "button", variant: "primary", onClick: props.cancelDiscard, children: t("cancel") })
5338
5510
  ] })
5511
+ ] }),
5512
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-actions", children: [
5513
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: editorDisabled || snapshot4 === null, onClick: (event) => {
5514
+ initiatorRef.current = event.currentTarget;
5515
+ void props.create();
5516
+ }, children: t("new") }),
5517
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled, onClick: (event) => {
5518
+ initiatorRef.current = event.currentTarget;
5519
+ void props.refresh();
5520
+ }, children: t(state.busy === "refresh" ? "refreshing" : "refresh") })
5521
+ ] }),
5522
+ editor !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-badge", "data-dsmm-editor-state": state.invalidFields.length > 0 || invalid2 || rawInvalid ? "invalid" : state.dirty ? "dirty" : readOnly ? "readonly" : "ready", children: t(editor.refreshRequired ? "savedRefreshRequired" : state.invalidFields.length > 0 || invalid2 || rawInvalid ? "validation" : state.dirty ? "dirty" : applied ? "savedApplied" : relationship === "unknown" ? "savedRelationshipUnknown" : "savedNotApplied") })
5523
+ ] }),
5524
+ snapshot4?.profiles.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("empty") }),
5525
+ snapshot4 !== null && snapshot4.profiles.some((profile) => profile.error !== void 0 || profile.warnings?.length) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "dsmm-profile-list", "aria-label": t("savedInventory"), children: snapshot4.profiles.filter((profile) => profile.error !== void 0 || profile.warnings?.length).map((profile, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { children: [
5526
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id }),
5527
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProfileWarnings, { warnings: profile.warnings, t }),
5528
+ profile.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IssueDetails, { issue: profile.error, t })
5529
+ ] }, `${index}:${profile.id}`)) }),
5530
+ state.pendingEditor !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-confirm", role: "group", "aria-labelledby": `${prefix}-confirm`, onKeyDown: (event) => {
5531
+ if (event.key === "Escape") {
5532
+ event.preventDefault();
5533
+ props.cancelDiscard();
5534
+ }
5535
+ }, children: [
5536
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-confirm`, children: t("discardPrompt") }),
5537
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-actions", children: [
5538
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", onClick: () => {
5539
+ void props.discardAndOpen();
5540
+ }, children: t("discard") }),
5541
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { ref: cancelRef, type: "button", variant: "primary", onClick: props.cancelDiscard, children: t("cancel") })
5339
5542
  ] })
5340
5543
  ] }),
5341
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsmm-zone", "aria-labelledby": `${prefix}-edit`, "data-dsmm-zone": "edit", children: [
5342
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { id: `${prefix}-edit`, children: t("editZone") }),
5343
- editor === null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("noEditor") }),
5344
- editor !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-editor", children: [
5345
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { "data-dsmm-editor-state": true, children: t(editor.refreshRequired ? "savedRefreshRequired" : state.dirty ? "dirty" : applied ? "savedApplied" : relationship === "unknown" ? "savedRelationshipUnknown" : "savedNotApplied") }),
5346
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-actions", children: [
5347
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "primary", disabled: editorDisabled || !state.dirty || snapshot4 === null || state.invalidFields.length > 0, onClick: () => {
5348
- void props.save();
5349
- }, children: t(state.busy === "save" ? "saving" : "save") }),
5350
- editor.revision !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled, onClick: () => {
5351
- void props.reload();
5352
- }, children: t("reload") })
5353
- ] }),
5354
- warnings2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
5355
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("draftWarnings") }),
5356
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProfileWarnings, { warnings: warnings2, t })
5357
- ] }),
5358
- editor.warnings?.length ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
5359
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("savedWarnings") }),
5360
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProfileWarnings, { warnings: editor.warnings, t })
5361
- ] }) : null,
5362
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
5363
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-id`, children: t("profileId") }),
5364
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Input, { ref: inputRef, id: `${prefix}-id`, className: "dsmm-input", value: editor.id, disabled: editorDisabled || editor.revision !== null, "aria-invalid": idInvalid || void 0, "aria-describedby": `${prefix}-id-hint${idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editId(event.currentTarget.value) }),
5365
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-id-hint`, className: "dsmm-hint", children: t("idHint") })
5366
- ] }),
5367
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-catalog", children: [
5368
- state.catalogUnavailable && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("catalogUnavailable") }),
5369
- state.catalog?.failures.map((failure) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("catalogFailure", { name: failure.name, id: failure.id }) }, failure.id)),
5370
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: state.catalogBusy, onClick: () => {
5371
- void props.refreshCatalog();
5372
- }, children: t(state.catalogBusy ? "catalogRefreshing" : "catalogRefresh") })
5544
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-effective-summary", "data-dsmm-effective-summary": true, children: [
5545
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-summary-row", children: [
5546
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
5547
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "dsmm-summary-label", children: t("futureDefaultSummary") }),
5548
+ " ",
5549
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "dsmm-summary-val", "data-dsmm-selection": true, children: selection })
5373
5550
  ] }),
5374
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StructuredEditor, { state, actions: props, disabled: editorDisabled, t }, `structured:${state.editorEpoch}`),
5375
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { ref: advancedRef, className: "dsmm-advanced", children: [
5376
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("summary", { children: t("advanced") }),
5377
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
5378
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-content`, children: t("configuration") }),
5379
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("textarea", { ref: editorRef, id: `${prefix}-content`, rows: 12, spellCheck: false, value: editor.content, readOnly, disabled: editorDisabled, "aria-invalid": rawInvalid || invalid2 && !idInvalid || void 0, "aria-describedby": `${prefix}-content-hint ${prefix}-structural-hint${invalid2 && !idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editContent(event.currentTarget.value) }),
5380
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-content-hint`, className: "dsmm-hint", children: t("configurationHint") }),
5381
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-structural-hint`, className: "dsmm-hint", children: t("structuralHint") })
5382
- ] })
5383
- ] }, `advanced:${state.editorEpoch}`)
5551
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "primary", size: "sm", disabled: editorDisabled || state.dirty || state.invalidFields.length > 0 || editor?.revision == null || !reconcilable || applied && !selectionConflict, onClick: () => {
5552
+ void props.apply();
5553
+ }, children: t(state.busy === "apply" ? "applying" : "apply") })
5384
5554
  ] }),
5385
- state.issue !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-issue", id: `${prefix}-issue`, role: "alert", children: [
5386
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t(issueKey(state.issue)) }),
5387
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IssueDetails, { issue: state.issue, t })
5388
- ] })
5389
- ] }),
5390
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsmm-zone", "aria-labelledby": `${prefix}-global`, "data-dsmm-zone": "future-default", children: [
5391
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { id: `${prefix}-global`, children: t("globalScope") }),
5392
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-global-action`, className: "dsmm-hint", children: t("newSessions") }),
5393
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { "data-dsmm-selection": true, children: selection }),
5394
5555
  snapshot4?.refreshRequired && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", children: t("savedRefreshRequired") }),
5395
5556
  snapshot4?.selectedWarnings?.length ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
5396
5557
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("futureWarnings") }),
5397
5558
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProfileWarnings, { warnings: snapshot4.selectedWarnings, t })
5398
5559
  ] }) : null,
5399
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-actions", children: [
5400
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "primary", "aria-describedby": `${prefix}-global-action`, disabled: editorDisabled || state.dirty || editor?.revision == null || !reconcilable || applied && !selectionConflict, onClick: () => {
5401
- void props.apply();
5402
- }, children: t(state.busy === "apply" ? "applying" : "apply") }),
5403
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: editorDisabled || !reconcilable || snapshot4?.selectedId === null && !selectionConflict, onClick: () => {
5404
- void props.reset();
5405
- }, children: t(state.busy === "reset" ? "resetting" : "reset") })
5406
- ] }),
5407
5560
  snapshot4?.selectionError !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-issue", children: [
5408
5561
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t(selectionConflict ? "selectionConflict" : "retry") }),
5409
5562
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IssueDetails, { issue: snapshot4.selectionError, t })
5563
+ ] }),
5564
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-summary-row", children: [
5565
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
5566
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "dsmm-summary-label", children: t("currentSessionSummary") }),
5567
+ " ",
5568
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "dsmm-summary-val", children: state.session === null ? t("sessionUnavailable") : sessionProfileLabels(state.session, t).admitted })
5569
+ ] }),
5570
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
5571
+ if (moreActionsRef.current !== null) {
5572
+ moreActionsRef.current.open = true;
5573
+ moreActionsOpenRef.current = true;
5574
+ }
5575
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
5576
+ sessionScopeRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
5577
+ }, children: t("locateSessionScope") })
5578
+ ] }),
5579
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionScopeFeedback, { state, t }),
5580
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { ref: moreActionsRef, className: "dsmm-more-actions", open: moreActionsOpenRef.current || void 0, onToggle: (e) => {
5581
+ moreActionsOpenRef.current = e.currentTarget.open;
5582
+ }, children: [
5583
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("summary", { children: t("moreActions") }),
5584
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
5585
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
5586
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: editorDisabled || !reconcilable || snapshot4?.selectedId === null && !selectionConflict, onClick: () => {
5587
+ void props.reset();
5588
+ }, children: t(state.busy === "reset" ? "resetting" : "reset") }),
5589
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("futureResetHint") })
5590
+ ] }),
5591
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref: sessionScopeRef, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionScope, { state, actions: props, t, showFeedback: false }) })
5592
+ ] })
5410
5593
  ] })
5411
5594
  ] }),
5412
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("section", { className: "dsmm-zone", "aria-label": t("sessionScope"), "data-dsmm-zone": "current-session", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionScope, { state, actions: props, t }) }),
5595
+ editor === null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("noEditor") }),
5596
+ editor !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-editor", children: [
5597
+ warnings2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
5598
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("draftWarnings") }),
5599
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProfileWarnings, { warnings: warnings2, t })
5600
+ ] }),
5601
+ editor.warnings?.length ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
5602
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("savedWarnings") }),
5603
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProfileWarnings, { warnings: editor.warnings, t })
5604
+ ] }) : null,
5605
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-catalog", children: [
5606
+ state.catalogUnavailable && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("catalogUnavailable") }),
5607
+ state.catalog?.failures.map((failure) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("catalogFailure", { name: failure.name, id: failure.id }) }, failure.id)),
5608
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: state.catalogBusy, onClick: () => {
5609
+ void props.refreshCatalog();
5610
+ }, children: t(state.catalogBusy ? "catalogRefreshing" : "catalogRefresh") })
5611
+ ] }),
5612
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-basic-settings", "data-dsmm-basic-settings": true, children: [
5613
+ structuredDoc === null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-structured-invalid", "data-dsmm-structured-invalid": true, children: [
5614
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("rawInvalid") }),
5615
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("rawInvalidFormDisabled") }),
5616
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5617
+ import_dsh_client_ui_primitives4.Button,
5618
+ {
5619
+ type: "button",
5620
+ variant: "outline",
5621
+ onClick: () => {
5622
+ if (advancedRef.current !== null) {
5623
+ advancedRef.current.open = true;
5624
+ jsoncOpenRef.current = true;
5625
+ }
5626
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
5627
+ editorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
5628
+ editorRef.current?.focus();
5629
+ },
5630
+ children: t("viewConfiguration")
5631
+ }
5632
+ )
5633
+ ] }),
5634
+ basicDoc !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
5635
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
5636
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-label`, children: t("profileLabel") }),
5637
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5638
+ import_dsh_client_ui_primitives4.Input,
5639
+ {
5640
+ ref: labelRef,
5641
+ id: `${prefix}-label`,
5642
+ className: "dsmm-input",
5643
+ value: basicDoc.label ?? "",
5644
+ disabled: editorDisabled || structuredDoc === null,
5645
+ onChange: (event) => props.editPath(["label"], event.currentTarget.value)
5646
+ }
5647
+ ),
5648
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5649
+ import_dsh_client_ui_primitives4.Button,
5650
+ {
5651
+ type: "button",
5652
+ variant: "outline",
5653
+ disabled: editorDisabled || structuredDoc === null || basicDoc.label === void 0,
5654
+ onClick: () => props.editPath(["label"], void 0),
5655
+ children: t("omitLabel")
5656
+ }
5657
+ )
5658
+ ] }),
5659
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
5660
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-id`, children: t("profileId") }),
5661
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5662
+ import_dsh_client_ui_primitives4.Input,
5663
+ {
5664
+ ref: inputRef,
5665
+ id: `${prefix}-id`,
5666
+ className: "dsmm-input",
5667
+ value: editor.id,
5668
+ disabled: editorDisabled || structuredDoc === null || editor.revision !== null,
5669
+ "aria-invalid": idInvalid || void 0,
5670
+ "aria-describedby": `${prefix}-id-hint${idInvalid ? ` ${prefix}-issue` : ""}`,
5671
+ onChange: (event) => props.editId(event.currentTarget.value)
5672
+ }
5673
+ ),
5674
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-id-hint`, className: "dsmm-hint", children: t("idHint") })
5675
+ ] }),
5676
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: orchestratorRef, className: "dsmm-field", id: `${prefix}-orchestrator-primary`, children: [
5677
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-orch-mode`, children: t("orchestratorModel") }),
5678
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("orchestratorModelDesc") }),
5679
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
5680
+ "select",
5681
+ {
5682
+ id: `${prefix}-orch-mode`,
5683
+ disabled: editorDisabled || structuredDoc === null || !hasOrchestrator,
5684
+ "aria-describedby": !hasOrchestrator ? `${prefix}-orch-unavailable` : void 0,
5685
+ value: basicDoc.roleRouting["dsmm-orchestrator"]?.primary === void 0 ? "inherit" : "explicit",
5686
+ onChange: (event) => props.editPath(["settings", "roleRouting", "dsmm-orchestrator", "primary"], event.currentTarget.value === "inherit" ? void 0 : { provider: "", model: "" }),
5687
+ children: [
5688
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "inherit", children: t("inheritRoute") }),
5689
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "explicit", children: t("configuredRoute") })
5690
+ ]
5691
+ }
5692
+ ),
5693
+ !hasOrchestrator && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", id: `${prefix}-orch-unavailable`, children: t("orchestratorUnavailable") }),
5694
+ basicDoc.roleRouting["dsmm-orchestrator"]?.primary !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5695
+ RouteFields,
5696
+ {
5697
+ t,
5698
+ value: basicDoc.roleRouting["dsmm-orchestrator"].primary,
5699
+ path: ["settings", "roleRouting", "dsmm-orchestrator", "primary"],
5700
+ naturalLabels: true,
5701
+ catalog: state.catalog,
5702
+ disabled: editorDisabled || structuredDoc === null || !hasOrchestrator,
5703
+ edit: props.editPath,
5704
+ editRoute: props.editRoute
5705
+ }
5706
+ ),
5707
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("effortChangeHint") })
5708
+ ] }),
5709
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
5710
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-locale`, children: t("businessLocale") }),
5711
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
5712
+ "select",
5713
+ {
5714
+ id: `${prefix}-locale`,
5715
+ value: String(basicDoc.settings.locale ?? ""),
5716
+ disabled: editorDisabled || structuredDoc === null,
5717
+ "aria-describedby": `${prefix}-locale-hint`,
5718
+ onChange: (event) => props.editPath(["settings", "locale"], event.currentTarget.value || void 0),
5719
+ children: [
5720
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: t("inheritLocale") }),
5721
+ typeof basicDoc.settings.locale === "string" && !DSMM_LOCALES.includes(basicDoc.settings.locale) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: basicDoc.settings.locale, children: t("unsupportedLocale") }),
5722
+ DSMM_LOCALES.map((locale) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: locale, children: locale }, locale))
5723
+ ]
5724
+ }
5725
+ ),
5726
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-locale-hint`, className: "dsmm-hint", children: t("localeHint") })
5727
+ ] }),
5728
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
5729
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-active`, children: t("defaultActive") }),
5730
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
5731
+ "select",
5732
+ {
5733
+ id: `${prefix}-active`,
5734
+ disabled: editorDisabled || structuredDoc === null,
5735
+ value: basicDoc.settings.defaultActive === void 0 ? "" : String(basicDoc.settings.defaultActive),
5736
+ onChange: (event) => props.editPath(["settings", "defaultActive"], event.currentTarget.value === "" ? void 0 : event.currentTarget.value === "true"),
5737
+ children: [
5738
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: t("inherit") }),
5739
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "true", children: t("enabled") }),
5740
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "false", children: t("disabled") })
5741
+ ]
5742
+ }
5743
+ ),
5744
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("activeHint") })
5745
+ ] })
5746
+ ] })
5747
+ ] }, `basic:${state.editorEpoch}`),
5748
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
5749
+ "details",
5750
+ {
5751
+ ref: advancedSettingsRef,
5752
+ className: "dsmm-advanced-settings",
5753
+ open: advancedOpenRef.current || void 0,
5754
+ onToggle: (e) => {
5755
+ advancedOpenRef.current = e.currentTarget.open;
5756
+ },
5757
+ children: [
5758
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("summary", { children: t("advancedSettings") }),
5759
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
5760
+ AdvancedSettings,
5761
+ {
5762
+ state,
5763
+ actions: props,
5764
+ disabled: editorDisabled,
5765
+ onJumpToOrchestrator: () => {
5766
+ const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
5767
+ orchestratorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
5768
+ orchestratorRef.current?.querySelector("select, input")?.focus();
5769
+ },
5770
+ t
5771
+ }
5772
+ ) })
5773
+ ]
5774
+ },
5775
+ `advanced-settings:${state.editorEpoch}`
5776
+ ),
5777
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
5778
+ "details",
5779
+ {
5780
+ ref: advancedRef,
5781
+ className: "dsmm-advanced",
5782
+ open: jsoncOpenRef.current || void 0,
5783
+ onToggle: (e) => {
5784
+ jsoncOpenRef.current = e.currentTarget.open;
5785
+ },
5786
+ children: [
5787
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("summary", { children: t("configuration") }),
5788
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
5789
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-content`, children: t("configuration") }),
5790
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("textarea", { ref: editorRef, id: `${prefix}-content`, rows: 12, spellCheck: false, value: editor.content, readOnly, disabled: editorDisabled, "aria-invalid": rawInvalid || invalid2 && !idInvalid || void 0, "aria-describedby": `${prefix}-content-hint ${prefix}-structural-hint${invalid2 && !idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editContent(event.currentTarget.value) }),
5791
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-content-hint`, className: "dsmm-hint", children: t("configurationHint") }),
5792
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { id: `${prefix}-structural-hint`, className: "dsmm-hint", children: t("structuralHint") })
5793
+ ] })
5794
+ ]
5795
+ },
5796
+ `advanced:${state.editorEpoch}`
5797
+ ),
5798
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "dsmm-save-bar", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-actions", children: [
5799
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "primary", disabled: editorDisabled || !state.dirty || snapshot4 === null || state.invalidFields.length > 0, onClick: () => {
5800
+ void props.save();
5801
+ }, children: t(state.busy === "save" ? "saving" : "save") }),
5802
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: editorDisabled || !state.dirty && state.invalidFields.length === 0, onClick: (event) => {
5803
+ initiatorRef.current = event.currentTarget;
5804
+ props.discard();
5805
+ }, children: t("discard") }),
5806
+ editor.revision !== null && !state.dirty && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled, onClick: (event) => {
5807
+ initiatorRef.current = event.currentTarget;
5808
+ void props.reload();
5809
+ }, children: t("reload") })
5810
+ ] }) })
5811
+ ] }),
5812
+ state.issue !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-issue", id: `${prefix}-issue`, role: "alert", children: [
5813
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t(issueKey(state.issue)) }),
5814
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IssueDetails, { issue: state.issue, t })
5815
+ ] }),
5413
5816
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.busy === "refresh" && snapshot4 === null ? t("loading") : state.busy === "read" ? t("reading") : notice })
5414
5817
  ] });
5415
5818
  }
@@ -5510,7 +5913,25 @@ var PROFILE_STYLES = `
5510
5913
  .dsmm-profiles .dsmm-kv{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;margin:4px 0 0;font-size:12px}
5511
5914
  .dsmm-profiles .dsmm-kv dt{font-weight:500;color:var(--dsw-alias-label-secondary)}
5512
5915
  .dsmm-profiles .dsmm-kv dd{margin:0;color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code)}
5513
- @media(prefers-reduced-motion:reduce){.dsmm-profiles *{transition:none!important;animation:none!important}}
5916
+ .dsmm-named-profiles .dsmm-browse-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
5917
+ .dsmm-named-profiles .dsmm-effective-summary{display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md)}
5918
+ .dsmm-named-profiles .dsmm-summary-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
5919
+ .dsmm-named-profiles .dsmm-summary-label{display:inline-flex;align-items:center;gap:6px;font-weight:500}
5920
+ .dsmm-named-profiles .dsmm-summary-val{color:var(--dsw-alias-label-secondary)}
5921
+ .dsmm-named-profiles .dsmm-more-actions{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);padding:8px 12px}
5922
+ .dsmm-named-profiles .dsmm-more-actions[open]{padding-bottom:12px}
5923
+ .dsmm-named-profiles .dsmm-more-actions>summary{font-weight:500}
5924
+ .dsmm-named-profiles .dsmm-more-actions>div{margin-top:12px;display:flex;flex-direction:column;gap:12px}
5925
+ .dsmm-named-profiles .dsmm-basic-settings{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md)}
5926
+ .dsmm-named-profiles .dsmm-advanced-settings{border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);padding:8px 12px}
5927
+ .dsmm-named-profiles .dsmm-advanced-settings[open]{padding-bottom:12px}
5928
+ .dsmm-named-profiles .dsmm-advanced-settings>summary{font-weight:500}
5929
+ .dsmm-named-profiles .dsmm-advanced-settings>div{margin-top:12px;display:flex;flex-direction:column;gap:12px}
5930
+ .dsmm-named-profiles .dsmm-save-bar{display:flex;flex-direction:column;gap:8px;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l4)}
5931
+ .dsmm-named-profiles .dsmm-orchestrator-primary{background:var(--dsw-alias-bg-layer-1)}
5932
+ .dsmm-named-profiles .dsmm-git-guard{background:var(--dsw-alias-bg-layer-1)}
5933
+ .dsmm-named-profiles .dsmm-structured-invalid{display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid var(--dsw-alias-state-error-primary);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform)}
5934
+ @media(prefers-reduced-motion:reduce){.dsmm-profiles *{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
5514
5935
  `;
5515
5936
 
5516
5937
  // src/client/deployment-data.ts
@@ -8227,8 +8648,10 @@ function preparingRoleTool(toolName, args) {
8227
8648
  return value === void 0 ? [] : [[key, value]];
8228
8649
  }));
8229
8650
  const complete = Object.fromEntries(Object.entries(received).filter(([key]) => args.complete(key)));
8651
+ const requested = requestedRoleTool(toolName, args.invalid ? "" : JSON.stringify(complete));
8652
+ const description = requested.description ?? (typeof received.description === "string" ? received.description : void 0);
8230
8653
  return {
8231
- requested: requestedRoleTool(toolName, args.invalid ? "" : JSON.stringify(complete)),
8654
+ requested: { ...requested, description },
8232
8655
  preview: Object.keys(received).length === 0 ? "" : JSON.stringify(received, null, 2)
8233
8656
  };
8234
8657
  }
@@ -8249,18 +8672,21 @@ function roleToolDisplay(target) {
8249
8672
  var ROLE_TOOL_NS = "conversation.dsmm-role-tool";
8250
8673
  var roleToolEn = {
8251
8674
  call: "Call",
8675
+ calling: "Calling",
8252
8676
  unknownTarget: "DSMM agent · target pending",
8253
8677
  requested: "Requested",
8254
8678
  actual: "Actual",
8255
8679
  role: "Role",
8256
8680
  category: "Category",
8257
8681
  unknown: "Unknown",
8682
+ actualUnknown: "Actual unknown",
8258
8683
  preparing: "Preparing",
8259
- running: "Running",
8260
- result: "Tool returned · child completion not inferred",
8261
- background: "Started / handed off · child completion not confirmed",
8262
- error: "Tool error",
8684
+ running: "Calling",
8685
+ result: "Returned",
8686
+ background: "Background",
8687
+ error: "Failed",
8263
8688
  stopped: "Interrupted",
8689
+ technicalDetails: "Technical details",
8264
8690
  args: "Original arguments",
8265
8691
  preparingArgs: "Arguments received so far",
8266
8692
  output: "Complete result content",
@@ -8277,18 +8703,21 @@ var roleToolEn = {
8277
8703
  };
8278
8704
  var roleToolZh = {
8279
8705
  call: "调用",
8706
+ calling: "正在调用",
8280
8707
  unknownTarget: "DSMM 代理 · 目标待确定",
8281
8708
  requested: "请求",
8282
8709
  actual: "实际",
8283
8710
  role: "角色",
8284
8711
  category: "类别",
8285
8712
  unknown: "未知",
8713
+ actualUnknown: "实际未知",
8286
8714
  preparing: "准备中",
8287
- running: "运行中",
8288
- result: "工具已返回 · 不推断子任务完成",
8289
- background: "已启动/移交 · 尚未确认子任务完成",
8290
- error: "工具错误",
8715
+ running: "调用中",
8716
+ result: "已返回",
8717
+ background: "后台调用",
8718
+ error: "失败",
8291
8719
  stopped: "已中断",
8720
+ technicalDetails: "技术详情",
8292
8721
  args: "原始参数",
8293
8722
  preparingArgs: "目前已收到的参数",
8294
8723
  output: "完整结果内容",
@@ -8309,13 +8738,21 @@ var import_jsx_runtime12 = require("react/jsx-runtime");
8309
8738
  var styles = `
8310
8739
  .dsmm-role-tool{min-width:0;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family);font-size:14px;line-height:22px}
8311
8740
  .dsmm-role-tool .dsmm-role-heading{color:var(--dsw-alias-label-primary);height:auto;min-height:32px}
8312
- .dsmm-role-tool .dsmm-role-title{white-space:normal;overflow-wrap:anywhere;min-width:0;max-width:100%;color:inherit;font-size:inherit;line-height:inherit}
8741
+ .dsmm-role-tool .dsmm-role-title{white-space:normal;overflow-wrap:anywhere;min-width:0;max-width:100%;color:inherit;font-size:inherit;line-height:inherit;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis}
8742
+ .dsmm-role-tool[data-expanded="true"] .dsmm-role-title{display:block;-webkit-line-clamp:unset;overflow:visible}
8313
8743
  .dsmm-role-tool .dsmm-role-text{flex:1;min-width:0}
8314
- .dsmm-role-tool .dsmm-role-body{display:flex;flex-direction:column;gap:12px;min-width:0;padding:8px 0}
8744
+ .dsmm-role-tool .dsmm-role-body{display:flex;flex-direction:column;gap:8px;min-width:0;padding:8px 0}
8315
8745
  .dsmm-role-tool p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
8316
8746
  .dsmm-role-tool .dsmm-role-status{color:var(--dsw-alias-label-secondary)}
8317
8747
  .dsmm-role-tool .dsmm-role-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
8318
- .dsmm-role-tool :is(button,[role=button]):focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
8748
+ .dsmm-role-tool .dsmm-role-identity{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}
8749
+ .dsmm-role-tool .dsmm-role-task{color:var(--dsw-alias-label-primary);font-size:14px;line-height:22px}
8750
+ .dsmm-role-tool .dsmm-role-dim{color:var(--dsw-alias-label-tertiary)}
8751
+ .dsmm-role-tool .dsmm-role-section-title{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px;margin-bottom:4px}
8752
+ .dsmm-role-tool .dsmm-role-details{border-top:1px solid var(--dsw-alias-border-l2);padding-top:8px;margin-top:4px}
8753
+ .dsmm-role-tool .dsmm-role-details summary{cursor:pointer;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px;user-select:none}
8754
+ .dsmm-role-tool .dsmm-role-details-body{display:flex;flex-direction:column;gap:8px;margin-top:8px;padding-left:8px}
8755
+ .dsmm-role-tool :is(button,[role=button],summary):focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
8319
8756
  `;
8320
8757
  function RoleToolView(props) {
8321
8758
  const { expanded, toggle } = props.useDisclosure();
@@ -8327,10 +8764,17 @@ function RoleToolView(props) {
8327
8764
  const failed = result !== void 0 && (result.isError || result.error != null);
8328
8765
  const actual = result === void 0 ? void 0 : actualRoleTool(props.toolName, result.meta, failed);
8329
8766
  const target = actual?.role ?? requested.target;
8330
- const title = `${t("call")} ${target === void 0 ? t("unknownTarget") : roleToolDisplay(target)}${(actual?.level ?? requested.level) === void 0 ? "" : ` · ${actual?.level ?? requested.level}`}`;
8767
+ const action2 = props.phase === "preparing" ? t("calling") : t("call");
8768
+ const targetLabel = target === void 0 ? t("unknownTarget") : roleToolDisplay(target);
8769
+ const rawDesc = requested.description?.trim();
8770
+ const singleLineDesc = rawDesc ? rawDesc.replace(/\s+/gu, " ") : void 0;
8771
+ const title = singleLineDesc ? `${action2} ${targetLabel}: ${singleLineDesc}` : `${action2} ${targetLabel}`;
8331
8772
  const state = result?.error?.code === "interrupted" ? "stopped" : failed ? "error" : result === void 0 ? props.phase === "preparing" ? "preparing" : "running" : actual?.jobId !== void 0 || actual?.mode === "continuable" ? "background" : "result";
8332
8773
  const code = (value) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.CodeBlock, { code: value, copyLabel: t("copy"), copiedLabel: t("copied") });
8333
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-role-tool", "data-dsmm-role-tool": props.toolName, "data-identity": actual === void 0 ? "requested" : "actual", "data-state": state, children: [
8774
+ const roleDiffers = requested.target !== void 0 && actual !== void 0 && actual.role !== requested.target;
8775
+ const levelDiffers = requested.level !== void 0 && actual !== void 0 && actual.level !== requested.level;
8776
+ const showRequestedVsActual = roleDiffers || levelDiffers;
8777
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-role-tool", "data-dsmm-role-tool": props.toolName, "data-identity": actual === void 0 ? "requested" : "actual", "data-state": state, "data-expanded": expanded ? "true" : "false", children: [
8334
8778
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
8335
8779
  import_dsh_client_ui_primitives10.DisclosureRow,
8336
8780
  {
@@ -8344,58 +8788,73 @@ function RoleToolView(props) {
8344
8788
  onToggle: toggle,
8345
8789
  expandOnRowClick: true,
8346
8790
  children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-role-body", children: [
8347
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
8348
- props.toolName,
8349
- " · ",
8350
- props.callId
8351
- ] }),
8352
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsmm-role-status", children: [
8353
- t("requested"),
8354
- " ",
8355
- t(requested.kind),
8356
- ": ",
8357
- requested.target === void 0 ? t("unknown") : roleToolDisplay(requested.target)
8358
- ] }),
8359
- requested.description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-status", children: requested.description }),
8360
- actual !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
8361
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
8362
- t("actual"),
8363
- " ",
8364
- t(requested.kind),
8365
- ": ",
8366
- roleToolDisplay(actual.role),
8367
- " · ",
8368
- t("level"),
8369
- ": ",
8370
- actual.level
8791
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsmm-role-identity", children: [
8792
+ showRequestedVsActual ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
8793
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsmm-role-dim", children: [
8794
+ t("requested"),
8795
+ ": "
8796
+ ] }),
8797
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
8798
+ requested.target === void 0 ? t("unknown") : roleToolDisplay(requested.target),
8799
+ requested.level ? ` (${requested.level})` : ""
8800
+ ] }),
8801
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "dsmm-role-dim", children: " → " }),
8802
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsmm-role-dim", children: [
8803
+ t("actual"),
8804
+ ": "
8805
+ ] }),
8806
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
8807
+ roleToolDisplay(actual.role),
8808
+ " (",
8809
+ actual.level,
8810
+ ")"
8811
+ ] })
8812
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
8813
+ actual !== void 0 ? roleToolDisplay(actual.role) : requested.target === void 0 ? t("unknownTarget") : roleToolDisplay(requested.target),
8814
+ (actual?.level ?? requested.level) !== void 0 && ` · ${actual?.level ?? requested.level}`,
8815
+ result !== void 0 && actual === void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsmm-role-dim", children: [
8816
+ " · ",
8817
+ t("actualUnknown")
8818
+ ] })
8371
8819
  ] }),
8372
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
8373
- t("routeSource"),
8374
- ": ",
8375
- actual.routeSource,
8820
+ actual?.route !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsmm-role-model", children: [
8376
8821
  " · ",
8377
- t("route"),
8378
- ": ",
8379
- actual.route === void 0 ? t("unknown") : `${actual.route.provider}/${actual.route.model}${actual.route.reasoningEffort === void 0 ? "" : ` · ${actual.route.reasoningEffort}`}`
8822
+ actual.route.provider,
8823
+ "/",
8824
+ actual.route.model,
8825
+ actual.route.reasoningEffort ? ` · ${actual.route.reasoningEffort}` : ""
8380
8826
  ] })
8381
8827
  ] }),
8382
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
8383
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t(props.phase === "preparing" ? "preparingArgs" : "args") }),
8384
- raw === "" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("emptyArgs") }) : code(raw)
8828
+ requested.description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-task", children: requested.description }),
8829
+ result?.error != null && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-role-failure", children: [
8830
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-section-title", children: t("failure") }),
8831
+ code(JSON.stringify(result.error, null, 2))
8385
8832
  ] }),
8386
- result !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
8387
- actual === void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("unavailable") }),
8388
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
8389
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("output") }),
8390
- code(JSON.stringify(result.content, null, 2))
8391
- ] }),
8392
- result.error != null && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
8393
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("failure") }),
8394
- code(JSON.stringify(result.error, null, 2))
8395
- ] }),
8396
- result.meta != null && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
8397
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("metadata") }),
8398
- code(JSON.stringify(result.meta, null, 2))
8833
+ result?.content !== void 0 && (result.error == null || result.content.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-role-output", children: [
8834
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-section-title", children: t("output") }),
8835
+ code(JSON.stringify(result.content, null, 2))
8836
+ ] }),
8837
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("details", { className: "dsmm-role-details", children: [
8838
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("summary", { children: t("technicalDetails") }),
8839
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-role-details-body", children: [
8840
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
8841
+ props.toolName,
8842
+ " · ",
8843
+ props.callId
8844
+ ] }),
8845
+ actual?.routeSource !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
8846
+ t("routeSource"),
8847
+ ": ",
8848
+ actual.routeSource
8849
+ ] }),
8850
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
8851
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-section-title", children: t(props.phase === "preparing" ? "preparingArgs" : "args") }),
8852
+ raw === "" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-empty", children: t("emptyArgs") }) : code(raw)
8853
+ ] }),
8854
+ result?.meta != null && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
8855
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-section-title", children: t("metadata") }),
8856
+ code(JSON.stringify(result.meta, null, 2))
8857
+ ] })
8399
8858
  ] })
8400
8859
  ] })
8401
8860
  ] })