@open-mercato/cli 0.6.8-develop.6972.1.275e435508 → 0.6.8-develop.6973.1.17fe21ccd4
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 +1 -1
- package/dist/agentic/claude-code/settings.experimental-hooks-validator.json +37 -0
- package/dist/agentic/claude-code/settings.json +0 -21
- package/dist/agentic/cursor/hooks.experimental-hooks-validator.json +20 -0
- package/dist/agentic/cursor/hooks.json +0 -10
- package/dist/agentic/guides/module-facts.json +112 -112
- package/dist/agentic/guides/module-facts.v2.json +112 -112
- package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
- package/dist/agentic/guides/modules/api_docs/index.md +1 -1
- package/dist/agentic/guides/modules/api_keys/index.md +1 -1
- package/dist/agentic/guides/modules/attachments/index.md +1 -1
- package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
- package/dist/agentic/guides/modules/auth/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/catalog/index.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/checkout/index.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
- package/dist/agentic/guides/modules/configs/index.md +1 -1
- package/dist/agentic/guides/modules/content/index.md +1 -1
- package/dist/agentic/guides/modules/currencies/index.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
- package/dist/agentic/guides/modules/customers/index.md +1 -1
- package/dist/agentic/guides/modules/dashboards/index.md +1 -1
- package/dist/agentic/guides/modules/data_sync/index.md +1 -1
- package/dist/agentic/guides/modules/design_system/index.md +1 -1
- package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
- package/dist/agentic/guides/modules/directory/index.md +1 -1
- package/dist/agentic/guides/modules/entities/index.md +1 -1
- package/dist/agentic/guides/modules/eudr/index.md +1 -1
- package/dist/agentic/guides/modules/events/index.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/generators/index.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
- package/dist/agentic/guides/modules/integrations/index.md +1 -1
- package/dist/agentic/guides/modules/messages/index.md +1 -1
- package/dist/agentic/guides/modules/notifications/index.md +1 -1
- package/dist/agentic/guides/modules/onboarding/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
- package/dist/agentic/guides/modules/perspectives/index.md +1 -1
- package/dist/agentic/guides/modules/planner/index.md +1 -1
- package/dist/agentic/guides/modules/portal/index.md +1 -1
- package/dist/agentic/guides/modules/progress/index.md +1 -1
- package/dist/agentic/guides/modules/query_index/index.md +1 -1
- package/dist/agentic/guides/modules/record_locks/index.md +1 -1
- package/dist/agentic/guides/modules/resources/index.md +1 -1
- package/dist/agentic/guides/modules/sales/index.md +1 -1
- package/dist/agentic/guides/modules/scheduler/index.md +1 -1
- package/dist/agentic/guides/modules/search/index.md +1 -1
- package/dist/agentic/guides/modules/security/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
- package/dist/agentic/guides/modules/sso/index.md +1 -1
- package/dist/agentic/guides/modules/staff/index.md +1 -1
- package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/webhooks/index.md +1 -1
- package/dist/agentic/guides/modules/wms/index.md +1 -1
- package/dist/agentic/guides/modules/workflows/index.md +1 -1
- package/dist/agentic/guides/reference-module-facts.json +1 -1
- package/dist/agentic/guides/upstream/manifest.json +1 -1
- package/dist/lib/__integration__/TC-INT-008.spec.js +77 -4
- package/dist/lib/__integration__/TC-INT-008.spec.js.map +2 -2
- package/dist/lib/agentic-init.js +4 -1
- package/dist/lib/agentic-init.js.map +2 -2
- package/dist/lib/agentic-setup.js +59 -12
- package/dist/lib/agentic-setup.js.map +2 -2
- package/package.json +6 -6
- package/src/lib/__integration__/TC-INT-008.spec.ts +88 -6
- package/src/lib/__tests__/agentic-init.test.ts +53 -5
- package/src/lib/agentic-init.ts +4 -0
- package/src/lib/agentic-setup.ts +67 -10
package/src/lib/agentic-setup.ts
CHANGED
|
@@ -43,11 +43,13 @@ interface AgenticSetupOptions {
|
|
|
43
43
|
tool?: string
|
|
44
44
|
force?: boolean
|
|
45
45
|
updateHarness?: boolean
|
|
46
|
+
experimentalHooksValidator?: boolean
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
interface AgenticConfig {
|
|
49
50
|
projectName: string
|
|
50
51
|
targetDir: string
|
|
52
|
+
experimentalHooksValidator: boolean
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
interface HarnessManifestFile {
|
|
@@ -226,9 +228,27 @@ function listFiles(root: string): string[] {
|
|
|
226
228
|
* hook registration pointing at a file that was never created. Deriving the list from disk
|
|
227
229
|
* keeps this path and the create-app wizard in step whenever a hook is added.
|
|
228
230
|
*/
|
|
229
|
-
function claudeHookFiles(): string[] {
|
|
231
|
+
function claudeHookFiles(experimentalHooksValidator: boolean): string[] {
|
|
230
232
|
const hooksDir = join(AGENTIC_DIR, 'claude-code', 'hooks')
|
|
231
|
-
return listFiles(hooksDir)
|
|
233
|
+
return listFiles(hooksDir)
|
|
234
|
+
.map((file) => relative(hooksDir, file).replaceAll('\\', '/'))
|
|
235
|
+
.filter((file) => experimentalHooksValidator || file !== 'gate-evidence.ts')
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function resolveExperimentalHooksValidator(
|
|
239
|
+
explicitValue?: boolean,
|
|
240
|
+
environment: NodeJS.ProcessEnv = process.env,
|
|
241
|
+
): boolean {
|
|
242
|
+
if (explicitValue !== undefined) return explicitValue
|
|
243
|
+
|
|
244
|
+
const token = environment.OM_HARNESS_EXPERIMENTAL_HOOKS_VALIDATOR?.trim().toLowerCase()
|
|
245
|
+
if (!token) return false
|
|
246
|
+
if (['1', 'true', 'yes', 'on'].includes(token)) return true
|
|
247
|
+
if (['0', 'false', 'no', 'off'].includes(token)) return false
|
|
248
|
+
|
|
249
|
+
throw new Error(
|
|
250
|
+
'OM_HARNESS_EXPERIMENTAL_HOOKS_VALIDATOR must be one of: 1, true, yes, on, 0, false, no, off',
|
|
251
|
+
)
|
|
232
252
|
}
|
|
233
253
|
|
|
234
254
|
function copyTree(sourceRoot: string, destinationRoot: string, config: AgenticConfig): void {
|
|
@@ -475,14 +495,31 @@ function finalizeHarnessManifest(config: AgenticConfig, selectedTools: string[])
|
|
|
475
495
|
if (selectedTools.includes('claude-code')) {
|
|
476
496
|
paths.add(join(targetDir, 'CLAUDE.md'))
|
|
477
497
|
paths.add(join(targetDir, '.claude', 'settings.json'))
|
|
478
|
-
for (const hook of claudeHookFiles())
|
|
498
|
+
for (const hook of claudeHookFiles(config.experimentalHooksValidator)) {
|
|
499
|
+
paths.add(join(targetDir, '.claude', 'hooks', hook))
|
|
500
|
+
}
|
|
479
501
|
paths.add(join(targetDir, '.mcp.json.example'))
|
|
480
502
|
}
|
|
481
|
-
if (selectedTools.includes('codex'))
|
|
503
|
+
if (selectedTools.includes('codex')) {
|
|
504
|
+
paths.add(join(targetDir, '.codex', 'mcp.json.example'))
|
|
505
|
+
if (config.experimentalHooksValidator) {
|
|
506
|
+
paths.add(join(targetDir, '.codex', 'hooks.json'))
|
|
507
|
+
paths.add(join(targetDir, '.codex', 'hooks', 'gate-evidence.mjs'))
|
|
508
|
+
}
|
|
509
|
+
}
|
|
482
510
|
if (selectedTools.includes('cursor')) {
|
|
483
|
-
for (const
|
|
484
|
-
|
|
485
|
-
|
|
511
|
+
for (const relativePath of [
|
|
512
|
+
'hooks.json',
|
|
513
|
+
'hooks/entity-migration-check.mjs',
|
|
514
|
+
'mcp.json.example',
|
|
515
|
+
'rules/open-mercato.mdc',
|
|
516
|
+
'rules/entity-guard.mdc',
|
|
517
|
+
'rules/generated-guard.mdc',
|
|
518
|
+
]) {
|
|
519
|
+
paths.add(join(targetDir, '.cursor', relativePath))
|
|
520
|
+
}
|
|
521
|
+
if (config.experimentalHooksValidator) {
|
|
522
|
+
paths.add(join(targetDir, '.cursor', 'hooks', 'gate-evidence.mjs'))
|
|
486
523
|
}
|
|
487
524
|
}
|
|
488
525
|
const manifestPath = join(targetDir, '.ai', 'harness', 'manifest.json')
|
|
@@ -701,8 +738,12 @@ function generateClaudeCode(config: AgenticConfig): void {
|
|
|
701
738
|
const srcDir = join(AGENTIC_DIR, 'claude-code')
|
|
702
739
|
|
|
703
740
|
writeTemplate(srcDir, 'CLAUDE.md.template', join(targetDir, 'CLAUDE.md'), config)
|
|
704
|
-
copyFile(
|
|
705
|
-
|
|
741
|
+
copyFile(
|
|
742
|
+
srcDir,
|
|
743
|
+
config.experimentalHooksValidator ? 'settings.experimental-hooks-validator.json' : 'settings.json',
|
|
744
|
+
join(targetDir, '.claude', 'settings.json'),
|
|
745
|
+
)
|
|
746
|
+
for (const hook of claudeHookFiles(config.experimentalHooksValidator)) {
|
|
706
747
|
copyFile(srcDir, `hooks/${hook}`, join(targetDir, '.claude', 'hooks', hook))
|
|
707
748
|
}
|
|
708
749
|
copyFile(srcDir, 'mcp.json.example', join(targetDir, '.mcp.json.example'))
|
|
@@ -738,6 +779,10 @@ function generateCodex(config: AgenticConfig): void {
|
|
|
738
779
|
writeFileSync(agentsPath, agents)
|
|
739
780
|
}
|
|
740
781
|
|
|
782
|
+
if (config.experimentalHooksValidator) {
|
|
783
|
+
copyFile(srcDir, 'hooks.json', join(targetDir, '.codex', 'hooks.json'))
|
|
784
|
+
copyFile(srcDir, 'hooks/gate-evidence.mjs', join(targetDir, '.codex', 'hooks', 'gate-evidence.mjs'))
|
|
785
|
+
}
|
|
741
786
|
copyFile(srcDir, 'mcp.json.example', join(targetDir, '.codex', 'mcp.json.example'))
|
|
742
787
|
|
|
743
788
|
// No .codex/skills directory: Codex reads the canonical .agents/skills/,
|
|
@@ -751,8 +796,15 @@ function generateCursor(config: AgenticConfig): void {
|
|
|
751
796
|
writeTemplate(srcDir, 'rules/open-mercato.mdc', join(targetDir, '.cursor', 'rules', 'open-mercato.mdc'), config)
|
|
752
797
|
copyFile(srcDir, 'rules/entity-guard.mdc', join(targetDir, '.cursor', 'rules', 'entity-guard.mdc'))
|
|
753
798
|
copyFile(srcDir, 'rules/generated-guard.mdc', join(targetDir, '.cursor', 'rules', 'generated-guard.mdc'))
|
|
754
|
-
copyFile(
|
|
799
|
+
copyFile(
|
|
800
|
+
srcDir,
|
|
801
|
+
config.experimentalHooksValidator ? 'hooks.experimental-hooks-validator.json' : 'hooks.json',
|
|
802
|
+
join(targetDir, '.cursor', 'hooks.json'),
|
|
803
|
+
)
|
|
755
804
|
copyFile(srcDir, 'hooks/entity-migration-check.mjs', join(targetDir, '.cursor', 'hooks', 'entity-migration-check.mjs'))
|
|
805
|
+
if (config.experimentalHooksValidator) {
|
|
806
|
+
copyFile(srcDir, 'hooks/gate-evidence.mjs', join(targetDir, '.cursor', 'hooks', 'gate-evidence.mjs'))
|
|
807
|
+
}
|
|
756
808
|
copyFile(srcDir, 'mcp.json.example', join(targetDir, '.cursor', 'mcp.json.example'))
|
|
757
809
|
|
|
758
810
|
// No .cursor/skills directory: Cursor reads the canonical .agents/skills/,
|
|
@@ -862,6 +914,7 @@ export async function runAgenticSetup(
|
|
|
862
914
|
const config: AgenticConfig = {
|
|
863
915
|
projectName: basename(targetDir),
|
|
864
916
|
targetDir,
|
|
917
|
+
experimentalHooksValidator: resolveExperimentalHooksValidator(options?.experimentalHooksValidator),
|
|
865
918
|
}
|
|
866
919
|
|
|
867
920
|
const stagingDir = mkdtempSync(join(tmpdir(), 'open-mercato-harness-'))
|
|
@@ -876,6 +929,7 @@ export async function runAgenticSetup(
|
|
|
876
929
|
const stagingConfig: AgenticConfig = {
|
|
877
930
|
projectName: config.projectName,
|
|
878
931
|
targetDir: stagingDir,
|
|
932
|
+
experimentalHooksValidator: config.experimentalHooksValidator,
|
|
879
933
|
}
|
|
880
934
|
generateHarness(stagingConfig, selectedIds)
|
|
881
935
|
const conflicts = applyHarnessUpdate(targetDir, stagingDir, {
|
|
@@ -908,6 +962,9 @@ export async function runAgenticSetup(
|
|
|
908
962
|
if (selectedIds.includes('cursor')) {
|
|
909
963
|
console.log(' ✓ Cursor — .cursor/rules/, .cursor/hooks/, .cursor/mcp.json.example')
|
|
910
964
|
}
|
|
965
|
+
if (config.experimentalHooksValidator) {
|
|
966
|
+
console.log(' ✓ Experimental gate-evidence/typecheck validator hooks')
|
|
967
|
+
}
|
|
911
968
|
console.log('')
|
|
912
969
|
console.log(' .ai/agentic.config.json ships preconfigured (GitHub tracker, labels off);')
|
|
913
970
|
console.log(' run /om-setup-agent-pipeline in your agent CLI to tailor labels, QA gate,')
|