every-plugin 2.10.1 → 3.0.0-rc.3

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 (462) hide show
  1. package/bin/every-plugin-serve.mjs +12 -0
  2. package/bin/every-plugin.mjs +59 -0
  3. package/dist/_virtual/_rolldown/runtime.cjs +1 -2
  4. package/dist/build/artifact-names.cjs +119 -0
  5. package/dist/build/artifact-names.cjs.map +1 -0
  6. package/dist/build/artifact-names.d.cts +68 -0
  7. package/dist/build/artifact-names.d.cts.map +1 -0
  8. package/dist/build/artifact-names.d.mts +68 -0
  9. package/dist/build/artifact-names.d.mts.map +1 -0
  10. package/dist/build/artifact-names.mjs +102 -0
  11. package/dist/build/artifact-names.mjs.map +1 -0
  12. package/dist/build/contract-types.cjs +89 -0
  13. package/dist/build/contract-types.cjs.map +1 -0
  14. package/dist/build/contract-types.mjs +81 -0
  15. package/dist/build/contract-types.mjs.map +1 -0
  16. package/dist/build/rspack/build-report-plugin.cjs +37 -0
  17. package/dist/build/rspack/build-report-plugin.cjs.map +1 -0
  18. package/dist/build/rspack/build-report-plugin.d.cts +18 -0
  19. package/dist/build/rspack/build-report-plugin.d.cts.map +1 -0
  20. package/dist/build/rspack/build-report-plugin.d.mts +18 -0
  21. package/dist/build/rspack/build-report-plugin.d.mts.map +1 -0
  22. package/dist/build/rspack/build-report-plugin.mjs +37 -0
  23. package/dist/build/rspack/build-report-plugin.mjs.map +1 -0
  24. package/dist/build/rspack/chunk-completeness-plugin.cjs +47 -0
  25. package/dist/build/rspack/chunk-completeness-plugin.cjs.map +1 -0
  26. package/dist/build/rspack/chunk-completeness-plugin.mjs +47 -0
  27. package/dist/build/rspack/chunk-completeness-plugin.mjs.map +1 -0
  28. package/dist/build/rspack/compose.cjs +69 -0
  29. package/dist/build/rspack/compose.cjs.map +1 -0
  30. package/dist/build/rspack/compose.d.cts +20 -0
  31. package/dist/build/rspack/compose.d.cts.map +1 -0
  32. package/dist/build/rspack/compose.d.mts +20 -0
  33. package/dist/build/rspack/compose.d.mts.map +1 -0
  34. package/dist/build/rspack/compose.mjs +65 -0
  35. package/dist/build/rspack/compose.mjs.map +1 -0
  36. package/dist/build/rspack/fix-mf-data-uri-plugin.cjs +11 -11
  37. package/dist/build/rspack/fix-mf-data-uri-plugin.cjs.map +1 -1
  38. package/dist/build/rspack/fix-mf-data-uri-plugin.d.cts +2 -0
  39. package/dist/build/rspack/fix-mf-data-uri-plugin.d.cts.map +1 -1
  40. package/dist/build/rspack/fix-mf-data-uri-plugin.d.mts +2 -0
  41. package/dist/build/rspack/fix-mf-data-uri-plugin.d.mts.map +1 -1
  42. package/dist/build/rspack/fix-mf-data-uri-plugin.mjs +11 -10
  43. package/dist/build/rspack/fix-mf-data-uri-plugin.mjs.map +1 -1
  44. package/dist/build/rspack/generated-config.cjs +35 -0
  45. package/dist/build/rspack/generated-config.cjs.map +1 -0
  46. package/dist/build/rspack/generated-config.mjs +32 -0
  47. package/dist/build/rspack/generated-config.mjs.map +1 -0
  48. package/dist/build/rspack/index.cjs +8 -5
  49. package/dist/build/rspack/index.d.cts +5 -3
  50. package/dist/build/rspack/index.d.mts +5 -3
  51. package/dist/build/rspack/index.mjs +5 -3
  52. package/dist/build/rspack/module-federation.cjs +2 -2
  53. package/dist/build/rspack/module-federation.cjs.map +1 -1
  54. package/dist/build/rspack/module-federation.mjs +1 -1
  55. package/dist/build/rspack/module-federation.mjs.map +1 -1
  56. package/dist/build/rspack/plugin.cjs +44 -69
  57. package/dist/build/rspack/plugin.cjs.map +1 -1
  58. package/dist/build/rspack/plugin.d.cts +4 -13
  59. package/dist/build/rspack/plugin.d.cts.map +1 -1
  60. package/dist/build/rspack/plugin.d.mts +4 -13
  61. package/dist/build/rspack/plugin.d.mts.map +1 -1
  62. package/dist/build/rspack/plugin.mjs +44 -69
  63. package/dist/build/rspack/plugin.mjs.map +1 -1
  64. package/dist/build/rspack/utils.cjs +7 -5
  65. package/dist/build/rspack/utils.cjs.map +1 -1
  66. package/dist/build/rspack/utils.mjs +7 -6
  67. package/dist/build/rspack/utils.mjs.map +1 -1
  68. package/dist/build/ui/factory.cjs +88 -0
  69. package/dist/build/ui/factory.cjs.map +1 -0
  70. package/dist/build/ui/factory.d.cts +11 -0
  71. package/dist/build/ui/factory.d.cts.map +1 -0
  72. package/dist/build/ui/factory.d.mts +11 -0
  73. package/dist/build/ui/factory.d.mts.map +1 -0
  74. package/dist/build/ui/factory.mjs +80 -0
  75. package/dist/build/ui/factory.mjs.map +1 -0
  76. package/dist/build/ui/generated-config.cjs +118 -0
  77. package/dist/build/ui/generated-config.cjs.map +1 -0
  78. package/dist/build/ui/generated-config.d.cts +33 -0
  79. package/dist/build/ui/generated-config.d.cts.map +1 -0
  80. package/dist/build/ui/generated-config.d.mts +33 -0
  81. package/dist/build/ui/generated-config.d.mts.map +1 -0
  82. package/dist/build/ui/generated-config.mjs +111 -0
  83. package/dist/build/ui/generated-config.mjs.map +1 -0
  84. package/dist/build/ui/hash-artifacts-plugin.cjs +61 -0
  85. package/dist/build/ui/hash-artifacts-plugin.cjs.map +1 -0
  86. package/dist/build/ui/hash-artifacts-plugin.d.cts +20 -0
  87. package/dist/build/ui/hash-artifacts-plugin.d.cts.map +1 -0
  88. package/dist/build/ui/hash-artifacts-plugin.d.mts +20 -0
  89. package/dist/build/ui/hash-artifacts-plugin.d.mts.map +1 -0
  90. package/dist/build/ui/hash-artifacts-plugin.mjs +58 -0
  91. package/dist/build/ui/hash-artifacts-plugin.mjs.map +1 -0
  92. package/dist/build/ui/index.cjs +90 -0
  93. package/dist/build/ui/index.cjs.map +1 -0
  94. package/dist/build/ui/index.d.cts +29 -0
  95. package/dist/build/ui/index.d.cts.map +1 -0
  96. package/dist/build/ui/index.d.mts +29 -0
  97. package/dist/build/ui/index.d.mts.map +1 -0
  98. package/dist/build/ui/index.mjs +68 -0
  99. package/dist/build/ui/index.mjs.map +1 -0
  100. package/dist/build/ui/manifest-plugin.cjs +37 -0
  101. package/dist/build/ui/manifest-plugin.cjs.map +1 -0
  102. package/dist/build/ui/manifest-plugin.d.cts +19 -0
  103. package/dist/build/ui/manifest-plugin.d.cts.map +1 -0
  104. package/dist/build/ui/manifest-plugin.d.mts +19 -0
  105. package/dist/build/ui/manifest-plugin.d.mts.map +1 -0
  106. package/dist/build/ui/manifest-plugin.mjs +37 -0
  107. package/dist/build/ui/manifest-plugin.mjs.map +1 -0
  108. package/dist/build/ui/rsbuild-config.cjs +203 -0
  109. package/dist/build/ui/rsbuild-config.cjs.map +1 -0
  110. package/dist/build/ui/rsbuild-config.d.cts +45 -0
  111. package/dist/build/ui/rsbuild-config.d.cts.map +1 -0
  112. package/dist/build/ui/rsbuild-config.d.mts +45 -0
  113. package/dist/build/ui/rsbuild-config.d.mts.map +1 -0
  114. package/dist/build/ui/rsbuild-config.mjs +200 -0
  115. package/dist/build/ui/rsbuild-config.mjs.map +1 -0
  116. package/dist/build/ui/stubs.cjs +107 -0
  117. package/dist/build/ui/stubs.cjs.map +1 -0
  118. package/dist/build/ui/stubs.d.cts +25 -0
  119. package/dist/build/ui/stubs.d.cts.map +1 -0
  120. package/dist/build/ui/stubs.d.mts +25 -0
  121. package/dist/build/ui/stubs.d.mts.map +1 -0
  122. package/dist/build/ui/stubs.mjs +106 -0
  123. package/dist/build/ui/stubs.mjs.map +1 -0
  124. package/dist/cli.cjs +83 -0
  125. package/dist/cli.cjs.map +1 -0
  126. package/dist/cli.d.cts +6 -0
  127. package/dist/cli.d.cts.map +1 -0
  128. package/dist/cli.d.mts +6 -0
  129. package/dist/cli.d.mts.map +1 -0
  130. package/dist/cli.mjs +82 -0
  131. package/dist/cli.mjs.map +1 -0
  132. package/dist/dev/serve.cjs +390 -0
  133. package/dist/dev/serve.cjs.map +1 -0
  134. package/dist/dev/serve.d.cts +23 -0
  135. package/dist/dev/serve.d.cts.map +1 -0
  136. package/dist/dev/serve.d.mts +23 -0
  137. package/dist/dev/serve.d.mts.map +1 -0
  138. package/dist/dev/serve.mjs +384 -0
  139. package/dist/dev/serve.mjs.map +1 -0
  140. package/dist/dev/watch-kill.cjs +39 -0
  141. package/dist/dev/watch-kill.cjs.map +1 -0
  142. package/dist/dev/watch-kill.mjs +38 -0
  143. package/dist/dev/watch-kill.mjs.map +1 -0
  144. package/dist/effect-helpers.cjs +23 -0
  145. package/dist/effect-helpers.cjs.map +1 -0
  146. package/dist/effect-helpers.d.cts +20 -0
  147. package/dist/effect-helpers.d.cts.map +1 -0
  148. package/dist/effect-helpers.d.mts +20 -0
  149. package/dist/effect-helpers.d.mts.map +1 -0
  150. package/dist/effect-helpers.mjs +22 -0
  151. package/dist/effect-helpers.mjs.map +1 -0
  152. package/dist/errors.cjs +50 -69
  153. package/dist/errors.cjs.map +1 -1
  154. package/dist/errors.d.cts +13 -96
  155. package/dist/errors.d.cts.map +1 -1
  156. package/dist/errors.d.mts +13 -96
  157. package/dist/errors.d.mts.map +1 -1
  158. package/dist/errors.mjs +16 -34
  159. package/dist/errors.mjs.map +1 -1
  160. package/dist/identity.cjs +19 -0
  161. package/dist/identity.cjs.map +1 -0
  162. package/dist/identity.d.cts +33 -0
  163. package/dist/identity.d.cts.map +1 -0
  164. package/dist/identity.d.mts +33 -0
  165. package/dist/identity.d.mts.map +1 -0
  166. package/dist/identity.mjs +16 -0
  167. package/dist/identity.mjs.map +1 -0
  168. package/dist/index.cjs +9 -5
  169. package/dist/index.d.cts +8 -6
  170. package/dist/index.d.mts +8 -6
  171. package/dist/index.mjs +6 -4
  172. package/dist/plugin.cjs +13 -26
  173. package/dist/plugin.cjs.map +1 -1
  174. package/dist/plugin.d.cts +57 -24
  175. package/dist/plugin.d.cts.map +1 -1
  176. package/dist/plugin.d.mts +58 -25
  177. package/dist/plugin.d.mts.map +1 -1
  178. package/dist/plugin.mjs +16 -29
  179. package/dist/plugin.mjs.map +1 -1
  180. package/dist/remote-entry.cjs +103 -0
  181. package/dist/remote-entry.cjs.map +1 -0
  182. package/dist/remote-entry.d.cts +53 -0
  183. package/dist/remote-entry.d.cts.map +1 -0
  184. package/dist/remote-entry.d.mts +53 -0
  185. package/dist/remote-entry.d.mts.map +1 -0
  186. package/dist/remote-entry.mjs +98 -0
  187. package/dist/remote-entry.mjs.map +1 -0
  188. package/dist/runtime/errors.cjs +159 -33
  189. package/dist/runtime/errors.cjs.map +1 -1
  190. package/dist/runtime/errors.d.cts +64 -7
  191. package/dist/runtime/errors.d.cts.map +1 -1
  192. package/dist/runtime/errors.d.mts +64 -7
  193. package/dist/runtime/errors.d.mts.map +1 -1
  194. package/dist/runtime/errors.mjs +154 -30
  195. package/dist/runtime/errors.mjs.map +1 -1
  196. package/dist/runtime/index.cjs +95 -23
  197. package/dist/runtime/index.cjs.map +1 -1
  198. package/dist/runtime/index.d.cts +16 -0
  199. package/dist/runtime/index.d.cts.map +1 -1
  200. package/dist/runtime/index.d.mts +16 -0
  201. package/dist/runtime/index.d.mts.map +1 -1
  202. package/dist/runtime/index.mjs +98 -26
  203. package/dist/runtime/index.mjs.map +1 -1
  204. package/dist/runtime/mf-config.cjs +3 -78
  205. package/dist/runtime/mf-config.cjs.map +1 -1
  206. package/dist/runtime/mf-config.d.cts +3 -49
  207. package/dist/runtime/mf-config.d.cts.map +1 -1
  208. package/dist/runtime/mf-config.d.mts +3 -49
  209. package/dist/runtime/mf-config.d.mts.map +1 -1
  210. package/dist/runtime/mf-config.mjs +5 -78
  211. package/dist/runtime/mf-config.mjs.map +1 -1
  212. package/dist/runtime/services/module-federation.service.cjs +57 -12
  213. package/dist/runtime/services/module-federation.service.cjs.map +1 -1
  214. package/dist/runtime/services/module-federation.service.d.cts +4 -13
  215. package/dist/runtime/services/module-federation.service.d.mts +4 -13
  216. package/dist/runtime/services/module-federation.service.mjs +57 -14
  217. package/dist/runtime/services/module-federation.service.mjs.map +1 -1
  218. package/dist/runtime/services/normalize.cjs +2 -22
  219. package/dist/runtime/services/normalize.d.cts +2 -21
  220. package/dist/runtime/services/normalize.d.mts +2 -21
  221. package/dist/runtime/services/normalize.mjs +2 -21
  222. package/dist/runtime/services/plugin-lifecycle.service.cjs +9 -11
  223. package/dist/runtime/services/plugin-lifecycle.service.cjs.map +1 -1
  224. package/dist/runtime/services/plugin-lifecycle.service.d.cts +3 -16
  225. package/dist/runtime/services/plugin-lifecycle.service.d.mts +3 -16
  226. package/dist/runtime/services/plugin-lifecycle.service.mjs +10 -13
  227. package/dist/runtime/services/plugin-lifecycle.service.mjs.map +1 -1
  228. package/dist/runtime/services/plugin-loader.service.cjs +56 -30
  229. package/dist/runtime/services/plugin-loader.service.cjs.map +1 -1
  230. package/dist/runtime/services/plugin-loader.service.d.cts +6 -53
  231. package/dist/runtime/services/plugin-loader.service.d.mts +6 -53
  232. package/dist/runtime/services/plugin-loader.service.mjs +55 -31
  233. package/dist/runtime/services/plugin-loader.service.mjs.map +1 -1
  234. package/dist/runtime/services/plugin.service.cjs +10 -12
  235. package/dist/runtime/services/plugin.service.cjs.map +1 -1
  236. package/dist/runtime/services/plugin.service.d.cts +14 -36
  237. package/dist/runtime/services/plugin.service.d.cts.map +1 -1
  238. package/dist/runtime/services/plugin.service.d.mts +14 -36
  239. package/dist/runtime/services/plugin.service.d.mts.map +1 -1
  240. package/dist/runtime/services/plugin.service.mjs +14 -18
  241. package/dist/runtime/services/plugin.service.mjs.map +1 -1
  242. package/dist/runtime/services/secrets.service.cjs +12 -12
  243. package/dist/runtime/services/secrets.service.cjs.map +1 -1
  244. package/dist/runtime/services/secrets.service.d.cts +3 -15
  245. package/dist/runtime/services/secrets.service.d.mts +3 -15
  246. package/dist/runtime/services/secrets.service.mjs +12 -13
  247. package/dist/runtime/services/secrets.service.mjs.map +1 -1
  248. package/dist/runtime/services/shared-identity.cjs +40 -0
  249. package/dist/runtime/services/shared-identity.cjs.map +1 -0
  250. package/dist/runtime/services/shared-identity.mjs +38 -0
  251. package/dist/runtime/services/shared-identity.mjs.map +1 -0
  252. package/dist/runtime/validation.cjs +2 -2
  253. package/dist/runtime/validation.cjs.map +1 -1
  254. package/dist/runtime/validation.mjs +2 -2
  255. package/dist/runtime/validation.mjs.map +1 -1
  256. package/dist/shared-deps-spec.cjs +384 -0
  257. package/dist/shared-deps-spec.cjs.map +1 -0
  258. package/dist/shared-deps-spec.d.cts +182 -0
  259. package/dist/shared-deps-spec.d.cts.map +1 -0
  260. package/dist/shared-deps-spec.d.mts +182 -0
  261. package/dist/shared-deps-spec.d.mts.map +1 -0
  262. package/dist/shared-deps-spec.mjs +368 -0
  263. package/dist/shared-deps-spec.mjs.map +1 -0
  264. package/dist/types.d.cts +25 -41
  265. package/dist/types.d.cts.map +1 -1
  266. package/dist/types.d.mts +25 -41
  267. package/dist/types.d.mts.map +1 -1
  268. package/dist/ui/manifest/construct.cjs +268 -0
  269. package/dist/ui/manifest/construct.cjs.map +1 -0
  270. package/dist/ui/manifest/construct.d.cts +48 -0
  271. package/dist/ui/manifest/construct.d.cts.map +1 -0
  272. package/dist/ui/manifest/construct.d.mts +48 -0
  273. package/dist/ui/manifest/construct.d.mts.map +1 -0
  274. package/dist/ui/manifest/construct.mjs +268 -0
  275. package/dist/ui/manifest/construct.mjs.map +1 -0
  276. package/dist/ui/manifest/contract.cjs +34 -0
  277. package/dist/ui/manifest/contract.cjs.map +1 -0
  278. package/dist/ui/manifest/contract.d.cts +26 -0
  279. package/dist/ui/manifest/contract.d.cts.map +1 -0
  280. package/dist/ui/manifest/contract.d.mts +26 -0
  281. package/dist/ui/manifest/contract.d.mts.map +1 -0
  282. package/dist/ui/manifest/contract.mjs +26 -0
  283. package/dist/ui/manifest/contract.mjs.map +1 -0
  284. package/dist/ui/manifest/descriptor.cjs +64 -0
  285. package/dist/ui/manifest/descriptor.cjs.map +1 -0
  286. package/dist/ui/manifest/descriptor.d.cts +60 -0
  287. package/dist/ui/manifest/descriptor.d.cts.map +1 -0
  288. package/dist/ui/manifest/descriptor.d.mts +60 -0
  289. package/dist/ui/manifest/descriptor.d.mts.map +1 -0
  290. package/dist/ui/manifest/descriptor.mjs +61 -0
  291. package/dist/ui/manifest/descriptor.mjs.map +1 -0
  292. package/dist/ui/manifest/generator.cjs +128 -0
  293. package/dist/ui/manifest/generator.cjs.map +1 -0
  294. package/dist/ui/manifest/generator.d.cts +41 -0
  295. package/dist/ui/manifest/generator.d.cts.map +1 -0
  296. package/dist/ui/manifest/generator.d.mts +41 -0
  297. package/dist/ui/manifest/generator.d.mts.map +1 -0
  298. package/dist/ui/manifest/generator.mjs +125 -0
  299. package/dist/ui/manifest/generator.mjs.map +1 -0
  300. package/dist/ui/manifest/index.cjs +35 -0
  301. package/dist/ui/manifest/index.d.cts +9 -0
  302. package/dist/ui/manifest/index.d.mts +9 -0
  303. package/dist/ui/manifest/index.mjs +9 -0
  304. package/dist/ui/manifest/manifest-schema.cjs +97 -0
  305. package/dist/ui/manifest/manifest-schema.cjs.map +1 -0
  306. package/dist/ui/manifest/manifest-schema.d.cts +132 -0
  307. package/dist/ui/manifest/manifest-schema.d.cts.map +1 -0
  308. package/dist/ui/manifest/manifest-schema.d.mts +132 -0
  309. package/dist/ui/manifest/manifest-schema.d.mts.map +1 -0
  310. package/dist/ui/manifest/manifest-schema.mjs +90 -0
  311. package/dist/ui/manifest/manifest-schema.mjs.map +1 -0
  312. package/dist/ui/manifest/mount-registry.cjs +52 -0
  313. package/dist/ui/manifest/mount-registry.cjs.map +1 -0
  314. package/dist/ui/manifest/mount-registry.d.cts +61 -0
  315. package/dist/ui/manifest/mount-registry.d.cts.map +1 -0
  316. package/dist/ui/manifest/mount-registry.d.mts +61 -0
  317. package/dist/ui/manifest/mount-registry.d.mts.map +1 -0
  318. package/dist/ui/manifest/mount-registry.mjs +48 -0
  319. package/dist/ui/manifest/mount-registry.mjs.map +1 -0
  320. package/dist/ui/manifest/nav.cjs +13 -0
  321. package/dist/ui/manifest/nav.cjs.map +1 -0
  322. package/dist/ui/manifest/nav.d.cts +34 -0
  323. package/dist/ui/manifest/nav.d.cts.map +1 -0
  324. package/dist/ui/manifest/nav.d.mts +34 -0
  325. package/dist/ui/manifest/nav.d.mts.map +1 -0
  326. package/dist/ui/manifest/nav.mjs +13 -0
  327. package/dist/ui/manifest/nav.mjs.map +1 -0
  328. package/dist/ui/manifest/route-config.cjs +33 -0
  329. package/dist/ui/manifest/route-config.cjs.map +1 -0
  330. package/dist/ui/manifest/route-config.d.cts +40 -0
  331. package/dist/ui/manifest/route-config.d.cts.map +1 -0
  332. package/dist/ui/manifest/route-config.d.mts +40 -0
  333. package/dist/ui/manifest/route-config.d.mts.map +1 -0
  334. package/dist/ui/manifest/route-config.mjs +33 -0
  335. package/dist/ui/manifest/route-config.mjs.map +1 -0
  336. package/dist/version-manifest.cjs +65 -0
  337. package/dist/version-manifest.cjs.map +1 -0
  338. package/dist/version-manifest.d.cts +52 -0
  339. package/dist/version-manifest.d.cts.map +1 -0
  340. package/dist/version-manifest.d.mts +52 -0
  341. package/dist/version-manifest.d.mts.map +1 -0
  342. package/dist/version-manifest.mjs +63 -0
  343. package/dist/version-manifest.mjs.map +1 -0
  344. package/package.json +165 -68
  345. package/skills/plugin-client/SKILL.md +24 -5
  346. package/skills/plugin-development/SKILL.md +79 -47
  347. package/skills/plugin-testing/SKILL.md +41 -12
  348. package/src/build/artifact-names.ts +117 -0
  349. package/src/build/contract-types.ts +101 -0
  350. package/src/build/rspack/build-report-plugin.ts +34 -0
  351. package/src/build/rspack/chunk-completeness-plugin.ts +57 -0
  352. package/src/build/rspack/compose.ts +87 -0
  353. package/src/build/rspack/fix-mf-data-uri-plugin.ts +23 -12
  354. package/src/build/rspack/generated-config.ts +35 -0
  355. package/src/build/rspack/index.ts +10 -5
  356. package/src/build/rspack/module-federation.ts +1 -1
  357. package/src/build/rspack/plugin.ts +103 -105
  358. package/src/build/rspack/utils.ts +8 -2
  359. package/src/build/ui/factory.ts +96 -0
  360. package/src/build/ui/generated-config.ts +133 -0
  361. package/src/build/ui/hash-artifacts-plugin.ts +79 -0
  362. package/src/build/ui/index.ts +98 -0
  363. package/src/build/ui/manifest-plugin.ts +54 -0
  364. package/src/build/ui/rsbuild-config.ts +256 -0
  365. package/src/build/ui/stubs.ts +103 -0
  366. package/src/cli.ts +100 -0
  367. package/src/dev/serve.ts +477 -0
  368. package/src/dev/watch-kill.ts +58 -0
  369. package/src/effect-helpers.ts +25 -0
  370. package/src/errors.ts +17 -18
  371. package/src/identity.ts +36 -0
  372. package/src/index.ts +4 -0
  373. package/src/plugin.ts +88 -91
  374. package/src/remote-entry.ts +171 -0
  375. package/src/runtime/errors.ts +229 -26
  376. package/src/runtime/index.ts +132 -43
  377. package/src/runtime/mf-config.ts +12 -107
  378. package/src/runtime/services/module-federation.service.ts +218 -117
  379. package/src/runtime/services/normalize.ts +1 -18
  380. package/src/runtime/services/plugin-lifecycle.service.ts +66 -75
  381. package/src/runtime/services/plugin-loader.service.ts +271 -212
  382. package/src/runtime/services/plugin.service.ts +61 -43
  383. package/src/runtime/services/secrets.service.ts +20 -15
  384. package/src/runtime/services/shared-identity.ts +68 -0
  385. package/src/runtime/validation.ts +5 -7
  386. package/src/shared-deps-spec.ts +478 -0
  387. package/src/types.ts +25 -48
  388. package/src/ui/manifest/construct.ts +403 -0
  389. package/src/ui/manifest/contract.ts +33 -0
  390. package/src/ui/manifest/descriptor.ts +96 -0
  391. package/src/ui/manifest/generator.ts +238 -0
  392. package/src/ui/manifest/index.ts +55 -0
  393. package/src/ui/manifest/manifest-schema.ts +107 -0
  394. package/src/ui/manifest/mount-registry.ts +50 -0
  395. package/src/ui/manifest/nav.ts +43 -0
  396. package/src/ui/manifest/route-config.ts +82 -0
  397. package/src/version-manifest.ts +88 -0
  398. package/dist/build/rspack/dev-server-middleware.cjs +0 -248
  399. package/dist/build/rspack/dev-server-middleware.cjs.map +0 -1
  400. package/dist/build/rspack/dev-server-middleware.mjs +0 -247
  401. package/dist/build/rspack/dev-server-middleware.mjs.map +0 -1
  402. package/dist/build/shared-deps.cjs +0 -83
  403. package/dist/build/shared-deps.cjs.map +0 -1
  404. package/dist/build/shared-deps.d.cts +0 -67
  405. package/dist/build/shared-deps.d.cts.map +0 -1
  406. package/dist/build/shared-deps.d.mts +0 -67
  407. package/dist/build/shared-deps.d.mts.map +0 -1
  408. package/dist/build/shared-deps.mjs +0 -79
  409. package/dist/build/shared-deps.mjs.map +0 -1
  410. package/dist/effect.cjs +0 -9
  411. package/dist/effect.d.cts +0 -1
  412. package/dist/effect.d.mts +0 -1
  413. package/dist/effect.mjs +0 -3
  414. package/dist/orpc-openapi.cjs +0 -17
  415. package/dist/orpc-openapi.d.cts +0 -2
  416. package/dist/orpc-openapi.d.mts +0 -2
  417. package/dist/orpc-openapi.mjs +0 -5
  418. package/dist/orpc.cjs +0 -46
  419. package/dist/orpc.d.cts +0 -7
  420. package/dist/orpc.d.mts +0 -7
  421. package/dist/orpc.mjs +0 -11
  422. package/dist/package.cjs +0 -23
  423. package/dist/package.cjs.map +0 -1
  424. package/dist/package.mjs +0 -17
  425. package/dist/package.mjs.map +0 -1
  426. package/dist/runtime/services/module-federation.service.d.cts.map +0 -1
  427. package/dist/runtime/services/module-federation.service.d.mts.map +0 -1
  428. package/dist/runtime/services/normalize.cjs.map +0 -1
  429. package/dist/runtime/services/normalize.d.cts.map +0 -1
  430. package/dist/runtime/services/normalize.d.mts.map +0 -1
  431. package/dist/runtime/services/normalize.mjs.map +0 -1
  432. package/dist/runtime/services/plugin-lifecycle.service.d.cts.map +0 -1
  433. package/dist/runtime/services/plugin-lifecycle.service.d.mts.map +0 -1
  434. package/dist/runtime/services/plugin-loader.service.d.cts.map +0 -1
  435. package/dist/runtime/services/plugin-loader.service.d.mts.map +0 -1
  436. package/dist/runtime/services/secrets.service.d.cts.map +0 -1
  437. package/dist/runtime/services/secrets.service.d.mts.map +0 -1
  438. package/dist/testing/index.cjs +0 -57
  439. package/dist/testing/index.cjs.map +0 -1
  440. package/dist/testing/index.d.cts +0 -54
  441. package/dist/testing/index.d.cts.map +0 -1
  442. package/dist/testing/index.d.mts +0 -54
  443. package/dist/testing/index.d.mts.map +0 -1
  444. package/dist/testing/index.mjs +0 -55
  445. package/dist/testing/index.mjs.map +0 -1
  446. package/dist/zod-core.cjs +0 -9
  447. package/dist/zod-core.d.cts +0 -1
  448. package/dist/zod-core.d.mts +0 -1
  449. package/dist/zod-core.mjs +0 -3
  450. package/dist/zod.cjs +0 -11
  451. package/dist/zod.d.cts +0 -2
  452. package/dist/zod.d.mts +0 -2
  453. package/dist/zod.mjs +0 -3
  454. package/src/build/rspack/dev-server-middleware.ts +0 -324
  455. package/src/build/shared-deps.ts +0 -102
  456. package/src/effect.ts +0 -1
  457. package/src/orpc-openapi.ts +0 -2
  458. package/src/orpc.ts +0 -9
  459. package/src/testing/index.ts +0 -87
  460. package/src/testing/mocks/module-federation.service.ts +0 -41
  461. package/src/zod-core.ts +0 -1
  462. package/src/zod.ts +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch-kill.mjs","names":[],"sources":["../../src/dev/watch-kill.ts"],"sourcesContent":["interface KillableChild {\n pid?: number | undefined;\n kill: (signal?: NodeJS.Signals) => void;\n exitCode: number | null;\n killed: boolean;\n addListener: (event: \"exit\", listener: () => void) => unknown;\n removeListener: (event: \"exit\", listener: () => void) => unknown;\n}\n\nconst waitForExit = (child: KillableChild, timeoutMs: number): Promise<boolean> =>\n new Promise((resolve) => {\n if (child.exitCode !== null) {\n resolve(true);\n return;\n }\n const onExit = () => {\n clearTimeout(timer);\n resolve(true);\n };\n const timer = setTimeout(() => {\n child.removeListener(\"exit\", onExit);\n resolve(false);\n }, timeoutMs);\n child.addListener(\"exit\", onExit);\n });\n\nexport const killChildEscalating = async (\n child: KillableChild,\n terminateMs = 2000,\n): Promise<void> => {\n if (child.exitCode !== null || child.killed) return;\n child.kill(\"SIGTERM\");\n const exited = await waitForExit(child, terminateMs);\n if (!exited) child.kill(\"SIGKILL\");\n};\n\nexport interface WatchParentDeathOptions {\n intervalMs?: number;\n getPpid?: () => number;\n onParentDeath?: () => void | Promise<void>;\n}\n\nexport const watchParentDeath = (\n onParentDeath: () => void | Promise<void>,\n opts?: Omit<WatchParentDeathOptions, \"onParentDeath\">,\n): { stop: () => void } => {\n const getPpid = opts?.getPpid ?? (() => process.ppid);\n const intervalMs = opts?.intervalMs ?? 200;\n const initialPpid = getPpid();\n const timer = setInterval(() => {\n if (getPpid() !== initialPpid) {\n clearInterval(timer);\n void onParentDeath();\n }\n }, intervalMs);\n timer.unref?.();\n return { stop: () => clearInterval(timer) };\n};\n"],"mappings":";AASA,MAAM,eAAe,OAAsB,cACzC,IAAI,SAAS,YAAY;CACvB,IAAI,MAAM,aAAa,MAAM;EAC3B,QAAQ,IAAI;EACZ;CACF;CACA,MAAM,eAAe;EACnB,aAAa,KAAK;EAClB,QAAQ,IAAI;CACd;CACA,MAAM,QAAQ,iBAAiB;EAC7B,MAAM,eAAe,QAAQ,MAAM;EACnC,QAAQ,KAAK;CACf,GAAG,SAAS;CACZ,MAAM,YAAY,QAAQ,MAAM;AAClC,CAAC;AAEH,MAAa,sBAAsB,OACjC,OACA,cAAc,QACI;CAClB,IAAI,MAAM,aAAa,QAAQ,MAAM,QAAQ;CAC7C,MAAM,KAAK,SAAS;CAEpB,IAAI,CAAC,MADgB,YAAY,OAAO,WAAW,GACtC,MAAM,KAAK,SAAS;AACnC;AAQA,MAAa,oBACX,eACA,SACyB;CACzB,MAAM,UAAU,MAAM,kBAAkB,QAAQ;CAChD,MAAM,aAAa,MAAM,cAAc;CACvC,MAAM,cAAc,QAAQ;CAC5B,MAAM,QAAQ,kBAAkB;EAC9B,IAAI,QAAQ,MAAM,aAAa;GAC7B,cAAc,KAAK;GACnB,AAAK,cAAc;EACrB;CACF,GAAG,UAAU;CACb,MAAM,QAAQ;CACd,OAAO,EAAE,YAAY,cAAc,KAAK,EAAE;AAC5C"}
