@herbertgao/pi-extensions 2026.9.16 → 2026.9.18

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 (267) hide show
  1. package/README.md +14 -15
  2. package/node_modules/@herbertgao/pi-bark/package.json +2 -2
  3. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +4 -1
  4. package/node_modules/@herbertgao/pi-cc-extensions/README.md +4 -1
  5. package/node_modules/@herbertgao/pi-cc-extensions/package.json +75 -75
  6. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  7. package/node_modules/@herbertgao/pi-subagents/package.json +7 -7
  8. package/node_modules/@herbertgao/resume-from/package.json +4 -2
  9. package/node_modules/@herbertgao/sol-pi/package.json +6 -6
  10. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +11 -53
  11. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +99 -99
  12. package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
  13. package/node_modules/@tifan/pi-handoff/package.json +1 -1
  14. package/node_modules/@tifan/pi-handoff/src/index.ts +56 -26
  15. package/node_modules/@tifan/pi-mermaid-open/package.json +1 -1
  16. package/node_modules/@tifan/pi-preferred-thinking/package.json +1 -1
  17. package/node_modules/@tifan/pi-recap/package.json +1 -1
  18. package/node_modules/@tifan/pi-rename/package.json +1 -1
  19. package/node_modules/pi-antigravity/package.json +2 -2
  20. package/node_modules/pi-lens/package.json +158 -158
  21. package/node_modules/pi-multi-account/package.json +2 -2
  22. package/node_modules/pi-typesafe/README.md +1 -1
  23. package/node_modules/pi-typesafe/dist/auth.d.ts +9 -5
  24. package/node_modules/pi-typesafe/dist/auth.js +7 -3
  25. package/node_modules/pi-typesafe/dist/backends.d.ts +33 -3
  26. package/node_modules/pi-typesafe/dist/backends.js +95 -1
  27. package/node_modules/pi-typesafe/dist/client.d.ts +5 -5
  28. package/node_modules/pi-typesafe/dist/client.js +12 -9
  29. package/node_modules/pi-typesafe/dist/credentials.d.ts +14 -8
  30. package/node_modules/pi-typesafe/dist/credentials.js +10 -7
  31. package/node_modules/pi-typesafe/dist/errors.d.ts +2 -2
  32. package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
  33. package/node_modules/pi-typesafe/dist/index.js +1 -1
  34. package/node_modules/pi-typesafe/dist/login.d.ts +2 -2
  35. package/node_modules/pi-typesafe/dist/login.js +2 -2
  36. package/node_modules/pi-typesafe/package.json +5 -5
  37. package/node_modules/pi-web-access/package.json +2 -2
  38. package/node_modules/remote-pi/package.json +5 -1
  39. package/package.json +16 -28
  40. package/node_modules/pi-mcp-adapter/CHANGELOG.md +0 -1013
  41. package/node_modules/pi-mcp-adapter/LICENSE +0 -21
  42. package/node_modules/pi-mcp-adapter/OAUTH.md +0 -369
  43. package/node_modules/pi-mcp-adapter/README.md +0 -1021
  44. package/node_modules/pi-mcp-adapter/abort.ts +0 -34
  45. package/node_modules/pi-mcp-adapter/agent-dir.ts +0 -68
  46. package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +0 -416
  47. package/node_modules/pi-mcp-adapter/agent-plugin-provenance.ts +0 -36
  48. package/node_modules/pi-mcp-adapter/app-bridge.bundle.js +0 -67
  49. package/node_modules/pi-mcp-adapter/banner.png +0 -0
  50. package/node_modules/pi-mcp-adapter/bearer-command-resolver.ts +0 -193
  51. package/node_modules/pi-mcp-adapter/claude-plugin-loader.ts +0 -365
  52. package/node_modules/pi-mcp-adapter/cli.js +0 -454
  53. package/node_modules/pi-mcp-adapter/commands.ts +0 -861
  54. package/node_modules/pi-mcp-adapter/config.ts +0 -1565
  55. package/node_modules/pi-mcp-adapter/consent-manager.ts +0 -95
  56. package/node_modules/pi-mcp-adapter/direct-tool-surface.ts +0 -244
  57. package/node_modules/pi-mcp-adapter/direct-tools.ts +0 -428
  58. package/node_modules/pi-mcp-adapter/dist/abort.d.ts +0 -2
  59. package/node_modules/pi-mcp-adapter/dist/abort.js +0 -36
  60. package/node_modules/pi-mcp-adapter/dist/abort.js.map +0 -1
  61. package/node_modules/pi-mcp-adapter/dist/agent-dir.d.ts +0 -10
  62. package/node_modules/pi-mcp-adapter/dist/agent-dir.js +0 -63
  63. package/node_modules/pi-mcp-adapter/dist/agent-dir.js.map +0 -1
  64. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.d.ts +0 -8
  65. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js +0 -398
  66. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js.map +0 -1
  67. package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.d.ts +0 -1
  68. package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js +0 -31
  69. package/node_modules/pi-mcp-adapter/dist/agent-plugin-provenance.js.map +0 -1
  70. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.d.ts +0 -6
  71. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js +0 -194
  72. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js.map +0 -1
  73. package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.d.ts +0 -9
  74. package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js +0 -362
  75. package/node_modules/pi-mcp-adapter/dist/claude-plugin-loader.js.map +0 -1
  76. package/node_modules/pi-mcp-adapter/dist/config.d.ts +0 -134
  77. package/node_modules/pi-mcp-adapter/dist/config.js +0 -1361
  78. package/node_modules/pi-mcp-adapter/dist/config.js.map +0 -1
  79. package/node_modules/pi-mcp-adapter/dist/consent-manager.d.ts +0 -18
  80. package/node_modules/pi-mcp-adapter/dist/consent-manager.js +0 -88
  81. package/node_modules/pi-mcp-adapter/dist/consent-manager.js.map +0 -1
  82. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.d.ts +0 -17
  83. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js +0 -316
  84. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js.map +0 -1
  85. package/node_modules/pi-mcp-adapter/dist/errors.d.ts +0 -131
  86. package/node_modules/pi-mcp-adapter/dist/errors.js +0 -278
  87. package/node_modules/pi-mcp-adapter/dist/errors.js.map +0 -1
  88. package/node_modules/pi-mcp-adapter/dist/http-ca.d.ts +0 -8
  89. package/node_modules/pi-mcp-adapter/dist/http-ca.js +0 -88
  90. package/node_modules/pi-mcp-adapter/dist/http-ca.js.map +0 -1
  91. package/node_modules/pi-mcp-adapter/dist/jev-client.d.ts +0 -14
  92. package/node_modules/pi-mcp-adapter/dist/jev-client.js +0 -367
  93. package/node_modules/pi-mcp-adapter/dist/jev-client.js.map +0 -1
  94. package/node_modules/pi-mcp-adapter/dist/jev-contracts.d.ts +0 -77
  95. package/node_modules/pi-mcp-adapter/dist/jev-contracts.js +0 -2
  96. package/node_modules/pi-mcp-adapter/dist/jev-contracts.js.map +0 -1
  97. package/node_modules/pi-mcp-adapter/dist/jev-key-store.d.ts +0 -51
  98. package/node_modules/pi-mcp-adapter/dist/jev-key-store.js +0 -205
  99. package/node_modules/pi-mcp-adapter/dist/jev-key-store.js.map +0 -1
  100. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.d.ts +0 -2
  101. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js +0 -68
  102. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js.map +0 -1
  103. package/node_modules/pi-mcp-adapter/dist/lifecycle.d.ts +0 -56
  104. package/node_modules/pi-mcp-adapter/dist/lifecycle.js +0 -410
  105. package/node_modules/pi-mcp-adapter/dist/lifecycle.js.map +0 -1
  106. package/node_modules/pi-mcp-adapter/dist/logger.d.ts +0 -51
  107. package/node_modules/pi-mcp-adapter/dist/logger.js +0 -131
  108. package/node_modules/pi-mcp-adapter/dist/logger.js.map +0 -1
  109. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.d.ts +0 -26
  110. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js +0 -103
  111. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js.map +0 -1
  112. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.d.ts +0 -118
  113. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js +0 -1097
  114. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js.map +0 -1
  115. package/node_modules/pi-mcp-adapter/dist/mcp-auth.d.ts +0 -170
  116. package/node_modules/pi-mcp-adapter/dist/mcp-auth.js +0 -1142
  117. package/node_modules/pi-mcp-adapter/dist/mcp-auth.js.map +0 -1
  118. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.d.ts +0 -24
  119. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js +0 -203
  120. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js.map +0 -1
  121. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.d.ts +0 -53
  122. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js +0 -441
  123. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js.map +0 -1
  124. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.d.ts +0 -148
  125. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js +0 -689
  126. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js.map +0 -1
  127. package/node_modules/pi-mcp-adapter/dist/mcp-probe.d.ts +0 -6
  128. package/node_modules/pi-mcp-adapter/dist/mcp-probe.js +0 -166
  129. package/node_modules/pi-mcp-adapter/dist/mcp-probe.js.map +0 -1
  130. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.d.ts +0 -102
  131. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js +0 -369
  132. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js.map +0 -1
  133. package/node_modules/pi-mcp-adapter/dist/mcp-trace.d.ts +0 -95
  134. package/node_modules/pi-mcp-adapter/dist/mcp-trace.js +0 -242
  135. package/node_modules/pi-mcp-adapter/dist/mcp-trace.js.map +0 -1
  136. package/node_modules/pi-mcp-adapter/dist/metadata-cache.d.ts +0 -19
  137. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +0 -301
  138. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +0 -1
  139. package/node_modules/pi-mcp-adapter/dist/npx-resolver.d.ts +0 -6
  140. package/node_modules/pi-mcp-adapter/dist/npx-resolver.js +0 -505
  141. package/node_modules/pi-mcp-adapter/dist/npx-resolver.js.map +0 -1
  142. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.d.ts +0 -2
  143. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js +0 -144
  144. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js.map +0 -1
  145. package/node_modules/pi-mcp-adapter/dist/request-headers-command.d.ts +0 -10
  146. package/node_modules/pi-mcp-adapter/dist/request-headers-command.js +0 -312
  147. package/node_modules/pi-mcp-adapter/dist/request-headers-command.js.map +0 -1
  148. package/node_modules/pi-mcp-adapter/dist/resource-tools.d.ts +0 -1
  149. package/node_modules/pi-mcp-adapter/dist/resource-tools.js +0 -15
  150. package/node_modules/pi-mcp-adapter/dist/resource-tools.js.map +0 -1
  151. package/node_modules/pi-mcp-adapter/dist/runtime-owner.d.ts +0 -13
  152. package/node_modules/pi-mcp-adapter/dist/runtime-owner.js +0 -97
  153. package/node_modules/pi-mcp-adapter/dist/runtime-owner.js.map +0 -1
  154. package/node_modules/pi-mcp-adapter/dist/sampling-handler.d.ts +0 -17
  155. package/node_modules/pi-mcp-adapter/dist/sampling-handler.js +0 -203
  156. package/node_modules/pi-mcp-adapter/dist/sampling-handler.js.map +0 -1
  157. package/node_modules/pi-mcp-adapter/dist/secure-keyring.d.ts +0 -11
  158. package/node_modules/pi-mcp-adapter/dist/secure-keyring.js +0 -172
  159. package/node_modules/pi-mcp-adapter/dist/secure-keyring.js.map +0 -1
  160. package/node_modules/pi-mcp-adapter/dist/server-manager.d.ts +0 -157
  161. package/node_modules/pi-mcp-adapter/dist/server-manager.js +0 -1745
  162. package/node_modules/pi-mcp-adapter/dist/server-manager.js.map +0 -1
  163. package/node_modules/pi-mcp-adapter/dist/session-approvals.d.ts +0 -34
  164. package/node_modules/pi-mcp-adapter/dist/session-approvals.js +0 -140
  165. package/node_modules/pi-mcp-adapter/dist/session-approvals.js.map +0 -1
  166. package/node_modules/pi-mcp-adapter/dist/session-recovery.d.ts +0 -26
  167. package/node_modules/pi-mcp-adapter/dist/session-recovery.js +0 -142
  168. package/node_modules/pi-mcp-adapter/dist/session-recovery.js.map +0 -1
  169. package/node_modules/pi-mcp-adapter/dist/state.d.ts +0 -73
  170. package/node_modules/pi-mcp-adapter/dist/state.js +0 -2
  171. package/node_modules/pi-mcp-adapter/dist/state.js.map +0 -1
  172. package/node_modules/pi-mcp-adapter/dist/types.d.ts +0 -642
  173. package/node_modules/pi-mcp-adapter/dist/types.js +0 -331
  174. package/node_modules/pi-mcp-adapter/dist/types.js.map +0 -1
  175. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.d.ts +0 -6
  176. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js +0 -37
  177. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js.map +0 -1
  178. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.d.ts +0 -17
  179. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js +0 -219
  180. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js.map +0 -1
  181. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.d.ts +0 -104
  182. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js +0 -59
  183. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js.map +0 -1
  184. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.d.ts +0 -4
  185. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js +0 -27
  186. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js.map +0 -1
  187. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.d.ts +0 -15
  188. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js +0 -85
  189. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js.map +0 -1
  190. package/node_modules/pi-mcp-adapter/dist/utils.d.ts +0 -41
  191. package/node_modules/pi-mcp-adapter/dist/utils.js +0 -417
  192. package/node_modules/pi-mcp-adapter/dist/utils.js.map +0 -1
  193. package/node_modules/pi-mcp-adapter/elicitation-handler.ts +0 -358
  194. package/node_modules/pi-mcp-adapter/error-signal.ts +0 -32
  195. package/node_modules/pi-mcp-adapter/errors.ts +0 -364
  196. package/node_modules/pi-mcp-adapter/examples/jev-accessibility-loop.mjs +0 -85
  197. package/node_modules/pi-mcp-adapter/examples/jev-semantic-filter.mjs +0 -34
  198. package/node_modules/pi-mcp-adapter/failure-backoff.ts +0 -23
  199. package/node_modules/pi-mcp-adapter/glimpse-ui.ts +0 -80
  200. package/node_modules/pi-mcp-adapter/host-html-template.ts +0 -515
  201. package/node_modules/pi-mcp-adapter/http-ca.ts +0 -84
  202. package/node_modules/pi-mcp-adapter/index.ts +0 -2106
  203. package/node_modules/pi-mcp-adapter/init.ts +0 -721
  204. package/node_modules/pi-mcp-adapter/jev-client.ts +0 -300
  205. package/node_modules/pi-mcp-adapter/jev-contracts.ts +0 -53
  206. package/node_modules/pi-mcp-adapter/jev-key-store.ts +0 -192
  207. package/node_modules/pi-mcp-adapter/json-schema-validator.ts +0 -83
  208. package/node_modules/pi-mcp-adapter/lazy-loader.ts +0 -7
  209. package/node_modules/pi-mcp-adapter/lifecycle.ts +0 -457
  210. package/node_modules/pi-mcp-adapter/logger.ts +0 -169
  211. package/node_modules/pi-mcp-adapter/mcp-auth-fetch.ts +0 -113
  212. package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +0 -1296
  213. package/node_modules/pi-mcp-adapter/mcp-auth.ts +0 -1287
  214. package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +0 -250
  215. package/node_modules/pi-mcp-adapter/mcp-callback-server.ts +0 -534
  216. package/node_modules/pi-mcp-adapter/mcp-code.ts +0 -495
  217. package/node_modules/pi-mcp-adapter/mcp-install.ts +0 -60
  218. package/node_modules/pi-mcp-adapter/mcp-keyring-helper.cjs +0 -89
  219. package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +0 -819
  220. package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +0 -511
  221. package/node_modules/pi-mcp-adapter/mcp-panel-theme.ts +0 -104
  222. package/node_modules/pi-mcp-adapter/mcp-panel.ts +0 -1099
  223. package/node_modules/pi-mcp-adapter/mcp-probe.ts +0 -201
  224. package/node_modules/pi-mcp-adapter/mcp-references.ts +0 -373
  225. package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +0 -137
  226. package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +0 -747
  227. package/node_modules/pi-mcp-adapter/mcp-status.ts +0 -105
  228. package/node_modules/pi-mcp-adapter/mcp-tasks.ts +0 -467
  229. package/node_modules/pi-mcp-adapter/mcp-trace.ts +0 -306
  230. package/node_modules/pi-mcp-adapter/metadata-cache.ts +0 -362
  231. package/node_modules/pi-mcp-adapter/namespace-tools.ts +0 -334
  232. package/node_modules/pi-mcp-adapter/npx-resolver.ts +0 -543
  233. package/node_modules/pi-mcp-adapter/oauth-handler.ts +0 -30
  234. package/node_modules/pi-mcp-adapter/oauth.ts +0 -52
  235. package/node_modules/pi-mcp-adapter/onboarding-state.ts +0 -76
  236. package/node_modules/pi-mcp-adapter/package-mcp-loader.ts +0 -156
  237. package/node_modules/pi-mcp-adapter/package.json +0 -219
  238. package/node_modules/pi-mcp-adapter/panel-keys.ts +0 -53
  239. package/node_modules/pi-mcp-adapter/prompts.ts +0 -385
  240. package/node_modules/pi-mcp-adapter/proxy-modes.ts +0 -1735
  241. package/node_modules/pi-mcp-adapter/request-headers-command.ts +0 -333
  242. package/node_modules/pi-mcp-adapter/resource-tools.ts +0 -17
  243. package/node_modules/pi-mcp-adapter/runtime-owner.ts +0 -106
  244. package/node_modules/pi-mcp-adapter/sampling-handler.ts +0 -261
  245. package/node_modules/pi-mcp-adapter/sandbox-proxy-template.ts +0 -144
  246. package/node_modules/pi-mcp-adapter/search-ranking.ts +0 -309
  247. package/node_modules/pi-mcp-adapter/secure-keyring.ts +0 -170
  248. package/node_modules/pi-mcp-adapter/semantic-search.ts +0 -186
  249. package/node_modules/pi-mcp-adapter/server-manager.ts +0 -2088
  250. package/node_modules/pi-mcp-adapter/session-approvals.ts +0 -201
  251. package/node_modules/pi-mcp-adapter/session-recovery.ts +0 -158
  252. package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +0 -49
  253. package/node_modules/pi-mcp-adapter/state.ts +0 -71
  254. package/node_modules/pi-mcp-adapter/tool-approval.ts +0 -205
  255. package/node_modules/pi-mcp-adapter/tool-metadata.ts +0 -302
  256. package/node_modules/pi-mcp-adapter/tool-registrar.ts +0 -255
  257. package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +0 -573
  258. package/node_modules/pi-mcp-adapter/ts-shape.ts +0 -149
  259. package/node_modules/pi-mcp-adapter/types.ts +0 -1120
  260. package/node_modules/pi-mcp-adapter/ui-app-bridge-helpers.ts +0 -40
  261. package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +0 -266
  262. package/node_modules/pi-mcp-adapter/ui-server.ts +0 -993
  263. package/node_modules/pi-mcp-adapter/ui-session.ts +0 -624
  264. package/node_modules/pi-mcp-adapter/ui-stream-types.ts +0 -89
  265. package/node_modules/pi-mcp-adapter/ui-tool-visibility.ts +0 -25
  266. package/node_modules/pi-mcp-adapter/unix-socket-transport.ts +0 -85
  267. package/node_modules/pi-mcp-adapter/utils.ts +0 -464
