@leitwerk-dev/pi-session-transfer 0.0.0-bootstrap.0 → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2026 Leitwerk contributors.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/README.md CHANGED
@@ -1 +1,65 @@
1
- Registration placeholder only. Not a usable Leitwerk release.
1
+ # Pi session transfer for Leitwerk
2
+
3
+ Copy a retained Leitwerk process workspace and its primary Pi conversation into local Pi.
4
+ The import keeps the conversation tree and workspace files. Future turns use the local Pi
5
+ installation's models, credentials, extensions, skills, and tools.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pi install npm:@leitwerk-dev/pi-session-transfer
11
+ ```
12
+
13
+ Update or remove it through Pi:
14
+
15
+ ```bash
16
+ pi update npm:@leitwerk-dev/pi-session-transfer
17
+ pi remove npm:@leitwerk-dev/pi-session-transfer
18
+ ```
19
+
20
+ ## Use
21
+
22
+ Create a link from **More actions → Create local transfer link** in Leitwerk. Then run in
23
+ interactive Pi:
24
+
25
+ ```text
26
+ /leitwerk-transfer https://leitwerk.example/api/session-transfers/agt_…/trg_…#token=…
27
+ ```
28
+
29
+ With no argument, the command asks for the link. It defaults the new destination to
30
+ `<current-directory>/<process-instance-id>`. The destination must not exist. After validation,
31
+ Pi reserves it exclusively; a directory created there during the transfer is preserved and the
32
+ import fails.
33
+
34
+ The link is a bearer credential. Do not paste it into logs, tickets, or chat. Confirm the exact
35
+ Leitwerk origin shown by Pi before claiming it. A transfer must start within one hour. Press
36
+ `Esc` before the final local commit to cancel; the link can be explicitly retried while its grant
37
+ remains valid. Pi waits for cancellation cleanup before closing the progress view.
38
+
39
+ ## What is copied
40
+
41
+ The transfer contains:
42
+
43
+ - the complete portable process workspace, including nested Git directories, index and dirty
44
+ state, untracked and ignored files, executable bits, timestamps, and safe relative symlinks;
45
+ - the primary Pi JSONL conversation tree.
46
+
47
+ The transfer excludes Pi agent state, provider and repository credentials, dependency and mise
48
+ caches outside the workspace, private Docker state, temporary process state, and all unrelated
49
+ process-volume paths. Ownership, ACLs, extended attributes, devices, sockets, FIFOs, and hard-link
50
+ identity are not preserved.
51
+
52
+ The importer accepts Pi session format V3 only. It verifies the compressed stream digest and byte
53
+ count, validates Git branch and HEAD evidence, rewrites only the session cwd, removes source
54
+ `parentSession` metadata, places the validated JSONL in Pi's normal session store without running
55
+ Pi migration code, and then offers to switch to it.
56
+
57
+ Each import uses one mode-0600 recovery record. Verified entries move into the owned destination
58
+ before the local session is written. The record then transitions atomically from temporary import
59
+ state to a token-free completion receipt. Pi removes only stale incomplete paths that still
60
+ carry the matching ownership marker. Completed records let acknowledgement and session switching
61
+ be retried safely. A pending acknowledgement does not prevent opening the completed local session;
62
+ use the same link to retry acknowledgement without copying again. An incomplete recovery record
63
+ is retained if cleanup fails and cannot be overwritten by another import of the same link.
64
+
65
+ V1 supports interactive TUI mode only.
package/dist/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2026 Leitwerk contributors.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,5 @@
1
+ import { ExtensionAPI } from '@earendil-works/pi-coding-agent';
2
+
3
+ declare function leitwerkSessionTransfer(pi: ExtensionAPI): Promise<void>;
4
+
5
+ export { leitwerkSessionTransfer as default };