@michengai/dsh-automation 0.1.9 → 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 +141 -30
- 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/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) => {
|
|
@@ -632,9 +635,11 @@ var MINUTES = Array.from({ length: 60 }, (_, index) => String(index).padStart(2,
|
|
|
632
635
|
function CreateModal({
|
|
633
636
|
t,
|
|
634
637
|
permissionT,
|
|
638
|
+
modelT,
|
|
635
639
|
busy,
|
|
636
640
|
workspaces,
|
|
637
641
|
models,
|
|
642
|
+
modelFailures,
|
|
638
643
|
defaultModel,
|
|
639
644
|
skills,
|
|
640
645
|
permissions,
|
|
@@ -675,6 +680,7 @@ function CreateModal({
|
|
|
675
680
|
(0, import_react2.useEffect)(() => {
|
|
676
681
|
const onKey = (event) => {
|
|
677
682
|
if (event.key !== "Escape") return;
|
|
683
|
+
if (document.querySelector(".dsh-st-model-select-menu") !== null) return;
|
|
678
684
|
event.preventDefault();
|
|
679
685
|
event.stopPropagation();
|
|
680
686
|
event.stopImmediatePropagation();
|
|
@@ -872,10 +878,12 @@ function CreateModal({
|
|
|
872
878
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-st-composer-right", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
873
879
|
ModelPicker,
|
|
874
880
|
{
|
|
875
|
-
|
|
881
|
+
modelT,
|
|
876
882
|
models,
|
|
883
|
+
failures: modelFailures,
|
|
877
884
|
modelKey: form.modelKey,
|
|
878
|
-
|
|
885
|
+
reasoningEffort: form.reasoningEffort,
|
|
886
|
+
onSelection: (modelKey, reasoningEffort) => update({ modelKey, reasoningEffort })
|
|
879
887
|
}
|
|
880
888
|
) })
|
|
881
889
|
] })
|
|
@@ -906,65 +914,165 @@ function CreateModal({
|
|
|
906
914
|
] }) });
|
|
907
915
|
}
|
|
908
916
|
function ModelPicker({
|
|
909
|
-
|
|
917
|
+
modelT,
|
|
910
918
|
models,
|
|
919
|
+
failures,
|
|
911
920
|
modelKey,
|
|
912
|
-
|
|
921
|
+
reasoningEffort,
|
|
922
|
+
onSelection
|
|
913
923
|
}) {
|
|
914
924
|
const menu = useMenuState();
|
|
925
|
+
const [pane, setPane] = (0, import_react2.useState)("root");
|
|
915
926
|
const selected = models.find((item) => `${item.provider}::${item.model}` === modelKey);
|
|
916
|
-
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");
|
|
917
931
|
const modelGroups = Array.from(models.reduce((groups, item) => {
|
|
918
|
-
const group = groups.get(item.provider) ?? [];
|
|
919
|
-
group.push(item);
|
|
932
|
+
const group = groups.get(item.provider) ?? { label: item.providerLabel, models: [] };
|
|
933
|
+
group.models.push(item);
|
|
920
934
|
groups.set(item.provider, group);
|
|
921
935
|
return groups;
|
|
922
936
|
}, /* @__PURE__ */ new Map()));
|
|
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");
|
|
964
|
+
};
|
|
923
965
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: `dsh-st-model-select${menu.open ? " is-open" : ""}`, ref: menu.root, children: [
|
|
924
966
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
925
967
|
"button",
|
|
926
968
|
{
|
|
927
969
|
type: "button",
|
|
928
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 }),
|
|
929
972
|
onMouseDown: (event) => event.stopPropagation(),
|
|
930
973
|
onClick: () => {
|
|
931
974
|
if (menu.open) {
|
|
932
975
|
menu.setOpen(false);
|
|
933
976
|
return;
|
|
934
977
|
}
|
|
978
|
+
setPane("root");
|
|
935
979
|
menu.setOpen(true);
|
|
936
980
|
},
|
|
937
981
|
children: [
|
|
938
982
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: trigger }),
|
|
939
|
-
/* @__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" : ""}` })
|
|
940
985
|
]
|
|
941
986
|
}
|
|
942
987
|
),
|
|
943
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
944
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
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: [
|
|
989
|
+
pane === "root" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
990
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
991
|
+
MenuRow,
|
|
992
|
+
{
|
|
993
|
+
kv: true,
|
|
994
|
+
label: modelT("menu.model"),
|
|
995
|
+
hint: selected?.label ?? modelT("trigger.fallback"),
|
|
996
|
+
chevron: true,
|
|
997
|
+
onClick: () => setPane("model")
|
|
998
|
+
}
|
|
999
|
+
),
|
|
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) => {
|
|
1016
|
+
const value = `${item.provider}::${item.model}`;
|
|
1017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1018
|
+
"button",
|
|
1019
|
+
{
|
|
1020
|
+
type: "button",
|
|
1021
|
+
role: "menuitemradio",
|
|
1022
|
+
"aria-checked": value === modelKey,
|
|
1023
|
+
className: "dsh-st-model-option",
|
|
1024
|
+
title: item.label,
|
|
1025
|
+
onClick: () => selectModel(item),
|
|
1026
|
+
children: [
|
|
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, {}) })
|
|
1032
|
+
]
|
|
1033
|
+
},
|
|
1034
|
+
value
|
|
1035
|
+
);
|
|
1036
|
+
})
|
|
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") })
|
|
1039
|
+
] }),
|
|
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)(
|
|
948
1042
|
"button",
|
|
949
1043
|
{
|
|
950
1044
|
type: "button",
|
|
951
1045
|
role: "menuitemradio",
|
|
952
|
-
"aria-checked":
|
|
1046
|
+
"aria-checked": reasoningEffort === "none",
|
|
953
1047
|
className: "dsh-st-model-option",
|
|
954
|
-
|
|
955
|
-
onClick: () => {
|
|
956
|
-
onModelKey(value);
|
|
957
|
-
menu.setOpen(false);
|
|
958
|
-
},
|
|
1048
|
+
onClick: () => selectEffort("none"),
|
|
959
1049
|
children: [
|
|
960
|
-
/* @__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:
|
|
961
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-check", 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
|
+
]
|
|
1053
|
+
}
|
|
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, {}) })
|
|
962
1069
|
]
|
|
963
1070
|
},
|
|
964
|
-
|
|
965
|
-
)
|
|
966
|
-
|
|
967
|
-
|
|
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
|
+
] })
|
|
1075
|
+
] })
|
|
968
1076
|
] });
|
|
969
1077
|
}
|
|
970
1078
|
function TimeSelect({
|
|
@@ -1184,7 +1292,7 @@ var EXAMPLES = [
|
|
|
1184
1292
|
{ name: "\u6BCF\u5468\u4F9D\u8D56\u5DE1\u68C0", scheduleKind: "weekly", time: "10:00", weekdays: [1] },
|
|
1185
1293
|
{ name: "\u5DE5\u4F5C\u65E5\u65E9\u62A5", scheduleKind: "weekly", time: "08:00", weekdays: [1, 2, 3, 4, 5] }
|
|
1186
1294
|
];
|
|
1187
|
-
function AutomationView({ t, permissionT, runtime, closeSettings, pickWorkspaceDirectory }) {
|
|
1295
|
+
function AutomationView({ t, permissionT, modelT, runtime, closeSettings, pickWorkspaceDirectory }) {
|
|
1188
1296
|
const state = (0, import_react3.useSyncExternalStore)(runtime.source.subscribe, runtime.source.getSnapshot, runtime.source.getSnapshot);
|
|
1189
1297
|
const [tab, setTab] = (0, import_react3.useState)("mine");
|
|
1190
1298
|
const [query, setQuery] = (0, import_react3.useState)("");
|
|
@@ -1357,9 +1465,11 @@ function AutomationView({ t, permissionT, runtime, closeSettings, pickWorkspaceD
|
|
|
1357
1465
|
{
|
|
1358
1466
|
t,
|
|
1359
1467
|
permissionT,
|
|
1468
|
+
modelT,
|
|
1360
1469
|
busy,
|
|
1361
1470
|
workspaces,
|
|
1362
1471
|
models,
|
|
1472
|
+
modelFailures: snapshot?.modelFailures ?? [],
|
|
1363
1473
|
defaultModel: snapshot?.defaultModel ?? null,
|
|
1364
1474
|
skills: snapshot?.skills ?? [],
|
|
1365
1475
|
permissions,
|
|
@@ -2897,7 +3007,7 @@ var CSS_TEXT = `
|
|
|
2897
3007
|
.dsh-st-chip-btn:hover{background:rgba(255,255,255,.06);color:var(--dsw-alias-label-primary)}
|
|
2898
3008
|
.dsh-st-chip-btn.is-static{cursor:default;opacity:.78}
|
|
2899
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}
|
|
2900
|
-
.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}
|
|
2901
3011
|
.dsh-st-suffix{color:var(--dsw-alias-label-secondary);font-size:13px}
|
|
2902
3012
|
.dsh-st-inline input.is-narrow{width:72px;flex:none}
|
|
2903
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)}
|
|
@@ -2981,6 +3091,7 @@ function apply(ctx) {
|
|
|
2981
3091
|
ctx.effect(() => ctx.locale.register(NS, { zh, en }), "dsh-automation: locale");
|
|
2982
3092
|
const t = ctx.locale.bind(NS);
|
|
2983
3093
|
const permissionT = ctx.locale.bind("permission.access");
|
|
3094
|
+
const modelT = ctx.locale.bind("model");
|
|
2984
3095
|
const runtime = createAutomationRuntime(ctx.connection.rpc);
|
|
2985
3096
|
ctx.effect(() => installSettingsNavIcon(() => [t("tab"), "Scheduled tasks", "\u5B9A\u65F6\u4EFB\u52A1"]), "dsh-automation: settings icon");
|
|
2986
3097
|
ctx.slots.inject("settings.section", () => ctx.slots.register({
|
|
@@ -2992,7 +3103,7 @@ function apply(ctx) {
|
|
|
2992
3103
|
icon: "schedule"
|
|
2993
3104
|
}, function ScheduledTasksSettings(props) {
|
|
2994
3105
|
const workspacesApi = readOptionalWorkspaces(ctx);
|
|
2995
|
-
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() } });
|
|
2996
3107
|
}));
|
|
2997
3108
|
ctx.slots.inject("sidebar.schedule", () => ctx.slots.register({
|
|
2998
3109
|
name: "sidebar.schedule",
|