## Alpha API Report File for "@fluidframework/tree-agent" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts // @alpha export type Arg = readonly [ name: string, type: T ]; // @alpha export type ArgsTuple = T extends readonly [infer Single extends Arg] ? [Single[1]] : T extends readonly [infer Head extends Arg, ...infer Tail extends readonly Arg[]] ? [Head[1], ...ArgsTuple] : never; // @alpha export type AsynchronousEditor = (tree: ViewOrTree, code: string) => Promise; // @alpha export type BindableSchema = TreeNodeSchema | TreeNodeSchema | TreeNodeSchema | TreeNodeSchema; // @alpha export function buildFunc(def: { description?: string; returns: Return; rest?: Rest; }, ...args: Args): FunctionDef; // @alpha export interface Context { create: Record TreeNode>; is: Record(input: T) => input is T>; isArray(value: unknown): boolean; isMap(value: unknown): boolean; key(child: TreeNode): string | number; parent(child: TreeNode): TreeNode | undefined; root: ReadableField; } // @alpha export function createContext(tree: ViewOrTree): Context; // @alpha export function createTreeAgent(model: SharedTreeChatModel, tree: ViewOrTree, options?: TreeAgentOptions): TreeAgent; // @alpha export type Ctor = new (...args: any[]) => T; // @alpha export interface EditResult { message: string; type: "success" | "editingError" | "tooManyEditsError"; } // @alpha export function executeSemanticEditing(model: SharedTreeChatModel, tree: ViewOrTree, prompt: string, options?: ExecuteSemanticEditingOptions): Promise; // @alpha export interface ExecuteSemanticEditingOptions { domainHints?: string; editor?: SynchronousEditor | AsynchronousEditor; logger?: Logger; maximumSequentialEdits?: number; } // @alpha export interface ExposedMethods { expose>, S extends Ctor & IExposedMethods, Z extends FunctionDef>(constructor: S, methodName: K, tfFunction: Z): void; exposeMethod>, S extends Ctor & IExposedMethods, Z extends FunctionDef>(constructor: S, methodName: K, tfFunction: Z): void; } // @alpha export interface ExposedProperties { exposeProperty(constructor: S, name: K, def: { schema: TypeFactoryType; description?: string; readOnly?: boolean; }): void; exposeProperty(constructor: S, name: K, tfType: TypeFactoryType): void; } // @alpha export const exposeMethodsSymbol: unique symbol; // @alpha export const exposePropertiesSymbol: unique symbol; // @alpha export interface FunctionDef { args: Args; description?: string; rest?: Rest; returns: Return; } // @alpha export interface IExposedMethods { [exposeMethodsSymbol](methods: ExposedMethods): void; } // @alpha export interface IExposedProperties { [exposePropertiesSymbol]?(properties: ExposedProperties): void; } // @alpha export function isTypeFactoryType(value: unknown): value is TypeFactoryType; // @alpha export const llmDefault: unique symbol; // @alpha export interface Logger { log(message: string): void; } // @alpha export type MethodKeys = { [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never; }; // @alpha export class PropertyDef { constructor( name: string, description: string | undefined, schema: TypeFactoryType, readOnly: boolean); readonly description: string | undefined; readonly name: string; readonly readOnly: boolean; readonly schema: TypeFactoryType; } // @alpha export interface SharedTreeChatModel { editToolName?: string; invoke(history: readonly TreeAgentChatMessage[]): Promise; name?: string; } // @alpha export type SynchronousEditor = (tree: ViewOrTree, code: string) => void; // @alpha export interface TreeAgent { dispose(): void; message(prompt: string): Promise; } // @alpha export interface TreeAgentAssistantMessage { readonly content: string; readonly role: "assistant"; } // @alpha export type TreeAgentChatMessage = TreeAgentSystemMessage | TreeAgentUserMessage | TreeAgentAssistantMessage | TreeAgentToolCallMessage | TreeAgentToolResultMessage; // @alpha export type TreeAgentChatResponse = TreeAgentToolCallMessage | TreeAgentAssistantMessage; // @alpha export interface TreeAgentOptions { domainHints?: string; editor?: SynchronousEditor | AsynchronousEditor; logger?: Logger; maximumSequentialEdits?: number; } // @alpha export interface TreeAgentSystemMessage { readonly content: string; readonly role: "system"; } // @alpha export interface TreeAgentToolCallMessage { readonly role: "tool_call"; readonly toolArgs: Record; readonly toolCallId?: string; readonly toolName: string; } // @alpha export interface TreeAgentToolResultMessage { readonly content: string; readonly role: "tool_result"; readonly toolCallId?: string; } // @alpha export interface TreeAgentUserMessage { readonly content: string; readonly role: "user"; } // @alpha export type TreeView = Pick, "root" | "fork" | "merge" | "rebaseOnto" | "schema" | "events"> & UntypedTreeViewAlpha; // @alpha export const typeFactory: { instanceOf(schema: T): TypeFactoryInstanceOf; string(): TypeFactoryString; number(): TypeFactoryNumber; boolean(): TypeFactoryBoolean; date(): TypeFactoryDate; void(): TypeFactoryVoid; undefined(): TypeFactoryUndefined; null(): TypeFactoryNull; unknown(): TypeFactoryUnknown; array(element: TypeFactoryType): TypeFactoryArray; promise(innerType: TypeFactoryType): TypeFactoryPromise; object(shape: Record): TypeFactoryObject; record(keyType: TypeFactoryType, valueType: TypeFactoryType): TypeFactoryRecord; map(keyType: TypeFactoryType, valueType: TypeFactoryType): TypeFactoryMap; tuple(items: readonly TypeFactoryType[], rest?: TypeFactoryType): TypeFactoryTuple; union(options: readonly TypeFactoryType[]): TypeFactoryUnion; intersection(types: readonly TypeFactoryType[]): TypeFactoryIntersection; literal(value: string | number | boolean): TypeFactoryLiteral; optional(innerType: TypeFactoryType): TypeFactoryOptional; readonly(innerType: TypeFactoryType): TypeFactoryReadonly; function(parameters: readonly TypeFactoryFunctionParameter[], returnType: TypeFactoryType, restParameter?: TypeFactoryFunctionParameter): TypeFactoryFunction; }; // @alpha export interface TypeFactoryArray extends TypeFactoryType { readonly element: TypeFactoryType; // (undocumented) readonly _kind: "array"; } // @alpha export interface TypeFactoryBoolean extends TypeFactoryType { // (undocumented) readonly _kind: "boolean"; } // @alpha export interface TypeFactoryDate extends TypeFactoryType { // (undocumented) readonly _kind: "date"; } // @alpha export interface TypeFactoryFunction extends TypeFactoryType { // (undocumented) readonly _kind: "function"; readonly parameters: readonly TypeFactoryFunctionParameter[]; readonly restParameter?: TypeFactoryFunctionParameter; readonly returnType: TypeFactoryType; } // @alpha export type TypeFactoryFunctionParameter = readonly [name: string, type: TypeFactoryType]; // @alpha export interface TypeFactoryInstanceOf extends TypeFactoryType { readonly constructor: new (...args: any[]) => unknown; readonly _kind: "instanceof"; } // @alpha export interface TypeFactoryIntersection extends TypeFactoryType { // (undocumented) readonly _kind: "intersection"; readonly types: readonly TypeFactoryType[]; } // @alpha export interface TypeFactoryLiteral extends TypeFactoryType { // (undocumented) readonly _kind: "literal"; readonly value: string | number | boolean; } // @alpha export interface TypeFactoryMap extends TypeFactoryType { readonly keyType: TypeFactoryType; // (undocumented) readonly _kind: "map"; readonly valueType: TypeFactoryType; } // @alpha export interface TypeFactoryNull extends TypeFactoryType { // (undocumented) readonly _kind: "null"; } // @alpha export interface TypeFactoryNumber extends TypeFactoryType { // (undocumented) readonly _kind: "number"; } // @alpha export interface TypeFactoryObject extends TypeFactoryType { // (undocumented) readonly _kind: "object"; readonly shape: Record; } // @alpha export interface TypeFactoryOptional extends TypeFactoryType { readonly innerType: TypeFactoryType; // (undocumented) readonly _kind: "optional"; } // @alpha export interface TypeFactoryPromise extends TypeFactoryType { readonly innerType: TypeFactoryType; // (undocumented) readonly _kind: "promise"; } // @alpha export interface TypeFactoryReadonly extends TypeFactoryType { readonly innerType: TypeFactoryType; // (undocumented) readonly _kind: "readonly"; } // @alpha export interface TypeFactoryRecord extends TypeFactoryType { readonly keyType: TypeFactoryType; // (undocumented) readonly _kind: "record"; readonly valueType: TypeFactoryType; } // @alpha export interface TypeFactoryString extends TypeFactoryType { // (undocumented) readonly _kind: "string"; } // @alpha export interface TypeFactoryTuple extends TypeFactoryType { readonly items: readonly TypeFactoryType[]; // (undocumented) readonly _kind: "tuple"; readonly rest?: TypeFactoryType; } // @alpha export interface TypeFactoryType { readonly _kind: TypeFactoryTypeKind; } // @alpha export type TypeFactoryTypeKind = "string" | "number" | "boolean" | "void" | "undefined" | "null" | "unknown" | "date" | "promise" | "array" | "object" | "record" | "map" | "tuple" | "union" | "intersection" | "literal" | "optional" | "readonly" | "function" | "instanceof"; // @alpha export interface TypeFactoryUndefined extends TypeFactoryType { // (undocumented) readonly _kind: "undefined"; } // @alpha export interface TypeFactoryUnion extends TypeFactoryType { // (undocumented) readonly _kind: "union"; readonly options: readonly TypeFactoryType[]; } // @alpha export interface TypeFactoryUnknown extends TypeFactoryType { // (undocumented) readonly _kind: "unknown"; } // @alpha export interface TypeFactoryVoid extends TypeFactoryType { // (undocumented) readonly _kind: "void"; } // @alpha export type ViewOrTree = TreeView | (ReadableField & TreeNode); ```