@open-mercato/cli 0.9.1-develop.7573.1.d0ccc51d5b → 0.9.1-develop.7575.1.8480826a9b

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 (172) hide show
  1. package/.turbo/turbo-build.log +1 -5
  2. package/dist/agentic/guides/architecture.md +0 -2
  3. package/dist/agentic/guides/extensions.md +0 -2
  4. package/dist/agentic/guides/module-facts.json +683 -4227
  5. package/dist/agentic/guides/module-facts.v2.json +683 -4227
  6. package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
  7. package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
  8. package/dist/agentic/guides/modules/api_docs/index.md +1 -1
  9. package/dist/agentic/guides/modules/api_keys/index.md +1 -1
  10. package/dist/agentic/guides/modules/attachments/index.md +1 -1
  11. package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
  12. package/dist/agentic/guides/modules/auth/index.md +1 -1
  13. package/dist/agentic/guides/modules/availability/index.md +1 -1
  14. package/dist/agentic/guides/modules/business_rules/index.md +1 -1
  15. package/dist/agentic/guides/modules/catalog/acl-features.md +1 -3
  16. package/dist/agentic/guides/modules/catalog/active-extension-bindings.md +3 -3
  17. package/dist/agentic/guides/modules/catalog/cli-commands.md +0 -1
  18. package/dist/agentic/guides/modules/catalog/contribution-resolutions.md +0 -2
  19. package/dist/agentic/guides/modules/catalog/di-registrations-rich.md +4 -5
  20. package/dist/agentic/guides/modules/catalog/di-service-tokens.md +1 -2
  21. package/dist/agentic/guides/modules/catalog/entities.md +0 -1
  22. package/dist/agentic/guides/modules/catalog/exact-override-targets.md +4 -10
  23. package/dist/agentic/guides/modules/catalog/index.md +5 -5
  24. package/dist/agentic/guides/modules/catalog/umes-contributions.md +0 -2
  25. package/dist/agentic/guides/modules/catalog/umes-hosts.md +0 -1
  26. package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
  27. package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
  28. package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
  29. package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
  30. package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
  31. package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
  32. package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
  33. package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
  34. package/dist/agentic/guides/modules/checkout/index.md +1 -1
  35. package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
  36. package/dist/agentic/guides/modules/configs/index.md +1 -1
  37. package/dist/agentic/guides/modules/content/index.md +1 -1
  38. package/dist/agentic/guides/modules/currencies/index.md +1 -1
  39. package/dist/agentic/guides/modules/customer_accounts/index.md +2 -3
  40. package/dist/agentic/guides/modules/customer_groups/active-extension-bindings.md +1 -1
  41. package/dist/agentic/guides/modules/customer_groups/index.md +2 -3
  42. package/dist/agentic/guides/modules/customers/active-extension-bindings.md +5 -5
  43. package/dist/agentic/guides/modules/customers/di-registrations-rich.md +3 -5
  44. package/dist/agentic/guides/modules/customers/exact-override-targets.md +3 -5
  45. package/dist/agentic/guides/modules/customers/index.md +2 -2
  46. package/dist/agentic/guides/modules/customers/owned-contract-module-metadata.md +1 -1
  47. package/dist/agentic/guides/modules/customers/umes-hosts.md +0 -2
  48. package/dist/agentic/guides/modules/dashboards/index.md +1 -1
  49. package/dist/agentic/guides/modules/data_sync/di-registrations-rich.md +8 -8
  50. package/dist/agentic/guides/modules/data_sync/di-service-tokens.md +4 -4
  51. package/dist/agentic/guides/modules/data_sync/exact-override-targets.md +8 -8
  52. package/dist/agentic/guides/modules/data_sync/index.md +1 -1
  53. package/dist/agentic/guides/modules/design_system/index.md +1 -1
  54. package/dist/agentic/guides/modules/devices/index.md +1 -1
  55. package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
  56. package/dist/agentic/guides/modules/directory/index.md +1 -1
  57. package/dist/agentic/guides/modules/documents/index.md +1 -1
  58. package/dist/agentic/guides/modules/entities/index.md +1 -1
  59. package/dist/agentic/guides/modules/eudr/index.md +1 -1
  60. package/dist/agentic/guides/modules/events/index.md +1 -1
  61. package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
  62. package/dist/agentic/guides/modules/forms/index.md +1 -1
  63. package/dist/agentic/guides/modules/gateway_stripe/di-registrations-rich.md +1 -1
  64. package/dist/agentic/guides/modules/gateway_stripe/exact-override-targets.md +1 -1
  65. package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
  66. package/dist/agentic/guides/modules/generators/index.md +1 -1
  67. package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
  68. package/dist/agentic/guides/modules/integrations/index.md +1 -1
  69. package/dist/agentic/guides/modules/messages/index.md +1 -1
  70. package/dist/agentic/guides/modules/notifications/index.md +1 -1
  71. package/dist/agentic/guides/modules/onboarding/index.md +1 -1
  72. package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
  73. package/dist/agentic/guides/modules/perspectives/index.md +1 -1
  74. package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
  75. package/dist/agentic/guides/modules/planner/index.md +1 -1
  76. package/dist/agentic/guides/modules/portal/index.md +1 -1
  77. package/dist/agentic/guides/modules/portal/owned-contract-module-metadata.md +1 -1
  78. package/dist/agentic/guides/modules/progress/index.md +1 -1
  79. package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
  80. package/dist/agentic/guides/modules/query_index/index.md +1 -1
  81. package/dist/agentic/guides/modules/record_locks/index.md +1 -1
  82. package/dist/agentic/guides/modules/resources/index.md +1 -1
  83. package/dist/agentic/guides/modules/sales/index.md +1 -1
  84. package/dist/agentic/guides/modules/scheduler/exact-override-targets.md +1 -1
  85. package/dist/agentic/guides/modules/scheduler/index.md +1 -1
  86. package/dist/agentic/guides/modules/scheduler/workers.md +1 -1
  87. package/dist/agentic/guides/modules/search/index.md +1 -1
  88. package/dist/agentic/guides/modules/security/index.md +1 -1
  89. package/dist/agentic/guides/modules/seeds/index.md +1 -1
  90. package/dist/agentic/guides/modules/shipping_carriers/exact-override-targets.md +1 -1
  91. package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
  92. package/dist/agentic/guides/modules/shipping_carriers/workers.md +1 -1
  93. package/dist/agentic/guides/modules/sso/index.md +1 -1
  94. package/dist/agentic/guides/modules/staff/index.md +1 -1
  95. package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
  96. package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
  97. package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
  98. package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
  99. package/dist/agentic/guides/modules/telemetry/index.md +1 -1
  100. package/dist/agentic/guides/modules/tillio/index.md +1 -1
  101. package/dist/agentic/guides/modules/translations/index.md +1 -1
  102. package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
  103. package/dist/agentic/guides/modules/webhooks/exact-override-targets.md +2 -2
  104. package/dist/agentic/guides/modules/webhooks/index.md +1 -1
  105. package/dist/agentic/guides/modules/webhooks/workers.md +2 -2
  106. package/dist/agentic/guides/modules/wms/events.md +1 -2
  107. package/dist/agentic/guides/modules/wms/index.md +1 -1
  108. package/dist/agentic/guides/modules/wms/umes-hosts.md +0 -1
  109. package/dist/agentic/guides/modules/workflows/index.md +1 -1
  110. package/dist/agentic/guides/modules/workflows/owned-contract-module-metadata.md +1 -1
  111. package/dist/agentic/guides/reference-module-facts.json +25 -443
  112. package/dist/agentic/guides/reference-modules/example/active-extension-bindings.md +0 -2
  113. package/dist/agentic/guides/reference-modules/example/contribution-resolutions.md +4 -9
  114. package/dist/agentic/guides/reference-modules/example/di-registrations-rich.md +2 -3
  115. package/dist/agentic/guides/reference-modules/example/di-service-tokens.md +1 -1
  116. package/dist/agentic/guides/reference-modules/example/exact-override-targets.md +6 -12
  117. package/dist/agentic/guides/reference-modules/example/index.md +4 -4
  118. package/dist/agentic/guides/reference-modules/example/umes-contributions.md +5 -10
  119. package/dist/agentic/guides/reference-modules/example/umes-hosts.md +0 -1
  120. package/dist/agentic/guides/upstream/AGENTS.md +1 -1
  121. package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +0 -20
  122. package/dist/agentic/guides/upstream/manifest.json +3 -3
  123. package/dist/agentic/shared/AGENTS.md.template +0 -1
  124. package/dist/agentic/shared/ai/harness/README.md +2 -6
  125. package/dist/agentic/shared/ai/harness/RELEASE.md +4 -4
  126. package/dist/agentic/shared/ai/harness/cases.json +39 -371
  127. package/dist/agentic/shared/ai/harness/cases.schema.json +4 -4
  128. package/dist/agentic/shared/ai/harness/design-system-inventory.json +3 -63
  129. package/dist/agentic/shared/ai/harness/source-link-inventory.json +8 -316
  130. package/dist/agentic/shared/ai/harness/validators.json +1 -1
  131. package/dist/agentic/shared/ai/skills/om-integration-builder/references/provider-families.md +1 -1
  132. package/dist/agentic/shared/ai/skills/om-module-scaffold/SKILL.md +0 -2
  133. package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +9 -78
  134. package/dist/agentic/shared/scripts/execution-sandbox.mjs +7 -8
  135. package/dist/bin.js +0 -2
  136. package/dist/bin.js.map +2 -2
  137. package/dist/mercato.js +17 -87
  138. package/dist/mercato.js.map +2 -2
  139. package/package.json +7 -7
  140. package/src/__tests__/mercato.test.ts +0 -480
  141. package/src/bin.ts +0 -5
  142. package/src/mercato.ts +14 -104
  143. package/dist/agentic/guides/customers-calendar.md +0 -57
  144. package/dist/agentic/guides/module-tool.md +0 -35
  145. package/dist/agentic/guides/modules/customer_accounts/incoming-installed-contributions.md +0 -13
  146. package/dist/agentic/guides/modules/customer_groups/incoming-installed-contributions.md +0 -11
  147. package/dist/agentic/guides/modules/ecommerce/acl-features.md +0 -15
  148. package/dist/agentic/guides/modules/ecommerce/active-extension-bindings.md +0 -12
  149. package/dist/agentic/guides/modules/ecommerce/backend-pages.md +0 -12
  150. package/dist/agentic/guides/modules/ecommerce/contribution-resolutions.md +0 -32
  151. package/dist/agentic/guides/modules/ecommerce/di-registrations-rich.md +0 -11
  152. package/dist/agentic/guides/modules/ecommerce/di-service-tokens.md +0 -11
  153. package/dist/agentic/guides/modules/ecommerce/entities.md +0 -13
  154. package/dist/agentic/guides/modules/ecommerce/events.md +0 -22
  155. package/dist/agentic/guides/modules/ecommerce/exact-override-targets.md +0 -41
  156. package/dist/agentic/guides/modules/ecommerce/index.md +0 -26
  157. package/dist/agentic/guides/modules/ecommerce/notifications.md +0 -12
  158. package/dist/agentic/guides/modules/ecommerce/owned-contract-module-metadata.md +0 -11
  159. package/dist/agentic/guides/modules/ecommerce/search-entities.md +0 -11
  160. package/dist/agentic/guides/modules/ecommerce/setup.md +0 -11
  161. package/dist/agentic/guides/modules/ecommerce/umes-contributions.md +0 -32
  162. package/dist/agentic/guides/modules/ecommerce/umes-hosts.md +0 -27
  163. package/dist/agentic/guides/modules/gateway_tpay/acl-features.md +0 -12
  164. package/dist/agentic/guides/modules/gateway_tpay/cli-commands.md +0 -12
  165. package/dist/agentic/guides/modules/gateway_tpay/contribution-resolutions.md +0 -12
  166. package/dist/agentic/guides/modules/gateway_tpay/di-registrations-rich.md +0 -11
  167. package/dist/agentic/guides/modules/gateway_tpay/exact-override-targets.md +0 -17
  168. package/dist/agentic/guides/modules/gateway_tpay/index.md +0 -19
  169. package/dist/agentic/guides/modules/gateway_tpay/owned-contract-module-metadata.md +0 -11
  170. package/dist/agentic/guides/modules/gateway_tpay/setup.md +0 -11
  171. package/dist/agentic/guides/modules/gateway_tpay/umes-contributions.md +0 -12
  172. package/src/lib/__tests__/bin-next-subpath-hook.test.ts +0 -25
