@herbertgao/pi-extensions 2026.8.1 → 2026.8.3
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 -3
- package/node_modules/@czottmann/pi-automode/README.md +16 -2
- package/node_modules/@czottmann/pi-automode/docs/GLOSSARY.md +35 -0
- package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +18 -9
- package/node_modules/@czottmann/pi-automode/docs/defaults.md +6 -2
- package/node_modules/@czottmann/pi-automode/examples/automode.local.json +6 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +11 -7
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/config.ts +100 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +32 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +78 -3
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/hard-deny.ts +16 -4
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/paths.ts +23 -1
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/permissions.ts +22 -1
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/types.ts +18 -2
- package/node_modules/@czottmann/pi-automode/package.json +4 -4
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-audit.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-debt.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-gain.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-help.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-review.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail.md +5 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/plugins/ponytail-frontmatter.cjs +23 -0
- package/node_modules/@dietrichgebert/ponytail/.opencode/plugins/ponytail.mjs +99 -0
- package/node_modules/@dietrichgebert/ponytail/.qoder/rules/ponytail.md +30 -0
- package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +16 -0
- package/node_modules/@dietrichgebert/ponytail/AGENTS.md +32 -0
- package/node_modules/@dietrichgebert/ponytail/LICENSE +21 -0
- package/node_modules/@dietrichgebert/ponytail/README.es.md +298 -0
- package/node_modules/@dietrichgebert/ponytail/README.ko.md +315 -0
- package/node_modules/@dietrichgebert/ponytail/README.md +351 -0
- package/node_modules/@dietrichgebert/ponytail/assets/benchmark-3model.svg +21 -0
- package/node_modules/@dietrichgebert/ponytail/assets/benchmark-agentic.svg +62 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo-dark.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo-dark.svg +115 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo-greenpt-dark.svg +27 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo-greenpt.svg +27 -0
- package/node_modules/@dietrichgebert/ponytail/assets/logo.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/social-preview.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/waitlist-banner-es.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/waitlist-banner-ko.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/assets/waitlist-banner.png +0 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/claude-codex-hooks.json +44 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/copilot-hooks.json +21 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-activate.js +96 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-config.js +169 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-instructions.js +98 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-mode-tracker.js +130 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-runtime.js +85 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-statusline.ps1 +24 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-statusline.sh +18 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-subagent.js +77 -0
- package/node_modules/@dietrichgebert/ponytail/hooks/qoder-hooks.json +26 -0
- package/node_modules/@dietrichgebert/ponytail/package.json +47 -0
- package/node_modules/@dietrichgebert/ponytail/pi-extension/index.js +211 -0
- package/node_modules/@dietrichgebert/ponytail/pi-extension/package.json +8 -0
- package/node_modules/@dietrichgebert/ponytail/scripts/uninstall.js +60 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail/SKILL.md +120 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-audit/SKILL.md +41 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-debt/SKILL.md +44 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-gain/SKILL.md +50 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-help/SKILL.md +71 -0
- package/node_modules/@dietrichgebert/ponytail/skills/ponytail-review/SKILL.md +57 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +6 -10
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +5 -9
- package/node_modules/@herbertgao/pi-cc-extensions/assets/readme/hero.en.svg +101 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -17
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +15 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/{utils/agent-summary.ts → feature/agent-summary/core.ts} +37 -35
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{agent-summary.ts → agent-summary/index.ts} +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +24 -83
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{session-reference.ts → reference/index.ts} +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{agent-autocomplete.ts → reference/subagent.ts} +19 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{pi-startup-header.ts → shell/startup-header.ts} +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{working-message.ts → shell/working-message.ts} +5 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/index.ts +32 -28
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +452 -94
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +727 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +66 -776
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/{feature → renderer}/markdown-enhance.ts +134 -11
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/hover.ts +130 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{mouse-interaction.ts → mouse/interaction.ts} +90 -568
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/layout.ts +144 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/packets.ts +143 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +195 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/ansi-utils.ts +56 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/diff-renderer.ts +4 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/line-width-safety.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/write-display-utils.ts +12 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/write-execution.ts +1 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-grouping.ts → tool/grouping.ts} +27 -10
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-result.ts → tool/result.ts} +4 -13
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/transcript-refresh.ts +91 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/fullscreen-detect.ts +0 -27
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark.json +1 -0
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-light.json +2 -2
- package/node_modules/@herbertgao/pi-stash/README.md +9 -9
- package/node_modules/@herbertgao/pi-stash/package.json +1 -1
- package/node_modules/@herbertgao/pi-stash/src/index.ts +2 -1
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +20 -0
- package/node_modules/@herbertgao/pi-subagents/README.md +6 -2
- package/node_modules/@herbertgao/pi-subagents/package.json +3 -3
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +1 -0
- package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +3 -1
- package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +85 -11
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +61 -39
- package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +26 -35
- package/node_modules/@herbertgao/pi-subagents/src/prompts.ts +15 -1
- package/node_modules/@herbertgao/pi-subagents/src/settings.ts +12 -0
- package/node_modules/@herbertgao/pi-subagents/src/types.ts +2 -0
- package/node_modules/@narumitw/pi-btw/LICENSE +21 -0
- package/node_modules/@narumitw/pi-btw/README.md +210 -0
- package/node_modules/@narumitw/pi-btw/package.json +53 -0
- package/node_modules/@narumitw/pi-btw/src/bring-to-main.ts +632 -0
- package/node_modules/@narumitw/pi-btw/src/btw.ts +996 -0
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +339 -0
- package/node_modules/@narumitw/pi-btw/src/index.ts +1 -0
- package/node_modules/@narumitw/pi-btw/src/menu.ts +296 -0
- package/node_modules/@narumitw/pi-btw/src/settings.ts +237 -0
- package/node_modules/@narumitw/pi-btw/src/side-thread.ts +238 -0
- package/node_modules/@narumitw/pi-btw/src/text.ts +10 -0
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +620 -0
- package/node_modules/@pi-plugins/fast-mode/LICENSE +21 -0
- package/node_modules/@pi-plugins/fast-mode/README.md +92 -0
- package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts +6 -0
- package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -0
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +2026 -0
- package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -0
- package/node_modules/@pi-plugins/fast-mode/package.json +73 -0
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +78 -0
- package/node_modules/pi-mcp-adapter/README.md +80 -16
- package/node_modules/pi-mcp-adapter/agent-dir.ts +40 -0
- package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +377 -0
- package/node_modules/pi-mcp-adapter/commands.ts +21 -9
- package/node_modules/pi-mcp-adapter/config.ts +110 -49
- package/node_modules/pi-mcp-adapter/direct-tools.ts +40 -27
- package/node_modules/pi-mcp-adapter/elicitation-handler.ts +37 -36
- package/node_modules/pi-mcp-adapter/errors.ts +21 -17
- package/node_modules/pi-mcp-adapter/host-html-template.ts +13 -7
- package/node_modules/pi-mcp-adapter/index.ts +52 -17
- package/node_modules/pi-mcp-adapter/init.ts +9 -7
- package/node_modules/pi-mcp-adapter/json-schema-validator.ts +2 -2
- package/node_modules/pi-mcp-adapter/lifecycle.ts +8 -8
- package/node_modules/pi-mcp-adapter/logger.ts +1 -1
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +122 -25
- package/node_modules/pi-mcp-adapter/mcp-auth.ts +120 -2
- package/node_modules/pi-mcp-adapter/mcp-callback-server.ts +138 -61
- package/node_modules/pi-mcp-adapter/mcp-code.ts +13 -11
- package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +62 -17
- package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +15 -11
- package/node_modules/pi-mcp-adapter/mcp-panel.ts +34 -15
- package/node_modules/pi-mcp-adapter/mcp-probe.ts +131 -34
- package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +2 -2
- package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +7 -4
- package/node_modules/pi-mcp-adapter/mcp-trace.ts +59 -64
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +34 -26
- package/node_modules/pi-mcp-adapter/npx-resolver.ts +6 -4
- package/node_modules/pi-mcp-adapter/oauth-handler.ts +1 -1
- package/node_modules/pi-mcp-adapter/oauth.ts +48 -0
- package/node_modules/pi-mcp-adapter/onboarding-state.ts +19 -11
- package/node_modules/pi-mcp-adapter/package.json +20 -9
- package/node_modules/pi-mcp-adapter/panel-keys.ts +20 -4
- package/node_modules/pi-mcp-adapter/prompts.ts +2 -2
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +56 -21
- package/node_modules/pi-mcp-adapter/sampling-handler.ts +22 -15
- package/node_modules/pi-mcp-adapter/search-ranking.ts +2 -1
- package/node_modules/pi-mcp-adapter/server-manager.ts +165 -113
- package/node_modules/pi-mcp-adapter/session-recovery.ts +11 -12
- package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +3 -3
- package/node_modules/pi-mcp-adapter/state.ts +3 -1
- package/node_modules/pi-mcp-adapter/tool-approval.ts +67 -4
- package/node_modules/pi-mcp-adapter/tool-metadata.ts +6 -5
- package/node_modules/pi-mcp-adapter/tool-registrar.ts +187 -3
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +14 -2
- package/node_modules/pi-mcp-adapter/ts-shape.ts +9 -2
- package/node_modules/pi-mcp-adapter/types.ts +111 -22
- package/node_modules/pi-mcp-adapter/ui-app-bridge-helpers.ts +40 -0
- package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +28 -19
- package/node_modules/pi-mcp-adapter/ui-server.ts +90 -58
- package/node_modules/pi-mcp-adapter/ui-session.ts +16 -14
- package/node_modules/pi-mcp-adapter/unix-socket-transport.ts +4 -4
- package/node_modules/pi-mcp-adapter/utils.ts +23 -9
- package/node_modules/pi-web-access/CHANGELOG.md +45 -0
- package/node_modules/pi-web-access/README.md +104 -29
- package/node_modules/pi-web-access/bocha.ts +221 -0
- package/node_modules/pi-web-access/curator-page.ts +113 -12
- package/node_modules/pi-web-access/curator-server.ts +56 -20
- package/node_modules/pi-web-access/datalab-pdf-extract.ts +568 -0
- package/node_modules/pi-web-access/duckduckgo.ts +123 -0
- package/node_modules/pi-web-access/extract.ts +288 -143
- package/node_modules/pi-web-access/feature-config.ts +29 -0
- package/node_modules/pi-web-access/gemini-api.ts +4 -0
- package/node_modules/pi-web-access/gemini-search.ts +45 -12
- package/node_modules/pi-web-access/gemini-web.ts +68 -3
- package/node_modules/pi-web-access/index.ts +160 -71
- package/node_modules/pi-web-access/jina-search.ts +284 -0
- package/node_modules/pi-web-access/kagi.ts +12 -12
- package/node_modules/pi-web-access/openai-search.ts +12 -2
- package/node_modules/pi-web-access/package.json +4 -3
- package/node_modules/pi-web-access/pdf-extract.ts +327 -228
- package/node_modules/pi-web-access/storage.ts +440 -2
- package/node_modules/pi-web-access/summary-model-scope.ts +1 -1
- package/node_modules/pi-web-access/summary-review.ts +4 -2
- package/node_modules/pi-web-access/video-extract.ts +10 -8
- package/node_modules/pi-web-access/xai-search.ts +12 -2
- package/node_modules/pi-web-access/youtube-extract.ts +2 -1
- package/node_modules/remote-pi/LICENSE +21 -0
- package/node_modules/remote-pi/README.md +675 -0
- package/node_modules/remote-pi/dist/actions/handlers.d.ts +122 -0
- package/node_modules/remote-pi/dist/actions/handlers.js +160 -0
- package/node_modules/remote-pi/dist/actions/handlers.js.map +1 -0
- package/node_modules/remote-pi/dist/actions/registry.d.ts +39 -0
- package/node_modules/remote-pi/dist/actions/registry.js +58 -0
- package/node_modules/remote-pi/dist/actions/registry.js.map +1 -0
- package/node_modules/remote-pi/dist/bin/supervisord.d.ts +2 -0
- package/node_modules/remote-pi/dist/bin/supervisord.js +86 -0
- package/node_modules/remote-pi/dist/bin/supervisord.js.map +1 -0
- package/node_modules/remote-pi/dist/commands/builtin_mirror.d.ts +58 -0
- package/node_modules/remote-pi/dist/commands/builtin_mirror.js +71 -0
- package/node_modules/remote-pi/dist/commands/builtin_mirror.js.map +1 -0
- package/node_modules/remote-pi/dist/commands/list_commands.d.ts +60 -0
- package/node_modules/remote-pi/dist/commands/list_commands.js +73 -0
- package/node_modules/remote-pi/dist/commands/list_commands.js.map +1 -0
- package/node_modules/remote-pi/dist/config.d.ts +62 -0
- package/node_modules/remote-pi/dist/config.js +115 -0
- package/node_modules/remote-pi/dist/config.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/client.d.ts +20 -0
- package/node_modules/remote-pi/dist/daemon/client.js +131 -0
- package/node_modules/remote-pi/dist/daemon/client.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/control_protocol.d.ts +176 -0
- package/node_modules/remote-pi/dist/daemon/control_protocol.js +63 -0
- package/node_modules/remote-pi/dist/daemon/control_protocol.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/cron_log.d.ts +45 -0
- package/node_modules/remote-pi/dist/daemon/cron_log.js +72 -0
- package/node_modules/remote-pi/dist/daemon/cron_log.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/cron_registry.d.ts +80 -0
- package/node_modules/remote-pi/dist/daemon/cron_registry.js +194 -0
- package/node_modules/remote-pi/dist/daemon/cron_registry.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/id.d.ts +24 -0
- package/node_modules/remote-pi/dist/daemon/id.js +36 -0
- package/node_modules/remote-pi/dist/daemon/id.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/install.d.ts +170 -0
- package/node_modules/remote-pi/dist/daemon/install.js +547 -0
- package/node_modules/remote-pi/dist/daemon/install.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/registry.d.ts +63 -0
- package/node_modules/remote-pi/dist/daemon/registry.js +153 -0
- package/node_modules/remote-pi/dist/daemon/registry.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/rpc_child.d.ts +194 -0
- package/node_modules/remote-pi/dist/daemon/rpc_child.js +389 -0
- package/node_modules/remote-pi/dist/daemon/rpc_child.js.map +1 -0
- package/node_modules/remote-pi/dist/daemon/supervisor.d.ts +93 -0
- package/node_modules/remote-pi/dist/daemon/supervisor.js +596 -0
- package/node_modules/remote-pi/dist/daemon/supervisor.js.map +1 -0
- package/node_modules/remote-pi/dist/extension_ui_bridge.d.ts +26 -0
- package/node_modules/remote-pi/dist/extension_ui_bridge.js +341 -0
- package/node_modules/remote-pi/dist/extension_ui_bridge.js.map +1 -0
- package/node_modules/remote-pi/dist/index.d.ts +213 -0
- package/node_modules/remote-pi/dist/index.js +4996 -0
- package/node_modules/remote-pi/dist/index.js.map +1 -0
- package/node_modules/remote-pi/dist/mcp/mesh_result.d.ts +10 -0
- package/node_modules/remote-pi/dist/mcp/mesh_result.js +42 -0
- package/node_modules/remote-pi/dist/mcp/mesh_result.js.map +1 -0
- package/node_modules/remote-pi/dist/mcp/mesh_server.d.ts +16 -0
- package/node_modules/remote-pi/dist/mcp/mesh_server.js +327 -0
- package/node_modules/remote-pi/dist/mcp/mesh_server.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/canonical.d.ts +30 -0
- package/node_modules/remote-pi/dist/mesh/canonical.js +61 -0
- package/node_modules/remote-pi/dist/mesh/canonical.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/client.d.ts +18 -0
- package/node_modules/remote-pi/dist/mesh/client.js +125 -0
- package/node_modules/remote-pi/dist/mesh/client.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/encoding.d.ts +38 -0
- package/node_modules/remote-pi/dist/mesh/encoding.js +216 -0
- package/node_modules/remote-pi/dist/mesh/encoding.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/self_revoke.d.ts +73 -0
- package/node_modules/remote-pi/dist/mesh/self_revoke.js +401 -0
- package/node_modules/remote-pi/dist/mesh/self_revoke.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/siblings.d.ts +49 -0
- package/node_modules/remote-pi/dist/mesh/siblings.js +159 -0
- package/node_modules/remote-pi/dist/mesh/siblings.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/types.d.ts +34 -0
- package/node_modules/remote-pi/dist/mesh/types.js +11 -0
- package/node_modules/remote-pi/dist/mesh/types.js.map +1 -0
- package/node_modules/remote-pi/dist/mesh/verify.d.ts +17 -0
- package/node_modules/remote-pi/dist/mesh/verify.js +86 -0
- package/node_modules/remote-pi/dist/mesh/verify.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/crypto.d.ts +8 -0
- package/node_modules/remote-pi/dist/pairing/crypto.js +22 -0
- package/node_modules/remote-pi/dist/pairing/crypto.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/handshake.d.ts +28 -0
- package/node_modules/remote-pi/dist/pairing/handshake.js +113 -0
- package/node_modules/remote-pi/dist/pairing/handshake.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/noise-sha256.d.ts +16 -0
- package/node_modules/remote-pi/dist/pairing/noise-sha256.js +103 -0
- package/node_modules/remote-pi/dist/pairing/noise-sha256.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/qr.d.ts +59 -0
- package/node_modules/remote-pi/dist/pairing/qr.js +125 -0
- package/node_modules/remote-pi/dist/pairing/qr.js.map +1 -0
- package/node_modules/remote-pi/dist/pairing/storage.d.ts +120 -0
- package/node_modules/remote-pi/dist/pairing/storage.js +604 -0
- package/node_modules/remote-pi/dist/pairing/storage.js.map +1 -0
- package/node_modules/remote-pi/dist/protocol/codec.d.ts +7 -0
- package/node_modules/remote-pi/dist/protocol/codec.js +49 -0
- package/node_modules/remote-pi/dist/protocol/codec.js.map +1 -0
- package/node_modules/remote-pi/dist/protocol/types.d.ts +393 -0
- package/node_modules/remote-pi/dist/protocol/types.js +2 -0
- package/node_modules/remote-pi/dist/protocol/types.js.map +1 -0
- package/node_modules/remote-pi/dist/rooms.d.ts +29 -0
- package/node_modules/remote-pi/dist/rooms.js +57 -0
- package/node_modules/remote-pi/dist/rooms.js.map +1 -0
- package/node_modules/remote-pi/dist/session/address.d.ts +49 -0
- package/node_modules/remote-pi/dist/session/address.js +58 -0
- package/node_modules/remote-pi/dist/session/address.js.map +1 -0
- package/node_modules/remote-pi/dist/session/agent_bridge.d.ts +55 -0
- package/node_modules/remote-pi/dist/session/agent_bridge.js +146 -0
- package/node_modules/remote-pi/dist/session/agent_bridge.js.map +1 -0
- package/node_modules/remote-pi/dist/session/bridge.d.ts +37 -0
- package/node_modules/remote-pi/dist/session/bridge.js +130 -0
- package/node_modules/remote-pi/dist/session/bridge.js.map +1 -0
- package/node_modules/remote-pi/dist/session/broker.d.ts +189 -0
- package/node_modules/remote-pi/dist/session/broker.js +507 -0
- package/node_modules/remote-pi/dist/session/broker.js.map +1 -0
- package/node_modules/remote-pi/dist/session/broker_remote.d.ts +74 -0
- package/node_modules/remote-pi/dist/session/broker_remote.js +583 -0
- package/node_modules/remote-pi/dist/session/broker_remote.js.map +1 -0
- package/node_modules/remote-pi/dist/session/cwd_lock.d.ts +33 -0
- package/node_modules/remote-pi/dist/session/cwd_lock.js +126 -0
- package/node_modules/remote-pi/dist/session/cwd_lock.js.map +1 -0
- package/node_modules/remote-pi/dist/session/envelope.d.ts +33 -0
- package/node_modules/remote-pi/dist/session/envelope.js +117 -0
- package/node_modules/remote-pi/dist/session/envelope.js.map +1 -0
- package/node_modules/remote-pi/dist/session/global_config.d.ts +33 -0
- package/node_modules/remote-pi/dist/session/global_config.js +73 -0
- package/node_modules/remote-pi/dist/session/global_config.js.map +1 -0
- package/node_modules/remote-pi/dist/session/ipc.d.ts +27 -0
- package/node_modules/remote-pi/dist/session/ipc.js +22 -0
- package/node_modules/remote-pi/dist/session/ipc.js.map +1 -0
- package/node_modules/remote-pi/dist/session/leader_election.d.ts +32 -0
- package/node_modules/remote-pi/dist/session/leader_election.js +106 -0
- package/node_modules/remote-pi/dist/session/leader_election.js.map +1 -0
- package/node_modules/remote-pi/dist/session/local_config.d.ts +55 -0
- package/node_modules/remote-pi/dist/session/local_config.js +157 -0
- package/node_modules/remote-pi/dist/session/local_config.js.map +1 -0
- package/node_modules/remote-pi/dist/session/mesh_message.d.ts +20 -0
- package/node_modules/remote-pi/dist/session/mesh_message.js +28 -0
- package/node_modules/remote-pi/dist/session/mesh_message.js.map +1 -0
- package/node_modules/remote-pi/dist/session/mesh_node.d.ts +116 -0
- package/node_modules/remote-pi/dist/session/mesh_node.js +573 -0
- package/node_modules/remote-pi/dist/session/mesh_node.js.map +1 -0
- package/node_modules/remote-pi/dist/session/peer.d.ts +139 -0
- package/node_modules/remote-pi/dist/session/peer.js +451 -0
- package/node_modules/remote-pi/dist/session/peer.js.map +1 -0
- package/node_modules/remote-pi/dist/session/peer_inventory.d.ts +13 -0
- package/node_modules/remote-pi/dist/session/peer_inventory.js +48 -0
- package/node_modules/remote-pi/dist/session/peer_inventory.js.map +1 -0
- package/node_modules/remote-pi/dist/session/peer_limits.d.ts +9 -0
- package/node_modules/remote-pi/dist/session/peer_limits.js +21 -0
- package/node_modules/remote-pi/dist/session/peer_limits.js.map +1 -0
- package/node_modules/remote-pi/dist/session/setup_wizard.d.ts +39 -0
- package/node_modules/remote-pi/dist/session/setup_wizard.js +63 -0
- package/node_modules/remote-pi/dist/session/setup_wizard.js.map +1 -0
- package/node_modules/remote-pi/dist/session/tool_gate.d.ts +5 -0
- package/node_modules/remote-pi/dist/session/tool_gate.js +11 -0
- package/node_modules/remote-pi/dist/session/tool_gate.js.map +1 -0
- package/node_modules/remote-pi/dist/session/tools.d.ts +24 -0
- package/node_modules/remote-pi/dist/session/tools.js +252 -0
- package/node_modules/remote-pi/dist/session/tools.js.map +1 -0
- package/node_modules/remote-pi/dist/session/wizard.d.ts +13 -0
- package/node_modules/remote-pi/dist/session/wizard.js +20 -0
- package/node_modules/remote-pi/dist/session/wizard.js.map +1 -0
- package/node_modules/remote-pi/dist/settings.d.ts +15 -0
- package/node_modules/remote-pi/dist/settings.js +52 -0
- package/node_modules/remote-pi/dist/settings.js.map +1 -0
- package/node_modules/remote-pi/dist/transport/peer_channel.d.ts +37 -0
- package/node_modules/remote-pi/dist/transport/peer_channel.js +98 -0
- package/node_modules/remote-pi/dist/transport/peer_channel.js.map +1 -0
- package/node_modules/remote-pi/dist/transport/pi_forward_client.d.ts +29 -0
- package/node_modules/remote-pi/dist/transport/pi_forward_client.js +62 -0
- package/node_modules/remote-pi/dist/transport/pi_forward_client.js.map +1 -0
- package/node_modules/remote-pi/dist/transport/relay_client.d.ts +91 -0
- package/node_modules/remote-pi/dist/transport/relay_client.js +206 -0
- package/node_modules/remote-pi/dist/transport/relay_client.js.map +1 -0
- package/node_modules/remote-pi/dist/ui/footer.d.ts +32 -0
- package/node_modules/remote-pi/dist/ui/footer.js +34 -0
- package/node_modules/remote-pi/dist/ui/footer.js.map +1 -0
- package/node_modules/remote-pi/docs/daemon.md +289 -0
- package/node_modules/remote-pi/package.json +88 -0
- package/node_modules/remote-pi/service-templates/launchd.plist.template +35 -0
- package/node_modules/remote-pi/service-templates/systemd.service.template +19 -0
- package/node_modules/remote-pi/service-templates/task-launcher.vbs.template +10 -0
- package/node_modules/remote-pi/service-templates/task-scheduler.xml.template +38 -0
- package/node_modules/remote-pi/skills/agent-network/SKILL.md +310 -0
- package/package.json +37 -12
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool-diff/write-display-utils.ts +0 -29
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{session-reference-core.ts → reference/session.ts} +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/{pi-aliases.ts → shell/aliases.ts} +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/ATTRIBUTION.md +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/diff-presentation.ts +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/index.ts +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/render-utils.ts +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/shiki-highlight.ts +0 -0
- /package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/{tool-diff → tool/diff}/types.ts +0 -0
|
@@ -102,14 +102,11 @@ function trimUrl(url: string): string {
|
|
|
102
102
|
function linkifyUrls(markdown: string): string {
|
|
103
103
|
const lines = markdown.split("\n");
|
|
104
104
|
const out: string[] = [];
|
|
105
|
-
let
|
|
105
|
+
let fence: MarkdownFence | undefined;
|
|
106
106
|
for (const line of lines) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
if (inFence) {
|
|
107
|
+
const scanned = scanMarkdownFence(line, fence);
|
|
108
|
+
fence = scanned.fence;
|
|
109
|
+
if (scanned.protected) {
|
|
113
110
|
out.push(line);
|
|
114
111
|
continue;
|
|
115
112
|
}
|
|
@@ -129,6 +126,129 @@ function linkifyUrls(markdown: string): string {
|
|
|
129
126
|
return out.join("\n");
|
|
130
127
|
}
|
|
131
128
|
|
|
129
|
+
// ============================================================================
|
|
130
|
+
// 圈数字 → 半角括号
|
|
131
|
+
// ============================================================================
|
|
132
|
+
|
|
133
|
+
// Nerd Font 补丁字形(U+2460-U+2473)ink 超界,DirectWrite 下渲染会压住相邻字符;
|
|
134
|
+
// 转成 ASCII "(n)" 后任何字体下宽度一致。U+2460-U+2473 连续,差值即序号。
|
|
135
|
+
const CIRCLED_RE = /[①-⑳]/g;
|
|
136
|
+
const BLOCKQUOTE_PREFIX = /^ {0,3}>[ \t]?/;
|
|
137
|
+
const CODE_FENCE_OPEN = /^ {0,3}(`{3,}|~{3,})/;
|
|
138
|
+
const CODE_FENCE_CLOSE = /^ {0,3}(`+|~+)[ \t]*$/;
|
|
139
|
+
|
|
140
|
+
type FenceLine = { blockquoteDepth: number; content: string };
|
|
141
|
+
type MarkdownFence = { marker: string; blockquoteDepth: number };
|
|
142
|
+
|
|
143
|
+
function parseFenceLine(line: string): FenceLine {
|
|
144
|
+
let content = line;
|
|
145
|
+
let blockquoteDepth = 0;
|
|
146
|
+
while (BLOCKQUOTE_PREFIX.test(content)) {
|
|
147
|
+
content = content.replace(BLOCKQUOTE_PREFIX, "");
|
|
148
|
+
blockquoteDepth++;
|
|
149
|
+
}
|
|
150
|
+
return { blockquoteDepth, content };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function scanMarkdownFence(
|
|
154
|
+
line: string,
|
|
155
|
+
fence: MarkdownFence | undefined,
|
|
156
|
+
): { protected: boolean; fence: MarkdownFence | undefined } {
|
|
157
|
+
const parsed = parseFenceLine(line);
|
|
158
|
+
if (fence && parsed.blockquoteDepth >= fence.blockquoteDepth) {
|
|
159
|
+
const close = parsed.content.match(CODE_FENCE_CLOSE)?.[1];
|
|
160
|
+
const closed =
|
|
161
|
+
parsed.blockquoteDepth === fence.blockquoteDepth &&
|
|
162
|
+
close?.[0] === fence.marker[0] &&
|
|
163
|
+
close.length >= fence.marker.length;
|
|
164
|
+
return { protected: true, fence: closed ? undefined : fence };
|
|
165
|
+
}
|
|
166
|
+
const marker = parsed.content.match(CODE_FENCE_OPEN)?.[1];
|
|
167
|
+
return {
|
|
168
|
+
protected: Boolean(marker),
|
|
169
|
+
fence: marker ? { marker, blockquoteDepth: parsed.blockquoteDepth } : undefined,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function replaceCircled(text: string): string {
|
|
174
|
+
return text.replace(CIRCLED_RE, (ch) => `(${ch.codePointAt(0)! - 0x2460 + 1})`);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function backtickRunAt(
|
|
178
|
+
text: string,
|
|
179
|
+
start: number,
|
|
180
|
+
skipEscaped: boolean,
|
|
181
|
+
): { start: number; end: number } | null {
|
|
182
|
+
let index = text.indexOf("`", start);
|
|
183
|
+
while (index >= 0) {
|
|
184
|
+
let backslashes = 0;
|
|
185
|
+
for (let cursor = index - 1; cursor >= 0 && text[cursor] === "\\"; cursor--) backslashes++;
|
|
186
|
+
if (!skipEscaped || backslashes % 2 === 0) {
|
|
187
|
+
let end = index + 1;
|
|
188
|
+
while (text[end] === "`") end++;
|
|
189
|
+
return { start: index, end };
|
|
190
|
+
}
|
|
191
|
+
index = text.indexOf("`", index + 1);
|
|
192
|
+
}
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** 转换连续 prose(可跨行),但保留有效 inline code spans。 */
|
|
197
|
+
function deCircledProse(prose: string): string {
|
|
198
|
+
let cursor = 0;
|
|
199
|
+
let transformed = "";
|
|
200
|
+
while (cursor < prose.length) {
|
|
201
|
+
const opening = backtickRunAt(prose, cursor, true);
|
|
202
|
+
if (!opening) {
|
|
203
|
+
transformed += replaceCircled(prose.slice(cursor));
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
let closing = backtickRunAt(prose, opening.end, false);
|
|
207
|
+
while (closing && closing.end - closing.start !== opening.end - opening.start) {
|
|
208
|
+
closing = backtickRunAt(prose, closing.end, false);
|
|
209
|
+
}
|
|
210
|
+
if (!closing) {
|
|
211
|
+
transformed += replaceCircled(prose.slice(cursor, opening.end));
|
|
212
|
+
cursor = opening.end;
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
transformed += replaceCircled(prose.slice(cursor, opening.start));
|
|
216
|
+
transformed += prose.slice(opening.start, closing.end);
|
|
217
|
+
cursor = closing.end;
|
|
218
|
+
}
|
|
219
|
+
return transformed;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** 转换普通 Markdown 文本,但保留匹配 container 的 fenced blocks 与 inline code spans。 */
|
|
223
|
+
function deCircled(markdown: string): string {
|
|
224
|
+
const output: string[] = [];
|
|
225
|
+
let prose: string[] = [];
|
|
226
|
+
let fence: MarkdownFence | undefined;
|
|
227
|
+
const flushProse = () => {
|
|
228
|
+
if (prose.length === 0) return;
|
|
229
|
+
output.push(deCircledProse(prose.join("\n")));
|
|
230
|
+
prose = [];
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
for (const line of markdown.split("\n")) {
|
|
234
|
+
const scanned = scanMarkdownFence(line, fence);
|
|
235
|
+
fence = scanned.fence;
|
|
236
|
+
if (scanned.protected) {
|
|
237
|
+
flushProse();
|
|
238
|
+
output.push(line);
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
if (parseFenceLine(line).content.trim() === "") {
|
|
242
|
+
flushProse();
|
|
243
|
+
output.push(line);
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
prose.push(line);
|
|
247
|
+
}
|
|
248
|
+
flushProse();
|
|
249
|
+
return output.join("\n");
|
|
250
|
+
}
|
|
251
|
+
|
|
132
252
|
// ============================================================================
|
|
133
253
|
// 注册
|
|
134
254
|
// ============================================================================
|
|
@@ -140,6 +260,8 @@ export default function (pi: ExtensionAPI): void {
|
|
|
140
260
|
const { messageType, isStreaming = false } = context ?? {};
|
|
141
261
|
// 与官方推荐一致:thinking 块与流式中间态不转换
|
|
142
262
|
if (messageType === "assistant-thinking" || isStreaming) return markdown;
|
|
263
|
+
// 0. 圈数字转半角括号(Nerd Font 补丁字形缺陷规避)
|
|
264
|
+
markdown = deCircled(markdown);
|
|
143
265
|
// 1. Mermaid 方言渲染
|
|
144
266
|
markdown = renderDiagrams(markdown, context);
|
|
145
267
|
// 2. GitHub 风格提示框
|
|
@@ -212,17 +334,18 @@ function renderDiagrams(
|
|
|
212
334
|
function renderAdmonitions(markdown: string): string {
|
|
213
335
|
const lines = markdown.split("\n");
|
|
214
336
|
const out: string[] = [];
|
|
215
|
-
let
|
|
337
|
+
let fence: MarkdownFence | undefined;
|
|
216
338
|
let i = 0;
|
|
217
339
|
while (i < lines.length) {
|
|
218
340
|
const line = lines[i];
|
|
219
|
-
|
|
220
|
-
|
|
341
|
+
const scanned = scanMarkdownFence(line, fence);
|
|
342
|
+
fence = scanned.fence;
|
|
343
|
+
if (scanned.protected) {
|
|
221
344
|
out.push(line);
|
|
222
345
|
i++;
|
|
223
346
|
continue;
|
|
224
347
|
}
|
|
225
|
-
if (
|
|
348
|
+
if (/^>\s*\[\s*!/i.test(line)) {
|
|
226
349
|
const result = renderAdmonition(lines, i);
|
|
227
350
|
if (result) {
|
|
228
351
|
out.push(...result.output);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { setHoveredCompactAssistant } from "../compact-mode.ts";
|
|
2
|
+
import {
|
|
3
|
+
isExpandedToolIoView,
|
|
4
|
+
invalidateIoView,
|
|
5
|
+
type ExpandedToolIoView,
|
|
6
|
+
type ToolIoSection,
|
|
7
|
+
} from "../tool/result.ts";
|
|
8
|
+
import type { ToolGroupComponent } from "../tool/grouping.ts";
|
|
9
|
+
import { componentAtLocalRow, type ComponentRowHit } from "./layout.ts";
|
|
10
|
+
import { setScrollButtonHovered } from "./scroll.ts";
|
|
11
|
+
|
|
12
|
+
const TOOL_HOVER_STATE_KEY = Symbol.for("pi.ccstyle.tool-hover-state");
|
|
13
|
+
|
|
14
|
+
type SharedToolHoverState = { toolCallId: string | null };
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* hover 状态宿主(Symbol.for + globalThis):模块 reload 后新旧实例共享,
|
|
18
|
+
* 测试依赖该跨实例语义。
|
|
19
|
+
*/
|
|
20
|
+
export function sharedToolHoverState(): SharedToolHoverState {
|
|
21
|
+
const host = globalThis as any;
|
|
22
|
+
return (host[TOOL_HOVER_STATE_KEY] ??= { toolCallId: null });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export let hoveredToolCallId: string | null = sharedToolHoverState().toolCallId;
|
|
26
|
+
|
|
27
|
+
export function setHoveredToolCallId(toolCallId: string | null): void {
|
|
28
|
+
hoveredToolCallId = toolCallId;
|
|
29
|
+
sharedToolHoverState().toolCallId = toolCallId;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function isToolCallHovered(toolCallId: string | null | undefined): boolean {
|
|
33
|
+
return Boolean(toolCallId && sharedToolHoverState().toolCallId === toolCallId);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let hoveredToolGroup: ToolGroupComponent | null = null;
|
|
37
|
+
|
|
38
|
+
export function setHoveredToolGroup(group: ToolGroupComponent | null): boolean {
|
|
39
|
+
if (group === hoveredToolGroup) return false;
|
|
40
|
+
hoveredToolGroup?.setHintHovered(false);
|
|
41
|
+
hoveredToolGroup = group;
|
|
42
|
+
group?.setHintHovered(true);
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let hoveredToolIoView: ExpandedToolIoView | null = null;
|
|
47
|
+
let hoveredToolIoSection: ToolIoSection | null = null;
|
|
48
|
+
|
|
49
|
+
export function setHoveredToolIo(
|
|
50
|
+
view: ExpandedToolIoView | null,
|
|
51
|
+
section: ToolIoSection | null,
|
|
52
|
+
): boolean {
|
|
53
|
+
// resultRendererComponent 可能是 Text/第三方 renderer;reload 后也可能残留旧实例。
|
|
54
|
+
const nextView = isExpandedToolIoView(view) ? view : null;
|
|
55
|
+
const nextSection = nextView ? section : null;
|
|
56
|
+
if (nextView === hoveredToolIoView && nextSection === hoveredToolIoSection) return false;
|
|
57
|
+
if (isExpandedToolIoView(hoveredToolIoView)) {
|
|
58
|
+
hoveredToolIoView.setHoveredSection(null);
|
|
59
|
+
invalidateIoView(hoveredToolIoView);
|
|
60
|
+
}
|
|
61
|
+
hoveredToolIoView = nextView;
|
|
62
|
+
hoveredToolIoSection = nextSection;
|
|
63
|
+
if (nextView) {
|
|
64
|
+
nextView.setHoveredSection(nextSection);
|
|
65
|
+
invalidateIoView(nextView);
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** hover 与点击共用组件定位;同一布局下按容器/宽度/行缓存,避免 motion 重复渲染。 */
|
|
71
|
+
let fullscreenHoverCacheLayout: unknown = null;
|
|
72
|
+
let fullscreenHoverComponentCache = new WeakMap<object, Map<string, ComponentRowHit | null>>();
|
|
73
|
+
|
|
74
|
+
export function cachedFullscreenComponentAtRow(
|
|
75
|
+
layout: any,
|
|
76
|
+
container: any,
|
|
77
|
+
row: number,
|
|
78
|
+
width: number,
|
|
79
|
+
): ComponentRowHit | null {
|
|
80
|
+
if (!container || typeof container !== "object") return null;
|
|
81
|
+
if (fullscreenHoverCacheLayout !== layout) {
|
|
82
|
+
fullscreenHoverCacheLayout = layout;
|
|
83
|
+
fullscreenHoverComponentCache = new WeakMap();
|
|
84
|
+
}
|
|
85
|
+
let rows = fullscreenHoverComponentCache.get(container);
|
|
86
|
+
if (!rows) {
|
|
87
|
+
rows = new Map();
|
|
88
|
+
fullscreenHoverComponentCache.set(container, rows);
|
|
89
|
+
}
|
|
90
|
+
const key = `${width}:${row}`;
|
|
91
|
+
if (rows.has(key)) return rows.get(key) ?? null;
|
|
92
|
+
const hit = componentAtLocalRow(container, row, width);
|
|
93
|
+
rows.set(key, hit);
|
|
94
|
+
return hit;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** fullscreen 鼠标悬停目标。 */
|
|
98
|
+
export type FullscreenHoverTarget =
|
|
99
|
+
| { kind: "button" }
|
|
100
|
+
| { kind: "group"; component: ToolGroupComponent }
|
|
101
|
+
| { kind: "assistant"; component: any }
|
|
102
|
+
| {
|
|
103
|
+
kind: "tool";
|
|
104
|
+
component: any;
|
|
105
|
+
view: ExpandedToolIoView | null;
|
|
106
|
+
section: ToolIoSection | null;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** 悬停状态变化才触发渲染(motion 事件密集,状态不变跳过)。 */
|
|
110
|
+
export function applyFullscreenHover(tui: any, target: FullscreenHoverTarget | null): void {
|
|
111
|
+
let changed = false;
|
|
112
|
+
const nextCallId =
|
|
113
|
+
target?.kind === "tool" && !target.component.expanded
|
|
114
|
+
? (target.component.toolCallId ?? null)
|
|
115
|
+
: null;
|
|
116
|
+
if (nextCallId !== sharedToolHoverState().toolCallId) {
|
|
117
|
+
setHoveredToolCallId(nextCallId);
|
|
118
|
+
changed = true;
|
|
119
|
+
}
|
|
120
|
+
const nextGroup = target?.kind === "group" ? target.component : null;
|
|
121
|
+
if (setHoveredToolGroup(nextGroup)) changed = true;
|
|
122
|
+
const nextAssistant = target?.kind === "assistant" ? target.component : null;
|
|
123
|
+
if (setHoveredCompactAssistant(nextAssistant)) changed = true;
|
|
124
|
+
const nextView = target?.kind === "tool" ? target.view : null;
|
|
125
|
+
const nextSection = target?.kind === "tool" ? target.section : null;
|
|
126
|
+
if (setHoveredToolIo(nextView, nextSection)) changed = true;
|
|
127
|
+
const nextButton = target?.kind === "button";
|
|
128
|
+
if (setScrollButtonHovered(nextButton)) changed = true;
|
|
129
|
+
if (changed) tui.requestRender?.();
|
|
130
|
+
}
|