/** * Projection: protobuf services and types → the existing graph primitives * (change: add-contract-graph-projection, protobuf phase). * * The protobuf half of `projectContracts`, kept apart because nothing in it is HTTP: an RPC has no * method or path to match, and its server is wired up by a registration call instead of a route. * * RPC node `/pkg.Service/Method` — the gRPC method path, unique per RPC * message / enum node `pkg.Order` — the full name, package included * `references_schema` RPC → its request and response types; message → its fields' types * `implements_endpoint` the method a registered implementation defines → the RPC it serves * * Every rule refuses rather than guesses, as the OpenAPI half does: a service name two packages * declare binds nothing, a registered type with two same-named methods binds nothing, and a type * name protobuf's own scoping does not resolve draws no edge. All of it is disclosed. */ import type { CallEdge, FunctionNode } from '../call-graph-types.js'; import { type GrpcRegistration, type ImportTarget } from './grpc-registration.js'; /** `.proto` files read per build. Kept apart from the OpenAPI cap: protobuf schemas come in many small files. */ export declare const MAX_PROTO_FILES = 500; /** `synthesizedBy` on an edge bound through a gRPC server registration rather than a call site. */ export declare const GRPC_REGISTRATION_BINDING = "grpc-registration"; /** A registration that names a service, but whose implementation could not be bound. */ export interface UnresolvedRegistration { file: string; line: number; service: string; /** The RPC, when the failure is about one method rather than the whole registration. */ rpc?: string; /** * The function name the registration WROTE at this position and this projection refused to bind. * Carried so a consumer can say WHICH symbol was left unrooted — `find_dead_code` reads it to * keep an unbound handler out of its high-confidence verdicts. Set only where a literal named a * function: never for Go or Python, whose registrations name a type, not a method (the method * name there comes from the schema by convention, and claiming the registration named it would * be a false claim and a repository-wide false match). */ symbol?: string; /** * Every function name a literal handler map wrote, for a refusal decided BEFORE the map was * consulted (the service name resolved to nothing or to two declarations). Those names are * exactly what the binding would have rooted, so naming them caps precisely instead of falling * back to the whole file. */ symbols?: string[]; /** * The implementation type the registration named (`reg.implType`), when it named one. For Go and * Python the registration names a class whose methods serve the RPCs, so the class — not one * function — is what was left unbound. */ className?: string; /** * The ONE directory `className` can live in, where the projection's own scope rule proves it: a * Go registration naming an unqualified type can only mean its own package. Absent where no such * proof exists (a qualified Go type, any Python type), so a consumer narrows exactly as far as is * sound — never further, which would silently drop a cap that is owed. */ classDir?: string; reason: 'not-literal' | 'unknown-service' | 'ambiguous-service' | 'ambiguous-implementation' | 'inline-implementation' | 'implementation-not-found'; detail?: string; } export interface ProtobufProjectionInput { files: readonly { path: string; content: string; }[]; registrations: readonly GrpcRegistration[]; /** * The code functions a registration could mean by `name`: for Go and Python, the methods of * `reg.implType`; for Node, the functions of that name. The projector picks among them. */ resolveImplementation: (reg: GrpcRegistration, name: string) => readonly FunctionNode[]; /** Where an import names a function: its module, one level of re-export followed. */ importTargets?: (fromFile: string, specifier: string, name: string) => readonly ImportTarget[]; } export interface ProtobufProjection { nodes: FunctionNode[]; edges: CallEdge[]; unreadSpecifications: Array<{ file: string; reason: string; }>; unresolvedRegistrations: UnresolvedRegistration[]; /** RPCs no scanned registration bound, as `address (file:line)`. */ unboundRpcs: string[]; /** Reasons a conclusion is withheld (unread files, caps). */ notAssessed: string[]; /** Element classes outside the model (`extend`, `extensions`). Disclosed; never withholds a conclusion. */ outsideModel: string[]; /** Said after the fact: type references that drew no edge. Never withholds a conclusion. */ unresolvedTypes: number; truncations: Array<{ reason: 'operation-cap' | 'schema-cap'; cap: number; seen: number; }>; } export declare function projectProtobuf(input: ProtobufProjectionInput): ProtobufProjection; //# sourceMappingURL=project-protobuf.d.ts.map