manifest 5.45.1 → 7.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.
Files changed (414) hide show
  1. package/CONTRACT.md +50 -0
  2. package/README.md +47 -101
  3. package/dist/chunk-DP2C4E42.js +720 -0
  4. package/dist/index.cjs +757 -0
  5. package/dist/index.d.cts +20 -0
  6. package/dist/index.d.ts +20 -0
  7. package/dist/index.js +8 -18
  8. package/dist/register.cjs +742 -0
  9. package/dist/register.d.cts +2 -0
  10. package/dist/register.d.ts +2 -0
  11. package/dist/register.js +6 -0
  12. package/docs/guide.md +94 -0
  13. package/docs/healing-diagram.svg +549 -0
  14. package/package.json +50 -79
  15. package/dist/backend/analytics/analytics.module.js +0 -60
  16. package/dist/backend/analytics/controllers/agent-analytics.controller.js +0 -69
  17. package/dist/backend/analytics/controllers/agents.controller.js +0 -176
  18. package/dist/backend/analytics/controllers/costs.controller.js +0 -71
  19. package/dist/backend/analytics/controllers/messages.controller.js +0 -67
  20. package/dist/backend/analytics/controllers/overview.controller.js +0 -104
  21. package/dist/backend/analytics/controllers/tokens.controller.js +0 -74
  22. package/dist/backend/analytics/dto/messages-query.dto.js +0 -73
  23. package/dist/backend/analytics/services/agent-analytics.service.js +0 -125
  24. package/dist/backend/analytics/services/agent-lifecycle.service.js +0 -102
  25. package/dist/backend/analytics/services/aggregation.service.js +0 -205
  26. package/dist/backend/analytics/services/message-details.service.js +0 -147
  27. package/dist/backend/analytics/services/messages-query.service.js +0 -197
  28. package/dist/backend/analytics/services/query-helpers.js +0 -45
  29. package/dist/backend/analytics/services/timeseries-queries.service.js +0 -237
  30. package/dist/backend/app.module.js +0 -94
  31. package/dist/backend/auth/auth.instance.js +0 -121
  32. package/dist/backend/auth/auth.module.js +0 -17
  33. package/dist/backend/auth/current-user.decorator.js +0 -9
  34. package/dist/backend/auth/local-auth.guard.js +0 -51
  35. package/dist/backend/auth/session.guard.js +0 -57
  36. package/dist/backend/common/common.module.js +0 -41
  37. package/dist/backend/common/constants/api-key.constants.js +0 -6
  38. package/dist/backend/common/constants/cache.constants.js +0 -8
  39. package/dist/backend/common/constants/local-mode.constants.js +0 -102
  40. package/dist/backend/common/constants/ollama.js +0 -5
  41. package/dist/backend/common/constants/providers.js +0 -134
  42. package/dist/backend/common/decorators/public.decorator.js +0 -8
  43. package/dist/backend/common/dto/create-agent.dto.js +0 -26
  44. package/dist/backend/common/dto/range-query.dto.js +0 -29
  45. package/dist/backend/common/dto/rename-agent.dto.js +0 -26
  46. package/dist/backend/common/filters/spa-fallback.filter.js +0 -46
  47. package/dist/backend/common/guards/api-key.guard.js +0 -89
  48. package/dist/backend/common/interceptors/agent-cache.interceptor.js +0 -39
  49. package/dist/backend/common/interceptors/user-cache.interceptor.js +0 -39
  50. package/dist/backend/common/middleware/http-error-logger.middleware.js +0 -19
  51. package/dist/backend/common/services/ingest-event-bus.service.js +0 -44
  52. package/dist/backend/common/services/manifest-runtime.service.js +0 -39
  53. package/dist/backend/common/services/tenant-cache.service.js +0 -56
  54. package/dist/backend/common/utils/anthropic-model-id.js +0 -36
  55. package/dist/backend/common/utils/cost-calculator.js +0 -19
  56. package/dist/backend/common/utils/crypto.util.js +0 -72
  57. package/dist/backend/common/utils/frontend-path.js +0 -21
  58. package/dist/backend/common/utils/hash.util.js +0 -32
  59. package/dist/backend/common/utils/local-ip.js +0 -33
  60. package/dist/backend/common/utils/period.util.js +0 -55
  61. package/dist/backend/common/utils/provider-aliases.js +0 -13
  62. package/dist/backend/common/utils/provider-inference.js +0 -7
  63. package/dist/backend/common/utils/range.util.js +0 -29
  64. package/dist/backend/common/utils/slugify.js +0 -13
  65. package/dist/backend/common/utils/sql-dialect.js +0 -71
  66. package/dist/backend/common/utils/subscription-support.js +0 -12
  67. package/dist/backend/common/utils/ttl-cache.js +0 -59
  68. package/dist/backend/common/utils/url-validation.js +0 -107
  69. package/dist/backend/config/app.config.js +0 -48
  70. package/dist/backend/database/database-seeder.service.js +0 -180
  71. package/dist/backend/database/database.module.js +0 -201
  72. package/dist/backend/database/datasource.js +0 -28
  73. package/dist/backend/database/local-bootstrap.service.js +0 -161
  74. package/dist/backend/database/migrations/1771464895790-InitialSchema.js +0 -91
  75. package/dist/backend/database/migrations/1771500000000-HashApiKeys.js +0 -67
  76. package/dist/backend/database/migrations/1771600000000-AddModelCapabilities.js +0 -27
  77. package/dist/backend/database/migrations/1771600000000-ModelPricingImprovements.js +0 -60
  78. package/dist/backend/database/migrations/1771700000000-AddRoutingTables.js +0 -50
  79. package/dist/backend/database/migrations/1771700000000-EmailProviderConfigs.js +0 -31
  80. package/dist/backend/database/migrations/1771800000000-AddNotificationEmailAndOptionalDomain.js +0 -16
  81. package/dist/backend/database/migrations/1771800000000-AddQualityScore.js +0 -50
  82. package/dist/backend/database/migrations/1771800100000-SeedQualityScores.js +0 -45
  83. package/dist/backend/database/migrations/1771900000000-EncryptApiKeys.js +0 -34
  84. package/dist/backend/database/migrations/1772000000000-MakeApiKeyNullable.js +0 -16
  85. package/dist/backend/database/migrations/1772100000000-AddRoutingTier.js +0 -17
  86. package/dist/backend/database/migrations/1772200000000-AddLimitAction.js +0 -17
  87. package/dist/backend/database/migrations/1772300000000-AddRoutingReason.js +0 -17
  88. package/dist/backend/database/migrations/1772400000000-AddAgentDisplayName.js +0 -13
  89. package/dist/backend/database/migrations/1772500000000-PerAgentRouting.js +0 -82
  90. package/dist/backend/database/migrations/1772668898071-AddCustomProviders.js +0 -31
  91. package/dist/backend/database/migrations/1772682112419-NullablePricing.js +0 -17
  92. package/dist/backend/database/migrations/1772843035514-AddPerformanceIndexes.js +0 -56
  93. package/dist/backend/database/migrations/1772900000000-AddProviderAuthType.js +0 -13
  94. package/dist/backend/database/migrations/1772905146384-AddDashboardIndexes.js +0 -24
  95. package/dist/backend/database/migrations/1772905260464-AddFallbacks.js +0 -18
  96. package/dist/backend/database/migrations/1772920000000-AddModelDisplayName.js +0 -14
  97. package/dist/backend/database/migrations/1772940000000-DropRedundantIndexes.js +0 -39
  98. package/dist/backend/database/migrations/1772948502780-BackfillTenantId.js +0 -20
  99. package/dist/backend/database/migrations/1772960000000-DropUnusedIndexes.js +0 -19
  100. package/dist/backend/database/migrations/1772960000000-PurgeNonCuratedModels.js +0 -86
  101. package/dist/backend/database/migrations/1773000000000-ExpandProviderUniqueKey.js +0 -19
  102. package/dist/backend/database/migrations/1773100000000-AddOverrideAuthType.js +0 -18
  103. package/dist/backend/database/migrations/1773200000000-AddMessageAuthType.js +0 -18
  104. package/dist/backend/database/migrations/1773202787708-AddModelsAgentIndex.js +0 -16
  105. package/dist/backend/database/migrations/1773300000000-AddEmailProviderKeyPrefix.js +0 -13
  106. package/dist/backend/database/migrations/1773400000000-AddProviderModelCache.js +0 -15
  107. package/dist/backend/database/migrations/1773500000000-DropModelPricingTables.js +0 -51
  108. package/dist/backend/database/migrations/1773600000000-AddOverrideProvider.js +0 -18
  109. package/dist/backend/database/migrations/1773650000000-AddProviderRegion.js +0 -13
  110. package/dist/backend/database/migrations/1773700000000-DropSecurityEventTable.js +0 -24
  111. package/dist/backend/database/migrations/1773800000000-FixNegativeCosts.js +0 -12
  112. package/dist/backend/database/migrations/1773900000000-AddKeyPrefixIndex.js +0 -15
  113. package/dist/backend/database/migrations/1774000000000-WidenKeyHashColumn.js +0 -15
  114. package/dist/backend/database/migrations/1774896789000-WidenApiKeyColumn.js +0 -14
  115. package/dist/backend/database/migrations/1775000000000-AddErrorHttpStatus.js +0 -18
  116. package/dist/backend/database/models-dev-sync.service.js +0 -238
  117. package/dist/backend/database/ollama-sync.service.js +0 -70
  118. package/dist/backend/database/pricing-sync.service.js +0 -116
  119. package/dist/backend/database/quality-score.util.js +0 -76
  120. package/dist/backend/database/seed-messages.js +0 -66
  121. package/dist/backend/entities/agent-api-key.entity.js +0 -91
  122. package/dist/backend/entities/agent-log.entity.js +0 -71
  123. package/dist/backend/entities/agent-message.entity.js +0 -163
  124. package/dist/backend/entities/agent.entity.js +0 -75
  125. package/dist/backend/entities/api-key.entity.js +0 -62
  126. package/dist/backend/entities/cost-snapshot.entity.js +0 -56
  127. package/dist/backend/entities/custom-provider.entity.js +0 -64
  128. package/dist/backend/entities/email-provider-config.entity.js +0 -72
  129. package/dist/backend/entities/llm-call.entity.js +0 -106
  130. package/dist/backend/entities/notification-log.entity.js +0 -67
  131. package/dist/backend/entities/notification-rule.entity.js +0 -84
  132. package/dist/backend/entities/tenant.entity.js +0 -62
  133. package/dist/backend/entities/tier-assignment.entity.js +0 -72
  134. package/dist/backend/entities/token-usage-snapshot.entity.js +0 -71
  135. package/dist/backend/entities/tool-execution.entity.js +0 -60
  136. package/dist/backend/entities/user-provider.entity.js +0 -87
  137. package/dist/backend/github/github.controller.js +0 -53
  138. package/dist/backend/github/github.module.js +0 -20
  139. package/dist/backend/health/health.controller.js +0 -51
  140. package/dist/backend/health/health.module.js +0 -22
  141. package/dist/backend/health/version-check.service.js +0 -95
  142. package/dist/backend/main.js +0 -154
  143. package/dist/backend/model-discovery/anthropic-subscription-probe.js +0 -87
  144. package/dist/backend/model-discovery/known-model-prices.js +0 -18
  145. package/dist/backend/model-discovery/model-discovery.module.js +0 -28
  146. package/dist/backend/model-discovery/model-discovery.service.js +0 -309
  147. package/dist/backend/model-discovery/model-fallback.js +0 -234
  148. package/dist/backend/model-discovery/model-fetcher.js +0 -3
  149. package/dist/backend/model-discovery/provider-model-fetcher.service.js +0 -376
  150. package/dist/backend/model-discovery/provider-model-registry.service.js +0 -84
  151. package/dist/backend/model-prices/model-name-normalizer.js +0 -129
  152. package/dist/backend/model-prices/model-prices.controller.js +0 -39
  153. package/dist/backend/model-prices/model-prices.module.js +0 -41
  154. package/dist/backend/model-prices/model-prices.service.js +0 -45
  155. package/dist/backend/model-prices/model-pricing-cache.service.js +0 -171
  156. package/dist/backend/notifications/dto/notification-rule.dto.js +0 -82
  157. package/dist/backend/notifications/dto/set-email-provider.dto.js +0 -86
  158. package/dist/backend/notifications/dto/set-notification-email.dto.js +0 -24
  159. package/dist/backend/notifications/emails/reset-password.js +0 -108
  160. package/dist/backend/notifications/emails/test-email.js +0 -91
  161. package/dist/backend/notifications/emails/threshold-alert.js +0 -187
  162. package/dist/backend/notifications/emails/verify-email.js +0 -108
  163. package/dist/backend/notifications/notifications.controller.js +0 -208
  164. package/dist/backend/notifications/notifications.module.js +0 -35
  165. package/dist/backend/notifications/services/email-provider-config.service.js +0 -184
  166. package/dist/backend/notifications/services/email-provider-validation.js +0 -47
  167. package/dist/backend/notifications/services/email-providers/email-provider.interface.js +0 -3
  168. package/dist/backend/notifications/services/email-providers/mailgun.provider.js +0 -62
  169. package/dist/backend/notifications/services/email-providers/resend.provider.js +0 -51
  170. package/dist/backend/notifications/services/email-providers/resolve-provider.js +0 -19
  171. package/dist/backend/notifications/services/email-providers/send-email.js +0 -34
  172. package/dist/backend/notifications/services/email-providers/sendgrid.provider.js +0 -59
  173. package/dist/backend/notifications/services/limit-check.service.js +0 -160
  174. package/dist/backend/notifications/services/notification-cron.service.js +0 -151
  175. package/dist/backend/notifications/services/notification-email.service.js +0 -65
  176. package/dist/backend/notifications/services/notification-log.service.js +0 -84
  177. package/dist/backend/notifications/services/notification-rules.service.js +0 -156
  178. package/dist/backend/otlp/guards/agent-key-auth.guard.js +0 -226
  179. package/dist/backend/otlp/interfaces/ingestion-context.interface.js +0 -3
  180. package/dist/backend/otlp/otlp-deprecated.controller.js +0 -61
  181. package/dist/backend/otlp/otlp.module.js +0 -30
  182. package/dist/backend/otlp/services/api-key.service.js +0 -143
  183. package/dist/backend/public-stats/public-stats.controller.js +0 -141
  184. package/dist/backend/public-stats/public-stats.module.js +0 -26
  185. package/dist/backend/public-stats/public-stats.service.js +0 -226
  186. package/dist/backend/routing/copilot.controller.js +0 -79
  187. package/dist/backend/routing/custom-provider/custom-provider.controller.js +0 -131
  188. package/dist/backend/routing/custom-provider/custom-provider.module.js +0 -27
  189. package/dist/backend/routing/custom-provider/custom-provider.service.js +0 -161
  190. package/dist/backend/routing/dto/custom-provider.dto.js +0 -124
  191. package/dist/backend/routing/dto/resolve-request.dto.js +0 -63
  192. package/dist/backend/routing/dto/resolve-response.js +0 -3
  193. package/dist/backend/routing/dto/routing.dto.js +0 -136
  194. package/dist/backend/routing/model.controller.js +0 -105
  195. package/dist/backend/routing/oauth/copilot-device-auth.service.js +0 -77
  196. package/dist/backend/routing/oauth/minimax-oauth-helpers.js +0 -70
  197. package/dist/backend/routing/oauth/minimax-oauth.controller.js +0 -80
  198. package/dist/backend/routing/oauth/minimax-oauth.service.js +0 -252
  199. package/dist/backend/routing/oauth/oauth.module.js +0 -29
  200. package/dist/backend/routing/oauth/openai-oauth.controller.js +0 -138
  201. package/dist/backend/routing/oauth/openai-oauth.service.js +0 -273
  202. package/dist/backend/routing/oauth/openai-oauth.types.js +0 -45
  203. package/dist/backend/routing/provider-base-url.js +0 -25
  204. package/dist/backend/routing/provider.controller.js +0 -152
  205. package/dist/backend/routing/proxy/anthropic-adapter.js +0 -295
  206. package/dist/backend/routing/proxy/cache-injection.js +0 -33
  207. package/dist/backend/routing/proxy/chatgpt-adapter.js +0 -272
  208. package/dist/backend/routing/proxy/chatgpt-helpers.js +0 -108
  209. package/dist/backend/routing/proxy/copilot-token.service.js +0 -63
  210. package/dist/backend/routing/proxy/fallback-status-codes.js +0 -7
  211. package/dist/backend/routing/proxy/google-adapter.js +0 -314
  212. package/dist/backend/routing/proxy/provider-client-converters.js +0 -190
  213. package/dist/backend/routing/proxy/provider-client.js +0 -130
  214. package/dist/backend/routing/proxy/provider-endpoints.js +0 -182
  215. package/dist/backend/routing/proxy/proxy-error-sanitizer.js +0 -40
  216. package/dist/backend/routing/proxy/proxy-exception.filter.js +0 -67
  217. package/dist/backend/routing/proxy/proxy-fallback.service.js +0 -227
  218. package/dist/backend/routing/proxy/proxy-friendly-response.js +0 -115
  219. package/dist/backend/routing/proxy/proxy-message-dedup.js +0 -121
  220. package/dist/backend/routing/proxy/proxy-message-recorder.js +0 -264
  221. package/dist/backend/routing/proxy/proxy-rate-limiter.js +0 -81
  222. package/dist/backend/routing/proxy/proxy-response-handler.js +0 -202
  223. package/dist/backend/routing/proxy/proxy-transport.js +0 -90
  224. package/dist/backend/routing/proxy/proxy-types.js +0 -3
  225. package/dist/backend/routing/proxy/proxy.controller.js +0 -174
  226. package/dist/backend/routing/proxy/proxy.module.js +0 -62
  227. package/dist/backend/routing/proxy/proxy.service.js +0 -227
  228. package/dist/backend/routing/proxy/session-momentum.service.js +0 -66
  229. package/dist/backend/routing/proxy/stream-writer.js +0 -147
  230. package/dist/backend/routing/proxy/thought-signature-cache.js +0 -45
  231. package/dist/backend/routing/qwen-region.js +0 -51
  232. package/dist/backend/routing/resolve/resolve.controller.js +0 -106
  233. package/dist/backend/routing/resolve/resolve.module.js +0 -28
  234. package/dist/backend/routing/resolve/resolve.service.js +0 -126
  235. package/dist/backend/routing/routing-core/provider-key.service.js +0 -190
  236. package/dist/backend/routing/routing-core/provider.service.js +0 -305
  237. package/dist/backend/routing/routing-core/resolve-agent.service.js +0 -62
  238. package/dist/backend/routing/routing-core/routing-cache.service.js +0 -73
  239. package/dist/backend/routing/routing-core/routing-core.module.js +0 -56
  240. package/dist/backend/routing/routing-core/routing-invalidation.service.js +0 -90
  241. package/dist/backend/routing/routing-core/tier-auto-assign.service.js +0 -138
  242. package/dist/backend/routing/routing-core/tier.service.js +0 -179
  243. package/dist/backend/routing/routing.module.js +0 -46
  244. package/dist/backend/routing/tier.controller.js +0 -129
  245. package/dist/backend/scoring/__tests__/fixtures.js +0 -191
  246. package/dist/backend/scoring/config.js +0 -383
  247. package/dist/backend/scoring/dimensions/contextual-dimensions.js +0 -85
  248. package/dist/backend/scoring/dimensions/index.js +0 -17
  249. package/dist/backend/scoring/dimensions/keyword-dimensions.js +0 -47
  250. package/dist/backend/scoring/dimensions/structural-dimensions.js +0 -118
  251. package/dist/backend/scoring/index.js +0 -186
  252. package/dist/backend/scoring/keyword-trie.js +0 -75
  253. package/dist/backend/scoring/momentum.js +0 -50
  254. package/dist/backend/scoring/overrides.js +0 -55
  255. package/dist/backend/scoring/sigmoid.js +0 -24
  256. package/dist/backend/scoring/text-extractor.js +0 -67
  257. package/dist/backend/scoring/types.js +0 -6
  258. package/dist/backend/sse/sse.controller.js +0 -45
  259. package/dist/backend/sse/sse.module.js +0 -20
  260. package/dist/node_modules/manifest-shared/dist/cjs/api-key.d.ts +0 -2
  261. package/dist/node_modules/manifest-shared/dist/cjs/api-key.d.ts.map +0 -1
  262. package/dist/node_modules/manifest-shared/dist/cjs/api-key.js +0 -5
  263. package/dist/node_modules/manifest-shared/dist/cjs/api-key.js.map +0 -1
  264. package/dist/node_modules/manifest-shared/dist/cjs/auth-types.d.ts +0 -3
  265. package/dist/node_modules/manifest-shared/dist/cjs/auth-types.d.ts.map +0 -1
  266. package/dist/node_modules/manifest-shared/dist/cjs/auth-types.js +0 -5
  267. package/dist/node_modules/manifest-shared/dist/cjs/auth-types.js.map +0 -1
  268. package/dist/node_modules/manifest-shared/dist/cjs/index.d.ts +0 -10
  269. package/dist/node_modules/manifest-shared/dist/cjs/index.d.ts.map +0 -1
  270. package/dist/node_modules/manifest-shared/dist/cjs/index.js +0 -22
  271. package/dist/node_modules/manifest-shared/dist/cjs/index.js.map +0 -1
  272. package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.d.ts +0 -8
  273. package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.d.ts.map +0 -1
  274. package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.js +0 -37
  275. package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.js.map +0 -1
  276. package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.d.ts +0 -12
  277. package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.d.ts.map +0 -1
  278. package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.js +0 -3
  279. package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.js.map +0 -1
  280. package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.d.ts +0 -4
  281. package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.d.ts.map +0 -1
  282. package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.js +0 -80
  283. package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.js.map +0 -1
  284. package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.d.ts +0 -6
  285. package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.d.ts.map +0 -1
  286. package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.js +0 -25
  287. package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.js.map +0 -1
  288. package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.d.ts +0 -4
  289. package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.d.ts.map +0 -1
  290. package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.js +0 -12
  291. package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.js.map +0 -1
  292. package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.d.ts +0 -17
  293. package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.d.ts.map +0 -1
  294. package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.js +0 -3
  295. package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.js.map +0 -1
  296. package/dist/node_modules/manifest-shared/dist/cjs/tiers.d.ts +0 -5
  297. package/dist/node_modules/manifest-shared/dist/cjs/tiers.d.ts.map +0 -1
  298. package/dist/node_modules/manifest-shared/dist/cjs/tiers.js +0 -17
  299. package/dist/node_modules/manifest-shared/dist/cjs/tiers.js.map +0 -1
  300. package/dist/node_modules/manifest-shared/dist/esm/api-key.d.ts +0 -2
  301. package/dist/node_modules/manifest-shared/dist/esm/api-key.d.ts.map +0 -1
  302. package/dist/node_modules/manifest-shared/dist/esm/api-key.js +0 -2
  303. package/dist/node_modules/manifest-shared/dist/esm/api-key.js.map +0 -1
  304. package/dist/node_modules/manifest-shared/dist/esm/auth-types.d.ts +0 -3
  305. package/dist/node_modules/manifest-shared/dist/esm/auth-types.d.ts.map +0 -1
  306. package/dist/node_modules/manifest-shared/dist/esm/auth-types.js +0 -2
  307. package/dist/node_modules/manifest-shared/dist/esm/auth-types.js.map +0 -1
  308. package/dist/node_modules/manifest-shared/dist/esm/index.d.ts +0 -10
  309. package/dist/node_modules/manifest-shared/dist/esm/index.d.ts.map +0 -1
  310. package/dist/node_modules/manifest-shared/dist/esm/index.js +0 -6
  311. package/dist/node_modules/manifest-shared/dist/esm/index.js.map +0 -1
  312. package/dist/node_modules/manifest-shared/dist/esm/provider-inference.d.ts +0 -8
  313. package/dist/node_modules/manifest-shared/dist/esm/provider-inference.d.ts.map +0 -1
  314. package/dist/node_modules/manifest-shared/dist/esm/provider-inference.js +0 -33
  315. package/dist/node_modules/manifest-shared/dist/esm/provider-inference.js.map +0 -1
  316. package/dist/node_modules/manifest-shared/dist/esm/resolve-response.d.ts +0 -12
  317. package/dist/node_modules/manifest-shared/dist/esm/resolve-response.d.ts.map +0 -1
  318. package/dist/node_modules/manifest-shared/dist/esm/resolve-response.js +0 -2
  319. package/dist/node_modules/manifest-shared/dist/esm/resolve-response.js.map +0 -1
  320. package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.d.ts +0 -4
  321. package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.d.ts.map +0 -1
  322. package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.js +0 -77
  323. package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.js.map +0 -1
  324. package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.d.ts +0 -6
  325. package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.d.ts.map +0 -1
  326. package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.js +0 -19
  327. package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.js.map +0 -1
  328. package/dist/node_modules/manifest-shared/dist/esm/subscription/index.d.ts +0 -4
  329. package/dist/node_modules/manifest-shared/dist/esm/subscription/index.d.ts.map +0 -1
  330. package/dist/node_modules/manifest-shared/dist/esm/subscription/index.js +0 -3
  331. package/dist/node_modules/manifest-shared/dist/esm/subscription/index.js.map +0 -1
  332. package/dist/node_modules/manifest-shared/dist/esm/subscription/types.d.ts +0 -17
  333. package/dist/node_modules/manifest-shared/dist/esm/subscription/types.d.ts.map +0 -1
  334. package/dist/node_modules/manifest-shared/dist/esm/subscription/types.js +0 -2
  335. package/dist/node_modules/manifest-shared/dist/esm/subscription/types.js.map +0 -1
  336. package/dist/node_modules/manifest-shared/dist/esm/tiers.d.ts +0 -5
  337. package/dist/node_modules/manifest-shared/dist/esm/tiers.d.ts.map +0 -1
  338. package/dist/node_modules/manifest-shared/dist/esm/tiers.js +0 -14
  339. package/dist/node_modules/manifest-shared/dist/esm/tiers.js.map +0 -1
  340. package/dist/node_modules/manifest-shared/package.json +0 -26
  341. package/dist/openclaw.plugin.json +0 -37
  342. package/dist/package.json +0 -94
  343. package/dist/server.d.ts +0 -9
  344. package/dist/server.js +0 -69
  345. package/openclaw.plugin.json +0 -37
  346. package/public/assets/Account-C5g6WhPe.js +0 -1
  347. package/public/assets/AuthBadge-Dj2KkXRW.js +0 -1
  348. package/public/assets/ConnectProvider-axzk92LC.js +0 -1
  349. package/public/assets/CopyButton-BWMVlK2w.js +0 -1
  350. package/public/assets/FreeModels-D14GhDL_.js +0 -1
  351. package/public/assets/Help-ifWIlcDo.js +0 -1
  352. package/public/assets/Limits-Xgc4xTl5.js +0 -1
  353. package/public/assets/Login-DMXD4PMZ.js +0 -1
  354. package/public/assets/MessageLog-DoriYlHo.js +0 -1
  355. package/public/assets/ModelPrices-MhBT_7Zb.js +0 -1
  356. package/public/assets/Overview-Bi9FuoLx.js +0 -1
  357. package/public/assets/Pagination-D8BOkffh.js +0 -1
  358. package/public/assets/ProviderTokens-Cu2RUqQG.js +0 -1
  359. package/public/assets/Register-CrovWG_d.js +0 -1
  360. package/public/assets/ResetPassword-C6B1ubhL.js +0 -1
  361. package/public/assets/Routing-B-On2pvv.js +0 -6
  362. package/public/assets/Settings-BH-xNoID.js +0 -1
  363. package/public/assets/SetupStepAddProvider-CSNkQmoC.js +0 -3
  364. package/public/assets/SocialButtons-DudwEJ6b.js +0 -1
  365. package/public/assets/auth-CU91cd7V.js +0 -1
  366. package/public/assets/chart-utils-DTt1NOye.js +0 -1
  367. package/public/assets/charts-Cty976qB.js +0 -3
  368. package/public/assets/charts-Saz_VHki.css +0 -1
  369. package/public/assets/index-C4Qw7vZo.js +0 -2
  370. package/public/assets/index-DhaXpWfr.css +0 -1
  371. package/public/assets/model-display-DHwvDtl4.js +0 -1
  372. package/public/assets/overview-DKLGwfLs.js +0 -1
  373. package/public/assets/overview-vZEzTjBP.css +0 -1
  374. package/public/assets/provider-api-key-urls-1G6okUJ7.js +0 -1
  375. package/public/assets/routing-CLLAl6kl.js +0 -1
  376. package/public/assets/routing-utils-CHapjwyd.js +0 -1
  377. package/public/assets/vendor-C-Y5oNOq.js +0 -1
  378. package/public/example-messages.svg +0 -1
  379. package/public/example-overview.svg +0 -1
  380. package/public/favicon.ico +0 -0
  381. package/public/fonts/boxicons/boxicons-duotone.min.css +0 -37
  382. package/public/fonts/boxicons/boxicons-duotone.woff2 +0 -0
  383. package/public/fonts/bricolage-grotesque-latin.woff2 +0 -0
  384. package/public/fonts/dm-sans-latin.woff2 +0 -0
  385. package/public/fonts/jetbrains-mono-latin.woff2 +0 -0
  386. package/public/icons/caret-down.svg +0 -1
  387. package/public/icons/cohere.svg +0 -30
  388. package/public/icons/free.svg +0 -91
  389. package/public/icons/gemini.svg +0 -25
  390. package/public/icons/kilocode.jpg +0 -0
  391. package/public/icons/nvidia.svg +0 -1
  392. package/public/icons/providers/alibaba.svg +0 -1
  393. package/public/icons/providers/amazon.svg +0 -1
  394. package/public/icons/providers/anthropic.svg +0 -1
  395. package/public/icons/providers/cohere.svg +0 -1
  396. package/public/icons/providers/deepseek.svg +0 -1
  397. package/public/icons/providers/google.svg +0 -1
  398. package/public/icons/providers/meta.svg +0 -1
  399. package/public/icons/providers/mistral.svg +0 -1
  400. package/public/icons/providers/moonshot.svg +0 -1
  401. package/public/icons/providers/openai.svg +0 -1
  402. package/public/icons/providers/xai.svg +0 -1
  403. package/public/icons/providers/zhipu.svg +0 -1
  404. package/public/icons/qwen.svg +0 -1
  405. package/public/images/oauth-callback-example.mp4 +0 -0
  406. package/public/images/oauth-callback-example.png +0 -0
  407. package/public/index.html +0 -41
  408. package/public/logo-white.svg +0 -93
  409. package/public/logo.svg +0 -93
  410. package/public/logos/mailgun.svg +0 -13
  411. package/public/logos/resend.svg +0 -4
  412. package/public/logos/sendgrid.svg +0 -18
  413. package/public/manifest-logo.png +0 -0
  414. package/public/theme-init.js +0 -6
