@hukj/dsh-subagent-model-tags 0.0.0-stage → 1.0.0
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/LICENSE +21 -0
- package/README.md +43 -2
- package/client.js +344 -0
- package/cordis.patch.yml +3 -0
- package/docs/DETAIL.md +1 -0
- package/docs/preview.svg +16 -0
- package/icon.svg +11 -0
- package/index.js +2 -0
- package/locale/de.json +7 -0
- package/locale/en.json +7 -0
- package/locale/es.json +7 -0
- package/locale/fr.json +7 -0
- package/locale/ja.json +7 -0
- package/locale/pt.json +7 -0
- package/locale/ru.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +43 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The subagent-models contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-subagent-model-tags
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A DeepSeek Harness plugin that shows each subagent's model name in the session-header subagent panels, and widens those panels from 360 px to 460 px.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## What it does
|
|
8
|
+
|
|
9
|
+
- Adds each subagent's model name on its row's name line — the second line when the row shows a description — in every subagent panel: the root session's subagent panel, a subagent conversation's sibling switcher, and its own children panel. The name is written as `provider/model · reasoning effort`, at every nesting level.
|
|
10
|
+
- A subagent with no recorded model, and external subagents that have no local session, show `—`.
|
|
11
|
+
- Widens the subagent panels to 460 px (still bounded by the window width).
|
|
12
|
+
|
|
13
|
+
The model name comes from each subagent session's `modelSelection` projection, which the Harness records durably, so it shows what the subagent actually runs with rather than what a parent was asked for.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
Requires DeepSeek Harness `0.2.2-rc.5` and later `0.2.x`.
|
|
18
|
+
|
|
19
|
+
- **Published package**: open **Plugins** in the Web sidebar, choose **Add plugin**, and enter `@hukj/dsh-subagent-model-tags`. The Plugin Manager picks the registry through its own configuration and falls back through the configured registries.
|
|
20
|
+
- **Local development**: enter the absolute path of this directory in the same dialog.
|
|
21
|
+
|
|
22
|
+
Then enable the bundle if it is switched off. The change takes effect after a page refresh.
|
|
23
|
+
|
|
24
|
+
## Limitations
|
|
25
|
+
|
|
26
|
+
- The model name is injected as text into the panel's rendered rows, so a future DSH panel change can silently stop it. The plugin writes a name onto a row only when it can pair every rendered row against a catalog it knows (the conversation's own or an ancestor's) and verify each paired row's displayed label; a panel that verifies against nothing stays untouched instead of showing a wrong model.
|
|
27
|
+
- Two catalogs with identical row labels in the same order could still cross-match; in practice that requires two identical agent sets on the same chain.
|
|
28
|
+
- The panel width is raised through the host's `--dsh-subagent-menu-width` variable; if the host restructures the panel, the width rule may stop applying.
|
|
29
|
+
- Diagnostics: with a panel open, run `__subagentModelsDebug()` in the page console to see what the last syncs paired and why a candidate root was rejected.
|
|
30
|
+
|
|
31
|
+
## Files
|
|
32
|
+
|
|
33
|
+
| File | Role |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `client.js` | Web client module: panel widening and the two invisible seats that write model names |
|
|
36
|
+
| `index.js` | Inert Host entry |
|
|
37
|
+
| `cordis.patch.yml` | Bundle patch inserting the plugin row |
|
|
38
|
+
| `locale/*.json` | Plugin display metadata in eight languages |
|
|
39
|
+
| `docs/DETAIL.md`, `docs/preview.svg` | Detail page image |
|
|
40
|
+
| `icon.svg` | Plugin icon |
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
MIT
|
package/client.js
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: '@hukj/dsh-subagent-model-tags',
|
|
3
|
+
factory(require) {
|
|
4
|
+
const React = require('react');
|
|
5
|
+
|
|
6
|
+
const BADGE_MARK = 'data-subagent-model-badge';
|
|
7
|
+
|
|
8
|
+
let sessionsService = null;
|
|
9
|
+
let lastDebug = null;
|
|
10
|
+
|
|
11
|
+
/** Badge text for one recorded model selection; null when nothing is recorded. */
|
|
12
|
+
function modelText(selection) {
|
|
13
|
+
if (selection === null || selection === undefined) return null;
|
|
14
|
+
if (typeof selection.model !== 'string' || selection.model === '') return null;
|
|
15
|
+
const prefix = typeof selection.provider === 'string' && selection.provider !== ''
|
|
16
|
+
? selection.provider + '/'
|
|
17
|
+
: '';
|
|
18
|
+
const route = prefix + selection.model;
|
|
19
|
+
return typeof selection.reasoningEffort === 'string' && selection.reasoningEffort !== ''
|
|
20
|
+
? route + ' · ' + selection.reasoningEffort
|
|
21
|
+
: route;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Map every catalog child's session id to its badge text.
|
|
26
|
+
* A value of null means the child is known but has no recorded model yet.
|
|
27
|
+
*/
|
|
28
|
+
function modelMapOf(projections) {
|
|
29
|
+
const map = new Map();
|
|
30
|
+
if (projections === null || typeof projections !== 'object') return map;
|
|
31
|
+
for (const snapshot of Object.values(projections)) {
|
|
32
|
+
const entries = snapshot && snapshot.values ? snapshot.values.subagentCatalog : undefined;
|
|
33
|
+
if (!Array.isArray(entries)) continue;
|
|
34
|
+
for (const entry of entries) {
|
|
35
|
+
const child = projections[entry.id];
|
|
36
|
+
const selection = child && child.values ? child.values.modelSelection : undefined;
|
|
37
|
+
const chosen = (selection && (selection.next || selection.lastUsed)) || null;
|
|
38
|
+
map.set(entry.id, modelText(chosen));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return map;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Pair each rendered row with its catalog entry by walking the panel's tree
|
|
46
|
+
* structure in order, recursing through rendered (expanded) groups. Every
|
|
47
|
+
* nesting level pairs by position, so no displayed-text matching is needed.
|
|
48
|
+
*/
|
|
49
|
+
function collectRows(container, entries, projections, out) {
|
|
50
|
+
if (!Array.isArray(entries) || entries.length === 0) return;
|
|
51
|
+
const nodes = Array.from(container.children).filter(element =>
|
|
52
|
+
element.firstElementChild !== null
|
|
53
|
+
&& element.firstElementChild.getAttribute('role') === 'treeitem');
|
|
54
|
+
let index = 0;
|
|
55
|
+
for (const entry of entries) {
|
|
56
|
+
const node = nodes[index++];
|
|
57
|
+
if (node === undefined) break;
|
|
58
|
+
const row = node.firstElementChild;
|
|
59
|
+
out.push([row, entry]);
|
|
60
|
+
const group = node.querySelector(':scope > [role="group"]');
|
|
61
|
+
if (group !== null) {
|
|
62
|
+
const child = projections[entry.id];
|
|
63
|
+
collectRows(
|
|
64
|
+
group,
|
|
65
|
+
child && child.values ? child.values.subagentCatalog : undefined,
|
|
66
|
+
projections,
|
|
67
|
+
out,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Place or update one row's model badge on the row's name line: inside the
|
|
75
|
+
* secondary name span when the row shows a description, else inside the
|
|
76
|
+
* label span. Appends after the line's text; never inserts between the
|
|
77
|
+
* host's own React children.
|
|
78
|
+
*/
|
|
79
|
+
function applyBadge(row, text) {
|
|
80
|
+
const area = row.querySelector(':scope > div');
|
|
81
|
+
if (area === null) return;
|
|
82
|
+
const content = area.children[1];
|
|
83
|
+
if (!content || content.tagName !== 'SPAN') return;
|
|
84
|
+
const label = content.firstElementChild;
|
|
85
|
+
if (!label || label.tagName !== 'SPAN') return;
|
|
86
|
+
const line = label.nextElementSibling !== null && label.nextElementSibling.tagName === 'SPAN'
|
|
87
|
+
? label.nextElementSibling
|
|
88
|
+
: label;
|
|
89
|
+
if (text === undefined) {
|
|
90
|
+
const stale = content.querySelector(':scope > [' + BADGE_MARK + ']');
|
|
91
|
+
if (stale !== null) stale.remove();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const shown = text === null ? '—' : text;
|
|
95
|
+
let badge = line.querySelector(':scope > [' + BADGE_MARK + ']');
|
|
96
|
+
if (badge === null) {
|
|
97
|
+
badge = document.createElement('span');
|
|
98
|
+
badge.setAttribute(BADGE_MARK, 'true');
|
|
99
|
+
badge.setAttribute('aria-hidden', 'true');
|
|
100
|
+
badge.style.cssText = 'display:inline-block;margin-left:6px;padding:0 6px;'
|
|
101
|
+
+ 'border-radius:999px;background:var(--dsw-alias-interactive-bg-hover);'
|
|
102
|
+
+ 'color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:15px;'
|
|
103
|
+
+ 'font-weight:400;white-space:nowrap;vertical-align:1px;';
|
|
104
|
+
line.appendChild(badge);
|
|
105
|
+
}
|
|
106
|
+
if (text === null) badge.removeAttribute('title');
|
|
107
|
+
else badge.setAttribute('title', text);
|
|
108
|
+
if (badge.textContent !== shown) badge.textContent = shown;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** The displayed primary label a catalog entry renders on its row. */
|
|
112
|
+
function expectedLabel(entry, summaries) {
|
|
113
|
+
const summary = summaries ? summaries[entry.id] : undefined;
|
|
114
|
+
const name = entry.mode === 'continuable' || entry.mode === 'external'
|
|
115
|
+
? entry.name || entry.id
|
|
116
|
+
: entry.id;
|
|
117
|
+
return entry.label || (summary && summary.title) || name;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** The row's displayed primary label text, or null when unavailable. */
|
|
121
|
+
function rowLabel(row) {
|
|
122
|
+
const area = row.querySelector(':scope > div');
|
|
123
|
+
if (area === null) return null;
|
|
124
|
+
const content = area.children[1];
|
|
125
|
+
if (!content || content.tagName !== 'SPAN') return null;
|
|
126
|
+
const label = content.firstElementChild;
|
|
127
|
+
if (!label || label.tagName !== 'SPAN') return null;
|
|
128
|
+
const textNode = label.firstChild;
|
|
129
|
+
if (!textNode || textNode.nodeType !== 3) return null;
|
|
130
|
+
return String(textNode.textContent || '').trim();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Sync the panel we are mounted in by structural row/entry pairing against
|
|
135
|
+
* its known root session's catalog. The root is known, so no verification
|
|
136
|
+
* is needed here; the pairing is positional and complete.
|
|
137
|
+
*/
|
|
138
|
+
function syncHomePanel(panel, rootEntries, projections, models) {
|
|
139
|
+
const pairs = [];
|
|
140
|
+
const tree = panel.querySelector('[role="tree"]');
|
|
141
|
+
if (tree !== null) collectRows(tree, rootEntries, projections, pairs);
|
|
142
|
+
for (const [row, entry] of pairs) {
|
|
143
|
+
applyBadge(row, models.get(entry.id));
|
|
144
|
+
}
|
|
145
|
+
return pairs;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Sync a panel whose seat we are not mounted in: try structural pairing
|
|
150
|
+
* against each candidate root session's catalog; accept a candidate only
|
|
151
|
+
* when it pairs every rendered row AND each paired row's displayed label
|
|
152
|
+
* equals its entry's expected label. When no candidate verifies, the panel
|
|
153
|
+
* is left alone rather than badged with guesses, and the failed attempts
|
|
154
|
+
* are reported for diagnosis.
|
|
155
|
+
*/
|
|
156
|
+
function syncForeignPanel(panel, candidateRoots, projections, summaries, models) {
|
|
157
|
+
const rows = Array.from(panel.querySelectorAll('[role="treeitem"]'));
|
|
158
|
+
if (rows.length === 0) return null;
|
|
159
|
+
const rowLabels = rows.map(row => rowLabel(row));
|
|
160
|
+
const tree = panel.querySelector('[role="tree"]');
|
|
161
|
+
const attempts = [];
|
|
162
|
+
if (tree === null) {
|
|
163
|
+
return { rootId: null, pairs: [], attempts: [{ reason: 'no-tree', rows: rows.length }] };
|
|
164
|
+
}
|
|
165
|
+
for (const rootId of candidateRoots) {
|
|
166
|
+
const snapshot = projections ? projections[rootId] : undefined;
|
|
167
|
+
const entries = snapshot && snapshot.values ? snapshot.values.subagentCatalog : undefined;
|
|
168
|
+
const pairs = [];
|
|
169
|
+
collectRows(tree, entries, projections, pairs);
|
|
170
|
+
if (pairs.length !== rows.length) {
|
|
171
|
+
attempts.push({ rootId, reason: 'count', rows: rows.length, paired: pairs.length,
|
|
172
|
+
rowLabels: rowLabels.slice(0, 12) });
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
const mismatch = pairs.find(([row, entry]) => rowLabel(row) !== expectedLabel(entry, summaries));
|
|
176
|
+
if (mismatch !== undefined) {
|
|
177
|
+
attempts.push({ rootId, reason: 'label', rows: rows.length,
|
|
178
|
+
rowLabel: rowLabel(mismatch[0]),
|
|
179
|
+
expectedLabel: expectedLabel(mismatch[1], summaries),
|
|
180
|
+
entryId: mismatch[1].id, entryName: mismatch[1].name || null });
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
for (const [row, entry] of pairs) applyBadge(row, models.get(entry.id));
|
|
184
|
+
return { rootId, pairs, attempts };
|
|
185
|
+
}
|
|
186
|
+
return { rootId: null, pairs: [], attempts };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** Pull missing model selections for visible paired rows. */
|
|
190
|
+
function refreshMissing(pairs, projections) {
|
|
191
|
+
if (sessionsService === null) return;
|
|
192
|
+
for (const [, entry] of pairs) {
|
|
193
|
+
const child = projections ? projections[entry.id] : undefined;
|
|
194
|
+
if (child && child.values && child.values.modelSelection) continue;
|
|
195
|
+
Promise.resolve(sessionsService.refreshProjections(entry.id)).catch(() => {});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Root-panel footer seat: mounts only while the root session's subagent
|
|
201
|
+
* panel is open and badges that panel's rows by structural pairing.
|
|
202
|
+
*/
|
|
203
|
+
function SubagentModels(props) {
|
|
204
|
+
const anchor = React.useRef(null);
|
|
205
|
+
const useSessions = props.useSessions;
|
|
206
|
+
const projections = useSessions ? useSessions(state => state.projectionsBySession) : undefined;
|
|
207
|
+
const rootEntries = projections && projections[props.sessionId] && projections[props.sessionId].values
|
|
208
|
+
? projections[props.sessionId].values.subagentCatalog
|
|
209
|
+
: undefined;
|
|
210
|
+
const models = React.useMemo(() => modelMapOf(projections), [projections]);
|
|
211
|
+
React.useEffect(() => {
|
|
212
|
+
const anchorElement = anchor.current;
|
|
213
|
+
if (anchorElement === null || models.size === 0) return undefined;
|
|
214
|
+
const home = anchorElement.closest('[data-subagent-panel]');
|
|
215
|
+
if (home === null) return undefined;
|
|
216
|
+
const sync = () => syncHomePanel(home, rootEntries, projections, models);
|
|
217
|
+
const pairs = sync();
|
|
218
|
+
lastDebug = { ...lastDebug, home: {
|
|
219
|
+
rootSessionId: props.sessionId,
|
|
220
|
+
pairedRows: pairs.map(([, entry]) => ({
|
|
221
|
+
id: entry.id,
|
|
222
|
+
name: entry.name || null,
|
|
223
|
+
model: models.get(entry.id) === undefined ? 'unmapped' : models.get(entry.id),
|
|
224
|
+
})),
|
|
225
|
+
} };
|
|
226
|
+
refreshMissing(pairs, projections);
|
|
227
|
+
const observer = new MutationObserver(sync);
|
|
228
|
+
observer.observe(home, { childList: true, subtree: true, characterData: true });
|
|
229
|
+
return () => observer.disconnect();
|
|
230
|
+
}, [models, rootEntries, projections]);
|
|
231
|
+
return React.createElement('span', { ref: anchor, hidden: true });
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Always-mounted header-actions seat: renders in every session header (root
|
|
236
|
+
* and subagent conversations), so it covers every subagent panel. Badges a
|
|
237
|
+
* panel only when one of its candidate root sessions (this conversation's
|
|
238
|
+
* own and its parent's catalogs) verifies against every rendered row; a
|
|
239
|
+
* panel that verifies against nothing stays untouched.
|
|
240
|
+
*/
|
|
241
|
+
function SubagentModelsHeader(props) {
|
|
242
|
+
const useSessions = props.useSessions;
|
|
243
|
+
const useSession = props.useSession;
|
|
244
|
+
const projections = useSessions ? useSessions(state => state.projectionsBySession) : undefined;
|
|
245
|
+
const summaries = useSessions ? useSessions(state => state.byId) : undefined;
|
|
246
|
+
const address = useSession
|
|
247
|
+
? useSession(session => (session.subagent && session.subagent.address) || null)
|
|
248
|
+
: null;
|
|
249
|
+
const models = React.useMemo(() => modelMapOf(projections), [projections]);
|
|
250
|
+
const candidateRoots = React.useMemo(() => {
|
|
251
|
+
/** The parent of a subagent session, from summaries or loaded catalogs. */
|
|
252
|
+
const parentOf = (sid) => {
|
|
253
|
+
const summary = summaries ? summaries[sid] : undefined;
|
|
254
|
+
if (summary && summary.origin === 'subagent' && summary.parentId) return summary.parentId;
|
|
255
|
+
if (projections) {
|
|
256
|
+
for (const id of Object.keys(projections)) {
|
|
257
|
+
const entries = projections[id] && projections[id].values
|
|
258
|
+
? projections[id].values.subagentCatalog
|
|
259
|
+
: undefined;
|
|
260
|
+
if (Array.isArray(entries) && entries.some(one => one.id === sid)) return id;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return null;
|
|
264
|
+
};
|
|
265
|
+
const roots = [];
|
|
266
|
+
const seen = new Set();
|
|
267
|
+
const add = (id) => { if (id && !seen.has(id)) { seen.add(id); roots.push(id); } };
|
|
268
|
+
// Panels in this header can root at the current session or at any
|
|
269
|
+
// ancestor's catalog, so every ancestor must be a candidate.
|
|
270
|
+
add(props.sessionId);
|
|
271
|
+
let cursor = address !== null && address.parentSessionId
|
|
272
|
+
? address.parentSessionId
|
|
273
|
+
: parentOf(props.sessionId);
|
|
274
|
+
for (let guard = 0; cursor !== null && guard < 16; guard++) {
|
|
275
|
+
add(cursor);
|
|
276
|
+
cursor = parentOf(cursor);
|
|
277
|
+
}
|
|
278
|
+
return roots;
|
|
279
|
+
}, [props.sessionId, address, summaries, projections]);
|
|
280
|
+
React.useEffect(() => {
|
|
281
|
+
const sync = () => {
|
|
282
|
+
const allPairs = [];
|
|
283
|
+
const matchedRoots = [];
|
|
284
|
+
const panelReports = [];
|
|
285
|
+
const panels = Array.from(document.querySelectorAll('[data-subagent-panel]'));
|
|
286
|
+
for (const panel of panels) {
|
|
287
|
+
const result = syncForeignPanel(panel, candidateRoots, projections, summaries, models);
|
|
288
|
+
if (result === null) {
|
|
289
|
+
matchedRoots.push('empty');
|
|
290
|
+
panelReports.push({ matchedRoot: 'empty', attempts: [] });
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
matchedRoots.push(result.rootId);
|
|
294
|
+
panelReports.push({ matchedRoot: result.rootId, attempts: result.attempts });
|
|
295
|
+
for (const pair of result.pairs) allPairs.push(pair);
|
|
296
|
+
}
|
|
297
|
+
return { panels: panels.length, matchedRoots, panelReports, pairs: allPairs };
|
|
298
|
+
};
|
|
299
|
+
const result = sync();
|
|
300
|
+
lastDebug = { ...lastDebug, lineage: {
|
|
301
|
+
sessionId: props.sessionId,
|
|
302
|
+
candidateRoots,
|
|
303
|
+
panels: result.panels,
|
|
304
|
+
matchedRoots: result.matchedRoots,
|
|
305
|
+
panelReports: result.panelReports,
|
|
306
|
+
pairedRows: result.pairs.map(([, entry]) => ({
|
|
307
|
+
id: entry.id,
|
|
308
|
+
name: entry.name || null,
|
|
309
|
+
model: models.get(entry.id) === undefined ? 'unmapped' : models.get(entry.id),
|
|
310
|
+
})),
|
|
311
|
+
} };
|
|
312
|
+
refreshMissing(result.pairs, projections);
|
|
313
|
+
const observer = new MutationObserver(() => { sync(); });
|
|
314
|
+
observer.observe(document.body, { childList: true, subtree: true, characterData: true });
|
|
315
|
+
return () => observer.disconnect();
|
|
316
|
+
}, [models, candidateRoots, projections]);
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return {
|
|
321
|
+
inject: ['slots', 'sessions'],
|
|
322
|
+
apply(ctx) {
|
|
323
|
+
sessionsService = ctx.sessions;
|
|
324
|
+
window.__subagentModelsDebug = () => lastDebug;
|
|
325
|
+
ctx.effect(() => {
|
|
326
|
+
const style = document.createElement('style');
|
|
327
|
+
style.textContent = '[data-subagent-panel][role="dialog"]'
|
|
328
|
+
+ '{--dsh-subagent-menu-width:min(460px,calc(100vw - 32px));}';
|
|
329
|
+
document.head.appendChild(style);
|
|
330
|
+
return () => style.remove();
|
|
331
|
+
}, 'subagent-models: panel width');
|
|
332
|
+
ctx.slots.inject('conversation.session.header.actions.subagent.footer', () => ctx.slots.register({
|
|
333
|
+
name: 'conversation.session.header.actions.subagent.footer',
|
|
334
|
+
id: 'subagent-models',
|
|
335
|
+
}, SubagentModels));
|
|
336
|
+
ctx.slots.inject('conversation.session.header.actions', () => ctx.slots.register({
|
|
337
|
+
name: 'conversation.session.header.actions',
|
|
338
|
+
id: 'subagent-models',
|
|
339
|
+
order: 15,
|
|
340
|
+
}, SubagentModelsHeader));
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
},
|
|
344
|
+
});
|
package/cordis.patch.yml
ADDED
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+

|
package/docs/preview.svg
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
|
|
2
|
+
<rect width="640" height="300" rx="20" fill="#f3f5f9"/>
|
|
3
|
+
<rect x="88" y="40" width="220" height="14" rx="7" fill="#d6dde7"/>
|
|
4
|
+
<rect x="88" y="62" width="136" height="8" rx="4" fill="#e0e5ed"/>
|
|
5
|
+
<rect x="88" y="94" width="464" height="130" rx="18" fill="#ffffff" stroke="#b7c3d2" stroke-width="2"/>
|
|
6
|
+
<rect x="110" y="122" width="100" height="9" rx="4" fill="#63758c"/>
|
|
7
|
+
<rect x="214" y="119" width="86" height="15" rx="7.5" fill="#e2e9f1"/>
|
|
8
|
+
<rect x="472" y="122" width="64" height="9" rx="4" fill="#d6dde7"/>
|
|
9
|
+
<rect x="110" y="152" width="120" height="9" rx="4" fill="#63758c"/>
|
|
10
|
+
<rect x="234" y="149" width="96" height="15" rx="7.5" fill="#e2e9f1"/>
|
|
11
|
+
<rect x="472" y="152" width="64" height="9" rx="4" fill="#d6dde7"/>
|
|
12
|
+
<rect x="110" y="182" width="90" height="9" rx="4" fill="#63758c"/>
|
|
13
|
+
<rect x="204" y="179" width="110" height="15" rx="7.5" fill="#e2e9f1"/>
|
|
14
|
+
<rect x="472" y="182" width="64" height="9" rx="4" fill="#d6dde7"/>
|
|
15
|
+
<circle cx="118" cy="248" r="18" fill="#247bbf"/>
|
|
16
|
+
</svg>
|
package/icon.svg
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect x="8" y="9.5" width="20" height="5" rx="2.5" fill="#9AA8B6" fill-opacity="0.8" />
|
|
3
|
+
<rect x="8" y="18.5" width="8" height="5" rx="2.5" fill="#9AA8B6" fill-opacity="0.8" />
|
|
4
|
+
<rect x="17.5" y="18.5" width="11" height="5" rx="2.5" fill="url(#sm-new)" />
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="sm-new" x1="17.5" y1="18.5" x2="28.5" y2="23.5" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#67C7FE" />
|
|
8
|
+
<stop offset="1" stop-color="#2F7DFF" />
|
|
9
|
+
</linearGradient>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
package/index.js
ADDED
package/locale/de.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Subagent-Modelle",
|
|
4
|
+
"description": "Zeigt den Modellnamen jedes Subagenten in der Namenszeile seiner Zeile (die zweite Zeile, wenn die Zeile eine Beschreibung zeigt) in den Subagenten-Panels der Kopfzeile (Root-Panel, Geschwister-Umschalter und Kinder-Panel) und verbreitert diese Panels auf 460 px. Der Modellname stammt aus der aufgezeichneten Modellauswahl der jeweiligen Subagenten-Session und wird als provider/model plus Reasoning-Stufe geschrieben; ein Subagent ohne Auswahl und externe Subagenten zeigen einen Gedankenstrich. Der Text wird in die Panel-Zeilen injiziert, daher kann eine künftige Panel-Änderung von DSH ihn verschwinden lassen; ein Panel, das sich keinem bekannten Katalog zuordnen lässt, bleibt ohne Markierung, statt ein falsches Modell zu zeigen.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Subagent models",
|
|
4
|
+
"description": "Shows each subagent's model name on the row's name line — the second line when the row shows a description — in the session-header subagent panels (root panel, sibling switcher, and children panel), and widens those panels to 460px. The model name comes from each subagent session's recorded model selection, written as provider/model and its reasoning effort; a subagent without one, and external subagents, show a dash. The text is injected into the panel rows, so a future DSH panel change can hide it; a panel the plugin cannot pair against a known catalog stays unmarked instead of showing a wrong model.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/es.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Modelos de subagentes",
|
|
4
|
+
"description": "Muestra el nombre del modelo de cada subagente en la línea del nombre de su fila (la segunda línea cuando la fila muestra una descripción) en los paneles de subagentes de la cabecera (panel raíz, selector de hermanos y panel de hijos), y ensancha esos paneles a 460 px. El nombre del modelo proviene de la selección registrada en la sesión de cada subagente, escrito como provider/model y su esfuerzo de razonamiento; un subagente sin selección y los subagentes externos muestran un guion. El texto se inyecta en las filas del panel, así que un cambio futuro del panel de DSH puede ocultarlo; un panel que no puede emparejarse con un catálogo conocido queda sin marcar en lugar de mostrar un modelo incorrecto.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/fr.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Modèles des sous-agents",
|
|
4
|
+
"description": "Affiche le nom du modèle de chaque sous-agent sur la ligne du nom de sa ligne (la deuxième ligne lorsque la ligne affiche une description) dans les panneaux de sous-agents de l'en-tête (panneau racine, sélecteur de frères, panneau des enfants), et élargit ces panneaux à 460 px. Le nom du modèle provient de la sélection enregistrée dans la session de chaque sous-agent, écrit sous la forme provider/model et son effort de raisonnement ; un sous-agent sans sélection et les sous-agents externes affichent un tiret. Le texte est injecté dans les lignes du panneau : une future modification du panneau par DSH peut le faire disparaître ; un panneau impossible à associer à un catalogue connu reste sans marque plutôt que d'afficher un modèle erroné.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/ja.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "サブエージェントのモデル",
|
|
4
|
+
"description": "セッションヘッダーのサブエージェントパネル(ルートパネル、兄弟切り替えパネル、子パネル)で、各サブエージェントの名前の行(説明がある行では2行目)に使用モデル名を表示し、パネルを460pxに広げます。モデル名は各サブエージェントのセッションに記録されたモデル選択から取得し、provider/model と推論強度の形式で表示します。記録がないサブエージェントと外部サブエージェントは「—」と表示します。文字はパネル行に注入されるため、将来のDSHのパネル変更で表示されなくなる可能性があります。既知のカタログと対応付けられないパネルは、誤ったモデルを表示せず何も表示しません。",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/pt.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Modelos de subagentes",
|
|
4
|
+
"description": "Mostra o nome do modelo de cada subagente na linha do nome da sua linha (a segunda linha quando a linha mostra uma descrição) nos painéis de subagentes do cabeçalho (painel raiz, seletor de irmãos e painel de filhos), e alarga esses painéis para 460 px. O nome do modelo vem da seleção registrada na sessão de cada subagente, escrito como provider/model e seu esforço de raciocínio; um subagente sem seleção e os subagentes externos mostram um traço. O texto é injetado nas linhas do painel, então uma futura mudança do painel pelo DSH pode ocultá-lo; um painel que não pode ser associado a um catálogo conhecido fica sem marcação em vez de mostrar um modelo errado.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/ru.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Модели субагентов",
|
|
4
|
+
"description": "Показывает название модели каждого субагента в строке имени его строки (вторая строка, если строка показывает описание) в панелях субагентов в заголовке сессии (корневая панель, переключатель соседних и панель дочерних), и расширяет эти панели до 460 px. Название модели берётся из сохранённого выбора модели сессии субагента и записывается как provider/model и уровень рассуждений; субагенты без выбора и внешние субагенты показывают прочерк. Текст вставляется в строки панели, поэтому будущее изменение панели в DSH может его скрыть; панель, которую не удаётся сопоставить с известным каталогом, остаётся без пометок, а не показывает неверную модель.",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/zh.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "子代理模型",
|
|
4
|
+
"description": "在会话顶部的子代理面板(根面板、兄弟切换面板、子代理自己的面板)中,为每个子代理的名称行(有描述的行就是第二行)显示所使用的模型名,并将面板加宽到 460px。模型名取自该子代理会话记录的模型选择,格式为 provider/model 加推理档位;没有记录的子代理和 external 子代理显示“—”。文字直接注入在面板行内,DSH 未来改动面板结构时可能失效;无法与已知目录匹配的面板宁可不显示,也不显示错误的模型。",
|
|
5
|
+
"detail": "docs/DETAIL.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hukj/dsh-subagent-model-tags",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shows each subagent's model in the session-header subagent panels.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"dsh",
|
|
9
|
+
"deepseek-harness",
|
|
10
|
+
"plugin",
|
|
11
|
+
"subagent",
|
|
12
|
+
"model"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"dsh": ">=0.2.2-rc.5 <0.3.0"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": "./index.js",
|
|
22
|
+
"./client": "./client.js",
|
|
23
|
+
"./locale/*.json": "./locale/*.json",
|
|
24
|
+
"./icon": "./icon.svg"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"index.js",
|
|
28
|
+
"client.js",
|
|
29
|
+
"cordis.patch.yml",
|
|
30
|
+
"locale/*.json",
|
|
31
|
+
"docs",
|
|
32
|
+
"icon.svg"
|
|
33
|
+
],
|
|
34
|
+
"dsh": {
|
|
35
|
+
"bundle": {
|
|
36
|
+
"patch": "./cordis.patch.yml"
|
|
37
|
+
},
|
|
38
|
+
"client": {
|
|
39
|
+
"platform": "web",
|
|
40
|
+
"immediately": true,
|
|
41
|
+
"inject": [
|
|
42
|
+
"@deepseek-ai/dsh-client-ui-subagent"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
6
46
|
}
|