@@ -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": 32,
6
- "recordCount": 150,
7
- "sourceRequiredCount": 125,
8
- "readableCount": 150,
5
+ "ownerCount": 30,
6
+ "recordCount": 138,
7
+ "sourceRequiredCount": 113,
8
+ "readableCount": 138,
9
9
  "baselineSha": "f7c941570003f3abe920b1765995cbef98dcad0b"
10
10
  },
11
11
  "notCovered": [
@@ -113,308 +113,6 @@
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
- },
418
116
  {
419
117
  "referenceId": "guides/framework-contracts:node_modules/@open-mercato/shared/src/lib/commands/registry.ts",
420
118
  "requirement": "source-required",
@@ -1915,8 +1613,7 @@
1915
1613
  "resolvedPath": "src/modules/example/commands/interceptors.ts",
1916
1614
  "moduleId": "example",
1917
1615
  "capabilityIds": [
1918
- "commands.interceptors",
1919
- "umes.customers.calendar-event-types"
1616
+ "commands.interceptors"
1920
1617
  ],
1921
1618
  "presets": [
1922
1619
  "classic",
@@ -2287,8 +1984,7 @@
2287
1984
  "moduleId": "example",
2288
1985
  "capabilityIds": [
2289
1986
  "integrations.local-bundle",
2290
- "module.di-registration",
2291
- "umes.customers.calendar-event-types"
1987
+ "module.di-registration"
2292
1988
  ],
2293
1989
  "presets": [
2294
1990
  "classic",
@@ -2752,8 +2448,7 @@
2752
2448
  "moduleId": "example",
2753
2449
  "capabilityIds": [
2754
2450
  "integrations.local-bundle",
2755
- "module.di-registration",
2756
- "umes.customers.calendar-event-types"
2451
+ "module.di-registration"
2757
2452
  ],
2758
2453
  "presets": [
2759
2454
  "classic",
@@ -3071,8 +2766,7 @@
3071
2766
  "resolvedPath": "src/modules/example/commands/interceptors.ts",
3072
2767
  "moduleId": "example",
3073
2768
  "capabilityIds": [
3074
- "commands.interceptors",
3075
- "umes.customers.calendar-event-types"
2769
+ "commands.interceptors"
3076
2770
  ],
3077
2771
  "presets": [
3078
2772
  "classic",
@@ -3325,7 +3019,6 @@
3325
3019
  "resolvedPath": "src/modules/example/widgets/injection-table.ts",
3326
3020
  "moduleId": "example",
3327
3021
  "capabilityIds": [
3328
- "umes.customers.calendar-event-types",
3329
3022
  "umes.injection-table"
3330
3023
  ],
3331
3024
  "presets": [
@@ -3765,7 +3458,6 @@
3765
3458
  "resolvedPath": "src/modules/example/widgets/injection-table.ts",
3766
3459
  "moduleId": "example",
3767
3460
  "capabilityIds": [
3768
- "umes.customers.calendar-event-types",
3769
3461
  "umes.injection-table"
3770
3462
  ],
3771
3463
  "presets": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "catalog": {
4
- "expectedCaseCount": 239,
4
+ "expectedCaseCount": 237,
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 (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.
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.
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,8 +12,6 @@ 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
-
17
15
  ## Workflow
18
16
 
19
17
  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,79 +2906,13 @@ function buildRunnerInvocation({ runner, root, schemaPath, outputPath, model, re
2906
2906
  return { command: 'claude', args }
2907
2907
  }
2908
2908
 
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 }) {
2909
+ function runAgentOnce({ runner, root, schemaPath, prompt, timeout, model, reasoningEffort, writable, allowedReads = [], allowedWrites = [], immutableRoots = [], validateResponse = validateRoutingResponse }) {
2975
2910
  const canonicalRoot = fs.realpathSync(root)
2976
2911
  const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'om-harness-result-'))
2977
2912
  const outputPath = path.join(tempDir, 'structured.json')
2978
2913
  const isolatedSchemaPath = path.join(tempDir, 'output.schema.json')
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 })
2914
+ fs.copyFileSync(schemaPath, isolatedSchemaPath, fs.constants.COPYFILE_EXCL)
2915
+ fs.chmodSync(isolatedSchemaPath, 0o600)
2982
2916
  const invocation = buildRunnerInvocation({ runner, root: canonicalRoot, schemaPath: isolatedSchemaPath, outputPath, model, reasoningEffort, writable, allowedReads, allowedWrites, immutableRoots })
2983
2917
  const runnerEnv = narrowRunnerEnv(runner)
2984
2918
  if (runner === 'codex') {
@@ -3032,7 +2966,7 @@ function runAgentOnce({ runner, root, schemaPath, responseSchema, prompt, timeou
3032
2966
  })
3033
2967
  const processResult = spawnSync(contained.command, contained.args, {
3034
2968
  cwd: contained.cwd,
3035
- input: runner === 'codex' ? codexOutputPrompt(prompt, canonicalSchema) : prompt,
2969
+ input: prompt,
3036
2970
  encoding: 'utf8',
3037
2971
  timeout,
3038
2972
  maxBuffer: 8 * 1024 * 1024,
@@ -3045,9 +2979,8 @@ function runAgentOnce({ runner, root, schemaPath, responseSchema, prompt, timeou
3045
2979
  if (processResult.error) return { kind: 'environment-failure', durationMs, exitStatus: processResult.status, error: processResult.error.message, stdout: processResult.stdout ?? '' }
3046
2980
  if (processResult.status !== 0) return { kind: 'process-failure', durationMs, exitStatus: processResult.status, error: processFailureDiagnostic(runner, processResult), stdout: processResult.stdout ?? '' }
3047
2981
  try {
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)]
2982
+ const rawResponse = extractJsonCandidate(processResult.stdout ?? '', outputPath, runner)
2983
+ const schemaErrors = [...validateResponse(rawResponse), ...validateJsonSchema(rawResponse, readJson(schemaPath))]
3051
2984
  if (schemaErrors.length) return { kind: 'invalid-structured-output', durationMs, exitStatus: processResult.status, error: schemaErrors.join('; '), stdout: processResult.stdout ?? '' }
3052
2985
  const response = rawResponse
3053
2986
  for (const key of ['selectedRouter', 'selectedSkills', 'selectedContext', 'decisions', 'violations']) {
@@ -3735,7 +3668,6 @@ export function resolveLiveCaseTimeout(options, model, caseTimeout = 0) {
3735
3668
 
3736
3669
  function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, harnessDir, resultSchema }) {
3737
3670
  const schemaPath = path.join(harnessDir, 'routing-response.schema.json')
3738
- const routingResponseSchema = readJson(schemaPath)
3739
3671
  const version = runnerVersion(options.runner, root)
3740
3672
  const model = options.model ?? releaseMatrix.routing.runners[options.runner].modelSelector
3741
3673
  const writableRoot = options.writableRoot ? path.resolve(options.writableRoot) : undefined
@@ -3778,9 +3710,8 @@ function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, h
3778
3710
  // fail-closed tool server, so a declared example root can never be written.
3779
3711
  const immutableRoots = immutableExampleRoots(evaluationCase)
3780
3712
  const timeout = resolveLiveCaseTimeout(options, model, caseRecord.timeoutMs ?? 0)
3781
- const responseSchema = routingResponseSchemaForCase(routingResponseSchema, evaluationCase)
3782
3713
  const executions = [runAgentOnce({
3783
- runner: options.runner, root: runRoot, schemaPath, responseSchema, prompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3714
+ runner: options.runner, root: runRoot, schemaPath, prompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3784
3715
  allowedReads, allowedWrites: writable ? caseRecord.allowedWrites ?? [] : [], immutableRoots,
3785
3716
  })]
3786
3717
  let execution = executions[0]
@@ -3792,7 +3723,7 @@ function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, h
3792
3723
  ? `${prompt}\n\nYour previous response was not valid structured output. Return only the schema object.`
3793
3724
  : `${prompt}\n\nThis is retry attempt 2 after a transient provider failure. Continue with the same routing contract.`
3794
3725
  execution = runAgentOnce({
3795
- runner: options.runner, root: runRoot, schemaPath, responseSchema, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3726
+ runner: options.runner, root: runRoot, schemaPath, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3796
3727
  allowedReads, allowedWrites: writable ? caseRecord.allowedWrites ?? [] : [], immutableRoots,
3797
3728
  })
3798
3729
  executions.push(execution)
@@ -3856,7 +3787,7 @@ function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, h
3856
3787
  const diagnostics = routingCorrectionDiagnostics(evaluated.violations)
3857
3788
  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.`
3858
3789
  execution = runAgentOnce({
3859
- runner: options.runner, root: runRoot, schemaPath, responseSchema, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3790
+ runner: options.runner, root: runRoot, schemaPath, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
3860
3791
  allowedReads, allowedWrites: [], immutableRoots,
3861
3792
  })
3862
3793
  executions.push(execution)
@@ -69,17 +69,16 @@ export function collapseReadOnlyRoots(values) {
69
69
 
70
70
  export function linuxMergedUsrSymlinkArgs() {
71
71
  const aliases = [
72
- ['/bin', ['usr/bin']],
73
- ['/sbin', ['usr/sbin', 'usr/bin']],
74
- ['/lib', ['usr/lib']],
75
- ['/lib64', ['usr/lib64', 'usr/lib']],
72
+ ['/bin', 'usr/bin'],
73
+ ['/sbin', 'usr/sbin'],
74
+ ['/lib', 'usr/lib'],
75
+ ['/lib64', 'usr/lib64'],
76
76
  ]
77
- return aliases.flatMap(([alias, targets]) => {
77
+ return aliases.flatMap(([alias, expected]) => {
78
78
  try {
79
79
  const stat = fs.lstatSync(alias)
80
- const target = stat.isSymbolicLink() ? fs.readlinkSync(alias) : null
81
- return targets.includes(target)
82
- ? ['--symlink', target, alias]
80
+ return stat.isSymbolicLink() && fs.readlinkSync(alias) === expected
81
+ ? ['--symlink', expected, alias]
83
82
  : []
84
83
  } catch { return [] }
85
84
  })
package/dist/bin.js CHANGED
@@ -1,6 +1,5 @@
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";
4
3
  import { resolveCliBootstrapMode } from "./lib/cli-bootstrap-mode.js";
5
4
  import { flushBeforeExit } from "./lib/flush-before-exit.js";
6
5
  function assertNode24Runtime() {
@@ -49,7 +48,6 @@ async function tryBootstrap(mode) {
49
48
  }
50
49
  async function main() {
51
50
  assertNode24Runtime();
52
- installNextSubpathResolveHook();
53
51
  const bootstrapMode = resolveCliBootstrapMode(process.argv);
54
52
  if (bootstrapMode !== "none") {
55
53
  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 { 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;",
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;",
6
6
  "names": []
7
7
  }