@open-mercato/cli 0.6.7-develop.6795.1.8a3f27921c → 0.6.7-develop.6824.1.21fff90682
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/build.mjs +1 -1
- package/dist/agentic/guides/module-facts.json +90266 -20749
- package/dist/agentic/guides/modules/ai_assistant.md +170 -60
- package/dist/agentic/guides/modules/api_docs.md +26 -1
- package/dist/agentic/guides/modules/api_keys.md +57 -17
- package/dist/agentic/guides/modules/attachments.md +72 -19
- package/dist/agentic/guides/modules/audit_logs.md +95 -29
- package/dist/agentic/guides/modules/auth.md +218 -83
- package/dist/agentic/guides/modules/business_rules.md +108 -34
- package/dist/agentic/guides/modules/catalog.md +386 -157
- package/dist/agentic/guides/modules/channel_gmail.md +55 -6
- package/dist/agentic/guides/modules/channel_imap.md +55 -6
- package/dist/agentic/guides/modules/checkout.md +254 -129
- package/dist/agentic/guides/modules/communication_channels.md +280 -109
- package/dist/agentic/guides/modules/configs.md +68 -11
- package/dist/agentic/guides/modules/content.md +26 -1
- package/dist/agentic/guides/modules/currencies.md +109 -44
- package/dist/agentic/guides/modules/customer_accounts.md +350 -156
- package/dist/agentic/guides/modules/customers.md +642 -294
- package/dist/agentic/guides/modules/dashboards.md +122 -28
- package/dist/agentic/guides/modules/data_sync.md +117 -37
- package/dist/agentic/guides/modules/design_system.md +36 -2
- package/dist/agentic/guides/modules/dictionaries.md +78 -20
- package/dist/agentic/guides/modules/directory.md +110 -45
- package/dist/agentic/guides/modules/entities.md +95 -38
- package/dist/agentic/guides/modules/events.md +31 -1
- package/dist/agentic/guides/modules/feature_toggles.md +79 -12
- package/dist/agentic/guides/modules/gateway_stripe.md +61 -6
- package/dist/agentic/guides/modules/generators.md +17 -1
- package/dist/agentic/guides/modules/inbox_ops.md +171 -60
- package/dist/agentic/guides/modules/integrations.md +116 -30
- package/dist/agentic/guides/modules/messages.md +187 -66
- package/dist/agentic/guides/modules/notifications.md +64 -9
- package/dist/agentic/guides/modules/onboarding.md +47 -8
- package/dist/agentic/guides/modules/payment_gateways.md +133 -48
- package/dist/agentic/guides/modules/perspectives.md +50 -12
- package/dist/agentic/guides/modules/planner.md +102 -32
- package/dist/agentic/guides/modules/portal.md +58 -15
- package/dist/agentic/guides/modules/progress.md +78 -30
- package/dist/agentic/guides/modules/query_index.md +115 -53
- package/dist/agentic/guides/modules/record_locks.md +178 -59
- package/dist/agentic/guides/modules/resources.md +155 -78
- package/dist/agentic/guides/modules/sales.md +620 -257
- package/dist/agentic/guides/modules/scheduler.md +95 -19
- package/dist/agentic/guides/modules/search.md +124 -20
- package/dist/agentic/guides/modules/security.md +251 -105
- package/dist/agentic/guides/modules/shipping_carriers.md +106 -37
- package/dist/agentic/guides/modules/sso.md +121 -49
- package/dist/agentic/guides/modules/staff.md +314 -126
- package/dist/agentic/guides/modules/storage_s3.md +55 -6
- package/dist/agentic/guides/modules/sync_akeneo.md +54 -4
- package/dist/agentic/guides/modules/sync_excel.md +49 -11
- package/dist/agentic/guides/modules/system_status_overlays.md +33 -5
- package/dist/agentic/guides/modules/translations.md +76 -21
- package/dist/agentic/guides/modules/webhooks.md +166 -82
- package/dist/agentic/guides/modules/wms.md +383 -223
- package/dist/agentic/guides/modules/workflows.md +248 -112
- package/dist/agentic/guides/upstream/AGENTS.md +1 -1
- package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +2 -0
- package/dist/agentic/guides/upstream/manifest.json +3 -3
- package/dist/agentic/shared/AGENTS.md.template +6 -5
- package/dist/agentic/shared/ai/harness/README.md +2 -2
- package/dist/agentic/shared/ai/harness/RELEASE.md +4 -4
- package/dist/agentic/shared/ai/harness/cases.json +94 -1
- package/dist/agentic/shared/ai/harness/cases.schema.json +3 -3
- package/dist/agentic/shared/ai/harness/validators.json +1 -1
- package/dist/agentic/shared/ai/lessons/_template.md +16 -0
- package/dist/agentic/shared/ai/lessons.md +26 -3
- package/dist/agentic/shared/ai/skills/om-evolve-harness/SKILL.md +7 -6
- package/dist/agentic/shared/ai/skills/om-system-extension/SKILL.md +1 -1
- package/dist/agentic/shared/ai/skills/om-system-extension/references/unified-overrides.md +4 -2
- package/dist/agentic/shared/scripts/check-lessons.mjs +178 -0
- package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +37 -12
- package/dist/lib/agentic-setup.js +2 -2
- package/dist/lib/agentic-setup.js.map +2 -2
- package/dist/lib/generators/module-extension-facts.js +652 -24
- package/dist/lib/generators/module-extension-facts.js.map +3 -3
- package/dist/lib/generators/module-fact-sources.js +70 -0
- package/dist/lib/generators/module-fact-sources.js.map +7 -0
- package/dist/lib/generators/module-facts.js +1001 -26
- package/dist/lib/generators/module-facts.js.map +3 -3
- package/dist/lib/generators/module-override-targets.js +688 -0
- package/dist/lib/generators/module-override-targets.js.map +7 -0
- package/dist/lib/testing/integration.js +5 -0
- package/dist/lib/testing/integration.js.map +2 -2
- package/package.json +5 -5
- package/src/lib/__tests__/agentic-setup.ownership.test.ts +6 -0
- package/src/lib/agentic-setup.ts +6 -2
- package/src/lib/generators/__tests__/activation-adapter-coverage.test.ts +92 -0
- package/src/lib/generators/__tests__/module-extension-activations.test.ts +762 -0
- package/src/lib/generators/__tests__/module-extension-facts.test.ts +4 -2
- package/src/lib/generators/__tests__/module-facts.bc-guard.test.ts +37 -3
- package/src/lib/generators/__tests__/module-facts.owned-contracts.test.ts +561 -0
- package/src/lib/generators/__tests__/module-override-targets.roundtrip.test.ts +149 -0
- package/src/lib/generators/__tests__/module-override-targets.test.ts +304 -0
- package/src/lib/generators/module-extension-facts.ts +923 -27
- package/src/lib/generators/module-fact-sources.ts +108 -0
- package/src/lib/generators/module-facts.ts +1360 -25
- package/src/lib/generators/module-override-targets.ts +863 -0
- package/src/lib/testing/__tests__/integration.test.ts +4 -0
- package/src/lib/testing/integration.ts +5 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ModuleFactSourceKind,
|
|
3
|
+
ModuleFactSourceRef,
|
|
4
|
+
ModuleFactsJsonEntry,
|
|
5
|
+
} from './module-facts'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The subset of a module's facts needed to resolve the provenance index. Both
|
|
9
|
+
* the in-memory `ModuleFacts` and the emitted `ModuleFactsJsonEntry` satisfy it.
|
|
10
|
+
*/
|
|
11
|
+
export type FactSourceLookupInput = Pick<
|
|
12
|
+
ModuleFactsJsonEntry,
|
|
13
|
+
| 'apiRoutes'
|
|
14
|
+
| 'cliCommands'
|
|
15
|
+
| 'backendPages'
|
|
16
|
+
| 'frontendPages'
|
|
17
|
+
| 'aiTools'
|
|
18
|
+
| 'aiAgents'
|
|
19
|
+
| 'ownedContracts'
|
|
20
|
+
| 'extensionSurfaces'
|
|
21
|
+
| 'factSources'
|
|
22
|
+
>
|
|
23
|
+
|
|
24
|
+
export type FactSourceLookup = (kind: ModuleFactSourceKind, id: string) => ModuleFactSourceRef | null
|
|
25
|
+
|
|
26
|
+
function identityKey(left: string, right: string): string {
|
|
27
|
+
return JSON.stringify([left, right])
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Fact sections that do not serialize a source inline: their provenance lives in
|
|
32
|
+
* `factSources` under the mapped kind, so a `factRef` into them resolves with one
|
|
33
|
+
* extra hop. Used by `fact-ref` extension hosts, which reference the fact they
|
|
34
|
+
* expose rather than a declaration of their own.
|
|
35
|
+
*/
|
|
36
|
+
const SECTION_FACT_KINDS: Record<string, ModuleFactSourceKind> = {
|
|
37
|
+
entities: 'entity',
|
|
38
|
+
events: 'event',
|
|
39
|
+
aclFeatures: 'acl-feature',
|
|
40
|
+
notifications: 'notification',
|
|
41
|
+
searchEntities: 'search',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Builds the single provenance lookup every consumer uses. `factSources` entries
|
|
46
|
+
* carrying an inline `source` resolve directly; `factRef` entries are followed
|
|
47
|
+
* into the fact section that already serializes the declaration site, so every
|
|
48
|
+
* proven `(kind, id)` resolves deterministically without duplicated payloads.
|
|
49
|
+
*/
|
|
50
|
+
export function buildFactSourceLookup(facts: FactSourceLookupInput): FactSourceLookup {
|
|
51
|
+
const bySection = new Map<string, ModuleFactSourceRef>()
|
|
52
|
+
const register = (factSection: string, factKey: string, source: ModuleFactSourceRef): void => {
|
|
53
|
+
bySection.set(identityKey(factSection, factKey), source)
|
|
54
|
+
}
|
|
55
|
+
for (const route of facts.apiRoutes ?? []) {
|
|
56
|
+
if (route.sourcePath) register('apiRoutes', route.path, { sourcePath: route.sourcePath })
|
|
57
|
+
}
|
|
58
|
+
for (const command of facts.cliCommands ?? []) {
|
|
59
|
+
register('cliCommands', command.command, { sourcePath: command.sourcePath })
|
|
60
|
+
}
|
|
61
|
+
for (const page of facts.backendPages ?? []) register('backendPages', page.path, { sourcePath: page.sourcePath })
|
|
62
|
+
for (const page of facts.frontendPages ?? []) register('frontendPages', page.path, { sourcePath: page.sourcePath })
|
|
63
|
+
for (const tool of facts.aiTools ?? []) register('aiTools', tool.name, { sourcePath: tool.sourcePath })
|
|
64
|
+
for (const agent of facts.aiAgents ?? []) register('aiAgents', agent.id, { sourcePath: agent.sourcePath })
|
|
65
|
+
for (const [kind, ownedFacts] of Object.entries(facts.ownedContracts ?? {})) {
|
|
66
|
+
for (const fact of ownedFacts ?? []) register(`ownedContracts.${kind}`, fact.id, fact.source)
|
|
67
|
+
}
|
|
68
|
+
for (const contribution of facts.extensionSurfaces?.contributions ?? []) {
|
|
69
|
+
register('extensionSurfaces.contributions', contribution.id, { sourcePath: contribution.source.path })
|
|
70
|
+
}
|
|
71
|
+
const factRefHostTargets = new Map<string, { factSection: string; factKey: string }>()
|
|
72
|
+
for (const host of facts.extensionSurfaces?.hosts ?? []) {
|
|
73
|
+
if (host.source.kind === 'fact-ref') {
|
|
74
|
+
factRefHostTargets.set(host.key, { factSection: host.source.factSection, factKey: host.source.factKey })
|
|
75
|
+
continue
|
|
76
|
+
}
|
|
77
|
+
register('extensionSurfaces.hosts', host.key, { sourcePath: host.source.path })
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const entries = new Map<string, { source?: ModuleFactSourceRef; factSection?: string; factKey?: string }>()
|
|
81
|
+
for (const entry of facts.factSources ?? []) {
|
|
82
|
+
entries.set(identityKey(entry.kind, entry.id), {
|
|
83
|
+
...(entry.source ? { source: entry.source } : {}),
|
|
84
|
+
...(entry.factRef ? { factSection: entry.factRef.factSection, factKey: entry.factRef.factKey } : {}),
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const resolve = (kind: ModuleFactSourceKind, id: string, depth: number): ModuleFactSourceRef | null => {
|
|
89
|
+
if (depth > 2) return null
|
|
90
|
+
const entry = entries.get(identityKey(kind, id))
|
|
91
|
+
if (!entry) return null
|
|
92
|
+
if (entry.source) return entry.source
|
|
93
|
+
if (entry.factSection === undefined) return null
|
|
94
|
+
const factKey = entry.factKey ?? id
|
|
95
|
+
const direct = bySection.get(identityKey(entry.factSection, factKey))
|
|
96
|
+
if (direct) return direct
|
|
97
|
+
if (entry.factSection === 'extensionSurfaces.hosts') {
|
|
98
|
+
const hostTarget = factRefHostTargets.get(factKey)
|
|
99
|
+
const hostKind = hostTarget ? SECTION_FACT_KINDS[hostTarget.factSection] : undefined
|
|
100
|
+
if (hostTarget && hostKind) return resolve(hostKind, hostTarget.factKey, depth + 1)
|
|
101
|
+
if (hostTarget) return bySection.get(identityKey(hostTarget.factSection, hostTarget.factKey)) ?? null
|
|
102
|
+
}
|
|
103
|
+
const sectionKind = SECTION_FACT_KINDS[entry.factSection]
|
|
104
|
+
return sectionKind ? resolve(sectionKind, factKey, depth + 1) : null
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return (kind, id) => resolve(kind, id, 0)
|
|
108
|
+
}
|