@@ -0,0 +1,23 @@
1
+ let effect = require("effect");
2
+
3
+ //#region src/effect-helpers.ts
4
+ /**
5
+ * Builds a layer with the current scope and returns the built context.
6
+ *
7
+ * Resources are released when the plugin's scope closes. Use inside
8
+ * `initialize` for multi-service layers; resolve individual services from
9
+ * the returned context with `Context.get`.
10
+ */
11
+ const buildScopedContext = (layer) => effect.Effect.flatMap(effect.Effect.scope, (scope) => effect.Layer.buildWithScope(layer, scope));
12
+ /**
13
+ * Builds a layer with the current scope and resolves one service from it.
14
+ *
15
+ * Equivalent to `buildScopedContext` + `Context.get` for single-service
16
+ * layers: `const db = yield* buildScoped(DatabaseTag, DatabaseLive(url))`.
17
+ */
18
+ const buildScoped = (tag, layer) => buildScopedContext(layer).pipe(effect.Effect.map((context) => effect.Context.get(context, tag)));
19
+
20
+ //#endregion
21
+ exports.buildScoped = buildScoped;
22
+ exports.buildScopedContext = buildScopedContext;
23
+ //# sourceMappingURL=effect-helpers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect-helpers.cjs","names":["Effect","Layer","Context"],"sources":["../src/effect-helpers.ts"],"sourcesContent":["import { Context, Effect, Layer, type Scope } from \"effect\";\n\n/**\n * Builds a layer with the current scope and returns the built context.\n *\n * Resources are released when the plugin's scope closes. Use inside\n * `initialize` for multi-service layers; resolve individual services from\n * the returned context with `Context.get`.\n */\nexport const buildScopedContext = <A, E, R>(\n layer: Layer.Layer<A, E, R>,\n): Effect.Effect<Context.Context<A>, E, Scope.Scope | R> =>\n Effect.flatMap(Effect.scope, (scope) => Layer.buildWithScope(layer, scope));\n\n/**\n * Builds a layer with the current scope and resolves one service from it.\n *\n * Equivalent to `buildScopedContext` + `Context.get` for single-service\n * layers: `const db = yield* buildScoped(DatabaseTag, DatabaseLive(url))`.\n */\nexport const buildScoped = <Identifier, Shape, E, R>(\n tag: Context.Service<Identifier, Shape>,\n layer: Layer.Layer<Identifier, E, R>,\n): Effect.Effect<Shape, E, Scope.Scope | R> =>\n buildScopedContext(layer).pipe(Effect.map((context) => Context.get(context, tag)));\n"],"mappings":";;;;;;;;;;AASA,MAAa,sBACX,UAEAA,cAAO,QAAQA,cAAO,QAAQ,UAAUC,aAAM,eAAe,OAAO,KAAK,CAAC;;;;;;;AAQ5E,MAAa,eACX,KACA,UAEA,mBAAmB,KAAK,CAAC,CAAC,KAAKD,cAAO,KAAK,YAAYE,eAAQ,IAAI,SAAS,GAAG,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Context, Effect, Layer, Scope } from "effect";
2
+ //#region src/effect-helpers.d.ts
3
+ /**
4
+ * Builds a layer with the current scope and returns the built context.
5
+ *
6
+ * Resources are released when the plugin's scope closes. Use inside
7
+ * `initialize` for multi-service layers; resolve individual services from
8
+ * the returned context with `Context.get`.
9
+ */
10
+ declare const buildScopedContext: <A, E, R>(layer: Layer.Layer<A, E, R>) => Effect.Effect<Context.Context<A>, E, Scope.Scope | R>;
11
+ /**
12
+ * Builds a layer with the current scope and resolves one service from it.
13
+ *
14
+ * Equivalent to `buildScopedContext` + `Context.get` for single-service
15
+ * layers: `const db = yield* buildScoped(DatabaseTag, DatabaseLive(url))`.
16
+ */
17
+ declare const buildScoped: <Identifier, Shape, E, R>(tag: Context.Service<Identifier, Shape>, layer: Layer.Layer<Identifier, E, R>) => Effect.Effect<Shape, E, Scope.Scope | R>;
18
+ //#endregion
19
+ export { buildScoped, buildScopedContext };
20
+ //# sourceMappingURL=effect-helpers.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect-helpers.d.cts","names":[],"sources":["../src/effect-helpers.ts"],"mappings":";;;;;;;;;cASa,qBAAsB,GAAG,GAAG,GAAC,OACjC,MAAM,MAAM,GAAG,GAAG,OACxB,OAAO,OAAO,QAAQ,QAAQ,IAAI,GAAG,MAAM,QAAQ;;;;;;;cASzC,cAAe,YAAY,OAAO,GAAG,GAAC,KAC5C,QAAQ,QAAQ,YAAY,QAAM,OAChC,MAAM,MAAM,YAAY,GAAG,OACjC,OAAO,OAAO,OAAO,GAAG,MAAM,QAAQ"}
@@ -0,0 +1,20 @@
1
+ import { Context, Effect, Layer, Scope } from "effect";
2
+ //#region src/effect-helpers.d.ts
3
+ /**
4
+ * Builds a layer with the current scope and returns the built context.
5
+ *
6
+ * Resources are released when the plugin's scope closes. Use inside
7
+ * `initialize` for multi-service layers; resolve individual services from
8
+ * the returned context with `Context.get`.
9
+ */
10
+ declare const buildScopedContext: <A, E, R>(layer: Layer.Layer<A, E, R>) => Effect.Effect<Context.Context<A>, E, Scope.Scope | R>;
11
+ /**
12
+ * Builds a layer with the current scope and resolves one service from it.
13
+ *
14
+ * Equivalent to `buildScopedContext` + `Context.get` for single-service
15
+ * layers: `const db = yield* buildScoped(DatabaseTag, DatabaseLive(url))`.
16
+ */
17
+ declare const buildScoped: <Identifier, Shape, E, R>(tag: Context.Service<Identifier, Shape>, layer: Layer.Layer<Identifier, E, R>) => Effect.Effect<Shape, E, Scope.Scope | R>;
18
+ //#endregion
19
+ export { buildScoped, buildScopedContext };
20
+ //# sourceMappingURL=effect-helpers.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect-helpers.d.mts","names":[],"sources":["../src/effect-helpers.ts"],"mappings":";;;;;;;;;cASa,qBAAsB,GAAG,GAAG,GAAC,OACjC,MAAM,MAAM,GAAG,GAAG,OACxB,OAAO,OAAO,QAAQ,QAAQ,IAAI,GAAG,MAAM,QAAQ;;;;;;;cASzC,cAAe,YAAY,OAAO,GAAG,GAAC,KAC5C,QAAQ,QAAQ,YAAY,QAAM,OAChC,MAAM,MAAM,YAAY,GAAG,OACjC,OAAO,OAAO,OAAO,GAAG,MAAM,QAAQ"}
@@ -0,0 +1,22 @@
1
+ import { Context, Effect, Layer } from "effect";
2
+
3
+ //#region src/effect-helpers.ts
4
+ /**
5
+ * Builds a layer with the current scope and returns the built context.
6
+ *
7
+ * Resources are released when the plugin's scope closes. Use inside
8
+ * `initialize` for multi-service layers; resolve individual services from
9
+ * the returned context with `Context.get`.
10
+ */
11
+ const buildScopedContext = (layer) => Effect.flatMap(Effect.scope, (scope) => Layer.buildWithScope(layer, scope));
12
+ /**
13
+ * Builds a layer with the current scope and resolves one service from it.
14
+ *
15
+ * Equivalent to `buildScopedContext` + `Context.get` for single-service
16
+ * layers: `const db = yield* buildScoped(DatabaseTag, DatabaseLive(url))`.
17
+ */
18
+ const buildScoped = (tag, layer) => buildScopedContext(layer).pipe(Effect.map((context) => Context.get(context, tag)));
19
+
20
+ //#endregion
21
+ export { buildScoped, buildScopedContext };
22
+ //# sourceMappingURL=effect-helpers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect-helpers.mjs","names":[],"sources":["../src/effect-helpers.ts"],"sourcesContent":["import { Context, Effect, Layer, type Scope } from \"effect\";\n\n/**\n * Builds a layer with the current scope and returns the built context.\n *\n * Resources are released when the plugin's scope closes. Use inside\n * `initialize` for multi-service layers; resolve individual services from\n * the returned context with `Context.get`.\n */\nexport const buildScopedContext = <A, E, R>(\n layer: Layer.Layer<A, E, R>,\n): Effect.Effect<Context.Context<A>, E, Scope.Scope | R> =>\n Effect.flatMap(Effect.scope, (scope) => Layer.buildWithScope(layer, scope));\n\n/**\n * Builds a layer with the current scope and resolves one service from it.\n *\n * Equivalent to `buildScopedContext` + `Context.get` for single-service\n * layers: `const db = yield* buildScoped(DatabaseTag, DatabaseLive(url))`.\n */\nexport const buildScoped = <Identifier, Shape, E, R>(\n tag: Context.Service<Identifier, Shape>,\n layer: Layer.Layer<Identifier, E, R>,\n): Effect.Effect<Shape, E, Scope.Scope | R> =>\n buildScopedContext(layer).pipe(Effect.map((context) => Context.get(context, tag)));\n"],"mappings":";;;;;;;;;;AASA,MAAa,sBACX,UAEA,OAAO,QAAQ,OAAO,QAAQ,UAAU,MAAM,eAAe,OAAO,KAAK,CAAC;;;;;;;AAQ5E,MAAa,eACX,KACA,UAEA,mBAAmB,KAAK,CAAC,CAAC,KAAK,OAAO,KAAK,YAAY,QAAQ,IAAI,SAAS,GAAG,CAAC,CAAC"}
package/dist/errors.cjs CHANGED
@@ -1,39 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- require('./zod.cjs');
3
2
  const require_errors = require('./runtime/errors.cjs');
