@michengai/dsh-automation 0.1.8 → 0.1.10
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/lib/client.js +129 -67
- package/lib/client.js.map +2 -2
- package/lib/index.js +40 -8
- package/lib/types/client/AutomationView.d.ts +1 -1
- package/lib/types/client/contracts.d.ts +2 -0
- package/lib/types/client/create-modal.d.ts +7 -13
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/menu.d.ts +2 -1
- package/lib/types/client/protocol.d.ts +16 -0
- package/lib/types/service.d.ts +16 -0
- package/package.json +8 -8
package/lib/client.js
CHANGED
|
@@ -79,7 +79,7 @@ function defaultFormState(now = /* @__PURE__ */ new Date(), workspaces = [], def
|
|
|
79
79
|
permission: defaultPermission,
|
|
80
80
|
workspaceId: workspaces[0]?.id ?? "",
|
|
81
81
|
modelKey: defaultModel === void 0 || defaultModel === null ? "default" : `${defaultModel.provider}::${defaultModel.model}`,
|
|
82
|
-
reasoningEffort: "
|
|
82
|
+
reasoningEffort: defaultModel?.reasoning?.defaultEffort ?? "none",
|
|
83
83
|
skills: []
|
|
84
84
|
};
|
|
85
85
|
}
|
|
@@ -239,7 +239,7 @@ function formFromAutomation(item, workspaces = [], defaultModel, defaultPermissi
|
|
|
239
239
|
permission: item.permission,
|
|
240
240
|
workspaceId: item.workspaceId ?? base.workspaceId,
|
|
241
241
|
modelKey,
|
|
242
|
-
reasoningEffort: item.reasoningEffort ?? "
|
|
242
|
+
reasoningEffort: item.reasoningEffort ?? "none"
|
|
243
243
|
};
|
|
244
244
|
switch (schedule.kind) {
|
|
245
245
|
case "once":
|
|
@@ -465,6 +465,7 @@ function MenuPopup({
|
|
|
465
465
|
up,
|
|
466
466
|
end,
|
|
467
467
|
className,
|
|
468
|
+
ariaLabel,
|
|
468
469
|
children,
|
|
469
470
|
onClick
|
|
470
471
|
}) {
|
|
@@ -489,6 +490,8 @@ function MenuPopup({
|
|
|
489
490
|
{
|
|
490
491
|
ref: menuRef,
|
|
491
492
|
className: `${className}${host !== null ? " is-float" : ""}`,
|
|
493
|
+
role: "menu",
|
|
494
|
+
"aria-label": ariaLabel,
|
|
492
495
|
style: host !== null ? style : void 0,
|
|
493
496
|
onMouseDown: (event) => event.stopPropagation(),
|
|
494
497
|
onClick: (event) => {
|
|
@@ -629,13 +632,14 @@ var WEEKDAYS = [1, 2, 3, 4, 5, 6, 7];
|
|
|
629
632
|
var KINDS = ["once", "interval", "hourly", "daily", "weekly", "monthly", "custom"];
|
|
630
633
|
var HOURS = Array.from({ length: 24 }, (_, index) => String(index).padStart(2, "0"));
|
|
631
634
|
var MINUTES = Array.from({ length: 60 }, (_, index) => String(index).padStart(2, "0"));
|
|
632
|
-
var EFFORTS = ["none", "low", "medium", "high"];
|
|
633
635
|
function CreateModal({
|
|
634
636
|
t,
|
|
635
637
|
permissionT,
|
|
638
|
+
modelT,
|
|
636
639
|
busy,
|
|
637
640
|
workspaces,
|
|
638
641
|
models,
|
|
642
|
+
modelFailures,
|
|
639
643
|
defaultModel,
|
|
640
644
|
skills,
|
|
641
645
|
permissions,
|
|
@@ -676,6 +680,7 @@ function CreateModal({
|
|
|
676
680
|
(0, import_react2.useEffect)(() => {
|
|
677
681
|
const onKey = (event) => {
|
|
678
682
|
if (event.key !== "Escape") return;
|
|
683
|
+
if (document.querySelector(".dsh-st-model-select-menu") !== null) return;
|
|
679
684
|
event.preventDefault();
|
|
680
685
|
event.stopPropagation();
|
|
681
686
|
event.stopImmediatePropagation();
|
|
@@ -873,12 +878,12 @@ function CreateModal({
|
|
|
873
878
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-st-composer-right", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
874
879
|
ModelPicker,
|
|
875
880
|
{
|
|
876
|
-
|
|
881
|
+
modelT,
|
|
877
882
|
models,
|
|
883
|
+
failures: modelFailures,
|
|
878
884
|
modelKey: form.modelKey,
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
onEffort: (value) => update({ reasoningEffort: value })
|
|
885
|
+
reasoningEffort: form.reasoningEffort,
|
|
886
|
+
onSelection: (modelKey, reasoningEffort) => update({ modelKey, reasoningEffort })
|
|
882
887
|
}
|
|
883
888
|
) })
|
|
884
889
|
] })
|
|
@@ -909,28 +914,53 @@ function CreateModal({
|
|
|
909
914
|
] }) });
|
|
910
915
|
}
|
|
911
916
|
function ModelPicker({
|
|
912
|
-
|
|
917
|
+
modelT,
|
|
913
918
|
models,
|
|
919
|
+
failures,
|
|
914
920
|
modelKey,
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
onEffort
|
|
921
|
+
reasoningEffort,
|
|
922
|
+
onSelection
|
|
918
923
|
}) {
|
|
919
924
|
const menu = useMenuState();
|
|
920
925
|
const [pane, setPane] = (0, import_react2.useState)("root");
|
|
921
926
|
const selected = models.find((item) => `${item.provider}::${item.model}` === modelKey);
|
|
922
|
-
const
|
|
923
|
-
const
|
|
924
|
-
const
|
|
927
|
+
const reasoning = selected?.reasoning;
|
|
928
|
+
const effectiveEffort = reasoningEffort === "none" ? reasoning?.defaultEffort : reasoningEffort;
|
|
929
|
+
const effortLabel = reasoning === void 0 ? void 0 : effectiveEffort === void 0 ? modelT("effort.providerDefault") : reasoning.efforts.find((item) => item.id === effectiveEffort)?.name ?? effectiveEffort;
|
|
930
|
+
const trigger = selected?.label ?? modelT("trigger.fallback");
|
|
925
931
|
const modelGroups = Array.from(models.reduce((groups, item) => {
|
|
926
|
-
const group = groups.get(item.provider) ?? [];
|
|
927
|
-
group.push(item);
|
|
932
|
+
const group = groups.get(item.provider) ?? { label: item.providerLabel, models: [] };
|
|
933
|
+
group.models.push(item);
|
|
928
934
|
groups.set(item.provider, group);
|
|
929
935
|
return groups;
|
|
930
936
|
}, /* @__PURE__ */ new Map()));
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
937
|
+
(0, import_react2.useEffect)(() => {
|
|
938
|
+
if (!menu.open) return;
|
|
939
|
+
const onKey = (event) => {
|
|
940
|
+
if (event.key !== "Escape") return;
|
|
941
|
+
event.preventDefault();
|
|
942
|
+
event.stopPropagation();
|
|
943
|
+
event.stopImmediatePropagation();
|
|
944
|
+
if (pane !== "root") setPane("root");
|
|
945
|
+
else menu.setOpen(false);
|
|
946
|
+
};
|
|
947
|
+
window.addEventListener("keydown", onKey, true);
|
|
948
|
+
return () => {
|
|
949
|
+
window.removeEventListener("keydown", onKey, true);
|
|
950
|
+
};
|
|
951
|
+
}, [menu.open, menu.setOpen, pane]);
|
|
952
|
+
const selectModel = (item) => {
|
|
953
|
+
onSelection(
|
|
954
|
+
`${item.provider}::${item.model}`,
|
|
955
|
+
item.reasoning?.defaultEffort ?? "none"
|
|
956
|
+
);
|
|
957
|
+
menu.setOpen(false);
|
|
958
|
+
setPane("root");
|
|
959
|
+
};
|
|
960
|
+
const selectEffort = (effort) => {
|
|
961
|
+
onSelection(modelKey, effort);
|
|
962
|
+
menu.setOpen(false);
|
|
963
|
+
setPane("root");
|
|
934
964
|
};
|
|
935
965
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: `dsh-st-model-select${menu.open ? " is-open" : ""}`, ref: menu.root, children: [
|
|
936
966
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
@@ -938,46 +968,51 @@ function ModelPicker({
|
|
|
938
968
|
{
|
|
939
969
|
type: "button",
|
|
940
970
|
className: "dsh-st-model-select-trigger",
|
|
971
|
+
"aria-label": selected === void 0 ? modelT("trigger.selectAria") : effortLabel === void 0 ? modelT("trigger.aria", { model: selected.label }) : modelT("trigger.ariaEffort", { model: selected.label, effort: effortLabel }),
|
|
941
972
|
onMouseDown: (event) => event.stopPropagation(),
|
|
942
973
|
onClick: () => {
|
|
943
974
|
if (menu.open) {
|
|
944
975
|
menu.setOpen(false);
|
|
945
976
|
return;
|
|
946
977
|
}
|
|
947
|
-
|
|
978
|
+
setPane("root");
|
|
979
|
+
menu.setOpen(true);
|
|
948
980
|
},
|
|
949
981
|
children: [
|
|
950
982
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: trigger }),
|
|
951
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("
|
|
983
|
+
effortLabel !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-trigger-effort", children: effortLabel }),
|
|
984
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives.IconChevronDownOutline14, { className: `dsh-st-model-trigger-chevron${menu.open ? " is-open" : ""}` })
|
|
952
985
|
]
|
|
953
986
|
}
|
|
954
987
|
),
|
|
955
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(MenuPopup, { open: menu.open, anchor: menu.root, menuRef: menu.menu, up: true, end: true, className: "dsh-st-model-select-menu is-up is-end", children: [
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(MenuPopup, { open: menu.open, anchor: menu.root, menuRef: menu.menu, up: true, end: true, className: "dsh-st-model-select-menu is-up is-end", ariaLabel: modelT("menu.aria"), children: [
|
|
956
989
|
pane === "root" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
957
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
958
|
-
|
|
959
|
-
] }),
|
|
960
|
-
pane === "model" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
961
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
962
|
-
"button",
|
|
990
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
991
|
+
MenuRow,
|
|
963
992
|
{
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
onClick: () =>
|
|
969
|
-
onModelKey("default");
|
|
970
|
-
menu.setOpen(false);
|
|
971
|
-
},
|
|
972
|
-
children: [
|
|
973
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-option-copy", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-name", children: t("form.modelDefault") }) }),
|
|
974
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-check", children: modelKey === "default" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CheckOutlineIcon, { width: 16, height: 16 }) })
|
|
975
|
-
]
|
|
993
|
+
kv: true,
|
|
994
|
+
label: modelT("menu.model"),
|
|
995
|
+
hint: selected?.label ?? modelT("trigger.fallback"),
|
|
996
|
+
chevron: true,
|
|
997
|
+
onClick: () => setPane("model")
|
|
976
998
|
}
|
|
977
999
|
),
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
1000
|
+
reasoning !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1001
|
+
MenuRow,
|
|
1002
|
+
{
|
|
1003
|
+
kv: true,
|
|
1004
|
+
label: modelT("menu.effort"),
|
|
1005
|
+
hint: effortLabel ?? modelT("effort.providerDefault"),
|
|
1006
|
+
chevron: true,
|
|
1007
|
+
onClick: () => setPane("effort")
|
|
1008
|
+
}
|
|
1009
|
+
)
|
|
1010
|
+
] }),
|
|
1011
|
+
pane === "model" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
1012
|
+
failures.map((failure) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-st-model-warning", children: modelT("warning.groupLoad", { name: failure.providerLabel, message: failure.message }) }, failure.provider)),
|
|
1013
|
+
modelGroups.map(([provider, group]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { role: "group", "aria-label": group.label, className: "dsh-st-model-group", children: [
|
|
1014
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-st-model-group-title", children: group.label }),
|
|
1015
|
+
group.models.map((item) => {
|
|
981
1016
|
const value = `${item.provider}::${item.model}`;
|
|
982
1017
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
983
1018
|
"button",
|
|
@@ -987,32 +1022,56 @@ function ModelPicker({
|
|
|
987
1022
|
"aria-checked": value === modelKey,
|
|
988
1023
|
className: "dsh-st-model-option",
|
|
989
1024
|
title: item.label,
|
|
990
|
-
onClick: () =>
|
|
991
|
-
onModelKey(value);
|
|
992
|
-
menu.setOpen(false);
|
|
993
|
-
},
|
|
1025
|
+
onClick: () => selectModel(item),
|
|
994
1026
|
children: [
|
|
995
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
996
|
-
|
|
1027
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dsh-st-model-option-copy", children: [
|
|
1028
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-name", children: item.label }),
|
|
1029
|
+
item.description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-description", children: item.description })
|
|
1030
|
+
] }),
|
|
1031
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-check", children: value === modelKey && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives.IconCheckOutline16, {}) })
|
|
997
1032
|
]
|
|
998
1033
|
},
|
|
999
1034
|
value
|
|
1000
1035
|
);
|
|
1001
1036
|
})
|
|
1002
|
-
] }, provider))
|
|
1037
|
+
] }, provider)),
|
|
1038
|
+
modelGroups.length === 0 && failures.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-st-model-empty", children: modelT("empty.models") })
|
|
1003
1039
|
] }),
|
|
1004
|
-
pane === "effort" &&
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1040
|
+
pane === "effort" && reasoning !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
1041
|
+
reasoning.defaultEffort === void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1042
|
+
"button",
|
|
1043
|
+
{
|
|
1044
|
+
type: "button",
|
|
1045
|
+
role: "menuitemradio",
|
|
1046
|
+
"aria-checked": reasoningEffort === "none",
|
|
1047
|
+
className: "dsh-st-model-option",
|
|
1048
|
+
onClick: () => selectEffort("none"),
|
|
1049
|
+
children: [
|
|
1050
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-option-copy", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-name", children: modelT("effort.providerDefault") }) }),
|
|
1051
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-check", children: reasoningEffort === "none" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives.IconCheckOutline16, {}) })
|
|
1052
|
+
]
|
|
1012
1053
|
}
|
|
1013
|
-
|
|
1014
|
-
item
|
|
1015
|
-
|
|
1054
|
+
),
|
|
1055
|
+
reasoning.efforts.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1056
|
+
"button",
|
|
1057
|
+
{
|
|
1058
|
+
type: "button",
|
|
1059
|
+
role: "menuitemradio",
|
|
1060
|
+
"aria-checked": effectiveEffort === item.id,
|
|
1061
|
+
className: "dsh-st-model-option",
|
|
1062
|
+
onClick: () => selectEffort(item.id),
|
|
1063
|
+
children: [
|
|
1064
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dsh-st-model-option-copy", children: [
|
|
1065
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-name", children: item.name }),
|
|
1066
|
+
item.description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-description", children: item.description })
|
|
1067
|
+
] }),
|
|
1068
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-check", children: effectiveEffort === item.id && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives.IconCheckOutline16, {}) })
|
|
1069
|
+
]
|
|
1070
|
+
},
|
|
1071
|
+
item.id
|
|
1072
|
+
)),
|
|
1073
|
+
reasoning.efforts.length === 0 && reasoning.defaultEffort !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-st-model-empty", children: modelT("empty.efforts") })
|
|
1074
|
+
] })
|
|
1016
1075
|
] })
|
|
1017
1076
|
] });
|
|
1018
1077
|
}
|
|
@@ -1233,7 +1292,7 @@ var EXAMPLES = [
|
|
|
1233
1292
|
{ name: "\u6BCF\u5468\u4F9D\u8D56\u5DE1\u68C0", scheduleKind: "weekly", time: "10:00", weekdays: [1] },
|
|
1234
1293
|
{ name: "\u5DE5\u4F5C\u65E5\u65E9\u62A5", scheduleKind: "weekly", time: "08:00", weekdays: [1, 2, 3, 4, 5] }
|
|
1235
1294
|
];
|
|
1236
|
-
function AutomationView({ t, permissionT, runtime, closeSettings, pickWorkspaceDirectory }) {
|
|
1295
|
+
function AutomationView({ t, permissionT, modelT, runtime, closeSettings, pickWorkspaceDirectory }) {
|
|
1237
1296
|
const state = (0, import_react3.useSyncExternalStore)(runtime.source.subscribe, runtime.source.getSnapshot, runtime.source.getSnapshot);
|
|
1238
1297
|
const [tab, setTab] = (0, import_react3.useState)("mine");
|
|
1239
1298
|
const [query, setQuery] = (0, import_react3.useState)("");
|
|
@@ -1406,9 +1465,11 @@ function AutomationView({ t, permissionT, runtime, closeSettings, pickWorkspaceD
|
|
|
1406
1465
|
{
|
|
1407
1466
|
t,
|
|
1408
1467
|
permissionT,
|
|
1468
|
+
modelT,
|
|
1409
1469
|
busy,
|
|
1410
1470
|
workspaces,
|
|
1411
1471
|
models,
|
|
1472
|
+
modelFailures: snapshot?.modelFailures ?? [],
|
|
1412
1473
|
defaultModel: snapshot?.defaultModel ?? null,
|
|
1413
1474
|
skills: snapshot?.skills ?? [],
|
|
1414
1475
|
permissions,
|
|
@@ -1580,7 +1641,7 @@ var en = {
|
|
|
1580
1641
|
"form.workspacePath": "Folder path",
|
|
1581
1642
|
"form.workspacePathPlaceholder": "D:\\work\\project",
|
|
1582
1643
|
"form.model": "Model",
|
|
1583
|
-
"form.
|
|
1644
|
+
"form.modelSelect": "Select model",
|
|
1584
1645
|
"form.effort": "Reasoning",
|
|
1585
1646
|
"form.effort.none": "Default",
|
|
1586
1647
|
"form.effort.low": "Low",
|
|
@@ -1772,7 +1833,7 @@ var zh = {
|
|
|
1772
1833
|
"form.workspacePath": "\u76EE\u5F55\u8DEF\u5F84",
|
|
1773
1834
|
"form.workspacePathPlaceholder": "D:\\work\\project",
|
|
1774
1835
|
"form.model": "\u6A21\u578B",
|
|
1775
|
-
"form.
|
|
1836
|
+
"form.modelSelect": "\u9009\u62E9\u6A21\u578B",
|
|
1776
1837
|
"form.effort": "\u63A8\u7406\u7B49\u7EA7",
|
|
1777
1838
|
"form.effort.none": "\u9ED8\u8BA4",
|
|
1778
1839
|
"form.effort.low": "Low",
|
|
@@ -2903,7 +2964,7 @@ var CSS_TEXT = `
|
|
|
2903
2964
|
.dsh-st-run p{display:flex;gap:10px;margin:0;color:var(--dsw-alias-label-tertiary);font-size:12px}
|
|
2904
2965
|
.dsh-st-error{color:#ff6b6b;font-size:12px}
|
|
2905
2966
|
.dsh-st-muted{color:var(--dsw-alias-label-secondary)}
|
|
2906
|
-
.dsh-st-mask{position:fixed;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:24px;overflow:auto;background:rgba(0,0,0,.45)}.dsh-st-flyout-root{position:absolute;inset:0;z-index:1200;overflow:visible;pointer-events:none}.dsh-st-flyout-root .dsh-st-select-menu{pointer-events:auto}
|
|
2967
|
+
.dsh-st-mask{position:fixed;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:24px;overflow:auto;background:rgba(0,0,0,.45)}.dsh-st-flyout-root{position:absolute;inset:0;z-index:1200;overflow:visible;pointer-events:none}.dsh-st-flyout-root .dsh-st-select-menu,.dsh-st-flyout-root .dsh-st-model-select-menu{pointer-events:auto}
|
|
2907
2968
|
.dsh-st-modal,.dsh-st-modal *{box-sizing:border-box}.dsh-st-modal{display:flex;flex-direction:column;width:min(760px,calc(100vw - 48px));max-width:100%;max-height:min(92vh,900px);overflow:hidden;padding:24px;border:1px solid var(--dsw-alias-border-l2);border-radius:20px;background:var(--dsw-alias-bg-base)}
|
|
2908
2969
|
.dsh-st-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
|
|
2909
2970
|
.dsh-st-modal-head h2{margin:0 0 4px;font-size:20px}
|
|
@@ -2946,7 +3007,7 @@ var CSS_TEXT = `
|
|
|
2946
3007
|
.dsh-st-chip-btn:hover{background:rgba(255,255,255,.06);color:var(--dsw-alias-label-primary)}
|
|
2947
3008
|
.dsh-st-chip-btn.is-static{cursor:default;opacity:.78}
|
|
2948
3009
|
.dsh-st-chip-btn em,.dsh-st-select.is-pill .dsh-st-select-btn em{width:6px;height:6px;margin-left:2px;opacity:.55}
|
|
2949
|
-
.dsh-st-model-select{position:relative;z-index:1;min-width:0;flex:none}.dsh-st-model-select.is-open{z-index:30}.dsh-st-model-select-trigger{display:flex;align-items:center;gap:4px;min-width:0;max-width:
|
|
3010
|
+
.dsh-st-model-select{position:relative;z-index:1;min-width:0;flex:none}.dsh-st-model-select.is-open{z-index:30}.dsh-st-model-select-trigger{display:flex;align-items:center;gap:4px;min-width:0;max-width:260px;height:28px;padding:0 4px 0 8px;border:0;border-radius:24px;background:transparent;color:var(--dsw-alias-label-secondary);font-size:13px;font-weight:500;line-height:20px;cursor:pointer}.dsh-st-model-select-trigger:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.dsh-st-model-select-trigger>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsh-st-model-trigger-effort{flex:none;color:var(--dsw-alias-label-tertiary);white-space:nowrap}.dsh-st-model-trigger-chevron{flex:none;transition:transform .16s ease}.dsh-st-model-trigger-chevron.is-open{transform:rotate(180deg)}.dsh-st-model-select-menu{z-index:30;width:min(240px,calc(100vw - 32px));max-height:min(360px,calc(100vh - 96px));overflow-y:auto;padding:4px;border:1px solid var(--dsw-alias-border-inverted,var(--dsw-alias-border-l2));border-radius:12px;background:var(--dsw-specific-menu,var(--dsw-alias-bg-base));box-shadow:var(--dsw-shadow-lv3)}.dsh-st-model-select-menu.is-float{position:absolute;z-index:1200;box-sizing:border-box}.dsh-st-model-select-menu .dsh-st-menu-row{min-height:40px;padding:0 10px;border-radius:10px;font-size:14px}.dsh-st-model-select-menu .dsh-st-menu-row.is-kv .dsh-st-menu-row-side{font-size:13px;color:var(--dsw-alias-label-tertiary)}.dsh-st-model-group+.dsh-st-model-group{margin-top:4px}.dsh-st-model-group-title{position:sticky;top:0;z-index:1;padding:5px 8px 3px;background:var(--dsw-specific-menu,var(--dsw-alias-bg-base));color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:500;line-height:18px}.dsh-st-model-option{display:flex;width:100%;min-height:38px;align-items:center;gap:8px;padding:6px 8px;border:0;border-radius:10px;background:transparent;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer}.dsh-st-model-option:hover,.dsh-st-model-option:focus-visible{background:var(--dsw-alias-interactive-bg-hover);outline:none}.dsh-st-model-option-copy{display:flex;min-width:0;flex:1;flex-direction:column}.dsh-st-model-name{overflow:hidden;font-size:14px;font-weight:500;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.dsh-st-model-description{overflow:hidden;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px;text-overflow:ellipsis;white-space:nowrap}.dsh-st-model-check{display:grid;flex:0 0 18px;place-items:center;color:var(--dsw-alias-label-primary)}.dsh-st-model-warning{margin:4px;padding:8px;border-radius:8px;background:var(--dsw-alias-interactive-bg-hover-danger,rgba(248,81,73,.1));color:var(--dsw-alias-state-error-primary,#f85149);font-size:12px;line-height:18px}.dsh-st-model-empty{padding:14px 12px;color:var(--dsw-alias-label-tertiary);font-size:12px;text-align:center}
|
|
2950
3011
|
.dsh-st-suffix{color:var(--dsw-alias-label-secondary);font-size:13px}
|
|
2951
3012
|
.dsh-st-inline input.is-narrow{width:72px;flex:none}
|
|
2952
3013
|
.dsh-st-time{display:inline-flex;align-items:center;gap:2px;min-height:36px;padding:0 8px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:rgba(255,255,255,.04)}
|
|
@@ -3030,6 +3091,7 @@ function apply(ctx) {
|
|
|
3030
3091
|
ctx.effect(() => ctx.locale.register(NS, { zh, en }), "dsh-automation: locale");
|
|
3031
3092
|
const t = ctx.locale.bind(NS);
|
|
3032
3093
|
const permissionT = ctx.locale.bind("permission.access");
|
|
3094
|
+
const modelT = ctx.locale.bind("model");
|
|
3033
3095
|
const runtime = createAutomationRuntime(ctx.connection.rpc);
|
|
3034
3096
|
ctx.effect(() => installSettingsNavIcon(() => [t("tab"), "Scheduled tasks", "\u5B9A\u65F6\u4EFB\u52A1"]), "dsh-automation: settings icon");
|
|
3035
3097
|
ctx.slots.inject("settings.section", () => ctx.slots.register({
|
|
@@ -3041,7 +3103,7 @@ function apply(ctx) {
|
|
|
3041
3103
|
icon: "schedule"
|
|
3042
3104
|
}, function ScheduledTasksSettings(props) {
|
|
3043
3105
|
const workspacesApi = readOptionalWorkspaces(ctx);
|
|
3044
|
-
return (0, import_react7.createElement)(AutomationView, { t, permissionT, runtime, ...props.close === void 0 ? {} : { closeSettings: props.close }, ...workspacesApi === void 0 ? {} : { pickWorkspaceDirectory: () => workspacesApi.pickDirectory() } });
|
|
3106
|
+
return (0, import_react7.createElement)(AutomationView, { t, permissionT, modelT, runtime, ...props.close === void 0 ? {} : { closeSettings: props.close }, ...workspacesApi === void 0 ? {} : { pickWorkspaceDirectory: () => workspacesApi.pickDirectory() } });
|
|
3045
3107
|
}));
|
|
3046
3108
|
ctx.slots.inject("sidebar.schedule", () => ctx.slots.register({
|
|
3047
3109
|
name: "sidebar.schedule",
|