@herbertgao/pi-extensions 2026.9.17 → 2026.9.19
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 +31 -33
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/node_modules/@herbertgao/pi-bark/package.json +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/working-message.ts +21 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +15 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/index.ts +43 -7
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +7 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +75 -75
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/package.json +7 -7
- package/node_modules/@herbertgao/resume-from/package.json +4 -2
- package/node_modules/@herbertgao/sol-pi/package.json +6 -6
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +99 -99
- package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
- package/node_modules/@tifan/pi-handoff/package.json +1 -1
- package/node_modules/@tifan/pi-handoff/src/index.ts +56 -26
- package/node_modules/@tifan/pi-mermaid-open/package.json +1 -1
- package/node_modules/@tifan/pi-preferred-thinking/package.json +1 -1
- package/node_modules/@tifan/pi-recap/package.json +1 -1
- package/node_modules/@tifan/pi-rename/package.json +1 -1
- package/node_modules/pi-antigravity/README.md +29 -6
- package/node_modules/pi-antigravity/package.json +14 -9
- package/node_modules/pi-antigravity/src/auth/accounts.ts +327 -0
- package/node_modules/pi-antigravity/src/auth/index.ts +9 -0
- package/node_modules/pi-antigravity/src/client/client.ts +1 -1
- package/node_modules/pi-antigravity/src/image/image.ts +4 -4
- package/node_modules/pi-antigravity/src/index.ts +203 -13
- package/node_modules/pi-antigravity/src/search/index.ts +1 -0
- package/node_modules/pi-antigravity/src/search/search.ts +325 -0
- package/node_modules/pi-antigravity/src/stream/stream.ts +191 -14
- package/node_modules/pi-antigravity/src/types/enums.ts +45 -36
- package/node_modules/pi-antigravity/src/types/types.ts +5 -12
- package/node_modules/pi-antigravity/src/utils/http.ts +7 -2
- package/node_modules/pi-antigravity/src/utils/util.ts +31 -3
- package/node_modules/pi-lens/package.json +158 -158
- package/node_modules/pi-multi-account/package.json +2 -2
- package/node_modules/pi-typesafe/README.md +3 -1
- package/node_modules/pi-typesafe/dist/auth.d.ts +9 -5
- package/node_modules/pi-typesafe/dist/auth.js +7 -3
- package/node_modules/pi-typesafe/dist/backends.d.ts +33 -3
- package/node_modules/pi-typesafe/dist/backends.js +95 -1
- package/node_modules/pi-typesafe/dist/client.d.ts +5 -5
- package/node_modules/pi-typesafe/dist/client.js +12 -9
- package/node_modules/pi-typesafe/dist/credentials.d.ts +14 -8
- package/node_modules/pi-typesafe/dist/credentials.js +10 -7
- package/node_modules/pi-typesafe/dist/errors.d.ts +2 -2
- package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
- package/node_modules/pi-typesafe/dist/index.js +1 -1
- package/node_modules/pi-typesafe/dist/login.d.ts +2 -2
- package/node_modules/pi-typesafe/dist/login.js +2 -2
- package/node_modules/pi-typesafe/package.json +6 -5
- package/node_modules/pi-web-access/CHANGELOG.md +72 -0
- package/node_modules/pi-web-access/README.md +34 -13
- package/node_modules/pi-web-access/chrome-cookies.ts +79 -25
- package/node_modules/pi-web-access/curator-page.ts +5 -1
- package/node_modules/pi-web-access/curator-server.ts +2 -0
- package/node_modules/pi-web-access/dist/index.js +1337 -1009
- package/node_modules/pi-web-access/exa.ts +20 -52
- package/node_modules/pi-web-access/extract.ts +41 -4
- package/node_modules/pi-web-access/gemini-search.ts +12 -4
- package/node_modules/pi-web-access/index.ts +29 -37
- package/node_modules/pi-web-access/openai-search.ts +35 -7
- package/node_modules/pi-web-access/package.json +8 -7
- package/node_modules/pi-web-access/page-query.ts +2 -2
- package/node_modules/pi-web-access/query-rewrite.ts +2 -3
- package/node_modules/pi-web-access/ssrf-protection.ts +27 -10
- package/node_modules/pi-web-access/storage.ts +48 -77
- package/node_modules/pi-web-access/summary-model-scope.ts +6 -77
- package/node_modules/pi-web-access/summary-review.ts +3 -4
- package/node_modules/pi-web-access/tavily.ts +67 -20
- package/node_modules/pi-web-access/tool-activation.ts +53 -33
- package/node_modules/pi-web-access/utils.ts +1 -1
- package/node_modules/pi-web-access/you.ts +164 -0
- package/node_modules/pi-web-access/zai.ts +161 -0
- package/node_modules/remote-pi/package.json +5 -1
- package/package.json +19 -31
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +0 -1013
- package/node_modules/pi-mcp-adapter/LICENSE +0 -21
- package/node_modules/pi-mcp-adapter/OAUTH.md +0 -369
- package/node_modules/pi-mcp-adapter/README.md +0 -1021
- package/node_modules/pi-mcp-adapter/abort.ts +0 -34
- package/node_modules/pi-mcp-adapter/agent-dir.ts +0 -68
- package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +0 -416
- package/node_modules/pi-mcp-adapter/agent-plugin-provenance.ts +0 -36
- package/node_modules/pi-mcp-adapter/app-bridge.bundle.js +0 -67
- package/node_modules/pi-mcp-adapter/banner.png +0 -0
- package/node_modules/pi-mcp-adapter/bearer-command-resolver.ts +0 -193
- package/node_modules/pi-mcp-adapter/claude-plugin-loader.ts +0 -365
- package/node_modules/pi-mcp-adapter/cli.js +0 -454
- package/node_modules/pi-mcp-adapter/commands.ts +0 -861
- package/node_modules/pi-mcp-adapter/config.ts +0 -1565
- package/node_modules/pi-mcp-adapter/consent-manager.ts +0 -95
- package/node_modules/pi-mcp-adapter/direct-tool-surface.ts +0 -244
- package/node_modules/pi-mcp-adapter/direct-tools.ts +0 -428
- package/node_modules/pi-mcp-adapter/dist/abort.d.ts +0 -2
- package/node_modules/pi-mcp-adapter/dist/abort.js +0 -36
- package/node_modules/pi-mcp-adapter/dist/abort.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/agent-dir.d.ts +0 -10
- package/node_modules/pi-mcp-adapter/dist/agent-dir.js +0 -63
- package/node_modules/pi-mcp-adapter/dist/agent-dir.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.d.ts +0 -8
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js +0 -398
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.d.ts +0 -1
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js +0 -31
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.d.ts +0 -6
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js +0 -194
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.d.ts +0 -9
- package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js +0 -362
- package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/config.d.ts +0 -134
- package/node_modules/pi-mcp-adapter/dist/config.js +0 -1361
- package/node_modules/pi-mcp-adapter/dist/config.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/consent-manager.d.ts +0 -18
- package/node_modules/pi-mcp-adapter/dist/consent-manager.js +0 -88
- package/node_modules/pi-mcp-adapter/dist/consent-manager.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.d.ts +0 -17
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js +0 -316
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/errors.d.ts +0 -131
- package/node_modules/pi-mcp-adapter/dist/errors.js +0 -278
- package/node_modules/pi-mcp-adapter/dist/errors.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/http-ca.d.ts +0 -8
- package/node_modules/pi-mcp-adapter/dist/http-ca.js +0 -88
- package/node_modules/pi-mcp-adapter/dist/http-ca.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/jev-client.d.ts +0 -14
- package/node_modules/pi-mcp-adapter/dist/jev-client.js +0 -367
- package/node_modules/pi-mcp-adapter/dist/jev-client.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.d.ts +0 -77
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.js +0 -2
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.d.ts +0 -51
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.js +0 -205
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.d.ts +0 -2
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js +0 -68
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/lifecycle.d.ts +0 -56
- package/node_modules/pi-mcp-adapter/dist/lifecycle.js +0 -410
- package/node_modules/pi-mcp-adapter/dist/lifecycle.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/logger.d.ts +0 -51
- package/node_modules/pi-mcp-adapter/dist/logger.js +0 -131
- package/node_modules/pi-mcp-adapter/dist/logger.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.d.ts +0 -26
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js +0 -103
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.d.ts +0 -118
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js +0 -1097
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.d.ts +0 -170
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.js +0 -1142
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.d.ts +0 -24
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js +0 -203
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.d.ts +0 -53
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js +0 -441
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.d.ts +0 -148
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js +0 -689
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.d.ts +0 -6
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.js +0 -166
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.d.ts +0 -102
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js +0 -369
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.d.ts +0 -95
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.js +0 -242
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.d.ts +0 -19
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +0 -301
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.d.ts +0 -6
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.js +0 -505
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.d.ts +0 -2
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js +0 -144
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.d.ts +0 -10
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.js +0 -312
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/resource-tools.d.ts +0 -1
- package/node_modules/pi-mcp-adapter/dist/resource-tools.js +0 -15
- package/node_modules/pi-mcp-adapter/dist/resource-tools.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.d.ts +0 -13
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.js +0 -97
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.d.ts +0 -17
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.js +0 -203
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.d.ts +0 -11
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.js +0 -172
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/server-manager.d.ts +0 -157
- package/node_modules/pi-mcp-adapter/dist/server-manager.js +0 -1745
- package/node_modules/pi-mcp-adapter/dist/server-manager.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/session-approvals.d.ts +0 -34
- package/node_modules/pi-mcp-adapter/dist/session-approvals.js +0 -140
- package/node_modules/pi-mcp-adapter/dist/session-approvals.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/session-recovery.d.ts +0 -26
- package/node_modules/pi-mcp-adapter/dist/session-recovery.js +0 -142
- package/node_modules/pi-mcp-adapter/dist/session-recovery.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/state.d.ts +0 -73
- package/node_modules/pi-mcp-adapter/dist/state.js +0 -2
- package/node_modules/pi-mcp-adapter/dist/state.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/types.d.ts +0 -642
- package/node_modules/pi-mcp-adapter/dist/types.js +0 -331
- package/node_modules/pi-mcp-adapter/dist/types.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.d.ts +0 -6
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js +0 -37
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.d.ts +0 -17
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js +0 -219
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.d.ts +0 -104
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js +0 -59
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.d.ts +0 -4
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js +0 -27
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.d.ts +0 -15
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js +0 -85
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js.map +0 -1
- package/node_modules/pi-mcp-adapter/dist/utils.d.ts +0 -41
- package/node_modules/pi-mcp-adapter/dist/utils.js +0 -417
- package/node_modules/pi-mcp-adapter/dist/utils.js.map +0 -1
- package/node_modules/pi-mcp-adapter/elicitation-handler.ts +0 -358
- package/node_modules/pi-mcp-adapter/error-signal.ts +0 -32
- package/node_modules/pi-mcp-adapter/errors.ts +0 -364
- package/node_modules/pi-mcp-adapter/examples/jev-accessibility-loop.mjs +0 -85
- package/node_modules/pi-mcp-adapter/examples/jev-semantic-filter.mjs +0 -34
- package/node_modules/pi-mcp-adapter/failure-backoff.ts +0 -23
- package/node_modules/pi-mcp-adapter/glimpse-ui.ts +0 -80
- package/node_modules/pi-mcp-adapter/host-html-template.ts +0 -515
- package/node_modules/pi-mcp-adapter/http-ca.ts +0 -84
- package/node_modules/pi-mcp-adapter/index.ts +0 -2106
- package/node_modules/pi-mcp-adapter/init.ts +0 -721
- package/node_modules/pi-mcp-adapter/jev-client.ts +0 -300
- package/node_modules/pi-mcp-adapter/jev-contracts.ts +0 -53
- package/node_modules/pi-mcp-adapter/jev-key-store.ts +0 -192
- package/node_modules/pi-mcp-adapter/json-schema-validator.ts +0 -83
- package/node_modules/pi-mcp-adapter/lazy-loader.ts +0 -7
- package/node_modules/pi-mcp-adapter/lifecycle.ts +0 -457
- package/node_modules/pi-mcp-adapter/logger.ts +0 -169
- package/node_modules/pi-mcp-adapter/mcp-auth-fetch.ts +0 -113
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +0 -1296
- package/node_modules/pi-mcp-adapter/mcp-auth.ts +0 -1287
- package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +0 -250
- package/node_modules/pi-mcp-adapter/mcp-callback-server.ts +0 -534
- package/node_modules/pi-mcp-adapter/mcp-code.ts +0 -495
- package/node_modules/pi-mcp-adapter/mcp-install.ts +0 -60
- package/node_modules/pi-mcp-adapter/mcp-keyring-helper.cjs +0 -89
- package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +0 -819
- package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +0 -511
- package/node_modules/pi-mcp-adapter/mcp-panel-theme.ts +0 -104
- package/node_modules/pi-mcp-adapter/mcp-panel.ts +0 -1099
- package/node_modules/pi-mcp-adapter/mcp-probe.ts +0 -201
- package/node_modules/pi-mcp-adapter/mcp-references.ts +0 -373
- package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +0 -137
- package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +0 -747
- package/node_modules/pi-mcp-adapter/mcp-status.ts +0 -105
- package/node_modules/pi-mcp-adapter/mcp-tasks.ts +0 -467
- package/node_modules/pi-mcp-adapter/mcp-trace.ts +0 -306
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +0 -362
- package/node_modules/pi-mcp-adapter/namespace-tools.ts +0 -334
- package/node_modules/pi-mcp-adapter/npx-resolver.ts +0 -543
- package/node_modules/pi-mcp-adapter/oauth-handler.ts +0 -30
- package/node_modules/pi-mcp-adapter/oauth.ts +0 -52
- package/node_modules/pi-mcp-adapter/onboarding-state.ts +0 -76
- package/node_modules/pi-mcp-adapter/package-mcp-loader.ts +0 -156
- package/node_modules/pi-mcp-adapter/package.json +0 -219
- package/node_modules/pi-mcp-adapter/panel-keys.ts +0 -53
- package/node_modules/pi-mcp-adapter/prompts.ts +0 -385
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +0 -1735
- package/node_modules/pi-mcp-adapter/request-headers-command.ts +0 -333
- package/node_modules/pi-mcp-adapter/resource-tools.ts +0 -17
- package/node_modules/pi-mcp-adapter/runtime-owner.ts +0 -106
- package/node_modules/pi-mcp-adapter/sampling-handler.ts +0 -261
- package/node_modules/pi-mcp-adapter/sandbox-proxy-template.ts +0 -144
- package/node_modules/pi-mcp-adapter/search-ranking.ts +0 -309
- package/node_modules/pi-mcp-adapter/secure-keyring.ts +0 -170
- package/node_modules/pi-mcp-adapter/semantic-search.ts +0 -186
- package/node_modules/pi-mcp-adapter/server-manager.ts +0 -2088
- package/node_modules/pi-mcp-adapter/session-approvals.ts +0 -201
- package/node_modules/pi-mcp-adapter/session-recovery.ts +0 -158
- package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +0 -49
- package/node_modules/pi-mcp-adapter/state.ts +0 -71
- package/node_modules/pi-mcp-adapter/tool-approval.ts +0 -205
- package/node_modules/pi-mcp-adapter/tool-metadata.ts +0 -302
- package/node_modules/pi-mcp-adapter/tool-registrar.ts +0 -255
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +0 -573
- package/node_modules/pi-mcp-adapter/ts-shape.ts +0 -149
- package/node_modules/pi-mcp-adapter/types.ts +0 -1120
- package/node_modules/pi-mcp-adapter/ui-app-bridge-helpers.ts +0 -40
- package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +0 -266
- package/node_modules/pi-mcp-adapter/ui-server.ts +0 -993
- package/node_modules/pi-mcp-adapter/ui-session.ts +0 -624
- package/node_modules/pi-mcp-adapter/ui-stream-types.ts +0 -89
- package/node_modules/pi-mcp-adapter/ui-tool-visibility.ts +0 -25
- package/node_modules/pi-mcp-adapter/unix-socket-transport.ts +0 -85
- package/node_modules/pi-mcp-adapter/utils.ts +0 -464
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { createSecureKeyringStore, getTestSecureKeyringEntries, getTestSecureKeyringReadCount, removeTestSecureKeyringEntry, resetTestSecureKeyring, setTestSecureKeyringEntry } from "./secure-keyring.ts";
|
|
3
|
-
|
|
4
|
-
type BearerSecretStore = {
|
|
5
|
-
read(account: string): string | undefined;
|
|
6
|
-
write(account: string, payload: string): void;
|
|
7
|
-
remove(account: string): void;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
interface StoredBearerTokenRecord {
|
|
11
|
-
token: string;
|
|
12
|
-
serverUrl: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface BearerChunkManifest {
|
|
16
|
-
__piMcpAdapterBearerChunked: 1;
|
|
17
|
-
chunkCount: number;
|
|
18
|
-
chunkDigest: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const BEARER_SECRET_SERVICE = "pi-mcp-adapter.bearer";
|
|
22
|
-
const BEARER_SECRET_CHUNK_SIZE = 1000;
|
|
23
|
-
|
|
24
|
-
export class BearerCredentialStoreError extends Error {
|
|
25
|
-
readonly code = "BEARER_CREDENTIAL_STORE_UNAVAILABLE";
|
|
26
|
-
readonly operation: "read" | "write" | "remove";
|
|
27
|
-
|
|
28
|
-
constructor(message: string, operation: "read" | "write" | "remove", cause: unknown) {
|
|
29
|
-
super(message, { cause });
|
|
30
|
-
this.name = "BearerCredentialStoreError";
|
|
31
|
-
this.operation = operation;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export type BearerCredentialStatus =
|
|
36
|
-
| { status: "present" }
|
|
37
|
-
| { status: "missing" }
|
|
38
|
-
| { status: "url-mismatch" }
|
|
39
|
-
| { status: "unavailable"; message: string };
|
|
40
|
-
|
|
41
|
-
function getBearerSecretStore(): BearerSecretStore {
|
|
42
|
-
return createSecureKeyringStore(BEARER_SECRET_SERVICE);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function getBearerAccount(serverName: string): string {
|
|
46
|
-
if (typeof serverName !== "string") {
|
|
47
|
-
throw new Error(`Invalid MCP server name: ${JSON.stringify(serverName)}`);
|
|
48
|
-
}
|
|
49
|
-
return `sha256-${createHash("sha256").update(serverName, "utf8").digest("hex")}`;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function parseBearerPayload(serverName: string, payload: string): StoredBearerTokenRecord {
|
|
53
|
-
const parsed = parseStoredBearerJson(serverName, payload);
|
|
54
|
-
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
55
|
-
throw new Error(`Stored bearer token record for ${serverName} has invalid shape`);
|
|
56
|
-
}
|
|
57
|
-
const record = parsed as Partial<StoredBearerTokenRecord>;
|
|
58
|
-
if (typeof record.token !== "string" || typeof record.serverUrl !== "string") {
|
|
59
|
-
throw new Error(`Stored bearer token record for ${serverName} has invalid shape`);
|
|
60
|
-
}
|
|
61
|
-
return { token: record.token, serverUrl: record.serverUrl };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function parseStoredBearerJson(serverName: string, payload: string): unknown {
|
|
65
|
-
try {
|
|
66
|
-
return JSON.parse(payload) as unknown;
|
|
67
|
-
} catch {
|
|
68
|
-
throw new Error(`Failed to parse stored bearer token record for ${serverName}`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function isBearerChunkManifest(value: unknown): value is BearerChunkManifest {
|
|
73
|
-
if (typeof value !== "object" || value === null) return false;
|
|
74
|
-
const manifest = value as Partial<BearerChunkManifest>;
|
|
75
|
-
return manifest.__piMcpAdapterBearerChunked === 1
|
|
76
|
-
&& typeof manifest.chunkCount === "number"
|
|
77
|
-
&& Number.isInteger(manifest.chunkCount)
|
|
78
|
-
&& manifest.chunkCount > 0
|
|
79
|
-
&& typeof manifest.chunkDigest === "string"
|
|
80
|
-
&& /^[a-f0-9]{16}$/.test(manifest.chunkDigest);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function readManifest(serverName: string, payload: string): BearerChunkManifest | undefined {
|
|
84
|
-
const parsed = parseStoredBearerJson(serverName, payload);
|
|
85
|
-
return isBearerChunkManifest(parsed) ? parsed : undefined;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function chunkAccount(account: string, manifest: BearerChunkManifest, index: number): string {
|
|
89
|
-
return `${account}.chunk.${manifest.chunkDigest}.${index}`;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function chunkAccounts(account: string, manifest: BearerChunkManifest): string[] {
|
|
93
|
-
return Array.from({ length: manifest.chunkCount }, (_, index) => chunkAccount(account, manifest, index));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function createManifest(payload: string): BearerChunkManifest {
|
|
97
|
-
return {
|
|
98
|
-
__piMcpAdapterBearerChunked: 1,
|
|
99
|
-
chunkCount: Math.ceil(payload.length / BEARER_SECRET_CHUNK_SIZE),
|
|
100
|
-
chunkDigest: createHash("sha256").update(payload, "utf8").digest("hex").slice(0, 16),
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function readExistingManifest(store: BearerSecretStore, serverName: string, account: string): BearerChunkManifest | undefined {
|
|
105
|
-
try {
|
|
106
|
-
const payload = store.read(account);
|
|
107
|
-
return payload === undefined ? undefined : readManifest(serverName, payload);
|
|
108
|
-
} catch {
|
|
109
|
-
return undefined;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function removeChunks(store: BearerSecretStore, account: string, manifest: BearerChunkManifest | undefined): void {
|
|
114
|
-
if (!manifest) return;
|
|
115
|
-
for (const accountName of chunkAccounts(account, manifest)) store.remove(accountName);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function tryRemoveChunks(store: BearerSecretStore, account: string, manifest: BearerChunkManifest | undefined): void {
|
|
119
|
-
try {
|
|
120
|
-
removeChunks(store, account, manifest);
|
|
121
|
-
} catch {
|
|
122
|
-
// Stale chunk cleanup must not hide a successful credential write.
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function readBearerRecordFromStore(store: BearerSecretStore, serverName: string): StoredBearerTokenRecord | undefined {
|
|
127
|
-
const account = getBearerAccount(serverName);
|
|
128
|
-
let payload: string | undefined;
|
|
129
|
-
try {
|
|
130
|
-
payload = store.read(account);
|
|
131
|
-
} catch (error) {
|
|
132
|
-
throw new BearerCredentialStoreError(
|
|
133
|
-
`Failed to read bearer token for ${serverName} from the OS secure credential store`,
|
|
134
|
-
"read",
|
|
135
|
-
error,
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
if (payload === undefined) return undefined;
|
|
139
|
-
try {
|
|
140
|
-
const manifest = readManifest(serverName, payload);
|
|
141
|
-
const recordPayload = manifest
|
|
142
|
-
? chunkAccounts(account, manifest).map((chunkName) => {
|
|
143
|
-
const chunk = store.read(chunkName);
|
|
144
|
-
if (chunk === undefined) throw new Error(`Missing bearer token chunk for ${serverName}`);
|
|
145
|
-
return chunk;
|
|
146
|
-
}).join("")
|
|
147
|
-
: payload;
|
|
148
|
-
return parseBearerPayload(serverName, recordPayload);
|
|
149
|
-
} catch (error) {
|
|
150
|
-
throw new BearerCredentialStoreError(
|
|
151
|
-
`Failed to read bearer token for ${serverName} from the OS secure credential store`,
|
|
152
|
-
"read",
|
|
153
|
-
error,
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function writeBearerRecordToStore(store: BearerSecretStore, serverName: string, record: StoredBearerTokenRecord): void {
|
|
159
|
-
const account = getBearerAccount(serverName);
|
|
160
|
-
const payload = JSON.stringify(record);
|
|
161
|
-
const previousManifest = readExistingManifest(store, serverName, account);
|
|
162
|
-
const manifest = payload.length > BEARER_SECRET_CHUNK_SIZE ? createManifest(payload) : undefined;
|
|
163
|
-
try {
|
|
164
|
-
if (manifest) {
|
|
165
|
-
for (let index = 0; index < manifest.chunkCount; index++) {
|
|
166
|
-
store.write(chunkAccount(account, manifest, index), payload.slice(index * BEARER_SECRET_CHUNK_SIZE, (index + 1) * BEARER_SECRET_CHUNK_SIZE));
|
|
167
|
-
}
|
|
168
|
-
store.write(account, JSON.stringify(manifest));
|
|
169
|
-
} else {
|
|
170
|
-
store.write(account, payload);
|
|
171
|
-
}
|
|
172
|
-
if (previousManifest?.chunkDigest !== manifest?.chunkDigest) {
|
|
173
|
-
tryRemoveChunks(store, account, previousManifest);
|
|
174
|
-
}
|
|
175
|
-
} catch (error) {
|
|
176
|
-
// An identical payload reuses the previous manifest's digest-keyed chunk
|
|
177
|
-
// accounts. Removing them on a failed rewrite would destroy the still
|
|
178
|
-
// installed previous credential, so clean up only digest-distinct chunks.
|
|
179
|
-
if (previousManifest?.chunkDigest !== manifest?.chunkDigest) {
|
|
180
|
-
tryRemoveChunks(store, account, manifest);
|
|
181
|
-
}
|
|
182
|
-
throw new BearerCredentialStoreError(
|
|
183
|
-
`Failed to write bearer token for ${serverName} to the OS secure credential store`,
|
|
184
|
-
"write",
|
|
185
|
-
error,
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function removeBearerRecordFromStore(store: BearerSecretStore, serverName: string): void {
|
|
191
|
-
const account = getBearerAccount(serverName);
|
|
192
|
-
try {
|
|
193
|
-
const payload = store.read(account);
|
|
194
|
-
const manifest = payload === undefined ? undefined : readManifest(serverName, payload);
|
|
195
|
-
removeChunks(store, account, manifest);
|
|
196
|
-
store.remove(account);
|
|
197
|
-
} catch (error) {
|
|
198
|
-
throw new BearerCredentialStoreError(
|
|
199
|
-
`Failed to remove bearer token for ${serverName} from the OS secure credential store`,
|
|
200
|
-
"remove",
|
|
201
|
-
error,
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export function getBearerTokenForUrl(serverName: string, serverUrl: string): string | undefined {
|
|
207
|
-
const record = readBearerRecordFromStore(getBearerSecretStore(), serverName);
|
|
208
|
-
if (!record) return undefined;
|
|
209
|
-
return record.serverUrl === serverUrl ? record.token : undefined;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export function saveBearerTokenForUrl(serverName: string, token: string, serverUrl: string): void {
|
|
213
|
-
writeBearerRecordToStore(getBearerSecretStore(), serverName, { token, serverUrl });
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export function removeBearerToken(serverName: string): void {
|
|
217
|
-
removeBearerRecordFromStore(getBearerSecretStore(), serverName);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export function inspectBearerTokenForUrl(serverName: string, serverUrl: string): BearerCredentialStatus {
|
|
221
|
-
try {
|
|
222
|
-
const record = readBearerRecordFromStore(getBearerSecretStore(), serverName);
|
|
223
|
-
if (!record) return { status: "missing" };
|
|
224
|
-
if (record.serverUrl !== serverUrl) return { status: "url-mismatch" };
|
|
225
|
-
return { status: "present" };
|
|
226
|
-
} catch (error) {
|
|
227
|
-
if (!(error instanceof BearerCredentialStoreError)) throw error;
|
|
228
|
-
return { status: "unavailable", message: "Bearer token secure credential store unavailable. Configure or unlock the OS credential store and retry." };
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export function resetTestBearerTokenStore(): void {
|
|
233
|
-
resetTestSecureKeyring();
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export function getTestBearerTokenStoreEntries(): [string, string][] {
|
|
237
|
-
return getTestSecureKeyringEntries().filter(([key]) => key.startsWith(`${BEARER_SECRET_SERVICE}\0`)).map(([key, value]) => [key.slice(BEARER_SECRET_SERVICE.length + 1), value]);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export function removeTestBearerTokenStoreEntry(account: string): void {
|
|
241
|
-
removeTestSecureKeyringEntry(BEARER_SECRET_SERVICE, account);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export function setTestBearerTokenStoreEntry(account: string, payload: string): void {
|
|
245
|
-
setTestSecureKeyringEntry(BEARER_SECRET_SERVICE, account, payload);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export function getTestBearerTokenStoreReadCount(): number {
|
|
249
|
-
return getTestSecureKeyringReadCount();
|
|
250
|
-
}
|