@henryqw/pi-herdr-clone 0.3.0 → 0.3.2

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.
Files changed (2) hide show
  1. package/README.md +24 -14
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # `@henryqw/pi-herdr-clone`
2
2
 
3
- Pi extension that clones the current conversation path into a new Pi process in a new tab of the current Herdr workspace, or into a new Herdr Git worktree workspace. Requires Pi Coding Agent 0.84.x (minimum 0.84.2) and a Pi session running inside Herdr.
3
+ Clone the current Pi conversation path into a new Herdr tab or Git worktree workspace.
4
4
 
5
5
  ## Why
6
6
 
7
- - **Created for**: Spawning a new Pi process that continues the current conversation, either as a workspace tab or in a fresh Git worktree.
8
- - **Advantage**: Clones copy only the active root-to-leaf session path, leaving sibling branches and the original session untouched.
7
+ - **Created for**: Start a new Pi process that continues the current conversation in a workspace tab or fresh Git worktree.
8
+ - **Advantage**: Clones copy only the active root-to-leaf session path. They leave sibling branches and the original session untouched.
9
9
 
10
10
  ## Install
11
11
 
@@ -13,6 +13,8 @@ Pi extension that clones the current conversation path into a new Pi process in
13
13
  pi install npm:@henryqw/pi-herdr-clone
14
14
  ```
15
15
 
16
+ Requires a Pi session running inside Herdr.
17
+
16
18
  ## Use
17
19
 
18
20
  | Surface | Type | Purpose |
@@ -20,23 +22,31 @@ pi install npm:@henryqw/pi-herdr-clone
20
22
  | `/clone-tab` | command | Clone the current conversation into a new tab of the current Herdr workspace. |
21
23
  | `/clone-worktree` | command | Clone the current conversation into a new Herdr Git worktree workspace. |
22
24
 
23
- Both commands immediately validate the current Herdr pane (`HERDR_ENV=1`, `HERDR_PANE_ID`), the session file, and the current session leaf. They copy only the active root-to-leaf path available when invoked into a new persisted session file: sibling branches and any still-streaming assistant output are excluded, and the original Pi session is not switched. Neither command has configuration.
25
+ The active conversation path is the saved messages from the session root to its current leaf. Both commands validate the current Herdr pane (`HERDR_ENV=1`, `HERDR_PANE_ID`), the session file, and the current session leaf immediately.
26
+
27
+ They copy only the active root-to-leaf path available when invoked into a new persisted session file. Sibling branches and still-streaming assistant output are excluded.
28
+
29
+ The original Pi session is not switched. Neither command has configuration.
24
30
 
25
31
  ### `/clone-tab` behavior
26
32
 
27
- 1. Creates an unfocused Herdr tab in the current workspace with the current working directory.
28
- 2. Starts Pi in the tab's root pane with `--session <absolute-clone-file>`.
29
- 3. Focuses the new tab after Pi starts successfully.
33
+ 1. Create an unfocused Herdr tab in the current workspace with the current working directory.
34
+ 2. Start Pi in the tab's root pane with `--session <absolute-clone-file>`.
35
+ 3. Focus the new tab after Pi starts successfully.
30
36
 
31
37
  ### `/clone-worktree` behavior
32
38
 
33
- 1. Creates a Git worktree-backed workspace with `herdr worktree create --workspace <current-workspace> --no-focus`; Herdr creates the branch from `HEAD` unless the name exists, checks out the worktree under its configured `worktrees.directory`, and opens it as a grouped workspace.
34
- 2. Waits briefly for any worktree-layout plugin (for example `herdr-plus`) to start its own agent in the new workspace's root pane.
35
- 3. If the root pane is occupied, creates an additional unfocused tab in the new workspace with the checkout as its working directory, so the plugin's agent and the clone coexist. Otherwise the clone uses the root pane.
36
- 4. Copies the active path into a clone session stamped with the fresh checkout path as its working directory.
37
- 5. Starts Pi in the chosen pane with `--session <absolute-clone-file>`.
38
- 6. Focuses the clone's tab after Pi starts successfully.
39
+ 1. Create a Git worktree-backed workspace with `herdr worktree create --workspace <current-workspace> --no-focus`.
40
+ Herdr creates the branch from `HEAD` unless the name exists, checks out the worktree under its configured `worktrees.directory`, and opens it as a grouped workspace.
41
+ 2. Wait briefly for a worktree-layout plugin, such as `herdr-plus`, to start its agent in the new workspace's root pane.
42
+ 3. If the root pane is occupied, create an additional unfocused tab in the new workspace with the checkout as its working directory. The plugin's agent and the clone then coexist. Otherwise, use the root pane.
43
+ 4. Copy the active path into a clone session stamped with the fresh checkout path as its working directory.
44
+ 5. Start Pi in the chosen pane with `--session <absolute-clone-file>`.
45
+ 6. Focus the clone's tab after Pi starts successfully.
39
46
 
40
47
  ### Failure semantics
41
48
 
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.
49
+ - **Target creation failed:** No clone session is kept or created.
50
+ - **Killed or incomplete creation response:** The result is ambiguous because Herdr may have retained partial state. The error reports every identifier returned so far and suggests inspecting `herdr workspace list`.
51
+ - **Agent start attempted:** Retain the target tab, panes, and session file because the launch outcome can be unknown. The error reports any known IDs for recovery.
52
+ - **Later focus failure:** Show a warning. Do not report the already-started clone as failed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-herdr-clone",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Clone the current Pi conversation path into a new Herdr tab.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -15,9 +15,9 @@
15
15
  },
16
16
  "license": "MIT",
17
17
  "files": [
18
+ "LICENSE",
18
19
  "extensions",
19
- "README.md",
20
- "LICENSE"
20
+ "README.md"
21
21
  ],
22
22
  "scripts": {
23
23
  "test": "node --test test/*.test.ts",
@@ -25,7 +25,7 @@
25
25
  "pack:check": "npm pack --dry-run"
26
26
  },
27
27
  "peerDependencies": {
28
- "@earendil-works/pi-coding-agent": "^0.84.2"
28
+ "@earendil-works/pi-coding-agent": "^0.84.4"
29
29
  },
30
30
  "dependencies": {
31
31
  "@henryqw/pi-herdr": "^0.4.0"