@henryqw/pi-herdr-clone 0.2.7 → 0.2.8
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/extensions/clone-tab.ts +20 -19
- package/package.json +2 -2
package/extensions/clone-tab.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
createHerdrClient,
|
|
14
14
|
herdrCommandFailure,
|
|
15
|
-
|
|
15
|
+
startPiAgent,
|
|
16
16
|
withWorktreeLock,
|
|
17
17
|
type HerdrClient,
|
|
18
18
|
type HerdrExecResult,
|
|
@@ -199,24 +199,25 @@ async function launchCloneAgent(
|
|
|
199
199
|
): Promise<string> {
|
|
200
200
|
const agentName = `clone-${randomUUID().replaceAll("-", "").slice(0, 24)}`;
|
|
201
201
|
try {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
202
|
+
const result = await startPiAgent(herdr, {
|
|
203
|
+
name: agentName,
|
|
204
|
+
pane: rootPaneId,
|
|
205
|
+
args: ["--session", cloneFile],
|
|
206
|
+
options: { cwd: ctx.cwd },
|
|
207
|
+
onPaneBusy: onPaneBusy
|
|
208
|
+
? async () => {
|
|
209
|
+
const next = await onPaneBusy!();
|
|
210
|
+
rootPaneId = next.rootPaneId;
|
|
211
|
+
retained = next.retained;
|
|
212
|
+
return rootPaneId;
|
|
213
|
+
}
|
|
214
|
+
: undefined,
|
|
215
|
+
});
|
|
216
|
+
if (result.code === 0 && !result.killed) return agentName;
|
|
217
|
+
const startArgs = [
|
|
218
|
+
"agent", "start", agentName, "--kind", "pi", "--pane", rootPaneId, "--", "--session", cloneFile,
|
|
219
|
+
];
|
|
220
|
+
throw new Error(herdrCommandFailure(startArgs, result));
|
|
220
221
|
} catch (error) {
|
|
221
222
|
throw new Error(
|
|
222
223
|
`Clone launch could not be confirmed after starting agent ${agentName}; retained ${retained}: ${errorMessage(error)}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-herdr-clone",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Clone the current Pi conversation path into a new Herdr tab.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@earendil-works/pi-coding-agent": "^0.84.2"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@henryqw/pi-herdr": "^0.
|
|
31
|
+
"@henryqw/pi-herdr": "^0.4.0"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|