@zhushanwen/pi-goal 0.10.0 → 0.11.1
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/adapters/ports.ts +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/pi-goal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Codex-style /goal command for Pi — persistent goal-driven autonomous loop with evidence-based completion, token/time budgets, blocked detection, and steering templates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"index.ts"
|
|
26
26
|
],
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@earendil-works/pi-ai": "^0.84.
|
|
29
|
-
"@earendil-works/pi-coding-agent": "^0.84.
|
|
30
|
-
"@earendil-works/pi-tui": "^0.84.
|
|
28
|
+
"@earendil-works/pi-ai": "^0.84.4",
|
|
29
|
+
"@earendil-works/pi-coding-agent": "^0.84.4",
|
|
30
|
+
"@earendil-works/pi-tui": "^0.84.4",
|
|
31
31
|
"typebox": "*",
|
|
32
|
-
"@zhushanwen/pi-pending-notifications": "0.
|
|
32
|
+
"@zhushanwen/pi-pending-notifications": "0.5.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@xyz-agent/extension-protocol": "0.7.0"
|
package/src/adapters/ports.ts
CHANGED
|
@@ -53,7 +53,12 @@ export function buildPorts(pi: ExtensionAPI, ctx: ExtensionContext): ServicePort
|
|
|
53
53
|
// host 侧 event-adapter 检测 marker 解码还原。guiSetWidget 无 isGui 守卫
|
|
54
54
|
// (helpers.ts 仅查 ctx.ui?.setWidget 存在性),isGui 判定在 updateWidget
|
|
55
55
|
// 外层(projection/widget.ts)。
|
|
56
|
-
|
|
56
|
+
//
|
|
57
|
+
// 断言根因:pi ExtensionUIContext.custom 是泛型方法(返回 Promise<T>),
|
|
58
|
+
// 与 GuiContext.ui.custom 的具体返回类型静态不兼容,但 mode/hasUI/ui 其余
|
|
59
|
+
// 成员形状一致(ExtensionMode 与 GuiContext.mode union 完全相同)——
|
|
60
|
+
// 单层直接断言可过 tsc(guiSetWidget 仅读 ui.setWidget,custom 不参与)。
|
|
61
|
+
guiSetWidget(ctx as GuiContext, name, result);
|
|
57
62
|
},
|
|
58
63
|
setStatus(name: string, text: string | undefined): void {
|
|
59
64
|
ctx.ui.setStatus(name, text);
|
|
@@ -65,8 +70,9 @@ export function buildPorts(pi: ExtensionAPI, ctx: ExtensionContext): ServicePort
|
|
|
65
70
|
return Boolean(ctx.hasUI);
|
|
66
71
|
},
|
|
67
72
|
get isGui(): boolean {
|
|
68
|
-
// RPC 模式 = GUI 渲染通道有效;TUI/json/print 走 pi
|
|
69
|
-
|
|
73
|
+
// RPC 模式 = GUI 渲染通道有效;TUI/json/print 走 pi 原生渲染。
|
|
74
|
+
// 断言同 setGuiWidget:custom 泛型签名静态不兼容,mode 单字段运行时可靠。
|
|
75
|
+
return isGuiCapable(ctx as GuiContext);
|
|
70
76
|
},
|
|
71
77
|
// ThemeLike 形状:透传 ctx.ui.theme 的 fg/bold。
|
|
72
78
|
// Theme.fg 只接受 ThemeColor 字面量 union(SDK 契约);projection 层保证传入 union 内字面量,
|