Skip to content

@toolcog/compiler

Toolcog compiler

References

default

Renames and re-exports toolcogTransformer

Interfaces

ToolcogTransformerConfig

Properties

contextToolsImport?

optional contextToolsImport: false | [string, string]

Defined in

transformer.ts:33

embedderImport?

optional embedderImport: [string, string]

Defined in

transformer.ts:30

generatorImport?

optional generatorImport: [string, string]

Defined in

transformer.ts:29

idiomResolverImport?

optional idiomResolverImport: [string, string]

Defined in

transformer.ts:32

indexerImport?

optional indexerImport: [string, string]

Defined in

transformer.ts:31

keepIntrinsicImports?

optional keepIntrinsicImports: boolean

Defined in

transformer.ts:35

manifestFile?

optional manifestFile: string

Defined in

transformer.ts:39

standalone?

optional standalone: boolean

Defined in

transformer.ts:37

Variables

inventoryDeclarationsModuleName

const inventoryDeclarationsModuleName: "toolcog-inventory.d.ts" = "toolcog-inventory.d.ts"

Defined in

inventory.ts:239


inventoryModuleName

const inventoryModuleName: "toolcog-inventory.js" = "toolcog-inventory.js"

Defined in

inventory.ts:6

Functions

callSiteToSchema()

callSiteToSchema(ts, checker, addDiagnostic, argumentsExpression, returnType, name, comment, errorNode): FunctionSchema

Parameters

ts: __module

checker: TypeChecker

addDiagnostic

argumentsExpression: undefined | Expression

returnType: undefined | Type

name: undefined | string

comment: undefined | Comment

errorNode: undefined | Node

Returns

FunctionSchema

Defined in

schema.ts:393


createInventoryDeclarationsModule()

createInventoryDeclarationsModule(ts, factory, moduleName): SourceFile

Parameters

ts: __module

factory: NodeFactory

moduleName: string

Returns

SourceFile

Defined in

inventory.ts:241


createInventoryModule()

createInventoryModule(ts, factory, inventory): SourceFile

Parameters

ts: __module

factory: NodeFactory

inventory: Inventory<Float32Array>

Returns

SourceFile

Defined in

inventory.ts:8


defineIdiomExpression()

defineIdiomExpression(ts, host, program, factory, checker, addDiagnostic, moduleDef, idiomType, idiomResolverExpression, valueExpression, valueType, errorNode, idiomIds?): Expression

Parameters

ts: __module

host: ModuleResolutionHost

program: Program

factory: NodeFactory

checker: TypeChecker

addDiagnostic

moduleDef: ModuleDef

idiomType: Type

idiomResolverExpression: undefined | Expression

valueExpression: Expression

valueType: Type

errorNode: Node

idiomIds?: string[]

Returns

Expression

Defined in

intrinsics/define-idiom.ts:9


defineIdiomsExpression()

defineIdiomsExpression(ts, host, program, factory, checker, addDiagnostic, moduleDef, idiomType, idiomsType, idiomResolverExpression, valuesExpression, valuesType, errorNode, idiomIds?): Expression

Parameters

ts: __module

host: ModuleResolutionHost

program: Program

factory: NodeFactory

checker: TypeChecker

addDiagnostic

moduleDef: ModuleDef

idiomType: Type

idiomsType: Type

idiomResolverExpression: undefined | Expression

valuesExpression: Expression

valuesType: Type

errorNode: Node

idiomIds?: string[]

Returns

Expression

Defined in

intrinsics/define-idioms.ts:7


defineIndexExpression()

defineIndexExpression(ts, host, program, factory, checker, addDiagnostic, moduleDef, idiomType, idiomsType, idiomResolverExpression, embedderExpression, indexerExpression, callExpression): Expression

Parameters

ts: __module

host: ModuleResolutionHost

program: Program

factory: NodeFactory

checker: TypeChecker

addDiagnostic

moduleDef: ModuleDef

idiomType: Type

idiomsType: Type

idiomResolverExpression: undefined | Expression

embedderExpression: Expression

indexerExpression: Expression

callExpression: CallExpression

Returns

Expression

Defined in

intrinsics/define-index.ts:6


definePromptExpression()

definePromptExpression(ts, host, program, factory, checker, addDiagnostic, moduleDef, generatorExpression, contextToolsExpression, callExpression): Expression

Parameters

ts: __module

host: ModuleResolutionHost

program: Program

factory: NodeFactory

checker: TypeChecker

addDiagnostic

moduleDef: ModuleDef

generatorExpression: Expression

contextToolsExpression: undefined | Expression

callExpression: CallExpression

Returns

Expression

Defined in

intrinsics/define-prompt.ts:10


defineToolExpression()

defineToolExpression(ts, host, program, factory, checker, addDiagnostic, moduleDef, toolType, funcExpression, funcType, errorNode): Expression

Parameters

ts: __module

host: ModuleResolutionHost

program: Program

factory: NodeFactory

checker: TypeChecker

addDiagnostic

moduleDef: ModuleDef

toolType: Type

funcExpression: Expression

funcType: Type

errorNode: Node

Returns

Expression

Defined in

intrinsics/define-tool.ts:12


defineToolsExpression()

defineToolsExpression(ts, host, program, factory, checker, addDiagnostic, moduleDef, toolType, toolsType, funcsExpression, funcsType, errorNode): Expression

Parameters

ts: __module

host: ModuleResolutionHost

program: Program

factory: NodeFactory

checker: TypeChecker

addDiagnostic

moduleDef: ModuleDef

toolType: Type

toolsType: Type

funcsExpression: Expression

funcsType: Type

errorNode: Node

Returns

Expression

Defined in

intrinsics/define-tools.ts:7


promptExpression()

promptExpression(ts, host, program, factory, checker, addDiagnostic, moduleDef, generatorExpression, contextToolsExpression, callExpression): Expression

Parameters

ts: __module

host: ModuleResolutionHost

program: Program

factory: NodeFactory

checker: TypeChecker

addDiagnostic

moduleDef: ModuleDef

generatorExpression: Expression

contextToolsExpression: undefined | Expression

callExpression: CallExpression

Returns

Expression

Defined in

intrinsics/prompt.ts:10


signatureToSchema()

signatureToSchema(ts, checker, addDiagnostic, signature, name, comment, errorNode): FunctionSchema

Parameters

ts: __module

checker: TypeChecker

addDiagnostic

signature: Signature

name: undefined | string

comment: undefined | Comment

errorNode: undefined | Node

Returns

FunctionSchema

Defined in

schema.ts:307


toolcogTransformer()

toolcogTransformer(program, config?, extras?, host?): TransformerFactory<SourceFile>

Parameters

program: Program

config?: ToolcogTransformerConfig

extras?

extras.addDiagnostic?

extras.ts?: __module

host?: ModuleResolutionHost & object

Returns

TransformerFactory<SourceFile>

Defined in

transformer.ts:574


transformToolcog()

transformToolcog(ts, context, host, program, addDiagnostic, config): Transformer<SourceFile>

Parameters

ts: __module

context: TransformationContext

host: ModuleResolutionHost & object

program: Program

addDiagnostic

config: undefined | ToolcogTransformerConfig

Returns

Transformer<SourceFile>

Defined in

transformer.ts:42


typeToSchema()

typeToSchema(ts, checker, addDiagnostic, type, description, propertyDescriptions, errorNode): Schema

Parameters

ts: __module

checker: TypeChecker

addDiagnostic

type: Type

description: undefined | null | string

propertyDescriptions: undefined | Record<string, string>

errorNode: undefined | Node

Returns

Schema

Defined in

schema.ts:12