dsh-connect-minimaxcode 0.5.1 → 0.5.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 CHANGED
@@ -49,6 +49,8 @@ Another implementation in the same direction is **[dingminhua/dsh-connect-workbu
49
49
  - **Daily check-in**: MiniMax Code grants credits every day and the desktop app does **not** claim them for you; the plugin shows the seven-day cycle and can claim the day's grant
50
50
  - **Read-mostly**: apart from "refreshing an expired desktop app login state" and the sign-in you start yourself, the plugin does not write to or modify any MiniMax file
51
51
  - **Follows the selected model**: the balance sits in the **composer tool row beside the model picker**, and is drawn **only while a MiniMax model is selected** — picking another connector's model hides it entirely instead of misleading you with MiniMax's balance
52
+ - **An icon and two languages of its own**: a 48×48 SVG ships with the package, so the plugin page no longer shows the default placeholder; the title and the introduction come in Chinese and English, and the interface follows the host's language
53
+ - **Image input**: models whose catalog entry declares the `image` input modality (`M3`, `M3.1-Flash`) take pictures directly; the host's attachment service reads the image into request bytes, and the plugin only has to connect the durable reference to it
52
54
 
53
55
  ## Prerequisites
54
56
 
@@ -59,6 +61,8 @@ Either:
59
61
 
60
62
  Plus DSH desktop (built-in core `>=0.2.1-rc.2 <0.3.0`, see `engines.dsh` in `package.json`; tested on `0.2.1-rc.2`) or the Web profile.
61
63
 
64
+ > **Sending a picture needs the host's attachment service**: the plugin does not read images itself — the host's durable attachment service turns a stored reference into request bytes, and the plugin only connects the two. On a host without that service the plugin still loads and text still works; only image requests are refused (`pi-ai image input requires the durable attachment service`).
65
+
62
66
  ## Installation
63
67
 
64
68
  **Option 1: install from the Git repository** (recommended, gets the latest code)
@@ -292,10 +296,24 @@ The OAuth token is valid for about an hour and is refreshed automatically by the
292
296
  - **The automatic claim is off by default**, and it only asks when the server explicitly says the day can be claimed, at most once a day. Whether to turn it on, and whether that is within MiniMax's terms of service, is your call.
293
297
  - **No settings card is provided**. The plugin does not register a card on the DSH settings page; the interface it adds is a single pill in the composer tool row (**drawn only while this plugin's model is selected**) and a small card on the plugin page.
294
298
  - **The upstream APIs are non-public** and may stop working when MiniMax updates its client. If the balance API breaks, the pill shows "credits unavailable", which does not affect model traffic.
299
+ - **Image input depends on the host's attachment service.** The catalog declares the `image` modality (`M3`, `M3.1-Flash`), but turning a durable attachment into request bytes is the host's job: without that service the plugin still loads and serves text, and only image requests are refused.
295
300
  - **The device code flow needs `account.minimax.cn` to be reachable**, and the browser that authorizes it has to be able to sign in to a MiniMax account. On some restricted networks the authorization page cannot be opened.
296
301
 
297
302
  ## Changelog
298
303
 
304
+ ### 0.5.3 (2026-10-25)
305
+
306
+ - **Fixed image input**: an upload used to fail every time — `pi-ai image input requires the durable attachment service` (`UNSUPPORTED_CONTENT`). The catalog always declared `image` among a model's input modalities, but the plugin built its `PiAiAdapter` without `resolveAttachments` or `resolveImageAccess`, so pi-ai had no way to turn a durable attachment reference into request bytes and refused the call before it reached the gateway. The plugin now reads the host's `attachments` service on demand and maps an attachment's host path into the current execution world with `fs.processPathFromHostPath`; a host that offers no attachment service gets `undefined` for both hooks, and text-only calls are unchanged.
307
+ - New `tests/image-input.spec.ts` pins how both hooks resolve, the path mapping, and the "no attachment service still loads" case; `peerDependencies` gains `@deepseek-ai/dsh-attachment`.
308
+ - Measured against the live gateway: a 2×2 PNG sent to `M3.1-Flash` came back answered correctly (`inputTokens: 316`).
309
+
310
+ ### 0.5.2 (2026-10-21)
311
+
312
+ - **An icon for the plugin page**: a new `icon.svg` (48×48, under 800 bytes) ships with the package, declared as `"icon": "./icon.svg"` in `package.json`. The host reads it as a data URL and draws it on the plugin page instead of the default placeholder.
313
+ - **Chinese and English title and introduction**: new `locale/en.json` and `locale/zh.json` (the host reads the language files in the package root's `locale/` directory, with the English file as the anchor). The plugin page used to show the package name `dsh-connect-minimaxcode` and the mixed-language description from package.json; the title is now `DSH Connect MiniMax Code` and the introduction comes in both languages.
314
+ - **The interface follows the host's language**: neither the composer nor the plugin-page slot carries a translator in its standard props, so the copy always came from the built-in Chinese fallback — Chinese labels even in an English host. The bound locale is now injected into both slots, so an English host shows English.
315
+ - `exports` gains `./locale/*` (the host resolves the language files through it) and `files` gains `locale` and `icon.svg`.
316
+
299
317
  ### 0.5.1 (2026-10-20)
300
318
 
301
319
  - **The balance follows the selected model**: moved from the dock below the input box to the **composer tool row beside the model picker**, gated by the host's `modelSelection` projection — the readout is drawn **only while a `minimaxcode` model is selected**, and selecting another connector's model (workbuddy, for instance) hides it entirely, polling included (following `dsh-connect-trae`).
@@ -346,6 +364,25 @@ For earlier versions, see [GitHub Releases](https://github.com/JeffTsuiCUG/dsh-c
346
364
 
347
365
  The plugin ships an installable `dsh.bundle` manifest and is published to npm. The directory of the community plugin marketplace (`dshmarket`) is generated from the [Awesome DSH Plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) registry, and this plugin's listing has been submitted as PR [#8110](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/8110). A draft and the operating notes are kept in the repository: [`awesome-dsh-plugin-submission/`](awesome-dsh-plugin-submission/).
348
366
 
367
+ **Other directories and marketplaces** (entries submitted or already listed, text refreshed to 0.5.1):
368
+
369
+ | Channel | State |
370
+ |---|---|
371
+ | [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) (the registry) | Listed; entry refresh PR [#8380](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/8380) |
372
+ | [awesome-deepseek-harness](https://github.com/0xsline/awesome-deepseek-harness) | PR [#727](https://github.com/0xsline/awesome-deepseek-harness/pull/727) |
373
+ | [Awesome-DeepSeek-Harness-Plugins](https://github.com/Zhiyuan-Fan/Awesome-DeepSeek-Harness-Plugins) | PR [#92](https://github.com/Zhiyuan-Fan/Awesome-DeepSeek-Harness-Plugins/pull/92) |
374
+ | [dsh-suite](https://github.com/whyihaveyou/dsh-suite) | PR [#66](https://github.com/whyihaveyou/dsh-suite/pull/66) |
375
+ | [awesome-dsh-plugins](https://github.com/kejixiaoliang/awesome-dsh-plugins) | PR [#143](https://github.com/kejixiaoliang/awesome-dsh-plugins/pull/143) |
376
+ | [awesome-dsh-plugins](https://github.com/dshworks/awesome-dsh-plugins) | PR [#176](https://github.com/dshworks/awesome-dsh-plugins/pull/176) |
377
+ | [awesome-deepseek-harness](https://github.com/awesome-deepseekharness/awesome-deepseek-harness) | PR [#177](https://github.com/awesome-deepseekharness/awesome-deepseek-harness/pull/177) |
378
+ | [dsh-plugin-radar](https://github.com/AdamPlatin123/dsh-plugin-radar) | PR [#964](https://github.com/AdamPlatin123/dsh-plugin-radar/pull/964) |
379
+ | [dsh-community-plugins](https://github.com/zhu1090093659/dsh-community-plugins) | PR [#46](https://github.com/zhu1090093659/dsh-community-plugins/pull/46) |
380
+ | [dsh-plugin.org](https://github.com/dshplugin/dsh-plugin-hub) | Listed (automatic scan; the npm package shows up in the DSH plugin centre) |
381
+ | [dshbase](https://github.com/ylwl1997/dshbase) | Listed |
382
+ | [awesome-deepseek-harness-plugins](https://github.com/walkinglabs/awesome-deepseek-harness-plugins) | PR [#117](https://github.com/walkinglabs/awesome-deepseek-harness-plugins/pull/117) |
383
+ | [awesome-deepseek-harness](https://github.com/Dominic789654/awesome-deepseek-harness) | PR [#663](https://github.com/Dominic789654/awesome-deepseek-harness/pull/663) |
384
+ | [awesome-deepseek-harness-plugins](https://github.com/imsai-sh/awesome-deepseek-harness-plugins) | PR [#660](https://github.com/imsai-sh/awesome-deepseek-harness-plugins/pull/660) |
385
+
349
386
  Marketplace screenshots are declared, per the current convention, by the **`screenshots.json` in the plugin's own repository root** (the registry's `data/screenshots.json` is a fallback from the old convention, and no new keys are added there). This repository **does not ship screenshots yet**, so the file does not exist; once there are some, put `screenshots.json` in the repository root (an array of relative image paths) and the marketplace card will pick them up.
350
387
 
351
388
  > **Since 0.5.1 the readout lives in the composer tool row (beside the model picker) and is gated by the host's `modelSelection` projection**: the balance belongs to the provider the next request will actually use, so it sits where that selection is made — and it hides entirely, polling included, when another connector's model (workbuddy, for example) is selected. This follows `dsh-connect-trae`, whose `ComposerPointsGate` returns null for every provider but its own.
@@ -415,6 +452,11 @@ dsh plugin --profile web exec dsh-workbuddy-connect status
415
452
 
416
453
  > This plugin's version must match your DSH core exactly (each core line uses a different version); see the version table in its README before installing.
417
454
 
455
+ ## Contributors
456
+
457
+ - **[eghrhegpe](https://github.com/eghrhegpe)** — raised the request for a plugin-page icon and Chinese/English copy ([#1](https://github.com/JeffTsuiCUG/dsh-connect-minimaxcode/issues/1)). It became 0.5.2: the plugin page has its own SVG artwork, the title and the introduction come in both languages, and the interface follows the host's language.
458
+ - Plugin author: **[JeffTsuiCUG](https://github.com/JeffTsuiCUG)**
459
+
418
460
  ## Acknowledgements
419
461
 
420
462
  - **[corrinehu/dsh-workbuddy-connect](https://github.com/corrinehu/dsh-workbuddy-connect)** — **the inspiration for this plugin**. The overall idea of "reuse the desktop app's local login state and bring the already-signed-in model into DSH" was established first by that project, and this plugin follows the same approach; the read-only reuse of credentials was designed with it in mind.
package/README.md CHANGED
@@ -49,6 +49,8 @@
49
49
  - **每日签到**:MiniMax Code 每天送积分,客户端**不会自动领**;插件可以显示七天一签的进度,并代领当天的额度
50
50
  - **只读为主**:除「续期已过期的桌面 App 登录态」和「你自己发起的登录」外,不写入、不修改 MiniMax 的任何文件
51
51
  - **跟随所选模型**:余额显示在**输入框工具行(模型选择器旁)**,且**只在选中 MiniMax 模型时出现** —— 切到其他反代插件的模型就整体隐藏,不会拿着 MiniMax 的余额误导你
52
+ - **插件页有自己的图标与中英文**:随包发布一张 48×48 的 SVG,插件页不再显示默认占位图;标题与简介按宿主语言给中英文两版,界面文案也跟着宿主语言走
53
+ - **能看图**:模型目录里声明了 `image` 输入模态的模型(`M3`、`M3.1-Flash`)可以直接发图;图片由宿主的附件服务读成请求字节,插件只负责把持久化的附件引用接上去
52
54
 
53
55
  ## 前置条件
54
56
 
@@ -59,6 +61,8 @@
59
61
 
60
62
  另外需要 DSH 桌面版(内置内核 `>=0.2.1-rc.2 <0.3.0`,见 `package.json` 的 `engines.dsh`;实测 `0.2.1-rc.2`)或 Web profile。
61
63
 
64
+ > **发图需要宿主提供附件服务**:图片不是插件自己读的,而是由宿主的持久化附件服务读成请求字节,插件只负责把附件引用接上去。宿主没有附件服务时,插件照常加载、文本照常对话,只是发图会被拒绝(`pi-ai image input requires the durable attachment service`)。
65
+
62
66
  ## 安装
63
67
 
64
68
  **方式一:从 Git 仓库安装**(推荐,拿到最新代码)
@@ -298,10 +302,24 @@ OAuth 令牌有效期约 1 小时,由客户端自动续期。插件**只在自
298
302
  - **自动签到默认关闭**,且只在服务端明确说「当天可领」时才发请求、每天至多一次。是否开启、以及这样做是否符合 MiniMax 的服务条款,请自行判断。
299
303
  - **不提供设置界面卡片**。插件不在 DSH 设置页注册卡片;界面只在输入框工具行增加一枚胶囊(**仅选中本插件的模型时显示**),以及插件页面里的一张小卡片。
300
304
  - **上游接口非公开**,MiniMax 客户端更新后可能失效。余额接口失效时胶囊会显示「积分不可用」,不会影响模型对话。
305
+ - **发图依赖宿主的附件服务**。模型目录声明了 `image` 模态(`M3`、`M3.1-Flash`),但把持久化附件读成请求字节是宿主的活儿:宿主没有附件服务时插件仍能加载并服务文本,只是带图的请求会被拒绝。
301
306
  - **设备码流需要能访问 `account.minimax.cn`**,且授权时要在浏览器里能登录 MiniMax 账号。某些内网或受限网络下打不开授权页。
302
307
 
303
308
  ## 更新记录
304
309
 
310
+ ### 0.5.3(2026-10-25)
311
+
312
+ - **修复图片输入**:此前发图必然失败 —— `本轮运行失败 pi-ai image input requires the durable attachment service`(`UNSUPPORTED_CONTENT`)。模型目录一直把 `image` 写进模型的输入模态,但插件构造 `PiAiAdapter` 时没有给 `resolveAttachments` 与 `resolveImageAccess` 两个钩子,pi-ai 因此无法把持久化的附件引用变成请求字节,在发往网关之前就拒绝了调用。现在插件按需读取宿主的 `attachments` 服务,并用 `fs.processPathFromHostPath` 把附件的宿主路径映射进当前执行世界;宿主没有提供附件服务时这两个钩子为 `undefined`,纯文本调用不受影响。
313
+ - 新增 `tests/image-input.spec.ts`,钉住两个钩子的解析、路径映射,以及「宿主没有附件服务仍能加载」;`peerDependencies` 增加 `@deepseek-ai/dsh-attachment`。
314
+ - 实测:真实网关 + `M3.1-Flash` 发一张 2×2 PNG,回答正确(`inputTokens: 316`)。
315
+
316
+ ### 0.5.2(2026-10-21)
317
+
318
+ - **插件页图标**:新增随包发布的 `icon.svg`(48×48,800 字节内),并在 `package.json` 里声明 `"icon": "./icon.svg"`。宿主会把它读成 data URL 画在插件页卡片上,不再是默认占位图。
319
+ - **插件页标题与简介的中英文**:新增 `locale/en.json` 与 `locale/zh.json`(宿主按包根 `locale/` 目录里的语言文件读取,英文文件是基准)。此前插件页显示的是包名 `dsh-connect-minimaxcode` 和 package.json 里那句中英混排的描述;现在标题是 `DSH Connect MiniMax Code`,简介按宿主语言给中/英两版。
320
+ - **界面文案跟随宿主语言**:此前两个插槽都拿不到翻译函数(composer 与 plugin-page 插槽的 standardProps 里没有 `t`),所以界面永远走内置中文兜底,英文界面下也是中文。现在改为 `locale.bind()` 之后经插槽的 `inject` 传进去,英文界面显示英文。
321
+ - `exports` 增加 `./locale/*`(宿主要通过它解析语言包),`files` 增加 `locale` 与 `icon.svg`。
322
+
305
323
  ### 0.5.1(2026-10-20)
306
324
 
307
325
  - **余额读数跟随所选模型**:从输入框下方的 dock 移到**输入框工具行(模型选择器旁)**,并按宿主 `modelSelection` 投影门控 —— **只有选中 `minimaxcode` 模型时才显示**;切到其他反代插件(如 workbuddy)的模型即整体隐藏,且不轮询(学习 `dsh-connect-trae` 的做法)。
@@ -352,6 +370,25 @@ OAuth 令牌有效期约 1 小时,由客户端自动续期。插件**只在自
352
370
 
353
371
  插件已包含可安装的 `dsh.bundle` manifest,并发布到 npm。社区插件市场(`dshmarket`)的目录由 [Awesome DSH Plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 注册表生成,本插件的收录条目已提交为 PR [#8110](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/8110),仓库内保留了一份草稿与操作说明:[`awesome-dsh-plugin-submission/`](awesome-dsh-plugin-submission/)。
354
372
 
373
+ **其它目录 / 市场的收录**(条目已提交或已上线,内容随版本更新到 0.5.1):
374
+
375
+ | 渠道 | 状态 |
376
+ |---|---|
377
+ | [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)(官方注册表) | ✅ 已收录;条目更新 PR [#8380](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/8380) |
378
+ | [awesome-deepseek-harness](https://github.com/0xsline/awesome-deepseek-harness) | PR [#727](https://github.com/0xsline/awesome-deepseek-harness/pull/727) |
379
+ | [Awesome-DeepSeek-Harness-Plugins](https://github.com/Zhiyuan-Fan/Awesome-DeepSeek-Harness-Plugins) | PR [#92](https://github.com/Zhiyuan-Fan/Awesome-DeepSeek-Harness-Plugins/pull/92) |
380
+ | [dsh-suite](https://github.com/whyihaveyou/dsh-suite) | PR [#66](https://github.com/whyihaveyou/dsh-suite/pull/66) |
381
+ | [awesome-dsh-plugins](https://github.com/kejixiaoliang/awesome-dsh-plugins) | PR [#143](https://github.com/kejixiaoliang/awesome-dsh-plugins/pull/143) |
382
+ | [awesome-dsh-plugins](https://github.com/dshworks/awesome-dsh-plugins) | PR [#176](https://github.com/dshworks/awesome-dsh-plugins/pull/176) |
383
+ | [awesome-deepseek-harness](https://github.com/awesome-deepseekharness/awesome-deepseek-harness) | PR [#177](https://github.com/awesome-deepseekharness/awesome-deepseek-harness/pull/177) |
384
+ | [dsh-plugin-radar](https://github.com/AdamPlatin123/dsh-plugin-radar) | PR [#964](https://github.com/AdamPlatin123/dsh-plugin-radar/pull/964) |
385
+ | [dsh-community-plugins](https://github.com/zhu1090093659/dsh-community-plugins) | PR [#46](https://github.com/zhu1090093659/dsh-community-plugins/pull/46) |
386
+ | [dsh-plugin.org](https://github.com/dshplugin/dsh-plugin-hub) | ✅ 已收录(自助扫描,会随目录更新出现在 DSH「插件中心」) |
387
+ | [dshbase](https://github.com/ylwl1997/dshbase) | ✅ 已收录 |
388
+ | [awesome-deepseek-harness-plugins](https://github.com/walkinglabs/awesome-deepseek-harness-plugins) | PR [#117](https://github.com/walkinglabs/awesome-deepseek-harness-plugins/pull/117) |
389
+ | [awesome-deepseek-harness](https://github.com/Dominic789654/awesome-deepseek-harness) | PR [#663](https://github.com/Dominic789654/awesome-deepseek-harness/pull/663) |
390
+ | [awesome-deepseek-harness-plugins](https://github.com/imsai-sh/awesome-deepseek-harness-plugins) | PR [#660](https://github.com/imsai-sh/awesome-deepseek-harness-plugins/pull/660) |
391
+
355
392
  市场截图按当前约定由**插件自己仓库根目录的** `screenshots.json` 声明(注册表 `data/screenshots.json` 是旧约定下的回退,不再新增键)。本仓库目前**尚未提供截图**,所以还没有这个文件;补上截图后,在根目录放 `screenshots.json`(内容是图片相对路径的数组)即可被市场卡片取用。
356
393
 
357
394
  > **0.5.1 起,读数移到输入框工具行(模型选择器旁)并按宿主 `modelSelection` 投影做门控**:余额属于「下一次请求真正会用的那个 provider」,所以它既该待在选模型的地方,也该在选中别的反代插件(如 workbuddy)时**整体隐藏、且不发轮询请求**——这是学习 `dsh-connect-trae` 的做法(其 `ComposerPointsGate` 对非自家 provider 一律 `return null`)。
@@ -421,6 +458,11 @@ dsh plugin --profile web exec dsh-workbuddy-connect status
421
458
 
422
459
  > 该插件的版本需与你的 DSH 内核严格对应(不同内核线用不同版本),安装前请见其 README 的版本对应表。
423
460
 
461
+ ## 贡献者
462
+
463
+ - **[eghrhegpe](https://github.com/eghrhegpe)** —— 提出了插件页图标与中英文文案的建议([#1](https://github.com/JeffTsuiCUG/dsh-connect-minimaxcode/issues/1))。这条建议促成了 0.5.2:插件页有了自己的 SVG 图标,标题与简介有了中英两版,界面文案也开始跟随宿主语言。
464
+ - 插件作者:**[JeffTsuiCUG](https://github.com/JeffTsuiCUG)**
465
+
424
466
  ## 致谢
425
467
 
426
468
  - **[corrinehu/dsh-workbuddy-connect](https://github.com/corrinehu/dsh-workbuddy-connect)** — **本插件的灵感来源**。「复用桌面 App 本机登录态、把已登录模型接进 DSH」的整体思路由该项目最早确立,本插件沿用同一做法;凭据只读复用的设计也参照于此。
package/icon.svg ADDED
@@ -0,0 +1,11 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48" role="img" aria-label="DSH Connect MiniMax Code">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0" stop-color="#4f46e5"/>
5
+ <stop offset="1" stop-color="#7c3aed"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <rect x="2" y="2" width="44" height="44" rx="11" fill="url(#bg)"/>
9
+ <path d="M14 33V17l10 9 10-9v16" fill="none" stroke="#ffffff" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"/>
10
+ <circle cx="36" cy="13" r="2.4" fill="#fbbf24"/>
11
+ </svg>
package/lib/client.js CHANGED
@@ -480,6 +480,11 @@
480
480
  const context = ctx;
481
481
  // Visible text goes through the host's locale service.
482
482
  context.effect(() => context.locale.register(NAMESPACE, { zh, en }), `${BUNDLE_NAME}: locale`);
483
+ // The composer and plugin-page slots carry no translator in their
484
+ // standard props, so the bound one is injected into both. Without
485
+ // this the components fall back to their own Chinese copy and an
486
+ // English host shows Chinese labels.
487
+ const t = context.locale.bind(NAMESPACE);
483
488
  // The tool row to the left of the composer — beside the model
484
489
  // picker — rather than the ambient strip below it: the balance
485
490
  // belongs to the provider that is selected, so it sits where that
@@ -490,6 +495,7 @@
490
495
  id: 'minimax-credits',
491
496
  order: 4,
492
497
  locale: NAMESPACE,
498
+ inject: () => ({ t }),
493
499
  }, CreditPillGate));
494
500
  // The plugin's own page, keyed by the package name, where the
495
501
  // balance and the expiry schedule are spelled out.
@@ -497,6 +503,7 @@
497
503
  name: 'plugins.bundle.config',
498
504
  key: BUNDLE_NAME,
499
505
  locale: NAMESPACE,
506
+ inject: () => ({ t }),
500
507
  }, PluginPage));
501
508
  },
502
509
  };
package/lib/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import "@earendil-works/pi-ai";
2
2
  import { LlmAdapter } from "@deepseek-ai/dsh-llm";
3
+ import { PiAiAdapterOptions } from "@deepseek-ai/dsh-llm-pi-ai";
3
4
  import { Context } from "@deepseek-ai/cordis";
4
5
  //#region src/auth.d.ts
5
6
  /** File the desktop app writes its runtime auth context into. */
@@ -911,6 +912,17 @@ interface AdapterOptions {
911
912
  * transcript, so what is reported is what was actually billed.
912
913
  */
913
914
  onUsage?: (model: string, usage: ModelUsage) => void;
915
+ /**
916
+ * Resolve the host's durable attachment service at request time.
917
+ *
918
+ * Required for image input: without it the pi-ai adapter rejects any message
919
+ * carrying an image with `UNSUPPORTED_CONTENT`, because it cannot turn a
920
+ * durable reference into request bytes. Optional here only so a host that
921
+ * provides no such service can still load this plugin and serve text.
922
+ */
923
+ resolveAttachments?: PiAiAdapterOptions['resolveAttachments'];
924
+ /** Bridge one attachment into the current tool execution world. */
925
+ resolveImageAccess?: PiAiAdapterOptions['resolveImageAccess'];
914
926
  }
915
927
  /** What {@link createMinimaxCodeAdapter} hands back. */
916
928
  interface AdapterBundle {
package/lib/index.js CHANGED
@@ -4,7 +4,7 @@ import { homedir } from "node:os";
4
4
  import { dirname, join } from "node:path";
5
5
  import { createProvider } from "@earendil-works/pi-ai";
6
6
  import { anthropicMessagesApi } from "@earendil-works/pi-ai/api/anthropic-messages.lazy";
7
- import { LlmAdapter, resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
7
+ import { LlmAdapter, resolveImageAttachmentAccess, resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
8
8
  import { PiAiAdapter } from "@deepseek-ai/dsh-llm-pi-ai";
9
9
  import { createHash, randomBytes } from "node:crypto";
10
10
  //#region src/auth.ts
@@ -613,7 +613,9 @@ function createMinimaxCodeAdapter(options) {
613
613
  const inner = new PiAiAdapter({
614
614
  profiles: () => profiles,
615
615
  resolveApiKey: options.resolveApiKey,
616
- auth: INERT_AUTH
616
+ auth: INERT_AUTH,
617
+ ...options.resolveAttachments === void 0 ? {} : { resolveAttachments: options.resolveAttachments },
618
+ ...options.resolveImageAccess === void 0 ? {} : { resolveImageAccess: options.resolveImageAccess }
617
619
  });
618
620
  return {
619
621
  adapter: options.onUsage === void 0 ? inner : new MeteredAdapter(inner, options.onUsage),
@@ -623,6 +625,30 @@ function createMinimaxCodeAdapter(options) {
623
625
  };
624
626
  }
625
627
  //#endregion
628
+ //#region src/image-input.ts
629
+ /**
630
+ * Build the two image-input hooks from the services the host provides.
631
+ *
632
+ * Both services are read per request through `ctx.get` rather than declared as
633
+ * startup injections: they may be provided after this plugin loads, and a host
634
+ * without them must still start and serve text. A host that provides no
635
+ * attachment store simply keeps refusing images, which is the old behaviour
636
+ * rather than a new failure.
637
+ *
638
+ * `resolveImageAccess` is what lets a model read the normalized image from a
639
+ * tool as well as see it inline. It degrades to `undefined` when the host
640
+ * exposes no host-path mapping, and the adapter then reports no local copy.
641
+ *
642
+ * @param ctx - the plugin fiber whose services are read.
643
+ * @returns The optional {@link AdapterOptions} hooks, ready to spread.
644
+ */
645
+ function imageInputHooks(ctx) {
646
+ return {
647
+ resolveAttachments: () => ctx.get("attachments"),
648
+ resolveImageAccess: (attachments, ref) => resolveImageAttachmentAccess(attachments, (hostPath) => ctx.get("fs")?.processPathFromHostPath(hostPath), ref)
649
+ };
650
+ }
651
+ //#endregion
626
652
  //#region src/status-route.ts
627
653
  /** Route this plugin mounts, matching its settings card. */
628
654
  const MINIMAX_STATUS_PATH = "/plugins/dsh-connect-minimaxcode/status";
@@ -2159,6 +2185,7 @@ function apply(ctx) {
2159
2185
  region: () => region,
2160
2186
  resolveApiKey: async () => (await readNow())?.token,
2161
2187
  bearerToken: () => modelToken,
2188
+ ...imageInputHooks(ctx),
2162
2189
  onUsage: (model, usage) => {
2163
2190
  meter.record(model, usage);
2164
2191
  refreshCredits();
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DSH Connect MiniMax Code",
4
+ "description": "Bring the MiniMax Code models into DSH: reuse the desktop app's sign-in or sign in on your own with an OAuth device code, and get a live model catalog, the daily check-in, and a credit balance that follows the model you selected."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DSH Connect MiniMax Code",
4
+ "description": "把 MiniMax Code 的模型接入 DSH:复用桌面 App 登录态,或用 OAuth 设备码自己登录;带实时模型目录、每日签到,以及跟随所选模型显示的积分余额与到期提示。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -2,8 +2,18 @@
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.5.1",
5
+ "version": "0.5.3",
6
6
  "author": "JeffTsuiCUG",
7
+ "contributors": [
8
+ {
9
+ "name": "JeffTsuiCUG",
10
+ "url": "https://github.com/JeffTsuiCUG"
11
+ },
12
+ {
13
+ "name": "eghrhegpe",
14
+ "url": "https://github.com/eghrhegpe"
15
+ }
16
+ ],
7
17
  "license": "MIT",
8
18
  "private": false,
9
19
  "publishConfig": {
@@ -23,6 +33,7 @@
23
33
  "node": "^22.19.0 || >=24.0.0",
24
34
  "dsh": ">=0.2.1-rc.2 <0.3.0-0"
25
35
  },
36
+ "icon": "./icon.svg",
26
37
  "main": "lib/index.js",
27
38
  "types": "lib/index.d.ts",
28
39
  "exports": {
@@ -32,10 +43,14 @@
32
43
  },
33
44
  "./client": "./lib/client.js",
34
45
  "./cordis.patch.yml": "./cordis.patch.yml",
46
+ "./icon.svg": "./icon.svg",
47
+ "./locale/*": "./locale/*",
35
48
  "./package.json": "./package.json"
36
49
  },
37
50
  "files": [
38
51
  "lib",
52
+ "locale",
53
+ "icon.svg",
39
54
  "cordis.patch.yml",
40
55
  "README.md",
41
56
  "LICENSE"
@@ -60,6 +75,7 @@
60
75
  "peerDependencies": {
61
76
  "@deepseek-ai/cordis": ">=4.0.4 <5.0.0",
62
77
  "@deepseek-ai/dsh-atomic-write": ">=0.1.7-rc.1 <0.3.0-0",
78
+ "@deepseek-ai/dsh-attachment": ">=0.1.7-rc.1 <0.3.0-0",
63
79
  "@deepseek-ai/dsh-home-paths": ">=0.1.7-rc.1 <0.3.0-0",
64
80
  "@deepseek-ai/dsh-host-webserver": ">=0.1.7-rc.1 <0.3.0-0",
65
81
  "@deepseek-ai/dsh-llm": ">=0.1.7-rc.1 <0.3.0-0",