manifest 5.45.1 → 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.
Files changed (408) hide show
  1. package/CONTRACT.md +50 -0
  2. package/README.md +69 -100
  3. package/dist/index.cjs +472 -0
  4. package/dist/index.d.cts +24 -0
  5. package/dist/index.d.ts +24 -0
  6. package/dist/index.js +443 -18
  7. package/docs/guide.md +77 -0
  8. package/package.json +36 -79
  9. package/dist/backend/analytics/analytics.module.js +0 -60
  10. package/dist/backend/analytics/controllers/agent-analytics.controller.js +0 -69
  11. package/dist/backend/analytics/controllers/agents.controller.js +0 -176
  12. package/dist/backend/analytics/controllers/costs.controller.js +0 -71
  13. package/dist/backend/analytics/controllers/messages.controller.js +0 -67
  14. package/dist/backend/analytics/controllers/overview.controller.js +0 -104
  15. package/dist/backend/analytics/controllers/tokens.controller.js +0 -74
  16. package/dist/backend/analytics/dto/messages-query.dto.js +0 -73
  17. package/dist/backend/analytics/services/agent-analytics.service.js +0 -125
  18. package/dist/backend/analytics/services/agent-lifecycle.service.js +0 -102
  19. package/dist/backend/analytics/services/aggregation.service.js +0 -205
  20. package/dist/backend/analytics/services/message-details.service.js +0 -147
  21. package/dist/backend/analytics/services/messages-query.service.js +0 -197
  22. package/dist/backend/analytics/services/query-helpers.js +0 -45
  23. package/dist/backend/analytics/services/timeseries-queries.service.js +0 -237
  24. package/dist/backend/app.module.js +0 -94
  25. package/dist/backend/auth/auth.instance.js +0 -121
  26. package/dist/backend/auth/auth.module.js +0 -17
  27. package/dist/backend/auth/current-user.decorator.js +0 -9
  28. package/dist/backend/auth/local-auth.guard.js +0 -51
  29. package/dist/backend/auth/session.guard.js +0 -57
  30. package/dist/backend/common/common.module.js +0 -41
  31. package/dist/backend/common/constants/api-key.constants.js +0 -6
  32. package/dist/backend/common/constants/cache.constants.js +0 -8
  33. package/dist/backend/common/constants/local-mode.constants.js +0 -102
  34. package/dist/backend/common/constants/ollama.js +0 -5
  35. package/dist/backend/common/constants/providers.js +0 -134
  36. package/dist/backend/common/decorators/public.decorator.js +0 -8
  37. package/dist/backend/common/dto/create-agent.dto.js +0 -26
  38. package/dist/backend/common/dto/range-query.dto.js +0 -29
  39. package/dist/backend/common/dto/rename-agent.dto.js +0 -26
  40. package/dist/backend/common/filters/spa-fallback.filter.js +0 -46
  41. package/dist/backend/common/guards/api-key.guard.js +0 -89
  42. package/dist/backend/common/interceptors/agent-cache.interceptor.js +0 -39
  43. package/dist/backend/common/interceptors/user-cache.interceptor.js +0 -39
  44. package/dist/backend/common/middleware/http-error-logger.middleware.js +0 -19
  45. package/dist/backend/common/services/ingest-event-bus.service.js +0 -44
  46. package/dist/backend/common/services/manifest-runtime.service.js +0 -39
  47. package/dist/backend/common/services/tenant-cache.service.js +0 -56
  48. package/dist/backend/common/utils/anthropic-model-id.js +0 -36
  49. package/dist/backend/common/utils/cost-calculator.js +0 -19
  50. package/dist/backend/common/utils/crypto.util.js +0 -72
  51. package/dist/backend/common/utils/frontend-path.js +0 -21
  52. package/dist/backend/common/utils/hash.util.js +0 -32
  53. package/dist/backend/common/utils/local-ip.js +0 -33
  54. package/dist/backend/common/utils/period.util.js +0 -55
  55. package/dist/backend/common/utils/provider-aliases.js +0 -13
  56. package/dist/backend/common/utils/provider-inference.js +0 -7
  57. package/dist/backend/common/utils/range.util.js +0 -29
  58. package/dist/backend/common/utils/slugify.js +0 -13
  59. package/dist/backend/common/utils/sql-dialect.js +0 -71
  60. package/dist/backend/common/utils/subscription-support.js +0 -12
  61. package/dist/backend/common/utils/ttl-cache.js +0 -59
  62. package/dist/backend/common/utils/url-validation.js +0 -107
  63. package/dist/backend/config/app.config.js +0 -48
  64. package/dist/backend/database/database-seeder.service.js +0 -180
  65. package/dist/backend/database/database.module.js +0 -201
  66. package/dist/backend/database/datasource.js +0 -28
  67. package/dist/backend/database/local-bootstrap.service.js +0 -161
  68. package/dist/backend/database/migrations/1771464895790-InitialSchema.js +0 -91
  69. package/dist/backend/database/migrations/1771500000000-HashApiKeys.js +0 -67
  70. package/dist/backend/database/migrations/1771600000000-AddModelCapabilities.js +0 -27
  71. package/dist/backend/database/migrations/1771600000000-ModelPricingImprovements.js +0 -60
  72. package/dist/backend/database/migrations/1771700000000-AddRoutingTables.js +0 -50
  73. package/dist/backend/database/migrations/1771700000000-EmailProviderConfigs.js +0 -31
  74. package/dist/backend/database/migrations/1771800000000-AddNotificationEmailAndOptionalDomain.js +0 -16
  75. package/dist/backend/database/migrations/1771800000000-AddQualityScore.js +0 -50
  76. package/dist/backend/database/migrations/1771800100000-SeedQualityScores.js +0 -45
  77. package/dist/backend/database/migrations/1771900000000-EncryptApiKeys.js +0 -34
  78. package/dist/backend/database/migrations/1772000000000-MakeApiKeyNullable.js +0 -16
  79. package/dist/backend/database/migrations/1772100000000-AddRoutingTier.js +0 -17
  80. package/dist/backend/database/migrations/1772200000000-AddLimitAction.js +0 -17
  81. package/dist/backend/database/migrations/1772300000000-AddRoutingReason.js +0 -17
  82. package/dist/backend/database/migrations/1772400000000-AddAgentDisplayName.js +0 -13
  83. package/dist/backend/database/migrations/1772500000000-PerAgentRouting.js +0 -82
  84. package/dist/backend/database/migrations/1772668898071-AddCustomProviders.js +0 -31
  85. package/dist/backend/database/migrations/1772682112419-NullablePricing.js +0 -17
  86. package/dist/backend/database/migrations/1772843035514-AddPerformanceIndexes.js +0 -56
  87. package/dist/backend/database/migrations/1772900000000-AddProviderAuthType.js +0 -13
  88. package/dist/backend/database/migrations/1772905146384-AddDashboardIndexes.js +0 -24
  89. package/dist/backend/database/migrations/1772905260464-AddFallbacks.js +0 -18
  90. package/dist/backend/database/migrations/1772920000000-AddModelDisplayName.js +0 -14
  91. package/dist/backend/database/migrations/1772940000000-DropRedundantIndexes.js +0 -39
  92. package/dist/backend/database/migrations/1772948502780-BackfillTenantId.js +0 -20
  93. package/dist/backend/database/migrations/1772960000000-DropUnusedIndexes.js +0 -19
  94. package/dist/backend/database/migrations/1772960000000-PurgeNonCuratedModels.js +0 -86
  95. package/dist/backend/database/migrations/1773000000000-ExpandProviderUniqueKey.js +0 -19
  96. package/dist/backend/database/migrations/1773100000000-AddOverrideAuthType.js +0 -18
  97. package/dist/backend/database/migrations/1773200000000-AddMessageAuthType.js +0 -18
  98. package/dist/backend/database/migrations/1773202787708-AddModelsAgentIndex.js +0 -16
  99. package/dist/backend/database/migrations/1773300000000-AddEmailProviderKeyPrefix.js +0 -13
  100. package/dist/backend/database/migrations/1773400000000-AddProviderModelCache.js +0 -15
  101. package/dist/backend/database/migrations/1773500000000-DropModelPricingTables.js +0 -51
  102. package/dist/backend/database/migrations/1773600000000-AddOverrideProvider.js +0 -18
  103. package/dist/backend/database/migrations/1773650000000-AddProviderRegion.js +0 -13
  104. package/dist/backend/database/migrations/1773700000000-DropSecurityEventTable.js +0 -24
  105. package/dist/backend/database/migrations/1773800000000-FixNegativeCosts.js +0 -12
  106. package/dist/backend/database/migrations/1773900000000-AddKeyPrefixIndex.js +0 -15
  107. package/dist/backend/database/migrations/1774000000000-WidenKeyHashColumn.js +0 -15
  108. package/dist/backend/database/migrations/1774896789000-WidenApiKeyColumn.js +0 -14
  109. package/dist/backend/database/migrations/1775000000000-AddErrorHttpStatus.js +0 -18
  110. package/dist/backend/database/models-dev-sync.service.js +0 -238
  111. package/dist/backend/database/ollama-sync.service.js +0 -70
  112. package/dist/backend/database/pricing-sync.service.js +0 -116
  113. package/dist/backend/database/quality-score.util.js +0 -76
  114. package/dist/backend/database/seed-messages.js +0 -66
  115. package/dist/backend/entities/agent-api-key.entity.js +0 -91
  116. package/dist/backend/entities/agent-log.entity.js +0 -71
  117. package/dist/backend/entities/agent-message.entity.js +0 -163
  118. package/dist/backend/entities/agent.entity.js +0 -75
  119. package/dist/backend/entities/api-key.entity.js +0 -62
  120. package/dist/backend/entities/cost-snapshot.entity.js +0 -56
  121. package/dist/backend/entities/custom-provider.entity.js +0 -64
  122. package/dist/backend/entities/email-provider-config.entity.js +0 -72
  123. package/dist/backend/entities/llm-call.entity.js +0 -106
  124. package/dist/backend/entities/notification-log.entity.js +0 -67
  125. package/dist/backend/entities/notification-rule.entity.js +0 -84
  126. package/dist/backend/entities/tenant.entity.js +0 -62
  127. package/dist/backend/entities/tier-assignment.entity.js +0 -72
  128. package/dist/backend/entities/token-usage-snapshot.entity.js +0 -71
  129. package/dist/backend/entities/tool-execution.entity.js +0 -60
  130. package/dist/backend/entities/user-provider.entity.js +0 -87
  131. package/dist/backend/github/github.controller.js +0 -53
  132. package/dist/backend/github/github.module.js +0 -20
  133. package/dist/backend/health/health.controller.js +0 -51
  134. package/dist/backend/health/health.module.js +0 -22
  135. package/dist/backend/health/version-check.service.js +0 -95
  136. package/dist/backend/main.js +0 -154
  137. package/dist/backend/model-discovery/anthropic-subscription-probe.js +0 -87
  138. package/dist/backend/model-discovery/known-model-prices.js +0 -18
  139. package/dist/backend/model-discovery/model-discovery.module.js +0 -28
  140. package/dist/backend/model-discovery/model-discovery.service.js +0 -309
  141. package/dist/backend/model-discovery/model-fallback.js +0 -234
  142. package/dist/backend/model-discovery/model-fetcher.js +0 -3
  143. package/dist/backend/model-discovery/provider-model-fetcher.service.js +0 -376
  144. package/dist/backend/model-discovery/provider-model-registry.service.js +0 -84
  145. package/dist/backend/model-prices/model-name-normalizer.js +0 -129
  146. package/dist/backend/model-prices/model-prices.controller.js +0 -39
  147. package/dist/backend/model-prices/model-prices.module.js +0 -41
  148. package/dist/backend/model-prices/model-prices.service.js +0 -45
  149. package/dist/backend/model-prices/model-pricing-cache.service.js +0 -171
  150. package/dist/backend/notifications/dto/notification-rule.dto.js +0 -82
  151. package/dist/backend/notifications/dto/set-email-provider.dto.js +0 -86
  152. package/dist/backend/notifications/dto/set-notification-email.dto.js +0 -24
  153. package/dist/backend/notifications/emails/reset-password.js +0 -108
  154. package/dist/backend/notifications/emails/test-email.js +0 -91
  155. package/dist/backend/notifications/emails/threshold-alert.js +0 -187
  156. package/dist/backend/notifications/emails/verify-email.js +0 -108
  157. package/dist/backend/notifications/notifications.controller.js +0 -208
  158. package/dist/backend/notifications/notifications.module.js +0 -35
  159. package/dist/backend/notifications/services/email-provider-config.service.js +0 -184
  160. package/dist/backend/notifications/services/email-provider-validation.js +0 -47
  161. package/dist/backend/notifications/services/email-providers/email-provider.interface.js +0 -3
  162. package/dist/backend/notifications/services/email-providers/mailgun.provider.js +0 -62
  163. package/dist/backend/notifications/services/email-providers/resend.provider.js +0 -51
  164. package/dist/backend/notifications/services/email-providers/resolve-provider.js +0 -19
  165. package/dist/backend/notifications/services/email-providers/send-email.js +0 -34
  166. package/dist/backend/notifications/services/email-providers/sendgrid.provider.js +0 -59
  167. package/dist/backend/notifications/services/limit-check.service.js +0 -160
  168. package/dist/backend/notifications/services/notification-cron.service.js +0 -151
  169. package/dist/backend/notifications/services/notification-email.service.js +0 -65
  170. package/dist/backend/notifications/services/notification-log.service.js +0 -84
  171. package/dist/backend/notifications/services/notification-rules.service.js +0 -156
  172. package/dist/backend/otlp/guards/agent-key-auth.guard.js +0 -226
  173. package/dist/backend/otlp/interfaces/ingestion-context.interface.js +0 -3
  174. package/dist/backend/otlp/otlp-deprecated.controller.js +0 -61
  175. package/dist/backend/otlp/otlp.module.js +0 -30
  176. package/dist/backend/otlp/services/api-key.service.js +0 -143
  177. package/dist/backend/public-stats/public-stats.controller.js +0 -141
  178. package/dist/backend/public-stats/public-stats.module.js +0 -26
  179. package/dist/backend/public-stats/public-stats.service.js +0 -226
  180. package/dist/backend/routing/copilot.controller.js +0 -79
  181. package/dist/backend/routing/custom-provider/custom-provider.controller.js +0 -131
  182. package/dist/backend/routing/custom-provider/custom-provider.module.js +0 -27
  183. package/dist/backend/routing/custom-provider/custom-provider.service.js +0 -161
  184. package/dist/backend/routing/dto/custom-provider.dto.js +0 -124
  185. package/dist/backend/routing/dto/resolve-request.dto.js +0 -63
  186. package/dist/backend/routing/dto/resolve-response.js +0 -3
  187. package/dist/backend/routing/dto/routing.dto.js +0 -136
  188. package/dist/backend/routing/model.controller.js +0 -105
  189. package/dist/backend/routing/oauth/copilot-device-auth.service.js +0 -77
  190. package/dist/backend/routing/oauth/minimax-oauth-helpers.js +0 -70
  191. package/dist/backend/routing/oauth/minimax-oauth.controller.js +0 -80
  192. package/dist/backend/routing/oauth/minimax-oauth.service.js +0 -252
  193. package/dist/backend/routing/oauth/oauth.module.js +0 -29
  194. package/dist/backend/routing/oauth/openai-oauth.controller.js +0 -138
  195. package/dist/backend/routing/oauth/openai-oauth.service.js +0 -273
  196. package/dist/backend/routing/oauth/openai-oauth.types.js +0 -45
  197. package/dist/backend/routing/provider-base-url.js +0 -25
  198. package/dist/backend/routing/provider.controller.js +0 -152
  199. package/dist/backend/routing/proxy/anthropic-adapter.js +0 -295
  200. package/dist/backend/routing/proxy/cache-injection.js +0 -33
  201. package/dist/backend/routing/proxy/chatgpt-adapter.js +0 -272
  202. package/dist/backend/routing/proxy/chatgpt-helpers.js +0 -108
  203. package/dist/backend/routing/proxy/copilot-token.service.js +0 -63
  204. package/dist/backend/routing/proxy/fallback-status-codes.js +0 -7
  205. package/dist/backend/routing/proxy/google-adapter.js +0 -314
  206. package/dist/backend/routing/proxy/provider-client-converters.js +0 -190
  207. package/dist/backend/routing/proxy/provider-client.js +0 -130
  208. package/dist/backend/routing/proxy/provider-endpoints.js +0 -182
  209. package/dist/backend/routing/proxy/proxy-error-sanitizer.js +0 -40
  210. package/dist/backend/routing/proxy/proxy-exception.filter.js +0 -67
  211. package/dist/backend/routing/proxy/proxy-fallback.service.js +0 -227
  212. package/dist/backend/routing/proxy/proxy-friendly-response.js +0 -115
  213. package/dist/backend/routing/proxy/proxy-message-dedup.js +0 -121
  214. package/dist/backend/routing/proxy/proxy-message-recorder.js +0 -264
  215. package/dist/backend/routing/proxy/proxy-rate-limiter.js +0 -81
  216. package/dist/backend/routing/proxy/proxy-response-handler.js +0 -202
  217. package/dist/backend/routing/proxy/proxy-transport.js +0 -90
  218. package/dist/backend/routing/proxy/proxy-types.js +0 -3
  219. package/dist/backend/routing/proxy/proxy.controller.js +0 -174
  220. package/dist/backend/routing/proxy/proxy.module.js +0 -62
  221. package/dist/backend/routing/proxy/proxy.service.js +0 -227
  222. package/dist/backend/routing/proxy/session-momentum.service.js +0 -66
  223. package/dist/backend/routing/proxy/stream-writer.js +0 -147
  224. package/dist/backend/routing/proxy/thought-signature-cache.js +0 -45
  225. package/dist/backend/routing/qwen-region.js +0 -51
  226. package/dist/backend/routing/resolve/resolve.controller.js +0 -106
  227. package/dist/backend/routing/resolve/resolve.module.js +0 -28
  228. package/dist/backend/routing/resolve/resolve.service.js +0 -126
  229. package/dist/backend/routing/routing-core/provider-key.service.js +0 -190
  230. package/dist/backend/routing/routing-core/provider.service.js +0 -305
  231. package/dist/backend/routing/routing-core/resolve-agent.service.js +0 -62
  232. package/dist/backend/routing/routing-core/routing-cache.service.js +0 -73
  233. package/dist/backend/routing/routing-core/routing-core.module.js +0 -56
  234. package/dist/backend/routing/routing-core/routing-invalidation.service.js +0 -90
  235. package/dist/backend/routing/routing-core/tier-auto-assign.service.js +0 -138
  236. package/dist/backend/routing/routing-core/tier.service.js +0 -179
  237. package/dist/backend/routing/routing.module.js +0 -46
  238. package/dist/backend/routing/tier.controller.js +0 -129
  239. package/dist/backend/scoring/__tests__/fixtures.js +0 -191
  240. package/dist/backend/scoring/config.js +0 -383
  241. package/dist/backend/scoring/dimensions/contextual-dimensions.js +0 -85
  242. package/dist/backend/scoring/dimensions/index.js +0 -17
  243. package/dist/backend/scoring/dimensions/keyword-dimensions.js +0 -47
  244. package/dist/backend/scoring/dimensions/structural-dimensions.js +0 -118
  245. package/dist/backend/scoring/index.js +0 -186
  246. package/dist/backend/scoring/keyword-trie.js +0 -75
  247. package/dist/backend/scoring/momentum.js +0 -50
  248. package/dist/backend/scoring/overrides.js +0 -55
  249. package/dist/backend/scoring/sigmoid.js +0 -24
  250. package/dist/backend/scoring/text-extractor.js +0 -67
  251. package/dist/backend/scoring/types.js +0 -6
  252. package/dist/backend/sse/sse.controller.js +0 -45
  253. package/dist/backend/sse/sse.module.js +0 -20
  254. package/dist/node_modules/manifest-shared/dist/cjs/api-key.d.ts +0 -2
  255. package/dist/node_modules/manifest-shared/dist/cjs/api-key.d.ts.map +0 -1
  256. package/dist/node_modules/manifest-shared/dist/cjs/api-key.js +0 -5
  257. package/dist/node_modules/manifest-shared/dist/cjs/api-key.js.map +0 -1
  258. package/dist/node_modules/manifest-shared/dist/cjs/auth-types.d.ts +0 -3
  259. package/dist/node_modules/manifest-shared/dist/cjs/auth-types.d.ts.map +0 -1
  260. package/dist/node_modules/manifest-shared/dist/cjs/auth-types.js +0 -5
  261. package/dist/node_modules/manifest-shared/dist/cjs/auth-types.js.map +0 -1
  262. package/dist/node_modules/manifest-shared/dist/cjs/index.d.ts +0 -10
  263. package/dist/node_modules/manifest-shared/dist/cjs/index.d.ts.map +0 -1
  264. package/dist/node_modules/manifest-shared/dist/cjs/index.js +0 -22
  265. package/dist/node_modules/manifest-shared/dist/cjs/index.js.map +0 -1
  266. package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.d.ts +0 -8
  267. package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.d.ts.map +0 -1
  268. package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.js +0 -37
  269. package/dist/node_modules/manifest-shared/dist/cjs/provider-inference.js.map +0 -1
  270. package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.d.ts +0 -12
  271. package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.d.ts.map +0 -1
  272. package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.js +0 -3
  273. package/dist/node_modules/manifest-shared/dist/cjs/resolve-response.js.map +0 -1
  274. package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.d.ts +0 -4
  275. package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.d.ts.map +0 -1
  276. package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.js +0 -80
  277. package/dist/node_modules/manifest-shared/dist/cjs/subscription/configs.js.map +0 -1
  278. package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.d.ts +0 -6
  279. package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.d.ts.map +0 -1
  280. package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.js +0 -25
  281. package/dist/node_modules/manifest-shared/dist/cjs/subscription/helpers.js.map +0 -1
  282. package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.d.ts +0 -4
  283. package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.d.ts.map +0 -1
  284. package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.js +0 -12
  285. package/dist/node_modules/manifest-shared/dist/cjs/subscription/index.js.map +0 -1
  286. package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.d.ts +0 -17
  287. package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.d.ts.map +0 -1
  288. package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.js +0 -3
  289. package/dist/node_modules/manifest-shared/dist/cjs/subscription/types.js.map +0 -1
  290. package/dist/node_modules/manifest-shared/dist/cjs/tiers.d.ts +0 -5
  291. package/dist/node_modules/manifest-shared/dist/cjs/tiers.d.ts.map +0 -1
  292. package/dist/node_modules/manifest-shared/dist/cjs/tiers.js +0 -17
  293. package/dist/node_modules/manifest-shared/dist/cjs/tiers.js.map +0 -1
  294. package/dist/node_modules/manifest-shared/dist/esm/api-key.d.ts +0 -2
  295. package/dist/node_modules/manifest-shared/dist/esm/api-key.d.ts.map +0 -1
  296. package/dist/node_modules/manifest-shared/dist/esm/api-key.js +0 -2
  297. package/dist/node_modules/manifest-shared/dist/esm/api-key.js.map +0 -1
  298. package/dist/node_modules/manifest-shared/dist/esm/auth-types.d.ts +0 -3
  299. package/dist/node_modules/manifest-shared/dist/esm/auth-types.d.ts.map +0 -1
  300. package/dist/node_modules/manifest-shared/dist/esm/auth-types.js +0 -2
  301. package/dist/node_modules/manifest-shared/dist/esm/auth-types.js.map +0 -1
  302. package/dist/node_modules/manifest-shared/dist/esm/index.d.ts +0 -10
  303. package/dist/node_modules/manifest-shared/dist/esm/index.d.ts.map +0 -1
  304. package/dist/node_modules/manifest-shared/dist/esm/index.js +0 -6
  305. package/dist/node_modules/manifest-shared/dist/esm/index.js.map +0 -1
  306. package/dist/node_modules/manifest-shared/dist/esm/provider-inference.d.ts +0 -8
  307. package/dist/node_modules/manifest-shared/dist/esm/provider-inference.d.ts.map +0 -1
  308. package/dist/node_modules/manifest-shared/dist/esm/provider-inference.js +0 -33
  309. package/dist/node_modules/manifest-shared/dist/esm/provider-inference.js.map +0 -1
  310. package/dist/node_modules/manifest-shared/dist/esm/resolve-response.d.ts +0 -12
  311. package/dist/node_modules/manifest-shared/dist/esm/resolve-response.d.ts.map +0 -1
  312. package/dist/node_modules/manifest-shared/dist/esm/resolve-response.js +0 -2
  313. package/dist/node_modules/manifest-shared/dist/esm/resolve-response.js.map +0 -1
  314. package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.d.ts +0 -4
  315. package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.d.ts.map +0 -1
  316. package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.js +0 -77
  317. package/dist/node_modules/manifest-shared/dist/esm/subscription/configs.js.map +0 -1
  318. package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.d.ts +0 -6
  319. package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.d.ts.map +0 -1
  320. package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.js +0 -19
  321. package/dist/node_modules/manifest-shared/dist/esm/subscription/helpers.js.map +0 -1
  322. package/dist/node_modules/manifest-shared/dist/esm/subscription/index.d.ts +0 -4
  323. package/dist/node_modules/manifest-shared/dist/esm/subscription/index.d.ts.map +0 -1
  324. package/dist/node_modules/manifest-shared/dist/esm/subscription/index.js +0 -3
  325. package/dist/node_modules/manifest-shared/dist/esm/subscription/index.js.map +0 -1
  326. package/dist/node_modules/manifest-shared/dist/esm/subscription/types.d.ts +0 -17
  327. package/dist/node_modules/manifest-shared/dist/esm/subscription/types.d.ts.map +0 -1
  328. package/dist/node_modules/manifest-shared/dist/esm/subscription/types.js +0 -2
  329. package/dist/node_modules/manifest-shared/dist/esm/subscription/types.js.map +0 -1
  330. package/dist/node_modules/manifest-shared/dist/esm/tiers.d.ts +0 -5
  331. package/dist/node_modules/manifest-shared/dist/esm/tiers.d.ts.map +0 -1
  332. package/dist/node_modules/manifest-shared/dist/esm/tiers.js +0 -14
  333. package/dist/node_modules/manifest-shared/dist/esm/tiers.js.map +0 -1
  334. package/dist/node_modules/manifest-shared/package.json +0 -26
  335. package/dist/openclaw.plugin.json +0 -37
  336. package/dist/package.json +0 -94
  337. package/dist/server.d.ts +0 -9
  338. package/dist/server.js +0 -69
  339. package/openclaw.plugin.json +0 -37
  340. package/public/assets/Account-C5g6WhPe.js +0 -1
  341. package/public/assets/AuthBadge-Dj2KkXRW.js +0 -1
  342. package/public/assets/ConnectProvider-axzk92LC.js +0 -1
  343. package/public/assets/CopyButton-BWMVlK2w.js +0 -1
  344. package/public/assets/FreeModels-D14GhDL_.js +0 -1
  345. package/public/assets/Help-ifWIlcDo.js +0 -1
  346. package/public/assets/Limits-Xgc4xTl5.js +0 -1
  347. package/public/assets/Login-DMXD4PMZ.js +0 -1
  348. package/public/assets/MessageLog-DoriYlHo.js +0 -1
  349. package/public/assets/ModelPrices-MhBT_7Zb.js +0 -1
  350. package/public/assets/Overview-Bi9FuoLx.js +0 -1
  351. package/public/assets/Pagination-D8BOkffh.js +0 -1
  352. package/public/assets/ProviderTokens-Cu2RUqQG.js +0 -1
  353. package/public/assets/Register-CrovWG_d.js +0 -1
  354. package/public/assets/ResetPassword-C6B1ubhL.js +0 -1
  355. package/public/assets/Routing-B-On2pvv.js +0 -6
  356. package/public/assets/Settings-BH-xNoID.js +0 -1
  357. package/public/assets/SetupStepAddProvider-CSNkQmoC.js +0 -3
  358. package/public/assets/SocialButtons-DudwEJ6b.js +0 -1
  359. package/public/assets/auth-CU91cd7V.js +0 -1
  360. package/public/assets/chart-utils-DTt1NOye.js +0 -1
  361. package/public/assets/charts-Cty976qB.js +0 -3
  362. package/public/assets/charts-Saz_VHki.css +0 -1
  363. package/public/assets/index-C4Qw7vZo.js +0 -2
  364. package/public/assets/index-DhaXpWfr.css +0 -1
  365. package/public/assets/model-display-DHwvDtl4.js +0 -1
  366. package/public/assets/overview-DKLGwfLs.js +0 -1
  367. package/public/assets/overview-vZEzTjBP.css +0 -1
  368. package/public/assets/provider-api-key-urls-1G6okUJ7.js +0 -1
  369. package/public/assets/routing-CLLAl6kl.js +0 -1
  370. package/public/assets/routing-utils-CHapjwyd.js +0 -1
  371. package/public/assets/vendor-C-Y5oNOq.js +0 -1
  372. package/public/example-messages.svg +0 -1
  373. package/public/example-overview.svg +0 -1
  374. package/public/favicon.ico +0 -0
  375. package/public/fonts/boxicons/boxicons-duotone.min.css +0 -37
  376. package/public/fonts/boxicons/boxicons-duotone.woff2 +0 -0
  377. package/public/fonts/bricolage-grotesque-latin.woff2 +0 -0
  378. package/public/fonts/dm-sans-latin.woff2 +0 -0
  379. package/public/fonts/jetbrains-mono-latin.woff2 +0 -0
  380. package/public/icons/caret-down.svg +0 -1
  381. package/public/icons/cohere.svg +0 -30
  382. package/public/icons/free.svg +0 -91
  383. package/public/icons/gemini.svg +0 -25
  384. package/public/icons/kilocode.jpg +0 -0
  385. package/public/icons/nvidia.svg +0 -1
  386. package/public/icons/providers/alibaba.svg +0 -1
  387. package/public/icons/providers/amazon.svg +0 -1
  388. package/public/icons/providers/anthropic.svg +0 -1
  389. package/public/icons/providers/cohere.svg +0 -1
  390. package/public/icons/providers/deepseek.svg +0 -1
  391. package/public/icons/providers/google.svg +0 -1
  392. package/public/icons/providers/meta.svg +0 -1
  393. package/public/icons/providers/mistral.svg +0 -1
  394. package/public/icons/providers/moonshot.svg +0 -1
  395. package/public/icons/providers/openai.svg +0 -1
  396. package/public/icons/providers/xai.svg +0 -1
  397. package/public/icons/providers/zhipu.svg +0 -1
  398. package/public/icons/qwen.svg +0 -1
  399. package/public/images/oauth-callback-example.mp4 +0 -0
  400. package/public/images/oauth-callback-example.png +0 -0
  401. package/public/index.html +0 -41
  402. package/public/logo-white.svg +0 -93
  403. package/public/logo.svg +0 -93
  404. package/public/logos/mailgun.svg +0 -13
  405. package/public/logos/resend.svg +0 -4
  406. package/public/logos/sendgrid.svg +0 -18
  407. package/public/manifest-logo.png +0 -0
  408. 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
