@zhushanwen/pi-todo 0.4.2 → 0.5.0
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 +2 -2
- package/src/commands.ts +8 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/pi-todo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "AI-driven todo list for Pi — stateful task management with session persistence and /todos command.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@earendil-works/pi-coding-agent": "*",
|
|
32
32
|
"@earendil-works/pi-tui": "*",
|
|
33
33
|
"@earendil-works/pi-ai": "*",
|
|
34
|
-
"
|
|
34
|
+
"typebox": "*"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@earendil-works/pi-tui": {
|
package/src/commands.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* 用户在 TUI 中不可见。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { ExtensionAPI, ExtensionCommandContext, Theme } from "@earendil-works/pi-coding-agent";
|
|
9
|
+
import type { ExtensionAPI, ExtensionCommandContext, KeybindingsManager, Theme } from "@earendil-works/pi-coding-agent";
|
|
10
|
+
import type { TUI } from "@earendil-works/pi-tui";
|
|
10
11
|
|
|
11
12
|
import type { TodoSessionState } from "./state";
|
|
12
13
|
import { TodoListComponent } from "./component";
|
|
@@ -21,8 +22,12 @@ export function registerTodosCommand(pi: ExtensionAPI, state: TodoSessionState):
|
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
// ctx.ui.custom 的 factory 签名为
|
|
26
|
+
// (tui: TUI, theme: Theme, keybindings: KeybindingsManager, done: (result) => void)
|
|
27
|
+
// 返回 Component & { dispose?(): void }。TodoListComponent 实现该形状,
|
|
28
|
+
// done 接收 result(此处忽略)。
|
|
29
|
+
await ctx.ui.custom((_tui: TUI, theme: Theme, _kb: KeybindingsManager, done: (result: unknown) => void) => {
|
|
30
|
+
return new TodoListComponent(state.todos, theme, () => done(undefined));
|
|
26
31
|
});
|
|
27
32
|
},
|
|
28
33
|
});
|