dsh-connect-minimaxcode 0.6.2 → 0.6.3
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.en.md +7 -0
- package/README.md +7 -0
- package/lib/client.js +72 -5
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -384,6 +384,13 @@ The OAuth token is valid for about an hour and is refreshed automatically by the
|
|
|
384
384
|
|
|
385
385
|
## Changelog
|
|
386
386
|
|
|
387
|
+
### 0.6.3 (2026-11-11)
|
|
388
|
+
|
|
389
|
+
- **"Could not send it to the conversation" now names the missing piece**: delivering a picture needs several pieces of the host — the session identifier, the sessions service, the session binding, a way to send or to hold a draft, and the input box's attachment channel — and they arrive in different ways. There used to be one blanket failure message; each absence now has its own: the host named no session / offers no sessions service / this session is not reachable / it cannot send / it cannot hold drafts / the input box takes no attachments.
|
|
390
|
+
- **The plugin checks itself and reports**: the card tells the plugin's own route what the host actually offered when it mounts, so the status document carries that report — working on a failure no longer depends only on the sentence on the screen.
|
|
391
|
+
- Also fixed a real defect the tests caught at once: the report referred to the session identifier before it was defined, and the host fires effects early, so the script broke.
|
|
392
|
+
- `tests/generate-dock.spec.ts` grows to 8 cases, covering the report's content and the wording when no session is named.
|
|
393
|
+
|
|
387
394
|
### 0.6.2 (2026-11-11)
|
|
388
395
|
|
|
389
396
|
- **Fixed "could not send it to the conversation"**: the previous version looked for the session among the slot's props, but the host hands the session to the slot's **injection callback** (the slot is session-scoped), so the identifier was always missing and the picture had nowhere to go. The session is now taken the way the host gives it.
|
package/README.md
CHANGED
|
@@ -395,6 +395,13 @@ OAuth 令牌有效期约 1 小时,由客户端自动续期。插件**只在自
|
|
|
395
395
|
|
|
396
396
|
## 更新记录
|
|
397
397
|
|
|
398
|
+
### 0.6.3(2026-11-11)
|
|
399
|
+
|
|
400
|
+
- **「无法发送到对话」现在会说明缺哪一步**:把图片送进对话需要宿主的好几块能力(会话标识、会话服务、会话绑定、发送或草稿通道、输入框的附件通道),它们分别以不同方式交到插件手上。原先只有一句笼统的失败提示,现在每种缺失都有各自的话:宿主没给会话标识 / 没有会话服务 / 当前会话不可达 / 会话不支持发送 / 不支持草稿 / 输入框不接受附件。
|
|
401
|
+
- **插件会自检并上报**:卡片在挂载时把宿主实际提供了什么报告给插件自己的路由,因此状态文档里能读到这份自检结果 —— 排查时不必只靠屏幕上的那句话。
|
|
402
|
+
- 顺带修掉一处真实缺陷:自检报告引用了后面才定义的会话标识,宿主在效果阶段先跑,导致脚本崩溃(测试当场抓到)。
|
|
403
|
+
- `tests/generate-dock.spec.ts` 增至 8 个用例:覆盖自检报告的内容、以及缺会话标识时的话术。
|
|
404
|
+
|
|
398
405
|
### 0.6.2(2026-11-11)
|
|
399
406
|
|
|
400
407
|
- **修复「无法发送到对话」**:上一版从插槽的 props 里找会话标识,但宿主是把会话交给**插槽的注入回调**的(该插槽是会话作用域的),于是标识始终为空,图片自然送不出去。现在按宿主的方式取会话标识。
|
package/lib/client.js
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
const STATUS_PATH = '/plugins/dsh-connect-minimaxcode/status';
|
|
21
21
|
const ACTION_PATH = '/plugins/dsh-connect-minimaxcode/action';
|
|
22
22
|
const GENERATE_PATH = '/plugins/dsh-connect-minimaxcode/generate';
|
|
23
|
+
const CAPABILITY_PATH = '/plugins/dsh-connect-minimaxcode/capability';
|
|
23
24
|
const POLL_INTERVAL_MS = 20000;
|
|
24
25
|
/**
|
|
25
26
|
* The provider id the host side registers with `llm.registerAdapter`.
|
|
@@ -99,6 +100,12 @@
|
|
|
99
100
|
generateSent: '图片已发送到对话',
|
|
100
101
|
generateDrafted: '图片已放入输入框',
|
|
101
102
|
generateSendFailed: '无法发送到对话,请到插件页生成后下载。',
|
|
103
|
+
generateNoSession: '宿主没有给出会话标识,无法定位对话。',
|
|
104
|
+
generateNoSessions: '宿主没有提供会话服务,无法定位对话。',
|
|
105
|
+
generateNoBinding: '当前会话不可达(宿主没有给出它的绑定)。',
|
|
106
|
+
generateNoPrompt: '当前会话不支持发送消息。',
|
|
107
|
+
generateNoDraft: '当前会话不支持草稿附件。',
|
|
108
|
+
generateNoInput: '输入框不接受附件。',
|
|
102
109
|
};
|
|
103
110
|
const en = {
|
|
104
111
|
title: 'MiniMax Code credits',
|
|
@@ -171,6 +178,12 @@
|
|
|
171
178
|
generateSent: 'The picture is on its way to the conversation',
|
|
172
179
|
generateDrafted: 'The picture is in the input box',
|
|
173
180
|
generateSendFailed: 'Could not send it to the conversation; generate on the plugin page and download it instead.',
|
|
181
|
+
generateNoSession: 'The host named no session, so the conversation cannot be located.',
|
|
182
|
+
generateNoSessions: 'The host offers no sessions service, so the conversation cannot be located.',
|
|
183
|
+
generateNoBinding: 'This session is not reachable (the host gave no binding for it).',
|
|
184
|
+
generateNoPrompt: 'This session cannot send messages.',
|
|
185
|
+
generateNoDraft: 'This session cannot hold draft attachments.',
|
|
186
|
+
generateNoInput: 'The input box does not take attachments.',
|
|
174
187
|
};
|
|
175
188
|
const loader = globalThis.__ModuleLoader__;
|
|
176
189
|
if (loader === undefined)
|
|
@@ -454,17 +467,51 @@
|
|
|
454
467
|
return template.replace(/\\{(\\w+)\\}/g, (_match, name) => String(params?.[name] ?? ''));
|
|
455
468
|
});
|
|
456
469
|
const [open, setOpen] = React.useState(false);
|
|
457
|
-
const [prompt, setPrompt] = React.useState('');
|
|
458
|
-
const [busy, setBusy] = React.useState(false);
|
|
459
|
-
const [note, setNote] = React.useState('');
|
|
460
470
|
/**
|
|
461
471
|
* The session the picture belongs to.
|
|
462
472
|
*
|
|
463
473
|
* The host hands the session id to the slot through its injection,
|
|
464
474
|
* because the slot is session-scoped; it is also carried on the
|
|
465
|
-
* standard props, so either may deliver it.
|
|
475
|
+
* standard props, so either may deliver it. It is read here, before
|
|
476
|
+
* anything else in the dock uses it, because an effect can fire
|
|
477
|
+
* before the rest of the body has run.
|
|
466
478
|
*/
|
|
467
479
|
const sessionId = () => props.sessionId;
|
|
480
|
+
/**
|
|
481
|
+
* What the host offers this dock, described once.
|
|
482
|
+
*
|
|
483
|
+
* Delivering a picture needs several pieces of the host and they
|
|
484
|
+
* arrive in different ways, so a failure otherwise reads as one
|
|
485
|
+
* undifferentiated message. The report is sent to the plugin's own
|
|
486
|
+
* route, so it can be read from the status document — by whoever is
|
|
487
|
+
* looking at the problem, not only by the person who hit it.
|
|
488
|
+
*/
|
|
489
|
+
const reportCapability = () => {
|
|
490
|
+
const id = sessionId();
|
|
491
|
+
const services = clientContext?.sessions;
|
|
492
|
+
const binding = id === undefined ? undefined : services?.binding?.(id);
|
|
493
|
+
const scoped = id === undefined ? undefined : services?.scope?.(id);
|
|
494
|
+
const conversation = scoped?.get?.('conversation');
|
|
495
|
+
const findings = {
|
|
496
|
+
sessionId: id === undefined ? 'missing' : 'present',
|
|
497
|
+
sessionsService: services === undefined ? 'missing' : 'present',
|
|
498
|
+
binding: binding === undefined ? 'missing' : 'present',
|
|
499
|
+
sessionPrompt: typeof binding?.session?.prompt === 'function' ? 'present' : 'missing',
|
|
500
|
+
scope: scoped === undefined ? 'missing' : 'present',
|
|
501
|
+
conversationService: conversation === undefined ? 'missing' : 'present',
|
|
502
|
+
createDrafts: typeof conversation?.createDrafts === 'function' ? 'present' : 'missing',
|
|
503
|
+
inputActions: typeof props.inputActions?.addAttachments === 'function' ? 'present' : 'missing',
|
|
504
|
+
};
|
|
505
|
+
void fetch(`${CAPABILITY_PATH}?report=${encodeURIComponent(JSON.stringify(findings))}`).catch(() => {
|
|
506
|
+
// The report is a courtesy; failing to send it changes nothing.
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
React.useEffect(() => {
|
|
510
|
+
reportCapability();
|
|
511
|
+
}, []);
|
|
512
|
+
const [prompt, setPrompt] = React.useState('');
|
|
513
|
+
const [busy, setBusy] = React.useState(false);
|
|
514
|
+
const [note, setNote] = React.useState('');
|
|
468
515
|
/**
|
|
469
516
|
* The session's own send path.
|
|
470
517
|
*
|
|
@@ -542,6 +589,14 @@
|
|
|
542
589
|
// Sending the picture as a turn is what the dock promises; the
|
|
543
590
|
// draft channel is the fallback for a host that only offers that.
|
|
544
591
|
const face = sessionFace();
|
|
592
|
+
if (face === undefined) {
|
|
593
|
+
const id = sessionId();
|
|
594
|
+
setNote(id === undefined
|
|
595
|
+
? t('generateNoSession')
|
|
596
|
+
: clientContext?.sessions === undefined
|
|
597
|
+
? t('generateNoSessions')
|
|
598
|
+
: t('generateNoBinding'));
|
|
599
|
+
}
|
|
545
600
|
if (face !== undefined) {
|
|
546
601
|
await face.prompt([part, { type: 'text', text }], 'queue', undefined, `minimax-h3-${Date.now()}`);
|
|
547
602
|
setPrompt('');
|
|
@@ -553,7 +608,19 @@
|
|
|
553
608
|
}
|
|
554
609
|
const drafts = draftFace();
|
|
555
610
|
const addAttachments = props.inputActions?.addAttachments;
|
|
556
|
-
if (drafts
|
|
611
|
+
if (drafts === undefined) {
|
|
612
|
+
setNote(sessionId() === undefined
|
|
613
|
+
? t('generateNoSession')
|
|
614
|
+
: clientContext?.sessions === undefined
|
|
615
|
+
? t('generateNoSessions')
|
|
616
|
+
: t('generateNoDraft'));
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
if (typeof addAttachments !== 'function') {
|
|
620
|
+
setNote(t('generateNoInput'));
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
{
|
|
557
624
|
const file = new File([base64Bytes(body.dataUrl)], 'minimax-h3-image.jpg', { type: body.mediaType ?? 'image/jpeg' });
|
|
558
625
|
const created = drafts.createDrafts(sessionId(), [file], true);
|
|
559
626
|
addAttachments(created.map(draft => draft.id));
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-connect-minimaxcode",
|
|
3
3
|
"displayName": "DSH Connect MiniMax Code",
|
|
4
4
|
"description": "把本机已登录的 MiniMax Code 桌面 App 模型接入 DeepSeek Harness:零配置、Anthropic Messages 兼容、动态模型目录,并显示积分余额与到期 — bring MiniMax Code desktop app models into DSH with a dynamic model catalog and a credit balance with expiry details.",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.3",
|
|
6
6
|
"author": "JeffTsuiCUG",
|
|
7
7
|
"contributors": [
|
|
8
8
|
{
|