@saptools/service-flow 0.1.32 → 0.1.34
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/CHANGELOG.md +14 -0
- package/README.md +4 -0
- package/TECHNICAL-NOTE.md +8 -0
- package/dist/{chunk-VT5FVMOA.js → chunk-5SR4SFSU.js} +70 -11
- package/dist/chunk-5SR4SFSU.js.map +1 -0
- package/dist/cli.js +62 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-VT5FVMOA.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/discovery/discover-repositories.ts","../src/utils/path-utils.ts","../src/parsers/package-json-parser.ts","../src/parsers/cds-parser.ts","../src/parsers/decorator-parser.ts","../src/parsers/ts-project.ts","../src/parsers/handler-registration-parser.ts","../src/utils/redaction.ts","../src/linker/odata-path-normalizer.ts","../src/parsers/outbound-call-parser.ts","../src/linker/external-http-target.ts","../src/parsers/service-binding-parser.ts","../src/linker/dynamic-edge-resolver.ts","../src/linker/remote-query-target.ts","../src/linker/service-resolver.ts","../src/linker/helper-package-linker.ts","../src/linker/operation-decorator-normalizer.ts","../src/linker/cross-repo-linker.ts","../src/trace/trace-engine.ts"],"sourcesContent":["import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport type { DiscoveredRepository } from '../types.js';\nimport { relativePath } from '../utils/path-utils.js';\nexport async function discoverRepositories(\n rootPath: string,\n ignore: readonly string[]\n): Promise<DiscoveredRepository[]> {\n const root = path.resolve(rootPath);\n const ignored = new Set(ignore);\n const found: DiscoveredRepository[] = [];\n async function isRealGitMarker(dir: string): Promise<boolean> {\n const gitPath = path.join(dir, '.git');\n try {\n const st = await fs.stat(gitPath);\n if (st.isDirectory()) {\n const children = await fs.readdir(gitPath);\n return children.includes('HEAD') || children.includes('config');\n }\n if (st.isFile()) {\n const text = await fs.readFile(gitPath, 'utf8');\n return text.trimStart().startsWith('gitdir:');\n }\n } catch {\n /* not a normal git marker */\n }\n try {\n const fixture = await fs.stat(path.join(dir, '.git-fixture'));\n return fixture.isFile() || fixture.isDirectory();\n } catch {\n return false;\n }\n }\n async function walk(dir: string): Promise<void> {\n const rel = relativePath(root, dir);\n if (rel !== '.' && rel.split('/').some((part) => ignored.has(part))) return;\n let entries: Array<{ name: string; isDirectory: () => boolean }>;\n try {\n entries = await fs.readdir(dir, { withFileTypes: true });\n } catch {\n return;\n }\n const hasMarker = entries.some((e) => e.name === '.git' || e.name === '.git-fixture');\n if (hasMarker && await isRealGitMarker(dir)) {\n found.push({\n name: path.basename(dir),\n absolutePath: dir,\n relativePath: relativePath(root, dir),\n isGitRepo: true\n });\n }\n for (const entry of entries)\n if (entry.isDirectory() && !ignore.includes(entry.name))\n await walk(path.join(dir, entry.name));\n }\n await walk(root);\n return found.sort((a, b) => a.relativePath.localeCompare(b.relativePath));\n}\n","import path from 'node:path';\nexport function normalizePath(value: string): string {\n return value.split(path.sep).join('/');\n}\nexport function relativePath(root: string, value: string): string {\n return normalizePath(path.relative(root, value) || '.');\n}\nexport function ensureLeadingSlash(value: string): string {\n return value.startsWith('/') ? value : `/${value}`;\n}\nexport function stripQuotes(value: string): string {\n return value.replace(/^['\"`]|['\"`]$/g, '');\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport type { CdsRequire, PackageFacts } from '../types.js';\nfunction recordOfString(value: unknown): Record<string, string> {\n if (!value || typeof value !== 'object') return {};\n return Object.fromEntries(\n Object.entries(value).filter(([, v]) => typeof v === 'string')\n ) as Record<string, string>;\n}\nfunction readRequires(cds: unknown): CdsRequire[] {\n const requires =\n cds && typeof cds === 'object' && 'requires' in cds\n ? (cds as { requires?: unknown }).requires\n : undefined;\n if (!requires || typeof requires !== 'object') return [];\n return Object.entries(requires).flatMap(([alias, raw]) => {\n if (!raw || typeof raw !== 'object') return [];\n const obj = raw as Record<string, unknown>;\n const credentials =\n obj.credentials && typeof obj.credentials === 'object'\n ? (obj.credentials as Record<string, unknown>)\n : {};\n return [\n {\n alias,\n kind: typeof obj.kind === 'string' ? obj.kind : undefined,\n model: typeof obj.model === 'string' ? obj.model : undefined,\n destination:\n typeof credentials.destination === 'string'\n ? credentials.destination\n : undefined,\n servicePath:\n typeof credentials.path === 'string' ? credentials.path : undefined,\n requestTimeout:\n typeof credentials.requestTimeout === 'number'\n ? credentials.requestTimeout\n : undefined,\n rawJson: JSON.stringify(raw)\n }\n ];\n });\n}\nexport async function parsePackageJson(\n repoPath: string\n): Promise<PackageFacts> {\n try {\n const raw = await fs.readFile(path.join(repoPath, 'package.json'), 'utf8');\n const json = JSON.parse(raw) as Record<string, unknown>;\n return {\n packageName: typeof json.name === 'string' ? json.name : undefined,\n packageVersion:\n typeof json.version === 'string' ? json.version : undefined,\n dependencies: {\n ...recordOfString(json.dependencies),\n ...recordOfString(json.devDependencies)\n },\n cdsRequires: readRequires(json.cds),\n scripts: recordOfString(json.scripts)\n };\n } catch {\n return { dependencies: {}, cdsRequires: [], scripts: {} };\n }\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport type { CdsOperationFact, CdsServiceFact } from '../types.js';\nimport { ensureLeadingSlash, normalizePath } from '../utils/path-utils.js';\n\nfunction lineOf(text: string, index: number): number {\n return text.slice(0, index).split('\\n').length;\n}\n\nfunction maskCommentsAndStrings(text: string): string {\n let out = '';\n let mode: 'code' | 'line' | 'block' | 'single' | 'double' | 'template' =\n 'code';\n for (let i = 0; i < text.length; i += 1) {\n const c = text[i] ?? '';\n const n = text[i + 1] ?? '';\n if (mode === 'code' && c === '/' && n === '/') {\n mode = 'line';\n out += ' ';\n i += 1;\n continue;\n }\n if (mode === 'code' && c === '/' && n === '*') {\n mode = 'block';\n out += ' ';\n i += 1;\n continue;\n }\n if (mode === 'line' && c === '\\n') mode = 'code';\n if (mode === 'block' && c === '*' && n === '/') {\n mode = 'code';\n out += ' ';\n i += 1;\n continue;\n }\n if (mode === 'code' && (c === \"'\" || c === '\"' || c === '`')) {\n mode = c === \"'\" ? 'single' : c === '\"' ? 'double' : 'template';\n out += ' ';\n continue;\n }\n if ((mode === 'single' && c === \"'\") || (mode === 'double' && c === '\"') || (mode === 'template' && c === '`'))\n mode = 'code';\n out += mode === 'code' || c === '\\n' ? c : ' ';\n }\n return out;\n}\n\nfunction readAnnotation(text: string, index: number): { end: number; raw: string } | undefined {\n if (text[index] !== '@') return undefined;\n let i = index + 1;\n while (/\\s/.test(text[i] ?? '')) i += 1;\n if (text[i] !== '(') return undefined;\n let depth = 0;\n for (; i < text.length; i += 1) {\n if (text[i] === '(') depth += 1;\n if (text[i] === ')') depth -= 1;\n if (depth === 0) return { end: i + 1, raw: text.slice(index, i + 1) };\n }\n return undefined;\n}\n\nfunction collectAnnotations(text: string, index: number): { end: number; raw: string } {\n let i = index;\n let raw = '';\n while (i < text.length) {\n while (/\\s/.test(text[i] ?? '')) i += 1;\n const annotation = readAnnotation(text, i);\n if (!annotation) break;\n raw += annotation.raw;\n i = annotation.end;\n }\n return { end: i, raw };\n}\n\nfunction pathAnnotation(raw: string): string | undefined {\n return /path\\s*:\\s*['\"]([^'\"]+)['\"]/s.exec(raw)?.[1];\n}\n\nfunction matchingBrace(text: string, open: number): number {\n let depth = 0;\n for (let i = open; i < text.length; i += 1) {\n if (text[i] === '{') depth += 1;\n if (text[i] === '}') depth -= 1;\n if (depth === 0) return i;\n }\n return text.length - 1;\n}\n\nfunction operationsFromBody(text: string, maskedBody: string, bodyOffset: number, filePath: string): CdsOperationFact[] {\n return [...maskedBody.matchAll(/\\b(action|function|event)\\s+(\\w+)\\s*(?:\\(([^)]*)\\))?\\s*(?:returns\\s+([^;{]+))?/g)].map((m) => ({\n operationType: (m[1] as 'action' | 'function' | 'event') ?? 'action',\n operationName: m[2] ?? 'unknown',\n operationPath: ensureLeadingSlash(m[2] ?? 'unknown'),\n paramsJson: JSON.stringify((m[3] ?? '').split(',').map((part) => part.trim()).filter(Boolean)),\n returnType: m[4]?.trim(),\n sourceFile: normalizePath(filePath),\n sourceLine: lineOf(text, bodyOffset + (m.index ?? 0))\n }));\n}\n\nexport async function parseCdsFile(repoPath: string, filePath: string): Promise<CdsServiceFact[]> {\n const absolute = path.join(repoPath, filePath);\n const text = await fs.readFile(absolute, 'utf8');\n const masked = maskCommentsAndStrings(text);\n const namespace = /namespace\\s+([\\w.]+)\\s*;/.exec(masked)?.[1];\n const services: CdsServiceFact[] = [];\n const pendingAnnotations: Array<{ end: number; raw: string }> = [];\n for (const a of masked.matchAll(/@\\s*\\(/g)) {\n const annotation = collectAnnotations(masked, a.index ?? 0);\n pendingAnnotations.push(annotation);\n }\n const serviceRegex = /\\b(extend\\s+)?service\\s+([\\w.]+)\\b/g;\n let match: RegExpExecArray | null;\n while ((match = serviceRegex.exec(masked))) {\n const afterName = collectAnnotations(masked, serviceRegex.lastIndex);\n const open = masked.indexOf('{', afterName.end);\n if (open === -1) continue;\n const matchIndex = match.index;\n const prefix = pendingAnnotations\n .filter((a) => a.end <= matchIndex && matchIndex - a.end < 8)\n .map((a) => a.raw)\n .join('');\n const annotations = `${prefix}${afterName.raw}`;\n const end = matchingBrace(masked, open);\n const body = masked.slice(open + 1, end);\n const name = match[2] ?? 'UnknownService';\n const serviceName = name.split('.').pop() ?? name;\n const servicePath = ensureLeadingSlash(pathAnnotation(annotations) ?? serviceName);\n services.push({\n namespace,\n serviceName,\n qualifiedName: name.includes('.') ? name : namespace ? `${namespace}.${name}` : name,\n servicePath,\n isExtend: Boolean(match[1]),\n sourceFile: normalizePath(filePath),\n sourceLine: lineOf(text, match.index),\n operations: operationsFromBody(text, body, open + 1, filePath)\n });\n serviceRegex.lastIndex = end + 1;\n }\n const baseOps = new Map(services.filter((s) => !s.isExtend).map((s) => [s.qualifiedName, s.operations]));\n for (const service of services.filter((s) => s.isExtend && s.operations.length === 0)) {\n const inherited = baseOps.get(service.qualifiedName) ?? baseOps.get(service.serviceName);\n if (inherited) service.operations = inherited.map((op) => ({ ...op, sourceFile: service.sourceFile, sourceLine: service.sourceLine }));\n }\n return services;\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport ts from 'typescript';\nimport type { HandlerClassFact } from '../types.js';\nimport { createSourceFile } from './ts-project.js';\nimport { normalizePath, stripQuotes } from '../utils/path-utils.js';\nfunction line(sf: ts.SourceFile, pos: number): number {\n return sf.getLineAndCharacterOfPosition(pos).line + 1;\n}\nfunction decs(node: ts.Node): ts.Decorator[] {\n return ts.canHaveDecorators(node) ? [...(ts.getDecorators(node) ?? [])] : [];\n}\nfunction callName(d: ts.Decorator): string {\n const e = d.expression;\n return ts.isCallExpression(e) ? e.expression.getText() : e.getText();\n}\nfunction firstArg(d: ts.Decorator): string {\n const e = d.expression;\n return ts.isCallExpression(e) && e.arguments[0]\n ? e.arguments[0].getText()\n : '';\n}\nexport async function parseDecorators(\n repoPath: string,\n filePath: string\n): Promise<HandlerClassFact[]> {\n const text = await fs.readFile(path.join(repoPath, filePath), 'utf8');\n const sf = createSourceFile(filePath, text);\n const constants = new Map<string, string>();\n const handlers: HandlerClassFact[] = [];\n function visit(node: ts.Node): void {\n if (\n ts.isVariableDeclaration(node) &&\n ts.isIdentifier(node.name) &&\n node.initializer &&\n ts.isStringLiteralLike(node.initializer)\n )\n constants.set(node.name.text, node.initializer.text);\n if (ts.isClassDeclaration(node)) {\n const className = node.name?.text ?? 'AnonymousHandler';\n const hasHandler = decs(node).some((d) => callName(d) === 'Handler');\n const methods = node.members.filter(ts.isMethodDeclaration).flatMap((m) =>\n decs(m)\n .filter((d) =>\n ['Func', 'Action', 'On', 'Event'].includes(callName(d))\n )\n .map((d) => {\n const raw = firstArg(d);\n const value =\n raw.startsWith('\"') || raw.startsWith(\"'\") || raw.startsWith('`')\n ? stripQuotes(raw)\n : (constants.get(raw) ??\n (raw.endsWith('.name') ? raw.split('.').at(-2) : undefined));\n return {\n methodName: m.name.getText(),\n decoratorKind: callName(d),\n decoratorValue: value,\n decoratorRawExpression: raw,\n sourceFile: normalizePath(filePath),\n sourceLine: line(sf, m.getStart())\n };\n })\n );\n if (hasHandler || methods.length > 0)\n handlers.push({\n className,\n sourceFile: normalizePath(filePath),\n sourceLine: line(sf, node.getStart()),\n methods\n });\n }\n ts.forEachChild(node, visit);\n }\n visit(sf);\n return handlers;\n}\n","import ts from 'typescript';\nexport function createSourceFile(\n filePath: string,\n text: string\n): ts.SourceFile {\n return ts.createSourceFile(\n filePath,\n text,\n ts.ScriptTarget.Latest,\n true,\n filePath.endsWith('.js') ? ts.ScriptKind.JS : ts.ScriptKind.TS\n );\n}\n","import fsSync from 'node:fs';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport ts from 'typescript';\nimport type { HandlerRegistrationFact } from '../types.js';\nimport { normalizePath } from '../utils/path-utils.js';\n\ninterface ImportEvidence { importedName: string; source: string }\ninterface ClassEvidence { className: string; importSource?: string }\ninterface FileExports { arrays: Map<string, ClassEvidence[]>; defaultArray?: ClassEvidence[]; aliases: Map<string, string> }\n\nconst MAX_EXPORT_DEPTH = 5;\n\nfunction lineOf(sourceFile: ts.SourceFile, node: ts.Node): number {\n return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1;\n}\nfunction isRelative(source: string): boolean {\n return source.startsWith('./') || source.startsWith('../');\n}\nfunction sourceText(node: ts.PropertyName, sourceFile: ts.SourceFile): string | undefined {\n if (ts.isIdentifier(node) || ts.isStringLiteral(node) || ts.isNumericLiteral(node)) return node.text;\n return node.getText(sourceFile);\n}\nfunction importSourceFor(identifier: string, imports: Map<string, ImportEvidence>): string | undefined {\n const evidence = imports.get(identifier);\n return evidence ? `${evidence.source}#${evidence.importedName}` : undefined;\n}\n\nexport async function parseHandlerRegistrations(repoPath: string, filePath: string): Promise<HandlerRegistrationFact[]> {\n const absolutePath = path.join(repoPath, filePath);\n const text = await fs.readFile(absolutePath, 'utf8');\n const sourceFile = ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const imports = collectImports(sourceFile);\n const localArrays = collectLocalArrays(sourceFile, imports, new Map(), repoPath, filePath);\n const out: HandlerRegistrationFact[] = [];\n\n function emitFromExpression(expression: ts.Expression, call: ts.CallExpression): void {\n const classes = resolveArrayExpression(expression, localArrays, imports, repoPath, filePath, new Set());\n for (const cls of classes) {\n out.push({\n className: cls.className,\n importSource: cls.importSource,\n registrationFile: normalizePath(filePath),\n registrationLine: lineOf(sourceFile, call),\n registrationKind: 'combined-handler-class',\n confidence: 0.95,\n });\n }\n if (classes.length === 0) {\n out.push({\n registrationFile: normalizePath(filePath),\n registrationLine: lineOf(sourceFile, call),\n registrationKind: 'combined-handler',\n confidence: 0.75,\n });\n }\n }\n\n function visit(node: ts.Node): void {\n if (ts.isCallExpression(node) && isRegistrationCall(node)) {\n const handlerExpr = handlerExpression(node, sourceFile);\n if (handlerExpr) emitFromExpression(handlerExpr, node);\n else out.push({ registrationFile: normalizePath(filePath), registrationLine: lineOf(sourceFile, node), registrationKind: 'combined-handler', confidence: 0.75 });\n }\n ts.forEachChild(node, visit);\n }\n visit(sourceFile);\n return out;\n}\n\nfunction isRegistrationCall(call: ts.CallExpression): boolean {\n const text = call.expression.getText();\n return text.endsWith('createCombinedHandler') || text.endsWith('srv.prepend') || text.endsWith('cds.serve');\n}\nfunction handlerExpression(call: ts.CallExpression, sourceFile: ts.SourceFile): ts.Expression | undefined {\n for (const arg of call.arguments) {\n if (!ts.isObjectLiteralExpression(arg)) continue;\n for (const prop of arg.properties) {\n if (!ts.isPropertyAssignment(prop)) continue;\n if (sourceText(prop.name, sourceFile) === 'handler') return prop.initializer;\n }\n }\n return undefined;\n}\nfunction collectImports(sourceFile: ts.SourceFile): Map<string, ImportEvidence> {\n const imports = new Map<string, ImportEvidence>();\n for (const statement of sourceFile.statements) {\n if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier)) continue;\n const source = statement.moduleSpecifier.text;\n const clause = statement.importClause;\n if (!clause) continue;\n if (clause.name) imports.set(clause.name.text, { importedName: 'default', source });\n const named = clause.namedBindings;\n if (named && ts.isNamedImports(named)) {\n for (const element of named.elements) imports.set(element.name.text, { importedName: element.propertyName?.text ?? element.name.text, source });\n }\n if (named && ts.isNamespaceImport(named)) imports.set(named.name.text, { importedName: '*', source });\n }\n return imports;\n}\nfunction collectLocalArrays(sourceFile: ts.SourceFile, imports: Map<string, ImportEvidence>, seed: Map<string, ClassEvidence[]>, repoPath = '', fromFile = ''): Map<string, ClassEvidence[]> {\n const arrays = new Map(seed);\n for (const statement of sourceFile.statements) {\n if (ts.isVariableStatement(statement)) {\n for (const decl of statement.declarationList.declarations) {\n if (ts.isIdentifier(decl.name) && decl.initializer && ts.isArrayLiteralExpression(decl.initializer)) {\n arrays.set(decl.name.text, resolveArrayLiteral(decl.initializer, arrays, imports, repoPath, fromFile, new Set()));\n }\n }\n }\n }\n return arrays;\n}\nfunction resolveArrayExpression(expr: ts.Expression, arrays: Map<string, ClassEvidence[]>, imports: Map<string, ImportEvidence>, repoPath: string, fromFile: string, seen: Set<string>): ClassEvidence[] {\n if (ts.isArrayLiteralExpression(expr)) return resolveArrayLiteral(expr, arrays, imports, repoPath, fromFile, seen);\n if (ts.isIdentifier(expr)) {\n const local = arrays.get(expr.text);\n if (local) return local;\n const evidence = imports.get(expr.text);\n if (evidence && isRelative(evidence.source)) return resolveImportedArray(repoPath, fromFile, evidence, seen);\n if (evidence) return [{ className: evidence.importedName === 'default' ? expr.text : evidence.importedName, importSource: `${evidence.source}#${evidence.importedName}` }];\n }\n return [];\n}\nfunction resolveArrayLiteral(array: ts.ArrayLiteralExpression, arrays: Map<string, ClassEvidence[]>, imports: Map<string, ImportEvidence>, repoPath: string, fromFile: string, seen: Set<string>): ClassEvidence[] {\n const out: ClassEvidence[] = [];\n for (const element of array.elements) {\n if (ts.isSpreadElement(element)) out.push(...resolveArrayExpression(element.expression, arrays, imports, repoPath, fromFile, seen));\n else if (ts.isIdentifier(element)) out.push({ className: element.text, importSource: importSourceFor(element.text, imports) });\n }\n return out;\n}\nfunction resolveImportedArray(repoPath: string, fromFile: string, evidence: ImportEvidence, seen: Set<string>): ClassEvidence[] {\n const moduleFile = resolveRelativeModule(repoPath, fromFile, evidence.source);\n if (!moduleFile) return [];\n const key = `${moduleFile}:${evidence.importedName}`;\n if (seen.has(key) || seen.size > MAX_EXPORT_DEPTH) return [];\n seen.add(key);\n const exports = readExports(repoPath, moduleFile, seen);\n if (evidence.importedName === 'default') return exports.defaultArray ?? [];\n return exports.arrays.get(evidence.importedName) ?? exports.arrays.get(exports.aliases.get(evidence.importedName) ?? evidence.importedName) ?? [];\n}\nfunction resolveRelativeModule(repoPath: string, fromFile: string, specifier: string): string | undefined {\n const base = path.resolve(repoPath, path.dirname(fromFile), specifier);\n for (const candidate of [base, `${base}.ts`, `${base}.js`, path.join(base, 'index.ts'), path.join(base, 'index.js')]) {\n try {\n const stat = fsSync.statSync(candidate);\n if (stat.isFile()) return normalizePath(path.relative(repoPath, candidate));\n } catch { /* ignore missing candidate */ }\n }\n return undefined;\n}\nfunction readExports(repoPath: string, filePath: string, seen: Set<string>): FileExports {\n const absolute = path.join(repoPath, filePath);\n let text: string;\n try { text = fsSync.readFileSync(absolute, 'utf8'); } catch { return { arrays: new Map(), aliases: new Map() }; }\n const sourceFile = ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const imports = collectImports(sourceFile);\n const arrays = collectLocalArrays(sourceFile, imports, new Map(), repoPath, filePath);\n const aliases = new Map<string, string>();\n let defaultArray: ClassEvidence[] | undefined;\n for (const statement of sourceFile.statements) {\n if (ts.isExportAssignment(statement) && ts.isIdentifier(statement.expression)) defaultArray = arrays.get(statement.expression.text);\n if (ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause)) {\n const module = statement.moduleSpecifier && ts.isStringLiteral(statement.moduleSpecifier) ? statement.moduleSpecifier.text : undefined;\n for (const element of statement.exportClause.elements) {\n const local = element.propertyName?.text ?? element.name.text;\n aliases.set(element.name.text, local);\n if (module && isRelative(module)) {\n const imported = resolveImportedArray(repoPath, filePath, { source: module, importedName: local }, seen);\n if (imported.length > 0) arrays.set(element.name.text, imported);\n }\n }\n }\n }\n return { arrays, defaultArray, aliases };\n}\n","const SENSITIVE = /authorization|cookie|token|secret|password|key|credential/i;\nexport function redactText(text: string): string {\n return text.replace(\n /(authorization|cookie|token|secret|password|key|credential)\\s*[:=]\\s*(['\"`]?)[^,'\"`}\\s]+\\2/gi,\n '$1: [REDACTED]'\n );\n}\nexport function redactValue(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(redactValue);\n if (value && typeof value === 'object') {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value))\n out[k] = SENSITIVE.test(k) ? '[REDACTED]' : redactValue(v);\n return out;\n }\n return typeof value === 'string' ? redactText(value) : value;\n}\nexport function summarizeExpression(text: string): string {\n return redactText(text).slice(0, 240);\n}\n","export interface NormalizedODataOperationPath {\n rawOperationPath: string;\n normalizedOperationPath: string;\n wasInvocation: boolean;\n invocationArgumentPlaceholderKeys: string[];\n normalizationReason?: string;\n normalizationRejectedReason?: string;\n}\n\nexport type ODataPathIntentKind = 'operation_invocation' | 'entity_query' | 'entity_key_read' | 'entity_navigation_query' | 'unknown';\n\nexport interface ODataPathIntent {\n kind: ODataPathIntentKind;\n rawPath: string;\n method: string;\n pathWithoutQuery: string;\n queryString?: string;\n hasQueryString: boolean;\n entitySegment?: string;\n placeholderKeys: string[];\n reason: string;\n}\n\nexport function normalizeODataOperationInvocationPath(path: string | undefined): NormalizedODataOperationPath | undefined {\n if (path === undefined) return undefined;\n const raw = path.trim();\n if (!raw) return undefined;\n const rejected = (reason: string): NormalizedODataOperationPath => ({ rawOperationPath: raw, normalizedOperationPath: raw, wasInvocation: false, invocationArgumentPlaceholderKeys: [], normalizationRejectedReason: reason });\n const open = raw.indexOf('(');\n if (open < 0) return rejected('no_top_level_parenthesis');\n const query = topLevelQueryIndex(raw);\n if (query >= 0) return rejected('query_string_paths_are_not_operation_invocations');\n if (!raw.startsWith('/')) return rejected('path_is_not_absolute');\n if (raw.slice(1, open).includes('/')) return rejected('operation_segment_contains_navigation_separator');\n const close = matchingClose(raw, open);\n if (close === undefined) return rejected('top_level_invocation_parenthesis_is_unbalanced');\n if (raw.slice(close + 1).trim().length > 0) return rejected('top_level_invocation_does_not_cover_remaining_path');\n const operationSegment = raw.slice(0, open).trim();\n if (operationSegment.length <= 1) return rejected('operation_segment_is_empty');\n return {\n rawOperationPath: raw,\n normalizedOperationPath: operationSegment,\n wasInvocation: true,\n invocationArgumentPlaceholderKeys: [...new Set(extractTemplatePlaceholders(raw.slice(open + 1, close)))],\n normalizationReason: 'balanced_top_level_operation_invocation',\n };\n}\n\nexport function classifyODataPathIntent(path: string | undefined, method: string | undefined): ODataPathIntent {\n const rawPath = (path ?? '').trim();\n const normalizedMethod = (method ?? 'GET').trim().toUpperCase() || 'GET';\n const queryIndex = rawPath.indexOf('?');\n const pathWithoutQuery = queryIndex >= 0 ? rawPath.slice(0, queryIndex) : rawPath;\n const queryString = queryIndex >= 0 ? rawPath.slice(queryIndex + 1) : undefined;\n const segments = pathWithoutQuery.replace(/^\\//, '').split('/').filter(Boolean);\n const firstSegment = segments[0] ?? '';\n const hasNavigationSegments = segments.length > 1;\n const entitySegment = entitySegmentFromPath(pathWithoutQuery);\n const placeholderKeys = [...new Set(extractTemplatePlaceholders(rawPath))];\n const base = { rawPath, method: normalizedMethod, pathWithoutQuery, queryString, hasQueryString: queryIndex >= 0, entitySegment, placeholderKeys };\n if (!rawPath || !rawPath.startsWith('/')) return { ...base, kind: 'unknown', reason: 'path_missing_or_not_absolute' };\n if (normalizedMethod !== 'GET') return { ...base, kind: 'operation_invocation', reason: 'non_get_service_send_defaults_to_operation' };\n if (queryIndex >= 0) {\n if (hasNavigationSegments) return { ...base, kind: 'entity_navigation_query', reason: 'get_path_has_navigation_and_query_string' };\n if (looksLikeLowerCamelInvocation(firstSegment)) return { ...base, kind: 'unknown', reason: 'get_invocation_with_query_string_requires_indexed_operation_evidence' };\n return { ...base, kind: 'entity_query', reason: 'get_collection_path_has_query_string' };\n }\n if (hasNavigationSegments) return { ...base, kind: 'entity_navigation_query', reason: 'get_path_has_navigation_segments' };\n if (firstSegment.includes('(')) {\n return looksLikeLowerCamelInvocation(firstSegment)\n ? { ...base, kind: 'operation_invocation', reason: 'get_single_lower_camel_segment_has_top_level_invocation' }\n : { ...base, kind: 'entity_key_read', reason: 'get_entity_segment_has_key_predicate' };\n }\n return { ...base, kind: 'unknown', reason: 'get_path_has_no_query_key_or_navigation_signal' };\n}\n\nfunction entitySegmentFromPath(path: string): string | undefined {\n const first = path.replace(/^\\//, '').split('/')[0]?.trim();\n if (!first) return undefined;\n const open = first.indexOf('(');\n const entity = (open >= 0 ? first.slice(0, open) : first).trim();\n return entity || undefined;\n}\n\nfunction looksLikeLowerCamelInvocation(segment: string): boolean {\n const open = segment.indexOf('(');\n if (open <= 0) return false;\n const name = segment.slice(0, open).split('.').at(-1) ?? segment.slice(0, open);\n return /^[a-z][A-Za-z0-9_]*$/.test(name);\n}\n\nfunction extractTemplatePlaceholders(text: string): string[] {\n const keys: string[] = [];\n for (let index = 0; index < text.length - 1; index += 1) {\n if (text[index] !== '$' || text[index + 1] !== '{') continue;\n const close = matchingPlaceholderClose(text, index + 1);\n if (close === undefined) continue;\n const key = text.slice(index + 2, close).trim();\n if (key) keys.push(key);\n index = close;\n }\n return keys;\n}\n\nfunction matchingClose(text: string, openIndex: number): number | undefined {\n let depth = 0;\n let quote: 'single' | 'double' | 'template' | undefined;\n for (let index = openIndex; index < text.length; index += 1) {\n const char = text[index];\n const prev = text[index - 1];\n if (quote) {\n if (prev === '\\\\') continue;\n if (quote === 'template' && char === '$' && text[index + 1] === '{') {\n const close = matchingPlaceholderClose(text, index + 1);\n if (close === undefined) return undefined;\n index = close;\n continue;\n }\n if ((quote === 'single' && char === \"'\") || (quote === 'double' && char === '\"') || (quote === 'template' && char === '`')) quote = undefined;\n continue;\n }\n if (char === '$' && text[index + 1] === '{') {\n const close = matchingPlaceholderClose(text, index + 1);\n if (close === undefined) return undefined;\n index = close;\n continue;\n }\n if (char === \"'\") { quote = 'single'; continue; }\n if (char === '\"') { quote = 'double'; continue; }\n if (char === '`') { quote = 'template'; continue; }\n if (char === '(') depth += 1;\n if (char === ')') {\n depth -= 1;\n if (depth === 0) return index;\n if (depth < 0) return undefined;\n }\n }\n return undefined;\n}\n\nfunction matchingPlaceholderClose(text: string, openBraceIndex: number): number | undefined {\n let depth = 0;\n let quote: 'single' | 'double' | 'template' | undefined;\n for (let index = openBraceIndex; index < text.length; index += 1) {\n const char = text[index];\n const prev = text[index - 1];\n if (quote) {\n if (prev === '\\\\') continue;\n if (quote === 'template' && char === '$' && text[index + 1] === '{') {\n depth += 1;\n index += 1;\n continue;\n }\n if ((quote === 'single' && char === \"'\") || (quote === 'double' && char === '\"') || (quote === 'template' && char === '`')) quote = undefined;\n continue;\n }\n if (char === \"'\") { quote = 'single'; continue; }\n if (char === '\"') { quote = 'double'; continue; }\n if (char === '`') { quote = 'template'; continue; }\n if (char === '{') depth += 1;\n if (char === '}') {\n depth -= 1;\n if (depth === 0) return index;\n if (depth < 0) return undefined;\n }\n }\n return undefined;\n}\n\nfunction topLevelQueryIndex(text: string): number {\n let quote: 'single' | 'double' | 'template' | undefined;\n for (let index = 0; index < text.length; index += 1) {\n const char = text[index];\n const prev = text[index - 1];\n if (quote) {\n if (prev === '\\\\') continue;\n if (quote === 'template' && char === '$' && text[index + 1] === '{') {\n const close = matchingPlaceholderClose(text, index + 1);\n if (close === undefined) return -1;\n index = close;\n continue;\n }\n if ((quote === 'single' && char === \"'\") || (quote === 'double' && char === '\"') || (quote === 'template' && char === '`')) quote = undefined;\n continue;\n }\n if (char === '$' && text[index + 1] === '{') {\n const close = matchingPlaceholderClose(text, index + 1);\n if (close === undefined) return -1;\n index = close;\n continue;\n }\n if (char === \"'\") { quote = 'single'; continue; }\n if (char === '\"') { quote = 'double'; continue; }\n if (char === '`') { quote = 'template'; continue; }\n if (char === '?') return index;\n }\n return -1;\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport ts from 'typescript';\nimport { externalHttpTarget } from '../linker/external-http-target.js';\nimport type { OutboundCallFact } from '../types.js';\nimport { normalizePath, stripQuotes } from '../utils/path-utils.js';\nimport { summarizeExpression } from '../utils/redaction.js';\nimport { classifyODataPathIntent } from '../linker/odata-path-normalizer.js';\nfunction lineOf(text: string, idx: number): number {\n return text.slice(0, idx).split('\\n').length;\n}\nfunction entityFromExpression(expr: ts.Expression | undefined): string | undefined {\n if (!expr) return undefined;\n if (ts.isIdentifier(expr) || ts.isStringLiteral(expr) || ts.isNoSubstitutionTemplateLiteral(expr)) return expr.text;\n if (ts.isPropertyAccessExpression(expr) && expr.expression.kind === ts.SyntaxKind.ThisKeyword) return expr.name.text;\n if (ts.isElementAccessExpression(expr) && expr.argumentExpression && (ts.isStringLiteral(expr.argumentExpression) || ts.isNoSubstitutionTemplateLiteral(expr.argumentExpression))) return expr.argumentExpression.text;\n return undefined;\n}\nfunction expressionName(expr: ts.Expression): string {\n if (ts.isIdentifier(expr)) return expr.text;\n if (ts.isPropertyAccessExpression(expr)) return `${expressionName(expr.expression)}.${expr.name.text}`;\n return expr.getText();\n}\nfunction variableInitializers(source: ts.SourceFile): Map<string, ts.Expression> {\n const initializers = new Map<string, ts.Expression>();\n const visit = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer && (node.parent.flags & ts.NodeFlags.Const) !== 0) initializers.set(node.name.text, node.initializer);\n ts.forEachChild(node, visit);\n };\n visit(source);\n return initializers;\n}\nfunction queryEntityFromAst(expr: ts.Expression, initializers = new Map<string, ts.Expression>()): string | undefined {\n if (ts.isParenthesizedExpression(expr) || ts.isAwaitExpression(expr)) return queryEntityFromAst(expr.expression, initializers);\n if (ts.isIdentifier(expr) && initializers.has(expr.text)) return queryEntityFromAst(initializers.get(expr.text) as ts.Expression, initializers);\n if (ts.isCallExpression(expr)) {\n const name = expressionName(expr.expression);\n if (name === 'cds.run') return queryEntityFromAst(expr.arguments[0], initializers);\n if (['SELECT.one.from', 'SELECT.from', 'SELECT.one', 'INSERT.into', 'UPSERT.into', 'DELETE.from', 'UPDATE.entity'].includes(name)) return entityFromExpression(expr.arguments[0]);\n if (name === 'UPDATE') return entityFromExpression(expr.arguments[0]);\n const receiver = ts.isPropertyAccessExpression(expr.expression) ? expr.expression.expression : undefined;\n if (receiver) return queryEntityFromAst(receiver, initializers);\n }\n return undefined;\n}\nfunction extractQueryEntity(expr: string): string | undefined {\n const source = ts.createSourceFile('query.ts', `const __query = (${expr});`, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const initializers = variableInitializers(source);\n let found: string | undefined;\n const visit = (node: ts.Node): void => {\n if (found) return;\n if (ts.isParenthesizedExpression(node)) found = queryEntityFromAst(node.expression, initializers);\n ts.forEachChild(node, visit);\n };\n visit(source);\n return found;\n}\nfunction queryWarning(expr: string): string {\n if (/^\\s*[`'\"]/.test(expr)) return 'raw_sql_or_cql_expression';\n if (/^\\s*\\w+\\s*$/.test(expr)) return 'query_variable_without_static_initializer';\n return 'dynamic_entity_expression';\n}\nexport interface ClassifiedOutboundCall {\n fact: OutboundCallFact;\n node: ts.CallExpression;\n}\nfunction parserEvidence(source: ts.SourceFile, node: ts.CallExpression, extra?: Record<string, unknown>): Record<string, unknown> {\n return { parser: 'typescript_ast', startOffset: node.getStart(source), endOffset: node.getEnd(), ...extra };\n}\nfunction isStringLike(expr: ts.Expression | undefined): expr is ts.StringLiteral | ts.NoSubstitutionTemplateLiteral {\n return Boolean(expr && (ts.isStringLiteral(expr) || ts.isNoSubstitutionTemplateLiteral(expr)));\n}\nfunction literalText(expr: ts.Expression | undefined): string | undefined {\n if (isStringLike(expr)) return expr.text;\n return undefined;\n}\nfunction objectPropertyText(object: ts.ObjectLiteralExpression, key: string): string | undefined {\n const prop = object.properties.find((property): property is ts.PropertyAssignment | ts.ShorthandPropertyAssignment =>\n (ts.isPropertyAssignment(property) && nameOfProperty(property.name) === key) || (ts.isShorthandPropertyAssignment(property) && property.name.text === key),\n );\n if (!prop) return undefined;\n return ts.isShorthandPropertyAssignment(prop) ? prop.name.text : prop.initializer.getText();\n}\nfunction objectPropertyIsShorthand(object: ts.ObjectLiteralExpression, key: string): boolean {\n return object.properties.some((property) => ts.isShorthandPropertyAssignment(property) && property.name.text === key);\n}\nfunction nameOfProperty(name: ts.PropertyName): string | undefined {\n if (ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name)) return name.text;\n return undefined;\n}\n\nfunction staticExpressionText(expr: ts.Expression | undefined, initializers: Map<string, ts.Expression>): string | undefined {\n if (!expr) return undefined;\n if (isStringLike(expr)) return expr.text;\n if (ts.isIdentifier(expr) && initializers.has(expr.text)) return staticExpressionText(initializers.get(expr.text), initializers);\n return undefined;\n}\nfunction propertyInitializer(object: ts.ObjectLiteralExpression, key: string): ts.Expression | undefined {\n for (const property of object.properties) {\n if (ts.isPropertyAssignment(property) && nameOfProperty(property.name) === key) return property.initializer;\n if (ts.isShorthandPropertyAssignment(property) && property.name.text === key) return property.name;\n }\n return undefined;\n}\nfunction httpMethodFromObject(object: ts.ObjectLiteralExpression, initializers: Map<string, ts.Expression>): string | undefined {\n const text = staticExpressionText(propertyInitializer(object, 'method'), initializers);\n return text ? stripQuotes(text).toUpperCase() : undefined;\n}\nfunction urlTargetFromExpression(expr: ts.Expression | undefined, initializers: Map<string, ts.Expression>): Record<string, unknown> {\n const text = staticExpressionText(expr, initializers);\n if (text) return { kind: 'static_url', expression: text, dynamic: false };\n if (expr && (ts.isTemplateExpression(expr) || ts.isIdentifier(expr) || ts.isPropertyAccessExpression(expr) || ts.isCallExpression(expr))) return { kind: 'url_expression', expression: expr.getText(expr.getSourceFile()), dynamic: true };\n return { kind: 'unknown', dynamic: false };\n}\nfunction destinationTargetFromExpression(expr: ts.Expression | undefined, initializers: Map<string, ts.Expression>): Record<string, unknown> | undefined {\n const text = staticExpressionText(expr, initializers);\n if (text) return { kind: 'destination', expression: text, dynamic: false };\n if (expr && ts.isIdentifier(expr)) return { kind: 'destination', expression: expr.text, dynamic: true };\n return undefined;\n}\nfunction externalHttpEvidence(node: ts.CallExpression, source: ts.SourceFile, initializers: Map<string, ts.Expression>): { method?: string; externalTarget: Record<string, unknown>; classifier: string; sourceCallShape: string } | undefined {\n const expr = node.expression;\n const exprText = expr.getText(source);\n if (exprText === 'useOrFetchDestination') {\n const objectArg = node.arguments[0];\n if (objectArg && ts.isObjectLiteralExpression(objectArg)) {\n const destination = destinationTargetFromExpression(propertyInitializer(objectArg, 'destinationName'), initializers);\n return { externalTarget: destination ?? { kind: 'unknown', dynamic: false }, classifier: 'sap_destination_lookup', sourceCallShape: 'useOrFetchDestination' };\n }\n }\n if (exprText === 'executeHttpRequest') {\n const destination = destinationTargetFromExpression(node.arguments[0], initializers);\n const config = node.arguments[1];\n const method = config && ts.isObjectLiteralExpression(config) ? httpMethodFromObject(config, initializers) : undefined;\n const url = config && ts.isObjectLiteralExpression(config) ? urlTargetFromExpression(propertyInitializer(config, 'url'), initializers) : { kind: 'unknown', dynamic: false };\n return { method, externalTarget: destination ? { ...url, destination } : url, classifier: 'sap_execute_http_request', sourceCallShape: 'executeHttpRequest' };\n }\n if (exprText === 'axios') {\n const config = node.arguments[0];\n if (config && ts.isObjectLiteralExpression(config)) {\n const method = httpMethodFromObject(config, initializers);\n return { method, externalTarget: urlTargetFromExpression(propertyInitializer(config, 'url'), initializers), classifier: 'axios_config_call', sourceCallShape: 'axios(config)' };\n }\n return { externalTarget: { kind: 'unknown', dynamic: false }, classifier: 'axios_unknown_call', sourceCallShape: 'axios(...)' };\n }\n if (exprText === 'fetch') {\n const init = node.arguments[1];\n const method = init && ts.isObjectLiteralExpression(init) ? httpMethodFromObject(init, initializers) : undefined;\n return { method, externalTarget: urlTargetFromExpression(node.arguments[0], initializers), classifier: 'fetch_call', sourceCallShape: 'fetch' };\n }\n if (ts.isPropertyAccessExpression(expr) && ['get','post','put','patch','delete','head'].includes(expr.name.text) && expr.expression.getText(source) === 'axios') {\n return { method: expr.name.text.toUpperCase(), externalTarget: urlTargetFromExpression(node.arguments[0], initializers), classifier: 'axios_member_call', sourceCallShape: `axios.${expr.name.text}` };\n }\n return undefined;\n}\n\nfunction collectServiceVariables(source: ts.SourceFile): Set<string> {\n const vars = new Set<string>(['cds', 'messaging', 'messageClient', 'eventClient']);\n const visit = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n const text = node.initializer.getText(source);\n if (/cds\\.connect\\.(to|messaging)\\s*\\(/.test(text)) vars.add(node.name.text);\n }\n ts.forEachChild(node, visit);\n };\n visit(source);\n return vars;\n}\nfunction receiverName(expr: ts.Expression): string | undefined {\n if (ts.isIdentifier(expr)) return expr.text;\n if (ts.isPropertyAccessExpression(expr)) return expr.getText(sourceOf(expr));\n return undefined;\n}\nfunction sourceOf(node: ts.Node): ts.SourceFile {\n return node.getSourceFile();\n}\nfunction rootReceiverName(expr: ts.Expression): string | undefined {\n if (ts.isIdentifier(expr)) return expr.text;\n if (ts.isPropertyAccessExpression(expr)) return rootReceiverName(expr.expression);\n if (ts.isCallExpression(expr)) return rootReceiverName(expr.expression);\n return undefined;\n}\nfunction isSupportedEventReceiver(receiver: string | undefined, rootReceiver: string | undefined, serviceVariables: Set<string>): boolean {\n const candidate = rootReceiver ?? receiver;\n if (!candidate) return false;\n if (candidate === 'cds') return true;\n if (serviceVariables.has(candidate)) return true;\n if (receiver && serviceVariables.has(receiver)) return true;\n if (/^(srv|service|serviceClient|messaging|messageClient|eventClient)$/.test(candidate)) return true;\n return false;\n}\ninterface WrapperSpec { clientIndex: number; pathIndex: number; methodIndex?: number; definitionLine: number; internalStart: number; internalEnd: number }\nfunction collectWrapperSpecs(source: ts.SourceFile): Map<string, WrapperSpec> {\n const specs = new Map<string, WrapperSpec>();\n const scanFunction = (name: string, fn: ts.FunctionLikeDeclaration): void => {\n const params = fn.parameters.map((param) => ts.isIdentifier(param.name) ? param.name.text : undefined);\n const closure = returnedClosure(fn);\n if (!closure) return;\n const sends: Array<{ client: string; path: string; method?: string }> = [];\n const visit = (node: ts.Node): void => {\n if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && node.expression.name.text === 'send' && ts.isIdentifier(node.expression.expression)) {\n const objectArg = node.arguments[0];\n if (objectArg && ts.isObjectLiteralExpression(objectArg)) {\n const pathProp = objectArg.properties.find((property): property is ts.ShorthandPropertyAssignment => ts.isShorthandPropertyAssignment(property) && property.name.text === 'path');\n if (pathProp) sends.push({ client: node.expression.expression.text, path: pathProp.name.text, method: objectPropertyText(objectArg, 'method') });\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(closure);\n if (sends.length !== 1) return;\n const found = sends[0];\n const clientIndex = params.indexOf(found.client);\n const pathIndex = params.indexOf(found.path);\n const methodIndex = found.method && params.includes(found.method) ? params.indexOf(found.method) : undefined;\n if (clientIndex >= 0 && pathIndex >= 0) specs.set(name, { clientIndex, pathIndex, methodIndex, definitionLine: lineOf(source.text, fn.getStart(source)), internalStart: closure.getStart(source), internalEnd: closure.getEnd() });\n };\n for (const stmt of source.statements) {\n if (ts.isFunctionDeclaration(stmt) && stmt.name) scanFunction(stmt.name.text, stmt);\n if (ts.isVariableStatement(stmt)) for (const decl of stmt.declarationList.declarations) if (ts.isIdentifier(decl.name) && decl.initializer && (ts.isArrowFunction(decl.initializer) || ts.isFunctionExpression(decl.initializer))) scanFunction(decl.name.text, decl.initializer);\n }\n return specs;\n}\nfunction returnedClosure(fn: ts.FunctionLikeDeclaration): ts.ArrowFunction | ts.FunctionExpression | undefined {\n const body = fn.body;\n if (!body) return undefined;\n if (ts.isArrowFunction(fn) && !ts.isBlock(body)) return ts.isArrowFunction(body) || ts.isFunctionExpression(body) ? body : undefined;\n if (!ts.isBlock(body)) return undefined;\n const returns = body.statements.filter(ts.isReturnStatement);\n if (returns.length !== 1) return undefined;\n const expr = returns[0]?.expression;\n return expr && (ts.isArrowFunction(expr) || ts.isFunctionExpression(expr)) ? expr : undefined;\n}\n\nexport function classifyOutboundCallsInSource(source: ts.SourceFile, filePath: string): ClassifiedOutboundCall[] {\n const calls: ClassifiedOutboundCall[] = [];\n const sourceFile = normalizePath(filePath);\n const initializers = variableInitializers(source);\n const serviceVariables = collectServiceVariables(source);\n const wrapperSpecs = collectWrapperSpecs(source);\n const wrapperInternalRanges = [...wrapperSpecs.values()].map((spec) => ({ start: spec.internalStart, end: spec.internalEnd }));\n const add = (node: ts.CallExpression, fact: Omit<OutboundCallFact, 'sourceFile' | 'sourceLine' | 'confidence'> & { confidence?: number }, extra?: Record<string, unknown>): void => {\n calls.push({ node, fact: { ...fact, sourceFile, sourceLine: lineOf(source.text, node.getStart(source)), confidence: fact.confidence ?? 0.8, evidence: parserEvidence(source, node, extra) } });\n };\n const visit = (node: ts.Node): void => {\n if (ts.isCallExpression(node)) {\n if (wrapperInternalRanges.some((range) => node.getStart(source) >= range.start && node.getEnd() <= range.end)) {\n return;\n }\n const expr = node.expression;\n const exprText = expr.getText(source);\n if (exprText === 'cds.run') {\n const arg = node.arguments[0];\n const entity = arg ? queryEntityFromAst(arg, initializers) : undefined;\n const payload = arg?.getText(source) ?? '';\n add(node, { callType: 'local_db_query', queryEntity: entity, payloadSummary: summarizeExpression(payload), confidence: entity ? 0.9 : 0.55, unresolvedReason: entity ? undefined : queryWarning(payload) });\n } else if (ts.isPropertyAccessExpression(expr) && expr.name.text === 'send' && (ts.isIdentifier(expr.expression) || ts.isPropertyAccessExpression(expr.expression))) {\n const objectArg = node.arguments[0];\n if (objectArg && ts.isObjectLiteralExpression(objectArg)) {\n const receiver = receiverName(expr.expression);\n const query = objectPropertyText(objectArg, 'query');\n const method = stripQuotes(objectPropertyText(objectArg, 'method') ?? 'POST');\n const op = objectPropertyText(objectArg, 'path') ?? objectPropertyText(objectArg, 'event');\n const shorthandPath = objectPropertyIsShorthand(objectArg, 'path');\n const operationPathExpr = op && !shorthandPath ? `/${stripQuotes(op).replace(/^\\//, '')}` : undefined;\n const intent = classifyODataPathIntent(operationPathExpr, method);\n const isODataQueryRead = method.toUpperCase() === 'GET' && ['entity_query', 'entity_key_read', 'entity_navigation_query'].includes(intent.kind);\n add(node, { callType: query || isODataQueryRead ? 'remote_query' : 'remote_action', serviceVariableName: receiver, method, operationPathExpr, queryEntity: query ? extractQueryEntity(query) : isODataQueryRead ? intent.entitySegment : undefined, payloadSummary: summarizeExpression(objectArg.getText(source)), confidence: op || query ? 0.8 : 0.4, unresolvedReason: !query && shorthandPath ? 'dynamic_operation_path_identifier' : undefined }, { receiver, classifier: 'service_client_send_object', operationPathExpression: shorthandPath ? op : undefined, odataPathIntent: operationPathExpr ? intent : undefined, parserWarning: shorthandPath ? 'dynamic_operation_path_identifier' : undefined });\n }\n } else if (((ts.isCallExpression(expr) && ts.isIdentifier(expr.expression) && wrapperSpecs.has(expr.expression.text)) || (ts.isIdentifier(expr) && wrapperSpecs.has(expr.text)))) {\n const wrapperName = ts.isIdentifier(expr) ? expr.text : ts.isCallExpression(expr) && ts.isIdentifier(expr.expression) ? expr.expression.text : '';\n const wrapperArgs = ts.isIdentifier(expr) ? node.arguments : ts.isCallExpression(expr) ? expr.arguments : node.arguments;\n const spec = wrapperSpecs.get(wrapperName);\n const clientArg = spec ? wrapperArgs[spec.clientIndex] : undefined;\n const pathArg = spec ? wrapperArgs[spec.pathIndex] : undefined;\n const methodArg = spec?.methodIndex === undefined ? undefined : wrapperArgs[spec.methodIndex];\n if (spec && clientArg && ts.isIdentifier(clientArg) && isStringLike(pathArg)) {\n add(node, { callType: 'remote_action', serviceVariableName: clientArg.text, method: stripQuotes(methodArg?.getText(source) ?? 'POST'), operationPathExpr: `/${pathArg.text.replace(/^\\//, '')}`, payloadSummary: summarizeExpression(node.getText(source)), confidence: 0.75 }, { receiver: clientArg.text, classifier: 'higher_order_wrapper_literal_path', wrapperFunction: wrapperName, wrapperDefinitionLine: spec.definitionLine, literalCallerArgumentDetected: true });\n } else if (spec && clientArg && ts.isIdentifier(clientArg)) {\n add(node, { callType: 'remote_action', serviceVariableName: clientArg.text, method: stripQuotes(methodArg?.getText(source) ?? 'POST'), payloadSummary: summarizeExpression(node.getText(source)), confidence: 0.45, unresolvedReason: 'dynamic_operation_path_identifier' }, { receiver: clientArg.text, classifier: 'higher_order_wrapper_dynamic_path', wrapperFunction: wrapperName, wrapperDefinitionLine: spec.definitionLine, parserWarning: 'dynamic_operation_path_identifier' });\n }\n } else if (ts.isPropertyAccessExpression(expr) && ['emit', 'publish', 'on'].includes(expr.name.text)) {\n const receiver = receiverName(expr.expression);\n const rootReceiver = rootReceiverName(expr.expression);\n if (isSupportedEventReceiver(receiver, rootReceiver, serviceVariables)) {\n const eventName = literalText(node.arguments[0]);\n if (eventName) add(node, { callType: expr.name.text === 'on' ? 'async_subscribe' : 'async_emit', serviceVariableName: rootReceiver ?? receiver, eventNameExpr: eventName }, { receiver, rootReceiver, classifier: expr.name.text === 'on' ? 'cap_service_event_subscription' : 'cap_service_event_emit', receiverClassification: 'cap_evidence' });\n }\n } else {\n const external = externalHttpEvidence(node, source, initializers);\n if (external) {\n const evidenceTarget = { ...external.externalTarget, method: external.method, parserClassifier: external.classifier, sourceCallShape: external.sourceCallShape };\n const safeTarget = externalHttpTarget({ method: external.method, evidence_json: JSON.stringify({ externalTarget: evidenceTarget }) });\n add(node, { callType: 'external_http', method: external.method, payloadSummary: undefined, confidence: 0.7, unresolvedReason: 'External HTTP destination is outside indexed CAP services', externalTarget: { kind: safeTarget.kind, stableId: safeTarget.toId, label: safeTarget.label, dynamic: safeTarget.dynamic } }, { classifier: external.classifier, externalTarget: safeTarget, sourceCallShape: external.sourceCallShape });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(source);\n return calls;\n}\nexport function containsSupportedOutboundCall(node: ts.Node): boolean {\n const source = node.getSourceFile();\n const start = node.getFullStart();\n const end = node.getEnd();\n return classifyOutboundCallsInSource(source, source.fileName).some((call) => call.node.getStart(source) >= start && call.node.getEnd() <= end);\n}\nexport async function parseOutboundCalls(\n repoPath: string,\n filePath: string,\n): Promise<OutboundCallFact[]> {\n const text = await fs.readFile(path.join(repoPath, filePath), 'utf8');\n const source = ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true, filePath.endsWith('.ts') ? ts.ScriptKind.TS : ts.ScriptKind.JS);\n return [...classifyOutboundCallsInSource(source, filePath).map((call) => call.fact), ...parseLocalServiceCalls(text, filePath)];\n}\nfunction parseLocalServiceCalls(text: string, filePath: string): OutboundCallFact[] {\n const source = ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true, filePath.endsWith('.ts') ? ts.ScriptKind.TS : ts.ScriptKind.JS);\n const aliases = new Map<string, { service: string; lookup: string; chain: string[] }>();\n const calls: OutboundCallFact[] = [];\n const visit = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n const origin = serviceLookup(node.initializer, aliases);\n if (origin) aliases.set(node.name.text, { ...origin, chain: [...origin.chain, node.name.text] });\n }\n if (ts.isCallExpression(node)) {\n const parsed = serviceOperationCall(node.expression, aliases);\n if (parsed && parsed.operation !== 'entities') calls.push({\n callType: 'local_service_call',\n operationPathExpr: `/${parsed.operation}`,\n payloadSummary: parsed.service,\n localServiceName: parsed.service,\n localServiceLookup: parsed.lookup,\n aliasChain: parsed.chain,\n sourceFile: normalizePath(filePath),\n sourceLine: lineOf(text, node.getStart(source)),\n confidence: 0.9,\n unresolvedReason: ['send', 'emit', 'publish', 'on'].includes(parsed.operation) ? 'transport_client_method' : undefined,\n evidence: parserEvidence(source, node, {\n classifier: 'local_cap_service_call',\n localServiceLookup: parsed.lookup,\n localServiceName: parsed.service,\n operation: parsed.operation,\n aliasChain: parsed.chain,\n }),\n });\n }\n ts.forEachChild(node, visit);\n };\n visit(source);\n return calls;\n}\nfunction serviceLookup(expr: ts.Expression, aliases: Map<string, { service: string; lookup: string; chain: string[] }>): { service: string; lookup: string; chain: string[] } | undefined {\n if (ts.isIdentifier(expr)) return aliases.get(expr.text);\n if (ts.isPropertyAccessExpression(expr) && expr.expression.getText() === 'cds.services') return { service: expr.name.text, lookup: expr.getText(), chain: [expr.getText()] };\n if (ts.isElementAccessExpression(expr) && expr.expression.getText() === 'cds.services' && ts.isStringLiteral(expr.argumentExpression)) return { service: expr.argumentExpression.text, lookup: expr.getText(), chain: [expr.getText()] };\n return undefined;\n}\nfunction serviceOperationCall(expr: ts.Expression, aliases: Map<string, { service: string; lookup: string; chain: string[] }>): { service: string; lookup: string; chain: string[]; operation: string } | undefined {\n if (!ts.isPropertyAccessExpression(expr)) return undefined;\n const operation = expr.name.text;\n const origin = serviceLookup(expr.expression, aliases);\n if (!origin) return undefined;\n return { ...origin, operation };\n}\n","import { createHash } from 'node:crypto';\n\nexport type ExternalTargetKind = 'destination' | 'static_url' | 'url_expression' | 'unknown';\nexport interface ExternalHttpTarget { kind: ExternalTargetKind; toKind: 'external_destination' | 'external_endpoint'; toId: string; label: string; method?: string; dynamic: boolean; expression?: string; }\nconst sensitiveKeys = new Set(['token','access_token','id_token','api_key','apikey','key','password','passwd','pwd','secret','client_secret','authorization','cookie','signature']);\nfunction hash(value: string): string { return createHash('sha256').update(value).digest('hex').slice(0, 12); }\nfunction methodPrefix(method: unknown): string { return typeof method === 'string' && method.length > 0 ? `${method.toUpperCase()} ` : ''; }\nexport function redactUrl(value: string): string {\n try {\n const url = new URL(value, value.startsWith('/') ? 'https://relative.invalid' : undefined);\n url.username = ''; url.password = '';\n for (const key of [...url.searchParams.keys()]) url.searchParams.set(key, sensitiveKeys.has(key.toLowerCase()) ? '<redacted>' : '<redacted>');\n const path = `${url.pathname}${url.search ? url.search : ''}`;\n return value.startsWith('/') ? path : `${url.origin}${path}`;\n } catch {\n return value.replace(/([?&][^=;&]*(?:token|key|password|secret|cookie|authorization)[^=;&]*=)[^&]*/gi, '$1<redacted>');\n }\n}\nexport function externalHttpTarget(call: Record<string, unknown>): ExternalHttpTarget {\n const evidence = typeof call.evidence_json === 'string' ? safeParse(call.evidence_json) : {};\n const target = evidence.externalTarget && typeof evidence.externalTarget === 'object' && !Array.isArray(evidence.externalTarget) ? evidence.externalTarget as Record<string, unknown> : {};\n const method = typeof call.method === 'string' ? call.method : typeof target.method === 'string' ? target.method : undefined;\n const kind = typeof target.kind === 'string' ? target.kind : 'unknown';\n const expression = typeof target.expression === 'string' ? target.expression : undefined;\n if (kind === 'destination' && expression) return { kind, toKind: 'external_destination', toId: `destination:${expression}`, label: `External destination: ${expression}`, method, dynamic: false, expression };\n if (kind === 'static_url' && expression) {\n const redacted = redactUrl(expression);\n return { kind, toKind: 'external_endpoint', toId: `endpoint:${hash(`${method ?? ''}:${redacted}`)}`, label: `External endpoint: ${methodPrefix(method)}${redacted}`, method, dynamic: false, expression: redacted };\n }\n if (kind === 'url_expression' && expression) return { kind, toKind: 'external_endpoint', toId: `dynamic:${hash(expression)}`, label: `External endpoint: ${methodPrefix(method)}dynamic URL`, method, dynamic: true, expression: `expr:${hash(expression)}` };\n return { kind: 'unknown', toKind: 'external_endpoint', toId: 'unknown', label: 'External endpoint: unknown', method, dynamic: false };\n}\nfunction safeParse(value: string): Record<string, unknown> { try { const parsed = JSON.parse(value) as unknown; return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed as Record<string, unknown> : {}; } catch { return {}; } }\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport ts from 'typescript';\nimport type { ServiceBindingFact } from '../types.js';\nimport { normalizePath } from '../utils/path-utils.js';\n\ninterface HelperBinding {\n exportedName: string;\n returnedProperty?: string;\n alias?: string;\n aliasExpr?: string;\n destinationExpr?: string;\n servicePathExpr?: string;\n isDynamic: boolean;\n placeholders: string[];\n sourceFile: string;\n sourceLine: number;\n}\ninterface ImportBinding {\n localName: string;\n exportedName: string;\n sourceFile?: string;\n}\ninterface ClassHelperReturn {\n className: string;\n helperName: string;\n propertyName: string;\n variableName: string;\n fact: Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'>;\n sourceLine: number;\n}\n\nfunction lineOf(sf: ts.SourceFile, node: ts.Node): number {\n return sf.getLineAndCharacterOfPosition(node.getStart(sf)).line + 1;\n}\nfunction stringValue(node: ts.Expression | undefined): string | undefined {\n if (!node) return undefined;\n if (ts.isStringLiteralLike(node) || ts.isNoSubstitutionTemplateLiteral(node))\n return node.text;\n if (ts.isTemplateExpression(node))\n return node.getText().replace(/^`|`$/g, '');\n return node.getText();\n}\nfunction placeholders(value?: string): string[] {\n return [...(value ?? '').matchAll(/\\$\\{([^}]*)\\}/g)]\n .map((m) => (m[1] ?? '').trim())\n .filter(Boolean);\n}\nfunction connectFactFromCall(\n call: ts.CallExpression,\n):\n | Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'>\n | undefined {\n const expr = call.expression;\n if (!ts.isPropertyAccessExpression(expr) || expr.name.text !== 'to')\n return undefined;\n const inner = expr.expression;\n if (\n !ts.isPropertyAccessExpression(inner) ||\n inner.name.text !== 'connect' ||\n inner.expression.getText() !== 'cds'\n )\n return undefined;\n const first = call.arguments[0];\n if (!first) return undefined;\n const second = call.arguments[1];\n const objectArg = ts.isObjectLiteralExpression(first)\n ? first\n : second && ts.isObjectLiteralExpression(second)\n ? second\n : undefined;\n let alias: string | undefined;\n let aliasExpr: string | undefined;\n if (ts.isStringLiteralLike(first) || ts.isNoSubstitutionTemplateLiteral(first))\n alias = first.text;\n else if (!ts.isObjectLiteralExpression(first))\n aliasExpr = stringValue(first);\n if (\n (ts.isStringLiteralLike(first) || ts.isNoSubstitutionTemplateLiteral(first)) &&\n !objectArg\n )\n return { alias: first.text, isDynamic: false, placeholders: [] };\n if (!objectArg && aliasExpr)\n return {\n aliasExpr,\n isDynamic: true,\n placeholders: placeholders(aliasExpr),\n };\n let destinationExpr: string | undefined;\n let servicePathExpr: string | undefined;\n function visitObject(obj: ts.ObjectLiteralExpression): void {\n for (const prop of obj.properties) {\n if (!ts.isPropertyAssignment(prop)) continue;\n const name =\n ts.isIdentifier(prop.name) || ts.isStringLiteralLike(prop.name)\n ? prop.name.text\n : undefined;\n if (name === 'destination')\n destinationExpr = stringValue(prop.initializer);\n if (name === 'path' || name === 'servicePath')\n servicePathExpr = stringValue(prop.initializer);\n if (ts.isObjectLiteralExpression(prop.initializer))\n visitObject(prop.initializer);\n }\n }\n if (objectArg) visitObject(objectArg);\n const ph = [\n ...placeholders(aliasExpr ?? alias),\n ...placeholders(destinationExpr),\n ...placeholders(servicePathExpr),\n ];\n return {\n alias,\n aliasExpr,\n destinationExpr,\n servicePathExpr,\n isDynamic: ph.length > 0 || (!destinationExpr && !servicePathExpr),\n placeholders: ph,\n };\n}\nfunction unwrapCall(expr: ts.Expression): ts.CallExpression | undefined {\n if (ts.isAwaitExpression(expr)) return unwrapCall(expr.expression);\n if (ts.isParenthesizedExpression(expr)) return unwrapCall(expr.expression);\n if (ts.isAsExpression(expr) || ts.isSatisfiesExpression(expr)) return unwrapCall(expr.expression);\n if (ts.isTypeAssertionExpression(expr)) return unwrapCall(expr.expression);\n if (ts.isCallExpression(expr)) return expr;\n return undefined;\n}\nfunction unwrapIdentityExpression(expr: ts.Expression): ts.Expression {\n if (ts.isAwaitExpression(expr)) return unwrapIdentityExpression(expr.expression);\n if (ts.isParenthesizedExpression(expr)) return unwrapIdentityExpression(expr.expression);\n if (ts.isAsExpression(expr) || ts.isSatisfiesExpression(expr)) return unwrapIdentityExpression(expr.expression);\n if (ts.isTypeAssertionExpression(expr)) return unwrapIdentityExpression(expr.expression);\n return expr;\n}\nfunction findConnectInExpression(\n expr: ts.Expression,\n):\n | Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'>\n | undefined {\n const direct = unwrapCall(expr);\n if (direct) {\n const fact = connectFactFromCall(direct);\n if (fact) return fact;\n }\n let found:\n | Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'>\n | undefined;\n function visit(node: ts.Node): void {\n if (found) return;\n if (ts.isCallExpression(node)) found = connectFactFromCall(node);\n if (!found) ts.forEachChild(node, visit);\n }\n visit(expr);\n return found;\n}\nasync function readSource(abs: string): Promise<ts.SourceFile | undefined> {\n try {\n const text = await fs.readFile(abs, 'utf8');\n return ts.createSourceFile(\n abs,\n text,\n ts.ScriptTarget.Latest,\n true,\n ts.ScriptKind.TS,\n );\n } catch {\n return undefined;\n }\n}\nasync function resolveImport(\n repoPath: string,\n fromFile: string,\n spec: string,\n): Promise<string | undefined> {\n if (!spec.startsWith('.')) return undefined;\n const rawBase = path.resolve(repoPath, path.dirname(fromFile), spec);\n const parsed = path.parse(rawBase);\n const base = ['.js', '.mjs', '.cjs', '.ts', '.mts', '.cts'].includes(parsed.ext)\n ? path.join(parsed.dir, parsed.name)\n : rawBase;\n for (const candidate of [\n base,\n `${base}.ts`,\n `${base}.js`,\n path.join(base, 'index.ts'),\n path.join(base, 'index.js'),\n ]) {\n try {\n const st = await fs.stat(candidate);\n if (st.isFile()) return normalizePath(path.relative(repoPath, candidate));\n } catch {\n /* continue */\n }\n }\n return undefined;\n}\nasync function importsFor(\n repoPath: string,\n filePath: string,\n sf: ts.SourceFile,\n): Promise<ImportBinding[]> {\n const imports: ImportBinding[] = [];\n for (const stmt of sf.statements) {\n if (\n !ts.isImportDeclaration(stmt) ||\n !ts.isStringLiteralLike(stmt.moduleSpecifier)\n )\n continue;\n const sourceFile = await resolveImport(\n repoPath,\n filePath,\n stmt.moduleSpecifier.text,\n );\n const clause = stmt.importClause;\n if (!clause) continue;\n if (clause.name)\n imports.push({\n localName: clause.name.text,\n exportedName: 'default',\n sourceFile,\n });\n const bindings = clause.namedBindings;\n if (bindings && ts.isNamedImports(bindings))\n for (const el of bindings.elements)\n imports.push({\n localName: el.name.text,\n exportedName: el.propertyName?.text ?? el.name.text,\n sourceFile,\n });\n }\n return imports;\n}\nfunction collectReturnedObjectBindings(\n fn: ts.FunctionLikeDeclaration,\n): Map<string, Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'>> {\n const bindings = new Map<string, Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'>>();\n const returns = new Map<string, string>();\n function visit(node: ts.Node): void {\n if (node !== fn && (ts.isFunctionDeclaration(node) || ts.isArrowFunction(node) || ts.isFunctionExpression(node)))\n return;\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n const fact = findConnectInExpression(node.initializer);\n if (fact) bindings.set(node.name.text, fact);\n }\n if (ts.isReturnStatement(node) && node.expression && ts.isObjectLiteralExpression(node.expression)) {\n for (const prop of node.expression.properties) {\n if (ts.isShorthandPropertyAssignment(prop)) returns.set(prop.name.text, prop.name.text);\n if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.initializer)) {\n const propertyName = ts.isIdentifier(prop.name) || ts.isStringLiteralLike(prop.name) ? prop.name.text : undefined;\n if (propertyName) returns.set(propertyName, prop.initializer.text);\n }\n }\n }\n ts.forEachChild(node, visit);\n }\n visit(fn);\n const out = new Map<string, Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'>>();\n for (const [propertyName, variableName] of returns) {\n const fact = bindings.get(variableName);\n if (fact) out.set(propertyName, fact);\n }\n return out;\n}\n\nfunction functionLikeInitializer(\n expr: ts.Expression | undefined,\n): ts.FunctionLikeDeclaration | undefined {\n if (!expr) return undefined;\n if (ts.isArrowFunction(expr) || ts.isFunctionExpression(expr)) return expr;\n return undefined;\n}\n\nfunction directReturnConnectFact(\n fn: ts.FunctionLikeDeclaration,\n): Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'> | undefined {\n const localBindings = new Map<string, Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'>>();\n let returned: ts.Expression | undefined;\n function visit(node: ts.Node): void {\n if (node !== fn && (ts.isFunctionDeclaration(node) || ts.isArrowFunction(node) || ts.isFunctionExpression(node)))\n return;\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n const fact = findConnectInExpression(node.initializer);\n if (fact) localBindings.set(node.name.text, fact);\n }\n if (!returned && ts.isReturnStatement(node) && node.expression)\n returned = node.expression;\n if (!returned) ts.forEachChild(node, visit);\n }\n visit(fn);\n if (!returned) return undefined;\n if (ts.isIdentifier(returned)) return localBindings.get(returned.text);\n return findConnectInExpression(returned);\n}\n\nfunction directConnectFactFromFunctionLike(\n fn: ts.FunctionLikeDeclaration,\n): Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'> | undefined {\n if (ts.isArrowFunction(fn) && fn.body && !ts.isBlock(fn.body))\n return findConnectInExpression(fn.body);\n return directReturnConnectFact(fn);\n}\n\nfunction exportedLocalNames(sf: ts.SourceFile): Map<string, string> {\n const exports = new Map<string, string>();\n for (const stmt of sf.statements) {\n const direct = ts.canHaveModifiers(stmt)\n ? (ts\n .getModifiers(stmt)\n ?.some(\n (m: ts.ModifierLike) => m.kind === ts.SyntaxKind.ExportKeyword,\n ) ?? false)\n : false;\n if (direct && ts.isFunctionDeclaration(stmt) && stmt.name)\n exports.set(stmt.name.text, stmt.name.text);\n if (direct && ts.isVariableStatement(stmt))\n for (const decl of stmt.declarationList.declarations)\n if (ts.isIdentifier(decl.name)) exports.set(decl.name.text, decl.name.text);\n if (!ts.isExportDeclaration(stmt) || !stmt.exportClause) continue;\n if (!ts.isNamedExports(stmt.exportClause)) continue;\n for (const el of stmt.exportClause.elements)\n exports.set(el.name.text, el.propertyName?.text ?? el.name.text);\n }\n return exports;\n}\nasync function helperBindings(\n repoPath: string,\n filePath: string,\n): Promise<HelperBinding[]> {\n const sf = await readSource(path.join(repoPath, filePath));\n if (!sf) return [];\n const sourceFileAst = sf;\n const out: HelperBinding[] = [];\n const exportedLocals = exportedLocalNames(sf);\n const factsByLocal = new Map<\n string,\n Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'> & {\n sourceLine: number;\n }\n >();\n for (const stmt of sf.statements) {\n if (ts.isFunctionDeclaration(stmt) && stmt.name) {\n const fact = directConnectFactFromFunctionLike(stmt);\n if (fact) factsByLocal.set(stmt.name.text, { ...fact, sourceLine: lineOf(sf, stmt) });\n for (const [returnedProperty, objectFact] of collectReturnedObjectBindings(stmt))\n factsByLocal.set(`${stmt.name.text}#${returnedProperty}`, { ...objectFact, returnedProperty, sourceLine: lineOf(sf, stmt) });\n }\n if (ts.isVariableStatement(stmt))\n for (const decl of stmt.declarationList.declarations) {\n if (!ts.isIdentifier(decl.name) || !decl.initializer) continue;\n const helper = functionLikeInitializer(decl.initializer);\n if (helper) {\n const directReturn = directConnectFactFromFunctionLike(helper);\n if (directReturn)\n factsByLocal.set(decl.name.text, {\n ...directReturn,\n sourceLine: lineOf(sourceFileAst, decl),\n });\n for (const [returnedProperty, objectFact] of collectReturnedObjectBindings(helper))\n factsByLocal.set(`${decl.name.text}#${returnedProperty}`, {\n ...objectFact,\n returnedProperty,\n sourceLine: lineOf(sourceFileAst, decl),\n });\n continue;\n }\n const fact = findConnectInExpression(decl.initializer);\n if (fact)\n factsByLocal.set(decl.name.text, {\n ...fact,\n sourceLine: lineOf(sourceFileAst, decl),\n });\n }\n }\n for (const [exportedName, localName] of exportedLocals) {\n const fact = factsByLocal.get(localName);\n if (fact)\n out.push({\n ...fact,\n exportedName,\n sourceFile: normalizePath(filePath),\n sourceLine: fact.sourceLine,\n });\n }\n for (const [key, fact] of factsByLocal) {\n const [localName, returnedProperty] = key.split('#');\n if (!returnedProperty) continue;\n for (const [exportedName, exportedLocal] of exportedLocals) {\n if (exportedLocal !== localName) continue;\n out.push({ ...fact, exportedName, returnedProperty, sourceFile: normalizePath(filePath), sourceLine: fact.sourceLine });\n }\n }\n return out;\n}\n\nexport async function parseServiceBindings(\n repoPath: string,\n filePath: string,\n): Promise<ServiceBindingFact[]> {\n const sf = await readSource(path.join(repoPath, filePath));\n if (!sf) return [];\n const sourceFileAst = sf;\n const out: ServiceBindingFact[] = [];\n const imports = await importsFor(repoPath, filePath, sf);\n const helperCache = new Map<string, HelperBinding[]>();\n const classHelpers = collectClassHelpers(sourceFileAst);\n const localObjectHelpers = new Map<string, HelperBinding[]>();\n for (const stmt of sourceFileAst.statements) {\n if (ts.isFunctionDeclaration(stmt) && stmt.name) {\n const rows: HelperBinding[] = [];\n for (const [returnedProperty, fact] of collectReturnedObjectBindings(stmt))\n rows.push({ ...fact, exportedName: stmt.name.text, returnedProperty, sourceFile: normalizePath(filePath), sourceLine: lineOf(sourceFileAst, stmt) });\n if (rows.length > 0) localObjectHelpers.set(stmt.name.text, rows);\n }\n if (ts.isVariableStatement(stmt)) {\n for (const decl of stmt.declarationList.declarations) {\n if (!ts.isIdentifier(decl.name)) continue;\n const helper = functionLikeInitializer(decl.initializer);\n if (!helper) continue;\n const rows: HelperBinding[] = [];\n for (const [returnedProperty, fact] of collectReturnedObjectBindings(helper))\n rows.push({ ...fact, exportedName: decl.name.text, returnedProperty, sourceFile: normalizePath(filePath), sourceLine: lineOf(sourceFileAst, decl) });\n if (rows.length > 0) localObjectHelpers.set(decl.name.text, rows);\n }\n }\n }\n async function importedHelpers(\n localName: string,\n ): Promise<Array<{ imp: ImportBinding; helper: HelperBinding }>> {\n const imp = imports.find((i) => i.localName === localName && i.sourceFile);\n if (!imp?.sourceFile) return [];\n if (!helperCache.has(imp.sourceFile))\n helperCache.set(\n imp.sourceFile,\n await helperBindings(repoPath, imp.sourceFile),\n );\n return (helperCache.get(imp.sourceFile) ?? [])\n .filter((h) => h.exportedName === imp.exportedName)\n .map((helper) => ({ imp, helper }));\n }\n async function importedHelper(\n localName: string,\n ): Promise<{ imp: ImportBinding; helper: HelperBinding } | undefined> {\n return (await importedHelpers(localName)).find((row) => !row.helper.returnedProperty);\n }\n function bindingForVariable(variableName: string): ServiceBindingFact | undefined {\n const sourceFile = normalizePath(filePath);\n return [...out]\n .reverse()\n .find((row) => row.variableName === variableName && row.sourceFile === sourceFile);\n }\n function cloneAliasBinding(targetName: string, sourceName: string, aliasKind: 'identity' | 'identity-assignment' | 'transaction', node: ts.Node): void {\n const existing = bindingForVariable(sourceName);\n if (!existing) return;\n out.push({\n ...existing,\n variableName: targetName,\n sourceLine: lineOf(sourceFileAst, node),\n helperChain: [\n ...(existing.helperChain ?? []),\n {\n callerVariable: targetName,\n aliasOf: sourceName,\n aliasKind,\n scopeRule: 'same-file-source-order',\n },\n ],\n });\n }\n function recordIdentityAlias(decl: ts.VariableDeclaration): void {\n if (!ts.isIdentifier(decl.name) || !decl.initializer) return;\n const unwrapped = unwrapIdentityExpression(decl.initializer);\n if (!ts.isIdentifier(unwrapped)) return;\n cloneAliasBinding(decl.name.text, unwrapped.text, 'identity', decl);\n }\n\n async function recordBindingFromExpression(targetName: string, expr: ts.Expression, node: ts.Node, aliasKind: 'declaration' | 'assignment'): Promise<void> {\n const call = unwrapCall(expr);\n if (!call) return;\n const direct = connectFactFromCall(call);\n if (direct)\n out.push({\n variableName: targetName,\n ...direct,\n sourceFile: normalizePath(filePath),\n sourceLine: lineOf(sourceFileAst, node),\n helperChain: aliasKind === 'assignment'\n ? [{ callerVariable: targetName, assignedFrom: call.expression.getText(sourceFileAst), aliasKind, scopeRule: 'same-file-source-order' }]\n : undefined,\n });\n else if (ts.isIdentifier(call.expression)) {\n const resolved = await importedHelper(call.expression.text);\n if (resolved)\n out.push({\n variableName: targetName,\n alias: resolved.helper.alias,\n aliasExpr: resolved.helper.aliasExpr,\n destinationExpr: resolved.helper.destinationExpr,\n servicePathExpr: resolved.helper.servicePathExpr,\n isDynamic: resolved.helper.isDynamic,\n placeholders: resolved.helper.placeholders,\n sourceFile: normalizePath(filePath),\n sourceLine: lineOf(sourceFileAst, node),\n helperChain: [\n {\n callerVariable: targetName,\n ...(aliasKind === 'assignment' ? { assignedFrom: call.expression.text, aliasKind, scopeRule: 'same-file-source-order' } : {}),\n importedHelper: call.expression.text,\n importSource: resolved.imp.sourceFile,\n exportedSymbol: resolved.imp.exportedName,\n helperSourceFile: resolved.helper.sourceFile,\n helperSourceLine: resolved.helper.sourceLine,\n },\n ],\n });\n }\n }\n async function recordVariable(decl: ts.VariableDeclaration): Promise<void> {\n if (!ts.isIdentifier(decl.name) || !decl.initializer) return;\n await recordBindingFromExpression(decl.name.text, decl.initializer, decl, 'declaration');\n }\n\n async function helpersForCall(call: ts.CallExpression): Promise<Array<{ helper: HelperBinding; imp?: ImportBinding }>> {\n if (!ts.isIdentifier(call.expression)) return [];\n const local = localObjectHelpers.get(call.expression.text) ?? [];\n const imported = await importedHelpers(call.expression.text);\n return [...local.map((helper) => ({ helper })), ...imported];\n }\n async function recordDestructuredHelper(decl: ts.VariableDeclaration): Promise<void> {\n if (!ts.isObjectBindingPattern(decl.name) || !decl.initializer) return;\n const call = unwrapCall(decl.initializer);\n if (!call) return;\n const helpers = await helpersForCall(call);\n if (helpers.length === 0) return;\n for (const el of decl.name.elements) {\n if (!ts.isIdentifier(el.name)) continue;\n const propertyName = el.propertyName && ts.isIdentifier(el.propertyName) ? el.propertyName.text : el.name.text;\n const matches = helpers.filter((row) => row.helper.returnedProperty === propertyName);\n if (matches.length !== 1) continue;\n const resolved = matches[0];\n out.push({\n variableName: el.name.text,\n alias: resolved.helper.alias,\n aliasExpr: resolved.helper.aliasExpr,\n destinationExpr: resolved.helper.destinationExpr,\n servicePathExpr: resolved.helper.servicePathExpr,\n isDynamic: resolved.helper.isDynamic,\n placeholders: resolved.helper.placeholders,\n sourceFile: normalizePath(filePath),\n sourceLine: lineOf(sourceFileAst, decl),\n helperChain: [{ callerVariable: el.name.text, helperFunction: call.expression.getText(sourceFileAst), returnedProperty: propertyName, importSource: resolved.imp?.sourceFile, exportedSymbol: resolved.imp?.exportedName, helperSourceFile: resolved.helper.sourceFile, helperSourceLine: resolved.helper.sourceLine }],\n });\n }\n }\n async function recordDestructuredAssignment(pattern: ts.ObjectLiteralExpression, expr: ts.Expression, node: ts.Node): Promise<void> {\n const call = unwrapCall(expr);\n if (!call) return;\n const helpers = await helpersForCall(call);\n if (helpers.length === 0) return;\n for (const prop of pattern.properties) {\n let propertyName: string | undefined;\n let targetName: string | undefined;\n if (ts.isShorthandPropertyAssignment(prop)) {\n propertyName = prop.name.text;\n targetName = prop.name.text;\n } else if (ts.isPropertyAssignment(prop)) {\n propertyName = ts.isIdentifier(prop.name) || ts.isStringLiteralLike(prop.name) ? prop.name.text : undefined;\n targetName = ts.isIdentifier(prop.initializer) ? prop.initializer.text : undefined;\n }\n if (!propertyName || !targetName) continue;\n const matches = helpers.filter((row) => row.helper.returnedProperty === propertyName);\n if (matches.length !== 1) continue;\n const resolved = matches[0];\n out.push({\n variableName: targetName,\n alias: resolved.helper.alias,\n aliasExpr: resolved.helper.aliasExpr,\n destinationExpr: resolved.helper.destinationExpr,\n servicePathExpr: resolved.helper.servicePathExpr,\n isDynamic: resolved.helper.isDynamic,\n placeholders: resolved.helper.placeholders,\n sourceFile: normalizePath(filePath),\n sourceLine: lineOf(sourceFileAst, node),\n helperChain: [{ callerVariable: targetName, assignedFrom: call.expression.getText(sourceFileAst), aliasKind: 'assignment', scopeRule: 'same-file-source-order', returnedProperty: propertyName, importSource: resolved.imp?.sourceFile, exportedSymbol: resolved.imp?.exportedName, helperSourceFile: resolved.helper.sourceFile, helperSourceLine: resolved.helper.sourceLine }],\n });\n }\n }\n function recordDestructuredClassHelper(decl: ts.VariableDeclaration): void {\n if (!ts.isObjectBindingPattern(decl.name) || !decl.initializer) return;\n const call = unwrapCall(decl.initializer);\n if (!call || !ts.isPropertyAccessExpression(call.expression)) return;\n const target = call.expression;\n if (target.expression.kind !== ts.SyntaxKind.ThisKeyword) return;\n for (const el of decl.name.elements) {\n if (!ts.isIdentifier(el.name)) continue;\n const propertyName = el.propertyName && ts.isIdentifier(el.propertyName)\n ? el.propertyName.text\n : el.name.text;\n const helper = classHelpers.find(\n (h) => h.helperName === target.name.text && h.propertyName === propertyName,\n );\n if (!helper) continue;\n out.push({\n variableName: el.name.text,\n ...helper.fact,\n sourceFile: normalizePath(filePath),\n sourceLine: lineOf(sourceFileAst, decl),\n helperChain: [\n {\n callerVariable: el.name.text,\n className: helper.className,\n classHelper: helper.helperName,\n returnedProperty: helper.propertyName,\n helperVariable: helper.variableName,\n helperSourceFile: normalizePath(filePath),\n helperSourceLine: helper.sourceLine,\n },\n ],\n });\n }\n }\n const events: Array<{ pos: number; node: ts.VariableDeclaration | ts.BinaryExpression }> = [];\n function collectEvents(node: ts.Node): void {\n if (ts.isVariableDeclaration(node)) events.push({ pos: node.getStart(sourceFileAst), node });\n if (ts.isBinaryExpression(node) && node.operatorToken.kind === ts.SyntaxKind.EqualsToken)\n events.push({ pos: node.getStart(sourceFileAst), node });\n ts.forEachChild(node, collectEvents);\n }\n collectEvents(sourceFileAst);\n events.sort((a, b) => a.pos - b.pos);\n for (const event of events) {\n if (ts.isVariableDeclaration(event.node)) {\n const decl = event.node;\n await recordDestructuredHelper(decl);\n recordDestructuredClassHelper(decl);\n await recordVariable(decl);\n recordIdentityAlias(decl);\n if (ts.isIdentifier(decl.name) && decl.initializer && ts.isCallExpression(decl.initializer) && ts.isPropertyAccessExpression(decl.initializer.expression) && decl.initializer.expression.name.text === 'tx' && ts.isIdentifier(decl.initializer.expression.expression)) {\n cloneAliasBinding(decl.name.text, decl.initializer.expression.expression.text, 'transaction', decl);\n }\n continue;\n }\n const assignment = event.node;\n if (ts.isIdentifier(assignment.left)) {\n const rhs = unwrapIdentityExpression(assignment.right);\n if (ts.isIdentifier(rhs)) {\n cloneAliasBinding(assignment.left.text, rhs.text, 'identity-assignment', assignment);\n continue;\n }\n await recordBindingFromExpression(assignment.left.text, assignment.right, assignment, 'assignment');\n continue;\n }\n const left = ts.isParenthesizedExpression(assignment.left) ? assignment.left.expression : assignment.left;\n if (ts.isObjectLiteralExpression(left))\n await recordDestructuredAssignment(left, assignment.right, assignment);\n }\n return out;\n}\n\nfunction collectClassHelpers(sf: ts.SourceFile): ClassHelperReturn[] {\n const helpers: ClassHelperReturn[] = [];\n for (const stmt of sf.statements) {\n if (!ts.isClassDeclaration(stmt) || !stmt.name) continue;\n for (const member of stmt.members) {\n if (!ts.isPropertyDeclaration(member) || !member.initializer) continue;\n if (!ts.isIdentifier(member.name)) continue;\n const className = stmt.name.text;\n const helperName = member.name.text;\n const initializer = member.initializer;\n if (!ts.isArrowFunction(initializer) && !ts.isFunctionExpression(initializer))\n continue;\n const bindings = new Map<\n string,\n Omit<HelperBinding, 'exportedName' | 'sourceFile' | 'sourceLine'>\n >();\n function visit(node: ts.Node): void {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n const fact = findConnectInExpression(node.initializer);\n if (fact) bindings.set(node.name.text, fact);\n }\n if (ts.isReturnStatement(node) && node.expression && ts.isObjectLiteralExpression(node.expression)) {\n for (const prop of node.expression.properties) {\n if (ts.isShorthandPropertyAssignment(prop)) {\n const fact = bindings.get(prop.name.text);\n if (fact)\n helpers.push({\n className,\n helperName,\n propertyName: prop.name.text,\n variableName: prop.name.text,\n fact,\n sourceLine: lineOf(sf, prop),\n });\n }\n if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.initializer)) {\n const propertyName =\n ts.isIdentifier(prop.name) || ts.isStringLiteralLike(prop.name)\n ? prop.name.text\n : undefined;\n const fact = propertyName ? bindings.get(prop.initializer.text) : undefined;\n if (propertyName && fact)\n helpers.push({\n className,\n helperName,\n propertyName,\n variableName: prop.initializer.text,\n fact,\n sourceLine: lineOf(sf, prop),\n });\n }\n }\n }\n ts.forEachChild(node, visit);\n }\n visit(initializer);\n }\n }\n return helpers;\n}\n","export interface RuntimeSubstitution {\n original?: string;\n effective?: string;\n placeholders: string[];\n missing: string[];\n supplied: string[];\n changed: boolean;\n}\n\nconst PLACEHOLDER = /\\$\\{([^}]*)\\}/g;\n\nexport function applyVariables(\n template: string | undefined,\n vars: Record<string, string>,\n): string | undefined {\n return substituteVariables(template, vars).effective;\n}\n\nexport function extractPlaceholders(template: string | undefined): string[] {\n return [...(template ?? '').matchAll(PLACEHOLDER)]\n .map((m) => (m[1] ?? '').trim())\n .filter(Boolean);\n}\n\nexport function substituteVariables(\n template: string | undefined,\n vars: Record<string, string>,\n): RuntimeSubstitution {\n if (!template) return { placeholders: [], missing: [], supplied: [], changed: false };\n const placeholders = [...new Set(extractPlaceholders(template))];\n const supplied = placeholders.filter((key) => Object.hasOwn(vars, key));\n const missing = placeholders.filter((key) => !Object.hasOwn(vars, key));\n const effective = template.replace(PLACEHOLDER, (_m, key: string) => {\n const trimmed = key.trim();\n return Object.hasOwn(vars, trimmed) ? vars[trimmed] ?? '' : `\\${${trimmed}}`;\n });\n return {\n original: template,\n effective,\n placeholders,\n missing,\n supplied,\n changed: effective !== template,\n };\n}\n","export interface RemoteQueryTargetInput {\n queryEntity?: unknown;\n servicePath?: string;\n serviceAlias?: unknown;\n serviceAliasExpr?: unknown;\n destination?: string;\n isDynamic?: boolean;\n parserWarning?: unknown;\n}\n\nexport interface RemoteQueryTarget {\n toKind: 'remote_entity' | 'remote_query';\n toId: string;\n label: string;\n evidence: Record<string, unknown>;\n}\n\nexport function buildRemoteQueryTarget(input: RemoteQueryTargetInput): RemoteQueryTarget {\n const entity = typeof input.queryEntity === 'string' && input.queryEntity.trim() ? input.queryEntity.trim() : undefined;\n const servicePath = input.servicePath?.trim();\n const prefix = servicePath ? `${servicePath}:` : '';\n const label = entity ? `Remote entity: ${prefix}${entity}` : 'Remote query: unknown';\n return {\n toKind: entity ? 'remote_entity' : 'remote_query',\n toId: entity ? `${prefix}${entity}` : 'unknown',\n label,\n evidence: {\n remoteQueryTarget: label,\n queryEntity: entity,\n queryTargetKind: entity ? 'remote_entity' : 'remote_query_unknown',\n queryEntityDynamic: entity ? undefined : Boolean(input.isDynamic) || undefined,\n serviceAlias: input.serviceAlias,\n serviceAliasExpr: input.serviceAliasExpr,\n destination: input.destination,\n servicePath,\n parserWarning: entity ? input.parserWarning : input.parserWarning ?? { code: 'query_entity_unknown', message: 'Remote query entity is dynamic or unavailable' },\n },\n };\n}\n","import type { Db } from '../db/connection.js';\nexport interface OperationTarget {\n operationId: number;\n repoName: string;\n serviceName: string;\n qualifiedName: string;\n servicePath: string;\n operationPath: string;\n operationName: string;\n sourceFile: string;\n sourceLine: number;\n repoId?: number;\n packageName?: string | null;\n score: number;\n reasons: string[];\n}\nexport interface OperationResolution {\n status: 'resolved' | 'ambiguous' | 'unresolved' | 'dynamic';\n target?: OperationTarget;\n candidates: OperationTarget[];\n reasons: string[];\n}\nfunction rows(\n db: Db,\n operationPath: string,\n workspaceId?: number,\n): OperationTarget[] {\n const names = operationLookupNames(operationPath);\n return db\n .prepare(\n `SELECT o.id operationId,r.id repoId,r.name repoName,r.package_name packageName,s.service_name serviceName,s.qualified_name qualifiedName,s.service_path servicePath,o.operation_path operationPath,o.operation_name operationName,o.source_file sourceFile,o.source_line sourceLine,0 score,'' reasons\n FROM cds_operations o JOIN cds_services s ON s.id=o.service_id JOIN repositories r ON r.id=s.repo_id\n WHERE (? IS NULL OR r.workspace_id=?) AND (o.operation_path IN (?,?) OR o.operation_name IN (?,?)) ORDER BY r.name,s.service_path,o.operation_name`,\n )\n .all(\n workspaceId,\n workspaceId,\n names.path,\n names.simplePath,\n names.name,\n names.simpleName,\n ) as unknown as OperationTarget[];\n}\nfunction operationLookupNames(operationPath: string): { path: string; simplePath: string; name: string; simpleName: string } {\n const name = operationPath.replace(/^\\//, '');\n const simpleName = name.split('.').at(-1) ?? name;\n return { path: operationPath, simplePath: `/${simpleName}`, name, simpleName };\n}\nfunction operationMatches(candidate: OperationTarget, operationPath: string | undefined): boolean {\n if (!operationPath) return false;\n const names = operationLookupNames(operationPath);\n return candidate.operationPath === names.path || candidate.operationPath === names.simplePath || candidate.operationName === names.name || candidate.operationName === names.simpleName;\n}\nexport function resolveOperation(\n db: Db,\n signals: {\n servicePath?: string;\n alias?: string;\n destination?: string;\n operationPath?: string;\n serviceName?: string;\n repoId?: number;\n hasExplicitOverride?: boolean;\n isDynamic?: boolean;\n localServiceLookup?: string;\n },\n workspaceId?: number,\n): OperationResolution {\n const missing = [signals.servicePath, signals.alias, signals.destination, signals.operationPath].flatMap((value) => [...(value ?? '').matchAll(/\\$\\{([^}]*)\\}/g)].map((match) => (match[1] ?? '').trim())).filter(Boolean);\n if (missing.length > 0)\n return {\n status: 'dynamic',\n candidates: signals.operationPath ? rows(db, signals.operationPath, workspaceId) : [],\n reasons: [...new Set(missing)].map((name) => `missing_variable:${name}`),\n };\n if (!signals.operationPath)\n return {\n status: 'unresolved',\n candidates: [],\n reasons: ['missing_operation_path'],\n };\n const allCandidates = rows(db, signals.operationPath, workspaceId).map((c) => ({\n ...c,\n score: 0.2,\n reasons: ['operation_path_match'],\n }));\n let candidates = allCandidates.filter((c) => matchesLocalRepo(db, c.operationId, signals.repoId));\n if (candidates.length === 0 && signals.repoId !== undefined && signals.serviceName) {\n candidates = implementationContextCandidates(db, allCandidates, signals.repoId, signals.serviceName);\n if (candidates.length === 0)\n return {\n status: 'unresolved',\n candidates: allCandidates.filter((c) => serviceMatches(c, signals.serviceName)),\n reasons: allCandidates.some((c) => serviceMatches(c, signals.serviceName)) ? ['local_service_candidate_without_caller_ownership'] : ['no_operation_candidates'],\n };\n }\n if (candidates.length === 0)\n return {\n status: 'unresolved',\n candidates: [],\n reasons: ['no_operation_candidates'],\n };\n const hasStrongSignal = Boolean(\n signals.servicePath ||\n signals.serviceName ||\n signals.alias ||\n signals.destination ||\n signals.hasExplicitOverride,\n );\n for (const c of candidates) {\n if (signals.servicePath && c.servicePath === signals.servicePath) {\n c.score += 0.75;\n c.reasons.push('exact_service_path');\n }\n if (signals.servicePath && c.servicePath !== signals.servicePath) {\n c.score -= 0.1;\n c.reasons.push('service_path_mismatch');\n }\n if (signals.serviceName) {\n const simple = signals.serviceName.split('.').at(-1) ?? signals.serviceName;\n if (c.qualifiedName === signals.serviceName) {\n c.score += 0.8;\n c.reasons.push('exact_local_qualified_service_name');\n } else if (c.serviceName === signals.serviceName || c.serviceName === simple) {\n c.score += 0.75;\n c.reasons.push('exact_local_simple_service_name');\n } else if (c.servicePath === signals.serviceName || c.servicePath === `/${signals.serviceName}` || c.servicePath === `/${simple}`) {\n c.score += 0.7;\n c.reasons.push('exact_local_service_path');\n } else if (c.servicePath.endsWith(`/${simple}`)) {\n c.score += candidates.filter((candidate) => candidate.servicePath.endsWith(`/${simple}`)).length === 1 ? 0.65 : 0.2;\n c.reasons.push('suffix_local_service_path');\n } else c.reasons.push('local_service_name_mismatch');\n }\n if (signals.hasExplicitOverride) {\n c.score += 0.2;\n c.reasons.push(signals.repoId !== undefined ? 'explicit_local_service_call' : 'explicit_dynamic_override');\n }\n if (signals.repoId !== undefined && candidates.length === 1 && signals.serviceName && c.reasons.includes('local_service_name_mismatch') && operationMatches(c, signals.operationPath)) {\n c.score = Math.max(c.score, 0.9);\n c.reasons.push('same_repo_unique_operation_path_with_lookup_mismatch');\n }\n }\n for (const c of candidates) c.score = Math.max(0, Math.min(1, c.score));\n candidates.sort(\n (a, b) => b.score - a.score || a.repoName.localeCompare(b.repoName),\n );\n const best = candidates[0];\n const second = candidates[1];\n if (signals.isDynamic && !signals.hasExplicitOverride && !signals.servicePath)\n return {\n status: 'dynamic',\n candidates,\n reasons: ['dynamic_target_without_override'],\n };\n if (!hasStrongSignal)\n return {\n status: candidates.length > 1 ? 'ambiguous' : 'unresolved',\n candidates,\n reasons: ['operation_path_only_has_no_strong_target_signal'],\n };\n if (\n best &&\n best.score >= 0.9 &&\n (best.servicePath === signals.servicePath || Boolean(signals.serviceName && (!best.reasons.includes('local_service_name_mismatch') || best.reasons.includes('same_repo_unique_operation_path_with_lookup_mismatch')))) &&\n operationMatches(best, signals.operationPath) &&\n (!second || best.score - second.score >= 0.25)\n )\n return {\n status: 'resolved',\n target: best,\n candidates,\n reasons: best.reasons,\n };\n return {\n status: candidates.length > 1 ? 'ambiguous' : 'unresolved',\n candidates,\n reasons: ['candidate_score_below_resolution_threshold'],\n };\n}\nfunction serviceMatches(candidate: OperationTarget, serviceName: string | undefined): boolean {\n if (!serviceName) return false;\n const simple = serviceName.split('.').at(-1) ?? serviceName;\n return candidate.qualifiedName === serviceName || candidate.serviceName === serviceName || candidate.serviceName === simple || candidate.servicePath === serviceName || candidate.servicePath === `/${serviceName}` || candidate.servicePath === `/${simple}` || candidate.servicePath.endsWith(`/${simple}`);\n}\nfunction implementationContextCandidates(db: Db, candidates: OperationTarget[], callerRepoId: number, serviceName: string): OperationTarget[] {\n const matching = candidates.filter((candidate) => serviceMatches(candidate, serviceName));\n const owned = matching.map((candidate) => ownershipReason(db, candidate, callerRepoId)).filter((item): item is { candidate: OperationTarget; reason: string } => Boolean(item));\n if (owned.length === 0) return [];\n const direct = owned.filter((item) => item.reason !== 'caller_depends_on_model_package');\n const chosen = direct.length > 0 ? direct : owned.length === 1 ? owned : [];\n return chosen.map((item) => ({ ...item.candidate, score: 0.95, reasons: [...item.candidate.reasons, 'implementation_context_caller_ownership', item.reason] }));\n}\nfunction ownershipReason(db: Db, candidate: OperationTarget, callerRepoId: number): { candidate: OperationTarget; reason: string } | undefined {\n const edge = db.prepare(\"SELECT status,evidence_json,to_id FROM graph_edges WHERE edge_type='OPERATION_IMPLEMENTED_BY_HANDLER' AND from_kind='operation' AND from_id=? ORDER BY CASE status WHEN 'resolved' THEN 0 WHEN 'ambiguous' THEN 1 ELSE 2 END LIMIT 1\").get(String(candidate.operationId)) as { status?: string; evidence_json?: string; to_id?: string } | undefined;\n if (edge?.status === 'resolved') {\n const row = db.prepare('SELECT hc.repo_id repoId FROM handler_methods hm JOIN handler_classes hc ON hc.id=hm.handler_class_id WHERE hm.id=?').get(edge.to_id) as { repoId?: number } | undefined;\n if (row?.repoId === callerRepoId) return { candidate, reason: 'resolved_implementation_handler_repo_matches_caller' };\n }\n if (edge?.evidence_json) {\n const evidence = JSON.parse(edge.evidence_json) as { candidates?: Array<{ accepted?: boolean; handlerPackage?: { id?: number }; applicationPackage?: { id?: number } }> };\n const hit = evidence.candidates?.find((item) => item.accepted && (Number(item.handlerPackage?.id) === callerRepoId || Number(item.applicationPackage?.id) === callerRepoId));\n if (hit) return { candidate, reason: edge.status === 'ambiguous' ? 'ambiguous_implementation_candidate_repo_matches_caller' : 'registration_package_matches_caller' };\n }\n const dep = db.prepare(\"SELECT 1 FROM graph_edges WHERE edge_type='REPO_IMPORTS_HELPER_PACKAGE' AND status='resolved' AND from_kind='repo' AND from_id=? AND to_id=?\").get(String(callerRepoId), String(candidate.repoId));\n if (dep) return { candidate, reason: 'caller_depends_on_model_package' };\n return undefined;\n}\n\nfunction matchesLocalRepo(db: Db, operationId: number, repoId: number | undefined): boolean {\n if (repoId === undefined) return true;\n const row = db.prepare('SELECT s.repo_id repoId FROM cds_operations o JOIN cds_services s ON s.id=o.service_id WHERE o.id=?').get(operationId) as { repoId?: number } | undefined;\n return row?.repoId === repoId;\n}\nexport function findOperation(\n db: Db,\n servicePath: string | undefined,\n operationPath: string | undefined,\n workspaceId?: number,\n): OperationTarget | undefined {\n return resolveOperation(db, { servicePath, operationPath }, workspaceId)\n .target;\n}\n","import type { Db } from '../db/connection.js';\n\ninterface RepoDependencyRow {\n id: number;\n name: string;\n package_name: string | null;\n dependencies_json: string;\n}\nexport interface DependencyLinkSummary {\n edgeCount: number;\n resolvedCount: number;\n ambiguousCount: number;\n}\ninterface CandidateResult {\n candidates: RepoDependencyRow[];\n strategy: 'exact_package_name' | 'normalized_directory';\n}\nfunction normalizeName(value: string): string {\n return value.toLowerCase().replace(/^@[^/]+\\//, '').replace(/[^a-z0-9]+/g, '');\n}\nfunction candidatesForDependency(repos: RepoDependencyRow[], dep: string, sourceId: number): CandidateResult {\n const exact = repos.filter((repo) => repo.id !== sourceId && repo.package_name === dep);\n if (exact.length > 0) return { candidates: exact, strategy: 'exact_package_name' };\n const normalized = normalizeName(dep);\n return { candidates: repos.filter((repo) => repo.id !== sourceId && normalizeName(repo.name) === normalized), strategy: 'normalized_directory' };\n}\nexport function linkHelperPackages(db: Db, workspaceId: number, generation: number): DependencyLinkSummary {\n const repos = db.prepare('SELECT id,name,package_name,dependencies_json FROM repositories WHERE workspace_id=?').all(workspaceId) as unknown as RepoDependencyRow[];\n const summary: DependencyLinkSummary = { edgeCount: 0, resolvedCount: 0, ambiguousCount: 0 };\n for (const repo of repos) {\n const deps = JSON.parse(repo.dependencies_json) as Record<string, string>;\n for (const dep of Object.keys(deps)) {\n const result = candidatesForDependency(repos, dep, repo.id);\n if (result.candidates.length === 0) continue;\n const status = result.candidates.length === 1 ? 'resolved' : 'ambiguous';\n const helper = status === 'resolved' ? result.candidates[0] : undefined;\n db.prepare('INSERT INTO graph_edges(workspace_id,edge_type,status,from_kind,from_id,to_kind,to_id,confidence,evidence_json,is_dynamic,unresolved_reason,generation) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)').run(\n workspaceId,\n 'REPO_IMPORTS_HELPER_PACKAGE',\n status,\n 'repo',\n String(repo.id),\n helper ? 'repo' : 'repo_candidates',\n helper ? String(helper.id) : result.candidates.map((candidate) => candidate.id).join(','),\n helper ? 1 : 0.5,\n JSON.stringify({ dependency: dep, candidates: result.candidates.map((candidate) => ({ id: candidate.id, name: candidate.name, packageName: candidate.package_name })), match: result.strategy }),\n 0,\n helper ? null : 'Ambiguous dependency package candidates',\n generation,\n );\n summary.edgeCount += 1;\n if (helper) summary.resolvedCount += 1;\n else summary.ambiguousCount += 1;\n }\n }\n return summary;\n}\n","function lowerFirst(value: string): string {\n return value ? `${value[0]?.toLowerCase() ?? ''}${value.slice(1)}` : value;\n}\nexport type DecoratorOperationSignal =\n | { status: 'resolved'; operationName: string; raw?: string }\n | { status: 'none'; raw?: string }\n | { status: 'unsupported'; raw: string; reason: string }\n | { status: 'malformed'; raw: string; reason: string };\nexport function normalizedOperationName(value: string): string {\n return value.replace(/^\\//, '');\n}\nfunction clean(value: string): string {\n return value.replace(/^[`'\"]|[`'\"]$/g, '');\n}\nfunction generatedFromConstantName(value: string): string | undefined {\n for (const prefix of ['Action', 'Func']) {\n if (value.startsWith(prefix) && value.length > prefix.length && /^[A-Z]/.test(value.slice(prefix.length))) return lowerFirst(value.slice(prefix.length));\n }\n return undefined;\n}\nfunction resolved(value: string, raw?: string): DecoratorOperationSignal {\n const literal = clean(value);\n const generated = generatedFromConstantName(literal);\n return { status: 'resolved', operationName: generated ?? normalizedOperationName(literal), raw };\n}\nexport function normalizeDecoratorOperationSignal(value: string | undefined, raw: string | undefined, candidateOperation?: string): DecoratorOperationSignal {\n if (value) return resolved(value, raw);\n if (!raw || raw.trim().length === 0) return { status: 'none', raw };\n const expression = raw.trim();\n const nameMatch = /(?:^|\\.)(Action[A-Z][\\w$]*|Func[A-Z][\\w$]*)\\.name$/.exec(expression);\n if (nameMatch?.[1]) return resolved(nameMatch[1], expression);\n const stringMatch = /^String\\(([A-Za-z_$][\\w$]*)\\)$/.exec(expression);\n if (stringMatch?.[1]) {\n const identifier = stringMatch[1];\n const generated = generatedFromConstantName(identifier);\n const normalizedCandidate = candidateOperation ? normalizedOperationName(candidateOperation) : undefined;\n if (generated) return { status: 'resolved', operationName: generated, raw: expression };\n if (normalizedCandidate && identifier === normalizedCandidate) return { status: 'resolved', operationName: identifier, raw: expression };\n return { status: 'unsupported', raw: expression, reason: 'string_wrapper_identifier_not_resolved' };\n }\n if (/^[`'\"]/.test(expression) && !/[`'\"]$/.test(expression)) return { status: 'malformed', raw: expression, reason: 'unterminated_literal' };\n return { status: 'unsupported', raw: expression, reason: 'unsupported_decorator_expression' };\n}\nexport function normalizeDecoratorOperation(value: string | undefined, raw: string | undefined): string | undefined {\n const signal = normalizeDecoratorOperationSignal(value, raw);\n return signal.status === 'resolved' ? signal.operationName : undefined;\n}\n","import type { Db } from '../db/connection.js';\nimport { applyVariables } from './dynamic-edge-resolver.js';\nimport { classifyODataPathIntent, normalizeODataOperationInvocationPath, type NormalizedODataOperationPath } from './odata-path-normalizer.js';\nimport { buildRemoteQueryTarget } from './remote-query-target.js';\nimport { resolveOperation } from './service-resolver.js';\nimport { linkHelperPackages } from './helper-package-linker.js';\nimport { normalizeDecoratorOperationSignal, normalizedOperationName } from './operation-decorator-normalizer.js';\nimport { externalHttpTarget } from './external-http-target.js';\nexport interface LinkWorkspaceResult {\n edgeCount: number;\n unresolvedCount: number;\n resolvedCount: number;\n remoteResolvedCount: number;\n localResolvedCount: number;\n ambiguousCount: number;\n dynamicCount: number;\n terminalCount: number;\n dependencyResolvedCount: number;\n dependencyAmbiguousCount: number;\n implementationResolvedCount: number;\n implementationAmbiguousCount: number;\n implementationUnresolvedCount: number;\n}\nexport function linkWorkspace(db: Db, workspaceId: number, vars: Record<string, string> = {}): LinkWorkspaceResult {\n return db.transaction(() => {\n const generation = nextGraphGeneration(db, workspaceId);\n db.prepare('DELETE FROM graph_edges WHERE workspace_id=?').run(workspaceId);\n const deps = linkHelperPackages(db, workspaceId, generation);\n const impl = linkImplementations(db, workspaceId, generation);\n const callSummary = linkCalls(db, workspaceId, vars, generation);\n db.prepare(\"UPDATE repositories SET graph_generation=?, graph_stale_reason=NULL, graph_stale_at=NULL WHERE workspace_id=?\").run(generation, workspaceId);\n return { ...callSummary, edgeCount: deps.edgeCount + callSummary.edgeCount + impl.edgeCount, dependencyResolvedCount: deps.resolvedCount, dependencyAmbiguousCount: deps.ambiguousCount, implementationResolvedCount: impl.resolvedCount, implementationAmbiguousCount: impl.ambiguousCount, implementationUnresolvedCount: impl.unresolvedCount };\n });\n}\nfunction nextGraphGeneration(db: Db, workspaceId: number): number {\n const row = db.prepare('SELECT COALESCE(MAX(graph_generation),0) generation FROM repositories WHERE workspace_id=?').get(workspaceId) as { generation?: number } | undefined;\n return Number(row?.generation ?? 0) + 1;\n}\nfunction linkCalls(db: Db, workspaceId: number, vars: Record<string, string>, generation: number): Omit<LinkWorkspaceResult, 'dependencyResolvedCount' | 'dependencyAmbiguousCount' | 'implementationResolvedCount' | 'implementationAmbiguousCount' | 'implementationUnresolvedCount'> {\n let edgeCount = 0;\n let unresolvedCount = 0;\n let resolvedCount = 0;\n let remoteResolvedCount = 0;\n let localResolvedCount = 0;\n let ambiguousCount = 0;\n let dynamicCount = 0;\n let terminalCount = 0;\n const calls = db.prepare(`SELECT c.*,r.name repoName,b.alias,b.alias_expr aliasExpr,b.destination_expr destinationExpr,b.service_path_expr servicePathExpr,b.is_dynamic isDynamic,b.placeholders_json placeholdersJson,b.helper_chain_json helperChainJson,req.service_path requireServicePath,req.destination requireDestination FROM outbound_calls c JOIN repositories r ON r.id=c.repo_id LEFT JOIN service_bindings b ON b.id=c.service_binding_id LEFT JOIN cds_requires req ON req.repo_id=c.repo_id AND req.alias=b.alias WHERE r.workspace_id=?`).all(workspaceId) as Array<Record<string, unknown>>;\n for (const call of calls) {\n const result = insertCallEdge(db, workspaceId, call, vars, generation);\n edgeCount += 1;\n resolvedCount += result.status === 'resolved' ? 1 : 0;\n remoteResolvedCount += result.status === 'resolved' && result.callType !== 'local_service_call' ? 1 : 0;\n localResolvedCount += result.status === 'resolved' && result.callType === 'local_service_call' ? 1 : 0;\n unresolvedCount += result.status === 'unresolved' ? 1 : 0;\n ambiguousCount += result.status === 'ambiguous' ? 1 : 0;\n dynamicCount += result.status === 'dynamic' ? 1 : 0;\n terminalCount += result.status === 'terminal' ? 1 : 0;\n }\n return { edgeCount, unresolvedCount, resolvedCount, remoteResolvedCount, localResolvedCount, ambiguousCount, dynamicCount, terminalCount };\n}\nfunction insertCallEdge(db: Db, workspaceId: number, call: Record<string, unknown>, vars: Record<string, string>, generation: number): { status: string; callType: string } {\n const callType = String(call.call_type);\n const rawOp = applyVariables(String(call.operation_path_expr ?? ''), vars);\n const intent = classifyODataPathIntent(rawOp, call.method as string | undefined);\n const isEntityQueryIntent = ['entity_query', 'entity_key_read', 'entity_navigation_query'].includes(intent.kind);\n const resolutionRawOp = callType === 'remote_query' && isEntityQueryIntent ? intent.pathWithoutQuery : rawOp;\n const normalized = normalizeODataOperationInvocationPath(resolutionRawOp);\n const op = normalized?.normalizedOperationPath ?? resolutionRawOp;\n const servicePath = applyVariables((call.servicePathExpr as string | undefined) ?? (call.requireServicePath as string | undefined), vars);\n const destination = (call.destinationExpr as string | undefined) ?? (call.requireDestination as string | undefined);\n const isDynamic = Boolean(Number(call.isDynamic ?? 0));\n const isOperationCall = (callType === 'remote_action' || callType === 'local_service_call') || (callType === 'remote_query' && Boolean(op));\n const resolution = isOperationCall ? resolveOperation(db, { servicePath, operationPath: op, serviceName: call.local_service_name as string | undefined, repoId: callType === 'local_service_call' ? Number(call.repo_id) : undefined, alias: applyVariables((call.aliasExpr as string | undefined) ?? (call.alias as string | undefined), vars), destination: destination ? applyVariables(destination, vars) : undefined, isDynamic, hasExplicitOverride: Object.keys(vars).length > 0 || callType === 'local_service_call' }, workspaceId) : { status: 'unresolved' as const, candidates: [], reasons: [] };\n const evidence = callEvidence(call, resolution, servicePath, op, destination ? applyVariables(destination, vars) : undefined, normalized, intent);\n if (callType === 'remote_query' && (isEntityQueryIntent || !op) && !resolution.target) {\n const target = buildRemoteQueryTarget({ queryEntity: call.query_entity, servicePath, serviceAlias: call.alias, serviceAliasExpr: call.aliasExpr, destination: destination ? applyVariables(destination, vars) : undefined, isDynamic, parserWarning: evidence.parserWarning });\n db.prepare('INSERT INTO graph_edges(workspace_id,edge_type,status,from_kind,from_id,to_kind,to_id,confidence,evidence_json,is_dynamic,generation) VALUES(?,?,?,?,?,?,?,?,?,?,?)').run(workspaceId, 'HANDLER_RUNS_REMOTE_QUERY', 'terminal', 'call', String(call.id), target.toKind, target.toId, Number(call.confidence ?? 0.5), JSON.stringify({ ...evidence, ...target.evidence }), 0, generation);\n return { status: 'terminal', callType };\n }\n if (callType === 'local_service_call' && call.unresolved_reason === 'transport_client_method' && !resolution.target && resolution.candidates.length === 0) {\n db.prepare('INSERT INTO graph_edges(workspace_id,edge_type,status,from_kind,from_id,to_kind,to_id,confidence,evidence_json,is_dynamic,generation) VALUES(?,?,?,?,?,?,?,?,?,?,?)').run(workspaceId, 'HANDLER_CALLS_TRANSPORT_METHOD', 'terminal', 'call', String(call.id), 'transport_method', String(op || 'transport_client_method'), Number(call.confidence ?? 0.5), JSON.stringify({ ...evidence, classification: 'transport_client_method' }), 0, generation);\n return { status: 'terminal', callType };\n }\n if (resolution.target) {\n db.prepare('INSERT INTO graph_edges(workspace_id,edge_type,status,from_kind,from_id,to_kind,to_id,confidence,evidence_json,is_dynamic,generation) VALUES(?,?,?,?,?,?,?,?,?,?,?)').run(workspaceId, callType === 'local_service_call' ? 'LOCAL_CALL_RESOLVES_TO_OPERATION' : 'REMOTE_CALL_RESOLVES_TO_OPERATION', 'resolved', 'call', String(call.id), 'operation', String(resolution.target.operationId), resolution.target.score, JSON.stringify(evidence), 0, generation);\n return { status: 'resolved', callType };\n }\n const edgeType = callType === 'local_db_query' ? 'HANDLER_RUNS_DB_QUERY' : callType === 'external_http' ? 'HANDLER_CALLS_EXTERNAL_HTTP' : callType === 'async_emit' ? 'HANDLER_EMITS_EVENT' : callType === 'async_subscribe' ? 'EVENT_CONSUMED_BY_HANDLER' : resolution.status === 'dynamic' ? 'DYNAMIC_EDGE_CANDIDATE' : 'UNRESOLVED_EDGE';\n const status = edgeType === 'DYNAMIC_EDGE_CANDIDATE' ? 'dynamic' : resolution.status === 'ambiguous' ? 'ambiguous' : edgeType === 'UNRESOLVED_EDGE' ? 'unresolved' : 'terminal';\n const unresolvedReason = status === 'terminal' ? null : String(call.unresolved_reason ?? unresolvedOperationReason(resolution));\n const externalTarget = callType === 'external_http' ? externalHttpTarget(call) : undefined;\n const targetKind = callType === 'local_db_query' ? 'db_entity' : callType.startsWith('async_') ? 'event' : callType === 'external_http' ? (externalTarget?.toKind ?? 'external_endpoint') : 'operation_candidate';\n const targetId = callType === 'local_db_query' ? String(call.query_entity ?? 'unknown') : callType === 'remote_action' ? (op ? `Remote action: ${op}` : (call.unresolved_reason === 'dynamic_operation_path_identifier' ? 'Remote action: dynamic path' : 'Remote action: unknown path')) : callType === 'external_http' ? String(externalTarget?.toId ?? 'unknown') : String(call.event_name_expr ?? op ?? 'unknown');\n const graphLevelDynamic = edgeType === 'DYNAMIC_EDGE_CANDIDATE' && resolution.status === 'dynamic';\n const finalEvidence = externalTarget ? { ...evidence, externalTarget } : evidence;\n db.prepare('INSERT INTO graph_edges(workspace_id,edge_type,status,from_kind,from_id,to_kind,to_id,confidence,evidence_json,is_dynamic,unresolved_reason,generation) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)').run(workspaceId, edgeType, status, 'call', String(call.id), targetKind, targetId, Number(call.confidence ?? 0.2), JSON.stringify(finalEvidence), graphLevelDynamic ? 1 : 0, unresolvedReason, generation);\n return { status, callType };\n}\nfunction unresolvedOperationReason(resolution: { candidates: unknown[]; status: string; reasons: string[] }): string {\n if (resolution.status === 'dynamic') return `Dynamic target requires runtime variable overrides: ${(resolution.reasons.length ? resolution.reasons : ['missing runtime variables']).join(', ')}`;\n if (resolution.candidates.length === 0) return 'No indexed target operation matched';\n if (resolution.reasons.includes('operation_path_only_has_no_strong_target_signal')) return 'Operation candidates found but no strong service signal is available';\n if (resolution.reasons.includes('candidate_score_below_resolution_threshold')) return 'Operation candidates found but resolution score is below threshold';\n if (resolution.status === 'ambiguous') return 'Ambiguous operation candidates require a strong service signal';\n return 'Operation candidates found but resolution could not select a target';\n}\nfunction parseJson(value: unknown): unknown {\n if (!value) return undefined;\n try {\n return JSON.parse(String(value)) as unknown;\n } catch {\n return undefined;\n }\n}\nfunction objectJson(value: unknown): Record<string, unknown> | undefined {\n const parsed = parseJson(value);\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed as Record<string, unknown> : undefined;\n}\nfunction callEvidence(call: Record<string, unknown>, resolution: { target?: { repoName?: string; servicePath?: string; operationPath?: string; operationName?: string }; candidates: unknown[]; status: string; reasons: string[] }, servicePath: string | undefined, op: string | undefined, destination: string | undefined, normalized?: NormalizedODataOperationPath, odataPathIntent?: ReturnType<typeof classifyODataPathIntent>): Record<string, unknown> {\n const bindingHasDynamicExpression = Boolean(Number(call.isDynamic ?? 0));\n return { sourceFile: call.source_file, sourceLine: call.source_line, file: call.source_file, line: call.source_line, callId: call.id, repo: call.repoName, serviceAlias: call.alias, serviceAliasExpr: call.aliasExpr, destination, servicePath, operationPath: op, rawOperationPath: normalized?.wasInvocation ? normalized.rawOperationPath : odataPathIntent?.rawPath, normalizedOperationPath: normalized?.wasInvocation ? normalized.normalizedOperationPath : undefined, invocationArgumentPlaceholderKeys: normalized?.invocationArgumentPlaceholderKeys.length ? normalized.invocationArgumentPlaceholderKeys : undefined, odataOperationNormalizationReason: normalized?.normalizationReason, odataOperationNormalizationRejectedReason: normalized?.normalizationRejectedReason, localServiceName: call.local_service_name, localServiceLookup: call.local_service_lookup, aliasChain: parseJson(call.alias_chain_json), transport: call.call_type === 'local_service_call' ? 'local' : undefined, targetRepo: resolution.target?.repoName, targetServicePath: resolution.target?.servicePath, targetOperationPath: resolution.target?.operationPath, targetOperation: resolution.target?.operationName, helperChain: parseJson(call.helperChainJson), candidates: resolution.candidates, candidateCount: resolution.candidates.length, resolutionStatus: resolution.status, resolutionReasons: resolution.reasons, odataPathIntent, queryStringPresent: odataPathIntent?.hasQueryString || undefined, queryPlaceholderKeys: odataPathIntent?.placeholderKeys.length ? odataPathIntent.placeholderKeys : undefined, bindingHasDynamicExpression: bindingHasDynamicExpression || undefined, outboundEvidence: objectJson(call.evidence_json), analysisCompleteness: call.unresolved_reason ? 'partial' : 'complete', parserWarning: call.unresolved_reason ? { code: 'parser_warning', message: call.unresolved_reason } : undefined };\n}\n\nfunction linkImplementations(db: Db, workspaceId: number, generation: number): { edgeCount: number; resolvedCount: number; ambiguousCount: number; unresolvedCount: number } {\n const operations = db.prepare(`SELECT o.id operationId,o.operation_path operationPath,o.operation_name operationName,s.service_path servicePath,s.repo_id modelRepoId,r.name modelRepo,r.package_name modelPackage,r.kind modelKind FROM cds_operations o JOIN cds_services s ON s.id=o.service_id JOIN repositories r ON r.id=s.repo_id WHERE r.workspace_id=?`).all(workspaceId) as Array<Record<string, unknown>>;\n let edgeCount = 0;\n let resolvedCount = 0;\n let ambiguousCount = 0;\n let unresolvedCount = 0;\n for (const operation of operations) {\n const candidates = rankedImplementationCandidates(db, workspaceId, operation);\n if (candidates.length === 0) continue;\n const accepted = candidates.filter((candidate) => candidate.accepted);\n const topScore = accepted[0]?.score ?? 0;\n const winners = accepted.filter((candidate) => candidate.score === topScore);\n const unique = winners.length === 1 ? winners[0] : undefined;\n const evidence = {\n servicePath: operation.servicePath,\n operationPath: operation.operationPath,\n operationName: operation.operationName,\n modelPackage: { id: operation.modelRepoId, name: operation.modelRepo, packageName: operation.modelPackage },\n candidates: candidates.map((candidate, index) => candidateEvidence(candidate, index + 1)),\n };\n if (accepted.length === 0) {\n db.prepare('INSERT INTO graph_edges(workspace_id,edge_type,status,from_kind,from_id,to_kind,to_id,confidence,evidence_json,is_dynamic,unresolved_reason,generation) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)').run(workspaceId, 'OPERATION_IMPLEMENTED_BY_HANDLER', 'unresolved', 'operation', graphId(operation.operationId), 'handler_method_candidates', candidates.map((row) => graphId(row.methodId)).join(','), 0, JSON.stringify(evidence), 0, 'No implementation candidate passed policy', generation);\n edgeCount += 1;\n unresolvedCount += 1;\n continue;\n }\n db.prepare('INSERT INTO graph_edges(workspace_id,edge_type,status,from_kind,from_id,to_kind,to_id,confidence,evidence_json,is_dynamic,unresolved_reason,generation) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)').run(workspaceId, 'OPERATION_IMPLEMENTED_BY_HANDLER', unique ? 'resolved' : 'ambiguous', 'operation', graphId(operation.operationId), unique ? 'handler_method' : 'handler_method_candidates', unique ? graphId(unique.methodId) : winners.map((row) => graphId(row.methodId)).join(','), unique ? 0.95 : 0.5, JSON.stringify(evidence), 0, unique ? null : 'Ambiguous registered handler implementation candidates', generation);\n edgeCount += 1;\n if (unique) resolvedCount += 1;\n else ambiguousCount += 1;\n }\n return { edgeCount, resolvedCount, ambiguousCount, unresolvedCount };\n}\ninterface ImplementationCandidate extends Record<string, unknown> {\n methodId: number;\n registrations?: Array<Record<string, unknown>>;\n score: number;\n accepted: boolean;\n acceptedReasons: string[];\n rejectedReasons: string[];\n}\nfunction rankedImplementationCandidates(db: Db, workspaceId: number, operation: Record<string, unknown>): ImplementationCandidate[] {\n const rows = implementationCandidates(db, workspaceId, operation);\n return deduplicateCandidates(rows.map((row) => scoreImplementationCandidate(row, operation))).sort((a, b) => b.score - a.score || String(a.className).localeCompare(String(b.className)) || a.methodId - b.methodId);\n}\n\nfunction deduplicateCandidates(rows: ImplementationCandidate[]): ImplementationCandidate[] {\n const merged = new Map<string, ImplementationCandidate>();\n for (const row of rows) {\n const key = [row.methodId, row.classId, row.handlerRepoId].join(':');\n const registration = { file: row.registrationFile, line: row.registrationLine, kind: row.registrationKind, importSource: row.importSource };\n const existing = merged.get(key);\n if (!existing) {\n merged.set(key, { ...row, registrations: [registration] });\n continue;\n }\n existing.registrations = uniqueRegistrations([...(existing.registrations ?? []), registration]);\n existing.score = Math.max(existing.score, row.score);\n existing.accepted = existing.accepted || row.accepted;\n existing.acceptedReasons = [...new Set([...existing.acceptedReasons, ...row.acceptedReasons])];\n existing.rejectedReasons = [...new Set([...existing.rejectedReasons, ...row.rejectedReasons])];\n }\n return [...merged.values()];\n}\nfunction uniqueRegistrations(rows: Array<Record<string, unknown>>): Array<Record<string, unknown>> {\n const seen = new Set<string>();\n return rows.filter((row) => {\n const key = JSON.stringify(row);\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n}\nfunction implementationCandidates(db: Db, workspaceId: number, operation: Record<string, unknown>): Array<Record<string, unknown>> {\n const modelRepoGraphId = graphId(operation.modelRepoId);\n return db.prepare(`SELECT DISTINCT\n hm.id methodId,\n hm.method_name methodName,\n hm.decorator_value decoratorValue,\n hm.decorator_raw_expression decoratorRawExpression,\n hc.id classId,\n hc.class_name className,\n hc.source_file sourceFile,\n hc.source_line sourceLine,\n hr.repo_id applicationRepoId,\n hr.registration_file registrationFile,\n hr.registration_line registrationLine,\n hr.registration_kind registrationKind,\n hr.import_source importSource,\n handlerRepo.id handlerRepoId,\n handlerRepo.name handlerRepo,\n handlerRepo.package_name handlerPackage,\n appRepo.name applicationRepo,\n appRepo.package_name applicationPackage,\n ? modelRepoId,\n ? modelRepo,\n ? modelPackage,\n ? modelKind,\n ? servicePath,\n ? operationPath,\n ? operationName,\n CASE WHEN appRepo.id=? THEN 1 ELSE 0 END modelIsApplicationRepo,\n CASE WHEN handlerRepo.id=? THEN 1 ELSE 0 END modelIsHandlerRepo,\n CASE WHEN appRepo.id=handlerRepo.id THEN 1 ELSE 0 END sameRepoRegistration,\n CASE WHEN EXISTS (SELECT 1 FROM cds_services localService WHERE localService.repo_id=appRepo.id AND localService.service_path=?) THEN 1 ELSE 0 END localServicePathMatch,\n CASE WHEN EXISTS (SELECT 1 FROM cds_services localService WHERE localService.repo_id=appRepo.id) THEN 1 ELSE 0 END applicationHasLocalServices,\n CASE WHEN EXISTS (SELECT 1 FROM handler_registrations localReg JOIN handler_classes localClass ON (localClass.id=localReg.handler_class_id OR localClass.class_name=localReg.class_name) JOIN handler_methods localMethod ON localMethod.handler_class_id=localClass.id WHERE localReg.repo_id=appRepo.id AND (localMethod.decorator_value=? OR localMethod.decorator_value=? OR localMethod.method_name=? OR localMethod.decorator_raw_expression LIKE ?)) THEN 1 ELSE 0 END applicationHasLocalRegistrationForOperation,\n CASE WHEN EXISTS (SELECT 1 FROM graph_edges dep WHERE dep.edge_type='REPO_IMPORTS_HELPER_PACKAGE' AND dep.status='resolved' AND dep.from_kind='repo' AND dep.from_id=CAST(appRepo.id AS TEXT) AND dep.to_id=?) THEN 1 ELSE 0 END appDependsOnModel,\n CASE WHEN EXISTS (SELECT 1 FROM graph_edges dep WHERE dep.edge_type='REPO_IMPORTS_HELPER_PACKAGE' AND dep.status='resolved' AND dep.from_kind='repo' AND dep.from_id=CAST(appRepo.id AS TEXT) AND dep.to_id=CAST(handlerRepo.id AS TEXT)) THEN 1 ELSE 0 END appDependsOnHandler,\n CASE WHEN EXISTS (SELECT 1 FROM graph_edges dep WHERE dep.edge_type='REPO_IMPORTS_HELPER_PACKAGE' AND dep.status='resolved' AND dep.from_kind='repo' AND dep.from_id=CAST(handlerRepo.id AS TEXT) AND dep.to_id=?) THEN 1 ELSE 0 END handlerDependsOnModel\n FROM handler_methods hm\n JOIN handler_classes hc ON hc.id=hm.handler_class_id\n JOIN repositories handlerRepo ON handlerRepo.id=hc.repo_id\n JOIN handler_registrations hr ON (hr.handler_class_id=hc.id OR (hr.class_name=hc.class_name AND (hr.repo_id=hc.repo_id OR hr.import_source IS NOT NULL)))\n JOIN repositories appRepo ON appRepo.id=hr.repo_id\n WHERE appRepo.workspace_id=?\n AND (hm.decorator_value=? OR hm.decorator_value=? OR hm.method_name=? OR hm.decorator_raw_expression LIKE ?)`).all(\n operation.modelRepoId,\n operation.modelRepo,\n operation.modelPackage,\n operation.modelKind,\n operation.servicePath,\n operation.operationPath,\n operation.operationName,\n operation.modelRepoId,\n operation.modelRepoId,\n operation.servicePath,\n normalizedOperation(String(operation.operationPath ?? '')),\n operation.operationName,\n operation.operationName,\n `%${upperFirst(normalizedOperation(String(operation.operationPath ?? operation.operationName ?? '')))}%`,\n modelRepoGraphId,\n modelRepoGraphId,\n workspaceId,\n normalizedOperation(String(operation.operationPath ?? '')),\n operation.operationName,\n operation.operationName,\n `%${upperFirst(normalizedOperation(String(operation.operationPath ?? operation.operationName ?? '')))}%`,\n ) as Array<Record<string, unknown>>;\n}\nfunction scoreImplementationCandidate(row: Record<string, unknown>, operation: Record<string, unknown>): ImplementationCandidate {\n const acceptedReasons: string[] = [];\n const rejectedReasons: string[] = [];\n let score = 0;\n const modelIsApplicationRepo = flag(row.modelIsApplicationRepo);\n const modelIsHandlerRepo = flag(row.modelIsHandlerRepo);\n const localServicePathMatch = flag(row.localServicePathMatch);\n const applicationHasLocalServices = flag(row.applicationHasLocalServices);\n const appDependsOnModel = flag(row.appDependsOnModel);\n const applicationHasLocalRegistrationForOperation = flag(row.applicationHasLocalRegistrationForOperation);\n const appDependsOnHandler = flag(row.appDependsOnHandler);\n const handlerDependsOnModel = flag(row.handlerDependsOnModel);\n const importSource = typeof row.importSource === 'string' && row.importSource.length > 0;\n const sameRepoRegistration = flag(row.sameRepoRegistration);\n const modelOriented = row.modelKind === 'cap-db-model' || !applicationHasLocalRegistrationForOperation;\n const methodSignal = implementationMethodSignal(row, operation);\n const methodMatches = methodSignal.matches;\n acceptedReasons.push(...methodSignal.acceptedReasons);\n rejectedReasons.push(...methodSignal.rejectedReasons);\n const registeredAndLinked = sameRepoRegistration && importSource;\n const helperOwned = modelOriented && methodMatches && registeredAndLinked && sameRepoRegistration && !applicationHasLocalServices && !modelIsApplicationRepo && !modelIsHandlerRepo && !localServicePathMatch && !appDependsOnModel && !appDependsOnHandler && !handlerDependsOnModel;\n if (modelIsApplicationRepo) {\n score += 100;\n acceptedReasons.push('model package equals registration package');\n }\n if (modelIsHandlerRepo) {\n score += 100;\n acceptedReasons.push('model package equals handler package');\n }\n if (localServicePathMatch) {\n score += 80;\n acceptedReasons.push('registration package contains exact local service path');\n } else if (applicationHasLocalServices && !appDependsOnModel && !modelIsApplicationRepo) {\n rejectedReasons.push(`registration package has local services but none match ${String(operation.servicePath ?? '')}`);\n }\n if (appDependsOnModel) {\n score += 70;\n acceptedReasons.push('registration package depends on model package');\n }\n if (appDependsOnHandler) {\n score += 30;\n acceptedReasons.push('registration package depends on handler package');\n }\n if (handlerDependsOnModel) {\n score += 20;\n acceptedReasons.push('handler package depends on model package');\n }\n if (helperOwned) {\n score += 60;\n acceptedReasons.push('unique registered helper implementation for model-only operation');\n }\n if (importSource) {\n score += 10;\n acceptedReasons.push('registration imports handler class');\n }\n const hasOwnership = modelIsApplicationRepo || modelIsHandlerRepo;\n const hasCrossPackage = appDependsOnModel && (modelIsHandlerRepo || appDependsOnHandler || !importSource);\n const contradicted = applicationHasLocalServices && !localServicePathMatch && !appDependsOnModel && !hasOwnership;\n if (!hasOwnership && !localServicePathMatch && !hasCrossPackage && !helperOwned) rejectedReasons.push('missing direct ownership, exact local service path, or validated cross-package dependency evidence');\n const accepted = methodMatches && !methodSignal.contradicted && !contradicted && (hasOwnership || localServicePathMatch || hasCrossPackage || handlerDependsOnModel || helperOwned);\n if (!accepted && rejectedReasons.length === 0) rejectedReasons.push('candidate did not meet implementation ownership policy');\n return { ...row, methodId: Number(row.methodId), score, accepted, acceptedReasons, rejectedReasons };\n}\nfunction candidateEvidence(candidate: ImplementationCandidate, rank: number): Record<string, unknown> {\n return {\n rank,\n score: candidate.score,\n accepted: candidate.accepted,\n acceptedReasons: candidate.acceptedReasons,\n rejectedReasons: candidate.rejectedReasons,\n methodId: candidate.methodId,\n classId: candidate.classId,\n className: candidate.className,\n sourceFile: candidate.sourceFile,\n sourceLine: candidate.sourceLine,\n registration: { file: candidate.registrationFile, line: candidate.registrationLine, kind: candidate.registrationKind, importSource: candidate.importSource },\n registrations: candidate.registrations ?? [],\n applicationPackage: { id: candidate.applicationRepoId, name: candidate.applicationRepo, packageName: candidate.applicationPackage },\n handlerPackage: { id: candidate.handlerRepoId, name: candidate.handlerRepo, packageName: candidate.handlerPackage },\n modelPackage: { id: candidate.modelRepoId, name: candidate.modelRepo, packageName: candidate.modelPackage },\n servicePath: candidate.servicePath,\n operationPath: candidate.operationPath,\n operationName: candidate.operationName,\n signals: {\n directOwnership: { modelIsApplicationRepo: flag(candidate.modelIsApplicationRepo), modelIsHandlerRepo: flag(candidate.modelIsHandlerRepo) },\n localServicePathMatch: flag(candidate.localServicePathMatch),\n applicationHasLocalServices: flag(candidate.applicationHasLocalServices),\n applicationHasLocalRegistrationForOperation: flag(candidate.applicationHasLocalRegistrationForOperation),\n appDependsOnModel: flag(candidate.appDependsOnModel),\n appDependsOnHandler: flag(candidate.appDependsOnHandler),\n handlerDependsOnModel: flag(candidate.handlerDependsOnModel),\n sameRepoRegistration: flag(candidate.sameRepoRegistration),\n },\n };\n}\nfunction implementationMethodSignal(row: Record<string, unknown>, operation: Record<string, unknown>): { matches: boolean; contradicted: boolean; acceptedReasons: string[]; rejectedReasons: string[] } {\n const op = normalizedOperationName(String(operation.operationPath ?? operation.operationName ?? ''));\n const decorator = normalizeDecoratorOperationSignal(typeof row.decoratorValue === 'string' ? row.decoratorValue : undefined, typeof row.decoratorRawExpression === 'string' ? row.decoratorRawExpression : undefined, op);\n if (decorator.status === 'resolved' && decorator.operationName === op) return { matches: true, contradicted: false, acceptedReasons: ['decorator targets operation'], rejectedReasons: [] };\n if (decorator.status === 'resolved' && decorator.operationName !== op) return { matches: false, contradicted: true, acceptedReasons: [], rejectedReasons: ['method_name_matches_but_decorator_targets_different_operation'] };\n if (String(row.methodName ?? '') === op) return { matches: true, contradicted: false, acceptedReasons: ['method name fallback matched operation'], rejectedReasons: [] };\n return { matches: false, contradicted: false, acceptedReasons: [], rejectedReasons: ['method name does not match operation'] };\n}\nfunction upperFirst(value: string): string {\n return value ? `${value[0]?.toUpperCase() ?? ''}${value.slice(1)}` : value;\n}\nfunction flag(value: unknown): boolean {\n return Boolean(Number(value ?? 0));\n}\nfunction graphId(value: unknown): string {\n return String(value);\n}\nfunction normalizedOperation(value: string): string {\n return value.startsWith('/') ? value.slice(1) : value;\n}\n","import type { Db } from '../db/connection.js';\nimport { extractPlaceholders, substituteVariables, type RuntimeSubstitution } from '../linker/dynamic-edge-resolver.js';\nimport { normalizeODataOperationInvocationPath } from '../linker/odata-path-normalizer.js';\nimport { resolveOperation, type OperationTarget } from '../linker/service-resolver.js';\nimport type { TraceEdge, TraceResult, TraceStart } from '../types.js';\n\ninterface RepoRef {\n id: number;\n name: string;\n}\ninterface StartScope {\n repo?: RepoRef;\n sourceFiles?: Set<string>;\n symbolIds?: Set<number>;\n selectorMatched: boolean;\n startOperationId?: string;\n startDiagnostics?: Array<Record<string, unknown>>;\n}\ninterface CallRow extends Record<string, unknown> {\n id: number;\n repo_id: number;\n repoName: string;\n source_file: string;\n source_line: number;\n call_type: string;\n confidence: number;\n source_symbol_id?: number;\n}\ninterface GraphRow extends Record<string, unknown> {\n id: number;\n edge_type: string;\n from_id: string;\n to_kind: string;\n to_id: string;\n confidence: number;\n evidence_json: string;\n unresolved_reason?: string;\n status?: string;\n}\ninterface ContextBinding {\n bindingId: number;\n alias?: string;\n aliasExpr?: string;\n destinationExpr?: string;\n servicePathExpr?: string;\n requireServicePath?: string;\n requireDestination?: string;\n effectiveServicePath?: string;\n effectiveDestination?: string;\n sourceFile?: string;\n sourceLine?: number;\n source: string;\n callerArgument?: string;\n callerProperty?: string;\n calleeParameter?: string;\n calleeObjectProperty?: string;\n calleeLocalDestructuredIdentifier?: string;\n parameterPropertyAliasKind?: unknown;\n parameterPropertyAliasLine?: unknown;\n calleeReceiver: string;\n}\ninterface Candidate {\n servicePath?: string;\n operationPath?: string;\n repoName?: string;\n operationName?: string;\n score?: number;\n}\n\nfunction normalizeOperation(value: string | undefined): string | undefined {\n if (!value) return undefined;\n return value.startsWith('/') ? value.slice(1) : value;\n}\nfunction positiveDepth(value: number): number {\n return Number.isFinite(value) && value > 0 ? Math.floor(value) : 25;\n}\n\nfunction operationStartScope(db: Db, repoId: number | undefined, start: TraceStart): { files?: Set<string>; symbols?: Set<number>; operationId?: string; diagnostics?: Array<Record<string, unknown>> } | undefined {\n const requested = normalizeOperation(start.operationPath ?? start.operation);\n if (!requested) return undefined;\n const rows = db.prepare(`SELECT o.id operationId,o.operation_name operationName,o.operation_path operationPath,s.service_path servicePath,r.id repoId,r.name repoName\n FROM cds_operations o JOIN cds_services s ON s.id=o.service_id JOIN repositories r ON r.id=s.repo_id\n WHERE (? IS NULL OR r.id=?) AND (? IS NULL OR s.service_path=?) AND (o.operation_name=? OR o.operation_path=? OR o.operation_path=?)\n ORDER BY r.name,s.service_path,o.operation_name,o.id`).all(repoId, repoId, start.servicePath, start.servicePath, requested, requested, requested.startsWith('/') ? requested : `/${requested}`) as Array<Record<string, unknown>>;\n if (rows.length === 0) return undefined;\n const repoCount = new Set(rows.map((row) => String(row.repoName))).size;\n const serviceCount = new Set(rows.map((row) => `${String(row.repoName)}:${String(row.servicePath)}`)).size;\n if (!repoId && repoCount > 1) return { diagnostics: [{ severity: 'warning', code: 'trace_start_ambiguous', message: 'Operation trace start matched multiple repositories; add --repo to disambiguate', normalizedSelectorValue: requested, resolutionStage: 'operation', resolutionStatus: 'ambiguous_operation', candidates: rows }] };\n if (!start.servicePath && serviceCount > 1) return { diagnostics: [{ severity: 'warning', code: 'trace_start_ambiguous', message: 'Operation trace start matched multiple services; add --service to disambiguate', normalizedSelectorValue: requested, resolutionStage: 'operation', resolutionStatus: 'ambiguous_operation', candidates: rows }] };\n if (rows.length !== 1) return { diagnostics: [{ severity: 'warning', code: 'trace_start_ambiguous', message: 'Operation trace start matched multiple indexed operations', normalizedSelectorValue: requested, resolutionStage: 'operation', resolutionStatus: 'ambiguous_operation', candidates: rows }] };\n const operationId = String(rows[0]?.operationId);\n const impl = implementationScope(db, operationId);\n if (impl.edge?.status === 'resolved' && impl.files.size > 0) return { files: impl.files, symbols: impl.symbolId ? new Set([impl.symbolId]) : undefined, operationId, diagnostics: [] };\n if (impl.edge) return { operationId, diagnostics: [{ severity: 'warning', code: impl.edge.status === 'ambiguous' ? 'trace_start_ambiguous' : 'trace_start_implementation_unresolved', message: `Indexed operation matched but implementation edge is ${String(impl.edge.status ?? 'unresolved')}`, resolutionStage: 'implementation', resolutionStatus: impl.edge.status === 'ambiguous' ? 'ambiguous_implementation' : 'rejected_implementation', implementationEdgeId: impl.edge.id, implementationStatus: impl.edge.status, candidates: parseEvidence(impl.edge.evidence_json).candidates }] };\n return { operationId, diagnostics: [{ severity: 'warning', code: 'trace_start_implementation_unresolved', message: 'Indexed operation matched but no implementation candidate exists', resolutionStage: 'implementation', resolutionStatus: 'operation_without_implementation' }] };\n}\n\nfunction sourceFilesForStart(\n db: Db,\n repoId: number | undefined,\n start: TraceStart,\n): { files?: Set<string>; symbols?: Set<number> } | undefined {\n const handler = start.handler;\n const operation = normalizeOperation(start.operation ?? start.operationPath);\n if (!handler && !operation) return undefined;\n const rows = db\n .prepare(\n `SELECT DISTINCT hc.source_file sourceFile,s.id symbolId\n FROM handler_classes hc LEFT JOIN handler_methods hm ON hm.handler_class_id=hc.id LEFT JOIN symbols s ON s.repo_id=hc.repo_id AND s.source_file=hc.source_file AND s.name=hm.method_name\n WHERE (? IS NULL OR hc.repo_id=?) AND (? IS NULL OR hc.class_name=? OR hm.method_name=?)\n AND (? IS NULL OR hm.decorator_value=? OR hm.method_name=?)\n AND (? IS NULL OR EXISTS (SELECT 1 FROM cds_services s JOIN cds_operations o ON o.service_id=s.id WHERE s.repo_id=hc.repo_id AND s.service_path=? AND (? IS NULL OR o.operation_path=? OR o.operation_name=? OR hm.decorator_value=? OR hm.method_name=?)))`,\n )\n .all(\n repoId,\n repoId,\n handler,\n handler,\n handler,\n operation,\n operation,\n operation,\n start.servicePath,\n start.servicePath,\n operation,\n operation,\n operation,\n operation,\n operation,\n ) as Array<{ sourceFile?: string; symbolId?: number }>;\n if (rows.length > 0) return { files: new Set(rows.map((row) => row.sourceFile).filter(Boolean) as string[]), symbols: new Set(rows.map((row) => Number(row.symbolId)).filter(Boolean)) };\n if (start.servicePath && operation) {\n const implRows = db.prepare(`SELECT DISTINCT hc.source_file sourceFile,sym.id symbolId\n FROM cds_services s JOIN cds_operations o ON o.service_id=s.id\n JOIN graph_edges e ON e.edge_type='OPERATION_IMPLEMENTED_BY_HANDLER' AND e.status='resolved' AND e.from_kind='operation' AND e.from_id=CAST(o.id AS TEXT)\n JOIN handler_methods hm ON hm.id=CAST(e.to_id AS INTEGER)\n JOIN handler_classes hc ON hc.id=hm.handler_class_id\n LEFT JOIN symbols sym ON sym.repo_id=hc.repo_id AND sym.source_file=hc.source_file AND sym.name=hm.method_name\n WHERE (? IS NULL OR s.repo_id=?) AND s.service_path=? AND (o.operation_path=? OR o.operation_name=?)`).all(repoId, repoId, start.servicePath, operation, operation) as Array<{ sourceFile?: string; symbolId?: number }>;\n if (implRows.length > 0) return { files: new Set(implRows.map((row) => row.sourceFile).filter(Boolean) as string[]), symbols: new Set(implRows.map((row) => Number(row.symbolId)).filter(Boolean)) };\n }\n return undefined;\n}\nfunction startScope(db: Db, start: TraceStart): StartScope {\n const repo = start.repo\n ? (db\n .prepare(\n 'SELECT id,name FROM repositories WHERE name=? OR package_name=?',\n )\n .get(start.repo, start.repo) as RepoRef | undefined)\n : undefined;\n if (start.repo && !repo) return { repo, selectorMatched: false };\n const operationScope = operationStartScope(db, repo?.id, start);\n const terminalOperationScope = operationScope && !operationScope.files && (operationScope.diagnostics ?? []).some((d) => d.resolutionStage === 'operation' || d.resolutionStage === 'implementation');\n const sourceScope = operationScope?.files || terminalOperationScope ? operationScope : sourceFilesForStart(db, repo?.id, start);\n const sourceFiles = sourceScope?.files;\n const hasSelector = Boolean(\n start.handler ?? start.operation ?? start.operationPath ?? start.servicePath,\n );\n if (start.servicePath && !start.operation && !start.operationPath && !start.handler)\n return { repo, selectorMatched: false };\n return {\n repo,\n sourceFiles,\n symbolIds: sourceScope?.symbols,\n selectorMatched: !terminalOperationScope && (!hasSelector || sourceFiles !== undefined),\n startOperationId: operationScope?.operationId,\n startDiagnostics: operationScope?.diagnostics,\n };\n}\nfunction handlerFilesForOperation(db: Db, operationId: string): Set<string> {\n const op = db\n .prepare(\n `SELECT o.operation_name operationName,o.operation_path operationPath,s.repo_id repoId\n FROM cds_operations o JOIN cds_services s ON s.id=o.service_id WHERE o.id=?`,\n )\n .get(operationId) as\n | { operationName?: string; operationPath?: string; repoId?: number }\n | undefined;\n if (!op) return new Set();\n const operation = normalizeOperation(op.operationPath ?? op.operationName);\n const rows = db\n .prepare(\n `SELECT DISTINCT hc.source_file sourceFile,sym.id symbolId FROM handler_classes hc\n JOIN handler_methods hm ON hm.handler_class_id=hc.id\n LEFT JOIN symbols sym ON sym.repo_id=hc.repo_id AND sym.source_file=hc.source_file AND sym.name=hm.method_name\n WHERE hc.repo_id=? AND (hm.decorator_value=? OR hm.method_name=? OR hm.decorator_value=?)`,\n )\n .all(op.repoId, operation, operation, op.operationName) as Array<{\n sourceFile?: string;\n }>;\n return new Set(rows.map((row) => row.sourceFile).filter(Boolean) as string[]);\n}\n\nfunction implementationEdge(db: Db, operationId: string): GraphRow | undefined {\n return db.prepare(\"SELECT * FROM graph_edges WHERE edge_type='OPERATION_IMPLEMENTED_BY_HANDLER' AND from_kind='operation' AND from_id=? ORDER BY CASE status WHEN 'resolved' THEN 0 WHEN 'ambiguous' THEN 1 ELSE 2 END,id LIMIT 1\").get(operationId) as GraphRow | undefined;\n}\nfunction handlerMethodNode(db: Db, methodId: string): Record<string, unknown> | undefined {\n const row = db.prepare(`SELECT hm.id methodId,hm.method_name methodName,hm.decorator_value decoratorValue,hm.source_line sourceLine,hc.class_name className,hc.source_file sourceFile,r.name repoName,r.id repoId FROM handler_methods hm JOIN handler_classes hc ON hc.id=hm.handler_class_id JOIN repositories r ON r.id=hc.repo_id WHERE hm.id=?`).get(methodId) as Record<string, unknown> | undefined;\n if (!row) return undefined;\n return { id: `handler_method:${methodId}`, kind: 'handler_method', label: `${String(row.repoName)}:${String(row.className)}.${String(row.methodName)}`, ...row };\n}\nfunction implementationScope(db: Db, operationId: string): { repoId?: number; files: Set<string>; symbolId?: number; edge?: GraphRow } {\n const edge = implementationEdge(db, operationId);\n if (!edge || edge.status !== 'resolved') return { files: new Set(), edge };\n const row = db.prepare('SELECT hc.repo_id repoId,hc.source_file sourceFile,s.id symbolId FROM handler_methods hm JOIN handler_classes hc ON hc.id=hm.handler_class_id LEFT JOIN symbols s ON s.repo_id=hc.repo_id AND s.source_file=hc.source_file AND s.name=hm.method_name WHERE hm.id=?').get(edge.to_id) as { repoId?: number; sourceFile?: string; symbolId?: number } | undefined;\n return { repoId: row?.repoId, files: new Set(row?.sourceFile ? [row.sourceFile] : []), symbolId: row?.symbolId, edge };\n}\nfunction contextImplementationMethodId(edge: GraphRow | undefined, callerRepoId: number | undefined, remoteEvidence: Record<string, unknown> = {}): { methodId?: string; evidence: Record<string, unknown> } {\n if (!edge || edge.status !== 'ambiguous' || callerRepoId === undefined) return { evidence: { status: 'not_applicable' } };\n const evidence = JSON.parse(String(edge.evidence_json || '{}')) as { candidates?: Array<{ accepted?: boolean; methodId?: number; handlerPackage?: { id?: number; name?: string }; applicationPackage?: { id?: number; name?: string }; reasons?: string[]; score?: number }> };\n const scores = (evidence.candidates ?? []).filter((item) => item.accepted).map((item) => {\n const reasons: string[] = [];\n let score = Number(item.score ?? 0);\n if (Number(item.handlerPackage?.id) === callerRepoId) { score += 10; reasons.push('handler_package_matches_caller_repository'); }\n if (Number(item.applicationPackage?.id) === callerRepoId) { score += 10; reasons.push('registration_package_matches_caller_repository'); }\n if (typeof remoteEvidence.effectiveServicePath === 'string' || typeof remoteEvidence.effectiveDestination === 'string' || typeof remoteEvidence.effectiveAlias === 'string') { score += 1; reasons.push('remote_call_context_available'); }\n return { methodId: item.methodId, score, reasons, handlerPackage: item.handlerPackage, applicationPackage: item.applicationPackage };\n }).sort((a, b) => b.score - a.score);\n if (scores.length === 0) return { evidence: { status: 'not_applicable', candidateScores: [] } };\n const [first, second] = scores;\n if (first && first.methodId !== undefined && first.score > 0 && (!second || first.score > second.score)) return { methodId: String(first.methodId), evidence: { status: 'selected', selectedMethodId: first.methodId, candidateScores: scores } };\n return { evidence: { status: 'tied', tieReason: scores.length > 1 ? 'duplicate_helper_implementation_candidates' : 'no_unique_materially_stronger_candidate', candidateScores: scores } };\n}\nfunction handlerScope(db: Db, methodId: string): { repoId?: number; files: Set<string>; symbolId?: number } | undefined {\n const row = db.prepare('SELECT hc.repo_id repoId,hc.source_file sourceFile,s.id symbolId FROM handler_methods hm JOIN handler_classes hc ON hc.id=hm.handler_class_id LEFT JOIN symbols s ON s.repo_id=hc.repo_id AND s.source_file=hc.source_file AND s.name=hm.method_name WHERE hm.id=?').get(methodId) as { repoId?: number; sourceFile?: string; symbolId?: number } | undefined;\n if (!row) return undefined;\n return { repoId: row.repoId, files: new Set(row.sourceFile ? [row.sourceFile] : []), symbolId: row.symbolId };\n}\n\nfunction includeCall(\n type: string,\n options: {\n includeExternal?: boolean;\n includeDb?: boolean;\n includeAsync?: boolean;\n },\n): boolean {\n if (!options.includeDb && type === 'local_db_query') return false;\n if (!options.includeExternal && type === 'external_http') return false;\n if (!options.includeAsync && type.startsWith('async_')) return false;\n return true;\n}\nfunction graphForCalls(db: Db, callIds: number[]): Map<number, GraphRow[]> {\n const map = new Map<number, GraphRow[]>();\n if (callIds.length === 0) return map;\n const rows = db\n .prepare(\n `SELECT * FROM graph_edges WHERE from_kind='call' AND from_id IN (${callIds.map(() => '?').join(',')}) ORDER BY id`,\n )\n .all(...callIds.map((id) => String(id))) as GraphRow[];\n for (const row of rows) {\n const id = Number(row.from_id);\n map.set(id, [...(map.get(id) ?? []), row]);\n }\n return map;\n}\nfunction hasRuntimeVariable(value: unknown, vars: Record<string, string>): boolean {\n return typeof value === 'string' && extractPlaceholders(value).some((key) => Object.hasOwn(vars, key));\n}\n\nfunction isRemoteRuntimeCandidate(row: GraphRow, evidence: Record<string, unknown>, vars: Record<string, string> | undefined): boolean {\n if (!vars || Object.keys(vars).length === 0) return false;\n if (!['dynamic', 'ambiguous', 'unresolved'].includes(String(row.status ?? ''))) return false;\n if (!['DYNAMIC_EDGE_CANDIDATE', 'UNRESOLVED_EDGE', 'REMOTE_CALL_RESOLVES_TO_OPERATION'].includes(row.edge_type)) return false;\n if (row.status === 'resolved') return false;\n return ['servicePath', 'operationPath', 'serviceAliasExpr', 'serviceAlias', 'destination'].some((key) => hasRuntimeVariable(evidence[key], vars));\n}\n\nfunction evidenceWithRuntimeVariables(\n evidence: Record<string, unknown>,\n vars: Record<string, string> | undefined,\n): Record<string, unknown> {\n if (!vars || Object.keys(vars).length === 0) return evidence;\n const substitutions: Record<string, RuntimeSubstitution> = {};\n for (const key of ['servicePath', 'operationPath', 'serviceAliasExpr', 'serviceAlias', 'destination']) {\n const substitution = substituteVariables(typeof evidence[key] === 'string' ? String(evidence[key]) : undefined, vars);\n if (substitution.placeholders.length > 0) substitutions[key] = substitution;\n }\n const next: Record<string, unknown> = { ...evidence, runtimeVariablesApplied: true, runtimeSubstitutions: substitutions };\n for (const [key, value] of Object.entries(substitutions)) {\n if (value.effective) next[key] = value.effective;\n }\n const missing = Object.values(substitutions).flatMap((value) => value.missing);\n if (missing.length > 0) next.missingRuntimeVariables = [...new Set(missing)];\n return next;\n}\n\n\nfunction symbolNode(db: Db, symbolId: number): Record<string, unknown> | undefined {\n const row = db.prepare(`SELECT s.id symbolId,s.name symbolName,s.qualified_name qualifiedName,s.source_file sourceFile,s.start_line startLine,s.end_line endLine,r.name repoName,r.id repoId FROM symbols s JOIN repositories r ON r.id=s.repo_id WHERE s.id=?`).get(symbolId) as Record<string, unknown> | undefined;\n if (!row) return undefined;\n const fileName = String(row.sourceFile ?? '').split('/').at(-1) ?? String(row.sourceFile ?? '');\n return { id: `symbol:${symbolId}`, kind: 'symbol', label: `${fileName}:${String(row.qualifiedName ?? row.symbolName)}`, ...row };\n}\n\nfunction operationNode(db: Db, operationId: string): Record<string, unknown> | undefined {\n const row = db.prepare(`SELECT o.id operationId,o.operation_name operationName,o.operation_type operationType,o.operation_path operationPath,o.source_file sourceFile,o.source_line sourceLine,s.id serviceId,s.service_name serviceName,s.qualified_name qualifiedName,s.service_path servicePath,r.id repoId,r.name repoName FROM cds_operations o JOIN cds_services s ON s.id=o.service_id JOIN repositories r ON r.id=s.repo_id WHERE o.id=?`).get(operationId) as Record<string, unknown> | undefined;\n if (!row) return undefined;\n return { id: `operation:${operationId}`, kind: 'operation', label: `${String(row.repoName)}:${String(row.servicePath)}${String(row.operationPath)}`, ...row };\n}\nfunction workspaceIdForCall(db: Db, callId: string): number | undefined {\n return (db.prepare('SELECT r.workspace_id workspaceId FROM outbound_calls c JOIN repositories r ON r.id=c.repo_id WHERE c.id=?').get(callId) as { workspaceId?: number } | undefined)?.workspaceId;\n}\nfunction runtimeResolution(db: Db, row: GraphRow, evidence: Record<string, unknown>, vars: Record<string, string> | undefined): { row: GraphRow; evidence: Record<string, unknown>; target?: OperationTarget; unresolvedReason?: string } {\n if (!isRemoteRuntimeCandidate(row, evidence, vars))\n return { row, evidence, unresolvedReason: row.unresolved_reason };\n const nextEvidence = evidenceWithRuntimeVariables(evidence, vars);\n const servicePath = typeof nextEvidence.servicePath === 'string' ? nextEvidence.servicePath : undefined;\n const operationPath = typeof nextEvidence.normalizedOperationPath === 'string' ? nextEvidence.normalizedOperationPath : typeof nextEvidence.operationPath === 'string' ? nextEvidence.operationPath : undefined;\n const alias = typeof nextEvidence.serviceAliasExpr === 'string' ? nextEvidence.serviceAliasExpr : typeof nextEvidence.serviceAlias === 'string' ? nextEvidence.serviceAlias : undefined;\n const destination = typeof nextEvidence.destination === 'string' ? nextEvidence.destination : undefined;\n const resolution = resolveOperation(db, { servicePath, operationPath, alias, destination, hasExplicitOverride: true, isDynamic: true }, workspaceIdForCall(db, row.from_id));\n nextEvidence.runtimeResolutionStatus = resolution.status;\n nextEvidence.runtimeResolutionReasons = resolution.reasons;\n if (resolution.target) {\n nextEvidence.runtimeResolvedCandidate = resolution.target;\n return { row: { ...row, to_kind: 'operation', to_id: String(resolution.target.operationId), unresolved_reason: undefined, confidence: Math.max(0, Math.min(1, resolution.target.score)) }, evidence: nextEvidence, target: resolution.target };\n }\n const unresolvedReason = resolution.status === 'dynamic' ? `Dynamic target is missing runtime variables: ${resolution.reasons.join(', ')}` : resolution.status === 'ambiguous' ? 'Ambiguous runtime operation candidates' : 'No runtime operation candidate matched substituted service and operation path';\n return { row, evidence: nextEvidence, unresolvedReason };\n}\nfunction parseEvidence(value: unknown): Record<string, unknown> {\n try {\n const parsed = JSON.parse(String(value || '{}')) as unknown;\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed as Record<string, unknown> : {};\n } catch {\n return {};\n }\n}\nfunction receiverFromEvidence(value: unknown): string | undefined {\n const evidence = parseEvidence(value);\n return typeof evidence.receiver === 'string' ? evidence.receiver : undefined;\n}\nfunction hasDynamicPlaceholder(value: string | undefined): boolean {\n return extractPlaceholders(value).length > 0;\n}\nfunction enrichBinding(row: ContextBinding): ContextBinding {\n const effectiveServicePath = row.servicePathExpr && !hasDynamicPlaceholder(row.servicePathExpr) ? row.servicePathExpr : !row.servicePathExpr ? row.requireServicePath : undefined;\n const effectiveDestination = row.destinationExpr && !hasDynamicPlaceholder(row.destinationExpr) ? row.destinationExpr : !row.destinationExpr ? row.requireDestination : undefined;\n return { ...row, effectiveServicePath, effectiveDestination };\n}\nfunction knownBindingsForCalls(db: Db, calls: CallRow[]): Map<string, ContextBinding> {\n const map = new Map<string, ContextBinding>();\n for (const call of calls) {\n const receiver = receiverFromEvidence(call.evidence_json);\n const bindingId = Number(call.service_binding_id ?? 0);\n if (!receiver || !bindingId) continue;\n const row = db.prepare(`SELECT b.id,b.alias,b.alias_expr aliasExpr,b.destination_expr destinationExpr,b.service_path_expr servicePathExpr,b.source_file sourceFile,b.source_line sourceLine,req.service_path requireServicePath,req.destination requireDestination\n FROM service_bindings b LEFT JOIN cds_requires req ON req.repo_id=b.repo_id AND req.alias=b.alias\n WHERE b.id=?`).get(bindingId) as ContextBinding | undefined;\n if (row) map.set(receiver, enrichBinding({ ...row, bindingId, source: 'local_service_binding', calleeReceiver: receiver }));\n }\n return map;\n}\nfunction knownBindingsForScope(db: Db, repoId: number | undefined, symbolIds: Set<number> | undefined, files: Set<string> | undefined): Map<string, ContextBinding> {\n const map = new Map<string, ContextBinding>();\n if (repoId === undefined) return map;\n type BindingRow = Omit<ContextBinding, 'bindingId' | 'source' | 'calleeReceiver'> & { id?: number; variableName?: string };\n const rows = db.prepare(`SELECT b.id,b.variable_name variableName,b.alias,b.alias_expr aliasExpr,b.destination_expr destinationExpr,b.service_path_expr servicePathExpr,b.source_file sourceFile,b.source_line sourceLine,req.service_path requireServicePath,req.destination requireDestination\n FROM service_bindings b LEFT JOIN cds_requires req ON req.repo_id=b.repo_id AND req.alias=b.alias\n WHERE b.repo_id=?`).all(repoId) as BindingRow[];\n for (const row of rows) {\n if (!row.variableName) continue;\n if (files && !files.has(String(row.sourceFile))) continue;\n if (symbolIds && symbolIds.size > 0) {\n const owner = db.prepare('SELECT id FROM symbols WHERE id IN (' + [...symbolIds].map(() => '?').join(',') + ') AND source_file=? AND start_line<=? AND end_line>=? LIMIT 1').get(...symbolIds, row.sourceFile, row.sourceLine, row.sourceLine) as { id?: number } | undefined;\n if (!owner) continue;\n }\n map.set(row.variableName, enrichBinding({ ...row, bindingId: Number(row.id), source: 'local_service_binding', calleeReceiver: row.variableName }));\n }\n return map;\n}\nfunction contextForSymbolCall(db: Db, symbolCall: Record<string, unknown>, callerBindings: Map<string, ContextBinding>): Map<string, ContextBinding> {\n const next = new Map<string, ContextBinding>();\n if (callerBindings.size === 0) return next;\n const callEvidence = parseEvidence(symbolCall.evidence_json);\n const callee = db.prepare('SELECT evidence_json evidenceJson FROM symbols WHERE id=?').get(symbolCall.callee_symbol_id) as { evidenceJson?: string } | undefined;\n const calleeEvidence = parseEvidence(callee?.evidenceJson);\n const params = Array.isArray(calleeEvidence.parameters) ? calleeEvidence.parameters.filter((item): item is string => typeof item === 'string') : [];\n const parameterBindings = Array.isArray(calleeEvidence.parameterBindings) ? calleeEvidence.parameterBindings.filter((item): item is Record<string, unknown> => Boolean(item && typeof item === 'object' && !Array.isArray(item))) : [];\n const parameterPropertyAliases = Array.isArray(calleeEvidence.parameterPropertyAliases) ? calleeEvidence.parameterPropertyAliases.filter((item): item is Record<string, unknown> => Boolean(item && typeof item === 'object' && !Array.isArray(item))) : [];\n const args = Array.isArray(callEvidence.callArguments) ? callEvidence.callArguments as Array<Record<string, unknown>> : [];\n args.forEach((arg, index) => {\n const paramBinding = parameterBindings.find((binding) => binding.index === index);\n const param = paramBinding?.kind === 'identifier' && typeof paramBinding.name === 'string' ? paramBinding.name : params[index];\n if (arg.kind === 'identifier' && typeof arg.name === 'string') {\n const binding = callerBindings.get(arg.name);\n if (binding && param) next.set(param, { ...binding, source: 'local_symbol_argument', callerArgument: arg.name, calleeParameter: param, calleeReceiver: param });\n }\n if (arg.kind === 'object_literal' && Array.isArray(arg.properties)) {\n for (const prop of arg.properties as Array<Record<string, unknown>>) {\n if (typeof prop.property !== 'string' || typeof prop.argument !== 'string') continue;\n const binding = callerBindings.get(prop.argument);\n if (!binding) continue;\n const destructured = paramBinding?.kind === 'object_pattern' && Array.isArray(paramBinding.properties)\n ? (paramBinding.properties as Array<Record<string, unknown>>).find((item) => item.property === prop.property && typeof item.local === 'string')\n : undefined;\n if (destructured && typeof destructured.local === 'string') next.set(destructured.local, { ...binding, source: 'local_symbol_destructured_object_argument', callerProperty: prop.property, callerArgument: prop.argument, calleeParameter: String(index), calleeReceiver: destructured.local });\n else if (param) {\n next.set(`${param}.${prop.property}`, { ...binding, source: 'local_symbol_object_argument', callerProperty: prop.property, callerArgument: prop.argument, calleeParameter: param, calleeReceiver: `${param}.${prop.property}` });\n for (const alias of parameterPropertyAliases) {\n if (alias.parameter === param && alias.property === prop.property && typeof alias.local === 'string') next.set(alias.local, { ...binding, source: 'local_symbol_object_parameter_destructure', callerProperty: prop.property, callerArgument: prop.argument, calleeParameter: param, calleeObjectProperty: `${param}.${prop.property}`, calleeReceiver: alias.local, calleeLocalDestructuredIdentifier: alias.local, parameterPropertyAliasKind: alias.kind, parameterPropertyAliasLine: alias.line });\n }\n }\n }\n }\n });\n return next;\n}\nfunction contextualRuntimeResolution(db: Db, call: CallRow, binding: ContextBinding | undefined, workspaceId: number | undefined): { row?: GraphRow; evidence?: Record<string, unknown>; unresolvedReason?: string } {\n if (!binding || String(call.call_type) !== 'remote_action' || call.operation_path_expr === undefined || call.operation_path_expr === null) return {};\n const normalized = normalizeODataOperationInvocationPath(String(call.operation_path_expr));\n const op = normalized?.normalizedOperationPath ?? (String(call.operation_path_expr).startsWith('/') ? String(call.operation_path_expr) : `/${String(call.operation_path_expr)}`);\n const servicePath = binding.effectiveServicePath ?? binding.servicePathExpr ?? binding.requireServicePath;\n const destination = binding.effectiveDestination ?? binding.destinationExpr ?? binding.requireDestination;\n const resolution = resolveOperation(db, { servicePath, operationPath: op, alias: binding.aliasExpr ?? binding.alias, destination, hasExplicitOverride: true, isDynamic: false }, workspaceId);\n const evidence: Record<string, unknown> = { contextualServiceBindingAttempted: true, contextualBinding: { source: binding.source, callerArgument: binding.callerArgument, callerProperty: binding.callerProperty, calleeParameter: binding.calleeParameter, calleeReceiver: binding.calleeReceiver, bindingSourceFile: binding.sourceFile, bindingSourceLine: binding.sourceLine, alias: binding.alias, aliasExpr: binding.aliasExpr, requireServicePath: binding.requireServicePath, requireDestination: binding.requireDestination, effectiveServicePath: binding.effectiveServicePath, effectiveDestination: binding.effectiveDestination }, operationPath: op, rawOperationPath: normalized?.rawOperationPath, normalizedOperationPath: normalized?.wasInvocation ? normalized.normalizedOperationPath : undefined, invocationArgumentPlaceholderKeys: normalized?.invocationArgumentPlaceholderKeys.length ? normalized.invocationArgumentPlaceholderKeys : undefined, servicePath, serviceAlias: binding.alias, serviceAliasExpr: binding.aliasExpr, destination, requireServicePath: binding.requireServicePath, requireDestination: binding.requireDestination, effectiveServicePath: binding.effectiveServicePath, effectiveDestination: binding.effectiveDestination, contextualResolutionStatus: resolution.status, contextualCandidateCount: resolution.candidates.length, candidates: resolution.candidates, contextualResolutionReasons: resolution.reasons, resolutionReasons: resolution.reasons };\n if (!resolution.target) return { evidence, unresolvedReason: resolution.status === 'ambiguous' ? 'Ambiguous contextual operation candidates' : resolution.status === 'dynamic' ? `Dynamic contextual target is missing runtime variables: ${resolution.reasons.join(', ')}` : 'No contextual operation candidate matched' };\n const resolvedEvidence = { ...evidence, contextualServiceBindingSelected: true, targetRepo: resolution.target.repoName, targetServicePath: resolution.target.servicePath, targetOperationPath: resolution.target.operationPath, targetOperation: resolution.target.operationName };\n return { row: { id: -Number(call.id), edge_type: 'REMOTE_CALL_RESOLVES_TO_OPERATION', from_id: String(call.id), to_kind: 'operation', to_id: String(resolution.target.operationId), confidence: resolution.target.score, evidence_json: JSON.stringify(resolvedEvidence), status: 'resolved' }, evidence: resolvedEvidence, unresolvedReason: undefined };\n}\nfunction edgeTarget(row: GraphRow, evidence: Record<string, unknown>): string {\n const runtimeCandidate = evidence.runtimeResolvedCandidate as\n | Candidate\n | undefined;\n if (runtimeCandidate?.servicePath && runtimeCandidate.operationPath)\n return `${runtimeCandidate.servicePath}${runtimeCandidate.operationPath}`;\n const targetServicePath = typeof evidence.targetServicePath === 'string' ? evidence.targetServicePath : undefined;\n const targetOperationPath = typeof evidence.targetOperationPath === 'string' ? evidence.targetOperationPath : undefined;\n if (targetServicePath && targetOperationPath) return `${targetServicePath}${targetOperationPath}`;\n const servicePath =\n typeof evidence.servicePath === 'string' ? evidence.servicePath : undefined;\n const operationPath =\n typeof evidence.operationPath === 'string'\n ? evidence.operationPath\n : undefined;\n const targetOperation =\n typeof evidence.targetOperation === 'string'\n ? evidence.targetOperation\n : undefined;\n const targetRepo =\n typeof evidence.targetRepo === 'string' ? evidence.targetRepo : '';\n if (row.edge_type === 'HANDLER_RUNS_DB_QUERY') return `Entity: ${row.to_id || 'unknown'}`;\n if (row.edge_type === 'HANDLER_RUNS_REMOTE_QUERY') return typeof evidence.remoteQueryTarget === 'string' ? evidence.remoteQueryTarget : `Remote query: ${row.to_id || 'unknown'}`;\n if (row.edge_type === 'HANDLER_CALLS_EXTERNAL_HTTP') {\n const target = evidence.externalTarget as Record<string, unknown> | undefined;\n return typeof target?.label === 'string' ? target.label : `External endpoint: ${row.to_id || 'unknown'}`;\n }\n return servicePath && operationPath\n ? `${servicePath}${operationPath}`\n : targetOperation\n ? `${targetRepo}:${targetOperation}`\n : row.to_id;\n}\nexport function trace(\n db: Db,\n start: TraceStart,\n options: {\n depth: number;\n vars?: Record<string, string>;\n includeExternal?: boolean;\n includeDb?: boolean;\n includeAsync?: boolean;\n },\n): TraceResult {\n const scope = startScope(db, start);\n const diagnostics = db\n .prepare(\n 'SELECT severity,code,message,source_file sourceFile,source_line sourceLine FROM diagnostics WHERE (? IS NULL OR repo_id=?)',\n )\n .all(scope.repo?.id, scope.repo?.id) as Array<Record<string, unknown>>;\n const stale = db.prepare('SELECT name,graph_stale_reason reason FROM repositories WHERE graph_stale_reason IS NOT NULL AND (? IS NULL OR id=?)').all(scope.repo?.id, scope.repo?.id) as Array<{ name?: string; reason?: string }>;\n for (const row of stale)\n diagnostics.unshift({ severity: 'warning', code: 'graph_stale', message: `Graph is stale for ${row.name ?? 'repository'}: ${row.reason ?? 'facts_changed'}. Run service-flow link.` });\n for (const diagnostic of scope.startDiagnostics ?? []) diagnostics.unshift(diagnostic);\n if (!scope.selectorMatched && !(scope.startDiagnostics?.length))\n diagnostics.unshift({\n severity: 'warning',\n code: 'trace_start_not_found',\n message: start.servicePath && !start.operation && !start.operationPath && !start.handler ? 'Service-only trace requires --operation or --path and will not broaden to the whole workspace' : 'No handler source matched the requested trace start selector',\n });\n const maxDepth = positiveDepth(options.depth);\n const edges: TraceEdge[] = [];\n const nodes = new Map<string, Record<string, unknown>>();\n const seenEdges = new Set<number>();\n const queue: Array<{ repoId?: number; files?: Set<string>; symbolIds?: Set<number>; depth: number; context?: Map<string, ContextBinding> }> =\n scope.selectorMatched\n ? [{ repoId: scope.repo?.id, files: scope.sourceFiles, symbolIds: scope.symbolIds, depth: 1, context: new Map() }]\n : [];\n if (scope.startOperationId) {\n const op = operationNode(db, scope.startOperationId);\n const impl = implementationScope(db, scope.startOperationId);\n if (op) nodes.set(String(op.id), op);\n if (impl.edge && impl.edge.status === 'resolved') {\n const implEvidence = { ...parseEvidence(impl.edge.evidence_json), startResolution: { strategy: 'indexed_operation_graph', matchedOperationId: scope.startOperationId, implementationEdgeId: impl.edge.id, implementationStatus: impl.edge.status, selectedHandlerMethodId: impl.edge.status === 'resolved' ? impl.edge.to_id : undefined } };\n const handlerNode = impl.edge.status === 'resolved' ? handlerMethodNode(db, impl.edge.to_id) : undefined;\n if (handlerNode) nodes.set(String(handlerNode.id), handlerNode);\n seenEdges.add(Number(impl.edge.id));\n edges.push({ step: 1, type: 'operation_implemented_by_handler', from: op?.label ? String(op.label) : `operation:${scope.startOperationId}`, to: handlerNode?.label ? String(handlerNode.label) : `${impl.edge.to_kind}:${impl.edge.to_id}`, evidence: implEvidence, confidence: Number(impl.edge.confidence ?? 0), unresolvedReason: impl.edge.status === 'resolved' ? undefined : String(impl.edge.unresolved_reason ?? impl.edge.status) });\n }\n }\n const seenScopes = new Set<string>();\n while (queue.length > 0) {\n const current = queue.shift();\n if (!current || current.depth > maxDepth) continue;\n const contextKey = [...(current.context ?? new Map<string, ContextBinding>()).keys()].sort().join(',');\n const key = `${current.repoId ?? '*'}:${[...(current.symbolIds ?? new Set(['*']))].sort().join(',')}:${[...(current.files ?? new Set(['*']))].sort().join(',')}:${contextKey}`;\n if (seenScopes.has(key)) continue;\n seenScopes.add(key);\n const calls = db\n .prepare(\n `SELECT c.*,r.name repoName FROM outbound_calls c JOIN repositories r ON r.id=c.repo_id WHERE (? IS NULL OR c.repo_id=?) ORDER BY c.source_file,c.source_line`,\n )\n .all(current.repoId, current.repoId) as CallRow[];\n const filtered = calls.filter(\n (c) =>\n (!current.symbolIds || current.symbolIds.has(Number(c.source_symbol_id))) && (!current.files || current.files.has(String(c.source_file))) &&\n includeCall(String(c.call_type), options),\n );\n const callerBindings = new Map<string, ContextBinding>([...(current.context ?? new Map<string, ContextBinding>()), ...knownBindingsForScope(db, current.repoId, current.symbolIds, current.files), ...knownBindingsForCalls(db, filtered)]);\n\n if (current.symbolIds && current.symbolIds.size > 0 && current.depth < maxDepth) {\n const symbolRows = db.prepare(`SELECT sc.*,s.repo_id calleeRepoId,s.source_file calleeFile FROM symbol_calls sc LEFT JOIN symbols s ON s.id=sc.callee_symbol_id WHERE sc.caller_symbol_id IN (${[...current.symbolIds].map(() => '?').join(',')}) ORDER BY sc.source_file,sc.source_line`).all(...current.symbolIds) as Array<Record<string, unknown>>;\n for (const symbolCall of symbolRows) {\n if (!symbolCall.callee_symbol_id) continue;\n const nextSymbols = new Set([Number(symbolCall.callee_symbol_id)]);\n const nextFiles = new Set([String(symbolCall.calleeFile)]);\n const nextRepoId = Number(symbolCall.calleeRepoId);\n const nextKey = `${nextRepoId}:${[...nextSymbols].join(',')}:${[...nextFiles].join(',')}`;\n const calleeNode = symbolNode(db, Number(symbolCall.callee_symbol_id));\n if (calleeNode) nodes.set(String(calleeNode.id), calleeNode);\n const evidence = { ...(JSON.parse(String(symbolCall.evidence_json || '{}')) as Record<string, unknown>), sourceFile: symbolCall.source_file, sourceLine: symbolCall.source_line, calleeSymbolId: symbolCall.callee_symbol_id, calleeSymbolName: calleeNode?.symbolName, calleeSymbolFile: calleeNode?.sourceFile, resolutionStatus: symbolCall.status };\n edges.push({ step: current.depth, type: 'local_symbol_call', from: String(symbolCall.callee_expression), to: calleeNode?.label ? String(calleeNode.label) : `symbol:${String(symbolCall.callee_symbol_id)}`, evidence, confidence: Number(symbolCall.confidence ?? 0.8), unresolvedReason: String(symbolCall.status) === 'resolved' ? undefined : symbolCall.unresolved_reason ? String(symbolCall.unresolved_reason) : undefined });\n if (seenScopes.has(nextKey)) edges.push({ step: current.depth, type: 'cycle', from: String(symbolCall.callee_expression), to: nextKey, evidence: { cycle: true, symbolCallId: symbolCall.id }, confidence: 1, unresolvedReason: 'Cycle detected; downstream symbol already visited' });\n else queue.push({ repoId: nextRepoId, files: nextFiles, symbolIds: nextSymbols, depth: current.depth + 1, context: contextForSymbolCall(db, symbolCall, callerBindings) });\n }\n }\n const graph = graphForCalls(\n db,\n filtered.map((c) => Number(c.id)),\n );\n for (const call of filtered) {\n const callNode = `call:${call.id}`;\n nodes.set(callNode, {\n id: callNode,\n kind: 'outbound_call',\n repo: call.repoName,\n file: call.source_file,\n line: call.source_line,\n callType: call.call_type,\n });\n const contextual = contextualRuntimeResolution(db, call, callerBindings.get(receiverFromEvidence(call.evidence_json) ?? ''), workspaceIdForCall(db, String(call.id)));\n const graphRows = contextual.row ? [contextual.row] : (graph.get(Number(call.id)) ?? []);\n for (const row of graphRows) {\n if (seenEdges.has(Number(row.id))) continue;\n seenEdges.add(Number(row.id));\n const persistedEvidence = JSON.parse(\n String(row.evidence_json || '{}'),\n ) as Record<string, unknown>;\n const rawEvidence = contextual.evidence ? { ...persistedEvidence, ...contextual.evidence } : persistedEvidence;\n const effective = runtimeResolution(db, row, rawEvidence, options.vars);\n const evidence = effective.evidence;\n const effectiveRow = effective.row;\n const targetNode = `${effectiveRow.to_kind}:${effectiveRow.to_id}`;\n const opNode = effectiveRow.to_kind === 'operation' ? operationNode(db, effectiveRow.to_id) : undefined;\n nodes.set(targetNode, opNode ?? {\n id: targetNode,\n kind: effectiveRow.to_kind,\n label: effectiveRow.to_kind === 'db_entity' ? `Entity: ${effectiveRow.to_id || 'unknown'}` : effectiveRow.to_id,\n });\n const to = edgeTarget(effectiveRow, evidence);\n edges.push({\n step: current.depth,\n type: String(call.call_type),\n from: `${call.repoName}:${call.source_file}:${call.source_line}`,\n to,\n evidence,\n confidence: Number(effectiveRow.confidence ?? call.confidence),\n unresolvedReason: effective.unresolvedReason,\n });\n if (effectiveRow.to_kind === 'operation') {\n const implementation = implementationScope(db, effectiveRow.to_id);\n const contextSelection = contextImplementationMethodId(implementation.edge, current.repoId, evidence);\n const contextMethodId = contextSelection.methodId;\n const contextNode = contextMethodId ? handlerMethodNode(db, contextMethodId) : undefined;\n if (implementation.edge) {\n const implEvidence = JSON.parse(String(implementation.edge.evidence_json || '{}')) as Record<string, unknown>;\n const handlerNode = implementation.edge.status === 'resolved' ? handlerMethodNode(db, implementation.edge.to_id) : contextNode;\n const implTo = handlerNode?.label ? String(handlerNode.label) : `${implementation.edge.to_kind}:${implementation.edge.to_id}`;\n if (handlerNode) nodes.set(String(handlerNode.id), handlerNode);\n edges.push({\n step: current.depth,\n type: 'operation_implemented_by_handler',\n from: to,\n to: implTo,\n evidence: contextMethodId ? { ...implEvidence, contextualImplementationSelected: true, contextualImplementation: contextSelection.evidence } : { ...implEvidence, contextualImplementation: contextSelection.evidence },\n confidence: Number(implementation.edge.confidence ?? 0),\n unresolvedReason: implementation.edge.status === 'resolved' || contextMethodId ? undefined : String(implementation.edge.unresolved_reason ?? implementation.edge.status),\n });\n }\n if (current.depth >= maxDepth) continue;\n const contextScope = contextMethodId ? handlerScope(db, contextMethodId) : undefined;\n const files = contextScope?.files ?? (implementation.files.size > 0 ? implementation.files : handlerFilesForOperation(db, effectiveRow.to_id));\n const symbolIds = contextScope?.symbolId ? new Set([contextScope.symbolId]) : implementation.symbolId ? new Set([implementation.symbolId]) : undefined;\n if ((implementation.edge?.status === 'resolved' || contextScope) && files.size > 0) {\n const targetRepoId = contextScope?.repoId ?? implementation.repoId ?? (db\n .prepare(\n 'SELECT s.repo_id repoId FROM cds_operations o JOIN cds_services s ON s.id=o.service_id WHERE o.id=?',\n )\n .get(effectiveRow.to_id)?.repoId as number | undefined);\n const nextKey = `${targetRepoId ?? '*'}:${[...(symbolIds ?? new Set(['*']))].sort().join(',')}:${[...files].sort().join(',')}`;\n if (seenScopes.has(nextKey))\n edges.push({\n step: current.depth,\n type: 'cycle',\n from: to,\n to: nextKey,\n evidence: { ...evidence, cycle: true },\n confidence: 1,\n unresolvedReason:\n 'Cycle detected; downstream scope already visited',\n });\n else\n queue.push({\n repoId: targetRepoId,\n files,\n symbolIds,\n depth: current.depth + 1,\n });\n }\n }\n }\n }\n }\n return { start, nodes: [...nodes.values()], edges, diagnostics };\n}\n"],"mappings":";;;AAAA,OAAO,QAAQ;AACf,OAAOA,WAAU;;;ACDjB,OAAO,UAAU;AACV,SAAS,cAAc,OAAuB;AACnD,SAAO,MAAM,MAAM,KAAK,GAAG,EAAE,KAAK,GAAG;AACvC;AACO,SAAS,aAAa,MAAc,OAAuB;AAChE,SAAO,cAAc,KAAK,SAAS,MAAM,KAAK,KAAK,GAAG;AACxD;AACO,SAAS,mBAAmB,OAAuB;AACxD,SAAO,MAAM,WAAW,GAAG,IAAI,QAAQ,IAAI,KAAK;AAClD;AACO,SAAS,YAAY,OAAuB;AACjD,SAAO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AAA,gBACJ,UAAU,EAAE,GAAG,UAAU,OAAO,KAAK;AAAA,gBACrC,YAAY;AAAA,gBACZ,kBACE;AAAA,cACJ,CAAC;AAAA;AAED,oBAAM,KAAK;AAAA,gBACT,QAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBACA,OAAO,QAAQ,QAAQ;AAAA,cACzB,CAAC;AAAA,UACL;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO,EAAE,OAAO,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,OAAO,YAAY;AACjE;","names":["path","path","fs","path","fs","path","path","fs","fs","path","ts","ts","fs","path","fs","path","ts","lineOf","ts","path","fs","path","fs","path","ts","path","lineOf","ts","fs","path","fs","path","ts","lineOf","ts","fs","path","rows","resolved","visit","placeholders","rows","rows","callEvidence"]}
|