@open-mercato/cli 0.6.7-develop.6863.1.61001cf9a8 → 0.6.7
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.
- package/.turbo/turbo-build.log +4 -4
- package/build.mjs +7 -24
- package/dist/agentic/claude-code/hooks/entity-migration-check.ts +88 -32
- package/dist/agentic/codex/enforcement-rules.md +16 -2
- package/dist/agentic/cursor/hooks/entity-migration-check.mjs +50 -19
- package/dist/agentic/cursor/rules/entity-guard.mdc +21 -9
- package/dist/agentic/cursor/rules/generated-guard.mdc +5 -3
- package/dist/agentic/cursor/rules/open-mercato.mdc +29 -3
- package/dist/agentic/guides/cache.md +45 -0
- package/dist/agentic/guides/core.md +453 -0
- package/dist/agentic/guides/events.md +117 -0
- package/dist/agentic/guides/module-facts.json +3833 -115419
- package/dist/agentic/guides/module-system.md +127 -12
- package/dist/agentic/guides/modules/ai_assistant.md +28 -227
- package/dist/agentic/guides/modules/api_docs.md +2 -58
- package/dist/agentic/guides/modules/api_keys.md +7 -92
- package/dist/agentic/guides/modules/attachments.md +14 -119
- package/dist/agentic/guides/modules/audit_logs.md +10 -131
- package/dist/agentic/guides/modules/auth.md +33 -276
- package/dist/agentic/guides/modules/business_rules.md +14 -149
- package/dist/agentic/guides/modules/catalog.md +43 -475
- package/dist/agentic/guides/modules/channel_gmail.md +3 -82
- package/dist/agentic/guides/modules/channel_imap.md +3 -82
- package/dist/agentic/guides/modules/checkout.md +27 -299
- package/dist/agentic/guides/modules/communication_channels.md +33 -315
- package/dist/agentic/guides/modules/configs.md +8 -104
- package/dist/agentic/guides/modules/content.md +2 -57
- package/dist/agentic/guides/modules/currencies.md +17 -152
- package/dist/agentic/guides/modules/customer_accounts.md +45 -387
- package/dist/agentic/guides/modules/customers.md +85 -746
- package/dist/agentic/guides/modules/dashboards.md +10 -155
- package/dist/agentic/guides/modules/data_sync.md +16 -149
- package/dist/agentic/guides/modules/dictionaries.md +12 -107
- package/dist/agentic/guides/modules/directory.md +15 -148
- package/dist/agentic/guides/modules/entities.md +13 -145
- package/dist/agentic/guides/modules/events.md +2 -59
- package/dist/agentic/guides/modules/feature_toggles.md +9 -119
- package/dist/agentic/guides/modules/gateway_stripe.md +4 -92
- package/dist/agentic/guides/modules/generators.md +2 -45
- package/dist/agentic/guides/modules/inbox_ops.md +27 -207
- package/dist/agentic/guides/modules/integrations.md +16 -146
- package/dist/agentic/guides/modules/messages.md +24 -223
- package/dist/agentic/guides/modules/notifications.md +8 -96
- package/dist/agentic/guides/modules/onboarding.md +6 -77
- package/dist/agentic/guides/modules/payment_gateways.md +21 -164
- package/dist/agentic/guides/modules/perspectives.md +7 -77
- package/dist/agentic/guides/modules/planner.md +18 -136
- package/dist/agentic/guides/modules/portal.md +2 -93
- package/dist/agentic/guides/modules/progress.md +14 -104
- package/dist/agentic/guides/modules/query_index.md +15 -154
- package/dist/agentic/guides/modules/record_locks.md +21 -206
- package/dist/agentic/guides/modules/resources.md +30 -197
- package/dist/agentic/guides/modules/sales.md +84 -678
- package/dist/agentic/guides/modules/scheduler.md +14 -133
- package/dist/agentic/guides/modules/search.md +6 -170
- package/dist/agentic/guides/modules/security.md +35 -294
- package/dist/agentic/guides/modules/shipping_carriers.md +18 -134
- package/dist/agentic/guides/modules/sso.md +26 -151
- package/dist/agentic/guides/modules/staff.md +57 -369
- package/dist/agentic/guides/modules/storage_s3.md +5 -95
- package/dist/agentic/guides/modules/sync_akeneo.md +3 -85
- package/dist/agentic/guides/modules/sync_excel.md +6 -75
- package/dist/agentic/guides/modules/system_status_overlays.md +2 -60
- package/dist/agentic/guides/modules/translations.md +10 -104
- package/dist/agentic/guides/modules/webhooks.md +24 -203
- package/dist/agentic/guides/modules/wms.md +46 -441
- package/dist/agentic/guides/modules/workflows.md +43 -302
- package/dist/agentic/guides/queue.md +53 -0
- package/dist/agentic/guides/search.md +115 -0
- package/dist/agentic/guides/shared.md +108 -0
- package/dist/agentic/guides/ui.md +347 -0
- package/dist/agentic/shared/AGENTS.md.template +311 -124
- package/dist/agentic/shared/ai/agentic.config.json +0 -2
- package/dist/agentic/shared/ai/lessons.md +3 -26
- package/dist/agentic/shared/ai/skills/om-auto-continue-pr-loop/SKILL.md +27 -0
- package/dist/agentic/shared/ai/skills/om-auto-create-pr-loop/SKILL.md +27 -0
- package/dist/agentic/shared/ai/skills/om-auto-review-pr/SKILL.md +0 -4
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/SKILL.md +241 -20
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/ui-components.md +260 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/SKILL.md +601 -16
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/mikro-orm-cheatsheet.md +146 -0
- package/dist/agentic/shared/ai/skills/om-eject-and-customize/SKILL.md +310 -14
- package/dist/agentic/shared/ai/skills/om-help/SKILL.md +97 -15
- package/dist/agentic/shared/ai/skills/om-help/references/skills-catalog.md +84 -0
- package/dist/agentic/shared/ai/skills/om-help/references/workflow-sequences.md +193 -0
- package/dist/agentic/shared/ai/skills/om-implement-spec/SKILL.md +152 -33
- package/dist/agentic/shared/ai/skills/om-integration-builder/SKILL.md +708 -24
- package/dist/agentic/shared/ai/skills/om-integration-builder/STANDALONE.md +34 -0
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/adapter-contracts.md +762 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/SKILL.md +820 -20
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/naming-conventions.md +50 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/navigation-patterns.md +97 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/SKILL.md +843 -19
- package/dist/agentic/shared/ai/skills/om-system-extension/references/extension-contracts.md +271 -0
- package/dist/agentic/shared/ai/skills/om-trim-unused-modules/SKILL.md +63 -15
- package/dist/agentic/shared/ai/skills/om-troubleshooter/SKILL.md +467 -16
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/diagnostic-commands.md +101 -0
- package/dist/agentic/shared/ai/skills/tiers.json +21 -143
- package/dist/agentic/shared/ai/skills/tiers.schema.json +40 -52
- package/dist/agentic/shared/ai/specs/README.md +3 -4
- package/dist/agentic/shared/ai/specs/SPEC-000-template.md +10 -226
- package/dist/agentic/shared/ai/trackers/github.md +4 -108
- package/dist/agentic/shared/scripts/install-skills.sh +694 -4
- package/dist/bin.js +1 -13
- package/dist/bin.js.map +2 -2
- package/dist/lib/__integration__/TC-INT-008.spec.js +8 -88
- package/dist/lib/__integration__/TC-INT-008.spec.js.map +2 -2
- package/dist/lib/agentic-init.js +3 -13
- package/dist/lib/agentic-init.js.map +2 -2
- package/dist/lib/agentic-setup.js +186 -418
- package/dist/lib/agentic-setup.js.map +2 -2
- package/dist/lib/generators/extensions/injection-widgets.js +0 -20
- package/dist/lib/generators/extensions/injection-widgets.js.map +2 -2
- package/dist/lib/generators/module-facts-discovery.js +7 -41
- package/dist/lib/generators/module-facts-discovery.js.map +2 -2
- package/dist/lib/generators/module-facts.js +45 -1387
- package/dist/lib/generators/module-facts.js.map +3 -3
- package/dist/lib/generators/module-registry.js +5 -11
- package/dist/lib/generators/module-registry.js.map +2 -2
- package/dist/lib/resolver.js +0 -2
- package/dist/lib/resolver.js.map +2 -2
- package/dist/lib/testing/integration.js +0 -5
- package/dist/lib/testing/integration.js.map +2 -2
- package/dist/mercato.js +1 -23
- package/dist/mercato.js.map +2 -2
- package/package.json +11 -13
- package/src/bin.ts +1 -33
- package/src/lib/__integration__/TC-INT-008.spec.ts +9 -107
- package/src/lib/__tests__/agentic-init.test.ts +5 -41
- package/src/lib/agentic-init.ts +3 -15
- package/src/lib/agentic-setup.ts +224 -530
- package/src/lib/generators/__tests__/module-facts.bc-guard.test.ts +2 -88
- package/src/lib/generators/__tests__/module-facts.customers.fixture.test.ts +0 -1
- package/src/lib/generators/__tests__/module-facts.discovery.test.ts +10 -54
- package/src/lib/generators/__tests__/module-subset.test.ts +0 -18
- package/src/lib/generators/extensions/injection-widgets.ts +0 -51
- package/src/lib/generators/module-facts-discovery.ts +7 -58
- package/src/lib/generators/module-facts.ts +46 -1851
- package/src/lib/generators/module-registry.ts +6 -16
- package/src/lib/resolver.ts +0 -3
- package/src/lib/testing/__tests__/integration.test.ts +0 -4
- package/src/lib/testing/integration.ts +0 -5
- package/src/mercato.ts +1 -26
- package/dist/agentic/guides/ai-workflows.md +0 -76
- package/dist/agentic/guides/architecture.md +0 -107
- package/dist/agentic/guides/backend-ui.md +0 -80
- package/dist/agentic/guides/contracts.md +0 -92
- package/dist/agentic/guides/extensions.md +0 -121
- package/dist/agentic/guides/framework-extension-points.md +0 -36
- package/dist/agentic/guides/integrations.md +0 -81
- package/dist/agentic/guides/modules/design_system.md +0 -102
- package/dist/agentic/guides/spec-delivery.md +0 -22
- package/dist/agentic/guides/testing-debugging.md +0 -80
- package/dist/agentic/guides/upstream/AGENTS.md +0 -298
- package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +0 -316
- package/dist/agentic/guides/upstream/manifest.json +0 -8
- package/dist/agentic/shared/ai/harness/README.md +0 -50
- package/dist/agentic/shared/ai/harness/RELEASE.md +0 -57
- package/dist/agentic/shared/ai/harness/cases.json +0 -13680
- package/dist/agentic/shared/ai/harness/cases.schema.json +0 -133
- package/dist/agentic/shared/ai/harness/fixtures/index.json +0 -49
- package/dist/agentic/shared/ai/harness/fixtures/seeds.json +0 -162
- package/dist/agentic/shared/ai/harness/generated-code-review-policy.md +0 -21
- package/dist/agentic/shared/ai/harness/generated-code-review-response.schema.json +0 -96
- package/dist/agentic/shared/ai/harness/generated-code-review-result.schema.json +0 -172
- package/dist/agentic/shared/ai/harness/release-matrix.json +0 -158
- package/dist/agentic/shared/ai/harness/release-result.schema.json +0 -219
- package/dist/agentic/shared/ai/harness/result.schema.json +0 -76
- package/dist/agentic/shared/ai/harness/routing-response.schema.json +0 -12
- package/dist/agentic/shared/ai/harness/target-validation-result.schema.json +0 -73
- package/dist/agentic/shared/ai/harness/validators.json +0 -78
- package/dist/agentic/shared/ai/harness/writable-ast-oracles.mjs +0 -2121
- package/dist/agentic/shared/ai/harness/writable-behavior-oracles.mjs +0 -1096
- package/dist/agentic/shared/ai/lessons/_template.md +0 -16
- package/dist/agentic/shared/ai/review-checklist.md +0 -36
- package/dist/agentic/shared/ai/skills/om-auto-implement-spec/SKILL.md +0 -21
- package/dist/agentic/shared/ai/skills/om-auto-upgrade-0.6.6-to-0.6.7/SKILL.md +0 -98
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/crud-surfaces.md +0 -16
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/frontend-and-design-system.md +0 -53
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/page-and-navigation.md +0 -13
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/quality-states.md +0 -11
- package/dist/agentic/shared/ai/skills/om-build-workflow/SKILL.md +0 -30
- package/dist/agentic/shared/ai/skills/om-build-workflow/references/activity-contracts.md +0 -12
- package/dist/agentic/shared/ai/skills/om-build-workflow/references/durability-and-progress.md +0 -13
- package/dist/agentic/shared/ai/skills/om-build-workflow/references/workflow-design.md +0 -14
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/SKILL.md +0 -28
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/attachments-and-overrides.md +0 -12
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/module-agents-and-tools.md +0 -22
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/orchestrator-agents.md +0 -12
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/surface-selector.md +0 -19
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/integrity-and-concurrency.md +0 -19
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/migration-workflow.md +0 -13
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/schema-design.md +0 -14
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/sensitive-data.md +0 -10
- package/dist/agentic/shared/ai/skills/om-eject-and-customize/references/decision-and-procedure.md +0 -17
- package/dist/agentic/shared/ai/skills/om-evolve-harness/SKILL.md +0 -29
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/case-template.md +0 -100
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/case-workflow.md +0 -16
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/owner-selection.md +0 -17
- package/dist/agentic/shared/ai/skills/om-framework-context/SKILL.md +0 -25
- package/dist/agentic/shared/ai/skills/om-framework-context/references/resolver-procedure.md +0 -11
- package/dist/agentic/shared/ai/skills/om-framework-context/references/skew-and-escalation.md +0 -13
- package/dist/agentic/shared/ai/skills/om-help/references/delivery-workflows.md +0 -18
- package/dist/agentic/shared/ai/skills/om-help/references/task-families.md +0 -20
- package/dist/agentic/shared/ai/skills/om-implement-spec/references/phases-and-gates.md +0 -33
- package/dist/agentic/shared/ai/skills/om-implement-spec/references/planning-and-progress.md +0 -40
- package/dist/agentic/shared/ai/skills/om-implement-spec/references/report-templates.md +0 -27
- package/dist/agentic/shared/ai/skills/om-implement-spec/references/spec-resolution.md +0 -24
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/package-and-activation.md +0 -16
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/provider-families.md +0 -14
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/security-and-reliability.md +0 -15
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/sync-and-files.md +0 -12
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/SKILL.md +0 -34
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/agents/openai.yaml +0 -4
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/agentic-setup.md +0 -11
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/input-normalization.md +0 -31
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/judge-workflow.md +0 -39
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/report-template.md +0 -43
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/rules.md +0 -11
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/api-and-domain.md +0 -19
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/business-one-shot-blueprints.md +0 -172
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/data-and-migrations.md +0 -12
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/discovery-surface-catalog.md +0 -83
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/module-surfaces.md +0 -21
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/planning.md +0 -11
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/runtime-cache-and-queues.md +0 -22
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/verification.md +0 -13
- package/dist/agentic/shared/ai/skills/om-share-this-session/SKILL.md +0 -41
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/agentic-setup.md +0 -19
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/bundle-preparation.md +0 -44
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/consent-and-review.md +0 -39
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/publication.md +0 -20
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/report-templates.md +0 -57
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/rules.md +0 -11
- package/dist/agentic/shared/ai/skills/om-share-this-session/scripts/prepare-share-bundle.mjs +0 -486
- package/dist/agentic/shared/ai/skills/om-system-extension/references/extension-branches.md +0 -18
- package/dist/agentic/shared/ai/skills/om-system-extension/references/mechanism-selector.md +0 -27
- package/dist/agentic/shared/ai/skills/om-system-extension/references/read-write-roundtrip.md +0 -13
- package/dist/agentic/shared/ai/skills/om-system-extension/references/unified-overrides.md +0 -41
- package/dist/agentic/shared/ai/skills/om-system-extension/references/verification.md +0 -11
- package/dist/agentic/shared/ai/skills/om-trim-unused-modules/references/dependency-and-redirect.md +0 -15
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/diagnosis-map.md +0 -16
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/regression-oracles.md +0 -14
- package/dist/agentic/shared/scripts/agent-harness-tool-server.mjs +0 -187
- package/dist/agentic/shared/scripts/check-lessons.mjs +0 -178
- package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +0 -2958
- package/dist/agentic/shared/scripts/execution-sandbox.mjs +0 -329
- package/dist/agentic/shared/scripts/framework-context.mjs +0 -888
- package/dist/agentic/shared/scripts/install-skills.mjs +0 -1029
- package/dist/agentic/shared/scripts/prepare-agent-harness-fixture.mjs +0 -222
- package/dist/agentic/shared/scripts/run-agent-harness-release.mjs +0 -1774
- package/dist/lib/generators/module-extension-facts.js +0 -1840
- package/dist/lib/generators/module-extension-facts.js.map +0 -7
- package/dist/lib/generators/module-fact-sources.js +0 -70
- package/dist/lib/generators/module-fact-sources.js.map +0 -7
- package/dist/lib/generators/module-override-targets.js +0 -688
- package/dist/lib/generators/module-override-targets.js.map +0 -7
- package/dist/lib/load-env.js +0 -24
- package/dist/lib/load-env.js.map +0 -7
- package/dist/lib/telemetry-init.js +0 -358
- package/dist/lib/telemetry-init.js.map +0 -7
- package/src/lib/__tests__/agentic-setup.ownership.test.ts +0 -386
- package/src/lib/__tests__/injection-widget-id-validation.test.ts +0 -184
- package/src/lib/__tests__/load-env.test.ts +0 -65
- package/src/lib/__tests__/telemetry-init.test.ts +0 -298
- package/src/lib/generators/__tests__/activation-adapter-coverage.test.ts +0 -92
- package/src/lib/generators/__tests__/module-extension-activations.test.ts +0 -762
- package/src/lib/generators/__tests__/module-extension-facts.test.ts +0 -404
- package/src/lib/generators/__tests__/module-facts.extension-hosts.test.ts +0 -108
- package/src/lib/generators/__tests__/module-facts.owned-contracts.test.ts +0 -561
- package/src/lib/generators/__tests__/module-facts.source-links.test.ts +0 -119
- package/src/lib/generators/__tests__/module-override-targets.roundtrip.test.ts +0 -149
- package/src/lib/generators/__tests__/module-override-targets.test.ts +0 -304
- package/src/lib/generators/module-extension-facts.ts +0 -2365
- package/src/lib/generators/module-fact-sources.ts +0 -108
- package/src/lib/generators/module-override-targets.ts +0 -863
- package/src/lib/load-env.ts +0 -30
- package/src/lib/telemetry-init.ts +0 -461
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/cli",
|
|
3
|
-
"version": "0.6.7
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -56,13 +56,12 @@
|
|
|
56
56
|
"node": "24.x"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@mikro-orm/core": "^7.1.
|
|
60
|
-
"@mikro-orm/decorators": "^7.1.
|
|
61
|
-
"@mikro-orm/migrations": "^7.1.
|
|
62
|
-
"@mikro-orm/postgresql": "^7.1.
|
|
63
|
-
"@open-mercato/queue": "0.6.7
|
|
64
|
-
"@open-mercato/shared": "0.6.7
|
|
65
|
-
"@open-mercato/telemetry": "0.6.7-develop.6863.1.61001cf9a8",
|
|
59
|
+
"@mikro-orm/core": "^7.1.5",
|
|
60
|
+
"@mikro-orm/decorators": "^7.1.5",
|
|
61
|
+
"@mikro-orm/migrations": "^7.1.5",
|
|
62
|
+
"@mikro-orm/postgresql": "^7.1.5",
|
|
63
|
+
"@open-mercato/queue": "0.6.7",
|
|
64
|
+
"@open-mercato/shared": "0.6.7",
|
|
66
65
|
"cross-spawn": "^7.0.6",
|
|
67
66
|
"pg": "8.22.0",
|
|
68
67
|
"semver": "^7.8.5",
|
|
@@ -73,13 +72,13 @@
|
|
|
73
72
|
"typescript-js": "npm:typescript@6.0.3"
|
|
74
73
|
},
|
|
75
74
|
"peerDependencies": {
|
|
76
|
-
"@open-mercato/shared": "0.6.7
|
|
75
|
+
"@open-mercato/shared": "0.6.7"
|
|
77
76
|
},
|
|
78
77
|
"devDependencies": {
|
|
79
|
-
"@open-mercato/shared": "0.6.7
|
|
78
|
+
"@open-mercato/shared": "0.6.7",
|
|
80
79
|
"@types/jest": "^30.0.0",
|
|
81
80
|
"jest": "^30.4.2",
|
|
82
|
-
"ts-jest": "^29.4.
|
|
81
|
+
"ts-jest": "^29.4.11"
|
|
83
82
|
},
|
|
84
83
|
"publishConfig": {
|
|
85
84
|
"access": "public"
|
|
@@ -88,6 +87,5 @@
|
|
|
88
87
|
"type": "git",
|
|
89
88
|
"url": "https://github.com/open-mercato/open-mercato",
|
|
90
89
|
"directory": "packages/cli"
|
|
91
|
-
}
|
|
92
|
-
"stableVersion": "0.6.6"
|
|
90
|
+
}
|
|
93
91
|
}
|
package/src/bin.ts
CHANGED
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
* Called from within a Next.js app directory as: yarn mercato <command>
|
|
5
5
|
* Uses dynamic app resolution to find generated files at .mercato/generated/
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
getTelemetryRuntime,
|
|
9
|
-
isTelemetryBackendEnabled,
|
|
10
|
-
} from '@open-mercato/shared/lib/telemetry/runtime'
|
|
11
|
-
// `run` is imported dynamically inside `main()` so telemetry can initialize
|
|
12
|
-
// before the mercato entry (and its Postgres driver) loads — see main().
|
|
7
|
+
import { run } from './mercato.js'
|
|
13
8
|
|
|
14
9
|
// Commands that can run without bootstrap (without generated files)
|
|
15
10
|
// - generate: creates the generated files
|
|
@@ -23,7 +18,6 @@ const BOOTSTRAP_FREE_COMMANDS = [
|
|
|
23
18
|
'db',
|
|
24
19
|
'init',
|
|
25
20
|
'agentic:init',
|
|
26
|
-
'telemetry',
|
|
27
21
|
'eject',
|
|
28
22
|
'test',
|
|
29
23
|
'test:integration',
|
|
@@ -91,26 +85,6 @@ async function main(): Promise<void> {
|
|
|
91
85
|
const requiresBootstrap = needsBootstrap(process.argv)
|
|
92
86
|
|
|
93
87
|
if (requiresBootstrap) {
|
|
94
|
-
// Load the app's `.env` BEFORE initTelemetry(): `run()` only dotenv-loads it
|
|
95
|
-
// later (ensureEnvLoaded), which is too late — TELEMETRY_BACKEND set only in
|
|
96
|
-
// `.env` would silently resolve to `noop` for worker/scheduler processes.
|
|
97
|
-
// The loader touches only the resolver + dotenv (no `pg`), preserving the
|
|
98
|
-
// instrumentation load-order guarantee below.
|
|
99
|
-
const { loadAppEnv } = await import('./lib/load-env.js')
|
|
100
|
-
await loadAppEnv()
|
|
101
|
-
|
|
102
|
-
// Initialize telemetry BEFORE bootstrapping the app graph. Bootstrap and the
|
|
103
|
-
// per-command handlers load MikroORM's Postgres driver → `pg`, and the
|
|
104
|
-
// OpenTelemetry pg/undici auto-instrumentation only records spans for a
|
|
105
|
-
// driver required AFTER the SDK has started. Registering here — ahead of any
|
|
106
|
-
// app module — is what lets long-running worker/scheduler processes emit DB
|
|
107
|
-
// spans (not just the bullmq-otel add/process envelope). The package itself
|
|
108
|
-
// is not imported unless an explicit supported backend is selected.
|
|
109
|
-
if (isTelemetryBackendEnabled()) {
|
|
110
|
-
const { initTelemetry } = await import('@open-mercato/telemetry')
|
|
111
|
-
await initTelemetry()
|
|
112
|
-
}
|
|
113
|
-
|
|
114
88
|
const bootstrapSucceeded = await tryBootstrap()
|
|
115
89
|
if (!bootstrapSucceeded) {
|
|
116
90
|
console.error('╔═══════════════════════════════════════════════════════════════════╗')
|
|
@@ -126,13 +100,7 @@ async function main(): Promise<void> {
|
|
|
126
100
|
}
|
|
127
101
|
}
|
|
128
102
|
|
|
129
|
-
// Dynamic import (not a top-level static import) so the mercato entry — and the
|
|
130
|
-
// Postgres driver it pulls in — loads only after initTelemetry() above.
|
|
131
|
-
const { run } = await import('./mercato.js')
|
|
132
103
|
const code = await run(process.argv)
|
|
133
|
-
// Flush spans/logs for commands that return (workers block forever and flush via
|
|
134
|
-
// their own shutdown handler instead).
|
|
135
|
-
await getTelemetryRuntime()?.shutdown()
|
|
136
104
|
process.exit(code ?? 0)
|
|
137
105
|
}
|
|
138
106
|
|
|
@@ -14,8 +14,6 @@ const cliIntegrationRunnerPath = path.join(cliDir, 'src', 'lib', 'testing', 'int
|
|
|
14
14
|
const standaloneTemplatePackageJsonPath = path.join(repoRoot, 'packages', 'create-app', 'template', 'package.json.template')
|
|
15
15
|
const agenticRoot = path.join(repoRoot, 'packages', 'create-app', 'agentic')
|
|
16
16
|
const packagesRoot = path.join(repoRoot, 'packages')
|
|
17
|
-
const coreVersion = JSON.parse(fs.readFileSync(path.join(packagesRoot, 'core', 'package.json'), 'utf8')).version as string
|
|
18
|
-
const UNROUTED_PACKAGE_GUIDES = new Set(['cache', 'core', 'events', 'queue', 'search', 'shared', 'ui'])
|
|
19
17
|
|
|
20
18
|
// Modules the standalone fixture enables in src/modules.ts. Both are on the
|
|
21
19
|
// fact-sheet allowlist, so agentic:init must ship exactly their fact-sheets
|
|
@@ -26,7 +24,7 @@ function normalizePath(value: string): string {
|
|
|
26
24
|
return value.split(path.sep).join('/')
|
|
27
25
|
}
|
|
28
26
|
|
|
29
|
-
function runCommand(command: string, args: string[], cwd: string
|
|
27
|
+
function runCommand(command: string, args: string[], cwd: string): string {
|
|
30
28
|
return execFileSync(command, args, {
|
|
31
29
|
cwd,
|
|
32
30
|
encoding: 'utf8',
|
|
@@ -38,7 +36,6 @@ function runCommand(command: string, args: string[], cwd: string, env: NodeJS.Pr
|
|
|
38
36
|
// whose external step (`npx skills add`) needs the network. Local tier
|
|
39
37
|
// symlinks are still installed.
|
|
40
38
|
OM_SKIP_EXTERNAL_SKILLS: '1',
|
|
41
|
-
...env,
|
|
42
39
|
},
|
|
43
40
|
})
|
|
44
41
|
}
|
|
@@ -64,48 +61,16 @@ function createStandaloneFixture(rootDir: string): string {
|
|
|
64
61
|
{
|
|
65
62
|
name: 'sample-store',
|
|
66
63
|
private: true,
|
|
67
|
-
dependencies: { '@open-mercato/core': coreVersion },
|
|
68
64
|
},
|
|
69
65
|
null,
|
|
70
66
|
2,
|
|
71
67
|
),
|
|
72
68
|
)
|
|
73
|
-
const moduleEntries = FIXTURE_ENABLED_MODULES
|
|
74
|
-
.map((moduleId) => ` { id: '${moduleId}', from: '@open-mercato/core' },`)
|
|
75
|
-
.join('\n')
|
|
69
|
+
const moduleEntries = FIXTURE_ENABLED_MODULES.map((moduleId) => ` { id: '${moduleId}' },`).join('\n')
|
|
76
70
|
writeFile(path.join(appDir, 'src', 'modules.ts'), `export const enabledModules = [\n${moduleEntries}\n]\n`)
|
|
77
71
|
return appDir
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
function installFakeFrameworkPackage(appDir: string): string {
|
|
81
|
-
const packageRoot = path.join(appDir, 'node_modules', '@open-mercato', 'core')
|
|
82
|
-
writeFile(path.join(packageRoot, 'package.json'), JSON.stringify({
|
|
83
|
-
name: '@open-mercato/core',
|
|
84
|
-
version: coreVersion,
|
|
85
|
-
type: 'module',
|
|
86
|
-
exports: { '.': './dist/index.js' },
|
|
87
|
-
}))
|
|
88
|
-
writeFile(path.join(packageRoot, 'dist', 'index.js'), 'export {}\n')
|
|
89
|
-
writeFile(path.join(packageRoot, 'AGENTS.md'), '# Installed core instructions\n')
|
|
90
|
-
for (const moduleId of FIXTURE_ENABLED_MODULES) {
|
|
91
|
-
writeFile(path.join(packageRoot, 'src', 'modules', moduleId, 'AGENTS.md'), `# Installed ${moduleId} instructions\n`)
|
|
92
|
-
writeFile(
|
|
93
|
-
path.join(packageRoot, 'src', 'modules', moduleId, 'data', 'entities.ts'),
|
|
94
|
-
`export class ${moduleId === 'customers' ? 'Person' : 'Sale'} {}\n`,
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
return packageRoot
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function snapshotTextFiles(rootDir: string): Record<string, string> {
|
|
101
|
-
return Object.fromEntries(
|
|
102
|
-
listRelativeFiles(rootDir).map((relativePath) => [
|
|
103
|
-
relativePath,
|
|
104
|
-
fs.readFileSync(path.join(rootDir, relativePath), 'utf8'),
|
|
105
|
-
]),
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
74
|
function listRelativeFiles(rootDir: string): string[] {
|
|
110
75
|
if (!fs.existsSync(rootDir)) {
|
|
111
76
|
return []
|
|
@@ -229,7 +194,7 @@ function expectedGuideOutputNames(): string[] {
|
|
|
229
194
|
|
|
230
195
|
for (const packageName of fs.readdirSync(packagesRoot)) {
|
|
231
196
|
const packageGuide = path.join(packagesRoot, packageName, 'agentic', 'standalone-guide.md')
|
|
232
|
-
if (fs.existsSync(packageGuide)
|
|
197
|
+
if (fs.existsSync(packageGuide)) {
|
|
233
198
|
collected.add(`${packageName}.md`)
|
|
234
199
|
}
|
|
235
200
|
|
|
@@ -249,14 +214,8 @@ function expectedGuideOutputNames(): string[] {
|
|
|
249
214
|
// Generated fact-sheet artifacts (spec 2026-06-27-ts-morph-module-fact-sheets):
|
|
250
215
|
// the module-facts.json sidecar is copied as-is and fact-sheets are filtered to the
|
|
251
216
|
// fixture's enabled modules. The legacy core.<module>.md redirect stubs are no longer
|
|
252
|
-
// emitted (#3754).
|
|
253
|
-
// dist/agentic/guides by both build.mjs pipelines (#4810) rather than checked in
|
|
254
|
-
// alongside the static conceptual guides, so it needs an explicit entry here.
|
|
217
|
+
// emitted (#3754).
|
|
255
218
|
collected.add('module-facts.json')
|
|
256
|
-
collected.add('framework-extension-points.md')
|
|
257
|
-
collected.add('upstream/AGENTS.md')
|
|
258
|
-
collected.add('upstream/BACKWARD_COMPATIBILITY.md')
|
|
259
|
-
collected.add('upstream/manifest.json')
|
|
260
219
|
for (const moduleId of FIXTURE_ENABLED_MODULES) {
|
|
261
220
|
collected.add(normalizePath(path.join('modules', `${moduleId}.md`)))
|
|
262
221
|
}
|
|
@@ -303,17 +262,14 @@ test.describe('TC-INT-008: CLI agentic init mirrors standalone scaffolding asset
|
|
|
303
262
|
|
|
304
263
|
const agentsSource = fs.readFileSync(path.join(appDir, 'AGENTS.md'), 'utf8')
|
|
305
264
|
expect(agentsSource).toContain('<!-- CODEX_ENFORCEMENT_RULES_START -->')
|
|
306
|
-
expect(agentsSource).toContain('.ai/guides/
|
|
265
|
+
expect(agentsSource).toContain('.ai/guides/core.md')
|
|
307
266
|
|
|
308
|
-
// The Module-Specific Guides marker block
|
|
309
|
-
//
|
|
267
|
+
// The Module-Specific Guides marker block lists exactly the enabled modules'
|
|
268
|
+
// fact-sheets (enabled ∩ allowlist), not the full bundled set.
|
|
310
269
|
for (const moduleId of FIXTURE_ENABLED_MODULES) {
|
|
311
|
-
expect(agentsSource).toContain(
|
|
270
|
+
expect(agentsSource).toContain(`.ai/guides/modules/${moduleId}.md`)
|
|
312
271
|
}
|
|
313
|
-
expect(agentsSource).toContain('
|
|
314
|
-
expect(agentsSource.match(/\.ai\/guides\/modules\//g)).toHaveLength(1)
|
|
315
|
-
expect(agentsSource).not.toContain('`auth`')
|
|
316
|
-
expect(agentsSource).not.toContain('Core CRM capabilities')
|
|
272
|
+
expect(agentsSource).not.toContain('.ai/guides/modules/auth.md')
|
|
317
273
|
|
|
318
274
|
const specsReadmeSource = fs.readFileSync(path.join(appDir, '.ai', 'specs', 'README.md'), 'utf8')
|
|
319
275
|
expect(specsReadmeSource).toContain('sample-store')
|
|
@@ -352,58 +308,4 @@ test.describe('TC-INT-008: CLI agentic init mirrors standalone scaffolding asset
|
|
|
352
308
|
fs.rmSync(tempRoot, { recursive: true, force: true })
|
|
353
309
|
}
|
|
354
310
|
})
|
|
355
|
-
|
|
356
|
-
test('emits a runnable exact-version framework context escape hatch for an installed package', () => {
|
|
357
|
-
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'mercato-cli-framework-context-'))
|
|
358
|
-
|
|
359
|
-
try {
|
|
360
|
-
const appDir = createStandaloneFixture(tempRoot)
|
|
361
|
-
const packageRoot = installFakeFrameworkPackage(appDir)
|
|
362
|
-
const resolvedPackageRoot = fs.realpathSync(packageRoot)
|
|
363
|
-
const packageBefore = snapshotTextFiles(packageRoot)
|
|
364
|
-
|
|
365
|
-
runMercato(['agentic:init', '--tool=codex'], appDir)
|
|
366
|
-
const generatedScript = path.join(appDir, 'scripts', 'framework-context.mjs')
|
|
367
|
-
expect(fs.existsSync(generatedScript)).toBe(true)
|
|
368
|
-
|
|
369
|
-
const output = runCommand(
|
|
370
|
-
process.execPath,
|
|
371
|
-
[generatedScript, '--module', 'customers', '--query', 'Person', '--json'],
|
|
372
|
-
appDir,
|
|
373
|
-
// The generated standalone helper must not depend on a globally
|
|
374
|
-
// installed ripgrep binary; process.execPath is already absolute.
|
|
375
|
-
{ PATH: '', Path: '' },
|
|
376
|
-
)
|
|
377
|
-
const context = JSON.parse(output) as {
|
|
378
|
-
module: string
|
|
379
|
-
package: { name: string; version: string; root: string }
|
|
380
|
-
sourceKind: string
|
|
381
|
-
sourceRoot: string
|
|
382
|
-
materializedSource: string
|
|
383
|
-
instructions: Array<{ kind: string; path: string | null; materializedPath?: string }>
|
|
384
|
-
boundedSearch: { status: string; matches: number; maxMatches: number; result: string }
|
|
385
|
-
warnings: string[]
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
expect(context.module).toBe('customers')
|
|
389
|
-
expect(context.package).toEqual({ name: '@open-mercato/core', version: coreVersion, root: resolvedPackageRoot })
|
|
390
|
-
expect(context.sourceKind).toBe('source')
|
|
391
|
-
expect(normalizePath(context.sourceRoot)).toBe(normalizePath(path.join(resolvedPackageRoot, 'src', 'modules', 'customers')))
|
|
392
|
-
expect(context.instructions.filter((entry) => entry.path).map((entry) => entry.kind)).toEqual([
|
|
393
|
-
'standalone-root',
|
|
394
|
-
'upstream-bc',
|
|
395
|
-
'package',
|
|
396
|
-
'module-1',
|
|
397
|
-
'upstream-root',
|
|
398
|
-
])
|
|
399
|
-
expect(context.instructions.filter((entry) => entry.path).every((entry) => entry.materializedPath)).toBe(true)
|
|
400
|
-
expect(context.boundedSearch).toMatchObject({ status: 'matched', matches: 1, maxMatches: 200 })
|
|
401
|
-
expect(fs.existsSync(path.join(appDir, context.materializedSource))).toBe(true)
|
|
402
|
-
expect(fs.existsSync(path.join(appDir, context.boundedSearch.result))).toBe(true)
|
|
403
|
-
expect(context.warnings.some((warning) => warning.includes('Generated facts for customers are stale'))).toBe(false)
|
|
404
|
-
expect(snapshotTextFiles(packageRoot)).toEqual(packageBefore)
|
|
405
|
-
} finally {
|
|
406
|
-
fs.rmSync(tempRoot, { recursive: true, force: true })
|
|
407
|
-
}
|
|
408
|
-
})
|
|
409
311
|
})
|
|
@@ -17,11 +17,7 @@ const loadRunAgenticInit = async ({
|
|
|
17
17
|
}: {
|
|
18
18
|
existingPaths: Set<string>
|
|
19
19
|
questionAnswer?: string
|
|
20
|
-
runAgenticSetupImplementation?: (
|
|
21
|
-
targetDir: string,
|
|
22
|
-
ask: (question: string) => Promise<string>,
|
|
23
|
-
options?: { tool?: string; force?: boolean; updateHarness?: boolean },
|
|
24
|
-
) => Promise<void>
|
|
20
|
+
runAgenticSetupImplementation?: (targetDir: string, ask: (question: string) => Promise<string>, options?: { tool?: string; force?: boolean }) => Promise<void>
|
|
25
21
|
}): Promise<AgenticInitTestContext> => {
|
|
26
22
|
jest.resetModules()
|
|
27
23
|
|
|
@@ -140,22 +136,6 @@ describe('runAgenticInit', () => {
|
|
|
140
136
|
expect(testContext.runAgenticSetup).not.toHaveBeenCalled()
|
|
141
137
|
})
|
|
142
138
|
|
|
143
|
-
it('rejects force and ownership-aware update together before setup', async () => {
|
|
144
|
-
const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation()
|
|
145
|
-
const testContext = await loadRunAgenticInit({
|
|
146
|
-
existingPaths: new Set<string>([appModulesPath]),
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
const exitCode = await testContext.runAgenticInit(['--force', '--update-harness'])
|
|
150
|
-
|
|
151
|
-
expect(exitCode).toBe(1)
|
|
152
|
-
expect(consoleErrorSpy).toHaveBeenCalledWith(
|
|
153
|
-
'❌ --force and --update-harness are mutually exclusive',
|
|
154
|
-
)
|
|
155
|
-
expect(testContext.createInterface).not.toHaveBeenCalled()
|
|
156
|
-
expect(testContext.runAgenticSetup).not.toHaveBeenCalled()
|
|
157
|
-
})
|
|
158
|
-
|
|
159
139
|
it('warns and exits early when relevant agentic files already exist without force', async () => {
|
|
160
140
|
const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation()
|
|
161
141
|
const testContext = await loadRunAgenticInit({
|
|
@@ -170,7 +150,7 @@ describe('runAgenticInit', () => {
|
|
|
170
150
|
expect(consoleLogSpy.mock.calls.flat()).toEqual(expect.arrayContaining([
|
|
171
151
|
'⚠️ Agentic files already exist:',
|
|
172
152
|
' • .codex/mcp.json.example',
|
|
173
|
-
'Run with --
|
|
153
|
+
'Run with --force to regenerate from current templates.',
|
|
174
154
|
]))
|
|
175
155
|
})
|
|
176
156
|
|
|
@@ -180,7 +160,7 @@ describe('runAgenticInit', () => {
|
|
|
180
160
|
questionAnswer: ' cursor ',
|
|
181
161
|
runAgenticSetupImplementation: async (currentTargetDir, ask, options) => {
|
|
182
162
|
expect(currentTargetDir).toBe(targetDir)
|
|
183
|
-
expect(options).toEqual({ tool: undefined, force: undefined
|
|
163
|
+
expect(options).toEqual({ tool: undefined, force: undefined })
|
|
184
164
|
await expect(ask('Select a tool')).resolves.toBe('cursor')
|
|
185
165
|
},
|
|
186
166
|
})
|
|
@@ -208,7 +188,7 @@ describe('runAgenticInit', () => {
|
|
|
208
188
|
expect(testContext.runAgenticSetup).toHaveBeenCalledWith(
|
|
209
189
|
targetDir,
|
|
210
190
|
expect.any(Function),
|
|
211
|
-
{ tool: 'codex', force: undefined
|
|
191
|
+
{ tool: 'codex', force: undefined },
|
|
212
192
|
)
|
|
213
193
|
expect(consoleLogSpy.mock.calls.flat()).not.toContain('⚠️ Agentic files already exist:')
|
|
214
194
|
expect(testContext.closeInterface).toHaveBeenCalledTimes(1)
|
|
@@ -225,23 +205,7 @@ describe('runAgenticInit', () => {
|
|
|
225
205
|
expect(testContext.runAgenticSetup).toHaveBeenCalledWith(
|
|
226
206
|
targetDir,
|
|
227
207
|
expect.any(Function),
|
|
228
|
-
{ tool: 'codex', force: true
|
|
229
|
-
)
|
|
230
|
-
expect(testContext.closeInterface).toHaveBeenCalledTimes(1)
|
|
231
|
-
})
|
|
232
|
-
|
|
233
|
-
it('bypasses overwrite warnings and requests an ownership-aware update', async () => {
|
|
234
|
-
const testContext = await loadRunAgenticInit({
|
|
235
|
-
existingPaths: new Set<string>([appModulesPath, codexConfigPath]),
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
const exitCode = await testContext.runAgenticInit(['--tool=codex', '--update-harness'])
|
|
239
|
-
|
|
240
|
-
expect(exitCode).toBe(0)
|
|
241
|
-
expect(testContext.runAgenticSetup).toHaveBeenCalledWith(
|
|
242
|
-
targetDir,
|
|
243
|
-
expect.any(Function),
|
|
244
|
-
{ tool: 'codex', force: undefined, updateHarness: true },
|
|
208
|
+
{ tool: 'codex', force: true },
|
|
245
209
|
)
|
|
246
210
|
expect(testContext.closeInterface).toHaveBeenCalledTimes(1)
|
|
247
211
|
})
|
package/src/lib/agentic-init.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { createInterface } from 'node:readline'
|
|
|
5
5
|
interface AgenticInitOptions {
|
|
6
6
|
tool?: string
|
|
7
7
|
force?: boolean
|
|
8
|
-
updateHarness?: boolean
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
const TOOL_EXISTING_FILES: Record<string, string[]> = {
|
|
@@ -28,8 +27,6 @@ function parseArgs(args: string[]): AgenticInitOptions {
|
|
|
28
27
|
const arg = args[i]
|
|
29
28
|
if (arg === '--force' || arg === '-f') {
|
|
30
29
|
options.force = true
|
|
31
|
-
} else if (arg === '--update-harness') {
|
|
32
|
-
options.updateHarness = true
|
|
33
30
|
} else if (arg.startsWith('--tool=')) {
|
|
34
31
|
options.tool = arg.slice('--tool='.length)
|
|
35
32
|
} else if (arg === '--tool') {
|
|
@@ -62,11 +59,6 @@ export async function runAgenticInit(args: string[]): Promise<number> {
|
|
|
62
59
|
const targetDir = resolve('.')
|
|
63
60
|
const options = parseArgs(args)
|
|
64
61
|
|
|
65
|
-
if (options.force && options.updateHarness) {
|
|
66
|
-
console.error('❌ --force and --update-harness are mutually exclusive')
|
|
67
|
-
return 1
|
|
68
|
-
}
|
|
69
|
-
|
|
70
62
|
// Validate this is an Open Mercato app directory
|
|
71
63
|
if (!existsSync(join(targetDir, 'src', 'modules.ts'))) {
|
|
72
64
|
console.error('❌ Not an Open Mercato app directory (src/modules.ts not found)')
|
|
@@ -74,7 +66,7 @@ export async function runAgenticInit(args: string[]): Promise<number> {
|
|
|
74
66
|
}
|
|
75
67
|
|
|
76
68
|
// Check if agentic files already exist and warn unless --force
|
|
77
|
-
if (!options.force
|
|
69
|
+
if (!options.force) {
|
|
78
70
|
const existingFiles = resolveRelevantAgenticFiles(options.tool)
|
|
79
71
|
.filter((relativePath) => existsSync(join(targetDir, relativePath)))
|
|
80
72
|
|
|
@@ -85,7 +77,7 @@ export async function runAgenticInit(args: string[]): Promise<number> {
|
|
|
85
77
|
console.log(` • ${f}`)
|
|
86
78
|
}
|
|
87
79
|
console.log('')
|
|
88
|
-
console.log('Run with --
|
|
80
|
+
console.log('Run with --force to regenerate from current templates.')
|
|
89
81
|
console.log('')
|
|
90
82
|
return 0
|
|
91
83
|
}
|
|
@@ -100,11 +92,7 @@ export async function runAgenticInit(args: string[]): Promise<number> {
|
|
|
100
92
|
const ask = (q: string) => new Promise<string>((res) => rl.question(q, (a) => res(a.trim())))
|
|
101
93
|
|
|
102
94
|
try {
|
|
103
|
-
await runAgenticSetup(targetDir, ask, {
|
|
104
|
-
tool: options.tool,
|
|
105
|
-
force: options.force,
|
|
106
|
-
updateHarness: options.updateHarness,
|
|
107
|
-
})
|
|
95
|
+
await runAgenticSetup(targetDir, ask, { tool: options.tool, force: options.force })
|
|
108
96
|
} finally {
|
|
109
97
|
rl.close()
|
|
110
98
|
}
|