every-plugin 3.0.0-rc.15 → 3.0.0-rc.17

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 (75) hide show
  1. package/dist/build/artifact-names.cjs +8 -5
  2. package/dist/build/artifact-names.cjs.map +1 -1
  3. package/dist/build/artifact-names.d.cts +7 -5
  4. package/dist/build/artifact-names.d.cts.map +1 -1
  5. package/dist/build/artifact-names.d.mts +7 -5
  6. package/dist/build/artifact-names.d.mts.map +1 -1
  7. package/dist/build/artifact-names.mjs +8 -5
  8. package/dist/build/artifact-names.mjs.map +1 -1
  9. package/dist/build/ui/stubs.cjs +2 -7
  10. package/dist/build/ui/stubs.cjs.map +1 -1
  11. package/dist/build/ui/stubs.d.cts.map +1 -1
  12. package/dist/build/ui/stubs.d.mts.map +1 -1
  13. package/dist/build/ui/stubs.mjs +2 -7
  14. package/dist/build/ui/stubs.mjs.map +1 -1
  15. package/dist/client.cjs +15 -63
  16. package/dist/client.cjs.map +1 -1
  17. package/dist/client.d.cts +12 -11
  18. package/dist/client.d.cts.map +1 -1
  19. package/dist/client.d.mts +12 -11
  20. package/dist/client.d.mts.map +1 -1
  21. package/dist/client.mjs +16 -64
  22. package/dist/client.mjs.map +1 -1
  23. package/dist/errors.cjs +11 -1
  24. package/dist/errors.cjs.map +1 -1
  25. package/dist/errors.d.cts +15 -1
  26. package/dist/errors.d.cts.map +1 -1
  27. package/dist/errors.d.mts +15 -1
  28. package/dist/errors.d.mts.map +1 -1
  29. package/dist/errors.mjs +11 -2
  30. package/dist/errors.mjs.map +1 -1
  31. package/dist/index.cjs +1 -0
  32. package/dist/index.d.cts +4 -4
  33. package/dist/index.d.mts +4 -4
  34. package/dist/index.mjs +2 -2
  35. package/dist/runtime/mf-config.cjs +1 -1
  36. package/dist/runtime/mf-config.mjs +1 -1
  37. package/dist/ui/manifest/construct.cjs +13 -38
  38. package/dist/ui/manifest/construct.cjs.map +1 -1
  39. package/dist/ui/manifest/construct.d.cts +4 -13
  40. package/dist/ui/manifest/construct.d.cts.map +1 -1
  41. package/dist/ui/manifest/construct.d.mts +4 -13
  42. package/dist/ui/manifest/construct.d.mts.map +1 -1
  43. package/dist/ui/manifest/construct.mjs +14 -39
  44. package/dist/ui/manifest/construct.mjs.map +1 -1
  45. package/dist/ui/manifest/descriptor.cjs +1 -1
  46. package/dist/ui/manifest/descriptor.mjs +1 -1
  47. package/dist/ui/manifest/index.d.cts +3 -3
  48. package/dist/ui/manifest/index.d.mts +3 -3
  49. package/dist/ui/manifest/mount-registry.cjs +6 -13
  50. package/dist/ui/manifest/mount-registry.cjs.map +1 -1
  51. package/dist/ui/manifest/mount-registry.d.cts +29 -36
  52. package/dist/ui/manifest/mount-registry.d.cts.map +1 -1
  53. package/dist/ui/manifest/mount-registry.d.mts +29 -36
  54. package/dist/ui/manifest/mount-registry.d.mts.map +1 -1
  55. package/dist/ui/manifest/mount-registry.mjs +6 -13
  56. package/dist/ui/manifest/mount-registry.mjs.map +1 -1
  57. package/dist/version-manifest.cjs +70 -5
  58. package/dist/version-manifest.cjs.map +1 -1
  59. package/dist/version-manifest.d.cts +41 -1
  60. package/dist/version-manifest.d.cts.map +1 -1
  61. package/dist/version-manifest.d.mts +41 -1
  62. package/dist/version-manifest.d.mts.map +1 -1
  63. package/dist/version-manifest.mjs +66 -6
  64. package/dist/version-manifest.mjs.map +1 -1
  65. package/package.json +1 -1
  66. package/skills/plugin-client/SKILL.md +3 -3
  67. package/src/build/artifact-names.ts +8 -5
  68. package/src/build/ui/stubs.ts +2 -7
  69. package/src/client.ts +14 -111
  70. package/src/errors.ts +10 -0
  71. package/src/index.ts +2 -0
  72. package/src/ui/manifest/construct.ts +20 -65
  73. package/src/ui/manifest/index.ts +0 -2
  74. package/src/ui/manifest/mount-registry.ts +20 -20
  75. package/src/version-manifest.ts +77 -10
package/dist/errors.cjs CHANGED
@@ -69,6 +69,13 @@ const NOT_FOUND = {
69
69
  resourceId: zod.z.string().optional()
70
70
  })
71
71
  };
