@undefineds.co/xpod 0.4.12 → 0.4.13

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 (207) hide show
  1. package/dist/acceptance/QleverSemanticConformance.js +7 -0
  2. package/dist/api/ai-gateway/providers/OfferingAuthorization.d.ts +6 -1
  3. package/dist/api/ai-gateway/providers/OfferingAuthorization.js +0 -3
  4. package/dist/api/ai-gateway/providers/ProviderRegistry.js +2 -2
  5. package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.d.ts +1 -1
  6. package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.js +1 -1
  7. package/dist/api/service/AiClientConfigurationService.d.ts +1 -1
  8. package/dist/api/service/AiClientConfigurationService.js +1 -1
  9. package/dist/storage/rdf/PostgresRdfEngine.js +10 -4
  10. package/dist/storage/rdf/RdfAccessScope.js +15 -1
  11. package/dist/storage/rdf/RdfEngineRdfJsSource.js +10 -2
  12. package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.d.ts +1 -1
  13. package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +1 -1
  14. package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +1 -1
  15. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +1 -1
  16. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +3 -3
  17. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.d.ts +1 -1
  18. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +1 -1
  19. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +2 -2
  20. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.d.ts +1 -1
  21. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.d.ts +1 -1
  22. package/node_modules/@undefineds.co/ai-connections/dist/AiCustomProviderDialog.d.ts +1 -1
  23. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.d.ts +1 -1
  24. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +1 -1
  25. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +1 -1
  26. package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.d.ts +1 -1
  27. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.d.ts +1 -1
  28. package/node_modules/@undefineds.co/ai-connections/dist/AiQuotaCard.d.ts +1 -1
  29. package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.d.ts +1 -1
  30. package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +13 -11
  31. package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.js +16 -13
  32. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +1 -1
  33. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +3 -3
  34. package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +1 -1
  35. package/node_modules/@undefineds.co/ai-connections/dist/collections.js +3 -3
  36. package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +1 -1
  37. package/node_modules/@undefineds.co/ai-connections/dist/controller.js +3 -2
  38. package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +1 -1
  39. package/node_modules/@undefineds.co/ai-connections/dist/display-wording.d.ts +20 -0
  40. package/node_modules/@undefineds.co/ai-connections/dist/display-wording.js +73 -0
  41. package/node_modules/@undefineds.co/ai-connections/dist/error-wording.d.ts +24 -0
  42. package/node_modules/@undefineds.co/ai-connections/dist/error-wording.js +253 -0
  43. package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +1 -1
  44. package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +2 -3
  45. package/node_modules/@undefineds.co/ai-connections/dist/index.js +2 -3
  46. package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +1 -1
  47. package/node_modules/@undefineds.co/ai-connections/dist/offering-label.d.ts +1 -1
  48. package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +1 -1
  49. package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +1 -1
  50. package/node_modules/@undefineds.co/ai-connections/dist/useAiConnectDialog.d.ts +1 -1
  51. package/node_modules/@undefineds.co/ai-connections/package.json +1 -24
  52. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/ai-connections-client.d.ts +5 -3
  53. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/ai-connections-client.js +5 -3
  54. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/normalize.d.ts +17 -7
  55. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/normalize.js +18 -213
  56. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/request.js +3 -3
  57. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/types.d.ts +11 -2
  58. package/node_modules/@undefineds.co/ai-connections-core/dist/index.d.ts +9 -0
  59. package/node_modules/@undefineds.co/ai-connections-core/dist/index.js +9 -0
  60. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/provider-catalog.cjs +2 -25
  61. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/provider-catalog.d.ts +9 -8
  62. package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/provider-catalog.js +11 -31
  63. package/node_modules/@undefineds.co/ai-connections-core/package.json +61 -0
  64. package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +4 -2
  65. package/node_modules/@undefineds.co/shared-ui/dist/index.js +4 -2
  66. package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.d.ts +4 -1
  67. package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.js +12 -6
  68. package/node_modules/@undefineds.co/shared-ui/dist/login/LoginView.d.ts +1 -1
  69. package/node_modules/@undefineds.co/shared-ui/dist/login/host-types.d.ts +7 -1
  70. package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.d.ts +6 -0
  71. package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.js +18 -0
  72. package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.d.ts +14 -2
  73. package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.js +26 -17
  74. package/node_modules/@undefineds.co/solid-sdk/dist/login-store.d.ts +3 -3
  75. package/node_modules/@undefineds.co/solid-sdk/dist/login-store.js +3 -3
  76. package/package.json +5 -3
  77. package/static/app/assets/main.css +1 -1
  78. package/static/auth-callback/assets/{AiConfigContext-DnQs1ZpW.js → AiConfigContext-DlFyEWy9.js} +1 -1
  79. package/static/auth-callback/assets/{AiConfigPage-DOtvlxH0.js → AiConfigPage-CkYk-SFW.js} +1 -1
  80. package/static/auth-callback/assets/{DocumentProcessingPanel-BS2voQgL.js → DocumentProcessingPanel-CqIr3JqN.js} +1 -1
  81. package/static/auth-callback/assets/{IndexLifecyclePanel-Cvt0cJtN.js → IndexLifecyclePanel-C1GKV3Vx.js} +1 -1
  82. package/static/auth-callback/assets/{IndexSubjectPanel-Dhf01GqF.js → IndexSubjectPanel-ro9lC6XW.js} +1 -1
  83. package/static/auth-callback/assets/{ModelAssignmentsPanel-BJutWaAF.js → ModelAssignmentsPanel-DxNdyKRJ.js} +1 -1
  84. package/static/auth-callback/assets/{ModelsPage-BRS0sje3.js → ModelsPage-BVtWSPBU.js} +6 -6
  85. package/static/auth-callback/assets/{NetworkPage-B3qBfANA.js → NetworkPage-cEvxRMAl.js} +1 -1
  86. package/static/auth-callback/assets/{PaneListHeader-QQeJGTp4.js → PaneListHeader-ByKw8ada.js} +1 -1
  87. package/static/auth-callback/assets/{SearchIndexingPanel-MyNUSEwT.js → SearchIndexingPanel-CulBKcYT.js} +1 -1
  88. package/static/auth-callback/assets/{StatusSubjectPanel-DQkEVsFs.js → StatusSubjectPanel-VOcfrt8o.js} +1 -1
  89. package/static/auth-callback/assets/{StatusWorkspace-Dkv63Uwk.js → StatusWorkspace-Jsz6hAdE.js} +1 -1
  90. package/static/auth-callback/assets/{SystemSettingsPage-TIsUfX5d.js → SystemSettingsPage-BFNvGAle.js} +1 -1
  91. package/static/auth-callback/assets/{SystemSettingsSubjectPanel-BJWEt2-7.js → SystemSettingsSubjectPanel-DFRdrSfK.js} +1 -1
  92. package/static/auth-callback/assets/XpodAiConnectionsPodStore-C6KpvHVg.js +3 -0
  93. package/static/auth-callback/assets/{activity-5hNeNKnL.js → activity-DnTlb9iM.js} +1 -1
  94. package/static/auth-callback/assets/ai-connections-C6yaE6WQ.js +1 -0
  95. package/static/auth-callback/assets/auth-callback-Cx9D_1qj.css +1 -0
  96. package/static/auth-callback/assets/{auth-callback-CAFZ3R0B.js → auth-callback-D2UkK5Xj.js} +3 -3
  97. package/static/auth-callback/assets/{badge-CAIPI0CB.js → badge-D7IJuuTM.js} +1 -1
  98. package/static/auth-callback/assets/{collection-runtime-D9s7h9YA.js → collection-runtime-wT1n4GS2.js} +1 -1
  99. package/static/auth-callback/assets/{dialog-BjA109aX.js → dialog-DickLu5z.js} +1 -1
  100. package/static/auth-callback/assets/{download-B3Up5W2G.js → download-kn8WnRu3.js} +1 -1
  101. package/static/auth-callback/assets/{external-link-BTXgSPzB.js → external-link-B6B8jfSn.js} +1 -1
  102. package/static/auth-callback/assets/{index-DlLYWOhw.js → index-Cu0EguPo.js} +2 -2
  103. package/static/auth-callback/assets/{index-BppXlxcp.js → index-DHF97YLP.js} +1 -1
  104. package/static/auth-callback/assets/{index-CirW4CJf.js → index-Dz83EEHD.js} +1 -1
  105. package/static/auth-callback/assets/{index-browser-DtU38ni3.js → index-browser-CSghinyi.js} +1 -1
  106. package/static/auth-callback/assets/{key-round-CQCOrZ7x.js → key-round-ChkOx3E1.js} +1 -1
  107. package/static/auth-callback/assets/{rotate-ccw-C1zM2KtS.js → rotate-ccw-B3hE-nyd.js} +1 -1
  108. package/static/auth-callback/assets/{skeleton-Cqp7_M9-.js → skeleton-kEqR7tpI.js} +1 -1
  109. package/static/auth-callback/assets/{waypoints-Bj6gAUSQ.js → waypoints-D6Jo-SZa.js} +1 -1
  110. package/static/auth-callback/assets/{workspace-layout-DK8mDzrY.js → workspace-layout-BHwT_cHd.js} +1 -1
  111. package/static/auth-callback/auth-callback.html +2 -2
  112. package/static/dashboard/assets/{AiConfigContext-BsE7MqX8.js → AiConfigContext-BfC3v-x2.js} +1 -1
  113. package/static/dashboard/assets/{AiConfigPage-DvM-lRXa.js → AiConfigPage-QNS3u7Ff.js} +1 -1
  114. package/static/dashboard/assets/{DocumentProcessingPanel-BPfdlfuf.js → DocumentProcessingPanel-Dr4XLeT4.js} +1 -1
  115. package/static/dashboard/assets/{IndexLifecyclePanel--m0AGxvh.js → IndexLifecyclePanel-KtM_gpeO.js} +1 -1
  116. package/static/dashboard/assets/{IndexSubjectPanel-Bb7m1k3d.js → IndexSubjectPanel-DLaiKdLc.js} +1 -1
  117. package/static/dashboard/assets/{ModelAssignmentsPanel-BLi_zbMa.js → ModelAssignmentsPanel-Bk7TvQRq.js} +1 -1
  118. package/static/dashboard/assets/{ModelsPage-CxdpgnfR.js → ModelsPage-Cci3vlos.js} +6 -6
  119. package/static/dashboard/assets/{NetworkPage-BAIPw-D_.js → NetworkPage-Ot4G2dX5.js} +1 -1
  120. package/static/dashboard/assets/{PaneListHeader-BBCMei0r.js → PaneListHeader-qHME_s08.js} +1 -1
  121. package/static/dashboard/assets/{SearchIndexingPanel-Ck4Y-xjR.js → SearchIndexingPanel-HZPKj8H9.js} +1 -1
  122. package/static/dashboard/assets/{StatusSubjectPanel-D1KWfAXE.js → StatusSubjectPanel-ij7IpI8d.js} +1 -1
  123. package/static/dashboard/assets/{StatusWorkspace-JbA5gzXx.js → StatusWorkspace-Cp02JcaN.js} +1 -1
  124. package/static/dashboard/assets/{SystemSettingsPage-BbwQWsSR.js → SystemSettingsPage-BSeuvb8X.js} +1 -1
  125. package/static/dashboard/assets/{SystemSettingsSubjectPanel-N117nMt5.js → SystemSettingsSubjectPanel-CP4_luGS.js} +1 -1
  126. package/static/dashboard/assets/{XpodAiConnectionsPodStore-CdDOb4SV.js → XpodAiConnectionsPodStore-urO6zaHL.js} +7 -7
  127. package/static/dashboard/assets/{activity-DX1I96o_.js → activity-DxjgQNvr.js} +1 -1
  128. package/static/dashboard/assets/ai-connections-CXp5gd1J.js +1 -0
  129. package/static/dashboard/assets/{badge-k2vhtDqH.js → badge-53qCrRbl.js} +1 -1
  130. package/static/dashboard/assets/{collection-runtime-BFQ8teQJ.js → collection-runtime-BPAmHG46.js} +1 -1
  131. package/static/dashboard/assets/{dashboard-DWZ-fmCT.js → dashboard-BcT2ByXw.js} +2 -2
  132. package/static/dashboard/assets/dashboard-Cx9D_1qj.css +1 -0
  133. package/static/dashboard/assets/{dialog-1CCw-iHT.js → dialog-B28YtNhS.js} +1 -1
  134. package/static/dashboard/assets/{download-C6-SNY1q.js → download-DkLNceJ4.js} +1 -1
  135. package/static/dashboard/assets/{external-link-BgPcZ_j2.js → external-link-D3TXnlo3.js} +1 -1
  136. package/static/dashboard/assets/{index-D7A8U6Pt.js → index-CFIenkeK.js} +1 -1
  137. package/static/dashboard/assets/{index-6LcIUIYO.js → index-CIiBu9mr.js} +1 -1
  138. package/static/dashboard/assets/{index-UD6QOE7H.js → index-Gp3cLolR.js} +2 -2
  139. package/static/dashboard/assets/{key-round-BOd7Jo0Q.js → key-round-B5ccp6nx.js} +1 -1
  140. package/static/dashboard/assets/{rotate-ccw-CCgJqsvx.js → rotate-ccw-DUpfkNnk.js} +1 -1
  141. package/static/dashboard/assets/{skeleton-Bc7abAn5.js → skeleton-BRe19fO0.js} +1 -1
  142. package/static/dashboard/assets/{waypoints-s-opmJxx.js → waypoints-BKDMxEvu.js} +1 -1
  143. package/static/dashboard/assets/{workspace-layout-DqIQeTBV.js → workspace-layout-ZTF7C16h.js} +1 -1
  144. package/static/dashboard/dashboard.html +2 -2
  145. package/static/settings/assets/{AiConfigContext-BB9KZySa.js → AiConfigContext-DsyWgu2i.js} +1 -1
  146. package/static/settings/assets/{AiConfigPage-DGSXUkLs.js → AiConfigPage-CSCBckKo.js} +1 -1
  147. package/static/settings/assets/{DocumentProcessingPanel-Da2Re6Rg.js → DocumentProcessingPanel-w9yQDbBe.js} +1 -1
  148. package/static/settings/assets/{IndexLifecyclePanel-BSZuIzgr.js → IndexLifecyclePanel-CUUXI8mP.js} +1 -1
  149. package/static/settings/assets/{IndexSubjectPanel-CFd0ay-r.js → IndexSubjectPanel-BypAU5TJ.js} +1 -1
  150. package/static/settings/assets/{ModelAssignmentsPanel-CSAryvWJ.js → ModelAssignmentsPanel-BetgXw1G.js} +1 -1
  151. package/static/settings/assets/{ModelsPage-BQwCwLHU.js → ModelsPage-DZpTlTZ3.js} +6 -6
  152. package/static/settings/assets/{NetworkPage-BKymvsQc.js → NetworkPage-BVkasFGM.js} +1 -1
  153. package/static/settings/assets/{PaneListHeader-Bjh3hRdQ.js → PaneListHeader-BGOqGec4.js} +1 -1
  154. package/static/settings/assets/{SearchIndexingPanel-MjKL5QLU.js → SearchIndexingPanel-DYAbpZ_9.js} +1 -1
  155. package/static/settings/assets/{StatusSubjectPanel-Bvl6K4mx.js → StatusSubjectPanel-CFgzeQ8Q.js} +1 -1
  156. package/static/settings/assets/{StatusWorkspace-B0NzrP--.js → StatusWorkspace-4Z6g4Jvv.js} +1 -1
  157. package/static/settings/assets/{SystemSettingsPage-D2z6Z4FE.js → SystemSettingsPage-C1tlrgvI.js} +1 -1
  158. package/static/settings/assets/{SystemSettingsSubjectPanel-4sxma4X4.js → SystemSettingsSubjectPanel-CcURI-1L.js} +1 -1
  159. package/static/settings/assets/XpodAiConnectionsPodStore-owBQc5nY.js +3 -0
  160. package/static/settings/assets/{activity-CgJJGpjx.js → activity-CtBc9cNy.js} +1 -1
  161. package/static/settings/assets/ai-connections-C6yaE6WQ.js +1 -0
  162. package/static/settings/assets/{badge-C4NypVyT.js → badge--r-FDIhU.js} +1 -1
  163. package/static/settings/assets/{collection-runtime-CTLCDxAi.js → collection-runtime-CnhPmwAM.js} +1 -1
  164. package/static/settings/assets/{dialog-Csq0vWUi.js → dialog-B7ZRsjN7.js} +1 -1
  165. package/static/settings/assets/{download-DaLJJ-Wp.js → download-DgQ1F8QR.js} +1 -1
  166. package/static/settings/assets/{external-link--w_iW5Au.js → external-link-Bz7NckNO.js} +1 -1
  167. package/static/settings/assets/{index-B0mQa59b.js → index-BdXwm8nh.js} +2 -2
  168. package/static/settings/assets/{index-COmVnZi2.js → index-CkGda_Pg.js} +1 -1
  169. package/static/settings/assets/{index-BukHiu4y.js → index-Vv-8Vslg.js} +1 -1
  170. package/static/settings/assets/{index-browser-BGpvHwD0.js → index-browser-Dq7omlpY.js} +1 -1
  171. package/static/settings/assets/{key-round-Bk4YRjBu.js → key-round-CvuhloKV.js} +1 -1
  172. package/static/settings/assets/{rotate-ccw-TCabbqsr.js → rotate-ccw-DgFKDaz7.js} +1 -1
  173. package/static/settings/assets/{settings-CJWpdbNC.js → settings-BvqY7K96.js} +3 -3
  174. package/static/settings/assets/settings-Cx9D_1qj.css +1 -0
  175. package/static/settings/assets/{skeleton-JDHYVe7t.js → skeleton-D3OeFDF6.js} +1 -1
  176. package/static/settings/assets/{waypoints-DDvEl-MU.js → waypoints-C4WbspTb.js} +1 -1
  177. package/static/settings/assets/{workspace-layout-DV5QU30U.js → workspace-layout-B9H1Tqrk.js} +1 -1
  178. package/static/settings/settings.html +2 -2
  179. package/static/auth-callback/assets/XpodAiConnectionsPodStore-BJiXm-PF.js +0 -3
  180. package/static/auth-callback/assets/ai-connections-CryuHGKW.js +0 -1
  181. package/static/auth-callback/assets/auth-callback-rk080mvG.css +0 -1
  182. package/static/dashboard/assets/ai-connections-DwCRqOQa.js +0 -1
  183. package/static/dashboard/assets/dashboard-rk080mvG.css +0 -1
  184. package/static/settings/assets/XpodAiConnectionsPodStore-BkNQ8fZx.js +0 -3
  185. package/static/settings/assets/ai-connections-CryuHGKW.js +0 -1
  186. package/static/settings/assets/settings-rk080mvG.css +0 -1
  187. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/request.d.ts +0 -0
  188. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client/types.js +0 -0
  189. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/base-adapter.d.ts +0 -0
  190. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/base-adapter.js +0 -0
  191. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/codex.d.ts +0 -0
  192. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/codex.js +0 -0
  193. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/index.cjs +0 -0
  194. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/index.d.ts +0 -0
  195. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/index.js +0 -0
  196. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/json-env-adapter.d.ts +0 -0
  197. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/json-env-adapter.js +0 -0
  198. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/pi.d.ts +0 -0
  199. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/pi.js +0 -0
  200. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/transaction.d.ts +0 -0
  201. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/transaction.js +0 -0
  202. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/types.d.ts +0 -0
  203. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/client-config/types.js +0 -0
  204. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/credential-storage.d.ts +0 -0
  205. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/credential-storage.js +0 -0
  206. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/endpoint-urls.d.ts +0 -0
  207. /package/node_modules/@undefineds.co/{ai-connections → ai-connections-core}/dist/endpoint-urls.js +0 -0
