@henryqw/pi-herdr-clone 0.2.7 → 0.2.9
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/README.md +0 -14
- package/extensions/clone-tab.ts +20 -19
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,17 +40,3 @@ Both commands wait until Pi is idle, then validate the current Herdr pane (`HERD
|
|
|
40
40
|
### Failure semantics
|
|
41
41
|
|
|
42
42
|
If target creation fails outright, no clone session is kept or created. A killed or incomplete creation response is ambiguous because Herdr may have retained partial state; the error reports every identifier returned so far and suggests inspecting `herdr workspace list`. Once agent start is attempted, the target tab, panes, and session file are retained because the launch outcome can be unknown; the error reports any known IDs for recovery. A later focus failure is shown as a warning and does not report the already-started clone as failed.
|
|
43
|
-
|
|
44
|
-
## Remove
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
pi remove npm:@henryqw/pi-herdr-clone
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Development
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
npm test --workspace @henryqw/pi-herdr-clone
|
|
54
|
-
npm run typecheck --workspace @henryqw/pi-herdr-clone
|
|
55
|
-
npm run pack:check --workspace @henryqw/pi-herdr-clone
|
|
56
|
-
```
|
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.9",
|
|
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",
|