@open-mercato/cli 0.6.7-develop.6795.1.8a3f27921c → 0.6.7-develop.6814.1.0627c7e9f1
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/manifest.json +2 -2
- package/dist/agentic/shared/AGENTS.md.template +6 -5
- package/dist/agentic/shared/ai/harness/cases.json +3 -0
- 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/references/unified-overrides.md +4 -2
- package/dist/agentic/shared/scripts/check-lessons.mjs +178 -0
- 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,70 @@
|
|
|
1
|
+
function identityKey(left, right) {
|
|
2
|
+
return JSON.stringify([left, right]);
|
|
3
|
+
}
|
|
4
|
+
const SECTION_FACT_KINDS = {
|
|
5
|
+
entities: "entity",
|
|
6
|
+
events: "event",
|
|
7
|
+
aclFeatures: "acl-feature",
|
|
8
|
+
notifications: "notification",
|
|
9
|
+
searchEntities: "search"
|
|
10
|
+
};
|
|
11
|
+
function buildFactSourceLookup(facts) {
|
|
12
|
+
const bySection = /* @__PURE__ */ new Map();
|
|
13
|
+
const register = (factSection, factKey, source) => {
|
|
14
|
+
bySection.set(identityKey(factSection, factKey), source);
|
|
15
|
+
};
|
|
16
|
+
for (const route of facts.apiRoutes ?? []) {
|
|
17
|
+
if (route.sourcePath) register("apiRoutes", route.path, { sourcePath: route.sourcePath });
|
|
18
|
+
}
|
|
19
|
+
for (const command of facts.cliCommands ?? []) {
|
|
20
|
+
register("cliCommands", command.command, { sourcePath: command.sourcePath });
|
|
21
|
+
}
|
|
22
|
+
for (const page of facts.backendPages ?? []) register("backendPages", page.path, { sourcePath: page.sourcePath });
|
|
23
|
+
for (const page of facts.frontendPages ?? []) register("frontendPages", page.path, { sourcePath: page.sourcePath });
|
|
24
|
+
for (const tool of facts.aiTools ?? []) register("aiTools", tool.name, { sourcePath: tool.sourcePath });
|
|
25
|
+
for (const agent of facts.aiAgents ?? []) register("aiAgents", agent.id, { sourcePath: agent.sourcePath });
|
|
26
|
+
for (const [kind, ownedFacts] of Object.entries(facts.ownedContracts ?? {})) {
|
|
27
|
+
for (const fact of ownedFacts ?? []) register(`ownedContracts.${kind}`, fact.id, fact.source);
|
|
28
|
+
}
|
|
29
|
+
for (const contribution of facts.extensionSurfaces?.contributions ?? []) {
|
|
30
|
+
register("extensionSurfaces.contributions", contribution.id, { sourcePath: contribution.source.path });
|
|
31
|
+
}
|
|
32
|
+
const factRefHostTargets = /* @__PURE__ */ new Map();
|
|
33
|
+
for (const host of facts.extensionSurfaces?.hosts ?? []) {
|
|
34
|
+
if (host.source.kind === "fact-ref") {
|
|
35
|
+
factRefHostTargets.set(host.key, { factSection: host.source.factSection, factKey: host.source.factKey });
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
register("extensionSurfaces.hosts", host.key, { sourcePath: host.source.path });
|
|
39
|
+
}
|
|
40
|
+
const entries = /* @__PURE__ */ new Map();
|
|
41
|
+
for (const entry of facts.factSources ?? []) {
|
|
42
|
+
entries.set(identityKey(entry.kind, entry.id), {
|
|
43
|
+
...entry.source ? { source: entry.source } : {},
|
|
44
|
+
...entry.factRef ? { factSection: entry.factRef.factSection, factKey: entry.factRef.factKey } : {}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const resolve = (kind, id, depth) => {
|
|
48
|
+
if (depth > 2) return null;
|
|
49
|
+
const entry = entries.get(identityKey(kind, id));
|
|
50
|
+
if (!entry) return null;
|
|
51
|
+
if (entry.source) return entry.source;
|
|
52
|
+
if (entry.factSection === void 0) return null;
|
|
53
|
+
const factKey = entry.factKey ?? id;
|
|
54
|
+
const direct = bySection.get(identityKey(entry.factSection, factKey));
|
|
55
|
+
if (direct) return direct;
|
|
56
|
+
if (entry.factSection === "extensionSurfaces.hosts") {
|
|
57
|
+
const hostTarget = factRefHostTargets.get(factKey);
|
|
58
|
+
const hostKind = hostTarget ? SECTION_FACT_KINDS[hostTarget.factSection] : void 0;
|
|
59
|
+
if (hostTarget && hostKind) return resolve(hostKind, hostTarget.factKey, depth + 1);
|
|
60
|
+
if (hostTarget) return bySection.get(identityKey(hostTarget.factSection, hostTarget.factKey)) ?? null;
|
|
61
|
+
}
|
|
62
|
+
const sectionKind = SECTION_FACT_KINDS[entry.factSection];
|
|
63
|
+
return sectionKind ? resolve(sectionKind, factKey, depth + 1) : null;
|
|
64
|
+
};
|
|
65
|
+
return (kind, id) => resolve(kind, id, 0);
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
buildFactSourceLookup
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=module-fact-sources.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/generators/module-fact-sources.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n ModuleFactSourceKind,\n ModuleFactSourceRef,\n ModuleFactsJsonEntry,\n} from './module-facts'\n\n/**\n * The subset of a module's facts needed to resolve the provenance index. Both\n * the in-memory `ModuleFacts` and the emitted `ModuleFactsJsonEntry` satisfy it.\n */\nexport type FactSourceLookupInput = Pick<\n ModuleFactsJsonEntry,\n | 'apiRoutes'\n | 'cliCommands'\n | 'backendPages'\n | 'frontendPages'\n | 'aiTools'\n | 'aiAgents'\n | 'ownedContracts'\n | 'extensionSurfaces'\n | 'factSources'\n>\n\nexport type FactSourceLookup = (kind: ModuleFactSourceKind, id: string) => ModuleFactSourceRef | null\n\nfunction identityKey(left: string, right: string): string {\n return JSON.stringify([left, right])\n}\n\n/**\n * Fact sections that do not serialize a source inline: their provenance lives in\n * `factSources` under the mapped kind, so a `factRef` into them resolves with one\n * extra hop. Used by `fact-ref` extension hosts, which reference the fact they\n * expose rather than a declaration of their own.\n */\nconst SECTION_FACT_KINDS: Record<string, ModuleFactSourceKind> = {\n entities: 'entity',\n events: 'event',\n aclFeatures: 'acl-feature',\n notifications: 'notification',\n searchEntities: 'search',\n}\n\n/**\n * Builds the single provenance lookup every consumer uses. `factSources` entries\n * carrying an inline `source` resolve directly; `factRef` entries are followed\n * into the fact section that already serializes the declaration site, so every\n * proven `(kind, id)` resolves deterministically without duplicated payloads.\n */\nexport function buildFactSourceLookup(facts: FactSourceLookupInput): FactSourceLookup {\n const bySection = new Map<string, ModuleFactSourceRef>()\n const register = (factSection: string, factKey: string, source: ModuleFactSourceRef): void => {\n bySection.set(identityKey(factSection, factKey), source)\n }\n for (const route of facts.apiRoutes ?? []) {\n if (route.sourcePath) register('apiRoutes', route.path, { sourcePath: route.sourcePath })\n }\n for (const command of facts.cliCommands ?? []) {\n register('cliCommands', command.command, { sourcePath: command.sourcePath })\n }\n for (const page of facts.backendPages ?? []) register('backendPages', page.path, { sourcePath: page.sourcePath })\n for (const page of facts.frontendPages ?? []) register('frontendPages', page.path, { sourcePath: page.sourcePath })\n for (const tool of facts.aiTools ?? []) register('aiTools', tool.name, { sourcePath: tool.sourcePath })\n for (const agent of facts.aiAgents ?? []) register('aiAgents', agent.id, { sourcePath: agent.sourcePath })\n for (const [kind, ownedFacts] of Object.entries(facts.ownedContracts ?? {})) {\n for (const fact of ownedFacts ?? []) register(`ownedContracts.${kind}`, fact.id, fact.source)\n }\n for (const contribution of facts.extensionSurfaces?.contributions ?? []) {\n register('extensionSurfaces.contributions', contribution.id, { sourcePath: contribution.source.path })\n }\n const factRefHostTargets = new Map<string, { factSection: string; factKey: string }>()\n for (const host of facts.extensionSurfaces?.hosts ?? []) {\n if (host.source.kind === 'fact-ref') {\n factRefHostTargets.set(host.key, { factSection: host.source.factSection, factKey: host.source.factKey })\n continue\n }\n register('extensionSurfaces.hosts', host.key, { sourcePath: host.source.path })\n }\n\n const entries = new Map<string, { source?: ModuleFactSourceRef; factSection?: string; factKey?: string }>()\n for (const entry of facts.factSources ?? []) {\n entries.set(identityKey(entry.kind, entry.id), {\n ...(entry.source ? { source: entry.source } : {}),\n ...(entry.factRef ? { factSection: entry.factRef.factSection, factKey: entry.factRef.factKey } : {}),\n })\n }\n\n const resolve = (kind: ModuleFactSourceKind, id: string, depth: number): ModuleFactSourceRef | null => {\n if (depth > 2) return null\n const entry = entries.get(identityKey(kind, id))\n if (!entry) return null\n if (entry.source) return entry.source\n if (entry.factSection === undefined) return null\n const factKey = entry.factKey ?? id\n const direct = bySection.get(identityKey(entry.factSection, factKey))\n if (direct) return direct\n if (entry.factSection === 'extensionSurfaces.hosts') {\n const hostTarget = factRefHostTargets.get(factKey)\n const hostKind = hostTarget ? SECTION_FACT_KINDS[hostTarget.factSection] : undefined\n if (hostTarget && hostKind) return resolve(hostKind, hostTarget.factKey, depth + 1)\n if (hostTarget) return bySection.get(identityKey(hostTarget.factSection, hostTarget.factKey)) ?? null\n }\n const sectionKind = SECTION_FACT_KINDS[entry.factSection]\n return sectionKind ? resolve(sectionKind, factKey, depth + 1) : null\n }\n\n return (kind, id) => resolve(kind, id, 0)\n}\n"],
|
|
5
|
+
"mappings": "AAyBA,SAAS,YAAY,MAAc,OAAuB;AACxD,SAAO,KAAK,UAAU,CAAC,MAAM,KAAK,CAAC;AACrC;AAQA,MAAM,qBAA2D;AAAA,EAC/D,UAAU;AAA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