@@ -0,0 +1,73 @@
1
+ /**
2
+ * The wording this applet shows, in one place.
3
+ *
4
+ * The shared core carries what a provider *is* and how to talk to it - ids,
5
+ * auth modes, connect modes, endpoints - and deliberately carries no user-facing
6
+ * wording. A connect entry's wording is a property of the entry's id, so it
7
+ * belongs here, where it is rendered, rather than in the catalog, in the
8
+ * payload the server sends, and in this applet's own fallback derivation, which
9
+ * is where the same button used to be named three different ways.
10
+ *
11
+ * An id this table does not know keeps whatever wording its payload declared:
12
+ * a provider the user configured themselves can still name its own entry, and an
13
+ * entry that names nothing stays unrendered, which is how "the offering did not
14
+ * ask for this button" has always been expressed.
15
+ *
16
+ * The table lists only the ids the shared core stopped naming - the four connect
17
+ * actions plus the browser authorization-code entry. A declared wording always
18
+ * wins (see `authorizationMethodLabel`); this is the fallback that keeps a
19
+ * payload naming nothing renderable under the action's own name.
20
+ */
21
+ const AUTHORIZATION_METHOD_LABEL_BY_ID = {
22
+ 'api-key': '添加 API Key',
23
+ 'browser-login': '浏览器登录',
24
+ 'browser-oauth': '浏览器登录',
25
+ 'device-code': '设备码登录',
26
+ 'local-session-import': '已有登录态',
27
+ 'local-service': '本地服务',
28
+ };
29
+ /**
30
+ * Wording for one connect entry.
31
+ *
32
+ * A payload that declares its own wording keeps it: the entry's own name is the
33
+ * more specific statement, and it is how a provider the user configured names
34
+ * its entry, and how one offering renames a shared action for its context. The
35
+ * table only fills the gap the shared core deliberately leaves - it names the
36
+ * action by `id` and no longer writes the button.
37
+ */
38
+ export function authorizationMethodLabel(method) {
39
+ return method.label ?? AUTHORIZATION_METHOD_LABEL_BY_ID[method.id];
40
+ }
41
+ /** Fills in the wording of every entry that has one. */
42
+ export function withAuthorizationMethodLabels(methods) {
43
+ return methods.map((method) => {
44
+ const label = authorizationMethodLabel(method);
45
+ return label === method.label ? method : { ...method, label };
46
+ });
47
+ }
48
+ /**
49
+ * The name this applet shows for a provider. English for the providers whose
50
+ * product name is English, Chinese where the product is known by its Chinese
51
+ * name - a display decision, so it lives with the display layer instead of
52
+ * travelling in every payload.
53
+ */
54
+ export function providerDisplayName(provider) {
55
+ switch (provider) {
56
+ case 'openai':
57
+ return 'OpenAI';
58
+ case 'anthropic':
59
+ return 'Anthropic';
60
+ case 'kimi':
61
+ return 'Kimi';
62
+ case 'bailian':
63
+ return '百炼';
64
+ case 'deepseek':
65
+ return 'DeepSeek';
66
+ case 'zhipu':
67
+ return '智谱 AI';
68
+ case 'ollama':
69
+ return 'Ollama';
70
+ case 'custom':
71
+ return 'Custom';
72
+ }
73
+ }
@@ -0,0 +1,24 @@
1
+ import type { AiConnectionsClient, AiConnectionsProvider } from '@undefineds.co/ai-connections-core/client';
2
+ /**
3
+ * The sentence to show for anything a request threw.
4
+ *
5
+ * A failed request carries the facts - the wire code, the upstream status, the
6
+ * request's provider and auth mode - so the sentence is chosen from those rather
7
+ * than parsed back out of a message. Anything that is not a request failure (a
8
+ * thrown string, an unexpected `Error`) still goes through the sanitiser, which
9
+ * is what keeps internals off the screen.
10
+ */
11
+ export declare function aiConnectionsErrorMessage(error: unknown): string;
12
+ export declare function aiConnectionsErrorMessageForPayload(payload: unknown, status: number, context?: {
13
+ provider?: AiConnectionsProvider;
14
+ authMode?: 'apiKey' | 'deviceCodeOAuth' | 'local';
15
+ }): string;
16
+ /**
17
+ * The shared client reports a failure by naming its code; the sentence a user
18
+ * reads is the applet's (`error-wording`). This app renders messages straight
19
+ * from the thrown error, so it relabels them once, at its own boundary, instead
20
+ * of letting a code reach the screen or teaching every call site to translate.
21
+ * The error object itself is rethrown unchanged, so callers that inspect it -
22
+ * `instanceof`, `code`, `providerStatus` - keep working.
23
+ */
24
+ export declare function withDisplayableErrors(client: AiConnectionsClient): AiConnectionsClient;
@@ -0,0 +1,253 @@
1
+ import { AiConnectionsRequestError, aiConnectionsErrorCode } from '@undefineds.co/ai-connections-core/client';
2
+ /**
3
+ * The wording a failed AI Connection request is shown under.
4
+ *
5
+ * This used to live in the shared core, which meant the published contract
6
+ * carried sentences: nine Chinese messages plus the English fallbacks, and every
7
+ * consumer of the client - the applet and the web app - displayed wording chosen
8
+ * by a package that has no idea who is rendering it. The core now classifies a
9
+ * failure and hands over its code; the sentence is chosen here, where it is read.
10
+ *
11
+ * The rules below are a move, not a rewrite: the same codes map to the same
12
+ * sentences as before, so nothing a user reads changes.
13
+ */
14
+ const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = 'AI Connection request failed. Please try again.';
15
+ function isRecord(value) {
16
+ return typeof value === 'object' && value !== null;
17
+ }
18
+ const LOCAL_SESSION_REFRESH_FAILED_MESSAGE = '订阅登录态自动刷新失败,请稍后重试。';
19
+ const LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE = '订阅登录态已失效,请在原客户端重新登录后重读,或使用设备码登录。';
20
+ const OAUTH_MODEL_AUTH_FAILED_MESSAGE = '订阅登录态不可用,请重读登录态或重新登录后再同步模型。';
21
+ const MODEL_DISCOVERY_SAFE_MESSAGES = new Set([
22
+ OAUTH_MODEL_AUTH_FAILED_MESSAGE,
23
+ LOCAL_SESSION_REFRESH_FAILED_MESSAGE,
24
+ LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE,
25
+ '密钥不可用。请检查密钥是否填写正确,或换一个密钥后重试。',
26
+ '模型服务地址不正确。请检查服务地址后重试。',
27
+ '请求太频繁。请稍等一会儿再试。',
28
+ '模型服务暂时没有响应。请稍后重试。',
29
+ '模型列表获取失败。请检查密钥、服务地址或网络后重试。',
30
+ ]);
31
+ function normalizeAiConnectionsErrorText(message) {
32
+ if (message.startsWith('provider_models_response_error:')) {
33
+ return sanitizeProviderResponseMessage(message.slice('provider_models_response_error:'.length))
34
+ ?? '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
35
+ }
36
+ const exact = messageForSafeErrorCode(message);
37
+ if (exact)
38
+ return exact;
39
+ const prefix = message.split(':', 1)[0]?.trim();
40
+ const prefixed = prefix ? messageForSafeErrorCode(prefix) : undefined;
41
+ if (prefixed)
42
+ return prefixed;
43
+ if (message === 'AI Connection service identity is unavailable')
44
+ return message;
45
+ if (MODEL_DISCOVERY_SAFE_MESSAGES.has(message))
46
+ return message;
47
+ if (isModelDiscoveryMessageWithProviderDetail(message))
48
+ return message;
49
+ if (message.startsWith('invalid_'))
50
+ return 'AI Connection returned an invalid response.';
51
+ return AI_CONNECTIONS_GENERIC_ERROR_MESSAGE;
52
+ }
53
+ /**
54
+ * The sentence to show for anything a request threw.
55
+ *
56
+ * A failed request carries the facts - the wire code, the upstream status, the
57
+ * request's provider and auth mode - so the sentence is chosen from those rather
58
+ * than parsed back out of a message. Anything that is not a request failure (a
59
+ * thrown string, an unexpected `Error`) still goes through the sanitiser, which
60
+ * is what keeps internals off the screen.
61
+ */
62
+ export function aiConnectionsErrorMessage(error) {
63
+ if (error instanceof AiConnectionsRequestError) {
64
+ return aiConnectionsErrorMessageForPayload(error.payload, error.status, {
65
+ provider: error.provider,
66
+ authMode: error.authMode,
67
+ });
68
+ }
69
+ if (error instanceof Error) {
70
+ return normalizeAiConnectionsErrorText(error.message);
71
+ }
72
+ return normalizeAiConnectionsErrorText(String(error));
73
+ }
74
+ export function aiConnectionsErrorMessageForPayload(payload, status, context = {}) {
75
+ const code = aiConnectionsErrorCode(payload);
76
+ if (code === 'provider_models_response_error') {
77
+ const message = isRecord(payload) && typeof payload.message === 'string'
78
+ ? sanitizeProviderResponseMessage(payload.message)
79
+ : undefined;
80
+ if (message)
81
+ return message;
82
+ return '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
83
+ }
84
+ if (code === 'provider_models_fetch_failed') {
85
+ const providerStatus = isRecord(payload) && typeof payload.providerStatus === 'number'
86
+ ? payload.providerStatus
87
+ : undefined;
88
+ const providerMessage = isRecord(payload) && typeof payload.providerMessage === 'string'
89
+ ? payload.providerMessage.trim()
90
+ : undefined;
91
+ return withProviderMessage(modelDiscoveryErrorMessage(providerStatus, context.authMode), providerMessage);
92
+ }
93
+ const coded = code ? messageForSafeErrorCode(code, context.provider) : undefined;
94
+ if (coded)
95
+ return coded;
96
+ const text = isRecord(payload) && typeof payload.error === 'string'
97
+ ? payload.error
98
+ : undefined;
99
+ if (text) {
100
+ const exact = messageForSafeErrorCode(text, context.provider);
101
+ if (exact)
102
+ return exact;
103
+ if (text === 'AI Connection service identity is unavailable') {
104
+ return text;
105
+ }
106
+ if (text === 'Provider credential not found for current identity') {
107
+ return '当前身份没有可用的额度凭证。';
108
+ }
109
+ if (text === 'Provider quota adapter not found' || text === 'Provider quota lookup failed') {
110
+ return '该接入方式不支持查询官方额度。';
111
+ }
112
+ }
113
+ if (status === 401)
114
+ return 'Please sign in again to continue.';
115
+ if (status === 403)
116
+ return 'AI Connection permission was denied.';
117
+ if (status === 404 && context.provider) {
118
+ return `${providerLabel(context.provider)} connection is not configured.`;
119
+ }
120
+ if (status === 429)
121
+ return 'AI Connection is rate limited. Please try again later.';
122
+ if (status === 503)
123
+ return 'AI Connection service is unavailable.';
124
+ return AI_CONNECTIONS_GENERIC_ERROR_MESSAGE;
125
+ }
126
+ function messageForSafeErrorCode(code, provider) {
127
+ switch (code.trim().toLowerCase().replace(/-/g, '_')) {
128
+ case 'not_configured':
129
+ case 'notconfigured':
130
+ return provider
131
+ ? `${providerLabel(provider)} connection is not configured.`
132
+ : 'AI provider connection is not configured.';
133
+ case 'unsupported':
134
+ return provider
135
+ ? `${providerLabel(provider)} does not support this operation.`
136
+ : 'This AI Connection operation is not supported.';
137
+ case 'service_identity_unavailable':
138
+ return 'AI Connection service identity is unavailable';
139
+ case 'unauthorized':
140
+ return 'Please sign in again to continue.';
141
+ case 'forbidden':
142
+ case 'permission_denied':
143
+ return 'AI Connection permission was denied.';
144
+ case 'rate_limited':
145
+ return 'AI Connection is rate limited. Please try again later.';
146
+ case 'service_unavailable':
147
+ return 'AI Connection service is unavailable.';
148
+ case 'unsafe_provider_base_url':
149
+ return '该服务地址指向 Xpod 不允许访问的网络,请改用公网 HTTPS 地址。';
150
+ case 'invalid_proxy_url':
151
+ return '代理地址必须是无账号密码的 HTTP 或 HTTPS 地址。';
152
+ case 'oauth_refresh_failed':
153
+ case 'oauth_refresh_unavailable':
154
+ case 'local_session_refresh_failed':
155
+ return LOCAL_SESSION_REFRESH_FAILED_MESSAGE;
156
+ case 'oauth_session_reauth_required':
157
+ case 'oauth_refresh_token_required':
158
+ case 'local_session_reauth_required':
159
+ case 'local_session_missing_refresh_token':
160
+ return LOCAL_SESSION_REAUTH_REQUIRED_MESSAGE;
161
+ case 'models_persistence_failed':
162
+ return '模型已获取,但保存到 Pod 失败。请重试同步模型。';
163
+ case 'quota_credential_not_found':
164
+ return '当前身份没有可用的额度凭证。';
165
+ case 'credential_secret_unavailable':
166
+ return '当前凭证密钥不可用,请重新保存后再查询额度。';
167
+ case 'gateway_api_key_plaintext_unavailable':
168
+ return 'Pod 中未找到此 API Key 的原文,无法复制配置。请创建新的 Key,更新客户端后再删除旧 Key。';
169
+ case 'quota_adapter_not_found':
170
+ return '该接入方式不支持查询官方额度。';
171
+ default:
172
+ return undefined;
173
+ }
174
+ }
175
+ function modelDiscoveryErrorMessage(providerStatus, authMode) {
176
+ if (providerStatus === 401 || providerStatus === 403) {
177
+ if (authMode === 'deviceCodeOAuth')
178
+ return OAUTH_MODEL_AUTH_FAILED_MESSAGE;
179
+ return '密钥不可用。请检查密钥是否填写正确,或换一个密钥后重试。';
180
+ }
181
+ if (providerStatus === 404) {
182
+ return '模型服务地址不正确。请检查服务地址后重试。';
183
+ }
184
+ if (providerStatus === 429) {
185
+ return '请求太频繁。请稍等一会儿再试。';
186
+ }
187
+ if (providerStatus !== undefined && providerStatus >= 500) {
188
+ return '模型服务暂时没有响应。请稍后重试。';
189
+ }
190
+ return '模型列表获取失败。请检查密钥、服务地址或网络后重试。';
191
+ }
192
+ function withProviderMessage(message, providerMessage) {
193
+ const sanitized = providerMessage ? sanitizeProviderResponseMessage(providerMessage) : undefined;
194
+ if (!sanitized)
195
+ return message;
196
+ return `${message} 上游返回:${sanitized}`;
197
+ }
198
+ function isModelDiscoveryMessageWithProviderDetail(message) {
199
+ const marker = ' 上游返回:';
200
+ const index = message.indexOf(marker);
201
+ if (index <= 0)
202
+ return false;
203
+ return MODEL_DISCOVERY_SAFE_MESSAGES.has(message.slice(0, index));
204
+ }
205
+ function sanitizeProviderResponseMessage(value) {
206
+ const sanitized = value
207
+ .replace(/[\u0000-\u001f\u007f]/gu, ' ')
208
+ .replace(/\bBearer\s+[^\s,;]+/giu, 'Bearer [REDACTED]')
209
+ .replace(/(?:sk|id)[._-][A-Za-z0-9._-]{8,}/gu, '[REDACTED]')
210
+ .replace(/https?:\/\/[^\s]+/giu, '[URL]')
211
+ .trim()
212
+ .slice(0, 240);
213
+ return sanitized || undefined;
214
+ }
215
+ function providerLabel(provider) {
216
+ switch (provider) {
217
+ case 'openai': return 'OpenAI';
218
+ case 'anthropic': return 'Anthropic';
219
+ case 'kimi': return 'Kimi';
220
+ case 'bailian': return 'Bailian';
221
+ case 'deepseek': return 'DeepSeek';
222
+ case 'zhipu': return 'Zhipu';
223
+ case 'ollama': return 'Ollama';
224
+ case 'custom': return 'Custom';
225
+ }
226
+ }
227
+ /**
228
+ * The shared client reports a failure by naming its code; the sentence a user
229
+ * reads is the applet's (`error-wording`). This app renders messages straight
230
+ * from the thrown error, so it relabels them once, at its own boundary, instead
231
+ * of letting a code reach the screen or teaching every call site to translate.
232
+ * The error object itself is rethrown unchanged, so callers that inspect it -
233
+ * `instanceof`, `code`, `providerStatus` - keep working.
234
+ */
235
+ export function withDisplayableErrors(client) {
236
+ const wrapped = { ...client };
237
+ for (const [key, value] of Object.entries(client)) {
238
+ if (typeof value !== 'function')
239
+ continue;
240
+ wrapped[key] = async (...args) => {
241
+ try {
242
+ return await value.apply(client, args);
243
+ }
244
+ catch (error) {
245
+ if (error instanceof AiConnectionsRequestError) {
246
+ error.message = aiConnectionsErrorMessage(error);
247
+ }
248
+ throw error;
249
+ }
250
+ };
251
+ }
252
+ return wrapped;
253
+ }
@@ -1,4 +1,4 @@
1
- import { normalizeMessagesEndpoint, normalizeV1Endpoint } from './endpoint-urls.js';
1
+ import { normalizeMessagesEndpoint, normalizeV1Endpoint } from '@undefineds.co/ai-connections-core/endpoint-urls';
2
2
  /**
3
3
  * The protocols the Xpod gateway serves, as registered by
4
4
  * `src/api/handlers/AiGatewayHandler.ts`:
@@ -1,6 +1,5 @@
1
1
  import type { WebExtensionModule } from '@undefineds.co/extension-sdk/web';
2
2
  import { type AiConnectionsController } from './controller';
3
- export * from './ai-connections-client';
4
3
  export * from './AiClientConfigurationSection';
5
4
  export * from './AiConnectionsPanel';
6
5
  export * from './AiCopyButton';
@@ -16,8 +15,8 @@ export * from './AiCustomProviderDialog';
16
15
  export * from './AiModelEditorDialog';
17
16
  export * from './controller';
18
17
  export * from './collections';
19
- export * from './credential-storage';
20
- export * from './endpoint-urls';
18
+ export * from './display-wording';
19
+ export * from './error-wording';
21
20
  export * from './gateway-endpoints';
22
21
  export * from './AiProviderCard';
23
22
  export * from './AiCredentialPoolSection';
@@ -6,7 +6,6 @@ import { AiConnectionsMainHeader } from './AiConnectionsMainHeader.js';
6
6
  import { createAiConnectionsController, } from './controller.js';
7
7
  import { aiConnectionManifest } from './manifest.js';
8
8
  import { createElement } from 'react';
9
- export * from './ai-connections-client.js';
10
9
  export * from './AiClientConfigurationSection.js';
11
10
  export * from './AiConnectionsPanel.js';
12
11
  export * from './AiCopyButton.js';
@@ -22,8 +21,8 @@ export * from './AiCustomProviderDialog.js';
22
21
  export * from './AiModelEditorDialog.js';
23
22
  export * from './controller.js';
24
23
  export * from './collections.js';
25
- export * from './credential-storage.js';
26
- export * from './endpoint-urls.js';
24
+ export * from './display-wording.js';
25
+ export * from './error-wording.js';
27
26
  export * from './gateway-endpoints.js';
28
27
  export * from './AiProviderCard.js';
29
28
  export * from './AiCredentialPoolSection.js';
@@ -1,4 +1,4 @@
1
- import type { AiProviderOffering } from './ai-connections-client';
1
+ import type { AiProviderOffering } from '@undefineds.co/ai-connections-core/client';
2
2
  /** One protocol the user can point a client at: the `protocol → base URL` pair the UI lists. */
