@michengai/dsh-automation 0.1.8 → 0.1.9

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 CHANGED
@@ -629,7 +629,6 @@ var WEEKDAYS = [1, 2, 3, 4, 5, 6, 7];
629
629
  var KINDS = ["once", "interval", "hourly", "daily", "weekly", "monthly", "custom"];
630
630
  var HOURS = Array.from({ length: 24 }, (_, index) => String(index).padStart(2, "0"));
631
631
  var MINUTES = Array.from({ length: 60 }, (_, index) => String(index).padStart(2, "0"));
632
- var EFFORTS = ["none", "low", "medium", "high"];
633
632
  function CreateModal({
634
633
  t,
635
634
  permissionT,
@@ -876,9 +875,7 @@ function CreateModal({
876
875
  t,
877
876
  models,
878
877
  modelKey: form.modelKey,
879
- effort: form.reasoningEffort,
880
- onModelKey: (value) => update({ modelKey: value }),
881
- onEffort: (value) => update({ reasoningEffort: value })
878
+ onModelKey: (value) => update({ modelKey: value, reasoningEffort: "none" })
882
879
  }
883
880
  ) })
884
881
  ] })
@@ -912,26 +909,17 @@ function ModelPicker({
912
909
  t,
913
910
  models,
914
911
  modelKey,
915
- effort,
916
- onModelKey,
917
- onEffort
912
+ onModelKey
918
913
  }) {
919
914
  const menu = useMenuState();
920
- const [pane, setPane] = (0, import_react2.useState)("root");
921
915
  const selected = models.find((item) => `${item.provider}::${item.model}` === modelKey);
922
- const modelLabel = selected === void 0 ? t("form.modelDefault") : selected.label;
923
- const effortLabel = t(`form.effort.${effort}`);
924
- const trigger = effort === "none" ? modelLabel : `${modelLabel} ${effortLabel}`;
916
+ const trigger = selected?.label ?? t("form.modelSelect");
925
917
  const modelGroups = Array.from(models.reduce((groups, item) => {
926
918
  const group = groups.get(item.provider) ?? [];
927
919
  group.push(item);
928
920
  groups.set(item.provider, group);
929
921
  return groups;
930
922
  }, /* @__PURE__ */ new Map()));
931
- const open = (next) => {
932
- setPane(next);
933
- menu.setOpen(true);
934
- };
935
923
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: `dsh-st-model-select${menu.open ? " is-open" : ""}`, ref: menu.root, children: [
936
924
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
937
925
  "button",
@@ -944,7 +932,7 @@ function ModelPicker({
944
932
  menu.setOpen(false);
945
933
  return;
946
934
  }
947
- open("root");
935
+ menu.setOpen(true);
948
936
  },
949
937
  children: [
950
938
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: trigger }),
@@ -952,68 +940,31 @@ function ModelPicker({
952
940
  ]
953
941
  }
954
942
  ),
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: [
956
- pane === "root" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
957
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MenuRow, { kv: true, label: t("form.model"), hint: modelLabel, chevron: true, onClick: () => setPane("model") }),
958
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MenuRow, { kv: true, label: t("form.effort"), hint: effortLabel, chevron: true, onClick: () => setPane("effort") })
959
- ] }),
960
- pane === "model" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
961
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
943
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(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: modelGroups.map(([provider, group]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { role: "group", "aria-label": provider, className: "dsh-st-model-group", children: [
944
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-st-model-group-title", children: provider }),
945
+ group.map((item) => {
946
+ const value = `${item.provider}::${item.model}`;
947
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
962
948
  "button",
963
949
  {
964
950
  type: "button",
965
951
  role: "menuitemradio",
966
- "aria-checked": modelKey === "default",
952
+ "aria-checked": value === modelKey,
967
953
  className: "dsh-st-model-option",
954
+ title: item.label,
968
955
  onClick: () => {
969
- onModelKey("default");
956
+ onModelKey(value);
970
957
  menu.setOpen(false);
971
958
  },
972
959
  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 }) })
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: item.label }) }),
961
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-check", children: value === modelKey && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CheckOutlineIcon, { width: 16, height: 16 }) })
975
962
  ]
