dsh-hiss-plugins 1.2.1 → 1.2.2

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
@@ -55,7 +55,8 @@ Plugins 页(侧边栏 **插件**)里多出一个 `dsh-hiss-plugins` 标签
55
55
  - 浏览器半是 **`lib/client.js`** —— 手写的 lazy-CJS bundle,没有构建步骤:`window.__ModuleLoader__.load({ id: "dsh-hiss-plugins", factory })` 只注册工厂,模块体(slot 注册、locale 字典)在首次被 require 时执行。`id` 必须逐字等于包名(客户端图里的行 id 就是包名)。
56
56
  - `package.json` 里 `dsh.client.platform = "web"`、`exports["./client"]` 指向 `lib/client.js`;客户端模块系统按 Loader 行扫描,**只有本包有行挂载,这个文件才会被送进浏览器**。
57
57
  - 标签注册进 Plugins 页声明的 `plugins.tab` list slot(`ctx.slots.inject("plugins.tab", …)`),排在页面自己的「已安装」标签之后;文案来自包内的 `locale/*.json`。
58
- - `exports.inject` 是浏览器侧**服务名**(`slots`、`locale`、`remote`、`remote.pluginManager`);远程调用形如 `ctx.remote.<命名空间>.<方法>`,命名空间就是 host 侧服务名。
58
+ - `exports.inject` 是浏览器侧**服务名**(`slots`、`locale`、`remote`、`remote.pluginManager`、`uiConversation`);远程调用形如 `ctx.remote.<命名空间>.<方法>`,命名空间就是 host 侧服务名。
59
+ - 浏览器半还注册 **`/mcp` 的 chat 节点投影**(`ctx.uiConversation.events.register` + `conversation.chat.node` 的零尺寸渲染器)。原因:DSH 在会话还没有 `turn/start` 时把整段对话当 blank 隐藏(chat 视图的 `isActive` 只认非 `command` 节点),只写 command 事件的 `/mcp` 在新会话里会“看不见”;报告的文本仍由 DSH 的通用 command 卡片渲染。
59
60
  - `dsh.client.inject` 列的是**其它浏览器半的包名**(`@deepseek-ai/dsh-api-remotes`、`@deepseek-ai/dsh-client-modules`)—— 浏览器侧的图依赖,不是 npm 依赖。
60
61
 
61
62
  ## git-bash 行为什么自带 realm 隔离
@@ -157,6 +158,7 @@ colgrep command:"init" / command:"status" / command:"clear"
157
158
  - **${VAR} 展开**:`${TOKEN}` / `${TOKEN:-默认值}` 在挂载时用宿主进程环境求值,`.mcp.json` 里不必写明文密钥。
158
159
  - **失败不致命**:坏 JSON、不支持的 transport、起不来的 server 都只影响它自己,打一条 warn,会话照常开。
159
160
  - **`/mcp` 看状态**:在本项目的会话里执行 `/mcp`,逐条列出 `.mcp.json` 声明的 server 与其实时状态 —— `connected, N tools`(MCP 桥连上并同步工具后才注册工具)、`no tools`(没连上,或 server 本身不暴露工具)、`skipped`(条目映射不了)、`unusable`(宿主 MCP 桥的 schema 拒绝);另外报告本会话里来自项目外配置的 MCP 工具总数。状态读的是当前 agent 自己的工具表,所以列的是**此刻真正可用**的工具;命令不接受参数。
161
+ - **新会话里立即显示**:DSH 的 Web 客户端在会话还没有任何 turn 时把整段对话当 blank 隐藏(只有 `turn/start` 会清 `sessionListMetadata.blank`),而 `/mcp` 只写 `command/run`/`command/done`。浏览器半因此给 `/mcp` 注册了一个非 `command` 的**伴随节点**(`hiss-mcp-command`,零尺寸),chat 视图立即激活——不必再先发一条消息。
160
162
 
161
163
  `.mcp.json` 就是 Claude Code 的项目级 MCP 配置文件:
162
164
 
@@ -355,8 +357,8 @@ test/ node:test:<feature>/ 七个目录 + manifest / patch / c
355
357
  ## 发布(给维护者)
356
358
 
