Types
InjectionResult
TypeScript contract for InjectionResult.
What it does
TypeScript contract for InjectionResult.
Use InjectionResult to keep application code aligned with the values MemoGrafter accepts or returns at this boundary. It is a TypeScript-only contract and adds no runtime behavior.
Definition
TypeScript
interface InjectionResult {
systemPrompt: string;
nodes: TopicNode[];
memories?: MemoryNode[];
tokenCount: number;
tokenBudget?: number;
}Fields and behavior
systemPrompt is the assembled context; this operation does not itself call the chat model.nodes are selected topics and memories contains their active structured facts when included.tokenCount is the assembled size; tokenBudget is present when a budget governed assembly.Result
A compile-time-only TypeScript contract with no runtime value.
Example
example.ts
import type { InjectionResult } from "memo-grafter";
function useValue(value: InjectionResult) {
return value;
}Important behavior
Use
import type when the contract is not needed at runtime.