@undefineds.co/xpod 0.3.57 → 0.3.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (779) hide show
  1. package/README.md +3 -0
  2. package/config/cli.json +88 -0
  3. package/config/cloud.json +32 -1
  4. package/config/components-ignore.json +3 -0
  5. package/config/extensions.local.initializer.json +44 -0
  6. package/config/resolver.json +86 -0
  7. package/config/xpod.base.json +4 -0
  8. package/dist/agents/AgentExecutorFactory.d.ts +3 -3
  9. package/dist/agents/AgentExecutorFactory.js +28 -15
  10. package/dist/agents/AgentExecutorFactory.js.map +1 -1
  11. package/dist/agents/BaseAgentExecutor.d.ts +2 -1
  12. package/dist/agents/BaseAgentExecutor.js +1 -0
  13. package/dist/agents/BaseAgentExecutor.js.map +1 -1
  14. package/dist/agents/ClaudeExecutor.d.ts +3 -1
  15. package/dist/agents/ClaudeExecutor.js +18 -12
  16. package/dist/agents/ClaudeExecutor.js.map +1 -1
  17. package/dist/agents/config/resolve.js +0 -21
  18. package/dist/agents/config/resolve.js.map +1 -1
  19. package/dist/agents/config/types.d.ts +2 -7
  20. package/dist/agents/config/types.js +2 -1
  21. package/dist/agents/config/types.js.map +1 -1
  22. package/dist/agents/types.d.ts +18 -0
  23. package/dist/agents/types.js.map +1 -1
  24. package/dist/ai/schema/types.d.ts +2 -1
  25. package/dist/ai/schema/types.js +1 -0
  26. package/dist/ai/schema/types.js.map +1 -1
  27. package/dist/ai/service/CredentialReader.d.ts +3 -1
  28. package/dist/ai/service/CredentialReader.js.map +1 -1
  29. package/dist/ai/service/CredentialReaderImpl.d.ts +3 -1
  30. package/dist/ai/service/CredentialReaderImpl.js +24 -2
  31. package/dist/ai/service/CredentialReaderImpl.js.map +1 -1
  32. package/dist/ai/service/EmbeddingServiceImpl.js +13 -2
  33. package/dist/ai/service/EmbeddingServiceImpl.js.map +1 -1
  34. package/dist/ai/service/ProviderRegistry.d.ts +4 -0
  35. package/dist/ai/service/ProviderRegistry.js.map +1 -1
  36. package/dist/ai/service/ProviderRegistry.jsonld +4 -0
  37. package/dist/ai/service/ProviderRegistryImpl.d.ts +4 -1
  38. package/dist/ai/service/ProviderRegistryImpl.js +26 -4
  39. package/dist/ai/service/ProviderRegistryImpl.js.map +1 -1
  40. package/dist/ai/service/ProviderRegistryImpl.jsonld +12 -0
  41. package/dist/ai/service/defaultEmbeddingProfile.d.ts +5 -0
  42. package/dist/ai/service/defaultEmbeddingProfile.js +31 -0
  43. package/dist/ai/service/defaultEmbeddingProfile.js.map +1 -0
  44. package/dist/ai/service/index.d.ts +1 -0
  45. package/dist/ai/service/index.js +1 -0
  46. package/dist/ai/service/index.js.map +1 -1
  47. package/dist/ai/service/types.d.ts +1 -0
  48. package/dist/ai/service/types.js.map +1 -1
  49. package/dist/api/ApiServer.js +17 -2
  50. package/dist/api/ApiServer.js.map +1 -1
  51. package/dist/api/ai-gateway/AiGatewayService.d.ts +106 -0
  52. package/dist/api/ai-gateway/AiGatewayService.js +527 -0
  53. package/dist/api/ai-gateway/AiGatewayService.js.map +1 -0
  54. package/dist/api/ai-gateway/auth/AiConnectionInvocationKeyIssuer.d.ts +38 -0
  55. package/dist/api/ai-gateway/auth/AiConnectionInvocationKeyIssuer.js +128 -0
  56. package/dist/api/ai-gateway/auth/AiConnectionInvocationKeyIssuer.js.map +1 -0
  57. package/dist/api/ai-gateway/auth/ClientCredentialsInternalPodAccessTokenProvider.d.ts +25 -0
  58. package/dist/api/ai-gateway/auth/ClientCredentialsInternalPodAccessTokenProvider.js +91 -0
  59. package/dist/api/ai-gateway/auth/ClientCredentialsInternalPodAccessTokenProvider.js.map +1 -0
  60. package/dist/api/ai-gateway/auth/GatewayApiKey.d.ts +28 -0
  61. package/dist/api/ai-gateway/auth/GatewayApiKey.js +162 -0
  62. package/dist/api/ai-gateway/auth/GatewayApiKey.js.map +1 -0
  63. package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.d.ts +56 -0
  64. package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.js +143 -0
  65. package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.js.map +1 -0
  66. package/dist/api/ai-gateway/auth/GatewayKeyLocatorCodec.d.ts +26 -0
  67. package/dist/api/ai-gateway/auth/GatewayKeyLocatorCodec.js +97 -0
  68. package/dist/api/ai-gateway/auth/GatewayKeyLocatorCodec.js.map +1 -0
  69. package/dist/api/ai-gateway/auth/GatewayPrincipal.d.ts +20 -0
  70. package/dist/api/ai-gateway/auth/GatewayPrincipal.js +37 -0
  71. package/dist/api/ai-gateway/auth/GatewayPrincipal.js.map +1 -0
  72. package/dist/api/ai-gateway/auth/InvocationTokenCodec.d.ts +41 -0
  73. package/dist/api/ai-gateway/auth/InvocationTokenCodec.js +221 -0
  74. package/dist/api/ai-gateway/auth/InvocationTokenCodec.js.map +1 -0
  75. package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.d.ts +54 -0
  76. package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.js +152 -0
  77. package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.js.map +1 -0
  78. package/dist/api/ai-gateway/connect/index.d.ts +367 -0
  79. package/dist/api/ai-gateway/connect/index.js +1061 -0
  80. package/dist/api/ai-gateway/connect/index.js.map +1 -0
  81. package/dist/api/ai-gateway/credentials/CloudKmsWrapper.d.ts +40 -0
  82. package/dist/api/ai-gateway/credentials/CloudKmsWrapper.js +59 -0
  83. package/dist/api/ai-gateway/credentials/CloudKmsWrapper.js.map +1 -0
  84. package/dist/api/ai-gateway/credentials/CredentialVault.d.ts +14 -0
  85. package/dist/api/ai-gateway/credentials/CredentialVault.js +11 -0
  86. package/dist/api/ai-gateway/credentials/CredentialVault.js.map +1 -0
  87. package/dist/api/ai-gateway/credentials/KeyWrapper.d.ts +27 -0
  88. package/dist/api/ai-gateway/credentials/KeyWrapper.js +3 -0
  89. package/dist/api/ai-gateway/credentials/KeyWrapper.js.map +1 -0
  90. package/dist/api/ai-gateway/credentials/LocalKeychainWrapper.d.ts +27 -0
  91. package/dist/api/ai-gateway/credentials/LocalKeychainWrapper.js +145 -0
  92. package/dist/api/ai-gateway/credentials/LocalKeychainWrapper.js.map +1 -0
  93. package/dist/api/ai-gateway/credentials/SecretCellCredentialVault.d.ts +13 -0
  94. package/dist/api/ai-gateway/credentials/SecretCellCredentialVault.js +133 -0
  95. package/dist/api/ai-gateway/credentials/SecretCellCredentialVault.js.map +1 -0
  96. package/dist/api/ai-gateway/credentials/SecretCellKeyWrapper.d.ts +23 -0
  97. package/dist/api/ai-gateway/credentials/SecretCellKeyWrapper.js +62 -0
  98. package/dist/api/ai-gateway/credentials/SecretCellKeyWrapper.js.map +1 -0
  99. package/dist/api/ai-gateway/credentials/WebCryptoCredentialVault.d.ts +23 -0
  100. package/dist/api/ai-gateway/credentials/WebCryptoCredentialVault.js +173 -0
  101. package/dist/api/ai-gateway/credentials/WebCryptoCredentialVault.js.map +1 -0
  102. package/dist/api/ai-gateway/errors.d.ts +21 -0
  103. package/dist/api/ai-gateway/errors.js +50 -0
  104. package/dist/api/ai-gateway/errors.js.map +1 -0
  105. package/dist/api/ai-gateway/protocol/ChatCompletionsFrontend.d.ts +6 -0
  106. package/dist/api/ai-gateway/protocol/ChatCompletionsFrontend.js +111 -0
  107. package/dist/api/ai-gateway/protocol/ChatCompletionsFrontend.js.map +1 -0
  108. package/dist/api/ai-gateway/protocol/MessagesFrontend.d.ts +6 -0
  109. package/dist/api/ai-gateway/protocol/MessagesFrontend.js +99 -0
  110. package/dist/api/ai-gateway/protocol/MessagesFrontend.js.map +1 -0
  111. package/dist/api/ai-gateway/protocol/ResponsesFrontend.d.ts +6 -0
  112. package/dist/api/ai-gateway/protocol/ResponsesFrontend.js +232 -0
  113. package/dist/api/ai-gateway/protocol/ResponsesFrontend.js.map +1 -0
  114. package/dist/api/ai-gateway/protocol/index.d.ts +3 -0
  115. package/dist/api/ai-gateway/protocol/index.js +10 -0
  116. package/dist/api/ai-gateway/protocol/index.js.map +1 -0
  117. package/dist/api/ai-gateway/providers/AnthropicRuntimeAdapter.d.ts +7 -0
  118. package/dist/api/ai-gateway/providers/AnthropicRuntimeAdapter.js +37 -0
  119. package/dist/api/ai-gateway/providers/AnthropicRuntimeAdapter.js.map +1 -0
  120. package/dist/api/ai-gateway/providers/BailianRuntimeAdapter.d.ts +9 -0
  121. package/dist/api/ai-gateway/providers/BailianRuntimeAdapter.js +127 -0
  122. package/dist/api/ai-gateway/providers/BailianRuntimeAdapter.js.map +1 -0
  123. package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.d.ts +8 -0
  124. package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.js +47 -0
  125. package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.js.map +1 -0
  126. package/dist/api/ai-gateway/providers/KimiRuntimeAdapter.d.ts +8 -0
  127. package/dist/api/ai-gateway/providers/KimiRuntimeAdapter.js +57 -0
  128. package/dist/api/ai-gateway/providers/KimiRuntimeAdapter.js.map +1 -0
  129. package/dist/api/ai-gateway/providers/OpenAiCompatibleRuntimeAdapter.d.ts +1 -0
  130. package/dist/api/ai-gateway/providers/OpenAiCompatibleRuntimeAdapter.js +6 -0
  131. package/dist/api/ai-gateway/providers/OpenAiCompatibleRuntimeAdapter.js.map +1 -0
  132. package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.d.ts +13 -0
  133. package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.js +34 -0
  134. package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.js.map +1 -0
  135. package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +68 -0
  136. package/dist/api/ai-gateway/providers/ProviderRegistry.js +288 -0
  137. package/dist/api/ai-gateway/providers/ProviderRegistry.js.map +1 -0
  138. package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.d.ts +88 -0
  139. package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.js +645 -0
  140. package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.js.map +1 -0
  141. package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.d.ts +13 -0
  142. package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +48 -0
  143. package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js.map +1 -0
  144. package/dist/api/ai-gateway/providers/index.d.ts +9 -0
  145. package/dist/api/ai-gateway/providers/index.js +26 -0
  146. package/dist/api/ai-gateway/providers/index.js.map +1 -0
  147. package/dist/api/ai-gateway/quota/AnthropicQuotaAdapter.d.ts +5 -0
  148. package/dist/api/ai-gateway/quota/AnthropicQuotaAdapter.js +21 -0
  149. package/dist/api/ai-gateway/quota/AnthropicQuotaAdapter.js.map +1 -0
  150. package/dist/api/ai-gateway/quota/BailianQuotaAdapter.d.ts +5 -0
  151. package/dist/api/ai-gateway/quota/BailianQuotaAdapter.js +21 -0
  152. package/dist/api/ai-gateway/quota/BailianQuotaAdapter.js.map +1 -0
  153. package/dist/api/ai-gateway/quota/DeepSeekQuotaAdapter.d.ts +10 -0
  154. package/dist/api/ai-gateway/quota/DeepSeekQuotaAdapter.js +83 -0
  155. package/dist/api/ai-gateway/quota/DeepSeekQuotaAdapter.js.map +1 -0
  156. package/dist/api/ai-gateway/quota/KimiQuotaAdapter.d.ts +10 -0
  157. package/dist/api/ai-gateway/quota/KimiQuotaAdapter.js +70 -0
  158. package/dist/api/ai-gateway/quota/KimiQuotaAdapter.js.map +1 -0
  159. package/dist/api/ai-gateway/quota/OpenAiQuotaAdapter.d.ts +5 -0
  160. package/dist/api/ai-gateway/quota/OpenAiQuotaAdapter.js +21 -0
  161. package/dist/api/ai-gateway/quota/OpenAiQuotaAdapter.js.map +1 -0
  162. package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.d.ts +214 -0
  163. package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.js +511 -0
  164. package/dist/api/ai-gateway/quota/ProviderQuotaAdapter.js.map +1 -0
  165. package/dist/api/ai-gateway/quota/index.d.ts +6 -0
  166. package/dist/api/ai-gateway/quota/index.js +23 -0
  167. package/dist/api/ai-gateway/quota/index.js.map +1 -0
  168. package/dist/api/ai-gateway/routing/InMemorySessionAffinityStore.d.ts +26 -0
  169. package/dist/api/ai-gateway/routing/InMemorySessionAffinityStore.js +67 -0
  170. package/dist/api/ai-gateway/routing/InMemorySessionAffinityStore.js.map +1 -0
  171. package/dist/api/ai-gateway/routing/ModelRouter.d.ts +84 -0
  172. package/dist/api/ai-gateway/routing/ModelRouter.js +274 -0
  173. package/dist/api/ai-gateway/routing/ModelRouter.js.map +1 -0
  174. package/dist/api/ai-gateway/routing/RedisSessionAffinityStore.d.ts +39 -0
  175. package/dist/api/ai-gateway/routing/RedisSessionAffinityStore.js +122 -0
  176. package/dist/api/ai-gateway/routing/RedisSessionAffinityStore.js.map +1 -0
  177. package/dist/api/ai-gateway/routing/SessionAffinityStore.d.ts +49 -0
  178. package/dist/api/ai-gateway/routing/SessionAffinityStore.js +66 -0
  179. package/dist/api/ai-gateway/routing/SessionAffinityStore.js.map +1 -0
  180. package/dist/api/ai-gateway/service-access/AiConnectionServiceAccess.d.ts +25 -0
  181. package/dist/api/ai-gateway/service-access/AiConnectionServiceAccess.js +50 -0
  182. package/dist/api/ai-gateway/service-access/AiConnectionServiceAccess.js.map +1 -0
  183. package/dist/api/ai-gateway/types.d.ts +112 -0
  184. package/dist/api/ai-gateway/types.js +305 -0
  185. package/dist/api/ai-gateway/types.js.map +1 -0
  186. package/dist/api/auth/AuthContext.d.ts +18 -3
  187. package/dist/api/auth/AuthContext.js +13 -2
  188. package/dist/api/auth/AuthContext.js.map +1 -1
  189. package/dist/api/auth/Authenticator.d.ts +3 -0
  190. package/dist/api/auth/Authenticator.js.map +1 -1
  191. package/dist/api/auth/ClientCredentialsAuthenticator.d.ts +2 -6
  192. package/dist/api/auth/ClientCredentialsAuthenticator.js +12 -30
  193. package/dist/api/auth/ClientCredentialsAuthenticator.js.map +1 -1
  194. package/dist/api/auth/SolidTokenAuthenticator.d.ts +2 -0
  195. package/dist/api/auth/SolidTokenAuthenticator.js +88 -2
  196. package/dist/api/auth/SolidTokenAuthenticator.js.map +1 -1
  197. package/dist/api/auth/TokenIdentity.d.ts +6 -0
  198. package/dist/api/auth/TokenIdentity.js +31 -0
  199. package/dist/api/auth/TokenIdentity.js.map +1 -0
  200. package/dist/api/chatkit/ai-provider.d.ts +9 -23
  201. package/dist/api/chatkit/ai-provider.js +30 -153
  202. package/dist/api/chatkit/ai-provider.js.map +1 -1
  203. package/dist/api/chatkit/default-agent.d.ts +24 -15
  204. package/dist/api/chatkit/default-agent.js +24 -83
  205. package/dist/api/chatkit/default-agent.js.map +1 -1
  206. package/dist/api/chatkit/index.d.ts +2 -1
  207. package/dist/api/chatkit/index.js +3 -1
  208. package/dist/api/chatkit/index.js.map +1 -1
  209. package/dist/api/chatkit/pod-store.d.ts +13 -1
  210. package/dist/api/chatkit/pod-store.js +127 -7
  211. package/dist/api/chatkit/pod-store.js.map +1 -1
  212. package/dist/api/chatkit/runtime/AcpAgentRuntime.d.ts +0 -1
  213. package/dist/api/chatkit/runtime/AcpAgentRuntime.js +14 -51
  214. package/dist/api/chatkit/runtime/AcpAgentRuntime.js.map +1 -1
  215. package/dist/api/chatkit/runtime/AcpRunner.js +2 -1
  216. package/dist/api/chatkit/runtime/AcpRunner.js.map +1 -1
  217. package/dist/api/chatkit/runtime/CodexRuntimeProjector.d.ts +15 -1
  218. package/dist/api/chatkit/runtime/CodexRuntimeProjector.js +52 -34
  219. package/dist/api/chatkit/runtime/CodexRuntimeProjector.js.map +1 -1
  220. package/dist/api/chatkit/service.d.ts +8 -1
  221. package/dist/api/chatkit/service.js +46 -5
  222. package/dist/api/chatkit/service.js.map +1 -1
  223. package/dist/api/chatkit/store.d.ts +23 -1
  224. package/dist/api/chatkit/store.js +56 -0
  225. package/dist/api/chatkit/store.js.map +1 -1
  226. package/dist/api/chatkit/types.d.ts +1 -0
  227. package/dist/api/chatkit/types.js.map +1 -1
  228. package/dist/api/container/common.js +286 -13
  229. package/dist/api/container/common.js.map +1 -1
  230. package/dist/api/container/index.js +126 -6
  231. package/dist/api/container/index.js.map +1 -1
  232. package/dist/api/container/local.js +50 -6
  233. package/dist/api/container/local.js.map +1 -1
  234. package/dist/api/container/rdf.d.ts +15 -0
  235. package/dist/api/container/rdf.js +90 -0
  236. package/dist/api/container/rdf.js.map +1 -0
  237. package/dist/api/container/routes.js +151 -11
  238. package/dist/api/container/routes.js.map +1 -1
  239. package/dist/api/container/types.d.ts +96 -0
  240. package/dist/api/container/types.js.map +1 -1
  241. package/dist/api/handlers/AdminHandler.d.ts +25 -2
  242. package/dist/api/handlers/AdminHandler.js +60 -10
  243. package/dist/api/handlers/AdminHandler.js.map +1 -1
  244. package/dist/api/handlers/AiClientConfigurationHandler.d.ts +7 -0
  245. package/dist/api/handlers/AiClientConfigurationHandler.js +202 -0
  246. package/dist/api/handlers/AiClientConfigurationHandler.js.map +1 -0
  247. package/dist/api/handlers/AiGatewayHandler.d.ts +23 -0
  248. package/dist/api/handlers/AiGatewayHandler.js +231 -0
  249. package/dist/api/handlers/AiGatewayHandler.js.map +1 -0
  250. package/dist/api/handlers/AiGatewayManagementHandler.d.ts +24 -0
  251. package/dist/api/handlers/AiGatewayManagementHandler.js +503 -0
  252. package/dist/api/handlers/AiGatewayManagementHandler.js.map +1 -0
  253. package/dist/api/handlers/ChatHandler.d.ts +11 -12
  254. package/dist/api/handlers/ChatHandler.js +12 -219
  255. package/dist/api/handlers/ChatHandler.js.map +1 -1
  256. package/dist/api/handlers/DashboardHandler.js +22 -116
  257. package/dist/api/handlers/DashboardHandler.js.map +1 -1
  258. package/dist/api/handlers/NetworkSettingsHandler.d.ts +97 -0
  259. package/dist/api/handlers/NetworkSettingsHandler.js +511 -0
  260. package/dist/api/handlers/NetworkSettingsHandler.js.map +1 -0
  261. package/dist/api/handlers/PodSettingsHandler.d.ts +79 -0
  262. package/dist/api/handlers/PodSettingsHandler.js +162 -0
  263. package/dist/api/handlers/PodSettingsHandler.js.map +1 -0
  264. package/dist/api/handlers/ProvisionHandler.d.ts +3 -1
  265. package/dist/api/handlers/ProvisionHandler.js +22 -87
  266. package/dist/api/handlers/ProvisionHandler.js.map +1 -1
  267. package/dist/api/handlers/RdfStatsHandler.d.ts +6 -0
  268. package/dist/api/handlers/RdfStatsHandler.js +85 -0
  269. package/dist/api/handlers/RdfStatsHandler.js.map +1 -0
  270. package/dist/api/handlers/SettingsHandler.d.ts +5 -0
  271. package/dist/api/handlers/SettingsHandler.js +13 -0
  272. package/dist/api/handlers/SettingsHandler.js.map +1 -0
  273. package/dist/api/handlers/StaticSpaHandler.d.ts +8 -0
  274. package/dist/api/handlers/StaticSpaHandler.js +102 -0
  275. package/dist/api/handlers/StaticSpaHandler.js.map +1 -0
  276. package/dist/api/handlers/index.d.ts +1 -0
  277. package/dist/api/handlers/index.js +1 -0
  278. package/dist/api/handlers/index.js.map +1 -1
  279. package/dist/api/http/readBoundedJsonBody.d.ts +14 -0
  280. package/dist/api/http/readBoundedJsonBody.js +58 -0
  281. package/dist/api/http/readBoundedJsonBody.js.map +1 -0
  282. package/dist/api/middleware/AuthMiddleware.d.ts +1 -0
  283. package/dist/api/middleware/AuthMiddleware.js +33 -4
  284. package/dist/api/middleware/AuthMiddleware.js.map +1 -1
  285. package/dist/api/runs/AgentRuntimeTypes.d.ts +18 -3
  286. package/dist/api/runs/AgentRuntimeTypes.js +61 -0
  287. package/dist/api/runs/AgentRuntimeTypes.js.map +1 -1
  288. package/dist/api/runs/InngestRunExecutionBackend.d.ts +28 -3
  289. package/dist/api/runs/InngestRunExecutionBackend.js +26 -3
  290. package/dist/api/runs/InngestRunExecutionBackend.js.map +1 -1
  291. package/dist/api/runs/ManagedRunWorker.d.ts +4 -1
  292. package/dist/api/runs/ManagedRunWorker.js +39 -8
  293. package/dist/api/runs/ManagedRunWorker.js.map +1 -1
  294. package/dist/api/runs/PiAgentRuntimeDriver.d.ts +5 -1
  295. package/dist/api/runs/PiAgentRuntimeDriver.js +94 -57
  296. package/dist/api/runs/PiAgentRuntimeDriver.js.map +1 -1
  297. package/dist/api/runs/RdfRunContextRetriever.d.ts +46 -0
  298. package/dist/api/runs/RdfRunContextRetriever.js +277 -0
  299. package/dist/api/runs/RdfRunContextRetriever.js.map +1 -0
  300. package/dist/api/runs/RunExecutionBackend.d.ts +38 -0
  301. package/dist/api/runs/RunExecutionBackend.js.map +1 -1
  302. package/dist/api/runs/RunStateCenter.d.ts +18 -3
  303. package/dist/api/runs/RunStateCenter.js +85 -24
  304. package/dist/api/runs/RunStateCenter.js.map +1 -1
  305. package/dist/api/runtime.js +163 -3
  306. package/dist/api/runtime.js.map +1 -1
  307. package/dist/api/service/AiClientConfigurationService.d.ts +97 -0
  308. package/dist/api/service/AiClientConfigurationService.js +379 -0
  309. package/dist/api/service/AiClientConfigurationService.js.map +1 -0
  310. package/dist/api/service/RdfBenchmarkReportCatalog.d.ts +86 -0
  311. package/dist/api/service/RdfBenchmarkReportCatalog.js +349 -0
  312. package/dist/api/service/RdfBenchmarkReportCatalog.js.map +1 -0
  313. package/dist/api/service/RdfBenchmarkReportGate.d.ts +78 -0
  314. package/dist/api/service/RdfBenchmarkReportGate.js +197 -0
  315. package/dist/api/service/RdfBenchmarkReportGate.js.map +1 -0
  316. package/dist/api/service/RdfSearchIndexingService.d.ts +113 -0
  317. package/dist/api/service/RdfSearchIndexingService.js +272 -0
  318. package/dist/api/service/RdfSearchIndexingService.js.map +1 -0
  319. package/dist/api/service/RdfSearchIndexingSolidFsSyncer.d.ts +27 -0
  320. package/dist/api/service/RdfSearchIndexingSolidFsSyncer.js +90 -0
  321. package/dist/api/service/RdfSearchIndexingSolidFsSyncer.js.map +1 -0
  322. package/dist/api/service/RdfStorageStatsService.d.ts +31 -0
  323. package/dist/api/service/RdfStorageStatsService.js +97 -0
  324. package/dist/api/service/RdfStorageStatsService.js.map +1 -0
  325. package/dist/api/service/VectorStoreService.d.ts +2 -0
  326. package/dist/api/service/VectorStoreService.js +70 -2
  327. package/dist/api/service/VectorStoreService.js.map +1 -1
  328. package/dist/api/service/VercelChatService.d.ts +27 -38
  329. package/dist/api/service/VercelChatService.js +153 -505
  330. package/dist/api/service/VercelChatService.js.map +1 -1
  331. package/dist/api/service/provider-http-transport.d.ts +21 -0
  332. package/dist/api/service/provider-http-transport.js +108 -2
  333. package/dist/api/service/provider-http-transport.js.map +1 -1
  334. package/dist/api/service/provider-registry.d.ts +5 -7
  335. package/dist/api/service/provider-registry.js +81 -64
  336. package/dist/api/service/provider-registry.js.map +1 -1
  337. package/dist/api/tasks/InngestTaskScheduler.d.ts +44 -4
  338. package/dist/api/tasks/TaskMaterializer.d.ts +10 -1
  339. package/dist/api/tasks/TaskMaterializer.js +39 -4
  340. package/dist/api/tasks/TaskMaterializer.js.map +1 -1
  341. package/dist/api/tasks/TaskService.d.ts +5 -1
  342. package/dist/api/tasks/TaskService.js +3 -0
  343. package/dist/api/tasks/TaskService.js.map +1 -1
  344. package/dist/cli/commands/obj.d.ts +9 -0
  345. package/dist/cli/commands/obj.js +74 -3
  346. package/dist/cli/commands/obj.js.map +1 -1
  347. package/dist/cli/commands/rdf.d.ts +9 -0
  348. package/dist/cli/commands/rdf.js +66 -1
  349. package/dist/cli/commands/rdf.js.map +1 -1
  350. package/dist/cli/commands/start.js +3 -0
  351. package/dist/cli/commands/start.js.map +1 -1
  352. package/dist/cli/lib/solid-auth.d.ts +3 -3
  353. package/dist/cli/lib/solid-auth.js +4 -4
  354. package/dist/cli/lib/solid-auth.js.map +1 -1
  355. package/dist/components/components.jsonld +16 -0
  356. package/dist/components/context.jsonld +815 -28
  357. package/dist/document/Chunker.jsonld +110 -0
  358. package/dist/document/{DocumentParser.d.ts → DocumentReader.d.ts} +23 -11
  359. package/dist/document/{DocumentParser.js → DocumentReader.js} +2 -2
  360. package/dist/document/DocumentReader.js.map +1 -0
  361. package/dist/document/DocumentReader.jsonld +82 -0
  362. package/dist/document/HeadingChunker.jsonld +41 -0
  363. package/dist/document/{JinaDocumentParser.d.ts → JinaReader.d.ts} +7 -7
  364. package/dist/document/{JinaDocumentParser.js → JinaReader.js} +12 -12
  365. package/dist/document/JinaReader.js.map +1 -0
  366. package/dist/document/JinaReader.jsonld +133 -0
  367. package/dist/document/L0SourceSummary.d.ts +103 -0
  368. package/dist/document/L0SourceSummary.js +157 -0
  369. package/dist/document/L0SourceSummary.js.map +1 -0
  370. package/dist/document/L0SourceSummary.jsonld +326 -0
  371. package/dist/document/PaddleOcrReader.d.ts +40 -0
  372. package/dist/document/PaddleOcrReader.js +53 -0
  373. package/dist/document/PaddleOcrReader.js.map +1 -0
  374. package/dist/document/PaddleOcrReader.jsonld +234 -0
  375. package/dist/document/ReaderAiConfig.d.ts +50 -0
  376. package/dist/document/ReaderAiConfig.js +109 -0
  377. package/dist/document/ReaderAiConfig.js.map +1 -0
  378. package/dist/document/ReaderAiConfig.jsonld +185 -0
  379. package/dist/document/ReaderPolicy.d.ts +89 -0
  380. package/dist/document/ReaderPolicy.js +158 -0
  381. package/dist/document/ReaderPolicy.js.map +1 -0
  382. package/dist/document/ReaderPolicy.jsonld +218 -0
  383. package/dist/document/index.d.ts +6 -2
  384. package/dist/document/index.js +6 -2
  385. package/dist/document/index.js.map +1 -1
  386. package/dist/edge/DdnsManager.d.ts +1 -1
  387. package/dist/edge/DdnsManager.js.map +1 -1
  388. package/dist/edge/EdgeNodeAgent.d.ts +4 -0
  389. package/dist/edge/EdgeNodeAgent.js +6 -0
  390. package/dist/edge/EdgeNodeAgent.js.map +1 -1
  391. package/dist/edge/EdgeNodeAgent.jsonld +8 -0
  392. package/dist/edge/EdgeNodeAgentInitializer.d.ts +16 -0
  393. package/dist/edge/EdgeNodeAgentInitializer.js +51 -0
  394. package/dist/edge/EdgeNodeAgentInitializer.js.map +1 -1
  395. package/dist/edge/EdgeNodeAgentInitializer.jsonld +250 -0
  396. package/dist/edge/EdgeNodeCertificateCapabilityBridge.d.ts +34 -0
  397. package/dist/edge/EdgeNodeCertificateCapabilityBridge.js +111 -0
  398. package/dist/edge/EdgeNodeCertificateCapabilityBridge.js.map +1 -0
  399. package/dist/edge/acme/AcmeCertificateManager.d.ts +14 -1
  400. package/dist/edge/acme/AcmeCertificateManager.js +67 -7
  401. package/dist/edge/acme/AcmeCertificateManager.js.map +1 -1
  402. package/dist/edge/acme/AcmeCertificateManager.jsonld +22 -2
  403. package/dist/edge/acme/ClusterCertificateManager.d.ts +12 -0
  404. package/dist/edge/acme/ClusterCertificateManager.js +38 -0
  405. package/dist/edge/acme/ClusterCertificateManager.js.map +1 -1
  406. package/dist/extensions/ExtensionRuntime.d.ts +17 -0
  407. package/dist/extensions/ExtensionRuntime.js +171 -0
  408. package/dist/extensions/ExtensionRuntime.js.map +1 -0
  409. package/dist/extensions/PodCredentialResolver.d.ts +23 -0
  410. package/dist/extensions/PodCredentialResolver.js +139 -0
  411. package/dist/extensions/PodCredentialResolver.js.map +1 -0
  412. package/dist/extensions/index.d.ts +3 -0
  413. package/dist/extensions/index.js +20 -0
  414. package/dist/extensions/index.js.map +1 -0
  415. package/dist/extensions/types.d.ts +73 -0
  416. package/dist/extensions/types.js +3 -0
  417. package/dist/extensions/types.js.map +1 -0
  418. package/dist/http/SubgraphSparqlHttpHandler.d.ts +20 -1
  419. package/dist/http/SubgraphSparqlHttpHandler.js +324 -43
  420. package/dist/http/SubgraphSparqlHttpHandler.js.map +1 -1
  421. package/dist/http/SubgraphSparqlHttpHandler.jsonld +87 -0
  422. package/dist/identity/drizzle/EdgeNodeRepository.js +3 -2
  423. package/dist/identity/drizzle/EdgeNodeRepository.js.map +1 -1
  424. package/dist/identity/drizzle/schema.pg.js +1 -1
  425. package/dist/identity/drizzle/schema.pg.js.map +1 -1
  426. package/dist/identity/drizzle/schema.sqlite.js +1 -1
  427. package/dist/identity/drizzle/schema.sqlite.js.map +1 -1
  428. package/dist/identity/oidc/ScopedPickWebIdHandler.js +5 -5
  429. package/dist/identity/oidc/ScopedPickWebIdHandler.js.map +1 -1
  430. package/dist/index.d.ts +12 -2
  431. package/dist/index.js +13 -1
  432. package/dist/index.js.map +1 -1
  433. package/dist/main.js +3 -0
  434. package/dist/main.js.map +1 -1
  435. package/dist/provision/LocalProvisionState.d.ts +28 -0
  436. package/dist/provision/LocalProvisionState.js +124 -0
  437. package/dist/provision/LocalProvisionState.js.map +1 -0
  438. package/dist/provision/ProvisionCodeCodec.d.ts +7 -3
  439. package/dist/provision/ProvisionCodeCodec.js +10 -3
  440. package/dist/provision/ProvisionCodeCodec.js.map +1 -1
  441. package/dist/provision/ProvisionPodCreator.d.ts +15 -1
  442. package/dist/provision/ProvisionPodCreator.js +68 -1
  443. package/dist/provision/ProvisionPodCreator.js.map +1 -1
  444. package/dist/provision/ProvisionPodCreator.jsonld +31 -0
  445. package/dist/provision/ServiceAccessTokenCodec.d.ts +45 -0
  446. package/dist/provision/ServiceAccessTokenCodec.js +86 -0
  447. package/dist/provision/ServiceAccessTokenCodec.js.map +1 -0
  448. package/dist/runtime/GatewayAdminProxyAuth.d.ts +29 -0
  449. package/dist/runtime/GatewayAdminProxyAuth.js +108 -0
  450. package/dist/runtime/GatewayAdminProxyAuth.js.map +1 -0
  451. package/dist/runtime/Proxy.d.ts +10 -0
  452. package/dist/runtime/Proxy.js +64 -6
  453. package/dist/runtime/Proxy.js.map +1 -1
  454. package/dist/runtime/XpodRuntime.js +1 -0
  455. package/dist/runtime/XpodRuntime.js.map +1 -1
  456. package/dist/runtime/bootstrap.d.ts +1 -0
  457. package/dist/runtime/bootstrap.js +29 -0
  458. package/dist/runtime/bootstrap.js.map +1 -1
  459. package/dist/runtime/css-process.d.ts +1 -0
  460. package/dist/runtime/css-process.js +1 -0
  461. package/dist/runtime/css-process.js.map +1 -1
  462. package/dist/runtime/index.d.ts +1 -0
  463. package/dist/runtime/index.js +3 -1
  464. package/dist/runtime/index.js.map +1 -1
  465. package/dist/runtime/lifecycle.d.ts +3 -1
  466. package/dist/runtime/lifecycle.js +3 -1
  467. package/dist/runtime/lifecycle.js.map +1 -1
  468. package/dist/runtime/runner/node/NodeGatewayRuntimeRunner.js +2 -0
  469. package/dist/runtime/runner/node/NodeGatewayRuntimeRunner.js.map +1 -1
  470. package/dist/runtime/runner/types.d.ts +3 -0
  471. package/dist/runtime/runner/types.js.map +1 -1
  472. package/dist/runtime/runtime-types.d.ts +2 -0
  473. package/dist/runtime/runtime-types.js.map +1 -1
  474. package/dist/runtime/safe-env.d.ts +15 -0
  475. package/dist/runtime/safe-env.js +109 -0
  476. package/dist/runtime/safe-env.js.map +1 -0
  477. package/dist/security/index.d.ts +1 -0
  478. package/dist/security/index.js +18 -0
  479. package/dist/security/index.js.map +1 -0
  480. package/dist/security/secret-cell/DeploymentRootKeyProvider.d.ts +17 -0
  481. package/dist/security/secret-cell/DeploymentRootKeyProvider.js +61 -0
  482. package/dist/security/secret-cell/DeploymentRootKeyProvider.js.map +1 -0
  483. package/dist/security/secret-cell/DeploymentRootKeyProvider.jsonld +124 -0
  484. package/dist/security/secret-cell/SecretCellVault.d.ts +55 -0
  485. package/dist/security/secret-cell/SecretCellVault.js +242 -0
  486. package/dist/security/secret-cell/SecretCellVault.js.map +1 -0
  487. package/dist/security/secret-cell/SecretCellVault.jsonld +207 -0
  488. package/dist/security/secret-cell/index.d.ts +2 -0
  489. package/dist/security/secret-cell/index.js +11 -0
  490. package/dist/security/secret-cell/index.js.map +1 -0
  491. package/dist/solidfs/CompositeSolidFsSyncer.d.ts +18 -0
  492. package/dist/solidfs/CompositeSolidFsSyncer.js +32 -0
  493. package/dist/solidfs/CompositeSolidFsSyncer.js.map +1 -0
  494. package/dist/solidfs/LocalSolidFS.js +25 -1
  495. package/dist/solidfs/LocalSolidFS.js.map +1 -1
  496. package/dist/solidfs/RdfIndexSolidFsSyncer.d.ts +41 -2
  497. package/dist/solidfs/RdfIndexSolidFsSyncer.js +331 -21
  498. package/dist/solidfs/RdfIndexSolidFsSyncer.js.map +1 -1
  499. package/dist/solidfs/SolidFsMetaNotes.d.ts +25 -0
  500. package/dist/solidfs/SolidFsMetaNotes.js +103 -0
  501. package/dist/solidfs/SolidFsMetaNotes.js.map +1 -0
  502. package/dist/solidfs/SolidFsSyncJournal.d.ts +2 -2
  503. package/dist/solidfs/SolidFsSyncJournal.js +9 -4
  504. package/dist/solidfs/SolidFsSyncJournal.js.map +1 -1
  505. package/dist/solidfs/SolidFsSyncJournal.jsonld +119 -0
  506. package/dist/solidfs/WorkspacePrompt.d.ts +13 -0
  507. package/dist/solidfs/WorkspacePrompt.js +42 -0
  508. package/dist/solidfs/WorkspacePrompt.js.map +1 -0
  509. package/dist/solidfs/index.d.ts +3 -0
  510. package/dist/solidfs/index.js +3 -0
  511. package/dist/solidfs/index.js.map +1 -1
  512. package/dist/solidfs/types.d.ts +12 -2
  513. package/dist/solidfs/types.js.map +1 -1
  514. package/dist/storage/accessors/MixDataAccessor.d.ts +36 -4
  515. package/dist/storage/accessors/MixDataAccessor.js +222 -23
  516. package/dist/storage/accessors/MixDataAccessor.js.map +1 -1
  517. package/dist/storage/accessors/MixDataAccessor.jsonld +89 -0
  518. package/dist/storage/accessors/SolidRdfDataAccessor.d.ts +6 -1
  519. package/dist/storage/accessors/SolidRdfDataAccessor.js +35 -0
  520. package/dist/storage/accessors/SolidRdfDataAccessor.js.map +1 -1
  521. package/dist/storage/accessors/SolidRdfDataAccessor.jsonld +20 -0
  522. package/dist/storage/database/PostgresPoolManager.d.ts +1 -0
  523. package/dist/storage/database/PostgresPoolManager.js +2 -2
  524. package/dist/storage/database/PostgresPoolManager.js.map +1 -1
  525. package/dist/storage/locking/UrlAwareRedisLocker.d.ts +2 -0
  526. package/dist/storage/locking/UrlAwareRedisLocker.js +65 -0
  527. package/dist/storage/locking/UrlAwareRedisLocker.js.map +1 -1
  528. package/dist/storage/locking/UrlAwareRedisLocker.jsonld +19 -0
  529. package/dist/storage/rdf/PostgresRdfEngine.d.ts +286 -9
  530. package/dist/storage/rdf/PostgresRdfEngine.js +10773 -2084
  531. package/dist/storage/rdf/PostgresRdfEngine.js.map +1 -1
  532. package/dist/storage/rdf/PostgresRdfEngine.jsonld +1693 -89
  533. package/dist/storage/rdf/PostgresRdfSqlExecutor.d.ts +24 -0
  534. package/dist/storage/rdf/PostgresRdfSqlExecutor.js +131 -0
  535. package/dist/storage/rdf/PostgresRdfSqlExecutor.js.map +1 -0
  536. package/dist/storage/rdf/PostgresRdfTextIndex.d.ts +54 -0
  537. package/dist/storage/rdf/PostgresRdfTextIndex.js +1255 -0
  538. package/dist/storage/rdf/PostgresRdfTextIndex.js.map +1 -0
  539. package/dist/storage/rdf/PostgresRdfTextIndex.jsonld +487 -0
  540. package/dist/storage/rdf/PostgresRdfVectorIndex.d.ts +46 -0
  541. package/dist/storage/rdf/PostgresRdfVectorIndex.js +1165 -0
  542. package/dist/storage/rdf/PostgresRdfVectorIndex.js.map +1 -0
  543. package/dist/storage/rdf/PostgresRdfVectorIndex.jsonld +423 -0
  544. package/dist/storage/rdf/Rdf3xIndex.d.ts +14 -1
  545. package/dist/storage/rdf/Rdf3xIndex.js +286 -2
  546. package/dist/storage/rdf/Rdf3xIndex.js.map +1 -1
  547. package/dist/storage/rdf/Rdf3xIndex.jsonld +36 -0
  548. package/dist/storage/rdf/Rdf3xSchema.d.ts +5 -1
  549. package/dist/storage/rdf/Rdf3xSchema.js +17 -3
  550. package/dist/storage/rdf/Rdf3xSchema.js.map +1 -1
  551. package/dist/storage/rdf/RdfAccessScope.d.ts +22 -0
  552. package/dist/storage/rdf/RdfAccessScope.js +345 -0
  553. package/dist/storage/rdf/RdfAccessScope.js.map +1 -0
  554. package/dist/storage/rdf/RdfAccessScope.jsonld +45 -0
  555. package/dist/storage/rdf/RdfFusionRankPlan.d.ts +2 -0
  556. package/dist/storage/rdf/RdfFusionRankPlan.js +186 -0
  557. package/dist/storage/rdf/RdfFusionRankPlan.js.map +1 -0
  558. package/dist/storage/rdf/RdfJoinShape.d.ts +8 -0
  559. package/dist/storage/rdf/RdfJoinShape.js +31 -0
  560. package/dist/storage/rdf/RdfJoinShape.js.map +1 -0
  561. package/dist/storage/rdf/RdfQuadIndex.d.ts +5 -2
  562. package/dist/storage/rdf/RdfQuadIndex.js +94 -6
  563. package/dist/storage/rdf/RdfQuadIndex.js.map +1 -1
  564. package/dist/storage/rdf/RdfQuadIndex.jsonld +12 -0
  565. package/dist/storage/rdf/RdfQueryExecutor.d.ts +3 -4
  566. package/dist/storage/rdf/RdfQueryExecutor.js +235 -8
  567. package/dist/storage/rdf/RdfQueryExecutor.js.map +1 -1
  568. package/dist/storage/rdf/RdfSearchSourceFilter.d.ts +10 -0
  569. package/dist/storage/rdf/RdfSearchSourceFilter.js +83 -0
  570. package/dist/storage/rdf/RdfSearchSourceFilter.js.map +1 -0
  571. package/dist/storage/rdf/RdfSparqlAdapter.d.ts +27 -1
  572. package/dist/storage/rdf/RdfSparqlAdapter.js +265 -3
  573. package/dist/storage/rdf/RdfSparqlAdapter.js.map +1 -1
  574. package/dist/storage/rdf/RdfSparqlAdapter.jsonld +8 -0
  575. package/dist/storage/rdf/RdfTermDictionary.d.ts +7 -1
  576. package/dist/storage/rdf/RdfTermDictionary.js +139 -0
  577. package/dist/storage/rdf/RdfTermDictionary.js.map +1 -1
  578. package/dist/storage/rdf/RdfTermDictionary.jsonld +4 -0
  579. package/dist/storage/rdf/RdfTextIndex.d.ts +45 -2
  580. package/dist/storage/rdf/RdfTextIndex.js +810 -114
  581. package/dist/storage/rdf/RdfTextIndex.js.map +1 -1
  582. package/dist/storage/rdf/RdfTextIndex.jsonld +193 -0
  583. package/dist/storage/rdf/RdfTextProjection.d.ts +10 -0
  584. package/dist/storage/rdf/RdfTextProjection.js +258 -0
  585. package/dist/storage/rdf/RdfTextProjection.js.map +1 -0
  586. package/dist/storage/rdf/RdfVectorIndex.d.ts +30 -2
  587. package/dist/storage/rdf/RdfVectorIndex.js +461 -38
  588. package/dist/storage/rdf/RdfVectorIndex.js.map +1 -1
  589. package/dist/storage/rdf/RdfVectorIndex.jsonld +163 -0
  590. package/dist/storage/rdf/SolidRdfEngine.d.ts +12 -9
  591. package/dist/storage/rdf/SolidRdfEngine.js +48 -22
  592. package/dist/storage/rdf/SolidRdfEngine.js.map +1 -1
  593. package/dist/storage/rdf/SolidRdfEngine.jsonld +33 -43
  594. package/dist/storage/rdf/SolidRdfSparqlEngine.d.ts +19 -8
  595. package/dist/storage/rdf/SolidRdfSparqlEngine.js +674 -44
  596. package/dist/storage/rdf/SolidRdfSparqlEngine.js.map +1 -1
  597. package/dist/storage/rdf/SolidRdfSparqlEngine.jsonld +51 -0
  598. package/dist/storage/rdf/index.d.ts +9 -5
  599. package/dist/storage/rdf/index.js +42 -1
  600. package/dist/storage/rdf/index.js.map +1 -1
  601. package/dist/storage/rdf/models-benchmark.d.ts +264 -2
  602. package/dist/storage/rdf/models-benchmark.js +4207 -155
  603. package/dist/storage/rdf/models-benchmark.js.map +1 -1
  604. package/dist/storage/rdf/types.d.ts +833 -4
  605. package/dist/storage/rdf/types.js.map +1 -1
  606. package/dist/storage/rdf/types.jsonld +348 -0
  607. package/dist/storage/sparql/CompatibilitySparqlEngine.d.ts +14 -13
  608. package/dist/storage/sparql/CompatibilitySparqlEngine.js +24 -24
  609. package/dist/storage/sparql/CompatibilitySparqlEngine.js.map +1 -1
  610. package/dist/storage/sparql/CompatibilitySparqlEngineImpl.d.ts +14 -13
  611. package/dist/storage/sparql/CompatibilitySparqlEngineImpl.js +30 -18
  612. package/dist/storage/sparql/CompatibilitySparqlEngineImpl.js.map +1 -1
  613. package/dist/storage/sparql/SubgraphQueryEngine.d.ts +21 -12
  614. package/dist/storage/sparql/SubgraphQueryEngine.js +12 -12
  615. package/dist/storage/sparql/SubgraphQueryEngine.js.map +1 -1
  616. package/dist/terminal/sandbox/MacOSSandbox.js +2 -1
  617. package/dist/terminal/sandbox/MacOSSandbox.js.map +1 -1
  618. package/dist/terminal/sandbox/index.js +2 -1
  619. package/dist/terminal/sandbox/index.js.map +1 -1
  620. package/dist/test-utils/no-auth-xpod.js +3 -0
  621. package/dist/test-utils/no-auth-xpod.js.map +1 -1
  622. package/dist/tunnel/LocalTunnelProvider.d.ts +3 -0
  623. package/dist/tunnel/LocalTunnelProvider.js +17 -1
  624. package/dist/tunnel/LocalTunnelProvider.js.map +1 -1
  625. package/dist/tunnel/LocalTunnelProvider.jsonld +23 -0
  626. package/dist/tunnel/SakuraFrpTunnelProvider.d.ts +3 -0
  627. package/dist/tunnel/SakuraFrpTunnelProvider.js +18 -2
  628. package/dist/tunnel/SakuraFrpTunnelProvider.js.map +1 -1
  629. package/dist/tunnel/TunnelProfiles.d.ts +22 -0
  630. package/dist/tunnel/TunnelProfiles.js +208 -0
  631. package/dist/tunnel/TunnelProfiles.js.map +1 -0
  632. package/dist/tunnel/index.d.ts +2 -0
  633. package/dist/tunnel/index.js +4 -1
  634. package/dist/tunnel/index.js.map +1 -1
  635. package/dist/util/identifiers/ClusterIdentifierStrategy.d.ts +3 -0
  636. package/dist/util/identifiers/ClusterIdentifierStrategy.js +18 -2
  637. package/dist/util/identifiers/ClusterIdentifierStrategy.js.map +1 -1
  638. package/dist/util/identifiers/ClusterIdentifierStrategy.jsonld +5 -1
  639. package/node_modules/@undefineds.co/ai-connection/dist/AiClientConfigurationSection.d.ts +55 -0
  640. package/node_modules/@undefineds.co/ai-connection/dist/AiClientConfigurationSection.js +167 -0
  641. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionHeader.d.ts +3 -0
  642. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionHeader.js +8 -0
  643. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionList.d.ts +4 -0
  644. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionList.js +36 -0
  645. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMain.d.ts +4 -0
  646. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMain.js +37 -0
  647. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMainHeader.d.ts +3 -0
  648. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionMainHeader.js +7 -0
  649. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionPanel.d.ts +14 -0
  650. package/node_modules/@undefineds.co/ai-connection/dist/AiConnectionPanel.js +333 -0
  651. package/node_modules/@undefineds.co/ai-connection/dist/AiProviderCard.d.ts +22 -0
  652. package/node_modules/@undefineds.co/ai-connection/dist/AiProviderCard.js +43 -0
  653. package/node_modules/@undefineds.co/ai-connection/dist/AiQuotaCard.d.ts +8 -0
  654. package/node_modules/@undefineds.co/ai-connection/dist/AiQuotaCard.js +6 -0
  655. package/node_modules/@undefineds.co/ai-connection/dist/ai-connection-client.d.ts +120 -0
  656. package/node_modules/@undefineds.co/ai-connection/dist/ai-connection-client.js +414 -0
  657. package/node_modules/@undefineds.co/ai-connection/dist/client-config/base-adapter.d.ts +32 -0
  658. package/node_modules/@undefineds.co/ai-connection/dist/client-config/base-adapter.js +212 -0
  659. package/node_modules/@undefineds.co/ai-connection/dist/client-config/codex.d.ts +14 -0
  660. package/node_modules/@undefineds.co/ai-connection/dist/client-config/codex.js +90 -0
  661. package/node_modules/@undefineds.co/ai-connection/dist/client-config/index.cjs +668 -0
  662. package/node_modules/@undefineds.co/ai-connection/dist/client-config/index.d.ts +6 -0
  663. package/node_modules/@undefineds.co/ai-connection/dist/client-config/index.js +6 -0
  664. package/node_modules/@undefineds.co/ai-connection/dist/client-config/json-env-adapter.d.ts +21 -0
  665. package/node_modules/@undefineds.co/ai-connection/dist/client-config/json-env-adapter.js +82 -0
  666. package/node_modules/@undefineds.co/ai-connection/dist/client-config/pi.d.ts +13 -0
  667. package/node_modules/@undefineds.co/ai-connection/dist/client-config/pi.js +83 -0
  668. package/node_modules/@undefineds.co/ai-connection/dist/client-config/transaction.d.ts +17 -0
  669. package/node_modules/@undefineds.co/ai-connection/dist/client-config/transaction.js +153 -0
  670. package/node_modules/@undefineds.co/ai-connection/dist/client-config/types.d.ts +40 -0
  671. package/node_modules/@undefineds.co/ai-connection/dist/client-config/types.js +1 -0
  672. package/node_modules/@undefineds.co/ai-connection/dist/controller.d.ts +42 -0
  673. package/node_modules/@undefineds.co/ai-connection/dist/controller.js +289 -0
  674. package/node_modules/@undefineds.co/ai-connection/dist/index.d.ts +16 -0
  675. package/node_modules/@undefineds.co/ai-connection/dist/index.js +41 -0
  676. package/node_modules/@undefineds.co/ai-connection/dist/manifest.d.ts +1 -0
  677. package/node_modules/@undefineds.co/ai-connection/dist/manifest.js +18 -0
  678. package/node_modules/@undefineds.co/ai-connection/dist/service-access.d.ts +3 -0
  679. package/node_modules/@undefineds.co/ai-connection/dist/service-access.js +133 -0
  680. package/node_modules/@undefineds.co/ai-connection/package.json +50 -0
  681. package/node_modules/@undefineds.co/extension-sdk/README.md +299 -0
  682. package/node_modules/@undefineds.co/extension-sdk/dist/index.d.ts +5 -0
  683. package/node_modules/@undefineds.co/extension-sdk/dist/index.js +5 -0
  684. package/node_modules/@undefineds.co/extension-sdk/dist/layout.d.ts +16 -0
  685. package/node_modules/@undefineds.co/extension-sdk/dist/layout.js +36 -0
  686. package/node_modules/@undefineds.co/extension-sdk/dist/manifest.d.ts +27 -0
  687. package/node_modules/@undefineds.co/extension-sdk/dist/manifest.js +79 -0
  688. package/node_modules/@undefineds.co/extension-sdk/dist/react/app-layout.d.ts +7 -0
  689. package/node_modules/@undefineds.co/extension-sdk/dist/react/app-layout.js +8 -0
  690. package/node_modules/@undefineds.co/extension-sdk/dist/react/auth-boundary.d.ts +27 -0
  691. package/node_modules/@undefineds.co/extension-sdk/dist/react/auth-boundary.js +49 -0
  692. package/node_modules/@undefineds.co/extension-sdk/dist/react/layout-context.d.ts +11 -0
  693. package/node_modules/@undefineds.co/extension-sdk/dist/react/layout-context.js +9 -0
  694. package/node_modules/@undefineds.co/extension-sdk/dist/react/workspace-layout.d.ts +38 -0
  695. package/node_modules/@undefineds.co/extension-sdk/dist/react/workspace-layout.js +132 -0
  696. package/node_modules/@undefineds.co/extension-sdk/dist/react.d.ts +12 -0
  697. package/node_modules/@undefineds.co/extension-sdk/dist/react.js +19 -0
  698. package/node_modules/@undefineds.co/extension-sdk/dist/testing.d.ts +7 -0
  699. package/node_modules/@undefineds.co/extension-sdk/dist/testing.js +27 -0
  700. package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +225 -0
  701. package/node_modules/@undefineds.co/extension-sdk/dist/web.js +142 -0
  702. package/node_modules/@undefineds.co/extension-sdk/package.json +49 -0
  703. package/node_modules/@undefineds.co/shared-ui/dist/badge.d.ts +8 -0
  704. package/node_modules/@undefineds.co/shared-ui/dist/badge.js +17 -0
  705. package/node_modules/@undefineds.co/shared-ui/dist/button.d.ts +10 -0
  706. package/node_modules/@undefineds.co/shared-ui/dist/button.js +30 -0
  707. package/node_modules/@undefineds.co/shared-ui/dist/card.d.ts +7 -0
  708. package/node_modules/@undefineds.co/shared-ui/dist/card.js +15 -0
  709. package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +6 -0
  710. package/node_modules/@undefineds.co/shared-ui/dist/index.js +6 -0
  711. package/node_modules/@undefineds.co/shared-ui/dist/input.d.ts +4 -0
  712. package/node_modules/@undefineds.co/shared-ui/dist/input.js +5 -0
  713. package/node_modules/@undefineds.co/shared-ui/dist/theme.css +121 -0
  714. package/node_modules/@undefineds.co/shared-ui/dist/utils.d.ts +2 -0
  715. package/node_modules/@undefineds.co/shared-ui/dist/utils.js +5 -0
  716. package/node_modules/@undefineds.co/shared-ui/dist/workspace.d.ts +23 -0
  717. package/node_modules/@undefineds.co/shared-ui/dist/workspace.js +38 -0
  718. package/node_modules/@undefineds.co/shared-ui/package.json +39 -0
  719. package/node_modules/@undefineds.co/solid-sdk/dist/index.d.ts +3 -0
  720. package/node_modules/@undefineds.co/solid-sdk/dist/index.js +3 -0
  721. package/node_modules/@undefineds.co/solid-sdk/dist/pod-runtime.d.ts +45 -0
  722. package/node_modules/@undefineds.co/solid-sdk/dist/pod-runtime.js +147 -0
  723. package/node_modules/@undefineds.co/solid-sdk/dist/react.d.ts +15 -0
  724. package/node_modules/@undefineds.co/solid-sdk/dist/react.js +15 -0
  725. package/node_modules/@undefineds.co/solid-sdk/dist/session.d.ts +42 -0
  726. package/node_modules/@undefineds.co/solid-sdk/dist/session.js +127 -0
  727. package/node_modules/@undefineds.co/solid-sdk/package.json +45 -0
  728. package/package.json +32 -12
  729. package/static/app/assets/index-BoYHJ6si.js +230 -0
  730. package/static/app/assets/inrupt-smoke.js +2 -2
  731. package/static/app/assets/main.css +1 -1
  732. package/static/app/assets/main.js +9 -9
  733. package/static/dashboard/assets/NetworkPage-Brt79fuQ.js +2 -0
  734. package/static/dashboard/assets/PaneListHeader-57nvMwH6.js +1 -0
  735. package/static/dashboard/assets/PodPage-CM6do1vB.js +2 -0
  736. package/static/dashboard/assets/ServicesPage-BUNxGJRz.js +1 -0
  737. package/static/dashboard/assets/card-B9Zjf_2p.js +1 -0
  738. package/static/dashboard/assets/dashboard-8C6o666W.js +305 -0
  739. package/static/dashboard/assets/dashboard-CSdewNeA.css +1 -0
  740. package/static/dashboard/assets/database-DPh9wDY9.js +1 -0
  741. package/static/dashboard/assets/external-link-VbMQvVMz.js +1 -0
  742. package/static/dashboard/assets/index-RfiFckzb.js +51 -0
  743. package/static/dashboard/assets/refresh-cw-BxVxNxNr.js +1 -0
  744. package/static/dashboard/assets/services-status-context-DKmJ7ISr.js +1 -0
  745. package/static/dashboard/dashboard.html +2 -2
  746. package/static/settings/assets/ModelsPage-D_IH7AH3.js +1 -0
  747. package/static/settings/assets/PaneListHeader-Bgaze006.js +1 -0
  748. package/static/settings/assets/PodPage-Cy1VNObw.js +2 -0
  749. package/static/settings/assets/ServicesPage-BsFaxVWC.js +1 -0
  750. package/static/settings/assets/SettingsPage-UafNWE_p.js +48 -0
  751. package/static/settings/assets/card-B_bXSIn-.js +1 -0
  752. package/static/settings/assets/services-status-context-DiX-AbrP.js +1 -0
  753. package/static/settings/assets/settings-B30oMfZq.js +305 -0
  754. package/static/settings/assets/settings-CSdewNeA.css +1 -0
  755. package/static/settings/assets/workspace-layout-Dv1Yn9Ci.js +1 -0
  756. package/static/settings/auth.html +21 -0
  757. package/static/settings/reachability.html +221 -0
  758. package/static/settings/reachability.svg +7 -0
  759. package/static/settings/reachability.webmanifest +18 -0
  760. package/static/settings/settings.html +13 -0
  761. package/static/settings/signal-pod.html +293 -0
  762. package/static/settings/vite.svg +1 -0
  763. package/dist/api/service/ai-gateway-transport.d.ts +0 -25
  764. package/dist/api/service/ai-gateway-transport.js +0 -136
  765. package/dist/api/service/ai-gateway-transport.js.map +0 -1
  766. package/dist/api/service/chat-protocol-adapters.d.ts +0 -5
  767. package/dist/api/service/chat-protocol-adapters.js +0 -146
  768. package/dist/api/service/chat-protocol-adapters.js.map +0 -1
  769. package/dist/api/service/chat-routing.d.ts +0 -8
  770. package/dist/api/service/chat-routing.js +0 -16
  771. package/dist/api/service/chat-routing.js.map +0 -1
  772. package/dist/api/service/platform-ai-config.d.ts +0 -10
  773. package/dist/api/service/platform-ai-config.js +0 -76
  774. package/dist/api/service/platform-ai-config.js.map +0 -1
  775. package/dist/document/DocumentParser.js.map +0 -1
  776. package/dist/document/JinaDocumentParser.js.map +0 -1
  777. package/static/app/assets/index-C1yksyT4.js +0 -171
  778. package/static/dashboard/assets/dashboard-BssaVKTn.css +0 -1
  779. package/static/dashboard/assets/dashboard-Ckuadl3C.js +0 -54
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RedisSessionAffinityStore.js","sourceRoot":"","sources":["../../../../src/api/ai-gateway/routing/RedisSessionAffinityStore.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA4B;AAC5B,iEAAqD;AAErD,iEAUgC;AAChC,sFAGqD;AAqBrD,MAAa,yBAAyB;IAUpC,YAAmB,OAAyC;QATzC,WAAM,GAAG,IAAA,oCAAY,EAAC,IAAI,CAAC,CAAC;QAOvC,iBAAY,GAAG,KAAK,CAAC;QAG3B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC;QAC3C,IAAI,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AC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QACpE,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC1E,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IACjD,CAAC;IAEO,KAAK,CAAC,GAAW;QACvB,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;IAChC,CAAC;IAEO,aAAa,CAAC,GAAkB;QACtC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAiC,CAAC;YAC9D,IACE,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ;mBACjC,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;mBAC/B,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ;mBACxC,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;mBAClC,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ,EACzC,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,OAAO,KAA4B,CAAC;QACtC,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sDAAsD,KAAK,EAAE,CAAC,CAAC;YAChF,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AAhID,8DAgIC","sourcesContent":["import Redis from 'ioredis';\nimport { getLoggerFor } from 'global-logger-factory';\n\nimport {\n affinityStorageKey,\n cooldownStorageKey,\n createSessionAffinityKeyDeriver,\n isExpired,\n type CredentialCooldownIdentity,\n type SessionAffinityKeyDeriver,\n type SessionAffinityEntry,\n type SessionAffinityIdentity,\n type SessionAffinityStore,\n} from './SessionAffinityStore';\nimport {\n attachRedisClientErrorHandler,\n closeRedisClient,\n} from '../../../storage/redis/RedisClientLifecycle';\n\nexport interface RedisSessionAffinityStoreOptions {\n client: string | RedisSessionAffinityRedisClient;\n secret?: string | Uint8Array;\n keyDeriver?: SessionAffinityKeyDeriver;\n namespace?: string;\n ttlMs?: number;\n now?: () => Date;\n}\n\nexport interface RedisSessionAffinityRedisClient {\n get(key: string): Promise<string | null>;\n set(key: string, value: string, ...args: unknown[]): Promise<unknown>;\n del(key: string): Promise<unknown>;\n}\n\ninterface StoredAffinityEntry extends Omit<SessionAffinityEntry, 'expiresAt'> {\n expiresAt?: string;\n}\n\nexport class RedisSessionAffinityStore implements SessionAffinityStore {\n protected readonly logger = getLoggerFor(this);\n private readonly client: RedisSessionAffinityRedisClient;\n private readonly ownClient: Redis | undefined;\n private readonly prefix: string;\n private readonly keyDeriver: SessionAffinityKeyDeriver;\n private readonly ttlMs: number;\n private readonly now: () => Date;\n private shuttingDown = false;\n\n public constructor(options: RedisSessionAffinityStoreOptions) {\n this.prefix = options.namespace ?? 'xpod:';\n this.keyDeriver = createSessionAffinityKeyDeriver(options);\n this.ttlMs = options.ttlMs ?? 60 * 60 * 1000;\n this.now = options.now ?? (() => new Date());\n if (typeof options.client === 'string') {\n this.ownClient = new Redis(options.client, { lazyConnect: false });\n attachRedisClientErrorHandler(this.ownClient, {\n logger: this.logger,\n label: 'RedisSessionAffinityStore',\n isShuttingDown: () => this.shuttingDown,\n });\n this.client = this.ownClient;\n } else {\n this.client = options.client;\n }\n }\n\n public async finalize(): Promise<void> {\n if (!this.ownClient) {\n return;\n }\n this.shuttingDown = true;\n await closeRedisClient(this.ownClient, {\n logger: this.logger,\n label: 'RedisSessionAffinityStore',\n });\n }\n\n public affinityKey(input: SessionAffinityIdentity): string {\n return affinityStorageKey(input, this.keyDeriver);\n }\n\n public cooldownKey(input: CredentialCooldownIdentity): string {\n return cooldownStorageKey(input, this.keyDeriver);\n }\n\n public async get(input: SessionAffinityIdentity): Promise<SessionAffinityEntry | undefined> {\n const raw = await this.client.get(this.toKey(this.affinityKey(input)));\n const entry = this.parseAffinity(raw);\n if (!entry) {\n return undefined;\n }\n const expiresAt = entry.expiresAt ? new Date(entry.expiresAt) : undefined;\n if (isExpired(expiresAt, this.now())) {\n await this.delete(input);\n return undefined;\n }\n return {\n ...entry,\n expiresAt,\n };\n }\n\n public async set(input: SessionAffinityEntry): Promise<void> {\n const expiresAt = input.expiresAt ?? new Date(this.now().getTime() + this.ttlMs);\n await this.setWithTtl(this.toKey(this.affinityKey(input)), {\n ...input,\n expiresAt: expiresAt.toISOString(),\n }, expiresAt);\n }\n\n public async delete(input: SessionAffinityIdentity): Promise<void> {\n await this.client.del(this.toKey(this.affinityKey(input)));\n }\n\n public async getCooldown(input: CredentialCooldownIdentity): Promise<Date | undefined> {\n const raw = await this.client.get(this.toKey(this.cooldownKey(input)));\n if (!raw) {\n return undefined;\n }\n const until = new Date(raw);\n if (!Number.isFinite(until.getTime()) || isExpired(until, this.now())) {\n await this.client.del(this.toKey(this.cooldownKey(input)));\n return undefined;\n }\n return until;\n }\n\n public async setCooldown(input: CredentialCooldownIdentity & { until: Date }): Promise<void> {\n await this.setWithTtl(this.toKey(this.cooldownKey(input)), input.until.toISOString(), input.until);\n }\n\n public debugAffinityKey(input: SessionAffinityIdentity): string {\n return this.affinityKey(input);\n }\n\n private async setWithTtl(key: string, value: unknown, expiresAt: Date): Promise<void> {\n const ttl = Math.max(1, expiresAt.getTime() - this.now().getTime());\n const payload = typeof value === 'string' ? value : JSON.stringify(value);\n await this.client.set(key, payload, 'PX', ttl);\n }\n\n private toKey(key: string): string {\n return `${this.prefix}${key}`;\n }\n\n private parseAffinity(raw: string | null): StoredAffinityEntry | undefined {\n if (!raw) {\n return undefined;\n }\n try {\n const value = JSON.parse(raw) as Partial<StoredAffinityEntry>;\n if (\n typeof value.deployment !== 'string'\n || typeof value.webId !== 'string'\n || typeof value.conversationId !== 'string'\n || typeof value.provider !== 'string'\n || typeof value.credentialId !== 'string'\n ) {\n return undefined;\n }\n return value as StoredAffinityEntry;\n } catch (error: unknown) {\n this.logger.warn(`Failed to parse AI gateway affinity Redis payload: ${error}`);\n return undefined;\n }\n }\n}\n"]}
@@ -0,0 +1,49 @@
1
+ export interface SessionAffinityIdentity {
2
+ deployment: string;
3
+ webId: string;
4
+ conversationId: string;
5
+ provider: string;
6
+ }
7
+ export interface SessionAffinityEntry extends SessionAffinityIdentity {
8
+ credentialId: string;
9
+ expiresAt?: Date;
10
+ }
11
+ export interface CredentialCooldownIdentity {
12
+ deployment: string;
13
+ webId: string;
14
+ credentialId: string;
15
+ }
16
+ export interface SessionAffinityStore {
17
+ affinityKey(input: SessionAffinityIdentity): string;
18
+ cooldownKey(input: CredentialCooldownIdentity): string;
19
+ get(input: SessionAffinityIdentity): Promise<SessionAffinityEntry | undefined>;
20
+ set(input: SessionAffinityEntry): Promise<void>;
21
+ delete(input: SessionAffinityIdentity): Promise<void>;
22
+ getCooldown(input: CredentialCooldownIdentity): Promise<Date | undefined>;
23
+ setCooldown(input: CredentialCooldownIdentity & {
24
+ until: Date;
25
+ }): Promise<void>;
26
+ }
27
+ export interface SessionAffinityKeyDeriver {
28
+ hashWebId(webId: string): string;
29
+ hashConversationId(conversationId: string): string;
30
+ hashCredentialId(credentialId: string): string;
31
+ }
32
+ export interface HmacSessionAffinityKeyDeriverOptions {
33
+ secret: string | Uint8Array;
34
+ }
35
+ export declare class HmacSessionAffinityKeyDeriver implements SessionAffinityKeyDeriver {
36
+ private readonly secret;
37
+ constructor(options: HmacSessionAffinityKeyDeriverOptions);
38
+ hashWebId(webId: string): string;
39
+ hashConversationId(conversationId: string): string;
40
+ hashCredentialId(credentialId: string): string;
41
+ private hmac;
42
+ }
43
+ export declare function createSessionAffinityKeyDeriver(input: {
44
+ secret?: string | Uint8Array;
45
+ keyDeriver?: SessionAffinityKeyDeriver;
46
+ }): SessionAffinityKeyDeriver;
47
+ export declare function affinityStorageKey(input: SessionAffinityIdentity, keyDeriver: SessionAffinityKeyDeriver): string;
48
+ export declare function cooldownStorageKey(input: CredentialCooldownIdentity, keyDeriver: SessionAffinityKeyDeriver): string;
49
+ export declare function isExpired(date: Date | undefined, now: Date): boolean;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HmacSessionAffinityKeyDeriver = void 0;
4
+ exports.createSessionAffinityKeyDeriver = createSessionAffinityKeyDeriver;
5
+ exports.affinityStorageKey = affinityStorageKey;
6
+ exports.cooldownStorageKey = cooldownStorageKey;
7
+ exports.isExpired = isExpired;
8
+ const node_crypto_1 = require("node:crypto");
9
+ class HmacSessionAffinityKeyDeriver {
10
+ constructor(options) {
11
+ this.secret = Buffer.isBuffer(options.secret)
12
+ ? Buffer.from(options.secret)
13
+ : Buffer.from(options.secret);
14
+ if (this.secret.byteLength < 16) {
15
+ throw new Error('Session affinity key derivation secret must contain at least 128-bit entropy');
16
+ }
17
+ }
18
+ hashWebId(webId) {
19
+ return `web_${this.hmac(webId)}`;
20
+ }
21
+ hashConversationId(conversationId) {
22
+ return `conv_${this.hmac(conversationId)}`;
23
+ }
24
+ hashCredentialId(credentialId) {
25
+ return `cred_${this.hmac(credentialId)}`;
26
+ }
27
+ hmac(value) {
28
+ return (0, node_crypto_1.createHmac)('sha256', this.secret).update(value, 'utf8').digest('hex');
29
+ }
30
+ }
31
+ exports.HmacSessionAffinityKeyDeriver = HmacSessionAffinityKeyDeriver;
32
+ function createSessionAffinityKeyDeriver(input) {
33
+ if (input.keyDeriver) {
34
+ return input.keyDeriver;
35
+ }
36
+ if (!input.secret) {
37
+ throw new Error('Session affinity key derivation requires a deployment secret');
38
+ }
39
+ return new HmacSessionAffinityKeyDeriver({ secret: input.secret });
40
+ }
41
+ function affinityStorageKey(input, keyDeriver) {
42
+ return [
43
+ 'ai-gateway',
44
+ 'affinity',
45
+ safeKeySegment(input.deployment),
46
+ keyDeriver.hashWebId(input.webId),
47
+ safeKeySegment(input.provider),
48
+ keyDeriver.hashConversationId(input.conversationId),
49
+ ].join(':');
50
+ }
51
+ function cooldownStorageKey(input, keyDeriver) {
52
+ return [
53
+ 'ai-gateway',
54
+ 'cooldown',
55
+ safeKeySegment(input.deployment),
56
+ keyDeriver.hashWebId(input.webId),
57
+ keyDeriver.hashCredentialId(input.credentialId),
58
+ ].join(':');
59
+ }
60
+ function isExpired(date, now) {
61
+ return Boolean(date && date.getTime() <= now.getTime());
62
+ }
63
+ function safeKeySegment(value) {
64
+ return value.trim().toLowerCase().replace(/[^a-z0-9._-]+/gu, '_');
65
+ }
66
+ //# sourceMappingURL=SessionAffinityStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SessionAffinityStore.js","sourceRoot":"","sources":["../../../../src/api/ai-gateway/routing/SessionAffinityStore.ts"],"names":[],"mappings":";;;AAqEA,0EAWC;AAED,gDASC;AAED,gDAQC;AAED,8BAEC;AAzGD,6CAAyC;AAwCzC,MAAa,6BAA6B;IAGxC,YAAmB,OAA6C;QAC9D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;YAC3C,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;YAC7B,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,EAAE,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;QAClG,CAAC;IACH,CAAC;IAEM,SAAS,CAAC,KAAa;QAC5B,OAAO,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACnC,CAAC;IAEM,kBAAkB,CAAC,cAAsB;QAC9C,OAAO,QAAQ,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,E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;KAChD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAED,SAAgB,SAAS,CAAC,IAAsB,EAAE,GAAS;IACzD,OAAO,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import { createHmac } from 'node:crypto';\n\nexport interface SessionAffinityIdentity {\n deployment: string;\n webId: string;\n conversationId: string;\n provider: string;\n}\n\nexport interface SessionAffinityEntry extends SessionAffinityIdentity {\n credentialId: string;\n expiresAt?: Date;\n}\n\nexport interface CredentialCooldownIdentity {\n deployment: string;\n webId: string;\n credentialId: string;\n}\n\nexport interface SessionAffinityStore {\n affinityKey(input: SessionAffinityIdentity): string;\n cooldownKey(input: CredentialCooldownIdentity): string;\n get(input: SessionAffinityIdentity): Promise<SessionAffinityEntry | undefined>;\n set(input: SessionAffinityEntry): Promise<void>;\n delete(input: SessionAffinityIdentity): Promise<void>;\n getCooldown(input: CredentialCooldownIdentity): Promise<Date | undefined>;\n setCooldown(input: CredentialCooldownIdentity & { until: Date }): Promise<void>;\n}\n\nexport interface SessionAffinityKeyDeriver {\n hashWebId(webId: string): string;\n hashConversationId(conversationId: string): string;\n hashCredentialId(credentialId: string): string;\n}\n\nexport interface HmacSessionAffinityKeyDeriverOptions {\n secret: string | Uint8Array;\n}\n\nexport class HmacSessionAffinityKeyDeriver implements SessionAffinityKeyDeriver {\n private readonly secret: Buffer;\n\n public constructor(options: HmacSessionAffinityKeyDeriverOptions) {\n this.secret = Buffer.isBuffer(options.secret)\n ? Buffer.from(options.secret)\n : Buffer.from(options.secret);\n if (this.secret.byteLength < 16) {\n throw new Error('Session affinity key derivation secret must contain at least 128-bit entropy');\n }\n }\n\n public hashWebId(webId: string): string {\n return `web_${this.hmac(webId)}`;\n }\n\n public hashConversationId(conversationId: string): string {\n return `conv_${this.hmac(conversationId)}`;\n }\n\n public hashCredentialId(credentialId: string): string {\n return `cred_${this.hmac(credentialId)}`;\n }\n\n private hmac(value: string): string {\n return createHmac('sha256', this.secret).update(value, 'utf8').digest('hex');\n }\n}\n\nexport function createSessionAffinityKeyDeriver(input: {\n secret?: string | Uint8Array;\n keyDeriver?: SessionAffinityKeyDeriver;\n}): SessionAffinityKeyDeriver {\n if (input.keyDeriver) {\n return input.keyDeriver;\n }\n if (!input.secret) {\n throw new Error('Session affinity key derivation requires a deployment secret');\n }\n return new HmacSessionAffinityKeyDeriver({ secret: input.secret });\n}\n\nexport function affinityStorageKey(input: SessionAffinityIdentity, keyDeriver: SessionAffinityKeyDeriver): string {\n return [\n 'ai-gateway',\n 'affinity',\n safeKeySegment(input.deployment),\n keyDeriver.hashWebId(input.webId),\n safeKeySegment(input.provider),\n keyDeriver.hashConversationId(input.conversationId),\n ].join(':');\n}\n\nexport function cooldownStorageKey(input: CredentialCooldownIdentity, keyDeriver: SessionAffinityKeyDeriver): string {\n return [\n 'ai-gateway',\n 'cooldown',\n safeKeySegment(input.deployment),\n keyDeriver.hashWebId(input.webId),\n keyDeriver.hashCredentialId(input.credentialId),\n ].join(':');\n}\n\nexport function isExpired(date: Date | undefined, now: Date): boolean {\n return Boolean(date && date.getTime() <= now.getTime());\n}\n\nfunction safeKeySegment(value: string): string {\n return value.trim().toLowerCase().replace(/[^a-z0-9._-]+/gu, '_');\n}\n"]}
@@ -0,0 +1,25 @@
1
+ export declare const AI_CONNECTION_APPLET_ID = "co.undefineds.ai-connection";
2
+ export interface AiConnectionServiceAccessDescriptor {
3
+ appletId: typeof AI_CONNECTION_APPLET_ID;
4
+ service: {
5
+ webId: string;
6
+ label: 'Xpod AI Connection';
7
+ };
8
+ resources: AiConnectionServiceAccessResource[];
9
+ }
10
+ export interface AiConnectionServiceAccessResource {
11
+ id: 'providerCredentials' | 'providerDefinitions' | 'gatewayAccessKeys' | 'quotaSnapshots';
12
+ url: string;
13
+ mediaType: 'text/turtle';
14
+ access: {
15
+ read: true;
16
+ append: true;
17
+ write: true;
18
+ controlRead?: never;
19
+ controlWrite?: never;
20
+ };
21
+ }
22
+ export declare function createAiConnectionServiceAccess(input: {
23
+ ownerWebId: string;
24
+ serviceWebId: string;
25
+ }): AiConnectionServiceAccessDescriptor;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AI_CONNECTION_APPLET_ID = void 0;
4
+ exports.createAiConnectionServiceAccess = createAiConnectionServiceAccess;
5
+ const drizzle_solid_1 = require("@undefineds.co/drizzle-solid");
6
+ const models_1 = require("@undefineds.co/models");
7
+ exports.AI_CONNECTION_APPLET_ID = 'co.undefineds.ai-connection';
8
+ const declaredResourceBases = new WeakMap([
9
+ [models_1.credentialResource, declaredResourceBase(models_1.credentialResource)],
10
+ [models_1.aiProviderResource, declaredResourceBase(models_1.aiProviderResource)],
11
+ [models_1.gatewayAccessKeyResource, declaredResourceBase(models_1.gatewayAccessKeyResource)],
12
+ [models_1.quotaSnapshotResource, declaredResourceBase(models_1.quotaSnapshotResource)],
13
+ ]);
14
+ function createAiConnectionServiceAccess(input) {
15
+ return {
16
+ appletId: exports.AI_CONNECTION_APPLET_ID,
17
+ service: {
18
+ webId: input.serviceWebId,
19
+ label: 'Xpod AI Connection',
20
+ },
21
+ resources: [
22
+ ['providerCredentials', resourceUrl(input.ownerWebId, models_1.credentialResource)],
23
+ ['providerDefinitions', resourceUrl(input.ownerWebId, models_1.aiProviderResource)],
24
+ ['gatewayAccessKeys', resourceUrl(input.ownerWebId, models_1.gatewayAccessKeyResource)],
25
+ ['quotaSnapshots', resourceUrl(input.ownerWebId, models_1.quotaSnapshotResource)],
26
+ ].map(([id, url]) => ({
27
+ id,
28
+ url,
29
+ mediaType: 'text/turtle',
30
+ access: { read: true, append: true, write: true },
31
+ })),
32
+ };
33
+ }
34
+ function resourceUrl(ownerWebId, resource) {
35
+ const podRoot = `${(0, drizzle_solid_1.resolvePodBaseUrl)(ownerWebId).replace(/\/$/u, '')}/`;
36
+ const resourcePath = declaredResourceBases.get(resource);
37
+ if (!resourcePath) {
38
+ throw new Error('AI Connection resource is missing an immutable declared base');
39
+ }
40
+ const documentPath = resource.buildId({ id: '__service_access__' }).split('#')[0];
41
+ return new URL(`${resourcePath}/${documentPath}`.replace(/^\/+/u, ''), podRoot).href;
42
+ }
43
+ function declaredResourceBase(resource) {
44
+ const base = resource.config?.base?.replace(/^\/+|\/+$/gu, '');
45
+ if (!base) {
46
+ throw new Error('AI Connection resource is missing a declared base');
47
+ }
48
+ return base;
49
+ }
50
+ //# sourceMappingURL=AiConnectionServiceAccess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiConnectionServiceAccess.js","sourceRoot":"","sources":["../../../../src/api/ai-gateway/service-access/AiConnectionServiceAccess.ts"],"names":[],"mappings":";;;AA8CA,0EAsBC;AApED,gEAAiE;AACjE,kDAK+B;AAElB,QAAA,uBAAuB,GAAG,6BAA6B,CAAC;AA+BrE,MAAM,qBAAqB,GAAG,IAAI,OAAO,CAAiB;IACxD,CAAC,2BAAkB,EAAE,oBAAoB,CAAC,2BAAkB,CAAC,CAAC;IAC9D,CAAC,2BAAkB,EAAE,oBAAoB,CAAC,2BAAkB,CAAC,CAAC;IAC9D,CAAC,iCAAwB,EAAE,oBAAoB,CAAC,iCAAwB,CAAC,CAAC;IAC1E,CAAC,8BAAqB,EAAE,oBAAoB,CAAC,8BAAqB,CAAC,CAAC;CACrE,CAAC,CAAC;AAEH,SAAgB,+BAA+B,CAAC,KAG/C;IACC,OAAO;QACL,QAAQ,EAAE,+BAAuB;QACjC,OAAO,EAAE;YACP,KAAK,EAAE,KAAK,CAAC,YAAY;YACzB,KAAK,EAAE,oBAAoB;SAC5B;QACD,SAAS,EAAE;YACT,CAAC,qBAA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C,QAA4B;IACxD,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;IAC/D,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { resolvePodBaseUrl } from '@undefineds.co/drizzle-solid';\nimport {\n aiProviderResource,\n credentialResource,\n gatewayAccessKeyResource,\n quotaSnapshotResource,\n} from '@undefineds.co/models';\n\nexport const AI_CONNECTION_APPLET_ID = 'co.undefineds.ai-connection';\n\nexport interface AiConnectionServiceAccessDescriptor {\n appletId: typeof AI_CONNECTION_APPLET_ID;\n service: {\n webId: string;\n label: 'Xpod AI Connection';\n };\n resources: AiConnectionServiceAccessResource[];\n}\n\nexport interface AiConnectionServiceAccessResource {\n id: 'providerCredentials' | 'providerDefinitions' | 'gatewayAccessKeys' | 'quotaSnapshots';\n url: string;\n mediaType: 'text/turtle';\n access: {\n read: true;\n append: true;\n write: true;\n controlRead?: never;\n controlWrite?: never;\n };\n}\n\ninterface PodResourceLocator {\n config?: {\n base?: string;\n };\n buildId(value: { id: string }): string;\n}\n\nconst declaredResourceBases = new WeakMap<object, string>([\n [credentialResource, declaredResourceBase(credentialResource)],\n [aiProviderResource, declaredResourceBase(aiProviderResource)],\n [gatewayAccessKeyResource, declaredResourceBase(gatewayAccessKeyResource)],\n [quotaSnapshotResource, declaredResourceBase(quotaSnapshotResource)],\n]);\n\nexport function createAiConnectionServiceAccess(input: {\n ownerWebId: string;\n serviceWebId: string;\n}): AiConnectionServiceAccessDescriptor {\n return {\n appletId: AI_CONNECTION_APPLET_ID,\n service: {\n webId: input.serviceWebId,\n label: 'Xpod AI Connection',\n },\n resources: [\n ['providerCredentials', resourceUrl(input.ownerWebId, credentialResource)],\n ['providerDefinitions', resourceUrl(input.ownerWebId, aiProviderResource)],\n ['gatewayAccessKeys', resourceUrl(input.ownerWebId, gatewayAccessKeyResource)],\n ['quotaSnapshots', resourceUrl(input.ownerWebId, quotaSnapshotResource)],\n ].map(([id, url]) => ({\n id,\n url,\n mediaType: 'text/turtle',\n access: { read: true, append: true, write: true },\n })) as AiConnectionServiceAccessResource[],\n };\n}\n\nfunction resourceUrl(ownerWebId: string, resource: PodResourceLocator): string {\n const podRoot = `${resolvePodBaseUrl(ownerWebId).replace(/\\/$/u, '')}/`;\n const resourcePath = declaredResourceBases.get(resource as object);\n if (!resourcePath) {\n throw new Error('AI Connection resource is missing an immutable declared base');\n }\n const documentPath = resource.buildId({ id: '__service_access__' }).split('#')[0];\n return new URL(`${resourcePath}/${documentPath}`.replace(/^\\/+/u, ''), podRoot).href;\n}\n\nfunction declaredResourceBase(resource: PodResourceLocator): string {\n const base = resource.config?.base?.replace(/^\\/+|\\/+$/gu, '');\n if (!base) {\n throw new Error('AI Connection resource is missing a declared base');\n }\n return base;\n}\n"]}
@@ -0,0 +1,112 @@
1
+ export type GatewayProtocol = 'responses' | 'anthropic' | 'chatCompletions';
2
+ export type GatewayMessageRole = 'system' | 'developer' | 'user' | 'assistant' | 'tool';
3
+ export type GatewayContentPart = {
4
+ type: 'text';
5
+ text: string;
6
+ } | {
7
+ type: 'image';
8
+ imageUrl?: string;
9
+ mediaType?: string;
10
+ data?: string;
11
+ detail?: string;
12
+ };
13
+ export interface GatewayMessage {
14
+ role: GatewayMessageRole;
15
+ content: GatewayContentPart[];
16
+ name?: string;
17
+ toolCallId?: string;
18
+ protocolExtensions?: Record<string, unknown>;
19
+ }
20
+ export interface GatewayTool {
21
+ type: 'function';
22
+ name: string;
23
+ description?: string;
24
+ inputSchema?: Record<string, unknown>;
25
+ protocolExtensions?: Record<string, unknown>;
26
+ }
27
+ export interface GatewayReasoningOptions {
28
+ effort?: string;
29
+ exposeSummary?: boolean;
30
+ }
31
+ export interface GatewayUsage {
32
+ inputTokens?: number;
33
+ outputTokens?: number;
34
+ totalTokens?: number;
35
+ cacheReadTokens?: number;
36
+ cacheWriteTokens?: number;
37
+ }
38
+ export interface GatewayRequest {
39
+ model: string;
40
+ instructions?: string;
41
+ messages: GatewayMessage[];
42
+ tools: GatewayTool[];
43
+ reasoning?: GatewayReasoningOptions;
44
+ maxOutputTokens?: number;
45
+ previousResponseId?: string;
46
+ stream: boolean;
47
+ protocolExtensions: Partial<Record<GatewayProtocol, Record<string, unknown>>>;
48
+ }
49
+ export type GatewayEvent = {
50
+ type: 'response.started';
51
+ id: string;
52
+ } | {
53
+ type: 'text.delta';
54
+ text: string;
55
+ } | {
56
+ type: 'reasoning.delta';
57
+ text: string;
58
+ } | {
59
+ type: 'reasoning.signature';
60
+ provider: string;
61
+ signature: string;
62
+ } | {
63
+ type: 'tool.started';
64
+ callId: string;
65
+ name: string;
66
+ } | {
67
+ type: 'tool.arguments.delta';
68
+ callId: string;
69
+ delta: string;
70
+ } | {
71
+ type: 'tool.completed';
72
+ callId: string;
73
+ } | {
74
+ type: 'usage';
75
+ usage: GatewayUsage;
76
+ } | {
77
+ type: 'response.completed';
78
+ finishReason: string;
79
+ };
80
+ export interface GatewayEventSerializer {
81
+ serializeEvent(event: GatewayEvent): Record<string, unknown> | Record<string, unknown>[];
82
+ }
83
+ export interface GatewayProtocolFrontend {
84
+ readonly protocol: GatewayProtocol;
85
+ parseRequest(body: unknown): GatewayRequest;
86
+ createEventSerializer(): GatewayEventSerializer;
87
+ }
88
+ export declare function requireObject(value: unknown, context: string): Record<string, unknown>;
89
+ export declare function stringOrUndefined(value: unknown): string | undefined;
90
+ export declare function booleanValue(value: unknown): boolean;
91
+ export declare function extractExtension(body: Record<string, unknown>, protocol: GatewayProtocol, normalizedKeys: readonly string[]): Partial<Record<GatewayProtocol, Record<string, unknown>>>;
92
+ export declare function extractText(value: unknown): string | undefined;
93
+ export declare function normalizeContentParts(content: unknown, protocol: GatewayProtocol): GatewayContentPart[];
94
+ export declare function normalizeToolFromResponses(tool: unknown): GatewayTool | undefined;
95
+ export declare function normalizeToolFromAnthropic(tool: unknown): GatewayTool | undefined;
96
+ export declare function normalizeToolFromChat(tool: unknown): GatewayTool | undefined;
97
+ export declare function normalizeMessage(message: unknown, protocol: GatewayProtocol): GatewayMessage | undefined;
98
+ export declare function mapGatewayUsageToOpenAi(usage: GatewayUsage): Record<string, unknown>;
99
+ export declare function mapGatewayUsageToChatCompletions(usage: GatewayUsage): Record<string, unknown>;
100
+ export declare function mapGatewayUsageToAnthropic(usage: GatewayUsage): Record<string, unknown>;
101
+ export declare class ToolArgumentTracker {
102
+ private readonly chunks;
103
+ private readonly toolIndexes;
104
+ private nextIndex;
105
+ reset(): void;
106
+ start(callId: string): number;
107
+ append(callId: string, delta: string): number;
108
+ argumentsFor(callId: string): string;
109
+ complete(callId: string): number;
110
+ private requireStarted;
111
+ }
112
+ export declare function unsupportedEvent(event: GatewayEvent): never;
@@ -0,0 +1,305 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolArgumentTracker = void 0;
4
+ exports.requireObject = requireObject;
5
+ exports.stringOrUndefined = stringOrUndefined;
6
+ exports.booleanValue = booleanValue;
7
+ exports.extractExtension = extractExtension;
8
+ exports.extractText = extractText;
9
+ exports.normalizeContentParts = normalizeContentParts;
10
+ exports.normalizeToolFromResponses = normalizeToolFromResponses;
11
+ exports.normalizeToolFromAnthropic = normalizeToolFromAnthropic;
12
+ exports.normalizeToolFromChat = normalizeToolFromChat;
13
+ exports.normalizeMessage = normalizeMessage;
14
+ exports.mapGatewayUsageToOpenAi = mapGatewayUsageToOpenAi;
15
+ exports.mapGatewayUsageToChatCompletions = mapGatewayUsageToChatCompletions;
16
+ exports.mapGatewayUsageToAnthropic = mapGatewayUsageToAnthropic;
17
+ exports.unsupportedEvent = unsupportedEvent;
18
+ const errors_1 = require("./errors");
19
+ function requireObject(value, context) {
20
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
21
+ throw new errors_1.GatewayProtocolError(`${context} must be an object`);
22
+ }
23
+ return value;
24
+ }
25
+ function stringOrUndefined(value) {
26
+ return typeof value === 'string' ? value : undefined;
27
+ }
28
+ function booleanValue(value) {
29
+ return value === true;
30
+ }
31
+ function extractExtension(body, protocol, normalizedKeys) {
32
+ const normalized = new Set(normalizedKeys);
33
+ const extension = {};
34
+ for (const [key, value] of Object.entries(body)) {
35
+ if (!normalized.has(key)) {
36
+ extension[key] = value;
37
+ }
38
+ }
39
+ return Object.keys(extension).length > 0 ? { [protocol]: extension } : {};
40
+ }
41
+ function extractText(value) {
42
+ if (typeof value === 'string') {
43
+ return value;
44
+ }
45
+ if (Array.isArray(value)) {
46
+ const parts = value
47
+ .map((item) => {
48
+ if (typeof item === 'string') {
49
+ return item;
50
+ }
51
+ if (item && typeof item === 'object' && typeof item.text === 'string') {
52
+ return item.text;
53
+ }
54
+ return undefined;
55
+ })
56
+ .filter((item) => item !== undefined);
57
+ return parts.length > 0 ? parts.join('\n') : undefined;
58
+ }
59
+ if (value == null) {
60
+ return undefined;
61
+ }
62
+ return String(value);
63
+ }
64
+ function normalizeContentParts(content, protocol) {
65
+ if (typeof content === 'string') {
66
+ return [{ type: 'text', text: content }];
67
+ }
68
+ if (!Array.isArray(content)) {
69
+ if (content && typeof content === 'object') {
70
+ return normalizeContentParts([content], protocol);
71
+ }
72
+ const text = extractText(content);
73
+ return text ? [{ type: 'text', text }] : [];
74
+ }
75
+ return content.flatMap((part) => {
76
+ if (typeof part === 'string') {
77
+ return [{ type: 'text', text: part }];
78
+ }
79
+ if (!part || typeof part !== 'object') {
80
+ return [];
81
+ }
82
+ const record = part;
83
+ const type = record.type;
84
+ if (type === 'text'
85
+ || type === 'input_text'
86
+ || type === 'output_text') {
87
+ const text = stringOrUndefined(record.text);
88
+ return text ? [{ type: 'text', text }] : [];
89
+ }
90
+ if (type === 'image_url') {
91
+ const imageUrl = record.image_url;
92
+ if (typeof imageUrl === 'string') {
93
+ return [{ type: 'image', imageUrl }];
94
+ }
95
+ if (imageUrl && typeof imageUrl === 'object') {
96
+ const image = imageUrl;
97
+ return [{
98
+ type: 'image',
99
+ imageUrl: stringOrUndefined(image.url),
100
+ detail: stringOrUndefined(image.detail),
101
+ }];
102
+ }
103
+ }
104
+ if (type === 'input_image') {
105
+ return [{
106
+ type: 'image',
107
+ imageUrl: stringOrUndefined(record.image_url) ?? stringOrUndefined(record.file_id),
108
+ detail: stringOrUndefined(record.detail),
109
+ }];
110
+ }
111
+ if (type === 'image' && protocol === 'anthropic') {
112
+ const source = record.source;
113
+ if (source && typeof source === 'object') {
114
+ const image = source;
115
+ return [{
116
+ type: 'image',
117
+ mediaType: stringOrUndefined(image.media_type),
118
+ data: stringOrUndefined(image.data),
119
+ }];
120
+ }
121
+ }
122
+ return [];
123
+ });
124
+ }
125
+ function normalizeToolFromResponses(tool) {
126
+ if (!tool || typeof tool !== 'object') {
127
+ return undefined;
128
+ }
129
+ const record = tool;
130
+ const name = stringOrUndefined(record.name);
131
+ if (!name) {
132
+ return undefined;
133
+ }
134
+ return {
135
+ type: 'function',
136
+ name,
137
+ description: stringOrUndefined(record.description),
138
+ inputSchema: record.parameters && typeof record.parameters === 'object'
139
+ ? record.parameters
140
+ : undefined,
141
+ };
142
+ }
143
+ function normalizeToolFromAnthropic(tool) {
144
+ if (!tool || typeof tool !== 'object') {
145
+ return undefined;
146
+ }
147
+ const record = tool;
148
+ const name = stringOrUndefined(record.name);
149
+ if (!name) {
150
+ return undefined;
151
+ }
152
+ return {
153
+ type: 'function',
154
+ name,
155
+ description: stringOrUndefined(record.description),
156
+ inputSchema: record.input_schema && typeof record.input_schema === 'object'
157
+ ? record.input_schema
158
+ : undefined,
159
+ };
160
+ }
161
+ function normalizeToolFromChat(tool) {
162
+ if (!tool || typeof tool !== 'object') {
163
+ return undefined;
164
+ }
165
+ const record = tool;
166
+ const fn = record.function;
167
+ if (!fn || typeof fn !== 'object') {
168
+ return undefined;
169
+ }
170
+ const functionRecord = fn;
171
+ const name = stringOrUndefined(functionRecord.name);
172
+ if (!name) {
173
+ return undefined;
174
+ }
175
+ return {
176
+ type: 'function',
177
+ name,
178
+ description: stringOrUndefined(functionRecord.description),
179
+ inputSchema: functionRecord.parameters && typeof functionRecord.parameters === 'object'
180
+ ? functionRecord.parameters
181
+ : undefined,
182
+ };
183
+ }
184
+ function normalizeMessage(message, protocol) {
185
+ if (!message || typeof message !== 'object') {
186
+ return undefined;
187
+ }
188
+ const record = message;
189
+ const role = stringOrUndefined(record.role);
190
+ if (!role) {
191
+ return undefined;
192
+ }
193
+ return {
194
+ role: role,
195
+ content: normalizeContentParts(record.content, protocol),
196
+ name: stringOrUndefined(record.name),
197
+ toolCallId: stringOrUndefined(record.tool_call_id) ?? stringOrUndefined(record.tool_use_id),
198
+ };
199
+ }
200
+ function mapGatewayUsageToOpenAi(usage) {
201
+ return {
202
+ ...(usage.inputTokens !== undefined ? { input_tokens: usage.inputTokens } : {}),
203
+ ...(usage.outputTokens !== undefined ? { output_tokens: usage.outputTokens } : {}),
204
+ ...(usage.totalTokens !== undefined ? { total_tokens: usage.totalTokens } : {}),
205
+ ...(usage.cacheReadTokens !== undefined || usage.cacheWriteTokens !== undefined
206
+ ? {
207
+ input_tokens_details: {
208
+ ...(usage.cacheReadTokens !== undefined ? { cached_tokens: usage.cacheReadTokens } : {}),
209
+ ...(usage.cacheWriteTokens !== undefined ? { cache_write_tokens: usage.cacheWriteTokens } : {}),
210
+ },
211
+ }
212
+ : {}),
213
+ };
214
+ }
215
+ function mapGatewayUsageToChatCompletions(usage) {
216
+ return {
217
+ ...(usage.inputTokens !== undefined ? { prompt_tokens: usage.inputTokens } : {}),
218
+ ...(usage.outputTokens !== undefined ? { completion_tokens: usage.outputTokens } : {}),
219
+ ...(usage.totalTokens !== undefined ? { total_tokens: usage.totalTokens } : {}),
220
+ ...(usage.cacheReadTokens !== undefined || usage.cacheWriteTokens !== undefined
221
+ ? {
222
+ prompt_tokens_details: {
223
+ ...(usage.cacheReadTokens !== undefined ? { cached_tokens: usage.cacheReadTokens } : {}),
224
+ ...(usage.cacheWriteTokens !== undefined ? { cache_write_tokens: usage.cacheWriteTokens } : {}),
225
+ },
226
+ }
227
+ : {}),
228
+ };
229
+ }
230
+ function mapGatewayUsageToAnthropic(usage) {
231
+ return {
232
+ ...(usage.inputTokens !== undefined ? { input_tokens: usage.inputTokens } : {}),
233
+ ...(usage.outputTokens !== undefined ? { output_tokens: usage.outputTokens } : {}),
234
+ ...(usage.cacheReadTokens !== undefined ? { cache_read_input_tokens: usage.cacheReadTokens } : {}),
235
+ ...(usage.cacheWriteTokens !== undefined ? { cache_creation_input_tokens: usage.cacheWriteTokens } : {}),
236
+ };
237
+ }
238
+ class ToolArgumentTracker {
239
+ constructor() {
240
+ this.chunks = new Map();
241
+ this.toolIndexes = new Map();
242
+ this.nextIndex = 0;
243
+ }
244
+ reset() {
245
+ this.chunks.clear();
246
+ this.toolIndexes.clear();
247
+ this.nextIndex = 0;
248
+ }
249
+ start(callId) {
250
+ if (!this.toolIndexes.has(callId)) {
251
+ this.toolIndexes.set(callId, this.nextIndex);
252
+ this.nextIndex += 1;
253
+ }
254
+ if (!this.chunks.has(callId)) {
255
+ this.chunks.set(callId, '');
256
+ }
257
+ return this.toolIndexes.get(callId) ?? 0;
258
+ }
259
+ append(callId, delta) {
260
+ const index = this.requireStarted(callId);
261
+ this.chunks.set(callId, `${this.chunks.get(callId) ?? ''}${delta}`);
262
+ return index;
263
+ }
264
+ argumentsFor(callId) {
265
+ this.requireStarted(callId);
266
+ return this.chunks.get(callId) ?? '';
267
+ }
268
+ complete(callId) {
269
+ const index = this.requireStarted(callId);
270
+ const value = this.chunks.get(callId) ?? '';
271
+ try {
272
+ JSON.parse(value || '{}');
273
+ }
274
+ catch (error) {
275
+ throw new errors_1.GatewayProtocolError('Completed tool arguments must be valid JSON', {
276
+ code: 'invalid_tool_arguments',
277
+ status: 400,
278
+ details: { callId },
279
+ cause: error,
280
+ });
281
+ }
282
+ this.chunks.delete(callId);
283
+ this.toolIndexes.delete(callId);
284
+ return index;
285
+ }
286
+ requireStarted(callId) {
287
+ const index = this.toolIndexes.get(callId);
288
+ if (index === undefined || !this.chunks.has(callId)) {
289
+ throw new errors_1.GatewayProtocolError('Tool arguments event received before tool start', {
290
+ code: 'invalid_tool_arguments',
291
+ status: 400,
292
+ details: { callId },
293
+ });
294
+ }
295
+ return index;
296
+ }
297
+ }
298
+ exports.ToolArgumentTracker = ToolArgumentTracker;
299
+ function unsupportedEvent(event) {
300
+ throw new errors_1.GatewayProtocolError(`Unsupported gateway event: ${event.type}`, {
301
+ code: 'unsupported_protocol_event',
302
+ status: 500,
303
+ });
304
+ }
305
+ //# sourceMappingURL=types.js.map