@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,12 +1,12 @@
1
1
  import { TypeSafeClient } from "@typesafe-ai/sdk";
2
2
  import { recordAuthFailure, recordAuthVerified } from "./auth.js";
3
- import { DEFAULT_BACKEND, TYPESAFE_KEY_ENV, backendConfig, backendModelId, defaultModelId, usesTypesafeKey } from "./backends.js";
3
+ import { TYPESAFE_KEY_ENV, backendModelId, resolveBackend, usesTypesafeKey } from "./backends.js";
4
4
  import { evaluateAll, evaluateMany } from "./batch.js";
5
5
  import { keySituation } from "./credentials.js";
6
6
  import { TypeSafeIntegrationError, safeError } from "./errors.js";
7
7
  import { DEFAULT_MAX_INPUT_BYTES, assertWithinByteLimit, prepareEvaluationRequest } from "./schema.js";
8
8
  import { DEFAULT_USD_PER_MTOK, capsFromEnvironment, estimateUsd, mergeCaps, openUsageLedger } from "./usage.js";
9
- export { DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./backends.js";
9
+ export { backendHost, resolveBackend, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./backends.js";
10
10
  /** The paths the SDK appends to whatever base URL it is given. */
11
11
  const SDK_PATH = "/v1/systemone";
12
12
  const SDK_MODELS_PATH = "/v1/models";
@@ -118,13 +118,14 @@ function capsDescription(caps) {
118
118
  }
119
119
  /** A bounded, server-side TypeSafe client independent of Pi's runtime. */
120
120
  export function createTypeSafe(options = {}) {
121
+ const backend = resolveBackend(options.backend);
121
122
  let apiKey = options.apiKey?.trim();
122
- const backendName = options.backend ?? DEFAULT_BACKEND;
123
- const backend = backendConfig(backendName);
124
123
  const baseURL = backend.host;
124
+ // Only a registry backend maps ids; a caller-supplied endpoint's model is sent as the caller wrote it.
125
+ const mapModel = (model) => (backend.name === undefined ? model : backendModelId(backend.name, model));
125
126
  if (!apiKey) {
126
127
  // The same resolution that authState() and ensureApiKey() report, so the status line and the request agree.
127
- const situation = keySituation(backendName);
128
+ const situation = keySituation(options.backend);
128
129
  if (situation.kind === "unusable")
129
130
  throw new TypeSafeIntegrationError("configuration", situation.reason);
130
131
  if (situation.kind === "environment" || situation.kind === "stored")
@@ -148,10 +149,12 @@ export function createTypeSafe(options = {}) {
148
149
  const transport = backend.path !== undefined || backend.modelsPath !== undefined ? backendFetch(backend, options.fetch) : options.fetch;
149
150
  // The caller's input is validated as written, then mapped to the backend's id form; omitting it sends the backend's
150
151
  // own default, which the mapping leaves unchanged.
151
- const requested = options.model ?? defaultModelId(backendName);
152
+ const requested = options.model ?? backend.defaultModel;
153
+ if (requested === undefined)
154
+ throw new TypeSafeIntegrationError("configuration", `Backend "${backend.label}" names no defaultModel; pass model to createTypeSafe.`);
152
155
  if (typeof requested !== "string" || !requested.trim() || requested.length > 100)
153
156
  throw new TypeSafeIntegrationError("configuration", "model must be a nonempty string of at most 100 characters.");
154
- const model = backendModelId(backendName, requested);
157
+ const model = mapModel(requested);
155
158
  // Do not inherit SDK debug logging or alternate destinations from the environment.
156
159
  const client = new TypeSafeClient({
157
160
  apiKey,
@@ -187,7 +190,7 @@ export function createTypeSafe(options = {}) {
187
190
  if (!Array.isArray(models))
188
191
  throw new TypeSafeIntegrationError("response", "TypeSafe returned an unexpected model list.");
189
192
  // A backend that serves its list publicly accepts any key, so a success there proves nothing about one.
190
- if (backend.modelsVerifyKey !== false && !verificationRecorded) {
193
+ if (backend.modelsVerifyKey && !verificationRecorded) {
191
194
  verificationRecorded = true;
192
195
  recordAuthVerified();
193
196
  }
@@ -200,7 +203,7 @@ export function createTypeSafe(options = {}) {
200
203
  async evaluate(input, callOptions = {}) {
201
204
  const validated = prepareEvaluationRequest(input, { maxInputBytes });
202
205
  // A per-request model meets the same mapping as the client default; the schema already limited the caller's own id.
203
- const body = JSON.stringify({ ...validated, model: validated.model === undefined ? model : backendModelId(backendName, validated.model) });
206
+ const body = JSON.stringify({ ...validated, model: validated.model === undefined ? model : mapModel(validated.model) });
204
207
  assertWithinByteLimit(body, maxInputBytes);
205
208
  if (callOptions.signal?.aborted)
206
209
  throw new TypeSafeIntegrationError("aborted", "TypeSafe request cancelled before submission.");
@@ -1,6 +1,9 @@
1
- import type { TypeSafeBackend } from "./backends.js";
1
+ import type { BackendSpec } from "./backends.js";
2
2
  export type KeySource = "environment" | "stored";
3
- /** The complete, never-throwing answer to "which key is in effect". */
3
+ /**
4
+ * The complete answer to "which key is in effect" for a valid backend: it never throws. An invalid backend — an
5
+ * unknown name or an endpoint object that fails validation — throws the same `configuration` error as resolveBackend.
6
+ */
4
7
  export type KeySituation =
5
8
  /** `keyEnv` names the variable that was read; absent means `TYPESAFE_API_KEY`. */
6
9
  {
@@ -30,21 +33,24 @@ export declare function normalizeApiKey(value: unknown): string;
30
33
  */
31
34
  export declare function readStoredApiKey(): string | undefined;
32
35
  /**
33
- * What the environment, the login store, and file permissions add up to right now for one judgment backend. Never
34
- * throws; the "unusable" kind carries the user-facing reason (a stored key that other local users can read).
36
+ * What the environment, the login store, and file permissions add up to right now for one judgment backend. A valid
37
+ * backend never throws: the "unusable" kind carries the user-facing reason (a stored key that other local users can
38
+ * read). An invalid backend — an unknown name or an endpoint object that fails validation — throws the same
39
+ * `configuration` error as resolveBackend(), so validate a user-supplied endpoint with resolveBackend() first.
35
40
  * The TypeSafe backend reads `TYPESAFE_API_KEY`, then the login store. Every other backend reads only its own
36
41
  * environment variable, because the store holds a TypeSafe key and a login verifies against api.typesafe.ai.
37
42
  */
38
- export declare function keySituation(backend?: TypeSafeBackend): KeySituation;
43
+ export declare function keySituation(backend?: BackendSpec): KeySituation;
39
44
  /** Short phrase naming the source; full sentences stay with the caller. */
40
45
  export declare function keySourceLabel(situation: KeySituation): string;
41
46
  /**
42
47
  * The pre-0.4.0 key interface, frozen for existing callers: environment first so CI and scripts stay explicit, the
43
48
  * stored key as the interactive default, `undefined` when no key is configured, and a `configuration` error when a
44
- * store must not be read. New code should call keySituation() instead: same precedence, never throws, and the
45
- * "must not be read" case arrives as `unusable` with the reason.
49
+ * store must not be read. New code should call keySituation() instead: same precedence, never throws for a valid
50
+ * backend (an invalid one throws resolveBackend's `configuration` error), and the "must not be read" case arrives as
51
+ * `unusable` with the reason.
46
52
  */
47
- export declare function resolveApiKey(backend?: TypeSafeBackend): {
53
+ export declare function resolveApiKey(backend?: BackendSpec): {
48
54
  key: string;
49
55
  source: KeySource;
50
56
  } | undefined;
@@ -1,7 +1,7 @@
1
1
  import { chmodSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import { dirname, join } from "node:path";
4
- import { DEFAULT_BACKEND, TYPESAFE_KEY_ENV, backendConfig, usesTypesafeKey } from "./backends.js";
4
+ import { DEFAULT_BACKEND, TYPESAFE_KEY_ENV, resolveBackend, usesTypesafeKey } from "./backends.js";
5
5
  import { TypeSafeIntegrationError } from "./errors.js";
6
6
  /** Mirrors Pi's agent directory rule; every pi-typesafe file lives in this one directory. */
7
7
  export function piTypesafeDir() {
@@ -45,14 +45,16 @@ export function readStoredApiKey() {
45
45
  }
46
46
  }
47
47
  /**
48
- * What the environment, the login store, and file permissions add up to right now for one judgment backend. Never
49
- * throws; the "unusable" kind carries the user-facing reason (a stored key that other local users can read).
48
+ * What the environment, the login store, and file permissions add up to right now for one judgment backend. A valid
49
+ * backend never throws: the "unusable" kind carries the user-facing reason (a stored key that other local users can
50
+ * read). An invalid backend — an unknown name or an endpoint object that fails validation — throws the same
51
+ * `configuration` error as resolveBackend(), so validate a user-supplied endpoint with resolveBackend() first.
50
52
  * The TypeSafe backend reads `TYPESAFE_API_KEY`, then the login store. Every other backend reads only its own
51
53
  * environment variable, because the store holds a TypeSafe key and a login verifies against api.typesafe.ai.
52
54
  */
53
55
  export function keySituation(backend = DEFAULT_BACKEND) {
54
- const config = backendConfig(backend);
55
- const keyEnv = config.keyEnv ?? TYPESAFE_KEY_ENV;
56
+ const config = resolveBackend(backend);
57
+ const keyEnv = config.keyEnv;
56
58
  const fromEnvironment = process.env[keyEnv]?.trim();
57
59
  if (fromEnvironment)
58
60
  return { kind: "environment", key: fromEnvironment, keyEnv };
@@ -82,8 +84,9 @@ export function keySourceLabel(situation) {
82
84
  /**
83
85
  * The pre-0.4.0 key interface, frozen for existing callers: environment first so CI and scripts stay explicit, the
84
86
  * stored key as the interactive default, `undefined` when no key is configured, and a `configuration` error when a
85
- * store must not be read. New code should call keySituation() instead: same precedence, never throws, and the
86
- * "must not be read" case arrives as `unusable` with the reason.
87
+ * store must not be read. New code should call keySituation() instead: same precedence, never throws for a valid
88
+ * backend (an invalid one throws resolveBackend's `configuration` error), and the "must not be read" case arrives as
89
+ * `unusable` with the reason.
87
90
  */
88
91
  export function resolveApiKey(backend = DEFAULT_BACKEND) {
89
92
  const situation = keySituation(backend);
@@ -1,4 +1,4 @@
1
- import type { BackendConfig, TypeSafeBackend } from "./backends.js";
1
+ import type { BackendConfig, BackendSpec } from "./backends.js";
2
2
  export type IntegrationErrorCode = "configuration" | "validation" | "budget" | "aborted" | "timeout" | "http" | "connection" | "response";
3
3
  /**
4
4
  * Safe to display: never contains upstream bodies, keys, or submitted state. The only header value a message can
@@ -14,4 +14,4 @@ export declare class TypeSafeIntegrationError extends Error {
14
14
  * Classify an error into a message safe to display. `backend` names the key variable the 401 advice tells the user
15
15
  * to check and selects the 402 wording; omitting it keeps the one-argument call and assumes the default TypeSafe key.
16
16
  */
17
- export declare function safeError(error: unknown, backend?: TypeSafeBackend | BackendConfig): TypeSafeIntegrationError;
17
+ export declare function safeError(error: unknown, backend?: BackendSpec | BackendConfig): TypeSafeIntegrationError;
@@ -1,5 +1,5 @@
1
- export { createTypeSafe, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
2
- export type { TypeSafe, TypeSafeOptions, EvaluationOptions, Evaluation, UsageSnapshot, SpendReport, TypeSafeBackend, BackendConfig, } from "./client.js";
1
+ export { createTypeSafe, backendHost, resolveBackend, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
2
+ export type { TypeSafe, TypeSafeOptions, EvaluationOptions, Evaluation, UsageSnapshot, SpendReport, TypeSafeBackend, BackendConfig, BackendEndpoint, BackendSpec, ResolvedBackend, } from "./client.js";
3
3
  export { ask, DEFAULT_ASK_TIMEOUT_MS } from "./ask.js";
4
4
  export type { AskAnswer, AskOptions, Judge } from "./ask.js";
5
5
  export { fanOut, DEFAULT_CONCURRENCY, evaluateMany, evaluateAll, chunkEvaluationRequest } from "./batch.js";
@@ -1,4 +1,4 @@
1
- export { createTypeSafe, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
1
+ export { createTypeSafe, backendHost, resolveBackend, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
2
2
  export { ask, DEFAULT_ASK_TIMEOUT_MS } from "./ask.js";
3
3
  export { fanOut, DEFAULT_CONCURRENCY, evaluateMany, evaluateAll, chunkEvaluationRequest } from "./batch.js";
4
4
  export { authState, authStatePath, clearAuthState, describeAuth, recordAuthFailure, recordAuthVerified } from "./auth.js";
@@ -1,5 +1,5 @@
1
1
  import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
- import type { TypeSafeBackend } from "./backends.js";
2
+ import type { BackendSpec } from "./backends.js";
3
3
  import type { KeySource } from "./credentials.js";
4
4
  export interface LoginResult {
5
5
  /** Where the verified key was saved. */
@@ -29,5 +29,5 @@ export type EnsureApiKeyResult = {
29
29
  * the prompt would verify the key against the wrong service and store it where the TypeSafe key lives.
30
30
  */
31
31
  export declare function ensureApiKey(ctx: ExtensionCommandContext, options?: {
32
- backend?: TypeSafeBackend;
32
+ backend?: BackendSpec;
33
33
  }): Promise<EnsureApiKeyResult | undefined>;
@@ -1,4 +1,4 @@
1
- import { DEFAULT_BACKEND, backendConfig, usesTypesafeKey } from "./backends.js";
1
+ import { DEFAULT_BACKEND, resolveBackend, usesTypesafeKey } from "./backends.js";
2
2
  import { createTypeSafe } from "./client.js";
3
3
  import { keySituation, normalizeApiKey, storeApiKey } from "./credentials.js";
4
4
  import { TypeSafeIntegrationError } from "./errors.js";
@@ -38,7 +38,7 @@ export async function ensureApiKey(ctx, options = {}) {
38
38
  return { source: situation.kind };
39
39
  if (situation.kind === "unusable")
40
40
  throw new TypeSafeIntegrationError("configuration", situation.reason);
41
- const config = backendConfig(backend);
41
+ const config = resolveBackend(backend);
42
42
  if (!usesTypesafeKey(config)) {
43
43
  throw new TypeSafeIntegrationError("configuration", `No ${config.label} key. Set ${config.keyEnv} in the environment; /typesafe login stores a TypeSafe key only.`);
44
44
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-typesafe",
3
- "version": "0.7.4",
3
+ "version": "0.8.0",
4
4
  "description": "TypeSafe AI (Jev) decisions for Pi: batched Choice/Score/Noul evaluation tool, terminal playground, and a typed API other extensions build on.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -64,12 +64,12 @@
64
64
  "prepack": "npm run build"
65
65
  },
66
66
  "dependencies": {
67
- "@typesafe-ai/sdk": "^0.6.0",
68
- "typebox": "^1.3.31"
67
+ "@typesafe-ai/sdk": "^0.6.0"
69
68
  },
70
69
  "peerDependencies": {
71
- "@earendil-works/pi-coding-agent": ">=0.85.1 <1",
72
- "@earendil-works/pi-tui": ">=0.85.1 <1"
70
+ "@earendil-works/pi-coding-agent": "*",
71
+ "@earendil-works/pi-tui": "*",
72
+ "typebox": "*"
73
73
  },
74
74
  "peerDependenciesMeta": {
75
75
  "@earendil-works/pi-coding-agent": {
@@ -60,14 +60,14 @@
60
60
  "p-limit": "^6.1.0",
61
61
  "promise.try": "^2.0.1",
62
62
  "turndown": "^7.2.0",
63
- "typebox": "^1.1.38",
64
63
  "unpdf": "^1.6.2",
65
64
  "undici": "^8.9.0"
66
65
  },
67
66
  "peerDependencies": {
68
67
  "@earendil-works/pi-ai": "*",
69
68
  "@earendil-works/pi-coding-agent": "*",
70
- "@earendil-works/pi-tui": "*"
69
+ "@earendil-works/pi-tui": "*",
70
+ "typebox": "*"
71
71
  },
72
72
  "pi": {
73
73
  "extensions": [
@@ -81,8 +81,12 @@
81
81
  "@noble/ed25519": "^3.1.0",
82
82
  "croner": "^10.0.1",
83
83
  "qrcode-terminal": "^0.12.0",
84
- "typebox": "^1.1.38",
85
84
  "ws": "^8.21.0",
86
85
  "zod": "^4.4.3"
86
+ },
87
+ "peerDependencies": {
88
+ "@earendil-works/pi-coding-agent": "*",
89
+ "@earendil-works/pi-tui": "*",
90
+ "typebox": "*"
87
91
  }
88
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-extensions",
3
- "version": "2026.9.16",
3
+ "version": "2026.9.18",
4
4
  "description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
5
5
  "keywords": [
6
6
  "extensions",
@@ -38,20 +38,13 @@
38
38
  "@ast-grep/napi": "^0.45.0",
39
39
  "@bufbuild/protobuf": "^2.14.0",
40
40
  "@dietrichgebert/ponytail": "4.10.0",
41
- "@earendil-works/pi-ai": "^0.87.1",
42
- "@earendil-works/pi-coding-agent": "^0.87.1",
43
- "@earendil-works/pi-tui": "^0.87.1",
44
- "@herbertgao/pi-bark": "0.1.3",
45
- "@herbertgao/pi-cc-extensions": "0.9.5",
46
- "@herbertgao/pi-subagents": "0.18.3",
47
- "@herbertgao/resume-from": "0.2.3",
48
- "@herbertgao/sol-pi": "0.3.2",
41
+ "@herbertgao/pi-bark": "0.1.4",
42
+ "@herbertgao/pi-cc-extensions": "0.9.6",
43
+ "@herbertgao/pi-subagents": "0.18.4",
44
+ "@herbertgao/resume-from": "0.2.4",
45
+ "@herbertgao/sol-pi": "0.3.4",
49
46
  "@juicesharp/rpiv-ask-user-question": "2.11.0",
50
47
  "@juicesharp/rpiv-config": "^2.11.0",
51
- "@modelcontextprotocol/client": "2.0.0",
52
- "@modelcontextprotocol/core": "2.0.0",
53
- "@modelcontextprotocol/ext-apps": "^1.2.2",
54
- "@modelcontextprotocol/ext-tasks": "^0.1.0",
55
48
  "@modelcontextprotocol/sdk": "^1.29.0",
56
49
  "@mozilla/readability": "^0.6.0",
57
50
  "@napi-rs/keyring": "^2.1.0",
@@ -61,20 +54,16 @@
61
54
  "@noble/ed25519": "^3.1.0",
62
55
  "@pi-plugins/fast-mode": "0.1.12",
63
56
  "@shikijs/cli": "^4.0.2",
64
- "@sinclair/typebox": "^0.34.49",
65
57
  "@tifan/pi-copy-response": "0.2.7",
66
- "@tifan/pi-handoff": "2.2.1",
58
+ "@tifan/pi-handoff": "2.2.2",
67
59
  "@tifan/pi-inline-skills": "1.0.6",
68
60
  "@tifan/pi-mermaid-open": "0.2.1",
69
61
  "@tifan/pi-preferred-thinking": "1.0.2",
70
62
  "@tifan/pi-recap": "0.4.7",
71
63
  "@tifan/pi-rename": "0.6.0",
72
64
  "@typesafe-ai/sdk": "0.6.0",
73
- "ajv": "^8.17.1",
74
- "ajv-formats": "^3.0.1",
75
65
  "chalk": "^6.0.0",
76
66
  "croner": "^10.0.1",
77
- "cross-spawn": "^7.0.6",
78
67
  "dbus-native": "^0.15.2",
79
68
  "defuddle": "0.19.3",
80
69
  "gpt-tokenizer": "^3.4.0",
@@ -84,27 +73,21 @@
84
73
  "linkedom": "^0.16.0",
85
74
  "minimatch": "^10.2.6",
86
75
  "nanoid": "^5.0.0",
87
- "open": "^10.2.0",
88
76
  "p-limit": "^6.1.0",
89
77
  "pi-antigravity": "0.7.2",
90
78
  "pi-footer": "0.5.1",
91
79
  "pi-jev-auto-mode": "0.5.0",
92
80
  "pi-lens": "4.3.0",
93
- "pi-mcp-adapter": "2.38.0",
94
81
  "pi-multi-account": "1.23.2",
95
82
  "pi-next-cue": "1.0.7",
96
- "pi-typesafe": "0.7.4",
83
+ "pi-typesafe": "0.8.0",
97
84
  "pi-web-access": "0.31.0",
98
85
  "pidusage": "^4.0.1",
99
86
  "promise.try": "^2.0.1",
100
87
  "proper-lockfile": "4.1.2",
101
88
  "qrcode-terminal": "^0.12.0",
102
- "recheck": "4.6.0-beta.3",
103
89
  "remote-pi": "0.7.0",
104
- "smol-toml": "^1.6.1",
105
- "strip-json-comments": "^5.0.3",
106
90
  "turndown": "^7.2.0",
107
- "typebox": "^1.1.38",
108
91
  "unbash": "4.0.10",
109
92
  "undici": "^8.9.0",
110
93
  "unpdf": "^1.6.2",
@@ -112,6 +95,14 @@
112
95
  "ws": "^8.21.0",
113
96
  "zod": "^3.25.0 || ^4.0.0"
114
97
  },
98
+ "peerDependencies": {
99
+ "@earendil-works/pi-agent-core": "*",
100
+ "@earendil-works/pi-ai": "*",
101
+ "@earendil-works/pi-coding-agent": "*",
102
+ "@earendil-works/pi-tui": "*",
103
+ "@sinclair/typebox": "*",
104
+ "typebox": "*"
105
+ },
115
106
  "optionalDependencies": {
116
107
  "web-tree-sitter": "0.25.10"
117
108
  },
@@ -138,7 +129,6 @@
138
129
  "pi-footer",
139
130
  "pi-jev-auto-mode",
140
131
  "pi-lens",
141
- "pi-mcp-adapter",
142
132
  "pi-multi-account",
143
133
  "pi-next-cue",
144
134
  "pi-typesafe",
@@ -168,7 +158,6 @@
168
158
  "./node_modules/@narumitw/pi-btw/dist/index.ts",
169
159
  "./node_modules/@narumitw/pi-caffeinate/dist/index.ts",
170
160
  "./node_modules/@pi-plugins/fast-mode/dist/index.mjs",
171
- "./node_modules/pi-mcp-adapter/index.ts",
172
161
  "./node_modules/pi-jev-auto-mode/index.ts",
173
162
  "./node_modules/pi-multi-account/index.ts",
174
163
  "./node_modules/pi-next-cue/index.ts",
@@ -185,7 +174,6 @@
185
174
  ],
186
175
  "skills": [
187
176
  "./node_modules/@dietrichgebert/ponytail/skills",
188
- "./node_modules/pi-mcp-adapter/skills",
189
177
  "./node_modules/pi-lens/skills"
190
178
  ]
191
179
  }