976
- }
977
- ),
978
- modelGroups.map(([provider, group]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { role: "group", "aria-label": provider, className: "dsh-st-model-group", children: [
979
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-st-model-group-title", children: provider }),
980
- group.map((item) => {
981
- const value = `${item.provider}::${item.model}`;
982
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
983
- "button",
984
- {
985
- type: "button",
986
- role: "menuitemradio",
987
- "aria-checked": value === modelKey,
988
- className: "dsh-st-model-option",
989
- title: item.label,
990
- onClick: () => {
991
- onModelKey(value);
992
- menu.setOpen(false);
993
- },
994
- children: [
995
- /* @__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: item.label }) }),
996
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-st-model-check", children: value === modelKey && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CheckOutlineIcon, { width: 16, height: 16 }) })
997
- ]
998
- },
999
- value
1000
- );
1001
- })
1002
- ] }, provider))
1003
- ] }),
1004
- pane === "effort" && EFFORTS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1005
- MenuRow,
1006
- {
1007
- label: t(`form.effort.${item}`),
1008
- active: item === effort,
1009
- onClick: () => {
1010
- onEffort(item);
1011
- menu.setOpen(false);
1012
- }
1013
- },
1014
- item
1015
- ))
1016
- ] })
963
+ },
964
+ value
965
+ );
966
+ })
967
+ ] }, provider)) })
1017
968
  ] });
1018
969
  }
1019
970
  function TimeSelect({
@@ -1580,7 +1531,7 @@ var en = {
1580
1531
  "form.workspacePath": "Folder path",
1581
1532
  "form.workspacePathPlaceholder": "D:\\work\\project",
1582
1533
  "form.model": "Model",
1583
- "form.modelDefault": "Follow default model",
1534
+ "form.modelSelect": "Select model",
1584
1535
  "form.effort": "Reasoning",
1585
1536
  "form.effort.none": "Default",
1586
1537
  "form.effort.low": "Low",
@@ -1772,7 +1723,7 @@ var zh = {
1772
1723
  "form.workspacePath": "\u76EE\u5F55\u8DEF\u5F84",
1773
1724
  "form.workspacePathPlaceholder": "D:\\work\\project",
1774
1725
  "form.model": "\u6A21\u578B",
1775
- "form.modelDefault": "\u8DDF\u968F\u9ED8\u8BA4\u6A21\u578B",
1726
+ "form.modelSelect": "\u9009\u62E9\u6A21\u578B",
1776
1727
  "form.effort": "\u63A8\u7406\u7B49\u7EA7",
1777
1728
  "form.effort.none": "\u9ED8\u8BA4",
1778
1729
  "form.effort.low": "Low",
@@ -2903,7 +2854,7 @@ var CSS_TEXT = `
2903
2854
  .dsh-st-run p{display:flex;gap:10px;margin:0;color:var(--dsw-alias-label-tertiary);font-size:12px}
2904
2855
  .dsh-st-error{color:#ff6b6b;font-size:12px}
2905
2856
  .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}
2857
+ .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
2858
  .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
2859
  .dsh-st-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
2909
2860
  .dsh-st-modal-head h2{margin:0 0 4px;font-size:20px}
@@ -2946,7 +2897,7 @@ var CSS_TEXT = `
2946
2897
  .dsh-st-chip-btn:hover{background:rgba(255,255,255,.06);color:var(--dsw-alias-label-primary)}
2947
2898
  .dsh-st-chip-btn.is-static{cursor:default;opacity:.78}
2948
2899
  .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:220px;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{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsh-st-model-select-trigger em{width:6px;height:6px;margin-left:2px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px);opacity:.55;flex:none}.dsh-st-model-select-menu{z-index:30;width:min(240px,calc(100vw - 32px));max-height:min(360px,calc(100vh - 96px));overflow:hidden;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-check{display:grid;flex:0 0 18px;place-items:center;color:var(--dsw-alias-label-primary)}
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:220px;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{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsh-st-model-select-trigger em{width:6px;height:6px;margin-left:2px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px);opacity:.55;flex:none}.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-check{display:grid;flex:0 0 18px;place-items:center;color:var(--dsw-alias-label-primary)}
2950
2901
  .dsh-st-suffix{color:var(--dsw-alias-label-secondary);font-size:13px}
2951
2902
  .dsh-st-inline input.is-narrow{width:72px;flex:none}
2952
2903
  .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)}