@zhushanwen/pi-session-manager 0.1.10 → 0.1.11

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
@@ -4,8 +4,8 @@ agent-managed session pi extension:把 session 的创建/发送/读取/列表/
4
4
 
5
5
  ## 通道契约
6
6
 
7
- - 工具调用经 `ctx.ui.select(SESSION_MANAGER_MARKER, [JSON], {timeout})` 发出,超时按 action 分档(create/history 60s、其余 30s,SSOT 在 `src/index.ts` 的 `SELECT_TIMEOUT_MS`);marker 为 `\x00TAIJI_SESSION_MANAGER`(NUL 前缀防与普通 select title 冲突,SSOT 在 `@taiji/extension-protocol`)
8
- - 请求体为嵌套形状 `{ action, params }`(形状 SSOT 在 `@taiji/extension-protocol`);**不要扁平化展开**——runtime event-adapter 按 `data.params` 提取,扁平化会导致 params 丢失
7
+ - 工具调用经 `ctx.ui.select(SESSION_MANAGER_MARKER, [JSON], {timeout})` 发出,超时按 action 分档(create/history 60s、其余 30s,SSOT 在 `src/index.ts` 的 `SELECT_TIMEOUT_MS`);marker 为 `\x00TAIJI_SESSION_MANAGER`(NUL 前缀防与普通 select title 冲突,SSOT 在 `@zhushanwen/extension-protocol`)
8
+ - 请求体为嵌套形状 `{ action, params }`(形状 SSOT 在 `@zhushanwen/extension-protocol`);**不要扁平化展开**——runtime event-adapter 按 `data.params` 提取,扁平化会导致 params 丢失
9
9
  - 应答方是 taiji runtime 的 `SessionManagerHandler`(select value 通道回写 JSON 字符串;取消/超时返回 null)
10
10
 
11
11
  ## 工具(6 个 action)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhushanwen/pi-session-manager",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Pi extension for managing agent-managed sessions — create, send, read history, list, status, abort via ctx.ui.select channel.",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -26,7 +26,7 @@
26
26
  "README.md"
27
27
  ],
28
28
  "dependencies": {
29
- "@taiji/extension-protocol": "0.11.0",
29
+ "@zhushanwen/extension-protocol": "0.11.0",
30
30
  "@zhushanwen/pi-extension-logger": "0.6.0"
31
31
  },
32
32
  "devDependencies": {
@@ -1,7 +1,7 @@
1
1
  // tool-execute.test.ts — U5-A2: each tool's execute calls ctx.ui.select with SESSION_MANAGER_MARKER + JSON payload
2
2
 
3
3
  import { describe, it, expect, vi, beforeEach } from "vitest";
4
- import { SESSION_MANAGER_MARKER } from "@taiji/extension-protocol";
4
+ import { SESSION_MANAGER_MARKER } from "@zhushanwen/extension-protocol";
5
5
  import registerExtension from "../index.ts";
6
6
 
7
7
  /** Capture registered tools and provide a mock ctx.ui.select. */
@@ -1,7 +1,7 @@
1
1
  // tool-registration.test.ts — U5-A1: 6 tools registered with correct name/description/parameters + SESSION_MANAGER_MARKER import
2
2
 
3
3
  import { describe, it, expect, vi } from "vitest";
4
- import { SESSION_MANAGER_MARKER } from "@taiji/extension-protocol";
4
+ import { SESSION_MANAGER_MARKER } from "@zhushanwen/extension-protocol";
5
5
  import registerExtension from "../index.ts";
6
6
 
7
7
  /** Proxy-based mock: capture registerTool calls for assertion. */
@@ -61,7 +61,7 @@ describe("U5-A1 tool-registration", () => {
61
61
  }
62
62
  });
63
63
 
64
- it("SESSION_MANAGER_MARKER is imported from @taiji/extension-protocol", () => {
64
+ it("SESSION_MANAGER_MARKER is imported from @zhushanwen/extension-protocol", () => {
65
65
  expect(typeof SESSION_MANAGER_MARKER).toBe("string");
66
66
  });
67
67
 
package/src/index.ts CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  isChannelErrorResult,
10
10
  type MarkerRpcResult,
11
11
  type SessionManagerAction,
12
- } from "@taiji/extension-protocol";
12
+ } from "@zhushanwen/extension-protocol";
13
13
  import { getLogger, setPiHandle } from "@zhushanwen/pi-extension-logger";
14
14
  import { Type, type Static, type TObject } from "typebox";
15
15
 
@@ -68,7 +68,7 @@ function callSessionManager(
68
68
  action: SessionManagerAction,
69
69
  params: Record<string, unknown>,
70
70
  ): Promise<MarkerRpcResult> {
71
- // 契约 SSOT:请求体 = 嵌套 { action, params } 形状(协议包 @taiji/extension-protocol
71
+ // 契约 SSOT:请求体 = 嵌套 { action, params } 形状(协议包 @zhushanwen/extension-protocol
72
72
  // 的 session-manager 模块)。runtime event-adapter 的 marker
73
73
  // 分支按 data.params 提取——若扁平化展开({action, ...params})params 会丢失变 {}。
74
74
  const payload = JSON.stringify({ action, params });