dsh-multi-router 0.6.3 → 0.6.5

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
@@ -50,7 +50,7 @@ module.exports = __toCommonJS(client_exports);
50
50
  var import_react = require("react");
51
51
 
52
52
  // package.json
53
- var version = "0.6.3";
53
+ var version = "0.6.5";
54
54
 
55
55
  // src/client.jsx
56
56
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -2364,7 +2364,7 @@ function RouteReasoningSelect({ draft, setDraft, data, busy }) {
2364
2364
  }, [signature, data.key]);
2365
2365
  const pending = preview?.signature !== signature, modes = pending ? [] : preview?.reasoning?.supportedEfforts ?? [];
2366
2366
  const effort = draft.reasoningEffort ?? "", unavailable = !!effort && !pending && !preview?.error && !modes.includes(effort);
2367
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "box stack", children: [
2367
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "stack", children: [
2368
2368
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
2369
2369
  "\u9ED8\u8BA4\u601D\u8003\u6DF1\u5EA6",
2370
2370
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { "aria-describedby": "route-reasoning-help", disabled: busy || pending || !!preview?.error, value: effort, onChange: (e) => setDraft((d) => ({ ...d, reasoningEffort: e.target.value || null })), children: [
@@ -2412,7 +2412,26 @@ function RouteForm({ draft, setDraft, data, act, busy, error, notice }) {
2412
2412
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { required: true, maxLength: 200, value: draft.name, disabled: busy, onChange: (e) => set("name", e.target.value), placeholder: "\u4F8B\u5982 \u6211\u7684 Flash \u81EA\u52A8\u5207\u6362" })
2413
2413
  ] }),
2414
2414
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "notice", children: "\u540D\u79F0\u663E\u793A\u5728 DSH \u6A21\u578B\u5217\u8868\u4E2D\uFF0C\u53EF\u968F\u65F6\u4FEE\u6539\uFF0C\u4E0D\u5F71\u54CD\u5DF2\u6709\u4F1A\u8BDD\u7684\u8DEF\u7531\u9009\u62E9\u3002" }),
2415
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteReasoningSelect, { draft, setDraft, data, busy }),
2415
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "box stack", "aria-labelledby": "route-model-parameters", children: [
2416
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { id: "route-model-parameters", children: "\u6A21\u578B\u53C2\u6570" }),
2417
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid", children: [
2418
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "stack", children: [
2419
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
2420
+ "\u4E0A\u4E0B\u6587\u5BB9\u91CF",
2421
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { disabled: busy, value: draft.contextMode ?? "maximum", onChange: (e) => set("contextMode", e.target.value), children: [
2422
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "maximum", children: "\u4F7F\u7528\u6A21\u578B\u6700\u5927\u5BB9\u91CF\uFF08\u9ED8\u8BA4\uFF09" }),
2423
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "custom", children: "\u624B\u52A8\u8BBE\u7F6E\u672C\u5730\u9884\u7B97" })
2424
+ ] })
2425
+ ] }),
2426
+ draft.contextMode === "custom" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
2427
+ "\u4E0A\u4E0B\u6587\u9884\u7B97\uFF08Token\uFF09",
2428
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "number", disabled: busy, min: "1", required: true, value: draft.contextWindow, onChange: (e) => set("contextWindow", Number(e.target.value)) })
2429
+ ] }),
2430
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "notice", children: "\u9ED8\u8BA4\u968F\u6A21\u578B\u76EE\u5F55\u66F4\u65B0\u3002\u53EA\u5411\u652F\u6301\u5F53\u524D\u5BB9\u91CF\u7684\u6E20\u9053\u5207\u6362\uFF1B\u8C03\u4F4E\u9884\u7B97\u53EF\u8BA9\u66F4\u591A\u6E20\u9053\u53C2\u4E0E\u3002\u4E0D\u4F1A\u5220\u9664\u4F1A\u8BDD\u5386\u53F2\u3002" })
2431
+ ] }),
2432
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteReasoningSelect, { draft, setDraft, data, busy })
2433
+ ] })
2434
+ ] }),
2416
2435
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
2417
2436
  "\u8D26\u53F7\u5207\u6362\u89C4\u5219",
2418
2437
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("select", { disabled: busy, value: draft.strategy, onChange: (e) => set("strategy", e.target.value), children: Object.entries(strategies).map(([id, label]) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: id, children: label }, id)) })
@@ -2500,20 +2519,6 @@ function RouteForm({ draft, setDraft, data, act, busy, error, notice }) {
2500
2519
  ] }, t.key);
2501
2520
  }),
2502
2521
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy, onClick: () => set("targets", [...draft.targets, { provider: "workbuddy", account: "", key: crypto.randomUUID(), weight: 1, tokenBudget: 1e5, creditBudget: 100, modelText: "" }]), children: "\u6DFB\u52A0\u5207\u6362\u76EE\u6807" }),
2503
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "box stack", children: [
2504
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
2505
- "\u4E0A\u4E0B\u6587\u5BB9\u91CF",
2506
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { disabled: busy, value: draft.contextMode ?? "maximum", onChange: (e) => set("contextMode", e.target.value), children: [
2507
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "maximum", children: "\u4F7F\u7528\u76EE\u6807\u6E20\u9053\u6A21\u578B\u7684\u6700\u5927\u5BB9\u91CF\uFF08\u9ED8\u8BA4\uFF09" }),
2508
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "custom", children: "\u624B\u52A8\u8BBE\u7F6E\u672C\u5730\u9884\u7B97" })
2509
- ] })
2510
- ] }),
2511
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "notice", children: "\u9ED8\u8BA4\u968F\u6A21\u578B\u76EE\u5F55\u66F4\u65B0\u3002\u53EA\u5411\u652F\u6301\u5F53\u524D\u5BB9\u91CF\u7684\u6E20\u9053\u5207\u6362\uFF1B\u8C03\u4F4E\u9884\u7B97\u53EF\u8BA9\u66F4\u591A\u6E20\u9053\u53C2\u4E0E\u3002\u4E0D\u4F1A\u5220\u9664\u4F1A\u8BDD\u5386\u53F2\u3002" }),
2512
- draft.contextMode === "custom" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
2513
- "\u4E0A\u4E0B\u6587\u9884\u7B97\uFF08Token\uFF09",
2514
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "number", disabled: busy, min: "1", required: true, value: draft.contextWindow, onChange: (e) => set("contextWindow", Number(e.target.value)) })
2515
- ] })
2516
- ] }),
2517
2522
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", { children: [
2518
2523
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", { children: "\u9AD8\u7EA7\uFF1A\u8F93\u51FA\u957F\u5EA6" }),
2519
2524
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid", style: { marginTop: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [