@open-mercato/cli 0.10.1-develop.7576.1.21d5b50435 → 0.10.1-develop.7578.1.677eeb8343

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 (177) hide show
  1. package/.turbo/turbo-build.log +5 -1
  2. package/dist/agentic/guides/architecture.md +2 -0
  3. package/dist/agentic/guides/customers-calendar.md +57 -0
  4. package/dist/agentic/guides/extensions.md +2 -0
  5. package/dist/agentic/guides/module-facts.json +4287 -699
  6. package/dist/agentic/guides/module-facts.v2.json +4287 -699
  7. package/dist/agentic/guides/module-tool.md +35 -0
  8. package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
  9. package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
  10. package/dist/agentic/guides/modules/api_docs/index.md +1 -1
  11. package/dist/agentic/guides/modules/api_keys/index.md +1 -1
  12. package/dist/agentic/guides/modules/attachments/index.md +1 -1
  13. package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
  14. package/dist/agentic/guides/modules/auth/index.md +1 -1
  15. package/dist/agentic/guides/modules/availability/index.md +1 -1
  16. package/dist/agentic/guides/modules/business_rules/index.md +1 -1
  17. package/dist/agentic/guides/modules/catalog/acl-features.md +3 -1
  18. package/dist/agentic/guides/modules/catalog/active-extension-bindings.md +3 -3
  19. package/dist/agentic/guides/modules/catalog/cli-commands.md +1 -0
  20. package/dist/agentic/guides/modules/catalog/contribution-resolutions.md +2 -0
  21. package/dist/agentic/guides/modules/catalog/di-registrations-rich.md +5 -4
  22. package/dist/agentic/guides/modules/catalog/di-service-tokens.md +2 -1
  23. package/dist/agentic/guides/modules/catalog/entities.md +1 -0
  24. package/dist/agentic/guides/modules/catalog/exact-override-targets.md +10 -4
  25. package/dist/agentic/guides/modules/catalog/index.md +5 -5
  26. package/dist/agentic/guides/modules/catalog/umes-contributions.md +2 -0
  27. package/dist/agentic/guides/modules/catalog/umes-hosts.md +1 -0
  28. package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
  29. package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
  30. package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
  31. package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
  32. package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
  33. package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
  34. package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
  35. package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
  36. package/dist/agentic/guides/modules/checkout/index.md +1 -1
  37. package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
  38. package/dist/agentic/guides/modules/configs/index.md +1 -1
  39. package/dist/agentic/guides/modules/content/index.md +1 -1
  40. package/dist/agentic/guides/modules/currencies/index.md +1 -1
  41. package/dist/agentic/guides/modules/customer_accounts/incoming-installed-contributions.md +13 -0
  42. package/dist/agentic/guides/modules/customer_accounts/index.md +3 -2
  43. package/dist/agentic/guides/modules/customer_groups/active-extension-bindings.md +1 -1
  44. package/dist/agentic/guides/modules/customer_groups/incoming-installed-contributions.md +11 -0
  45. package/dist/agentic/guides/modules/customer_groups/index.md +3 -2
  46. package/dist/agentic/guides/modules/customers/active-extension-bindings.md +5 -5
  47. package/dist/agentic/guides/modules/customers/di-registrations-rich.md +5 -3
  48. package/dist/agentic/guides/modules/customers/exact-override-targets.md +5 -3
  49. package/dist/agentic/guides/modules/customers/index.md +2 -2
  50. package/dist/agentic/guides/modules/customers/owned-contract-module-metadata.md +1 -1
  51. package/dist/agentic/guides/modules/customers/umes-hosts.md +2 -0
  52. package/dist/agentic/guides/modules/dashboards/index.md +1 -1
  53. package/dist/agentic/guides/modules/data_sync/di-registrations-rich.md +8 -8
  54. package/dist/agentic/guides/modules/data_sync/di-service-tokens.md +4 -4
  55. package/dist/agentic/guides/modules/data_sync/exact-override-targets.md +8 -8
  56. package/dist/agentic/guides/modules/data_sync/index.md +1 -1
  57. package/dist/agentic/guides/modules/design_system/index.md +1 -1
  58. package/dist/agentic/guides/modules/devices/index.md +1 -1
  59. package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
  60. package/dist/agentic/guides/modules/directory/index.md +1 -1
  61. package/dist/agentic/guides/modules/documents/index.md +1 -1
  62. package/dist/agentic/guides/modules/ecommerce/acl-features.md +15 -0
  63. package/dist/agentic/guides/modules/ecommerce/active-extension-bindings.md +12 -0
  64. package/dist/agentic/guides/modules/ecommerce/backend-pages.md +12 -0
  65. package/dist/agentic/guides/modules/ecommerce/contribution-resolutions.md +32 -0
  66. package/dist/agentic/guides/modules/ecommerce/di-registrations-rich.md +11 -0
  67. package/dist/agentic/guides/modules/ecommerce/di-service-tokens.md +11 -0
  68. package/dist/agentic/guides/modules/ecommerce/entities.md +13 -0
  69. package/dist/agentic/guides/modules/ecommerce/events.md +22 -0
  70. package/dist/agentic/guides/modules/ecommerce/exact-override-targets.md +41 -0
  71. package/dist/agentic/guides/modules/ecommerce/index.md +26 -0
  72. package/dist/agentic/guides/modules/ecommerce/notifications.md +12 -0
  73. package/dist/agentic/guides/modules/ecommerce/owned-contract-module-metadata.md +11 -0
  74. package/dist/agentic/guides/modules/ecommerce/search-entities.md +11 -0
  75. package/dist/agentic/guides/modules/ecommerce/setup.md +11 -0
  76. package/dist/agentic/guides/modules/ecommerce/umes-contributions.md +32 -0
  77. package/dist/agentic/guides/modules/ecommerce/umes-hosts.md +27 -0
  78. package/dist/agentic/guides/modules/entities/index.md +1 -1
  79. package/dist/agentic/guides/modules/eudr/index.md +1 -1
  80. package/dist/agentic/guides/modules/events/index.md +1 -1
  81. package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
  82. package/dist/agentic/guides/modules/forms/index.md +1 -1
  83. package/dist/agentic/guides/modules/gateway_stripe/di-registrations-rich.md +1 -1
  84. package/dist/agentic/guides/modules/gateway_stripe/exact-override-targets.md +1 -1
  85. package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
  86. package/dist/agentic/guides/modules/gateway_tpay/acl-features.md +12 -0
  87. package/dist/agentic/guides/modules/gateway_tpay/cli-commands.md +12 -0
  88. package/dist/agentic/guides/modules/gateway_tpay/contribution-resolutions.md +12 -0
  89. package/dist/agentic/guides/modules/gateway_tpay/di-registrations-rich.md +11 -0
  90. package/dist/agentic/guides/modules/gateway_tpay/exact-override-targets.md +17 -0
  91. package/dist/agentic/guides/modules/gateway_tpay/index.md +19 -0
  92. package/dist/agentic/guides/modules/gateway_tpay/owned-contract-module-metadata.md +11 -0
  93. package/dist/agentic/guides/modules/gateway_tpay/setup.md +11 -0
  94. package/dist/agentic/guides/modules/gateway_tpay/umes-contributions.md +12 -0
  95. package/dist/agentic/guides/modules/generators/index.md +1 -1
  96. package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
  97. package/dist/agentic/guides/modules/integrations/di-registrations-rich.md +9 -8
  98. package/dist/agentic/guides/modules/integrations/di-service-tokens.md +5 -4
  99. package/dist/agentic/guides/modules/integrations/exact-override-targets.md +9 -8
  100. package/dist/agentic/guides/modules/integrations/index.md +1 -1
  101. package/dist/agentic/guides/modules/messages/index.md +1 -1
  102. package/dist/agentic/guides/modules/notifications/index.md +1 -1
  103. package/dist/agentic/guides/modules/onboarding/index.md +1 -1
  104. package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
  105. package/dist/agentic/guides/modules/perspectives/index.md +1 -1
  106. package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
  107. package/dist/agentic/guides/modules/planner/index.md +1 -1
  108. package/dist/agentic/guides/modules/portal/index.md +1 -1
  109. package/dist/agentic/guides/modules/portal/owned-contract-module-metadata.md +1 -1
  110. package/dist/agentic/guides/modules/progress/index.md +1 -1
  111. package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
  112. package/dist/agentic/guides/modules/query_index/index.md +1 -1
  113. package/dist/agentic/guides/modules/record_locks/index.md +1 -1
  114. package/dist/agentic/guides/modules/resources/index.md +1 -1
  115. package/dist/agentic/guides/modules/sales/index.md +1 -1
  116. package/dist/agentic/guides/modules/scheduler/exact-override-targets.md +1 -1
  117. package/dist/agentic/guides/modules/scheduler/index.md +1 -1
  118. package/dist/agentic/guides/modules/scheduler/workers.md +1 -1
  119. package/dist/agentic/guides/modules/search/index.md +1 -1
  120. package/dist/agentic/guides/modules/security/index.md +1 -1
  121. package/dist/agentic/guides/modules/seeds/index.md +1 -1
  122. package/dist/agentic/guides/modules/shipping_carriers/exact-override-targets.md +1 -1
  123. package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
  124. package/dist/agentic/guides/modules/shipping_carriers/workers.md +1 -1
  125. package/dist/agentic/guides/modules/sso/index.md +1 -1
  126. package/dist/agentic/guides/modules/staff/index.md +1 -1
  127. package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
  128. package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
  129. package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
  130. package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
  131. package/dist/agentic/guides/modules/telemetry/index.md +1 -1
  132. package/dist/agentic/guides/modules/tillio/index.md +1 -1
  133. package/dist/agentic/guides/modules/translations/index.md +1 -1
  134. package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
  135. package/dist/agentic/guides/modules/webhooks/exact-override-targets.md +2 -2
  136. package/dist/agentic/guides/modules/webhooks/index.md +1 -1
  137. package/dist/agentic/guides/modules/webhooks/workers.md +2 -2
  138. package/dist/agentic/guides/modules/wms/events.md +2 -1
  139. package/dist/agentic/guides/modules/wms/index.md +1 -1
  140. package/dist/agentic/guides/modules/wms/umes-hosts.md +1 -0
  141. package/dist/agentic/guides/modules/workflows/index.md +1 -1
  142. package/dist/agentic/guides/modules/workflows/owned-contract-module-metadata.md +1 -1
  143. package/dist/agentic/guides/reference-module-facts.json +443 -25
  144. package/dist/agentic/guides/reference-modules/example/active-extension-bindings.md +2 -0
  145. package/dist/agentic/guides/reference-modules/example/contribution-resolutions.md +9 -4
  146. package/dist/agentic/guides/reference-modules/example/di-registrations-rich.md +3 -2
  147. package/dist/agentic/guides/reference-modules/example/di-service-tokens.md +1 -1
  148. package/dist/agentic/guides/reference-modules/example/exact-override-targets.md +12 -6
  149. package/dist/agentic/guides/reference-modules/example/index.md +4 -4
  150. package/dist/agentic/guides/reference-modules/example/umes-contributions.md +10 -5
  151. package/dist/agentic/guides/reference-modules/example/umes-hosts.md +1 -0
  152. package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +46 -0
  153. package/dist/agentic/guides/upstream/manifest.json +2 -2
  154. package/dist/agentic/shared/AGENTS.md.template +1 -0
  155. package/dist/agentic/shared/ai/harness/README.md +6 -2
  156. package/dist/agentic/shared/ai/harness/RELEASE.md +4 -4
  157. package/dist/agentic/shared/ai/harness/cases.json +371 -39
  158. package/dist/agentic/shared/ai/harness/cases.schema.json +4 -4
  159. package/dist/agentic/shared/ai/harness/design-system-inventory.json +63 -3
  160. package/dist/agentic/shared/ai/harness/source-link-inventory.json +316 -8
  161. package/dist/agentic/shared/ai/harness/validators.json +1 -1
  162. package/dist/agentic/shared/ai/skills/om-integration-builder/references/provider-families.md +1 -1
  163. package/dist/agentic/shared/ai/skills/om-module-scaffold/SKILL.md +2 -0
  164. package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +78 -9
  165. package/dist/agentic/shared/scripts/execution-sandbox.mjs +8 -7
  166. package/dist/bin.js +2 -0
  167. package/dist/bin.js.map +2 -2
  168. package/dist/lib/testing/integration.js +2 -0
  169. package/dist/lib/testing/integration.js.map +2 -2
  170. package/dist/mercato.js +87 -17
  171. package/dist/mercato.js.map +2 -2
  172. package/package.json +7 -7
  173. package/src/__tests__/mercato.test.ts +480 -0
  174. package/src/bin.ts +5 -0
  175. package/src/lib/__tests__/bin-next-subpath-hook.test.ts +25 -0
  176. package/src/lib/testing/integration.ts +2 -0
  177. package/src/mercato.ts +104 -14
