@zhushanwen/pi-todo 0.8.3 → 0.8.4
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 +3 -2
- package/src/handlers.ts +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/pi-todo",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
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",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"vitest": "^4.1.8"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xyz-agent/extension-protocol": "0.6.0"
|
|
32
|
+
"@xyz-agent/extension-protocol": "0.6.0",
|
|
33
|
+
"@zhushanwen/pi-extension-logger": "0.3.0"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
36
|
"@earendil-works/pi-coding-agent": "^0.84.1",
|
package/src/handlers.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import { getLogger } from "@zhushanwen/pi-extension-logger";
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
migrateTodo,
|
|
@@ -11,6 +12,8 @@ import {
|
|
|
11
12
|
} from "./model";
|
|
12
13
|
import type { TodoSessionState } from "./state";
|
|
13
14
|
|
|
15
|
+
const logger = getLogger("todo");
|
|
16
|
+
|
|
14
17
|
// ── 常量 ────────────────────────────────────────────
|
|
15
18
|
|
|
16
19
|
/** 全部完成后保留的轮数,之后再自动 clear */
|
|
@@ -78,7 +81,7 @@ export function reconstructState(state: TodoSessionState, ctx: ExtensionContext)
|
|
|
78
81
|
migrated.push(migrateTodo(t));
|
|
79
82
|
} catch (e) {
|
|
80
83
|
// best-effort 降级:脏数据(null/primitive)跳过该条,不中断会话回放
|
|
81
|
-
|
|
84
|
+
logger.debug("reconstructState: skipping dirty todo entry", { error: String(e) });
|
|
82
85
|
}
|
|
83
86
|
}
|
|
84
87
|
if (migrated.length > 0) {
|
|
@@ -155,7 +158,7 @@ export function registerTodoEventHandlers(
|
|
|
155
158
|
|
|
156
159
|
return buildBeforeAgentStartMessage(state);
|
|
157
160
|
} catch (e) {
|
|
158
|
-
|
|
161
|
+
logger.debug("before_agent_start error", { error: String(e) });
|
|
159
162
|
return undefined;
|
|
160
163
|
}
|
|
161
164
|
});
|
|
@@ -175,7 +178,7 @@ export function registerTodoEventHandlers(
|
|
|
175
178
|
}
|
|
176
179
|
} catch (e) {
|
|
177
180
|
// best-effort:agent_end 事件处理器出错不阻断会话主流程,仅记录调试日志
|
|
178
|
-
|
|
181
|
+
logger.debug("agent_end error", { error: String(e) });
|
|
179
182
|
}
|
|
180
183
|
});
|
|
181
184
|
}
|