+ 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. Incomplete request or 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,90 @@
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
1
+ # Manifest for Node.js
2
+
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
+
5
+ Repair failed JSON API requests automatically. Works with Node's built-in `fetch`, for everyday APIs and LLMs alike.
6
+
7
+ ```js
8
+ import { manifest } from 'manifest';
9
+
10
+ manifest();
11
+ // Keep making your API calls as usual.
57
12
  ```
58
13
 
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.
14
+ Your API rejects a request → Manifest finds a repair → the SDK retries once, locally.
60
15
 
61
- ### Docker
16
+ ## Setup
62
17
 
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.
18
+ ### 1. Install
64
19
 
65
- ### Which version choose?
20
+ Requires **Node.js 22+**:
66
21
 
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.
22
+ ```sh
23
+ npm install manifest
24
+ ```
25
+
26
+ JavaScript, TypeScript, ESM and CommonJS are supported; there are no runtime dependencies.
68
27
 
69
- Not sure which one to choose? Start with cloud.
28
+ ### 2. Connect your project
70
29
 
71
- ## How it works
30
+ Create a project in your Manifest dashboard and copy the project key shown during setup. In **Project Settings**, turn **Autofix** on to enable repairs.
72
31
 
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.
32
+ ```sh
33
+ export MNFST_KEY='your-project-key'
34
+ ```
74
35
 
