@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.
Files changed (307) hide show
  1. package/README.md +31 -33
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/node_modules/@herbertgao/pi-bark/package.json +2 -2
  4. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +4 -1
  5. package/node_modules/@herbertgao/pi-cc-extensions/README.md +4 -1
  6. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/working-message.ts +21 -6
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +15 -4
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/index.ts +43 -7
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +7 -2
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +1 -1
  11. package/node_modules/@herbertgao/pi-cc-extensions/package.json +75 -75
  12. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  13. package/node_modules/@herbertgao/pi-subagents/package.json +7 -7
  14. package/node_modules/@herbertgao/resume-from/package.json +4 -2
  15. package/node_modules/@herbertgao/sol-pi/package.json +6 -6
  16. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +99 -99
  17. package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
  18. package/node_modules/@tifan/pi-handoff/package.json +1 -1
  19. package/node_modules/@tifan/pi-handoff/src/index.ts +56 -26
  20. package/node_modules/@tifan/pi-mermaid-open/package.json +1 -1
  21. package/node_modules/@tifan/pi-preferred-thinking/package.json +1 -1
  22. package/node_modules/@tifan/pi-recap/package.json +1 -1
  23. package/node_modules/@tifan/pi-rename/package.json +1 -1
  24. package/node_modules/pi-antigravity/README.md +29 -6
  25. package/node_modules/pi-antigravity/package.json +14 -9
  26. package/node_modules/pi-antigravity/src/auth/accounts.ts +327 -0
  27. package/node_modules/pi-antigravity/src/auth/index.ts +9 -0
  28. package/node_modules/pi-antigravity/src/client/client.ts +1 -1
  29. package/node_modules/pi-antigravity/src/image/image.ts +4 -4
  30. package/node_modules/pi-antigravity/src/index.ts +203 -13
  31. package/node_modules/pi-antigravity/src/search/index.ts +1 -0
  32. package/node_modules/pi-antigravity/src/search/search.ts +325 -0
  33. package/node_modules/pi-antigravity/src/stream/stream.ts +191 -14
  34. package/node_modules/pi-antigravity/src/types/enums.ts +45 -36
  35. package/node_modules/pi-antigravity/src/types/types.ts +5 -12
  36. package/node_modules/pi-antigravity/src/utils/http.ts +7 -2
  37. package/node_modules/pi-antigravity/src/utils/util.ts +31 -3
  38. package/node_modules/pi-lens/package.json +158 -158
  39. package/node_modules/pi-multi-account/package.json +2 -2
  40. package/node_modules/pi-typesafe/README.md +3 -1
  41. package/node_modules/pi-typesafe/dist/auth.d.ts +9 -5
  42. package/node_modules/pi-typesafe/dist/auth.js +7 -3
  43. package/node_modules/pi-typesafe/dist/backends.d.ts +33 -3
  44. package/node_modules/pi-typesafe/dist/backends.js +95 -1
  45. package/node_modules/pi-typesafe/dist/client.d.ts +5 -5
  46. package/node_modules/pi-typesafe/dist/client.js +12 -9
  47. package/node_modules/pi-typesafe/dist/credentials.d.ts +14 -8
  48. package/node_modules/pi-typesafe/dist/credentials.js +10 -7
  49. package/node_modules/pi-typesafe/dist/errors.d.ts +2 -2
  50. package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
  51. package/node_modules/pi-typesafe/dist/index.js +1 -1
  52. package/node_modules/pi-typesafe/dist/login.d.ts +2 -2
  53. package/node_modules/pi-typesafe/dist/login.js +2 -2
  54. package/node_modules/pi-typesafe/package.json +6 -5
  55. package/node_modules/pi-web-access/CHANGELOG.md +72 -0
  56. package/node_modules/pi-web-access/README.md +34 -13
  57. package/node_modules/pi-web-access/chrome-cookies.ts +79 -25
  58. package/node_modules/pi-web-access/curator-page.ts +5 -1
  59. package/node_modules/pi-web-access/curator-server.ts +2 -0
  60. package/node_modules/pi-web-access/dist/index.js +1337 -1009
  61. package/node_modules/pi-web-access/exa.ts +20 -52
  62. package/node_modules/pi-web-access/extract.ts +41 -4
  63. package/node_modules/pi-web-access/gemini-search.ts +12 -4
  64. package/node_modules/pi-web-access/index.ts +29 -37
  65. package/node_modules/pi-web-access/openai-search.ts +35 -7
  66. package/node_modules/pi-web-access/package.json +8 -7
  67. package/node_modules/pi-web-access/page-query.ts +2 -2
  68. package/node_modules/pi-web-access/query-rewrite.ts +2 -3
  69. package/node_modules/pi-web-access/ssrf-protection.ts +27 -10
  70. package/node_modules/pi-web-access/storage.ts +48 -77
  71. package/node_modules/pi-web-access/summary-model-scope.ts +6 -77
  72. package/node_modules/pi-web-access/summary-review.ts +3 -4
  73. package/node_modules/pi-web-access/tavily.ts +67 -20
  74. package/node_modules/pi-web-access/tool-activation.ts +53 -33
  75. package/node_modules/pi-web-access/utils.ts +1 -1
  76. package/node_modules/pi-web-access/you.ts +164 -0
  77. package/node_modules/pi-web-access/zai.ts +161 -0
  78. package/node_modules/remote-pi/package.json +5 -1
  79. package/package.json +19 -31
  80. package/node_modules/pi-mcp-adapter/CHANGELOG.md +0 -1013
  81. package/node_modules/pi-mcp-adapter/LICENSE +0 -21
  82. package/node_modules/pi-mcp-adapter/OAUTH.md +0 -369
  83. package/node_modules/pi-mcp-adapter/README.md +0 -1021
  84. package/node_modules/pi-mcp-adapter/abort.ts +0 -34
  85. package/node_modules/pi-mcp-adapter/agent-dir.ts +0 -68
  86. package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +0 -416
  87. package/node_modules/pi-mcp-adapter/agent-plugin-provenance.ts +0 -36
  88. package/node_modules/pi-mcp-adapter/app-bridge.bundle.js +0 -67
  89. package/node_modules/pi-mcp-adapter/banner.png +0 -0
  90. package/node_modules/pi-mcp-adapter/bearer-command-resolver.ts +0 -193
  91. package/node_modules/pi-mcp-adapter/claude-plugin-loader.ts +0 -365
  92. package/node_modules/pi-mcp-adapter/cli.js +0 -454
  93. package/node_modules/pi-mcp-adapter/commands.ts +0 -861
  94. package/node_modules/pi-mcp-adapter/config.ts +0 -1565
  95. package/node_modules/pi-mcp-adapter/consent-manager.ts +0 -95
  96. package/node_modules/pi-mcp-adapter/direct-tool-surface.ts +0 -244
  97. package/node_modules/pi-mcp-adapter/direct-tools.ts +0 -428
  98. package/node_modules/pi-mcp-adapter/dist/abort.d.ts +0 -2
  99. package/node_modules/pi-mcp-adapter/dist/abort.js +0 -36
  100. package/node_modules/pi-mcp-adapter/dist/abort.js.map +0 -1
  101. package/node_modules/pi-mcp-adapter/dist/agent-dir.d.ts +0 -10
  102. package/node_modules/pi-mcp-adapter/dist/agent-dir.js +0 -63
  103. package/node_modules/pi-mcp-adapter/dist/agent-dir.js.map +0 -1
  104. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.d.ts +0 -8
  105. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js +0 -398
  106. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js.map +0 -1
  107. package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.d.ts +0 -1
  108. package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js +0 -31
  109. package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js.map +0 -1
  110. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.d.ts +0 -6
  111. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js +0 -194
  112. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js.map +0 -1
  113. package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.d.ts +0 -9
  114. package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js +0 -362
  115. package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js.map +0 -1
  116. package/node_modules/pi-mcp-adapter/dist/config.d.ts +0 -134
  117. package/node_modules/pi-mcp-adapter/dist/config.js +0 -1361
  118. package/node_modules/pi-mcp-adapter/dist/config.js.map +0 -1
  119. package/node_modules/pi-mcp-adapter/dist/consent-manager.d.ts +0 -18
  120. package/node_modules/pi-mcp-adapter/dist/consent-manager.js +0 -88
  121. package/node_modules/pi-mcp-adapter/dist/consent-manager.js.map +0 -1
  122. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.d.ts +0 -17
  123. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js +0 -316
  124. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js.map +0 -1
  125. package/node_modules/pi-mcp-adapter/dist/errors.d.ts +0 -131
  126. package/node_modules/pi-mcp-adapter/dist/errors.js +0 -278
  127. package/node_modules/pi-mcp-adapter/dist/errors.js.map +0 -1
  128. package/node_modules/pi-mcp-adapter/dist/http-ca.d.ts +0 -8
  129. package/node_modules/pi-mcp-adapter/dist/http-ca.js +0 -88
  130. package/node_modules/pi-mcp-adapter/dist/http-ca.js.map +0 -1
  131. package/node_modules/pi-mcp-adapter/dist/jev-client.d.ts +0 -14
  132. package/node_modules/pi-mcp-adapter/dist/jev-client.js +0 -367
  133. package/node_modules/pi-mcp-adapter/dist/jev-client.js.map +0 -1
  134. package/node_modules/pi-mcp-adapter/dist/jev-contracts.d.ts +0 -77
  135. package/node_modules/pi-mcp-adapter/dist/jev-contracts.js +0 -2
  136. package/node_modules/pi-mcp-adapter/dist/jev-contracts.js.map +0 -1
  137. package/node_modules/pi-mcp-adapter/dist/jev-key-store.d.ts +0 -51
  138. package/node_modules/pi-mcp-adapter/dist/jev-key-store.js +0 -205
  139. package/node_modules/pi-mcp-adapter/dist/jev-key-store.js.map +0 -1
  140. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.d.ts +0 -2
  141. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js +0 -68
  142. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js.map +0 -1
  143. package/node_modules/pi-mcp-adapter/dist/lifecycle.d.ts +0 -56
  144. package/node_modules/pi-mcp-adapter/dist/lifecycle.js +0 -410
  145. package/node_modules/pi-mcp-adapter/dist/lifecycle.js.map +0 -1
  146. package/node_modules/pi-mcp-adapter/dist/logger.d.ts +0 -51
  147. package/node_modules/pi-mcp-adapter/dist/logger.js +0 -131
  148. package/node_modules/pi-mcp-adapter/dist/logger.js.map +0 -1
  149. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.d.ts +0 -26
  150. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js +0 -103
  151. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js.map +0 -1
  152. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.d.ts +0 -118
  153. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js +0 -1097
  154. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js.map +0 -1
  155. package/node_modules/pi-mcp-adapter/dist/mcp-auth.d.ts +0 -170
  156. package/node_modules/pi-mcp-adapter/dist/mcp-auth.js +0 -1142
  157. package/node_modules/pi-mcp-adapter/dist/mcp-auth.js.map +0 -1
  158. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.d.ts +0 -24
  159. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js +0 -203
  160. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js.map +0 -1
  161. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.d.ts +0 -53
  162. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js +0 -441
  163. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js.map +0 -1
  164. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.d.ts +0 -148
  165. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js +0 -689
  166. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js.map +0 -1
  167. package/node_modules/pi-mcp-adapter/dist/mcp-probe.d.ts +0 -6
  168. package/node_modules/pi-mcp-adapter/dist/mcp-probe.js +0 -166
  169. package/node_modules/pi-mcp-adapter/dist/mcp-probe.js.map +0 -1
  170. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.d.ts +0 -102
  171. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js +0 -369
  172. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js.map +0 -1
  173. package/node_modules/pi-mcp-adapter/dist/mcp-trace.d.ts +0 -95
  174. package/node_modules/pi-mcp-adapter/dist/mcp-trace.js +0 -242
  175. package/node_modules/pi-mcp-adapter/dist/mcp-trace.js.map +0 -1
  176. package/node_modules/pi-mcp-adapter/dist/metadata-cache.d.ts +0 -19
  177. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +0 -301
  178. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +0 -1
  179. package/node_modules/pi-mcp-adapter/dist/npx-resolver.d.ts +0 -6
  180. package/node_modules/pi-mcp-adapter/dist/npx-resolver.js +0 -505
  181. package/node_modules/pi-mcp-adapter/dist/npx-resolver.js.map +0 -1
  182. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.d.ts +0 -2
  183. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js +0 -144
  184. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js.map +0 -1
  185. package/node_modules/pi-mcp-adapter/dist/request-headers-command.d.ts +0 -10
  186. package/node_modules/pi-mcp-adapter/dist/request-headers-command.js +0 -312
  187. package/node_modules/pi-mcp-adapter/dist/request-headers-command.js.map +0 -1
  188. package/node_modules/pi-mcp-adapter/dist/resource-tools.d.ts +0 -1
  189. package/node_modules/pi-mcp-adapter/dist/resource-tools.js +0 -15
  190. package/node_modules/pi-mcp-adapter/dist/resource-tools.js.map +0 -1
  191. package/node_modules/pi-mcp-adapter/dist/runtime-owner.d.ts +0 -13
  192. package/node_modules/pi-mcp-adapter/dist/runtime-owner.js +0 -97
  193. package/node_modules/pi-mcp-adapter/dist/runtime-owner.js.map +0 -1
  194. package/node_modules/pi-mcp-adapter/dist/sampling-handler.d.ts +0 -17
  195. package/node_modules/pi-mcp-adapter/dist/sampling-handler.js +0 -203
  196. package/node_modules/pi-mcp-adapter/dist/sampling-handler.js.map +0 -1
  197. package/node_modules/pi-mcp-adapter/dist/secure-keyring.d.ts +0 -11
  198. package/node_modules/pi-mcp-adapter/dist/secure-keyring.js +0 -172
  199. package/node_modules/pi-mcp-adapter/dist/secure-keyring.js.map +0 -1
  200. package/node_modules/pi-mcp-adapter/dist/server-manager.d.ts +0 -157
  201. package/node_modules/pi-mcp-adapter/dist/server-manager.js +0 -1745
  202. package/node_modules/pi-mcp-adapter/dist/server-manager.js.map +0 -1
  203. package/node_modules/pi-mcp-adapter/dist/session-approvals.d.ts +0 -34
  204. package/node_modules/pi-mcp-adapter/dist/session-approvals.js +0 -140
  205. package/node_modules/pi-mcp-adapter/dist/session-approvals.js.map +0 -1
  206. package/node_modules/pi-mcp-adapter/dist/session-recovery.d.ts +0 -26
  207. package/node_modules/pi-mcp-adapter/dist/session-recovery.js +0 -142
  208. package/node_modules/pi-mcp-adapter/dist/session-recovery.js.map +0 -1
  209. package/node_modules/pi-mcp-adapter/dist/state.d.ts +0 -73
  210. package/node_modules/pi-mcp-adapter/dist/state.js +0 -2
  211. package/node_modules/pi-mcp-adapter/dist/state.js.map +0 -1
  212. package/node_modules/pi-mcp-adapter/dist/types.d.ts +0 -642
  213. package/node_modules/pi-mcp-adapter/dist/types.js +0 -331
  214. package/node_modules/pi-mcp-adapter/dist/types.js.map +0 -1
  215. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.d.ts +0 -6
  216. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js +0 -37
  217. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js.map +0 -1
  218. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.d.ts +0 -17
  219. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js +0 -219
  220. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js.map +0 -1
  221. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.d.ts +0 -104
  222. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js +0 -59
  223. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js.map +0 -1
  224. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.d.ts +0 -4
  225. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js +0 -27
  226. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js.map +0 -1
  227. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.d.ts +0 -15
  228. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js +0 -85
  229. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js.map +0 -1
  230. package/node_modules/pi-mcp-adapter/dist/utils.d.ts +0 -41
  231. package/node_modules/pi-mcp-adapter/dist/utils.js +0 -417
  232. package/node_modules/pi-mcp-adapter/dist/utils.js.map +0 -1
  233. package/node_modules/pi-mcp-adapter/elicitation-handler.ts +0 -358
  234. package/node_modules/pi-mcp-adapter/error-signal.ts +0 -32
  235. package/node_modules/pi-mcp-adapter/errors.ts +0 -364
  236. package/node_modules/pi-mcp-adapter/examples/jev-accessibility-loop.mjs +0 -85
  237. package/node_modules/pi-mcp-adapter/examples/jev-semantic-filter.mjs +0 -34
  238. package/node_modules/pi-mcp-adapter/failure-backoff.ts +0 -23
  239. package/node_modules/pi-mcp-adapter/glimpse-ui.ts +0 -80
  240. package/node_modules/pi-mcp-adapter/host-html-template.ts +0 -515
  241. package/node_modules/pi-mcp-adapter/http-ca.ts +0 -84
  242. package/node_modules/pi-mcp-adapter/index.ts +0 -2106
  243. package/node_modules/pi-mcp-adapter/init.ts +0 -721
  244. package/node_modules/pi-mcp-adapter/jev-client.ts +0 -300
  245. package/node_modules/pi-mcp-adapter/jev-contracts.ts +0 -53
  246. package/node_modules/pi-mcp-adapter/jev-key-store.ts +0 -192
  247. package/node_modules/pi-mcp-adapter/json-schema-validator.ts +0 -83
  248. package/node_modules/pi-mcp-adapter/lazy-loader.ts +0 -7
  249. package/node_modules/pi-mcp-adapter/lifecycle.ts +0 -457
  250. package/node_modules/pi-mcp-adapter/logger.ts +0 -169
  251. package/node_modules/pi-mcp-adapter/mcp-auth-fetch.ts +0 -113
  252. package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +0 -1296
  253. package/node_modules/pi-mcp-adapter/mcp-auth.ts +0 -1287
  254. package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +0 -250
  255. package/node_modules/pi-mcp-adapter/mcp-callback-server.ts +0 -534
  256. package/node_modules/pi-mcp-adapter/mcp-code.ts +0 -495
  257. package/node_modules/pi-mcp-adapter/mcp-install.ts +0 -60
  258. package/node_modules/pi-mcp-adapter/mcp-keyring-helper.cjs +0 -89
  259. package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +0 -819
  260. package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +0 -511
  261. package/node_modules/pi-mcp-adapter/mcp-panel-theme.ts +0 -104
  262. package/node_modules/pi-mcp-adapter/mcp-panel.ts +0 -1099
  263. package/node_modules/pi-mcp-adapter/mcp-probe.ts +0 -201
  264. package/node_modules/pi-mcp-adapter/mcp-references.ts +0 -373
  265. package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +0 -137
  266. package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +0 -747
  267. package/node_modules/pi-mcp-adapter/mcp-status.ts +0 -105
  268. package/node_modules/pi-mcp-adapter/mcp-tasks.ts +0 -467
  269. package/node_modules/pi-mcp-adapter/mcp-trace.ts +0 -306
  270. package/node_modules/pi-mcp-adapter/metadata-cache.ts +0 -362
  271. package/node_modules/pi-mcp-adapter/namespace-tools.ts +0 -334
  272. package/node_modules/pi-mcp-adapter/npx-resolver.ts +0 -543
  273. package/node_modules/pi-mcp-adapter/oauth-handler.ts +0 -30
  274. package/node_modules/pi-mcp-adapter/oauth.ts +0 -52
  275. package/node_modules/pi-mcp-adapter/onboarding-state.ts +0 -76
  276. package/node_modules/pi-mcp-adapter/package-mcp-loader.ts +0 -156
  277. package/node_modules/pi-mcp-adapter/package.json +0 -219
  278. package/node_modules/pi-mcp-adapter/panel-keys.ts +0 -53
  279. package/node_modules/pi-mcp-adapter/prompts.ts +0 -385
  280. package/node_modules/pi-mcp-adapter/proxy-modes.ts +0 -1735
  281. package/node_modules/pi-mcp-adapter/request-headers-command.ts +0 -333
  282. package/node_modules/pi-mcp-adapter/resource-tools.ts +0 -17
  283. package/node_modules/pi-mcp-adapter/runtime-owner.ts +0 -106
  284. package/node_modules/pi-mcp-adapter/sampling-handler.ts +0 -261
  285. package/node_modules/pi-mcp-adapter/sandbox-proxy-template.ts +0 -144
  286. package/node_modules/pi-mcp-adapter/search-ranking.ts +0 -309
  287. package/node_modules/pi-mcp-adapter/secure-keyring.ts +0 -170
  288. package/node_modules/pi-mcp-adapter/semantic-search.ts +0 -186
  289. package/node_modules/pi-mcp-adapter/server-manager.ts +0 -2088
  290. package/node_modules/pi-mcp-adapter/session-approvals.ts +0 -201
  291. package/node_modules/pi-mcp-adapter/session-recovery.ts +0 -158
  292. package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +0 -49
  293. package/node_modules/pi-mcp-adapter/state.ts +0 -71
  294. package/node_modules/pi-mcp-adapter/tool-approval.ts +0 -205
  295. package/node_modules/pi-mcp-adapter/tool-metadata.ts +0 -302
  296. package/node_modules/pi-mcp-adapter/tool-registrar.ts +0 -255
  297. package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +0 -573
  298. package/node_modules/pi-mcp-adapter/ts-shape.ts +0 -149
  299. package/node_modules/pi-mcp-adapter/types.ts +0 -1120
  300. package/node_modules/pi-mcp-adapter/ui-app-bridge-helpers.ts +0 -40
  301. package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +0 -266
  302. package/node_modules/pi-mcp-adapter/ui-server.ts +0 -993
  303. package/node_modules/pi-mcp-adapter/ui-session.ts +0 -624
  304. package/node_modules/pi-mcp-adapter/ui-stream-types.ts +0 -89
  305. package/node_modules/pi-mcp-adapter/ui-tool-visibility.ts +0 -25
  306. package/node_modules/pi-mcp-adapter/unix-socket-transport.ts +0 -85
  307. package/node_modules/pi-mcp-adapter/utils.ts +0 -464