3
3
  export interface AiEndpointEntry {
4
4
  protocol: string;
@@ -1,4 +1,4 @@
1
- import type { AiProviderAuthorizationMethod, AiProviderOffering } from './ai-connections-client';
1
+ import type { AiProviderAuthorizationMethod, AiProviderOffering } from '@undefineds.co/ai-connections-core/client';
2
2
  export declare function offeringTitle(offering: AiProviderOffering): string;
3
3
  /** Name of the offering kind. Same taxonomy as the title fallback, so it reuses the one map. */
4
4
  export declare function offeringKindLabel(kind: string): string;
@@ -1,4 +1,4 @@
1
- import type { AiConnectionsProvider } from './ai-connections-client';
1
+ import type { AiConnectionsProvider } from '@undefineds.co/ai-connections-core/client';
2
2
  /**
3
3
  * The Xpod shield (`ui/src/assets/xpod-shield.svg`), inlined like the provider
4
4
  * marks: from a coding client's point of view Xpod is just another provider.
@@ -1,4 +1,4 @@
1
- import { AI_CONNECTIONS_PROVIDER_DOCUMENT_IDS } from './provider-catalog.js';
1
+ import { AI_CONNECTIONS_PROVIDER_DOCUMENT_IDS } from '@undefineds.co/ai-connections-core/provider-catalog';
2
2
  export const AI_CONNECTIONS_APPLET_ID = 'co.undefineds.ai-connections';
3
3
  const KNOWN_RESOURCE_PATHS = {
4
4
  providerCredentials: 'settings/credentials.ttl',
@@ -1,4 +1,4 @@
1
- import type { AiConnectAttempt, AiConnectionsMode, AiProviderAuthorizationMethod, AiProviderCredentialSummary, AiProviderOffering } from './ai-connections-client';
1
+ import type { AiConnectAttempt, AiConnectionsMode, AiProviderAuthorizationMethod, AiProviderCredentialSummary, AiProviderOffering } from '@undefineds.co/ai-connections-core/client';
2
2
  /**
3
3
  * Lifecycle of the connect dialog: which offering is being connected, whether the
4
4
  * user is creating or editing, and the busy/error state the toolbar and the
@@ -13,27 +13,13 @@
13
13
  "types": "./dist/index.d.ts",
14
14
  "import": "./dist/index.js"
15
15
  },
16
- "./client": {
17
- "types": "./dist/ai-connections-client.d.ts",
18
- "import": "./dist/ai-connections-client.js"
19
- },
20
- "./provider-catalog": {
21
- "types": "./dist/provider-catalog.d.ts",
22
- "import": "./dist/provider-catalog.js",
23
- "require": "./dist/provider-catalog.cjs"
24
- },
25
16
  "./manifest": {
26
17
  "types": "./dist/manifest.d.ts",
27
18
  "import": "./dist/manifest.js"
28
- },
29
- "./client-config": {
30
- "types": "./dist/client-config/index.d.ts",
31
- "import": "./dist/client-config/index.js",
32
- "require": "./dist/client-config/index.cjs"
33
19
  }
34
20
  },
35
21
  "scripts": {
36
- "build": "rm -rf dist && tsc -p tsconfig.json && bun ../../scripts/fix-dist-js-imports.mjs dist && bun build src/client-config/index.ts --target=node --format=cjs --outfile=dist/client-config/index.cjs && bun build src/provider-catalog.ts --target=node --format=cjs --outfile=dist/provider-catalog.cjs",
22
+ "build": "rm -rf dist && tsc -p tsconfig.json && bun ../../scripts/fix-dist-js-imports.mjs dist",
37
23
  "test": "vitest run --config ../../vitest.packages.config.mts"
38
24
  },
39
25
  "dependencies": {
@@ -55,15 +41,6 @@
55
41
  },
56
42
  "typesVersions": {
57
43
  "*": {
58
- "provider-catalog": [
59
- "dist/provider-catalog.d.ts"
60
- ],
61
- "client": [
62
- "dist/ai-connections-client.d.ts"
63
- ],
64
- "client-config": [
65
- "dist/client-config/index.d.ts"
66
- ],
67
44
  "manifest": [
68
45
  "dist/manifest.d.ts"
69
46
  ]
@@ -1,6 +1,8 @@
1
1
  /**
2
- * Public entry point of the AI connections client
3
- * (`@undefineds.co/ai-connections/client`).
2
+ * Public entry point of the AI Connections client protocol. This package is
3
+ * the shared core: the gateway and the applet both consume it, and the applet
4
+ * (`@undefineds.co/ai-connections`) adds the components, artwork and wording.
5
+ * (`@undefineds.co/ai-connections-core/client`).
4
6
  *
5
7
  * The implementation lives in `./client`, split into wire types, payload
6
8
  * normalisation and the request factory. This file stays a barrel — importers
@@ -10,7 +12,7 @@
10
12
  */
11
13
  export { AI_CONNECTIONS_PROVIDERS } from './client/types';
12
14
  export type { AiConnectAttempt, AiConnectionBeginOptions, AiConnectionsClient, AiConnectionsCredential, AiConnectionsMode, AiConnectionsProvider, AiConnectStatus, AiGatewayModel, AiProviderAuthorizationMethod, AiProviderAuthorizationMethodId, AiProviderAuthorizationMethodsSummary, AiProviderConnectionSummary, AiProviderCredentialSummary, AiProviderOffering, AiProviderSummary, AiProviderSummaryStatus, AiQuotaSnapshot, AiQuotaWindow, CreateApiKeyCredentialInput, CreatedGatewayKey, CustomProviderModel, DiscoveredProviderModel, GatewayKeyRecord, ProviderModelDiscovery, TestProviderCredentialInput, UpdateProviderCredentialInput, } from './client/types';
13
- export { AI_CONNECTIONS_GENERIC_ERROR_MESSAGE, AiConnectionsRequestError, normalizeAiConnectionsErrorMessage, normalizeAiConnectionsThrownError, normalizeProxyUrl, redactProxyUrl, } from './client/normalize';
15
+ export { AiConnectionsRequestError, aiConnectionsErrorCode, normalizeProxyUrl, redactProxyUrl, } from './client/normalize';
14
16
  export { createAiConnectionsClient, resolveAiConnectionsApiBase } from './client/request';
15
17
  /**
16
18
  * Storage-shape rules for credential rows. They are shared with the Pod adapter
@@ -1,6 +1,8 @@
1
1
  /**
2
- * Public entry point of the AI connections client
3
- * (`@undefineds.co/ai-connections/client`).
2
+ * Public entry point of the AI Connections client protocol. This package is
3
+ * the shared core: the gateway and the applet both consume it, and the applet
4
+ * (`@undefineds.co/ai-connections`) adds the components, artwork and wording.
5
+ * (`@undefineds.co/ai-connections-core/client`).
4
6
  *
5
7
  * The implementation lives in `./client`, split into wire types, payload
6
8
  * normalisation and the request factory. This file stays a barrel — importers
@@ -9,7 +11,7 @@
9
11
  * parsers under `./client` are internal, and `export *` would publish them.
10
12
  */
11
13
  export { AI_CONNECTIONS_PROVIDERS } from './client/types.js';
12
- export { AI_CONNECTIONS_GENERIC_ERROR_MESSAGE, AiConnectionsRequestError, normalizeAiConnectionsErrorMessage, normalizeAiConnectionsThrownError, normalizeProxyUrl, redactProxyUrl, } from './client/normalize.js';
14
+ export { AiConnectionsRequestError, aiConnectionsErrorCode, normalizeProxyUrl, redactProxyUrl, } from './client/normalize.js';
13
15
  export { createAiConnectionsClient, resolveAiConnectionsApiBase } from './client/request.js';
14
16
  /**
15
17
  * Storage-shape rules for credential rows. They are shared with the Pod adapter
@@ -8,7 +8,6 @@ import type { AiConnectAttempt, AiConnectionsCredential, AiConnectionsProvider,
8
8
  * within this module family. The published surface is the explicit list in
9
9
  * `ai-connections-client.ts`, not this file.
10
10
  */
11
- export declare const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = "AI Connection request failed. Please try again.";
12
11
  /**
13
12
  * Validate and normalize a user supplied upstream proxy URL. Proxy credentials
14
13
  * are intentionally rejected because proxy auth is not stored in the Pod
@@ -16,16 +15,27 @@ export declare const AI_CONNECTIONS_GENERIC_ERROR_MESSAGE = "AI Connection reque
16
15
  */
17
16
  export declare function normalizeProxyUrl(value: string | undefined | null): string | undefined;
18
17
  export declare function redactProxyUrl(value: string | undefined | null): string | undefined;
18
+ /**
19
+ * A failed AI Connection request.
20
+ *
21
+ * It carries the facts a caller needs to decide what to say - the wire code, the
22
+ * upstream status, the payload itself - and a diagnostic message that names the
23
+ * code. The sentence a user reads is the applet's (`error-wording.ts`): a shared
24
+ * client must not pick the wording for whoever happens to render it.
25
+ */
19
26
  export declare class AiConnectionsRequestError extends Error {
20
27
  readonly code?: string;
28
+ readonly status: number;
21
29
  readonly providerStatus?: number;
22
- constructor(message: string, payload: unknown);
30
+ readonly payload: unknown;
31
+ readonly provider?: string;
32
+ readonly authMode?: string;
33
+ constructor(payload: unknown, status: number, context?: {
34
+ provider?: string;
35
+ authMode?: string;
36
+ });
23
37
  }
24
- export declare function normalizeAiConnectionsThrownError(error: unknown): string;
25
- export declare function normalizeAiConnectionsErrorMessage(payload: unknown, status: number, context?: {
26
- provider?: AiConnectionsProvider;
27
- authMode?: 'apiKey' | 'deviceCodeOAuth' | 'local';
28
- }): string;
38
+ export declare function aiConnectionsErrorCode(payload: unknown): string | undefined;
29
39
  export declare function readJson(response: Response): Promise<unknown>;
30
40
  export declare function assertProvider(provider: string): asserts provider is AiConnectionsProvider;
31
41
  export declare function parseGatewayKeyRecord(value: unknown): GatewayKeyRecord | undefined;