@zhushanwen/pi-base-tool-enhance 0.5.4 → 0.5.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhushanwen/pi-base-tool-enhance",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "Base tool enhancement - override builtin bash tool: foreground delegates to pi official factory, incremental background mode (design decisions documented in source comments)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -28,7 +28,7 @@
28
28
  "skills/"
29
29
  ],
30
30
  "dependencies": {
31
- "@taiji/extension-protocol": "0.11.0",
31
+ "@zhushanwen/extension-protocol": "0.11.0",
32
32
  "@zhushanwen/pi-ext-guards": "0.4.0",
33
33
  "@zhushanwen/pi-extension-logger": "0.6.0",
34
34
  "@zhushanwen/pi-file-lock": "0.4.0",
@@ -41,7 +41,7 @@
41
41
  "peerDependencies": {
42
42
  "@earendil-works/pi-coding-agent": "^0.84.4",
43
43
  "typebox": "*",
44
- "@zhushanwen/pi-pending-notifications": "0.7.3"
44
+ "@zhushanwen/pi-pending-notifications": "0.7.4"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "@zhushanwen/pi-pending-notifications": {
@@ -20,9 +20,9 @@ vi.mock("@earendil-works/pi-coding-agent", () => ({
20
20
  // 进程原语(ext-simplify-13 后单点在 protocol 子出口)转发真实杀 + 记录调用
21
21
  //(timeout 分支断言 killProcessTree 被调)
22
22
  const { killTreeCalls } = vi.hoisted(() => ({ killTreeCalls: [] as number[] }));
23
- vi.mock("@taiji/extension-protocol/background-task", async (importOriginal) => {
23
+ vi.mock("@zhushanwen/extension-protocol/background-task", async (importOriginal) => {
24
24
  const orig = await importOriginal<
25
- typeof import("@taiji/extension-protocol/background-task")
25
+ typeof import("@zhushanwen/extension-protocol/background-task")
26
26
  >();
27
27
  return {
28
28
  ...orig,
@@ -33,7 +33,7 @@ vi.mock("@taiji/extension-protocol/background-task", async (importOriginal) => {
33
33
  };
34
34
  });
35
35
 
36
- import { isPidAlive } from "@taiji/extension-protocol/background-task";
36
+ import { isPidAlive } from "@zhushanwen/extension-protocol/background-task";
37
37
 
38
38
  import { createBashKillToolDefinition } from "../bash-kill-tool.ts";
39
39
  import { createBashOutputToolDefinition } from "../bash-output-tool.ts";
@@ -8,7 +8,7 @@ import { join } from "node:path";
8
8
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
9
9
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
10
10
 
11
- import { killProcessTree } from "@taiji/extension-protocol/background-task";
11
+ import { killProcessTree } from "@zhushanwen/extension-protocol/background-task";
12
12
  import {
13
13
  BACKGROUND_BASH_CUSTOM_TYPE,
14
14
  buildNotificationContent,
@@ -10,7 +10,7 @@ import {
10
10
  BACKGROUND_TASK_ID_PREFIX,
11
11
  collectActivePendingIds,
12
12
  mapReasonToStatus,
13
- } from "@taiji/extension-protocol";
13
+ } from "@zhushanwen/extension-protocol";
14
14
  import { afterEach, describe, expect, it, vi } from "vitest";
15
15
 
16
16
  import {
@@ -5,7 +5,7 @@ import { join } from "node:path";
5
5
 
6
6
  import { afterEach, describe, expect, it } from "vitest";
7
7
 
8
- import { MAX_TERMINAL_REGISTRY_ENTRIES } from "@taiji/extension-protocol";
8
+ import { MAX_TERMINAL_REGISTRY_ENTRIES } from "@zhushanwen/extension-protocol";
9
9
 
10
10
  import {
11
11
  getRegistryPath,
@@ -8,7 +8,7 @@
8
8
  * - readTailSummary:exit 边沿的 tail 摘要(存条目 / M3 通知用)
9
9
  */
10
10
 
11
- import { readOutputTail as readOutputTailPrimitive } from "@taiji/extension-protocol/background-task";
11
+ import { readOutputTail as readOutputTailPrimitive } from "@zhushanwen/extension-protocol/background-task";
12
12
 
13
13
  /** pi 内置 bash 同款截断上限(last 2000 lines / 50KB = 51200 bytes,先到为准)。 */
14
14
  export const TAIL_MAX_LINES = 2000;
@@ -35,8 +35,8 @@ import {
35
35
  BACKGROUND_TASK_ID_PREFIX,
36
36
  collectActivePendingIds,
37
37
  mapReasonToStatus,
38
- } from "@taiji/extension-protocol";
39
- import { isPidAlive } from "@taiji/extension-protocol/background-task";
38
+ } from "@zhushanwen/extension-protocol";
39
+ import { isPidAlive } from "@zhushanwen/extension-protocol/background-task";
40
40
  import { toErrorMessage } from "@zhushanwen/pi-ext-guards";
41
41
  import { getLogger } from "@zhushanwen/pi-extension-logger";
42
42
 
@@ -13,7 +13,7 @@
13
13
  * 可查、对账可补),不加同步握手。
14
14
  */
15
15
 
16
- import { isPidAlive } from "@taiji/extension-protocol/background-task";
16
+ import { isPidAlive } from "@zhushanwen/extension-protocol/background-task";
17
17
 
18
18
  import { readTailSummary } from "./output-tail.ts";
19
19
  import { readRegistry, taskToRegistryEntry, writeRegistryEntry } from "./registry.ts";
@@ -27,7 +27,7 @@
27
27
  * 本单元不管。
28
28
  */
29
29
 
30
- import { killProcessTree } from "@taiji/extension-protocol/background-task";
30
+ import { killProcessTree } from "@zhushanwen/extension-protocol/background-task";
31
31
  import { toErrorMessage } from "@zhushanwen/pi-ext-guards";
32
32
  import { getLogger } from "@zhushanwen/pi-extension-logger";
33
33
 
@@ -7,7 +7,7 @@
7
7
  * 写入。
8
8
  *
9
9
  * 行为原语单点(ext-simplify-13):解析防御 / corrupt 隔离 / 原子写 / 序列化 /
10
- * 终态 LRU 裁剪自 @taiji/extension-protocol background-task 子出口引入——此前
10
+ * 终态 LRU 裁剪自 @zhushanwen/extension-protocol background-task 子出口引入——此前
11
11
  * 本地实现与 runtime 侧逐字同构、靠注释对齐;本模块只保留 bte 形态薄壳:Map 投影
12
12
  * readRegistry 与锁内 RMW 写壳。
13
13
  *
@@ -26,14 +26,14 @@ import { join } from "node:path";
26
26
 
27
27
  // 契约常量(LRU 上限)走 index 出口(background-task.ts 契约面);行为原语走
28
28
  // background-task 子出口(含 node 内建依赖,不进 index——renderer/core 零触达)
29
- import { MAX_TERMINAL_REGISTRY_ENTRIES } from "@taiji/extension-protocol";
29
+ import { MAX_TERMINAL_REGISTRY_ENTRIES } from "@zhushanwen/extension-protocol";
30
30
  import {
31
31
  atomicWriteRegistry,
32
32
  readRegistry as readRegistryEntries,
33
33
  serializeRegistryFile,
34
34
  trimTerminalEntries,
35
35
  type RegistryFileLogFn,
36
- } from "@taiji/extension-protocol/background-task";
36
+ } from "@zhushanwen/extension-protocol/background-task";
37
37
  import { toErrorMessage } from "@zhushanwen/pi-ext-guards";
38
38
  import { getLogger } from "@zhushanwen/pi-extension-logger";
39
39
  import { withFileLockSync } from "@zhushanwen/pi-file-lock";
@@ -17,7 +17,7 @@ import { mkdirSync, openSync, closeSync, accessSync, constants } from "node:fs";
17
17
  import { dirname, join } from "node:path";
18
18
  import { randomBytes } from "node:crypto";
19
19
 
20
- import { getProcessStartTimeSec, killProcessTree, pidStartMatchesRegistered } from "@taiji/extension-protocol/background-task";
20
+ import { getProcessStartTimeSec, killProcessTree, pidStartMatchesRegistered } from "@zhushanwen/extension-protocol/background-task";
21
21
  import { toErrorMessage } from "@zhushanwen/pi-ext-guards";
22
22
  import { getLogger } from "@zhushanwen/pi-extension-logger";
23
23
 
@@ -28,7 +28,7 @@
28
28
  * 未来新增写路径(如 maintenance 类)必须保持该顺序,违反即 intent 可丢失。
29
29
  */
30
30
 
31
- import { trimTerminalEntries } from "@taiji/extension-protocol/background-task";
31
+ import { trimTerminalEntries } from "@zhushanwen/extension-protocol/background-task";
32
32
 
33
33
  import {
34
34
  isActiveState,
@@ -8,7 +8,7 @@
8
8
  * 条目记 ownerPiPid(M2 只负责写入)
9
9
  *
10
10
  * 契约改引(u-bte-remove):registry 持久化形状(RegistryEntry / 状态机 / reason
11
- * 枚举 / active·terminal 判定)与 @taiji/extension-protocol background-task.ts
11
+ * 枚举 / active·terminal 判定)与 @zhushanwen/extension-protocol background-task.ts
12
12
  * 契约逐字段一致(契约文档头声明基线即本文件 + registry.ts),本地副本已删除、
13
13
  * 此处 re-export 并保留包内短名——消费方 import 路径与字段语义零变化。运行时
14
14
  * 对象类型(BackgroundTask / KillingIntent)不在契约内(剥离非持久字段前的形状),
@@ -19,18 +19,18 @@ import type { ChildProcess } from "node:child_process";
19
19
  import type {
20
20
  BackgroundTaskEndReason as ContractEndReason,
21
21
  BackgroundTaskState as ContractState,
22
- } from "@taiji/extension-protocol";
22
+ } from "@zhushanwen/extension-protocol";
23
23
 
24
24
  /** 状态机与 reason 枚举 / 持久化条目 / active·terminal 判定:契约 SSOT re-export。 */
25
25
  export type {
26
26
  BackgroundTaskRegistryEntry as RegistryEntry,
27
27
  BackgroundTaskState,
28
28
  BackgroundTaskEndReason,
29
- } from "@taiji/extension-protocol";
29
+ } from "@zhushanwen/extension-protocol";
30
30
  export {
31
31
  isActiveBackgroundTaskState as isActiveState,
32
32
  isTerminalBackgroundTaskState as isTerminalState,
33
- } from "@taiji/extension-protocol";
33
+ } from "@zhushanwen/extension-protocol";
34
34
 
35
35
  /**
36
36
  * killing intent:bash_kill / 后台 timeout 已发令、轮询器 exit 边沿未确认的瞬态标记。
@@ -18,7 +18,7 @@
18
18
 
19
19
  import type { AgentToolResult, ExtensionContext } from "@earendil-works/pi-coding-agent";
20
20
  import { getAgentDir } from "@earendil-works/pi-coding-agent";
21
- import { getProcessStartTimeSec, isPidAlive, killProcessTree } from "@taiji/extension-protocol/background-task";
21
+ import { getProcessStartTimeSec, isPidAlive, killProcessTree } from "@zhushanwen/extension-protocol/background-task";
22
22
  import { Type } from "typebox";
23
23
 
24
24
  import { toErrorMessage } from "@zhushanwen/pi-ext-guards";
@@ -14,7 +14,7 @@
14
14
 
15
15
  import type { AgentToolResult, ExtensionContext } from "@earendil-works/pi-coding-agent";
16
16
  import { getAgentDir } from "@earendil-works/pi-coding-agent";
17
- import { readOutputTail } from "@taiji/extension-protocol/background-task";
17
+ import { readOutputTail } from "@zhushanwen/extension-protocol/background-task";
18
18
  import { Type } from "typebox";
19
19
 
20
20
  import { TAIL_MAX_BYTES, TAIL_MAX_LINES } from "./background/output-tail.ts";