3
+ let _orpc_server = require("@orpc/server");
4
4
  let zod = require("zod");
5
5
 
6
6
  //#region src/errors.ts
7
7
  /**
8
- * Error pattern constants for categorizing infrastructure errors
9
- */
10
- const ERROR_PATTERNS = {
11
- CONNECTION_REFUSED: ["ECONNREFUSED"],
12
- HOST_NOT_FOUND: ["ENOTFOUND", "EHOSTUNREACH"],
13
- TIMEOUT: [
14
- "ETIMEDOUT",
15
- "ESOCKETTIMEDOUT",
16
- "timeout"
17
- ],
18
- CONNECTION_RESET: ["ECONNRESET", "EPIPE"],
19
- PERMISSION: [
20
- "EACCES",
21
- "EPERM",
22
- "permission denied"
23
- ],
24
- AUTH: [
25
- "401",
26
- "unauthorized",
27
- "authentication failed"
28
- ],
29
- RATE_LIMITED: [
30
- "429",
31
- "too many requests",
32
- "rate limit"
33
- ],
34
- SERVICE_UNAVAILABLE: ["503", "service unavailable"]
35
- };
36
- /**
37
8
  * Common error schemas for plugin contracts.
38
9
  * Import individually or use the grouped PluginErrors export.
39
10
  *
@@ -49,10 +20,10 @@ const ERROR_PATTERNS = {
49
20
  */
