@open-mercato/cli 0.11.1-develop.8589.1.db1a76ea60 → 0.11.1-develop.8593.1.50784dae35
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/AGENTS.md +1 -0
- package/dist/agentic/guides/module-facts.json +164 -164
- package/dist/agentic/guides/module-facts.v2.json +164 -164
- package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
- 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/availability/index.md +1 -1
- package/dist/agentic/guides/modules/backups/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
- package/dist/agentic/guides/modules/cart/index.md +1 -1
- package/dist/agentic/guides/modules/catalog/index.md +1 -1
- package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
- package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
- package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
- package/dist/agentic/guides/modules/channel_fcm/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/channel_resend/index.md +1 -1
- package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
- package/dist/agentic/guides/modules/channel_smtp/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/customer_groups/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/devices/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/documents/index.md +1 -1
- package/dist/agentic/guides/modules/ecommerce/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/forms/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_tpay/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/phone_calls/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/promotions/index.md +1 -1
- package/dist/agentic/guides/modules/push_notifications/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/seeds/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/telemetry/index.md +1 -1
- package/dist/agentic/guides/modules/tillio/index.md +1 -1
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/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/generate-child-process.js +21 -3
- package/dist/lib/generate-child-process.js.map +2 -2
- package/dist/lib/generate-watch-events.js +135 -19
- package/dist/lib/generate-watch-events.js.map +2 -2
- package/dist/lib/generate-watch-plan.js +166 -0
- package/dist/lib/generate-watch-plan.js.map +7 -0
- package/dist/lib/generate-watch-runner.js +53 -0
- package/dist/lib/generate-watch-runner.js.map +7 -0
- package/dist/lib/generate-watch-structure.js +576 -203
- package/dist/lib/generate-watch-structure.js.map +3 -3
- package/dist/lib/generators/extensions/agent-files.js +1 -0
- package/dist/lib/generators/extensions/agent-files.js.map +2 -2
- package/dist/lib/generators/module-registry.js +148 -191
- package/dist/lib/generators/module-registry.js.map +3 -3
- package/dist/lib/generators/openapi.js +24 -1
- package/dist/lib/generators/openapi.js.map +2 -2
- package/dist/lib/generators/web-research-adapters.js +54 -22
- package/dist/lib/generators/web-research-adapters.js.map +2 -2
- package/dist/lib/in-process-generate-watcher.js +98 -75
- package/dist/lib/in-process-generate-watcher.js.map +2 -2
- package/dist/mercato.js +74 -46
- package/dist/mercato.js.map +2 -2
- package/package.json +7 -7
- package/src/lib/__tests__/generate-child-process.test.ts +30 -0
- package/src/lib/__tests__/generate-watch-events.test.ts +377 -8
- package/src/lib/__tests__/generate-watch-plan.test.ts +98 -0
- package/src/lib/__tests__/generate-watch-runner.test.ts +126 -0
- package/src/lib/__tests__/generate-watch-structure.test.ts +522 -1
- package/src/lib/__tests__/in-process-generate-watcher.test.ts +393 -6
- package/src/lib/__tests__/module-inspection.test.ts +17 -11
- package/src/lib/generate-child-process.ts +26 -3
- package/src/lib/generate-watch-events.ts +189 -17
- package/src/lib/generate-watch-plan.ts +177 -0
- package/src/lib/generate-watch-runner.ts +62 -0
- package/src/lib/generate-watch-structure.ts +666 -227
- package/src/lib/generators/__tests__/incremental-registry.test.ts +262 -0
- package/src/lib/generators/__tests__/openapi.test.ts +91 -1
- package/src/lib/generators/__tests__/web-research-adapters.test.ts +298 -87
- package/src/lib/generators/extension.ts +2 -0
- package/src/lib/generators/extensions/agent-files.ts +1 -0
- package/src/lib/generators/module-registry.ts +168 -200
- package/src/lib/generators/openapi.ts +34 -0
- package/src/lib/generators/web-research-adapters.ts +76 -21
- package/src/lib/in-process-generate-watcher.ts +151 -96
- package/src/mercato.ts +85 -53
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/lib/generate-watch-structure.ts"],
|
|
4
|
-
"sourcesContent": ["import crypto from 'node:crypto'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport {\n MODULE_CODE_EXTENSIONS,\n SCAN_CONFIGS,\n resolveStandaloneSourceMirrorBase,\n scanModuleDir,\n stripModuleCodeExtension,\n type ModuleRoots,\n} from './generators/scanner'\n\nconst STRUCTURAL_CONVENTION_FILES = [\n 'index.ts',\n 'cli.ts',\n 'di.ts',\n 'acl.ts',\n 'setup.ts',\n 'runtime.ts',\n 'encryption.ts',\n 'ce.ts',\n 'search.ts',\n 'events.ts',\n 'notifications.ts',\n 'notifications.client.ts',\n 'notifications.handlers.ts',\n 'translations.ts',\n 'generators.ts',\n 'ai-tools.ts',\n 'ai-agents.ts',\n 'analytics.ts',\n 'workflows.ts',\n 'inbox-actions.ts',\n 'message-types.ts',\n 'message-objects.ts',\n 'integration.ts',\n 'security.mfa-providers.ts',\n 'security.sudo.ts',\n 'data/entities.ts',\n 'data/extensions.ts',\n 'data/fields.ts',\n 'data/enrichers.ts',\n 'data/guards.ts',\n 'api/interceptors.ts',\n 'commands/interceptors.ts',\n 'widgets/components.ts',\n 'widgets/injection-table.ts',\n 'frontend/middleware.ts',\n 'backend/middleware.ts',\n] as const\n\nconst CONTENT_SENSITIVE_SCAN_CONFIGS = [\n SCAN_CONFIGS.apiRoutes,\n SCAN_CONFIGS.apiPlainFiles,\n SCAN_CONFIGS.subscribers,\n SCAN_CONFIGS.workers,\n SCAN_CONFIGS.dashboardWidgets,\n SCAN_CONFIGS.injectionWidgets,\n] as const\n\nconst ROUTE_SHAPE_SCAN_CONFIGS = [\n SCAN_CONFIGS.frontendPages,\n SCAN_CONFIGS.backendPages,\n] as const\n\nfunction checksum(value: string): string {\n return crypto.createHash('md5').update(value).digest('hex')\n}\n\nfunction moduleRootIdentity(roots: ModuleRoots): string {\n return JSON.stringify([\n roots.pkgBase.replace(/\\\\/g, '/'),\n roots.appBase.replace(/\\\\/g, '/'),\n ])\n}\n\nfunction fileRecord(filePath: string, base: string, mode: 'content' | 'shape'): string | null {\n if (!fs.existsSync(filePath)) return null\n let stat: fs.Stats\n try {\n stat = fs.statSync(filePath)\n } catch {\n return null\n }\n if (!stat.isFile()) return null\n const rel = path.relative(base, filePath).replace(/\\\\/g, '/')\n if (mode === 'shape') {\n return `file:${rel}`\n }\n try {\n return `file:${rel}:${stat.size}:${checksum(fs.readFileSync(filePath, 'utf8'))}`\n } catch {\n return `file:${rel}:unreadable`\n }\n}\n\nfunction addFileRecord(\n records: string[],\n prefix: string,\n filePath: string,\n base: string,\n mode: 'content' | 'shape',\n): void {\n const record = fileRecord(filePath, base, mode)\n if (record) records.push(`${prefix}:${record}`)\n}\n\nfunction resolveCodeFile(base: string, relativePath: string): string | null {\n const stripped = stripModuleCodeExtension(relativePath)\n const candidates = MODULE_CODE_EXTENSIONS.map((extension) => `${stripped}${extension}`)\n for (const candidate of candidates) {\n const filePath = path.join(base, ...candidate.split('/'))\n if (fs.existsSync(filePath)) return filePath\n }\n return null\n}\n\nfunction resolveRuntimeCounterpart(\n pkgBase: string,\n sourceBase: string,\n sourceFile: string,\n): string | null {\n if (sourceBase === pkgBase) return null\n const relativePath = path.relative(sourceBase, sourceFile).replace(/\\\\/g, '/')\n return resolveCodeFile(pkgBase, relativePath)\n}\n\nfunction hasInlinePageMetadata(filePath: string): boolean {\n try {\n const source = fs.readFileSync(filePath, 'utf8')\n return /\\bexport\\s+(?:const|let|var|function|class)\\s+metadata\\b/.test(source)\n || /\\bexport\\s+\\{[^}]*\\bmetadata\\b[^}]*\\}/.test(source)\n } catch {\n return false\n }\n}\n\nfunction addConventionRecords(records: string[], roots: ModuleRoots): void {\n const packageSourceBase = resolveStandaloneSourceMirrorBase(roots.pkgBase) ?? roots.pkgBase\n for (const base of [roots.pkgBase, roots.appBase]) {\n records.push(`module-root:${base}:${fs.existsSync(base) ? 'present' : 'missing'}`)\n }\n if (packageSourceBase !== roots.pkgBase) {\n records.push(\n `module-root:${packageSourceBase}:${fs.existsSync(packageSourceBase) ? 'present' : 'missing'}`,\n )\n }\n\n for (const relativePath of STRUCTURAL_CONVENTION_FILES) {\n const appFile = resolveCodeFile(roots.appBase, relativePath)\n if (appFile) {\n addFileRecord(records, 'convention:app', appFile, roots.appBase, 'content')\n continue\n }\n\n const sourceFile = resolveCodeFile(packageSourceBase, relativePath)\n if (!sourceFile) {\n const runtimeFile = packageSourceBase === roots.pkgBase\n ? null\n : resolveCodeFile(roots.pkgBase, relativePath)\n if (runtimeFile) {\n addFileRecord(records, 'convention:package-runtime', runtimeFile, roots.pkgBase, 'content')\n } else {\n records.push(`convention:missing:${relativePath}`)\n }\n continue\n }\n\n const packagePrefix = packageSourceBase === roots.pkgBase ? 'package' : 'package-source'\n addFileRecord(records, `convention:${packagePrefix}`, sourceFile, packageSourceBase, 'content')\n const runtimeFile = resolveRuntimeCounterpart(roots.pkgBase, packageSourceBase, sourceFile)\n if (runtimeFile) {\n addFileRecord(records, 'convention:package-runtime', runtimeFile, roots.pkgBase, 'content')\n } else if (packageSourceBase !== roots.pkgBase) {\n records.push(`convention:package-runtime:missing:${relativePath}`)\n }\n }\n}\n\nfunction addScannedRecords(records: string[], roots: ModuleRoots): void {\n const packageSourceBase = resolveStandaloneSourceMirrorBase(roots.pkgBase) ?? roots.pkgBase\n for (const config of CONTENT_SENSITIVE_SCAN_CONFIGS) {\n for (const scanned of scanModuleDir(roots, config)) {\n const base = scanned.fromApp ? roots.appBase : packageSourceBase\n const filePath = path.join(base, ...config.folder.split('/'), ...scanned.relPath.split('/'))\n let sourceOrigin = 'app'\n if (!scanned.fromApp) {\n sourceOrigin = packageSourceBase === roots.pkgBase ? 'package' : 'package-source'\n }\n addFileRecord(records, `${config.folder}:${sourceOrigin}`, filePath, base, 'content')\n\n if (!scanned.fromApp && packageSourceBase !== roots.pkgBase) {\n const runtimeFile = resolveRuntimeCounterpart(roots.pkgBase, packageSourceBase, filePath)\n if (runtimeFile) {\n addFileRecord(\n records,\n `${config.folder}:package-runtime`,\n runtimeFile,\n roots.pkgBase,\n 'content',\n )\n } else {\n records.push(`${config.folder}:package-runtime:missing:${scanned.relPath}`)\n }\n }\n }\n }\n\n for (const config of ROUTE_SHAPE_SCAN_CONFIGS) {\n for (const scanned of scanModuleDir(roots, config)) {\n const base = scanned.fromApp ? roots.appBase : packageSourceBase\n const folderPath = path.join(base, ...config.folder.split('/'))\n const filePath = path.join(folderPath, ...scanned.relPath.split('/'))\n let sourceOrigin = 'app'\n if (!scanned.fromApp) {\n sourceOrigin = packageSourceBase === roots.pkgBase ? 'package' : 'package-source'\n }\n addFileRecord(\n records,\n `${config.folder}:${sourceOrigin}`,\n filePath,\n base,\n hasInlinePageMetadata(filePath) ? 'content' : 'shape',\n )\n\n let runtimeFile: string | null = null\n if (!scanned.fromApp && packageSourceBase !== roots.pkgBase) {\n runtimeFile = resolveRuntimeCounterpart(roots.pkgBase, packageSourceBase, filePath)\n if (runtimeFile) {\n addFileRecord(\n records,\n `${config.folder}:package-runtime`,\n runtimeFile,\n roots.pkgBase,\n hasInlinePageMetadata(runtimeFile) ? 'content' : 'shape',\n )\n } else {\n records.push(`${config.folder}:package-runtime:missing:${scanned.relPath}`)\n }\n }\n\n const stem = stripModuleCodeExtension(path.basename(filePath))\n const metaCandidates = stem === 'page'\n ? ['page.meta', 'meta']\n : [`${stem}.meta`, 'meta']\n for (const candidate of metaCandidates) {\n const metaPath = resolveCodeFile(path.dirname(filePath), candidate)\n if (!metaPath) continue\n addFileRecord(records, `${config.folder}:meta:${sourceOrigin}`, metaPath, base, 'content')\n }\n\n if (runtimeFile) {\n for (const candidate of metaCandidates) {\n const runtimeMetaPath = resolveCodeFile(path.dirname(runtimeFile), candidate)\n if (!runtimeMetaPath) continue\n addFileRecord(\n records,\n `${config.folder}:meta:package-runtime`,\n runtimeMetaPath,\n roots.pkgBase,\n 'content',\n )\n }\n }\n }\n }\n}\n\nexport function calculateGenerateWatchStructureChecksum(options: {\n modulesFile: string\n moduleRoots: ModuleRoots[]\n}): string {\n const records: string[] = []\n const modulesRecord = fileRecord(options.modulesFile, path.dirname(options.modulesFile), 'content')\n records.push(modulesRecord ?? `missing:${options.modulesFile}`)\n\n for (const roots of options.moduleRoots) {\n const moduleRecords: string[] = []\n addConventionRecords(moduleRecords, roots)\n addScannedRecords(moduleRecords, roots)\n const rootIdentity = moduleRootIdentity(roots)\n records.push(...moduleRecords.map((record) => `${rootIdentity}:${record}`))\n }\n\n return checksum(records.sort((a, b) => a.localeCompare(b)).join('\\n'))\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,MAAM,8BAA8B;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,iCAAiC;AAAA,EACrC,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AACf;AAEA,MAAM,2BAA2B;AAAA,EAC/B,aAAa;AAAA,EACb,aAAa;AACf;AAEA,SAAS,SAAS,OAAuB;AACvC,SAAO,OAAO,WAAW,KAAK,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK;AAC5D;AAEA,SAAS,mBAAmB,OAA4B;AACtD,SAAO,KAAK,UAAU;AAAA,IACpB,MAAM,QAAQ,QAAQ,OAAO,GAAG;AAAA,IAChC,MAAM,QAAQ,QAAQ,OAAO,GAAG;AAAA,EAClC,CAAC;AACH;AAEA,SAAS,WAAW,UAAkB,MAAc,MAA0C;AAC5F,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W,QAAQ,WAAW,EAAE;AAE9D,aAAW,SAAS,QAAQ,aAAa;AACvC,UAAM,gBAA0B,CAAC;AACjC,yBAAqB,eAAe,KAAK;AACzC,sBAAkB,eAAe,KAAK;AACtC,UAAM,eAAe,mBAAmB,KAAK;AAC7C,YAAQ,KAAK,GAAG,cAAc,IAAI,CAAC,WAAW,GAAG,YAAY,IAAI,MAAM,EAAE,CAAC;AAAA,EAC5E;AAEA,SAAO,SAAS,QAAQ,KAAK,CAAC,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC;AACvE;",
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import crypto from 'node:crypto'\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport ts from 'typescript-js'\nimport {\n MODULE_CODE_EXTENSIONS,\n SCAN_CONFIGS,\n resolveStandaloneSourceMirrorBase,\n scanModuleDir,\n stripModuleCodeExtension,\n type ModuleRoots,\n type ScanConfig,\n type ScannedFile,\n} from './generators/scanner'\nimport type {\n GenerateWatchCategory, GenerateWatchChange, GenerateWatchRecord, GenerateWatchSnapshot,\n} from './generate-watch-plan'\n\ntype InputKind = { category: GenerateWatchCategory; extensionId?: string }\ntype WatchRoots = ModuleRoots & { moduleId?: string; from?: string }\nexport type GenerateWatchStructureOptions = {\n modulesFile: string\n moduleRoots: WatchRoots[]\n /** Dependency/configuration inputs whose changes require a conservative full generation. */\n additionalInputs?: string[]\n /** Inputs consumed specifically by OpenAPI generation. */\n openapiInputs?: string[]\n /** Candidate package manifests consumed specifically by web-research adapter discovery. */\n webResearchAdapterInputs?: string[]\n /** Adapter discovery failures that make this capture non-authoritative. */\n webResearchAdapterFullReasons?: readonly string[]\n}\n\n/**\n * Facts derived from one stat identity of a tracked file. Source text and parsed\n * ASTs are capture-local; only these small extracted values outlive a capture.\n */\ntype CachedStructureFile = {\n identity: string\n fingerprint: string\n parseFailed?: true\n pageFingerprint?: string | null\n imports?: { specifiers: string[]; uncertain: boolean }\n pluginConventions?: string[] | null\n supervisorOverride?: boolean\n}\n\ntype GenerateWatchStructureCacheState = {\n files: Map<string, CachedStructureFile>\n}\n\ndeclare const generateWatchStructureCacheBrand: unique symbol\nexport type GenerateWatchStructureCache = {\n readonly [generateWatchStructureCacheBrand]: true\n}\n\nconst cacheStates = new WeakMap<GenerateWatchStructureCache, GenerateWatchStructureCacheState>()\n\nexport function createGenerateWatchStructureCache(): GenerateWatchStructureCache {\n const cache = {} as GenerateWatchStructureCache\n cacheStates.set(cache, { files: new Map() })\n return cache\n}\n\nconst REGISTRY_CONVENTIONS = [\n 'index', 'acl', 'setup', 'runtime', 'encryption', 'ce', 'integration', 'vector',\n 'data/extensions', 'data/fields',\n]\nconst EXTENSION_CONVENTIONS: Readonly<Record<string, string>> = {\n notifications: 'registry.notifications',\n 'notifications.client': 'registry.notifications',\n 'notifications.handlers': 'registry.notifications',\n 'message-types': 'registry.messages',\n 'message-objects': 'registry.messages',\n 'ai-tools': 'registry.ai-tools',\n 'ai-agents': 'registry.ai-agents',\n analytics: 'registry.analytics',\n translations: 'registry.translatable-fields',\n workflows: 'registry.workflows',\n 'inbox-actions': 'registry.inbox-actions',\n 'data/enrichers': 'registry.enrichers',\n 'data/guards': 'registry.guards',\n 'api/interceptors': 'registry.interceptors',\n 'commands/interceptors': 'registry.command-interceptors',\n 'widgets/components': 'registry.component-overrides',\n 'frontend/middleware': 'registry.page-middleware',\n 'backend/middleware': 'registry.page-middleware',\n}\n\n// These two policies mirror the registry's command/legacy-API scans; all other\n// directory discovery is shared with the generator through SCAN_CONFIGS.\nconst COMMAND_SCAN_CONFIG: ScanConfig = {\n folder: 'commands',\n include: (name) => MODULE_CODE_EXTENSIONS.some((extension) => name.endsWith(extension))\n && !name.endsWith('.d.ts') && !/\\.(test|spec)\\.[jt]sx?$/.test(name)\n && !['index', 'shared', 'factory'].includes(stripModuleCodeExtension(name)),\n}\nconst LEGACY_API_SCAN_CONFIGS: ScanConfig[] = ['get', 'post', 'put', 'patch', 'delete'].map((method) => ({\n folder: `api/${method}`,\n include: (name) => /\\.[jt]s$/.test(name) && !/\\.(test|spec)\\.[jt]s$/.test(name),\n}))\n\nfunction checksum(value: string): string {\n return crypto.createHash('md5').update(value).digest('hex')\n}\n\nfunction isMissing(error: unknown): boolean {\n return typeof error === 'object' && error !== null && 'code' in error\n && (error.code === 'ENOENT' || error.code === 'ENOTDIR')\n}\n\nfunction unwrap(node: ts.Expression): ts.Expression {\n while (ts.isParenthesizedExpression(node) || ts.isAsExpression(node)\n || ts.isTypeAssertionExpression(node) || ts.isSatisfiesExpression(node)) node = node.expression\n return node\n}\n\n/** Read only static declaration data; never execute a plugin to watch it. */\nfunction pluginConventions(file: ts.SourceFile): string[] | null {\n const declarations = new Map<string, ts.Expression>()\n let exported: ts.Expression | undefined\n for (const statement of file.statements) {\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name) && declaration.initializer) {\n declarations.set(declaration.name.text, declaration.initializer)\n if (declaration.name.text === 'generatorPlugins'\n && statement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)) {\n exported = declaration.initializer\n }\n }\n }\n } else if (ts.isExportAssignment(statement)) {\n exported ??= statement.expression\n } else if (ts.isImportDeclaration(statement)) {\n if (!statement.importClause?.isTypeOnly) return null\n } else if (!ts.isFunctionDeclaration(statement) && !ts.isInterfaceDeclaration(statement)\n && !ts.isTypeAliasDeclaration(statement) && !ts.isEmptyStatement(statement)) return null\n }\n if (!exported) return null\n const resolve = (expression: ts.Expression, seen = new Set<string>()): ts.Expression | null => {\n const node = unwrap(expression)\n if (!ts.isIdentifier(node)) return node\n if (seen.has(node.text)) return null\n seen.add(node.text)\n const value = declarations.get(node.text)\n return value ? resolve(value, seen) : null\n }\n const plugins = resolve(exported)\n if (!plugins || !ts.isArrayLiteralExpression(plugins)) return null\n const conventions: string[] = []\n for (const element of plugins.elements) {\n const plugin = resolve(element)\n if (!plugin || !ts.isObjectLiteralExpression(plugin)) return null\n let convention: string | undefined\n for (const property of plugin.properties) {\n if (ts.isSpreadAssignment(property) || ts.isComputedPropertyName(property.name)) return null\n if (property.name.getText(file).replace(/^['\"]|['\"]$/g, '') !== 'conventionFile') continue\n const value = ts.isPropertyAssignment(property) ? resolve(property.initializer) : null\n if (!value || !ts.isStringLiteralLike(value)) return null\n convention = value.text\n }\n if (!convention) return null\n conventions.push(convention)\n }\n return conventions\n}\n\n/** `null` when the page exports metadata (content fingerprint applies); otherwise its default-export marker. */\nfunction pageFingerprint(parsed: ts.SourceFile): string | null {\n const metadata = parsed.statements.some((statement) => {\n if (ts.isExportDeclaration(statement)) {\n return !statement.exportClause || (ts.isNamedExports(statement.exportClause)\n && statement.exportClause.elements.some((element) => element.name.text === 'metadata'))\n }\n if (!ts.canHaveModifiers(statement)\n || !ts.getModifiers(statement)?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)) return false\n if (ts.isVariableStatement(statement)) {\n return statement.declarationList.declarations.some((declaration) => /\\bmetadata\\b/.test(declaration.name.getText(parsed)))\n }\n return (ts.isFunctionDeclaration(statement) || ts.isClassDeclaration(statement)) && statement.name?.text === 'metadata'\n })\n if (metadata) return null\n const hasDefault = parsed.statements.some((statement) =>\n (ts.isExportAssignment(statement) && !statement.isExportEquals)\n || (ts.canHaveModifiers(statement) && ts.getModifiers(statement)?.some((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword))\n || (ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause)\n && statement.exportClause.elements.some((element) => element.name.text === 'default')),\n )\n return `page:default:${hasDefault}`\n}\n\nconst SUPERVISOR_OVERRIDE_CALLS = ['applyWorkerOverrides', 'applyCliOverrides']\n\nfunction declaresSupervisorOverride(parsed: ts.SourceFile): boolean {\n const direct = new Set<string>()\n const namespaces = new Set<string>()\n for (const statement of parsed.statements) {\n if (!ts.isImportDeclaration(statement) || !ts.isStringLiteralLike(statement.moduleSpecifier)\n || statement.moduleSpecifier.text !== '@open-mercato/shared/modules/overrides') continue\n const bindings = statement.importClause?.namedBindings\n if (bindings && ts.isNamespaceImport(bindings)) namespaces.add(bindings.name.text)\n if (bindings && ts.isNamedImports(bindings)) {\n for (const element of bindings.elements) {\n if (SUPERVISOR_OVERRIDE_CALLS.includes(element.propertyName?.text ?? element.name.text)) direct.add(element.name.text)\n }\n }\n }\n let found = false\n const visit = (node: ts.Node): void => {\n if (ts.isCallExpression(node)) {\n const expression = node.expression\n if (ts.isIdentifier(expression) && direct.has(expression.text)) found = true\n if (ts.isPropertyAccessExpression(expression) && ts.isIdentifier(expression.expression)\n && namespaces.has(expression.expression.text)\n && SUPERVISOR_OVERRIDE_CALLS.includes(expression.name.text)) found = true\n }\n if (!found) ts.forEachChild(node, visit)\n }\n visit(parsed)\n return found\n}\n\n/** Module specifiers evaluated at load time; `uncertain` marks a non-literal import()/require(). */\nfunction staticImports(parsed: ts.SourceFile): { specifiers: string[]; uncertain: boolean } {\n const specifiers: string[] = []\n let uncertain = false\n const visit = (node: ts.Node): void => {\n // Handler/component bodies are not evaluated to discover registrations.\n // Static imports are still tracked, including imports used by metadata.\n if (ts.isFunctionLike(node)) return\n if (ts.isImportDeclaration(node)) {\n if (node.importClause?.isTypeOnly) return\n const bindings = node.importClause?.namedBindings\n if (!node.importClause?.name && bindings && ts.isNamedImports(bindings)\n && bindings.elements.length > 0 && bindings.elements.every((element) => element.isTypeOnly)) return\n if (ts.isStringLiteralLike(node.moduleSpecifier)) specifiers.push(node.moduleSpecifier.text)\n return\n }\n if (ts.isExportDeclaration(node) && !node.isTypeOnly && node.moduleSpecifier\n && ts.isStringLiteralLike(node.moduleSpecifier)) specifiers.push(node.moduleSpecifier.text)\n if (ts.isCallExpression(node) && (node.expression.kind === ts.SyntaxKind.ImportKeyword\n || (ts.isIdentifier(node.expression) && node.expression.text === 'require'))) {\n const argument = node.arguments[0]\n if (argument && ts.isStringLiteralLike(argument)) specifiers.push(argument.text)\n else uncertain = true\n }\n ts.forEachChild(node, visit)\n }\n visit(parsed)\n return { specifiers, uncertain }\n}\n\nclass SnapshotCollector {\n readonly records = new Map<string, GenerateWatchRecord>()\n readonly fullReasons = new Set<string>()\n private readonly stats = new Map<string, fs.Stats | null>()\n private readonly identities = new Map<string, string | null>()\n readonly uncertainDependencies = new Set<string>()\n readonly uncertainPluginDescriptors = new Set<string>()\n private readonly dependencySeeds = new Map<string, Map<string, InputKind>>()\n readonly inspectedCachePaths = new Set<string>()\n private readonly sources = new Map<string, string>()\n private readonly parsedFiles = new Map<string, ts.SourceFile>()\n\n constructor(private readonly cache: GenerateWatchStructureCacheState) {}\n\n private identity(file: string): string | null {\n if (!this.identities.has(file)) this.stat(file)\n return this.identities.get(file) ?? null\n }\n\n private seedDependency(file: string, kind: InputKind): void {\n const identity = `${kind.category}:${kind.extensionId ?? ''}`\n const kinds = this.dependencySeeds.get(file) ?? new Map<string, InputKind>()\n kinds.set(identity, kind)\n this.dependencySeeds.set(file, kinds)\n }\n\n stat(file: string): fs.Stats | null {\n if (this.stats.has(file)) return this.stats.get(file) ?? null\n try {\n const stat = fs.statSync(file)\n const identity = [stat.dev, stat.ino, stat.size, stat.mtimeMs, stat.ctimeMs].join(':')\n this.stats.set(file, stat)\n this.identities.set(file, identity)\n return stat\n } catch (error) {\n if (!isMissing(error)) this.fullReasons.add(`Cannot inspect generator input: ${file}`)\n this.stats.set(file, null)\n this.identities.set(file, null)\n return null\n }\n }\n\n /** Stat-keyed cache entry for a readable file; unchanged identities are never re-read. */\n entry(file: string): CachedStructureFile | null {\n const stat = this.stat(file)\n const identity = this.identity(file)\n if (!stat?.isFile() || !identity) {\n this.fullReasons.add(`Cannot read generator input: ${file}`)\n return null\n }\n this.inspectedCachePaths.add(file)\n const cached = this.cache.files.get(file)\n if (cached?.identity === identity) return cached\n const source = this.readSource(file)\n if (source === null) return null\n const entry: CachedStructureFile = { identity, fingerprint: checksum(source) }\n this.cache.files.set(file, entry)\n return entry\n }\n\n private readSource(file: string): string | null {\n const known = this.sources.get(file)\n if (known !== undefined) return known\n try {\n const source = fs.readFileSync(file, 'utf8')\n this.sources.set(file, source)\n return source\n } catch {\n this.fullReasons.add(`Cannot read generator input: ${file}`)\n return null\n }\n }\n\n /** Capture-local AST for a file whose cached facts are missing; parse failures are cached per identity. */\n parsed(file: string, entry: CachedStructureFile): ts.SourceFile | null {\n if (entry.parseFailed) {\n this.fullReasons.add(`Cannot parse generator input: ${file}`)\n return null\n }\n const known = this.parsedFiles.get(file)\n if (known) return known\n const source = this.readSource(file)\n if (source === null) return null\n let parsed: ts.SourceFile\n try {\n parsed = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, true)\n } catch {\n this.fullReasons.add(`Cannot parse generator input: ${file}`)\n return null\n }\n const diagnostics = (parsed as ts.SourceFile & { parseDiagnostics?: readonly ts.Diagnostic[] }).parseDiagnostics\n if (diagnostics?.length) {\n entry.parseFailed = true\n this.fullReasons.add(`Cannot parse generator input: ${file}`)\n return null\n }\n this.parsedFiles.set(file, parsed)\n return parsed\n }\n\n record(key: string, file: string, kind: InputKind, fingerprint: string): void {\n this.records.set(key, { key, path: file, ...kind, fingerprint })\n }\n\n file(key: string, file: string, kind: InputKind, mode: 'content' | 'page' | 'membership' | 'stat' = 'content'): void {\n if (!this.stat(file)?.isFile()) return\n if (mode === 'membership') {\n this.record(key, file, kind, 'present')\n return\n }\n if (mode === 'stat') {\n this.record(key, file, kind, this.identity(file) ?? 'present')\n return\n }\n const entry = this.entry(file)\n if (!entry) {\n this.record(key, file, kind, 'unreadable')\n return\n }\n if (mode === 'page') {\n if (entry.pageFingerprint === undefined) {\n const parsed = this.parsed(file, entry)\n if (!parsed) {\n this.record(key, file, kind, 'unparseable')\n return\n }\n entry.pageFingerprint = pageFingerprint(parsed)\n }\n if (entry.pageFingerprint !== null) {\n this.record(key, file, kind, entry.pageFingerprint)\n return\n }\n }\n this.record(key, file, kind, entry.fingerprint)\n if (/\\.[cm]?[jt]sx?$/.test(file)) this.seedDependency(file, kind)\n }\n\n codeFile(base: string, relativePath: string): string | null {\n const stripped = stripModuleCodeExtension(relativePath)\n const candidates = [relativePath, ...MODULE_CODE_EXTENSIONS.map((extension) => `${stripped}${extension}`)]\n for (const candidate of candidates) {\n const file = path.join(base, candidate)\n if (this.stat(file)?.isFile()) return file\n }\n return null\n }\n\n scan(roots: ModuleRoots, config: ScanConfig): ScannedFile[] {\n try {\n return scanModuleDir(roots, config)\n } catch {\n this.fullReasons.add(`Cannot scan generator inputs: ${roots.appBase}, ${roots.pkgBase}/${config.folder}`)\n return []\n }\n }\n\n entries(directory: string): fs.Dirent[] {\n if (!this.stat(directory)?.isDirectory()) return []\n try {\n return fs.readdirSync(directory, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))\n } catch {\n this.fullReasons.add(`Cannot scan generator inputs: ${directory}`)\n return []\n }\n }\n\n pair(identity: string, roots: ModuleRoots, relativePath: string, kind: InputKind, mode: 'content' | 'page' = 'content'): string[] {\n const sourceBase = resolveStandaloneSourceMirrorBase(roots.pkgBase) ?? roots.pkgBase\n const app = this.codeFile(roots.appBase, relativePath)\n const source = app ?? this.codeFile(sourceBase, relativePath)\n // Conventions retain stale compiled inputs after source deletion. Directory\n // scans still enumerate only the authoritative source mirror before pairing.\n const runtime = !app && sourceBase !== roots.pkgBase\n ? this.codeFile(roots.pkgBase, stripModuleCodeExtension(relativePath))\n : source\n const primary = source ?? runtime\n if (!primary) return []\n const logical = stripModuleCodeExtension(relativePath).replace(/\\\\/g, '/')\n const key = `${identity}:${kind.category}:${kind.extensionId ?? ''}:${logical}`\n if (source) this.file(`${key}:source`, source, kind, mode)\n if (runtime && runtime !== source) this.file(`${key}:runtime`, runtime, kind, mode)\n // Physical ownership is part of the fingerprint even for identical bytes.\n this.record(`${key}:authority`, primary, kind, JSON.stringify([source, runtime]))\n return source && runtime && runtime !== source ? [source, runtime] : [primary]\n }\n\n tree(identity: string, directory: string, kind: InputKind, skipTests = true): void {\n for (const entry of this.entries(directory)) {\n if (skipTests && (entry.name === '__tests__' || entry.name === '__mocks__')) continue\n const file = path.join(directory, entry.name)\n if (entry.isDirectory()) this.tree(identity, file, kind, skipTests)\n else if (entry.isFile()) this.file(`${identity}:${file}`, file, kind)\n }\n }\n\n supervisor(appSource: string): void {\n const pending = [appSource]\n let found = false\n while (pending.length > 0 && !found) {\n const directory = pending.pop()!\n for (const entry of this.entries(directory)) {\n const file = path.join(directory, entry.name)\n if (entry.isDirectory()) {\n if (entry.name !== '__tests__' && entry.name !== 'node_modules') pending.push(file)\n continue\n }\n if (!/\\.[cm]?tsx?$/.test(entry.name) || /(?:^|\\.)test\\.[cm]?tsx?$/.test(entry.name)) continue\n const cached = this.entry(file)\n if (!cached) continue\n if (cached.supervisorOverride === undefined) {\n if (!this.readSource(file)?.includes('@open-mercato/shared/modules/overrides')) {\n cached.supervisorOverride = false\n continue\n }\n const parsed = this.parsed(file, cached)\n if (!parsed) continue\n cached.supervisorOverride = declaresSupervisorOverride(parsed)\n }\n if (cached.supervisorOverride) {\n found = true\n break\n }\n }\n }\n this.record('supervisor-overrides', appSource, { category: 'registry-convention', extensionId: 'supervisor' }, String(found))\n }\n\n dependencies(appSource: string): void {\n const visited = new Set<string>()\n const pending = [...this.dependencySeeds]\n .flatMap(([file, kinds]) => [...kinds.entries()].map(([identity, kind]) => ({ file, identity, kind })))\n .sort((left, right) => right.file.localeCompare(left.file) || right.identity.localeCompare(left.identity))\n while (pending.length > 0) {\n const { file, identity, kind } = pending.pop()!\n const visitKey = `${identity}:${file}`\n if (visited.has(visitKey)) continue\n visited.add(visitKey)\n const cached = this.entry(file)\n if (!cached) continue\n if (!cached.imports) {\n const parsed = this.parsed(file, cached)\n if (!parsed) continue\n cached.imports = staticImports(parsed)\n }\n if (cached.imports.uncertain) this.uncertainDependencies.add(file)\n const imports = cached.imports.specifiers\n for (const specifier of imports) {\n if (!specifier.startsWith('.') && !specifier.startsWith('@/')) continue\n const target = specifier.startsWith('@/')\n ? path.join(appSource, specifier.slice(2)) : path.resolve(path.dirname(file), specifier)\n const resolved = this.codeFile(path.dirname(target), path.basename(target))\n ?? this.codeFile(target, 'index')\n const dependencyKey = `dependency:${identity}:${file}:${target}`\n if (!resolved) {\n // Keep an absence record so a newly supplied helper invalidates the plan.\n this.record(dependencyKey, target, kind, 'missing')\n continue\n }\n // A generator's own outputs must not feed back into its watcher baseline.\n if (resolved.includes(`${path.sep}.mercato${path.sep}`) || resolved.includes(`${path.sep}generated${path.sep}`)) continue\n const fingerprint = this.entry(resolved)?.fingerprint ?? 'unreadable'\n this.record(dependencyKey, resolved, kind, `${resolved}:${fingerprint}`)\n if (/\\.[cm]?[jt]sx?$/.test(resolved)) pending.push({ file: resolved, identity, kind })\n }\n }\n }\n}\n\nfunction addModule(collector: SnapshotCollector, roots: WatchRoots, index: number, plugins: Set<string>): void {\n const distMarker = `${path.sep}dist${path.sep}modules${path.sep}`\n const distIndex = roots.pkgBase.lastIndexOf(distMarker)\n if (distIndex >= 0) {\n const packageRoot = roots.pkgBase.slice(0, distIndex)\n collector.stat(path.join(packageRoot, 'src', 'modules', roots.pkgBase.slice(distIndex + distMarker.length)))\n }\n const sourceBase = resolveStandaloneSourceMirrorBase(roots.pkgBase) ?? roots.pkgBase\n const identity = `module:${index}:${roots.moduleId ?? path.basename(roots.appBase)}:${roots.appBase}:${roots.pkgBase}`\n collector.record(`${identity}:roots`, roots.appBase, { category: 'configuration' }, JSON.stringify([\n Object.entries(roots).sort(([left], [right]) => left.localeCompare(right)), sourceBase,\n collector.stat(roots.appBase)?.isDirectory() ?? false, collector.stat(roots.pkgBase)?.isDirectory() ?? false,\n ]))\n const convention = (relativePath: string, kind: InputKind) => collector.pair(identity, roots, `${relativePath}.ts`, kind)\n for (const relativePath of REGISTRY_CONVENTIONS) convention(relativePath, { category: 'registry-convention' })\n for (const [relativePath, extensionId] of Object.entries(EXTENSION_CONVENTIONS)) {\n convention(relativePath, { category: 'extension', extensionId })\n }\n collector.pair(identity, roots, 'widgets/payments/client.tsx', { category: 'extension', extensionId: 'registry.notifications' })\n for (const category of ['cli', 'di', 'search', 'events'] as const) convention(category, { category })\n convention('widgets/injection-table', { category: 'injection-widgets' })\n for (const descriptor of convention('generators', { category: 'generator-plugin' })) {\n const cached = collector.entry(descriptor)\n if (cached && cached.pluginConventions === undefined) {\n const parsed = collector.parsed(descriptor, cached)\n if (parsed) cached.pluginConventions = pluginConventions(parsed)\n }\n const discovered = cached?.pluginConventions ?? null\n if (discovered === null) collector.uncertainPluginDescriptors.add(descriptor)\n else for (const file of discovered) plugins.add(file)\n }\n\n // Entity generators use direct app/package candidates, including legacy db and\n // override/schema fallbacks, rather than resolveModuleFile's source authority.\n for (const base of new Set([roots.appBase, roots.pkgBase, sourceBase])) {\n for (const directory of ['data', 'db']) {\n for (const stem of ['entities.override', 'entities', 'schema']) {\n for (const extension of MODULE_CODE_EXTENSIONS) {\n const file = path.join(base, directory, `${stem}${extension}`)\n collector.file(`${identity}:entities:${file}`, file, { category: 'entities' })\n }\n }\n }\n }\n if (distIndex >= 0) {\n const packageRoot = roots.pkgBase.slice(0, distIndex)\n const direct = path.join(packageRoot, 'generated')\n collector.record(`${identity}:package-entities-direct-root`, direct, { category: 'entities' },\n collector.stat(direct)?.isDirectory() ? 'directory' : 'missing')\n const generated = collector.stat(direct)?.isDirectory() ? direct : path.join(packageRoot, 'dist', 'generated')\n collector.record(`${identity}:package-entities-root`, generated, { category: 'entities' }, generated)\n for (const extension of ['.ts', '.js']) {\n const ids = path.join(generated, `entities.ids.generated${extension}`)\n collector.file(`${identity}:package-entities:${ids}`, ids, { category: 'entities' })\n for (const entry of collector.entries(path.join(generated, 'entities'))) {\n if (!entry.isDirectory()) continue\n const fields = path.join(generated, 'entities', entry.name, `index${extension}`)\n collector.file(`${identity}:package-entities:${fields}`, fields, { category: 'entities' })\n }\n }\n }\n const scans: Array<[ScanConfig, GenerateWatchCategory]> = [\n [SCAN_CONFIGS.apiRoutes, 'api-route'], [SCAN_CONFIGS.apiPlainFiles, 'api-route'],\n ...LEGACY_API_SCAN_CONFIGS.map((config): [ScanConfig, GenerateWatchCategory] => [config, 'api-route']),\n [COMMAND_SCAN_CONFIG, 'commands'], [SCAN_CONFIGS.subscribers, 'subscribers'],\n [SCAN_CONFIGS.workers, 'workers'], [SCAN_CONFIGS.dashboardWidgets, 'dashboard-widgets'],\n [SCAN_CONFIGS.injectionWidgets, 'injection-widgets'],\n [SCAN_CONFIGS.frontendPages, 'frontend-page'], [SCAN_CONFIGS.backendPages, 'backend-page'],\n ]\n for (const [config, category] of scans) {\n for (const scanned of collector.scan(roots, config)) {\n const relativePath = `${config.folder}/${scanned.relPath}`\n // Exact conventions in route/page directories are not route registrations.\n if (EXTENSION_CONVENTIONS[stripModuleCodeExtension(relativePath)]) continue\n const page = category === 'frontend-page' || category === 'backend-page'\n const files = collector.pair(identity, roots, relativePath, { category }, page ? 'page' : 'content')\n if (!page) continue\n for (const file of files) {\n const stem = stripModuleCodeExtension(path.basename(file))\n for (const candidate of [stem === 'page' ? 'page.meta' : `${stem}.meta`, 'meta']) {\n const metadata = collector.codeFile(path.dirname(file), candidate)\n if (metadata) collector.file(`${identity}:${category}:metadata:${metadata}`, metadata, { category })\n }\n }\n }\n }\n for (const base of new Set([sourceBase, roots.appBase])) {\n const directory = path.join(base, 'i18n')\n for (const entry of collector.entries(directory)) {\n if (!entry.isFile() || !/^[a-zA-Z0-9][a-zA-Z0-9_-]*\\.json$/.test(entry.name)) continue\n const file = path.join(directory, entry.name)\n collector.file(`${identity}:i18n:${file}`, file, { category: 'i18n' }, 'membership')\n if (base === sourceBase && sourceBase !== roots.pkgBase) {\n const runtime = path.join(roots.pkgBase, 'i18n', entry.name)\n collector.file(`${identity}:i18n:runtime:${runtime}`, runtime, { category: 'i18n' }, 'membership')\n }\n }\n collector.tree(`${identity}:agents`, path.join(base, 'agents'), { category: 'extension', extensionId: 'registry.agent-files' })\n }\n}\n\nexport function collectGenerateWatchStructureSnapshot(\n options: GenerateWatchStructureOptions,\n cache?: GenerateWatchStructureCache,\n): GenerateWatchSnapshot {\n const cacheState = cache ? cacheStates.get(cache) : { files: new Map<string, CachedStructureFile>() }\n if (!cacheState) throw new TypeError('Invalid generate watch structure cache')\n const collector = new SnapshotCollector(cacheState)\n for (const reason of options.webResearchAdapterFullReasons ?? []) collector.fullReasons.add(reason)\n collector.file(`configuration:${options.modulesFile}`, options.modulesFile, { category: 'configuration' })\n const plugins = new Set<string>()\n options.moduleRoots.forEach((roots, index) => addModule(collector, roots, index, plugins))\n options.moduleRoots.forEach((roots, index) => {\n const identity = `module:${index}:${roots.moduleId ?? path.basename(roots.appBase)}:${roots.appBase}:${roots.pkgBase}`\n for (const relativePath of plugins) collector.pair(identity, roots, relativePath, { category: 'generator-plugin' })\n })\n const knownInputs = new Map<string, GenerateWatchRecord>()\n for (const record of collector.records.values()) {\n if (record.category !== 'configuration') knownInputs.set(record.path, record)\n }\n const ordered = (inputs: readonly string[] | undefined) =>\n [...new Set(inputs ?? [])].sort((left, right) => left < right ? -1 : left > right ? 1 : 0)\n for (const input of ordered(options.additionalInputs)) {\n if (knownInputs.has(input)) continue\n const stat = collector.stat(input)\n if (stat?.isFile()) collector.file(`configuration:${input}`, input, { category: 'configuration' })\n else collector.record(`configuration:${input}`, input, { category: 'configuration' }, stat?.isDirectory() ? 'directory' : 'missing')\n }\n const addSpecializedInputs = (\n inputs: readonly string[] | undefined,\n kind: InputKind,\n keyPrefix: string,\n mode: 'content' | 'stat' = 'content',\n ) => {\n for (const input of ordered(inputs)) {\n const stat = collector.stat(input)\n if (stat?.isFile()) collector.file(`${keyPrefix}:${input}`, input, kind, mode)\n else collector.record(`${keyPrefix}:${input}`, input, kind, stat?.isDirectory() ? 'directory' : 'missing')\n }\n }\n addSpecializedInputs(options.openapiInputs, { category: 'openapi' }, 'openapi-input')\n addSpecializedInputs(\n options.webResearchAdapterInputs,\n { category: 'web-research-adapters' },\n 'web-research-adapter-input',\n 'stat',\n )\n collector.supervisor(path.dirname(options.modulesFile))\n collector.dependencies(path.dirname(options.modulesFile))\n // A dynamic descriptor is valid source, not a transient failed capture. Until\n // its dependencies can be proven, watch all potential module contributions.\n // Changes require a full suite, but an unchanged successful baseline is clean.\n if (collector.uncertainPluginDescriptors.size > 0 || collector.uncertainDependencies.size > 0) {\n const category = collector.uncertainPluginDescriptors.size > 0 ? 'generator-plugin' : 'unknown'\n for (const roots of options.moduleRoots) {\n for (const base of new Set([roots.appBase, roots.pkgBase, resolveStandaloneSourceMirrorBase(roots.pkgBase)])) {\n if (base) collector.tree(`uncertain-dependencies:${base}`, base, { category }, false)\n }\n }\n for (const descriptor of collector.uncertainPluginDescriptors) {\n collector.record(`uncertain-plugin:${descriptor}`, descriptor, { category: 'generator-plugin' }, 'unresolved-conventions')\n }\n for (const dependency of collector.uncertainDependencies) {\n collector.record(`uncertain-dependency:${dependency}`, dependency, { category: 'unknown' }, 'unresolved-import')\n }\n }\n const records = new Map([...collector.records].sort(([left], [right]) => left.localeCompare(right)))\n const fullReasons = [...collector.fullReasons].sort((left, right) => left < right ? -1 : left > right ? 1 : 0)\n if (fullReasons.length === 0) {\n for (const cachedPath of cacheState.files.keys()) {\n if (!collector.inspectedCachePaths.has(cachedPath)) cacheState.files.delete(cachedPath)\n }\n }\n return {\n checksum: checksum(JSON.stringify([[...records.values()], fullReasons])),\n records,\n fullReasons,\n }\n}\n\nexport function diffGenerateWatchStructureSnapshots(\n previous: GenerateWatchSnapshot,\n next: GenerateWatchSnapshot,\n): GenerateWatchChange[] {\n const changes: GenerateWatchChange[] = []\n for (const key of [...new Set([...previous.records.keys(), ...next.records.keys()])].sort((left, right) => left < right ? -1 : left > right ? 1 : 0)) {\n const before = previous.records.get(key)\n const after = next.records.get(key)\n if (before && after && before.fingerprint === after.fingerprint && before.path === after.path\n && before.category === after.category && before.extensionId === after.extensionId) continue\n const record = after ?? before!\n changes.push({\n key, kind: !before ? 'add' : !after ? 'delete' : 'change',\n category: record.category, path: record.path,\n ...(record.extensionId ? { extensionId: record.extensionId } : {}),\n })\n }\n return changes\n}\n\n/** Legacy callers intentionally receive only the opaque snapshot checksum. */\nexport function calculateGenerateWatchStructureChecksum(options: GenerateWatchStructureOptions): string {\n return collectGenerateWatchStructureSnapshot(options).checksum\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AA2CP,MAAM,cAAc,oBAAI,QAAuE;AAExF,SAAS,oCAAiE;AAC/E,QAAM,QAAQ,CAAC;AACf,cAAY,IAAI,OAAO,EAAE,OAAO,oBAAI,IAAI,EAAE,CAAC;AAC3C,SAAO;AACT;AAEA,MAAM,uBAAuB;AAAA,EAC3B;AAAA,EAAS;AAAA,EAAO;AAAA,EAAS;AAAA,EAAW;AAAA,EAAc;AAAA,EAAM;AAAA,EAAe;AAAA,EACvE;AAAA,EAAmB;AACrB;AACA,MAAM,wBAA0D;AAAA,EAC9D,eAAe;AAAA,EACf,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,WAAW;AAAA,EACX,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,sBAAsB;AACxB;AAIA,MAAM,sBAAkC;AAAA,EACtC,QAAQ;AAAA,EACR,SAAS,CAAC,SAAS,uBAAuB,KAAK,CAAC,cAAc,KAAK,SAAS,SAAS,CAAC,KACjF,CAAC,KAAK,SAAS,OAAO,KAAK,CAAC,0BAA0B,KAAK,IAAI,KAC/D,CAAC,CAAC,SAAS,UAAU,SAAS,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AAC,GAAG,SAAS,QAAQ,KAAK,GAAG,GAAG,KAAK,QAAQ,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,UAAU,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI,CAAC,GAAG;AACpJ,UAAM,SAAS,SAAS,QAAQ,IAAI,GAAG;AACvC,UAAM,QAAQ,KAAK,QAAQ,IAAI,GAAG;AAClC,QAAI,UAAU,SAAS,OAAO,gBAAgB,MAAM,eAAe,OAAO,SAAS,MAAM,QACpF,OAAO,aAAa,MAAM,YAAY,OAAO,gBAAgB,MAAM,YAAa;AACrF,UAAM,SAAS,SAAS;AACxB,YAAQ,KAAK;AAAA,MACX;AAAA,MAAK,MAAM,CAAC,SAAS,QAAQ,CAAC,QAAQ,WAAW;AAAA,MACjD,UAAU,OAAO;AAAA,MAAU,MAAM,OAAO;AAAA,MACxC,GAAI,OAAO,cAAc,EAAE,aAAa,OAAO,YAAY,IAAI,CAAC;AAAA,IAClE,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAGO,SAAS,wCAAwC,SAAgD;AACtG,SAAO,sCAAsC,OAAO,EAAE;AACxD;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -992,6 +992,7 @@ function createAgentFilesExtension(resolver) {
|
|
|
992
992
|
return {
|
|
993
993
|
id: "registry.agent-files",
|
|
994
994
|
outputFiles: [],
|
|
995
|
+
usesSharedImportIds: false,
|
|
995
996
|
scanModule(ctx) {
|
|
996
997
|
if (ctx.moduleId === ORCHESTRATOR_MODULE_ID) sawOrchestratorModule = true;
|
|
997
998
|
if (!repoRoot) {
|