feat: add /acp-export command (session handoff export) - #272
Conversation
📦 Built Extension ArtifactBranch: Option A — Install from npm PR tag (recommended)pi install npm:billion-context-pi@pr-272Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pi-pr272.tgz
pi install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 PR reviewed and verified on Verification (local, on the PR branch)
Code review
One gap found — fixedThe Extended the existing exclusion test to include an Minor notes (no action needed)
Ready for merge (merge stays human-only per repo policy). |
[bot] 🏷 Follow-up: CI on the updated head |
|
冲突了 解决下 |
[bot] 🏷 冲突已解决 ✅ 冲突原因:master 已前进到 v0.1.56( 解决方式:取 master 侧的 0.0.50(更新版本,且 验证(本地,合并后):
已推送 merge commit |
[bot] 🏷 确认:merge commit |
Port the upstream billion-context export command into the Pi adapter. - /acp-export lists ACP-managed sessions (title/label/tokens/blocks). - /acp-export <id> renders the folded view (block summaries in place of compressed ranges, in conversation order) via prune(). - /acp-export <id> --full renders the original messages from the session. - --output writes the markdown file; without it the document is sent to the transcript (filtered from LLM context) or notified. - Empty store / no-match / ambiguous-selector errors match upstream. - Output contains no secrets or environment-specific paths.
Replaces the local renderHandoff/renderMessage/matchSession in src/export.ts with the kernel's shared implementations (acp-kernel PR #183), so the proxy and the Pi adapter no longer duplicate the handoff markdown logic. - exportSession now calls kernel renderHandoff({coreMessages, state, full, meta}) and kernel matchSession(all, selector, labelOf). - Bumps acp-kernel 0.0.48 -> 0.0.49 (the release that ships the handoff exports). package-lock.json is refreshed once 0.0.49 is published on npm. Local pre-validation against acp-kernel#183's build: typecheck clean, 472/475 tests pass (3 skipped), build success.
ec43f08 to
8a355a7
Compare
Summary
Ports the upstream
billion-contextexportcommand (session handoff export) into the Pi adapter, per #271.What it does
/acp-export(namedacp-exportto avoid colliding with Pi's built-in/export):<id>— renders the folded view: block summaries in place of compressed ranges, in conversation order, viaprune().<id> --full— renders the original messages from the session.--output <file>— writes the markdown file; without it the document is sent to the transcript (filtered from LLM context) or notified.Design notes
.jsonland ACP state in an adjacent<sessionFile>.acp.json(written every turn), so both the folded and full views are always available — no snapshot cache or v2 fallback needed (simpler than the proxy).*.acp.jsonfiles (any ACP-active session has one).acp-exportand excluded from LLM-context projection (same asacp-statuspanels).Delegation to acp-kernel (follow-up)
Per the owner's request, the handoff markdown rendering is now shared in the kernel instead of duplicated across the proxy and this adapter:
src/export.tsnow calls kernelrenderHandoff({coreMessages, state, full, meta})and kernelmatchSession(all, selector, labelOf)(added in acp-kernel#183); the localrenderHandoff/renderMessage/matchSessioncopies are removed (net −52 lines).acp-kernel0.0.48→0.0.49(the release that ships the handoff exports).package-lock.jsonis refreshed once0.0.49is on npm.Verification
npm run typecheck— cleannpm test— 472 pass, 0 fail, 3 skippednpm run build— success (acp-kernel inlined)New tests:
tests/export-cmd.test.ts(10 tests: arg parsing, list, folded, full, output, no-match, empty store, ambiguous selector, command wiring). Updatedtests/integration.test.tscommand count to 6.Dependency / merge order
Blocked on acp-kernel#183 merging + acp-kernel 0.0.49 publishing. Until then CI is red at
npm ci(cannot resolve 0.0.49). After 0.0.49 is live, runnpm installto refresh the lockfile and the PR goes green.