dsh-magpie-route 1.0.0 → 1.1.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/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # dsh-magpie-route
2
2
 
3
+ ![magpie real route in the DSH composer dock](https://raw.githubusercontent.com/zhaochunqi/dsh-magpie-route/main/docs/preview.png)
4
+
3
5
  A DeepSeek Harness (`dsh`) plugin that shows the **real upstream model** behind a [magpie](https://usemagpie.ai) routing-group alias, directly below the composer.
4
6
 
5
- DSH's model picker only knows the routing-group alias you configured (for example `magpie/group/daily`). The local magpie gateway decides which upstream provider/model actually serves each request, and that can change from turn to turn. This plugin reads the gateway's own trace and shows the real result.
7
+ DSH's model picker only knows the routing-group alias you configured (for example `magpie/group/daily`). The local magpie gateway decides which upstream provider/model actually serves each request, and that can change from turn to turn. This plugin reads the gateway's own route record and shows the real result.
6
8
 
7
9
  ```
8
10
  ● magpie real route · 13:32 magpie/group/daily → workbuddy/glm-5.3
@@ -11,14 +13,16 @@ DSH's model picker only knows the routing-group alias you configured (for exampl
11
13
  ## Features
12
14
 
13
15
  - **Composer dock line** — sits below the composer, refreshes every 15 seconds, and refreshes immediately on click. Shows the time, the asked alias, the real `provider/model`, and the matched routing rule.
14
- - Green dot = a settled route; red dot = the gateway is unreachable (click to retry); grey dot = no settled request yet. Hover for the data source.
15
- - Read-only: it sends no model request, changes no routing, and injects no headers.
16
+ - **Per DSH session** — the Host half tags each magpie inference with `X-Magpie-Session`, so the gateway can report this session's current/last route; an in-flight request shows its already-picked target with a "进行中 / in flight" marker.
17
+ - **Follows the DSH UI language** — the line reads `magpie real route` in English and `magpie 真实路由` in Chinese (and switches live when the UI language changes).
18
+ - Green dot = a route; red dot = the gateway is unreachable (click to retry); grey dot = no route yet.
19
+ - Read-only: it sends no model request, changes no routing, and only adds one transport header.
16
20
  - **No command and no agent tool** — this plugin only displays the route.
17
21
 
18
22
  ## Requirements
19
23
 
20
24
  - DeepSeek Harness with the composer dock slot (0.2.x).
21
- - A running [magpie](https://usemagpie.ai) gateway. Default base URL `http://127.0.0.1:3425`, overridable in the bundle config.
25
+ - A running [magpie](https://usemagpie.ai) gateway on the default `http://127.0.0.1:3425`.
22
26
 
23
27
  ## Install
24
28
 
@@ -28,27 +32,18 @@ For a local checkout instead, install the bundle directory with `plugin_manager`
28
32
 
29
33
  ## Configuration
30
34
 
31
- Edit the plugin row's config in your profile's `cordis.patch.yml` (a Host-only bundle has no UI config form):
32
-
33
- ```yaml
34
- - id: magpie-route
35
- config:
36
- baseURL: http://127.0.0.1:3425
37
- agent: dsh
38
- limit: 5
39
- ```
40
-
41
- `agent` is the magpie trace agent name to filter on (default `dsh`); `limit` is the number of recent settled rows the route returns (the dock shows the first).
35
+ No configuration is required: the plugin talks to the default local gateway at `http://127.0.0.1:3425` and filters the `dsh` agent. Only if your gateway runs elsewhere, override `baseURL` (and optionally `agent`/`limit`) in your profile's `cordis.patch.yml`.
42
36
 
43
37
  ## How it works
44
38
 
45
- - The Host half reads `GET {baseURL}/v1/magpie/trace` (real `provider/model` and rule per settled request) and serves it on the package's same-origin route `/plugins/magpie-route/route`.
46
- - The client half renders the composer-dock line by polling that same-origin route, because the magpie gateway sends no CORS headers.
39
+ - The Host half contributes `X-Magpie-Session: <dsh session id>` through DSH's `llm-pi-ai/request-headers` waterfall (a header only; no request-body, model, or tool change), then reads `GET {baseURL}/v1/magpie/route?session=<dsh session id>` for this session's current/last route.
40
+ - `GET {baseURL}/v1/magpie/trace` is the fallback for the first paint, before any inference has happened in this Host process.
41
+ - The client half renders the composer-dock line by polling the package's same-origin route `/plugins/magpie-route/route`, because the magpie gateway sends no CORS headers.
47
42
 
48
43
  ## Limitations
49
44
 
50
- - Shows the **most recent settled** request, not the request currently in flight: a request still running has no `usage`, so its final route is not known yet. When the dock says "另有 N 条进行中", those are in-flight requests that are counted but not reported.
51
- - The dock line is the latest settled `dsh` request **across all DSH sessions**, because DSH does not send `X-Magpie-Session` and the gateway cannot tie a route to a DSH session.
45
+ - Shows **this session's current/last route**. An in-flight request shows its already-picked target with a "进行中 / in flight" marker; the final served model is still only confirmed after magpie finishes. On the first paint (before any inference), it falls back to the global latest settled `dsh` trace row.
46
+ - The Host half remembers the most recent DSH session that sent a magpie request. If you open another session that has not requested anything yet, the dock may still show the previous session's route until that new session runs.
52
47
  - `trace` keeps a recent window (about 60 rows), not full history. For full history use `magpie usage --csv`.
53
48
  - `trace` reports `provider/model`; the final `served_model` (for example `hy4-free`) appears in `magpie usage --csv`.
54
49
  - Routing groups use session affinity and rules, so the "current real model" can change per turn.
package/README.zh.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # dsh-magpie-route
2
2
 
3
+ ![magpie 真实路由显示在输入框下方](https://raw.githubusercontent.com/zhaochunqi/dsh-magpie-route/main/docs/preview.png)
4
+
3
5
  DeepSeek Harness(`dsh`)插件:把 [magpie](https://usemagpie.ai) 路由组别名背后的**真实上游模型**直接显示在输入框下方。
4
6
 
5
- DSH 的模型选择器只知道你配置的路由组别名(例如 `magpie/group/daily`);请求实际发往哪个上游 provider/model 由本地 magpie 网关决定,而且可能逐轮变化。本插件读取网关自己的 trace,把真实结果显示出来。
7
+ DSH 的模型选择器只知道你配置的路由组别名(例如 `magpie/group/daily`);请求实际发往哪个上游 provider/model 由本地 magpie 网关决定,而且可能逐轮变化。本插件读取网关自己的路由记录,把真实结果显示出来。
6
8
 
7
9
  ```
8
10
  ● magpie 真实路由 · 13:32 magpie/group/daily → workbuddy/glm-5.3
@@ -11,14 +13,16 @@ DSH 的模型选择器只知道你配置的路由组别名(例如 `magpie/grou
11
13
  ## 功能
12
14
 
13
15
  - **输入框下方常驻一行**:每 15 秒刷新,点击立即刷新;显示时间、请求别名、真实 `provider/model` 和命中的路由规则。
14
- - 绿点 = 有已完成结果;红点 = 网关不可用(点击重试);灰点 = 暂无已完成请求;悬停显示数据源。
15
- - 只读:不发模型请求、不改路由、不注入请求头。
16
+ - **按 DSH 会话**:Host 半给每次 magpie 推理加上 `X-Magpie-Session`,网关就能返回本会话当前/最近的路由;进行中的请求会显示已选定的目标,并标注“进行中”。
17
+ - **跟随 DSH 界面语言**:中文界面显示“magpie 真实路由”,英文界面显示“magpie real route”,切换语言时会实时更新。
18
+ - 绿点 = 有路由结果;红点 = 网关不可用(点击重试);灰点 = 暂无路由;悬停显示数据源。
19
+ - 只读:不发模型请求、不改路由,只增加一个传输头。
16
20
  - **不提供命令,也不提供 agent 工具**,插件只负责界面显示。
17
21
 
18
22
  ## 要求
19
23
 
20
24
  - 带 composer dock slot 的 DeepSeek Harness(0.2.x)。
21
- - 正在运行的 [magpie](https://usemagpie.ai) 网关。默认 `http://127.0.0.1:3425`,可在 bundle 配置里改。
25
+ - 正在运行的 [magpie](https://usemagpie.ai) 网关,默认地址 `http://127.0.0.1:3425`。
22
26
 
23
27
  ## 安装
24
28
 
@@ -28,27 +32,18 @@ DSH 的模型选择器只知道你配置的路由组别名(例如 `magpie/grou
28
32
 
29
33
  ## 配置
30
34
 
31
- 在 profile 的 `cordis.patch.yml` 里改该插件行的 config(Host-only bundle 没有 UI 配置表单):
32
-
33
- ```yaml
34
- - id: magpie-route
35
- config:
36
- baseURL: http://127.0.0.1:3425
37
- agent: dsh
38
- limit: 5
39
- ```
40
-
41
- `agent` 是 magpie trace 里的 agent 名(默认 `dsh`);`limit` 是路由返回的最近已完成条数(界面显示第一条)。
35
+ 默认无需配置:插件自动连接本地网关 `http://127.0.0.1:3425`,并按 `dsh` agent 过滤。只有网关不在默认地址时,才需要在 profile 的 `cordis.patch.yml` 里覆盖 `baseURL`(以及可选的 `agent`/`limit`)。
42
36
 
43
37
  ## 工作原理
44
38
 
45
- - Host 半读取 `GET {baseURL}/v1/magpie/trace`(每条已完成请求的真实 `provider/model` 与规则),并挂在同源路由 `/plugins/magpie-route/route` 上。
46
- - Client 半轮询这个同源路由,渲染输入框下方那一行,因为 magpie 网关没有 CORS 头。
39
+ - Host 半通过 DSH 的 `llm-pi-ai/request-headers` waterfall 给每次 magpie 推理加上 `X-Magpie-Session: <dsh session id>`(只加请求头,不改请求体、模型或工具集),然后读取 `GET {baseURL}/v1/magpie/route?session=<dsh session id>` 得到本会话当前/最近的路由。
40
+ - `GET {baseURL}/v1/magpie/trace` 只作为首次绘制的兜底(Host 进程里还没有发生过推理时)。
41
+ - Client 半轮询本包 Host 的同源路由 `/plugins/magpie-route/route`,渲染输入框下方那一行,因为 magpie 网关没有 CORS 头。
47
42
 
48
43
  ## 限制
49
44
 
50
- - 显示的是**最近一次已完成**的请求,不是正在进行中的请求:进行中的请求还没有 `usage`,最终落点还未知。界面显示“另有 N 条进行中”时,那 N 条就是进行中、只计数、不当作结论。
51
- - 界面行显示的是**所有 DSH 会话中最近完成的一条** `dsh` 请求,因为 DSH 不发送 `X-Magpie-Session`,网关无法把路由关联到 DSH 会话。
45
+ - 显示的是**本会话当前/最近**的路由。进行中的请求显示已选定目标并标注“进行中”;最终 served model 仍要等 magpie 完成才能确认。首次绘制(还没发生推理)会退回全局最近一条已完成的 `dsh` trace。
46
+ - Host 半记住最近一次发起 magpie 请求的 DSH 会话。如果你切到一个还没发过请求的新会话,dock 可能仍显示上一个会话的路由,直到新会话真正发起请求。
52
47
  - `trace` 只保留最近窗口(约 60 条),不是完整历史;完整历史用 `magpie usage --csv`。
53
48
  - `trace` 显示 `provider/model`;最终 `served_model`(如 `hy4-free`)只在 `magpie usage --csv` 里出现。
54
49
  - 路由组有会话亲和与规则路由,“当前真实模型”可能逐轮变化。
package/client.js CHANGED
@@ -4,16 +4,47 @@
4
4
  * Host half over a same-origin route (the gateway itself sends no CORS headers).
5
5
  * Clicking the line refreshes immediately; the row also refreshes every 15s.
6
6
  *
7
- * Only the `react` module is required here; all styling is inline so the factory
8
- * does not depend on any other client builtin.
7
+ * The label follows the DSH UI language (Chinese / English). Only the `react`
8
+ * module is required; all styling is inline so the factory does not depend on
9
+ * any other client builtin.
9
10
  */
10
11
  window.__ModuleLoader__.load({
11
- id: '@local/dsh-magpie-route',
12
+ id: 'dsh-magpie-route',
12
13
  factory(require) {
13
14
  const React = require('react')
14
15
  const h = React.createElement
15
16
  const ROUTE = '/plugins/magpie-route/route'
16
17
  const REFRESH_MS = 15000
18
+ const NS = 'magpieRoute'
19
+
20
+ const DICT = {
21
+ zh: {
22
+ label: 'magpie 真实路由',
23
+ loading: '读取中…',
24
+ unreachable: '网关不可用(点击重试)',
25
+ none: '暂无已完成的请求',
26
+ inFlight: '进行中',
27
+ inFlightPrefix: '另有 ',
28
+ inFlightSuffix: ' 条进行中',
29
+ clickRefresh: '点击刷新',
30
+ sourcePrefix: '数据源 ',
31
+ sourceSuffix: ' · 点击刷新',
32
+ aria: 'magpie 真实路由,点击刷新',
33
+ },
34
+ en: {
35
+ label: 'magpie real route',
36
+ loading: 'loading…',
37
+ unreachable: 'gateway unreachable (click to retry)',
38
+ none: 'no settled request yet',
39
+ inFlight: 'in flight',
40
+ inFlightPrefix: '',
41
+ inFlightSuffix: ' in flight',
42
+ clickRefresh: 'click to refresh',
43
+ sourcePrefix: 'source ',
44
+ sourceSuffix: ' · click to refresh',
45
+ aria: 'magpie real route, click to refresh',
46
+ },
47
+ }
17
48
 
18
49
  const baseStyle = {
19
50
  display: 'flex',
@@ -45,22 +76,50 @@ window.__ModuleLoader__.load({
45
76
  return text.length >= 19 ? text.slice(11, 16) : ''
46
77
  }
47
78
 
48
- function MagpieRouteDock() {
79
+ function currentLang(ctx) {
80
+ try {
81
+ const snapshot = ctx.locale.getLocale()
82
+ return String((snapshot && snapshot.id) || 'zh').slice(0, 2) === 'en' ? 'en' : 'zh'
83
+ } catch {
84
+ return 'zh'
85
+ }
86
+ }
87
+
88
+ function MagpieRouteDock(props) {
89
+ const ctx = props.ctx
49
90
  const [state, setState] = React.useState({ phase: 'loading' })
50
91
  const [nonce, setNonce] = React.useState(0)
92
+ const [lang, setLang] = React.useState(() => currentLang(ctx))
93
+
94
+ React.useEffect(() => {
95
+ let unsubscribe = null
96
+ try {
97
+ unsubscribe = ctx.locale.subscribe(() => setLang(currentLang(ctx)))
98
+ } catch {
99
+ /* locale is optional for rendering */
100
+ }
101
+ return () => {
102
+ if (typeof unsubscribe === 'function') unsubscribe()
103
+ }
104
+ }, [ctx])
51
105
 
52
106
  React.useEffect(() => {
53
107
  let alive = true
54
108
  let timer = null
55
109
  const run = async () => {
56
110
  try {
57
- const response = await fetch(`${ROUTE}?limit=1`, { headers: { accept: 'application/json' } })
111
+ const response = await fetch(`${ROUTE}`, { headers: { accept: 'application/json' } })
58
112
  const body = await response.json()
59
113
  if (!alive) return
60
114
  if (!response.ok || body.error) {
61
- setState({ phase: 'error', message: body.error || 'magpie 网关不可用' })
115
+ setState({ phase: 'error', message: body.error || 'magpie gateway unavailable' })
62
116
  } else {
63
- setState({ phase: 'ok', route: (body.routes || [])[0] || null, pending: body.pending || 0 })
117
+ setState({
118
+ phase: 'ok',
119
+ kind: body.kind || 'trace',
120
+ route: (body.routes || [])[0] || null,
121
+ pending: body.pending || 0,
122
+ })
64
123
  }
65
124
  } catch (error) {
66
125
  if (alive) setState({ phase: 'error', message: String((error && error.message) || error) })
@@ -74,25 +133,29 @@ window.__ModuleLoader__.load({
74
133
  }
75
134
  }, [nonce])
76
135
 
136
+ const t = DICT[lang] || DICT.zh
77
137
  let dot = 'var(--dsw-alias-state-idle-primary)'
78
- let text = 'magpie 真实路由 · 读取中…'
79
- let title = '点击刷新'
138
+ let text = `${t.label} · ${t.loading}`
139
+ let title = t.clickRefresh
80
140
  if (state.phase === 'error') {
81
141
  dot = 'var(--dsw-alias-state-error-primary)'
82
- text = 'magpie 真实路由 · 网关不可用(点击重试)'
142
+ text = `${t.label} · ${t.unreachable}`
83
143
  title = state.message || text
84
144
  } else if (state.phase === 'ok') {
85
145
  const route = state.route
86
146
  if (!route) {
87
- text = 'magpie 真实路由 · 暂无已完成的请求'
88
- title = '点击刷新'
147
+ text = `${t.label} · ${t.none}`
89
148
  } else {
90
149
  dot = 'var(--dsw-alias-state-success-primary)'
91
150
  const asked = route.asked ? `${route.asked} → ` : ''
92
151
  const rule = route.rule ? ` [${route.rule}]` : ''
93
- const pending = state.pending > 0 ? ` · 另有 ${state.pending} 条进行中` : ''
94
- text = `magpie 真实路由 · ${timeOf(route.time)} ${asked}${route.real}${rule}${pending}`
95
- title = `数据源 ${ROUTE} · 点击刷新`
152
+ const pending = state.pending > 0
153
+ ? (state.kind === 'session'
154
+ ? ` · ${t.inFlight}`
155
+ : ` · ${t.inFlightPrefix}${state.pending}${t.inFlightSuffix}`)
156
+ : ''
157
+ text = `${t.label} · ${timeOf(route.time)} ${asked}${route.real}${rule}${pending}`
158
+ title = `${t.sourcePrefix}${ROUTE}${t.sourceSuffix}`
96
159
  }
97
160
  }
98
161
 
@@ -100,7 +163,7 @@ window.__ModuleLoader__.load({
100
163
  type: 'button',
101
164
  style: baseStyle,
102
165
  title,
103
- 'aria-label': 'magpie 真实路由,点击刷新',
166
+ 'aria-label': t.aria,
104
167
  onClick: () => setNonce(value => value + 1),
105
168
  },
106
169
  h('span', {
@@ -116,13 +179,33 @@ window.__ModuleLoader__.load({
116
179
  }
117
180
 
118
181
  return {
119
- inject: ['slots'],
182
+ inject: ['slots', 'locale'],
120
183
  apply(ctx) {
184
+ ctx.effect(() => {
185
+ const disposers = []
186
+ for (const locale of Object.keys(DICT)) {
187
+ try {
188
+ disposers.push(ctx.locale.register(NS, locale, DICT[locale]))
189
+ } catch {
190
+ /* locale registration is best-effort */
191
+ }
192
+ }
193
+ return () => {
194
+ for (const dispose of disposers) {
195
+ try {
196
+ dispose()
197
+ } catch {
198
+ /* ignore */
199
+ }
200
+ }
201
+ }
202
+ }, 'dsh-magpie-route: dictionaries')
203
+
121
204
  ctx.slots.inject('conversation.composer.dock', () => ctx.slots.register({
122
205
  name: 'conversation.composer.dock',
123
206
  id: 'magpie-route-dock',
124
207
  order: 40,
125
- }, MagpieRouteDock))
208
+ }, props => h(MagpieRouteDock, { ...props, ctx })))
126
209
  },
127
210
  }
128
211
  },
package/cordis.patch.yml CHANGED
@@ -1,7 +1,4 @@
1
1
  - insert:
2
2
  - id: magpie-route
3
3
  name: 'dsh-magpie-route'
4
- config:
5
- baseURL: http://127.0.0.1:3425
6
- agent: dsh
7
- limit: 5
4
+ config: {}
Binary file
package/index.js CHANGED
@@ -23,12 +23,28 @@ function jsonResponse(value, status = 200) {
23
23
  }
24
24
 
25
25
  /**
26
- * Serve the same-origin read route that the client dock polls. The client half
27
- * renders the composer-dock line; this plugin intentionally adds no command and
28
- * no agent tool.
26
+ * Serve the same-origin read route that the client dock polls.
27
+ *
28
+ * The Host half also tags every magpie inference with `X-Magpie-Session`, so
29
+ * the gateway can answer `/v1/magpie/route?session=...` for *this* DSH session
30
+ * (including an in-flight request's already-picked target). The trace endpoint
31
+ * remains the fallback for the first paint and for profiles where no inference
32
+ * has happened yet. The plugin adds no command and no agent tool.
29
33
  */
30
34
  export function apply(ctx, config = {}) {
31
35
  const settings = { ...DEFAULTS, ...(config && typeof config === 'object' ? config : {}) }
36
+ let lastSession
37
+
38
+ // Only a transport header is added; the request body, model, and tool set are untouched.
39
+ ctx.effect(() => ctx.on('llm-pi-ai/request-headers', (request, headers, next) => {
40
+ if (request.provider === 'magpie'
41
+ && typeof request.sessionId === 'string'
42
+ && request.sessionId.length > 0) {
43
+ lastSession = request.sessionId
44
+ headers.set('x-magpie-session', request.sessionId)
45
+ }
46
+ return next()
47
+ }))
32
48
 
33
49
  ctx.effect(() => ctx.webServer.register({
34
50
  kind: 'exact',
@@ -39,10 +55,16 @@ export function apply(ctx, config = {}) {
39
55
  if (origin !== null && origin !== url.origin) {
40
56
  return jsonResponse({ error: 'forbidden origin' }, 403)
41
57
  }
42
- const rawLimit = Number(url.searchParams.get('limit'))
43
- const limit = Number.isFinite(rawLimit) && rawLimit > 0 ? rawLimit : 1
44
58
  try {
45
- const result = await collectRoutes({ ...settings, limit, signal: request.signal })
59
+ let result
60
+ if (lastSession) {
61
+ result = await collectRoutes({ ...settings, session: lastSession, signal: request.signal })
62
+ if (result.kind === 'session-empty') {
63
+ result = await collectRoutes({ ...settings, limit: 1, signal: request.signal })
64
+ }
65
+ } else {
66
+ result = await collectRoutes({ ...settings, limit: 1, signal: request.signal })
67
+ }
46
68
  return jsonResponse(result)
47
69
  } catch (error) {
48
70
  return jsonResponse({ error: describeError(error, settings.baseURL) }, 502)
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Magpie real route",
4
- "description": "Show the real upstream model behind a magpie routing group directly below the composer. The dock line refreshes every 15 seconds and on click; it reads the package Host half's same-origin route /plugins/magpie-route/route, so the browser never calls the gateway directly. Read-only: it sends no model request and does not change routing; the magpie gateway must be running. In-flight requests without usage are counted but not reported as a route. The dock shows the latest settled request across DSH sessions because DSH does not send X-Magpie-Session. The default gateway is http://127.0.0.1:3425; baseURL, agent, and limit are edited in the bundle's cordis.patch.yml and take effect after a reload/restart (no UI config form). This plugin adds no command and no agent tool."
4
+ "description": "Show the real upstream model behind a magpie routing group directly below the composer (the text follows the DSH UI language: \"magpie real route\" in English, \"magpie 真实路由\" in Chinese). The Host half tags each magpie inference with X-Magpie-Session and reads /v1/magpie/route for this session's current/last route, including an in-flight request's already-picked target; trace is the first-paint fallback. The dock line refreshes every 15 seconds and on click; it reads the package Host half's same-origin route /plugins/magpie-route/route, so the browser never calls the gateway directly. Read-only: it sends no model request and does not change routing; the magpie gateway must be running. No configuration is required: it uses the default gateway http://127.0.0.1:3425; only if your gateway runs elsewhere, override baseURL in cordis.patch.yml. This plugin adds no command and no agent tool."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Magpie 真实路由",
4
- "description": "把 magpie 路由组别名背后的真实上游模型直接显示在输入框下方。界面行每 15 秒自动刷新、点击刷新,读取 Host 半的同源路由 /plugins/magpie-route/route(浏览器无需直连网关)。只读,不发模型请求、不改路由;需要 magpie 网关正在运行,进行中且尚无 usage 的请求只计数、不显示为结论。DSH 不发送 X-Magpie-Session,界面行显示所有 DSH 会话中最近完成的一条。默认网关为 http://127.0.0.1:3425,baseURL、agent、limit 需编辑该 bundle 的 cordis.patch.yml 后重新加载/重启生效(无 UI 配置表单)。本插件不提供命令,也不提供 agent 工具。"
4
+ "description": "把 magpie 路由组别名背后的真实上游模型直接显示在输入框下方(文本跟随 DSH 界面语言:中文“magpie 真实路由”,英文“magpie real route”)。Host 半给每次 magpie 推理加上 X-Magpie-Session,并读取 /v1/magpie/route 得到本会话当前/最近的路由(进行中请求显示已选定目标);trace 仅作为首次绘制兜底。界面行每 15 秒自动刷新、点击刷新,读取 Host 半的同源路由 /plugins/magpie-route/route(浏览器无需直连网关)。只读,不发模型请求、不改路由;需要 magpie 网关正在运行。默认无需配置,自动连接 http://127.0.0.1:3425;仅当网关不在默认地址时,才需要在 cordis.patch.yml 中覆盖 baseURL。本插件不提供命令,也不提供 agent 工具。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-magpie-route",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "DeepSeek Harness plugin: show the real upstream model behind a magpie routing group directly below the composer.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -43,6 +43,8 @@
43
43
  "route-query.js",
44
44
  "cordis.patch.yml",
45
45
  "locale/*.json",
46
+ "docs",
47
+ "screenshots.json",
46
48
  "icon.svg",
47
49
  "README.md",
48
50
  "README.zh.md",
package/route-query.js CHANGED
@@ -71,6 +71,7 @@ export async function collectRoutes(options = {}) {
71
71
  kind: 'session',
72
72
  source: url,
73
73
  session,
74
+ pending: route.done === false ? 1 : 0,
74
75
  routes: [{
75
76
  time: timeOf(route.time),
76
77
  asked: typeof route.asked === 'string' ? route.asked : '',
@@ -0,0 +1,3 @@
1
+ [
2
+ "docs/preview.png"
3
+ ]