manifest 5.17.0 → 5.19.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/README.md +105 -124
- package/dist/backend/analytics/services/aggregation.service.js +5 -1
- package/dist/backend/analytics/services/timeseries-queries.service.js +1 -0
- package/dist/backend/auth/auth.instance.js +5 -2
- package/dist/backend/common/guards/api-key.guard.js +3 -2
- package/dist/backend/common/utils/crypto.util.js +3 -10
- package/dist/backend/common/utils/hash.util.js +2 -2
- package/dist/backend/common/utils/sql-dialect.js +1 -1
- package/dist/backend/config/app.config.js +2 -2
- package/dist/backend/database/database-seeder.service.js +130 -15
- package/dist/backend/database/database.module.js +28 -8
- package/dist/backend/database/local-bootstrap.service.js +38 -3
- package/dist/backend/database/pricing-sync.service.js +5 -3
- package/dist/backend/database/quality-score.util.js +1 -0
- package/dist/backend/database/seed-messages.js +54 -0
- package/dist/backend/model-prices/model-name-normalizer.js +10 -0
- package/dist/backend/notifications/dto/notification-rule.dto.js +2 -2
- package/dist/backend/notifications/notifications.controller.js +1 -1
- package/dist/backend/notifications/services/notification-rules.service.js +2 -2
- package/dist/backend/otlp/guards/otlp-auth.guard.js +5 -7
- package/dist/backend/otlp/services/api-key.service.js +2 -2
- package/dist/backend/otlp/services/trace-ingest.service.js +14 -0
- package/dist/backend/routing/provider-aliases.js +3 -0
- package/dist/backend/routing/proxy/anthropic-adapter.js +234 -0
- package/dist/backend/routing/proxy/cache-injection.js +33 -0
- package/dist/backend/routing/proxy/google-adapter.js +6 -1
- package/dist/backend/routing/proxy/provider-client.js +28 -2
- package/dist/backend/routing/proxy/provider-endpoints.js +21 -3
- package/dist/backend/routing/proxy/proxy.controller.js +19 -3
- package/dist/backend/routing/proxy/proxy.service.js +5 -1
- package/dist/index.js +3 -3
- package/dist/openclaw.plugin.json +1 -0
- package/dist/server.d.ts +0 -1
- package/dist/server.js +2 -1
- package/openclaw.plugin.json +1 -0
- package/package.json +2 -2
- package/public/assets/index-CTglHtZk.css +1 -0
- package/public/assets/index-Lt9Tg-Oh.js +7 -0
- package/public/index.html +2 -2
- package/dist/backend/analytics/analytics.module.d.ts +0 -2
- package/dist/backend/analytics/analytics.module.js.map +0 -1
- package/dist/backend/analytics/controllers/agent-analytics.controller.d.ts +0 -14
- package/dist/backend/analytics/controllers/agent-analytics.controller.js.map +0 -1
- package/dist/backend/analytics/controllers/agents.controller.d.ts +0 -49
- package/dist/backend/analytics/controllers/agents.controller.js.map +0 -1
- package/dist/backend/analytics/controllers/costs.controller.d.ts +0 -28
- package/dist/backend/analytics/controllers/costs.controller.js.map +0 -1
- package/dist/backend/analytics/controllers/messages.controller.d.ts +0 -13
- package/dist/backend/analytics/controllers/messages.controller.js.map +0 -1
- package/dist/backend/analytics/controllers/overview.controller.d.ts +0 -59
- package/dist/backend/analytics/controllers/overview.controller.js.map +0 -1
- package/dist/backend/analytics/controllers/tokens.controller.d.ts +0 -26
- package/dist/backend/analytics/controllers/tokens.controller.js.map +0 -1
- package/dist/backend/analytics/dto/messages-query.dto.d.ts +0 -11
- package/dist/backend/analytics/dto/messages-query.dto.js.map +0 -1
- package/dist/backend/analytics/services/agent-analytics.service.d.ts +0 -33
- package/dist/backend/analytics/services/agent-analytics.service.js.map +0 -1
- package/dist/backend/analytics/services/aggregation.service.d.ts +0 -39
- package/dist/backend/analytics/services/aggregation.service.js.map +0 -1
- package/dist/backend/analytics/services/query-helpers.d.ts +0 -10
- package/dist/backend/analytics/services/query-helpers.js.map +0 -1
- package/dist/backend/analytics/services/timeseries-queries.service.d.ts +0 -59
- package/dist/backend/analytics/services/timeseries-queries.service.js.map +0 -1
- package/dist/backend/app.module.d.ts +0 -2
- package/dist/backend/app.module.js.map +0 -1
- package/dist/backend/auth/auth.instance.d.ts +0 -6
- package/dist/backend/auth/auth.instance.js.map +0 -1
- package/dist/backend/auth/auth.module.d.ts +0 -2
- package/dist/backend/auth/auth.module.js.map +0 -1
- package/dist/backend/auth/current-user.decorator.d.ts +0 -1
- package/dist/backend/auth/current-user.decorator.js.map +0 -1
- package/dist/backend/auth/local-auth.guard.d.ts +0 -7
- package/dist/backend/auth/local-auth.guard.js.map +0 -1
- package/dist/backend/auth/session.guard.d.ts +0 -7
- package/dist/backend/auth/session.guard.js.map +0 -1
- package/dist/backend/common/common.module.d.ts +0 -2
- package/dist/backend/common/common.module.js.map +0 -1
- package/dist/backend/common/constants/api-key.constants.d.ts +0 -1
- package/dist/backend/common/constants/api-key.constants.js.map +0 -1
- package/dist/backend/common/constants/cache.constants.d.ts +0 -2
- package/dist/backend/common/constants/cache.constants.js.map +0 -1
- package/dist/backend/common/constants/local-mode.constants.d.ts +0 -15
- package/dist/backend/common/constants/local-mode.constants.js.map +0 -1
- package/dist/backend/common/constants/ollama.d.ts +0 -1
- package/dist/backend/common/constants/ollama.js.map +0 -1
- package/dist/backend/common/decorators/public.decorator.d.ts +0 -2
- package/dist/backend/common/decorators/public.decorator.js.map +0 -1
- package/dist/backend/common/dto/create-agent.dto.d.ts +0 -3
- package/dist/backend/common/dto/create-agent.dto.js.map +0 -1
- package/dist/backend/common/dto/range-query.dto.d.ts +0 -4
- package/dist/backend/common/dto/range-query.dto.js.map +0 -1
- package/dist/backend/common/dto/rename-agent.dto.d.ts +0 -3
- package/dist/backend/common/dto/rename-agent.dto.js.map +0 -1
- package/dist/backend/common/filters/spa-fallback.filter.d.ts +0 -6
- package/dist/backend/common/filters/spa-fallback.filter.js.map +0 -1
- package/dist/backend/common/guards/api-key.guard.d.ts +0 -14
- package/dist/backend/common/guards/api-key.guard.js.map +0 -1
- package/dist/backend/common/interceptors/user-cache.interceptor.d.ts +0 -9
- package/dist/backend/common/interceptors/user-cache.interceptor.js.map +0 -1
- package/dist/backend/common/services/cache-invalidation.service.d.ts +0 -16
- package/dist/backend/common/services/cache-invalidation.service.js.map +0 -1
- package/dist/backend/common/services/ingest-event-bus.service.d.ts +0 -11
- package/dist/backend/common/services/ingest-event-bus.service.js.map +0 -1
- package/dist/backend/common/utils/crypto.util.d.ts +0 -4
- package/dist/backend/common/utils/crypto.util.js.map +0 -1
- package/dist/backend/common/utils/hash.util.d.ts +0 -2
- package/dist/backend/common/utils/hash.util.js.map +0 -1
- package/dist/backend/common/utils/period.util.d.ts +0 -5
- package/dist/backend/common/utils/period.util.js.map +0 -1
- package/dist/backend/common/utils/posthog-sender.d.ts +0 -1
- package/dist/backend/common/utils/posthog-sender.js.map +0 -1
- package/dist/backend/common/utils/product-telemetry.d.ts +0 -3
- package/dist/backend/common/utils/product-telemetry.js.map +0 -1
- package/dist/backend/common/utils/range.util.d.ts +0 -3
- package/dist/backend/common/utils/range.util.js.map +0 -1
- package/dist/backend/common/utils/slugify.d.ts +0 -1
- package/dist/backend/common/utils/slugify.js.map +0 -1
- package/dist/backend/common/utils/sql-dialect.d.ts +0 -12
- package/dist/backend/common/utils/sql-dialect.js.map +0 -1
- package/dist/backend/config/app.config.d.ts +0 -31
- package/dist/backend/config/app.config.js.map +0 -1
- package/dist/backend/database/database-seeder.service.d.ts +0 -32
- package/dist/backend/database/database-seeder.service.js.map +0 -1
- package/dist/backend/database/database.module.d.ts +0 -2
- package/dist/backend/database/database.module.js.map +0 -1
- package/dist/backend/database/datasource.d.ts +0 -4
- package/dist/backend/database/datasource.js.map +0 -1
- package/dist/backend/database/local-bootstrap.service.d.ts +0 -23
- package/dist/backend/database/local-bootstrap.service.js.map +0 -1
- package/dist/backend/database/migrations/1771464895790-InitialSchema.d.ts +0 -6
- package/dist/backend/database/migrations/1771464895790-InitialSchema.js.map +0 -1
- package/dist/backend/database/migrations/1771500000000-HashApiKeys.d.ts +0 -6
- package/dist/backend/database/migrations/1771500000000-HashApiKeys.js.map +0 -1
- package/dist/backend/database/migrations/1771600000000-AddModelCapabilities.d.ts +0 -5
- package/dist/backend/database/migrations/1771600000000-AddModelCapabilities.js.map +0 -1
- package/dist/backend/database/migrations/1771600000000-ModelPricingImprovements.d.ts +0 -9
- package/dist/backend/database/migrations/1771600000000-ModelPricingImprovements.js.map +0 -1
- package/dist/backend/database/migrations/1771700000000-AddRoutingTables.d.ts +0 -5
- package/dist/backend/database/migrations/1771700000000-AddRoutingTables.js.map +0 -1
- package/dist/backend/database/migrations/1771700000000-EmailProviderConfigs.d.ts +0 -6
- package/dist/backend/database/migrations/1771700000000-EmailProviderConfigs.js.map +0 -1
- package/dist/backend/database/migrations/1771800000000-AddNotificationEmailAndOptionalDomain.d.ts +0 -6
- package/dist/backend/database/migrations/1771800000000-AddNotificationEmailAndOptionalDomain.js.map +0 -1
- package/dist/backend/database/migrations/1771800000000-AddQualityScore.d.ts +0 -5
- package/dist/backend/database/migrations/1771800000000-AddQualityScore.js.map +0 -1
- package/dist/backend/database/migrations/1771800100000-SeedQualityScores.d.ts +0 -5
- package/dist/backend/database/migrations/1771800100000-SeedQualityScores.js.map +0 -1
- package/dist/backend/database/migrations/1771900000000-EncryptApiKeys.d.ts +0 -6
- package/dist/backend/database/migrations/1771900000000-EncryptApiKeys.js.map +0 -1
- package/dist/backend/database/migrations/1772000000000-MakeApiKeyNullable.d.ts +0 -5
- package/dist/backend/database/migrations/1772000000000-MakeApiKeyNullable.js.map +0 -1
- package/dist/backend/database/migrations/1772100000000-AddRoutingTier.d.ts +0 -6
- package/dist/backend/database/migrations/1772100000000-AddRoutingTier.js.map +0 -1
- package/dist/backend/database/migrations/1772200000000-AddLimitAction.d.ts +0 -6
- package/dist/backend/database/migrations/1772200000000-AddLimitAction.js.map +0 -1
- package/dist/backend/database/migrations/1772300000000-AddRoutingReason.d.ts +0 -6
- package/dist/backend/database/migrations/1772300000000-AddRoutingReason.js.map +0 -1
- package/dist/backend/database/migrations/1772400000000-AddAgentDisplayName.d.ts +0 -5
- package/dist/backend/database/migrations/1772400000000-AddAgentDisplayName.js.map +0 -1
- package/dist/backend/database/ollama-sync.service.d.ts +0 -12
- package/dist/backend/database/ollama-sync.service.js.map +0 -1
- package/dist/backend/database/pricing-history.service.d.ts +0 -19
- package/dist/backend/database/pricing-history.service.js.map +0 -1
- package/dist/backend/database/pricing-sync.service.d.ts +0 -28
- package/dist/backend/database/pricing-sync.service.js.map +0 -1
- package/dist/backend/database/quality-score.util.d.ts +0 -3
- package/dist/backend/database/quality-score.util.js.map +0 -1
- package/dist/backend/entities/agent-api-key.entity.d.ts +0 -17
- package/dist/backend/entities/agent-api-key.entity.js.map +0 -1
- package/dist/backend/entities/agent-log.entity.d.ts +0 -12
- package/dist/backend/entities/agent-log.entity.js.map +0 -1
- package/dist/backend/entities/agent-message.entity.d.ts +0 -25
- package/dist/backend/entities/agent-message.entity.js.map +0 -1
- package/dist/backend/entities/agent.entity.d.ts +0 -14
- package/dist/backend/entities/agent.entity.js.map +0 -1
- package/dist/backend/entities/api-key.entity.d.ts +0 -10
- package/dist/backend/entities/api-key.entity.js.map +0 -1
- package/dist/backend/entities/cost-snapshot.entity.d.ts +0 -9
- package/dist/backend/entities/cost-snapshot.entity.js.map +0 -1
- package/dist/backend/entities/email-provider-config.entity.d.ts +0 -11
- package/dist/backend/entities/email-provider-config.entity.js.map +0 -1
- package/dist/backend/entities/llm-call.entity.d.ts +0 -19
- package/dist/backend/entities/llm-call.entity.js.map +0 -1
- package/dist/backend/entities/model-pricing-history.entity.d.ts +0 -10
- package/dist/backend/entities/model-pricing-history.entity.js.map +0 -1
- package/dist/backend/entities/model-pricing.entity.d.ts +0 -11
- package/dist/backend/entities/model-pricing.entity.js.map +0 -1
- package/dist/backend/entities/notification-log.entity.d.ts +0 -11
- package/dist/backend/entities/notification-log.entity.js.map +0 -1
- package/dist/backend/entities/notification-rule.entity.d.ts +0 -14
- package/dist/backend/entities/notification-rule.entity.js.map +0 -1
- package/dist/backend/entities/security-event.entity.d.ts +0 -9
- package/dist/backend/entities/security-event.entity.js.map +0 -1
- package/dist/backend/entities/tenant.entity.d.ts +0 -11
- package/dist/backend/entities/tenant.entity.js.map +0 -1
- package/dist/backend/entities/tier-assignment.entity.d.ts +0 -8
- package/dist/backend/entities/tier-assignment.entity.js.map +0 -1
- package/dist/backend/entities/token-usage-snapshot.entity.d.ts +0 -12
- package/dist/backend/entities/token-usage-snapshot.entity.js.map +0 -1
- package/dist/backend/entities/tool-execution.entity.d.ts +0 -10
- package/dist/backend/entities/tool-execution.entity.js.map +0 -1
- package/dist/backend/entities/unresolved-model.entity.d.ts +0 -9
- package/dist/backend/entities/unresolved-model.entity.js.map +0 -1
- package/dist/backend/entities/user-provider.entity.d.ts +0 -9
- package/dist/backend/entities/user-provider.entity.js.map +0 -1
- package/dist/backend/github/github.controller.d.ts +0 -5
- package/dist/backend/github/github.controller.js.map +0 -1
- package/dist/backend/github/github.module.d.ts +0 -2
- package/dist/backend/github/github.module.js.map +0 -1
- package/dist/backend/health/health.controller.d.ts +0 -15
- package/dist/backend/health/health.controller.js.map +0 -1
- package/dist/backend/health/health.module.d.ts +0 -2
- package/dist/backend/health/health.module.js.map +0 -1
- package/dist/backend/health/version-check.service.d.ts +0 -23
- package/dist/backend/health/version-check.service.js.map +0 -1
- package/dist/backend/main.d.ts +0 -1
- package/dist/backend/main.js.map +0 -1
- package/dist/backend/model-prices/model-name-normalizer.d.ts +0 -4
- package/dist/backend/model-prices/model-name-normalizer.js.map +0 -1
- package/dist/backend/model-prices/model-prices.controller.d.ts +0 -30
- package/dist/backend/model-prices/model-prices.controller.js.map +0 -1
- package/dist/backend/model-prices/model-prices.module.d.ts +0 -2
- package/dist/backend/model-prices/model-prices.module.js.map +0 -1
- package/dist/backend/model-prices/model-prices.service.d.ts +0 -36
- package/dist/backend/model-prices/model-prices.service.js.map +0 -1
- package/dist/backend/model-prices/model-pricing-cache.service.d.ts +0 -16
- package/dist/backend/model-prices/model-pricing-cache.service.js.map +0 -1
- package/dist/backend/model-prices/unresolved-model-tracker.service.d.ts +0 -16
- package/dist/backend/model-prices/unresolved-model-tracker.service.js.map +0 -1
- package/dist/backend/notifications/dto/email-config.dto.d.ts +0 -13
- package/dist/backend/notifications/dto/email-config.dto.js.map +0 -1
- package/dist/backend/notifications/dto/notification-email.dto.d.ts +0 -3
- package/dist/backend/notifications/dto/notification-email.dto.js.map +0 -1
- package/dist/backend/notifications/dto/notification-rule.dto.d.ts +0 -14
- package/dist/backend/notifications/dto/notification-rule.dto.js.map +0 -1
- package/dist/backend/notifications/dto/set-email-provider.dto.d.ts +0 -12
- package/dist/backend/notifications/dto/set-email-provider.dto.js.map +0 -1
- package/dist/backend/notifications/email-config.controller.d.ts +0 -32
- package/dist/backend/notifications/email-config.controller.js.map +0 -1
- package/dist/backend/notifications/emails/reset-password.d.ts +0 -5
- package/dist/backend/notifications/emails/reset-password.js.map +0 -1
- package/dist/backend/notifications/emails/test-email.d.ts +0 -1
- package/dist/backend/notifications/emails/test-email.js.map +0 -1
- package/dist/backend/notifications/emails/threshold-alert.d.ts +0 -9
- package/dist/backend/notifications/emails/threshold-alert.js.map +0 -1
- package/dist/backend/notifications/emails/verify-email.d.ts +0 -5
- package/dist/backend/notifications/emails/verify-email.js.map +0 -1
- package/dist/backend/notifications/notifications.controller.d.ts +0 -50
- package/dist/backend/notifications/notifications.controller.js.map +0 -1
- package/dist/backend/notifications/notifications.module.d.ts +0 -2
- package/dist/backend/notifications/notifications.module.js.map +0 -1
- package/dist/backend/notifications/services/email-config.service.d.ts +0 -25
- package/dist/backend/notifications/services/email-config.service.js.map +0 -1
- package/dist/backend/notifications/services/email-provider-config.service.d.ts +0 -43
- package/dist/backend/notifications/services/email-provider-config.service.js.map +0 -1
- package/dist/backend/notifications/services/email-provider-validation.d.ts +0 -10
- package/dist/backend/notifications/services/email-provider-validation.js.map +0 -1
- package/dist/backend/notifications/services/email-providers/email-provider.interface.d.ts +0 -18
- package/dist/backend/notifications/services/email-providers/email-provider.interface.js.map +0 -1
- package/dist/backend/notifications/services/email-providers/mailgun.provider.d.ts +0 -9
- package/dist/backend/notifications/services/email-providers/mailgun.provider.js.map +0 -1
- package/dist/backend/notifications/services/email-providers/resend.provider.d.ts +0 -8
- package/dist/backend/notifications/services/email-providers/resend.provider.js.map +0 -1
- package/dist/backend/notifications/services/email-providers/resolve-provider.d.ts +0 -2
- package/dist/backend/notifications/services/email-providers/resolve-provider.js.map +0 -1
- package/dist/backend/notifications/services/email-providers/send-email.d.ts +0 -2
- package/dist/backend/notifications/services/email-providers/send-email.js.map +0 -1
- package/dist/backend/notifications/services/email-providers/sendgrid.provider.d.ts +0 -9
- package/dist/backend/notifications/services/email-providers/sendgrid.provider.js.map +0 -1
- package/dist/backend/notifications/services/limit-check.service.d.ts +0 -36
- package/dist/backend/notifications/services/limit-check.service.js.map +0 -1
- package/dist/backend/notifications/services/notification-cron.service.d.ts +0 -19
- package/dist/backend/notifications/services/notification-cron.service.js.map +0 -1
- package/dist/backend/notifications/services/notification-email-address.service.d.ts +0 -8
- package/dist/backend/notifications/services/notification-email-address.service.js.map +0 -1
- package/dist/backend/notifications/services/notification-email.service.d.ts +0 -9
- package/dist/backend/notifications/services/notification-email.service.js.map +0 -1
- package/dist/backend/notifications/services/notification-rules.service.d.ts +0 -18
- package/dist/backend/notifications/services/notification-rules.service.js.map +0 -1
- package/dist/backend/otlp/guards/otlp-auth.guard.d.ts +0 -15
- package/dist/backend/otlp/guards/otlp-auth.guard.js.map +0 -1
- package/dist/backend/otlp/interfaces/index.d.ts +0 -4
- package/dist/backend/otlp/interfaces/index.js.map +0 -1
- package/dist/backend/otlp/interfaces/ingestion-context.interface.d.ts +0 -6
- package/dist/backend/otlp/interfaces/ingestion-context.interface.js.map +0 -1
- package/dist/backend/otlp/interfaces/otlp-common.d.ts +0 -26
- package/dist/backend/otlp/interfaces/otlp-common.js.map +0 -1
- package/dist/backend/otlp/interfaces/otlp-log.d.ts +0 -22
- package/dist/backend/otlp/interfaces/otlp-log.js.map +0 -1
- package/dist/backend/otlp/interfaces/otlp-metric.d.ts +0 -34
- package/dist/backend/otlp/interfaces/otlp-metric.js.map +0 -1
- package/dist/backend/otlp/interfaces/otlp-trace.d.ts +0 -33
- package/dist/backend/otlp/interfaces/otlp-trace.js.map +0 -1
- package/dist/backend/otlp/otlp.controller.d.ts +0 -38
- package/dist/backend/otlp/otlp.controller.js.map +0 -1
- package/dist/backend/otlp/otlp.module.d.ts +0 -2
- package/dist/backend/otlp/otlp.module.js.map +0 -1
- package/dist/backend/otlp/proto/otlp-proto-defs.d.ts +0 -1
- package/dist/backend/otlp/proto/otlp-proto-defs.js.map +0 -1
- package/dist/backend/otlp/services/api-key.service.d.ts +0 -29
- package/dist/backend/otlp/services/api-key.service.js.map +0 -1
- package/dist/backend/otlp/services/log-ingest.service.d.ts +0 -11
- package/dist/backend/otlp/services/log-ingest.service.js.map +0 -1
- package/dist/backend/otlp/services/metric-ingest.service.d.ts +0 -16
- package/dist/backend/otlp/services/metric-ingest.service.js.map +0 -1
- package/dist/backend/otlp/services/otlp-decoder.service.d.ts +0 -14
- package/dist/backend/otlp/services/otlp-decoder.service.js.map +0 -1
- package/dist/backend/otlp/services/otlp-helpers.d.ts +0 -14
- package/dist/backend/otlp/services/otlp-helpers.js.map +0 -1
- package/dist/backend/otlp/services/trace-ingest.service.d.ts +0 -27
- package/dist/backend/otlp/services/trace-ingest.service.js.map +0 -1
- package/dist/backend/routing/dto/resolve-request.dto.d.ts +0 -13
- package/dist/backend/routing/dto/resolve-request.dto.js.map +0 -1
- package/dist/backend/routing/dto/resolve-response.d.ts +0 -9
- package/dist/backend/routing/dto/resolve-response.js.map +0 -1
- package/dist/backend/routing/dto/routing.dto.d.ts +0 -13
- package/dist/backend/routing/dto/routing.dto.js.map +0 -1
- package/dist/backend/routing/provider-aliases.d.ts +0 -1
- package/dist/backend/routing/provider-aliases.js.map +0 -1
- package/dist/backend/routing/proxy/google-adapter.d.ts +0 -3
- package/dist/backend/routing/proxy/google-adapter.js.map +0 -1
- package/dist/backend/routing/proxy/provider-client.d.ts +0 -10
- package/dist/backend/routing/proxy/provider-client.js.map +0 -1
- package/dist/backend/routing/proxy/provider-endpoints.d.ts +0 -8
- package/dist/backend/routing/proxy/provider-endpoints.js.map +0 -1
- package/dist/backend/routing/proxy/proxy-rate-limiter.d.ts +0 -13
- package/dist/backend/routing/proxy/proxy-rate-limiter.js.map +0 -1
- package/dist/backend/routing/proxy/proxy.controller.d.ts +0 -24
- package/dist/backend/routing/proxy/proxy.controller.js.map +0 -1
- package/dist/backend/routing/proxy/proxy.service.d.ts +0 -27
- package/dist/backend/routing/proxy/proxy.service.js.map +0 -1
- package/dist/backend/routing/proxy/session-momentum.service.d.ts +0 -11
- package/dist/backend/routing/proxy/session-momentum.service.js.map +0 -1
- package/dist/backend/routing/proxy/stream-writer.d.ts +0 -7
- package/dist/backend/routing/proxy/stream-writer.js.map +0 -1
- package/dist/backend/routing/resolve.controller.d.ts +0 -12
- package/dist/backend/routing/resolve.controller.js.map +0 -1
- package/dist/backend/routing/resolve.service.d.ts +0 -13
- package/dist/backend/routing/resolve.service.js.map +0 -1
- package/dist/backend/routing/routing.controller.d.ts +0 -55
- package/dist/backend/routing/routing.controller.js.map +0 -1
- package/dist/backend/routing/routing.module.d.ts +0 -2
- package/dist/backend/routing/routing.module.js.map +0 -1
- package/dist/backend/routing/routing.service.d.ts +0 -30
- package/dist/backend/routing/routing.service.js.map +0 -1
- package/dist/backend/routing/scorer/__tests__/fixtures.d.ts +0 -8
- package/dist/backend/routing/scorer/__tests__/fixtures.js.map +0 -1
- package/dist/backend/routing/scorer/config.d.ts +0 -3
- package/dist/backend/routing/scorer/config.js.map +0 -1
- package/dist/backend/routing/scorer/dimensions/contextual-dimensions.d.ts +0 -5
- package/dist/backend/routing/scorer/dimensions/contextual-dimensions.js.map +0 -1
- package/dist/backend/routing/scorer/dimensions/index.d.ts +0 -3
- package/dist/backend/routing/scorer/dimensions/index.js.map +0 -1
- package/dist/backend/routing/scorer/dimensions/keyword-dimensions.d.ts +0 -7
- package/dist/backend/routing/scorer/dimensions/keyword-dimensions.js.map +0 -1
- package/dist/backend/routing/scorer/dimensions/structural-dimensions.d.ts +0 -5
- package/dist/backend/routing/scorer/dimensions/structural-dimensions.js.map +0 -1
- package/dist/backend/routing/scorer/index.d.ts +0 -6
- package/dist/backend/routing/scorer/index.js.map +0 -1
- package/dist/backend/routing/scorer/keyword-trie.d.ts +0 -18
- package/dist/backend/routing/scorer/keyword-trie.js.map +0 -1
- package/dist/backend/routing/scorer/momentum.d.ts +0 -8
- package/dist/backend/routing/scorer/momentum.js.map +0 -1
- package/dist/backend/routing/scorer/overrides.d.ts +0 -4
- package/dist/backend/routing/scorer/overrides.js.map +0 -1
- package/dist/backend/routing/scorer/sigmoid.d.ts +0 -3
- package/dist/backend/routing/scorer/sigmoid.js.map +0 -1
- package/dist/backend/routing/scorer/text-extractor.d.ts +0 -9
- package/dist/backend/routing/scorer/text-extractor.js.map +0 -1
- package/dist/backend/routing/scorer/types.d.ts +0 -56
- package/dist/backend/routing/scorer/types.js.map +0 -1
- package/dist/backend/routing/tier-auto-assign.service.d.ts +0 -20
- package/dist/backend/routing/tier-auto-assign.service.js.map +0 -1
- package/dist/backend/security/security.controller.d.ts +0 -16
- package/dist/backend/security/security.controller.js.map +0 -1
- package/dist/backend/security/security.module.d.ts +0 -2
- package/dist/backend/security/security.module.js.map +0 -1
- package/dist/backend/security/security.service.d.ts +0 -22
- package/dist/backend/security/security.service.js.map +0 -1
- package/dist/backend/sse/sse.controller.d.ts +0 -13
- package/dist/backend/sse/sse.controller.js.map +0 -1
- package/dist/backend/sse/sse.module.d.ts +0 -2
- package/dist/backend/sse/sse.module.js.map +0 -1
- package/dist/backend/telemetry/dto/create-telemetry.dto.d.ts +0 -20
- package/dist/backend/telemetry/dto/create-telemetry.dto.js.map +0 -1
- package/dist/backend/telemetry/telemetry.controller.d.ts +0 -13
- package/dist/backend/telemetry/telemetry.controller.js.map +0 -1
- package/dist/backend/telemetry/telemetry.module.d.ts +0 -2
- package/dist/backend/telemetry/telemetry.module.js.map +0 -1
- package/dist/backend/telemetry/telemetry.service.d.ts +0 -26
- package/dist/backend/telemetry/telemetry.service.js.map +0 -1
- package/public/assets/index-BuT7UE_1.css +0 -1
- package/public/assets/index-CQkPcBNT.js +0 -7
- package/public/fonts/bricolage-grotesque-latin-ext.woff2 +0 -0
- package/public/fonts/dm-sans-latin-ext.woff2 +0 -0
- package/public/og-image.png +0 -0
package/README.md
CHANGED
|
@@ -1,171 +1,152 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mnfst/manifest/HEAD/.github/assets/logo-white.svg" />
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/mnfst/manifest/HEAD/.github/assets/logo-dark.svg" />
|
|
5
|
+
<img src="https://raw.githubusercontent.com/mnfst/manifest/HEAD/.github/assets/logo-dark.svg" alt="Manifest" height="53" title="Manifest"/>
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
<p align="center">
|
|
9
|
+
🦞 Take control of your
|
|
10
|
+
OpenClaw costs
|
|
11
|
+
</p>
|
|
2
12
|
|
|
3
|
-
|
|
13
|
+

