/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Project a flat list of `ClassificationProposal`s into a flat `AddressTree` (every proposal * becomes a root node, no containment nesting). Useful for surfacing policy-filtered output * through the existing JSON/tuple/XML decoder projections without rebuilding the original * containment hierarchy — which is intentionally lossy: once proposals are individually * accept/rejected by policy, the containment relationships from the source tree may no longer be * meaningful. * * For consumers that need containment back, re-tokenize the input and run the full decoder * pipeline. */ import type { ClassificationProposal, ClassificationProposalSource, ComponentTag } from "../types/index.ts"; import type { AddressTree } from "./types.ts"; export declare function proposalsToTree(raw: string, proposals: readonly ClassificationProposal[]): AddressTree; /** * The inverse of {@link proposalsToTree}: walk an `AddressTree` into a flat list of `ClassificationProposal`s (one per * node, depth-first), tagged with the given `source` (#478 increment 3). Used to bring the whole-text neural parse into * the arbitration layer's proposal currency so it can be unioned with rule proposals and filtered by the policy * registry. * * The spans are structural (`{ start, end, body }`) — we intentionally avoid `Span.from(...)` (which forces the * tokenization module's filesystem-bound init); downstream proposal consumers read only `start` / `end` / `body`. Same * convention as the neural proposal-classifier adapter. * * @param tree The parsed tree (e.g. the neural argmax tree). * @param source Provenance stamped on every emitted proposal (`"neural"` here). * @param opts.sourceID Optional stable id surfaced as `source_id`. * @param opts.emits Optional tag allow-list; when set, only nodes with these tags are emitted. */ export declare function treeToProposals(tree: AddressTree, source: ClassificationProposalSource, opts?: { sourceID?: string; emits?: ReadonlySet; }): ClassificationProposal[]; //# sourceMappingURL=proposals-to-tree.d.ts.map