manifest 5.45.0 → 6.0.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/CONTRACT.md +50 -0
- package/README.md +69 -100
- package/dist/index.cjs +472 -0
- package/dist/index.d.cts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +443 -12
- package/docs/guide.md +77 -0
- package/package.json +36 -79
- package/dist/backend/analytics/analytics.module.js +0 -60
- package/dist/backend/analytics/controllers/agent-analytics.controller.js +0 -69
- package/dist/backend/analytics/controllers/agents.controller.js +0 -176
- package/dist/backend/analytics/controllers/costs.controller.js +0 -71
- package/dist/backend/analytics/controllers/messages.controller.js +0 -67
- package/dist/backend/analytics/controllers/overview.controller.js +0 -104
- package/dist/backend/analytics/controllers/tokens.controller.js +0 -74
- package/dist/backend/analytics/dto/messages-query.dto.js +0 -73
- package/dist/backend/analytics/services/agent-analytics.service.js +0 -125
- package/dist/backend/analytics/services/agent-lifecycle.service.js +0 -102
- package/dist/backend/analytics/services/aggregation.service.js +0 -205
- package/dist/backend/analytics/services/message-details.service.js +0 -146
- package/dist/backend/analytics/services/messages-query.service.js +0 -196
- package/dist/backend/analytics/services/query-helpers.js +0 -45
- package/dist/backend/analytics/services/timeseries-queries.service.js +0 -237
- package/dist/backend/app.module.js +0 -94
- package/dist/backend/auth/auth.instance.js +0 -121
- package/dist/backend/auth/auth.module.js +0 -17
- package/dist/backend/auth/current-user.decorator.js +0 -9
- package/dist/backend/auth/local-auth.guard.js +0 -51
- package/dist/backend/auth/session.guard.js +0 -57
- package/dist/backend/common/common.module.js +0 -41
- package/dist/backend/common/constants/api-key.constants.js +0 -6
- package/dist/backend/common/constants/cache.constants.js +0 -8
- package/dist/backend/common/constants/local-mode.constants.js +0 -102
- package/dist/backend/common/constants/ollama.js +0 -5
- package/dist/backend/common/constants/providers.js +0 -134
- package/dist/backend/common/decorators/public.decorator.js +0 -8
- package/dist/backend/common/dto/create-agent.dto.js +0 -26
- package/dist/backend/common/dto/range-query.dto.js +0 -29
- package/dist/backend/common/dto/rename-agent.dto.js +0 -26
- package/dist/backend/common/filters/spa-fallback.filter.js +0 -46
- package/dist/backend/common/guards/api-key.guard.js +0 -89
- package/dist/backend/common/interceptors/agent-cache.interceptor.js +0 -39
- package/dist/backend/common/interceptors/user-cache.interceptor.js +0 -39
- package/dist/backend/common/services/ingest-event-bus.service.js +0 -44
- package/dist/backend/common/services/manifest-runtime.service.js +0 -39
- package/dist/backend/common/services/tenant-cache.service.js +0 -56
- package/dist/backend/common/utils/anthropic-model-id.js +0 -36
- package/dist/backend/common/utils/cost-calculator.js +0 -19
- package/dist/backend/common/utils/crypto.util.js +0 -72
- package/dist/backend/common/utils/frontend-path.js +0 -21
- package/dist/backend/common/utils/hash.util.js +0 -32
- package/dist/backend/common/utils/local-ip.js +0 -33
- package/dist/backend/common/utils/period.util.js +0 -55
- package/dist/backend/common/utils/provider-aliases.js +0 -13
- package/dist/backend/common/utils/provider-inference.js +0 -7
- package/dist/backend/common/utils/range.util.js +0 -29
- package/dist/backend/common/utils/slugify.js +0 -13
- package/dist/backend/common/utils/sql-dialect.js +0 -71
- package/dist/backend/common/utils/subscription-support.js +0 -12
- package/dist/backend/common/utils/ttl-cache.js +0 -59
- package/dist/backend/common/utils/url-validation.js +0 -107
- package/dist/backend/config/app.config.js +0 -48
- package/dist/backend/database/database-seeder.service.js +0 -180
- package/dist/backend/database/database.module.js +0 -199
- package/dist/backend/database/datasource.js +0 -28
- package/dist/backend/database/local-bootstrap.service.js +0 -161
- package/dist/backend/database/migrations/1771464895790-InitialSchema.js +0 -91
- package/dist/backend/database/migrations/1771500000000-HashApiKeys.js +0 -67
- package/dist/backend/database/migrations/1771600000000-AddModelCapabilities.js +0 -27
- package/dist/backend/database/migrations/1771600000000-ModelPricingImprovements.js +0 -60
- package/dist/backend/database/migrations/1771700000000-AddRoutingTables.js +0 -50
- package/dist/backend/database/migrations/1771700000000-EmailProviderConfigs.js +0 -31
- package/dist/backend/database/migrations/1771800000000-AddNotificationEmailAndOptionalDomain.js +0 -16
- package/dist/backend/database/migrations/1771800000000-AddQualityScore.js +0 -50
- package/dist/backend/database/migrations/1771800100000-SeedQualityScores.js +0 -45
- package/dist/backend/database/migrations/1771900000000-EncryptApiKeys.js +0 -34
- package/dist/backend/database/migrations/1772000000000-MakeApiKeyNullable.js +0 -16
- package/dist/backend/database/migrations/1772100000000-AddRoutingTier.js +0 -17
- package/dist/backend/database/migrations/1772200000000-AddLimitAction.js +0 -17
- package/dist/backend/database/migrations/1772300000000-AddRoutingReason.js +0 -17
- package/dist/backend/database/migrations/1772400000000-AddAgentDisplayName.js +0 -13
- package/dist/backend/database/migrations/1772500000000-PerAgentRouting.js +0 -82
- package/dist/backend/database/migrations/1772668898071-AddCustomProviders.js +0 -31
- package/dist/backend/database/migrations/1772682112419-NullablePricing.js +0 -17
- package/dist/backend/database/migrations/1772843035514-AddPerformanceIndexes.js +0 -56
- package/dist/backend/database/migrations/1772900000000-AddProviderAuthType.js +0 -13
- package/dist/backend/database/migrations/1772905146384-AddDashboardIndexes.js +0 -24
- package/dist/backend/database/migrations/1772905260464-AddFallbacks.js +0 -18
- package/dist/backend/database/migrations/1772920000000-AddModelDisplayName.js +0 -14
- package/dist/backend/database/migrations/1772940000000-DropRedundantIndexes.js +0 -39
- package/dist/backend/database/migrations/1772948502780-BackfillTenantId.js +0 -20
- package/dist/backend/database/migrations/1772960000000-DropUnusedIndexes.js +0 -19
- package/dist/backend/database/migrations/1772960000000-PurgeNonCuratedModels.js +0 -86
- package/dist/backend/database/migrations/1773000000000-ExpandProviderUniqueKey.js +0 -19
- package/dist/backend/database/migrations/1773100000000-AddOverrideAuthType.js +0 -18
- package/dist/backend/database/migrations/1773200000000-AddMessageAuthType.js +0 -18
- package/dist/backend/database/migrations/1773202787708-AddModelsAgentIndex.js +0 -16
- package/dist/backend/database/migrations/1773300000000-AddEmailProviderKeyPrefix.js +0 -13
- package/dist/backend/database/migrations/1773400000000-AddProviderModelCache.js +0 -15
- package/dist/backend/database/migrations/1773500000000-DropModelPricingTables.js +0 -51
- package/dist/backend/database/migrations/1773600000000-AddOverrideProvider.js +0 -18
- package/dist/backend/database/migrations/1773650000000-AddProviderRegion.js +0 -13
- package/dist/backend/database/migrations/1773700000000-DropSecurityEventTable.js +0 -24
- package/dist/backend/database/migrations/1773800000000-FixNegativeCosts.js +0 -12
- package/dist/backend/database/migrations/1773900000000-AddKeyPrefixIndex.js +0 -15
- package/dist/backend/database/migrations/1774000000000-WidenKeyHashColumn.js +0 -15
- package/dist/backend/database/migrations/1774896789000-WidenApiKeyColumn.js +0 -14
- package/dist/backend/database/models-dev-sync.service.js +0 -238
- package/dist/backend/database/ollama-sync.service.js +0 -70
- package/dist/backend/database/pricing-sync.service.js +0 -116
- package/dist/backend/database/quality-score.util.js +0 -76
- package/dist/backend/database/seed-messages.js +0 -66
- package/dist/backend/entities/agent-api-key.entity.js +0 -91
- package/dist/backend/entities/agent-log.entity.js +0 -71
- package/dist/backend/entities/agent-message.entity.js +0 -158
- package/dist/backend/entities/agent.entity.js +0 -75
- package/dist/backend/entities/api-key.entity.js +0 -62
- package/dist/backend/entities/cost-snapshot.entity.js +0 -56
- package/dist/backend/entities/custom-provider.entity.js +0 -64
- package/dist/backend/entities/email-provider-config.entity.js +0 -72
- package/dist/backend/entities/llm-call.entity.js +0 -106
- package/dist/backend/entities/notification-log.entity.js +0 -67
- package/dist/backend/entities/notification-rule.entity.js +0 -84
- package/dist/backend/entities/tenant.entity.js +0 -62
- package/dist/backend/entities/tier-assignment.entity.js +0 -72
- package/dist/backend/entities/token-usage-snapshot.entity.js +0 -71
- package/dist/backend/entities/tool-execution.entity.js +0 -60
- package/dist/backend/entities/user-provider.entity.js +0 -87
- package/dist/backend/github/github.controller.js +0 -53
- package/dist/backend/github/github.module.js +0 -20
- package/dist/backend/health/health.controller.js +0 -51
- package/dist/backend/health/health.module.js +0 -22
- package/dist/backend/health/version-check.service.js +0 -95
- package/dist/backend/main.js +0 -153
- package/dist/backend/model-discovery/anthropic-subscription-probe.js +0 -87
- package/dist/backend/model-discovery/known-model-prices.js +0 -18
- package/dist/backend/model-discovery/model-discovery.module.js +0 -28
- package/dist/backend/model-discovery/model-discovery.service.js +0 -309
- package/dist/backend/model-discovery/model-fallback.js +0 -234
- package/dist/backend/model-discovery/model-fetcher.js +0 -3
- package/dist/backend/model-discovery/provider-model-fetcher.service.js +0 -376
- package/dist/backend/model-discovery/provider-model-registry.service.js +0 -84
- package/dist/backend/model-prices/model-name-normalizer.js +0 -129
- package/dist/backend/model-prices/model-prices.controller.js +0 -39
- package/dist/backend/model-prices/model-prices.module.js +0 -41
- package/dist/backend/model-prices/model-prices.service.js +0 -45
- package/dist/backend/model-prices/model-pricing-cache.service.js +0 -171
- package/dist/backend/notifications/dto/notification-rule.dto.js +0 -82
- package/dist/backend/notifications/dto/set-email-provider.dto.js +0 -86
- package/dist/backend/notifications/dto/set-notification-email.dto.js +0 -24
- package/dist/backend/notifications/emails/reset-password.js +0 -108
- package/dist/backend/notifications/emails/test-email.js +0 -91
- package/dist/backend/notifications/emails/threshold-alert.js +0 -187
- package/dist/backend/notifications/emails/verify-email.js +0 -108
- package/dist/backend/notifications/notifications.controller.js +0 -208
- package/dist/backend/notifications/notifications.module.js +0 -35
- package/dist/backend/notifications/services/email-provider-config.service.js +0 -184
- package/dist/backend/notifications/services/email-provider-validation.js +0 -47
- package/dist/backend/notifications/services/email-providers/email-provider.interface.js +0 -3
- package/dist/backend/notifications/services/email-providers/mailgun.provider.js +0 -62
- package/dist/backend/notifications/services/email-providers/resend.provider.js +0 -51
- package/dist/backend/notifications/services/email-providers/resolve-provider.js +0 -19
- package/dist/backend/notifications/services/email-providers/send-email.js +0 -34
- package/dist/backend/notifications/services/email-providers/sendgrid.provider.js +0 -59
- package/dist/backend/notifications/services/limit-check.service.js +0 -160
- package/dist/backend/notifications/services/notification-cron.service.js +0 -151
- package/dist/backend/notifications/services/notification-email.service.js +0 -65
- package/dist/backend/notifications/services/notification-log.service.js +0 -84
- package/dist/backend/notifications/services/notification-rules.service.js +0 -156
- package/dist/backend/otlp/guards/agent-key-auth.guard.js +0 -226
- package/dist/backend/otlp/interfaces/ingestion-context.interface.js +0 -3
- package/dist/backend/otlp/otlp-deprecated.controller.js +0 -61
- package/dist/backend/otlp/otlp.module.js +0 -30
- package/dist/backend/otlp/services/api-key.service.js +0 -143
- package/dist/backend/public-stats/public-stats.controller.js +0 -141
- package/dist/backend/public-stats/public-stats.module.js +0 -26
- package/dist/backend/public-stats/public-stats.service.js +0 -226
- package/dist/backend/routing/copilot.controller.js +0 -79
- package/dist/backend/routing/custom-provider/custom-provider.controller.js +0 -131
- package/dist/backend/routing/custom-provider/custom-provider.module.js +0 -27
- package/dist/backend/routing/custom-provider/custom-provider.service.js +0 -161
- package/dist/backend/routing/dto/custom-provider.dto.js +0 -124
- package/dist/backend/routing/dto/resolve-request.dto.js +0 -63
- package/dist/backend/routing/dto/resolve-response.js +0 -3
- package/dist/backend/routing/dto/routing.dto.js +0 -136
- package/dist/backend/routing/model.controller.js +0 -105
- package/dist/backend/routing/oauth/copilot-device-auth.service.js +0 -77
- package/dist/backend/routing/oauth/minimax-oauth-helpers.js +0 -70
- package/dist/backend/routing/oauth/minimax-oauth.controller.js +0 -80
- package/dist/backend/routing/oauth/minimax-oauth.service.js +0 -252
- package/dist/backend/routing/oauth/oauth.module.js +0 -29
- package/dist/backend/routing/oauth/openai-oauth.controller.js +0 -138
- package/dist/backend/routing/oauth/openai-oauth.service.js +0 -273
- package/dist/backend/routing/oauth/openai-oauth.types.js +0 -45
- package/dist/backend/routing/provider-base-url.js +0 -25
- package/dist/backend/routing/provider.controller.js +0 -152
- package/dist/backend/routing/proxy/anthropic-adapter.js +0 -295
- package/dist/backend/routing/proxy/cache-injection.js +0 -33
- package/dist/backend/routing/proxy/chatgpt-adapter.js +0 -272
- package/dist/backend/routing/proxy/chatgpt-helpers.js +0 -108
- package/dist/backend/routing/proxy/copilot-token.service.js +0 -63
- package/dist/backend/routing/proxy/fallback-status-codes.js +0 -7
- package/dist/backend/routing/proxy/google-adapter.js +0 -314
- package/dist/backend/routing/proxy/provider-client-converters.js +0 -190
- package/dist/backend/routing/proxy/provider-client.js +0 -130
- package/dist/backend/routing/proxy/provider-endpoints.js +0 -182
- package/dist/backend/routing/proxy/proxy-error-sanitizer.js +0 -40
- package/dist/backend/routing/proxy/proxy-exception.filter.js +0 -67
- package/dist/backend/routing/proxy/proxy-fallback.service.js +0 -227
- package/dist/backend/routing/proxy/proxy-friendly-response.js +0 -115
- package/dist/backend/routing/proxy/proxy-message-dedup.js +0 -121
- package/dist/backend/routing/proxy/proxy-message-recorder.js +0 -262
- package/dist/backend/routing/proxy/proxy-rate-limiter.js +0 -81
- package/dist/backend/routing/proxy/proxy-response-handler.js +0 -202
- package/dist/backend/routing/proxy/proxy-transport.js +0 -90
- package/dist/backend/routing/proxy/proxy-types.js +0 -3
- package/dist/backend/routing/proxy/proxy.controller.js +0 -174
- package/dist/backend/routing/proxy/proxy.module.js +0 -62
- package/dist/backend/routing/proxy/proxy.service.js +0 -227
- package/dist/backend/routing/proxy/session-momentum.service.js +0 -66
- package/dist/backend/routing/proxy/stream-writer.js +0 -147
- package/dist/backend/routing/proxy/thought-signature-cache.js +0 -45
- package/dist/backend/routing/qwen-region.js +0 -51
- package/dist/backend/routing/resolve/resolve.controller.js +0 -106
- package/dist/backend/routing/resolve/resolve.module.js +0 -28
- package/dist/backend/routing/resolve/resolve.service.js +0 -126
- package/dist/backend/routing/routing-core/provider-key.service.js +0 -190
- package/dist/backend/routing/routing-core/provider.service.js +0 -305
- package/dist/backend/routing/routing-core/resolve-agent.service.js +0 -62
- package/dist/backend/routing/routing-core/routing-cache.service.js +0 -73
- package/dist/backend/routing/routing-core/routing-core.module.js +0 -56
- package/dist/backend/routing/routing-core/routing-invalidation.service.js +0 -90
- package/dist/backend/routing/routing-core/tier-auto-assign.service.js +0 -138
- package/dist/backend/routing/routing-core/tier.service.js +0 -179
- package/dist/backend/routing/routing.module.js +0 -46
- package/dist/backend/routing/tier.controller.js +0 -129
- package/dist/backend/scoring/__tests__/fixtures.js +0 -191
- package/dist/backend/scoring/config.js +0 -383
- package/dist/backend/scoring/dimensions/contextual-dimensions.js +0 -85
- package/dist/backend/scoring/dimensions/index.js +0 -17
- package/dist/backend/scoring/dimensions/keyword-dimensions.js +0 -47
- package/dist/backend/scoring/dimensions/structural-dimensions.js +0 -118
- package/dist/backend/scoring/index.js +0 -186
- package/dist/backend/scoring/keyword-trie.js +0 -75
- package/dist/backend/scoring/momentum.js +0 -50
- package/dist/backend/scoring/overrides.js +0 -55
- package/dist/backend/scoring/sigmoid.js +0 -24
- package/dist/backend/scoring/text-extractor.js +0 -67
- package/dist/backend/scoring/types.js +0 -6
- package/dist/backend/sse/sse.controller.js +0 -45
- package/dist/backend/sse/sse.module.js +0 -20
- package/dist/node_modules/manifest-shared/dist/cjs/api-key.d.ts +0 -2
- package/dist/node_modules/manifest-shared/dist/cjs/api-key.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/api-key.js +0 -5
- package/dist/node_modules/manifest-shared/dist/cjs/api-key.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/auth-types.d.ts +0 -3
- package/dist/node_modules/manifest-shared/dist/cjs/auth-types.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/auth-types.js +0 -5
- package/dist/node_modules/manifest-shared/dist/cjs/auth-types.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/index.d.ts +0 -10
- package/dist/node_modules/manifest-shared/dist/cjs/index.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/index.js +0 -22
- package/dist/node_modules/manifest-shared/dist/cjs/index.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.d.ts +0 -8
- package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.js +0 -37
- package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.d.ts +0 -12
- package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.js +0 -3
- package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.d.ts +0 -4
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.js +0 -80
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.d.ts +0 -6
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.js +0 -25
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.d.ts +0 -4
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.js +0 -12
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.d.ts +0 -17
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.js +0 -3
- package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/tiers.d.ts +0 -5
- package/dist/node_modules/manifest-shared/dist/cjs/tiers.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/cjs/tiers.js +0 -17
- package/dist/node_modules/manifest-shared/dist/cjs/tiers.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/api-key.d.ts +0 -2
- package/dist/node_modules/manifest-shared/dist/esm/api-key.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/api-key.js +0 -2
- package/dist/node_modules/manifest-shared/dist/esm/api-key.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/auth-types.d.ts +0 -3
- package/dist/node_modules/manifest-shared/dist/esm/auth-types.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/auth-types.js +0 -2
- package/dist/node_modules/manifest-shared/dist/esm/auth-types.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/index.d.ts +0 -10
- package/dist/node_modules/manifest-shared/dist/esm/index.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/index.js +0 -6
- package/dist/node_modules/manifest-shared/dist/esm/index.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/provider-inference.d.ts +0 -8
- package/dist/node_modules/manifest-shared/dist/esm/provider-inference.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/provider-inference.js +0 -33
- package/dist/node_modules/manifest-shared/dist/esm/provider-inference.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/resolve-response.d.ts +0 -12
- package/dist/node_modules/manifest-shared/dist/esm/resolve-response.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/resolve-response.js +0 -2
- package/dist/node_modules/manifest-shared/dist/esm/resolve-response.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.d.ts +0 -4
- package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.js +0 -77
- package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.d.ts +0 -6
- package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.js +0 -19
- package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/subscription/index.d.ts +0 -4
- package/dist/node_modules/manifest-shared/dist/esm/subscription/index.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/subscription/index.js +0 -3
- package/dist/node_modules/manifest-shared/dist/esm/subscription/index.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/subscription/types.d.ts +0 -17
- package/dist/node_modules/manifest-shared/dist/esm/subscription/types.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/subscription/types.js +0 -2
- package/dist/node_modules/manifest-shared/dist/esm/subscription/types.js.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/tiers.d.ts +0 -5
- package/dist/node_modules/manifest-shared/dist/esm/tiers.d.ts.map +0 -1
- package/dist/node_modules/manifest-shared/dist/esm/tiers.js +0 -14
- package/dist/node_modules/manifest-shared/dist/esm/tiers.js.map +0 -1
- package/dist/node_modules/manifest-shared/package.json +0 -26
- package/dist/openclaw.plugin.json +0 -37
- package/dist/package.json +0 -94
- package/dist/server.d.ts +0 -8
- package/dist/server.js +0 -69
- package/openclaw.plugin.json +0 -37
- package/public/assets/Account-B_3C4z7e.js +0 -1
- package/public/assets/AuthBadge-Dj2KkXRW.js +0 -1
- package/public/assets/ConnectProvider-DxPYovG2.js +0 -1
- package/public/assets/CopyButton-BWMVlK2w.js +0 -1
- package/public/assets/FreeModels-BzNWxfZl.js +0 -1
- package/public/assets/Help-ifWIlcDo.js +0 -1
- package/public/assets/Limits-BLW0fW8j.js +0 -1
- package/public/assets/Login-DvUR0ri0.js +0 -1
- package/public/assets/MessageLog-BsuwgHos.js +0 -1
- package/public/assets/ModelPrices-8EpyI4cZ.js +0 -1
- package/public/assets/Overview-B2DQeTd2.js +0 -1
- package/public/assets/Pagination-D8BOkffh.js +0 -1
- package/public/assets/ProviderTokens-nv6wk29Y.js +0 -1
- package/public/assets/Register-WBrQ1E73.js +0 -1
- package/public/assets/ResetPassword-CWdklAXJ.js +0 -1
- package/public/assets/Routing-BqfY1unJ.js +0 -6
- package/public/assets/Settings-na6aYffS.js +0 -1
- package/public/assets/SetupStepAddProvider-CSNkQmoC.js +0 -3
- package/public/assets/SocialButtons-DG2BtKEz.js +0 -1
- package/public/assets/auth-Bcnz6mJV.js +0 -1
- package/public/assets/chart-utils-DTt1NOye.js +0 -1
- package/public/assets/charts-Cty976qB.js +0 -3
- package/public/assets/charts-Saz_VHki.css +0 -1
- package/public/assets/index-ByYwCwOa.js +0 -2
- package/public/assets/index-DhaXpWfr.css +0 -1
- package/public/assets/model-display-Bd0Zg5Lp.js +0 -1
- package/public/assets/overview-B6Wy_RSw.js +0 -1
- package/public/assets/overview-vZEzTjBP.css +0 -1
- package/public/assets/provider-api-key-urls-1G6okUJ7.js +0 -1
- package/public/assets/routing-UGVXjYdE.js +0 -1
- package/public/assets/routing-utils-BVCa9TKk.js +0 -1
- package/public/assets/vendor-C-Y5oNOq.js +0 -1
- package/public/example-messages.svg +0 -1
- package/public/example-overview.svg +0 -1
- package/public/favicon.ico +0 -0
- package/public/fonts/boxicons/boxicons-duotone.min.css +0 -37
- package/public/fonts/boxicons/boxicons-duotone.woff2 +0 -0
- package/public/fonts/bricolage-grotesque-latin.woff2 +0 -0
- package/public/fonts/dm-sans-latin.woff2 +0 -0
- package/public/fonts/jetbrains-mono-latin.woff2 +0 -0
- package/public/icons/caret-down.svg +0 -1
- package/public/icons/cohere.svg +0 -30
- package/public/icons/free.svg +0 -91
- package/public/icons/gemini.svg +0 -25
- package/public/icons/kilocode.jpg +0 -0
- package/public/icons/nvidia.svg +0 -1
- package/public/icons/providers/alibaba.svg +0 -1
- package/public/icons/providers/amazon.svg +0 -1
- package/public/icons/providers/anthropic.svg +0 -1
- package/public/icons/providers/cohere.svg +0 -1
- package/public/icons/providers/deepseek.svg +0 -1
- package/public/icons/providers/google.svg +0 -1
- package/public/icons/providers/meta.svg +0 -1
- package/public/icons/providers/mistral.svg +0 -1
- package/public/icons/providers/moonshot.svg +0 -1
- package/public/icons/providers/openai.svg +0 -1
- package/public/icons/providers/xai.svg +0 -1
- package/public/icons/providers/zhipu.svg +0 -1
- package/public/icons/qwen.svg +0 -1
- package/public/images/oauth-callback-example.mp4 +0 -0
- package/public/images/oauth-callback-example.png +0 -0
- package/public/index.html +0 -41
- package/public/logo-white.svg +0 -93
- package/public/logo.svg +0 -93
- package/public/logos/mailgun.svg +0 -13
- package/public/logos/resend.svg +0 -4
- package/public/logos/sendgrid.svg +0 -18
- package/public/manifest-logo.png +0 -0
- package/public/theme-init.js +0 -6
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.auth = void 0;
|
|
4
|
-
const better_auth_1 = require("better-auth");
|
|
5
|
-
const render_1 = require("@react-email/render");
|
|
6
|
-
const verify_email_1 = require("../notifications/emails/verify-email");
|
|
7
|
-
const reset_password_1 = require("../notifications/emails/reset-password");
|
|
8
|
-
const send_email_1 = require("../notifications/services/email-providers/send-email");
|
|
9
|
-
const local_mode_constants_1 = require("../common/constants/local-mode.constants");
|
|
10
|
-
const isLocalMode = process.env['MANIFEST_MODE'] === 'local';
|
|
11
|
-
const port = process.env['PORT'] ?? '3001';
|
|
12
|
-
const isDev = (process.env['NODE_ENV'] ?? '') !== 'production';
|
|
13
|
-
const hasEmailProvider = !!(process.env['MAILGUN_API_KEY'] && process.env['MAILGUN_DOMAIN']);
|
|
14
|
-
function createDatabaseConnection() {
|
|
15
|
-
if (isLocalMode) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
const { Pool } = require('pg');
|
|
19
|
-
const databaseUrl = process.env['DATABASE_URL'] ?? 'postgresql://myuser:mypassword@localhost:5432/mydatabase';
|
|
20
|
-
return new Pool({ connectionString: databaseUrl });
|
|
21
|
-
}
|
|
22
|
-
const database = createDatabaseConnection();
|
|
23
|
-
const betterAuthSecret = process.env['BETTER_AUTH_SECRET'] ?? '';
|
|
24
|
-
const nodeEnv = process.env['NODE_ENV'] ?? '';
|
|
25
|
-
if (!isLocalMode && nodeEnv !== 'test' && (!betterAuthSecret || betterAuthSecret.length < 32)) {
|
|
26
|
-
throw new Error('BETTER_AUTH_SECRET must be set to a value of at least 32 characters');
|
|
27
|
-
}
|
|
28
|
-
function buildTrustedOrigins() {
|
|
29
|
-
const origins = [];
|
|
30
|
-
if (process.env['BETTER_AUTH_URL']) {
|
|
31
|
-
origins.push(process.env['BETTER_AUTH_URL']);
|
|
32
|
-
}
|
|
33
|
-
if (process.env['CORS_ORIGIN']) {
|
|
34
|
-
origins.push(process.env['CORS_ORIGIN']);
|
|
35
|
-
}
|
|
36
|
-
if (isDev || isLocalMode) {
|
|
37
|
-
origins.push(`http://localhost:3000`, `http://localhost:${port}`);
|
|
38
|
-
}
|
|
39
|
-
if (isLocalMode) {
|
|
40
|
-
origins.push(`http://127.0.0.1:${port}`, `http://127.0.0.1:3000`);
|
|
41
|
-
}
|
|
42
|
-
if (process.env['FRONTEND_PORT']) {
|
|
43
|
-
origins.push(`http://localhost:${process.env['FRONTEND_PORT']}`);
|
|
44
|
-
}
|
|
45
|
-
return origins;
|
|
46
|
-
}
|
|
47
|
-
const authInstance = isLocalMode
|
|
48
|
-
? null
|
|
49
|
-
: (0, better_auth_1.betterAuth)({
|
|
50
|
-
database: database,
|
|
51
|
-
baseURL: process.env['BETTER_AUTH_URL'] ?? `http://localhost:${port}`,
|
|
52
|
-
basePath: '/api/auth',
|
|
53
|
-
secret: betterAuthSecret || (0, local_mode_constants_1.getLocalAuthSecret)(),
|
|
54
|
-
logger: { level: 'debug' },
|
|
55
|
-
telemetry: { enabled: false },
|
|
56
|
-
account: {
|
|
57
|
-
accountLinking: {
|
|
58
|
-
enabled: true,
|
|
59
|
-
trustedProviders: ['google', 'github', 'discord'],
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
emailAndPassword: {
|
|
63
|
-
enabled: true,
|
|
64
|
-
minPasswordLength: 8,
|
|
65
|
-
requireEmailVerification: !isDev && !isLocalMode && hasEmailProvider,
|
|
66
|
-
sendResetPassword: async ({ user, url }) => {
|
|
67
|
-
const element = (0, reset_password_1.ResetPasswordEmail)({
|
|
68
|
-
userName: user.name,
|
|
69
|
-
resetUrl: url,
|
|
70
|
-
});
|
|
71
|
-
const html = await (0, render_1.render)(element);
|
|
72
|
-
const text = await (0, render_1.render)(element, { plainText: true });
|
|
73
|
-
void (0, send_email_1.sendEmail)({
|
|
74
|
-
to: user.email,
|
|
75
|
-
subject: 'Reset your password',
|
|
76
|
-
html,
|
|
77
|
-
text,
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
emailVerification: {
|
|
82
|
-
sendOnSignUp: !isLocalMode && hasEmailProvider,
|
|
83
|
-
autoSignInAfterVerification: true,
|
|
84
|
-
sendVerificationEmail: async ({ user, url }) => {
|
|
85
|
-
const element = (0, verify_email_1.VerifyEmailEmail)({
|
|
86
|
-
userName: user.name,
|
|
87
|
-
verificationUrl: url,
|
|
88
|
-
});
|
|
89
|
-
const html = await (0, render_1.render)(element);
|
|
90
|
-
const text = await (0, render_1.render)(element, { plainText: true });
|
|
91
|
-
void (0, send_email_1.sendEmail)({
|
|
92
|
-
to: user.email,
|
|
93
|
-
subject: 'Verify your email address',
|
|
94
|
-
html,
|
|
95
|
-
text,
|
|
96
|
-
});
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
socialProviders: {
|
|
100
|
-
google: {
|
|
101
|
-
clientId: process.env['GOOGLE_CLIENT_ID'] ?? '',
|
|
102
|
-
clientSecret: process.env['GOOGLE_CLIENT_SECRET'] ?? '',
|
|
103
|
-
enabled: !!(process.env['GOOGLE_CLIENT_ID'] && process.env['GOOGLE_CLIENT_SECRET']),
|
|
104
|
-
},
|
|
105
|
-
github: {
|
|
106
|
-
clientId: process.env['GITHUB_CLIENT_ID'] ?? '',
|
|
107
|
-
clientSecret: process.env['GITHUB_CLIENT_SECRET'] ?? '',
|
|
108
|
-
enabled: !!(process.env['GITHUB_CLIENT_ID'] && process.env['GITHUB_CLIENT_SECRET']),
|
|
109
|
-
scope: ['user:email'],
|
|
110
|
-
},
|
|
111
|
-
discord: {
|
|
112
|
-
clientId: process.env['DISCORD_CLIENT_ID'] ?? '',
|
|
113
|
-
clientSecret: process.env['DISCORD_CLIENT_SECRET'] ?? '',
|
|
114
|
-
enabled: !!(process.env['DISCORD_CLIENT_ID'] && process.env['DISCORD_CLIENT_SECRET']),
|
|
115
|
-
scope: ['identify', 'email'],
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
trustedOrigins: buildTrustedOrigins(),
|
|
119
|
-
});
|
|
120
|
-
exports.auth = authInstance;
|
|
121
|
-
//# sourceMappingURL=auth.instance.js.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.AuthModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
let AuthModule = class AuthModule {
|
|
12
|
-
};
|
|
13
|
-
exports.AuthModule = AuthModule;
|
|
14
|
-
exports.AuthModule = AuthModule = __decorate([
|
|
15
|
-
(0, common_1.Module)({})
|
|
16
|
-
], AuthModule);
|
|
17
|
-
//# sourceMappingURL=auth.module.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CurrentUser = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
exports.CurrentUser = (0, common_1.createParamDecorator)((_data, ctx) => {
|
|
6
|
-
const request = ctx.switchToHttp().getRequest();
|
|
7
|
-
return request.user;
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=current-user.decorator.js.map
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LocalAuthGuard = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const core_1 = require("@nestjs/core");
|
|
15
|
-
const public_decorator_1 = require("../common/decorators/public.decorator");
|
|
16
|
-
const local_mode_constants_1 = require("../common/constants/local-mode.constants");
|
|
17
|
-
const local_ip_1 = require("../common/utils/local-ip");
|
|
18
|
-
let LocalAuthGuard = class LocalAuthGuard {
|
|
19
|
-
reflector;
|
|
20
|
-
constructor(reflector) {
|
|
21
|
-
this.reflector = reflector;
|
|
22
|
-
}
|
|
23
|
-
async canActivate(context) {
|
|
24
|
-
const isPublic = this.reflector.getAllAndOverride(public_decorator_1.IS_PUBLIC_KEY, [
|
|
25
|
-
context.getHandler(),
|
|
26
|
-
context.getClass(),
|
|
27
|
-
]);
|
|
28
|
-
if (isPublic)
|
|
29
|
-
return true;
|
|
30
|
-
const request = context.switchToHttp().getRequest();
|
|
31
|
-
if (request.headers['x-api-key'])
|
|
32
|
-
return true;
|
|
33
|
-
const clientIp = request.ip ?? '';
|
|
34
|
-
if ((0, local_ip_1.isAllowedLocalIp)(clientIp)) {
|
|
35
|
-
const configEmail = (0, local_mode_constants_1.readLocalNotificationEmail)();
|
|
36
|
-
request.user = {
|
|
37
|
-
id: local_mode_constants_1.LOCAL_USER_ID,
|
|
38
|
-
name: 'Local User',
|
|
39
|
-
email: configEmail ?? local_mode_constants_1.LOCAL_EMAIL,
|
|
40
|
-
};
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
exports.LocalAuthGuard = LocalAuthGuard;
|
|
47
|
-
exports.LocalAuthGuard = LocalAuthGuard = __decorate([
|
|
48
|
-
(0, common_1.Injectable)(),
|
|
49
|
-
__metadata("design:paramtypes", [core_1.Reflector])
|
|
50
|
-
], LocalAuthGuard);
|
|
51
|
-
//# sourceMappingURL=local-auth.guard.js.map
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var SessionGuard_1;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.SessionGuard = void 0;
|
|
14
|
-
const common_1 = require("@nestjs/common");
|
|
15
|
-
const core_1 = require("@nestjs/core");
|
|
16
|
-
const node_1 = require("better-auth/node");
|
|
17
|
-
const auth_instance_1 = require("./auth.instance");
|
|
18
|
-
const public_decorator_1 = require("../common/decorators/public.decorator");
|
|
19
|
-
let SessionGuard = SessionGuard_1 = class SessionGuard {
|
|
20
|
-
reflector;
|
|
21
|
-
logger = new common_1.Logger(SessionGuard_1.name);
|
|
22
|
-
constructor(reflector) {
|
|
23
|
-
this.reflector = reflector;
|
|
24
|
-
}
|
|
25
|
-
async canActivate(context) {
|
|
26
|
-
const isPublic = this.reflector.getAllAndOverride(public_decorator_1.IS_PUBLIC_KEY, [
|
|
27
|
-
context.getHandler(),
|
|
28
|
-
context.getClass(),
|
|
29
|
-
]);
|
|
30
|
-
if (isPublic)
|
|
31
|
-
return true;
|
|
32
|
-
const request = context.switchToHttp().getRequest();
|
|
33
|
-
if (request.headers['x-api-key'])
|
|
34
|
-
return true;
|
|
35
|
-
if (!auth_instance_1.auth)
|
|
36
|
-
return true;
|
|
37
|
-
try {
|
|
38
|
-
const session = await auth_instance_1.auth.api.getSession({
|
|
39
|
-
headers: (0, node_1.fromNodeHeaders)(request.headers),
|
|
40
|
-
});
|
|
41
|
-
if (session) {
|
|
42
|
-
request.user = session.user;
|
|
43
|
-
request.session = session.session;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch (err) {
|
|
47
|
-
this.logger.warn(`Session lookup failed: ${err.message}`);
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
exports.SessionGuard = SessionGuard;
|
|
53
|
-
exports.SessionGuard = SessionGuard = SessionGuard_1 = __decorate([
|
|
54
|
-
(0, common_1.Injectable)(),
|
|
55
|
-
__metadata("design:paramtypes", [core_1.Reflector])
|
|
56
|
-
], SessionGuard);
|
|
57
|
-
//# sourceMappingURL=session.guard.js.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.CommonModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
-
const tenant_entity_1 = require("../entities/tenant.entity");
|
|
13
|
-
const ingest_event_bus_service_1 = require("./services/ingest-event-bus.service");
|
|
14
|
-
const manifest_runtime_service_1 = require("./services/manifest-runtime.service");
|
|
15
|
-
const tenant_cache_service_1 = require("./services/tenant-cache.service");
|
|
16
|
-
const user_cache_interceptor_1 = require("./interceptors/user-cache.interceptor");
|
|
17
|
-
const agent_cache_interceptor_1 = require("./interceptors/agent-cache.interceptor");
|
|
18
|
-
let CommonModule = class CommonModule {
|
|
19
|
-
};
|
|
20
|
-
exports.CommonModule = CommonModule;
|
|
21
|
-
exports.CommonModule = CommonModule = __decorate([
|
|
22
|
-
(0, common_1.Global)(),
|
|
23
|
-
(0, common_1.Module)({
|
|
24
|
-
imports: [typeorm_1.TypeOrmModule.forFeature([tenant_entity_1.Tenant])],
|
|
25
|
-
providers: [
|
|
26
|
-
ingest_event_bus_service_1.IngestEventBusService,
|
|
27
|
-
manifest_runtime_service_1.ManifestRuntimeService,
|
|
28
|
-
tenant_cache_service_1.TenantCacheService,
|
|
29
|
-
user_cache_interceptor_1.UserCacheInterceptor,
|
|
30
|
-
agent_cache_interceptor_1.AgentCacheInterceptor,
|
|
31
|
-
],
|
|
32
|
-
exports: [
|
|
33
|
-
ingest_event_bus_service_1.IngestEventBusService,
|
|
34
|
-
manifest_runtime_service_1.ManifestRuntimeService,
|
|
35
|
-
tenant_cache_service_1.TenantCacheService,
|
|
36
|
-
user_cache_interceptor_1.UserCacheInterceptor,
|
|
37
|
-
agent_cache_interceptor_1.AgentCacheInterceptor,
|
|
38
|
-
],
|
|
39
|
-
})
|
|
40
|
-
], CommonModule);
|
|
41
|
-
//# sourceMappingURL=common.module.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.API_KEY_PREFIX = void 0;
|
|
4
|
-
var manifest_shared_1 = require("manifest-shared");
|
|
5
|
-
Object.defineProperty(exports, "API_KEY_PREFIX", { enumerable: true, get: function () { return manifest_shared_1.API_KEY_PREFIX; } });
|
|
6
|
-
//# sourceMappingURL=api-key.constants.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PUBLIC_STATS_CACHE_TTL_MS = exports.MODEL_PRICES_CACHE_TTL_MS = exports.AGENT_LIST_CACHE_TTL_MS = exports.DASHBOARD_CACHE_TTL_MS = void 0;
|
|
4
|
-
exports.DASHBOARD_CACHE_TTL_MS = 30_000;
|
|
5
|
-
exports.AGENT_LIST_CACHE_TTL_MS = 60_000;
|
|
6
|
-
exports.MODEL_PRICES_CACHE_TTL_MS = 300_000;
|
|
7
|
-
exports.PUBLIC_STATS_CACHE_TTL_MS = 86_400_000;
|
|
8
|
-
//# sourceMappingURL=cache.constants.js.map
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LOCAL_AGENT_NAME = exports.LOCAL_AGENT_ID = exports.LOCAL_TENANT_ID = exports.LOCAL_DEFAULT_PORT = exports.LOCAL_EMAIL = exports.LOCAL_USER_ID = void 0;
|
|
4
|
-
exports.getLocalAuthSecret = getLocalAuthSecret;
|
|
5
|
-
exports.getLocalPassword = getLocalPassword;
|
|
6
|
-
exports.readLocalEmailConfig = readLocalEmailConfig;
|
|
7
|
-
exports.writeLocalEmailConfig = writeLocalEmailConfig;
|
|
8
|
-
exports.clearLocalEmailConfig = clearLocalEmailConfig;
|
|
9
|
-
exports.readLocalApiKey = readLocalApiKey;
|
|
10
|
-
exports.readLocalNotificationEmail = readLocalNotificationEmail;
|
|
11
|
-
exports.writeLocalNotificationEmail = writeLocalNotificationEmail;
|
|
12
|
-
const fs_1 = require("fs");
|
|
13
|
-
const path_1 = require("path");
|
|
14
|
-
const os_1 = require("os");
|
|
15
|
-
const crypto_1 = require("crypto");
|
|
16
|
-
exports.LOCAL_USER_ID = 'local-user-001';
|
|
17
|
-
exports.LOCAL_EMAIL = 'local@manifest.local';
|
|
18
|
-
exports.LOCAL_DEFAULT_PORT = 2099;
|
|
19
|
-
exports.LOCAL_TENANT_ID = 'local-tenant-001';
|
|
20
|
-
exports.LOCAL_AGENT_ID = 'local-agent-001';
|
|
21
|
-
exports.LOCAL_AGENT_NAME = 'local-agent';
|
|
22
|
-
const CONFIG_DIR = (0, path_1.join)((0, os_1.homedir)(), '.openclaw', 'manifest');
|
|
23
|
-
const CONFIG_FILE = (0, path_1.join)(CONFIG_DIR, 'config.json');
|
|
24
|
-
function ensureConfigDir() {
|
|
25
|
-
if (!(0, fs_1.existsSync)(CONFIG_DIR)) {
|
|
26
|
-
(0, fs_1.mkdirSync)(CONFIG_DIR, { recursive: true, mode: 0o700 });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function readConfig() {
|
|
30
|
-
ensureConfigDir();
|
|
31
|
-
if (!(0, fs_1.existsSync)(CONFIG_FILE))
|
|
32
|
-
return {};
|
|
33
|
-
try {
|
|
34
|
-
return JSON.parse((0, fs_1.readFileSync)(CONFIG_FILE, 'utf-8'));
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
return {};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function writeConfig(config) {
|
|
41
|
-
ensureConfigDir();
|
|
42
|
-
(0, fs_1.writeFileSync)(CONFIG_FILE, JSON.stringify(config, null, 2), { mode: 0o600 });
|
|
43
|
-
}
|
|
44
|
-
function getLocalAuthSecret() {
|
|
45
|
-
const config = readConfig();
|
|
46
|
-
if (config.authSecret && config.authSecret.length >= 32) {
|
|
47
|
-
return config.authSecret;
|
|
48
|
-
}
|
|
49
|
-
const secret = (0, crypto_1.randomBytes)(32).toString('hex');
|
|
50
|
-
writeConfig({ ...config, authSecret: secret });
|
|
51
|
-
return secret;
|
|
52
|
-
}
|
|
53
|
-
function getLocalPassword() {
|
|
54
|
-
const config = readConfig();
|
|
55
|
-
if (config.localPassword && config.localPassword.length >= 16) {
|
|
56
|
-
return config.localPassword;
|
|
57
|
-
}
|
|
58
|
-
const password = (0, crypto_1.randomBytes)(24).toString('base64url');
|
|
59
|
-
writeConfig({ ...config, localPassword: password });
|
|
60
|
-
return password;
|
|
61
|
-
}
|
|
62
|
-
function readLocalEmailConfig() {
|
|
63
|
-
const config = readConfig();
|
|
64
|
-
if (!config.emailProvider || !config.emailApiKey)
|
|
65
|
-
return null;
|
|
66
|
-
return {
|
|
67
|
-
provider: config.emailProvider,
|
|
68
|
-
apiKey: config.emailApiKey,
|
|
69
|
-
domain: config.emailDomain,
|
|
70
|
-
fromEmail: config.emailFromAddress,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function writeLocalEmailConfig(emailConfig) {
|
|
74
|
-
const config = readConfig();
|
|
75
|
-
config.emailProvider = emailConfig.provider;
|
|
76
|
-
config.emailApiKey = emailConfig.apiKey;
|
|
77
|
-
config.emailDomain = emailConfig.domain;
|
|
78
|
-
config.emailFromAddress = emailConfig.fromEmail;
|
|
79
|
-
writeConfig(config);
|
|
80
|
-
}
|
|
81
|
-
function clearLocalEmailConfig() {
|
|
82
|
-
const config = readConfig();
|
|
83
|
-
delete config.emailProvider;
|
|
84
|
-
delete config.emailApiKey;
|
|
85
|
-
delete config.emailDomain;
|
|
86
|
-
delete config.emailFromAddress;
|
|
87
|
-
writeConfig(config);
|
|
88
|
-
}
|
|
89
|
-
function readLocalApiKey() {
|
|
90
|
-
const config = readConfig();
|
|
91
|
-
return typeof config.apiKey === 'string' ? config.apiKey : null;
|
|
92
|
-
}
|
|
93
|
-
function readLocalNotificationEmail() {
|
|
94
|
-
const config = readConfig();
|
|
95
|
-
return config.notificationEmail ?? null;
|
|
96
|
-
}
|
|
97
|
-
function writeLocalNotificationEmail(email) {
|
|
98
|
-
const config = readConfig();
|
|
99
|
-
config.notificationEmail = email;
|
|
100
|
-
writeConfig(config);
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=local-mode.constants.js.map
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALL_PROVIDER_IDS = exports.OPENROUTER_PREFIX_TO_PROVIDER = exports.PROVIDER_BY_ID_OR_ALIAS = exports.PROVIDER_BY_ID = exports.PROVIDER_REGISTRY = void 0;
|
|
4
|
-
exports.expandProviderNames = expandProviderNames;
|
|
5
|
-
exports.PROVIDER_REGISTRY = [
|
|
6
|
-
{
|
|
7
|
-
id: 'anthropic',
|
|
8
|
-
displayName: 'Anthropic',
|
|
9
|
-
aliases: [],
|
|
10
|
-
openRouterPrefixes: ['anthropic'],
|
|
11
|
-
requiresApiKey: true,
|
|
12
|
-
localOnly: false,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
id: 'openai',
|
|
16
|
-
displayName: 'OpenAI',
|
|
17
|
-
aliases: [],
|
|
18
|
-
openRouterPrefixes: ['openai'],
|
|
19
|
-
requiresApiKey: true,
|
|
20
|
-
localOnly: false,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: 'gemini',
|
|
24
|
-
displayName: 'Google',
|
|
25
|
-
aliases: ['google'],
|
|
26
|
-
openRouterPrefixes: ['google'],
|
|
27
|
-
requiresApiKey: true,
|
|
28
|
-
localOnly: false,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: 'deepseek',
|
|
32
|
-
displayName: 'DeepSeek',
|
|
33
|
-
aliases: [],
|
|
34
|
-
openRouterPrefixes: ['deepseek'],
|
|
35
|
-
requiresApiKey: true,
|
|
36
|
-
localOnly: false,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: 'mistral',
|
|
40
|
-
displayName: 'Mistral',
|
|
41
|
-
aliases: [],
|
|
42
|
-
openRouterPrefixes: ['mistralai'],
|
|
43
|
-
requiresApiKey: true,
|
|
44
|
-
localOnly: false,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: 'moonshot',
|
|
48
|
-
displayName: 'Moonshot',
|
|
49
|
-
aliases: ['kimi'],
|
|
50
|
-
openRouterPrefixes: ['moonshotai'],
|
|
51
|
-
requiresApiKey: true,
|
|
52
|
-
localOnly: false,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: 'xai',
|
|
56
|
-
displayName: 'xAI',
|
|
57
|
-
aliases: [],
|
|
58
|
-
openRouterPrefixes: ['xai', 'x-ai'],
|
|
59
|
-
requiresApiKey: true,
|
|
60
|
-
localOnly: false,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 'minimax',
|
|
64
|
-
displayName: 'MiniMax',
|
|
65
|
-
aliases: [],
|
|
66
|
-
openRouterPrefixes: ['minimax'],
|
|
67
|
-
requiresApiKey: true,
|
|
68
|
-
localOnly: false,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: 'qwen',
|
|
72
|
-
displayName: 'Alibaba',
|
|
73
|
-
aliases: ['alibaba'],
|
|
74
|
-
openRouterPrefixes: ['qwen', 'alibaba'],
|
|
75
|
-
requiresApiKey: true,
|
|
76
|
-
localOnly: false,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 'zai',
|
|
80
|
-
displayName: 'Z.ai',
|
|
81
|
-
aliases: ['z.ai'],
|
|
82
|
-
openRouterPrefixes: ['z-ai', 'zhipuai'],
|
|
83
|
-
requiresApiKey: true,
|
|
84
|
-
localOnly: false,
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: 'copilot',
|
|
88
|
-
displayName: 'GitHub Copilot',
|
|
89
|
-
aliases: [],
|
|
90
|
-
openRouterPrefixes: [],
|
|
91
|
-
requiresApiKey: false,
|
|
92
|
-
localOnly: false,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
id: 'openrouter',
|
|
96
|
-
displayName: 'OpenRouter',
|
|
97
|
-
aliases: [],
|
|
98
|
-
openRouterPrefixes: ['openrouter'],
|
|
99
|
-
requiresApiKey: true,
|
|
100
|
-
localOnly: false,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
id: 'ollama',
|
|
104
|
-
displayName: 'Ollama',
|
|
105
|
-
aliases: [],
|
|
106
|
-
openRouterPrefixes: [],
|
|
107
|
-
requiresApiKey: false,
|
|
108
|
-
localOnly: true,
|
|
109
|
-
},
|
|
110
|
-
];
|
|
111
|
-
exports.PROVIDER_BY_ID = new Map(exports.PROVIDER_REGISTRY.map((p) => [p.id, p]));
|
|
112
|
-
exports.PROVIDER_BY_ID_OR_ALIAS = new Map(exports.PROVIDER_REGISTRY.flatMap((p) => [
|
|
113
|
-
[p.id, p],
|
|
114
|
-
...p.aliases.map((a) => [a, p]),
|
|
115
|
-
]));
|
|
116
|
-
exports.OPENROUTER_PREFIX_TO_PROVIDER = new Map(exports.PROVIDER_REGISTRY.flatMap((p) => p.openRouterPrefixes.map((prefix) => [prefix, p.displayName])));
|
|
117
|
-
exports.ALL_PROVIDER_IDS = new Set(exports.PROVIDER_REGISTRY.flatMap((p) => [p.id, ...p.aliases]));
|
|
118
|
-
function expandProviderNames(names) {
|
|
119
|
-
const expanded = new Set();
|
|
120
|
-
for (const name of names) {
|
|
121
|
-
const lower = name.toLowerCase();
|
|
122
|
-
expanded.add(lower);
|
|
123
|
-
if (lower.startsWith('custom:'))
|
|
124
|
-
continue;
|
|
125
|
-
const entry = exports.PROVIDER_BY_ID_OR_ALIAS.get(lower);
|
|
126
|
-
if (entry) {
|
|
127
|
-
expanded.add(entry.id);
|
|
128
|
-
for (const alias of entry.aliases)
|
|
129
|
-
expanded.add(alias);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return expanded;
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=providers.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Public = exports.IS_PUBLIC_KEY = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
exports.IS_PUBLIC_KEY = 'isPublic';
|
|
6
|
-
const Public = () => (0, common_1.SetMetadata)(exports.IS_PUBLIC_KEY, true);
|
|
7
|
-
exports.Public = Public;
|
|
8
|
-
//# sourceMappingURL=public.decorator.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CreateAgentDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
class CreateAgentDto {
|
|
15
|
-
name;
|
|
16
|
-
}
|
|
17
|
-
exports.CreateAgentDto = CreateAgentDto;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, class_validator_1.IsString)(),
|
|
20
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
-
(0, class_validator_1.MinLength)(1),
|
|
22
|
-
(0, class_validator_1.MaxLength)(100),
|
|
23
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9 _-]+$/, { message: 'Agent name must contain only letters, numbers, spaces, dashes, and underscores' }),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], CreateAgentDto.prototype, "name", void 0);
|
|
26
|
-
//# sourceMappingURL=create-agent.dto.js.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RangeQueryDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
class RangeQueryDto {
|
|
15
|
-
range;
|
|
16
|
-
agent_name;
|
|
17
|
-
}
|
|
18
|
-
exports.RangeQueryDto = RangeQueryDto;
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, class_validator_1.IsOptional)(),
|
|
21
|
-
(0, class_validator_1.IsIn)(['1h', '6h', '24h', '7d', '30d']),
|
|
22
|
-
__metadata("design:type", String)
|
|
23
|
-
], RangeQueryDto.prototype, "range", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, class_validator_1.IsOptional)(),
|
|
26
|
-
(0, class_validator_1.IsString)(),
|
|
27
|
-
__metadata("design:type", String)
|
|
28
|
-
], RangeQueryDto.prototype, "agent_name", void 0);
|
|
29
|
-
//# sourceMappingURL=range-query.dto.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RenameAgentDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
class RenameAgentDto {
|
|
15
|
-
name;
|
|
16
|
-
}
|
|
17
|
-
exports.RenameAgentDto = RenameAgentDto;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, class_validator_1.IsString)(),
|
|
20
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
-
(0, class_validator_1.MinLength)(1),
|
|
22
|
-
(0, class_validator_1.MaxLength)(100),
|
|
23
|
-
(0, class_validator_1.Matches)(/^[a-zA-Z0-9 _-]+$/, { message: 'Agent name must contain only letters, numbers, spaces, dashes, and underscores' }),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], RenameAgentDto.prototype, "name", void 0);
|
|
26
|
-
//# sourceMappingURL=rename-agent.dto.js.map
|