@undefineds.co/xpod 0.4.12 → 0.4.14

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 (272) hide show
  1. package/config/components-ignore.json +11 -7
  2. package/dist/acceptance/QleverSemanticConformance.js +7 -0
  3. package/dist/api/ai-gateway/providers/OfferingAuthorization.d.ts +6 -1
  4. package/dist/api/ai-gateway/providers/OfferingAuthorization.js +0 -3
  5. package/dist/api/ai-gateway/providers/ProviderRegistry.js +1 -1
  6. package/dist/api/container/index.js +1 -0
  7. package/dist/api/container/local.js +30 -12
  8. package/dist/api/container/routes.js +2 -0
  9. package/dist/api/container/types.d.ts +2 -0
  10. package/dist/api/handlers/AdminHandler.d.ts +17 -1
  11. package/dist/api/handlers/AdminHandler.js +40 -3
  12. package/dist/api/handlers/EdgeNodeSignalHandler.js +10 -2
  13. package/dist/api/handlers/NetworkSettingsHandler.d.ts +37 -5
  14. package/dist/api/handlers/NetworkSettingsHandler.js +39 -11
  15. package/dist/api/handlers/ProvisionHandler.d.ts +6 -1
  16. package/dist/api/handlers/ProvisionHandler.js +7 -2
  17. package/dist/api/handlers/ReachabilityHandler.d.ts +6 -0
  18. package/dist/api/handlers/ReachabilityHandler.js +22 -5
  19. package/dist/api/network/NetworkEnvironmentConfigurationStore.d.ts +6 -1
  20. package/dist/api/network/NetworkEnvironmentConfigurationStore.js +72 -16
  21. package/dist/api/runtime.d.ts +9 -0
  22. package/dist/api/runtime.js +15 -2
  23. package/dist/cli/commands/start.d.ts +19 -1
  24. package/dist/cli/commands/start.js +71 -5
  25. package/dist/components/context.jsonld +30 -0
  26. package/dist/edge/EdgeNodeAgent.d.ts +6 -0
  27. package/dist/edge/EdgeNodeAgent.js +1 -1
  28. package/dist/edge/EdgeNodeAgentInitializer.d.ts +2 -0
  29. package/dist/edge/EdgeNodeAgentInitializer.js +1 -0
  30. package/dist/edge/EdgeNodeAgentInitializer.jsonld +19 -0
  31. package/dist/edge/EdgeNodeDnsCoordinator.d.ts +11 -1
  32. package/dist/edge/EdgeNodeDnsCoordinator.js +12 -2
  33. package/dist/edge/EdgeNodeHealthProbeService.d.ts +15 -0
  34. package/dist/edge/EdgeNodeHealthProbeService.js +44 -12
  35. package/dist/edge/EdgeNodeHealthProbeService.jsonld +77 -0
  36. package/dist/edge/ProbeTargetGuard.d.ts +35 -0
  37. package/dist/edge/ProbeTargetGuard.js +142 -0
  38. package/dist/edge/reachability/NodeAccessResolver.d.ts +16 -0
  39. package/dist/edge/reachability/NodeAccessResolver.js +30 -0
  40. package/dist/index.d.ts +3 -1
  41. package/dist/index.js +9 -3
  42. package/dist/main.js +7 -0
  43. package/dist/runtime/Proxy.d.ts +22 -0
  44. package/dist/runtime/Proxy.js +34 -7
  45. package/dist/runtime/bootstrap.d.ts +11 -0
  46. package/dist/runtime/bootstrap.js +21 -1
  47. package/dist/runtime/css-process.d.ts +1 -0
  48. package/dist/runtime/css-process.js +1 -0
  49. package/dist/runtime/host/node/NodeRuntimeHost.js +4 -1
  50. package/dist/runtime/host/types.d.ts +6 -0
  51. package/dist/runtime/index.d.ts +1 -1
  52. package/dist/runtime/index.js +5 -1
  53. package/dist/runtime/lifecycle.js +1 -0
  54. package/dist/runtime/port-finder.d.ts +30 -0
  55. package/dist/runtime/port-finder.js +83 -0
  56. package/dist/runtime/runner/node/NodeGatewayRuntimeRunner.js +1 -0
  57. package/dist/runtime/runner/types.d.ts +5 -0
  58. package/dist/runtime/runtime-types.d.ts +1 -0
  59. package/dist/storage/rdf/PostgresRdfEngine.js +10 -4
  60. package/dist/storage/rdf/RdfAccessScope.js +15 -1
  61. package/dist/storage/rdf/RdfEngineRdfJsSource.js +10 -2
  62. package/dist/test-utils/local-managed-client-p2p-e2e-smoke.js +1 -1
  63. package/dist/tunnel/LocalTunnelProvider.d.ts +15 -0
  64. package/dist/tunnel/LocalTunnelProvider.js +87 -18
  65. package/dist/tunnel/LocalTunnelProvider.jsonld +27 -0
  66. package/dist/tunnel/NgrokTunnelProvider.d.ts +4 -0
  67. package/dist/tunnel/NgrokTunnelProvider.js +117 -43
  68. package/dist/tunnel/NgrokTunnelProvider.jsonld +4 -0
  69. package/dist/tunnel/SakuraFrpTunnelProvider.d.ts +65 -3
  70. package/dist/tunnel/SakuraFrpTunnelProvider.js +268 -25
  71. package/dist/tunnel/TunnelLifecycle.d.ts +14 -0
  72. package/dist/tunnel/TunnelLifecycle.js +34 -0
  73. package/dist/tunnel/TunnelProfiles.d.ts +33 -3
  74. package/dist/tunnel/TunnelProfiles.js +105 -78
  75. package/dist/tunnel/TunnelProvider.d.ts +15 -2
  76. package/dist/tunnel/TunnelProvider.jsonld +8 -0
  77. package/dist/tunnel/TunnelProviderCatalog.d.ts +62 -0
  78. package/dist/tunnel/TunnelProviderCatalog.js +130 -0
  79. package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.d.ts +1 -1
  80. package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +1 -1
  81. package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +1 -1
  82. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +1 -1
  83. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +3 -3
  84. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.d.ts +1 -1
  85. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +1 -1
  86. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +2 -2
  87. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.d.ts +1 -1
  88. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.d.ts +1 -1
  89. package/node_modules/@undefineds.co/ai-connections/dist/AiCustomProviderDialog.d.ts +1 -1
  90. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.d.ts +1 -1
  91. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +1 -1
  92. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +1 -1
  93. package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.d.ts +1 -1
  94. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.d.ts +1 -1
  95. package/node_modules/@undefineds.co/ai-connections/dist/AiQuotaCard.d.ts +1 -1
  96. package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.d.ts +1 -1
  97. package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +13 -11
  98. package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.js +16 -13
  99. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +1 -1
  100. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +3 -3
  101. package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +1 -1
  102. package/node_modules/@undefineds.co/ai-connections/dist/collections.js +3 -3
  103. package/node_modules/@undefineds.co/ai-connections/dist/{ai-connections-client.d.ts → contract/ai-connections-client.d.ts} +4 -2
  104. package/node_modules/@undefineds.co/ai-connections/dist/{ai-connections-client.js → contract/ai-connections-client.js} +4 -2
  105. package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/normalize.d.ts +17 -7
  106. package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/normalize.js +18 -213
  107. package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/request.js +3 -3
  108. package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/types.d.ts +11 -2
  109. package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/index.cjs +8 -8
  110. package/node_modules/@undefineds.co/ai-connections/dist/contract/index.d.ts +9 -0
  111. package/node_modules/@undefineds.co/ai-connections/dist/contract/index.js +9 -0
  112. package/node_modules/@undefineds.co/ai-connections/dist/{provider-catalog.cjs → contract/provider-catalog.cjs} +5 -28
  113. package/node_modules/@undefineds.co/ai-connections/dist/{provider-catalog.d.ts → contract/provider-catalog.d.ts} +9 -8
  114. package/node_modules/@undefineds.co/ai-connections/dist/{provider-catalog.js → contract/provider-catalog.js} +11 -31
  115. package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +1 -1
  116. package/node_modules/@undefineds.co/ai-connections/dist/controller.js +3 -2
  117. package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +1 -1
  118. package/node_modules/@undefineds.co/ai-connections/dist/display-wording.d.ts +20 -0
  119. package/node_modules/@undefineds.co/ai-connections/dist/display-wording.js +73 -0
  120. package/node_modules/@undefineds.co/ai-connections/dist/error-wording.d.ts +24 -0
  121. package/node_modules/@undefineds.co/ai-connections/dist/error-wording.js +253 -0
  122. package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +1 -1
  123. package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +2 -3
  124. package/node_modules/@undefineds.co/ai-connections/dist/index.js +2 -3
  125. package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +1 -1
  126. package/node_modules/@undefineds.co/ai-connections/dist/offering-label.d.ts +1 -1
  127. package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +1 -1
  128. package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +1 -1
  129. package/node_modules/@undefineds.co/ai-connections/dist/useAiConnectDialog.d.ts +1 -1
  130. package/node_modules/@undefineds.co/ai-connections/package.json +25 -18
  131. package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +4 -2
  132. package/node_modules/@undefineds.co/shared-ui/dist/index.js +4 -2
  133. package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.d.ts +4 -1
  134. package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.js +12 -6
  135. package/node_modules/@undefineds.co/shared-ui/dist/login/LoginView.d.ts +1 -1
  136. package/node_modules/@undefineds.co/shared-ui/dist/login/host-types.d.ts +7 -1
  137. package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.d.ts +6 -0
  138. package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.js +18 -0
  139. package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.d.ts +14 -2
  140. package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.js +26 -17
  141. package/node_modules/@undefineds.co/solid-sdk/dist/login-store.d.ts +3 -3
  142. package/node_modules/@undefineds.co/solid-sdk/dist/login-store.js +3 -3
  143. package/package.json +4 -3
  144. package/static/auth-callback/assets/{AiConfigContext-DnQs1ZpW.js → AiConfigContext-DCXpjzpj.js} +1 -1
  145. package/static/auth-callback/assets/{AiConfigPage-DOtvlxH0.js → AiConfigPage-fe-xMIXa.js} +1 -1
  146. package/static/auth-callback/assets/{DocumentProcessingPanel-BS2voQgL.js → DocumentProcessingPanel-BGnkfMuU.js} +1 -1
  147. package/static/auth-callback/assets/{IndexLifecyclePanel-Cvt0cJtN.js → IndexLifecyclePanel-42Jups0j.js} +1 -1
  148. package/static/auth-callback/assets/{IndexSubjectPanel-Dhf01GqF.js → IndexSubjectPanel-CYyLOlQU.js} +1 -1
  149. package/static/auth-callback/assets/{ModelAssignmentsPanel-BJutWaAF.js → ModelAssignmentsPanel-BOvUH4yr.js} +1 -1
  150. package/static/auth-callback/assets/{ModelsPage-BRS0sje3.js → ModelsPage-DwyITxt7.js} +6 -6
  151. package/static/auth-callback/assets/NetworkPage-CG9RelJA.js +2 -0
  152. package/static/auth-callback/assets/{PaneListHeader-QQeJGTp4.js → PaneListHeader-yvd5ohs6.js} +1 -1
  153. package/static/auth-callback/assets/{SearchIndexingPanel-MyNUSEwT.js → SearchIndexingPanel-2_a6ezzj.js} +1 -1
  154. package/static/auth-callback/assets/{StatusSubjectPanel-DQkEVsFs.js → StatusSubjectPanel-8qtVxnzC.js} +1 -1
  155. package/static/auth-callback/assets/{StatusWorkspace-Dkv63Uwk.js → StatusWorkspace-CBdRahCF.js} +1 -1
  156. package/static/auth-callback/assets/{SystemSettingsPage-TIsUfX5d.js → SystemSettingsPage-BZJ6vWkg.js} +1 -1
  157. package/static/auth-callback/assets/{SystemSettingsSubjectPanel-BJWEt2-7.js → SystemSettingsSubjectPanel-xm08UhXP.js} +1 -1
  158. package/static/auth-callback/assets/XpodAiConnectionsPodStore-V6vgGfuw.js +3 -0
  159. package/static/auth-callback/assets/{activity-5hNeNKnL.js → activity-CeM7xly8.js} +1 -1
  160. package/static/auth-callback/assets/ai-connections-C6yaE6WQ.js +1 -0
  161. package/static/auth-callback/assets/{auth-callback-CAFZ3R0B.js → auth-callback-DTG8cSj7.js} +3 -3
  162. package/static/auth-callback/assets/{badge-CAIPI0CB.js → badge-qJo2Zr4d.js} +1 -1
  163. package/static/auth-callback/assets/{collection-runtime-D9s7h9YA.js → collection-runtime-Bztsz31a.js} +1 -1
  164. package/static/auth-callback/assets/{dialog-BjA109aX.js → dialog-D-h6x5x0.js} +1 -1
  165. package/static/auth-callback/assets/{download-B3Up5W2G.js → download-C2ir4lmR.js} +1 -1
  166. package/static/auth-callback/assets/{external-link-BTXgSPzB.js → external-link-THLDL4On.js} +1 -1
  167. package/static/auth-callback/assets/{index-CirW4CJf.js → index-BRpv4yO3.js} +1 -1
  168. package/static/auth-callback/assets/{index-BppXlxcp.js → index-BlVZb9A7.js} +1 -1
  169. package/static/auth-callback/assets/index-D983R1FV.js +4 -0
  170. package/static/auth-callback/assets/{index-browser-DtU38ni3.js → index-browser-3FvR0aaf.js} +1 -1
  171. package/static/auth-callback/assets/{key-round-CQCOrZ7x.js → key-round-C9U5j1Ly.js} +1 -1
  172. package/static/auth-callback/assets/{rotate-ccw-C1zM2KtS.js → rotate-ccw-DP45cD4o.js} +1 -1
  173. package/static/auth-callback/assets/{skeleton-Cqp7_M9-.js → skeleton-Dn4EiSCS.js} +1 -1
  174. package/static/auth-callback/assets/{waypoints-Bj6gAUSQ.js → waypoints-uqFQ3uEG.js} +1 -1
  175. package/static/auth-callback/assets/{workspace-layout-DK8mDzrY.js → workspace-layout-DLYK0Wwu.js} +1 -1
  176. package/static/auth-callback/auth-callback.html +1 -1
  177. package/static/dashboard/assets/{AiConfigContext-BsE7MqX8.js → AiConfigContext-DJcMECNw.js} +1 -1
  178. package/static/dashboard/assets/{AiConfigPage-DvM-lRXa.js → AiConfigPage-BvE7dOTy.js} +1 -1
  179. package/static/dashboard/assets/{DocumentProcessingPanel-BPfdlfuf.js → DocumentProcessingPanel-D9780krf.js} +1 -1
  180. package/static/dashboard/assets/{IndexLifecyclePanel--m0AGxvh.js → IndexLifecyclePanel-SjsUcnbM.js} +1 -1
  181. package/static/dashboard/assets/{IndexSubjectPanel-Bb7m1k3d.js → IndexSubjectPanel-C-ym2Tqi.js} +1 -1
  182. package/static/dashboard/assets/{ModelAssignmentsPanel-BLi_zbMa.js → ModelAssignmentsPanel-BRjZ-arB.js} +1 -1
  183. package/static/dashboard/assets/{ModelsPage-CxdpgnfR.js → ModelsPage-BtTU6du3.js} +6 -6
  184. package/static/dashboard/assets/NetworkPage-CV9qpkDg.js +2 -0
  185. package/static/dashboard/assets/{PaneListHeader-BBCMei0r.js → PaneListHeader-KyPTTBsv.js} +1 -1
  186. package/static/dashboard/assets/{SearchIndexingPanel-Ck4Y-xjR.js → SearchIndexingPanel-DolHGawg.js} +1 -1
  187. package/static/dashboard/assets/{StatusSubjectPanel-D1KWfAXE.js → StatusSubjectPanel-_YZvKiYi.js} +1 -1
  188. package/static/dashboard/assets/{StatusWorkspace-JbA5gzXx.js → StatusWorkspace-Dlbh_G40.js} +1 -1
  189. package/static/dashboard/assets/{SystemSettingsPage-BbwQWsSR.js → SystemSettingsPage-Be7QSIoz.js} +1 -1
  190. package/static/dashboard/assets/{SystemSettingsSubjectPanel-N117nMt5.js → SystemSettingsSubjectPanel-DBp0gja7.js} +1 -1
  191. package/static/dashboard/assets/{XpodAiConnectionsPodStore-CdDOb4SV.js → XpodAiConnectionsPodStore-ClpSjzpP.js} +7 -7
  192. package/static/dashboard/assets/{activity-DX1I96o_.js → activity-lsNbTXJu.js} +1 -1
  193. package/static/dashboard/assets/ai-connections-CXp5gd1J.js +1 -0
  194. package/static/dashboard/assets/{badge-k2vhtDqH.js → badge-CVatKjaG.js} +1 -1
  195. package/static/dashboard/assets/{collection-runtime-BFQ8teQJ.js → collection-runtime-Ec4UnY28.js} +1 -1
  196. package/static/dashboard/assets/{dashboard-DWZ-fmCT.js → dashboard-BEzsRsvF.js} +2 -2
  197. package/static/dashboard/assets/{dialog-1CCw-iHT.js → dialog-BuyelQ4V.js} +1 -1
  198. package/static/dashboard/assets/{download-C6-SNY1q.js → download-B4Nf678F.js} +1 -1
  199. package/static/dashboard/assets/{external-link-BgPcZ_j2.js → external-link-PYv9CvKL.js} +1 -1
  200. package/static/dashboard/assets/index-C9XPE-mI.js +4 -0
  201. package/static/dashboard/assets/{index-D7A8U6Pt.js → index-Cx69bTNh.js} +1 -1
  202. package/static/dashboard/assets/{index-6LcIUIYO.js → index-awr7ulur.js} +1 -1
  203. package/static/dashboard/assets/{key-round-BOd7Jo0Q.js → key-round-VsY80U1Z.js} +1 -1
  204. package/static/dashboard/assets/{rotate-ccw-CCgJqsvx.js → rotate-ccw-Cz1K4vE9.js} +1 -1
  205. package/static/dashboard/assets/{skeleton-Bc7abAn5.js → skeleton-BhNv_8tO.js} +1 -1
  206. package/static/dashboard/assets/{waypoints-s-opmJxx.js → waypoints-DYS9XFYV.js} +1 -1
  207. package/static/dashboard/assets/{workspace-layout-DqIQeTBV.js → workspace-layout-OZJAFx5V.js} +1 -1
  208. package/static/dashboard/dashboard.html +1 -1
  209. package/static/settings/assets/{AiConfigContext-BB9KZySa.js → AiConfigContext-B8JS3MXF.js} +1 -1
  210. package/static/settings/assets/{AiConfigPage-DGSXUkLs.js → AiConfigPage-C3Zl8LUl.js} +1 -1
  211. package/static/settings/assets/{DocumentProcessingPanel-Da2Re6Rg.js → DocumentProcessingPanel-DpDZAQvf.js} +1 -1
  212. package/static/settings/assets/{IndexLifecyclePanel-BSZuIzgr.js → IndexLifecyclePanel-Ec1XF88t.js} +1 -1
  213. package/static/settings/assets/{IndexSubjectPanel-CFd0ay-r.js → IndexSubjectPanel-BulT9BmO.js} +1 -1
  214. package/static/settings/assets/{ModelAssignmentsPanel-CSAryvWJ.js → ModelAssignmentsPanel-BcGSmYjb.js} +1 -1
  215. package/static/settings/assets/{ModelsPage-BQwCwLHU.js → ModelsPage-CvTCKy1T.js} +6 -6
  216. package/static/settings/assets/NetworkPage-DQF5u9Bn.js +2 -0
  217. package/static/settings/assets/{PaneListHeader-Bjh3hRdQ.js → PaneListHeader-D40hqcVl.js} +1 -1
  218. package/static/settings/assets/{SearchIndexingPanel-MjKL5QLU.js → SearchIndexingPanel-iCUPOx_0.js} +1 -1
  219. package/static/settings/assets/{StatusSubjectPanel-Bvl6K4mx.js → StatusSubjectPanel-E--ZHSql.js} +1 -1
  220. package/static/settings/assets/{StatusWorkspace-B0NzrP--.js → StatusWorkspace-YjDAx1II.js} +1 -1
  221. package/static/settings/assets/{SystemSettingsPage-D2z6Z4FE.js → SystemSettingsPage-CDdV3mC9.js} +1 -1
  222. package/static/settings/assets/{SystemSettingsSubjectPanel-4sxma4X4.js → SystemSettingsSubjectPanel-Br8WazDq.js} +1 -1
  223. package/static/settings/assets/XpodAiConnectionsPodStore-CLr38P_Z.js +3 -0
  224. package/static/settings/assets/{activity-CgJJGpjx.js → activity-C5DAHHTE.js} +1 -1
  225. package/static/settings/assets/ai-connections-C6yaE6WQ.js +1 -0
  226. package/static/settings/assets/{badge-C4NypVyT.js → badge-D8eIyxKt.js} +1 -1
  227. package/static/settings/assets/{collection-runtime-CTLCDxAi.js → collection-runtime-DLc9zil8.js} +1 -1
  228. package/static/settings/assets/{dialog-Csq0vWUi.js → dialog-CyuR7Va4.js} +1 -1
  229. package/static/settings/assets/{download-DaLJJ-Wp.js → download-c0oxZrCz.js} +1 -1
  230. package/static/settings/assets/{external-link--w_iW5Au.js → external-link-D3Z34fP_.js} +1 -1
  231. package/static/settings/assets/{index-BukHiu4y.js → index-CKGbRFlc.js} +1 -1
  232. package/static/settings/assets/index-CSr3-2Cj.js +4 -0
  233. package/static/settings/assets/{index-COmVnZi2.js → index-ComidxAm.js} +1 -1
  234. package/static/settings/assets/{index-browser-BGpvHwD0.js → index-browser-CAscEbae.js} +1 -1
  235. package/static/settings/assets/{key-round-Bk4YRjBu.js → key-round-DyjLmXuB.js} +1 -1
  236. package/static/settings/assets/{rotate-ccw-TCabbqsr.js → rotate-ccw-679HF_ec.js} +1 -1
  237. package/static/settings/assets/{settings-CJWpdbNC.js → settings-DKknqu4C.js} +3 -3
  238. package/static/settings/assets/{skeleton-JDHYVe7t.js → skeleton-CkopNkPB.js} +1 -1
  239. package/static/settings/assets/{waypoints-DDvEl-MU.js → waypoints-CrqfAftE.js} +1 -1
  240. package/static/settings/assets/{workspace-layout-DV5QU30U.js → workspace-layout-UN6c4qTG.js} +1 -1
  241. package/static/settings/settings.html +1 -1
  242. package/static/auth-callback/assets/NetworkPage-B3qBfANA.js +0 -2
  243. package/static/auth-callback/assets/XpodAiConnectionsPodStore-BJiXm-PF.js +0 -3
  244. package/static/auth-callback/assets/ai-connections-CryuHGKW.js +0 -1
  245. package/static/auth-callback/assets/index-DlLYWOhw.js +0 -4
  246. package/static/dashboard/assets/NetworkPage-BAIPw-D_.js +0 -2
  247. package/static/dashboard/assets/ai-connections-DwCRqOQa.js +0 -1
  248. package/static/dashboard/assets/index-UD6QOE7H.js +0 -4
  249. package/static/settings/assets/NetworkPage-BKymvsQc.js +0 -2
  250. package/static/settings/assets/XpodAiConnectionsPodStore-BkNQ8fZx.js +0 -3
  251. package/static/settings/assets/ai-connections-CryuHGKW.js +0 -1
  252. package/static/settings/assets/index-B0mQa59b.js +0 -4
  253. /package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/request.d.ts +0 -0
  254. /package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/types.js +0 -0
  255. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/base-adapter.d.ts +0 -0
  256. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/base-adapter.js +0 -0
  257. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/codex.d.ts +0 -0
  258. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/codex.js +0 -0
  259. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/index.d.ts +0 -0
  260. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/index.js +0 -0
  261. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/json-env-adapter.d.ts +0 -0
  262. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/json-env-adapter.js +0 -0
  263. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/pi.d.ts +0 -0
  264. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/pi.js +0 -0
  265. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/transaction.d.ts +0 -0
  266. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/transaction.js +0 -0
  267. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/types.d.ts +0 -0
  268. /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/types.js +0 -0
  269. /package/node_modules/@undefineds.co/ai-connections/dist/{credential-storage.d.ts → contract/credential-storage.d.ts} +0 -0
  270. /package/node_modules/@undefineds.co/ai-connections/dist/{credential-storage.js → contract/credential-storage.js} +0 -0
  271. /package/node_modules/@undefineds.co/ai-connections/dist/{endpoint-urls.d.ts → contract/endpoint-urls.d.ts} +0 -0
  272. /package/node_modules/@undefineds.co/ai-connections/dist/{endpoint-urls.js → contract/endpoint-urls.js} +0 -0
