dsh-cothread-mcp 0.1.3 → 0.1.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.4
4
+ - Fix the automation task update failing with `cannot get property "sessions" without inject`. The session-naming helper read the host's session registry through the context's property access, which Cordis rejects unless the plugin declares the service as an injected dependency; the error escaped the task assembly and left the settings saved but the automation task unchanged. The service is now read the same lenient way as every other host service the plugin uses, so a missing registry only means the session stays unnamed.
5
+
3
6
  ## 0.1.3
4
7
  - Remove the custom environment: only 正式环境 and 本地环境 remain. The environment picker in the settings page and the one in the sidebar's account menu no longer offer a custom option, and the custom service-address input is gone. A configuration saved with the old custom environment is normalized to 正式环境 instead of failing to load, so the plugin keeps working after the update. The authorization flow itself is unchanged.
5
8
  - Match the sidebar entry to the native DSH account row: the account label keeps the native 14px weight, the environment name is 12px, and the row's inline padding is 8px on both sides, so the CoThread row, the MiniMax usage row and the native account row line up. The signed-in menu now offers 「自动化设置」 with a gear glyph instead of 「共序自动化」, and the sidebar panel entry uses the native workspace-tree glyph so its stroke weight and padding match the other panel rows.
@@ -30,6 +33,7 @@
30
33
  - A project that has been saved once is locked: its project and workspace can no longer be changed, only its actions can still be adjusted, and switching project means deleting the row first.
31
34
  - Deleting a project now inspects the automation task and session first and asks for a second confirmation that spells out the task title, task id and session id that will be ended and archived; only after confirming does the task end, the session get archived and the row disappear.
32
35
  - 「打开自动化会话」 is now a single icon button next to the row, alongside the per-row save button.
36
+
33
37
  ## 0.1.1
34
38
 
35
39
  - Widen `engines.dsh` to `>=0.2.1-rc.2 <0.3.0-0 || >=0.2.2-0 <0.3.0-0` so the declared host range admits the DSH 0.2.2 pre-release line this plugin is verified on. The previous single-clause range excluded 0.2.2 pre-releases even though the peer ranges already accepted them.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cothread-mcp",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "连接共序 CoThread MCP,支持浏览器授权、项目设置及消息提醒。",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/automation.js CHANGED
@@ -241,9 +241,12 @@ async function ensureSession(ctx, sessionId, cwd, title) {
241
241
  }
242
242
 
243
243
  /** 给自动化会话起个项目名,界面上就能看到它叫什么。 */
244
- function nameSession(ctx, sessionId, title) {
244
+ export function nameSession(ctx, sessionId, title) {
245
245
  if (!title) return ''
246
- const sessions = ctx && ctx.sessions
246
+ // 用 ctx.get 取,不用 ctx.sessions:Cordis 的属性访问会检查本插件 fiber 的 inject,
247
+ // 没声明 inject 就会抛 'cannot get property "sessions" without inject',
248
+ // 把整个自动化任务的更新一起带崩。ctx.get 是宽松的,取不到就当没有。
249
+ const sessions = serviceOf(ctx, 'sessions')
247
250
  const titles = serviceOf(ctx, 'sessionTitle')
248
251
  if (!sessions || typeof sessions.get !== 'function') return ''
249
252
  const session = sessions.get(sessionId)