75
- All routing data (tokens, costs, model, duration) is recorded automatically. You see it in the dashboard. No extra setup.
36
+ The SDK defaults to `https://api.manifest.build`. For a local app running on port 5310, also set:
76
37
 
77
- ## Manifest vs OpenRouter
38
+ ```sh
39
+ export MNFST_URL='http://127.0.0.1:5310'
40
+ ```
41
+
42
+ Your server must support the [SDK API contract](CONTRACT.md). The local app must already be running.
43
+
44
+ ### 3. Initialize before your requests
45
+
46
+ Call `manifest()` once at startup, before other libraries save a reference to `fetch`. Save this as `example.mjs`, replacing the example endpoint and payload with your own:
47
+
48
+ ```js
49
+ import { manifest, flush } from 'manifest';
50
+
51
+ manifest({
52
+ onHeal(event) {
53
+ console.log('[manifest]', event.healStatus, event.replayStatusCode);
54
+ },
55
+ });
56
+
57
+ try {
58
+ const response = await fetch('https://api.example.com/orders', {
59
+ method: 'POST',
60
+ headers: { 'content-type': 'application/json' },
61
+ body: JSON.stringify({ limit: 500 }),
62
+ });
63
+ console.log(response.status, await response.text());
64
+ } finally {
65
+ await flush({ timeoutMs: 5000 });
66
+ }
67
+ ```
78
68
 
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 |
69
+ Run it with `node example.mjs`. For an API that rejects `limit: 500` and has a matching repair, Manifest can retry with a valid limit. Repairs depend on the API error and available patches.
86
70
 