@@ -0,0 +1,253 @@
1
+ import { AiConnectionsRequestError, aiConnectionsErrorCode } from './contract/ai-connections-client.js';
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 './contract/endpoint-urls.js';
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 './contract/ai-connections-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 './contract/ai-connections-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 './contract/ai-connections-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 './contract/provider-catalog.js';
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 './contract/ai-connections-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,31 @@
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
19
  },
20
+ "./client": {
21
+ "types": "./dist/contract/ai-connections-client.d.ts",
22
+ "import": "./dist/contract/ai-connections-client.js"
23
+ },
24
+ "./provider-catalog": {
25
+ "types": "./dist/contract/provider-catalog.d.ts",
26
+ "import": "./dist/contract/provider-catalog.js",
27
+ "require": "./dist/contract/provider-catalog.cjs"
28
+ },
29
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"
30
+ "types": "./dist/contract/client-config/index.d.ts",
31
+ "import": "./dist/contract/client-config/index.js",
32
+ "require": "./dist/contract/client-config/index.cjs"
33
+ },
34
+ "./endpoint-urls": {
35
+ "types": "./dist/contract/endpoint-urls.d.ts",
36
+ "import": "./dist/contract/endpoint-urls.js"
33
37
  }
34
38
  },
35
39
  "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",
