@herbertgao/pi-extensions 2026.9.19 → 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 +14 -16
- 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 +85 -68
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +79 -62
- package/node_modules/@herbertgao/pi-cc-extensions/assets/readme/preview.webp +0 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +116 -34
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +370 -118
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +6 -36
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/index.ts +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +31 -33
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +330 -360
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/reference/index.ts +56 -108
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/reference/session.ts +97 -15
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/reference/subagent.ts +80 -45
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/flush-docked-bash.ts +36 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer-layout.ts +229 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +521 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/mcp-chip.ts +136 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/startup-header.ts +92 -61
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/working-message.ts +58 -38
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/index.ts +19 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +1127 -231
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +267 -262
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +38 -48
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +8 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/hover.ts +2 -7
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +287 -114
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/layout.ts +15 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/packets.ts +18 -72
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +61 -26
- 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/ansi-utils.ts +25 -57
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-component.ts +125 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-edit-render.ts +227 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-header.ts +136 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-highlight.ts +151 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-inline.ts +324 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-layout.ts +762 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-limits.ts +152 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-palette.ts +410 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-parse.ts +535 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-presentation.ts +4 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-renderer.ts +21 -3219
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-text.ts +44 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-write-render.ts +568 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/index.ts +103 -48
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/line-width-safety.ts +8 -7
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/write-execution.ts +2 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +171 -196
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/mcp-title.ts +39 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{message-display.ts → tool/message-display.ts} +27 -93
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +429 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +259 -164
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{show-more-hint.ts → tool/show-more-hint.ts} +10 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/transcript-refresh.ts +8 -26
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-color.ts +44 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-text.ts +77 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/component-tree.ts +34 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/format.ts +28 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/fullscreen-detect.ts +51 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/patch-keys.ts +124 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/sgr-mouse.ts +70 -0
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +10 -8
- 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/codex → 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/pi → 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/claude-code → 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 +18 -22
- package/node_modules/@herbertgao/pi-cc-extensions/assets/readme/hero.en.svg +0 -101
- package/node_modules/@herbertgao/pi-cc-extensions/assets/readme/hero.svg +0 -101
- package/node_modules/@herbertgao/pi-cc-extensions/assets/readme/welcome.webp +0 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/render-utils.ts +0 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/types.ts +0 -30
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/write-display-utils.ts +0 -12
- 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/pi-footer/CHANGELOG.md +0 -145
- package/node_modules/pi-footer/LICENSE +0 -21
- package/node_modules/pi-footer/README.md +0 -354
- package/node_modules/pi-footer/package.json +0 -68
- package/node_modules/pi-footer/src/cache.ts +0 -106
- package/node_modules/pi-footer/src/colors.ts +0 -237
- package/node_modules/pi-footer/src/config.ts +0 -202
- package/node_modules/pi-footer/src/event-widgets.ts +0 -41
- package/node_modules/pi-footer/src/extension-statuses.ts +0 -102
- package/node_modules/pi-footer/src/git.ts +0 -135
- package/node_modules/pi-footer/src/index.ts +0 -268
- package/node_modules/pi-footer/src/metrics.ts +0 -141
- package/node_modules/pi-footer/src/presets.ts +0 -383
- package/node_modules/pi-footer/src/render.ts +0 -114
- package/node_modules/pi-footer/src/separators.ts +0 -52
- package/node_modules/pi-footer/src/types.ts +0 -122
- package/node_modules/pi-footer/src/ui/color-level-confirm.ts +0 -22
- package/node_modules/pi-footer/src/ui/color-options.ts +0 -195
- package/node_modules/pi-footer/src/ui/config-lifecycle.ts +0 -61
- package/node_modules/pi-footer/src/ui/edit-colors.ts +0 -13
- package/node_modules/pi-footer/src/ui/events.ts +0 -35
- package/node_modules/pi-footer/src/ui/extension-status-picker.ts +0 -60
- package/node_modules/pi-footer/src/ui/extension-statuses.ts +0 -73
- package/node_modules/pi-footer/src/ui/fields.ts +0 -252
- package/node_modules/pi-footer/src/ui/global-menu.ts +0 -126
- package/node_modules/pi-footer/src/ui/helpers.ts +0 -44
- package/node_modules/pi-footer/src/ui/layout.ts +0 -17
- package/node_modules/pi-footer/src/ui/line-list.ts +0 -19
- package/node_modules/pi-footer/src/ui/model.ts +0 -64
- package/node_modules/pi-footer/src/ui/navigation.ts +0 -29
- package/node_modules/pi-footer/src/ui/option-edit.ts +0 -93
- package/node_modules/pi-footer/src/ui/overlay-render.ts +0 -103
- package/node_modules/pi-footer/src/ui/screen-context.ts +0 -18
- package/node_modules/pi-footer/src/ui/screen-controller.ts +0 -27
- package/node_modules/pi-footer/src/ui/screen-render.ts +0 -32
- package/node_modules/pi-footer/src/ui/screen-state.ts +0 -20
- package/node_modules/pi-footer/src/ui/screen.ts +0 -243
- package/node_modules/pi-footer/src/ui/screens/add-widget.ts +0 -92
- package/node_modules/pi-footer/src/ui/screens/confirm-exit.ts +0 -52
- package/node_modules/pi-footer/src/ui/screens/controller.ts +0 -12
- package/node_modules/pi-footer/src/ui/screens/edit-colors.ts +0 -68
- package/node_modules/pi-footer/src/ui/screens/edit-widget.ts +0 -115
- package/node_modules/pi-footer/src/ui/screens/extension-status-row.ts +0 -61
- package/node_modules/pi-footer/src/ui/screens/global.ts +0 -75
- package/node_modules/pi-footer/src/ui/screens/line-list.ts +0 -108
- package/node_modules/pi-footer/src/ui/screens/main.ts +0 -99
- package/node_modules/pi-footer/src/ui/screens/terminal.ts +0 -121
- package/node_modules/pi-footer/src/ui/screens/widget-list.ts +0 -154
- package/node_modules/pi-footer/src/ui/terminal-menu.ts +0 -32
- package/node_modules/pi-footer/src/ui/theme.ts +0 -48
- package/node_modules/pi-footer/src/ui/title-bar.ts +0 -100
- package/node_modules/pi-footer/src/ui/widget-actions.ts +0 -76
- package/node_modules/pi-footer/src/ui.ts +0 -66
- package/node_modules/pi-footer/src/widgets/context.ts +0 -28
- package/node_modules/pi-footer/src/widgets/core/active-tools.ts +0 -17
- package/node_modules/pi-footer/src/widgets/core/context-window.ts +0 -24
- package/node_modules/pi-footer/src/widgets/core/cwd-basename.ts +0 -19
- package/node_modules/pi-footer/src/widgets/core/cwd.ts +0 -108
- package/node_modules/pi-footer/src/widgets/core/event.ts +0 -34
- package/node_modules/pi-footer/src/widgets/core/external-status.ts +0 -102
- package/node_modules/pi-footer/src/widgets/core/model-provider.ts +0 -20
- package/node_modules/pi-footer/src/widgets/core/model.ts +0 -35
- package/node_modules/pi-footer/src/widgets/core/provider.ts +0 -17
- package/node_modules/pi-footer/src/widgets/core/session-name.ts +0 -17
- package/node_modules/pi-footer/src/widgets/core/text-verbosity.ts +0 -17
- package/node_modules/pi-footer/src/widgets/core/thinking-level.ts +0 -17
- package/node_modules/pi-footer/src/widgets/git/ahead-behind.ts +0 -17
- package/node_modules/pi-footer/src/widgets/git/branch.ts +0 -81
- package/node_modules/pi-footer/src/widgets/git/clean.ts +0 -19
- package/node_modules/pi-footer/src/widgets/git/deletions.ts +0 -17
- package/node_modules/pi-footer/src/widgets/git/diff.ts +0 -38
- package/node_modules/pi-footer/src/widgets/git/insertions.ts +0 -17
- package/node_modules/pi-footer/src/widgets/git/remote.ts +0 -17
- package/node_modules/pi-footer/src/widgets/git/root.ts +0 -17
- package/node_modules/pi-footer/src/widgets/git/sha.ts +0 -17
- package/node_modules/pi-footer/src/widgets/git/staged.ts +0 -17
- package/node_modules/pi-footer/src/widgets/git/status.ts +0 -19
- package/node_modules/pi-footer/src/widgets/git/unstaged.ts +0 -17
- package/node_modules/pi-footer/src/widgets/git/untracked.ts +0 -17
- package/node_modules/pi-footer/src/widgets/instance.ts +0 -118
- package/node_modules/pi-footer/src/widgets/layout/custom-text.ts +0 -18
- package/node_modules/pi-footer/src/widgets/layout/flex-separator.ts +0 -32
- package/node_modules/pi-footer/src/widgets/layout/separator.ts +0 -57
- package/node_modules/pi-footer/src/widgets/layout/spacer.ts +0 -31
- package/node_modules/pi-footer/src/widgets/options.ts +0 -122
- package/node_modules/pi-footer/src/widgets/project/runtime.ts +0 -361
- package/node_modules/pi-footer/src/widgets/registry.ts +0 -223
- package/node_modules/pi-footer/src/widgets/session/assistant-messages.ts +0 -17
- package/node_modules/pi-footer/src/widgets/session/compactions.ts +0 -17
- package/node_modules/pi-footer/src/widgets/session/elapsed.ts +0 -18
- package/node_modules/pi-footer/src/widgets/session/last-activity.ts +0 -18
- package/node_modules/pi-footer/src/widgets/session/messages.ts +0 -19
- package/node_modules/pi-footer/src/widgets/session/session-id.ts +0 -17
- package/node_modules/pi-footer/src/widgets/session/session-start.ts +0 -18
- package/node_modules/pi-footer/src/widgets/session/tool-results.ts +0 -17
- package/node_modules/pi-footer/src/widgets/session/total-messages.ts +0 -19
- package/node_modules/pi-footer/src/widgets/session/total-time.ts +0 -18
- package/node_modules/pi-footer/src/widgets/session/user-messages.ts +0 -17
- package/node_modules/pi-footer/src/widgets/store.ts +0 -26
- package/node_modules/pi-footer/src/widgets/tokens/cache-hit-rate.ts +0 -55
- package/node_modules/pi-footer/src/widgets/tokens/cache-read.ts +0 -18
- package/node_modules/pi-footer/src/widgets/tokens/cache-write.ts +0 -18
- package/node_modules/pi-footer/src/widgets/tokens/context-bar.ts +0 -108
- package/node_modules/pi-footer/src/widgets/tokens/context-length.ts +0 -26
- package/node_modules/pi-footer/src/widgets/tokens/context-remaining.ts +0 -29
- package/node_modules/pi-footer/src/widgets/tokens/context.ts +0 -29
- package/node_modules/pi-footer/src/widgets/tokens/cost.ts +0 -51
- package/node_modules/pi-footer/src/widgets/tokens/input-speed.ts +0 -25
- package/node_modules/pi-footer/src/widgets/tokens/input-tokens.ts +0 -18
- package/node_modules/pi-footer/src/widgets/tokens/output-speed.ts +0 -25
- package/node_modules/pi-footer/src/widgets/tokens/output-tokens.ts +0 -18
- package/node_modules/pi-footer/src/widgets/tokens/tokens.ts +0 -20
- package/node_modules/pi-footer/src/widgets/tokens/total-speed.ts +0 -25
- package/node_modules/pi-footer/src/widgets/tokens/total-tokens.ts +0 -18
- package/node_modules/pi-footer/src/widgets/types.ts +0 -181
- package/node_modules/pi-footer/src/widgets/utils/colors.ts +0 -11
- package/node_modules/pi-footer/src/widgets/utils/context.ts +0 -112
- package/node_modules/pi-footer/src/widgets/utils/session.ts +0 -19
- package/node_modules/pi-footer/src/widgets/utils/token-format.ts +0 -78
- /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
|
@@ -40,8 +40,14 @@ const USER_CREDENTIAL_PATTERN = /(^|[\s;&|])(-u|--user)(=|\s+)("[^"\r\n]*"|'[^'\
|
|
|
40
40
|
const URI_USERINFO_PATTERN = /\b([a-z][a-z0-9+.-]*:\/\/)([^\s/:@]+):([^\s/@]+)@/gi;
|
|
41
41
|
// Unquoted value requires a structural delimiter or line/string end following it, OR a digit
|
|
42
42
|
// somewhere in the token (C-RED-1: "token: expired" is plain English and stays, while
|
|
43
|
-
// "password: hunter2 # prod" carries a credential that must not cross even mid-line).
|
|
44
|
-
|
|
43
|
+
// "password: hunter2 # prod" carries a credential that must not cross even mid-line). The value is
|
|
44
|
+
// taken whole, however long it is, so a credential can never be left half-redacted (FR-28).
|
|
45
|
+
// A quoted key is matched whole and an unquoted one up to 64 characters: an unbounded identifier run
|
|
46
|
+
// makes the engine backtrack over the whole run at every start position, which is quadratic on a
|
|
47
|
+
// long unbroken line (measured: 50 KB of one word took 11.8 s and 100 KB never finished). A longer
|
|
48
|
+
// unquoted run still matches through its last 64 characters, and `isSensitiveKey` decides by the
|
|
49
|
+
// name's tail as well as by its whole text, so nothing the unbounded name found is hidden.
|
|
50
|
+
const JSON_LIKE_PATTERN = /(?:(?<quote>["'])(?<quoted>[A-Za-z_][A-Za-z0-9_-]*)\k<quote>|(?<bare>[A-Za-z_][A-Za-z0-9_-]{0,63}))(\s*:\s*)("[^"\r\n]*"|'[^'\r\n]*'|[^\s,;}]+(?=[,;}]|[\r\n]|$)|[^\s,;}]*\d[^\s,;}]*)/g;
|
|
45
51
|
function normalizedKey(key) {
|
|
46
52
|
return key.toLowerCase().replaceAll(/[^a-z0-9]/g, "");
|
|
47
53
|
}
|
|
@@ -118,7 +124,14 @@ export function redactSensitiveText(text) {
|
|
|
118
124
|
.replace(USER_CREDENTIAL_PATTERN, `$1$2$3${REDACTED_VALUE}`)
|
|
119
125
|
.replace(URI_USERINFO_PATTERN, `$1$2:${REDACTED_VALUE}@`)
|
|
120
126
|
.replace(ASSIGNMENT_PATTERN, (match, key, separator) => isSensitiveKey(key) ? `${key}${separator}${REDACTED_VALUE}` : match)
|
|
121
|
-
.replace(JSON_LIKE_PATTERN, (match, quote,
|
|
127
|
+
.replace(JSON_LIKE_PATTERN, (match, quote, quoted, bare, separator) => {
|
|
128
|
+
const key = quoted ?? bare;
|
|
129
|
+
if (key === undefined || !isSensitiveKey(key))
|
|
130
|
+
return match;
|
|
131
|
+
// Only the value is replaced; the quoting and the separator stay as they were recorded.
|
|
132
|
+
const name = quote === undefined ? key : `${quote}${key}${quote}`;
|
|
133
|
+
return `${name}${separator}${REDACTED_VALUE}`;
|
|
134
|
+
})
|
|
122
135
|
.replace(CREDENTIAL_PATTERN, REDACTED_VALUE);
|
|
123
136
|
}
|
|
124
137
|
/** Redact a source-recorded argument string, preserving valid JSON when it is JSON. */
|
package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/rollout.d.ts
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a Codex rollout file is: where it lives, how it is named, and which entries it holds.
|
|
3
3
|
*
|
|
4
|
-
* Every fact here was confirmed against codex-cli 0.146.0
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
4
|
+
* Every fact here was confirmed against codex-cli 0.146.0, and the `item_completed` schema below
|
|
5
|
+
* against codex-cli 0.151.0-alpha and again against 0.157.1, 0.158.0 and 0.159.2 (Constraints:
|
|
6
|
+
* "Facts about Codex are verified against the installed version, never assumed"). The entry names
|
|
7
|
+
* are the ones C-7, C-8 and C-12 measured: `event_msg` drives the visible history and the picker
|
|
8
|
+
* preview, `response_item` drives the model history only.
|
|
8
9
|
*/
|
|
9
10
|
import type { HomePath, SessionId } from "./contract.js";
|
|
10
11
|
/** Codex reads this variable to find its home; so does this adapter (FR-2, FR-3). */
|
|
@@ -21,6 +22,32 @@ export declare const CODEX_ENTRY_RESPONSE_ITEM = "response_item";
|
|
|
21
22
|
export declare const CODEX_ENTRY_COMPACTED = "compacted";
|
|
22
23
|
export declare const CODEX_EVENT_USER_MESSAGE = "user_message";
|
|
23
24
|
export declare const CODEX_EVENT_AGENT_MESSAGE = "agent_message";
|
|
25
|
+
/**
|
|
26
|
+
* The second dialogue schema (C-12): one `event_msg` per turn, whose kind is `payload.item.type`
|
|
27
|
+
* rather than `payload.type`. A rollout that speaks it has no `user_message`/`agent_message`
|
|
28
|
+
* entries at all, so reading only those two names yields zero dialogue.
|
|
29
|
+
*/
|
|
30
|
+
export declare const CODEX_EVENT_ITEM_COMPLETED = "item_completed";
|
|
31
|
+
/** `payload.item.type` values that carry a turn this module can use (C-12). */
|
|
32
|
+
export declare const CODEX_THREAD_ITEM_USER_MESSAGE = "UserMessage";
|
|
33
|
+
export declare const CODEX_THREAD_ITEM_AGENT_MESSAGE = "AgentMessage";
|
|
34
|
+
export declare const CODEX_THREAD_ITEM_COMMAND_EXECUTION = "CommandExecution";
|
|
35
|
+
export declare const CODEX_THREAD_ITEM_FILE_CHANGE = "FileChange";
|
|
36
|
+
export declare const CODEX_THREAD_ITEM_EXTENSION = "Extension";
|
|
37
|
+
export declare const CODEX_THREAD_ITEM_IMAGE_VIEW = "ImageView";
|
|
38
|
+
/** A call to a server tool, named by `server` and `tool` rather than by a model-visible name. */
|
|
39
|
+
export declare const CODEX_THREAD_ITEM_MCP_TOOL_CALL = "McpToolCall";
|
|
40
|
+
/** An action on another agent of the same client, named by its own `tool` field. */
|
|
41
|
+
export declare const CODEX_THREAD_ITEM_COLLAB_AGENT_TOOL_CALL = "CollabAgentToolCall";
|
|
42
|
+
/**
|
|
43
|
+
* Item kinds that carry no turn: reasoning cannot move (C-4), a compaction has no text, and a
|
|
44
|
+
* subagent activity marker reports progress that its own tool call already records.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CODEX_THREAD_ITEM_REASONING = "Reasoning";
|
|
47
|
+
export declare const CODEX_THREAD_ITEM_CONTEXT_COMPACTION = "ContextCompaction";
|
|
48
|
+
export declare const CODEX_THREAD_ITEM_SUB_AGENT_ACTIVITY = "SubAgentActivity";
|
|
49
|
+
/** The one `Extension.kind` measured to be a read: a web search (C-12). */
|
|
50
|
+
export declare const CODEX_EXTENSION_KIND_WEB_SEARCH = "web.search";
|
|
24
51
|
export declare const CODEX_ITEM_FUNCTION_CALL = "function_call";
|
|
25
52
|
export declare const CODEX_ITEM_FUNCTION_CALL_OUTPUT = "function_call_output";
|
|
26
53
|
export declare const CODEX_ITEM_CUSTOM_TOOL_CALL = "custom_tool_call";
|
|
@@ -65,6 +92,19 @@ export declare function parseRolloutText(text: string): {
|
|
|
65
92
|
truncated: boolean;
|
|
66
93
|
};
|
|
67
94
|
export declare function stringifyRollout(entries: RolloutEntry[]): string;
|
|
95
|
+
/** State a consumer and `streamRolloutEntries` share (C-13). */
|
|
96
|
+
export interface RolloutStreamState {
|
|
97
|
+
/** Set by the reader when a line could not be read. */
|
|
98
|
+
truncated: boolean;
|
|
99
|
+
/** Set by the consumer to end the stream at the next line, without abandoning it mid-read. */
|
|
100
|
+
stop: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Yields the entries of a rollout without ever holding the file (C-13). A line that is not one whole
|
|
104
|
+
* JSON object marks the file truncated, exactly as `parseRolloutText` does; a line longer than any
|
|
105
|
+
* Codex entry is dropped whole instead of being materialized as one string.
|
|
106
|
+
*/
|
|
107
|
+
export declare function streamRolloutEntries(filePath: string, state: RolloutStreamState): AsyncGenerator<RolloutEntry>;
|
|
68
108
|
export declare function payloadType(entry: RolloutEntry): string;
|
|
69
109
|
/** The entries Codex renders as history, and the only ones this module writes (C-7, C-8). */
|
|
70
110
|
export declare function isMessageEvent(entry: RolloutEntry): boolean;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a Codex rollout file is: where it lives, how it is named, and which entries it holds.
|
|
3
3
|
*
|
|
4
|
-
* Every fact here was confirmed against codex-cli 0.146.0
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
4
|
+
* Every fact here was confirmed against codex-cli 0.146.0, and the `item_completed` schema below
|
|
5
|
+
* against codex-cli 0.151.0-alpha and again against 0.157.1, 0.158.0 and 0.159.2 (Constraints:
|
|
6
|
+
* "Facts about Codex are verified against the installed version, never assumed"). The entry names
|
|
7
|
+
* are the ones C-7, C-8 and C-12 measured: `event_msg` drives the visible history and the picker
|
|
8
|
+
* preview, `response_item` drives the model history only.
|
|
8
9
|
*/
|
|
10
|
+
import { createReadStream } from "node:fs";
|
|
9
11
|
import { lstat, readdir } from "node:fs/promises";
|
|
10
12
|
import { homedir } from "node:os";
|
|
11
13
|
import { join, resolve } from "node:path";
|
|
@@ -23,6 +25,32 @@ export const CODEX_ENTRY_RESPONSE_ITEM = "response_item";
|
|
|
23
25
|
export const CODEX_ENTRY_COMPACTED = "compacted";
|
|
24
26
|
export const CODEX_EVENT_USER_MESSAGE = "user_message";
|
|
25
27
|
export const CODEX_EVENT_AGENT_MESSAGE = "agent_message";
|
|
28
|
+
/**
|
|
29
|
+
* The second dialogue schema (C-12): one `event_msg` per turn, whose kind is `payload.item.type`
|
|
30
|
+
* rather than `payload.type`. A rollout that speaks it has no `user_message`/`agent_message`
|
|
31
|
+
* entries at all, so reading only those two names yields zero dialogue.
|
|
32
|
+
*/
|
|
33
|
+
export const CODEX_EVENT_ITEM_COMPLETED = "item_completed";
|
|
34
|
+
/** `payload.item.type` values that carry a turn this module can use (C-12). */
|
|
35
|
+
export const CODEX_THREAD_ITEM_USER_MESSAGE = "UserMessage";
|
|
36
|
+
export const CODEX_THREAD_ITEM_AGENT_MESSAGE = "AgentMessage";
|
|
37
|
+
export const CODEX_THREAD_ITEM_COMMAND_EXECUTION = "CommandExecution";
|
|
38
|
+
export const CODEX_THREAD_ITEM_FILE_CHANGE = "FileChange";
|
|
39
|
+
export const CODEX_THREAD_ITEM_EXTENSION = "Extension";
|
|
40
|
+
export const CODEX_THREAD_ITEM_IMAGE_VIEW = "ImageView";
|
|
41
|
+
/** A call to a server tool, named by `server` and `tool` rather than by a model-visible name. */
|
|
42
|
+
export const CODEX_THREAD_ITEM_MCP_TOOL_CALL = "McpToolCall";
|
|
43
|
+
/** An action on another agent of the same client, named by its own `tool` field. */
|
|
44
|
+
export const CODEX_THREAD_ITEM_COLLAB_AGENT_TOOL_CALL = "CollabAgentToolCall";
|
|
45
|
+
/**
|
|
46
|
+
* Item kinds that carry no turn: reasoning cannot move (C-4), a compaction has no text, and a
|
|
47
|
+
* subagent activity marker reports progress that its own tool call already records.
|
|
48
|
+
*/
|
|
49
|
+
export const CODEX_THREAD_ITEM_REASONING = "Reasoning";
|
|
50
|
+
export const CODEX_THREAD_ITEM_CONTEXT_COMPACTION = "ContextCompaction";
|
|
51
|
+
export const CODEX_THREAD_ITEM_SUB_AGENT_ACTIVITY = "SubAgentActivity";
|
|
52
|
+
/** The one `Extension.kind` measured to be a read: a web search (C-12). */
|
|
53
|
+
export const CODEX_EXTENSION_KIND_WEB_SEARCH = "web.search";
|
|
26
54
|
export const CODEX_ITEM_FUNCTION_CALL = "function_call";
|
|
27
55
|
export const CODEX_ITEM_FUNCTION_CALL_OUTPUT = "function_call_output";
|
|
28
56
|
export const CODEX_ITEM_CUSTOM_TOOL_CALL = "custom_tool_call";
|
|
@@ -136,6 +164,62 @@ export function parseRolloutText(text) {
|
|
|
136
164
|
export function stringifyRollout(entries) {
|
|
137
165
|
return entries.map((entry) => `${JSON.stringify(entry)}\n`).join("");
|
|
138
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* A Codex entry is kilobytes; a longer line is damage, not a turn. Such a line is dropped whole and
|
|
169
|
+
* the file counts as truncated, so no rollout can exhaust memory or the maximum string length (C-13).
|
|
170
|
+
*/
|
|
171
|
+
const MAX_ENTRY_LINE_CHARS = 16 * 1024 * 1024;
|
|
172
|
+
/**
|
|
173
|
+
* Yields the entries of a rollout without ever holding the file (C-13). A line that is not one whole
|
|
174
|
+
* JSON object marks the file truncated, exactly as `parseRolloutText` does; a line longer than any
|
|
175
|
+
* Codex entry is dropped whole instead of being materialized as one string.
|
|
176
|
+
*/
|
|
177
|
+
export async function* streamRolloutEntries(filePath, state) {
|
|
178
|
+
const stream = createReadStream(filePath, { encoding: "utf8", highWaterMark: 1 << 20 });
|
|
179
|
+
let pending = "";
|
|
180
|
+
let droppingLine = false;
|
|
181
|
+
try {
|
|
182
|
+
for await (const chunk of stream) {
|
|
183
|
+
pending += chunk;
|
|
184
|
+
for (;;) {
|
|
185
|
+
const end = pending.indexOf("\n");
|
|
186
|
+
if (end === -1)
|
|
187
|
+
break;
|
|
188
|
+
const line = pending.slice(0, end);
|
|
189
|
+
pending = pending.slice(end + 1);
|
|
190
|
+
if (droppingLine) {
|
|
191
|
+
// The tail of an over-long line: its newline is the last of it.
|
|
192
|
+
droppingLine = false;
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
const entry = line.trim() === "" ? null : parseEntry(line);
|
|
196
|
+
if (entry !== null) {
|
|
197
|
+
yield entry;
|
|
198
|
+
if (state.stop === true)
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
else if (line.trim() !== "") {
|
|
202
|
+
state.truncated = true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (pending.length > MAX_ENTRY_LINE_CHARS) {
|
|
206
|
+
pending = "";
|
|
207
|
+
droppingLine = true;
|
|
208
|
+
state.truncated = true;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (!droppingLine && pending.trim() !== "") {
|
|
212
|
+
const entry = parseEntry(pending);
|
|
213
|
+
if (entry !== null)
|
|
214
|
+
yield entry;
|
|
215
|
+
else
|
|
216
|
+
state.truncated = true;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
finally {
|
|
220
|
+
stream.destroy();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
139
223
|
export function payloadType(entry) {
|
|
140
224
|
const type = entry.payload.type;
|
|
141
225
|
return typeof type === "string" ? type : "";
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* does: a file with session metadata and one `event_msg` entry per turn is listed, previewed and
|
|
7
7
|
* resumed with native turns. This module writes that file, and never calls that API.
|
|
8
8
|
*/
|
|
9
|
-
import type { CanonicalSession, ProvenanceMarker, SerializedSession, TargetProfile, ValidationDefect } from "./contract.js";
|
|
9
|
+
import type { CanonicalSession, ProvenanceMarker, SerializationContext, SerializedSession, TargetProfile, ValidationDefect } from "./contract.js";
|
|
10
10
|
export type { CodexSerializeDeps } from "./contract.js";
|
|
11
11
|
import type { CodexSerializeDeps } from "./contract.js";
|
|
12
|
-
export declare function serializeCodex(session: CanonicalSession, target: TargetProfile, marker: ProvenanceMarker, deps: CodexSerializeDeps): SerializedSession;
|
|
12
|
+
export declare function serializeCodex(session: CanonicalSession, target: TargetProfile, marker: ProvenanceMarker, context: SerializationContext, deps: CodexSerializeDeps): SerializedSession;
|
|
13
13
|
/**
|
|
14
14
|
* FR-50, read against C-7's symptoms: a thread without metadata or without a non-empty first
|
|
15
15
|
* user message is invisible to the picker, and a `response_item` entry is the shape C-8 replaced.
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
import { basename, isAbsolute } from "node:path";
|
|
10
10
|
import { CODEX_CLI_VERSION, CODEX_ENTRY_EVENT_MSG, CODEX_ENTRY_SESSION_META, CODEX_EVENT_AGENT_MESSAGE, CODEX_EVENT_USER_MESSAGE, CODEX_ORIGINATOR, CODEX_SOURCE_CLI, isMessageEvent, rolloutFilePath, sessionIdFromRolloutFileName, stringifyRollout, } from "./rollout.js";
|
|
11
11
|
import { inspectCodexRollout } from "./validation.js";
|
|
12
|
-
export function serializeCodex(session, target, marker, deps) {
|
|
12
|
+
export function serializeCodex(session, target, marker, context, deps) {
|
|
13
13
|
const importedAt = resolveStamp(marker.importedAt, session.provenance);
|
|
14
14
|
const sessionId = deps.newSessionId();
|
|
15
15
|
const stamp = importedAt.toISOString();
|
|
16
|
-
const entries = [sessionMetaEntry(sessionId, stamp,
|
|
16
|
+
const entries = [sessionMetaEntry(sessionId, stamp, context.cwd, session)];
|
|
17
17
|
// Codex has no verified durable, out-of-context transcript entry. Do not encode
|
|
18
18
|
// provenance as an agent message: that would make imported metadata look like
|
|
19
19
|
// conversation and could send it back to the model on resume.
|
|
@@ -34,6 +34,10 @@ export interface ValidationDefect {
|
|
|
34
34
|
/** What is missing or malformed, and why the agent would fail on it. */
|
|
35
35
|
message: string;
|
|
36
36
|
}
|
|
37
|
+
/** The host-supplied absolute destination, preserving native subdirectory and symlink spelling. */
|
|
38
|
+
export interface SerializationContext {
|
|
39
|
+
cwd: string;
|
|
40
|
+
}
|
|
37
41
|
/** What serializing a canonical session into the target format produced. */
|
|
38
42
|
export interface SerializedSession {
|
|
39
43
|
sessionId: SessionId;
|
|
@@ -64,7 +68,7 @@ export interface AgentAdapter {
|
|
|
64
68
|
/** Source role. Reads one session into the neutral vocabulary. Drops every result body. */
|
|
65
69
|
loadSession(descriptor: SessionDescriptor): Promise<CanonicalSession>;
|
|
66
70
|
/** Target role. Produces bytes only. It never creates a file (FR-49, FR-53). */
|
|
67
|
-
serialize(session: CanonicalSession, target: TargetProfile, marker: ProvenanceMarker): SerializedSession;
|
|
71
|
+
serialize(session: CanonicalSession, target: TargetProfile, marker: ProvenanceMarker, context: SerializationContext): SerializedSession;
|
|
68
72
|
/** Target role. Checks the structure before placement. Empty means valid (FR-50). */
|
|
69
73
|
validate(serialized: SerializedSession): ValidationDefect[];
|
|
70
74
|
/** Target role. Reads the committed session back, to compare item counts (FR-51, FR-52). */
|
|
@@ -8,13 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { readdir, readFile, stat } from "node:fs/promises";
|
|
11
|
-
import { basename, join } from "node:path";
|
|
11
|
+
import { basename, isAbsolute, join } from "node:path";
|
|
12
12
|
import { DEFAULT_WINDOW_TOKENS, defaultPiHome, sessionIdFromFileName, sessionsRoot, shortTitle, toIsoUtc, UNREADABLE_TITLE_PREFIX, } from "./format.js";
|
|
13
13
|
import { changedPathsFromEntries, entriesToTurns, lastTimestamp, parseSessionText, resolveActiveEntries, titleFromEntries, } from "./parse.js";
|
|
14
14
|
import { serializeSession } from "./serialize.js";
|
|
15
15
|
import { validateSerialized } from "./validate.js";
|
|
16
16
|
const DEFAULT_DEPS = {
|
|
17
|
-
cwd: () => process.cwd(),
|
|
18
17
|
now: () => new Date(),
|
|
19
18
|
newSessionId: () => randomUUID(),
|
|
20
19
|
newEntryId: () => randomUUID().slice(0, 8),
|
|
@@ -68,6 +67,7 @@ function describe(home, filePath, text, fileTime) {
|
|
|
68
67
|
const ref = { agent: "pi", home, id };
|
|
69
68
|
const startedAt = toIsoUtc(parsed.header?.timestamp) ?? fileTime;
|
|
70
69
|
const resolved = resolveActiveEntries(parsed.entries);
|
|
70
|
+
const repoPaths = parsed.header !== null && isAbsolute(parsed.header.cwd) ? [parsed.header.cwd] : [];
|
|
71
71
|
if (!parsed.header || parsed.truncated || resolved.unreadable !== null) {
|
|
72
72
|
return {
|
|
73
73
|
ref,
|
|
@@ -75,7 +75,9 @@ function describe(home, filePath, text, fileTime) {
|
|
|
75
75
|
startedAt,
|
|
76
76
|
updatedAt: lastTimestamp(resolved.activePath) ?? fileTime,
|
|
77
77
|
turnCount: 0,
|
|
78
|
-
repoPath: null,
|
|
78
|
+
repoPath: repoPaths[0] ?? null,
|
|
79
|
+
repoPaths,
|
|
80
|
+
startDirectory: repoPaths[0] ?? null,
|
|
79
81
|
filePath,
|
|
80
82
|
};
|
|
81
83
|
}
|
|
@@ -87,7 +89,9 @@ function describe(home, filePath, text, fileTime) {
|
|
|
87
89
|
startedAt,
|
|
88
90
|
updatedAt: lastTimestamp(resolved.activePath) ?? startedAt,
|
|
89
91
|
turnCount: loaded.turns.length,
|
|
90
|
-
repoPath:
|
|
92
|
+
repoPath: repoPaths[0] ?? null,
|
|
93
|
+
repoPaths,
|
|
94
|
+
startDirectory: repoPaths[0] ?? null,
|
|
91
95
|
filePath,
|
|
92
96
|
};
|
|
93
97
|
}
|
|
@@ -163,8 +167,8 @@ export function createPiAdapter(overrides = {}) {
|
|
|
163
167
|
turns: loaded.turns,
|
|
164
168
|
};
|
|
165
169
|
},
|
|
166
|
-
serialize(session, target, marker) {
|
|
167
|
-
return serializeSession(session, target, marker, deps);
|
|
170
|
+
serialize(session, target, marker, context) {
|
|
171
|
+
return serializeSession(session, target, marker, context, deps);
|
|
168
172
|
},
|
|
169
173
|
validate(serialized) {
|
|
170
174
|
return validateSerialized(serialized);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AdapterRole, AgentAdapter, AgentCapabilities, AgentRuntime, Bytes, LandingLevel, PendingFile, ProvenanceSupport, SelectionLevel, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect } from "../contract.js";
|
|
2
|
-
export type { AdapterRole, AgentAdapter, AgentCapabilities, AgentRuntime, Bytes, LandingLevel, PendingFile, ProvenanceSupport, SelectionLevel, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect, };
|
|
1
|
+
import type { AdapterRole, AgentAdapter, AgentCapabilities, AgentRuntime, Bytes, LandingLevel, PendingFile, ProvenanceSupport, SelectionLevel, SerializationContext, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect } from "../contract.js";
|
|
2
|
+
export type { AdapterRole, AgentAdapter, AgentCapabilities, AgentRuntime, Bytes, LandingLevel, PendingFile, ProvenanceSupport, SelectionLevel, SerializationContext, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect, };
|
|
3
3
|
import type { AgentId, CanonicalSession, CanonicalTurn, HomePath, ProvenanceMarker, RepoSnapshot, SessionDescriptor, SessionId, SessionRef, SourceProvenance, TargetProfile, ToolCallRecord, ToolEffect, TurnKind, TurnRole } from "../../session/contract.js";
|
|
4
4
|
export type { AgentId, CanonicalSession, CanonicalTurn, HomePath, ProvenanceMarker, RepoSnapshot, SessionDescriptor, SessionId, SessionRef, SourceProvenance, TargetProfile, ToolCallRecord, ToolEffect, TurnKind, TurnRole, };
|
|
5
5
|
/** The options Pi's switchSession takes (C-10). */
|
|
@@ -40,8 +40,14 @@ const USER_CREDENTIAL_PATTERN = /(^|[\s;&|])(-u|--user)(=|\s+)("[^"\r\n]*"|'[^'\
|
|
|
40
40
|
const URI_USERINFO_PATTERN = /\b([a-z][a-z0-9+.-]*:\/\/)([^\s/:@]+):([^\s/@]+)@/gi;
|
|
41
41
|
// Unquoted value requires a structural delimiter or line/string end following it, OR a digit
|
|
42
42
|
// somewhere in the token (C-RED-1: "token: expired" is plain English and stays, while
|
|
43
|
-
// "password: hunter2 # prod" carries a credential that must not cross even mid-line).
|
|
44
|
-
|
|
43
|
+
// "password: hunter2 # prod" carries a credential that must not cross even mid-line). The value is
|
|
44
|
+
// taken whole, however long it is, so a credential can never be left half-redacted (FR-28).
|
|
45
|
+
// A quoted key is matched whole and an unquoted one up to 64 characters: an unbounded identifier run
|
|
46
|
+
// makes the engine backtrack over the whole run at every start position, which is quadratic on a
|
|
47
|
+
// long unbroken line (measured: 50 KB of one word took 11.8 s and 100 KB never finished). A longer
|
|
48
|
+
// unquoted run still matches through its last 64 characters, and `isSensitiveKey` decides by the
|
|
49
|
+
// name's tail as well as by its whole text, so nothing the unbounded name found is hidden.
|
|
50
|
+
const JSON_LIKE_PATTERN = /(?:(?<quote>["'])(?<quoted>[A-Za-z_][A-Za-z0-9_-]*)\k<quote>|(?<bare>[A-Za-z_][A-Za-z0-9_-]{0,63}))(\s*:\s*)("[^"\r\n]*"|'[^'\r\n]*'|[^\s,;}]+(?=[,;}]|[\r\n]|$)|[^\s,;}]*\d[^\s,;}]*)/g;
|
|
45
51
|
function normalizedKey(key) {
|
|
46
52
|
return key.toLowerCase().replaceAll(/[^a-z0-9]/g, "");
|
|
47
53
|
}
|
|
@@ -118,7 +124,14 @@ export function redactSensitiveText(text) {
|
|
|
118
124
|
.replace(USER_CREDENTIAL_PATTERN, `$1$2$3${REDACTED_VALUE}`)
|
|
119
125
|
.replace(URI_USERINFO_PATTERN, `$1$2:${REDACTED_VALUE}@`)
|
|
120
126
|
.replace(ASSIGNMENT_PATTERN, (match, key, separator) => isSensitiveKey(key) ? `${key}${separator}${REDACTED_VALUE}` : match)
|
|
121
|
-
.replace(JSON_LIKE_PATTERN, (match, quote,
|
|
127
|
+
.replace(JSON_LIKE_PATTERN, (match, quote, quoted, bare, separator) => {
|
|
128
|
+
const key = quoted ?? bare;
|
|
129
|
+
if (key === undefined || !isSensitiveKey(key))
|
|
130
|
+
return match;
|
|
131
|
+
// Only the value is replaced; the quoting and the separator stay as they were recorded.
|
|
132
|
+
const name = quote === undefined ? key : `${quote}${key}${quote}`;
|
|
133
|
+
return `${name}${separator}${REDACTED_VALUE}`;
|
|
134
|
+
})
|
|
122
135
|
.replace(CREDENTIAL_PATTERN, REDACTED_VALUE);
|
|
123
136
|
}
|
|
124
137
|
/** Redact a source-recorded argument string, preserving valid JSON when it is JSON. */
|
package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/serialize.d.ts
RENAMED
|
@@ -11,12 +11,10 @@
|
|
|
11
11
|
* An imported tool call is therefore one assistant text entry carrying its outcome line,
|
|
12
12
|
* which also gives T-PI-4 its "one message entry per canonical turn".
|
|
13
13
|
*/
|
|
14
|
-
import type { CanonicalSession, ProvenanceMarker, SerializedSession, TargetProfile } from "./contract.js";
|
|
14
|
+
import type { CanonicalSession, ProvenanceMarker, SerializationContext, SerializedSession, TargetProfile } from "./contract.js";
|
|
15
15
|
export interface PiSerializeDeps {
|
|
16
|
-
/** The repository the new session belongs to. Pi buckets its sessions by it. */
|
|
17
|
-
cwd(): string;
|
|
18
16
|
now(): Date;
|
|
19
17
|
newSessionId(): string;
|
|
20
18
|
newEntryId(): string;
|
|
21
19
|
}
|
|
22
|
-
export declare function serializeSession(session: CanonicalSession, target: TargetProfile, marker: ProvenanceMarker, deps: PiSerializeDeps): SerializedSession;
|
|
20
|
+
export declare function serializeSession(session: CanonicalSession, target: TargetProfile, marker: ProvenanceMarker, context: SerializationContext, deps: PiSerializeDeps): SerializedSession;
|
|
@@ -19,8 +19,8 @@ function turnText(turn) {
|
|
|
19
19
|
const text = turn.kind === "tool-call" ? (turn.toolCall?.outcomeLine ?? "") : turn.text;
|
|
20
20
|
return text.trim().length > 0 ? text : EMPTY_TURN_TEXT;
|
|
21
21
|
}
|
|
22
|
-
export function serializeSession(session, target, marker, deps) {
|
|
23
|
-
const cwd =
|
|
22
|
+
export function serializeSession(session, target, marker, context, deps) {
|
|
23
|
+
const cwd = context.cwd;
|
|
24
24
|
const sessionId = deps.newSessionId();
|
|
25
25
|
const createdAt = deps.now().toISOString();
|
|
26
26
|
const fallbackTime = toIsoUtc(session.provenance.updatedAt) ?? createdAt;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LandingResult, Listing } from "./contract.js";
|
|
2
|
-
export declare function renderListing(listing: Listing,
|
|
2
|
+
export declare function renderListing(listing: Listing, destinationCwd: string): string[];
|
|
3
3
|
export declare function renderLanding(result: LandingResult): string[];
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// Nothing here decides anything: it prints what the pipeline returned.
|
|
3
3
|
import { safeText } from "./presentation.js";
|
|
4
4
|
const COLUMN_GAP = " ";
|
|
5
|
-
export function renderListing(listing,
|
|
5
|
+
export function renderListing(listing, destinationCwd) {
|
|
6
6
|
const lines = listing.rows.length === 0
|
|
7
|
-
? [`No session of ${safeText(
|
|
7
|
+
? [`No session of ${safeText(destinationCwd)} was found.`]
|
|
8
8
|
: renderRows(listing.rows);
|
|
9
|
-
//
|
|
9
|
+
// Skipped homes and sessions are printed, never hidden.
|
|
10
10
|
if (listing.failures.length > 0) {
|
|
11
11
|
const count = listing.failures.length;
|
|
12
|
-
lines.push("", `${count}
|
|
12
|
+
lines.push("", `${count} ${count === 1 ? "entry" : "entries"} skipped:`);
|
|
13
13
|
for (const failure of listing.failures) {
|
|
14
14
|
lines.push(` ${safeText(failure.agent)}${COLUMN_GAP}${safeText(failure.home)}${COLUMN_GAP}${safeText(failure.message)}`);
|
|
15
15
|
}
|
|
@@ -35,7 +35,7 @@ async function run(invocation, pipeline, fallback) {
|
|
|
35
35
|
};
|
|
36
36
|
if (selection === null) {
|
|
37
37
|
const request = {
|
|
38
|
-
|
|
38
|
+
destinationCwd: invocation.cwd,
|
|
39
39
|
target,
|
|
40
40
|
onlyAgent,
|
|
41
41
|
onlyHome,
|
|
@@ -53,7 +53,7 @@ async function run(invocation, pipeline, fallback) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
const request = {
|
|
56
|
-
|
|
56
|
+
destinationCwd: invocation.cwd,
|
|
57
57
|
target,
|
|
58
58
|
selection,
|
|
59
59
|
onlyAgent,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AdapterRole, AgentAdapter, AgentCapabilities, LandingLevel, ProvenanceSupport, SelectionLevel, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect } from "../adapters/contract.js";
|
|
2
|
-
export type { AdapterRole, AgentAdapter, AgentCapabilities, LandingLevel, ProvenanceSupport, SelectionLevel, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect, };
|
|
1
|
+
import type { AdapterRole, AgentAdapter, AgentCapabilities, LandingLevel, ProvenanceSupport, SelectionLevel, SerializationContext, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect } from "../adapters/contract.js";
|
|
2
|
+
export type { AdapterRole, AgentAdapter, AgentCapabilities, LandingLevel, ProvenanceSupport, SelectionLevel, SerializationContext, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect, };
|
|
3
3
|
import type { CliExit, CliInvocation, CliOutcome, CliRunner } from "./cli/contract.js";
|
|
4
4
|
export type { CliExit, CliInvocation, CliOutcome, CliRunner };
|
|
5
5
|
import type { PiCommandContext, PiResumeFromCommand, PiSwitchContext, PiSwitchOptions, PiSwitchResult } from "./pi-extension/contract.js";
|
package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/command.js
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { safeText } from "./presentation.js";
|
|
1
2
|
/** The name Pi shows for the command (FR-7). */
|
|
2
3
|
export const RESUME_FROM_COMMAND_NAME = "resume-from";
|
|
3
4
|
const CONFIRM_QUESTION = "Import this session? (y/N)";
|
|
@@ -20,7 +21,7 @@ export function createResumeFromCommand(deps) {
|
|
|
20
21
|
}
|
|
21
22
|
async function runResumeFrom(deps, ctx, args, pipeline) {
|
|
22
23
|
const scope = {
|
|
23
|
-
|
|
24
|
+
destinationCwd: ctx.cwd,
|
|
24
25
|
target: targetOf(deps, ctx),
|
|
25
26
|
onlyAgent: null,
|
|
26
27
|
onlyHome: null,
|
|
@@ -29,7 +30,9 @@ async function runResumeFrom(deps, ctx, args, pipeline) {
|
|
|
29
30
|
if (selection === null)
|
|
30
31
|
return;
|
|
31
32
|
const request = { ...scope, selection };
|
|
32
|
-
const report = await pipeline.preview(request);
|
|
33
|
+
const report = await withDiagnostic(deps.ui, "preview", () => pipeline.preview(request));
|
|
34
|
+
if (report === null)
|
|
35
|
+
return;
|
|
33
36
|
deps.ui.show(report.lines); // Verbatim and unreordered (FR-21).
|
|
34
37
|
if (report.blocked) {
|
|
35
38
|
deps.ui.show([report.blockedReason ?? BLOCKED_FALLBACK]);
|
|
@@ -40,10 +43,28 @@ async function runResumeFrom(deps, ctx, args, pipeline) {
|
|
|
40
43
|
return; // Nothing is written before the user confirms (FR-16, FR-20).
|
|
41
44
|
}
|
|
42
45
|
// Pi's own context is the runtime handle the Pi adapter switches with (FR-44).
|
|
43
|
-
const landing = await pipeline.commit(request, ctx, report.confirmationToken);
|
|
44
|
-
if (!landing.switched)
|
|
46
|
+
const landing = await withDiagnostic(deps.ui, "import", () => pipeline.commit(request, ctx, report.confirmationToken));
|
|
47
|
+
if (landing !== null && !landing.switched)
|
|
45
48
|
present(deps.ui, landing);
|
|
46
49
|
}
|
|
50
|
+
/** Catch only pipeline failures, not UI errors or presentation after a successful switch. */
|
|
51
|
+
async function withDiagnostic(ui, stage, operation) {
|
|
52
|
+
try {
|
|
53
|
+
return await operation();
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
// Pipeline errors may wrap an abort; preserve cancellation rather than relabel it.
|
|
57
|
+
const seen = new Set();
|
|
58
|
+
for (let cause = error; cause instanceof Error && !seen.has(cause); cause = cause.cause) {
|
|
59
|
+
if (cause.name === "AbortError")
|
|
60
|
+
throw error;
|
|
61
|
+
seen.add(cause);
|
|
62
|
+
}
|
|
63
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
64
|
+
ui.show([`The ${stage} failed: ${safeText(message)}`]);
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
47
68
|
/** The import target is always the Pi home the user is in (FR-1, FR-2). */
|
|
48
69
|
function targetOf(deps, ctx) {
|
|
49
70
|
return { agent: "pi", home: ctx.home, windowTokens: deps.windowTokens };
|
|
@@ -62,12 +83,14 @@ async function resolveSelection(deps, args, pipeline, scope) {
|
|
|
62
83
|
const [only] = given;
|
|
63
84
|
if (only !== undefined)
|
|
64
85
|
return parseArgument(only); // An argument skips the picker (FR-12).
|
|
65
|
-
const listing = await pipeline.list(scope);
|
|
86
|
+
const listing = await withDiagnostic(deps.ui, "listing", () => pipeline.list(scope));
|
|
87
|
+
if (listing === null)
|
|
88
|
+
return null;
|
|
66
89
|
if (listing.failures.length > 0) {
|
|
67
|
-
deps.ui.show(listing.failures.map(formatFailure)); //
|
|
90
|
+
deps.ui.show(listing.failures.map(formatFailure)); // Home and session failures are never silent.
|
|
68
91
|
}
|
|
69
92
|
if (listing.rows.length === 0) {
|
|
70
|
-
deps.ui.show([`No sessions to import for ${scope.
|
|
93
|
+
deps.ui.show([`No sessions to import for ${scope.destinationCwd}.`]);
|
|
71
94
|
return null; // A picker over nothing is a trap.
|
|
72
95
|
}
|
|
73
96
|
const picked = await deps.picker.pick(listing);
|
|
@@ -86,7 +109,7 @@ function parseArgument(argument) {
|
|
|
86
109
|
: { by: "session-id", id: argument };
|
|
87
110
|
}
|
|
88
111
|
function formatFailure(failure) {
|
|
89
|
-
return
|
|
112
|
+
return `${failure.agent} ${failure.home}: ${failure.message}`;
|
|
90
113
|
}
|
|
91
114
|
/**
|
|
92
115
|
* Shows the marker and handover when the switch did not happen (FR-45, FR-47).
|
|
@@ -22,7 +22,7 @@ export interface HostDeps {
|
|
|
22
22
|
createEstimators?: () => EstimatorFactory;
|
|
23
23
|
createRepo?: () => RepoReader;
|
|
24
24
|
createCommitter?: () => FileCommitter;
|
|
25
|
-
/**
|
|
25
|
+
/** Host invocation directory. Each pipeline request independently supplies its destination. */
|
|
26
26
|
cwd?: string;
|
|
27
27
|
/** The import time written into the marker (FR-47). Injected so a preview and a commit agree. */
|
|
28
28
|
now?: () => string;
|
|
@@ -26,9 +26,8 @@ export async function createHost(deps = {}) {
|
|
|
26
26
|
// Step 1. It rejects before anything else exists, which is what FR-56 asks for.
|
|
27
27
|
const config = await (deps.configLoader ?? createConfigLoader()).load();
|
|
28
28
|
// Step 2.
|
|
29
|
-
const cwd = deps.cwd ?? process.cwd();
|
|
30
29
|
const estimators = (deps.createEstimators ?? (() => estimatorFactory))();
|
|
31
|
-
const repo = (deps.createRepo ??
|
|
30
|
+
const repo = (deps.createRepo ?? createRepoReader)();
|
|
32
31
|
const committer = (deps.createCommitter ?? createFileCommitter)();
|
|
33
32
|
// Step 3. The list is the only place that knows which implementations exist. Each adapter
|
|
34
33
|
// names itself, so the family is keyed by what it declares and never by what the list assumed.
|
|
@@ -2,5 +2,8 @@ import type { SessionDescriptor } from "../session/contract.js";
|
|
|
2
2
|
import type { PreviewContent } from "./preview/contract.js";
|
|
3
3
|
import type { TransferPlan } from "./transfer/contract.js";
|
|
4
4
|
/** Binds confirmation to every input that can affect the imported session or its preview. */
|
|
5
|
-
export declare function confirmationToken(descriptor: SessionDescriptor, plan: TransferPlan, report: PreviewContent
|
|
5
|
+
export declare function confirmationToken(descriptor: SessionDescriptor, plan: TransferPlan, report: PreviewContent, destination: {
|
|
6
|
+
canonicalCwd: string;
|
|
7
|
+
commonDir: string | null;
|
|
8
|
+
}): string;
|
|
6
9
|
export declare function confirmationMatches(expected: string, supplied: string): boolean;
|
|
@@ -2,8 +2,8 @@ import { createHash, timingSafeEqual } from "node:crypto";
|
|
|
2
2
|
const TOKEN_PREFIX = "v1-sha256-";
|
|
3
3
|
const TOKEN_PATTERN = /^v1-sha256-[0-9a-f]{64}$/;
|
|
4
4
|
/** Binds confirmation to every input that can affect the imported session or its preview. */
|
|
5
|
-
export function confirmationToken(descriptor, plan, report) {
|
|
6
|
-
const payload = stableJson({ descriptor, plan, report });
|
|
5
|
+
export function confirmationToken(descriptor, plan, report, destination) {
|
|
6
|
+
const payload = stableJson({ descriptor, plan, report, destination });
|
|
7
7
|
return `${TOKEN_PREFIX}${createHash("sha256").update(payload).digest("hex")}`;
|
|
8
8
|
}
|
|
9
9
|
export function confirmationMatches(expected, supplied) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AdapterRole, AgentAdapter, AgentCapabilities, AgentRuntime, LandingLevel, ProvenanceSupport, SelectionLevel, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect } from "../adapters/contract.js";
|
|
2
|
-
export type { AdapterRole, AgentAdapter, AgentCapabilities, AgentRuntime, LandingLevel, ProvenanceSupport, SelectionLevel, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect, };
|
|
3
|
-
import type { HomeFailure, Listing, SearchScope, SelectionError, SelectionInput, SessionFinder } from "./discovery/contract.js";
|
|
4
|
-
export type { HomeFailure, Listing, SearchScope, SelectionError, SelectionInput, SessionFinder };
|
|
1
|
+
import type { AdapterRole, AgentAdapter, AgentCapabilities, AgentRuntime, LandingLevel, ProvenanceSupport, SelectionLevel, SerializationContext, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect } from "../adapters/contract.js";
|
|
2
|
+
export type { AdapterRole, AgentAdapter, AgentCapabilities, AgentRuntime, LandingLevel, ProvenanceSupport, SelectionLevel, SerializationContext, SerializedSession, StoredSessionFacts, SwitchOutcome, ValidationDefect, };
|
|
3
|
+
import type { DiscoveryDestination, HomeFailure, Listing, SearchScope, SelectionError, SelectionInput, SessionFinder } from "./discovery/contract.js";
|
|
4
|
+
export type { DiscoveryDestination, HomeFailure, Listing, SearchScope, SelectionError, SelectionInput, SessionFinder, };
|
|
5
5
|
import type { HandoverInstruction, LandingError, LandingResult, LandingStage, SessionLander } from "./landing/contract.js";
|
|
6
6
|
export type { HandoverInstruction, LandingError, LandingResult, LandingStage, SessionLander };
|
|
7
7
|
import type { PreviewBuilder, PreviewContent, PreviewReport, PreviewWarning, WarningKind } from "./preview/contract.js";
|
|
@@ -18,14 +18,16 @@ import type { AgentId, CanonicalSession, CanonicalTurn, HomePath, ProvenanceMark
|
|
|
18
18
|
export type { AgentId, CanonicalSession, CanonicalTurn, HomePath, ProvenanceMarker, RepoSnapshot, SessionDescriptor, SessionId, SessionRef, SourceProvenance, TargetProfile, ToolCallRecord, ToolEffect, TurnKind, TurnRole, };
|
|
19
19
|
/** What to list (FR-10, FR-15). */
|
|
20
20
|
export interface ListRequest {
|
|
21
|
-
|
|
21
|
+
/** Host-supplied absolute working directory; preserve native subdirectory and symlink spelling. */
|
|
22
|
+
destinationCwd: string;
|
|
22
23
|
target: TargetProfile;
|
|
23
24
|
onlyAgent: AgentId | null;
|
|
24
25
|
onlyHome: HomePath | null;
|
|
25
26
|
}
|
|
26
27
|
/** What to preview, and later what to commit (FR-16, FR-20). */
|
|
27
28
|
export interface ImportRequest {
|
|
28
|
-
|
|
29
|
+
/** Host-supplied absolute working directory; preserve native subdirectory and symlink spelling. */
|
|
30
|
+
destinationCwd: string;
|
|
29
31
|
target: TargetProfile;
|
|
30
32
|
selection: SelectionInput;
|
|
31
33
|
onlyAgent: AgentId | null;
|