{"_id":"@demo-0416/smart-copy","_rev":"2-9e6ce3ba7ea3467a7fa5cdfcedcbb231","name":"@demo-0416/smart-copy","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@demo-0416/smart-copy","version":"0.1.0","keywords":["pi-package","pi-extension","clipboard","copy"],"author":{"name":"Demo-0416"},"license":"MIT","_id":"@demo-0416/smart-copy@0.1.0","maintainers":[{"name":"demo-0416","email":"3114147163@qq.com"}],"homepage":"https://github.com/Demo-0416/my-pi-extensions#readme","bugs":{"url":"https://github.com/Demo-0416/my-pi-extensions/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"8d6bee01ca72111f7062e7815af33701c3eea91c","tarball":"https://registry.npmjs.org/@demo-0416/smart-copy/-/smart-copy-0.1.0.tgz","fileCount":7,"integrity":"sha512-x/feuWHN6Q4zCEagPBdh6LZy94iPbW6XuvS5PSvSmWaGDRHhyJqXCudz1QLC9zkumoFrpQxOX4KTSSL7O2bDUg==","signatures":[{"sig":"MEYCIQCvwc+fkr9q4yVpMrBmX7HCUOGhwn9JPIxIOfuNxpGoyAIhANNYCDaioMQg8QVkIbXn2shc3IeH1qIQgVtI+fwcpPim","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23104},"main":"src/index.ts","type":"module","gitHead":"90d0b8f83a7f53cfaeee322afac15a14f8fe0116","_npmUser":{"name":"demo-0416","email":"3114147163@qq.com"},"repository":{"url":"git+https://github.com/Demo-0416/my-pi-extensions.git","type":"git","directory":"smart-copy"},"_npmVersion":"11.6.3","description":"pi extension: smart copy — segment-aware /copyx (code blocks, Markdown sections, multi-message picker)","directories":{},"_nodeVersion":"24.10.0","dependencies":{"marked":"^15.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/smart-copy_0.1.0_1787133309259_0.39124667826399717","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@demo-0416/smart-copy","version":"0.1.1","description":"pi extension: smart copy — segment-aware /copyx (code blocks, Markdown sections, multi-message picker)","keywords":["pi-package","pi-extension","clipboard","copy"],"type":"module","main":"src/index.ts","license":"MIT","author":{"name":"Demo-0416"},"repository":{"type":"git","url":"git+https://github.com/Demo-0416/my-pi-extensions.git","directory":"smart-copy"},"pi":{"extensions":["./src/index.ts"]},"dependencies":{"marked":"^15.0.0"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*","@earendil-works/pi-tui":"*"},"gitHead":"90d0b8f83a7f53cfaeee322afac15a14f8fe0116","_id":"@demo-0416/smart-copy@0.1.1","bugs":{"url":"https://github.com/Demo-0416/my-pi-extensions/issues"},"homepage":"https://github.com/Demo-0416/my-pi-extensions#readme","_nodeVersion":"24.10.0","_npmVersion":"11.6.3","dist":{"integrity":"sha512-rsD5SUk2e20KQSqPuzrTg2avnlVPE3j8CHGcSp8SFNevI0Nlqom5swX29cQzyzT30jkZ5lSNxu+HmwhIpFuidg==","shasum":"a7ebeacf194c9a8fbaeeb7d96230019287a3d366","tarball":"https://registry.npmjs.org/@demo-0416/smart-copy/-/smart-copy-0.1.1.tgz","fileCount":7,"unpackedSize":23165,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC9baJMfv14M8ZJhIk6fu3wKzBTcTqDd+TvRjn/Wjs2QAiEAvKXPvVSXaMjvCxcFYsPSw4qfUku6dG6pxcNMBHZUOcQ="}]},"_npmUser":{"name":"demo-0416","email":"3114147163@qq.com"},"directories":{},"maintainers":[{"name":"demo-0416","email":"3114147163@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/smart-copy_0.1.1_1787133378286_0.0319281915733034"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-19T09:55:09.059Z","modified":"2026-08-19T09:56:18.617Z","0.1.0":"2026-08-19T09:55:09.383Z","0.1.1":"2026-08-19T09:56:18.424Z"},"bugs":{"url":"https://github.com/Demo-0416/my-pi-extensions/issues"},"author":{"name":"Demo-0416"},"license":"MIT","homepage":"https://github.com/Demo-0416/my-pi-extensions#readme","keywords":["pi-package","pi-extension","clipboard","copy"],"repository":{"type":"git","url":"git+https://github.com/Demo-0416/my-pi-extensions.git","directory":"smart-copy"},"description":"pi extension: smart copy — segment-aware /copyx (code blocks, Markdown sections, multi-message picker)","maintainers":[{"name":"demo-0416","email":"3114147163@qq.com"}],"readme":"# smart-copy\n\npi 扩展：模仿 Claude Code 的 `/copy`，支持智能切段（代码块、Markdown 章节）和多消息选择的 `/copyx` 命令。\n\n## 安装\n\n```bash\npi install npm:@demo-0416/smart-copy\n```\n\n## 功能\n\n- `/copyx [N]` — 复制第 N 条（1 = 最新，默认）assistant 消息，上限 20 条\n- 选择器条目（按顺序）：\n  1. **Full response** — 全量回复\n  2. **Last code block** — 最后一个代码块（高频快捷项，仅有代码块时出现）\n  3. **每个代码块** — label 为代码首行（截断 60 显示列，中文宽字符感知）\n  4. **每个 Markdown 章节** — 按 ATX heading 切分（含子章节内容）\n  5. **Always copy full response** — 写入偏好后跳过选择器\n- 代码块和章节都为 0 时不弹选择器，直接全量复制\n\n## 快捷键\n\n| 按键 | 作用 |\n|---|---|\n| `ctrl+shift+x` | 等价 `/copyx 1` |\n| `↑↓` | 选择器导航 |\n| `Enter` | 复制选中项 |\n| `Esc` | 取消 |\n| `[` `]` 或 `←` `→` | 切换上一条/下一条候选消息 |\n| `w` | 当前高亮项写入 `$TMPDIR/pi-copy/<file>`（代码块按语言给扩展名） |\n| 直接打字 | 过滤条目 |\n\n复制成功提示 `Copied X chars to clipboard`。\n\n## 配置\n\n偏好文件 `~/.pi/agent/smart-copy.json`：\n\n```json\n{ \"alwaysFull\": true }\n```\n\n- 选择器里选 **Always copy full response** 即写入 `alwaysFull: true`，此后 `/copyx` 直接全量复制\n- 删除该字段（或整个文件）即恢复选择器\n\n## 复制与 fallback\n\n主路径 `copyToClipboard`（pi 内置降级链：原生 addon → pbcopy/clip/wl-copy/xclip/xsel/termux → SSH OSC 52）。全失败时写入 `$TMPDIR/pi-copy/response.md` 并提示路径，保证任何环境拿得到内容。\n\n## 安装\n\n扩展目录 `npm install` 后，在 `~/.pi/agent/settings.json` 的 `extensions` 数组加入本目录的绝对路径：\n\n```json\n{ \"extensions\": [\"/path/to/smart-copy\"] }\n```\n\n## 已知限制\n\n- 只能复制当前分支可见消息（compaction 之前的消息不在 `getBranch()` 范围内）\n- 不复制 thinking 块和工具调用内容\n- streaming 中触发（`ctrl+shift+x`）降级为直接全量复制最新消息，不弹选择器\n","readmeFilename":"README.md"}