{"_id":"@datspike/pi-fork-resume","name":"@datspike/pi-fork-resume","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@datspike/pi-fork-resume","version":"0.1.0","description":"Pi extension that forks a session selected through the resume-style session picker without opening the source session.","type":"module","keywords":["pi-package","pi","pi-coding-agent","extension","fork","resume","session"],"author":{"name":"Enzo Lucchesi","email":"enzo@edl.sh"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/datspike/pi-fork-resume.git"},"bugs":{"url":"https://github.com/datspike/pi-fork-resume/issues"},"homepage":"https://github.com/datspike/pi-fork-resume#readme","publishConfig":{"access":"public"},"pi":{"extensions":["./src/index.ts"]},"scripts":{"test":"node --test --import tsx tests/**/*.test.ts","typecheck":"tsc --noEmit","check":"npm run typecheck && npm test && npm pack --dry-run"},"peerDependencies":{"@mariozechner/pi-coding-agent":"*","@mariozechner/pi-tui":"*"},"devDependencies":{"@mariozechner/pi-coding-agent":"^0.72.0","@mariozechner/pi-tui":"^0.72.0","@types/node":"^24.3.0","tsx":"^4.20.6","typescript":"^5.9.3"},"engines":{"node":">=20.6.0"},"_id":"@datspike/pi-fork-resume@0.1.0","gitHead":"9540ca3be6fee181218925273fa368da074db96f","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-dKIWtTrNlQGGpW2XuKFbWDc2HNC19C9kpjz+idNoJG9QQjAGkjZfbvumFY6WOoFX14xELj/huG6N1TYdBnQkow==","shasum":"2292326d2265cd624bc45441519d6d78304255e3","tarball":"https://registry.npmjs.org/@datspike/pi-fork-resume/-/pi-fork-resume-0.1.0.tgz","fileCount":6,"unpackedSize":13285,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEzX9D4MqjT545lNwpvdsUHtt1LdwIHhIak3YpN+N0jcAiEAjjFCY54EWsYgB1ZFIfoqrNXxKORaGejeNGL+lxKSEB4="}]},"_npmUser":{"name":"datspike","email":"elesin38@gmail.com"},"directories":{},"maintainers":[{"name":"datspike","email":"elesin38@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-fork-resume_0.1.0_1777718957209_0.890943147221452"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-02T10:49:17.123Z","0.1.0":"2026-05-02T10:49:17.354Z","modified":"2026-05-02T10:49:17.546Z"},"maintainers":[{"name":"datspike","email":"elesin38@gmail.com"}],"description":"Pi extension that forks a session selected through the resume-style session picker without opening the source session.","homepage":"https://github.com/datspike/pi-fork-resume#readme","keywords":["pi-package","pi","pi-coding-agent","extension","fork","resume","session"],"repository":{"type":"git","url":"git+https://github.com/datspike/pi-fork-resume.git"},"author":{"name":"Enzo Lucchesi","email":"enzo@edl.sh"},"bugs":{"url":"https://github.com/datspike/pi-fork-resume/issues"},"license":"MIT","readme":"# @datspike/pi-fork-resume\n\nPi extension that forks a session selected through the resume-style session picker without opening the source session.\n\n## Why\n\nPi already has useful primitives:\n\n- `pi --fork <path|id>` safely forks a session, but only at process startup.\n- `/resume` has the right global session picker, but opens the selected session as the active file.\n- `/fork` forks the current active session from a selected message.\n\nThis package fills the gap: choose any existing session from the resume picker, copy it into a new fork for the current project, and switch to that fork.\n\n## Install\n\n```bash\npi install npm:@datspike/pi-fork-resume\n```\n\nFor local development:\n\n```bash\npi -e /home/spike/hobby/pi-fork-resume\n```\n\n## Commands\n\n### `/fork-resume`\n\n1. Waits until the current agent turn is idle.\n2. Opens the same session picker component used by `/resume`.\n3. Lets you choose a session from the current project or all projects.\n4. Creates a new session via `SessionManager.forkFrom(sourcePath, ctx.cwd, ctx.sessionManager.getSessionDir())`.\n5. Switches to the newly created fork via `ctx.switchSession(forkedFile)`.\n\nThe selected source session is not resumed and is not opened as the active session.\n\n### `/fork-picker`\n\nAlias for `/fork-resume`.\n\n## Current `/fork` limitation\n\nThe intended long-term UX is to make `/fork` open the resume-style picker. In Pi `0.70.6`, built-in interactive commands are handled before extension commands, and `/fork` is hardcoded to the current-session message picker. A package-level extension cannot safely override that behavior.\n\nThis extension deliberately avoids monkey patching Pi internals. When Pi exposes built-in command override hooks or changes command priority, the implementation can register `/fork` as a thin alias to the same workflow.\n\n## Development\n\n```bash\nnpm install\nnpm run check\n```\n\nThe architecture keeps Pi wiring thin:\n\n- `src/index.ts` registers commands and adapts Pi APIs.\n- `src/fork-resume.ts` contains the testable workflow.\n- `src/session-label.ts` contains fallback selector formatting helpers.\n- `tests/*.test.ts` cover cancellation, fork errors, switch cancellation, and option formatting.\n\n## Release\n\n```bash\nnpm version patch\nnpm publish --access public\n```\n\nThe package is published as a Pi package through the `pi.extensions` manifest in `package.json`.\n","readmeFilename":"README.md","_rev":"1-622719257a2fdbd71c260bba9cd47114"}