@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.
- package/config/components-ignore.json +11 -7
- package/dist/acceptance/QleverSemanticConformance.js +7 -0
- package/dist/api/ai-gateway/providers/OfferingAuthorization.d.ts +6 -1
- package/dist/api/ai-gateway/providers/OfferingAuthorization.js +0 -3
- package/dist/api/ai-gateway/providers/ProviderRegistry.js +1 -1
- package/dist/api/container/index.js +1 -0
- package/dist/api/container/local.js +30 -12
- package/dist/api/container/routes.js +2 -0
- package/dist/api/container/types.d.ts +2 -0
- package/dist/api/handlers/AdminHandler.d.ts +17 -1
- package/dist/api/handlers/AdminHandler.js +40 -3
- package/dist/api/handlers/EdgeNodeSignalHandler.js +10 -2
- package/dist/api/handlers/NetworkSettingsHandler.d.ts +37 -5
- package/dist/api/handlers/NetworkSettingsHandler.js +39 -11
- package/dist/api/handlers/ProvisionHandler.d.ts +6 -1
- package/dist/api/handlers/ProvisionHandler.js +7 -2
- package/dist/api/handlers/ReachabilityHandler.d.ts +6 -0
- package/dist/api/handlers/ReachabilityHandler.js +22 -5
- package/dist/api/network/NetworkEnvironmentConfigurationStore.d.ts +6 -1
- package/dist/api/network/NetworkEnvironmentConfigurationStore.js +72 -16
- package/dist/api/runtime.d.ts +9 -0
- package/dist/api/runtime.js +15 -2
- package/dist/cli/commands/start.d.ts +19 -1
- package/dist/cli/commands/start.js +71 -5
- package/dist/components/context.jsonld +30 -0
- package/dist/edge/EdgeNodeAgent.d.ts +6 -0
- package/dist/edge/EdgeNodeAgent.js +1 -1
- package/dist/edge/EdgeNodeAgentInitializer.d.ts +2 -0
- package/dist/edge/EdgeNodeAgentInitializer.js +1 -0
- package/dist/edge/EdgeNodeAgentInitializer.jsonld +19 -0
- package/dist/edge/EdgeNodeDnsCoordinator.d.ts +11 -1
- package/dist/edge/EdgeNodeDnsCoordinator.js +12 -2
- package/dist/edge/EdgeNodeHealthProbeService.d.ts +15 -0
- package/dist/edge/EdgeNodeHealthProbeService.js +44 -12
- package/dist/edge/EdgeNodeHealthProbeService.jsonld +77 -0
- package/dist/edge/ProbeTargetGuard.d.ts +35 -0
- package/dist/edge/ProbeTargetGuard.js +142 -0
- package/dist/edge/reachability/NodeAccessResolver.d.ts +16 -0
- package/dist/edge/reachability/NodeAccessResolver.js +30 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +9 -3
- package/dist/main.js +7 -0
- package/dist/runtime/Proxy.d.ts +22 -0
- package/dist/runtime/Proxy.js +34 -7
- package/dist/runtime/bootstrap.d.ts +11 -0
- package/dist/runtime/bootstrap.js +21 -1
- package/dist/runtime/css-process.d.ts +1 -0
- package/dist/runtime/css-process.js +1 -0
- package/dist/runtime/host/node/NodeRuntimeHost.js +4 -1
- package/dist/runtime/host/types.d.ts +6 -0
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +5 -1
- package/dist/runtime/lifecycle.js +1 -0
- package/dist/runtime/port-finder.d.ts +30 -0
- package/dist/runtime/port-finder.js +83 -0
- package/dist/runtime/runner/node/NodeGatewayRuntimeRunner.js +1 -0
- package/dist/runtime/runner/types.d.ts +5 -0
- package/dist/runtime/runtime-types.d.ts +1 -0
- package/dist/storage/rdf/PostgresRdfEngine.js +10 -4
- package/dist/storage/rdf/RdfAccessScope.js +15 -1
- package/dist/storage/rdf/RdfEngineRdfJsSource.js +10 -2
- package/dist/test-utils/local-managed-client-p2p-e2e-smoke.js +1 -1
- package/dist/tunnel/LocalTunnelProvider.d.ts +15 -0
- package/dist/tunnel/LocalTunnelProvider.js +87 -18
- package/dist/tunnel/LocalTunnelProvider.jsonld +27 -0
- package/dist/tunnel/NgrokTunnelProvider.d.ts +4 -0
- package/dist/tunnel/NgrokTunnelProvider.js +117 -43
- package/dist/tunnel/NgrokTunnelProvider.jsonld +4 -0
- package/dist/tunnel/SakuraFrpTunnelProvider.d.ts +65 -3
- package/dist/tunnel/SakuraFrpTunnelProvider.js +268 -25
- package/dist/tunnel/TunnelLifecycle.d.ts +14 -0
- package/dist/tunnel/TunnelLifecycle.js +34 -0
- package/dist/tunnel/TunnelProfiles.d.ts +33 -3
- package/dist/tunnel/TunnelProfiles.js +105 -78
- package/dist/tunnel/TunnelProvider.d.ts +15 -2
- package/dist/tunnel/TunnelProvider.jsonld +8 -0
- package/dist/tunnel/TunnelProviderCatalog.d.ts +62 -0
- package/dist/tunnel/TunnelProviderCatalog.js +130 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +3 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +2 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiCustomProviderDialog.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiQuotaCard.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +13 -11
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.js +16 -13
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +3 -3
- package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/collections.js +3 -3
- package/node_modules/@undefineds.co/ai-connections/dist/{ai-connections-client.d.ts → contract/ai-connections-client.d.ts} +4 -2
- package/node_modules/@undefineds.co/ai-connections/dist/{ai-connections-client.js → contract/ai-connections-client.js} +4 -2
- package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/normalize.d.ts +17 -7
- package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/normalize.js +18 -213
- package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/request.js +3 -3
- package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/types.d.ts +11 -2
- package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/index.cjs +8 -8
- package/node_modules/@undefineds.co/ai-connections/dist/contract/index.d.ts +9 -0
- package/node_modules/@undefineds.co/ai-connections/dist/contract/index.js +9 -0
- package/node_modules/@undefineds.co/ai-connections/dist/{provider-catalog.cjs → contract/provider-catalog.cjs} +5 -28
- package/node_modules/@undefineds.co/ai-connections/dist/{provider-catalog.d.ts → contract/provider-catalog.d.ts} +9 -8
- package/node_modules/@undefineds.co/ai-connections/dist/{provider-catalog.js → contract/provider-catalog.js} +11 -31
- package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/controller.js +3 -2
- package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/display-wording.d.ts +20 -0
- package/node_modules/@undefineds.co/ai-connections/dist/display-wording.js +73 -0
- package/node_modules/@undefineds.co/ai-connections/dist/error-wording.d.ts +24 -0
- package/node_modules/@undefineds.co/ai-connections/dist/error-wording.js +253 -0
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +2 -3
- package/node_modules/@undefineds.co/ai-connections/dist/index.js +2 -3
- package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/offering-label.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/useAiConnectDialog.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/package.json +25 -18
- package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +4 -2
- package/node_modules/@undefineds.co/shared-ui/dist/index.js +4 -2
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.d.ts +4 -1
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.js +12 -6
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginView.d.ts +1 -1
- package/node_modules/@undefineds.co/shared-ui/dist/login/host-types.d.ts +7 -1
- package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.d.ts +6 -0
- package/node_modules/@undefineds.co/shared-ui/dist/login/login-branding.js +18 -0
- package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.d.ts +14 -2
- package/node_modules/@undefineds.co/shared-ui/dist/user-facing-errors.js +26 -17
- package/node_modules/@undefineds.co/solid-sdk/dist/login-store.d.ts +3 -3
- package/node_modules/@undefineds.co/solid-sdk/dist/login-store.js +3 -3
- package/package.json +4 -3
- package/static/auth-callback/assets/{AiConfigContext-DnQs1ZpW.js → AiConfigContext-DCXpjzpj.js} +1 -1
- package/static/auth-callback/assets/{AiConfigPage-DOtvlxH0.js → AiConfigPage-fe-xMIXa.js} +1 -1
- package/static/auth-callback/assets/{DocumentProcessingPanel-BS2voQgL.js → DocumentProcessingPanel-BGnkfMuU.js} +1 -1
- package/static/auth-callback/assets/{IndexLifecyclePanel-Cvt0cJtN.js → IndexLifecyclePanel-42Jups0j.js} +1 -1
- package/static/auth-callback/assets/{IndexSubjectPanel-Dhf01GqF.js → IndexSubjectPanel-CYyLOlQU.js} +1 -1
- package/static/auth-callback/assets/{ModelAssignmentsPanel-BJutWaAF.js → ModelAssignmentsPanel-BOvUH4yr.js} +1 -1
- package/static/auth-callback/assets/{ModelsPage-BRS0sje3.js → ModelsPage-DwyITxt7.js} +6 -6
- package/static/auth-callback/assets/NetworkPage-CG9RelJA.js +2 -0
- package/static/auth-callback/assets/{PaneListHeader-QQeJGTp4.js → PaneListHeader-yvd5ohs6.js} +1 -1
- package/static/auth-callback/assets/{SearchIndexingPanel-MyNUSEwT.js → SearchIndexingPanel-2_a6ezzj.js} +1 -1
- package/static/auth-callback/assets/{StatusSubjectPanel-DQkEVsFs.js → StatusSubjectPanel-8qtVxnzC.js} +1 -1
- package/static/auth-callback/assets/{StatusWorkspace-Dkv63Uwk.js → StatusWorkspace-CBdRahCF.js} +1 -1
- package/static/auth-callback/assets/{SystemSettingsPage-TIsUfX5d.js → SystemSettingsPage-BZJ6vWkg.js} +1 -1
- package/static/auth-callback/assets/{SystemSettingsSubjectPanel-BJWEt2-7.js → SystemSettingsSubjectPanel-xm08UhXP.js} +1 -1
- package/static/auth-callback/assets/XpodAiConnectionsPodStore-V6vgGfuw.js +3 -0
- package/static/auth-callback/assets/{activity-5hNeNKnL.js → activity-CeM7xly8.js} +1 -1
- package/static/auth-callback/assets/ai-connections-C6yaE6WQ.js +1 -0
- package/static/auth-callback/assets/{auth-callback-CAFZ3R0B.js → auth-callback-DTG8cSj7.js} +3 -3
- package/static/auth-callback/assets/{badge-CAIPI0CB.js → badge-qJo2Zr4d.js} +1 -1
- package/static/auth-callback/assets/{collection-runtime-D9s7h9YA.js → collection-runtime-Bztsz31a.js} +1 -1
- package/static/auth-callback/assets/{dialog-BjA109aX.js → dialog-D-h6x5x0.js} +1 -1
- package/static/auth-callback/assets/{download-B3Up5W2G.js → download-C2ir4lmR.js} +1 -1
- package/static/auth-callback/assets/{external-link-BTXgSPzB.js → external-link-THLDL4On.js} +1 -1
- package/static/auth-callback/assets/{index-CirW4CJf.js → index-BRpv4yO3.js} +1 -1
- package/static/auth-callback/assets/{index-BppXlxcp.js → index-BlVZb9A7.js} +1 -1
- package/static/auth-callback/assets/index-D983R1FV.js +4 -0
- package/static/auth-callback/assets/{index-browser-DtU38ni3.js → index-browser-3FvR0aaf.js} +1 -1
- package/static/auth-callback/assets/{key-round-CQCOrZ7x.js → key-round-C9U5j1Ly.js} +1 -1
- package/static/auth-callback/assets/{rotate-ccw-C1zM2KtS.js → rotate-ccw-DP45cD4o.js} +1 -1
- package/static/auth-callback/assets/{skeleton-Cqp7_M9-.js → skeleton-Dn4EiSCS.js} +1 -1
- package/static/auth-callback/assets/{waypoints-Bj6gAUSQ.js → waypoints-uqFQ3uEG.js} +1 -1
- package/static/auth-callback/assets/{workspace-layout-DK8mDzrY.js → workspace-layout-DLYK0Wwu.js} +1 -1
- package/static/auth-callback/auth-callback.html +1 -1
- package/static/dashboard/assets/{AiConfigContext-BsE7MqX8.js → AiConfigContext-DJcMECNw.js} +1 -1
- package/static/dashboard/assets/{AiConfigPage-DvM-lRXa.js → AiConfigPage-BvE7dOTy.js} +1 -1
- package/static/dashboard/assets/{DocumentProcessingPanel-BPfdlfuf.js → DocumentProcessingPanel-D9780krf.js} +1 -1
- package/static/dashboard/assets/{IndexLifecyclePanel--m0AGxvh.js → IndexLifecyclePanel-SjsUcnbM.js} +1 -1
- package/static/dashboard/assets/{IndexSubjectPanel-Bb7m1k3d.js → IndexSubjectPanel-C-ym2Tqi.js} +1 -1
- package/static/dashboard/assets/{ModelAssignmentsPanel-BLi_zbMa.js → ModelAssignmentsPanel-BRjZ-arB.js} +1 -1
- package/static/dashboard/assets/{ModelsPage-CxdpgnfR.js → ModelsPage-BtTU6du3.js} +6 -6
- package/static/dashboard/assets/NetworkPage-CV9qpkDg.js +2 -0
- package/static/dashboard/assets/{PaneListHeader-BBCMei0r.js → PaneListHeader-KyPTTBsv.js} +1 -1
- package/static/dashboard/assets/{SearchIndexingPanel-Ck4Y-xjR.js → SearchIndexingPanel-DolHGawg.js} +1 -1
- package/static/dashboard/assets/{StatusSubjectPanel-D1KWfAXE.js → StatusSubjectPanel-_YZvKiYi.js} +1 -1
- package/static/dashboard/assets/{StatusWorkspace-JbA5gzXx.js → StatusWorkspace-Dlbh_G40.js} +1 -1
- package/static/dashboard/assets/{SystemSettingsPage-BbwQWsSR.js → SystemSettingsPage-Be7QSIoz.js} +1 -1
- package/static/dashboard/assets/{SystemSettingsSubjectPanel-N117nMt5.js → SystemSettingsSubjectPanel-DBp0gja7.js} +1 -1
- package/static/dashboard/assets/{XpodAiConnectionsPodStore-CdDOb4SV.js → XpodAiConnectionsPodStore-ClpSjzpP.js} +7 -7
- package/static/dashboard/assets/{activity-DX1I96o_.js → activity-lsNbTXJu.js} +1 -1
- package/static/dashboard/assets/ai-connections-CXp5gd1J.js +1 -0
- package/static/dashboard/assets/{badge-k2vhtDqH.js → badge-CVatKjaG.js} +1 -1
- package/static/dashboard/assets/{collection-runtime-BFQ8teQJ.js → collection-runtime-Ec4UnY28.js} +1 -1
- package/static/dashboard/assets/{dashboard-DWZ-fmCT.js → dashboard-BEzsRsvF.js} +2 -2
- package/static/dashboard/assets/{dialog-1CCw-iHT.js → dialog-BuyelQ4V.js} +1 -1
- package/static/dashboard/assets/{download-C6-SNY1q.js → download-B4Nf678F.js} +1 -1
- package/static/dashboard/assets/{external-link-BgPcZ_j2.js → external-link-PYv9CvKL.js} +1 -1
- package/static/dashboard/assets/index-C9XPE-mI.js +4 -0
- package/static/dashboard/assets/{index-D7A8U6Pt.js → index-Cx69bTNh.js} +1 -1
- package/static/dashboard/assets/{index-6LcIUIYO.js → index-awr7ulur.js} +1 -1
- package/static/dashboard/assets/{key-round-BOd7Jo0Q.js → key-round-VsY80U1Z.js} +1 -1
- package/static/dashboard/assets/{rotate-ccw-CCgJqsvx.js → rotate-ccw-Cz1K4vE9.js} +1 -1
- package/static/dashboard/assets/{skeleton-Bc7abAn5.js → skeleton-BhNv_8tO.js} +1 -1
- package/static/dashboard/assets/{waypoints-s-opmJxx.js → waypoints-DYS9XFYV.js} +1 -1
- package/static/dashboard/assets/{workspace-layout-DqIQeTBV.js → workspace-layout-OZJAFx5V.js} +1 -1
- package/static/dashboard/dashboard.html +1 -1
- package/static/settings/assets/{AiConfigContext-BB9KZySa.js → AiConfigContext-B8JS3MXF.js} +1 -1
- package/static/settings/assets/{AiConfigPage-DGSXUkLs.js → AiConfigPage-C3Zl8LUl.js} +1 -1
- package/static/settings/assets/{DocumentProcessingPanel-Da2Re6Rg.js → DocumentProcessingPanel-DpDZAQvf.js} +1 -1
- package/static/settings/assets/{IndexLifecyclePanel-BSZuIzgr.js → IndexLifecyclePanel-Ec1XF88t.js} +1 -1
- package/static/settings/assets/{IndexSubjectPanel-CFd0ay-r.js → IndexSubjectPanel-BulT9BmO.js} +1 -1
- package/static/settings/assets/{ModelAssignmentsPanel-CSAryvWJ.js → ModelAssignmentsPanel-BcGSmYjb.js} +1 -1
- package/static/settings/assets/{ModelsPage-BQwCwLHU.js → ModelsPage-CvTCKy1T.js} +6 -6
- package/static/settings/assets/NetworkPage-DQF5u9Bn.js +2 -0
- package/static/settings/assets/{PaneListHeader-Bjh3hRdQ.js → PaneListHeader-D40hqcVl.js} +1 -1
- package/static/settings/assets/{SearchIndexingPanel-MjKL5QLU.js → SearchIndexingPanel-iCUPOx_0.js} +1 -1
- package/static/settings/assets/{StatusSubjectPanel-Bvl6K4mx.js → StatusSubjectPanel-E--ZHSql.js} +1 -1
- package/static/settings/assets/{StatusWorkspace-B0NzrP--.js → StatusWorkspace-YjDAx1II.js} +1 -1
- package/static/settings/assets/{SystemSettingsPage-D2z6Z4FE.js → SystemSettingsPage-CDdV3mC9.js} +1 -1
- package/static/settings/assets/{SystemSettingsSubjectPanel-4sxma4X4.js → SystemSettingsSubjectPanel-Br8WazDq.js} +1 -1
- package/static/settings/assets/XpodAiConnectionsPodStore-CLr38P_Z.js +3 -0
- package/static/settings/assets/{activity-CgJJGpjx.js → activity-C5DAHHTE.js} +1 -1
- package/static/settings/assets/ai-connections-C6yaE6WQ.js +1 -0
- package/static/settings/assets/{badge-C4NypVyT.js → badge-D8eIyxKt.js} +1 -1
- package/static/settings/assets/{collection-runtime-CTLCDxAi.js → collection-runtime-DLc9zil8.js} +1 -1
- package/static/settings/assets/{dialog-Csq0vWUi.js → dialog-CyuR7Va4.js} +1 -1
- package/static/settings/assets/{download-DaLJJ-Wp.js → download-c0oxZrCz.js} +1 -1
- package/static/settings/assets/{external-link--w_iW5Au.js → external-link-D3Z34fP_.js} +1 -1
- package/static/settings/assets/{index-BukHiu4y.js → index-CKGbRFlc.js} +1 -1
- package/static/settings/assets/index-CSr3-2Cj.js +4 -0
- package/static/settings/assets/{index-COmVnZi2.js → index-ComidxAm.js} +1 -1
- package/static/settings/assets/{index-browser-BGpvHwD0.js → index-browser-CAscEbae.js} +1 -1
- package/static/settings/assets/{key-round-Bk4YRjBu.js → key-round-DyjLmXuB.js} +1 -1
- package/static/settings/assets/{rotate-ccw-TCabbqsr.js → rotate-ccw-679HF_ec.js} +1 -1
- package/static/settings/assets/{settings-CJWpdbNC.js → settings-DKknqu4C.js} +3 -3
- package/static/settings/assets/{skeleton-JDHYVe7t.js → skeleton-CkopNkPB.js} +1 -1
- package/static/settings/assets/{waypoints-DDvEl-MU.js → waypoints-CrqfAftE.js} +1 -1
- package/static/settings/assets/{workspace-layout-DV5QU30U.js → workspace-layout-UN6c4qTG.js} +1 -1
- package/static/settings/settings.html +1 -1
- package/static/auth-callback/assets/NetworkPage-B3qBfANA.js +0 -2
- package/static/auth-callback/assets/XpodAiConnectionsPodStore-BJiXm-PF.js +0 -3
- package/static/auth-callback/assets/ai-connections-CryuHGKW.js +0 -1
- package/static/auth-callback/assets/index-DlLYWOhw.js +0 -4
- package/static/dashboard/assets/NetworkPage-BAIPw-D_.js +0 -2
- package/static/dashboard/assets/ai-connections-DwCRqOQa.js +0 -1
- package/static/dashboard/assets/index-UD6QOE7H.js +0 -4
- package/static/settings/assets/NetworkPage-BKymvsQc.js +0 -2
- package/static/settings/assets/XpodAiConnectionsPodStore-BkNQ8fZx.js +0 -3
- package/static/settings/assets/ai-connections-CryuHGKW.js +0 -1
- package/static/settings/assets/index-B0mQa59b.js +0 -4
- /package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/request.d.ts +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client → contract/client}/types.js +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/base-adapter.d.ts +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/base-adapter.js +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/codex.d.ts +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/codex.js +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/index.d.ts +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/index.js +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/json-env-adapter.d.ts +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/json-env-adapter.js +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/pi.d.ts +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/pi.js +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/transaction.d.ts +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/transaction.js +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/types.d.ts +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{client-config → contract/client-config}/types.js +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{credential-storage.d.ts → contract/credential-storage.d.ts} +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{credential-storage.js → contract/credential-storage.js} +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{endpoint-urls.d.ts → contract/endpoint-urls.d.ts} +0 -0
- /package/node_modules/@undefineds.co/ai-connections/dist/{endpoint-urls.js → contract/endpoint-urls.js} +0 -0
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
const INTERNAL_ERROR_PATTERN = /\b(provisionCode|providerCode|canonical|OIDC|openid-configuration|issuer|provider|storageProvider|publicUrl|baseUrl|spDomain|idpUrl|WebID|solid:storage|profile|dashboard|findById|IRI|HTTP\s+\d{3}|Cannot find module|node_modules|jsonld|componentsjs|cloudflared|Cloudflare Tunnel|container|root container|database|query failed|resource id|BadRequestHttpError|H400|xpod|runtime|Application Support|localhost|CSS_[A-Z_]+|XPOD_[A-Z_]+|Pod|podUrl|Solid|RDF|row\.id|row id|subject|Agent|Secretary|authenticated fetch|client_secret|client_id|access_token|refresh_token|threadId|chatId|messageId|workspaceUri|nodeId)\b/i;
|
|
2
2
|
const STACK_OR_PATH_PATTERN = /(?:\/Users\/|\\Users\\|\.tsx?:\d+|\.jsx?:\d+|Require stack|at\s+\w+[\w.]*\s*\()/i;
|
|
3
3
|
const RAW_ADDRESS_PATTERN = /(?:https?:\/\/|file:\/\/|127\.0\.0\.1|0\.0\.0\.0|\[::1\])/i;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Product name used in user-facing text when the caller supplies none.
|
|
6
|
+
*
|
|
7
|
+
* These components are shared, so they must not assert a product identity: a
|
|
8
|
+
* host passes its own name in, and the fallback stays neutral enough to read
|
|
9
|
+
* correctly for any of them.
|
|
10
|
+
*/
|
|
11
|
+
export const DEFAULT_PRODUCT_NAME = '应用';
|
|
12
|
+
export function formatErrorForUser(error, fallback = '操作失败,请重试。', options = {}) {
|
|
13
|
+
const productName = options.productName?.trim() || DEFAULT_PRODUCT_NAME;
|
|
5
14
|
const raw = extractErrorMessage(error);
|
|
6
15
|
if (!raw) {
|
|
7
16
|
return fallback;
|
|
@@ -9,7 +18,7 @@ export function formatErrorForUser(error, fallback = '操作失败,请重试
|
|
|
9
18
|
const message = safeDecodeURIComponent(raw).trim();
|
|
10
19
|
const normalized = message.toLowerCase();
|
|
11
20
|
if (/email_unverified|verify_required/.test(normalized)) {
|
|
12
|
-
return
|
|
21
|
+
return `请先验证邮箱。打开注册邮箱里的验证邮件后,再回到 ${productName} 重试。`;
|
|
13
22
|
}
|
|
14
23
|
if (/login_required|interaction_required|consent_required|account_selection_required/.test(normalized)) {
|
|
15
24
|
return '需要重新确认登录。请在弹出的登录窗口完成授权。';
|
|
@@ -51,7 +60,7 @@ export function formatErrorForUser(error, fallback = '操作失败,请重试
|
|
|
51
60
|
return '当前空间还没有创建完成。请回到空间选择页,重新进入后按提示创建。';
|
|
52
61
|
}
|
|
53
62
|
if (/selected sp pod url|current sp pod url|pod url was not applied|unable to resolve current pod url|cannot .* pod record|outside the current sp|pod 地址无效|pod 不属于当前选择的空间|当前空间没有声明可写入的 pod/.test(normalized)) {
|
|
54
|
-
return
|
|
63
|
+
return `${productName} 还不能把数据保存到当前空间。请换一个空间;如果这是本地空间,请先完成空间创建。`;
|
|
55
64
|
}
|
|
56
65
|
if (/webid does not belong to this account|does not belong to this account/.test(normalized)) {
|
|
57
66
|
return '账号和当前空间不匹配。请返回空间选择页,换账号或换空间。';
|
|
@@ -60,7 +69,7 @@ export function formatErrorForUser(error, fallback = '操作失败,请重试
|
|
|
60
69
|
return '空间准备超时。请检查网络,或返回空间选择页重试。';
|
|
61
70
|
}
|
|
62
71
|
if (/pod write failed|write failed|read failed|solid database is missing authenticated fetch|agent resource id must|agent home|ai secretary|secretary.*初始化失败|created ai secretary.*missing id|secretary chat row|secretary thread row/.test(normalized)) {
|
|
63
|
-
return
|
|
72
|
+
return `${productName} 还不能在当前空间保存数据。请返回空间选择页,换一个空间后重试。`;
|
|
64
73
|
}
|
|
65
74
|
if (/pod creation endpoint not found/.test(normalized)) {
|
|
66
75
|
return '当前空间暂时不能创建。请返回空间选择页,确认选择正确后再试。';
|
|
@@ -99,34 +108,34 @@ export function formatErrorForUser(error, fallback = '操作失败,请重试
|
|
|
99
108
|
return '本地工作区还没有配置完成。请在设置里检查本地空间后重试。';
|
|
100
109
|
}
|
|
101
110
|
if (/database not connected|solid database is not ready|database is not ready|数据库未就绪|not ready/.test(normalized)) {
|
|
102
|
-
return
|
|
111
|
+
return `${productName} 还不能在当前空间保存数据。请稍后重试;如果仍失败,请换一个空间重新登录。`;
|
|
103
112
|
}
|
|
104
113
|
if (/(?:chat|thread|message).*not found|no chat found|cannot find pod message|failed to resolve (?:chat|thread|message)|(?:chat|thread|message).*missing id|row is missing id/.test(normalized)) {
|
|
105
114
|
return '当前内容还没有准备好。请刷新页面后重试。';
|
|
106
115
|
}
|
|
107
116
|
if (/findbyid requires|base-relative|full iris/.test(normalized)) {
|
|
108
|
-
return
|
|
117
|
+
return `${productName} 初始化失败。请刷新页面;如果仍失败,请换一个空间重新登录。`;
|
|
109
118
|
}
|
|
110
119
|
if (/unable to install @undefineds\.co\/xpod|unable to prepare xpod runtime/.test(normalized)) {
|
|
111
120
|
return '本地空间组件下载失败。请检查网络后重试。';
|
|
112
121
|
}
|
|
113
122
|
if (/unable to locate xpod|unable to determine exact @undefineds\.co\/xpod version/.test(normalized)) {
|
|
114
|
-
return
|
|
123
|
+
return `本地空间启动文件损坏。请重启 ${productName} 让它自动修复;如果仍失败,请打开本地空间设置修复。`;
|
|
115
124
|
}
|
|
116
125
|
if (/missing required local login\/startup capabilities|scoped webid|scoped pickwebid|scoped picker|escaped recursive css runtime/.test(normalized)) {
|
|
117
|
-
return
|
|
126
|
+
return `本地空间版本过旧。请重启 ${productName} 让它自动更新;如果仍失败,请打开本地空间设置修复。`;
|
|
118
127
|
}
|
|
119
128
|
if (/local 服务在完成启动前已退出|exceeded max restarts|failed to start xpod/.test(normalized)) {
|
|
120
|
-
return
|
|
129
|
+
return `本地空间启动失败。请点“重新检查”;如果仍失败,请重启 ${productName}。`;
|
|
121
130
|
}
|
|
122
131
|
if (/等待 local 服务就绪超时|local.*启动超时/.test(normalized)) {
|
|
123
|
-
return
|
|
132
|
+
return `本地空间启动超时。请点“重新检查”;如果仍失败,请重启 ${productName}。`;
|
|
124
133
|
}
|
|
125
134
|
if (/cannot find module|invalid resource iri|jsonld|componentsjs|application support|require stack/.test(normalized)) {
|
|
126
|
-
return
|
|
135
|
+
return `本地空间启动文件损坏。请重启 ${productName} 让它自动修复;如果仍失败,请打开本地空间设置修复。`;
|
|
127
136
|
}
|
|
128
137
|
if (/spawn bun enoent|本地运行环境|node\/npm|npm|bun/.test(normalized)) {
|
|
129
|
-
return
|
|
138
|
+
return `本机缺少本地空间运行环境。请检查网络后重试,${productName} 会自动安装需要的组件。`;
|
|
130
139
|
}
|
|
131
140
|
if (/spacekind must|configuredspacekind|requestedspacekind/.test(normalized)) {
|
|
132
141
|
return '当前页面和已启动的空间不一致。请回到空间选择页重新进入。';
|
|
@@ -137,14 +146,14 @@ export function formatErrorForUser(error, fallback = '操作失败,请重试
|
|
|
137
146
|
if (isInternalDiagnostic(message)) {
|
|
138
147
|
return fallback;
|
|
139
148
|
}
|
|
140
|
-
const productMessage = localizeProductTerms(message);
|
|
149
|
+
const productMessage = localizeProductTerms(message, productName);
|
|
141
150
|
if (isSafeUserMessage(productMessage)) {
|
|
142
151
|
return productMessage;
|
|
143
152
|
}
|
|
144
153
|
return fallback;
|
|
145
154
|
}
|
|
146
|
-
export function createUserFacingError(error, fallback) {
|
|
147
|
-
const userMessage = formatErrorForUser(error, fallback);
|
|
155
|
+
export function createUserFacingError(error, fallback, options = {}) {
|
|
156
|
+
const userMessage = formatErrorForUser(error, fallback, options);
|
|
148
157
|
return new Error(userMessage);
|
|
149
158
|
}
|
|
150
159
|
function extractErrorMessage(error) {
|
|
@@ -182,10 +191,10 @@ function isSafeUserMessage(message) {
|
|
|
182
191
|
function isInternalDiagnostic(message) {
|
|
183
192
|
return INTERNAL_ERROR_PATTERN.test(message) || STACK_OR_PATH_PATTERN.test(message) || RAW_ADDRESS_PATTERN.test(message);
|
|
184
193
|
}
|
|
185
|
-
function localizeProductTerms(message) {
|
|
194
|
+
function localizeProductTerms(message, productName) {
|
|
186
195
|
return message
|
|
187
196
|
.replace(/Cloud-managed canonical URL/gi, '自动分配登录地址')
|
|
188
|
-
.replace(/Cloud provisioning/gi,
|
|
197
|
+
.replace(/Cloud provisioning/gi, `${productName}`)
|
|
189
198
|
.replace(/\bCloud\s+账号/g, '云端账号')
|
|
190
199
|
.replace(/\bCloud\s+身份/g, '云端账号')
|
|
191
200
|
.replace(/\bCloud\b/g, '云端')
|
|
@@ -63,10 +63,10 @@ export declare const useLoginStore: import("zustand").UseBoundStore<Omit<StoreAp
|
|
|
63
63
|
};
|
|
64
64
|
}>;
|
|
65
65
|
/**
|
|
66
|
-
* Creates the
|
|
66
|
+
* Creates the shared login store for a host-owned lifetime.
|
|
67
67
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
68
|
+
* The only host adaptation: callers may isolate the two persisted keys or opt out
|
|
69
|
+
* of persistence without changing the shared state machine.
|
|
70
70
|
*/
|
|
71
71
|
export declare function createLoginStore(options?: LoginStoreOptions): LoginStoreApi;
|
|
72
72
|
export declare const DEFAULT_PROVIDERS: ProviderOption[];
|
|
@@ -183,10 +183,10 @@ function createLoginPersistOptions(storage, name) {
|
|
|
183
183
|
const defaultPersistStorage = getBrowserStorage() ?? createMemoryStorage();
|
|
184
184
|
export const useLoginStore = create()(persist(createLoginState(persistRememberedAccount), createLoginPersistOptions(defaultPersistStorage, LOGIN_STORE_KEY)));
|
|
185
185
|
/**
|
|
186
|
-
* Creates the
|
|
186
|
+
* Creates the shared login store for a host-owned lifetime.
|
|
187
187
|
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
188
|
+
* The only host adaptation: callers may isolate the two persisted keys or opt out
|
|
189
|
+
* of persistence without changing the shared state machine.
|
|
190
190
|
*/
|
|
191
191
|
export function createLoginStore(options = {}) {
|
|
192
192
|
const rememberedStorage = options.storage === undefined ? getBrowserStorage() : options.storage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@undefineds.co/xpod",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.14",
|
|
4
4
|
"description": "Xpod is an extended Community Solid Server, offering rich-feature, production-level Solid Pod and identity management.",
|
|
5
5
|
"repository": "https://github.com/undefinedsco/xpod",
|
|
6
6
|
"author": "developer@undefineds.co",
|
|
@@ -170,7 +170,8 @@
|
|
|
170
170
|
"smoke:tunnel:ngrok:browser": "bun scripts/ngrok-browser-pod-smoke.ts",
|
|
171
171
|
"smoke:tunnel:ngrok:inrupt": "bun scripts/ngrok-inrupt-oidc-smoke.ts",
|
|
172
172
|
"dev:monitor": "bun --no-env-file scripts/dev-repair.ts",
|
|
173
|
-
"dev:monitor:desktop": "bun --no-env-file scripts/dev-repair.ts --desktop"
|
|
173
|
+
"dev:monitor:desktop": "bun --no-env-file scripts/dev-repair.ts --desktop",
|
|
174
|
+
"accept:network-tunnel": "bun scripts/accept-network-tunnel.ts"
|
|
174
175
|
},
|
|
175
176
|
"devDependencies": {
|
|
176
177
|
"@anthropic-ai/claude-agent-sdk": "^0.2.39",
|
|
@@ -383,7 +384,7 @@
|
|
|
383
384
|
}
|
|
384
385
|
},
|
|
385
386
|
"optionalDependencies": {
|
|
386
|
-
"@undefineds.co/xpod-darwin-arm64": "0.4.
|
|
387
|
+
"@undefineds.co/xpod-darwin-arm64": "0.4.14"
|
|
387
388
|
},
|
|
388
389
|
"resolutions": {
|
|
389
390
|
"@inrupt/solid-client-authn-browser": "^3.1.1",
|
package/static/auth-callback/assets/{AiConfigContext-DnQs1ZpW.js → AiConfigContext-DCXpjzpj.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as J,r as a,j as V,p as X}from"./auth-callback-
|
|
1
|
+
import{u as J,r as a,j as V,p as X}from"./auth-callback-DTG8cSj7.js";import{a as $}from"./ai-connections-C6yaE6WQ.js";import{d as D}from"./XpodAiConnectionsPodStore-V6vgGfuw.js";async function R(t){return k(t(h("/api/ai/config"),{method:"GET",credentials:"include",headers:{accept:"application/json"}}))}async function G(t,e){return k(t(h("/api/ai/config"),{method:"PATCH",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(e)}))}async function H(t,e){const o=await t(h("/api/ai/config/rebuild"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({target:e})}),s=await o.json().catch(()=>{});if(!o.ok||!s?.job)throw new Error(s?.error??"Index rebuild request failed");return s.job}async function ee(t,e){const o=e.capabilities.some(i=>i.toLowerCase()==="embedding"),s=await t(h(o?"/v1/embeddings":"/v1/chat/completions"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(o?{model:e.id,input:"xpod readiness probe"}:{model:e.id,messages:[{role:"user",content:"Reply OK."}],max_tokens:1,stream:!1})});if(!s.ok){const i=await s.json().catch(()=>{}),d=typeof i?.error=="string"?i.error:i?.error?.message;throw new Error(d??"Model readiness probe failed")}await s.arrayBuffer()}function h(t){if(typeof window>"u")throw new Error("AI Config API requires the current browser origin");return new URL(t,window.location.origin).toString()}async function k(t){const e=await t,o=await e.json().catch(()=>{});if(!e.ok||!o?.config||!o.capabilities)throw new Error(o?.error??"AI Config request failed");return o}const L=a.createContext(void 0),K=2e3;function te({children:t}){const e=J(),[o,s]=a.useState(),[i,d]=a.useState(),[c,p]=a.useState([]),[y,g]=a.useState(),[O,v]=a.useState(!0),[C,M]=a.useState(!1),[I,P]=a.useState(!1),[S,u]=a.useState(),[N,T]=a.useState(0),q=!!(e.webId&&e.currentPod);a.useEffect(()=>{if(!e.webId||!e.currentPod)return;let r=!1;return queueMicrotask(()=>{if(r||!e.webId||!e.currentPod)return;v(!0),u(void 0);const n=$({webId:e.webId,podUrl:e.currentPod.podUrl,authenticatedFetch:e.fetch}),_=D({database:e.currentPod.database,authenticatedFetch:e.fetch,podUrl:e.currentPod.podUrl,webId:e.currentPod.webId}).listModels?.()?.catch(()=>[])??Promise.resolve([]);Promise.all([R(e.fetch),n.listModels().catch(()=>[]),_]).then(([l,B,F])=>{r||(s(l.config),d(l.capabilities),g(l.lifecycle),p(Q(z(F,B))))}).catch(l=>{r||u(l instanceof Error?l.message:String(l))}).finally(()=>{r||v(!1)})}),()=>{r=!0}},[N,e.currentPod,e.fetch,e.webId]);const A=a.useCallback(()=>{T(r=>r+1)},[]),j=y?.pending??0;a.useEffect(()=>{if(j<=0||!e.webId||!e.currentPod)return;let r=!1;const n=setInterval(()=>{R(e.fetch).then(f=>{r||g(f.lifecycle)}).catch(()=>{})},K);return()=>{r=!0,clearInterval(n)}},[j,e.currentPod,e.fetch,e.webId]);const b=a.useCallback(async r=>{M(!0),u(void 0);try{const n=await G(e.fetch,r);s(n.config),d(n.capabilities),g(n.lifecycle)}catch(n){throw u(n instanceof Error?n.message:String(n)),n}finally{M(!1)}},[e.fetch]),m=a.useCallback(async r=>{P(!0),u(void 0);try{const n=await H(e.fetch,r);g(f=>({configurationVersion:f?.configurationVersion,pending:(f?.pending??0)+1,recent:[n,...f?.recent??[]].slice(0,20)}))}catch(n){throw u(n instanceof Error?n.message:String(n)),n}finally{P(!1)}},[e.fetch]),E=a.useCallback(async(r,n)=>{await b(r),await m(n)},[m,b]),x=q?O:!1,U=a.useMemo(()=>({config:o,capabilities:i,lifecycle:y,models:c,loading:x,saving:C,rebuilding:I,error:S,reload:A,save:b,rebuild:m,saveAndRebuild:E}),[i,o,x,S,y,c,m,I,A,b,E,C]);return V.jsx(L.Provider,{value:U,children:t})}function z(t,e){const o=new Map,s=i=>`${i.provider}\0${w(i.id)}`;for(const i of[...t,...e]){const d=s(i),c=o.get(d);if(!c){o.set(d,{...i,id:w(i.id)});continue}const p=[...new Set([...c.capabilities??[],...i.capabilities??[]])];o.set(d,{...c,...i,id:w(i.id),resourceId:c.resourceId??i.resourceId,displayName:c.displayName??i.displayName,availability:c.availability==="available"?c.availability:i.availability,modelType:c.modelType??i.modelType,...p.length>0?{capabilities:p}:{},...c.inputModalities??i.inputModalities?{inputModalities:c.inputModalities??i.inputModalities}:{}})}return[...o.values()]}function w(t){const e=t.lastIndexOf("#");return e>=0?t.slice(e+1):t}function Q(t){return t.map(e=>({id:e.id,displayName:e.displayName,owner:e.provider,ref:X(e.provider,e.id),capabilities:e.capabilities??[]}))}function ie(t,e){const s={chatModel:["chat"],ocrModel:["ocr"],readerModel:["document-understanding","documentunderstanding"],embeddingModel:["embedding"],indexerModel:["indexing"],rerankerModel:["reranking","reranker"]}[e];return s?t.filter(i=>i.capabilities.some(d=>s.includes(d.toLowerCase()))):t}function ne(){const t=a.useContext(L);if(!t)throw new Error("useAiConfig must be used within AiConfigProvider");return t}export{te as A,ie as m,ee as t,ne as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as e,v as h,r as p,O as g,N as f,w as v,x as y}from"./auth-callback-
|
|
1
|
+
import{c as d,j as e,v as h,r as p,O as g,N as f,w as v,x as y}from"./auth-callback-DTG8cSj7.js";import{P as b}from"./PaneListHeader-yvd5ohs6.js";import{A as j,u as k}from"./AiConfigContext-DCXpjzpj.js";import{T as N,u as w}from"./workspace-layout-DLYK0Wwu.js";import"./ai-connections-C6yaE6WQ.js";import"./XpodAiConnectionsPodStore-V6vgGfuw.js";import"./index-browser-3FvR0aaf.js";const M=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],C=d("file-search",M);const A=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M7 12H3",key:"13ou7f"}],["path",{d:"M7 19H3",key:"wbqt3n"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14",key:"qth677"}],["path",{d:"M11 10v4h4",key:"172dkj"}]],I=d("list-restart",A);const L=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]],H=d("scan-text",L);const q=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],_=d("sliders-horizontal",q);function o(s,a,t,n,i){return{id:s,label:a,path:t,href:`/ai-config/${t}`,end:!0,description:n,icon:i}}const l=[o("model-assignments","Model Assignments","model-assignments","Choose the model used by each Xpod capability.",_),o("document-processing","Document Processing","document-processing","Control OCR and structured document reading.",H),o("search-indexing","Search & Indexing","search-indexing","Enable FTS, vector retrieval, and backend selection.",C),o("index-lifecycle","Index Lifecycle","index-lifecycle","Control automatic indexing and derived-index rebuilds.",I)];function K(){return e.jsx(j,{children:e.jsx(S,{})})}function S(){const s=h(),{config:a,loading:t,saving:n,error:i,reload:m}=k(),[u,c]=p.useState(!1),x=l.find(r=>s.pathname.endsWith(r.path))??l[0];return e.jsx(N,{mode:"auto",listHeader:e.jsx(b,{title:"AI Config"}),list:e.jsx(T,{}),mainHeader:e.jsx("div",{className:"flex h-full min-w-0 items-center px-4",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-sm font-semibold text-foreground",children:["AI Config · ",x.label]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Pod-level AI and derived-index policy"})]})}),main:e.jsxs("section",{className:"min-h-full bg-background",children:[n&&e.jsx("div",{role:"status","aria-live":"polite",className:"border-b border-border px-6 py-2 text-xs text-muted-foreground",children:"Saving AI configuration…"}),i?e.jsx(z,{error:i,showTechnicalDetails:u,onToggleTechnicalDetails:()=>c(r=>!r),onRetry:()=>{c(!1),m()}}):t||!a?e.jsx(P,{}):e.jsx(g,{})]}),className:"min-h-full"})}function z({error:s,showTechnicalDetails:a,onToggleTechnicalDetails:t,onRetry:n}){return e.jsx("div",{className:"mx-auto w-full max-w-4xl p-6",children:e.jsxs("div",{role:"alert","aria-live":"assertive",className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"AI configuration could not be loaded"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Xpod could not read this Pod’s AI settings. Your existing settings were not changed."}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:"Try again"}),e.jsx("button",{type:"button","aria-expanded":a,onClick:t,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground hover:bg-accent",children:a?"Hide details":"Show details"})]}),a&&e.jsx("p",{className:"mt-3 break-words font-mono text-xs text-muted-foreground",children:s})]})})}function P(){return e.jsxs("div",{role:"status","aria-live":"polite",className:"mx-auto w-full max-w-4xl p-6",children:[e.jsx("div",{className:"h-7 w-52 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"mt-3 h-4 w-80 max-w-full animate-pulse rounded bg-muted"}),e.jsx("div",{className:"mt-6 divide-y divide-border overflow-hidden rounded-xl border border-border",children:Array.from({length:4},(s,a)=>e.jsxs("div",{className:"grid gap-4 p-4 lg:grid-cols-[minmax(220px,1fr)_minmax(320px,440px)]",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 w-28 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"h-3 w-52 animate-pulse rounded bg-muted"})]}),e.jsx("div",{className:"h-10 animate-pulse rounded-md bg-muted"})]},a))}),e.jsx("span",{className:"sr-only",children:"Loading AI configuration…"})]})}function T(){const s=w();return e.jsx("aside",{className:"h-full border-r border-border bg-muted/20 py-2",children:e.jsx("nav",{"aria-label":"AI Config sections","data-list-navigation":!0,children:l.map(a=>{const t=a.icon;return e.jsxs(f,{to:a.path,end:a.end,onClick:()=>s.openMain(),onKeyDown:v,className:({isActive:n})=>y(n,{compact:!1}),children:[e.jsx(t,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-medium",children:a.label}),e.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-muted-foreground",children:a.description})]})]},a.id)})})})}export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,j as a}from"./auth-callback-
|
|
1
|
+
import{r as u,j as a}from"./auth-callback-DTG8cSj7.js";import{i as g,A as p}from"./ModelAssignmentsPanel-BOvUH4yr.js";import{u as x}from"./AiConfigContext-DCXpjzpj.js";import"./dialog-D-h6x5x0.js";import"./index-BlVZb9A7.js";import"./ai-connections-C6yaE6WQ.js";import"./XpodAiConnectionsPodStore-V6vgGfuw.js";import"./index-browser-3FvR0aaf.js";function P(){const{config:o,save:t,saving:s}=x(),[e,r]=u.useState(o?.documentProcessing);if(u.useEffect(()=>{let n=!1;return queueMicrotask(()=>{n||r(o?.documentProcessing)}),()=>{n=!0}},[o]),!e)return null;const l=g(e,o?.documentProcessing),b=async n=>{n.preventDefault(),await t({documentProcessing:e})};return a.jsx(p,{title:"Document Processing",description:"Control when Xpod invokes OCR and structured document readers.",onSubmit:b,onRestore:()=>t({documentProcessing:{ocrEnabled:!0,automaticOcr:!0,imageRecognition:!0,pdfRecognition:!0,tableRecognition:!1,processingMode:"auto",ocrFallbackOrder:["ocr","reader","plain-text"],readerPolicy:"auto",readerPriority:"structure-first",maxFileSizeMb:64,maxPages:500,failureFallback:"plain-text"}}),saving:s,dirty:l,children:a.jsxs("div",{className:"space-y-4 rounded-xl border border-border p-4",children:[a.jsx(i,{label:"Enable OCR",description:"Read text from images and scanned documents.",checked:e.ocrEnabled,onChange:n=>r({...e,ocrEnabled:n})}),a.jsx(i,{label:"Automatic OCR",description:"Run OCR when indexed content has no usable text layer.",checked:e.automaticOcr,onChange:n=>r({...e,automaticOcr:n})}),a.jsx(i,{label:"Image recognition",description:"Allow OCR and readers to process image resources.",checked:e.imageRecognition,onChange:n=>r({...e,imageRecognition:n})}),a.jsx(i,{label:"PDF recognition",description:"Process native and scanned PDF resources.",checked:e.pdfRecognition,onChange:n=>r({...e,pdfRecognition:n})}),a.jsx(i,{label:"Table recognition",description:"Preserve detected table structure when the reader supports it.",checked:e.tableRecognition,onChange:n=>r({...e,tableRecognition:n})}),a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["Processing mode",a.jsxs("select",{name:"processingMode",value:e.processingMode,onChange:n=>r({...e,processingMode:n.target.value}),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm sm:max-w-xs",children:[a.jsx("option",{value:"auto",children:"Auto"}),a.jsx("option",{value:"on-demand",children:"On demand"})]})]}),a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["OCR fallback order",a.jsx("input",{value:e.ocrFallbackOrder.join(", "),onChange:n=>r({...e,ocrFallbackOrder:n.target.value.split(",").map(c=>c.trim()).filter(c=>["ocr","reader","plain-text"].includes(c))}),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm"})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(d,{label:"Reader policy",value:e.readerPolicy,options:["auto","always","disabled"],onChange:n=>r({...e,readerPolicy:n})}),a.jsx(d,{label:"Reader priority",value:e.readerPriority,options:["structure-first","speed-first"],onChange:n=>r({...e,readerPriority:n})}),a.jsx(m,{label:"Maximum file size (MB)",value:e.maxFileSizeMb,min:1,max:1024,onChange:n=>r({...e,maxFileSizeMb:n})}),a.jsx(m,{label:"Maximum pages",value:e.maxPages,min:1,max:1e4,onChange:n=>r({...e,maxPages:n})}),a.jsx(d,{label:"Failure fallback",value:e.failureFallback,options:["plain-text","skip"],onChange:n=>r({...e,failureFallback:n})})]})]})})}function d({label:o,value:t,options:s,onChange:e}){return a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:[o,a.jsx("select",{value:t,onChange:r=>e(r.target.value),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm",children:s.map(r=>a.jsx("option",{value:r,children:r},r))})]})}function m({label:o,value:t,min:s,max:e,onChange:r}){return a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:[o,a.jsx("input",{type:"number",value:t,min:s,max:e,onChange:l=>r(l.target.valueAsNumber),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm"})]})}function i({label:o,description:t,checked:s,onChange:e}){return a.jsxs("label",{className:"flex items-start justify-between gap-4",children:[a.jsxs("span",{children:[a.jsx("span",{className:"block text-sm font-medium",children:o}),a.jsx("span",{className:"block text-xs text-muted-foreground",children:t})]}),a.jsx("input",{type:"checkbox",checked:s,onChange:r=>e(r.target.checked),className:"mt-1 h-4 w-4 rounded border-input"})]})}export{P as DocumentProcessingPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e}from"./auth-callback-
|
|
1
|
+
import{r as l,j as e}from"./auth-callback-DTG8cSj7.js";import{i as h,A as b}from"./ModelAssignmentsPanel-BOvUH4yr.js";import{u as g}from"./AiConfigContext-DCXpjzpj.js";import"./dialog-D-h6x5x0.js";import"./index-BlVZb9A7.js";import"./ai-connections-C6yaE6WQ.js";import"./XpodAiConnectionsPodStore-V6vgGfuw.js";import"./index-browser-3FvR0aaf.js";function S(){const{config:r,capabilities:d,lifecycle:i,save:n,rebuild:u,saving:m,rebuilding:x}=g(),[s,a]=l.useState(r?.lifecycle);if(l.useEffect(()=>{let t=!1;return queueMicrotask(()=>{t||a(r?.lifecycle)}),()=>{t=!0}},[r]),!s)return null;const f=h(s,r?.lifecycle),p=async t=>{t.preventDefault(),await n({lifecycle:s})};return e.jsxs(b,{title:"Index Lifecycle",description:"Control automatic maintenance and explicitly schedule rebuilds of derived data.",onSubmit:p,onRestore:()=>n({lifecycle:{automaticIndexing:!0,refreshAfterSourceUpdate:!0,removeAfterSourceDeletion:!0}}),saving:m,dirty:f,children:[e.jsxs("div",{className:"divide-y divide-border rounded-xl border border-border",children:[e.jsxs("label",{className:"flex items-start justify-between gap-4 p-4",children:[e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-medium",children:"Automatically index changes"}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:"Index new and updated resources, and remove derived entries after deletion."})]}),e.jsx("input",{name:"automaticIndexing",type:"checkbox",checked:s.automaticIndexing,onChange:t=>a({...s,automaticIndexing:t.target.checked}),className:"mt-1 h-4 w-4 rounded border-input"})]}),e.jsx(c,{label:"Refresh after source updates",checked:s.refreshAfterSourceUpdate,onChange:t=>a({...s,refreshAfterSourceUpdate:t})}),e.jsx(c,{label:"Remove derived entries after source deletion",checked:s.removeAfterSourceDeletion,onChange:t=>a({...s,removeAfterSourceDeletion:t})})]}),e.jsxs("section",{className:"rounded-xl border border-border p-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Rebuild derived indexes"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Rebuild actions never modify authority data in the Pod."}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["fts","vector","all"].map(t=>e.jsxs("button",{type:"button",disabled:!d?.rebuildTargets?.includes(t)||x,onClick:()=>u(t),className:"h-9 rounded-md border border-input px-3 text-sm font-medium disabled:opacity-50",children:["Rebuild ",t==="all"?"all":t.toUpperCase()]},t))})]}),e.jsxs("section",{className:"rounded-xl border border-border p-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Lifecycle evidence"}),e.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[e.jsx(o,{label:"Configuration version",value:i?.configurationVersion??r?.updatedAt??"Default"}),e.jsx(o,{label:"Pending queue",value:String(i?.pending??0)})]}),e.jsx("div",{className:"mt-4 space-y-2",children:i?.recent.length?i.recent.map(t=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border p-3 text-sm",children:[e.jsxs("span",{children:[t.target.toUpperCase()," · ",t.status]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.progress??0,"% · ",new Date(t.createdAt).toLocaleString()]}),t.error?e.jsx("span",{className:"w-full text-xs text-destructive",children:t.error}):null]},t.id)):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No rebuild jobs have been scheduled."})})]})]})}function c({label:r,checked:d,onChange:i}){return e.jsxs("label",{className:"flex items-start justify-between gap-4 p-4",children:[e.jsx("span",{className:"text-sm font-medium",children:r}),e.jsx("input",{type:"checkbox",checked:d,onChange:n=>i(n.target.checked),className:"mt-1 h-4 w-4 rounded border-input"})]})}function o({label:r,value:d}){return e.jsxs("div",{className:"rounded-md border border-border p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:r}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:d})]})}export{S as IndexLifecyclePanel};
|
package/static/auth-callback/assets/{IndexSubjectPanel-Dhf01GqF.js → IndexSubjectPanel-CYyLOlQU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e,B as g,R as j,C as p,a as y,b,d as S,e as N}from"./auth-callback-
|
|
1
|
+
import{r as l,j as e,B as g,R as j,C as p,a as y,b,d as S,e as N}from"./auth-callback-DTG8cSj7.js";import{g as C}from"./admin-C6qCRFiY.js";import{S as m}from"./skeleton-Dn4EiSCS.js";function F({kind:r}){const[s,n]=l.useState(null),[d,t]=l.useState(!1),i=l.useCallback(async()=>{t(!0);try{n(await C())}finally{t(!1)}},[]);return l.useEffect(()=>{let c=!0;return Promise.resolve().then(()=>{c&&i()}),()=>{c=!1}},[i]),e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(g,{type:"button",size:"sm",variant:"outline",onClick:i,disabled:d,children:[e.jsx(j,{className:"mr-2 h-4 w-4"}),"Refresh"]})}),e.jsx("div",{role:"status","aria-live":"polite",className:"sr-only",children:d?"Refreshing index evidence…":s?"Index evidence refreshed.":"Waiting for index evidence."}),e.jsxs(p,{children:[e.jsxs(y,{children:[e.jsx(b,{children:w[r]}),e.jsx(S,{children:"Observed derived-index state; policy changes belong in AI Config."})]}),e.jsx(N,{children:d&&!s?e.jsx(B,{}):R(r,s)})]})]})}const w={overview:"Index Overview",fts:"FTS",vector:"Vector","retrieval-points":"Retrieval Points",cache:"Cache","slow-queries":"Slow Queries",benchmark:"Benchmark"};function R(r,s){if(!s)return e.jsx("p",{className:"text-sm text-muted-foreground",children:"Waiting for runtime evidence."});if(r==="benchmark"){const t=s.benchmarkReports;return e.jsx(a,{values:[["Reports",String(t?.reportCount??0)],["Skipped files",String(t?.skippedFiles??0)],["Errors",String(t?.errors.length??0)]]})}if(!s.available)return e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Unavailable: ",s.reason]});if(r==="overview"){const t=s.stats.lifecycle;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(a,{values:[["Engine",s.engine],["State",v(t?.status)],["Authority data",o(s.stats.factsBytes)],["Derived storage",o(s.stats.derivedBytes)],["Total storage",o(s.stats.totalBytes)],["Generated",f(s.generatedAt)]]}),e.jsx(x,{children:"Derived indexes are rebuildable runtime evidence; Pod RDF remains the authority data."})]})}if(r==="cache"){const t=s.stats.derivedCache;return t?e.jsx(a,{values:[["Cache bytes",o(t.cacheBytes)],["Limit",o(t.maxCacheBytes)],["Pressure",`${Math.round(t.cachePressure*100)}%`],["Evictions",String(t.evictionCount)]]}):e.jsx(u,{})}if(r==="slow-queries"){const t=s.stats.slowQueries;return t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{values:[["Captured",String(t.entryCount)],["Limit",String(t.maxEntries)]]}),t.entries.slice(0,10).map(i=>e.jsxs("div",{className:"rounded-lg border border-border p-3 text-sm",children:[e.jsxs("div",{className:"font-medium",children:[i.runtime.durationMs," ms · ",i.runtime.returnedRows," rows"]}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:i.reasons.join(", ")||i.queryKey})]},`${i.generatedAt}-${i.queryKey}`))]}):e.jsx(u,{})}if(r==="retrieval-points"){const t=s.stats.rdf3x;return t?e.jsx(a,{values:[["State",t.syncedWithFacts?"Synchronized":`${t.refreshLag} versions behind`],["Facts version",String(t.factsDataVersion)],["Retrieval version",String(t.rdf3xFactsDataVersion)],["Pending sources",String(t.pendingSources)]]}):e.jsx(u,{})}const n=s.stats.lifecycle,d=r==="fts"?n?.coldStart?.ownsTextIndex:n?.coldStart?.ownsVectorIndex;if((r==="fts"||r==="vector")&&d){const t=s.stats.pgAcceleration,i=s.stats.rdf3x;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(a,{values:[["State",v(n?.status)],["Ownership","Runtime managed"],["Backend",t?.provider?`${h(t.provider)}${t.version?` ${t.version}`:""}`:n?.driver??"Not reported"],["Freshness",i?i.syncedWithFacts?"Current":`${i.refreshLag} versions behind`:"Not reported"],["Indexes",t?.customIndexes?.map(c=>c.name).join(", ")||"Runtime managed"],["Last ready",f(n?.lastReadyAt)]]}),e.jsxs(x,{children:[r==="fts"?"Text retrieval":"Vector retrieval"," is derived from Pod authority data. Enablement and backend policy are configured in AI Config."]})]})}return e.jsx(u,{})}function a({values:r}){return e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:r.map(([s,n])=>e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s}),e.jsx("div",{className:"mt-1 font-medium",children:n})]},s))})}function B(){return e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","aria-hidden":"true",children:Array.from({length:4},(r,s)=>e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx(m,{className:"h-3 w-20"}),e.jsx(m,{className:"mt-2 h-5 w-28"})]},s))})}function u(){return e.jsx("p",{className:"text-sm text-muted-foreground",children:"This runtime does not report evidence for this index subject."})}function x({children:r}){return e.jsx("p",{className:"text-sm text-muted-foreground",children:r})}function o(r){return r<1024?`${r} B`:r<1024*1024?`${Math.round(r/1024)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}function f(r){return r?new Date(r).toLocaleString():"Not reported"}function v(r){return r?h(r):"Unknown"}function h(r){return r.charAt(0).toUpperCase()+r.slice(1)}export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,u as U,r as b}from"./auth-callback-
|
|
1
|
+
import{j as e,u as U,r as b}from"./auth-callback-DTG8cSj7.js";import{m as z,u as L,t as q}from"./AiConfigContext-DCXpjzpj.js";import{D as X,a as J,b as V,c as G,d as H,e as K}from"./dialog-D-h6x5x0.js";function Q(t,s){return N(t)!==N(s)}function N(t){return Array.isArray(t)?`[${t.map(N).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).filter(([,s])=>s!==void 0).sort(([s],[n])=>s.localeCompare(n)).map(([s,n])=>`${JSON.stringify(s)}:${N(n)}`).join(",")}}`:JSON.stringify(t)}const k=[{label:"General / Chat",name:"chatModel",description:"Used for assistant conversations and general text tasks."},{label:"OCR",name:"ocrModel",description:"Reads text from images and scanned pages."},{label:"Document Reader",name:"readerModel",description:"Extracts structure and content from documents."},{label:"Embedding",name:"embeddingModel",description:"Creates vectors for semantic search."},{label:"Indexer / Summarizer",name:"indexerModel",description:"Prepares and summarizes content for indexes."},{label:"Reranker",name:"rerankerModel",description:"Reorders search results by relevance."}];function W(){const{config:t,capabilities:s,lifecycle:n,models:o,save:l,saveAndRebuild:c,saving:i,rebuilding:a}=L(),g=U(),[f,j]=b.useState({}),[u,v]=b.useState(),[y,w]=b.useState({}),[S,x]=b.useState(),[C,d]=b.useState();b.useEffect(()=>{let r=!1;return queueMicrotask(()=>{r||j(t?.models??{})}),()=>{r=!0}},[t]);const _=Q(f,t?.models??{}),M=T(f,t),h=R(n,a),A=()=>Object.fromEntries(k.map(({name:r})=>[r,f[r]||null])),F=async r=>{if(r.preventDefault(),M){if(h)return;x({models:A(),switch:M});return}await l({models:A()})},B=async()=>{const r=Object.fromEntries(k.map(({name:p})=>[p,null])),m=T(r,t);if(!m){await l({models:r});return}h||x({models:r,switch:m})},I=async()=>{const r=S;if(x(void 0),!r)return;const m=D(s);if(!m){await l({models:r.models}),d("模型已保存;此运行时不支持重建索引,请稍后手动重建。");return}await c({models:r.models},m),d(void 0)};return e.jsxs(e.Fragment,{children:[e.jsxs(P,{title:"Model Assignments",description:"Choose a connected model for each Xpod capability. Unassigned capabilities use the system default.",onSubmit:F,onRestore:()=>{B()},saving:i||a,dirty:_,children:[e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border",children:k.map(r=>e.jsx(O,{...r,models:o,value:f[r.name],testing:u===r.name,testResult:y[r.name],disabled:r.name==="embeddingModel"&&h,notice:r.name!=="embeddingModel"?void 0:h?"索引重建进行中,完成后才能再次切换向量模型。":M?"切换向量模型会重建索引:保存前需要二次确认,确认后立即排队重建。":void 0,onChange:m=>j(p=>({...p,[r.name]:m})),onTest:async m=>{v(r.name);try{await q(g.fetch,m),w(p=>({...p,[r.name]:"ready"}))}catch{w(p=>({...p,[r.name]:"failed"}))}finally{v(void 0)}}},r.name))}),e.jsx(E,{lifecycle:n,fallbackNotice:C})]}),e.jsx(Z,{request:S?.switch,models:o,saving:i||a||h,onCancel:()=>x(void 0),onConfirm:()=>{I()}})]})}function T(t,s){const n=t.embeddingModel;if(n===void 0)return;const o=s?.models?.embeddingModel??"";return(n??"")===o?void 0:{from:o||void 0,to:n||void 0}}function R(t,s=!1){if(s)return!0;const n=$(t)?.phase;return n==="queued"||n==="running"}function D(t){const s=t?.rebuildTargets??[];if(s.includes("vector"))return"vector";if(s.includes("all"))return"all"}function $(t){if(!t)return;const s=t.recent[0];if(!s)return t.pending>0?{phase:"queued",pending:t.pending}:void 0;if(!(s.status==="queued"&&t.pending<=0))return{phase:s.status,pending:t.pending,target:s.target,...s.progress!==void 0?{progress:s.progress}:{},...s.error?{error:s.error}:{}}}const Y={queued:"索引重建已排队",running:"索引重建进行中",succeeded:"索引重建完成",failed:"索引重建失败"};function E({lifecycle:t,fallbackNotice:s}){const n=$(t);if(!n)return s?e.jsx("p",{role:"status",className:"text-xs text-amber-600",children:s}):null;const o=[n.progress!==void 0?`${n.progress}%`:void 0,n.pending>0?`队列 ${n.pending}`:void 0,n.error].filter(Boolean).join(" · ");return e.jsxs("p",{role:"status",className:`text-xs ${n.phase==="failed"?"text-destructive":"text-muted-foreground"}`,children:[Y[n.phase],o?` · ${o}`:""]})}function Z({request:t,models:s,saving:n,onCancel:o,onConfirm:l}){const c=i=>{if(!i)return"系统默认";const a=s.find(g=>g.ref===i);return a?`${a.displayName??a.id} · ${a.owner}`:i};return e.jsx(X,{open:!!t,onOpenChange:i=>{i||o()},children:e.jsxs(J,{"data-testid":"embedding-switch-dialog",children:[e.jsxs(V,{children:[e.jsx(G,{children:"切换向量模型并重建索引?"}),e.jsx(H,{children:"已建立的向量由原模型生成,切换后需要用新模型重建索引才能参与检索。重建期间检索只会返回文本命中。"})]}),t&&e.jsxs("dl",{className:"grid gap-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("dt",{className:"text-muted-foreground",children:"当前"}),e.jsx("dd",{className:"min-w-0 break-all text-right",children:c(t.from)})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("dt",{className:"text-muted-foreground",children:"切换为"}),e.jsx("dd",{className:"min-w-0 break-all text-right",children:c(t.to)})]})]}),e.jsxs(K,{children:[e.jsx("button",{type:"button",onClick:o,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium hover:bg-accent",children:"取消"}),e.jsx("button",{type:"button",disabled:n,onClick:l,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground disabled:opacity-50",children:n?"提交中…":"确认切换并重建"})]})]})})}function O({label:t,name:s,description:n,models:o,value:l,testing:c,testResult:i,notice:a,disabled:g=!1,onChange:f,onTest:j}){const u=o.find(d=>d.ref===l),v=z(o,s),y=u?.capabilities.some(d=>["chat","embedding"].includes(d.toLowerCase()))===!0,x=[u?`Connected · credential ready · ${u.owner}`:l?"Selected model is no longer credential-ready":void 0,i==="ready"?"Probe succeeded":i==="failed"?"Probe failed; review AI Connection health":void 0].filter(Boolean).join(" · "),C=!!(l&&!u)||i==="failed";return e.jsxs("div",{"data-testid":"model-assignment-row",className:"grid gap-3 p-4 lg:grid-cols-[minmax(220px,1fr)_minmax(320px,440px)] lg:items-start",children:[e.jsxs("div",{className:"min-w-0 pt-1",children:[e.jsx("span",{className:"block text-sm font-medium text-foreground",children:t}),e.jsx("span",{className:"mt-0.5 block text-xs leading-5 text-muted-foreground",children:n})]}),e.jsxs("div",{"data-testid":"model-assignment-controls",className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,1fr)_4.5rem] sm:items-start",children:[e.jsxs("label",{className:"min-w-0",children:[e.jsxs("span",{className:"sr-only",children:[t," model"]}),e.jsxs("select",{name:s,value:l??"",disabled:g,onChange:d=>f(d.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground disabled:opacity-50",children:[e.jsx("option",{value:"",children:"System default"}),v.map(d=>e.jsxs("option",{value:d.ref,children:[d.displayName??d.id," · ",d.owner]},`${d.owner}:${d.id}`))]})]}),e.jsx("button",{type:"button","aria-label":`Test ${t} model`,disabled:g||!y||c,title:u?y?"Send a bounded readiness probe":"This model has no bounded probe endpoint":"Select a connected model first",onClick:()=>u&&void j(u),className:"h-10 w-full self-start rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground hover:bg-accent disabled:opacity-50",children:c?"Testing…":"Test"}),x&&e.jsx("span",{role:"status",className:`text-xs sm:col-span-2 ${C?"text-destructive":"text-muted-foreground"}`,children:x}),a&&e.jsx("span",{"data-testid":"model-assignment-notice",className:"text-xs text-amber-600 sm:col-span-2",children:a})]})]})}function P({title:t,description:s,children:n,onSubmit:o,onRestore:l,footerActions:c,saving:i=!1,dirty:a=!0}){return e.jsxs("form",{onSubmit:o,className:"mx-auto flex w-full max-w-4xl flex-col gap-6 p-6",children:[e.jsxs("header",{children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:t}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm text-muted-foreground",children:s})]}),n,e.jsxs("div",{className:"flex justify-end gap-2 border-t border-border pt-4",children:[e.jsx("span",{role:"status",className:"mr-auto self-center text-xs text-muted-foreground",children:a?"Unsaved changes":"Applied"}),c,e.jsx("button",{type:"button",onClick:l,disabled:i||!l,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium hover:bg-accent disabled:opacity-50",children:"Restore defaults"}),e.jsx("button",{type:"submit",disabled:i||!o||!a,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground disabled:opacity-50",children:i?"Saving…":"Save configuration"})]})]})}const ne=Object.freeze(Object.defineProperty({__proto__:null,AiConfigForm:P,ModelAssignmentRow:O,ModelAssignmentsPanel:W,RebuildStatusLine:E,embeddingModelSwitch:T,rebuildInFlight:R,rebuildStatusFrom:$,rebuildTargetForCapabilities:D},Symbol.toStringTag,{value:"Module"}));export{P as A,ne as M,Q as i};
|