40
+ "build": "rm -rf dist && tsc -p tsconfig.json && bun ../../scripts/fix-dist-js-imports.mjs dist && bun build src/contract/client-config/index.ts --target=node --format=cjs --outfile=dist/contract/client-config/index.cjs && bun build src/contract/provider-catalog.ts --target=node --format=cjs --outfile=dist/contract/provider-catalog.cjs",
37
41
  "test": "vitest run --config ../../vitest.packages.config.mts"
38
42
  },
39
43
  "dependencies": {
@@ -55,17 +59,20 @@
55
59
  },
56
60
  "typesVersions": {
57
61
  "*": {
62
+ "manifest": [
63
+ "dist/manifest.d.ts"
64
+ ],
58
65
  "provider-catalog": [
59
- "dist/provider-catalog.d.ts"
66
+ "dist/contract/provider-catalog.d.ts"
60
67
  ],
61
68
  "client": [
62
- "dist/ai-connections-client.d.ts"
69
+ "dist/contract/ai-connections-client.d.ts"
63
70
  ],
64
71
  "client-config": [
65
- "dist/client-config/index.d.ts"
72
+ "dist/contract/client-config/index.d.ts"
66
73
  ],
67
- "manifest": [
68
- "dist/manifest.d.ts"
74
+ "endpoint-urls": [
75
+ "dist/contract/endpoint-urls.d.ts"
69
76
  ]
70
77
  }
71
78
  }
@@ -9,9 +9,11 @@ export * from './user-facing-errors';
9
9
  export * from './input';
10
10
  export * from './label';
11
11
  export { LoginAccountView, LoginAvatar, LoginCardShell, LoginConnectingView, LoginErrorBanner, LoginFailureView, LoginRestoringView, RememberedLoginView, type RememberedLoginIdentity, type RememberedLoginViewCopy, type SessionLoginPresentationState, type SessionLoginStatus, } from './login';
12
- /** LinX product login surface. Xpod does not render this. */
12
+ /**
13
+ * Shared login surface. Hosts inject their brand and product name;
14
+ * the component itself assumes neither.
15
+ */
13
16
  export { LoginModal, } from './login/LoginModal';
14
- /** LinX product login surface. Xpod does not render this. */
15
17
  export { LoginView, type LoginViewActions, type LoginViewProps, type LoginViewState, } from './login/LoginView';
16
18
  export { LocalReachabilitySummary, } from './login/LocalReachabilitySummary';
17
19
  export { getProviderActionLabel, getProviderDisplayLabel, getProviderInfoText, getProviderSourceLabel, getProviderStatusBadge, getProviderSubtitle, type ProviderStatusBadge, } from './login/presentation';
@@ -9,9 +9,11 @@ export * from './user-facing-errors.js';
9
9
  export * from './input.js';
10
10
  export * from './label.js';
11
11
  export { LoginAccountView, LoginAvatar, LoginCardShell, LoginConnectingView, LoginErrorBanner, LoginFailureView, LoginRestoringView, RememberedLoginView, } from './login.js';
12
- /** LinX product login surface. Xpod does not render this. */
12
+ /**
13
+ * Shared login surface. Hosts inject their brand and product name;
14
+ * the component itself assumes neither.
15
+ */
13
16
  export { LoginModal, } from './login/LoginModal.js';
14
- /** LinX product login surface. Xpod does not render this. */
15
17
  export { LoginView, } from './login/LoginView.js';
16
18
  export { LocalReachabilitySummary, } from './login/LocalReachabilitySummary.js';
17
19
  export { getProviderActionLabel, getProviderDisplayLabel, getProviderInfoText, getProviderSourceLabel, getProviderStatusBadge, getProviderSubtitle, } from './login/presentation.js';
@@ -1,3 +1,6 @@
1
1
  import type { LoginModalProps } from './types';
2
- /** LinX product login modal. Xpod does not render this component. */
2
+ /**
3
+ * Shared login modal. The host supplies the brand and, optionally, the product
4
+ * name that user-facing messages refer to.
5
+ */
3
6
  export declare function LoginModal(props: LoginModalProps): import("react").JSX.Element | null;
@@ -7,13 +7,17 @@ import { getProviderDisplayLabel, } from './presentation.js';
7
7
  import { resolveLoginProviderSource } from './provider-model.js';
8
8
  import { LoginCardShell } from '../login.js';
9
9
  import { formatLoginErrorForUser } from './error-messages.js';
10
+ import { LoginProductNameProvider, useLoginProductName } from './login-branding.js';
10
11
  import { LocalReachabilitySummary } from './LocalReachabilitySummary.js';
11
- /** LinX product login modal. Xpod does not render this component. */
12
+ /**
13
+ * Shared login modal. The host supplies the brand and, optionally, the product
14
+ * name that user-facing messages refer to.
15
+ */
12
16
  export function LoginModal(props) {
13
17
  const { state, storageConflict, view } = props;
14
18
  if (state === 'authenticated' && !storageConflict)
15
19
  return null;
16
- return (_jsx(LoginCardShell, { ariaLabel: props.ariaLabel ?? 'Sign in', overlayClassName: props.overlayClassName, cardClassName: props.cardClassName, cardSize: "compact", children: storageConflict ? (_jsx(StorageConflictView, { storedAccount: props.storedAccount, storageConflict: storageConflict, onDismiss: props.onDismissStorageConflict, onOpenCurrentSpacePodSetup: props.onOpenCurrentSpacePodSetup })) : state === 'restoring' ? (_jsx(RestoringView, { storedAccount: props.storedAccount })) : state === 'connecting' ? (_jsx(ConnectingView, { authWindowStatus: props.authWindowStatus, connectingProvider: props.connectingProvider, onCancel: props.onCancelConnecting })) : view === 'local' ? (_jsx(LocalOnboardingView, { localOnboarding: props.localOnboarding, localProviderSource: props.localProviderSource, error: props.error, onBack: props.onBackFromLocal, onContinue: props.onContinueLocalLogin, onSwitchAccount: props.onSwitchAccount, onTestConnectivity: props.onTestLocalConnectivity, onOpenSettings: props.onOpenLocalSettings, onClearError: props.onClearError })) : props.storedAccount ? (_jsx(AccountView, { storedAccount: props.storedAccount, hasRestorableSession: props.hasRestorableSession, onContinueStoredAccount: props.onContinueStoredAccount, onSwitchAccount: props.onSwitchAccount, error: props.error, onClearError: props.onClearError })) : (_jsx(ProviderSelectionView, { providers: props.providers, error: props.error, localLoginStatus: props.localLoginStatus, onConnect: props.onConnect, onAddProvider: props.onAddProvider, onClearError: props.onClearError, brand: props.brand, capabilities: props.capabilities })) }));
20
+ return (_jsx(LoginProductNameProvider, { productName: props.productName, children: _jsx(LoginCardShell, { ariaLabel: props.ariaLabel ?? 'Sign in', overlayClassName: props.overlayClassName, cardClassName: props.cardClassName, cardSize: "compact", children: storageConflict ? (_jsx(StorageConflictView, { storedAccount: props.storedAccount, storageConflict: storageConflict, onDismiss: props.onDismissStorageConflict, onOpenCurrentSpacePodSetup: props.onOpenCurrentSpacePodSetup })) : state === 'restoring' ? (_jsx(RestoringView, { storedAccount: props.storedAccount })) : state === 'connecting' ? (_jsx(ConnectingView, { authWindowStatus: props.authWindowStatus, connectingProvider: props.connectingProvider, onCancel: props.onCancelConnecting })) : view === 'local' ? (_jsx(LocalOnboardingView, { localOnboarding: props.localOnboarding, localProviderSource: props.localProviderSource, error: props.error, onBack: props.onBackFromLocal, onContinue: props.onContinueLocalLogin, onSwitchAccount: props.onSwitchAccount, onTestConnectivity: props.onTestLocalConnectivity, onOpenSettings: props.onOpenLocalSettings, onClearError: props.onClearError })) : props.storedAccount ? (_jsx(AccountView, { storedAccount: props.storedAccount, hasRestorableSession: props.hasRestorableSession, onContinueStoredAccount: props.onContinueStoredAccount, onSwitchAccount: props.onSwitchAccount, error: props.error, onClearError: props.onClearError })) : (_jsx(ProviderSelectionView, { providers: props.providers, error: props.error, localLoginStatus: props.localLoginStatus, onConnect: props.onConnect, onAddProvider: props.onAddProvider, onClearError: props.onClearError, brand: props.brand, capabilities: props.capabilities })) }) }));
17
21
  }
18
22
  function StorageConflictView({ storedAccount, storageConflict, onDismiss, onOpenCurrentSpacePodSetup, }) {
19
23
  const accountName = storedAccount?.displayName || '当前账号';
@@ -89,6 +93,7 @@ function ConnectingView({ authWindowStatus, connectingProvider, onCancel, }) {
89
93
  }
90
94
  // ── LocalOnboardingView ──────────────────────────────────────────────
91
95
  function LocalOnboardingView({ localOnboarding, localProviderSource, error, onBack, onContinue, onSwitchAccount, onTestConnectivity, onOpenSettings, onClearError, }) {
96
+ const productName = useLoginProductName();
92
97
  const snapshot = localOnboarding;
93
98
  const autoProbeKeyRef = useRef(null);
94
99
  const isStandalone = localProviderSource === 'standalone';
@@ -132,7 +137,7 @@ function LocalOnboardingView({ localOnboarding, localProviderSource, error, onBa
132
137
  snapshot?.publicUrl,
133
138
  snapshot?.spaceKind,
134
139
  ]);
135
- return (_jsxs("div", { className: "flex-1 flex flex-col h-full", children: [_jsxs("div", { className: "px-5 pt-5 pb-3 shrink-0 flex items-center gap-2", children: [_jsxs("button", { onClick: onBack, className: "-ml-1.5 inline-flex h-8 items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors cursor-pointer", "aria-label": "\u8FD4\u56DE\u7A7A\u95F4\u9009\u62E9", children: [_jsx(ArrowLeft, { className: "w-4 h-4" }), "\u8FD4\u56DE"] }), _jsx("h2", { className: "text-lg font-semibold text-foreground", children: productLabel })] }), _jsx(ErrorBanner, { error: error, onClearError: onClearError }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-5 py-2", children: _jsxs("div", { className: "flex min-h-full flex-col justify-center gap-4", children: [(isPendingStart || isStarting) && (_jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [_jsx(Loader2, { className: "w-6 h-6 text-primary animate-spin" }), _jsxs("p", { className: "text-sm font-medium text-foreground", children: ["\u6B63\u5728\u51C6\u5907", productLabel] }), _jsx("p", { className: "max-w-[18rem] text-xs leading-5 text-muted-foreground", children: progressDetail })] })), isReady && (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx("p", { className: "text-sm font-medium text-foreground text-center", children: isLocalNetworkBlocked ? '本机空间入口异常' : `${productLabel} 已准备好` }), isLocalNetworkBlocked ? (_jsx("p", { className: "text-xs text-muted-foreground leading-relaxed text-center", children: formatLocalStatusMessageForUser(connectivity?.message, '本机入口不可达。请确认本机空间已启动后重试。') })) : null, isStandalone ? (_jsx(RouteInfoCard, { title: "\u672C\u673A\u5165\u53E3", value: localUrl })) : null, !isStandalone ? (_jsx(LocalReachabilitySummary, { connectivity: connectivity, assumeLocalReachable: true })) : null, _jsx("button", { onClick: onContinue, className: "w-full h-10 rounded-xl bg-primary text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer", children: isLocalNetworkBlocked ? '重新检测' : '继续登录' })] })), (isRepair || isError) && (_jsx(LocalUnavailableRecovery, { canOpenSettings: Boolean(snapshot?.canOpenSettings), canRetry: Boolean(snapshot?.canRetry), onRetry: onContinue, onOpenSettings: onOpenSettings ?? (() => undefined), onSwitchAccount: onSwitchAccount }))] }) }), _jsx("div", { className: "px-5 pb-5 shrink-0" }), _jsx(Footer, {})] }));
140
+ return (_jsxs("div", { className: "flex-1 flex flex-col h-full", children: [_jsxs("div", { className: "px-5 pt-5 pb-3 shrink-0 flex items-center gap-2", children: [_jsxs("button", { onClick: onBack, className: "-ml-1.5 inline-flex h-8 items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors cursor-pointer", "aria-label": "\u8FD4\u56DE\u7A7A\u95F4\u9009\u62E9", children: [_jsx(ArrowLeft, { className: "w-4 h-4" }), "\u8FD4\u56DE"] }), _jsx("h2", { className: "text-lg font-semibold text-foreground", children: productLabel })] }), _jsx(ErrorBanner, { error: error, onClearError: onClearError }), _jsx("div", { className: "flex-1 min-h-0 overflow-y-auto px-5 py-2", children: _jsxs("div", { className: "flex min-h-full flex-col justify-center gap-4", children: [(isPendingStart || isStarting) && (_jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [_jsx(Loader2, { className: "w-6 h-6 text-primary animate-spin" }), _jsxs("p", { className: "text-sm font-medium text-foreground", children: ["\u6B63\u5728\u51C6\u5907", productLabel] }), _jsx("p", { className: "max-w-[18rem] text-xs leading-5 text-muted-foreground", children: progressDetail })] })), isReady && (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx("p", { className: "text-sm font-medium text-foreground text-center", children: isLocalNetworkBlocked ? '本机空间入口异常' : `${productLabel} 已准备好` }), isLocalNetworkBlocked ? (_jsx("p", { className: "text-xs text-muted-foreground leading-relaxed text-center", children: formatLocalStatusMessageForUser(connectivity?.message, '本机入口不可达。请确认本机空间已启动后重试。', productName) })) : null, isStandalone ? (_jsx(RouteInfoCard, { title: "\u672C\u673A\u5165\u53E3", value: localUrl })) : null, !isStandalone ? (_jsx(LocalReachabilitySummary, { connectivity: connectivity, assumeLocalReachable: true })) : null, _jsx("button", { onClick: onContinue, className: "w-full h-10 rounded-xl bg-primary text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer", children: isLocalNetworkBlocked ? '重新检测' : '继续登录' })] })), (isRepair || isError) && (_jsx(LocalUnavailableRecovery, { canOpenSettings: Boolean(snapshot?.canOpenSettings), canRetry: Boolean(snapshot?.canRetry), onRetry: onContinue, onOpenSettings: onOpenSettings ?? (() => undefined), onSwitchAccount: onSwitchAccount }))] }) }), _jsx("div", { className: "px-5 pb-5 shrink-0" }), _jsx(Footer, {})] }));
136
141
  }
137
142
  function RouteInfoCard({ title, value, action, }) {
138
143
  return (_jsxs("div", { className: "rounded-2xl border border-border/60 bg-muted/25 p-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("p", { className: "text-[11px] font-medium tracking-wide text-muted-foreground/70", children: title }), action] }), _jsx("p", { className: "mt-2 break-all font-mono text-[11px] leading-5 text-foreground", children: value ?? '正在获取入口' })] }));
@@ -163,8 +168,8 @@ function getLocalPreparationDetail(state, progressPhase) {
163
168
  return '正在准备登录授权';
164
169
  return '正在启动本机服务';
165
170
  }
166
- function formatLocalStatusMessageForUser(value, fallback) {
167
- return formatLoginErrorForUser(value, fallback);
171
+ function formatLocalStatusMessageForUser(value, fallback, productName) {
172
+ return formatLoginErrorForUser(value, fallback, { productName });
168
173
  }
169
174
  function formatProviderLabelForUser(value) {
170
175
  if (value === 'Cloud')
@@ -176,9 +181,10 @@ function formatProviderLabelForUser(value) {
176
181
  return value ?? '所选空间';
177
182
  }
178
183
  function ErrorBanner({ error, onClearError }) {
184
+ const productName = useLoginProductName();
179
185
  if (!error)
180
186
  return null;
181
- const message = formatLoginErrorForUser(error, '操作失败,请返回上一步后重试。');
187
+ const message = formatLoginErrorForUser(error, '操作失败,请返回上一步后重试。', { productName });
182
188
  return (_jsxs("div", { className: "mx-4 mb-3 px-3 py-2 bg-destructive/10 rounded-lg flex items-start gap-2 shrink-0", children: [_jsx(AlertCircle, { className: "w-3.5 h-3.5 text-destructive mt-0.5 shrink-0" }), _jsx("p", { className: "text-xs text-destructive flex-1 leading-relaxed", children: message }), _jsx("button", { onClick: onClearError, className: "text-destructive/60 hover:text-destructive shrink-0 cursor-pointer", "aria-label": "\u5173\u95ED\u9519\u8BEF\u63D0\u793A", children: _jsx(X, { className: "w-3.5 h-3.5" }) })] }));
183
189
  }
184
190
  function Footer() {
@@ -9,7 +9,7 @@ export interface LoginViewActions {
9
9
  dismissError: () => void;
10
10
  }
11
11
  /**
12
- * LinX-controlled authentication presentation. Xpod does not render this.
12
+ * Shared authentication presentation, driven by the host that renders it.
13
13
  *
14
14
  * `error` is idle-context copy, not a fifth product phase. Session creation,
15
15
  * restoration and Account/WebID composition belong to the host.
@@ -64,9 +64,15 @@ export interface StorageConflict {
64
64
  export interface LoginModalHostProps {
65
65
  /** Presentational seam only; hosts supply their own product brand. */
66
66
  brand?: ReactNode;
67
+ /**
68
+ * The name this host's product is shown under, used in user-facing text such
69
+ * as an error that asks the user to restart the application. Shared components
70
+ * do not assume one: leaving it out renders the neutral default.
71
+ */
72
+ productName?: string;
67
73
  /** Accessible dialog label for the login surface. */
68
74
  ariaLabel?: string;
69
- /** Optional affordances. Omitted values preserve the complete LinX source UI. */
75
+ /** Optional affordances. Omitted values preserve the complete source UI. */
70
76
  capabilities?: {
71
77
  storageSelection?: boolean;
72
78
  additionalProviders?: boolean;
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare function LoginProductNameProvider({ productName, children, }: {
3
+ productName?: string;
4
+ children: ReactNode;
5
+ }): import("react").JSX.Element;
6
+ export declare function useLoginProductName(): string;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from 'react';
3
+ import { DEFAULT_PRODUCT_NAME } from '../user-facing-errors.js';
4
+ /**
5
+ * The name the host's product is shown under, for the shared login surface.
6
+ *
7
+ * The login components are shared, so none of them may assume a product name:
8
+ * this carries the host's choice to the few places that mention the product in
9
+ * user-facing text - an error that asks the user to restart the application, for
10
+ * instance - without threading a prop through every nested view.
11
+ */
12
+ const LoginProductNameContext = createContext(DEFAULT_PRODUCT_NAME);
13
+ export function LoginProductNameProvider({ productName, children, }) {
14
+ return (_jsx(LoginProductNameContext.Provider, { value: productName?.trim() || DEFAULT_PRODUCT_NAME, children: children }));
15
+ }
16
+ export function useLoginProductName() {
17
+ return useContext(LoginProductNameContext);
18
+ }
@@ -1,2 +1,14 @@
1
- export declare function formatErrorForUser(error: unknown, fallback?: string): string;
2
- export declare function createUserFacingError(error: unknown, fallback: string): Error;
1
+ /**
2
+ * Product name used in user-facing text when the caller supplies none.
3
+ *
4
+ * These components are shared, so they must not assert a product identity: a
5
+ * host passes its own name in, and the fallback stays neutral enough to read
6
+ * correctly for any of them.
7
+ */
8
+ export declare const DEFAULT_PRODUCT_NAME = "\u5E94\u7528";
9
+ export interface UserFacingErrorOptions {
10
+ /** The name the host's product is shown under. */
11
+ productName?: string;
12
+ }
13
+ export declare function formatErrorForUser(error: unknown, fallback?: string, options?: UserFacingErrorOptions): string;
14
+ export declare function createUserFacingError(error: unknown, fallback: string, options?: UserFacingErrorOptions): Error;