@dsmm/dsmm 0.3.14 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -36
- package/docs/agent-presets.md +1 -1
- package/docs/compatibility.md +3 -3
- package/docs/deferred-native-approval-risk.md +1 -1
- package/docs/design.md +1 -1
- package/docs/lsp.md +1 -1
- package/docs/model-routing.md +13 -6
- package/docs/native-permissions.md +1 -1
- package/docs/profiles.md +3 -1
- package/docs/roadmap.md +2 -2
- package/docs/runtime-recovery.md +4 -4
- package/docs/safety-guards.md +1 -1
- package/docs/settings-status.md +4 -2
- package/docs/tui.md +53 -0
- package/dsh-plugin.json +41 -0
- package/lib/client/DeploymentFields.js +3 -1
- package/lib/client/DeploymentPage.js +4 -1
- package/lib/client/EditableChoice.js +5 -2
- package/lib/client/ProfileModelsDialog.d.ts +2 -1
- package/lib/client/ProfileModelsDialog.js +9 -5
- package/lib/client/ProfilesSection.js +1 -1
- package/lib/client/RoleToolView-locales.d.ts +1 -1
- package/lib/client/RoleToolView-locales.js +2 -2
- package/lib/client/SessionProfiles.js +8 -7
- package/lib/client/children-locales.d.ts +1 -1
- package/lib/client/controller.d.ts +13 -1
- package/lib/client/controller.js +114 -20
- package/lib/client/deployment-locales.d.ts +2 -0
- package/lib/client/deployment-locales.js +6 -3
- package/lib/client/deployment-modules.js +1 -1
- package/lib/client/index.js +22 -4
- package/lib/client/locales.d.ts +1 -0
- package/lib/client/locales.js +6 -4
- package/lib/client/session-labels.d.ts +1 -0
- package/lib/client/session-labels.js +3 -0
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +23 -13
- package/lib/client.js +226 -86
- package/lib/commands.d.ts +7 -3
- package/lib/commands.js +20 -11
- package/lib/host-llm.js +6 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -6
- package/lib/model-routing.js +43 -19
- package/lib/profile-diagnostics.js +1 -0
- package/lib/profile-runtime.js +1 -1
- package/lib/request-routing.d.ts +27 -0
- package/lib/request-routing.js +69 -0
- package/lib/role-llm-runtime.js +15 -2
- package/lib/role-routing.d.ts +4 -3
- package/lib/role-routing.js +17 -10
- package/lib/runtime-recovery.js +56 -16
- package/lib/settings.d.ts +3 -0
- package/lib/settings.js +9 -0
- package/lib/state.d.ts +2 -2
- package/lib/state.js +13 -4
- package/lib/status.d.ts +5 -0
- package/lib/status.js +18 -7
- package/lib/tui-actions.d.ts +21 -0
- package/lib/tui-actions.js +301 -0
- package/lib/tui-adapter.d.ts +25 -0
- package/lib/tui-adapter.js +422 -0
- package/lib/tui-types.d.ts +98 -0
- package/lib/tui-types.js +2 -0
- package/package.json +3 -1
package/lib/client.js
CHANGED
|
@@ -2692,6 +2692,7 @@ var roleRouting = { primary: route, fallbackRoutes: [route], strategy: null, rat
|
|
|
2692
2692
|
var configFields = {
|
|
2693
2693
|
permissionControl: schemaFieldShape(permissionControlSchema),
|
|
2694
2694
|
modelParameters: { passthrough: null },
|
|
2695
|
+
rootModelPolicy: null,
|
|
2695
2696
|
locale: null,
|
|
2696
2697
|
modeName: null,
|
|
2697
2698
|
section: null,
|
|
@@ -3550,6 +3551,7 @@ var ProfilesController = class {
|
|
|
3550
3551
|
currentSessionId: null,
|
|
3551
3552
|
sessionViewEpoch: 0,
|
|
3552
3553
|
sessionUnconfirmed: false,
|
|
3554
|
+
sessionReadinessPending: false,
|
|
3553
3555
|
session: null,
|
|
3554
3556
|
sessionChoice: null,
|
|
3555
3557
|
sessionWorkspaces: [],
|
|
@@ -3595,6 +3597,13 @@ var ProfilesController = class {
|
|
|
3595
3597
|
modeRefreshPending = false;
|
|
3596
3598
|
sessionSource = null;
|
|
3597
3599
|
sessionSourceId = null;
|
|
3600
|
+
sessionBinding = null;
|
|
3601
|
+
agentAvailable;
|
|
3602
|
+
availabilityEpoch = 0;
|
|
3603
|
+
availabilityReadSucceeded = false;
|
|
3604
|
+
initialSessionRead = true;
|
|
3605
|
+
sessionReadIssue = null;
|
|
3606
|
+
readinessTimer = null;
|
|
3598
3607
|
stopSessionSource = null;
|
|
3599
3608
|
stopModelEvents = null;
|
|
3600
3609
|
modelInteraction = null;
|
|
@@ -3655,6 +3664,7 @@ var ProfilesController = class {
|
|
|
3655
3664
|
};
|
|
3656
3665
|
numberDrafts = /* @__PURE__ */ new Map();
|
|
3657
3666
|
dispose() {
|
|
3667
|
+
this.endReadiness();
|
|
3658
3668
|
this.releasePreparation();
|
|
3659
3669
|
this.stopWorkspaces?.();
|
|
3660
3670
|
this.releaseComposerBlock();
|
|
@@ -3689,6 +3699,7 @@ var ProfilesController = class {
|
|
|
3689
3699
|
this.connectionBound = true;
|
|
3690
3700
|
this.connectionBaseline = source?.getSnapshot();
|
|
3691
3701
|
const invalidate = () => {
|
|
3702
|
+
this.resetReadiness();
|
|
3692
3703
|
this.releasePreparation();
|
|
3693
3704
|
this.connectionBaseline = source?.getSnapshot();
|
|
3694
3705
|
this.generation += 1;
|
|
@@ -3698,6 +3709,7 @@ var ProfilesController = class {
|
|
|
3698
3709
|
this.publish({
|
|
3699
3710
|
session: null,
|
|
3700
3711
|
sessionBusy: null,
|
|
3712
|
+
sessionIssue: null,
|
|
3701
3713
|
sessionNotice: null,
|
|
3702
3714
|
sessionUnconfirmed: false,
|
|
3703
3715
|
sessionViewEpoch: this.current.sessionViewEpoch + 1,
|
|
@@ -3710,10 +3722,7 @@ var ProfilesController = class {
|
|
|
3710
3722
|
if (replacement || source === null || this.connectionBaseline === void 0) invalidate();
|
|
3711
3723
|
this.stopConnection = source?.subscribe(() => {
|
|
3712
3724
|
invalidate();
|
|
3713
|
-
if (this.connectionCurrent())
|
|
3714
|
-
void this.refresh();
|
|
3715
|
-
void this.refreshSession();
|
|
3716
|
-
}
|
|
3725
|
+
if (this.connectionCurrent()) void this.refresh();
|
|
3717
3726
|
}) ?? null;
|
|
3718
3727
|
}
|
|
3719
3728
|
connectionCurrent() {
|
|
@@ -3933,18 +3942,22 @@ var ProfilesController = class {
|
|
|
3933
3942
|
this.modelSelectionGeneration += 1;
|
|
3934
3943
|
}) ?? null;
|
|
3935
3944
|
}
|
|
3936
|
-
attachSessionSource(sessionId2, source) {
|
|
3937
|
-
if (this.disposed || sessionId2 === this.sessionSourceId && source === this.sessionSource) return;
|
|
3945
|
+
attachSessionSource(sessionId2, source, binding = source) {
|
|
3946
|
+
if (this.disposed || sessionId2 === this.sessionSourceId && source === this.sessionSource && binding === this.sessionBinding) return;
|
|
3947
|
+
this.resetReadiness();
|
|
3938
3948
|
this.stopSessionSource?.();
|
|
3939
3949
|
this.sessionSourceId = sessionId2;
|
|
3940
3950
|
this.sessionSource = source;
|
|
3951
|
+
this.sessionBinding = binding;
|
|
3941
3952
|
let running = source?.getSnapshot().running;
|
|
3942
|
-
const current = () => !this.disposed && sessionId2 !== null && sessionId2 === this.current.currentSessionId && source === this.sessionSource;
|
|
3953
|
+
const current = () => !this.disposed && sessionId2 !== null && sessionId2 === this.current.currentSessionId && source === this.sessionSource && binding === this.sessionBinding;
|
|
3943
3954
|
this.stopSessionSource = source?.subscribe(() => {
|
|
3944
3955
|
if (!current()) return;
|
|
3956
|
+
if (this.connectionCurrent() && this.sessionSourceFailed()) return;
|
|
3945
3957
|
const next = source.getSnapshot().running;
|
|
3946
3958
|
if (next === running) return;
|
|
3947
3959
|
running = next;
|
|
3960
|
+
if (!this.connectionCurrent()) return;
|
|
3948
3961
|
this.modeRefreshPending = true;
|
|
3949
3962
|
this.refreshObservedMode();
|
|
3950
3963
|
}) ?? null;
|
|
@@ -3954,6 +3967,7 @@ var ProfilesController = class {
|
|
|
3954
3967
|
this.publish({
|
|
3955
3968
|
session: null,
|
|
3956
3969
|
sessionBusy: null,
|
|
3970
|
+
sessionIssue: null,
|
|
3957
3971
|
sessionNotice: null,
|
|
3958
3972
|
sessionViewEpoch: this.current.sessionViewEpoch + 1,
|
|
3959
3973
|
sessionUnconfirmed: this.pendingSessionSelections.has(sessionId2)
|
|
@@ -3961,6 +3975,53 @@ var ProfilesController = class {
|
|
|
3961
3975
|
this.refreshObservedMode();
|
|
3962
3976
|
}
|
|
3963
3977
|
}
|
|
3978
|
+
endReadiness() {
|
|
3979
|
+
if (this.readinessTimer !== null) clearTimeout(this.readinessTimer);
|
|
3980
|
+
this.readinessTimer = null;
|
|
3981
|
+
if (this.current.sessionReadinessPending) this.publish({ sessionReadinessPending: false });
|
|
3982
|
+
}
|
|
3983
|
+
resetReadiness() {
|
|
3984
|
+
this.endReadiness();
|
|
3985
|
+
this.agentAvailable = void 0;
|
|
3986
|
+
this.availabilityEpoch += 1;
|
|
3987
|
+
this.availabilityReadSucceeded = false;
|
|
3988
|
+
this.initialSessionRead = true;
|
|
3989
|
+
this.sessionReadIssue = null;
|
|
3990
|
+
}
|
|
3991
|
+
sessionSourceFailed() {
|
|
3992
|
+
const source = this.sessionSource?.getSnapshot();
|
|
3993
|
+
if (source === void 0 || !source.removed && source.openError === null) return false;
|
|
3994
|
+
this.endReadiness();
|
|
3995
|
+
this.initialSessionRead = false;
|
|
3996
|
+
this.availabilityEpoch += 1;
|
|
3997
|
+
this.availabilityReadSucceeded = false;
|
|
3998
|
+
this.sessionGeneration += 1;
|
|
3999
|
+
this.modeRefreshPending = false;
|
|
4000
|
+
const issue = source.removed ? { kind: "domain", code: "disposed", field: "sessionId" } : { kind: "transport", code: source.openError.code };
|
|
4001
|
+
this.sessionReadIssue = issue;
|
|
4002
|
+
const { currentSessionId: id2, session, sessionUnconfirmed } = this.current;
|
|
4003
|
+
this.publish({
|
|
4004
|
+
session: null,
|
|
4005
|
+
sessionBusy: null,
|
|
4006
|
+
sessionIssue: issue,
|
|
4007
|
+
sessionUnconfirmed: sessionUnconfirmed || id2 !== null && this.pendingSessionSelections.has(id2) || session?.refreshRequired === true || session?.selection.refreshRequired === true
|
|
4008
|
+
});
|
|
4009
|
+
return true;
|
|
4010
|
+
}
|
|
4011
|
+
observeSessionAvailability(id2, source, available) {
|
|
4012
|
+
if (this.disposed || !this.connectionCurrent() || id2 !== this.current.currentSessionId || id2 !== this.sessionSourceId || source !== this.sessionSource || this.sessionSourceFailed()) return;
|
|
4013
|
+
const changed = available !== this.agentAvailable;
|
|
4014
|
+
this.agentAvailable = available;
|
|
4015
|
+
if (!available) {
|
|
4016
|
+
this.availabilityEpoch += 1;
|
|
4017
|
+
this.availabilityReadSucceeded = false;
|
|
4018
|
+
return;
|
|
4019
|
+
}
|
|
4020
|
+
if (changed || !this.availabilityReadSucceeded) {
|
|
4021
|
+
this.modeRefreshPending = true;
|
|
4022
|
+
this.refreshObservedMode();
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
3964
4025
|
attachModelEventSource(sessionId2, source) {
|
|
3965
4026
|
if (this.disposed || sessionId2 === this.modelEventsSessionId && source === this.modelEvents) return;
|
|
3966
4027
|
this.modelEventsGeneration += 1;
|
|
@@ -4008,6 +4069,7 @@ var ProfilesController = class {
|
|
|
4008
4069
|
}
|
|
4009
4070
|
setSession(id2) {
|
|
4010
4071
|
if (this.disposed || id2 === this.current.currentSessionId) return;
|
|
4072
|
+
this.resetReadiness();
|
|
4011
4073
|
const task = this.preparation;
|
|
4012
4074
|
const preparationUnconfirmed = task?.id === id2 && this.current.sessionUnconfirmed;
|
|
4013
4075
|
if (task?.id === id2 && task.held !== null && id2 !== null) {
|
|
@@ -4047,16 +4109,46 @@ var ProfilesController = class {
|
|
|
4047
4109
|
return;
|
|
4048
4110
|
}
|
|
4049
4111
|
if (this.disposed || !this.connectionCurrent() || id2 === null || this.current.sessionBusy !== null || this.sessionSourceId === id2 && this.sessionSource === null) return;
|
|
4112
|
+
if (this.sessionSourceFailed()) return;
|
|
4113
|
+
const initial = this.initialSessionRead;
|
|
4114
|
+
const availabilityEpoch = this.availabilityEpoch;
|
|
4115
|
+
this.initialSessionRead = false;
|
|
4050
4116
|
this.modeRefreshPending = false;
|
|
4051
4117
|
const generation = ++this.sessionGeneration;
|
|
4052
4118
|
const live = () => !this.disposed && this.connectionCurrent() && generation === this.sessionGeneration && id2 === this.current.currentSessionId;
|
|
4053
|
-
this.publish({ sessionBusy: "read"
|
|
4119
|
+
this.publish({ sessionBusy: "read" });
|
|
4054
4120
|
try {
|
|
4055
4121
|
const session = await this.unwrap(this.remote.describeSession(id2));
|
|
4056
4122
|
if (session.sessionId !== id2) throw { kind: "assembly", code: "unavailable" };
|
|
4057
|
-
if (live())
|
|
4123
|
+
if (live()) {
|
|
4124
|
+
if (availabilityEpoch === this.availabilityEpoch && this.agentAvailable !== false) this.availabilityReadSucceeded = true;
|
|
4125
|
+
this.endReadiness();
|
|
4126
|
+
this.publish({
|
|
4127
|
+
session,
|
|
4128
|
+
sessionChoice: (session.admittedSelection ?? session.selection).selectedId,
|
|
4129
|
+
sessionUnconfirmed: this.pendingSessionSelections.has(id2),
|
|
4130
|
+
...this.current.sessionIssue === this.sessionReadIssue ? { sessionIssue: null } : {}
|
|
4131
|
+
});
|
|
4132
|
+
this.sessionReadIssue = null;
|
|
4133
|
+
}
|
|
4058
4134
|
} catch (error) {
|
|
4059
|
-
if (live())
|
|
4135
|
+
if (live()) {
|
|
4136
|
+
const issue = this.issue(error);
|
|
4137
|
+
const waiting = (initial || this.current.sessionReadinessPending) && this.sessionSourceId === id2 && this.sessionSource !== null && this.current.session === null && this.sessionSource.getSnapshot().sessionId === id2 && issue.kind === "domain" && issue.code === "unavailable" && issue.field === "sessionId";
|
|
4138
|
+
if (!waiting) this.endReadiness();
|
|
4139
|
+
if (!preserveFeedback || this.current.sessionIssue === null || this.current.sessionIssue === this.sessionReadIssue) this.publish({ sessionIssue: issue });
|
|
4140
|
+
this.sessionReadIssue = issue;
|
|
4141
|
+
if (waiting && this.readinessTimer === null) {
|
|
4142
|
+
const source = this.sessionSource, connection = this.connectionBaseline;
|
|
4143
|
+
const timer = setTimeout(() => {
|
|
4144
|
+
if (this.readinessTimer !== timer || this.disposed || source !== this.sessionSource || id2 !== this.current.currentSessionId || connection !== this.connectionBaseline) return;
|
|
4145
|
+
this.readinessTimer = null;
|
|
4146
|
+
this.publish({ sessionReadinessPending: false });
|
|
4147
|
+
}, 1e4);
|
|
4148
|
+
this.readinessTimer = timer;
|
|
4149
|
+
this.publish({ sessionReadinessPending: true });
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4060
4152
|
} finally {
|
|
4061
4153
|
if (live()) {
|
|
4062
4154
|
this.publish({ sessionBusy: null });
|
|
@@ -4238,10 +4330,11 @@ var ProfilesController = class {
|
|
|
4238
4330
|
}
|
|
4239
4331
|
}
|
|
4240
4332
|
async refresh() {
|
|
4241
|
-
|
|
4333
|
+
const session = this.refreshSession();
|
|
4334
|
+
await Promise.all([session, this.perform("refresh", async (live) => {
|
|
4242
4335
|
const snapshot4 = await this.unwrap(this.remote.describe());
|
|
4243
4336
|
if (live()) this.publish({ snapshot: snapshot4 });
|
|
4244
|
-
});
|
|
4337
|
+
})]);
|
|
4245
4338
|
}
|
|
4246
4339
|
async open(id2) {
|
|
4247
4340
|
if (this.disposed || this.current.busy !== null || this.current.pendingEditor !== null) return;
|
|
@@ -4401,6 +4494,7 @@ var en = {
|
|
|
4401
4494
|
sessionSelectionBlock: "Finish choosing this session's configuration to continue typing.",
|
|
4402
4495
|
sessionCommittedRefresh: "Saved. Refresh to confirm it.",
|
|
4403
4496
|
sessionUnconfirmedRefresh: "The result is unknown. Refresh before choosing or sending again.",
|
|
4497
|
+
sessionWaitingReady: "Waiting for the session to be ready…",
|
|
4404
4498
|
technicalDetails: "Details",
|
|
4405
4499
|
diagnosticJsonc: "Fix the JSONC syntax at the marked location.",
|
|
4406
4500
|
diagnosticDuplicate: "Remove the duplicate field.",
|
|
@@ -4492,14 +4586,14 @@ var en = {
|
|
|
4492
4586
|
viewConfiguration: "View JSONC source",
|
|
4493
4587
|
advancedSettings: "Advanced settings",
|
|
4494
4588
|
gitWriteGuard: "Git write protection",
|
|
4495
|
-
gitWriteScope: "
|
|
4589
|
+
gitWriteScope: "Git write protection scope",
|
|
4496
4590
|
gitWriteScopeDisabledHint: "Protection is off; inspection scope is inactive",
|
|
4497
4591
|
gitWriteGuardHint: "Inspection scope adjusts automatic Git protection only; explicit ask/deny still applies. Turning off does not authorize operations.",
|
|
4498
4592
|
gitWriteAsk: "Ask",
|
|
4499
4593
|
gitWriteDeny: "Deny",
|
|
4500
4594
|
gitWriteOff: "Off",
|
|
4501
|
-
gitWriteAllWrites: "All
|
|
4502
|
-
gitWriteHighRisk: "High-risk
|
|
4595
|
+
gitWriteAllWrites: "All write operations",
|
|
4596
|
+
gitWriteHighRisk: "High-risk write operations only",
|
|
4503
4597
|
topologyPerRole: "One tool per role",
|
|
4504
4598
|
topologyParameterized: "Select role in tool arguments",
|
|
4505
4599
|
roleModels: "Role models and availability",
|
|
@@ -4708,6 +4802,7 @@ var zh = {
|
|
|
4708
4802
|
sessionSelectionBlock: "请先完成本次会话的配置选择,然后即可继续输入。",
|
|
4709
4803
|
sessionCommittedRefresh: "已保存,请刷新确认。",
|
|
4710
4804
|
sessionUnconfirmedRefresh: "结果未知,请刷新后再选择或发送。",
|
|
4805
|
+
sessionWaitingReady: "正在等待会话就绪…",
|
|
4711
4806
|
technicalDetails: "详情",
|
|
4712
4807
|
diagnosticJsonc: "请修正标记位置的 JSONC 语法。",
|
|
4713
4808
|
diagnosticDuplicate: "请删除重复字段。",
|
|
@@ -4799,14 +4894,14 @@ var zh = {
|
|
|
4799
4894
|
viewConfiguration: "查看配置内容",
|
|
4800
4895
|
advancedSettings: "高级设置",
|
|
4801
4896
|
gitWriteGuard: "Git 写入保护",
|
|
4802
|
-
gitWriteScope: "
|
|
4897
|
+
gitWriteScope: "Git 写操作保护范围",
|
|
4803
4898
|
gitWriteScopeDisabledHint: "保护已关闭,检查范围暂不生效",
|
|
4804
4899
|
gitWriteGuardHint: "检查范围只调整自动 Git 保护,显式 ask/deny 仍生效;关闭不代表授权。",
|
|
4805
4900
|
gitWriteAsk: "询问",
|
|
4806
4901
|
gitWriteDeny: "禁止",
|
|
4807
4902
|
gitWriteOff: "关闭",
|
|
4808
|
-
gitWriteAllWrites: "
|
|
4809
|
-
gitWriteHighRisk: "
|
|
4903
|
+
gitWriteAllWrites: "所有写操作",
|
|
4904
|
+
gitWriteHighRisk: "仅高风险写操作",
|
|
4810
4905
|
topologyPerRole: "每个角色独立入口",
|
|
4811
4906
|
topologyParameterized: "统一入口中选择角色",
|
|
4812
4907
|
roleModels: "角色模型与可用性",
|
|
@@ -5069,6 +5164,12 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
|
|
|
5069
5164
|
placeholder,
|
|
5070
5165
|
autoComplete: "off",
|
|
5071
5166
|
onBlur: close,
|
|
5167
|
+
onClick: () => {
|
|
5168
|
+
if (!disabled && choices.length > 0 && !visible) {
|
|
5169
|
+
setOpen(true);
|
|
5170
|
+
setActiveId(null);
|
|
5171
|
+
}
|
|
5172
|
+
},
|
|
5072
5173
|
onChange: (event) => {
|
|
5073
5174
|
onChange(event.currentTarget.value);
|
|
5074
5175
|
setOpen(true);
|
|
@@ -5096,7 +5197,7 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
|
|
|
5096
5197
|
{
|
|
5097
5198
|
type: "button",
|
|
5098
5199
|
size: "sm",
|
|
5099
|
-
variant: "
|
|
5200
|
+
variant: "ghost",
|
|
5100
5201
|
tabIndex: -1,
|
|
5101
5202
|
className: "dsmm-choice-toggle",
|
|
5102
5203
|
"aria-label": label,
|
|
@@ -5391,6 +5492,22 @@ function RoleAvailability({ value, t }) {
|
|
|
5391
5492
|
] });
|
|
5392
5493
|
}
|
|
5393
5494
|
|
|
5495
|
+
// src/client/session-labels.ts
|
|
5496
|
+
function displayRoleLabel(label) {
|
|
5497
|
+
return label.replace(/^DW\s+/u, "");
|
|
5498
|
+
}
|
|
5499
|
+
function sessionProfileLabels(session, t) {
|
|
5500
|
+
const admitted = session.admittedSelection;
|
|
5501
|
+
const profile = admitted === void 0 ? t("sessionGlobalCaptured") : admitted.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: admitted.selectedId, revision: t(configurationVersionState(admitted.sourceRevision)) });
|
|
5502
|
+
const future = session.globalDefault;
|
|
5503
|
+
return {
|
|
5504
|
+
admitted: t("sessionState", { profile, scope: session.scope }),
|
|
5505
|
+
futureDefault: t("sessionFutureDefault", {
|
|
5506
|
+
profile: !future || future.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: future.selectedId, revision: t(configurationVersionState(future.sourceRevision)) })
|
|
5507
|
+
})
|
|
5508
|
+
};
|
|
5509
|
+
}
|
|
5510
|
+
|
|
5394
5511
|
// src/client/ProfileModelsDialog.tsx
|
|
5395
5512
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
5396
5513
|
function locateFieldInsideRole(roleCard, field) {
|
|
@@ -5601,7 +5718,8 @@ function ProfileModelsDialog({
|
|
|
5601
5718
|
if (searchQuery.trim()) {
|
|
5602
5719
|
const q = searchQuery.trim().toLowerCase();
|
|
5603
5720
|
const matchesId = role3.id.toLowerCase().includes(q);
|
|
5604
|
-
const
|
|
5721
|
+
const displayLabel = displayRoleLabel(role3.label);
|
|
5722
|
+
const matchesLabel = role3.label.toLowerCase().includes(q) || displayLabel.toLowerCase().includes(q);
|
|
5605
5723
|
if (!matchesId && !matchesLabel) return false;
|
|
5606
5724
|
}
|
|
5607
5725
|
if (filterExplicitOnly) {
|
|
@@ -5735,6 +5853,7 @@ function ProfileModelsDialog({
|
|
|
5735
5853
|
doc !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-roles-list dsmm-dialog-roles-list", children: [
|
|
5736
5854
|
filteredRoles.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint dsmm-no-roles", children: t("noMatchingRoles") }),
|
|
5737
5855
|
filteredRoles.map((role3) => {
|
|
5856
|
+
const roleName = displayRoleLabel(role3.label);
|
|
5738
5857
|
const policy = doc.roleRouting[role3.id] ?? {};
|
|
5739
5858
|
const rolePath = ["settings", "roleRouting", role3.id];
|
|
5740
5859
|
const isOrchestrator = role3.id === "dsmm-orchestrator";
|
|
@@ -5771,13 +5890,13 @@ function ProfileModelsDialog({
|
|
|
5771
5890
|
children: [
|
|
5772
5891
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-role-main-row", children: [
|
|
5773
5892
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsmm-dialog-role-header", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-role-title-group", children: [
|
|
5774
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-role-title", children:
|
|
5893
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-role-title", children: roleName }),
|
|
5775
5894
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { className: "dsmm-role-id-badge", children: role3.id }),
|
|
5776
5895
|
explicitOverride && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-override-badge", children: t("roleSettingsOverridden") })
|
|
5777
5896
|
] }) }),
|
|
5778
5897
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-role-primary-route", children: [
|
|
5779
5898
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field dsmm-primary-mode-field", children: [
|
|
5780
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-primary-mode`, children: t("primaryMode", { name:
|
|
5899
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-primary-mode`, children: t("primaryMode", { name: roleName }) }),
|
|
5781
5900
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5782
5901
|
"select",
|
|
5783
5902
|
{
|
|
@@ -5801,7 +5920,7 @@ function ProfileModelsDialog({
|
|
|
5801
5920
|
t,
|
|
5802
5921
|
value: policy.primary,
|
|
5803
5922
|
path: [...rolePath, "primary"],
|
|
5804
|
-
name: t("primaryName", { name:
|
|
5923
|
+
name: t("primaryName", { name: roleName }),
|
|
5805
5924
|
catalog: state.catalog,
|
|
5806
5925
|
disabled: effectiveDisabled,
|
|
5807
5926
|
edit: actions3.editPath,
|
|
@@ -5848,7 +5967,7 @@ function ProfileModelsDialog({
|
|
|
5848
5967
|
] }),
|
|
5849
5968
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-details-content", children: [
|
|
5850
5969
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field", children: [
|
|
5851
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-fallback-mode`, children: t("fallbackMode", { name:
|
|
5970
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-fallback-mode`, children: t("fallbackMode", { name: roleName }) }),
|
|
5852
5971
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5853
5972
|
"select",
|
|
5854
5973
|
{
|
|
@@ -5868,7 +5987,7 @@ function ProfileModelsDialog({
|
|
|
5868
5987
|
] }),
|
|
5869
5988
|
policy.fallbackRoutes?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", children: t("emptyChain") }),
|
|
5870
5989
|
policy.fallbackRoutes?.map((candidate, index) => {
|
|
5871
|
-
const name2 = t("fallbackName", { name:
|
|
5990
|
+
const name2 = t("fallbackName", { name: roleName, index: index + 1 });
|
|
5872
5991
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5873
5992
|
"fieldset",
|
|
5874
5993
|
{
|
|
@@ -5959,7 +6078,7 @@ function ProfileModelsDialog({
|
|
|
5959
6078
|
actions3.editPath([...rolePath, "fallbackRoutes", policy.fallbackRoutes.length], { provider: "", model: "" });
|
|
5960
6079
|
}
|
|
5961
6080
|
},
|
|
5962
|
-
children: t("addFallback", { name:
|
|
6081
|
+
children: t("addFallback", { name: roleName })
|
|
5963
6082
|
}
|
|
5964
6083
|
)
|
|
5965
6084
|
] })
|
|
@@ -5975,7 +6094,7 @@ function ProfileModelsDialog({
|
|
|
5975
6094
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-details-content", children: [
|
|
5976
6095
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RoleAvailability, { value: role3.availability, t }),
|
|
5977
6096
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field", children: [
|
|
5978
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-role-enabled`, children: t("namedRole", { name:
|
|
6097
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-role-enabled`, children: t("namedRole", { name: roleName }) }),
|
|
5979
6098
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5980
6099
|
"select",
|
|
5981
6100
|
{
|
|
@@ -6010,7 +6129,7 @@ function ProfileModelsDialog({
|
|
|
6010
6129
|
value: policy,
|
|
6011
6130
|
inherited,
|
|
6012
6131
|
path: rolePath,
|
|
6013
|
-
name:
|
|
6132
|
+
name: roleName,
|
|
6014
6133
|
disabled: effectiveDisabled,
|
|
6015
6134
|
actions: actions3
|
|
6016
6135
|
}
|
|
@@ -6032,21 +6151,6 @@ function ProfileModelsDialog({
|
|
|
6032
6151
|
// src/client/SessionProfiles.tsx
|
|
6033
6152
|
var import_react4 = require("react");
|
|
6034
6153
|
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6035
|
-
|
|
6036
|
-
// src/client/session-labels.ts
|
|
6037
|
-
function sessionProfileLabels(session, t) {
|
|
6038
|
-
const admitted = session.admittedSelection;
|
|
6039
|
-
const profile = admitted === void 0 ? t("sessionGlobalCaptured") : admitted.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: admitted.selectedId, revision: t(configurationVersionState(admitted.sourceRevision)) });
|
|
6040
|
-
const future = session.globalDefault;
|
|
6041
|
-
return {
|
|
6042
|
-
admitted: t("sessionState", { profile, scope: session.scope }),
|
|
6043
|
-
futureDefault: t("sessionFutureDefault", {
|
|
6044
|
-
profile: !future || future.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: future.selectedId, revision: t(configurationVersionState(future.sourceRevision)) })
|
|
6045
|
-
})
|
|
6046
|
-
};
|
|
6047
|
-
}
|
|
6048
|
-
|
|
6049
|
-
// src/client/SessionProfiles.tsx
|
|
6050
6154
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
6051
6155
|
var MENU_ISSUE_CODES = /* @__PURE__ */ new Set(["validation", "conflict", "not-found", "lock-timeout", "unsafe-path", "io", "activation", "corrupt-selection", "limit", "busy", "maintenance", "disposed", "not-owned", "unavailable", "cancelled", "module-off", "runtime-unavailable", "new-session-required", "model-unconfigured", "model-choice-changed", "model-service-unavailable", "model-observation-unavailable", "model-selection-failed"]);
|
|
6052
6156
|
function capabilityReason(reason, t) {
|
|
@@ -6085,7 +6189,8 @@ function SessionScopeFeedback({ state, t }) {
|
|
|
6085
6189
|
state.dirty && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("sessionDirty") }),
|
|
6086
6190
|
(session?.refreshRequired || session?.selection.refreshRequired) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", children: t("sessionCommittedRefresh") }),
|
|
6087
6191
|
state.sessionUnconfirmed && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", children: t(state.sessionIssue?.code === "blank-identity-unconfirmed" ? "sessionPreparationUnknown" : "sessionUnconfirmedRefresh") }),
|
|
6088
|
-
state.
|
|
6192
|
+
state.sessionReadinessPending && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", children: t("sessionWaitingReady") }),
|
|
6193
|
+
state.sessionIssue !== null && !state.sessionReadinessPending && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
6089
6194
|
/* @__PURE__ */ (0, import_jsx_runtime6.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") }),
|
|
6090
6195
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IssueDetails, { issue: state.sessionIssue, t })
|
|
6091
6196
|
] }),
|
|
@@ -6145,7 +6250,7 @@ function SessionScope({ state, actions: actions3, t, compact = false, showFeedba
|
|
|
6145
6250
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
6146
6251
|
labels !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { "data-dsmm-session-state": true, children: labels.admitted }),
|
|
6147
6252
|
labels !== null && !compact && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", "data-dsmm-session-future-default": true, children: labels.futureDefault }),
|
|
6148
|
-
session === null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: t("sessionUnavailable") }),
|
|
6253
|
+
session === null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: t(state.sessionReadinessPending ? "sessionWaitingReady" : "sessionUnavailable") }),
|
|
6149
6254
|
session !== null && !allowed && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: capabilityReason(session.applyOverlayUnavailableReason, t) }),
|
|
6150
6255
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
|
|
6151
6256
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-choice`, children: t("sessionSelect") }),
|
|
@@ -6221,6 +6326,7 @@ function SessionProfiles(props) {
|
|
|
6221
6326
|
let feedback = "";
|
|
6222
6327
|
if (state.sessionUnconfirmed) feedback = t(state.sessionIssue?.code === "blank-identity-unconfirmed" ? "sessionPreparationUnknown" : "sessionUnconfirmedRefresh");
|
|
6223
6328
|
else if (session?.refreshRequired || session?.selection.refreshRequired) feedback = t("sessionCommittedRefresh");
|
|
6329
|
+
else if (state.sessionReadinessPending) feedback = t("sessionWaitingReady");
|
|
6224
6330
|
else if (state.sessionIssue !== null) feedback = t(state.sessionIssue.source === "profile-model" ? state.sessionIssue.code === "model-unconfigured" ? "headerNoProfileModel" : state.sessionIssue.code === "model-choice-changed" ? "headerModelChoiceChanged" : "headerModelUnconfirmed" : state.sessionIssue.code === "conflict" ? "headerConflict" : state.sessionIssue.code === "activation" ? "headerActivationRefused" : state.sessionIssue.code === "maintenance" ? "headerMaintenanceRefused" : state.sessionIssue.code === "busy" ? "headerBusyRefused" : state.sessionIssue.code === "cancelled" ? "headerCancelledRefused" : state.sessionIssue.code === "unavailable" || state.sessionIssue.kind === "assembly" ? "headerUnavailableRefused" : "headerSelectionRefused");
|
|
6225
6331
|
else if (committing || state.busy !== null) feedback = t(state.sessionBusy === "apply" || state.sessionBusy === "reset" ? "headerApplying" : "headerLoading");
|
|
6226
6332
|
else if (state.dirty || state.invalidFields.length > 0 || state.pendingEditor !== null) feedback = t("headerDraft");
|
|
@@ -6228,7 +6334,7 @@ function SessionProfiles(props) {
|
|
|
6228
6334
|
else if (session === null || state.snapshot === null) feedback = t("headerUnavailable");
|
|
6229
6335
|
else if (state.sessionNotice !== null) feedback = t(state.sessionNotice === "mode-on" ? "headerModeOn" : state.sessionNotice === "mode-off" ? "headerModeOff" : state.sessionNotice === "applied-with-model" ? "headerAppliedWithModel" : "headerApplied");
|
|
6230
6336
|
const profileName = unknownCaptured ? t("headerCaptured") : admission !== void 0 && sourceRelationship(admission, currentSaved?.revision) === "current" && currentSaved?.label?.trim() ? currentSaved.label : admission?.selectedId ?? t("sessionBaseline");
|
|
6231
|
-
const currentLabel = t("headerCurrentProfile", { profile: session === null ? t("headerUnavailable") : profileName });
|
|
6337
|
+
const currentLabel = t("headerCurrentProfile", { profile: session === null ? t(state.sessionReadinessPending ? "sessionWaitingReady" : "headerUnavailable") : profileName });
|
|
6232
6338
|
const entries = [{ type: "label", id: "@current", text: currentLabel }];
|
|
6233
6339
|
for (const warning of profileWarnings(session?.warnings)) entries.push({ type: "label", id: `@warning:${warning.code}`, text: t("warningMarker", { code: warning.code, field: warning.field }) });
|
|
6234
6340
|
if ((id2 === null || session?.canApplyOverlay === true) && state.snapshot !== null) entries.push({ type: "label", id: "@future", text: t("sessionFutureDefault", { profile: state.snapshot.profiles.find((profile) => profile.id === state.snapshot.selectedId)?.label?.trim() || state.snapshot.selectedId || t("sessionBaseline") }) });
|
|
@@ -6240,7 +6346,7 @@ function SessionProfiles(props) {
|
|
|
6240
6346
|
disabled: unavailable || session?.canToggleMode !== true || mode === void 0 || mode.locked
|
|
6241
6347
|
});
|
|
6242
6348
|
if (session !== null && session.canToggleMode !== true) entries.push({ type: "label", id: "@mode-reason", text: capabilityReason(session.toggleModeUnavailableReason, t) });
|
|
6243
|
-
const diagnostic2 = state.sessionIssue === null ? null : menuIssue(state.sessionIssue);
|
|
6349
|
+
const diagnostic2 = state.sessionIssue === null || state.sessionReadinessPending ? null : menuIssue(state.sessionIssue);
|
|
6244
6350
|
const diagnosticText = diagnostic2 === null ? "" : t("headerIssueCode", { code: diagnostic2.code }) + (diagnostic2.field === void 0 ? "" : ` ${t("headerIssueField", { field: diagnostic2.field })}`);
|
|
6245
6351
|
const retryHint = t(state.sessionUnconfirmed ? "sessionUnconfirmedRefresh" : diagnostic2?.code === "maintenance" || diagnostic2?.code === "busy" ? "headerWaitRetryHint" : "headerRetryHint");
|
|
6246
6352
|
if (diagnostic2 !== null) entries.push({ type: "label", id: "@diagnostic", text: diagnosticText }, { type: "label", id: "@retry", text: retryHint });
|
|
@@ -6277,10 +6383,7 @@ function SessionProfiles(props) {
|
|
|
6277
6383
|
if (live.currentSessionId !== id2 || live.sessionViewEpoch !== state.sessionViewEpoch || live.session !== session) return;
|
|
6278
6384
|
if (value === "@refresh") {
|
|
6279
6385
|
if (committing || state.busy !== null) return;
|
|
6280
|
-
void (
|
|
6281
|
-
await props.refresh();
|
|
6282
|
-
if (props.readProfileView().currentSessionId === id2 && props.readProfileView().sessionViewEpoch === state.sessionViewEpoch) await props.refreshSession();
|
|
6283
|
-
})();
|
|
6386
|
+
void props.refresh();
|
|
6284
6387
|
} else {
|
|
6285
6388
|
const row = entries.find((entry) => entry.id === value && !("type" in entry));
|
|
6286
6389
|
if (row === void 0 || !("disabled" in row) || row.disabled) return;
|
|
@@ -6301,7 +6404,7 @@ function SessionProfiles(props) {
|
|
|
6301
6404
|
}
|
|
6302
6405
|
}
|
|
6303
6406
|
),
|
|
6304
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "dsmm-profile-announcement", id: `${prefix}-feedback`, role: state.sessionIssue === null ? "status" : "alert", "aria-live": "polite", "aria-atomic": "true", children: [
|
|
6407
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "dsmm-profile-announcement", id: `${prefix}-feedback`, role: state.sessionIssue === null || state.sessionReadinessPending ? "status" : "alert", "aria-live": "polite", "aria-atomic": "true", children: [
|
|
6305
6408
|
feedback || currentLabel,
|
|
6306
6409
|
diagnostic2 === null ? "" : ` ${diagnosticText} ${retryHint}`
|
|
6307
6410
|
] })
|
|
@@ -6567,7 +6670,7 @@ function ProfilesSection(props) {
|
|
|
6567
6670
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
6568
6671
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "dsmm-summary-label", children: t("currentSessionSummary") }),
|
|
6569
6672
|
" ",
|
|
6570
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "dsmm-summary-val", children: state.session === null ? t("sessionUnavailable") : sessionProfileLabels(state.session, t).admitted })
|
|
6673
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "dsmm-summary-val", children: state.session === null ? t(state.sessionReadinessPending ? "sessionWaitingReady" : "sessionUnavailable") : sessionProfileLabels(state.session, t).admitted })
|
|
6571
6674
|
] }),
|
|
6572
6675
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
|
|
6573
6676
|
if (moreActionsRef.current !== null) {
|
|
@@ -7025,7 +7128,10 @@ var PROFILE_STYLES = `
|
|
|
7025
7128
|
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-input input{width:100%;min-width:0;font:inherit;color:inherit}
|
|
7026
7129
|
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice{position:relative;min-width:0}
|
|
7027
7130
|
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-input input{padding-right:32px}
|
|
7028
|
-
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:
|
|
7131
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:24px;height:24px;min-height:24px;padding:0;border:none;border-radius:var(--dsw-radius-xs,4px);background:transparent;color:var(--dsw-alias-label-secondary)}
|
|
7132
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
|
|
7133
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}
|
|
7134
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle:disabled{background:transparent;color:var(--dsw-alias-label-tertiary);opacity:0.4;cursor:not-allowed}
|
|
7029
7135
|
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice-list{position:absolute;z-index:1;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;list-style:none;margin:4px 0 0;padding:4px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}
|
|
7030
7136
|
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice-list [role=option]{padding:8px 10px;min-width:0;overflow-wrap:anywhere;cursor:pointer}
|
|
7031
7137
|
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice-list [role=option]:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
@@ -7044,6 +7150,7 @@ var PROFILE_STYLES = `
|
|
|
7044
7150
|
.dsmm-profiles .dsmm-issue{padding:12px;border-left:4px solid var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}
|
|
7045
7151
|
.dsmm-profiles .dsmm-issue p+p{margin-top:8px}
|
|
7046
7152
|
.dsmm-profiles .dsmm-status{min-height:22px}
|
|
7153
|
+
.dsmm-profiles .dsmm-status:empty{min-height:0;display:none}
|
|
7047
7154
|
.dsmm-profiles .dsmm-zone{min-width:0;display:flex;flex-direction:column;gap:12px;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l4)}
|
|
7048
7155
|
.dsmm-profiles .dsmm-profile-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:12px;min-width:0}
|
|
7049
7156
|
.dsmm-profiles .dsmm-profile-list li{min-width:0;display:flex;flex-direction:column;gap:4px}
|
|
@@ -7058,8 +7165,8 @@ var PROFILE_STYLES = `
|
|
|
7058
7165
|
.dsmm-panel-heading{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center;min-width:0}
|
|
7059
7166
|
.dsmm-panel-heading h2:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
|
|
7060
7167
|
.dsmm-rules-transaction{padding-top:16px}
|
|
7061
|
-
.dsmm-scope-save{position:sticky;top:0;z-index:4;display:flex;flex-direction:column;gap:8px;padding:8px 0
|
|
7062
|
-
.dsmm-rules-save-bar{position:sticky;top:var(--dsmm-scope-save-offset,0px);z-index:3;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;background:var(--dsw-alias-bg-
|
|
7168
|
+
.dsmm-scope-save{position:sticky;top:0;z-index:4;display:flex;flex-direction:column;gap:8px;padding:8px 0;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1));border-bottom:1px solid var(--dsw-alias-border-l4);margin-bottom:8px}
|
|
7169
|
+
.dsmm-rules-save-bar{position:sticky;top:var(--dsmm-scope-save-offset,0px);z-index:3;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1));border-bottom:1px solid var(--dsw-alias-border-l4);margin-bottom:8px}
|
|
7063
7170
|
.dsmm-deployment .dsmm-deployment-group{border-top:1px solid var(--dsw-alias-border-l4);padding-top:8px;min-width:0}
|
|
7064
7171
|
.dsmm-deployment .dsmm-deployment-group>div{display:flex;flex-direction:column;gap:8px;padding-top:8px}
|
|
7065
7172
|
.dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row{display:flex;align-items:center;gap:8px;list-style:none}
|
|
@@ -7106,7 +7213,7 @@ var PROFILE_STYLES = `
|
|
|
7106
7213
|
.dsmm-named-profiles .dsmm-advanced-settings>summary{font-weight:500}
|
|
7107
7214
|
.dsmm-named-profiles .dsmm-advanced-settings>div{margin-top:12px;display:flex;flex-direction:column;gap:12px}
|
|
7108
7215
|
.dsmm-named-profiles .dsmm-save-bar{position:sticky;top:0;z-index:5;display:flex;flex-direction:column;gap:8px;padding:8px 0 12px;background:var(--dsw-alias-bg-module-platform);border-bottom:1px solid var(--dsw-alias-border-l4);margin-bottom:4px}
|
|
7109
|
-
.dsmm-dialog-top-bar{position:sticky;top:0;z-index:10;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 0
|
|
7216
|
+
.dsmm-dialog-top-bar{position:sticky;top:0;z-index:10;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1));border-bottom:1px solid var(--dsw-alias-border-l4);flex-shrink:0}
|
|
7110
7217
|
.dsmm-profiles :is(.dsmm-field, fieldset, details, .dsmm-zone, input, select, textarea){scroll-margin-top:calc(var(--dsmm-save-bar-offset, 48px) + 12px)}
|
|
7111
7218
|
.dsmm-profile-models-dialog :is(.dsmm-field, .dsmm-dialog-role-card, fieldset, details, .dsmm-zone, input, select, textarea){scroll-margin-top:calc(var(--dsmm-dialog-bar-offset, 48px) + 12px)}
|
|
7112
7219
|
.dsmm-deployment :is(.dsmm-field, fieldset, details, .dsmm-zone, input, select, textarea){scroll-margin-top:calc(var(--dsmm-scope-save-offset, 48px) + 12px)}
|
|
@@ -7121,35 +7228,40 @@ var PROFILE_STYLES = `
|
|
|
7121
7228
|
.dsmm-profile-models-dialog{width:min(1040px, calc(100vw - 32px))!important;max-width:1040px!important;max-height:calc(100vh - 48px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;box-sizing:border-box;font-family:var(--dsw-font-family);font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}
|
|
7122
7229
|
.dsmm-profile-models-dialog-content,
|
|
7123
7230
|
.dsmm-models-dialog-content,
|
|
7124
|
-
.dsmm-profile-models-dialog .dsmm-profile-models-dialog-content{overflow-y:auto!important;overflow-x:hidden;display:flex;flex-direction:column;gap:
|
|
7231
|
+
.dsmm-profile-models-dialog .dsmm-profile-models-dialog-content{overflow-y:auto!important;overflow-x:hidden;display:flex;flex-direction:column;gap:8px;padding:0 0 16px;min-height:0;flex:1 1 auto}
|
|
7232
|
+
.dsmm-profile-models-dialog-content > :last-child{margin-top:0}
|
|
7125
7233
|
.dsmm-models-filter-bar,
|
|
7126
7234
|
.dsmm-dialog-filter-bar,
|
|
7127
|
-
.dsmm-profile-models-dialog .dsmm-filter-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding
|
|
7235
|
+
.dsmm-profile-models-dialog .dsmm-filter-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:4px 0 8px;border-bottom:1px solid var(--dsw-alias-border-l4);flex-shrink:0}
|
|
7128
7236
|
.dsmm-models-filter-bar .dsmm-search-input,
|
|
7129
7237
|
.dsmm-filter-search{flex:1 1 240px;min-width:0}
|
|
7238
|
+
.dsmm-filter-search .dsmm-input{height:32px}
|
|
7130
7239
|
.dsmm-filter-label,
|
|
7131
|
-
.dsmm-filter-override-toggle{display:inline-flex;align-items:center;gap:
|
|
7240
|
+
.dsmm-filter-override-toggle{display:inline-flex;align-items:center;gap:8px;height:32px;min-height:32px;cursor:pointer;font-size:13px;line-height:22px;user-select:none;color:var(--dsw-alias-label-primary)}
|
|
7241
|
+
.dsmm-filter-override-toggle input[type=checkbox]{margin:0;width:16px;height:16px;accent-color:var(--dsw-alias-state-business-primary);flex-shrink:0}
|
|
7132
7242
|
.dsmm-dialog-issue{margin-bottom:8px;padding:8px 12px;border:1px solid var(--dsw-alias-state-error-primary);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform);display:flex;flex-direction:column;gap:6px}
|
|
7133
7243
|
.dsmm-dialog-issue-title{font-weight:600;color:var(--dsw-alias-state-error-primary);margin:0}
|
|
7134
7244
|
.dsmm-dialog-issue-action{display:flex;justify-content:flex-end;margin-top:4px}
|
|
7135
7245
|
.dsmm-profile-models-dialog .dsmm-roles-list,
|
|
7136
7246
|
.dsmm-profile-models-dialog .dsmm-dialog-roles-list{display:flex;flex-direction:column;gap:8px;min-width:0}
|
|
7137
7247
|
.dsmm-profile-models-dialog .dsmm-dialog-role-card{display:flex;flex-direction:column;gap:6px;padding:8px 12px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform);min-width:0}
|
|
7138
|
-
.dsmm-profile-models-dialog .dsmm-role-main-row{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:
|
|
7139
|
-
.dsmm-profile-models-dialog .dsmm-dialog-role-header{display:flex;align-items:center;min-width:
|
|
7248
|
+
.dsmm-profile-models-dialog .dsmm-role-main-row{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-start;gap:8px 16px;min-width:0}
|
|
7249
|
+
.dsmm-profile-models-dialog .dsmm-dialog-role-header{display:flex;align-items:center;min-width:180px;width:200px;flex:0 0 200px;margin-bottom:6px}
|
|
7140
7250
|
.dsmm-profile-models-dialog .dsmm-role-title-group{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}
|
|
7141
7251
|
.dsmm-profile-models-dialog .dsmm-role-title{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
7142
7252
|
.dsmm-profile-models-dialog .dsmm-role-id-badge{font-family:var(--ds-font-family-code);font-size:11px;padding:1px 4px;border-radius:var(--dsw-radius-xs,2px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);white-space:nowrap}
|
|
7143
7253
|
.dsmm-profile-models-dialog .dsmm-override-badge{font-size:11px;padding:1px 6px;border-radius:var(--dsw-radius-md);background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-state-business-primary);border:1px solid var(--dsw-alias-state-business-primary);white-space:nowrap}
|
|
7144
|
-
.dsmm-profile-models-dialog .dsmm-role-primary-route{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 12px;flex:1 1 auto;justify-content:flex-
|
|
7145
|
-
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field{flex:0 0 auto;min-width:110px}
|
|
7254
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 12px;flex:1 1 auto;justify-content:flex-start;min-width:0}
|
|
7255
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field{flex:0 0 auto;min-width:110px;gap:2px}
|
|
7256
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field label{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary);margin:0;white-space:nowrap}
|
|
7146
7257
|
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field select{width:auto;min-width:110px;height:32px}
|
|
7147
7258
|
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields{display:flex;flex-wrap:nowrap;align-items:flex-end;gap:8px;flex:0 1 auto;min-width:0}
|
|
7148
7259
|
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields>.dsmm-field{flex:0 1 auto;min-width:100px;max-width:200px;gap:2px}
|
|
7260
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields>.dsmm-field label{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary);margin:0;white-space:nowrap}
|
|
7149
7261
|
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields select{width:100%;height:32px}
|
|
7150
7262
|
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields .dsmm-input{height:32px}
|
|
7151
|
-
.dsmm-profile-models-dialog .dsmm-route-inherited-hint{font-size:12px;color:var(--dsw-alias-label-secondary);
|
|
7152
|
-
.dsmm-profile-models-dialog .dsmm-orchestrator-tag{font-size:12px;color:var(--dsw-alias-label-secondary);
|
|
7263
|
+
.dsmm-profile-models-dialog .dsmm-route-inherited-hint{font-size:12px;color:var(--dsw-alias-label-secondary);height:32px;display:inline-flex;align-items:center;line-height:20px}
|
|
7264
|
+
.dsmm-profile-models-dialog .dsmm-orchestrator-tag{font-size:12px;color:var(--dsw-alias-label-secondary);height:32px;display:inline-flex;align-items:center;line-height:20px}
|
|
7153
7265
|
.dsmm-profile-models-dialog .dsmm-role-details-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;min-width:0;padding-top:4px;border-top:1px dashed var(--dsw-alias-border-l4)}
|
|
7154
7266
|
.dsmm-profile-models-dialog .dsmm-compact-details{display:inline-block;min-width:0}
|
|
7155
7267
|
.dsmm-profile-models-dialog .dsmm-compact-details[open]{flex:1 1 100%;width:100%}
|
|
@@ -7165,6 +7277,7 @@ var PROFILE_STYLES = `
|
|
|
7165
7277
|
.dsmm-profile-models-dialog{width:calc(100vw - 16px)!important;max-height:calc(100vh - 16px)}
|
|
7166
7278
|
.dsmm-profile-models-dialog .dsmm-dialog-role-card{padding:10px}
|
|
7167
7279
|
.dsmm-profile-models-dialog .dsmm-role-main-row{flex-direction:column;align-items:stretch;gap:8px}
|
|
7280
|
+
.dsmm-profile-models-dialog .dsmm-dialog-role-header{width:100%;min-width:0;flex:0 0 auto;margin-bottom:0}
|
|
7168
7281
|
.dsmm-profile-models-dialog .dsmm-role-primary-route{flex-direction:column;align-items:stretch;gap:8px}
|
|
7169
7282
|
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields{flex-wrap:wrap}
|
|
7170
7283
|
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields>.dsmm-field{flex:1 1 100%;max-width:100%}
|
|
@@ -7518,7 +7631,7 @@ var moduleTitle = (module2) => `module:${module2}`;
|
|
|
7518
7631
|
function moduleFor(path) {
|
|
7519
7632
|
const key = path.split(".")[0];
|
|
7520
7633
|
if (["defaultActive", "modules", "modelParameters", "runtime"].includes(key)) return "run";
|
|
7521
|
-
if (["roleRouting", "runtimePolicy", "runtimeRecovery"].includes(key)) return "routes";
|
|
7634
|
+
if (["rootModelPolicy", "roleRouting", "runtimePolicy", "runtimeRecovery"].includes(key)) return "routes";
|
|
7522
7635
|
if (["workflow", "roles", "skills", "presets", "businessLocale", "locale", "promptOrder", "subagents"].includes(key)) return "workflow";
|
|
7523
7636
|
if (["permissionControl", "guards"].includes(key)) return "permissions";
|
|
7524
7637
|
return "other";
|
|
@@ -7699,7 +7812,7 @@ var DEPLOYMENT_NS = "plugins.dsmm";
|
|
|
7699
7812
|
var deploymentEn = {
|
|
7700
7813
|
title: "DSMM",
|
|
7701
7814
|
summary: "Global config and profile overrides",
|
|
7702
|
-
description: "Layers save independently;
|
|
7815
|
+
description: "Layers save independently; running sessions retain their admitted settings.",
|
|
7703
7816
|
global: "DSMM Global config",
|
|
7704
7817
|
globalHint: "Shared by this Home. Unset fields use built-in defaults.",
|
|
7705
7818
|
profile: "Current DSH profile overrides",
|
|
@@ -7741,6 +7854,8 @@ var deploymentEn = {
|
|
|
7741
7854
|
unitChars: "characters",
|
|
7742
7855
|
useDefaults: "Use defaults",
|
|
7743
7856
|
restoreInheritance: "Restore inheritance",
|
|
7857
|
+
gitWriteAllWrites: "All write operations",
|
|
7858
|
+
gitWriteHighRisk: "High-risk write operations only",
|
|
7744
7859
|
nativeRuntimeState: "Observed native runtime",
|
|
7745
7860
|
nativeRuntimeBinding: "Observed runtime composition",
|
|
7746
7861
|
nativeRuntimeFence: "Execution admission ready",
|
|
@@ -7802,7 +7917,7 @@ var deploymentEn = {
|
|
|
7802
7917
|
var deploymentZh = {
|
|
7803
7918
|
title: "DSMM",
|
|
7804
7919
|
summary: "全局配置与当前配置覆盖",
|
|
7805
|
-
description: "
|
|
7920
|
+
description: "两层独立保存,运行中会话保留已准入设置。",
|
|
7806
7921
|
global: "DSMM 全局配置",
|
|
7807
7922
|
globalHint: "同一 Home 共用;未设置字段使用内建默认值。",
|
|
7808
7923
|
profile: "当前 DSH 配置覆盖",
|
|
@@ -7844,6 +7959,8 @@ var deploymentZh = {
|
|
|
7844
7959
|
unitChars: "字符",
|
|
7845
7960
|
useDefaults: "使用默认值",
|
|
7846
7961
|
restoreInheritance: "恢复继承",
|
|
7962
|
+
gitWriteAllWrites: "所有写操作",
|
|
7963
|
+
gitWriteHighRisk: "仅高风险写操作",
|
|
7847
7964
|
nativeRuntimeState: "已观测原生运行时",
|
|
7848
7965
|
nativeRuntimeBinding: "已观测运行时组合",
|
|
7849
7966
|
nativeRuntimeFence: "执行准入已就绪",
|
|
@@ -7903,6 +8020,7 @@ var deploymentZh = {
|
|
|
7903
8020
|
namedIndependent: "设置中的 Deepwork Profiles 是独立的具名 JSONC 运行时资源编辑器。在此保存不会应用具名配置或选择其模型。"
|
|
7904
8021
|
};
|
|
7905
8022
|
var deploymentFieldLabels = {
|
|
8023
|
+
rootModelPolicy: ["Root model policy (native: user model; configured: admitted routes, all clients)", "根模型策略(native:用户模型;configured:准入路由,所有客户端)"],
|
|
7906
8024
|
modelParameters: ["Model parameters", "模型参数"],
|
|
7907
8025
|
passthrough: ["Model parameter passthrough", "模型参数透传"],
|
|
7908
8026
|
locale: ["Agent business language", "Agent 业务语言"],
|
|
@@ -7927,7 +8045,7 @@ var deploymentFieldLabels = {
|
|
|
7927
8045
|
scope: ["Guard scope", "保护范围"],
|
|
7928
8046
|
shellCommandSafety: ["Shell command safety", "Shell 命令安全"],
|
|
7929
8047
|
gitWriteGuard: ["Git write policy", "Git 写入策略"],
|
|
7930
|
-
gitWriteScope: ["
|
|
8048
|
+
gitWriteScope: ["Git write protection scope", "Git 写操作保护范围"],
|
|
7931
8049
|
toolOutputTruncation: ["Tool output truncation", "工具输出截断"],
|
|
7932
8050
|
maxInlineBytes: ["Inline byte limit", "内联字节上限"],
|
|
7933
8051
|
planFormatValidation: ["Plan format validation", "计划格式校验"],
|
|
@@ -8738,6 +8856,7 @@ function Field({ schema, path, controller, initiallyOpen = false, disclosures, t
|
|
|
8738
8856
|
};
|
|
8739
8857
|
const explicit = at(state.draft, path), inherited = controller.layer === "global" ? at(snapshot4.defaults, path) : at(mergeLayer(mergeLayer(snapshot4.defaults, snapshot4.global), snapshot4.nativeForm?.base ?? {}), path);
|
|
8740
8858
|
const choices = enumValues(schema), disabled = !controller.canEdit();
|
|
8859
|
+
const choiceLabel = (value) => name2 === "guards.gitWriteScope" && (value === "all-writes" || value === "high-risk") ? t(value === "all-writes" ? "gitWriteAllWrites" : "gitWriteHighRisk") : displayValue(value, t);
|
|
8741
8860
|
if (name2 === "permissionControl.nativeCommands.entries") return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { "data-field": name2, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NativeCommandEntries, { controller, value: explicit, inherited: inherited ?? [], disabled, onChange: (value) => controller.edit(path, value), setInvalid: (key, bad) => controller.setInvalid(key, bad), t: permissionText(t) }) });
|
|
8742
8861
|
if (name2 === "permissionControl.rules") return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { "data-field": name2, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PermissionRuleEntries, { controller, value: explicit, inherited: inherited ?? [], disabled, onChange: (value) => controller.edit(path, value), expanded: open, onExpandedChange: expand, t: permissionText(t) }) });
|
|
8743
8862
|
if (schema.type === "object" && schema.fields !== void 0 && path[0] !== "roleRouting") return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsmm-deployment-group", "data-field": name2, open, onToggle: (event) => expand(event.currentTarget.open), children: [
|
|
@@ -8755,8 +8874,8 @@ function Field({ schema, path, controller, initiallyOpen = false, disclosures, t
|
|
|
8755
8874
|
schema.type === "boolean" || choices !== null ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
8756
8875
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: id2, children: fieldLabel(path, t) }),
|
|
8757
8876
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { id: id2, disabled, value: explicit === void 0 ? "inherit" : JSON.stringify(explicit), onChange: (event) => controller.edit(path, event.currentTarget.value === "inherit" ? void 0 : JSON.parse(event.currentTarget.value)), children: [
|
|
8758
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "inherit", children: `${unsetLabel} · ${
|
|
8759
|
-
(choices ?? [true, false]).map((choice2) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: JSON.stringify(choice2), children:
|
|
8877
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "inherit", children: `${unsetLabel} · ${choiceLabel(inherited)}` }),
|
|
8878
|
+
(choices ?? [true, false]).map((choice2) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: JSON.stringify(choice2), children: choiceLabel(choice2) }, String(choice2)))
|
|
8760
8879
|
] })
|
|
8761
8880
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScalarField, { schema, path, controller, inherited, t }),
|
|
8762
8881
|
name2 === "modelParameters.passthrough" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("modelParametersHint") }),
|
|
@@ -9403,21 +9522,22 @@ function ScopeSave({ controller, workspace, refreshOnly = false, t }) {
|
|
|
9403
9522
|
}
|
|
9404
9523
|
};
|
|
9405
9524
|
}, []);
|
|
9525
|
+
const status = refreshOnly ? state.busy ? t("loading") : "" : state.busy ? t("saving") : state.refreshRequired ? t("savedRefreshRequired") : state.saved ? t("saved") : state.dirty ? t("dirty") : "";
|
|
9406
9526
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { ref, className: "dsmm-scope-save", "aria-label": t("saveScope"), children: [
|
|
9407
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.
|
|
9408
|
-
|
|
9527
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-actions", children: [
|
|
9528
|
+
!refreshOnly && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "primary", disabled: !controller.canSave(), onClick: () => void (workspace?.save() ?? controller.save()), children: t(controller.layer === "global" ? "saveGlobal" : "saveProfile") }),
|
|
9529
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void controller.refresh(), children: t("refresh") }),
|
|
9530
|
+
!refreshOnly && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "outline", disabled: state.busy || !state.dirty && state.issue === null && !state.refreshRequired, onClick: () => void controller.refresh(true), children: t("discard") }),
|
|
9531
|
+
status !== "" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: status })
|
|
9532
|
+
] }),
|
|
9533
|
+
!refreshOnly && pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsmm-hint", children: [
|
|
9409
9534
|
t("pendingModules"),
|
|
9410
9535
|
": ",
|
|
9411
9536
|
pending.map((module2) => t(moduleTitle(module2))).join(" · ")
|
|
9412
9537
|
] }),
|
|
9413
9538
|
state.issue !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-issue", role: "alert", children: t(state.issue) }),
|
|
9414
9539
|
!refreshOnly && state.invalidFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-issue", role: "alert", children: t("invalid") }),
|
|
9415
|
-
controller.layer === "profile" && !controller.canWriteProfile() && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t("unavailableForm") })
|
|
9416
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-actions", children: [
|
|
9417
|
-
!refreshOnly && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "primary", disabled: !controller.canSave(), onClick: () => void (workspace?.save() ?? controller.save()), children: t(controller.layer === "global" ? "saveGlobal" : "saveProfile") }),
|
|
9418
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void controller.refresh(), children: t("refresh") }),
|
|
9419
|
-
!refreshOnly && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "outline", disabled: state.busy || !state.dirty && state.issue === null && !state.refreshRequired, onClick: () => void controller.refresh(true), children: t("discard") })
|
|
9420
|
-
] })
|
|
9540
|
+
controller.layer === "profile" && !controller.canWriteProfile() && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t("unavailableForm") })
|
|
9421
9541
|
] });
|
|
9422
9542
|
}
|
|
9423
9543
|
function NativeRuntimeState({ value, t }) {
|
|
@@ -10004,7 +10124,7 @@ var roleToolEn = {
|
|
|
10004
10124
|
output: "Complete result content",
|
|
10005
10125
|
failure: "Error details",
|
|
10006
10126
|
metadata: "Invocation metadata",
|
|
10007
|
-
inspect: "
|
|
10127
|
+
inspect: "View call details",
|
|
10008
10128
|
copy: "Copy",
|
|
10009
10129
|
copied: "Copied",
|
|
10010
10130
|
emptyArgs: "Arguments not available yet",
|
|
@@ -10040,7 +10160,7 @@ var roleToolZh = {
|
|
|
10040
10160
|
output: "完整结果内容",
|
|
10041
10161
|
failure: "错误详情",
|
|
10042
10162
|
metadata: "调用元数据",
|
|
10043
|
-
inspect: "
|
|
10163
|
+
inspect: "查看调用详情",
|
|
10044
10164
|
copy: "复制",
|
|
10045
10165
|
copied: "已复制",
|
|
10046
10166
|
emptyArgs: "参数尚不可用",
|
|
@@ -10923,7 +11043,6 @@ async function apply(ctx) {
|
|
|
10923
11043
|
void profileCtx.inject(["connection"], (connectionCtx) => {
|
|
10924
11044
|
controller.bindConnection(connectionCtx.connection.generation);
|
|
10925
11045
|
void controller.refresh();
|
|
10926
|
-
void controller.refreshSession();
|
|
10927
11046
|
connectionCtx.effect(() => () => controller.bindConnection(null), "dsmm: profile connection withdrawal");
|
|
10928
11047
|
});
|
|
10929
11048
|
profiles = controller;
|
|
@@ -10974,19 +11093,40 @@ async function apply(ctx) {
|
|
|
10974
11093
|
controller.attachCatalog(null);
|
|
10975
11094
|
}, "dsmm: native catalog/selector lifetime");
|
|
10976
11095
|
});
|
|
10977
|
-
void profileCtx.inject(["uiSession", "sessions"], (sessionCtx) => {
|
|
11096
|
+
void profileCtx.inject(["uiSession", "sessions", "connection"], (sessionCtx) => {
|
|
10978
11097
|
const source = sessionCtx.uiSession.adapter.current;
|
|
10979
11098
|
const nativeSessions = sessionCtx.sessions;
|
|
11099
|
+
const connection = sessionCtx.connection.generation;
|
|
11100
|
+
let attached;
|
|
11101
|
+
sessionCtx.effect(() => {
|
|
11102
|
+
let stopReady;
|
|
11103
|
+
const subscribe = () => {
|
|
11104
|
+
stopReady?.();
|
|
11105
|
+
const generation = connection.getSnapshot();
|
|
11106
|
+
stopReady = generation === void 0 ? void 0 : sessionCtx.remote.$on("api-session/added", (summary) => {
|
|
11107
|
+
const binding = source.getSnapshot();
|
|
11108
|
+
if (connection.getSnapshot() !== generation || binding.key !== summary.sessionId || attached === void 0 || nativeSessions.binding(summary.sessionId) !== attached) return;
|
|
11109
|
+
controller.observeSessionAvailability(summary.sessionId, attached.session, summary.agentAvailable);
|
|
11110
|
+
});
|
|
11111
|
+
};
|
|
11112
|
+
subscribe();
|
|
11113
|
+
const stopConnection = connection.subscribe(subscribe);
|
|
11114
|
+
return () => {
|
|
11115
|
+
stopConnection();
|
|
11116
|
+
stopReady?.();
|
|
11117
|
+
};
|
|
11118
|
+
}, "dsmm: native Agent readiness");
|
|
10980
11119
|
const update = () => {
|
|
10981
11120
|
const binding = source.getSnapshot();
|
|
10982
11121
|
const nativeBinding = binding.key === void 0 ? void 0 : nativeSessions.binding(binding.key);
|
|
10983
|
-
|
|
11122
|
+
attached = nativeBinding;
|
|
11123
|
+
controller.attachSessionSource(binding.key ?? null, nativeBinding?.session ?? null, nativeBinding ?? null);
|
|
10984
11124
|
controller.setSession(binding.key ?? null);
|
|
10985
11125
|
controller.attachModelSelectionSource(binding.key ?? null, binding.key === void 0 ? null : binding.keyedHooks.projection?.("modelSelection") ?? null);
|
|
10986
11126
|
controller.attachModelEventSource(binding.key ?? null, nativeBinding?.eventSource ?? null);
|
|
10987
11127
|
};
|
|
10988
|
-
update();
|
|
10989
11128
|
sessionCtx.effect(() => source.subscribe(update), "dsmm: current native session");
|
|
11129
|
+
update();
|
|
10990
11130
|
sessionCtx.effect(() => () => {
|
|
10991
11131
|
controller.attachModelSelectionSource(null, null);
|
|
10992
11132
|
controller.attachModelEventSource(null, null);
|