@herbertgao/pi-extensions 2026.9.20 → 2026.10.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/README.md +13 -8
- package/THIRD_PARTY_NOTICES.md +29 -3
- package/node_modules/@herbertgao/pi-bark/README.md +39 -3
- package/node_modules/@herbertgao/pi-bark/package.json +1 -1
- package/node_modules/@herbertgao/pi-bark/src/index.ts +275 -15
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +50 -50
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +7 -7
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +25 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +24 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +7 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +47 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/mcp-chip.ts +136 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +56 -11
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +36 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +11 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +303 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-header.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-highlight.ts +36 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-presentation.ts +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-write-render.ts +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/index.ts +88 -34
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/line-width-safety.ts +6 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/write-execution.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +31 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/message-display.ts +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +3 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +173 -36
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-text.ts +1 -0
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +6 -4
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/package.json +1 -1
- package/node_modules/@herbertgao/pi-subagents/src/mention-clone.ts +3 -2
- package/node_modules/@herbertgao/sol-pi/CONTRIBUTING.md +22 -0
- package/node_modules/@herbertgao/sol-pi/README.md +36 -17
- package/node_modules/@herbertgao/sol-pi/THIRD_PARTY_NOTICES.md +10 -6
- package/node_modules/@herbertgao/sol-pi/agents-install.md +15 -12
- package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +24 -8
- package/node_modules/@herbertgao/sol-pi/docs/configuration.md +2 -2
- package/node_modules/@herbertgao/sol-pi/docs/star-history.md +18 -0
- package/node_modules/@herbertgao/sol-pi/package.json +4 -2
- package/node_modules/@herbertgao/sol-pi/scripts/check-sol-pi-config.mjs +1 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/config.ts +1 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/file-queue.ts +23 -4
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +32 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/then-run.ts +3 -2
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/observation.ts +1 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/economics.ts +27 -7
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +137 -41
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/index.ts +1 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/plan.ts +2 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/projection.ts +58 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/state.ts +28 -6
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/tools.ts +2 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/runtime-paths.ts +15 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
- package/node_modules/@pi-plugins/fast-mode/README.md +7 -1
- package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -1
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +7 -1
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
- package/node_modules/@pi-plugins/fast-mode/package.json +5 -5
- package/node_modules/pi-antigravity/README.md +3 -0
- package/node_modules/pi-antigravity/package.json +8 -8
- package/node_modules/pi-antigravity/src/auth/oauth.ts +6 -3
- package/node_modules/pi-antigravity/src/index.ts +114 -110
- package/node_modules/pi-antigravity/src/stream/stream.ts +1 -1
- package/node_modules/pi-antigravity/src/utils/util.ts +18 -1
- package/node_modules/pi-multi-account/CHANGELOG.md +20 -0
- package/node_modules/pi-multi-account/README.md +46 -8
- package/node_modules/pi-multi-account/config-file-transaction.ts +42 -0
- package/node_modules/pi-multi-account/index.ts +255 -269
- package/node_modules/pi-multi-account/model-pins.ts +36 -0
- package/node_modules/pi-multi-account/package.json +9 -7
- package/node_modules/pi-multi-account/slot-proxy-auth.ts +12 -2
- package/node_modules/pi-multi-account/slot-proxy.ts +27 -5
- package/node_modules/pi-web-access/CHANGELOG.md +17 -0
- package/node_modules/pi-web-access/README.md +6 -3
- package/node_modules/pi-web-access/brave-rate-limit.ts +170 -0
- package/node_modules/pi-web-access/brave.ts +28 -11
- package/node_modules/pi-web-access/dist/index.js +202 -33
- package/node_modules/pi-web-access/gemini-search.ts +2 -5
- package/node_modules/pi-web-access/index.ts +13 -7
- package/node_modules/pi-web-access/openai-search.ts +24 -10
- package/node_modules/pi-web-access/package.json +1 -1
- package/node_modules/pi-web-access/summary-review.ts +8 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/README.md +16 -12
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/adapter.d.ts +0 -5
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/adapter.js +2 -3
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/contract.d.ts +2 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/reader.d.ts +3 -0
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/reader.js +27 -15
- package/node_modules/{@herbertgao/resume-from/dist/adapters/pi → resume-from/dist/adapters/claude-code}/redaction.js +16 -3
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/writer.d.ts +2 -4
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/writer.js +1 -1
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/contract.d.ts +2 -4
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/index.js +1 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/read.d.ts +16 -0
- package/node_modules/resume-from/dist/adapters/codex/read.js +723 -0
- package/node_modules/{@herbertgao/resume-from/dist/adapters/claude-code → resume-from/dist/adapters/codex}/redaction.js +16 -3
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/rollout.d.ts +44 -4
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/rollout.js +88 -4
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/write.d.ts +2 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/write.js +2 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/contract.d.ts +5 -1
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/adapter.js +10 -6
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/contract.d.ts +2 -2
- package/node_modules/{@herbertgao/resume-from/dist/adapters/codex → resume-from/dist/adapters/pi}/redaction.js +16 -3
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/serialize.d.ts +2 -4
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/serialize.js +2 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/render.d.ts +1 -1
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/render.js +4 -4
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/runner.js +2 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/contract.d.ts +2 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/command.js +31 -8
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/wiring.d.ts +1 -1
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/wiring.js +1 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/confirmation.d.ts +4 -1
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/confirmation.js +2 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/contract.d.ts +8 -6
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/contract.d.ts +10 -5
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/finder.d.ts +2 -1
- package/node_modules/resume-from/dist/import/discovery/finder.js +269 -0
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/contract.d.ts +3 -3
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/lander.js +3 -3
- package/node_modules/resume-from/dist/import/pipeline.d.ts +28 -0
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/pipeline.js +31 -11
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/builder.d.ts +2 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/builder.js +9 -5
- package/node_modules/resume-from/dist/import/preview/warnings.d.ts +14 -0
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/warnings.js +26 -20
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/wiring.js +12 -2
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/contract.d.ts +9 -3
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/git.d.ts +4 -4
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/git.js +7 -4
- package/node_modules/resume-from/dist/platform/repo/reader.d.ts +3 -0
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/reader.js +60 -20
- package/node_modules/{@herbertgao/resume-from → resume-from}/dist/session/contract.d.ts +8 -1
- package/node_modules/{@herbertgao/resume-from → resume-from}/package.json +19 -32
- package/node_modules/{@herbertgao/resume-from → resume-from}/shims/pi/extensions/resume-from.js +2 -2
- package/package.json +17 -17
- package/node_modules/@herbertgao/resume-from/dist/adapters/codex/read.js +0 -270
- package/node_modules/@herbertgao/resume-from/dist/import/discovery/finder.js +0 -129
- package/node_modules/@herbertgao/resume-from/dist/import/pipeline.d.ts +0 -17
- package/node_modules/@herbertgao/resume-from/dist/import/preview/warnings.d.ts +0 -11
- package/node_modules/@herbertgao/resume-from/dist/platform/repo/reader.d.ts +0 -8
- /package/node_modules/{@herbertgao/resume-from → resume-from}/LICENSE +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/entries.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/entries.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/layout.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/layout.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/readback.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/readback.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/redaction.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/validation.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/validation.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/readback.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/readback.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/redaction.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/validation.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/validation.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/adapter.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/format.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/format.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/parse.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/parse.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/redaction.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/validate.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/validate.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/bin.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/bin.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/contract.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/agents.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/agents.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/args.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/args.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/contract.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/presentation.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/presentation.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/runner.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/entry.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/entry.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/command.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/contract.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/picker.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/picker.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/presentation.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/presentation.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/register.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/register.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/ui.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/ui.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/profile.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/profile.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/registry.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/registry.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/errors.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/errors.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/homes.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/homes.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/ordering.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/ordering.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/errors.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/errors.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/errors.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/errors.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/handover.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/handover.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/lander.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/marker.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/marker.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/contract.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/format.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/format.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/contract.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/rules.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/rules.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/wiring.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/contract.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/defaults.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/defaults.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/errors.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/errors.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/loader.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/loader.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/paths.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/paths.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/validate.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/validate.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/contract.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/file-committer.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/file-committer.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/contract.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/contract.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/estimator.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/estimator.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/index.d.ts +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/index.js +0 -0
- /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/session/contract.js +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Text, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
2
2
|
import { inspect } from "node:util";
|
|
3
3
|
import { config } from "../../config/config.ts";
|
|
4
|
+
import { createCodeBlockHighlighter } from "./diff/diff-highlight.ts";
|
|
4
5
|
import { showMoreHintText } from "./show-more-hint.ts";
|
|
5
6
|
import { TOOL_LOADING_INTERVAL_MS, toolLoadingIcon } from "../../utils/tool-loading-icon.ts";
|
|
6
7
|
import { getToolMouseTui } from "../mouse/scroll.ts";
|
|
@@ -231,7 +232,7 @@ export class ExpandedToolResultText {
|
|
|
231
232
|
}
|
|
232
233
|
|
|
233
234
|
/** 截断体末行 `… +N more lines` 旁的展开提示,点击打开全量预览。 */
|
|
234
|
-
export const SHOW_MORE_LABEL = "
|
|
235
|
+
export const SHOW_MORE_LABEL = "· click to show more";
|
|
235
236
|
|
|
236
237
|
export type ToolIoSection = "input" | "output";
|
|
237
238
|
|
|
@@ -268,6 +269,17 @@ export class ExpandedToolIoView {
|
|
|
268
269
|
private truncated: { input: boolean; output: boolean } = { input: false, output: false };
|
|
269
270
|
/** 0-based header line indexes that carry show-more after last render. */
|
|
270
271
|
private showMoreHeaderRows: { input?: number; output?: number } = {};
|
|
272
|
+
/** Input 里的代码块(codemode 的 `code`):着色行覆盖默认 dim/muted 样式。 */
|
|
273
|
+
private inputCode?:
|
|
274
|
+
| {
|
|
275
|
+
startLine: number;
|
|
276
|
+
language: string;
|
|
277
|
+
standalone: boolean;
|
|
278
|
+
code: string;
|
|
279
|
+
theme: unknown;
|
|
280
|
+
rows: () => string[];
|
|
281
|
+
}
|
|
282
|
+
| undefined;
|
|
271
283
|
|
|
272
284
|
/** flushLeft:贴左渲染(mode=on 展开卡);默认 false 保留前导空格(compact 等共用路径)。 */
|
|
273
285
|
private flushLeft: boolean;
|
|
@@ -325,6 +337,57 @@ export class ExpandedToolIoView {
|
|
|
325
337
|
return this.inputBody;
|
|
326
338
|
}
|
|
327
339
|
|
|
340
|
+
/**
|
|
341
|
+
* 登记 Input 里的代码块:同步 cli-highlight 打底,shiki 异步升级,落地后
|
|
342
|
+
* 经 invalidate 重画。同一份代码与主题只建一次(视图按宽度缓存行)。
|
|
343
|
+
*/
|
|
344
|
+
setInputCode(block: InputCodeBlock | undefined): void {
|
|
345
|
+
if (!block) {
|
|
346
|
+
if (this.inputCode) {
|
|
347
|
+
this.inputCode = undefined;
|
|
348
|
+
this.invalidate();
|
|
349
|
+
}
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if (this.inputCode?.code === block.code && this.inputCode.theme === this.theme) {
|
|
353
|
+
this.inputCode.startLine = block.startLine;
|
|
354
|
+
this.inputCode.standalone = block.standalone;
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
this.inputCode = {
|
|
358
|
+
startLine: block.startLine,
|
|
359
|
+
language: block.language,
|
|
360
|
+
standalone: block.standalone,
|
|
361
|
+
code: block.code,
|
|
362
|
+
theme: this.theme,
|
|
363
|
+
rows: createCodeBlockHighlighter(block.code, block.language, this.theme, () => {
|
|
364
|
+
// 视图自己的行缓存 + 外层工具卡(清 paint 缓存并 requestRender)
|
|
365
|
+
this.invalidate();
|
|
366
|
+
invalidateIoView(this);
|
|
367
|
+
}),
|
|
368
|
+
};
|
|
369
|
+
this.invalidate();
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* 整段 Input 就是代码块时给出语言与代码,供全量预览包一层围栏(弹框按 Markdown
|
|
374
|
+
* 渲染,围栏代码块由 pi 的 highlightCode 着色)。混了别的字段时返回 undefined。
|
|
375
|
+
*/
|
|
376
|
+
getInputCodeFence(): { language: string; code: string } | undefined {
|
|
377
|
+
const block = this.inputCode;
|
|
378
|
+
return block?.standalone ? { language: block.language, code: block.code } : undefined;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/** 代码块里某一源行的着色内容(已剥掉行首缩进);不在块内时为 undefined。 */
|
|
382
|
+
private inputCodeLine(sourceIndex: number): string | undefined {
|
|
383
|
+
const block = this.inputCode;
|
|
384
|
+
if (!block) return undefined;
|
|
385
|
+
const offset = sourceIndex - block.startLine;
|
|
386
|
+
if (offset < 0) return undefined;
|
|
387
|
+
const rows = block.rows();
|
|
388
|
+
return offset < rows.length ? rows[offset] : undefined;
|
|
389
|
+
}
|
|
390
|
+
|
|
328
391
|
getOutputBody(): string {
|
|
329
392
|
return this.outputBody.trim() ? this.outputBody : "Done";
|
|
330
393
|
}
|
|
@@ -342,7 +405,7 @@ export class ExpandedToolIoView {
|
|
|
342
405
|
/** True when the plain truncation footer carries show-more. Input 续行带 │,Output 不带。 */
|
|
343
406
|
matchShowMoreLine(plainLine: string): ToolIoSection | null {
|
|
344
407
|
const line = plainLine.replace(/\x1b\[[0-9;]*m/g, "");
|
|
345
|
-
if (!line.includes(`
|
|
408
|
+
if (!line.includes(` · ${showMoreHintText()}`) || !/\+\d+ more lines/.test(line)) return null;
|
|
346
409
|
if (this.truncated.input && line.includes("│")) return "input";
|
|
347
410
|
if (this.truncated.output) return "output";
|
|
348
411
|
return null;
|
|
@@ -363,7 +426,7 @@ export class ExpandedToolIoView {
|
|
|
363
426
|
/** Column range (1-based, visible cells) of show-more on a rendered header, if present. */
|
|
364
427
|
showMoreHitbox(plainLine: string): { startCol: number; endCol: number } | null {
|
|
365
428
|
const line = plainLine.replace(/\x1b\[[0-9;]*m/g, "");
|
|
366
|
-
const label = `
|
|
429
|
+
const label = ` · ${showMoreHintText()}`;
|
|
367
430
|
const idx = line.lastIndexOf(label);
|
|
368
431
|
if (idx < 0) return null;
|
|
369
432
|
const before = line.slice(0, idx);
|
|
@@ -409,14 +472,6 @@ export class ExpandedToolIoView {
|
|
|
409
472
|
lines.push(truncateToWidth(theme.fg("dim", `${lead}│`), safeWidth, ""));
|
|
410
473
|
};
|
|
411
474
|
|
|
412
|
-
/** Style `key: value` input rows — dim keys, readable values. */
|
|
413
|
-
const styleInputLine = (rawLine: string): string => {
|
|
414
|
-
const match = rawLine.match(/^([A-Za-z_][\w.-]*)(:\s*)(.*)$/);
|
|
415
|
-
if (!match) return theme.fg("muted", rawLine);
|
|
416
|
-
const [, key, sep, rest] = match;
|
|
417
|
-
return theme.fg("dim", key + sep) + theme.fg("muted", rest ?? "");
|
|
418
|
-
};
|
|
419
|
-
|
|
420
475
|
const pushBody = (
|
|
421
476
|
body: string,
|
|
422
477
|
opts: { input?: boolean; limit: number; continued?: boolean; section: ToolIoSection },
|
|
@@ -428,8 +483,13 @@ export class ExpandedToolIoView {
|
|
|
428
483
|
}
|
|
429
484
|
const sourceLines = raw.split("\n");
|
|
430
485
|
const wrapped: string[] = [];
|
|
431
|
-
for (const source of sourceLines) {
|
|
432
|
-
|
|
486
|
+
for (const [index, source] of sourceLines.entries()) {
|
|
487
|
+
if (opts.input) {
|
|
488
|
+
// 代码块的行用着色版本(已剥缩进),其余走默认 dim/muted
|
|
489
|
+
wrapped.push(...wrapInputLine(source, contentWidth, theme, this.inputCodeLine(index)));
|
|
490
|
+
continue;
|
|
491
|
+
}
|
|
492
|
+
const styled = theme.fg(bodyColor, source);
|
|
433
493
|
const parts = wrapTextWithAnsi(styled, contentWidth);
|
|
434
494
|
if (parts.length === 0) wrapped.push(styled);
|
|
435
495
|
else wrapped.push(...parts);
|
|
@@ -444,7 +504,7 @@ export class ExpandedToolIoView {
|
|
|
444
504
|
if (hidden > 0) {
|
|
445
505
|
// hover 只高亮文字,圆点保持 dim(与 group hint 一致)。
|
|
446
506
|
const more =
|
|
447
|
-
theme.fg("dim", "
|
|
507
|
+
theme.fg("dim", " ·") +
|
|
448
508
|
theme.fg(
|
|
449
509
|
this.hoveredSection === opts.section ? "text" : "dim",
|
|
450
510
|
` ${showMoreHintText()}`,
|
|
@@ -462,7 +522,15 @@ export class ExpandedToolIoView {
|
|
|
462
522
|
// Decide show-more from the same truncation rules as pushBody.
|
|
463
523
|
const inputWouldTruncate =
|
|
464
524
|
hasInput &&
|
|
465
|
-
bodyExceedsLineLimit(
|
|
525
|
+
bodyExceedsLineLimit(
|
|
526
|
+
this.inputBody,
|
|
527
|
+
this.maxInputLines,
|
|
528
|
+
contentWidth,
|
|
529
|
+
true,
|
|
530
|
+
theme,
|
|
531
|
+
bodyColor,
|
|
532
|
+
(inputIndex: number) => this.inputCodeLine(inputIndex),
|
|
533
|
+
);
|
|
466
534
|
const outputWouldTruncate = bodyExceedsLineLimit(
|
|
467
535
|
outputText,
|
|
468
536
|
this.maxOutputLines,
|
|
@@ -522,6 +590,40 @@ export function isExpandedToolIoView(value: unknown): value is ExpandedToolIoVie
|
|
|
522
590
|
);
|
|
523
591
|
}
|
|
524
592
|
|
|
593
|
+
/** Input 行着色:`key: value` 拆成 dim 键 + muted 值,其余整行 muted。 */
|
|
594
|
+
function styleInputSourceLine(line: string, theme: any): string {
|
|
595
|
+
const match = line.match(/^([A-Za-z_][\w.-]*)(:\s*)(.*)$/);
|
|
596
|
+
if (!match) return theme.fg("muted", line);
|
|
597
|
+
const [, key, sep, rest] = match;
|
|
598
|
+
return theme.fg("dim", key + sep) + theme.fg("muted", rest ?? "");
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* 折一行 Input 源码。不带 styledBody 时与改动前完全一致(其他工具不受影响);
|
|
603
|
+
* 代码块(styledBody = 已着色且已剥缩进的行)续行跟着源码前导缩进:顶到 rail
|
|
604
|
+
* 会被读成新的一行,所以缩进先剥掉、折行宽度相应扣减,再给每一行加回去。
|
|
605
|
+
* 行数判断(bodyExceedsLineLimit)与实际渲染共用这一套,展开提示才对得上。
|
|
606
|
+
*/
|
|
607
|
+
function wrapInputLine(
|
|
608
|
+
source: string,
|
|
609
|
+
contentWidth: number,
|
|
610
|
+
theme: any,
|
|
611
|
+
styledBody?: string,
|
|
612
|
+
): string[] {
|
|
613
|
+
if (styledBody === undefined) {
|
|
614
|
+
const styled = styleInputSourceLine(source, theme);
|
|
615
|
+
const parts = wrapTextWithAnsi(styled, contentWidth);
|
|
616
|
+
return parts.length ? parts : [styled];
|
|
617
|
+
}
|
|
618
|
+
const lead = /^[ \t]*/.exec(source)?.[0] ?? "";
|
|
619
|
+
const leadWidth = visibleWidth(lead);
|
|
620
|
+
const parts = wrapTextWithAnsi(styledBody, Math.max(1, contentWidth - leadWidth));
|
|
621
|
+
const rows = parts.length ? parts : [styledBody];
|
|
622
|
+
if (!leadWidth) return rows;
|
|
623
|
+
const prefix = theme.fg("muted", lead);
|
|
624
|
+
return rows.map((row) => prefix + row);
|
|
625
|
+
}
|
|
626
|
+
|
|
525
627
|
/** True when body needs truncation at the given line limit (source lines or wrapped rows). */
|
|
526
628
|
function bodyExceedsLineLimit(
|
|
527
629
|
body: string,
|
|
@@ -530,23 +632,18 @@ function bodyExceedsLineLimit(
|
|
|
530
632
|
asInput: boolean,
|
|
531
633
|
theme: any,
|
|
532
634
|
bodyColor = "toolOutput",
|
|
635
|
+
/** 代码块的源行取着色内容,行数判断与实际渲染保持同一套规则。 */
|
|
636
|
+
codeLine?: (sourceIndex: number) => string | undefined,
|
|
533
637
|
): boolean {
|
|
534
638
|
const raw = body.replace(/\t/g, " ").replace(/\n+$/, "");
|
|
535
639
|
if (!raw.trim()) return false;
|
|
536
640
|
const sourceLines = raw.split("\n");
|
|
537
641
|
if (sourceLines.length > limit) return true;
|
|
538
642
|
let total = 0;
|
|
539
|
-
for (const source of sourceLines) {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
styled = match
|
|
544
|
-
? theme.fg("dim", match[1] + match[2]) + theme.fg("muted", match[3] ?? "")
|
|
545
|
-
: theme.fg("muted", source);
|
|
546
|
-
} else {
|
|
547
|
-
styled = theme.fg(bodyColor, source);
|
|
548
|
-
}
|
|
549
|
-
const parts = wrapTextWithAnsi(styled, contentWidth);
|
|
643
|
+
for (const [index, source] of sourceLines.entries()) {
|
|
644
|
+
const parts = asInput
|
|
645
|
+
? wrapInputLine(source, contentWidth, theme, codeLine?.(index))
|
|
646
|
+
: wrapTextWithAnsi(theme.fg(bodyColor, source), contentWidth);
|
|
550
647
|
total += Math.max(1, parts.length);
|
|
551
648
|
if (total > limit) return true;
|
|
552
649
|
}
|
|
@@ -603,26 +700,42 @@ export function middleTruncateToWidth(text: string, width: number): string {
|
|
|
603
700
|
return `${left}…${right}`;
|
|
604
701
|
}
|
|
605
702
|
|
|
703
|
+
/**
|
|
704
|
+
* 展开卡 Input 的代码块:源行起始下标(相对 text)+ 语言 + 剥掉行首缩进的代码。
|
|
705
|
+
* standalone = 整段 Input 就是这块代码(没有 `code:` 标签),全量预览可以整段包围栏。
|
|
706
|
+
*/
|
|
707
|
+
export type InputCodeBlock = {
|
|
708
|
+
startLine: number;
|
|
709
|
+
language: string;
|
|
710
|
+
code: string;
|
|
711
|
+
standalone: boolean;
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
export type ToolInputBody = { text: string; codeBlock?: InputCodeBlock };
|
|
715
|
+
|
|
716
|
+
/** 按字段名判定可着色的入参:codemode / mcpscript 的 `code` 都是 JS 脚本。 */
|
|
717
|
+
const INPUT_CODE_LANGUAGES: Record<string, string> = { code: "javascript" };
|
|
718
|
+
|
|
606
719
|
/** Pretty-print tool call args for the expanded Input section. */
|
|
607
|
-
export function
|
|
608
|
-
if (args === undefined || args === null) return "";
|
|
720
|
+
export function formatToolInputBody(args: unknown, maxChars = 8_000): ToolInputBody {
|
|
721
|
+
if (args === undefined || args === null) return { text: "" };
|
|
609
722
|
if (typeof args !== "object") {
|
|
610
723
|
const text = sanitizeToolResultText(String(args));
|
|
611
|
-
return text.length > maxChars ? `${text.slice(0, maxChars)}…` : text;
|
|
724
|
+
return { text: text.length > maxChars ? `${text.slice(0, maxChars)}…` : text };
|
|
612
725
|
}
|
|
613
726
|
if (Array.isArray(args)) {
|
|
614
727
|
try {
|
|
615
728
|
const json = JSON.stringify(args, null, 2);
|
|
616
|
-
return json.length > maxChars ? `${json.slice(0, maxChars)}…` : json;
|
|
729
|
+
return { text: json.length > maxChars ? `${json.slice(0, maxChars)}…` : json };
|
|
617
730
|
} catch {
|
|
618
|
-
return sanitizeToolResultText(String(args));
|
|
731
|
+
return { text: sanitizeToolResultText(String(args)) };
|
|
619
732
|
}
|
|
620
733
|
}
|
|
621
734
|
|
|
622
735
|
const entries = Object.entries(args as Record<string, unknown>).filter(
|
|
623
736
|
([, value]) => value !== undefined,
|
|
624
737
|
);
|
|
625
|
-
if (entries.length === 0) return "";
|
|
738
|
+
if (entries.length === 0) return { text: "" };
|
|
626
739
|
|
|
627
740
|
// Stable, human-first field order for common tools.
|
|
628
741
|
const preferred = [
|
|
@@ -648,13 +761,30 @@ export function formatToolInputArgs(args: unknown, maxChars = 8_000): string {
|
|
|
648
761
|
});
|
|
649
762
|
|
|
650
763
|
const lines: string[] = [];
|
|
764
|
+
let codeBlock: InputCodeBlock | undefined;
|
|
651
765
|
for (const [rawKey, value] of entries) {
|
|
652
766
|
const key = sanitizeToolResultText(rawKey);
|
|
653
767
|
if (typeof value === "string") {
|
|
654
768
|
const safeValue = sanitizeToolResultText(value);
|
|
655
769
|
if (safeValue.includes("\n")) {
|
|
656
|
-
|
|
657
|
-
|
|
770
|
+
const expanded = safeValue.replace(/\t/g, " ");
|
|
771
|
+
const language = INPUT_CODE_LANGUAGES[key];
|
|
772
|
+
// 只有一个 code 字段时(codemode 等)整块 Input 就是脚本,`code:` 标签是噪音
|
|
773
|
+
const standaloneCode = Boolean(language) && entries.length === 1;
|
|
774
|
+
if (!standaloneCode) lines.push(`${key}:`);
|
|
775
|
+
if (language) {
|
|
776
|
+
// 缩进由 wrapInputLine 负责,着色只喂剥掉行首缩进的正文
|
|
777
|
+
codeBlock = {
|
|
778
|
+
startLine: lines.length,
|
|
779
|
+
language,
|
|
780
|
+
code: expanded
|
|
781
|
+
.split("\n")
|
|
782
|
+
.map((line) => line.replace(/^[ \t]*/, ""))
|
|
783
|
+
.join("\n"),
|
|
784
|
+
standalone: standaloneCode,
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
for (const line of expanded.split("\n")) {
|
|
658
788
|
lines.push(` ${line}`);
|
|
659
789
|
}
|
|
660
790
|
} else {
|
|
@@ -679,7 +809,13 @@ export function formatToolInputArgs(args: unknown, maxChars = 8_000): string {
|
|
|
679
809
|
}
|
|
680
810
|
}
|
|
681
811
|
const text = lines.join("\n");
|
|
682
|
-
|
|
812
|
+
// 截断后的行号与着色行不再对齐,这时只给纯文本
|
|
813
|
+
if (text.length > maxChars) return { text: `${text.slice(0, maxChars)}…` };
|
|
814
|
+
return codeBlock ? { text, codeBlock } : { text };
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
export function formatToolInputArgs(args: unknown, maxChars = 8_000): string {
|
|
818
|
+
return formatToolInputBody(args, maxChars).text;
|
|
683
819
|
}
|
|
684
820
|
|
|
685
821
|
export function hasExpandableDetail(outputText: string, args: unknown): boolean {
|
|
@@ -697,7 +833,7 @@ export function renderExpandedToolResult(
|
|
|
697
833
|
/** mode=on 展开卡贴左;compact 等保持默认前导空格 */
|
|
698
834
|
flushLeft = false,
|
|
699
835
|
): ExpandedToolIoView | ExpandedToolResultText | Text {
|
|
700
|
-
const inputBody =
|
|
836
|
+
const { text: inputBody, codeBlock } = formatToolInputBody(args);
|
|
701
837
|
const outputBody = body;
|
|
702
838
|
const maxOutputLines = config.expandedOutputMaxLines;
|
|
703
839
|
const maxInputLines = config.expandedInputMaxLines;
|
|
@@ -726,6 +862,7 @@ export function renderExpandedToolResult(
|
|
|
726
862
|
flushLeft,
|
|
727
863
|
);
|
|
728
864
|
}
|
|
865
|
+
view.setInputCode(codeBlock);
|
|
729
866
|
if (context) rememberIoView(context, view);
|
|
730
867
|
return view;
|
|
731
868
|
}
|
|
@@ -41,6 +41,7 @@ export function stripBackgroundAnsi(line: string): string {
|
|
|
41
41
|
/** 剥离行首状态图标(展开组内工具首行复用)。 */
|
|
42
42
|
export function stripLeadingStatusIcon(line: string): string {
|
|
43
43
|
return line.replace(
|
|
44
|
+
// 行首图标:ccstyle 用 `·`,pi 原生输出里还有 `•`,两种都要剥
|
|
44
45
|
/^((?:\x1b\[[0-9;]*m|[ \t]|[├└│─])*)(?:\x1b\[[0-9;]*m)*(?:[✓✗●○■⬤•·])(?:\x1b\[[0-9;]*m)*\s+/,
|
|
45
46
|
"$1",
|
|
46
47
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-cc-extensions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A Pi productivity suite with Claude Code-style UI, context inspection, and agent/session references",
|
|
6
6
|
"type": "module",
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"test": "node scripts/test.mjs",
|
|
44
|
+
"coverage": "node scripts/test.mjs --experimental-test-coverage --test-coverage-include=extensions/**/*.ts",
|
|
45
|
+
"docs:tool-render": "node --experimental-strip-types scripts/generate-tool-render-examples.ts",
|
|
44
46
|
"typecheck": "tsc --noEmit",
|
|
45
47
|
"format": "biome format --write .",
|
|
46
48
|
"format:check": "biome format ."
|
|
@@ -69,9 +71,9 @@
|
|
|
69
71
|
},
|
|
70
72
|
"x-upstream": {
|
|
71
73
|
"package": "pi-cc-extensions",
|
|
72
|
-
"version": "0.9.
|
|
73
|
-
"reviewedVersion": "0.9.
|
|
74
|
+
"version": "0.9.10",
|
|
75
|
+
"reviewedVersion": "0.9.10",
|
|
74
76
|
"repository": "https://github.com/minuque/pi-cc-extensions",
|
|
75
|
-
"commit": "
|
|
77
|
+
"commit": "2b72669cafefe0771b2e3e63b0db5c478314d2d4"
|
|
76
78
|
}
|
|
77
79
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#258](https://github.com/HerbertGao/pi-extensions/pull/258) [`4f505b1`](https://github.com/HerbertGao/pi-extensions/commit/4f505b1456c5ea766121ee915f14ad29e48973e7) Thanks [@HerbertGao](https://github.com/HerbertGao)! - Keep Pi 1.x tool-call capabilities when starting a mentioned agent through a conversation clone, while preserving attribution to the main session.
|
|
8
|
+
|
|
3
9
|
## 0.18.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -108,7 +108,7 @@ export async function runMentionClone(
|
|
|
108
108
|
let spawned = false
|
|
109
109
|
const cloneAgentTool: ToolDefinition = {
|
|
110
110
|
...agentTool,
|
|
111
|
-
execute: (_cloneToolCallId, params, signal, onUpdate,
|
|
111
|
+
execute: (_cloneToolCallId, params, signal, onUpdate, cloneCtx) => {
|
|
112
112
|
// One spawn per mention. The clone has a single tool and every reason to
|
|
113
113
|
// stop after using it, but a model that decides to "also" launch a second
|
|
114
114
|
// agent would do it where nobody can see and nobody asked.
|
|
@@ -138,7 +138,8 @@ export async function runMentionClone(
|
|
|
138
138
|
} as typeof params,
|
|
139
139
|
signal,
|
|
140
140
|
onUpdate,
|
|
141
|
-
|
|
141
|
+
// Keep Pi's tool-call capabilities, but attribute the spawn to the main session.
|
|
142
|
+
{ ...ctx, tools: cloneCtx.tools, executeTool: cloneCtx.executeTool },
|
|
142
143
|
)
|
|
143
144
|
},
|
|
144
145
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
We welcome external pull requests that improve token efficiency and reduce token cost through Pi-compatible extensions.
|
|
4
|
+
|
|
5
|
+
## Pull Request Requirements
|
|
6
|
+
|
|
7
|
+
Your PR should:
|
|
8
|
+
|
|
9
|
+
- Implement a Pi-compatible extension using Pi's public extension APIs, without modifying Pi's core.
|
|
10
|
+
- Be tested before submission, with relevant automated tests and reproducible validation steps.
|
|
11
|
+
- Clearly explain how the extension reduces token cost or improves token efficiency, including local measurements where available.
|
|
12
|
+
- Document its configuration, expected behavior, and any trade-offs. Efficiency improvements will be evaluated alongside correctness and task performance.
|
|
13
|
+
|
|
14
|
+
## Benchmarking and Reports
|
|
15
|
+
|
|
16
|
+
Our team will help benchmark submitted extensions to evaluate token usage, model cost, and task performance.
|
|
17
|
+
|
|
18
|
+
We will publish updated benchmark reports on a regular reporting cycle, sharing evaluated changes, results, and any observed trade-offs.
|
|
19
|
+
|
|
20
|
+
## Contributor Recognition
|
|
21
|
+
|
|
22
|
+
Authors of accepted PRs will be credited as Contributors in the project documentation and the relevant benchmark reports.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="assets/sol-pi-hero.png" width="100%" alt="SoL-Pi: Scaling Auto-Research Loops for Efficient Agent Harnesses" />
|
|
2
|
+
<img src="https://raw.githubusercontent.com/HerbertGao/pi-extensions/refs/heads/master/packages/sol-pi/assets/sol-pi-hero.png" width="100%" alt="SoL-Pi: Scaling Auto-Research Loops for Efficient Agent Harnesses" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# ⚡ SoL-Pi: Scaling Auto-Research Loops for Efficient Agent Harnesses
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
+
<a href="https://arxiv.org/abs/2609.20519"><img src="https://img.shields.io/badge/arXiv-2609.20519-B31B1B?logo=arxiv&logoColor=white" alt="arXiv: 2609.20519" /></a>
|
|
8
9
|
<a href="#getting-started"><img src="https://img.shields.io/badge/Getting%20Started-Install-76B900" alt="Getting Started" /></a>
|
|
9
10
|
<a href="docs/configuration.md"><img src="https://img.shields.io/badge/Docs-Configuration-555555" alt="Configuration" /></a>
|
|
10
11
|
<a href="https://nvlabs.github.io/SoL-Pi/"><img src="https://img.shields.io/badge/Blog-SoL--Pi-76B900" alt="SoL-Pi Blog" /></a>
|
|
@@ -52,32 +53,36 @@ The mechanisms share four rules:
|
|
|
52
53
|
|
|
53
54
|
Read the [SoL-Pi blog](https://nvlabs.github.io/SoL-Pi/) for a deeper look at the technical details, design rationale, and core insights behind SoL-Pi, including how auto-research led to the four efficiency mechanisms and how they work.
|
|
54
55
|
|
|
56
|
+
## Paper
|
|
57
|
+
|
|
58
|
+
Read our paper: [SoL-Pi: Recursively Scaling Auto-Research Loops for Efficient Agent Harness](https://arxiv.org/abs/2609.20519).
|
|
59
|
+
|
|
55
60
|
## Getting Started
|
|
56
61
|
|
|
57
62
|
### Requirements
|
|
58
63
|
|
|
59
64
|
- Node.js 24 or newer
|
|
60
65
|
- npm
|
|
61
|
-
- `@earendil-works/pi-coding-agent` 0.
|
|
66
|
+
- `@earendil-works/pi-coding-agent` 1.0.4 (the monorepo's tested host; runtime peers remain `*`)
|
|
62
67
|
|
|
63
68
|
### Install
|
|
64
69
|
|
|
65
70
|
Install the tested Pi release:
|
|
66
71
|
|
|
67
72
|
```bash
|
|
68
|
-
npm install --global @earendil-works/pi-coding-agent@0.
|
|
73
|
+
npm install --global @earendil-works/pi-coding-agent@1.0.4
|
|
69
74
|
```
|
|
70
75
|
|
|
71
|
-
|
|
76
|
+
Install this independently maintained package, or use `@herbertgao/pi-extensions` for the collection:
|
|
72
77
|
|
|
73
78
|
```bash
|
|
74
|
-
pi install
|
|
79
|
+
pi install npm:@herbertgao/sol-pi
|
|
75
80
|
```
|
|
76
81
|
|
|
77
82
|
To install it only for the current project, use the project-local scope:
|
|
78
83
|
|
|
79
84
|
```bash
|
|
80
|
-
pi install
|
|
85
|
+
pi install npm:@herbertgao/sol-pi --local --approve
|
|
81
86
|
```
|
|
82
87
|
|
|
83
88
|
### Configure
|
|
@@ -102,9 +107,9 @@ The following conservative configuration enables only the two local mechanisms t
|
|
|
102
107
|
}
|
|
103
108
|
```
|
|
104
109
|
|
|
105
|
-
Enable additional mechanisms only after reviewing their configuration and security implications. SoL-Pi uses no dedicated environment variables; feature flags, the reducer provider/model route, and the compaction ratio are configured in `sol-pi.json`.
|
|
110
|
+
Enable additional mechanisms only after reviewing their configuration and security implications. SoL-Pi uses no dedicated environment variables; feature flags, the reducer provider/model route, and the compaction ratio are configured in `sol-pi.json`. See [sol-pi.example.json](sol-pi.example.json) for a template listing every key.
|
|
106
111
|
|
|
107
|
-
For the complete schema, see [Configuration](docs/configuration.md). Coding agents and automated environments should follow the canonical [agent installation and configuration protocol](agents-install.md)
|
|
112
|
+
For the complete schema, see [Configuration](docs/configuration.md). Coding agents and automated environments should follow the canonical [agent installation and configuration protocol](agents-install.md), which describes an all-enabled configuration checked with `scripts/check-sol-pi-config.mjs --require-all-enabled`.
|
|
108
113
|
|
|
109
114
|
## Storage and Security
|
|
110
115
|
|
|
@@ -118,7 +123,9 @@ ObservationPack and Evidence-Preserving Reducer store session-specific archives
|
|
|
118
123
|
|
|
119
124
|
They archive eligible source material in this directory. The archived copies remain local and are not automatically deleted when the Pi session ends.
|
|
120
125
|
|
|
121
|
-
|
|
126
|
+
With `pi --no-session` or `SessionManager.inMemory()`, Pi provides no session directory. SoL-Pi instead creates a private directory named `sol-pi-<session-id>-<random>/` under the operating system's temporary directory. ObservationPack and Evidence-Preserving Reducer share this directory for the lifetime of the loaded extension. These modes disable Pi's session-log persistence; SoL-Pi still writes archive files for exact recall. Temporary archives are also retained after the session or worker exits so callers can read referenced evidence. Their eventual cleanup follows the host's temporary-file policy or the caller's cleanup, and they are not guaranteed to survive system cleanup or support session recovery.
|
|
127
|
+
|
|
128
|
+
Online Context Compact stores its state in Pi's session log. After a successful compaction, or a recoverable native refusal (session too small, already compacted, or an incomplete summary at the token cap), it automatically continues the active task. A refused attempt retains the existing context and adds no cache debt; plan-only turns cannot repeatedly retry it. Cancelling the run or exiting Pi does not trigger automatic continuation.
|
|
122
129
|
|
|
123
130
|
Evidence-Preserving Reducer may send eligible diagnostic-log content to its configured reducer model using Pi-managed authentication. Review [SECURITY.md](SECURITY.md) before enabling it. Do not enable remote reduction for logs that must remain local.
|
|
124
131
|
|
|
@@ -133,22 +140,22 @@ Evidence-Preserving Reducer may send eligible diagnostic-log content to its conf
|
|
|
133
140
|
|
|
134
141
|
## Development
|
|
135
142
|
|
|
136
|
-
|
|
143
|
+
From the monorepo root, install from its Bun lockfile and run the complete source checks:
|
|
137
144
|
|
|
138
145
|
```bash
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
node scripts/check-pi-compat.mjs
|
|
146
|
+
bun install --frozen-lockfile
|
|
147
|
+
bun run check
|
|
148
|
+
bun audit
|
|
149
|
+
node packages/sol-pi/scripts/check-pi-compat.mjs
|
|
143
150
|
```
|
|
144
151
|
|
|
145
|
-
`
|
|
152
|
+
For package-only checks, run `bun run --cwd packages/sol-pi typecheck` and `bun run --cwd packages/sol-pi test`, then inspect the package with `npm pack --dry-run` from `packages/sol-pi`. Root development dependencies provide Pi 1.0.4; runtime Pi packages remain peer dependencies so Pi owns their installation and upgrades.
|
|
146
153
|
|
|
147
154
|
## Project Status
|
|
148
155
|
|
|
149
|
-
SoL-Pi is developed
|
|
156
|
+
The original SoL-Pi project is developed by NVIDIA as a standalone extension for Pi. This package is independently maintained in HerbertGao/pi-extensions.
|
|
150
157
|
|
|
151
|
-
|
|
158
|
+
For upstream contributions, see [CONTRIBUTING.md](CONTRIBUTING.md). Report collection-specific issues to [HerbertGao/pi-extensions](https://github.com/HerbertGao/pi-extensions/issues); upstream private security channels remain described in [SECURITY.md](SECURITY.md).
|
|
152
159
|
|
|
153
160
|
## Acknowledgements
|
|
154
161
|
|
|
@@ -157,3 +164,15 @@ SoL-Pi builds on the public extension interfaces provided by [Pi](https://github
|
|
|
157
164
|
## License
|
|
158
165
|
|
|
159
166
|
SoL-Pi is released under the [MIT License](LICENSE).
|
|
167
|
+
|
|
168
|
+
## Star History
|
|
169
|
+
|
|
170
|
+
This chart tracks the original NVIDIA project. Its generator and tests are retained as development-only references; publication stays in the [upstream workflow](docs/star-history.md), not this monorepo.
|
|
171
|
+
|
|
172
|
+
<a href="https://www.star-history.com/?repos=NVlabs%2FSoL-Pi&type=date">
|
|
173
|
+
<picture>
|
|
174
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/NVlabs/SoL-Pi/star-history/star-history-dark.svg" />
|
|
175
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/NVlabs/SoL-Pi/star-history/star-history-light.svg" />
|
|
176
|
+
<img alt="SoL-Pi star history chart" src="https://raw.githubusercontent.com/NVlabs/SoL-Pi/star-history/star-history-light.svg" width="100%" />
|
|
177
|
+
</picture>
|
|
178
|
+
</a>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Third-Party Notices
|
|
2
2
|
|
|
3
|
-
SoL-Pi
|
|
3
|
+
This independently maintained package imports the MIT-licensed SoL-Pi source from [NVlabs/SoL-Pi](https://github.com/NVlabs/SoL-Pi). Original NVIDIA copyright and MIT notices are preserved; `package.json` records the imported baseline in `x-upstream`. Its npm tarball contains only SoL-Pi source, documentation, assets, and project metadata, without vendored Pi or Star History source.
|
|
4
4
|
|
|
5
5
|
## Runtime peer dependencies
|
|
6
6
|
|
|
@@ -8,12 +8,16 @@ The following packages are supplied by the user's Pi installation and retain the
|
|
|
8
8
|
|
|
9
9
|
| Package | Development-tested version | License | Source |
|
|
10
10
|
| --- | ---: | --- | --- |
|
|
11
|
-
| `@earendil-works/pi-agent-core` | 0.
|
|
12
|
-
| `@earendil-works/pi-ai` | 0.
|
|
13
|
-
| `@earendil-works/pi-coding-agent` | 0.
|
|
14
|
-
| `@earendil-works/pi-tui` | 0.
|
|
11
|
+
| `@earendil-works/pi-agent-core` | 1.0.4 | MIT | <https://github.com/earendil-works/pi> |
|
|
12
|
+
| `@earendil-works/pi-ai` | 1.0.4 | MIT | <https://github.com/earendil-works/pi> |
|
|
13
|
+
| `@earendil-works/pi-coding-agent` | 1.0.4 | MIT | <https://github.com/earendil-works/pi> |
|
|
14
|
+
| `@earendil-works/pi-tui` | 1.0.4 | MIT | <https://github.com/earendil-works/pi> |
|
|
15
15
|
| `typebox` | 1.3.7 | MIT | <https://github.com/sinclairzx81/typebox> |
|
|
16
16
|
|
|
17
17
|
## Development-only dependencies
|
|
18
18
|
|
|
19
|
-
`@types/node` (MIT), TypeScript (Apache-2.0), and Vitest (MIT) are used to type-check and test the repository. They are not included in the SoL-Pi npm tarball. Exact versions and transitive dependency metadata are recorded in `
|
|
19
|
+
`@types/node` (MIT), TypeScript (Apache-2.0), and Vitest (MIT) are used to type-check and test the repository. They are not included in the SoL-Pi npm tarball. Exact versions and transitive dependency metadata are recorded in the monorepo root's `bun.lock`.
|
|
20
|
+
|
|
21
|
+
## Star history chart generation
|
|
22
|
+
|
|
23
|
+
The upstream documentation workflow (not enabled in this monorepo) checks out the MIT-licensed [Star History renderer](https://github.com/star-history/star-history/tree/c326eac651bc5afb4cd40d354223dd419e1e2ae6) to preserve its chart design. Its source and dependencies are installed only for chart generation and are not included in the SoL-Pi npm tarball. The generated chart branch includes the upstream MIT license as `LICENSE-star-history.txt`.
|