@open-mercato/cli 0.6.6-develop.6383.1.27fcc83455 → 0.6.6-develop.6385.1.9a81faa5f0
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 +11 -0
- package/build.mjs +70 -2
- package/dist/agentic/guides/core.auth.md +3 -0
- package/dist/agentic/guides/core.catalog.md +3 -0
- package/dist/agentic/guides/core.currencies.md +3 -0
- package/dist/agentic/guides/core.customer_accounts.md +3 -0
- package/dist/agentic/guides/core.customers.md +3 -0
- package/dist/agentic/guides/core.data_sync.md +3 -0
- package/dist/agentic/guides/core.integrations.md +3 -0
- package/dist/agentic/guides/core.sales.md +3 -0
- package/dist/agentic/guides/core.workflows.md +3 -0
- package/dist/agentic/guides/module-facts.json +2073 -0
- package/dist/agentic/guides/modules/auth.md +64 -0
- package/dist/agentic/guides/modules/catalog.md +70 -0
- package/dist/agentic/guides/modules/currencies.md +50 -0
- package/dist/agentic/guides/modules/customer_accounts.md +76 -0
- package/dist/agentic/guides/modules/customers.md +115 -0
- package/dist/agentic/guides/modules/data_sync.md +49 -0
- package/dist/agentic/guides/modules/integrations.md +49 -0
- package/dist/agentic/guides/modules/sales.md +109 -0
- package/dist/agentic/guides/modules/workflows.md +73 -0
- package/dist/lib/__integration__/TC-INT-008.spec.js +29 -1
- package/dist/lib/__integration__/TC-INT-008.spec.js.map +2 -2
- package/dist/lib/agentic-setup.js +87 -0
- package/dist/lib/agentic-setup.js.map +2 -2
- package/dist/lib/worker-job-handler.js +13 -1
- package/dist/lib/worker-job-handler.js.map +2 -2
- package/dist/mercato.js +4 -1
- package/dist/mercato.js.map +2 -2
- package/package.json +5 -5
- package/src/lib/__integration__/TC-INT-008.spec.ts +41 -1
- package/src/lib/__tests__/worker-job-handler.test.ts +28 -0
- package/src/lib/agentic-setup.ts +129 -0
- package/src/lib/worker-job-handler.ts +13 -1
- package/src/mercato.ts +4 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
[build:cli] found 93 entry points
|
|
2
2
|
Copied create-app/agentic/ → dist/agentic/
|
|
3
3
|
Discovered 7 standalone guides → dist/agentic/guides/
|
|
4
|
+
[module-facts] module registry unavailable (registryPath not provided); API route auth omitted for auth
|
|
5
|
+
[module-facts] module registry unavailable (registryPath not provided); API route auth omitted for catalog
|
|
6
|
+
[module-facts] module registry unavailable (registryPath not provided); API route auth omitted for currencies
|
|
7
|
+
[module-facts] module registry unavailable (registryPath not provided); API route auth omitted for customer_accounts
|
|
8
|
+
[module-facts] module registry unavailable (registryPath not provided); API route auth omitted for customers
|
|
9
|
+
[module-facts] module registry unavailable (registryPath not provided); API route auth omitted for data_sync
|
|
10
|
+
[module-facts] module registry unavailable (registryPath not provided); API route auth omitted for integrations
|
|
11
|
+
Generated 9 module fact-sheets → dist/agentic/guides/modules/
|
|
12
|
+
[module-facts] module registry unavailable (registryPath not provided); API route auth omitted for sales
|
|
13
|
+
Wrote 9 legacy core.<module>.md redirect stubs → dist/agentic/guides/
|
|
4
14
|
[build:cli] built successfully
|
|
15
|
+
[module-facts] module registry unavailable (registryPath not provided); API route auth omitted for workflows
|
package/build.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { chmodSync, cpSync, existsSync, mkdirSync, readdirSync, readFileSync } from 'node:fs'
|
|
1
|
+
import { chmodSync, cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
|
2
2
|
import { dirname, join } from 'node:path'
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
4
4
|
import { atomicWriteFileSync } from '../../scripts/lib/add-js-extension.mjs'
|
|
5
5
|
import { buildPackage } from '../../scripts/build-package.mjs'
|
|
6
6
|
|
|
@@ -35,6 +35,18 @@ await buildPackage(packageDir, {
|
|
|
35
35
|
const guidesDestDir = join(outdir, 'agentic', 'guides')
|
|
36
36
|
mkdirSync(guidesDestDir, { recursive: true })
|
|
37
37
|
|
|
38
|
+
// Clean stale per-module artifacts before regenerating so an incremental dist never
|
|
39
|
+
// retains a removed module's full guide or fact-sheet — a removed `core.<module>.md`
|
|
40
|
+
// (two-dot, per-module) must come back as a redirect stub, not linger as a full guide.
|
|
41
|
+
// Mirrors packages/create-app/build.mjs; the conceptual `module-system.md` and the
|
|
42
|
+
// single-dot package guides are re-copied/re-discovered below.
|
|
43
|
+
rmSync(join(guidesDestDir, 'modules'), { recursive: true, force: true })
|
|
44
|
+
for (const entry of readdirSync(guidesDestDir)) {
|
|
45
|
+
if (/^core\..+\.md$/.test(entry)) {
|
|
46
|
+
rmSync(join(guidesDestDir, entry))
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
let guidesFound = 0
|
|
39
51
|
for (const pkg of readdirSync(packagesDir)) {
|
|
40
52
|
const guideSource = join(packagesDir, pkg, 'agentic', 'standalone-guide.md')
|
|
@@ -58,5 +70,61 @@ await buildPackage(packageDir, {
|
|
|
58
70
|
if (guidesFound > 0) {
|
|
59
71
|
console.log(`Discovered ${guidesFound} standalone guides → dist/agentic/guides/`)
|
|
60
72
|
}
|
|
73
|
+
|
|
74
|
+
// Generate per-module fact-sheets (Layer 2) from core module sources via the
|
|
75
|
+
// freshly built ts-morph extractor, so `mercato agentic:init` bundles the same
|
|
76
|
+
// guides as a create-mercato-app scaffold (packages/create-app/build.mjs).
|
|
77
|
+
const coreSrcRoot = join(packagesDir, 'core', 'src', 'modules')
|
|
78
|
+
if (existsSync(coreSrcRoot)) {
|
|
79
|
+
const { extractAllModuleFacts, renderModuleFactsJson } = await import(
|
|
80
|
+
pathToFileURL(join(outdir, 'lib', 'generators', 'module-facts.js')).href
|
|
81
|
+
)
|
|
82
|
+
const registryPath = join(packagesDir, '..', 'apps', 'mercato', '.mercato', 'generated', 'modules.runtime.generated.ts')
|
|
83
|
+
let coreVersion = null
|
|
84
|
+
try {
|
|
85
|
+
coreVersion = JSON.parse(readFileSync(join(packagesDir, 'core', 'package.json'), 'utf8')).version ?? null
|
|
86
|
+
} catch {
|
|
87
|
+
coreVersion = null
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const { factsByModule, markdownByModule, warnings } = extractAllModuleFacts({
|
|
91
|
+
coreSrcRoot,
|
|
92
|
+
registryPath: existsSync(registryPath) ? registryPath : null,
|
|
93
|
+
coreVersion,
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const modulesGuidesDir = join(guidesDestDir, 'modules')
|
|
97
|
+
mkdirSync(modulesGuidesDir, { recursive: true })
|
|
98
|
+
for (const [moduleId, markdown] of Object.entries(markdownByModule)) {
|
|
99
|
+
writeFileSync(join(modulesGuidesDir, `${moduleId}.md`), markdown)
|
|
100
|
+
}
|
|
101
|
+
writeFileSync(join(guidesDestDir, 'module-facts.json'), renderModuleFactsJson(factsByModule))
|
|
102
|
+
|
|
103
|
+
for (const warning of warnings) console.warn(warning)
|
|
104
|
+
console.log(`Generated ${Object.keys(markdownByModule).length} module fact-sheets → dist/agentic/guides/modules/`)
|
|
105
|
+
|
|
106
|
+
// BC bridge (spec §7 generated-file contract): for any allowlisted module whose
|
|
107
|
+
// legacy full guide `core.<module>.md` is no longer bundled (its standalone-guide.md
|
|
108
|
+
// source was removed), emit a thin redirect stub pointing at the generated fact-sheet.
|
|
109
|
+
// Fresh scaffolds never link these names; they exist only for apps upgrading in place.
|
|
110
|
+
let stubsWritten = 0
|
|
111
|
+
for (const moduleId of Object.keys(markdownByModule)) {
|
|
112
|
+
const legacyGuidePath = join(guidesDestDir, `core.${moduleId}.md`)
|
|
113
|
+
if (!existsSync(legacyGuidePath)) {
|
|
114
|
+
writeFileSync(
|
|
115
|
+
legacyGuidePath,
|
|
116
|
+
`# core.${moduleId} — moved\n\n` +
|
|
117
|
+
`> This guide has moved. See [\`modules/${moduleId}.md\`](modules/${moduleId}.md) for the generated ` +
|
|
118
|
+
`\`${moduleId}\` fact-sheet, and [\`module-system.md\`](module-system.md) for conceptual module guidance.\n`,
|
|
119
|
+
)
|
|
120
|
+
stubsWritten++
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (stubsWritten > 0) {
|
|
124
|
+
console.log(`Wrote ${stubsWritten} legacy core.<module>.md redirect stubs → dist/agentic/guides/`)
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
console.warn(`[module-facts] core module sources not found at ${coreSrcRoot}; skipping fact-sheet generation`)
|
|
128
|
+
}
|
|
61
129
|
},
|
|
62
130
|
})
|