@@ -1,131 +0,0 @@
1
- /**
2
- * Custom error types for MCP UI operations.
3
- * Provides structured errors with context and recovery hints.
4
- */
5
- export interface McpUiErrorContext {
6
- server?: string;
7
- tool?: string;
8
- uri?: string;
9
- session?: string;
10
- [key: string]: unknown;
11
- }
12
- /**
13
- * Base error class for MCP UI errors.
14
- */
15
- export declare class McpUiError extends Error {
16
- readonly code: string;
17
- readonly context: McpUiErrorContext;
18
- readonly recoveryHint: string | undefined;
19
- readonly cause: Error | undefined;
20
- constructor(message: string, options: {
21
- code: string;
22
- context?: McpUiErrorContext;
23
- recoveryHint?: string;
24
- cause?: Error;
25
- });
26
- toJSON(): Record<string, unknown>;
27
- }
28
- /**
29
- * Error fetching a UI resource from the MCP server.
30
- */
31
- export declare class ResourceFetchError extends McpUiError {
32
- constructor(uri: string, reason: string, options?: {
33
- server?: string;
34
- cause?: Error;
35
- });
36
- }
37
- /**
38
- * Error parsing or validating UI resource content.
39
- */
40
- export declare class ResourceParseError extends McpUiError {
41
- constructor(uri: string, reason: string, options?: {
42
- server?: string;
43
- mimeType?: string;
44
- });
45
- }
46
- /**
47
- * Error connecting to the AppBridge.
48
- */
49
- export declare class BridgeConnectionError extends McpUiError {
50
- constructor(reason: string, options?: {
51
- session?: string;
52
- cause?: Error;
53
- });
54
- }
55
- /**
56
- * Error related to user consent for tool calls.
57
- */
58
- export declare class ConsentError extends McpUiError {
59
- readonly denied: boolean;
60
- constructor(server: string, options: {
61
- denied?: boolean;
62
- requiresApproval?: boolean;
63
- });
64
- }
65
- /**
66
- * Error with UI server session management.
67
- */
68
- export declare class SessionError extends McpUiError {
69
- constructor(reason: string, options?: {
70
- session?: string;
71
- cause?: Error;
72
- });
73
- }
74
- /**
75
- * Error starting or operating the UI server.
76
- */
77
- export declare class ServerError extends McpUiError {
78
- constructor(reason: string, options?: {
79
- port?: number;
80
- cause?: Error;
81
- });
82
- }
83
- /**
84
- * Error communicating with the MCP server.
85
- */
86
- export declare class McpServerError extends McpUiError {
87
- constructor(server: string, reason: string, options?: {
88
- tool?: string;
89
- cause?: Error;
90
- });
91
- }
92
- /**
93
- * Wrap an unknown error into an McpUiError.
94
- */
95
- export declare function wrapError(error: unknown, context?: McpUiErrorContext): McpUiError;
96
- /**
97
- * Check if an error is a specific MCP UI error type.
98
- */
99
- export declare function isErrorCode(error: unknown, code: string): boolean;
100
- /**
101
- * Stable adapter error code for an SDK-native input_required result that the
102
- * current client cannot fulfil because its embedded-request handler is not
103
- * registered. The SDK keeps the request key/method in `SdkError.data`; this
104
- * adapter detail intentionally copies only bounded, actionable fields.
105
- */
106
- export declare const INPUT_REQUIRED_NEEDS_UI: "input_required_needs_ui";
107
- export interface InputRequiredNeedsUiDetails {
108
- error: typeof INPUT_REQUIRED_NEEDS_UI;
109
- server: string;
110
- tool?: string;
111
- resourceUri?: string;
112
- inputKey: string;
113
- inputMethod: string;
114
- message: string;
115
- }
116
- export interface InputRequiredIdentity {
117
- server: string;
118
- tool?: string;
119
- resourceUri?: string;
120
- }
121
- /**
122
- * Convert a missing embedded-input handler into an adapter-owned result
123
- * detail. Matching requires the SDK's typed code/data shape (or this module's
124
- * typed wrapper), rather than arbitrary error-message text.
125
- */
126
- export declare function getInputRequiredNeedsUiDetails(error: unknown, identity: InputRequiredIdentity): InputRequiredNeedsUiDetails | undefined;
127
- /** Error form used by UiResourceHandler so an outer tool call can preserve the classification. */
128
- export declare class InputRequiredNeedsUiError extends McpUiError {
129
- readonly details: InputRequiredNeedsUiDetails;
130
- constructor(details: InputRequiredNeedsUiDetails, cause?: Error);
131
- }
@@ -1,278 +0,0 @@
1
- /**
2
- * Custom error types for MCP UI operations.
3
- * Provides structured errors with context and recovery hints.
4
- */
5
- /**
6
- * Base error class for MCP UI errors.
7
- */
8
- export class McpUiError extends Error {
9
- code;
10
- context;
11
- recoveryHint;
12
- cause;
13
- constructor(message, options) {
14
- super(message);
15
- this.name = "McpUiError";
16
- this.code = options.code;
17
- this.context = options.context ?? {};
18
- this.recoveryHint = options.recoveryHint;
19
- this.cause = options.cause;
20
- // Maintain proper stack trace
21
- if (Error.captureStackTrace) {
22
- Error.captureStackTrace(this, this.constructor);
23
- }
24
- }
25
- toJSON() {
26
- return {
27
- name: this.name,
28
- code: this.code,
29
- message: this.message,
30
- context: this.context,
31
- recoveryHint: this.recoveryHint,
32
- stack: this.stack,
33
- };
34
- }
35
- }
36
- /**
37
- * Error fetching a UI resource from the MCP server.
38
- */
39
- export class ResourceFetchError extends McpUiError {
40
- constructor(uri, reason, options) {
41
- super(`Failed to fetch UI resource "${uri}": ${reason}`, {
42
- code: "RESOURCE_FETCH_ERROR",
43
- context: { uri, ...(options?.server !== undefined ? { server: options.server } : {}) },
44
- recoveryHint: "Check that the MCP server is connected and the resource URI is valid.",
45
- ...(options?.cause !== undefined ? { cause: options.cause } : {}),
46
- });
47
- this.name = "ResourceFetchError";
48
- }
49
- }
50
- /**
51
- * Error parsing or validating UI resource content.
52
- */
53
- export class ResourceParseError extends McpUiError {
54
- constructor(uri, reason, options) {
55
- super(`Invalid UI resource "${uri}": ${reason}`, {
56
- code: "RESOURCE_PARSE_ERROR",
57
- context: {
58
- uri,
59
- ...(options?.server !== undefined ? { server: options.server } : {}),
60
- ...(options?.mimeType !== undefined ? { mimeType: options.mimeType } : {}),
61
- },
62
- recoveryHint: "Ensure the resource returns valid HTML with the correct MIME type.",
63
- });
64
- this.name = "ResourceParseError";
65
- }
66
- }
67
- /**
68
- * Error connecting to the AppBridge.
69
- */
70
- export class BridgeConnectionError extends McpUiError {
71
- constructor(reason, options) {
72
- super(`AppBridge connection failed: ${reason}`, {
73
- code: "BRIDGE_CONNECTION_ERROR",
74
- context: options?.session !== undefined ? { session: options.session } : {},
75
- recoveryHint: "Check browser console for detailed errors. The iframe may have failed to load.",
76
- ...(options?.cause !== undefined ? { cause: options.cause } : {}),
77
- });
78
- this.name = "BridgeConnectionError";
79
- }
80
- }
81
- /**
82
- * Error related to user consent for tool calls.
83
- */
84
- export class ConsentError extends McpUiError {
85
- denied;
86
- constructor(server, options) {
87
- const message = options.denied
88
- ? `Tool calls for "${server}" were denied for this session`
89
- : `Tool call approval required for "${server}"`;
90
- super(message, {
91
- code: options.denied ? "CONSENT_DENIED" : "CONSENT_REQUIRED",
92
- context: { server },
93
- recoveryHint: options.denied
94
- ? "The user denied tool access. Start a new session to try again."
95
- : "Prompt the user for consent before calling tools.",
96
- });
97
- this.name = "ConsentError";
98
- this.denied = options.denied ?? false;
99
- }
100
- }
101
- /**
102
- * Error with UI server session management.
103
- */
104
- export class SessionError extends McpUiError {
105
- constructor(reason, options) {
106
- super(`Session error: ${reason}`, {
107
- code: "SESSION_ERROR",
108
- context: options?.session !== undefined ? { session: options.session } : {},
109
- recoveryHint: "The session may have expired or been closed. Try opening the UI again.",
110
- ...(options?.cause !== undefined ? { cause: options.cause } : {}),
111
- });
112
- this.name = "SessionError";
113
- }
114
- }
115
- /**
116
- * Error starting or operating the UI server.
117
- */
118
- export class ServerError extends McpUiError {
119
- constructor(reason, options) {
120
- super(`UI server error: ${reason}`, {
121
- code: "SERVER_ERROR",
122
- context: options?.port !== undefined ? { port: options.port } : {},
123
- recoveryHint: "Check if the port is available. Another process may be using it.",
124
- ...(options?.cause !== undefined ? { cause: options.cause } : {}),
125
- });
126
- this.name = "ServerError";
127
- }
128
- }
129
- /**
130
- * Error communicating with the MCP server.
131
- */
132
- export class McpServerError extends McpUiError {
133
- constructor(server, reason, options) {
134
- super(`MCP server "${server}" error: ${reason}`, {
135
- code: "MCP_SERVER_ERROR",
136
- context: { server, ...(options?.tool !== undefined ? { tool: options.tool } : {}) },
137
- recoveryHint: "Check that the MCP server is running and responsive.",
138
- ...(options?.cause !== undefined ? { cause: options.cause } : {}),
139
- });
140
- this.name = "McpServerError";
141
- }
142
- }
143
- /**
144
- * Wrap an unknown error into an McpUiError.
145
- */
146
- export function wrapError(error, context) {
147
- if (error instanceof McpUiError) {
148
- // Merge contexts
149
- return new McpUiError(error.message, {
150
- code: error.code,
151
- context: { ...error.context, ...context },
152
- ...(error.recoveryHint !== undefined ? { recoveryHint: error.recoveryHint } : {}),
153
- ...(error.cause !== undefined ? { cause: error.cause } : {}),
154
- });
155
- }
156
- const cause = error instanceof Error ? error : undefined;
157
- const message = error instanceof Error ? error.message : String(error);
158
- return new McpUiError(message, {
159
- code: "UNKNOWN_ERROR",
160
- ...(context !== undefined ? { context } : {}),
161
- ...(cause !== undefined ? { cause } : {}),
162
- });
163
- }
164
- /**
165
- * Check if an error is a specific MCP UI error type.
166
- */
167
- export function isErrorCode(error, code) {
168
- return error instanceof McpUiError && error.code === code;
169
- }
170
- /**
171
- * Stable adapter error code for an SDK-native input_required result that the
172
- * current client cannot fulfil because its embedded-request handler is not
173
- * registered. The SDK keeps the request key/method in `SdkError.data`; this
174
- * adapter detail intentionally copies only bounded, actionable fields.
175
- */
176
- export const INPUT_REQUIRED_NEEDS_UI = "input_required_needs_ui";
177
- const INPUT_REQUIRED_METHODS = new Set([
178
- "elicitation/create",
179
- "sampling/createMessage",
180
- ]);
181
- const MAX_INPUT_REQUIRED_SERVER_LENGTH = 96;
182
- const MAX_INPUT_REQUIRED_TARGET_LENGTH = 160;
183
- const MAX_INPUT_REQUIRED_DETAIL_LENGTH = 128;
184
- function asRecord(value) {
185
- return value !== null && typeof value === "object" && !Array.isArray(value)
186
- ? value
187
- : undefined;
188
- }
189
- function boundedText(value, maxLength) {
190
- if (typeof value !== "string" || value.length === 0)
191
- return undefined;
192
- return value.length <= maxLength ? value : `${value.slice(0, maxLength - 1)}…`;
193
- }
194
- function findEmbeddedInputRequest(error) {
195
- let current = error;
196
- const seen = new Set();
197
- for (let depth = 0; depth < 8 && current !== undefined && current !== null; depth++) {
198
- if (seen.has(current))
199
- return undefined;
200
- seen.add(current);
201
- const record = asRecord(current);
202
- if (!record)
203
- return undefined;
204
- if (record.code === INPUT_REQUIRED_NEEDS_UI) {
205
- const details = asRecord(record.details);
206
- const inputKey = boundedText(details?.inputKey, MAX_INPUT_REQUIRED_DETAIL_LENGTH);
207
- const inputMethod = boundedText(details?.inputMethod, MAX_INPUT_REQUIRED_DETAIL_LENGTH);
208
- if (inputKey && inputMethod && INPUT_REQUIRED_METHODS.has(inputMethod)) {
209
- const server = boundedText(details?.server, MAX_INPUT_REQUIRED_SERVER_LENGTH);
210
- const tool = boundedText(details?.tool, MAX_INPUT_REQUIRED_TARGET_LENGTH);
211
- const resourceUri = boundedText(details?.resourceUri, MAX_INPUT_REQUIRED_TARGET_LENGTH);
212
- return {
213
- inputKey,
214
- inputMethod,
215
- ...(server ? { server } : {}),
216
- ...(tool ? { tool } : {}),
217
- ...(resourceUri ? { resourceUri } : {}),
218
- };
219
- }
220
- }
221
- if (record.code === "CAPABILITY_NOT_SUPPORTED") {
222
- const data = asRecord(record.data);
223
- const inputKey = boundedText(data?.key, MAX_INPUT_REQUIRED_DETAIL_LENGTH);
224
- const inputMethod = boundedText(data?.method, MAX_INPUT_REQUIRED_DETAIL_LENGTH);
225
- if (inputKey && inputMethod && INPUT_REQUIRED_METHODS.has(inputMethod)) {
226
- return { inputKey, inputMethod };
227
- }
228
- }
229
- current = record.cause;
230
- }
231
- return undefined;
232
- }
233
- /**
234
- * Convert a missing embedded-input handler into an adapter-owned result
235
- * detail. Matching requires the SDK's typed code/data shape (or this module's
236
- * typed wrapper), rather than arbitrary error-message text.
237
- */
238
- export function getInputRequiredNeedsUiDetails(error, identity) {
239
- const request = findEmbeddedInputRequest(error);
240
- if (!request)
241
- return undefined;
242
- const server = boundedText(request.server ?? identity.server, MAX_INPUT_REQUIRED_SERVER_LENGTH) ?? "unknown";
243
- const tool = boundedText(request.tool ?? identity.tool, MAX_INPUT_REQUIRED_TARGET_LENGTH);
244
- const resourceUri = boundedText(request.resourceUri ?? identity.resourceUri, MAX_INPUT_REQUIRED_TARGET_LENGTH);
245
- const target = resourceUri
246
- ? `read resource "${resourceUri}"`
247
- : tool
248
- ? `call tool "${tool}"`
249
- : "complete the MCP request";
250
- const guidance = request.inputMethod === "elicitation/create"
251
- ? "Run this call in an interactive Pi session with elicitation enabled, then retry."
252
- : "Run this call in an interactive Pi session with the required MCP capability enabled, then retry.";
253
- const message = `MCP server "${server}" requested input to ${target}, but this session has no handler for "${request.inputMethod}" (input "${request.inputKey}"). ${guidance}`;
254
- return {
255
- error: INPUT_REQUIRED_NEEDS_UI,
256
- server,
257
- ...(tool ? { tool } : {}),
258
- ...(resourceUri ? { resourceUri } : {}),
259
- inputKey: request.inputKey,
260
- inputMethod: request.inputMethod,
261
- message,
262
- };
263
- }
264
- /** Error form used by UiResourceHandler so an outer tool call can preserve the classification. */
265
- export class InputRequiredNeedsUiError extends McpUiError {
266
- details;
267
- constructor(details, cause) {
268
- super(details.message, {
269
- code: INPUT_REQUIRED_NEEDS_UI,
270
- context: { ...details },
271
- recoveryHint: "Run this call in an interactive Pi session with the required MCP input handler enabled, then retry.",
272
- ...(cause ? { cause } : {}),
273
- });
274
- this.details = details;
275
- this.name = "InputRequiredNeedsUiError";
276
- }
277
- }
278
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC1B,IAAI,CAAS;IACb,OAAO,CAAoB;IAC3B,YAAY,CAAqB;IACjC,KAAK,CAAoB;IAElC,YACE,OAAe,EACf,OAKC;QAED,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;QACrC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAE3B,8BAA8B;QAC9B,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IA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C1C,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- import type { ServerEntry } from "./types.ts";
2
- /** Validate at the connection boundary, including callers that bypass JSON config. */
3
- export declare function validateCaFile(definition: ServerEntry): void;
4
- /** One connection owner, shared across transport/auth retries; never process-wide. */
5
- export declare function createCaFetch(definition: ServerEntry): {
6
- fetch: (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>;
7
- close: () => Promise<void>;
8
- } | undefined;
@@ -1,88 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { X509Certificate } from "node:crypto";
3
- import { Agent, Request as UndiciRequest, fetch as undiciFetch } from "undici";
4
- import { getMissingEnvVars, resolveConfigPath, resolveServerUrl } from "./utils.js";
5
- /** Validate at the connection boundary, including callers that bypass JSON config. */
6
- export function validateCaFile(definition) {
7
- if (definition.caFile === undefined)
8
- return;
9
- if (typeof definition.caFile !== "string" || !definition.caFile.trim()) {
10
- throw new Error("MCP caFile must be a non-empty path string");
11
- }
12
- if (definition.command !== undefined || definition.socket !== undefined
13
- || !definition.url || new URL(resolveServerUrl(definition)).protocol !== "https:") {
14
- throw new Error("MCP caFile is only supported for HTTPS HTTP servers");
15
- }
16
- }
17
- /** One connection owner, shared across transport/auth retries; never process-wide. */
18
- export function createCaFetch(definition) {
19
- validateCaFile(definition);
20
- if (definition.caFile === undefined)
21
- return undefined;
22
- const origin = new URL(resolveServerUrl(definition)).origin;
23
- if (getMissingEnvVars(definition.caFile).length)
24
- throw new Error("Missing environment variable in MCP caFile");
25
- let ca;
26
- try {
27
- ca = readFileSync(resolveConfigPath(definition.caFile), "utf8");
28
- const certificates = ca.match(/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g);
29
- if (!certificates?.length || ca.replace(/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g, "").trim()) {
30
- throw new Error("expected a PEM certificate bundle");
31
- }
32
- for (const certificate of certificates)
33
- new X509Certificate(certificate);
34
- }
35
- catch (cause) {
36
- throw new Error("Failed to load MCP caFile PEM certificate bundle", { cause });
37
- }
38
- const dispatcher = new Agent({ connect: { ca } });
39
- let closed;
40
- return {
41
- fetch: (input, init) => {
42
- const url = new URL(input instanceof Request ? input.url : input.toString());
43
- if (url.origin !== origin)
44
- return globalThis.fetch(input, init);
45
- // The Agent comes from the bundled undici copy, whose internals do not
46
- // match the global fetch dispatcher contract on newer Node releases
47
- // (Node 26 ships undici v8; the dependency pins undici v6). Route
48
- // same-origin requests through the bundled fetch so dispatcher and
49
- // Agent share an implementation. Never follow a redirect with this
50
- // dispatcher, even to the same origin (no trust-bearing redirect hops).
51
- // Attach after header-command Request reconstruction.
52
- try {
53
- const bundledInput = input instanceof Request
54
- ? new UndiciRequest(input.url, {
55
- method: input.method,
56
- headers: [...input.headers],
57
- // Defer acquiring the source stream until bundled Request validation
58
- // succeeds. An overriding body never consumes the original body.
59
- ...(init?.body == null && input.body ? { body: (async function* () {
60
- yield* input.body;
61
- })(), duplex: "half" } : {}),
62
- cache: input.cache,
63
- credentials: input.credentials,
64
- integrity: input.integrity,
65
- keepalive: input.keepalive,
66
- mode: input.mode,
67
- redirect: input.redirect,
68
- referrer: input.referrer,
69
- referrerPolicy: input.referrerPolicy,
70
- signal: input.signal,
71
- })
72
- : input;
73
- const options = {
74
- ...init,
75
- ...(init?.headers !== undefined ? { headers: [...new Headers(init.headers)] } : {}),
76
- dispatcher,
77
- redirect: "error",
78
- };
79
- return undiciFetch(bundledInput, options);
80
- }
81
- catch (error) {
82
- return Promise.reject(error);
83
- }
84
- },
85
- close: () => closed ??= dispatcher.destroy(),
86
- };
87
- }
88
- //# sourceMappingURL=http-ca.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-ca.js","sourceRoot":"","sources":["../http-ca.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,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ensionState } from "./state.ts";
2
- import { type JevCredentialResolution } from "./jev-key-store.ts";
3
- import type { JevBudget, JevEvaluateInput, JevEvaluationEnvelope, ResolvedJevSettings } from "./jev-contracts.ts";
4
- export type { ResolvedJevSettings } from "./jev-contracts.ts";
5
- export declare function areJevSourcesAllowed(state: McpExtensionState, settings: ResolvedJevSettings, sources: Iterable<string>): boolean;
6
- export declare function validateJevSettings(value: unknown): ResolvedJevSettings;
7
- export declare function resolveSemanticJevSettings(state: McpExtensionState, credentialResolver?: () => JevCredentialResolution): ResolvedJevSettings;
8
- export declare function validateJevEvaluateInput(value: unknown, limits: ResolvedJevSettings): JevEvaluateInput;
9
- export declare function evaluateJev(state: McpExtensionState, value: JevEvaluateInput, options: {
10
- purpose: "script" | "semantic-search";
11
- signal?: AbortSignal;
12
- budget?: JevBudget;
13
- observedSources?: readonly string[];
14
- }): Promise<JevEvaluationEnvelope>;