@@ -2,10 +2,10 @@
2
2
  "version": 1,
3
3
  "generatedNote": "Derived asset — the app-facing projection of the repository source-link inventory, regenerated with `yarn workspace create-mercato-app harness:generate-source-link-inventory`. Never hand-edit. Harness cases resolve `context.sourceReferenceIds` against `referenceId` here; a record with `readStatus: \"qa-only\"` is validation evidence only and is refused as a case reference.",
4
4
  "derived": {
5
- "ownerCount": 30,
6
- "recordCount": 138,
7
- "sourceRequiredCount": 113,
8
- "readableCount": 138,
5
+ "ownerCount": 32,
6
+ "recordCount": 150,
7
+ "sourceRequiredCount": 125,
8
+ "readableCount": 150,
9
9
  "baselineSha": "f7c941570003f3abe920b1765995cbef98dcad0b"
10
10
  },
11
11
  "notCovered": [
@@ -113,6 +113,308 @@
113
113
  "migration"
114
114
  ]
115
115
  },
116
+ {
117
+ "referenceId": "guides/customers-calendar:commands/interceptors.ts",
118
+ "requirement": "source-required",
119
+ "originAsset": ".ai/guides/customers-calendar.md",
120
+ "heading": "Exact reference implementation",
121
+ "href": "../../src/modules/example/commands/interceptors.ts",
122
+ "targetKind": "canonical-example",
123
+ "readStatus": "readable",
124
+ "resolvedPath": "src/modules/example/commands/interceptors.ts",
125
+ "moduleId": "example",
126
+ "capabilityIds": [
127
+ "commands.interceptors",
128
+ "umes.customers.calendar-event-types"
129
+ ],
130
+ "presets": [
131
+ "classic",
132
+ "crm",
133
+ "empty",
134
+ "wms"
135
+ ],
136
+ "tiers": [
137
+ "automation",
138
+ "core",
139
+ "migration"
140
+ ]
141
+ },
142
+ {
143
+ "referenceId": "guides/customers-calendar:components/VisitPanel.tsx",
144
+ "requirement": "source-required",
145
+ "originAsset": ".ai/guides/customers-calendar.md",
146
+ "heading": "Exact reference implementation",
147
+ "href": "../../src/modules/example/components/VisitPanel.tsx",
148
+ "targetKind": "canonical-example",
149
+ "readStatus": "readable",
150
+ "resolvedPath": "src/modules/example/components/VisitPanel.tsx",
151
+ "moduleId": "example",
152
+ "capabilityIds": [
153
+ "umes.customers.calendar-event-types"
154
+ ],
155
+ "presets": [
156
+ "classic",
157
+ "crm",
158
+ "empty",
159
+ "wms"
160
+ ],
161
+ "tiers": [
162
+ "automation",
163
+ "core",
164
+ "migration"
165
+ ]
166
+ },
167
+ {
168
+ "referenceId": "guides/customers-calendar:di.ts",
169
+ "requirement": "source-required",
170
+ "originAsset": ".ai/guides/customers-calendar.md",
171
+ "heading": "Exact reference implementation",
172
+ "href": "../../src/modules/example/di.ts",
173
+ "targetKind": "canonical-example",
174
+ "readStatus": "readable",
175
+ "resolvedPath": "src/modules/example/di.ts",
176
+ "moduleId": "example",
177
+ "capabilityIds": [
178
+ "integrations.local-bundle",
179
+ "module.di-registration",
180
+ "umes.customers.calendar-event-types"
181
+ ],
182
+ "presets": [
183
+ "classic",
184
+ "crm",
185
+ "empty",
186
+ "wms"
187
+ ],
188
+ "tiers": [
189
+ "automation",
190
+ "core",
191
+ "migration"
192
+ ]
193
+ },
194
+ {
195
+ "referenceId": "guides/customers-calendar:lib/visitAvailability.ts",
196
+ "requirement": "source-required",
197
+ "originAsset": ".ai/guides/customers-calendar.md",
198
+ "heading": "Exact reference implementation",
199
+ "href": "../../src/modules/example/lib/visitAvailability.ts",
200
+ "targetKind": "canonical-example",
201
+ "readStatus": "readable",
202
+ "resolvedPath": "src/modules/example/lib/visitAvailability.ts",
203
+ "moduleId": "example",
204
+ "capabilityIds": [
205
+ "umes.customers.calendar-event-types"
206
+ ],
207
+ "presets": [
208
+ "classic",
209
+ "crm",
210
+ "empty",
211
+ "wms"
212
+ ],
213
+ "tiers": [
214
+ "automation",
215
+ "core",
216
+ "migration"
217
+ ]
218
+ },
219
+ {
220
+ "referenceId": "guides/customers-calendar:lib/visitAvailabilityGuard.ts",
221
+ "requirement": "source-required",
222
+ "originAsset": ".ai/guides/customers-calendar.md",
223
+ "heading": "Exact reference implementation",
224
+ "href": "../../src/modules/example/lib/visitAvailabilityGuard.ts",
225
+ "targetKind": "canonical-example",
226
+ "readStatus": "readable",
227
+ "resolvedPath": "src/modules/example/lib/visitAvailabilityGuard.ts",
228
+ "moduleId": "example",
229
+ "capabilityIds": [
230
+ "umes.customers.calendar-event-types"
231
+ ],
232
+ "presets": [
233
+ "classic",
234
+ "crm",
235
+ "empty",
236
+ "wms"
237
+ ],
238
+ "tiers": [
239
+ "automation",
240
+ "core",
241
+ "migration"
242
+ ]
243
+ },
244
+ {
245
+ "referenceId": "guides/customers-calendar:node_modules/@open-mercato/core/src/modules/customers/calendar-event-types.ts",
246
+ "requirement": "source-required",
247
+ "originAsset": ".ai/guides/customers-calendar.md",
248
+ "heading": "Exact reference implementation",
249
+ "href": "../../node_modules/@open-mercato/core/src/modules/customers/calendar-event-types.ts",
250
+ "targetKind": "installed-package",
251
+ "readStatus": "readable",
252
+ "resolvedPath": "node_modules/@open-mercato/core/src/modules/customers/calendar-event-types.ts",
253
+ "moduleId": null,
254
+ "capabilityIds": [],
255
+ "packageName": "@open-mercato/core",
256
+ "packageRelativePath": "src/modules/customers/calendar-event-types.ts",
257
+ "presets": [
258
+ "classic",
259
+ "crm",
260
+ "empty",
261
+ "wms"
262
+ ],
263
+ "tiers": [
264
+ "automation",
265
+ "core",
266
+ "migration"
267
+ ]
268
+ },
269
+ {
270
+ "referenceId": "guides/customers-calendar:node_modules/@open-mercato/core/src/modules/customers/components/calendar/CalendarEventEditor.tsx",
271
+ "requirement": "source-required",
272
+ "originAsset": ".ai/guides/customers-calendar.md",
273
+ "heading": "Exact reference implementation",
274
+ "href": "../../node_modules/@open-mercato/core/src/modules/customers/components/calendar/CalendarEventEditor.tsx",
275
+ "targetKind": "installed-package",
276
+ "readStatus": "readable",
277
+ "resolvedPath": "node_modules/@open-mercato/core/src/modules/customers/components/calendar/CalendarEventEditor.tsx",
278
+ "moduleId": null,
279
+ "capabilityIds": [],
280
+ "packageName": "@open-mercato/core",
281
+ "packageRelativePath": "src/modules/customers/components/calendar/CalendarEventEditor.tsx",
282
+ "presets": [
283
+ "classic",
284
+ "crm",
285
+ "empty",
286
+ "wms"
287
+ ],
288
+ "tiers": [
289
+ "automation",
290
+ "core",
291
+ "migration"
292
+ ]
293
+ },
294
+ {
295
+ "referenceId": "guides/customers-calendar:node_modules/@open-mercato/core/src/modules/customers/lib/calendar/eventTypeResolver.ts",
296
+ "requirement": "source-required",
297
+ "originAsset": ".ai/guides/customers-calendar.md",
298
+ "heading": "Exact reference implementation",
299
+ "href": "../../node_modules/@open-mercato/core/src/modules/customers/lib/calendar/eventTypeResolver.ts",
300
+ "targetKind": "installed-package",
301
+ "readStatus": "readable",
302
+ "resolvedPath": "node_modules/@open-mercato/core/src/modules/customers/lib/calendar/eventTypeResolver.ts",
303
+ "moduleId": null,
304
+ "capabilityIds": [],
305
+ "packageName": "@open-mercato/core",
306
+ "packageRelativePath": "src/modules/customers/lib/calendar/eventTypeResolver.ts",
307
+ "presets": [
308
+ "classic",
309
+ "crm",
310
+ "empty",
311
+ "wms"
312
+ ],
313
+ "tiers": [
314
+ "automation",
315
+ "core",
316
+ "migration"
317
+ ]
318
+ },
319
+ {
320
+ "referenceId": "guides/customers-calendar:widgets/injection-table.ts",
321
+ "requirement": "source-required",
322
+ "originAsset": ".ai/guides/customers-calendar.md",
323
+ "heading": "Exact reference implementation",
324
+ "href": "../../src/modules/example/widgets/injection-table.ts",
325
+ "targetKind": "canonical-example",
326
+ "readStatus": "readable",
327
+ "resolvedPath": "src/modules/example/widgets/injection-table.ts",
328
+ "moduleId": "example",
329
+ "capabilityIds": [
330
+ "umes.customers.calendar-event-types",
331
+ "umes.injection-table"
332
+ ],
333
+ "presets": [
334
+ "classic",
335
+ "crm",
336
+ "empty",
337
+ "wms"
338
+ ],
339
+ "tiers": [
340
+ "automation",
341
+ "core",
342
+ "migration"
343
+ ]
344
+ },
345
+ {
346
+ "referenceId": "guides/customers-calendar:widgets/injection/calendar-visit/widget.ts",
347
+ "requirement": "source-required",
348
+ "originAsset": ".ai/guides/customers-calendar.md",
349
+ "heading": "Exact reference implementation",
350
+ "href": "../../src/modules/example/widgets/injection/calendar-visit/widget.ts",
351
+ "targetKind": "canonical-example",
352
+ "readStatus": "readable",
353
+ "resolvedPath": "src/modules/example/widgets/injection/calendar-visit/widget.ts",
354
+ "moduleId": "example",
355
+ "capabilityIds": [
356
+ "umes.customers.calendar-event-types"
357
+ ],
358
+ "presets": [
359
+ "classic",
360
+ "crm",
361
+ "empty",
362
+ "wms"
363
+ ],
364
+ "tiers": [
365
+ "automation",
366
+ "core",
367
+ "migration"
368
+ ]
369
+ },
370
+ {
371
+ "referenceId": "guides/customers-calendar:widgets/injection/visit-availability/widget.ts",
372
+ "requirement": "source-required",
373
+ "originAsset": ".ai/guides/customers-calendar.md",
374
+ "heading": "Exact reference implementation",
375
+ "href": "../../src/modules/example/widgets/injection/visit-availability/widget.ts",
376
+ "targetKind": "canonical-example",
377
+ "readStatus": "readable",
378
+ "resolvedPath": "src/modules/example/widgets/injection/visit-availability/widget.ts",
379
+ "moduleId": "example",
380
+ "capabilityIds": [
381
+ "umes.customers.calendar-event-types"
382
+ ],
383
+ "presets": [
384
+ "classic",
385
+ "crm",
386
+ "empty",
387
+ "wms"
388
+ ],
389
+ "tiers": [
390
+ "automation",
391
+ "core",
392
+ "migration"
393
+ ]
394
+ },
395
+ {
396
+ "referenceId": "guides/extensions:.ai/guides/customers-calendar.md",
397
+ "requirement": "source-required",
398
+ "originAsset": ".ai/guides/extensions.md",
399
+ "heading": "Mechanism Selector",
400
+ "href": "customers-calendar.md",
401
+ "targetKind": "local-owner",
402
+ "readStatus": "readable",
403
+ "resolvedPath": ".ai/guides/customers-calendar.md",
404
+ "moduleId": null,
405
+ "capabilityIds": [],
406
+ "presets": [
407
+ "classic",
408
+ "crm",
409
+ "empty",
410
+ "wms"
411
+ ],
412
+ "tiers": [
413
+ "automation",
414
+ "core",
415
+ "migration"
416
+ ]
417
+ },
116
418
  {
117
419
  "referenceId": "guides/framework-contracts:node_modules/@open-mercato/shared/src/lib/commands/registry.ts",
118
420
  "requirement": "source-required",
@@ -1613,7 +1915,8 @@
1613
1915
  "resolvedPath": "src/modules/example/commands/interceptors.ts",
1614
1916
  "moduleId": "example",
1615
1917
  "capabilityIds": [
1616
- "commands.interceptors"
1918
+ "commands.interceptors",
1919
+ "umes.customers.calendar-event-types"
1617
1920
  ],
1618
1921
  "presets": [
1619
1922
  "classic",
@@ -1984,7 +2287,8 @@
1984
2287
  "moduleId": "example",
1985
2288
  "capabilityIds": [
1986
2289
  "integrations.local-bundle",
1987
- "module.di-registration"
2290
+ "module.di-registration",
2291
+ "umes.customers.calendar-event-types"
1988
2292
  ],
1989
2293
  "presets": [
1990
2294
  "classic",
@@ -2448,7 +2752,8 @@
2448
2752
  "moduleId": "example",
2449
2753
  "capabilityIds": [
2450
2754
  "integrations.local-bundle",
2451
- "module.di-registration"
2755
+ "module.di-registration",
2756
+ "umes.customers.calendar-event-types"
2452
2757
  ],
2453
2758
  "presets": [
2454
2759
  "classic",
@@ -2766,7 +3071,8 @@
2766
3071
  "resolvedPath": "src/modules/example/commands/interceptors.ts",
2767
3072
  "moduleId": "example",
2768
3073
  "capabilityIds": [
2769
- "commands.interceptors"
3074
+ "commands.interceptors",
3075
+ "umes.customers.calendar-event-types"
2770
3076
  ],
2771
3077
  "presets": [
2772
3078
  "classic",
@@ -3019,6 +3325,7 @@
3019
3325
  "resolvedPath": "src/modules/example/widgets/injection-table.ts",
3020
3326
  "moduleId": "example",
3021
3327
  "capabilityIds": [
3328
+ "umes.customers.calendar-event-types",
3022
3329
  "umes.injection-table"
3023
3330
  ],
3024
3331
  "presets": [
@@ -3458,6 +3765,7 @@
3458
3765
  "resolvedPath": "src/modules/example/widgets/injection-table.ts",
3459
3766
  "moduleId": "example",
3460
3767
  "capabilityIds": [
3768
+ "umes.customers.calendar-event-types",
3461
3769
  "umes.injection-table"
3462
3770
  ],
3463
3771
  "presets": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "catalog": {
4
- "expectedCaseCount": 237,
4
+ "expectedCaseCount": 239,
5
5
  "maxContextFiles": 16,
6
6
  "maxInitialContextBytes": 98304,
7
7
  "maxTotalContextBytes": 1048576,
@@ -5,7 +5,7 @@ Load this reference to choose provider contracts.
5
5
  - **Transactional email:** tenant credentials; `IntegrationDefinition`; DI sender and health services; bounded retry/redaction; activation. No generic installed transactional-email adapter exists, so do not invent one.
6
6
  - **Mailbox/email channel:** installed `communication_channels` hub; `ChannelAdapter`; `integration.ts` with `hub: 'communication_channels'`; DI + setup adapter/health registration; per-user credentials; threading/dedup; webhook/poll convergence. Follow installed `channel_gmail`/`channel_imap` facts and contracts.
7
7
  - **Shipping:** installed `ShippingAdapter` plus `registerShippingAdapter`; services/rates/labels/tracking; address/package validation; idempotent fulfillment transitions; signed status callbacks. Keep host domain state provider-neutral (`provider-neutral-domain`); the carrier module is optional, so preserve a safe absent-provider path (`optional-provider`).
8
- - **Payment:** installed `GatewayAdapter` plus `registerGatewayAdapter`, `registerWebhookHandler`, and `registerPaymentGatewayDescriptor`; register `verifyWebhook` so the host can reach it; durable idempotency; money/currency exactness; signed webhook reconciliation; concurrency-safe status machine.
8
+ - **Payment:** installed `GatewayAdapter` plus `registerGatewayAdapter`, `registerWebhookHandler`, and `registerPaymentGatewayDescriptor`; register `verifyWebhook` so the host can reach it (optional `registerWebhookHandler` options: `readSessionIdHint`/`readPaymentIdHint` locators with raw `context`, `rawBody: 'bytes'` for exact-byte signatures, `maxBodyBytes`, `formatResponse` for provider-specific acknowledgements; verifiers get a safe `candidate` snapshot and never take tenant scope from the payload); durable idempotency; money/currency exactness; signed webhook reconciliation; concurrency-safe status machine.
9
9
  - **Data sync:** `DataSyncAdapter`; entity mappings/presets; external IDs; streaming batches/cursors; overlap, progress, cancellation, reconciliation.
10
10
  - **Webhooks:** inbound verification/replay; outbound Standard Webhooks signing; queued deliveries, retries, logs, status.
11
11
  - **Import/export:** streaming format adapter; mapping/validation; formula and archive safety; row errors; progress/artifact cleanup.
@@ -12,6 +12,8 @@ Create the smallest working vertical slice under `src/modules/<id>/`. START at [
12
12
  - A domain brief; infer names conservatively and ask only when a choice changes public behavior or scope.
13
13
  - Optional requested phases. Without phases, deliver the complete slice needed by the brief.
14
14
 
15
+ With terminal access, initialize a new app module with `npx create-mercato-module init <module_id>` before implementing the slice; skip `init` for existing modules. Without process execution, report that capability gap instead of claiming initialization or bypassing the tool. For publication or continued development in a dedicated repository, follow `.ai/guides/module-tool.md`.
16
+
15
17
  ## Workflow
16
18
 
17
19
  Route before reading: every specialist step below is conditional. Decide from the brief and the blueprint route key first, include each applicable route in the assembled route, and only then read that route's guide or skill. Never probe a specialist guide and discard its route. In particular, do not open the extension or framework-context skill as a precaution: select UMES only for an injected, overridden, enriched, or intercepted installed surface, and select framework context only after naming an unresolved exact-version detail. For an architecture-only plan, the root router's `architecture` + `module-data` exception wins: use the blueprint to name likely UI/workflow surfaces without loading their implementation guides or skills.
@@ -2906,13 +2906,79 @@ function buildRunnerInvocation({ runner, root, schemaPath, outputPath, model, re
2906
2906
  return { command: 'claude', args }
2907
2907
  }
2908
2908
 
2909
- function runAgentOnce({ runner, root, schemaPath, prompt, timeout, model, reasoningEffort, writable, allowedReads = [], allowedWrites = [], immutableRoots = [], validateResponse = validateRoutingResponse }) {
2909
+ export function codexOutputSchema(schema) {
2910
+ if (!isPlainObject(schema)) return schema
2911
+ const strict = { ...schema }
2912
+ delete strict.uniqueItems
2913
+ if (schema.$defs) strict.$defs = Object.fromEntries(Object.entries(schema.$defs).map(([key, child]) => [key, codexOutputSchema(child)]))
2914
+ if (schema.items) strict.items = codexOutputSchema(schema.items)
2915
+ for (const keyword of ['anyOf', 'oneOf', 'allOf']) {
2916
+ if (Array.isArray(schema[keyword])) strict[keyword] = schema[keyword].map(codexOutputSchema)
2917
+ }
2918
+ if (schema.properties) {
2919
+ const required = new Set(schema.required ?? [])
2920
+ strict.properties = Object.fromEntries(Object.entries(schema.properties).map(([key, child]) => {
2921
+ const converted = codexOutputSchema(child)
2922
+ return [key, required.has(key) ? converted : { anyOf: [converted, { type: 'null' }] }]
2923
+ }))
2924
+ strict.required = Object.keys(schema.properties)
2925
+ }
2926
+ return strict
2927
+ }
2928
+
2929
+ function acceptsCanonicalNull(schema, rootSchema) {
2930
+ if (schema.$ref) {
2931
+ const resolved = resolveJsonSchemaReference(rootSchema, schema.$ref)
2932
+ return resolved ? acceptsCanonicalNull(resolved, rootSchema) : false
2933
+ }
2934
+ if (schema.anyOf && !schema.anyOf.some((child) => acceptsCanonicalNull(child, rootSchema))) return false
2935
+ if (schema.oneOf && schema.oneOf.filter((child) => acceptsCanonicalNull(child, rootSchema)).length !== 1) return false
2936
+ return validateJsonSchema(null, schema, '$', rootSchema).length === 0
2937
+ }
2938
+
2939
+ export function normalizeCodexOutput(value, schema, rootSchema = schema) {
2940
+ if (schema.$ref) {
2941
+ const resolved = resolveJsonSchemaReference(rootSchema, schema.$ref)
2942
+ return resolved ? normalizeCodexOutput(value, resolved, rootSchema) : value
2943
+ }
2944
+ if (Array.isArray(value) && schema.items) return value.map((item) => normalizeCodexOutput(item, schema.items, rootSchema))
2945
+ if (!isPlainObject(value) || !schema.properties) return value
2946
+ const normalized = { ...value }
2947
+ const required = new Set(schema.required ?? [])
2948
+ for (const [key, child] of Object.entries(schema.properties)) {
2949
+ if (!Object.hasOwn(value, key)) continue
2950
+ const nullable = acceptsCanonicalNull(child, rootSchema)
2951
+ if (value[key] === null && !required.has(key) && !nullable) delete normalized[key]
2952
+ else normalized[key] = normalizeCodexOutput(value[key], child, rootSchema)
2953
+ }
2954
+ return normalized
2955
+ }
2956
+
2957
+ export function codexOutputPrompt(prompt, schema) {
2958
+ const optionalFields = Object.keys(schema.properties ?? {}).filter((key) => !(schema.required ?? []).includes(key))
2959
+ if (!optionalFields.length) return prompt
2960
+ return `${prompt}\n\nCodex wire format: nullable fields encode optional output. Use null for fields that the instructions omit or do not request; never invent optional content merely because the wire schema requires its key.`
2961
+ }
2962
+
2963
+ export function routingResponseSchemaForCase(schema, caseRecord) {
2964
+ if (isSpecRoutingCase(caseRecord) || !schema.properties?.specRouting) return schema
2965
+ const properties = { ...schema.properties }
2966
+ delete properties.specRouting
2967
+ return {
2968
+ ...schema,
2969
+ properties,
2970
+ required: (schema.required ?? []).filter((key) => key !== 'specRouting'),
2971
+ }
2972
+ }
2973
+
2974
+ function runAgentOnce({ runner, root, schemaPath, responseSchema, prompt, timeout, model, reasoningEffort, writable, allowedReads = [], allowedWrites = [], immutableRoots = [], validateResponse = validateRoutingResponse }) {
2910
2975
  const canonicalRoot = fs.realpathSync(root)
2911
2976
  const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'om-harness-result-'))
2912
2977
  const outputPath = path.join(tempDir, 'structured.json')
2913
2978
  const isolatedSchemaPath = path.join(tempDir, 'output.schema.json')
2914
- fs.copyFileSync(schemaPath, isolatedSchemaPath, fs.constants.COPYFILE_EXCL)
2915
- fs.chmodSync(isolatedSchemaPath, 0o600)
2979
+ const canonicalSchema = responseSchema ?? readJson(schemaPath)
2980
+ const transportSchema = runner === 'codex' ? codexOutputSchema(canonicalSchema) : canonicalSchema
2981
+ fs.writeFileSync(isolatedSchemaPath, `${JSON.stringify(transportSchema)}\n`, { flag: 'wx', mode: 0o600 })
2916
2982
  const invocation = buildRunnerInvocation({ runner, root: canonicalRoot, schemaPath: isolatedSchemaPath, outputPath, model, reasoningEffort, writable, allowedReads, allowedWrites, immutableRoots })
2917
2983
  const runnerEnv = narrowRunnerEnv(runner)
2918
2984
  if (runner === 'codex') {
@@ -2966,7 +3032,7 @@ function runAgentOnce({ runner, root, schemaPath, prompt, timeout, model, reason
2966
3032
  })
2967
3033
  const processResult = spawnSync(contained.command, contained.args, {
2968
3034
  cwd: contained.cwd,
2969
- input: prompt,
3035
+ input: runner === 'codex' ? codexOutputPrompt(prompt, canonicalSchema) : prompt,
2970
3036
  encoding: 'utf8',
2971
3037
  timeout,
2972
3038
  maxBuffer: 8 * 1024 * 1024,
@@ -2979,8 +3045,9 @@ function runAgentOnce({ runner, root, schemaPath, prompt, timeout, model, reason
2979
3045
  if (processResult.error) return { kind: 'environment-failure', durationMs, exitStatus: processResult.status, error: processResult.error.message, stdout: processResult.stdout ?? '' }
2980
3046
  if (processResult.status !== 0) return { kind: 'process-failure', durationMs, exitStatus: processResult.status, error: processFailureDiagnostic(runner, processResult), stdout: processResult.stdout ?? '' }
2981
3047
  try {
2982
- const rawResponse = extractJsonCandidate(processResult.stdout ?? '', outputPath, runner)
2983
- const schemaErrors = [...validateResponse(rawResponse), ...validateJsonSchema(rawResponse, readJson(schemaPath))]
3048
+ const transportResponse = extractJsonCandidate(processResult.stdout ?? '', outputPath, runner)
3049
+ const rawResponse = runner === 'codex' ? normalizeCodexOutput(transportResponse, canonicalSchema) : transportResponse
3050
+ const schemaErrors = [...validateResponse(rawResponse), ...validateJsonSchema(rawResponse, canonicalSchema)]
2984
3051
  if (schemaErrors.length) return { kind: 'invalid-structured-output', durationMs, exitStatus: processResult.status, error: schemaErrors.join('; '), stdout: processResult.stdout ?? '' }
2985
3052
  const response = rawResponse
2986
3053
  for (const key of ['selectedRouter', 'selectedSkills', 'selectedContext', 'decisions', 'violations']) {
@@ -3668,6 +3735,7 @@ export function resolveLiveCaseTimeout(options, model, caseTimeout = 0) {
3668
3735
 
3669
3736
  function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, harnessDir, resultSchema }) {
3670
3737
  const schemaPath = path.join(harnessDir, 'routing-response.schema.json')
3738
+ const routingResponseSchema = readJson(schemaPath)
3671
3739
  const version = runnerVersion(options.runner, root)
3672
3740
  const model = options.model ?? releaseMatrix.routing.runners[options.runner].modelSelector
3673
3741
  const writableRoot = options.writableRoot ? path.resolve(options.writableRoot) : undefined
@@ -3710,8 +3778,9 @@ function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, h
3710
3778
  // fail-closed tool server, so a declared example root can never be written.
3711
3779
  const immutableRoots = immutableExampleRoots(evaluationCase)
3712
3780
  const timeout = resolveLiveCaseTimeout(options, model, caseRecord.timeoutMs ?? 0)
3781
+ const responseSchema = routingResponseSchemaForCase(routingResponseSchema, evaluationCase)
3713
3782
  const executions = [runAgentOnce({
3714
- runner: options.runner, root: runRoot, schemaPath, prompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3783
+ runner: options.runner, root: runRoot, schemaPath, responseSchema, prompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3715
3784
  allowedReads, allowedWrites: writable ? caseRecord.allowedWrites ?? [] : [], immutableRoots,
3716
3785
  })]
3717
3786
  let execution = executions[0]
@@ -3723,7 +3792,7 @@ function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, h
3723
3792
  ? `${prompt}\n\nYour previous response was not valid structured output. Return only the schema object.`
3724
3793
  : `${prompt}\n\nThis is retry attempt 2 after a transient provider failure. Continue with the same routing contract.`
3725
3794
  execution = runAgentOnce({
3726
- runner: options.runner, root: runRoot, schemaPath, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3795
+ runner: options.runner, root: runRoot, schemaPath, responseSchema, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3727
3796
  allowedReads, allowedWrites: writable ? caseRecord.allowedWrites ?? [] : [], immutableRoots,
3728
3797
  })
3729
3798
  executions.push(execution)
@@ -3787,7 +3856,7 @@ function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, h
3787
3856
  const diagnostics = routingCorrectionDiagnostics(evaluated.violations)
3788
3857
  const retryPrompt = `${prompt}\n\nThis is correction attempt ${executions.length + 1} after the previous routing answer failed a non-safety contract. Correction kind: ${correctionKind}. Evaluator diagnostics: ${JSON.stringify(diagnostics)}. These diagnostics identify only the failing contract categories; derive every answer from emitted instructions. Start the routing audit again by calling harness.read with {"path":"AGENTS.md"}; never call read_mcp_resource or any resource API. Re-evaluate every additive Axis 1 route, Axis 2 work-unit skill, module fact, and required decision while opening only the smallest task-matching initial context. Build selectedContext from every successful read in this correction attempt: add every opened routed guide's route and every opened skill's ID, or avoid opening it. Never reuse or prune the previous answer. Re-check the context budget, then return only the schema object.`
3789
3858
  execution = runAgentOnce({
3790
- runner: options.runner, root: runRoot, schemaPath, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3859
+ runner: options.runner, root: runRoot, schemaPath, responseSchema, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3791
3860
  allowedReads, allowedWrites: [], immutableRoots,
3792
3861
  })
3793
3862
  executions.push(execution)
@@ -69,16 +69,17 @@ export function collapseReadOnlyRoots(values) {
69
69
 
70
70
  export function linuxMergedUsrSymlinkArgs() {
71
71
  const aliases = [
72
- ['/bin', 'usr/bin'],
73
- ['/sbin', 'usr/sbin'],
74
- ['/lib', 'usr/lib'],
75
- ['/lib64', 'usr/lib64'],
72
+ ['/bin', ['usr/bin']],
73
+ ['/sbin', ['usr/sbin', 'usr/bin']],
74
+ ['/lib', ['usr/lib']],
75
+ ['/lib64', ['usr/lib64', 'usr/lib']],
76
76
  ]
77
- return aliases.flatMap(([alias, expected]) => {
77
+ return aliases.flatMap(([alias, targets]) => {
78
78
  try {
79
79
  const stat = fs.lstatSync(alias)
80
- return stat.isSymbolicLink() && fs.readlinkSync(alias) === expected
81
- ? ['--symlink', expected, alias]
80
+ const target = stat.isSymbolicLink() ? fs.readlinkSync(alias) : null
81
+ return targets.includes(target)
82
+ ? ['--symlink', target, alias]
82
83
  : []
83
84
  } catch { return [] }
84
85
  })
package/dist/bin.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { isTelemetryBackendEnabled } from "@open-mercato/shared/lib/telemetry/runtime";
3
+ import { installNextSubpathResolveHook } from "@open-mercato/shared/lib/bootstrap/next-subpath-resolve-hook";
3
4
  import { resolveCliBootstrapMode } from "./lib/cli-bootstrap-mode.js";
4
5
  import { flushBeforeExit } from "./lib/flush-before-exit.js";
5
6
  function assertNode24Runtime() {
@@ -48,6 +49,7 @@ async function tryBootstrap(mode) {
48
49
  }
49
50
  async function main() {
50
51
  assertNode24Runtime();
52
+ installNextSubpathResolveHook();
51
53
  const bootstrapMode = resolveCliBootstrapMode(process.argv);
52
54
  if (bootstrapMode !== "none") {
53
55
  const { loadAppEnv } = await import("./lib/load-env.js");
package/dist/bin.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/bin.ts"],
4
- "sourcesContent": ["/**\n * CLI binary entry point for @open-mercato/cli package.\n *\n * Called from within a Next.js app directory as: yarn mercato <command>\n * Uses dynamic app resolution to find generated files at .mercato/generated/\n */\nimport { isTelemetryBackendEnabled } from '@open-mercato/shared/lib/telemetry/runtime'\nimport { resolveCliBootstrapMode, type CliBootstrapMode } from './lib/cli-bootstrap-mode.js'\nimport { flushBeforeExit } from './lib/flush-before-exit.js'\n// `run` is imported dynamically inside `main()` so telemetry can initialize\n// before the mercato entry (and its Postgres driver) loads \u2014 see main().\n\nfunction assertNode24Runtime(): void {\n const detectedNodeVersion = process.versions.node\n const majorVersion = Number.parseInt(detectedNodeVersion.split('.')[0] ?? '0', 10)\n if (majorVersion >= 24) {\n return\n }\n throw new Error(\n [\n 'Unsupported Node.js runtime.',\n `Cause: Detected Node ${detectedNodeVersion}, but Open Mercato requires Node 24.x.`,\n 'What to do: switch your shell to Node 24 (for example `nvm use 24`), run `yarn install`, then retry.',\n ].join(' '),\n )\n}\n\nasync function tryBootstrap(mode: Exclude<CliBootstrapMode, 'none'>): Promise<boolean> {\n try {\n // Use the CLI resolver to find the app directory (handles monorepo detection)\n const { createResolver } = await import('./lib/resolver.js')\n const resolver = createResolver()\n const appDir = resolver.getAppDir()\n\n if (mode === 'dev-supervisor') {\n const {\n canUseLightweightDevSupervisor,\n loadDevSupervisorManifest,\n registerDevSupervisorManifest,\n } = await import(\n './lib/dev-supervisor-manifest.js'\n )\n const manifest = loadDevSupervisorManifest(appDir)\n if (canUseLightweightDevSupervisor(manifest)) {\n registerDevSupervisorManifest(manifest)\n return true\n }\n }\n\n const { bootstrapFromAppRoot } = await import('@open-mercato/shared/lib/bootstrap/dynamicLoader')\n const { registerCliModules } = await import('./mercato.js')\n const data = await bootstrapFromAppRoot(appDir)\n // Register CLI modules directly to avoid module resolution issues\n registerCliModules(data.modules)\n return true\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n // Check if the error is about missing generated files\n if (\n message.includes('dev-supervisor.generated.json') ||\n (\n message.includes('Cannot find module') &&\n (message.includes('/generated/') || message.includes('.generated') || message.includes('.mercato'))\n )\n ) {\n return false\n }\n // Re-throw other errors\n throw err\n }\n}\n\nasync function main(): Promise<void> {\n assertNode24Runtime()\n const bootstrapMode = resolveCliBootstrapMode(process.argv)\n\n if (bootstrapMode !== 'none') {\n // Load the app's `.env` BEFORE initTelemetry(): `run()` only dotenv-loads it\n // later (ensureEnvLoaded), which is too late \u2014 TELEMETRY_BACKEND set only in\n // `.env` would silently resolve to `noop` for worker/scheduler processes.\n // The loader touches only the resolver + dotenv (no `pg`), preserving the\n // instrumentation load-order guarantee below.\n const { loadAppEnv } = await import('./lib/load-env.js')\n await loadAppEnv()\n\n // Initialize telemetry BEFORE bootstrapping the app graph. Bootstrap and the\n // per-command handlers load MikroORM's Postgres driver \u2192 `pg`, and the\n // OpenTelemetry pg/undici auto-instrumentation only records spans for a\n // driver required AFTER the SDK has started. Registering here \u2014 ahead of any\n // app module \u2014 is what lets long-running worker/scheduler processes emit DB\n // spans (not just the bullmq-otel add/process envelope). The package itself\n // is not imported unless an explicit supported backend is selected.\n if (isTelemetryBackendEnabled()) {\n const { initTelemetry } = await import('@open-mercato/telemetry')\n await initTelemetry()\n }\n\n const bootstrapSucceeded = await tryBootstrap(bootstrapMode)\n if (!bootstrapSucceeded) {\n console.error('\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557')\n console.error('\u2551 Generated files not found! \u2551')\n console.error('\u2551 \u2551')\n console.error('\u2551 The CLI requires generated files to discover modules. \u2551')\n console.error('\u2551 Please run the following command first: \u2551')\n console.error('\u2551 \u2551')\n console.error('\u2551 yarn mercato generate \u2551')\n console.error('\u2551 \u2551')\n console.error('\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D')\n process.exit(1)\n }\n }\n\n // Dynamic import (not a top-level static import) so the mercato entry \u2014 and the\n // Postgres driver it pulls in \u2014 loads only after initTelemetry() above.\n const { run } = await import('./mercato.js')\n const code = await run(process.argv)\n // Flush the coalesced browser broadcasts, then spans/logs, for commands that\n // return (workers block forever and flush via their own shutdown handler instead).\n await flushBeforeExit()\n process.exit(code ?? 0)\n}\n\nmain().catch((error: unknown) => {\n if (error instanceof Error) {\n console.error(error.message)\n } else {\n console.error(error)\n }\n process.exit(1)\n})\n"],
5
- "mappings": "AAMA,SAAS,iCAAiC;AAC1C,SAAS,+BAAsD;AAC/D,SAAS,uBAAuB;AAIhC,SAAS,sBAA4B;AACnC,QAAM,sBAAsB,QAAQ,SAAS;AAC7C,QAAM,eAAe,OAAO,SAAS,oBAAoB,MAAM,GAAG,EAAE,CAAC,KAAK,KAAK,EAAE;AACjF,MAAI,gBAAgB,IAAI;AACtB;AAAA,EACF;AACA,QAAM,IAAI;AAAA,IACR;AAAA,MACE;AAAA,MACA,wBAAwB,mBAAmB;AAAA,MAC3C;AAAA,IACF,EAAE,KAAK,GAAG;AAAA,EACZ;AACF;AAEA,eAAe,aAAa,MAA2D;AACrF,MAAI;AAEF,UAAM,EAAE,eAAe,IAAI,MAAM,OAAO,mBAAmB;AAC3D,UAAM,WAAW,eAAe;AAChC,UAAM,SAAS,SAAS,UAAU;AAElC,QAAI,SAAS,kBAAkB;AAC7B,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,MACF,IAAI,MAAM,OACR,kCACF;AACA,YAAM,WAAW,0BAA0B,MAAM;AACjD,UAAI,+BAA+B,QAAQ,GAAG;AAC5C,sCAA8B,QAAQ;AACtC,eAAO;AAAA,MACT;AAAA,IACF;AAEA,UAAM,EAAE,qBAAqB,IAAI,MAAM,OAAO,kDAAkD;AAChG,UAAM,EAAE,mBAAmB,IAAI,MAAM,OAAO,cAAc;AAC1D,UAAM,OAAO,MAAM,qBAAqB,MAAM;AAE9C,uBAAmB,KAAK,OAAO;AAC/B,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,UAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAE/D,QACE,QAAQ,SAAS,+BAA+B,KAE9C,QAAQ,SAAS,oBAAoB,MACpC,QAAQ,SAAS,aAAa,KAAK,QAAQ,SAAS,YAAY,KAAK,QAAQ,SAAS,UAAU,IAEnG;AACA,aAAO;AAAA,IACT;AAEA,UAAM;AAAA,EACR;AACF;AAEA,eAAe,OAAsB;AACnC,sBAAoB;AACpB,QAAM,gBAAgB,wBAAwB,QAAQ,IAAI;AAE1D,MAAI,kBAAkB,QAAQ;AAM5B,UAAM,EAAE,WAAW,IAAI,MAAM,OAAO,mBAAmB;AACvD,UAAM,WAAW;AASjB,QAAI,0BAA0B,GAAG;AAC/B,YAAM,EAAE,cAAc,IAAI,MAAM,OAAO,yBAAyB;AAChE,YAAM,cAAc;AAAA,IACtB;AAEA,UAAM,qBAAqB,MAAM,aAAa,aAAa;AAC3D,QAAI,CAAC,oBAAoB;AACvB,cAAQ,MAAM,gaAAuE;AACrF,cAAQ,MAAM,iFAAuE;AACrF,cAAQ,MAAM,iFAAuE;AACrF,cAAQ,MAAM,gFAAsE;AACpF,cAAQ,MAAM,gFAAsE;AACpF,cAAQ,MAAM,iFAAuE;AACrF,cAAQ,MAAM,gFAAsE;AACpF,cAAQ,MAAM,iFAAuE;AACrF,cAAQ,MAAM,gaAAuE;AACrF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AAIA,QAAM,EAAE,IAAI,IAAI,MAAM,OAAO,cAAc;AAC3C,QAAM,OAAO,MAAM,IAAI,QAAQ,IAAI;AAGnC,QAAM,gBAAgB;AACtB,UAAQ,KAAK,QAAQ,CAAC;AACxB;AAEA,KAAK,EAAE,MAAM,CAAC,UAAmB;AAC/B,MAAI,iBAAiB,OAAO;AAC1B,YAAQ,MAAM,MAAM,OAAO;AAAA,EAC7B,OAAO;AACL,YAAQ,MAAM,KAAK;AAAA,EACrB;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;",
4
+ "sourcesContent": ["/**\n * CLI binary entry point for @open-mercato/cli package.\n *\n * Called from within a Next.js app directory as: yarn mercato <command>\n * Uses dynamic app resolution to find generated files at .mercato/generated/\n */\nimport { isTelemetryBackendEnabled } from '@open-mercato/shared/lib/telemetry/runtime'\nimport { installNextSubpathResolveHook } from '@open-mercato/shared/lib/bootstrap/next-subpath-resolve-hook'\nimport { resolveCliBootstrapMode, type CliBootstrapMode } from './lib/cli-bootstrap-mode.js'\nimport { flushBeforeExit } from './lib/flush-before-exit.js'\n// `run` is imported dynamically inside `main()` so telemetry can initialize\n// before the mercato entry (and its Postgres driver) loads \u2014 see main().\n\nfunction assertNode24Runtime(): void {\n const detectedNodeVersion = process.versions.node\n const majorVersion = Number.parseInt(detectedNodeVersion.split('.')[0] ?? '0', 10)\n if (majorVersion >= 24) {\n return\n }\n throw new Error(\n [\n 'Unsupported Node.js runtime.',\n `Cause: Detected Node ${detectedNodeVersion}, but Open Mercato requires Node 24.x.`,\n 'What to do: switch your shell to Node 24 (for example `nvm use 24`), run `yarn install`, then retry.',\n ].join(' '),\n )\n}\n\nasync function tryBootstrap(mode: Exclude<CliBootstrapMode, 'none'>): Promise<boolean> {\n try {\n // Use the CLI resolver to find the app directory (handles monorepo detection)\n const { createResolver } = await import('./lib/resolver.js')\n const resolver = createResolver()\n const appDir = resolver.getAppDir()\n\n if (mode === 'dev-supervisor') {\n const {\n canUseLightweightDevSupervisor,\n loadDevSupervisorManifest,\n registerDevSupervisorManifest,\n } = await import(\n './lib/dev-supervisor-manifest.js'\n )\n const manifest = loadDevSupervisorManifest(appDir)\n if (canUseLightweightDevSupervisor(manifest)) {\n registerDevSupervisorManifest(manifest)\n return true\n }\n }\n\n const { bootstrapFromAppRoot } = await import('@open-mercato/shared/lib/bootstrap/dynamicLoader')\n const { registerCliModules } = await import('./mercato.js')\n const data = await bootstrapFromAppRoot(appDir)\n // Register CLI modules directly to avoid module resolution issues\n registerCliModules(data.modules)\n return true\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n // Check if the error is about missing generated files\n if (\n message.includes('dev-supervisor.generated.json') ||\n (\n message.includes('Cannot find module') &&\n (message.includes('/generated/') || message.includes('.generated') || message.includes('.mercato'))\n )\n ) {\n return false\n }\n // Re-throw other errors\n throw err\n }\n}\n\nasync function main(): Promise<void> {\n assertNode24Runtime()\n // Commands and workers run in plain Node, where a bare `next/<subpath>` such\n // as `next/dynamic` or `next/link` does not resolve (#7102). Install the\n // retry-with-`.js` hook before any package dist can be imported.\n installNextSubpathResolveHook()\n const bootstrapMode = resolveCliBootstrapMode(process.argv)\n\n if (bootstrapMode !== 'none') {\n // Load the app's `.env` BEFORE initTelemetry(): `run()` only dotenv-loads it\n // later (ensureEnvLoaded), which is too late \u2014 TELEMETRY_BACKEND set only in\n // `.env` would silently resolve to `noop` for worker/scheduler processes.\n // The loader touches only the resolver + dotenv (no `pg`), preserving the\n // instrumentation load-order guarantee below.\n const { loadAppEnv } = await import('./lib/load-env.js')\n await loadAppEnv()\n\n // Initialize telemetry BEFORE bootstrapping the app graph. Bootstrap and the\n // per-command handlers load MikroORM's Postgres driver \u2192 `pg`, and the\n // OpenTelemetry pg/undici auto-instrumentation only records spans for a\n // driver required AFTER the SDK has started. Registering here \u2014 ahead of any\n // app module \u2014 is what lets long-running worker/scheduler processes emit DB\n // spans (not just the bullmq-otel add/process envelope). The package itself\n // is not imported unless an explicit supported backend is selected.\n if (isTelemetryBackendEnabled()) {\n const { initTelemetry } = await import('@open-mercato/telemetry')\n await initTelemetry()\n }\n\n const bootstrapSucceeded = await tryBootstrap(bootstrapMode)\n if (!bootstrapSucceeded) {\n console.error('\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557')\n console.error('\u2551 Generated files not found! \u2551')\n console.error('\u2551 \u2551')\n console.error('\u2551 The CLI requires generated files to discover modules. \u2551')\n console.error('\u2551 Please run the following command first: \u2551')\n console.error('\u2551 \u2551')\n console.error('\u2551 yarn mercato generate \u2551')\n console.error('\u2551 \u2551')\n console.error('\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D')\n process.exit(1)\n }\n }\n\n // Dynamic import (not a top-level static import) so the mercato entry \u2014 and the\n // Postgres driver it pulls in \u2014 loads only after initTelemetry() above.\n const { run } = await import('./mercato.js')\n const code = await run(process.argv)\n // Flush the coalesced browser broadcasts, then spans/logs, for commands that\n // return (workers block forever and flush via their own shutdown handler instead).\n await flushBeforeExit()\n process.exit(code ?? 0)\n}\n\nmain().catch((error: unknown) => {\n if (error instanceof Error) {\n console.error(error.message)\n } else {\n console.error(error)\n }\n process.exit(1)\n})\n"],
5
+ "mappings": "AAMA,SAAS,iCAAiC;AAC1C,SAAS,qCAAqC;AAC9C,SAAS,+BAAsD;AAC/D,SAAS,uBAAuB;AAIhC,SAAS,sBAA4B;AACnC,QAAM,sBAAsB,QAAQ,SAAS;AAC7C,QAAM,eAAe,OAAO,SAAS,oBAAoB,MAAM,GAAG,EAAE,CAAC,KAAK,KAAK,EAAE;AACjF,MAAI,gBAAgB,IAAI;AACtB;AAAA,EACF;AACA,QAAM,IAAI;AAAA,IACR;AAAA,MACE;AAAA,MACA,wBAAwB,mBAAmB;AAAA,MAC3C;AAAA,IACF,EAAE,KAAK,GAAG;AAAA,EACZ;AACF;AAEA,eAAe,aAAa,MAA2D;AACrF,MAAI;AAEF,UAAM,EAAE,eAAe,IAAI,MAAM,OAAO,mBAAmB;AAC3D,UAAM,WAAW,eAAe;AAChC,UAAM,SAAS,SAAS,UAAU;AAElC,QAAI,SAAS,kBAAkB;AAC7B,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,MACF,IAAI,MAAM,OACR,kCACF;AACA,YAAM,WAAW,0BAA0B,MAAM;AACjD,UAAI,+BAA+B,QAAQ,GAAG;AAC5C,sCAA8B,QAAQ;AACtC,eAAO;AAAA,MACT;AAAA,IACF;AAEA,UAAM,EAAE,qBAAqB,IAAI,MAAM,OAAO,kDAAkD;AAChG,UAAM,EAAE,mBAAmB,IAAI,MAAM,OAAO,cAAc;AAC1D,UAAM,OAAO,MAAM,qBAAqB,MAAM;AAE9C,uBAAmB,KAAK,OAAO;AAC/B,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,UAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAE/D,QACE,QAAQ,SAAS,+BAA+B,KAE9C,QAAQ,SAAS,oBAAoB,MACpC,QAAQ,SAAS,aAAa,KAAK,QAAQ,SAAS,YAAY,KAAK,QAAQ,SAAS,UAAU,IAEnG;AACA,aAAO;AAAA,IACT;AAEA,UAAM;AAAA,EACR;AACF;AAEA,eAAe,OAAsB;AACnC,sBAAoB;AAIpB,gCAA8B;AAC9B,QAAM,gBAAgB,wBAAwB,QAAQ,IAAI;AAE1D,MAAI,kBAAkB,QAAQ;AAM5B,UAAM,EAAE,WAAW,IAAI,MAAM,OAAO,mBAAmB;AACvD,UAAM,WAAW;AASjB,QAAI,0BAA0B,GAAG;AAC/B,YAAM,EAAE,cAAc,IAAI,MAAM,OAAO,yBAAyB;AAChE,YAAM,cAAc;AAAA,IACtB;AAEA,UAAM,qBAAqB,MAAM,aAAa,aAAa;AAC3D,QAAI,CAAC,oBAAoB;AACvB,cAAQ,MAAM,gaAAuE;AACrF,cAAQ,MAAM,iFAAuE;AACrF,cAAQ,MAAM,iFAAuE;AACrF,cAAQ,MAAM,gFAAsE;AACpF,cAAQ,MAAM,gFAAsE;AACpF,cAAQ,MAAM,iFAAuE;AACrF,cAAQ,MAAM,gFAAsE;AACpF,cAAQ,MAAM,iFAAuE;AACrF,cAAQ,MAAM,gaAAuE;AACrF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AAIA,QAAM,EAAE,IAAI,IAAI,MAAM,OAAO,cAAc;AAC3C,QAAM,OAAO,MAAM,IAAI,QAAQ,IAAI;AAGnC,QAAM,gBAAgB;AACtB,UAAQ,KAAK,QAAQ,CAAC;AACxB;AAEA,KAAK,EAAE,MAAM,CAAC,UAAmB;AAC/B,MAAI,iBAAiB,OAAO;AAC1B,YAAQ,MAAM,MAAM,OAAO;AAAA,EAC7B,OAAO;AACL,YAAQ,MAAM,KAAK;AAAA,EACrB;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;",
6
6
  "names": []
7
7
  }