@@ -1,410 +0,0 @@
1
- import { SdkError, SdkErrorCode } from "@modelcontextprotocol/client";
2
- import { isServerDisabled } from "./types.js";
3
- import { isTransientHttpConnectError, isUnauthorizedHttpError, } from "./server-manager.js";
4
- import { hasPendingAuth } from "./mcp-auth-flow.js";
5
- import { logger } from "./logger.js";
6
- import { formatTerminalError, parallelLimit, sanitizeTerminalText } from "./utils.js";
7
- import { isTerminatedSession } from "./session-recovery.js";
8
- const KEEP_ALIVE_RETRY_BASE_MS = 30_000;
9
- const KEEP_ALIVE_RETRY_MAX_MS = 5 * 60_000;
10
- const KEEP_ALIVE_CHECK_CONCURRENCY = 10;
11
- export class McpLifecycleManager {
12
- manager;
13
- hasPendingAuthForServer;
14
- keepAliveServers = new Map();
15
- allServers = new Map();
16
- serverSettings = new Map();
17
- globalIdleTimeout = 10 * 60 * 1000;
18
- healthCheckInterval;
19
- onReconnect;
20
- onReconnectFailure;
21
- onHealthRestored;
22
- onAuthRequired;
23
- onIdleShutdown;
24
- activeHealthCheck;
25
- activeConvergence;
26
- shutdownPromise;
27
- retryStates = new Map();
28
- pendingMetadataPublications = new Set();
29
- stopped = false;
30
- removeHealthAbortListener;
31
- constructor(manager, hasPendingAuthForServer = hasPendingAuth) {
32
- this.manager = manager;
33
- this.hasPendingAuthForServer = hasPendingAuthForServer;
34
- }
35
- setReconnectCallback(callback) {
36
- this.onReconnect = callback;
37
- }
38
- setReconnectFailureCallback(callback) {
39
- this.onReconnectFailure = callback;
40
- }
41
- setHealthRestoredCallback(callback) {
42
- this.onHealthRestored = callback;
43
- }
44
- setAuthRequiredCallback(callback) {
45
- this.onAuthRequired = callback;
46
- }
47
- markKeepAlive(name, definition) {
48
- if (isServerDisabled(definition))
49
- return;
50
- this.keepAliveServers.set(name, definition);
51
- }
52
- registerServer(name, definition, settings) {
53
- if (isServerDisabled(definition))
54
- return;
55
- this.allServers.set(name, definition);
56
- if (settings?.idleTimeout !== undefined)
57
- this.serverSettings.set(name, settings);
58
- }
59
- unregisterServer(name) {
60
- this.allServers.delete(name);
61
- this.keepAliveServers.delete(name);
62
- this.serverSettings.delete(name);
63
- this.retryStates.delete(name);
64
- this.pendingMetadataPublications.delete(name);
65
- }
66
- setGlobalIdleTimeout(minutes) {
67
- this.globalIdleTimeout = minutes * 60 * 1000;
68
- }
69
- setIdleShutdownCallback(callback) {
70
- this.onIdleShutdown = callback;
71
- }
72
- startHealthChecks(signalOrInterval, maybeIntervalMs = 30000) {
73
- const signal = typeof signalOrInterval === "number" ? undefined : signalOrInterval;
74
- const intervalMs = typeof signalOrInterval === "number" ? signalOrInterval : maybeIntervalMs;
75
- this.stopped = false;
76
- if (signal?.aborted) {
77
- this.stopped = true;
78
- return;
79
- }
80
- const stop = () => {
81
- this.stopped = true;
82
- if (this.healthCheckInterval)
83
- clearInterval(this.healthCheckInterval);
84
- this.healthCheckInterval = undefined;
85
- };
86
- signal?.addEventListener("abort", stop, { once: true });
87
- this.removeHealthAbortListener = () => signal?.removeEventListener("abort", stop);
88
- this.healthCheckInterval = setInterval(() => {
89
- if (this.stopped || signal?.aborted || this.activeHealthCheck)
90
- return;
91
- const check = this.checkConnections(signal)
92
- .catch(error => {
93
- console.error(`MCP: Health check failed: ${formatTerminalError(error)}`);
94
- })
95
- .finally(() => {
96
- if (this.activeHealthCheck === check)
97
- this.activeHealthCheck = undefined;
98
- });
99
- this.activeHealthCheck = check;
100
- }, intervalMs);
101
- this.healthCheckInterval.unref();
102
- }
103
- async ensureConverged(signal) {
104
- if (this.stopped || signal?.aborted)
105
- return;
106
- if (this.activeConvergence)
107
- return this.activeConvergence;
108
- const check = this.checkKeepAliveConnections(signal);
109
- this.activeConvergence = check;
110
- try {
111
- await check;
112
- }
113
- finally {
114
- if (this.activeConvergence === check)
115
- this.activeConvergence = undefined;
116
- }
117
- }
118
- async checkConnections(signal) {
119
- if (this.stopped || signal?.aborted)
120
- return;
121
- await this.ensureConverged(signal);
122
- if (this.stopped || signal?.aborted)
123
- return;
124
- for (const [name] of this.allServers) {
125
- if (this.keepAliveServers.has(name))
126
- continue;
127
- const timeout = this.getIdleTimeout(name);
128
- if (timeout > 0 && this.manager.isIdle(name, timeout)) {
129
- await this.manager.close(name);
130
- if (this.stopped || signal?.aborted)
131
- return;
132
- this.onIdleShutdown?.(name);
133
- }
134
- }
135
- }
136
- async checkKeepAliveConnections(signal) {
137
- if (this.stopped || signal?.aborted)
138
- return;
139
- await parallelLimit([...this.keepAliveServers], KEEP_ALIVE_CHECK_CONCURRENCY, ([name, definition]) => this.checkKeepAliveConnection(name, definition, signal));
140
- }
141
- async checkKeepAliveConnection(name, definition, signal, retrySuperseded = true) {
142
- if (isServerDisabled(definition) || this.stopped || signal?.aborted)
143
- return;
144
- // Fence against unregisterServer racing an in-flight convergence pass.
145
- // Identity comparison also rejects stale passes after a same-name
146
- // replacement registration, which a name check would wrongly accept.
147
- if (this.keepAliveServers.get(name) !== definition)
148
- return;
149
- const connection = this.manager.getConnection(name);
150
- if (connection?.status === "needs-auth") {
151
- this.pendingMetadataPublications.delete(name);
152
- return;
153
- }
154
- if (!this.shouldAttemptConnection(name, connection))
155
- return;
156
- if (!connection || connection.status !== "connected") {
157
- if (this.hasPendingAuthForServer(name)) {
158
- logger.debug(`Skipping reconnect for ${name} while OAuth authorization is pending`);
159
- return;
160
- }
161
- let freshConnection;
162
- try {
163
- freshConnection = await this.manager.connect(name, definition, signal);
164
- }
165
- catch (error) {
166
- if (this.stopped || signal?.aborted)
167
- return;
168
- this.reportConnectionFailure(name, definition, error, "reconnect", this.manager.getConnection(name));
169
- return;
170
- }
171
- if (this.stopped || signal?.aborted)
172
- return;
173
- if (freshConnection.status === "needs-auth") {
174
- await this.notifyAuthRequired(name, definition, freshConnection);
175
- return;
176
- }
177
- if (freshConnection.status !== "connected") {
178
- this.reportConnectionFailure(name, definition, new Error(`MCP server ${name} did not return a connected session`), "reconnect", freshConnection);
179
- return;
180
- }
181
- logger.debug(`Reconnected to ${name}`);
182
- await this.publishConnectedMetadata(name, definition, freshConnection);
183
- return;
184
- }
185
- if (this.pendingMetadataPublications.has(name)) {
186
- await this.publishConnectedMetadata(name, definition, connection);
187
- return;
188
- }
189
- if (!definition.url)
190
- return;
191
- const hadSessionId = connection.transport?.sessionId != null;
192
- let refreshResult;
193
- try {
194
- refreshResult = await this.manager.refreshTools(name, connection, signal);
195
- }
196
- catch (error) {
197
- if (this.stopped || signal?.aborted)
198
- return;
199
- const current = this.manager.getConnection(name);
200
- if (current !== connection || connection.status !== "connected") {
201
- await this.handleSupersededConnection(name, definition, connection, signal, retrySuperseded);
202
- return;
203
- }
204
- if (!shouldReconnectAfterRefresh(error, hadSessionId, definition)) {
205
- this.reportConnectionFailure(name, definition, error, "refresh", connection);
206
- return;
207
- }
208
- if (this.hasPendingAuthForServer(name)) {
209
- logger.debug(`Skipping reconnect for ${name} while OAuth authorization is pending`);
210
- return;
211
- }
212
- let freshConnection;
213
- try {
214
- freshConnection = await this.manager.reconnect(name, definition, connection, signal);
215
- }
216
- catch (reconnectError) {
217
- if (this.stopped || signal?.aborted)
218
- return;
219
- this.reportConnectionFailure(name, definition, reconnectError, "reconnect", this.manager.getConnection(name));
220
- return;
221
- }
222
- if (this.stopped || signal?.aborted)
223
- return;
224
- if (freshConnection.status === "needs-auth") {
225
- await this.notifyAuthRequired(name, definition, freshConnection);
226
- return;
227
- }
228
- if (freshConnection.status !== "connected") {
229
- this.reportConnectionFailure(name, definition, new Error(`MCP server ${name} did not return a connected session`), "reconnect", freshConnection);
230
- return;
231
- }
232
- logger.debug(`Reconnected stale MCP session for ${name}`);
233
- await this.publishConnectedMetadata(name, definition, freshConnection);
234
- return;
235
- }
236
- if (refreshResult === "superseded") {
237
- await this.handleSupersededConnection(name, definition, connection, signal, retrySuperseded);
238
- return;
239
- }
240
- if (refreshResult === "refresh-timeout") {
241
- this.deferRefreshTimeout(name, definition, connection);
242
- return;
243
- }
244
- if (this.keepAliveServers.get(name) !== definition)
245
- return;
246
- if (this.retryStates.delete(name)) {
247
- await this.onHealthRestored?.(name);
248
- }
249
- }
250
- async handleSupersededConnection(name, definition, staleConnection, signal, retrySuperseded) {
251
- const current = this.manager.getConnection(name);
252
- if (this.keepAliveServers.get(name) !== definition)
253
- return;
254
- if (current === staleConnection && current.status === "connected") {
255
- if (this.retryStates.delete(name))
256
- await this.onHealthRestored?.(name);
257
- return;
258
- }
259
- if (current?.status === "connected") {
260
- await this.publishConnectedMetadata(name, definition, current);
261
- return;
262
- }
263
- if (current?.status === "needs-auth") {
264
- await this.notifyAuthRequired(name, definition, current);
265
- return;
266
- }
267
- if (retrySuperseded) {
268
- await this.checkKeepAliveConnection(name, definition, signal, false);
269
- }
270
- }
271
- async publishConnectedMetadata(name, definition, connection) {
272
- // Fence stale convergence passes by definition identity so disposal, and
273
- // disposal followed by a same-name replacement, never re-track this
274
- // server. Close the pass's own connection only when it is still current,
275
- // so a replacement's connection is never touched.
276
- if (this.keepAliveServers.get(name) !== definition) {
277
- if (this.manager.getConnection(name) === connection)
278
- await this.manager.close(name);
279
- return;
280
- }
281
- this.pendingMetadataPublications.add(name);
282
- try {
283
- await this.onReconnect?.(name);
284
- this.pendingMetadataPublications.delete(name);
285
- this.retryStates.delete(name);
286
- }
287
- catch (error) {
288
- if (this.stopped)
289
- return;
290
- this.reportConnectionFailure(name, definition, error, "publish", connection);
291
- }
292
- }
293
- async notifyAuthRequired(name, definition, connection) {
294
- // Fence stale convergence passes by definition identity. Close the
295
- // leftover needs-auth connection only while it is still the manager's
296
- // current entry, so a replacement's connection is never touched and the
297
- // stale client/transport cannot leak when a replacement connects later.
298
- if (this.keepAliveServers.get(name) !== definition) {
299
- if (this.manager.getConnection(name) === connection)
300
- await this.manager.close(name);
301
- return;
302
- }
303
- this.pendingMetadataPublications.delete(name);
304
- this.retryStates.delete(name);
305
- try {
306
- await this.onAuthRequired?.(name);
307
- }
308
- catch (error) {
309
- const message = error instanceof Error ? error.message : String(error);
310
- logger.debug(`MCP: auth-required callback failed for ${name}: ${sanitizeTerminalText(message)}`);
311
- }
312
- }
313
- shouldAttemptConnection(name, connection) {
314
- const retry = this.retryStates.get(name);
315
- if (!retry)
316
- return true;
317
- if (retry.connection !== connection || retry.status !== connection?.status) {
318
- this.retryStates.delete(name);
319
- return true;
320
- }
321
- return Date.now() >= retry.nextAttemptAt;
322
- }
323
- connectionFailureTarget(action, name) {
324
- if (action === "reconnect")
325
- return `reconnect to ${name}`;
326
- if (action === "publish")
327
- return `publish metadata for ${name}`;
328
- return `refresh ${name}`;
329
- }
330
- reportConnectionFailure(name, definition, error, action, connection) {
331
- if (!this.recordRetry(name, definition, connection))
332
- return;
333
- this.onReconnectFailure?.(name, error);
334
- if (isTransientHttpConnectError(error))
335
- return;
336
- const retry = this.retryStates.get(name);
337
- if (retry?.warningReported)
338
- return;
339
- if (retry)
340
- retry.warningReported = true;
341
- const message = error instanceof Error ? error.message : String(error);
342
- console.error(`MCP: Failed to ${this.connectionFailureTarget(action, name)}: ${sanitizeTerminalText(message)}`);
343
- }
344
- deferRefreshTimeout(name, definition, connection) {
345
- if (!this.recordRetry(name, definition, connection))
346
- return;
347
- logger.debug(`MCP: keep-alive tools/list refresh timed out for ${name}; retrying after backoff`);
348
- }
349
- recordRetry(name, definition, connection) {
350
- // Do not recreate retry/failure state from a stale convergence pass after
351
- // disposal or a same-name replacement registration.
352
- if (this.keepAliveServers.get(name) !== definition)
353
- return false;
354
- const previous = this.retryStates.get(name);
355
- const attempts = (previous?.attempts ?? 0) + 1;
356
- const delay = Math.min(KEEP_ALIVE_RETRY_BASE_MS * 2 ** Math.min(attempts - 1, 10), KEEP_ALIVE_RETRY_MAX_MS);
357
- this.retryStates.set(name, {
358
- attempts,
359
- nextAttemptAt: Date.now() + delay,
360
- connection,
361
- status: connection?.status,
362
- warningReported: previous?.warningReported ?? false,
363
- });
364
- return true;
365
- }
366
- getIdleTimeout(name) {
367
- const perServer = this.serverSettings.get(name)?.idleTimeout;
368
- if (perServer !== undefined)
369
- return perServer * 60 * 1000;
370
- return this.globalIdleTimeout;
371
- }
372
- async gracefulShutdown() {
373
- if (this.shutdownPromise)
374
- return this.shutdownPromise;
375
- this.shutdownPromise = this.shutdownOnce();
376
- return this.shutdownPromise;
377
- }
378
- async shutdownOnce() {
379
- this.stopped = true;
380
- if (this.healthCheckInterval)
381
- clearInterval(this.healthCheckInterval);
382
- this.healthCheckInterval = undefined;
383
- this.removeHealthAbortListener?.();
384
- this.removeHealthAbortListener = undefined;
385
- await this.activeHealthCheck;
386
- this.activeHealthCheck = undefined;
387
- await this.activeConvergence;
388
- this.activeConvergence = undefined;
389
- this.onReconnect = undefined;
390
- this.onReconnectFailure = undefined;
391
- this.onHealthRestored = undefined;
392
- this.onAuthRequired = undefined;
393
- this.onIdleShutdown = undefined;
394
- this.retryStates.clear();
395
- this.pendingMetadataPublications.clear();
396
- if (typeof this.manager.closeAll === "function") {
397
- await this.manager.closeAll();
398
- }
399
- }
400
- }
401
- function shouldReconnectAfterRefresh(error, hadSessionId, definition) {
402
- if (isTerminatedSession(error, hadSessionId))
403
- return true;
404
- // Reconnect baked bearer sources so connect-time resolution runs again.
405
- if (definition.auth === "bearer" && isUnauthorizedHttpError(error))
406
- return true;
407
- return error instanceof SdkError
408
- && (error.code === SdkErrorCode.NotConnected || error.code === SdkErrorCode.ConnectionClosed);
409
- }
410
- //# sourceMappingURL=lifecycle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAyB,MAAM,YAAY,CAAC;AACrE,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,GAGxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAA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,iBAAiB,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,2BAA2B,CAAC,KAAK,EAAE,CAAC;QACzC,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;YAChD,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;CACF;AAED,SAAS,2BAA2B,CAClC,KAAc,EACd,YAAqB,EACrB,UAA4B;IAE5B,IAAI,mBAAmB,CAAC,KAAK,EAAE,YAAY,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1D,wEAAwE;IACxE,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ,IAAI,uBAAuB,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAChF,OAAO,KAAK,YAAY,QAAQ;WAC3B,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAClG,CAAC"}
@@ -1,51 +0,0 @@
1
- /**
2
- * Centralized logging for MCP UI operations.
3
- * Provides structured, contextual logs with levels.
4
- */
5
- export type LogLevel = "debug" | "info" | "warn" | "error";
6
- export interface LogContext {
7
- server?: string;
8
- session?: string;
9
- tool?: string;
10
- uri?: string;
11
- [key: string]: unknown;
12
- }
13
- export interface LogEntry {
14
- level: LogLevel;
15
- message: string;
16
- context?: LogContext;
17
- error?: Error;
18
- timestamp: Date;
19
- }
20
- type LogHandler = (entry: LogEntry) => void;
21
- declare class Logger {
22
- private minLevel;
23
- private handlers;
24
- private defaultContext;
25
- setLevel(level: LogLevel): void;
26
- setDefaultContext(context: LogContext): void;
27
- addHandler(handler: LogHandler): void;
28
- clearHandlers(): void;
29
- private shouldLog;
30
- private emit;
31
- debug(message: string, context?: LogContext): void;
32
- info(message: string, context?: LogContext): void;
33
- warn(message: string, context?: LogContext): void;
34
- error(message: string, error?: Error, context?: LogContext): void;
35
- /**
36
- * Create a child logger with additional default context.
37
- */
38
- child(context: LogContext): ChildLogger;
39
- }
40
- declare class ChildLogger {
41
- private parent;
42
- private context;
43
- constructor(parent: Logger, context: LogContext);
44
- debug(message: string, context?: LogContext): void;
45
- info(message: string, context?: LogContext): void;
46
- warn(message: string, context?: LogContext): void;
47
- error(message: string, error?: Error, context?: LogContext): void;
48
- child(context: LogContext): ChildLogger;
49
- }
50
- export declare const logger: Logger;
51
- export {};
@@ -1,131 +0,0 @@
1
- /**
2
- * Centralized logging for MCP UI operations.
3
- * Provides structured, contextual logs with levels.
4
- */
5
- const LEVEL_PRIORITY = {
6
- debug: 0,
7
- info: 1,
8
- warn: 2,
9
- error: 3,
10
- };
11
- const LEVEL_PREFIX = {
12
- debug: "[MCP-UI:DEBUG]",
13
- info: "[MCP-UI]",
14
- warn: "[MCP-UI:WARN]",
15
- error: "[MCP-UI:ERROR]",
16
- };
17
- class Logger {
18
- minLevel = "info";
19
- handlers = [];
20
- defaultContext = {};
21
- setLevel(level) {
22
- this.minLevel = level;
23
- }
24
- setDefaultContext(context) {
25
- this.defaultContext = context;
26
- }
27
- addHandler(handler) {
28
- this.handlers.push(handler);
29
- }
30
- clearHandlers() {
31
- this.handlers = [];
32
- }
33
- shouldLog(level) {
34
- return LEVEL_PRIORITY[level] >= LEVEL_PRIORITY[this.minLevel];
35
- }
36
- emit(level, message, context, error) {
37
- if (!this.shouldLog(level))
38
- return;
39
- const entry = {
40
- level,
41
- message,
42
- context: { ...this.defaultContext, ...context },
43
- ...(error !== undefined ? { error } : {}),
44
- timestamp: new Date(),
45
- };
46
- // Default console output
47
- const prefix = LEVEL_PREFIX[level];
48
- const contextStr = formatContext(entry.context);
49
- const fullMessage = contextStr ? `${prefix} ${message} ${contextStr}` : `${prefix} ${message}`;
50
- if (level === "error") {
51
- console.error(fullMessage, error ?? "");
52
- }
53
- else if (level === "warn") {
54
- console.warn(fullMessage);
55
- }
56
- else if (level === "debug") {
57
- console.debug(fullMessage);
58
- }
59
- else {
60
- console.log(fullMessage);
61
- }
62
- // Custom handlers
63
- for (const handler of this.handlers) {
64
- try {
65
- handler(entry);
66
- }
67
- catch {
68
- // Ignore handler errors
69
- }
70
- }
71
- }
72
- debug(message, context) {
73
- this.emit("debug", message, context);
74
- }
75
- info(message, context) {
76
- this.emit("info", message, context);
77
- }
78
- warn(message, context) {
79
- this.emit("warn", message, context);
80
- }
81
- error(message, error, context) {
82
- this.emit("error", message, context, error);
83
- }
84
- /**
85
- * Create a child logger with additional default context.
86
- */
87
- child(context) {
88
- return new ChildLogger(this, context);
89
- }
90
- }
91
- class ChildLogger {
92
- parent;
93
- context;
94
- constructor(parent, context) {
95
- this.parent = parent;
96
- this.context = context;
97
- }
98
- debug(message, context) {
99
- this.parent.debug(message, { ...this.context, ...context });
100
- }
101
- info(message, context) {
102
- this.parent.info(message, { ...this.context, ...context });
103
- }
104
- warn(message, context) {
105
- this.parent.warn(message, { ...this.context, ...context });
106
- }
107
- error(message, error, context) {
108
- this.parent.error(message, error, { ...this.context, ...context });
109
- }
110
- child(context) {
111
- return new ChildLogger(this.parent, { ...this.context, ...context });
112
- }
113
- }
114
- function formatContext(context) {
115
- if (!context || Object.keys(context).length === 0)
116
- return "";
117
- const parts = [];
118
- for (const [key, value] of Object.entries(context)) {
119
- if (value !== undefined && value !== null) {
120
- parts.push(`${key}=${typeof value === "string" ? value : JSON.stringify(value)}`);
121
- }
122
- }
123
- return parts.length > 0 ? `(${parts.join(", ")})` : "";
124
- }
125
- // Singleton instance
126
- export const logger = new Logger();
127
- // Enable debug mode via environment variable
128
- if (process.env.MCP_UI_DEBUG === "1" || process.env.MCP_UI_DEBUG === "true") {
129
- logger.setLevel("debug");
130
- }
131
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,MAAM,cAAc,GAA6B;IAC/C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,YAAY,GAA6B;IAC7C,KAAK,EAAE,gBAAgB;IACvB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEF,MAAM,MAAM;IACF,QAAQ,GAAa,MAAM,CAAC;IAC5B,QAAQ,GAAiB,EAAE,CAAC;IAC5B,cAAc,GAAe,EAAE,CAAC;IAExC,QAAQ,CAAC,KAAe;QACtB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,iBAAiB,CAAC,OAAmB;QACnC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,UAAU,CAAC,OAAmB;QAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,aAAa;QACX,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,CAAC;IAEO,SAAS,CAAC,KAAe;QAC/B,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC;IAEO,IAAI,CAAC,KAAe,EAAE,OAAe,EAAE,OAAoB,EAAE,KAAa;QAChF,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;YAAE,OAAO;QAEnC,MAAM,KAAK,GAAa;YACtB,KA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C;AAC3B,CAAC"}
@@ -1,26 +0,0 @@
1
- import type { FetchLike } from "@modelcontextprotocol/client";
2
- /**
3
- * Resolve only at a connection/authentication boundary, never during config discovery.
4
- * TypeError is fatal to the native SDK's fresh and cached discovery paths; ordinary
5
- * errors can be swallowed and allow authentication to continue without credentials.
6
- */
7
- type OAuthHeaderOptions = {
8
- commands?: boolean;
9
- literal?: boolean;
10
- };
11
- export declare function resolveOAuthHeaders(values: Record<string, string> | undefined, options?: OAuthHeaderOptions): Headers;
12
- export type OAuthFetch = FetchLike & {
13
- throwIfHeaderResolutionFailed(): void;
14
- };
15
- /**
16
- * Configured service headers belong only to the configured MCP origin, not to
17
- * discovered issuers. SDK request headers win (notably Authorization and MIME
18
- * types). Credential-bearing redirects fail closed, including same-origin ones.
19
- */
20
- export declare function createOAuthFetch(serverUrl: string, getHeaders?: () => Headers, signal?: AbortSignal, options?: {
21
- timeout?: boolean;
22
- delegate?: FetchLike;
23
- }): OAuthFetch;
24
- /** Cache success or failure only in the owning auth leg/connection, never in storage. */
25
- export declare function oauthHeaderResolver(values: Record<string, string> | undefined, options?: Pick<OAuthHeaderOptions, "literal">): () => Headers;
26
- export {};