50
21
  const UNAUTHORIZED = {
51
22
  status: 401,
52
- data: zod.object({
53
- apiKeyProvided: zod.boolean(),
54
- provider: zod.string().optional(),
55
- authType: zod.enum([
23
+ data: zod.z.object({
24
+ apiKeyProvided: zod.z.boolean(),
25
+ provider: zod.z.string().optional(),
26
+ authType: zod.z.enum([
56
27
  "apiKey",
57
28
  "oauth",
58
29
  "token"
@@ -61,11 +32,11 @@ const UNAUTHORIZED = {
61
32
  };
62
33
  const RATE_LIMITED = {
63
34
  status: 429,
64
- data: zod.object({
65
- retryAfter: zod.number().int().min(1),
66
- remainingRequests: zod.number().int().min(0).optional(),
67
- resetTime: zod.string().datetime().optional(),
68
- limitType: zod.enum([
35
+ data: zod.z.object({
36
+ retryAfter: zod.z.number().int().min(1),
37
+ remainingRequests: zod.z.number().int().min(0).optional(),
38
+ resetTime: zod.z.string().datetime().optional(),
39
+ limitType: zod.z.enum([
69
40
  "requests",
70
41
  "tokens",
71
42
  "bandwidth"
@@ -74,52 +45,52 @@ const RATE_LIMITED = {
74
45
  };
75
46
  const SERVICE_UNAVAILABLE = {
76
47
  status: 503,
77
- data: zod.object({
78
- retryAfter: zod.number().int().optional(),
79
- maintenanceWindow: zod.boolean().default(false),
80
- estimatedUptime: zod.string().datetime().optional()
48
+ data: zod.z.object({
49
+ retryAfter: zod.z.number().int().optional(),
50
+ maintenanceWindow: zod.z.boolean().default(false),
51
+ estimatedUptime: zod.z.string().datetime().optional()
81
52
  })
82
53
  };
83
54
  const BAD_REQUEST = {
84
55
  status: 400,
85
- data: zod.object({
86
- invalidFields: zod.array(zod.string()).optional(),
87
- validationErrors: zod.array(zod.object({
88
- field: zod.string(),
89
- message: zod.string(),
90
- code: zod.string().optional()
56
+ data: zod.z.object({
57
+ invalidFields: zod.z.array(zod.z.string()).optional(),
58
+ validationErrors: zod.z.array(zod.z.object({
59
+ field: zod.z.string(),
60
+ message: zod.z.string(),
61
+ code: zod.z.string().optional()
91
62
  })).optional()
92
63
  })
93
64
  };
94
65
  const NOT_FOUND = {
95
66
  status: 404,
96
- data: zod.object({
97
- resource: zod.string().optional(),
98
- resourceId: zod.string().optional()
67
+ data: zod.z.object({
68
+ resource: zod.z.string().optional(),
69
+ resourceId: zod.z.string().optional()
99
70
  })
100
71
  };
101
72
  const FORBIDDEN = {
102
73
  status: 403,
103
- data: zod.object({
104
- requiredPermissions: zod.array(zod.string()).optional(),
105
- action: zod.string().optional()
74
+ data: zod.z.object({
75
+ requiredPermissions: zod.z.array(zod.z.string()).optional(),
76
+ action: zod.z.string().optional()
106
77
  })
107
78
  };
108
79
  const TIMEOUT = {
109
80
  status: 504,
110
- data: zod.object({
111
- timeoutMs: zod.number().int().min(0).optional(),
112
- operation: zod.string().optional(),
113
- retryable: zod.boolean().default(true)
81
+ data: zod.z.object({
82
+ timeoutMs: zod.z.number().int().min(0).optional(),
83
+ operation: zod.z.string().optional(),
84
+ retryable: zod.z.boolean().default(true)
114
85
  })
115
86
  };
116
87
  const CONNECTION_ERROR = {
117
88
  status: 502,
118
- data: zod.object({
119
- errorCode: zod.string().optional(),
120
- host: zod.string().optional(),
121
- port: zod.number().int().optional(),
122
- suggestion: zod.string().optional()
89
+ data: zod.z.object({
90
+ errorCode: zod.z.string().optional(),
91
+ host: zod.z.string().optional(),
92
+ port: zod.z.number().int().optional(),
93
+ suggestion: zod.z.string().optional()
123
94
  })
124
95
  };
125
96
  /**
@@ -137,18 +108,27 @@ const PluginErrors = {
137
108
  CONNECTION_ERROR
138
109
  };
139
110
  /**
140
- * @deprecated Use individual imports or PluginErrors instead
111
+ * Error-code -> HTTP-status map for handlers.
112
+ *
113
+ * oRPC v2 resolves statuses at the handler boundary via `errorStatusMap`
114
+ * (default `COMMON_ERROR_STATUS_MAP`, where TIMEOUT is 408). Providing a
115
+ * map REPLACES the default entirely, so the standard codes must be spread
116
+ * back in. These custom entries preserve the v1 wire behavior:
117
+ * TIMEOUT -> 504, CONNECTION_ERROR -> 502.
141
118
  */
142
- const CommonPluginErrors = PluginErrors;
119
+ const PLUGIN_ERROR_STATUS_MAP = {
120
+ ..._orpc_server.COMMON_ERROR_STATUS_MAP,
121
+ TIMEOUT: 504,
122
+ CONNECTION_ERROR: 502
123
+ };
143
124
 
144
125
  //#endregion
145
126
  exports.BAD_REQUEST = BAD_REQUEST;
146
127
  exports.CONNECTION_ERROR = CONNECTION_ERROR;
147
- exports.CommonPluginErrors = CommonPluginErrors;
148
- exports.ERROR_PATTERNS = ERROR_PATTERNS;
149
128
  exports.FORBIDDEN = FORBIDDEN;
150
129
  exports.ModuleFederationError = require_errors.ModuleFederationError;
151
130
  exports.NOT_FOUND = NOT_FOUND;
131
+ exports.PLUGIN_ERROR_STATUS_MAP = PLUGIN_ERROR_STATUS_MAP;
152
132
  exports.PluginErrors = PluginErrors;
153
133
  exports.PluginRuntimeError = require_errors.PluginRuntimeError;
154
134
  exports.RATE_LIMITED = RATE_LIMITED;
@@ -156,9 +136,10 @@ exports.SERVICE_UNAVAILABLE = SERVICE_UNAVAILABLE;
156
136
  exports.TIMEOUT = TIMEOUT;
157
137
  exports.UNAUTHORIZED = UNAUTHORIZED;
158
138
  exports.ValidationError = require_errors.ValidationError;
139
+ exports.classifyPluginFailure = require_errors.classifyPluginFailure;
140
+ exports.defaultMissingSecretWarnings = require_errors.defaultMissingSecretWarnings;
159
141
  exports.extractFromFiberFailure = require_errors.extractFromFiberFailure;
160
142
  exports.formatORPCError = require_errors.formatORPCError;
161
- exports.isRetryableORPCCode = require_errors.isRetryableORPCCode;
162
143
  exports.toPluginRuntimeError = require_errors.toPluginRuntimeError;
163
144
  exports.wrapORPCError = require_errors.wrapORPCError;
164
145
  //# sourceMappingURL=errors.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.cjs","names":["z"],"sources":["../src/errors.ts"],"sourcesContent":["import { z } from \"./zod\";\n\n/**\n * Error pattern constants for categorizing infrastructure errors\n */\nexport const ERROR_PATTERNS = {\n CONNECTION_REFUSED: [\"ECONNREFUSED\"],\n HOST_NOT_FOUND: [\"ENOTFOUND\", \"EHOSTUNREACH\"],\n TIMEOUT: [\"ETIMEDOUT\", \"ESOCKETTIMEDOUT\", \"timeout\"],\n CONNECTION_RESET: [\"ECONNRESET\", \"EPIPE\"],\n PERMISSION: [\"EACCES\", \"EPERM\", \"permission denied\"],\n AUTH: [\"401\", \"unauthorized\", \"authentication failed\"],\n RATE_LIMITED: [\"429\", \"too many requests\", \"rate limit\"],\n SERVICE_UNAVAILABLE: [\"503\", \"service unavailable\"],\n} as const;\n\n/**\n * Common error schemas for plugin contracts.\n * Import individually or use the grouped PluginErrors export.\n *\n * @example\n * ```typescript\n * import { NOT_FOUND, FORBIDDEN, UNAUTHORIZED } from \"every-plugin/errors\";\n *\n * export const contract = oc.router({\n * getData: oc.route(...)\n * .errors({ NOT_FOUND, FORBIDDEN, UNAUTHORIZED })\n * });\n * ```\n */\n\nexport const UNAUTHORIZED = {\n status: 401,\n data: z.object({\n apiKeyProvided: z.boolean(),\n provider: z.string().optional(),\n authType: z.enum([\"apiKey\", \"oauth\", \"token\"]).optional(),\n }),\n} as const;\n\nexport const RATE_LIMITED = {\n status: 429,\n data: z.object({\n retryAfter: z.number().int().min(1),\n remainingRequests: z.number().int().min(0).optional(),\n resetTime: z.string().datetime().optional(),\n limitType: z.enum([\"requests\", \"tokens\", \"bandwidth\"]).optional(),\n }),\n} as const;\n\nexport const SERVICE_UNAVAILABLE = {\n status: 503,\n data: z.object({\n retryAfter: z.number().int().optional(),\n maintenanceWindow: z.boolean().default(false),\n estimatedUptime: z.string().datetime().optional(),\n }),\n} as const;\n\nexport const BAD_REQUEST = {\n status: 400,\n data: z.object({\n invalidFields: z.array(z.string()).optional(),\n validationErrors: z\n .array(\n z.object({\n field: z.string(),\n message: z.string(),\n code: z.string().optional(),\n }),\n )\n .optional(),\n }),\n} as const;\n\nexport const NOT_FOUND = {\n status: 404,\n data: z.object({\n resource: z.string().optional(),\n resourceId: z.string().optional(),\n }),\n} as const;\n\nexport const FORBIDDEN = {\n status: 403,\n data: z.object({\n requiredPermissions: z.array(z.string()).optional(),\n action: z.string().optional(),\n }),\n} as const;\n\nexport const TIMEOUT = {\n status: 504,\n data: z.object({\n timeoutMs: z.number().int().min(0).optional(),\n operation: z.string().optional(),\n retryable: z.boolean().default(true),\n }),\n} as const;\n\nexport const CONNECTION_ERROR = {\n status: 502,\n data: z.object({\n errorCode: z.string().optional(),\n host: z.string().optional(),\n port: z.number().int().optional(),\n suggestion: z.string().optional(),\n }),\n} as const;\n\n/**\n * Grouped export for all plugin errors.\n * Use individual imports for cleaner code.\n */\nexport const PluginErrors = {\n UNAUTHORIZED,\n RATE_LIMITED,\n SERVICE_UNAVAILABLE,\n BAD_REQUEST,\n NOT_FOUND,\n FORBIDDEN,\n TIMEOUT,\n CONNECTION_ERROR,\n} as const;\n\n/**\n * @deprecated Use individual imports or PluginErrors instead\n */\nexport const CommonPluginErrors = PluginErrors;\n\nexport {\n extractFromFiberFailure,\n formatORPCError,\n isRetryableORPCCode,\n ModuleFederationError,\n PluginRuntimeError,\n toPluginRuntimeError,\n ValidationError,\n wrapORPCError,\n} from \"./runtime/errors\";\n"],"mappings":";;;;;;;;;AAKA,MAAa,iBAAiB;CAC5B,oBAAoB,CAAC,cAAc;CACnC,gBAAgB,CAAC,aAAa,cAAc;CAC5C,SAAS;EAAC;EAAa;EAAmB;CAAS;CACnD,kBAAkB,CAAC,cAAc,OAAO;CACxC,YAAY;EAAC;EAAU;EAAS;CAAmB;CACnD,MAAM;EAAC;EAAO;EAAgB;CAAuB;CACrD,cAAc;EAAC;EAAO;EAAqB;CAAY;CACvD,qBAAqB,CAAC,OAAO,qBAAqB;AACpD;;;;;;;;;;;;;;;AAiBA,MAAa,eAAe;CAC1B,QAAQ;CACR,MAAMA,IAAE,OAAO;EACb,gBAAgBA,IAAE,QAAQ;EAC1B,UAAUA,IAAE,OAAO,CAAC,CAAC,SAAS;EAC9B,UAAUA,IAAE,KAAK;GAAC;GAAU;GAAS;EAAO,CAAC,CAAC,CAAC,SAAS;CAC1D,CAAC;AACH;AAEA,MAAa,eAAe;CAC1B,QAAQ;CACR,MAAMA,IAAE,OAAO;EACb,YAAYA,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;EAClC,mBAAmBA,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;EACpD,WAAWA,IAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EAC1C,WAAWA,IAAE,KAAK;GAAC;GAAY;GAAU;EAAW,CAAC,CAAC,CAAC,SAAS;CAClE,CAAC;AACH;AAEA,MAAa,sBAAsB;CACjC,QAAQ;CACR,MAAMA,IAAE,OAAO;EACb,YAAYA,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;EACtC,mBAAmBA,IAAE,QAAQ,CAAC,CAAC,QAAQ,KAAK;EAC5C,iBAAiBA,IAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAClD,CAAC;AACH;AAEA,MAAa,cAAc;CACzB,QAAQ;CACR,MAAMA,IAAE,OAAO;EACb,eAAeA,IAAE,MAAMA,IAAE,OAAO,CAAC,CAAC,CAAC,SAAS;EAC5C,kBAAkBA,IACf,MACCA,IAAE,OAAO;GACP,OAAOA,IAAE,OAAO;GAChB,SAASA,IAAE,OAAO;GAClB,MAAMA,IAAE,OAAO,CAAC,CAAC,SAAS;EAC5B,CAAC,CACH,CAAC,CACA,SAAS;CACd,CAAC;AACH;AAEA,MAAa,YAAY;CACvB,QAAQ;CACR,MAAMA,IAAE,OAAO;EACb,UAAUA,IAAE,OAAO,CAAC,CAAC,SAAS;EAC9B,YAAYA,IAAE,OAAO,CAAC,CAAC,SAAS;CAClC,CAAC;AACH;AAEA,MAAa,YAAY;CACvB,QAAQ;CACR,MAAMA,IAAE,OAAO;EACb,qBAAqBA,IAAE,MAAMA,IAAE,OAAO,CAAC,CAAC,CAAC,SAAS;EAClD,QAAQA,IAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,CAAC;AACH;AAEA,MAAa,UAAU;CACrB,QAAQ;CACR,MAAMA,IAAE,OAAO;EACb,WAAWA,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;EAC5C,WAAWA,IAAE,OAAO,CAAC,CAAC,SAAS;EAC/B,WAAWA,IAAE,QAAQ,CAAC,CAAC,QAAQ,IAAI;CACrC,CAAC;AACH;AAEA,MAAa,mBAAmB;CAC9B,QAAQ;CACR,MAAMA,IAAE,OAAO;EACb,WAAWA,IAAE,OAAO,CAAC,CAAC,SAAS;EAC/B,MAAMA,IAAE,OAAO,CAAC,CAAC,SAAS;EAC1B,MAAMA,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;EAChC,YAAYA,IAAE,OAAO,CAAC,CAAC,SAAS;CAClC,CAAC;AACH;;;;;AAMA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;AAKA,MAAa,qBAAqB"}
1
+ {"version":3,"file":"errors.cjs","names":["z","COMMON_ERROR_STATUS_MAP"],"sources":["../src/errors.ts"],"sourcesContent":["import { COMMON_ERROR_STATUS_MAP } from \"@orpc/server\";\nimport { z } from \"zod\";\n\n/**\n * Common error schemas for plugin contracts.\n * Import individually or use the grouped PluginErrors export.\n *\n * @example\n * ```typescript\n * import { NOT_FOUND, FORBIDDEN, UNAUTHORIZED } from \"every-plugin/errors\";\n *\n * export const contract = oc.router({\n * getData: oc.route(...)\n * .errors({ NOT_FOUND, FORBIDDEN, UNAUTHORIZED })\n * });\n * ```\n */\n\nexport const UNAUTHORIZED = {\n status: 401,\n data: z.object({\n apiKeyProvided: z.boolean(),\n provider: z.string().optional(),\n authType: z.enum([\"apiKey\", \"oauth\", \"token\"]).optional(),\n }),\n} as const;\n\nexport const RATE_LIMITED = {\n status: 429,\n data: z.object({\n retryAfter: z.number().int().min(1),\n remainingRequests: z.number().int().min(0).optional(),\n resetTime: z.string().datetime().optional(),\n limitType: z.enum([\"requests\", \"tokens\", \"bandwidth\"]).optional(),\n }),\n} as const;\n\nexport const SERVICE_UNAVAILABLE = {\n status: 503,\n data: z.object({\n retryAfter: z.number().int().optional(),\n maintenanceWindow: z.boolean().default(false),\n estimatedUptime: z.string().datetime().optional(),\n }),\n} as const;\n\nexport const BAD_REQUEST = {\n status: 400,\n data: z.object({\n invalidFields: z.array(z.string()).optional(),\n validationErrors: z\n .array(\n z.object({\n field: z.string(),\n message: z.string(),\n code: z.string().optional(),\n }),\n )\n .optional(),\n }),\n} as const;\n\nexport const NOT_FOUND = {\n status: 404,\n data: z.object({\n resource: z.string().optional(),\n resourceId: z.string().optional(),\n }),\n} as const;\n\nexport const FORBIDDEN = {\n status: 403,\n data: z.object({\n requiredPermissions: z.array(z.string()).optional(),\n action: z.string().optional(),\n }),\n} as const;\n\nexport const TIMEOUT = {\n status: 504,\n data: z.object({\n timeoutMs: z.number().int().min(0).optional(),\n operation: z.string().optional(),\n retryable: z.boolean().default(true),\n }),\n} as const;\n\nexport const CONNECTION_ERROR = {\n status: 502,\n data: z.object({\n errorCode: z.string().optional(),\n host: z.string().optional(),\n port: z.number().int().optional(),\n suggestion: z.string().optional(),\n }),\n} as const;\n\n/**\n * Grouped export for all plugin errors.\n * Use individual imports for cleaner code.\n */\nexport const PluginErrors = {\n UNAUTHORIZED,\n RATE_LIMITED,\n SERVICE_UNAVAILABLE,\n BAD_REQUEST,\n NOT_FOUND,\n FORBIDDEN,\n TIMEOUT,\n CONNECTION_ERROR,\n} as const;\n\n/**\n * Error-code -> HTTP-status map for handlers.\n *\n * oRPC v2 resolves statuses at the handler boundary via `errorStatusMap`\n * (default `COMMON_ERROR_STATUS_MAP`, where TIMEOUT is 408). Providing a\n * map REPLACES the default entirely, so the standard codes must be spread\n * back in. These custom entries preserve the v1 wire behavior:\n * TIMEOUT -> 504, CONNECTION_ERROR -> 502.\n */\nexport const PLUGIN_ERROR_STATUS_MAP: Record<string, number> = {\n ...COMMON_ERROR_STATUS_MAP,\n TIMEOUT: 504,\n CONNECTION_ERROR: 502,\n} as const;\n\nexport type { PluginLoadFailureInfo, PluginWarningInfo } from \"./runtime/errors\";\nexport {\n classifyPluginFailure,\n defaultMissingSecretWarnings,\n extractFromFiberFailure,\n formatORPCError,\n ModuleFederationError,\n PluginRuntimeError,\n toPluginRuntimeError,\n ValidationError,\n wrapORPCError,\n} from \"./runtime/errors\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,MAAa,eAAe;CAC1B,QAAQ;CACR,MAAMA,MAAE,OAAO;EACb,gBAAgBA,MAAE,QAAQ;EAC1B,UAAUA,MAAE,OAAO,CAAC,CAAC,SAAS;EAC9B,UAAUA,MAAE,KAAK;GAAC;GAAU;GAAS;EAAO,CAAC,CAAC,CAAC,SAAS;CAC1D,CAAC;AACH;AAEA,MAAa,eAAe;CAC1B,QAAQ;CACR,MAAMA,MAAE,OAAO;EACb,YAAYA,MAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;EAClC,mBAAmBA,MAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;EACpD,WAAWA,MAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EAC1C,WAAWA,MAAE,KAAK;GAAC;GAAY;GAAU;EAAW,CAAC,CAAC,CAAC,SAAS;CAClE,CAAC;AACH;AAEA,MAAa,sBAAsB;CACjC,QAAQ;CACR,MAAMA,MAAE,OAAO;EACb,YAAYA,MAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;EACtC,mBAAmBA,MAAE,QAAQ,CAAC,CAAC,QAAQ,KAAK;EAC5C,iBAAiBA,MAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAClD,CAAC;AACH;AAEA,MAAa,cAAc;CACzB,QAAQ;CACR,MAAMA,MAAE,OAAO;EACb,eAAeA,MAAE,MAAMA,MAAE,OAAO,CAAC,CAAC,CAAC,SAAS;EAC5C,kBAAkBA,MACf,MACCA,MAAE,OAAO;GACP,OAAOA,MAAE,OAAO;GAChB,SAASA,MAAE,OAAO;GAClB,MAAMA,MAAE,OAAO,CAAC,CAAC,SAAS;EAC5B,CAAC,CACH,CAAC,CACA,SAAS;CACd,CAAC;AACH;AAEA,MAAa,YAAY;CACvB,QAAQ;CACR,MAAMA,MAAE,OAAO;EACb,UAAUA,MAAE,OAAO,CAAC,CAAC,SAAS;EAC9B,YAAYA,MAAE,OAAO,CAAC,CAAC,SAAS;CAClC,CAAC;AACH;AAEA,MAAa,YAAY;CACvB,QAAQ;CACR,MAAMA,MAAE,OAAO;EACb,qBAAqBA,MAAE,MAAMA,MAAE,OAAO,CAAC,CAAC,CAAC,SAAS;EAClD,QAAQA,MAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,CAAC;AACH;AAEA,MAAa,UAAU;CACrB,QAAQ;CACR,MAAMA,MAAE,OAAO;EACb,WAAWA,MAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;EAC5C,WAAWA,MAAE,OAAO,CAAC,CAAC,SAAS;EAC/B,WAAWA,MAAE,QAAQ,CAAC,CAAC,QAAQ,IAAI;CACrC,CAAC;AACH;AAEA,MAAa,mBAAmB;CAC9B,QAAQ;CACR,MAAMA,MAAE,OAAO;EACb,WAAWA,MAAE,OAAO,CAAC,CAAC,SAAS;EAC/B,MAAMA,MAAE,OAAO,CAAC,CAAC,SAAS;EAC1B,MAAMA,MAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;EAChC,YAAYA,MAAE,OAAO,CAAC,CAAC,SAAS;CAClC,CAAC;AACH;;;;;AAMA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;AAWA,MAAa,0BAAkD;CAC7D,GAAGC;CACH,SAAS;CACT,kBAAkB;AACpB"}
package/dist/errors.d.cts CHANGED
@@ -1,19 +1,6 @@
1
- import { z } from "./zod.cjs";
2
- import { ModuleFederationError, PluginRuntimeError, ValidationError, extractFromFiberFailure, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.cjs";
1
+ import { ModuleFederationError, PluginLoadFailureInfo, PluginRuntimeError, PluginWarningInfo, ValidationError, classifyPluginFailure, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.cjs";
2
+ import { z } from "zod";
3
3
  //#region src/errors.d.ts
4
- /**
5
- * Error pattern constants for categorizing infrastructure errors
6
- */
7
- declare const ERROR_PATTERNS: {
8
- readonly CONNECTION_REFUSED: readonly ["ECONNREFUSED"];
9
- readonly HOST_NOT_FOUND: readonly ["ENOTFOUND", "EHOSTUNREACH"];
10
- readonly TIMEOUT: readonly ["ETIMEDOUT", "ESOCKETTIMEDOUT", "timeout"];
11
- readonly CONNECTION_RESET: readonly ["ECONNRESET", "EPIPE"];
12
- readonly PERMISSION: readonly ["EACCES", "EPERM", "permission denied"];
13
- readonly AUTH: readonly ["401", "unauthorized", "authentication failed"];
14
- readonly RATE_LIMITED: readonly ["429", "too many requests", "rate limit"];
15
- readonly SERVICE_UNAVAILABLE: readonly ["503", "service unavailable"];
16
- };
17
4
  /**
18
5
  * Common error schemas for plugin contracts.
19
6
  * Import individually or use the grouped PluginErrors export.
@@ -47,9 +34,9 @@ declare const RATE_LIMITED: {
47
34
  remainingRequests: z.ZodOptional<z.ZodNumber>;
48
35
  resetTime: z.ZodOptional<z.ZodString>;
49
36
  limitType: z.ZodOptional<z.ZodEnum<{
37
+ bandwidth: "bandwidth";
50
38
  requests: "requests";
51
39
  tokens: "tokens";
52
- bandwidth: "bandwidth";
53
40
  }>>;
54
41
  }, z.core.$strip>;
55
42
  };
@@ -127,9 +114,9 @@ declare const PluginErrors: {
127
114
  remainingRequests: z.ZodOptional<z.ZodNumber>;
128
115
  resetTime: z.ZodOptional<z.ZodString>;
129
116
  limitType: z.ZodOptional<z.ZodEnum<{
117
+ bandwidth: "bandwidth";
130
118
  requests: "requests";
131
119
  tokens: "tokens";
132
- bandwidth: "bandwidth";
133
120
  }>>;
134
121
  }, z.core.$strip>;
135
122
  };
@@ -185,85 +172,15 @@ declare const PluginErrors: {
185
172
  };
186
173
  };
187
174
  /**
188
- * @deprecated Use individual imports or PluginErrors instead
175
+ * Error-code -> HTTP-status map for handlers.
176
+ *
177
+ * oRPC v2 resolves statuses at the handler boundary via `errorStatusMap`
178
+ * (default `COMMON_ERROR_STATUS_MAP`, where TIMEOUT is 408). Providing a
179
+ * map REPLACES the default entirely, so the standard codes must be spread
180
+ * back in. These custom entries preserve the v1 wire behavior:
181
+ * TIMEOUT -> 504, CONNECTION_ERROR -> 502.
189
182
  */
190
- declare const CommonPluginErrors: {
191
- readonly UNAUTHORIZED: {
192
- readonly status: 401;
193
- readonly data: z.ZodObject<{
194
- apiKeyProvided: z.ZodBoolean;
195
- provider: z.ZodOptional<z.ZodString>;
196
- authType: z.ZodOptional<z.ZodEnum<{
197
- apiKey: "apiKey";
198
- oauth: "oauth";
199
- token: "token";
200
- }>>;
201
- }, z.core.$strip>;
202
- };
203
- readonly RATE_LIMITED: {
204
- readonly status: 429;
205
- readonly data: z.ZodObject<{
206
- retryAfter: z.ZodNumber;
207
- remainingRequests: z.ZodOptional<z.ZodNumber>;
208
- resetTime: z.ZodOptional<z.ZodString>;
209
- limitType: z.ZodOptional<z.ZodEnum<{
210
- requests: "requests";
211
- tokens: "tokens";
212
- bandwidth: "bandwidth";
213
- }>>;
214
- }, z.core.$strip>;
215
- };
216
- readonly SERVICE_UNAVAILABLE: {
217
- readonly status: 503;
218
- readonly data: z.ZodObject<{
219
- retryAfter: z.ZodOptional<z.ZodNumber>;
220
- maintenanceWindow: z.ZodDefault<z.ZodBoolean>;
221
- estimatedUptime: z.ZodOptional<z.ZodString>;
222
- }, z.core.$strip>;
223
- };
224
- readonly BAD_REQUEST: {
225
- readonly status: 400;
226
- readonly data: z.ZodObject<{
227
- invalidFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
228
- validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
229
- field: z.ZodString;
230
- message: z.ZodString;
231
- code: z.ZodOptional<z.ZodString>;
232
- }, z.core.$strip>>>;
233
- }, z.core.$strip>;
234
- };
235
- readonly NOT_FOUND: {
236
- readonly status: 404;
237
- readonly data: z.ZodObject<{
238
- resource: z.ZodOptional<z.ZodString>;
239
- resourceId: z.ZodOptional<z.ZodString>;
240
- }, z.core.$strip>;
241
- };
242
- readonly FORBIDDEN: {
243
- readonly status: 403;
244
- readonly data: z.ZodObject<{
245
- requiredPermissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
246
- action: z.ZodOptional<z.ZodString>;
247
- }, z.core.$strip>;
248
- };
249
- readonly TIMEOUT: {
250
- readonly status: 504;
251
- readonly data: z.ZodObject<{
252
- timeoutMs: z.ZodOptional<z.ZodNumber>;
253
- operation: z.ZodOptional<z.ZodString>;
254
- retryable: z.ZodDefault<z.ZodBoolean>;
255
- }, z.core.$strip>;
256
- };
257
- readonly CONNECTION_ERROR: {
258
- readonly status: 502;
259
- readonly data: z.ZodObject<{
260
- errorCode: z.ZodOptional<z.ZodString>;
261
- host: z.ZodOptional<z.ZodString>;
262
- port: z.ZodOptional<z.ZodNumber>;
263
- suggestion: z.ZodOptional<z.ZodString>;
264
- }, z.core.$strip>;
265
- };
266
- };
183
+ declare const PLUGIN_ERROR_STATUS_MAP: Record<string, number>;
267
184
  //#endregion
268
- export { BAD_REQUEST, CONNECTION_ERROR, CommonPluginErrors, ERROR_PATTERNS, FORBIDDEN, ModuleFederationError, NOT_FOUND, PluginErrors, PluginRuntimeError, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED, ValidationError, extractFromFiberFailure, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError };
185
+ export { BAD_REQUEST, CONNECTION_ERROR, FORBIDDEN, ModuleFederationError, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, type PluginLoadFailureInfo, PluginRuntimeError, type PluginWarningInfo, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED, ValidationError, classifyPluginFailure, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, toPluginRuntimeError, wrapORPCError };
269
186
  //# sourceMappingURL=errors.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;;cAKa;;;;;;;;;;;;;;;;;;;;;;;;cA0BA;;;;;;;;;;;;cASA;;;;;;;;;;;;;cAUA;;;;;;;;cASA;;;;;;;;;;;cAgBA;;;;;;;cAQA;;;;;;;cAQA;;;;;;;;cASA;;;;;;;;;;;;;cAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcA"}
1
+ {"version":3,"file":"errors.d.cts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;;;;;;;;;;;;;cAkBa;WACX;WACA,MAAI,EAAA;;;;;;;;;;cAOO;WACX;WACA,MAAI,EAAA;;;;;;;;;;;cAQO;WACX;WACA,MAAI,EAAA;;;;;;cAOO;WACX;WACA,MAAI,EAAA;;;;;;;;;cAcO;WACX;WACA,MAAI,EAAA;;;;;cAMO;WACX;WACA,MAAI,EAAA;;;;;cAMO;WACX;WACA,MAAI,EAAA;;;;;;cAOO;WACX;WACA,MAAI,EAAA;;;;;;;;;;;cAYO;;aAlFH;;;;;;;;;;;;aASA;;;;;;;;;;;;;aAUA;;;;;;;;aASA;;;;;;;;;;;aAgBA;;;;;;;aAQA;;;;;;;aAQA;;;;;;;;aASA;;;;;;;;;;;;;;;;;;cAiCG,yBAAyB"}
package/dist/errors.d.mts CHANGED
@@ -1,19 +1,6 @@
1
- import { z } from "./zod.mjs";
2
- import { ModuleFederationError, PluginRuntimeError, ValidationError, extractFromFiberFailure, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.mjs";
1
+ import { ModuleFederationError, PluginLoadFailureInfo, PluginRuntimeError, PluginWarningInfo, ValidationError, classifyPluginFailure, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.mjs";
2
+ import { z } from "zod";
3
3
  //#region src/errors.d.ts
4
- /**
5
- * Error pattern constants for categorizing infrastructure errors
6
- */
7
- declare const ERROR_PATTERNS: {
8
- readonly CONNECTION_REFUSED: readonly ["ECONNREFUSED"];
9
- readonly HOST_NOT_FOUND: readonly ["ENOTFOUND", "EHOSTUNREACH"];
10
- readonly TIMEOUT: readonly ["ETIMEDOUT", "ESOCKETTIMEDOUT", "timeout"];
11
- readonly CONNECTION_RESET: readonly ["ECONNRESET", "EPIPE"];
12
- readonly PERMISSION: readonly ["EACCES", "EPERM", "permission denied"];
13
- readonly AUTH: readonly ["401", "unauthorized", "authentication failed"];
14
- readonly RATE_LIMITED: readonly ["429", "too many requests", "rate limit"];
15
- readonly SERVICE_UNAVAILABLE: readonly ["503", "service unavailable"];
16
- };
17
4
  /**
18
5
  * Common error schemas for plugin contracts.
19
6
  * Import individually or use the grouped PluginErrors export.
@@ -47,9 +34,9 @@ declare const RATE_LIMITED: {
47
34
  remainingRequests: z.ZodOptional<z.ZodNumber>;
48
35
  resetTime: z.ZodOptional<z.ZodString>;
49
36
  limitType: z.ZodOptional<z.ZodEnum<{
37
+ bandwidth: "bandwidth";
50
38
  requests: "requests";
51
39
  tokens: "tokens";
52
- bandwidth: "bandwidth";
53
40
  }>>;
54
41
  }, z.core.$strip>;
55
42
  };
@@ -127,9 +114,9 @@ declare const PluginErrors: {
127
114
  remainingRequests: z.ZodOptional<z.ZodNumber>;
128
115
  resetTime: z.ZodOptional<z.ZodString>;
129
116
  limitType: z.ZodOptional<z.ZodEnum<{
117
+ bandwidth: "bandwidth";
130
118
  requests: "requests";
131
119
  tokens: "tokens";
132
- bandwidth: "bandwidth";
133
120
  }>>;
134
121
  }, z.core.$strip>;
135
122
  };
@@ -185,85 +172,15 @@ declare const PluginErrors: {
185
172
  };
186
173
  };
187
174
  /**
188
- * @deprecated Use individual imports or PluginErrors instead
175
+ * Error-code -> HTTP-status map for handlers.
176
+ *
177
+ * oRPC v2 resolves statuses at the handler boundary via `errorStatusMap`
178
+ * (default `COMMON_ERROR_STATUS_MAP`, where TIMEOUT is 408). Providing a
179
+ * map REPLACES the default entirely, so the standard codes must be spread
180
+ * back in. These custom entries preserve the v1 wire behavior:
181
+ * TIMEOUT -> 504, CONNECTION_ERROR -> 502.
189
182
  */
190
- declare const CommonPluginErrors: {
191
- readonly UNAUTHORIZED: {
192
- readonly status: 401;
193
- readonly data: z.ZodObject<{
194
- apiKeyProvided: z.ZodBoolean;
195
- provider: z.ZodOptional<z.ZodString>;
196
- authType: z.ZodOptional<z.ZodEnum<{
197
- apiKey: "apiKey";
198
- oauth: "oauth";
199
- token: "token";
200
- }>>;
201
- }, z.core.$strip>;
202
- };
203
- readonly RATE_LIMITED: {
204
- readonly status: 429;
205
- readonly data: z.ZodObject<{
206
- retryAfter: z.ZodNumber;
207
- remainingRequests: z.ZodOptional<z.ZodNumber>;
208
- resetTime: z.ZodOptional<z.ZodString>;
209
- limitType: z.ZodOptional<z.ZodEnum<{
210
- requests: "requests";
211
- tokens: "tokens";
212
- bandwidth: "bandwidth";
213
- }>>;
214
- }, z.core.$strip>;
215
- };
216
- readonly SERVICE_UNAVAILABLE: {
217
- readonly status: 503;
218
- readonly data: z.ZodObject<{
219
- retryAfter: z.ZodOptional<z.ZodNumber>;
220
- maintenanceWindow: z.ZodDefault<z.ZodBoolean>;
221
- estimatedUptime: z.ZodOptional<z.ZodString>;
222
- }, z.core.$strip>;
223
- };
224
- readonly BAD_REQUEST: {
225
- readonly status: 400;
226
- readonly data: z.ZodObject<{
227
- invalidFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
228
- validationErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
229
- field: z.ZodString;
230
- message: z.ZodString;
231
- code: z.ZodOptional<z.ZodString>;
232
- }, z.core.$strip>>>;
233
- }, z.core.$strip>;
234
- };
235
- readonly NOT_FOUND: {
236
- readonly status: 404;
237
- readonly data: z.ZodObject<{
238
- resource: z.ZodOptional<z.ZodString>;
239
- resourceId: z.ZodOptional<z.ZodString>;
240
- }, z.core.$strip>;
241
- };
242
- readonly FORBIDDEN: {
243
- readonly status: 403;
244
- readonly data: z.ZodObject<{
245
- requiredPermissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
246
- action: z.ZodOptional<z.ZodString>;
247
- }, z.core.$strip>;
248
- };
249
- readonly TIMEOUT: {
250
- readonly status: 504;
251
- readonly data: z.ZodObject<{
252
- timeoutMs: z.ZodOptional<z.ZodNumber>;
253
- operation: z.ZodOptional<z.ZodString>;
254
- retryable: z.ZodDefault<z.ZodBoolean>;
255
- }, z.core.$strip>;
256
- };
257
- readonly CONNECTION_ERROR: {
258
- readonly status: 502;
259
- readonly data: z.ZodObject<{
260
- errorCode: z.ZodOptional<z.ZodString>;
261
- host: z.ZodOptional<z.ZodString>;
262
- port: z.ZodOptional<z.ZodNumber>;
263
- suggestion: z.ZodOptional<z.ZodString>;
264
- }, z.core.$strip>;
265
- };
266
- };
183
+ declare const PLUGIN_ERROR_STATUS_MAP: Record<string, number>;
267
184
  //#endregion
268
- export { BAD_REQUEST, CONNECTION_ERROR, CommonPluginErrors, ERROR_PATTERNS, FORBIDDEN, ModuleFederationError, NOT_FOUND, PluginErrors, PluginRuntimeError, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED, ValidationError, extractFromFiberFailure, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError };
185
+ export { BAD_REQUEST, CONNECTION_ERROR, FORBIDDEN, ModuleFederationError, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, type PluginLoadFailureInfo, PluginRuntimeError, type PluginWarningInfo, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED, ValidationError, classifyPluginFailure, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, toPluginRuntimeError, wrapORPCError };
269
186
  //# sourceMappingURL=errors.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;;cAKa;;;;;;;;;;;;;;;;;;;;;;;;cA0BA;;;;;;;;;;;;cASA;;;;;;;;;;;;;cAUA;;;;;;;;cASA;;;;;;;;;;;cAgBA;;;;;;;cAQA;;;;;;;cAQA;;;;;;;;cASA;;;;;;;;;;;;;cAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcA"}
1
+ {"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"mappings":";;;;;;;;;;;;;;;;;cAkBa;WACX;WACA,MAAI,EAAA;;;;;;;;;;cAOO;WACX;WACA,MAAI,EAAA;;;;;;;;;;;cAQO;WACX;WACA,MAAI,EAAA;;;;;;cAOO;WACX;WACA,MAAI,EAAA;;;;;;;;;cAcO;WACX;WACA,MAAI,EAAA;;;;;cAMO;WACX;WACA,MAAI,EAAA;;;;;cAMO;WACX;WACA,MAAI,EAAA;;;;;;cAOO;WACX;WACA,MAAI,EAAA;;;;;;;;;;;cAYO;;aAlFH;;;;;;;;;;;;aASA;;;;;;;;;;;;;aAUA;;;;;;;;aASA;;;;;;;;;;;aAgBA;;;;;;;aAQA;;;;;;;aAQA;;;;;;;;aASA;;;;;;;;;;;;;;;;;;cAiCG,yBAAyB"}