@lynn123411/dsh-subagent-judge-dispatch 0.6.8 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/client/index.ts", "../src/enablement.ts", "../src/client/SessionToggle.tsx", "../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 { SETTINGS_NAMESPACE } from '../enablement.ts';\nimport { MODEL_OPTIONS_SLOT, SessionToggle } from './SessionToggle.tsx';\nimport { injectCardStyles, setupSettingsUi } from './settings/ui.tsx';\nimport { apply as registerDictionaries, NS, en, zh } from './locales.ts';\n\n/**\n * \u6D4F\u89C8\u5668\u534A\u8FB9\uFF1A\u5728\u63D2\u4EF6\u9875\u6302\u914D\u7F6E\u5361\uFF0C\u5728\u6A21\u578B\u83DC\u5355\u6302\u4F1A\u8BDD\u5F00\u5173\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 ctx.effect(injectCardStyles, 'dsh-subagent-judge-dispatch: card styles');\n registerDictionaries(ctx);\n ctx.slots.inject(MODEL_OPTIONS_SLOT, () => ctx.slots.register({\n name: MODEL_OPTIONS_SLOT,\n id: 'subagent-judge-dispatch-enabled',\n locale: NS,\n inject: () => ({ form: ctx.configForms.get<Record<string, unknown>>(SETTINGS_NAMESPACE) }),\n }, SessionToggle));\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} from './settings/store.ts';\n", "/** Shared by the host and the conversation menu. */\nexport const DEFAULT_ENABLED = true;\nexport const SETTINGS_NAMESPACE = 'dsh-subagent-judge-dispatch';\n\nexport type SessionOverrides = Readonly<Record<string, boolean>>;\n\n/** An explicit choice takes precedence over the plugin default. */\nexport function enabledFor(overrides: unknown, fallback: boolean, sessionId?: string): boolean {\n if (sessionId === undefined || overrides === null || typeof overrides !== 'object'\n || !Object.hasOwn(overrides, sessionId)) return fallback;\n const choice = (overrides as SessionOverrides)[sessionId];\n return typeof choice === 'boolean' ? choice : fallback;\n}\n", "import { useEffect, useState } from 'react';\nimport { Switch } from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';\nimport type {} from '@deepseek-ai/dsh-client-ui-model-selection/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-session/client';\nimport type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';\nimport { DEFAULT_ENABLED, enabledFor } from '../enablement.ts';\nimport { NS } from './locales.ts';\n\nexport const MODEL_OPTIONS_SLOT = 'conversation.input.model.options';\n\ntype ToggleProps = PropsRuntime<typeof MODEL_OPTIONS_SLOT>\n & PropsLocale<typeof NS>\n & { form: ConfigForm<Record<string, unknown>> };\n\nexport function SessionToggle(props: ToggleProps) {\n const { sessionId, useSession, useSessions } = props;\n const addressedChild = useSession(snapshot => snapshot.subagent !== null);\n const listedChild = useSessions(state => state.byId[sessionId]?.origin === 'subagent');\n if (addressedChild || listedChild) return null;\n return <RootSessionToggle key={sessionId} {...props} />;\n}\n\nfunction RootSessionToggle({ sessionId, form, locked, reportFailure, t }: ToggleProps) {\n const [snapshot, setSnapshot] = useState(() => form.getSnapshot());\n const [pending, setPending] = useState(false);\n\n useEffect(() => {\n const sync = () => setSnapshot(form.getSnapshot());\n sync();\n return form.subscribe(sync);\n }, [form]);\n\n if (snapshot.status !== 'ready' || snapshot.value === undefined) return null;\n const fallback = typeof snapshot.value.enabled === 'boolean' ? snapshot.value.enabled : DEFAULT_ENABLED;\n const enabled = enabledFor(snapshot.value.sessionOverrides, fallback, sessionId);\n\n async function select(next: boolean) {\n setPending(true);\n try {\n const path = ['sessionOverrides', sessionId];\n // Clearing a user value exposes the composition layer's value for this session.\n const base = snapshot.base as { sessionOverrides?: unknown } | null | undefined;\n const afterUnset = enabledFor(base?.sessionOverrides, fallback, sessionId);\n // The form queue supplies the revision when this path edit is sent.\n const accepted = await form.mutate([next === fallback && next === afterUnset\n ? { op: 'unset', path }\n : { op: 'set', path, value: next }]);\n if (!accepted) reportFailure(t('sessionToggle.failed'));\n } catch {\n reportFailure(t('sessionToggle.failed'));\n } finally {\n setSnapshot(form.getSnapshot());\n setPending(false);\n }\n }\n\n return (\n <div className=\"dsh-judge-session-toggle\">\n <span>{t('sessionToggle.label')}</span>\n <Switch\n className=\"dsh-judge-session-switch\"\n checked={enabled}\n disabled={locked || pending || !snapshot.writable}\n label={t('sessionToggle.label')}\n onChange={select}\n />\n </div>\n );\n}\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 exportJudgeJson,\n exportRowsJson,\n JUDGE_API_KEY_REF,\n parseJudgeJson,\n parseRowsJson,\n rowHints,\n type CredentialsRemoteLike,\n routeKey,\n SETTINGS_NAMESPACE,\n splitRouteKey,\n type LogRow,\n type PageState,\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\u4E24\u8282\u7684\u4E09\u79CD\u574F\u8F93\u5165\u5404\u8BF4\u5404\u7684\uFF0C\u4E0D\u5728\u8C03\u7528\u5904\u62FC\u952E\u540D\u3002 */\nconst IMPORT_ERROR_KEYS = {\n rows: {\n json: 'rows.importBadJson',\n shape: 'rows.importBadShape',\n empty: 'rows.importEmpty',\n },\n judge: {\n json: 'judge.importBadJson',\n shape: 'judge.importBadShape',\n empty: 'judge.importEmpty',\n },\n} as const;\n\n/** \u5BFC\u5165\u5F39\u7A97\u670D\u52A1\u7684\u4E24\u8282\uFF1A\u5224\u65AD\u670D\u52A1\u8BBE\u7F6E\uFF0C\u4E0E\u4EFB\u52A1\u7C7B\u578B\u6E05\u5355\u3002 */\ntype ImportSection = 'judge' | 'rows';\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-session-toggle {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n min-height: 34px;\n padding: 0 8px;\n border-radius: var(--dsw-radius-md);\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-xs-13);\n}\n.dsh-judge-session-toggle .dsh-judge-session-switch { position: static; }\n.dsh-judge-session-switch::after { content: ''; position: absolute; inset: 0; border-radius: var(--dsw-radius-md); }\n.dsh-judge-session-toggle:has(.dsh-judge-session-switch:focus-visible) { background: var(--dsw-alias-interactive-bg-hover); }\n@media (hover: hover) {\n .dsh-judge-session-toggle:has(.dsh-judge-session-switch:not(:disabled)):hover { background: var(--dsw-alias-interactive-bg-hover); }\n}\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-description {\n field-sizing: content;\n display: block;\n min-height: 32px;\n max-height: 40vh;\n resize: vertical;\n padding: 6px 10px;\n border: 0.5px solid var(--dsw-alias-border-l3);\n border-radius: var(--dsw-radius-md);\n background: var(--dsw-alias-bg-layer-1);\n color: inherit;\n font: inherit;\n line-height: 1.4;\n}\n.dsh-judge-description:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }\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); }\n/* \u6807\u9898\u884C\u53F3\u7AEF\u7684\u4E00\u7EC4\u52A8\u4F5C\uFF1A\u8BD5\u901A\u3001\u5BFC\u5165\u3001\u5BFC\u51FA\u3001\u52A0\u4E00\u884C\u90FD\u6392\u5728\u8FD9\u91CC\u3002 */\n.dsh-judge-actions-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n/* \u4EFB\u52A1\u7C7B\u578B\u90A3\u4E00\u8282\u9876\u90E8\u7684\u4E00\u884C\uFF1A\u4F9D\u8D56\u54EA\u4EFD\u5B98\u65B9\u914D\u7F6E\uFF0C\u4EE5\u53CA\u53BB\u90A3\u91CC\u7684\u5165\u53E3\u3002 */\n/* \u5165\u53E3\u6309\u94FE\u63A5\u7684\u6837\u5B50\u8D70\uFF1A\u6CA1\u6709\u6309\u94AE\u7684\u76D2\u5B50\u548C\u5E95\u8272\uFF0C\u53EA\u5728\u60AC\u505C\u65F6\u52A0\u4E0B\u5212\u7EBF\u3002 */\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\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-drag { width: 36px; }\n.dsh-judge-drag { border: 0; padding: 4px; background: transparent; cursor: grab; color: var(--dsw-alias-label-tertiary); font: inherit; }\n.dsh-judge-drag:active { cursor: grabbing; }\n.dsh-judge-col-model { width: 188px; }\n.dsh-judge-col-effort { width: 124px; }\n.dsh-judge-col-actions { width: 130px; }\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/* Allow the model column to shrink so long names can be clipped. */\n.dsh-judge-log-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 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' || 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 return () => element.remove();\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 sections \u2014 the judgement service, and the\n * task-type table \u2014 and neither has a save button: a text field writes when\n * focus leaves it, a switch and a row action write the moment they are used, and\n * a failed write is reported at the bottom of the section that attempted it. The\n * log tab reads the Host's runtime log.\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 dragIndex = React.useRef<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 /** Which section's paste box is open; null when it is closed. */\n const [importSection, setImportSection] = useState<ImportSection | null>(null);\n /** What is pasted into that box. */\n const [importText, setImportText] = useState('');\n /** Why the last import attempt was refused, or ''. */\n const [importError, setImportError] = useState('');\n /** What the last export did, shown in the section that did it. */\n const [copyNote, setCopyNote] = useState<{ ok: boolean; text: string; section: ImportSection } | null>(null);\n const [logCopyResult, setLogCopyResult] = useState<boolean | null>(null);\n\n useEffect(() => {\n setState(dispatchCardStore.getState());\n const unsubscribe = dispatchCardStore.subscribe(() => setState(dispatchCardStore.getState()));\n return () => {\n unsubscribe();\n // \u79BB\u5F00\u63D2\u4EF6\u9875\u65F6\u540C\u6837\u5148\u5199\uFF1A\u5361\u7247\u5378\u8F7D\u4E4B\u540E\u6CA1\u6709\u4EBA\u518D\u66FF\u8FD9\u51E0\u683C\u63D0\u4EA4\u3002\n void dispatchCardStore.flush();\n };\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 const openPreview = async (): Promise<void> => {\n // \u9884\u89C8\u8BFB\u7684\u662F\u5DF2\u843D\u5730\u7684\u914D\u7F6E\uFF1A\u5148\u628A\u8FD8\u6CA1\u5931\u7126\u7684\u8349\u7A3F\u5199\u4E0B\u53BB\uFF0C\u5426\u5219\u770B\u5230\u7684\u662F\u4E0A\u4E00\u7248\u3002\n await dispatchCardStore.flush();\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'), section: 'rows' });\n };\n\n /** Copy the judgement service settings out as plain JSON. */\n const exportJudge = async (): Promise<void> => {\n const copied = await writeClipboard(exportJudgeJson(state));\n setCopyNote({ ok: copied, text: t(copied ? 'judge.exported' : 'judge.exportFailed'), section: 'judge' });\n };\n\n /** Open one section's paste box, empty and with no leftover complaint. */\n const openImport = (section: ImportSection): void => {\n setImportSection(section);\n setImportText('');\n setImportError('');\n setCopyNote(null);\n };\n\n /** Close the paste box without touching what is stored. */\n const closeImport = (): void => {\n setImportSection(null);\n setImportText('');\n setImportError('');\n };\n\n /** Read the pasted text into the page and write it; the dialog's button is the confirmation. */\n const applyImport = (): void => {\n if (importSection === 'judge') {\n const result = parseJudgeJson(importText);\n if (!result.ok) {\n setImportError(t(IMPORT_ERROR_KEYS.judge[result.error] as never));\n return;\n }\n dispatchCardStore.replaceJudgeConfig(result.value);\n } else {\n const result = parseRowsJson(importText);\n if (!result.ok) {\n setImportError(t(IMPORT_ERROR_KEYS.rows[result.error] as never));\n return;\n }\n dispatchCardStore.replaceRows(result.rows);\n }\n closeImport();\n };\n\n /** \u8FD9\u4E00\u8282\u7684\u4E00\u6B21\u63D0\u4EA4\uFF1A\u6587\u5B57\u683C\u79BB\u5F00\u8F93\u5165\u6846\u3001\u83DC\u5355\u9009\u5B8C\u65F6\u90FD\u8D70\u5B83\u3002 */\n const commitJudge = (): void => void dispatchCardStore.commit('judge');\n const commitRows = (): void => void dispatchCardStore.commit('rows');\n\n /** \u8FD9\u4E00\u8282\u6700\u540E\u4E00\u6B21\u5199\u5165\u6CA1\u843D\u5730\u65F6\uFF0C\u5C31\u5730\u8BF4\u660E\uFF1B\u4E24\u8282\u5404\u62A5\u5404\u7684\u3002 */\n const failure = (section: 'judge' | 'rows'): React.ReactElement | null => (\n state.writeFailed === section && state.writeError !== ''\n ? (\n <div className=\"dsh-judge-note-bad\" role=\"alert\">\n {t('write.failed').replace('{error}', state.writeError)}\n </div>\n )\n : null\n );\n\n /** One editable task-type row. */\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 && draft.enabled ? undefined : 'dsh-judge-row-off'}\n onDragOver={(event) => { if (dragIndex.current !== null) event.preventDefault(); }}\n onDrop={(event) => {\n event.preventDefault();\n if (dragIndex.current !== null) dispatchCardStore.moveRow(dragIndex.current, index);\n dragIndex.current = null;\n setOpenMenu(null);\n }}\n >\n <td className=\"dsh-judge-col-drag\">\n <button type=\"button\" className=\"dsh-judge-drag\" draggable={state.writable} disabled={!state.writable} aria-label={`${t('rows.drag')}: ${draft.description}`}\n onDragStart={(event) => { dragIndex.current = index; event.dataTransfer.effectAllowed = 'move'; event.dataTransfer.setData('text/plain', String(index)); }}\n onDragEnd={() => { dragIndex.current = null; }}\n onKeyDown={(event) => {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n dispatchCardStore.moveRow(index, index + (event.key === 'ArrowUp' ? -1 : 1));\n }\n }}\n >\u283F</button>\n </td>\n <td>\n {rowHints(state.rows, index, t).map((hint) => (\n <span key={hint} className=\"dsh-judge-off\">{hint}</span>\n ))}\n <textarea\n className=\"dsh-judge-field dsh-judge-description\"\n rows={2}\n readOnly={!state.writable}\n value={draft.description}\n placeholder={t('rows.descriptionPlaceholder')}\n aria-label={`${t('rows.colDescription')} ${index + 1}`}\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) =>\n dispatchCardStore.cell(index, 'description', event.target.value)}\n onBlur={commitRows}\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}\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.model}`,\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 commitRows();\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 commitRows();\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 onBlur={commitRows}\n />\n )}\n </td>\n <td className=\"dsh-judge-col-actions\">\n <div className=\"dsh-judge-cell-actions\">\n <Switch checked={draft.enabled} onChange={(next: boolean) => dispatchCardStore.toggleRow(index, next)}\n label={`${t('rows.enabled')}: ${draft.description}`} disabled={!state.writable} />\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 {/* \u4E09\u4EF6\u90FD\u662F\u8FD9\u4E00\u8282\u7684\u52A8\u4F5C\uFF1A\u5BFC\u5165\u4E0E\u5BFC\u51FA\u662F\u540C\u4E00\u4EFD\u8BBE\u7F6E\u7684\u4E24\u4E2A\u65B9\u5411\uFF0C\u8BD5\u901A\u95EE\u7684\u662F\n \u300C\u8FD9\u4EFD\u8BBE\u7F6E\u73B0\u5728\u80FD\u4E0D\u80FD\u7528\u300D\u3002\u8BD5\u901A\u4E0D\u843D\u76D8\u3001\u53EA\u8BFB\u5DF2\u843D\u5730\u7684\u503C\uFF0C\u6240\u4EE5\u5199\u5165\u8FD8\u5728\n \u8DEF\u4E0A\u65F6\u5148\u4E0D\u7ED9\u6309\u3002 */}\n <div className=\"dsh-judge-actions-group\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => openImport('judge')}>\n {t('judge.importOpen')}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void exportJudge()}>\n {t('judge.export')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={probing || state.writing !== ''}\n onClick={() => void runProbe()}\n >\n {probing ? t('judge.probing') : t('judge.probe')}\n </Button>\n </div>\n </div>\n <div className=\"dsh-judge-desc\">{t('judge.desc')}</div>\n\n {/* \u5F00\u5173\u62E8\u4E86\u5C31\u662F\u4E00\u6B21\u5B8C\u6574\u7684\u51B3\u5B9A\uFF0C\u6240\u4EE5\u5B83\u5F53\u573A\u5199\u5165\uFF1B\u4E0B\u9762\u51E0\u683C\u662F\u6587\u5B57\uFF0C\u79BB\u5F00\u8F93\u5165\u6846\u624D\u5199\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}\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}\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\"\n aria-label={t('judge.endpoint')}\n disabled={!state.writable}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.field('endpointUrl', event.target.value)}\n onBlur={commitJudge}\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 disabled={!state.writable}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.field('judgeModel', event.target.value)}\n onBlur={commitJudge}\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\u51E0\u683C\u540C\u5BBD\uFF1A\u72B6\u6001\u653E\u5728\u8F93\u5165\u6846\u4E0B\u9762\u90A3\u4E00\u884C\uFF0C\u5DE6\u53F3\u8FB9\u7F18\u624D\u5BF9\u5F97\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 || !state.writable}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.key(event.target.value)}\n onBlur={commitJudge}\n onKeyDown={(event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter') return;\n event.preventDefault();\n commitJudge();\n }}\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.unavailable && <span className=\"dsh-judge-hint\">{t('judge.keyUnavailable')}</span>}\n {state.key.failed && (\n <span className=\"dsh-judge-note-bad\" role=\"alert\">\n {t('judge.keyFailed').replace('{error}', state.key.error || t('write.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 {copyNote !== null && copyNote.section === 'judge' && (\n <div className={copyNote.ok ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'} role=\"status\">\n {copyNote.text}\n </div>\n )}\n {failure('judge')}\n </div>\n\n <div className=\"dsh-judge-section\">\n <div className=\"dsh-judge-head\">\n <span className=\"dsh-judge-title\">{t('rows.title')}</span>\n {/* \u4E09\u4EF6\u90FD\u662F\u6574\u5F20\u8868\u7684\u52A8\u4F5C\uFF1A\u5BFC\u5165\u4E0E\u5BFC\u51FA\u662F\u540C\u4E00\u4EFD\u6E05\u5355\u7684\u4E24\u4E2A\u65B9\u5411\uFF0C\u52A0\u4E00\u884C\u662F\u5F80\u8868\u5C3E\u7EED\u4E00\u6761\u3002 */}\n <div className=\"dsh-judge-actions-group\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => openImport('rows')}>\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 </div>\n </div>\n <div className=\"dsh-judge-desc\">{t('rows.dependsOn')}</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-drag\" />\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 {copyNote !== null && copyNote.section === 'rows' && (\n <div className={copyNote.ok ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'} role=\"status\">\n {copyNote.text}\n </div>\n )}\n {failure('rows')}\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 <Button variant=\"outline\" size=\"sm\" onClick={() => void openPreview()}>\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 <div className=\"dsh-judge-actions-group\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => void writeClipboard(t('log.analysisPrompt')).then(setLogCopyResult)}>\n {t('log.copyAnalysis')}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void dispatchCardStore.refreshLog()}>\n {t('log.refresh')}\n </Button>\n </div>\n </div>\n {logCopyResult !== null && (\n <div className={logCopyResult ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'} role=\"status\">\n {t(logCopyResult ? 'log.analysisCopied' : 'log.analysisCopyFailed')}\n </div>\n )}\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.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 <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={(next) => {\n // \u5207\u8D70\u4E4B\u524D\u5148\u628A\u8FD8\u6CA1\u5931\u7126\u7684\u90A3\u4E00\u683C\u5199\u4E0B\u53BB\uFF1A\u81EA\u52A8\u4FDD\u5B58\u4E0D\u7559\u300C\u660E\u660E\u586B\u4E86\u5374\u6CA1\u5B58\u300D\u7684\u6B7B\u89D2\u3002\n void dispatchCardStore.flush();\n setTab(next);\n }}\n label={t('tab.design')}\n />\n {tab === 'design' ? design : log}\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={importSection !== null}\n onClose={closeImport}\n title={t(importSection === 'judge' ? 'judge.importTitle' : 'rows.importTitle')}\n closeLabel={t(importSection === 'judge' ? 'judge.importClose' : 'rows.importClose')}\n description={t(importSection === 'judge' ? 'judge.importDesc' : 'rows.importDesc')}\n className=\"dsh-judge-modal\"\n footer={(\n <>\n <Button variant=\"outline\" size=\"sm\" onClick={closeImport}>\n {t(importSection === 'judge' ? 'judge.importCancel' : 'rows.importCancel')}\n </Button>\n <Button variant=\"primary\" size=\"sm\" onClick={applyImport}>\n {t(importSection === 'judge' ? 'judge.importApply' : 'rows.importApply')}\n </Button>\n </>\n )}\n >\n <textarea\n className=\"dsh-judge-paste\"\n value={importText}\n aria-label={t(importSection === 'judge' ? 'judge.importTitle' : 'rows.importTitle')}\n placeholder={t(importSection === 'judge' ? 'judge.importPlaceholder' : '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={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.metrics === undefined\n ? <div className=\"dsh-judge-desc\">{t('log.promptEmpty')}</div>\n : <div className=\"dsh-judge-prompt\">\n <CodeBlock\n code={JSON.stringify(detail.metrics, null, 2)}\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 * 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. */\nconst 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 list rules live here as well, because the criteria map IS the list: which\n * rows are offered ({@link selectableRows}) and what number each carries\n * ({@link numberTypeRows}).\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. */\nconst 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. */\nconst 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 */\nconst PROBE_INSTRUCTIONS =\n 'Answer with the number of the one option listed below.';\n\n/** The single criterion the connectivity check offers. */\nconst 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 * Whether one row is switched on.\n *\n * A row that is switched off stays in the list \u2014 the reader keeps it there to\n * turn it back on later \u2014 but takes no part in a judgement and carries no\n * number. A missing value counts as switched on, so a row written before the\n * switch existed keeps working.\n *\n * The parameter is narrowed to the one field the rule reads, so a stored row, a\n * numbered row and the page's draft row all satisfy it.\n *\n * @param row - one row, stored or drafted.\n * @returns whether the row takes part in judgements.\n */\nexport function isRowEnabled(row: { enabled?: boolean }): boolean {\n return row.enabled !== false;\n}\n\n/** The fields a row must carry to be judged: the switch, and the route it runs on. */\ntype RowOffering = { enabled?: boolean } & Pick<TypeRow, 'provider' | 'model' | 'effort'>;\n\n/**\n * Whether one row is offered to the judge: switched on, and its route filled in.\n *\n * The two conditions are one rule because the judge's list is exactly the rows\n * that pass both \u2014 a row switched off is one the reader does not want judged,\n * and a half-filled row could be chosen and then have nothing to write.\n *\n * @param row - one row, stored, numbered or drafted.\n * @returns whether the judge may choose it.\n */\nexport function isOfferedRow(row: RowOffering): boolean {\n return isRowEnabled(row) && isSelectableRow(row);\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(isOfferedRow);\n}\n\n/**\n * Number the rows the judge is offered, in list order.\n *\n * The number is positional and never stored: switching a row off, filling one\n * in, or moving it renumbers the rest. A row that is not offered carries 0 \u2014 it\n * has no number to be answered with \u2014 so the criteria map is numbered 1..n with\n * no gaps, and the preview, the request and the answer all read the same list.\n *\n * @param rows - the rows as the page holds them, in page order.\n * @returns the rows with their numbers applied, in the same order.\n */\nexport function numberTypeRows<T extends RowOffering>(\n rows: readonly T[],\n): (T & { id: number })[] {\n let next = 0;\n return rows.map((row) => {\n if (!isOfferedRow(row)) return { ...row, id: 0 };\n next += 1;\n return { ...row, id: next };\n });\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. */\nconst 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}\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}\n", "/**\n * The configuration card's own state: what the Host serves, what the reader has\n * staged, and what a commit would write.\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 * - A control commits on its own terms: a text field when focus leaves it, a\n * switch or a row action the moment it is used. There is no save button, so a\n * half-typed endpoint reaches a delegation only if the reader leaves the field\n * \u2014 the same moment they would have pressed save.\n * - A commit that did not land is reported in the section that attempted it, and\n * the drafts stay for the next attempt. The shared configuration form answers\n * `false` for a refusal, which is not a rejection: treating it as success would\n * 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 { DEFAULT_ENABLED } from '../../enablement.ts';\nimport { isSelectableRow } from '../../server/judge-prompt.ts';\nimport type { LogEntry as LogRow } from '../../server/types.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 enabled: boolean;\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 type { LogEntry as LogRow } from '../../server/types.ts';\n\n/** Which of the two sections a commit 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 /**\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 writing: boolean;\n failed: boolean;\n /** The credentials service's own message for a refused write, or ''. */\n error: string;\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 /** Which section a commit is crossing the wire for, or '' when none is. */\n writing: Section | '';\n /** Which section's last commit did not land, or '' when none failed. */\n writeFailed: Section | '';\n /** The Host's own message for the last refused write, or ''. */\n writeError: 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\nexport { SETTINGS_NAMESPACE } from '../../enablement.ts';\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 };\n subscribe(listener: () => void): () => void;\n mutate(ops: readonly SettingsPathOpLike[]): 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 enabled: record.enabled !== false,\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/** The three sentences a row can be flagged with. */\nexport type RowHintKey = 'rows.incomplete' | 'rows.hintNoDescription' | 'rows.hintDuplicateDescription';\n\n/** The page's translator, narrowed to the sentences a row hint can be. */\nexport type RowHintKeyTranslator = (key: RowHintKey) => string;\n\n/**\n * Everything wrong with one row, as sentences to show under its number.\n *\n * Three faults, one place. A row whose model route is incomplete is not offered\n * to the judge at all; a row with a blank or repeated description is offered\n * with a criterion the judge cannot tell apart from another. None of them blocks\n * a write \u2014 the reader may be halfway through typing \u2014 so they are reported\n * beside the row while the list is written as it stands.\n *\n * @param rows - every row on the page, in page order.\n * @param index - which row to describe.\n * @param t - the page's translator, so each sentence is localized.\n * @returns the sentences, empty when the row has nothing wrong.\n */\nexport function rowHints(rows: readonly TypeRowDraft[], index: number, t: RowHintKeyTranslator): string[] {\n const row = rows[index];\n if (row === undefined) return [];\n const hints: string[] = [];\n if (!isSelectableRow(row)) hints.push(t('rows.incomplete'));\n const description = row.description.trim();\n if (description === '') {\n hints.push(t('rows.hintNoDescription'));\n } else if (rows.some((other, at) => at !== index && other.description.trim() === description)) {\n hints.push(t('rows.hintDuplicateDescription'));\n }\n return hints;\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 enabled: row.enabled,\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 || (record.enabled !== undefined && typeof record.enabled !== 'boolean')) 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 enabled: record.enabled !== false,\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/** The judgement service's connection settings, as the page exports and imports them. */\nexport interface JudgeConfigDraft {\n endpointUrl: string;\n judgeModel: string;\n}\n\n/**\n * The judgement service's connection settings as plain JSON text, for copying out.\n *\n * The key is not part of it: it is write-only, and a copied document that\n * carried a secret would be a secret in a clipboard.\n *\n * @param state - the three settings as the page holds them.\n * @returns indented JSON text.\n */\nexport function exportJudgeJson(\n state: Pick<PageState, 'endpointUrl' | 'judgeModel'>,\n): string {\n return JSON.stringify(\n {\n endpointUrl: state.endpointUrl,\n judgeModel: state.judgeModel,\n },\n null,\n 2,\n );\n}\n\n/** What reading pasted judgement-service JSON produced. */\nexport type JudgeImport =\n | { ok: true; value: JudgeConfigDraft }\n /** `error` names the fault; the page turns it into its own sentence. */\n | { ok: false; error: 'json' | 'shape' | 'empty' };\n\n/**\n * Read pasted judgement-service settings.\n *\n * The text is checked before it can reach the page: it must be one JSON object\n * and the two fields must be strings. An unknown field is ignored rather than\n * refused, so a document copied from a newer version still loads what it\n * understands.\n *\n * @param text - what the reader pasted.\n * @returns the settings, or the fault that stopped it.\n */\nexport function parseJudgeJson(text: string): JudgeImport {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n return { ok: false, error: 'json' };\n }\n if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {\n return { ok: false, error: 'shape' };\n }\n const record = parsed as Record<string, unknown>;\n const wrongType = ['endpointUrl', 'judgeModel']\n .some((key) => record[key] !== undefined && typeof record[key] !== 'string');\n if (wrongType) return { ok: false, error: 'shape' };\n const value: JudgeConfigDraft = {\n endpointUrl: typeof record.endpointUrl === 'string' ? record.endpointUrl : '',\n judgeModel: typeof record.judgeModel === 'string' ? record.judgeModel : '',\n };\n if (value.endpointUrl.trim() === '' && value.judgeModel.trim() === '') {\n return { ok: false, error: 'empty' };\n }\n return { ok: true, value };\n}\n\n/** A key nothing is staged for and nothing is known about. */\nfunction emptyKey(): KeyState {\n return {\n text: '', configured: false, unavailable: false,\n writing: false, failed: false, error: '',\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 commits on its own terms, so a\n * half-typed endpoint can never reach a delegation: a field writes when focus\n * leaves it, which is the moment the reader has finished with it. Commits are\n * serialized through one queue, so two controls left in quick succession cannot\n * race the Host's revision fence.\n */\nexport class DispatchCardStore {\n private state: PageState = {\n available: false,\n writable: false,\n enabled: DEFAULT_ENABLED,\n logEnabled: true,\n endpointUrl: '',\n judgeModel: '',\n rows: [],\n models: [],\n catalogRead: false,\n committed: {\n enabled: DEFAULT_ENABLED,\n logEnabled: true,\n endpointUrl: '',\n judgeModel: '',\n rows: [],\n },\n writing: '',\n writeFailed: '',\n writeError: '',\n key: emptyKey(),\n log: [],\n logLoaded: false,\n logFailed: false,\n };\n\n private listeners = new Set<() => void>();\n /** One commit at a time: a queued write reads the drafts as they stand when it runs. */\n private queue: Promise<void> = Promise.resolve();\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: { ...this.state.key, configured: info?.configured === true },\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 : DEFAULT_ENABLED,\n logEnabled: typeof value.logEnabled === 'boolean' ? value.logEnabled : true,\n endpointUrl: typeof value.endpointUrl === 'string' ? value.endpointUrl : '',\n judgeModel: typeof value.judgeModel === 'string' ? value.judgeModel : '',\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.notify();\n }\n\n /**\n * Stage one edit.\n *\n * A failure stays on screen until a write lands: the value it complains about\n * has not reached the document yet, so clearing it on the first keystroke would\n * say \"fixed\" while the drafts are still only on this page.\n *\n * @param patch - the state fields this edit changes.\n */\n private stage(patch: Partial<PageState>): void {\n this.state = { ...this.state, ...patch };\n this.notify();\n }\n\n /** Stage one top-level field; its control commits when focus leaves it. */\n field(key: 'endpointUrl' | 'judgeModel', value: string): void {\n this.stage(key === 'endpointUrl' ? { endpointUrl: value } : { judgeModel: value });\n }\n\n /** Flip one switch and write it: a switch is one complete decision. */\n toggle(key: 'enabled' | 'logEnabled', value: boolean): void {\n this.stage(key === 'enabled' ? { enabled: value } : { logEnabled: value });\n void this.commit('judge');\n }\n\n /** Stage the judgement key; its control commits when focus leaves it or on Enter. */\n key(text: string): void {\n this.stage({ key: { ...this.state.key, text, failed: false, error: '' } });\n }\n\n /** Stage one cell of one row; a text cell commits on blur, a menu choice at once. */\n cell(index: number, key: Exclude<keyof TypeRowDraft, 'enabled'>, 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 write can\n // never carry an effort the selected route cannot run.\n this.stage({ rows: key === 'model' ? this.reconcileEffort(rows, index) : rows });\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 and write it: a new row is a decision like any other. */\n addRow(): void {\n this.stage({ rows: [...this.state.rows, { description: '', provider: '', model: '', effort: '', enabled: true }] });\n void this.commit('rows');\n }\n\n /**\n * Replace the list with an imported one and write it.\n *\n * The import dialog's own button is the confirmation, so the list it produces\n * is written at once rather than left as a draft the reader has to commit a\n * second time.\n *\n * @param rows - the rows read from the pasted JSON.\n */\n replaceRows(rows: readonly TypeRowDraft[]): void {\n this.stage({ rows: rows.map(readRow) });\n void this.commit('rows');\n }\n\n /**\n * Replace the judgement service's connection settings with an imported set and\n * write them.\n *\n * The import dialog's own button is the confirmation, so the settings it\n * produces are written at once rather than left as a draft.\n *\n * @param draft - the settings read from the pasted JSON.\n */\n replaceJudgeConfig(draft: JudgeConfigDraft): void {\n this.stage({\n endpointUrl: draft.endpointUrl,\n judgeModel: draft.judgeModel,\n });\n void this.commit('judge');\n }\n\n toggleRow(index: number, enabled: boolean): void {\n this.stage({ rows: this.state.rows.map((row, at) => at === index ? { ...row, enabled } : row) });\n void this.commit('rows');\n }\n\n moveRow(from: number, to: number): void {\n if (from === to || from < 0 || to < 0 || from >= this.state.rows.length || to >= this.state.rows.length) return;\n const rows = [...this.state.rows];\n const [moved] = rows.splice(from, 1);\n rows.splice(to, 0, moved);\n this.stage({ rows });\n void this.commit('rows');\n }\n\n /** Delete one row and write the rest; the remaining rows renumber themselves. */\n removeRow(index: number): void {\n this.stage({ rows: this.state.rows.filter((_row, at) => at !== index) });\n void this.commit('rows');\n }\n\n /**\n * Write one section's staged edits as one batch.\n *\n * The card queues commits so each one reads the latest drafts and committed\n * values after the previous commit settles. The shared form orders these\n * writes with the session menu's writes and supplies their revision fences.\n *\n * The judgement section also writes a typed key, so leaving the key field and\n * leaving the endpoint field are one kind of gesture. The type rows are written\n * whole rather than diffed: the array is one value, and a positional number is\n * derived from it, so a partial write could momentarily renumber the list under\n * a reader mid-write.\n *\n * @param section - which section's drafts to write.\n * @returns settlement after the write, whether it landed or not.\n */\n commit(section: Section): Promise<void> {\n this.queue = this.queue.then(() => this.write(section)).catch(() => {});\n return this.queue;\n }\n\n /** Write whatever both sections still hold; used when the page is left. */\n flush(): Promise<void> {\n return this.commit('judge').then(() => this.commit('rows'));\n }\n\n /**\n * The write itself, run from the queue.\n * @param section - which section's drafts to write.\n */\n private async write(section: Section): Promise<void> {\n const form = this.form;\n if (form === null || !this.state.writable) 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 const typedKey = section === 'judge' ? this.state.key.text.trim() : '';\n if (ops.length === 0 && typedKey === '') {\n // Nothing is left to write: the drafts match the document again, so a\n // failure about this section is no longer the current fact.\n if (this.state.writeFailed === section) {\n this.state = { ...this.state, writeFailed: '', writeError: '' };\n this.notify();\n }\n return;\n }\n\n this.state = { ...this.state, writing: section, writeFailed: '', writeError: '' };\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 let failure = '';\n let keyFailed = false;\n if (typedKey !== '') {\n const result = await this.writeKey(typedKey);\n if (!result.ok) {\n failure = result.error;\n keyFailed = true;\n }\n }\n if (failure === '' && ops.length > 0) {\n try {\n const landed = await form.mutate(ops);\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('write.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('write.invalid');\n }\n }\n // A key failure is already on the key row; repeating it at the section's foot\n // would say the same sentence twice.\n this.state = {\n ...this.state,\n writing: '',\n writeFailed: failure === '' || keyFailed ? '' : section,\n writeError: keyFailed ? '' : failure,\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, writing: 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.writeFailed');\n this.state = { ...this.state, key: { ...this.state.key, writing: false, failed: true, error } };\n return { ok: false, error };\n }\n this.state = {\n ...this.state,\n key: { ...this.state.key, writing: false, failed: false, error: '', text: '', configured: true },\n };\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.writeFailed');\n this.state = { ...this.state, key: { ...this.state.key, writing: false, failed: true, error: message } };\n return { ok: false, error: message };\n }\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();", "// \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': 'Enable judge dispatch by default',\n 'switch.rewrite.desc': 'Applies to conversations without their own choice in the model menu.',\n 'sessionToggle.label': 'Subagent judge dispatch',\n 'sessionToggle.failed': 'Could not save judge dispatch for this conversation.',\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 judge model's base URL. /v1/systemone or /systemone is appended automatically.\",\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.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.writeFailed': 'The key was not accepted.',\n 'judge.importOpen': 'Import',\n 'judge.export': 'Export',\n 'judge.exported': 'Copied the judgement service settings as JSON.',\n 'judge.exportFailed': 'Could not copy to the clipboard.',\n 'judge.importTitle': 'Import the judgement service settings',\n 'judge.importDesc': 'Paste the JSON here. It replaces the address and the model, and is written at once.',\n 'judge.importPlaceholder': '{\\n \"endpointUrl\": \"...\",\\n \"judgeModel\": \"...\"\\n}',\n 'judge.importApply': 'Replace and write',\n 'judge.importCancel': 'Cancel',\n 'judge.importClose': 'Close',\n 'judge.importBadJson': 'This is not valid JSON.',\n 'judge.importBadShape': 'This is not a judgement service setting: endpointUrl and judgeModel must be text.',\n 'judge.importEmpty': 'This setting names neither an address nor a model.',\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.unavailable-route': 'the selected model or effort is unavailable',\n 'reason.other': 'other',\n 'reason.unknown': 'unknown reason',\n 'rows.title': 'Task types',\n 'rows.empty': 'No task type yet. Add one below.',\n 'rows.drag': 'Drag to reorder',\n 'rows.enabled': 'Enable task type',\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.hintNoDescription': 'No description',\n 'rows.hintDuplicateDescription': 'Description repeats another row',\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.dependsOn': 'Under Plugins \u2192 Official \u2192 Subagent, enable model selection and add allowed models. If it is off, the child keeps its original model.',\n 'rows.allowedEmpty':\n 'The official setting offers no model yet; fill it in and the options appear here.',\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 replaces the table below and is written at once.',\n 'rows.importPlaceholder': '[\\n { \"description\": \"...\", \"provider\": \"...\", \"model\": \"...\", \"effort\": \"...\" }\\n]',\n 'rows.importApply': 'Replace and write',\n 'rows.importCancel': 'Cancel',\n 'rows.importClose': 'Close',\n 'rows.importBadJson': 'This is not valid JSON.',\n 'rows.importBadShape': 'Task type fields must be text, and enabled must be true or false.',\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.failed': 'The preview could not be read.',\n 'write.failed': 'The write did not land: {error}',\n 'write.invalid': 'This could not be written.',\n 'write.refused': 'The host did not accept this write.',\n 'log.title': 'Judgement log',\n 'log.desc': 'The 10 most recent judgements. Open an entry to see its request metrics.',\n 'log.empty': 'No judgement has run yet.',\n 'log.colResult': 'Result',\n 'log.colChoice': 'Choice',\n 'log.colTime': 'Time',\n 'log.colLatency': 'Took',\n 'log.resultJudged': 'Type {id}',\n 'log.resultInherited': 'No match',\n 'log.promptTitle': 'Judgement request metrics',\n 'log.promptDesc': 'Judge model, number of offered choices, and input length.',\n 'log.promptClose': 'Close',\n 'log.promptEmpty': 'No judge request was attempted.',\n 'log.copyAnalysis': 'Analyze judgement results',\n 'log.analysisPrompt': 'Analyze the latest 100 records in dsh-subagent-judge-dispatch/judgements.json under DSH_HOME (default ~/.dsh). Summarize results by type, fallback reasons, and latency. Type numbering can change when the list is edited. Do not infer whether individual tasks were classified correctly from metrics alone.',\n 'log.analysisCopied': 'Analysis prompt copied.',\n 'log.analysisCopyFailed': 'Could not copy to the clipboard.',\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': '\u9ED8\u8BA4\u5F00\u542F\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E',\n 'switch.rewrite.desc': '\u4F1A\u8BDD\u5728\u6A21\u578B\u83DC\u5355\u4E2D\u6CA1\u6709\u5355\u72EC\u8BBE\u7F6E\u65F6\uFF0C\u4F7F\u7528\u6B64\u9ED8\u8BA4\u503C\u3002',\n 'sessionToggle.label': '\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E',\n 'sessionToggle.failed': '\u672C\u4F1A\u8BDD\u7684\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E\u8BBE\u7F6E\u672A\u80FD\u4FDD\u5B58\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': '\u5224\u65AD\u6A21\u578B\u7684BaseURL\u3002\u4F1A\u81EA\u52A8\u8865/v1/systemone\u6216/systemone',\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.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.writeFailed': '\u5BC6\u94A5\u6CA1\u88AB\u63A5\u53D7\u3002',\n 'judge.importOpen': '\u5BFC\u5165',\n 'judge.export': '\u5BFC\u51FA',\n 'judge.exported': '\u5DF2\u7ECF\u628A\u5224\u65AD\u670D\u52A1\u8BBE\u7F6E\u6309 JSON \u590D\u5236\u8D70\u4E86\u3002',\n 'judge.exportFailed': '\u590D\u5236\u5230\u526A\u8D34\u677F\u6CA1\u6210\u529F\u3002',\n 'judge.importTitle': '\u5BFC\u5165\u5224\u65AD\u670D\u52A1\u8BBE\u7F6E',\n 'judge.importDesc': '\u628A JSON \u7C98\u8D34\u5230\u8FD9\u91CC\u3002\u5B83\u4F1A\u66FF\u6362\u5730\u5740\u4E0E\u5224\u65AD\u6A21\u578B\uFF0C\u5E76\u7ACB\u5373\u5199\u5165\u3002',\n 'judge.importPlaceholder': '{\\n \"endpointUrl\": \"\u2026\u2026\",\\n \"judgeModel\": \"\u2026\u2026\"\\n}',\n 'judge.importApply': '\u66FF\u6362\u5E76\u5199\u5165',\n 'judge.importCancel': '\u53D6\u6D88',\n 'judge.importClose': '\u5173\u95ED',\n 'judge.importBadJson': '\u8FD9\u4E0D\u662F\u5408\u6CD5\u7684 JSON\u3002',\n 'judge.importBadShape': '\u8FD9\u4E0D\u662F\u4E00\u4EFD\u5224\u65AD\u670D\u52A1\u8BBE\u7F6E\uFF1AendpointUrl \u4E0E judgeModel \u8981\u662F\u6587\u5B57\u3002',\n 'judge.importEmpty': '\u8FD9\u4EFD\u8BBE\u7F6E\u91CC\u65E2\u6CA1\u6709\u5730\u5740\u4E5F\u6CA1\u6709\u6A21\u578B\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': '\u5224\u65AD\u6216\u8DEF\u7EBF\u6821\u9A8C\u8D85\u8FC7 5 \u79D2',\n 'reason.unmatched': '\u7B54\u590D\u5BF9\u4E0D\u4E0A\u6E05\u5355',\n 'reason.incomplete': '\u9009\u4E2D\u7684\u7C7B\u578B\u6CA1\u586B\u5168',\n 'reason.unavailable-route': '\u9009\u4E2D\u7684\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u5F53\u524D\u4E0D\u53EF\u7528',\n 'reason.other': '\u5176\u4ED6',\n 'reason.unknown': '\u539F\u56E0\u4E0D\u660E',\n 'rows.title': '\u4EFB\u52A1\u7C7B\u578B',\n 'rows.empty': '\u8FD8\u6CA1\u6709\u4EFB\u52A1\u7C7B\u578B\u3002\u5728\u4E0B\u9762\u52A0\u4E00\u884C\u3002',\n 'rows.drag': '\u62D6\u62FD\u8C03\u6574\u987A\u5E8F',\n 'rows.enabled': '\u5F00\u542F\u4EFB\u52A1\u7C7B\u578B',\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.hintNoDescription': '\u6CA1\u6709\u63CF\u8FF0',\n 'rows.hintDuplicateDescription': '\u63CF\u8FF0\u548C\u522B\u7684\u884C\u91CD\u590D',\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.dependsOn': '\u8BF7\u5728\u300C\u63D2\u4EF6 \u2192 \u5B98\u65B9 \u2192 \u5B50\u667A\u80FD\u4F53\u300D\u4E2D\u5F00\u542F\u6A21\u578B\u9009\u62E9\u5E76\u6DFB\u52A0\u5141\u8BB8\u7684\u6A21\u578B\u3002\u5173\u95ED\u65F6\uFF0C\u5B50\u4EE3\u7406\u6CBF\u7528\u539F\u8DEF\u7EBF\u3002',\n 'rows.allowedEmpty': '\u5B98\u65B9\u914D\u7F6E\u91CC\u8FD8\u6CA1\u6709\u53EF\u9009\u6A21\u578B\uFF0C\u586B\u4E0A\u4E4B\u540E\u8FD9\u91CC\u624D\u6709\u53EF\u9009\u9879\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\u4F1A\u66FF\u6362\u4E0B\u9762\u90A3\u5F20\u8868\uFF0C\u5E76\u7ACB\u5373\u5199\u5165\u3002',\n 'rows.importPlaceholder': '[\\n { \"description\": \"\u2026\u2026\", \"provider\": \"\u2026\u2026\", \"model\": \"\u2026\u2026\", \"effort\": \"\u2026\u2026\" }\\n]',\n 'rows.importApply': '\u66FF\u6362\u5E76\u5199\u5165',\n 'rows.importCancel': '\u53D6\u6D88',\n 'rows.importClose': '\u5173\u95ED',\n 'rows.importBadJson': '\u8FD9\u4E0D\u662F\u5408\u6CD5\u7684 JSON\u3002',\n 'rows.importBadShape': '\u4EFB\u52A1\u7C7B\u578B\u7684\u6587\u5B57\u5B57\u6BB5\u5FC5\u987B\u662F\u6587\u5B57\uFF0Cenabled \u5FC5\u987B\u662F true \u6216 false\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.failed': '\u9884\u89C8\u8BFB\u4E0D\u51FA\u6765\u3002',\n 'write.failed': '\u6CA1\u5199\u8FDB\u53BB\uFF1A{error}',\n 'write.invalid': '\u8FD9\u6B21\u5199\u5165\u6CA1\u88AB\u63A5\u53D7\u3002',\n 'write.refused': '\u5BBF\u4E3B\u6CA1\u6709\u63A5\u53D7\u8FD9\u6B21\u5199\u5165\u3002',\n 'log.title': '\u5224\u65AD\u65E5\u5FD7',\n 'log.desc': '\u663E\u793A\u6700\u8FD1 10 \u6B21\u5224\u65AD\u3002\u70B9\u5F00\u4E00\u884C\u67E5\u770B\u5F53\u6B21\u8BF7\u6C42\u7684\u7EDF\u8BA1\u3002',\n 'log.empty': '\u8FD8\u6CA1\u6709\u5224\u65AD\u8FC7\u3002',\n 'log.colResult': '\u7ED3\u679C',\n 'log.colChoice': '\u9009\u62E9',\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': '\u5224\u65AD\u8BF7\u6C42\u7EDF\u8BA1',\n 'log.promptDesc': '\u5224\u65AD\u6A21\u578B\u3001\u53EF\u9009\u7C7B\u578B\u6570\u548C\u8F93\u5165\u957F\u5EA6\u3002',\n 'log.promptClose': '\u5173\u95ED',\n 'log.promptEmpty': '\u8FD9\u6B21\u6CA1\u6709\u5C1D\u8BD5\u53D1\u9001\u5224\u65AD\u8BF7\u6C42\u3002',\n 'log.copyAnalysis': '\u5206\u6790\u5224\u65AD\u7ED3\u679C',\n 'log.analysisPrompt': '\u8BF7\u5206\u6790 DSH \u5BB6\u76EE\u5F55\uFF08DSH_HOME\uFF0C\u9ED8\u8BA4 ~/.dsh\uFF09\u4E0B dsh-subagent-judge-dispatch/judgements.json \u4E2D\u6700\u8FD1 100 \u6761\u5224\u65AD\u8BB0\u5F55\u3002\u7EDF\u8BA1\u5404\u7C7B\u578B\u7684\u5224\u65AD\u6B21\u6570\u3001\u5931\u8D25\u539F\u56E0\u548C\u8017\u65F6\u3002\u6E05\u5355\u6539\u52A8\u540E\u7C7B\u578B\u7F16\u53F7\u53EF\u80FD\u53D8\u5316\uFF0C\u4EC5\u51ED\u8FD9\u4E9B\u6307\u6807\u65E0\u6CD5\u5224\u65AD\u5355\u4E2A\u4EFB\u52A1\u662F\u5426\u88AB\u6B63\u786E\u5F52\u7C7B\u3002',\n 'log.analysisCopied': '\u5DF2\u590D\u5236\u5206\u6790\u63D0\u793A\u8BCD\u3002',\n 'log.analysisCopyFailed': '\u590D\u5236\u5230\u526A\u8D34\u677F\u6CA1\u6210\u529F\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}"],
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;;;ACCO,IAAM,kBAAkB;AACxB,IAAM,qBAAqB;AAK3B,SAAS,WAAW,WAAoB,UAAmB,WAA6B;AAC7F,MAAI,cAAc,UAAa,cAAc,QAAQ,OAAO,cAAc,YACrE,CAAC,OAAO,OAAO,WAAW,SAAS,EAAG,QAAO;AAClD,QAAM,SAAU,UAA+B,SAAS;AACxD,SAAO,OAAO,WAAW,YAAY,SAAS;AAChD;;;ACZA,mBAAoC;AACpC,sCAAuB;AAmBd;AAXF,IAAM,qBAAqB;AAM3B,SAAS,cAAc,OAAoB;AAChD,QAAM,EAAE,WAAW,YAAY,YAAY,IAAI;AAC/C,QAAM,iBAAiB,WAAW,cAAY,SAAS,aAAa,IAAI;AACxE,QAAM,cAAc,YAAY,WAAS,MAAM,KAAK,SAAS,GAAG,WAAW,UAAU;AACrF,MAAI,kBAAkB,YAAa,QAAO;AAC1C,SAAO,4CAAC,qBAAmC,GAAG,SAAf,SAAsB;AACvD;AAEA,SAAS,kBAAkB,EAAE,WAAW,MAAM,QAAQ,eAAe,EAAE,GAAgB;AACrF,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,MAAM,KAAK,YAAY,CAAC;AACjE,QAAM,CAAC,SAAS,UAAU,QAAI,u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,MAAI,MAAM,OAAO,oBAAoB,MAAM,IAAI,MAAM,SAAS;AAAA,IAC5D,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,QAAQ,OAAO,EAAE,MAAM,IAAI,YAAY,IAA6B,kBAAkB,EAAE;AAAA,EAC1F,GAAG,aAAa,CAAC;AACjB,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 { SETTINGS_NAMESPACE } from '../enablement.ts';\nimport { MODEL_OPTIONS_SLOT, SessionToggle } from './SessionToggle.tsx';\nimport { injectCardStyles, setupSettingsUi } from './settings/ui.tsx';\nimport { apply as registerDictionaries, NS, en, zh } from './locales.ts';\n\n/**\n * \u6D4F\u89C8\u5668\u534A\u8FB9\uFF1A\u5728\u63D2\u4EF6\u9875\u6302\u914D\u7F6E\u5361\uFF0C\u5728\u6A21\u578B\u83DC\u5355\u6302\u4F1A\u8BDD\u5F00\u5173\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 ctx.effect(injectCardStyles, 'dsh-subagent-judge-dispatch: card styles');\n registerDictionaries(ctx);\n ctx.slots.inject(MODEL_OPTIONS_SLOT, () => ctx.slots.register({\n name: MODEL_OPTIONS_SLOT,\n id: 'subagent-judge-dispatch-enabled',\n locale: NS,\n inject: () => ({ form: ctx.configForms.get<Record<string, unknown>>(SETTINGS_NAMESPACE) }),\n }, SessionToggle));\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} from './settings/store.ts';\n", "/** Shared by the host and the conversation menu. */\nexport const DEFAULT_ENABLED = true;\nexport const SETTINGS_NAMESPACE = 'dsh-subagent-judge-dispatch';\n\nexport type SessionOverrides = Readonly<Record<string, boolean>>;\n\n/** An explicit choice takes precedence over the plugin default. */\nexport function enabledFor(overrides: unknown, fallback: boolean, sessionId?: string): boolean {\n if (sessionId === undefined || overrides === null || typeof overrides !== 'object'\n || !Object.hasOwn(overrides, sessionId)) return fallback;\n const choice = (overrides as SessionOverrides)[sessionId];\n return typeof choice === 'boolean' ? choice : fallback;\n}\n", "import { useEffect, useState } from 'react';\nimport { Switch } from '@deepseek-ai/dsh-client-ui-primitives';\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';\nimport type {} from '@deepseek-ai/dsh-client-ui-model-selection/client';\nimport type {} from '@deepseek-ai/dsh-client-ui-session/client';\nimport type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';\nimport { DEFAULT_ENABLED, enabledFor } from '../enablement.ts';\nimport { NS } from './locales.ts';\n\nexport const MODEL_OPTIONS_SLOT = 'conversation.input.model.options';\n\ntype ToggleProps = PropsRuntime<typeof MODEL_OPTIONS_SLOT>\n & PropsLocale<typeof NS>\n & { form: ConfigForm<Record<string, unknown>> };\n\nexport function SessionToggle(props: ToggleProps) {\n const { sessionId, useSession, useSessions } = props;\n const addressedChild = useSession(snapshot => snapshot.subagent !== null);\n const listedChild = useSessions(state => state.byId[sessionId]?.origin === 'subagent');\n if (addressedChild || listedChild) return null;\n return <RootSessionToggle key={sessionId} {...props} />;\n}\n\nfunction RootSessionToggle({ sessionId, form, locked, reportFailure, t }: ToggleProps) {\n const [snapshot, setSnapshot] = useState(() => form.getSnapshot());\n const [pending, setPending] = useState(false);\n\n useEffect(() => {\n const sync = () => setSnapshot(form.getSnapshot());\n sync();\n return form.subscribe(sync);\n }, [form]);\n\n if (snapshot.status !== 'ready' || snapshot.value === undefined) return null;\n const fallback = typeof snapshot.value.enabled === 'boolean' ? snapshot.value.enabled : DEFAULT_ENABLED;\n const enabled = enabledFor(snapshot.value.sessionOverrides, fallback, sessionId);\n\n async function select(next: boolean) {\n setPending(true);\n try {\n const path = ['sessionOverrides', sessionId];\n // Clearing a user value exposes the composition layer's value for this session.\n const base = snapshot.base as { sessionOverrides?: unknown } | null | undefined;\n const afterUnset = enabledFor(base?.sessionOverrides, fallback, sessionId);\n // The form queue supplies the revision when this path edit is sent.\n const accepted = await form.mutate([next === fallback && next === afterUnset\n ? { op: 'unset', path }\n : { op: 'set', path, value: next }]);\n if (!accepted) reportFailure(t('sessionToggle.failed'));\n } catch {\n reportFailure(t('sessionToggle.failed'));\n } finally {\n setSnapshot(form.getSnapshot());\n setPending(false);\n }\n }\n\n return (\n <div className=\"dsh-judge-session-toggle\">\n <span>{t('sessionToggle.label')}</span>\n <Switch\n className=\"dsh-judge-session-switch\"\n checked={enabled}\n disabled={locked || pending || !snapshot.writable}\n label={t('sessionToggle.label')}\n onChange={select}\n />\n </div>\n );\n}\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 exportJudgeJson,\n exportRowsJson,\n JUDGE_API_KEY_REF,\n parseJudgeJson,\n parseRowsJson,\n rowHints,\n type CredentialsRemoteLike,\n routeKey,\n SETTINGS_NAMESPACE,\n splitRouteKey,\n type LogRow,\n type PageState,\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\u4E24\u8282\u7684\u4E09\u79CD\u574F\u8F93\u5165\u5404\u8BF4\u5404\u7684\uFF0C\u4E0D\u5728\u8C03\u7528\u5904\u62FC\u952E\u540D\u3002 */\nconst IMPORT_ERROR_KEYS = {\n rows: {\n json: 'rows.importBadJson',\n shape: 'rows.importBadShape',\n empty: 'rows.importEmpty',\n },\n judge: {\n json: 'judge.importBadJson',\n shape: 'judge.importBadShape',\n empty: 'judge.importEmpty',\n },\n} as const;\n\n/** \u5BFC\u5165\u5F39\u7A97\u670D\u52A1\u7684\u4E24\u8282\uFF1A\u5224\u65AD\u670D\u52A1\u8BBE\u7F6E\uFF0C\u4E0E\u4EFB\u52A1\u7C7B\u578B\u6E05\u5355\u3002 */\ntype ImportSection = 'judge' | 'rows';\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-session-toggle {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n min-height: 34px;\n padding: 0 8px;\n border-radius: var(--dsw-radius-md);\n color: var(--dsw-alias-label-primary);\n font: var(--dsw-font-xs-13);\n}\n.dsh-judge-session-toggle .dsh-judge-session-switch { position: static; }\n.dsh-judge-session-switch::after { content: ''; position: absolute; inset: 0; border-radius: var(--dsw-radius-md); }\n.dsh-judge-session-toggle:has(.dsh-judge-session-switch:focus-visible) { background: var(--dsw-alias-interactive-bg-hover); }\n@media (hover: hover) {\n .dsh-judge-session-toggle:has(.dsh-judge-session-switch:not(:disabled)):hover { background: var(--dsw-alias-interactive-bg-hover); }\n}\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-description {\n field-sizing: content;\n display: block;\n min-height: 32px;\n max-height: 40vh;\n resize: vertical;\n padding: 6px 10px;\n border: 0.5px solid var(--dsw-alias-border-l3);\n border-radius: var(--dsw-radius-md);\n background: var(--dsw-alias-bg-layer-1);\n color: inherit;\n font: inherit;\n line-height: 1.4;\n}\n.dsh-judge-description:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }\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); }\n/* \u6807\u9898\u884C\u53F3\u7AEF\u7684\u4E00\u7EC4\u52A8\u4F5C\uFF1A\u8BD5\u901A\u3001\u5BFC\u5165\u3001\u5BFC\u51FA\u3001\u52A0\u4E00\u884C\u90FD\u6392\u5728\u8FD9\u91CC\u3002 */\n.dsh-judge-actions-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n/* \u4EFB\u52A1\u7C7B\u578B\u90A3\u4E00\u8282\u9876\u90E8\u7684\u4E00\u884C\uFF1A\u4F9D\u8D56\u54EA\u4EFD\u5B98\u65B9\u914D\u7F6E\uFF0C\u4EE5\u53CA\u53BB\u90A3\u91CC\u7684\u5165\u53E3\u3002 */\n/* \u5165\u53E3\u6309\u94FE\u63A5\u7684\u6837\u5B50\u8D70\uFF1A\u6CA1\u6709\u6309\u94AE\u7684\u76D2\u5B50\u548C\u5E95\u8272\uFF0C\u53EA\u5728\u60AC\u505C\u65F6\u52A0\u4E0B\u5212\u7EBF\u3002 */\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\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-drag { width: 36px; }\n.dsh-judge-drag { border: 0; padding: 4px; background: transparent; cursor: grab; color: var(--dsw-alias-label-tertiary); font: inherit; }\n.dsh-judge-drag:active { cursor: grabbing; }\n.dsh-judge-col-model { width: 188px; }\n.dsh-judge-col-effort { width: 124px; }\n.dsh-judge-col-actions { width: 130px; }\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/* Allow the model column to shrink so long names can be clipped. */\n.dsh-judge-log-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 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' || 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 return () => element.remove();\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 sections \u2014 the judgement service, and the\n * task-type table \u2014 and neither has a save button: a text field writes when\n * focus leaves it, a switch and a row action write the moment they are used, and\n * a failed write is reported at the bottom of the section that attempted it. The\n * log tab reads the Host's runtime log.\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 dragIndex = React.useRef<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 [sampleTask, setSampleTask] = useState('');\n const [sampling, setSampling] = useState(false);\n const [sampleResult, setSampleResult] = useState<Awaited<ReturnType<typeof dispatchCardStore.sample>> | 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 /** Which section's paste box is open; null when it is closed. */\n const [importSection, setImportSection] = useState<ImportSection | null>(null);\n /** What is pasted into that box. */\n const [importText, setImportText] = useState('');\n /** Why the last import attempt was refused, or ''. */\n const [importError, setImportError] = useState('');\n /** What the last export did, shown in the section that did it. */\n const [copyNote, setCopyNote] = useState<{ ok: boolean; text: string; section: ImportSection } | null>(null);\n const [logCopyResult, setLogCopyResult] = useState<boolean | null>(null);\n\n useEffect(() => {\n setState(dispatchCardStore.getState());\n const unsubscribe = dispatchCardStore.subscribe(() => setState(dispatchCardStore.getState()));\n return () => {\n unsubscribe();\n // \u79BB\u5F00\u63D2\u4EF6\u9875\u65F6\u540C\u6837\u5148\u5199\uFF1A\u5361\u7247\u5378\u8F7D\u4E4B\u540E\u6CA1\u6709\u4EBA\u518D\u66FF\u8FD9\u51E0\u683C\u63D0\u4EA4\u3002\n void dispatchCardStore.flush();\n };\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 const openPreview = async (): Promise<void> => {\n // \u9884\u89C8\u8BFB\u7684\u662F\u5DF2\u843D\u5730\u7684\u914D\u7F6E\uFF1A\u5148\u628A\u8FD8\u6CA1\u5931\u7126\u7684\u8349\u7A3F\u5199\u4E0B\u53BB\uFF0C\u5426\u5219\u770B\u5230\u7684\u662F\u4E0A\u4E00\u7248\u3002\n await dispatchCardStore.flush();\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'), section: 'rows' });\n };\n\n /** Copy the judgement service settings out as plain JSON. */\n const exportJudge = async (): Promise<void> => {\n const copied = await writeClipboard(exportJudgeJson(state));\n setCopyNote({ ok: copied, text: t(copied ? 'judge.exported' : 'judge.exportFailed'), section: 'judge' });\n };\n\n /** Open one section's paste box, empty and with no leftover complaint. */\n const openImport = (section: ImportSection): void => {\n setImportSection(section);\n setImportText('');\n setImportError('');\n setCopyNote(null);\n };\n\n /** Close the paste box without touching what is stored. */\n const closeImport = (): void => {\n setImportSection(null);\n setImportText('');\n setImportError('');\n };\n\n /** Read the pasted text into the page and write it; the dialog's button is the confirmation. */\n const applyImport = (): void => {\n if (importSection === 'judge') {\n const result = parseJudgeJson(importText);\n if (!result.ok) {\n setImportError(t(IMPORT_ERROR_KEYS.judge[result.error] as never));\n return;\n }\n dispatchCardStore.replaceJudgeConfig(result.value);\n } else {\n const result = parseRowsJson(importText);\n if (!result.ok) {\n setImportError(t(IMPORT_ERROR_KEYS.rows[result.error] as never));\n return;\n }\n dispatchCardStore.replaceRows(result.rows);\n }\n closeImport();\n };\n\n /** \u8FD9\u4E00\u8282\u7684\u4E00\u6B21\u63D0\u4EA4\uFF1A\u6587\u5B57\u683C\u79BB\u5F00\u8F93\u5165\u6846\u3001\u83DC\u5355\u9009\u5B8C\u65F6\u90FD\u8D70\u5B83\u3002 */\n const commitJudge = (): void => void dispatchCardStore.commit('judge');\n const commitRows = (): void => void dispatchCardStore.commit('rows');\n\n /** \u8FD9\u4E00\u8282\u6700\u540E\u4E00\u6B21\u5199\u5165\u6CA1\u843D\u5730\u65F6\uFF0C\u5C31\u5730\u8BF4\u660E\uFF1B\u4E24\u8282\u5404\u62A5\u5404\u7684\u3002 */\n const failure = (section: 'judge' | 'rows'): React.ReactElement | null => (\n state.writeFailed === section && state.writeError !== ''\n ? (\n <div className=\"dsh-judge-note-bad\" role=\"alert\">\n {t('write.failed').replace('{error}', state.writeError)}\n </div>\n )\n : null\n );\n\n /** One editable task-type row. */\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 && draft.enabled ? undefined : 'dsh-judge-row-off'}\n onDragOver={(event) => { if (dragIndex.current !== null) event.preventDefault(); }}\n onDrop={(event) => {\n event.preventDefault();\n if (dragIndex.current !== null) dispatchCardStore.moveRow(dragIndex.current, index);\n dragIndex.current = null;\n setOpenMenu(null);\n }}\n >\n <td className=\"dsh-judge-col-drag\">\n <button type=\"button\" className=\"dsh-judge-drag\" draggable={state.writable} disabled={!state.writable} aria-label={`${t('rows.drag')}: ${draft.description}`}\n onDragStart={(event) => { dragIndex.current = index; event.dataTransfer.effectAllowed = 'move'; event.dataTransfer.setData('text/plain', String(index)); }}\n onDragEnd={() => { dragIndex.current = null; }}\n onKeyDown={(event) => {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n dispatchCardStore.moveRow(index, index + (event.key === 'ArrowUp' ? -1 : 1));\n }\n }}\n >\u283F</button>\n </td>\n <td>\n {draft.stableId && <span className=\"dsh-judge-hint\">{t('log.typeKey').replace('{key}', draft.stableId)}</span>}\n {rowHints(state.rows, index, t).map((hint) => (\n <span key={hint} className=\"dsh-judge-off\">{hint}</span>\n ))}\n <textarea\n className=\"dsh-judge-field dsh-judge-description\"\n rows={2}\n readOnly={!state.writable}\n value={draft.description}\n placeholder={t('rows.descriptionPlaceholder')}\n aria-label={`${t('rows.colDescription')} ${index + 1}`}\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) =>\n dispatchCardStore.cell(index, 'description', event.target.value)}\n onBlur={commitRows}\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}\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.model}`,\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 commitRows();\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 commitRows();\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 onBlur={commitRows}\n />\n )}\n </td>\n <td className=\"dsh-judge-col-actions\">\n <div className=\"dsh-judge-cell-actions\">\n <Switch checked={draft.enabled} onChange={(next: boolean) => dispatchCardStore.toggleRow(index, next)}\n label={`${t('rows.enabled')}: ${draft.description}`} disabled={!state.writable} />\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 {/* \u4E09\u4EF6\u90FD\u662F\u8FD9\u4E00\u8282\u7684\u52A8\u4F5C\uFF1A\u5BFC\u5165\u4E0E\u5BFC\u51FA\u662F\u540C\u4E00\u4EFD\u8BBE\u7F6E\u7684\u4E24\u4E2A\u65B9\u5411\uFF0C\u8BD5\u901A\u95EE\u7684\u662F\n \u300C\u8FD9\u4EFD\u8BBE\u7F6E\u73B0\u5728\u80FD\u4E0D\u80FD\u7528\u300D\u3002\u8BD5\u901A\u4E0D\u843D\u76D8\u3001\u53EA\u8BFB\u5DF2\u843D\u5730\u7684\u503C\uFF0C\u6240\u4EE5\u5199\u5165\u8FD8\u5728\n \u8DEF\u4E0A\u65F6\u5148\u4E0D\u7ED9\u6309\u3002 */}\n <div className=\"dsh-judge-actions-group\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => openImport('judge')}>\n {t('judge.importOpen')}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void exportJudge()}>\n {t('judge.export')}\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={probing || state.writing !== ''}\n onClick={() => void runProbe()}\n >\n {probing ? t('judge.probing') : t('judge.probe')}\n </Button>\n </div>\n </div>\n <div className=\"dsh-judge-desc\">{t('judge.desc')}</div>\n\n {/* \u5F00\u5173\u62E8\u4E86\u5C31\u662F\u4E00\u6B21\u5B8C\u6574\u7684\u51B3\u5B9A\uFF0C\u6240\u4EE5\u5B83\u5F53\u573A\u5199\u5165\uFF1B\u4E0B\u9762\u51E0\u683C\u662F\u6587\u5B57\uFF0C\u79BB\u5F00\u8F93\u5165\u6846\u624D\u5199\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}\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}\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\"\n aria-label={t('judge.endpoint')}\n disabled={!state.writable}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.field('endpointUrl', event.target.value)}\n onBlur={commitJudge}\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 disabled={!state.writable}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.field('judgeModel', event.target.value)}\n onBlur={commitJudge}\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\u51E0\u683C\u540C\u5BBD\uFF1A\u72B6\u6001\u653E\u5728\u8F93\u5165\u6846\u4E0B\u9762\u90A3\u4E00\u884C\uFF0C\u5DE6\u53F3\u8FB9\u7F18\u624D\u5BF9\u5F97\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 || !state.writable}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) =>\n dispatchCardStore.key(event.target.value)}\n onBlur={commitJudge}\n onKeyDown={(event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter') return;\n event.preventDefault();\n commitJudge();\n }}\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.unavailable && <span className=\"dsh-judge-hint\">{t('judge.keyUnavailable')}</span>}\n {state.key.failed && (\n <span className=\"dsh-judge-note-bad\" role=\"alert\">\n {t('judge.keyFailed').replace('{error}', state.key.error || t('write.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 {copyNote !== null && copyNote.section === 'judge' && (\n <div className={copyNote.ok ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'} role=\"status\">\n {copyNote.text}\n </div>\n )}\n {failure('judge')}\n </div>\n\n <div className=\"dsh-judge-section\">\n <div className=\"dsh-judge-head\">\n <span className=\"dsh-judge-title\">{t('rows.title')}</span>\n {/* \u4E09\u4EF6\u90FD\u662F\u6574\u5F20\u8868\u7684\u52A8\u4F5C\uFF1A\u5BFC\u5165\u4E0E\u5BFC\u51FA\u662F\u540C\u4E00\u4EFD\u6E05\u5355\u7684\u4E24\u4E2A\u65B9\u5411\uFF0C\u52A0\u4E00\u884C\u662F\u5F80\u8868\u5C3E\u7EED\u4E00\u6761\u3002 */}\n <div className=\"dsh-judge-actions-group\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => openImport('rows')}>\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 </div>\n </div>\n <div className=\"dsh-judge-desc\">{t('rows.dependsOn')}</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-drag\" />\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 {copyNote !== null && copyNote.section === 'rows' && (\n <div className={copyNote.ok ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'} role=\"status\">\n {copyNote.text}\n </div>\n )}\n {failure('rows')}\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 <Button variant=\"outline\" size=\"sm\" onClick={() => void openPreview()}>\n {t('preview.open')}\n </Button>\n </div>\n <div className=\"dsh-judge-section\">\n <div className=\"dsh-judge-title\">{t('sample.title')}</div>\n <div className=\"dsh-judge-desc\">{t('sample.desc')}</div>\n <textarea aria-label={t('sample.title')} value={sampleTask} maxLength={10000} onChange={(event) => setSampleTask(event.target.value)} />\n <Button variant=\"outline\" size=\"sm\" disabled={sampling || !sampleTask.trim() || state.writing !== ''} onClick={() => void (async () => {\n setSampling(true);\n await dispatchCardStore.flush();\n const current = dispatchCardStore.getState();\n if (current.writeFailed || current.key.failed || current.endpointUrl !== current.committed.endpointUrl\n || current.judgeModel !== current.committed.judgeModel || JSON.stringify(current.rows) !== JSON.stringify(current.committed.rows)) setSampleResult({ ok: false, reason: 'write' });\n else setSampleResult(await dispatchCardStore.sample(sampleTask));\n setSampling(false);\n })()}>{sampling ? t('sample.running') : t('sample.send')}</Button>\n {sampleResult && <div role=\"status\">\n {sampleResult.typeId != null && <div>{t('log.resultJudged').replace('{id}', String(sampleResult.typeId))}</div>}\n {sampleResult.route && <div>{[sampleResult.route.provider, sampleResult.route.model, sampleResult.route.reasoningEffort].join(' \u00B7 ')}</div>}\n <div>{sampleResult.ok ? t('sample.valid') : `${t('sample.failed')} ${sampleResult.reason === 'write' ? t('write.invalid') : reasonText(sampleResult.reason)}`}</div>\n </div>}\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 <div className=\"dsh-judge-actions-group\">\n <Button variant=\"outline\" size=\"sm\" onClick={() => void writeClipboard(t('log.analysisPrompt')).then(setLogCopyResult)}>\n {t('log.copyAnalysis')}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void dispatchCardStore.refreshLog()}>\n {t('log.refresh')}\n </Button>\n </div>\n </div>\n {logCopyResult !== null && (\n <div className={logCopyResult ? 'dsh-judge-note-ok' : 'dsh-judge-note-bad'} role=\"status\">\n {t(logCopyResult ? 'log.analysisCopied' : 'log.analysisCopyFailed')}\n </div>\n )}\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.logFailed && 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.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.resultHistorical').replace('{id}', String(entry.typeId)), hint: entry.typeKey ? t('log.typeKey').replace('{key}', entry.typeKey) : t('log.legacyType') };\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 <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={(next) => {\n // \u5207\u8D70\u4E4B\u524D\u5148\u628A\u8FD8\u6CA1\u5931\u7126\u7684\u90A3\u4E00\u683C\u5199\u4E0B\u53BB\uFF1A\u81EA\u52A8\u4FDD\u5B58\u4E0D\u7559\u300C\u660E\u660E\u586B\u4E86\u5374\u6CA1\u5B58\u300D\u7684\u6B7B\u89D2\u3002\n void dispatchCardStore.flush();\n setTab(next);\n }}\n label={t('tab.design')}\n />\n {tab === 'design' ? design : log}\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={importSection !== null}\n onClose={closeImport}\n title={t(importSection === 'judge' ? 'judge.importTitle' : 'rows.importTitle')}\n closeLabel={t(importSection === 'judge' ? 'judge.importClose' : 'rows.importClose')}\n description={t(importSection === 'judge' ? 'judge.importDesc' : 'rows.importDesc')}\n className=\"dsh-judge-modal\"\n footer={(\n <>\n <Button variant=\"outline\" size=\"sm\" onClick={closeImport}>\n {t(importSection === 'judge' ? 'judge.importCancel' : 'rows.importCancel')}\n </Button>\n <Button variant=\"primary\" size=\"sm\" onClick={applyImport}>\n {t(importSection === 'judge' ? 'judge.importApply' : 'rows.importApply')}\n </Button>\n </>\n )}\n >\n <textarea\n className=\"dsh-judge-paste\"\n value={importText}\n aria-label={t(importSection === 'judge' ? 'judge.importTitle' : 'rows.importTitle')}\n placeholder={t(importSection === 'judge' ? 'judge.importPlaceholder' : '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={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.metrics === undefined\n ? <div className=\"dsh-judge-desc\">{t('log.promptEmpty')}</div>\n : <div className=\"dsh-judge-prompt\">\n <CodeBlock\n code={JSON.stringify(detail.metrics, null, 2)}\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. */\nconst 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 list rules live here as well, because the criteria map IS the list: which\n * rows are offered ({@link selectableRows}) and what number each carries\n * ({@link numberTypeRows}).\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. */\nconst 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. */\nconst 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 */\nconst PROBE_INSTRUCTIONS =\n 'Answer with the number of the one option listed below.';\n\n/** The single criterion the connectivity check offers. */\nconst 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 * Whether one row is switched on.\n *\n * A row that is switched off stays in the list \u2014 the reader keeps it there to\n * turn it back on later \u2014 but takes no part in a judgement and carries no\n * number. A missing value counts as switched on, so a row written before the\n * switch existed keeps working.\n *\n * The parameter is narrowed to the one field the rule reads, so a stored row, a\n * numbered row and the page's draft row all satisfy it.\n *\n * @param row - one row, stored or drafted.\n * @returns whether the row takes part in judgements.\n */\nexport function isRowEnabled(row: { enabled?: boolean }): boolean {\n return row.enabled !== false;\n}\n\n/** The fields a row must carry to be judged: the switch, and the route it runs on. */\ntype RowOffering = { enabled?: boolean } & Pick<TypeRow, 'provider' | 'model' | 'effort'>;\n\n/**\n * Whether one row is offered to the judge: switched on, and its route filled in.\n *\n * The two conditions are one rule because the judge's list is exactly the rows\n * that pass both \u2014 a row switched off is one the reader does not want judged,\n * and a half-filled row could be chosen and then have nothing to write.\n *\n * @param row - one row, stored, numbered or drafted.\n * @returns whether the judge may choose it.\n */\nexport function isOfferedRow(row: RowOffering): boolean {\n return isRowEnabled(row) && isSelectableRow(row);\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(isOfferedRow);\n}\n\n/**\n * Number the rows the judge is offered, in list order.\n *\n * The number is positional and never stored: switching a row off, filling one\n * in, or moving it renumbers the rest. A row that is not offered carries 0 \u2014 it\n * has no number to be answered with \u2014 so the criteria map is numbered 1..n with\n * no gaps, and the preview, the request and the answer all read the same list.\n *\n * @param rows - the rows as the page holds them, in page order.\n * @returns the rows with their numbers applied, in the same order.\n */\nexport function numberTypeRows<T extends RowOffering>(\n rows: readonly T[],\n): (T & { id: number })[] {\n let next = 0;\n return rows.map((row) => {\n if (!isOfferedRow(row)) return { ...row, id: 0 };\n next += 1;\n return { ...row, id: next };\n });\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. */\nconst 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}\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}\n", "/**\n * The configuration card's own state: what the Host serves, what the reader has\n * staged, and what a commit would write.\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 * - A control commits on its own terms: a text field when focus leaves it, a\n * switch or a row action the moment it is used. There is no save button, so a\n * half-typed endpoint reaches a delegation only if the reader leaves the field\n * \u2014 the same moment they would have pressed save.\n * - A commit that did not land is reported in the section that attempted it, and\n * the drafts stay for the next attempt. The shared configuration form answers\n * `false` for a refusal, which is not a rejection: treating it as success would\n * 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 { DEFAULT_ENABLED } from '../../enablement.ts';\nimport { isSelectableRow } from '../../server/judge-prompt.ts';\nimport type { LogEntry as LogRow } from '../../server/types.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 stableId?: string;\n description: string;\n provider: string;\n model: string;\n effort: string;\n enabled: boolean;\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 type { LogEntry as LogRow } from '../../server/types.ts';\n\n/** Which of the two sections a commit 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 /**\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 writing: boolean;\n failed: boolean;\n /** The credentials service's own message for a refused write, or ''. */\n error: string;\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 /** Which section a commit is crossing the wire for, or '' when none is. */\n writing: Section | '';\n /** Which section's last commit did not land, or '' when none failed. */\n writeFailed: Section | '';\n /** The Host's own message for the last refused write, or ''. */\n writeError: 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\nexport { SETTINGS_NAMESPACE } from '../../enablement.ts';\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 };\n subscribe(listener: () => void): () => void;\n mutate(ops: readonly SettingsPathOpLike[]): 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 sample?(task: string): Promise<SampleResult>;\n}\n\nexport interface SampleResult {\n ok: boolean;\n reason?: string;\n typeId?: number | null;\n valid?: boolean;\n route?: { provider: string; model: string; reasoningEffort: 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';\nexport const SAMPLE_ROUTE_PATH = '/api/dsh-subagent-judge-dispatch/sample';\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 const response = await fetch(LOG_ROUTE_PATH);\n if (!response.ok) throw new Error('Log request failed');\n const body = await readJson(response);\n if (body?.ok !== true || !Array.isArray(body.entries)) throw new Error('Invalid log response');\n return body.entries as LogRow[];\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 async sample(task: string): Promise<SampleResult> {\n const response = await fetch(SAMPLE_ROUTE_PATH, {\n method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ task }),\n });\n if (!response.ok) throw new Error('Sample request failed');\n return await readJson(response) ?? { ok: false, reason: 'unreachable' };\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 ...typeof record.stableId === 'string' && record.stableId !== '' ? { stableId: record.stableId } : {},\n description: text('description'),\n provider: text('provider'),\n model: text('model'),\n effort: text('effort'),\n enabled: record.enabled !== false,\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/** The three sentences a row can be flagged with. */\nexport type RowHintKey = 'rows.incomplete' | 'rows.hintNoDescription' | 'rows.hintDuplicateDescription';\n\n/** The page's translator, narrowed to the sentences a row hint can be. */\nexport type RowHintKeyTranslator = (key: RowHintKey) => string;\n\n/**\n * Everything wrong with one row, as sentences to show under its number.\n *\n * Three faults, one place. A row whose model route is incomplete is not offered\n * to the judge at all; a row with a blank or repeated description is offered\n * with a criterion the judge cannot tell apart from another. None of them blocks\n * a write \u2014 the reader may be halfway through typing \u2014 so they are reported\n * beside the row while the list is written as it stands.\n *\n * @param rows - every row on the page, in page order.\n * @param index - which row to describe.\n * @param t - the page's translator, so each sentence is localized.\n * @returns the sentences, empty when the row has nothing wrong.\n */\nexport function rowHints(rows: readonly TypeRowDraft[], index: number, t: RowHintKeyTranslator): string[] {\n const row = rows[index];\n if (row === undefined) return [];\n const hints: string[] = [];\n if (!isSelectableRow(row)) hints.push(t('rows.incomplete'));\n const description = row.description.trim();\n if (description === '') {\n hints.push(t('rows.hintNoDescription'));\n } else if (rows.some((other, at) => at !== index && other.description.trim() === description)) {\n hints.push(t('rows.hintDuplicateDescription'));\n }\n return hints;\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 enabled: row.enabled,\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 || (record.enabled !== undefined && typeof record.enabled !== 'boolean')) 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 enabled: record.enabled !== false,\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/** The judgement service's connection settings, as the page exports and imports them. */\nexport interface JudgeConfigDraft {\n endpointUrl: string;\n judgeModel: string;\n}\n\n/**\n * The judgement service's connection settings as plain JSON text, for copying out.\n *\n * The key is not part of it: it is write-only, and a copied document that\n * carried a secret would be a secret in a clipboard.\n *\n * @param state - the three settings as the page holds them.\n * @returns indented JSON text.\n */\nexport function exportJudgeJson(\n state: Pick<PageState, 'endpointUrl' | 'judgeModel'>,\n): string {\n return JSON.stringify(\n {\n endpointUrl: state.endpointUrl,\n judgeModel: state.judgeModel,\n },\n null,\n 2,\n );\n}\n\n/** What reading pasted judgement-service JSON produced. */\nexport type JudgeImport =\n | { ok: true; value: JudgeConfigDraft }\n /** `error` names the fault; the page turns it into its own sentence. */\n | { ok: false; error: 'json' | 'shape' | 'empty' };\n\n/**\n * Read pasted judgement-service settings.\n *\n * The text is checked before it can reach the page: it must be one JSON object\n * and the two fields must be strings. An unknown field is ignored rather than\n * refused, so a document copied from a newer version still loads what it\n * understands.\n *\n * @param text - what the reader pasted.\n * @returns the settings, or the fault that stopped it.\n */\nexport function parseJudgeJson(text: string): JudgeImport {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n return { ok: false, error: 'json' };\n }\n if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {\n return { ok: false, error: 'shape' };\n }\n const record = parsed as Record<string, unknown>;\n const wrongType = ['endpointUrl', 'judgeModel']\n .some((key) => record[key] !== undefined && typeof record[key] !== 'string');\n if (wrongType) return { ok: false, error: 'shape' };\n const value: JudgeConfigDraft = {\n endpointUrl: typeof record.endpointUrl === 'string' ? record.endpointUrl : '',\n judgeModel: typeof record.judgeModel === 'string' ? record.judgeModel : '',\n };\n if (value.endpointUrl.trim() === '' && value.judgeModel.trim() === '') {\n return { ok: false, error: 'empty' };\n }\n return { ok: true, value };\n}\n\n/** A key nothing is staged for and nothing is known about. */\nfunction emptyKey(): KeyState {\n return {\n text: '', configured: false, unavailable: false,\n writing: false, failed: false, error: '',\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 commits on its own terms, so a\n * half-typed endpoint can never reach a delegation: a field writes when focus\n * leaves it, which is the moment the reader has finished with it. Commits are\n * serialized through one queue, so two controls left in quick succession cannot\n * race the Host's revision fence.\n */\nexport class DispatchCardStore {\n private state: PageState = {\n available: false,\n writable: false,\n enabled: DEFAULT_ENABLED,\n logEnabled: true,\n endpointUrl: '',\n judgeModel: '',\n rows: [],\n models: [],\n catalogRead: false,\n committed: {\n enabled: DEFAULT_ENABLED,\n logEnabled: true,\n endpointUrl: '',\n judgeModel: '',\n rows: [],\n },\n writing: '',\n writeFailed: '',\n writeError: '',\n key: emptyKey(),\n log: [],\n logLoaded: false,\n logFailed: false,\n };\n\n private listeners = new Set<() => void>();\n /** One commit at a time: a queued write reads the drafts as they stand when it runs. */\n private queue: Promise<void> = Promise.resolve();\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: { ...this.state.key, configured: info?.configured === true },\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 : DEFAULT_ENABLED,\n logEnabled: typeof value.logEnabled === 'boolean' ? value.logEnabled : true,\n endpointUrl: typeof value.endpointUrl === 'string' ? value.endpointUrl : '',\n judgeModel: typeof value.judgeModel === 'string' ? value.judgeModel : '',\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.notify();\n }\n\n /**\n * Stage one edit.\n *\n * A failure stays on screen until a write lands: the value it complains about\n * has not reached the document yet, so clearing it on the first keystroke would\n * say \"fixed\" while the drafts are still only on this page.\n *\n * @param patch - the state fields this edit changes.\n */\n private stage(patch: Partial<PageState>): void {\n this.state = { ...this.state, ...patch };\n this.notify();\n }\n\n /** Stage one top-level field; its control commits when focus leaves it. */\n field(key: 'endpointUrl' | 'judgeModel', value: string): void {\n this.stage(key === 'endpointUrl' ? { endpointUrl: value } : { judgeModel: value });\n }\n\n /** Flip one switch and write it: a switch is one complete decision. */\n toggle(key: 'enabled' | 'logEnabled', value: boolean): void {\n this.stage(key === 'enabled' ? { enabled: value } : { logEnabled: value });\n void this.commit('judge');\n }\n\n /** Stage the judgement key; its control commits when focus leaves it or on Enter. */\n key(text: string): void {\n this.stage({ key: { ...this.state.key, text, failed: false, error: '' } });\n }\n\n /** Stage one cell of one row; a text cell commits on blur, a menu choice at once. */\n cell(index: number, key: 'description' | 'provider' | 'model' | 'effort', 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 write can\n // never carry an effort the selected route cannot run.\n this.stage({ rows: key === 'model' ? this.reconcileEffort(rows, index) : rows });\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 and write it: a new row is a decision like any other. */\n addRow(): void {\n this.stage({ rows: [...this.state.rows, { description: '', provider: '', model: '', effort: '', enabled: true }] });\n void this.commit('rows');\n }\n\n /**\n * Replace the list with an imported one and write it.\n *\n * The import dialog's own button is the confirmation, so the list it produces\n * is written at once rather than left as a draft the reader has to commit a\n * second time.\n *\n * @param rows - the rows read from the pasted JSON.\n */\n replaceRows(rows: readonly TypeRowDraft[]): void {\n this.stage({ rows: rows.map(readRow) });\n void this.commit('rows');\n }\n\n /**\n * Replace the judgement service's connection settings with an imported set and\n * write them.\n *\n * The import dialog's own button is the confirmation, so the settings it\n * produces are written at once rather than left as a draft.\n *\n * @param draft - the settings read from the pasted JSON.\n */\n replaceJudgeConfig(draft: JudgeConfigDraft): void {\n this.stage({\n endpointUrl: draft.endpointUrl,\n judgeModel: draft.judgeModel,\n });\n void this.commit('judge');\n }\n\n toggleRow(index: number, enabled: boolean): void {\n this.stage({ rows: this.state.rows.map((row, at) => at === index ? { ...row, enabled } : row) });\n void this.commit('rows');\n }\n\n moveRow(from: number, to: number): void {\n if (from === to || from < 0 || to < 0 || from >= this.state.rows.length || to >= this.state.rows.length) return;\n const rows = [...this.state.rows];\n const [moved] = rows.splice(from, 1);\n rows.splice(to, 0, moved);\n this.stage({ rows });\n void this.commit('rows');\n }\n\n /** Delete one row and write the rest; the remaining rows renumber themselves. */\n removeRow(index: number): void {\n this.stage({ rows: this.state.rows.filter((_row, at) => at !== index) });\n void this.commit('rows');\n }\n\n /**\n * Write one section's staged edits as one batch.\n *\n * The card queues commits so each one reads the latest drafts and committed\n * values after the previous commit settles. The shared form orders these\n * writes with the session menu's writes and supplies their revision fences.\n *\n * The judgement section also writes a typed key, so leaving the key field and\n * leaving the endpoint field are one kind of gesture. The type rows are written\n * whole rather than diffed: the array is one value, and a positional number is\n * derived from it, so a partial write could momentarily renumber the list under\n * a reader mid-write.\n *\n * @param section - which section's drafts to write.\n * @returns settlement after the write, whether it landed or not.\n */\n commit(section: Section): Promise<void> {\n this.queue = this.queue.then(() => this.write(section)).catch(() => {});\n return this.queue;\n }\n\n /** Write whatever both sections still hold; used when the page is left. */\n flush(): Promise<void> {\n return this.commit('judge').then(() => this.commit('rows'));\n }\n\n /**\n * The write itself, run from the queue.\n * @param section - which section's drafts to write.\n */\n private async write(section: Section): Promise<void> {\n const form = this.form;\n if (form === null || !this.state.writable) 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 const rows = this.state.rows.map((row) => readRow({ ...row, stableId: row.stableId || crypto.randomUUID() }));\n this.state = { ...this.state, rows };\n ops.push({ op: 'set', path: ['rows'], value: rows });\n }\n\n const typedKey = section === 'judge' ? this.state.key.text.trim() : '';\n if (ops.length === 0 && typedKey === '') {\n // Nothing is left to write: the drafts match the document again, so a\n // failure about this section is no longer the current fact.\n if (this.state.writeFailed === section) {\n this.state = { ...this.state, writeFailed: '', writeError: '' };\n this.notify();\n }\n return;\n }\n\n this.state = { ...this.state, writing: section, writeFailed: '', writeError: '' };\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 let failure = '';\n let keyFailed = false;\n if (typedKey !== '') {\n const result = await this.writeKey(typedKey);\n if (!result.ok) {\n failure = result.error;\n keyFailed = true;\n }\n }\n if (failure === '' && ops.length > 0) {\n try {\n const landed = await form.mutate(ops);\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('write.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('write.invalid');\n }\n }\n // A key failure is already on the key row; repeating it at the section's foot\n // would say the same sentence twice.\n this.state = {\n ...this.state,\n writing: '',\n writeFailed: failure === '' || keyFailed ? '' : section,\n writeError: keyFailed ? '' : failure,\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, writing: 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.writeFailed');\n this.state = { ...this.state, key: { ...this.state.key, writing: false, failed: true, error } };\n return { ok: false, error };\n }\n this.state = {\n ...this.state,\n key: { ...this.state.key, writing: false, failed: false, error: '', text: '', configured: true },\n };\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.writeFailed');\n this.state = { ...this.state, key: { ...this.state.key, writing: false, failed: true, error: message } };\n return { ok: false, error: message };\n }\n }\n\n /** Read the runtime log from the Host. */\n async refreshLog(): Promise<void> {\n if (this.remote === null) {\n this.state = { ...this.state, logLoaded: true, logFailed: true };\n this.notify();\n return;\n }\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 async sample(task: string): Promise<SampleResult> {\n try {\n return await this.remote?.sample?.(task) ?? { ok: false, reason: 'unreachable' };\n } catch {\n return { ok: false, 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': 'Enable judge dispatch by default',\n 'switch.rewrite.desc': 'Applies to conversations without their own choice in the model menu.',\n 'sessionToggle.label': 'Subagent judge dispatch',\n 'sessionToggle.failed': 'Could not save judge dispatch for this conversation.',\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 judge model's base URL. /v1/systemone or /systemone is appended automatically.\",\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.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.writeFailed': 'The key was not accepted.',\n 'judge.importOpen': 'Import',\n 'judge.export': 'Export',\n 'judge.exported': 'Copied the judgement service settings as JSON.',\n 'judge.exportFailed': 'Could not copy to the clipboard.',\n 'judge.importTitle': 'Import the judgement service settings',\n 'judge.importDesc': 'Paste the JSON here. It replaces the address and the model, and is written at once.',\n 'judge.importPlaceholder': '{\\n \"endpointUrl\": \"...\",\\n \"judgeModel\": \"...\"\\n}',\n 'judge.importApply': 'Replace and write',\n 'judge.importCancel': 'Cancel',\n 'judge.importClose': 'Close',\n 'judge.importBadJson': 'This is not valid JSON.',\n 'judge.importBadShape': 'This is not a judgement service setting: endpointUrl and judgeModel must be text.',\n 'judge.importEmpty': 'This setting names neither an address nor a model.',\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.unavailable-route': 'the selected model or effort is unavailable',\n 'reason.other': 'other',\n 'reason.unknown': 'unknown reason',\n 'rows.title': 'Task types',\n 'rows.empty': 'No task type yet. Add one below.',\n 'rows.drag': 'Drag to reorder',\n 'rows.enabled': 'Enable task type',\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.hintNoDescription': 'No description',\n 'rows.hintDuplicateDescription': 'Description repeats another row',\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.dependsOn': 'Under Plugins \u2192 Official \u2192 Subagent, enable model selection and add allowed models. If it is off, the child keeps its original model.',\n 'rows.allowedEmpty':\n 'The official setting offers no model yet; fill it in and the options appear here.',\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 replaces the table below and is written at once.',\n 'rows.importPlaceholder': '[\\n { \"description\": \"...\", \"provider\": \"...\", \"model\": \"...\", \"effort\": \"...\" }\\n]',\n 'rows.importApply': 'Replace and write',\n 'rows.importCancel': 'Cancel',\n 'rows.importClose': 'Close',\n 'rows.importBadJson': 'This is not valid JSON.',\n 'rows.importBadShape': 'Task type fields must be text, and enabled must be true or false.',\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.failed': 'The preview could not be read.',\n 'write.failed': 'The write did not land: {error}',\n 'write.invalid': 'This could not be written.',\n 'write.refused': 'The host did not accept this write.',\n 'log.title': 'Judgement log',\n 'log.desc': 'The 10 most recent judgements. Open an entry to see its request metrics.',\n 'log.empty': 'No judgement has run yet.',\n 'log.colResult': 'Result',\n 'log.colChoice': 'Choice',\n 'log.colTime': 'Time',\n 'log.colLatency': 'Took',\n 'log.resultJudged': 'Type {id}',\n 'log.resultHistorical': 'Type {id} at the time',\n 'log.resultInherited': 'No match',\n 'log.promptTitle': 'Judgement request metrics',\n 'log.promptDesc': 'Judge model, number of offered choices, and input length.',\n 'log.promptClose': 'Close',\n 'log.promptEmpty': 'No judge request was attempted.',\n 'log.copyAnalysis': 'Analyze judgement results',\n 'log.analysisPrompt': 'Analyze the latest 100 records in dsh-subagent-judge-dispatch/judgements.json under DSH_HOME (default ~/.dsh). Summarize results by type, fallback reasons, and latency. Type numbering can change when the list is edited. Do not infer whether individual tasks were classified correctly from metrics alone.',\n 'log.analysisCopied': 'Analysis prompt copied.',\n 'log.analysisCopyFailed': 'Could not copy to the clipboard.',\n 'log.refresh': 'Refresh',\n 'log.loadFailed': 'The log could not be read.',\n 'log.typeKey': 'Type identifier: {key}; number at the time of judgement.',\n 'log.legacyType': 'Historical number; the original type cannot be identified after edits.',\n 'sample.title': 'Try a sample task',\n 'sample.desc': 'Sending will transmit this text and the configured type list to the configured judgement service. Uses saved settings; does not dispatch a subagent or write a log.',\n 'sample.send': 'Send sample for judgement',\n 'sample.running': 'Judging\u2026',\n 'sample.valid': 'Route validation passed.',\n 'sample.failed': 'Judgement or route validation failed:',\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': '\u9ED8\u8BA4\u5F00\u542F\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E',\n 'switch.rewrite.desc': '\u4F1A\u8BDD\u5728\u6A21\u578B\u83DC\u5355\u4E2D\u6CA1\u6709\u5355\u72EC\u8BBE\u7F6E\u65F6\uFF0C\u4F7F\u7528\u6B64\u9ED8\u8BA4\u503C\u3002',\n 'sessionToggle.label': '\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E',\n 'sessionToggle.failed': '\u672C\u4F1A\u8BDD\u7684\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E\u8BBE\u7F6E\u672A\u80FD\u4FDD\u5B58\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': '\u5224\u65AD\u6A21\u578B\u7684BaseURL\u3002\u4F1A\u81EA\u52A8\u8865/v1/systemone\u6216/systemone',\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.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.writeFailed': '\u5BC6\u94A5\u6CA1\u88AB\u63A5\u53D7\u3002',\n 'judge.importOpen': '\u5BFC\u5165',\n 'judge.export': '\u5BFC\u51FA',\n 'judge.exported': '\u5DF2\u7ECF\u628A\u5224\u65AD\u670D\u52A1\u8BBE\u7F6E\u6309 JSON \u590D\u5236\u8D70\u4E86\u3002',\n 'judge.exportFailed': '\u590D\u5236\u5230\u526A\u8D34\u677F\u6CA1\u6210\u529F\u3002',\n 'judge.importTitle': '\u5BFC\u5165\u5224\u65AD\u670D\u52A1\u8BBE\u7F6E',\n 'judge.importDesc': '\u628A JSON \u7C98\u8D34\u5230\u8FD9\u91CC\u3002\u5B83\u4F1A\u66FF\u6362\u5730\u5740\u4E0E\u5224\u65AD\u6A21\u578B\uFF0C\u5E76\u7ACB\u5373\u5199\u5165\u3002',\n 'judge.importPlaceholder': '{\\n \"endpointUrl\": \"\u2026\u2026\",\\n \"judgeModel\": \"\u2026\u2026\"\\n}',\n 'judge.importApply': '\u66FF\u6362\u5E76\u5199\u5165',\n 'judge.importCancel': '\u53D6\u6D88',\n 'judge.importClose': '\u5173\u95ED',\n 'judge.importBadJson': '\u8FD9\u4E0D\u662F\u5408\u6CD5\u7684 JSON\u3002',\n 'judge.importBadShape': '\u8FD9\u4E0D\u662F\u4E00\u4EFD\u5224\u65AD\u670D\u52A1\u8BBE\u7F6E\uFF1AendpointUrl \u4E0E judgeModel \u8981\u662F\u6587\u5B57\u3002',\n 'judge.importEmpty': '\u8FD9\u4EFD\u8BBE\u7F6E\u91CC\u65E2\u6CA1\u6709\u5730\u5740\u4E5F\u6CA1\u6709\u6A21\u578B\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': '\u5224\u65AD\u6216\u8DEF\u7EBF\u6821\u9A8C\u8D85\u8FC7 5 \u79D2',\n 'reason.unmatched': '\u7B54\u590D\u5BF9\u4E0D\u4E0A\u6E05\u5355',\n 'reason.incomplete': '\u9009\u4E2D\u7684\u7C7B\u578B\u6CA1\u586B\u5168',\n 'reason.unavailable-route': '\u9009\u4E2D\u7684\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u5F53\u524D\u4E0D\u53EF\u7528',\n 'reason.other': '\u5176\u4ED6',\n 'reason.unknown': '\u539F\u56E0\u4E0D\u660E',\n 'rows.title': '\u4EFB\u52A1\u7C7B\u578B',\n 'rows.empty': '\u8FD8\u6CA1\u6709\u4EFB\u52A1\u7C7B\u578B\u3002\u5728\u4E0B\u9762\u52A0\u4E00\u884C\u3002',\n 'rows.drag': '\u62D6\u62FD\u8C03\u6574\u987A\u5E8F',\n 'rows.enabled': '\u5F00\u542F\u4EFB\u52A1\u7C7B\u578B',\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.hintNoDescription': '\u6CA1\u6709\u63CF\u8FF0',\n 'rows.hintDuplicateDescription': '\u63CF\u8FF0\u548C\u522B\u7684\u884C\u91CD\u590D',\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.dependsOn': '\u8BF7\u5728\u300C\u63D2\u4EF6 \u2192 \u5B98\u65B9 \u2192 \u5B50\u667A\u80FD\u4F53\u300D\u4E2D\u5F00\u542F\u6A21\u578B\u9009\u62E9\u5E76\u6DFB\u52A0\u5141\u8BB8\u7684\u6A21\u578B\u3002\u5173\u95ED\u65F6\uFF0C\u5B50\u4EE3\u7406\u6CBF\u7528\u539F\u8DEF\u7EBF\u3002',\n 'rows.allowedEmpty': '\u5B98\u65B9\u914D\u7F6E\u91CC\u8FD8\u6CA1\u6709\u53EF\u9009\u6A21\u578B\uFF0C\u586B\u4E0A\u4E4B\u540E\u8FD9\u91CC\u624D\u6709\u53EF\u9009\u9879\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\u4F1A\u66FF\u6362\u4E0B\u9762\u90A3\u5F20\u8868\uFF0C\u5E76\u7ACB\u5373\u5199\u5165\u3002',\n 'rows.importPlaceholder': '[\\n { \"description\": \"\u2026\u2026\", \"provider\": \"\u2026\u2026\", \"model\": \"\u2026\u2026\", \"effort\": \"\u2026\u2026\" }\\n]',\n 'rows.importApply': '\u66FF\u6362\u5E76\u5199\u5165',\n 'rows.importCancel': '\u53D6\u6D88',\n 'rows.importClose': '\u5173\u95ED',\n 'rows.importBadJson': '\u8FD9\u4E0D\u662F\u5408\u6CD5\u7684 JSON\u3002',\n 'rows.importBadShape': '\u4EFB\u52A1\u7C7B\u578B\u7684\u6587\u5B57\u5B57\u6BB5\u5FC5\u987B\u662F\u6587\u5B57\uFF0Cenabled \u5FC5\u987B\u662F true \u6216 false\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.failed': '\u9884\u89C8\u8BFB\u4E0D\u51FA\u6765\u3002',\n 'write.failed': '\u6CA1\u5199\u8FDB\u53BB\uFF1A{error}',\n 'write.invalid': '\u8FD9\u6B21\u5199\u5165\u6CA1\u88AB\u63A5\u53D7\u3002',\n 'write.refused': '\u5BBF\u4E3B\u6CA1\u6709\u63A5\u53D7\u8FD9\u6B21\u5199\u5165\u3002',\n 'log.title': '\u5224\u65AD\u65E5\u5FD7',\n 'log.desc': '\u663E\u793A\u6700\u8FD1 10 \u6B21\u5224\u65AD\u3002\u70B9\u5F00\u4E00\u884C\u67E5\u770B\u5F53\u6B21\u8BF7\u6C42\u7684\u7EDF\u8BA1\u3002',\n 'log.empty': '\u8FD8\u6CA1\u6709\u5224\u65AD\u8FC7\u3002',\n 'log.colResult': '\u7ED3\u679C',\n 'log.colChoice': '\u9009\u62E9',\n 'log.colTime': '\u65F6\u95F4',\n 'log.colLatency': '\u8017\u65F6',\n 'log.resultJudged': '\u7C7B\u578B {id}',\n 'log.resultHistorical': '\u5F53\u65F6\u7684\u7C7B\u578B {id}',\n 'log.resultInherited': '\u672A\u5224\u6210',\n 'log.promptTitle': '\u5224\u65AD\u8BF7\u6C42\u7EDF\u8BA1',\n 'log.promptDesc': '\u5224\u65AD\u6A21\u578B\u3001\u53EF\u9009\u7C7B\u578B\u6570\u548C\u8F93\u5165\u957F\u5EA6\u3002',\n 'log.promptClose': '\u5173\u95ED',\n 'log.promptEmpty': '\u8FD9\u6B21\u6CA1\u6709\u5C1D\u8BD5\u53D1\u9001\u5224\u65AD\u8BF7\u6C42\u3002',\n 'log.copyAnalysis': '\u5206\u6790\u5224\u65AD\u7ED3\u679C',\n 'log.analysisPrompt': '\u8BF7\u5206\u6790 DSH \u5BB6\u76EE\u5F55\uFF08DSH_HOME\uFF0C\u9ED8\u8BA4 ~/.dsh\uFF09\u4E0B dsh-subagent-judge-dispatch/judgements.json \u4E2D\u6700\u8FD1 100 \u6761\u5224\u65AD\u8BB0\u5F55\u3002\u7EDF\u8BA1\u5404\u7C7B\u578B\u7684\u5224\u65AD\u6B21\u6570\u3001\u5931\u8D25\u539F\u56E0\u548C\u8017\u65F6\u3002\u6E05\u5355\u6539\u52A8\u540E\u7C7B\u578B\u7F16\u53F7\u53EF\u80FD\u53D8\u5316\uFF0C\u4EC5\u51ED\u8FD9\u4E9B\u6307\u6807\u65E0\u6CD5\u5224\u65AD\u5355\u4E2A\u4EFB\u52A1\u662F\u5426\u88AB\u6B63\u786E\u5F52\u7C7B\u3002',\n 'log.analysisCopied': '\u5DF2\u590D\u5236\u5206\u6790\u63D0\u793A\u8BCD\u3002',\n 'log.analysisCopyFailed': '\u590D\u5236\u5230\u526A\u8D34\u677F\u6CA1\u6210\u529F\u3002',\n 'log.refresh': '\u5237\u65B0',\n 'log.loadFailed': '\u65E5\u5FD7\u8BFB\u4E0D\u51FA\u6765\u3002',\n 'log.typeKey': '\u7C7B\u578B\u6807\u8BC6\uFF1A{key}\uFF1B\u7F16\u53F7\u662F\u5224\u65AD\u65F6\u7684\u7F16\u53F7\u3002',\n 'log.legacyType': '\u8FD9\u662F\u5F53\u65F6\u7684\u7F16\u53F7\uFF1B\u6E05\u5355\u4FEE\u6539\u540E\u65E0\u6CD5\u786E\u5B9A\u539F\u6765\u7684\u7C7B\u578B\u3002',\n 'sample.title': '\u8BD5\u5224\u6837\u4F8B\u4EFB\u52A1',\n 'sample.desc': '\u53D1\u9001\u540E\uFF0C\u8FD9\u6BB5\u6587\u5B57\u548C\u5DF2\u4FDD\u5B58\u7684\u7C7B\u578B\u6E05\u5355\u4F1A\u53D1\u7ED9\u914D\u7F6E\u7684\u5224\u65AD\u670D\u52A1\u3002\u4F7F\u7528\u5DF2\u4FDD\u5B58\u7684\u8BBE\u7F6E\uFF0C\u4E0D\u4F1A\u6D3E\u51FA\u5B50\u4EE3\u7406\u6216\u5199\u5165\u65E5\u5FD7\u3002',\n 'sample.send': '\u53D1\u9001\u6837\u4F8B\u5E76\u8BD5\u5224',\n 'sample.running': '\u6B63\u5728\u5224\u65AD\u2026',\n 'sample.valid': '\u8DEF\u7EBF\u6821\u9A8C\u901A\u8FC7\u3002',\n 'sample.failed': '\u5224\u65AD\u6216\u8DEF\u7EBF\u6821\u9A8C\u5931\u8D25\uFF1A',\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;;;ACCO,IAAM,kBAAkB;AACxB,IAAM,qBAAqB;AAK3B,SAAS,WAAW,WAAoB,UAAmB,WAA6B;AAC7F,MAAI,cAAc,UAAa,cAAc,QAAQ,OAAO,cAAc,YACrE,CAAC,OAAO,OAAO,WAAW,SAAS,EAAG,QAAO;AAClD,QAAM,SAAU,UAA+B,SAAS;AACxD,SAAO,OAAO,WAAW,YAAY,SAAS;AAChD;;;ACZA,mBAAoC;AACpC,sCAAuB;AAmBd;AAXF,IAAM,qBAAq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