|
|
4
14
|
|
|
5
|
-
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://github.com/mnfst/manifest/stargazers"><img src="https://img.shields.io/github/stars/mnfst/manifest?style=flat" alt="GitHub stars" /></a>
|
|
17
|
+
|
|
18
|
+
<a href="https://www.npmjs.com/package/manifest"><img src="https://img.shields.io/npm/v/manifest?color=cb3837&label=npm" alt="npm version" /></a>
|
|
19
|
+
|
|
20
|
+
<a href="https://www.npmjs.com/package/manifest"><img src="https://img.shields.io/npm/dw/manifest?color=cb3837" alt="npm downloads" /></a>
|
|
21
|
+
|
|
22
|
+
<a href="https://github.com/mnfst/manifest/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/mnfst/manifest/ci.yml?branch=main&label=CI" alt="CI status" /></a>
|
|
23
|
+
|
|
24
|
+
<a href="https://app.codecov.io/gh/mnfst/manifest"><img src="https://img.shields.io/codecov/c/github/mnfst/manifest?label=coverage" alt="Codecov" /></a>
|
|
25
|
+
|
|
26
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/mnfst/manifest?color=blue" alt="license" /></a>
|
|
27
|
+
|
|
28
|
+
<a href="https://discord.gg/FepAked3W7"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord" /></a>
|
|
29
|
+
</p>
|
|
6
30
|
|
|
7
|
-
##
|
|
31
|
+
## What do you get?
|
|
8
32
|
|
|
9
|
-
|
|
33
|
+
- 🔀 **Routes every request to the right model** — and cuts costs up to 70%
|
|
34
|
+
- 📊 **Track your expenses** — real-time dashboard that shows tokens and costs per model
|
|
35
|
+
- 🔔 **Set limits** — set up alerts (soft or hard) if your consumption exceeds a certain volume
|
|
10
36
|
|
|
11
|
-
|
|
12
|
-
openclaw plugins install manifest
|
|
13
|
-
openclaw config set plugins.entries.manifest.config.apiKey "mnfst_YOUR_KEY"
|
|
14
|
-
openclaw gateway restart
|
|
15
|
-
```
|
|
37
|
+
## Why Manifest
|
|
16
38
|
|
|
17
|
-
|
|
39
|
+
OpenClaw sends all your requests to the same model, which is not cost-effective since you summon big models for tiny tasks. Manifest solves it by redirecting queries to the most cost-effective model.
|
|
18
40
|
|
|
19
|
-
|
|
41
|
+
Manifest is an OpenClaw plugin that intercepts your query, passes it through a 23-dimension scoring algorithm in <2ms and sends it to the most suitable model.
|
|
20
42
|
|
|
21
|
-
|
|
22
|
-
openclaw plugins install manifest
|
|
23
|
-
openclaw config set plugins.entries.manifest.config.mode local
|
|
24
|
-
openclaw gateway restart
|
|
25
|
-
```
|
|
43
|
+
Unlike almost all alternatives, everything stays on your machine. No suspicious installer, no black box, no third party, no crypto.
|
|
26
44
|
|
|
27
|
-
|
|
45
|
+
## Quick Start
|
|
28
46
|
|
|
29
|
-
|
|
47
|
+
### Cloud vs Local
|
|
30
48
|
|
|
31
|
-
Manifest
|
|
49
|
+
Manifest is available in cloud and local versions. While both versions install the same OpenClaw Plugin, the local version stores the telemetry data on your computer and the cloud version uses our secure platform.
|
|
32
50
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
#### Use cloud if
|
|
52
|
+
- You want a quick install
|
|
53
|
+
- You want to access the dashboard from different devices
|
|
54
|
+
- You want to connect multiple agents
|
|
37
55
|
|
|
38
|
-
|
|
56
|
+
#### Use local if
|
|
57
|
+
- You don't want the telemetry data to move from your computer
|
|
58
|
+
- You don’t need multi-device access
|
|
59
|
+
- You don't want to subscribe to a cloud service
|
|
39
60
|
|
|
40
|
-
|
|
61
|
+
If you don't know which version to choose, start with the **cloud version**.
|
|
41
62
|
|
|
42
|
-
|
|
63
|
+
### Cloud (default)
|
|
43
64
|
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
model: auto
|
|
65
|
+
```bash
|
|
66
|
+
openclaw plugins install manifest
|
|
67
|
+
openclaw config set plugins.entries.manifest.config.apiKey "mnfst_YOUR_KEY"
|
|
68
|
+
openclaw gateway restart
|
|
49
69
|
```
|
|
50
70
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
The dashboard tracks every LLM call in real time:
|
|
54
|
-
|
|
55
|
-
- **Token usage** — input, output, and cache-read tokens broken down by model and provider
|
|
56
|
-
- **Cost breakdown** — per-model spend in USD with trend indicators
|
|
57
|
-
- **Message log** — paginated history with latency, tokens, and tool calls per request
|
|
58
|
-
- **Agent overview** — aggregated metrics across all your agents
|
|
59
|
-
|
|
60
|
-
### Agent self-query tools
|
|
61
|
-
|
|
62
|
-
The plugin registers three tools your agent can call to query its own telemetry:
|
|
71
|
+
Sign up at [app.manifest.build](https://app.manifest.build) to get your API key.
|
|
63
72
|
|
|
64
|
-
|
|
65
|
-
|------|---------|
|
|
66
|
-
| `manifest_usage` | Token consumption (input, output, cache, trend %) |
|
|
67
|
-
| `manifest_costs` | Cost breakdown by model in USD |
|
|
68
|
-
| `manifest_health` | Connectivity check |
|
|
73
|
+
### Local
|
|
69
74
|
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
```bash
|
|
76
|
+
openclaw plugins install manifest
|
|
77
|
+
openclaw config set plugins.entries.manifest.config.mode local
|
|
78
|
+
openclaw gateway restart
|
|
74
79
|
```
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
Dashboard opens at **http://127.0.0.1:2099**. Telemetry from your agents flows in automatically.
|
|
77
82
|
|
|
78
|
-
|
|
79
|
-
- **Cloud mode**: Only OpenTelemetry metadata (model, tokens, latency) is sent. Message content is never collected.
|
|
83
|
+
## Features
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
- **LLM Router** — scores each query and calls the most suitable model
|
|
86
|
+
- **Real-time dashboard** — tokens, costs, messages, and model usage at a glance
|
|
87
|
+
- **No coding required** — Simple install as OpenClaw plugin
|
|
88
|
+
- **OTLP-native** — standard OpenTelemetry ingestion (traces, metrics, logs)
|
|
82
89
|
|
|
83
|
-
|
|
90
|
+
## Privacy by architecture
|
|
84
91
|
|
|
85
|
-
|
|
86
|
-
|---------|------|---------|-------------|
|
|
87
|
-
| `mode` | string | `cloud` | `cloud` sends telemetry to app.manifest.build (default). `local` runs an embedded server on your machine. `dev` connects to a local backend without API key management. |
|
|
88
|
-
| `apiKey` | string | env `MANIFEST_API_KEY` | Agent API key (must start with `mnfst_`). Required for cloud mode, auto-generated in local mode. |
|
|
89
|
-
| `endpoint` | string | `https://app.manifest.build/otlp` | OTLP endpoint URL. Only relevant for cloud and dev modes. |
|
|
90
|
-
| `port` | number | `2099` | Port for the embedded dashboard server (local mode only). |
|
|
91
|
-
| `host` | string | `127.0.0.1` | Bind address for the embedded server (local mode only). |
|
|
92
|
+
**In local mode, your data stays on your machine.** All agent messages, token counts, costs, and telemetry are stored locally. In cloud mode, only OpenTelemetry metadata (model, tokens, latency) is sent — message content is never collected.
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
**In cloud mode, the blind proxy physically cannot read your prompts** This is fundamentally different from services saying "trust us."
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
openclaw config set plugins.entries.manifest.config.mode local
|
|
97
|
-
openclaw gateway restart
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Self-hosted
|
|
96
|
+
The only thing Manifest collects is anonymous product analytics (hashed machine ID, OS platform, package version, event names) to help improve the project. No personally identifiable information or agent data is included.
|
|
101
97
|
|
|
102
|
-
|
|
98
|
+
**Opting out:**
|
|
103
99
|
|
|
104
100
|
```bash
|
|
105
|
-
|
|
101
|
+
MANIFEST_TELEMETRY_OPTOUT=1
|
|
106
102
|
```
|
|
107
103
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
The plugin hooks into four OpenClaw lifecycle events and produces standard OpenTelemetry traces:
|
|
111
|
-
|
|
112
|
-
| Event | What happens |
|
|
113
|
-
|-------|-------------|
|
|
114
|
-
| `message_received` | Root span created, message counter incremented |
|
|
115
|
-
| `before_agent_start` | Child span for the agent turn |
|
|
116
|
-
| `tool_result_persist` | Tool span with duration, success/error tracking |
|
|
117
|
-
| `agent_end` | Spans closed, token/cost metrics recorded, routing resolved |
|
|
104
|
+
Or add `"telemetryOptOut": true` to `~/.openclaw/manifest/config.json`.
|
|
118
105
|
|
|
119
|
-
```
|
|
120
|
-
openclaw.request (SERVER)
|
|
121
|
-
└── openclaw.agent.turn (INTERNAL) model=gpt-4o-mini, tier=simple
|
|
122
|
-
├── tool.web_search duration=320ms
|
|
123
|
-
└── tool.summarize duration=45ms
|
|
124
|
-
```
|
|
125
106
|
|
|
126
|
-
##
|
|
107
|
+
## Manifest vs OpenRouter
|
|
127
108
|
|
|
128
|
-
|
|
109
|
+
| | Manifest | OpenRouter |
|
|
110
|
+
| ------------ | ---------------------------------------------------------- | ------------------------------------------------------------- |
|
|
111
|
+
| Architecture | Runs locally — data stays on your machine | Cloud proxy — all traffic routes through their servers |
|
|
112
|
+
| Cost | Free | 5% fee on every API call |
|
|
113
|
+
| Source code | MIT licensed, fully open | Proprietary |
|
|
114
|
+
| Data privacy | 100% local routing and logging | Your prompts and responses pass through a third party |
|
|
115
|
+
| Transparency | Open scoring algorithm — see exactly why a model is chosen | Black box routing, no visibility into how models are selected |
|
|
129
116
|
|
|
130
|
-
|
|
131
|
-
Published package:
|
|
132
|
-
dist/index.js Single-file bundle (~1.4 MB)
|
|
133
|
-
dist/server.js Embedded NestJS server (local mode)
|
|
134
|
-
dist/backend/ Backend compiled output
|
|
135
|
-
public/ Frontend dashboard assets
|
|
136
|
-
openclaw.plugin.json Plugin manifest + config schema
|
|
137
|
-
skills/ Bundled agent skills
|
|
138
|
-
```
|
|
117
|
+
## Supported Providers
|
|
139
118
|
|
|
140
|
-
|
|
119
|
+
Manifest supports **300+ models** across all major LLM providers. Every provider supports smart routing, real-time cost tracking, and OTLP telemetry.
|
|
141
120
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
121
|
+
| Provider | Models |
|
|
122
|
+
|----------|--------|
|
|
123
|
+
| [OpenAI](https://platform.openai.com/) | `gpt-5.3`, `gpt-4.1`, `o3`, `o4-mini` + 54 more |
|
|
124
|
+
| [Anthropic](https://www.anthropic.com/) | `claude-opus-4-6`, `claude-sonnet-4.5`, `claude-haiku-4.5` + 14 more |
|
|
125
|
+
| [Google Gemini](https://ai.google.dev/) | `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-3-pro` + 19 more |
|
|
126
|
+
| [DeepSeek](https://www.deepseek.com/) | `deepseek-v3`, `deepseek-r1` + 11 more |
|
|
127
|
+
| [xAI](https://x.ai/) | `grok-4`, `grok-3`, `grok-3-mini` + 8 more |
|
|
128
|
+
| [Mistral AI](https://mistral.ai/) | `mistral-large`, `codestral`, `devstral` + 26 more |
|
|
129
|
+
| [Qwen (Alibaba)](https://www.alibabacloud.com/en/solutions/generative-ai/qwen) | `qwen3-235b`, `qwen3-coder`, `qwq-32b` + 42 more |
|
|
130
|
+
| [MiniMax](https://www.minimax.io/) | `minimax-m2.5`, `minimax-m1`, `minimax-m2` + 5 more |
|
|
131
|
+
| [Kimi (Moonshot)](https://kimi.ai/) | `kimi-k2`, `kimi-k2.5` + 3 more |
|
|
132
|
+
| [Amazon Nova](https://aws.amazon.com/ai/nova/) | `nova-pro`, `nova-lite`, `nova-micro` + 5 more |
|
|
133
|
+
| [Z.ai (Zhipu)](https://z.ai/) | `glm-5`, `glm-4.7`, `glm-4.5` + 5 more |
|
|
134
|
+
| [OpenRouter](https://openrouter.ai/) | 300+ models from all providers |
|
|
135
|
+
| [Ollama](https://ollama.com/) | Run any model locally (Llama, Gemma, Mistral, …) |
|
|
148
136
|
|
|
149
|
-
|
|
137
|
+
## Contributing
|
|
150
138
|
|
|
151
|
-
|
|
152
|
-
openclaw plugins install -l ./packages/openclaw-plugin
|
|
153
|
-
openclaw gateway restart
|
|
154
|
-
# Dashboard at http://127.0.0.1:2099
|
|
155
|
-
```
|
|
139
|
+
Manifest is open source under the [MIT license](LICENSE). See [CONTRIBUTING.md](CONTRIBUTING.md) for the development setup, architecture notes, and workflow. Join the conversation on [Discord](https://discord.gg/FepAked3W7).
|
|
156
140
|
|
|
157
|
-
|
|
141
|
+
> **Want a hosted version instead?** Check out [app.manifest.build](https://app.manifest.build)
|
|
158
142
|
|
|
159
|
-
|
|
160
|
-
- In cloud mode, check your API key starts with `mnfst_`
|
|
161
|
-
- Verify the endpoint is reachable: `curl -I http://your-endpoint/v1/traces`
|
|
162
|
-
- Disable `diagnostics-otel` if enabled: `openclaw plugins disable diagnostics-otel`
|
|
143
|
+
## Quick Links
|
|
163
144
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
145
|
+
- [GitHub](https://github.com/mnfst/manifest)
|
|
146
|
+
- [Docs](https://manifest.build/docs)
|
|
147
|
+
- [Discord](https://discord.com/invite/FepAked3W7)
|
|
148
|
+
- [Discussions](https://github.com/mnfst/manifest/discussions)
|
|
168
149
|
|
|
169
150
|
## License
|
|
170
151
|
|
|
171
|
-
[MIT](LICENSE
|
|
152
|
+
[MIT](LICENSE)
|
|
@@ -223,7 +223,11 @@ let AggregationService = class AggregationService {
|
|
|
223
223
|
.addSelect('at.input_tokens + at.output_tokens', 'total_tokens')
|
|
224
224
|
.addSelect(costExpr, 'cost')
|
|
225
225
|
.addSelect('at.routing_tier', 'routing_tier')
|
|
226
|
-
.addSelect('at.routing_reason', 'routing_reason')
|
|
226
|
+
.addSelect('at.routing_reason', 'routing_reason')
|
|
227
|
+
.addSelect('at.cache_read_tokens', 'cache_read_tokens')
|
|
228
|
+
.addSelect('at.cache_creation_tokens', 'cache_creation_tokens')
|
|
229
|
+
.addSelect('at.duration_ms', 'duration_ms')
|
|
230
|
+
.addSelect('at.error_message', 'error_message');
|
|
227
231
|
if (params.cursor) {
|
|
228
232
|
const sepIdx = params.cursor.indexOf('|');
|
|
229
233
|
if (sepIdx !== -1) {
|
|
@@ -170,6 +170,7 @@ let TimeseriesQueriesService = class TimeseriesQueriesService {
|
|
|
170
170
|
.addSelect(costExpr, 'cost')
|
|
171
171
|
.addSelect('at.routing_tier', 'routing_tier')
|
|
172
172
|
.addSelect('at.routing_reason', 'routing_reason')
|
|
173
|
+
.addSelect('at.error_message', 'error_message')
|
|
173
174
|
.where('at.timestamp >= :cutoff', { cutoff });
|
|
174
175
|
(0, query_helpers_1.addTenantFilter)(qb, userId, agentName);
|
|
175
176
|
return qb.orderBy('at.timestamp', 'DESC').limit(limit).getRawMany();
|
|
@@ -24,6 +24,7 @@ const nodeEnv = process.env['NODE_ENV'] ?? '';
|
|
|
24
24
|
if (!isLocalMode && nodeEnv !== 'test' && (!betterAuthSecret || betterAuthSecret.length < 32)) {
|
|
25
25
|
throw new Error('BETTER_AUTH_SECRET must be set to a value of at least 32 characters');
|
|
26
26
|
}
|
|
27
|
+
const local_mode_constants_1 = require("../common/constants/local-mode.constants");
|
|
27
28
|
function buildTrustedOrigins() {
|
|
28
29
|
const origins = [];
|
|
29
30
|
if (process.env['BETTER_AUTH_URL']) {
|
|
@@ -32,7 +33,9 @@ function buildTrustedOrigins() {
|
|
|
32
33
|
if (process.env['CORS_ORIGIN']) {
|
|
33
34
|
origins.push(process.env['CORS_ORIGIN']);
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
if (isDev || isLocalMode) {
|
|
37
|
+
origins.push(`http://localhost:3000`, `http://localhost:${port}`);
|
|
38
|
+
}
|
|
36
39
|
if (isLocalMode) {
|
|
37
40
|
origins.push(`http://127.0.0.1:${port}`, `http://127.0.0.1:3000`);
|
|
38
41
|
}
|
|
@@ -47,7 +50,7 @@ exports.auth = isLocalMode
|
|
|
47
50
|
database: database,
|
|
48
51
|
baseURL: process.env['BETTER_AUTH_URL'] ?? `http://localhost:${port}`,
|
|
49
52
|
basePath: '/api/auth',
|
|
50
|
-
secret: betterAuthSecret ||
|
|
53
|
+
secret: betterAuthSecret || (0, local_mode_constants_1.getLocalAuthSecret)(),
|
|
51
54
|
logger: { level: 'debug' },
|
|
52
55
|
telemetry: { enabled: false },
|
|
53
56
|
account: {
|
|
@@ -48,11 +48,12 @@ let ApiKeyGuard = ApiKeyGuard_1 = class ApiKeyGuard {
|
|
|
48
48
|
this.logger.warn(`Rejected request without API key from ${request.ip}`);
|
|
49
49
|
throw new common_1.UnauthorizedException('X-API-Key header required');
|
|
50
50
|
}
|
|
51
|
-
const hash = (0, hash_util_1.
|
|
51
|
+
const hash = (0, hash_util_1.hashKey)(apiKey);
|
|
52
52
|
const found = await this.apiKeyRepo.findOne({ where: { key_hash: hash } });
|
|
53
53
|
if (found) {
|
|
54
54
|
request.apiKeyUserId = String(found.user_id);
|
|
55
|
-
this.apiKeyRepo
|
|
55
|
+
this.apiKeyRepo
|
|
56
|
+
.update({ key_hash: hash }, { last_used_at: () => 'CURRENT_TIMESTAMP' })
|
|
56
57
|
.catch(() => { });
|
|
57
58
|
return true;
|
|
58
59
|
}
|
|
@@ -13,8 +13,7 @@ function deriveKey(secret, salt) {
|
|
|
13
13
|
return (0, crypto_1.scryptSync)(secret, salt, KEY_LENGTH);
|
|
14
14
|
}
|
|
15
15
|
function getEncryptionSecret() {
|
|
16
|
-
const key = process.env['MANIFEST_ENCRYPTION_KEY'] ||
|
|
17
|
-
process.env['BETTER_AUTH_SECRET'];
|
|
16
|
+
const key = process.env['MANIFEST_ENCRYPTION_KEY'] || process.env['BETTER_AUTH_SECRET'];
|
|
18
17
|
if (key && key.length >= 32) {
|
|
19
18
|
return key;
|
|
20
19
|
}
|
|
@@ -29,10 +28,7 @@ function encrypt(plaintext, secret) {
|
|
|
29
28
|
const key = deriveKey(secret, salt);
|
|
30
29
|
const iv = (0, crypto_1.randomBytes)(IV_LENGTH);
|
|
31
30
|
const cipher = (0, crypto_1.createCipheriv)(ALGORITHM, key, iv);
|
|
32
|
-
const encrypted = Buffer.concat([
|
|
33
|
-
cipher.update(plaintext, 'utf8'),
|
|
34
|
-
cipher.final(),
|
|
35
|
-
]);
|
|
31
|
+
const encrypted = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
|
|
36
32
|
const tag = cipher.getAuthTag();
|
|
37
33
|
return [
|
|
38
34
|
salt.toString('base64'),
|
|
@@ -54,10 +50,7 @@ function decrypt(ciphertext, secret) {
|
|
|
54
50
|
const key = deriveKey(secret, salt);
|
|
55
51
|
const decipher = (0, crypto_1.createDecipheriv)(ALGORITHM, key, iv);
|
|
56
52
|
decipher.setAuthTag(tag);
|
|
57
|
-
const decrypted = Buffer.concat([
|
|
58
|
-
decipher.update(encrypted),
|
|
59
|
-
decipher.final(),
|
|
60
|
-
]);
|
|
53
|
+
const decrypted = Buffer.concat([decipher.update(encrypted), decipher.final()]);
|
|
61
54
|
return decrypted.toString('utf8');
|
|
62
55
|
}
|
|
63
56
|
function isEncrypted(value) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.hashKey = hashKey;
|
|
4
4
|
exports.keyPrefix = keyPrefix;
|
|
5
5
|
const crypto_1 = require("crypto");
|
|
6
6
|
const HASH_SALT = 'manifest-api-key-salt';
|
|
7
7
|
const KEY_LENGTH = 32;
|
|
8
|
-
function
|
|
8
|
+
function hashKey(input) {
|
|
9
9
|
return (0, crypto_1.scryptSync)(input, HASH_SALT, KEY_LENGTH).toString('hex');
|
|
10
10
|
}
|
|
11
11
|
function keyPrefix(key) {
|
|
@@ -12,7 +12,7 @@ exports.sqlSanitizeCost = sqlSanitizeCost;
|
|
|
12
12
|
exports.portableSql = portableSql;
|
|
13
13
|
exports.sqlCastInterval = sqlCastInterval;
|
|
14
14
|
function detectDialect(dsType) {
|
|
15
|
-
return
|
|
15
|
+
return dsType === 'sqljs' ? 'sqlite' : 'postgres';
|
|
16
16
|
}
|
|
17
17
|
function timestampType() {
|
|
18
18
|
return process.env['MANIFEST_MODE'] === 'local' ? 'datetime' : 'timestamp';
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.appConfig = void 0;
|
|
4
4
|
const config_1 = require("@nestjs/config");
|
|
5
5
|
const path_1 = require("path");
|
|
6
|
-
function
|
|
6
|
+
function sanitizeDbPath(raw) {
|
|
7
7
|
if (!raw)
|
|
8
8
|
return '';
|
|
9
9
|
return (0, path_1.resolve)(raw);
|
|
@@ -13,7 +13,7 @@ exports.appConfig = (0, config_1.registerAs)('app', () => ({
|
|
|
13
13
|
nodeEnv: process.env['NODE_ENV'] ?? 'development',
|
|
14
14
|
databaseUrl: process.env['DATABASE_URL'] ?? 'postgresql://myuser:mypassword@localhost:5432/mydatabase',
|
|
15
15
|
manifestMode: process.env['MANIFEST_MODE'] ?? 'cloud',
|
|
16
|
-
|
|
16
|
+
dbPath: sanitizeDbPath(process.env['MANIFEST_DB_PATH'] ?? ''),
|
|
17
17
|
corsOrigin: process.env['CORS_ORIGIN'] ?? 'http://localhost:3000',
|
|
18
18
|
throttleTtl: Number(process.env['THROTTLE_TTL'] ?? 60000),
|
|
19
19
|
throttleLimit: Number(process.env['THROTTLE_LIMIT'] ?? 100),
|