@undefineds.co/xpod 0.4.13 → 0.4.15
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/cloud.json +0 -3
- package/config/components-ignore.json +11 -7
- package/config/local.json +0 -3
- package/config/xpod.base.json +0 -24
- package/dist/api/ai-config/AiConfigStore.d.ts +2 -2
- package/dist/api/ai-config/AiConfigStore.js +4 -1
- package/dist/api/ai-gateway/auth/CallerPodAccess.d.ts +2 -5
- package/dist/api/ai-gateway/auth/CallerPodAccess.js +3 -42
- package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.d.ts +2 -1
- package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.js +1 -1
- package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.d.ts +3 -8
- package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.js +9 -32
- package/dist/api/ai-gateway/connect/index.d.ts +3 -3
- package/dist/api/ai-gateway/connect/index.js +9 -38
- package/dist/api/ai-gateway/errors.js +2 -1
- package/dist/api/ai-gateway/models/PodModelSelectionRepository.d.ts +3 -3
- package/dist/api/ai-gateway/models/PodModelSelectionRepository.js +7 -11
- package/dist/api/ai-gateway/pod/HostedPodRoute.d.ts +27 -0
- package/dist/api/ai-gateway/pod/HostedPodRoute.js +47 -0
- package/dist/api/ai-gateway/pod/OwnerPodAccess.d.ts +79 -0
- package/dist/api/ai-gateway/pod/OwnerPodAccess.js +192 -0
- package/dist/api/ai-gateway/pod/PodInterfaceKeyStore.d.ts +52 -0
- package/dist/api/ai-gateway/pod/PodInterfaceKeyStore.js +61 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.js +1 -1
- package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.d.ts +3 -3
- package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.js +7 -32
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.d.ts +1 -1
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.js +1 -1
- package/dist/api/auth/ClientCredentialsAuthenticator.js +5 -28
- package/dist/api/auth/TokenEndpointRoute.d.ts +18 -0
- package/dist/api/auth/TokenEndpointRoute.js +36 -0
- package/dist/api/chatkit/pod-store.d.ts +4 -4
- package/dist/api/chatkit/pod-store.js +24 -95
- package/dist/api/container/common.js +36 -23
- package/dist/api/container/index.js +1 -0
- package/dist/api/container/local.js +88 -37
- package/dist/api/container/routes.js +41 -7
- package/dist/api/container/types.d.ts +4 -2
- package/dist/api/handlers/AdminHandler.d.ts +17 -1
- package/dist/api/handlers/AdminHandler.js +40 -3
- package/dist/api/handlers/AiGatewayManagementHandler.d.ts +6 -0
- package/dist/api/handlers/AiGatewayManagementHandler.js +17 -4
- package/dist/api/handlers/EdgeNodeSignalHandler.js +10 -2
- package/dist/api/handlers/NetworkSettingsHandler.d.ts +44 -5
- package/dist/api/handlers/NetworkSettingsHandler.js +46 -11
- package/dist/api/handlers/PodSettingsHandler.d.ts +3 -3
- package/dist/api/handlers/PodSettingsHandler.js +3 -3
- package/dist/api/handlers/ProvisionHandler.d.ts +35 -1
- package/dist/api/handlers/ProvisionHandler.js +53 -2
- package/dist/api/handlers/ReachabilityHandler.d.ts +6 -0
- package/dist/api/handlers/ReachabilityHandler.js +25 -6
- package/dist/api/network/NetworkEnvironmentConfigurationStore.d.ts +6 -1
- package/dist/api/network/NetworkEnvironmentConfigurationStore.js +72 -16
- package/dist/api/runtime.d.ts +18 -0
- package/dist/api/runtime.js +28 -2
- package/dist/api/service/AiClientConfigurationService.d.ts +1 -1
- package/dist/api/service/AiClientConfigurationService.js +1 -1
- package/dist/cli/commands/start.d.ts +26 -1
- package/dist/cli/commands/start.js +69 -5
- package/dist/components/components.jsonld +1 -1
- package/dist/components/context.jsonld +35 -42
- package/dist/edge/EdgeNodeAgent.d.ts +16 -0
- package/dist/edge/EdgeNodeAgent.js +56 -1
- package/dist/edge/EdgeNodeAgent.jsonld +8 -0
- 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/edge/reachability/ReachabilitySessionService.js +4 -1
- package/dist/edge/reachability/RouteSetBuilder.d.ts +18 -1
- package/dist/edge/reachability/RouteSetBuilder.js +47 -0
- package/dist/edge/reachability/RouteSetBuilder.jsonld +29 -0
- package/dist/edge/reachability/types.d.ts +8 -2
- package/dist/http/SubgraphSparqlHttpHandler.d.ts +1 -25
- package/dist/http/SubgraphSparqlHttpHandler.js +0 -100
- package/dist/http/SubgraphSparqlHttpHandler.jsonld +0 -8
- package/dist/identity/drizzle/PodInterfaceKeyRepository.d.ts +33 -0
- package/dist/identity/drizzle/PodInterfaceKeyRepository.js +78 -0
- package/dist/identity/drizzle/db.d.ts +7 -0
- package/dist/identity/drizzle/db.js +30 -0
- package/dist/identity/drizzle/schema.pg.d.ts +9 -0
- package/dist/identity/drizzle/schema.pg.js +16 -1
- package/dist/identity/drizzle/schema.sqlite.d.ts +106 -0
- package/dist/identity/drizzle/schema.sqlite.js +16 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +9 -5
- package/dist/main.js +7 -0
- package/dist/runtime/GatewayAdminProxyAuth.d.ts +1 -16
- package/dist/runtime/GatewayAdminProxyAuth.js +2 -71
- package/dist/runtime/Proxy.d.ts +32 -1
- package/dist/runtime/Proxy.js +125 -31
- package/dist/runtime/bootstrap.d.ts +21 -0
- package/dist/runtime/bootstrap.js +45 -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 +6 -1
- package/dist/runtime/host/types.d.ts +6 -0
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +4 -1
- package/dist/runtime/js-runtime.js +10 -3
- package/dist/runtime/lifecycle.js +6 -4
- package/dist/runtime/port-finder.d.ts +26 -0
- package/dist/runtime/port-finder.js +64 -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/test-utils/local-managed-client-p2p-e2e-smoke.js +1 -1
- package/dist/tunnel/AutoTunnelProvider.d.ts +56 -0
- package/dist/tunnel/AutoTunnelProvider.js +181 -0
- 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/dist/tunnel/index.d.ts +1 -0
- package/dist/tunnel/index.js +3 -1
- 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 +1 -1
- 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/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 +1 -1
- 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-core/dist → ai-connections/dist/contract}/ai-connections-client.d.ts +1 -1
- package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/ai-connections-client.js +1 -1
- package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/index.cjs +8 -8
- package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/index.d.ts +1 -1
- package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/index.js +1 -1
- package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/provider-catalog.cjs +3 -3
- package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/controller.js +1 -1
- 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 +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/error-wording.d.ts +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/error-wording.js +8 -3
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +1 -1
- 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 +31 -1
- package/node_modules/@undefineds.co/solid-sdk/dist/access-route.cjs +230 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/access-route.d.ts +76 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/access-route.js +115 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/index.cjs +89 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/index.d.ts +1 -0
- package/node_modules/@undefineds.co/solid-sdk/dist/index.js +1 -0
- package/node_modules/@undefineds.co/solid-sdk/package.json +6 -1
- package/package.json +5 -6
- package/static/app/assets/inrupt-smoke.js +23 -23
- package/static/app/assets/main.css +1 -1
- package/static/auth-callback/assets/{AiConfigContext-DlFyEWy9.js → AiConfigContext-Bx0HCAW5.js} +1 -1
- package/static/auth-callback/assets/{AiConfigPage-CkYk-SFW.js → AiConfigPage-ChQImMbm.js} +1 -1
- package/static/auth-callback/assets/{DocumentProcessingPanel-CqIr3JqN.js → DocumentProcessingPanel-D830H4SH.js} +1 -1
- package/static/auth-callback/assets/{IndexLifecyclePanel-C1GKV3Vx.js → IndexLifecyclePanel-CnlkjMF8.js} +1 -1
- package/static/auth-callback/assets/{IndexSubjectPanel-ro9lC6XW.js → IndexSubjectPanel-CdEfg_CO.js} +1 -1
- package/static/auth-callback/assets/{ModelAssignmentsPanel-DxNdyKRJ.js → ModelAssignmentsPanel-D-8A8dZx.js} +1 -1
- package/static/auth-callback/assets/{ModelsPage-BVtWSPBU.js → ModelsPage-Cim7cubp.js} +3 -3
- package/static/auth-callback/assets/NetworkPage-CfK3x-pb.js +2 -0
- package/static/auth-callback/assets/{PaneListHeader-ByKw8ada.js → PaneListHeader-Bf_kEd4U.js} +1 -1
- package/static/auth-callback/assets/{SearchIndexingPanel-CulBKcYT.js → SearchIndexingPanel-4kD4RBEQ.js} +1 -1
- package/static/auth-callback/assets/{StatusSubjectPanel-VOcfrt8o.js → StatusSubjectPanel-Bw9AiTSf.js} +1 -1
- package/static/auth-callback/assets/{StatusWorkspace-Jsz6hAdE.js → StatusWorkspace-C-301H-0.js} +1 -1
- package/static/auth-callback/assets/{SystemSettingsPage-BFNvGAle.js → SystemSettingsPage-BbWn-eG6.js} +1 -1
- package/static/auth-callback/assets/{SystemSettingsSubjectPanel-DFRdrSfK.js → SystemSettingsSubjectPanel-DA4wvNSm.js} +1 -1
- package/static/auth-callback/assets/{XpodAiConnectionsPodStore-C6KpvHVg.js → XpodAiConnectionsPodStore-CohdyLoX.js} +1 -1
- package/static/auth-callback/assets/{activity-DnTlb9iM.js → activity-CCsb9Oam.js} +1 -1
- package/static/auth-callback/assets/ai-connections-DexTPyfC.js +1 -0
- package/static/auth-callback/assets/{auth-callback-D2UkK5Xj.js → auth-callback-Ds-c62W3.js} +5 -5
- package/static/auth-callback/assets/auth-callback-rk080mvG.css +1 -0
- package/static/auth-callback/assets/{badge-D7IJuuTM.js → badge-CQm5OyzR.js} +1 -1
- package/static/auth-callback/assets/{collection-runtime-wT1n4GS2.js → collection-runtime-DlAuU5TW.js} +1 -1
- package/static/auth-callback/assets/{dialog-DickLu5z.js → dialog-CnGzg5Ff.js} +1 -1
- package/static/auth-callback/assets/{download-kn8WnRu3.js → download-DwMONJvm.js} +1 -1
- package/static/auth-callback/assets/{external-link-B6B8jfSn.js → external-link-Bu5AGqCO.js} +1 -1
- package/static/auth-callback/assets/{index-DHF97YLP.js → index-B0T-1YO8.js} +1 -1
- package/static/auth-callback/assets/{index-Dz83EEHD.js → index-C8QZf_4W.js} +1 -1
- package/static/auth-callback/assets/index-DwIlrIDG.js +4 -0
- package/static/auth-callback/assets/{index-browser-CSghinyi.js → index-browser-lRsMcP_7.js} +1 -1
- package/static/auth-callback/assets/{key-round-ChkOx3E1.js → key-round-BDMtU57P.js} +1 -1
- package/static/auth-callback/assets/{rotate-ccw-B3hE-nyd.js → rotate-ccw-CoKIGCsQ.js} +1 -1
- package/static/auth-callback/assets/{skeleton-kEqR7tpI.js → skeleton-CPoSWHDr.js} +1 -1
- package/static/auth-callback/assets/{waypoints-D6Jo-SZa.js → waypoints-BeYHxqHv.js} +1 -1
- package/static/auth-callback/assets/{workspace-layout-BHwT_cHd.js → workspace-layout-xA5YxiK3.js} +1 -1
- package/static/auth-callback/auth-callback.html +2 -2
- package/static/dashboard/assets/{AiConfigContext-BfC3v-x2.js → AiConfigContext-rWx4TyiH.js} +1 -1
- package/static/dashboard/assets/{AiConfigPage-QNS3u7Ff.js → AiConfigPage-StVJpDFT.js} +1 -1
- package/static/dashboard/assets/{DocumentProcessingPanel-Dr4XLeT4.js → DocumentProcessingPanel-DJ5yul2O.js} +1 -1
- package/static/dashboard/assets/{IndexLifecyclePanel-KtM_gpeO.js → IndexLifecyclePanel-CpjtgezK.js} +1 -1
- package/static/dashboard/assets/{IndexSubjectPanel-DLaiKdLc.js → IndexSubjectPanel-BVKcot1_.js} +1 -1
- package/static/dashboard/assets/{ModelAssignmentsPanel-Bk7TvQRq.js → ModelAssignmentsPanel-BxVgWZPc.js} +1 -1
- package/static/dashboard/assets/{ModelsPage-Cci3vlos.js → ModelsPage-CECBwmeO.js} +3 -3
- package/static/dashboard/assets/NetworkPage-zQgFscEW.js +2 -0
- package/static/dashboard/assets/{PaneListHeader-qHME_s08.js → PaneListHeader-DIPe8pS6.js} +1 -1
- package/static/dashboard/assets/{SearchIndexingPanel-HZPKj8H9.js → SearchIndexingPanel-lalFJ3c8.js} +1 -1
- package/static/dashboard/assets/{StatusSubjectPanel-ij7IpI8d.js → StatusSubjectPanel-CpY_KU-G.js} +1 -1
- package/static/dashboard/assets/{StatusWorkspace-Cp02JcaN.js → StatusWorkspace-BwWCii3A.js} +1 -1
- package/static/dashboard/assets/{SystemSettingsPage-BSeuvb8X.js → SystemSettingsPage-BKZxX-_n.js} +1 -1
- package/static/dashboard/assets/{SystemSettingsSubjectPanel-CP4_luGS.js → SystemSettingsSubjectPanel-BZrqb2C5.js} +1 -1
- package/static/dashboard/assets/{XpodAiConnectionsPodStore-urO6zaHL.js → XpodAiConnectionsPodStore-Bbpx9dTN.js} +1 -1
- package/static/dashboard/assets/{activity-DxjgQNvr.js → activity-BJ15TLVP.js} +1 -1
- package/static/dashboard/assets/ai-connections-GG6qkTJt.js +1 -0
- package/static/dashboard/assets/{badge-53qCrRbl.js → badge-BBX5FlaB.js} +1 -1
- package/static/dashboard/assets/{collection-runtime-BPAmHG46.js → collection-runtime-UBbHBzdf.js} +1 -1
- package/static/dashboard/assets/{dashboard-BcT2ByXw.js → dashboard-7Y6BHyV9.js} +62 -62
- package/static/dashboard/assets/dashboard-rk080mvG.css +1 -0
- package/static/dashboard/assets/{dialog-B28YtNhS.js → dialog-QrOJ-hB0.js} +1 -1
- package/static/dashboard/assets/{download-DkLNceJ4.js → download-DK9x-VOP.js} +1 -1
- package/static/dashboard/assets/{external-link-D3TXnlo3.js → external-link-Cnkn87mJ.js} +1 -1
- package/static/dashboard/assets/index-B1z84it5.js +4 -0
- package/static/dashboard/assets/{index-CIiBu9mr.js → index-DzjauX3N.js} +1 -1
- package/static/dashboard/assets/{index-CFIenkeK.js → index-cIa8_efI.js} +1 -1
- package/static/dashboard/assets/{key-round-B5ccp6nx.js → key-round-BoS6UqKz.js} +1 -1
- package/static/dashboard/assets/{rotate-ccw-DUpfkNnk.js → rotate-ccw-BeWV76i0.js} +1 -1
- package/static/dashboard/assets/{skeleton-BRe19fO0.js → skeleton-CypcJL07.js} +1 -1
- package/static/dashboard/assets/{waypoints-BKDMxEvu.js → waypoints-zHOOqfhi.js} +1 -1
- package/static/dashboard/assets/{workspace-layout-ZTF7C16h.js → workspace-layout-DZ9JuxnM.js} +1 -1
- package/static/dashboard/dashboard.html +2 -2
- package/static/settings/assets/{AiConfigContext-DsyWgu2i.js → AiConfigContext-D3b1l_Kw.js} +1 -1
- package/static/settings/assets/{AiConfigPage-CSCBckKo.js → AiConfigPage-DYKw-atP.js} +1 -1
- package/static/settings/assets/{DocumentProcessingPanel-w9yQDbBe.js → DocumentProcessingPanel-DguRfsIV.js} +1 -1
- package/static/settings/assets/{IndexLifecyclePanel-CUUXI8mP.js → IndexLifecyclePanel-B85qJJA4.js} +1 -1
- package/static/settings/assets/{IndexSubjectPanel-BypAU5TJ.js → IndexSubjectPanel-CsN7IxaV.js} +1 -1
- package/static/settings/assets/{ModelAssignmentsPanel-BetgXw1G.js → ModelAssignmentsPanel-DEp9byI6.js} +1 -1
- package/static/settings/assets/{ModelsPage-DZpTlTZ3.js → ModelsPage-CzTnPs_G.js} +3 -3
- package/static/settings/assets/NetworkPage-BDVnmUU0.js +2 -0
- package/static/settings/assets/{PaneListHeader-BGOqGec4.js → PaneListHeader-Cpe39N76.js} +1 -1
- package/static/settings/assets/{SearchIndexingPanel-DYAbpZ_9.js → SearchIndexingPanel-DA9w8lLL.js} +1 -1
- package/static/settings/assets/{StatusSubjectPanel-CFgzeQ8Q.js → StatusSubjectPanel-BU0Aq0CS.js} +1 -1
- package/static/settings/assets/{StatusWorkspace-4Z6g4Jvv.js → StatusWorkspace-D1AC1i5N.js} +1 -1
- package/static/settings/assets/{SystemSettingsPage-C1tlrgvI.js → SystemSettingsPage-ChKvOioO.js} +1 -1
- package/static/settings/assets/{SystemSettingsSubjectPanel-CcURI-1L.js → SystemSettingsSubjectPanel-DyTpOnD2.js} +1 -1
- package/static/settings/assets/{XpodAiConnectionsPodStore-owBQc5nY.js → XpodAiConnectionsPodStore-VU5Bsz1a.js} +1 -1
- package/static/settings/assets/{activity-CtBc9cNy.js → activity-DGpLfsQB.js} +1 -1
- package/static/settings/assets/ai-connections-DexTPyfC.js +1 -0
- package/static/settings/assets/{badge--r-FDIhU.js → badge-_hCrrWRP.js} +1 -1
- package/static/settings/assets/{collection-runtime-CnhPmwAM.js → collection-runtime-E40TZ8Cl.js} +1 -1
- package/static/settings/assets/{dialog-B7ZRsjN7.js → dialog-DTr2JkHn.js} +1 -1
- package/static/settings/assets/{download-DgQ1F8QR.js → download-B_D21DDX.js} +1 -1
- package/static/settings/assets/{external-link-Bz7NckNO.js → external-link-BATYaM13.js} +1 -1
- package/static/settings/assets/index-BAlAVi-J.js +4 -0
- package/static/settings/assets/{index-CkGda_Pg.js → index-Ckh4h9jj.js} +1 -1
- package/static/settings/assets/{index-Vv-8Vslg.js → index-DOiwLF4B.js} +1 -1
- package/static/settings/assets/{index-browser-Dq7omlpY.js → index-browser-DFFWN3Kr.js} +1 -1
- package/static/settings/assets/{key-round-CvuhloKV.js → key-round-ZTVU_1O1.js} +1 -1
- package/static/settings/assets/{rotate-ccw-DgFKDaz7.js → rotate-ccw-DDdw8PTU.js} +1 -1
- package/static/settings/assets/{settings-BvqY7K96.js → settings-CyLnISOv.js} +62 -62
- package/static/settings/assets/settings-rk080mvG.css +1 -0
- package/static/settings/assets/{skeleton-D3OeFDF6.js → skeleton-DEzA3hc2.js} +1 -1
- package/static/settings/assets/{waypoints-C4WbspTb.js → waypoints-BSdfNvEb.js} +1 -1
- package/static/settings/assets/{workspace-layout-B9H1Tqrk.js → workspace-layout-BOQnl_3d.js} +1 -1
- package/static/settings/settings.html +2 -2
- package/dist/api/ai-gateway/pod/HostedPodDataAccess.d.ts +0 -31
- package/dist/api/ai-gateway/pod/HostedPodDataAccess.js +0 -330
- package/dist/http/InternalPodDataHttpHandler.d.ts +0 -57
- package/dist/http/InternalPodDataHttpHandler.js +0 -551
- package/dist/http/InternalPodDataHttpHandler.jsonld +0 -243
- package/node_modules/@undefineds.co/ai-connections-core/package.json +0 -61
- package/static/auth-callback/assets/NetworkPage-cEvxRMAl.js +0 -2
- package/static/auth-callback/assets/ai-connections-C6yaE6WQ.js +0 -1
- package/static/auth-callback/assets/auth-callback-Cx9D_1qj.css +0 -1
- package/static/auth-callback/assets/index-Cu0EguPo.js +0 -4
- package/static/dashboard/assets/NetworkPage-Ot4G2dX5.js +0 -2
- package/static/dashboard/assets/ai-connections-CXp5gd1J.js +0 -1
- package/static/dashboard/assets/dashboard-Cx9D_1qj.css +0 -1
- package/static/dashboard/assets/index-Gp3cLolR.js +0 -4
- package/static/settings/assets/NetworkPage-BVkasFGM.js +0 -2
- package/static/settings/assets/ai-connections-C6yaE6WQ.js +0 -1
- package/static/settings/assets/index-BdXwm8nh.js +0 -4
- package/static/settings/assets/settings-Cx9D_1qj.css +0 -1
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/normalize.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/normalize.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/request.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/request.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/types.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/types.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/base-adapter.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/base-adapter.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/codex.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/codex.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/index.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/index.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/json-env-adapter.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/json-env-adapter.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/pi.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/pi.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/transaction.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/transaction.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/types.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/types.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/credential-storage.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/credential-storage.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/endpoint-urls.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/endpoint-urls.js +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/provider-catalog.d.ts +0 -0
- /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/provider-catalog.js +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NgrokTunnelProvider = void 0;
|
|
4
|
+
exports.isLocalAgentUrl = isLocalAgentUrl;
|
|
4
5
|
const node_child_process_1 = require("node:child_process");
|
|
5
6
|
const global_logger_factory_1 = require("global-logger-factory");
|
|
7
|
+
const TunnelLifecycle_1 = require("./TunnelLifecycle");
|
|
6
8
|
/**
|
|
7
9
|
* Starts a user-owned ngrok agent for Local SP access.
|
|
8
10
|
*
|
|
@@ -37,6 +39,7 @@ class NgrokTunnelProvider {
|
|
|
37
39
|
endpoint: normalizeEndpointForConfig(this.configuredUrl) ?? '',
|
|
38
40
|
originUrl,
|
|
39
41
|
};
|
|
42
|
+
this.expectedLocalOrigin = originUrl;
|
|
40
43
|
this.currentConfig = config;
|
|
41
44
|
return config;
|
|
42
45
|
}
|
|
@@ -59,11 +62,9 @@ class NgrokTunnelProvider {
|
|
|
59
62
|
args.push('--url', endpointForCli);
|
|
60
63
|
}
|
|
61
64
|
args.push(actualConfig.originUrl);
|
|
62
|
-
this.status = {
|
|
63
|
-
running: true,
|
|
64
|
-
connected: false,
|
|
65
|
+
this.status = (0, TunnelLifecycle_1.createTunnelStatus)('process-started', {
|
|
65
66
|
endpoint: normalizeEndpointForConfig(endpointForCli),
|
|
66
|
-
};
|
|
67
|
+
});
|
|
67
68
|
this.currentConfig = {
|
|
68
69
|
...actualConfig,
|
|
69
70
|
endpoint: this.status.endpoint ?? actualConfig.endpoint,
|
|
@@ -81,23 +82,20 @@ class NgrokTunnelProvider {
|
|
|
81
82
|
this.process.stderr?.on('data', (data) => this.handleOutput(data.toString()));
|
|
82
83
|
this.process.on('exit', (code) => {
|
|
83
84
|
this.logger.info(`ngrok exited with code ${code}`);
|
|
84
|
-
this.status = {
|
|
85
|
-
running: false,
|
|
86
|
-
connected: false,
|
|
85
|
+
this.status = (0, TunnelLifecycle_1.createTunnelStatus)('failed', {
|
|
87
86
|
endpoint: this.status.endpoint,
|
|
88
|
-
error: this.status.error ?? (code === 0 ?
|
|
89
|
-
};
|
|
87
|
+
error: this.status.error ?? (code === 0 ? 'ngrok-exited' : `ngrok exited with code ${code}`),
|
|
88
|
+
});
|
|
90
89
|
this.process = null;
|
|
91
90
|
this.managedByUs = false;
|
|
92
91
|
});
|
|
93
92
|
this.process.on('error', (error) => {
|
|
94
|
-
|
|
95
|
-
this.
|
|
96
|
-
|
|
97
|
-
connected: false,
|
|
93
|
+
const described = (0, TunnelLifecycle_1.describeSpawnError)('ngrok', this.ngrokPath, error);
|
|
94
|
+
this.logger.error(`Failed to start ngrok: ${described}`);
|
|
95
|
+
this.status = (0, TunnelLifecycle_1.createTunnelStatus)('failed', {
|
|
98
96
|
endpoint: this.status.endpoint,
|
|
99
|
-
error:
|
|
100
|
-
};
|
|
97
|
+
error: described,
|
|
98
|
+
});
|
|
101
99
|
this.process = null;
|
|
102
100
|
this.managedByUs = false;
|
|
103
101
|
});
|
|
@@ -105,7 +103,8 @@ class NgrokTunnelProvider {
|
|
|
105
103
|
}
|
|
106
104
|
async stop() {
|
|
107
105
|
if (!this.managedByUs) {
|
|
108
|
-
|
|
106
|
+
// Keep the last error: stopping must not turn a failed tunnel into a clean one.
|
|
107
|
+
this.status = (0, TunnelLifecycle_1.createTunnelStatus)('stopped', { endpoint: this.status.endpoint, error: this.status.error });
|
|
109
108
|
return;
|
|
110
109
|
}
|
|
111
110
|
if (this.process) {
|
|
@@ -122,7 +121,7 @@ class NgrokTunnelProvider {
|
|
|
122
121
|
});
|
|
123
122
|
this.process = null;
|
|
124
123
|
}
|
|
125
|
-
this.status =
|
|
124
|
+
this.status = (0, TunnelLifecycle_1.createTunnelStatus)('stopped', { endpoint: this.status.endpoint, error: this.status.error });
|
|
126
125
|
this.managedByUs = false;
|
|
127
126
|
}
|
|
128
127
|
getStatus() {
|
|
@@ -158,17 +157,36 @@ class NgrokTunnelProvider {
|
|
|
158
157
|
}
|
|
159
158
|
}
|
|
160
159
|
markConnected(endpoint) {
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
// Readiness requires a process we still own: without one, any endpoint we just learned
|
|
161
|
+
// about (for example from the machine-wide agent API) belongs to someone else.
|
|
162
|
+
if (!this.process || !this.managedByUs) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const discovered = normalizeEndpointForConfig(endpoint);
|
|
166
|
+
const declared = normalizeEndpointForConfig(this.configuredUrl);
|
|
167
|
+
// A discovered entry has to be a real public endpoint: the local agent's own web
|
|
168
|
+
// interface is not one, and accepting it made a tunnel that published nothing look up.
|
|
169
|
+
if (!declared && (!discovered || isLocalAgentUrl(discovered))) {
|
|
163
170
|
return;
|
|
164
171
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
172
|
+
const effective = declared ?? discovered;
|
|
173
|
+
if (!effective) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (declared && discovered && normalizeOrigin(declared) !== normalizeOrigin(discovered)) {
|
|
177
|
+
// The operator declared one entry and ngrok published another; report the declared
|
|
178
|
+
// one but leave the discrepancy in the log for whoever has to explain reachability.
|
|
179
|
+
this.logger.warn(`ngrok published ${discovered} while ${declared} is declared; keeping the declared entry`);
|
|
180
|
+
}
|
|
181
|
+
this.status = (0, TunnelLifecycle_1.createTunnelStatus)('proxy-ready', {
|
|
182
|
+
endpoint: effective,
|
|
183
|
+
lastHeartbeat: new Date(),
|
|
184
|
+
error: this.status.error,
|
|
185
|
+
});
|
|
168
186
|
this.currentConfig = {
|
|
169
|
-
...(this.currentConfig ?? { subdomain: 'local', provider: 'ngrok', endpoint:
|
|
187
|
+
...(this.currentConfig ?? { subdomain: 'local', provider: 'ngrok', endpoint: effective }),
|
|
170
188
|
provider: 'ngrok',
|
|
171
|
-
endpoint:
|
|
189
|
+
endpoint: effective,
|
|
172
190
|
};
|
|
173
191
|
}
|
|
174
192
|
async waitForConnection() {
|
|
@@ -180,49 +198,71 @@ class NgrokTunnelProvider {
|
|
|
180
198
|
if (!this.status.running && this.status.error) {
|
|
181
199
|
throw new Error(`ngrok failed to start: ${this.status.error}`);
|
|
182
200
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
201
|
+
// The agent API is machine-wide: another instance's agent answers on the same port.
|
|
202
|
+
// Only consult it while this provider actually has a process, otherwise a provider
|
|
203
|
+
// that failed to start would adopt someone else's tunnel as its own.
|
|
204
|
+
if (this.process && this.managedByUs) {
|
|
205
|
+
const endpoint = await this.discoverEndpointFromAgentApi();
|
|
206
|
+
if (endpoint) {
|
|
207
|
+
this.markConnected(endpoint);
|
|
208
|
+
// Discovery may have been refused (foreign entry, no live process); only an
|
|
209
|
+
// actual readiness transition ends the wait.
|
|
210
|
+
if (this.status.connected) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
187
214
|
}
|
|
188
215
|
await new Promise((resolve) => setTimeout(resolve, Math.min(250, Math.max(25, this.connectTimeoutMs))));
|
|
189
216
|
}
|
|
190
217
|
if (!this.status.running && this.status.error) {
|
|
191
218
|
throw new Error(`ngrok failed to start: ${this.status.error}`);
|
|
192
219
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
220
|
+
// A timeout must not be reported as a running tunnel that merely lacks a heartbeat:
|
|
221
|
+
// the endpoint is recorded, but the stage says nothing is serving yet.
|
|
222
|
+
this.status = (0, TunnelLifecycle_1.createTunnelStatus)('failed', {
|
|
223
|
+
endpoint: this.status.endpoint,
|
|
224
|
+
error: this.status.error ?? 'ngrok-connect-timeout',
|
|
225
|
+
});
|
|
226
|
+
throw new Error(`ngrok connection timeout${this.status.endpoint ? ` for ${this.status.endpoint}` : ''}`);
|
|
199
227
|
}
|
|
200
228
|
async discoverEndpointFromAgentApi() {
|
|
201
229
|
const base = this.agentApiUrl.replace(/\/+$/u, '');
|
|
202
|
-
return await readNgrokAgentEndpoint(`${base}/api/tunnels
|
|
203
|
-
?? await readNgrokAgentEndpoint(`${base}/api/endpoints
|
|
230
|
+
return await readNgrokAgentEndpoint(`${base}/api/tunnels`, this.expectedLocalOrigin)
|
|
231
|
+
?? await readNgrokAgentEndpoint(`${base}/api/endpoints`, this.expectedLocalOrigin);
|
|
204
232
|
}
|
|
205
233
|
}
|
|
206
234
|
exports.NgrokTunnelProvider = NgrokTunnelProvider;
|
|
207
|
-
|
|
235
|
+
/** Loopback endpoints belong to the agent itself, never to a published tunnel. */
|
|
236
|
+
function isLocalAgentUrl(url) {
|
|
237
|
+
try {
|
|
238
|
+
const { hostname } = new URL(url);
|
|
239
|
+
const normalized = hostname.replace(/^\[/u, '').replace(/\]$/u, '').toLowerCase();
|
|
240
|
+
return normalized === 'localhost' || normalized === '::1' || normalized.startsWith('127.');
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
async function readNgrokAgentEndpoint(url, expectedLocalOrigin) {
|
|
208
247
|
try {
|
|
209
248
|
const response = await fetch(url);
|
|
210
249
|
if (!response.ok) {
|
|
211
250
|
return undefined;
|
|
212
251
|
}
|
|
213
252
|
const body = await response.json();
|
|
214
|
-
return extractEndpointFromAgentBody(body);
|
|
253
|
+
return extractEndpointFromAgentBody(body, expectedLocalOrigin);
|
|
215
254
|
}
|
|
216
255
|
catch {
|
|
217
256
|
return undefined;
|
|
218
257
|
}
|
|
219
258
|
}
|
|
220
|
-
function extractEndpointFromAgentBody(body) {
|
|
259
|
+
function extractEndpointFromAgentBody(body, expectedLocalOrigin) {
|
|
221
260
|
if (!body || typeof body !== 'object') {
|
|
222
261
|
return undefined;
|
|
223
262
|
}
|
|
224
263
|
const record = body;
|
|
225
264
|
const lists = [record.tunnels, record.endpoints].filter(Array.isArray);
|
|
265
|
+
const candidates = [];
|
|
226
266
|
for (const list of lists) {
|
|
227
267
|
for (const item of list) {
|
|
228
268
|
if (!item || typeof item !== 'object') {
|
|
@@ -232,12 +272,44 @@ function extractEndpointFromAgentBody(body) {
|
|
|
232
272
|
const publicUrl = typeof value.public_url === 'string' ? value.public_url : undefined;
|
|
233
273
|
const url = typeof value.url === 'string' ? value.url : undefined;
|
|
234
274
|
const endpoint = normalizeEndpointForConfig(publicUrl ?? url);
|
|
235
|
-
if (endpoint?.startsWith('https://')) {
|
|
236
|
-
|
|
275
|
+
if (!endpoint?.startsWith('https://') || isLocalAgentUrl(endpoint)) {
|
|
276
|
+
continue;
|
|
237
277
|
}
|
|
278
|
+
const config = value.config;
|
|
279
|
+
const address = config && typeof config === 'object'
|
|
280
|
+
? config.addr
|
|
281
|
+
: undefined;
|
|
282
|
+
candidates.push({ endpoint, ...(typeof address === 'string' ? { address } : {}) });
|
|
238
283
|
}
|
|
239
284
|
}
|
|
240
|
-
|
|
285
|
+
if (candidates.length === 0) {
|
|
286
|
+
return undefined;
|
|
287
|
+
}
|
|
288
|
+
if (!expectedLocalOrigin) {
|
|
289
|
+
return candidates[0].endpoint;
|
|
290
|
+
}
|
|
291
|
+
// An entry exposing our own origin is ours. When the agent reports no address at all we
|
|
292
|
+
// can only accept it if there is exactly one candidate, otherwise ownership is a guess.
|
|
293
|
+
const matched = candidates.find((candidate) => candidate.address
|
|
294
|
+
&& normalizeOrigin(candidate.address) === normalizeOrigin(expectedLocalOrigin));
|
|
295
|
+
if (matched) {
|
|
296
|
+
return matched.endpoint;
|
|
297
|
+
}
|
|
298
|
+
return candidates.length === 1 && !candidates[0].address ? candidates[0].endpoint : undefined;
|
|
299
|
+
}
|
|
300
|
+
function normalizeOrigin(value) {
|
|
301
|
+
try {
|
|
302
|
+
const url = new URL(value);
|
|
303
|
+
const hostname = url.hostname.replace(/^\[/u, '').replace(/\]$/u, '').toLowerCase();
|
|
304
|
+
// `localhost`, `::1` and `127.x` are the same machine; agents spell them differently.
|
|
305
|
+
const host = hostname === 'localhost' || hostname === '::1' || hostname.startsWith('127.')
|
|
306
|
+
? '127.0.0.1'
|
|
307
|
+
: hostname;
|
|
308
|
+
return `${url.protocol}//${host}:${url.port || (url.protocol === 'https:' ? '443' : '80')}`;
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
return value.trim().replace(/\/+$/u, '');
|
|
312
|
+
}
|
|
241
313
|
}
|
|
242
314
|
function extractEndpoint(output) {
|
|
243
315
|
try {
|
|
@@ -261,10 +333,12 @@ function extractEndpointFromText(value) {
|
|
|
261
333
|
}
|
|
262
334
|
function isConnectionLine(output) {
|
|
263
335
|
const lower = output.toLowerCase();
|
|
336
|
+
// A bare "started" is not evidence that a tunnel exists: the agent logs it for its own
|
|
337
|
+
// web interface as well.
|
|
264
338
|
return lower.includes('started tunnel')
|
|
265
339
|
|| lower.includes('tunnel started')
|
|
266
340
|
|| lower.includes('client session established')
|
|
267
|
-
|| lower.includes('started');
|
|
341
|
+
|| lower.includes('started tunnel session');
|
|
268
342
|
}
|
|
269
343
|
function extractError(output) {
|
|
270
344
|
try {
|
|
@@ -124,6 +124,10 @@
|
|
|
124
124
|
"@id": "undefineds:dist/tunnel/NgrokTunnelProvider.jsonld#NgrokTunnelProvider__member_managedByUs",
|
|
125
125
|
"memberFieldName": "managedByUs"
|
|
126
126
|
},
|
|
127
|
+
{
|
|
128
|
+
"@id": "undefineds:dist/tunnel/NgrokTunnelProvider.jsonld#NgrokTunnelProvider__member_expectedLocalOrigin",
|
|
129
|
+
"memberFieldName": "expectedLocalOrigin"
|
|
130
|
+
},
|
|
127
131
|
{
|
|
128
132
|
"@id": "undefineds:dist/tunnel/NgrokTunnelProvider.jsonld#NgrokTunnelProvider__member_constructor",
|
|
129
133
|
"memberFieldName": "constructor"
|
|
@@ -4,21 +4,30 @@
|
|
|
4
4
|
* 使用 SakuraFRP 提供隧道服务
|
|
5
5
|
* 用于没有公网 IP 的 Local 节点
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* 凭据就是控制台「配置文件」里那串启动参数 (`<访问密钥>:<隧道ID>`)。公网入口
|
|
8
|
+
* **不由用户声明**:控制台只让用户选节点和本地端口,访问地址是平台分配的,因此
|
|
9
|
+
* provider 用同一个凭据向 SakuraFrp 开放 API 查询分配结果(节点地址 + 远程端口),
|
|
10
|
+
* 声明字段只作为 API 不可用时的可选兜底。
|
|
8
11
|
*/
|
|
9
12
|
import type { TunnelProvider, TunnelConfig, TunnelSetupOptions, TunnelStatus } from './TunnelProvider';
|
|
10
13
|
/**
|
|
11
14
|
* SakuraFRP Tunnel Provider 配置
|
|
12
15
|
*/
|
|
13
16
|
export interface SakuraFrpTunnelProviderOptions {
|
|
14
|
-
/** SakuraFRP
|
|
17
|
+
/** SakuraFRP 启动参数 (`<访问密钥>:<隧道ID>[,<隧道ID>...]`),来自 SAKURA_TUNNEL_TOKEN */
|
|
15
18
|
token: string;
|
|
16
|
-
/**
|
|
19
|
+
/** Optional declared endpoint, used only when the provider cannot be asked. */
|
|
17
20
|
publicUrl?: string;
|
|
18
21
|
/** frpc 可执行文件路径 (默认 'frpc') */
|
|
19
22
|
frpcPath?: string;
|
|
23
|
+
/** 等待代理发布的毫秒数;超时后状态为 failed */
|
|
24
|
+
connectTimeoutMs?: number;
|
|
20
25
|
/** SakuraFRP 服务端地址 (如果需要自定义) */
|
|
21
26
|
serverAddr?: string;
|
|
27
|
+
/** SakuraFrp open API base, where the assigned public entry can be read back. */
|
|
28
|
+
apiBaseUrl?: string;
|
|
29
|
+
/** Injection point for tests; defaults to the global fetch. */
|
|
30
|
+
fetchImpl?: typeof fetch;
|
|
22
31
|
}
|
|
23
32
|
/**
|
|
24
33
|
* SakuraFRP Tunnel Provider
|
|
@@ -31,12 +40,49 @@ export declare class SakuraFrpTunnelProvider implements TunnelProvider {
|
|
|
31
40
|
private readonly token;
|
|
32
41
|
private readonly publicUrl?;
|
|
33
42
|
private readonly frpcPath;
|
|
43
|
+
private readonly connectTimeoutMs;
|
|
34
44
|
private readonly serverAddr?;
|
|
45
|
+
private readonly apiBaseUrl;
|
|
46
|
+
private readonly fetchImpl;
|
|
47
|
+
/** Endpoint the platform assigned, once discovery has answered. */
|
|
48
|
+
private discoveredEndpoint?;
|
|
49
|
+
/** Credential actually handed to frpc, completed from the platform answer when needed. */
|
|
50
|
+
private clientCredential?;
|
|
51
|
+
/** Why no browser-facing entry can be claimed, when the platform refuses plain HTTP. */
|
|
52
|
+
private discoveryBlockedReason?;
|
|
53
|
+
/** Whether the platform terminates TLS for this entry (auto HTTPS). */
|
|
54
|
+
private autoHttpsEnabled;
|
|
55
|
+
/** Entry the client itself printed, used when the platform API cannot name one. */
|
|
56
|
+
private logEndpoint?;
|
|
35
57
|
private process;
|
|
36
58
|
private status;
|
|
37
59
|
private currentConfig;
|
|
38
60
|
private managedByUs;
|
|
39
61
|
constructor(options: SakuraFrpTunnelProviderOptions);
|
|
62
|
+
/**
|
|
63
|
+
* Reads back the entry the platform assigned to this tunnel.
|
|
64
|
+
*
|
|
65
|
+
* The console never asks for a domain: for a TCP tunnel it assigns a node host and a
|
|
66
|
+
* remote port, and for a bound tunnel it assigns the domain itself. Asking the provider
|
|
67
|
+
* is therefore the only honest way to learn the entry, and a failure to ask changes
|
|
68
|
+
* nothing except that the status stops short of naming an endpoint.
|
|
69
|
+
*/
|
|
70
|
+
private discoverEndpoint;
|
|
71
|
+
/**
|
|
72
|
+
* Builds the parameter frpc needs, completing a bare access key with the tunnel it owns.
|
|
73
|
+
*
|
|
74
|
+
* `-f` accepts `<访问密钥>:<隧道ID>`; an operator who pasted only the access key would
|
|
75
|
+
* otherwise get `Bad fetch parameter` even though discovery can read the tunnel with that
|
|
76
|
+
* same key. Completion is only safe when the answer is unambiguous.
|
|
77
|
+
*/
|
|
78
|
+
private resolveClientCredential;
|
|
79
|
+
private resolveNodeHost;
|
|
80
|
+
private fetchJson;
|
|
81
|
+
/**
|
|
82
|
+
* The endpoint to report: what the platform assigned, else what the client printed, else
|
|
83
|
+
* what was declared. Nothing is invented when no source names an entry.
|
|
84
|
+
*/
|
|
85
|
+
private currentEndpoint;
|
|
40
86
|
/**
|
|
41
87
|
* Setup: 解析 Token 获取配置
|
|
42
88
|
*/
|
|
@@ -60,3 +106,19 @@ export declare class SakuraFrpTunnelProvider implements TunnelProvider {
|
|
|
60
106
|
private waitForConnection;
|
|
61
107
|
isManagedByUs(): boolean;
|
|
62
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* The local port the SakuraFrp console told the tunnel to forward to.
|
|
111
|
+
*
|
|
112
|
+
* The console already owns this fact, and the provider reads the same API for the public
|
|
113
|
+
* entry, so the runtime must take the port from there instead of asking the operator to type
|
|
114
|
+
* it a second time.
|
|
115
|
+
*/
|
|
116
|
+
export declare function resolveSakuraAssignedLocalPort(token: string | undefined, options?: {
|
|
117
|
+
apiBaseUrl?: string;
|
|
118
|
+
fetchImpl?: typeof fetch;
|
|
119
|
+
}): Promise<number | undefined>;
|
|
120
|
+
/** Splits the console's startup parameter into the access key and the tunnel ids. */
|
|
121
|
+
export declare function parseSakuraCredential(value: string | undefined): {
|
|
122
|
+
accessKey?: string;
|
|
123
|
+
tunnelIds: string[];
|
|
124
|
+
};
|