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,46 +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.SpaFallbackFilter = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const path_1 = require("path");
|
|
15
|
-
const fs_1 = require("fs");
|
|
16
|
-
const frontend_path_1 = require("../utils/frontend-path");
|
|
17
|
-
const API_PREFIXES = ['/api/', '/otlp/', '/v1/'];
|
|
18
|
-
let SpaFallbackFilter = class SpaFallbackFilter {
|
|
19
|
-
indexContent;
|
|
20
|
-
constructor() {
|
|
21
|
-
const frontendDir = (0, frontend_path_1.resolveFrontendDir)();
|
|
22
|
-
this.indexContent = frontendDir ? (0, fs_1.readFileSync)((0, path_1.join)(frontendDir, 'index.html'), 'utf-8') : null;
|
|
23
|
-
}
|
|
24
|
-
catch(exception, host) {
|
|
25
|
-
const ctx = host.switchToHttp();
|
|
26
|
-
const req = ctx.getRequest();
|
|
27
|
-
const res = ctx.getResponse();
|
|
28
|
-
if (req.method !== 'GET' ||
|
|
29
|
-
!this.indexContent ||
|
|
30
|
-
API_PREFIXES.some((p) => req.originalUrl.startsWith(p))) {
|
|
31
|
-
const response = exception.getResponse();
|
|
32
|
-
const status = exception.getStatus();
|
|
33
|
-
res.status(status).json(response);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
res.setHeader('Content-Type', 'text/html');
|
|
37
|
-
res.setHeader('Cache-Control', 'no-cache');
|
|
38
|
-
res.status(200).send(this.indexContent);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
exports.SpaFallbackFilter = SpaFallbackFilter;
|
|
42
|
-
exports.SpaFallbackFilter = SpaFallbackFilter = __decorate([
|
|
43
|
-
(0, common_1.Catch)(common_1.NotFoundException),
|
|
44
|
-
__metadata("design:paramtypes", [])
|
|
45
|
-
], SpaFallbackFilter);
|
|
46
|
-
//# sourceMappingURL=spa-fallback.filter.js.map
|
|
@@ -1,89 +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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var ApiKeyGuard_1;
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.ApiKeyGuard = void 0;
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const core_1 = require("@nestjs/core");
|
|
19
|
-
const config_1 = require("@nestjs/config");
|
|
20
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
21
|
-
const typeorm_2 = require("typeorm");
|
|
22
|
-
const crypto_1 = require("crypto");
|
|
23
|
-
const api_key_entity_1 = require("../../entities/api-key.entity");
|
|
24
|
-
const public_decorator_1 = require("../decorators/public.decorator");
|
|
25
|
-
const hash_util_1 = require("../utils/hash.util");
|
|
26
|
-
let ApiKeyGuard = ApiKeyGuard_1 = class ApiKeyGuard {
|
|
27
|
-
reflector;
|
|
28
|
-
configService;
|
|
29
|
-
apiKeyRepo;
|
|
30
|
-
logger = new common_1.Logger(ApiKeyGuard_1.name);
|
|
31
|
-
constructor(reflector, configService, apiKeyRepo) {
|
|
32
|
-
this.reflector = reflector;
|
|
33
|
-
this.configService = configService;
|
|
34
|
-
this.apiKeyRepo = apiKeyRepo;
|
|
35
|
-
}
|
|
36
|
-
async canActivate(context) {
|
|
37
|
-
const isPublic = this.reflector.getAllAndOverride(public_decorator_1.IS_PUBLIC_KEY, [
|
|
38
|
-
context.getHandler(),
|
|
39
|
-
context.getClass(),
|
|
40
|
-
]);
|
|
41
|
-
if (isPublic)
|
|
42
|
-
return true;
|
|
43
|
-
const request = context.switchToHttp().getRequest();
|
|
44
|
-
if (request.user)
|
|
45
|
-
return true;
|
|
46
|
-
const apiKey = request.headers['x-api-key'];
|
|
47
|
-
if (!apiKey || typeof apiKey !== 'string') {
|
|
48
|
-
this.logger.warn(`Rejected request without API key from ${request.ip}`);
|
|
49
|
-
throw new common_1.UnauthorizedException('X-API-Key header required');
|
|
50
|
-
}
|
|
51
|
-
const prefix = (0, hash_util_1.keyPrefix)(apiKey);
|
|
52
|
-
const candidates = await this.apiKeyRepo.find({ where: { key_prefix: prefix } });
|
|
53
|
-
const found = candidates.find((c) => (0, hash_util_1.verifyKey)(apiKey, c.key_hash));
|
|
54
|
-
if (found) {
|
|
55
|
-
request.apiKeyUserId = String(found.user_id);
|
|
56
|
-
this.apiKeyRepo
|
|
57
|
-
.createQueryBuilder()
|
|
58
|
-
.update(api_key_entity_1.ApiKey)
|
|
59
|
-
.set({ last_used_at: () => 'CURRENT_TIMESTAMP' })
|
|
60
|
-
.where('id = :id', { id: found.id })
|
|
61
|
-
.execute()
|
|
62
|
-
.catch((err) => this.logger.warn(`Failed to update last_used_at: ${err.message}`));
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
const validKey = this.configService.get('app.apiKey', '');
|
|
66
|
-
if (validKey && this.safeCompare(apiKey, validKey)) {
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
this.logger.warn(`Rejected invalid API key from ${request.ip}`);
|
|
70
|
-
throw new common_1.UnauthorizedException('Invalid API key');
|
|
71
|
-
}
|
|
72
|
-
safeCompare(a, b) {
|
|
73
|
-
const maxLen = Math.max(a.length, b.length);
|
|
74
|
-
const aBuf = Buffer.alloc(maxLen);
|
|
75
|
-
const bBuf = Buffer.alloc(maxLen);
|
|
76
|
-
Buffer.from(a).copy(aBuf);
|
|
77
|
-
Buffer.from(b).copy(bBuf);
|
|
78
|
-
return a.length === b.length && (0, crypto_1.timingSafeEqual)(aBuf, bBuf);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
exports.ApiKeyGuard = ApiKeyGuard;
|
|
82
|
-
exports.ApiKeyGuard = ApiKeyGuard = ApiKeyGuard_1 = __decorate([
|
|
83
|
-
(0, common_1.Injectable)(),
|
|
84
|
-
__param(2, (0, typeorm_1.InjectRepository)(api_key_entity_1.ApiKey)),
|
|
85
|
-
__metadata("design:paramtypes", [core_1.Reflector,
|
|
86
|
-
config_1.ConfigService,
|
|
87
|
-
typeorm_2.Repository])
|
|
88
|
-
], ApiKeyGuard);
|
|
89
|
-
//# sourceMappingURL=api-key.guard.js.map
|
|
@@ -1,39 +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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.AgentCacheInterceptor = void 0;
|
|
16
|
-
const cache_manager_1 = require("@nestjs/cache-manager");
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const core_1 = require("@nestjs/core");
|
|
19
|
-
let AgentCacheInterceptor = class AgentCacheInterceptor extends cache_manager_1.CacheInterceptor {
|
|
20
|
-
constructor(cacheManager, reflector) {
|
|
21
|
-
super(cacheManager, reflector);
|
|
22
|
-
}
|
|
23
|
-
trackBy(context) {
|
|
24
|
-
const request = context.switchToHttp().getRequest();
|
|
25
|
-
if (request.method !== 'GET')
|
|
26
|
-
return undefined;
|
|
27
|
-
const agentId = request.ingestionContext?.agentId;
|
|
28
|
-
if (!agentId)
|
|
29
|
-
return undefined;
|
|
30
|
-
return `agent:${agentId}:${request.originalUrl}`;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
exports.AgentCacheInterceptor = AgentCacheInterceptor;
|
|
34
|
-
exports.AgentCacheInterceptor = AgentCacheInterceptor = __decorate([
|
|
35
|
-
(0, common_1.Injectable)(),
|
|
36
|
-
__param(0, (0, common_1.Inject)('CACHE_MANAGER')),
|
|
37
|
-
__metadata("design:paramtypes", [Object, core_1.Reflector])
|
|
38
|
-
], AgentCacheInterceptor);
|
|
39
|
-
//# sourceMappingURL=agent-cache.interceptor.js.map
|
|
@@ -1,39 +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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.UserCacheInterceptor = void 0;
|
|
16
|
-
const cache_manager_1 = require("@nestjs/cache-manager");
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const core_1 = require("@nestjs/core");
|
|
19
|
-
let UserCacheInterceptor = class UserCacheInterceptor extends cache_manager_1.CacheInterceptor {
|
|
20
|
-
constructor(cacheManager, reflector) {
|
|
21
|
-
super(cacheManager, reflector);
|
|
22
|
-
}
|
|
23
|
-
trackBy(context) {
|
|
24
|
-
const request = context.switchToHttp().getRequest();
|
|
25
|
-
if (request.method !== 'GET')
|
|
26
|
-
return undefined;
|
|
27
|
-
const user = request.user;
|
|
28
|
-
if (!user?.id)
|
|
29
|
-
return undefined;
|
|
30
|
-
return `${user.id}:${request.originalUrl}`;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
exports.UserCacheInterceptor = UserCacheInterceptor;
|
|
34
|
-
exports.UserCacheInterceptor = UserCacheInterceptor = __decorate([
|
|
35
|
-
(0, common_1.Injectable)(),
|
|
36
|
-
__param(0, (0, common_1.Inject)('CACHE_MANAGER')),
|
|
37
|
-
__metadata("design:paramtypes", [Object, core_1.Reflector])
|
|
38
|
-
], UserCacheInterceptor);
|
|
39
|
-
//# sourceMappingURL=user-cache.interceptor.js.map
|
|
@@ -1,44 +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.IngestEventBusService = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const rxjs_1 = require("rxjs");
|
|
12
|
-
const operators_1 = require("rxjs/operators");
|
|
13
|
-
let IngestEventBusService = class IngestEventBusService {
|
|
14
|
-
subject = new rxjs_1.Subject();
|
|
15
|
-
debounceTimers = new Map();
|
|
16
|
-
DEBOUNCE_MS = 1_000;
|
|
17
|
-
emit(userId) {
|
|
18
|
-
const existing = this.debounceTimers.get(userId);
|
|
19
|
-
if (existing)
|
|
20
|
-
clearTimeout(existing);
|
|
21
|
-
this.debounceTimers.set(userId, setTimeout(() => {
|
|
22
|
-
this.debounceTimers.delete(userId);
|
|
23
|
-
this.subject.next(userId);
|
|
24
|
-
}, this.DEBOUNCE_MS));
|
|
25
|
-
}
|
|
26
|
-
forUser(userId) {
|
|
27
|
-
return this.subject.asObservable().pipe((0, operators_1.filter)((id) => id === userId));
|
|
28
|
-
}
|
|
29
|
-
all() {
|
|
30
|
-
return this.subject.asObservable();
|
|
31
|
-
}
|
|
32
|
-
onModuleDestroy() {
|
|
33
|
-
for (const timer of this.debounceTimers.values()) {
|
|
34
|
-
clearTimeout(timer);
|
|
35
|
-
}
|
|
36
|
-
this.debounceTimers.clear();
|
|
37
|
-
this.subject.complete();
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.IngestEventBusService = IngestEventBusService;
|
|
41
|
-
exports.IngestEventBusService = IngestEventBusService = __decorate([
|
|
42
|
-
(0, common_1.Injectable)()
|
|
43
|
-
], IngestEventBusService);
|
|
44
|
-
//# sourceMappingURL=ingest-event-bus.service.js.map
|
|
@@ -1,39 +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.ManifestRuntimeService = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const config_1 = require("@nestjs/config");
|
|
15
|
-
let ManifestRuntimeService = class ManifestRuntimeService {
|
|
16
|
-
config;
|
|
17
|
-
constructor(config) {
|
|
18
|
-
this.config = config;
|
|
19
|
-
}
|
|
20
|
-
getMode() {
|
|
21
|
-
return this.config.get('app.manifestMode', 'cloud');
|
|
22
|
-
}
|
|
23
|
-
isLocalMode() {
|
|
24
|
-
return this.getMode() === 'local';
|
|
25
|
-
}
|
|
26
|
-
getAuthBaseUrl() {
|
|
27
|
-
const configuredBaseUrl = this.config.get('app.betterAuthUrl', '');
|
|
28
|
-
if (configuredBaseUrl)
|
|
29
|
-
return configuredBaseUrl;
|
|
30
|
-
const port = this.config.get('app.port', 3001);
|
|
31
|
-
return `http://localhost:${port}`;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.ManifestRuntimeService = ManifestRuntimeService;
|
|
35
|
-
exports.ManifestRuntimeService = ManifestRuntimeService = __decorate([
|
|
36
|
-
(0, common_1.Injectable)(),
|
|
37
|
-
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
38
|
-
], ManifestRuntimeService);
|
|
39
|
-
//# sourceMappingURL=manifest-runtime.service.js.map
|
|
@@ -1,56 +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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.TenantCacheService = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
-
const typeorm_2 = require("typeorm");
|
|
19
|
-
const tenant_entity_1 = require("../../entities/tenant.entity");
|
|
20
|
-
const TTL_MS = 300_000;
|
|
21
|
-
const MAX_ENTRIES = 5_000;
|
|
22
|
-
let TenantCacheService = class TenantCacheService {
|
|
23
|
-
tenantRepo;
|
|
24
|
-
cache = new Map();
|
|
25
|
-
constructor(tenantRepo) {
|
|
26
|
-
this.tenantRepo = tenantRepo;
|
|
27
|
-
}
|
|
28
|
-
async resolve(userId) {
|
|
29
|
-
const cached = this.cache.get(userId);
|
|
30
|
-
if (cached && cached.expiresAt > Date.now()) {
|
|
31
|
-
return cached.tenantId;
|
|
32
|
-
}
|
|
33
|
-
if (cached)
|
|
34
|
-
this.cache.delete(userId);
|
|
35
|
-
const tenant = await this.tenantRepo.findOne({ where: { name: userId } });
|
|
36
|
-
if (!tenant)
|
|
37
|
-
return null;
|
|
38
|
-
if (this.cache.size >= MAX_ENTRIES && !this.cache.has(userId)) {
|
|
39
|
-
const firstKey = this.cache.keys().next().value;
|
|
40
|
-
if (firstKey !== undefined)
|
|
41
|
-
this.cache.delete(firstKey);
|
|
42
|
-
}
|
|
43
|
-
this.cache.set(userId, {
|
|
44
|
-
tenantId: tenant.id,
|
|
45
|
-
expiresAt: Date.now() + TTL_MS,
|
|
46
|
-
});
|
|
47
|
-
return tenant.id;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
exports.TenantCacheService = TenantCacheService;
|
|
51
|
-
exports.TenantCacheService = TenantCacheService = __decorate([
|
|
52
|
-
(0, common_1.Injectable)(),
|
|
53
|
-
__param(0, (0, typeorm_1.InjectRepository)(tenant_entity_1.Tenant)),
|
|
54
|
-
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
55
|
-
], TenantCacheService);
|
|
56
|
-
//# sourceMappingURL=tenant-cache.service.js.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeAnthropicShortModelId = normalizeAnthropicShortModelId;
|
|
4
|
-
exports.buildAnthropicShortModelIdVariants = buildAnthropicShortModelIdVariants;
|
|
5
|
-
const ANTHROPIC_PREFIX = 'anthropic/';
|
|
6
|
-
const SHORT_ANTHROPIC_MODEL_RE = /^claude-(opus|sonnet|haiku)-/i;
|
|
7
|
-
const DOTTED_MINOR_RE = /-(\d+)\.(\d{1,2})(?=$|-\d{8}$)/g;
|
|
8
|
-
const DASHED_MINOR_RE = /-(\d+)-(\d{1,2})(?=$|-\d{8}$)/g;
|
|
9
|
-
function splitAnthropicPrefix(model) {
|
|
10
|
-
if (model.startsWith(ANTHROPIC_PREFIX)) {
|
|
11
|
-
return {
|
|
12
|
-
prefix: ANTHROPIC_PREFIX,
|
|
13
|
-
bare: model.slice(ANTHROPIC_PREFIX.length),
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
return { prefix: '', bare: model };
|
|
17
|
-
}
|
|
18
|
-
function supportsShortAnthropicMinorVersion(model) {
|
|
19
|
-
return SHORT_ANTHROPIC_MODEL_RE.test(model);
|
|
20
|
-
}
|
|
21
|
-
function normalizeAnthropicShortModelId(model) {
|
|
22
|
-
const { prefix, bare } = splitAnthropicPrefix(model);
|
|
23
|
-
if (!supportsShortAnthropicMinorVersion(bare))
|
|
24
|
-
return model;
|
|
25
|
-
return `${prefix}${bare.replace(DOTTED_MINOR_RE, '-$1-$2')}`;
|
|
26
|
-
}
|
|
27
|
-
function buildAnthropicShortModelIdVariants(model) {
|
|
28
|
-
const normalized = normalizeAnthropicShortModelId(model);
|
|
29
|
-
const { prefix, bare } = splitAnthropicPrefix(normalized);
|
|
30
|
-
if (!supportsShortAnthropicMinorVersion(bare))
|
|
31
|
-
return [model];
|
|
32
|
-
const variants = new Set([model, normalized]);
|
|
33
|
-
variants.add(`${prefix}${bare.replace(DASHED_MINOR_RE, '-$1.$2')}`);
|
|
34
|
-
return [...variants];
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=anthropic-model-id.js.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.computeTokenCost = computeTokenCost;
|
|
4
|
-
function computeTokenCost(input) {
|
|
5
|
-
if (!input.model)
|
|
6
|
-
return null;
|
|
7
|
-
if (input.isSubscription)
|
|
8
|
-
return 0;
|
|
9
|
-
if (input.inputTokens === 0 && input.outputTokens === 0)
|
|
10
|
-
return null;
|
|
11
|
-
const pricing = input.pricing;
|
|
12
|
-
if (!pricing || pricing.input_price_per_token == null || pricing.output_price_per_token == null) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
const cost = input.inputTokens * Number(pricing.input_price_per_token) +
|
|
16
|
-
input.outputTokens * Number(pricing.output_price_per_token);
|
|
17
|
-
return cost < 0 ? null : cost;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=cost-calculator.js.map
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEncryptionSecret = getEncryptionSecret;
|
|
4
|
-
exports.encrypt = encrypt;
|
|
5
|
-
exports.decrypt = decrypt;
|
|
6
|
-
exports.isEncrypted = isEncrypted;
|
|
7
|
-
const crypto_1 = require("crypto");
|
|
8
|
-
const ALGORITHM = 'aes-256-gcm';
|
|
9
|
-
const IV_LENGTH = 16;
|
|
10
|
-
const SALT_LENGTH = 16;
|
|
11
|
-
const KEY_LENGTH = 32;
|
|
12
|
-
function deriveKey(secret, salt) {
|
|
13
|
-
return (0, crypto_1.scryptSync)(secret, salt, KEY_LENGTH);
|
|
14
|
-
}
|
|
15
|
-
function getEncryptionSecret() {
|
|
16
|
-
const key = process.env['MANIFEST_ENCRYPTION_KEY'] || process.env['BETTER_AUTH_SECRET'];
|
|
17
|
-
if (key && key.length >= 32) {
|
|
18
|
-
return key;
|
|
19
|
-
}
|
|
20
|
-
if (process.env['MANIFEST_MODE'] === 'local') {
|
|
21
|
-
const { getLocalAuthSecret } = require('../../common/constants/local-mode.constants');
|
|
22
|
-
return getLocalAuthSecret();
|
|
23
|
-
}
|
|
24
|
-
throw new Error('Encryption secret required. Set MANIFEST_ENCRYPTION_KEY or BETTER_AUTH_SECRET (>=32 chars).');
|
|
25
|
-
}
|
|
26
|
-
function encrypt(plaintext, secret) {
|
|
27
|
-
const salt = (0, crypto_1.randomBytes)(SALT_LENGTH);
|
|
28
|
-
const key = deriveKey(secret, salt);
|
|
29
|
-
const iv = (0, crypto_1.randomBytes)(IV_LENGTH);
|
|
30
|
-
const cipher = (0, crypto_1.createCipheriv)(ALGORITHM, key, iv);
|
|
31
|
-
const encrypted = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
|
|
32
|
-
const tag = cipher.getAuthTag();
|
|
33
|
-
return [
|
|
34
|
-
salt.toString('base64'),
|
|
35
|
-
iv.toString('base64'),
|
|
36
|
-
tag.toString('base64'),
|
|
37
|
-
encrypted.toString('base64'),
|
|
38
|
-
].join(':');
|
|
39
|
-
}
|
|
40
|
-
function decrypt(ciphertext, secret) {
|
|
41
|
-
const parts = ciphertext.split(':');
|
|
42
|
-
if (parts.length !== 4) {
|
|
43
|
-
throw new Error('Invalid ciphertext format');
|
|
44
|
-
}
|
|
45
|
-
const [saltB64, ivB64, tagB64, encryptedB64] = parts;
|
|
46
|
-
const salt = Buffer.from(saltB64, 'base64');
|
|
47
|
-
const iv = Buffer.from(ivB64, 'base64');
|
|
48
|
-
const tag = Buffer.from(tagB64, 'base64');
|
|
49
|
-
const encrypted = Buffer.from(encryptedB64, 'base64');
|
|
50
|
-
const key = deriveKey(secret, salt);
|
|
51
|
-
const decipher = (0, crypto_1.createDecipheriv)(ALGORITHM, key, iv);
|
|
52
|
-
decipher.setAuthTag(tag);
|
|
53
|
-
const decrypted = Buffer.concat([decipher.update(encrypted), decipher.final()]);
|
|
54
|
-
return decrypted.toString('utf8');
|
|
55
|
-
}
|
|
56
|
-
function isEncrypted(value) {
|
|
57
|
-
const parts = value.split(':');
|
|
58
|
-
if (parts.length !== 4)
|
|
59
|
-
return false;
|
|
60
|
-
try {
|
|
61
|
-
for (const part of parts) {
|
|
62
|
-
const buf = Buffer.from(part, 'base64');
|
|
63
|
-
if (buf.toString('base64') !== part)
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
catch {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=crypto.util.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveFrontendDir = resolveFrontendDir;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const fs_1 = require("fs");
|
|
6
|
-
function hasIndex(dir) {
|
|
7
|
-
return (0, fs_1.existsSync)((0, path_1.join)(dir, 'index.html'));
|
|
8
|
-
}
|
|
9
|
-
function resolveFrontendDir() {
|
|
10
|
-
const envDir = process.env['MANIFEST_FRONTEND_DIR'];
|
|
11
|
-
if (envDir && hasIndex(envDir))
|
|
12
|
-
return envDir;
|
|
13
|
-
const monorepo = (0, path_1.join)(__dirname, '..', '..', '..', '..', 'frontend', 'dist');
|
|
14
|
-
if (hasIndex(monorepo))
|
|
15
|
-
return monorepo;
|
|
16
|
-
const embedded = (0, path_1.join)(__dirname, '..', '..', '..', '..', 'public');
|
|
17
|
-
if (hasIndex(embedded))
|
|
18
|
-
return embedded;
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=frontend-path.js.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hashKey = hashKey;
|
|
4
|
-
exports.verifyKey = verifyKey;
|
|
5
|
-
exports.keyPrefix = keyPrefix;
|
|
6
|
-
const crypto_1 = require("crypto");
|
|
7
|
-
const LEGACY_SALT = 'manifest-api-key-salt';
|
|
8
|
-
const KEY_LENGTH = 32;
|
|
9
|
-
const SALT_LENGTH = 16;
|
|
10
|
-
function hashKey(input) {
|
|
11
|
-
const salt = (0, crypto_1.randomBytes)(SALT_LENGTH);
|
|
12
|
-
const hash = (0, crypto_1.scryptSync)(input, salt, KEY_LENGTH);
|
|
13
|
-
return `${salt.toString('hex')}:${hash.toString('hex')}`;
|
|
14
|
-
}
|
|
15
|
-
function verifyKey(input, storedHash) {
|
|
16
|
-
if (storedHash.includes(':')) {
|
|
17
|
-
const [saltHex, hashHex] = storedHash.split(':');
|
|
18
|
-
const salt = Buffer.from(saltHex, 'hex');
|
|
19
|
-
const expected = Buffer.from(hashHex, 'hex');
|
|
20
|
-
const actual = (0, crypto_1.scryptSync)(input, salt, KEY_LENGTH);
|
|
21
|
-
return expected.length === KEY_LENGTH && (0, crypto_1.timingSafeEqual)(actual, expected);
|
|
22
|
-
}
|
|
23
|
-
if (!/^[0-9a-fA-F]{64}$/.test(storedHash))
|
|
24
|
-
return false;
|
|
25
|
-
const legacyHashBuf = (0, crypto_1.scryptSync)(input, LEGACY_SALT, KEY_LENGTH);
|
|
26
|
-
const storedBuf = Buffer.from(storedHash, 'hex');
|
|
27
|
-
return (0, crypto_1.timingSafeEqual)(legacyHashBuf, storedBuf);
|
|
28
|
-
}
|
|
29
|
-
function keyPrefix(key) {
|
|
30
|
-
return key.substring(0, 12);
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=hash.util.js.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isLoopbackIp = isLoopbackIp;
|
|
4
|
-
exports.isAllowedLocalIp = isAllowedLocalIp;
|
|
5
|
-
const FFMPEG_PREFIX = '::ffff:';
|
|
6
|
-
function isLoopbackIp(ip) {
|
|
7
|
-
return ip === '127.0.0.1' || ip === '::1' || ip === '::ffff:127.0.0.1';
|
|
8
|
-
}
|
|
9
|
-
function parseIpv4(ip) {
|
|
10
|
-
return ip.startsWith(FFMPEG_PREFIX) ? ip.slice(FFMPEG_PREFIX.length) : ip;
|
|
11
|
-
}
|
|
12
|
-
function isPrivateIpv4(ipv4) {
|
|
13
|
-
const parts = ipv4.split('.');
|
|
14
|
-
if (parts.length !== 4)
|
|
15
|
-
return false;
|
|
16
|
-
const [a, b] = parts.map(Number);
|
|
17
|
-
if (a === 10)
|
|
18
|
-
return true;
|
|
19
|
-
if (a === 172 && b >= 16 && b <= 31)
|
|
20
|
-
return true;
|
|
21
|
-
if (a === 192 && b === 168)
|
|
22
|
-
return true;
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
function isAllowedLocalIp(ip) {
|
|
26
|
-
if (isLoopbackIp(ip))
|
|
27
|
-
return true;
|
|
28
|
-
if (process.env['MANIFEST_TRUST_LAN'] !== 'true')
|
|
29
|
-
return false;
|
|
30
|
-
const ipv4 = parseIpv4(ip);
|
|
31
|
-
return isPrivateIpv4(ipv4);
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=local-ip.js.map
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.computePeriodBoundaries = computePeriodBoundaries;
|
|
4
|
-
exports.computePeriodResetDate = computePeriodResetDate;
|
|
5
|
-
const fmt = (d) => d.toISOString().replace('T', ' ').replace('Z', '').slice(0, 19);
|
|
6
|
-
function computePeriodBoundaries(period) {
|
|
7
|
-
const now = new Date();
|
|
8
|
-
let start;
|
|
9
|
-
switch (period) {
|
|
10
|
-
case 'hour':
|
|
11
|
-
start = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours() - 1));
|
|
12
|
-
break;
|
|
13
|
-
case 'day':
|
|
14
|
-
start = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()));
|
|
15
|
-
break;
|
|
16
|
-
case 'week': {
|
|
17
|
-
const dayOfWeek = now.getUTCDay();
|
|
18
|
-
const monday = now.getUTCDate() - ((dayOfWeek + 6) % 7);
|
|
19
|
-
start = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), monday));
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
case 'month':
|
|
23
|
-
start = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1));
|
|
24
|
-
break;
|
|
25
|
-
default:
|
|
26
|
-
start = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours() - 1));
|
|
27
|
-
}
|
|
28
|
-
const end = new Date(now.getTime());
|
|
29
|
-
return { periodStart: fmt(start), periodEnd: fmt(end) };
|
|
30
|
-
}
|
|
31
|
-
function computePeriodResetDate(period) {
|
|
32
|
-
const now = new Date();
|
|
33
|
-
let reset;
|
|
34
|
-
switch (period) {
|
|
35
|
-
case 'hour':
|
|
36
|
-
reset = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours() + 1));
|
|
37
|
-
break;
|
|
38
|
-
case 'day':
|
|
39
|
-
reset = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() + 1));
|
|
40
|
-
break;
|
|
41
|
-
case 'week': {
|
|
42
|
-
const dayOfWeek = now.getUTCDay();
|
|
43
|
-
const daysUntilMonday = (8 - dayOfWeek) % 7 || 7;
|
|
44
|
-
reset = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() + daysUntilMonday));
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
case 'month':
|
|
48
|
-
reset = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth() + 1, 1));
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
reset = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours() + 1));
|
|
52
|
-
}
|
|
53
|
-
return fmt(reset);
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=period.util.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.expandProviderNames = void 0;
|
|
4
|
-
exports.inferProviderFromModelName = inferProviderFromModelName;
|
|
5
|
-
var providers_1 = require("../constants/providers");
|
|
6
|
-
Object.defineProperty(exports, "expandProviderNames", { enumerable: true, get: function () { return providers_1.expandProviderNames; } });
|
|
7
|
-
function inferProviderFromModelName(modelName) {
|
|
8
|
-
if (!modelName)
|
|
9
|
-
return undefined;
|
|
10
|
-
const slashIdx = modelName.indexOf('/');
|
|
11
|
-
return slashIdx > 0 ? modelName.substring(0, slashIdx).toLowerCase() : undefined;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=provider-aliases.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inferProviderFromModel = exports.MODEL_PREFIX_MAP = void 0;
|
|
4
|
-
var manifest_shared_1 = require("manifest-shared");
|
|
5
|
-
Object.defineProperty(exports, "MODEL_PREFIX_MAP", { enumerable: true, get: function () { return manifest_shared_1.MODEL_PREFIX_MAP; } });
|
|
6
|
-
Object.defineProperty(exports, "inferProviderFromModel", { enumerable: true, get: function () { return manifest_shared_1.inferProviderFromModel; } });
|
|
7
|
-
//# sourceMappingURL=provider-inference.js.map
|