@lynn123411/dsh-subagent-judge-dispatch 0.6.7 → 0.6.8
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/README.md +20 -20
- package/lib/client.js +26 -88
- package/lib/client.js.map +3 -3
- package/lib/index.js +474 -302
- package/lib/index.js.map +4 -4
- package/package.json +17 -16
package/README.md
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
- **清单由你写**:任务类型是一张表格,每一行写一段判定依据、选一个模型、选一个思考强度。模型从宿主那份「子代理可选用哪些模型」设置里读,强度从该模型自己声明的档位里读:档位读得到时强度栏是下拉,读不到时退回自由填写格。没填完的行、没有描述的行、描述和别的行重复的行,编号下面各有一句提示;它们照常写进配置,只是暂时不生效或判不准。每一行还有一个开关:关掉的行留在清单里,但不参与判断,也不占编号。
|
|
10
10
|
- **只改两样**:只改写子代理使用的模型与思考强度,不改名字、不改标题、不动主对话,其余一概沿用 DSH 原本的派工流程。
|
|
11
|
-
-
|
|
11
|
+
- **判断永不打断派工**:判断和路线校验共用 5 秒。判断服务不可用、答复不符合清单、校验失败或时间用完时,子代理沿用宿主已经解析好的路线。
|
|
12
12
|
- **导入导出**:任务类型清单与判断服务设置都能按纯 JSON 复制走,也能粘贴回来;粘进来的那一份直接替换并立即写入。判断服务那一份只含地址与判断模型,不含密钥。
|
|
13
13
|
- **完整预览**:看一眼真正会发给判断服务的整段内容,派工标签与任务正文那两处标注「派工时才填」。
|
|
14
14
|
- **当场试通**:判断服务的地址填完就能试一下通不通,不用等第一次派工失败。
|
|
15
15
|
- **地址自动补路径**:端点地址填到主机就行,发请求时自动补上 `/v1/systemone`;地址里已经带了 `/v1/systemone` 或 `/systemone` 就原样用,只填到 `/v1` 就只补 `/systemone`。
|
|
16
16
|
- **密钥直接填**:判断服务要用的密钥就填在配置卡片里,存进 DSH 的凭据文件,只写不读;页面不会把它显示回来。
|
|
17
|
-
-
|
|
17
|
+
- **结果日志**:记录结果、路线、时间和耗时。点开一行可看判断模型、可选类型数和输入长度。配置页显示最近 10 条,磁盘最多保留 200 条。
|
|
18
18
|
|
|
19
19
|
## 安装与开关
|
|
20
20
|
|
|
@@ -34,7 +34,7 @@ dsh plugin --profile web add @lynn123411/dsh-subagent-judge-dispatch
|
|
|
34
34
|
|
|
35
35
|
模型与推理等级菜单中可以按会话开关判断;关闭后该会话及其嵌套子代理的派工不判断,也不记日志。插件页的配置卡片可以设置会话默认是否开启,安装后默认开启;会话自己的选择优先于默认值。「记录日志」关掉后照常判断,只是不写日志文件。整条 loader entry 关掉时插件完全不加载。任务类型清单里每一行还有自己的开关,关掉的行不参与判断,也不占编号。
|
|
36
36
|
|
|
37
|
-
宿主半边声明的服务(`inject`):`credentials`、`sessions
|
|
37
|
+
宿主半边声明的服务(`inject`):`credentials`、`sessions`;`connection` 经 `ctx.inject` 取,取不到时插件照常加载、只是没有那三条读取通道;`settings` 同样经 `ctx.inject` 取,用来声明本条目不走宿主自动生成的设置页。
|
|
38
38
|
|
|
39
39
|
客户端半边有两层声明,两层都要写(见 `docs/rules/client-wiring.md`):
|
|
40
40
|
|
|
@@ -64,7 +64,7 @@ dsh plugin --profile web add @lynn123411/dsh-subagent-judge-dispatch
|
|
|
64
64
|
- **草稿按字段保留**:宿主每次发布配置,只有读者改过、且改动与「本页上次看到的已提交值」不同的那一项才留在页面上,其余跟着宿主走。按整节保留会让一次写入把读者没碰过的字段写回去,等于撤掉别的页面刚做的改动。
|
|
65
65
|
- **失败就地报**:写入没落地时,那句错误出现在发起写入的那一节最后一行,两节各报各的;它留到下一次写入真的落地才消失,读者再改一下并离开输入框就会重试,不弹窗打断。密钥写失败只在密钥那一行说一次。
|
|
66
66
|
- **密钥只写不读**:引用名是插件自己的常量 `SUBAGENT_JUDGE_API_KEY`,不是页面填的字段——读者只要把密钥贴进来,不必知道什么是凭据引用。密钥值交给凭据服务之后立刻从页面状态里清掉;页面只显示「已存 / 还没有」。页面没有凭据通道(非回环地址)时,输入框禁用,并有一行字说明原因。
|
|
67
|
-
-
|
|
67
|
+
- **依赖官方配置**:在「插件 → 官方 → 子智能体」开启「允许 Agent 为子智能体选择模型」,并添加允许的提供方和模型。关闭开关、列表不可用、模型不在允许列表中,或模型不支持选定的推理等级时,子代理沿用原路线。
|
|
68
68
|
|
|
69
69
|
## 实现
|
|
70
70
|
|
|
@@ -76,11 +76,13 @@ dsh plugin --profile web add @lynn123411/dsh-subagent-judge-dispatch
|
|
|
76
76
|
|
|
77
77
|
先是派出这次活的标签(`subagent/descriptor` 的 `label`,宿主用它当子会话标题),再是任务正文原文,两段之间空一行。标签只有三五个词,是派工方写的摘要;正文才是「这个活到底要做什么」。只发标签,判断只能看出个大概方向;只发正文,遇到开头是套话的任务就丢了派工方的意图。
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
新建时,宿主在 `agent/created` 监听器返回后才投递初始任务。插件只在直接父会话当前步骤查找尚未结束的 `subagent` 或 `subagent_fork` 调用,要求派工描述与子代理 `subagent/descriptor` 的标签唯一匹配。直接调用和 `run_code` 内部调用分别对应 `tool/call` 与 `tool/ptc-dispatch-start`。找不到唯一匹配时,子代理沿用原路线。
|
|
80
|
+
|
|
81
|
+
恢复时,插件通过父会话的 `subagent/catalog` 定位本子代理的原始派工,并核对初始任务。初始任务的来源是直接父会话发出的 `agent-message`,可以出现在收件箱的 `agent/inbox/spliced` 中,也可以已经写成 `user/message`。取正文时去掉开头的发件人提示和末尾的回报说明。找不到原始派工的恢复会话沿用原路线。
|
|
80
82
|
|
|
81
83
|
只读子代理自己的事件:`ownEvents()`(或 `snapshotEvents(inheritedEventCount)`)是子代理自己产生的那一段。不能从日志开头读——叉出来的子代理,日志前缀是父代理已完成的回合,从开头读会把祖先的标签和父对话的第一条消息送给判断模型。
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
发给判断服务的长任务保留开头 1400 字和结尾 400 字,中间标明省略字数。
|
|
84
86
|
|
|
85
87
|
### 判断协议
|
|
86
88
|
|
|
@@ -88,9 +90,9 @@ dsh plugin --profile web add @lynn123411/dsh-subagent-judge-dispatch
|
|
|
88
90
|
|
|
89
91
|
预览、真正发出的请求与答复匹配读的是同一份编号:关掉或没填全的行在这三处都不出现,所以预览里是编号 2 的那一行,就是答复「2」会选中的那一行。
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
提供方、模型和推理等级一次写入。派工调用显式指定路线,或子会话已经记录了模型选择或使用记录时,插件保留原路线。写入前,插件查宿主当前的子代理允许列表,并用 `llm.resolveCallConfig()` 校验这组提供方、模型和推理等级。模型校验返回后再核对允许列表,避免应用在校验期间撤销的路线。
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
判断失败或预检失败时,子代理沿用宿主已解析好的路线。
|
|
94
96
|
|
|
95
97
|
端点地址补全:页面只存读者填的那一段地址,真正请求的地址在发请求时算出来——已经以 `/v1/systemone` 或 `/systemone` 结尾就原样用,只填到 `/v1` 就补 `/systemone`,更短的补 `/v1/systemone`。地址与模型两格都不预填值,占位提示给出例子。
|
|
96
98
|
|
|
@@ -98,11 +100,9 @@ dsh plugin --profile web add @lynn123411/dsh-subagent-judge-dispatch
|
|
|
98
100
|
|
|
99
101
|
### 日志
|
|
100
102
|
|
|
101
|
-
判断日志写在 `~/.dsh/dsh-subagent-judge-dispatch/judgements.json`(跟随 `DSH_HOME
|
|
102
|
-
|
|
103
|
-
表格「子代理」一栏只放派工标签(没有标签时退回正文开头,截到 60 字),不把判断模型读过的那一整段塞回去——那一整段在同一行的弹窗里能看到。日志是一张六列表:结果(`类型 3` / `未判成`)、选择(`模型 · 强度`,悬停补上供应商)、主代理、子代理、时间、耗时。结果在最左,读者扫一眼先看「判成了没有」;选择一栏只写各条之间真正不同的两样,供应商几乎每行都一样,悬停才把整段路 `供应商 · 模型 · 强度` 写出来。没判成的原因同样不在格子里展开,悬停才说——那一列宽度是给编号留的。放不下的格子截断,气泡用宿主的 `Tooltip`(原生 `title` 键盘够不到)。
|
|
103
|
+
判断日志写在 `~/.dsh/dsh-subagent-judge-dispatch/judgements.json`(跟随 `DSH_HOME`)。多个进程在同一个文件锁内读取并合并最新记录,再原子替换文件。
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
「选择」列显示模型和推理等级,悬停可以查看提供方。「未判成」结果的悬停提示说明失败原因。点开日志行可看当次请求的数值和模型信息。日志不保存任务正文、派工标签、会话标题或判断条件。日志页的「分析判断结果」可复制一段统计最近 100 条日志的请求。
|
|
106
106
|
|
|
107
107
|
### 导入导出
|
|
108
108
|
|
|
@@ -126,13 +126,13 @@ dsh plugin --profile web add @lynn123411/dsh-subagent-judge-dispatch
|
|
|
126
126
|
|
|
127
127
|
## 限制
|
|
128
128
|
|
|
129
|
-
-
|
|
129
|
+
- 判断服务和宿主路线校验共用 5 秒,时间用完时沿用原路线。
|
|
130
130
|
- 编号按位置算:关掉一行、填完一行或换一个顺序,后面的编号都会重排;日志里早先记下的编号可能因此指向另一行。
|
|
131
131
|
- 每个子代理只判一次,插件卸载或重载后这份记录清空。
|
|
132
|
-
-
|
|
132
|
+
- 宿主未开启子代理模型选择时,派工沿用宿主原路线。
|
|
133
133
|
- 日志文件留最近 200 条,配置页只列最近 10 条。
|
|
134
134
|
- 判断协议里的截断标记与失败原因用英文,不随界面语言变。
|
|
135
|
-
-
|
|
135
|
+
- 任务类型的模型选项来自官方子代理设置中的允许列表。
|
|
136
136
|
|
|
137
137
|
## 验证
|
|
138
138
|
|
|
@@ -142,11 +142,11 @@ cd plugins/dsh-subagent-judge-dispatch && pnpm check
|
|
|
142
142
|
|
|
143
143
|
`check` = `typecheck` + `build` + 五个自检 + `assert:lib-untracked`:
|
|
144
144
|
|
|
145
|
-
- **`scripts/test-decision.mjs`**
|
|
146
|
-
- **`scripts/smoke-host.mjs`**
|
|
145
|
+
- **`scripts/test-decision.mjs`** 直接验证判断请求、答复匹配、超时、类型编号与日志保留。用四个进程同时追加日志,核对磁盘保留完整的最新 200 条。
|
|
146
|
+
- **`scripts/smoke-host.mjs`** 用 Cordis `Context` 验证 `agent/created` 的派工关联、原路线保留、实时允许名单、推理等级校验、共享时限与无任务正文的日志。覆盖直接调用和程序化派工、任务还在收件箱或已落盘的恢复、兄弟会话消息、无关调用、已结束调用、重复描述和明确选择。
|
|
147
147
|
- **`scripts/smoke-client.mjs`** 按 Web shell 的方式装载 `lib/client.js`(`window.__ModuleLoader__.load` 桩件),喂假 cordis 服务:断言卡片注册进 `plugins.bundle.config`、key 是包名、走 `slots.inject`、读本插件自己的命名空间与宿主那份「子代理可选用哪些模型」设置、以宿主在服务本条目为挂载条件、样式表在 `apply()` 追加一次且没写死色值,以及 zh/en 键集一致。它的守卫带反例断言(「守卫拒绝未声明的服务读取」必须抛)。
|
|
148
|
-
- **`scripts/test-card.mjs`** 打的是 `src/`,守配置卡片这层状态机:文字格只在提交时写且只写改过的那一项、开关与行的增删当场写、连续两次提交合并成一次写、没填完的行照常写入而页面只在行上提示、宿主回 `false` 算没写进去、密钥跟着判断服务那次提交一起写且写的是固定引用名、密钥值从不进页面状态、草稿按字段保留,「选择」一列只写模型与强度、悬停才带上供应商,清单与判断服务设置各自的 JSON
|
|
149
|
-
- **`scripts/test-render.mjs`** 用真 react 把卡片画进 jsdom
|
|
148
|
+
- **`scripts/test-card.mjs`** 打的是 `src/`,守配置卡片这层状态机:文字格只在提交时写且只写改过的那一项、开关与行的增删当场写、连续两次提交合并成一次写、没填完的行照常写入而页面只在行上提示、宿主回 `false` 算没写进去、密钥跟着判断服务那次提交一起写且写的是固定引用名、密钥值从不进页面状态、草稿按字段保留,「选择」一列只写模型与强度、悬停才带上供应商,清单与判断服务设置各自的 JSON 导出与导入认什么、拒什么。
|
|
149
|
+
- **`scripts/test-render.mjs`** 用真 react 把卡片画进 jsdom:没有保存按钮,两节标题行的动作顺序、行上只剩「删掉」、预览单独在卡片最下面那条栏里;任务类型一节说明官方配置的位置;文字格离开才写、写的是这一格的新值,行的问题写在编号列下方;日志表是四列且顺序固定,结果写「类型 3」/「未判成」,选择格只写模型与强度、供应商在悬停气泡里,导出把清单按纯 JSON 写进剪贴板、导入直接替换并立即写入且三种坏输入各报各的话,没判成的原因挂在宿主的 `Tooltip` 上而不是原生 `title`。`ui-primitives` 走替身(真组件是浏览器 ESM、带 `.css` 导入,Node 里跑不起来),所以它验的是本插件的视图结构,外观与浮层定位要在真浏览器里看。
|
|
150
150
|
- **`assert-lib-untracked.mjs`**:`lib/` 是构建镜像,不入 git。
|
|
151
151
|
|
|
152
|
-
要肉眼确认页面上的形态,用仓库的 `node tools/verify-client.mjs dsh-subagent-judge-dispatch --needle '<你新写的文案>'`。
|
|
152
|
+
要肉眼确认页面上的形态,用仓库的 `node tools/verify-client.mjs dsh-subagent-judge-dispatch --needle '<你新写的文案>'`。
|
package/lib/client.js
CHANGED
|
@@ -129,29 +129,6 @@ function setupPluginPage(slots, register) {
|
|
|
129
129
|
return slots.inject(BUNDLE_CONFIG_SLOT, register);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
// src/client/settings/official-settings.ts
|
|
133
|
-
var SUBAGENT_ITEM_ID = "subagent";
|
|
134
|
-
var OPEN_BUDGET_MS = 1500;
|
|
135
|
-
var OPEN_POLL_MS = 50;
|
|
136
|
-
function createOfficialSettingsOpener(navigation) {
|
|
137
|
-
if (navigation === void 0 || typeof navigation.openList !== "function") return null;
|
|
138
|
-
return () => {
|
|
139
|
-
navigation.openList();
|
|
140
|
-
const deadline = Date.now() + OPEN_BUDGET_MS;
|
|
141
|
-
const press = () => {
|
|
142
|
-
const card = document.querySelector(
|
|
143
|
-
`[data-plugin-item="${SUBAGENT_ITEM_ID}"] button`
|
|
144
|
-
);
|
|
145
|
-
if (card !== null) {
|
|
146
|
-
card.click();
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (Date.now() < deadline) setTimeout(press, OPEN_POLL_MS);
|
|
150
|
-
};
|
|
151
|
-
setTimeout(press, 0);
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
132
|
// src/server/judge-prompt.ts
|
|
156
133
|
function isSelectableRow(row) {
|
|
157
134
|
return row.provider.trim() !== "" && row.model.trim() !== "" && row.effort.trim() !== "";
|
|
@@ -406,7 +383,6 @@ var DispatchCardStore = class {
|
|
|
406
383
|
credentials = null;
|
|
407
384
|
offForm = null;
|
|
408
385
|
offAllowed = null;
|
|
409
|
-
officialSettingsOpener = null;
|
|
410
386
|
translate = (key) => key;
|
|
411
387
|
/** Bind the Host services; re-binding detaches the previous subscriptions. */
|
|
412
388
|
attach(options) {
|
|
@@ -417,7 +393,6 @@ var DispatchCardStore = class {
|
|
|
417
393
|
this.session = options.session;
|
|
418
394
|
this.remote = options.remote;
|
|
419
395
|
this.credentials = options.credentials;
|
|
420
|
-
this.officialSettingsOpener = options.officialSettingsOpener;
|
|
421
396
|
this.translate = options.t;
|
|
422
397
|
this.state = {
|
|
423
398
|
...this.state,
|
|
@@ -726,14 +701,6 @@ var DispatchCardStore = class {
|
|
|
726
701
|
return { ok: false, error: message };
|
|
727
702
|
}
|
|
728
703
|
}
|
|
729
|
-
/** Whether this page can open the official setting the type list depends on. */
|
|
730
|
-
canOpenOfficialSettings() {
|
|
731
|
-
return this.officialSettingsOpener !== null;
|
|
732
|
-
}
|
|
733
|
-
/** Open the official setting the type list depends on. */
|
|
734
|
-
openOfficialSettings() {
|
|
735
|
-
this.officialSettingsOpener?.();
|
|
736
|
-
}
|
|
737
704
|
/** Read the runtime log from the Host. */
|
|
738
705
|
async refreshLog() {
|
|
739
706
|
if (this.remote === null) return;
|
|
@@ -833,6 +800,7 @@ var en = {
|
|
|
833
800
|
"reason.timeout": "it did not answer within 5 seconds",
|
|
834
801
|
"reason.unmatched": "the answer named no listed type",
|
|
835
802
|
"reason.incomplete": "the selected type is not filled in",
|
|
803
|
+
"reason.unavailable-route": "the selected model or effort is unavailable",
|
|
836
804
|
"reason.other": "other",
|
|
837
805
|
"reason.unknown": "unknown reason",
|
|
838
806
|
"rows.title": "Task types",
|
|
@@ -851,8 +819,7 @@ var en = {
|
|
|
851
819
|
"rows.effortPlaceholder": "Not chosen",
|
|
852
820
|
"rows.incomplete": "Not used",
|
|
853
821
|
"rows.descriptionPlaceholder": "What kind of job is this? Write as much as you like.",
|
|
854
|
-
"rows.dependsOn":
|
|
855
|
-
"rows.dependsOnOpen": "Open",
|
|
822
|
+
"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.",
|
|
856
823
|
"rows.allowedEmpty": "The official setting offers no model yet; fill it in and the options appear here.",
|
|
857
824
|
"rows.importOpen": "Import",
|
|
858
825
|
"rows.export": "Export",
|
|
@@ -878,22 +845,20 @@ var en = {
|
|
|
878
845
|
"write.invalid": "This could not be written.",
|
|
879
846
|
"write.refused": "The host did not accept this write.",
|
|
880
847
|
"log.title": "Judgement log",
|
|
881
|
-
"log.desc": "The most recent
|
|
848
|
+
"log.desc": "The 10 most recent judgements. Open an entry to see its request metrics.",
|
|
882
849
|
"log.empty": "No judgement has run yet.",
|
|
883
850
|
"log.colResult": "Result",
|
|
884
851
|
"log.colChoice": "Choice",
|
|
885
|
-
"log.colParent": "Main agent",
|
|
886
|
-
"log.colChild": "Subagent",
|
|
887
852
|
"log.colTime": "Time",
|
|
888
853
|
"log.colLatency": "Took",
|
|
889
854
|
"log.resultJudged": "Type {id}",
|
|
890
855
|
"log.resultInherited": "No match",
|
|
891
|
-
"log.promptTitle": "
|
|
892
|
-
"log.promptDesc": "
|
|
856
|
+
"log.promptTitle": "Judgement request metrics",
|
|
857
|
+
"log.promptDesc": "Judge model, number of offered choices, and input length.",
|
|
893
858
|
"log.promptClose": "Close",
|
|
894
|
-
"log.promptEmpty": "No request was
|
|
895
|
-
"log.copyAnalysis": "
|
|
896
|
-
"log.analysisPrompt": "Analyze the latest 100
|
|
859
|
+
"log.promptEmpty": "No judge request was attempted.",
|
|
860
|
+
"log.copyAnalysis": "Analyze judgement results",
|
|
861
|
+
"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.",
|
|
897
862
|
"log.analysisCopied": "Analysis prompt copied.",
|
|
898
863
|
"log.analysisCopyFailed": "Could not copy to the clipboard.",
|
|
899
864
|
"log.refresh": "Refresh",
|
|
@@ -944,9 +909,10 @@ var zh = {
|
|
|
944
909
|
"judge.probeFail": "\u7528\u4E0D\u4E86\uFF1A{reason}",
|
|
945
910
|
"reason.unconfigured": "\u7AEF\u70B9\u5730\u5740\u6216\u5224\u65AD\u6A21\u578B\u8FD8\u6CA1\u586B",
|
|
946
911
|
"reason.unreachable": "\u8FDE\u4E0D\u4E0A\u8FD9\u4E2A\u5730\u5740",
|
|
947
|
-
"reason.timeout": "\
|
|
912
|
+
"reason.timeout": "\u5224\u65AD\u6216\u8DEF\u7EBF\u6821\u9A8C\u8D85\u8FC7 5 \u79D2",
|
|
948
913
|
"reason.unmatched": "\u7B54\u590D\u5BF9\u4E0D\u4E0A\u6E05\u5355",
|
|
949
914
|
"reason.incomplete": "\u9009\u4E2D\u7684\u7C7B\u578B\u6CA1\u586B\u5168",
|
|
915
|
+
"reason.unavailable-route": "\u9009\u4E2D\u7684\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u5F53\u524D\u4E0D\u53EF\u7528",
|
|
950
916
|
"reason.other": "\u5176\u4ED6",
|
|
951
917
|
"reason.unknown": "\u539F\u56E0\u4E0D\u660E",
|
|
952
918
|
"rows.title": "\u4EFB\u52A1\u7C7B\u578B",
|
|
@@ -965,8 +931,7 @@ var zh = {
|
|
|
965
931
|
"rows.effortPlaceholder": "\u8FD8\u6CA1\u9009",
|
|
966
932
|
"rows.incomplete": "\u4E0D\u751F\u6548",
|
|
967
933
|
"rows.descriptionPlaceholder": "\u8FD9\u662F\u54EA\u79CD\u6D3B\uFF1F\u5199\u591A\u5C11\u90FD\u884C\u3002",
|
|
968
|
-
"rows.dependsOn": "\
|
|
969
|
-
"rows.dependsOnOpen": "\u53BB\u8BBE\u7F6E",
|
|
934
|
+
"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",
|
|
970
935
|
"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",
|
|
971
936
|
"rows.importOpen": "\u5BFC\u5165",
|
|
972
937
|
"rows.export": "\u5BFC\u51FA",
|
|
@@ -992,22 +957,20 @@ var zh = {
|
|
|
992
957
|
"write.invalid": "\u8FD9\u6B21\u5199\u5165\u6CA1\u88AB\u63A5\u53D7\u3002",
|
|
993
958
|
"write.refused": "\u5BBF\u4E3B\u6CA1\u6709\u63A5\u53D7\u8FD9\u6B21\u5199\u5165\u3002",
|
|
994
959
|
"log.title": "\u5224\u65AD\u65E5\u5FD7",
|
|
995
|
-
"log.desc": "\u6700\u8FD1 10 \
|
|
960
|
+
"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",
|
|
996
961
|
"log.empty": "\u8FD8\u6CA1\u6709\u5224\u65AD\u8FC7\u3002",
|
|
997
962
|
"log.colResult": "\u7ED3\u679C",
|
|
998
963
|
"log.colChoice": "\u9009\u62E9",
|
|
999
|
-
"log.colParent": "\u4E3B\u4EE3\u7406",
|
|
1000
|
-
"log.colChild": "\u5B50\u4EE3\u7406",
|
|
1001
964
|
"log.colTime": "\u65F6\u95F4",
|
|
1002
965
|
"log.colLatency": "\u8017\u65F6",
|
|
1003
966
|
"log.resultJudged": "\u7C7B\u578B {id}",
|
|
1004
967
|
"log.resultInherited": "\u672A\u5224\u6210",
|
|
1005
|
-
"log.promptTitle": "\
|
|
1006
|
-
"log.promptDesc": "\
|
|
968
|
+
"log.promptTitle": "\u5224\u65AD\u8BF7\u6C42\u7EDF\u8BA1",
|
|
969
|
+
"log.promptDesc": "\u5224\u65AD\u6A21\u578B\u3001\u53EF\u9009\u7C7B\u578B\u6570\u548C\u8F93\u5165\u957F\u5EA6\u3002",
|
|
1007
970
|
"log.promptClose": "\u5173\u95ED",
|
|
1008
|
-
"log.promptEmpty": "\u8FD9\u6B21\
|
|
1009
|
-
"log.copyAnalysis": "\
|
|
1010
|
-
"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\
|
|
971
|
+
"log.promptEmpty": "\u8FD9\u6B21\u6CA1\u6709\u5C1D\u8BD5\u53D1\u9001\u5224\u65AD\u8BF7\u6C42\u3002",
|
|
972
|
+
"log.copyAnalysis": "\u5206\u6790\u5224\u65AD\u7ED3\u679C",
|
|
973
|
+
"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",
|
|
1011
974
|
"log.analysisCopied": "\u5DF2\u590D\u5236\u5206\u6790\u63D0\u793A\u8BCD\u3002",
|
|
1012
975
|
"log.analysisCopyFailed": "\u590D\u5236\u5230\u526A\u8D34\u677F\u6CA1\u6210\u529F\u3002",
|
|
1013
976
|
"log.refresh": "\u5237\u65B0",
|
|
@@ -1108,11 +1071,7 @@ var CARD_CSS = `
|
|
|
1108
1071
|
/* \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 */
|
|
1109
1072
|
.dsh-judge-actions-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
1110
1073
|
/* \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 */
|
|
1111
|
-
.dsh-judge-dependency { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; }
|
|
1112
|
-
.dsh-judge-dependency .dsh-judge-desc { max-width: none; }
|
|
1113
1074
|
/* \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 */
|
|
1114
|
-
.dsh-judge-link { height: auto; padding: 0 2px; color: var(--dsw-alias-link); font: var(--dsw-font-xxs-12); }
|
|
1115
|
-
.dsh-judge-link:hover { color: var(--dsw-alias-link); background: none; text-decoration: underline; }
|
|
1116
1075
|
/* \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 */
|
|
1117
1076
|
.dsh-judge-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
|
|
1118
1077
|
.dsh-judge-hint { color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); }
|
|
@@ -1139,9 +1098,8 @@ var CARD_CSS = `
|
|
|
1139
1098
|
.dsh-judge-row-off .dsh-judge-field { opacity: 0.6; }
|
|
1140
1099
|
.dsh-judge-cell-actions { display: flex; gap: 6px; }
|
|
1141
1100
|
.dsh-judge-log { display: flex; flex-direction: column; gap: 4px; font: var(--dsw-font-xxs-12); }
|
|
1142
|
-
/*
|
|
1143
|
-
|
|
1144
|
-
.dsh-judge-log-row { display: grid; grid-template-columns: 72px minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 62px 74px; gap: 8px; align-items: center; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: var(--dsw-radius-sm); cursor: pointer; color: inherit; font: inherit; }
|
|
1101
|
+
/* Allow the model column to shrink so long names can be clipped. */
|
|
1102
|
+
.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; }
|
|
1145
1103
|
.dsh-judge-cell-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1146
1104
|
.dsh-judge-log-row:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
1147
1105
|
.dsh-judge-log-head { font-weight: 600; color: var(--dsw-alias-label-tertiary); cursor: default; }
|
|
@@ -1156,14 +1114,15 @@ var CARD_CSS = `
|
|
|
1156
1114
|
.dsh-judge-paste:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary); }
|
|
1157
1115
|
`;
|
|
1158
1116
|
function injectCardStyles() {
|
|
1159
|
-
if (typeof document === "undefined") return
|
|
1160
|
-
|
|
1117
|
+
if (typeof document === "undefined" || document.getElementById(STYLE_ID) !== null) return () => {
|
|
1118
|
+
};
|
|
1161
1119
|
const element = document.createElement("style");
|
|
1162
1120
|
element.id = STYLE_ID;
|
|
1163
1121
|
element.dataset.plugin = PLUGIN_NAME;
|
|
1164
1122
|
element.dataset.pluginCss = `${PLUGIN_NAME}/settings/ui`;
|
|
1165
1123
|
element.textContent = CARD_CSS;
|
|
1166
1124
|
document.head.appendChild(element);
|
|
1125
|
+
return () => element.remove();
|
|
1167
1126
|
}
|
|
1168
1127
|
var STYLE_ID = "dsh-subagent-judge-dispatch-styles";
|
|
1169
1128
|
var PLUGIN_NAME = "@lynn123411/dsh-subagent-judge-dispatch";
|
|
@@ -1548,19 +1507,7 @@ function JudgeDispatchPanel(props) {
|
|
|
1548
1507
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => dispatchCardStore.addRow(), children: t("rows.add") })
|
|
1549
1508
|
] })
|
|
1550
1509
|
] }),
|
|
1551
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
1552
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-desc", children: t("rows.dependsOn") }),
|
|
1553
|
-
dispatchCardStore.canOpenOfficialSettings() && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1554
|
-
import_dsh_client_ui_primitives2.Button,
|
|
1555
|
-
{
|
|
1556
|
-
variant: "ghost",
|
|
1557
|
-
size: "sm",
|
|
1558
|
-
className: "dsh-judge-link",
|
|
1559
|
-
onClick: () => dispatchCardStore.openOfficialSettings(),
|
|
1560
|
-
children: t("rows.dependsOnOpen")
|
|
1561
|
-
}
|
|
1562
|
-
)
|
|
1563
|
-
] }),
|
|
1510
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("rows.dependsOn") }),
|
|
1564
1511
|
state.models.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-off", children: t("rows.allowedEmpty") }),
|
|
1565
1512
|
state.rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("rows.empty") }),
|
|
1566
1513
|
state.rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { className: "dsh-judge-table", children: [
|
|
@@ -1594,8 +1541,6 @@ function JudgeDispatchPanel(props) {
|
|
|
1594
1541
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-log-row dsh-judge-log-head", children: [
|
|
1595
1542
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colResult") }),
|
|
1596
1543
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colChoice") }),
|
|
1597
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colParent") }),
|
|
1598
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colChild") }),
|
|
1599
1544
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colTime") }),
|
|
1600
1545
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colLatency") })
|
|
1601
1546
|
] }),
|
|
@@ -1613,8 +1558,6 @@ function JudgeDispatchPanel(props) {
|
|
|
1613
1558
|
children: [
|
|
1614
1559
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: result.text, hint: result.hint }),
|
|
1615
1560
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: describeModel(entry) || "\u2014", hint: describeChoice(entry) }),
|
|
1616
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: entry.parentTitle || "\u2014" }),
|
|
1617
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: entry.childLabel || "\u2014" }),
|
|
1618
1561
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: new Date(entry.at).toLocaleTimeString() }),
|
|
1619
1562
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("ms").replace("{value}", String(entry.latencyMs)) })
|
|
1620
1563
|
]
|
|
@@ -1697,10 +1640,10 @@ function JudgeDispatchPanel(props) {
|
|
|
1697
1640
|
closeLabel: t("log.promptClose"),
|
|
1698
1641
|
description: t("log.promptDesc"),
|
|
1699
1642
|
className: "dsh-judge-modal",
|
|
1700
|
-
children: detail !== null && (detail.
|
|
1643
|
+
children: detail !== null && (detail.metrics === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("log.promptEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-prompt", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1701
1644
|
import_dsh_client_ui_primitives2.CodeBlock,
|
|
1702
1645
|
{
|
|
1703
|
-
code: detail.
|
|
1646
|
+
code: JSON.stringify(detail.metrics, null, 2),
|
|
1704
1647
|
copyLabel: t("preview.copy"),
|
|
1705
1648
|
copiedLabel: t("preview.copied")
|
|
1706
1649
|
}
|
|
@@ -1722,11 +1665,6 @@ function setupSettingsUi(ctx) {
|
|
|
1722
1665
|
remote: createDispatchRemote(),
|
|
1723
1666
|
// The judgement key is written here; its value never rides a response.
|
|
1724
1667
|
credentials: ctx.remote?.credentials ?? null,
|
|
1725
|
-
// The type list's options come from the host's own official setting; this
|
|
1726
|
-
// is the one jump to it the page can make.
|
|
1727
|
-
officialSettingsOpener: createOfficialSettingsOpener(
|
|
1728
|
-
ctx.get?.("pluginNavigation")
|
|
1729
|
-
),
|
|
1730
1668
|
t
|
|
1731
1669
|
});
|
|
1732
1670
|
} catch (error) {
|
|
@@ -1749,7 +1687,7 @@ function setupSettingsUi(ctx) {
|
|
|
1749
1687
|
var name = "@lynn123411/dsh-subagent-judge-dispatch";
|
|
1750
1688
|
var inject = ["slots", "configForms", "remote", "remote.session", "remote.credentials", "locale"];
|
|
1751
1689
|
function apply2(ctx) {
|
|
1752
|
-
injectCardStyles
|
|
1690
|
+
ctx.effect(injectCardStyles, "dsh-subagent-judge-dispatch: card styles");
|
|
1753
1691
|
apply(ctx);
|
|
1754
1692
|
ctx.slots.inject(MODEL_OPTIONS_SLOT, () => ctx.slots.register({
|
|
1755
1693
|
name: MODEL_OPTIONS_SLOT,
|