@zhushanwen/pi-ask-user 1.0.2 → 1.0.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/package.json +5 -5
- package/src/__tests__/sdk-contract.test.ts +3 -3
- package/src/channel-handler.ts +1 -1
- package/src/component.ts +1 -1
- package/src/index.ts +1 -1
- package/src/question-view.ts +1 -1
- package/src/submit-view.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/pi-ask-user",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Inline adaptive ask_user tool for Pi — single/multi-question structured input with split-pane preview, inline editor, and optional comments.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"vitest": "^4.1.8"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
38
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
39
|
+
"@earendil-works/pi-tui": "*",
|
|
40
40
|
"@sinclair/typebox": "*",
|
|
41
|
-
"@zhushanwen/pi-subagent-workflow": "
|
|
41
|
+
"@zhushanwen/pi-subagent-workflow": "0.4.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
|
-
"@
|
|
44
|
+
"@earendil-works/pi-tui": {
|
|
45
45
|
"optional": true
|
|
46
46
|
},
|
|
47
47
|
"@zhushanwen/pi-subagent-workflow": {
|
|
@@ -30,7 +30,7 @@ describe("ask-user SDK contract", () => {
|
|
|
30
30
|
registerCommand() {},
|
|
31
31
|
getAllTools() { return []; },
|
|
32
32
|
setActiveTools() {},
|
|
33
|
-
} as unknown as import("@
|
|
33
|
+
} as unknown as import("@earendil-works/pi-coding-agent").ExtensionAPI;
|
|
34
34
|
|
|
35
35
|
askUserExtension(mockPi);
|
|
36
36
|
|
|
@@ -52,7 +52,7 @@ describe("ask-user SDK contract", () => {
|
|
|
52
52
|
registerCommand() {},
|
|
53
53
|
getAllTools() { return []; },
|
|
54
54
|
setActiveTools() {},
|
|
55
|
-
} as unknown as import("@
|
|
55
|
+
} as unknown as import("@earendil-works/pi-coding-agent").ExtensionAPI;
|
|
56
56
|
askUserExtension(mockPi);
|
|
57
57
|
expect(toolDef!.renderCall!.length).toBeGreaterThanOrEqual(1);
|
|
58
58
|
});
|
|
@@ -65,7 +65,7 @@ describe("ask-user SDK contract", () => {
|
|
|
65
65
|
registerCommand() {},
|
|
66
66
|
getAllTools() { return []; },
|
|
67
67
|
setActiveTools() {},
|
|
68
|
-
} as unknown as import("@
|
|
68
|
+
} as unknown as import("@earendil-works/pi-coding-agent").ExtensionAPI;
|
|
69
69
|
askUserExtension(mockPi);
|
|
70
70
|
expect(toolDef!.renderResult!.length).toBeGreaterThanOrEqual(2);
|
|
71
71
|
});
|
package/src/channel-handler.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// handler 收到的 req.channelPayload = {questions: AskUserQuestion[], allowCancel}(proto 格式,
|
|
16
16
|
// 由子进程 askUserInteract 编码、subagent-workflow parseChannel 解析 options[0] JSON 得到)。
|
|
17
17
|
|
|
18
|
-
import type { ExtensionContext } from "@
|
|
18
|
+
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
19
19
|
import {
|
|
20
20
|
type AskUserAnswers,
|
|
21
21
|
askUserInteract,
|
package/src/component.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import { Box, Text, TruncatedText, truncateToWidth } from "@earendil-works/pi-tui";
|
|
3
|
-
import type { AgentToolResult, AgentToolUpdateCallback, ExtensionAPI, ExtensionContext, ToolRenderResultOptions } from "@
|
|
3
|
+
import type { AgentToolResult, AgentToolUpdateCallback, ExtensionAPI, ExtensionContext, ToolRenderResultOptions } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import { type Static } from "@sinclair/typebox";
|
|
5
5
|
import {
|
|
6
6
|
type AskUserAnswers,
|
package/src/question-view.ts
CHANGED
package/src/submit-view.ts
CHANGED