357
359
  ```powershell
358
- git tag dsh-hiss-plugins@1.2.1 # 必须与本目录 package.json 的 version 逐字一致
359
- git push origin dsh-hiss-plugins@1.2.1
360
+ git tag dsh-hiss-plugins@1.2.2 # 必须与本目录 package.json 的 version 逐字一致
361
+ git push origin dsh-hiss-plugins@1.2.2
360
362
  ```
361
363
 
362
364
  CI(`.github/workflows/publish.yml`,Windows runner)解析 tag、跑全量测试,再用 **npm trusted publishing(OIDC,无需任何 token)** 发布;包内 `prepublishOnly` 会再跑一次 `npm test`。手工发布:`npm publish`(`publishConfig.access` 已设为 public),发版前先 `node ../scripts/smoke-profile.mjs` 走一遍真实安装 + 真启动。发布新版本前记得递增 `package.json` 的 `version`。
package/lib/client.js CHANGED
@@ -321,12 +321,56 @@ window.__ModuleLoader__.load({
321
321
  });
322
322
  }
323
323
 
324
- /** Services required by the tab registration and its Remote answers. */
324
+ /** Host command whose run this browser half projects into the chat view. */
325
+ const MCP_COMMAND = "mcp";
326
+ /**
327
+ * Chat node kind of the `/mcp` projection.
328
+ *
329
+ * DSH hides the whole transcript while a session has no turn (the chat view counts only
330
+ * non-command nodes as activity, and only a turn clears the session's blank flag), so in a
331
+ * never-messaged session the `/mcp` result — logged as `command/run` + `command/done` — would
332
+ * stay invisible until the first message starts a turn. Registering this non-command node is
333
+ * how DSH's own `ui-goal` keeps `/goal` visible; the report itself stays in the generic
334
+ * command card, which is why the renderer below draws nothing.
335
+ */
336
+ const MCP_NODE_KIND = "hiss-mcp-command";
337
+
338
+ /**
339
+ * Project one `/mcp` run as an empty chat node.
340
+ * Only `command/run` is claimed: `command/done` still renders through the generic command card,
341
+ * and every other command is untouched.
342
+ */
343
+ const mcpCommandDefinition = {
344
+ kind: MCP_NODE_KIND,
345
+ target: "chat",
346
+ match: (event) => event.type === "command/run" && event.data.name === MCP_COMMAND
347
+ ? { id: String(event.data.commandId), role: "start" }
348
+ : null,
349
+ start: (_context, match) => ({ seq: match.event.seq, commandId: match.event.data.commandId }),
350
+ buildViewNode: (context) => ({
351
+ key: context.key,
352
+ kind: MCP_NODE_KIND,
353
+ id: context.id,
354
+ target: "chat",
355
+ anchorSeq: context.state.seq - 0.1,
356
+ location: context.start?.location ?? { kind: "unresolved" },
357
+ visibility: "visible",
358
+ data: { commandId: context.state.commandId },
359
+ }),
360
+ };
361
+
362
+ /** Zero-size renderer: the node exists to keep the chat view active, not to draw the report. */
363
+ function McpCommandNodeView() {
364
+ return null;
365
+ }
366
+
367
+ /** Services required by the tab registration, its Remote answers, and the `/mcp` projection. */
325
368
  const inject = [
326
369
  "slots",
327
370
  "locale",
328
371
  "remote",
329
- "remote.pluginManager"
372
+ "remote.pluginManager",
373
+ "uiConversation"
330
374
  ];
331
375
 
332
376
  /**
@@ -339,6 +383,12 @@ window.__ModuleLoader__.load({
339
383
  en
340
384
  }), "hiss-plugins: dictionaries");
341
385
  const t = ctx.locale.bind(NS);
386
+ ctx.uiConversation.events.register(mcpCommandDefinition);
387
+ ctx.slots.inject("conversation.chat.node", () => ctx.slots.register({
388
+ name: "conversation.chat.node",
389
+ key: MCP_NODE_KIND,
390
+ locale: NS,
391
+ }, McpCommandNodeView));
342
392
  /**
343
393
  * Read the running profile's rows.
344
394
  * @returns one projected row per feature this package contributes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-hiss-plugins",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "dsh-hiss-plugins — one DeepSeek Harness bundle carrying seven independently switchable plugins (colgrep, codegraph, project-mcp, git-bash, superpowers, ponytail, init) plus a management tab in the Plugins page.",
5
5
  "keywords": [
6
6
  "dsh",