@maxiaochao/pi-toolkit 0.10.12 → 0.10.13
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 2026-10-09 - v0.10.13
|
|
2
|
+
|
|
3
|
+
- bundle worktree v0.3.1: show a persistent in-conversation confirmation after switching worktrees
|
|
4
|
+
|
|
1
5
|
## 2026-10-09 - v0.10.12
|
|
2
6
|
|
|
3
7
|
- bundle worktree v0.3.0: automatically move Agent conversations into prepared worktrees without external Harness support
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxiaochao/pi-toolkit",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.13",
|
|
4
4
|
"description": "Personal pi coding agent toolkit: scheduler, /btw, /cache_export, apply_patch, browser automation, and bundled theme/skills.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -163,7 +163,12 @@ export default function worktreeExtension(pi: ExtensionAPI) {
|
|
|
163
163
|
switched = await ctx.switchSession(targetSessionFile, {
|
|
164
164
|
withSession: async (next) => {
|
|
165
165
|
const dirtyNote = prepared.dirty ? "(已有未提交改动)" : "";
|
|
166
|
-
next.
|
|
166
|
+
await next.sendMessage({
|
|
167
|
+
customType: "worktree-switch",
|
|
168
|
+
content: `✓ 已进入 worktree:${prepared.path}\nBranch: ${prepared.branch}${dirtyNote}`,
|
|
169
|
+
display: true,
|
|
170
|
+
details: prepared,
|
|
171
|
+
}, { triggerTurn: false });
|
|
167
172
|
},
|
|
168
173
|
});
|
|
169
174
|
} catch (error) {
|
|
@@ -31,6 +31,7 @@ async function fixture({ cancelled = false, switchError, customSessionDir = true
|
|
|
31
31
|
|
|
32
32
|
const handlers = {};
|
|
33
33
|
const sent = [];
|
|
34
|
+
const sessionMessages = [];
|
|
34
35
|
const notifications = [];
|
|
35
36
|
const execCalls = [];
|
|
36
37
|
let releaseExec;
|
|
@@ -71,13 +72,16 @@ async function fixture({ cancelled = false, switchError, customSessionDir = true
|
|
|
71
72
|
switchedTo = path;
|
|
72
73
|
if (cancelled) return { cancelled: true };
|
|
73
74
|
if (switchError) throw switchError;
|
|
74
|
-
await options.withSession({
|
|
75
|
+
await options.withSession({
|
|
76
|
+
ui: ctx.ui,
|
|
77
|
+
async sendMessage(message, options) { sessionMessages.push({ message, options }); },
|
|
78
|
+
});
|
|
75
79
|
return { cancelled: false };
|
|
76
80
|
},
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
return {
|
|
80
|
-
root, cwd, worktree, sessions, handlers, sent, notifications, execCalls, ctx,
|
|
84
|
+
root, cwd, worktree, sessions, handlers, sent, sessionMessages, notifications, execCalls, ctx,
|
|
81
85
|
execStarted,
|
|
82
86
|
releaseExec: () => releaseExec(),
|
|
83
87
|
switchedTo: () => switchedTo,
|
|
@@ -117,10 +121,15 @@ test("enter_worktree defers, forks the current session, and switches automatical
|
|
|
117
121
|
assert.equal(header.cwd, f.worktree);
|
|
118
122
|
assert.equal(header.parentSession, join(f.sessions, "source.jsonl"));
|
|
119
123
|
assert.match(readFileSync(target, "utf8"), /"id":"history-1"/);
|
|
120
|
-
assert.deepEqual(f.
|
|
121
|
-
message:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
assert.deepEqual(f.sessionMessages, [{
|
|
125
|
+
message: {
|
|
126
|
+
customType: "worktree-switch",
|
|
127
|
+
content: `✓ 已进入 worktree:${f.worktree}\nBranch: feature`,
|
|
128
|
+
display: true,
|
|
129
|
+
details: { status: "created", path: f.worktree, branch: "feature", dirty: false },
|
|
130
|
+
},
|
|
131
|
+
options: { triggerTurn: false },
|
|
132
|
+
}]);
|
|
124
133
|
} finally {
|
|
125
134
|
f.cleanup();
|
|
126
135
|
}
|