72
+ const CONFLICT = {
73
+ status: 409,
74
+ data: zod.z.object({
75
+ resource: zod.z.string().optional(),
76
+ detail: zod.z.string().optional()
77
+ })
78
+ };
72
79
  const FORBIDDEN = {
73
80
  status: 403,
74
81
  data: zod.z.object({
@@ -103,6 +110,7 @@ const PluginErrors = {
103
110
  SERVICE_UNAVAILABLE,
104
111
  BAD_REQUEST,
105
112
  NOT_FOUND,
113
+ CONFLICT,
106
114
  FORBIDDEN,
107
115
  TIMEOUT,
108
116
  CONNECTION_ERROR
@@ -119,11 +127,13 @@ const PluginErrors = {
119
127
  const PLUGIN_ERROR_STATUS_MAP = {
120
128
  ..._orpc_server.COMMON_ERROR_STATUS_MAP,
121
129
  TIMEOUT: 504,
122
- CONNECTION_ERROR: 502
130
+ CONNECTION_ERROR: 502,
131
+ CONFLICT: 409
123
132
  };
124
133
 
125
134
  //#endregion
126
135
  exports.BAD_REQUEST = BAD_REQUEST;
136
+ exports.CONFLICT = CONFLICT;
127
137
  exports.CONNECTION_ERROR = CONNECTION_ERROR;
128
138
  exports.FORBIDDEN = FORBIDDEN;
129
139
  exports.ModuleFederationError = require_errors.ModuleFederationError;
@@ -1 +1 @@
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;CA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;CACA;AACF;;;;;;;;;;AAWA,MAAa,0BAAkD;CAC7D,GAAGC;CACH,SAAS;CACT,kBAAkB;AACpB"}
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 CONFLICT = {\n status: 409,\n data: z.object({\n resource: z.string().optional(),\n detail: 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 CONFLICT,\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 CONFLICT: 409,\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,U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OAAO,CAAC,CAAC,SAAS;EAC9B,QAAQA,MAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,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;CACA;AACF;;;;;;;;;;AAWA,MAAa,0BAAkD;CAC7D,GAAGC;CACH,SAAS;CACT,kBAAkB;CAClB,UAAU;AACZ"}
package/dist/errors.d.cts CHANGED
@@ -66,6 +66,13 @@ declare const NOT_FOUND: {
66
66
  resourceId: z.ZodOptional<z.ZodString>;
67
67
  }, z.core.$strip>;
68
68
  };
69
+ declare const CONFLICT: {
70
+ readonly status: 409;
71
+ readonly data: z.ZodObject<{
72
+ resource: z.ZodOptional<z.ZodString>;
73
+ detail: z.ZodOptional<z.ZodString>;
74
+ }, z.core.$strip>;
75
+ };
69
76
  declare const FORBIDDEN: {
70
77
  readonly status: 403;
71
78
  readonly data: z.ZodObject<{
@@ -146,6 +153,13 @@ declare const PluginErrors: {
146
153
  resourceId: z.ZodOptional<z.ZodString>;
147
154
  }, z.core.$strip>;
148
155
  };
156
+ readonly CONFLICT: {
157
+ readonly status: 409;
158
+ readonly data: z.ZodObject<{
159
+ resource: z.ZodOptional<z.ZodString>;
160
+ detail: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>;
162
+ };
149
163
  readonly FORBIDDEN: {
150
164
  readonly status: 403;
151
165
  readonly data: z.ZodObject<{
@@ -182,5 +196,5 @@ declare const PluginErrors: {
182
196
  */
183
197
  declare const PLUGIN_ERROR_STATUS_MAP: Record<string, number>;
184
198
  //#endregion
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 };
199
+ export { BAD_REQUEST, CONFLICT, 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 };
186
200
  //# sourceMappingURL=errors.d.cts.map
@@ -1 +1 @@
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"}
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;;;;;cAMO;WACX;WACA,MAAI,EAAA;;;;;;cAOO;WACX;WACA,MAAI,EAAA;;;;;;;;;;;cAYO;;aA1FH;;;;;;;;;;;;aASA;;;;;;;;;;;;;aAUA;;;;;;;;aASA;;;;;;;;;;;aAgBA;;;;;;;aAQA;;;;;;;aAQA;;;;;;;aAQA;;;;;;;;aASA;;;;;;;;;;;;;;;;;;cAkCG,yBAAyB"}
package/dist/errors.d.mts CHANGED
@@ -66,6 +66,13 @@ declare const NOT_FOUND: {
66
66
  resourceId: z.ZodOptional<z.ZodString>;
67
67
  }, z.core.$strip>;
68
68
  };
69
+ declare const CONFLICT: {
70
+ readonly status: 409;
71
+ readonly data: z.ZodObject<{
72
+ resource: z.ZodOptional<z.ZodString>;
73
+ detail: z.ZodOptional<z.ZodString>;
74
+ }, z.core.$strip>;
75
+ };
69
76
  declare const FORBIDDEN: {
70
77
  readonly status: 403;
71
78
  readonly data: z.ZodObject<{
@@ -146,6 +153,13 @@ declare const PluginErrors: {
146
153
  resourceId: z.ZodOptional<z.ZodString>;
147
154
  }, z.core.$strip>;
148
155
  };
156
+ readonly CONFLICT: {
157
+ readonly status: 409;
158
+ readonly data: z.ZodObject<{
159
+ resource: z.ZodOptional<z.ZodString>;
160
+ detail: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>;
162
+ };
149
163
  readonly FORBIDDEN: {
150
164
  readonly status: 403;
151
165
  readonly data: z.ZodObject<{
@@ -182,5 +196,5 @@ declare const PluginErrors: {
182
196
  */
183
197
  declare const PLUGIN_ERROR_STATUS_MAP: Record<string, number>;
184
198
  //#endregion
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 };
199
+ export { BAD_REQUEST, CONFLICT, 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 };
186
200
  //# sourceMappingURL=errors.d.mts.map
@@ -1 +1 @@
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"}
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;;;;;cAMO;WACX;WACA,MAAI,EAAA;;;;;;cAOO;WACX;WACA,MAAI,EAAA;;;;;;;;;;;cAYO;;aA1FH;;;;;;;;;;;;aASA;;;;;;;;;;;;;aAUA;;;;;;;;aASA;;;;;;;;;;;aAgBA;;;;;;;aAQA;;;;;;;aAQA;;;;;;;aAQA;;;;;;;;aASA;;;;;;;;;;;;;;;;;;cAkCG,yBAAyB"}
package/dist/errors.mjs CHANGED
@@ -68,6 +68,13 @@ const NOT_FOUND = {
68
68
  resourceId: z.string().optional()
69
69
  })
70
70
  };
71
+ const CONFLICT = {
72
+ status: 409,
73
+ data: z.object({
74
+ resource: z.string().optional(),
75
+ detail: z.string().optional()
76
+ })
77
+ };
71
78
  const FORBIDDEN = {
72
79
  status: 403,
73
80
  data: z.object({
@@ -102,6 +109,7 @@ const PluginErrors = {
102
109
  SERVICE_UNAVAILABLE,
103
110
  BAD_REQUEST,
104
111
  NOT_FOUND,
112
+ CONFLICT,
105
113
  FORBIDDEN,
106
114
  TIMEOUT,
107
115
  CONNECTION_ERROR
@@ -118,9 +126,10 @@ const PluginErrors = {
118
126
  const PLUGIN_ERROR_STATUS_MAP = {
119
127
  ...COMMON_ERROR_STATUS_MAP,
120
128
  TIMEOUT: 504,
121
- CONNECTION_ERROR: 502
129
+ CONNECTION_ERROR: 502,
130
+ CONFLICT: 409
122
131
  };
123
132
 
124
133
  //#endregion
125
- export { BAD_REQUEST, CONNECTION_ERROR, FORBIDDEN, ModuleFederationError, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, PluginRuntimeError, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED, ValidationError, classifyPluginFailure, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, toPluginRuntimeError, wrapORPCError };
134
+ export { BAD_REQUEST, CONFLICT, CONNECTION_ERROR, FORBIDDEN, ModuleFederationError, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, PluginRuntimeError, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED, ValidationError, classifyPluginFailure, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, toPluginRuntimeError, wrapORPCError };
126
135
  //# sourceMappingURL=errors.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.mjs","names":[],"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,MAAM,EAAE,OAAO;EACb,gBAAgB,EAAE,QAAQ;EAC1B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;EAC9B,UAAU,EAAE,KAAK;GAAC;GAAU;GAAS;EAAO,CAAC,CAAC,CAAC,SAAS;CAC1D,CAAC;AACH;AAEA,MAAa,eAAe;CAC1B,QAAQ;CACR,MAAM,EAAE,OAAO;EACb,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;EAClC,mBAAmB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;EACpD,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EAC1C,WAAW,EAAE,KAAK;GAAC;GAAY;GAAU;EAAW,CAAC,CAAC,CAAC,SAAS;CAClE,CAAC;AACH;AAEA,MAAa,sBAAsB;CACjC,QAAQ;CACR,MAAM,EAAE,OAAO;EACb,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;EACtC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,QAAQ,KAAK;EAC5C,iBA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;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;AAWA,MAAa,0BAAkD;CAC7D,GAAG;CACH,SAAS;CACT,kBAAkB;AACpB"}
1
+ {"version":3,"file":"errors.mjs","names":[],"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 CONFLICT = {\n status: 409,\n data: z.object({\n resource: z.string().optional(),\n detail: 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 CONFLICT,\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 CONFLICT: 409,\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,MAAM,EAAE,OAAO;EACb,gBAAgB,EAAE,QAAQ;EAC1B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;EAC9B,UAA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B,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,CAAC;AACH;AAEA,MAAa,YAAY;CACvB,QAAQ;CACR,MAAM,EAAE,OAAO;EACb,qBAAqB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;EAClD,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,CAAC;AACH;AAEA,MAAa,UAAU;CACrB,QAAQ;CACR,MAAM,EAAE,OAAO;EACb,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;EAC5C,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;EAC/B,WAAW,EAAE,QAAQ,CAAC,CAAC,QAAQ,IAAI;CACrC,CAAC;AACH;AAEA,MAAa,mBAAmB;CAC9B,QAAQ;CACR,MAAM,EAAE,OAAO;EACb,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;EAC/B,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;EAC1B,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;EAChC,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS;CAClC,CAAC;AACH;;;;;AAMA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;AAWA,MAAa,0BAAkD;CAC7D,GAAG;CACH,SAAS;CACT,kBAAkB;CAClB,UAAU;AACZ"}
package/dist/index.cjs CHANGED
@@ -9,6 +9,7 @@ const require_runtime_index = require("./runtime/index.cjs");
9
9
  require("@orpc/openapi/extensions/route");
10
10
 
11
11
  exports.BAD_REQUEST = require_errors$1.BAD_REQUEST;
12
+ exports.CONFLICT = require_errors$1.CONFLICT;
12
13
  exports.CONNECTION_ERROR = require_errors$1.CONNECTION_ERROR;
13
14
  exports.FORBIDDEN = require_errors$1.FORBIDDEN;
14
15
  exports.ModuleFederationError = require_errors.ModuleFederationError;
package/dist/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { remoteName } from "./identity.cjs";
2
- import { RpcClientConfig, RpcConnectionErrorCopy, createRpcClient } from "./client.cjs";
2
+ import { createRpcClient } from "./client.cjs";
3
3
  import { ModuleFederationError, PluginLoadFailureInfo, PluginRuntimeError, PluginWarningInfo, ValidationError, classifyPluginFailure, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.cjs";
4
- import { BAD_REQUEST, CONNECTION_ERROR, FORBIDDEN, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED } from "./errors.cjs";
4
+ import { BAD_REQUEST, CONFLICT, CONNECTION_ERROR, FORBIDDEN, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED } from "./errors.cjs";
5
5
  import { buildScoped, buildScopedContext } from "./effect-helpers.cjs";
6
6
  import { CreatePluginFn, CreatePluginWithPlugins, LoadedPluginWithBinding, Plugin, PluginConfigFor, PluginEnv, PluginIdTag, PluginInitializeInput, PluginWarningsFn, createPlugin, withPlugins } from "./plugin.cjs";
7
- import { AnyPlugin, EveryPlugin, InitializedPlugin, LoadedPlugin, ModuleClientEntry, ModuleEndpoint, ModuleSurface, ModuleTransport, PluginClientEntry, PluginClientType, PluginConfigInput, PluginContext, PluginContract, PluginEndpoint, PluginInstance, PluginMetadata, PluginRegistry, PluginRouterType, PluginRuntimeConfig, PluginSecrets, PluginServicesEntry, PluginSurface, PluginTransport, PluginVariables, RegisteredPlugins, SecretsConfig, UsePluginResult } from "./types.cjs";
7
+ import { AnyPlugin, EveryPlugin, InferRegistryFromEntries, InitializedPlugin, LoadedPlugin, ModuleClientEntry, ModuleEndpoint, ModuleSurface, ModuleTransport, PluginClientEntry, PluginClientType, PluginConfigInput, PluginContext, PluginContract, PluginEndpoint, PluginInstance, PluginMetadata, PluginRegistry, PluginRegistryEntry, PluginRouterType, PluginRuntimeConfig, PluginSecrets, PluginServicesEntry, PluginSurface, PluginTransport, PluginVariables, RegisteredPlugins, SecretsConfig, UsePluginResult } from "./types.cjs";
8
8
  import { PluginRuntime, createPluginRuntime } from "./runtime/index.cjs";
9
9
  import "@orpc/openapi/extensions/route";
10
- export { type AnyPlugin, BAD_REQUEST, CONNECTION_ERROR, CreatePluginFn, CreatePluginWithPlugins, type EveryPlugin, FORBIDDEN, type InitializedPlugin, type LoadedPlugin, LoadedPluginWithBinding, type ModuleClientEntry, type ModuleEndpoint, ModuleFederationError, type ModuleSurface, type ModuleTransport, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, Plugin, type PluginClientEntry, type PluginClientType, PluginConfigFor, type PluginConfigInput, type PluginContext, type PluginContract, type PluginEndpoint, PluginEnv, PluginErrors, PluginIdTag, PluginInitializeInput, type PluginInstance, type PluginLoadFailureInfo, type PluginMetadata, type PluginRegistry, type PluginRouterType, PluginRuntime, type PluginRuntimeConfig, PluginRuntimeError, type PluginSecrets, type PluginServicesEntry, type PluginSurface, type PluginTransport, type PluginVariables, type PluginWarningInfo, PluginWarningsFn, RATE_LIMITED, type RegisteredPlugins, RpcClientConfig, RpcConnectionErrorCopy, SERVICE_UNAVAILABLE, type SecretsConfig, TIMEOUT, UNAUTHORIZED, type UsePluginResult, ValidationError, buildScoped, buildScopedContext, classifyPluginFailure, createPlugin, createPluginRuntime, createRpcClient, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, remoteName as getNormalizedRemoteName, toPluginRuntimeError, withPlugins, wrapORPCError };
10
+ export { type AnyPlugin, BAD_REQUEST, CONFLICT, CONNECTION_ERROR, CreatePluginFn, CreatePluginWithPlugins, type EveryPlugin, FORBIDDEN, type InferRegistryFromEntries, type InitializedPlugin, type LoadedPlugin, LoadedPluginWithBinding, type ModuleClientEntry, type ModuleEndpoint, ModuleFederationError, type ModuleSurface, type ModuleTransport, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, Plugin, type PluginClientEntry, type PluginClientType, PluginConfigFor, type PluginConfigInput, type PluginContext, type PluginContract, type PluginEndpoint, PluginEnv, PluginErrors, PluginIdTag, PluginInitializeInput, type PluginInstance, type PluginLoadFailureInfo, type PluginMetadata, type PluginRegistry, type PluginRegistryEntry, type PluginRouterType, PluginRuntime, type PluginRuntimeConfig, PluginRuntimeError, type PluginSecrets, type PluginServicesEntry, type PluginSurface, type PluginTransport, type PluginVariables, type PluginWarningInfo, PluginWarningsFn, RATE_LIMITED, type RegisteredPlugins, SERVICE_UNAVAILABLE, type SecretsConfig, TIMEOUT, UNAUTHORIZED, type UsePluginResult, ValidationError, buildScoped, buildScopedContext, classifyPluginFailure, createPlugin, createPluginRuntime, createRpcClient, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, remoteName as getNormalizedRemoteName, toPluginRuntimeError, withPlugins, wrapORPCError };
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { remoteName } from "./identity.mjs";
2
- import { RpcClientConfig, RpcConnectionErrorCopy, createRpcClient } from "./client.mjs";
2
+ import { createRpcClient } from "./client.mjs";
3
3
  import { ModuleFederationError, PluginLoadFailureInfo, PluginRuntimeError, PluginWarningInfo, ValidationError, classifyPluginFailure, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.mjs";
4
- import { BAD_REQUEST, CONNECTION_ERROR, FORBIDDEN, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED } from "./errors.mjs";
4
+ import { BAD_REQUEST, CONFLICT, CONNECTION_ERROR, FORBIDDEN, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED } from "./errors.mjs";
5
5
  import { buildScoped, buildScopedContext } from "./effect-helpers.mjs";
6
6
  import { CreatePluginFn, CreatePluginWithPlugins, LoadedPluginWithBinding, Plugin, PluginConfigFor, PluginEnv, PluginIdTag, PluginInitializeInput, PluginWarningsFn, createPlugin, withPlugins } from "./plugin.mjs";
7
- import { AnyPlugin, EveryPlugin, InitializedPlugin, LoadedPlugin, ModuleClientEntry, ModuleEndpoint, ModuleSurface, ModuleTransport, PluginClientEntry, PluginClientType, PluginConfigInput, PluginContext, PluginContract, PluginEndpoint, PluginInstance, PluginMetadata, PluginRegistry, PluginRouterType, PluginRuntimeConfig, PluginSecrets, PluginServicesEntry, PluginSurface, PluginTransport, PluginVariables, RegisteredPlugins, SecretsConfig, UsePluginResult } from "./types.mjs";
7
+ import { AnyPlugin, EveryPlugin, InferRegistryFromEntries, InitializedPlugin, LoadedPlugin, ModuleClientEntry, ModuleEndpoint, ModuleSurface, ModuleTransport, PluginClientEntry, PluginClientType, PluginConfigInput, PluginContext, PluginContract, PluginEndpoint, PluginInstance, PluginMetadata, PluginRegistry, PluginRegistryEntry, PluginRouterType, PluginRuntimeConfig, PluginSecrets, PluginServicesEntry, PluginSurface, PluginTransport, PluginVariables, RegisteredPlugins, SecretsConfig, UsePluginResult } from "./types.mjs";
8
8
  import { PluginRuntime, createPluginRuntime } from "./runtime/index.mjs";
9
9
  import "@orpc/openapi/extensions/route";
10
- export { type AnyPlugin, BAD_REQUEST, CONNECTION_ERROR, CreatePluginFn, CreatePluginWithPlugins, type EveryPlugin, FORBIDDEN, type InitializedPlugin, type LoadedPlugin, LoadedPluginWithBinding, type ModuleClientEntry, type ModuleEndpoint, ModuleFederationError, type ModuleSurface, type ModuleTransport, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, Plugin, type PluginClientEntry, type PluginClientType, PluginConfigFor, type PluginConfigInput, type PluginContext, type PluginContract, type PluginEndpoint, PluginEnv, PluginErrors, PluginIdTag, PluginInitializeInput, type PluginInstance, type PluginLoadFailureInfo, type PluginMetadata, type PluginRegistry, type PluginRouterType, PluginRuntime, type PluginRuntimeConfig, PluginRuntimeError, type PluginSecrets, type PluginServicesEntry, type PluginSurface, type PluginTransport, type PluginVariables, type PluginWarningInfo, PluginWarningsFn, RATE_LIMITED, type RegisteredPlugins, RpcClientConfig, RpcConnectionErrorCopy, SERVICE_UNAVAILABLE, type SecretsConfig, TIMEOUT, UNAUTHORIZED, type UsePluginResult, ValidationError, buildScoped, buildScopedContext, classifyPluginFailure, createPlugin, createPluginRuntime, createRpcClient, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, remoteName as getNormalizedRemoteName, toPluginRuntimeError, withPlugins, wrapORPCError };
10
+ export { type AnyPlugin, BAD_REQUEST, CONFLICT, CONNECTION_ERROR, CreatePluginFn, CreatePluginWithPlugins, type EveryPlugin, FORBIDDEN, type InferRegistryFromEntries, type InitializedPlugin, type LoadedPlugin, LoadedPluginWithBinding, type ModuleClientEntry, type ModuleEndpoint, ModuleFederationError, type ModuleSurface, type ModuleTransport, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, Plugin, type PluginClientEntry, type PluginClientType, PluginConfigFor, type PluginConfigInput, type PluginContext, type PluginContract, type PluginEndpoint, PluginEnv, PluginErrors, PluginIdTag, PluginInitializeInput, type PluginInstance, type PluginLoadFailureInfo, type PluginMetadata, type PluginRegistry, type PluginRegistryEntry, type PluginRouterType, PluginRuntime, type PluginRuntimeConfig, PluginRuntimeError, type PluginSecrets, type PluginServicesEntry, type PluginSurface, type PluginTransport, type PluginVariables, type PluginWarningInfo, PluginWarningsFn, RATE_LIMITED, type RegisteredPlugins, SERVICE_UNAVAILABLE, type SecretsConfig, TIMEOUT, UNAUTHORIZED, type UsePluginResult, ValidationError, buildScoped, buildScopedContext, classifyPluginFailure, createPlugin, createPluginRuntime, createRpcClient, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, remoteName as getNormalizedRemoteName, toPluginRuntimeError, withPlugins, wrapORPCError };
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { createRpcClient } from "./client.mjs";
2
2
  import { buildScoped, buildScopedContext } from "./effect-helpers.mjs";
3
3
  import { ModuleFederationError, PluginRuntimeError, ValidationError, classifyPluginFailure, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, toPluginRuntimeError, wrapORPCError } from "./runtime/errors.mjs";
4
- import { BAD_REQUEST, CONNECTION_ERROR, FORBIDDEN, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED } from "./errors.mjs";
4
+ import { BAD_REQUEST, CONFLICT, CONNECTION_ERROR, FORBIDDEN, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED } from "./errors.mjs";
5
5
  import { PluginIdTag, createPlugin, withPlugins } from "./plugin.mjs";
6
6
  import { remoteName } from "./identity.mjs";
7
7
  import { PluginRuntime, createPluginRuntime } from "./runtime/index.mjs";
8
8
  import "@orpc/openapi/extensions/route";
9
9
 
10
- export { BAD_REQUEST, CONNECTION_ERROR, FORBIDDEN, ModuleFederationError, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, PluginIdTag, PluginRuntime, PluginRuntimeError, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED, ValidationError, buildScoped, buildScopedContext, classifyPluginFailure, createPlugin, createPluginRuntime, createRpcClient, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, remoteName as getNormalizedRemoteName, toPluginRuntimeError, withPlugins, wrapORPCError };
10
+ export { BAD_REQUEST, CONFLICT, CONNECTION_ERROR, FORBIDDEN, ModuleFederationError, NOT_FOUND, PLUGIN_ERROR_STATUS_MAP, PluginErrors, PluginIdTag, PluginRuntime, PluginRuntimeError, RATE_LIMITED, SERVICE_UNAVAILABLE, TIMEOUT, UNAUTHORIZED, ValidationError, buildScoped, buildScopedContext, classifyPluginFailure, createPlugin, createPluginRuntime, createRpcClient, defaultMissingSecretWarnings, extractFromFiberFailure, formatORPCError, remoteName as getNormalizedRemoteName, toPluginRuntimeError, withPlugins, wrapORPCError };
@@ -3,7 +3,7 @@ const require_shared_deps_spec = require("../shared-deps-spec.cjs");
3
3
  let node_fs = require("node:fs");
4
4
 
5
5
  //#region src/runtime/mf-config.ts
6
- const PLUGIN_VERSION = "3.0.0-rc.15";
6
+ const PLUGIN_VERSION = "3.0.0-rc.17";
7
7
  const MF_CORE_SHARED_DEPS = require_shared_deps_spec.buildMfCoreSharedDependencies({ ownVersion: PLUGIN_VERSION });
8
8
 
9
9
  //#endregion
@@ -2,7 +2,7 @@ import { buildMfCoreSharedDependencies } from "../shared-deps-spec.mjs";
2
2
  import { readFileSync } from "node:fs";
3
3
 
4
4
  //#region src/runtime/mf-config.ts
5
- const PLUGIN_VERSION = "3.0.0-rc.15";
5
+ const PLUGIN_VERSION = "3.0.0-rc.17";
6
6
  const MF_CORE_SHARED_DEPS = buildMfCoreSharedDependencies({ ownVersion: PLUGIN_VERSION });
7
7
 
8
8
  //#endregion
@@ -10,9 +10,10 @@ let _tanstack_react_router = require("@tanstack/react-router");
10
10
  * Host-side route-graph construction (ADR 0008 §1): manifests + route
11
11
  * configs in → host-built tree out. The host constructs ITS OWN Route
12
12
  * objects from validated manifest data via public `createRoute` APIs; no
13
- * foreign route object is ever mutated. Gates are attached HOST-side from
14
- * the mount registry — plugins cannot ship a route that escapes its
15
- * mount's gate because plugins never construct route objects.
13
+ * foreign route object is ever mutated. Mount guards are ordinary
14
+ * beforeLoads attached HOST-side from ConstructInput.guards — plugins
15
+ * cannot ship a route that escapes its mount's guard because plugins never
16
+ * construct route objects.
16
17
  *
17
18
  * Mounts are the ONLY cross-source parenting points: a root-level
18
19
  * pathless layout file (`_public.tsx`) declares the mount for the whole
@@ -31,33 +32,6 @@ let _tanstack_react_router = require("@tanstack/react-router");
31
32
  function toAnyRoute(route) {
32
33
  return route;
33
34
  }
34
- /**
35
- * Gate redirects are absolute: gates attach to root-level mount routes, and
36
- * relatives would silently shift if a mount ever moved deeper in the tree.
37
- * The login surface is plugin-owned, never core-known.
38
- */
39
- const LOGIN_TO = "/login";
40
- const HOME_TO = "/";
41
- /**
42
- * Gate implementations by mount gate kind. Only `session` and `admin` are
43
- * implemented (ADR 0008 §3); unimplemented mounts are rejected during mount
44
- * declaration before any gate lookup, and gates are optional by type — a
45
- * mount without an entry (or `none`) renders ungated.
46
- */
47
- const GATES = {
48
- session: ({ context, location }) => {
49
- if (!userOf(context)) throw (0, _tanstack_react_router.redirect)({
50
- to: LOGIN_TO,
51
- search: { redirect: location.pathname + location.searchStr }
52
- });
53
- },
54
- admin: ({ context }) => {
55
- const user = userOf(context);
56
- if (!user) throw (0, _tanstack_react_router.redirect)({ to: LOGIN_TO });
57
- if (user.role !== "admin") throw (0, _tanstack_react_router.redirect)({ to: HOME_TO });
58
- }
59
- };
60
- const userOf = (context) => context?.user ?? context?.session?.user;
61
35
  function joinPath(a, b) {
62
36
  const left = a && a !== "/" ? a.replace(/\/+$/, "") : "";
63
37
  const right = b && b !== "/" ? b.replace(/^\/+/, "") : "";
@@ -70,14 +44,14 @@ const navOf = (options) => {
70
44
  if (nav && typeof nav === "object" && typeof nav.label === "string") return nav;
71
45
  };
72
46
  /** Layout routes (mount or pathless) pass their authored options through,
73
- * like every other route kind. On mount routes the registry gate composes
47
+ * like every other route kind. On mount routes the mount's guard composes
74
48
  * BEFORE the declaration's own beforeLoad so a source can never escape its
75
- * mount's gate (ADR 0008 §3), while the declaration's return value still
49
+ * mount's guard (ADR 0008 §3), while the declaration's return value still
76
50
  * flows to children as route context. */
77
- function layoutBeforeLoad(gate, declared) {
78
- if (!gate) return declared;
79
- return (args) => {
80
- gate(args);
51
+ function layoutBeforeLoad(guard, declared) {
52
+ if (!guard) return declared;
53
+ return async (args) => {
54
+ await guard(args);
81
55
  return declared?.(args);
82
56
  };
83
57
  }
@@ -161,12 +135,13 @@ async function constructTree(input) {
161
135
  const declaration = declarations.get(mountId);
162
136
  if (!declaration) continue;
163
137
  const def = require_mount_registry.MOUNT_REGISTRY[mountId];
164
- const gate = GATES[def.gate];
138
+ const guard = input.guards?.[mountId];
139
+ if (def.guarded && !guard) throw new Error(`mount "${mountId}" requires a guard — add one to ConstructInput.guards`);
165
140
  const options = declaration.options;
166
141
  const route = (0, _tanstack_react_router.createRoute)({
167
142
  id: `__mount_${mountId}`,
168
143
  getParentRoute: () => rootRoute,
169
- ...gate || options.beforeLoad ? { beforeLoad: layoutBeforeLoad(gate, options.beforeLoad) } : {},
144
+ ...guard || options.beforeLoad ? { beforeLoad: layoutBeforeLoad(guard, options.beforeLoad) } : {},
170
145
  ...authoredOptions(options),
171
146
  component: options.component ?? _tanstack_react_router.Outlet
172
147
  });
@@ -1 +1 @@
1
- {"version":3,"file":"construct.cjs","names":["redirect","ROUTE_OPTION_KEYS","MOUNT_REGISTRY","createRootRoute","Outlet","createRoute","resolveMountSegment","compareNavItems","digestOf"],"sources":["../../../src/ui/manifest/construct.ts"],"sourcesContent":["import type { AnyRoute } from \"@tanstack/react-router\";\nimport { createRootRoute, createRoute, Outlet, redirect } from \"@tanstack/react-router\";\nimport { CORE_UI_PLUGIN_KEY } from \"./contract\";\nimport { digestOf } from \"./descriptor\";\nimport type { PluginManifest, RouteRecord } from \"./manifest-schema\";\nimport { MOUNT_REGISTRY, type MountDef, type MountId, resolveMountSegment } from \"./mount-registry\";\nimport { compareNavItems, type NavDeclaration, type NavItem, type NavManifest } from \"./nav\";\nimport { ROUTE_OPTION_KEYS, type RouteConfigModule, type RouteOptionsBundle } from \"./route-config\";\n\n/**\n * Host-side route-graph construction (ADR 0008 §1): manifests + route\n * configs in → host-built tree out. The host constructs ITS OWN Route\n * objects from validated manifest data via public `createRoute` APIs; no\n * foreign route object is ever mutated. Gates are attached HOST-side from\n * the mount registry — plugins cannot ship a route that escapes its\n * mount's gate because plugins never construct route objects.\n *\n * Mounts are the ONLY cross-source parenting points: a root-level\n * pathless layout file (`_public.tsx`) declares the mount for the whole\n * composition (exactly one declaring source per mount); every other\n * source's routes live under the same `_mount/` directory prefix and\n * parent onto the shared mount route. This module executes inside the\n * core ui's module graph (production MF expose `./compose`, dev source\n * import) so constructed routes are minted by the same react/router\n * instance that renders them.\n */\n\n/**\n * TanStack's Route generics are intentionally invariant — routes built from\n * manifest data can't satisfy them structurally. One named boundary for\n * handing a constructed route to the tree-building APIs.\n */\nfunction toAnyRoute(route: unknown): AnyRoute {\n return route as AnyRoute;\n}\n\nexport interface GateUser {\n id: string;\n name?: string;\n /** Better Auth user role — \"admin\" gates the admin mount. */\n role?: string;\n}\n\nexport interface HostContext {\n user?: GateUser;\n session?: { user?: GateUser };\n}\n\ntype GateFn = (args: {\n context: HostContext;\n location: { pathname: string; searchStr: string };\n}) => void;\n\n/**\n * Gate redirects are absolute: gates attach to root-level mount routes, and\n * relatives would silently shift if a mount ever moved deeper in the tree.\n * The login surface is plugin-owned, never core-known.\n */\nconst LOGIN_TO: string = \"/login\";\nconst HOME_TO: string = \"/\";\n\n/**\n * Gate implementations by mount gate kind. Only `session` and `admin` are\n * implemented (ADR 0008 §3); unimplemented mounts are rejected during mount\n * declaration before any gate lookup, and gates are optional by type — a\n * mount without an entry (or `none`) renders ungated.\n */\nconst GATES: Partial<Record<MountDef[\"gate\"], GateFn>> = {\n session: ({ context, location }) => {\n const user = userOf(context);\n if (!user) {\n throw redirect({\n to: LOGIN_TO,\n search: { redirect: location.pathname + location.searchStr } as never,\n });\n }\n },\n admin: ({ context }) => {\n const user = userOf(context);\n if (!user) throw redirect({ to: LOGIN_TO });\n if (user.role !== \"admin\") throw redirect({ to: HOME_TO });\n },\n};\n\nconst userOf = (context: HostContext | undefined): GateUser | undefined =>\n context?.user ?? context?.session?.user;\n\nexport interface ConstructPluginRef {\n /** composition identity — plugin key; participates in the digest */\n key: string;\n /** deployment identity — the MF container name loadRemote targets */\n mfName: string;\n}\n\nexport interface ResolvedPlugin {\n key: string;\n manifest: PluginManifest;\n routeConfig: RouteConfigModule;\n}\n\nexport interface ConstructInput {\n name: string;\n plugins: ReadonlyArray<ConstructPluginRef>;\n resolve: (ref: ConstructPluginRef) => Promise<ResolvedPlugin>;\n /** core ui `__root` options — component/error/notFound + head baseline */\n rootOptions?: RouteOptionsBundle;\n}\n\nexport interface ConstructedTree {\n rootRoute: AnyRoute;\n routeTree: AnyRoute;\n digest: string;\n manifests: PluginManifest[];\n nav: NavManifest;\n /** constructed route count per mount id */\n mountCounts: Record<string, number>;\n}\n\ninterface MountDeclaration {\n key: string;\n record: RouteRecord;\n options: RouteOptionsBundle;\n}\n\nfunction joinPath(a: string | undefined, b: string | undefined): string {\n const left = a && a !== \"/\" ? a.replace(/\\/+$/, \"\") : \"\";\n const right = b && b !== \"/\" ? b.replace(/^\\/+/, \"\") : \"\";\n if (!left) return right ? `/${right}` : \"/\";\n if (!right) return left;\n return `${left}/${right}`;\n}\n\nconst navOf = (options: RouteOptionsBundle): NavDeclaration | undefined => {\n const nav = options.staticData?.nav;\n if (nav && typeof nav === \"object\" && typeof (nav as NavDeclaration).label === \"string\") {\n return nav as NavDeclaration;\n }\n return undefined;\n};\n\n/** Layout routes (mount or pathless) pass their authored options through,\n * like every other route kind. On mount routes the registry gate composes\n * BEFORE the declaration's own beforeLoad so a source can never escape its\n * mount's gate (ADR 0008 §3), while the declaration's return value still\n * flows to children as route context. */\nfunction layoutBeforeLoad(\n gate: GateFn | undefined,\n declared: RouteOptionsBundle[\"beforeLoad\"],\n): RouteOptionsBundle[\"beforeLoad\"] {\n if (!gate) return declared;\n return (args) => {\n gate(args);\n return declared?.(args);\n };\n}\n\nconst AUTHORED_OPTION_KEYS = ROUTE_OPTION_KEYS.filter(\n (key) => key !== \"beforeLoad\" && key !== \"component\",\n);\n\nfunction authoredOptions(options: RouteOptionsBundle): Partial<RouteOptionsBundle> {\n const authored: Partial<Record<keyof RouteOptionsBundle, unknown>> = {};\n for (const key of AUTHORED_OPTION_KEYS) {\n if (options[key] !== undefined) authored[key] = options[key];\n }\n return authored as Partial<RouteOptionsBundle>;\n}\n\nfunction rootAuthoredOptions(options: RouteOptionsBundle): Partial<RouteOptionsBundle> {\n const { params: _params, ...authored } = authoredOptions(options);\n return authored;\n}\n\nexport async function constructTree(input: ConstructInput): Promise<ConstructedTree> {\n const refs = [...input.plugins].sort((a, b) => a.key.localeCompare(b.key));\n const resolved: ResolvedPlugin[] = [];\n for (const ref of refs) {\n resolved.push(await input.resolve(ref));\n }\n\n const ordered = [\n ...resolved.filter((plugin) => plugin.key === CORE_UI_PLUGIN_KEY),\n ...resolved.filter((plugin) => plugin.key !== CORE_UI_PLUGIN_KEY),\n ];\n\n const optionsByPlugin = new Map<string, Map<string, RouteOptionsBundle>>();\n const skippedByPlugin = new Map<string, Set<string>>();\n for (const plugin of resolved) {\n // A plugin with no manifest at all contributes no routes — skip it rather\n // than crashing SSR composition (same contract as the missing-loader skip\n // below).\n if (!plugin.manifest?.routes) continue;\n const optionsById = new Map<string, RouteOptionsBundle>();\n const skipped = new Set<string>();\n await Promise.all(\n plugin.manifest.routes.map(async (record) => {\n const loader = plugin.routeConfig.routeConfigLoaders[record.id];\n if (!loader) {\n console.log(\n `[Compose] skipping route \"${record.id}\" in \"${plugin.key}\" — no routeConfig loader`,\n );\n skipped.add(record.id);\n return;\n }\n optionsById.set(record.id, await loader());\n }),\n );\n // cascade: any route whose parent is skipped is also skipped\n let changed = true;\n while (changed) {\n changed = false;\n for (const record of plugin.manifest.routes) {\n if (skipped.has(record.id)) continue;\n if (record.parentId && skipped.has(record.parentId)) {\n skipped.add(record.id);\n changed = true;\n }\n }\n }\n optionsByPlugin.set(plugin.key, optionsById);\n skippedByPlugin.set(plugin.key, skipped);\n }\n\n const declarations = new Map<MountId, MountDeclaration>();\n const mountByLayoutId = new Map<string, MountId>();\n for (const plugin of ordered) {\n if (!plugin.manifest?.routes) continue;\n for (const record of plugin.manifest.routes) {\n if (!record.mount) continue;\n const mountId = record.mount as MountId;\n const def = MOUNT_REGISTRY[mountId];\n if (!def.implemented) {\n throw new Error(\n `mount \"${record.mount}\" is declared vocabulary but unimplemented (ADR 0008 §3) — declared by \"${plugin.key}\"`,\n );\n }\n const existing = declarations.get(mountId);\n if (existing) {\n if (existing.key === CORE_UI_PLUGIN_KEY && plugin.key !== CORE_UI_PLUGIN_KEY) {\n console.log(\n `[Compose] mount declaration \"${existing.key}:${existing.record.id}\" (${mountId}) shadows \"${plugin.key}:${record.id}\" — core ui wins; shadowed declaration skipped`,\n );\n mountByLayoutId.set(record.id, mountId);\n continue;\n }\n throw new Error(\n `mount \"${mountId}\" declared by multiple sources: \"${existing.key}\" (${existing.record.file}) and \"${plugin.key}\" (${record.file})`,\n );\n }\n if (skippedByPlugin.get(plugin.key)!.has(record.id)) continue;\n declarations.set(mountId, {\n key: plugin.key,\n record,\n options: optionsByPlugin.get(plugin.key)!.get(record.id)!,\n });\n mountByLayoutId.set(record.id, mountId);\n }\n }\n\n const rootRoute = toAnyRoute(\n createRootRoute({\n ...(input.rootOptions ? rootAuthoredOptions(input.rootOptions) : {}),\n component: input.rootOptions?.component ?? Outlet,\n ...(input.rootOptions?.beforeLoad ? { beforeLoad: input.rootOptions.beforeLoad } : {}),\n }),\n );\n\n const mountRoutes = new Map<MountId, AnyRoute>();\n for (const mountId of Object.keys(MOUNT_REGISTRY) as MountId[]) {\n const declaration = declarations.get(mountId);\n if (!declaration) continue;\n const def = MOUNT_REGISTRY[mountId]!;\n const gate = GATES[def.gate];\n const options = declaration.options;\n const route = createRoute({\n id: `__mount_${mountId}`,\n getParentRoute: () => rootRoute,\n ...(gate || options.beforeLoad\n ? { beforeLoad: layoutBeforeLoad(gate, options.beforeLoad) }\n : {}),\n ...authoredOptions(options),\n component: options.component ?? Outlet,\n });\n mountRoutes.set(mountId, toAnyRoute(route));\n }\n\n const nav: NavItem[] = [];\n const mountCounts: Record<string, number> = {};\n const childrenByParent = new Map<AnyRoute, AnyRoute[]>();\n /** cross-plugin path-collision guard: claimed paths per parent route */\n const claimedPathsByParent = new Map<AnyRoute, Map<string, string>>();\n const attach = (parent: AnyRoute, child: AnyRoute) => {\n const list = childrenByParent.get(parent) ?? [];\n list.push(child);\n childrenByParent.set(parent, list);\n };\n\n for (const plugin of ordered) {\n if (!plugin.manifest?.routes) continue;\n const optionsById = optionsByPlugin.get(plugin.key)!;\n const fullPathById = new Map<string, string>();\n const mountById = new Map<string, MountId>();\n const byId = new Map<string, { record: RouteRecord; route: AnyRoute }>();\n\n const parentFor = (\n record: RouteRecord,\n ): { route: AnyRoute; fullPath: string; mount: MountId } => {\n if (record.parentId) {\n const local = byId.get(record.parentId);\n if (local) {\n return {\n route: local.route,\n fullPath: fullPathById.get(record.parentId)!,\n mount: mountById.get(record.parentId)!,\n };\n }\n const mount = mountByLayoutId.get(record.parentId);\n if (mount) return { route: mountRoutes.get(mount)!, fullPath: \"\", mount };\n throw new Error(\n `unresolvable parent \"${record.parentId}\" for \"${record.id}\" in \"${plugin.key}\" — mounts are the only cross-source parenting points`,\n );\n }\n const firstSegment = record.id.split(\"/\")[0] ?? \"\";\n if (firstSegment.startsWith(\"_\")) {\n const mount = resolveMountSegment(firstSegment.slice(1));\n if (mount && mountRoutes.has(mount))\n return { route: mountRoutes.get(mount)!, fullPath: \"\", mount };\n if (mount) {\n throw new Error(\n `mount \"${mount}\" is not declared by any source (route \"${record.id}\" in \"${plugin.key}\")`,\n );\n }\n throw new Error(\n `unknown mount \"_${firstSegment.slice(1)}\" (route \"${record.id}\" in \"${plugin.key}\")`,\n );\n }\n throw new Error(`route \"${record.id}\" in \"${plugin.key}\" must live under a mount`);\n };\n\n const pending = plugin.manifest.routes.filter(\n (record) => !record.mount && !skippedByPlugin.get(plugin.key)!.has(record.id),\n );\n const shadowedIds = new Set<string>();\n let progressed = true;\n while (pending.length > 0 && progressed) {\n progressed = false;\n for (let i = 0; i < pending.length; i += 1) {\n const record = pending[i]!;\n const parentId = record.parentId;\n if (parentId) {\n if (shadowedIds.has(parentId)) {\n shadowedIds.add(record.id);\n pending.splice(i, 1);\n i -= 1;\n progressed = true;\n continue;\n }\n if (!byId.has(parentId) && !mountByLayoutId.has(parentId)) continue;\n }\n pending.splice(i, 1);\n progressed = true;\n\n const options = optionsById.get(record.id)!;\n const parent = parentFor(record);\n const routePath = record.path;\n const isLayoutRoute = record.type === \"layout\" || routePath === undefined;\n if (!isLayoutRoute) {\n const siblings = claimedPathsByParent.get(parent.route) ?? new Map<string, string>();\n const claimant = siblings.get(routePath);\n if (claimant) {\n if (\n plugin.key !== CORE_UI_PLUGIN_KEY &&\n claimant.startsWith(`${CORE_UI_PLUGIN_KEY}:`)\n ) {\n console.log(\n `[Compose] route claim \"${claimant}\" (${routePath}) shadows \"${plugin.key}:${record.id}\" — core ui wins; shadowed route skipped`,\n );\n shadowedIds.add(record.id);\n break;\n }\n throw new Error(\n `path collision: \"${plugin.key}\" route \"${record.id}\" declares \"${routePath}\" which is already claimed by \"${claimant}\" under the same parent`,\n );\n }\n siblings.set(routePath, `${plugin.key}:${record.id}`);\n claimedPathsByParent.set(parent.route, siblings);\n }\n const fullPath = joinPath(parent.fullPath, routePath);\n let route: AnyRoute;\n if (isLayoutRoute) {\n route = createRoute({\n id: `${plugin.key}__${record.id}`,\n getParentRoute: () => parent.route,\n ...authoredOptions(options),\n ...(options.beforeLoad ? { beforeLoad: options.beforeLoad } : {}),\n component: options.component ?? Outlet,\n });\n } else {\n route = createRoute({\n path: routePath,\n getParentRoute: () => parent.route,\n ...authoredOptions(options),\n ...(options.beforeLoad ? { beforeLoad: options.beforeLoad } : {}),\n component: options.component ?? Outlet,\n });\n }\n\n byId.set(record.id, { record, route: toAnyRoute(route) });\n fullPathById.set(record.id, fullPath);\n mountById.set(record.id, parent.mount);\n attach(parent.route, toAnyRoute(route));\n mountCounts[parent.mount] = (mountCounts[parent.mount] ?? 0) + 1;\n\n const navDeclaration = navOf(options);\n if (navDeclaration && navDeclaration.hidden !== true) {\n nav.push({\n id: `${plugin.key}:${record.id}`,\n label: navDeclaration.label,\n ...(typeof navDeclaration.icon === \"string\" ? { icon: navDeclaration.icon } : {}),\n ...(typeof navDeclaration.group === \"string\" ? { group: navDeclaration.group } : {}),\n ...(typeof navDeclaration.order === \"number\" ? { order: navDeclaration.order } : {}),\n to: navDeclaration.to ?? fullPath,\n plugin: plugin.key,\n mount: parent.mount,\n });\n }\n break;\n }\n }\n if (pending.length > 0) {\n throw new Error(\n `unresolvable parentage in \"${plugin.key}\": ${pending.map((record) => record.id).join(\", \")}`,\n );\n }\n }\n\n for (const [parent, children] of childrenByParent) {\n (parent as { addChildren: (children: AnyRoute[]) => void }).addChildren(children);\n }\n rootRoute.addChildren([...mountRoutes.values()] as AnyRoute[]);\n nav.sort(compareNavItems);\n\n const digest = await digestOf({\n plugins: refs.map((ref) => ({ key: ref.key, mfName: ref.mfName })),\n manifests: resolved.map((plugin) => plugin.manifest),\n });\n\n return {\n rootRoute,\n routeTree: rootRoute,\n digest,\n manifests: resolved.map((plugin) => plugin.manifest),\n nav: { items: nav },\n mountCounts,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,WAAW,OAA0B;CAC5C,OAAO;AACT;;;;;;AAwBA,MAAM,WAAmB;AACzB,MAAM,UAAkB;;;;;;;AAQxB,MAAM,QAAmD;CACvD,UAAU,EAAE,SAAS,eAAe;EAElC,IAAI,CADS,OAAO,OACZ,GACN,UAAMA,iCAAS;GACb,IAAI;GACJ,QAAQ,EAAE,UAAU,SAAS,WAAW,SAAS,UAAU;EAC7D,CAAC;CAEL;CACA,QAAQ,EAAE,cAAc;EACtB,MAAM,OAAO,OAAO,OAAO;EAC3B,IAAI,CAAC,MAAM,UAAMA,iCAAS,EAAE,IAAI,SAAS,CAAC;EAC1C,IAAI,KAAK,SAAS,SAAS,UAAMA,iCAAS,EAAE,IAAI,QAAQ,CAAC;CAC3D;AACF;AAEA,MAAM,UAAU,YACd,SAAS,QAAQ,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K,IAAI,CAAC;KAC/E,GAAI,OAAO,eAAe,UAAU,WAAW,EAAE,OAAO,eAAe,MAAM,IAAI,CAAC;KAClF,GAAI,OAAO,eAAe,UAAU,WAAW,EAAE,OAAO,eAAe,MAAM,IAAI,CAAC;KAClF,IAAI,eAAe,MAAM;KACzB,QAAQ,OAAO;KACf,OAAO,OAAO;IAChB,CAAC;IAEH;GACF;EACF;EACA,IAAI,QAAQ,SAAS,GACnB,MAAM,IAAI,MACR,8BAA8B,OAAO,IAAI,KAAK,QAAQ,KAAK,WAAW,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,GAC5F;CAEJ;CAEA,KAAK,MAAM,CAAC,QAAQ,aAAa,kBAC/B,AAAC,OAA2D,YAAY,QAAQ;CAElF,UAAU,YAAY,CAAC,GAAG,YAAY,OAAO,CAAC,CAAe;CAC7D,IAAI,KAAKG,2BAAe;CAOxB,OAAO;EACL;EACA,WAAW;EACX,cARmBC,4BAAS;GAC5B,SAAS,KAAK,KAAK,SAAS;IAAE,KAAK,IAAI;IAAK,QAAQ,IAAI;GAAO,EAAE;GACjE,WAAW,SAAS,KAAK,WAAW,OAAO,QAAQ;EACrD,CAAC;EAMC,WAAW,SAAS,KAAK,WAAW,OAAO,QAAQ;EACnD,KAAK,EAAE,OAAO,IAAI;EAClB;CACF;AACF"}
1
+ {"version":3,"file":"construct.cjs","names":["ROUTE_OPTION_KEYS","MOUNT_REGISTRY","createRootRoute","Outlet","createRoute","resolveMountSegment","compareNavItems","digestOf"],"sources":["../../../src/ui/manifest/construct.ts"],"sourcesContent":["import type { AnyRoute } from \"@tanstack/react-router\";\nimport { createRootRoute, createRoute, Outlet } from \"@tanstack/react-router\";\nimport { CORE_UI_PLUGIN_KEY } from \"./contract\";\nimport { digestOf } from \"./descriptor\";\nimport type { PluginManifest, RouteRecord } from \"./manifest-schema\";\nimport { MOUNT_REGISTRY, type MountId, resolveMountSegment } from \"./mount-registry\";\nimport { compareNavItems, type NavDeclaration, type NavItem, type NavManifest } from \"./nav\";\nimport { ROUTE_OPTION_KEYS, type RouteConfigModule, type RouteOptionsBundle } from \"./route-config\";\n\n/**\n * Host-side route-graph construction (ADR 0008 §1): manifests + route\n * configs in → host-built tree out. The host constructs ITS OWN Route\n * objects from validated manifest data via public `createRoute` APIs; no\n * foreign route object is ever mutated. Mount guards are ordinary\n * beforeLoads attached HOST-side from ConstructInput.guards — plugins\n * cannot ship a route that escapes its mount's guard because plugins never\n * construct route objects.\n *\n * Mounts are the ONLY cross-source parenting points: a root-level\n * pathless layout file (`_public.tsx`) declares the mount for the whole\n * composition (exactly one declaring source per mount); every other\n * source's routes live under the same `_mount/` directory prefix and\n * parent onto the shared mount route. This module executes inside the\n * core ui's module graph (production MF expose `./compose`, dev source\n * import) so constructed routes are minted by the same react/router\n * instance that renders them.\n */\n\n/**\n * TanStack's Route generics are intentionally invariant — routes built from\n * manifest data can't satisfy them structurally. One named boundary for\n * handing a constructed route to the tree-building APIs.\n */\nfunction toAnyRoute(route: unknown): AnyRoute {\n return route as AnyRoute;\n}\n\nexport interface ConstructPluginRef {\n /** composition identity — plugin key; participates in the digest */\n key: string;\n /** deployment identity — the MF container name loadRemote targets */\n mfName: string;\n}\n\nexport interface ResolvedPlugin {\n key: string;\n manifest: PluginManifest;\n routeConfig: RouteConfigModule;\n}\n\nexport interface ConstructInput {\n name: string;\n plugins: ReadonlyArray<ConstructPluginRef>;\n resolve: (ref: ConstructPluginRef) => Promise<ResolvedPlugin>;\n /** core ui `__root` options — component/error/notFound + head baseline */\n rootOptions?: RouteOptionsBundle;\n /** Guard per mount id — beforeLoads supplied by the composing framework. */\n guards?: Partial<Record<MountId, RouteOptionsBundle[\"beforeLoad\"]>>;\n}\n\nexport interface ConstructedTree {\n rootRoute: AnyRoute;\n routeTree: AnyRoute;\n digest: string;\n manifests: PluginManifest[];\n nav: NavManifest;\n /** constructed route count per mount id */\n mountCounts: Record<string, number>;\n}\n\ninterface MountDeclaration {\n key: string;\n record: RouteRecord;\n options: RouteOptionsBundle;\n}\n\nfunction joinPath(a: string | undefined, b: string | undefined): string {\n const left = a && a !== \"/\" ? a.replace(/\\/+$/, \"\") : \"\";\n const right = b && b !== \"/\" ? b.replace(/^\\/+/, \"\") : \"\";\n if (!left) return right ? `/${right}` : \"/\";\n if (!right) return left;\n return `${left}/${right}`;\n}\n\nconst navOf = (options: RouteOptionsBundle): NavDeclaration | undefined => {\n const nav = options.staticData?.nav;\n if (nav && typeof nav === \"object\" && typeof (nav as NavDeclaration).label === \"string\") {\n return nav as NavDeclaration;\n }\n return undefined;\n};\n\n/** Layout routes (mount or pathless) pass their authored options through,\n * like every other route kind. On mount routes the mount's guard composes\n * BEFORE the declaration's own beforeLoad so a source can never escape its\n * mount's guard (ADR 0008 §3), while the declaration's return value still\n * flows to children as route context. */\nfunction layoutBeforeLoad(\n guard: RouteOptionsBundle[\"beforeLoad\"],\n declared: RouteOptionsBundle[\"beforeLoad\"],\n): RouteOptionsBundle[\"beforeLoad\"] {\n if (!guard) return declared;\n return async (args) => {\n await guard(args);\n return declared?.(args);\n };\n}\n\nconst AUTHORED_OPTION_KEYS = ROUTE_OPTION_KEYS.filter(\n (key) => key !== \"beforeLoad\" && key !== \"component\",\n);\n\nfunction authoredOptions(options: RouteOptionsBundle): Partial<RouteOptionsBundle> {\n const authored: Partial<Record<keyof RouteOptionsBundle, unknown>> = {};\n for (const key of AUTHORED_OPTION_KEYS) {\n if (options[key] !== undefined) authored[key] = options[key];\n }\n return authored as Partial<RouteOptionsBundle>;\n}\n\nfunction rootAuthoredOptions(options: RouteOptionsBundle): Partial<RouteOptionsBundle> {\n const { params: _params, ...authored } = authoredOptions(options);\n return authored;\n}\n\nexport async function constructTree(input: ConstructInput): Promise<ConstructedTree> {\n const refs = [...input.plugins].sort((a, b) => a.key.localeCompare(b.key));\n const resolved: ResolvedPlugin[] = [];\n for (const ref of refs) {\n resolved.push(await input.resolve(ref));\n }\n\n const ordered = [\n ...resolved.filter((plugin) => plugin.key === CORE_UI_PLUGIN_KEY),\n ...resolved.filter((plugin) => plugin.key !== CORE_UI_PLUGIN_KEY),\n ];\n\n const optionsByPlugin = new Map<string, Map<string, RouteOptionsBundle>>();\n const skippedByPlugin = new Map<string, Set<string>>();\n for (const plugin of resolved) {\n // A plugin with no manifest at all contributes no routes — skip it rather\n // than crashing SSR composition (same contract as the missing-loader skip\n // below).\n if (!plugin.manifest?.routes) continue;\n const optionsById = new Map<string, RouteOptionsBundle>();\n const skipped = new Set<string>();\n await Promise.all(\n plugin.manifest.routes.map(async (record) => {\n const loader = plugin.routeConfig.routeConfigLoaders[record.id];\n if (!loader) {\n console.log(\n `[Compose] skipping route \"${record.id}\" in \"${plugin.key}\" — no routeConfig loader`,\n );\n skipped.add(record.id);\n return;\n }\n optionsById.set(record.id, await loader());\n }),\n );\n // cascade: any route whose parent is skipped is also skipped\n let changed = true;\n while (changed) {\n changed = false;\n for (const record of plugin.manifest.routes) {\n if (skipped.has(record.id)) continue;\n if (record.parentId && skipped.has(record.parentId)) {\n skipped.add(record.id);\n changed = true;\n }\n }\n }\n optionsByPlugin.set(plugin.key, optionsById);\n skippedByPlugin.set(plugin.key, skipped);\n }\n\n const declarations = new Map<MountId, MountDeclaration>();\n const mountByLayoutId = new Map<string, MountId>();\n for (const plugin of ordered) {\n if (!plugin.manifest?.routes) continue;\n for (const record of plugin.manifest.routes) {\n if (!record.mount) continue;\n const mountId = record.mount as MountId;\n const def = MOUNT_REGISTRY[mountId];\n if (!def.implemented) {\n throw new Error(\n `mount \"${record.mount}\" is declared vocabulary but unimplemented (ADR 0008 §3) — declared by \"${plugin.key}\"`,\n );\n }\n const existing = declarations.get(mountId);\n if (existing) {\n if (existing.key === CORE_UI_PLUGIN_KEY && plugin.key !== CORE_UI_PLUGIN_KEY) {\n console.log(\n `[Compose] mount declaration \"${existing.key}:${existing.record.id}\" (${mountId}) shadows \"${plugin.key}:${record.id}\" — core ui wins; shadowed declaration skipped`,\n );\n mountByLayoutId.set(record.id, mountId);\n continue;\n }\n throw new Error(\n `mount \"${mountId}\" declared by multiple sources: \"${existing.key}\" (${existing.record.file}) and \"${plugin.key}\" (${record.file})`,\n );\n }\n if (skippedByPlugin.get(plugin.key)!.has(record.id)) continue;\n declarations.set(mountId, {\n key: plugin.key,\n record,\n options: optionsByPlugin.get(plugin.key)!.get(record.id)!,\n });\n mountByLayoutId.set(record.id, mountId);\n }\n }\n\n const rootRoute = toAnyRoute(\n createRootRoute({\n ...(input.rootOptions ? rootAuthoredOptions(input.rootOptions) : {}),\n component: input.rootOptions?.component ?? Outlet,\n ...(input.rootOptions?.beforeLoad ? { beforeLoad: input.rootOptions.beforeLoad } : {}),\n }),\n );\n\n const mountRoutes = new Map<MountId, AnyRoute>();\n for (const mountId of Object.keys(MOUNT_REGISTRY) as MountId[]) {\n const declaration = declarations.get(mountId);\n if (!declaration) continue;\n const def = MOUNT_REGISTRY[mountId]!;\n const guard = input.guards?.[mountId];\n if (def.guarded && !guard) {\n throw new Error(`mount \"${mountId}\" requires a guard — add one to ConstructInput.guards`);\n }\n const options = declaration.options;\n const route = createRoute({\n id: `__mount_${mountId}`,\n getParentRoute: () => rootRoute,\n ...(guard || options.beforeLoad\n ? { beforeLoad: layoutBeforeLoad(guard, options.beforeLoad) }\n : {}),\n ...authoredOptions(options),\n component: options.component ?? Outlet,\n });\n mountRoutes.set(mountId, toAnyRoute(route));\n }\n\n const nav: NavItem[] = [];\n const mountCounts: Record<string, number> = {};\n const childrenByParent = new Map<AnyRoute, AnyRoute[]>();\n /** cross-plugin path-collision guard: claimed paths per parent route */\n const claimedPathsByParent = new Map<AnyRoute, Map<string, string>>();\n const attach = (parent: AnyRoute, child: AnyRoute) => {\n const list = childrenByParent.get(parent) ?? [];\n list.push(child);\n childrenByParent.set(parent, list);\n };\n\n for (const plugin of ordered) {\n if (!plugin.manifest?.routes) continue;\n const optionsById = optionsByPlugin.get(plugin.key)!;\n const fullPathById = new Map<string, string>();\n const mountById = new Map<string, MountId>();\n const byId = new Map<string, { record: RouteRecord; route: AnyRoute }>();\n\n const parentFor = (\n record: RouteRecord,\n ): { route: AnyRoute; fullPath: string; mount: MountId } => {\n if (record.parentId) {\n const local = byId.get(record.parentId);\n if (local) {\n return {\n route: local.route,\n fullPath: fullPathById.get(record.parentId)!,\n mount: mountById.get(record.parentId)!,\n };\n }\n const mount = mountByLayoutId.get(record.parentId);\n if (mount) return { route: mountRoutes.get(mount)!, fullPath: \"\", mount };\n throw new Error(\n `unresolvable parent \"${record.parentId}\" for \"${record.id}\" in \"${plugin.key}\" — mounts are the only cross-source parenting points`,\n );\n }\n const firstSegment = record.id.split(\"/\")[0] ?? \"\";\n if (firstSegment.startsWith(\"_\")) {\n const mount = resolveMountSegment(firstSegment.slice(1));\n if (mount && mountRoutes.has(mount))\n return { route: mountRoutes.get(mount)!, fullPath: \"\", mount };\n if (mount) {\n throw new Error(\n `mount \"${mount}\" is not declared by any source (route \"${record.id}\" in \"${plugin.key}\")`,\n );\n }\n throw new Error(\n `unknown mount \"_${firstSegment.slice(1)}\" (route \"${record.id}\" in \"${plugin.key}\")`,\n );\n }\n throw new Error(`route \"${record.id}\" in \"${plugin.key}\" must live under a mount`);\n };\n\n const pending = plugin.manifest.routes.filter(\n (record) => !record.mount && !skippedByPlugin.get(plugin.key)!.has(record.id),\n );\n const shadowedIds = new Set<string>();\n let progressed = true;\n while (pending.length > 0 && progressed) {\n progressed = false;\n for (let i = 0; i < pending.length; i += 1) {\n const record = pending[i]!;\n const parentId = record.parentId;\n if (parentId) {\n if (shadowedIds.has(parentId)) {\n shadowedIds.add(record.id);\n pending.splice(i, 1);\n i -= 1;\n progressed = true;\n continue;\n }\n if (!byId.has(parentId) && !mountByLayoutId.has(parentId)) continue;\n }\n pending.splice(i, 1);\n progressed = true;\n\n const options = optionsById.get(record.id)!;\n const parent = parentFor(record);\n const routePath = record.path;\n const isLayoutRoute = record.type === \"layout\" || routePath === undefined;\n if (!isLayoutRoute) {\n const siblings = claimedPathsByParent.get(parent.route) ?? new Map<string, string>();\n const claimant = siblings.get(routePath);\n if (claimant) {\n if (\n plugin.key !== CORE_UI_PLUGIN_KEY &&\n claimant.startsWith(`${CORE_UI_PLUGIN_KEY}:`)\n ) {\n console.log(\n `[Compose] route claim \"${claimant}\" (${routePath}) shadows \"${plugin.key}:${record.id}\" — core ui wins; shadowed route skipped`,\n );\n shadowedIds.add(record.id);\n break;\n }\n throw new Error(\n `path collision: \"${plugin.key}\" route \"${record.id}\" declares \"${routePath}\" which is already claimed by \"${claimant}\" under the same parent`,\n );\n }\n siblings.set(routePath, `${plugin.key}:${record.id}`);\n claimedPathsByParent.set(parent.route, siblings);\n }\n const fullPath = joinPath(parent.fullPath, routePath);\n let route: AnyRoute;\n if (isLayoutRoute) {\n route = createRoute({\n id: `${plugin.key}__${record.id}`,\n getParentRoute: () => parent.route,\n ...authoredOptions(options),\n ...(options.beforeLoad ? { beforeLoad: options.beforeLoad } : {}),\n component: options.component ?? Outlet,\n });\n } else {\n route = createRoute({\n path: routePath,\n getParentRoute: () => parent.route,\n ...authoredOptions(options),\n ...(options.beforeLoad ? { beforeLoad: options.beforeLoad } : {}),\n component: options.component ?? Outlet,\n });\n }\n\n byId.set(record.id, { record, route: toAnyRoute(route) });\n fullPathById.set(record.id, fullPath);\n mountById.set(record.id, parent.mount);\n attach(parent.route, toAnyRoute(route));\n mountCounts[parent.mount] = (mountCounts[parent.mount] ?? 0) + 1;\n\n const navDeclaration = navOf(options);\n if (navDeclaration && navDeclaration.hidden !== true) {\n nav.push({\n id: `${plugin.key}:${record.id}`,\n label: navDeclaration.label,\n ...(typeof navDeclaration.icon === \"string\" ? { icon: navDeclaration.icon } : {}),\n ...(typeof navDeclaration.group === \"string\" ? { group: navDeclaration.group } : {}),\n ...(typeof navDeclaration.order === \"number\" ? { order: navDeclaration.order } : {}),\n to: navDeclaration.to ?? fullPath,\n plugin: plugin.key,\n mount: parent.mount,\n });\n }\n break;\n }\n }\n if (pending.length > 0) {\n throw new Error(\n `unresolvable parentage in \"${plugin.key}\": ${pending.map((record) => record.id).join(\", \")}`,\n );\n }\n }\n\n for (const [parent, children] of childrenByParent) {\n (parent as { addChildren: (children: AnyRoute[]) => void }).addChildren(children);\n }\n rootRoute.addChildren([...mountRoutes.values()] as AnyRoute[]);\n nav.sort(compareNavItems);\n\n const digest = await digestOf({\n plugins: refs.map((ref) => ({ key: ref.key, mfName: ref.mfName })),\n manifests: resolved.map((plugin) => plugin.manifest),\n });\n\n return {\n rootRoute,\n routeTree: rootRoute,\n digest,\n manifests: resolved.map((plugin) => plugin.manifest),\n nav: { items: nav },\n mountCounts,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAS,WAAW,OAA0B;CAC5C,OAAO;AACT;AAyCA,SAAS,SAAS,GAAuB,GAA+B;CACtE,MAAM,OAAO,KAAK,MAAM,MAAM,EAAE,QAAQ,QAAQ,EAAE,IAAI;CACtD,MAAM,QAAQ,KAAK,MAAM,MAAM,EAAE,QAAQ,QAAQ,EAAE,IAAI;CACvD,IAAI,CAAC,MAAM,OAAO,QAAQ,IAAI,UAAU;CACxC,IAAI,CAAC,OAAO,OAAO;CACnB,OAAO,GAAG,KAAK,GAAG;AACpB;AAEA,MAAM,SAAS,YAA4D;CACzE,MAAM,MAAM,QAAQ,YAAY;CAChC,IAAI,OAAO,OAAO,QAAQ,YAAY,OAAQ,IAAuB,UAAU,UAC7E,OAAO;AAGX;;;;;;AAOA,SAAS,iBACP,OACA,UACkC;CAClC,IAAI,CAAC,OAAO,OAAO;CACnB,OAAO,OAAO,SAAS;EACrB,MAAM,MAAM,IAAI;EAChB,OAAO,WAAW,IAAI;CACxB;AACF;AAEA,MAAM,uBAAuBA,uCAAkB,QAC5C,QAAQ,QAAQ,gBAAgB,QAAQ,WAC3C;AAEA,SAAS,gBAAgB,SAA0D;CACjF,MAAM,WAA+D,CAAC;CACtE,KAAK,MAAM,OAAO,sBAChB,IAAI,QAAQ,SAAS,QAAW,SAAS,OAAO,QA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AS,KAAK,WAAW,OAAO,QAAQ;EACrD,CAAC;EAMC,WAAW,SAAS,KAAK,WAAW,OAAO,QAAQ;EACnD,KAAK,EAAE,OAAO,IAAI;EAClB;CACF;AACF"}
@@ -1,20 +1,9 @@
1
1
  import { PluginManifest } from "./manifest-schema.cjs";
2
+ import { MountId } from "./mount-registry.cjs";
2
3
  import { NavManifest } from "./nav.cjs";
3
4
  import { RouteConfigModule, RouteOptionsBundle } from "./route-config.cjs";
4
5
  import { AnyRoute } from "@tanstack/react-router";
5
6
  //#region src/ui/manifest/construct.d.ts
6
- interface GateUser {
7
- id: string;
8
- name?: string;
9
- /** Better Auth user role — "admin" gates the admin mount. */
10
- role?: string;
11
- }
12
- interface HostContext {
13
- user?: GateUser;
14
- session?: {
15
- user?: GateUser;
16
- };
17
- }
18
7
  interface ConstructPluginRef {
19
8
  /** composition identity — plugin key; participates in the digest */
20
9
  key: string;
@@ -32,6 +21,8 @@ interface ConstructInput {
32
21
  resolve: (ref: ConstructPluginRef) => Promise<ResolvedPlugin>;
33
22
  /** core ui `__root` options — component/error/notFound + head baseline */
34
23
  rootOptions?: RouteOptionsBundle;
24
+ /** Guard per mount id — beforeLoads supplied by the composing framework. */
25
+ guards?: Partial<Record<MountId, RouteOptionsBundle["beforeLoad"]>>;
35
26
  }
36
27
  interface ConstructedTree {
37
28
  rootRoute: AnyRoute;
@@ -44,5 +35,5 @@ interface ConstructedTree {
44
35
  }
45
36
  declare function constructTree(input: ConstructInput): Promise<ConstructedTree>;
46
37
  //#endregion
47
- export { ConstructInput, ConstructPluginRef, ConstructedTree, GateUser, HostContext, ResolvedPlugin, constructTree };
38
+ export { ConstructInput, ConstructPluginRef, ConstructedTree, ResolvedPlugin, constructTree };
48
39
  //# sourceMappingURL=construct.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"construct.d.cts","names":[],"sources":["../../../src/ui/manifest/construct.ts"],"mappings":";;;;;UAoCiB;EACf;EACA;;EAEA;;UAGe;EACf,OAAO;EACP;IAAY,OAAO;;;UA0CJ;;EAEf;;EAEA;;UAGe;EACf;EACA,UAAU;EACV,aAAa;;UAGE;EACf;EACA,SAAS,cAAc;EACvB,UAAU,KAAK,uBAAuB,QAAQ;;EAE9C,cAAc;;UAGC;EACf,WAAW;EACX,WAAW;EACX;EACA,WAAW;EACX,KAAK;;EAEL,aAAa;;iBA0DO,cAAc,OAAO,iBAAiB,QAAQ"}
1
+ {"version":3,"file":"construct.d.cts","names":[],"sources":["../../../src/ui/manifest/construct.ts"],"mappings":";;;;;;UAqCiB;;EAEf;;EAEA;;UAGe;EACf;EACA,UAAU;EACV,aAAa;;UAGE;EACf;EACA,SAAS,cAAc;EACvB,UAAU,KAAK,uBAAuB,QAAQ;;EAE9C,cAAc;;EAEd,SAAS,QAAQ,OAAO,SAAS;;UAGlB;EACf,WAAW;EACX,WAAW;EACX;EACA,WAAW;EACX,KAAK;;EAEL,aAAa;;iBA0DO,cAAc,OAAO,iBAAiB,QAAQ"}
@@ -1,20 +1,9 @@
1
1
  import { PluginManifest } from "./manifest-schema.mjs";
2
+ import { MountId } from "./mount-registry.mjs";
2
3
  import { NavManifest } from "./nav.mjs";
3
4
  import { RouteConfigModule, RouteOptionsBundle } from "./route-config.mjs";
4
5
  import { AnyRoute } from "@tanstack/react-router";
5
6
  //#region src/ui/manifest/construct.d.ts
6
- interface GateUser {
7
- id: string;
8
- name?: string;
9
- /** Better Auth user role — "admin" gates the admin mount. */
10
- role?: string;
11
- }
12
- interface HostContext {
13
- user?: GateUser;
14
- session?: {
15
- user?: GateUser;
16
- };
17
- }
18
7
  interface ConstructPluginRef {
19
8
  /** composition identity — plugin key; participates in the digest */
20
9
  key: string;
@@ -32,6 +21,8 @@ interface ConstructInput {
32
21
  resolve: (ref: ConstructPluginRef) => Promise<ResolvedPlugin>;
33
22
  /** core ui `__root` options — component/error/notFound + head baseline */
34
23
  rootOptions?: RouteOptionsBundle;
24
+ /** Guard per mount id — beforeLoads supplied by the composing framework. */
25
+ guards?: Partial<Record<MountId, RouteOptionsBundle["beforeLoad"]>>;
35
26
  }
36
27
  interface ConstructedTree {
37
28
  rootRoute: AnyRoute;
@@ -44,5 +35,5 @@ interface ConstructedTree {
44
35
  }
45
36
  declare function constructTree(input: ConstructInput): Promise<ConstructedTree>;
46
37
  //#endregion
47
- export { ConstructInput, ConstructPluginRef, ConstructedTree, GateUser, HostContext, ResolvedPlugin, constructTree };
38
+ export { ConstructInput, ConstructPluginRef, ConstructedTree, ResolvedPlugin, constructTree };
48
39
  //# sourceMappingURL=construct.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"construct.d.mts","names":[],"sources":["../../../src/ui/manifest/construct.ts"],"mappings":";;;;;UAoCiB;EACf;EACA;;EAEA;;UAGe;EACf,OAAO;EACP;IAAY,OAAO;;;UA0CJ;;EAEf;;EAEA;;UAGe;EACf;EACA,UAAU;EACV,aAAa;;UAGE;EACf;EACA,SAAS,cAAc;EACvB,UAAU,KAAK,uBAAuB,QAAQ;;EAE9C,cAAc;;UAGC;EACf,WAAW;EACX,WAAW;EACX;EACA,WAAW;EACX,KAAK;;EAEL,aAAa;;iBA0DO,cAAc,OAAO,iBAAiB,QAAQ"}
1
+ {"version":3,"file":"construct.d.mts","names":[],"sources":["../../../src/ui/manifest/construct.ts"],"mappings":";;;;;;UAqCiB;;EAEf;;EAEA;;UAGe;EACf;EACA,UAAU;EACV,aAAa;;UAGE;EACf;EACA,SAAS,cAAc;EACvB,UAAU,KAAK,uBAAuB,QAAQ;;EAE9C,cAAc;;EAEd,SAAS,QAAQ,OAAO,SAAS;;UAGlB;EACf,WAAW;EACX,WAAW;EACX;EACA,WAAW;EACX,KAAK;;EAEL,aAAa;;iBA0DO,cAAc,OAAO,iBAAiB,QAAQ"}