package/CONTRACT.md ADDED
@@ -0,0 +1,50 @@
1
+ # SDK / app contract
2
+
3
+ The SDK talks to the configured Manifest API using `Authorization: Bearer <project key>` and `User-Agent: mnfst-node/<version>`.
4
+
5
+ ## Capture
6
+
7
+ `POST /v1/heal` receives:
8
+
9
+ ```json
10
+ {
11
+ "traceId": "unique-capture-id",
12
+ "request": {"method": "POST", "url": "https://example.com/orders", "headers": {}, "body": {"limit": 200}},
13
+ "response": {"statusCode": 400, "body": {"error": "limit must be at most 100"}, "truncated": false},
14
+ "responseTimeMs": 25
15
+ }
16
+ ```
17
+
18
+ Any 4xx response is captured except 401, 402, 403 and 429; those and every 5xx pass through untouched, because auth, billing, rate limiting and server faults are not repaired by editing the request. JSON bodies and `application/x-www-form-urlencoded` bodies are sent as structured JSON values. Credential filtering and body limits are described in the README. Capture gates live in `runtime.ts`; the server owns repair policy.
19
+
20
+ A successful heal response may contain `status: patched|unverified`, `healAttemptId`, `operations` and `healedRequest` with `url`, `headers` or `body`. Only these two statuses authorize a retry. No patch, malformed responses and unavailable service return the original error response. HTTP 403 with `{"error":"project_disabled"}` suppresses healing for five minutes.
21
+
22
+ ## Apply
23
+
24
+ A healed URL replaces the URL only within the original origin. Headers set or replace case-insensitively; null removes a header. Content length is recalculated. Objects merge using the server's healed body as the authoritative copy of fields sent to the server; withheld local credential fields are restored. Non-object JSON replaces the body. Form-urlencoded retries use the original encoding and are re-encoded from the parsed structure, so repeated keys return as indexed keys; a non-object healed body is not retried for them. Incomplete or malformed request captures and incomplete error captures are not retried.
25
+
26
+ Each captured failure permits one retry. A retry response, including another failure, is returned to the caller. A transport failure returns the original response. Successful response streams are not eagerly consumed.
27
+
28
+ ## Outcome
29
+
30
+ `PATCH /v1/heal-attempts/:id` sends exactly one of:
31
+
32
+ ```json
33
+ {"response":{"statusCode":200}}
34
+ ```
35
+
36
+ ```json
37
+ {"response":{"statusCode":400,"body":{"error":"raw upstream error"},"truncated":false}}
38
+ ```
39
+
40
+ ```json
41
+ {"failure":{"kind":"transport_error","message":"Upstream retry failed before an HTTP response"}}
42
+ ```
43
+
44
+ ```json
45
+ {"failure":{"kind":"not_attempted","message":"replay_not_attempted"}}
46
+ ```
47
+
48
+ HTTP status must be 200–599. Transport failures use a fixed message without exception prose. HTTP status zero is not a wire status. Transport failures and unattempted retries are inconclusive evidence; neither can verify or invalidate a patch. The server determines the verdict from the raw evidence, with the first accepted report winning.
49
+
50
+ Reports are best effort, bounded, and observable through Node warnings with code `MNFST`. The SDK sends the failed retry's raw body so the app can distinguish recurrence from a newly revealed issue. It does not assert `succeeded` or `failed` itself.
package/README.md CHANGED
@@ -1,121 +1,67 @@
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 OpenClaw costs
10
- </p>
11
-
12
- ![manifest-gh](https://github.com/user-attachments/assets/7dd74fc2-f7d6-4558-a95a-014ed754a125)
13
-
14
- <p align="center">
15
- <span><img src="https://img.shields.io/badge/status-beta-yellow" alt="beta" /></span>
16
- &nbsp;
17
- <a href="https://github.com/mnfst/manifest/stargazers"><img src="https://img.shields.io/github/stars/mnfst/manifest?style=flat" alt="GitHub stars" /></a>
18
- &nbsp;
19
- <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>
20
- &nbsp;
21
- <a href="https://www.npmjs.com/package/manifest"><img src="https://img.shields.io/npm/dw/manifest?color=cb3837" alt="npm downloads" /></a>
22
- &nbsp;
23
- <a href="https://hub.docker.com/r/manifestdotbuild/manifest"><img src="https://img.shields.io/docker/pulls/manifestdotbuild/manifest?color=2496ED&label=docker%20pulls" alt="Docker pulls" /></a>
24
- &nbsp;
25
- <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>
26
- &nbsp;
27
- <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>
28
- &nbsp;
29
- <a href="LICENSE"><img src="https://img.shields.io/github/license/mnfst/manifest?color=blue" alt="license" /></a>
30
- &nbsp;
31
- <a href="https://discord.gg/FepAked3W7"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord" /></a>
32
- </p>
33
-
34
- <p align="center">
35
- <a href="https://trendshift.io/repositories/12890" target="_blank"><img src="https://trendshift.io/api/badge/repositories/12890" alt="mnfst%2Fmanifest | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
36
- </p>
37
-
38
- ## What is Manifest?
39
-
40
- Manifest is a smart model router for OpenClaw. It sits between your agent and your LLM providers, scores each request, and routes it to the cheapest model that can handle it. Simple questions go to fast, cheap models. Hard problems go to expensive ones. You save money without thinking about it.
41
-
42
- - Route requests to the right model: Cut costs up to 70%
43
- - Automatic fallbacks: If a model fails, the next one picks up
44
- - Set limits: Don't exceed your budget
45
-
46
- ## Quick start
47
-
48
- ### Cloud version
49
-
50
- Go to [app.manifest.build](https://app.manifest.build) and follow the guide.
51
-
52
- ### Local version
53
-
54
- ```bash
55
- openclaw plugins install manifest
56
- openclaw gateway restart
57
- ```
1
+ # Manifest for Node.js
58
2
 
59
- Dashboard opens at **http://127.0.0.1:2099**. The plugin starts an embedded server, runs the dashboard locally, and registers itself as a provider automatically. No account or API key needed.
3
+ [![CI](https://github.com/mnfst/manifest-node/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mnfst/manifest-node/actions/workflows/ci.yml)
4
+ [![npm version](https://img.shields.io/npm/v/manifest?label=npm)](https://www.npmjs.com/package/manifest)
5
+ [![npm downloads](https://img.shields.io/npm/dm/manifest?label=npm%20downloads)](https://www.npmjs.com/package/manifest)
60
6
 
61
- ### Docker
7
+ **An API rejects your request. Manifest fixes it and retries. You do nothing.**
62
8
 
63
- Our <a href="https://hub.docker.com/r/manifestdotbuild/manifest">Manifest Docker Image</a> allows you to self-host Manifest router in your own infrastructure.
9
+ ```sh
10
+ npm install manifest
11
+ ```
64
12
 
65
- ### Which version choose?
13
+ ```js
14
+ import { manifest } from 'manifest';
66
15
 
67
- Pick cloud version for quick setup and multi-device access. Pick local version for keeping all your data on your machine or for using local models like Ollama. Pick Docker for self-hosting on your own infrastructure.
16
+ manifest(); // once, at startup
17
+ // Keep making your API calls as usual.
18
+ ```
68
19
 
69
- Not sure which one to choose? Start with cloud.
20
+ Works with built-in `fetch`, `node:http`, `node:https` and Axios, for JSON and form-urlencoded bodies. Node.js 22+. TypeScript, ESM and CommonJS. Zero dependencies.
70
21
 
71
- ## How it works
22
+ ![How Manifest heals a failed request: a 400 reaches Manifest, drops to a patch from the knowledge base or the healing agents, and is retried once, returning a 200 OK](docs/healing-diagram.svg)
72
23
 
73
- Every request to `manifest/auto` goes through a 23-dimension scoring algorithm (runs in under 2ms). The scorer picks a tier (simple, standard, complex, or reasoning) and routes to the best model in that tier from your connected providers.
24
+ ## Setup
74
25
 
75
- All routing data (tokens, costs, model, duration) is recorded automatically. You see it in the dashboard. No extra setup.
26
+ 1. Create a project in your Manifest dashboard and copy its project key.
27
+ 2. Turn on **Autofix** in **Project Settings**.
28
+ 3. Set the key:
76
29
 
77
- ## Manifest vs OpenRouter
30
+ ```sh
31
+ export MNFST_KEY='your-project-key'
32
+ ```
78
33
 
79
- | | Manifest | OpenRouter |
80
- | ------------ | -------------------------------------------- | --------------------------------------------------- |
81
- | Architecture | Local. Your requests, your providers | Cloud proxy. All traffic goes through their servers |
82
- | Cost | Free | 5% fee on every API call |
83
- | Source code | MIT, fully open | Proprietary |
84
- | Data privacy | Metadata only (cloud) or fully local | Prompts and responses pass through a third party |
85
- | Transparency | Open scoring. You see why a model was chosen | No visibility into routing decisions |
34
+ Call `manifest()` before any library grabs its own reference to `fetch` or `node:http`. To install before any of your modules run, preload it instead:
86
35
 
87
- ## Supported providers
36
+ ```sh
37
+ node --import manifest/register app.js
38
+ ```
88
39
 
89
- Works with 300+ models across these providers:
40
+ ## See it work
90
41
 
91
- | Provider | Models |
92
- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------- |
93
- | [OpenAI](https://platform.openai.com/) | `gpt-5.3`, `gpt-4.1`, `o3`, `o4-mini` + 54 more |
94
- | [Anthropic](https://www.anthropic.com/) | `claude-opus-4-6`, `claude-sonnet-4.5`, `claude-haiku-4.5` + 14 more |
95
- | [Google Gemini](https://ai.google.dev/) | `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-3-pro` + 19 more |
96
- | [DeepSeek](https://www.deepseek.com/) | `deepseek-chat`, `deepseek-reasoner` + 11 more |
97
- | [xAI](https://x.ai/) | `grok-4`, `grok-3`, `grok-3-mini` + 8 more |
98
- | [Mistral AI](https://mistral.ai/) | `mistral-large`, `codestral`, `devstral` + 26 more |
99
- | [Qwen (Alibaba)](https://www.alibabacloud.com/en/solutions/generative-ai/qwen) | `qwen3-235b`, `qwen3-coder`, `qwq-32b` + 42 more |
100
- | [MiniMax](https://www.minimax.io/) | `minimax-m2.5`, `minimax-m1`, `minimax-m2` + 5 more |
101
- | [Kimi (Moonshot)](https://kimi.ai/) | `kimi-k2`, `kimi-k2.5` + 3 more |
102
- | [Amazon Nova](https://aws.amazon.com/ai/nova/) | `nova-pro`, `nova-lite`, `nova-micro` + 5 more |
103
- | [Z.ai (Zhipu)](https://z.ai/) | `glm-5`, `glm-4.7`, `glm-4.5` + 5 more |
104
- | [OpenRouter](https://openrouter.ai/) | 300+ models from all providers |
105
- | [Ollama](https://ollama.com/) | Run any model locally (Llama, Gemma, Mistral, ...) |
106
- | Custom providers | Any provider with an OpenAI-compatible API endpoint |
42
+ ```js
43
+ import { manifest } from 'manifest';
107
44
 
108
- ## Contributing
45
+ manifest({
46
+ onHeal(event) {
47
+ console.log('[manifest]', event.healStatus, event.replayStatusCode);
48
+ },
49
+ });
109
50
 
110
- Manifest is open source under the [MIT license](LICENSE). See [CONTRIBUTING.md](CONTRIBUTING.md) for dev setup, architecture, and workflow. Join the conversation on [Discord](https://discord.gg/FepAked3W7).
51
+ const res = await fetch('https://api.example.com/orders', {
52
+ method: 'POST',
53
+ headers: { 'content-type': 'application/json' },
54
+ body: JSON.stringify({ limit: 500 }), // rejected? Manifest retries with a valid limit
55
+ });
56
+ ```
111
57
 
112
- ## Quick links
58
+ ## Good to know
113
59
 
114
- - [GitHub](https://github.com/mnfst/manifest)
115
- - [Docs](https://manifest.build/docs)
116
- - [Discord](https://discord.com/invite/FepAked3W7)
117
- - [Discussions](https://github.com/mnfst/manifest/discussions)
60
+ - **Retries repeat side effects.** Use idempotency keys on non-idempotent calls.
61
+ - **A heal adds up to 60 s** to a failed request. Successful requests are untouched.
62
+ - **Not intercepted:** browsers, HTTP/2, and directly imported `undici`.
63
+ - **Privacy.** Failed URLs, headers, JSON or form-urlencoded bodies, and error responses are sent to Manifest. Known credentials are masked, but nested secrets and business data are not. Enable it only for traffic you allow Manifest to process.
118
64
 
119
- ## License
65
+ ## More
120
66
 
121
- [MIT](LICENSE)
67
+ [Configuration, limits & development](docs/guide.md) · [API contract](CONTRACT.md) · [Python SDK](https://github.com/mnfst/manifest-python)