87
- ## Supported providers
71
+ CommonJS uses `const { manifest, flush } = require('manifest')`.
88
72
 
89
- Works with 300+ models across these providers:
73
+ ## Check that it works
90
74
 
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 |
75
+ Send a JSON request that your test API rejects with **400, 404 or 422**. Check the failure in your project's dashboard and the `onHeal` callback for the repair result. A successful request alone does not contact Manifest. `flush()` lets a short script wait for outcome reports before exiting.
107
76
 
108
- ## Contributing
77
+ ## What to expect
109
78
 
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).
79
+ - **One retry.** Manifest returns a repair; the SDK sends the corrected request directly to your API.
80
+ - **Original error if healing is unavailable.** A heal call can add up to 60 seconds. If a retry returns an HTTP response, that response reaches your application.
81
+ - **Built-in fetch.** Browser JavaScript, default Axios, `node:http` and separately imported fetch implementations are not intercepted.
82
+ - **Retry semantics still matter.** Use idempotency keys where needed; a repeated request can repeat side effects.
111
83
 
112
- ## Quick links
84
+ ## Privacy
113
85
 
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)
86
+ Manifest receives failed request URLs, headers, JSON bodies and error responses. Known credential fields are masked or withheld, but nested secrets, prompts and business data can still be sent. Enable it only for traffic you permit your Manifest server to process and store.
118
87
 
119
- ## License
88
+ ## More
120
89
 
121
- [MIT](LICENSE)
90
+ [Configuration, limits & development](docs/guide.md) · [API contract](CONTRACT.md) · [Python SDK](https://github.com/mnfst/manifest-python)