@lobu/gateway 2.8.0
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/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +6 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/platform.d.ts +92 -0
- package/dist/api/platform.d.ts.map +1 -0
- package/dist/api/platform.js +236 -0
- package/dist/api/platform.js.map +1 -0
- package/dist/api/response-renderer.d.ts +44 -0
- package/dist/api/response-renderer.d.ts.map +1 -0
- package/dist/api/response-renderer.js +123 -0
- package/dist/api/response-renderer.js.map +1 -0
- package/dist/auth/agent-metadata-store.d.ts +64 -0
- package/dist/auth/agent-metadata-store.d.ts.map +1 -0
- package/dist/auth/agent-metadata-store.js +115 -0
- package/dist/auth/agent-metadata-store.js.map +1 -0
- package/dist/auth/api-auth-middleware.d.ts +19 -0
- package/dist/auth/api-auth-middleware.d.ts.map +1 -0
- package/dist/auth/api-auth-middleware.js +61 -0
- package/dist/auth/api-auth-middleware.js.map +1 -0
- package/dist/auth/api-key-provider-module.d.ts +60 -0
- package/dist/auth/api-key-provider-module.d.ts.map +1 -0
- package/dist/auth/api-key-provider-module.js +148 -0
- package/dist/auth/api-key-provider-module.js.map +1 -0
- package/dist/auth/base-provider-module.d.ts +70 -0
- package/dist/auth/base-provider-module.d.ts.map +1 -0
- package/dist/auth/base-provider-module.js +118 -0
- package/dist/auth/base-provider-module.js.map +1 -0
- package/dist/auth/chatgpt/chatgpt-oauth-module.d.ts +34 -0
- package/dist/auth/chatgpt/chatgpt-oauth-module.d.ts.map +1 -0
- package/dist/auth/chatgpt/chatgpt-oauth-module.js +136 -0
- package/dist/auth/chatgpt/chatgpt-oauth-module.js.map +1 -0
- package/dist/auth/chatgpt/device-code-client.d.ts +40 -0
- package/dist/auth/chatgpt/device-code-client.d.ts.map +1 -0
- package/dist/auth/chatgpt/device-code-client.js +165 -0
- package/dist/auth/chatgpt/device-code-client.js.map +1 -0
- package/dist/auth/chatgpt/index.d.ts +2 -0
- package/dist/auth/chatgpt/index.d.ts.map +1 -0
- package/dist/auth/chatgpt/index.js +6 -0
- package/dist/auth/chatgpt/index.js.map +1 -0
- package/dist/auth/claude/oauth-module.d.ts +29 -0
- package/dist/auth/claude/oauth-module.d.ts.map +1 -0
- package/dist/auth/claude/oauth-module.js +201 -0
- package/dist/auth/claude/oauth-module.js.map +1 -0
- package/dist/auth/cli/token-service.d.ts +35 -0
- package/dist/auth/cli/token-service.d.ts.map +1 -0
- package/dist/auth/cli/token-service.js +171 -0
- package/dist/auth/cli/token-service.js.map +1 -0
- package/dist/auth/external/client.d.ts +65 -0
- package/dist/auth/external/client.d.ts.map +1 -0
- package/dist/auth/external/client.js +348 -0
- package/dist/auth/external/client.js.map +1 -0
- package/dist/auth/external/device-code-client.d.ts +41 -0
- package/dist/auth/external/device-code-client.d.ts.map +1 -0
- package/dist/auth/external/device-code-client.js +128 -0
- package/dist/auth/external/device-code-client.js.map +1 -0
- package/dist/auth/mcp/config-service.d.ts +70 -0
- package/dist/auth/mcp/config-service.d.ts.map +1 -0
- package/dist/auth/mcp/config-service.js +269 -0
- package/dist/auth/mcp/config-service.js.map +1 -0
- package/dist/auth/mcp/proxy.d.ts +68 -0
- package/dist/auth/mcp/proxy.d.ts.map +1 -0
- package/dist/auth/mcp/proxy.js +783 -0
- package/dist/auth/mcp/proxy.js.map +1 -0
- package/dist/auth/mcp/string-substitution.d.ts +11 -0
- package/dist/auth/mcp/string-substitution.d.ts.map +1 -0
- package/dist/auth/mcp/string-substitution.js +21 -0
- package/dist/auth/mcp/string-substitution.js.map +1 -0
- package/dist/auth/mcp/tool-cache.d.ts +26 -0
- package/dist/auth/mcp/tool-cache.d.ts.map +1 -0
- package/dist/auth/mcp/tool-cache.js +58 -0
- package/dist/auth/mcp/tool-cache.js.map +1 -0
- package/dist/auth/oauth/base-client.d.ts +54 -0
- package/dist/auth/oauth/base-client.d.ts.map +1 -0
- package/dist/auth/oauth/base-client.js +191 -0
- package/dist/auth/oauth/base-client.js.map +1 -0
- package/dist/auth/oauth/client.d.ts +35 -0
- package/dist/auth/oauth/client.d.ts.map +1 -0
- package/dist/auth/oauth/client.js +96 -0
- package/dist/auth/oauth/client.js.map +1 -0
- package/dist/auth/oauth/credentials.d.ts +8 -0
- package/dist/auth/oauth/credentials.d.ts.map +1 -0
- package/dist/auth/oauth/credentials.js +3 -0
- package/dist/auth/oauth/credentials.js.map +1 -0
- package/dist/auth/oauth/providers.d.ts +44 -0
- package/dist/auth/oauth/providers.d.ts.map +1 -0
- package/dist/auth/oauth/providers.js +37 -0
- package/dist/auth/oauth/providers.js.map +1 -0
- package/dist/auth/oauth/state-store.d.ts +62 -0
- package/dist/auth/oauth/state-store.d.ts.map +1 -0
- package/dist/auth/oauth/state-store.js +84 -0
- package/dist/auth/oauth/state-store.js.map +1 -0
- package/dist/auth/oauth-templates.d.ts +15 -0
- package/dist/auth/oauth-templates.d.ts.map +1 -0
- package/dist/auth/oauth-templates.js +161 -0
- package/dist/auth/oauth-templates.js.map +1 -0
- package/dist/auth/provider-catalog.d.ts +52 -0
- package/dist/auth/provider-catalog.d.ts.map +1 -0
- package/dist/auth/provider-catalog.js +155 -0
- package/dist/auth/provider-catalog.js.map +1 -0
- package/dist/auth/provider-model-options.d.ts +3 -0
- package/dist/auth/provider-model-options.d.ts.map +1 -0
- package/dist/auth/provider-model-options.js +29 -0
- package/dist/auth/provider-model-options.js.map +1 -0
- package/dist/auth/settings/agent-settings-store.d.ts +112 -0
- package/dist/auth/settings/agent-settings-store.d.ts.map +1 -0
- package/dist/auth/settings/agent-settings-store.js +376 -0
- package/dist/auth/settings/agent-settings-store.js.map +1 -0
- package/dist/auth/settings/auth-profiles-manager.d.ts +26 -0
- package/dist/auth/settings/auth-profiles-manager.d.ts.map +1 -0
- package/dist/auth/settings/auth-profiles-manager.js +146 -0
- package/dist/auth/settings/auth-profiles-manager.js.map +1 -0
- package/dist/auth/settings/index.d.ts +4 -0
- package/dist/auth/settings/index.d.ts.map +1 -0
- package/dist/auth/settings/index.js +9 -0
- package/dist/auth/settings/index.js.map +1 -0
- package/dist/auth/settings/model-preference-store.d.ts +25 -0
- package/dist/auth/settings/model-preference-store.d.ts.map +1 -0
- package/dist/auth/settings/model-preference-store.js +50 -0
- package/dist/auth/settings/model-preference-store.js.map +1 -0
- package/dist/auth/settings/model-selection.d.ts +11 -0
- package/dist/auth/settings/model-selection.d.ts.map +1 -0
- package/dist/auth/settings/model-selection.js +83 -0
- package/dist/auth/settings/model-selection.js.map +1 -0
- package/dist/auth/settings/resolved-settings-view.d.ts +45 -0
- package/dist/auth/settings/resolved-settings-view.d.ts.map +1 -0
- package/dist/auth/settings/resolved-settings-view.js +152 -0
- package/dist/auth/settings/resolved-settings-view.js.map +1 -0
- package/dist/auth/settings/template-utils.d.ts +3 -0
- package/dist/auth/settings/template-utils.d.ts.map +1 -0
- package/dist/auth/settings/template-utils.js +43 -0
- package/dist/auth/settings/template-utils.js.map +1 -0
- package/dist/auth/settings/token-service.d.ts +86 -0
- package/dist/auth/settings/token-service.d.ts.map +1 -0
- package/dist/auth/settings/token-service.js +3 -0
- package/dist/auth/settings/token-service.js.map +1 -0
- package/dist/auth/system-env-store.d.ts +26 -0
- package/dist/auth/system-env-store.d.ts.map +1 -0
- package/dist/auth/system-env-store.js +92 -0
- package/dist/auth/system-env-store.js.map +1 -0
- package/dist/auth/user-agents-store.d.ts +31 -0
- package/dist/auth/user-agents-store.d.ts.map +1 -0
- package/dist/auth/user-agents-store.js +54 -0
- package/dist/auth/user-agents-store.js.map +1 -0
- package/dist/channels/binding-service.d.ts +69 -0
- package/dist/channels/binding-service.d.ts.map +1 -0
- package/dist/channels/binding-service.js +144 -0
- package/dist/channels/binding-service.js.map +1 -0
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.d.ts.map +1 -0
- package/dist/channels/index.js +6 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/cli/gateway.d.ts +31 -0
- package/dist/cli/gateway.d.ts.map +1 -0
- package/dist/cli/gateway.js +1062 -0
- package/dist/cli/gateway.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +56 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/built-in-commands.d.ts +10 -0
- package/dist/commands/built-in-commands.d.ts.map +1 -0
- package/dist/commands/built-in-commands.js +63 -0
- package/dist/commands/built-in-commands.js.map +1 -0
- package/dist/commands/command-dispatcher.d.ts +25 -0
- package/dist/commands/command-dispatcher.d.ts.map +1 -0
- package/dist/commands/command-dispatcher.js +50 -0
- package/dist/commands/command-dispatcher.js.map +1 -0
- package/dist/commands/command-reply-adapters.d.ts +3 -0
- package/dist/commands/command-reply-adapters.d.ts.map +1 -0
- package/dist/commands/command-reply-adapters.js +60 -0
- package/dist/commands/command-reply-adapters.js.map +1 -0
- package/dist/config/file-loader.d.ts +23 -0
- package/dist/config/file-loader.d.ts.map +1 -0
- package/dist/config/file-loader.js +495 -0
- package/dist/config/file-loader.js.map +1 -0
- package/dist/config/index.d.ts +96 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +357 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/network-allowlist.d.ts +18 -0
- package/dist/config/network-allowlist.d.ts.map +1 -0
- package/dist/config/network-allowlist.js +60 -0
- package/dist/config/network-allowlist.js.map +1 -0
- package/dist/connections/chat-instance-manager.d.ts +107 -0
- package/dist/connections/chat-instance-manager.d.ts.map +1 -0
- package/dist/connections/chat-instance-manager.js +886 -0
- package/dist/connections/chat-instance-manager.js.map +1 -0
- package/dist/connections/chat-response-bridge.d.ts +31 -0
- package/dist/connections/chat-response-bridge.d.ts.map +1 -0
- package/dist/connections/chat-response-bridge.js +465 -0
- package/dist/connections/chat-response-bridge.js.map +1 -0
- package/dist/connections/index.d.ts +4 -0
- package/dist/connections/index.d.ts.map +1 -0
- package/dist/connections/index.js +8 -0
- package/dist/connections/index.js.map +1 -0
- package/dist/connections/interaction-bridge.d.ts +7 -0
- package/dist/connections/interaction-bridge.d.ts.map +1 -0
- package/dist/connections/interaction-bridge.js +593 -0
- package/dist/connections/interaction-bridge.js.map +1 -0
- package/dist/connections/message-handler-bridge.d.ts +21 -0
- package/dist/connections/message-handler-bridge.d.ts.map +1 -0
- package/dist/connections/message-handler-bridge.js +314 -0
- package/dist/connections/message-handler-bridge.js.map +1 -0
- package/dist/connections/platform-auth-methods.d.ts +5 -0
- package/dist/connections/platform-auth-methods.d.ts.map +1 -0
- package/dist/connections/platform-auth-methods.js +13 -0
- package/dist/connections/platform-auth-methods.js.map +1 -0
- package/dist/connections/types.d.ts +52 -0
- package/dist/connections/types.d.ts.map +1 -0
- package/dist/connections/types.js +20 -0
- package/dist/connections/types.js.map +1 -0
- package/dist/gateway/connection-manager.d.ts +87 -0
- package/dist/gateway/connection-manager.d.ts.map +1 -0
- package/dist/gateway/connection-manager.js +216 -0
- package/dist/gateway/connection-manager.js.map +1 -0
- package/dist/gateway/index.d.ts +71 -0
- package/dist/gateway/index.d.ts.map +1 -0
- package/dist/gateway/index.js +509 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/job-router.d.ts +60 -0
- package/dist/gateway/job-router.d.ts.map +1 -0
- package/dist/gateway/job-router.js +148 -0
- package/dist/gateway/job-router.js.map +1 -0
- package/dist/gateway-main.d.ts +81 -0
- package/dist/gateway-main.d.ts.map +1 -0
- package/dist/gateway-main.js +143 -0
- package/dist/gateway-main.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/queue/index.d.ts +8 -0
- package/dist/infrastructure/queue/index.d.ts.map +1 -0
- package/dist/infrastructure/queue/index.js +12 -0
- package/dist/infrastructure/queue/index.js.map +1 -0
- package/dist/infrastructure/queue/queue-producer.d.ts +68 -0
- package/dist/infrastructure/queue/queue-producer.d.ts.map +1 -0
- package/dist/infrastructure/queue/queue-producer.js +72 -0
- package/dist/infrastructure/queue/queue-producer.js.map +1 -0
- package/dist/infrastructure/queue/redis-queue.d.ts +45 -0
- package/dist/infrastructure/queue/redis-queue.d.ts.map +1 -0
- package/dist/infrastructure/queue/redis-queue.js +273 -0
- package/dist/infrastructure/queue/redis-queue.js.map +1 -0
- package/dist/infrastructure/queue/types.d.ts +107 -0
- package/dist/infrastructure/queue/types.d.ts.map +1 -0
- package/dist/infrastructure/queue/types.js +7 -0
- package/dist/infrastructure/queue/types.js.map +1 -0
- package/dist/infrastructure/redis/system-message-limiter.d.ts +35 -0
- package/dist/infrastructure/redis/system-message-limiter.d.ts.map +1 -0
- package/dist/infrastructure/redis/system-message-limiter.js +61 -0
- package/dist/infrastructure/redis/system-message-limiter.js.map +1 -0
- package/dist/interactions/config-request-store.d.ts +41 -0
- package/dist/interactions/config-request-store.d.ts.map +1 -0
- package/dist/interactions/config-request-store.js +103 -0
- package/dist/interactions/config-request-store.js.map +1 -0
- package/dist/interactions.d.ts +134 -0
- package/dist/interactions.d.ts.map +1 -0
- package/dist/interactions.js +175 -0
- package/dist/interactions.js.map +1 -0
- package/dist/lobu.d.ts +78 -0
- package/dist/lobu.d.ts.map +1 -0
- package/dist/lobu.js +248 -0
- package/dist/lobu.js.map +1 -0
- package/dist/metrics/prometheus.d.ts +6 -0
- package/dist/metrics/prometheus.d.ts.map +1 -0
- package/dist/metrics/prometheus.js +78 -0
- package/dist/metrics/prometheus.js.map +1 -0
- package/dist/modules/module-system.d.ts +82 -0
- package/dist/modules/module-system.d.ts.map +1 -0
- package/dist/modules/module-system.js +53 -0
- package/dist/modules/module-system.js.map +1 -0
- package/dist/orchestration/base-deployment-manager.d.ts +173 -0
- package/dist/orchestration/base-deployment-manager.d.ts.map +1 -0
- package/dist/orchestration/base-deployment-manager.js +553 -0
- package/dist/orchestration/base-deployment-manager.js.map +1 -0
- package/dist/orchestration/deployment-utils.d.ts +25 -0
- package/dist/orchestration/deployment-utils.d.ts.map +1 -0
- package/dist/orchestration/deployment-utils.js +65 -0
- package/dist/orchestration/deployment-utils.js.map +1 -0
- package/dist/orchestration/impl/docker-deployment.d.ts +43 -0
- package/dist/orchestration/impl/docker-deployment.d.ts.map +1 -0
- package/dist/orchestration/impl/docker-deployment.js +480 -0
- package/dist/orchestration/impl/docker-deployment.js.map +1 -0
- package/dist/orchestration/impl/embedded-deployment.d.ts +16 -0
- package/dist/orchestration/impl/embedded-deployment.d.ts.map +1 -0
- package/dist/orchestration/impl/embedded-deployment.js +195 -0
- package/dist/orchestration/impl/embedded-deployment.js.map +1 -0
- package/dist/orchestration/impl/index.d.ts +8 -0
- package/dist/orchestration/impl/index.d.ts.map +1 -0
- package/dist/orchestration/impl/index.js +14 -0
- package/dist/orchestration/impl/index.js.map +1 -0
- package/dist/orchestration/impl/k8s/deployment.d.ts +204 -0
- package/dist/orchestration/impl/k8s/deployment.d.ts.map +1 -0
- package/dist/orchestration/impl/k8s/deployment.js +620 -0
- package/dist/orchestration/impl/k8s/deployment.js.map +1 -0
- package/dist/orchestration/impl/k8s/helpers.d.ts +34 -0
- package/dist/orchestration/impl/k8s/helpers.d.ts.map +1 -0
- package/dist/orchestration/impl/k8s/helpers.js +377 -0
- package/dist/orchestration/impl/k8s/helpers.js.map +1 -0
- package/dist/orchestration/impl/k8s/index.d.ts +2 -0
- package/dist/orchestration/impl/k8s/index.d.ts.map +1 -0
- package/dist/orchestration/impl/k8s/index.js +6 -0
- package/dist/orchestration/impl/k8s/index.js.map +1 -0
- package/dist/orchestration/index.d.ts +53 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +257 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/message-consumer.d.ts +49 -0
- package/dist/orchestration/message-consumer.d.ts.map +1 -0
- package/dist/orchestration/message-consumer.js +406 -0
- package/dist/orchestration/message-consumer.js.map +1 -0
- package/dist/orchestration/scheduled-wakeup.d.ts +110 -0
- package/dist/orchestration/scheduled-wakeup.d.ts.map +1 -0
- package/dist/orchestration/scheduled-wakeup.js +500 -0
- package/dist/orchestration/scheduled-wakeup.js.map +1 -0
- package/dist/permissions/approval-policy.d.ts +28 -0
- package/dist/permissions/approval-policy.d.ts.map +1 -0
- package/dist/permissions/approval-policy.js +33 -0
- package/dist/permissions/approval-policy.js.map +1 -0
- package/dist/permissions/grant-store.d.ts +52 -0
- package/dist/permissions/grant-store.d.ts.map +1 -0
- package/dist/permissions/grant-store.js +192 -0
- package/dist/permissions/grant-store.js.map +1 -0
- package/dist/platform/file-handler.d.ts +51 -0
- package/dist/platform/file-handler.d.ts.map +1 -0
- package/dist/platform/file-handler.js +6 -0
- package/dist/platform/file-handler.js.map +1 -0
- package/dist/platform/link-buttons.d.ts +21 -0
- package/dist/platform/link-buttons.d.ts.map +1 -0
- package/dist/platform/link-buttons.js +43 -0
- package/dist/platform/link-buttons.js.map +1 -0
- package/dist/platform/renderer-utils.d.ts +10 -0
- package/dist/platform/renderer-utils.d.ts.map +1 -0
- package/dist/platform/renderer-utils.js +42 -0
- package/dist/platform/renderer-utils.js.map +1 -0
- package/dist/platform/response-renderer.d.ts +66 -0
- package/dist/platform/response-renderer.d.ts.map +1 -0
- package/dist/platform/response-renderer.js +8 -0
- package/dist/platform/response-renderer.js.map +1 -0
- package/dist/platform/unified-thread-consumer.d.ts +41 -0
- package/dist/platform/unified-thread-consumer.d.ts.map +1 -0
- package/dist/platform/unified-thread-consumer.js +143 -0
- package/dist/platform/unified-thread-consumer.js.map +1 -0
- package/dist/platform.d.ts +255 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +40 -0
- package/dist/platform.js.map +1 -0
- package/dist/proxy/http-proxy.d.ts +32 -0
- package/dist/proxy/http-proxy.d.ts.map +1 -0
- package/dist/proxy/http-proxy.js +636 -0
- package/dist/proxy/http-proxy.js.map +1 -0
- package/dist/proxy/proxy-manager.d.ts +13 -0
- package/dist/proxy/proxy-manager.d.ts.map +1 -0
- package/dist/proxy/proxy-manager.js +68 -0
- package/dist/proxy/proxy-manager.js.map +1 -0
- package/dist/proxy/secret-proxy.d.ts +78 -0
- package/dist/proxy/secret-proxy.d.ts.map +1 -0
- package/dist/proxy/secret-proxy.js +309 -0
- package/dist/proxy/secret-proxy.js.map +1 -0
- package/dist/proxy/token-refresh-job.d.ts +29 -0
- package/dist/proxy/token-refresh-job.d.ts.map +1 -0
- package/dist/proxy/token-refresh-job.js +104 -0
- package/dist/proxy/token-refresh-job.js.map +1 -0
- package/dist/routes/internal/audio.d.ts +14 -0
- package/dist/routes/internal/audio.d.ts.map +1 -0
- package/dist/routes/internal/audio.js +118 -0
- package/dist/routes/internal/audio.js.map +1 -0
- package/dist/routes/internal/device-auth.d.ts +42 -0
- package/dist/routes/internal/device-auth.d.ts.map +1 -0
- package/dist/routes/internal/device-auth.js +397 -0
- package/dist/routes/internal/device-auth.js.map +1 -0
- package/dist/routes/internal/files.d.ts +9 -0
- package/dist/routes/internal/files.d.ts.map +1 -0
- package/dist/routes/internal/files.js +175 -0
- package/dist/routes/internal/files.js.map +1 -0
- package/dist/routes/internal/history.d.ts +9 -0
- package/dist/routes/internal/history.d.ts.map +1 -0
- package/dist/routes/internal/history.js +55 -0
- package/dist/routes/internal/history.js.map +1 -0
- package/dist/routes/internal/images.d.ts +10 -0
- package/dist/routes/internal/images.d.ts.map +1 -0
- package/dist/routes/internal/images.js +101 -0
- package/dist/routes/internal/images.js.map +1 -0
- package/dist/routes/internal/interactions.d.ts +9 -0
- package/dist/routes/internal/interactions.d.ts.map +1 -0
- package/dist/routes/internal/interactions.js +53 -0
- package/dist/routes/internal/interactions.js.map +1 -0
- package/dist/routes/internal/middleware.d.ts +7 -0
- package/dist/routes/internal/middleware.d.ts.map +1 -0
- package/dist/routes/internal/middleware.js +24 -0
- package/dist/routes/internal/middleware.js.map +1 -0
- package/dist/routes/internal/schedule.d.ts +14 -0
- package/dist/routes/internal/schedule.d.ts.map +1 -0
- package/dist/routes/internal/schedule.js +169 -0
- package/dist/routes/internal/schedule.js.map +1 -0
- package/dist/routes/internal/types.d.ts +22 -0
- package/dist/routes/internal/types.d.ts.map +1 -0
- package/dist/routes/internal/types.js +6 -0
- package/dist/routes/internal/types.js.map +1 -0
- package/dist/routes/openapi-auto.d.ts +8 -0
- package/dist/routes/openapi-auto.d.ts.map +1 -0
- package/dist/routes/openapi-auto.js +196 -0
- package/dist/routes/openapi-auto.js.map +1 -0
- package/dist/routes/public/agent-access.d.ts +11 -0
- package/dist/routes/public/agent-access.d.ts.map +1 -0
- package/dist/routes/public/agent-access.js +11 -0
- package/dist/routes/public/agent-access.js.map +1 -0
- package/dist/routes/public/agent-config.d.ts +42 -0
- package/dist/routes/public/agent-config.d.ts.map +1 -0
- package/dist/routes/public/agent-config.js +415 -0
- package/dist/routes/public/agent-config.js.map +1 -0
- package/dist/routes/public/agent-history.d.ts +17 -0
- package/dist/routes/public/agent-history.d.ts.map +1 -0
- package/dist/routes/public/agent-history.js +335 -0
- package/dist/routes/public/agent-history.js.map +1 -0
- package/dist/routes/public/agent-schedules.d.ts +18 -0
- package/dist/routes/public/agent-schedules.d.ts.map +1 -0
- package/dist/routes/public/agent-schedules.js +242 -0
- package/dist/routes/public/agent-schedules.js.map +1 -0
- package/dist/routes/public/agent.d.ts +23 -0
- package/dist/routes/public/agent.d.ts.map +1 -0
- package/dist/routes/public/agent.js +864 -0
- package/dist/routes/public/agent.js.map +1 -0
- package/dist/routes/public/agents.d.ts +22 -0
- package/dist/routes/public/agents.d.ts.map +1 -0
- package/dist/routes/public/agents.js +257 -0
- package/dist/routes/public/agents.js.map +1 -0
- package/dist/routes/public/channels.d.ts +23 -0
- package/dist/routes/public/channels.d.ts.map +1 -0
- package/dist/routes/public/channels.js +131 -0
- package/dist/routes/public/channels.js.map +1 -0
- package/dist/routes/public/cli-auth.d.ts +12 -0
- package/dist/routes/public/cli-auth.d.ts.map +1 -0
- package/dist/routes/public/cli-auth.js +552 -0
- package/dist/routes/public/cli-auth.js.map +1 -0
- package/dist/routes/public/connections.d.ts +20 -0
- package/dist/routes/public/connections.d.ts.map +1 -0
- package/dist/routes/public/connections.js +464 -0
- package/dist/routes/public/connections.js.map +1 -0
- package/dist/routes/public/landing.d.ts +3 -0
- package/dist/routes/public/landing.d.ts.map +1 -0
- package/dist/routes/public/landing.js +17 -0
- package/dist/routes/public/landing.js.map +1 -0
- package/dist/routes/public/oauth.d.ts +24 -0
- package/dist/routes/public/oauth.d.ts.map +1 -0
- package/dist/routes/public/oauth.js +108 -0
- package/dist/routes/public/oauth.js.map +1 -0
- package/dist/routes/public/settings-auth.d.ts +28 -0
- package/dist/routes/public/settings-auth.d.ts.map +1 -0
- package/dist/routes/public/settings-auth.js +90 -0
- package/dist/routes/public/settings-auth.js.map +1 -0
- package/dist/routes/public/slack.d.ts +4 -0
- package/dist/routes/public/slack.d.ts.map +1 -0
- package/dist/routes/public/slack.js +119 -0
- package/dist/routes/public/slack.js.map +1 -0
- package/dist/routes/shared/agent-ownership.d.ts +15 -0
- package/dist/routes/shared/agent-ownership.d.ts.map +1 -0
- package/dist/routes/shared/agent-ownership.js +61 -0
- package/dist/routes/shared/agent-ownership.js.map +1 -0
- package/dist/routes/shared/token-verifier.d.ts +21 -0
- package/dist/routes/shared/token-verifier.d.ts.map +1 -0
- package/dist/routes/shared/token-verifier.js +25 -0
- package/dist/routes/shared/token-verifier.js.map +1 -0
- package/dist/services/core-services.d.ts +133 -0
- package/dist/services/core-services.d.ts.map +1 -0
- package/dist/services/core-services.js +728 -0
- package/dist/services/core-services.js.map +1 -0
- package/dist/services/image-generation-service.d.ts +38 -0
- package/dist/services/image-generation-service.d.ts.map +1 -0
- package/dist/services/image-generation-service.js +167 -0
- package/dist/services/image-generation-service.js.map +1 -0
- package/dist/services/instruction-service.d.ts +41 -0
- package/dist/services/instruction-service.d.ts.map +1 -0
- package/dist/services/instruction-service.js +252 -0
- package/dist/services/instruction-service.js.map +1 -0
- package/dist/services/mcp-registry.d.ts +31 -0
- package/dist/services/mcp-registry.d.ts.map +1 -0
- package/dist/services/mcp-registry.js +69 -0
- package/dist/services/mcp-registry.js.map +1 -0
- package/dist/services/platform-helpers.d.ts +47 -0
- package/dist/services/platform-helpers.d.ts.map +1 -0
- package/dist/services/platform-helpers.js +200 -0
- package/dist/services/platform-helpers.js.map +1 -0
- package/dist/services/session-manager.d.ts +72 -0
- package/dist/services/session-manager.d.ts.map +1 -0
- package/dist/services/session-manager.js +199 -0
- package/dist/services/session-manager.js.map +1 -0
- package/dist/services/settings-resolver.d.ts +25 -0
- package/dist/services/settings-resolver.d.ts.map +1 -0
- package/dist/services/settings-resolver.js +55 -0
- package/dist/services/settings-resolver.js.map +1 -0
- package/dist/services/system-config-resolver.d.ts +25 -0
- package/dist/services/system-config-resolver.d.ts.map +1 -0
- package/dist/services/system-config-resolver.js +73 -0
- package/dist/services/system-config-resolver.js.map +1 -0
- package/dist/services/system-skills-service.d.ts +38 -0
- package/dist/services/system-skills-service.d.ts.map +1 -0
- package/dist/services/system-skills-service.js +186 -0
- package/dist/services/system-skills-service.js.map +1 -0
- package/dist/services/transcription-service.d.ts +91 -0
- package/dist/services/transcription-service.d.ts.map +1 -0
- package/dist/services/transcription-service.js +465 -0
- package/dist/services/transcription-service.js.map +1 -0
- package/dist/session.d.ts +75 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +19 -0
- package/dist/session.js.map +1 -0
- package/dist/spaces/index.d.ts +2 -0
- package/dist/spaces/index.d.ts.map +1 -0
- package/dist/spaces/index.js +18 -0
- package/dist/spaces/index.js.map +1 -0
- package/dist/spaces/space-resolver.d.ts +10 -0
- package/dist/spaces/space-resolver.d.ts.map +1 -0
- package/dist/spaces/space-resolver.js +17 -0
- package/dist/spaces/space-resolver.js.map +1 -0
- package/dist/stores/in-memory-agent-store.d.ts +57 -0
- package/dist/stores/in-memory-agent-store.d.ts.map +1 -0
- package/dist/stores/in-memory-agent-store.js +304 -0
- package/dist/stores/in-memory-agent-store.js.map +1 -0
- package/dist/stores/redis-agent-store.d.ts +57 -0
- package/dist/stores/redis-agent-store.d.ts.map +1 -0
- package/dist/stores/redis-agent-store.js +163 -0
- package/dist/stores/redis-agent-store.js.map +1 -0
- package/dist/utils/public-url.d.ts +6 -0
- package/dist/utils/public-url.d.ts.map +1 -0
- package/dist/utils/public-url.js +33 -0
- package/dist/utils/public-url.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +32 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +56 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.CoreServices = void 0;
|
|
38
|
+
const core_1 = require("@lobu/core");
|
|
39
|
+
const agent_metadata_store_1 = require("../auth/agent-metadata-store");
|
|
40
|
+
const api_key_provider_module_1 = require("../auth/api-key-provider-module");
|
|
41
|
+
const chatgpt_1 = require("../auth/chatgpt");
|
|
42
|
+
const oauth_module_1 = require("../auth/claude/oauth-module");
|
|
43
|
+
const client_1 = require("../auth/external/client");
|
|
44
|
+
const config_service_1 = require("../auth/mcp/config-service");
|
|
45
|
+
const proxy_1 = require("../auth/mcp/proxy");
|
|
46
|
+
const tool_cache_1 = require("../auth/mcp/tool-cache");
|
|
47
|
+
const client_2 = require("../auth/oauth/client");
|
|
48
|
+
const providers_1 = require("../auth/oauth/providers");
|
|
49
|
+
const state_store_1 = require("../auth/oauth/state-store");
|
|
50
|
+
const provider_catalog_1 = require("../auth/provider-catalog");
|
|
51
|
+
const settings_1 = require("../auth/settings");
|
|
52
|
+
const model_preference_store_1 = require("../auth/settings/model-preference-store");
|
|
53
|
+
const user_agents_store_1 = require("../auth/user-agents-store");
|
|
54
|
+
const channels_1 = require("../channels");
|
|
55
|
+
const built_in_commands_1 = require("../commands/built-in-commands");
|
|
56
|
+
const file_loader_1 = require("../config/file-loader");
|
|
57
|
+
const gateway_1 = require("../gateway");
|
|
58
|
+
const queue_1 = require("../infrastructure/queue");
|
|
59
|
+
const interactions_1 = require("../interactions");
|
|
60
|
+
const module_system_1 = require("../modules/module-system");
|
|
61
|
+
const scheduled_wakeup_1 = require("../orchestration/scheduled-wakeup");
|
|
62
|
+
const grant_store_1 = require("../permissions/grant-store");
|
|
63
|
+
const secret_proxy_1 = require("../proxy/secret-proxy");
|
|
64
|
+
const token_refresh_job_1 = require("../proxy/token-refresh-job");
|
|
65
|
+
const in_memory_agent_store_1 = require("../stores/in-memory-agent-store");
|
|
66
|
+
const redis_agent_store_1 = require("../stores/redis-agent-store");
|
|
67
|
+
const image_generation_service_1 = require("./image-generation-service");
|
|
68
|
+
const instruction_service_1 = require("./instruction-service");
|
|
69
|
+
const session_manager_1 = require("./session-manager");
|
|
70
|
+
const settings_resolver_1 = require("./settings-resolver");
|
|
71
|
+
const system_config_resolver_1 = require("./system-config-resolver");
|
|
72
|
+
const system_skills_service_1 = require("./system-skills-service");
|
|
73
|
+
const transcription_service_1 = require("./transcription-service");
|
|
74
|
+
const logger = (0, core_1.createLogger)("core-services");
|
|
75
|
+
/**
|
|
76
|
+
* Core Services - Centralized service initialization and lifecycle management
|
|
77
|
+
*/
|
|
78
|
+
class CoreServices {
|
|
79
|
+
constructor(config, options) {
|
|
80
|
+
this.config = config;
|
|
81
|
+
// File-first architecture state
|
|
82
|
+
this.fileLoadedAgents = [];
|
|
83
|
+
this.projectPath = null;
|
|
84
|
+
this.configAgents = [];
|
|
85
|
+
this.options = options;
|
|
86
|
+
if (options === null || options === void 0 ? void 0 : options.configStore)
|
|
87
|
+
this.configStore = options.configStore;
|
|
88
|
+
if (options === null || options === void 0 ? void 0 : options.connectionStore)
|
|
89
|
+
this.connectionStore = options.connectionStore;
|
|
90
|
+
if (options === null || options === void 0 ? void 0 : options.accessStore)
|
|
91
|
+
this.accessStore = options.accessStore;
|
|
92
|
+
}
|
|
93
|
+
getConfigStore() {
|
|
94
|
+
return this.configStore;
|
|
95
|
+
}
|
|
96
|
+
getConnectionStore() {
|
|
97
|
+
return this.connectionStore;
|
|
98
|
+
}
|
|
99
|
+
getAccessStore() {
|
|
100
|
+
return this.accessStore;
|
|
101
|
+
}
|
|
102
|
+
getSettingsResolver() {
|
|
103
|
+
return this.settingsResolver;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Initialize all core services in dependency order
|
|
107
|
+
*/
|
|
108
|
+
async initialize() {
|
|
109
|
+
logger.debug("Initializing core services...");
|
|
110
|
+
// 1. Queue (foundation for everything else)
|
|
111
|
+
await this.initializeQueue();
|
|
112
|
+
logger.debug("Queue initialized");
|
|
113
|
+
// 2. Session management
|
|
114
|
+
await this.initializeSessionServices();
|
|
115
|
+
logger.debug("Session services initialized");
|
|
116
|
+
// 3. Auth & provider services
|
|
117
|
+
await this.initializeClaudeServices();
|
|
118
|
+
logger.debug("Auth & provider services initialized");
|
|
119
|
+
// 4. MCP ecosystem (depends on queue and Claude services)
|
|
120
|
+
await this.initializeMcpServices();
|
|
121
|
+
logger.debug("MCP services initialized");
|
|
122
|
+
// 5. Queue producer (depends on queue being ready)
|
|
123
|
+
await this.initializeQueueProducer();
|
|
124
|
+
logger.debug("Queue producer initialized");
|
|
125
|
+
// 6. Scheduled wakeup service (depends on queue)
|
|
126
|
+
await this.initializeScheduledWakeupService();
|
|
127
|
+
logger.debug("Scheduled wakeup service initialized");
|
|
128
|
+
// 7. Command registry (depends on agent settings store)
|
|
129
|
+
this.initializeCommandRegistry();
|
|
130
|
+
logger.debug("Command registry initialized");
|
|
131
|
+
logger.info("Core services initialized successfully");
|
|
132
|
+
}
|
|
133
|
+
// ============================================================================
|
|
134
|
+
// 1. Queue Services Initialization
|
|
135
|
+
// ============================================================================
|
|
136
|
+
async initializeQueue() {
|
|
137
|
+
var _a;
|
|
138
|
+
if (!((_a = this.config.queues) === null || _a === void 0 ? void 0 : _a.connectionString)) {
|
|
139
|
+
throw new Error("Queue connection string is required");
|
|
140
|
+
}
|
|
141
|
+
const url = new URL(this.config.queues.connectionString);
|
|
142
|
+
if (url.protocol !== "redis:") {
|
|
143
|
+
throw new Error(`Unsupported queue protocol: ${url.protocol}. Only redis:// is supported.`);
|
|
144
|
+
}
|
|
145
|
+
const config = {
|
|
146
|
+
host: url.hostname,
|
|
147
|
+
port: Number.parseInt(url.port, 10) || 6379,
|
|
148
|
+
password: url.password || undefined,
|
|
149
|
+
db: url.pathname ? Number.parseInt(url.pathname.slice(1), 10) : 0,
|
|
150
|
+
maxRetriesPerRequest: 3,
|
|
151
|
+
};
|
|
152
|
+
this.queue = new queue_1.RedisQueue(config);
|
|
153
|
+
await this.queue.start();
|
|
154
|
+
logger.debug("Queue connection established");
|
|
155
|
+
}
|
|
156
|
+
async initializeQueueProducer() {
|
|
157
|
+
if (!this.queue) {
|
|
158
|
+
throw new Error("Queue must be initialized before queue producer");
|
|
159
|
+
}
|
|
160
|
+
this.queueProducer = new queue_1.QueueProducer(this.queue);
|
|
161
|
+
await this.queueProducer.start();
|
|
162
|
+
logger.debug("Queue producer initialized");
|
|
163
|
+
}
|
|
164
|
+
// ============================================================================
|
|
165
|
+
// Scheduled Wakeup Service Initialization
|
|
166
|
+
// ============================================================================
|
|
167
|
+
async initializeScheduledWakeupService() {
|
|
168
|
+
if (!this.queue) {
|
|
169
|
+
throw new Error("Queue must be initialized before scheduled wakeup service");
|
|
170
|
+
}
|
|
171
|
+
this.scheduledWakeupService = new scheduled_wakeup_1.ScheduledWakeupService(this.queue);
|
|
172
|
+
await this.scheduledWakeupService.start();
|
|
173
|
+
// Set global reference for BaseDeploymentManager cleanup
|
|
174
|
+
(0, scheduled_wakeup_1.setScheduledWakeupService)(this.scheduledWakeupService);
|
|
175
|
+
logger.debug("Scheduled wakeup service initialized");
|
|
176
|
+
}
|
|
177
|
+
// ============================================================================
|
|
178
|
+
// 2. Session Services Initialization
|
|
179
|
+
// ============================================================================
|
|
180
|
+
async initializeSessionServices() {
|
|
181
|
+
var _a, _b, _c;
|
|
182
|
+
if (!this.queue) {
|
|
183
|
+
throw new Error("Queue must be initialized before session services");
|
|
184
|
+
}
|
|
185
|
+
const redisClient = this.queue.getRedisClient();
|
|
186
|
+
const sessionStore = new session_manager_1.RedisSessionStore(this.queue);
|
|
187
|
+
this.sessionManager = new session_manager_1.SessionManager(sessionStore);
|
|
188
|
+
logger.debug("Session manager initialized");
|
|
189
|
+
this.interactionService = new interactions_1.InteractionService();
|
|
190
|
+
logger.debug("Interaction service initialized");
|
|
191
|
+
// Initialize grant store for unified permissions
|
|
192
|
+
this.grantStore = new grant_store_1.GrantStore(redisClient);
|
|
193
|
+
logger.debug("Grant store initialized");
|
|
194
|
+
// Initialize agent configuration stores
|
|
195
|
+
this.agentSettingsStore = new settings_1.AgentSettingsStore(redisClient);
|
|
196
|
+
this.channelBindingService = new channels_1.ChannelBindingService(redisClient);
|
|
197
|
+
this.userAgentsStore = new user_agents_store_1.UserAgentsStore(redisClient);
|
|
198
|
+
this.agentMetadataStore = new agent_metadata_store_1.AgentMetadataStore(redisClient);
|
|
199
|
+
logger.debug("Agent settings, channel binding, user agents & metadata stores initialized");
|
|
200
|
+
// Initialize agent sub-stores
|
|
201
|
+
if (!this.configStore || !this.connectionStore || !this.accessStore) {
|
|
202
|
+
if ((_a = this.config.agents) === null || _a === void 0 ? void 0 : _a.length) {
|
|
203
|
+
const inMemoryStore = new in_memory_agent_store_1.InMemoryAgentStore();
|
|
204
|
+
if (!this.configStore)
|
|
205
|
+
this.configStore = inMemoryStore;
|
|
206
|
+
if (!this.connectionStore)
|
|
207
|
+
this.connectionStore = inMemoryStore;
|
|
208
|
+
if (!this.accessStore)
|
|
209
|
+
this.accessStore = inMemoryStore;
|
|
210
|
+
await this.populateStoreFromAgentConfigs(inMemoryStore, this.config.agents);
|
|
211
|
+
logger.debug(`Agent sub-stores initialized (in-memory, ${this.config.agents.length} agent(s) from config)`);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
// Check if lobu.toml exists (file-first dev mode)
|
|
215
|
+
const { existsSync } = await Promise.resolve().then(() => __importStar(require("node:fs")));
|
|
216
|
+
const { resolve } = await Promise.resolve().then(() => __importStar(require("node:path")));
|
|
217
|
+
const workspaceRoot = (_b = process.env.LOBU_WORKSPACE_ROOT) === null || _b === void 0 ? void 0 : _b.trim();
|
|
218
|
+
const candidatePaths = [
|
|
219
|
+
...(workspaceRoot ? [resolve(workspaceRoot, "lobu.toml")] : []),
|
|
220
|
+
resolve(process.cwd(), "lobu.toml"),
|
|
221
|
+
resolve("/app/lobu.toml"),
|
|
222
|
+
];
|
|
223
|
+
const tomlPath = candidatePaths.find((p) => existsSync(p));
|
|
224
|
+
if (tomlPath) {
|
|
225
|
+
const inMemoryStore = new in_memory_agent_store_1.InMemoryAgentStore();
|
|
226
|
+
if (!this.configStore)
|
|
227
|
+
this.configStore = inMemoryStore;
|
|
228
|
+
if (!this.connectionStore)
|
|
229
|
+
this.connectionStore = inMemoryStore;
|
|
230
|
+
if (!this.accessStore)
|
|
231
|
+
this.accessStore = inMemoryStore;
|
|
232
|
+
// File-first dev mode: use InMemoryAgentStore populated from files
|
|
233
|
+
this.projectPath = resolve(tomlPath, "..");
|
|
234
|
+
// Load agents from files and populate store
|
|
235
|
+
this.fileLoadedAgents = await (0, file_loader_1.loadAgentConfigFromFiles)(this.projectPath);
|
|
236
|
+
await this.populateStoreFromFiles(inMemoryStore, this.fileLoadedAgents);
|
|
237
|
+
logger.debug(`Agent sub-stores initialized (in-memory, ${this.fileLoadedAgents.length} agent(s) from files)`);
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
if (!this.configStore) {
|
|
241
|
+
this.configStore = new redis_agent_store_1.RedisAgentConfigStore(this.agentSettingsStore, this.agentMetadataStore);
|
|
242
|
+
}
|
|
243
|
+
if (!this.connectionStore) {
|
|
244
|
+
this.connectionStore = new redis_agent_store_1.RedisAgentConnectionStore(redisClient, this.channelBindingService);
|
|
245
|
+
}
|
|
246
|
+
if (!this.accessStore) {
|
|
247
|
+
this.accessStore = new redis_agent_store_1.RedisAgentAccessStore(this.grantStore, this.userAgentsStore);
|
|
248
|
+
}
|
|
249
|
+
logger.debug("Agent sub-stores initialized (Redis-backed defaults)");
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
logger.debug("Using host-provided agent sub-stores (embedded mode)");
|
|
255
|
+
}
|
|
256
|
+
// Create settings resolver (template fallback logic)
|
|
257
|
+
this.settingsResolver = new settings_resolver_1.SettingsResolver(this.configStore, this.connectionStore);
|
|
258
|
+
// Initialize external OAuth client if configured
|
|
259
|
+
this.externalAuthClient =
|
|
260
|
+
(_c = client_1.ExternalAuthClient.fromEnv(this.config.mcp.publicGatewayUrl, {
|
|
261
|
+
get: (key) => redisClient.get(key),
|
|
262
|
+
set: (key, value, ttlSeconds) => redisClient.setex(key, ttlSeconds, value),
|
|
263
|
+
})) !== null && _c !== void 0 ? _c : undefined;
|
|
264
|
+
if (this.externalAuthClient) {
|
|
265
|
+
logger.debug("External OAuth client initialized");
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// ============================================================================
|
|
269
|
+
// 3. Auth & Provider Services Initialization
|
|
270
|
+
// ============================================================================
|
|
271
|
+
async initializeClaudeServices() {
|
|
272
|
+
var _a, _b, _c;
|
|
273
|
+
if (!this.queue) {
|
|
274
|
+
throw new Error("Queue must be initialized before auth services");
|
|
275
|
+
}
|
|
276
|
+
const redisClient = this.queue.getRedisClient();
|
|
277
|
+
if (!this.agentSettingsStore) {
|
|
278
|
+
throw new Error("Agent settings store must be initialized before auth services");
|
|
279
|
+
}
|
|
280
|
+
if (this.fileLoadedAgents.length > 0) {
|
|
281
|
+
for (const agent of this.fileLoadedAgents) {
|
|
282
|
+
await this.syncAgentSettingsToRuntimeStore(agent.agentId, agent.settings);
|
|
283
|
+
}
|
|
284
|
+
logger.debug(`Synced settings for ${this.fileLoadedAgents.length} file-loaded agent(s)`);
|
|
285
|
+
}
|
|
286
|
+
if (this.configAgents.length > 0) {
|
|
287
|
+
for (const agent of this.configAgents) {
|
|
288
|
+
await this.syncAgentSettingsToRuntimeStore(agent.id, this.buildSettingsFromAgentConfig(agent));
|
|
289
|
+
}
|
|
290
|
+
logger.debug(`Synced settings for ${this.configAgents.length} config agent(s)`);
|
|
291
|
+
}
|
|
292
|
+
// Initialize auth profile and preference stores
|
|
293
|
+
this.authProfilesManager = new settings_1.AuthProfilesManager(this.agentSettingsStore);
|
|
294
|
+
this.transcriptionService = new transcription_service_1.TranscriptionService(this.authProfilesManager);
|
|
295
|
+
this.imageGenerationService = new image_generation_service_1.ImageGenerationService(this.authProfilesManager);
|
|
296
|
+
this.modelPreferenceStore = new model_preference_store_1.ModelPreferenceStore(redisClient, "claude");
|
|
297
|
+
// Seed provider credentials from file-loaded agents
|
|
298
|
+
if (this.authProfilesManager && this.fileLoadedAgents.length > 0) {
|
|
299
|
+
for (const agent of this.fileLoadedAgents) {
|
|
300
|
+
for (const cred of agent.credentials) {
|
|
301
|
+
await this.authProfilesManager.upsertProfile({
|
|
302
|
+
agentId: agent.agentId,
|
|
303
|
+
provider: cred.provider,
|
|
304
|
+
credential: cred.key,
|
|
305
|
+
authType: "api-key",
|
|
306
|
+
label: `${cred.provider} (from lobu.toml)`,
|
|
307
|
+
makePrimary: true,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
logger.debug(`Seeded credentials for ${this.fileLoadedAgents.length} file-loaded agent(s)`);
|
|
312
|
+
}
|
|
313
|
+
// Seed provider credentials from config agents (embedded mode)
|
|
314
|
+
if (this.authProfilesManager && this.configAgents.length > 0) {
|
|
315
|
+
for (const agent of this.configAgents) {
|
|
316
|
+
for (const provider of agent.providers || []) {
|
|
317
|
+
if (!provider.key)
|
|
318
|
+
continue;
|
|
319
|
+
await this.authProfilesManager.upsertProfile({
|
|
320
|
+
agentId: agent.id,
|
|
321
|
+
provider: provider.id,
|
|
322
|
+
credential: provider.key,
|
|
323
|
+
authType: "api-key",
|
|
324
|
+
label: `${provider.id} (from config)`,
|
|
325
|
+
makePrimary: true,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
logger.debug(`Seeded credentials for ${this.configAgents.length} config agent(s)`);
|
|
330
|
+
}
|
|
331
|
+
logger.debug("Auth profile, model preference, transcription, and image generation services initialized");
|
|
332
|
+
// Initialize secret injection proxy (will be finalized after provider modules are registered)
|
|
333
|
+
this.secretProxy = new secret_proxy_1.SecretProxy({
|
|
334
|
+
defaultUpstreamUrl: this.config.anthropicProxy.anthropicBaseUrl ||
|
|
335
|
+
"https://api.anthropic.com",
|
|
336
|
+
});
|
|
337
|
+
this.secretProxy.initialize(redisClient);
|
|
338
|
+
logger.debug(`Secret proxy initialized (upstream: ${this.config.anthropicProxy.anthropicBaseUrl || "https://api.anthropic.com"})`);
|
|
339
|
+
// Start background token refresh job
|
|
340
|
+
if (!this.authProfilesManager) {
|
|
341
|
+
throw new Error("Auth profiles manager must be initialized before token refresh job");
|
|
342
|
+
}
|
|
343
|
+
this.tokenRefreshJob = new token_refresh_job_1.TokenRefreshJob(this.authProfilesManager, redisClient, [{ providerId: "claude", oauthClient: new client_2.OAuthClient(providers_1.CLAUDE_PROVIDER) }]);
|
|
344
|
+
this.tokenRefreshJob.start();
|
|
345
|
+
logger.debug("Token refresh job started");
|
|
346
|
+
// Register Claude OAuth module
|
|
347
|
+
this.oauthStateStore = (0, state_store_1.createOAuthStateStore)("claude", redisClient);
|
|
348
|
+
const claudeOAuthModule = new oauth_module_1.ClaudeOAuthModule(this.authProfilesManager, this.modelPreferenceStore);
|
|
349
|
+
core_1.moduleRegistry.register(claudeOAuthModule);
|
|
350
|
+
logger.debug(`Claude OAuth module registered (system token: ${claudeOAuthModule.hasSystemKey() ? "available" : "not available"})`);
|
|
351
|
+
// Register ChatGPT OAuth module
|
|
352
|
+
const chatgptOAuthModule = new chatgpt_1.ChatGPTOAuthModule(this.agentSettingsStore);
|
|
353
|
+
core_1.moduleRegistry.register(chatgptOAuthModule);
|
|
354
|
+
logger.debug(`ChatGPT OAuth module registered (system token: ${chatgptOAuthModule.hasSystemKey() ? "available" : "not available"})`);
|
|
355
|
+
// Initialize system skills — use injected skills if provided, else load from file
|
|
356
|
+
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.systemSkills) {
|
|
357
|
+
this.systemSkillsService = new system_skills_service_1.SystemSkillsService(undefined, this.options.systemSkills);
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
this.systemSkillsService = new system_skills_service_1.SystemSkillsService("config/system-skills.json");
|
|
361
|
+
}
|
|
362
|
+
this.systemConfigResolver = new system_config_resolver_1.SystemConfigResolver(this.systemSkillsService);
|
|
363
|
+
logger.debug("System skills service initialized");
|
|
364
|
+
(_b = this.transcriptionService) === null || _b === void 0 ? void 0 : _b.setProviderConfigSource(() => this.systemConfigResolver
|
|
365
|
+
? this.systemConfigResolver.getProviderConfigs()
|
|
366
|
+
: Promise.resolve({}));
|
|
367
|
+
// Register config-driven providers from system skills
|
|
368
|
+
const configProviders = await this.systemConfigResolver.getProviderConfigs();
|
|
369
|
+
const registeredIds = new Set((0, module_system_1.getModelProviderModules)().map((m) => m.providerId));
|
|
370
|
+
for (const [id, entry] of Object.entries(configProviders)) {
|
|
371
|
+
if (registeredIds.has(id)) {
|
|
372
|
+
logger.info(`Skipping config-driven provider "${id}" — already registered`);
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
const module = new api_key_provider_module_1.ApiKeyProviderModule({
|
|
376
|
+
providerId: id,
|
|
377
|
+
providerDisplayName: entry.displayName,
|
|
378
|
+
providerIconUrl: entry.iconUrl,
|
|
379
|
+
envVarName: entry.envVarName,
|
|
380
|
+
slug: id,
|
|
381
|
+
upstreamBaseUrl: entry.upstreamBaseUrl,
|
|
382
|
+
modelsEndpoint: entry.modelsEndpoint,
|
|
383
|
+
sdkCompat: entry.sdkCompat,
|
|
384
|
+
defaultModel: entry.defaultModel,
|
|
385
|
+
registryAlias: entry.registryAlias,
|
|
386
|
+
apiKeyInstructions: entry.apiKeyInstructions,
|
|
387
|
+
apiKeyPlaceholder: entry.apiKeyPlaceholder,
|
|
388
|
+
agentSettingsStore: this.agentSettingsStore,
|
|
389
|
+
});
|
|
390
|
+
core_1.moduleRegistry.register(module);
|
|
391
|
+
registeredIds.add(id);
|
|
392
|
+
logger.debug(`Registered config-driven provider: ${id} (system key: ${module.hasSystemKey() ? "available" : "not available"})`);
|
|
393
|
+
}
|
|
394
|
+
// Initialize provider catalog service
|
|
395
|
+
this.providerCatalogService = new provider_catalog_1.ProviderCatalogService(this.agentSettingsStore, this.authProfilesManager);
|
|
396
|
+
logger.debug("Provider catalog service initialized");
|
|
397
|
+
// Register provider upstream configs with the secret proxy for path-based routing
|
|
398
|
+
if (this.secretProxy) {
|
|
399
|
+
this.secretProxy.setAuthProfilesManager(this.authProfilesManager);
|
|
400
|
+
for (const provider of (0, module_system_1.getModelProviderModules)()) {
|
|
401
|
+
const upstream = (_c = provider.getUpstreamConfig) === null || _c === void 0 ? void 0 : _c.call(provider);
|
|
402
|
+
if (upstream) {
|
|
403
|
+
this.secretProxy.registerUpstream(upstream, provider.providerId);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
// Register system key resolver for fallback when no per-agent auth profile exists
|
|
407
|
+
const modules = (0, module_system_1.getModelProviderModules)();
|
|
408
|
+
this.secretProxy.setSystemKeyResolver((providerId) => {
|
|
409
|
+
const mod = modules.find((m) => m.providerId === providerId);
|
|
410
|
+
if (!mod)
|
|
411
|
+
return undefined;
|
|
412
|
+
// Use the module's injectSystemKeyFallback to resolve the system key.
|
|
413
|
+
// The fallback may inject into a different env var than credentialEnvVarName
|
|
414
|
+
// (e.g., Claude injects ANTHROPIC_API_KEY, not CLAUDE_CODE_OAUTH_TOKEN),
|
|
415
|
+
// so check all secret env var names.
|
|
416
|
+
const testEnv = {};
|
|
417
|
+
mod.injectSystemKeyFallback(testEnv);
|
|
418
|
+
for (const varName of mod.getSecretEnvVarNames()) {
|
|
419
|
+
if (testEnv[varName])
|
|
420
|
+
return testEnv[varName];
|
|
421
|
+
}
|
|
422
|
+
return testEnv[mod.getCredentialEnvVarName()] || undefined;
|
|
423
|
+
});
|
|
424
|
+
logger.debug("Provider upstreams registered with secret proxy");
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
// ============================================================================
|
|
428
|
+
// 4. MCP Services Initialization
|
|
429
|
+
// ============================================================================
|
|
430
|
+
async initializeMcpServices() {
|
|
431
|
+
if (!this.queue) {
|
|
432
|
+
throw new Error("Queue must be initialized before MCP services");
|
|
433
|
+
}
|
|
434
|
+
const redisClient = this.queue.getRedisClient();
|
|
435
|
+
// Initialize simplified MCP config service (no OAuth discovery)
|
|
436
|
+
this.mcpConfigService = new config_service_1.McpConfigService({
|
|
437
|
+
agentSettingsStore: this.agentSettingsStore,
|
|
438
|
+
configResolver: this.systemConfigResolver,
|
|
439
|
+
});
|
|
440
|
+
// Initialize instruction service (needed by WorkerGateway)
|
|
441
|
+
this.instructionService = new instruction_service_1.InstructionService(this.mcpConfigService, this.agentSettingsStore);
|
|
442
|
+
logger.debug("Instruction service initialized");
|
|
443
|
+
// Initialize MCP tool cache and proxy
|
|
444
|
+
const mcpToolCache = new tool_cache_1.McpToolCache(redisClient);
|
|
445
|
+
this.mcpProxy = new proxy_1.McpProxy(this.mcpConfigService, this.queue, mcpToolCache, this.grantStore);
|
|
446
|
+
logger.debug("MCP proxy initialized");
|
|
447
|
+
// Initialize worker gateway
|
|
448
|
+
if (!this.sessionManager) {
|
|
449
|
+
throw new Error("Session manager must be initialized before worker gateway");
|
|
450
|
+
}
|
|
451
|
+
this.workerGateway = new gateway_1.WorkerGateway(this.queue, this.config.mcp.publicGatewayUrl, this.sessionManager, this.mcpConfigService, this.instructionService, this.mcpProxy, this.providerCatalogService, this.settingsResolver, this.systemSkillsService);
|
|
452
|
+
logger.debug("Worker gateway initialized");
|
|
453
|
+
// Discover and initialize all available modules
|
|
454
|
+
await core_1.moduleRegistry.registerAvailableModules();
|
|
455
|
+
await core_1.moduleRegistry.initAll();
|
|
456
|
+
logger.debug("Modules initialized");
|
|
457
|
+
}
|
|
458
|
+
// ============================================================================
|
|
459
|
+
// 7. Command Registry Initialization
|
|
460
|
+
// ============================================================================
|
|
461
|
+
initializeCommandRegistry() {
|
|
462
|
+
if (!this.agentSettingsStore) {
|
|
463
|
+
throw new Error("Agent settings store must be initialized before command registry");
|
|
464
|
+
}
|
|
465
|
+
this.commandRegistry = new core_1.CommandRegistry();
|
|
466
|
+
(0, built_in_commands_1.registerBuiltInCommands)(this.commandRegistry, {
|
|
467
|
+
agentSettingsStore: this.agentSettingsStore,
|
|
468
|
+
});
|
|
469
|
+
logger.debug("Command registry initialized with built-in commands");
|
|
470
|
+
}
|
|
471
|
+
// ============================================================================
|
|
472
|
+
// File-First Helpers
|
|
473
|
+
// ============================================================================
|
|
474
|
+
async populateStoreFromFiles(store, agents) {
|
|
475
|
+
for (const agent of agents) {
|
|
476
|
+
await store.saveMetadata(agent.agentId, {
|
|
477
|
+
agentId: agent.agentId,
|
|
478
|
+
name: agent.name,
|
|
479
|
+
description: agent.description,
|
|
480
|
+
owner: { platform: "system", userId: "manifest" },
|
|
481
|
+
createdAt: Date.now(),
|
|
482
|
+
});
|
|
483
|
+
await store.saveSettings(agent.agentId, Object.assign(Object.assign({}, agent.settings), { updatedAt: Date.now() }));
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
buildSettingsFromAgentConfig(agent) {
|
|
487
|
+
var _a, _b, _c;
|
|
488
|
+
const settings = {};
|
|
489
|
+
if (agent.identityMd)
|
|
490
|
+
settings.identityMd = agent.identityMd;
|
|
491
|
+
if (agent.soulMd)
|
|
492
|
+
settings.soulMd = agent.soulMd;
|
|
493
|
+
if (agent.userMd)
|
|
494
|
+
settings.userMd = agent.userMd;
|
|
495
|
+
if ((_a = agent.providers) === null || _a === void 0 ? void 0 : _a.length) {
|
|
496
|
+
settings.installedProviders = agent.providers.map((p) => ({
|
|
497
|
+
providerId: p.id,
|
|
498
|
+
installedAt: Date.now(),
|
|
499
|
+
}));
|
|
500
|
+
settings.modelSelection = { mode: "auto" };
|
|
501
|
+
const providerModelPreferences = Object.fromEntries(agent.providers
|
|
502
|
+
.filter((p) => { var _a; return !!((_a = p.model) === null || _a === void 0 ? void 0 : _a.trim()); })
|
|
503
|
+
.map((p) => [p.id, p.model.trim()]));
|
|
504
|
+
if (Object.keys(providerModelPreferences).length > 0) {
|
|
505
|
+
settings.providerModelPreferences = providerModelPreferences;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
if ((_b = agent.skills) === null || _b === void 0 ? void 0 : _b.mcp) {
|
|
509
|
+
settings.mcpServers = agent.skills.mcp;
|
|
510
|
+
}
|
|
511
|
+
if (agent.network) {
|
|
512
|
+
settings.networkConfig = {
|
|
513
|
+
allowedDomains: agent.network.allowed,
|
|
514
|
+
deniedDomains: agent.network.denied,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
if ((_c = agent.nixPackages) === null || _c === void 0 ? void 0 : _c.length) {
|
|
518
|
+
settings.nixConfig = { packages: agent.nixPackages };
|
|
519
|
+
}
|
|
520
|
+
return settings;
|
|
521
|
+
}
|
|
522
|
+
async syncAgentSettingsToRuntimeStore(agentId, settings) {
|
|
523
|
+
if (!this.agentSettingsStore) {
|
|
524
|
+
throw new Error("Agent settings store must be initialized");
|
|
525
|
+
}
|
|
526
|
+
const existing = await this.agentSettingsStore.getSettings(agentId);
|
|
527
|
+
await this.agentSettingsStore.saveSettings(agentId, Object.assign(Object.assign({}, settings), { authProfiles: existing === null || existing === void 0 ? void 0 : existing.authProfiles, mcpInstallNotified: existing === null || existing === void 0 ? void 0 : existing.mcpInstallNotified }));
|
|
528
|
+
}
|
|
529
|
+
async populateStoreFromAgentConfigs(store, agents) {
|
|
530
|
+
for (const agent of agents) {
|
|
531
|
+
await store.saveMetadata(agent.id, {
|
|
532
|
+
agentId: agent.id,
|
|
533
|
+
name: agent.name,
|
|
534
|
+
description: agent.description,
|
|
535
|
+
owner: { platform: "system", userId: "config" },
|
|
536
|
+
createdAt: Date.now(),
|
|
537
|
+
});
|
|
538
|
+
await store.saveSettings(agent.id, Object.assign(Object.assign({}, this.buildSettingsFromAgentConfig(agent)), { updatedAt: Date.now() }));
|
|
539
|
+
}
|
|
540
|
+
// Store agent configs for credential seeding and connection seeding later
|
|
541
|
+
this.configAgents = agents;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Reload agent config from files (dev mode only).
|
|
545
|
+
* Re-reads lobu.toml + markdown, clears and re-populates the in-memory store.
|
|
546
|
+
*/
|
|
547
|
+
async reloadFromFiles() {
|
|
548
|
+
var _a, _b;
|
|
549
|
+
if (!this.projectPath) {
|
|
550
|
+
return { reloaded: false, agents: [] };
|
|
551
|
+
}
|
|
552
|
+
// Re-load from disk
|
|
553
|
+
this.fileLoadedAgents = await (0, file_loader_1.loadAgentConfigFromFiles)(this.projectPath);
|
|
554
|
+
// Re-populate the in-memory store (clear existing data first)
|
|
555
|
+
if (this.configStore instanceof in_memory_agent_store_1.InMemoryAgentStore) {
|
|
556
|
+
const store = this.configStore;
|
|
557
|
+
// Clear existing agents by loading fresh
|
|
558
|
+
const existing = await store.listAgents();
|
|
559
|
+
for (const meta of existing) {
|
|
560
|
+
// Only clear file-managed agents (owner: system/manifest)
|
|
561
|
+
if (((_a = meta.owner) === null || _a === void 0 ? void 0 : _a.platform) === "system" &&
|
|
562
|
+
((_b = meta.owner) === null || _b === void 0 ? void 0 : _b.userId) === "manifest") {
|
|
563
|
+
await store.deleteSettings(meta.agentId);
|
|
564
|
+
await store.deleteMetadata(meta.agentId);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
await this.populateStoreFromFiles(store, this.fileLoadedAgents);
|
|
568
|
+
}
|
|
569
|
+
if (this.agentSettingsStore) {
|
|
570
|
+
for (const agent of this.fileLoadedAgents) {
|
|
571
|
+
await this.syncAgentSettingsToRuntimeStore(agent.agentId, agent.settings);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
// Re-seed credentials
|
|
575
|
+
if (this.authProfilesManager) {
|
|
576
|
+
for (const agent of this.fileLoadedAgents) {
|
|
577
|
+
for (const cred of agent.credentials) {
|
|
578
|
+
await this.authProfilesManager.upsertProfile({
|
|
579
|
+
agentId: agent.agentId,
|
|
580
|
+
provider: cred.provider,
|
|
581
|
+
credential: cred.key,
|
|
582
|
+
authType: "api-key",
|
|
583
|
+
label: `${cred.provider} (from lobu.toml)`,
|
|
584
|
+
makePrimary: true,
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
const agentIds = this.fileLoadedAgents.map((a) => a.agentId);
|
|
590
|
+
logger.info(`Reloaded ${agentIds.length} agent(s) from files`);
|
|
591
|
+
return { reloaded: true, agents: agentIds };
|
|
592
|
+
}
|
|
593
|
+
getFileLoadedAgents() {
|
|
594
|
+
return this.fileLoadedAgents;
|
|
595
|
+
}
|
|
596
|
+
getConfigAgents() {
|
|
597
|
+
return this.configAgents;
|
|
598
|
+
}
|
|
599
|
+
getProjectPath() {
|
|
600
|
+
return this.projectPath;
|
|
601
|
+
}
|
|
602
|
+
isFileFirstMode() {
|
|
603
|
+
return this.projectPath !== null;
|
|
604
|
+
}
|
|
605
|
+
// ============================================================================
|
|
606
|
+
// Shutdown
|
|
607
|
+
// ============================================================================
|
|
608
|
+
async shutdown() {
|
|
609
|
+
logger.info("Shutting down core services...");
|
|
610
|
+
if (this.tokenRefreshJob) {
|
|
611
|
+
this.tokenRefreshJob.stop();
|
|
612
|
+
}
|
|
613
|
+
if (this.queueProducer) {
|
|
614
|
+
await this.queueProducer.stop();
|
|
615
|
+
}
|
|
616
|
+
if (this.workerGateway) {
|
|
617
|
+
this.workerGateway.shutdown();
|
|
618
|
+
logger.info("Worker gateway shutdown complete");
|
|
619
|
+
}
|
|
620
|
+
if (this.queue) {
|
|
621
|
+
await this.queue.stop();
|
|
622
|
+
}
|
|
623
|
+
logger.info("Core services shutdown complete");
|
|
624
|
+
}
|
|
625
|
+
// ============================================================================
|
|
626
|
+
// Service Accessors (implements ICoreServices interface)
|
|
627
|
+
// ============================================================================
|
|
628
|
+
getQueue() {
|
|
629
|
+
if (!this.queue)
|
|
630
|
+
throw new Error("Queue not initialized");
|
|
631
|
+
return this.queue;
|
|
632
|
+
}
|
|
633
|
+
getQueueProducer() {
|
|
634
|
+
if (!this.queueProducer)
|
|
635
|
+
throw new Error("Queue producer not initialized");
|
|
636
|
+
return this.queueProducer;
|
|
637
|
+
}
|
|
638
|
+
getSecretProxy() {
|
|
639
|
+
return this.secretProxy;
|
|
640
|
+
}
|
|
641
|
+
getWorkerGateway() {
|
|
642
|
+
return this.workerGateway;
|
|
643
|
+
}
|
|
644
|
+
getMcpProxy() {
|
|
645
|
+
return this.mcpProxy;
|
|
646
|
+
}
|
|
647
|
+
getMcpConfigService() {
|
|
648
|
+
return this.mcpConfigService;
|
|
649
|
+
}
|
|
650
|
+
getModelPreferenceStore() {
|
|
651
|
+
return this.modelPreferenceStore;
|
|
652
|
+
}
|
|
653
|
+
getOAuthStateStore() {
|
|
654
|
+
return this.oauthStateStore;
|
|
655
|
+
}
|
|
656
|
+
getPublicGatewayUrl() {
|
|
657
|
+
return this.config.mcp.publicGatewayUrl;
|
|
658
|
+
}
|
|
659
|
+
getSessionManager() {
|
|
660
|
+
if (!this.sessionManager)
|
|
661
|
+
throw new Error("Session manager not initialized");
|
|
662
|
+
return this.sessionManager;
|
|
663
|
+
}
|
|
664
|
+
getInstructionService() {
|
|
665
|
+
return this.instructionService;
|
|
666
|
+
}
|
|
667
|
+
getInteractionService() {
|
|
668
|
+
if (!this.interactionService)
|
|
669
|
+
throw new Error("Interaction service not initialized");
|
|
670
|
+
return this.interactionService;
|
|
671
|
+
}
|
|
672
|
+
getAgentSettingsStore() {
|
|
673
|
+
if (!this.agentSettingsStore)
|
|
674
|
+
throw new Error("Agent settings store not initialized");
|
|
675
|
+
return this.agentSettingsStore;
|
|
676
|
+
}
|
|
677
|
+
getChannelBindingService() {
|
|
678
|
+
if (!this.channelBindingService)
|
|
679
|
+
throw new Error("Channel binding service not initialized");
|
|
680
|
+
return this.channelBindingService;
|
|
681
|
+
}
|
|
682
|
+
getScheduledWakeupService() {
|
|
683
|
+
return this.scheduledWakeupService;
|
|
684
|
+
}
|
|
685
|
+
getTranscriptionService() {
|
|
686
|
+
return this.transcriptionService;
|
|
687
|
+
}
|
|
688
|
+
getImageGenerationService() {
|
|
689
|
+
return this.imageGenerationService;
|
|
690
|
+
}
|
|
691
|
+
getUserAgentsStore() {
|
|
692
|
+
if (!this.userAgentsStore)
|
|
693
|
+
throw new Error("User agents store not initialized");
|
|
694
|
+
return this.userAgentsStore;
|
|
695
|
+
}
|
|
696
|
+
getAgentMetadataStore() {
|
|
697
|
+
if (!this.agentMetadataStore)
|
|
698
|
+
throw new Error("Agent metadata store not initialized");
|
|
699
|
+
return this.agentMetadataStore;
|
|
700
|
+
}
|
|
701
|
+
getCommandRegistry() {
|
|
702
|
+
if (!this.commandRegistry)
|
|
703
|
+
throw new Error("Command registry not initialized");
|
|
704
|
+
return this.commandRegistry;
|
|
705
|
+
}
|
|
706
|
+
getProviderCatalogService() {
|
|
707
|
+
if (!this.providerCatalogService)
|
|
708
|
+
throw new Error("Provider catalog service not initialized");
|
|
709
|
+
return this.providerCatalogService;
|
|
710
|
+
}
|
|
711
|
+
getAuthProfilesManager() {
|
|
712
|
+
return this.authProfilesManager;
|
|
713
|
+
}
|
|
714
|
+
getGrantStore() {
|
|
715
|
+
return this.grantStore;
|
|
716
|
+
}
|
|
717
|
+
getSystemSkillsService() {
|
|
718
|
+
return this.systemSkillsService;
|
|
719
|
+
}
|
|
720
|
+
getSystemConfigResolver() {
|
|
721
|
+
return this.systemConfigResolver;
|
|
722
|
+
}
|
|
723
|
+
getExternalAuthClient() {
|
|
724
|
+
return this.externalAuthClient;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
exports.CoreServices = CoreServices;
|
|
728
|
+
//# sourceMappingURL=core-services.js.map
|