{"_id":"@cfcluan/pi-tuicr","_rev":"2-477e2e7f485b7c5e8b70d6d13777e74d","name":"@cfcluan/pi-tuicr","dist-tags":{"latest":"0.3.2"},"versions":{"0.3.2":{"name":"@cfcluan/pi-tuicr","version":"0.3.2","keywords":["pi-package"],"license":"MIT","_id":"@cfcluan/pi-tuicr@0.3.2","maintainers":[{"name":"cfcluan","email":"npm@luan.sh"}],"homepage":"https://github.com/luan/agents#readme","bugs":{"url":"https://github.com/luan/agents/issues"},"pi":{"image":"https://github.com/luan/agents/releases/download/v0.3.2/pi-tuicr.png","video":"https://github.com/luan/agents/releases/download/v0.3.2/pi-tuicr.mp4","extensions":["./src/extension.ts","./node_modules/pi-libtui/src/extension.ts"]},"dist":{"shasum":"4cba68458781826faadcd7deece1b3252e701d60","tarball":"https://registry.npmjs.org/@cfcluan/pi-tuicr/-/pi-tuicr-0.3.2.tgz","fileCount":3659,"integrity":"sha512-iuxIlZ155Krm7HzkoYwD16MCe5qlAkRp6O8XjE7B9ezb10/jdmxYe1N0E1mddny0C7Gb9pVL602H+0wi5Jw3lQ==","signatures":[{"sig":"MEUCIGF+NlJkzGSHhQbmTj2HLR6NC3qlOEHBTI6tgfGgnm2qAiEAuS3WuJz6gq3dHfnPdqt4m9HpGoph8xG5N/z1Bfzn9mc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26831836},"type":"module","_from":"file:/Users/luan.santos/src/agents/.tmp/package-migration/tarballs-clean/cfcluan-pi-tuicr-0.3.2.tgz","exports":{".":"./src/index.ts"},"scripts":{"test":"bun test --only-failures test","typecheck":"tsc --build"},"_npmUser":{"name":"cfcluan","email":"npm@luan.sh"},"_resolved":"/Users/luan.santos/src/agents/.tmp/package-migration/tarballs-clean/cfcluan-pi-tuicr-0.3.2.tgz","_integrity":"sha512-iuxIlZ155Krm7HzkoYwD16MCe5qlAkRp6O8XjE7B9ezb10/jdmxYe1N0E1mddny0C7Gb9pVL602H+0wi5Jw3lQ==","repository":{"url":"git+https://github.com/luan/agents.git","type":"git","directory":"harnesses/pi/agent/packages/pi-tuicr"},"_npmVersion":"11.19.0","description":"Tuicr review integration with optional side-panel tabs","directories":{},"_nodeVersion":"26.7.0","dependencies":{"pi-libtui":"file:../pi-libtui","pi-libactions":"file:../pi-libactions"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.0","typescript":"^6.0.3","@earendil-works/pi-tui":"0.84.2","@earendil-works/pi-coding-agent":"0.84.2"},"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"bundleDependencies":["pi-libactions","pi-libtui"],"_npmOperationalInternal":{"tmp":"tmp/pi-tuicr_0.3.2_1789154702285_0.08320476130980037","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Use @luan.sh/pi-tuicr instead. This package name is deprecated."}},"time":{"created":"2026-09-11T19:25:02.100Z","modified":"2026-09-11T23:36:17.652Z","0.3.2":"2026-09-11T19:25:02.548Z"},"bugs":{"url":"https://github.com/luan/agents/issues"},"license":"MIT","homepage":"https://github.com/luan/agents#readme","keywords":["pi-package"],"repository":{"url":"git+https://github.com/luan/agents.git","type":"git","directory":"harnesses/pi/agent/packages/pi-tuicr"},"description":"Tuicr review integration with optional side-panel tabs","maintainers":[{"name":"cfcluan","email":"npm@luan.sh"}],"readme":"# @cfcluan/pi-tuicr\n\n`@cfcluan/pi-tuicr` runs the `tuicr` code review TUI inside Pi. One action\nopens a picker of git review targets, launches `tuicr` in an embedded terminal,\nand watches tuicr's session files for review comments. Comments written in\ntuicr appear in Pi's editor as a single attachment pill and expand into a\nformatted request when the prompt is submitted.\n\nIt is a Pi extension, not a model-facing tool. It registers no tools and adds\nno settings.\n\n## Preview\n\n![pi-tuicr in Bootty](https://github.com/luan/agents/releases/download/v0.3.2/pi-tuicr.png)\n\n[Watch the demo](https://github.com/luan/agents/releases/download/v0.3.2/pi-tuicr.mp4).\n\n## Install\n\n```sh\npi install npm:@cfcluan/pi-tuicr\n```\n\n### Requirements\n\n- `tuicr` on `PATH`. tuicr is a third-party code review tool; install it\n  separately. The extension checks `tuicr --version` before listing targets and\n  reports \"Could not start tuicr — is it on your PATH?\" if that fails.\n- `git` on `PATH`, used to discover a base branch for the branch-comparison\n  targets. Without it those two targets are simply omitted.\n- Requires a Rust toolchain (https://rustup.rs). The `terminal_bridge` binary\n  builds itself on first use under Pi's agent directory\n  (`native/terminal-bridge/<version>/`). Set `PI_TERMINAL_BRIDGE_BINARY` to use\n  a prebuilt binary. This binary backs the embedded terminal pane.\n\n### Optional companion\n\n`pi install npm:pi-panels` adds a side panel; when it is present,\nreviews open as panel tabs, and when it is absent, they open in a fullscreen\noverlay. Both modes are described below.\n\n## Use it\n\nThe extension registers one action, `panels.tuicr.open` (\"Review changes\nwith tuicr\"). Running it lists review targets for Pi's current working\ndirectory:\n\n| Target | tuicr arguments |\n| --- | --- |\n| Uncommitted changes | `-w` |\n| Branch vs `<base>` (+ uncommitted) | `-r <base>..HEAD -w` |\n| Branch vs `<base>` | `-r <base>..HEAD` |\n| Last commit | `-r HEAD~1..HEAD` |\n| Pick commits | none (tuicr's own picker) |\n| Every tracked file | `-A` |\n| Custom revset… | prompts for a revset, then `-r <revset>` |\n| Pull request… | prompts for a number, `owner/repo#N`, or URL, then `pr <target>` |\n\nThe two branch targets appear only when a base branch is found. The base is the\nfirst of `origin/HEAD`'s target, `origin/main`, `origin/master`, `main`, or\n`master` that exists and is not the current branch. Cancelling the revset or PR\nprompt, or leaving it empty, aborts without launching anything.\n\n`tuicr` is launched with `--appearance dark` or `--appearance light`, resolved\nfrom Pi's active theme, so embedded truecolor rendering does not depend on a\nterminal background query.\n\n### With a side panel\n\nWhen a side-panel host is attached, each review is a tab labelled \"Review\" (or\n\"Review N\" once there is more than one). The tab's header action shows the\ncurrent target label and reruns `panels.tuicr.open`; on an active review\ntab that reopens the target picker as a floating overlay over the running\ntuicr pane. Picking the same target again closes the picker; picking a\ndifferent one restarts tuicr for that target. Cancelling the picker on a tab\nthat has no target yet closes the tab. The tab closes itself when tuicr exits.\nThe panel's empty state also gets a \"Review\" entry that runs the same action.\n\n### Without a side panel\n\nThe target list appears in Pi's standard select prompt and tuicr opens in a\nfullscreen overlay titled \"Review\". Closing the overlay or quitting tuicr ends\nthe review.\n\n### Review comments\n\nBefore launching, the extension records the ids of comments that already exist\nin tuicr sessions (via `tuicr review list --all` and\n`tuicr review comments --session <path>`), so only comments written during\nthis review are picked up. It then watches tuicr's session directories and\nre-reads changed `.json` files, debounced by 25 ms, rather than polling the\nCLI. Only sessions whose `repo_path` matches Pi's working directory are\nconsidered; review-level, file-level, and line-level comments are all\ncollected, and comments with empty content are ignored.\n\nNew comments are published into Pi's editor as one \"N review comments\" pill\nbacked by a private token appended to the editor text. Hovering the pill shows\na detail card listing each comment with its type and `path:line` anchor. When\nthe prompt is submitted, the token is replaced with:\n\n```\nI reviewed your changes. Please address these comments:\n\n1. `src/one.ts:4` - Updated first issue\n2. `src/two.ts` [SUGGESTION] - Second issue\n```\n\nComments whose type is `none` get no bracketed tag. The comment set clears once\nPi confirms that user message started. Disposing the extension (session end or\nreload) removes the token from the editor without submitting anything.\nComments still present when a review closes are published as well, so nothing\nwritten in tuicr is lost when it exits.\n\nSession directories are discovered from `tuicr review list --all` and fall\nback to tuicr's platform default: `~/Library/Application Support/tuicr/reviews/sessions`\non macOS, `%LOCALAPPDATA%\\tuicr\\reviews\\sessions` on Windows, and\n`$XDG_DATA_HOME/tuicr/reviews/sessions` (default `~/.local/share/...`) elsewhere.\n\n## Keybindings\n\n`panels.tuicr.open` is registered through `pi-libactions` and has no\ndefault key. Bind it in `keybindings.json` in Pi's agent directory (normally\n`~/.pi/agent/keybindings.json`). The file maps action IDs to a key ID or an\narray of key IDs:\n\n```json\n{\n  \"panels.tuicr.open\": \"ctrl+shift+r\"\n}\n```\n\nBindings take effect only when a shortcut host is installed\n(`pi install npm:pi-xsettings` provides one). The file is read on\nload, so `/reload` after editing it.\n\n## Settings\n\nNone. The package does not read `pi-xsettings` or any configuration file.\n\n## Library API\n\n`src/index.ts` exports `TuicrManager`, `ReviewCommentAttachments`, and the\ncontents of `src/tuicr-review.ts` (`createTuicrRuntime`, `listTuicrTargets`,\n`prepareTuicrReview`, `createTuicrCommentFeed`, `formatTuicrComments`, and\ntheir types). Importing it does not start the extension.\n\n## Layout\n\n| Concern | Owner |\n| --- | --- |\n| Pi hooks, action and side-panel provider registration, runtime wiring | `src/extension.ts` |\n| Review tabs, target picker, PTY lifecycle, overlay fallback | `src/manager.ts` |\n| Target list, base-branch discovery, tuicr JSON parsing, session-file watcher, comment formatting | `src/tuicr-review.ts` |\n| Editor pill, hover detail card, submit-time expansion | `src/review-comments.ts` |\n| Public exports | `src/index.ts` |\n\n## Develop\n\nSource: https://github.com/luan/agents, directory\nharnesses/pi/agent/packages/pi-tuicr. Run `bun run typecheck` and\n`bun test test` in that directory.\n\nTests cover target discovery when tuicr is missing, the session-file comment\nfeed, the editor attachment, and overlay suppression after dispose. They use\ninjected runtimes and do not run `tuicr` or `git`.\n","readmeFilename":"README.md"}