@lynn123411/dsh-subagent-judge-dispatch 0.4.0 → 0.4.2
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/DETAILS.md +4 -2
- package/assets/icon.svg +5 -4
- package/lib/client.js +31 -29
- package/lib/client.js.map +2 -2
- package/package.json +1 -1
package/DETAILS.md
CHANGED
|
@@ -52,7 +52,9 @@ dsh plugin --profile web add @lynn123411/dsh-subagent-judge-dispatch
|
|
|
52
52
|
- **保存按下之后**:密钥先写,再写设置。密钥没写进去就不再动设置;设置被宿主拒绝(共享配置表单 resolve `false` 是拒绝,不是异常)时页面必须报没存上,不能显示成已保存。
|
|
53
53
|
- **草稿按字段保留**:宿主每次发布配置,只有读者改过、且改动与「本页上次看到的已提交值」不同的那一项才留在页面上,其余跟着宿主走。按整节保留会让一次保存把读者没碰过的字段写回去,等于撤掉别的页面刚做的改动。
|
|
54
54
|
- **放弃改动只丢草稿**:放弃判断服务那一节,只清掉还没交出去的文本与那几项设置;密钥已经存进凭据文件,页面因此不会改口说「还没有密钥」。
|
|
55
|
-
-
|
|
55
|
+
- **试通跟着判断服务那一节走**:按钮放在这一节保存行的右端,左边写下去、右边问一句。试通不落盘(它只是问一句),但要求先把改动保存下来。它在标题栏下面,而不是标题那一行:那里是整节的标题,不是一套设置的出口。
|
|
56
|
+
- **导入、导出、加一行排在任务类型那一节保存行的右端**:三件都只动这份清单——导入把它填回草稿,导出把草稿抄成 JSON,加一行往下续一条——所以它们跟这一节的保存同一行,顺序固定为「导入、导出、加一行」:前两件是同一件事的两个方向,加一行是往表里添新的一行,放在最后不打断这一对。
|
|
57
|
+
- **预览单独排在卡片最下面**:它同时读判断模型与整份类型清单,哪一节都不独占,所以不进任何一节的保存行。它要求先把改动保存下来,那句提醒就跟在它左边。这一排按卡片宽度靠右对齐。
|
|
56
58
|
- **判断日志是一张六列表**:结果(`类型 3` / `未判成`)、选择(`模型 · 强度`,悬停补上供应商)、主代理、子代理、时间、耗时。结果在最左,读者扫一眼先看「判成了没有」;选择一栏只写各条之间真正不同的两样,供应商几乎每行都一样,悬停才把整段路 `供应商 · 模型 · 强度` 写出来。没判成的原因同样不在格子里展开,悬停才说——那一列宽度是给编号留的。放不下的格子截断,气泡用宿主的 `Tooltip`(原生 `title` 键盘够不到)。
|
|
57
59
|
- **点一行看的是这段提示词**:弹窗里只有这次真正发给判断模型的请求体,任务文字也在里面。正文按字符折行,不给长行留横向滚动;高度超出一屏就在框里竖向滚动,滚动条的深浅跟着弹窗这层表面走。结果、选择、主代理这几项行上已经有了,弹窗不再各列一遍。这条请求体由发出请求的那一处格式化后原样存进日志,页面没有第二次拼装的机会——`scripts/smoke-host.mjs` 断言日志里那一段与发出去的请求体同值。
|
|
58
60
|
- **导入导出走纯文本**:导出把清单按 `[{ description, provider, model, effort }]` 复制进剪贴板,不带编号——编号是按位置排的,写出去会让读者以为它是设置的一部分。导入是一个只收粘贴的弹窗:不读文件、不联网,粘进来的 JSON 先过形状检查(必须是数组、每条是对象、四个字段是文字、不能有整条全空的行),合格就整份换进草稿,按「保存」之前一个字都不写。三种坏输入(不是 JSON、形状不对、空清单)各自说一句不同的话,不合并成「格式有误」。
|
|
@@ -84,7 +86,7 @@ cd plugins/dsh-subagent-judge-dispatch && pnpm check
|
|
|
84
86
|
- **`scripts/smoke-client.mjs`** 按 Web shell 的方式装载 `lib/client.js`(`window.__ModuleLoader__.load` 桩件),喂假 cordis 服务:断言卡片注册进 `plugins.bundle.config`、key 是包名、走 `slots.inject`、读本插件自己的命名空间与宿主那份「子代理可选用哪些模型」设置、以宿主在服务本条目为挂载条件、样式表在 `apply()` 追加一次且没写死色值,以及 zh/en 键集一致。它的守卫带反例断言(「守卫拒绝未声明的服务读取」必须抛),否则那一串绿灯是假的。
|
|
85
87
|
|
|
86
88
|
- **`scripts/test-card.mjs`** 打的是 `src/`,守配置卡片这层状态机:两节各存各的、清单没填全不挡端点、宿主回 `false` 算没存上、密钥跟着判断服务那次保存一起写且写的是固定引用名、密钥值从不进页面状态、草稿按字段保留(宿主改了一项而我在改另一项时,保存只写我改的那一项),「选择」一列只写模型与强度、悬停才带上供应商且两条路都不留悬空的分隔点,以及清单的 JSON 导出与导入各自认什么、拒什么。
|
|
87
|
-
- **`scripts/test-render.mjs`** 用真 react 把卡片画进 jsdom
|
|
89
|
+
- **`scripts/test-render.mjs`** 用真 react 把卡片画进 jsdom:试通在判断服务那一节的保存行里、导入导出与加一行按固定顺序排在任务类型那一节的保存行右端、标题栏没有按钮,预览单独在卡片最下面那条栏里,日志表是六列且顺序固定,结果写「类型 3」/「未判成」,选择格只写模型与强度、供应商在悬停气泡里,导出把清单按纯 JSON 写进剪贴板、导入只填草稿且三种坏输入各报各的话,没判成的原因挂在宿主的 `Tooltip` 上而不是原生 `title`,弹窗里只有那段提示词且不把行上的栏目再列一遍。`ui-primitives` 走替身(真组件是浏览器 ESM、带 `.css` 导入,Node 里跑不起来),所以它验的是本插件的视图结构,外观与浮层定位要在真浏览器里看。
|
|
88
90
|
|
|
89
91
|
`lib/` 是构建镜像,`assert:lib-untracked` 判它没被 git 跟踪。
|
|
90
92
|
|
package/assets/icon.svg
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke
|
|
2
|
-
<rect x="
|
|
3
|
-
<path d="M12 8.
|
|
4
|
-
<
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<rect x="8.6" y="2.6" width="6.8" height="6.2" rx="1.8" fill="#4C46C8" stroke="#332C9E" stroke-width="1"/>
|
|
3
|
+
<path d="M12 8.8v3.4M12 12.2l-4.6 4.6M12 12.2l4.6 4.6" stroke="#8A82F2" stroke-width="1.6"/>
|
|
4
|
+
<circle cx="6.4" cy="18" r="2.4" fill="#F5A623" stroke="#BE7710" stroke-width="1"/>
|
|
5
|
+
<circle cx="17.6" cy="18" r="2.4" fill="#19A974" stroke="#0E7A52" stroke-width="1"/>
|
|
5
6
|
</svg>
|
package/lib/client.js
CHANGED
|
@@ -904,7 +904,7 @@ function LogCell({ text, hint }) {
|
|
|
904
904
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tooltip, { label, side: "top", portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-cell-clip", children: text }) });
|
|
905
905
|
}
|
|
906
906
|
var CARD_CSS = `
|
|
907
|
-
.dsh-judge-card { display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; width: 100%;
|
|
907
|
+
.dsh-judge-card { display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; width: 100%; color: var(--dsw-alias-label-primary); }
|
|
908
908
|
.dsh-judge-panel { display: flex; flex-direction: column; gap: 16px; }
|
|
909
909
|
.dsh-judge-section {
|
|
910
910
|
display: flex;
|
|
@@ -934,6 +934,9 @@ var CARD_CSS = `
|
|
|
934
934
|
/* \u8FD9\u4E00\u8282\u7684\u51FA\u53E3\uFF1A\u5DE6\u8FB9\u5199\u4E0B\u53BB\uFF0C\u53F3\u8FB9\u67E5\u5DF2\u6709\u7684\u2014\u2014\u4E24\u4E2A\u65B9\u5411\u5206\u5F00\uFF0C\u6309\u9519\u4E00\u4E2A\u4E0D\u4F1A\u4E32\u5230\u53E6\u4E00\u4E2A\u3002 */
|
|
935
935
|
.dsh-judge-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 0.5px solid var(--dsw-alias-border-l3); }
|
|
936
936
|
.dsh-judge-actions-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
937
|
+
/* \u5361\u7247\u6700\u4E0B\u9762\u7684\u51FA\u53E3\uFF1A\u53EA\u6709\u9884\u89C8\u8FD9\u4E00\u4EF6\u8DE8\u8282\u7684\u52A8\u4F5C\uFF0C\u9760\u53F3\u4E0E\u4E24\u8282\u7684\u53F3\u8FB9\u7F18\u5BF9\u9F50\uFF1B\u8981\u5148\u628A\u6539\u52A8
|
|
938
|
+
\u5B58\u4E0B\u53BB\u65F6\uFF0C\u90A3\u53E5\u63D0\u9192\u5728\u5B83\u5DE6\u8FB9\u3002 */
|
|
939
|
+
.dsh-judge-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
|
|
937
940
|
.dsh-judge-hint { color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); }
|
|
938
941
|
.dsh-judge-note-ok { color: var(--dsw-alias-state-success-primary); font: var(--dsw-font-xxs-12); }
|
|
939
942
|
.dsh-judge-note-bad { color: var(--dsw-alias-state-error-primary); font: var(--dsw-font-xxs-12); }
|
|
@@ -1303,29 +1306,16 @@ function JudgeDispatchPanel(props) {
|
|
|
1303
1306
|
] })
|
|
1304
1307
|
] }),
|
|
1305
1308
|
probeResult !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: probeResult.ok ? "dsh-judge-note-ok" : "dsh-judge-note-bad", children: probeResult.ok ? t("judge.probeOk").replace("{latency}", String(probeResult.latencyMs)) : t("judge.probeFail").replace("{reason}", reasonText(probeResult.reason)) }),
|
|
1306
|
-
state.
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
}
|
|
1317
|
-
),
|
|
1318
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1319
|
-
import_dsh_client_ui_primitives.Button,
|
|
1320
|
-
{
|
|
1321
|
-
variant: "outline",
|
|
1322
|
-
size: "sm",
|
|
1323
|
-
disabled: state.dirty,
|
|
1324
|
-
onClick: () => void openPreview(),
|
|
1325
|
-
children: t("preview.open")
|
|
1326
|
-
}
|
|
1327
|
-
)
|
|
1328
|
-
] }))
|
|
1309
|
+
saveRow("judge", state.judgeDirty, () => void dispatchCardStore.save("judge"), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1310
|
+
import_dsh_client_ui_primitives.Button,
|
|
1311
|
+
{
|
|
1312
|
+
variant: "outline",
|
|
1313
|
+
size: "sm",
|
|
1314
|
+
disabled: probing || state.dirty,
|
|
1315
|
+
onClick: () => void runProbe(),
|
|
1316
|
+
children: probing ? t("judge.probing") : t("judge.probe")
|
|
1317
|
+
}
|
|
1318
|
+
))
|
|
1329
1319
|
] }),
|
|
1330
1320
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-section", children: [
|
|
1331
1321
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-title", children: t("rows.title") }),
|
|
@@ -1342,14 +1332,26 @@ function JudgeDispatchPanel(props) {
|
|
|
1342
1332
|
] }) }),
|
|
1343
1333
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: state.rows.map((draft, index) => row(draft, index)) })
|
|
1344
1334
|
] }),
|
|
1345
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
1346
|
-
|
|
1335
|
+
state.rowsInvalid !== "" && state.rowsDirty && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-note-bad", role: "alert", children: state.rowsInvalid }),
|
|
1336
|
+
saveRow("rows", state.rowsDirty, saveRows, /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1347
1337
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: openImport, children: t("rows.importOpen") }),
|
|
1348
1338
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => void exportRows(), children: t("rows.export") }),
|
|
1339
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => dispatchCardStore.addRow(), children: t("rows.add") }),
|
|
1349
1340
|
copyNote !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: copyNote.ok ? "dsh-judge-note-ok" : "dsh-judge-note-bad", role: "status", children: copyNote.text })
|
|
1350
|
-
] })
|
|
1351
|
-
|
|
1352
|
-
|
|
1341
|
+
] }))
|
|
1342
|
+
] }),
|
|
1343
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-footer", children: [
|
|
1344
|
+
state.dirty && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-hint", children: t("preview.blocked") }),
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1346
|
+
import_dsh_client_ui_primitives.Button,
|
|
1347
|
+
{
|
|
1348
|
+
variant: "outline",
|
|
1349
|
+
size: "sm",
|
|
1350
|
+
disabled: state.dirty,
|
|
1351
|
+
onClick: () => void openPreview(),
|
|
1352
|
+
children: t("preview.open")
|
|
1353
|
+
}
|
|
1354
|
+
)
|
|
1353
1355
|
] })
|
|
1354
1356
|
] });
|
|
1355
1357
|
const log = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-panel", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-section", children: [
|
package/lib/client.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/client/index.ts", "../src/client/settings/ui.tsx", "../src/client/settings/plugin-page.ts", "../src/server/judge-prompt.ts", "../src/server/credentials.ts", "../src/client/settings/store.ts", "../src/client/locales.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Context as ClientContext } from '@deepseek-ai/cordis';\n// \u7C7B\u578B\u53EA\u8BFB\uFF1A\u8FD9\u4E9B\u5305\u7684\u6D4F\u89C8\u5668\u534A\u8FB9\u628A\u5EA7\u4F4D\u5951\u7EA6\u4E0E `ctx.configForms` \u5408\u5E76\u8FDB Context\u3002\nimport type {} from '@deepseek-ai/dsh-client-locale/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client';\nimport { injectCardStyles, setupSettingsUi } from './settings/ui.tsx';\nimport { apply as registerDictionaries, en, zh } from './locales.ts';\n\n/**\n * \u6D4F\u89C8\u5668\u534A\u8FB9\uFF1A\u628A\u914D\u7F6E\u5361\u7247\u6302\u5230\u5BBF\u4E3B\u7684\u300C\u63D2\u4EF6\u300D\u9875\u4E0A\u3002\n *\n * `inject` \u662F cordis \u670D\u52A1\u540D\uFF08`remote.credentials` \u662F\u5224\u65AD\u5BC6\u94A5\u7684\u5199\u5165\u901A\u9053\uFF09\uFF1B\n * `package.json` \u7684 `dsh.client.inject` \u662F\u5305\u540D\u3002\n * \u4E24\u5C42\u90FD\u8981\u58F0\u660E\uFF0C\u6F0F\u4E00\u5C42\u6574\u6761 loader entry \u4F1A\u9759\u9ED8\u53D8\u6210 failed\uFF0C\u9875\u9762\u4E0A\u4EC0\u4E48\u4E5F\u770B\u4E0D\u89C1\n * \uFF08\u89C1 docs/rules/client-wiring.md\uFF09\u3002\n */\nexport const name = '@lynn123411/dsh-subagent-judge-dispatch';\nexport const inject = ['slots', 'configForms', 'remote', 'remote.session', 'remote.credentials', 'locale'];\n\n/**\n * \u63D2\u4EF6\u672C\u4F53\uFF1A\u6CE8\u518C\u5B57\u5178\uFF0C\u518D\u6302\u914D\u7F6E\u5361\u7247\u3002\n * @param ctx - \u5BA2\u6237\u7AEF\u6839\u4E0A\u4E0B\u6587\u3002\n */\nexport function apply(ctx: ClientContext): void {\n injectCardStyles();\n registerDictionaries(ctx);\n ctx.effect(\n () => {\n setupSettingsUi(ctx as never);\n return () => {};\n },\n 'dsh-subagent-judge-dispatch: plugins page config',\n );\n}\n\nexport { NS } from './locales.ts';\nexport { en, zh } from './locales.ts';\n\n/** \u5B57\u5178\u672C\u4F53\uFF0C\u968F bundle \u5BFC\u51FA\u4F9B\u81EA\u68C0\u6838\u5BF9\u952E\u96C6\u3002 */\nexport const __dictionaries = { en, zh };\nexport { JudgeDispatchPanel, injectCardStyles, setupSettingsUi } from './settings/ui.tsx';\nexport {\n ALLOWED_MODELS_NAMESPACE,\n buildModelOptions,\n createDispatchRemote,\n describeChoice,\n describeModel,\n dispatchCardStore,\n readRow,\n SETTINGS_NAMESPACE,\n validateRows,\n} from './settings/store.ts';\n", "import { useEffect, useState } from 'react';\nimport * as React from 'react';\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';\nimport {\n Button,\n CodeBlock,\n Input,\n Menu,\n Modal,\n SegmentedTabs,\n Switch,\n Tag,\n Tooltip,\n writeClipboard,\n} from '@deepseek-ai/dsh-client-ui-primitives';\nimport {\n BUNDLE_CONFIG_KEY,\n BUNDLE_CONFIG_SLOT,\n setupPluginPage,\n} from './plugin-page.ts';\nimport {\n ALLOWED_MODELS_NAMESPACE,\n createDispatchRemote,\n describeChoice,\n describeModel,\n dispatchCardStore,\n exportRowsJson,\n JUDGE_API_KEY_REF,\n parseRowsJson,\n type CredentialsRemoteLike,\n routeKey,\n SETTINGS_NAMESPACE,\n splitRouteKey,\n type LogRow,\n type PageState,\n type Section,\n type TypeRowDraft,\n} from './store.ts';\nimport { NS } from '../locales.ts';\n\n/** \u5BFC\u5165\u88AB\u62D2\u65F6\u90A3\u53E5\u8BDD\u7684\u952E\uFF1A\u4E09\u79CD\u574F\u8F93\u5165\u5404\u8BF4\u5404\u7684\uFF0C\u4E0D\u5728\u8C03\u7528\u5904\u62FC\u952E\u540D\u3002 */\nconst IMPORT_ERROR_KEYS = {\n json: 'rows.importBadJson',\n shape: 'rows.importBadShape',\n empty: 'rows.importEmpty',\n} as const;\n\n/** Path shown in the key hint; the value itself never reaches the page. */\nconst CREDENTIALS_PATH = '~/.dsh/.credentials.yaml';\n\n/** One localized template with technical samples rendered inline. */\nfunction withSamples(text: string, samples: Record<string, string>): React.ReactNode {\n return text.split(/(\\{\\w+\\})/g).map((part, index) => {\n const name = /^\\{\\w+\\}$/.test(part) ? part.slice(1, -1) : '';\n const sample = name === '' ? undefined : samples[name];\n return sample === undefined ? part : <code key={index}>{sample}</code>;\n });\n}\n\n/**\n * One log cell: the text clips to its column, and the whole value is one hover\n * away.\n *\n * The bubble is the Host's `Tooltip`, not a native `title`: the Host's own rule\n * is that a hover surface comes from the primitives package, and the native one\n * cannot be reached by keyboard. It carries `hint` when the cell has something\n * the column itself has no room for \u2014 the reason a judgement did not match, or\n * the provider behind a choice cell that shows only model and effort \u2014 and the\n * cell's own text otherwise.\n *\n * @param props.text - the value shown in the cell.\n * @param props.hint - extra text the bubble should carry instead of `text`.\n * @returns the cell.\n */\nfunction LogCell({ text, hint }: { text: string; hint?: string }): React.ReactElement {\n const label = hint === undefined || hint === '' ? text : hint;\n return (\n <Tooltip label={label} side=\"top\" portal>\n <span className=\"dsh-judge-cell-clip\">{text}</span>\n </Tooltip>\n );\n}\n\n/**\n * The card's own styles.\n *\n * Only the shapes the Host's controls do not carry: the settings-card material\n * (R20, the settings stroke and fill), the section and field rows, and the\n * task-type table. Every colour resolves through a `--dsw-alias-*` token, and\n * every elevated surface uses the settings-card material rather than a border\n * plus a shadow.\n */\nconst CARD_CSS = `\n.dsh-judge-card { display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; width: 100%; max-width: 760px; color: var(--dsw-alias-label-primary); }\n.dsh-judge-panel { display: flex; flex-direction: column; gap: 16px; }\n.dsh-judge-section {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px 18px;\n border: 0.5px solid var(--dsw-alias-settings-card-stroke);\n border-radius: var(--dsw-radius-xl);\n background: var(--dsw-alias-settings-card-fill);\n}\n.dsh-judge-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.dsh-judge-title { font: var(--dsw-font-s-strong-14); }\n.dsh-judge-desc { max-width: 46em; color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-desc code { font-family: var(--ds-font-family-code); }\n.dsh-judge-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }\n.dsh-judge-row + .dsh-judge-row { padding-top: 12px; border-top: 0.5px solid var(--dsw-alias-border-l3); }\n.dsh-judge-row-info { flex: 1; min-width: 0; }\n.dsh-judge-row-title { font: var(--dsw-font-xs-strong-13); }\n.dsh-judge-row-hint { margin-top: 2px; color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-row-field { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; box-sizing: border-box; width: 360px; max-width: 100%; }\n/* \u5BBF\u4E3B\u7684 Input \u628A\u8F93\u5165\u6846\u5305\u5728\u4E00\u5C42 inline-flex \u7684 span \u91CC\uFF0C\u7C7B\u540D\u843D\u5728\u90A3\u5C42 span \u4E0A\uFF0C\n \u6240\u4EE5\u8981\u6491\u7684\u662F\u5B83\uFF0C\u53EA\u7ED9 input \u5199\u5BBD\u5EA6\u6CA1\u7528\u3002 */\n.dsh-judge-field { display: flex; box-sizing: border-box; width: 100%; min-width: 0; }\n.dsh-judge-field input { box-sizing: border-box; width: 100%; min-width: 0; }\n.dsh-judge-key-line { display: flex; align-items: center; gap: 8px; box-sizing: border-box; width: 100%; }\n.dsh-judge-off { display: block; color: var(--dsw-alias-state-warn-label); font: var(--dsw-font-xxxs-11); white-space: nowrap; }\n/* \u8FD9\u4E00\u8282\u7684\u51FA\u53E3\uFF1A\u5DE6\u8FB9\u5199\u4E0B\u53BB\uFF0C\u53F3\u8FB9\u67E5\u5DF2\u6709\u7684\u2014\u2014\u4E24\u4E2A\u65B9\u5411\u5206\u5F00\uFF0C\u6309\u9519\u4E00\u4E2A\u4E0D\u4F1A\u4E32\u5230\u53E6\u4E00\u4E2A\u3002 */\n.dsh-judge-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 0.5px solid var(--dsw-alias-border-l3); }\n.dsh-judge-actions-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n.dsh-judge-hint { color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-note-ok { color: var(--dsw-alias-state-success-primary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-note-bad { color: var(--dsw-alias-state-error-primary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-field-wrap { display: flex; box-sizing: border-box; width: 100%; min-width: 0; }\n.dsh-judge-table { box-sizing: border-box; width: 100%; border-collapse: collapse; table-layout: fixed; }\n.dsh-judge-table th, .dsh-judge-table td { box-sizing: border-box; }\n.dsh-judge-table th {\n padding: 0 8px 6px 0;\n color: var(--dsw-alias-label-tertiary);\n font: var(--dsw-font-xxs-12);\n text-align: left;\n}\n.dsh-judge-table td { padding: 6px 8px 6px 0; vertical-align: middle; }\n.dsh-judge-table tbody tr + tr td { border-top: 0.5px solid var(--dsw-alias-border-l3); }\n.dsh-judge-table td:last-child, .dsh-judge-table th:last-child { padding-right: 0; }\n.dsh-judge-col-no { width: 52px; }\n.dsh-judge-col-model { width: 188px; }\n.dsh-judge-col-effort { width: 124px; }\n.dsh-judge-col-actions { width: 148px; }\n.dsh-judge-no { color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); font-variant-numeric: tabular-nums; }\n.dsh-judge-row-off .dsh-judge-field { opacity: 0.6; }\n.dsh-judge-cell-actions { display: flex; gap: 6px; }\n.dsh-judge-log { display: flex; flex-direction: column; gap: 4px; font: var(--dsw-font-xxs-12); }\n/* \u516D\u5217\u7684\u5BBD\u5EA6\u6309\u5185\u5BB9\u5B9A\uFF1A\u7ED3\u679C\u4E0E\u65F6\u95F4\u662F\u5B9A\u957F\u7684\uFF0C\u9009\u62E9\u6700\u957F\u3001\u4E3B\u4EE3\u7406\u4E0E\u5B50\u4EE3\u7406\u5404\u5360\u4E00\u4EFD\u4F59\u91CF\u3002\n minmax(0, \u2026) \u662F\u622A\u65AD\u7684\u524D\u63D0\u2014\u2014\u4E0D\u7ED9\u4E0B\u9650\u5F52\u96F6\uFF0C\u957F\u5185\u5BB9\u4F1A\u628A\u6574\u5217\u6491\u51FA\u53BB\u3002 */\n.dsh-judge-log-row { display: grid; grid-template-columns: 72px minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 62px 74px; gap: 8px; align-items: center; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: var(--dsw-radius-sm); cursor: pointer; color: inherit; font: inherit; }\n.dsh-judge-cell-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-judge-log-row:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dsh-judge-log-head { font-weight: 600; color: var(--dsw-alias-label-tertiary); cursor: default; }\n.dsh-judge-log-head:hover { background: none; }\n/* \u5F39\u7A97\u91CC\u662F\u4E00\u6574\u6BB5\u8BF7\u6C42\u4F53\uFF1A\u91CF\u5BBD\u653E\u5F00\uFF0C\u6B63\u6587\u81EA\u5DF1\u6362\u884C\uFF0C\u9AD8\u4E86\u5C31\u5728\u6846\u91CC\u6EDA\u52A8\u2014\u2014\u6491\u5230\u5F39\u7A97\n \u5916\u9762\u7684\u5185\u5BB9\u65E2\u770B\u4E0D\u89C1\u4E5F\u6EDA\u4E0D\u5230\u3002\u6EDA\u52A8\u6761\u7684\u4E24\u79CD\u989C\u8272\u8DDF\u7740\u5F39\u7A97\u8FD9\u5C42\u8868\u9762\u8D70\u3002 */\n.dsh-judge-modal { width: min(760px, 100%); max-height: min(85vh, 100%); --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2); --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2); }\n.dsh-judge-prompt { max-height: 58vh; overflow: auto; }\n.dsh-judge-prompt pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }\n/* \u7C98\u8D34\u6846\uFF1A\u7B49\u5BBD\u663E\u793A\uFF0C\u597D\u8BA9\u8BFB\u8005\u770B\u51FA JSON \u7684\u5C42\u7EA7\uFF1B\u81EA\u5DF1\u6491\u9AD8\u5230\u4E00\u5C4F\u7684\u4E00\u534A\u518D\u6EDA\u52A8\u3002 */\n.dsh-judge-paste { box-sizing: border-box; width: 100%; min-height: 220px; max-height: 45vh; resize: vertical; padding: 10px 12px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: var(--dsw-font-markdown-code-block); }\n.dsh-judge-paste:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary); }\n`;\n\n/**\n * Append this card's stylesheet once, at apply() time.\n *\n * Injection happens here rather than on first render because the host's own\n * stylesheets are already-loaded `<link>` elements: a plugin sheet appended\n * later wins at equal specificity, and doing it once in apply() keeps that\n * order stable across remounts. The id makes the append idempotent.\n */\nexport function injectCardStyles(): void {\n if (typeof document === 'undefined') return;\n if (document.getElementById(STYLE_ID) !== null) return;\n const element = document.createElement('style');\n element.id = STYLE_ID;\n // \u4E24\u4E2A\u5F52\u5C5E\u952E\u7F3A\u4E00\u4E0D\u53EF\uFF1Aclient-modules \u6309 `data-plugin` \u5728\u5378\u8F7D\u4E0E\u6362\u4EE3\u7801\u65F6\u6574\u8868\u6E05\u6389\uFF0C\n // \u6CA1\u6253\u952E\u7684\u8868\u4F1A\u4E00\u76F4\u53E0\u5728\u9875\u9762\u4E0A\uFF08docs/rules/plugin-ui.md\u300C\u6837\u5F0F\u5728 apply() \u91CC\u6CE8\u5165\u300D\uFF09\u3002\n element.dataset.plugin = PLUGIN_NAME;\n element.dataset.pluginCss = `${PLUGIN_NAME}/settings/ui`;\n element.textContent = CARD_CSS;\n document.head.appendChild(element);\n}\n\n/** DOM id of this card's stylesheet, so a remount does not append a second one. */\nconst STYLE_ID = 'dsh-subagent-judge-dispatch-styles';\n\n/** \u672C\u63D2\u4EF6\u7684\u5305\u540D\uFF0C\u7528\u4F5C\u6837\u5F0F\u8868\u7684\u5F52\u5C5E\u952E\u3002 */\nconst PLUGIN_NAME = '@lynn123411/dsh-subagent-judge-dispatch';\n\n/**\n * This plugin's configuration card inside the DSH **Plugins** page.\n *\n * Two tabs. The design tab holds two independently saved sections \u2014 the\n * judgement service, and the task-type table \u2014 because each is edited on its own\n * occasion and fails on its own terms; a single save for both would let an\n * unfinished description block an endpoint change. The log tab reads the Host's\n * runtime log. Nothing is written while the reader types.\n *\n * @param props - the renderer-bound seat of `plugins.bundle.config`.\n * @returns the card element.\n */\nexport function JudgeDispatchPanel(\n props: PropsRuntime<'plugins.bundle.config'> & PropsLocale<typeof NS>,\n): React.ReactElement {\n const { t } = props;\n\n const [state, setState] = useState<PageState>(() => dispatchCardStore.getState());\n const [tab, setTab] = useState<'design' | 'log'>('design');\n const [browsing, setBrowsing] = useState<number | null>(null);\n const [preview, setPreview] = useState<string | null>(null);\n const [previewOpen, setPreviewOpen] = useState(false);\n const [probing, setProbing] = useState(false);\n const [probeResult, setProbeResult] = useState<{ ok: boolean; latencyMs: number; reason?: string } | null>(null);\n const [detail, setDetail] = useState<LogRow | null>(null);\n /** Which row's dropdown is open, and which of the two. */\n const [openMenu, setOpenMenu] = useState<{ index: number; kind: 'model' | 'effort' } | null>(null);\n /** The reason a save was refused, shown as a popup. */\n const [refusal, setRefusal] = useState<string | null>(null);\n /** The paste box for importing a task-type list; null when it is closed. */\n const [importText, setImportText] = useState<string | null>(null);\n /** Why the last import attempt was refused, or ''. */\n const [importError, setImportError] = useState('');\n /** What the last export did, shown until the next action. */\n const [copyNote, setCopyNote] = useState<{ ok: boolean; text: string } | null>(null);\n\n useEffect(() => {\n setState(dispatchCardStore.getState());\n return dispatchCardStore.subscribe(() => setState(dispatchCardStore.getState()));\n }, []);\n\n useEffect(() => {\n if (tab === 'log') void dispatchCardStore.refreshLog();\n }, [tab]);\n\n /** Localized reason text for one fallback. */\n const reasonText = (reason: string | undefined): string =>\n t(`reason.${reason ?? 'other'}` as never) || t('reason.unknown');\n\n const runProbe = async (): Promise<void> => {\n setProbing(true);\n setProbeResult(await dispatchCardStore.probe());\n setProbing(false);\n };\n\n /** \u7C7B\u578B\u6E05\u5355\u6709\u7F3A\u65F6\u6309\u6309\u94AE\u4E0D\u7ED9\u5199\uFF1A\u628A\u539F\u56E0\u5F39\u51FA\u6765\uFF0C\u800C\u4E0D\u662F\u8BA9\u6309\u94AE\u70B9\u4E0D\u52A8\u3002 */\n const saveRows = (): void => {\n if (state.rowsInvalid !== '') {\n setRefusal(state.rowsInvalid);\n return;\n }\n void dispatchCardStore.save('rows');\n };\n\n const openPreview = async (): Promise<void> => {\n const text = await dispatchCardStore.preview();\n setPreview(text ?? t('preview.failed'));\n setPreviewOpen(true);\n };\n\n /** Copy the task-type list out as plain JSON. */\n const exportRows = async (): Promise<void> => {\n const copied = await writeClipboard(exportRowsJson(state.rows));\n setCopyNote({ ok: copied, text: t(copied ? 'rows.exported' : 'rows.exportFailed') });\n };\n\n /** Open the paste box, empty and with no leftover complaint. */\n const openImport = (): void => {\n setImportText('');\n setImportError('');\n setCopyNote(null);\n };\n\n /** Read the pasted list into the drafts; the section's save is still separate. */\n const applyImport = (): void => {\n const result = parseRowsJson(importText ?? '');\n if (!result.ok) {\n setImportError(t(IMPORT_ERROR_KEYS[result.error] as never));\n return;\n }\n dispatchCardStore.replaceRows(result.rows);\n setImportText(null);\n setImportError('');\n };\n\n /** One section's save row: the write and the discard on the left, that section's checks on the right. */\n const saveRow = (\n section: Section,\n dirty: boolean,\n onSave: () => void,\n checks?: React.ReactNode,\n ): React.ReactElement => (\n <div className=\"dsh-judge-actions\">\n <div className=\"dsh-judge-actions-group\">\n {/* \u7C7B\u578B\u6E05\u5355\u6709\u7F3A\u65F6\u6309\u94AE\u4ECD\u53EF\u70B9\uFF1A\u6309\u4E0B\u53BB\u7531 saveRows \u5F39\u7A97\u8BF4\u660E\u4E3A\u4EC0\u4E48\u5B58\u4E0D\u4E86\u3002\n \u505A\u6210 disabled \u7684\u8BDD\uFF0C\u8BFB\u8005\u53EA\u770B\u5230\u4E00\u4E2A\u70B9\u4E0D\u52A8\u7684\u6309\u94AE\uFF0C\u4E0D\u77E5\u9053\u8981\u6539\u54EA\u91CC\u3002 */}\n <Button\n variant=\"primary\"\n size=\"sm\"\n disabled={state.saving !== '' || !dirty || !state.writable}\n onClick={onSave}\n >\n {state.saving === section ? t('save.saving') : t('save.button')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={state.saving !== '' || !dirty}\n onClick={() => dispatchCardStore.revert(section)}\n >\n {t('save.discard')}\n </Button>\n {dirty && <span className=\"dsh-judge-hint\">{t('save.unsaved')}</span>}\n {/* \u5931\u8D25\u6309\u8282\u62A5\uFF1A\u5224\u65AD\u670D\u52A1\u90A3\u6B21\u4FDD\u5B58\u6CA1\u843D\u5730\u65F6\uFF0C\u4EFB\u52A1\u7C7B\u578B\u90A3\u4E00\u8282\u4E0D\u8BE5\u8DDF\u7740\u62A5\u9519\u3002 */}\n {state.saveFailed === section && state.saveError !== '' && (\n <span className=\"dsh-judge-note-bad\" role=\"alert\">\n {t('save.failed').replace('{error}', state.saveError)}\n </span>\n )}\n </div>\n {checks !== undefined && <div className=\"dsh-judge-actions-group\">{checks}</div>}\n </div>\n );\n\n /** One task-type row as three cells plus its row number and its actions. */\n const row = (draft: TypeRowDraft, index: number): React.ReactElement => {\n const efforts = dispatchCardStore.effortsFor(draft);\n const usable = dispatchCardStore.rowUsable(draft);\n // \u53EA\u6709\u300C\u76EE\u5F55\u8BFB\u5230\u4E86\u3001\u4E14\u8FD9\u4E2A\u8DEF\u7531\u786E\u5B9E\u58F0\u660E\u4E86\u6863\u4F4D\u300D\u65F6\u624D\u7ED9\u4E0B\u62C9\uFF1B\u5426\u5219\u81EA\u7531\u586B\u5199\u3002\n const catalogOffersEffort = state.catalogRead && efforts.length > 0;\n return (\n <tr key={index} className={usable ? undefined : 'dsh-judge-row-off'}>\n <td className=\"dsh-judge-col-no\">\n <span className=\"dsh-judge-no\">{index + 1}</span>\n {usable ? null : <span className=\"dsh-judge-off\">{t('rows.incomplete')}</span>}\n </td>\n <td>\n <Input\n type=\"text\"\n className=\"dsh-judge-field\"\n value={draft.description}\n placeholder={t('rows.descriptionPlaceholder')}\n aria-label={`${t('rows.colDescription')} ${index + 1}`}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.cell(index, 'description', event.target.value)}\n />\n </td>\n <td>\n <Menu\n open={openMenu?.index === index && openMenu.kind === 'model'}\n anchor={<Input\n type=\"text\"\n className=\"dsh-judge-field\"\n readOnly\n value={draft.model === '' ? '' : `${draft.provider}/${draft.model}`}\n placeholder={t('rows.modelPlaceholder')}\n aria-label={`${t('rows.colModel')} ${index + 1}`}\n aria-haspopup=\"listbox\"\n aria-expanded={openMenu?.index === index && openMenu.kind === 'model'}\n onClick={() => setOpenMenu({ index, kind: 'model' })}\n onFocus={() => setOpenMenu({ index, kind: 'model' })}\n />}\n items={[\n { type: 'label', id: 'model', text: t('rows.colModel') },\n ...(state.models.length === 0\n ? []\n : state.models.map((option) => ({\n id: routeKey(option.provider, option.model),\n label: `${option.provider}/${option.label}`,\n }))),\n ]}\n selectedId={draft.model === '' ? undefined : routeKey(draft.provider, draft.model)}\n onSelect={(id) => {\n const { provider, model } = splitRouteKey(id);\n dispatchCardStore.cell(index, 'provider', provider);\n dispatchCardStore.cell(index, 'model', model);\n setOpenMenu(null);\n }}\n onClose={() => setOpenMenu(null)}\n className=\"dsh-judge-field-wrap\"\n portal\n />\n </td>\n {/* \u76EE\u5F55\u8BFB\u5F97\u5230\u65F6\uFF0C\u5F3A\u5EA6\u662F\u8FD9\u4EFD\u53EF\u9009\u6863\u4F4D\u91CC\u7684\u4E00\u4E2A\uFF1B\u8BFB\u4E0D\u5230\uFF08\u6216\u8FD9\u4E2A\u8DEF\u7531\u6CA1\u58F0\u660E\u6863\u4F4D\uFF09\n \u65F6\u9000\u56DE\u81EA\u7531\u586B\u5199\u2014\u2014\u628A\u683C\u5B50\u7981\u6389\u4F1A\u8BA9\u6574\u5F20\u8868\u6C38\u8FDC\u586B\u4E0D\u5168\uFF0C\u4E5F\u5C31\u6C38\u8FDC\u4E0D\u518D\u5224\u65AD\u4EFB\u4F55\u4E1C\u897F\u3002 */}\n <td>\n {catalogOffersEffort ? (\n <Menu\n open={openMenu?.index === index && openMenu.kind === 'effort'}\n anchor={<Input\n type=\"text\"\n className=\"dsh-judge-field\"\n readOnly\n value={draft.effort}\n placeholder={t('rows.effortPlaceholder')}\n aria-label={`${t('rows.colEffort')} ${index + 1}`}\n aria-haspopup=\"listbox\"\n aria-expanded={openMenu?.index === index && openMenu.kind === 'effort'}\n onClick={() => setOpenMenu({ index, kind: 'effort' })}\n onFocus={() => setOpenMenu({ index, kind: 'effort' })}\n />}\n items={[\n { type: 'label', id: 'effort', text: t('rows.colEffort') },\n ...efforts.map((effort) => ({ id: effort, label: effort })),\n ]}\n selectedId={draft.effort === '' ? undefined : draft.effort}\n onSelect={(id) => {\n dispatchCardStore.cell(index, 'effort', id);\n setOpenMenu(null);\n }}\n onClose={() => setOpenMenu(null)}\n className=\"dsh-judge-field-wrap\"\n portal\n />\n ) : (\n <Input\n type=\"text\"\n className=\"dsh-judge-field\"\n value={draft.effort}\n placeholder={t('rows.effortPlaceholder')}\n aria-label={`${t('rows.colEffort')} ${index + 1}`}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.cell(index, 'effort', event.target.value)}\n />\n )}\n </td>\n <td className=\"dsh-judge-col-actions\">\n <div className=\"dsh-judge-cell-actions\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${t('rows.browse')} ${index + 1}`}\n onClick={() => setBrowsing(index)}\n >\n {t('rows.browse')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${t('rows.remove')} ${index + 1}`}\n onClick={() => dispatchCardStore.removeRow(index)}\n >\n {t('rows.remove')}\n </Button>\n </div>\n </td>\n </tr>\n );\n };\n\n const design = (\n <div className=\"dsh-judge-panel\">\n <div className=\"dsh-judge-section\">\n <div className=\"dsh-judge-head\">\n <span className=\"dsh-judge-title\">{t('judge.title')}</span>\n </div>\n <div className=\"dsh-judge-desc\">{t('judge.desc')}</div>\n\n {/* \u8FD9\u4E00\u8282\u91CC\u7684\u6BCF\u4E00\u683C\u90FD\u5F52\u4E0B\u9762\u90A3\u4E2A\u4FDD\u5B58\u6309\u94AE\u7BA1\uFF1A\u5F00\u5173\u3001\u7AEF\u70B9\u3001\u5224\u65AD\u6A21\u578B\u3001\u5BC6\u94A5\u4E00\u6B21\u5199\u5165\u3002\n \u5F00\u5173\u4E0D\u53E6\u5916\u7ED9\u4FDD\u5B58\u6309\u94AE\uFF0C\u4E5F\u4E0D\u5373\u65F6\u5199\u5165\u2014\u2014\u300C\u53EA\u6709\u6309\u4FDD\u5B58\u624D\u5199\u300D\u8FD9\u6761\u89C4\u5219\u5728\u4E00\u4E2A\u8282\u91CC\n \u53EA\u80FD\u6709\u4E00\u4E2A\u51FA\u53E3\uFF0C\u5426\u5219\u8BFB\u8005\u65E0\u6CD5\u9884\u5224\u54EA\u4E00\u4E0B\u4F1A\u843D\u76D8\u3002 */}\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('switch.rewrite.title')}</div>\n <div className=\"dsh-judge-row-hint\">{t('switch.rewrite.desc')}</div>\n </div>\n <Switch\n checked={state.enabled}\n onChange={(next: boolean) => dispatchCardStore.toggle('enabled', next)}\n label={t('switch.rewrite.title')}\n disabled={!state.writable || state.saving !== ''}\n />\n </div>\n\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('switch.log.title')}</div>\n <div className=\"dsh-judge-row-hint\">{t('switch.log.desc')}</div>\n </div>\n <Switch\n checked={state.logEnabled}\n onChange={(next: boolean) => dispatchCardStore.toggle('logEnabled', next)}\n label={t('switch.log.title')}\n disabled={!state.writable || state.saving !== ''}\n />\n </div>\n\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('judge.endpoint')}</div>\n <div className=\"dsh-judge-row-hint\">{t('judge.endpointDesc')}</div>\n </div>\n <div className=\"dsh-judge-row-field\">\n <Input\n type=\"text\"\n className=\"dsh-judge-field\"\n value={state.endpointUrl}\n placeholder=\"http://127.0.0.1:3425/v1/systemone\"\n aria-label={t('judge.endpoint')}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.field('endpointUrl', event.target.value)}\n />\n </div>\n </div>\n\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('judge.model')}</div>\n <div className=\"dsh-judge-row-hint\">{t('judge.modelDesc')}</div>\n </div>\n <div className=\"dsh-judge-row-field\">\n <Input\n type=\"text\"\n className=\"dsh-judge-field\"\n value={state.judgeModel}\n placeholder=\"future-jev/jev-latest\"\n aria-label={t('judge.model')}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.field('judgeModel', event.target.value)}\n />\n </div>\n </div>\n\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('judge.key')}</div>\n <div className=\"dsh-judge-row-hint\">\n {withSamples(t('judge.keyDesc'), { ref: JUDGE_API_KEY_REF, path: CREDENTIALS_PATH })}\n </div>\n </div>\n <div className=\"dsh-judge-row-field\">\n {/* \u5BC6\u94A5\u683C\u4E0E\u4E0A\u9762\u4E24\u683C\u540C\u5BBD\uFF1A\u72B6\u6001\u4E0E\u300C\u5220\u6389\u300D\u653E\u5728\u8F93\u5165\u6846\u4E0B\u9762\u90A3\u4E00\u884C\uFF0C\n \u8FD9\u6837\u4E09\u683C\u7684\u5DE6\u53F3\u8FB9\u7F18\u5BF9\u9F50\u3002 */}\n <Input\n type=\"password\"\n autoComplete=\"new-password\"\n className=\"dsh-judge-field\"\n value={state.key.text}\n placeholder={state.key.configured ? t('judge.keyPlaceholderSet') : t('judge.keyPlaceholder')}\n aria-label={t('judge.key')}\n disabled={state.key.unavailable}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.key(event.target.value)}\n />\n <div className=\"dsh-judge-key-line\">\n <Tag tone={state.key.configured ? 'success' : 'warning'}>\n {t(state.key.configured ? 'judge.keySet' : 'judge.keyUnset')}\n </Tag>\n {state.key.configured && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={state.key.saving || !state.key.writable}\n onClick={() => void dispatchCardStore.clearKey()}\n >\n {t('judge.keyClear')}\n </Button>\n )}\n {state.key.unavailable && <span className=\"dsh-judge-hint\">{t('judge.keyUnavailable')}</span>}\n {state.key.landed === 'saved' && <span className=\"dsh-judge-note-ok\">{t('judge.keySaved')}</span>}\n {state.key.landed === 'cleared' && <span className=\"dsh-judge-note-ok\">{t('judge.keyCleared')}</span>}\n {state.key.failed && (\n <span className=\"dsh-judge-note-bad\" role=\"alert\">\n {t('judge.keyFailed').replace('{error}', state.key.error || t('save.invalid'))}\n </span>\n )}\n </div>\n </div>\n </div>\n\n {probeResult !== null && (\n <div className={probeResult.ok ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'}>\n {probeResult.ok\n ? t('judge.probeOk').replace('{latency}', String(probeResult.latencyMs))\n : t('judge.probeFail').replace('{reason}', reasonText(probeResult.reason))}\n </div>\n )}\n {state.dirty && <div className=\"dsh-judge-hint\">{t('preview.blocked')}</div>}\n\n {/* \u8BD5\u901A\u4E0E\u9884\u89C8\u95EE\u7684\u90FD\u662F\u300C\u8FD9\u4E00\u8282\u5B58\u4E0B\u53BB\u4F1A\u600E\u6837\u300D\uFF0C\u6240\u4EE5\u8DDF\u7740\u8FD9\u4E00\u8282\u7684\u4FDD\u5B58\u8D70\uFF1A\n \u5DE6\u8FB9\u5199\u4E0B\u53BB\uFF0C\u53F3\u8FB9\u67E5\u73B0\u5728\u8FD9\u4EFD\u3002 */}\n {saveRow('judge', state.judgeDirty, () => void dispatchCardStore.save('judge'), (\n <>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={probing || state.dirty}\n onClick={() => void runProbe()}\n >\n {probing ? t('judge.probing') : t('judge.probe')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={state.dirty}\n onClick={() => void openPreview()}\n >\n {t('preview.open')}\n </Button>\n </>\n ))}\n </div>\n\n <div className=\"dsh-judge-section\">\n <div className=\"dsh-judge-title\">{t('rows.title')}</div>\n <div className=\"dsh-judge-desc\">{t('rows.desc')}</div>\n {state.models.length === 0 && <div className=\"dsh-judge-off\">{t('rows.allowedEmpty')}</div>}\n {state.rows.length === 0 && <div className=\"dsh-judge-desc\">{t('rows.empty')}</div>}\n {state.rows.length > 0 && (\n <table className=\"dsh-judge-table\">\n <thead>\n <tr>\n <th className=\"dsh-judge-col-no\">{t('rows.colId')}</th>\n <th>{t('rows.colType')}</th>\n <th className=\"dsh-judge-col-model\">{t('rows.colModel')}</th>\n <th className=\"dsh-judge-col-effort\">{t('rows.colEffort')}</th>\n <th className=\"dsh-judge-col-actions\" />\n </tr>\n </thead>\n <tbody>\n {state.rows.map((draft, index) => row(draft, index))}\n </tbody>\n </table>\n )}\n <div className=\"dsh-judge-actions-group\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => dispatchCardStore.addRow()}>\n {t('rows.add')}\n </Button>\n {/* \u5BFC\u5165\u4E0E\u5BFC\u51FA\u90FD\u53EA\u52A8\u8FD9\u4E00\u4EFD\u6E05\u5355\uFF1A\u5BFC\u5165\u843D\u5728\u8349\u7A3F\u91CC\uFF0C\u5BFC\u51FA\u5C31\u662F\u628A\u8349\u7A3F\u6284\u6210 JSON\uFF0C\n \u4E24\u8005\u90FD\u4E0D\u78B0\u4FDD\u5B58\u6309\u94AE\u90A3\u6761\u8DEF\u3002 */}\n <Button variant=\"outline\" size=\"sm\" onClick={openImport}>\n {t('rows.importOpen')}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void exportRows()}>\n {t('rows.export')}\n </Button>\n {copyNote !== null && (\n <span className={copyNote.ok ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'} role=\"status\">\n {copyNote.text}\n </span>\n )}\n </div>\n {state.rowsInvalid !== '' && state.rowsDirty && (\n <div className=\"dsh-judge-note-bad\" role=\"alert\">{state.rowsInvalid}</div>\n )}\n {saveRow('rows', state.rowsDirty, saveRows)}\n </div>\n </div>\n );\n\n const log = (\n <div className=\"dsh-judge-panel\">\n <div className=\"dsh-judge-section\">\n <div className=\"dsh-judge-head\">\n <span className=\"dsh-judge-title\">{t('log.title')}</span>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void dispatchCardStore.refreshLog()}>\n {t('log.refresh')}\n </Button>\n </div>\n <div className=\"dsh-judge-desc\">{t('log.desc')}</div>\n {state.logFailed && <div className=\"dsh-judge-note-bad\">{t('log.loadFailed')}</div>}\n {state.logLoaded && state.log.length === 0 && (\n <div className=\"dsh-judge-desc\">{t('log.empty')}</div>\n )}\n {state.log.length > 0 && (\n <div className=\"dsh-judge-log\">\n <div className=\"dsh-judge-log-row dsh-judge-log-head\">\n <span>{t('log.colResult')}</span>\n <span>{t('log.colChoice')}</span>\n <span>{t('log.colParent')}</span>\n <span>{t('log.colChild')}</span>\n <span>{t('log.colTime')}</span>\n <span>{t('log.colLatency')}</span>\n </div>\n {state.log.map((entry, index) => {\n // \u5224\u6210\u4E86\u5199\u7C7B\u578B\u7F16\u53F7\uFF1B\u6CA1\u5224\u6210\u5C31\u5199\u300C\u672A\u5224\u6210\u300D\uFF0C\u539F\u56E0\u7559\u7ED9\u60AC\u505C\u2014\u2014\u90A3\u4E00\u5217\u5BBD\u5EA6\n // \u662F\u7ED9\u7F16\u53F7\u7559\u7684\uFF0C\u585E\u4E00\u6BB5\u539F\u56E0\u4F1A\u628A\u516D\u5217\u7684\u5BBD\u5EA6\u5168\u6324\u6B6A\u3002\n const result = entry.typeId === null\n ? {\n text: t('log.resultInherited'),\n hint: entry.reason === undefined ? '' : reasonText(entry.reason),\n }\n : { text: t('log.resultJudged').replace('{id}', String(entry.typeId)), hint: '' };\n return (\n <button\n key={index}\n type=\"button\"\n className=\"dsh-judge-log-row\"\n onClick={() => setDetail(entry)}\n >\n <LogCell text={result.text} hint={result.hint} />\n <LogCell text={describeModel(entry) || '\u2014'} hint={describeChoice(entry)} />\n <LogCell text={entry.parentTitle || '\u2014'} />\n <LogCell text={entry.childLabel || '\u2014'} />\n <span>{new Date(entry.at).toLocaleTimeString()}</span>\n <span>{t('ms').replace('{value}', String(entry.latencyMs))}</span>\n </button>\n );\n })}\n </div>\n )}\n </div>\n </div>\n );\n\n return (\n <div className=\"dsh-judge-card\">\n <SegmentedTabs\n items={[\n { value: 'design' as const, label: t('tab.design'), id: 'judge-tab-design', panelId: 'judge-panel-design' },\n { value: 'log' as const, label: t('tab.log'), id: 'judge-tab-log', panelId: 'judge-panel-log' },\n ]}\n value={tab}\n onChange={setTab}\n label={t('tab.design')}\n />\n {tab === 'design' ? design : log}\n\n <Modal\n open={refusal !== null}\n onClose={() => setRefusal(null)}\n title={t('save.refusedTitle')}\n closeLabel={t('rows.browseClose')}\n >\n <div className=\"dsh-judge-note-bad\" role=\"alert\">{refusal ?? ''}</div>\n </Modal>\n\n <Modal\n open={previewOpen}\n onClose={() => setPreviewOpen(false)}\n title={t('preview.title')}\n closeLabel={t('preview.close')}\n className=\"dsh-judge-modal\"\n >\n <div className=\"dsh-judge-desc\">{t('preview.desc')}</div>\n <div className=\"dsh-judge-prompt\">\n <CodeBlock code={preview ?? ''} copyLabel={t('preview.copy')} copiedLabel={t('preview.copied')} />\n </div>\n </Modal>\n\n {/* \u5BFC\u5165\u53EA\u6536\u7C98\u8D34\uFF1A\u8FD9\u4E00\u6B65\u4E0D\u8BFB\u6587\u4EF6\u3001\u4E0D\u8054\u7F51\uFF0C\u8BFB\u8005\u770B\u5230\u7684\u548C\u7528\u8FDB\u53BB\u7684\u662F\u540C\u4E00\u6BB5\u6587\u672C\u3002 */}\n <Modal\n open={importText !== null}\n onClose={() => setImportText(null)}\n title={t('rows.importTitle')}\n closeLabel={t('rows.browseClose')}\n description={t('rows.importDesc')}\n className=\"dsh-judge-modal\"\n footer={(\n <>\n <Button variant=\"outline\" size=\"sm\" onClick={() => setImportText(null)}>\n {t('rows.importCancel')}\n </Button>\n <Button variant=\"primary\" size=\"sm\" onClick={applyImport}>\n {t('rows.importApply')}\n </Button>\n </>\n )}\n >\n <textarea\n className=\"dsh-judge-paste\"\n value={importText ?? ''}\n aria-label={t('rows.importTitle')}\n placeholder={t('rows.importPlaceholder')}\n spellCheck={false}\n data-modal-autofocus\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => {\n setImportText(event.target.value);\n setImportError('');\n }}\n />\n {importError !== '' && <div className=\"dsh-judge-note-bad\" role=\"alert\">{importError}</div>}\n </Modal>\n\n <Modal\n open={browsing !== null}\n onClose={() => setBrowsing(null)}\n title={t('rows.browseTitle').replace('{id}', String((browsing ?? 0) + 1))}\n closeLabel={t('rows.browseClose')}\n >\n <div className=\"dsh-judge-desc\" style={{ whiteSpace: 'pre-wrap' }}>\n {browsing === null ? '' : state.rows[browsing]?.description ?? ''}\n </div>\n </Modal>\n\n {/* \u5224\u65AD\u8BE6\u60C5\u8FD9\u4E00\u5904\u53EA\u56DE\u7B54\u4E00\u4E2A\u95EE\u9898\uFF1A\u8FD9\u6B21\u5230\u5E95\u53D1\u7ED9\u5224\u65AD\u6A21\u578B\u4EC0\u4E48\u3002\u884C\u4E0A\u90A3\u51E0\u5217\u5DF2\u7ECF\u5199\u6E05\u4E86\n \u7ED3\u679C\u3001\u9009\u62E9\u3001\u8C01\u6D3E\u7684\u6D3B\u3001\u8017\u65F6\uFF0C\u5F39\u7A97\u518D\u5217\u4E00\u904D\u53EA\u662F\u628A\u540C\u4E00\u4EF6\u4E8B\u8BF4\u4E24\u6B21\u3002 */}\n <Modal\n open={detail !== null}\n onClose={() => setDetail(null)}\n title={t('log.promptTitle')}\n closeLabel={t('log.promptClose')}\n description={t('log.promptDesc')}\n className=\"dsh-judge-modal\"\n >\n {detail !== null && (detail.prompt === ''\n ? <div className=\"dsh-judge-desc\">{t('log.promptEmpty')}</div>\n : <div className=\"dsh-judge-prompt\">\n <CodeBlock\n code={detail.prompt}\n copyLabel={t('preview.copy')}\n copiedLabel={t('preview.copied')}\n />\n </div>)}\n </Modal>\n </div>\n );\n}\n\n/** The client context surface this file uses. */\ninterface ClientContextLike {\n effect(factory: () => void | (() => void), label?: string): void;\n slots?: {\n inject(name: string, register: () => unknown): () => void;\n register(options: Record<string, unknown>, component: unknown): () => void;\n };\n configForms: {\n get(namespace: string): any;\n whileServed(namespaces: readonly string[], register: (served: ReadonlySet<string>) => () => void): () => void;\n };\n locale?: any;\n remote?: { session?: any; credentials?: CredentialsRemoteLike };\n}\n\n/**\n * Bind the card to this plugin's own configuration form, the Host's allowlist,\n * the credentials service, and this plugin's runtime routes, then contribute it\n * to the Plugins page.\n * @param ctx - the browser client context.\n */\nexport function setupSettingsUi(ctx: ClientContextLike): void {\n if (typeof window === 'undefined') return;\n const t = ctx.locale?.bind?.(NS) ?? ((key: string) => key);\n try {\n dispatchCardStore.attach({\n form: ctx.configForms.get(SETTINGS_NAMESPACE),\n // The Host owns which models a subagent may use; this card only reads it so\n // the plugin never keeps a second list that could drift from it.\n allowedForm: ctx.configForms.get(ALLOWED_MODELS_NAMESPACE),\n session: ctx.remote?.session ?? null,\n remote: createDispatchRemote(),\n // The judgement key is written here; its value never rides a response.\n credentials: ctx.remote?.credentials ?? null,\n t,\n });\n } catch (error) {\n console.warn('[dsh-subagent-judge-dispatch] \u914D\u7F6E\u8868\u5355\u7ED1\u5B9A\u5931\u8D25\uFF1A', error);\n }\n\n // The dictionaries are registered once by the client entry point; the card's\n // seat resolves `t` against them through its `locale: NS` registration above.\n\n // The card lives on the Plugins page, which declares `plugins.bundle.config`\n // only while its own entry is mounted; `whileServed` additionally ties the\n // contribution to the Host actually serving this plugin's own settings entry.\n ctx.effect(\n () => ctx.configForms.whileServed([SETTINGS_NAMESPACE], () =>\n setupPluginPage(ctx.slots, () =>\n (ctx.slots as NonNullable<ClientContextLike['slots']>).register(\n {\n name: BUNDLE_CONFIG_SLOT,\n key: BUNDLE_CONFIG_KEY,\n locale: NS,\n },\n JudgeDispatchPanel,\n ))),\n 'dsh-subagent-judge-dispatch: plugins page config',\n );\n}\n", "/**\n * This plugin's configuration card and where it lives: the DSH **Plugins** page,\n * registered into `plugins.bundle.config` under the bundle's package name.\n *\n * The key is the package name; the settings the card reads and writes live in a\n * DIFFERENT literal \u2014 the Loader row id, which is also this plugin's settings\n * namespace. Writing one where the other belongs makes the card silently never\n * appear, so both are spelled once, here and in `src/index.ts`.\n */\n\n// Type-only: brings the owner's `plugins.bundle.config` SlotMap contract into\n// this program. Erased from the bundle, so the browser half never depends on the\n// plugin manager at runtime.\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client';\n\n/** npm package name of this plugin's bundle \u2014 the whole `plugins.bundle.config` key. */\nexport const BUNDLE_NAME = '@lynn123411/dsh-subagent-judge-dispatch';\n\n/** The Plugins page slot a bundle's own configuration registers into. */\nexport const BUNDLE_CONFIG_SLOT = 'plugins.bundle.config';\n\n/** This plugin's own config key: the bundle's package name. */\nexport const BUNDLE_CONFIG_KEY = BUNDLE_NAME;\n\n/** Services this registration needs from the browser runtime. */\ninterface PluginPageSlots {\n inject(name: string, callback: () => unknown): () => void;\n}\n\n/**\n * Contribute this plugin's configuration card to the Plugins page.\n * @param slots - the client slot registry.\n * @param register - registers the card component; returns its disposer.\n * @returns A disposer releasing the contribution, or a no-op when the browser\n * runtime hands no slot registry at all.\n */\nexport function setupPluginPage(\n slots: PluginPageSlots | null | undefined,\n register: () => () => void,\n): () => void {\n if (!slots || typeof slots.inject !== 'function') return () => {};\n return slots.inject(BUNDLE_CONFIG_SLOT, register);\n}\n", "/**\n * The judgement request the plugin sends, and the answer it reads back.\n *\n * Two pure functions live here, so the whole \"what did the judge decide\"\n * question is answerable without a Host, a socket, or a timer:\n *\n * - {@link buildJudgeRequest} turns the type list plus the task text into the\n * exact body that goes out.\n * - {@link readJudgeAnswer} turns whatever came back into a decision, treating\n * every malformed, empty or off-list answer as \"no decision\" rather than\n * inventing one.\n *\n * The protocol is the System One one: POST a body of `{ model, state,\n * questions }`, where each question is a `choice` carrying an `instructions`\n * line and a `criteria` map of option id to the text that option means. The\n * answer names the chosen option id.\n */\n\nimport type { TypeRow } from './types.ts';\n\n/** The one question key the plugin asks. */\nexport const QUESTION_KEY = 'task_type';\n\n/**\n * The question's instructions line.\n *\n * It says what to weigh, not what the types are: the types themselves arrive as\n * the criteria map, so the reader's own descriptions are the whole criterion\n * list and nothing here can drift from them.\n */\nexport const QUESTION_INSTRUCTIONS =\n 'Which single task type below does the delegated job best match? '\n + 'Weigh what the job actually requires, not how it is phrased. '\n + 'Answer with the number of exactly one listed type.';\n\n/** The option id the connectivity check offers: the only one it offers. */\nexport const PROBE_OPTION_ID = '1';\n\n/** The task text the connectivity check sends. */\nexport const PROBE_TASK_TEXT = '\u8FDE\u63A5\u6D4B\u8BD5\uFF1A\u8FD9\u662F\u4E00\u6B21\u5224\u65AD\u670D\u52A1\u7684\u8FDE\u901A\u6027\u68C0\u67E5\u3002';\n\n/**\n * The connectivity check's instructions.\n *\n * It asks for the one option that exists, so an endpoint that understands the\n * protocol at all can answer it: answering it wrong is a failure of the\n * protocol, not of the reader's task list.\n */\nexport const PROBE_INSTRUCTIONS =\n 'Answer with the number of the one option listed below.';\n\n/** The single criterion the connectivity check offers. */\nexport const PROBE_CRITERION = '\u786E\u8BA4\u8FD9\u6B21\u8C03\u7528\u53EF\u4EE5\u5B8C\u6210\u3002';\n\n/** One option of the judge's question. */\nexport interface JudgeChoice {\n type: 'choice';\n instructions: string;\n criteria: Record<string, string>;\n}\n\n/** The exact body sent to the judge endpoint. */\nexport interface JudgeRequest {\n model: string;\n state: { message: string };\n questions: { [QUESTION_KEY]: JudgeChoice };\n}\n\n/**\n * Whether one row is complete enough to be offered to the judge.\n *\n * A row needs its provider, model and effort: a half-filled row could otherwise\n * be chosen and then have nothing to write, which would turn the reader's\n * unfinished edit into a delegation that silently lost its route. This is the\n * ONE place that rule lives \u2014 the page, the config gate and the rewrite all ask\n * this function rather than restating the three comparisons.\n *\n * The parameter is narrowed to the three fields the rule reads, so the page's\n * draft row (which carries no sequence number) and the server's numbered row\n * both satisfy it without either shape being converted into the other.\n *\n * @param row - one row, numbered or drafted.\n * @returns whether the judge may choose it.\n */\nexport function isSelectableRow(row: Pick<TypeRow, 'provider' | 'model' | 'effort'>): boolean {\n return row.provider.trim() !== '' && row.model.trim() !== '' && row.effort.trim() !== '';\n}\n\n/**\n * Which rows may be offered to the judge.\n * @param rows - every row on the page, in page order.\n * @returns the rows the judge may choose, in page order.\n */\nexport function selectableRows(rows: readonly TypeRow[]): TypeRow[] {\n return rows.filter(isSelectableRow);\n}\n\n/**\n * How much of a delegated task's opening the judge reads.\n *\n * The judge answers one multiple-choice question; the opening of a task says\n * what kind of job it is, and the rest is usually detail the choice does not\n * turn on. Bounding it keeps the request small and keeps one enormous\n * delegation from crowding out the type list it is being weighed against.\n */\nexport const SUBJECT_HEAD_CHARS = 1400;\n\n/**\n * How much of a task's closing the judge reads.\n *\n * Supplementary requirements are written at the end \u2014 \"also run the review\" \u2014\n * so the tail is kept rather than the middle.\n */\nexport const SUBJECT_TAIL_CHARS = 400;\n\n/** Opening words of the label line the judge reads above the task. */\nexport const LABEL_PREFIX = 'Delegation label: ';\n\n/**\n * Build the subject the judge is asked to classify.\n *\n * Two parts, in the order the reader would put them: the delegation's own label\n * \u2014 a summary the delegating agent wrote, which carries its intent \u2014 and then\n * the task text itself. The label alone is a display phrase of a few words, too\n * little to classify by; the task text alone loses that intent when it opens\n * with boilerplate.\n *\n * @param label - the delegation label, or '' when the child has none.\n * @param taskText - the delegated task text, or '' when it cannot be read.\n * @returns the subject to send, bounded to {@link SUBJECT_HEAD_CHARS} plus\n * {@link SUBJECT_TAIL_CHARS} characters of task text.\n */\nexport function composeJudgeSubject(label: string, taskText: string): string {\n const task = clipTaskText(taskText.trim());\n const heading = label.trim();\n if (heading === '') return task;\n return task === '' ? LABEL_PREFIX + heading : `${LABEL_PREFIX}${heading}\\n\\n${task}`;\n}\n\n/**\n * Bound a task text to its opening and closing.\n *\n * The dropped middle is named rather than silently removed, so a reader looking\n * at the logged request can tell truncation from a short task. The marker is\n * English like the rest of the protocol, so it reads as a note from the plugin\n * rather than as part of the task, whatever language the task is written in.\n *\n * @param text - the task text.\n * @returns the text, or its head and tail around a count of what was dropped.\n */\nfunction clipTaskText(text: string): string {\n if (text.length <= SUBJECT_HEAD_CHARS + SUBJECT_TAIL_CHARS) return text;\n const dropped = text.length - SUBJECT_HEAD_CHARS - SUBJECT_TAIL_CHARS;\n const head = text.slice(0, SUBJECT_HEAD_CHARS);\n const tail = text.slice(text.length - SUBJECT_TAIL_CHARS);\n return `${head}\\n\u2026 (${dropped} characters omitted) \u2026\\n${tail}`;\n}\n\n/**\n * Build the exact body sent to the judge endpoint.\n *\n * @param rows - the selectable rows, in page order.\n * @param model - the judge model id.\n * @param subject - the text the judge classifies, from {@link composeJudgeSubject}.\n * @returns the request body.\n */\nexport function buildJudgeRequest(\n rows: readonly TypeRow[],\n model: string,\n subject: string,\n): JudgeRequest {\n const criteria: Record<string, string> = {};\n for (const row of rows) criteria[String(row.id)] = row.description;\n return {\n model,\n state: { message: subject },\n questions: {\n [QUESTION_KEY]: {\n type: 'choice',\n instructions: QUESTION_INSTRUCTIONS,\n criteria,\n },\n },\n };\n}\n\n/**\n * Build the body the connectivity check sends.\n *\n * It carries its own single option rather than the reader's task types: the\n * question the button answers is \"does this endpoint and model work\", and that\n * question has an answer before any type list exists. Requiring a finished list\n * first would make the check unable to tell a reader with an empty list from a\n * reader whose endpoint is down.\n *\n * @param model - the judge model id.\n * @returns the request body.\n */\nexport function buildProbeRequest(model: string): JudgeRequest {\n return {\n model,\n state: { message: PROBE_TASK_TEXT },\n questions: {\n [QUESTION_KEY]: {\n type: 'choice',\n instructions: PROBE_INSTRUCTIONS,\n criteria: { [PROBE_OPTION_ID]: PROBE_CRITERION },\n },\n },\n };\n}\n\n/**\n * Serialize one request body the way the page shows it.\n *\n * Both the preview and a logged judgement display this text, while the call\n * itself sends the same object compacted onto the wire. Deriving both from one\n * body is what keeps the shown text from describing a different request than\n * the one that went out.\n *\n * @param body - the request body.\n * @returns the pretty-printed JSON.\n */\nexport function formatJudgeRequest(body: JudgeRequest): string {\n return JSON.stringify(body, null, 2);\n}\n\n/**\n * The text the configuration page's preview shows.\n *\n * It is the request body minus the subject, because no delegation exists until\n * one happens; the preview marks both spots the subject will fill rather than\n * inventing a task. The two markers are told apart, because the real subject is\n * a label line followed by the task text and the preview should read that way.\n *\n * @param rows - the selectable rows, in page order.\n * @param model - the judge model id.\n * @returns the pretty-printed preview text.\n */\nexport function buildPreview(rows: readonly TypeRow[], model: string): string {\n return formatJudgeRequest(\n buildJudgeRequest(rows, model, composeJudgeSubject('\uFF08\u6D3E\u5DE5\u65F6\u624D\u586B\uFF1A\u6D3E\u5DE5\u6807\u7B7E\uFF09', '\uFF08\u6D3E\u5DE5\u65F6\u624D\u586B\uFF1A\u4EFB\u52A1\u6B63\u6587\uFF09')),\n );\n}\n\n/** What reading the judge's answer produced. */\nexport type JudgeDecision =\n | { kind: 'row'; row: TypeRow }\n | { kind: 'empty' }\n | { kind: 'unmatched' };\n\n/**\n * Find the chosen option id inside whatever the endpoint answered.\n *\n * The protocol's own shape is `answers.<key>.choice`; the two fallbacks are the\n * ones the reference clients read, so an endpoint that answers the shorter way\n * still works. Anything else \u2014 a missing body, a non-string, an empty string \u2014\n * yields `undefined` and is treated as no answer.\n *\n * @param payload - the decoded response body.\n * @returns the chosen option id, or undefined when the body names none.\n */\nexport function readChoice(payload: unknown): string | undefined {\n if (typeof payload !== 'object' || payload === null) return undefined;\n const body = payload as Record<string, unknown>;\n const answers = body.answers;\n const fromAnswers =\n typeof answers === 'object' && answers !== null\n ? (answers as Record<string, unknown>)[QUESTION_KEY]\n : undefined;\n const candidate = fromAnswers ?? body[QUESTION_KEY];\n if (typeof candidate === 'object' && candidate !== null) {\n const choice = (candidate as Record<string, unknown>).choice;\n if (typeof choice === 'string' && choice.trim() !== '') return choice.trim();\n if (typeof choice === 'number' && Number.isFinite(choice)) return String(choice);\n return undefined;\n }\n if (typeof candidate === 'string' && candidate.trim() !== '') return candidate.trim();\n if (typeof candidate === 'number' && Number.isFinite(candidate)) return String(candidate);\n return undefined;\n}\n\n/**\n * Turn the judge's answer into a decision.\n *\n * The choice is the type row's number. Matching is by that number's numeric\n * value, so an endpoint that answers `\"3\"` and one that answers `3` agree; a\n * number no listed row carries is `unmatched`, and a body naming no choice at\n * all is `empty`. Both travel to the log as their own reason, because \"it\n * answered nothing\" and \"it answered something I do not have\" send the reader\n * to different fixes.\n *\n * @param payload - the decoded response body.\n * @param rows - the selectable rows, in page order.\n * @returns the decision.\n */\nexport function readJudgeAnswer(payload: unknown, rows: readonly TypeRow[]): JudgeDecision {\n const choice = readChoice(payload);\n if (choice === undefined) return { kind: 'empty' };\n const wanted = Number(choice);\n if (!Number.isFinite(wanted)) return { kind: 'unmatched' };\n const row = rows.find((candidate) => candidate.id === wanted);\n return row === undefined ? { kind: 'unmatched' } : { kind: 'row', row };\n}\n", "/**\n * Where the judgement key lives, and the Host service it is read through.\n *\n * The reference name is a constant of the plugin rather than a setting: the\n * page asks for the key itself and stores it write-only through the DSH\n * credentials service, so a reader never has to know what a \"credential\n * reference\" is, and no surface can point the plugin at somebody else's key.\n * This module imports nothing, so both halves can share the literal.\n *\n * The key value crosses in one direction only: it is written, and read back by\n * the Host half alone. The browser face reads a status-only view.\n */\n\n/** Credential reference the judgement key is stored under. */\nexport const JUDGE_API_KEY_REF = 'SUBAGENT_JUDGE_API_KEY';\n\n/** Minimal structural shape of the Host's `ctx.credentials` service. */\nexport interface CredentialsServiceLike {\n /** Resolve a reference to its stored or inherited value. */\n resolve(ref: string): Promise<{ value: string; source?: string } | undefined>;\n /** Status-only view of a reference; never returns the plaintext value. */\n describe(ref: string): Promise<{ configured: boolean; source?: string; writable: boolean }>;\n /** Store a non-empty value under a reference. */\n set(ref: string, value: string): Promise<void>;\n /** Remove a reference from the document. */\n unset(ref: string): Promise<void>;\n}\n\n/** Minimal structural shape of the browser's `ctx.remote.credentials` face. */\nexport interface CredentialsRemoteLike {\n describe(refs: string[]): Promise<\n { ok: true; value: Record<string, { configured: boolean; source?: string; writable: boolean }> }\n | { ok: false; error: { message: string } }\n >;\n set(ref: string, value: string): Promise<{ ok: true } | { ok: false; error: { message: string } }>;\n unset(ref: string): Promise<{ ok: true } | { ok: false; error: { message: string } }>;\n}\n", "/**\n * The configuration card's own state: what the Host serves, what the reader has\n * staged, and what a save would do.\n *\n * Three rules live here rather than in the component, because each is the kind\n * of thing a render pass must not be trusted with:\n *\n * - A row's sequence number is positional (`1..n`) and is never stored. Duplicate\n * numbers are therefore impossible by construction rather than by validation.\n * - The two sections save separately. The judgement service and the task-type\n * list are edited at different times and fail differently, so one save for both\n * would let a half-finished description block a change to the endpoint.\n * - A save that did not land is reported as such. The shared configuration form\n * answers `false` for a refusal, which is not a rejection: treating it as\n * success would show a saved page over a document the Host never accepted.\n *\n * The model and effort options come from the Host's own \"models subagents may\n * choose\" setting and the adapter catalogue, so the plugin never keeps a second\n * list that could drift from it. The judgement key is write-only over the DSH\n * credentials service, which is why no key value is ever part of this state.\n */\n\nimport { isSelectableRow } from '../../server/judge-prompt.ts';\nimport { JUDGE_API_KEY_REF, type CredentialsRemoteLike } from '../../server/credentials.ts';\n\nexport { JUDGE_API_KEY_REF };\nexport type { CredentialsRemoteLike };\n\n/** One type row as the page edits it; `id` is derived, never stored. */\nexport interface TypeRowDraft {\n description: string;\n provider: string;\n model: string;\n effort: string;\n}\n\n/** One selectable model and the efforts it declares. */\nexport interface ModelOption {\n provider: string;\n model: string;\n /** Display name from the adapter catalogue, when it advertises one. */\n label: string;\n /** Effort ids this exact route declares, in catalogue order. */\n efforts: string[];\n}\n\n/** One log row as the Host serves it. */\nexport interface LogRow {\n typeId: number | null;\n provider: string;\n model: string;\n effort: string;\n reason?: string;\n at: number;\n latencyMs: number;\n parentTitle: string;\n childLabel: string;\n /** The exact request body that went to the judge; '' when none went out. */\n prompt: string;\n}\n\n/** Which of the two sections a save writes. */\nexport type Section = 'judge' | 'rows';\n\n/** What the page shows about the judgement key; never its value. */\nexport interface KeyState {\n /** Staged key text; blank until the reader types one. */\n text: string;\n /** Whether the Host reports a stored key under the reference. */\n configured: boolean;\n /** Whether the credentials document accepts writes. */\n writable: boolean;\n /**\n * Whether this page has no credentials channel at all \u2014 a non-loopback page\n * is served without the namespace, and a field that cannot be written should\n * say so before the reader types into it.\n */\n unavailable: boolean;\n saving: boolean;\n failed: boolean;\n /** The credentials service's own message for a refused write, or ''. */\n error: string;\n /** What the last landed key write did, or '' when none has landed. */\n landed: '' | 'saved' | 'cleared';\n}\n\n/** The card's whole state. */\nexport interface PageState {\n available: boolean;\n writable: boolean;\n /** Whether the model-rewrite switch is on. */\n enabled: boolean;\n /** Whether the log switch is on. */\n logEnabled: boolean;\n endpointUrl: string;\n judgeModel: string;\n rows: TypeRowDraft[];\n /** Model options read from the Host's allowlist plus the adapter catalogue. */\n models: ModelOption[];\n /** Whether the adapter catalogue was read; false means the effort column is free text. */\n catalogRead: boolean;\n /** Persisted values, for computing dirtiness and reverting. */\n committed: {\n enabled: boolean;\n logEnabled: boolean;\n endpointUrl: string;\n judgeModel: string;\n rows: TypeRowDraft[];\n };\n /** Whether the judgement service section holds edits a save would write. */\n judgeDirty: boolean;\n /** Whether the task-type list holds edits a save would write. */\n rowsDirty: boolean;\n /** Whether either section holds edits, for the preview's own notice. */\n dirty: boolean;\n /** A reason the task-type drafts cannot be saved; '' when they can. */\n rowsInvalid: string;\n /** Which section a save is crossing the wire for, or '' when none is. */\n saving: Section | '';\n /** Which section's last save did not land, or '' when none failed. */\n saveFailed: Section | '';\n /** The Host's own message for the last refused write, or ''. */\n saveError: string;\n /** The judgement key's write-only state. */\n key: KeyState;\n /** Runtime log rows, newest first. */\n log: LogRow[];\n logLoaded: boolean;\n logFailed: boolean;\n}\n\n/** Defaults mirroring the Host schema, so an unserved page still renders. */\nexport const DEFAULT_ENDPOINT_URL = 'http://127.0.0.1:3425/v1/systemone';\nexport const DEFAULT_JUDGE_MODEL = 'future-jev/jev-latest';\n\n/** Profile entry id (== settings namespace). */\nexport const SETTINGS_NAMESPACE = 'dsh-subagent-judge-dispatch';\n\n/** The Host's own allowlist namespace, which the card reads for model options. */\nexport const ALLOWED_MODELS_NAMESPACE = 'subagent-model-selection-settings';\n\n/** One path-addressed edit, matching the wire shape the form's `mutate` accepts. */\nexport type SettingsPathOpLike =\n | { op: 'set'; path: string[]; value: unknown }\n | { op: 'unset'; path: string[] };\n\n/** Minimal structural shape of the DSH shared configuration form. */\nexport interface ConfigFormLike {\n getSnapshot(): {\n status: 'loading' | 'ready' | 'unavailable';\n value?: Record<string, unknown>;\n writable: boolean;\n revision?: number;\n };\n subscribe(listener: () => void): () => void;\n mutate(ops: readonly SettingsPathOpLike[], expectedRevision?: number): Promise<boolean>;\n}\n\n/** The `remote.session` face the model catalogue is read through. */\nexport interface SessionRemoteLike {\n modelCatalog(): Promise<\n | { ok: true; value: { groups: readonly { id: string; name: string; models: readonly { id: string; name: string; reasoning?: { efforts: readonly { id: string }[] } }[] }[] } }\n | { ok: false; error: { message: string } }\n >;\n}\n\n/**\n * The Host's three runtime reads.\n *\n * They are plain Fetch calls on this plugin's own routes rather than a Remote\n * namespace: the routes ride Connection's authenticated `/api` transport, which\n * is the same channel the page is already served over.\n */\nexport interface DispatchRemoteLike {\n log(): Promise<LogRow[]>;\n preview(): Promise<string | null>;\n probe(): Promise<{ ok: boolean; latencyMs: number; reason?: string }>;\n}\n\n/** The three route paths, shared with the Host half by literal. */\nexport const LOG_ROUTE_PATH = '/api/dsh-subagent-judge-dispatch/log';\nexport const PREVIEW_ROUTE_PATH = '/api/dsh-subagent-judge-dispatch/preview';\nexport const PROBE_ROUTE_PATH = '/api/dsh-subagent-judge-dispatch/probe';\n\n/** Decode a response body, treating an unreadable one as absent. */\nasync function readJson(response: Response): Promise<any> {\n try {\n return await response.json();\n } catch {\n return null;\n }\n}\n\n/** The real Host reads, over this plugin's own routes. */\nexport function createDispatchRemote(): DispatchRemoteLike {\n return {\n async log(): Promise<LogRow[]> {\n try {\n const response = await fetch(LOG_ROUTE_PATH);\n if (!response.ok) return [];\n const body = await readJson(response);\n return Array.isArray(body?.entries) ? (body.entries as LogRow[]) : [];\n } catch {\n return [];\n }\n },\n async preview(): Promise<string | null> {\n try {\n const response = await fetch(PREVIEW_ROUTE_PATH);\n if (!response.ok) return null;\n const body = await readJson(response);\n return typeof body?.preview === 'string' ? body.preview : null;\n } catch {\n return null;\n }\n },\n async probe(): Promise<{ ok: boolean; latencyMs: number; reason?: string }> {\n try {\n const response = await fetch(PROBE_ROUTE_PATH, { method: 'POST' });\n if (!response.ok) return { ok: false, latencyMs: 0, reason: 'unreachable' };\n const body = await readJson(response);\n if (body === null || typeof body !== 'object') return { ok: false, latencyMs: 0, reason: 'unreachable' };\n return {\n ok: body.ok === true,\n latencyMs: typeof body.latencyMs === 'number' ? body.latencyMs : 0,\n ...typeof body.reason === 'string' ? { reason: body.reason } : {},\n };\n } catch {\n return { ok: false, latencyMs: 0, reason: 'unreachable' };\n }\n },\n };\n}\n\n/**\n * Read one row from a stored document value, tolerating a partial record.\n * @param value - one entry of the stored `rows` array.\n * @returns the row's four text fields, each defaulted to ''.\n */\nexport function readRow(value: unknown): TypeRowDraft {\n const record = typeof value === 'object' && value !== null ? (value as Record<string, unknown>) : {};\n const text = (key: string): string => (typeof record[key] === 'string' ? (record[key] as string) : '');\n return {\n description: text('description'),\n provider: text('provider'),\n model: text('model'),\n effort: text('effort'),\n };\n}\n\n/**\n * The model and effort of one log row as a single scanned value.\n *\n * The list shows one \"choice\" cell rather than three, because model and effort\n * are read together \u2014 \"which route did this child run on\". The two are joined\n * with the same middle dot the model menu uses, and a blank field is dropped\n * rather than left as a dangling separator on a fallback row that kept only a\n * partially known inherited route. The provider stays out of the cell: it is\n * the same for nearly every row and is only one hover away in\n * {@link describeChoice}.\n *\n * @param row - the model and effort to join.\n * @returns the joined text, or '' when both are blank.\n */\nexport function describeModel(row: Pick<LogRow, 'model' | 'effort'>): string {\n return joinRouteParts([row.model, row.effort]);\n}\n\n/**\n * The full route of one log row: provider, model and effort.\n *\n * This is what the choice cell's hover bubble carries, so the provider is still\n * one hover away from a reader who needs to know which adapter served the\n * child. Blank fields are dropped by the same rule as {@link describeModel}.\n *\n * @param row - the provider, model and effort to join.\n * @returns the joined text, or '' when all three are blank.\n */\nexport function describeChoice(row: Pick<LogRow, 'provider' | 'model' | 'effort'>): string {\n return joinRouteParts([row.provider, row.model, row.effort]);\n}\n\n/**\n * Join the parts of a route the way both cells above need it.\n *\n * One rule, two callers: a blank part is dropped rather than left as a dangling\n * separator, and the rest are joined with the middle dot the model menu uses.\n *\n * @param parts - the route fields, in display order.\n * @returns the joined text, or '' when every part is blank.\n */\nfunction joinRouteParts(parts: readonly string[]): string {\n return parts\n .map((part) => part.trim())\n .filter((part) => part !== '')\n .join(' \u00B7 ');\n}\n\n/**\n * Stable identity for one exact provider/model route.\n *\n * The separator is a NUL, which cannot appear in a provider or model id, so the\n * join and the split can never disagree. Both live here rather than at the call\n * sites: encoding and decoding are one concept and must not drift apart.\n *\n * @param provider - provider id.\n * @param model - model id.\n * @returns the composite key.\n */\nexport function routeKey(provider: string, model: string): string {\n return `${provider}\\0${model}`;\n}\n\n/**\n * Split a composite route key back into its two ids.\n * @param key - a value produced by {@link routeKey}.\n * @returns the provider and model, both '' when the key is malformed.\n */\nexport function splitRouteKey(key: string): { provider: string; model: string } {\n const at = key.indexOf('\\0');\n if (at < 0) return { provider: '', model: '' };\n return { provider: key.slice(0, at), model: key.slice(at + 1) };\n}\n\n/**\n * Pair the Host's allowlist with the adapter catalogue.\n *\n * The allowlist decides which routes may be offered; the catalogue supplies each\n * route's display name and the effort ids it declares. A route the allowlist\n * names but the catalogue no longer advertises is kept, so a stored row never\n * becomes uneditable merely because an adapter went away.\n *\n * @param allowed - the Host's `allowedModels` entries.\n * @param groups - catalogue provider groups.\n * @returns the options to render, in allowlist order.\n */\nexport function buildModelOptions(\n allowed: readonly { provider?: unknown; model?: unknown }[],\n groups: readonly { id: string; models: readonly { id: string; name: string; reasoning?: { efforts: readonly { id: string }[] } }[] }[],\n): ModelOption[] {\n const byRoute = new Map<string, { label: string; efforts: string[] }>();\n for (const group of groups) {\n for (const model of group.models) {\n byRoute.set(routeKey(group.id, model.id), {\n label: model.name,\n efforts: (model.reasoning?.efforts ?? []).map((effort) => effort.id),\n });\n }\n }\n const options: ModelOption[] = [];\n const seen = new Set<string>();\n for (const entry of allowed) {\n const provider = typeof entry.provider === 'string' ? entry.provider : '';\n const model = typeof entry.model === 'string' ? entry.model : '';\n if (provider === '' || model === '') continue;\n const key = routeKey(provider, model);\n if (seen.has(key)) continue;\n seen.add(key);\n const found = byRoute.get(key);\n options.push({\n provider,\n model,\n label: found?.label ?? model,\n efforts: found?.efforts ?? [],\n });\n }\n return options;\n}\n\n/**\n * The reason the task-type drafts cannot be saved, or '' when they can.\n *\n * A duplicate description is refused because the description is the criterion\n * the judge reads: two identical criteria would make the answer ambiguous and\n * the log unreadable. An empty description is refused for the same reason \u2014 a\n * row the judge cannot tell apart from any other.\n *\n * @param rows - the staged rows.\n * @param t - the page's translator, so the message is localized.\n * @returns the reason text, or ''.\n */\nexport function validateRows(rows: readonly TypeRowDraft[], t: (key: string) => string): string {\n const seen = new Set<string>();\n for (const row of rows) {\n const description = row.description.trim();\n if (description === '') return t('save.emptyDescription');\n if (seen.has(description)) return t('save.duplicateDescription');\n seen.add(description);\n }\n return '';\n}\n\n/**\n * The task-type list as plain JSON text, for copying out.\n *\n * The shape is the stored one \u2014 an array of `{ description, provider, model,\n * effort }` \u2014 with the sequence numbers left out: they are positional, and\n * writing them would invite a reader to think they are part of the setting.\n *\n * @param rows - the rows as they stand on the page.\n * @returns indented JSON text.\n */\nexport function exportRowsJson(rows: readonly TypeRowDraft[]): string {\n return JSON.stringify(\n // \u7A7A\u767D\u884C\uFF08\u8BFB\u8005\u6309\u4E86\u300C\u52A0\u4E00\u884C\u300D\u8FD8\u6CA1\u586B\uFF09\u4E0D\u5199\u8FDB JSON\uFF1A\u5B83\u6CA1\u6709\u5185\u5BB9\u53EF\u5E26\u8D70\uFF0C\u5199\u51FA\u53BB\n // \u8FD8\u4F1A\u8BA9\u8FD9\u4EFD\u6587\u672C\u81EA\u5DF1\u8BFB\u4E0D\u56DE\u6765\u3002\n rows.filter((row) => !isBlankRow(row)).map((row) => ({\n description: row.description,\n provider: row.provider,\n model: row.model,\n effort: row.effort,\n })),\n null,\n 2,\n );\n}\n\n/**\n * Whether a row carries nothing at all.\n * @param row - the row to inspect.\n * @returns true when all four fields are empty or whitespace.\n */\nfunction isBlankRow(row: TypeRowDraft): boolean {\n return [row.description, row.provider, row.model, row.effort]\n .every((field) => field.trim() === '');\n}\n\n/** What reading pasted JSON produced. */\nexport type RowsImport =\n | { ok: true; rows: TypeRowDraft[] }\n /** `error` names the fault; the page turns it into its own sentence. */\n | { ok: false; error: 'json' | 'shape' | 'empty' };\n\n/**\n * Read a pasted task-type list.\n *\n * The text is checked before it can reach the page: it must be one JSON array,\n * every element must be an object, and the four fields must be strings. An\n * unknown field is ignored rather than refused, so a list copied from a newer\n * version still loads what it understands.\n *\n * @param text - what the reader pasted.\n * @returns the rows, or the fault that stopped it.\n */\nexport function parseRowsJson(text: string): RowsImport {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n return { ok: false, error: 'json' };\n }\n if (!Array.isArray(parsed)) return { ok: false, error: 'shape' };\n if (parsed.length === 0) return { ok: false, error: 'empty' };\n const rows: TypeRowDraft[] = [];\n for (const value of parsed) {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return { ok: false, error: 'shape' };\n const record = value as Record<string, unknown>;\n // \u5B57\u6BB5\u5B58\u5728\u4F46\u4E0D\u662F\u6587\u5B57\uFF0C\u662F\u5F62\u72B6\u4E0D\u5BF9\uFF1B\u7F3A\u5B57\u6BB5\u5F53\u4F5C\u7A7A\u4E32\uFF0C\u90A3\u662F\u5408\u6CD5\u7684\u6B8B\u7F3A\u8BB0\u5F55\u3002\n const wrongType = ['description', 'provider', 'model', 'effort']\n .some((key) => record[key] !== undefined && typeof record[key] !== 'string');\n if (wrongType) return { ok: false, error: 'shape' };\n const field = (key: string): string => (typeof record[key] === 'string' ? (record[key] as string) : '');\n const row = {\n description: field('description'),\n provider: field('provider'),\n model: field('model'),\n effort: field('effort'),\n };\n // \u7A7A\u767D\u884C\u7167\u6536\u4E0D\u8BEF\u3001\u76F4\u63A5\u8DF3\u8FC7\uFF1A\u5BFC\u51FA\u4F1A\u5E26\u6765\u8FD9\u79CD\u884C\uFF0C\u62D2\u6536\u4F1A\u8BA9\u8FD9\u4EFD JSON \u81EA\u5DF1\u8BFB\u4E0D\u56DE\u6765\u3002\n if (isBlankRow(row)) continue;\n rows.push(row);\n }\n if (rows.length === 0) return { ok: false, error: 'empty' };\n return { ok: true, rows };\n}\n\n/** A key nothing is staged for and nothing is known about. */\nfunction emptyKey(): KeyState {\n return {\n text: '', configured: false, writable: false, unavailable: false,\n saving: false, failed: false, error: '', landed: '',\n };\n}\n\n/**\n * The read/write face of the Host document plus the runtime reads.\n *\n * Every control stages into this store and only a section's own save writes, so\n * a half-typed endpoint can never reach a delegation, and a half-written type\n * list can never be stored behind the reader's back.\n */\nexport class DispatchCardStore {\n private state: PageState = {\n available: false,\n writable: false,\n enabled: true,\n logEnabled: true,\n endpointUrl: DEFAULT_ENDPOINT_URL,\n judgeModel: DEFAULT_JUDGE_MODEL,\n rows: [],\n models: [],\n catalogRead: false,\n committed: {\n enabled: true,\n logEnabled: true,\n endpointUrl: DEFAULT_ENDPOINT_URL,\n judgeModel: DEFAULT_JUDGE_MODEL,\n rows: [],\n },\n judgeDirty: false,\n rowsDirty: false,\n dirty: false,\n rowsInvalid: '',\n saving: '',\n saveFailed: '',\n saveError: '',\n key: emptyKey(),\n log: [],\n logLoaded: false,\n logFailed: false,\n };\n\n private listeners = new Set<() => void>();\n private form: ConfigFormLike | null = null;\n private allowedForm: ConfigFormLike | null = null;\n private session: SessionRemoteLike | null = null;\n private remote: DispatchRemoteLike | null = null;\n private credentials: CredentialsRemoteLike | null = null;\n private offForm: (() => void) | null = null;\n private offAllowed: (() => void) | null = null;\n private translate: (key: string) => string = (key) => key;\n\n /** Bind the Host services; re-binding detaches the previous subscriptions. */\n attach(options: {\n form: ConfigFormLike | null;\n allowedForm: ConfigFormLike | null;\n session: SessionRemoteLike | null;\n remote: DispatchRemoteLike | null;\n credentials: CredentialsRemoteLike | null;\n t: (key: string) => string;\n }): void {\n this.offForm?.();\n this.offAllowed?.();\n this.form = options.form;\n this.allowedForm = options.allowedForm;\n this.session = options.session;\n this.remote = options.remote;\n this.credentials = options.credentials;\n this.translate = options.t;\n this.state = {\n ...this.state,\n key: { ...this.state.key, unavailable: options.credentials === null },\n };\n if (this.form !== null) {\n this.offForm = this.form.subscribe(() => this.deriveCommitted());\n this.deriveCommitted();\n }\n if (this.allowedForm !== null) {\n this.offAllowed = this.allowedForm.subscribe(() => void this.loadModels());\n void this.loadModels();\n }\n void this.refreshKeyStatus();\n }\n\n getState(): PageState {\n return this.state;\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n /** Read the Host's allowlist and the adapter catalogue into the model options. */\n async loadModels(): Promise<void> {\n const allowedValue = this.allowedForm?.getSnapshot().value;\n const allowed = Array.isArray(allowedValue?.allowedModels)\n ? (allowedValue.allowedModels as { provider?: unknown; model?: unknown }[])\n : [];\n let groups: readonly { id: string; models: readonly { id: string; name: string; reasoning?: { efforts: readonly { id: string }[] } }[] }[] = [];\n let catalogRead = false;\n if (this.session !== null) {\n try {\n const response = await this.session.modelCatalog();\n if (response.ok) {\n groups = response.value.groups;\n catalogRead = true;\n }\n } catch {\n // Handled by the flag below.\n }\n }\n // Whether the effort column may offer a fixed list. When the catalogue could\n // not be read the column falls back to free text rather than going\n // unavailable: an empty list would otherwise disable the effort cell on\n // every row, and a table where no row can be completed is a table that\n // silently stops judging anything.\n this.state = { ...this.state, models: buildModelOptions(allowed, groups), catalogRead };\n this.notify();\n }\n\n /** Read the status-only view of the judgement key. */\n async refreshKeyStatus(): Promise<void> {\n if (this.credentials === null) return;\n try {\n const response = await this.credentials.describe([JUDGE_API_KEY_REF]);\n if (!response.ok) return;\n const info = response.value[JUDGE_API_KEY_REF];\n this.state = {\n ...this.state,\n key: {\n ...this.state.key,\n configured: info?.configured === true,\n writable: info?.writable === true,\n },\n };\n this.notify();\n } catch {\n // The key stays \"not configured\": the status is an enrichment, and a\n // failed read must not claim a key that may not be there.\n }\n }\n\n /**\n * Map the Host's resolved section into committed state and re-seed the drafts.\n *\n * Drafts are held FIELD BY FIELD, against the value this page last saw\n * committed. Holding a whole section instead would make a save write back a\n * field the reader never touched \u2014 reverting a change another page made to it \u2014\n * while holding nothing would discard input mid-typing every time the Host\n * publishes.\n */\n private deriveCommitted(): void {\n const snapshot = this.form?.getSnapshot();\n const value = snapshot?.value;\n if (value === undefined) return;\n const rows = Array.isArray(value.rows) ? (value.rows as unknown[]).map(readRow) : [];\n const committed = {\n enabled: typeof value.enabled === 'boolean' ? value.enabled : true,\n logEnabled: typeof value.logEnabled === 'boolean' ? value.logEnabled : true,\n endpointUrl: typeof value.endpointUrl === 'string' ? value.endpointUrl : DEFAULT_ENDPOINT_URL,\n judgeModel: typeof value.judgeModel === 'string' ? value.judgeModel : DEFAULT_JUDGE_MODEL,\n rows,\n };\n /** Whether the reader's staged value still differs from what this page last saw committed. */\n const staged = <T>(current: T, previously: T): boolean => current !== previously;\n const before = this.state.committed;\n this.state = {\n ...this.state,\n available: snapshot?.status === 'ready',\n writable: snapshot?.writable ?? false,\n committed,\n enabled: staged(this.state.enabled, before.enabled) ? this.state.enabled : committed.enabled,\n logEnabled: staged(this.state.logEnabled, before.logEnabled) ? this.state.logEnabled : committed.logEnabled,\n endpointUrl: staged(this.state.endpointUrl, before.endpointUrl) ? this.state.endpointUrl : committed.endpointUrl,\n judgeModel: staged(this.state.judgeModel, before.judgeModel) ? this.state.judgeModel : committed.judgeModel,\n rows: JSON.stringify(this.state.rows) !== JSON.stringify(before.rows) ? this.state.rows : committed.rows,\n };\n this.recompute();\n }\n\n /** Recompute per-section dirtiness and the row validation against committed values. */\n private recompute(): void {\n const committed = this.state.committed;\n const judgeDirty =\n this.state.enabled !== committed.enabled ||\n this.state.logEnabled !== committed.logEnabled ||\n this.state.endpointUrl !== committed.endpointUrl ||\n this.state.judgeModel !== committed.judgeModel ||\n this.state.key.text.trim() !== '';\n const rowsDirty = JSON.stringify(this.state.rows) !== JSON.stringify(committed.rows);\n this.state = {\n ...this.state,\n judgeDirty,\n rowsDirty,\n dirty: judgeDirty || rowsDirty,\n rowsInvalid: validateRows(this.state.rows, this.translate),\n };\n this.notify();\n }\n\n /** Stage one top-level field. */\n field(key: 'endpointUrl' | 'judgeModel', value: string): void {\n this.state = { ...this.state, [key]: value, saveFailed: '' };\n this.recompute();\n }\n\n /** Stage one switch. */\n toggle(key: 'enabled' | 'logEnabled', value: boolean): void {\n this.state = { ...this.state, [key]: value, saveFailed: '' };\n this.recompute();\n }\n\n /** Stage the judgement key. The value stays in this draft until a save. */\n key(text: string): void {\n this.state = { ...this.state, key: { ...this.state.key, text, failed: false, error: '', landed: '' } };\n this.recompute();\n }\n\n /** Stage one cell of one row. */\n cell(index: number, key: keyof TypeRowDraft, value: string): void {\n const rows = this.state.rows.map((row, at) => (at === index ? { ...row, [key]: value } : row));\n // Choosing a model drops an effort that model does not declare, so a save can\n // never carry an effort the selected route cannot run.\n this.state = {\n ...this.state,\n rows: key === 'model' ? this.reconcileEffort(rows, index) : rows,\n saveFailed: '',\n };\n this.recompute();\n }\n\n /** Drop an effort the freshly selected model does not declare. */\n private reconcileEffort(rows: TypeRowDraft[], index: number): TypeRowDraft[] {\n const row = rows[index];\n if (row === undefined) return rows;\n const option = this.state.models.find(\n (candidate) => candidate.provider === row.provider && candidate.model === row.model,\n );\n if (option === undefined || option.efforts.length === 0) return rows;\n if (row.effort !== '' && !option.efforts.includes(row.effort)) {\n return rows.map((candidate, at) => (at === index ? { ...candidate, effort: '' } : candidate));\n }\n return rows;\n }\n\n /** Append an empty row. */\n addRow(): void {\n this.state = { ...this.state, rows: [...this.state.rows, { description: '', provider: '', model: '', effort: '' }], saveFailed: '' };\n this.recompute();\n }\n\n /**\n * Stage a whole imported list, replacing what the page holds.\n *\n * Nothing is written: an import lands in the drafts exactly like typing does,\n * so the section's own save button is still the only thing that reaches the\n * document, and the reader can discard the import like any other edit.\n *\n * @param rows - the rows read from the pasted JSON.\n */\n replaceRows(rows: readonly TypeRowDraft[]): void {\n this.state = { ...this.state, rows: rows.map((row) => ({ ...row })), saveFailed: '' };\n this.recompute();\n }\n\n /** Delete one row; the remaining rows renumber themselves. */\n removeRow(index: number): void {\n this.state = { ...this.state, rows: this.state.rows.filter((_row, at) => at !== index), saveFailed: '' };\n this.recompute();\n }\n\n /** Discard one section's drafts back to the committed values. */\n revert(section: Section): void {\n const committed = this.state.committed;\n this.state = section === 'judge'\n ? {\n ...this.state,\n enabled: committed.enabled,\n logEnabled: committed.logEnabled,\n endpointUrl: committed.endpointUrl,\n judgeModel: committed.judgeModel,\n // \u53EA\u6E05\u6389\u300C\u8FD8\u6CA1\u4EA4\u51FA\u53BB\u7684\u90A3\u6BB5\u6587\u672C\u300D\u3002\u5BC6\u94A5\u5DF2\u7ECF\u5B58\u5728\u51ED\u636E\u6587\u4EF6\u91CC\uFF0C\u653E\u5F03\u8FD9\u4E00\u8282\u7684\n // \u8BBE\u7F6E\u8349\u7A3F\u4E0D\u8BE5\u8BA9\u9875\u9762\u6539\u53E3\u8BF4\u300C\u8FD8\u6CA1\u6709\u5BC6\u94A5\u300D\u2014\u2014\u90A3\u662F\u53E6\u4E00\u5904\u7684\u72B6\u6001\u3002\n key: { ...this.state.key, text: '', failed: false, error: '', landed: '' },\n saveFailed: '',\n }\n : { ...this.state, rows: committed.rows, saveFailed: '' };\n this.recompute();\n }\n\n /**\n * Write one section's staged edits as one revision-fenced batch.\n *\n * The judgement section also writes a typed key, so naming the endpoint and\n * giving it its credential is one gesture rather than two. The type rows are\n * written whole rather than diffed: the array is one value, and a positional\n * number is derived from it, so a partial write could momentarily renumber the\n * list under a reader mid-save.\n *\n * @param section - which section's drafts to write.\n */\n async save(section: Section): Promise<void> {\n if (this.state.saving !== '') return;\n const form = this.form;\n if (form === null || !this.state.writable) return;\n if (section === 'rows' && (this.state.rowsInvalid !== '' || !this.state.rowsDirty)) return;\n if (section === 'judge' && !this.state.judgeDirty) return;\n\n const ops: SettingsPathOpLike[] = [];\n if (section === 'judge') {\n if (this.state.endpointUrl !== this.state.committed.endpointUrl) {\n ops.push({ op: 'set', path: ['endpointUrl'], value: this.state.endpointUrl });\n }\n if (this.state.judgeModel !== this.state.committed.judgeModel) {\n ops.push({ op: 'set', path: ['judgeModel'], value: this.state.judgeModel });\n }\n if (this.state.enabled !== this.state.committed.enabled) {\n ops.push({ op: 'set', path: ['enabled'], value: this.state.enabled });\n }\n if (this.state.logEnabled !== this.state.committed.logEnabled) {\n ops.push({ op: 'set', path: ['logEnabled'], value: this.state.logEnabled });\n }\n } else if (JSON.stringify(this.state.rows) !== JSON.stringify(this.state.committed.rows)) {\n ops.push({ op: 'set', path: ['rows'], value: this.state.rows.map((row) => ({ ...row })) });\n }\n\n this.state = { ...this.state, saving: section, saveFailed: '', saveError: '' };\n this.notify();\n\n // The key goes first: a document write the Host refuses leaves the key in\n // place, while a key that landed with a refused endpoint is still a landed\n // key. Either way the reader is told which part did not take.\n const typedKey = section === 'judge' ? this.state.key.text.trim() : '';\n let failure = '';\n let keyLanded: '' | 'saved' | 'cleared' = '';\n if (typedKey !== '') {\n const result = await this.writeKey(typedKey);\n if (result.ok) keyLanded = 'saved';\n else failure = result.error;\n }\n if (failure === '' && ops.length > 0) {\n try {\n const landed = await form.mutate(ops, form.getSnapshot().revision);\n // `false` is a refusal, not a rejection: the Host answered and did not\n // accept, so reporting success here would show a saved page over a\n // document that still holds the old value.\n if (!landed) failure = this.translate('save.refused');\n } catch (error) {\n // The Host's own words, not a generic phrase: a rejected write is the one\n // place the reader needs to know WHAT the Host objected to.\n failure = error instanceof Error && error.message !== '' ? error.message : this.translate('save.invalid');\n }\n }\n this.state = {\n ...this.state,\n saving: '',\n saveFailed: failure === '' ? '' : section,\n saveError: failure,\n key: keyLanded === '' ? this.state.key : { ...this.state.key, text: '', landed: keyLanded },\n };\n if (failure === '') this.deriveCommitted();\n else this.notify();\n }\n\n /**\n * Write one judgement key through the credentials service.\n *\n * The service resolves with `{ ok: false }` rather than rejecting when it\n * refuses a write, so that result decides the outcome. The key value is handed\n * straight to the service and is never copied into the page state.\n *\n * @param value - the staged key text, already trimmed and known non-empty.\n * @returns whether the write landed, and the message when it did not.\n */\n private async writeKey(value: string): Promise<{ ok: boolean; error: string }> {\n const credentials = this.credentials;\n if (credentials === null) return { ok: false, error: this.translate('key.unavailable') };\n this.state = { ...this.state, key: { ...this.state.key, saving: true, failed: false, error: '' } };\n this.notify();\n try {\n const response = await credentials.set(JUDGE_API_KEY_REF, value);\n if (!response.ok) {\n const error = response.error.message || this.translate('key.saveFailed');\n this.state = { ...this.state, key: { ...this.state.key, saving: false, failed: true, error } };\n return { ok: false, error };\n }\n this.state = { ...this.state, key: { ...this.state.key, saving: false, failed: false, error: '', configured: true } };\n await this.refreshKeyStatus();\n return { ok: true, error: '' };\n } catch (error) {\n const message = error instanceof Error && error.message !== '' ? error.message : this.translate('key.saveFailed');\n this.state = { ...this.state, key: { ...this.state.key, saving: false, failed: true, error: message } };\n return { ok: false, error: message };\n }\n }\n\n /**\n * Remove the stored judgement key.\n *\n * A separate control rather than \"save an empty field\": the shared\n * configuration form's own rule is that a blank draft writes nothing, so an\n * emptied input cannot mean removal without contradicting it.\n *\n * @returns settlement after the credentials read-back.\n */\n async clearKey(): Promise<void> {\n const credentials = this.credentials;\n if (credentials === null) return;\n this.state = { ...this.state, key: { ...this.state.key, saving: true, failed: false, error: '' } };\n this.notify();\n try {\n const response = await credentials.unset(JUDGE_API_KEY_REF);\n if (!response.ok) {\n this.state = {\n ...this.state,\n key: {\n ...this.state.key,\n saving: false,\n failed: true,\n error: response.error.message || this.translate('key.clearFailed'),\n },\n };\n } else {\n this.state = {\n ...this.state,\n key: { ...this.state.key, saving: false, text: '', failed: false, error: '', landed: 'cleared', configured: false },\n };\n await this.refreshKeyStatus();\n }\n } catch (error) {\n this.state = {\n ...this.state,\n key: {\n ...this.state.key,\n saving: false,\n failed: true,\n error: error instanceof Error && error.message !== '' ? error.message : this.translate('key.clearFailed'),\n },\n };\n }\n this.notify();\n }\n\n /** Read the runtime log from the Host. */\n async refreshLog(): Promise<void> {\n if (this.remote === null) return;\n try {\n const entries = await this.remote.log();\n this.state = { ...this.state, log: entries, logLoaded: true, logFailed: false };\n } catch {\n this.state = { ...this.state, logLoaded: true, logFailed: true };\n }\n this.notify();\n }\n\n /** Read the exact prompt a judgement would send. */\n async preview(): Promise<string | null> {\n if (this.remote === null) return null;\n try {\n return await this.remote.preview();\n } catch {\n return null;\n }\n }\n\n /** Test the judge endpoint against the committed settings. */\n async probe(): Promise<{ ok: boolean; latencyMs: number; reason?: string }> {\n if (this.remote === null) return { ok: false, latencyMs: 0, reason: 'unreachable' };\n try {\n return await this.remote.probe();\n } catch {\n return { ok: false, latencyMs: 0, reason: 'unreachable' };\n }\n }\n\n /** The effort ids available for one row's currently selected model. */\n effortsFor(row: TypeRowDraft): string[] {\n return this.state.models.find(\n (candidate) => candidate.provider === row.provider && candidate.model === row.model,\n )?.efforts ?? [];\n }\n\n /** Whether one row will be offered to the judge (the server's own rule). */\n rowUsable(row: TypeRowDraft): boolean {\n return isSelectableRow(row);\n }\n\n private notify(): void {\n for (const listener of [...this.listeners]) {\n try {\n listener();\n } catch {}\n }\n }\n}\n\nexport const dispatchCardStore = new DispatchCardStore();\n", "// \u7C7B\u578B\u53EA\u8BFB\uFF1A\u5EA7\u4F4D\u5951\u7EA6\u4E0E\u5B83\u7684 LocaleNamespaceMap \u5408\u5E76\u6765\u81EA\u8FD9\u4E2A\u5305\u3002\nimport type {} from '@deepseek-ai/dsh-client-ui-slots';\n\n/** \u8FD9\u4E2A\u63D2\u4EF6\u7684\u5B57\u5178\u547D\u540D\u7A7A\u95F4\uFF1A\u5EA7\u4F4D\u6CE8\u518C\u4E0E\u5361\u7247\u6587\u6848\u90FD\u7528\u5B83\u3002 */\nexport const NS = 'subagentjudgedispatch';\n/** \u82F1\u6587\u6587\u6848\u3002 */\nexport const en = {\n 'tab.design': 'Design',\n 'tab.log': 'Log',\n 'switch.rewrite.title': 'Rewrite subagent model and effort',\n 'switch.rewrite.desc':\n 'Every subagent is judged once when it is delegated. While this is off, nothing is judged and nothing is logged.',\n 'switch.log.title': 'Record the log',\n 'switch.log.desc': 'Write every judgement to a file under the DSH home, so it survives a restart.',\n 'judge.title': 'Judgement service',\n 'judge.desc':\n 'The task type is decided by this endpoint. It receives the delegation label, the task text and the type list, and answers with one type number.',\n 'judge.endpoint': 'Endpoint address',\n 'judge.endpointDesc': 'The full address, including the protocol path. One System One example is prefilled.',\n 'judge.model': 'Judgement model',\n 'judge.modelDesc': 'The model id this endpoint interprets.',\n 'judge.key': 'Key',\n 'judge.keyDesc': 'Stored write-only as {ref} in {path}. It is never read back into this page.',\n 'judge.keyPlaceholder': 'Paste the key',\n 'judge.keyPlaceholderSet': 'A key is stored; type a new one to replace it',\n 'judge.keySet': 'Key stored',\n 'judge.keyUnset': 'No key',\n 'judge.keyClear': 'Remove the key',\n 'judge.keySaved': 'The key is stored.',\n 'judge.keyCleared': 'The key was removed.',\n 'judge.keyFailed': 'The key was not stored: {error}',\n 'key.unavailable': 'The credentials service is unavailable on this page.',\n 'judge.keyUnavailable': 'This page has no credentials channel, so a key cannot be stored from here.',\n 'key.saveFailed': 'The key was not accepted.',\n 'key.clearFailed': 'The key was not removed.',\n 'judge.probe': 'Test the connection',\n 'judge.probing': 'Testing\u2026',\n 'judge.probeOk': 'Connected in {latency} ms',\n 'judge.probeFail': 'Not usable: {reason}',\n 'reason.unconfigured': 'the endpoint address or model is not filled in',\n 'reason.unreachable': 'the endpoint could not be reached',\n 'reason.timeout': 'it did not answer within 5 seconds',\n 'reason.unmatched': 'the answer named no listed type',\n 'reason.incomplete': 'the selected type is not filled in',\n 'reason.other': 'other',\n 'reason.unknown': 'unknown reason',\n 'rows.title': 'Task types',\n 'rows.desc':\n 'One row per task type: the number it answers with, the description it reads, the model it runs on, and the effort. Numbers are assigned for you, always 1, 2, 3\u2026',\n 'rows.empty': 'No task type yet. Add one below.',\n 'rows.colId': 'No.',\n 'rows.colType': 'Task type',\n 'rows.colDescription': 'Description',\n 'rows.colModel': 'Model',\n 'rows.colEffort': 'Effort',\n 'rows.add': 'Add a row',\n 'rows.remove': 'Remove',\n 'rows.browse': 'View',\n 'rows.browseTitle': 'Task type {id}',\n 'rows.browseClose': 'Close',\n 'rows.modelPlaceholder': 'Not chosen',\n 'rows.effortPlaceholder': 'Not chosen',\n 'rows.incomplete': 'Not used',\n 'rows.descriptionPlaceholder': 'What kind of job is this? Write as much as you like.',\n 'rows.allowedEmpty':\n 'The host setting \"models subagents may choose\" is empty, so there is nothing to pick. Fill it in on the Subagent settings page first.',\n 'rows.importOpen': 'Import',\n 'rows.export': 'Export',\n 'rows.exported': 'Copied the task-type list as JSON.',\n 'rows.exportFailed': 'Could not copy to the clipboard.',\n 'rows.importTitle': 'Import the task-type list',\n 'rows.importDesc': 'Paste the JSON list here. It fills the table below; nothing is written until you press Save.',\n 'rows.importPlaceholder': '[\\n { \"description\": \"...\", \"provider\": \"...\", \"model\": \"...\", \"effort\": \"...\" }\\n]',\n 'rows.importApply': 'Fill in',\n 'rows.importCancel': 'Cancel',\n 'rows.importBadJson': 'This is not valid JSON.',\n 'rows.importBadShape': 'This is not a list of task types: every entry needs description, provider, model and effort as text.',\n 'rows.importEmpty': 'There is no task type in this list.',\n 'preview.title': 'View the full prompt',\n 'preview.desc': 'Exactly what would be sent to the judgement service. The delegation label and the task text are filled in at delegation time.',\n 'preview.open': 'View the full prompt',\n 'preview.copy': 'Copy',\n 'preview.copied': 'Copied',\n 'preview.close': 'Close',\n 'preview.blocked': 'Save your changes first.',\n 'preview.failed': 'The preview could not be read.',\n 'save.button': 'Save',\n 'save.saving': 'Saving\u2026',\n 'save.unsaved': 'There are unsaved changes.',\n 'save.discard': 'Discard',\n 'save.refusedTitle': 'This cannot be saved yet',\n 'save.failed': 'The save did not land: {error}',\n 'save.duplicateDescription': 'Two rows have the same description. Give them different descriptions before saving.',\n 'save.emptyDescription': 'Every row needs a description before it can be saved.',\n 'save.invalid': 'This cannot be saved yet.',\n 'save.refused': 'The host did not accept this write.',\n 'log.title': 'Judgement log',\n 'log.desc': 'The most recent 10 judgements, newest first; the file keeps more. Click one to see the exact prompt that was sent.',\n 'log.empty': 'No judgement has run yet.',\n 'log.colResult': 'Result',\n 'log.colChoice': 'Choice',\n 'log.colParent': 'Main agent',\n 'log.colChild': 'Subagent',\n 'log.colTime': 'Time',\n 'log.colLatency': 'Took',\n 'log.resultJudged': 'Type {id}',\n 'log.resultInherited': 'No match',\n 'log.promptTitle': 'The prompt sent to the judge',\n 'log.promptDesc': 'Exactly the request body this judgement sent.',\n 'log.promptClose': 'Close',\n 'log.promptEmpty': 'No request was sent for this judgement.',\n 'log.refresh': 'Refresh',\n 'log.loadFailed': 'The log could not be read.',\n 'ms': '{value} ms',\n};\n\n/** \u4E2D\u6587\u6587\u6848\u3002\u952E\u96C6\u4E0E\u82F1\u6587\u9010\u4E00\u5BF9\u9F50\uFF08smoke-client \u4F1A\u67E5\u8FD9\u4E00\u6761\uFF09\u3002 */\nexport const zh: Record<keyof typeof en, string> = {\n 'tab.design': '\u8BBE\u8BA1',\n 'tab.log': '\u65E5\u5FD7',\n 'switch.rewrite.title': '\u6539\u5199\u5B50\u4EE3\u7406\u7684\u6A21\u578B\u4E0E\u5F3A\u5EA6',\n 'switch.rewrite.desc': '\u6BCF\u4E2A\u5B50\u4EE3\u7406\u5728\u6D3E\u5DE5\u90A3\u4E00\u523B\u5224\u65AD\u4E00\u6B21\u3002\u8FD9\u4E2A\u5F00\u5173\u5173\u7740\u65F6\u4E0D\u5224\u65AD\uFF0C\u4E5F\u4E0D\u8BB0\u65E5\u5FD7\u3002',\n 'switch.log.title': '\u8BB0\u5F55\u65E5\u5FD7',\n 'switch.log.desc': '\u628A\u6BCF\u6B21\u5224\u65AD\u5199\u8FDB DSH \u5BB6\u76EE\u5F55\u91CC\u7684\u4E00\u4E2A\u6587\u4EF6\uFF0C\u91CD\u542F\u4E4B\u540E\u7167\u6837\u5728\u3002',\n 'judge.title': '\u5224\u65AD\u670D\u52A1',\n 'judge.desc': '\u4EFB\u52A1\u7C7B\u578B\u7531\u8FD9\u4E2A\u5730\u5740\u51B3\u5B9A\uFF1A\u5B83\u6536\u5230\u6D3E\u5DE5\u6807\u7B7E\u3001\u4EFB\u52A1\u6B63\u6587\u548C\u7C7B\u578B\u6E05\u5355\uFF0C\u56DE\u7B54\u4E00\u4E2A\u7C7B\u578B\u7F16\u53F7\u3002',\n 'judge.endpoint': '\u7AEF\u70B9\u5730\u5740',\n 'judge.endpointDesc': '\u5B8C\u6574\u5730\u5740\uFF0C\u8981\u5E26\u534F\u8BAE\u8DEF\u5F84\u3002\u5DF2\u7ECF\u9884\u586B\u4E00\u4E2A System One \u7684\u4F8B\u5B50\u3002',\n 'judge.model': '\u5224\u65AD\u6A21\u578B',\n 'judge.modelDesc': '\u8FD9\u4E2A\u5730\u5740\u6240\u4F7F\u7528\u7684\u6A21\u578B\u540D\u3002',\n 'judge.key': '\u5BC6\u94A5',\n 'judge.keyDesc': '\u4EE5 {ref} \u7684\u540D\u5B57\u5B58\u8FDB {path}\uFF0C\u53EA\u5199\u4E0D\u8BFB\uFF0C\u4E0D\u4F1A\u56DE\u586B\u5230\u8FD9\u4E00\u9875\u3002',\n 'judge.keyPlaceholder': '\u628A\u5BC6\u94A5\u8D34\u8FDB\u6765',\n 'judge.keyPlaceholderSet': '\u5DF2\u7ECF\u5B58\u4E86\u5BC6\u94A5\uFF0C\u8981\u6362\u5C31\u586B\u4E00\u4E2A\u65B0\u7684',\n 'judge.keySet': '\u5DF2\u5B58\u5BC6\u94A5',\n 'judge.keyUnset': '\u8FD8\u6CA1\u6709\u5BC6\u94A5',\n 'judge.keyClear': '\u5220\u6389\u5BC6\u94A5',\n 'judge.keySaved': '\u5BC6\u94A5\u5DF2\u5B58\u3002',\n 'judge.keyCleared': '\u5BC6\u94A5\u5DF2\u5220\u6389\u3002',\n 'judge.keyFailed': '\u5BC6\u94A5\u6CA1\u5B58\u4E0A\uFF1A{error}',\n 'key.unavailable': '\u8FD9\u4E2A\u9875\u9762\u4E0A\u7528\u4E0D\u4E86\u51ED\u636E\u670D\u52A1\u3002',\n 'judge.keyUnavailable': '\u8FD9\u4E2A\u9875\u9762\u4E0A\u6CA1\u6709\u51ED\u636E\u901A\u9053\uFF0C\u5728\u8FD9\u91CC\u5B58\u4E0D\u4E86\u5BC6\u94A5\u3002',\n 'key.saveFailed': '\u5BC6\u94A5\u6CA1\u88AB\u63A5\u53D7\u3002',\n 'key.clearFailed': '\u5BC6\u94A5\u6CA1\u5220\u6389\u3002',\n 'judge.probe': '\u8BD5\u4E00\u4E0B\u901A\u4E0D\u901A',\n 'judge.probing': '\u6B63\u5728\u8BD5\u2026',\n 'judge.probeOk': '\u8FDE\u4E0A\u4E86\uFF0C\u7528\u4E86 {latency} \u6BEB\u79D2',\n 'judge.probeFail': '\u7528\u4E0D\u4E86\uFF1A{reason}',\n 'reason.unconfigured': '\u7AEF\u70B9\u5730\u5740\u6216\u5224\u65AD\u6A21\u578B\u8FD8\u6CA1\u586B',\n 'reason.unreachable': '\u8FDE\u4E0D\u4E0A\u8FD9\u4E2A\u5730\u5740',\n 'reason.timeout': '\u7B49\u4E86 5 \u79D2\u6CA1\u56DE',\n 'reason.unmatched': '\u7B54\u590D\u5BF9\u4E0D\u4E0A\u6E05\u5355',\n 'reason.incomplete': '\u9009\u4E2D\u7684\u7C7B\u578B\u6CA1\u586B\u5168',\n 'reason.other': '\u5176\u4ED6',\n 'reason.unknown': '\u539F\u56E0\u4E0D\u660E',\n 'rows.title': '\u4EFB\u52A1\u7C7B\u578B',\n 'rows.desc':\n '\u4E00\u884C\u4E00\u4E2A\u4EFB\u52A1\u7C7B\u578B\uFF1A\u5B83\u56DE\u7B54\u7684\u7F16\u53F7\u3001\u5B83\u8BFB\u7684\u63CF\u8FF0\u3001\u8BE5\u7528\u7684\u6A21\u578B\u4E0E\u5F3A\u5EA6\u3002\u7F16\u53F7\u7531\u63D2\u4EF6\u81EA\u52A8\u6392\uFF0C\u6C38\u8FDC\u4ECE 1 \u5F80\u540E\u8FDE\u7740\u3002',\n 'rows.empty': '\u8FD8\u6CA1\u6709\u4EFB\u52A1\u7C7B\u578B\u3002\u5728\u4E0B\u9762\u52A0\u4E00\u884C\u3002',\n 'rows.colId': '\u7F16\u53F7',\n 'rows.colType': '\u4EFB\u52A1\u7C7B\u578B',\n 'rows.colDescription': '\u63CF\u8FF0',\n 'rows.colModel': '\u6A21\u578B',\n 'rows.colEffort': '\u5F3A\u5EA6',\n 'rows.add': '\u52A0\u4E00\u884C',\n 'rows.remove': '\u5220\u6389',\n 'rows.browse': '\u67E5\u770B',\n 'rows.browseTitle': '\u4EFB\u52A1\u7C7B\u578B {id}',\n 'rows.browseClose': '\u5173\u95ED',\n 'rows.modelPlaceholder': '\u8FD8\u6CA1\u9009',\n 'rows.effortPlaceholder': '\u8FD8\u6CA1\u9009',\n 'rows.incomplete': '\u4E0D\u751F\u6548',\n 'rows.descriptionPlaceholder': '\u8FD9\u662F\u54EA\u79CD\u6D3B\uFF1F\u5199\u591A\u5C11\u90FD\u884C\u3002',\n 'rows.allowedEmpty': '\u5BBF\u4E3B\u90A3\u4EFD\u300C\u5B50\u4EE3\u7406\u53EF\u9009\u7528\u54EA\u4E9B\u6A21\u578B\u300D\u8FD8\u662F\u7A7A\u7684\uFF0C\u6CA1\u6709\u53EF\u4EE5\u9009\u7684\u4E1C\u897F\u3002\u5148\u5230\u5B50\u4EE3\u7406\u8BBE\u7F6E\u9875\u628A\u5B83\u586B\u4E0A\u3002',\n 'rows.importOpen': '\u5BFC\u5165',\n 'rows.export': '\u5BFC\u51FA',\n 'rows.exported': '\u5DF2\u7ECF\u628A\u4EFB\u52A1\u7C7B\u578B\u6E05\u5355\u6309 JSON \u590D\u5236\u8D70\u4E86\u3002',\n 'rows.exportFailed': '\u590D\u5236\u5230\u526A\u8D34\u677F\u6CA1\u6210\u529F\u3002',\n 'rows.importTitle': '\u5BFC\u5165\u4EFB\u52A1\u7C7B\u578B',\n 'rows.importDesc': '\u628A JSON \u6E05\u5355\u7C98\u8D34\u5230\u8FD9\u91CC\u3002\u5B83\u53EA\u586B\u4E0B\u9762\u90A3\u5F20\u8868\uFF0C\u6309\u300C\u4FDD\u5B58\u300D\u4E4B\u524D\u4E00\u4E2A\u5B57\u90FD\u4E0D\u5199\u3002',\n 'rows.importPlaceholder': '[\\n { \"description\": \"\u2026\u2026\", \"provider\": \"\u2026\u2026\", \"model\": \"\u2026\u2026\", \"effort\": \"\u2026\u2026\" }\\n]',\n 'rows.importApply': '\u586B\u8FDB\u53BB',\n 'rows.importCancel': '\u53D6\u6D88',\n 'rows.importBadJson': '\u8FD9\u4E0D\u662F\u5408\u6CD5\u7684 JSON\u3002',\n 'rows.importBadShape': '\u8FD9\u4E0D\u662F\u4E00\u4EFD\u4EFB\u52A1\u7C7B\u578B\u6E05\u5355\uFF1A\u6BCF\u4E00\u6761\u90FD\u8981\u6709 description\u3001provider\u3001model\u3001effort \u56DB\u4E2A\u6587\u5B57\u5B57\u6BB5\u3002',\n 'rows.importEmpty': '\u8FD9\u4EFD\u6E05\u5355\u91CC\u4E00\u6761\u4EFB\u52A1\u7C7B\u578B\u90FD\u6CA1\u6709\u3002',\n 'preview.title': '\u67E5\u770B\u5B8C\u6574\u9884\u89C8',\n 'preview.desc': '\u771F\u6B63\u4F1A\u53D1\u7ED9\u5224\u65AD\u670D\u52A1\u7684\u90A3\u6BB5\u5185\u5BB9\u3002\u6D3E\u5DE5\u6807\u7B7E\u4E0E\u4EFB\u52A1\u6B63\u6587\u90FD\u5728\u6D3E\u5DE5\u90A3\u4E00\u523B\u624D\u586B\u8FDB\u53BB\u3002',\n 'preview.open': '\u67E5\u770B\u5B8C\u6574\u9884\u89C8',\n 'preview.copy': '\u590D\u5236',\n 'preview.copied': '\u5DF2\u590D\u5236',\n 'preview.close': '\u5173\u95ED',\n 'preview.blocked': '\u5148\u628A\u6539\u52A8\u4FDD\u5B58\u4E0B\u6765\u3002',\n 'preview.failed': '\u9884\u89C8\u8BFB\u4E0D\u51FA\u6765\u3002',\n 'save.button': '\u4FDD\u5B58',\n 'save.saving': '\u6B63\u5728\u4FDD\u5B58\u2026',\n 'save.unsaved': '\u6709\u8FD8\u6CA1\u4FDD\u5B58\u7684\u6539\u52A8\u3002',\n 'save.discard': '\u653E\u5F03\u6539\u52A8',\n 'save.refusedTitle': '\u73B0\u5728\u8FD8\u5B58\u4E0D\u4E86',\n 'save.failed': '\u6CA1\u4FDD\u5B58\u4E0A\uFF1A{error}',\n 'save.duplicateDescription': '\u6709\u4E24\u6761\u7684\u63CF\u8FF0\u4E00\u6A21\u4E00\u6837\u3002\u6539\u6210\u4E0D\u4E00\u6837\u7684\u518D\u4FDD\u5B58\u3002',\n 'save.emptyDescription': '\u6BCF\u4E00\u884C\u90FD\u8981\u6709\u63CF\u8FF0\u624D\u80FD\u4FDD\u5B58\u3002',\n 'save.invalid': '\u73B0\u5728\u8FD8\u5B58\u4E0D\u4E86\u3002',\n 'save.refused': '\u5BBF\u4E3B\u6CA1\u6709\u63A5\u53D7\u8FD9\u6B21\u5199\u5165\u3002',\n 'log.title': '\u5224\u65AD\u65E5\u5FD7',\n 'log.desc': '\u6700\u8FD1 10 \u6761\u5224\u65AD\uFF0C\u65B0\u7684\u5728\u6700\u524D\u9762\uFF1B\u6587\u4EF6\u91CC\u7559\u5F97\u66F4\u591A\u3002\u70B9\u4E00\u884C\u770B\u8FD9\u6B21\u53D1\u7ED9\u5224\u65AD\u6A21\u578B\u7684\u90A3\u6BB5\u5185\u5BB9\u3002',\n 'log.empty': '\u8FD8\u6CA1\u6709\u5224\u65AD\u8FC7\u3002',\n 'log.colResult': '\u7ED3\u679C',\n 'log.colChoice': '\u9009\u62E9',\n 'log.colParent': '\u4E3B\u4EE3\u7406',\n 'log.colChild': '\u5B50\u4EE3\u7406',\n 'log.colTime': '\u65F6\u95F4',\n 'log.colLatency': '\u8017\u65F6',\n 'log.resultJudged': '\u7C7B\u578B {id}',\n 'log.resultInherited': '\u672A\u5224\u6210',\n 'log.promptTitle': '\u53D1\u7ED9\u5224\u65AD\u6A21\u578B\u7684\u5185\u5BB9',\n 'log.promptDesc': '\u8FD9\u6B21\u5224\u65AD\u771F\u6B63\u53D1\u51FA\u53BB\u7684\u8BF7\u6C42\u4F53\u3002',\n 'log.promptClose': '\u5173\u95ED',\n 'log.promptEmpty': '\u8FD9\u6B21\u5224\u65AD\u6CA1\u6709\u53D1\u51FA\u8BF7\u6C42\u3002',\n 'log.refresh': '\u5237\u65B0',\n 'log.loadFailed': '\u65E5\u5FD7\u8BFB\u4E0D\u51FA\u6765\u3002',\n 'ms': '{value} \u6BEB\u79D2',\n};\n\n/**\n * \u628A\u5B57\u5178\u4EA4\u7ED9\u5BBF\u4E3B\u3002\u547D\u540D\u7A7A\u95F4\u4E0E\u952E\u96C6\u5728\u8FD9\u91CC\u58F0\u660E\u7684\u7C7B\u578B\u540C\u65F6\u662F\u5EA7\u4F4D `t` \u7684\u5951\u7EA6\u3002\n * @param ctx - \u5BA2\u6237\u7AEF\u4E0A\u4E0B\u6587\uFF08`locale` \u7531 inject \u58F0\u660E\uFF09\u3002\n */\nexport function apply(ctx: {\n effect(factory: () => () => void, label?: string): unknown;\n locale: { register(ns: string, dictionaries: unknown): () => void };\n}): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-subagent-judge-dispatch: dictionaries');\n}\n\n/** \u672C\u547D\u540D\u7A7A\u95F4\u5168\u90E8\u952E\u7684\u7C7B\u578B\uFF0C\u5EA7\u4F4D\u4E0A\u7684 `t` \u6309\u5B83\u505A\u952E\u68C0\u67E5\u3002 */\nexport type JudgeDispatchLocaleKey = keyof typeof en;\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** \u672C\u63D2\u4EF6\u914D\u7F6E\u5361\u7247\u7684\u6587\u6848\u3002 */\n subagentjudgedispatch: JudgeDispatchLocaleKey;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAoC;AAGpC,sCAWO;;;ACEA,IAAM,cAAc;AAGpB,IAAM,qBAAqB;AAG3B,IAAM,oBAAoB;AAc1B,SAAS,gBACd,OACA,UACY;AACZ,MAAI,CAAC,SAAS,OAAO,MAAM,WAAW,WAAY,QAAO,MAAM;AAAA,EAAC;AAChE,SAAO,MAAM,OAAO,oBAAoB,QAAQ;AAClD;;;AC0CO,SAAS,gBAAgB,KAA8D;AAC5F,SAAO,IAAI,SAAS,KAAK,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ACtD,MAAI;AACF,sBAAkB,OAAO;AAAA,MACvB,MAAM,IAAI,YAAY,IAAI,kBAAkB;AAAA;AAAA;AAAA,MAG5C,aAAa,IAAI,YAAY,IAAI,wBAAwB;AAAA,MACzD,SAAS,IAAI,QAAQ,WAAW;AAAA,MAChC,QAAQ,qBAAqB;AAAA;AAAA,MAE7B,aAAa,IAAI,QAAQ,eAAe;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ,KAAK,wFAA2C,KAAK;AAAA,EAC/D;AAQA,MAAI;AAAA,IACF,MAAM,IAAI,YAAY,YAAY,CAAC,kBAAkB,GAAG,MACtD,gBAAgB,IAAI,OAAO,MACxB,IAAI,MAAkD;AAAA,MACrD;AAAA,QACE,MAAM;AAAA,QACN,KAAK;AAAA,QACL,QAAQ;AAAA,MACV;AAAA,MACA;AAAA,IACF,CAAC,CAAC;AAAA,IACN;AAAA,EACF;AACF;;;ADp1BO,IAAM,OAAO;AACb,IAAM,SAAS,CAAC,SAAS,eAAe,UAAU,kBAAkB,sBAAsB,QAAQ;AAMlG,SAASC,OAAM,KAA0B;AAC9C,mBAAiB;AACjB,QAAqB,GAAG;AACxB,MAAI;AAAA,IACF,MAAM;AACJ,sBAAgB,GAAY;AAC5B,aAAO,MAAM;AAAA,MAAC;AAAA,IAChB;AAAA,IACA;AAAA,EACF;AACF;AAMO,IAAM,iBAAiB,EAAE,IAAI,GAAG;",
|
|
4
|
+
"sourcesContent": ["import type { Context as ClientContext } from '@deepseek-ai/cordis';\n// \u7C7B\u578B\u53EA\u8BFB\uFF1A\u8FD9\u4E9B\u5305\u7684\u6D4F\u89C8\u5668\u534A\u8FB9\u628A\u5EA7\u4F4D\u5951\u7EA6\u4E0E `ctx.configForms` \u5408\u5E76\u8FDB Context\u3002\nimport type {} from '@deepseek-ai/dsh-client-locale/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client';\nimport { injectCardStyles, setupSettingsUi } from './settings/ui.tsx';\nimport { apply as registerDictionaries, en, zh } from './locales.ts';\n\n/**\n * \u6D4F\u89C8\u5668\u534A\u8FB9\uFF1A\u628A\u914D\u7F6E\u5361\u7247\u6302\u5230\u5BBF\u4E3B\u7684\u300C\u63D2\u4EF6\u300D\u9875\u4E0A\u3002\n *\n * `inject` \u662F cordis \u670D\u52A1\u540D\uFF08`remote.credentials` \u662F\u5224\u65AD\u5BC6\u94A5\u7684\u5199\u5165\u901A\u9053\uFF09\uFF1B\n * `package.json` \u7684 `dsh.client.inject` \u662F\u5305\u540D\u3002\n * \u4E24\u5C42\u90FD\u8981\u58F0\u660E\uFF0C\u6F0F\u4E00\u5C42\u6574\u6761 loader entry \u4F1A\u9759\u9ED8\u53D8\u6210 failed\uFF0C\u9875\u9762\u4E0A\u4EC0\u4E48\u4E5F\u770B\u4E0D\u89C1\n * \uFF08\u89C1 docs/rules/client-wiring.md\uFF09\u3002\n */\nexport const name = '@lynn123411/dsh-subagent-judge-dispatch';\nexport const inject = ['slots', 'configForms', 'remote', 'remote.session', 'remote.credentials', 'locale'];\n\n/**\n * \u63D2\u4EF6\u672C\u4F53\uFF1A\u6CE8\u518C\u5B57\u5178\uFF0C\u518D\u6302\u914D\u7F6E\u5361\u7247\u3002\n * @param ctx - \u5BA2\u6237\u7AEF\u6839\u4E0A\u4E0B\u6587\u3002\n */\nexport function apply(ctx: ClientContext): void {\n injectCardStyles();\n registerDictionaries(ctx);\n ctx.effect(\n () => {\n setupSettingsUi(ctx as never);\n return () => {};\n },\n 'dsh-subagent-judge-dispatch: plugins page config',\n );\n}\n\nexport { NS } from './locales.ts';\nexport { en, zh } from './locales.ts';\n\n/** \u5B57\u5178\u672C\u4F53\uFF0C\u968F bundle \u5BFC\u51FA\u4F9B\u81EA\u68C0\u6838\u5BF9\u952E\u96C6\u3002 */\nexport const __dictionaries = { en, zh };\nexport { JudgeDispatchPanel, injectCardStyles, setupSettingsUi } from './settings/ui.tsx';\nexport {\n ALLOWED_MODELS_NAMESPACE,\n buildModelOptions,\n createDispatchRemote,\n describeChoice,\n describeModel,\n dispatchCardStore,\n readRow,\n SETTINGS_NAMESPACE,\n validateRows,\n} from './settings/store.ts';\n", "import { useEffect, useState } from 'react';\nimport * as React from 'react';\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';\nimport {\n Button,\n CodeBlock,\n Input,\n Menu,\n Modal,\n SegmentedTabs,\n Switch,\n Tag,\n Tooltip,\n writeClipboard,\n} from '@deepseek-ai/dsh-client-ui-primitives';\nimport {\n BUNDLE_CONFIG_KEY,\n BUNDLE_CONFIG_SLOT,\n setupPluginPage,\n} from './plugin-page.ts';\nimport {\n ALLOWED_MODELS_NAMESPACE,\n createDispatchRemote,\n describeChoice,\n describeModel,\n dispatchCardStore,\n exportRowsJson,\n JUDGE_API_KEY_REF,\n parseRowsJson,\n type CredentialsRemoteLike,\n routeKey,\n SETTINGS_NAMESPACE,\n splitRouteKey,\n type LogRow,\n type PageState,\n type Section,\n type TypeRowDraft,\n} from './store.ts';\nimport { NS } from '../locales.ts';\n\n/** \u5BFC\u5165\u88AB\u62D2\u65F6\u90A3\u53E5\u8BDD\u7684\u952E\uFF1A\u4E09\u79CD\u574F\u8F93\u5165\u5404\u8BF4\u5404\u7684\uFF0C\u4E0D\u5728\u8C03\u7528\u5904\u62FC\u952E\u540D\u3002 */\nconst IMPORT_ERROR_KEYS = {\n json: 'rows.importBadJson',\n shape: 'rows.importBadShape',\n empty: 'rows.importEmpty',\n} as const;\n\n/** Path shown in the key hint; the value itself never reaches the page. */\nconst CREDENTIALS_PATH = '~/.dsh/.credentials.yaml';\n\n/** One localized template with technical samples rendered inline. */\nfunction withSamples(text: string, samples: Record<string, string>): React.ReactNode {\n return text.split(/(\\{\\w+\\})/g).map((part, index) => {\n const name = /^\\{\\w+\\}$/.test(part) ? part.slice(1, -1) : '';\n const sample = name === '' ? undefined : samples[name];\n return sample === undefined ? part : <code key={index}>{sample}</code>;\n });\n}\n\n/**\n * One log cell: the text clips to its column, and the whole value is one hover\n * away.\n *\n * The bubble is the Host's `Tooltip`, not a native `title`: the Host's own rule\n * is that a hover surface comes from the primitives package, and the native one\n * cannot be reached by keyboard. It carries `hint` when the cell has something\n * the column itself has no room for \u2014 the reason a judgement did not match, or\n * the provider behind a choice cell that shows only model and effort \u2014 and the\n * cell's own text otherwise.\n *\n * @param props.text - the value shown in the cell.\n * @param props.hint - extra text the bubble should carry instead of `text`.\n * @returns the cell.\n */\nfunction LogCell({ text, hint }: { text: string; hint?: string }): React.ReactElement {\n const label = hint === undefined || hint === '' ? text : hint;\n return (\n <Tooltip label={label} side=\"top\" portal>\n <span className=\"dsh-judge-cell-clip\">{text}</span>\n </Tooltip>\n );\n}\n\n/**\n * The card's own styles.\n *\n * Only the shapes the Host's controls do not carry: the settings-card material\n * (R20, the settings stroke and fill), the section and field rows, and the\n * task-type table. Every colour resolves through a `--dsw-alias-*` token, and\n * every elevated surface uses the settings-card material rather than a border\n * plus a shadow.\n */\nconst CARD_CSS = `\n.dsh-judge-card { display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; width: 100%; color: var(--dsw-alias-label-primary); }\n.dsh-judge-panel { display: flex; flex-direction: column; gap: 16px; }\n.dsh-judge-section {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px 18px;\n border: 0.5px solid var(--dsw-alias-settings-card-stroke);\n border-radius: var(--dsw-radius-xl);\n background: var(--dsw-alias-settings-card-fill);\n}\n.dsh-judge-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.dsh-judge-title { font: var(--dsw-font-s-strong-14); }\n.dsh-judge-desc { max-width: 46em; color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-desc code { font-family: var(--ds-font-family-code); }\n.dsh-judge-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }\n.dsh-judge-row + .dsh-judge-row { padding-top: 12px; border-top: 0.5px solid var(--dsw-alias-border-l3); }\n.dsh-judge-row-info { flex: 1; min-width: 0; }\n.dsh-judge-row-title { font: var(--dsw-font-xs-strong-13); }\n.dsh-judge-row-hint { margin-top: 2px; color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-row-field { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; box-sizing: border-box; width: 360px; max-width: 100%; }\n/* \u5BBF\u4E3B\u7684 Input \u628A\u8F93\u5165\u6846\u5305\u5728\u4E00\u5C42 inline-flex \u7684 span \u91CC\uFF0C\u7C7B\u540D\u843D\u5728\u90A3\u5C42 span \u4E0A\uFF0C\n \u6240\u4EE5\u8981\u6491\u7684\u662F\u5B83\uFF0C\u53EA\u7ED9 input \u5199\u5BBD\u5EA6\u6CA1\u7528\u3002 */\n.dsh-judge-field { display: flex; box-sizing: border-box; width: 100%; min-width: 0; }\n.dsh-judge-field input { box-sizing: border-box; width: 100%; min-width: 0; }\n.dsh-judge-key-line { display: flex; align-items: center; gap: 8px; box-sizing: border-box; width: 100%; }\n.dsh-judge-off { display: block; color: var(--dsw-alias-state-warn-label); font: var(--dsw-font-xxxs-11); white-space: nowrap; }\n/* \u8FD9\u4E00\u8282\u7684\u51FA\u53E3\uFF1A\u5DE6\u8FB9\u5199\u4E0B\u53BB\uFF0C\u53F3\u8FB9\u67E5\u5DF2\u6709\u7684\u2014\u2014\u4E24\u4E2A\u65B9\u5411\u5206\u5F00\uFF0C\u6309\u9519\u4E00\u4E2A\u4E0D\u4F1A\u4E32\u5230\u53E6\u4E00\u4E2A\u3002 */\n.dsh-judge-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 0.5px solid var(--dsw-alias-border-l3); }\n.dsh-judge-actions-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n/* \u5361\u7247\u6700\u4E0B\u9762\u7684\u51FA\u53E3\uFF1A\u53EA\u6709\u9884\u89C8\u8FD9\u4E00\u4EF6\u8DE8\u8282\u7684\u52A8\u4F5C\uFF0C\u9760\u53F3\u4E0E\u4E24\u8282\u7684\u53F3\u8FB9\u7F18\u5BF9\u9F50\uFF1B\u8981\u5148\u628A\u6539\u52A8\n \u5B58\u4E0B\u53BB\u65F6\uFF0C\u90A3\u53E5\u63D0\u9192\u5728\u5B83\u5DE6\u8FB9\u3002 */\n.dsh-judge-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }\n.dsh-judge-hint { color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-note-ok { color: var(--dsw-alias-state-success-primary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-note-bad { color: var(--dsw-alias-state-error-primary); font: var(--dsw-font-xxs-12); }\n.dsh-judge-field-wrap { display: flex; box-sizing: border-box; width: 100%; min-width: 0; }\n.dsh-judge-table { box-sizing: border-box; width: 100%; border-collapse: collapse; table-layout: fixed; }\n.dsh-judge-table th, .dsh-judge-table td { box-sizing: border-box; }\n.dsh-judge-table th {\n padding: 0 8px 6px 0;\n color: var(--dsw-alias-label-tertiary);\n font: var(--dsw-font-xxs-12);\n text-align: left;\n}\n.dsh-judge-table td { padding: 6px 8px 6px 0; vertical-align: middle; }\n.dsh-judge-table tbody tr + tr td { border-top: 0.5px solid var(--dsw-alias-border-l3); }\n.dsh-judge-table td:last-child, .dsh-judge-table th:last-child { padding-right: 0; }\n.dsh-judge-col-no { width: 52px; }\n.dsh-judge-col-model { width: 188px; }\n.dsh-judge-col-effort { width: 124px; }\n.dsh-judge-col-actions { width: 148px; }\n.dsh-judge-no { color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); font-variant-numeric: tabular-nums; }\n.dsh-judge-row-off .dsh-judge-field { opacity: 0.6; }\n.dsh-judge-cell-actions { display: flex; gap: 6px; }\n.dsh-judge-log { display: flex; flex-direction: column; gap: 4px; font: var(--dsw-font-xxs-12); }\n/* \u516D\u5217\u7684\u5BBD\u5EA6\u6309\u5185\u5BB9\u5B9A\uFF1A\u7ED3\u679C\u4E0E\u65F6\u95F4\u662F\u5B9A\u957F\u7684\uFF0C\u9009\u62E9\u6700\u957F\u3001\u4E3B\u4EE3\u7406\u4E0E\u5B50\u4EE3\u7406\u5404\u5360\u4E00\u4EFD\u4F59\u91CF\u3002\n minmax(0, \u2026) \u662F\u622A\u65AD\u7684\u524D\u63D0\u2014\u2014\u4E0D\u7ED9\u4E0B\u9650\u5F52\u96F6\uFF0C\u957F\u5185\u5BB9\u4F1A\u628A\u6574\u5217\u6491\u51FA\u53BB\u3002 */\n.dsh-judge-log-row { display: grid; grid-template-columns: 72px minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 62px 74px; gap: 8px; align-items: center; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: var(--dsw-radius-sm); cursor: pointer; color: inherit; font: inherit; }\n.dsh-judge-cell-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-judge-log-row:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.dsh-judge-log-head { font-weight: 600; color: var(--dsw-alias-label-tertiary); cursor: default; }\n.dsh-judge-log-head:hover { background: none; }\n/* \u5F39\u7A97\u91CC\u662F\u4E00\u6574\u6BB5\u8BF7\u6C42\u4F53\uFF1A\u91CF\u5BBD\u653E\u5F00\uFF0C\u6B63\u6587\u81EA\u5DF1\u6362\u884C\uFF0C\u9AD8\u4E86\u5C31\u5728\u6846\u91CC\u6EDA\u52A8\u2014\u2014\u6491\u5230\u5F39\u7A97\n \u5916\u9762\u7684\u5185\u5BB9\u65E2\u770B\u4E0D\u89C1\u4E5F\u6EDA\u4E0D\u5230\u3002\u6EDA\u52A8\u6761\u7684\u4E24\u79CD\u989C\u8272\u8DDF\u7740\u5F39\u7A97\u8FD9\u5C42\u8868\u9762\u8D70\u3002 */\n.dsh-judge-modal { width: min(760px, 100%); max-height: min(85vh, 100%); --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2); --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2); }\n.dsh-judge-prompt { max-height: 58vh; overflow: auto; }\n.dsh-judge-prompt pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }\n/* \u7C98\u8D34\u6846\uFF1A\u7B49\u5BBD\u663E\u793A\uFF0C\u597D\u8BA9\u8BFB\u8005\u770B\u51FA JSON \u7684\u5C42\u7EA7\uFF1B\u81EA\u5DF1\u6491\u9AD8\u5230\u4E00\u5C4F\u7684\u4E00\u534A\u518D\u6EDA\u52A8\u3002 */\n.dsh-judge-paste { box-sizing: border-box; width: 100%; min-height: 220px; max-height: 45vh; resize: vertical; padding: 10px 12px; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: var(--dsw-font-markdown-code-block); }\n.dsh-judge-paste:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary); }\n`;\n\n/**\n * Append this card's stylesheet once, at apply() time.\n *\n * Injection happens here rather than on first render because the host's own\n * stylesheets are already-loaded `<link>` elements: a plugin sheet appended\n * later wins at equal specificity, and doing it once in apply() keeps that\n * order stable across remounts. The id makes the append idempotent.\n */\nexport function injectCardStyles(): void {\n if (typeof document === 'undefined') return;\n if (document.getElementById(STYLE_ID) !== null) return;\n const element = document.createElement('style');\n element.id = STYLE_ID;\n // \u4E24\u4E2A\u5F52\u5C5E\u952E\u7F3A\u4E00\u4E0D\u53EF\uFF1Aclient-modules \u6309 `data-plugin` \u5728\u5378\u8F7D\u4E0E\u6362\u4EE3\u7801\u65F6\u6574\u8868\u6E05\u6389\uFF0C\n // \u6CA1\u6253\u952E\u7684\u8868\u4F1A\u4E00\u76F4\u53E0\u5728\u9875\u9762\u4E0A\uFF08docs/rules/plugin-ui.md\u300C\u6837\u5F0F\u5728 apply() \u91CC\u6CE8\u5165\u300D\uFF09\u3002\n element.dataset.plugin = PLUGIN_NAME;\n element.dataset.pluginCss = `${PLUGIN_NAME}/settings/ui`;\n element.textContent = CARD_CSS;\n document.head.appendChild(element);\n}\n\n/** DOM id of this card's stylesheet, so a remount does not append a second one. */\nconst STYLE_ID = 'dsh-subagent-judge-dispatch-styles';\n\n/** \u672C\u63D2\u4EF6\u7684\u5305\u540D\uFF0C\u7528\u4F5C\u6837\u5F0F\u8868\u7684\u5F52\u5C5E\u952E\u3002 */\nconst PLUGIN_NAME = '@lynn123411/dsh-subagent-judge-dispatch';\n\n/**\n * This plugin's configuration card inside the DSH **Plugins** page.\n *\n * Two tabs. The design tab holds two independently saved sections \u2014 the\n * judgement service, and the task-type table \u2014 because each is edited on its own\n * occasion and fails on its own terms; a single save for both would let an\n * unfinished description block an endpoint change. The log tab reads the Host's\n * runtime log. Nothing is written while the reader types.\n *\n * @param props - the renderer-bound seat of `plugins.bundle.config`.\n * @returns the card element.\n */\nexport function JudgeDispatchPanel(\n props: PropsRuntime<'plugins.bundle.config'> & PropsLocale<typeof NS>,\n): React.ReactElement {\n const { t } = props;\n\n const [state, setState] = useState<PageState>(() => dispatchCardStore.getState());\n const [tab, setTab] = useState<'design' | 'log'>('design');\n const [browsing, setBrowsing] = useState<number | null>(null);\n const [preview, setPreview] = useState<string | null>(null);\n const [previewOpen, setPreviewOpen] = useState(false);\n const [probing, setProbing] = useState(false);\n const [probeResult, setProbeResult] = useState<{ ok: boolean; latencyMs: number; reason?: string } | null>(null);\n const [detail, setDetail] = useState<LogRow | null>(null);\n /** Which row's dropdown is open, and which of the two. */\n const [openMenu, setOpenMenu] = useState<{ index: number; kind: 'model' | 'effort' } | null>(null);\n /** The reason a save was refused, shown as a popup. */\n const [refusal, setRefusal] = useState<string | null>(null);\n /** The paste box for importing a task-type list; null when it is closed. */\n const [importText, setImportText] = useState<string | null>(null);\n /** Why the last import attempt was refused, or ''. */\n const [importError, setImportError] = useState('');\n /** What the last export did, shown until the next action. */\n const [copyNote, setCopyNote] = useState<{ ok: boolean; text: string } | null>(null);\n\n useEffect(() => {\n setState(dispatchCardStore.getState());\n return dispatchCardStore.subscribe(() => setState(dispatchCardStore.getState()));\n }, []);\n\n useEffect(() => {\n if (tab === 'log') void dispatchCardStore.refreshLog();\n }, [tab]);\n\n /** Localized reason text for one fallback. */\n const reasonText = (reason: string | undefined): string =>\n t(`reason.${reason ?? 'other'}` as never) || t('reason.unknown');\n\n const runProbe = async (): Promise<void> => {\n setProbing(true);\n setProbeResult(await dispatchCardStore.probe());\n setProbing(false);\n };\n\n /** \u7C7B\u578B\u6E05\u5355\u6709\u7F3A\u65F6\u6309\u6309\u94AE\u4E0D\u7ED9\u5199\uFF1A\u628A\u539F\u56E0\u5F39\u51FA\u6765\uFF0C\u800C\u4E0D\u662F\u8BA9\u6309\u94AE\u70B9\u4E0D\u52A8\u3002 */\n const saveRows = (): void => {\n if (state.rowsInvalid !== '') {\n setRefusal(state.rowsInvalid);\n return;\n }\n void dispatchCardStore.save('rows');\n };\n\n const openPreview = async (): Promise<void> => {\n const text = await dispatchCardStore.preview();\n setPreview(text ?? t('preview.failed'));\n setPreviewOpen(true);\n };\n\n /** Copy the task-type list out as plain JSON. */\n const exportRows = async (): Promise<void> => {\n const copied = await writeClipboard(exportRowsJson(state.rows));\n setCopyNote({ ok: copied, text: t(copied ? 'rows.exported' : 'rows.exportFailed') });\n };\n\n /** Open the paste box, empty and with no leftover complaint. */\n const openImport = (): void => {\n setImportText('');\n setImportError('');\n setCopyNote(null);\n };\n\n /** Read the pasted list into the drafts; the section's save is still separate. */\n const applyImport = (): void => {\n const result = parseRowsJson(importText ?? '');\n if (!result.ok) {\n setImportError(t(IMPORT_ERROR_KEYS[result.error] as never));\n return;\n }\n dispatchCardStore.replaceRows(result.rows);\n setImportText(null);\n setImportError('');\n };\n\n /** One section's save row: the write and the discard on the left, that section's checks on the right. */\n const saveRow = (\n section: Section,\n dirty: boolean,\n onSave: () => void,\n checks?: React.ReactNode,\n ): React.ReactElement => (\n <div className=\"dsh-judge-actions\">\n <div className=\"dsh-judge-actions-group\">\n {/* \u7C7B\u578B\u6E05\u5355\u6709\u7F3A\u65F6\u6309\u94AE\u4ECD\u53EF\u70B9\uFF1A\u6309\u4E0B\u53BB\u7531 saveRows \u5F39\u7A97\u8BF4\u660E\u4E3A\u4EC0\u4E48\u5B58\u4E0D\u4E86\u3002\n \u505A\u6210 disabled \u7684\u8BDD\uFF0C\u8BFB\u8005\u53EA\u770B\u5230\u4E00\u4E2A\u70B9\u4E0D\u52A8\u7684\u6309\u94AE\uFF0C\u4E0D\u77E5\u9053\u8981\u6539\u54EA\u91CC\u3002 */}\n <Button\n variant=\"primary\"\n size=\"sm\"\n disabled={state.saving !== '' || !dirty || !state.writable}\n onClick={onSave}\n >\n {state.saving === section ? t('save.saving') : t('save.button')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={state.saving !== '' || !dirty}\n onClick={() => dispatchCardStore.revert(section)}\n >\n {t('save.discard')}\n </Button>\n {dirty && <span className=\"dsh-judge-hint\">{t('save.unsaved')}</span>}\n {/* \u5931\u8D25\u6309\u8282\u62A5\uFF1A\u5224\u65AD\u670D\u52A1\u90A3\u6B21\u4FDD\u5B58\u6CA1\u843D\u5730\u65F6\uFF0C\u4EFB\u52A1\u7C7B\u578B\u90A3\u4E00\u8282\u4E0D\u8BE5\u8DDF\u7740\u62A5\u9519\u3002 */}\n {state.saveFailed === section && state.saveError !== '' && (\n <span className=\"dsh-judge-note-bad\" role=\"alert\">\n {t('save.failed').replace('{error}', state.saveError)}\n </span>\n )}\n </div>\n {checks !== undefined && <div className=\"dsh-judge-actions-group\">{checks}</div>}\n </div>\n );\n\n /** One task-type row as three cells plus its row number and its actions. */\n const row = (draft: TypeRowDraft, index: number): React.ReactElement => {\n const efforts = dispatchCardStore.effortsFor(draft);\n const usable = dispatchCardStore.rowUsable(draft);\n // \u53EA\u6709\u300C\u76EE\u5F55\u8BFB\u5230\u4E86\u3001\u4E14\u8FD9\u4E2A\u8DEF\u7531\u786E\u5B9E\u58F0\u660E\u4E86\u6863\u4F4D\u300D\u65F6\u624D\u7ED9\u4E0B\u62C9\uFF1B\u5426\u5219\u81EA\u7531\u586B\u5199\u3002\n const catalogOffersEffort = state.catalogRead && efforts.length > 0;\n return (\n <tr key={index} className={usable ? undefined : 'dsh-judge-row-off'}>\n <td className=\"dsh-judge-col-no\">\n <span className=\"dsh-judge-no\">{index + 1}</span>\n {usable ? null : <span className=\"dsh-judge-off\">{t('rows.incomplete')}</span>}\n </td>\n <td>\n <Input\n type=\"text\"\n className=\"dsh-judge-field\"\n value={draft.description}\n placeholder={t('rows.descriptionPlaceholder')}\n aria-label={`${t('rows.colDescription')} ${index + 1}`}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.cell(index, 'description', event.target.value)}\n />\n </td>\n <td>\n <Menu\n open={openMenu?.index === index && openMenu.kind === 'model'}\n anchor={<Input\n type=\"text\"\n className=\"dsh-judge-field\"\n readOnly\n value={draft.model === '' ? '' : `${draft.provider}/${draft.model}`}\n placeholder={t('rows.modelPlaceholder')}\n aria-label={`${t('rows.colModel')} ${index + 1}`}\n aria-haspopup=\"listbox\"\n aria-expanded={openMenu?.index === index && openMenu.kind === 'model'}\n onClick={() => setOpenMenu({ index, kind: 'model' })}\n onFocus={() => setOpenMenu({ index, kind: 'model' })}\n />}\n items={[\n { type: 'label', id: 'model', text: t('rows.colModel') },\n ...(state.models.length === 0\n ? []\n : state.models.map((option) => ({\n id: routeKey(option.provider, option.model),\n label: `${option.provider}/${option.label}`,\n }))),\n ]}\n selectedId={draft.model === '' ? undefined : routeKey(draft.provider, draft.model)}\n onSelect={(id) => {\n const { provider, model } = splitRouteKey(id);\n dispatchCardStore.cell(index, 'provider', provider);\n dispatchCardStore.cell(index, 'model', model);\n setOpenMenu(null);\n }}\n onClose={() => setOpenMenu(null)}\n className=\"dsh-judge-field-wrap\"\n portal\n />\n </td>\n {/* \u76EE\u5F55\u8BFB\u5F97\u5230\u65F6\uFF0C\u5F3A\u5EA6\u662F\u8FD9\u4EFD\u53EF\u9009\u6863\u4F4D\u91CC\u7684\u4E00\u4E2A\uFF1B\u8BFB\u4E0D\u5230\uFF08\u6216\u8FD9\u4E2A\u8DEF\u7531\u6CA1\u58F0\u660E\u6863\u4F4D\uFF09\n \u65F6\u9000\u56DE\u81EA\u7531\u586B\u5199\u2014\u2014\u628A\u683C\u5B50\u7981\u6389\u4F1A\u8BA9\u6574\u5F20\u8868\u6C38\u8FDC\u586B\u4E0D\u5168\uFF0C\u4E5F\u5C31\u6C38\u8FDC\u4E0D\u518D\u5224\u65AD\u4EFB\u4F55\u4E1C\u897F\u3002 */}\n <td>\n {catalogOffersEffort ? (\n <Menu\n open={openMenu?.index === index && openMenu.kind === 'effort'}\n anchor={<Input\n type=\"text\"\n className=\"dsh-judge-field\"\n readOnly\n value={draft.effort}\n placeholder={t('rows.effortPlaceholder')}\n aria-label={`${t('rows.colEffort')} ${index + 1}`}\n aria-haspopup=\"listbox\"\n aria-expanded={openMenu?.index === index && openMenu.kind === 'effort'}\n onClick={() => setOpenMenu({ index, kind: 'effort' })}\n onFocus={() => setOpenMenu({ index, kind: 'effort' })}\n />}\n items={[\n { type: 'label', id: 'effort', text: t('rows.colEffort') },\n ...efforts.map((effort) => ({ id: effort, label: effort })),\n ]}\n selectedId={draft.effort === '' ? undefined : draft.effort}\n onSelect={(id) => {\n dispatchCardStore.cell(index, 'effort', id);\n setOpenMenu(null);\n }}\n onClose={() => setOpenMenu(null)}\n className=\"dsh-judge-field-wrap\"\n portal\n />\n ) : (\n <Input\n type=\"text\"\n className=\"dsh-judge-field\"\n value={draft.effort}\n placeholder={t('rows.effortPlaceholder')}\n aria-label={`${t('rows.colEffort')} ${index + 1}`}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.cell(index, 'effort', event.target.value)}\n />\n )}\n </td>\n <td className=\"dsh-judge-col-actions\">\n <div className=\"dsh-judge-cell-actions\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${t('rows.browse')} ${index + 1}`}\n onClick={() => setBrowsing(index)}\n >\n {t('rows.browse')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n aria-label={`${t('rows.remove')} ${index + 1}`}\n onClick={() => dispatchCardStore.removeRow(index)}\n >\n {t('rows.remove')}\n </Button>\n </div>\n </td>\n </tr>\n );\n };\n\n const design = (\n <div className=\"dsh-judge-panel\">\n <div className=\"dsh-judge-section\">\n <div className=\"dsh-judge-head\">\n <span className=\"dsh-judge-title\">{t('judge.title')}</span>\n </div>\n <div className=\"dsh-judge-desc\">{t('judge.desc')}</div>\n\n {/* \u8FD9\u4E00\u8282\u91CC\u7684\u6BCF\u4E00\u683C\u90FD\u5F52\u4E0B\u9762\u90A3\u4E2A\u4FDD\u5B58\u6309\u94AE\u7BA1\uFF1A\u5F00\u5173\u3001\u7AEF\u70B9\u3001\u5224\u65AD\u6A21\u578B\u3001\u5BC6\u94A5\u4E00\u6B21\u5199\u5165\u3002\n \u5F00\u5173\u4E0D\u53E6\u5916\u7ED9\u4FDD\u5B58\u6309\u94AE\uFF0C\u4E5F\u4E0D\u5373\u65F6\u5199\u5165\u2014\u2014\u300C\u53EA\u6709\u6309\u4FDD\u5B58\u624D\u5199\u300D\u8FD9\u6761\u89C4\u5219\u5728\u4E00\u4E2A\u8282\u91CC\n \u53EA\u80FD\u6709\u4E00\u4E2A\u51FA\u53E3\uFF0C\u5426\u5219\u8BFB\u8005\u65E0\u6CD5\u9884\u5224\u54EA\u4E00\u4E0B\u4F1A\u843D\u76D8\u3002 */}\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('switch.rewrite.title')}</div>\n <div className=\"dsh-judge-row-hint\">{t('switch.rewrite.desc')}</div>\n </div>\n <Switch\n checked={state.enabled}\n onChange={(next: boolean) => dispatchCardStore.toggle('enabled', next)}\n label={t('switch.rewrite.title')}\n disabled={!state.writable || state.saving !== ''}\n />\n </div>\n\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('switch.log.title')}</div>\n <div className=\"dsh-judge-row-hint\">{t('switch.log.desc')}</div>\n </div>\n <Switch\n checked={state.logEnabled}\n onChange={(next: boolean) => dispatchCardStore.toggle('logEnabled', next)}\n label={t('switch.log.title')}\n disabled={!state.writable || state.saving !== ''}\n />\n </div>\n\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('judge.endpoint')}</div>\n <div className=\"dsh-judge-row-hint\">{t('judge.endpointDesc')}</div>\n </div>\n <div className=\"dsh-judge-row-field\">\n <Input\n type=\"text\"\n className=\"dsh-judge-field\"\n value={state.endpointUrl}\n placeholder=\"http://127.0.0.1:3425/v1/systemone\"\n aria-label={t('judge.endpoint')}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.field('endpointUrl', event.target.value)}\n />\n </div>\n </div>\n\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('judge.model')}</div>\n <div className=\"dsh-judge-row-hint\">{t('judge.modelDesc')}</div>\n </div>\n <div className=\"dsh-judge-row-field\">\n <Input\n type=\"text\"\n className=\"dsh-judge-field\"\n value={state.judgeModel}\n placeholder=\"future-jev/jev-latest\"\n aria-label={t('judge.model')}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.field('judgeModel', event.target.value)}\n />\n </div>\n </div>\n\n <div className=\"dsh-judge-row\">\n <div className=\"dsh-judge-row-info\">\n <div className=\"dsh-judge-row-title\">{t('judge.key')}</div>\n <div className=\"dsh-judge-row-hint\">\n {withSamples(t('judge.keyDesc'), { ref: JUDGE_API_KEY_REF, path: CREDENTIALS_PATH })}\n </div>\n </div>\n <div className=\"dsh-judge-row-field\">\n {/* \u5BC6\u94A5\u683C\u4E0E\u4E0A\u9762\u4E24\u683C\u540C\u5BBD\uFF1A\u72B6\u6001\u4E0E\u300C\u5220\u6389\u300D\u653E\u5728\u8F93\u5165\u6846\u4E0B\u9762\u90A3\u4E00\u884C\uFF0C\n \u8FD9\u6837\u4E09\u683C\u7684\u5DE6\u53F3\u8FB9\u7F18\u5BF9\u9F50\u3002 */}\n <Input\n type=\"password\"\n autoComplete=\"new-password\"\n className=\"dsh-judge-field\"\n value={state.key.text}\n placeholder={state.key.configured ? t('judge.keyPlaceholderSet') : t('judge.keyPlaceholder')}\n aria-label={t('judge.key')}\n disabled={state.key.unavailable}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.key(event.target.value)}\n />\n <div className=\"dsh-judge-key-line\">\n <Tag tone={state.key.configured ? 'success' : 'warning'}>\n {t(state.key.configured ? 'judge.keySet' : 'judge.keyUnset')}\n </Tag>\n {state.key.configured && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={state.key.saving || !state.key.writable}\n onClick={() => void dispatchCardStore.clearKey()}\n >\n {t('judge.keyClear')}\n </Button>\n )}\n {state.key.unavailable && <span className=\"dsh-judge-hint\">{t('judge.keyUnavailable')}</span>}\n {state.key.landed === 'saved' && <span className=\"dsh-judge-note-ok\">{t('judge.keySaved')}</span>}\n {state.key.landed === 'cleared' && <span className=\"dsh-judge-note-ok\">{t('judge.keyCleared')}</span>}\n {state.key.failed && (\n <span className=\"dsh-judge-note-bad\" role=\"alert\">\n {t('judge.keyFailed').replace('{error}', state.key.error || t('save.invalid'))}\n </span>\n )}\n </div>\n </div>\n </div>\n\n {probeResult !== null && (\n <div className={probeResult.ok ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'}>\n {probeResult.ok\n ? t('judge.probeOk').replace('{latency}', String(probeResult.latencyMs))\n : t('judge.probeFail').replace('{reason}', reasonText(probeResult.reason))}\n </div>\n )}\n\n {/* \u8BD5\u901A\u95EE\u7684\u662F\u300C\u8FD9\u4E00\u8282\u5B58\u4E0B\u53BB\u80FD\u4E0D\u80FD\u7528\u300D\uFF0C\u6240\u4EE5\u5C31\u8DDF\u7740\u8FD9\u4E00\u8282\u7684\u4FDD\u5B58\u8D70\uFF1A\u5DE6\u8FB9\u5199\u4E0B\u53BB\uFF0C\u53F3\u8FB9\u67E5\u4E00\u4E0B\u3002 */}\n {saveRow('judge', state.judgeDirty, () => void dispatchCardStore.save('judge'), (\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={probing || state.dirty}\n onClick={() => void runProbe()}\n >\n {probing ? t('judge.probing') : t('judge.probe')}\n </Button>\n ))}\n </div>\n\n <div className=\"dsh-judge-section\">\n <div className=\"dsh-judge-title\">{t('rows.title')}</div>\n <div className=\"dsh-judge-desc\">{t('rows.desc')}</div>\n {state.models.length === 0 && <div className=\"dsh-judge-off\">{t('rows.allowedEmpty')}</div>}\n {state.rows.length === 0 && <div className=\"dsh-judge-desc\">{t('rows.empty')}</div>}\n {state.rows.length > 0 && (\n <table className=\"dsh-judge-table\">\n <thead>\n <tr>\n <th className=\"dsh-judge-col-no\">{t('rows.colId')}</th>\n <th>{t('rows.colType')}</th>\n <th className=\"dsh-judge-col-model\">{t('rows.colModel')}</th>\n <th className=\"dsh-judge-col-effort\">{t('rows.colEffort')}</th>\n <th className=\"dsh-judge-col-actions\" />\n </tr>\n </thead>\n <tbody>\n {state.rows.map((draft, index) => row(draft, index))}\n </tbody>\n </table>\n )}\n {state.rowsInvalid !== '' && state.rowsDirty && (\n <div className=\"dsh-judge-note-bad\" role=\"alert\">{state.rowsInvalid}</div>\n )}\n {/* \u8FD9\u4E00\u8282\u7684\u51FA\u53E3\uFF1A\u5DE6\u8FB9\u5199\u4E0B\u53BB\uFF0C\u53F3\u8FB9\u662F\u8FD9\u5F20\u8868\u81EA\u5DF1\u7684\u4E09\u4E2A\u52A8\u4F5C\u2014\u2014\u5BFC\u5165\u3001\u5BFC\u51FA\u90FD\u53EA\u52A8\u8FD9\u4EFD\n \u6E05\u5355\uFF08\u5BFC\u5165\u843D\u8349\u7A3F\u3001\u5BFC\u51FA\u628A\u8349\u7A3F\u6284\u6210 JSON\uFF09\uFF0C\u52A0\u4E00\u884C\u5F80\u4E0B\u7EED\u4E00\u6761\uFF0C\u4E09\u4EF6\u90FD\u4E0D\u843D\u76D8\u3002 */}\n {saveRow('rows', state.rowsDirty, saveRows, (\n <>\n <Button variant=\"outline\" size=\"sm\" onClick={openImport}>\n {t('rows.importOpen')}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void exportRows()}>\n {t('rows.export')}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => dispatchCardStore.addRow()}>\n {t('rows.add')}\n </Button>\n {copyNote !== null && (\n <span className={copyNote.ok ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'} role=\"status\">\n {copyNote.text}\n </span>\n )}\n </>\n ))}\n </div>\n\n {/* \u9884\u89C8\u95EE\u7684\u662F\u8FD9\u4E00\u6574\u4EFD\u8BBE\u7F6E\u5B58\u4E0B\u53BB\u4F1A\u53D1\u7ED9\u5224\u65AD\u670D\u52A1\u4EC0\u4E48\uFF1A\u5B83\u540C\u65F6\u7528\u5230\u5224\u65AD\u6A21\u578B\u4E0E\u7C7B\u578B\u6E05\u5355\uFF0C\n \u54EA\u4E00\u8282\u90FD\u4E0D\u72EC\u5360\uFF0C\u6240\u4EE5\u5355\u72EC\u6392\u5728\u4E24\u8282\u4E4B\u5916\u3002 */}\n <div className=\"dsh-judge-footer\">\n {state.dirty && <span className=\"dsh-judge-hint\">{t('preview.blocked')}</span>}\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={state.dirty}\n onClick={() => void openPreview()}\n >\n {t('preview.open')}\n </Button>\n </div>\n </div>\n );\n\n const log = (\n <div className=\"dsh-judge-panel\">\n <div className=\"dsh-judge-section\">\n <div className=\"dsh-judge-head\">\n <span className=\"dsh-judge-title\">{t('log.title')}</span>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void dispatchCardStore.refreshLog()}>\n {t('log.refresh')}\n </Button>\n </div>\n <div className=\"dsh-judge-desc\">{t('log.desc')}</div>\n {state.logFailed && <div className=\"dsh-judge-note-bad\">{t('log.loadFailed')}</div>}\n {state.logLoaded && state.log.length === 0 && (\n <div className=\"dsh-judge-desc\">{t('log.empty')}</div>\n )}\n {state.log.length > 0 && (\n <div className=\"dsh-judge-log\">\n <div className=\"dsh-judge-log-row dsh-judge-log-head\">\n <span>{t('log.colResult')}</span>\n <span>{t('log.colChoice')}</span>\n <span>{t('log.colParent')}</span>\n <span>{t('log.colChild')}</span>\n <span>{t('log.colTime')}</span>\n <span>{t('log.colLatency')}</span>\n </div>\n {state.log.map((entry, index) => {\n // \u5224\u6210\u4E86\u5199\u7C7B\u578B\u7F16\u53F7\uFF1B\u6CA1\u5224\u6210\u5C31\u5199\u300C\u672A\u5224\u6210\u300D\uFF0C\u539F\u56E0\u7559\u7ED9\u60AC\u505C\u2014\u2014\u90A3\u4E00\u5217\u5BBD\u5EA6\n // \u662F\u7ED9\u7F16\u53F7\u7559\u7684\uFF0C\u585E\u4E00\u6BB5\u539F\u56E0\u4F1A\u628A\u516D\u5217\u7684\u5BBD\u5EA6\u5168\u6324\u6B6A\u3002\n const result = entry.typeId === null\n ? {\n text: t('log.resultInherited'),\n hint: entry.reason === undefined ? '' : reasonText(entry.reason),\n }\n : { text: t('log.resultJudged').replace('{id}', String(entry.typeId)), hint: '' };\n return (\n <button\n key={index}\n type=\"button\"\n className=\"dsh-judge-log-row\"\n onClick={() => setDetail(entry)}\n >\n <LogCell text={result.text} hint={result.hint} />\n <LogCell text={describeModel(entry) || '\u2014'} hint={describeChoice(entry)} />\n <LogCell text={entry.parentTitle || '\u2014'} />\n <LogCell text={entry.childLabel || '\u2014'} />\n <span>{new Date(entry.at).toLocaleTimeString()}</span>\n <span>{t('ms').replace('{value}', String(entry.latencyMs))}</span>\n </button>\n );\n })}\n </div>\n )}\n </div>\n </div>\n );\n\n return (\n <div className=\"dsh-judge-card\">\n <SegmentedTabs\n items={[\n { value: 'design' as const, label: t('tab.design'), id: 'judge-tab-design', panelId: 'judge-panel-design' },\n { value: 'log' as const, label: t('tab.log'), id: 'judge-tab-log', panelId: 'judge-panel-log' },\n ]}\n value={tab}\n onChange={setTab}\n label={t('tab.design')}\n />\n {tab === 'design' ? design : log}\n\n <Modal\n open={refusal !== null}\n onClose={() => setRefusal(null)}\n title={t('save.refusedTitle')}\n closeLabel={t('rows.browseClose')}\n >\n <div className=\"dsh-judge-note-bad\" role=\"alert\">{refusal ?? ''}</div>\n </Modal>\n\n <Modal\n open={previewOpen}\n onClose={() => setPreviewOpen(false)}\n title={t('preview.title')}\n closeLabel={t('preview.close')}\n className=\"dsh-judge-modal\"\n >\n <div className=\"dsh-judge-desc\">{t('preview.desc')}</div>\n <div className=\"dsh-judge-prompt\">\n <CodeBlock code={preview ?? ''} copyLabel={t('preview.copy')} copiedLabel={t('preview.copied')} />\n </div>\n </Modal>\n\n {/* \u5BFC\u5165\u53EA\u6536\u7C98\u8D34\uFF1A\u8FD9\u4E00\u6B65\u4E0D\u8BFB\u6587\u4EF6\u3001\u4E0D\u8054\u7F51\uFF0C\u8BFB\u8005\u770B\u5230\u7684\u548C\u7528\u8FDB\u53BB\u7684\u662F\u540C\u4E00\u6BB5\u6587\u672C\u3002 */}\n <Modal\n open={importText !== null}\n onClose={() => setImportText(null)}\n title={t('rows.importTitle')}\n closeLabel={t('rows.browseClose')}\n description={t('rows.importDesc')}\n className=\"dsh-judge-modal\"\n footer={(\n <>\n <Button variant=\"outline\" size=\"sm\" onClick={() => setImportText(null)}>\n {t('rows.importCancel')}\n </Button>\n <Button variant=\"primary\" size=\"sm\" onClick={applyImport}>\n {t('rows.importApply')}\n </Button>\n </>\n )}\n >\n <textarea\n className=\"dsh-judge-paste\"\n value={importText ?? ''}\n aria-label={t('rows.importTitle')}\n placeholder={t('rows.importPlaceholder')}\n spellCheck={false}\n data-modal-autofocus\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => {\n setImportText(event.target.value);\n setImportError('');\n }}\n />\n {importError !== '' && <div className=\"dsh-judge-note-bad\" role=\"alert\">{importError}</div>}\n </Modal>\n\n <Modal\n open={browsing !== null}\n onClose={() => setBrowsing(null)}\n title={t('rows.browseTitle').replace('{id}', String((browsing ?? 0) + 1))}\n closeLabel={t('rows.browseClose')}\n >\n <div className=\"dsh-judge-desc\" style={{ whiteSpace: 'pre-wrap' }}>\n {browsing === null ? '' : state.rows[browsing]?.description ?? ''}\n </div>\n </Modal>\n\n {/* \u5224\u65AD\u8BE6\u60C5\u8FD9\u4E00\u5904\u53EA\u56DE\u7B54\u4E00\u4E2A\u95EE\u9898\uFF1A\u8FD9\u6B21\u5230\u5E95\u53D1\u7ED9\u5224\u65AD\u6A21\u578B\u4EC0\u4E48\u3002\u884C\u4E0A\u90A3\u51E0\u5217\u5DF2\u7ECF\u5199\u6E05\u4E86\n \u7ED3\u679C\u3001\u9009\u62E9\u3001\u8C01\u6D3E\u7684\u6D3B\u3001\u8017\u65F6\uFF0C\u5F39\u7A97\u518D\u5217\u4E00\u904D\u53EA\u662F\u628A\u540C\u4E00\u4EF6\u4E8B\u8BF4\u4E24\u6B21\u3002 */}\n <Modal\n open={detail !== null}\n onClose={() => setDetail(null)}\n title={t('log.promptTitle')}\n closeLabel={t('log.promptClose')}\n description={t('log.promptDesc')}\n className=\"dsh-judge-modal\"\n >\n {detail !== null && (detail.prompt === ''\n ? <div className=\"dsh-judge-desc\">{t('log.promptEmpty')}</div>\n : <div className=\"dsh-judge-prompt\">\n <CodeBlock\n code={detail.prompt}\n copyLabel={t('preview.copy')}\n copiedLabel={t('preview.copied')}\n />\n </div>)}\n </Modal>\n </div>\n );\n}\n\n/** The client context surface this file uses. */\ninterface ClientContextLike {\n effect(factory: () => void | (() => void), label?: string): void;\n slots?: {\n inject(name: string, register: () => unknown): () => void;\n register(options: Record<string, unknown>, component: unknown): () => void;\n };\n configForms: {\n get(namespace: string): any;\n whileServed(namespaces: readonly string[], register: (served: ReadonlySet<string>) => () => void): () => void;\n };\n locale?: any;\n remote?: { session?: any; credentials?: CredentialsRemoteLike };\n}\n\n/**\n * Bind the card to this plugin's own configuration form, the Host's allowlist,\n * the credentials service, and this plugin's runtime routes, then contribute it\n * to the Plugins page.\n * @param ctx - the browser client context.\n */\nexport function setupSettingsUi(ctx: ClientContextLike): void {\n if (typeof window === 'undefined') return;\n const t = ctx.locale?.bind?.(NS) ?? ((key: string) => key);\n try {\n dispatchCardStore.attach({\n form: ctx.configForms.get(SETTINGS_NAMESPACE),\n // The Host owns which models a subagent may use; this card only reads it so\n // the plugin never keeps a second list that could drift from it.\n allowedForm: ctx.configForms.get(ALLOWED_MODELS_NAMESPACE),\n session: ctx.remote?.session ?? null,\n remote: createDispatchRemote(),\n // The judgement key is written here; its value never rides a response.\n credentials: ctx.remote?.credentials ?? null,\n t,\n });\n } catch (error) {\n console.warn('[dsh-subagent-judge-dispatch] \u914D\u7F6E\u8868\u5355\u7ED1\u5B9A\u5931\u8D25\uFF1A', error);\n }\n\n // The dictionaries are registered once by the client entry point; the card's\n // seat resolves `t` against them through its `locale: NS` registration above.\n\n // The card lives on the Plugins page, which declares `plugins.bundle.config`\n // only while its own entry is mounted; `whileServed` additionally ties the\n // contribution to the Host actually serving this plugin's own settings entry.\n ctx.effect(\n () => ctx.configForms.whileServed([SETTINGS_NAMESPACE], () =>\n setupPluginPage(ctx.slots, () =>\n (ctx.slots as NonNullable<ClientContextLike['slots']>).register(\n {\n name: BUNDLE_CONFIG_SLOT,\n key: BUNDLE_CONFIG_KEY,\n locale: NS,\n },\n JudgeDispatchPanel,\n ))),\n 'dsh-subagent-judge-dispatch: plugins page config',\n );\n}\n", "/**\n * This plugin's configuration card and where it lives: the DSH **Plugins** page,\n * registered into `plugins.bundle.config` under the bundle's package name.\n *\n * The key is the package name; the settings the card reads and writes live in a\n * DIFFERENT literal \u2014 the Loader row id, which is also this plugin's settings\n * namespace. Writing one where the other belongs makes the card silently never\n * appear, so both are spelled once, here and in `src/index.ts`.\n */\n\n// Type-only: brings the owner's `plugins.bundle.config` SlotMap contract into\n// this program. Erased from the bundle, so the browser half never depends on the\n// plugin manager at runtime.\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client';\n\n/** npm package name of this plugin's bundle \u2014 the whole `plugins.bundle.config` key. */\nexport const BUNDLE_NAME = '@lynn123411/dsh-subagent-judge-dispatch';\n\n/** The Plugins page slot a bundle's own configuration registers into. */\nexport const BUNDLE_CONFIG_SLOT = 'plugins.bundle.config';\n\n/** This plugin's own config key: the bundle's package name. */\nexport const BUNDLE_CONFIG_KEY = BUNDLE_NAME;\n\n/** Services this registration needs from the browser runtime. */\ninterface PluginPageSlots {\n inject(name: string, callback: () => unknown): () => void;\n}\n\n/**\n * Contribute this plugin's configuration card to the Plugins page.\n * @param slots - the client slot registry.\n * @param register - registers the card component; returns its disposer.\n * @returns A disposer releasing the contribution, or a no-op when the browser\n * runtime hands no slot registry at all.\n */\nexport function setupPluginPage(\n slots: PluginPageSlots | null | undefined,\n register: () => () => void,\n): () => void {\n if (!slots || typeof slots.inject !== 'function') return () => {};\n return slots.inject(BUNDLE_CONFIG_SLOT, register);\n}\n", "/**\n * The judgement request the plugin sends, and the answer it reads back.\n *\n * Two pure functions live here, so the whole \"what did the judge decide\"\n * question is answerable without a Host, a socket, or a timer:\n *\n * - {@link buildJudgeRequest} turns the type list plus the task text into the\n * exact body that goes out.\n * - {@link readJudgeAnswer} turns whatever came back into a decision, treating\n * every malformed, empty or off-list answer as \"no decision\" rather than\n * inventing one.\n *\n * The protocol is the System One one: POST a body of `{ model, state,\n * questions }`, where each question is a `choice` carrying an `instructions`\n * line and a `criteria` map of option id to the text that option means. The\n * answer names the chosen option id.\n */\n\nimport type { TypeRow } from './types.ts';\n\n/** The one question key the plugin asks. */\nexport const QUESTION_KEY = 'task_type';\n\n/**\n * The question's instructions line.\n *\n * It says what to weigh, not what the types are: the types themselves arrive as\n * the criteria map, so the reader's own descriptions are the whole criterion\n * list and nothing here can drift from them.\n */\nexport const QUESTION_INSTRUCTIONS =\n 'Which single task type below does the delegated job best match? '\n + 'Weigh what the job actually requires, not how it is phrased. '\n + 'Answer with the number of exactly one listed type.';\n\n/** The option id the connectivity check offers: the only one it offers. */\nexport const PROBE_OPTION_ID = '1';\n\n/** The task text the connectivity check sends. */\nexport const PROBE_TASK_TEXT = '\u8FDE\u63A5\u6D4B\u8BD5\uFF1A\u8FD9\u662F\u4E00\u6B21\u5224\u65AD\u670D\u52A1\u7684\u8FDE\u901A\u6027\u68C0\u67E5\u3002';\n\n/**\n * The connectivity check's instructions.\n *\n * It asks for the one option that exists, so an endpoint that understands the\n * protocol at all can answer it: answering it wrong is a failure of the\n * protocol, not of the reader's task list.\n */\nexport const PROBE_INSTRUCTIONS =\n 'Answer with the number of the one option listed below.';\n\n/** The single criterion the connectivity check offers. */\nexport const PROBE_CRITERION = '\u786E\u8BA4\u8FD9\u6B21\u8C03\u7528\u53EF\u4EE5\u5B8C\u6210\u3002';\n\n/** One option of the judge's question. */\nexport interface JudgeChoice {\n type: 'choice';\n instructions: string;\n criteria: Record<string, string>;\n}\n\n/** The exact body sent to the judge endpoint. */\nexport interface JudgeRequest {\n model: string;\n state: { message: string };\n questions: { [QUESTION_KEY]: JudgeChoice };\n}\n\n/**\n * Whether one row is complete enough to be offered to the judge.\n *\n * A row needs its provider, model and effort: a half-filled row could otherwise\n * be chosen and then have nothing to write, which would turn the reader's\n * unfinished edit into a delegation that silently lost its route. This is the\n * ONE place that rule lives \u2014 the page, the config gate and the rewrite all ask\n * this function rather than restating the three comparisons.\n *\n * The parameter is narrowed to the three fields the rule reads, so the page's\n * draft row (which carries no sequence number) and the server's numbered row\n * both satisfy it without either shape being converted into the other.\n *\n * @param row - one row, numbered or drafted.\n * @returns whether the judge may choose it.\n */\nexport function isSelectableRow(row: Pick<TypeRow, 'provider' | 'model' | 'effort'>): boolean {\n return row.provider.trim() !== '' && row.model.trim() !== '' && row.effort.trim() !== '';\n}\n\n/**\n * Which rows may be offered to the judge.\n * @param rows - every row on the page, in page order.\n * @returns the rows the judge may choose, in page order.\n */\nexport function selectableRows(rows: readonly TypeRow[]): TypeRow[] {\n return rows.filter(isSelectableRow);\n}\n\n/**\n * How much of a delegated task's opening the judge reads.\n *\n * The judge answers one multiple-choice question; the opening of a task says\n * what kind of job it is, and the rest is usually detail the choice does not\n * turn on. Bounding it keeps the request small and keeps one enormous\n * delegation from crowding out the type list it is being weighed against.\n */\nexport const SUBJECT_HEAD_CHARS = 1400;\n\n/**\n * How much of a task's closing the judge reads.\n *\n * Supplementary requirements are written at the end \u2014 \"also run the review\" \u2014\n * so the tail is kept rather than the middle.\n */\nexport const SUBJECT_TAIL_CHARS = 400;\n\n/** Opening words of the label line the judge reads above the task. */\nexport const LABEL_PREFIX = 'Delegation label: ';\n\n/**\n * Build the subject the judge is asked to classify.\n *\n * Two parts, in the order the reader would put them: the delegation's own label\n * \u2014 a summary the delegating agent wrote, which carries its intent \u2014 and then\n * the task text itself. The label alone is a display phrase of a few words, too\n * little to classify by; the task text alone loses that intent when it opens\n * with boilerplate.\n *\n * @param label - the delegation label, or '' when the child has none.\n * @param taskText - the delegated task text, or '' when it cannot be read.\n * @returns the subject to send, bounded to {@link SUBJECT_HEAD_CHARS} plus\n * {@link SUBJECT_TAIL_CHARS} characters of task text.\n */\nexport function composeJudgeSubject(label: string, taskText: string): string {\n const task = clipTaskText(taskText.trim());\n const heading = label.trim();\n if (heading === '') return task;\n return task === '' ? LABEL_PREFIX + heading : `${LABEL_PREFIX}${heading}\\n\\n${task}`;\n}\n\n/**\n * Bound a task text to its opening and closing.\n *\n * The dropped middle is named rather than silently removed, so a reader looking\n * at the logged request can tell truncation from a short task. The marker is\n * English like the rest of the protocol, so it reads as a note from the plugin\n * rather than as part of the task, whatever language the task is written in.\n *\n * @param text - the task text.\n * @returns the text, or its head and tail around a count of what was dropped.\n */\nfunction clipTaskText(text: string): string {\n if (text.length <= SUBJECT_HEAD_CHARS + SUBJECT_TAIL_CHARS) return text;\n const dropped = text.length - SUBJECT_HEAD_CHARS - SUBJECT_TAIL_CHARS;\n const head = text.slice(0, SUBJECT_HEAD_CHARS);\n const tail = text.slice(text.length - SUBJECT_TAIL_CHARS);\n return `${head}\\n\u2026 (${dropped} characters omitted) \u2026\\n${tail}`;\n}\n\n/**\n * Build the exact body sent to the judge endpoint.\n *\n * @param rows - the selectable rows, in page order.\n * @param model - the judge model id.\n * @param subject - the text the judge classifies, from {@link composeJudgeSubject}.\n * @returns the request body.\n */\nexport function buildJudgeRequest(\n rows: readonly TypeRow[],\n model: string,\n subject: string,\n): JudgeRequest {\n const criteria: Record<string, string> = {};\n for (const row of rows) criteria[String(row.id)] = row.description;\n return {\n model,\n state: { message: subject },\n questions: {\n [QUESTION_KEY]: {\n type: 'choice',\n instructions: QUESTION_INSTRUCTIONS,\n criteria,\n },\n },\n };\n}\n\n/**\n * Build the body the connectivity check sends.\n *\n * It carries its own single option rather than the reader's task types: the\n * question the button answers is \"does this endpoint and model work\", and that\n * question has an answer before any type list exists. Requiring a finished list\n * first would make the check unable to tell a reader with an empty list from a\n * reader whose endpoint is down.\n *\n * @param model - the judge model id.\n * @returns the request body.\n */\nexport function buildProbeRequest(model: string): JudgeRequest {\n return {\n model,\n state: { message: PROBE_TASK_TEXT },\n questions: {\n [QUESTION_KEY]: {\n type: 'choice',\n instructions: PROBE_INSTRUCTIONS,\n criteria: { [PROBE_OPTION_ID]: PROBE_CRITERION },\n },\n },\n };\n}\n\n/**\n * Serialize one request body the way the page shows it.\n *\n * Both the preview and a logged judgement display this text, while the call\n * itself sends the same object compacted onto the wire. Deriving both from one\n * body is what keeps the shown text from describing a different request than\n * the one that went out.\n *\n * @param body - the request body.\n * @returns the pretty-printed JSON.\n */\nexport function formatJudgeRequest(body: JudgeRequest): string {\n return JSON.stringify(body, null, 2);\n}\n\n/**\n * The text the configuration page's preview shows.\n *\n * It is the request body minus the subject, because no delegation exists until\n * one happens; the preview marks both spots the subject will fill rather than\n * inventing a task. The two markers are told apart, because the real subject is\n * a label line followed by the task text and the preview should read that way.\n *\n * @param rows - the selectable rows, in page order.\n * @param model - the judge model id.\n * @returns the pretty-printed preview text.\n */\nexport function buildPreview(rows: readonly TypeRow[], model: string): string {\n return formatJudgeRequest(\n buildJudgeRequest(rows, model, composeJudgeSubject('\uFF08\u6D3E\u5DE5\u65F6\u624D\u586B\uFF1A\u6D3E\u5DE5\u6807\u7B7E\uFF09', '\uFF08\u6D3E\u5DE5\u65F6\u624D\u586B\uFF1A\u4EFB\u52A1\u6B63\u6587\uFF09')),\n );\n}\n\n/** What reading the judge's answer produced. */\nexport type JudgeDecision =\n | { kind: 'row'; row: TypeRow }\n | { kind: 'empty' }\n | { kind: 'unmatched' };\n\n/**\n * Find the chosen option id inside whatever the endpoint answered.\n *\n * The protocol's own shape is `answers.<key>.choice`; the two fallbacks are the\n * ones the reference clients read, so an endpoint that answers the shorter way\n * still works. Anything else \u2014 a missing body, a non-string, an empty string \u2014\n * yields `undefined` and is treated as no answer.\n *\n * @param payload - the decoded response body.\n * @returns the chosen option id, or undefined when the body names none.\n */\nexport function readChoice(payload: unknown): string | undefined {\n if (typeof payload !== 'object' || payload === null) return undefined;\n const body = payload as Record<string, unknown>;\n const answers = body.answers;\n const fromAnswers =\n typeof answers === 'object' && answers !== null\n ? (answers as Record<string, unknown>)[QUESTION_KEY]\n : undefined;\n const candidate = fromAnswers ?? body[QUESTION_KEY];\n if (typeof candidate === 'object' && candidate !== null) {\n const choice = (candidate as Record<string, unknown>).choice;\n if (typeof choice === 'string' && choice.trim() !== '') return choice.trim();\n if (typeof choice === 'number' && Number.isFinite(choice)) return String(choice);\n return undefined;\n }\n if (typeof candidate === 'string' && candidate.trim() !== '') return candidate.trim();\n if (typeof candidate === 'number' && Number.isFinite(candidate)) return String(candidate);\n return undefined;\n}\n\n/**\n * Turn the judge's answer into a decision.\n *\n * The choice is the type row's number. Matching is by that number's numeric\n * value, so an endpoint that answers `\"3\"` and one that answers `3` agree; a\n * number no listed row carries is `unmatched`, and a body naming no choice at\n * all is `empty`. Both travel to the log as their own reason, because \"it\n * answered nothing\" and \"it answered something I do not have\" send the reader\n * to different fixes.\n *\n * @param payload - the decoded response body.\n * @param rows - the selectable rows, in page order.\n * @returns the decision.\n */\nexport function readJudgeAnswer(payload: unknown, rows: readonly TypeRow[]): JudgeDecision {\n const choice = readChoice(payload);\n if (choice === undefined) return { kind: 'empty' };\n const wanted = Number(choice);\n if (!Number.isFinite(wanted)) return { kind: 'unmatched' };\n const row = rows.find((candidate) => candidate.id === wanted);\n return row === undefined ? { kind: 'unmatched' } : { kind: 'row', row };\n}\n", "/**\n * Where the judgement key lives, and the Host service it is read through.\n *\n * The reference name is a constant of the plugin rather than a setting: the\n * page asks for the key itself and stores it write-only through the DSH\n * credentials service, so a reader never has to know what a \"credential\n * reference\" is, and no surface can point the plugin at somebody else's key.\n * This module imports nothing, so both halves can share the literal.\n *\n * The key value crosses in one direction only: it is written, and read back by\n * the Host half alone. The browser face reads a status-only view.\n */\n\n/** Credential reference the judgement key is stored under. */\nexport const JUDGE_API_KEY_REF = 'SUBAGENT_JUDGE_API_KEY';\n\n/** Minimal structural shape of the Host's `ctx.credentials` service. */\nexport interface CredentialsServiceLike {\n /** Resolve a reference to its stored or inherited value. */\n resolve(ref: string): Promise<{ value: string; source?: string } | undefined>;\n /** Status-only view of a reference; never returns the plaintext value. */\n describe(ref: string): Promise<{ configured: boolean; source?: string; writable: boolean }>;\n /** Store a non-empty value under a reference. */\n set(ref: string, value: string): Promise<void>;\n /** Remove a reference from the document. */\n unset(ref: string): Promise<void>;\n}\n\n/** Minimal structural shape of the browser's `ctx.remote.credentials` face. */\nexport interface CredentialsRemoteLike {\n describe(refs: string[]): Promise<\n { ok: true; value: Record<string, { configured: boolean; source?: string; writable: boolean }> }\n | { ok: false; error: { message: string } }\n >;\n set(ref: string, value: string): Promise<{ ok: true } | { ok: false; error: { message: string } }>;\n unset(ref: string): Promise<{ ok: true } | { ok: false; error: { message: string } }>;\n}\n", "/**\n * The configuration card's own state: what the Host serves, what the reader has\n * staged, and what a save would do.\n *\n * Three rules live here rather than in the component, because each is the kind\n * of thing a render pass must not be trusted with:\n *\n * - A row's sequence number is positional (`1..n`) and is never stored. Duplicate\n * numbers are therefore impossible by construction rather than by validation.\n * - The two sections save separately. The judgement service and the task-type\n * list are edited at different times and fail differently, so one save for both\n * would let a half-finished description block a change to the endpoint.\n * - A save that did not land is reported as such. The shared configuration form\n * answers `false` for a refusal, which is not a rejection: treating it as\n * success would show a saved page over a document the Host never accepted.\n *\n * The model and effort options come from the Host's own \"models subagents may\n * choose\" setting and the adapter catalogue, so the plugin never keeps a second\n * list that could drift from it. The judgement key is write-only over the DSH\n * credentials service, which is why no key value is ever part of this state.\n */\n\nimport { isSelectableRow } from '../../server/judge-prompt.ts';\nimport { JUDGE_API_KEY_REF, type CredentialsRemoteLike } from '../../server/credentials.ts';\n\nexport { JUDGE_API_KEY_REF };\nexport type { CredentialsRemoteLike };\n\n/** One type row as the page edits it; `id` is derived, never stored. */\nexport interface TypeRowDraft {\n description: string;\n provider: string;\n model: string;\n effort: string;\n}\n\n/** One selectable model and the efforts it declares. */\nexport interface ModelOption {\n provider: string;\n model: string;\n /** Display name from the adapter catalogue, when it advertises one. */\n label: string;\n /** Effort ids this exact route declares, in catalogue order. */\n efforts: string[];\n}\n\n/** One log row as the Host serves it. */\nexport interface LogRow {\n typeId: number | null;\n provider: string;\n model: string;\n effort: string;\n reason?: string;\n at: number;\n latencyMs: number;\n parentTitle: string;\n childLabel: string;\n /** The exact request body that went to the judge; '' when none went out. */\n prompt: string;\n}\n\n/** Which of the two sections a save writes. */\nexport type Section = 'judge' | 'rows';\n\n/** What the page shows about the judgement key; never its value. */\nexport interface KeyState {\n /** Staged key text; blank until the reader types one. */\n text: string;\n /** Whether the Host reports a stored key under the reference. */\n configured: boolean;\n /** Whether the credentials document accepts writes. */\n writable: boolean;\n /**\n * Whether this page has no credentials channel at all \u2014 a non-loopback page\n * is served without the namespace, and a field that cannot be written should\n * say so before the reader types into it.\n */\n unavailable: boolean;\n saving: boolean;\n failed: boolean;\n /** The credentials service's own message for a refused write, or ''. */\n error: string;\n /** What the last landed key write did, or '' when none has landed. */\n landed: '' | 'saved' | 'cleared';\n}\n\n/** The card's whole state. */\nexport interface PageState {\n available: boolean;\n writable: boolean;\n /** Whether the model-rewrite switch is on. */\n enabled: boolean;\n /** Whether the log switch is on. */\n logEnabled: boolean;\n endpointUrl: string;\n judgeModel: string;\n rows: TypeRowDraft[];\n /** Model options read from the Host's allowlist plus the adapter catalogue. */\n models: ModelOption[];\n /** Whether the adapter catalogue was read; false means the effort column is free text. */\n catalogRead: boolean;\n /** Persisted values, for computing dirtiness and reverting. */\n committed: {\n enabled: boolean;\n logEnabled: boolean;\n endpointUrl: string;\n judgeModel: string;\n rows: TypeRowDraft[];\n };\n /** Whether the judgement service section holds edits a save would write. */\n judgeDirty: boolean;\n /** Whether the task-type list holds edits a save would write. */\n rowsDirty: boolean;\n /** Whether either section holds edits, for the preview's own notice. */\n dirty: boolean;\n /** A reason the task-type drafts cannot be saved; '' when they can. */\n rowsInvalid: string;\n /** Which section a save is crossing the wire for, or '' when none is. */\n saving: Section | '';\n /** Which section's last save did not land, or '' when none failed. */\n saveFailed: Section | '';\n /** The Host's own message for the last refused write, or ''. */\n saveError: string;\n /** The judgement key's write-only state. */\n key: KeyState;\n /** Runtime log rows, newest first. */\n log: LogRow[];\n logLoaded: boolean;\n logFailed: boolean;\n}\n\n/** Defaults mirroring the Host schema, so an unserved page still renders. */\nexport const DEFAULT_ENDPOINT_URL = 'http://127.0.0.1:3425/v1/systemone';\nexport const DEFAULT_JUDGE_MODEL = 'future-jev/jev-latest';\n\n/** Profile entry id (== settings namespace). */\nexport const SETTINGS_NAMESPACE = 'dsh-subagent-judge-dispatch';\n\n/** The Host's own allowlist namespace, which the card reads for model options. */\nexport const ALLOWED_MODELS_NAMESPACE = 'subagent-model-selection-settings';\n\n/** One path-addressed edit, matching the wire shape the form's `mutate` accepts. */\nexport type SettingsPathOpLike =\n | { op: 'set'; path: string[]; value: unknown }\n | { op: 'unset'; path: string[] };\n\n/** Minimal structural shape of the DSH shared configuration form. */\nexport interface ConfigFormLike {\n getSnapshot(): {\n status: 'loading' | 'ready' | 'unavailable';\n value?: Record<string, unknown>;\n writable: boolean;\n revision?: number;\n };\n subscribe(listener: () => void): () => void;\n mutate(ops: readonly SettingsPathOpLike[], expectedRevision?: number): Promise<boolean>;\n}\n\n/** The `remote.session` face the model catalogue is read through. */\nexport interface SessionRemoteLike {\n modelCatalog(): Promise<\n | { ok: true; value: { groups: readonly { id: string; name: string; models: readonly { id: string; name: string; reasoning?: { efforts: readonly { id: string }[] } }[] }[] } }\n | { ok: false; error: { message: string } }\n >;\n}\n\n/**\n * The Host's three runtime reads.\n *\n * They are plain Fetch calls on this plugin's own routes rather than a Remote\n * namespace: the routes ride Connection's authenticated `/api` transport, which\n * is the same channel the page is already served over.\n */\nexport interface DispatchRemoteLike {\n log(): Promise<LogRow[]>;\n preview(): Promise<string | null>;\n probe(): Promise<{ ok: boolean; latencyMs: number; reason?: string }>;\n}\n\n/** The three route paths, shared with the Host half by literal. */\nexport const LOG_ROUTE_PATH = '/api/dsh-subagent-judge-dispatch/log';\nexport const PREVIEW_ROUTE_PATH = '/api/dsh-subagent-judge-dispatch/preview';\nexport const PROBE_ROUTE_PATH = '/api/dsh-subagent-judge-dispatch/probe';\n\n/** Decode a response body, treating an unreadable one as absent. */\nasync function readJson(response: Response): Promise<any> {\n try {\n return await response.json();\n } catch {\n return null;\n }\n}\n\n/** The real Host reads, over this plugin's own routes. */\nexport function createDispatchRemote(): DispatchRemoteLike {\n return {\n async log(): Promise<LogRow[]> {\n try {\n const response = await fetch(LOG_ROUTE_PATH);\n if (!response.ok) return [];\n const body = await readJson(response);\n return Array.isArray(body?.entries) ? (body.entries as LogRow[]) : [];\n } catch {\n return [];\n }\n },\n async preview(): Promise<string | null> {\n try {\n const response = await fetch(PREVIEW_ROUTE_PATH);\n if (!response.ok) return null;\n const body = await readJson(response);\n return typeof body?.preview === 'string' ? body.preview : null;\n } catch {\n return null;\n }\n },\n async probe(): Promise<{ ok: boolean; latencyMs: number; reason?: string }> {\n try {\n const response = await fetch(PROBE_ROUTE_PATH, { method: 'POST' });\n if (!response.ok) return { ok: false, latencyMs: 0, reason: 'unreachable' };\n const body = await readJson(response);\n if (body === null || typeof body !== 'object') return { ok: false, latencyMs: 0, reason: 'unreachable' };\n return {\n ok: body.ok === true,\n latencyMs: typeof body.latencyMs === 'number' ? body.latencyMs : 0,\n ...typeof body.reason === 'string' ? { reason: body.reason } : {},\n };\n } catch {\n return { ok: false, latencyMs: 0, reason: 'unreachable' };\n }\n },\n };\n}\n\n/**\n * Read one row from a stored document value, tolerating a partial record.\n * @param value - one entry of the stored `rows` array.\n * @returns the row's four text fields, each defaulted to ''.\n */\nexport function readRow(value: unknown): TypeRowDraft {\n const record = typeof value === 'object' && value !== null ? (value as Record<string, unknown>) : {};\n const text = (key: string): string => (typeof record[key] === 'string' ? (record[key] as string) : '');\n return {\n description: text('description'),\n provider: text('provider'),\n model: text('model'),\n effort: text('effort'),\n };\n}\n\n/**\n * The model and effort of one log row as a single scanned value.\n *\n * The list shows one \"choice\" cell rather than three, because model and effort\n * are read together \u2014 \"which route did this child run on\". The two are joined\n * with the same middle dot the model menu uses, and a blank field is dropped\n * rather than left as a dangling separator on a fallback row that kept only a\n * partially known inherited route. The provider stays out of the cell: it is\n * the same for nearly every row and is only one hover away in\n * {@link describeChoice}.\n *\n * @param row - the model and effort to join.\n * @returns the joined text, or '' when both are blank.\n */\nexport function describeModel(row: Pick<LogRow, 'model' | 'effort'>): string {\n return joinRouteParts([row.model, row.effort]);\n}\n\n/**\n * The full route of one log row: provider, model and effort.\n *\n * This is what the choice cell's hover bubble carries, so the provider is still\n * one hover away from a reader who needs to know which adapter served the\n * child. Blank fields are dropped by the same rule as {@link describeModel}.\n *\n * @param row - the provider, model and effort to join.\n * @returns the joined text, or '' when all three are blank.\n */\nexport function describeChoice(row: Pick<LogRow, 'provider' | 'model' | 'effort'>): string {\n return joinRouteParts([row.provider, row.model, row.effort]);\n}\n\n/**\n * Join the parts of a route the way both cells above need it.\n *\n * One rule, two callers: a blank part is dropped rather than left as a dangling\n * separator, and the rest are joined with the middle dot the model menu uses.\n *\n * @param parts - the route fields, in display order.\n * @returns the joined text, or '' when every part is blank.\n */\nfunction joinRouteParts(parts: readonly string[]): string {\n return parts\n .map((part) => part.trim())\n .filter((part) => part !== '')\n .join(' \u00B7 ');\n}\n\n/**\n * Stable identity for one exact provider/model route.\n *\n * The separator is a NUL, which cannot appear in a provider or model id, so the\n * join and the split can never disagree. Both live here rather than at the call\n * sites: encoding and decoding are one concept and must not drift apart.\n *\n * @param provider - provider id.\n * @param model - model id.\n * @returns the composite key.\n */\nexport function routeKey(provider: string, model: string): string {\n return `${provider}\\0${model}`;\n}\n\n/**\n * Split a composite route key back into its two ids.\n * @param key - a value produced by {@link routeKey}.\n * @returns the provider and model, both '' when the key is malformed.\n */\nexport function splitRouteKey(key: string): { provider: string; model: string } {\n const at = key.indexOf('\\0');\n if (at < 0) return { provider: '', model: '' };\n return { provider: key.slice(0, at), model: key.slice(at + 1) };\n}\n\n/**\n * Pair the Host's allowlist with the adapter catalogue.\n *\n * The allowlist decides which routes may be offered; the catalogue supplies each\n * route's display name and the effort ids it declares. A route the allowlist\n * names but the catalogue no longer advertises is kept, so a stored row never\n * becomes uneditable merely because an adapter went away.\n *\n * @param allowed - the Host's `allowedModels` entries.\n * @param groups - catalogue provider groups.\n * @returns the options to render, in allowlist order.\n */\nexport function buildModelOptions(\n allowed: readonly { provider?: unknown; model?: unknown }[],\n groups: readonly { id: string; models: readonly { id: string; name: string; reasoning?: { efforts: readonly { id: string }[] } }[] }[],\n): ModelOption[] {\n const byRoute = new Map<string, { label: string; efforts: string[] }>();\n for (const group of groups) {\n for (const model of group.models) {\n byRoute.set(routeKey(group.id, model.id), {\n label: model.name,\n efforts: (model.reasoning?.efforts ?? []).map((effort) => effort.id),\n });\n }\n }\n const options: ModelOption[] = [];\n const seen = new Set<string>();\n for (const entry of allowed) {\n const provider = typeof entry.provider === 'string' ? entry.provider : '';\n const model = typeof entry.model === 'string' ? entry.model : '';\n if (provider === '' || model === '') continue;\n const key = routeKey(provider, model);\n if (seen.has(key)) continue;\n seen.add(key);\n const found = byRoute.get(key);\n options.push({\n provider,\n model,\n label: found?.label ?? model,\n efforts: found?.efforts ?? [],\n });\n }\n return options;\n}\n\n/**\n * The reason the task-type drafts cannot be saved, or '' when they can.\n *\n * A duplicate description is refused because the description is the criterion\n * the judge reads: two identical criteria would make the answer ambiguous and\n * the log unreadable. An empty description is refused for the same reason \u2014 a\n * row the judge cannot tell apart from any other.\n *\n * @param rows - the staged rows.\n * @param t - the page's translator, so the message is localized.\n * @returns the reason text, or ''.\n */\nexport function validateRows(rows: readonly TypeRowDraft[], t: (key: string) => string): string {\n const seen = new Set<string>();\n for (const row of rows) {\n const description = row.description.trim();\n if (description === '') return t('save.emptyDescription');\n if (seen.has(description)) return t('save.duplicateDescription');\n seen.add(description);\n }\n return '';\n}\n\n/**\n * The task-type list as plain JSON text, for copying out.\n *\n * The shape is the stored one \u2014 an array of `{ description, provider, model,\n * effort }` \u2014 with the sequence numbers left out: they are positional, and\n * writing them would invite a reader to think they are part of the setting.\n *\n * @param rows - the rows as they stand on the page.\n * @returns indented JSON text.\n */\nexport function exportRowsJson(rows: readonly TypeRowDraft[]): string {\n return JSON.stringify(\n // \u7A7A\u767D\u884C\uFF08\u8BFB\u8005\u6309\u4E86\u300C\u52A0\u4E00\u884C\u300D\u8FD8\u6CA1\u586B\uFF09\u4E0D\u5199\u8FDB JSON\uFF1A\u5B83\u6CA1\u6709\u5185\u5BB9\u53EF\u5E26\u8D70\uFF0C\u5199\u51FA\u53BB\n // \u8FD8\u4F1A\u8BA9\u8FD9\u4EFD\u6587\u672C\u81EA\u5DF1\u8BFB\u4E0D\u56DE\u6765\u3002\n rows.filter((row) => !isBlankRow(row)).map((row) => ({\n description: row.description,\n provider: row.provider,\n model: row.model,\n effort: row.effort,\n })),\n null,\n 2,\n );\n}\n\n/**\n * Whether a row carries nothing at all.\n * @param row - the row to inspect.\n * @returns true when all four fields are empty or whitespace.\n */\nfunction isBlankRow(row: TypeRowDraft): boolean {\n return [row.description, row.provider, row.model, row.effort]\n .every((field) => field.trim() === '');\n}\n\n/** What reading pasted JSON produced. */\nexport type RowsImport =\n | { ok: true; rows: TypeRowDraft[] }\n /** `error` names the fault; the page turns it into its own sentence. */\n | { ok: false; error: 'json' | 'shape' | 'empty' };\n\n/**\n * Read a pasted task-type list.\n *\n * The text is checked before it can reach the page: it must be one JSON array,\n * every element must be an object, and the four fields must be strings. An\n * unknown field is ignored rather than refused, so a list copied from a newer\n * version still loads what it understands.\n *\n * @param text - what the reader pasted.\n * @returns the rows, or the fault that stopped it.\n */\nexport function parseRowsJson(text: string): RowsImport {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n return { ok: false, error: 'json' };\n }\n if (!Array.isArray(parsed)) return { ok: false, error: 'shape' };\n if (parsed.length === 0) return { ok: false, error: 'empty' };\n const rows: TypeRowDraft[] = [];\n for (const value of parsed) {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return { ok: false, error: 'shape' };\n const record = value as Record<string, unknown>;\n // \u5B57\u6BB5\u5B58\u5728\u4F46\u4E0D\u662F\u6587\u5B57\uFF0C\u662F\u5F62\u72B6\u4E0D\u5BF9\uFF1B\u7F3A\u5B57\u6BB5\u5F53\u4F5C\u7A7A\u4E32\uFF0C\u90A3\u662F\u5408\u6CD5\u7684\u6B8B\u7F3A\u8BB0\u5F55\u3002\n const wrongType = ['description', 'provider', 'model', 'effort']\n .some((key) => record[key] !== undefined && typeof record[key] !== 'string');\n if (wrongType) return { ok: false, error: 'shape' };\n const field = (key: string): string => (typeof record[key] === 'string' ? (record[key] as string) : '');\n const row = {\n description: field('description'),\n provider: field('provider'),\n model: field('model'),\n effort: field('effort'),\n };\n // \u7A7A\u767D\u884C\u7167\u6536\u4E0D\u8BEF\u3001\u76F4\u63A5\u8DF3\u8FC7\uFF1A\u5BFC\u51FA\u4F1A\u5E26\u6765\u8FD9\u79CD\u884C\uFF0C\u62D2\u6536\u4F1A\u8BA9\u8FD9\u4EFD JSON \u81EA\u5DF1\u8BFB\u4E0D\u56DE\u6765\u3002\n if (isBlankRow(row)) continue;\n rows.push(row);\n }\n if (rows.length === 0) return { ok: false, error: 'empty' };\n return { ok: true, rows };\n}\n\n/** A key nothing is staged for and nothing is known about. */\nfunction emptyKey(): KeyState {\n return {\n text: '', configured: false, writable: false, unavailable: false,\n saving: false, failed: false, error: '', landed: '',\n };\n}\n\n/**\n * The read/write face of the Host document plus the runtime reads.\n *\n * Every control stages into this store and only a section's own save writes, so\n * a half-typed endpoint can never reach a delegation, and a half-written type\n * list can never be stored behind the reader's back.\n */\nexport class DispatchCardStore {\n private state: PageState = {\n available: false,\n writable: false,\n enabled: true,\n logEnabled: true,\n endpointUrl: DEFAULT_ENDPOINT_URL,\n judgeModel: DEFAULT_JUDGE_MODEL,\n rows: [],\n models: [],\n catalogRead: false,\n committed: {\n enabled: true,\n logEnabled: true,\n endpointUrl: DEFAULT_ENDPOINT_URL,\n judgeModel: DEFAULT_JUDGE_MODEL,\n rows: [],\n },\n judgeDirty: false,\n rowsDirty: false,\n dirty: false,\n rowsInvalid: '',\n saving: '',\n saveFailed: '',\n saveError: '',\n key: emptyKey(),\n log: [],\n logLoaded: false,\n logFailed: false,\n };\n\n private listeners = new Set<() => void>();\n private form: ConfigFormLike | null = null;\n private allowedForm: ConfigFormLike | null = null;\n private session: SessionRemoteLike | null = null;\n private remote: DispatchRemoteLike | null = null;\n private credentials: CredentialsRemoteLike | null = null;\n private offForm: (() => void) | null = null;\n private offAllowed: (() => void) | null = null;\n private translate: (key: string) => string = (key) => key;\n\n /** Bind the Host services; re-binding detaches the previous subscriptions. */\n attach(options: {\n form: ConfigFormLike | null;\n allowedForm: ConfigFormLike | null;\n session: SessionRemoteLike | null;\n remote: DispatchRemoteLike | null;\n credentials: CredentialsRemoteLike | null;\n t: (key: string) => string;\n }): void {\n this.offForm?.();\n this.offAllowed?.();\n this.form = options.form;\n this.allowedForm = options.allowedForm;\n this.session = options.session;\n this.remote = options.remote;\n this.credentials = options.credentials;\n this.translate = options.t;\n this.state = {\n ...this.state,\n key: { ...this.state.key, unavailable: options.credentials === null },\n };\n if (this.form !== null) {\n this.offForm = this.form.subscribe(() => this.deriveCommitted());\n this.deriveCommitted();\n }\n if (this.allowedForm !== null) {\n this.offAllowed = this.allowedForm.subscribe(() => void this.loadModels());\n void this.loadModels();\n }\n void this.refreshKeyStatus();\n }\n\n getState(): PageState {\n return this.state;\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n /** Read the Host's allowlist and the adapter catalogue into the model options. */\n async loadModels(): Promise<void> {\n const allowedValue = this.allowedForm?.getSnapshot().value;\n const allowed = Array.isArray(allowedValue?.allowedModels)\n ? (allowedValue.allowedModels as { provider?: unknown; model?: unknown }[])\n : [];\n let groups: readonly { id: string; models: readonly { id: string; name: string; reasoning?: { efforts: readonly { id: string }[] } }[] }[] = [];\n let catalogRead = false;\n if (this.session !== null) {\n try {\n const response = await this.session.modelCatalog();\n if (response.ok) {\n groups = response.value.groups;\n catalogRead = true;\n }\n } catch {\n // Handled by the flag below.\n }\n }\n // Whether the effort column may offer a fixed list. When the catalogue could\n // not be read the column falls back to free text rather than going\n // unavailable: an empty list would otherwise disable the effort cell on\n // every row, and a table where no row can be completed is a table that\n // silently stops judging anything.\n this.state = { ...this.state, models: buildModelOptions(allowed, groups), catalogRead };\n this.notify();\n }\n\n /** Read the status-only view of the judgement key. */\n async refreshKeyStatus(): Promise<void> {\n if (this.credentials === null) return;\n try {\n const response = await this.credentials.describe([JUDGE_API_KEY_REF]);\n if (!response.ok) return;\n const info = response.value[JUDGE_API_KEY_REF];\n this.state = {\n ...this.state,\n key: {\n ...this.state.key,\n configured: info?.configured === true,\n writable: info?.writable === true,\n },\n };\n this.notify();\n } catch {\n // The key stays \"not configured\": the status is an enrichment, and a\n // failed read must not claim a key that may not be there.\n }\n }\n\n /**\n * Map the Host's resolved section into committed state and re-seed the drafts.\n *\n * Drafts are held FIELD BY FIELD, against the value this page last saw\n * committed. Holding a whole section instead would make a save write back a\n * field the reader never touched \u2014 reverting a change another page made to it \u2014\n * while holding nothing would discard input mid-typing every time the Host\n * publishes.\n */\n private deriveCommitted(): void {\n const snapshot = this.form?.getSnapshot();\n const value = snapshot?.value;\n if (value === undefined) return;\n const rows = Array.isArray(value.rows) ? (value.rows as unknown[]).map(readRow) : [];\n const committed = {\n enabled: typeof value.enabled === 'boolean' ? value.enabled : true,\n logEnabled: typeof value.logEnabled === 'boolean' ? value.logEnabled : true,\n endpointUrl: typeof value.endpointUrl === 'string' ? value.endpointUrl : DEFAULT_ENDPOINT_URL,\n judgeModel: typeof value.judgeModel === 'string' ? value.judgeModel : DEFAULT_JUDGE_MODEL,\n rows,\n };\n /** Whether the reader's staged value still differs from what this page last saw committed. */\n const staged = <T>(current: T, previously: T): boolean => current !== previously;\n const before = this.state.committed;\n this.state = {\n ...this.state,\n available: snapshot?.status === 'ready',\n writable: snapshot?.writable ?? false,\n committed,\n enabled: staged(this.state.enabled, before.enabled) ? this.state.enabled : committed.enabled,\n logEnabled: staged(this.state.logEnabled, before.logEnabled) ? this.state.logEnabled : committed.logEnabled,\n endpointUrl: staged(this.state.endpointUrl, before.endpointUrl) ? this.state.endpointUrl : committed.endpointUrl,\n judgeModel: staged(this.state.judgeModel, before.judgeModel) ? this.state.judgeModel : committed.judgeModel,\n rows: JSON.stringify(this.state.rows) !== JSON.stringify(before.rows) ? this.state.rows : committed.rows,\n };\n this.recompute();\n }\n\n /** Recompute per-section dirtiness and the row validation against committed values. */\n private recompute(): void {\n const committed = this.state.committed;\n const judgeDirty =\n this.state.enabled !== committed.enabled ||\n this.state.logEnabled !== committed.logEnabled ||\n this.state.endpointUrl !== committed.endpointUrl ||\n this.state.judgeModel !== committed.judgeModel ||\n this.state.key.text.trim() !== '';\n const rowsDirty = JSON.stringify(this.state.rows) !== JSON.stringify(committed.rows);\n this.state = {\n ...this.state,\n judgeDirty,\n rowsDirty,\n dirty: judgeDirty || rowsDirty,\n rowsInvalid: validateRows(this.state.rows, this.translate),\n };\n this.notify();\n }\n\n /** Stage one top-level field. */\n field(key: 'endpointUrl' | 'judgeModel', value: string): void {\n this.state = { ...this.state, [key]: value, saveFailed: '' };\n this.recompute();\n }\n\n /** Stage one switch. */\n toggle(key: 'enabled' | 'logEnabled', value: boolean): void {\n this.state = { ...this.state, [key]: value, saveFailed: '' };\n this.recompute();\n }\n\n /** Stage the judgement key. The value stays in this draft until a save. */\n key(text: string): void {\n this.state = { ...this.state, key: { ...this.state.key, text, failed: false, error: '', landed: '' } };\n this.recompute();\n }\n\n /** Stage one cell of one row. */\n cell(index: number, key: keyof TypeRowDraft, value: string): void {\n const rows = this.state.rows.map((row, at) => (at === index ? { ...row, [key]: value } : row));\n // Choosing a model drops an effort that model does not declare, so a save can\n // never carry an effort the selected route cannot run.\n this.state = {\n ...this.state,\n rows: key === 'model' ? this.reconcileEffort(rows, index) : rows,\n saveFailed: '',\n };\n this.recompute();\n }\n\n /** Drop an effort the freshly selected model does not declare. */\n private reconcileEffort(rows: TypeRowDraft[], index: number): TypeRowDraft[] {\n const row = rows[index];\n if (row === undefined) return rows;\n const option = this.state.models.find(\n (candidate) => candidate.provider === row.provider && candidate.model === row.model,\n );\n if (option === undefined || option.efforts.length === 0) return rows;\n if (row.effort !== '' && !option.efforts.includes(row.effort)) {\n return rows.map((candidate, at) => (at === index ? { ...candidate, effort: '' } : candidate));\n }\n return rows;\n }\n\n /** Append an empty row. */\n addRow(): void {\n this.state = { ...this.state, rows: [...this.state.rows, { description: '', provider: '', model: '', effort: '' }], saveFailed: '' };\n this.recompute();\n }\n\n /**\n * Stage a whole imported list, replacing what the page holds.\n *\n * Nothing is written: an import lands in the drafts exactly like typing does,\n * so the section's own save button is still the only thing that reaches the\n * document, and the reader can discard the import like any other edit.\n *\n * @param rows - the rows read from the pasted JSON.\n */\n replaceRows(rows: readonly TypeRowDraft[]): void {\n this.state = { ...this.state, rows: rows.map((row) => ({ ...row })), saveFailed: '' };\n this.recompute();\n }\n\n /** Delete one row; the remaining rows renumber themselves. */\n removeRow(index: number): void {\n this.state = { ...this.state, rows: this.state.rows.filter((_row, at) => at !== index), saveFailed: '' };\n this.recompute();\n }\n\n /** Discard one section's drafts back to the committed values. */\n revert(section: Section): void {\n const committed = this.state.committed;\n this.state = section === 'judge'\n ? {\n ...this.state,\n enabled: committed.enabled,\n logEnabled: committed.logEnabled,\n endpointUrl: committed.endpointUrl,\n judgeModel: committed.judgeModel,\n // \u53EA\u6E05\u6389\u300C\u8FD8\u6CA1\u4EA4\u51FA\u53BB\u7684\u90A3\u6BB5\u6587\u672C\u300D\u3002\u5BC6\u94A5\u5DF2\u7ECF\u5B58\u5728\u51ED\u636E\u6587\u4EF6\u91CC\uFF0C\u653E\u5F03\u8FD9\u4E00\u8282\u7684\n // \u8BBE\u7F6E\u8349\u7A3F\u4E0D\u8BE5\u8BA9\u9875\u9762\u6539\u53E3\u8BF4\u300C\u8FD8\u6CA1\u6709\u5BC6\u94A5\u300D\u2014\u2014\u90A3\u662F\u53E6\u4E00\u5904\u7684\u72B6\u6001\u3002\n key: { ...this.state.key, text: '', failed: false, error: '', landed: '' },\n saveFailed: '',\n }\n : { ...this.state, rows: committed.rows, saveFailed: '' };\n this.recompute();\n }\n\n /**\n * Write one section's staged edits as one revision-fenced batch.\n *\n * The judgement section also writes a typed key, so naming the endpoint and\n * giving it its credential is one gesture rather than two. The type rows are\n * written whole rather than diffed: the array is one value, and a positional\n * number is derived from it, so a partial write could momentarily renumber the\n * list under a reader mid-save.\n *\n * @param section - which section's drafts to write.\n */\n async save(section: Section): Promise<void> {\n if (this.state.saving !== '') return;\n const form = this.form;\n if (form === null || !this.state.writable) return;\n if (section === 'rows' && (this.state.rowsInvalid !== '' || !this.state.rowsDirty)) return;\n if (section === 'judge' && !this.state.judgeDirty) return;\n\n const ops: SettingsPathOpLike[] = [];\n if (section === 'judge') {\n if (this.state.endpointUrl !== this.state.committed.endpointUrl) {\n ops.push({ op: 'set', path: ['endpointUrl'], value: this.state.endpointUrl });\n }\n if (this.state.judgeModel !== this.state.committed.judgeModel) {\n ops.push({ op: 'set', path: ['judgeModel'], value: this.state.judgeModel });\n }\n if (this.state.enabled !== this.state.committed.enabled) {\n ops.push({ op: 'set', path: ['enabled'], value: this.state.enabled });\n }\n if (this.state.logEnabled !== this.state.committed.logEnabled) {\n ops.push({ op: 'set', path: ['logEnabled'], value: this.state.logEnabled });\n }\n } else if (JSON.stringify(this.state.rows) !== JSON.stringify(this.state.committed.rows)) {\n ops.push({ op: 'set', path: ['rows'], value: this.state.rows.map((row) => ({ ...row })) });\n }\n\n this.state = { ...this.state, saving: section, saveFailed: '', saveError: '' };\n this.notify();\n\n // The key goes first: a document write the Host refuses leaves the key in\n // place, while a key that landed with a refused endpoint is still a landed\n // key. Either way the reader is told which part did not take.\n const typedKey = section === 'judge' ? this.state.key.text.trim() : '';\n let failure = '';\n let keyLanded: '' | 'saved' | 'cleared' = '';\n if (typedKey !== '') {\n const result = await this.writeKey(typedKey);\n if (result.ok) keyLanded = 'saved';\n else failure = result.error;\n }\n if (failure === '' && ops.length > 0) {\n try {\n const landed = await form.mutate(ops, form.getSnapshot().revision);\n // `false` is a refusal, not a rejection: the Host answered and did not\n // accept, so reporting success here would show a saved page over a\n // document that still holds the old value.\n if (!landed) failure = this.translate('save.refused');\n } catch (error) {\n // The Host's own words, not a generic phrase: a rejected write is the one\n // place the reader needs to know WHAT the Host objected to.\n failure = error instanceof Error && error.message !== '' ? error.message : this.translate('save.invalid');\n }\n }\n this.state = {\n ...this.state,\n saving: '',\n saveFailed: failure === '' ? '' : section,\n saveError: failure,\n key: keyLanded === '' ? this.state.key : { ...this.state.key, text: '', landed: keyLanded },\n };\n if (failure === '') this.deriveCommitted();\n else this.notify();\n }\n\n /**\n * Write one judgement key through the credentials service.\n *\n * The service resolves with `{ ok: false }` rather than rejecting when it\n * refuses a write, so that result decides the outcome. The key value is handed\n * straight to the service and is never copied into the page state.\n *\n * @param value - the staged key text, already trimmed and known non-empty.\n * @returns whether the write landed, and the message when it did not.\n */\n private async writeKey(value: string): Promise<{ ok: boolean; error: string }> {\n const credentials = this.credentials;\n if (credentials === null) return { ok: false, error: this.translate('key.unavailable') };\n this.state = { ...this.state, key: { ...this.state.key, saving: true, failed: false, error: '' } };\n this.notify();\n try {\n const response = await credentials.set(JUDGE_API_KEY_REF, value);\n if (!response.ok) {\n const error = response.error.message || this.translate('key.saveFailed');\n this.state = { ...this.state, key: { ...this.state.key, saving: false, failed: true, error } };\n return { ok: false, error };\n }\n this.state = { ...this.state, key: { ...this.state.key, saving: false, failed: false, error: '', configured: true } };\n await this.refreshKeyStatus();\n return { ok: true, error: '' };\n } catch (error) {\n const message = error instanceof Error && error.message !== '' ? error.message : this.translate('key.saveFailed');\n this.state = { ...this.state, key: { ...this.state.key, saving: false, failed: true, error: message } };\n return { ok: false, error: message };\n }\n }\n\n /**\n * Remove the stored judgement key.\n *\n * A separate control rather than \"save an empty field\": the shared\n * configuration form's own rule is that a blank draft writes nothing, so an\n * emptied input cannot mean removal without contradicting it.\n *\n * @returns settlement after the credentials read-back.\n */\n async clearKey(): Promise<void> {\n const credentials = this.credentials;\n if (credentials === null) return;\n this.state = { ...this.state, key: { ...this.state.key, saving: true, failed: false, error: '' } };\n this.notify();\n try {\n const response = await credentials.unset(JUDGE_API_KEY_REF);\n if (!response.ok) {\n this.state = {\n ...this.state,\n key: {\n ...this.state.key,\n saving: false,\n failed: true,\n error: response.error.message || this.translate('key.clearFailed'),\n },\n };\n } else {\n this.state = {\n ...this.state,\n key: { ...this.state.key, saving: false, text: '', failed: false, error: '', landed: 'cleared', configured: false },\n };\n await this.refreshKeyStatus();\n }\n } catch (error) {\n this.state = {\n ...this.state,\n key: {\n ...this.state.key,\n saving: false,\n failed: true,\n error: error instanceof Error && error.message !== '' ? error.message : this.translate('key.clearFailed'),\n },\n };\n }\n this.notify();\n }\n\n /** Read the runtime log from the Host. */\n async refreshLog(): Promise<void> {\n if (this.remote === null) return;\n try {\n const entries = await this.remote.log();\n this.state = { ...this.state, log: entries, logLoaded: true, logFailed: false };\n } catch {\n this.state = { ...this.state, logLoaded: true, logFailed: true };\n }\n this.notify();\n }\n\n /** Read the exact prompt a judgement would send. */\n async preview(): Promise<string | null> {\n if (this.remote === null) return null;\n try {\n return await this.remote.preview();\n } catch {\n return null;\n }\n }\n\n /** Test the judge endpoint against the committed settings. */\n async probe(): Promise<{ ok: boolean; latencyMs: number; reason?: string }> {\n if (this.remote === null) return { ok: false, latencyMs: 0, reason: 'unreachable' };\n try {\n return await this.remote.probe();\n } catch {\n return { ok: false, latencyMs: 0, reason: 'unreachable' };\n }\n }\n\n /** The effort ids available for one row's currently selected model. */\n effortsFor(row: TypeRowDraft): string[] {\n return this.state.models.find(\n (candidate) => candidate.provider === row.provider && candidate.model === row.model,\n )?.efforts ?? [];\n }\n\n /** Whether one row will be offered to the judge (the server's own rule). */\n rowUsable(row: TypeRowDraft): boolean {\n return isSelectableRow(row);\n }\n\n private notify(): void {\n for (const listener of [...this.listeners]) {\n try {\n listener();\n } catch {}\n }\n }\n}\n\nexport const dispatchCardStore = new DispatchCardStore();\n", "// \u7C7B\u578B\u53EA\u8BFB\uFF1A\u5EA7\u4F4D\u5951\u7EA6\u4E0E\u5B83\u7684 LocaleNamespaceMap \u5408\u5E76\u6765\u81EA\u8FD9\u4E2A\u5305\u3002\nimport type {} from '@deepseek-ai/dsh-client-ui-slots';\n\n/** \u8FD9\u4E2A\u63D2\u4EF6\u7684\u5B57\u5178\u547D\u540D\u7A7A\u95F4\uFF1A\u5EA7\u4F4D\u6CE8\u518C\u4E0E\u5361\u7247\u6587\u6848\u90FD\u7528\u5B83\u3002 */\nexport const NS = 'subagentjudgedispatch';\n/** \u82F1\u6587\u6587\u6848\u3002 */\nexport const en = {\n 'tab.design': 'Design',\n 'tab.log': 'Log',\n 'switch.rewrite.title': 'Rewrite subagent model and effort',\n 'switch.rewrite.desc':\n 'Every subagent is judged once when it is delegated. While this is off, nothing is judged and nothing is logged.',\n 'switch.log.title': 'Record the log',\n 'switch.log.desc': 'Write every judgement to a file under the DSH home, so it survives a restart.',\n 'judge.title': 'Judgement service',\n 'judge.desc':\n 'The task type is decided by this endpoint. It receives the delegation label, the task text and the type list, and answers with one type number.',\n 'judge.endpoint': 'Endpoint address',\n 'judge.endpointDesc': 'The full address, including the protocol path. One System One example is prefilled.',\n 'judge.model': 'Judgement model',\n 'judge.modelDesc': 'The model id this endpoint interprets.',\n 'judge.key': 'Key',\n 'judge.keyDesc': 'Stored write-only as {ref} in {path}. It is never read back into this page.',\n 'judge.keyPlaceholder': 'Paste the key',\n 'judge.keyPlaceholderSet': 'A key is stored; type a new one to replace it',\n 'judge.keySet': 'Key stored',\n 'judge.keyUnset': 'No key',\n 'judge.keyClear': 'Remove the key',\n 'judge.keySaved': 'The key is stored.',\n 'judge.keyCleared': 'The key was removed.',\n 'judge.keyFailed': 'The key was not stored: {error}',\n 'key.unavailable': 'The credentials service is unavailable on this page.',\n 'judge.keyUnavailable': 'This page has no credentials channel, so a key cannot be stored from here.',\n 'key.saveFailed': 'The key was not accepted.',\n 'key.clearFailed': 'The key was not removed.',\n 'judge.probe': 'Test the connection',\n 'judge.probing': 'Testing\u2026',\n 'judge.probeOk': 'Connected in {latency} ms',\n 'judge.probeFail': 'Not usable: {reason}',\n 'reason.unconfigured': 'the endpoint address or model is not filled in',\n 'reason.unreachable': 'the endpoint could not be reached',\n 'reason.timeout': 'it did not answer within 5 seconds',\n 'reason.unmatched': 'the answer named no listed type',\n 'reason.incomplete': 'the selected type is not filled in',\n 'reason.other': 'other',\n 'reason.unknown': 'unknown reason',\n 'rows.title': 'Task types',\n 'rows.desc':\n 'One row per task type: the number it answers with, the description it reads, the model it runs on, and the effort. Numbers are assigned for you, always 1, 2, 3\u2026',\n 'rows.empty': 'No task type yet. Add one below.',\n 'rows.colId': 'No.',\n 'rows.colType': 'Task type',\n 'rows.colDescription': 'Description',\n 'rows.colModel': 'Model',\n 'rows.colEffort': 'Effort',\n 'rows.add': 'Add a row',\n 'rows.remove': 'Remove',\n 'rows.browse': 'View',\n 'rows.browseTitle': 'Task type {id}',\n 'rows.browseClose': 'Close',\n 'rows.modelPlaceholder': 'Not chosen',\n 'rows.effortPlaceholder': 'Not chosen',\n 'rows.incomplete': 'Not used',\n 'rows.descriptionPlaceholder': 'What kind of job is this? Write as much as you like.',\n 'rows.allowedEmpty':\n 'The host setting \"models subagents may choose\" is empty, so there is nothing to pick. Fill it in on the Subagent settings page first.',\n 'rows.importOpen': 'Import',\n 'rows.export': 'Export',\n 'rows.exported': 'Copied the task-type list as JSON.',\n 'rows.exportFailed': 'Could not copy to the clipboard.',\n 'rows.importTitle': 'Import the task-type list',\n 'rows.importDesc': 'Paste the JSON list here. It fills the table below; nothing is written until you press Save.',\n 'rows.importPlaceholder': '[\\n { \"description\": \"...\", \"provider\": \"...\", \"model\": \"...\", \"effort\": \"...\" }\\n]',\n 'rows.importApply': 'Fill in',\n 'rows.importCancel': 'Cancel',\n 'rows.importBadJson': 'This is not valid JSON.',\n 'rows.importBadShape': 'This is not a list of task types: every entry needs description, provider, model and effort as text.',\n 'rows.importEmpty': 'There is no task type in this list.',\n 'preview.title': 'View the full prompt',\n 'preview.desc': 'Exactly what would be sent to the judgement service. The delegation label and the task text are filled in at delegation time.',\n 'preview.open': 'View the full prompt',\n 'preview.copy': 'Copy',\n 'preview.copied': 'Copied',\n 'preview.close': 'Close',\n 'preview.blocked': 'Save your changes first.',\n 'preview.failed': 'The preview could not be read.',\n 'save.button': 'Save',\n 'save.saving': 'Saving\u2026',\n 'save.unsaved': 'There are unsaved changes.',\n 'save.discard': 'Discard',\n 'save.refusedTitle': 'This cannot be saved yet',\n 'save.failed': 'The save did not land: {error}',\n 'save.duplicateDescription': 'Two rows have the same description. Give them different descriptions before saving.',\n 'save.emptyDescription': 'Every row needs a description before it can be saved.',\n 'save.invalid': 'This cannot be saved yet.',\n 'save.refused': 'The host did not accept this write.',\n 'log.title': 'Judgement log',\n 'log.desc': 'The most recent 10 judgements, newest first; the file keeps more. Click one to see the exact prompt that was sent.',\n 'log.empty': 'No judgement has run yet.',\n 'log.colResult': 'Result',\n 'log.colChoice': 'Choice',\n 'log.colParent': 'Main agent',\n 'log.colChild': 'Subagent',\n 'log.colTime': 'Time',\n 'log.colLatency': 'Took',\n 'log.resultJudged': 'Type {id}',\n 'log.resultInherited': 'No match',\n 'log.promptTitle': 'The prompt sent to the judge',\n 'log.promptDesc': 'Exactly the request body this judgement sent.',\n 'log.promptClose': 'Close',\n 'log.promptEmpty': 'No request was sent for this judgement.',\n 'log.refresh': 'Refresh',\n 'log.loadFailed': 'The log could not be read.',\n 'ms': '{value} ms',\n};\n\n/** \u4E2D\u6587\u6587\u6848\u3002\u952E\u96C6\u4E0E\u82F1\u6587\u9010\u4E00\u5BF9\u9F50\uFF08smoke-client \u4F1A\u67E5\u8FD9\u4E00\u6761\uFF09\u3002 */\nexport const zh: Record<keyof typeof en, string> = {\n 'tab.design': '\u8BBE\u8BA1',\n 'tab.log': '\u65E5\u5FD7',\n 'switch.rewrite.title': '\u6539\u5199\u5B50\u4EE3\u7406\u7684\u6A21\u578B\u4E0E\u5F3A\u5EA6',\n 'switch.rewrite.desc': '\u6BCF\u4E2A\u5B50\u4EE3\u7406\u5728\u6D3E\u5DE5\u90A3\u4E00\u523B\u5224\u65AD\u4E00\u6B21\u3002\u8FD9\u4E2A\u5F00\u5173\u5173\u7740\u65F6\u4E0D\u5224\u65AD\uFF0C\u4E5F\u4E0D\u8BB0\u65E5\u5FD7\u3002',\n 'switch.log.title': '\u8BB0\u5F55\u65E5\u5FD7',\n 'switch.log.desc': '\u628A\u6BCF\u6B21\u5224\u65AD\u5199\u8FDB DSH \u5BB6\u76EE\u5F55\u91CC\u7684\u4E00\u4E2A\u6587\u4EF6\uFF0C\u91CD\u542F\u4E4B\u540E\u7167\u6837\u5728\u3002',\n 'judge.title': '\u5224\u65AD\u670D\u52A1',\n 'judge.desc': '\u4EFB\u52A1\u7C7B\u578B\u7531\u8FD9\u4E2A\u5730\u5740\u51B3\u5B9A\uFF1A\u5B83\u6536\u5230\u6D3E\u5DE5\u6807\u7B7E\u3001\u4EFB\u52A1\u6B63\u6587\u548C\u7C7B\u578B\u6E05\u5355\uFF0C\u56DE\u7B54\u4E00\u4E2A\u7C7B\u578B\u7F16\u53F7\u3002',\n 'judge.endpoint': '\u7AEF\u70B9\u5730\u5740',\n 'judge.endpointDesc': '\u5B8C\u6574\u5730\u5740\uFF0C\u8981\u5E26\u534F\u8BAE\u8DEF\u5F84\u3002\u5DF2\u7ECF\u9884\u586B\u4E00\u4E2A System One \u7684\u4F8B\u5B50\u3002',\n 'judge.model': '\u5224\u65AD\u6A21\u578B',\n 'judge.modelDesc': '\u8FD9\u4E2A\u5730\u5740\u6240\u4F7F\u7528\u7684\u6A21\u578B\u540D\u3002',\n 'judge.key': '\u5BC6\u94A5',\n 'judge.keyDesc': '\u4EE5 {ref} \u7684\u540D\u5B57\u5B58\u8FDB {path}\uFF0C\u53EA\u5199\u4E0D\u8BFB\uFF0C\u4E0D\u4F1A\u56DE\u586B\u5230\u8FD9\u4E00\u9875\u3002',\n 'judge.keyPlaceholder': '\u628A\u5BC6\u94A5\u8D34\u8FDB\u6765',\n 'judge.keyPlaceholderSet': '\u5DF2\u7ECF\u5B58\u4E86\u5BC6\u94A5\uFF0C\u8981\u6362\u5C31\u586B\u4E00\u4E2A\u65B0\u7684',\n 'judge.keySet': '\u5DF2\u5B58\u5BC6\u94A5',\n 'judge.keyUnset': '\u8FD8\u6CA1\u6709\u5BC6\u94A5',\n 'judge.keyClear': '\u5220\u6389\u5BC6\u94A5',\n 'judge.keySaved': '\u5BC6\u94A5\u5DF2\u5B58\u3002',\n 'judge.keyCleared': '\u5BC6\u94A5\u5DF2\u5220\u6389\u3002',\n 'judge.keyFailed': '\u5BC6\u94A5\u6CA1\u5B58\u4E0A\uFF1A{error}',\n 'key.unavailable': '\u8FD9\u4E2A\u9875\u9762\u4E0A\u7528\u4E0D\u4E86\u51ED\u636E\u670D\u52A1\u3002',\n 'judge.keyUnavailable': '\u8FD9\u4E2A\u9875\u9762\u4E0A\u6CA1\u6709\u51ED\u636E\u901A\u9053\uFF0C\u5728\u8FD9\u91CC\u5B58\u4E0D\u4E86\u5BC6\u94A5\u3002',\n 'key.saveFailed': '\u5BC6\u94A5\u6CA1\u88AB\u63A5\u53D7\u3002',\n 'key.clearFailed': '\u5BC6\u94A5\u6CA1\u5220\u6389\u3002',\n 'judge.probe': '\u8BD5\u4E00\u4E0B\u901A\u4E0D\u901A',\n 'judge.probing': '\u6B63\u5728\u8BD5\u2026',\n 'judge.probeOk': '\u8FDE\u4E0A\u4E86\uFF0C\u7528\u4E86 {latency} \u6BEB\u79D2',\n 'judge.probeFail': '\u7528\u4E0D\u4E86\uFF1A{reason}',\n 'reason.unconfigured': '\u7AEF\u70B9\u5730\u5740\u6216\u5224\u65AD\u6A21\u578B\u8FD8\u6CA1\u586B',\n 'reason.unreachable': '\u8FDE\u4E0D\u4E0A\u8FD9\u4E2A\u5730\u5740',\n 'reason.timeout': '\u7B49\u4E86 5 \u79D2\u6CA1\u56DE',\n 'reason.unmatched': '\u7B54\u590D\u5BF9\u4E0D\u4E0A\u6E05\u5355',\n 'reason.incomplete': '\u9009\u4E2D\u7684\u7C7B\u578B\u6CA1\u586B\u5168',\n 'reason.other': '\u5176\u4ED6',\n 'reason.unknown': '\u539F\u56E0\u4E0D\u660E',\n 'rows.title': '\u4EFB\u52A1\u7C7B\u578B',\n 'rows.desc':\n '\u4E00\u884C\u4E00\u4E2A\u4EFB\u52A1\u7C7B\u578B\uFF1A\u5B83\u56DE\u7B54\u7684\u7F16\u53F7\u3001\u5B83\u8BFB\u7684\u63CF\u8FF0\u3001\u8BE5\u7528\u7684\u6A21\u578B\u4E0E\u5F3A\u5EA6\u3002\u7F16\u53F7\u7531\u63D2\u4EF6\u81EA\u52A8\u6392\uFF0C\u6C38\u8FDC\u4ECE 1 \u5F80\u540E\u8FDE\u7740\u3002',\n 'rows.empty': '\u8FD8\u6CA1\u6709\u4EFB\u52A1\u7C7B\u578B\u3002\u5728\u4E0B\u9762\u52A0\u4E00\u884C\u3002',\n 'rows.colId': '\u7F16\u53F7',\n 'rows.colType': '\u4EFB\u52A1\u7C7B\u578B',\n 'rows.colDescription': '\u63CF\u8FF0',\n 'rows.colModel': '\u6A21\u578B',\n 'rows.colEffort': '\u5F3A\u5EA6',\n 'rows.add': '\u52A0\u4E00\u884C',\n 'rows.remove': '\u5220\u6389',\n 'rows.browse': '\u67E5\u770B',\n 'rows.browseTitle': '\u4EFB\u52A1\u7C7B\u578B {id}',\n 'rows.browseClose': '\u5173\u95ED',\n 'rows.modelPlaceholder': '\u8FD8\u6CA1\u9009',\n 'rows.effortPlaceholder': '\u8FD8\u6CA1\u9009',\n 'rows.incomplete': '\u4E0D\u751F\u6548',\n 'rows.descriptionPlaceholder': '\u8FD9\u662F\u54EA\u79CD\u6D3B\uFF1F\u5199\u591A\u5C11\u90FD\u884C\u3002',\n 'rows.allowedEmpty': '\u5BBF\u4E3B\u90A3\u4EFD\u300C\u5B50\u4EE3\u7406\u53EF\u9009\u7528\u54EA\u4E9B\u6A21\u578B\u300D\u8FD8\u662F\u7A7A\u7684\uFF0C\u6CA1\u6709\u53EF\u4EE5\u9009\u7684\u4E1C\u897F\u3002\u5148\u5230\u5B50\u4EE3\u7406\u8BBE\u7F6E\u9875\u628A\u5B83\u586B\u4E0A\u3002',\n 'rows.importOpen': '\u5BFC\u5165',\n 'rows.export': '\u5BFC\u51FA',\n 'rows.exported': '\u5DF2\u7ECF\u628A\u4EFB\u52A1\u7C7B\u578B\u6E05\u5355\u6309 JSON \u590D\u5236\u8D70\u4E86\u3002',\n 'rows.exportFailed': '\u590D\u5236\u5230\u526A\u8D34\u677F\u6CA1\u6210\u529F\u3002',\n 'rows.importTitle': '\u5BFC\u5165\u4EFB\u52A1\u7C7B\u578B',\n 'rows.importDesc': '\u628A JSON \u6E05\u5355\u7C98\u8D34\u5230\u8FD9\u91CC\u3002\u5B83\u53EA\u586B\u4E0B\u9762\u90A3\u5F20\u8868\uFF0C\u6309\u300C\u4FDD\u5B58\u300D\u4E4B\u524D\u4E00\u4E2A\u5B57\u90FD\u4E0D\u5199\u3002',\n 'rows.importPlaceholder': '[\\n { \"description\": \"\u2026\u2026\", \"provider\": \"\u2026\u2026\", \"model\": \"\u2026\u2026\", \"effort\": \"\u2026\u2026\" }\\n]',\n 'rows.importApply': '\u586B\u8FDB\u53BB',\n 'rows.importCancel': '\u53D6\u6D88',\n 'rows.importBadJson': '\u8FD9\u4E0D\u662F\u5408\u6CD5\u7684 JSON\u3002',\n 'rows.importBadShape': '\u8FD9\u4E0D\u662F\u4E00\u4EFD\u4EFB\u52A1\u7C7B\u578B\u6E05\u5355\uFF1A\u6BCF\u4E00\u6761\u90FD\u8981\u6709 description\u3001provider\u3001model\u3001effort \u56DB\u4E2A\u6587\u5B57\u5B57\u6BB5\u3002',\n 'rows.importEmpty': '\u8FD9\u4EFD\u6E05\u5355\u91CC\u4E00\u6761\u4EFB\u52A1\u7C7B\u578B\u90FD\u6CA1\u6709\u3002',\n 'preview.title': '\u67E5\u770B\u5B8C\u6574\u9884\u89C8',\n 'preview.desc': '\u771F\u6B63\u4F1A\u53D1\u7ED9\u5224\u65AD\u670D\u52A1\u7684\u90A3\u6BB5\u5185\u5BB9\u3002\u6D3E\u5DE5\u6807\u7B7E\u4E0E\u4EFB\u52A1\u6B63\u6587\u90FD\u5728\u6D3E\u5DE5\u90A3\u4E00\u523B\u624D\u586B\u8FDB\u53BB\u3002',\n 'preview.open': '\u67E5\u770B\u5B8C\u6574\u9884\u89C8',\n 'preview.copy': '\u590D\u5236',\n 'preview.copied': '\u5DF2\u590D\u5236',\n 'preview.close': '\u5173\u95ED',\n 'preview.blocked': '\u5148\u628A\u6539\u52A8\u4FDD\u5B58\u4E0B\u6765\u3002',\n 'preview.failed': '\u9884\u89C8\u8BFB\u4E0D\u51FA\u6765\u3002',\n 'save.button': '\u4FDD\u5B58',\n 'save.saving': '\u6B63\u5728\u4FDD\u5B58\u2026',\n 'save.unsaved': '\u6709\u8FD8\u6CA1\u4FDD\u5B58\u7684\u6539\u52A8\u3002',\n 'save.discard': '\u653E\u5F03\u6539\u52A8',\n 'save.refusedTitle': '\u73B0\u5728\u8FD8\u5B58\u4E0D\u4E86',\n 'save.failed': '\u6CA1\u4FDD\u5B58\u4E0A\uFF1A{error}',\n 'save.duplicateDescription': '\u6709\u4E24\u6761\u7684\u63CF\u8FF0\u4E00\u6A21\u4E00\u6837\u3002\u6539\u6210\u4E0D\u4E00\u6837\u7684\u518D\u4FDD\u5B58\u3002',\n 'save.emptyDescription': '\u6BCF\u4E00\u884C\u90FD\u8981\u6709\u63CF\u8FF0\u624D\u80FD\u4FDD\u5B58\u3002',\n 'save.invalid': '\u73B0\u5728\u8FD8\u5B58\u4E0D\u4E86\u3002',\n 'save.refused': '\u5BBF\u4E3B\u6CA1\u6709\u63A5\u53D7\u8FD9\u6B21\u5199\u5165\u3002',\n 'log.title': '\u5224\u65AD\u65E5\u5FD7',\n 'log.desc': '\u6700\u8FD1 10 \u6761\u5224\u65AD\uFF0C\u65B0\u7684\u5728\u6700\u524D\u9762\uFF1B\u6587\u4EF6\u91CC\u7559\u5F97\u66F4\u591A\u3002\u70B9\u4E00\u884C\u770B\u8FD9\u6B21\u53D1\u7ED9\u5224\u65AD\u6A21\u578B\u7684\u90A3\u6BB5\u5185\u5BB9\u3002',\n 'log.empty': '\u8FD8\u6CA1\u6709\u5224\u65AD\u8FC7\u3002',\n 'log.colResult': '\u7ED3\u679C',\n 'log.colChoice': '\u9009\u62E9',\n 'log.colParent': '\u4E3B\u4EE3\u7406',\n 'log.colChild': '\u5B50\u4EE3\u7406',\n 'log.colTime': '\u65F6\u95F4',\n 'log.colLatency': '\u8017\u65F6',\n 'log.resultJudged': '\u7C7B\u578B {id}',\n 'log.resultInherited': '\u672A\u5224\u6210',\n 'log.promptTitle': '\u53D1\u7ED9\u5224\u65AD\u6A21\u578B\u7684\u5185\u5BB9',\n 'log.promptDesc': '\u8FD9\u6B21\u5224\u65AD\u771F\u6B63\u53D1\u51FA\u53BB\u7684\u8BF7\u6C42\u4F53\u3002',\n 'log.promptClose': '\u5173\u95ED',\n 'log.promptEmpty': '\u8FD9\u6B21\u5224\u65AD\u6CA1\u6709\u53D1\u51FA\u8BF7\u6C42\u3002',\n 'log.refresh': '\u5237\u65B0',\n 'log.loadFailed': '\u65E5\u5FD7\u8BFB\u4E0D\u51FA\u6765\u3002',\n 'ms': '{value} \u6BEB\u79D2',\n};\n\n/**\n * \u628A\u5B57\u5178\u4EA4\u7ED9\u5BBF\u4E3B\u3002\u547D\u540D\u7A7A\u95F4\u4E0E\u952E\u96C6\u5728\u8FD9\u91CC\u58F0\u660E\u7684\u7C7B\u578B\u540C\u65F6\u662F\u5EA7\u4F4D `t` \u7684\u5951\u7EA6\u3002\n * @param ctx - \u5BA2\u6237\u7AEF\u4E0A\u4E0B\u6587\uFF08`locale` \u7531 inject \u58F0\u660E\uFF09\u3002\n */\nexport function apply(ctx: {\n effect(factory: () => () => void, label?: string): unknown;\n locale: { register(ns: string, dictionaries: unknown): () => void };\n}): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-subagent-judge-dispatch: dictionaries');\n}\n\n/** \u672C\u547D\u540D\u7A7A\u95F4\u5168\u90E8\u952E\u7684\u7C7B\u578B\uFF0C\u5EA7\u4F4D\u4E0A\u7684 `t` \u6309\u5B83\u505A\u952E\u68C0\u67E5\u3002 */\nexport type JudgeDispatchLocaleKey = keyof typeof en;\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** \u672C\u63D2\u4EF6\u914D\u7F6E\u5361\u7247\u7684\u6587\u6848\u3002 */\n subagentjudgedispatch: JudgeDispatchLocaleKey;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAoC;AAGpC,sCAWO;;;ACEA,IAAM,cAAc;AAGpB,IAAM,qBAAqB;AAG3B,IAAM,oBAAoB;AAc1B,SAAS,gBACd,OACA,UACY;AACZ,MAAI,CAAC,SAAS,OAAO,MAAM,WAAW,WAAY,QAAO,MAAM;AAAA,EAAC;AAChE,SAAO,MAAM,OAAO,oBAAoB,QAAQ;AAClD;;;AC0CO,SAAS,gBAAgB,KAA8D;AAC5F,SAAO,IAAI,SAAS,KAAK,MAAM,MAAM,IAAI,MAAM,KAAK,MAAM,MAAM,IAAI,OAAO,KAAK,MAAM;AACxF;;;ACxEO,IAAM,oBAAoB;;;ACsH1B,IAAM,uBAAuB;AAC7B,IAAM,sBAAsB;AAG5B,IAAM,qBAAqB;AAG3B,IAAM,2BAA2B;AAyCjC,IAAM,iBAAiB;AACvB,IAAM,qBAAqB;AAC3B,IAAM,mBAAmB;AAGhC,eAAe,SAAS,UAAkC;AACxD,MAAI;AACF,WAAO,MAAM,SAAS,KAAK;AAAA,EAC7B,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,SAAS,uBAA2C;AACzD,SAAO;AAAA,IACL,MAAM,MAAyB;AAC7B,UAAI;AACF,cAAM,WAAW,MAAM,MAAM,cAAc;AAC3C,YAAI,CAAC,SAAS,GAAI,QAAO,CAAC;AAC1B,cAAM,OAAO,MAAM,SAAS,QAAQ;AACpC,eAAO,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